define(["exports","./edu-vendor","./edu-main","systemjs"],function(e,o,a,t){"use strict";var i=["dropdownList"];function n(e,t){1&e&&(o.ɵɵelementStart(0,"span",7),o.ɵɵlistener("onTap",function(){return!0}),o.ɵɵelementEnd()),2&e&&(e=o.ɵɵnextContext(),o.ɵɵproperty("cleanHTML",e.placeholder))}function r(e,t){1&e&&(o.ɵɵelementStart(0,"span",8),o.ɵɵlistener("onTap",function(){return!0}),o.ɵɵelementEnd()),2&e&&(e=o.ɵɵnextContext(),o.ɵɵproperty("cleanHTML",e.value))}function s(e,n){var i,t,r;1&e&&(i=o.ɵɵgetCurrentView(),o.ɵɵelementStart(0,"li",9),o.ɵɵlistener("onTap",function(e){o.ɵɵrestoreView(i);var t=n.index;return o.ɵɵnextContext().selectItem(e,t)}),o.ɵɵelementEnd()),2&e&&(t=n.$implicit,r=n.index,e=o.ɵɵnextContext(),o.ɵɵclassProp("active",e.activeidx==r),o.ɵɵproperty("cleanHTML",t))}function c(e,t){1&e&&o.ɵɵelement(0,"i",10)}function l(e,t,n,i,r,s){return{"ng-wh-error":e,"drp-b-darker":t,second:n,selected:i,opened:r,disabled:s}}function d(e,t){1&e&&(o.ɵɵelementStart(0,"span",12),o.ɵɵlistener("onTap",function(){return!0}),o.ɵɵelementEnd()),2&e&&(e=o.ɵɵnextContext(),o.ɵɵproperty("cleanHTML",e.placeholder))}function p(e,t){1&e&&(o.ɵɵelementStart(0,"span",13),o.ɵɵlistener("onTap",function(){return!0}),o.ɵɵelementEnd()),2&e&&(e=o.ɵɵnextContext(),o.ɵɵproperty("cleanHTML",e.value))}function u(e,t,n,i,r){return{"ng-wh-error":e,"drp-b-darker":t,second:n,selected:i,opened:r}}var h=(Object.defineProperty(g.prototype,"value",{get:function(){return(this._value||"").toString()},set:function(e){this.noselection=!e,this._value=e},enumerable:!1,configurable:!0}),g.prototype.controlList=function(e,t){this.disabled||(this.opened=void 0!==t?t:!this.opened,this.onTapped.emit(this),this.fixOverflow())},g.prototype.close=function(){this.opened=!1},g.prototype.open=function(){this.opened=!0},g.prototype.selectItem=function(e,t){void 0===t&&(t=0),e&&e.srcEvent&&(e.srcEvent.cancelBubble=!0),e&&e.stopPropagation&&e.stopPropagation(),this._value=this.items[t],this.activeidx=t,this.valueChange.emit(this.value),this.noselection=!1,this.selected.emit({eventName:"select",value:this.value,index:t}),this.close(),this._cd.detectChanges()},g.prototype.trackByFn=function(e){return e},g.prototype.ngOnInit=function(){this.value&&-1<this.items.indexOf(this.value)&&(this.activeidx=this.items.indexOf(this.value))},g.prototype.fixOverflow=function(){var t=this.dropdownList&&this.dropdownList.nativeElement,n=t&&t.parentElement;setTimeout(function(){try{var e=t.getBoundingClientRect();n.getBoundingClientRect().x+e.width>=window.innerWidth?t.classList.add("sticky-right"):t.classList.remove("sticky-right")}catch(e){throw e}})},g.ɵfac=function(e){return new(e||g)(o.ɵɵdirectiveInject(o.ChangeDetectorRef))},g.ɵcmp=o.ɵɵdefineComponent({type:g,selectors:[["ng-dropdown"]],viewQuery:function(e,t){var n;1&e&&o.ɵɵviewQuery(i,!0,o.ElementRef),2&e&&o.ɵɵqueryRefresh(n=o.ɵɵloadQuery())&&(t.dropdownList=n.first)},inputs:{placeholder:"placeholder",items:"items",second:"second",darker:["dark-borders","darker"],invalid:"invalid",disabled:"disabled",value:"value"},outputs:{valueChange:"valueChange",selected:"selected",onTapped:"onTapped"},decls:7,vars:14,consts:[["zing-touch","",1,"dropdown",3,"ngClass","onTap","onTapOutside"],["zing-touch","","class","dropdown-placeholder",3,"cleanHTML","onTap",4,"ngIf"],["zing-touch","","class","dropdown-selected",3,"cleanHTML","onTap",4,"ngIf"],[1,"dropdown-list","ng-enter-element",3,"ng-hidden"],["dropdownList",""],["class","dropdown-item","zing-touch","",3,"active","cleanHTML","onTap",4,"ngFor","ngForOf","ngForTrackBy"],["class","dropdown-arrow bf-icon-down-open",4,"ngIf"],["zing-touch","",1,"dropdown-placeholder",3,"cleanHTML","onTap"],["zing-touch","",1,"dropdown-selected",3,"cleanHTML","onTap"],["zing-touch","",1,"dropdown-item",3,"cleanHTML","onTap"],[1,"dropdown-arrow","bf-icon-down-open"]],template:function(e,t){1&e&&(o.ɵɵelementStart(0,"div",0),o.ɵɵlistener("onTap",function(e){return t.controlList(e)})("onTapOutside",function(e){return t.controlList(e,!1)}),o.ɵɵtemplate(1,n,1,1,"span",1),o.ɵɵtemplate(2,r,1,1,"span",2),o.ɵɵelementStart(3,"ul",3,4),o.ɵɵtemplate(5,s,1,3,"li",5),o.ɵɵelementEnd(),o.ɵɵtemplate(6,c,1,0,"i",6),o.ɵɵelementEnd()),2&e&&(o.ɵɵproperty("ngClass",o.ɵɵpureFunction6(7,l,t.invalid,t.darker,t.second,!t.noselection,t.opened,t.disabled)),o.ɵɵadvance(1),o.ɵɵproperty("ngIf",t.placeholder&&t.noselection),o.ɵɵadvance(1),o.ɵɵproperty("ngIf",!t.noselection),o.ɵɵadvance(1),o.ɵɵproperty("ng-hidden",!t.opened),o.ɵɵadvance(2),o.ɵɵproperty("ngForOf",t.items)("ngForTrackBy",t.trackByFn),o.ɵɵadvance(1),o.ɵɵproperty("ngIf",!t.disabled))},directives:[a.TouchGestures,o.NgClass,o.NgIf,a.ngHidden,o.NgForOf,a.ngCleanHTML],encapsulation:2}),g);function g(e){this._cd=e,this.placeholder="Select...",this.items=[],this.darker=!1,this.invalid=!1,this.disabled=!1,this.valueChange=new o.EventEmitter,this.selected=new o.EventEmitter,this.onTapped=new o.EventEmitter,this.noselection=!0,this.opened=!1,this.activeidx=null}o.setClassMetadata(h,[{type:o.Component,args:[{selector:"ng-dropdown",template:'<div class="dropdown" [ngClass]="{ \'ng-wh-error\' : invalid, \'drp-b-darker\'  : darker, \'second\' : second, \'selected\' : !noselection, \'opened\' : opened, \'disabled\' : disabled }" zing-touch (onTap)="controlList($event)" (onTapOutside)="controlList($event,false)">\n                    <span zing-touch (onTap)="true" class="dropdown-placeholder" *ngIf="(placeholder && noselection)" [cleanHTML]="placeholder"></span>\n                    <span zing-touch (onTap)="true" class="dropdown-selected" *ngIf="!noselection" [cleanHTML]="value"></span>\n                    <ul class="dropdown-list ng-enter-element" [ng-hidden]="!opened" #dropdownList>\n                        <li *ngFor="let item of items; index as i; trackBy: trackByFn" class="dropdown-item" [class.active]="activeidx == i" zing-touch (onTap)="selectItem($event,i)" [cleanHTML]="item"></li>\n                    </ul>\n                    <i class="dropdown-arrow bf-icon-down-open" *ngIf="!disabled"></i>\n                </div>'}]}],function(){return[{type:o.ChangeDetectorRef}]},{placeholder:[{type:o.Input}],items:[{type:o.Input}],second:[{type:o.Input}],darker:[{type:o.Input,args:["dark-borders"]}],invalid:[{type:o.Input,args:["invalid"]}],disabled:[{type:o.Input}],valueChange:[{type:o.Output}],selected:[{type:o.Output}],onTapped:[{type:o.Output}],dropdownList:[{type:o.ViewChild,args:["dropdownList",{read:o.ElementRef,static:!1}]}],value:[{type:o.Input}]});var f,m=(f=h,__extends(v,f),v.prototype.Check=function(e){void 0!==e&&(this.booleanValue===e?(this.booleanValue=null,this.value=null):(this.booleanValue=e,this.value=e?"Yes":"No"),this.valueChange.emit(this.value))},v.ɵfac=function(e){return _(e||v)},v.ɵcmp=o.ɵɵdefineComponent({type:v,selectors:[["ng-dropdown-bool"]],inputs:{text:"text",name:"name",label:"label"},features:[o.ɵɵInheritDefinitionFeature],decls:19,vars:19,consts:[["zing-touch","",1,"dropdown",3,"ngClass","onTap","onTapOutside"],["zing-touch","","class","dropdown-placeholder",3,"cleanHTML","onTap",4,"ngIf"],["zing-touch","","class","dropdown-selected",3,"cleanHTML","onTap",4,"ngIf"],[1,"dropdown-list","ng-enter-element",3,"ng-hidden"],["dropdownList",""],[1,"text"],[1,"boolean-items"],["zing-touch","",1,"checkbox",3,"zingToggle"],["type","checkbox","value","",3,"checked","name","change"],[1,"track","bf-icon-ok"],[1,"name"],[1,"dropdown-arrow","bf-icon-down-open"],["zing-touch","",1,"dropdown-placeholder",3,"cleanHTML","onTap"],["zing-touch","",1,"dropdown-selected",3,"cleanHTML","onTap"]],template:function(e,t){1&e&&(o.ɵɵelementStart(0,"div",0),o.ɵɵlistener("onTap",function(e){return t.controlList(e)})("onTapOutside",function(e){return t.controlList(e,!1)}),o.ɵɵtemplate(1,d,1,1,"span",1),o.ɵɵtemplate(2,p,1,1,"span",2),o.ɵɵelementStart(3,"div",3,4),o.ɵɵelementStart(5,"p",5),o.ɵɵtext(6),o.ɵɵelementEnd(),o.ɵɵelementStart(7,"div",6),o.ɵɵelementStart(8,"label",7),o.ɵɵelementStart(9,"input",8),o.ɵɵlistener("change",function(){return t.Check(!0)}),o.ɵɵelementEnd(),o.ɵɵelement(10,"i",9),o.ɵɵelementStart(11,"span",10),o.ɵɵtext(12,"Yes"),o.ɵɵelementEnd(),o.ɵɵelementEnd(),o.ɵɵelementStart(13,"label",7),o.ɵɵelementStart(14,"input",8),o.ɵɵlistener("change",function(){return t.Check(!1)}),o.ɵɵelementEnd(),o.ɵɵelement(15,"i",9),o.ɵɵelementStart(16,"span",10),o.ɵɵtext(17,"No"),o.ɵɵelementEnd(),o.ɵɵelementEnd(),o.ɵɵelementEnd(),o.ɵɵelementEnd(),o.ɵɵelement(18,"i",11),o.ɵɵelementEnd()),2&e&&(o.ɵɵproperty("ngClass",o.ɵɵpureFunction5(13,u,t.invalid,t.darker,t.second,!t.noselection,t.opened)),o.ɵɵadvance(1),o.ɵɵproperty("ngIf",t.placeholder&&t.noselection),o.ɵɵadvance(1),o.ɵɵproperty("ngIf",!t.noselection),o.ɵɵadvance(1),o.ɵɵproperty("ng-hidden",!t.opened),o.ɵɵadvance(3),o.ɵɵtextInterpolate1(" ",t.text," "),o.ɵɵadvance(2),o.ɵɵproperty("zingToggle",!0),o.ɵɵattribute("aria-label",t.label),o.ɵɵadvance(1),o.ɵɵproperty("checked",!0===t.booleanValue)("name",t.name),o.ɵɵadvance(4),o.ɵɵproperty("zingToggle",!0),o.ɵɵattribute("aria-label",t.label),o.ɵɵadvance(1),o.ɵɵproperty("checked",!1===t.booleanValue)("name",t.name))},directives:[a.TouchGestures,o.NgClass,o.NgIf,a.ngHidden,a.ngCleanHTML],encapsulation:2}),v);function v(){var e=null!==f&&f.apply(this,arguments)||this;return e.text="Some text to display",e.name="",e.label="",e.booleanValue=null,e}var _=o.ɵɵgetInheritedFactory(m);o.setClassMetadata(m,[{type:o.Component,args:[{selector:"ng-dropdown-bool",template:'<div class="dropdown" [ngClass]="{ \'ng-wh-error\' : invalid, \'drp-b-darker\'  : darker, \'second\' : second, \'selected\' : !noselection, \'opened\' : opened }" zing-touch (onTap)="controlList($event)" (onTapOutside)="controlList($event,false)">\n                    <span zing-touch (onTap)="true" class="dropdown-placeholder" *ngIf="(placeholder && noselection)" [cleanHTML]="placeholder"></span>\n                    <span zing-touch (onTap)="true" class="dropdown-selected" *ngIf="!noselection" [cleanHTML]="value"></span>\n                    <div class="dropdown-list ng-enter-element" [ng-hidden]="!opened" #dropdownList>\n                        <p class="text"> {{ text }} </p>\n                        <div class="boolean-items">\n                            <label class="checkbox" zing-touch [zingToggle]="true" [attr.aria-label]="label">\n                                <input type="checkbox" value="" [checked]="booleanValue === true" (change)="Check(true)" [name]="name"/>\n                                <i class="track bf-icon-ok"></i>\n                                <span class="name">Yes</span>\n                            </label>\n                            <label class="checkbox" zing-touch [zingToggle]="true" [attr.aria-label]="label">\n                                <input type="checkbox" value="" [checked]="booleanValue === false" (change)="Check(false)" [name]="name"/>\n                                <i class="track bf-icon-ok"></i>\n                                <span class="name">No</span>\n                            </label>\n                        </div>\n                    </div>\n                    <i class="dropdown-arrow bf-icon-down-open"></i>\n                </div>'}]}],null,{text:[{type:o.Input}],name:[{type:o.Input}],label:[{type:o.Input}]});var w,b=(y.ɵmod=o.ɵɵdefineNgModule({type:y}),y.ɵinj=o.ɵɵdefineInjector({factory:function(e){return new(e||y)},imports:[[o.CommonModule,a.DirectivesModule]]}),y);function y(){}o.setClassMetadata(b,[{type:o.NgModule,args:[{declarations:[h,m],exports:[h,m],imports:[o.CommonModule,a.DirectivesModule]}]}],null,null);var k=(Object.defineProperty(C.prototype,"insuredvalue",{get:function(){return this.insuredparam.toString()},enumerable:!1,configurable:!0}),C.prototype._GetToken=function(){var t=this;return a.$http({url:a.ajaxUrl(),method:"GET",data:{action:"Pit.RefreshNonce"},expectedType:"text"}).then(function(e){return t.xsrf_token=e,w=e,t._cd.detectChanges(),null},function(e){return console.warn("could not get token"),e})},C.prototype.SetAdView=function(e){this.ad_click_id=e.click,this.ad_view_id=e.view,this._cd.detectChanges()},C.prototype.ChangeInsurance=function(e){this.insured=e,this.insuredparam="Yes"==e,this._cd.detectChanges()},C.prototype.ChangeZip=function(e){this.zipcode=e.target.value,this.invalid.zip=!1,this.show_error=!1,clearTimeout(this._ajax_error_timer),this._cd.detectChanges()},C.prototype.SetAge=function(e){this.age=e,this.ageparam=this._ages_param[this.ages.indexOf(this.age)],this.show_error=!1,this.invalid.age=!1,clearTimeout(this._ajax_error_timer),this._cd.detectChanges()},C.prototype._ajaxError=function(){var e=this;clearTimeout(this._ajax_error_timer),this.error_msg="something went wrong, please retry.",this.show_error=!0,this._cd.detectChanges(),this._ajax_error_timer=setTimeout(function(){e.show_error=!1,e._cd.detectChanges()},2500)},C.prototype.GetQuote=function(e){var t=this;if(!this.loading){if(this.pass_validation=!1,this.show_error)return this.show_error=!1,this._cd.detectChanges(),void setTimeout(function(){t.show_error=!0,t._cd.detectChanges()});0==/^\d+$/.test(this.zipcode)||5!==this.zipcode.length?(this.invalid.zip=!0,this.show_error=!0,this.error_msg="please provide a valid U.S zipcode"):this.age?(this.loading=!0,this.pass_validation=!0):(this.invalid.age=!0,this.show_error=!0,this.error_msg="please select an age"),this._cd.detectChanges(),this.show_error||(a.Cookies.set("wh_zipcode",this.zipcode,3650),a.Cookies.set("wh_age",this.ageparam,3650),a.Cookies.set("wh_currently_insured",this.insuredparam?1:0,3650),a.$http({url:a.ajaxUrl(),method:"GET",data:Object.assign({action:"Profiles.FindInsurers",age:this.ageparam,zip:this.zipcode,currently_insured:this.insuredparam,viewid:this.ad_view_id,clickid:this.ad_click_id},e||{}),after:function(){t.loading=!1,t._cd.detectChanges()}}).then(function(e){e.error?t._ajaxError():(setTimeout(function(){t.loading=!0,t._cd.detectChanges()}),window.open(e.goto_link,"_self"))}).catch(function(e){t._ajaxError()}))}},C.prototype.ngOnInit=function(){var t=this;a.isNode()||(w?this.xsrf_token=w:this._GetToken(),this.is_tabletmode=768<=window.innerWidth&&window.innerWidth<=1003,a.Cookies.get("wh_zipcode")&&""!=a.Cookies.get("wh_zipcode")?(this.zipcode=a.Cookies.get("wh_zipcode"),this._cd.detectChanges()):a.$http({url:a.ajaxUrl(),method:"GET",data:{action:"Calculators.MortgageIpToZip",loggedIn:!1}}).then(function(e){e.zip?t.zipcode=e.zip:"-"!=e[7]&&(t.zipcode=e[7]||""),t._cd.detectChanges()}).catch(function(e){t._ajaxError()}),a.Cookies.get("wh_age")&&""!=a.Cookies.get("wh_age")&&(this.ageparam=a.Cookies.get("wh_age"),this.age=this.ages[this._ages_param.indexOf(this.ageparam)],this._cd.detectChanges()),a.Cookies.get("wh_currently_insured")&&""!=a.Cookies.get("wh_currently_insured")&&(this.insured="1"==a.Cookies.get("wh_currently_insured")?"Yes":"No",this.insuredparam="1"==a.Cookies.get("wh_currently_insured"),this._cd.detectChanges()))},C.prototype.ngOnDestroy=function(){clearTimeout(this._ajax_error_timer),w=null},C.ɵfac=function(e){return new(e||C)(o.ɵɵdirectiveInject(o.ChangeDetectorRef))},C.ɵdir=o.ɵɵdefineDirective({type:C,inputs:{typeList:["type-list","typeList"],age:"age",insured:"insured",zipcode:"zipcode",layoutType:["layout-type","layoutType"]}}),C);function C(e){this._cd=e,this.typeList=[],this.age=null,this.insured="Yes",this.zipcode="",this.layoutType=1,this.ages=["16-20","21-24","25-34","35-44","45-54","55-65","65+"],this.ageparam="",this.insuredparam=!0,this._ages_param=["16","21","25","35","45","55","65"],this.loading=!1,this.invalid={type:!1,zip:!1,age:!1,rpc:!1},this.show_error=!1,this.error_msg="",this.pass_validation=!1,this.xsrf_token="",this.ad_view_id="",this.ad_click_id="",this.is_tabletmode=!1,this._ajax_error_timer=null}o.setClassMetadata(k,[{type:o.Directive}],function(){return[{type:o.ChangeDetectorRef}]},{typeList:[{type:o.Input,args:["type-list"]}],age:[{type:o.Input,args:["age"]}],insured:[{type:o.Input,args:["insured"]}],zipcode:[{type:o.Input,args:["zipcode"]}],layoutType:[{type:o.Input,args:["layout-type"]}]});var I=["input"];function x(e,t){1&e&&o.ɵɵelement(0,"div",5),2&e&&(e=o.ɵɵnextContext(),o.ɵɵproperty("innerHTML",e.label,o.ɵɵsanitizeHtml))}var E=(Object.defineProperty(T.prototype,"required",{get:function(){return this._required},set:function(e){this._required=!!e},enumerable:!1,configurable:!0}),T.prototype.Check=function(){this.checked=!this.checked,this.checkedChange.emit(this.checked)},T.prototype.ngAfterViewInit=function(){a.isNode()&&this.checked&&this.renderer.setAttribute(this.checkbox.nativeElement,"checked","checked")},T.ɵfac=function(e){return new(e||T)(o.ɵɵdirectiveInject(o.ElementRef),o.ɵɵdirectiveInject(o.Renderer2))},T.ɵcmp=o.ɵɵdefineComponent({type:T,selectors:[["ng-checkbox"]],viewQuery:function(e,t){var n;1&e&&o.ɵɵviewQuery(I,!0,o.ElementRef),2&e&&o.ɵɵqueryRefresh(n=o.ɵɵloadQuery())&&(t.checkbox=n.first)},inputs:{required:"required",name:"name",label:"label",checked:"checked",disabled:"disabled"},outputs:{checkedChange:"checkedChange"},decls:5,vars:7,consts:[["zing-touch","",1,"checkbox",3,"zingToggle"],["type","checkbox","value","",3,"checked","required","disabled","name","change"],["input",""],[1,"track","bf-icon-ok"],["class","name",3,"innerHTML",4,"ngIf"],[1,"name",3,"innerHTML"]],template:function(e,t){1&e&&(o.ɵɵelementStart(0,"label",0),o.ɵɵelementStart(1,"input",1,2),o.ɵɵlistener("change",function(){return t.Check()}),o.ɵɵelementEnd(),o.ɵɵelement(3,"i",3),o.ɵɵtemplate(4,x,1,1,"div",4),o.ɵɵelementEnd()),2&e&&(o.ɵɵproperty("zingToggle",!0),o.ɵɵattribute("aria-label",t.label),o.ɵɵadvance(1),o.ɵɵproperty("checked",t.checked)("required",t.required)("disabled",t.disabled)("name",t.name),o.ɵɵadvance(3),o.ɵɵproperty("ngIf",t.label))},directives:[a.TouchGestures,o.NgIf],encapsulation:2}),T);function T(e,t){this.el=e,this.renderer=t,this.name=null,this.label=null,this.checkedChange=new o.EventEmitter,this.disabled=!1}o.setClassMetadata(E,[{type:o.Component,args:[{selector:"ng-checkbox",template:'<label class="checkbox" zing-touch [zingToggle]="true" [attr.aria-label]="label">\n                    <input #input type="checkbox" value="" [checked]="checked" (change)="Check()" [required]="required" [disabled]="disabled" [name]="name"/>\n                    <i class="track bf-icon-ok"></i>\n                    <div class="name" *ngIf="label" [innerHTML]="label"></div>\n                </label>'}]}],function(){return[{type:o.ElementRef},{type:o.Renderer2}]},{checkbox:[{type:o.ViewChild,args:["input",{read:o.ElementRef,static:!1}]}],required:[{type:o.Input}],name:[{type:o.Input}],label:[{type:o.Input}],checkedChange:[{type:o.Output}],checked:[{type:o.Input}],disabled:[{type:o.Input}]});var z=(L.ɵmod=o.ɵɵdefineNgModule({type:L}),L.ɵinj=o.ɵɵdefineInjector({factory:function(e){return new(e||L)},imports:[[o.CommonModule,a.DirectivesModule]]}),L);function L(){}o.setClassMetadata(z,[{type:o.NgModule,args:[{declarations:[E],exports:[E],imports:[o.CommonModule,a.DirectivesModule]}]}],null,null);var S=["AdPixelViewTrigger"],M=["AdPixelViewReferrer"],R=["AdPixelViewClick"],O=(j.prototype.AttachEvents=function(){var t=this;this.onScrollEnd=new o.BehaviorSubject(null),this.onResize=new o.Subject,a.isNode()||(this._subs=this._dservice.onScroll.subscribe(function(e){t._scrolling&&clearTimeout(t._scrolltimer),t._scrolling=!0,t._scrolltimer=setTimeout(function(){t._scrolling=!1,a.reqAnimationFrame(function(){t.onScrollEnd.next(e)})},500)}),this._resize=new o.Subject,this._obs.push(o.fromEvent(window,"resize")),this._resizesubs=this._obs[this._obs.length-1].pipe(o.takeUntil(this._resize)).subscribe(function(){a.reqAnimationFrame(function(){t.onResize.next()})}))},j.prototype.DetachEvents=function(){this._subs&&(this._subs.unsubscribe(),this._subs=null),this._resizesubs&&(this._resizesubs.unsubscribe(),this._resizesubs=null),this._resize&&(this._resize.next(),this._resize.complete(),this._resize=null),this.onScrollEnd&&(this.onScrollEnd.complete(),this.onScrollEnd=null),this.onResize&&(this.onResize.complete(),this.onResize=null),this._obs=null},j.ɵfac=function(e){return new(e||j)(o.ɵɵinject(a.ScrollerService))},j.ɵprov=o.ɵɵdefineInjectable({token:j,factory:j.ɵfac}),j);function j(e){this._dservice=e,this._scrolling=!1,this._obs=[]}o.setClassMetadata(O,[{type:o.Injectable}],function(){return[{type:a.ScrollerService}]},null);var q=(Object.defineProperty(P.prototype,"recheck",{get:function(){return this._recheck},set:function(e){e&&this._ResetnCheck(),this._recheck=e},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"_adlocation",{get:function(){return this._loc.path().replace("/ng-home/","/").split("?")[0]},enumerable:!1,configurable:!0}),P.prototype.ngOnInit=function(){this.viewId=a.uniqid(),this.clickId=a.uniqid(),a.isNode()||(this.viewport=this._getViewportSize()),this.viewSet.emit(this.viewId)},P.prototype.ngAfterViewInit=function(){var t,e,n,i=this;this._PixelReferrer(),this._PixelAddClickId(),a.isNode()||(this.clicksList&&this.clicksList.forEach(function(t){var e=o.fromEvent(t.nativeElement,"click");i.obs.push(e),i.sbs.add(e.subscribe(function(e){i._PixelClicked(t)}))}),this.referrersList&&this.referrersList.forEach(function(e){e=o.fromEvent(e.nativeElement,"click");i.obs.push(e),i.sbs.add(e.subscribe(function(e){i.is_viewed||i._PixelTrigger()}))}),t=(this.use_IntersectionObserver?this._RegisterIntersectElements:this._CheckElements).bind(this),this.sbs.add(this.clicksList.changes.subscribe(function(e){t(i.clicksList),i._PixelAddClickId()})),this.sbs.add(this.triggersList.changes.subscribe(function(e){t(i.triggersList)})),this.sbs.add(this.referrersList.changes.subscribe(function(e){i._PixelReferrer(),t(i.referrersList)})),e=this._srv.onScrollEnd,n=this._srv.onResize,this.use_IntersectionObserver?(this._intersectionObserver=new IntersectionObserver(function(e){i._CheckForIntersection(e)},{threshold:this.triggerRatio}),this._RegisterIntersectElements("all"),this.sbs.add(e.subscribe(function(e){i.is_intersecting&&i._PixelTrigger()}))):(this._CheckElements("all"),this.sbs.add(e.subscribe(function(e){i._CheckElements("all")}))),this.sbs.add(n.subscribe(function(e){i.viewport=i._getViewportSize(),i.debug&&console.log("new viewport size : ",i.viewport),i.use_IntersectionObserver||i._CheckElements("all")})))},P.prototype._RegisterIntersectElements=function(e){var t=this,n=!0,i=function(e){t._intersectionObserver.unobserve(e.nativeElement),t._intersectionObserver.observe(e.nativeElement),n=!1};"all"==e?(this.triggersList&&this.triggersList.forEach(i),this.referrersList&&this.referrersList.forEach(i),this.clicksList&&this.clicksList.forEach(i)):e.forEach(i),(this.is_main_intersct=n)&&(i=this.mainElement.nativeElement,i=this.ad_use_parent_el?i.parentNode:i,this._intersectionObserver.observe(i))},P.prototype._CheckElements=function(e){var t,n,i=this;this.is_viewed||(t=!0,n=function(e){t=!1,i._isInViewport(e)&&i._PixelTrigger()},"all"==e?(this.triggersList&&this.triggersList.forEach(function(e){n(e)}),this.referrersList&&this.referrersList.forEach(function(e){n(e)}),this.clicksList&&this.clicksList.forEach(function(e){n(e)})):e&&e.forEach(function(e){n(e)}),(this.is_main_intersct=t)&&(e=this.mainElement.nativeElement,e=this.ad_use_parent_el?{nativeElement:e.parentNode}:this.mainElement,n(e)))},P.prototype._isInViewport=function(e,t){if(!this.viewport)return!1;var n=t?e.boundingClientRect:e.nativeElement.getBoundingClientRect(),t=n.height||n.bottom-n.top,e=n.width||n.right-n.left;return!(!t||!e)&&!(n.top+n.height*(this.is_main_intersct?this.triggerRatio:1)>this.viewport.h||n.bottom<0)},P.prototype._getViewportSize=function(){var e=window;if(null!=e.innerWidth)return{w:e.innerWidth,h:e.innerHeight};e=e.document;return{w:e.body.clientWidth,h:e.body.clientWidth}},P.prototype._ResetnCheck=function(){a.isNode()||(this.is_viewed=!1,this.viewId=a.uniqid(),this.clickId=a.uniqid(),this._PixelReferrer(),this._PixelAddClickId(),this._CheckElements("all"))},P.prototype._PixelTrigger=function(){this.is_viewed||(this.is_viewed=!0,this.adViewed.emit({view:this.viewId,click:this.clickId}),this._httpCall())},P.prototype._PixelClicked=function(e){var t=this;this.is_viewed||this._PixelTrigger(),a.reqAnimationFrame(function(){t._PixelAddClickId()})},P.prototype._PixelAddClickId=function(){var i=this;this.clicksList&&this.clicksList.forEach(function(e){var t,n=i.clickUrl;a.isNode()||(t=i.clickId,i.uniqueClickId&&(i.clickId=a.uniqid()),n=n+(-1<n.indexOf("?")?"&":"?")+"clickId="+t+"&viewId="+i.viewId,(t=e.nativeElement).dataset&&t.dataset.clickparams&&(n+="&"+t.dataset.clickparams)),i._renderer.setAttribute(e.nativeElement,"href",n)})},P.prototype._PixelReferrer=function(){var i=this;this.referrersList&&this.referrersList.forEach(function(e){var t=i.referrerUrl,n=t;a.isNode()||(n+=(-1<t.indexOf("?")?"&":"?")+"viewReferrer="+i.viewId),i._renderer.setAttribute(e.nativeElement,"href",n)})},P.prototype._httpCall=function(e){void 0===e&&(e={});var t=Object.assign({adview_id:this.viewId,adview_pid:this.adId,adview_page:this._adlocation,adview_version:2,adview_section:this.section,adview_position:this.position||0,adview_totals:this.totals||0},this.addlQueries,e),e=a.baseUrl()+"/pixel.png";t.adview_section||delete t.adview_section,t.adview_pid||delete t.adview_id,(0==t.adview_totals&&0==t.adview_position||-1==t.adview_totals&&-1==t.adview_position)&&(delete t.adview_position,delete t.adview_totals),a.$http({method:"GET",data:{},events:!1,url:e,query:t,expectedType:"text",retry:1}).then(function(){},function(e){}),this.debug&&console.log(this.adId," AdPixelView fired.")},P.prototype.ngOnDestroy=function(){this.sbs.unsubscribe(),this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=null),this.obs=[]},P.ɵfac=function(e){return new(e||P)(o.ɵɵdirectiveInject(o.ElementRef),o.ɵɵdirectiveInject(a.ScrollerService),o.ɵɵdirectiveInject(o.Renderer2),o.ɵɵdirectiveInject(O),o.ɵɵdirectiveInject(o.Location))},P.ɵdir=o.ɵɵdefineDirective({type:P,selectors:[["","ad-pixel",""]],contentQueries:function(e,t,n){1&e&&(o.ɵɵcontentQuery(n,S,!0,o.ElementRef),o.ɵɵcontentQuery(n,M,!0,o.ElementRef),o.ɵɵcontentQuery(n,R,!0,o.ElementRef)),2&e&&(o.ɵɵqueryRefresh(e=o.ɵɵloadQuery())&&(t.triggersList=e),o.ɵɵqueryRefresh(e=o.ɵɵloadQuery())&&(t.referrersList=e),o.ɵɵqueryRefresh(e=o.ɵɵloadQuery())&&(t.clicksList=e))},inputs:{addlQueries:["addl-queries","addlQueries"],triggerRatio:["trigger-ratio","triggerRatio"],debug:"debug",referrerUrl:["referrer-url","referrerUrl"],clickUrl:["click-url","clickUrl"],section:["adview-section","section"],position:["adview-position","position"],totals:["adview-totals","totals"],adId:["ad-id","adId"],ad_use_parent_el:["ad-use-parent","ad_use_parent_el"],uniqueClickId:["unique-click-id","uniqueClickId"],recheck:["ad-pixel-recheck","recheck"]},outputs:{adViewed:"adViewed",viewSet:"viewSet"}}),P);function P(e,t,n,i,r){var s=this;this.mainElement=e,this._dservice=t,this._renderer=n,this._srv=i,this._loc=r,this.triggerRatio=.15,this.debug=!1,this.referrerUrl="",this.clickUrl="",this.section="",this.position=0,this.totals=0,this.ad_use_parent_el=!1,this.uniqueClickId=!1,this.viewId="",this.is_viewed=!1,this.clickId="",this.sbs=new o.Subscription,this.obs=[],this.is_intersecting=!1,this.is_main_intersct=!1,this.adViewed=new o.EventEmitter,this.viewSet=new o.EventEmitter,this._CheckForIntersection=function(e){if(!s.is_viewed)for(var t=0,n=e.length;t<n;t++){var i=e[t];if(a.isNullorUndefined(i.isIntersecting)&&s._isInViewport(i,!0)){s.is_intersecting=!0;break}if(i.isIntersecting){s.is_intersecting=!0;break}s.is_intersecting=!1}},this.use_IntersectionObserver=!(a.isNode()||!window.IntersectionObserver),this.debug&&console.log("use_IntersectionObserver is : ",this.use_IntersectionObserver)}o.setClassMetadata(q,[{type:o.Directive,args:[{selector:"[ad-pixel]"}]}],function(){return[{type:o.ElementRef},{type:a.ScrollerService},{type:o.Renderer2},{type:O},{type:o.Location}]},{addlQueries:[{type:o.Input,args:["addl-queries"]}],triggerRatio:[{type:o.Input,args:["trigger-ratio"]}],debug:[{type:o.Input,args:["debug"]}],referrerUrl:[{type:o.Input,args:["referrer-url"]}],clickUrl:[{type:o.Input,args:["click-url"]}],section:[{type:o.Input,args:["adview-section"]}],position:[{type:o.Input,args:["adview-position"]}],totals:[{type:o.Input,args:["adview-totals"]}],adId:[{type:o.Input,args:["ad-id"]}],ad_use_parent_el:[{type:o.Input,args:["ad-use-parent"]}],uniqueClickId:[{type:o.Input,args:["unique-click-id"]}],recheck:[{type:o.Input,args:["ad-pixel-recheck"]}],triggersList:[{type:o.ContentChildren,args:["AdPixelViewTrigger",{read:o.ElementRef,descendants:!0}]}],referrersList:[{type:o.ContentChildren,args:["AdPixelViewReferrer",{read:o.ElementRef,descendants:!0}]}],clicksList:[{type:o.ContentChildren,args:["AdPixelViewClick",{read:o.ElementRef,descendants:!0}]}],adViewed:[{type:o.Output}],viewSet:[{type:o.Output}]});var V=(N.prototype.ngOnDestroy=function(){this._srv.DetachEvents()},N.ɵmod=o.ɵɵdefineNgModule({type:N}),N.ɵinj=o.ɵɵdefineInjector({factory:function(e){return new(e||N)(o.ɵɵinject(O))},providers:[O],imports:[[o.CommonModule,a.DirectivesModule]]}),N);function N(e){this._srv=e,this._srv.AttachEvents()}o.setClassMetadata(V,[{type:o.NgModule,args:[{declarations:[q],exports:[q],imports:[o.CommonModule,a.DirectivesModule],providers:[O]}]}],function(){return[{type:O}]},null);m=["class","car-insurance-widget"];function D(e,t){1&e&&(o.ɵɵelementStart(0,"div",15),o.ɵɵtext(1),o.ɵɵelementEnd()),2&e&&(e=o.ɵɵnextContext(),o.ɵɵadvance(1),o.ɵɵtextInterpolate(e.error_msg))}function H(e,t){1&e&&(o.ɵɵelementStart(0,"div",16),o.ɵɵtext(1),o.ɵɵelementEnd()),2&e&&(e=o.ɵɵnextContext(),o.ɵɵadvance(1),o.ɵɵtextInterpolate(e.error_msg))}require("systemjs").import("css:/ci-shortcode.css").then(function(){},function(){});var A,q=(A=k,__extends(F,A),F.prototype.ChangeInsurance=function(e){this.insuredparam=e,this._cd.detectChanges()},F.prototype._GetSesId=function(){var t=this;return a.$http({url:a.baseUrl()+"/sid.php",data:{a:"1"},method:"GET",events:!1,retry:2}).then(function(e){return e&&e.__whid&&(t.adview_extra={adview_offer_type:"Car_Insurance_Widget",session_id:e.__whid}),t._cd.detectChanges(),null}).catch(function(e){console.warn("could not get session id",e)})},F.prototype.ngOnInit=function(){var e;A.prototype.ngOnInit.call(this),a.isNode()||(e=a.Cookies.get("__whid"),this.adview_extra={adview_offer_type:"Car_Insurance_Widget",session_id:e},this._GetSesId())},F.ɵfac=function(e){return new(e||F)(o.ɵɵdirectiveInject(o.ChangeDetectorRef))},F.ɵcmp=o.ɵɵdefineComponent({type:F,selectors:[["div",8,"car-insurance-widget"]],features:[o.ɵɵInheritDefinitionFeature],attrs:m,decls:18,vars:16,consts:[["form-submit","","ad-pixel","",1,"form-ci-widget",3,"unique-click-id","ad-id","addl-queries","onSubmit","adViewed"],[1,"ciw-head"],[1,"ciw-row"],[1,"ciw-box","first"],["id","zip-ipt-label","for","zip-ipt",3,"hidden"],["type","tel","placeholder","Zip Code","name","zip","maxlength","5","id","zip-ipt","role","textbox","aria-labelledby","zip-ipt-label",1,"single","textfield","ciw-zip",3,"value","input"],[1,"ciw-box","second"],["placeholder","Age",3,"items","second","invalid","value","valueChange"],["class","ciw-error-age semi-bold-font mob ng-enter-element",4,"ngIf"],[1,"ciw-box","ciw-block","ci-checkbox"],["label","Currently Insured?","name","currently_insured",3,"checked","checkedChange"],[1,"ciw-box","ciw-block","with-loader"],["type","submit",1,"btn","blue","ciw-btn"],[1,"btn-loader"],["class","ciw-error-age semi-bold-font desk ng-enter-element",4,"ngIf"],[1,"ciw-error-age","semi-bold-font","mob","ng-enter-element"],[1,"ciw-error-age","semi-bold-font","desk","ng-enter-element"]],template:function(e,t){1&e&&(o.ɵɵelementStart(0,"form",0),o.ɵɵlistener("onSubmit",function(){return t.GetQuote()})("adViewed",function(e){return t.SetAdView(e)}),o.ɵɵelementStart(1,"h3",1),o.ɵɵtext(2,"Find Cheap Car Insurance"),o.ɵɵelementEnd(),o.ɵɵelementStart(3,"div",2),o.ɵɵelementStart(4,"div",3),o.ɵɵelementStart(5,"label",4),o.ɵɵtext(6,"Zip Code"),o.ɵɵelementEnd(),o.ɵɵelementStart(7,"input",5),o.ɵɵlistener("input",function(e){return t.ChangeZip(e)}),o.ɵɵelementEnd(),o.ɵɵelementEnd(),o.ɵɵelementStart(8,"div",6),o.ɵɵelementStart(9,"ng-dropdown",7),o.ɵɵlistener("valueChange",function(e){return t.SetAge(e)}),o.ɵɵelementEnd(),o.ɵɵelementEnd(),o.ɵɵtemplate(10,D,2,1,"div",8),o.ɵɵelementStart(11,"div",9),o.ɵɵelementStart(12,"ng-checkbox",10),o.ɵɵlistener("checkedChange",function(e){return t.ChangeInsurance(e)}),o.ɵɵelementEnd(),o.ɵɵelementEnd(),o.ɵɵelementStart(13,"div",11),o.ɵɵelementStart(14,"button",12),o.ɵɵtext(15,"Find Insurers"),o.ɵɵelement(16,"i",13),o.ɵɵelementEnd(),o.ɵɵelementEnd(),o.ɵɵelementEnd(),o.ɵɵtemplate(17,H,2,1,"div",14),o.ɵɵelementEnd()),2&e&&(o.ɵɵproperty("unique-click-id",!0)("ad-id",5e6)("addl-queries",t.adview_extra),o.ɵɵadvance(5),o.ɵɵproperty("hidden",!0),o.ɵɵadvance(2),o.ɵɵclassProp("ng-wh-error",t.invalid.zip),o.ɵɵproperty("value",t.zipcode),o.ɵɵadvance(2),o.ɵɵproperty("items",t.ages)("second",!0)("invalid",t.invalid.age)("value",t.age),o.ɵɵadvance(1),o.ɵɵproperty("ngIf",t.show_error),o.ɵɵadvance(2),o.ɵɵproperty("checked",t.insuredparam),o.ɵɵadvance(1),o.ɵɵclassProp("loadactive",t.loading),o.ɵɵadvance(4),o.ɵɵproperty("ngIf",t.show_error))},directives:[a.FormSubmit,q,h,o.NgIf,E],encapsulation:2,changeDetection:0}),F);function F(e){return A.call(this,e)||this}o.setClassMetadata(q,[{type:o.Component,args:[{selector:"div.car-insurance-widget",templateUrl:"/views/components/shortcodes/ci-shortcode.html",changeDetection:o.ChangeDetectionStrategy.OnPush}]}],function(){return[{type:o.ChangeDetectorRef}]},null);Q.ɵmod=o.ɵɵdefineNgModule({type:Q}),Q.ɵinj=o.ɵɵdefineInjector({factory:function(e){return new(e||Q)},imports:[[o.CommonModule,a.DirectivesModule,b,z,a.FormSubmitModule,V]]}),E=Q;function Q(){}o.setClassMetadata(E,[{type:o.NgModule,args:[{declarations:[q],entryComponents:[q],exports:[q],imports:[o.CommonModule,a.DirectivesModule,b,z,a.FormSubmitModule,V]}]}],null,null),e.CIShortCode=q,e.NGCIShortCodeModule=E,e.ngDropDownModule=b,e.ngDropdown=h});