define(["exports","./edu-vendor","./edu-main","systemjs"],(function(e,t,i,s){"use strict";function n(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var r=n(s).default;const a=["dropdownList"],o=["button"];function d(e,i){if(1&e&&t["ɵɵelement"](0,"span",9),2&e){const e=t["ɵɵnextContext"]();t["ɵɵproperty"]("cleanHTML",e.placeholder),t["ɵɵattribute"]("tabindex",e.tabindex)("aria-expanded",e.opened)}}function l(e,i){if(1&e){const e=t["ɵɵgetCurrentView"]();t["ɵɵelementStart"](0,"li",10),t["ɵɵlistener"]("onClick",(function(){const i=t["ɵɵrestoreView"](e).index,s=t["ɵɵnextContext"]();return t["ɵɵresetView"](s.selectItem(i))}))("onTap",(function(i){t["ɵɵrestoreView"](e);const s=t["ɵɵnextContext"]();return t["ɵɵresetView"](s.PreventClose(i))})),t["ɵɵelementEnd"]()}if(2&e){const e=i.$implicit,s=i.index,n=t["ɵɵnextContext"]();t["ɵɵclassProp"]("active",n.activeidx==s),t["ɵɵproperty"]("cleanHTML",e),t["ɵɵattribute"]("aria-selected",n.activeidx==s)("id",n.optionid+"-"+s)}}function c(e,i){1&e&&t["ɵɵelement"](0,"span",11),2&e&&t["ɵɵattribute"]("aria-hidden",!0)}function h(e,i){if(1&e){const e=t["ɵɵgetCurrentView"]();t["ɵɵelementStart"](0,"span",12),t["ɵɵlistener"]("onTap",(function(i){t["ɵɵrestoreView"](e);const s=t["ɵɵnextContext"]();return t["ɵɵresetView"](s.Clear(i))})),t["ɵɵelementEnd"]()}}const u=(e,t,i,s,n,r)=>({"ng-wh-error":e,"drp-b-darker":t,second:i,selected:s,opened:n,disabled:r});function p(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 g(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 _=(e,t,i,s,n)=>({"ng-wh-error":e,"drp-b-darker":t,second:i,selected:s,opened:n});class v{set value(e){this.noselection=!e,this._value=e,this.items&&(this.activeidx=this.items.indexOf(e)),this.usemap&&this.itemsMap&&this.itemsMap.length&&(!i.isNumber(this.activeidx)||this.activeidx<0)&&(this.activeidx=this.itemsMap.indexOf(this._value))}get value(){return this.itemsMap&&i.isNumber(this.activeidx)?(this.itemsMap[this.activeidx]||this._value||"").toString():this._value}get value_ui(){return this.itemsMap&&i.isNumber(this.activeidx)?this.usemap&&this.itemsMap&&this.itemsMap.length&&i.isNumber(this.activeidx)?(this.items[this.activeidx]||this._value||"").toString():(this.itemsMap[this.activeidx]||this._value||"").toString():this._value}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())}Clear(e){this._value=null,this.activeidx=null,this.valueChange.emit(this.value),this.noselection=!0,this.selected.emit({eventName:"select",value:this.value,index:null}),this.activedescendant=null,this._cd.detectChanges(),this.listbutton&&this.listbutton.nativeElement.focus(),e.preventDefault(),e.stopPropagation()}trackByFn(e){return e}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.clearable=!1,this.usemap=!1,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}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}}))}}v.ɵfac=function(e){return new(e||v)(t["ɵɵdirectiveInject"](t.ChangeDetectorRef))},v.ɵcmp=t["ɵɵdefineComponent"]({type:v,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",itemsMap:"itemsMap",second:"second",darker:["dark-borders","darker"],invalid:"invalid",disabled:"disabled",bounds_check:["bounds-check","bounds_check"],labelledby:"labelledby",clearable:"clearable",usemap:"usemap",value:"value"},outputs:{valueChange:"valueChange",selected:"selected",onTapped:"onTapped"},decls:9,vars:21,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"],["zing-touch","","tabindex","0","aria-role","button","aria-label","Clear Selection","class","dropdown-close bf-icon-cross",3,"onTap",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"],["zing-touch","","tabindex","0","aria-role","button","aria-label","Clear Selection",1,"dropdown-close","bf-icon-cross",3,"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,d,1,3,"span",1),t["ɵɵelement"](2,"span",2,3),t["ɵɵelementStart"](4,"ul",4,5),t["ɵɵtemplate"](6,l,1,5,"li",6),t["ɵɵelementEnd"](),t["ɵɵtemplate"](7,c,1,1,"span",7)(8,h,1,0,"span",8),t["ɵɵelementEnd"]()),2&e&&(t["ɵɵproperty"]("ngClass",t["ɵɵpureFunction6"](14,u,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_ui),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||i.clearable&&!i.noselection)),t["ɵɵadvance"](1),t["ɵɵproperty"]("ngIf",!i.disabled&&i.clearable&&!i.noselection))},dependencies:[t.NgClass,t.NgForOf,t.NgIf,i.TouchGestures,i.ngHidden,i.ngCleanHTML],encapsulation:2});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]});class b extends v{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))}}b.ɵfac=(()=>{let e;return function(i){return(e||(e=t["ɵɵgetInheritedFactory"](b)))(i||b)}})(),b.ɵcmp=t["ɵɵdefineComponent"]({type:b,selectors:[["ng-dropdown-bool"]],inputs:{text:"text",name:"name",label:"label"},features:[t["ɵɵInheritDefinitionFeature"]],decls:19,vars:17,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"],[1,"checkbox"],["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,p,1,1,"span",1)(2,g,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"](11,_,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["ɵɵtextInterpolate"](i.text),t["ɵɵadvance"](2),t["ɵɵattribute"]("aria-label",i.label),t["ɵɵadvance"](1),t["ɵɵproperty"]("checked",!0===i.booleanValue)("name",i.name),t["ɵɵadvance"](4),t["ɵɵattribute"]("aria-label",i.label),t["ɵɵadvance"](1),t["ɵɵproperty"]("checked",!1===i.booleanValue)("name",i.name))},dependencies:[t.NgClass,t.NgIf,i.TouchGestures,i.ngHidden,i.ngCleanHTML],encapsulation:2});class f{}f.ɵfac=function(e){return new(e||f)},f.ɵmod=t["ɵɵdefineNgModule"]({type:f}),f.ɵinj=t["ɵɵdefineInjector"]({imports:[t.CommonModule,i.DirectivesModule]});class w{get insuredvalue(){return this.insuredparam.toString()}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}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||!0===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)}}w.ɵfac=function(e){return new(e||w)(t["ɵɵdirectiveInject"](t.ChangeDetectorRef))},w.ɵdir=t["ɵɵdefineDirective"]({type:w,inputs:{typeList:["type-list","typeList"],age:"age",insured:"insured",zipcode:"zipcode",layoutType:["layout-type","layoutType"]}});class k extends w{constructor(e){super(e),this.adview_ready=!1}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.adview_ready=!0,this._cd.detectChanges(),null))).catch((e=>{console.warn("could not get session id",e),this.adview_ready=!0,this._cd.detectChanges()}))}ngOnInit(){super.ngOnInit(),i.isNode()||(this.adview_extra={adview_offer_type:"Car_Insurance_Widget"},this._GetSesId())}}k.ɵfac=function(e){return new(e||k)(t["ɵɵdirectiveInject"](t.ChangeDetectorRef))},k.ɵdir=t["ɵɵdefineDirective"]({type:k,features:[t["ɵɵInheritDefinitionFeature"]]});const x=["input"];function C(e,i){if(1&e&&t["ɵɵelement"](0,"div",6),2&e){const e=t["ɵɵnextContext"]();t["ɵɵproperty"]("cleanHTML",e.label)}}function y(e,i){if(1&e&&t["ɵɵelement"](0,"div",7),2&e){const e=t["ɵɵnextContext"]();t["ɵɵproperty"]("cleanHTML",e.label)("zing-url-container",!0)}}class I{get required(){return this._required}set required(e){this._required=!!e}Check(){this.checked=!this.checked,this.checkedChange.emit(this.checked)}constructor(e){this.renderer=e,this.name=null,this.label=null,this.has_links=!1,this.arialabel=null,this.checkedChange=new t.EventEmitter,this.checked=!1,this.disabled=!1}ngAfterViewInit(){i.isNode()&&this.checked&&this.renderer.setAttribute(this.checkbox.nativeElement,"checked","checked")}}I.ɵfac=function(e){return new(e||I)(t["ɵɵdirectiveInject"](t.Renderer2))},I.ɵcmp=t["ɵɵdefineComponent"]({type:I,selectors:[["ng-checkbox"]],viewQuery:function(e,i){if(1&e&&t["ɵɵviewQuery"](x,5,t.ElementRef),2&e){let e;t["ɵɵqueryRefresh"](e=t["ɵɵloadQuery"]())&&(i.checkbox=e.first)}},inputs:{required:"required",name:"name",label:"label",has_links:["label-with-links","has_links"],arialabel:"arialabel",checked:"checked",disabled:"disabled"},outputs:{checkedChange:"checkedChange"},decls:6,vars:8,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,"cleanHTML",4,"ngIf"],["class","name text-select","zing-touch","",3,"cleanHTML","zing-url-container",4,"ngIf"],[1,"name",3,"cleanHTML"],["zing-touch","",1,"name","text-select",3,"cleanHTML","zing-url-container"]],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,C,1,1,"div",4)(5,y,1,2,"div",5),t["ɵɵelementEnd"]()),2&e&&(t["ɵɵattribute"]("aria-label",i.arialabel||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&&!i.has_links),t["ɵɵadvance"](1),t["ɵɵproperty"]("ngIf",i.label&&i.has_links))},dependencies:[t.NgIf,i.TouchGestures,i.ngCleanHTML],encapsulation:2});class E{}E.ɵfac=function(e){return new(e||E)},E.ɵmod=t["ɵɵdefineNgModule"]({type:E}),E.ɵinj=t["ɵɵdefineInjector"]({imports:[t.CommonModule,i.DirectivesModule]});const T=["AdPixelViewTrigger"],L=["AdPixelViewReferrer"],z=["AdPixelViewClick"];class S{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}}S.ɵfac=function(e){return new(e||S)(t["ɵɵinject"](i.ScrollerService))},S.ɵprov=t["ɵɵdefineInjectable"]({token:S,factory:S.ɵfac});class M{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}constructor(e,s,n,r,a,o){this.mainElement=e,this._dservice=s,this._renderer=n,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,s=e.length;t<s;t++){let s=e[t];if(i.isNullorUndefined(s.isIntersecting)&&this._isInViewport(s,!0)){this.is_intersecting=!0;break}if(s.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)}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.clicksList&&this.sbs.add(this.clicksList.changes.subscribe((t=>{this.ad_disabled||e(this.clicksList),this._PixelAddClickId()}))),!this.ad_disabled&&this.triggersList&&this.sbs.add(this.triggersList.changes.subscribe((t=>{e(this.triggersList)}))),this.referrersList&&this.sbs.add(this.referrersList.changes.subscribe((t=>{this._PixelReferrer(),this.ad_disabled||e(this.referrersList)}))),this.ad_disabled)return;const s=this._srv.onScrollEnd,n=this._srv.onResize;this.use_IntersectionObserver?(this._intersectionObserver=new IntersectionObserver((e=>{this._CheckForIntersection(e)}),{threshold:this.triggerRatio}),this._RegisterIntersectElements("all"),this.sbs.add(s.subscribe((e=>{this.is_intersecting&&this._PixelTrigger()})))):this.sbs.add(s.subscribe((e=>{this._CheckElements("all")}))),this.sbs.add(n.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(),s=i.height||i.bottom-i.top,n=i.width||i.right-i.left;return!(!s||!n)&&!(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 s=this.clickId;this.uniqueClickId&&(this.clickId=i.uniqid());let n=t+(t.indexOf("?")>-1?"&":"?")+`clickId=${s}&viewId=${this.viewId}`;this.ad_disabled&&(n=t);const r=e.nativeElement;r.dataset&&r.dataset.clickparams&&(n.indexOf("?")>-1?n+="&":n+="?",n+=r.dataset.clickparams),this._renderer.setAttribute(e.nativeElement,"href",n)}))}_PixelReferrer(){this.referrersList&&this.referrersList.forEach((e=>{const t=this.referrerUrl;let s=t;i.isNode()||this.ad_disabled||(s+=(t.indexOf("?")>-1?"&":"?")+`viewReferrer=${this.viewId}`),this._renderer.setAttribute(e.nativeElement,"href",s)}))}_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),s=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:t,events:!1,url:s,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=[]}}M.ɵfac=function(e){return new(e||M)(t["ɵɵdirectiveInject"](t.ElementRef),t["ɵɵdirectiveInject"](i.ScrollerService),t["ɵɵdirectiveInject"](t.Renderer2),t["ɵɵdirectiveInject"](S),t["ɵɵdirectiveInject"](t.Location),t["ɵɵdirectiveInject"](t.ChangeDetectorRef))},M.ɵdir=t["ɵɵdefineDirective"]({type:M,selectors:[["","ad-pixel",""]],contentQueries:function(e,i,s){if(1&e&&(t["ɵɵcontentQuery"](s,T,5,t.ElementRef),t["ɵɵcontentQuery"](s,L,5,t.ElementRef),t["ɵɵcontentQuery"](s,z,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 O{constructor(e){this._srv=e,this._srv.AttachEvents()}ngOnDestroy(){this._srv.DetachEvents()}}O.ɵfac=function(e){return new(e||O)(t["ɵɵinject"](S))},O.ɵmod=t["ɵɵdefineNgModule"]({type:O}),O.ɵinj=t["ɵɵdefineInjector"]({providers:[S],imports:[t.CommonModule,i.DirectivesModule]});const j=["adForm"];function R(e,i){if(1&e&&t["ɵɵelement"](0,"h3",17),2&e){const e=t["ɵɵnextContext"]();t["ɵɵproperty"]("innerHTML",e.title,t["ɵɵsanitizeHtml"])}}function V(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)}}function P(e,i){if(1&e&&(t["ɵɵelementStart"](0,"div",19),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 N extends k{constructor(e){super(e)}ngOnInit(){this.data?this.title=this.data:""==this.data&&(this.title=null),super.ngOnInit()}ngAfterViewInit(){this.adView.is_viewed=!0,this._cd.detectChanges()}}N.ɵfac=function(e){return new(e||N)(t["ɵɵdirectiveInject"](t.ChangeDetectorRef))},N.ɵcmp=t["ɵɵdefineComponent"]({type:N,selectors:[["div",8,"car-insurance-widget"]],viewQuery:function(e,i){if(1&e&&t["ɵɵviewQuery"](j,5,M),2&e){let e;t["ɵɵqueryRefresh"](e=t["ɵɵloadQuery"]())&&(i.adView=e.first)}},features:[t["ɵɵInheritDefinitionFeature"]],attrs:["class","car-insurance-widget"],decls:20,vars:20,consts:[["form-submit","","ad-pixel","",1,"form-ci-widget",3,"unique-click-id","ad-pixel-recheck","ad-id","addl-queries","onSubmit","adViewed"],["adForm",""],["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"],["type","submit",1,"btn","blue","ciw-btn","with-loader"],[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,1),t["ɵɵlistener"]("onSubmit",(function(){return i.GetQuote()}))("adViewed",(function(e){return i.SetAdView(e)})),t["ɵɵtemplate"](2,R,1,1,"h3",2),t["ɵɵelementStart"](3,"div",3)(4,"div",4)(5,"label",5),t["ɵɵtext"](6,"Zip Code"),t["ɵɵelementEnd"](),t["ɵɵelementStart"](7,"input",6),t["ɵɵlistener"]("input",(function(e){return i.ChangeZip(e)})),t["ɵɵelementEnd"]()(),t["ɵɵelementStart"](8,"div",7)(9,"label",8),t["ɵɵtext"](10,"Age"),t["ɵɵelementEnd"](),t["ɵɵelementStart"](11,"ng-dropdown",9),t["ɵɵlistener"]("valueChange",(function(e){return i.SetAge(e)})),t["ɵɵelementEnd"]()(),t["ɵɵtemplate"](12,V,2,1,"div",10),t["ɵɵelementStart"](13,"div",11)(14,"ng-checkbox",12),t["ɵɵlistener"]("checkedChange",(function(e){return i.ChangeInsurance(e)})),t["ɵɵelementEnd"]()(),t["ɵɵelementStart"](15,"div",13)(16,"button",14),t["ɵɵtext"](17,"Find Insurers"),t["ɵɵelement"](18,"span",15),t["ɵɵelementEnd"]()()(),t["ɵɵtemplate"](19,P,2,1,"div",16),t["ɵɵelementEnd"]()),2&e&&(t["ɵɵproperty"]("unique-click-id",!0)("ad-pixel-recheck",i.adview_ready)("ad-id",5e6)("addl-queries",i.adview_extra),t["ɵɵadvance"](2),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"](2),t["ɵɵclassProp"]("loadactive",i.loading),t["ɵɵadvance"](3),t["ɵɵproperty"]("ngIf",i.show_error))},dependencies:[t.NgIf,v,I,i.FormSubmit,M],encapsulation:2,changeDetection:0});class q{}q.ɵfac=function(e){return new(e||q)},q.ɵmod=t["ɵɵdefineNgModule"]({type:q}),q.ɵinj=t["ɵɵdefineInjector"]({imports:[t.CommonModule,i.DirectivesModule,m,E,i.FormSubmitModule,O]}),e.CIShortCode=N,e.CIShortCodeBase=k,e.DropDown=v,e.DropDownModule=m,e.NGCIShortCodeModule=q}));