define(["exports","./edu-vendor","./edu-main","systemjs"],(function(e,t,i,n){"use strict";var r=["dropdownList"],s=["button"];function o(e,i){if(1&e&&t["ɵɵelement"](0,"span",8),2&e){var n=t["ɵɵnextContext"]();t["ɵɵproperty"]("cleanHTML",n.placeholder),t["ɵɵattribute"]("tabindex",n.tabindex)("aria-expanded",n.opened)}}function a(e,i){if(1&e){var n=t["ɵɵgetCurrentView"]();t["ɵɵelementStart"](0,"li",9),t["ɵɵlistener"]("onClick",(function(){var e=t["ɵɵrestoreView"](n).index;return t["ɵɵnextContext"]().selectItem(e)}))("onTap",(function(e){return t["ɵɵrestoreView"](n),t["ɵɵnextContext"]().PreventClose(e)})),t["ɵɵelementEnd"]()}if(2&e){var r=i.$implicit,s=i.index,o=t["ɵɵnextContext"]();t["ɵɵclassProp"]("active",o.activeidx==s),t["ɵɵproperty"]("cleanHTML",r),t["ɵɵattribute"]("aria-selected",o.activeidx==s)("id",o.optionid+"-"+s)}}function c(e,i){1&e&&t["ɵɵelement"](0,"span",10),2&e&&t["ɵɵattribute"]("aria-hidden",!0)}var d=function(e,t,i,n,r,s){return{"ng-wh-error":e,"drp-b-darker":t,second:i,selected:n,opened:r,disabled:s}};function l(e,i){if(1&e&&(t["ɵɵelementStart"](0,"span",12),t["ɵɵlistener"]("onTap",(function(){return!0})),t["ɵɵelementEnd"]()),2&e){var n=t["ɵɵnextContext"]();t["ɵɵproperty"]("cleanHTML",n.placeholder)}}function h(e,i){if(1&e&&(t["ɵɵelementStart"](0,"span",13),t["ɵɵlistener"]("onTap",(function(){return!0})),t["ɵɵelementEnd"]()),2&e){var n=t["ɵɵnextContext"]();t["ɵɵproperty"]("cleanHTML",n.value)}}var u=function(e,t,i,n,r){return{"ng-wh-error":e,"drp-b-darker":t,second:i,selected:n,opened:r}},p=function(){function e(e){this._cd=e,this.tabindex=0,this.placeholder="Select...",this.items=[],this.darker=!1,this.invalid=!1,this.disabled=!1,this.bounds_check=!1,this.labelledby="",this.valueChange=new t.EventEmitter,this.selected=new t.EventEmitter,this.onTapped=new t.EventEmitter,this.noselection=!0,this.opened=!1,this.activeidx=null,this._android_delay=!1}return Object.defineProperty(e.prototype,"value",{get:function(){return(this._value||"").toString()},set:function(e){this.noselection=!e,this._value=e},enumerable:!1,configurable:!0}),e.prototype.controlList=function(e,t){var i=this;this.disabled||(this.opened=void 0!==t?t:!this.opened,this.onTapped.emit(this),this.fixOverflow(),this._android_delay=!0,setTimeout((function(){i._android_delay=!1}),100))},e.prototype.close=function(){this.opened=!1},e.prototype.open=function(){this.opened=!0},e.prototype.PreventClose=function(e){e&&e.srcEvent&&(e.srcEvent.cancelBubble=!0,e.srcEvent.stopPropagation&&e.srcEvent.stopPropagation()),e&&e.stopPropagation&&e.stopPropagation()},e.prototype.selectItem=function(e){void 0===e&&(e=0),this._android_delay||(this._value=this.items[e],this.activeidx=e,this.valueChange.emit(this.value),this.noselection=!1,this.selected.emit({eventName:"select",value:this.value,index:e}),this.activedescendant=this.optionid+"-"+this.activeidx,this.close(),this._cd.detectChanges(),this.listbutton&&this.listbutton.nativeElement.focus())},e.prototype.trackByFn=function(e){return e},e.prototype.ngOnInit=function(){this.optionid=i.uniqid("opt-"),this.value&&this.items.indexOf(this.value)>-1&&(this.activeidx=this.items.indexOf(this.value),this.activedescendant=this.optionid+"-"+this.activeidx)},e.prototype.fixOverflow=function(){var e=this,t=this.dropdownList&&this.dropdownList.nativeElement,n=t&&t.parentElement;i.reqAnimationFrame((function(){try{var i=t.getBoundingClientRect();n.getBoundingClientRect().x+i.width>=window.innerWidth?t.classList.add("sticky-right"):t.classList.remove("sticky-right"),e.bounds_check&&i.y+i.height>window.innerHeight?t.classList.add("upwards"):t.classList.remove("upwards")}catch(e){throw e}}))},e.ɵfac=function(i){return new(i||e)(t["ɵɵdirectiveInject"](t.ChangeDetectorRef))},e.ɵcmp=t["ɵɵdefineComponent"]({type:e,selectors:[["ng-dropdown"]],viewQuery:function(e,i){if(1&e&&(t["ɵɵviewQuery"](r,5,t.ElementRef),t["ɵɵviewQuery"](s,5,t.ElementRef)),2&e){var n=void 0;t["ɵɵqueryRefresh"](n=t["ɵɵloadQuery"]())&&(i.dropdownList=n.first),t["ɵɵqueryRefresh"](n=t["ɵɵloadQuery"]())&&(i.listbutton=n.first)}},inputs:{tabindex:"tabindex",placeholder:"placeholder",items:"items",second:"second",darker:["dark-borders","darker"],invalid:"invalid",disabled:"disabled",bounds_check:["bounds-check","bounds_check"],labelledby:"labelledby",value:"value"},outputs:{valueChange:"valueChange",selected:"selected",onTapped:"onTapped"},decls:8,vars:20,consts:[["zing-touch","",1,"dropdown",3,"ngClass","onTap","onTapOutside"],["role","button","aria-haspopup","listbox","class","dropdown-placeholder",3,"cleanHTML",4,"ngIf"],["role","button","aria-haspopup","listbox",1,"dropdown-selected",3,"ng-hidden","cleanHTML"],["button",""],["role","listbox","tabindex","0",1,"dropdown-list","ng-enter-element",3,"ng-hidden"],["dropdownList",""],["class","dropdown-item","role","option","zing-touch","",3,"active","cleanHTML","onClick","onTap",4,"ngFor","ngForOf","ngForTrackBy"],["tabindex","-1","class","dropdown-arrow  bf-icon-down-open",4,"ngIf"],["role","button","aria-haspopup","listbox",1,"dropdown-placeholder",3,"cleanHTML"],["role","option","zing-touch","",1,"dropdown-item",3,"cleanHTML","onClick","onTap"],["tabindex","-1",1,"dropdown-arrow","bf-icon-down-open"]],template:function(e,i){1&e&&(t["ɵɵelementStart"](0,"div",0),t["ɵɵlistener"]("onTap",(function(e){return i.controlList(e)}))("onTapOutside",(function(e){return i.controlList(e,!1)})),t["ɵɵtemplate"](1,o,1,3,"span",1),t["ɵɵelement"](2,"span",2,3),t["ɵɵelementStart"](4,"ul",4,5),t["ɵɵtemplate"](6,a,1,5,"li",6),t["ɵɵelementEnd"](),t["ɵɵtemplate"](7,c,1,1,"span",7),t["ɵɵelementEnd"]()),2&e&&(t["ɵɵproperty"]("ngClass",t["ɵɵpureFunction6"](13,d,i.invalid,i.darker,i.second,!i.noselection,i.opened,i.disabled)),t["ɵɵadvance"](1),t["ɵɵproperty"]("ngIf",i.placeholder&&i.noselection),t["ɵɵadvance"](1),t["ɵɵproperty"]("ng-hidden",i.noselection)("cleanHTML",i.value),t["ɵɵattribute"]("tabindex",i.noselection?i.tabindex:-1)("aria-hidden",i.noselection)("aria-expanded",i.opened),t["ɵɵadvance"](2),t["ɵɵproperty"]("ng-hidden",!i.opened),t["ɵɵattribute"]("aria-labelledby",i.labelledby)("aria-activedescendant",i.activedescendant),t["ɵɵadvance"](2),t["ɵɵproperty"]("ngForOf",i.items)("ngForTrackBy",i.trackByFn),t["ɵɵadvance"](1),t["ɵɵproperty"]("ngIf",!i.disabled))},directives:[i.TouchGestures,t.NgClass,t.NgIf,i.ngCleanHTML,i.ngHidden,t.NgForOf],encapsulation:2}),e}(),f=(function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.text="Some text to display",t.name="",t.label="",t.booleanValue=null,t}var r;__extends(n,e),n.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))},n.ɵfac=function(e){return(r||(r=t["ɵɵgetInheritedFactory"](n)))(e||n)},n.ɵcmp=t["ɵɵdefineComponent"]({type:n,selectors:[["ng-dropdown-bool"]],inputs:{text:"text",name:"name",label:"label"},features:[t["ɵɵ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,i){1&e&&(t["ɵɵelementStart"](0,"div",0),t["ɵɵlistener"]("onTap",(function(e){return i.controlList(e)}))("onTapOutside",(function(e){return i.controlList(e,!1)})),t["ɵɵtemplate"](1,l,1,1,"span",1),t["ɵɵtemplate"](2,h,1,1,"span",2),t["ɵɵelementStart"](3,"div",3,4)(5,"p",5),t["ɵɵtext"](6),t["ɵɵelementEnd"](),t["ɵɵelementStart"](7,"div",6)(8,"label",7)(9,"input",8),t["ɵɵlistener"]("change",(function(){return i.Check(!0)})),t["ɵɵelementEnd"](),t["ɵɵelement"](10,"i",9),t["ɵɵelementStart"](11,"span",10),t["ɵɵtext"](12,"Yes"),t["ɵɵelementEnd"]()(),t["ɵɵelementStart"](13,"label",7)(14,"input",8),t["ɵɵlistener"]("change",(function(){return i.Check(!1)})),t["ɵɵelementEnd"](),t["ɵɵelement"](15,"i",9),t["ɵɵelementStart"](16,"span",10),t["ɵɵtext"](17,"No"),t["ɵɵelementEnd"]()()()(),t["ɵɵelement"](18,"i",11),t["ɵɵelementEnd"]()),2&e&&(t["ɵɵproperty"]("ngClass",t["ɵɵpureFunction5"](13,u,i.invalid,i.darker,i.second,!i.noselection,i.opened)),t["ɵɵadvance"](1),t["ɵɵproperty"]("ngIf",i.placeholder&&i.noselection),t["ɵɵadvance"](1),t["ɵɵproperty"]("ngIf",!i.noselection),t["ɵɵadvance"](1),t["ɵɵproperty"]("ng-hidden",!i.opened),t["ɵɵadvance"](3),t["ɵɵtextInterpolate1"](" ",i.text," "),t["ɵɵadvance"](2),t["ɵɵproperty"]("zingToggle",!0),t["ɵɵattribute"]("aria-label",i.label),t["ɵɵadvance"](1),t["ɵɵproperty"]("checked",!0===i.booleanValue)("name",i.name),t["ɵɵadvance"](4),t["ɵɵproperty"]("zingToggle",!0),t["ɵɵattribute"]("aria-label",i.label),t["ɵɵadvance"](1),t["ɵɵproperty"]("checked",!1===i.booleanValue)("name",i.name))},directives:[i.TouchGestures,t.NgClass,t.NgIf,i.ngCleanHTML,i.ngHidden],encapsulation:2})}(p),function(){function e(){}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=t["ɵɵdefineNgModule"]({type:e}),e.ɵinj=t["ɵɵdefineInjector"]({imports:[[t.CommonModule,i.DirectivesModule]]}),e}()),g=function(){function e(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=["18","22","30","39","49","59","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.ad_view_id="",this.ad_click_id="",this.is_tabletmode=!1,this._ajax_error_timer=null}return Object.defineProperty(e.prototype,"insuredvalue",{get:function(){return this.insuredparam.toString()},enumerable:!1,configurable:!0}),e.prototype.SetAdView=function(e){this.ad_click_id=e.click,this.ad_view_id=e.view,this._cd.detectChanges()},e.prototype.ChangeInsurance=function(e){this.insured=e,this.insuredparam="Yes"==e,this._cd.detectChanges()},e.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()},e.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()},e.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)},e.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||(i.Cookies.set("wh_zipcode",this.zipcode,3650),i.Cookies.set("wh_age",this.ageparam,3650),i.Cookies.set("wh_currently_insured",this.insuredparam?1:0,3650),i.$http({url:i.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():window.open(e.goto_link,"_self")})).catch((function(e){t._ajaxError()})))}},e.prototype.ngOnInit=function(){var e=this;i.isNode()||(this.is_tabletmode=window.innerWidth>=768&&window.innerWidth<=1003,i.Cookies.get("wh_zipcode")&&""!=i.Cookies.get("wh_zipcode")?(this.zipcode=i.Cookies.get("wh_zipcode"),this._cd.detectChanges()):i.$http({url:i.ajaxUrl(),method:"GET",data:{action:"Calculators.MortgageIpToZip",loggedIn:!1}}).then((function(t){t.zip?e.zipcode=t.zip:"-"!=t[7]&&(e.zipcode=t[7]||""),e._cd.detectChanges()})).catch((function(t){e._ajaxError()})),i.Cookies.get("wh_age")&&""!=i.Cookies.get("wh_age")&&(this.ageparam=i.Cookies.get("wh_age"),this.age=this.ages[this._ages_param.indexOf(this.ageparam)],this._cd.detectChanges()),i.Cookies.get("wh_currently_insured")&&""!=i.Cookies.get("wh_currently_insured")&&(this.insured="1"==i.Cookies.get("wh_currently_insured")?"Yes":"No",this.insuredparam="1"==i.Cookies.get("wh_currently_insured"),this._cd.detectChanges()))},e.prototype.ngOnDestroy=function(){clearTimeout(this._ajax_error_timer)},e.ɵfac=function(i){return new(i||e)(t["ɵɵdirectiveInject"](t.ChangeDetectorRef))},e.ɵdir=t["ɵɵdefineDirective"]({type:e,inputs:{typeList:["type-list","typeList"],age:"age",insured:"insured",zipcode:"zipcode",layoutType:["layout-type","layoutType"]}}),e}(),v=function(e){function n(t){return e.call(this,t)||this}return __extends(n,e),n.prototype.ChangeInsurance=function(e){this.insuredparam=e,this._cd.detectChanges()},n.prototype._GetSesId=function(){var e=this;return i.$http({url:i.baseUrl()+"/sid.php",data:{a:"1"},method:"GET",events:!1,retry:2}).then((function(t){return t&&t.__whid&&(e.adview_extra={adview_offer_type:"Car_Insurance_Widget",session_id:t.__whid}),e._cd.detectChanges(),null})).catch((function(e){console.warn("could not get session id",e)}))},n.prototype.ngOnInit=function(){if(e.prototype.ngOnInit.call(this),!i.isNode()){var t=i.Cookies.get("__whid");this.adview_extra={adview_offer_type:"Car_Insurance_Widget",session_id:t},this._GetSesId()}},n.ɵfac=function(e){return new(e||n)(t["ɵɵdirectiveInject"](t.ChangeDetectorRef))},n.ɵdir=t["ɵɵdefineDirective"]({type:n,features:[t["ɵɵInheritDefinitionFeature"]]}),n}(g),_=["input"];function m(e,i){if(1&e&&t["ɵɵelement"](0,"div",5),2&e){var n=t["ɵɵnextContext"]();t["ɵɵproperty"]("innerHTML",n.label,t["ɵɵsanitizeHtml"])}}var b=function(){function e(e,i){this.el=e,this.renderer=i,this.name=null,this.label=null,this.checkedChange=new t.EventEmitter,this.checked=!1,this.disabled=!1}return Object.defineProperty(e.prototype,"required",{get:function(){return this._required},set:function(e){this._required=!!e},enumerable:!1,configurable:!0}),e.prototype.Check=function(){this.checked=!this.checked,this.checkedChange.emit(this.checked)},e.prototype.ngAfterViewInit=function(){i.isNode()&&this.checked&&this.renderer.setAttribute(this.checkbox.nativeElement,"checked","checked")},e.ɵfac=function(i){return new(i||e)(t["ɵɵdirectiveInject"](t.ElementRef),t["ɵɵdirectiveInject"](t.Renderer2))},e.ɵcmp=t["ɵɵdefineComponent"]({type:e,selectors:[["ng-checkbox"]],viewQuery:function(e,i){if(1&e&&t["ɵɵviewQuery"](_,5,t.ElementRef),2&e){var n;t["ɵɵqueryRefresh"](n=t["ɵɵloadQuery"]())&&(i.checkbox=n.first)}},inputs:{required:"required",name:"name",label:"label",checked:"checked",disabled:"disabled"},outputs:{checkedChange:"checkedChange"},decls:5,vars:7,consts:[["role","checkbox","tabindex","0",1,"checkbox"],["type","checkbox","value","","aria-hidden","true","tabindex","-1",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,i){1&e&&(t["ɵɵelementStart"](0,"label",0)(1,"input",1,2),t["ɵɵlistener"]("change",(function(){return i.Check()})),t["ɵɵelementEnd"](),t["ɵɵelement"](3,"span",3),t["ɵɵtemplate"](4,m,1,1,"div",4),t["ɵɵelementEnd"]()),2&e&&(t["ɵɵattribute"]("aria-label",i.label)("aria-checked",i.checked?"true":"false"),t["ɵɵadvance"](1),t["ɵɵproperty"]("checked",i.checked)("required",i.required)("disabled",i.disabled)("name",i.name),t["ɵɵadvance"](3),t["ɵɵproperty"]("ngIf",i.label))},directives:[t.NgIf],encapsulation:2}),e}(),w=function(){function e(){}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=t["ɵɵdefineNgModule"]({type:e}),e.ɵinj=t["ɵɵdefineInjector"]({imports:[[t.CommonModule,i.DirectivesModule]]}),e}(),y=["AdPixelViewTrigger"],k=["AdPixelViewReferrer"],x=["AdPixelViewClick"],C=function(){function e(e){this._dservice=e,this._scrolling=!1,this._obs=[]}return e.prototype.AttachEvents=function(){var e=this;this.onScrollEnd=new t.BehaviorSubject(null),this.onResize=new t.Subject,i.isNode()||(this._subs=this._dservice.onScroll.subscribe((function(t){e._scrolling&&clearTimeout(e._scrolltimer),e._scrolling=!0,e._scrolltimer=setTimeout((function(){e._scrolling=!1,e.onScrollEnd.next(t)}),500)})),this._resize=new t.Subject,this._obs.push(t.fromEvent(window,"resize")),this._resizesubs=this._obs[this._obs.length-1].pipe(t.takeUntil(this._resize)).subscribe((function(){e.onResize.next(null)})))},e.prototype.DetachEvents=function(){this._subs&&(this._subs.unsubscribe(),this._subs=null),this._resizesubs&&(this._resizesubs.unsubscribe(),this._resizesubs=null),this._resize&&(this._resize.next(null),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},e.ɵfac=function(n){return new(n||e)(t["ɵɵinject"](i.ScrollerService))},e.ɵprov=t["ɵɵdefineInjectable"]({token:e,factory:e.ɵfac}),e}(),I=function(){function e(e,n,r,s,o,a){var c=this;this.mainElement=e,this._dservice=n,this._renderer=r,this._srv=s,this._loc=o,this._cd=a,this.ad_disabled=!1,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.pixel_on_click=!1,this.uniqueClickId=!1,this.viewId="",this.is_viewed=!1,this.clickId="",this.sbs=new t.Subscription,this.obs=[],this.is_intersecting=!1,this.is_main_intersct=!1,this.adViewed=new t.EventEmitter,this.adSet=new t.EventEmitter,this._ng_init=!1,this._CheckForIntersection=function(e){if(!c.is_viewed)for(var t=0,n=e.length;t<n;t++){var r=e[t];if(i.isNullorUndefined(r.isIntersecting)&&c._isInViewport(r,!0)){c.is_intersecting=!0;break}if(r.isIntersecting){c.is_intersecting=!0;break}c.is_intersecting=!1}},this.use_IntersectionObserver=!(i.isNode()||!window.IntersectionObserver),this.debug&&console.log("use_IntersectionObserver is : ",this.use_IntersectionObserver)}return Object.defineProperty(e.prototype,"adId",{get:function(){return this._adId},set:function(e){var t=this;e!=this._adId&&this._ng_init&&setTimeout((function(){t._ResetnCheck(),t._cd.detectChanges()})),this._adId=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"recheck",{get:function(){return this._recheck},set:function(e){e&&this._ng_init&&this._ResetnCheck(),this._recheck=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_adlocation",{get:function(){var e=this._loc.path().replace("/ng-home/","/");return e=e.split("?")[0]},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){this._ng_init=!0,this.ad_disabled||(this.viewId=i.uniqid(),this.clickId=i.uniqid(),i.isNode()||(this.viewport=this._getViewportSize()),this.adSet.emit({viewid:this.viewId,clickid:this.clickId}))},e.prototype.ngAfterViewInit=function(){var e=this;if(this._PixelReferrer(),this._PixelAddClickId(),!i.isNode()){this.clicksList&&!this.ad_disabled&&this.clicksList.forEach((function(i){var n=t.fromEvent(i.nativeElement,"click");e.obs.push(n),e.sbs.add(n.subscribe((function(t){e._PixelClicked(i)})))})),this.referrersList&&!this.ad_disabled&&this.referrersList.forEach((function(i){var n=t.fromEvent(i.nativeElement,"click");e.obs.push(n),e.sbs.add(n.subscribe((function(t){e.is_viewed||e._PixelTrigger()})))}));var n=(this.use_IntersectionObserver?this._RegisterIntersectElements:this._CheckElements).bind(this);if(this.sbs.add(this.clicksList.changes.subscribe((function(t){e.ad_disabled||n(e.clicksList),e._PixelAddClickId()}))),this.ad_disabled||this.sbs.add(this.triggersList.changes.subscribe((function(t){n(e.triggersList)}))),this.sbs.add(this.referrersList.changes.subscribe((function(t){e._PixelReferrer(),e.ad_disabled||n(e.referrersList)}))),!this.ad_disabled){var r=this._srv.onScrollEnd,s=this._srv.onResize;this.use_IntersectionObserver?(this._intersectionObserver=new IntersectionObserver((function(t){e._CheckForIntersection(t)}),{threshold:this.triggerRatio}),this._RegisterIntersectElements("all"),this.sbs.add(r.subscribe((function(t){e.is_intersecting&&e._PixelTrigger()})))):this.sbs.add(r.subscribe((function(t){e._CheckElements("all")}))),this.sbs.add(s.subscribe((function(t){e.viewport=e._getViewportSize(),e.debug&&console.log("new viewport size : ",e.viewport),e.use_IntersectionObserver||e._CheckElements("all")}))),this._CheckElements("all")}}},e.prototype._RegisterIntersectElements=function(e){var t=this,i=!0,n=function(e){t._intersectionObserver.unobserve(e.nativeElement),t._intersectionObserver.observe(e.nativeElement),i=!1};if("all"==e?(this.triggersList&&this.triggersList.forEach(n),this.referrersList&&this.referrersList.forEach(n),this.clicksList&&this.clicksList.forEach(n)):e.forEach(n),this.is_main_intersct=i,i){var r=this.mainElement.nativeElement,s=this.ad_use_parent_el?r.parentNode:r;this._intersectionObserver.observe(s)}},e.prototype._CheckElements=function(e){var t=this;if(!this.is_viewed){var i=!0,n=function(e){i=!1,t._isInViewport(e)&&t._PixelTrigger()};if("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=i,i){var r=this.mainElement.nativeElement,s=this.ad_use_parent_el?{nativeElement:r.parentNode}:this.mainElement;n(s)}}},e.prototype._isInViewport=function(e,t){if(!this.viewport)return!1;var i=t?e.boundingClientRect:e.nativeElement.getBoundingClientRect(),n=i.height||i.bottom-i.top,r=i.width||i.right-i.left;return!(!n||!r)&&!(i.top+i.height*(this.is_main_intersct?this.triggerRatio:1)>this.viewport.h||i.bottom<0)},e.prototype._getViewportSize=function(){var e=window;if(null!=e.innerWidth)return{w:e.innerWidth,h:e.innerHeight};var t=e.document;return{w:t.body.clientWidth,h:t.body.clientWidth}},e.prototype._ResetnCheck=function(){i.isNode()||(this.is_viewed=!1,this.viewId=i.uniqid(),this.clickId=i.uniqid(),this._PixelReferrer(),this._PixelAddClickId(),this._CheckElements("all"))},e.prototype._PixelTrigger=function(){this.is_viewed||(this.is_viewed=!0,this.adViewed.emit({view:this.viewId,click:this.clickId}),this._httpCall())},e.prototype._PixelClicked=function(e,t){var n=this;void 0===t&&(t=!1),this.is_viewed||this._PixelTrigger(),(this.pixel_on_click||t)&&this._httpCall({adview_click:this.clickId}),i.reqAnimationFrame((function(){n._PixelAddClickId()}))},e.prototype.TriggerClickPixel=function(e){if(this._PixelClicked(null,!0),this.clickUrl){var t=this.clickUrl+(this.clickUrl.indexOf("?")>-1?"&":"?")+"clickId=".concat(this.clickId,"&viewId=").concat(this.viewId);e&&(t+=i.objectSerialize(e)),window.open(t,"_blank")}},e.prototype.TriggerViewPixel=function(){this._PixelTrigger()},e.prototype._PixelAddClickId=function(){var e=this;this.clicksList&&this.clicksList.forEach((function(t){var n=e.clickUrl;if(i.isNode())e._renderer.setAttribute(t.nativeElement,"href",n);else{var r=e.clickId;e.uniqueClickId&&(e.clickId=i.uniqid());var s=n+(n.indexOf("?")>-1?"&":"?")+"clickId=".concat(r,"&viewId=").concat(e.viewId);e.ad_disabled&&(s=n);var o=t.nativeElement;o.dataset&&o.dataset.clickparams&&(s.indexOf("?")>-1?s+="&":s+="?",s+=o.dataset.clickparams),e._renderer.setAttribute(t.nativeElement,"href",s)}}))},e.prototype._PixelReferrer=function(){var e=this;this.referrersList&&this.referrersList.forEach((function(t){var n=e.referrerUrl,r=n;i.isNode()||e.ad_disabled||(r+=(n.indexOf("?")>-1?"&":"?")+"viewReferrer=".concat(e.viewId)),e._renderer.setAttribute(t.nativeElement,"href",r)}))},e.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),n=i.baseUrl()+"/pixel.png";t.adview_section||delete t.adview_section,t.adview_pid||delete t.adview_pid,(0==t.adview_totals&&0==t.adview_position||-1==t.adview_totals&&-1==t.adview_position)&&(delete t.adview_position,delete t.adview_totals),i.$http({method:"GET",data:{},events:!1,url:n,query:t,expectedType:"text",retry:1}).catch((function(e){})),this.debug&&console.log(this.adId," AdPixelView fired.")},e.prototype.ngOnDestroy=function(){this.sbs.unsubscribe(),this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=null),this.obs=[]},e.ɵfac=function(n){return new(n||e)(t["ɵɵdirectiveInject"](t.ElementRef),t["ɵɵdirectiveInject"](i.ScrollerService),t["ɵɵdirectiveInject"](t.Renderer2),t["ɵɵdirectiveInject"](C),t["ɵɵdirectiveInject"](t.Location),t["ɵɵdirectiveInject"](t.ChangeDetectorRef))},e.ɵdir=t["ɵɵdefineDirective"]({type:e,selectors:[["","ad-pixel",""]],contentQueries:function(e,i,n){if(1&e&&(t["ɵɵcontentQuery"](n,y,5,t.ElementRef),t["ɵɵcontentQuery"](n,k,5,t.ElementRef),t["ɵɵcontentQuery"](n,x,5,t.ElementRef)),2&e){var r=void 0;t["ɵɵqueryRefresh"](r=t["ɵɵloadQuery"]())&&(i.triggersList=r),t["ɵɵqueryRefresh"](r=t["ɵɵloadQuery"]())&&(i.referrersList=r),t["ɵɵqueryRefresh"](r=t["ɵɵloadQuery"]())&&(i.clicksList=r)}},inputs:{ad_disabled:["ad-disabled","ad_disabled"],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"],pixel_on_click:["ad-pixel-click","pixel_on_click"],uniqueClickId:["unique-click-id","uniqueClickId"],recheck:["ad-pixel-recheck","recheck"]},outputs:{adViewed:"adViewed",adSet:"adSet"}}),e}(),E=function(){function e(e){this._srv=e,this._srv.AttachEvents()}return e.prototype.ngOnDestroy=function(){this._srv.DetachEvents()},e.ɵfac=function(i){return new(i||e)(t["ɵɵinject"](C))},e.ɵmod=t["ɵɵdefineNgModule"]({type:e}),e.ɵinj=t["ɵɵdefineInjector"]({providers:[C],imports:[[t.CommonModule,i.DirectivesModule]]}),e}(),T=["class","car-insurance-widget"];function L(e,i){if(1&e&&t["ɵɵelement"](0,"h3",16),2&e){var n=t["ɵɵnextContext"]();t["ɵɵproperty"]("innerHTML",n.title,t["ɵɵsanitizeHtml"])}}function z(e,i){if(1&e&&(t["ɵɵelementStart"](0,"div",17),t["ɵɵtext"](1),t["ɵɵelementEnd"]()),2&e){var n=t["ɵɵnextContext"]();t["ɵɵadvance"](1),t["ɵɵtextInterpolate"](n.error_msg)}}function S(e,i){if(1&e&&(t["ɵɵelementStart"](0,"div",18),t["ɵɵtext"](1),t["ɵɵelementEnd"]()),2&e){var n=t["ɵɵnextContext"]();t["ɵɵadvance"](1),t["ɵɵtextInterpolate"](n.error_msg)}}require("systemjs").import("css:/ci-shortcode.css").then((function(){}),(function(){}));var O=function(e){function n(t){return e.call(this,t)||this}return __extends(n,e),n.prototype.ngOnInit=function(){this.data?this.title=this.data:""==this.data&&(this.title=null),e.prototype.ngOnInit.call(this)},n.ɵfac=function(e){return new(e||n)(t["ɵɵdirectiveInject"](t.ChangeDetectorRef))},n.ɵcmp=t["ɵɵdefineComponent"]({type:n,selectors:[["div",8,"car-insurance-widget"]],features:[t["ɵɵInheritDefinitionFeature"]],attrs:T,decls:19,vars:19,consts:[["form-submit","","ad-pixel","",1,"form-ci-widget",3,"unique-click-id","ad-id","addl-queries","onSubmit","adViewed"],["class","ciw-head",3,"innerHTML",4,"ngIf"],[1,"ciw-row","test-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"],["id","age-ipt-label",3,"hidden"],["placeholder","Age",3,"items","second","invalid","value","labelledby","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-head",3,"innerHTML"],[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,i){1&e&&(t["ɵɵelementStart"](0,"form",0),t["ɵɵlistener"]("onSubmit",(function(){return i.GetQuote()}))("adViewed",(function(e){return i.SetAdView(e)})),t["ɵɵtemplate"](1,L,1,1,"h3",1),t["ɵɵelementStart"](2,"div",2)(3,"div",3)(4,"label",4),t["ɵɵtext"](5,"Zip Code"),t["ɵɵelementEnd"](),t["ɵɵelementStart"](6,"input",5),t["ɵɵlistener"]("input",(function(e){return i.ChangeZip(e)})),t["ɵɵelementEnd"]()(),t["ɵɵelementStart"](7,"div",6)(8,"label",7),t["ɵɵtext"](9,"Age"),t["ɵɵelementEnd"](),t["ɵɵelementStart"](10,"ng-dropdown",8),t["ɵɵlistener"]("valueChange",(function(e){return i.SetAge(e)})),t["ɵɵelementEnd"]()(),t["ɵɵtemplate"](11,z,2,1,"div",9),t["ɵɵelementStart"](12,"div",10)(13,"ng-checkbox",11),t["ɵɵlistener"]("checkedChange",(function(e){return i.ChangeInsurance(e)})),t["ɵɵelementEnd"]()(),t["ɵɵelementStart"](14,"div",12)(15,"button",13),t["ɵɵtext"](16,"Find Insurers"),t["ɵɵelement"](17,"i",14),t["ɵɵelementEnd"]()()(),t["ɵɵtemplate"](18,S,2,1,"div",15),t["ɵɵelementEnd"]()),2&e&&(t["ɵɵproperty"]("unique-click-id",!0)("ad-id",5e6)("addl-queries",i.adview_extra),t["ɵɵadvance"](1),t["ɵɵproperty"]("ngIf",i.title),t["ɵɵadvance"](3),t["ɵɵproperty"]("hidden",!0),t["ɵɵadvance"](2),t["ɵɵclassProp"]("ng-wh-error",i.invalid.zip),t["ɵɵproperty"]("value",i.zipcode),t["ɵɵadvance"](2),t["ɵɵproperty"]("hidden",!0),t["ɵɵadvance"](2),t["ɵɵproperty"]("items",i.ages)("second",!0)("invalid",i.invalid.age)("value",i.age)("labelledby","age-ipt-label"),t["ɵɵadvance"](1),t["ɵɵproperty"]("ngIf",i.show_error),t["ɵɵadvance"](2),t["ɵɵproperty"]("checked",i.insuredparam),t["ɵɵadvance"](1),t["ɵɵclassProp"]("loadactive",i.loading),t["ɵɵadvance"](4),t["ɵɵproperty"]("ngIf",i.show_error))},directives:[i.FormSubmit,I,t.NgIf,p,b],encapsulation:2,changeDetection:0}),n}(v),j=function(){function e(){}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=t["ɵɵdefineNgModule"]({type:e}),e.ɵinj=t["ɵɵdefineInjector"]({imports:[[t.CommonModule,i.DirectivesModule,f,w,i.FormSubmitModule,E]]}),e}();e.CIShortCode=O,e.CIShortCodeBase=v,e.NGCIShortCodeModule=j,e.ngDropDownModule=f,e.ngDropdown=p}));