1import{A as $,E as p,xa as j,za as w}from"./chunk-YT5HM723.js";import{Aa as h,G as I,L as l,Z as g,aa as x,ga as T,i as v,la as c,pa as o,r as b,s as u,v as f,y}from"./chunk-C4YA3FN6.js";import{i as d}from"./chunk-RKLIRILV.js";var B=(()=>{let r=class r extends w{constructor(t,e){super(t,e),this.injector=t,this.apiBaseUrlTravelInsurance=j.apiBaseUrlTravelInsurance}postPromiseTravelInsurance(t,e){return d(this,null,function*(){let s=this.buildUrl(this.apiBaseUrlTravelInsurance,e),a=this.applyPolicy(this.http.post(s,t,{headers:this.defaultHeaders}),{maxRetries:1,retryNetwork:!0,retry5xx:!0,retryTimeout:!1});return f(a)})}postTravelInsurance(t,e,s){let a=this.buildUrl(this.apiBaseUrlTravelInsurance,e),n=this.mergeHeaders(this.defaultHeaders,s);return this.applyPolicy(this.http.post(a,t,{headers:n}),{maxRetries:1,retryNetwork:!0,retry5xx:!0,retryTimeout:!1}).pipe(l(m=>this.handleError(m)))}getTravelInsuranceObservable(t,e="",s){let a=this.buildUrl(this.apiBaseUrlTravelInsurance,t),n=new $({fromObject:s?.params??{}});s?.noCache&&(n=n.set("cb",Date.now().toString()));let m=this.defaultHeaders.set("searchKey",e).set("Cache-Control","no-cache, no-store, must-revalidate").set("Pragma","no-cache").set("Expires","0");return this.applyPolicy(this.http.get(a,{headers:m,params:n}),{maxRetries:1,retryNetwork:!0,retry5xx:!0,retryTimeout:!1}).pipe(l(E=>this.handleError(E)))}getTravelInsurancePromise(t,e=""){return d(this,null,function*(){let s=this.buildUrl(this.apiBaseUrlTravelInsurance,t),a=this.defaultHeaders.set("searchKey",e),n=this.applyPolicy(this.http.get(s,{headers:a}),{maxRetries:1,retryNetwork:!0,retry5xx:!0,retryTimeout:!1});return f(n)})}handleError(t){let e={status:t.status,url:t.url??"",message:t.message??"",code:t.status===4
110?"GONE_SINGLE":"HTTP_ERROR",raw:t};return u(()=>e)}};r.\u0275fac=function(e){return new(e||r)(o(h),o(p))},r.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var q=(()=>{let r=class r extends B{constructor(t,e){super(t,e),this.injector=t,this.httpClient=e,this.destinations$=new v([]),this.loaded=!1}getAll$(){return this.destinations$.asObservable()}setList(t){this.destinations$.next(t??[]),this.loaded=!0}refreshFromApi(){return this.loaded&&this.destinations$.value.length>0?b(this.destinations$.value):this.load$?this.load$:(this.load$=this.getTravelInsuranceObservable("/api/travel_insurance/v1/destinations").pipe(y(t=>this.mapApiToList(t)),g({count:3,delay:(t,e)=>I(e*1e3)}),T(t=>{this.setList(t)}),x(1),l(t=>(this.load$=null,this.setList([]),u(()=>t)))),this.load$)}findById(t){let e=String(t??"");return e?this.destinations$.value.find(s=>s.id===e)??null:null}resolveById(t){return this.refreshFromApi().pipe(y(()=>this.findById(t)))}mapApiToList(t){return Array.isArray(t)?t.map(e=>({id:String(e?.id??""),name:String(e?.name??"").trim(),category:Number(e?.category??0),order:typeof e?.order=="number"?e.order:null,label:e?.label!=null&&String(e.label).trim()!==""?String(e.label).trim():null})).filter(e=>e.id!==""&&e.name!==""):[]}};r.\u0275fac=function(e){return new(e||r)(o(h),o(p))},r.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();export{B as a,q as b};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.