PageSourceSearch

https://ahlagala.com/lite-ui/38.0.1/js/controllers/pledgesController.js

js ahlagala.com collected 2026-09-28 00:50:20 UTC 114,587 bytes, 4 lines download raw bytes

1define("model/donation",["model/baseModel","jquery","helper"],function(BaseModel,$,helper){var Donation=BaseModel.extend({eventID:null,pledgeID:null,guestID:null,urlRoot:function(){return this.get("id")?"/events/"+this.eventID+"/lots/donations":this.pledgeID?"/events/"+this.eventID+"/pledges/"+this.pledgeID+"/donations":this.guestID?"/events/"+this.eventID+"/guests/"+this.guestID+"/donations":void 0},initialize:function(){"undefined"!=typeof arguments[1]&&"undefined"!=typeof arguments[1].eventID&&(this.eventID=arguments[1].eventID),"undefined"!=typeof arguments[1]&&"undefined"!=typeof arguments[1].pledgeID&&(this.pledgeID=arguments[1].pledgeID),"undefined"!=typeof arguments[1]&&"undefined"!=typeof arguments[1].guestID&&(this.guestID=arguments[1].guestID)},get:function(attribute,format){switch("undefined"==typeof format&&(format="normal"),attribute){case"amount":var amount=BaseModel.prototype.get.call(this,attribute);return"sortable"===format||"original"==format?amount:"float"==format?amount/100:"withoutCurrency"==format?helper.formatCurrencyString(amount/100,""):helper.formatCurrencyString(amount/100,LiteApp.getEvent().get("currency"))}return BaseModel.prototype.get.call(this,attribute)},set:function(key,val,options){var attr,attrs;if(null==key)return this;"object"==typeof key?(attrs=key,options=val):(attrs={})[key]=val,options||(options={});for(attr in attrs){var val=attrs[attr];switch(attr){case"amount":options&&!options.fetchData&&(attrs[attr]=Math.round(100*val))}}return BaseModel.prototype.set.apply(this,[attrs,options])}});return Donation}),define("tpl!templates/lots/list.html",function(){return function(obj){var __p=[];try{with(obj||{})__p.push('<div class="list"></div><div class="next-loader">    <div class="loader"></div></div><div class="loader"></div>')}catch(e){console.log(e)}return __p.join("")}}),define("tpl!templates/lots/listItem.html",function(){return function(obj){var __p=[],print=function(input,escape){escape="undefined"==typeof escape?!0:escape,escape&&(input=_.escape(input)),__p.push.call(__p,input)};try{with(obj||{})__p.push(""),isClickable()?(__p.push('<a class="list-item__wrapper">    <div class="list-item__top-image '),print(hasImagePreview()?"":"list-item__top-image--hide"),__p.push('">        <img aria-hidden="true" alt="Picture of '),"undefined"!=typeof getModel().get("title")?print(getModel().get("title")):"",__p.push('" class="off-screen" />        <div class="list-item__top-image__overlay"></div>    </div>    <div class="list-item__under-image">        <div class="list-item__under-image__title-column">            <h3 aria-hidden="true" class="list-item__under-image__title-column__number">#'),"undefined"!=typeof getModel().get("displayNumber")?print(getModel().get("displayNumber")):"",__p.push('</h3>            <h4 aria-hidden="true" class="list-item__under-image__title-column__title" data-title="'),"undefined"!=typeof getModel().get("title")?print(getModel().get("title")):"",__p.push('">'),"undefined"!=typeof getModel().get("title")?print(getModel().get("title")):"",__p.push('</h4>        </div>        <div class="list-item__under-image__subtitle-row">            <div aria-hidden="true" class=\'list-item__under-image__subtitle-row__sub1 '),""===getSubtitle1()?print("list-item__under-image__subtitle-row__sub1--empty"):getModel().isSealed()?print("list-item__under-image__subtitle-row__sub1--sealed"):"",__p.push("'>                "),""===getSubtitle1()?print("&nbsp;",!1):print(getSubtitle1()),__p.push('            </div>            <div aria-hidden="true" class=\'list-item__under-image__subtitle-row__sub2 '),getModel().isSealed()?print("list-item__under-image__subtitle-row__sub2--sealed"):"",__p.push("'                data-title=\""),print(getSubtitle2()),__p.push('" >                '),print(getSubtitle2()),__p.push("            </div>        </div>    </div></a>")):(__p.push('<div class="list-item__wrapper">    <div class="list-item__top-image '),print(hasImagePreview()?"":"list-item__top-image--hide"),__p.push('">        <img alt="Picture of '),"undefined"!=typeof getModel().get("title")?print(getModel().get("title")):"",__p.push('" class="off-screen" />        <div class="list-item__top-image__overlay"></div>    </div>    <div class="list-item__under-image">        <div class="list-item__under-image__title-column">            <h1 class="list-item__under-image__title-column__number">#'),"undefined"!=typeof getModel().get("displayNumber")?print(getModel().get("displayNumber")):"",__p.push('</h3>            <h2 class="list-item__under-image__title-column__title" data-title="'),"undefined"!=typeof getModel().get("title")?print(getModel().get("title")):"",__p.push('">'),"undefined"!=typeof getModel().get("title")?print(getModel().get("title")):"",__p.push('</h4>        </div>        <div class="list-item__under-image__subtitle-row">            <div class=\'list-item__under-image__subtitle-row__sub1 '),""===getSubtitle1()?print("list-item__under-image__subtitle-row__sub1--empty"):getModel().isSealed()?print("list-item__under-image__subtitle-row__sub1--sealed"):"",__p.push("'>                "),""===getSubtitle1()?print("&nbsp;",!1):print(getSubtitle1()),__p.push("            </div>            <div class='list-item__under-image__subtitle-row__sub2 "),getModel().isSealed()?print("list-item__under-image__subtitle-row__sub2--sealed"):"",__p.push("'                data-title=\""),print(getSubtitle2()),__p.push('" >                '),print(getSubtitle2()),__p.push("            </div>        </div>    </div></div>")),__p.push("")}catch(e){console.log(e)}return __p.join("")}}),define("views/lots/listItemView",["views/imageUnveilView","tpl!templates/lots/listItem.html","model/picture","jquery.transit"],function(ImageUnveilView,LotListItemTemplate,Picture){var LotsListItemView=ImageUnveilView.extend({template:LotListItemTemplate,className:"list-item",tagName:"div",itemLinkFunction:null,withPreview:!0,searchTerm:"",events:{"click .list-item__wrapper":"didClickItem"},getItemElement:function(){return this.$(".list-item__wrapper")},getBidElement:function(){return this.$(".list-item__under-image__subtitle-row__sub1")},getBidderElement:function(){return this.$(".list-item__under-image__subtitle-row__sub2")},getTopImagelement:function(){return this.$(".list-item__top-image")},getNumberElement:function(){return this.$(".list-item__under-image__title-column__number")},getTitleElement:function(){return this.$(".list-item__under-image__title-column__title")},getSubtitleRowElement:function(){return this.$(".list-item__under-image__subtitle-row")},templateHelpers:function(){var that=this,showMinBidForLiveLots=!0;return this.model.collection&&void 0!=this.model.collection.type&&"live"==this.model.collection.type&&(LiteApp.getEvent().get("showMinBidForLiveLots")||(showMinBidForLiveLots=!1)),{isClickable:function(){return-1==that.className.indexOf("list-item--preview")},hasImagePreview:function(){return this.withPreview},getSubtitle1:function(){return showMinBidForLiveLots?that.model.get("topBidAmountFormatted"):""},getSubtitle2:function(){return showMinBidForLiveLots?_.escape(that.model.get("topBidName")):""}}},itemPageUrl:function(){return this.itemLinkFunction(this.model.get("displayNumber"),this.searchTerm)},initialize:function(){"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].withPreview&&(this.withPreview=arguments[0].withPreview),"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].itemLinkFunction&&(this.itemLinkFunction=arguments[0].itemLinkFunction),ImageUnveilView.prototype.initialize.apply(this,arguments)},didClickItem:function(){if("function"==typeof this.itemLinkFunction){var currentList=this.model.collection.getCollectionForCurrentCategory(),position=currentList.index(this.model)+1;givergyAnalytics.trigger("item:selected",this.model,position,this.model.collection.category,document.title),this.$(".list-item__wrapper").addClass("list-item__wrapper--focused"),setTimeout(function(){this.$(".list-item__wrapper").removeClass("list-item__wrapper--focused");var path=Backbone.history.getHashWithoutQueryParameters(window.location.href),queryParams=Backbone.history.getQueryParameters(window.location.href);queryParams.scrollToItem=this.model.get("displayNumber"),window.history.replaceState({},"",LiteApp.router.toFragment(path,queryParams)),LiteApp.router.navigate(this.itemPageUrl(),{trigger:!0})}.bind(this),200)}return!1},showLoadingIndicator:function(){},hideLoadingIndicator:function(){},getFullItemTitle:function(){var title="Lot number "+this.model.get("displayNumber")+", "+this.model.get("title");return title+=", "+this.templateHelpers().getSubtitle1()+" "+this.templateHelpers().getSubtitle2()},onRender:function(){this.model.get("picture")instanceof Picture&&this.withPreview&&(this.pictureUrl=this.model.get("picture").get("thumbnailUrl")),this.withPreview||this.$el.addClass("list-item--no-image"),this._isShown&&this.didChangeWindowSize(),this.itemLinkFunction&&this.getItemElement().prop("href",this.itemPageUrl()),this.getItemElement().prop("title",this.getFullItemTitle()),ImageUnveilView.prototype.onRender.apply(this,arguments)}
1,didLoadImage:function(){if(this.getTopImagelement().css("background-image")!='url("'+this.previewImage.src+'")'){this.getTopImagelement().css("background-image",'url("'+this.previewImage.src+'")');var imageElement=this.getTopImagelement().find("img");imageElement.prop("src",this.previewImage.src),this.getTopImagelement().find(".list-item__top-image__overlay").transition({opacity:0},600,"ease-in-out")}},didNotLoadImage:function(){if(this.pictureUrl==this.model.get("picture").get("thumbnailUrl")&&(this.pictureUrl=this.model.get("picture").get("url"),this.unveiled=!1,this.unveilImage(),!this.scrollCheckInterval)){var that=this;this.scrollCheckInterval=setInterval(function(){that.unveilImage(),that.unveiled&&clearInterval(that.scrollCheckInterval)},1e3)}},adjustImageContainerSize:function(){this.withPreview&&this.getTopImagelement().height(this.getTopImagelement().width()/1.5)},didChangeWindowSize:function(){this.adjustBidderElement(),this.ellipsizeTextBox(this.getTitleElement(),!0),this.adjustImageContainerSize()},adjustBidderElement:function(){var bidHeight=this.getBidElement().outerHeight();bidHeight&&(this.getBidderElement().css("max-height",bidHeight+"px"),this.getBidderElement().css("overflow","visible"),this.ellipsizeTextBox(this.getBidderElement()))},onShow:function(){this.didChangeWindowSize(),ImageUnveilView.prototype.onShow.apply(this,arguments)}});return LotsListItemView}),define("views/lots/listView",["backbone","views/baseView","tpl!templates/lots/list.html","views/lots/listItemView","vent"],function(Backbone,BaseView,LotListTemplate,LotListItemView,vent){var LotsListView=BaseView.extend({template:LotListTemplate,className:"lotList",itemView:LotListItemView,lotsCollection:null,itemLinkFunction:null,scrollToItem:null,pageIndex:0,pageNoItems:20,scrollCheckInterval:null,initialize:function(){"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].lots&&(this.lotsCollection=arguments[0].lots,this.lotsCollection instanceof Backbone.Collection&&(this.listenTo(this.lotsCollection,"fetchStart",this.didStartFetch),this.listenTo(this.lotsCollection,"fetchEnd",this.didEndFetch),this.listenTo(this.lotsCollection,"fetchError",this.didErrorFetch))),"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].itemLinkFunction&&(this.itemLinkFunction=arguments[0].itemLinkFunction),"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].scrollToItem&&(this.scrollToItem=arguments[0].scrollToItem),BaseView.prototype.initialize.apply(this,arguments)},didEndFetch:function(){this.initializeWithLoadedCollection(),BaseView.prototype.didEndFetch.apply(this,arguments)},didErrorFetch:function(){BaseView.prototype.didErrorFetch.apply(this,arguments)},initializeWithLoadedCollection:function(){this.setCollection(this.lotsCollection.getCollectionForCurrentCategory()),0==this.collection.models.length&&this.renderNoData(),givergyAnalytics.trigger("items:list",this.collection,this.lotsCollection.category,document.title)},showCollection:function(){var ItemView,scrollToItem=this.scrollToItem;this.collection.each(function(item,index){scrollToItem?(scrollToItem==item.get("displayNumber")&&(scrollToItem=null),ItemView=this.getItemView(item),this.addItemView(item,ItemView,index),this.pageIndex=Math.floor(index/this.pageNoItems)):index>=this.pageIndex*this.pageNoItems&&index<this.pageIndex*this.pageNoItems+this.pageNoItems&&(ItemView=this.getItemView(item),this.addItemView(item,ItemView,index))},this)},appendHtml:function(collectionView,itemView){collectionView.isBuffering?(collectionView.elBuffer.appendChild(itemView.el),collectionView._bufferedChildren.push(itemView)):this.$(".list").append(itemView.el)},appendBuffer:function(collectionView,buffer){this.$(".list").append(buffer)},onShow:function(){this.lotsCollection instanceof Backbone.Collection&&(this.lotsCollection.loaded?this.initializeWithLoadedCollection():this.lotsCollection.fetchData()),BaseView.prototype.onShow.apply(this,arguments)},onBeforeItemAdded:function(view){view.itemLinkFunction=this.itemLinkFunction,BaseView.prototype.onBeforeItemAdded.apply(this,arguments)},onCompositeCollectionRendered:function(){this.collection instanceof Backbone.Collection&&this.collection.loaded&&this.scrollToItem&&this.children.each(function(child){child.model.get("displayNumber")==this.scrollToItem&&(this.scrollToItem=null,vent.trigger("scroll:content:view:to:element",child.$el,!1))},this),this.collection instanceof Backbone.Collection&&this.collection.loaded&&this.children.length<this.collection.models.length&&(this.showLoadingNextRowsIndicator(),this.scrollCheckInterval=setInterval(function(){this.loadNextResults()}.bind(this),100))},showLoadingNextRowsIndicator:function(){this.$(".next-loader").show()},hideLoadingNextRowsIndicator:function(){this.$(".next-loader").hide()},loadNextResults:function(){var wt=$(document).scrollTop(),th=20,wb=wt+window.innerHeight,et=this.$el.offset().top,eb=et+this.$el.height(),shouldLoadNextResults=wb>=eb-th,noPages=Math.ceil(this.collection.models.length/this.pageNoItems);if(shouldLoadNextResults&&this.pageIndex<noPages-1){clearInterval(this.scrollCheckInterval),this.pageIndex++;{(new Date).getTime()}
1this.startBuffering(),this.showCollection(),this.endBuffering(),this.pageIndex<noPages-1?this.scrollCheckInterval=setInterval(function(){this.loadNextResults()}.bind(this),100):this.hideLoadingNextRowsIndicator()}},onClose:function(){this.scrollCheckInterval&&clearInterval(this.scrollCheckInterval)}});return LotsListView}),define("views/pledges/listItemView",["views/lots/listItemView"],function(LotsListItemView){var PledgesListItemView=LotsListItemView.extend({onRender:function(){LotsListItemView.prototype.onRender.apply(this,arguments),this.model.get("showRaised")||(this.getBidElement().html(""),this.getBidderElement().html("").attr("data-title",""))},itemPageUrl:function(){return this.itemLinkFunction(this.model)},getFullItemTitle:function(){var title="Pledge number "+this.model.get("displayNumber")+", "+this.model.get("title");return title+=", "+this.templateHelpers().getSubtitle1()+" "+this.templateHelpers().getSubtitle2()}});return PledgesListItemView}),define("views/pledges/listView",["views/lots/listView","views/pledges/listItemView"],function(LotsListView,PledgesListItemView){var PledgeListView=LotsListView.extend({itemView:PledgesListItemView,initialize:function(){"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].pledges&&(arguments[0].lots=arguments[0].pledges),LotsListView.prototype.initialize.apply(this,arguments)},didEndFetch:function(){var collection=this.lotsCollection.getCollectionForCurrentCategory();1==collection.models.length?LiteApp.router.navigate(this.itemLinkFunction(this.lotsCollection.models[0]),{trigger:!0}):LotsListView.prototype.didEndFetch.apply(this,arguments)}});return PledgeListView}),define("tpl!templates/lots/item.html",function(){return function(obj){var __p=[],print=function(input,escape){escape="undefined"==typeof escape?!0:escape,escape&&(input=_.escape(input)),__p.push.call(__p,input)};try{with(obj||{})__p.push('<div class="itemPreviewView__header"></div><hr class="itemPreviewView__separator" /><div class="itemPreviewView__body">    <div class="itemPreviewView__body__row1">        <div class="itemPreviewView__body__row1__col1">                <div class="itemPreviewView__photo ignore-scroll gallery">                    <div class="gallery__scroller"></div>                    <div class="gallery__overlay"></div>                </div>        </div>        <div class="itemPreviewView__body__row1__col2">            <div class="itemPreviewView__body__row1__col2__row1 itemPreviewView__bid-info">                <div class="itemPreviewView__bid-info__row time-left">                    <div class="itemPreviewView__bid-info__row__label">                        '),print(locale.lots.item.time_left,!1),__p.push(':                    </div>                    <div class="itemPreviewView__bid-info__row__value time-left-value">                    </div>                </div>                <div class="itemPreviewView__bid-info__row current-bid">                    <div class="itemPreviewView__bid-info__row__label">                        '),getModel().isSealed()?print(locale.lots.item.total_no_bids,!1):print(locale.lots.item.current_bid,!1),__p.push(':                    </div>                    <div class="itemPreviewView__bid-info__row__value">                        '),"undefined"!=typeof getModel().get("topBidAmount")?print(getModel().get("topBidAmount")):"",__p.push('                    </div>                </div>                <div class="itemPreviewView__bid-info__row minimum-donation">                    <div class="itemPreviewView__bid-info__row__label">                        '),print(locale.pledges.item.minium_donation,!1),__p.push(':                    </div>                    <div class="itemPreviewView__bid-info__row__value">                        '),"undefined"!=typeof getModel().get("minimum")?print(getModel().get("minimum")):"",__p.push('                    </div>                </div>                <div class="itemPreviewView__bid-info__row fixed-donation">                    <div class="itemPreviewView__bid-info__row__label">                        '),print(locale.pledges.item.fixed_donation,!1),__p.push(':                    </div>                    <div class="itemPreviewView__bid-info__row__value">                        '),"undefined"!=typeof getModel().get("minimum")?print(getModel().get("minimum")):"",__p.push('                    </div>                </div>                <div class="itemPreviewView__bid-info__row buy-now-price">                    <div class="table-cell itemPreviewView__bid-info__row__label">                        '),print(locale.lots.item.purchase_price,!1),__p.push(':                    </div>                    <div class="table-cell itemPreviewView__bid-info__row__value">                        '),"undefined"!=typeof getModel().get("buyNowPrice")?print(getModel().get("buyNowPrice")):"",__p.push('                    </div>                </div>                <div class="itemPreviewView__bid-info__row minimum-bid">                    <div class="itemPreviewView__bid-info__row__label">                        '),getModel().isSealed()?print(locale.lots.item.sealed_min_bid,!1):print(locale.lots.item.minimum_bid,!1),__p.push(':                    </div>                    <div class="itemPreviewView__bid-info__row__value">                        '),"undefined"!=typeof getModel().get("currentMinimum")?print(getModel().get("currentMinimum")):"",__p.push('                    </div>                </div>            </div>            <div class="itemPreviewView__body__row1__col2__row2 itemPreviewView__bid-form">                <form data-abide="ajax" data-live-validate="false" class="place-bid-form" role="form" aria-label="Place Bid" >                    <div class="row-flex-center auction-open">                        <div class="itemPreviewView__bid-info__row__label comment-label">                            '),print(locale.lots.item.add_comment,!1),__p.push('                        </div>                        <div class="small-12 columns no-padding comment">                            <div class="textAreaRow">                                <label class="text-area text-area--small" for="place-bid-form-comment">                                    <textarea                                            name="comment"                                            data-max-length="255"                                            data-max-goal="255"                                            placeholder="'),print(locale.lots.item.add_comment_placeholder,!1),__p.push('"                                            class="text-area__field text-area__field--empty"                                            id="place-bid-form-comment"                                    />                                </label>                            </div>                        </div>                        <div class="small-flex columns no-padding">                            <div class="row-flex-center amount-wrapper">                                <div class="small-auto columns currency-wrapper">
1                                    <span class="currency">'),print(LiteApp.getEvent().get("currency")),__p.push('</span>                                </div>                                <div class="small-flex columns no-padding input-wrapper" >                                    <label id="place-bid-amount-label" for="place-bid-amount" class="off-screen" >'),print(getBidPlaceholderText()),__p.push('</label>                                    <input aria-describedby="place-bid-error-label"                                           id="place-bid-amount"                                           type="tel"                                           pattern="[0-9,.]*"                                           name="amount"                                           autocomplete="off"                                           placeholder="'),print(getBidPlaceholderText()),__p.push('"                                           data-abide-validator="bidIsValid"                                           data-abide-disable-pattern="true" />                                    <small class="error" id="place-bid-error-label" ></small>                                </div>                            </div>                        </div>                        <div class="small-auto columns  no-padding-right">                            <button type="button" name="placeBid" class="a-button a-button--round" data-title="'),print(getBidButtonText()),__p.push('" >                                <div class="a-button__label">'),print(getBidButtonText()),__p.push('</div>                            </button>                        </div>                    </div>                    <div class="auction-closed text-center">                        <h3>'),print(getClosedAuctionText()),__p.push('</h3>                    </div>                </form>                <form data-abide="ajax" data-live-validate="false" action="#" class="buy-now-form" >                    <div class="auction-open">                        <div class="itemPreviewView__bid-info__row__label comment-label">                            '),print(locale.lots.item.add_comment,!1),__p.push('                        </div>                        <div class="small-12 columns no-padding comment">                            <div class="textAreaRow">                                <label class="text-area text-area--small" for="buy-now-form-comment">                                    <textarea                                            name="comment"                                            data-max-length="255"                                            data-max-goal="255"                                            placeholder="'),print(locale.lots.item.add_comment_placeholder,!1),__p.push('"                                            class="text-area__field text-area__field--empty"                                            id="buy-now-form-comment"                                    />                                    </label>                                </div>                        </div>                        <button type="button" name="buyNow"  class="a-button a-button--round" data-title="'),print(getBidButtonText()),__p.push('" >                            <div class="a-button__label">'),print(getBidButtonText()),__p.push('</div>                        </button>                    </div>                    <div class="auction-closed text-center">                        <h3>'),print(getClosedAuctionText()),__p.push('</h3>                    </div>                </form>            </div>        </div>    </div>    <div class="itemPreviewView__body__row2">            <div class="itemPreviewView__body__row2__row1">                <div class="itemPreviewView__body__row2__row1__col1 itemPreviewView__description">                    '),"undefined"!=typeof getModel().get("description")?print(getModel().get("description"),!1):"",__p.push("                 </div>                 "),shouldShowComments()&&__p.push('                    <div class="itemPreviewView__body__row2__row1__col2">                    </div>                 '),__p.push('            </div>            <div class="itemPreviewView__donated_by">                '),"undefined"!=typeof getModel().get("donatedBy")?print(getModel().get("donatedBy"),!1):"",__p.push('            </div>            <hr class="itemPreviewView__body__row2__separator itemPreviewView__separator" />            <div class="itemPreviewView__body__row2__row2 itemPreviewView__social socialButtons">                <div class="socialButtons__title">                    '),print(locale.lots.item.share,!1),__p.push(':                </div>                <div class="socialButtons__buttons">                    <a title="Share on Facebook (opens new window)" href="javascript:void(0);" target="_blank" class="socialButtons__buttons__button facebook-share-link facebook-button facebook-share">                        '),print(getFacebookIconSVG(),!1),__p.push('                        <sp
1an aria-hidden="true">'),print(locale.lots.item.share_with_facebook,!1),__p.push('</span>                    </a>                    <a title="Share on Twitter (opens new window)" href="javascript:void(0);" class="socialButtons__buttons__button twitter-share-link twitter-button twitter-share">                        '),print(getTwitterIconSVG(),!1),__p.push('                        <span aria-hidden="true">'),print(locale.lots.item.share_with_twitter,!1),__p.push("</span>                        <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>                    </a>                    <a title=\"Share via Email (opens new window)\" href=\"javascript:void(0);\" class=\"socialButtons__buttons__button email-share-link email-button email-share\" >                        "),print(getEmailIconSVG(),!1),__p.push('                        <span aria-hidden="true">'),print(locale.lots.item.share_with_email,!1),__p.push('</span>                    </a>                    <a title="Share via WhatsApp (opens new window)" class="socialButtons__buttons__button whatsapp-share-link whatsapp-button whatsapp-share" href="javascript:void(0);">                        '),print(getWhatsAppIconSVG(),!1),__p.push('<span aria-hidden="true">'),print(locale.lots.item.share_with_whatsapp,!1),__p.push('</span>                    </a>                    <a title="Share via Snapchat (opens new window)"                       class="socialButtons__buttons__button snapchat-share-link snapchat-button snapchat-share snapchat-share-button" >                        '),print(getSnapchatIconSVG(),!1),__p.push('                        <span aria-hidden="true">'),print(locale.lots.item.share_with_snapchat,!1),__p.push('</span>                    </a>                </div>            </div>    </div></div><div class="loader"></div>')}catch(e){console.log(e)}return __p.join("")}}),define("views/lots/bidAmountInterface",["vent","foundation.abide","helper","model/aria"],function(vent,FoundationAbide,helper,aria){var BidAmountInterface={events:{"change [name=amount]":"validateBidInput","keyup  [name=amount]":"validateBidInput","focus  [name=amount]":"didFocusOnPlaceBidAmount","blur   [name=amount]":"didBlurOnPlaceBidAmount"},validateBidInput:function(el){var keyPressed=el.which||0,$el=$(el);if(keyPressed!=aria.KeyCode.TAB){"undefined"!=typeof el.target&&(el=el.target,$el=$(el));var reg=FoundationAbide.settings.patterns.currency_higher_than_zero,start=el.selectionStart,end=el.selectionEnd,val_len=el.value.length,successAria=function(){$el.removeAttr("aria-invalid").removeAttr("role"),$el.attr("aria-describedby")&&$el.attr("aria-describedby",$el.attr("aria-describedby").replace(errorLabel.attr("id"),"")),errorLabel.attr("aria-hidden","true")},errorAria=function(){errorLabel.attr("aria-hidden","false"),errorLabel.attr("role","alert"),$el.attr(this.invalid_attr,"true"),$el.attr("aria-describedby")&&$el.attr("aria-describedby",$el.attr("aria-describedby").replace(errorLabel.attr("id"),"")+" "+errorLabel.attr("id")),setTimeout(function(){errorLabel.removeAttr("role")},1e3)},value=$el.val(),errorLabel=$el.parent().find("small.error");if(reg.test(value)){""!=$.trim(value)&&(value=helper.formatCurrencyString(value),$el.val(value),value.length>val_len?(start++,end++):value.length<val_len&&(start--,end--)),0!=keyPressed&&el.setSelectionRange(start,end);var value=parseFloat($el.val().replace(/,/g,""));if(_.isNaN(value)&&(value=0),value>=this.model.get("currentMinimum","float"))return $el.parent().hasClass("error")&&$el.parent().removeClass("error"),$el.hasClass("error")&&$el.removeClass("error"),successAria(),!0;$el.parent().find("small.error").html(this.getBidMinAmountErrorMessage()),errorAria()}else $el.parent().find("small.error").html(this.getBidIncorrectAmountErrorMessage()),errorAria();return $el.parent().hasClass("error")||($el.parent().addClass("error"),errorAria()),!1}},getBidMinAmountErrorMessage:function(){return locale.lots.item.place_bid_min_amount_error},getBidIncorrectAmountErrorMessage:function(){return locale.lots.item.place_bid_amount_error},getBidFormElement:function(){},getLastBidInfoRowElement:function(){},removeFixedClassFromBidFormElement:function(){},onRender:function(){this._super(),vent.trigger("rebind:foundation:events",{abide:{validators:{bidIsValid:_.bind(this.validateBidInput,this)}}})},didFocusOnPlaceBidAmount:function(){var itemElement=this.getBidFormElement();itemElement.addClass("focused")},didBlurOnPlaceBidAmount:function(){var itemElement=this.getBidFormElement();itemElement.removeClass("focused")}};return BidAmountInterface}),!function(a){"function"==typeof define&&define.amd?define("jquery.character-counter",["jquery","underscore"],a):a(jQuery,_)}(function($,_){return $.fn.extend({counter:function(settings){var defaults={type:"char",count:"down",goal:45,max:50,text:!0,target:!1,append:!0,translation:"",msg:"",containerClass:"",forceCutAboveMax:!1};settings=$.extend({},defaults,settings);var methods=function($obj,options){var $countObj="",countIndex="",noLimit=!1,objID=$obj.attr("id"),counterID=objID+"_count";$obj.attr("data-max-length")&&(options.max=$obj.attr("data-max-length")),$obj.attr("data-max-length")&&(options.goal=$obj.attr("data-max-goal"));var bind=function($obj){$obj.on("keypress.counter keydown.counter keyup.counter blur.counter focus.counter change.counter paste.counter",updateCounter),$obj.on("keydown.counter",doStopTyping),$obj.trigger("keydown")
2},isLimitless=function(){return"sky"===options.goal?(options.count="up",noLimit=!0):void 0},setMsg=function(){if(""!==options.msg)return options.msg;if(options.text===!1)return"";if(noLimit)return""!==options.msg?options.msg:"";switch(this.text=options.translation||"character word left max",this.text=this.text.split(" "),this.chars="s ( )".split(" "),this.msg=null,options.type){case"char":options.count===defaults.count&&options.text?this.msg=this.text[0]+this.chars[1]+this.chars[0]+this.chars[2]+" "+this.text[2]:"up"===options.count&&options.text&&(this.msg=this.text[0]+this.chars[0]+" "+this.chars[1]+options.goal+" "+this.text[3]+this.chars[2])}return this.msg},updateCounter=function(){$value="",$value=null!=$(this).attr("content-value")?$(this).attr("content-value"):"true"==$(this).attr("contentEditable")?$(this).text():$(this).val(),"char"===options.type&&("down"===options.count?(countIndex=options.goal-$value.length,$countObj.text(options.text?countIndex:countIndex+"/"+options.goal),options.goal-$value.length<0?passedGoal($(this)):notReachedGoal($(this)),options.max-$value.length<0&&passedMax($(this))):"up"===options.count&&(countIndex=$value.length,$countObj.text(countIndex+"/"+options.goal),countIndex>options.goal?passedGoal($(this)):notReachedGoal($(this)),countIndex>options.max&&passedMax($(this))))},doStopTyping=function(e){var keys=[46,8,9,35,36,37,38,39,40,32];return isMaxReached(e)&&e.keyCode!==keys[0]&&e.keyCode!==keys[1]&&e.keyCode!==keys[2]&&e.keyCode!==keys[3]&&e.keyCode!==keys[4]&&e.keyCode!==keys[5]&&e.keyCode!==keys[6]&&e.keyCode!==keys[7]&&e.keyCode!==keys[8]?options.type===defaults.type?!1:e.ke
2yCode!==keys[9]&&e.keyCode!==keys[1]&&options.type!=defaults.type:void 0},isMaxReached=function(e){if(noLimit)return!1;var $value="true"==$(e.target).attr("contentEditable")?$(e.target).text():$(e.target).val();return"down"===options.count?options.max-$value.length<=0:countIndex>=options.max},passedMax=function($obj){var userInput=$obj.val();"char"===options.type&&options.forceCutAboveMax&&($obj.val(userInput.substring(0,options.max)),updateCounter.call($obj.get(0)))},passedGoal=function($obj){$countObj.addClass("max"),$obj.trigger("passed-goal")},notReachedGoal=function($obj){$countObj.removeClass("max"),$obj.trigger("not-passed-goal")};isLimitless(),$countObj=$("<span id="+counterID+"/>");var counterDiv=$("<div class='input-counter'/>").attr("id",objID+"_counter").append($countObj).append(" "+setMsg());options.containerClass&&options.containerClass.length&&counterDiv.addClass(options.containerClass),options.target&&$(options.target).length?options.append?$(options.target).append(counterDiv):$(options.target).prepend(counterDiv):options.append?counterDiv.insertAfter($obj):counterDiv.insertBefore($obj),$obj.attr("aria-controls",objID+"_counter"),bind($obj)};return this.each(function(){var options=_.clone(settings);new methods($(this),options)})}}),$}),define("views/lots/itemView",["views/imageUnveilView","tpl!templates/lots/item.html","vent","underscore","marionette","views/lots/listItemView","views/lots/bidAmountInterface","views/windowScrollInterface","views/comments/listView","views/socialSharingButtons","helper","foundation.abide","slick","jquery.transit","jquery.character-counter","snapchat"],function(ImageUnveilView,LotItemTemplate,vent,_,Marionette,ListItemView,BidAmountInterface,WindowScrollInterface,CommentsListView,SocialSharingButtons,helper,FoundationAbide,slick,$){var ImageUnveilViewWithBidAmountInterface=ImageUnveilView.extend(BidAmountInterface),ImageUnveilViewWithBidAmountInterfaceAndWindowScrollInterface=ImageUnveilViewWithBidAmountInterface.extend(WindowScrollInterface),LotItemView=ImageUnveilViewWithBidAmountInterfaceAndWindowScrollInterface.extend({template:LotItemTemplate,className:"itemPreviewView",itemLinkFunction:null,itemType:"auction",events:{"change [name=add-to-favourites]":"didClickAddToFavourites","click .big-preview":"didClickPreviewImage","click .place-bid-form .a-button":"didClickPlaceBidButton","click .buy-now-form .a-button":"didClickBuyNowButton","focus textarea.text-area__field":"didFocusOnTextArea","blur textarea.text-area__field":"didBlurOnTextArea","keyup textarea.text-area__field":"didKeyUpOnTextArea"},getHeaderElement:function(){return this.$(".itemPreviewView__header")},getDescriptionElement:function(){return this.$(".itemPreviewView__description")},getCol2Element:function(){return this.$(".itemPreviewView__body__col2")},getPreviewImageElement:function(){return this.$(".itemPreviewView__photo")},getPreviewImageScrollerElement:function(){return this.$(".gallery__scroller")},getPreviewImageOverlayElement:function(){return this.$(".gallery__overlay")},getBidFormElement:function(){return this.$(".itemPreviewView__bid-form")},getBidInfoElement:function(){return this.$(".itemPreviewView__bid-info")},getOpenBidFormElement:function(){return this.getPlaceBidFormElement().find(".auction-open")},getClosedBidFormElement:function(){return this.getPlaceBidFormElement().find(".auction-closed")},getPlaceBidFormElement:function(){return this.$(".place-bid-form")},getBuyNowFormElement:function(){return this.$(".buy-now-form")},getOpenBuyNowFormElement:function(){return this.getBuyNowFormElement().find(".auction-open")},getClosedBuyNowFormElement:function(){return this.getBuyNowFormElement().find(".auction-closed")},getLastBidInfoRowElement:function(){return this.getBidInfoElement().find(".itemPreviewView__bid-info__row:visible:last")},getCommentsListElement:function(){return this.$(".itemPreviewView__body__row2__row1__col2")},getSocialButtonsContainer:function(){return this.$(".socialButtons")},shouldShowCommentsSection:function(){return LiteApp.getEvent().isGuestCommentsEnabled()&&this.model.isBuyNow()},templateHelpers:function(){var that=this;return{shouldShowComments:function(){return LiteApp.getEvent().isGuestCommentsEnabled()},getClosedAuctionText:function(){var closeLabel="";return closeLabel=0==that.model.get("numberAvailable")?locale.lots.item.auction_sold_out:that.model.isBeforeOpen()?locale.lots.item.auction_before_open+" - "+that.model.get("startTime").format("DD MMM"):locale.lots.item.auction_closed},getBidButtonText:function(){return that.model.get("buyNow")?locale.lots.item.buy_now_button:locale.lots.item.place_bid_button},getBidPlaceholderText:function(){return locale.lots.item.place_bid_amount_placeholder},getBidErrorText:function(){return locale.lots.item.place_bid_min_amount_error}}},initialize:function(){"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].itemLinkFunction&&(this.itemLinkFunction=arguments[0].itemLinkFunction),this.shouldShowCommentsSection()&&(this.commentsListView=new CommentsListView({collection:arguments[0].comments})),this._super.apply(this,arguments),this.socialButtonsView=new SocialSharingButtons({getEmailSubject:this.getEmailSubject.bind(this),getEmailCopy:this.getEmailCopy.bind(this),getTwitterCopy:this.getTwitterCopy.bind(this),getWhatsAppCopy:this.getWhatsAppCopy.bind(this),previewImage:this.previewImage,utm_source:this.itemType,getHash:function(){return this.model.getHash()}.bind(this)})},didClickPreviewImage:function(){this.$(".thumbnails .thumbnail").first().click()},didClickAddToFavourites:function(){this.$("[name=add-to-favourites]").is(":checked")?LiteApp.guest.addLotToFavourites(this.model):LiteApp.guest.removeLotFromFavourites(this.model)},didFocusOnTextArea:function(e){var fieldElement=$(e.target);fieldElement.addClass("text-area__field--focused").closest(".text-area").addClass("text-area--focused")},didBlurOnTextArea:function(e){var fieldElement=$(e.target);fieldElement.removeClass("text-area__field--focused").closest(".text-area").removeClass("text-area--focused"),this.autoValidate&&$(e.target).closest("form").trigger("validate")},didKeyUpOnTextArea:function(e){""!=$(e.target).val()?$(e.target).removeClass("text-area__field--empty"):$(e.target).addClass("text-area__field--empty")},getBidAmountValue:function(){return parseInt(this.getBidFormElement().find("[name=amount]").val().toString().replace(/,/g,""))},formIsValid:function(e){var form=$(e.target),that=this,lotCategory=null,currentList=null;"undefined"!=typeof that.model.collection?(currentList=that.model.collection.getCollectionForCurrentCategory(),lotCategory=that.model.collection.category):(currentList=LiteApp.lotsCollection,lotCategory=locale.lots.categories.all_lots);var list_position=currentList.index(that.model)+1,comment=form.find("[name=comment]").val();if(LiteApp.guest.isLogged())if(this.model.get("buyNow"))LiteApp.router.navigate(LiteApp.router.getConfirmBidLink(that.model.get("id"),that.model.get("buyNowPrice","float"),"buy_now",comment),{trigger:!0}),$.jStorage.set("last:item:in:cart",{model:that.model,quantity:1,price:that.model.get("buyNowPrice","float"),position:list_position,category:lotCategory,type:"buy_now"}),givergyAnalytics.trigger("item:added",that.model,1,that.model.get("buyNowPrice","float"),list_position,lotCategory);else{var bidAmount=this.getBidAmountValue();LiteApp.router.navigate(LiteApp.router.getConfirmBidLink(that.model.get("id"),bidAmount,that.model.get("bidMode")),{trigger:!0}),$.jStorage.set("last:item:in:cart",{model:that.model,quantity:1,price:bidAmount,position:list_position,category:lotCategory,type:"bid"}),givergyAnalytics.trigger("item:added",that.model,1,bidAmount,list_position,lotCategory)}else if(this.model.get("buyNow"))LiteApp.router.navigate(LiteApp.router.getCheckReg
2istrationLink(Backbone.history.fragment,LiteApp.router.getConfirmBidLink(that.model.get("id"),that.model.get("buyNowPrice","float"),"buy_now",comment)),{trigger:!0}),$.jStorage.set("last:item:in:cart",{model:that.model,quantity:1,price:that.model.get("buyNowPrice","float"),position:list_position,category:lotCategory,type:"buy_now"}),givergyAnalytics.trigger("item:added",that.model,1,that.model.get("buyNowPrice","float"),list_position,lotCategory);else{var bidAmount=this.getBidAmountValue();LiteApp.router.navigate(LiteApp.router.getCheckRegistrationLink(Backbone.history.fragment,LiteApp.router.getConfirmBidLink(that.model.get("id"),parseInt(form.find("[name=amount]").val().toString().replace(/,/g,"")),that.model.get("bidMode"))),{trigger:!0}),$.jStorage.set("last:item:in:cart",{model:that.model,quantity:1,price:bidAmount,position:list_position,category:lotCategory,type:"bid"}),givergyAnalytics.trigger("item:added",that.model,1,bidAmount,list_position,lotCategory)}return!1},configureBuyingForm:function(){this.model.get("silent")?this.model.get("buyNow")?(this.getPlaceBidFormElement().hide(),this.model.canBid()?this.getClosedBuyNowFormElement().hide():this.getOpenBuyNowFormElement().hide()):(this.getBuyNowFormElement().hide(),this.model.canBid()?this.getClosedBidFormElement().hide():this.getOpenBidFormElement().hide()):this.getBidFormElement().hide()},onRender:function(){this._super(),this.model instanceof Backbone.Model&&this.model.loaded&&(this.listItemView=new ListItemView({model:this.model,itemLinkFunction:this.itemLinkFunction,withPreview:!1,className:"list-item--preview"}),this.listItemView.render(),this.getHeaderElement().html(this.listItemView.el),this._isShown&&Marionette.triggerMethod.call(this.listItemView,"show"),this.commentsListView instanceof CommentsListView&&(this.commentsListView.render(),this.getCommentsListElement().html(this.commentsListView.el),this._isShown&&Marionette.triggerMethod.call(this.commentsListView,"show")),this.shouldShowCommentsSection()||(this.$(".comment").hide(),this.$(".comment-label").hide()),this.$(".minimum-donation").hide(),this.$(".fixed-donation").hide(),this.model.get("buyNow")?(this.$(".current-bid").hide(),this.$(".minimum-bid").hide()):this.$(".buy-now-price").hide(),0==this.model.get("bidCount")&&this.$(".current-bid").hide(),this.getLastBidInfoRowElement().addClass("itemPreviewView__bid-info__row--last"),this.pictureUrl||this.getPreviewImageElement().hide(),this.model.get("silent")||this.getBidInfoElement().hide(),this.configureBuyingForm(),this.setHeightForImage(),this.configureCountdown(),helper.configureCharacterCounters(this),this.renderSocialButtons(),helper.initializeSnapchat()),this.$el.attr("id",this.cid)},renderSocialButtons:function(){this.socialButtonsView.render(),this.getSocialButtonsContainer().html(this.socialButtonsView.el),this.socialButtonsView.$el.addClass(this.getSocialButtonsContainer().get(0).className),this.socialButtonsView.$el.unwrap(),this._isShown&&Marionette.triggerMethod.call(this.socialButtonsView,"show")},setHeightForImage:function(){var height=Math.floor(2*this.getPreviewImageElement().width()/3);this.getPreviewImageElement().height(height)},configureCountdown:function(){this.model.isOpen()&&this.model.get("silent")?this.calculateTimer():this.getBidInfoElement().hide()},calculateTimer:function(){if(this.$(".time-left-value").html(this.model.get("timeLeft")),this.model.get("timeLeft","seconds")>0){var that=this,element=this.$(".time-left-value");this.timeoutHandler=this.startAnimate([{interval:300,run:function(){var label=((new Date).getTime(),that.model.get("timeLeft"));that.model.get("timeLeft","seconds")>0?element.html(label):(element.html("Ended"),that.$(".time-left").transition({opacity:0},500,"ease-in-out",function(){$(this).hide()}),that.stopAnimate(),that.getClosedBidFormElement().show(),that.getOpenBidFormElement().hide());var lastX=parseInt(element.css("left")),parentWidth=element.parent().width(),elementWidth=element.width(),newX=Math.floor(parentWidth-elementWidth);isNaN(lastX)&&(lastX=newX);var diff=newX-lastX;element.css({position:"absolute",left:(Math.abs(diff)>5?newX:lastX)+"px"})}}])}},didEndFetch:function(){this.initializeWithLoadedModel(),this._super.apply(this,arguments)},initializeWithLoadedModel:function(){this.pictureUrl=this.model.get("picture").get("largeUrl");var lotCategory=null;lotCategory="undefined"!=typeof this.model.collection?this.model.collection.category:locale.lots.categories.all_lots,givergyAnalytics.trigger("item:viewed",this.model,lotCategory)},didNotLoadImage:function(){this.pictureUrl==this.model.get("picture").get("largeUrl")&&(this.pictureUrl=this.model.get("picture").get("url"),this.unveiled=!1,this.unveilImage())},didLoadImage:function(){this.adjustImageContainerSize(),this.renderImageGallery(),this.getPreviewImageOverlayElement().transition({opacity:0}
2,500,"ease-in-out",function(){this.getPreviewImageOverlayElement().hide()}.bind(this))},adjustImageContainerSize:function(){if(this.unveiled){var height=Math.floor(2*this.getPreviewImageElement().width()/3);this.getPreviewImageElement().stop().animate({height:height},500,function(){this.didFinishAnimateImageContainer()}.bind(this))}},didFinishAnimateImageContainer:function(){this.getPreviewImageScrollerElement().slick("unload").slick("reinit")},didChangeWindowSize:function(){this.adjustImageContainerSize(),this.didScrollWindow()},onShow:function(){this.listItemView instanceof ListItemView&&this.listItemView._isRendered&&Marionette.triggerMethod.call(this.listItemView,"show"),this.commentsListView instanceof CommentsListView&&this.commentsListView._isRendered&&Marionette.triggerMethod.call(this.commentsListView,"show"),this.model instanceof Backbone.Model&&(this.model.loaded?this.initializeWithLoadedModel():this.model.fetchData()),Marionette.triggerMethod.call(this.socialButtonsView,"show"),this._super()},onBeforeHide:function(){this.stopAnimate(),this.undelegateEvents()},renderImageGallery:function(){var picturesCollection=this.model.get("pictures","collection");if(picturesCollection instanceof Backbone.Collection&&picturesCollection.length>0){for(var slider="",i=0;i<picturesCollection.length;i++)slider+='<div class="gallery__scroller__item" data-lazy="'+picturesCollection.models[i].get("largeUrl")+'" ><img alt="Picture '+(i+1)+" of "+picturesCollection.length+" for "+this.model.get("title")+'" class="off-screen" /></div>';this.getPreviewImageScrollerElement().append(slider);var mq=matchMedia(Foundation.media_queries.medium),slickConfig={};mq.matches&&(slickConfig.autoplay=!0),this.getPreviewImageScrollerElement().slick(slickConfig)}},getLinkUrl:function(source,medium){var winLocation=window.location.href;return winLocation+helper.getURLParamSeparator(winLocation)+helper.serialiseObjToURLParams(helper.getUTMParams(source,medium))},getEmailSubject:function(){return locale.lots.item.email_subject.replace("[EVENT_NAME]",LiteApp.getEvent().get("name")).replace("[WEBSITE_DOMAIN]",helper.getDocumentURLWithUTMParams(this.itemType,"Email"))},getEmailCopy:function(){return locale.lots.item.email_copy.replace("[EVENT_NAME]",LiteApp.getEvent().get("name")).replace("[ITEM_TILE]",this.model.get("title")).replace("[ITEM_LINK]",this.getLinkUrl(this.itemType,"Email")).replace("[CLIENT_NAME]",LiteApp.getEvent().get("clientName"))},getTwitterCopy:function(){return locale.lots.item.twitter_copy.replace("[EVENT_NAME]",LiteApp.getEvent().get("name")).replace("[ITEM_TILE]",this.model.get("title")).replace("[WEBSITE_DOMAIN]",helper.getDocumentURLWithUTMParams(this.itemType,"Twitter")).replace("[CLIENT_NAME]",LiteApp.getEvent().get("clientName"))},getWhatsAppCopy:function(){return locale.lots.item.whatsapp_copy.replace("[EVENT_NAME]",LiteApp.getEvent().get("name")).replace("[ITEM_TILE]",this.model.get("title")).replace("[ITEM_LINK]",this.getLinkUrl(this.itemType,"WhatsApp")).replace("[CLIENT_NAME]",LiteApp.getEvent().get("clientName"))},didClickPlaceBidButton:function(e){var button=$(e.target);button.closest(".a-button").addClass("a-button--focused"),setTimeout(function(){button.closest(".a-button").removeClass("a-button--focused"),this.getPlaceBidFormElement().submit()}.bind(this),250)},didClickBuyNowButton:function(e){var button=$(e.target);button.closest(".a-button").addClass("a-button--focused"),setTimeout(function(){button.closest(".a-button").removeClass("a-button--focused"),this.getBuyNowFormElement().submit()}.bind(this),250)},removeFixedClassFromBidFormElement:function(){this.getBidFormElement().removeClass("itemPreviewView__bid-form--fixed")},getScrollableElement:function(){return this.getBidFormElement()},removeFixedClassFromScrollableElement:function(){this.getScrollableElement().removeClass("itemPreviewView__bid-form--fixed")},addFixedClassFromScrollableElement:function(){this.getScrollableElement().addClass("itemPreviewView__bid-form--fixed")}});return LotItemView}),define("views/pledges/itemView",["views/lots/itemView","backbone","views/imageUnveilView","views/pledges/listItemView","views/comments/listView","vent","helper"],function(LotItemView,Backbone,ImageUnveilView,PledgeListItemView,CommentsListView,vent,helper){var PledgeItemView=LotItemView.extend({itemType:"pledge",templateHelpers:function(){var that=this;return{getClosedAuctionText:function(){return that.model.isBeforeOpen()?locale.pledges.item.pledge_before_open+" - "+that.model.get("startTime").format("DD MMM"):locale.pledges.item.pledge_closed},getBidButtonText:function(){return locale.pledges.item.place_donation_button},getBidPlaceholderText:function(){return locale.pledges.item.place_donation_amount_placeholder},getBidErrorText:function(){return locale.pledges.item.place_donation_amount_error}}},shouldShowCommentsSection:function(){return LiteApp.getEvent().isGuestCommentsEnabled()},formIsValid:function(e){var form=$(e.target),that=this,amount=0,pledgeCategory=null,currentList=null;"undefined"!=typeof that.model.collection?(currentList=that.model.collection.getCollectionForCurrentCategory(),pledgeCategory=that.model.collection.category):(currentList=LiteApp.pledgesCollection,pledgeCategory=locale.pledges.categories.all_pledges);var list_position=currentList.index(that.model)+1;amount=this.model.isFixed()?this.model.get("minimum","float"):parseInt(form.find("[name=amount]").val().toString().replace(/,/g,""));var comment=form.find("[name=comment]").val();return LiteApp.guest.isLogged()?LiteApp.router.navigate(LiteApp.router.getConfirmDonationLink(that.model.get("id"),amount,comment),{trigger:!0}
2):LiteApp.router.navigate(LiteApp.router.getCheckRegistrationLink(Backbone.history.fragment,LiteApp.router.getConfirmDonationLink(that.model.get("id"),amount,comment)),{trigger:!0}),givergyAnalytics.trigger("item:added",that.model,1,amount,list_position,pledgeCategory),!1},configureBuyingForm:function(){this.model.isFixed()?(this.getPlaceBidFormElement().hide(),this.model.canDonate()?this.getClosedBuyNowFormElement().hide():this.getOpenBuyNowFormElement().hide()):(this.getBuyNowFormElement().hide(),this.model.canDonate()?this.getClosedBidFormElement().hide():this.getOpenBidFormElement().hide())},onRender:function(){if(this.model instanceof Backbone.Model&&this.model.loaded){this.listItemView=new PledgeListItemView({model:this.model,withPreview:!1,className:"list-item--preview"}),this.listItemView.render(),this.getHeaderElement().html(this.listItemView.el),this._isShown&&Marionette.triggerMethod.call(this.listItemView,"show"),this.commentsListView instanceof CommentsListView&&(this.commentsListView.render(),this.getCommentsListElement().html(this.commentsListView.el),this._isShown&&Marionette.triggerMethod.call(this.commentsListView,"show")),this.$(".current-bid").hide(),this.$(".minimum-bid").hide(),this.$(".donated").html("").addClass("empty"),this.$(".time-left").hide(),this.$(".buy-now-price").hide(),this.model.isFixed()?this.$(".minimum-donation").hide():this.$(".fixed-donation").hide(),this.shouldShowCommentsSection()||(this.$(".comment").hide(),this.$(".comment-label").hide()),this.getBidInfoElement().find(".itemPreviewView__bid-info__row:visible:last").addClass("itemPreviewView__bid-info__row--last"),this.pictureUrl||this.getPreviewImageElement().hide(),this.configureBuyingForm(),this.setHeightForImage(),helper.configureCharacterCounters(this);var itemElement=this.getBidFormElement(),itemHeight=itemElement.height()+parseInt(itemElement.css("padding-top"))+parseInt(itemElement.css("padding-bottom"));itemElement.attr("data-height",itemHeight),itemElement.attr("data-top",itemElement.offset().top),this.renderSocialButtons(),helper.initializeSnapchat()}vent.trigger("rebind:foundation:events",{abide:{validators:{bidIsValid:_.bind(this.validateBidInput,this)}}}),this.$el.attr("id",this.cid),ImageUnveilView.prototype.onRender.apply(this,arguments)},getBidMinAmountErrorMessage:function(){return locale.pledges.item.place_donation_amount_error}});return PledgeItemView}),define("tpl!templates/lots/placeBidSuccess.html",function(){return function(obj){var __p=[],print=function(input,escape){escape="undefined"==typeof escape?!0:escape,escape&&(input=_.escape(input)),__p.push.call(__p,input)};try{with(obj||{})__p.push('<div class="placeBidSuccessView__header"></div><div class="placeBidSuccessView__body">    <div class="placeBidSuccessView__body__icon">        '),print(getConfirmationTickSVG(),!1),__p.push('    </div>    <h3 class="placeBidSuccessView__body__title">        '),"max"==bidMode?print(locale.lots.place_bid.success_header_max_bid,!1):print(locale.lots.place_bid.success_header,!1),__p.push('    </h3>    <p class="placeBidSuccessView__body__message">        '),"max"==bidMode?print(locale.lots.place_bid.success_message_max_bid,!1):"belowReserve"==reason?print(locale.lots.place_bid.success_message_below_reserve+getModel().get("reserve")):getModel().get("buyNow")?print(locale.lots.place_bid.success_message_buy_now,!1):getModel().isSealed()?print(locale.lots.place_bid.success_message_sealed,!1):print(LiteApp.getEvent().get("auctionSuccessCopy"),!1),__p.push('    </p>    <div class="placeBidSuccessView__body__maximum-bid maximum-bid">            <h3 class="placeBidSuccessView__body__maximum-bid__title">'),print(locale.lots.place_bid.maximum_header,!1),__p.push('</h3>            <p class="placeBidSuccessView__body__maximum-bid__message">                '),print(locale.lots.place_bid.maximum_message,!1),__p.push('            </p>            <div class="placeBidSuccessView__body__maximum-bid__bid-form">                <form data-abide="ajax" data-live-validate="true" class="place-bid-form" role="form" aria-label="Place Maxiumum Bid" >                    <div class="row-flex-center auction-open">                        <div class="small-flex columns no-padding">                            <div class="row-flex-center amount-wrapper">                                <div class="small-auto columns currency-wrapper">
2                                    <span class="currency">'),print(LiteApp.getEvent().get("currency")),__p.push('</span>                                </div>                                <div class="small-flex columns no-padding input-wrapper" >                                    <label id="place-bid-amount-label" for="place-bid-amount" class="off-screen" >'),print(getBidPlaceholderText()),__p.push('</label>                                    <input type="tel"                                           id="place-bid-amount"                                           aria-describedby="place-bid-error-label"                                           pattern="[0-9,.]*"                                           name="amount"                                           placeholder="'),print(getBidPlaceholderText()),__p.push('"                                           data-abide-validator="bidIsValid"                                           data-abide-disable-pattern="true"                                        />                                    <small class="error" id="place-bid-error-label" ></small>                                </div>                            </div>                        </div>                        <div class="small-auto columns no-padding-right">                            <button type="button" name="placeBid" class="a-button a-button--round" data-title="'),print(getBidButtonText()),__p.push('" >                                <div class="a-button__label">'),print(getBidButtonText()),__p.push('</div>                            </button>                        </div>                    </div>                </form>            </div>    </div>    <div class="placeBidSuccessView__body__social socialButtons">        <div class="socialButtons__buttons">            <a title="Share on Facebook (opens new window)" href="javascript:void(0);" target="_blank" class="socialButtons__buttons__button facebook-share-link facebook-button facebook-share">                '),print(getFacebookIconSVG(),!1),__p.push('                <span aria-hidden="true">'),print(locale.lots.place_bid.share_with_facebook,!1),__p.push('</span>            </a>            <a title="Share on Twitter (opens new window)" href="javascript:void(0);" class="socialButtons__buttons__button twitter-share-link twitter-button twitter-share">                '),print(getTwitterIconSVG(),!1),__p.push('                <span aria-hidden="true" >'),print(locale.lots.place_bid.share_with_twitter,!1),__p.push("</span>                <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>            </a>            <a title=\"Share via Email (opens new window)\" href=\"javascript:void(0);\" class=\"socialButtons__buttons__button email-share-link email-button email-share\" >                "),print(getEmailIconSVG(),!1),__p.push('                <span aria-hidden="true" >'),print(locale.lots.place_bid.share_with_email,!1),__p.push('</span>            </a>            <a title="Share via WhatsApp (opens new window)" class="socialButtons__buttons__button whatsapp-share-link whatsapp-button whatsapp-share" href="javascript:void(0);">                '),print(getWhatsAppIconSVG(),!1),__p.push('                <span aria-hidden="true" >'),print(locale.lots.place_bid.share_with_whatsapp,!1),__p.push('</span>            </a>            <a title="Share via Snapchat (opens new window)"               class="socialButtons__buttons__button snapchat-share-link snapchat-button snapchat-share snapchat-share-button" >                '),print(getSnapchatIconSVG(),!1),__p.push('                <span aria-hidden="true">'),print(locale.lots.place_bid.share_with_snapchat,!1),__p.push('</span>            </a>        </div>    </div>    <div class="placeBidSuccessView__body__actions">        <form data-abide="ajax" data-live-validate="false" action="#" class="placeBidSuccessView__body__actions__wrapper actionsForm" >                <button type="button" class="placeBidSuccessView__body__actions__button a-button a-button--round a-button--bigger a-button--grey a-button--valid" >                    <div class="a-button__label">'),print(locale.lots.place_bid.back,!1),__p.push('</div>                </button>        </form>    </div></div><div class="loader"></div>')}catch(e){console.log(e)}return __p.join("")}}),define("views/lots/placeBidSuccessView",["views/baseView","tpl!templates/lots/placeBidSuccess.html","backbone","jquery","marionette","views/lots/listItemView","views/socialSharingButtons","vent","helper","foundation.abide","snapchat"],function(BaseView,PlaceBidSuccessTemplate,Backbone,$,Marionette,LotListItemView,SocialSharingButtons,vent,helper,FoundationAbide){var PlaceBidSuccessView=BaseView.extend({template:PlaceBidSuccessTemplate,className:"placeBidSuccessView",listItemViewConstructor:LotListItemView,listItemView:null,itemLinkFunction:null,backUrl:null,reason:null,anonymous:!1,bidMode:null,itemType:"auction",events:{"click .facebook-share-link":"didClickFacebookShare","click .twitter-share-link":"didClickTwitterShare","click .email-share-link":"didClickEmailShare","click .whatsapp-share-link":"didClickWhatsAppShare","click .actionsForm .a-button":"didClickActionButton","click .place-bid-form .a-button":"didClickPlaceBidButton"},getBackButtonElement:function(){return this.$(".placeBidSuccessView__body__actions__button")},getActionsForm:function(){return this.$(".actionsForm")},getIconElement:function(){return this.$(".placeBidSuccessView__body__icon")},getHeaderElement:function(){return this.$(".placeBidSuccessView__header")},getPlaceBidFormElement:function(){return this.$(".place-bid-form")},getSocialButtonsContainer:function(){return this.$(".socialButtons")},templateHelpers:function(){return{getBidButtonText:function(){return locale.lots.item.place_max_bid_button},getBidPlaceholderText:function(){return locale.lots.item.place_max_bid_amount_placeholder},getBidErrorText:function(){return locale.lots.item.place_max_min_bid_amount_error}}},initialize:function(){"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].itemLinkFunction&&(this.itemLinkFunction=arguments[0].itemLinkFunction),"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].backUrl&&(this.backUrl=arguments[0].backUrl),"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].reason&&(this.reason=arguments[0].reason),"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].anonymous&&(this.anonymous=arguments[0].anonymous),"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].bidMode&&(this.bidMode=arguments[0].bidMode),this.initializeListItemView(),this.socialButtonsView=new SocialSharingButtons({getEmailSubject:this.getEmailSubject.bind(this),getEmailCopy:this.getEmailCopy.bind(this),getTwitterCopy:this.getTwitterCopy.bind(this),getWhatsAppCopy:this.getWhatsAppCopy.bind(this),previewImage:this.previewImage,utm_source:this.itemType,getHash:function(){return this.model.getHash()}.bind(this),getLinkUrl:this.getItemUrl.bind(this)}),BaseView.prototype.initialize.apply(this,arguments)},didEndFetch:function(){BaseView.prototype.didEndFetch.apply(this,arguments),this.initializeWithLoadedModel()},serializeData:function(){return{reason:this.reason,bidMode:this.bidMode}},initializeWithLoadedModel:function(){},validateBidInput:function(el){var keyPressed=el.which||0;"undefined"!=typeof el.target&&(el=el.target);
3var reg=FoundationAbide.settings.patterns.currency_higher_than_zero,start=el.selectionStart,end=el.selectionEnd,val_len=el.value.length,value=$(el).val();if(reg.test(value)){""!=$.trim(value)&&(value=helper.formatCurrencyString(value),$(el).val(value),value.length>val_len?(start++,end++):value.length<val_len&&(start--,end--)),0!=keyPressed&&el.setSelectionRange(start,end);var value=parseFloat($(el).val().replace(/,/g,""));if(_.isNaN(value)&&(value=0),value>=this.model.get("currentMinimum","float"))return $(el).parent().hasClass("error")&&$(el).parent().removeClass("error"),$(el).hasClass("error")&&$(el).removeClass("error"),!0;$(el).parent().find("small.error").html(locale.lots.item.place_max_min_bid_amount_error)}else $(el).parent().find("small.error").html(locale.lots.item.place_max_bid_amount_error);return $(el).hasClass("error")||$(el).addClass("error"),!1},formIsValid:function(e){var form=$(e.target);if(form.hasClass("place-bid-form")){var that=this,hideAmount=!1,placeBidLink=LiteApp.router.getPlaceBidLink(that.model.get("id"),parseInt(form.find("[name=amount]").val().toString().replace(/,/g,"")),"max","",hideAmount,this.anonymous,Backbone.history.fragment);LiteApp.guest.isLogged()?LiteApp.router.navigate(placeBidLink,{trigger:!0,silent:!0}
3):LiteApp.router.navigate(LiteApp.router.getCheckRegistrationLink(Backbone.history.fragment,null,placeBidLink),{trigger:!0})}else LiteApp.router.navigate(this.backUrl,{trigger:!0});return!1},initializeListItemView:function(){this.listItemView=new this.listItemViewConstructor({model:this.model,className:"list-item--preview"})},onRender:function(){this.listItemView.render(),this.getHeaderElement().html(this.listItemView.el),this.canShowMaxBidForm()?this.$(".maximum-bid").show():this.$(".maximum-bid").hide(),LiteApp.lotsCollection instanceof Backbone.Collection&&LiteApp.lotsCollection.models.length<2&&this.getBackButtonElement().hide(),this._isShown&&(Marionette.triggerMethod.call(this.listItemView,"show"),setTimeout(function(){this.getIconElement().addClass("placeBidSuccessView__body__icon--show")}.bind(this),200),vent.trigger("rebind:foundation:events",{abide:{validators:{bidIsValid:_.bind(this.validateBidInput,this)}}})),this.renderSocialButtons(),helper.initializeSnapchat(),BaseView.prototype.onRender.apply(this,arguments)},renderSocialButtons:function(){this.socialButtonsView.render(),this.getSocialButtonsContainer().length&&(this.getSocialButtonsContainer().html(this.socialButtonsView.el),this.socialButtonsView.$el.addClass(this.getSocialButtonsContainer().get(0).className),this.socialButtonsView.$el.unwrap(),this._isShown&&Marionette.triggerMethod.call(this.socialButtonsView,"show"))},onShow:function(){this.listItemView instanceof Backbone.View&&this.listItemView._isRendered&&Marionette.triggerMethod.call(this.listItemView,"show"),this.model instanceof Backbone.Model&&(this.model.loaded?this.initializeWithLoadedModel():this.model.fetchData()),Marionette.triggerMethod.call(this.socialButtonsView,"show"),BaseView.prototype.onShow.apply(this,arguments)},canShowMaxBidForm:function(){return"hybrid"==this.model.get("bidMode","original")&&"max"!=this.bidMode},onBeforeHide:function(){this.undelegateEvents()},getItemUrl:function(source,medium){return"function"==typeof this.itemLinkFunction?helper.getDocumentRoot()+this.itemLinkFunction(this.model.get("displayNumber"))+"&"+helper.serialiseObjToURLParams(helper.getUTMParams(source,medium)):void 0},getEmailSubject:function(){return locale.lots.item.email_subject.replace("[EVENT_NAME]",LiteApp.getEvent().get("name")).replace("[WEBSITE_DOMAIN]",helper.getDocumentURLWithUTMParams(this.itemType,"Email"))},getEmailCopy:function(){return locale.lots.item.email_copy.replace("[EVENT_NAME]",LiteApp.getEvent().get("name")).replace("[ITEM_TILE]",this.model.get("title")).replace("[ITEM_LINK]",this.getItemUrl(this.itemType,"Email")).replace("[CLIENT_NAME]",LiteApp.getEvent().get("clientName"))},getTwitterCopy:function(){return locale.lots.item.twitter_copy.replace("[EVENT_NAME]",LiteApp.getEvent().get("name")).replace("[ITEM_TILE]",this.model.get("title")).replace("[WEBSITE_DOMAIN]",helper.getDocumentURLWithUTMParams(this.itemType,"Twitter")).replace("[CLIENT_NAME]",LiteApp.getEvent().get("clientName"))},getWhatsAppCopy:function(){return locale.lots.item.whatsapp_copy.replace("[EVENT_NAME]",LiteApp.getEvent().get("name")).replace("[ITEM_TILE]",this.model.get("title")).replace("[ITEM_LINK]",this.getItemUrl(this.itemType,"WhatsApp")).replace("[CLIENT_NAME]",LiteApp.getEvent().get("clientName"))},didClickActionButtonAction:function(){this.getActionsForm().submit()},didClickActionButton:function(e){var button=$(e.target);button.closest(".a-button").addClass("a-button--focused"),setTimeout(function(){button.closest(".a-button").removeClass("a-button--focused"),this.didClickActionButtonAction(button)}.bind(this),250)},didClickPlaceBidButton:function(e){var button=$(e.target);button.closest(".a-button").addClass("a-button--focused"),setTimeout(function(){button.closest(".a-button").removeClass("a-button--focused"),this.getPlaceBidFormElement().submit()}.bind(this),250)}});return PlaceBidSuccessView}),define("tpl!templates/pledges/placeDonationSuccess.html",function(){return function(obj){var __p=[],print=function(input,escape){escape="undefined"==typeof escape?!0:escape,escape&&(input=_.escape(input)),__p.push.call(__p,input)};try{with(obj||{})__p.push('<div class="placeDonationSuccessView__header"></div><div class="placeDonationSuccessView__body">    <div class="placeDonationSuccessView__body__icon">            '),print(getConfirmationTickSVG(),!1),__p.push('    </div>    <h3 class="placeDonationSuccessView__body__title">        '),print(locale.pledges.place_donation.success_header,!1),__p.push('    </h3>    <p class="placeDonationSuccessView__body__message">        '),print(LiteApp.getEvent().get("pledgeSuccessCopy"),!1),__p.push('    </p>    <div class="placeDonationSuccessView__body__social socialButtons">        <div class="socialButtons__buttons">            <a target="_blank" class="socialButtons__buttons__button facebook-share-link facebook-button facebook-share">                '),print(getFacebookIconSVG(),!1),__p.push('                <sp
3an aria-hidden="true" >'),print(locale.lots.place_bid.share_with_facebook,!1),__p.push("</span>            </a>            <a onclick=\"window.open('https://twitter.com/intent/tweet?original_referer="),print(encodeURIComponent(getItemUrl()),!1),__p.push("&url="),print(encodeURIComponent(getItemUrl()),!1),__p.push("&text="),print(encodeURIComponent(getTwitterCopy()),!1),__p.push("', '_blank', 'width=400,height=500');void(0);return false\" class=\"socialButtons__buttons__button twitter-button twitter-share\">                "),print(getTwitterIconSVG(),!1),__p.push('                <span aria-hidden="true">'),print(locale.lots.place_bid.share_with_twitter,!1),__p.push("</span>                <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>            </a>            <a title=\"Email\" class=\"socialButtons__buttons__button email-share-link email-button email-share\" href=\"mailto:%20?subject="),print(encodeURIComponent(getEmailSubject()),!1),__p.push("&body="),print(encodeURIComponent(getEmailCopy()),!1),__p.push('">                '),print(getEmailIconSVG(),!1),__p.push("                <span>"),print(locale.lots.place_bid.share_with_email,!1),__p.push('</span>            </a>            <a title="WhatsApp" target="_blank" class="socialButtons__buttons__button whatsapp-share-link whatsapp-button whatsapp-share" href="'),print(getWhatsAppShareUrl(locale.pledges.item.email_copy,getItemUrl()),!1),__p.push('">                '),print(getWhatsAppIconSVG(),!1),__p.push('                <span aria-hidden="true">'),print(locale.lots.place_bid.share_with_whatsapp,!1),__p.push('</span>            </a>            <a title="Share via Snapchat (opens new window)"               class="socialButtons__buttons__button snapchat-share-link snapchat-button snapchat-share snapchat-share-button" >                '),print(getSnapchatIconSVG(),!1),__p.push('                <span aria-hidden="true">'),print(locale.lots.place_bid.share_with_snapchat,!1),__p.push('</span>            </a>        </div>    </div>    <div class="placeDonationSuccessView__body__actions">        <form data-abide="ajax" data-live-validate="false" action="#" class="placeDonationSuccessView__body__actions__wrapper actionsForm" >            <button type="button" class="placeDonationSuccessView__body__actions__button a-button a-button--round a-button--bigger a-button--grey" >                <div class="a-button__label">'),print(locale.pledges.place_donation.back,!1),__p.push('</div>            </button>        </form>    </div></div><div class="loader"></div>')}catch(e){console.log(e)}return __p.join("")}}),define("views/pledges/placeDonationSuccessView",["views/lots/placeBidSuccessView","tpl!templates/pledges/placeDonationSuccess.html","views/pledges/listItemView","helper"],function(PlaceBidSuccessView,PlaceDonationSuccessTemplate,PledgeListItemView,helper){var PlaceDonationSuccessView=PlaceBidSuccessView.extend({template:PlaceDonationSuccessTemplate,className:"placeDonationSuccessView",listItemViewConstructor:PledgeListItemView,itemType:"pledge",getBackButtonElement:function(){return this.$(".placeDonationSuccessView__body__actions__button")},getItemUrl:function(source,medium){return"function"==typeof this.itemLinkFunction?helper.getDocumentRoot()+this.itemLinkFunction(this.model)+"&"+helper.serialiseObjToURLParams(helper.getUTMParams(source,medium)):void 0},getHeaderElement:function(){return this.$(".placeDonationSuccessView__header")},getIconElement:function(){return this.$(".placeDonationSuccessView__body__icon")},onRender:function(){PlaceBidSuccessView.prototype.onRender.apply(this,arguments),LiteApp.pledgesCollection.models.length<2&&this.getBackButtonElement().hide(),this._isShown&&(Marionette.triggerMethod.call(this.listItemView,"show"),setTimeout(function(){this.getIconElement().addClass("placeDonationSuccessView__body__icon--show")}.bind(this),200))}});return PlaceDonationSuccessView}),define("tpl!templates/pledges/confirmDonation.html",function(){return function(obj){var __p=[],print=function(input,escape){escape="undefined"==typeof escape?!0:escape,escape&&(input=_.escape(input)),__p.push.call(__p,input)};try{with(obj||{})__p.push('<div class="confirmDonationView__header"></div><div class="confirmDonationView__body">    <h3 class="confirmDonationView__body__title">        '),print(locale.pledges.confirm_donation.confirm_header,!1),__p.push('    </h3>    <div class="confirmDonationView__body__bid-info">        <div class="confirmDonationView__body__bid-info__row">                <div class="confirmDonationView__body__bid-info__row__col 
3confirmDonationView__body__bid-info__label">                        '),print(locale.pledges.confirm_donation.your_donation,!1),__p.push(':                </div>                <div class="confirmDonationView__body__bid-info__row__col confirmDonationView__body__bid-info__value">                        '),"undefined"!=typeof donation.get("amount")?print(donation.get("amount")):"",__p.push("                </div>        </div>        "),donation.get("comment")&&(__p.push('        <div class="confirmDonationView__body__bid-info__row--details">            <div class="confirmDonationView__body__bid-info__row--details__col confirmDonationView__body__bid-info__label">                <div class="litecheckbox">                    <input type="checkbox"                           name="hideAmount"                           id="confirm-donation-hide-amount"                    />                    <label for="confirm-donation-hide-amount" ></label>                </div>            </div>            <div class="confirmDonationView__body__bid-info__row--detail__col confirmDonationView__body__bid-info__value confirmDonationView__body__bid-info__value--small">                <label for="confirm-donation-hide-amount" >'),print(locale.pledges.confirm_donation.hide_donation_amount),__p.push('</label>            </div>        </div>        <div class="confirmDonationView__body__bid-info__row--details double-margin-top">            <div class="confirmDonationView__body__bid-info__row--details__col confirmDonationView__body__bid-info__label confirmDonationView__body__bid-info__label--small">                '),print(locale.pledges.confirm_donation.your_message,!1),__p.push(':            </div>            <div class="confirmDonationView__body__bid-info__row--details__col confirmDonationView__body__bid-info__value confirmDonationView__body__bid-info__value--small">                '),print(donation.get("comment")),__p.push("            </div>        </div>        ")),__p.push('    </div>    <div class="confirmDonationView__body__bid-actions">        <form data-abide="ajax" data-live-validate="false" action="#" class="confirmDonationView__body__bid-actions__wrapper actionsForm" >            '),showAnonymous&&(__p.push('            <button type="button" class="confirmDonationView__body__bid-actions__button a-button a-button--round a-button--bigger a-button--grey a-button--valid" onclick="this.form.originButton=this.name;" name="anonymousBid">                <div class="a-button__label">'),print(getBidAnonymousButtonText()),__p.push("</div>            </button>            ")),__p.push('            <button type="button" class="confirmDonationView__body__bid-actions__button a-button a-button--round a-button--bigger a-button--grey a-button--valid" onclick="this.form.originButton=this.name;" name="normalBid" >                <div class="a-button__label">'),print(getBidButtonText()),__p.push('</div>            </button>        </form>    </div></div><div class="loader"></div>')}catch(e){console.log(e)}return __p.join("")}}),define("views/pledges/confirmDonationView",["views/pledges/placeDonationSuccessView","views/windowResizeInterface","tpl!templates/pledges/confirmDonation.html","model/donation","vent"],function(PlaceDonationSuccessView,WindowResizeInterface,ConfirmDonationTemplate,Donation){var PlaceDonationSuccessViewWithWindowResizeInterface=PlaceDonationSuccessView.extend(WindowResizeInterface),ConfirmDonationView=PlaceDonationSuccessViewWithWindowResizeInterface.extend({template:ConfirmDonationTemplate,className:"confirmDonationView",listUrl:null,donation:null,windowChangeTimeout:null,initialize:function(){this.donation="undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].donation?arguments[0].donation:new Donation,this._super.apply(this,arguments)},getHideAmountCheckboxElement:function(){return this.$("[name=hideAmount]")},templateHelpers:function(){return{getBidButtonText:function(){return locale.pledges.confirm_donation.confirm_donation_button},getBidAnonymousButtonText:function(){return locale.pledges.confirm_donation.confirm_anonymous_donation_button}}},serializeData:function(){return _.extend({},this._super(),{donation:this.donation,showAnonymous:LiteApp.getEvent().get("anonPledgeOnLite")})},getHeaderElement:function(){return this.$(".confirmDonationView__header")},getActionsElement:function(){return this.$(".confirmDonationView__body__bid-actions")},formIsValid:function(e){var form=$(e.target),originButton=form.get(0).originButton,that=this,hideAmount=this.getHideAmountCheckboxElement().is(":checked"),placeDonationLink=LiteApp.router.getPlaceDonationLink(that.model.get("id"),this.donation.get("amount","float"),this.donation.get("comment"),hideAmount,"anonymousBid"==originButton?!0:!1);return LiteApp.guest.isLogged()?LiteApp.router.navigate(placeDonationLink,{trigger:!0,silent:!0}
3):LiteApp.router.navigate(LiteApp.router.getCheckRegistrationLink(Backbone.history.fragment,null,placeDonationLink),{trigger:!0}),!1},didChangeWindowSize:function(){var mq=matchMedia(Foundation.media_queries.medium);mq.matches?this.getActionsElement().removeClass("confirmDonationView__body__bid-actions--fixed"):this.getActionsElement().addClass("confirmDonationView__body__bid-actions--fixed")},initializeWithLoadedModel:function(){this._super(),givergyAnalytics.trigger("item:confirm:purchase",this.model,1,this.donation.get("amount","float"),this.model.collection.category)}});return ConfirmDonationView}),define("views/lots/placeBidView",["views/baseView","helper"],function(BaseView,helper){var PlaceBidView=BaseView.extend({template:_.template(""),className:"placeBid",buyNow:!1,initialize:function(){"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].buyNow&&(this.buyNow=arguments[0].buyNow),"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].lot&&(this.lot=arguments[0].lot),BaseView.prototype.initialize.apply(this,arguments)},didStartSave:function(){this.showLoadingIndicator("buy_now"==this.model.get("bidMode")?locale.lots.place_bid.buy_now_loader:locale.lots.place_bid.loader)},didSaveModel:function(){if("undefined"!=typeof this.model.get("code")){if("belowReserve"==this.model.get("code"))return void LiteApp.router.navigate(LiteApp.router.getPlaceBidSuccessLink(this.model.get("lotId"),"belowReserve",this.model.get("anonymous"),this.model.get("bidMode")),{trigger:!0});if("accepted"!=this.model.get("code"))return void this.didErrorSave()}"buy_now"==this.model.get("bidMode")&&LiteApp.getEvent().isPaymentEnabled()&&(this.lot.isGivergyItem()&&LiteApp.getEvent().isGivergyCollectsGivergyItemPayment()||!this.lot.isGivergyItem()&&LiteApp.getEvent().isGivergyCollectsClientItemPayment())?helper.isRunningOnHttps()?LiteApp.router.navigate(LiteApp.router.getCheckoutLink(),{trigger:!0}):LiteApp.router.navigate(LiteApp.router.getRedirectToCheckoutLink(),{trigger:!0}):LiteApp.router.navigate(LiteApp.router.getPlaceBidSuccessLink(this.model.get("lotId"),null,this.model.get("anonymous"),this.model.get("bidMode")),{trigger:!0}),this.triggerSucessfulBidEvent()},triggerSucessfulBidEvent:function(){var lotCategory=null,currentList=null;"undefined"!=typeof this.lot.collection?(currentList=this.lot.collection.getCollectionForCurrentCategory(),lotCategory=this.lot.collection.category):(currentList=LiteApp.lotsCollection,lotCategory=locale.lots.categories.all_lots);var list_position=currentList.index(this.model)+1;givergyAnalytics.trigger("bid:placed",this.lot,this.model.get("amount","float"),list_position,lotCategory,this.model.get("id"),this.model.get("bidMode"))},didErrorSave:function(){LiteApp.router.navigate(LiteApp.router.getPlaceBidErrorLink(this.model.get("lotId"),this.model.get("code"),this.model.get("bidMode"),this.model.get("extra")),{trigger:!0})},modelIsInvalid:function(){this.didErrorSave()},onRender:function(){BaseView.prototype.onRender.apply(this,arguments)},onShow:function(){this.model&&this.model.save(),BaseView.prototype.onShow.apply(this,arguments)}});return PlaceBidView}),define("views/pledges/placeDonationView",["views/lots/placeBidView","helper"],function(PlaceBidView,helper){var PlaceDonationView=PlaceBidView.extend({didSaveModel:function(){return"undefined"!=typeof this.model.get("code")&&"accepted"!=this.model.get("code")?void this.didErrorSave():void(LiteApp.getEvent().isPaymentEnabled()&&LiteApp.getEvent().isGivergyCollectsPledgePayment()?helper.isRunningOnHttps()?LiteApp.router.navigate(LiteApp.router.getCheckoutLink(),{trigger:!0}):LiteApp.router.navigate(LiteApp.router.getRedirectToCheckoutLink(),{trigger:!0}):LiteApp.router.navigate(LiteApp.router.getPlaceDonationSuccessLink(this.model.get("pledgeId")),{trigger:!0}))},didStartSave:function(){this.showLoadingIndicator(locale.pledges.place_donation.loader)},didErrorSave:function(){LiteApp.router.navigate(LiteApp.router.getPlaceDonationErrorLink(this.model.get("pledgeId")),{trigger:!0})}});return PlaceDonationView}),define("tpl!templates/pledges/placeDonationError.html",function(){return function(obj){var __p=[],print=function(input,escape){escape="undefined"==typeof escape?!0:escape,escape&&(input=_.escape(input)),__p.push.call(__p,input)};try{with(obj||{})__p.push('<div class="placeDonationErrorView__header"></div><div class="placeDonationErrorView__body">    <h3 class="placeDonationErrorView__body__title">        '),print(locale.pledges.place_donation.error_header,!1),__p.push('    </h3>    <p class="placeDonationErrorView__body__message">            '),getModel().isOpen()?print(locale.pledges.place_donation.error_message,!1):print(locale.pledges.place_donation.error_message_close,!1),__p.push('    </p></div><div class="loader"></div>')}catch(e){console.log(e)}return __p.join("")}}),define("views/pledges/placeDonationErrorView",["views/pledges/placeDonationSuccessView","tpl!templates/pledges/placeDonationError.html"],function(PlaceDonationSuccessView,PlaceDonationErrorTemplate){var PlaceDonationErrorView=PlaceDonationSuccessView.extend({template:PlaceDonationErrorTemplate,getHeaderElement:function(){return this.$(".placeDonationErrorView__header")},constructor:function(){this.className="placeDonationErrorView",PlaceDonationSuccessView.prototype.constructor.apply(this,arguments)}});return PlaceDonationErrorView}),define("tpl!templates/lots/categoriesList.html",function(){return function(obj){var __p=[];try{with(obj||{})__p.push('<div class="loader"></div>')}catch(e){console.log(e)}return __p.join("")}}),define("tpl!templates/lots/categoryListItem.html",function(){return function(obj){var __p=[],print=function(input,escape){escape="undefined"==typeof escape?!0:escape,escape&&(input=_.escape(input)),__p.push.call(__p,input)};try{with(obj||{})__p.push('<div class="categories__item__label">    '),"undefined"!=typeof categoryName?print(categoryName):"",__p.push('</div><div class="categories__item__button" aria-hidden="true"></div>')}catch(e){console.log(e)}return __p.join("")}}),define("views/lots/categoryListItemView",["views/baseView","tpl!templates/lots/categoryListItem.html"],function(BaseView,LotCategoryListItemTemplate){var LotCategoriesListItemView=BaseView.extend({template:LotCategoryListItemTemplate,className:"categories__item",itemLinkFunction:null,tagName:"a",templateHelpers:function(){var that=this;return{getCategoryLink:function(category){return"function"==typeof that.itemLinkFunction?that.itemLinkFunction(category):void 0}}},getItemButton:function(){return this.$(".categories__item__button")},setButtonText:function(){this.getItemButton().html(locale.lots.categories.view_lots)},onRender:function(){this.$el.attr("href",this.itemLinkFunction(this.model.get("categoryName"))).attr("title",this.model.get("categoryName")).attr("role","menuitem"),("undefined"!=this.model.get("type")||"undefined"!=typeof this.model.get("min")&&"undefined"!=typeof this.model.get("max"))&&this.$el.addClass("categories__item--special"),this.$el.bind("click",this.didClickView.bind(this)),this.setButtonText(),BaseView.prototype.onRender.apply(this,arguments)},didClickView:function(e){return givergyAnalytics.trigger("item:category:selected",this.$el.attr("title")),this.$el.hasClass("categories__item--focused")?void this.$el.removeClass("categories__item--focused"):(this.$el.addClass("categories__item--focused"),setTimeout(function(){this.$el.click()}.bind(this),250),e.stopPropagation(),!1)},serializeData:function(){return _.extend({listUrl:this.listUrl},BaseView.prototype.serializeData.apply(this,arguments))}});return LotCategoriesListItemView}),define("views/lots/categoriesListView",["views/baseView","tpl!templates/lots/categoriesList.html","views/lots/categoryListItemView","backbone","model/categoriesCollection","model/category"],function(BaseView,LotCategoriesListTemplate,LotC
3ategoriesListItemView,Backbone,CategoriesCollection,Category){var LotsCategoriesListView=BaseView.extend({template:LotCategoriesListTemplate,className:"categories",tagName:"nav",itemView:LotCategoriesListItemView,selectedCategory:null,lotsCollection:null,itemLinkFunction:null,initialize:function(){"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].selectedCategory&&(this.selectedCategory=arguments[0].selectedCategory),"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].lots&&(this.lotsCollection=arguments[0].lots,this.lotsCollection instanceof Backbone.Collection&&(this.listenTo(this.lotsCollection,"fetchStart",this.didStartFetch),this.listenTo(this.lotsCollection,"fetchEnd",this.didEndFetch),this.listenTo(this.lotsCollection,"fetchError",this.didErrorFetch))),"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].itemLinkFunction&&(this.itemLinkFunction=arguments[0].itemLinkFunction),BaseView.prototype.initialize.apply(this,arguments)},didErrorFetch:function(){BaseView.prototype.didErrorFetch.apply(this,arguments)},didEndFetch:function(){this.initializeWithLoadedCollection(),BaseView.prototype.didEndFetch.apply(this,arguments)},initializeWithLoadedCollection:function(){this.setCollection(this.lotsCollection.getCategoriesCollection())},onBeforeItemAdded:function(view){view.itemLinkFunction=this.itemLinkFunction,BaseView.prototype.onBeforeItemAdded.apply(this,arguments)},appendHtml:function(collectionView,itemView){this.selectedCategory instanceof Category&&itemView.model.get("categoryName")==this.selectedCategory.get("categoryName")&&itemView.$el.addClass("categories__item--selected").attr("aria-current","page"),BaseView.prototype.appendHtml.apply(this,arguments)},onShow:function(){this.lotsCollection instanceof Backbone.Collection&&(this.lotsCollection.loaded?this.initializeWithLoadedCollection():this.lotsCollection.fetchData()),BaseView.prototype.onShow.apply(this,arguments)}});return LotsCategoriesListView}),define("views/pledges/categoriesListView",["views/lots/categoriesListView"],function(LotsCategoriesListView){var PledgesCategoriesListView=LotsCategoriesListView.extend({initialize:function(){"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].pledges&&(arguments[0].lots=arguments[0].pledges),LotsCategoriesListView.prototype.initialize.apply(this,arguments)}});return PledgesCategoriesListView}),define("tpl!templates/lots/searchList.html",function(){return function(obj){var __p=[],print=function(input,escape){escape="undefined"==typeof escape?!0:escape,escape&&(input=_.escape(input)),__p.push.call(__p,input)};try{with(obj||{})__p.push('<h3 class="lotSearchListView__header">    '),print(locale.lots.search.title),__p.push('</h3><form data-abide="ajax"     class="lotSearchListView__search-form"     role="form"     title="Search">    <div class="row-flex-center search-bar">        <div class="small-flex columns no-padding">            <label for="search-text-field" class="off-screen" >'),print(locale.lots.search.placeholder),__p.push('</label>            <input type="text" value="'),"undefined"!=typeof searchTerm?print(searchTerm):"",__p.push('"                   name="searchTerm"                   id="search-text-field"                   aria-describedby="search-text-error-label"                   placeholder="'),print(locale.lots.search.placeholder),__p.push('"                   data-abide-validator="search" >            <small class="error" id="search-text-error-label" data-error-search="'),print(locale.lots.search.error,!1),__p.push('" ></small>        </div>        <button type="button" name=searchBtn class="a-button a-button--round a-button--bigger a-button--grey"  >            <div class="a-button__label">'),print(locale.lots.search.button),__p.push('</div>        </button>    </div></form><div class="lotSearchListView__results results-wrapper">    <div class="small-12 results"></div>    <div class="loader"></div></div>')}catch(e){console.log(e)}return __p.join("")}}),define("views/lots/searchListView",["views/baseView","tpl!templates/lots/searchList.html","views/lots/listItemView","model/lotsCollection","jquery","vent"],function(BaseView,LotSearchListTemplate,LotListItemView,LotsCollection,$,vent){var LotsSearchListView=BaseView.extend({template:LotSearchListTemplate,className:"lotSearchListView",itemView:LotListItemView,itemLinkFunction:null,searchTerm:"",typeTimer:null,events:{"click [name=searchBtn]":"didClickSearchButton","keydown [name=searchTerm]":"didTypeInSearch"},getFormElement:function(){return this.$("form")},getSearchButton:function(){return this.$("[name=searchBtn]")},serializeData:function(){return _.extend(BaseView.prototype.serializeData.apply(this,arguments),{searchTerm:this.searchTerm})},initialize:function(){"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].searchTerm&&(this.searchTerm=arguments[0].searchTerm),"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].itemLinkFunction&&(this.itemLinkFunction=arguments[0].itemLinkFunction),"undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].scrollToItem&&(this.scrollToItem=arguments[0].scrollToItem),BaseView.prototype.initialize.apply(this,arguments)},didClickSearchButton:function(e){var button=$(e.target);button.closest(".a-button").addClass("a-button--focused"),setTimeout(function(){button.closest(".a-button").removeClass("a-button--focused"),this.getFormElement().submit()}.bind(this),250)},didTypeInSearch:function(){clearTimeout(this.typeTimer),this.typeTimer=setTimeout(function(){this.$("form").submit()}.bind(this),1e3)},formIsInvalid:function(e,triggerdEventType){var validate_event=/validate/.test(triggerdEventType);
3this.getSearchButton().removeClass("a-button--valid"),validate_event||this._super.apply(this,arguments)},formIsValid:function(e,triggerdEventType){var validate_event=/validate/.test(triggerdEventType);this.getSearchButton().addClass("a-button--valid"),validate_event||""!=$.trim(this.$("[name=searchTerm]").val())&&this.$("[name=searchTerm]").val()!=this.searchTerm&&(this.searchTerm=$.trim(this.$("[name=searchTerm]").val()),givergyAnalytics.trigger("item:searched",this.searchTerm),this.refreshCollection())},refreshCollection:function(){this.collection.fetchParameters.q=this.searchTerm,this.collection.loaded=!1,this.collection.fetchData()},didErrorFetch:function(){this.$(".results-wrapper .loader").hide(),this.$(".results").html('<p class="no-results">'+locale.no_results+"</p>")},didStartFetch:function(){this.$(".results-wrapper .loader").show()},didEndFetch:function(){0==this.collection.models.length&&this.$(".results").html('<p class="no-results">'+locale.no_results+"</p>"),this.$(".results-wrapper .loader").hide(),BaseView.prototype.didEndFetch.apply(this,arguments)},appendHtml:function(collectionView,itemView){this.$(".results").find(".no-results").remove(),this.$(".results").append(itemView.$el),itemView.onShow()},onBeforeItemAdded:function(view){view.itemLinkFunction=this.itemLinkFunction,view.searchTerm=this.searchTerm;var parentView=this;view.itemPageUrl=_.bind(function(){return"function"==typeof this.itemLinkFunction?this.itemLinkFunction(this.model.get("displayNumber"),parentView.searchTerm):void 0},view),BaseView.prototype.onBeforeItemAdded.apply(this,arguments)},onCompositeCollectionRendered:function(){this.collection instanceof Backbone.Collection&&this.collection.loaded&&this.scrollToItem&&this.children.each(function(child){child.model.get("displayNumber")==this.scrollToItem&&vent.trigger("scroll:content:view:to:element",child.$el,!1)},this)},onShow:function(){""!=this.searchTerm&&this.refreshCollection(),BaseView.prototype.onShow.apply(this,arguments)}});return LotsSearchListView}),define("views/pledges/searchListView",["views/lots/searchListView"],function(LotsSearchListView){var PledgesSearchListView=LotsSearchListView.extend({});return PledgesSearchListView}),define("tpl!templates/pledges/bidConversion.html",function(){return function(obj){var __p=[],print=function(input,escape){escape="undefined"==typeof escape?!0:escape,escape&&(input=_.escape(input)),__p.push.call(__p,input)};try{with(obj||{})__p.push('<div class="bidConversionView__body"><h3 class="bidConversionView__body__title">'),print(locale.pledges.bid_conversion.confirm_header,!1),__p.push('</h3><p class="bidConversionView__body__message">'),showAnonymous?print(locale.pledges.bid_conversion.confirm_message_with_anonymous,!1):print(locale.pledges.bid_conversion.confirm_message,!1),__p.push('</p><div class="bidConversionView__body__bid-info"><div class="bidConversionView__body__bid-info__row"><div class="bidConversionView__body__bid-info__row__col bidConversionView__body__bid-info__label">'),print(locale.pledges.confirm_donation.your_donation,!1),__p.push(':</div><div class="bidConversionView__body__bid-info__row__col bidConversionView__body__bid-info__value"><div class="small-flex columns no-padding"><div class="row-flex-center amount-wrapper"><div class="small-auto columns currency-wrapper"><span class="currency">'),print(LiteApp.getEvent().get("currency")),__p.push('</span></div><div class="small-flex columns no-padding input-wrapper" ><label id="place-bid-amount-label" for="place-bid-amount" class="off-screen" >'),print(getBidPlaceholderText()),__p.push('</label><input aria-describedby="place-bid-error-label"id="place-bid-amount"type="tel"pattern="[0-9,.]*"name="amount"autocomplete="off"placeholder="'),print(getBidPlaceholderText()),__p.push('"data-abide-validator="bidIsValid"data-abide-disable-pattern="true" /><small class="error" id="place-bid-error-label" ></small></div></div></div></div></div></div><div class="bidConversionView__body__bid-actions"><form data-abide="ajax" data-live-validate="false" action="#" class="bidConversionView__body__bid-actions__wrapper actionsForm" >'),showAnonymous&&(__p.push('<button type="button" class="bidConversionView__body__bid-actions__button a-button a-button--round a-button--bigger a-button--grey a-button--valid" onclick="this.form.originButton=this.name;" name="anonymousBid"><div class="a-button__label">'),print(getBidAnonymousButtonText()),__p.push("</div></button>")),__p.push('<button type="button" class="bidConversionView__body__bid-actions__button a-button a-button--round a-button--bigger a-button--grey a-button--valid" onclick="this.form.originButton=this.name;" name="normalBid" ><div class="a-button__label">'),print(getBidButtonText()),__p.push('</div></button></form></div></div><div class="loader"></div>')
4}catch(e){console.log(e)}return __p.join("")}}),define("views/pledges/bidConversionView",["views/pledges/placeDonationSuccessView","views/lots/bidAmountInterface","views/windowResizeInterface","tpl!templates/pledges/bidConversion.html","model/donation","vent"],function(PlaceDonationSuccessView,BidAmountInterface,WindowResizeInterface,BidConversionTemplate,Donation){var PlaceDonationSuccessViewWithBidAmountInterface=PlaceDonationSuccessView.extend(BidAmountInterface),PlaceDonationSuccessViewWithBidAmountInterfaceAndWindowResizeInterface=PlaceDonationSuccessViewWithBidAmountInterface.extend(WindowResizeInterface),BidConversionView=PlaceDonationSuccessViewWithBidAmountInterfaceAndWindowResizeInterface.extend({template:BidConversionTemplate,className:"bidConversionView",listUrl:null,donation:null,windowChangeTimeout:null,initialize:function(){this.donation="undefined"!=typeof arguments[0]&&"undefined"!=typeof arguments[0].donation?arguments[0].donation:new Donation,this._super.apply(this,arguments)},templateHelpers:function(){return{getBidButtonText:function(){return locale.pledges.bid_conversion.confirm_donation_button},getBidAnonymousButtonText:function(){return locale.pledges.bid_conversion.confirm_anonymous_donation_button},getBidErrorText:function(){return locale.pledges.bid_conversion.place_donation_amount_error}}},serializeData:function(){return _.extend({},this._super(),{donation:this.donation,showAnonymous:LiteApp.getEvent().get("anonPledgeOnLite")})},getActionsElement:function(){return this.$(".bidConversionView__body__bid-actions")},getBidFormElement:function(){return this.$(".bidConversionView__body")},getBidInfoElement:function(){return this.$(".bidConversionView__body__bid-info")},getLastBidInfoRowElement:function(){return this.getBidInfoElement().find(".bidConversionView__body__bid-info__row:visible:last")},getBidAmountElement:function(){return this.getBidFormElement().find("[name=amount]")},getBidAmountValue:function(){return parseInt(this.getBidAmountElement().val().toString().replace(/,/g,""))},removeFixedClassFromBidFormElement:function(){this.getBidFormElement().removeClass("bidConversionView__body--fixed")},formIsValid:function(e){var form=$(e.target),originButton=form.get(0).originButton,that=this;return LiteApp.guest.isLogged()?LiteApp.router.navigate(LiteApp.router.getPlaceDonationLink(that.donation.get("lotId"),this.getBidAmountValue(),"anonymousBid"==originButton?!0:!1),{trigger:!0,silent:!0}
4):LiteApp.router.navigate(LiteApp.router.getCheckRegistrationLink(Backbone.history.fragment,null,LiteApp.router.getPlaceDonationLink(that.donation.get("lotId"),this.getBidAmountValue(),"anonymousBid"==originButton?!0:!1)),{trigger:!0}),!1},didChangeWindowSize:function(){var mq=matchMedia(Foundation.media_queries.medium);mq.matches?this.getActionsElement().removeClass("bidConversionView__body__bid-actions--fixed"):this.getActionsElement().addClass("bidConversionView__body__bid-actions--fixed")},getBidMinAmountErrorMessage:function(){return locale.pledges.bid_conversion.place_donation_amount_error},onRender:function(){this._super(),this.donation&&this.getBidAmountElement().val(this.donation.get("amount","withoutCurrency"))}});return BidConversionView}),define("controllers/pledgesController",["controllers/baseController","vent","jstorage","model/pledge","model/pledgesCollection","model/donation","model/category","model/categoriesCollection","model/commentsCollection","views/pledges/listView","views/pledges/itemView","views/pledges/confirmDonationView","views/pledges/placeDonationView","views/pledges/placeDonationSuccessView","views/pledges/placeDonationErrorView","views/pledges/categoriesListView","views/pledges/searchListView","views/pledges/bidConversionView","helper"],function(BaseController,vent,$,Pledge,PledgesCollection,Donation,Category,CategoriesCollection,CommentsCollection,PledgesListView,PledgeItemView,ConfirmDonationView,PlaceDonationView,PlaceDonationSuccessView,PlaceDonationErrorView,PledgesCategoriesListView,PledgesSearchListView,BidConversionView,helper){var PledgesController=BaseController.extend({"class":"pledges",layout:LiteApp.getLayout("default"),pledgesCollection:null,pledgesSearchCollection:null,pledgesCategoriesCollection:null,pledgeModel:null,categoryModel:null,searchTerm:"",menuPosition:"Make A Donation",pledgeLinkFunction:LiteApp.router.getPledgeLink,searchPledgeLinkFunction:LiteApp.router.getSearchPledgeLink,initialize:function(){BaseController.prototype.initialize.apply(this,arguments),this.pledgesCollection=LiteApp.pledgesCollection},didClickSearchButton:function(term){LiteApp.router.navigate(LiteApp.router.getPledgesSearchLink(null,term),{trigger:!0})},getPledgesCollection:function(categoryModel){return this.pledgesCollection instanceof PledgesCollection?(this.pledgesCollection.category=categoryModel instanceof Category?categoryModel.get("categoryName"):"",this.pledgesCollection.loaded=!1,this.pledgesCollection):(this.setPledgesCollection(new PledgesCollection($.jStorage.get("controller:pledges:collection",[]),{eventID:LiteApp.getEvent().get("id"),category:categoryModel instanceof Category?categoryModel.get("categoryName"):""})),this.pledgesCollection)},setPledgesCollection:function(value){this.pledgesCollection=value,$.jStorage.set("controller:pledges:collection",value)},getPledgesSearchCollection:function(reset){return reset="undefined"==typeof reset?!1:reset,this.pledgesSearchCollection instanceof PledgesCollection?(reset&&(this.pledgesSearchCollection.fetchParameters.q="",this.pledgesSearchCollection.reset([])),this.pledgesSearchCollection.loaded=!1,this.pledgesSearchCollection):(this.setPledgesSearchCollection(new PledgesCollection(reset?[]:$.jStorage.get("controller:pledges:search:collection",[]),{eventID:LiteApp.getEvent().get("id")})),this.pledgesSearchCollection)},setPledgesSearchCollection:function(value){this.pledgesSearchCollection instanceof PledgesCollection&&this.stopListening(this.pledgesSearchCollection),this.pledgesSearchCollection=value,$.jStorage.set("controller:pledges:search:collection",value),this.pledgesSearchCollection&&this.listenTo(this.pledgesSearchCollection,"sync",this.didSyncPledgesSearchCollection)},didSyncPledgesSearchCollection:function(collection){if(collection instanceof Backbone.Collection){$.jStorage.set("controller:pledges:search:collection",this.pledgesSearchCollection),this.searchTerm=this.pledgesSearchCollection.fetchParameters.q,$.jStorage.set("controller:pledges:search:term",this.searchTerm);var hash=LiteApp.router.getPledgesSearchLink(null,this.searchTerm);LiteApp.router.navigate(hash,{trigger:!1})}},setPledgeSearchTerm:function(value){this.searchTerm=value,$.jStorage.set("controller:pledges:search:term",value)},getPledgeSearchTerm:function(){return this.searchTerm?this.searchTerm:(this.searchTerm=$.jStorage.get("controller:pledges:search:term",""),this.searchTerm)}
4,getPledgeModel:function(resetLoaded){return"undefined"==typeof resetLoaded&&(resetLoaded=!0),this.pledgeModel instanceof Pledge?(resetLoaded&&(this.pledgeModel.loaded=!1),this.pledgeModel):(this.setPledgeModel(new Pledge($.jStorage.get("controller:pledge:model",{}),{eventID:LiteApp.getEvent().get("id")})),this.pledgeModel)},setPledgeModel:function(value){this.pledgeModel instanceof Pledge&&this.stopListening(this.pledgeModel,"sync"),this.pledgeModel=value,$.jStorage.set("controller:pledge:model",value),this.pledgeModel&&this.listenTo(this.pledgeModel,"sync",this.didSyncPledgeModel)},didSyncPledgeModel:function(){$.jStorage.set("controller:pledge:model",this.pledgeModel)},getCategoryModel:function(){return this.categoryModel instanceof Category?this.categoryModel:(this.setCategoryModel(new Category({categoryName:"All Pledges"},{eventID:LiteApp.getEvent().get("id")})),this.categoryModel)},setCategoryModel:function(value){this.categoryModel=value},getCommentsCollection:function(pledgeId){return new CommentsCollection([],{eventID:LiteApp.getEvent().get("id"),pledgeId:pledgeId,fetchParameters:{offset:0}})},getSubmenuListNavigation:function(active){var submenu=[{name:locale.pledges.submenu.list,link:LiteApp.router.getAllPledgesLink(),active:"pledges"==active?!0:!1}];return LiteApp.getEvent().get("showPledgeCategories")&&submenu.push({name:locale.pledges.submenu.categories,link:LiteApp.router.getPledgesCategoriesLink(),active:"categories"==active?!0:!1}),submenu.push({name:locale.pledges.submenu.search,link:LiteApp.router.getPledgesSearchLink(),active:"search"==active?!0:!1}),submenu},getPledgeModelByNumber:function(pledgeNumber,fromSearch){var collection=fromSearch?this.getPledgesSearchCollection():this.getPledgesCollection(this.getCategoryModel()).getCollectionForCurrentCategory(),pledge=collection.findWhere({displayNumber:pledgeNumber});return"undefined"==typeof pledge&&(pledge=collection.findWhere({id:pledgeNumber})),"undefined"==typeof pledge&&(pledge=LiteApp.pledgesCollection.findWhere({displayNumber:pledgeNumber})),"undefined"==typeof pledge&&(pledge=LiteApp.pledgesCollection.findWhere({id:pledgeNumber})),pledge},getSubmenuItemNavigation:function(pledgeNumber,fromSearch,searchTerm,backUrl){fromSearch="undefined"==typeof fromSearch?!1:fromSearch;var pledge=this.getPledgeModelByNumber(pledgeNumber,fromSearch),collection=[];pledge instanceof Pledge&&(collection=pledge.collection||[]);var submenuOptions=[];if(submenuOptions=collection.length>1?backUrl?[{name:"<&nbsp;&nbsp;"+locale.lots.item_submenu.back,link:backUrl,active:!0}]:[{name:"<&nbsp;&nbsp;"+locale.pledges.item_submenu.list,link:fromSearch?LiteApp.router.getPledgesSearchLink(pledgeNumber,fromSearch?searchTerm:""):LiteApp.router.getAllPledgesLink(pledgeNumber,fromSearch?searchTerm:""),active:!0}]:fromSearch?[{name:"<&nbsp;&nbsp;"+locale.pledges.item_submenu.search,link:LiteApp.router.getPledgesSearchLink(pledgeNumber,fromSearch?searchTerm:"")}]:[{name:"<&nbsp;&nbsp;"+locale.pledges.item_submenu.back,link:"javascript:history.back()"}],pledge instanceof Pledge){this.setPledgeModel(pledge);var index=collection.index(pledge);if(index>0){var prevPledge=collection.at(index-1);prevPledge&&submenuOptions.push({name:locale.pledges.item_submenu.prev,link:fromSearch?LiteApp.router.getSearchPledgeLink(prevPledge.get("displayNumber"),searchTerm):LiteApp.router.getPledgeLink(prevPledge)})}if(index<collection.models.length-1){var nextPledge=collection.at(index+1);nextPledge&&submenuOptions.push({name:locale.pledges.item_submenu.next,link:fromSearch?LiteApp.router.getSearchPledgeLink(nextPledge.get("displayNumber"),searchTerm):LiteApp.router.getPledgeLink(nextPledge)})}}else this.setPledgeModel(helper.isUUID(pledgeNumber)?new Pledge({id:pledgeNumber},{eventID:LiteApp.getEvent().get("id"),collection:new PledgesCollection}):new Pledge({id:pledgeNumber},{eventID:LiteApp.getEvent().get("id"),fetchByNumber:!0,collection:new PledgesCollection}));return submenuOptions},index:function(params){params=params||{},this.submenuOptions=this.getSubmenuListNavigation("pledges");"undefined"!=typeof params.category?(this.setCategoryModel(new Category({categoryName:"undefined"!=typeof params.category?params.category:"All Pledges"},{eventID:LiteApp.getEvent().get("id")})),document.title=LiteApp.getEvent().getFormattedTitle(locale.menu.pledge+" | "+("undefined"!=typeof params.category?params.category:"All Pledges"))):document.title=LiteApp.getEvent().getFormattedTitle(locale.menu.pledge),this.view=new PledgesListView({pledges:this.getPledgesCollection(this.getCategoryModel()),itemLinkFunction:this.pledgeLinkFunction,scrollToItem:params.scrollToItem}),this.render()},showPledge:function(params){this.submenuOptions=this.getSubmenuItemNavigation(params.id),this.submenuRendering="alternative";var pledgeModel=this.getPledgeModel();this.view=new PledgeItemView({model:pledgeModel,comments:this.getCommentsCollection(pledgeModel.get("id"))}),this.render(),this.listenToOnce(pledgeModel,"sync",function(pledgeModel){document.title=LiteApp.getEvent().getFormattedTitle(pledgeModel.get("title"))})},confirmDonation:function(params){this.submenuOptions=this.getSubmenuItemNavigation(params.id,null,null,params.back),this.submenuRendering="alternative",params=params||{};var donation=null;if(params.id){var attributes={lotId:params.id};params.amount&&(attributes.amount=params.amount),params.comment&&(attributes.comment=params.comment),donation=new Donation(attributes,{eventID:LiteApp.getEvent().get("id"),guestID:LiteApp.guest.get("id"),fetchData:!1})}this.view=new ConfirmDonationView({model:this.getPledgeModel(),donation:donation}),this.render(),this.listenToOnce(this.getPledgeModel(),"sync",function(pledgeModel){document.title=LiteApp.getEvent().getFormattedTitle(pledgeModel.get("title")+" | "+locale.pledges.confirm_donation.title)})},donateInstead:function(params){this.submenuRendering="hide",params=params||{};var donation=null;if(params.id){var attributes={lotId:params.id};params.amount&&(attributes.amount=params.amount/100),donation=new Donation(attributes,{eventID:LiteApp.getEvent().get("id"),guestID:LiteApp.guest.get("id"),fetchData:!1})}this.view=new BidConversionView({model:this.getPledgeModel(),donation:donation}),this.render(),this.listenToOnce(this.getPledgeModel(),"sync",function(pledgeModel){document.title=LiteApp.getEvent().getFormattedTitle(pledgeModel.get("title")+" | "+locale.pledges.confirm_donation.title)})},placeDonation:function(params){this.submenuOptions=[],params=params||{};var donation=null;if(!params.id||!params.amount)return void LiteApp.router.navigate(LiteApp.router.getPlaceDonationErrorLink());var attributes={pledgeId:params.id,amount:params.amount,anonymous:params.anonymous,comment:params.comment,hideAmount:params.hideAmount};donation=new Donation(attributes,{eventID:LiteApp.getEvent().get("id"),guestID:LiteApp.guest.get("id"),fetchData:!1}),this.view=new PlaceDonationView({model:donation}),this.render()},placeDonationSuccess:function(params){this.submenuOptions=this.getSubmenuItemNavigation(params.id),this.submenuRendering="alternative",this.view=new PlaceDonationSuccessView({model:this.getPledgeModel(),itemLinkFunction:LiteApp.router.getPledgeLink,backUrl:LiteApp.router.getAllPledgesLink()}),this.render(),this.listenToOnce(this.getPledgeModel(),"sync",function(pledgeModel){document.title=LiteApp.getEvent().getFormattedTitle(pledgeModel.get("title")+" | "+locale.pledges.place_donation.success_header)})},placeDonationError:function(params){this.submenuOptions=this.getSubmenuItemNavigation(params.id),this.submenuRendering="alternative",this.view=new PlaceDonationErrorView({model:this.getPledgeModel()}),this.render(),this.listenToOnce(this.getPledgeModel(),"sync",function(pledgeModel){document.title=LiteApp.getEvent().getFormattedTitle(pledgeModel.get("title")+" | "+locale.pledges.place_donation.error_header)})},categories:function(){this.submenuOptions=this.getSubmenuListNavigation("categories");this.view=new PledgesCategoriesListView({pledges:this.getPledgesCollection(),selectedCategory:this.getCategoryModel(),itemLinkFunction:this.pledgeLinkFunction}),this.render(),document.title=LiteApp.getEvent().getFormattedTitle(locale.menu.pledge+" | "+locale.pledges.submenu.categories)},search:function(params){params=params||{},this.submenuOptions=this.getSubmenuListNavigation("search");var searchTerm="";"undefined"!=typeof params.term&&(searchTerm=params.term),this.view=new PledgesSearchListView({collection:this.getPledgesSearchCollection(!0),searchTerm:searchTerm,itemLinkFunction:this.searchPledgeLinkFunction,scrollToItem:params.scrollToItem}),this.render(),document.title=LiteApp.getEvent().getFormattedTitle(locale.menu.pledge+" | "+locale.pledges.submenu.search)},showSearchPledge:function(params){var searchTerm="";"undefined"!=typeof params.term&&(searchTerm=params.term),this.submenuOptions=this.getSubmenuItemNavigation(params.id,!0,searchTerm),this.submenuRendering="alternative",this.view=new PledgeItemView({model:this.getPledgeModel()}),this.render(),this.listenToOnce(this.getPledgeModel(),"sync",function(pledgeModel){document.title=LiteApp.getEvent().getFormattedTitle(pledgeModel.get("title"))})}});return PledgesController});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.