jQuery.template("advance",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push('<div id="user-slider">   <div id="users" class="step">    <input type="text" placeholder="'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/advance.htm","Type to filter by e-mail or name"))),__.push('" class="filter" />    '),typeof users!="undefined"&&users!=null&&$.each(typeof users=="function"?users.call($item):users,function(){with(this)__.push('     <div class="user" data-key="'),typeof key!="undefined"&&key!=null&&__.push($.encode(typeof key=="function"?key.call($item):key)),__.push('" data-name="'),typeof name!="undefined"&&name!=null&&__.push($.encode(typeof name=="function"?name.call($item):name)),__.push('">       <img src="'),typeof img!="undefined"&&img!=null&&__.push($.encode(typeof img=="function"?img.call($item):img)),__.push('" alt="" />       <a href="/user/?id='),typeof key!="undefined"&&key!=null&&__.push($.encode(typeof key=="function"?key.call($item):key)),__.push('">'),typeof name!="undefined"&&name!=null&&__.push($.encode(typeof name=="function"?name.call($item):name)),__.push("<\/a>      <span>"),typeof email!="undefined"&&email!=null&&__.push($.encode(typeof email=="function"?email.call($item):email)),__.push("<\/span>     <\/div>    ")}),__.push('    <\/div>     <div id="advance" class="step form">    <div id="user">    <\/div>    <div>     <label for="amount">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/advance.htm","Amount"))),__.push('<\/label>         <input id="amount" type="text" value="$" />      <div class="aside"><span class="field-validation-error">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/advance.htm","Please provide correct amount"))),__.push('<\/span><\/div>     <\/div>         <a id="prev" href="#first"><span>&larr;&nbsp;&nbsp;'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/advance.htm","Step 1: Select user"))),__.push("<\/span><\/a>   <\/div>  <\/div>");return __});jQuery.template("transaction",function(n,$item){var $=n,__=[],i=$item.data;with(i)__.push('<img src="/user/picture?id='),typeof t.user.key!="undefined"&&t.user.key!=null&&__.push($.encode(typeof t.user.key=="function"?t.user.key.call($item):t.user.key)),__.push('" alt=""/><a href="/user?id='),typeof t.user.key!="undefined"&&t.user.key!=null&&__.push($.encode(typeof t.user.key=="function"?t.user.key.call($item):t.user.key)),__.push('" class="user">'),typeof(t.user.firstName+" "+t.user.lastName)!="undefined"&&t.user.firstName+" "+t.user.lastName!=null&&__.push($.encode(typeof(t.user.firstName+" "+t.user.lastName)=="function"?(t.user.firstName+" "+t.user.lastName).call($item):t.user.firstName+" "+t.user.lastName)),__.push('<\/a>    <div id="billingInfo" class="hidden">   <label>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transaction.htm","Billing settings"))),__.push("<\/label><span><\/span>  <\/div>    <div>   <label>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transaction.htm","Operation"))),__.push("<\/label><span>"),typeof t.type!="undefined"&&t.type!=null&&__.push(typeof t.type=="function"?t.type.call($item):t.type),__.push("<\/span>  <\/div>    <div>   <label>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transaction.htm","Date"))),__.push("<\/label><span>"),typeof t.date!="undefined"&&t.date!=null&&__.push($.encode(typeof t.date=="function"?t.date.call($item):t.date)),__.push("<\/span>  <\/div>    <div>   <label>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transaction.htm","Amount"))),__.push('<\/label><span class="'),typeof t.style!="undefined"&&t.style!=null&&__.push($.encode(typeof t.style=="function"?t.style.call($item):t.style)),__.push('">'),typeof t.amount!="undefined"&&t.amount!=null&&__.push($.encode(typeof t.amount=="function"?t.amount.call($item):t.amount)),__.push("<\/span>  <\/div>    <div>   <label>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transaction.htm","Status"))),__.push('<\/label><span id="status">'),typeof t.status!="undefined"&&t.status!=null&&__.push($.encode(typeof t.status=="function"?t.status.call($item):t.status)),__.push("<\/span>  <\/div>    "),typeof t.invoice!="undefined"&&t.invoice!=null&&(typeof t.invoice=="function"?t.invoice.call($item):t.invoice)&&(__.push('   <div class="invoice">    <label>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transaction.htm","Invoice"))),__.push("<\/label>      "),typeof(t.invoice.split(".").pop().toLowerCase()!="pdf")!="undefined"&&t.invoice.split(".").pop().toLowerCase()!="pdf"!=null&&(typeof(t.invoice.split(".").pop().toLowerCase()!="pdf")=="function"?(t.invoice.split(".").pop().toLowerCase()!="pdf").call($item):t.invoice.split(".").pop().toLowerCase()!="pdf")?(__.push('     <img data-url="'),typeof t.invoice!="undefined"&&t.invoice!=null&&__.push($.encode(typeof t.invoice=="function"?t.invoice.call($item):t.invoice)),__.push('" src="'),typeof t.invoice!="undefined"&&t.invoice!=null&&__.push($.encode(typeof t.invoice=="function"?t.invoice.call($item):t.invoice)),__.push('" />    ')):!0&&__.push('     <div class="icon-pdf"><\/div>    '),__.push('      <a href="/billing/invoice/'),typeof t.key!="undefined"&&t.key!=null&&__.push($.encode(typeof t.key=="function"?t.key.call($item):t.key)),__.push('">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transaction.htm","Download"))),__.push("<\/a>   <\/div>   ")),__.push("    <div>   "),typeof(admin&&t.status=="Processing")!="undefined"&&(admin&&t.status=="Processing")!=null&&(typeof(admin&&t.status=="Processing")=="function"?(admin&&t.status=="Processing").call($item):admin&&t.status=="Processing")?(__.push("    <label>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transaction.htm","Comment"))),__.push("<\/label><textarea>"),typeof t.comment!="undefined"&&t.comment!=null&&__.push($.encode(typeof t.comment=="function"?t.comment.call($item):t.comment)),__.push('<\/textarea><span id="comment"><\/span>     <div class="reason">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transaction.htm","Please specify the reason for rejecting the transaction."))),__.push("<\/div>   ")):typeof t.comment!="undefined"&&t.comment!=null&&(typeof t.comment=="function"?t.comment.call($item):t.comment)&&(__.push("    <label>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transaction.htm","Comment"))),__.push("<\/label><span>"),typeof t.comment!="undefined"&&t.comment!=null&&__.push($.encode(typeof t.comment=="function"?t.comment.call($item):t.comment)),__.push("<\/span>   ")),__.push("       <\/div>    "),typeof(t.status=="Processing"&&admin)!="undefined"&&(t.status=="Processing"&&admin)!=null&&(typeof(t.status=="Processing"&&admin)=="function"?(t.status=="Processing"&&admin).call($item):t.status=="Processing"&&admin)&&(__.push('    <br />   <a href="#" data-status="Complete" id="complete" class="ui-button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transaction.htm","Complete"))),__.push('<\/a>   <a href="#" data-status="Rejected" id="cancel" class="ui-button">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transaction.htm","Reject"))),__.push("<\/a>  ")),__.push("");return __});jQuery.template("transactions-partial",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push(""),typeof transactions.length!="undefined"&&transactions.length!=null&&(typeof transactions.length=="function"?transactions.length.call($item):transactions.length)&&(__.push("  "),typeof transactions!="undefined"&&transactions!=null&&$.each(typeof transactions=="function"?transactions.call($item):transactions,function(){with(this)__.push('   <tr>    <td class="date">'),typeof date!="undefined"&&date!=null&&__.push($.encode(typeof date=="function"?date.call($item):date)),__.push('<\/td>    <td class="'),typeof style!="undefined"&&style!=null&&__.push($.encode(typeof style=="function"?style.call($item):style)),__.push('">'),typeof amount!="undefined"&&amount!=null&&__.push($.encode(typeof amount=="function"?amount.call($item):amount)),__.push('<\/td>    <td class="details">'),typeof type!="undefined"&&type!=null&&__.push(typeof type=="function"?type.call($item):type),__.push("<\/td>    <td>"),typeof status!="undefined"&&status!=null&&__.push($.encode(typeof status=="function"?status.call($item):status)),__.push('<\/td>    <td class="invoice">     '),typeof invoice!="undefined"&&invoice!=null&&(typeof invoice=="function"?invoice.call($item):invoice)&&(__.push('      <i class="fa fa-file-text-o '),typeof(invoice.split(".").pop().toLowerCase()!="pdf"?"":"disabled")!="undefined"&&(invoice.split(".").pop().toLowerCase()!="pdf"?"":"disabled")!=null&&__.push($.encode(typeof(invoice.split(".").pop().toLowerCase()!="pdf"?"":"disabled")=="function"?(invoice.split(".").pop().toLowerCase()!="pdf"?"":"disabled").call($item):invoice.split(".").pop().toLowerCase()!="pdf"?"":"disabled")),__.push('" title="'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions-partial.htm","Preview"))),__.push('" data-url="'),typeof invoice!="undefined"&&invoice!=null&&__.push($.encode(typeof invoice=="function"?invoice.call($item):invoice)),__.push('"><\/i>      <a href="/billing/invoice/'),typeof key!="undefined"&&key!=null&&__.push($.encode(typeof key=="function"?key.call($item):key)),__.push('"><em class="icon icon-download" title="'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions-partial.htm","Download"))),__.push('"><\/em><\/a>     ')),__.push('    <\/td>    <td><a href="/user/?id='),typeof user.key!="undefined"&&user.key!=null&&__.push($.encode(typeof user.key=="function"?user.key.call($item):user.key)),__.push('">'),typeof(user.firstName+" "+user.lastName)!="undefined"&&user.firstName+" "+user.lastName!=null&&__.push($.encode(typeof(user.firstName+" "+user.lastName)=="function"?(user.firstName+" "+user.lastName).call($item):user.firstName+" "+user.lastName)),__.push('<\/a><\/td>    <td><a href="/billing/transaction/'),typeof key!="undefined"&&key!=null&&__.push($.encode(typeof key=="function"?key.call($item):key)),__.push('">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions-partial.htm","View"))),__.push("<\/a><\/td>   <\/tr>  ")}),__.push(" ")),__.push("");return __});jQuery.template("transactions",function(n,$item){var $=n,__=[],t=$item.data;with(t)__.push("<h3>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","Recent transactions"))),__.push("<\/h3>  "),typeof filters!="undefined"&&filters!=null&&(typeof filters=="function"?filters.call($item):filters)&&(__.push('   <label for="user">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","User"))),__.push('<\/label>  <select id="user">   <option>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","All users"))),__.push("<\/option>   "),typeof users!="undefined"&&users!=null&&$.each(typeof users=="function"?users.call($item):users,function(n,$value){with(this)__.push('    <option value="'),typeof $value.key!="undefined"&&$value.key!=null&&__.push($.encode(typeof $value.key=="function"?$value.key.call($item):$value.key)),__.push('">'),typeof $value.name!="undefined"&&$value.name!=null&&__.push($.encode(typeof $value.name=="function"?$value.name.call($item):$value.name)),__.push("<\/option>   ")}),__.push('  <\/select>   <label for="period">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","Period"))),__.push('<\/label>  <select id="period">   <option><\/option>     <option value="1">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","Today"))),__.push('<\/option>    <option value="7" selected>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","Last 7 days"))),__.push('<\/option>    <option value="30">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","Last 30 days"))),__.push('<\/option>    <option value="90">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","Last 90 days"))),__.push('<\/option>    <option value="365">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","Last year"))),__.push('<\/option>    <\/select>   <label for="status">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","Status"))),__.push('<\/label>  <select id="status">   <option selected><\/option>     <option value="0">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","Processing"))),__.push('<\/option>   <option value="1">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","Complete"))),__.push('<\/option>   <option value="2">'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","Rejected"))),__.push("<\/option>  <\/select>  ")),__.push('  <table class="knoema-table">    <thead>   <tr>    <th>'),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","Date"))),__.push("<\/th>    <th>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","Amount"))),__.push("<\/th>    <th>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","Details"))),__.push("<\/th>    <th>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","Status"))),__.push("<\/th>    <th>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","Invoice"))),__.push("<\/th>    <th>"),typeof $.R!="undefined"&&$.R!=null&&__.push($.encode($.R("~/Tmpl/billing/transactions.htm","Account"))),__.push("<\/th>    <th><\/th>   <\/tr>  <\/thead>   <tbody><\/tbody>  <\/table>");return __})