/* Widget: q4.api Version: 1.13.4 Compiled: 2020-07-06 */ !function(a){a.widget("q4.api",{options:{url:"",usePublic:!1,useJSONP:!1,languageId:null,apiKey:"",limit:0,limitSort:0,skip:0,excludeSelection:!1,fetchAllYears:!1,showAllYears:!1,allYearsText:"All",startYear:null,forceStartYear:!1,isTimeZoneKey:{PT:"PST",MT:"MST",CT:"CST",ET:"EST",AT:"AST",GT:"GST",GMT:"GMT",BST:"GMT"},tags:[],titleLength:0,bodyLength:0,shortBodyLength:0,useMoment:!1,dateFormat:"MM d, yy",sortAscending:!1,years:[],minYear:null,maxYear:null,minDate:null,maxDate:null,defaultThumb:"",append:!0,cssClass:null,loadingClass:null,loadingMessage:'

Loading ...

',yearContainer:null,yearTemplate:null,yearTrigger:null,yearSelect:null,noYearsMessage:"",tagSelect:null,tagTrigger:null,activeClass:"js--selected",itemContainer:null,itemTemplate:"",itemLoadingClass:null,itemLoadingMessage:null,itemNotFoundMessage:'

No items found.

',template:"",onYearChange:function(a,b){},onTagChange:function(a,b){},beforeRender:function(a,b){},beforeRenderItems:function(a,b){},beforeRenderYears:function(a,b){},itemsComplete:function(a){},complete:function(a){}},reloadYears:function(){var b=this,c=this.options,d=this.element;b._getYears().done(function(e,f){var g={years:[]};e.length?(b.years=b._filterYears(e),a.each(b.years,function(a,b){g.years.push({year:b,value:b})}),b.currentYear=g.years[0].year,a(c.yearContainer,d).empty(),a.each(g.years,function(b,e){a(c.yearContainer,d).append(Mustache.render(c.yearTemplate,e))}),b._updateYearControls(b.currentYear),b.reloadItems(),c.yearTrigger&&a(c.yearTrigger,d).each(function(d){var e=g.years[d].value;a(this).data("year",e),a(this).click(function(d){a(this).hasClass(c.activeClass)||b.setYear(e,d)})}),c.yearSelect&&a(c.yearSelect,d).change(function(c){b.setYear(a(this).val(),c)})):(a(c.yearContainer,d).empty(),a(c.yearContainer,d).append(c.noYearsMessage),a(c.itemContainer,d).html(c.itemNotFoundMessage||""))})},reloadItems:function(){var b=this,c=this.options,d=this.element;if(c.itemContainer&&c.itemTemplate){var e=a(c.itemContainer,d);c.itemLoadingClass&&e.addClass(c.itemLoadingClass),e.html(c.itemLoadingMessage||"")}else c.loadingClass&&this.$widget.addClass(c.loadingClass),this.$widget.html(c.loadingMessage||"");this._fetchItems(this.currentYear).done(function(a){c.itemContainer&&c.itemTemplate?b._renderItems(a):b._renderWidget(a)})},setYear:function(b,c){var d=this.options,e=parseInt(b);-1==a.inArray(e,this.years)&&(e=d.showAllYears?-1:this.years[0]),this._trigger("onYearChange",c,{year:e}),c&&c.isDefaultPrevented()||(this.currentYear=e,this._updateYearControls(this.currentYear),this.reloadItems())},setTags:function(a,b,c){a=this._convertToArray(a),this._trigger("onTagChange",c,{tags:a}),c&&c.isDefaultPrevented()||(this.currentTags=a,this._updateTagControls(this.currentTags),b?this.reloadYears():this.reloadItems())},$widget:null,years:null,currentYear:-1,currentTags:[],_setOption:function(a,b){this._super(a,b),this._normalizeOptions()},_convertToArray:function(b){return"string"==typeof b&&(b=a.trim(b).split(/[\s,|]+/)),a.isArray(b)?b:[]},_convertToDate:function(a){var b=new Date(a);return"Invalid Date"==b.toString()?null:b},_normalizeOptions:function(){var a=this.options;a.url=a.url.replace(/\/$/,""),a.years=this._convertToArray(a.years).sort(function(a,b){return b-a}),a.tags=this._convertToArray(a.tags),"string"==typeof a.startYear&&a.startYear.length&&(a.startYear=parseInt(a.startYear)),a.minDate=a.minDate?this._convertToDate(a.minDate):null,a.maxDate=a.maxDate?this._convertToDate(a.maxDate):null,null===a.itemLoadingClass&&(a.itemLoadingClass=a.loadingClass),null===a.itemLoadingMessage&&(a.itemLoadingMessage=a.loadingMessage);var b=(new Date).getFullYear();a.showPast&&!a.showFuture?a.maxYear=Math.min(b,a.maxYear||b):a.showFuture&&!a.showPast&&(a.minYear=Math.max(b,a.minYear||b))},_init:function(){var b=this,c=this.options,d=this.element;if("api"==this.widgetName)throw new Error("Please use one of q4.api's child widgets.");this.contentType=this.contentTypes[this.widgetName],this._normalizeOptions(),this.$widget=c.append?a("
").appendTo(d):d,c.cssClass&&this.$widget.addClass(c.cssClass),c.loadingClass&&this.$widget.addClass(c.loadingClass),this.$widget.html(c.loadingMessage||""),this.currentTags=c.tags,this._getYears().done(function(a,c){b.years=b._filterYears(a),b.currentYear=b._getCurrentYear(b.years),void 0!==c?b._renderWidget(c):b._fetchItems(b.currentYear).done(function(a){b._renderWidget(a)})})},_getYears:function(){var b=this.options;if(b.fetchAllYears&&!b.limit){var c=a.Deferred();return this._fetchItems(-1).done(function(b){var d=[];a.each(b,function(b,c){-1==a.inArray(c.year,d)&&d.push(c.year)}),c.resolve(d,b)}),c}return this._fetchYears()},_filterYears:function(b){var c=this.options;return b=a.grep(b,function(b){return(!c.minYear||b>=c.minYear)&&(!c.maxYear||b<=c.maxYear)&&(!c.years.length||a.inArray(b,c.years)>-1)}),c.forceStartYear&&-1==a.inArray(c.startYear,b)&&b.push(c.startYear),b.sort(function(a,b){return b-a}),b},_getCurrentYear:function(b){var c=this.options;if(b.length){if(a.inArray(c.startYear,b)>-1)return c.startYear;if(!c.showAllYears)return b[0]}return-1},_buildParams:function(){var a=this.options;return a.usePublic?{apiKey:a.apiKey,LanguageId:a.languageId?a.languageId:GetLanguageId()}:{serviceDto:{ViewType:GetViewType(),ViewDate:GetViewDate(),RevisionNumber:GetRevisionNumber(),LanguageId:a.languageId?a.languageId:GetLanguageId(),Signature:GetSignature()}}},_callApi:function(b,c){var d=this.options;return d.usePublic?a.ajax({type:"GET",url:d.url+b,data:c,contentType:"application/json; charset=utf-8",dataType:d.useJSONP?"jsonp":"json"}):a.ajax({type:"POST",url:b,data:JSON.stringify(c),contentType:"application/json; charset=utf-8",dataType:"json"})},_fetchYears:function(){var b=this,c=this.options,d=c.usePublic?1:0,e=a.Deferred(),f=a.grep(this.currentTags||[],function(a){return a.length>0}),g=c.usePublic?{tagList:f.join("|")}:{serviceDto:{TagList:f}};return this._callApi(this.contentType.yearsUrl[d],a.extend(!0,this._buildParams(),this.contentType.buildParams.call(this,c),g)).done(function(a){b._trigger("beforeRenderYears",null,{items:a[b.contentType.yearsResultField]}),e.resolve(a[b.contentType.yearsResultField])}),e},_fetchItems:function(b){var c=this,d=this.options,e=d.usePublic?1:0,f=a.Deferred(),g=a.grep(this.currentTags,function(a){return a.length>0}),h=d.usePublic?{pageSize:d.limit||-1,pageNumber:d.skip,tagList:g.join("|"),includeTags:!0,year:d.fetchAllYears?-1:b,excludeSelection:d.excludeSelection?0:1}:{serviceDto:{ItemCount:d.limit||-1,StartIndex:d.skip,TagList:g,IncludeTags:!0},excludeSelection:d.excludeSelection?0:1,year:d.fetchAllYears?-1:b};return this._callApi(this.contentType.itemsUrl[e],a.extend(!0,this._buildParams(),this.contentType.buildParams.call(this,d),h)).done(function(b){var e=a.map(b[c.contentType.itemsResultField],function(a){return c.contentType.parseItem.call(c,d,a)});e=a.grep(e,function(a){return(!d.minDate||a.dateObj>=d.minDate)&&(!d.maxDate||a.dateObj<=d.maxDate)}),e.sort(function(a,b){return(b.dateObj-a.dateObj)*(d.sortAscending?-1:1)}),0!==d.docOrder&&void 0!==d.docOrder&&a.each(e,function(b,c){a.each(d.docOrder,function(b,d){a.grep(c.docs,function(a){return a.docType==d}).length||c.docs.push({docType:d,docUrl:"",docEmpty:!0})}),c.docs.sort(function(b,c){var e=a.inArray(b.docType,d.docOrder),f=a.inArray(c.docType,d.docOrder);return ef?1:0})}),f.resolve(e)}),f},_truncate:function(a,b){return a?!b||a.length<=b?a:a.substring(0,b)+"...":""},_formatDate:function(b){var c=this.options,d=new Date(b),e=c.useMoment&&"undefined"!=typeof moment;if("string"==typeof c.dateFormat)return e?moment(d).format(c.dateFormat):a.datepicker.formatDate(c.dateFormat,d);if("object"==typeof c.dateFormat){var f={};for(name in c.dateFormat)f[name]=e?moment(d).format(c.dateFormat[name]):a.datepicker.formatDate(c.dateFormat[name],d);return f}},_buildTemplateData:function(b){var c=this,d=this.options,e={},f={items:[],years:[],yearsWithItems:[]};return a.each(b,function(b,d){if(-1==a.inArray(d.year,c.years))return!0;d.year in e||(e[d.year]=[]),f.items.push(d),e[d.year].push(d)}),d.showAllYears&&this.years.length&&f.years.push({year:d.allYearsText,value:-1,items:f.items}),a.each(this.years,function(a,b){f.years.push({year:b,value:b,items:e[b]||[]}),b in e&&f.yearsWithItems.push({year:b,value:b,items:e[b]})}),f},_renderItems:function(b){var c=this.options,d=this.element,e=a(c.itemContainer,d);c.limitSort&&b.reverse();var f={items:b};this._trigger("beforeRenderItems",null,f),c.itemLoadingClass&&e.removeClass(c.itemLoadingClass),f.items.length?(e.empty(),a.each(f.items,function(a,b){e.append(Mustache.render(c.itemTemplate,b))})):e.html(c.itemNotFoundMessage||""),this._trigger("itemsComplete")},_renderWidget:function(b){var c=this,d=this.options,e=this.element;d.limitSort&&b.reverse();var f=this._buildTemplateData(b),g=[];a.each(f.years,function(a,b){b.value==c.currentYear&&(b.active=!0,g=b.items)}),this._trigger("beforeRender",null,f),d.loadingClass&&this.$widget.removeClass(d.loadingClass),this.$widget.html(Mustache.render(d.template,f)),d.itemContainer&&d.itemTemplate&&this._renderItems(g),d.yearContainer&&d.yearTemplate&&(a(d.yearContainer,e).empty(),f.years.length?a.each(f.years,function(b,c){a(d.yearContainer,e).append(Mustache.render(d.yearTemplate,c))}):a(d.yearContainer,e).append(d.noYearsMessage)),d.yearTrigger&&a(d.yearTrigger,e).each(function(b){var e=f.years[b].value;a(this).data("year",e),a(this).click(function(b){a(this).hasClass(d.activeClass)||c.setYear(e,b)})}),d.yearSelect&&a(d.yearSelect,e).change(function(b){c.setYear(a(this).val(),b)}),d.tagSelect&&a(d.tagSelect,e).change(function(b){c.setTags(a(this).val(),!0,b)}),d.tagTrigger&&a(d.tagTrigger,e).each(function(b){a(this).click(function(b){a(this).hasClass(d.activeClass)||c.setTags(a(this).data("tag"),!0,b)})}),d.customSelect,this._updateYearControls(this.currentYear),this._trigger("complete")},_updateYearControls:function(b){var c=this.options,d=this.element;c.yearTrigger&&a(c.yearTrigger,d).each(function(){a(this).toggleClass(c.activeClass,a(this).data("year")==b)}),c.yearSelect&&a(c.yearSelect,d).val(b)},_updateTagControls:function(b){var c=this.options,d=this.element;c.tagTrigger&&a(c.tagTrigger,d).each(function(){a(this).toggleClass(c.activeClass,a(this).data("tag")==b)}),c.tagSelect&&a(c.tagSelect,d).val(b)},contentTypes:{downloads:{itemsUrl:["/Services/ContentAssetService.svc/GetContentAssetList","/feed/ContentAsset.svc/GetContentAssetList"],yearsUrl:["/Services/ContentAssetService.svc/GetContentAssetYearList","/feed/ContentAsset.svc/GetContentAssetYearList"],itemsResultField:"GetContentAssetListResult",yearsResultField:"GetContentAssetYearListResult",buildParams:function(a){return{assetType:a.downloadType}},parseItem:function(a,b){return{title:this._truncate(b.Title,a.titleLength),url:b.FilePath,dateObj:new Date(b.ContentAssetDate),year:new Date(b.ContentAssetDate).getFullYear(),date:this._formatDate(b.ContentAssetDate),type:b.Type,fileType:b.FileType,size:b.FileSize,icon:b.IconPath,thumb:b.ThumbnailPath,tags:b.TagsList,description:this._truncate(b.Description,a.bodyLength)}}},events:{itemsUrl:["/Services/EventService.svc/GetEventList","/feed/Event.svc/GetEventList"],yearsUrl:["/Services/EventService.svc/GetEventYearList","/feed/Event.svc/GetEventYearList"],itemsResultField:"GetEventListResult",yearsResultField:"GetEventYearListResult",buildParams:function(a){return{eventSelection:a.showFuture&&!a.showPast?1:a.showPast&&!a.showFuture?0:3,eventDateFilter:a.showFuture&&!a.showPast?1:a.showPast&&!a.showFuture?0:3,includeFinancialReports:!0,includePresentations:!0,includePressReleases:!0,sortOperator:a.sortAscending?0:1}},parseItem:function(b,c){a.each(b.isTimeZoneKey,function(a,c){b.isTimeZoneKey[c]=c});var d=this,e=new Date,f="0"==c.TimeZone?"":b.isTimeZoneKey[c.TimeZone]?b.isTimeZoneKey[c.TimeZone]:"",g=new Date(c.StartDate+" "+f),h=new Date(c.EndDate+" "+f);return{title:this._truncate(c.Title,b.titleLength),url:c.LinkToDetailPage,id:c.EventId,dateObj:g,year:g.getFullYear(),date:this._formatDate(c.StartDate),endDate:this._formatDate(c.EndDate),timeZone:"0"==c.TimeZone?"":c.TimeZone,isFuture:g>e,isPast:h-1})),{coverUrl:c.CoverImagePath,title:c.ReportTitle,fiscalYear:c.ReportYear,dateObj:new Date(c.ReportDate),year:c.ReportYear,date:this._formatDate(c.ReportDate),tags:c.TagsList,type:c.ReportSubType,shortType:void 0!=b.shortTypes?b.shortTypes[c.ReportSubType]:c.ReportSubType,docs:e}}},presentations:{itemsUrl:["/Services/PresentationService.svc/GetPresentationList","/feed/Presentation.svc/GetPresentationList"],yearsUrl:["/Services/PresentationService.svc/GetPresentationYearList","/feed/Presentation.svc/GetPresentationYearList"],itemsResultField:"GetPresentationListResult",yearsResultField:"GetPresentationYearListResult",buildParams:function(a){var b={};return a.usePublic?b.presentationDateFilter=a.showFuture&&!a.showPast?0:a.showPast&&!a.showFuture?1:3:b.presentationSelection=a.showFuture&&!a.showPast?0:a.showPast&&!a.showFuture?1:3,b},parseItem:function(a,b){return{title:this._truncate(b.Title,a.titleLength),url:b.LinkToDetailPage,dateObj:new Date(b.PresentationDate),year:new Date(b.PresentationDate).getFullYear(),date:this._formatDate(b.PresentationDate),tags:b.TagsList,body:this._truncate(b.Body,a.bodyLength),docUrl:b.DocumentPath,docSize:b.DocumentFileSize,docType:b.DocumentFileType,audioUrl:b.AudioFile,audioType:b.AudioFileType,audioSize:b.AudioFileSize,videoUrl:b.VideoFile,videoType:b.VideoFileType,videoSize:b.VideoFileSize,relatedUrl:b.RelatedFile,relatedType:b.RelatedFileType,relatedSize:b.RelatedFileSize,thumb:b.ThumbnailPath}}},news:{itemsUrl:["/Services/PressReleaseService.svc/GetPressReleaseList","/feed/PressRelease.svc/GetPressReleaseList"],yearsUrl:["/Services/PressReleaseService.svc/GetPressReleaseYearList","/feed/PressRelease.svc/GetPressReleaseYearList"],itemsResultField:"GetPressReleaseListResult",yearsResultField:"GetPressReleaseYearListResult",buildParams:function(a){var b=a.loadShortBody?a.loadBody?1:3:a.loadBody?2:0,c={};return a.usePublic?(c.bodyType=b,c.pressReleaseDateFilter=a.showFuture&&!a.showPast?0:a.showPast&&!a.showFuture?1:3,c.categoryId=a.category):(c.pressReleaseBodyType=b,c.pressReleaseSelection=a.showFuture&&!a.showPast?0:a.showPast&&!a.showFuture?1:3,c.pressReleaseCategoryWorkflowId=a.category),c},parseItem:function(b,c){return{title:this._truncate(c.Headline,b.titleLength),url:c.LinkToDetailPage,dateObj:new Date(c.PressReleaseDate),year:new Date(c.PressReleaseDate).getFullYear(),date:this._formatDate(c.PressReleaseDate),tags:c.TagsList,category:c.Category,excludeFromLatest:c.ExcludeFromLatest,languageId:c.LanguageId,linkToPage:c.LinkToPage,linkToUrl:c.LinkToUrl,pressReleaseId:c.PressReleaseId,shortDescription:c.ShortDescription,seoName:c.SeoName,body:this._truncate(c.Body,b.bodyLength),shortBody:this._truncate(c.ShortBody,b.shortBodyLength),docUrl:c.DocumentPath,docSize:c.DocumentFileSize,docType:c.DocumentFileType,thumb:c.ThumbnailPath||b.defaultThumb,media:a.map(c.MediaCollection,function(a){return{alt:a.Alt,url:a.SourceUrl,type:a.Style,height:a.Height,width:a.Width}}),attachments:a.map(c.Attachments,function(a){return{type:a.DocumentType,extension:a.Extension,size:a.Size,title:a.Title,category:a.Type,url:a.Url}}),multimedia:a.map(c.MediaFiles,function(b){return{id:b.PressReleaseMediaFileId,active:b.Active,thumbnail:b.ThumbnailPath,type:b.FileType,height:b.Height,url:b.Path,fileSize:b.Size,title:b.Title,category:b.Type,width:b.Width,sizes:a.map(b.Sizes,function(a){return{url:a.Path,category:a.Type,fileSize:a.Size,height:a.Height,width:a.Width}})}})}}},sec:{itemsUrl:["/Services/SECFilingService.svc/GetEdgarFilingList","/feed/SECFiling.svc/GetEdgarFilingList"],yearsUrl:["/Services/SECFilingService.svc/GetEdgarFilingYearList","/feed/SECFiling.svc/GetEdgarFilingYearList"],itemsResultField:"GetEdgarFilingListResult",yearsResultField:"GetEdgarFilingYearListResult",buildParams:function(a){return{exchange:a.exchange,symbol:a.symbol,formGroupIdList:a.filingGroups.join(","),filingTypeList:a.filingTypes.join(","),excludeNoDocuments:a.excludeNoDocuments,includeHtmlDocument:a.includeHtmlDocument}},parseItem:function(b,c){return{id:c.FilingId,description:this._truncate(c.FilingDescription,b.titleLength),url:c.LinkToDetailPage,dateObj:new Date(c.FilingDate),year:new Date(c.FilingDate).getFullYear(),date:this._formatDate(c.FilingDate),agent:c.FilingAgentName,person:c.ReportPersonName,type:c.FilingTypeMnemonic,docs:a.map(c.DocumentList,function(a){return{docType:a.DocumentType,docUrl:a.Url.replace(/(\w+:)/,"")}})}}}}}),a.widget("q4.downloads",a.q4.api,{options:{template:"",downloadType:null}}),a.widget("q4.events",a.q4.api,{options:{showFuture:!0,showPast:!0,template:""}}),a.widget("q4.financials",a.q4.api,{options:{reportTypes:[],shortTypes:{"Annual Report":"AR","Supplemental Report":"SR","First Quarter":"Q1","Second Quarter":"Q2","Third Quarter":"Q3","Fourth Quarter":"Q4"},docCategories:[],template:""},_sortItemsByType:function(b){var c=this.options,d=[],e={};return a.each(b,function(b,c){-1==a.inArray(c.type,d)&&(d.push(c.type),e[c.type]=[]),a.each(c.docs,function(a,b){e[c.type].push(b)})}),a.map(d,function(a,b){return{type:a,shortType:c.shortTypes[a],items:e[a]}})},_buildTemplateData:function(b){var c=this,d=this._super(b);return d.types=this._sortItemsByType(d.items),a.each(d.years,function(a,b){b.types=c._sortItemsByType(b.items)}),d}}),a.widget("q4.presentations",a.q4.api,{options:{showFuture:!0,showPast:!0,template:""}}),a.widget("q4.news",a.q4.api,{options:{category:"1cb807d2-208f-4bc3-9133-6a9ad45ac3b0",loadBody:!1,loadShortBody:!1,template:""}}),a.widget("q4.sec",a.q4.api,{options:{exchange:"",symbol:"",filingTypes:[],filingGroups:[],docOrder:["CONVPDF","RTF","XLS","XBRL","XBRL_HTML","HTML","CONVTEXT","ORIG"],excludeNoDocuments:!1,includeHtmlDocument:!1,template:""}})}(jQuery);