var e=/*@__PURE__*/require("svkc");let s=!1;const t=e=>class extends e{constructor(e){if(super(),!s&&(s=!0,this._initialize(),s=!1,null!=e))for(const[s,t]of e)this.set(s,t)}_tryToEnsureCanSet(e,s,t){let{force:i=!1}=void 0===t?{}:t;if(this._inverse.has(s)&&!Object.is(this._inverse.get(s),e)){if(!i)throw new Error("value already bound to another key");this.has(e)?(this.delete(e),this._inverse.delete(s)):this._inverse.set(s,e)}}inverse(){return this._inverse}};class i extends(/*@__PURE__*/t(/*@__PURE__*/(()=>(e.SameValueMap))())){_initialize(){this._inverse=new i,this._inverse._inverse=this,this._entries=new Set,this._inverse._entries=this._entries,this._keyIndex=0,this._valueIndex=1,this._inverse._keyIndex=1,this._inverse._valueIndex=0}clear(){this._entries.clear(),super.clear.call(this._inverse),super.clear()}delete(e){const s=super.get(e);return!!s&&(this._entries.delete(s),super.delete.call(this._inverse,s[this._valueIndex]),super.delete(e))}get(e){const s=super.get(e);return s&&s[this._valueIndex]}set(e,s,t){this._tryToEnsureCanSet(e,s,t);let i=super.get(e);if(i){if(Object.is(i[this._valueIndex],s))return this;super.delete.call(this._inverse,i[this._valueIndex])}else i=[],i[this._keyIndex]=e,this._entries.add(i),super.set(e,i);return i[this._valueIndex]=s,super.set.call(this._inverse,s,i),this}*[Symbol.iterator](){yield*this.entries()}*keys(){for(const e of this._entries)yield e[this._keyIndex]}*values(){for(const e of this._entries)yield e[this._valueIndex]}*entries(){for(const e of this._entries)yield[e[this._keyIndex],e[this._valueIndex]]}forEach(e,s){for(const[t,i]of this.entries())e.call(s,i,t,this)}}class r extends(/*@__PURE__*/t(WeakMap)){_initialize(){this._inverse=new r,this._inverse._inverse=this}delete(e){return!!this.has(e)&&(super.delete.call(this._inverse,this.get(e)),super.delete(e))}set(e,s,t){return this._tryToEnsureCanSet(e,s,t),super.set.call(this._inverse,s,e),super.set(e,s)}}exports.BiMap=i,exports.WeakBiMap=r;