// fileIn("html5/EventSource.st")
smalltalk.addClass("EventSource",smalltalk.HTML5,[],"EventSource");
smalltalk.EventSource.$comment=unescape("%0D%0A%09Server-Sent%20Events%20framework.%0D%0A%09Used%20for%20opening%20an%20HTTP%20connection%20for%20receiving%20push%20notifications%20from%20a%20server%20in%20the%20form%20of%20DOM%20events.%0D%0A%09http%3A//www.w3.org/TR/eventsource/%0D%0A%09@2012%20Alejandro%20Reimondo%20-%20aleReimondo@smalltalking.net%0D%0A");
smalltalk.bind(smalltalk.EventSource,"url",0
,function(){var self=this;
return ((function(){var $1$=(self.handle()["url"]);if(nil.isNil_($1$))return nil;return $1$;})());}
,"accessing",unescape("url%0D%0A%09%22%20Return%20the%20url%20of%20the%20receiver.%20%22%0D%0A%0D%0A%09%5Eself%20handle%20basicAt%3A%20%23url"));
smalltalk.bind(smalltalk.EventSource,"withCredentials",0
,function(){var self=this;
return ((function(){var $1$=(self.handle()["withCredentials"]);if(nil.isNil_($1$))return nil;return $1$;})());}
,"accessing",unescape("withCredentials%0D%0A%09%22%20Return%20the%20withCredentials%20of%20the%20receiver.%20%22%0D%0A%0D%0A%09%5Eself%20handle%20basicAt%3A%20%23withCredentials"));
smalltalk.bind(smalltalk.EventSource,"readyState",0
,function(){var self=this;
return ((function(){var $1$=(self.handle()["readyState"]);if(nil.isNil_($1$))return nil;return $1$;})());}
,"accessing",unescape("readyState%0D%0A%09%22%20Return%20the%20readyState%20of%20the%20receiver.%20%22%0D%0A%0D%0A%09%5Eself%20handle%20basicAt%3A%20%23readyState"));
smalltalk.bind(smalltalk.EventSource,"close",0
,function(){var self=this;
return self.handle().close();}
,"wrappers",unescape("close%0D%0A%09%22%20Delegate%20to%20handle.%20%22%0D%0A%0D%0A%09%5Eself%20handle%20%23close"));
smalltalk.bind(smalltalk.EventSource.$klass,"html5Events",0
,function(){var self=this;
return ["open:", "message:", "error:"]._comma(smalltalk.superImplementor(smalltalk.EventSource.$klass,"html5Events").apply(self, []));}
,"events",unescape("html5Events%0D%0A%09%22%20Private%20-%20Return%20the%20html5%20events%20managed%20by%20instances%20of%20the%20receiver.%20%22%0D%0A%0D%0A%09%5E%23%28%20%23open%3A%20%23message%3A%20%23error%3A%20%29%20%2C%20super%20html5Events"));
smalltalk.bind(smalltalk.EventSource,"onopen",0
,function(){var self=this;
return ((function(){var $1$=(self.handle()["onopen"]);if(nil.isNil_($1$))return nil;return $1$;})());}
,"accessing",unescape("onopen%0D%0A%09%22%20Return%20the%20onopen%20of%20the%20receiver.%20%22%0D%0A%0D%0A%09%5Eself%20handle%20basicAt%3A%20%23onopen"));
smalltalk.bind(smalltalk.EventSource,"onmessage",0
,function(){var self=this;
return ((function(){var $1$=(self.handle()["onmessage"]);if(nil.isNil_($1$))return nil;return $1$;})());}
,"accessing",unescape("onmessage%0D%0A%09%22%20Return%20the%20onmessage%20of%20the%20receiver.%20%22%0D%0A%0D%0A%09%5Eself%20handle%20basicAt%3A%20%23onmessage"));
smalltalk.bind(smalltalk.EventSource,"onerror",0
,function(){var self=this;
return ((function(){var $1$=(self.handle()["onerror"]);if(nil.isNil_($1$))return nil;return $1$;})());}
,"accessing",unescape("onerror%0D%0A%09%22%20Return%20the%20onerror%20of%20the%20receiver.%20%22%0D%0A%0D%0A%09%5Eself%20handle%20basicAt%3A%20%23onerror"));
smalltalk.bind(smalltalk.EventSource.$klass,"@","_at"
,function(urlOrHandle){var self=this;
if (self.isObject_(urlOrHandle).and_((function(){return urlOrHandle.isString();}))){return self.url_(urlOrHandle);};;
return smalltalk.superImplementor(smalltalk.EventSource.$klass,"_at").apply(self, [urlOrHandle]);}
,"instantiation",unescape("@%20urlOrHandle%0D%0A%09%22%20Return%20an%20instance%20of%20the%20receiver.%20%22%0D%0A%0D%0A%09%28%28self%20isObject%3A%20urlOrHandle%29%20and%3A%20%5B%20urlOrHandle%20isString%20%5D%29%20ifTrue%3A%20%5B%0D%0A%09%09%5Eself%20url%3A%20urlOrHandle%0D%0A%09%5D.%0D%0A%09%5Esuper%20@%20urlOrHandle"));
smalltalk.bind(smalltalk.EventSource.$klass,"url:",0
,function(url){var self=this;
return self.newInstance().initialize_(url);}
,"instantiation",unescape("url%3A%20url%0D%0A%09%22%20Return%20an%20instance%20of%20the%20receiver.%20%22%0D%0A%0D%0A%09%5Eself%20newInstance%20initialize%3A%20url"));
smalltalk.bind(smalltalk.EventSource.$klass,"url:with:",0
,function(url,options){var self=this;
return self.newInstance().initialize_with_(url,options);}
,"instantiation",unescape("url%3A%20url%20with%3A%20options%0D%0A%09%22%20Return%20an%20instance%20of%20the%20receiver.%20%22%0D%0A%0D%0A%09%5Eself%20newInstance%20initialize%3A%20url%20with%3A%20options"));
smalltalk.bind(smalltalk.EventSource.$klass,"url:withCredentials:",0
,function(url,aBoolean){var self=this;
return self.url_with_(url,"withCredentials"._minus_gt(aBoolean).json());}
,"instantiation",unescape("url%3A%20url%20withCredentials%3A%20aBoolean%0D%0A%09%22%20Return%20an%20instance%20of%20the%20receiver.%20%22%0D%0A%0D%0A%09%5Eself%20url%3A%20url%20with%3A%20%28%23withCredentials%20-%3E%20aBoolean%29%20json"));
smalltalk.bind(smalltalk.EventSource.$klass,"newInstance",0
,function(){var $s8Ret$={name:"stReturn"};try{var self=this;
smalltalk.Smalltalk.jsObjectAt_ifAbsent_("EventSource",(function(){return (function(){$s8Ret$.result=(function(){return smalltalk.Smalltalk.at_ifAbsent_("CustomEventSource",(function(){return self.error_("Missing support for EventSource");}))})();throw($s8Ret$)})();}));
(function(){$s8Ret$.result=(function(){return self.$$new()})();throw($s8Ret$)})();} catch($$ex) {if($$ex === $s8Ret$){return $$ex.result} throw($$ex);}}
,"private",unescape("newInstance%0D%0A%09%22%20Private%20-%20Return%20a%20concrete%20instance%20of%20the%20receiver.%20%22%0D%0A%0D%0A%09Smalltalk%20jsObjectAt%3A%20%23EventSource%20ifAbsent%3A%20%5B%0D%0A%09%09%5ESmalltalk%20at%3A%20%23CustomEventSource%20ifAbsent%3A%20%5B%0D%0A%09%09%09self%20error%3A%20%27Missing%20support%20for%20EventSource%27%0D%0A%09%09%5D%0D%0A%09%5D.%0D%0A%09%5Eself%20new"));
smalltalk.bind(smalltalk.EventSource,"initialize:with:",0
,function(url,options){var self=this;
self["@handle"]= new EventSource(url,options); ;
return self;}
,"initialize",unescape("initialize%3A%20url%20with%3A%20options%0D%0A%09%22%20Private%20-%20Initialize%20the%20receiver.%20%22%0D%0A%0D%0A%09handle%20%3A%3D%20%7B%27%20new%20EventSource%28url%2Coptions%29%3B%20%27%7D%20"));
smalltalk.bind(smalltalk.EventSource,"initialize:",0
,function(url){var self=this;
self["@handle"]= new EventSource(url); ;
return self;}
,"initialize",unescape("initialize%3A%20url%0D%0A%09%22%20Private%20-%20Initialize%20the%20receiver.%20%22%0D%0A%0D%0A%09handle%20%3A%3D%20%7B%27%20new%20EventSource%28url%29%3B%20%27%7D%20"));
smalltalk.addClass("CustomEventSource",smalltalk.EventManager,[],"EventSource");
smalltalk.bind(smalltalk.CustomEventSource.$klass,"constructEventsTriggered",0
,function(){var self=this;
return ["open:", "message:", "error:"]._comma(smalltalk.superImplementor(smalltalk.CustomEventSource.$klass,"constructEventsTriggered").apply(self, []));}
,"events",unescape("constructEventsTriggered%0D%0A%09%22%20Private%20-%20Return%20the%20events%20managed%20by%20instances%20of%20the%20receiver.%20%22%0D%0A%0D%0A%09%5E%23%28%09%23open%3A%20%23message%3A%20%23error%3A%0D%0A%09%29%20%2C%20super%20constructEventsTriggered"));
smalltalk.bind(smalltalk.CustomEventSource,"initialize:with:",0
,function(url,options){var self=this;
self.notImplementedYet();
return self;}
,"initialize",unescape("initialize%3A%20url%20with%3A%20options%0D%0A%09%22%20Private%20-%20Initialize%20the%20receiver.%20%22%0D%0A%0D%0A%09self%20notImplementedYet"));
smalltalk.bind(smalltalk.CustomEventSource,"initialize:",0
,function(url){var self=this;
self.notImplementedYet();
return self;}
,"initialize",unescape("initialize%3A%20url%0D%0A%09%22%20Private%20-%20Initialize%20the%20receiver.%20%22%0D%0A%0D%0A%09self%20notImplementedYet"));
// ------EventSource.st ToDo: Custom implementation (in case of not provided by host); fileIn cancelled----------------------------------