(()=>{var Ca=Object.create;var rt=Object.defineProperty,Aa=Object.defineProperties,di=Object.getOwnPropertyDescriptor,Oa=Object.getOwnPropertyDescriptors,Ta=Object.getOwnPropertyNames,ui=Object.getOwnPropertySymbols,Pa=Object.getPrototypeOf,pi=Object.prototype.hasOwnProperty,Ea=Object.prototype.propertyIsEnumerable,fi=Math.pow,mi=(t,e,r)=>e in t?rt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,S=(t,e)=>{for(var r in e||(e={}))pi.call(e,r)&&mi(t,r,e[r]);if(ui)for(var r of ui(e))Ea.call(e,r)&&mi(t,r,e[r]);return t},M=(t,e)=>Aa(t,Oa(e)),Ia=t=>rt(t,"__esModule",{value:!0});var gi=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var w=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ra=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ta(e))!pi.call(t,n)&&n!=="default"&&rt(t,n,{get:()=>e[n],enumerable:!(r=di(e,n))||r.enumerable});return t},I=t=>Ra(Ia(rt(t!=null?Ca(Pa(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),A=(t,e,r,n)=>{for(var i=n>1?void 0:n?di(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(i=(n?a(e,r,i):a(i))||i);return n&&i&&rt(e,r,i),i};var u=(t,e,r)=>new Promise((n,i)=>{var s=d=>{try{l(r.next(d))}catch(f){i(f)}},a=d=>{try{l(r.throw(d))}catch(f){i(f)}},l=d=>d.done?n(d.value):Promise.resolve(d.value).then(s,a);l((r=r.apply(t,e)).next())});var R=w(($d,Ut)=>{var yi,hi,bi,vi,xi,Si,wi,ki,Ci,qt,Lr,Ai,Oi,Ti,Ce,Pi,Ei,Ii,Ri,_i,Mi,Hi,Di,Li,jt;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&undefined?define("tslib",["exports"],function(n){t(r(e,r(n)))}):typeof Ut=="object"&&typeof Ut.exports=="object"?t(r(e,r(Ut.exports))):t(r(e));function r(n,i){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(s,a){return n[s]=i?i(s,a):a}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])};yi=function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(n,i);function s(){this.constructor=n}n.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)},hi=Object.assign||function(n){for(var i,s=1,a=arguments.length;s=0;g--)(f=n[g])&&(d=(l<3?f(d):l>3?f(i,s,d):f(i,s))||d);return l>3&&d&&Object.defineProperty(i,s,d),d},xi=function(n,i){return function(s,a){i(s,a,n)}},Si=function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},wi=function(n,i,s,a){function l(d){return d instanceof s?d:new s(function(f){f(d)})}return new(s||(s=Promise))(function(d,f){function g(h){try{v(a.next(h))}catch(oe){f(oe)}}function C(h){try{v(a.throw(h))}catch(oe){f(oe)}}function v(h){h.done?d(h.value):l(h.value).then(g,C)}v((a=a.apply(n,i||[])).next())})},ki=function(n,i){var s={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},a,l,d,f;return f={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function g(v){return function(h){return C([v,h])}}function C(v){if(a)throw new TypeError("Generator is already executing.");for(;s;)try{if(a=1,l&&(d=v[0]&2?l.return:v[0]?l.throw||((d=l.return)&&d.call(l),0):l.next)&&!(d=d.call(l,v[1])).done)return d;switch(l=0,d&&(v=[v[0]&2,d.value]),v[0]){case 0:case 1:d=v;break;case 4:return s.label++,{value:v[1],done:!1};case 5:s.label++,l=v[1],v=[0];continue;case 7:v=s.ops.pop(),s.trys.pop();continue;default:if(d=s.trys,!(d=d.length>0&&d[d.length-1])&&(v[0]===6||v[0]===2)){s=0;continue}if(v[0]===3&&(!d||v[1]>d[0]&&v[1]=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},Lr=function(n,i){var s=typeof Symbol=="function"&&n[Symbol.iterator];if(!s)return n;var a=s.call(n),l,d=[],f;try{for(;(i===void 0||i-- >0)&&!(l=a.next()).done;)d.push(l.value)}catch(g){f={error:g}}finally{try{l&&!l.done&&(s=a.return)&&s.call(a)}finally{if(f)throw f.error}}return d},Ai=function(){for(var n=[],i=0;i1||g(H,ke)})})}function g(H,ke){try{C(a[H](ke))}catch(_r){oe(d[0][3],_r)}}function C(H){H.value instanceof Ce?Promise.resolve(H.value.v).then(v,h):oe(d[0][2],H)}function v(H){g("next",H)}function h(H){g("throw",H)}function oe(H,ke){H(ke),d.shift(),d.length&&g(d[0][0],d[0][1])}},Ei=function(n){var i,s;return i={},a("next"),a("throw",function(l){throw l}),a("return"),i[Symbol.iterator]=function(){return this},i;function a(l,d){i[l]=n[l]?function(f){return(s=!s)?{value:Ce(n[l](f)),done:l==="return"}:d?d(f):f}:d}},Ii=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n[Symbol.asyncIterator],s;return i?i.call(n):(n=typeof qt=="function"?qt(n):n[Symbol.iterator](),s={},a("next"),a("throw"),a("return"),s[Symbol.asyncIterator]=function(){return this},s);function a(d){s[d]=n[d]&&function(f){return new Promise(function(g,C){f=n[d](f),l(g,C,f.done,f.value)})}}function l(d,f,g,C){Promise.resolve(C).then(function(v){d({value:v,done:g})},f)}},Ri=function(n,i){return Object.defineProperty?Object.defineProperty(n,"raw",{value:i}):n.raw=i,n};var r=Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i};_i=function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var s in n)s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)&&jt(i,n,s);return r(i,n),i},Mi=function(n){return n&&n.__esModule?n:{default:n}},Hi=function(n,i,s,a){if(s==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?n!==i||!a:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?a:s==="a"?a.call(n):a?a.value:i.get(n)},Di=function(n,i,s,a,l){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!l)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?n!==i||!l:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?l.call(n,s):l?l.value=s:i.set(n,s),s},Li=function(n,i){if(i===null||typeof i!="object"&&typeof i!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?i===n:n.has(i)},t("__extends",yi),t("__assign",hi),t("__rest",bi),t("__decorate",vi),t("__param",xi),t("__metadata",Si),t("__awaiter",wi),t("__generator",ki),t("__exportStar",Ci),t("__createBinding",jt),t("__values",qt),t("__read",Lr),t("__spread",Ai),t("__spreadArrays",Oi),t("__spreadArray",Ti),t("__await",Ce),t("__asyncGenerator",Pi),t("__asyncDelegator",Ei),t("__asyncValues",Ii),t("__makeTemplateObject",Ri),t("__importStar",_i),t("__importDefault",Mi),t("__classPrivateFieldGet",Hi),t("__classPrivateFieldSet",Di),t("__classPrivateFieldIn",Li)})});var nt=w(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.compose=Ae.CompositeTransducer=void 0;var qr=class{constructor(e,r){this.a=e,this.b=r}async_(e){return this.b.async_(this.a.async_(e))}sync(e){return this.b.sync(this.a.sync(e))}};Ae.CompositeTransducer=qr;function _a(t,e){return new qr(t,e)}Ae.compose=_a});var qi=w(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.decompose=void 0;var Ma=nt();function*jr(t){t instanceof Ma.CompositeTransducer?(yield*jr(t.a),yield*jr(t.b)):yield t}Bt.decompose=jr});var N=w(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.syncReturned=x.asyncReturned=x.isReturned=x.isYielded=x.AsyncIteratorHandler=x.by=x.toAsyncIterable=x.isArrayLike=x.asyncIterable=x.iterable=x.toIterable=x.isPromiseLike=x.isAsyncIterable=x.isIterable=x.value=x.key=x.comparators=x.descending=x.ascending=void 0;var se=R();function Gt(t,e){return te?1:0}x.ascending=Gt;function Ha(t,e){return te?-1:0}x.descending=Ha;function Da(...t){return(e,r)=>{for(let n of t){let i=n(e,r);if(i!=0)return i}return 0}}x.comparators=Da;function La(t){return Object.assign(e=>e[t],{name:t})}x.key=La;function qa(t){return e=>e[t]}x.value=qa;function ja(t){return typeof t=="object"&&Symbol.iterator in t}x.isIterable=ja;function Ua(t){return typeof t=="object"&&Symbol.asyncIterator in t}x.isAsyncIterable=Ua;function Ba(t){return typeof t=="object"&&"then"in t}x.isPromiseLike=Ba;function Ga(...t){return t}x.toIterable=Ga;function*Wa(t){for(let e=0;ee(r[t],n[t])}function $a(t,e=Gt){return(r,n)=>e(t(r),t(n))}var ji=class{constructor(){this.handlers=[],this.state=[]}value(e){this.newState({value:e,done:!1})}error(e){this.newState(e)}close(e){this.newState({value:e,done:!0})}[Symbol.asyncIterator](){return this}next(){return new Promise((e,r)=>{this.newHandler([e,r])})}newState(e){let r=this.handlers.shift();if(typeof r=="undefined")return this.state.push(e);let n=this.state.shift();if(typeof n=="undefined")return this.consume(e,r);this.consume(n,r),this.newState(e)}newHandler(e){let r=this.state.shift();if(typeof r=="undefined")return this.handlers.push(e);let n=this.handlers.shift();if(typeof n=="undefined")return this.consume(r,e);this.consume(r,n),this.newHandler(e)}consume(e,[r,n]){e instanceof Error?n(e):r(e)}};x.AsyncIteratorHandler=ji;function Ja(t){return t&&typeof t=="object"&&"yielded"in t}x.isYielded=Ja;function Ya(t){return t&&typeof t=="object"&&"returned"in t}x.isReturned=Ya;function Za(t){return se.__asyncGenerator(this,arguments,function*(){for(;;){let{value:r,done:n}=yield se.__await(t.next());if(n){yield yield se.__await({returned:r});break}else yield yield se.__await({yielded:r})}})}x.asyncReturned=Za;function*Qa(t){for(;;){let{value:e,done:r}=t.next();if(r){yield{returned:e};break}else yield{yielded:e}}}x.syncReturned=Qa});var Ui=w(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.dedupe=Te.DedupeTransducer=void 0;var Oe=R(),Xa=N(),Ur=class{constructor(e){this.comparator=e}async_(e){return Oe.__asyncGenerator(this,arguments,function*(){var n,i;let s;try{for(var a=Oe.__asyncValues(e),l;l=yield Oe.__await(a.next()),!l.done;){let d=l.value;typeof s=="undefined"?yield yield Oe.__await(d):this.comparator(d,s)!==0&&(yield yield Oe.__await(d)),s=d}}catch(d){n={error:d}}finally{try{l&&!l.done&&(i=a.return)&&(yield Oe.__await(i.call(a)))}finally{if(n)throw n.error}}})}*sync(e){let r;for(let n of e)typeof r=="undefined"?yield n:this.comparator(n,r)!==0&&(yield n),r=n}};Te.DedupeTransducer=Ur;function ec(t=Xa.ascending){return new Ur(t)}Te.dedupe=ec});var Bi=w(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.drop=Pe.DropTransducer=void 0;var it=R(),Br=class{constructor(e){if(this.count=e,typeof e=="undefined")throw new Error("Count can not be undefined")}async_(e){return it.__asyncGenerator(this,arguments,function*(){var n,i;try{for(var s=it.__asyncValues(e),a;a=yield it.__await(s.next()),!a.done;){let l=a.value;--this.count<0&&(yield yield it.__await(l))}}catch(l){n={error:l}}finally{try{a&&!a.done&&(i=s.return)&&(yield it.__await(i.call(s)))}finally{if(n)throw n.error}}})}*sync(e){for(let r of e)--this.count<0&&(yield r)}};Pe.DropTransducer=Br;function tc(t){return new Br(t)}Pe.drop=tc});var Gi=w(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.dropWhile=Ee.DropWhileTransducer=void 0;var ot=R(),Gr=class{constructor(e){this.predicate=e}async_(e){return ot.__asyncGenerator(this,arguments,function*(){var n,i;let s=!0;try{for(var a=ot.__asyncValues(e),l;l=yield ot.__await(a.next()),!l.done;){let d=l.value;s&&(s=this.predicate(d)),s||(yield yield ot.__await(d))}}catch(d){n={error:d}}finally{try{l&&!l.done&&(i=a.return)&&(yield ot.__await(i.call(a)))}finally{if(n)throw n.error}}})}*sync(e){let r=!0;for(let n of e)r&&(r=this.predicate(n)),r||(yield n)}};Ee.DropWhileTransducer=Gr;function rc(t){return new Gr(t)}Ee.dropWhile=rc});var Wt=w(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.accept=ae.filter=ae.FilterTransducer=void 0;var st=R(),Wr=class{constructor(e){this.predicate=e}async_(e){return st.__asyncGenerator(this,arguments,function*(){var n,i;try{for(var s=st.__asyncValues(e),a;a=yield st.__await(s.next()),!a.done;){let l=a.value;this.predicate(l)&&(yield yield st.__await(l))}}catch(l){n={error:l}}finally{try{a&&!a.done&&(i=s.return)&&(yield st.__await(i.call(s)))}finally{if(n)throw n.error}}})}*sync(e){for(let r of e)this.predicate(r)&&(yield r)}};ae.FilterTransducer=Wr;function Wi(t){return new Wr(t)}ae.filter=Wi;ae.accept=Wi});var Kr=w(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.first=Re.FirstTransducer=void 0;var Ie=R(),Fr=class{async_(e){return Ie.__asyncGenerator(this,arguments,function*(){var n,i;try{for(var s=Ie.__asyncValues(e),a;a=yield Ie.__await(s.next()),!a.done;){let l=a.value;return yield Ie.__await(yield yield Ie.__await(l))}}catch(l){n={error:l}}finally{try{a&&!a.done&&(i=s.return)&&(yield Ie.__await(i.call(s)))}finally{if(n)throw n.error}}})}*sync(e){for(let r of e)return yield r}};Re.FirstTransducer=Fr;function nc(){return new Fr}Re.first=nc});var Fi=w(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.find=void 0;var ic=Wt(),oc=Kr(),sc=nt();function ac(t){return(0,sc.compose)((0,ic.filter)(t),(0,oc.first)())}Ft.find=ac});var Ki=w(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.flatMap=_e.FlatMapTransducer=void 0;var me=R(),zr=class{constructor(e){this.mapper=e}async_(e){return me.__asyncGenerator(this,arguments,function*(){var n,i;try{for(var s=me.__asyncValues(e),a;a=yield me.__await(s.next()),!a.done;){let l=a.value;yield me.__await(yield*me.__asyncDelegator(me.__asyncValues(this.mapper(l))))}}catch(l){n={error:l}}finally{try{a&&!a.done&&(i=s.return)&&(yield me.__await(i.call(s)))}finally{if(n)throw n.error}}})}*sync(e){for(let r of e)yield*this.mapper(r)}};_e.FlatMapTransducer=zr;function cc(t){return new zr(t)}_e.flatMap=cc});var Vi=w(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.transducer=ce.identity=ce.IdentityTransducer=void 0;var Vr=class{async_(e){return e}sync(e){return e}};ce.IdentityTransducer=Vr;function zi(){return new Vr}ce.identity=zi;ce.transducer=zi});var $r=w(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.last=Me.LastTransducer=void 0;var at=R(),Nr=class{async_(e){return at.__asyncGenerator(this,arguments,function*(){var n,i;let s;try{for(var a=at.__asyncValues(e),l;l=yield at.__await(a.next()),!l.done;)s=l.value}catch(d){n={error:d}}finally{try{l&&!l.done&&(i=a.return)&&(yield at.__await(i.call(a)))}finally{if(n)throw n.error}}s!==void 0&&(yield yield at.__await(s))})}*sync(e){let r;for(r of e);r!==void 0&&(yield r)}};Me.LastTransducer=Nr;function lc(){return new Nr}Me.last=lc});var Ni=w(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.map=He.MapTransducer=void 0;var ct=R(),Jr=class{constructor(e){this.mapper=e}async_(e){return ct.__asyncGenerator(this,arguments,function*(){var n,i;try{for(var s=ct.__asyncValues(e),a;a=yield ct.__await(s.next()),!a.done;){let l=a.value;yield yield ct.__await(this.mapper(l))}}catch(l){n={error:l}}finally{try{a&&!a.done&&(i=s.return)&&(yield ct.__await(i.call(s)))}finally{if(n)throw n.error}}})}*sync(e){for(let r of e)yield this.mapper(r)}};He.MapTransducer=Jr;function dc(t){return new Jr(t)}He.map=dc});var Zr=w(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.scan=Le.ScanTransducer=void 0;var De=R(),Yr=class{constructor(e,r){this.reducer=e,this.seed=r}async_(e){return De.__asyncGenerator(this,arguments,function*(){var n,i;let s=this.seed;yield yield De.__await(s);try{for(var a=De.__asyncValues(e),l;l=yield De.__await(a.next()),!l.done;){let d=l.value;yield yield De.__await(s=this.reducer(s,d))}}catch(d){n={error:d}}finally{try{l&&!l.done&&(i=a.return)&&(yield De.__await(i.call(a)))}finally{if(n)throw n.error}}})}*sync(e){let r=this.seed;yield r;for(let n of e)yield r=this.reducer(r,n)}};Le.ScanTransducer=Yr;function uc(t,e){return new Yr(t,e)}Le.scan=uc});var $i=w(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.reduce=void 0;var pc=nt(),fc=$r(),mc=Zr();function gc(t,e){return(0,pc.compose)((0,mc.scan)(t,e),(0,fc.last)())}Kt.reduce=gc});var Ji=w(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.reject=void 0;var yc=Wt();function hc(t){return new yc.FilterTransducer(e=>!t(e))}zt.reject=hc});var Yi=w(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.sum=Y.subtract=Y.add=Y.increment=void 0;function bc(t){return t+1}Y.increment=bc;function vc(t,e){return e===void 0?r=>t+r:t+e}Y.add=vc;function xc(t,e){return e===void 0?r=>r-t:t-e}Y.subtract=xc;var Sc=(t,e)=>t+e;Y.sum=Sc});var $t=w(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.AsyncSequence=G.Sequence=G.sequence=G.range=G.repeat=G.iterate=void 0;var Qr=Yi(),Xr=N(),Zi=lt();function*Vt(t,e){for(;;)yield e,e=t(e)}G.iterate=Vt;function*wc(t){for(;;)yield t()}G.repeat=wc;function*kc(t,e,r=1){if(r===0)throw new Error("step can not be 0");if(e===void 0)yield*Vt((0,Qr.add)(r),t);else{let n=Math.abs(r);ei>=e)):yield*en(Vt((0,Qr.add)(n),t),(0,Zi.takeWhile)(i=>i<=e))}}G.range=kc;function en(t,...e){return(0,Xr.isIterable)(t)?new Nt(t,e):(0,Xr.isArrayLike)(t)?new Nt((0,Xr.iterable)(t),e):new tn(t,e)}G.sequence=en;var Nt=class{constructor(e,r){this.source=e,this.transducers=r}[Symbol.iterator](){return this.transducers.reduce((e,r)=>r.sync(e),this.source)[Symbol.iterator]()}};G.Sequence=Nt;var tn=class{constructor(e,r){this.source=e,this.transducers=r}[Symbol.asyncIterator](){return this.transducers.reduce((e,r)=>r.async_(e),this.source)[Symbol.asyncIterator]()}};G.AsyncSequence=tn});var eo=w(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.single=void 0;var Qi=R(),Cc=N(),Xi=$t();function Ac(t,...e){return(0,Cc.isIterable)(t)?Oc((0,Xi.sequence)(t,...e)):Tc((0,Xi.sequence)(t,...e))}Jt.single=Ac;function Oc(t){for(let e of t)return e;throw new Error("Expected a single value")}function Tc(t){var e,r,n,i;return Qi.__awaiter(this,void 0,void 0,function*(){try{for(e=Qi.__asyncValues(t);r=yield e.next(),!r.done;)return r.value}catch(s){n={error:s}}finally{try{r&&!r.done&&(i=e.return)&&(yield i.call(e))}finally{if(n)throw n.error}}throw new Error("Expected a single value")})}});var rn=w(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.array=void 0;var to=R(),ro=N(),no=$t();function Pc(t,...e){return(0,ro.isIterable)(t)||(0,ro.isArrayLike)(t)?Ec((0,no.sequence)(t,...e)):Ic((0,no.sequence)(t,...e))}Yt.array=Pc;function Ec(t){let e=[];for(let r of t)e.push(r);return e}function Ic(t){var e,r,n,i;return to.__awaiter(this,void 0,void 0,function*(){let s=[];try{for(e=to.__asyncValues(t);r=yield e.next(),!r.done;){let a=r.value;s.push(a)}}catch(a){n={error:a}}finally{try{r&&!r.done&&(i=e.return)&&(yield i.call(e))}finally{if(n)throw n.error}}return s})}});var oo=w(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.sort=qe.SortTransducer=void 0;var dt=R(),Rc=N(),io=rn(),nn=class{constructor(e){this.comparator=e}async_(e){return dt.__asyncGenerator(this,arguments,function*(){let n=yield dt.__await((0,io.array)(e));n.sort(this.comparator),yield dt.__await(yield*dt.__asyncDelegator(dt.__asyncValues(n)))})}*sync(e){let r=(0,io.array)(e);r.sort(this.comparator),yield*r}};qe.SortTransducer=nn;function _c(t=Rc.ascending){return new nn(t)}qe.sort=_c});var so=w(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.take=je.TakeTransducer=void 0;var ge=R(),on=class{constructor(e){if(this.count=e,typeof e=="undefined")throw new Error("Count can not be undefined")}async_(e){return ge.__asyncGenerator(this,arguments,function*(){var n,i;if(this.count<1)return yield ge.__await(void 0);try{for(var s=ge.__asyncValues(e),a;a=yield ge.__await(s.next()),!a.done;){let l=a.value;if(yield yield ge.__await(l),--this.count<1)return yield ge.__await(void 0)}}catch(l){n={error:l}}finally{try{a&&!a.done&&(i=s.return)&&(yield ge.__await(i.call(s)))}finally{if(n)throw n.error}}})}*sync(e){if(!(this.count<1)){for(let r of e)if(yield r,--this.count<1)return}}};je.TakeTransducer=on;function Mc(t){return new on(t)}je.take=Mc});var ao=w(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.takeWhile=Be.TakeWhileTransducer=void 0;var Ue=R(),sn=class{constructor(e){this.predicate=e}async_(e){return Ue.__asyncGenerator(this,arguments,function*(){var n,i;try{for(var s=Ue.__asyncValues(e),a;a=yield Ue.__await(s.next()),!a.done;){let l=a.value;if(this.predicate(l))yield yield Ue.__await(l);else return yield Ue.__await(void 0)}}catch(l){n={error:l}}finally{try{a&&!a.done&&(i=s.return)&&(yield Ue.__await(i.call(s)))}finally{if(n)throw n.error}}})}*sync(e){for(let r of e)if(this.predicate(r))yield r;else return}};Be.TakeWhileTransducer=sn;function Hc(t){return new sn(t)}Be.takeWhile=Hc});var lo=w(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0})});var Ge=w(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.container=le.lazy=le.replace=void 0;function uo(t,e,r){return Object.defineProperty(t,e,{value:r})}le.replace=uo;function po(t,e,r){if(typeof r.get=="undefined")throw new Error("@lazy can only decorate getter methods");return Object.defineProperty(t,e,Object.assign(Object.assign({},r),{get(){return uo(this,e,r.get.call(this))[e]}}))}le.lazy=po;function Dc(t){return Object.keys(t).reduce((e,r)=>po(e,r,{configurable:!0,get:()=>t[r](e)}),{})}le.container=Dc});var xo=w(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.AVLTree=void 0;var fo=R(),Zt=N(),mo=Ge(),Z=class{constructor(e){this.comparator=e}static empty(e=Zt.ascending){return new go(e)}static create(e,r,n=Zt.ascending){let i=Z.empty(n);return new K(n,e,r,i,i)}static of(e,r=Zt.ascending){return Z.preSorted(e.sort((0,Zt.by)(0)),r,Z.empty(r))}static preSorted(e,r,n){let i=e.length;switch(i){case 0:return n;case 1:{let[[s,a]]=e;return new K(r,s,a,n,n)}default:{let s=Math.floor(i/2),a=Z.preSorted(e.slice(0,s),r,n),l=Z.preSorted(e.slice(s+1),r,n),[d,f]=e[s];return new K(r,d,f,a,l)}}}};Qt.AVLTree=Z;var go=class extends Z{constructor(e){super(e);this.isEmpty=!0,this.height=0,this.balance=0}insert(e,r){return new K(this.comparator,e,r,this,this)}contains(e){return!1}lookup(e){}delete(e){return{tree:this}}first(){}last(){}removeFirst(){return{tree:this}}removeLast(){return{tree:this}}toString(){return""}*keys(){}*values(){}*entries(){return[]}},K=class extends Z{constructor(e,r,n,i,s){super(e);this.key=r,this.value=n,this.left=i,this.right=s,this.isEmpty=!1}insert(e,r){let n=this.comparator(e,this.key);return n===0?new K(this.comparator,e,r,this.left,this.right):n<0?this.replaceLeft(this.left.insert(e,r)):this.replaceRight(this.right.insert(e,r))}contains(e){let r=this.comparator(e,this.key);return r===0?!0:r<0?this.left.contains(e):this.right.contains(e)}lookup(e){let r=this.comparator(e,this.key);return r===0?this.value:r<0?this.left.lookup(e):this.right.lookup(e)}delete(e){let r=this.comparator(e,this.key);if(r===0){if(this.left.isEmpty)return{tree:this.right,key:this.key,value:this.value};if(this.right.isEmpty)return{tree:this.left,key:this.key,value:this.value};let{tree:a,key:l,value:d}=this.left.removeLast();return{tree:an(new K(this.comparator,l,d,a,this.right)),key:this.key,value:this.value}}if(r<0){let{tree:a,key:l,value:d}=this.left.delete(e);return{tree:this.replaceLeft(a),key:l,value:d}}let{tree:n,key:i,value:s}=this.right.delete(e);return{tree:this.replaceRight(n),key:i,value:s}}first(){return this.left.isEmpty?this.value:this.left.first()}last(){return this.right.isEmpty?this.value:this.right.last()}removeFirst(){if(this.left.isEmpty)return{tree:this.right,key:this.key,value:this.value};let{tree:e,key:r,value:n}=this.left.removeFirst();return{tree:this.replaceLeft(e),key:r,value:n}}removeLast(){if(this.right.isEmpty)return{tree:this.left,key:this.key,value:this.value};let{tree:e,key:r,value:n}=this.right.removeLast();return{tree:this.replaceRight(e),key:r,value:n}}replaceLeft(e){return an(new K(this.comparator,this.key,this.value,e,this.right))}replaceRight(e){return an(new K(this.comparator,this.key,this.value,this.left,e))}toString(){return`(${this.left} ${this.key}=${this.value} ${this.right})`}get balance(){return this.left.height-this.right.height}get height(){return Math.max(this.left.height,this.right.height)+1}*keys(){yield*this.left.keys(),yield this.key,yield*this.right.keys()}*values(){yield*this.left.values(),yield this.value,yield*this.right.values()}*entries(){yield*this.left.entries(),yield[this.key,this.value],yield*this.right.entries()}};fo.__decorate([mo.lazy],K.prototype,"balance",null);fo.__decorate([mo.lazy],K.prototype,"height",null);function an(t){let e=t.balance;return e==-2?qc(t):e==2?Lc(t):t}function Lc(t){let e=t.left.balance;return e==-1?jc(t):e==1?yo(t):t}function qc(t){let e=t.right.balance;return e==1?Uc(t):e==-1?ho(t):t}function yo(t){return vo(t)}function jc(t){let e=bo(t.left);return yo(t.replaceLeft(e))}function ho(t){return bo(t)}function Uc(t){let e=vo(t.right);return ho(t.replaceRight(e))}function bo(t){let e=t.right,r=e.left,n=t.replaceRight(r);return e.replaceLeft(n)}function vo(t){let e=t.left,r=e.right,n=t.replaceLeft(r);return e.replaceRight(n)}});var wo=w(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.unique=We.UniqueTransducer=void 0;var ut=R(),Bc=N(),So=xo(),cn=class{constructor(e){this.comparator=e}async_(e){return ut.__asyncGenerator(this,arguments,function*(){var n,i;let s=So.AVLTree.empty(this.comparator);try{for(var a=ut.__asyncValues(e),l;l=yield ut.__await(a.next()),!l.done;){let d=l.value;s.contains(d)||(s=s.insert(d,void 0),yield yield ut.__await(d))}}catch(d){n={error:d}}finally{try{l&&!l.done&&(i=a.return)&&(yield ut.__await(i.call(a)))}finally{if(n)throw n.error}}})}*sync(e){let r=So.AVLTree.empty(this.comparator);for(let n of e)r.contains(n)||(r=r.insert(n,void 0),yield n)}};We.UniqueTransducer=cn;function Gc(t=Bc.ascending){return new cn(t)}We.unique=Gc});var ko=w(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.WindowedTransducer=Ke.windowed=void 0;var Fe=R();function Wc(t,e=1,r=!1){return new ln(t,e,r)}Ke.windowed=Wc;var ln=class{constructor(e,r,n){this.size=e,this.step=r,this.remainder=n}async_(e){return Fe.__asyncGenerator(this,arguments,function*(){var n,i;let s=[],a=0;try{for(var l=Fe.__asyncValues(e),d;d=yield Fe.__await(l.next()),!d.done;){let f=d.value;if(a>0){a--;continue}s.push(f),s.length===this.size&&(yield yield Fe.__await([...s]),s=s.slice(this.step),this.step>this.size&&(a=this.step-this.size))}}catch(f){n={error:f}}finally{try{d&&!d.done&&(i=l.return)&&(yield Fe.__await(i.call(l)))}finally{if(n)throw n.error}}this.remainder&&(yield yield Fe.__await([...s]))})}*sync(e){let r=[],n=0;for(let i of e){if(n>0){n--;continue}r.push(i),r.length===this.size&&(yield[...r],r=r.slice(this.step),this.step>this.size&&(n=this.step-this.size))}this.remainder&&(yield[...r])}};Ke.WindowedTransducer=ln});var Ao=w(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.zipWithIndex=de.zip=de.ZipTransducer=void 0;var Xt=R(),Co=N(),Fc=$t(),er=class{constructor(e){this.other=e}async_(e){return Xt.__asyncGenerator(this,arguments,function*(){if(!(0,Co.isAsyncIterable)(this.other))throw new Error("Unsupported operation exception");let n=e[Symbol.asyncIterator](),i=this.other[Symbol.asyncIterator]();for(;;){let[s,a]=yield Xt.__await(Promise.all([n.next(),i.next()]));if(s.done||a.done)return yield Xt.__await(void 0);yield yield Xt.__await([s.value,a.value])}})}*sync(e){if(!(0,Co.isIterable)(this.other))throw new Error("Unsupported operation exception");let r=e[Symbol.iterator](),n=this.other[Symbol.iterator]();for(;;){let i=r.next(),s=n.next();if(i.done||s.done)return;yield[i.value,s.value]}}};de.ZipTransducer=er;function Kc(t){return new er(t)}de.zip=Kc;function zc(){return new er((0,Fc.range)(0))}de.zipWithIndex=zc});var lt=w(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});var E=R();E.__exportStar(nt(),O);E.__exportStar(qi(),O);E.__exportStar(Ui(),O);E.__exportStar(Bi(),O);E.__exportStar(Gi(),O);E.__exportStar(Wt(),O);E.__exportStar(Fi(),O);E.__exportStar(Kr(),O);E.__exportStar(Ki(),O);E.__exportStar(Vi(),O);E.__exportStar($r(),O);E.__exportStar(Ni(),O);E.__exportStar($i(),O);E.__exportStar(Ji(),O);E.__exportStar(Zr(),O);E.__exportStar(eo(),O);E.__exportStar(oo(),O);E.__exportStar(so(),O);E.__exportStar(ao(),O);E.__exportStar(lo(),O);E.__exportStar(wo(),O);E.__exportStar(ko(),O);E.__exportStar(Ao(),O)});var ye=w(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.caching=Ve.cache=void 0;function Jc(t,e,r){if(typeof r.value!="function")throw new Error("@cache can only decorate methods");let n=new WeakMap;function i(s){let a=n.get(s);if(a)return a;let l=new Map;return n.set(s,l),l}return Object.defineProperty(t,e,Object.assign(Object.assign({},r),{value:function(...s){let a=JSON.stringify(s),l=i(this),d=l.get(a);if(typeof d!="undefined"||l.has(a))return d;let f=r.value.call(this,...s);return l.set(a,f),f}}))}Ve.cache=Jc;function Yc(t){let e=new Map;return function(...r){let n=JSON.stringify(r),i=e.get(n);if(typeof i!="undefined"||e.has(n))return i;let s=t(...r);return e.set(n,s),s}}Ve.caching=Yc});var kr=w(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.StoppedClock=Ye.SystemClock=void 0;var Xs=class{now(){return new Date}};Ye.SystemClock=Xs;var ea=class{constructor(e){this.value=e}now(){return this.value}};Ye.StoppedClock=ea});var si=w(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.get=et.identity=void 0;function Dd(){return t=>t}et.identity=Dd;function Ld(t,e=void 0){try{let r=t();return typeof r=="undefined"?e:r}catch(r){return e}}et.get=Ld});var Hr=class{constructor(e){let r=Hr.RFC_3986.exec(e);if(!r)throw new Error(`Invalid Uri: ${e}`);let[,,n,,i,s,,a,,l]=r;this.scheme=n,this.authority=i?new Mr(i):void 0,this.path=s,this.query=a,this.fragment=l}toString(){let e=[];return typeof this.scheme!="undefined"&&e.push(this.scheme,":"),typeof this.authority!="undefined"&&e.push("//",this.authority.toString()),e.push(this.path),typeof this.query!="undefined"&&e.push("?",this.query),typeof this.fragment!="undefined"&&e.push("#",this.fragment),e.join("")}get host(){return this.authority&&this.authority.host}get port(){return this.authority&&this.authority.port}get userInfo(){return this.authority&&this.authority.userInfo}},P=Hr;P.RFC_3986=/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;var Dr=class{constructor(e){let r=Dr.RFC_3986.exec(e);if(!r)throw new Error(`Invalid Authority: ${e}`);let[,n,i,s]=r;this.userInfo=n,this.host=i,this.port=s}toString(){let e=[];return typeof this.userInfo!="undefined"&&e.push(this.userInfo,"@"),typeof this.host!="undefined"&&e.push(this.host),typeof this.port!="undefined"&&e.push(":",this.port),e.join("")}},Mr=Dr;Mr.RFC_3986=/(?:([^@]+)@)?([^:]+)(?::([\d]+))?/;var Oo=I(lt()),To=I(N()),Vc=I(lt());function Nc(t){switch(typeof t){case"undefined":return!0;case"string":return t.trim()==="";case"number":return isNaN(t);case"object":{if(t==null)return!0;if(m.isObject(t))return Object.keys(t).length===0;if(Array.isArray(t))return t.length===0}}return!1}var dn=class{static parse(e){if(typeof e!="number"&&Q.isEmpty(e))return;let r=Number(e);if(!isNaN(r))return r}static isNumber(e){return typeof e=="number"&&!isNaN(e)}};var ze=class{static noWhitespace(e){return e&&typeof e=="string"?e.replace(/\s+/g,""):""}static startWith(e,r){return e?e.substring(0,r.length)===r:e===r}static endsWith(e,r){return e.substring(e.length-r.length,e.length)===r}static isEmpty(e){return e===void 0||e===null?!0:e.trim().length===0}static isEmail(e){return typeof e=="string"&&this.validEmailPattern.test(e)}static isLowerCase(e){return e===e.toLowerCase()&&e!==e.toUpperCase()}static isUpperCase(e){return e===e.toUpperCase()&&e!==e.toLowerCase()}static kebabCase(e){return ze.delimiterCase(e,"-")}static snakeCase(e){return ze.delimiterCase(e,"_")}static delimiterCase(e,r){return e.replace(/([A-Z][a-z]+|\d+)/gm,`${r}$1`).replace(new RegExp(`^${r}`),"").toLowerCase()}static titleCase(e){return ze.isEmpty(e)?"":e.replace(/\w\S*/g,r=>r.charAt(0).toUpperCase()+r.substr(1).toLowerCase())}static camelCase(e){return ze.isEmpty(e)?"":e.replace(/([A-Za-z]+|\d+)/gm,r=>r.charAt(0).toUpperCase()+r.substr(1).toLowerCase()).replace(new RegExp("^."),r=>r.toLowerCase()).replace(new RegExp(/[_\-\s]/g),"")}},Q=ze;Q.validEmailPattern=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/;function pt(t,e,r){if(e(t))return r(t);switch(typeof t){case"undefined":return;case"object":{if(t===null)return null;if(Array.isArray(t))return t.map(n=>pt(n,e,r));if(m.isObject(t))return m.keys(t).sort().reduce((n,i)=>{let s=t[i];return n[i]=pt(s,e,r),n},{})}}return t}function tr(t,e){switch(typeof t){case"undefined":return;case"object":{if(t===null)return null;if(Array.isArray(t))return t.map(r=>tr(r,e));if(m.isObject(t))return m.keys(t).sort().reduce((r,n)=>{let i=t[n];return r[e(String(n))]=tr(i,e),r},{})}}return t}var m=class{static isObject(e){return e&&typeof e=="object"&&(e.constructor===Object||/Object.*native/.test(e.constructor.toString()))}static keys(e){return Object.keys(e)}static values(e){return Object.keys(e).map(r=>e[r])}static entries(e){return Object.keys(e).map(r=>[r,e[r]])}static removeEmpty(e){return e&&(m.isObject(e)?Object.keys(e).reduce((r,n)=>{let i=m.removeEmpty(e[n]);return Nc(i)||(r[n]=i),r},{}):e)}static sort(e){return e&&(Array.isArray(e)?e.map(m.sort):m.isObject(e)?Object.keys(e).sort().reduce((r,n)=>{let i=e[n];return r[n]=m.sort(i),r},{}):e)}static toLowerCase(e){return typeof e=="string"?e.toLowerCase():Array.isArray(e)?e.map(m.toLowerCase):p(()=>m.isObject(e))?Object.entries(e).reduce((r,[n,i])=>(r[n]=m.toLowerCase(i),r),{}):e}static snakeCase(e){return tr(e,Q.snakeCase)}static camelCase(e){return tr(e,Q.camelCase)}static filter(e,r){let n=m.keys(e).filter(r);return m.pick(e,...n)}static omit(e,...r){return r.reduce((n,i)=>(Reflect.deleteProperty(n,i),n),e)}static pick(e,...r){return r.reduce((n,i)=>(n[i]=e[i],n),{})}};var k=class{static from(e){return Array.from(e)}static find(e,r){if(e.find)return e.find(r);let[n]=e.filter(r);return n}static findLastIndex(e,r){let n=[...e].reverse().findIndex(r);return n===-1?n:e.length-n-1}static toObject(e){return e.reduce((r,n)=>(Object.keys(n).forEach(i=>{i in r||(r[i]=n[i])}),r),{})}static flatten(e){return e.reduce((r,n)=>r.concat(n),[])}static flatMap(e,r){return e.flatMap?e.flatMap(r):k.flatten(e.map(r))}static unique(e){return Array.from(new Set(e))}static clean(e){return e.filter(Boolean)}static trim(e){return e.map(r=>r.trim())}static includes(e,r){return"includes"in e?e.includes(r):e.indexOf(r)!==-1}static first(e){return e[0]}static last(e){return e[e.length-1]}static safeReverse(e){return e?e.slice().reverse():[]}static shuffle(e){return e.map(r=>({value:r,order:Math.random()})).sort((0,To.by)("order")).map(({value:r})=>r)}};function p(t,e=void 0){try{let r=t();return typeof r=="undefined"?e:r}catch(r){return e}}function X(t,e=void 0){return u(this,null,function*(){try{let r=yield t();return typeof r=="undefined"?e:r}catch(r){return e}})}function $c(t,e){let r=e.toLowerCase(),n=k.find(Object.keys(t),s=>s.toLowerCase()===r);if(!n)return;let i=t[n];return typeof i=="string"?i.trim():i}function rr(t,...e){if(!t)return[];if(Array.isArray(t))return k.clean(k.flatten(t.map(r=>rr(r,...e))));if(typeof t=="object"){let[r,...n]=e,i=$c(t,r);return typeof i=="object"?rr(i,...n):n.length===0&&Boolean(i)?[i]:[]}return[]}var D=(()=>typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof module!="undefined"?module:Function("return this")())();function Po(t,e,r){let n=t[e];return typeof n=="undefined"?t[e]=r:Array.isArray(n)?n.indexOf(r)==-1&&n.push(r):t[e]=[n,r],t}function Eo(t,e,r,n=i=>i){let i=[],s=0,a;for(;(a=t.exec(e))!=null;)i.push(n(e.substring(s,a.index))),i.push(r(a)),s=t.lastIndex;return i.push(n(e.substring(s))),i.join("")}function Io(t,e){return t.slice(0,e)}var Ro=I(ye()),_o=I(Ge());function T(t=D){return t.triptease=t.triptease||{},t.triptease.onboard=t.triptease.onboard||{},{triptease:t.triptease,onboard:t.triptease.onboard}}var he;(function(n){n.Native="native",n.NonNative="non-native",n.NotImplemented="not-implemented"})(he||(he={}));function un(t,e){return p(()=>e.split(".").reduce((r,n)=>r[n],t))}function Mo(t){return t==null?he.NotImplemented:typeof t=="function"?t.toString().includes("native code")?he.Native:he.NonNative:he.Native}function Ho(t,...e){return e.reduce((r,n)=>(r[n]=Mo(un(t,n)),r),{})}var nr=class{static exposeApi(){let e=T(D).triptease;e.native||(e.native=nr)}static getProperty(e){let r=un(D,e);return Mo(r)!==he.NonNative?r:un(nr.window,e)}static get window(){let e=D;if(!e.document)return e;try{let r=e.document,n=r.querySelector("[name='triptease.native']");if(n)return n.contentWindow;let i=r.createElement("iframe");return i.style.display="none",i.setAttribute("title","blank"),i.setAttribute("aria-hidden","true"),i.setAttribute("name","triptease.native"),r.documentElement.appendChild(i),i.contentWindow}catch(r){return e}}},L=nr;A([Ro.cache],L,"getProperty",1),A([_o.lazy],L,"window",1);var Zc=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}\.\d{3}Z)?$/;function Qc(t){return pt(t,e=>typeof e=="string"&&Zc.test(e),e=>{let r=new Date(e);return isNaN(r.valueOf())?e:r})}var Xc=L.getProperty("JSON.parse"),Do=L.getProperty("JSON.stringify"),el=L.getProperty("Date.prototype.toISOString"),tl=L.getProperty("atob"),rl=L.getProperty("btoa"),q=class{static parse(e){return Xc(e)}static parseWithDates(e){return Qc(q.parse(e))}static stringify(e){return Do(this.clean(e))}static clean(e){return pt(e,r=>{let n=typeof r;switch(n){case"undefined":case"string":case"number":case"boolean":return!0;case"object":{if(r===null)return!0;if(Array.isArray(r)||m.isObject(r))return!1;if("toJSON"in r)return!0}}throw new Error(`Illegal JsonValue: ${n} ${r} `)},r=>r instanceof Date?el.call(r):r)}static atob(e){try{let r=tl(e);return q.parseWithDates(r)}catch(r){}}static btoa(e){try{if(!m.isObject(e))return;let r=Do(e);return rl(r)}catch(r){}}},_=class{static same(e,r){return q.stringify(e)===q.stringify(r)}static isSuperset(e,r){return e===null||r===null?_.same(e,r):Array.isArray(e)&&Array.isArray(r)?e.length>r.length?!1:e.every(n=>r.some(i=>_.isSuperset(n,i))):p(()=>m.isObject(e))&&p(()=>m.isObject(r))?Object.keys(e).reduce((n,i)=>n&&_.isSuperset(e[i],r[i]),!0):_.same(e,r)}static compress(e){let r=_.groupValues(e);return this.compressGrouped(r)}static compressGrouped(e){return Object.entries(e).reduce(({shared:r,unique:n},[i,s])=>{if(p(()=>m.isObject(s))){let a=_.compressGrouped(s);Object.keys(a.shared).length>0&&(r[i]=a.shared),a.unique.forEach((l,d)=>{n[d]=n[d]||{},Object.keys(l).length>0&&(n[d][i]=l)})}return Array.isArray(s)&&s.forEach((a,l)=>{n[l]=n[l]||{},k.unique(s.map(d=>q.stringify(d))).length===1?r[i]=a:a!==void 0&&(n[l][i]=a)}),{shared:r,unique:n}},{shared:{},unique:[]})}static groupValues(e){let r=Array.from(e.reduce((a,l)=>Object.keys(l).reduce((d,f)=>d.add(f),a),new Set)),[n,i]=e.reduce((a,l)=>r.reduce(([d,f],g)=>{let C=l[g];return p(()=>m.isObject(C))?(f[g]=f[g]||[],f[g].push(C)):(d[g]=d[g]||[],d[g].push(C)),[d,f]},a),[{},{}]),s=Object.entries(i).reduce((a,[l,d])=>(a[l]=_.groupValues(d),a),{});return S(S({},n),s)}static decompress(e){return e.unique.map(r=>this.merge(e.shared,r))}static merge(e,r){return[...Object.keys(e),...Object.keys(r)].reduce((i,s)=>{let a=e[s],l=r[s];return p(()=>m.isObject(a))&&p(()=>m.isObject(l))?i[s]=_.merge(a,l):i[s]=l!=null?l:a,i},{})}};function B(t,e=!0){return t?(t.indexOf("?")==0&&(t=t.substring(1,t.length)),t.split("&").map(function(r){return r.split("=")}).reduce(function(r,n){let i=n[0],s=n[1];if(!i)return r;let a=Lo(s),l=e?nl(a):a;return Po(r,Lo(i),l)},{})):{}}function Lo(t){return p(()=>decodeURIComponent(t.replace(/\+/g,"%20")),t)}function nl(t){try{return q.parse(t)}catch(e){return t}}function il(t){return typeof t=="string"?t:JSON.stringify(t)}function qo(t,e=!0){return Object.keys(m.removeEmpty(t)).map(r=>{let n=t[r],i=e?il(n):n;return`${r}=${encodeURIComponent(i)}`}).join("&")}var jo=L.getProperty("console.log"),ol=L.getProperty("console.error"),sl=L.getProperty("console.debug"),Uo=class{constructor(e=jo,r=ol,n=sl||jo){this.log=e;this.error=r;this.debug=n}},Bo=class{constructor(){this.log=()=>{};this.error=()=>{};this.debug=()=>{}}},ir="triptease-debug",al=256;function or(t,e=ir){let r=p(()=>{var n;return B((n=t.location)==null?void 0:n.search,!1)[e]})||p(()=>{var n;return B(new P((n=t.location)==null?void 0:n.originalHref).query,!1)[e]})||p(()=>{var n,i;return(i=(n=t.process)==null?void 0:n.env)==null?void 0:i.DEBUG})||p(()=>{var n;return((n=t.localStorage)==null?void 0:n.getItem)&&t.localStorage.getItem(e)})||p(()=>{var n;return((n=t.sessionStorage)==null?void 0:n.getItem)&&t.sessionStorage.getItem(e)})||"";return p(()=>r.substring(0,al),"")}function Go(t=D){let e=or(t,ir);return Q.isEmpty(e)?"":qo({[ir]:e})}function cl(t){return or(t,ir).split(",").map(e=>e.trim())}function Wo(t){let e=t.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp("^"+e+"$")}function ll(t,e=D){try{let r=cl(e),n=r.filter(i=>i[0]==="!").map(i=>i.substr(1));return n.length>0?!n.some(i=>Wo(i).test(t)):r.some(i=>i==="true"||Wo(i).test(t))}catch(r){return!1}}var be;(function(n){n[n.DEBUG=0]="DEBUG",n[n.INFO=1]="INFO",n[n.ERROR=2]="ERROR"})(be||(be={}));var Fo=class{constructor(e,r,n=new Uo){this.name=e;this.logLevel=r;this.console=n}debug(e,...r){this.logLevel.valueOf()>0||this.console.debug(`[${this.name}] ${e}`,...r)}log(e,...r){this.logLevel.valueOf()>1||this.console.log(`[${this.name}] ${e}`,...r)}error(e,...r){this.logLevel.valueOf()>2||this.console.error(`[${this.name}] ${e}`,...r)}};function y(t,e=D){let r=p(()=>{var n,i,s;return be[((s=(i=(n=e.process)==null?void 0:n.env)==null?void 0:i.LOG_LEVEL)==null?void 0:s.toUpperCase())||"DEBUG"]},0);return ll(t,e)?new Fo(t,r):new Bo}function dl(t){try{let{target:e,method:r}=fn(t.type);if(e&&r)return!0}catch(e){}return!1}var pn=class{constructor(e,r){this.name=e;this.trackingApi=r;this.logger=y(e)}debug(e,...r){this.logger.debug(e,...r)}error(e,...r){this.logger.error(e,...r);try{this.trackingApi.trackError({name:this.name,message:e,args:r.map(n=>ft(n)?ml(n):n)})}catch(n){this.logger.error("Failed to track error",n)}}log(e,...r){this.logger.log(e,...r)}};var $=class{constructor(e,r,n=ul,i=y("messaging")){this.listener=e;this.allowedOrigins=n;this.logger=i;this.target=this.listener!==r?r:void 0}addListener(e){this.listener&&this.listener.addEventListener("message",r=>{this.disallowedOrigin(r)||!dl(r.data)||e(r.data,new $(void 0,r.source||this.target))})}disallowedOrigin(e){return e.origin&&this.allowedOrigins.length>0&&this.allowedOrigins.indexOf(new P(e.origin).host)===-1}send(e){if(this.target)try{this.target.postMessage(e,"*")}catch(r){this.target.postMessage(JSON.parse(JSON.stringify(e)),"*")}}},ul=["onboard.triptease.io","localhost"],pl=/^(.*)\.([^.]+)$/;function fn(t){let[,e,r]=t.match(pl)||[];return{target:e,method:r}}function sr(t){let e={};return function(...r){let n=JSON.stringify(r),i=e[n];return typeof i!="undefined"?i:e[n]=t(...r)}}function fl(t){return t.document.querySelector('iframe[name="triptease.onboard.kernel"]')}function Ko(t){let e=fl(t);if(e&&e.contentWindow)return new $(t,e.contentWindow)}function ft(t){return t&&typeof t=="object"&&"name"in t&&typeof t.name=="string"&&"message"in t&&typeof t.message=="string"&&"stack"in t&&typeof t.stack=="string"}function ml(t){return{name:t.name,message:t.message,stack:t.stack}}function mn(t,e,r){return{name:t,message:e,stack:r!=null?r:""}}var Zu=new Set(["Unknown","PossibleIdentifier"]),Qu=new Set(["HotelName","HotelCode","ChainCode"]);var ee={cookieBot:"cookieBot",klaro:"klaro",google:"google",defaultNoConsentMode:"defaultNoConsentMode",defaultAutoConsentMode:"defaultAutoConsentMode"};var F;(function(f){f.Search="Search",f.RoomsAndRates="RoomsAndRates",f.Confirmation="Confirmation",f.Checkout="Checkout",f.Payment="Payment",f.Group="Group",f.Advert="Advert",f.Partial="Partial",f.Unknown="Unknown"})(F||(F={}));var Xu=[F.Payment,F.Confirmation,F.RoomsAndRates,F.Checkout,F.Search,F.Partial,F.Group,F.Unknown,F.Advert];var zo;(function(i){i.Room="Room",i.Fee="Fee",i.Tax="Tax",i.Unknown="Unknown"})(zo||(zo={}));var Vo;(function(n){n.Singleton="Singleton",n.ApplicationHost="ApplicationHost",n.DataSource="DataSource"})(Vo||(Vo={}));var j;(function(i){i.PENDING="Pending",i.SKIPPED="Skipped",i.FAILED="Failed",i.PASSED="Passed"})(j||(j={}));var ue;(function(s){s.SCRIPT_PRESENT="Script Present",s.SCRIPT_LOADED="Script Loaded",s.INTEGRATION_ID_MATCHES="Integration Id Matches",s.PAGE_EVALUATED="Page Evaluated",s.MESSAGING_ACTIVE="Messaging Active"})(ue||(ue={}));var No="triptease.onboard.kernel",$o;(function(i){i.Enabled="Enabled",i.Disabled="Disabled",i.Strict="Strict",i.NotConfigured="NotConfigured"})($o||($o={}));var te=class{static get(){return p(()=>{let e="9160.135180";return e?"v"+e:"latest"})}};var gn=class{static application(e){let r=Go();return{name:No,url:`https://onboard.triptease.io/kernel/${te.get()}/kernel-host.html?originHost=${e}${r?"&"+r:""}`,type:"iframe",startMessage:"triptease.onboard.kernel-host-started",enabled:!0}}};var gl=L.getProperty("Date"),yn=class{now(){return new gl}},mt=class{now(){return new Date}};function Jo(t){return new Promise(e=>{this.setTimeout(()=>{e()},t)})}var W=class{constructor(e=new mt){this.clock=e;this.delay=Jo.bind(this);this.delay=Jo}task(e){return u(this,null,function*(){return yield this.delay(0),e()})}setTimeout(e,r){return setTimeout(e,r)}clearTimeout(e){clearTimeout(e)}setInterval(e,r){return setInterval(e,r)}clearInterval(e){clearInterval(e)}requestIdleCallback(e,r){let n=r?r.timeout:1,i=this.clock.now().getTime()+n,s=this;return this.setTimeout(()=>{e({didTimeout:!1,timeRemaining(){return Math.max(0,50-(s.clock.now().getTime()-i))}})},n)}cancelIdleCallback(e){this.clearTimeout(e)}};var up=new W;function Yo(t,e,r=new W){return n=>u(this,null,function*(){let i=yield Promise.race([e(n),r.delay(t)]);return i||{status:504,statusDescription:"Client timeout",body:`Request to ${n.url} timeout after ${t}`}})}function Ne(t={credentials:!1}){return e=>u(this,null,function*(){if(typeof fetch!="undefined"){let r=yield fetch(e.url,{method:e.method,headers:e.headers,body:e.body,credentials:t.credentials?"include":"omit"});return{status:r.status,statusDescription:r.statusText,body:yield r.text()}}else{let r=new XMLHttpRequest;return r.open(e.method,e.url,!0),e.headers&&Object.keys(e.headers).forEach(n=>{r.setRequestHeader(n,e.headers[n])}),r.withCredentials=t.credentials,r.send(e.body),new Promise((n,i)=>{r.addEventListener("load",s=>{n({status:r.status,statusDescription:r.statusText,body:r.responseText})}),r.addEventListener("error",s=>{i(s)})})}})}var Xo=I(ye());function yl(t){return t&&typeof t=="object"&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.enabled=="boolean"}function Zo(t){return yl(t)&&t.type!=="other"&&typeof t.url=="string"}var hl=/\${([^}]+)}/g;function Qo(t,e){return Eo(hl,t,([,r])=>{var n;return(n=e[r])!=null?n:`\${${r}}`})}var es=class{constructor(e,r=Ne()){this.logger=e;this.httpHandler=r;this.workers={}}createWorker(e,r){return u(this,null,function*(){let n=this.workers[e];return n||(this.workers[e]=yield this.create(r,{name:e}))})}create(e,r){return u(this,null,function*(){try{return new Worker(e,r)}catch(n){this.logger.debug("Failed to create Worker switching to Blob Worker because:",n.message);let i=`location.originalHref = "${e}"; `,a=(yield this.httpHandler({method:"GET",url:e})).body,l=new Blob([i,a],{type:"application/javascript"});return new Worker(URL.createObjectURL(l),r)}})}},ar=class{constructor(e,r=y("application-starter"),n=new es(r),i=new ts(e,r)){this.window=e;this.logging=r;this.workerFactory=n;this.waiter=i}start(e){return u(this,null,function*(){this.logging.debug(`ApplicationStarter starting app "${e.name}" (${e.type}), ${e.url}`);let r=this.window.document;if(e.type==="worker"){let s=yield this.workerFactory.createWorker(e.name,e.url);return e.startMessage&&(yield this.waiter.waitForMessage(e.startMessage,s)),this.logging.debug("ApplicationStarter returning worker"),s}let n=r.createElement(e.type);n.setAttribute("name",e.name),n.src=Qo(e.url,{onboard_version:te.get()});let i=ar.DefaultOptions[e.type]||{};return Object.keys(i).forEach(s=>{n.setAttribute(s.toLowerCase(),i[s])}),this.addElement(n),e.startMessage?yield this.waiter.waitForMessage(e.startMessage):e.type==="script"&&(yield this.waiter.waitForLoadEvent(n)),n})}addElement(e){(this.window.document.body||this.window.document.documentElement).appendChild(e)}static create(e){var n;let r=T(e).triptease.onboard;return r.applicationStarter=(n=r.applicationStarter)!=null?n:new ar(e)}},ve=ar;ve.DefaultOptions={script:{defer:"",async:"",crossOrigin:"anonymous"},iframe:{style:"display: none;",sandbox:"allow-scripts allow-same-origin",title:"blank","aria-hidden":"true"}},A([Xo.cache],ve.prototype,"start",1);var ts=class{constructor(e,r){this.window=e;this.logging=r}waitForLoadEvent(e){return this.logging.debug("MessageWaiter waiting for load/error event for",e),new Promise((r,n)=>{e.addEventListener("load",r),e.addEventListener("error",i=>n({name:"ScriptError",message:i.message||`Failed to load script "${e.src}"`}))})}waitForMessage(e,r=this.window){return this.logging.debug("MessageWaiter waiting for message",e),new Promise(n=>{this.logging.debug("MessageWaiter creating handler");let i=s=>{try{let a=s.data&&s.data.type,l=a===e;this.logging.debug(`ApplicationStarter message received "${a}", expecting "${e}", matched: ${l}`),l&&(r.removeEventListener("message",i),n(s.data))}catch(a){this.logging.debug("ApplicationStarter error in parsing message",a,s)}};this.logging.debug("MessageWaiter adding listener"),r.addEventListener("message",i)})}};var cr,bl=new Uint8Array(16);function hn(){if(!cr&&(cr=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!cr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return cr(bl)}var rs=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function vl(t){return typeof t=="string"&&rs.test(t)}var ns=vl;var U=[];for(lr=0;lr<256;++lr)U.push((lr+256).toString(16).substr(1));var lr;function xl(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(U[t[e+0]]+U[t[e+1]]+U[t[e+2]]+U[t[e+3]]+"-"+U[t[e+4]]+U[t[e+5]]+"-"+U[t[e+6]]+U[t[e+7]]+"-"+U[t[e+8]]+U[t[e+9]]+"-"+U[t[e+10]]+U[t[e+11]]+U[t[e+12]]+U[t[e+13]]+U[t[e+14]]+U[t[e+15]]).toLowerCase();if(!ns(r))throw TypeError("Stringified UUID is invalid");return r}var is=xl;function Sl(t,e,r){t=t||{};var n=t.random||(t.rng||hn)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(var i=0;i<16;++i)e[r+i]=n[i];return e}return is(n)}var bn=Sl;var gt=()=>p(()=>crypto.randomUUID())||bn(),vn=class{generate(e){if(typeof e!="undefined")throw new Error("UuidGenerator does not support custom lengths");return gt().replace(/-/g,"")}};var os=class{constructor(e,r){this.messaging=e;this.idGenerator=r}get(e,r,n){return(...i)=>u(this,null,function*(){let s=this.idGenerator.generate(),{payload:a}=yield this.messaging.handle({type:"triptease.onboard.request",requestType:String(r),payload:i,correlationId:s});if(ft(a))throw a;return a})}};function re(t,e=new vn){return new Proxy({},new os(t,e))}var xn=class{constructor(e,r=re(e)){this.proxy=r;this.applicationConfig=sr(e=>u(this,null,function*(){return yield this.proxy.applicationConfig(e)}));this.generateClientConfig=sr(e=>u(this,null,function*(){return yield this.proxy.generateClientConfig(e)}));this.generateConfig=sr(e=>u(this,null,function*(){return yield this.proxy.generateConfig(e)}))}};var $e=class{constructor(e){this.window=e;this.scripts=new Set}static create(e){let r=T(e).onboard,n=r.stackScriptFinder;return n||(r.stackScriptFinder=new $e(e))}capture(){let e=kl();e&&this.scripts.add(e);let r=this.window.document.currentScript;r&&"src"in r&&this.scripts.add(r.src)}get(){return Array.from(this.scripts).map(e=>new P(e))}},wl=/(https?.*):\d+:\d+/;function kl(){try{throw new Error}catch(t){if(!t.stack)return;let e=t.stack.match(wl);return e?e[1]:void 0}}function ss(t){let e=$e.create(t);e.capture();let r=e.get();return m.removeEmpty({scripts:r.map(n=>n.toString()),domains:r.map(n=>n.host).filter(Boolean),paths:r.map(n=>n.path)})}function as({method:t="POST",url:e,body:r}){let n=q.stringify(r);if(typeof navigator.sendBeacon!="undefined"&&t==="POST")navigator.sendBeacon(e,n);else if(typeof fetch!="undefined")fetch(e,{method:t,body:n});else if(XMLHttpRequest){let i=new XMLHttpRequest;i.open(t,e,!0),i.send(n)}}var yt={name:"onboard",version:te.get()},Cl="https://onboard.triptease.io";var Sn=class{constructor(e,r,n=y("analytics"),i=50){this.window=e;this.clock=r;this.logger=n;this.batchSize=i;this.queued=[];this.interval=setInterval(()=>u(this,null,function*(){return yield this.flush()}),1e3),this.window.addEventListener("pagehide",()=>u(this,null,function*(){return yield this.flush()}))}stop(){clearInterval(this.interval)}send(e){return u(this,null,function*(){this.queued.push(Al(this.clock,e)),this.queued.length>this.batchSize&&(yield this.flush())})}flush(){return u(this,null,function*(){if(this.queued.length===0)return;let e=this.queued.splice(0,this.batchSize);this.logger.log(`Flushing batch of ${e.length}, remaining in queue ${this.queued.length}`);let r={type:"triptease.onboard.batch",sentAt:this.clock.now(),payload:e};as({url:`${Cl}/message/batch`,body:r})})}};function Al(t,e){return S({messageId:gt(),createdAt:t.now()},e)}var _s=I(Ge());function Ol(t){return t&&typeof t=="function"&&typeof t.getAll=="function"}function cs(n,i){return u(this,arguments,function*(t,e,r=new W){let s=t[t.GoogleAnalyticsObject||"ga"];return Ol(s)?X(()=>u(this,null,function*(){let a=new Promise(l=>s(()=>l(k.unique(s.getAll().map(d=>d.get(e))))));return yield Promise.race([a,r.delay(50).then(()=>[])])})):[]})}function ls(t){return u(this,null,function*(){return{trackingIds:yield cs(t,"trackingId"),clientIds:yield cs(t,"clientId")}})}function ds(t){return{containerIds:k.unique(Array.from(t.document.querySelectorAll("script[src*=googletagmanager]")).map(r=>{let{query:n}=new P(r.src),{id:i}=B(n);return i}))}}function us(t){let e=Object.fromEntries(t.document.cookie.split(";").map(r=>r.split("=").map(n=>n.trim())));return m.removeEmpty({fbp:e._fbp,fbc:e._fbc})}function ps(t){return{appId:p(()=>t.duetto.initialConfig.appId),tld:p(()=>t.duetto.initialConfig.tld)}}function fs(t){var n;let e=!!t.document.querySelector("script[src*=revinate], .revinate-form, #revinate_contact_api_form"),r=(n=t.document.querySelector("#revinate_contact_api_form"))==null?void 0:n.getAttribute("token");if(e)return{exists:e,contactApiFormToken:r}}function ms(t){return m.removeEmpty({accountKey:p(()=>t.thn.__init.account_key),productAccess:p(()=>t.thn.__init.product_access)})}function gs(t){let e=t.document.querySelector("#hv[data-hvhotelid], #hv[data-hvexthotelid]");if(e)return m.removeEmpty({hotelId:e.dataset.hvhotelid,extHotelId:e.dataset.hvexthotelid,clientId:e.dataset.hvclientid,language:e.dataset.hvlanguage,product:e.dataset.hvproduct})}var ys="triptease.onboard.response";function wn(t){return t&&typeof t=="object"&&t.type==="triptease.onboard.request"&&typeof t.requestType=="string"&&typeof t.correlationId=="string"&&Array.isArray(t.payload)}function dr(t){return t&&typeof t=="object"&&t.type==="triptease.onboard.response"&&typeof t.correlationId=="string"}function ur(t,e){return{type:"triptease.onboard.response",correlationId:t,payload:e}}function pr(t,e){return ur(t,mn("NotFound","No handler found for "+e))}function hs(t){return p(()=>t.payload.name==="NotFound",!1)}function bs(t,e){return ur(t,mn(e.name,e.message,e.stack))}var ht=class{constructor(e,r=60*1e3,n=new W){this.handler=e;this.timeout=r;this.timers=n}handle(e){return u(this,null,function*(){let r=yield Promise.race([this.handler.handle(e),this.timers.delay(this.timeout)]);return r||{type:ys,payload:new Error(`Request ${e.requestType} timed out after ${this.timeout}`),correlationId:e.correlationId}})}};var vs=y("messaging"),pe=class{constructor(e){this.messageHandler=e;this.promises=new Map;e&&e.addListener(r=>{if(dr(r)){let{correlationId:n}=r,i=this.promises.get(n);i&&(vs.debug("Sender matched response",r),i.resolve(r),this.promises.delete(n))}})}handle(e){return u(this,null,function*(){return vs.debug("Sending request",e),this.messageHandler&&this.messageHandler.send(e),new Promise((r,n)=>{this.promises.set(e.correlationId,{resolve:r,reject:n})})})}};function xs(t){return u(this,null,function*(){return{browsingTopics:yield X(()=>Pl(t)),attributionSrc:k.unique(Array.from(t.document.querySelectorAll("a[attributionSrc], img[attributionSrc], script[attributionSrc]")).map(e=>e.getAttribute("attributionSrc"))),attributionSourceId:k.unique(Array.from(t.document.querySelectorAll("a[attributionSourceId]")).map(e=>e.getAttribute("attributionSourceId"))),attributionDestination:k.unique(Array.from(t.document.querySelectorAll("a[attributionDestination]")).map(e=>e.getAttribute("attributionDestination")))}})}function Tl(t){return re(new ht(new pe(Ko(t)),50))}var Pl=t=>u(void 0,null,function*(){return Tl(t).browserTopics()});function Ss(t){return u(this,null,function*(){return m.removeEmpty({googleAnalytics:yield X(()=>ls(t),{}),googleTagManager:p(()=>ds(t),{}),facebook:p(()=>us(t),{}),duetto:ps(t),revinate:fs(t),thn:ms(t),hotelVerse:gs(t),adtech:yield X(()=>xs(t))})})}var ws=["page","referrer","redirectSource","redirectDestination","source"];function ks(t){return!!t.trackingId}function J(t){if(!t)return{};let{scheme:e,host:r,path:n,query:i,fragment:s}=new P(t);return m.removeEmpty({scheme:e,host:r,path:n,query:i,queryParsed:B(i,!1),fragment:s})}var fr;(function(b){b.Config="triptease.config",b.Event="triptease.event",b.Log="triptease.logs",b.Error="triptease.onboard.error",b.Message="triptease.onboard.message",b.PageDisplayedSearch="triptease.integration.page_displayed_search",b.PageDisplayedRoomsAndRates="triptease.integration.page_displayed_rooms-and-rates",b.PageDisplayedConfirmation="triptease.integration.page_displayed_confirmation",b.PageDisplayedCheckout="triptease.integration.page_displayed_checkout",b.PageDisplayedUnknown="triptease.integration.page_displayed_unknown",b.PageDisplayedGroup="triptease.integration.page_displayed_group",b.PageDisplayedPartial="triptease.integration.page_displayed_partial",b.PageErroredRoomsAndRates="triptease.integration.page_errored_rooms-and-rates",b.PageErroredConfirmation="triptease.integration.page_errored_confirmation",b.IntegrationData="triptease.integration.integration_data",b.PartialConfirmationPageData="triptease.integration.partial_confirmation_data",b.InvalidConfirmationData="triptease.integration.invalid_confirmation_data",b.InvalidPage="triptease.integration.invalid_page",b.GenericScript="triptease.integration.generic_script",b.DataCapture="triptease.integration.data_capture",b.GenericAnalysisConfirmation="triptease.integration.generic_analysis_confirmation",b.EntityUpdate="triptease.entity.update",b.StatusChanged="triptease.onboard.status-changed"})(fr||(fr={}));var fe;(function(h){h.PageDisplayedAdvert="page_displayed_advert",h.PageDisplayedEmail="page_displayed_email",h.PageDisplayedMessage="page_displayed_message",h.UserClickedAdvert="user_clicked_advert",h.UserClickedEmailCTA="user_clicked_email-cta",h.UserClickedMessageClose="user_clicked_message-close",h.UserClickedMessageCTA="user_clicked_message-cta",h.UserSubmittedPII="user_submitted_pii",h.UserClickedBookingEngineLink="user_clicked_booking-engine-link",h.UserClickedEmailAddress="user_clicked_email-address",h.UserClickedLink="user_clicked_link",h.UserClickedOutboundLink="user_clicked_outbound-link",h.UserClickedPhoneNumber="user_clicked_phone-number"})(fe||(fe={}));var El=[fe.UserClickedBookingEngineLink,fe.UserClickedEmailAddress,fe.UserClickedLink,fe.UserClickedOutboundLink,fe.UserClickedPhoneNumber];function Cs(t){var e,r,n,i;try{if(((r=(e=t==null?void 0:t.context)==null?void 0:e.app)==null?void 0:r.name)==="MessageEngine")return{channel:"Messages",provider:"Triptease"};if(El.includes(t.event))return{channel:"Direct",provider:"Unknown"};let{eventCounter:s,trafficSource:a}=(i=(n=t==null?void 0:t.context)==null?void 0:n.tab)!=null?i:{};if(s===1)return{channel:a==null?void 0:a.channel,provider:a==null?void 0:a.provider}}catch(s){}return{channel:"Unknown",provider:"Unknown"}}var ne=I(Ge());var Ps=I(ye());var kn=["tt_gha_campaign_id"],As=["utm_campaign","utm_content","utm_medium","utm_source","utm_term","tt_ad_type","tt_auid","tt_channel","tt_cid","tt_meta","tt_pmd","tt_ps_tid","tt_rt","dclid","fbclid","gbraid ","gclid","gclsrc","msclkid","wbraid","wh_token",...kn];function Cn(t,e,r){var d,f;let{queryParsed:n,fragment:i}=J(t),s=i?B((d=i.split("?")[1])!=null?d:i,!1):{},a=(f=q.atob(n==null?void 0:n.data))!=null?f:{},l=S(S(S({},s),n),a==null?void 0:a.payload);return m.removeEmpty(r.reduce((g,C)=>{let v=l[C];if(!v)return g;let h=Array.isArray(v)?v.filter(Boolean)[0]:v;if(h.includes("?")&&h.includes("="))return Cn(h,g,r);if(h.includes("&")&&h.includes("=")){let[oe,H]=h.split(/&(.*)/);return g[C]=oe,Cn(`?${H}`,g,r)}return g[C]=h,g},e))}function mr(t,e){return typeof t!="string"?{}:Il(Cn(t,{},e))}function Os(t){return mr(t,As)}function Il(t){var e;return m.removeEmpty(S(M(S({},t),{tt_cid:(e=t.tt_cid)!=null?e:t.tt_gha_campaign_id}),kn.reduce((r,n)=>M(S({},r),{[n]:void 0}),{})))}function Ts(t){return t.filter(Boolean).reverse().reduce((r,n)=>_.merge(r,n),{})}var Rl=new Map([["facebook","Facebook"],["facebook.com","Facebook"],["fb","Facebook"],["ig","Instagram"],["instagram","Instagram"],["line","Line"],["linkedin","LinkedIn"],["pinterest","Pinterest"],["reddit","Reddit"],["snapchat","SnapChat"],["tiktok","TikTok"],["tripadvisor","TripAdvisor"],["tripadvisor.com","TripAdvisor"],["twitter","Twitter"],["twitter.com","Twitter"],["wechat","WeChat"],["yelp","Yelp"],["zalo","Zalo"]]),_l=new Map([["facebook","Facebook"],["instagram","Instagram"],["twitter","Twitter"],["snapchat","SnapChat"]]),Es=new Map([["baidu","Baidu"],["bing","Bing"],["duckduckgo","DuckDuckGo"],["google","Google"],["google.com","Google"],["googlemybusiness","Google"],["gha","Google"],["kayak","Kayak"],["msn","MSN"],["naver","Naver"],["rakuten","Rakuten"],["seznam","Seznam"],["skyscanner","SkyScanner"],["trivago","Trivago"],["wego","Wego"],["yahoo","Yahoo"],["yandex","Yandex"]]),Ml=new Set(["display","banner","expandable","interstitial","cpm"]),Hl=/^(.*cp.*|ppc|paid.*)$/,Dl=/^social[-_ ]?(?:network|media)?$/,Is=/^e[-_\s]?mail$/;function Rs(t){return/metai.*o/.test(t)}function Ll(t,e,r,n){return t?!0:/google.*hpa/.test(e)&&Rs(r)&&n}function ql(t,e){return!!t||e==="display"}function jl(t){return t==="paidsearch"}function Ul(t){return t==="paidsocial"}function Bl(t){return!!(t==null?void 0:t.startsWith("email"))}function Gl(t){return t==="messages"}var z=class{constructor(e){this.wihpDomains=new Set(["secure-hotel-tracker.com","secure-relay.com"]);this.dEdgeDomains=["redir.book-secure.com",".official-rates.com"];this.travelclickDomains=["tcgms.net","travelclick.com","zmaildirect.com"];this.cendynDomains=["guestfolio.net","contact-client.com"];this.history=e.map(r=>m.removeEmpty(M(S({},r),{urlParsed:J(r.url),wellKnownParams:Os(r.url)}))),this.wellKnownParams=Ts(this.history.map(r=>r.wellKnownParams))}get referrer(){var e;return J((e=this.history.find(r=>r.urlSource==="referrer"))==null?void 0:e.url)}get page(){var e;return J((e=this.history.find(r=>r.urlSource==="page"))==null?void 0:e.url)}getParameter(e){let r=this.wellKnownParams[e];return p(()=>r.toLowerCase().trim())}get linkType(){var r;let e=(r=this.getParameter("tt_ad_type"))==null?void 0:r.toLowerCase();return e==="paid"?"Paid":e==="free"?"Free":Hl.test(this.getParameter("utm_medium"))?"Paid":"Unknown"}get searchEngine(){var s;let e=this.getParameter("utm_source"),r=this.getParameter("tt_meta"),[,n]=(s=Array.from(Es.entries()).find(([a])=>(e==null?void 0:e.startsWith(a))||(r==null?void 0:r.startsWith(a))))!=null?s:[];if(n)return n;let[i]=p(()=>this.referrer.host.split(".").flatMap(a=>[Es.get(a)].filter(Boolean)),[]);return i||"Unknown"}get social(){let e=Rl.get(this.getParameter("utm_source"));if(e)return e;let[r="Unknown"]=p(()=>this.referrer.host.split(".").flatMap(n=>[_l.get(n)].filter(Boolean)),[]);return r}get tripteaseChannels(){let e=this.getParameter("utm_source"),r=this.getParameter("utm_campaign"),n=this.getParameter("tt_meta"),i=this.getParameter("tt_rt"),s=this.getParameter("tt_channel"),a=!!this.history.find(l=>["redirectSource","redirectDestination"].includes(l.urlSource));if(Ll(n,e,r,a))return{channel:"Metasearch",provider:"Triptease",adType:this.linkType};if(ql(i,s))return{channel:"Display",provider:"Triptease",adType:"Retargeting"};if(jl(s))return{channel:"Paid Search",provider:"Triptease",adType:"Unknown"};if(Ul(s))return{channel:"Paid Social",provider:"Triptease",adType:"Unknown"};if(Bl(s))return{channel:"Email",provider:"Triptease",adType:"Unknown"};if(Gl(s))return{channel:"Messages",provider:"Triptease",adType:"Unknown"}}get thirdPartyChannels(){var s;let e=((s=this.referrer)==null?void 0:s.host)||"",r=this.getParameter("utm_campaign"),n=this.getParameter("utm_source"),i=this.getParameter("utm_medium");if(this.wihpDomains.has(e)||Rs(r))return{channel:"Metasearch",provider:"WIHP",adType:this.linkType};if(this.dEdgeDomains.some(a=>e.endsWith(a)))return{channel:this.channel,provider:"D-Edge",adType:this.linkType};if(this.travelclickDomains.some(a=>e.endsWith(a))&&e!==this.page.host)return{channel:this.channel,provider:"Travelclick",adType:this.linkType};if((e==null?void 0:e.endsWith("revinate.com"))||n==="revinate")return{channel:this.channel,provider:"Revinate",adType:this.linkType};if(this.cendynDomains.some(a=>e.endsWith(a))||n==="cendyn")return{channel:this.channel,provider:"Cendyn",adType:this.linkType};if(i==="channel_connect")return{channel:this.channel,provider:"Sabre",adType:this.linkType}}get channel(){let e=this.getParameter("utm_source"),r=this.getParameter("utm_medium");return e==="direct"||!r&&!e?"Direct":Ml.has(r)?"Display":Is.test(e)||Is.test(r)?"Email":this.searchEngine!=="Unknown"?this.linkType==="Paid"?"Paid Search":"Organic Search":this.social!=="Unknown"?this.linkType?"Paid Social":"Organic Social":Dl.test(r)?"Organic Social":"Unknown"}standardChannels(){return{channel:this.channel,provider:"Unknown",adType:"Unknown"}}get trafficSource(){var r,n;let e=(n=(r=this.tripteaseChannels)!=null?r:this.thirdPartyChannels)!=null?n:this.standardChannels();return M(S({},e),{social:this.social,searchEngine:this.searchEngine})}};A([ne.lazy],z.prototype,"referrer",1),A([ne.lazy],z.prototype,"page",1),A([Ps.cache],z.prototype,"getParameter",1),A([ne.lazy],z.prototype,"linkType",1),A([ne.lazy],z.prototype,"searchEngine",1),A([ne.lazy],z.prototype,"social",1),A([ne.lazy],z.prototype,"tripteaseChannels",1),A([ne.lazy],z.prototype,"channel",1),A([ne.lazy],z.prototype,"trafficSource",1);function Wl(t){return{title:t.document.title,locale:t.document.documentElement.lang||t.document.documentElement.getAttribute("xml:lang")||"",url:t.location.href,urlParsed:J(t.location.href),referrer:t.document.referrer,referrerParsed:J(t.document.referrer),characterSet:t.document.characterSet,opener:p(()=>Boolean(t.opener),!1)}}function Fl(t){var e;return(e=t.find(r=>ks(r)))==null?void 0:e.trackingId}var An=class{constructor(e,r,n){this.browserMessageBuilder=e;this.sessionTracker=r;this.identityCombiner=n}buildMessage(e){return u(this,null,function*(){var l;let r=yield this.browserMessageBuilder.buildMessage(e),n=yield this.identityCombiner.getIdentity(),i=yield this.sessionTracker.urls((l=r.payload)==null?void 0:l.apiKey,n.serverTime),s=new z(i),a=m.removeEmpty(_.merge(M(S({},M(S({},n),{serverTime:void 0})),{trackingId:Fl(i),context:{page:{urls:s.history},tab:{history:s.history,wellKnownParams:s.wellKnownParams,trafficSource:s.trafficSource},trafficSource:s.trafficSource}}),r));return m.removeEmpty(_.merge({context:{eventSource:Cs(a)}},a))})}},gr=class{constructor(e,r=new mt){this.window=e;this.clock=r}get timezone(){return p(()=>Intl.DateTimeFormat().resolvedOptions().timeZone,"")}buildMessage(e){return u(this,null,function*(){let r=this.clock.now(),n=Wl(this.window);return m.removeEmpty(_.merge({createdAt:r,messageId:gt(),context:{library:yt,userAgent:this.window.navigator.userAgent,locale:this.window.navigator.language,page:n,screen:{width:this.window.screen.width,height:this.window.screen.height},timezone:this.timezone,thirdParty:yield Ss(this.window),scripts:ss(this.window),features:Ho(this.window,...Kl),performance:p(()=>PerformanceObserver.supportedEntryTypes,[])}},e))})}};A([_s.lazy],gr.prototype,"timezone",1);var Kl=["fbq","fetch","Set","Map","WebAssembly.constructor","PerformanceObserver","Date","Date.now","Date.prototype.toISOString","Date.prototype.toJSON","Date.prototype.getTime","crypto.randomUUID","crypto.getRandomValues","crypto.subtle.digest","Intl.Collator","Intl.NumberFormat","Intl.NumberFormat.prototype.formatToParts","Intl.DateTimeFormat","Intl.DateTimeFormat.prototype.formatToParts","console.log","navigator.share","navigator.serviceWorker","EventSource","customElements","__tcfapi","__cmp","_etmc","IntersectionObserver","IntersectionObserverEntry","IntersectionObserverEntry.prototype.intersectionRatio","document.browsingTopics","navigator.joinAdInterestGroup","navigator.runAdAuction","navigator.adAuctionComponents","navigator.createAuctionNonce","HTMLFencedFrameElement"];var zl=y("messaging"),yr=class{constructor(){this.handlers=new Map}register(e,r){return e.forEach(n=>{if(this.hasHandlerFor(n))throw new Error(`Method name "${n}" already registered to a handler`);this.handlers.set(n,r)}),this}handle(e){return u(this,null,function*(){let r=this.handlers.get(e.requestType);return r?(zl.debug("Matched message to handler",e,r),yield r.handle(e)):pr(e.correlationId,e.requestType)})}hasHandlerFor(e){return this.handlers.has(e)}};var On=y("messaging"),Je=class{constructor(e){this.target=e}handle(e){return u(this,null,function*(){let r=this.target[e.requestType];if(!r)return On.debug("No method found that matches method",e.requestType,this.target),pr(e.correlationId,e.requestType);try{On.debug("Found method",e.requestType);let n=yield r.apply(this.target,e.payload);return ur(e.correlationId,n)}catch(n){return On.debug("Error trying to in invoke method",e.requestType,n),bs(e.correlationId,n)}})}};var Vl=te.get();function Nl(t){return`https://onboard.triptease.io/integrations/${Vl}/${t}.js`}function Tn(t){return typeof t!="string"?"":t.split(/[^A-Za-z0-9-]/)[0].replace(/-/g,"").toLowerCase()}var c=class{constructor(e){this.name=e;if(!/[A-Za-z0-9]/.test(e))throw new Error("Only alpha numeric allowed");c.Lookup.set(Tn(e),this)}static values(){return Array.from(c.Lookup.values())}static parse(e){let r=c.Lookup.get(Tn(e));if(!r)throw new Error(`Invalid booking engine name: ${e}`);return r}toString(){return this.name}get canonical(){return Tn(this.name)}get folder(){return this.isSelfIntegration()?c.Default.folder:Q.kebabCase(this.name)}get script(){return Nl(this.folder)}isSelfIntegration(){return c.SelfIntegration.has(this)}},o=c;o.Lookup=new Map,o.AboveProperty=new c("AboveProperty"),o.AfricaAlbida=new c("AfricaAlbida"),o.Alaric=new c("Alaric"),o.Ascott=new c("Ascott"),o.ASIWebRes=new c("ASIWebRes"),o.AtlantisORS=new c("AtlantisORS"),o.Auberge=new c("Auberge"),o.AvailPro=new c("AvailPro"),o.Avvio=new c("Avvio"),o.Ayana=new c("Ayana"),o.AZDS=new c("AZDS"),o.BestWesternFrance=new c("BestWesternFrance"),o.BestWesternItaly=new c("BestWesternItaly"),o.BestWesternUk=new c("BestWesternUk"),o.Betsy=new c("Betsy"),o.Bloom=new c("Bloom"),o.BookAssist=new c("BookAssist"),o.BookEasy=new c("BookEasy"),o.Bookolo=new c("Bookolo"),o.BookOnlineNow=new c("BookOnlineNow"),o.BookVisit=new c("BookVisit"),o.Booking=new c("Booking"),o.Booking2Hotels=new c("Booking2Hotels"),o.BookingExpert=new c("BookingExpert"),o.BrochnerHotels=new c("BrochnerHotels"),o.BusyRooms=new c("BusyRooms"),o.BWHHotelGroup=new c("BWHHotelGroup"),o.CenterHotels=new c("CenterHotels"),o.CityExpress=new c("CityExpress"),o.Clink=new c("Clink"),o.Clock=new c("Clock"),o.CloudBeds=new c("CloudBeds"),o.Cocotel=new c("Cocotel"),o.CompuRez=new c("CompuRez"),o.Comwell=new c("Comwell"),o.ConstanceHotels=new c("ConstanceHotels"),o.Default=new c("Default"),o.DerqueBooking=new c("DerqueBooking"),o.DeutscheHospitality=new c("DeutscheHospitality"),o.Dingus=new c("Dingus"),o.Dirs21=new c("Dirs21"),o.DoyleCollection=new c("DoyleCollection"),o.EasyBooking=new c("EasyBooking"),o.EasyConsulting=new c("EasyConsulting"),o.Erez=new c("Erez"),o.EGds=new c("EGds"),o.Evancy=new c("Evancy"),o.Exely=new c("Exely"),o.Everly=new c("Everly"),o.ExtendedStayAmerica=new c("ExtendedStayAmerica"),o.Ezee=new c("Ezee"),o.FastBooking=new c("FastBooking"),o.Firmdale=new c("Firmdale"),o.FourSeasons=new c("FourSeasons"),o.FrontDeskMaster=new c("FrontDeskMaster"),o.FullertonHotels=new c("FullertonHotels"),o.Furama=new c("Furama"),o.GemHotels=new c("GemHotels"),o.Generic=new c("Generic"),o.GlenEagles=new c("GlenEagles"),o.GuestCentric=new c("GuestCentric"),o.GuestDesk=new c("GuestDesk"),o.GuestLine=new c("GuestLine"),o.GuestPro=new c("GuestPro"),o.Guild=new c("Guild"),o.HamiltonIsland=new c("HamiltonIsland"),o.HamiltonIslandHolidayHomes=new c("HamiltonIslandHolidayHomes"),o.HandPickedHotels=new c("HandPickedHotels"),o.Hart=new c("Hart"),o.HHotels=new c("HHotels"),o.HighLevelSoftware=new c("HighLevelSoftware"),o.Hipotels=new c("Hipotels"),o.HiUsa=new c("HiUsa"),o.Hoteliers=new c("Hoteliers"),o.HoteliersGuru=new c("HoteliersGuru"),o.HotelKeyApp=new c("HotelKeyApp"),o.HotelNetSolutions=new c("HotelNetSolutions"),o.HotelPartner=new c("HotelPartner"),o.Hotetec=new c("Hotetec"),o.Hotusa=new c("Hotusa"),o.Hoxton=new c("Hoxton"),o.HspRez=new c("HspRez"),o.HtiSystems=new c("HtiSystems"),o.Hyatt=new c("Hyatt"),o.GHS=new c("GHS"),o.GuestRez=new c("GuestRez"),o.Iberostar=new c("Iberostar"),o.Infotera=new c("Infotera"),o.Inkaterra=new c("Inkaterra"),o.InnQuest=new c("InnQuest"),o.InnRoad=new c("InnRoad"),o.InnStyle=new c("InnStyle"),o.Inntopia=new c("Inntopia"),o.Iperbooking=new c("Iperbooking"),o.IRM=new c("IRM"),o.JazHotels=new c("JazHotels"),o.Journey=new c("Journey"),o.Kasa=new c("Kasa"),o.KeaHotels=new c("KeaHotels"),o.Kempinski=new c("Kempinski"),o.Kerzner=new c("Kerzner"),o.LatourHotelsAndResorts=new c("LatourHotelsAndResorts"),o.LHW=new c("LHW"),o.LifeHouse=new c("LifeHouse"),o.Loews=new c("Loews"),o.Lotte=new c("Lotte"),o.LumaHotels=new c("LumaHotels"),o.Luxscapia=new c("Luxscapia"),o.McDreams=new c("McDreams"),o.Mews=new c("Mews"),o.MgmResorts=new c("MgmResorts"),o.MillenniumHotels=new c("MillenniumHotels"),o.MinorHotels=new c("MinorHotels"),o.Mirai=new c("Mirai"),o.MotelOne=new c("MotelOne"),o.Namastay=new c("Namastay"),o.NativePlaces=new c("NativePlaces"),o.NeoBookings=new c("NeoBookings"),o.NetAffinity=new c("NetAffinity"),o.Newbook=new c("Newbook"),o.NHHotels=new c("NHHotels"),o.OKU=new c("OKU"),o.OmegaHotelManagement=new c("OmegaHotelManagement"),o.Omnibees=new c("Omnibees"),o.OneHotels=new c("OneHotels"),o.Opera=new c("Opera"),o.OpenHotel=new c("OpenHotel"),o.P3=new c("P3"),o.PalaceResorts=new c("PalaceResorts"),o.PanHospitality=new c("PanHospitality"),o.Paraty=new c("Paraty"),o.Pegasus=new c("Pegasus"),o.Pelican=new c("Pelican"),o.Phobs=new c("Phobs"),o.Planet=new c("Planet"),o.PointAHotels=new c("PointAHotels"),o.Prestige=new c("Prestige"),o.ProfitRoom=new c("ProfitRoom"),o.Protel=new c("Protel"),o.PursuitCollection=new c("PursuitCollection"),o.RedPlanet=new c("RedPlanet"),o.RegalHotels=new c("RegalHotels"),o.ReserveHotel=new c("ReserveHotel"),o.ReserveOnline=new c("ReserveOnline"),o.ReservationResources=new c("ReservationResources"),o.Reservit=new c("Reservit"),o.Reseze=new c("Reseze"),o.ResNexus=new c("ResNexus"),o.ResOnTheWeb=new c("ResOnTheWeb"),o.Retargeting=new c("Retargeting"),o.Revenatium=new c("Revenatium"),o.Reztrip=new c("Reztrip"),o.RGuest=new c("RGuest"),o.RMSCloud=new c("RMSCloud"),o.Roiback=new c("Roiback"),o.RoomKey=new c("RoomKey"),o.RoomMaster=new c("RoomMaster"),o.RoomSome=new c("RoomSome"),o.RoomStay=new c("RoomStay"),o.SandsVegas=new c("SandsVegas"),o.Sandrix=new c("Sandrix"),o.Sbe=new c("Sbe"),o.SeamillHydro=new c("SeamillHydro"),o.Seekda=new c("Seekda"),o.Selfbook=new c("Selfbook"),o.Shr=new c("Shr"),o.SimpleBooking=new c("SimpleBooking"),o.SiteMinder=new c("SiteMinder"),o.Skipper=new c("Skipper"),o.Skyware=new c("Skyware"),o.Staah=new c("Staah"),o.StationCasinos=new c("StationCasinos"),o.Stayntouch=new c("Stayntouch"),o.Sweett=new c("Sweett"),o.Synxis=new c("Synxis"),o.SysHotelOnline=new c("SysHotelOnline"),o.Taj=new c("Taj"),o.ThinkReservations=new c("ThinkReservations"),o.Travelanium=new c("Travelanium"),o.TravelClick=new c("TravelClick"),o.Uibscrs=new c("Uibscrs"),o.Up=new c("Up"),o.VacationMarbella=new c("VacationMarbella"),o.Valamar=new c("Valamar"),o.VerticalBooking=new c("VerticalBooking"),o.Viato=new c("Viato"),o.Vinpearl=new c("Vinpearl"),o.WebRezPro=new c("WebRezPro"),o.WestCordHotels=new c("WestCordHotels"),o.Witbooking=new c("Witbooking"),o.Youngs=new c("Youngs"),o.Zafiro=new c("Zafiro"),o.SelfIntegration=new Set([c.Dirs21,c.HtiSystems,c.ExtendedStayAmerica]);function Ms(t,...e){let r=rr(t,...e);if(!r)return;let[n]=[...r].reverse();return n}function Pn(t){let e=p(()=>t.host.toLowerCase(),""),r=t.toString().toLowerCase();if(e==="gc.synxis.com")return o.Synxis;if(e==="be.synxis.com")return o.Synxis;if(e.indexOf("travelclick")!==-1)return o.TravelClick;if(e.indexOf("bookingbutton")!==-1||e.indexOf("book-directonline")!==-1||e.indexOf("direct-book.com")!==-1)return o.SiteMinder;if(e.indexOf(".hyatt.")!==-1)return o.Hyatt;if(e.indexOf(".bookonthenet.")!==-1)return o.RoomKey;if(e.indexOf("firmdalehotels")!==-1)return o.Firmdale;if(e.indexOf("apxhotelsapartments")!==-1||e.indexOf("mews.li")!==-1)return o.Mews;if(e.indexOf(".guestline.")!==-1||e.indexOf(".roomlynx.")!==-1)return o.GuestLine;if(e.indexOf("book-onlinenow.net")!==-1)return o.BookOnlineNow;if(e.indexOf("windsurfercrs.com")!==-1)return o.Shr;if(e.indexOf("bestwestern.fr")!==-1)return o.BestWesternFrance;if(r.indexOf("webrez.com")!==-1||e.indexOf("worldweb.com")!==-1||e.indexOf("webrez.com/v")!==-1)return o.WebRezPro;if(e.indexOf("hoteliers.com")!==-1)return o.Hoteliers;if(e.indexOf("doylecollection")!==-1)return o.DoyleCollection;if(r.indexOf("/bookcore/")!==-1)return o.Roiback;if(e.indexOf("nativeplaces.com")!==-1)return o.NativePlaces;if(r.indexOf("/cgi-bin/lansaweb")!==-1)return o.StationCasinos;if(e==="www.palms.com")return o.StationCasinos;if(e.indexOf(".webhotel.")!==-1)return o.Opera;if(e.indexOf("online.bookvisit.")!==-1)return o.BookVisit;if(e.indexOf("direct-reservation")!==-1)return o.BusyRooms;if(e.indexOf("youngshotels")!==-1)return o.Youngs;if(e.indexOf("loewshotels")!==-1)return o.Loews;if(e.indexOf("regalhotel")!==-1)return o.RegalHotels;if(e.indexOf("live.high-level-software")!==-1)return o.HighLevelSoftware;if(e.indexOf("premiereserve.com")!==-1||e.indexOf("teg-hotels.com")!==-1)return o.Everly;if(e.indexOf("simplebooking")!==-1||e.indexOf("booking.crimsonhotel")!==-1)return o.SimpleBooking;if(e.indexOf("bookassist.com")!==-1)return o.BookAssist;if(e.indexOf("booking.africaalbidatourism.com")!==-1)return o.AfricaAlbida;if(e.indexOf("onepagebooking.com")!==-1)return o.HotelNetSolutions;if(e.indexOf("reservhotel.com")!==-1)return o.ReserveHotel;if(r.indexOf("/irmng")!==-1)return o.IRM;if(e.indexOf("booking-channel.com")!==-1)return o.Hotusa;if(e.includes(".venetian.")||e.includes(".venetianlasvegas."))return o.SandsVegas;if(e.indexOf("clock-software.com")!==-1||e.indexOf("villasriomar.com")!==-1)return o.Clock;if(e.indexOf("tajinnercircle.com")!==-1||e.indexOf("tajhotels.com")!==-1||e.indexOf("gateway-hotels.")!==-1)return o.Taj;if(e.indexOf("booking.iberostartheclub.com")!==-1)return o.Iberostar;if(e.indexOf("services.comwell.com")!==-1)return o.Comwell;if(e.indexOf(".profitroom.")!==-1)return o.ProfitRoom;if(e.indexOf("bookingexpert.it")!==-1)return o.BookingExpert;if(e.indexOf("cloud-reservations.net")!==-1)return o.Hart;if(e.indexOf("pr.palaceresorts.com")!==-1||e.indexOf("pr.moonpalace.com")!==-1||e.indexOf("pr.leblancsparesorts.com")!==-1||e.indexOf(".palaceelite.com")!==-1)return o.PalaceResorts;if(e.indexOf(".iqwebbook.com")!==-1)return o.InnQuest;if(e.indexOf("theguild.co")!==-1)return o.Guild;if(e.indexOf(".innroad.com")!==-1)return o.InnRoad;if(e.indexOf(".furama.com")!==-1)return o.Furama;if(e.indexOf(".reztrip.com")!==-1)return o.Reztrip;if(e.indexOf("nisekoportfolio.com")!==-1)return o.BookEasy;if(e.indexOf(".steigenberger.com")!==-1||e.indexOf(".intercityhotel.com")!==-1||e.indexOf(".maxxhotel.com")!==-1||e.indexOf(".jaz-hotel.com")!==-1)return o.DeutscheHospitality;if(e.indexOf(".cloudbeds.com")!==-1)return o.CloudBeds;if(e.indexOf(".thehoxton.com")!==-1)return o.Hoxton;if(e.indexOf(".lottehotel.com")!==-1)return o.Lotte;if(e.indexOf("kempinski.com")!==-1)return o.Kempinski;if(e.indexOf("derquebooking")!==-1)return o.DerqueBooking;if(e.indexOf(".gfhoteles.")!==-1)return o.DerqueBooking;if(e.indexOf(".gleneagles.com")!==-1)return o.GlenEagles;if(e.indexOf(".redplanethotels.com")!==-1)return o.RedPlanet;if(e.indexOf(".banffjaspercollection.com")!==-1||e.indexOf(".glacierparkcollection.com")!==-1)return o.PursuitCollection;if(e.indexOf(".bestwestern.co.uk")!==-1)return o.BestWesternUk;if(e.indexOf(".sbe.com")!==-1)return o.Sbe;if(e.indexOf(".reserve-online.net")!==-1)return o.ReserveOnline;if(e.indexOf("secure-hotel-booking.com")!==-1)return o.AvailPro;if(e.indexOf(".syshotelonline.it")!==-1)return o.SysHotelOnline;if(e.indexOf(".reservit.com")!==-1)return o.Reservit;if(e.indexOf("vinpearl.com")!==-1)return o.Vinpearl;if(e.indexOf(".omnibees.com")!==-1)return o.Omnibees;if(e.indexOf(".hipotels.com")!==-1)return o.Hipotels;if(e.indexOf(".handpickedhotels.co.uk")!==-1)return o.HandPickedHotels;if(e.indexOf("bookings.zafirohotels.com")!==-1)return o.Zafiro;if(e.indexOf(".viatocrs.de")!==-1)return o.Viato;if(e.indexOf(".easy-booking.")!==-1)return o.EasyBooking;if(e.indexOf(".ipms247.")!==-1||e.indexOf("reservas.hotelkokai.com")!==-1)return o.Ezee;if(e.indexOf(".innstyle.")!==-1)return o.InnStyle;if(e.indexOf(".book-secure.")!==-1)return o.FastBooking;if(e.indexOf(".cityexpress.")!==-1)return o.CityExpress;if(e.indexOf(".hoteleasyreservations.")!==-1)return o.EasyConsulting;if(e.indexOf(".travelanium.")!==-1)return o.Travelanium;if(e.indexOf(".e-gds.")!==-1)return o.EGds;if(e.indexOf(".booking.com")!==-1)return o.Booking;if(e.indexOf(".iperbooking.")!==-1)return o.Iperbooking;if(e.indexOf(".okuhotels.")!==-1)return o.OKU;if(e.indexOf(".pegsbe.")!==-1)return o.Pegasus;if(e.indexOf(".the-ascott.")!==-1||e.indexOf(".discoverasr.")!==-1)return o.Ascott;if(e.indexOf("kasa.")!==-1)return o.Kasa;if(e.indexOf("verticalbooking.")!==-1)return o.VerticalBooking;if(e.indexOf(".avvio.")!==-1)return o.Avvio;if(e.indexOf(".bestwestern.it")!==-1)return o.BestWesternItaly;if(e.indexOf("extendedstayamerica.")!==-1)return o.ExtendedStayAmerica;if(e.indexOf(".fourseasons.")!==-1||e.indexOf(".fourseasonscountryclub.")!==-1||e.indexOf(".fsweb.")!==-1)return o.FourSeasons;if(e.indexOf(".hti-systems.")!==-1)return o.HtiSystems;if(e.indexOf("lhw.")!==-1)return o.LHW;if(e.indexOf("nh-hotels.")!==-1||e.indexOf(".nh-hoteles.")!==-1||e.indexOf("nh-collection.")!==-1)return o.NHHotels;if(e.indexOf(".h-hotels.")!==-1)return o.HHotels;if(e.indexOf(".1hotels.")!==-1)return o.OneHotels;if(e.indexOf(".asiwebres.")!==-1)return o.ASIWebRes;if(e.indexOf(".bwhhotelgroup.")!==-1)return o.BWHHotelGroup;if(e.indexOf(".frontdeskmaster.")!==-1)return o.FrontDeskMaster;if(e.indexOf(".evancy.")!==-1)return o.Evancy;if(e.indexOf(".brochner-hotels.")!==-1)return o.BrochnerHotels;if(e.indexOf(".welcome-anywhere.")!==-1)return o.RoomMaster;if(e.indexOf("staybloom.")!==-1)return o.Bloom;if(e.indexOf(".keahotels.")!==-1)return o.KeaHotels;if(e.indexOf("westcordhotels.")!==-1)return o.WestCordHotels;if(e.indexOf(".lumahotels.")!==-1)return o.LumaHotels;if(e.indexOf(".reservation-system.")!==-1||e.indexOf(".allhandsmarketing.")!==-1)return o.Pelican;if(e.indexOf(".pointahotels.")!==-1)return o.PointAHotels;if(e.indexOf(".hoteliers.guru")!==-1)return o.HoteliersGuru;if(e.indexOf(".reseze.")!==-1)return o.Reseze;if(e.indexOf(".aboveproperty.")!==-1)return o.AboveProperty;if(e.indexOf(".superghs.")!==-1)return o.GHS;if(e.indexOf(".rguest.")!==-1)return o.RGuest;if(e.indexOf(".ayana.")!==-1)return o.Ayana;if(e.indexOf("erez.")!==-1)return o.Erez;if(e.indexOf(".valamar.")!==-1)return o.Valamar;if(e.indexOf(".stayntouch.")!==-1)return o.Stayntouch;if(e.indexOf("resnexus.com")!==-1)return o.ResNexus;if(e.indexOf(".namastay.io")!==-1)return o.Namastay;if(e.indexOf("guestrez.")!==-1)return o.GuestRez;if(e.indexOf(".phobs.")!==-1)return o.Phobs;if(e.indexOf(".staah.")!==-1||e.indexOf(".swiftbook.")!==-1)return o.Staah;if(e.indexOf(".hamiltonisland.")!==-1||e.indexOf(".qualia.")!==-1)return o.HamiltonIsland;if(e.indexOf(".hamiltonislandholidayhomes.")!==-1)return o.HamiltonIslandHolidayHomes;if(r.indexOf("luxguests")!==-1)return o.Luxscapia;if(r.indexOf(".thinkreservations.")!==-1)return o.ThinkReservations;if(r.indexOf(".witbooking.")!==-1)return o.Witbooking;if(r.indexOf(".onejourney.")!==-1)return o.Journey;if(r.indexOf(".resontheweb.")!==-1)return o.ResOnTheWeb;if(e.indexOf(".bookoloengine.")!==-1)return o.Bookolo;if(e.indexOf(".openhotel.")!==-1)return o.OpenHotel;if(e.indexOf(".revenatium.")!==-1)return o.Revenatium;if(e.indexOf(".millenniumhotels.")!==-1)return o.MillenniumHotels;if(e.indexOf(".hotelkeyapp.")!==-1)return o.HotelKeyApp;if(e.indexOf(".omegahotelmanagement.")!==-1)return o.OmegaHotelManagement;if(e.indexOf(".panhospitality.")!==-1)return o.PanHospitality;if(e.indexOf(".skywaresystems.")!==-1)return o.Skyware;if(e.indexOf("honeycomb.rt.triptease.io")!==-1||e.indexOf("b.triptease.io")!==-1)return o.Retargeting}function $l(t){var e,r;if(t.document.querySelector('link[href*="synxis.com"]'))return o.Synxis;if(p(()=>Object.values(t.process.env).some(n=>p(()=>String(n).includes("synxis")))))return o.Synxis;if(p(()=>Object.keys(t).filter(i=>i.endsWith("Url")).map(i=>t[i]).some(i=>String(i).includes("travelclick.com")))||p(()=>!!Ms(t.dataLayer,"ihHotelID"),!1))return o.TravelClick;if(p(()=>t.document.querySelector('link[href*="vendors~about~booking~cancellation~checkout~confirmation~contact~policies~reservation"]'))||p(()=>t.dataLayer.find(n=>n.property_siteminder_property_id||n.booking_engine==="Modern"||n.tbb_prefix||n.virtual_url))||p(()=>t.document.querySelector('meta[name="occupancy-includes-infants"]'))||p(()=>!!t.digitalPartner.triptease))return o.SiteMinder;if(p(()=>t.dataLayer.some(n=>n.neobookings),!1))return o.NeoBookings;if(p(()=>Ms(t.dataLayer,"context.application")==="smart",!1))return o.AvailPro;if(t.document.querySelector("iframe.mews-distributor"))return o.Mews;if(t.WSMAIN||t.WsVars)return o.Shr;if(p(()=>t.document.querySelector("#clienId"),void 0))return o.RMSCloud;if(t.document.getElementById("bookingGadget")!==null)return o.GuestCentric;if(Boolean(t.document.querySelector('script[src*="UiBSJs"]')))return o.Uibscrs;if(p(()=>Boolean(t.Mirai),!1))return o.Mirai;if(t.MAIN_SITE==="paraty"||t.document.querySelector(".paraty-booking-form")||t.document.querySelector('img[src*=".paraty."]'))return o.Paraty;if(!!t.document.querySelector('[href^="https://www.booking2hotels.com"]')||t.document.querySelector('.booking-engine img[src*="booking2hotels"]'))return o.Booking2Hotels;if(t.document.querySelector('script[src*="seekda"]'))return o.Seekda;if(t.document.querySelector('meta[name="author"][content*="alaric"], [href*="alaric."]'))return o.Alaric;if(p(()=>t.document.cookie.split(/[=; ]/).find(n=>n==="alrcBasicToken")))return o.Alaric;if(p(()=>t.document.querySelector('meta[name="description"]').content.indexOf("reztrip")!==-1,!1))return o.Reztrip;if(p(()=>!!t.PROTELWBE5,!1))return o.Protel;if(p(()=>t.document.querySelector('link[href*="/bookvisit/"], meta[content*=".bookvisit."]')))return o.BookVisit;if(p(()=>t.document.querySelector('link[href*="webhotelier.net"]')))return o.ReserveOnline;if(p(()=>t.document.querySelector("#availpro-tracker")))return o.AvailPro;if(p(()=>t.document.querySelector("meta[name=Author][content*=RESERVIT]")))return o.Reservit;if(p(()=>t.document.querySelector("#eZee_BookingContainer, #eZee_BookingHeader, #eZee_BookingFilter, #eZ_BookingRooms")))return o.Ezee;if(p(()=>t.document.querySelector("img[src*=hotetec],a[href*=hotetec]")))return o.Hotetec;if(p(()=>t.document.querySelector("link[href*=cityexpress]")))return o.CityExpress;if(p(()=>t.document.querySelector("link[href*=travelanium]")||t.document.querySelector("input#ibe-base-url")))return o.Travelanium;if(p(()=>t.document.querySelector('a[href*=".e-gds."],img[src*=".e-gds."]')))return o.EGds;if(p(()=>t.document.querySelector('img[src*=".pegsbe."],img[src*=".bookingdirect."]')))return o.Pegasus;if(p(()=>t.document.querySelector("a[href*=verticalbooking], a[href*=VerticalBooking], script[src*=verticalbooking]"))||p(()=>typeof t.b_params.booking_engine_default_url=="string"))return o.VerticalBooking;if(p(()=>t.document.querySelector("guestdesk")))return o.GuestDesk;if(t.document.querySelector("img[src*=booking-channel],div[style*=booking-channel]"))return o.Hotusa;if(t.document.querySelector('img[src*=".asiwebres."]'))return o.ASIWebRes;if(t.document.querySelector("[class*=azds-booking]"))return o.AZDS;if(t.document.querySelector('[href*="compurez"]')||p(()=>t.document.querySelector("#footer").textContent.includes("CompuRez")))return o.CompuRez;if(t.document.querySelector('img[src*=".roommaster."],div[style*=".roommaster."]'))return o.RoomMaster;if(t.document.querySelector("[ng-app=PelicanApp]")||p(()=>t.myApp.name)==="PelicanApp")return o.Pelican;if(t.document.querySelector('#avvio, [href*="avvio.com"], [src*="avvio.com"]'))return o.Avvio;if(t.document.querySelector('[src*=".shrglobal."],[href*=".shrglobal."]'))return o.Shr;if(t.document.querySelector('[href*=".infotera."]'))return o.Infotera;if(t.document.querySelector('img[src*=".hoteliers.guru"]'))return o.HoteliersGuru;if(p(()=>typeof t.iBooking.hotel_alias=="string"))return o.GHS;if(t.document.querySelector('[src*=".omnibees."]'))return o.Omnibees;if(t.document.querySelector('[src*=".roomstay."],[href*=".roomstay."],[id*=roomstay-],[name*=roomstay-]'))return o.RoomStay;if(t.document.querySelector('[src*=".guestpro."],[href*="guestpro."]'))return o.GuestPro;if(p(()=>t.BookingEngine.SiteSettings.ApiUri,"").includes(".frontdeskmaster."))return o.FrontDeskMaster;if(t.location.host.indexOf(".opalcollection.")!==-1||typeof t.showOpalKeyPolicy=="function")return o.Sandrix;if(t.document.querySelector('[id^=erez],img[src*="erez."]'))return o.Erez;if(t.document.querySelector('ibe-up,[src*="ibe.uphotel.agency"]'))return o.Up;if(t.document.querySelector('img[src*=".profitroom."],[src*="upperbooking."]'))return o.ProfitRoom;if(p(()=>t.rt4Datalayer.ArrivalDtYYYYMMDD))return o.Pegasus;if(t.document.querySelector('[src*=".neobookings."]'))return o.NeoBookings;if(t.document.querySelector('a[href*="roomsome.hu"]'))return o.RoomSome;if(t.document.querySelector('[src*=".phobs."]'))return o.Phobs;if(t.document.querySelector('link[href*=".selfbook."]'))return o.Selfbook;if(t.document.querySelector("#PSBookEngine"))return o.Prestige;if(t.clockPmsWbePageViewCallback||t.document.querySelector('[src*=".clock-software."]'))return o.Clock;if(p(()=>{var n;return JSON.parse((n=t.sessionStorage.getItem("bookingengine"))!=null?n:"").session.chainData.booking_engine_configuration}))return o.Dingus;if(t.document.querySelector('link[href*="/luxscapia/"]'))return o.Luxscapia;if(t.document.querySelector('link[href*=".skipperhospitality."]'))return o.Skipper;if(!!((e=t.d21)==null?void 0:e.host)||!!((r=t.d21)==null?void 0:r.currentChannel))return o.Dirs21;if(p(()=>t.jsConfig.clientId))return o.Planet;if(t.document.querySelector('[href*="witbooking."]')||p(()=>t.wit_IntegrationId))return o.Witbooking;if(t.document.querySelector('a[href*=".p3hotels."]')||t.document.querySelector('script[src*="p3core"]'))return o.P3;if(p(()=>t.InntopiaManager))return o.Inntopia;if(t.document.querySelector('[href*=".netaffinity."]'))return o.NetAffinity;if(t.document.querySelector('a[href*=".atlantis.asia"]'))return o.AtlantisORS;if(t.document.querySelector('iframe[src*=".bookoloengine."]'))return o.Bookolo;if(t.document.querySelector('script[src*="res-online."]'))return o.HotelPartner;if(t.document.querySelector('script[src*=".hopenapi."]'))return o.Exely;if(p(()=>!!t.STAAHBookingTracker)||t.document.querySelector('img[src*=".staah."]'))return o.Staah;if(p(()=>t.__NEXT_DATA__.props.pageProps.siteConfig.publicPath.includes(".revenatium.")))return o.Revenatium;if(t.document.querySelector('img[src*="hsprez."],img[src*="hsp-rez."]'))return o.HspRez;if(t.document.querySelector('[src*="newbook."]'))return o.Newbook;if(t.document.querySelector('img[src*="b.triptease.io/assets"]'))return o.Retargeting}function Jl(t){let e=p(()=>new P(t.location.href).host.toLowerCase(),"");if(e.indexOf("constancehotels.com")!==-1)return o.ConstanceHotels;if(e.indexOf("vacationmarbella.")!==-1)return o.VacationMarbella;if(t.document.querySelector("[src*=life-house],[href*=life-house]"))return o.LifeHouse;if(e.indexOf("cocotel.")!==-1)return o.Cocotel;if(t.document.querySelector('[href*=".latourhotelsandresorts."]')||["parkplazaresort.","cabinsatgreenmountain.","atlanticbeachresortnc.","sandpebblebeachclub."].find(r=>e.indexOf(r)!==-1))return o.LatourHotelsAndResorts;if(e.indexOf(".seamillhydro.")!==-1)return o.SeamillHydro;if(e.indexOf(".inkaterra.")!==-1)return o.Inkaterra;if(e.indexOf("reservationresources.")!==-1)return o.ReservationResources;if(e.indexOf(".mcdreamshotels.")!==-1)return o.McDreams;if(e.indexOf(".minorhotels.")!==-1)return o.MinorHotels;if(e.indexOf(".hiusa.")!==-1)return o.HiUsa;if(e.indexOf(".thebetsyhotel.")!==-1)return o.Betsy;if(e.indexOf(".centerhotels.")!==-1)return o.CenterHotels;if(e.indexOf(".clinkhostels.")!==-1)return o.Clink;if(e.indexOf(".jazhotels.")!==-1)return o.JazHotels;if(e.indexOf("sweett.")!==-1)return o.Sweett;if(e.indexOf(".mgmresorts.")!==-1||e.indexOf(".devtest.vegas")!==-1)return o.MgmResorts;if(t.document.querySelector('[href*=".kerzner"],[src*=".kerzner"]'))return o.Kerzner;if(e.indexOf(".gemhotels.")!==-1)return o.GemHotels;if(e.indexOf(".motel-one.")!==-1)return o.MotelOne}function Yl(t){let e=t.querySelector('script[src*="static.triptease.io/client-integrations/"]');if(!e)return;let[,r]=p(()=>e.src.match(/\/([^/]+).js$/))||[];if(!!r)return p(()=>o.parse(r))}function Zl(t){return p(()=>{let r=t.document.querySelector('script[src*="onboard.triptease.io/bootstrap.js"]').src.match(/fallback=([a-zA-Z]+)/)[1];return o.parse(r)})}function Ql(t){let e=p(()=>new P(t.location.href).host.toLowerCase(),""),r=t.location.href.toString().toLowerCase();if(e.indexOf(".bachmann-hotels.")!==-1&&r.indexOf("confirmation")!==-1)return o.Protel;if(e.indexOf("aubergeresorts.")!==-1&&e.indexOf("reserve.aubergeresorts.")===-1)return o.Auberge;if(e.indexOf(".fullertonhotels.")!==-1)return o.FullertonHotels}function Hs(t){return p(()=>Pn(new P(t.location.href)))||p(()=>$l(t))||p(()=>Jl(t))||Yl(t.document)||Zl(t)||Ql(t)||o.Default}var hr=class{constructor(e,r,n=y("messaging")){this.listen=e;this.router=r;this.logger=n;this.rules=[];e.addListener(this.handler.bind(this)),this.addRule(wn,i=>i,i=>i),this.addRule(ed,rd,Ds)}registerAlias(e,r){if(!this.router.hasHandlerFor(r))throw new Error(`Illegal alias: Method "${r}" is not registered with router`);return this.addRule(Xl(e),td(r),Ds)}handler(e,r){return u(this,null,function*(){if(dr(e))return;this.logger.debug("listenOn received request",e);let n=this.rules.find(a=>a.predicate(e));if(!n)return;let i=n.requestConverter(e),s=yield this.router.handle(i);if(hs(s)){this.logger.debug(`Handler not found for request "${i.requestType}", potentially for another listener`);return}e.correlationId&&e.correlationId===s.correlationId&&(this.logger.debug("listenOn sending response to sender",s),r.send(n.responseConverter(s)))})}addRule(e,r,n){return this.rules.push({predicate:e,requestConverter:r,responseConverter:n}),this}};function Xl(t){return e=>e.type===t}function ed(t){return!wn(t)&&!!t.correlationId}function td(t){return e=>({type:"triptease.onboard.request",requestType:String(t),payload:[e],correlationId:e.correlationId||"fire-and-forget"})}function rd(t){let{value:e,correlationId:r}=t,{method:n}=fn(t.type);return{type:"triptease.onboard.request",requestType:n,payload:[e],correlationId:r}}function Ds(t){return{type:"triptease.onboard.response",correlationId:t.correlationId,value:t.payload}}var bt=class{static find(e){return this.scripts(e).map(r=>new P(r.src))}static scripts(e){let n=["bootstrap.js","/paperboy/","/identity-service/confirm"].map(s=>`script[src*="${s}"][src*="triptease.io"]`);n.push('script[src*="triptease.net"]');let i=n.join(", ");return e.querySelectorAll(i)}};var br=class{static difference(e,r){return Array.from(e).reduce((n,i)=>r.has(i)?n:n.add(i),new Set)}};var vt=y("events"),En=class{constructor(e,r){this.timers=e;this.handle=r;this.finders=new Set;this.keepers=new Set;this.handleEvent=e=>u(this,null,function*(){try{vt.debug("CreatedOrDeletedEvents: Checking for new created items");let r=new Set(Array.from(this.finders).flatMap(s=>s())),n=br.difference(r,this.keepers),i=br.difference(this.keepers,r);this.keepers=r,(n.size>0||i.size>0)&&(vt.log(`CreatedOrDeletedEvents: ${n.size} created, ${i.size} deleted element detected - firing event`),yield this.handle(e))}catch(r){vt.error("CreatedOrDeletedEvents.handleEvent threw while polling",r)}})}start(){return u(this,null,function*(){vt.log("Start polling for created items"),this.id=this.timers.setInterval(this.handleEvent,1e3)})}stop(){return u(this,null,function*(){vt.log("Stop polling for created items"),this.id&&(this.timers.clearInterval(this.id),this.id=void 0)})}watch(e){e().forEach(n=>this.keepers.add(n)),this.finders.add(e)}};function Ls(t,e){return()=>Array.from(t.querySelectorAll(e))}var nd=y("events"),In=class{constructor(e,r){this.window=e;this.delegate=r;this.first=!0;this.fire=e=>u(this,null,function*(){if(this.window.document.hidden&&!this.first){nd.log("Document hidden - skipping",e);return}yield this.delegate.fire(e),this.first=!1})}listen(e){return u(this,null,function*(){yield this.delegate.listen(e)})}removeListener(e){this.delegate.removeListener(e)}};var Rn=y("events"),_n=class{constructor(e,r){this.delegate=e;this.running=r;this.fire=e=>u(this,null,function*(){if(this.running.value){Rn.log("Already running - skipping",e);return}this.running.value=!0,yield this.delegate.fire(e),this.running.value=!1})}listen(e){return u(this,null,function*(){if(yield this.delegate.listen(e),this.running.value){Rn.log("Already running - firing immediately");try{yield e()}catch(r){Rn.log(r)}}})}removeListener(e){this.delegate.removeListener(e)}};var qs=y("events"),Mn=class{constructor(){this.handlers=[];this.fire=e=>u(this,null,function*(){qs.log(`Firing handlers(${this.handlers.length})`,e),yield Promise.all(this.handlers.map(r=>u(this,null,function*(){try{yield r()}catch(n){qs.log("Error while firing handler",n)}})))})}listen(e){return u(this,null,function*(){this.handlers.push(e)})}removeListener(e){this.handlers=this.handlers.filter(r=>r!==e)}};var js=y("events"),Hn=class{constructor(e,r){this.timers=e;this.delegate=r;this.timeoutMs=1e3;this.timerId=0;this.fire=e=>u(this,null,function*(){js.log(`Event observed, waiting for ${this.timeoutMs} ms quiet`,e),this.timers.clearInterval(this.timerId),this.timerId=this.timers.setTimeout(()=>u(this,null,function*(){js.log("Event quiet period ended, firing event",e),yield this.delegate(e)}),this.timeoutMs)})}};var id=y("events"),Dn=class{constructor(e,r,n=.2,i=new W){this.handle=e;this.running=r;this.idleThreshold=n;this.timers=i;this.lastState=!1;this.busy=!1;this.average=new xt;this.idleHandler=e=>{let r=e.timeRemaining();this.running.value?this.busy=!1:r===0?this.busy=!0:(this.average=this.average.calculate(r),this.busy=this.average.percentage<-this.idleThreshold),this.busy?this.idleId=void 0:this.idleId=this.timers.requestIdleCallback(this.idleHandler,r===0?void 0:{timeout:r})};this.intervalHandler=()=>u(this,null,function*(){this.stateHasChanged()&&this.isIdle()&&(id.log("Browser idle"),yield this.handle("Idle")),this.average=new xt,this.lastState=this.busy,this.idleId||(this.idleId=this.timers.requestIdleCallback(this.idleHandler))})}start(){return u(this,null,function*(){this.intervalId=this.timers.setInterval(this.intervalHandler,1e3),this.idleId=this.timers.requestIdleCallback(this.idleHandler)})}stop(){return u(this,null,function*(){this.intervalId&&this.timers.clearInterval(this.intervalId),this.idleId&&this.timers.cancelIdleCallback(this.idleId)})}isIdle(){return!this.busy}stateHasChanged(){return this.lastState!==this.busy}},xt=class{constructor(e=0,r=0,n=0,i=0){this.value=e;this.count=r;this.difference=n;this.percentage=i}calculate(e){let r=this.count+1,n=e-this.value,i=n/this.value,s=this.value+n/r;return new xt(s,r,n,i)}};var Ln=class{constructor(e,r){this.window=e;this.handle=r}start(){return u(this,null,function*(){this.window.addEventListener("visibilitychange",this.handle),this.window.addEventListener("popstate",this.handle),this.window.addEventListener("hashchange",this.handle),this.window.addEventListener("pageshow",this.handle),this.window.addEventListener("pagehide",this.handle),this.window.document.readyState!=="complete"?this.window.document.addEventListener("DOMContentLoaded",this.handle):yield this.handle("Document already loaded")})}stop(){return u(this,null,function*(){this.window.removeEventListener("visibilitychange",this.handle),this.window.removeEventListener("popstate",this.handle),this.window.removeEventListener("hashchange",this.handle),this.window.removeEventListener("pageshow",this.handle),this.window.removeEventListener("pagehide",this.handle),this.window.document.removeEventListener("DOMContentLoaded",this.handle)})}};var qn=class{constructor(){this.value=!1}};var Us=class{constructor(e,r=new W){this.window=e;let n=new qn;this.sink=new In(e,new _n(new Mn,n)),this.fire=new Hn(r,this.sink.fire).fire,this.mutation=new St(this.fire),this.created=new En(r,this.fire),this.sources=[new Dn(this.fire,n),this.mutation,this.created,new Ln(e,this.fire)]}watch(e){this.created.watch(e)}listen(e){return u(this,null,function*(){yield this.sink.listen(e)})}start(){return u(this,null,function*(){yield Promise.all(this.sources.map(e=>e.start()))})}stop(){return u(this,null,function*(){this.sources.forEach(e=>e.stop())})}removeListener(e){this.sink.removeListener(e)}};function vr(t){let e=T(t).triptease;return e.events=e.events||new Us(t)}var od={characterData:!0,attributes:!0,childList:!0},St=class{constructor(e){this.handle=e;this.observer=new MutationObserver(this.handle)}start(){return u(this,null,function*(){})}stop(){return u(this,null,function*(){this.observer.disconnect()})}static observe(e,r=od){if(!("MutationObserver"in D))return e;let n=vr(D).mutation;return e instanceof HTMLInputElement||e instanceof HTMLSelectElement?e.addEventListener("change",n.handle):n.observer.observe(e,r),e}};function jn(t,e=D){return p(()=>vr(e).watch(Ls(e.document,t))),t}var Un=class{constructor(e){this.parent=e}querySelector(e,r){let n=this.parent.querySelector(e);return n||void 0}querySelectorAll(e,r){return Array.from(this.parent.querySelectorAll(e))}},Bn=class{constructor(e){this.parent=e}querySelector(e,r){var i;jn(e,(i=this.parent.ownerDocument)==null?void 0:i.defaultView);let n=this.parent.querySelector(e);return n?St.observe(n,r):void 0}querySelectorAll(e,r){var n;return jn(e,(n=this.parent.ownerDocument)==null?void 0:n.defaultView),Array.from(this.parent.querySelectorAll(e)).map(i=>St.observe(i,r)).filter(Boolean)}};function xr(t){let e=or(t,"triptease-applications")||"auto";return p(()=>{let[r]=bt.find(new Un(t.document)),{applications:n}=B(r.query);return n},e).toLowerCase()}var wt=class{constructor(e,r,n){this.window=e;this.messageBatcher=r;this.messageBuilder=n}static create(e,r,n){var s;let i=T(e).onboard;return i.trackingApi=(s=i.trackingApi)!=null?s:new wt(e,r,n)}get isEnabled(){return xr(this.window)!=="none"}trackConfig(e){return u(this,null,function*(){!this.isEnabled||p(()=>e.payload.type===F.Payment)||(yield this.messageBatcher.send(m.removeEmpty(e)))})}trackEvent(e){return u(this,null,function*(){!this.isEnabled||(yield this.messageBatcher.send(e))})}trackError(e){return u(this,null,function*(){yield this.trackLog({context:{app:yt},payload:e,errorType:ft(e)?"exception":"console",level:"error"})})}trackMessage(e){return u(this,null,function*(){yield this.trackLog({context:{app:yt},payload:e,level:"info"})})}trackLog(e){return u(this,null,function*(){!this.isEnabled||(yield this.messageBatcher.send(yield this.messageBuilder.buildMessage(M(S({},e),{type:fr.Log}))))})}};var kt=class{constructor(e,r,n,i=ve.create(e),s=y("integration-executor")){this.window=e;this.kernel=r;this.consent=n;this.starter=i;this.logger=s;s.debug("DefaultApplicationLoader constructor called")}loadApplications(e){return u(this,null,function*(){var f;let r=xr(this.window);if(r==="none"||r==="tracking")return this.logger.log(`applications set to "${r}", skipping loading`),{};let{integrationId:n,clientKey:i,apiKey:s}=e,{applications:a}=(f=sd(yield this.kernel.applicationConfig({integrationId:n,clientKey:i,apiKey:s,includeDisabled:!0})))!=null?f:{applications:[]},l=this.filterApplications(r,a);return(yield Promise.all(l.map(g=>u(this,null,function*(){let C=this.consent.for(g);try{if(Zo(g)&&g.enabled&&C==="Granted")return yield this.starter.start(g),M(S({},g),{started:!0,consent:C})}catch(v){return M(S({},g),{started:!1,consent:C,error:v.message})}return M(S({},g),{consent:C})})))).reduce((g,C)=>(g[C.name]=m.removeEmpty({enabled:C.enabled,started:C.started,consent:C.consent,error:C.error}),g),{})})}filterApplications(e,r){return e==="auto"?r:r.filter(n=>n.name.toLowerCase()===e)}static create(e,r,n){var s;let i=T(e).triptease.onboard;return i.applicationLoader=(s=i.applicationLoader)!=null?s:new kt(e,r,n)}};function sd(t){if(!!t)return{applications:t.applications.map(e=>e.name!=="Audiences"?e:M(S({},e),{enabled:e.enabled||t.applications.some(r=>["Meta","PaidSearch"].includes(r.name)&&r.enabled)}))}}var va=I(ye());function Sr(t){return t&&p(()=>t instanceof HTMLAnchorElement,t.tagName==="A")}var Bs=I(rn()),Gs=I(lt());function Gn(t){var e;return((e=t.host)==null?void 0:e.split("."))||[]}function wr(t,e){let r=Gn(t).reverse(),n=Gn(e).reverse(),i=0;for(let[s,a]of(0,Bs.array)(r,(0,Gs.zip)(n)))if(s===a)i++;else break;return i>=3?!0:i===2?[r[i],n[i]].filter(s=>![void 0,"www"].includes(s)).length<=1:!1}function Ws(t){let[e]=Gn(t);return e}var ad=new Set([void 0,o.Default]);function Fs(t){return!ad.has(Pn(t))}function Ks(t,e){if(t.host===e.host)return!1;let r=wr(t,e);return!!(!r&&Fs(e)||r&&cd(e))}function cd(t){let e=Ws(t);return e&&(e.includes("book")||e.includes("reservation"))}var ld=new Set(["book now","book","book room","book your stay","booking","check rates","check availability","cancel reservation","my reservations","reservations","reserve agora"]);function zs(t){return pd(t).some(e=>ld.has(e))}function dd(t,e){let r=new P(e.href);return!!(Ks(t,r)||zs(e))}function ud(t,e){let r=e.form;if(!r)return!1;let n=new P(e.formAction||e.getAttribute("formaction")||r.action);return!!(Ks(t,n)||zs(e))}function Vs(t,e){return Fs(t)?!1:Sr(e)?dd(t,e):ud(t,e)}function pd(t){return[t.innerText||t.textContent,t.value,t.title,t.getAttribute("alt")].filter(Boolean).map(e=>e.trim().toLowerCase())}function fd(t){var e,r;return(r=(e=t.innerText)!=null?e:t.textContent)==null?void 0:r.trim()}function Ns(t){var e;return m.removeEmpty({element:t.tagName.toLowerCase(),classes:Array.from(t.classList),id:t.id,target:t.target.trim(),url:t.href.trim(),urlParsed:J(t.href),text:fd(t),title:t.title.trim(),alt:(e=t.getAttribute("alt"))==null?void 0:e.trim(),rel:Array.from(t.relList)})}function $s(t){var r,n;let{text:e=""}=(r=t==null?void 0:t.click)!=null?r:{};return!(e.length<4||(t==null?void 0:t.integrationName)!==o.Default.canonical||!((n=t==null?void 0:t.language)==null?void 0:n.startsWith("en")))}var md=y("click-tracking"),Wn=class{constructor(e,r){this.window=e;this.bootstrap=r;this.clickHandler=e=>u(this,null,function*(){try{let r=e.target;if(Sr(r)){let n=new P(this.window.location.href),i=new P(r.href);if(i.scheme==="javascript"||i.scheme==="about")return;let s=T(this.window).triptease.config,a={integrationId:s==null?void 0:s.integrationId,integrationName:s==null?void 0:s.integrationName,clientKey:s==null?void 0:s.clientKey,clientName:s==null?void 0:s.clientName,apiKey:s==null?void 0:s.apiKey,hotelName:s==null?void 0:s.hotelName,language:s==null?void 0:s.language,click:Ns(r)};i.scheme==="tel"?yield this.fireClickEvent("user_clicked_phone-number",a):i.scheme==="mailto"?yield this.fireClickEvent("user_clicked_email-address",a):Vs(n,r)?yield this.fireClickEvent("user_clicked_booking-engine-link",a):r.href&&!wr(n,i)?yield this.fireClickEvent("user_clicked_outbound-link",a):$s(a)&&(yield this.fireClickEvent("user_clicked_link",a))}}catch(r){md.error("clickHandler: Error ",r)}})}start(){this.window.addEventListener("click",this.clickHandler,{capture:!0,passive:!0})}stop(){this.window.removeEventListener("click",this.clickHandler)}fireClickEvent(e,r){return u(this,null,function*(){yield this.bootstrap.processEvent(m.removeEmpty({type:"triptease.event",event:e,payload:r}))})}};function Js(t){switch(t){case"essential":case"necessary":return"essential";case"functionality":case"personalisation":case"preferences":return"functionality";case"performance":case"statistics":case"analytics":return"performance";case"marketing":case"advertising":return"marketing"}}var Fn=class{constructor(e){this.window=e}find(){let e=["necessary","preferences","statistics","marketing"].map(r=>p(()=>this.window.Cookiebot.consent[r])?Js(r):void 0).filter(Boolean);if(e.length>0)return{type:"cmp",source:ee.cookieBot,values:e}}};var Ys=new Set(["all"]);function Zs(t){let e=new Set(t.filter(Boolean));return e.size===0||e.has("all")?Ys:(e.has("none")&&e.size!==1&&e.delete("none"),e.has("auto")&&e.size!==1&&e.delete("auto"),e)}var gd=new Map([["ad_storage",["marketing"]],["ad_user_data",["marketing"]],["ad_personalization",["marketing","functionality"]],["analytics_storage",["performance"]],["functionality_storage",["functionality"]],["personalization_storage",["functionality"]],["security_storage",["essential"]]]),Kn=class{constructor(e){this.window=e}find(){if(Array.isArray(this.window.dataLayer)){let e=this.window.dataLayer.filter(a=>a[0]==="consent"&&a[1]==="default").reduce((a,l)=>S(S({},a),l[2]),{}),r=this.window.dataLayer.filter(a=>a[0]==="consent"&&a[1]==="update").reduce((a,l)=>S(S({},a),l[2]),e),i=Object.entries(r).filter(([a,l])=>l==="granted").map(([a])=>a).reduce((a,l)=>{let d=gd.get(l)||[];return[...a,...d]},[]),s=k.unique(i);if(s.length>0)return{type:"cmp",source:ee.google,values:s};if(s.length===0&&Object.keys(r).length>0)return{type:"cmp",source:ee.google,values:["none"]}}}};var yd={app_basics:"essential",app_preference:"functionality",app_analytics:"performance",app_marketing:"marketing"},zn=class{constructor(e){this.window=e}find(){let{consents:e}=p(()=>this.window.klaro.getManager(),{consents:{}}),r=Object.entries(yd).reduce((n,[i,s])=>e[i]?[...n,s]:n,[]);if(r.length>0)return{type:"cmp",source:ee.klaro,values:r}}};var Ct=class{constructor(e,r,n){this.window=e;this.key=r;this.parser=n}values(){return this.scripts().map(r=>r.dataset[this.key]).filter(Boolean).flatMap(r=>r.split(/\s*,\s*/g).map(n=>this.parser.parse(n))).filter(r=>!!r)}scripts(){let e=bt.scripts(new Bn(this.window.document)),r=e.filter(n=>!n.src.includes("partner="));return r.length>0?r:e}};var Vn=class{constructor(e){this.lookup=e.reduce((r,n)=>r.set(n,n),new Map)}parse(e){if(!!e)return this.lookup.get(e.toLowerCase().trim())}},Nn=class extends Vn{constructor(){super(["none","first-party","third-party","all"])}},$n=class extends Vn{constructor(){super(["none","essential","functionality","performance","marketing","all","auto"])}};var hd=y("consent"),Qs=class extends Ct{constructor(e){super(e,"storageConsent",new $n)}find(){let e=this.values();if(e.length>0)return{type:"script",source:"script",values:e}}},Jn=class{constructor(e,r=[new Qs(e),new Fn(e),new zn(e),new Kn(e)]){this.finders=r}find(){return this.allConsents.overall}findAll(){return this.allConsents}get allConsents(){let e=this.finders.map(n=>n.find()).filter(Boolean);hd.log("individual consents",e);let r=this.getOverallConsent(e);return[...e,r].reduce((n,i)=>{let s=i.type==="overall"?i.type:i.source;return n[s]=i,n},{})}getOverallConsent(e){let r=e.find(i=>i.type==="script"),n=e.find(i=>i.type==="cmp"&&i.values.length>0);return r?r.values.includes("auto")?n?{type:"overall",source:n.source,values:this.cleaned(n.values)}:{type:"overall",source:ee.defaultAutoConsentMode,values:["none"]}:{type:"overall",source:r.source,values:this.cleaned(r.values)}:{type:"overall",source:ee.defaultNoConsentMode,values:["all"]}}cleaned(e){return Array.from(Zs(e))}};var At=I(N());var Yn=class extends Ct{constructor(e){super(e,"storage",new Nn)}find(){let e=this.values();if(e.length>0)return{values:e}}};var Zn=y("consent"),Ot=class{constructor(e,r){this.callbacks=new Set;this.set(e,r)}onChange(e){this.callbacks.add(e)}set(e,r){Zn.debug("Setting Consent and Storage");let n=this.consent,i=this.storage;if(this.consent=new Set(e),this.storage=new Set(r),!n||!i)return this.fireChanged();let s=!_.same(Array.from(n).sort(At.ascending),Array.from(this.consent).sort(At.ascending)),a=!_.same(Array.from(i).sort(At.ascending),Array.from(this.storage).sort(At.ascending));if(s||a)return Zn.debug("Consent / Storage has changed"),this.fireChanged()}fireChanged(){this.callbacks.forEach(e=>{try{e()}catch(r){Zn.error(r)}})}toArray(){return Array.from(this.consent)}get applications(){let e=this.consent.has("functionality"),r=this.consent.has("performance"),n=this.consent.has("marketing"),i=this.consent.has("all");return new Map([["Chat",e||i?"Granted":"Denied"],["CrossOriginTracking","Granted"],["GoogleAnalyticsPrototype",r||n||i?"Granted":"Denied"],["Messages",e||n||i?"Granted":"Denied"],["Meta",r||n||i?"Granted":"Denied"],["PaidSearch",r||n||i?"Granted":"Denied"],["Parity",e||r||n||i?"Granted":"Denied"],["Retargeting",n||i?"Granted":"Denied"],["Audiences",n||i?"Granted":"Denied"],["PaidSocial",n||i?"Granted":"Denied"]])}for(e){return this.consent.has("all")?"Granted":this.applications.get(e.name)||(e.type==="other"?"Granted":"Denied")}get firstPartyStorage(){return this.storage.size===0?["functionality","performance","marketing","all"].some(e=>this.consent.has(e)):["first-party","all"].some(e=>this.storage.has(e))}get thirdPartyStorage(){return this.storage.size===0?["functionality","performance","marketing","all"].some(e=>this.consent.has(e)):["third-party","all"].some(e=>this.storage.has(e))}static create(e){var s,a,l,d;let r=new Jn(e),n=new Yn(e),i=new Ot(((s=r.find())==null?void 0:s.values)||[],((a=n.find())==null?void 0:a.values)||[]);return(d=(l=T(e).triptease)==null?void 0:l.events)==null||d.listen(()=>u(this,null,function*(){var f,g;return i.set(((f=r.find())==null?void 0:f.values)||[],((g=n.find())==null?void 0:g.values)||[])})),i}};var ta=I(kr());var Tt=class{generate(e){return na(e)()}};function Qn(t){let e=new Error(t);return e.source="ulid",e}var Xn="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Pt=Xn.length,ra=Math.pow(2,48)-1,Cr=10;function bd(t){let e=Math.floor(t()*Pt);return e===Pt&&(e=Pt-1),Xn.charAt(e)}function vd(t,e){if(isNaN(t))throw new Error(t+" must be a number");if(t>ra)throw Qn("cannot encode time greater than "+ra);if(t<0)throw Qn("time must be positive");if(!Number.isInteger(t))throw Qn("time must be an integer");let r,n="";for(;e>0;e--)r=t%Pt,n=Xn.charAt(r)+n,t=(t-r)/Pt;return n}function xd(t,e){let r="";for(;t>0;t--)r=bd(e)+r;return r}var Sd=D;function wd(t=Sd.crypto){return()=>{try{let e=new Uint8Array(1);return t.getRandomValues(e),e[0]/255}catch(e){return Math.random()}}}function kd(t){if(tp(()=>e.getAnonymousIds(),[])))))})}setAnonymousId(e){return u(this,null,function*(){yield Promise.all(this.providers.map(r=>p(()=>r.setAnonymousId(e))))})}syncAnonymousIds(e){return u(this,null,function*(){return k.unique(k.flatten(yield Promise.all(this.providers.map(r=>p(()=>r.syncAnonymousIds(e),[])))))})}};var ia="triptease-anonymous-id",It=class{constructor(e){this.storage=e}getAnonymousIds(){return u(this,null,function*(){return this.get()})}setAnonymousId(e){return u(this,null,function*(){this.syncAnonymousIds([e])})}get(){let e=this.storage.get(ia);return e?Array.isArray(e)?e.flat():[e]:[]}syncAnonymousIds(e){return u(this,null,function*(){let r=this.get(),n=k.unique([...r,...e].flat());return this.storage.set(ia,n),n})}};var Ze=class{constructor(e){this.storage=e}get(e){let r=this.storage.getItem(e);if(r)return q.parseWithDates(r)}set(e,r){return this.storage.setItem(e,JSON.stringify(r)),this}clear(){this.storage.clear()}},Rt=class{constructor(){this.data=new Map}get(e){return this.data.get(e)}set(e,r){return this.data.set(e,r)}clear(){this.data.clear()}},ei=class{constructor(e){this.stores=e}clear(){this.stores.forEach(e=>p(()=>e.clear()))}get(e){for(let r of this.stores){let n=p(()=>r.get(e));if(n)return n}}set(e,r){return this.stores.forEach(n=>p(()=>n.set(e,r))),this}};var _t=I(Ge()),oa=I(ye()),sa=I(kr());var ti=class{static add(e,r){let n=new Date(e.getTime());return n.setUTCDate(e.getUTCDate()+r),n}};ti.milliseconds=24*60*60*1e3;function*Ad(t,e){for(;t>=e;)yield t%e,t=Math.floor(t/e);yield t}function ri(t,e){return Array.from(t).reduce((r,n,i)=>r+fi(e,i)*n,0)}function*Od(t,e){for(let r of Pd(t,e))yield ri(r,2)}function*Td(t,e){for(let r of t)for(let n=0;n0&&(yield r)}function*Ed(t){let e=t.BYTES_PER_ELEMENT*8;for(let r of t)for(let n=0;nthis.digits[r]).join("")}get lookup(){return[...this.digits].reduce((e,r,n)=>e.set(r,n),new Map)}decodeInteger(e){return ri(this.decode(e),this.base)}decodeBits(e){return Td(this.decode(e),this.bitsPerCharacter)}decode(e){return[...e].map(r=>this.lookup.get(r))}};A([_t.lazy],Qe.prototype,"base",1),A([_t.lazy],Qe.prototype,"bitsPerCharacter",1),A([_t.lazy],Qe.prototype,"lookup",1);var Se=new Qe("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),Id=new Qe("0123456789ABCDEF"),ca=class{static get detect(){try{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256?"LittleEndian":"BigEndian"}catch(e){return"Unknown"}}};A([_t.lazy],ca,"detect",1);var V=class{constructor(e,r){this.timestamp=e;this.entropy=r;if(r.length%Se.bitsPerCharacter!=0)throw Error(`entropy bit length must be a multiple of ${Se.bitsPerCharacter}`)}toString(){let e=Or(Se.encodeInteger(this.timestamp.getTime())).padStart(V.TIMESTAMP_LENGTH,"0"),r=Or(Se.encodeBits(this.entropy));return e+r}static parse(e){if(!e)throw new Error("Invalid ULID");let r=e.slice(0,V.TIMESTAMP_LENGTH),n=e.slice(V.TIMESTAMP_LENGTH),i=Se.decodeInteger(Or(r));if(!dn.isNumber(i))throw new Error("Invalid ULID");let s=Se.decodeBits(Or(n)),a=new Date(i);return new V(a,Array.from(s))}static create(e=V.DEFAULT_LENGTH,r=la,n=new sa.SystemClock){if(eu(this,null,function*(){Xe.debug("TimeoutIdentityProvider delegate.syncAnonymousIds called",r);let n=yield this.delegate.syncAnonymousIds(e);return Xe.debug("TimeoutIdentityProvider delegate.syncAnonymousIds returned",n,r),n}))(),this.wait(r)])}getAnonymousIds(){let e=++this.raceCounter;return Promise.race([(()=>u(this,null,function*(){Xe.debug("TimeoutIdentityProvider delegate.getAnonymousIds called",e);let r=yield this.delegate.getAnonymousIds();return Xe.debug("TimeoutIdentityProvider delegate.getAnonymousIds returned",r,e),r}))(),this.wait(e)])}setAnonymousId(e){return u(this,null,function*(){Xe.debug("TimeoutIdentityProvider delegate.setAnonymousId called",e),this.delegate.setAnonymousId(e)})}wait(e){return u(this,null,function*(){return yield this.timers.delay(this.delay),Xe.debug(`TimeoutIdentityProvider waited for ${this.delay} ms`,e),[]})}};var ii=class{getAnonymousIds(){return u(this,null,function*(){return[]})}setAnonymousId(e){return u(this,null,function*(){})}syncAnonymousIds(e){return u(this,null,function*(){return e})}};function da(t){return t.opener&&t.opener!==t?new Mt(800,re(new pe(new $(t,t.opener,[])))):new ii}var Hd=y("identity"),oi=class{constructor(e,r=3){this.delegate=e;this.limit=r}getAnonymousIds(){return u(this,null,function*(){return yield this.delegate.getAnonymousIds()})}setAnonymousId(e){return this.delegate.setAnonymousId(e)}internalSync(e,r=0){return u(this,null,function*(){if(r>this.limit)return Hd.error(`SynchronisingProvider syncAnonymousIds attempted more than ${this.limit} times`),e;let n=k.unique(e),i=k.unique(yield this.delegate.syncAnonymousIds(n));return n.length!==i.length?this.internalSync(i,r+1):i})}syncAnonymousIds(e){return u(this,null,function*(){return this.internalSync(e)})}};var ua=I(kr());var pa=I(ye()),Tr=class{constructor(e,r=new ua.SystemClock,n=Ne({credentials:!0})){this.window=e;this.clock=r;this.httpClient=n}getQueryString(e,r){let n=`?userId=${e}`;return r?`${n}&sessionId=${r}`:n}getIdentityClientData(e,r){return u(this,null,function*(){let n=yield this.httpClient({url:`https://onboard.triptease.io/identity${this.getQueryString(e,r)}`,method:"GET"});if(n.status!==200)return{};let i=q.parseWithDates(n.body),s=p(()=>{let a=i.serverTime;return this.clock.now().getTime()-a.getTime()});return M(S({},i),{timeOffset:s})})}};A([pa.cache],Tr.prototype,"getIdentityClientData",1);var ai=I(si()),tt=class{constructor(e,r,n=new Tr(e),i=new Tt){this.window=e;this.consent=r;this.identityClient=n;this.idGenerator=i}getIdentity(e){return u(this,null,function*(){let r=this.getIds();if(this.consent.thirdPartyStorage){let s=yield this.identityClient.getIdentityClientData(e,r.sessionId);return this.setIds(s),s}let n=r.userId||e||(0,ai.get)(()=>this.idGenerator.generate()),i=r.sessionId||(0,ai.get)(()=>this.idGenerator.generate());return this.setIds({sessionId:i,userId:n}),{isFreshUser:!r.userId,isFreshSession:!r.sessionId,userId:n,sessionId:i}})}getIds(){var e,r;try{return{userId:(e=this.window.sessionStorage.getItem(tt.USER_ID_KEY))!=null?e:void 0,sessionId:(r=this.window.sessionStorage.getItem(tt.SESSION_ID_KEY))!=null?r:void 0}}catch(n){}return{}}setIds({sessionId:e,userId:r}){try{this.window.sessionStorage.setItem(tt.SESSION_ID_KEY,e),this.window.sessionStorage.setItem(tt.USER_ID_KEY,r)}catch(n){}}},Ht=tt;Ht.USER_ID_KEY="triptease-user-id",Ht.SESSION_ID_KEY="triptease-session-id";var fa=y("identity"),ci=class{constructor(e,r,n,i=new Ht(e,n),s=new Ar(e,n),a=new Rt){this.window=e;this.kernelHost=r;this.consent=n;this.identityStore=i;this.domainUserId=s;this.inMemoryStorage=a;this._ids=new Set;this.build=()=>{fa.debug("Building identity providers");let e=[new It(this.inMemoryStorage),da(this.window)];e.push(new ni(this.domainUserId)),this.consent.firstPartyStorage&&(e.push(p(()=>new It(new Ze(this.window.sessionStorage)))),e.push(p(()=>new It(new Ze(this.window.localStorage))))),this.consent.thirdPartyStorage&&e.push(new Mt(100,this.kernelHost)),this.identityProvider=new oi(Et.create(...e))};this.consent.onChange(this.build),this.build()}getIdentity(){return u(this,null,function*(){fa.debug("getIdentity called");let{domainUserId:e}=this.domainUserId.getId();return m.removeEmpty((yield Promise.all([{domainUserId:e},X(()=>u(this,null,function*(){let r=yield this.identityStore.getIdentity(e);return this.ids=[r.userId],r}),{}),X(()=>u(this,null,function*(){this.ids=yield this.identityProvider.syncAnonymousIds(this.ids)}),{})])).reduce((r,n)=>S(S({},r),n),{anonymousId:k.first(this.ids),anonymousIds:this.ids}))})}get ids(){return Array.from(this._ids).sort()}set ids(e){(Array.isArray(e)?e:[e]).filter(n=>p(()=>ie.parse(n))).forEach(n=>this._ids.add(n))}getAnonymousIds(){return this.identityProvider.getAnonymousIds()}setAnonymousId(e){return this.identityProvider.setAnonymousId(e)}syncAnonymousIds(e){return this.identityProvider.syncAnonymousIds(e)}};var qd=y("bootstrap"),Er=class{constructor(e=Yo(1e3*6,Ne({credentials:!0}))){this.fetch=e}isClaim(e){return e&&typeof e=="object"&&Array.isArray(e.urls)&&e.urls.every(r=>r&&typeof r=="object"&&typeof r.url=="string"&&typeof r.urlSource=="string"&&typeof r.timestamp=="string"&&typeof r.trackingId=="string")}parseMessage(e){let r=p(()=>JSON.parse(e),{});return this.isClaim(r)?r:Er.DefaultResponse}lookupClaim(e){return u(this,null,function*(){try{let{apiKey:r,claimKey:n}=e,i=new URL("https://onboard.triptease.io/claim");r&&i.searchParams.append("apiKey",r),n&&i.searchParams.append("claimKey",n);let s=yield this.fetch({method:"GET",url:i.toString()});if(s&&s.status===200)return this.parseMessage(s.body)}catch(r){qd.debug("call to redirect /claim failed",r)}return Er.DefaultResponse})}},Pr=Er;Pr.DefaultResponse={urls:[]};function Ir(t){if(!t)return;let e=t instanceof Date?t:new Date(t);return isNaN(e.getTime())?void 0:e}var Dt="triptease.integration.previous-urls",ma="triptease.integration.previous-pages";function ga(t,e){if(typeof e!="object")return t;let{url:r,urlSource:n,timestamp:i,trackingId:s}=e!=null?e:{};return typeof r=="string"&&r.length!==0&&ws.includes(n)&&t.push(m.removeEmpty({url:r,urlSource:n,timestamp:Ir(i),trackingId:s})),t}var we=class{constructor(e){this.storage=e}static create(e){let r=new ei([p(()=>new Ze(e.sessionStorage)),we.backupStorage]),n=new we(r);return n.exists()&&(n.data=n.data),n}append(e){let r=this.data;return r.push(e),this.data=r,e}prepend(e){let r=this.data;return r.unshift(e),this.data=r,e}set data(e){this.storage.set(we.storageKey,Io(e.reduce(ga,[]),10))}get data(){let e=this.storage.get(we.storageKey);return(Array.isArray(e)?e:[]).reduce(ga,[])}exists(){return!!this.storage.get(we.storageKey)}clear(){this.storage.clear()}},Lt=we;Lt.storageKey=Dt,Lt.backupStorage=new Rt;var li=class{constructor(e,r=new Pr,n=Lt.create(e)){this.window=e;this.claimClient=r;this.urlHistory=n}urls(e,r){return u(this,null,function*(){if(!this.hasClaim()){let n=p(()=>{var s;return(s=Ir(r))==null?void 0:s.toISOString()});this.urlHistory.append({url:this.window.document.referrer,urlSource:"referrer",timestamp:n}),this.urlHistory.append({url:this.window.location.href,urlSource:"page",timestamp:n});let{tt_claim_key:i}=B(this.window.location.search);if(i||e){let{urls:s}=yield this.claimClient.lookupClaim({apiKey:e,claimKey:i});s.forEach(a=>this.urlHistory.prepend(a))}}return this.urlHistory.data})}hasClaim(){return this.urlHistory.exists()}};var ya=["app.triptease.io","gtm-spike.launchpad.triptease.io"];function jd(t,e){return j.PASSED}function Ud(t,e){return e?j.PASSED:j.FAILED}function Bd(t,e){return e?e.config?j.PASSED:j.PENDING:j.FAILED}function Gd(t,e){return e?(t==null?void 0:t.integrationId)?e.config?t.integrationId===e.config.integrationId?j.PASSED:j.FAILED:j.PENDING:j.SKIPPED:j.FAILED}function Wd(t,e){return e?e.message?j.PASSED:j.PENDING:j.FAILED}var Fd={[ue.SCRIPT_PRESENT]:jd,[ue.SCRIPT_LOADED]:Ud,[ue.PAGE_EVALUATED]:Bd,[ue.INTEGRATION_ID_MATCHES]:Gd,[ue.MESSAGING_ACTIVE]:Wd};function ha(t,e){try{let r=Object.entries(Fd).reduce((n,[i,s])=>{let a=s(t,e);return[...n,{name:i,status:a}]},[]);return{type:"success",checks:r}}catch(r){return{type:"error",error:r.message}}}function ba(t,e){var s;if(!t.includes("tt_claim_key")||!e.length)return!1;let r=(s=e.find(({url:a})=>a.includes("tt_claim_key")))==null?void 0:s.url;if(!r)return!0;let{tt_claim_key:n}=mr(t,["tt_claim_key"]),{tt_claim_key:i}=mr(r,["tt_claim_key"]);return!!(n&&i&&n!==i)}var xa=I(si());var Kd=y("bootstrap"),Rr=class{constructor(e,r=new yn,n=vr(e),i=Ot.create(e),s=new Sn(e,r),a=ve.create(e),l=$e.create(e)){this.window=e;this.clock=r;this.events=n;this.consent=i;this.messageBatcher=s;this.starter=a;this.stackScripts=l;this.integrate=()=>u(this,null,function*(){try{this.logger.log("Starting integrate()");let e=Hs(this.window);T(this.window).onboard.integrationName=e;let r=zd(e);yield this.starter.start(r)}catch(e){this.logger.error("Bootstrap.integrate: unhandled exception",e)}});T(this.window).onboard.bootstrap=this,this.clickTracking=new Wn(this.window,this)}get logger(){return this.trackingApi?new pn("bootstrap",this.trackingApi):Kd}start(){return u(this,null,function*(){try{this.logger.debug("Bootstrap starting"),L.exposeApi(),this.stackScripts.capture();let r=(yield this.kernelFrame()).contentWindow;if(!r){this.logger.log("Kernel frame did not generate a content window, aborting");return}let n=new $(this.window,r,[]),i=new ht(new pe(n));if(this.kernel=new xn(i),this.kernelHost=re(i),this.clearStaleSessionStorage(),this.identityCombiner=new ci(this.window,this.kernelHost,this.consent),T(this.window).onboard.messageBuilder=this.messageBuilder=new An(new gr(this.window),new li(this.window),this.identityCombiner),this.trackingApi=wt.create(this.window,this.messageBatcher,this.messageBuilder),new hr(n,new yr().register(["processEvent","processConfig","processNavigation","updateKernelMode"],new Je(this)).register(["getAnonymousIds","setAnonymousId","syncAnonymousIds"],new Je(this.identityCombiner)).register(["trackConfig","trackEvent","trackError","trackMessage","trackLog"],new Je(this.trackingApi))).registerAlias("triptease.event","processEvent").registerAlias("triptease.navigation","processNavigation").registerAlias("triptease.config","trackConfig").registerAlias("triptease.logs","trackLog"),this.window.opener&&this.window.opener!==this.window){let s=new $(this.window,this.window.opener,ya);new hr(s,new yr().register(["evaluateHealth"],new Je(this)))}this.applicationLoader=kt.create(this.window,this.kernel,this.consent),this.clickTracking.start(),yield this.events.listen(this.integrate),yield this.events.start()}catch(e){this.logger.error("Bootstrap.start: unhandled exception",e)}})}stop(){this.messageBatcher.stop()}reload(){return u(this,null,function*(){yield this.start(),this.logger.debug("Bootstrap reloading"),this.stackScripts.capture(),yield this.integrate()})}kernelFrame(){return u(this,null,function*(){let e=gn.application(this.window.location.hostname);return yield this.starter.start(e)})}updateKernelMode(e){return u(this,null,function*(){yield T(this.window).triptease.integration.updateKernelMode(e)})}processEvent(e){return u(this,null,function*(){let r=yield this.kernelHost.getPageState(),n=yield this.messageBuilder.buildMessage(_.merge(e,r));yield re(new pe(new $(void 0,window,[]))).trackEvent(n)})}processConfig(e){return u(this,null,function*(){let r=yield this.applicationLoader.loadApplications(e.payload);T(this.window).triptease.config=e.payload;let n=M(S({},e),{applications:r});T(this.window).triptease.message=n,this.logger.log("Broadcasting triptease.config message",{payload:n.payload,message:n}),new $(void 0,this.window).send(n)})}processNavigation(e){return u(this,null,function*(){let r=this.window.document.createElement("a");r.style.display="none",r.classList.add("triptease-navigation");for(let[n,i]of Object.entries(e))r[n]=i;this.window.document.documentElement.appendChild(r),r.click(),this.window.document.documentElement.removeChild(r)})}evaluateHealth(e){return u(this,null,function*(){var r;return ha(e,(r=T(this.window))==null?void 0:r.triptease)})}clearStaleSessionStorage(){try{let e=(0,xa.get)(()=>{var n;return JSON.parse((n=this.window.sessionStorage.getItem(Dt))!=null?n:"[]")},[]);ba(this.window.location.href,e)&&(this.logger.log("Clearing stale session storage"),this.window.sessionStorage.removeItem(Dt),this.window.sessionStorage.removeItem(ma))}catch(e){}}};A([va.cache],Rr.prototype,"start",1);function zd(t){return{name:t.name,url:t.script,type:"script",enabled:!0}}var Sa=y("bootstrap"),wa=p(()=>window.triptease.onboard.bootstrap);(()=>u(void 0,null,function*(){let{"triptease-bootstrap-version":t=""}=B(window.location.search);["none","noop"].includes(t.toLowerCase())||(wa?(Sa.log("Bootstrap reloading"),yield wa.reload()):(Sa.log("Creating new bootstrap"),yield new Rr(window).start()))}))();})();