module.exports = "(function(s,t,e){var i=e(5894),a=e(4810),n=e(7358),_=__MAX_QUEUED_MESSAGES__;s.exports={initialize:function(){this.__state={frames:[],defaultFrame:null,messages:[],subscribers:[],canonicalOrigins:null,disabled:!1},this.on(n.XDOMAIN_SET_DEFAULT_FRAME,this.__setDefaultFrame),this.on(n.XDOMAIN_ADD_FRAME,this.__addFrame),this.on(n.XDOMAIN_SET_MESSAGE,this.__setMessage),this.on(n.XDOMAIN_ADD_SUBSCRIBER,this.__addSubscriber),this.on(n.XDOMAIN_SET_CANONICAL_ORIGINS,this.__setCanonicalOrigins),this.on(n.XDOMAIN_SET_DISABLED,this.__disableXDomain)},getMessages:function(){return i.cloneDeep(this.__state.messages)},getOffset:function(){return 0===this.__state.messages.length?0:this.__state.messages[0].data.id},getNextMessageId:function(){return this.__state.messages.length+this.getOffset()},getMessageById:function(s){return this.__state.messages[s-this.getOffset()]},getSubscribers:function(){return this.__state.subscribers},getFrames:function(){return this.__state.frames},getNextFrameId:function(){return this.__state.frames.length},getDefaultFrame:function(){return this.__state.defaultFrame},getCanonicalOrigins:function(){return i.cloneDeep(this.__state.canonicalOrigins)},isDisabled:function(){return this.__state.disabled},__setDefaultFrame:function(s){this.__state.defaultFrame=s},__addFrame:function(s){this.__state.frames.push(s)},__setMessage:function(s){for(this.__state.messages[s.messageId-this.getOffset()]=s.message;this.__state.messages.length>_;){var t=this.__state.messages.shift();a.debug(\"XDomainStorage: Cleared old message: \"+t.data.id)}},__addSubscriber:function(s){this.__state.subscribers.push(s.subscriber)},__setCanonicalOrigins:function(s){this.__state.canonicalOrigins=s.canonicalOrigins},__disableXDomain:function(s){this.__state.disabled=s.disabled}}})";