define(["exports","./edu-vendor","./edu-main","systemjs"],(function(e,t,i,n){"use strict";function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var r=s(n);const a=["dropdownList"],o=["button"];function d(e,i){if(1&e&&t["ɵɵelement"](0,"span",8),2&e){const e=t["ɵɵnextContext"]();t["ɵɵproperty"]("cleanHTML",e.placeholder),t["ɵɵattribute"]("tabindex",e.tabindex)("aria-expanded",e.opened)}}function c(e,i){if(1&e){const e=t["ɵɵgetCurrentView"]();t["ɵɵelementStart"](0,"li",9),t["ɵɵlistener"]("onClick",(function(){const i=t["ɵɵrestoreView"](e).index,n=t["ɵɵnextContext"]();return t["ɵɵresetView"](n.selectItem(i))}))("onTap",(function(i){t["ɵɵrestoreView"](e);const n=t["ɵɵnextContext"]();return t["ɵɵresetView"](n.PreventClose(i))})),t["ɵɵelementEnd"]()}if(2&e){const e=i.$implicit,n=i.index,s=t["ɵɵnextContext"]();t["ɵɵclassProp"]("active",s.activeidx==n),t["ɵɵproperty"]("cleanHTML",e),t["ɵɵattribute"]("aria-selected",s.activeidx==n)("id",s.optionid+"-"+n)}}function l(e,i){1&e&&t["ɵɵelement"](0,"span",10),2&e&&t["ɵɵattribute"]("aria-hidden",!0)}const h=function(e,t,i,n,s,r){return{"ng-wh-error":e,"drp-b-darker":t,second:i,selected:n,opened:s,disabled:r}};function u(e,i){if(1&e&&(t["ɵɵelementStart"](0,"span",12),t["ɵɵlistener"]("onTap",(function(){return!0})),t["ɵɵelementEnd"]()),2&e){const e=t["ɵɵnextContext"]();t["ɵɵproperty"]("cleanHTML",e.placeholder)}}function p(e,i){if(1&e&&(t["ɵɵelementStart"](0,"span",13),t["ɵɵlistener"]("onTap",(function(){return!0})),t["ɵɵelementEnd"]()),2&e){const e=t["ɵɵnextContext"]();t["ɵɵproperty"]("cleanHTML",e.value)}}const g=function(e,t,i,n,s){return{"ng-wh-error":e,"drp-b-darker":t,second:i,selected:n,opened:s}};class _{constructor(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}set value(e){this.noselection=!e,this._value=e}get value(){return(this._value||"").toString()}controlList(e,t){this.disabled||(this.opened=void 0!==t?t:!this.opened,this.onTapped.emit(this),this.fixOverflow(),this._android_delay=!0,setTimeout((()=>{this._android_delay=!1}),100))}close(){this.opened=!1}open(){this.opened=!0}PreventClose(e){e&&e.srcEvent&&(e.srcEvent.cancelBubble=!0,e.srcEvent.stopPropagation&&e.srcEvent.stopPropagation()),e&&e.stopPropagation&&e.stopPropagation()}selectItem(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())}trackByFn(e){return e}ngOnInit(){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)}fixOverflow(){let e=this.dropdownList&&this.dropdownList.nativeElement,t=e&&e.parentElement;i.reqAnimationFrame((()=>{try{let i=e.getBoundingClientRect();t.getBoundingClientRect().x+i.width>=window.innerWidth?e.classList.add("sticky-right"):e.classList.remove("sticky-right"),this.bounds_check&&i.y+i.height>window.innerHeight?e.classList.add("upwards"):e.classList.remove("upwards")}catch(e){throw e}}))}}_.ɵfac=function(e){return new(e||_)(t["ɵɵdirectiveInject"](t.ChangeDetectorRef))},_.ɵcmp=t["ɵɵdefineComponent"]({type:_,selectors:[["ng-dropdown"]],viewQuery:function(e,i){if(1&e&&(t["ɵɵviewQuery"](a,5,t.ElementRef),t["ɵɵviewQuery"](o,5,t.ElementRef)),2&e){let e;t["ɵɵqueryRefresh"](e=t["ɵɵloadQuery"]())&&(i.dropdownList=e.first),t["ɵɵqueryRefresh"](e=t["ɵɵloadQuery"]())&&(i.listbutton=e.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,d,1,3,"span",1),t["ɵɵelement"](2,"span",2,3),t["ɵɵelementStart"](4,"ul",4,5),t["ɵɵtemplate"](6,c,1,5,"li",6),t["ɵɵelementEnd"](),t["ɵɵtemplate"](7,l,1,1,"span",7),t["ɵɵelementEnd"]()),2&e&&(t["ɵɵproperty"]("ngClass",t["ɵɵpureFunction6"](13,h,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))},dependencies:[t.NgClass,t.NgForOf,t.NgIf,i.ngHidden,i.ngCleanHTML,i.TouchGestures],encapsulation:2});class m extends _{constructor(){super(...arguments),this.text="Some text to display",this.name="",this.label="",this.booleanValue=null}Check(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))}}m.ɵfac=function(){let e;return function(i){return(e||(e=t["ɵɵgetInheritedFactory"](m)))(i||m)}}(),m.ɵcmp=t["ɵɵdefineComponent"]({type:m,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,u,1,1,"span",1),t["ɵɵtemplate"](2,p,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,g,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))},dependencies:[t.NgClass,t.NgIf,i.ngHidden,i.ngCleanHTML,i.TouchGestures],encapsulation:2});class v{}v.ɵfac=function(e){return new(e||v)},v.ɵmod=t["ɵɵdefineNgModule"]({type:v}),v.ɵinj=t["ɵɵdefineInjector"]({imports:[t.CommonModule,i.DirectivesModule]});class b{constructor(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}get insuredvalue(){return this.insuredparam.toString()}SetAdView(e){this.ad_click_id=e.click,this.ad_view_id=e.view,this._cd.detectChanges()}ChangeInsurance(e){this.insured=e,this.insuredparam="Yes"==e,this._cd.detectChanges()}ChangeZip(e){this.zipcode=e.target.value,this.invalid.zip=!1,this.show_error=!1,clearTimeout(this._ajax_error_timer),this._cd.detectChanges()}SetAge(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()}_ajaxError(){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((()=>{this.show_error=!1,this._cd.detectChanges()}),2500)}GetQuote(e){if(!this.loading){if(this.pass_validation=!1,this.show_error)return this.show_error=!1,this._cd.detectChanges(),void setTimeout((()=>{this.show_error=!0,this._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:()=>{this.loading=!1,this._cd.detectChanges()}}).then((e=>{e.error?this._ajaxError():window.open(e.goto_link,"_self")})).catch((e=>{this._ajaxError()})))}}ngOnInit(){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((e=>{e.zip?this.zipcode=e.zip:"-"!=e[7]&&(this.zipcode=e[7]||""),this._cd.detectChanges()})).catch((e=>{this._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()))}ngOnDestroy(){clearTimeout(this._ajax_error_timer)}}b.ɵfac=function(e){return new(e||b)(t["ɵɵdirectiveInject"](t.ChangeDetectorRef))},b.ɵdir=t["ɵɵdefineDirective"]({type:b,inputs:{typeList:["type-list","typeList"],age:"age",insured:"insured",zipcode:"zipcode",layoutType:["layout-type","layoutType"]}});class f extends b{constructor(e){super(e)}ChangeInsurance(e){this.insuredparam=e,this._cd.detectChanges()}_GetSesId(){return i.$http({url:i.baseUrl()+"/sid.php",data:{a:"1"},method:"GET",events:!1,retry:2}).then((e=>(e&&e.__whid&&(this.adview_extra={adview_offer_type:"Car_Insurance_Widget",session_id:e.__whid}),this._cd.detectChanges(),null))).catch((e=>{console.warn("could not get session id",e)}))}ngOnInit(){if(super.ngOnInit(),i.isNode())return;const e=i.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)(t["ɵɵdirectiveInject"](t.ChangeDetectorRef))},f.ɵdir=t["ɵɵdefineDirective"]({type:f,features:[t["ɵɵInheritDefinitionFeature"]]});const w=["input"];function k(e,i){if(1&e&&t["ɵɵelement"](0,"div",5),2&e){const e=t["ɵɵnextContext"]();t["ɵɵproperty"]("innerHTML",e.label,t["ɵɵsanitizeHtml"])}}class x{constructor(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}get required(){return this._required}set required(e){this._required=!!e}Check(){this.checked=!this.checked,this.checkedChange.emit(this.checked)}ngAfterViewInit(){i.isNode()&&this.checked&&this.renderer.setAttribute(this.checkbox.nativeElement,"checked","checked")}}x.ɵfac=function(e){return new(e||x)(t["ɵɵdirectiveInject"](t.ElementRef),t["ɵɵdirectiveInject"](t.Renderer2))},x.ɵcmp=t["ɵɵdefineComponent"]({type:x,selectors:[["ng-checkbox"]],viewQuery:function(e,i){if(1&e&&t["ɵɵviewQuery"](w,5,t.ElementRef),2&e){let e;t["ɵɵqueryRefresh"](e=t["ɵɵloadQuery"]())&&(i.checkbox=e.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,k,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))},dependencies:[t.NgIf],encapsulation:2});class C{}C.ɵfac=function(e){return new(e||C)},C.ɵmod=t["ɵɵdefineNgModule"]({type:C}),C.ɵinj=t["ɵɵdefineInjector"]({imports:[t.CommonModule,i.DirectivesModule]});const I=["AdPixelViewTrigger"],y=["AdPixelViewReferrer"],E=["AdPixelViewClick"];class T{constructor(e){this._dservice=e,this._scrolling=!1,this._obs=[]}AttachEvents(){this.onScrollEnd=new t.BehaviorSubject(null),this.onResize=new t.Subject,i.isNode()||(this._subs=this._dservice.onScroll.subscribe((e=>{this._scrolling&&clearTimeout(this._scrolltimer),this._scrolling=!0,this._scrolltimer=setTimeout((()=>{this._scrolling=!1,this.onScrollEnd.next(e)}),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((()=>{this.onResize.next(null)})))}DetachEvents(){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}}T.ɵfac=function(e){return new(e||T)(t["ɵɵinject"](i.ScrollerService))},T.ɵprov=t["ɵɵdefineInjectable"]({token:T,factory:T.ɵfac});class L{constructor(e,n,s,r,a,o){this.mainElement=e,this._dservice=n,this._renderer=s,this._srv=r,this._loc=a,this._cd=o,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=e=>{if(!this.is_viewed)for(let t=0,n=e.length;t<n;t++){let n=e[t];if(i.isNullorUndefined(n.isIntersecting)&&this._isInViewport(n,!0)){this.is_intersecting=!0;break}if(n.isIntersecting){this.is_intersecting=!0;break}this.is_intersecting=!1}},this.use_IntersectionObserver=!(i.isNode()||!window.IntersectionObserver),this.debug&&console.log("use_IntersectionObserver is : ",this.use_IntersectionObserver)}set adId(e){e!=this._adId&&this._ng_init&&setTimeout((()=>{this._ResetnCheck(),this._cd.detectChanges()})),this._adId=e}get adId(){return this._adId}set recheck(e){e&&this._ng_init&&this._ResetnCheck(),this._recheck=e}get recheck(){return this._recheck}get _adlocation(){let e=this._loc.path().replace("/ng-home/","/");return e=e.split("?")[0],e}ngOnInit(){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}))}ngAfterViewInit(){if(this._PixelReferrer(),this._PixelAddClickId(),i.isNode())return;this.clicksList&&!this.ad_disabled&&this.clicksList.forEach((e=>{const i=t.fromEvent(e.nativeElement,"click");this.obs.push(i),this.sbs.add(i.subscribe((t=>{this._PixelClicked(e)})))})),this.referrersList&&!this.ad_disabled&&this.referrersList.forEach((e=>{const i=t.fromEvent(e.nativeElement,"click");this.obs.push(i),this.sbs.add(i.subscribe((e=>{this.is_viewed||this._PixelTrigger()})))}));let e=(this.use_IntersectionObserver?this._RegisterIntersectElements:this._CheckElements).bind(this);if(this.sbs.add(this.clicksList.changes.subscribe((t=>{this.ad_disabled||e(this.clicksList),this._PixelAddClickId()}))),this.ad_disabled||this.sbs.add(this.triggersList.changes.subscribe((t=>{e(this.triggersList)}))),this.sbs.add(this.referrersList.changes.subscribe((t=>{this._PixelReferrer(),this.ad_disabled||e(this.referrersList)}))),this.ad_disabled)return;const n=this._srv.onScrollEnd,s=this._srv.onResize;this.use_IntersectionObserver?(this._intersectionObserver=new IntersectionObserver((e=>{this._CheckForIntersection(e)}),{threshold:this.triggerRatio}),this._RegisterIntersectElements("all"),this.sbs.add(n.subscribe((e=>{this.is_intersecting&&this._PixelTrigger()})))):this.sbs.add(n.subscribe((e=>{this._CheckElements("all")}))),this.sbs.add(s.subscribe((e=>{this.viewport=this._getViewportSize(),this.debug&&console.log("new viewport size : ",this.viewport),this.use_IntersectionObserver||this._CheckElements("all")}))),setTimeout((()=>{this._CheckElements("all")}))}_RegisterIntersectElements(e){let t=!0,i=e=>{this._intersectionObserver.unobserve(e.nativeElement),this._intersectionObserver.observe(e.nativeElement),t=!1};if("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=t,t){let e=this.mainElement.nativeElement,t=this.ad_use_parent_el?e.parentNode:e;this._intersectionObserver.observe(t)}}_CheckElements(e){if(this.is_viewed)return;let t=!0,i=e=>{t=!1,this._isInViewport(e)&&this._PixelTrigger()};if("all"==e?(this.triggersList&&this.triggersList.forEach((e=>{i(e)})),this.referrersList&&this.referrersList.forEach((e=>{i(e)})),this.clicksList&&this.clicksList.forEach((e=>{i(e)}))):e&&e.forEach((e=>{i(e)})),this.is_main_intersct=t,t){let e=this.mainElement.nativeElement,t=this.ad_use_parent_el?{nativeElement:e.parentNode}:this.mainElement;i(t)}}_isInViewport(e,t){if(!this.viewport)return!1;var i=t?e.boundingClientRect:e.nativeElement.getBoundingClientRect(),n=i.height||i.bottom-i.top,s=i.width||i.right-i.left;return!(!n||!s)&&!(i.top+i.height*(this.is_main_intersct?this.triggerRatio:1)>this.viewport.h||i.bottom<0)}_getViewportSize(){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}}_ResetnCheck(){i.isNode()||(this.is_viewed=!1,this.viewId=i.uniqid(),this.clickId=i.uniqid(),this._PixelReferrer(),this._PixelAddClickId(),this._CheckElements("all"))}_PixelTrigger(){this.is_viewed||(this.is_viewed=!0,this.adViewed.emit({view:this.viewId,click:this.clickId}),this._httpCall())}_PixelClicked(e,t=!1){this.is_viewed||this._PixelTrigger(),(this.pixel_on_click||t)&&this._httpCall({adview_click:this.clickId}),i.reqAnimationFrame((()=>{this._PixelAddClickId()}))}TriggerClickPixel(e){if(this._PixelClicked(null,!0),this.clickUrl){let t=this.clickUrl+(this.clickUrl.indexOf("?")>-1?"&":"?")+`clickId=${this.clickId}&viewId=${this.viewId}`;e&&(t+=i.objectSerialize(e)),window.open(t,"_blank")}}TriggerViewPixel(){this._PixelTrigger()}_PixelAddClickId(){this.clicksList&&this.clicksList.forEach((e=>{const t=this.clickUrl;if(i.isNode())return void this._renderer.setAttribute(e.nativeElement,"href",t);const n=this.clickId;this.uniqueClickId&&(this.clickId=i.uniqid());let s=t+(t.indexOf("?")>-1?"&":"?")+`clickId=${n}&viewId=${this.viewId}`;this.ad_disabled&&(s=t);const r=e.nativeElement;r.dataset&&r.dataset.clickparams&&(s.indexOf("?")>-1?s+="&":s+="?",s+=r.dataset.clickparams),this._renderer.setAttribute(e.nativeElement,"href",s)}))}_PixelReferrer(){this.referrersList&&this.referrersList.forEach((e=>{const t=this.referrerUrl;let n=t;i.isNode()||this.ad_disabled||(n+=(t.indexOf("?")>-1?"&":"?")+`viewReferrer=${this.viewId}`),this._renderer.setAttribute(e.nativeElement,"href",n)}))}_httpCall(e={}){let 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((e=>{})),this.debug&&console.log(this.adId," AdPixelView fired.")}ngOnDestroy(){this.sbs.unsubscribe(),this._intersectionObserver&&(this._intersectionObserver.disconnect(),this._intersectionObserver=null),this.obs=[]}}L.ɵfac=function(e){return new(e||L)(t["ɵɵdirectiveInject"](t.ElementRef),t["ɵɵdirectiveInject"](i.ScrollerService),t["ɵɵdirectiveInject"](t.Renderer2),t["ɵɵdirectiveInject"](T),t["ɵɵdirectiveInject"](t.Location),t["ɵɵdirectiveInject"](t.ChangeDetectorRef))},L.ɵdir=t["ɵɵdefineDirective"]({type:L,selectors:[["","ad-pixel",""]],contentQueries:function(e,i,n){if(1&e&&(t["ɵɵcontentQuery"](n,I,5,t.ElementRef),t["ɵɵcontentQuery"](n,y,5,t.ElementRef),t["ɵɵcontentQuery"](n,E,5,t.ElementRef)),2&e){let e;t["ɵɵqueryRefresh"](e=t["ɵɵloadQuery"]())&&(i.triggersList=e),t["ɵɵqueryRefresh"](e=t["ɵɵloadQuery"]())&&(i.referrersList=e),t["ɵɵqueryRefresh"](e=t["ɵɵloadQuery"]())&&(i.clicksList=e)}},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"}});class z{constructor(e){this._srv=e,this._srv.AttachEvents()}ngOnDestroy(){this._srv.DetachEvents()}}z.ɵfac=function(e){return new(e||z)(t["ɵɵinject"](T))},z.ɵmod=t["ɵɵdefineNgModule"]({type:z}),z.ɵinj=t["ɵɵdefineInjector"]({providers:[T],imports:[t.CommonModule,i.DirectivesModule]});function S(e,i){if(1&e&&t["ɵɵelement"](0,"h3",16),2&e){const e=t["ɵɵnextContext"]();t["ɵɵproperty"]("innerHTML",e.title,t["ɵɵsanitizeHtml"])}}function O(e,i){if(1&e&&(t["ɵɵelementStart"](0,"div",17),t["ɵɵtext"](1),t["ɵɵelementEnd"]()),2&e){const e=t["ɵɵnextContext"]();t["ɵɵadvance"](1),t["ɵɵtextInterpolate"](e.error_msg)}}function R(e,i){if(1&e&&(t["ɵɵelementStart"](0,"div",18),t["ɵɵtext"](1),t["ɵɵelementEnd"]()),2&e){const e=t["ɵɵnextContext"]();t["ɵɵadvance"](1),t["ɵɵtextInterpolate"](e.error_msg)}}r.import("css:/ci-shortcode.css").then((()=>{}),(()=>{}));class j extends f{constructor(e){super(e)}ngOnInit(){this.data?this.title=this.data:""==this.data&&(this.title=null),super.ngOnInit()}}j.ɵfac=function(e){return new(e||j)(t["ɵɵdirectiveInject"](t.ChangeDetectorRef))},j.ɵcmp=t["ɵɵdefineComponent"]({type:j,selectors:[["div",8,"car-insurance-widget"]],features:[t["ɵɵInheritDefinitionFeature"]],attrs:["class","car-insurance-widget"],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,S,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,O,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,R,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))},dependencies:[t.NgIf,_,x,i.FormSubmit,L],encapsulation:2,changeDetection:0});class M{}M.ɵfac=function(e){return new(e||M)},M.ɵmod=t["ɵɵdefineNgModule"]({type:M}),M.ɵinj=t["ɵɵdefineInjector"]({imports:[t.CommonModule,i.DirectivesModule,v,C,i.FormSubmitModule,z]}),e.CIShortCode=j,e.CIShortCodeBase=f,e.NGCIShortCodeModule=M,e.ngDropDownModule=v,e.ngDropdown=_}));