ba-js-common-header 0.0.3 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14168,6 +14168,8 @@ function makeServer() {
|
|
|
14168
14168
|
this.passthrough("https://www.bookassist.com/**");
|
|
14169
14169
|
this.passthrough("https://exceptions.hubspot.com/**");
|
|
14170
14170
|
this.passthrough("https://api.hubspot.com/**");
|
|
14171
|
+
this.passthrough("https://forms.hubspot.com/**");
|
|
14172
|
+
this.passthrough("/hotel_admin/json/title_bar.jsp");
|
|
14171
14173
|
}
|
|
14172
14174
|
});
|
|
14173
14175
|
}
|
|
@@ -26814,7 +26816,7 @@ function Header(props) {
|
|
|
26814
26816
|
}
|
|
26815
26817
|
}, [windowWidth]);
|
|
26816
26818
|
useEffect(() => {
|
|
26817
|
-
fetch("/
|
|
26819
|
+
fetch("/hotel_admin/json/title_bar.jsp").then((res) => res.json()).then((json) => {
|
|
26818
26820
|
dispatch(setTitleBar(json));
|
|
26819
26821
|
});
|
|
26820
26822
|
}, []);
|
|
@@ -23,7 +23,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
23
23
|
relationships are defined, and create a serializer for the parent
|
|
24
24
|
model, adding the relationships there.`),a.map(function(u){return u.all()})}}]),r}(Aa),_A=function(e){xn(r,e);var t=Cn(r);function r(){return vt(this,r),t.apply(this,arguments)}return xt(r,[{key:"handleStringShorthand",value:function(i,a){var o=this.shorthand,s=Te(o);Re(a,"The route handler for ".concat(i.url," is trying to access the ").concat(s," model, but that model doesn't exist."));var u=this._getAttrsForRequest(i,a.camelizedModelName);return a.create(u)}}]),r}(Aa),wA=function(e){xn(r,e);var t=Cn(r);function r(){return vt(this,r),t.apply(this,arguments)}return xt(r,[{key:"handleStringShorthand",value:function(i,a){var o=this.shorthand,s=Te(o);Re(a,"The route handler for ".concat(i.url," is trying to access the ").concat(s," model, but that model doesn't exist."));var u=this._getIdForRequest(i),f=a.find(u);if(!f)return new gn(404);var p=this._getAttrsForRequest(i,a.camelizedModelName);return f.update(p)}}]),r}(Aa),OA=function(e){xn(r,e);var t=Cn(r);function r(){return vt(this,r),t.apply(this,arguments)}return xt(r,[{key:"handleStringShorthand",value:function(i,a){var o=this.shorthand,s=Te(o);Re(a,"The route handler for ".concat(i.url," is trying to access the ").concat(s," model, but that model doesn't exist."));var u=this._getIdForRequest(i),f=a.find(u);if(!f)return new gn(404);f.destroy()}},{key:"handleArrayShorthand",value:function(i,a){var o=this,s=this._getIdForRequest(i),u=a[0].find(s),f=a.slice(1).map(function(p){return o._container.inflector.pluralize(p.camelizedModelName)});f.forEach(function(p){return u[p].destroy()}),u.destroy()}}]),r}(Aa),SA=function(e){xn(r,e);var t=Cn(r);function r(){return vt(this,r),t.apply(this,arguments)}return xt(r,[{key:"handleStringShorthand",value:function(i,a){var o=this.shorthand,s=Te(o);Re(a,"The route handler for ".concat(i.url," is trying to access the ").concat(s," model, but that model doesn't exist."));var u=this._getIdForRequest(i);if(u){var f=a.find(u);return f?new gn(204):new gn(404)}else if(this.options.coalesce&&i.queryParams&&i.queryParams.ids){var p=a.find(i.queryParams.ids);return p?new gn(204):new gn(404)}else return new gn(204)}}]),r}(Aa),AA={get:200,put:204,post:201,delete:204};function PA(e){var t=e.verb,r=e.schema,n=e.serializerOrRegistry,i=e.path,a=e.rawHandler,o=e.options,s,u=[r,n,a,i,o],f=nr(a);return f==="function"?s=En(Yp,u):f==="object"&&a?s=En(vA,u):t==="get"?s=En(bA,u):t==="post"?s=En(_A,u):t==="put"||t==="patch"?s=En(wA,u):t==="delete"?s=En(OA,u):t==="head"&&(s=En(SA,u)),s}var Qp=function(){function e(t){var r=t.schema,n=t.verb,i=t.rawHandler,a=t.customizedCode,o=t.options,s=t.path,u=t.serializerOrRegistry;vt(this,e),this.verb=n,this.customizedCode=a,this.serializerOrRegistry=u,this.handler=PA({verb:n,schema:r,path:s,serializerOrRegistry:u,rawHandler:i,options:o})}return xt(e,[{key:"handle",value:function(r){var n=this;return this._getMirageResponseForRequest(r).then(function(i){return n.serialize(i,r)}).then(function(i){return i.toRackResponse()})}},{key:"_getMirageResponseForRequest",value:function(r){var n;try{this.handler instanceof Yp&&this.handler.setRequest(r),n=this.handler.handle(r)}catch(a){if(a instanceof Qo)n=new gn(500,{},a);else{var i=a.message||a;n=new gn(500,{},{message:i,stack:"Mirage: Your ".concat(r.method," handler for the url ").concat(r.url,` threw an error:
|
|
25
25
|
|
|
26
|
-
`).concat(a.stack||a)})}}return this._toMirageResponse(n)}},{key:"_toMirageResponse",value:function(r){var n=this,i;return new Promise(function(a,o){Promise.resolve(r).then(function(s){if(s instanceof gn)i=r;else{var u=n._getCodeForResponse(s);i=new gn(u,{},s)}a(i)}).catch(o)})}},{key:"_getCodeForResponse",value:function(r){var n;return this.customizedCode?n=this.customizedCode:(n=AA[this.verb],n===204&&r!==void 0&&r!==""&&(n=200)),n}},{key:"serialize",value:function(r,n){return r.data=this.serializerOrRegistry.serialize(r.data,n),r}}]),e}();function Jp(e,t){var r=function(n){xn(a,n);var i=Cn(a);function a(){var o;vt(this,a);for(var s=arguments.length,u=new Array(s),f=0;f<s;f++)u[f]=arguments[f];if(o=i.call.apply(i,[this].concat(u)),e&&n2(e,"constructor")){var p;(p=e.constructor).call.apply(p,[Kp(o)].concat(u))}return o}return a}(this);return Object.assign(r,this,t),e&&Object.assign(r.prototype,e),r}var Xo=function(){function e(t,r,n,i){var a=this;return vt(this,e),Re(t,"A model requires a schema"),Re(r,"A model requires a modelName"),this._schema=t,this.modelName=r,this.fks=i||[],this.attrs={},n=n||{},this.fks.forEach(function(o){a.attrs[o]=n[o]!==void 0?n[o]:null}),Object.keys(n).forEach(function(o){var s=n[o];a._validateAttr(o,s),a._setupAttr(o,s),a._setupRelationship(o,s)}),this}return xt(e,[{key:"save",value:function(){var r=this._schema.toInternalCollectionName(this.modelName);return this.isNew()?(this.attrs=this._schema.db[r].insert(this.attrs),this._definePlainAttribute("id")):(this._schema.isSaving[this.toString()]=!0,this._schema.db[r].update(this.attrs.id,this.attrs)),this._saveAssociations(),this._schema.isSaving[this.toString()]=!1,this}},{key:"update",value:function(r,n){var i;return r==null?this:(nr(r)==="object"?i=r:(i={})[r]=n,Object.keys(i).forEach(function(a){!this.associationKeys.has(a)&&!this.associationIdKeys.has(a)&&this._definePlainAttribute(a),this[a]=i[a]},this),this.save(),this)}},{key:"destroy",value:function(){if(this.isSaved()){this._disassociateFromDependents();var r=this._schema.toInternalCollectionName(this.modelName);this._schema.db[r].remove(this.attrs.id)}}},{key:"isNew",value:function(){var r=!1,n=this.attrs.id!==void 0&&this.attrs.id!==null;if(n){var i=this._schema.toInternalCollectionName(this.modelName),a=this._schema.db[i].find(this.attrs.id);a&&(r=!0)}return!r}},{key:"isSaved",value:function(){return!this.isNew()}},{key:"reload",value:function(){if(this.id){var r=this._schema.toInternalCollectionName(this.modelName),n=this._schema.db[r].find(this.id);Object.keys(n).filter(function(i){return i!=="id"}).forEach(function(i){this.attrs[i]=n[i]},this)}return this._tempAssociations={},this}},{key:"toJSON",value:function(){return aA({},this.attrs)}},{key:"associations",get:function(){return this._schema.associationsFor(this.modelName)}},{key:"associationFor",value:function(r){return this.associations[r]}},{key:"inverseFor",value:function(r){return this._explicitInverseFor(r)||this._implicitInverseFor(r)}},{key:"_explicitInverseFor",value:function(r){this._checkForMultipleExplicitInverses(r);var n=this._schema.associationsFor(this.modelName),i=r.opts.inverse,a=i?n[i]:null,o=a&&a.isPolymorphic,s=a&&a.modelName===r.ownerModelName,u=a&&a.opts.inverse;return u&&a.opts.inverse!==r.name&&Re(!1,"You specified an inverse of ".concat(i," for ").concat(r.name,", but it does not match ").concat(a.modelName," ").concat(a.name,"'s inverse")),o||s?a:null}},{key:"_checkForMultipleExplicitInverses",value:function(r){var n=this._schema.associationsFor(this.modelName),i=Object.keys(n).filter(function(a){var o=n[a],s=r.ownerModelName===o.modelName,u=r.name===o.opts.inverse;return s&&u});Re(i.length<=1,"The ".concat(this.modelName," model has defined multiple explicit inverse associations for the ").concat(r.ownerModelName,".").concat(r.name," association."))}},{key:"_implicitInverseFor",value:function(r){var n=this,i=this._schema.associationsFor(this.modelName),a=r.ownerModelName;return yc(i).filter(function(o){return o.modelName===a}).reduce(function(o,s){var u=s.opts.inverse,f=u===void 0,p=u===r.name,d=f||p;return d&&(Re(!o,"The ".concat(n.modelName," model has multiple possible inverse associations for the ").concat(r.ownerModelName,".").concat(r.name," association.")),o=s),o},null)}},{key:"hasInverseFor",value:function(r){return!!this.inverseFor(r)}},{key:"alreadyAssociatedWith",value:function(r,n){var i=this[n.name];if(i&&r)return i instanceof e?i.isSaved()&&r.isSaved()?i.toString()===r.toString():i===r:i.includes(r)}},{key:"associate",value:function(r,n){if(!this.alreadyAssociatedWith(r,n)){var i=n.name;n instanceof Sa?this[i].includes(r)||this[i].add(r):this[i]=r}}},{key:"disassociate",value:function(r,n){var i=n.getForeignKey();if(n instanceof Sa){var a;if(n.isPolymorphic){var o=this[i].find(function(s){var u=s.type,f=s.id;return u===r.modelName&&f===r.id});a=o&&this[i].indexOf(o)}else a=this[i].map(function(s){return s.toString()}).indexOf(r.id.toString());a>-1&&this.attrs[i].splice(a,1)}else this.attrs[i]=null}},{key:"isSaving",get:function(){return this._schema.isSaving[this.toString()]}},{key:"_setupAttr",value:function(r,n){var i=this.associationKeys.has(r)||this.associationIdKeys.has(r);i||(this.attrs[r]=n,this._definePlainAttribute(r))}},{key:"_definePlainAttribute",value:function(r){var n=Object.getOwnPropertyDescriptor(this,r);n&&n.get||(Object.prototype.hasOwnProperty.call(this.attrs,r)||(this.attrs[r]=null),Object.defineProperty(this,r,{get:function(){return this.attrs[r]},set:function(a){this.attrs[r]=a}}))}},{key:"_setupRelationship",value:function(r,n){var i=this.associationIdKeys.has(r)||this.fks.includes(r),a=this.associationKeys.has(r);i&&(n!=null&&this._validateForeignKeyExistsInDatabase(r,n),this.attrs[r]=n),a&&(this[r]=n)}},{key:"_validateAttr",value:function(r,n){if(this.associationKeys.has(r)){var i=this.associationFor(r),a=n===null;if(i instanceof Sa){var o=n instanceof Vn||n instanceof an,s=Array.isArray(n)&&n.every(function(A){return A instanceof e});Re(o||s||a,"You're trying to create a ".concat(this.modelName,' model and you passed in "').concat(n,'" under the ').concat(r," key, but that key is a HasMany relationship. You must pass in a Collection, PolymorphicCollection, array of Models, or null."))}else i instanceof Oa&&Re(n instanceof e||a,"You're trying to create a ".concat(this.modelName,' model and you passed in "').concat(n,'" under the ').concat(r," key, but that key is a BelongsTo relationship. You must pass in a Model or null."))}if(this.associationIdKeys.has(r)&&r.endsWith("Ids")){var u=Array.isArray(n),f=n===null;Re(u||f,"You're trying to create a ".concat(this.modelName,' model and you passed in "').concat(n,'" under the ').concat(r," key, but that key is a foreign key for a HasMany relationship. You must pass in an array of ids or null."))}{var p=n instanceof e||n instanceof Vn||n instanceof an,d=Array.isArray(n)&&n.length&&n.every(function(A){return A instanceof e});if(p||d){var y=n;Re(this.associationKeys.has(r),"You're trying to create a ".concat(this.modelName," model and you passed in a ").concat(y.toString()," under the ").concat(r," key, but you haven't defined that key as an association on your model."))}}}},{key:"_validateForeignKeyExistsInDatabase",value:function(r,n){var i=this;if(Array.isArray(n)){var a=this.hasManyAssociationFks[r],o;a.isPolymorphic?(o=n.map(function(d){var y=d.type,A=d.id;return i._schema.db[i._schema.toInternalCollectionName(y)].find(A)}),o=jo(o)):o=this._schema.db[this._schema.toInternalCollectionName(a.modelName)].find(n);var s=a.isPolymorphic?n.map(function(d){return"".concat(d.type,":").concat(d.id)}).join(","):n;Re(o.length===n.length,"You're instantiating a ".concat(this.modelName," that has a ").concat(r," of ").concat(s,", but some of those records don't exist in the database."))}else{var u=this.belongsToAssociationFks[r],f;u.isPolymorphic?f=this._schema.db[this._schema.toInternalCollectionName(n.type)].find(n.id):f=this._schema.db[this._schema.toInternalCollectionName(u.modelName)].find(n);var p=u.isPolymorphic?"".concat(n.type,":").concat(n.id):n;Re(f,"You're instantiating a ".concat(this.modelName," that has a ").concat(r," of ").concat(p,", but that record doesn't exist in the database."))}}},{key:"_saveAssociations",value:function(){this._saveBelongsToAssociations(),this._saveHasManyAssociations()}},{key:"_saveBelongsToAssociations",value:function(){var r=this;yc(this.belongsToAssociations).forEach(function(n){r._disassociateFromOldInverses(n),r._saveNewAssociates(n),r._associateWithNewInverses(n)})}},{key:"_saveHasManyAssociations",value:function(){var r=this;yc(this.hasManyAssociations).forEach(function(n){r._disassociateFromOldInverses(n),r._saveNewAssociates(n),r._associateWithNewInverses(n)})}},{key:"_disassociateFromOldInverses",value:function(r){r instanceof Sa?this._disassociateFromHasManyInverses(r):r instanceof Oa&&this._disassociateFromBelongsToInverse(r)}},{key:"_disassociateFromHasManyInverses",value:function(r){var n=this,i=r.getForeignKey(),a=this._tempAssociations&&this._tempAssociations[r.name],o=this.attrs[i];if(a&&o){var s;r.isPolymorphic?s=o.map(function(u){var f=u.type,p=u.id;return n._schema[n._schema.toCollectionName(f)].find(p)}):s=this._schema[this._schema.toCollectionName(r.modelName)].find(o||[]).models,s.filter(function(u){return!u.isSaving&&!a.includes(u)&&u.hasInverseFor(r)}).forEach(function(u){var f=u.inverseFor(r);u.disassociate(n,f),u.save()})}}},{key:"_disassociateFromBelongsToInverse",value:function(r){var n=r.getForeignKey(),i=this._tempAssociations&&this._tempAssociations[r.name],a=this.attrs[n];if(i!==void 0&&a){var o;if(r.isPolymorphic?o=this._schema[this._schema.toCollectionName(a.type)].find(a.id):o=this._schema[this._schema.toCollectionName(r.modelName)].find(a),o.hasInverseFor(r)){var s=o.inverseFor(r);o.disassociate(this,s),o._updateInDb(o.attrs)}}}},{key:"_disassociateFromDependents",value:function(){var r=this;this._schema.dependentAssociationsFor(this.modelName).forEach(function(n){n.disassociateAllDependentsFromTarget(r)})}},{key:"_saveNewAssociates",value:function(r){var n=r.getForeignKey(),i=this._tempAssociations&&this._tempAssociations[r.name];if(i!==void 0){if(this.__isSavingNewChildren=!0,delete this._tempAssociations[r.name],i instanceof Vn)i.models.filter(function(o){return!o.isSaving}).forEach(function(o){o.save()}),this._updateInDb(rn({},n,i.models.map(function(o){return o.id})));else if(i instanceof an)i.models.filter(function(o){return!o.isSaving}).forEach(function(o){o.save()}),this._updateInDb(rn({},n,i.models.map(function(o){return{type:o.modelName,id:o.id}})));else if(i===null)this._updateInDb(rn({},n,null));else if(this.equals(i))this._updateInDb(rn({},n,this.id));else if(!i.isSaving){i.save(),this._syncTempAssociations(i);var a;r.isPolymorphic?a={id:i.id,type:i.modelName}:a=i.id,this._updateInDb(rn({},n,a))}this.__isSavingNewChildren=!1}}},{key:"_associateWithNewInverses",value:function(r){var n=this;if(!this.__isSavingNewChildren){var i=this[r.name];i instanceof e?this._associateModelWithInverse(i,r):(i instanceof Vn||i instanceof an)&&i.models.forEach(function(a){n._associateModelWithInverse(a,r)}),delete this._tempAssociations[r.name]}}},{key:"_associateModelWithInverse",value:function(r,n){var i=this;if(r.hasInverseFor(n)){var a=r.inverseFor(n),o=a.getForeignKey(),s=this.id;if(a instanceof Oa){var u;a.isPolymorphic?u={type:this.modelName,id:s}:u=s,this._schema.db[this._schema.toInternalCollectionName(r.modelName)].update(r.id,rn({},o,u))}else{var f=this._schema.db[this._schema.toInternalCollectionName(r.modelName)],p=f.find(r.id)[a.getForeignKey()]||[],d=Object.assign([],p),y,A;a.isPolymorphic?(y={type:this.modelName,id:s},A=d.some(function(P){return P.type==i.modelName&&P.id==s})):(y=s,A=d.includes(s)),A||d.push(y),f.update(r.id,rn({},o,d))}}}},{key:"_updateInDb",value:function(r){this.attrs=this._schema.db[this._schema.toInternalCollectionName(this.modelName)].update(this.attrs.id,r)}},{key:"_syncTempAssociations",value:function(r){var n=this;Object.keys(this._tempAssociations).forEach(function(i){n._tempAssociations[i]&&n._tempAssociations[i].toString()===r.toString()&&(n._tempAssociations[i]=r)})}},{key:"toString",value:function(){var r=this.id?"(".concat(this.id,")"):"";return"model:".concat(this.modelName).concat(r)}},{key:"equals",value:function(r){return this.toString()===r.toString()}}]),e}();Xo.extend=Jp,Xo.findBelongsToAssociation=function(e){return this.prototype.belongsToAssociations[e]};var Yn=function(){function e(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};vt(this,e),this.registry=t,this.type=r,this.request=n,this.attrs=this.attrs||void 0,this.include=this.include||[],this.root=this.root||void 0,this.embed=this.embed||void 0,this.serializeIds=this.serializeIds||void 0}return xt(e,[{key:"serialize",value:function(r){return this.primaryResource=r,this.buildPayload(r)}},{key:"normalize",value:function(r){return r}},{key:"buildPayload",value:function(r,n,i,a){if(!r&&vc(n))return a;if(r){var o=this.getHashForPrimaryResource(r),s=nn(o,2),u=s[0],f=s[1],p=this.isCollection(r)?r.models:[r];return this.buildPayload(void 0,f,p,u)}else{var d=n.shift(),y=this.getHashForIncludedResource(d),A=nn(y,2),P=A[0],C=A[1],v=C.filter(function(M){return!i.map(function(L){return L.toString()}).includes(M.toString())}).concat(n),I=(this.isCollection(d)?d.models:[d]).concat(i),T=this.mergePayloads(a,P);return this.buildPayload(void 0,v,I,T)}}},{key:"getHashForPrimaryResource",value:function(r){var n=this.getHashForResource(r),i=nn(n,2),a=i[0],o=i[1],s;if(this.root){Re(!(r instanceof an),"The base Serializer class cannot serialize a top-level PolymorphicCollection when root is true, since PolymorphicCollections have no type.");var u=this.serializerFor(r.modelName),f=u.keyForResource(r);s=rn({},f,a)}else s=a;return[s,o]}},{key:"getHashForIncludedResource",value:function(r){var n,i;if(r instanceof an)n={},i=r.models;else{var a=this.serializerFor(r.modelName),o=a.getHashForResource(r),s=nn(o,2),u=s[0],f=s[1],p=a.keyForRelationship(r.modelName);n=Array.isArray(u)?rn({},p,u):rn({},p,[u]),i=f}return[n,i]}},{key:"getHashForResource",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s,u;if(o||(u=this),o&&r.modelName&&(u=this.serializerFor(r.modelName)),this.isModel(r)?s=u._hashForModel(r,i,a):s=r.models.map(function(p){var d=u;return d||(d=n.serializerFor(p.modelName)),d._hashForModel(p,i,a)}),this.embed)return[s,[]];var f=bp(jo(Dd(u.getKeysForIncluded().map(function(p){return n.isCollection(r)?r.models.map(function(d){return d[p]}):r[p]}))),function(p){return p.toString()});return[s,f]}},{key:"mergePayloads",value:function(r,n){var i,a=Object.keys(n),o=nn(a,1),s=o[0];return r[s]?(i=r,i[s]=r[s].concat(n[s])):i=Object.assign(r,n),i}},{key:"keyForResource",value:function(r){var n=r.modelName;return this.isModel(r)?this.keyForModel(n):this.keyForCollection(n)}},{key:"keyForModel",value:function(r){return Te(r)}},{key:"keyForCollection",value:function(r){return this._container.inflector.pluralize(this.keyForModel(r))}},{key:"_hashForModel",value:function(r,n){var i=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this._attrsForModel(r);if(n&&r.fks.forEach(function(u){delete o[u]}),this.embed){var s=Object.assign({},a);return s[r.modelName]=s[r.modelName]||{},s[r.modelName][r.id]=!0,this.getKeysForIncluded().forEach(function(u){var f=r[u];if(f&&!vp(s,"".concat(f.modelName,".").concat(f.id))){var p=i.getHashForResource(f,!0,s,!0),d=nn(p,1),y=d[0],A=i.keyForEmbeddedRelationship(u);if(o[A]=y,i.isModel(f)){var P="".concat(Te(u),"Id");delete o[P]}}}),o}else return this._maybeAddAssociationIds(r,o)}},{key:"_attrsForModel",value:function(r){var n={};return this.attrs?n=this.attrs.reduce(function(i,a){return i[a]=r[a],i},{}):n=Object.assign(n,r.attrs),r.fks.forEach(function(i){return delete n[i]}),this._formatAttributeKeys(n)}},{key:"_maybeAddAssociationIds",value:function(r,n){var i=this,a=Object.assign({},n);return this.serializeIds==="always"?r.associationKeys.forEach(function(o){var s=r[o],u=r.associationFor(o);if(i.isCollection(s)){var f=i.keyForRelationshipIds(o);a[f]=r["".concat(i._container.inflector.singularize(o),"Ids")]}else if(i.isModel(s)&&u.isPolymorphic){var p=i.keyForPolymorphicForeignKeyType(o),d=i.keyForPolymorphicForeignKeyId(o);a[p]=r["".concat(o,"Id")].type,a[d]=r["".concat(o,"Id")].id}else if(s){var y=i.keyForForeignKey(o);a[y]=r["".concat(o,"Id")]}}):this.serializeIds==="included"&&this.getKeysForIncluded().forEach(function(o){var s=r[o],u=r.associationFor(o);if(i.isCollection(s)){var f=i.keyForRelationshipIds(o);a[f]=r["".concat(i._container.inflector.singularize(o),"Ids")]}else if(i.isModel(s)&&u.isPolymorphic){var p=i.keyForPolymorphicForeignKeyType(o),d=i.keyForPolymorphicForeignKeyId(o);a[p]=r["".concat(o,"Id")].type,a[d]=r["".concat(o,"Id")].id}else if(i.isModel(s)){var y=i.keyForForeignKey(o);a[y]=r["".concat(o,"Id")]}}),a}},{key:"keyForAttribute",value:function(r){return r}},{key:"keyForRelationship",value:function(r){return Te(this._container.inflector.pluralize(r))}},{key:"keyForEmbeddedRelationship",value:function(r){return Te(r)}},{key:"keyForRelationshipIds",value:function(r){return"".concat(this._container.inflector.singularize(Te(r)),"Ids")}},{key:"keyForForeignKey",value:function(r){return"".concat(Te(r),"Id")}},{key:"keyForPolymorphicForeignKeyId",value:function(r){return"".concat(Te(r),"Id")}},{key:"keyForPolymorphicForeignKeyType",value:function(r){return"".concat(Te(r),"Type")}},{key:"isModel",value:function(r){return r instanceof Xo}},{key:"isCollection",value:function(r){return r instanceof Vn||r instanceof an}},{key:"isModelOrCollection",value:function(r){return this.isModel(r)||this.isCollection(r)}},{key:"serializerFor",value:function(r){return this.registry.serializerFor(r)}},{key:"getKeysForIncluded",value:function(){return A1(this.include)?this.include(this.request,this.primaryResource):this.include}},{key:"schema",get:function(){return this.registry.schema}},{key:"_formatAttributeKeys",value:function(r){var n={};for(var i in r){var a=this.keyForAttribute(i);n[a]=r[i]}return n}},{key:"getCoalescedIds",value:function(){}}]),e}();Yn.prototype.include=[],Yn.prototype.root=!0,Yn.prototype.embed=!1,Yn.prototype.serializeIds="included",Yn.extend=Jp;var Xp=function(e){xn(r,e);var t=Cn(r);function r(){var n;return vt(this,r),n=t.apply(this,arguments),n.alwaysIncludeLinkageData=n.alwaysIncludeLinkageData||void 0,n}return xt(r,[{key:"keyForModel",value:function(i){return Ot(i)}},{key:"keyForCollection",value:function(i){return Ot(i)}},{key:"keyForAttribute",value:function(i){return Ot(i)}},{key:"keyForRelationship",value:function(i){return Ot(i)}},{key:"links",value:function(){}},{key:"getHashForPrimaryResource",value:function(i){this._createRequestedIncludesGraph(i);var a=this.getHashForResource(i),o={data:a},s=this.getAddToIncludesForResource(i);return[o,s]}},{key:"getHashForIncludedResource",value:function(i){var a=this.serializerFor(i.modelName),o=a.getHashForResource(i),s={included:this.isModel(i)?[o]:o},u=[];return this.hasQueryParamIncludes()||(u=this.getAddToIncludesForResource(i)),[s,u]}},{key:"getHashForResource",value:function(i){var a=this,o;return this.isModel(i)?o=this.getResourceObjectForModel(i):o=i.models.map(function(s){return a.getResourceObjectForModel(s)}),o}},{key:"getAddToIncludesForResource",value:function(i){var a;if(this.hasQueryParamIncludes())a=this.request.queryParams.include.split(",");else{var o=this.serializerFor(i.modelName);a=o.getKeysForIncluded()}return this.getAddToIncludesForResourceAndPaths(i,a)}},{key:"getAddToIncludesForResourceAndPaths",value:function(i,a){var o=this,s=[];return a.forEach(function(u){var f=u.split("."),p=o.getIncludesForResourceAndPath.apply(o,[i].concat(Vo(f)));s.push(p)}),bp(jo(Dd(s)),function(u){return u.toString()})}},{key:"getIncludesForResourceAndPath",value:function(i){for(var a=this,o=arguments.length,s=new Array(o>1?o-1:0),u=1;u<o;u++)s[u-1]=arguments[u];var f=Te(s.shift()),p=[],d=[];if(this.isModel(i)){var y=i[f];this.isModel(y)?d=[y]:this.isCollection(y)&&(d=y.models)}else i.models.forEach(function(A){var P=A[f];a.isModel(P)?d.push(P):a.isCollection(P)&&(d=d.concat(P.models))});return p=p.concat(d),s.length&&d.forEach(function(A){p=p.concat(a.getIncludesForResourceAndPath.apply(a,[A].concat(s)))}),p}},{key:"getResourceObjectForModel",value:function(i){var a=this._attrsForModel(i,!0);delete a.id;var o={type:this.typeKeyForModel(i),id:i.id,attributes:a};return this._maybeAddRelationshipsToResourceObjectForModel(o,i)}},{key:"_maybeAddRelationshipsToResourceObjectForModel",value:function(i,a){var o=this,s={};return a.associationKeys.forEach(function(u){var f=a[u],p=o.keyForRelationship(u),d={};if(o.hasLinksForRelationship(a,u)){var y=o.serializerFor(a.modelName),A=y.links(a);d.links=A[u]}if(o.alwaysIncludeLinkageData||o.shouldIncludeLinkageData(u,a)||o._relationshipIsIncludedForModel(u,a)){var P=null;o.isModel(f)?P={type:o.typeKeyForModel(f),id:f.id}:o.isCollection(f)&&(P=f.models.map(function(C){return{type:o.typeKeyForModel(C),id:C.id}})),d.data=P}vc(d)||(s[p]=d)}),vc(s)||(i.relationships=s),i}},{key:"hasLinksForRelationship",value:function(i,a){var o=this.serializerFor(i.modelName),s=o.links&&o.links(i);return s&&s[a]!=null}},{key:"_relationshipIsIncludedForModel",value:function(i,a){if(this.hasQueryParamIncludes()){var o=this.request._includesGraph,s=this._graphKeyForModel(a),u;return o.data[s]?u=o.data[s]:o.included[this._container.inflector.pluralize(a.modelName)]&&(u=o.included[this._container.inflector.pluralize(a.modelName)][s]),u&&u.relationships&&Object.prototype.hasOwnProperty.call(u.relationships,Ot(i))}else{var f=this.getKeysForIncluded();return f.includes(i)}}},{key:"_createRequestedIncludesGraph",value:function(i){var a=this,o={data:{}};if(this.isModel(i)){var s=this._graphKeyForModel(i);o.data[s]={},this._addPrimaryModelToRequestedIncludesGraph(o,i)}else this.isCollection(i)&&i.models.forEach(function(u){var f=a._graphKeyForModel(u);o.data[f]={},a._addPrimaryModelToRequestedIncludesGraph(o,u)});this.request._includesGraph=o}},{key:"_addPrimaryModelToRequestedIncludesGraph",value:function(i,a){var o=this;if(this.hasQueryParamIncludes()){var s=this._graphKeyForModel(a),u=this.getQueryParamIncludes();u.split(",").filter(function(f){return!!f.trim()}).forEach(function(f){i.data[s].relationships=i.data[s].relationships||{};var p=f.split(".").map(Ot),d=p[0],y=d,A=Te(d),P=a.associationKeys.has(A);Re(P,'You tried to include "'.concat(d,'" with ').concat(a,' but no association named "').concat(A,'" is defined on the model.'));var C=a[A],v;o.isModel(C)?v=o._graphKeyForModel(C):o.isCollection(C)?v=C.models.map(o._graphKeyForModel):v=null,i.data[s].relationships[y]=v,C&&o._addResourceToRequestedIncludesGraph(i,C,p.slice(1))})}}},{key:"_addResourceToRequestedIncludesGraph",value:function(i,a,o){var s=this;i.included=i.included||{};var u=this.isCollection(a)?a.models:[a];u.forEach(function(f){var p=s._container.inflector.pluralize(f.modelName);i.included[p]=i.included[p]||{},s._addModelToRequestedIncludesGraph(i,f,o)})}},{key:"_addModelToRequestedIncludesGraph",value:function(i,a,o){var s=this._container.inflector.pluralize(a.modelName),u=this._graphKeyForModel(a);i.included[s][u]=i.included[s][u]||{},o.length&&this._addResourceRelationshipsToRequestedIncludesGraph(i,s,u,a,o)}},{key:"_addResourceRelationshipsToRequestedIncludesGraph",value:function(i,a,o,s,u){i.included[a][o].relationships=i.included[a][o].relationships||{};var f=u[0],p=s[Te(f)],d;this.isModel(p)?d=this._graphKeyForModel(p):this.isCollection(p)&&(d=p.models.map(this._graphKeyForModel)),i.included[a][o].relationships[f]=d,p&&this._addResourceToRequestedIncludesGraph(i,p,u.slice(1))}},{key:"_graphKeyForModel",value:function(i){return"".concat(i.modelName,":").concat(i.id)}},{key:"getQueryParamIncludes",value:function(){return vp(this,"request.queryParams.include")}},{key:"hasQueryParamIncludes",value:function(){return!!this.getQueryParamIncludes()}},{key:"typeKeyForModel",value:function(i){return Ot(this._container.inflector.pluralize(i.modelName))}},{key:"getCoalescedIds",value:function(i){var a=i.queryParams&&i.queryParams["filter[id]"];return typeof a=="string"?a.split(","):a}},{key:"shouldIncludeLinkageData",value:function(i,a){return!1}}]),r}(Yn);Xp.prototype.alwaysIncludeLinkageData=!1;var Zp=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};vt(this,e),this.schema=t,this._serializerMap=r}return xt(e,[{key:"normalize",value:function(r,n){return this.serializerFor(n).normalize(r)}},{key:"serialize",value:function(r,n){var i=this;if(this.request=n,this._isModelOrCollection(r)){var a=this.serializerFor(r.modelName);return a.serialize(r,n)}else return Array.isArray(r)&&r.some(this._isCollection)?r.reduce(function(o,s){var u=i.serializerFor(s.modelName);return u.embed?o[i._container.inflector.pluralize(s.modelName)]=u.serialize(s,n):o=Object.assign(o,u.serialize(s,n)),o},{}):r}},{key:"serializerFor",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.explicit,a=i===void 0?!1:i,o=r&&this._serializerMap&&this._serializerMap[Te(r)];return a?Re(!!o,"You passed in ".concat(r," as an explicit serializer type but that serializer doesn't exist.")):(o=o||this._serializerMap.application||Yn,Re(!o||o.prototype.embed||o.prototype.root||new o instanceof Xp,"You cannot have a serializer that sideloads (embed: false) and disables the root (root: false).")),new o(this,r,this.request)}},{key:"_isModel",value:function(r){return r instanceof Xo}},{key:"_isCollection",value:function(r){return r instanceof Vn||r instanceof an}},{key:"_isModelOrCollection",value:function(r){return this._isModel(r)||this._isCollection(r)}},{key:"registerSerializers",value:function(r){var n=this._serializerMap||{};this._serializerMap=Object.assign(n,r)}},{key:"getCoalescedIds",value:function(r,n){return this.serializerFor(n).getCoalescedIds(r)}}]),e}(),jc={},Lc={},zc={},eg=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};vt(this,e),Re(t,"A schema requires a db"),this.db=t,this._registry={},this._dependentAssociations={polymorphic:[]},this.registerModels(r),this.isSaving={}}return xt(e,[{key:"registerModels",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};KO(n,function(i,a){r.registerModel(a,n[a])})}},{key:"registerModel",value:function(r,n){var i=this,a=Te(r),o=Ot(a);n=n.extend(),this._registry[a]=this._registry[a]||{class:null,foreignKeys:[]},this._registry[a].class=n,n.prototype._schema=this,n.prototype.modelName=o,n.prototype.hasManyAssociations={},n.prototype.hasManyAssociationFks={},n.prototype.belongsToAssociations={},n.prototype.belongsToAssociationFks={},n.prototype.associationKeys=new Set,n.prototype.associationIdKeys=new Set,n.prototype.dependentAssociations=[];var s={};for(var u in n.prototype)if(n.prototype[u]instanceof wa){var f=n.prototype[u];f.name=u,f.modelName=f.modelName||this.toModelName(u),f.ownerModelName=o,f.setSchema(this);var p=f.getForeignKeyArray(),d=nn(p,2),y=d[0],A=d[1];s[y]=s[y]||[],Re(!s[y].includes(A),"Your '".concat(r,"' model definition has multiple possible inverse relationships of type '").concat(y,"'. Please use explicit inverses.")),s[y].push(A),this._addForeignKeyToRegistry(y,A),f.addMethodsToModelClass(n,u)}var P=this.toCollectionName(o);return this.db[P]||this.db.createCollection(P),this[P]={camelizedModelName:a,new:function(v){return i.new(a,v)},create:function(v){return i.create(a,v)},all:function(v){return i.all(a,v)},find:function(v){return i.find(a,v)},findBy:function(v){return i.findBy(a,v)},findOrCreateBy:function(v){return i.findOrCreateBy(a,v)},where:function(v){return i.where(a,v)},none:function(v){return i.none(a,v)},first:function(v){return i.first(a,v)}},this}},{key:"modelFor",value:function(r){return this._registry[r]}},{key:"new",value:function(r,n){return this._instantiateModel(Ot(r),n)}},{key:"create",value:function(r,n){return this.new(r,n).save()}},{key:"all",value:function(r){var n=this.collectionForType(r);return this._hydrate(n,Ot(r))}},{key:"none",value:function(r){return this._hydrate([],Ot(r))}},{key:"find",value:function(r,n){var i=this.collectionForType(r),a=i.find(n);return Array.isArray(n)&&Re(a.length===n.length,"Couldn't find all ".concat(this._container.inflector.pluralize(r)," with ids: (").concat(n.join(","),") (found ").concat(a.length," results, but was looking for ").concat(n.length,")")),this._hydrate(a,Ot(r))}},{key:"findBy",value:function(r,n){var i=this.collectionForType(r),a=i.findBy(n);return this._hydrate(a,Ot(r))}},{key:"findOrCreateBy",value:function(r,n){var i=this.collectionForType(r),a=i.findBy(n),o;return a?o=this._hydrate(a,Ot(r)):o=this.create(r,n),o}},{key:"where",value:function(r,n){var i=this.collectionForType(r),a=i.where(n);return this._hydrate(a,Ot(r))}},{key:"first",value:function(r){var n=this.collectionForType(r),i=n[0];return this._hydrate(i,Ot(r))}},{key:"modelClassFor",value:function(r){var n=this._registry[Te(r)];return Re(n,"Model not registered: ".concat(r)),n.class.prototype}},{key:"addDependentAssociation",value:function(r,n){r.isPolymorphic?this._dependentAssociations.polymorphic.push(r):(this._dependentAssociations[n]=this._dependentAssociations[n]||[],this._dependentAssociations[n].push(r))}},{key:"dependentAssociationsFor",value:function(r){var n=this._dependentAssociations[r]||[],i=this._dependentAssociations.polymorphic||[];return n.concat(i)}},{key:"associationsFor",value:function(r){var n=this.modelClassFor(r);return Object.assign({},n.belongsToAssociations,n.hasManyAssociations)}},{key:"hasModelForModelName",value:function(r){return this.modelFor(Te(r))}},{key:"collectionForType",value:function(r){var n=this.toCollectionName(r);return Re(this.db[n],"You're trying to find model(s) of type ".concat(r," but this collection doesn't exist in the database.")),this.db[n]}},{key:"toCollectionName",value:function(r){if(typeof jc[r]!="string"){var n=Ot(r),i=Te(this._container.inflector.pluralize(n));jc[r]=i}return jc[r]}},{key:"toInternalCollectionName",value:function(r){if(typeof Lc[r]!="string"){var n="_".concat(this.toCollectionName(r));Lc[r]=n}return Lc[r]}},{key:"toModelName",value:function(r){if(typeof zc[r]!="string"){var n=Ot(r),i=this._container.inflector.singularize(n);zc[r]=i}return zc[r]}},{key:"_addForeignKeyToRegistry",value:function(r,n){this._registry[r]=this._registry[r]||{class:null,foreignKeys:[]};var i=this._registry[r].foreignKeys;i.includes(n)||i.push(n)}},{key:"_instantiateModel",value:function(r,n){var i=this._modelFor(r),a=this._foreignKeysFor(r);return new i(this,r,n,a)}},{key:"_modelFor",value:function(r){return this._registry[Te(r)].class}},{key:"_foreignKeysFor",value:function(r){return this._registry[Te(r)].foreignKeys}},{key:"_hydrate",value:function(r,n){if(Array.isArray(r)){var i=r.map(function(a){return this._instantiateModel(n,a)},this);return new Vn(n,i)}else return r?this._instantiateModel(n,r):null}}]),e}(),IA={Db:Vp,Association:wa,RouteHandler:Qp,BaseRouteHandler:Jo,Serializer:Yn,SerializerRegistry:Zp,Schema:eg},xA={singularize:ph,pluralize:hh},tg=function(){function e(){vt(this,e),this.inflector=xA}return xt(e,[{key:"register",value:function(r,n){this[r]=n}},{key:"create",value:function(r){var n=IA[r];n.prototype._container=this;for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return En(n,a)}}]),e}(),Mi=new tg;Vp.prototype._container=Mi,wa.prototype._container=Mi,Jo.prototype._container=Mi,Qp.prototype._container=Mi,Yn.prototype._container=Mi,Zp.prototype._container=Mi,eg.prototype._container=Mi;var Hc={};function EA(e){if(typeof window!="undefined")return new To(function(){this.passthroughRequest=function(r,n,i){e.shouldLog()&&console.log("Mirage: Passthrough request for ".concat(r.toUpperCase()," ").concat(i.url))},this.handledRequest=function(r,n,i){if(e.shouldLog()){console.groupCollapsed("Mirage: [".concat(i.status,"] ").concat(r.toUpperCase()," ").concat(i.url));var a=i.requestBody,o=i.responseText,s,u;try{s=JSON.parse(a)}catch{s=a}try{u=JSON.parse(o)}catch{u=o}console.groupCollapsed("Response"),console.log(u),console.groupEnd(),console.groupCollapsed("Request (data)"),console.log(s),console.groupEnd(),console.groupCollapsed("Request (raw)"),console.log(i),console.groupEnd(),console.groupEnd()}};var t=this.checkPassthrough;this.checkPassthrough=function(r){var n=e.passthroughChecks.some(function(a){return a(r)});if(n){var i=r.url.includes("?")?r.url.substr(0,r.url.indexOf("?")):r.url;this[r.method.toLowerCase()](i,this.passthrough)}return t.apply(this,arguments)},this.unhandledRequest=function(r,n){n=decodeURI(n),Re("Your app tried to ".concat(r," '").concat(n,"', but there was no route defined to handle this request. Define a route for this endpoint in your routes() config. Did you forget to define a namespace?"))}},{trackRequests:e.shouldTrackRequests()})}var Uc={coalesce:!1,timing:void 0},CA={singularize:ph,pluralize:hh},RA=["http://localhost:0/chromecheckurl","http://localhost:30820/socket.io",function(e){return/.+\.hot-update.json$/.test(e.url)}];function TA(e){if(!e||nr(e)!=="object")return!1;for(var t=Object.keys(Uc),r=Object.keys(e),n=0;n<r.length;n++){var i=r[n];if(t.indexOf(i)>-1)return!0}return!1}function MA(e){var t=e.splice(-1),r=nn(t,1),n=r[0];TA(n)?n=Ec({},Uc,n):(e.push(n),n=Uc);for(var i=2-e.length;i-- >0;)e.push(void 0);return e.push(n),e}function FA(e){return new $A(e)}var $A=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vt(this,e),this._container=new tg,this.config(t),this.db=this.db||void 0,this.schema=this.schema||void 0}return xt(e,[{key:"config",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.passthroughChecks=this.passthroughChecks||[];var n=r.environment&&this.environment&&this.environment!==r.environment;Re(!n,"You cannot modify Mirage's environment once the server is created"),this.environment=r.environment||this.environment||"development",r.routes&&(Re(!r.baseConfig,"The routes option is an alias for the baseConfig option. You can't pass both options into your server definition."),r.baseConfig=r.routes),r.seeds&&(Re(!r.scenarios,"The seeds option is an alias for the scenarios.default option. You can't pass both options into your server definition."),r.scenarios={default:r.seeds}),this._config=r,this.namespace=this.namespace||r.namespace||"",this.inflector=r.inflector||CA,this._container.register("inflector",this.inflector),this.urlPrefix=this.urlPrefix||r.urlPrefix||"",this.timing=this.timing||r.timing||400,this.logging=this.logging!==void 0?this.logging:void 0,this.testConfig=this.testConfig||void 0,this.trackRequests=r.trackRequests,this._defineRouteHandlerHelpers(),this.db?this.db.registerIdentityManagers(r.identityManagers):this.db=this._container.create("Db",void 0,r.identityManagers),this.schema?(this.schema.registerModels(r.models),this.serializerOrRegistry.registerSerializers(r.serializers||{})):(this.schema=this._container.create("Schema",this.db,r.models),this.serializerOrRegistry=this._container.create("SerializerRegistry",this.schema,r.serializers));var i=this._hasModulesOfType(r,"factories"),a=r.scenarios&&Object.prototype.hasOwnProperty.call(r.scenarios,"default"),o=r.trackRequests!==void 0&&this.pretender;Re(!o,"You cannot modify Pretender's request tracking once the server is created"),this.pretender=this.pretender||r.pretender||EA(this),r.baseConfig&&this.loadConfig(r.baseConfig),this.isTest()&&(r.testConfig&&this.loadConfig(r.testConfig),typeof window!="undefined"&&(window.server=this)),this.isTest()&&i?this.loadFactories(r.factories):!this.isTest()&&a?(this.loadFactories(r.factories),r.scenarios.default(this)):this.loadFixtures();var s=typeof r.useDefaultPassthroughs!="undefined"?r.useDefaultPassthroughs:!0;s&&this._configureDefaultPassthroughs()}},{key:"isTest",value:function(){return this.environment==="test"}},{key:"shouldLog",value:function(){return typeof this.logging!="undefined"?this.logging:!this.isTest()}},{key:"shouldTrackRequests",value:function(){return Boolean(this.trackRequests)}},{key:"loadConfig",value:function(r){r.call(this),this.timing=this.isTest()?0:this.timing||0}},{key:"passthrough",value:function(){for(var r=this,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];if(typeof window!="undefined"){var o=["get","post","put","delete","patch","options","head"],s=i[i.length-1];i.length===0?i=["/**","/"]:Array.isArray(s)&&(o=i.pop()),i.forEach(function(u){typeof u=="function"?r.passthroughChecks.push(u):o.forEach(function(f){var p=r._getFullPath(u);r.pretender[f](p,r.pretender.passthrough)})})}}},{key:"loadFixtures",value:function(){for(var r=this._config.fixtures,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];if(i.length){var o=i.map(Te),s=o.filter(function(u){return!r[u]});if(s.length)throw new Error("Fixtures not found: ".concat(s.join(", ")));r=_S.apply(void 0,[r].concat(Vo(o)))}this.db.loadData(r)}},{key:"loadFactories",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=this._factoryMap||{};this._factoryMap=Ec(i,n),Object.keys(n).forEach(function(a){var o=r.schema.toCollectionName(a);r.db.createCollection(o)})}},{key:"factoryFor",value:function(r){var n=Te(r);if(this._factoryMap&&this._factoryMap[n])return this._factoryMap[n]}},{key:"build",value:function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];var o=i.filter(function(C){return C&&typeof C=="string"}),s=Rc(i,function(C){return Iu(C)}),u=Te(r);this.factorySequences=this.factorySequences||{},this.factorySequences[u]=this.factorySequences[u]+1||0;var f=this.factoryFor(r);if(f){f=f.extend({});var p=f.attrs||{};this._validateTraits(o,f,r);var d=this._mergeExtensions(p,o,s);this._mapAssociationsFromAttributes(r,p,s),this._mapAssociationsFromAttributes(r,d);var y=f.extend(d),A=new y,P=this.factorySequences[u];return A.build(P)}else return s}},{key:"buildList",value:function(r,n){Re(Up(n),"second argument has to be an integer, you passed: ".concat(nr(n)));for(var i=[],a=arguments.length,o=new Array(a>2?a-2:0),s=2;s<a;s++)o[s-2]=arguments[s];for(var u=[r].concat(o),f=0;f<n;f++)i.push(this.build.apply(this,u));return i}},{key:"create",value:function(r){var n=this;Re(this._modelOrFactoryExistsForType(r),"You called server.create('".concat(r,"') but no model or factory was found. Make sure you're passing in the singularized version of the model or factory name."));for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];var s=a.filter(function(v){return v&&typeof v=="string"}),u=Rc(a,function(v){return Iu(v)}),f=Rc(a,function(v){return v&&Array.isArray(v)}),p=this.build.apply(this,[r].concat(Vo(s),[u])),d;if(this.schema&&this.schema[this.schema.toCollectionName(r)]){var y=this.schema[this.schema.toCollectionName(r)];d=y.create(p)}else{var A,P;f?A=f:(P=this.schema?this.schema.toInternalCollectionName(r):"_".concat(this.inflector.pluralize(r)),A=this.db[P]),Re(A,"You called server.create('".concat(r,"') but no model or factory was found.")),d=A.insert(p)}var C=this.factoryFor(r);return C&&C.extractAfterCreateCallbacks({traits:s}).forEach(function(v){v(d,n)}),d}},{key:"createList",value:function(r,n){Re(this._modelOrFactoryExistsForType(r),"You called server.createList('".concat(r,"') but no model or factory was found. Make sure you're passing in the singularized version of the model or factory name.")),Re(Up(n),"second argument has to be an integer, you passed: ".concat(nr(n)));for(var i=[],a=this.schema?this.schema.toInternalCollectionName(r):"_".concat(this.inflector.pluralize(r)),o=this.db[a],s=arguments.length,u=new Array(s>2?s-2:0),f=2;f<s;f++)u[f-2]=arguments[f];for(var p=[r].concat(u,[o]),d=0;d<n;d++)i.push(this.create.apply(this,p));return i}},{key:"shutdown",value:function(){typeof window!="undefined"&&this.pretender.shutdown(),typeof window!="undefined"&&this.environment==="test"&&(window.server=void 0)}},{key:"resource",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.only,o=i.except,s=i.path;if(r=this.inflector.pluralize(r),s=s||"/".concat(r),a=a||[],o=o||[],a.length>0&&o.length>0)throw"cannot use both :only and :except options";var u={index:{methods:["get"],path:"".concat(s)},show:{methods:["get"],path:"".concat(s,"/:id")},create:{methods:["post"],path:"".concat(s)},update:{methods:["put","patch"],path:"".concat(s,"/:id")},delete:{methods:["del"],path:"".concat(s,"/:id")}},f=Object.keys(u),p=a.length>0&&a||o.length>0&&f.filter(function(d){return o.indexOf(d)===-1})||f;p.forEach(function(d){var y=u[d];y.methods.forEach(function(A){return s===r?n[A](y.path):n[A](y.path,r)})})}},{key:"_defineRouteHandlerHelpers",value:function(){var r=this;[["get"],["post"],["put"],["delete","del"],["patch"],["head"],["options"]].forEach(function(n){var i=nn(n,2),a=i[0],o=i[1];r[a]=function(s){for(var u=arguments.length,f=new Array(u>1?u-1:0),p=1;p<u;p++)f[p-1]=arguments[p];var d=MA(f),y=nn(d,3),A=y[0],P=y[1],C=y[2];return r._registerRouteHandler(a,s,A,P,C)},o&&(r[o]=r[a])})}},{key:"_serialize",value:function(r){return typeof r=="string"?r:JSON.stringify(r)}},{key:"_registerRouteHandler",value:function(r,n,i,a,o){var s=this,u=this._container.create("RouteHandler",{schema:this.schema,verb:r,rawHandler:i,customizedCode:a,options:o,path:n,serializerOrRegistry:this.serializerOrRegistry}),f=this._getFullPath(n),p=o.timing!==void 0?o.timing:function(){return s.timing};if(this.pretender)return this.pretender[r](f,function(d){return u.handle(d).then(function(y){var A=nn(y,3),P=A[0],C=A[1],v=A[2];return[P,C,s._serialize(v)]})},p)}},{key:"_hasModulesOfType",value:function(r,n){var i=r[n];return i?Object.keys(i).length>0:!1}},{key:"_getFullPath",value:function(r){r=r[0]==="/"?r.slice(1):r;var n="",i=this.urlPrefix?this.urlPrefix.trim():"",a="";if(this.urlPrefix&&this.namespace&&(this.namespace[0]==="/"&&this.namespace[this.namespace.length-1]==="/"&&(a=this.namespace.substring(0,this.namespace.length-1).substring(1)),this.namespace[0]==="/"&&this.namespace[this.namespace.length-1]!=="/"&&(a=this.namespace.substring(1)),this.namespace[0]!=="/"&&this.namespace[this.namespace.length-1]==="/"&&(a=this.namespace.substring(0,this.namespace.length-1)),this.namespace[0]!=="/"&&this.namespace[this.namespace.length-1]!=="/"&&(a=this.namespace)),this.namespace&&!this.urlPrefix){if(this.namespace[0]==="/"&&this.namespace[this.namespace.length-1]==="/"&&(a=this.namespace.substring(0,this.namespace.length-1)),this.namespace[0]==="/"&&this.namespace[this.namespace.length-1]!=="/"&&(a=this.namespace),this.namespace[0]!=="/"&&this.namespace[this.namespace.length-1]==="/"){var o=this.namespace.substring(0,this.namespace.length-1);a="/".concat(o)}this.namespace[0]!=="/"&&this.namespace[this.namespace.length-1]!=="/"&&(a="/".concat(this.namespace))}return this.namespace||(a=""),/^https?:\/\//.test(r)?n+=r:(i.length&&(n+=i[i.length-1]==="/"?i:"".concat(i,"/")),n+=a,n[n.length-1]!=="/"&&(n+="/"),n+=r,/^https?:\/\//.test(n)||(n="/".concat(n),n=n.replace(/\/+/g,"/"))),n}},{key:"_configureDefaultPassthroughs",value:function(){var r=this;RA.forEach(function(n){r.passthrough(n)})}},{key:"_typeIsPluralForModel",value:function(r){if(typeof Hc[r]!="boolean"){var n=this._modelOrFactoryExistsForTypeOrCollectionName(r),i=r===this.inflector.pluralize(r),a=this.inflector.singularize(r)===this.inflector.pluralize(r),o=i&&!a&&n;Hc[r]=o}return Hc[r]}},{key:"_modelOrFactoryExistsForType",value:function(r){var n=this.schema&&this.schema.modelFor(Te(r)),i=this.db[this.schema.toInternalCollectionName(r)];return(n||i)&&!this._typeIsPluralForModel(r)}},{key:"_modelOrFactoryExistsForTypeOrCollectionName",value:function(r){var n=this.schema&&this.schema.modelFor(Te(r)),i=this.db[this.schema.toInternalCollectionName(r)];return n||i}},{key:"_validateTraits",value:function(r,n,i){r.forEach(function(a){if(!n.isTrait(a))throw new Error("'".concat(a,"' trait is not registered in '").concat(i,"' factory"))})}},{key:"_mergeExtensions",value:function(r,n,i){var a=n.map(function(o){return r[o].extension});return a.push(i||{}),a.reduce(function(o,s){return Ec(o,s)},{})}},{key:"_mapAssociationsFromAttributes",value:function(r,n){var i=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(n||{}).filter(function(o){return yA(n[o])}).forEach(function(o){var s=i.schema.modelClassFor(r),u=s.associationFor(o);Re(u&&u instanceof Oa,"You're using the `association` factory helper on the '".concat(o,"' attribute of your ").concat(r," factory, but that attribute is not a `belongsTo` association."));var f=u&&u instanceof Oa&&u.modelName===r;Re(!f,"You're using the association() helper on your ".concat(r," factory for ").concat(o,", which is a belongsTo self-referential relationship. You can't do this as it will lead to infinite recursion. You can move the helper inside of a trait and use it selectively."));var p=u&&u.opts&&u.opts.polymorphic;Re(!p,"You're using the association() helper on your ".concat(r," factory for ").concat(o,", which is a polymorphic relationship. This is not currently supported."));var d=n[o],y="".concat(Te(o),"Id");a[o]||(n[y]=i.create.apply(i,[u.modelName].concat(Vo(d.traitsAndOverrides))).id),delete n[o]})}}]),e}(),NA=Yn.extend({serializeIds:"always",normalizeIds:!0,keyForModel:function(t){return Gn(t)},keyForAttribute:function(t){return Gn(t)},keyForRelationship:function(t){return this._container.inflector.pluralize(Gn(t))},keyForEmbeddedRelationship:function(t){return Gn(t)},keyForRelationshipIds:function(t){return"".concat(Gn(this._container.inflector.singularize(t)),"_ids")},keyForForeignKey:function(t){return"".concat(Gn(t),"_id")},keyForPolymorphicForeignKeyId:function(t){return"".concat(Gn(t),"_id")},keyForPolymorphicForeignKeyType:function(t){return"".concat(Gn(t),"_type")},normalize:function(t){var r=this,n=Object.keys(t)[0],i=t[n],a=Te(n),o=this.schema.modelClassFor(a),s=o.belongsToAssociations,u=o.hasManyAssociations,f=Object.keys(s),p=Object.keys(u),d={data:{type:this._container.inflector.pluralize(n),attributes:{}}};i.id&&(d.data.id=i.id);var y={};return Object.keys(i).forEach(function(A){if(A!=="id")if(r.normalizeIds)if(f.includes(A)){var P=s[A],C=P.modelName;y[Ot(A)]={data:{type:C,id:i[A]}}}else if(p.includes(A)){var v=u[A],I=v.modelName,T=i[A].map(function(M){return{type:I,id:M}});y[Ot(A)]={data:T}}else d.data.attributes[Ot(A)]=i[A];else d.data.attributes[Ot(A)]=i[A]}),Object.keys(y).length&&(d.data.relationships=y),d},getCoalescedIds:function(t){return t.queryParams&&t.queryParams.ids}});NA.extend({serializeIds:"always",keyForModel:function(t){return Te(t)},keyForAttribute:function(t){return Te(t)},keyForRelationship:function(t){return Te(this._container.inflector.pluralize(t))},keyForEmbeddedRelationship:function(t){return Te(t)},keyForRelationshipIds:function(t){return Te(this._container.inflector.pluralize(t))},keyForForeignKey:function(t){return Te(this._container.inflector.singularize(t))},getCoalescedIds:function(t){return t.queryParams&&t.queryParams.ids}});function DA(){return FA({routes(){this.namespace="api",this.get("/titlebar",()=>({product:{name:"Booking Engine",href:"/hotel_admin/spl.jsp"},propertySelector:{type:"fetch",hotels:"/api/hotels"},user:{label:"Profile",children:[{label:"Maintain Users",href:"https://admin-dc.dev.bookassist.com/hotel_admin/maintain_users.jsp"},{label:"Change Password",href:"https://admin-dc.dev.bookassist.com/hotel_admin/login.jsp?resetpass"},{label:"Log Out",href:"https://admin-dc.bookassist.com/hotel_admin/logout.jsp"}]},languageSelector:{label:"Language",children:[{code:"en",label:"EnGlIsH"},{code:"cs"},{code:"de"},{code:"es"},{code:"fr"},{code:"it"},{code:"pl"},{code:"pt"}]},help:{label:"Help Center",href:"https://go.bookassist.org/en/knowledge/booking-engine"}})),this.get("/menu",()=>[{id:"raq3yznphb",label:"Hotel setup"},{id:"xjcwuw5o0wl",parentId:"raq3yznphb",label:"Hotel Logo",href:"#HotelLogo"},{id:"epzy61enrwu",parentId:"raq3yznphb",label:"Hotel Mobile Colours",href:"#HotelMobileColours"},{id:"szeh0zcpjn",parentId:"raq3yznphb",label:"Deposit Invoices",href:"#Invoices"},{id:"65csve3x2l",parentId:"raq3yznphb",label:"General Hotel Policies",href:"#GeneralHotelPolicies"},{id:"5tequyqbitm",parentId:"raq3yznphb",label:"Locate your hotel",href:"#Locateyourhotel"},{id:"mk86ze75d7",parentId:"raq3yznphb",label:"Premium example",premium:{value:!0,locked:!0}},{id:"f1ec1ry0rro",label:"Rooms/Packages"},{id:"w7x9wwfq4ge",parentId:"f1ec1ry0rro",label:"Manage Rooms & Packages",href:"#ManageRoomsPackages"},{id:"njxovt6l0d",parentId:"f1ec1ry0rro",label:"Book without credit card",href:"#Bookwithoutcreditcard"},{id:"39dl1gf3e8x",parentId:"f1ec1ry0rro",label:"XMLConnector Inventory",href:"#XMLConnectorInventory"},{id:"0qwiv7k5i6md",label:"Rates/Availability"},{id:"o3qrjsnlyin",parentId:"0qwiv7k5i6md",label:"Availability",group:"Availability"},{id:"gk3gwhnfo8j",parentId:"o3qrjsnlyin",label:"Edit Availability",href:"#EditAvailability"},{id:"g95dnxr3ifb",parentId:"o3qrjsnlyin",label:"Availability Batch",href:"#AvailabilityBatch"},{id:"8lttj490hu8",parentId:"0qwiv7k5i6md",label:"Availability and Rate Details",href:"#AvailabilityandRateDetails",group:"Availability"},{id:"7y6i0dnzc8o",parentId:"0qwiv7k5i6md",label:"Edit Rates",href:"#EditRates",group:"Rates"},{id:"o7c1dx9xume",parentId:"0qwiv7k5i6md",label:"Adjust Rates Manually",group:"Rates"},{id:"an9perx1x67",parentId:"o7c1dx9xume",label:"Adjust Rates",href:"#AdjustRates"},{id:"irtojrlv0t8",parentId:"o7c1dx9xume",label:"Rates Batch",href:"#RatesBatch"},{id:"j4mctyj216",parentId:"0qwiv7k5i6md",label:"Minimum Stays",group:"Restrictions"},{id:"yus5cglsgmm",parentId:"j4mctyj216",label:"Edit Minimum Stays",href:"#EditMinimumStays"},{id:"di4smaz6oyk",parentId:"j4mctyj216",label:"Batch",href:"#Batch"},{id:"3nvl2vajzb8",parentId:"0qwiv7k5i6md",label:"Closed For Arrival",group:"Restrictions"},{id:"gs54wi7f3ov",parentId:"3nvl2vajzb8",label:"Edit Closed For Arrival",href:"#EditClosedForArrival"},{id:"o8xoquq2vhm",parentId:"3nvl2vajzb8",label:"Batch",href:"#Batch"},{id:"a3lezzgyke",parentId:"0qwiv7k5i6md",label:"Open/Close Rooms",group:"Restrictions"},{id:"yhmwk4ntycs",parentId:"a3lezzgyke",label:"Edit Open/Close Rooms",href:"#EditOpenCloseRooms"},{id:"i00jgm1jw4",parentId:"a3lezzgyke",label:"Batch",href:"#Batch"},{id:"nwvz5qdsn4",parentId:"0qwiv7k5i6md",label:"Open/Closed Rooms Report",href:"#OpenClosedRoomsReport",group:"Restrictions"},{id:"xet04pxoomi",parentId:"0qwiv7k5i6md",label:"Extra Beds"},{id:"ww3e5s1k37s",parentId:"xet04pxoomi",label:"Edit Extra Beds",href:"#EditExtraBeds",group:"Restrictions"},{id:"3kdww03xlh8",parentId:"xet04pxoomi",label:"Batch",href:"#Batch"},{id:"462vczykrt8",label:"Extras"},{id:"rk6y9sxm8km",parentId:"462vczykrt8",label:"Manage Meal Plans",href:"#ManageMealPlans",group:"Meal Plans"},{id:"wg3uwe8mh2",parentId:"462vczykrt8",label:"Meal Plans Prices",group:"Meal Plans"},{id:"g128kodkhjo",parentId:"wg3uwe8mh2",label:"Edit Meal Plans Prices",href:"#EditMealPlansPrices"},{id:"xod48otj9o",parentId:"wg3uwe8mh2",label:"Meal Plans Prices Batch",href:"#MealPlansPricesBatch"},{id:"kwmxcwr5y8s",parentId:"462vczykrt8",label:"Open/Close Add-ons",href:"#OpenCloseAddons",group:"Add-Ons"},{id:"rbk08ib5mxb",parentId:"462vczykrt8",label:"Switch Off Add-ons",href:"#SwitchOffAddons",group:"Add-Ons"},{id:"ntbts4i22sb",parentId:"462vczykrt8",label:"Dynamic Discounts",href:"#DynamicDiscounts",group:"Discounts"},{id:"736g9tauy6k",parentId:"462vczykrt8",label:"Open/Close Discounts",group:"Discounts"},{id:"2qvsnasaj1l",parentId:"736g9tauy6k",label:"Edit Open/Close Discounts",href:"#EditOpenCloseDiscounts"},{id:"nj3242z7nt",parentId:"736g9tauy6k",label:"Batch",href:"#Batch"},{id:"ocf8po5w2el",parentId:"462vczykrt8",label:"Open/Close IRS",href:"#OpenCloseIRS",group:"Upselling"},{id:"5kccvsqsuf4",label:"Reservations",href:"#Reservations"},{id:"vu9d7b45nte",parentId:"5kccvsqsuf4",label:"Manage Reservation",href:"#ManageReservation"},{id:"f437g317fjc",parentId:"5kccvsqsuf4",label:"Search Reservations",href:"#SearchReservations"},{id:"k5464kvte8l",parentId:"5kccvsqsuf4",label:"Bookings Reports",href:"#BookingsReports"},{id:"cb58wdcv38c",label:"Corporate",href:"#Corporate"},{id:"3r614o7kqby",parentId:"cb58wdcv38c",label:"Customer list",href:"#Customerlist"},{id:"3qa95mud1xf",parentId:"cb58wdcv38c",label:"Categories",href:"#Categories"},{id:"af6698sant",parentId:"cb58wdcv38c",label:"Companies",href:"#Companies"},{id:"2wbkjjcia",parentId:"cb58wdcv38c",label:"Corporate Rates",href:"#CorporateRates"},{id:"hyaxqvj6doh",parentId:"cb58wdcv38c",label:"Corp Rate Groups",href:"#CorpRateGroups"},{id:"6rocuyqud7m",parentId:"cb58wdcv38c",label:"Create Rewards",href:"#CreateRewards"},{id:"a07tcgufbqm",parentId:"cb58wdcv38c",label:"Create New Customer",href:"#CreateNewCustomer"},{id:"s0ioinudzz",parentId:"cb58wdcv38c",label:"Voucher Availability",href:"#VoucherAvailability"},{id:"emm4qyt75ga",label:"Reputation",href:"#Reputation"},{id:"ysvbfa69j6",parentId:"emm4qyt75ga",label:"Direct Customer Reviews",href:"#DirectCustomerReviews"},{id:"67e1vjgsbl7",label:"Vouchers",href:"#Vouchers"},{id:"vx6f8cd05od",parentId:"67e1vjgsbl7",label:"Create Vouchers",href:"#CreateVouchers"},{id:"9fvp9xal5qo",parentId:"67e1vjgsbl7",label:"Purchased Vouchers",href:"#PurchasedVouchers"},{id:"bhe7fnem0nt",parentId:"67e1vjgsbl7",label:"Vouchers delivery options",href:"#Vouchersdeliveryoptions"}]),this.get("/notifications",()=>({en:[{title:"Test header 1",items:[{title:"Sollicitudin Vulputate Nibh Adipiscing",url:"#",date:"2022-01-01"},{title:"Ipsum Dolor Sem Ligula",url:"#",date:"2022-01-05"},{title:"Vestibulum Amet Risus Vehicula",url:"#",date:"2022-02-07"},{title:"Ullamcorper Parturient Malesuada Magna",url:"#",date:"2022-02-15"},{title:"Sollicitudin Vulputate Nibh Adipiscing",url:"#",date:"2022-03-04"}]},{title:"Test header 2",items:[{title:"Vestibulum Amet Risus Vehicula",url:"#",date:"2022-01-03"},{title:"Ullamcorper Parturient Malesuada Magna",url:"#",date:"2022-02-14"},{title:"Sollicitudin Vulputate Nibh Adipiscing",url:"#",date:"2022-03-03"},{title:"Ipsum Dolor Sem Ligula",url:"#",date:"2022-03-31"},{title:"Vestibulum Amet Risus Vehicula",url:"#",date:"2022-04-04"}]}],es:[{title:"Test header 1 ES",items:[{title:"ES Sollicitudin Vulputate Nibh Adipiscing",url:"#",date:"2022-01-01"},{title:"ES Ipsum Dolor Sem Ligula",url:"#",date:"2022-01-05"}]},{title:"Test header 2 ES",items:[{title:"ES Ipsum Dolor Sem Ligula",url:"#",date:"2022-03-31"},{title:"ES Vestibulum Amet Risus Vehicula",url:"#",date:"2022-04-04"}]}]})),this.get("/hotels",()=>[[" NON ATTIVO - Hotel Lunetta","2071_808"],["987 Design Prague Hotel","3291_802"],["A.Liebeskind Hotel","4012_823"],["Abbey Hotel Ballyvourney","2155_2"],["ABC Arabian Suites","2001_829"],["Abito Hotel","3425_802"],["Abrial Hotel","1101_600"],["Academy Plaza Hotel","9_1"],["Actons Hotel Kinsale","1739_2"],["ADLER HOTEL","3724_802"],["Adria Hotel Prague","1465_802"],["Agroturismo Can Toni Xumeu","3033_102"],["AGUA DE MaR Hotel Boutique","2620_102"],["Aida Plaza Hotel","2677_810"],["Akademik Collegia","3976_823"],["Akcent Hotel","2017_802"],["Al Buraimi Hotel","2076_869"],["Albergo Firenze","2722_808"],["Alef Hotel","3672_809"],["Alerion Hotel","2673_600"],["Aletti Palace Hotel","1742_600"],["Alexandra Lodge","1801_401"],["Allegroitalia Elba Capo D'arco","3160_808"],["Allegroitalia Elba Golf","3161_808"],["Allegroitalia Espresso Bologna","3115_808"],["Allegroitalia Etna Pedara","3163_808"],["Allegroitalia Golden Palace","3116_808"],["Allegroitalia Nazionale Volterra","3176_808"]]),this.passthrough("https://www.bookassist.com/**"),this.passthrough("https://exceptions.hubspot.com/**"),this.passthrough("https://api.hubspot.com/**")}})}var rg={exports:{}},jA="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",LA=jA,zA=LA;function ng(){}function ig(){}ig.resetWarningCache=ng;var HA=function(){function e(n,i,a,o,s,u){if(u!==zA){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ig,resetWarningCache:ng};return r.PropTypes=r,r};rg.exports=HA();var se=rg.exports,gi=ot.default.createContext(null);function UA(e){e()}var ag=UA,BA=function(t){return ag=t},kA=function(){return ag};function WA(){var e=kA(),t=null,r=null;return{clear:function(){t=null,r=null},notify:function(){e(function(){for(var i=t;i;)i.callback(),i=i.next})},get:function(){for(var i=[],a=t;a;)i.push(a),a=a.next;return i},subscribe:function(i){var a=!0,o=r={callback:i,next:null,prev:r};return o.prev?o.prev.next=o:t=o,function(){!a||t===null||(a=!1,o.next?o.next.prev=o.prev:r=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}var og={notify:function(){},get:function(){return[]}};function sg(e,t){var r,n=og;function i(d){return u(),n.subscribe(d)}function a(){n.notify()}function o(){p.onStateChange&&p.onStateChange()}function s(){return Boolean(r)}function u(){r||(r=t?t.addNestedSub(o):e.subscribe(o),n=WA())}function f(){r&&(r(),r=void 0,n.clear(),n=og)}var p={addNestedSub:i,notifyNestedSubs:a,handleChangeWrapper:o,isSubscribed:s,trySubscribe:u,tryUnsubscribe:f,getListeners:function(){return n}};return p}var Bc=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?z.useLayoutEffect:z.useEffect,Zo={exports:{}},Pa={};/*
|
|
26
|
+
`).concat(a.stack||a)})}}return this._toMirageResponse(n)}},{key:"_toMirageResponse",value:function(r){var n=this,i;return new Promise(function(a,o){Promise.resolve(r).then(function(s){if(s instanceof gn)i=r;else{var u=n._getCodeForResponse(s);i=new gn(u,{},s)}a(i)}).catch(o)})}},{key:"_getCodeForResponse",value:function(r){var n;return this.customizedCode?n=this.customizedCode:(n=AA[this.verb],n===204&&r!==void 0&&r!==""&&(n=200)),n}},{key:"serialize",value:function(r,n){return r.data=this.serializerOrRegistry.serialize(r.data,n),r}}]),e}();function Jp(e,t){var r=function(n){xn(a,n);var i=Cn(a);function a(){var o;vt(this,a);for(var s=arguments.length,u=new Array(s),f=0;f<s;f++)u[f]=arguments[f];if(o=i.call.apply(i,[this].concat(u)),e&&n2(e,"constructor")){var p;(p=e.constructor).call.apply(p,[Kp(o)].concat(u))}return o}return a}(this);return Object.assign(r,this,t),e&&Object.assign(r.prototype,e),r}var Xo=function(){function e(t,r,n,i){var a=this;return vt(this,e),Re(t,"A model requires a schema"),Re(r,"A model requires a modelName"),this._schema=t,this.modelName=r,this.fks=i||[],this.attrs={},n=n||{},this.fks.forEach(function(o){a.attrs[o]=n[o]!==void 0?n[o]:null}),Object.keys(n).forEach(function(o){var s=n[o];a._validateAttr(o,s),a._setupAttr(o,s),a._setupRelationship(o,s)}),this}return xt(e,[{key:"save",value:function(){var r=this._schema.toInternalCollectionName(this.modelName);return this.isNew()?(this.attrs=this._schema.db[r].insert(this.attrs),this._definePlainAttribute("id")):(this._schema.isSaving[this.toString()]=!0,this._schema.db[r].update(this.attrs.id,this.attrs)),this._saveAssociations(),this._schema.isSaving[this.toString()]=!1,this}},{key:"update",value:function(r,n){var i;return r==null?this:(nr(r)==="object"?i=r:(i={})[r]=n,Object.keys(i).forEach(function(a){!this.associationKeys.has(a)&&!this.associationIdKeys.has(a)&&this._definePlainAttribute(a),this[a]=i[a]},this),this.save(),this)}},{key:"destroy",value:function(){if(this.isSaved()){this._disassociateFromDependents();var r=this._schema.toInternalCollectionName(this.modelName);this._schema.db[r].remove(this.attrs.id)}}},{key:"isNew",value:function(){var r=!1,n=this.attrs.id!==void 0&&this.attrs.id!==null;if(n){var i=this._schema.toInternalCollectionName(this.modelName),a=this._schema.db[i].find(this.attrs.id);a&&(r=!0)}return!r}},{key:"isSaved",value:function(){return!this.isNew()}},{key:"reload",value:function(){if(this.id){var r=this._schema.toInternalCollectionName(this.modelName),n=this._schema.db[r].find(this.id);Object.keys(n).filter(function(i){return i!=="id"}).forEach(function(i){this.attrs[i]=n[i]},this)}return this._tempAssociations={},this}},{key:"toJSON",value:function(){return aA({},this.attrs)}},{key:"associations",get:function(){return this._schema.associationsFor(this.modelName)}},{key:"associationFor",value:function(r){return this.associations[r]}},{key:"inverseFor",value:function(r){return this._explicitInverseFor(r)||this._implicitInverseFor(r)}},{key:"_explicitInverseFor",value:function(r){this._checkForMultipleExplicitInverses(r);var n=this._schema.associationsFor(this.modelName),i=r.opts.inverse,a=i?n[i]:null,o=a&&a.isPolymorphic,s=a&&a.modelName===r.ownerModelName,u=a&&a.opts.inverse;return u&&a.opts.inverse!==r.name&&Re(!1,"You specified an inverse of ".concat(i," for ").concat(r.name,", but it does not match ").concat(a.modelName," ").concat(a.name,"'s inverse")),o||s?a:null}},{key:"_checkForMultipleExplicitInverses",value:function(r){var n=this._schema.associationsFor(this.modelName),i=Object.keys(n).filter(function(a){var o=n[a],s=r.ownerModelName===o.modelName,u=r.name===o.opts.inverse;return s&&u});Re(i.length<=1,"The ".concat(this.modelName," model has defined multiple explicit inverse associations for the ").concat(r.ownerModelName,".").concat(r.name," association."))}},{key:"_implicitInverseFor",value:function(r){var n=this,i=this._schema.associationsFor(this.modelName),a=r.ownerModelName;return yc(i).filter(function(o){return o.modelName===a}).reduce(function(o,s){var u=s.opts.inverse,f=u===void 0,p=u===r.name,d=f||p;return d&&(Re(!o,"The ".concat(n.modelName," model has multiple possible inverse associations for the ").concat(r.ownerModelName,".").concat(r.name," association.")),o=s),o},null)}},{key:"hasInverseFor",value:function(r){return!!this.inverseFor(r)}},{key:"alreadyAssociatedWith",value:function(r,n){var i=this[n.name];if(i&&r)return i instanceof e?i.isSaved()&&r.isSaved()?i.toString()===r.toString():i===r:i.includes(r)}},{key:"associate",value:function(r,n){if(!this.alreadyAssociatedWith(r,n)){var i=n.name;n instanceof Sa?this[i].includes(r)||this[i].add(r):this[i]=r}}},{key:"disassociate",value:function(r,n){var i=n.getForeignKey();if(n instanceof Sa){var a;if(n.isPolymorphic){var o=this[i].find(function(s){var u=s.type,f=s.id;return u===r.modelName&&f===r.id});a=o&&this[i].indexOf(o)}else a=this[i].map(function(s){return s.toString()}).indexOf(r.id.toString());a>-1&&this.attrs[i].splice(a,1)}else this.attrs[i]=null}},{key:"isSaving",get:function(){return this._schema.isSaving[this.toString()]}},{key:"_setupAttr",value:function(r,n){var i=this.associationKeys.has(r)||this.associationIdKeys.has(r);i||(this.attrs[r]=n,this._definePlainAttribute(r))}},{key:"_definePlainAttribute",value:function(r){var n=Object.getOwnPropertyDescriptor(this,r);n&&n.get||(Object.prototype.hasOwnProperty.call(this.attrs,r)||(this.attrs[r]=null),Object.defineProperty(this,r,{get:function(){return this.attrs[r]},set:function(a){this.attrs[r]=a}}))}},{key:"_setupRelationship",value:function(r,n){var i=this.associationIdKeys.has(r)||this.fks.includes(r),a=this.associationKeys.has(r);i&&(n!=null&&this._validateForeignKeyExistsInDatabase(r,n),this.attrs[r]=n),a&&(this[r]=n)}},{key:"_validateAttr",value:function(r,n){if(this.associationKeys.has(r)){var i=this.associationFor(r),a=n===null;if(i instanceof Sa){var o=n instanceof Vn||n instanceof an,s=Array.isArray(n)&&n.every(function(A){return A instanceof e});Re(o||s||a,"You're trying to create a ".concat(this.modelName,' model and you passed in "').concat(n,'" under the ').concat(r," key, but that key is a HasMany relationship. You must pass in a Collection, PolymorphicCollection, array of Models, or null."))}else i instanceof Oa&&Re(n instanceof e||a,"You're trying to create a ".concat(this.modelName,' model and you passed in "').concat(n,'" under the ').concat(r," key, but that key is a BelongsTo relationship. You must pass in a Model or null."))}if(this.associationIdKeys.has(r)&&r.endsWith("Ids")){var u=Array.isArray(n),f=n===null;Re(u||f,"You're trying to create a ".concat(this.modelName,' model and you passed in "').concat(n,'" under the ').concat(r," key, but that key is a foreign key for a HasMany relationship. You must pass in an array of ids or null."))}{var p=n instanceof e||n instanceof Vn||n instanceof an,d=Array.isArray(n)&&n.length&&n.every(function(A){return A instanceof e});if(p||d){var y=n;Re(this.associationKeys.has(r),"You're trying to create a ".concat(this.modelName," model and you passed in a ").concat(y.toString()," under the ").concat(r," key, but you haven't defined that key as an association on your model."))}}}},{key:"_validateForeignKeyExistsInDatabase",value:function(r,n){var i=this;if(Array.isArray(n)){var a=this.hasManyAssociationFks[r],o;a.isPolymorphic?(o=n.map(function(d){var y=d.type,A=d.id;return i._schema.db[i._schema.toInternalCollectionName(y)].find(A)}),o=jo(o)):o=this._schema.db[this._schema.toInternalCollectionName(a.modelName)].find(n);var s=a.isPolymorphic?n.map(function(d){return"".concat(d.type,":").concat(d.id)}).join(","):n;Re(o.length===n.length,"You're instantiating a ".concat(this.modelName," that has a ").concat(r," of ").concat(s,", but some of those records don't exist in the database."))}else{var u=this.belongsToAssociationFks[r],f;u.isPolymorphic?f=this._schema.db[this._schema.toInternalCollectionName(n.type)].find(n.id):f=this._schema.db[this._schema.toInternalCollectionName(u.modelName)].find(n);var p=u.isPolymorphic?"".concat(n.type,":").concat(n.id):n;Re(f,"You're instantiating a ".concat(this.modelName," that has a ").concat(r," of ").concat(p,", but that record doesn't exist in the database."))}}},{key:"_saveAssociations",value:function(){this._saveBelongsToAssociations(),this._saveHasManyAssociations()}},{key:"_saveBelongsToAssociations",value:function(){var r=this;yc(this.belongsToAssociations).forEach(function(n){r._disassociateFromOldInverses(n),r._saveNewAssociates(n),r._associateWithNewInverses(n)})}},{key:"_saveHasManyAssociations",value:function(){var r=this;yc(this.hasManyAssociations).forEach(function(n){r._disassociateFromOldInverses(n),r._saveNewAssociates(n),r._associateWithNewInverses(n)})}},{key:"_disassociateFromOldInverses",value:function(r){r instanceof Sa?this._disassociateFromHasManyInverses(r):r instanceof Oa&&this._disassociateFromBelongsToInverse(r)}},{key:"_disassociateFromHasManyInverses",value:function(r){var n=this,i=r.getForeignKey(),a=this._tempAssociations&&this._tempAssociations[r.name],o=this.attrs[i];if(a&&o){var s;r.isPolymorphic?s=o.map(function(u){var f=u.type,p=u.id;return n._schema[n._schema.toCollectionName(f)].find(p)}):s=this._schema[this._schema.toCollectionName(r.modelName)].find(o||[]).models,s.filter(function(u){return!u.isSaving&&!a.includes(u)&&u.hasInverseFor(r)}).forEach(function(u){var f=u.inverseFor(r);u.disassociate(n,f),u.save()})}}},{key:"_disassociateFromBelongsToInverse",value:function(r){var n=r.getForeignKey(),i=this._tempAssociations&&this._tempAssociations[r.name],a=this.attrs[n];if(i!==void 0&&a){var o;if(r.isPolymorphic?o=this._schema[this._schema.toCollectionName(a.type)].find(a.id):o=this._schema[this._schema.toCollectionName(r.modelName)].find(a),o.hasInverseFor(r)){var s=o.inverseFor(r);o.disassociate(this,s),o._updateInDb(o.attrs)}}}},{key:"_disassociateFromDependents",value:function(){var r=this;this._schema.dependentAssociationsFor(this.modelName).forEach(function(n){n.disassociateAllDependentsFromTarget(r)})}},{key:"_saveNewAssociates",value:function(r){var n=r.getForeignKey(),i=this._tempAssociations&&this._tempAssociations[r.name];if(i!==void 0){if(this.__isSavingNewChildren=!0,delete this._tempAssociations[r.name],i instanceof Vn)i.models.filter(function(o){return!o.isSaving}).forEach(function(o){o.save()}),this._updateInDb(rn({},n,i.models.map(function(o){return o.id})));else if(i instanceof an)i.models.filter(function(o){return!o.isSaving}).forEach(function(o){o.save()}),this._updateInDb(rn({},n,i.models.map(function(o){return{type:o.modelName,id:o.id}})));else if(i===null)this._updateInDb(rn({},n,null));else if(this.equals(i))this._updateInDb(rn({},n,this.id));else if(!i.isSaving){i.save(),this._syncTempAssociations(i);var a;r.isPolymorphic?a={id:i.id,type:i.modelName}:a=i.id,this._updateInDb(rn({},n,a))}this.__isSavingNewChildren=!1}}},{key:"_associateWithNewInverses",value:function(r){var n=this;if(!this.__isSavingNewChildren){var i=this[r.name];i instanceof e?this._associateModelWithInverse(i,r):(i instanceof Vn||i instanceof an)&&i.models.forEach(function(a){n._associateModelWithInverse(a,r)}),delete this._tempAssociations[r.name]}}},{key:"_associateModelWithInverse",value:function(r,n){var i=this;if(r.hasInverseFor(n)){var a=r.inverseFor(n),o=a.getForeignKey(),s=this.id;if(a instanceof Oa){var u;a.isPolymorphic?u={type:this.modelName,id:s}:u=s,this._schema.db[this._schema.toInternalCollectionName(r.modelName)].update(r.id,rn({},o,u))}else{var f=this._schema.db[this._schema.toInternalCollectionName(r.modelName)],p=f.find(r.id)[a.getForeignKey()]||[],d=Object.assign([],p),y,A;a.isPolymorphic?(y={type:this.modelName,id:s},A=d.some(function(P){return P.type==i.modelName&&P.id==s})):(y=s,A=d.includes(s)),A||d.push(y),f.update(r.id,rn({},o,d))}}}},{key:"_updateInDb",value:function(r){this.attrs=this._schema.db[this._schema.toInternalCollectionName(this.modelName)].update(this.attrs.id,r)}},{key:"_syncTempAssociations",value:function(r){var n=this;Object.keys(this._tempAssociations).forEach(function(i){n._tempAssociations[i]&&n._tempAssociations[i].toString()===r.toString()&&(n._tempAssociations[i]=r)})}},{key:"toString",value:function(){var r=this.id?"(".concat(this.id,")"):"";return"model:".concat(this.modelName).concat(r)}},{key:"equals",value:function(r){return this.toString()===r.toString()}}]),e}();Xo.extend=Jp,Xo.findBelongsToAssociation=function(e){return this.prototype.belongsToAssociations[e]};var Yn=function(){function e(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};vt(this,e),this.registry=t,this.type=r,this.request=n,this.attrs=this.attrs||void 0,this.include=this.include||[],this.root=this.root||void 0,this.embed=this.embed||void 0,this.serializeIds=this.serializeIds||void 0}return xt(e,[{key:"serialize",value:function(r){return this.primaryResource=r,this.buildPayload(r)}},{key:"normalize",value:function(r){return r}},{key:"buildPayload",value:function(r,n,i,a){if(!r&&vc(n))return a;if(r){var o=this.getHashForPrimaryResource(r),s=nn(o,2),u=s[0],f=s[1],p=this.isCollection(r)?r.models:[r];return this.buildPayload(void 0,f,p,u)}else{var d=n.shift(),y=this.getHashForIncludedResource(d),A=nn(y,2),P=A[0],C=A[1],v=C.filter(function(M){return!i.map(function(L){return L.toString()}).includes(M.toString())}).concat(n),I=(this.isCollection(d)?d.models:[d]).concat(i),T=this.mergePayloads(a,P);return this.buildPayload(void 0,v,I,T)}}},{key:"getHashForPrimaryResource",value:function(r){var n=this.getHashForResource(r),i=nn(n,2),a=i[0],o=i[1],s;if(this.root){Re(!(r instanceof an),"The base Serializer class cannot serialize a top-level PolymorphicCollection when root is true, since PolymorphicCollections have no type.");var u=this.serializerFor(r.modelName),f=u.keyForResource(r);s=rn({},f,a)}else s=a;return[s,o]}},{key:"getHashForIncludedResource",value:function(r){var n,i;if(r instanceof an)n={},i=r.models;else{var a=this.serializerFor(r.modelName),o=a.getHashForResource(r),s=nn(o,2),u=s[0],f=s[1],p=a.keyForRelationship(r.modelName);n=Array.isArray(u)?rn({},p,u):rn({},p,[u]),i=f}return[n,i]}},{key:"getHashForResource",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s,u;if(o||(u=this),o&&r.modelName&&(u=this.serializerFor(r.modelName)),this.isModel(r)?s=u._hashForModel(r,i,a):s=r.models.map(function(p){var d=u;return d||(d=n.serializerFor(p.modelName)),d._hashForModel(p,i,a)}),this.embed)return[s,[]];var f=bp(jo(Dd(u.getKeysForIncluded().map(function(p){return n.isCollection(r)?r.models.map(function(d){return d[p]}):r[p]}))),function(p){return p.toString()});return[s,f]}},{key:"mergePayloads",value:function(r,n){var i,a=Object.keys(n),o=nn(a,1),s=o[0];return r[s]?(i=r,i[s]=r[s].concat(n[s])):i=Object.assign(r,n),i}},{key:"keyForResource",value:function(r){var n=r.modelName;return this.isModel(r)?this.keyForModel(n):this.keyForCollection(n)}},{key:"keyForModel",value:function(r){return Te(r)}},{key:"keyForCollection",value:function(r){return this._container.inflector.pluralize(this.keyForModel(r))}},{key:"_hashForModel",value:function(r,n){var i=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this._attrsForModel(r);if(n&&r.fks.forEach(function(u){delete o[u]}),this.embed){var s=Object.assign({},a);return s[r.modelName]=s[r.modelName]||{},s[r.modelName][r.id]=!0,this.getKeysForIncluded().forEach(function(u){var f=r[u];if(f&&!vp(s,"".concat(f.modelName,".").concat(f.id))){var p=i.getHashForResource(f,!0,s,!0),d=nn(p,1),y=d[0],A=i.keyForEmbeddedRelationship(u);if(o[A]=y,i.isModel(f)){var P="".concat(Te(u),"Id");delete o[P]}}}),o}else return this._maybeAddAssociationIds(r,o)}},{key:"_attrsForModel",value:function(r){var n={};return this.attrs?n=this.attrs.reduce(function(i,a){return i[a]=r[a],i},{}):n=Object.assign(n,r.attrs),r.fks.forEach(function(i){return delete n[i]}),this._formatAttributeKeys(n)}},{key:"_maybeAddAssociationIds",value:function(r,n){var i=this,a=Object.assign({},n);return this.serializeIds==="always"?r.associationKeys.forEach(function(o){var s=r[o],u=r.associationFor(o);if(i.isCollection(s)){var f=i.keyForRelationshipIds(o);a[f]=r["".concat(i._container.inflector.singularize(o),"Ids")]}else if(i.isModel(s)&&u.isPolymorphic){var p=i.keyForPolymorphicForeignKeyType(o),d=i.keyForPolymorphicForeignKeyId(o);a[p]=r["".concat(o,"Id")].type,a[d]=r["".concat(o,"Id")].id}else if(s){var y=i.keyForForeignKey(o);a[y]=r["".concat(o,"Id")]}}):this.serializeIds==="included"&&this.getKeysForIncluded().forEach(function(o){var s=r[o],u=r.associationFor(o);if(i.isCollection(s)){var f=i.keyForRelationshipIds(o);a[f]=r["".concat(i._container.inflector.singularize(o),"Ids")]}else if(i.isModel(s)&&u.isPolymorphic){var p=i.keyForPolymorphicForeignKeyType(o),d=i.keyForPolymorphicForeignKeyId(o);a[p]=r["".concat(o,"Id")].type,a[d]=r["".concat(o,"Id")].id}else if(i.isModel(s)){var y=i.keyForForeignKey(o);a[y]=r["".concat(o,"Id")]}}),a}},{key:"keyForAttribute",value:function(r){return r}},{key:"keyForRelationship",value:function(r){return Te(this._container.inflector.pluralize(r))}},{key:"keyForEmbeddedRelationship",value:function(r){return Te(r)}},{key:"keyForRelationshipIds",value:function(r){return"".concat(this._container.inflector.singularize(Te(r)),"Ids")}},{key:"keyForForeignKey",value:function(r){return"".concat(Te(r),"Id")}},{key:"keyForPolymorphicForeignKeyId",value:function(r){return"".concat(Te(r),"Id")}},{key:"keyForPolymorphicForeignKeyType",value:function(r){return"".concat(Te(r),"Type")}},{key:"isModel",value:function(r){return r instanceof Xo}},{key:"isCollection",value:function(r){return r instanceof Vn||r instanceof an}},{key:"isModelOrCollection",value:function(r){return this.isModel(r)||this.isCollection(r)}},{key:"serializerFor",value:function(r){return this.registry.serializerFor(r)}},{key:"getKeysForIncluded",value:function(){return A1(this.include)?this.include(this.request,this.primaryResource):this.include}},{key:"schema",get:function(){return this.registry.schema}},{key:"_formatAttributeKeys",value:function(r){var n={};for(var i in r){var a=this.keyForAttribute(i);n[a]=r[i]}return n}},{key:"getCoalescedIds",value:function(){}}]),e}();Yn.prototype.include=[],Yn.prototype.root=!0,Yn.prototype.embed=!1,Yn.prototype.serializeIds="included",Yn.extend=Jp;var Xp=function(e){xn(r,e);var t=Cn(r);function r(){var n;return vt(this,r),n=t.apply(this,arguments),n.alwaysIncludeLinkageData=n.alwaysIncludeLinkageData||void 0,n}return xt(r,[{key:"keyForModel",value:function(i){return Ot(i)}},{key:"keyForCollection",value:function(i){return Ot(i)}},{key:"keyForAttribute",value:function(i){return Ot(i)}},{key:"keyForRelationship",value:function(i){return Ot(i)}},{key:"links",value:function(){}},{key:"getHashForPrimaryResource",value:function(i){this._createRequestedIncludesGraph(i);var a=this.getHashForResource(i),o={data:a},s=this.getAddToIncludesForResource(i);return[o,s]}},{key:"getHashForIncludedResource",value:function(i){var a=this.serializerFor(i.modelName),o=a.getHashForResource(i),s={included:this.isModel(i)?[o]:o},u=[];return this.hasQueryParamIncludes()||(u=this.getAddToIncludesForResource(i)),[s,u]}},{key:"getHashForResource",value:function(i){var a=this,o;return this.isModel(i)?o=this.getResourceObjectForModel(i):o=i.models.map(function(s){return a.getResourceObjectForModel(s)}),o}},{key:"getAddToIncludesForResource",value:function(i){var a;if(this.hasQueryParamIncludes())a=this.request.queryParams.include.split(",");else{var o=this.serializerFor(i.modelName);a=o.getKeysForIncluded()}return this.getAddToIncludesForResourceAndPaths(i,a)}},{key:"getAddToIncludesForResourceAndPaths",value:function(i,a){var o=this,s=[];return a.forEach(function(u){var f=u.split("."),p=o.getIncludesForResourceAndPath.apply(o,[i].concat(Vo(f)));s.push(p)}),bp(jo(Dd(s)),function(u){return u.toString()})}},{key:"getIncludesForResourceAndPath",value:function(i){for(var a=this,o=arguments.length,s=new Array(o>1?o-1:0),u=1;u<o;u++)s[u-1]=arguments[u];var f=Te(s.shift()),p=[],d=[];if(this.isModel(i)){var y=i[f];this.isModel(y)?d=[y]:this.isCollection(y)&&(d=y.models)}else i.models.forEach(function(A){var P=A[f];a.isModel(P)?d.push(P):a.isCollection(P)&&(d=d.concat(P.models))});return p=p.concat(d),s.length&&d.forEach(function(A){p=p.concat(a.getIncludesForResourceAndPath.apply(a,[A].concat(s)))}),p}},{key:"getResourceObjectForModel",value:function(i){var a=this._attrsForModel(i,!0);delete a.id;var o={type:this.typeKeyForModel(i),id:i.id,attributes:a};return this._maybeAddRelationshipsToResourceObjectForModel(o,i)}},{key:"_maybeAddRelationshipsToResourceObjectForModel",value:function(i,a){var o=this,s={};return a.associationKeys.forEach(function(u){var f=a[u],p=o.keyForRelationship(u),d={};if(o.hasLinksForRelationship(a,u)){var y=o.serializerFor(a.modelName),A=y.links(a);d.links=A[u]}if(o.alwaysIncludeLinkageData||o.shouldIncludeLinkageData(u,a)||o._relationshipIsIncludedForModel(u,a)){var P=null;o.isModel(f)?P={type:o.typeKeyForModel(f),id:f.id}:o.isCollection(f)&&(P=f.models.map(function(C){return{type:o.typeKeyForModel(C),id:C.id}})),d.data=P}vc(d)||(s[p]=d)}),vc(s)||(i.relationships=s),i}},{key:"hasLinksForRelationship",value:function(i,a){var o=this.serializerFor(i.modelName),s=o.links&&o.links(i);return s&&s[a]!=null}},{key:"_relationshipIsIncludedForModel",value:function(i,a){if(this.hasQueryParamIncludes()){var o=this.request._includesGraph,s=this._graphKeyForModel(a),u;return o.data[s]?u=o.data[s]:o.included[this._container.inflector.pluralize(a.modelName)]&&(u=o.included[this._container.inflector.pluralize(a.modelName)][s]),u&&u.relationships&&Object.prototype.hasOwnProperty.call(u.relationships,Ot(i))}else{var f=this.getKeysForIncluded();return f.includes(i)}}},{key:"_createRequestedIncludesGraph",value:function(i){var a=this,o={data:{}};if(this.isModel(i)){var s=this._graphKeyForModel(i);o.data[s]={},this._addPrimaryModelToRequestedIncludesGraph(o,i)}else this.isCollection(i)&&i.models.forEach(function(u){var f=a._graphKeyForModel(u);o.data[f]={},a._addPrimaryModelToRequestedIncludesGraph(o,u)});this.request._includesGraph=o}},{key:"_addPrimaryModelToRequestedIncludesGraph",value:function(i,a){var o=this;if(this.hasQueryParamIncludes()){var s=this._graphKeyForModel(a),u=this.getQueryParamIncludes();u.split(",").filter(function(f){return!!f.trim()}).forEach(function(f){i.data[s].relationships=i.data[s].relationships||{};var p=f.split(".").map(Ot),d=p[0],y=d,A=Te(d),P=a.associationKeys.has(A);Re(P,'You tried to include "'.concat(d,'" with ').concat(a,' but no association named "').concat(A,'" is defined on the model.'));var C=a[A],v;o.isModel(C)?v=o._graphKeyForModel(C):o.isCollection(C)?v=C.models.map(o._graphKeyForModel):v=null,i.data[s].relationships[y]=v,C&&o._addResourceToRequestedIncludesGraph(i,C,p.slice(1))})}}},{key:"_addResourceToRequestedIncludesGraph",value:function(i,a,o){var s=this;i.included=i.included||{};var u=this.isCollection(a)?a.models:[a];u.forEach(function(f){var p=s._container.inflector.pluralize(f.modelName);i.included[p]=i.included[p]||{},s._addModelToRequestedIncludesGraph(i,f,o)})}},{key:"_addModelToRequestedIncludesGraph",value:function(i,a,o){var s=this._container.inflector.pluralize(a.modelName),u=this._graphKeyForModel(a);i.included[s][u]=i.included[s][u]||{},o.length&&this._addResourceRelationshipsToRequestedIncludesGraph(i,s,u,a,o)}},{key:"_addResourceRelationshipsToRequestedIncludesGraph",value:function(i,a,o,s,u){i.included[a][o].relationships=i.included[a][o].relationships||{};var f=u[0],p=s[Te(f)],d;this.isModel(p)?d=this._graphKeyForModel(p):this.isCollection(p)&&(d=p.models.map(this._graphKeyForModel)),i.included[a][o].relationships[f]=d,p&&this._addResourceToRequestedIncludesGraph(i,p,u.slice(1))}},{key:"_graphKeyForModel",value:function(i){return"".concat(i.modelName,":").concat(i.id)}},{key:"getQueryParamIncludes",value:function(){return vp(this,"request.queryParams.include")}},{key:"hasQueryParamIncludes",value:function(){return!!this.getQueryParamIncludes()}},{key:"typeKeyForModel",value:function(i){return Ot(this._container.inflector.pluralize(i.modelName))}},{key:"getCoalescedIds",value:function(i){var a=i.queryParams&&i.queryParams["filter[id]"];return typeof a=="string"?a.split(","):a}},{key:"shouldIncludeLinkageData",value:function(i,a){return!1}}]),r}(Yn);Xp.prototype.alwaysIncludeLinkageData=!1;var Zp=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};vt(this,e),this.schema=t,this._serializerMap=r}return xt(e,[{key:"normalize",value:function(r,n){return this.serializerFor(n).normalize(r)}},{key:"serialize",value:function(r,n){var i=this;if(this.request=n,this._isModelOrCollection(r)){var a=this.serializerFor(r.modelName);return a.serialize(r,n)}else return Array.isArray(r)&&r.some(this._isCollection)?r.reduce(function(o,s){var u=i.serializerFor(s.modelName);return u.embed?o[i._container.inflector.pluralize(s.modelName)]=u.serialize(s,n):o=Object.assign(o,u.serialize(s,n)),o},{}):r}},{key:"serializerFor",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.explicit,a=i===void 0?!1:i,o=r&&this._serializerMap&&this._serializerMap[Te(r)];return a?Re(!!o,"You passed in ".concat(r," as an explicit serializer type but that serializer doesn't exist.")):(o=o||this._serializerMap.application||Yn,Re(!o||o.prototype.embed||o.prototype.root||new o instanceof Xp,"You cannot have a serializer that sideloads (embed: false) and disables the root (root: false).")),new o(this,r,this.request)}},{key:"_isModel",value:function(r){return r instanceof Xo}},{key:"_isCollection",value:function(r){return r instanceof Vn||r instanceof an}},{key:"_isModelOrCollection",value:function(r){return this._isModel(r)||this._isCollection(r)}},{key:"registerSerializers",value:function(r){var n=this._serializerMap||{};this._serializerMap=Object.assign(n,r)}},{key:"getCoalescedIds",value:function(r,n){return this.serializerFor(n).getCoalescedIds(r)}}]),e}(),jc={},Lc={},zc={},eg=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};vt(this,e),Re(t,"A schema requires a db"),this.db=t,this._registry={},this._dependentAssociations={polymorphic:[]},this.registerModels(r),this.isSaving={}}return xt(e,[{key:"registerModels",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};KO(n,function(i,a){r.registerModel(a,n[a])})}},{key:"registerModel",value:function(r,n){var i=this,a=Te(r),o=Ot(a);n=n.extend(),this._registry[a]=this._registry[a]||{class:null,foreignKeys:[]},this._registry[a].class=n,n.prototype._schema=this,n.prototype.modelName=o,n.prototype.hasManyAssociations={},n.prototype.hasManyAssociationFks={},n.prototype.belongsToAssociations={},n.prototype.belongsToAssociationFks={},n.prototype.associationKeys=new Set,n.prototype.associationIdKeys=new Set,n.prototype.dependentAssociations=[];var s={};for(var u in n.prototype)if(n.prototype[u]instanceof wa){var f=n.prototype[u];f.name=u,f.modelName=f.modelName||this.toModelName(u),f.ownerModelName=o,f.setSchema(this);var p=f.getForeignKeyArray(),d=nn(p,2),y=d[0],A=d[1];s[y]=s[y]||[],Re(!s[y].includes(A),"Your '".concat(r,"' model definition has multiple possible inverse relationships of type '").concat(y,"'. Please use explicit inverses.")),s[y].push(A),this._addForeignKeyToRegistry(y,A),f.addMethodsToModelClass(n,u)}var P=this.toCollectionName(o);return this.db[P]||this.db.createCollection(P),this[P]={camelizedModelName:a,new:function(v){return i.new(a,v)},create:function(v){return i.create(a,v)},all:function(v){return i.all(a,v)},find:function(v){return i.find(a,v)},findBy:function(v){return i.findBy(a,v)},findOrCreateBy:function(v){return i.findOrCreateBy(a,v)},where:function(v){return i.where(a,v)},none:function(v){return i.none(a,v)},first:function(v){return i.first(a,v)}},this}},{key:"modelFor",value:function(r){return this._registry[r]}},{key:"new",value:function(r,n){return this._instantiateModel(Ot(r),n)}},{key:"create",value:function(r,n){return this.new(r,n).save()}},{key:"all",value:function(r){var n=this.collectionForType(r);return this._hydrate(n,Ot(r))}},{key:"none",value:function(r){return this._hydrate([],Ot(r))}},{key:"find",value:function(r,n){var i=this.collectionForType(r),a=i.find(n);return Array.isArray(n)&&Re(a.length===n.length,"Couldn't find all ".concat(this._container.inflector.pluralize(r)," with ids: (").concat(n.join(","),") (found ").concat(a.length," results, but was looking for ").concat(n.length,")")),this._hydrate(a,Ot(r))}},{key:"findBy",value:function(r,n){var i=this.collectionForType(r),a=i.findBy(n);return this._hydrate(a,Ot(r))}},{key:"findOrCreateBy",value:function(r,n){var i=this.collectionForType(r),a=i.findBy(n),o;return a?o=this._hydrate(a,Ot(r)):o=this.create(r,n),o}},{key:"where",value:function(r,n){var i=this.collectionForType(r),a=i.where(n);return this._hydrate(a,Ot(r))}},{key:"first",value:function(r){var n=this.collectionForType(r),i=n[0];return this._hydrate(i,Ot(r))}},{key:"modelClassFor",value:function(r){var n=this._registry[Te(r)];return Re(n,"Model not registered: ".concat(r)),n.class.prototype}},{key:"addDependentAssociation",value:function(r,n){r.isPolymorphic?this._dependentAssociations.polymorphic.push(r):(this._dependentAssociations[n]=this._dependentAssociations[n]||[],this._dependentAssociations[n].push(r))}},{key:"dependentAssociationsFor",value:function(r){var n=this._dependentAssociations[r]||[],i=this._dependentAssociations.polymorphic||[];return n.concat(i)}},{key:"associationsFor",value:function(r){var n=this.modelClassFor(r);return Object.assign({},n.belongsToAssociations,n.hasManyAssociations)}},{key:"hasModelForModelName",value:function(r){return this.modelFor(Te(r))}},{key:"collectionForType",value:function(r){var n=this.toCollectionName(r);return Re(this.db[n],"You're trying to find model(s) of type ".concat(r," but this collection doesn't exist in the database.")),this.db[n]}},{key:"toCollectionName",value:function(r){if(typeof jc[r]!="string"){var n=Ot(r),i=Te(this._container.inflector.pluralize(n));jc[r]=i}return jc[r]}},{key:"toInternalCollectionName",value:function(r){if(typeof Lc[r]!="string"){var n="_".concat(this.toCollectionName(r));Lc[r]=n}return Lc[r]}},{key:"toModelName",value:function(r){if(typeof zc[r]!="string"){var n=Ot(r),i=this._container.inflector.singularize(n);zc[r]=i}return zc[r]}},{key:"_addForeignKeyToRegistry",value:function(r,n){this._registry[r]=this._registry[r]||{class:null,foreignKeys:[]};var i=this._registry[r].foreignKeys;i.includes(n)||i.push(n)}},{key:"_instantiateModel",value:function(r,n){var i=this._modelFor(r),a=this._foreignKeysFor(r);return new i(this,r,n,a)}},{key:"_modelFor",value:function(r){return this._registry[Te(r)].class}},{key:"_foreignKeysFor",value:function(r){return this._registry[Te(r)].foreignKeys}},{key:"_hydrate",value:function(r,n){if(Array.isArray(r)){var i=r.map(function(a){return this._instantiateModel(n,a)},this);return new Vn(n,i)}else return r?this._instantiateModel(n,r):null}}]),e}(),IA={Db:Vp,Association:wa,RouteHandler:Qp,BaseRouteHandler:Jo,Serializer:Yn,SerializerRegistry:Zp,Schema:eg},xA={singularize:ph,pluralize:hh},tg=function(){function e(){vt(this,e),this.inflector=xA}return xt(e,[{key:"register",value:function(r,n){this[r]=n}},{key:"create",value:function(r){var n=IA[r];n.prototype._container=this;for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return En(n,a)}}]),e}(),Mi=new tg;Vp.prototype._container=Mi,wa.prototype._container=Mi,Jo.prototype._container=Mi,Qp.prototype._container=Mi,Yn.prototype._container=Mi,Zp.prototype._container=Mi,eg.prototype._container=Mi;var Hc={};function EA(e){if(typeof window!="undefined")return new To(function(){this.passthroughRequest=function(r,n,i){e.shouldLog()&&console.log("Mirage: Passthrough request for ".concat(r.toUpperCase()," ").concat(i.url))},this.handledRequest=function(r,n,i){if(e.shouldLog()){console.groupCollapsed("Mirage: [".concat(i.status,"] ").concat(r.toUpperCase()," ").concat(i.url));var a=i.requestBody,o=i.responseText,s,u;try{s=JSON.parse(a)}catch{s=a}try{u=JSON.parse(o)}catch{u=o}console.groupCollapsed("Response"),console.log(u),console.groupEnd(),console.groupCollapsed("Request (data)"),console.log(s),console.groupEnd(),console.groupCollapsed("Request (raw)"),console.log(i),console.groupEnd(),console.groupEnd()}};var t=this.checkPassthrough;this.checkPassthrough=function(r){var n=e.passthroughChecks.some(function(a){return a(r)});if(n){var i=r.url.includes("?")?r.url.substr(0,r.url.indexOf("?")):r.url;this[r.method.toLowerCase()](i,this.passthrough)}return t.apply(this,arguments)},this.unhandledRequest=function(r,n){n=decodeURI(n),Re("Your app tried to ".concat(r," '").concat(n,"', but there was no route defined to handle this request. Define a route for this endpoint in your routes() config. Did you forget to define a namespace?"))}},{trackRequests:e.shouldTrackRequests()})}var Uc={coalesce:!1,timing:void 0},CA={singularize:ph,pluralize:hh},RA=["http://localhost:0/chromecheckurl","http://localhost:30820/socket.io",function(e){return/.+\.hot-update.json$/.test(e.url)}];function TA(e){if(!e||nr(e)!=="object")return!1;for(var t=Object.keys(Uc),r=Object.keys(e),n=0;n<r.length;n++){var i=r[n];if(t.indexOf(i)>-1)return!0}return!1}function MA(e){var t=e.splice(-1),r=nn(t,1),n=r[0];TA(n)?n=Ec({},Uc,n):(e.push(n),n=Uc);for(var i=2-e.length;i-- >0;)e.push(void 0);return e.push(n),e}function FA(e){return new $A(e)}var $A=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vt(this,e),this._container=new tg,this.config(t),this.db=this.db||void 0,this.schema=this.schema||void 0}return xt(e,[{key:"config",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.passthroughChecks=this.passthroughChecks||[];var n=r.environment&&this.environment&&this.environment!==r.environment;Re(!n,"You cannot modify Mirage's environment once the server is created"),this.environment=r.environment||this.environment||"development",r.routes&&(Re(!r.baseConfig,"The routes option is an alias for the baseConfig option. You can't pass both options into your server definition."),r.baseConfig=r.routes),r.seeds&&(Re(!r.scenarios,"The seeds option is an alias for the scenarios.default option. You can't pass both options into your server definition."),r.scenarios={default:r.seeds}),this._config=r,this.namespace=this.namespace||r.namespace||"",this.inflector=r.inflector||CA,this._container.register("inflector",this.inflector),this.urlPrefix=this.urlPrefix||r.urlPrefix||"",this.timing=this.timing||r.timing||400,this.logging=this.logging!==void 0?this.logging:void 0,this.testConfig=this.testConfig||void 0,this.trackRequests=r.trackRequests,this._defineRouteHandlerHelpers(),this.db?this.db.registerIdentityManagers(r.identityManagers):this.db=this._container.create("Db",void 0,r.identityManagers),this.schema?(this.schema.registerModels(r.models),this.serializerOrRegistry.registerSerializers(r.serializers||{})):(this.schema=this._container.create("Schema",this.db,r.models),this.serializerOrRegistry=this._container.create("SerializerRegistry",this.schema,r.serializers));var i=this._hasModulesOfType(r,"factories"),a=r.scenarios&&Object.prototype.hasOwnProperty.call(r.scenarios,"default"),o=r.trackRequests!==void 0&&this.pretender;Re(!o,"You cannot modify Pretender's request tracking once the server is created"),this.pretender=this.pretender||r.pretender||EA(this),r.baseConfig&&this.loadConfig(r.baseConfig),this.isTest()&&(r.testConfig&&this.loadConfig(r.testConfig),typeof window!="undefined"&&(window.server=this)),this.isTest()&&i?this.loadFactories(r.factories):!this.isTest()&&a?(this.loadFactories(r.factories),r.scenarios.default(this)):this.loadFixtures();var s=typeof r.useDefaultPassthroughs!="undefined"?r.useDefaultPassthroughs:!0;s&&this._configureDefaultPassthroughs()}},{key:"isTest",value:function(){return this.environment==="test"}},{key:"shouldLog",value:function(){return typeof this.logging!="undefined"?this.logging:!this.isTest()}},{key:"shouldTrackRequests",value:function(){return Boolean(this.trackRequests)}},{key:"loadConfig",value:function(r){r.call(this),this.timing=this.isTest()?0:this.timing||0}},{key:"passthrough",value:function(){for(var r=this,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];if(typeof window!="undefined"){var o=["get","post","put","delete","patch","options","head"],s=i[i.length-1];i.length===0?i=["/**","/"]:Array.isArray(s)&&(o=i.pop()),i.forEach(function(u){typeof u=="function"?r.passthroughChecks.push(u):o.forEach(function(f){var p=r._getFullPath(u);r.pretender[f](p,r.pretender.passthrough)})})}}},{key:"loadFixtures",value:function(){for(var r=this._config.fixtures,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];if(i.length){var o=i.map(Te),s=o.filter(function(u){return!r[u]});if(s.length)throw new Error("Fixtures not found: ".concat(s.join(", ")));r=_S.apply(void 0,[r].concat(Vo(o)))}this.db.loadData(r)}},{key:"loadFactories",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=this._factoryMap||{};this._factoryMap=Ec(i,n),Object.keys(n).forEach(function(a){var o=r.schema.toCollectionName(a);r.db.createCollection(o)})}},{key:"factoryFor",value:function(r){var n=Te(r);if(this._factoryMap&&this._factoryMap[n])return this._factoryMap[n]}},{key:"build",value:function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];var o=i.filter(function(C){return C&&typeof C=="string"}),s=Rc(i,function(C){return Iu(C)}),u=Te(r);this.factorySequences=this.factorySequences||{},this.factorySequences[u]=this.factorySequences[u]+1||0;var f=this.factoryFor(r);if(f){f=f.extend({});var p=f.attrs||{};this._validateTraits(o,f,r);var d=this._mergeExtensions(p,o,s);this._mapAssociationsFromAttributes(r,p,s),this._mapAssociationsFromAttributes(r,d);var y=f.extend(d),A=new y,P=this.factorySequences[u];return A.build(P)}else return s}},{key:"buildList",value:function(r,n){Re(Up(n),"second argument has to be an integer, you passed: ".concat(nr(n)));for(var i=[],a=arguments.length,o=new Array(a>2?a-2:0),s=2;s<a;s++)o[s-2]=arguments[s];for(var u=[r].concat(o),f=0;f<n;f++)i.push(this.build.apply(this,u));return i}},{key:"create",value:function(r){var n=this;Re(this._modelOrFactoryExistsForType(r),"You called server.create('".concat(r,"') but no model or factory was found. Make sure you're passing in the singularized version of the model or factory name."));for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];var s=a.filter(function(v){return v&&typeof v=="string"}),u=Rc(a,function(v){return Iu(v)}),f=Rc(a,function(v){return v&&Array.isArray(v)}),p=this.build.apply(this,[r].concat(Vo(s),[u])),d;if(this.schema&&this.schema[this.schema.toCollectionName(r)]){var y=this.schema[this.schema.toCollectionName(r)];d=y.create(p)}else{var A,P;f?A=f:(P=this.schema?this.schema.toInternalCollectionName(r):"_".concat(this.inflector.pluralize(r)),A=this.db[P]),Re(A,"You called server.create('".concat(r,"') but no model or factory was found.")),d=A.insert(p)}var C=this.factoryFor(r);return C&&C.extractAfterCreateCallbacks({traits:s}).forEach(function(v){v(d,n)}),d}},{key:"createList",value:function(r,n){Re(this._modelOrFactoryExistsForType(r),"You called server.createList('".concat(r,"') but no model or factory was found. Make sure you're passing in the singularized version of the model or factory name.")),Re(Up(n),"second argument has to be an integer, you passed: ".concat(nr(n)));for(var i=[],a=this.schema?this.schema.toInternalCollectionName(r):"_".concat(this.inflector.pluralize(r)),o=this.db[a],s=arguments.length,u=new Array(s>2?s-2:0),f=2;f<s;f++)u[f-2]=arguments[f];for(var p=[r].concat(u,[o]),d=0;d<n;d++)i.push(this.create.apply(this,p));return i}},{key:"shutdown",value:function(){typeof window!="undefined"&&this.pretender.shutdown(),typeof window!="undefined"&&this.environment==="test"&&(window.server=void 0)}},{key:"resource",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.only,o=i.except,s=i.path;if(r=this.inflector.pluralize(r),s=s||"/".concat(r),a=a||[],o=o||[],a.length>0&&o.length>0)throw"cannot use both :only and :except options";var u={index:{methods:["get"],path:"".concat(s)},show:{methods:["get"],path:"".concat(s,"/:id")},create:{methods:["post"],path:"".concat(s)},update:{methods:["put","patch"],path:"".concat(s,"/:id")},delete:{methods:["del"],path:"".concat(s,"/:id")}},f=Object.keys(u),p=a.length>0&&a||o.length>0&&f.filter(function(d){return o.indexOf(d)===-1})||f;p.forEach(function(d){var y=u[d];y.methods.forEach(function(A){return s===r?n[A](y.path):n[A](y.path,r)})})}},{key:"_defineRouteHandlerHelpers",value:function(){var r=this;[["get"],["post"],["put"],["delete","del"],["patch"],["head"],["options"]].forEach(function(n){var i=nn(n,2),a=i[0],o=i[1];r[a]=function(s){for(var u=arguments.length,f=new Array(u>1?u-1:0),p=1;p<u;p++)f[p-1]=arguments[p];var d=MA(f),y=nn(d,3),A=y[0],P=y[1],C=y[2];return r._registerRouteHandler(a,s,A,P,C)},o&&(r[o]=r[a])})}},{key:"_serialize",value:function(r){return typeof r=="string"?r:JSON.stringify(r)}},{key:"_registerRouteHandler",value:function(r,n,i,a,o){var s=this,u=this._container.create("RouteHandler",{schema:this.schema,verb:r,rawHandler:i,customizedCode:a,options:o,path:n,serializerOrRegistry:this.serializerOrRegistry}),f=this._getFullPath(n),p=o.timing!==void 0?o.timing:function(){return s.timing};if(this.pretender)return this.pretender[r](f,function(d){return u.handle(d).then(function(y){var A=nn(y,3),P=A[0],C=A[1],v=A[2];return[P,C,s._serialize(v)]})},p)}},{key:"_hasModulesOfType",value:function(r,n){var i=r[n];return i?Object.keys(i).length>0:!1}},{key:"_getFullPath",value:function(r){r=r[0]==="/"?r.slice(1):r;var n="",i=this.urlPrefix?this.urlPrefix.trim():"",a="";if(this.urlPrefix&&this.namespace&&(this.namespace[0]==="/"&&this.namespace[this.namespace.length-1]==="/"&&(a=this.namespace.substring(0,this.namespace.length-1).substring(1)),this.namespace[0]==="/"&&this.namespace[this.namespace.length-1]!=="/"&&(a=this.namespace.substring(1)),this.namespace[0]!=="/"&&this.namespace[this.namespace.length-1]==="/"&&(a=this.namespace.substring(0,this.namespace.length-1)),this.namespace[0]!=="/"&&this.namespace[this.namespace.length-1]!=="/"&&(a=this.namespace)),this.namespace&&!this.urlPrefix){if(this.namespace[0]==="/"&&this.namespace[this.namespace.length-1]==="/"&&(a=this.namespace.substring(0,this.namespace.length-1)),this.namespace[0]==="/"&&this.namespace[this.namespace.length-1]!=="/"&&(a=this.namespace),this.namespace[0]!=="/"&&this.namespace[this.namespace.length-1]==="/"){var o=this.namespace.substring(0,this.namespace.length-1);a="/".concat(o)}this.namespace[0]!=="/"&&this.namespace[this.namespace.length-1]!=="/"&&(a="/".concat(this.namespace))}return this.namespace||(a=""),/^https?:\/\//.test(r)?n+=r:(i.length&&(n+=i[i.length-1]==="/"?i:"".concat(i,"/")),n+=a,n[n.length-1]!=="/"&&(n+="/"),n+=r,/^https?:\/\//.test(n)||(n="/".concat(n),n=n.replace(/\/+/g,"/"))),n}},{key:"_configureDefaultPassthroughs",value:function(){var r=this;RA.forEach(function(n){r.passthrough(n)})}},{key:"_typeIsPluralForModel",value:function(r){if(typeof Hc[r]!="boolean"){var n=this._modelOrFactoryExistsForTypeOrCollectionName(r),i=r===this.inflector.pluralize(r),a=this.inflector.singularize(r)===this.inflector.pluralize(r),o=i&&!a&&n;Hc[r]=o}return Hc[r]}},{key:"_modelOrFactoryExistsForType",value:function(r){var n=this.schema&&this.schema.modelFor(Te(r)),i=this.db[this.schema.toInternalCollectionName(r)];return(n||i)&&!this._typeIsPluralForModel(r)}},{key:"_modelOrFactoryExistsForTypeOrCollectionName",value:function(r){var n=this.schema&&this.schema.modelFor(Te(r)),i=this.db[this.schema.toInternalCollectionName(r)];return n||i}},{key:"_validateTraits",value:function(r,n,i){r.forEach(function(a){if(!n.isTrait(a))throw new Error("'".concat(a,"' trait is not registered in '").concat(i,"' factory"))})}},{key:"_mergeExtensions",value:function(r,n,i){var a=n.map(function(o){return r[o].extension});return a.push(i||{}),a.reduce(function(o,s){return Ec(o,s)},{})}},{key:"_mapAssociationsFromAttributes",value:function(r,n){var i=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(n||{}).filter(function(o){return yA(n[o])}).forEach(function(o){var s=i.schema.modelClassFor(r),u=s.associationFor(o);Re(u&&u instanceof Oa,"You're using the `association` factory helper on the '".concat(o,"' attribute of your ").concat(r," factory, but that attribute is not a `belongsTo` association."));var f=u&&u instanceof Oa&&u.modelName===r;Re(!f,"You're using the association() helper on your ".concat(r," factory for ").concat(o,", which is a belongsTo self-referential relationship. You can't do this as it will lead to infinite recursion. You can move the helper inside of a trait and use it selectively."));var p=u&&u.opts&&u.opts.polymorphic;Re(!p,"You're using the association() helper on your ".concat(r," factory for ").concat(o,", which is a polymorphic relationship. This is not currently supported."));var d=n[o],y="".concat(Te(o),"Id");a[o]||(n[y]=i.create.apply(i,[u.modelName].concat(Vo(d.traitsAndOverrides))).id),delete n[o]})}}]),e}(),NA=Yn.extend({serializeIds:"always",normalizeIds:!0,keyForModel:function(t){return Gn(t)},keyForAttribute:function(t){return Gn(t)},keyForRelationship:function(t){return this._container.inflector.pluralize(Gn(t))},keyForEmbeddedRelationship:function(t){return Gn(t)},keyForRelationshipIds:function(t){return"".concat(Gn(this._container.inflector.singularize(t)),"_ids")},keyForForeignKey:function(t){return"".concat(Gn(t),"_id")},keyForPolymorphicForeignKeyId:function(t){return"".concat(Gn(t),"_id")},keyForPolymorphicForeignKeyType:function(t){return"".concat(Gn(t),"_type")},normalize:function(t){var r=this,n=Object.keys(t)[0],i=t[n],a=Te(n),o=this.schema.modelClassFor(a),s=o.belongsToAssociations,u=o.hasManyAssociations,f=Object.keys(s),p=Object.keys(u),d={data:{type:this._container.inflector.pluralize(n),attributes:{}}};i.id&&(d.data.id=i.id);var y={};return Object.keys(i).forEach(function(A){if(A!=="id")if(r.normalizeIds)if(f.includes(A)){var P=s[A],C=P.modelName;y[Ot(A)]={data:{type:C,id:i[A]}}}else if(p.includes(A)){var v=u[A],I=v.modelName,T=i[A].map(function(M){return{type:I,id:M}});y[Ot(A)]={data:T}}else d.data.attributes[Ot(A)]=i[A];else d.data.attributes[Ot(A)]=i[A]}),Object.keys(y).length&&(d.data.relationships=y),d},getCoalescedIds:function(t){return t.queryParams&&t.queryParams.ids}});NA.extend({serializeIds:"always",keyForModel:function(t){return Te(t)},keyForAttribute:function(t){return Te(t)},keyForRelationship:function(t){return Te(this._container.inflector.pluralize(t))},keyForEmbeddedRelationship:function(t){return Te(t)},keyForRelationshipIds:function(t){return Te(this._container.inflector.pluralize(t))},keyForForeignKey:function(t){return Te(this._container.inflector.singularize(t))},getCoalescedIds:function(t){return t.queryParams&&t.queryParams.ids}});function DA(){return FA({routes(){this.namespace="api",this.get("/titlebar",()=>({product:{name:"Booking Engine",href:"/hotel_admin/spl.jsp"},propertySelector:{type:"fetch",hotels:"/api/hotels"},user:{label:"Profile",children:[{label:"Maintain Users",href:"https://admin-dc.dev.bookassist.com/hotel_admin/maintain_users.jsp"},{label:"Change Password",href:"https://admin-dc.dev.bookassist.com/hotel_admin/login.jsp?resetpass"},{label:"Log Out",href:"https://admin-dc.bookassist.com/hotel_admin/logout.jsp"}]},languageSelector:{label:"Language",children:[{code:"en",label:"EnGlIsH"},{code:"cs"},{code:"de"},{code:"es"},{code:"fr"},{code:"it"},{code:"pl"},{code:"pt"}]},help:{label:"Help Center",href:"https://go.bookassist.org/en/knowledge/booking-engine"}})),this.get("/menu",()=>[{id:"raq3yznphb",label:"Hotel setup"},{id:"xjcwuw5o0wl",parentId:"raq3yznphb",label:"Hotel Logo",href:"#HotelLogo"},{id:"epzy61enrwu",parentId:"raq3yznphb",label:"Hotel Mobile Colours",href:"#HotelMobileColours"},{id:"szeh0zcpjn",parentId:"raq3yznphb",label:"Deposit Invoices",href:"#Invoices"},{id:"65csve3x2l",parentId:"raq3yznphb",label:"General Hotel Policies",href:"#GeneralHotelPolicies"},{id:"5tequyqbitm",parentId:"raq3yznphb",label:"Locate your hotel",href:"#Locateyourhotel"},{id:"mk86ze75d7",parentId:"raq3yznphb",label:"Premium example",premium:{value:!0,locked:!0}},{id:"f1ec1ry0rro",label:"Rooms/Packages"},{id:"w7x9wwfq4ge",parentId:"f1ec1ry0rro",label:"Manage Rooms & Packages",href:"#ManageRoomsPackages"},{id:"njxovt6l0d",parentId:"f1ec1ry0rro",label:"Book without credit card",href:"#Bookwithoutcreditcard"},{id:"39dl1gf3e8x",parentId:"f1ec1ry0rro",label:"XMLConnector Inventory",href:"#XMLConnectorInventory"},{id:"0qwiv7k5i6md",label:"Rates/Availability"},{id:"o3qrjsnlyin",parentId:"0qwiv7k5i6md",label:"Availability",group:"Availability"},{id:"gk3gwhnfo8j",parentId:"o3qrjsnlyin",label:"Edit Availability",href:"#EditAvailability"},{id:"g95dnxr3ifb",parentId:"o3qrjsnlyin",label:"Availability Batch",href:"#AvailabilityBatch"},{id:"8lttj490hu8",parentId:"0qwiv7k5i6md",label:"Availability and Rate Details",href:"#AvailabilityandRateDetails",group:"Availability"},{id:"7y6i0dnzc8o",parentId:"0qwiv7k5i6md",label:"Edit Rates",href:"#EditRates",group:"Rates"},{id:"o7c1dx9xume",parentId:"0qwiv7k5i6md",label:"Adjust Rates Manually",group:"Rates"},{id:"an9perx1x67",parentId:"o7c1dx9xume",label:"Adjust Rates",href:"#AdjustRates"},{id:"irtojrlv0t8",parentId:"o7c1dx9xume",label:"Rates Batch",href:"#RatesBatch"},{id:"j4mctyj216",parentId:"0qwiv7k5i6md",label:"Minimum Stays",group:"Restrictions"},{id:"yus5cglsgmm",parentId:"j4mctyj216",label:"Edit Minimum Stays",href:"#EditMinimumStays"},{id:"di4smaz6oyk",parentId:"j4mctyj216",label:"Batch",href:"#Batch"},{id:"3nvl2vajzb8",parentId:"0qwiv7k5i6md",label:"Closed For Arrival",group:"Restrictions"},{id:"gs54wi7f3ov",parentId:"3nvl2vajzb8",label:"Edit Closed For Arrival",href:"#EditClosedForArrival"},{id:"o8xoquq2vhm",parentId:"3nvl2vajzb8",label:"Batch",href:"#Batch"},{id:"a3lezzgyke",parentId:"0qwiv7k5i6md",label:"Open/Close Rooms",group:"Restrictions"},{id:"yhmwk4ntycs",parentId:"a3lezzgyke",label:"Edit Open/Close Rooms",href:"#EditOpenCloseRooms"},{id:"i00jgm1jw4",parentId:"a3lezzgyke",label:"Batch",href:"#Batch"},{id:"nwvz5qdsn4",parentId:"0qwiv7k5i6md",label:"Open/Closed Rooms Report",href:"#OpenClosedRoomsReport",group:"Restrictions"},{id:"xet04pxoomi",parentId:"0qwiv7k5i6md",label:"Extra Beds"},{id:"ww3e5s1k37s",parentId:"xet04pxoomi",label:"Edit Extra Beds",href:"#EditExtraBeds",group:"Restrictions"},{id:"3kdww03xlh8",parentId:"xet04pxoomi",label:"Batch",href:"#Batch"},{id:"462vczykrt8",label:"Extras"},{id:"rk6y9sxm8km",parentId:"462vczykrt8",label:"Manage Meal Plans",href:"#ManageMealPlans",group:"Meal Plans"},{id:"wg3uwe8mh2",parentId:"462vczykrt8",label:"Meal Plans Prices",group:"Meal Plans"},{id:"g128kodkhjo",parentId:"wg3uwe8mh2",label:"Edit Meal Plans Prices",href:"#EditMealPlansPrices"},{id:"xod48otj9o",parentId:"wg3uwe8mh2",label:"Meal Plans Prices Batch",href:"#MealPlansPricesBatch"},{id:"kwmxcwr5y8s",parentId:"462vczykrt8",label:"Open/Close Add-ons",href:"#OpenCloseAddons",group:"Add-Ons"},{id:"rbk08ib5mxb",parentId:"462vczykrt8",label:"Switch Off Add-ons",href:"#SwitchOffAddons",group:"Add-Ons"},{id:"ntbts4i22sb",parentId:"462vczykrt8",label:"Dynamic Discounts",href:"#DynamicDiscounts",group:"Discounts"},{id:"736g9tauy6k",parentId:"462vczykrt8",label:"Open/Close Discounts",group:"Discounts"},{id:"2qvsnasaj1l",parentId:"736g9tauy6k",label:"Edit Open/Close Discounts",href:"#EditOpenCloseDiscounts"},{id:"nj3242z7nt",parentId:"736g9tauy6k",label:"Batch",href:"#Batch"},{id:"ocf8po5w2el",parentId:"462vczykrt8",label:"Open/Close IRS",href:"#OpenCloseIRS",group:"Upselling"},{id:"5kccvsqsuf4",label:"Reservations",href:"#Reservations"},{id:"vu9d7b45nte",parentId:"5kccvsqsuf4",label:"Manage Reservation",href:"#ManageReservation"},{id:"f437g317fjc",parentId:"5kccvsqsuf4",label:"Search Reservations",href:"#SearchReservations"},{id:"k5464kvte8l",parentId:"5kccvsqsuf4",label:"Bookings Reports",href:"#BookingsReports"},{id:"cb58wdcv38c",label:"Corporate",href:"#Corporate"},{id:"3r614o7kqby",parentId:"cb58wdcv38c",label:"Customer list",href:"#Customerlist"},{id:"3qa95mud1xf",parentId:"cb58wdcv38c",label:"Categories",href:"#Categories"},{id:"af6698sant",parentId:"cb58wdcv38c",label:"Companies",href:"#Companies"},{id:"2wbkjjcia",parentId:"cb58wdcv38c",label:"Corporate Rates",href:"#CorporateRates"},{id:"hyaxqvj6doh",parentId:"cb58wdcv38c",label:"Corp Rate Groups",href:"#CorpRateGroups"},{id:"6rocuyqud7m",parentId:"cb58wdcv38c",label:"Create Rewards",href:"#CreateRewards"},{id:"a07tcgufbqm",parentId:"cb58wdcv38c",label:"Create New Customer",href:"#CreateNewCustomer"},{id:"s0ioinudzz",parentId:"cb58wdcv38c",label:"Voucher Availability",href:"#VoucherAvailability"},{id:"emm4qyt75ga",label:"Reputation",href:"#Reputation"},{id:"ysvbfa69j6",parentId:"emm4qyt75ga",label:"Direct Customer Reviews",href:"#DirectCustomerReviews"},{id:"67e1vjgsbl7",label:"Vouchers",href:"#Vouchers"},{id:"vx6f8cd05od",parentId:"67e1vjgsbl7",label:"Create Vouchers",href:"#CreateVouchers"},{id:"9fvp9xal5qo",parentId:"67e1vjgsbl7",label:"Purchased Vouchers",href:"#PurchasedVouchers"},{id:"bhe7fnem0nt",parentId:"67e1vjgsbl7",label:"Vouchers delivery options",href:"#Vouchersdeliveryoptions"}]),this.get("/notifications",()=>({en:[{title:"Test header 1",items:[{title:"Sollicitudin Vulputate Nibh Adipiscing",url:"#",date:"2022-01-01"},{title:"Ipsum Dolor Sem Ligula",url:"#",date:"2022-01-05"},{title:"Vestibulum Amet Risus Vehicula",url:"#",date:"2022-02-07"},{title:"Ullamcorper Parturient Malesuada Magna",url:"#",date:"2022-02-15"},{title:"Sollicitudin Vulputate Nibh Adipiscing",url:"#",date:"2022-03-04"}]},{title:"Test header 2",items:[{title:"Vestibulum Amet Risus Vehicula",url:"#",date:"2022-01-03"},{title:"Ullamcorper Parturient Malesuada Magna",url:"#",date:"2022-02-14"},{title:"Sollicitudin Vulputate Nibh Adipiscing",url:"#",date:"2022-03-03"},{title:"Ipsum Dolor Sem Ligula",url:"#",date:"2022-03-31"},{title:"Vestibulum Amet Risus Vehicula",url:"#",date:"2022-04-04"}]}],es:[{title:"Test header 1 ES",items:[{title:"ES Sollicitudin Vulputate Nibh Adipiscing",url:"#",date:"2022-01-01"},{title:"ES Ipsum Dolor Sem Ligula",url:"#",date:"2022-01-05"}]},{title:"Test header 2 ES",items:[{title:"ES Ipsum Dolor Sem Ligula",url:"#",date:"2022-03-31"},{title:"ES Vestibulum Amet Risus Vehicula",url:"#",date:"2022-04-04"}]}]})),this.get("/hotels",()=>[[" NON ATTIVO - Hotel Lunetta","2071_808"],["987 Design Prague Hotel","3291_802"],["A.Liebeskind Hotel","4012_823"],["Abbey Hotel Ballyvourney","2155_2"],["ABC Arabian Suites","2001_829"],["Abito Hotel","3425_802"],["Abrial Hotel","1101_600"],["Academy Plaza Hotel","9_1"],["Actons Hotel Kinsale","1739_2"],["ADLER HOTEL","3724_802"],["Adria Hotel Prague","1465_802"],["Agroturismo Can Toni Xumeu","3033_102"],["AGUA DE MaR Hotel Boutique","2620_102"],["Aida Plaza Hotel","2677_810"],["Akademik Collegia","3976_823"],["Akcent Hotel","2017_802"],["Al Buraimi Hotel","2076_869"],["Albergo Firenze","2722_808"],["Alef Hotel","3672_809"],["Alerion Hotel","2673_600"],["Aletti Palace Hotel","1742_600"],["Alexandra Lodge","1801_401"],["Allegroitalia Elba Capo D'arco","3160_808"],["Allegroitalia Elba Golf","3161_808"],["Allegroitalia Espresso Bologna","3115_808"],["Allegroitalia Etna Pedara","3163_808"],["Allegroitalia Golden Palace","3116_808"],["Allegroitalia Nazionale Volterra","3176_808"]]),this.passthrough("https://www.bookassist.com/**"),this.passthrough("https://exceptions.hubspot.com/**"),this.passthrough("https://api.hubspot.com/**"),this.passthrough("https://forms.hubspot.com/**"),this.passthrough("/hotel_admin/json/title_bar.jsp")}})}var rg={exports:{}},jA="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",LA=jA,zA=LA;function ng(){}function ig(){}ig.resetWarningCache=ng;var HA=function(){function e(n,i,a,o,s,u){if(u!==zA){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ig,resetWarningCache:ng};return r.PropTypes=r,r};rg.exports=HA();var se=rg.exports,gi=ot.default.createContext(null);function UA(e){e()}var ag=UA,BA=function(t){return ag=t},kA=function(){return ag};function WA(){var e=kA(),t=null,r=null;return{clear:function(){t=null,r=null},notify:function(){e(function(){for(var i=t;i;)i.callback(),i=i.next})},get:function(){for(var i=[],a=t;a;)i.push(a),a=a.next;return i},subscribe:function(i){var a=!0,o=r={callback:i,next:null,prev:r};return o.prev?o.prev.next=o:t=o,function(){!a||t===null||(a=!1,o.next?o.next.prev=o.prev:r=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}var og={notify:function(){},get:function(){return[]}};function sg(e,t){var r,n=og;function i(d){return u(),n.subscribe(d)}function a(){n.notify()}function o(){p.onStateChange&&p.onStateChange()}function s(){return Boolean(r)}function u(){r||(r=t?t.addNestedSub(o):e.subscribe(o),n=WA())}function f(){r&&(r(),r=void 0,n.clear(),n=og)}var p={addNestedSub:i,notifyNestedSubs:a,handleChangeWrapper:o,isSubscribed:s,trySubscribe:u,tryUnsubscribe:f,getListeners:function(){return n}};return p}var Bc=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?z.useLayoutEffect:z.useEffect,Zo={exports:{}},Pa={};/*
|
|
27
27
|
object-assign
|
|
28
28
|
(c) Sindre Sorhus
|
|
29
29
|
@license MIT
|
|
@@ -131,4 +131,4 @@ Expecting `+fe.join(", ")+", got '"+this.terminals_[Oe]+"'":H="Parse error on li
|
|
|
131
131
|
*
|
|
132
132
|
* This source code is licensed under the MIT license found in the
|
|
133
133
|
* LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/var vu=60103,bu=60106,ho=60107,po=60108,go=60114,yo=60109,mo=60110,vo=60112,bo=60113,sd=60120,_o=60115,wo=60116,mv=60121,vv=60122,bv=60117,_v=60129,wv=60131;if(typeof Symbol=="function"&&Symbol.for){var wr=Symbol.for;vu=wr("react.element"),bu=wr("react.portal"),ho=wr("react.fragment"),po=wr("react.strict_mode"),go=wr("react.profiler"),yo=wr("react.provider"),mo=wr("react.context"),vo=wr("react.forward_ref"),bo=wr("react.suspense"),sd=wr("react.suspense_list"),_o=wr("react.memo"),wo=wr("react.lazy"),mv=wr("react.block"),vv=wr("react.server.block"),bv=wr("react.fundamental"),_v=wr("react.debug_trace_mode"),wv=wr("react.legacy_hidden")}function $n(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case vu:switch(e=e.type,e){case ho:case go:case po:case bo:case sd:return e;default:switch(e=e&&e.$$typeof,e){case mo:case vo:case wo:case _o:case yo:return e;default:return t}}case bu:return t}}}var MC=yo,FC=vu,$C=vo,NC=ho,DC=wo,jC=_o,LC=bu,zC=go,HC=po,UC=bo;At.ContextConsumer=mo,At.ContextProvider=MC,At.Element=FC,At.ForwardRef=$C,At.Fragment=NC,At.Lazy=DC,At.Memo=jC,At.Portal=LC,At.Profiler=zC,At.StrictMode=HC,At.Suspense=UC,At.isAsyncMode=function(){return!1},At.isConcurrentMode=function(){return!1},At.isContextConsumer=function(e){return $n(e)===mo},At.isContextProvider=function(e){return $n(e)===yo},At.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===vu},At.isForwardRef=function(e){return $n(e)===vo},At.isFragment=function(e){return $n(e)===ho},At.isLazy=function(e){return $n(e)===wo},At.isMemo=function(e){return $n(e)===_o},At.isPortal=function(e){return $n(e)===bu},At.isProfiler=function(e){return $n(e)===go},At.isStrictMode=function(e){return $n(e)===po},At.isSuspense=function(e){return $n(e)===bo},At.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===ho||e===go||e===_v||e===po||e===bo||e===sd||e===wv||typeof e=="object"&&e!==null&&(e.$$typeof===wo||e.$$typeof===_o||e.$$typeof===yo||e.$$typeof===mo||e.$$typeof===vo||e.$$typeof===bv||e.$$typeof===mv||e[0]===vv)},At.typeOf=$n;function Ov(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function Sv(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function ud(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var r=getComputedStyle(e,null);return Sv(r.overflowY,t)||Sv(r.overflowX,t)||function(n){var i=function(a){if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}}(n);return!!i&&(i.clientHeight<n.scrollHeight||i.clientWidth<n.scrollWidth)}(e)}return!1}function _u(e,t,r,n,i,a,o,s){return a<e&&o>t||a>e&&o<t?0:a<=e&&s<=r||o>=t&&s>=r?a-e-n:o>t&&s<r||a<e&&s>r?o-t+i:0}function BC(e,t){var r=window,n=t.scrollMode,i=t.block,a=t.inline,o=t.boundary,s=t.skipOverflowHiddenElements,u=typeof o=="function"?o:function(ue){return ue!==o};if(!Ov(e))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,p=[],d=e;Ov(d)&&u(d);){if((d=d.parentElement)===f){p.push(d);break}d!=null&&d===document.body&&ud(d)&&!ud(document.documentElement)||d!=null&&ud(d,s)&&p.push(d)}for(var y=r.visualViewport?r.visualViewport.width:innerWidth,A=r.visualViewport?r.visualViewport.height:innerHeight,P=window.scrollX||pageXOffset,C=window.scrollY||pageYOffset,v=e.getBoundingClientRect(),I=v.height,T=v.width,M=v.top,L=v.right,K=v.bottom,ie=v.left,J=i==="start"||i==="nearest"?M:i==="end"?K:M+I/2,j=a==="center"?ie+T/2:a==="end"?L:ie,ce=[],q=0;q<p.length;q++){var ge=p[q],O=ge.getBoundingClientRect(),he=O.height,le=O.width,de=O.top,Me=O.right,Ne=O.bottom,Oe=O.left;if(n==="if-needed"&&M>=0&&ie>=0&&K<=A&&L<=y&&M>=de&&K<=Ne&&ie>=Oe&&L<=Me)return ce;var De=getComputedStyle(ge),pe=parseInt(De.borderLeftWidth,10),$=parseInt(De.borderTopWidth,10),U=parseInt(De.borderRightWidth,10),N=parseInt(De.borderBottomWidth,10),Q=0,V=0,be="offsetWidth"in ge?ge.offsetWidth-ge.clientWidth-pe-U:0,fe="offsetHeight"in ge?ge.offsetHeight-ge.clientHeight-$-N:0;if(f===ge)Q=i==="start"?J:i==="end"?J-A:i==="nearest"?_u(C,C+A,A,$,N,C+J,C+J+I,I):J-A/2,V=a==="start"?j:a==="center"?j-y/2:a==="end"?j-y:_u(P,P+y,y,pe,U,P+j,P+j+T,T),Q=Math.max(0,Q+C),V=Math.max(0,V+P);else{Q=i==="start"?J-de-$:i==="end"?J-Ne+N+fe:i==="nearest"?_u(de,Ne,he,$,N+fe,J,J+I,I):J-(de+he/2)+fe/2,V=a==="start"?j-Oe-pe:a==="center"?j-(Oe+le/2)+be/2:a==="end"?j-Me+U+be:_u(Oe,Me,le,pe,U+be,j,j+T,T);var H=ge.scrollLeft,ee=ge.scrollTop;J+=ee-(Q=Math.max(0,Math.min(ee+Q,ge.scrollHeight-he+fe))),j+=H-(V=Math.max(0,Math.min(H+V,ge.scrollWidth-le+be)))}ce.push({el:ge,top:Q,left:V})}return ce}var kC=0;function Av(){}function WC(e,t){if(!!e){var r=BC(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});r.forEach(function(n){var i=n.el,a=n.top,o=n.left;i.scrollTop=a,i.scrollLeft=o})}}function Pv(e,t,r){var n=e===t||t instanceof r.Node&&e.contains&&e.contains(t);return n}function Iv(e,t){var r;function n(){r&&clearTimeout(r)}function i(){for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];n(),r=setTimeout(function(){r=null,e.apply(void 0,o)},t)}return i.cancel=n,i}function Ui(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return t.some(function(s){return s&&s.apply(void 0,[n].concat(a)),n.preventDownshiftDefault||n.hasOwnProperty("nativeEvent")&&n.nativeEvent.preventDownshiftDefault})}}function Oo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){t.forEach(function(i){typeof i=="function"?i(n):i&&(i.current=n)})}}function KC(){return String(kC++)}function qC(e){var t=e.isOpen,r=e.resultCount,n=e.previousResultCount;return t?r?r!==n?r+" result"+(r===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function cd(e,t){return Object.keys(e).reduce(function(r,n){return r[n]=xv(t,n)?t[n]:e[n],r},{})}function xv(e,t){return e[t]!==void 0}function GC(e){var t=e.key,r=e.keyCode;return r>=37&&r<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function ld(e,t,r,n,i){if(i===void 0&&(i=!0),r===0)return-1;var a=r-1;(typeof t!="number"||t<0||t>=r)&&(t=e>0?-1:a+1);var o=t+e;o<0?o=i?a:0:o>a&&(o=i?0:a);var s=So(e,o,r,n,i);return s===-1?t>=r?-1:t:s}function So(e,t,r,n,i){var a=n(t);if(!a||!a.hasAttribute("disabled"))return t;if(e>0){for(var o=t+1;o<r;o++)if(!n(o).hasAttribute("disabled"))return o}else for(var s=t-1;s>=0;s--)if(!n(s).hasAttribute("disabled"))return s;return i?e>0?So(1,0,r,n,!1):So(-1,r-1,r,n,!1):-1}function Ev(e,t,r,n){return n===void 0&&(n=!0),t.some(function(i){return i&&(Pv(i,e,r)||n&&Pv(i,r.document.activeElement,r))})}var VC=Iv(function(e){Cv(e).textContent=""},500);function YC(e,t){var r=Cv(t);!e||(r.textContent=e,VC(t))}function Cv(e){e===void 0&&(e=document);var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var QC=["isInitialMount","highlightedIndex","items","environment"],Rv={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function JC(e,t,r){var n=e.props,i=e.type,a={};Object.keys(t).forEach(function(o){XC(o,e,t,r),r[o]!==t[o]&&(a[o]=r[o])}),n.onStateChange&&Object.keys(a).length&&n.onStateChange(Ct({type:i},a))}function XC(e,t,r,n){var i=t.props,a=t.type,o="on"+fd(e)+"Change";i[o]&&n[e]!==void 0&&n[e]!==r[e]&&i[o](Ct({type:a},n))}function ZC(e,t){return t.changes}function e3(e){var t=e.selectedItem,r=e.itemToString;return t?r(t)+" has been selected.":""}var t3=Iv(function(e,t){YC(e(),t)},200),r3=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?z.useLayoutEffect:z.useEffect;function n3(e){var t=e.id,r=t===void 0?"downshift-"+KC():t,n=e.labelId,i=e.menuId,a=e.getItemId,o=e.toggleButtonId,s=e.inputId,u=z.useRef({labelId:n||r+"-label",menuId:i||r+"-menu",getItemId:a||function(f){return r+"-item-"+f},toggleButtonId:o||r+"-toggle-button",inputId:s||r+"-input"});return u.current}function i3(e,t,r){return e!==void 0?e:r.length===0?-1:r.indexOf(t)}function a3(e){return e?String(e):""}function fd(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function Tv(e){var t=z.useRef(e);return t.current=e,t}function o3(e,t,r){var n=z.useRef(),i=z.useRef(),a=z.useCallback(function(y,A){i.current=A,y=cd(y,A.props);var P=e(y,A),C=A.props.stateReducer(y,Ct({},A,{changes:P}));return C},[e]),o=z.useReducer(a,t),s=o[0],u=o[1],f=Tv(r),p=z.useCallback(function(y){return u(Ct({props:f.current},y))},[f]),d=i.current;return z.useEffect(function(){d&&n.current&&n.current!==s&&JC(d,cd(n.current,d.props),s),n.current=s},[s,r,d]),[s,p]}var Ao={itemToString:a3,stateReducer:ZC,getA11ySelectionMessage:e3,scrollIntoView:WC,circularNavigation:!1,environment:typeof window=="undefined"?{}:window};function ri(e,t,r){r===void 0&&(r=Rv);var n="default"+fd(t);return n in e?e[n]:r[t]}function wu(e,t,r){if(r===void 0&&(r=Rv),t in e)return e[t];var n="initial"+fd(t);return n in e?e[n]:ri(e,t,r)}function s3(e){var t=wu(e,"selectedItem"),r=wu(e,"isOpen"),n=wu(e,"highlightedIndex"),i=wu(e,"inputValue");return{highlightedIndex:n<0&&t&&r?e.items.indexOf(t):n,isOpen:r,selectedItem:t,inputValue:i}}function Ou(e,t,r,n){var i=e.items,a=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,s=t.selectedItem,u=t.highlightedIndex;return i.length===0?-1:a!==void 0&&u===a?a:o!==void 0?o:s?r===0?i.indexOf(s):ld(r,i.indexOf(s),i.length,n,!1):r===0?-1:r<0?i.length-1:0}function u3(e,t,r,n){var i=z.useRef({isMouseDown:!1,isTouchMove:!1});return z.useEffect(function(){var a=function(){i.current.isMouseDown=!0},o=function(d){i.current.isMouseDown=!1,e&&!Ev(d.target,t.map(function(y){return y.current}),r)&&n()},s=function(){i.current.isTouchMove=!1},u=function(){i.current.isTouchMove=!0},f=function(d){e&&!i.current.isTouchMove&&!Ev(d.target,t.map(function(y){return y.current}),r,!1)&&n()};return r.addEventListener("mousedown",a),r.addEventListener("mouseup",o),r.addEventListener("touchstart",s),r.addEventListener("touchmove",u),r.addEventListener("touchend",f),function(){r.removeEventListener("mousedown",a),r.removeEventListener("mouseup",o),r.removeEventListener("touchstart",s),r.removeEventListener("touchmove",u),r.removeEventListener("touchend",f)}},[e,r]),i}var c3=function(){return Av};function Mv(e,t,r){var n=r.isInitialMount,i=r.highlightedIndex,a=r.items,o=r.environment,s=Xi(r,QC);z.useEffect(function(){n||t3(function(){return e(Ct({highlightedIndex:i,highlightedItem:a[i],resultCount:a.length},s))},o.document)},t)}function l3(e){var t=e.highlightedIndex,r=e.isOpen,n=e.itemRefs,i=e.getItemNodeFromIndex,a=e.menuElement,o=e.scrollIntoView,s=z.useRef(!0);return r3(function(){t<0||!r||!Object.keys(n.current).length||(s.current===!1?s.current=!0:o(i(t),a))},[t]),s}var f3=Av;function d3(e,t,r){var n=t.type,i=t.props,a;switch(n){case r.ItemMouseMove:a={highlightedIndex:t.index};break;case r.MenuMouseLeave:a={highlightedIndex:-1};break;case r.ToggleButtonClick:case r.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Ou(i,e,0)};break;case r.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:Ou(i,e,0)};break;case r.FunctionCloseMenu:a={isOpen:!1};break;case r.FunctionSetHighlightedIndex:a={highlightedIndex:t.highlightedIndex};break;case r.FunctionSetInputValue:a={inputValue:t.inputValue};break;case r.FunctionReset:a={highlightedIndex:ri(i,"highlightedIndex"),isOpen:ri(i,"isOpen"),selectedItem:ri(i,"selectedItem"),inputValue:ri(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return Ct({},e,a)}se.array.isRequired,se.func,se.func,se.func,se.bool,se.number,se.number,se.number,se.bool,se.bool,se.bool,se.any,se.any,se.any,se.string,se.string,se.string,se.func,se.string,se.func,se.func,se.func,se.func,se.func,se.shape({addEventListener:se.func,removeEventListener:se.func,document:se.shape({getElementById:se.func,activeElement:se.any,body:se.any})});function h3(e){var t=e.isOpen,r=e.resultCount,n=e.previousResultCount;return t?r?r!==n?r+" result"+(r===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.":"":"No results are available.":""}hs(hs({},Ao),{getA11yStatusMessage:h3});var dd=0,hd=1,pd=2,gd=3,yd=4,md=5,vd=6,Su=7,Fv=8,$v=9,bd=10,Nv=11,Dv=12,jv=13,Lv=14,zv=15,_d=16,Hv=17,Uv=18,wd=19,Bv=Object.freeze({__proto__:null,InputKeyDownArrowDown:dd,InputKeyDownArrowUp:hd,InputKeyDownEscape:pd,InputKeyDownHome:gd,InputKeyDownEnd:yd,InputKeyDownEnter:md,InputChange:vd,InputBlur:Su,MenuMouseLeave:Fv,ItemMouseMove:$v,ItemClick:bd,ToggleButtonClick:Nv,FunctionToggleMenu:Dv,FunctionOpenMenu:jv,FunctionCloseMenu:Lv,FunctionSetHighlightedIndex:zv,FunctionSelectItem:_d,FunctionSetInputValue:Hv,FunctionReset:Uv,ControlledPropUpdatedSelectedItem:wd});function p3(e){var t=s3(e),r=t.selectedItem,n=t.inputValue;return n===""&&r&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(n=e.itemToString(r)),Ct({},t,{inputValue:n})}se.array.isRequired,se.func,se.func,se.func,se.bool,se.number,se.number,se.number,se.bool,se.bool,se.bool,se.any,se.any,se.any,se.string,se.string,se.string,se.string,se.string,se.string,se.func,se.string,se.string,se.func,se.func,se.func,se.func,se.func,se.func,se.shape({addEventListener:se.func,removeEventListener:se.func,document:se.shape({getElementById:se.func,activeElement:se.any,body:se.any})});function g3(e,t,r){var n=z.useRef(),i=o3(e,t,r),a=i[0],o=i[1];return z.useEffect(function(){xv(r,"selectedItem")&&(n.current!==r.selectedItem&&o({type:wd,inputValue:r.itemToString(r.selectedItem)}),n.current=a.selectedItem===n.current?r.selectedItem:a.selectedItem)}),[cd(a,r),o]}var y3=Ct({},Ao,{getA11yStatusMessage:qC,circularNavigation:!0});function m3(e,t){var r=t.type,n=t.props,i=t.shiftKey,a;switch(r){case bd:a={isOpen:ri(n,"isOpen"),highlightedIndex:ri(n,"highlightedIndex"),selectedItem:n.items[t.index],inputValue:n.itemToString(n.items[t.index])};break;case dd:e.isOpen?a={highlightedIndex:ld(i?5:1,e.highlightedIndex,n.items.length,t.getItemNodeFromIndex,n.circularNavigation)}:a={highlightedIndex:Ou(n,e,1,t.getItemNodeFromIndex),isOpen:n.items.length>=0};break;case hd:e.isOpen?a={highlightedIndex:ld(i?-5:-1,e.highlightedIndex,n.items.length,t.getItemNodeFromIndex,n.circularNavigation)}:a={highlightedIndex:Ou(n,e,-1,t.getItemNodeFromIndex),isOpen:n.items.length>=0};break;case md:a=Ct({},e.isOpen&&e.highlightedIndex>=0&&{selectedItem:n.items[e.highlightedIndex],isOpen:ri(n,"isOpen"),highlightedIndex:ri(n,"highlightedIndex"),inputValue:n.itemToString(n.items[e.highlightedIndex])});break;case pd:a=Ct({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case gd:a={highlightedIndex:So(1,0,n.items.length,t.getItemNodeFromIndex,!1)};break;case yd:a={highlightedIndex:So(-1,n.items.length-1,n.items.length,t.getItemNodeFromIndex,!1)};break;case Su:a=Ct({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&t.selectItem&&{selectedItem:n.items[e.highlightedIndex],inputValue:n.itemToString(n.items[e.highlightedIndex])});break;case vd:a={isOpen:!0,highlightedIndex:ri(n,"highlightedIndex"),inputValue:t.inputValue};break;case _d:a={selectedItem:t.selectedItem,inputValue:n.itemToString(t.selectedItem)};break;case wd:a={inputValue:t.inputValue};break;default:return d3(e,t,Bv)}return Ct({},e,a)}var v3=["onMouseLeave","refKey","ref"],b3=["item","index","refKey","ref","onMouseMove","onClick","onPress"],_3=["onClick","onPress","refKey","ref"],w3=["onKeyDown","onChange","onInput","onBlur","onChangeText","refKey","ref"],O3=["refKey","ref"];kv.stateChangeTypes=Bv;function kv(e){e===void 0&&(e={});var t=Ct({},y3,e),r=t.initialIsOpen,n=t.defaultIsOpen,i=t.items,a=t.scrollIntoView,o=t.environment,s=t.getA11yStatusMessage,u=t.getA11ySelectionMessage,f=t.itemToString,p=p3(t),d=g3(m3,p,t),y=d[0],A=d[1],P=y.isOpen,C=y.highlightedIndex,v=y.selectedItem,I=y.inputValue,T=z.useRef(null),M=z.useRef({}),L=z.useRef(null),K=z.useRef(null),ie=z.useRef(null),J=z.useRef(!0),j=n3(t),ce=z.useRef(),q=Tv({state:y,props:t}),ge=z.useCallback(function(ee){return M.current[j.getItemId(ee)]},[j]);Mv(s,[P,C,I,i],Ct({isInitialMount:J.current,previousResultCount:ce.current,items:i,environment:o,itemToString:f},y)),Mv(u,[v],Ct({isInitialMount:J.current,previousResultCount:ce.current,items:i,environment:o,itemToString:f},y));var O=l3({menuElement:T.current,highlightedIndex:C,isOpen:P,itemRefs:M,scrollIntoView:a,getItemNodeFromIndex:ge});f3({isInitialMount:J.current,props:t,state:y}),z.useEffect(function(){var ee=r||n||P;ee&&L.current&&L.current.focus()},[]),z.useEffect(function(){J.current||(ce.current=i.length)});var he=u3(P,[ie,T,K],o,function(){A({type:Su,selectItem:!1})}),le=c3();z.useEffect(function(){J.current=!1},[]),z.useEffect(function(){P||(M.current={})},[P]);var de=z.useMemo(function(){return{ArrowDown:function(ue){ue.preventDefault(),A({type:dd,shiftKey:ue.shiftKey,getItemNodeFromIndex:ge})},ArrowUp:function(ue){ue.preventDefault(),A({type:hd,shiftKey:ue.shiftKey,getItemNodeFromIndex:ge})},Home:function(ue){!q.current.state.isOpen||(ue.preventDefault(),A({type:gd,getItemNodeFromIndex:ge}))},End:function(ue){!q.current.state.isOpen||(ue.preventDefault(),A({type:yd,getItemNodeFromIndex:ge}))},Escape:function(){var ue=q.current.state;(ue.isOpen||ue.inputValue||ue.selectedItem||ue.highlightedIndex>-1)&&A({type:pd})},Enter:function(ue){var oe=q.current.state;!oe.isOpen||oe.highlightedIndex<0||ue.which===229||(ue.preventDefault(),A({type:md,getItemNodeFromIndex:ge}))}}},[A,q,ge]),Me=z.useCallback(function(ee){return Ct({id:j.labelId,htmlFor:j.inputId},ee)},[j]),Ne=z.useCallback(function(ee,ue){var oe,ve=ee===void 0?{}:ee,Pe=ve.onMouseLeave,te=ve.refKey,Le=te===void 0?"ref":te,Ie=ve.ref,Ee=Xi(ve,v3),He=ue===void 0?{}:ue;return He.suppressRefError,Ct((oe={},oe[Le]=Oo(Ie,function(qe){T.current=qe}),oe.id=j.menuId,oe.role="listbox",oe["aria-labelledby"]=j.labelId,oe.onMouseLeave=Ui(Pe,function(){A({type:Fv})}),oe),Ee)},[A,le,j]),Oe=z.useCallback(function(ee){var ue,oe,ve=ee===void 0?{}:ee,Pe=ve.item,te=ve.index,Le=ve.refKey,Ie=Le===void 0?"ref":Le,Ee=ve.ref,He=ve.onMouseMove,qe=ve.onClick;ve.onPress;var Ke=Xi(ve,b3),rt=q.current,ke=rt.props,Pt=rt.state,Je=i3(te,Pe,ke.items);if(Je<0)throw new Error("Pass either item or item index in getItemProps!");var $t="onClick",Nt=qe,ht=function(){te!==Pt.highlightedIndex&&(O.current=!1,A({type:$v,index:te}))},Z=function(){A({type:bd,index:te}),L.current&&L.current.focus()};return Ct((ue={},ue[Ie]=Oo(Ee,function(Ae){Ae&&(M.current[j.getItemId(Je)]=Ae)}),ue.role="option",ue["aria-selected"]=""+(Je===Pt.highlightedIndex),ue.id=j.getItemId(Je),ue),!Ke.disabled&&(oe={onMouseMove:Ui(He,ht)},oe[$t]=Ui(Nt,Z),oe),Ke)},[A,q,O,j]),De=z.useCallback(function(ee){var ue,oe=ee===void 0?{}:ee,ve=oe.onClick;oe.onPress;var Pe=oe.refKey,te=Pe===void 0?"ref":Pe,Le=oe.ref,Ie=Xi(oe,_3),Ee=function(){A({type:Nv}),!q.current.state.isOpen&&L.current&&L.current.focus()};return Ct((ue={},ue[te]=Oo(Le,function(He){K.current=He}),ue.id=j.toggleButtonId,ue.tabIndex=-1,ue),!Ie.disabled&&Ct({},{onClick:Ui(ve,Ee)}),Ie)},[A,q,j]),pe=z.useCallback(function(ee,ue){var oe,ve=ee===void 0?{}:ee,Pe=ve.onKeyDown,te=ve.onChange,Le=ve.onInput,Ie=ve.onBlur;ve.onChangeText;var Ee=ve.refKey,He=Ee===void 0?"ref":Ee,qe=ve.ref,Ke=Xi(ve,w3),rt=ue===void 0?{}:ue;rt.suppressRefError;var ke=q.current.state,Pt=function(Fe){var pt=GC(Fe);pt&&de[pt]&&de[pt](Fe)},Je=function(Fe){A({type:vd,inputValue:Fe.target.value})},$t=function(){ke.isOpen&&!he.current.isMouseDown&&A({type:Su,selectItem:!0})},Nt="onChange",ht={};if(!Ke.disabled){var Z;ht=(Z={},Z[Nt]=Ui(te,Le,Je),Z.onKeyDown=Ui(Pe,Pt),Z.onBlur=Ui(Ie,$t),Z)}return Ct((oe={},oe[He]=Oo(qe,function(Ae){L.current=Ae}),oe.id=j.inputId,oe["aria-autocomplete"]="list",oe["aria-controls"]=j.menuId,oe),ke.isOpen&&ke.highlightedIndex>-1&&{"aria-activedescendant":j.getItemId(ke.highlightedIndex)},{"aria-labelledby":j.labelId,autoComplete:"off",value:ke.inputValue},ht,Ke)},[A,de,q,he,le,j]),$=z.useCallback(function(ee,ue){var oe,ve=ee===void 0?{}:ee,Pe=ve.refKey,te=Pe===void 0?"ref":Pe,Le=ve.ref,Ie=Xi(ve,O3),Ee=ue===void 0?{}:ue;return Ee.suppressRefError,Ct((oe={},oe[te]=Oo(Le,function(He){ie.current=He}),oe.role="combobox",oe["aria-haspopup"]="listbox",oe["aria-owns"]=j.menuId,oe["aria-expanded"]=q.current.state.isOpen,oe),Ie)},[q,le,j]),U=z.useCallback(function(){A({type:Dv})},[A]),N=z.useCallback(function(){A({type:Lv})},[A]),Q=z.useCallback(function(){A({type:jv})},[A]),V=z.useCallback(function(ee){A({type:zv,highlightedIndex:ee})},[A]),be=z.useCallback(function(ee){A({type:_d,selectedItem:ee})},[A]),fe=z.useCallback(function(ee){A({type:Hv,inputValue:ee})},[A]),H=z.useCallback(function(){A({type:Uv})},[A]);return{getItemProps:Oe,getLabelProps:Me,getMenuProps:Ne,getInputProps:pe,getComboboxProps:$,getToggleButtonProps:De,toggleMenu:U,openMenu:Q,closeMenu:N,setHighlightedIndex:V,setInputValue:fe,selectItem:be,reset:H,highlightedIndex:C,isOpen:P,selectedItem:v,inputValue:I}}function S3(e){var t=e.removedSelectedItem,r=e.itemToString;return r(t)+" has been removed."}se.array,se.array,se.array,se.func,se.func,se.func,se.number,se.number,se.number,se.func,se.func,se.string,se.string,se.shape({addEventListener:se.func,removeEventListener:se.func,document:se.shape({getElementById:se.func,activeElement:se.any,body:se.any})}),Ao.itemToString,Ao.stateReducer,Ao.environment;function A3(e){const{hotels:t,defaultHotel:r,selectedHotel:n,handleHotelChange:i,subMenuItem:a}=e,[o,s]=z.useState([]),{subMenus:u}=ct(T=>T.headerInfo),f=ii(),p=u.find(T=>T===a),d=T=>T?T[0]:"",{isOpen:y,getMenuProps:A,getInputProps:P,getComboboxProps:C,highlightedIndex:v,getItemProps:I}=kv({items:o,itemToString:d,initialSelectedItem:r,selectedItem:n,initialInputValue:r&&r[0],onSelectedItemChange:({selectedItem:T})=>{const M=T[0],[L,K]=T[1].split("_").map(J=>+J),ie={hotelId:L,guideId:K,name:M};Mr.unstable_batchedUpdates(()=>{f(ry(T)),f(Qg(ie)),f(ll(a))}),typeof i=="function"&&i(ie)},onInputValueChange:({inputValue:T})=>{s(t.filter(M=>d(M).toLowerCase().startsWith(T.toLowerCase())))}});return G("ul",{className:Qn("col-12","col-lg","py-3","px-lg-0","py-lg-0","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":p}),children:G("li",{children:We("div",{id:"hd-property-search",children:[G("label",{htmlFor:"hd-property-input",className:"form-label d-lg-none visually-hidden",children:"Select property"}),We("div",Vr(tr({id:"hd-property-input-container"},C()),{children:[G("input",tr({type:"text",className:"form-control",id:"hd-property-input",placeholder:"hotel name"},P())),G("ul",Vr(tr({style:{listStyle:"none",marginBottom:0}},A()),{children:y&&o.map((T,M)=>G("li",Vr(tr({style:v===M?{backgroundColor:"#bde4ff"}:{}},I({hotel:T,index:M})),{children:T[0]}),T[1]))})),G(Nr.Search,{className:"hd-icon hd-icon-search"}),G(Nr.Close,{className:"hd-icon hd-icon-close",onClick:()=>{console.log("clicked")}})]}))]})})})}function P3(e){const{handleHotelChange:t}=e,[r,n]=z.useState("Select property"),i=ct(v=>v.hotelInfo),a=ct(v=>v.userInfo),{isOpen:o,isMobileOrTablet:s}=ct(v=>v.headerInfo),{propertySelector:u}=ct(v=>v.titleBar),{items:f,defaultHotel:p,selectedHotel:d}=ct(v=>v.hotels),[y,{height:A}]=ps(),P=fa(!s||o,{from:{height:0},enter:{height:A},leave:{height:0},update:{height:A},config:Vr(tr({},Di.stiff),{clamp:!0})}),C=ii();return z.useEffect(()=>{(async()=>{if(u){let{type:v,hotels:I}=u;v==="fetch"&&(I=await(await fetch(I)).json());const T=I.find(M=>{const[L,K]=M[1].split("_").map(ie=>+ie);return i.hotelId===L&&i.guideId===K||a.hotelId===L&&a.guideId===K});Mr.unstable_batchedUpdates(()=>{C(EI(I)),C(CI(T)),C(ry(T))})}})()},[u]),P((v,I)=>I&&G(Li.div,{className:"col-12 col-lg me-lg-auto px-0 order-lg-3",id:"hd-property",style:s?v:{},children:G("ul",{ref:y,className:"row list-unstyled mx-0 mb-0 hd-nav-first-level",children:G("li",{className:"col-lg-auto align-items-center",onClick:()=>{C(ra(r))},children:We("div",{className:"row py-lg-0 align-items-center",children:[We("div",{className:"col col-lg-auto py-2 py-lg-0",id:"hd-group-property-name",children:[G("span",{className:"ps-lg-3 py-3 py-lg-0 d-block",id:"hd-group-name",children:"TESTING Hotels"}),We("div",{className:"row me-0 d-lg-none align-items-center",children:[We("div",{className:"col",children:[G("small",{className:"pt-2",children:r}),G("span",{className:"d-block",id:"hd-property-name",children:i.name||p&&p[0]})]}),G("div",{className:"col-auto p-2 d-block",children:G(Nr.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]})]}),f.length>0&&G(A3,{hotels:f,defaultHotel:p,selectedHotel:d,handleHotelChange:t,subMenuItem:r})]})})})}))}function I3(){const{i18n:e}=fo(),{help:t}=ct(i=>i.titleBar);if(!t)return null;const{label:r,href:n}=t;return G("li",{className:"col-lg-auto p-0",children:G("div",{className:"row m-0 py-lg-0 align-items-center",children:G("div",{className:"col py-2 py-lg-0 px-0",children:G("a",{className:"ps-lg-3 pe-3 py-2 d-block",title:"Help",href:n,target:"_blank",rel:"noreferrer",children:e.translate(r).fetch()})})})})}function x3(){const{i18n:e}=fo(),{subMenus:t}=ct(s=>s.headerInfo),{user:r}=ct(s=>s.titleBar),n=ii();if(!r)return null;const{label:i,children:a}=r,o=t.find(s=>s===i);return We("li",{className:"col-lg-auto p-0",onClick:()=>{n(ra(i))},children:[We("div",{className:"row m-0 py-lg-0 align-items-center",children:[We("div",{className:"col py-2 py-lg-0 px-0",children:[G("small",{className:"pt-2 d-lg-none",children:i}),We("span",{className:"ps-lg-3 pe-3 py-2 d-block",children:[G("span",{className:"d-none d-lg-inline",children:G(Nr.User,{className:"hd-icon hd-icon-user"})}),G("span",{className:"ps-lg-2",children:"david_all"}),G("span",{className:"d-none d-lg-inline ms-2",children:G(Nr.ArrowAngleDown,{className:"hd-icon hd-icon-arrow-angle-down"})})]})]}),G("div",{className:"col-auto p-2 d-block d-lg-none",children:G(Nr.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]}),G("ul",{className:Qn("py-3","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":o}),children:a.map(({href:s,label:u})=>G("li",{children:G("div",{className:"row m-0 py-lg-0 align-items-center",children:G("div",{className:"col py-2 py-lg-0 px-0",children:G("a",{className:"px-lg-4 py-2 d-block",href:s,target:"_blank",rel:"noreferrer",children:e.translate(u).fetch()})})})}))})]})}function E3(e){const{handleLanguageChange:t}=e,[r,n]=z.useState(),[i,a]=z.useState([]),o=ct(y=>y.userLanguage),{languageSelector:s}=ct(y=>y.titleBar),{subMenus:u}=ct(y=>y.headerInfo),f=ii();if(z.useEffect(()=>{if(s){const{children:y}=s;if(Array.isArray(y)){const A=y.map(({code:P,label:C})=>{const v=new Intl.DisplayNames([P],{type:"language"});return{code:P,name:C||v.of(P)}});A.length>0&&a(A)}}},[s]),z.useEffect(()=>{var y;if(o){const A=(y=i.find(({code:P})=>P===o))==null?void 0:y.name;A&&n(A)}},[o,i]),!s)return null;const{label:p}=s,d=u.find(y=>y===p);return We("li",{className:"col-lg-auto p-0",onClick:()=>{f(ra(p))},children:[We("div",{className:"row m-0 py-lg-0 align-items-center",children:[We("div",{className:"col py-2 py-lg-0 px-0",children:[G("small",{className:"pt-2 d-lg-none",children:p}),We("span",{className:"ps-lg-3 pe-3 pt-lg-2 pb-2 d-block",children:[r,G("span",{className:"d-none d-lg-inline ms-2",children:G(Nr.ArrowAngleDown,{className:"hd-icon hd-icon-arrow-angle-down"})})]})]}),G("div",{className:"col-auto p-2 d-block d-lg-none",children:G(Nr.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]}),G("ul",{className:Qn("py-3","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":d}),children:i.map(({code:y,name:A})=>G("li",{children:G("div",{className:"row m-0 py-lg-0 align-items-center",children:G("div",{className:"col py-2 py-lg-0 px-0",children:G("a",{className:"px-lg-4 py-2 d-block",href:"#",onClick:P=>{P.preventDefault(),P.stopPropagation(),f(ey(y)),typeof t=="function"&&t(y),f(ll(p))},children:A},y)})})}))})]})}function C3(){const[e,t]=z.useState(),{isOpen:r,subMenus:n,isMobileOrTablet:i}=ct(u=>u.headerInfo),{items:a}=ct(u=>u.menuItems),o=fa(n.length>0,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:Di.stiff}),s=ii();return z.useEffect(()=>{var f;const u=((f=a.find(p=>p.id===n[n.length-1]))==null?void 0:f.label)||n[n.length-1];u&&t(u)},[a,n]),!i||!r?null:o((u,f)=>f&&We(Li.div,{className:"col py-2 py-lg-0",id:"hd-submenu-title-container",style:u,children:[G("span",{id:"hd-submenu-back",onClick:()=>{s(ll(n[n.length-1]))},children:G(Nr.ArrowLeft,{className:"hd-icon hd-icon-arrow-left"})}),G("span",{className:"ms-3",id:"hd-submenu-title",children:e})]}))}function R3(e){const{handleHotelChange:t,handleLanguageChange:r}=e,{isOpen:n,isMobileOrTablet:i}=ct(u=>u.headerInfo),[a,{height:o}]=ps(),s=fa(!i||n,{from:{height:0},enter:{height:o},leave:{height:0},update:{height:o},config:Vr(tr({},Di.stiff),{clamp:!0})});return G("div",{className:"container-xxl",children:We("div",{className:"row align-items-center pb-lg-2",id:"hd-header-container",children:[G(C3,{}),G(Xx,{}),G(ZE,{}),G(tC,{}),G(TC,{}),G(P3,{handleHotelChange:t}),s((u,f)=>f&&G(Li.div,{className:"col-12 col-lg-auto ps-lg-0 align-middle order-lg-5",id:"hd-nav-container-top",style:i?u:{},children:G("nav",{ref:a,id:"hd-top-nav",children:We("ul",{className:"row list-unstyled mb-0 hd-nav-first-level",children:[G(I3,{}),G(E3,{handleLanguageChange:r}),G(x3,{})]})})}))]})})}let T3=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,r)=>(r&=63,r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r>62?t+="-":t+="_",t),"");function M3(e){var M;const{item:t,level:r,hasChildren:n,children:i}=e,{href:a,label:o,id:s,group:u,premium:f={}}=t,{value:p=!1,locked:d=!1}=f,{i18n:y}=fo(),{isOpen:A,subMenus:P}=ct(L=>L.headerInfo),{items:C}=ct(L=>L.menuItems),v=A&&P.find(L=>L===s),I=!!u&&((M=C.find(L=>L.group===u))==null?void 0:M.id)===s,T=ii();if(p&&d)return We("li",{className:"hd-nav-has-children",onClick:()=>{T(ra(s))},children:[G("div",{className:"row m-0 py-lg-0 align-items-center",children:G("div",{className:"col py-2 py-lg-0 px-0",children:We("span",{className:"px-lg-3 py-2 d-block",children:[y.translate("label").fetch(),G("span",{className:"float-end",children:G(Nr.Lock,{className:"hd-icon hd-icon-lock"})})]})})}),G("ul",{className:Qn("py-3","list-unstyled",{"hd-nav-second-level":r===1,"hd-nav-third-level":r===2,"hd-submenu-opened":v}),children:G("li",{className:"hd-premium",children:G("div",{className:"row m-0 py-lg-0 align-items-center",children:We("div",{className:"col p-lg-3",children:[G("span",{className:"d-lg-none mb-3",children:G(Nr.Lock,{className:"hd-icon hd-icon-lock"})}),We("p",{children:["This premium functionality has not been activated.",G("br",{}),"Please contact us to activate this feature."]}),G("a",{className:"btn btn-sm btn-outline-primary",href:"#",target:"_blank",children:"Learn more"})]})})})})]});if(r===1)return We("li",{className:"col-lg-auto p-0",onClick:()=>{n&&T(ra(s))},children:[We("div",{className:"row m-0 py-lg-0 align-items-center",children:[G("div",{className:"col py-2 py-lg-0 px-0",children:G("span",{className:"ps-lg-3 pe-3 py-2",children:y.translate(o).fetch()})}),n&&G("div",{className:"col-auto p-2 d-block d-lg-none",children:G(Nr.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]}),n&&G("ul",{className:Qn("py-3","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":v}),children:i})]});if(r===2)return We(es,{children:[I&&G("div",{className:"row m-0 pt-3 hd-nav-section",children:G("div",{className:"col py-2 py-lg-0 px-0",children:G("div",{className:"px-lg-3 d-block text-uppercase",children:y.translate(u).fetch()})})}),We("li",{onClick:()=>{n&&T(ra(s))},children:[We("div",{className:"row m-0 py-lg-0 align-items-center",children:[G("div",{className:"col py-2 py-lg-0 px-0",children:a?G("a",{className:"px-lg-3 py-2 d-block",href:a,onClick:()=>{T(cl(s))},children:y.translate(o).fetch()}):G("span",{className:"px-lg-3 py-2 d-block",children:y.translate(o).fetch()})}),n&&G("div",{className:"col-auto px-0",children:G("span",{className:"p-2 d-lg-block",children:G(Nr.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})})]}),n&&G("ul",{className:Qn("ps-3","ps-lg-0","list-unstyled","hd-nav-third-level",{"hd-submenu-opened":v}),children:i})]})]});if(r===3)return G("li",{children:G("div",{className:"row m-0 py-1 py-lg-0 align-items-center",children:G("div",{className:"col p-lg-0",children:G("a",{className:"px-lg-3 py-2 d-block",href:a,onClick:()=>{T(cl(s))},children:y.translate(o).fetch()})})})})}const Wv=T3();function Kv(e){const{menuItems:t,parentId:r=Wv,level:n=1}=e,i=t.filter(a=>(a.parentId||Wv)===r);return i.length?i.map(a=>{const o=!!t.find(p=>p.parentId===a.id),{premium:s={}}=a,{value:u=!1,locked:f=!1}=s;return G(M3,{item:a,level:n,hasChildren:o,premium:u,locked:f,children:G(Kv,{menuItems:t,parentId:a.id,level:n+1})},a.id)}):null}function F3(){const{items:e}=ct(f=>f.menuItems),{isOpen:t,isMobileOrTablet:r,subMenus:n}=ct(f=>f.headerInfo),i=ii(),[a,{height:o}]=ps(),s=z.useRef(null),u=fa(!r||t,{from:{height:0},enter:{height:o},leave:{height:0},update:{height:o},config:Vr(tr({},Di.stiff),{clamp:!0})});return z.useEffect(()=>{if(e.length>0){const f=new URL(window.location.href),{hash:p}=f,d=e.find(y=>y.href===p);d&&i(cl(d.id))}},[e]),z.useEffect(()=>{s&&n.length>0&&(s.current.scrollTop=0)},[n.length]),u((f,p)=>p&&G(Li.div,{className:"container-xxl",id:"hd-nav-container",style:r?f:{},children:G("nav",{className:"hd-nav",ref:a,children:G("ul",{ref:s,className:"row list-unstyled mb-0 hd-nav-first-level",children:G(Kv,{menuItems:e})})})}))}function $3(){const[e,t]=z.useState([]),{items:r,selectedItem:n}=ct(a=>a.menuItems),{i18n:i}=fo();return z.useEffect(()=>{if(n){const a=[];let o=r.find(s=>s.id===n);do a.push(o),o=r.find(s=>s.id===o.parentId);while(o);t(a.reverse())}},[n]),e.length===0?null:G("div",{className:"container-xxl mt-3 mt-lg-5",children:G("nav",{"aria-label":"breadcrumb",id:"hd-breadcrumb",children:We("ol",{className:"breadcrumb mb-0",children:[G("li",{className:"breadcrumb-item active",children:i.translate(e[0].label).fetch()}),e.length>=2&&G("li",{className:"breadcrumb-item active",children:i.translate(e[1].label).fetch()}),e.length===3&&G("li",{className:"breadcrumb-item active",children:i.translate(e[2].label).fetch()})]})})})}function N3(e){const{hotelInfo:t,userInfo:r,userLanguage:n}=e,{isOpen:i,subMenus:a,isMobileOrTablet:o}=ct(p=>p.headerInfo),s=z.useRef(null),{width:u}=$P(),f=ii();return z.useEffect(()=>{n&&f(ey(n))},[]),z.useEffect(()=>{u&&f(SI(u))},[u]),z.useEffect(()=>{fetch("/api/titlebar").then(p=>p.json()).then(p=>{f(gI(p))})},[]),z.useEffect(()=>{fetch("/api/menu").then(p=>p.json()).then(p=>{f(hI(p))})},[]),z.useEffect(()=>{fetch("/api/notifications").then(p=>p.json()).then(p=>{f(mI(p))})},[]),z.useEffect(()=>{t&&f(Qg(t))},[]),z.useEffect(()=>{r&&f(_I(r))},[]),z.useEffect(()=>{s&&a.length>0&&(s.current.scrollTop=0)},[a.length]),We(es,{children:[We("div",{ref:s,id:"hd-container",className:Qn("container-fluid","px-0 fixed-top",{"hd-menu-opened":i,"hd-overflow-hidden":a.length>0}),style:tr({},o&&!i&&{overflow:"hidden"}),children:[G(R3,tr({},e)),G(F3,{})]}),G($3,{})]})}const qv=FI(N3);function D3(e,t){Mr.render(G(qv,tr({},t)),e)}DA(),rr.Header=qv,rr.renderHeader=D3,Object.defineProperties(rr,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
134
|
+
*/var vu=60103,bu=60106,ho=60107,po=60108,go=60114,yo=60109,mo=60110,vo=60112,bo=60113,sd=60120,_o=60115,wo=60116,mv=60121,vv=60122,bv=60117,_v=60129,wv=60131;if(typeof Symbol=="function"&&Symbol.for){var wr=Symbol.for;vu=wr("react.element"),bu=wr("react.portal"),ho=wr("react.fragment"),po=wr("react.strict_mode"),go=wr("react.profiler"),yo=wr("react.provider"),mo=wr("react.context"),vo=wr("react.forward_ref"),bo=wr("react.suspense"),sd=wr("react.suspense_list"),_o=wr("react.memo"),wo=wr("react.lazy"),mv=wr("react.block"),vv=wr("react.server.block"),bv=wr("react.fundamental"),_v=wr("react.debug_trace_mode"),wv=wr("react.legacy_hidden")}function $n(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case vu:switch(e=e.type,e){case ho:case go:case po:case bo:case sd:return e;default:switch(e=e&&e.$$typeof,e){case mo:case vo:case wo:case _o:case yo:return e;default:return t}}case bu:return t}}}var MC=yo,FC=vu,$C=vo,NC=ho,DC=wo,jC=_o,LC=bu,zC=go,HC=po,UC=bo;At.ContextConsumer=mo,At.ContextProvider=MC,At.Element=FC,At.ForwardRef=$C,At.Fragment=NC,At.Lazy=DC,At.Memo=jC,At.Portal=LC,At.Profiler=zC,At.StrictMode=HC,At.Suspense=UC,At.isAsyncMode=function(){return!1},At.isConcurrentMode=function(){return!1},At.isContextConsumer=function(e){return $n(e)===mo},At.isContextProvider=function(e){return $n(e)===yo},At.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===vu},At.isForwardRef=function(e){return $n(e)===vo},At.isFragment=function(e){return $n(e)===ho},At.isLazy=function(e){return $n(e)===wo},At.isMemo=function(e){return $n(e)===_o},At.isPortal=function(e){return $n(e)===bu},At.isProfiler=function(e){return $n(e)===go},At.isStrictMode=function(e){return $n(e)===po},At.isSuspense=function(e){return $n(e)===bo},At.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===ho||e===go||e===_v||e===po||e===bo||e===sd||e===wv||typeof e=="object"&&e!==null&&(e.$$typeof===wo||e.$$typeof===_o||e.$$typeof===yo||e.$$typeof===mo||e.$$typeof===vo||e.$$typeof===bv||e.$$typeof===mv||e[0]===vv)},At.typeOf=$n;function Ov(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function Sv(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function ud(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var r=getComputedStyle(e,null);return Sv(r.overflowY,t)||Sv(r.overflowX,t)||function(n){var i=function(a){if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}}(n);return!!i&&(i.clientHeight<n.scrollHeight||i.clientWidth<n.scrollWidth)}(e)}return!1}function _u(e,t,r,n,i,a,o,s){return a<e&&o>t||a>e&&o<t?0:a<=e&&s<=r||o>=t&&s>=r?a-e-n:o>t&&s<r||a<e&&s>r?o-t+i:0}function BC(e,t){var r=window,n=t.scrollMode,i=t.block,a=t.inline,o=t.boundary,s=t.skipOverflowHiddenElements,u=typeof o=="function"?o:function(ue){return ue!==o};if(!Ov(e))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,p=[],d=e;Ov(d)&&u(d);){if((d=d.parentElement)===f){p.push(d);break}d!=null&&d===document.body&&ud(d)&&!ud(document.documentElement)||d!=null&&ud(d,s)&&p.push(d)}for(var y=r.visualViewport?r.visualViewport.width:innerWidth,A=r.visualViewport?r.visualViewport.height:innerHeight,P=window.scrollX||pageXOffset,C=window.scrollY||pageYOffset,v=e.getBoundingClientRect(),I=v.height,T=v.width,M=v.top,L=v.right,K=v.bottom,ie=v.left,J=i==="start"||i==="nearest"?M:i==="end"?K:M+I/2,j=a==="center"?ie+T/2:a==="end"?L:ie,ce=[],q=0;q<p.length;q++){var ge=p[q],O=ge.getBoundingClientRect(),he=O.height,le=O.width,de=O.top,Me=O.right,Ne=O.bottom,Oe=O.left;if(n==="if-needed"&&M>=0&&ie>=0&&K<=A&&L<=y&&M>=de&&K<=Ne&&ie>=Oe&&L<=Me)return ce;var De=getComputedStyle(ge),pe=parseInt(De.borderLeftWidth,10),$=parseInt(De.borderTopWidth,10),U=parseInt(De.borderRightWidth,10),N=parseInt(De.borderBottomWidth,10),Q=0,V=0,be="offsetWidth"in ge?ge.offsetWidth-ge.clientWidth-pe-U:0,fe="offsetHeight"in ge?ge.offsetHeight-ge.clientHeight-$-N:0;if(f===ge)Q=i==="start"?J:i==="end"?J-A:i==="nearest"?_u(C,C+A,A,$,N,C+J,C+J+I,I):J-A/2,V=a==="start"?j:a==="center"?j-y/2:a==="end"?j-y:_u(P,P+y,y,pe,U,P+j,P+j+T,T),Q=Math.max(0,Q+C),V=Math.max(0,V+P);else{Q=i==="start"?J-de-$:i==="end"?J-Ne+N+fe:i==="nearest"?_u(de,Ne,he,$,N+fe,J,J+I,I):J-(de+he/2)+fe/2,V=a==="start"?j-Oe-pe:a==="center"?j-(Oe+le/2)+be/2:a==="end"?j-Me+U+be:_u(Oe,Me,le,pe,U+be,j,j+T,T);var H=ge.scrollLeft,ee=ge.scrollTop;J+=ee-(Q=Math.max(0,Math.min(ee+Q,ge.scrollHeight-he+fe))),j+=H-(V=Math.max(0,Math.min(H+V,ge.scrollWidth-le+be)))}ce.push({el:ge,top:Q,left:V})}return ce}var kC=0;function Av(){}function WC(e,t){if(!!e){var r=BC(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});r.forEach(function(n){var i=n.el,a=n.top,o=n.left;i.scrollTop=a,i.scrollLeft=o})}}function Pv(e,t,r){var n=e===t||t instanceof r.Node&&e.contains&&e.contains(t);return n}function Iv(e,t){var r;function n(){r&&clearTimeout(r)}function i(){for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];n(),r=setTimeout(function(){r=null,e.apply(void 0,o)},t)}return i.cancel=n,i}function Ui(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return t.some(function(s){return s&&s.apply(void 0,[n].concat(a)),n.preventDownshiftDefault||n.hasOwnProperty("nativeEvent")&&n.nativeEvent.preventDownshiftDefault})}}function Oo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){t.forEach(function(i){typeof i=="function"?i(n):i&&(i.current=n)})}}function KC(){return String(kC++)}function qC(e){var t=e.isOpen,r=e.resultCount,n=e.previousResultCount;return t?r?r!==n?r+" result"+(r===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function cd(e,t){return Object.keys(e).reduce(function(r,n){return r[n]=xv(t,n)?t[n]:e[n],r},{})}function xv(e,t){return e[t]!==void 0}function GC(e){var t=e.key,r=e.keyCode;return r>=37&&r<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function ld(e,t,r,n,i){if(i===void 0&&(i=!0),r===0)return-1;var a=r-1;(typeof t!="number"||t<0||t>=r)&&(t=e>0?-1:a+1);var o=t+e;o<0?o=i?a:0:o>a&&(o=i?0:a);var s=So(e,o,r,n,i);return s===-1?t>=r?-1:t:s}function So(e,t,r,n,i){var a=n(t);if(!a||!a.hasAttribute("disabled"))return t;if(e>0){for(var o=t+1;o<r;o++)if(!n(o).hasAttribute("disabled"))return o}else for(var s=t-1;s>=0;s--)if(!n(s).hasAttribute("disabled"))return s;return i?e>0?So(1,0,r,n,!1):So(-1,r-1,r,n,!1):-1}function Ev(e,t,r,n){return n===void 0&&(n=!0),t.some(function(i){return i&&(Pv(i,e,r)||n&&Pv(i,r.document.activeElement,r))})}var VC=Iv(function(e){Cv(e).textContent=""},500);function YC(e,t){var r=Cv(t);!e||(r.textContent=e,VC(t))}function Cv(e){e===void 0&&(e=document);var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var QC=["isInitialMount","highlightedIndex","items","environment"],Rv={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function JC(e,t,r){var n=e.props,i=e.type,a={};Object.keys(t).forEach(function(o){XC(o,e,t,r),r[o]!==t[o]&&(a[o]=r[o])}),n.onStateChange&&Object.keys(a).length&&n.onStateChange(Ct({type:i},a))}function XC(e,t,r,n){var i=t.props,a=t.type,o="on"+fd(e)+"Change";i[o]&&n[e]!==void 0&&n[e]!==r[e]&&i[o](Ct({type:a},n))}function ZC(e,t){return t.changes}function e3(e){var t=e.selectedItem,r=e.itemToString;return t?r(t)+" has been selected.":""}var t3=Iv(function(e,t){YC(e(),t)},200),r3=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?z.useLayoutEffect:z.useEffect;function n3(e){var t=e.id,r=t===void 0?"downshift-"+KC():t,n=e.labelId,i=e.menuId,a=e.getItemId,o=e.toggleButtonId,s=e.inputId,u=z.useRef({labelId:n||r+"-label",menuId:i||r+"-menu",getItemId:a||function(f){return r+"-item-"+f},toggleButtonId:o||r+"-toggle-button",inputId:s||r+"-input"});return u.current}function i3(e,t,r){return e!==void 0?e:r.length===0?-1:r.indexOf(t)}function a3(e){return e?String(e):""}function fd(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function Tv(e){var t=z.useRef(e);return t.current=e,t}function o3(e,t,r){var n=z.useRef(),i=z.useRef(),a=z.useCallback(function(y,A){i.current=A,y=cd(y,A.props);var P=e(y,A),C=A.props.stateReducer(y,Ct({},A,{changes:P}));return C},[e]),o=z.useReducer(a,t),s=o[0],u=o[1],f=Tv(r),p=z.useCallback(function(y){return u(Ct({props:f.current},y))},[f]),d=i.current;return z.useEffect(function(){d&&n.current&&n.current!==s&&JC(d,cd(n.current,d.props),s),n.current=s},[s,r,d]),[s,p]}var Ao={itemToString:a3,stateReducer:ZC,getA11ySelectionMessage:e3,scrollIntoView:WC,circularNavigation:!1,environment:typeof window=="undefined"?{}:window};function ri(e,t,r){r===void 0&&(r=Rv);var n="default"+fd(t);return n in e?e[n]:r[t]}function wu(e,t,r){if(r===void 0&&(r=Rv),t in e)return e[t];var n="initial"+fd(t);return n in e?e[n]:ri(e,t,r)}function s3(e){var t=wu(e,"selectedItem"),r=wu(e,"isOpen"),n=wu(e,"highlightedIndex"),i=wu(e,"inputValue");return{highlightedIndex:n<0&&t&&r?e.items.indexOf(t):n,isOpen:r,selectedItem:t,inputValue:i}}function Ou(e,t,r,n){var i=e.items,a=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,s=t.selectedItem,u=t.highlightedIndex;return i.length===0?-1:a!==void 0&&u===a?a:o!==void 0?o:s?r===0?i.indexOf(s):ld(r,i.indexOf(s),i.length,n,!1):r===0?-1:r<0?i.length-1:0}function u3(e,t,r,n){var i=z.useRef({isMouseDown:!1,isTouchMove:!1});return z.useEffect(function(){var a=function(){i.current.isMouseDown=!0},o=function(d){i.current.isMouseDown=!1,e&&!Ev(d.target,t.map(function(y){return y.current}),r)&&n()},s=function(){i.current.isTouchMove=!1},u=function(){i.current.isTouchMove=!0},f=function(d){e&&!i.current.isTouchMove&&!Ev(d.target,t.map(function(y){return y.current}),r,!1)&&n()};return r.addEventListener("mousedown",a),r.addEventListener("mouseup",o),r.addEventListener("touchstart",s),r.addEventListener("touchmove",u),r.addEventListener("touchend",f),function(){r.removeEventListener("mousedown",a),r.removeEventListener("mouseup",o),r.removeEventListener("touchstart",s),r.removeEventListener("touchmove",u),r.removeEventListener("touchend",f)}},[e,r]),i}var c3=function(){return Av};function Mv(e,t,r){var n=r.isInitialMount,i=r.highlightedIndex,a=r.items,o=r.environment,s=Xi(r,QC);z.useEffect(function(){n||t3(function(){return e(Ct({highlightedIndex:i,highlightedItem:a[i],resultCount:a.length},s))},o.document)},t)}function l3(e){var t=e.highlightedIndex,r=e.isOpen,n=e.itemRefs,i=e.getItemNodeFromIndex,a=e.menuElement,o=e.scrollIntoView,s=z.useRef(!0);return r3(function(){t<0||!r||!Object.keys(n.current).length||(s.current===!1?s.current=!0:o(i(t),a))},[t]),s}var f3=Av;function d3(e,t,r){var n=t.type,i=t.props,a;switch(n){case r.ItemMouseMove:a={highlightedIndex:t.index};break;case r.MenuMouseLeave:a={highlightedIndex:-1};break;case r.ToggleButtonClick:case r.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Ou(i,e,0)};break;case r.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:Ou(i,e,0)};break;case r.FunctionCloseMenu:a={isOpen:!1};break;case r.FunctionSetHighlightedIndex:a={highlightedIndex:t.highlightedIndex};break;case r.FunctionSetInputValue:a={inputValue:t.inputValue};break;case r.FunctionReset:a={highlightedIndex:ri(i,"highlightedIndex"),isOpen:ri(i,"isOpen"),selectedItem:ri(i,"selectedItem"),inputValue:ri(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return Ct({},e,a)}se.array.isRequired,se.func,se.func,se.func,se.bool,se.number,se.number,se.number,se.bool,se.bool,se.bool,se.any,se.any,se.any,se.string,se.string,se.string,se.func,se.string,se.func,se.func,se.func,se.func,se.func,se.shape({addEventListener:se.func,removeEventListener:se.func,document:se.shape({getElementById:se.func,activeElement:se.any,body:se.any})});function h3(e){var t=e.isOpen,r=e.resultCount,n=e.previousResultCount;return t?r?r!==n?r+" result"+(r===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.":"":"No results are available.":""}hs(hs({},Ao),{getA11yStatusMessage:h3});var dd=0,hd=1,pd=2,gd=3,yd=4,md=5,vd=6,Su=7,Fv=8,$v=9,bd=10,Nv=11,Dv=12,jv=13,Lv=14,zv=15,_d=16,Hv=17,Uv=18,wd=19,Bv=Object.freeze({__proto__:null,InputKeyDownArrowDown:dd,InputKeyDownArrowUp:hd,InputKeyDownEscape:pd,InputKeyDownHome:gd,InputKeyDownEnd:yd,InputKeyDownEnter:md,InputChange:vd,InputBlur:Su,MenuMouseLeave:Fv,ItemMouseMove:$v,ItemClick:bd,ToggleButtonClick:Nv,FunctionToggleMenu:Dv,FunctionOpenMenu:jv,FunctionCloseMenu:Lv,FunctionSetHighlightedIndex:zv,FunctionSelectItem:_d,FunctionSetInputValue:Hv,FunctionReset:Uv,ControlledPropUpdatedSelectedItem:wd});function p3(e){var t=s3(e),r=t.selectedItem,n=t.inputValue;return n===""&&r&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(n=e.itemToString(r)),Ct({},t,{inputValue:n})}se.array.isRequired,se.func,se.func,se.func,se.bool,se.number,se.number,se.number,se.bool,se.bool,se.bool,se.any,se.any,se.any,se.string,se.string,se.string,se.string,se.string,se.string,se.func,se.string,se.string,se.func,se.func,se.func,se.func,se.func,se.func,se.shape({addEventListener:se.func,removeEventListener:se.func,document:se.shape({getElementById:se.func,activeElement:se.any,body:se.any})});function g3(e,t,r){var n=z.useRef(),i=o3(e,t,r),a=i[0],o=i[1];return z.useEffect(function(){xv(r,"selectedItem")&&(n.current!==r.selectedItem&&o({type:wd,inputValue:r.itemToString(r.selectedItem)}),n.current=a.selectedItem===n.current?r.selectedItem:a.selectedItem)}),[cd(a,r),o]}var y3=Ct({},Ao,{getA11yStatusMessage:qC,circularNavigation:!0});function m3(e,t){var r=t.type,n=t.props,i=t.shiftKey,a;switch(r){case bd:a={isOpen:ri(n,"isOpen"),highlightedIndex:ri(n,"highlightedIndex"),selectedItem:n.items[t.index],inputValue:n.itemToString(n.items[t.index])};break;case dd:e.isOpen?a={highlightedIndex:ld(i?5:1,e.highlightedIndex,n.items.length,t.getItemNodeFromIndex,n.circularNavigation)}:a={highlightedIndex:Ou(n,e,1,t.getItemNodeFromIndex),isOpen:n.items.length>=0};break;case hd:e.isOpen?a={highlightedIndex:ld(i?-5:-1,e.highlightedIndex,n.items.length,t.getItemNodeFromIndex,n.circularNavigation)}:a={highlightedIndex:Ou(n,e,-1,t.getItemNodeFromIndex),isOpen:n.items.length>=0};break;case md:a=Ct({},e.isOpen&&e.highlightedIndex>=0&&{selectedItem:n.items[e.highlightedIndex],isOpen:ri(n,"isOpen"),highlightedIndex:ri(n,"highlightedIndex"),inputValue:n.itemToString(n.items[e.highlightedIndex])});break;case pd:a=Ct({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case gd:a={highlightedIndex:So(1,0,n.items.length,t.getItemNodeFromIndex,!1)};break;case yd:a={highlightedIndex:So(-1,n.items.length-1,n.items.length,t.getItemNodeFromIndex,!1)};break;case Su:a=Ct({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&t.selectItem&&{selectedItem:n.items[e.highlightedIndex],inputValue:n.itemToString(n.items[e.highlightedIndex])});break;case vd:a={isOpen:!0,highlightedIndex:ri(n,"highlightedIndex"),inputValue:t.inputValue};break;case _d:a={selectedItem:t.selectedItem,inputValue:n.itemToString(t.selectedItem)};break;case wd:a={inputValue:t.inputValue};break;default:return d3(e,t,Bv)}return Ct({},e,a)}var v3=["onMouseLeave","refKey","ref"],b3=["item","index","refKey","ref","onMouseMove","onClick","onPress"],_3=["onClick","onPress","refKey","ref"],w3=["onKeyDown","onChange","onInput","onBlur","onChangeText","refKey","ref"],O3=["refKey","ref"];kv.stateChangeTypes=Bv;function kv(e){e===void 0&&(e={});var t=Ct({},y3,e),r=t.initialIsOpen,n=t.defaultIsOpen,i=t.items,a=t.scrollIntoView,o=t.environment,s=t.getA11yStatusMessage,u=t.getA11ySelectionMessage,f=t.itemToString,p=p3(t),d=g3(m3,p,t),y=d[0],A=d[1],P=y.isOpen,C=y.highlightedIndex,v=y.selectedItem,I=y.inputValue,T=z.useRef(null),M=z.useRef({}),L=z.useRef(null),K=z.useRef(null),ie=z.useRef(null),J=z.useRef(!0),j=n3(t),ce=z.useRef(),q=Tv({state:y,props:t}),ge=z.useCallback(function(ee){return M.current[j.getItemId(ee)]},[j]);Mv(s,[P,C,I,i],Ct({isInitialMount:J.current,previousResultCount:ce.current,items:i,environment:o,itemToString:f},y)),Mv(u,[v],Ct({isInitialMount:J.current,previousResultCount:ce.current,items:i,environment:o,itemToString:f},y));var O=l3({menuElement:T.current,highlightedIndex:C,isOpen:P,itemRefs:M,scrollIntoView:a,getItemNodeFromIndex:ge});f3({isInitialMount:J.current,props:t,state:y}),z.useEffect(function(){var ee=r||n||P;ee&&L.current&&L.current.focus()},[]),z.useEffect(function(){J.current||(ce.current=i.length)});var he=u3(P,[ie,T,K],o,function(){A({type:Su,selectItem:!1})}),le=c3();z.useEffect(function(){J.current=!1},[]),z.useEffect(function(){P||(M.current={})},[P]);var de=z.useMemo(function(){return{ArrowDown:function(ue){ue.preventDefault(),A({type:dd,shiftKey:ue.shiftKey,getItemNodeFromIndex:ge})},ArrowUp:function(ue){ue.preventDefault(),A({type:hd,shiftKey:ue.shiftKey,getItemNodeFromIndex:ge})},Home:function(ue){!q.current.state.isOpen||(ue.preventDefault(),A({type:gd,getItemNodeFromIndex:ge}))},End:function(ue){!q.current.state.isOpen||(ue.preventDefault(),A({type:yd,getItemNodeFromIndex:ge}))},Escape:function(){var ue=q.current.state;(ue.isOpen||ue.inputValue||ue.selectedItem||ue.highlightedIndex>-1)&&A({type:pd})},Enter:function(ue){var oe=q.current.state;!oe.isOpen||oe.highlightedIndex<0||ue.which===229||(ue.preventDefault(),A({type:md,getItemNodeFromIndex:ge}))}}},[A,q,ge]),Me=z.useCallback(function(ee){return Ct({id:j.labelId,htmlFor:j.inputId},ee)},[j]),Ne=z.useCallback(function(ee,ue){var oe,ve=ee===void 0?{}:ee,Pe=ve.onMouseLeave,te=ve.refKey,Le=te===void 0?"ref":te,Ie=ve.ref,Ee=Xi(ve,v3),He=ue===void 0?{}:ue;return He.suppressRefError,Ct((oe={},oe[Le]=Oo(Ie,function(qe){T.current=qe}),oe.id=j.menuId,oe.role="listbox",oe["aria-labelledby"]=j.labelId,oe.onMouseLeave=Ui(Pe,function(){A({type:Fv})}),oe),Ee)},[A,le,j]),Oe=z.useCallback(function(ee){var ue,oe,ve=ee===void 0?{}:ee,Pe=ve.item,te=ve.index,Le=ve.refKey,Ie=Le===void 0?"ref":Le,Ee=ve.ref,He=ve.onMouseMove,qe=ve.onClick;ve.onPress;var Ke=Xi(ve,b3),rt=q.current,ke=rt.props,Pt=rt.state,Je=i3(te,Pe,ke.items);if(Je<0)throw new Error("Pass either item or item index in getItemProps!");var $t="onClick",Nt=qe,ht=function(){te!==Pt.highlightedIndex&&(O.current=!1,A({type:$v,index:te}))},Z=function(){A({type:bd,index:te}),L.current&&L.current.focus()};return Ct((ue={},ue[Ie]=Oo(Ee,function(Ae){Ae&&(M.current[j.getItemId(Je)]=Ae)}),ue.role="option",ue["aria-selected"]=""+(Je===Pt.highlightedIndex),ue.id=j.getItemId(Je),ue),!Ke.disabled&&(oe={onMouseMove:Ui(He,ht)},oe[$t]=Ui(Nt,Z),oe),Ke)},[A,q,O,j]),De=z.useCallback(function(ee){var ue,oe=ee===void 0?{}:ee,ve=oe.onClick;oe.onPress;var Pe=oe.refKey,te=Pe===void 0?"ref":Pe,Le=oe.ref,Ie=Xi(oe,_3),Ee=function(){A({type:Nv}),!q.current.state.isOpen&&L.current&&L.current.focus()};return Ct((ue={},ue[te]=Oo(Le,function(He){K.current=He}),ue.id=j.toggleButtonId,ue.tabIndex=-1,ue),!Ie.disabled&&Ct({},{onClick:Ui(ve,Ee)}),Ie)},[A,q,j]),pe=z.useCallback(function(ee,ue){var oe,ve=ee===void 0?{}:ee,Pe=ve.onKeyDown,te=ve.onChange,Le=ve.onInput,Ie=ve.onBlur;ve.onChangeText;var Ee=ve.refKey,He=Ee===void 0?"ref":Ee,qe=ve.ref,Ke=Xi(ve,w3),rt=ue===void 0?{}:ue;rt.suppressRefError;var ke=q.current.state,Pt=function(Fe){var pt=GC(Fe);pt&&de[pt]&&de[pt](Fe)},Je=function(Fe){A({type:vd,inputValue:Fe.target.value})},$t=function(){ke.isOpen&&!he.current.isMouseDown&&A({type:Su,selectItem:!0})},Nt="onChange",ht={};if(!Ke.disabled){var Z;ht=(Z={},Z[Nt]=Ui(te,Le,Je),Z.onKeyDown=Ui(Pe,Pt),Z.onBlur=Ui(Ie,$t),Z)}return Ct((oe={},oe[He]=Oo(qe,function(Ae){L.current=Ae}),oe.id=j.inputId,oe["aria-autocomplete"]="list",oe["aria-controls"]=j.menuId,oe),ke.isOpen&&ke.highlightedIndex>-1&&{"aria-activedescendant":j.getItemId(ke.highlightedIndex)},{"aria-labelledby":j.labelId,autoComplete:"off",value:ke.inputValue},ht,Ke)},[A,de,q,he,le,j]),$=z.useCallback(function(ee,ue){var oe,ve=ee===void 0?{}:ee,Pe=ve.refKey,te=Pe===void 0?"ref":Pe,Le=ve.ref,Ie=Xi(ve,O3),Ee=ue===void 0?{}:ue;return Ee.suppressRefError,Ct((oe={},oe[te]=Oo(Le,function(He){ie.current=He}),oe.role="combobox",oe["aria-haspopup"]="listbox",oe["aria-owns"]=j.menuId,oe["aria-expanded"]=q.current.state.isOpen,oe),Ie)},[q,le,j]),U=z.useCallback(function(){A({type:Dv})},[A]),N=z.useCallback(function(){A({type:Lv})},[A]),Q=z.useCallback(function(){A({type:jv})},[A]),V=z.useCallback(function(ee){A({type:zv,highlightedIndex:ee})},[A]),be=z.useCallback(function(ee){A({type:_d,selectedItem:ee})},[A]),fe=z.useCallback(function(ee){A({type:Hv,inputValue:ee})},[A]),H=z.useCallback(function(){A({type:Uv})},[A]);return{getItemProps:Oe,getLabelProps:Me,getMenuProps:Ne,getInputProps:pe,getComboboxProps:$,getToggleButtonProps:De,toggleMenu:U,openMenu:Q,closeMenu:N,setHighlightedIndex:V,setInputValue:fe,selectItem:be,reset:H,highlightedIndex:C,isOpen:P,selectedItem:v,inputValue:I}}function S3(e){var t=e.removedSelectedItem,r=e.itemToString;return r(t)+" has been removed."}se.array,se.array,se.array,se.func,se.func,se.func,se.number,se.number,se.number,se.func,se.func,se.string,se.string,se.shape({addEventListener:se.func,removeEventListener:se.func,document:se.shape({getElementById:se.func,activeElement:se.any,body:se.any})}),Ao.itemToString,Ao.stateReducer,Ao.environment;function A3(e){const{hotels:t,defaultHotel:r,selectedHotel:n,handleHotelChange:i,subMenuItem:a}=e,[o,s]=z.useState([]),{subMenus:u}=ct(T=>T.headerInfo),f=ii(),p=u.find(T=>T===a),d=T=>T?T[0]:"",{isOpen:y,getMenuProps:A,getInputProps:P,getComboboxProps:C,highlightedIndex:v,getItemProps:I}=kv({items:o,itemToString:d,initialSelectedItem:r,selectedItem:n,initialInputValue:r&&r[0],onSelectedItemChange:({selectedItem:T})=>{const M=T[0],[L,K]=T[1].split("_").map(J=>+J),ie={hotelId:L,guideId:K,name:M};Mr.unstable_batchedUpdates(()=>{f(ry(T)),f(Qg(ie)),f(ll(a))}),typeof i=="function"&&i(ie)},onInputValueChange:({inputValue:T})=>{s(t.filter(M=>d(M).toLowerCase().startsWith(T.toLowerCase())))}});return G("ul",{className:Qn("col-12","col-lg","py-3","px-lg-0","py-lg-0","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":p}),children:G("li",{children:We("div",{id:"hd-property-search",children:[G("label",{htmlFor:"hd-property-input",className:"form-label d-lg-none visually-hidden",children:"Select property"}),We("div",Vr(tr({id:"hd-property-input-container"},C()),{children:[G("input",tr({type:"text",className:"form-control",id:"hd-property-input",placeholder:"hotel name"},P())),G("ul",Vr(tr({style:{listStyle:"none",marginBottom:0}},A()),{children:y&&o.map((T,M)=>G("li",Vr(tr({style:v===M?{backgroundColor:"#bde4ff"}:{}},I({hotel:T,index:M})),{children:T[0]}),T[1]))})),G(Nr.Search,{className:"hd-icon hd-icon-search"}),G(Nr.Close,{className:"hd-icon hd-icon-close",onClick:()=>{console.log("clicked")}})]}))]})})})}function P3(e){const{handleHotelChange:t}=e,[r,n]=z.useState("Select property"),i=ct(v=>v.hotelInfo),a=ct(v=>v.userInfo),{isOpen:o,isMobileOrTablet:s}=ct(v=>v.headerInfo),{propertySelector:u}=ct(v=>v.titleBar),{items:f,defaultHotel:p,selectedHotel:d}=ct(v=>v.hotels),[y,{height:A}]=ps(),P=fa(!s||o,{from:{height:0},enter:{height:A},leave:{height:0},update:{height:A},config:Vr(tr({},Di.stiff),{clamp:!0})}),C=ii();return z.useEffect(()=>{(async()=>{if(u){let{type:v,hotels:I}=u;v==="fetch"&&(I=await(await fetch(I)).json());const T=I.find(M=>{const[L,K]=M[1].split("_").map(ie=>+ie);return i.hotelId===L&&i.guideId===K||a.hotelId===L&&a.guideId===K});Mr.unstable_batchedUpdates(()=>{C(EI(I)),C(CI(T)),C(ry(T))})}})()},[u]),P((v,I)=>I&&G(Li.div,{className:"col-12 col-lg me-lg-auto px-0 order-lg-3",id:"hd-property",style:s?v:{},children:G("ul",{ref:y,className:"row list-unstyled mx-0 mb-0 hd-nav-first-level",children:G("li",{className:"col-lg-auto align-items-center",onClick:()=>{C(ra(r))},children:We("div",{className:"row py-lg-0 align-items-center",children:[We("div",{className:"col col-lg-auto py-2 py-lg-0",id:"hd-group-property-name",children:[G("span",{className:"ps-lg-3 py-3 py-lg-0 d-block",id:"hd-group-name",children:"TESTING Hotels"}),We("div",{className:"row me-0 d-lg-none align-items-center",children:[We("div",{className:"col",children:[G("small",{className:"pt-2",children:r}),G("span",{className:"d-block",id:"hd-property-name",children:i.name||p&&p[0]})]}),G("div",{className:"col-auto p-2 d-block",children:G(Nr.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]})]}),f.length>0&&G(A3,{hotels:f,defaultHotel:p,selectedHotel:d,handleHotelChange:t,subMenuItem:r})]})})})}))}function I3(){const{i18n:e}=fo(),{help:t}=ct(i=>i.titleBar);if(!t)return null;const{label:r,href:n}=t;return G("li",{className:"col-lg-auto p-0",children:G("div",{className:"row m-0 py-lg-0 align-items-center",children:G("div",{className:"col py-2 py-lg-0 px-0",children:G("a",{className:"ps-lg-3 pe-3 py-2 d-block",title:"Help",href:n,target:"_blank",rel:"noreferrer",children:e.translate(r).fetch()})})})})}function x3(){const{i18n:e}=fo(),{subMenus:t}=ct(s=>s.headerInfo),{user:r}=ct(s=>s.titleBar),n=ii();if(!r)return null;const{label:i,children:a}=r,o=t.find(s=>s===i);return We("li",{className:"col-lg-auto p-0",onClick:()=>{n(ra(i))},children:[We("div",{className:"row m-0 py-lg-0 align-items-center",children:[We("div",{className:"col py-2 py-lg-0 px-0",children:[G("small",{className:"pt-2 d-lg-none",children:i}),We("span",{className:"ps-lg-3 pe-3 py-2 d-block",children:[G("span",{className:"d-none d-lg-inline",children:G(Nr.User,{className:"hd-icon hd-icon-user"})}),G("span",{className:"ps-lg-2",children:"david_all"}),G("span",{className:"d-none d-lg-inline ms-2",children:G(Nr.ArrowAngleDown,{className:"hd-icon hd-icon-arrow-angle-down"})})]})]}),G("div",{className:"col-auto p-2 d-block d-lg-none",children:G(Nr.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]}),G("ul",{className:Qn("py-3","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":o}),children:a.map(({href:s,label:u})=>G("li",{children:G("div",{className:"row m-0 py-lg-0 align-items-center",children:G("div",{className:"col py-2 py-lg-0 px-0",children:G("a",{className:"px-lg-4 py-2 d-block",href:s,target:"_blank",rel:"noreferrer",children:e.translate(u).fetch()})})})}))})]})}function E3(e){const{handleLanguageChange:t}=e,[r,n]=z.useState(),[i,a]=z.useState([]),o=ct(y=>y.userLanguage),{languageSelector:s}=ct(y=>y.titleBar),{subMenus:u}=ct(y=>y.headerInfo),f=ii();if(z.useEffect(()=>{if(s){const{children:y}=s;if(Array.isArray(y)){const A=y.map(({code:P,label:C})=>{const v=new Intl.DisplayNames([P],{type:"language"});return{code:P,name:C||v.of(P)}});A.length>0&&a(A)}}},[s]),z.useEffect(()=>{var y;if(o){const A=(y=i.find(({code:P})=>P===o))==null?void 0:y.name;A&&n(A)}},[o,i]),!s)return null;const{label:p}=s,d=u.find(y=>y===p);return We("li",{className:"col-lg-auto p-0",onClick:()=>{f(ra(p))},children:[We("div",{className:"row m-0 py-lg-0 align-items-center",children:[We("div",{className:"col py-2 py-lg-0 px-0",children:[G("small",{className:"pt-2 d-lg-none",children:p}),We("span",{className:"ps-lg-3 pe-3 pt-lg-2 pb-2 d-block",children:[r,G("span",{className:"d-none d-lg-inline ms-2",children:G(Nr.ArrowAngleDown,{className:"hd-icon hd-icon-arrow-angle-down"})})]})]}),G("div",{className:"col-auto p-2 d-block d-lg-none",children:G(Nr.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]}),G("ul",{className:Qn("py-3","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":d}),children:i.map(({code:y,name:A})=>G("li",{children:G("div",{className:"row m-0 py-lg-0 align-items-center",children:G("div",{className:"col py-2 py-lg-0 px-0",children:G("a",{className:"px-lg-4 py-2 d-block",href:"#",onClick:P=>{P.preventDefault(),P.stopPropagation(),f(ey(y)),typeof t=="function"&&t(y),f(ll(p))},children:A},y)})})}))})]})}function C3(){const[e,t]=z.useState(),{isOpen:r,subMenus:n,isMobileOrTablet:i}=ct(u=>u.headerInfo),{items:a}=ct(u=>u.menuItems),o=fa(n.length>0,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:Di.stiff}),s=ii();return z.useEffect(()=>{var f;const u=((f=a.find(p=>p.id===n[n.length-1]))==null?void 0:f.label)||n[n.length-1];u&&t(u)},[a,n]),!i||!r?null:o((u,f)=>f&&We(Li.div,{className:"col py-2 py-lg-0",id:"hd-submenu-title-container",style:u,children:[G("span",{id:"hd-submenu-back",onClick:()=>{s(ll(n[n.length-1]))},children:G(Nr.ArrowLeft,{className:"hd-icon hd-icon-arrow-left"})}),G("span",{className:"ms-3",id:"hd-submenu-title",children:e})]}))}function R3(e){const{handleHotelChange:t,handleLanguageChange:r}=e,{isOpen:n,isMobileOrTablet:i}=ct(u=>u.headerInfo),[a,{height:o}]=ps(),s=fa(!i||n,{from:{height:0},enter:{height:o},leave:{height:0},update:{height:o},config:Vr(tr({},Di.stiff),{clamp:!0})});return G("div",{className:"container-xxl",children:We("div",{className:"row align-items-center pb-lg-2",id:"hd-header-container",children:[G(C3,{}),G(Xx,{}),G(ZE,{}),G(tC,{}),G(TC,{}),G(P3,{handleHotelChange:t}),s((u,f)=>f&&G(Li.div,{className:"col-12 col-lg-auto ps-lg-0 align-middle order-lg-5",id:"hd-nav-container-top",style:i?u:{},children:G("nav",{ref:a,id:"hd-top-nav",children:We("ul",{className:"row list-unstyled mb-0 hd-nav-first-level",children:[G(I3,{}),G(E3,{handleLanguageChange:r}),G(x3,{})]})})}))]})})}let T3=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,r)=>(r&=63,r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r>62?t+="-":t+="_",t),"");function M3(e){var M;const{item:t,level:r,hasChildren:n,children:i}=e,{href:a,label:o,id:s,group:u,premium:f={}}=t,{value:p=!1,locked:d=!1}=f,{i18n:y}=fo(),{isOpen:A,subMenus:P}=ct(L=>L.headerInfo),{items:C}=ct(L=>L.menuItems),v=A&&P.find(L=>L===s),I=!!u&&((M=C.find(L=>L.group===u))==null?void 0:M.id)===s,T=ii();if(p&&d)return We("li",{className:"hd-nav-has-children",onClick:()=>{T(ra(s))},children:[G("div",{className:"row m-0 py-lg-0 align-items-center",children:G("div",{className:"col py-2 py-lg-0 px-0",children:We("span",{className:"px-lg-3 py-2 d-block",children:[y.translate("label").fetch(),G("span",{className:"float-end",children:G(Nr.Lock,{className:"hd-icon hd-icon-lock"})})]})})}),G("ul",{className:Qn("py-3","list-unstyled",{"hd-nav-second-level":r===1,"hd-nav-third-level":r===2,"hd-submenu-opened":v}),children:G("li",{className:"hd-premium",children:G("div",{className:"row m-0 py-lg-0 align-items-center",children:We("div",{className:"col p-lg-3",children:[G("span",{className:"d-lg-none mb-3",children:G(Nr.Lock,{className:"hd-icon hd-icon-lock"})}),We("p",{children:["This premium functionality has not been activated.",G("br",{}),"Please contact us to activate this feature."]}),G("a",{className:"btn btn-sm btn-outline-primary",href:"#",target:"_blank",children:"Learn more"})]})})})})]});if(r===1)return We("li",{className:"col-lg-auto p-0",onClick:()=>{n&&T(ra(s))},children:[We("div",{className:"row m-0 py-lg-0 align-items-center",children:[G("div",{className:"col py-2 py-lg-0 px-0",children:G("span",{className:"ps-lg-3 pe-3 py-2",children:y.translate(o).fetch()})}),n&&G("div",{className:"col-auto p-2 d-block d-lg-none",children:G(Nr.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})]}),n&&G("ul",{className:Qn("py-3","list-unstyled","hd-nav-second-level",{"hd-submenu-opened":v}),children:i})]});if(r===2)return We(es,{children:[I&&G("div",{className:"row m-0 pt-3 hd-nav-section",children:G("div",{className:"col py-2 py-lg-0 px-0",children:G("div",{className:"px-lg-3 d-block text-uppercase",children:y.translate(u).fetch()})})}),We("li",{onClick:()=>{n&&T(ra(s))},children:[We("div",{className:"row m-0 py-lg-0 align-items-center",children:[G("div",{className:"col py-2 py-lg-0 px-0",children:a?G("a",{className:"px-lg-3 py-2 d-block",href:a,onClick:()=>{T(cl(s))},children:y.translate(o).fetch()}):G("span",{className:"px-lg-3 py-2 d-block",children:y.translate(o).fetch()})}),n&&G("div",{className:"col-auto px-0",children:G("span",{className:"p-2 d-lg-block",children:G(Nr.ArrowAngleRight,{className:"hd-icon hd-icon-arrow-angle-right"})})})]}),n&&G("ul",{className:Qn("ps-3","ps-lg-0","list-unstyled","hd-nav-third-level",{"hd-submenu-opened":v}),children:i})]})]});if(r===3)return G("li",{children:G("div",{className:"row m-0 py-1 py-lg-0 align-items-center",children:G("div",{className:"col p-lg-0",children:G("a",{className:"px-lg-3 py-2 d-block",href:a,onClick:()=>{T(cl(s))},children:y.translate(o).fetch()})})})})}const Wv=T3();function Kv(e){const{menuItems:t,parentId:r=Wv,level:n=1}=e,i=t.filter(a=>(a.parentId||Wv)===r);return i.length?i.map(a=>{const o=!!t.find(p=>p.parentId===a.id),{premium:s={}}=a,{value:u=!1,locked:f=!1}=s;return G(M3,{item:a,level:n,hasChildren:o,premium:u,locked:f,children:G(Kv,{menuItems:t,parentId:a.id,level:n+1})},a.id)}):null}function F3(){const{items:e}=ct(f=>f.menuItems),{isOpen:t,isMobileOrTablet:r,subMenus:n}=ct(f=>f.headerInfo),i=ii(),[a,{height:o}]=ps(),s=z.useRef(null),u=fa(!r||t,{from:{height:0},enter:{height:o},leave:{height:0},update:{height:o},config:Vr(tr({},Di.stiff),{clamp:!0})});return z.useEffect(()=>{if(e.length>0){const f=new URL(window.location.href),{hash:p}=f,d=e.find(y=>y.href===p);d&&i(cl(d.id))}},[e]),z.useEffect(()=>{s&&n.length>0&&(s.current.scrollTop=0)},[n.length]),u((f,p)=>p&&G(Li.div,{className:"container-xxl",id:"hd-nav-container",style:r?f:{},children:G("nav",{className:"hd-nav",ref:a,children:G("ul",{ref:s,className:"row list-unstyled mb-0 hd-nav-first-level",children:G(Kv,{menuItems:e})})})}))}function $3(){const[e,t]=z.useState([]),{items:r,selectedItem:n}=ct(a=>a.menuItems),{i18n:i}=fo();return z.useEffect(()=>{if(n){const a=[];let o=r.find(s=>s.id===n);do a.push(o),o=r.find(s=>s.id===o.parentId);while(o);t(a.reverse())}},[n]),e.length===0?null:G("div",{className:"container-xxl mt-3 mt-lg-5",children:G("nav",{"aria-label":"breadcrumb",id:"hd-breadcrumb",children:We("ol",{className:"breadcrumb mb-0",children:[G("li",{className:"breadcrumb-item active",children:i.translate(e[0].label).fetch()}),e.length>=2&&G("li",{className:"breadcrumb-item active",children:i.translate(e[1].label).fetch()}),e.length===3&&G("li",{className:"breadcrumb-item active",children:i.translate(e[2].label).fetch()})]})})})}function N3(e){const{hotelInfo:t,userInfo:r,userLanguage:n}=e,{isOpen:i,subMenus:a,isMobileOrTablet:o}=ct(p=>p.headerInfo),s=z.useRef(null),{width:u}=$P(),f=ii();return z.useEffect(()=>{n&&f(ey(n))},[]),z.useEffect(()=>{u&&f(SI(u))},[u]),z.useEffect(()=>{fetch("/hotel_admin/json/title_bar.jsp").then(p=>p.json()).then(p=>{f(gI(p))})},[]),z.useEffect(()=>{fetch("/api/menu").then(p=>p.json()).then(p=>{f(hI(p))})},[]),z.useEffect(()=>{fetch("/api/notifications").then(p=>p.json()).then(p=>{f(mI(p))})},[]),z.useEffect(()=>{t&&f(Qg(t))},[]),z.useEffect(()=>{r&&f(_I(r))},[]),z.useEffect(()=>{s&&a.length>0&&(s.current.scrollTop=0)},[a.length]),We(es,{children:[We("div",{ref:s,id:"hd-container",className:Qn("container-fluid","px-0 fixed-top",{"hd-menu-opened":i,"hd-overflow-hidden":a.length>0}),style:tr({},o&&!i&&{overflow:"hidden"}),children:[G(R3,tr({},e)),G(F3,{})]}),G($3,{})]})}const qv=FI(N3);function D3(e,t){Mr.render(G(qv,tr({},t)),e)}DA(),rr.Header=qv,rr.renderHeader=D3,Object.defineProperties(rr,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|