From 1b5a47d9cd648d2ad9148a9d2ee42931551432e7 Mon Sep 17 00:00:00 2001 From: gclaramunt Date: Thu, 17 Jan 2013 20:45:31 -0200 Subject: [PATCH 1/7] prevent NPE on "/" paths correct use of paths in test --- .../src/main/java/com/precog/api/Client.java | 2 +- .../test/java/com/precog/api/ClientTest.java | 40 ++++++++++++------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/precog/java/src/main/java/com/precog/api/Client.java b/precog/java/src/main/java/com/precog/api/Client.java index f8d5e24..a8e5b46 100644 --- a/precog/java/src/main/java/com/precog/api/Client.java +++ b/precog/java/src/main/java/com/precog/api/Client.java @@ -201,7 +201,7 @@ public String delete(Path path) throws IOException { * @throws IOException */ public String query(Path path, String q) throws IOException { - if (!path.getPrefix().equals(Paths.FS)) { + if (!Paths.FS.equals(path.getPrefix())) { path = Paths.FS.append(path); } Request request = new Request(); diff --git a/precog/java/src/test/java/com/precog/api/ClientTest.java b/precog/java/src/test/java/com/precog/api/ClientTest.java index 781dcf4..d58d5a5 100644 --- a/precog/java/src/test/java/com/precog/api/ClientTest.java +++ b/precog/java/src/test/java/com/precog/api/ClientTest.java @@ -16,8 +16,6 @@ import org.junit.Test; import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; import java.util.Map; import static org.junit.Assert.*; @@ -27,8 +25,8 @@ */ public class ClientTest { - private static String testId = null; private static Path testPath = null; + private static Path accountTestPath = null; public static String testAccountId; public static String testApiKey; @@ -49,7 +47,7 @@ public TestData(int testInt, String testStr, RawJson testRaw) { @BeforeClass public static void beforeAll() throws Exception { - testId = "" + Double.valueOf(java.lang.Math.random() * 10000).intValue(); + String testId = "" + Double.valueOf(java.lang.Math.random() * 10000).intValue(); Client testClient = new Client(Service.BetaPrecogHttps, null); String result = testClient.createAccount("java-test@precog.com", "password"); @@ -60,8 +58,8 @@ public static void beforeAll() throws Exception { res = GsonFromJson.of(new TypeToken() { }).deserialize(result); testApiKey = res.getApiKey(); - - testPath = new Path(testAccountId).append(new Path("/test" + testId)); + testPath = new Path("/test" + testId); + accountTestPath = new Path(testAccountId).append(testPath); } @Test @@ -73,7 +71,7 @@ public void testStore() throws IOException { TestData testData = new TestData(42, "Hello\" World", testJson); Record testRecord = new Record(testData); - testClient.store(testPath, testRecord, toJson); + testClient.store(accountTestPath, testRecord, toJson); } @Test @@ -82,7 +80,7 @@ public void testStoreStrToJson() throws IOException { Client testClient = new Client(Service.BetaPrecogHttps, testApiKey); Record testRecord = new Record("{\"test\":[{\"v\": 1}, {\"v\": 2}]}"); - testClient.store(testPath, testRecord, toJson); + testClient.store(accountTestPath, testRecord, toJson); } @Test @@ -90,14 +88,14 @@ public void testStoreRawString() throws IOException { Client testClient = new Client(Service.BetaPrecogHttps, testApiKey); String rawJson = "{\"test\":[{\"v\": 1}, {\"v\": 2}]}"; - testClient.store(testPath, rawJson); + testClient.store(accountTestPath, rawJson); } @Test public void testStoreRawUTF8() throws IOException { Client testClient = new Client(Service.BetaPrecogHttps, testApiKey); String rawJson = "{\"test\":[{\"ดีลลิเชียส\": 1}, {\"v\": 2}]}"; - testClient.store(testPath, rawJson); + testClient.store(accountTestPath, rawJson); } public static Map jsonToStrMap(String json) { @@ -109,7 +107,7 @@ public static Map jsonToStrMap(String json) { public void testIngestCSV() throws IOException { Client testClient = new Client(Service.BetaPrecogHttps, testApiKey); IngestOptions options = new CSVIngestOptions(); - String response = testClient.ingest(testPath, "blah,\n\n", options); + String response = testClient.ingest(accountTestPath, "blah,\n\n", options); IngestResult result = GsonFromJson.of(new TypeToken() { }).deserialize(response); assertEquals(1, result.getIngested()); @@ -120,7 +118,7 @@ public void testIngestJSON() throws IOException { Client testClient = new Client(Service.BetaPrecogHttps, testApiKey); IngestOptions options = new IngestOptions(ContentType.JSON); String rawJson = "{\"test\":[{\"v\": 1}, {\"v\": 2}]}"; - String response = testClient.ingest(testPath, rawJson, options); + String response = testClient.ingest(accountTestPath, rawJson, options); IngestResult result = GsonFromJson.of(new TypeToken() { }).deserialize(response); assertEquals(1, result.getIngested()); @@ -133,7 +131,7 @@ public void testIngestCsvWithOptions() throws IOException { options.setDelimiter(","); options.setQuote("'"); options.setEscape("\\"); - String response = testClient.ingest(testPath, "blah\n\n", options); + String response = testClient.ingest(accountTestPath, "blah\n\n", options); IngestResult result = GsonFromJson.of(new TypeToken() { }).deserialize(response); assertEquals(1, result.getIngested()); @@ -144,7 +142,7 @@ public void testIngestAsync() throws IOException { Client testClient = new Client(Service.BetaPrecogHttps, testApiKey); IngestOptions options = new CSVIngestOptions(); options.setAsync(true); - String response = testClient.ingest(testPath, "blah,\n\n", options); + String response = testClient.ingest(accountTestPath, "blah,\n\n", options); //is async, so we don't expect results assertEquals("", response); } @@ -215,10 +213,22 @@ public void testDescribeAccount() throws IOException { public void testQuery() throws IOException { //just test the query was sent and executed successfully Client testClient = new Client(Service.BetaPrecogHttps, testApiKey); - String result = testClient.query(new Path(testAccountId), "count(//" + testAccountId + ")"); + String result = testClient.query(new Path(testAccountId), "count(//"+ testPath +")"); assertNotNull(result); String[] res = GsonFromJson.of(String[].class).deserialize(result); assertEquals("0", res[0]); } + @Test + public void testQueryA() throws IOException { + + //just test the query was sent and executed successfully + Client testClient = new Client(Service.BetaPrecogHttps, testApiKey); + String result = testClient.query(new Path(testAccountId), "load(\"//"+ testPath +"\")"); + assertNotNull(result); + System.out.println(result); + //String[] res = GsonFromJson.of(String[].class).deserialize(result); + //assertEquals("0", res[0]); + } + } From 775d2f729915cef5371bb3a59583925ed9db4597 Mon Sep 17 00:00:00 2001 From: gclaramunt Date: Fri, 18 Jan 2013 16:18:43 -0200 Subject: [PATCH 2/7] master rebase --- doc/src/charts-api.v1.rst | 10 +- ...isualization-api-v1-options-label-axis.txt | 4 +- .../visualization-api-v1-options-layout.txt | 2 - doc/static/css/innerpage.css | 5 + .../PrecogClient/Client/Dto/AccountInfo.cs | 20 + .../PrecogClient/Client/Dto/IngestResult.cs | 21 + .../Client/Options/CSVIngestOptions.cs | 39 + .../Client/Options/IngestOptions.cs | 28 + .../PrecogClient/Client/PrecogClient.cs | 327 ++- precog/dotnet/PrecogClient/Client/Request.cs | 27 + precog/dotnet/PrecogClient/Client/Rest.cs | 215 ++ .../dotnet/PrecogClient/PrecogClient.csproj | 13 +- precog/dotnet/PrecogClient/PrecogClient.sln | 4 +- .../PrecogServiceStack.csproj | 7 +- .../PrecogTests/Client/TestStore.cs | 169 +- .../PrecogTests/PrecogTests.csproj | 17 +- precog/java/pom.xml | 7 +- .../src/main/java/com/precog/api/Service.java | 9 +- .../test/java/com/precog/api/ClientTest.java | 61 +- precog/js/src/precog.js | 37 +- precog/js/test/index.html | 2 +- precog/js/test/tests.js | 35 +- precog/php/src/Precog.php | 31 +- precog/php/test/basetest.php | 11 +- precog/php/test/test-add-grant-to-account.php | 13 +- precog/php/test/test-add-grant-to-key.php | 14 +- precog/php/test/test-create-grant-child.php | 23 +- precog/php/test/test-create-grant.php | 9 +- precog/php/test/test-create-key.php | 11 +- precog/php/test/test-delete-grant.php | 11 +- precog/php/test/test-delete-key.php | 10 +- precog/php/test/test-describe-key.php | 11 +- precog/php/test/test-list-keys.php | 16 +- precog/php/test/test-query.php | 2 +- precog/php/test/test-retrieve-grants.php | 11 +- precog/python/precog/precog.py | 9 +- precog/python/precog/test/conftest.py | 4 +- precog/ruby/lib/precog.rb | 3 +- precog/ruby/test/test_precog.rb | 28 +- reportgrid/java/pom.xml | 12 +- reportgrid/js/src/v1/reportgrid-charts.js | 2513 +++++++++-------- reportgrid/js/src/v1/reportgrid-query.js | 580 ++-- sticker-precog-beta.png | Bin 13195 -> 0 bytes 43 files changed, 2624 insertions(+), 1757 deletions(-) create mode 100644 precog/dotnet/PrecogClient/Client/Dto/AccountInfo.cs create mode 100644 precog/dotnet/PrecogClient/Client/Dto/IngestResult.cs create mode 100644 precog/dotnet/PrecogClient/Client/Options/CSVIngestOptions.cs create mode 100644 precog/dotnet/PrecogClient/Client/Options/IngestOptions.cs create mode 100644 precog/dotnet/PrecogClient/Client/Request.cs create mode 100644 precog/dotnet/PrecogClient/Client/Rest.cs delete mode 100644 sticker-precog-beta.png diff --git a/doc/src/charts-api.v1.rst b/doc/src/charts-api.v1.rst index 35800ab..f51357f 100644 --- a/doc/src/charts-api.v1.rst +++ b/doc/src/charts-api.v1.rst @@ -374,7 +374,9 @@ The ``lineChart`` can be used to build standard line charts, area charts stacked * "gradient:{lightness}:{levels}" : The ``lightness`` parameter is used to state how brigther (or darker) the end of the gradient will be and the ``levels`` parameterd states the number of steps that form the gradient. ``symbol`` : string OR function(object datapoint, object stats) string - Each datapoint in the line charts can be associated to an optional symbol. The symbol can be described statically using a string or using a function. The symbol must be expressed in SVG PATH format. There is a practical function ``ReportGrid.symbol.get()`` to quickly build symbols. + Each datapoint in the line charts can be associated to an optional symbol. The symbol can be described statically using a string or using a function. The symbol must be expressed in one of the 2 following formats: + * SVG PATH format. There is a practical function ``ReportGrid.symbol.get()`` to quickly build symbols. + * "image:urltoimage". This second format allows to embed raster images instead of vecorial symbols. The URL part must be an absolute path to an image. It is also possible to specify the size of the image this way: "image,40x50:urltoimage". The images are by default aligned so that their center will match the underlying datapoint. Other alignments are possible using this syntax: "image,left top:imageurl". The horizontal position must be expressed first (center, left, right), the vertical alignment must be separated by a white space (center, top, bottom). Size and alignment can be specified together by separating them with a comma. ``symbolstyle`` : function(object datapoint, object stats) string If symbols are added to the lines you can use ``symbolstyle`` to render a custom style for each of them. The style produced by the custom function must be a string in CSS format. ``y0property`` : string @@ -575,8 +577,10 @@ The scatter graph requires two axes, one for the X axis and one for the Y axis. **options:** -``symbol`` : string OR function(object datapoint, object stats) : string - Each point in a scatter graph should be associated to a symbol. Each symbol can be rendered indivisually to have a distinct shape or not. The ``symbol`` can be a static string or a function that returns such string. The string represents a SVG path. You can easily create a SVG path using `ReportGrid.symbol`_. +``symbol`` : string OR function(object datapoint, object stats) string + Each datapoint in the line charts can be associated to an optional symbol. The symbol can be described statically using a string or using a function. The symbol must be expressed in one of the 2 following formats: + * SVG PATH format. There is a practical function ``ReportGrid.symbol.get()`` to quickly build symbols. + * "image:urltoimage". This second format allows to embed raster images instead of vecorial symbols. The URL part must be an absolute path to an image. It is also possible to specify the size of the image this way: "image,40x50:urltoimage". The images are by default aligned so that their center will match the underlying datapoint. Other alignments are possible using this syntax: "image,left top:imageurl". The horizontal position must be expressed first (center, left, right), the vertical alignment must be separated by a white space (center, top, bottom). Size and alignment can be specified together by separating them with a comma. ``symbolstyle`` : string OR function(object datapoint, object stats) : string As much as you can control the sy,bol shape, you can control its style returning a custom style string. The style must be expressed in the CSS format. ``segment`` : object segmentoptions diff --git a/doc/src/visualization-api-v1-options-label-axis.txt b/doc/src/visualization-api-v1-options-label-axis.txt index a909749..8069c56 100644 --- a/doc/src/visualization-api-v1-options-label-axis.txt +++ b/doc/src/visualization-api-v1-options-label-axis.txt @@ -1,4 +1,6 @@ ``axis`` : function(string type) string The label to apply as a legend for the axis. ``tickmark`` : function(any value, string type) string - The label to apply to the individual tick-marks of the scales. The ``value`` argument is the scaled value for that tick-mark and ``type`` is the name of the axis. \ No newline at end of file + The label to apply to the individual tick-marks of the scales. The ``value`` argument is the scaled value for that tick-mark and ``type`` is the name of the axis. +``yscaleposition`` : string + ("alternating", "left", "right") \ No newline at end of file diff --git a/doc/src/visualization-api-v1-options-layout.txt b/doc/src/visualization-api-v1-options-layout.txt index f459248..1001cf9 100644 --- a/doc/src/visualization-api-v1-options-layout.txt +++ b/doc/src/visualization-api-v1-options-layout.txt @@ -9,7 +9,5 @@ The padding object controls how the chart is spaced from its margins. ``titleontop`` : bool Set if the title (assuming that one exists) is set on top of the visualization. -``yscaleposition`` : string - ("alternating", "left", "right") ``width`` : float Width of the visualization. If not specified it is assumed from the HTML container. \ No newline at end of file diff --git a/doc/static/css/innerpage.css b/doc/static/css/innerpage.css index 07075b3..c21edaa 100755 --- a/doc/static/css/innerpage.css +++ b/doc/static/css/innerpage.css @@ -158,6 +158,11 @@ h1 { text-align: left; } +.section>h2>a { + padding-top: 80px; + display: block; +} + .terms-pricing-text { width: 420px; padding-left: 20px; diff --git a/precog/dotnet/PrecogClient/Client/Dto/AccountInfo.cs b/precog/dotnet/PrecogClient/Client/Dto/AccountInfo.cs new file mode 100644 index 0000000..a268379 --- /dev/null +++ b/precog/dotnet/PrecogClient/Client/Dto/AccountInfo.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; + +namespace Precog.Client.Dto +{ + public class AccountInfo + { + public string accountId { get; set;} + public string email { get; set;} + public DateTime AccountCreationDate { get; set;} + public string ApiKey { get; set;} + public string rootPath { get; set;} + public Dictionary plan { get; set;} + + public AccountInfo () + { + } + } +} + diff --git a/precog/dotnet/PrecogClient/Client/Dto/IngestResult.cs b/precog/dotnet/PrecogClient/Client/Dto/IngestResult.cs new file mode 100644 index 0000000..da97ea3 --- /dev/null +++ b/precog/dotnet/PrecogClient/Client/Dto/IngestResult.cs @@ -0,0 +1,21 @@ +using System; + +namespace Precog.Client.Dto +{ + public class IngestResult + { + public bool Completed { get; private set; } + public decimal Total { get; set;} + public decimal Ingested { get; set;} + public decimal Failed { get; set;} + public decimal Skipped { get; set;} + public string[] Errors { get; set;} + + public IngestResult(bool completed= true) + { + this.Completed = completed; + } + + } +} + diff --git a/precog/dotnet/PrecogClient/Client/Options/CSVIngestOptions.cs b/precog/dotnet/PrecogClient/Client/Options/CSVIngestOptions.cs new file mode 100644 index 0000000..8c2543a --- /dev/null +++ b/precog/dotnet/PrecogClient/Client/Options/CSVIngestOptions.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; + +namespace Precog.Client.Options +{ + public class CSVIngestOptions : IngestOptions + { + + public static string QUOTE = "quote"; + public static string ESCAPE = "escape"; + public static string DELIMITER = "delimiter"; + + public string delimiter {get; set;} + public string quote {get; set;} + public string escape {get; set;} + + public CSVIngestOptions(): base(ContentType.CSV) + { + + } + + public override Dictionary asMap() + { + Dictionary map = base.asMap(); + if (quote != null) { + map.Add(QUOTE, quote); + } + if (delimiter != null) { + map.Add(DELIMITER, delimiter); + } + if (escape != null) { + map.Add(ESCAPE, escape); + } + return map; + } + + } +} + diff --git a/precog/dotnet/PrecogClient/Client/Options/IngestOptions.cs b/precog/dotnet/PrecogClient/Client/Options/IngestOptions.cs new file mode 100644 index 0000000..bfae81a --- /dev/null +++ b/precog/dotnet/PrecogClient/Client/Options/IngestOptions.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; + +namespace Precog.Client.Options +{ + public class IngestOptions + { + + public static string OWNER_ACCOUNT_ID = "ownerAccountId"; + + public ContentType DataType { get; set;} + public string OwnerAccountId { get; set;} + public bool Async { get; set;} + + public IngestOptions(ContentType dataType) { + this.DataType = dataType; + } + + public virtual Dictionary asMap() { + Dictionary map = new Dictionary(); + if (OwnerAccountId != null) { + map.Add(OWNER_ACCOUNT_ID, OwnerAccountId); + } + return map; + } + } +} + diff --git a/precog/dotnet/PrecogClient/Client/PrecogClient.cs b/precog/dotnet/PrecogClient/Client/PrecogClient.cs index 911c5e0..b626d53 100644 --- a/precog/dotnet/PrecogClient/Client/PrecogClient.cs +++ b/precog/dotnet/PrecogClient/Client/PrecogClient.cs @@ -3,6 +3,8 @@ using System.Net; using System.Text; using System.Web; +using Precog.Client.Options; +using Precog.Client.Dto; namespace Precog.Client { @@ -10,147 +12,264 @@ public class PrecogClient { const string QUERY_PARAMETER_TOKEN_ID = "tokenId"; const string QUERY_PARAMETER_QUERY = "q"; - static Uri HTTP = new Uri("http://api.precog.io/v1/"); - static Uri HTTPS = new Uri("https://api.precog.io:443/v1/"); + static Uri HTTP = new Uri("http://api.precog.io"); + static Uri HTTPS = new Uri("https://api.precog.io:443"); + + static int API_VERSION=1; + + private static class Paths { + public static string FS = "/fs"; + } + + private static class Services { + public static string ANALYTICS = "/analytics"; + public static string ACCOUNTS = "/accounts"; + public static string INGEST = "/ingest"; + } + public IJson Json { get; private set; } - public string TokenId { get; private set; } - public Uri Service { get; private set; } - string content; + private Rest rest; - public static PrecogClient Create(Uri service, string tokenId, IJson json) + public static PrecogClient Create(Uri service, string apiKey, IJson json) { - return new PrecogClient(service, tokenId, json); + return new PrecogClient(service, apiKey, json); } - public static PrecogClient Create(string tokenId, IJson json) + public static PrecogClient Create(string apiKey, IJson json) { - return Create(HTTP, tokenId, json); + return Create(HTTP, apiKey, json); } - public static PrecogClient CreateSecure(string tokenId, IJson json) + public static PrecogClient CreateSecure(string apiKey, IJson json) { - return Create(HTTPS, tokenId, json); + return Create(HTTPS, apiKey, json); } - private PrecogClient (Uri service, string tokenId, IJson json) + private PrecogClient (Uri service, string apiKey, IJson json) { if(null == json) throw new ArgumentNullException("json"); - if(null == tokenId) - throw new ArgumentNullException("tokenId"); if(null == service) throw new ArgumentNullException("service"); Json = json; - TokenId = tokenId; - Service = service; - } - - public bool Store(string path, T value) - { - var uri = new Uri(Service, "./vfs/" + path.TrimStart('/')); - var serialized = Json.Encode(value); - return executeStore(uri, serialized); + this.rest = new Rest(service,apiKey); } - public string LastError { get; private set; } + /// + /// Builds a path given a service and path, using the current api version + /// + /// + /// Path of the form /$service/v$version/$path + /// + /// + /// service the name of the API service to access (eg. account, ingest,etc) + /// + /// + /// the path corresponding to the action to be performed + /// + static public string ActionPath(string service, string path) + { + return service+"/v" + API_VERSION+"/"+path; + } - public T Query(string query) + /// + /// Creates a new account, accessible by the specified email address and password, or returns the existing account ID. + /// + /// + /// Account info with the account Id populated + /// + /// + /// user's email + /// + /// + /// user's password + /// + public AccountInfo CreateAccount(String email, String password) { - var uri = new Uri(Service, "./vfs/"); - if(executeQuery(uri, query)) - { - return Json.Decode(content); - } else { - throw new ApplicationException(content); - } - } + Request r= new Request(); + r.Body="{ \"email\": \"" + email + "\", \"password\": \"" + password + "\" }"; + string response= rest.Request(Method.POST, ActionPath(Services.ACCOUNTS, "accounts/"),r); + return Json.Decode(response); + } + - bool executeQuery(Uri path, string query) + /// + /// Retrieves the details about a particular account. This call is the primary mechanism by which you can retrieve your master API key. + /// + /// + /// account info + /// + /// + /// user's email + /// + /// + /// user's password + /// + /// + /// account's id number + /// + public AccountInfo DescribeAccount(string email, string password, string accountId) { - path = AddQueryParameter(path, QUERY_PARAMETER_TOKEN_ID, TokenId); - path = AddQueryParameter(path, QUERY_PARAMETER_QUERY, query); + string response= rest.Request(Method.GET, ActionPath(Services.ACCOUNTS, "accounts/" + accountId), credentials: rest.credentials(email,password)); + return Json.Decode(response); + } - HttpWebRequest request = (HttpWebRequest) WebRequest.Create(path); - request.Method = "GET"; - request.ContentType = "application/json"; - try - { - using(HttpWebResponse response = (HttpWebResponse) request.GetResponse()) - { - using(Stream responseStream = response.GetResponseStream()) - { - var bytes = new byte[responseStream.Length]; - responseStream.Read(bytes, 0, bytes.Length); - content = Encoding.UTF8.GetString(bytes); - } - switch(response.StatusCode) - { - case HttpStatusCode.OK: - return true; - default: - return false; - } - } - } - catch(WebException ex) - { - LastError = ex.Message; - return false; - } - } + /// + /// Store the specified record in the path + /// + /// + /// Storage path. + /// + /// + /// Record. + /// + /// + /// Type of the record + /// + public IngestResult Store(string path, T record) + { + return Store(path, Json.Encode(record)); + } - bool executeStore(Uri path, string value) + /// + /// Store a raw JSON string at the specified path. + /// + /// + /// storage path. + /// + /// + /// Record as json string. + /// + public IngestResult Store(string path, string recordJson) { - var data = Encoding.UTF8.GetBytes(value); + IngestOptions options = new IngestOptions(ContentType.JSON); + return Ingest(path, recordJson, options); + } - path = AddQueryParameter(path, QUERY_PARAMETER_TOKEN_ID, TokenId); + /// + /// Builds the async/sync data storage path + /// + /// + /// full storage path. + /// + /// + /// true to do an async storage call + /// + /// + /// The path at which the record should be placed in the virtual file system. + /// + public string BuildStoragePath(bool async, string path) + { + return (async ? "async" : "sync")+Paths.FS+"/"+path; + } - HttpWebRequest request = (HttpWebRequest) WebRequest.Create(path); - request.Method = "POST"; - request.ContentType = "application/json"; - request.ContentLength = data.Length; + /// + /// Builds a sync data storage path + /// + /// + /// The path at which the record should be placed in the virtual file system. + /// + /// + /// full storage path + /// + public string BuildSyncStoragePath(string path) + { + return BuildStoragePath(false, path); + } - using(Stream requestStream = request.GetRequestStream()) + /// + /// Ingest data in the specified path + /// Ingest behavior is controlled by the ingest options + ///

+ /// If Async is true, Asynchronously uploads data to the specified path and file name. The method will return almost immediately with an HTTP ACCEPTED response. + /// If Async is false, Synchronously uploads data to the specified path and file name. The method will not return until the data has been committed to the transaction log. Queries may or may not reflect data committed to the transaction log. + /// The optional owner account ID parameter can be used to disambiguate the account that owns the data, if the API key has multiple write grants to the path with different owners. + ///

+ /// + /// The path at which the record should be placed in the virtual file system. + /// + /// + /// content to be ingested + /// + /// + /// Ingestion options. + /// + /// + /// Is thrown when an argument passed to a method is invalid because it is . + /// + public IngestResult Ingest(string path, string content, IngestOptions options) + { + if (content == null || content=="") { + throw new ArgumentNullException("argument 'content' must contain a non empty value formatted as described by type"); + } + Request request = new Request(); + request.Header= options.asMap(); + request.Body=content; + request.ContentType=options.DataType; + string result= rest.Request(Method.POST, ActionPath(Services.INGEST, BuildStoragePath(options.Async, path)), request); + IngestResult ingestResult; + if (options.Async) { - requestStream.Write(data, 0, data.Length); + ingestResult= new IngestResult(false); + } else { + ingestResult= Json.Decode(result); } + return ingestResult; + } - try - { - using(HttpWebResponse response = (HttpWebResponse) request.GetResponse()) - { - switch(response.StatusCode) - { - case HttpStatusCode.OK: - return true; - default: - LastError = response.StatusDescription; - return false; - } - } - } - catch(WebException ex) - { - LastError = ex.Message; - return false; - } - } + /// + /// Deletes the specified path. + /// + /// + /// Path. + /// + public string Delete(string path) + { + return rest.Request(Method.DELETE, ActionPath(Services.INGEST, BuildSyncStoragePath(path))); + } - static Uri AddQueryParameter(Uri uri, string name, string value) + /// + /// Executes a synchronous query relative to the specified base path. The HTTP connection will remain open for as long as the query is evaluating (potentially minutes). + /// Not recommended for long-running queries, because if the connection is interrupted, there will be no way to retrieve the results of the query. + /// + /// + /// relative storage path to query + /// + /// + /// quirrel query to excecute + /// + /// + /// Type of the result object + /// + public T Query(string path, String q) { - var query = uri.Query; - if(String.IsNullOrEmpty(query)) - query = name + "=" + HttpUtility.UrlEncode(value); - else - query += "&" + name + "=" + HttpUtility.UrlEncode(value); - var builder = new UriBuilder(uri); - builder.Query = query.TrimStart('?'); - return builder.Uri; + path=addFS (path); + Request request = new Request(); + request.Parameters.Add("q", q); + string response= rest.Request(Method.GET, ActionPath(Services.ANALYTICS, path), request); + return Json.Decode(response); + } + + /// + /// Adds the FS prefix to the path if not present. + /// + /// + /// The FS+ path + /// + /// + /// storage path. + /// + private string addFS(string path) + { + if (!path.StartsWith(Paths.FS)) + { + path = Paths.FS+"/"+path; + } + return path; } } -} - +} \ No newline at end of file diff --git a/precog/dotnet/PrecogClient/Client/Request.cs b/precog/dotnet/PrecogClient/Client/Request.cs new file mode 100644 index 0000000..d8d235e --- /dev/null +++ b/precog/dotnet/PrecogClient/Client/Request.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; + +namespace Precog.Client +{ + public enum ContentType + { + XZIP, ZIP, JSON, CSV + } + + public class Request + { + public Dictionary Parameters { get; private set;} + public Dictionary Header { get; set; } + public string Body { get; set; } + public ContentType ContentType { get; set; } + + public Request() { + this.Body = ""; + this.ContentType = ContentType.JSON; + this.Parameters = new Dictionary(); + this.Header = new Dictionary(); + } + + } +} + diff --git a/precog/dotnet/PrecogClient/Client/Rest.cs b/precog/dotnet/PrecogClient/Client/Rest.cs new file mode 100644 index 0000000..9176792 --- /dev/null +++ b/precog/dotnet/PrecogClient/Client/Rest.cs @@ -0,0 +1,215 @@ +using System; +using System.Collections.Generic; +using System.Web; +using System.Net; +using System.IO; + +namespace Precog.Client +{ + public enum Method + { + GET, POST, DELETE, PUT + }; + + public class Rest + { + Uri uri; + string apiKey; + + /// + /// Initializes a new instance of the class. + /// + /// + /// URI. + /// + /// + /// API key. + /// + /// + internal Rest(Uri uri, string apiKey) { + this.uri = uri; + this.apiKey = apiKey; + } + + /// + /// Creates a parameter string for use in url, in the form $key=$value UTF-8 encoded + /// + /// + /// Single parameter string + /// + /// + /// Key. + /// + /// + /// Value. + /// + private string UrlParameter(string key, string value) + { + return key + "=" + HttpUtility.UrlEncode(value); + } + + /// + /// Encodes a string in base64. + /// + /// + /// The input string encoded in base64. + /// + /// + /// String to encode + /// + /// + public static string EncodeTo64(string toEncode) + { + byte[] toEncodeAsBytes = System.Text.Encoding.Unicode.GetBytes(toEncode); + string returnValue = System.Convert.ToBase64String(toEncodeAsBytes); + return returnValue; + } + + /* + /// + /// Adds base authentication to a header map + /// + /// + /// Headers map + /// + /// + /// User Id + /// + /// + /// Password + /// + public static void addBaseAuth(Dictionary headers, string user, string password) + { + headers.Add("Authorization", "Basic " + EncodeTo64(user + ":" + password)); + } + */ + + /// + /// Gets the full name of a content type. + /// + /// + /// The content type. + /// + /// + /// C. + /// + /// + private string GetContentType( ContentType c) + { + switch (c){ + case ContentType.XZIP: + return ("application/x-gzip"); + case ContentType.ZIP: + return ("application/zip"); + case ContentType.JSON: + return("application/json"); + case ContentType.CSV: + return ("text/csv"); + default: + throw new ArgumentException("Unrecognized content type"); + } + } + + public CredentialCache credentials(string user, string password) + { + CredentialCache wrCache = new CredentialCache(); + wrCache.Add(uri,"Basic", new NetworkCredential(user,password)); + return wrCache; + } + + /// + /// Sends a http request and parses the result + /// + /// + /// Server response as string + /// + /// + /// Request HTTP method ( GET, POST, DELETE,...) + /// + /// + /// Full path for the request (i.e. /$service/v$version/$action ) + /// + /// + /// Request configuration + /// + public string Request(Method method, string reqPath, Request request=null, CredentialCache credentials = null) + { + string path = reqPath.Replace ("//","/"); + + if (request == null) + { + request = new Request(); + } + + //add parameters + if (apiKey != null) + { + request.Parameters.Add("apiKey", apiKey); + } + char prefix = '?'; + foreach (var param in request.Parameters) + { + path = path + prefix + UrlParameter(param.Key, param.Value); + prefix = '&'; + } + + Uri fullUri= new Uri(uri,path); + HttpWebRequest webRequest = (HttpWebRequest)HttpWebRequest.Create(fullUri); + + webRequest.Method=Enum.GetName(typeof(Method),method); + + //add headers + foreach (var e in request.Header) + { + webRequest.Headers.Add(e.Key, e.Value); + } + webRequest.ContentType=GetContentType(request.ContentType); + if (credentials != null) + { + webRequest.Credentials = credentials; + } + + //write body (if present + if (request.Body.Length > 0) + { + byte[] bodyBytes = System.Text.Encoding.UTF8.GetBytes(request.Body); + webRequest.ContentLength= bodyBytes.Length; + + using(Stream sout = webRequest.GetRequestStream()) + { + sout.Write(bodyBytes, 0, bodyBytes.Length); + } + } + + ///get the result + string result; + try + { + using(HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse()) + { + if (webResponse.StatusCode != HttpStatusCode.OK && webResponse.StatusCode != HttpStatusCode.Accepted) { + string errorMsg = "Unexpected response from server: " + webResponse.StatusCode + ": " + webResponse.StatusDescription; + throw new WebException(errorMsg); + } + + using(Stream responseStream = webResponse.GetResponseStream()) + { + var streamReader = new StreamReader(responseStream); + result = streamReader.ReadToEnd(); + } + } + } + catch(WebException ex) + { + string errorMsg = "Exception caught executing web request; message: "+ex.Message+ ", service url " + fullUri + + " ; " + (request.Body.Length > 0 ? "record body '" + request.Body + "'" : " no body"); + throw new IOException(errorMsg); + } + + return result; + } + + } + +} + diff --git a/precog/dotnet/PrecogClient/PrecogClient.csproj b/precog/dotnet/PrecogClient/PrecogClient.csproj index 239faed..8294fc5 100644 --- a/precog/dotnet/PrecogClient/PrecogClient.csproj +++ b/precog/dotnet/PrecogClient/PrecogClient.csproj @@ -1,5 +1,5 @@ - + Debug x86 @@ -9,7 +9,6 @@ Library Precog PrecogClient - v3.5 true @@ -35,6 +34,12 @@ + + + + + + @@ -50,4 +55,8 @@ + + + + \ No newline at end of file diff --git a/precog/dotnet/PrecogClient/PrecogClient.sln b/precog/dotnet/PrecogClient/PrecogClient.sln index 74c9a5b..b471fdb 100644 --- a/precog/dotnet/PrecogClient/PrecogClient.sln +++ b/precog/dotnet/PrecogClient/PrecogClient.sln @@ -1,6 +1,6 @@  -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrecogClient", "PrecogClient.csproj", "{88B629F8-E460-40B5-8725-271B3868F2F8}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrecogTests", "PrecogTests\PrecogTests.csproj", "{9413D004-3E59-4213-A2BD-799F65EB1E7E}" diff --git a/precog/dotnet/PrecogClient/PrecogServiceStack/PrecogServiceStack.csproj b/precog/dotnet/PrecogClient/PrecogServiceStack/PrecogServiceStack.csproj index f7ba466..f34c930 100644 --- a/precog/dotnet/PrecogClient/PrecogServiceStack/PrecogServiceStack.csproj +++ b/precog/dotnet/PrecogClient/PrecogServiceStack/PrecogServiceStack.csproj @@ -1,5 +1,5 @@ - + Debug x86 @@ -9,7 +9,6 @@ Library PrecogServiceStack PrecogServiceStack - v3.5 true @@ -56,9 +55,9 @@ + ..\ServiceStack.Text\net35\ServiceStack.Text.dll - - \ No newline at end of file + diff --git a/precog/dotnet/PrecogClient/PrecogTests/Client/TestStore.cs b/precog/dotnet/PrecogClient/PrecogTests/Client/TestStore.cs index 0807809..e3001c7 100644 --- a/precog/dotnet/PrecogClient/PrecogTests/Client/TestStore.cs +++ b/precog/dotnet/PrecogClient/PrecogTests/Client/TestStore.cs @@ -3,44 +3,70 @@ using System.Text; using NUnit.Framework; using Precog.Client; +using Precog.Client.Dto; +using Precog.Client.Options; +using Precog.Client.Json; namespace Precog.Client { + class TestData + { + public int testInt {get; set; } + public string testStr; + public string rawJson; + + public TestData(int testInt, string testStr, string rawJson) { + this.testInt = testInt; + this.testStr = testStr; + this.rawJson = rawJson; + } + } + [TestFixture()] public class TestStore { - const string TEST_TOKEN_ID = "2D36035A-62F6-465E-A64A-0E37BCC5257E"; - const string PATH = "/unit_test/beta/"; - static Uri SERVICE = new Uri("http://beta2012v1.precog.io/v1/"); + static Uri SERVICE = new Uri("http://beta.precog.com"); + + private string testId; + private string testPath; + private string storePath; + + public string testAccountId; + public string testApiKey; + + public IJson Json= new JsonServiceStack(); - PrecogClient client; [SetUp()] public void Setup() { - client = ServiceStack.CreatePrecogClient(SERVICE, TEST_TOKEN_ID); - } - - [Test()] - public void TestSimpleStore () - { - var path = Path(); - Assert.IsTrue(client.Store(path, "test")); + PrecogClient noKeyClient = ServiceStack.CreatePrecogClient(SERVICE, null); + + testId = ""+ new Random().Next (0,10000); + + AccountInfo res = noKeyClient.CreateAccount("java-test@precog.com", "password"); + testAccountId = res.accountId; + res = noKeyClient.DescribeAccount("java-test@precog.com", "password", testAccountId); + testApiKey = res.ApiKey; + + testPath = "/test" + testId; + storePath = testAccountId+testPath; } - + [Test()] public void TestStoreAndQuery () { - var path = Path(); - var query = String.Format("count(load(\"{0}\"))", path); - int count = (int) client.Query>(query)[0]; + PrecogClient client = ServiceStack.CreatePrecogClient(SERVICE, testApiKey); + var query = String.Format("count(load(\"{0}\"))", testPath); - client.Store(path, "test"); + int count = (int) client.Query>(testAccountId,query)[0]; + + client.Store(storePath, "{\"test\":[{\"v\": 1}, {\"v\": 2}]}" ); var retry = 0; var success = false; while(retry++ < RETRIES) { - var newcount = (int) client.Query>(query)[0]; + var newcount = (int) client.Query>(testAccountId,query)[0]; if(newcount > count) { success = true; @@ -51,14 +77,113 @@ public void TestStoreAndQuery () Assert.IsTrue(success); } + [Test()] + public void testCreateAccount() + { + PrecogClient noKeyClient = ServiceStack.CreatePrecogClient(SERVICE, null); + AccountInfo res = noKeyClient.CreateAccount("java-test@precog.com", "password"); + string accountId = res.accountId; + Assert.IsNotNullOrEmpty(accountId); + Assert.AreEqual(testAccountId, accountId); + } + + [Test()] + public void testDescribeAccount() + { + PrecogClient noKeyClient = ServiceStack.CreatePrecogClient(SERVICE, null); + AccountInfo res = noKeyClient.DescribeAccount("java-test@precog.com", "password", testAccountId); + Assert.AreEqual(testAccountId, res.accountId); + } + + [Test()] + public void testQuery() + { + //just test the query was sent and executed successfully + PrecogClient testClient = ServiceStack.CreatePrecogClient(SERVICE, testApiKey); + string[] result = testClient.Query(testAccountId+"/", "count(//" + testAccountId + ")"); + Assert.IsNotNull(result); + Assert.AreEqual("0", result[0]); + } + const int DELAY = 500; const int RETRIES = 40; - - const string BASE_PATH = "/unit_test/beta/dotnet/"; - static string Path() + + [Test()] + public void testStore() + { + PrecogClient testClient = ServiceStack.CreatePrecogClient(SERVICE, testApiKey); + + TestData testData = new TestData(42, "Hello\" World", "{\"test\":[{\"v\": 1}, {\"v\": 2}]}"); + IngestResult response =testClient.Store(storePath, testData); + Assert.AreEqual(1, response.Ingested); + } + + [Test()] + public void testStoreRawString() + { + PrecogClient testClient = ServiceStack.CreatePrecogClient(SERVICE, testApiKey); + IngestResult response =testClient.Store(storePath, "{\"test\":[{\"v\": 1}, {\"v\": 2}]}"); + Assert.AreEqual(1, response.Ingested); + } + + [Test()] + public void testStoreRawUTF8() { + PrecogClient testClient = ServiceStack.CreatePrecogClient(SERVICE, testApiKey); + string rawJson = "{\"test\":[{\"ดีลลิเชียส\": 1}, {\"v\": 2}]}"; + IngestResult response =testClient.Store(storePath, rawJson); + Assert.AreEqual(1, response.Ingested); + } + + + [Test()] + public void testIngestCSV() { + PrecogClient testClient = ServiceStack.CreatePrecogClient(SERVICE, testApiKey); + IngestOptions options = new CSVIngestOptions(); + IngestResult response = testClient.Ingest(storePath, "blah,\n\n", options); + Assert.AreEqual(1, response.Ingested); + } + + [Test()] + public void testIngestJSON() { + PrecogClient testClient = ServiceStack.CreatePrecogClient(SERVICE, testApiKey); + IngestOptions options = new IngestOptions(ContentType.JSON); + string rawJson = "{\"test\":[{\"v\": 1}, {\"v\": 2}]}"; + IngestResult response = testClient.Ingest(storePath, rawJson, options); + Assert.AreEqual(1, response.Ingested); + } + + [Test()] + public void testIngestCsvWithOptions() { + PrecogClient testClient = ServiceStack.CreatePrecogClient(SERVICE, testApiKey); + CSVIngestOptions options = new CSVIngestOptions(); + options.delimiter=","; + options.quote="'"; + options.escape="\\"; + IngestResult response = testClient.Ingest(storePath, "blah,\n\n", options); + Assert.AreEqual(1, response.Ingested); + } + + [Test()] + public void testIngestAsync() { - return BASE_PATH + Guid.NewGuid(); + PrecogClient testClient = ServiceStack.CreatePrecogClient(SERVICE, testApiKey); + IngestOptions options = new CSVIngestOptions(); + options.Async=true; + IngestResult result = testClient.Ingest(storePath, "blah,\n\n", options); + //is async, so we don't expect results + Assert.IsFalse(result.Completed); + } + + [Test()] + public void testFromJson() + { string json = "{\"total\":1.0,\"Ingested\":1.0,\"Failed\":0.0,\"Skipped\":0.0,\"Errors\":[]}"; + IngestResult result=Json.Decode(json); + Assert.AreEqual(1,result.Total); + Assert.AreEqual(1,result.Ingested); + Assert.AreEqual(0,result.Failed); } + } + } diff --git a/precog/dotnet/PrecogClient/PrecogTests/PrecogTests.csproj b/precog/dotnet/PrecogClient/PrecogTests/PrecogTests.csproj index 5ba3e9c..f620599 100644 --- a/precog/dotnet/PrecogClient/PrecogTests/PrecogTests.csproj +++ b/precog/dotnet/PrecogClient/PrecogTests/PrecogTests.csproj @@ -1,5 +1,5 @@ - + Debug AnyCPU @@ -9,7 +9,6 @@ Library Precog PrecogTests - v3.5 true @@ -31,8 +30,18 @@ - - + + False + nunit + + + False + nunit + + + False + nunit + diff --git a/precog/java/pom.xml b/precog/java/pom.xml index 5777ae1..fb42d2f 100644 --- a/precog/java/pom.xml +++ b/precog/java/pom.xml @@ -19,8 +19,13 @@ nexus.reportgrid.com reportgrid public Nexus repo - http://nexus.reportgrid.com/content/repositories/public-snapshots + http://nexus.reportgrid.com/content/repositories/public-releases + + nexus.reportgrid.com + reportgrid public SNAPSHOT Nexus repo + http://nexus.reportgrid.com/content/repositories/public-snapshots + diff --git a/precog/java/src/main/java/com/precog/api/Service.java b/precog/java/src/main/java/com/precog/api/Service.java index 6382e87..5c80b7f 100644 --- a/precog/java/src/main/java/com/precog/api/Service.java +++ b/precog/java/src/main/java/com/precog/api/Service.java @@ -21,7 +21,7 @@ public interface Service { public static final Service ProductionHttp = new Service() { @Override public URL serviceUrl() { try { - return new URL("http", "api.precog.com", 80, "/v1/"); + return new URL("https", "api.precog.com", 443, "/v1/"); } catch (MalformedURLException ex) { Logger.getLogger(Service.class.getName()).log(Level.SEVERE, "Invalid client URL", ex); } @@ -36,8 +36,13 @@ public interface Service { public static final Service ProductionHttps = ServiceBuilder.service("api.precog.com"); /** - * The default production https service. + * The default beta https service. */ public static final Service BetaPrecogHttps = ServiceBuilder.service("beta.precog.com"); + /** + * Dev https service. + */ + public static final Service DevPrecogHttps = ServiceBuilder.service("devapi.precog.com"); + } diff --git a/precog/java/src/test/java/com/precog/api/ClientTest.java b/precog/java/src/test/java/com/precog/api/ClientTest.java index d58d5a5..9e4870e 100644 --- a/precog/java/src/test/java/com/precog/api/ClientTest.java +++ b/precog/java/src/test/java/com/precog/api/ClientTest.java @@ -16,7 +16,6 @@ import org.junit.Test; import java.io.IOException; -import java.util.Map; import static org.junit.Assert.*; @@ -30,6 +29,7 @@ public class ClientTest { public static String testAccountId; public static String testApiKey; + public static Client testClient; private static class TestData { public final int testInt; @@ -37,7 +37,6 @@ private static class TestData { @SerializedName("~raw") public final RawJson testRaw; - public TestData(int testInt, String testStr, RawJson testRaw) { this.testInt = testInt; this.testStr = testStr; @@ -49,15 +48,24 @@ public TestData(int testInt, String testStr, RawJson testRaw) { public static void beforeAll() throws Exception { String testId = "" + Double.valueOf(java.lang.Math.random() * 10000).intValue(); - Client testClient = new Client(Service.BetaPrecogHttps, null); - String result = testClient.createAccount("java-test@precog.com", "password"); + String host=System.getProperty("host"); + Service svc; + if (host == null){ + svc=Service.DevPrecogHttps; + } else { + svc= ServiceBuilder.service(host); + } + + Client noApiKeyClient = new Client(svc, null); + String result = noApiKeyClient.createAccount("java-test@precog.com", "password"); AccountInfo res = GsonFromJson.of(new TypeToken() { }).deserialize(result); testAccountId = res.getAccountId(); - result = testClient.describeAccount("java-test@precog.com", "password", testAccountId); + result = noApiKeyClient.describeAccount("java-test@precog.com", "password", testAccountId); res = GsonFromJson.of(new TypeToken() { }).deserialize(result); testApiKey = res.getApiKey(); + testClient =new Client(svc, testApiKey); testPath = new Path("/test" + testId); accountTestPath = new Path(testAccountId).append(testPath); } @@ -65,49 +73,44 @@ public static void beforeAll() throws Exception { @Test public void testStore() throws IOException { ToJson toJson = new GsonToJson(); - Client testClient = new Client(Service.BetaPrecogHttps, testApiKey); + RawJson testJson = new RawJson("{\"test\":[{\"v\": 1}, {\"v\": 2}]}"); TestData testData = new TestData(42, "Hello\" World", testJson); Record testRecord = new Record(testData); - testClient.store(accountTestPath, testRecord, toJson); + testClient.store(testPath, testRecord, toJson); } @Test public void testStoreStrToJson() throws IOException { ToJson toJson = new RawStringToJson(); - Client testClient = new Client(Service.BetaPrecogHttps, testApiKey); + Record testRecord = new Record("{\"test\":[{\"v\": 1}, {\"v\": 2}]}"); - testClient.store(accountTestPath, testRecord, toJson); + testClient.store(testPath, testRecord, toJson); } @Test public void testStoreRawString() throws IOException { - Client testClient = new Client(Service.BetaPrecogHttps, testApiKey); + String rawJson = "{\"test\":[{\"v\": 1}, {\"v\": 2}]}"; - testClient.store(accountTestPath, rawJson); + testClient.store(testPath, rawJson); } @Test public void testStoreRawUTF8() throws IOException { - Client testClient = new Client(Service.BetaPrecogHttps, testApiKey); - String rawJson = "{\"test\":[{\"ดีลลิเชียส\": 1}, {\"v\": 2}]}"; - testClient.store(accountTestPath, rawJson); - } - public static Map jsonToStrMap(String json) { - return GsonFromJson.of(new TypeToken>() { - }).deserialize(json); + String rawJson = "{\"test\":[{\"ดีลลิเชียส\": 1}, {\"v\": 2}]}"; + testClient.store(testPath, rawJson); } @Test public void testIngestCSV() throws IOException { - Client testClient = new Client(Service.BetaPrecogHttps, testApiKey); + IngestOptions options = new CSVIngestOptions(); - String response = testClient.ingest(accountTestPath, "blah,\n\n", options); + String response = testClient.ingest(testPath, "blah,\n\n", options); IngestResult result = GsonFromJson.of(new TypeToken() { }).deserialize(response); assertEquals(1, result.getIngested()); @@ -115,10 +118,10 @@ public void testIngestCSV() throws IOException { @Test public void testIngestJSON() throws IOException { - Client testClient = new Client(Service.BetaPrecogHttps, testApiKey); + IngestOptions options = new IngestOptions(ContentType.JSON); String rawJson = "{\"test\":[{\"v\": 1}, {\"v\": 2}]}"; - String response = testClient.ingest(accountTestPath, rawJson, options); + String response = testClient.ingest(testPath, rawJson, options); IngestResult result = GsonFromJson.of(new TypeToken() { }).deserialize(response); assertEquals(1, result.getIngested()); @@ -126,12 +129,12 @@ public void testIngestJSON() throws IOException { @Test public void testIngestCsvWithOptions() throws IOException { - Client testClient = new Client(Service.BetaPrecogHttps, testApiKey); + CSVIngestOptions options = new CSVIngestOptions(); options.setDelimiter(","); options.setQuote("'"); options.setEscape("\\"); - String response = testClient.ingest(accountTestPath, "blah\n\n", options); + String response = testClient.ingest(testPath, "blah\n\n", options); IngestResult result = GsonFromJson.of(new TypeToken() { }).deserialize(response); assertEquals(1, result.getIngested()); @@ -139,10 +142,10 @@ public void testIngestCsvWithOptions() throws IOException { @Test public void testIngestAsync() throws IOException { - Client testClient = new Client(Service.BetaPrecogHttps, testApiKey); + IngestOptions options = new CSVIngestOptions(); options.setAsync(true); - String response = testClient.ingest(accountTestPath, "blah,\n\n", options); + String response = testClient.ingest(testPath, "blah,\n\n", options); //is async, so we don't expect results assertEquals("", response); } @@ -188,7 +191,6 @@ public void testOddCharacters() throws IOException { @Test public void testCreateAccount() throws IOException { - Client testClient = new Client(Service.BetaPrecogHttps, null); String result = testClient.createAccount("java-test@precog.com", "password"); assertNotNull(result); AccountInfo res = GsonFromJson.of(new TypeToken() { @@ -201,7 +203,6 @@ public void testCreateAccount() throws IOException { @Test public void testDescribeAccount() throws IOException { - Client testClient = new Client(Service.BetaPrecogHttps, null); String result = testClient.describeAccount("java-test@precog.com", "password", testAccountId); assertNotNull(result); AccountInfo res = GsonFromJson.of(new TypeToken() { @@ -212,8 +213,8 @@ public void testDescribeAccount() throws IOException { @Test public void testQuery() throws IOException { //just test the query was sent and executed successfully - Client testClient = new Client(Service.BetaPrecogHttps, testApiKey); - String result = testClient.query(new Path(testAccountId), "count(//"+ testPath +")"); + + String result = testClient.query(new Path(testAccountId), "count(//" + testAccountId + ")"); assertNotNull(result); String[] res = GsonFromJson.of(String[].class).deserialize(result); assertEquals("0", res[0]); diff --git a/precog/js/src/precog.js b/precog/js/src/precog.js index 47a8718..58e2d6f 100644 --- a/precog/js/src/precog.js +++ b/precog/js/src/precog.js @@ -442,6 +442,8 @@ throw new SyntaxError('JSON.parse');};}}()); else { request.send(null); } + + return request; }, doJsonpRequest: function(options) { @@ -504,7 +506,7 @@ throw new SyntaxError('JSON.parse');};}}()); createHttpInterface: function(doRequest) { return { get: function(path, callbacks, query, headers) { - doRequest( + return doRequest( { method: 'GET', path: path, @@ -517,7 +519,7 @@ throw new SyntaxError('JSON.parse');};}}()); }, put: function(path, content, callbacks, query, headers) { - doRequest( + return doRequest( { method: 'PUT', path: path, @@ -531,7 +533,7 @@ throw new SyntaxError('JSON.parse');};}}()); }, post: function(path, content, callbacks, query, headers, progress) { - doRequest( + return doRequest( { method: 'POST', path: path, @@ -546,7 +548,7 @@ throw new SyntaxError('JSON.parse');};}}()); }, remove: function(path, callbacks, query, headers) { - doRequest( + return doRequest( { method: 'DELETE', path: path, @@ -663,7 +665,7 @@ throw new SyntaxError('JSON.parse');};}}()); if(options.sortOrder) parameters.sortOrder = options.sortOrder; - http.get( + return http.get( Util.actionUrl("analytics", "fs", options) + Util.actionPath(null, options), Util.createCallbacks(success, failure, description), parameters @@ -916,7 +918,7 @@ throw new SyntaxError('JSON.parse');};}}()); var description = 'Precog retrieve metadata ' + options.type, parameters = { apiKey : options.apiKey || $.Config.apiKey }; if(!parameters.apiKey) throw Error("apiKey not specified"); - http.get( + return http.get( Util.actionUrl("meta", "fs", options) + Util.actionPath(path, options) + "#" + options.type, Util.createCallbacks(success, failure, description), parameters @@ -1131,19 +1133,28 @@ throw new SyntaxError('JSON.parse');};}}()); { success(val); } else if(queue[id]) { - queue[id].push(success); + queue[id].push({success: success, failure: failure}); } else { - queue[id] = []; + queue[id] = [{success: success, failure: failure}]; executeQuery(query, function(data) { - cacheSet(id, data); - delayedCleanup(id); - success(data); + try{ + cacheSet(id, data); + delayedCleanup(id); + } catch(e){ + Precog.cache.disable(); + } + for(var i = 0; i < queue[id].length; i++) + { + queue[id][i].success(data); + } + delete queue[id]; + }, function(){ for(var i = 0; i < queue[id].length; i++) { - queue[id][i](data); + queue[id][i].failure.apply(null, arguments); } delete queue[id]; - }, failure, options); + }, options); } } cleanOld(); diff --git a/precog/js/test/index.html b/precog/js/test/index.html index fd09a3f..5112038 100644 --- a/precog/js/test/index.html +++ b/precog/js/test/index.html @@ -7,7 +7,7 @@
- + diff --git a/precog/js/test/tests.js b/precog/js/test/tests.js index 821773d..cc7cf41 100644 --- a/precog/js/test/tests.js +++ b/precog/js/test/tests.js @@ -87,7 +87,7 @@ ensureAccount(function(id, apiKey, rootPath) { Precog.describeAccount("test-js"+random+"@precog.com", password, result.accountId, function(description){ var accountId = description.accountId; - var grants = { "grants": [{ "type": "read", "path": rootPath+"foo/", "expirationDate": null, "ownerAccountId" : id }] }; + var grants = {"name":"js-test","description":"","grants":[{"parentIds":[],"expirationDate":null,"permissions":[{"accessType":"read","path":rootPath+"foo/","ownerAccountId":id}]}]}; Precog.createKey(grants, function(result) { console.log(result); @@ -163,7 +163,7 @@ ensureAccount(function(id, apiKey, rootPath) { // ********************** asyncTest("create and delete key", function() { - var grants = { "grants": [{ "type": "read", "path": rootPath+"foo/", "expirationDate": null, "ownerAccountId" : id }] }; + var grants = {"name":"js-test","description":"","grants":[{"parentIds":[],"expirationDate":null,"permissions":[{"accessType":"read","path":rootPath+"foo/","ownerAccountId":id}]}]}; Precog.createKey(grants, function(result) { var ak = result['apiKey']; @@ -191,7 +191,7 @@ ensureAccount(function(id, apiKey, rootPath) { }); asyncTest("list keys", function() { - var grants = { "grants": [{ "type": "read", "path": rootPath+"foo/", "expirationDate": null, "ownerAccountId" : id }] }; + var grants = {"name":"js-test","description":"","grants":[{"parentIds":[],"expirationDate":null,"permissions":[{"accessType":"read","path":rootPath+"foo/","ownerAccountId":id}]}]}; Precog.createKey(grants, function(result) { var ak = result['apiKey']; @@ -205,7 +205,7 @@ ensureAccount(function(id, apiKey, rootPath) { }); asyncTest("describe key", function() { - var grants = { "grants": [{ "type": "read", "path": rootPath+"foo/", "expirationDate": null, "ownerAccountId" : id }] }; + var grants = {"name":"js-test","description":"","grants":[{"parentIds":[],"expirationDate":null,"permissions":[{"accessType":"read","path":rootPath+"foo/","ownerAccountId":id}]}]}; Precog.createKey(grants, function(result) { var ak = result['apiKey']; @@ -219,12 +219,14 @@ ensureAccount(function(id, apiKey, rootPath) { }); asyncTest("create and describe new grant", function() { - var grant = { "type": "read", "path": rootPath+"foo/", "ownerAccountId": id, "expirationDate": null }; + var grant = {"parentIds":[],"expirationDate":null,"permissions":[{"accessType":"read","path":rootPath+"foo/","ownerAccountId":id}]}; + console.log("initial grant "+JSON.stringify(grant)); Precog.createGrant(grant, function(g) { ok(g.grantId); + console.log("create grant "+JSON.stringify(g)); Precog.describeGrant(g.grantId, function(result) { + console.log("desc grant "+JSON.stringify(result)); equal(result.grantId, g.grantId); - equal(result.ownerAccountId, id); equal(result.path, grant.path); equal(result.type, grant.type); equal(result.expirationDate, null); @@ -234,7 +236,7 @@ ensureAccount(function(id, apiKey, rootPath) { }); asyncTest("delete grant", function() { - var grant = { "type": "read", "path": rootPath+"foo/", "ownerAccountId": id, "expirationDate": null }; + var grant = {"parentIds":[],"expirationDate":null,"permissions":[{"accessType":"read","path":rootPath+"foo/","ownerAccountId":id}]}; Precog.createGrant(grant, function(g) { Precog.deleteGrant(g.grantId, function(result) { ok(true); @@ -244,8 +246,11 @@ ensureAccount(function(id, apiKey, rootPath) { }); asyncTest("create child grant and list", function() { - var grant1 = { "type": "read", "path": rootPath+"foo/", "ownerAccountId": id, "expirationDate": null }, - grant2 = { "type": "read", "path": rootPath+"foo/bar/", "ownerAccountId": id, "expirationDate": null }; + // var grant1 = { "type": "read", "path": rootPath+"foo/", "ownerAccountId": id, "expirationDate": null }, + // grant2 = { "type": "read", "path": rootPath+"foo/bar/", "ownerAccountId": id, "expirationDate": null }; + + var grant1 = {"parentIds":[],"expirationDate":null,"permissions":[{"accessType":"read","path":rootPath+"foo/","ownerAccountId":id}]}, + grant2 = {"parentIds":[],"expirationDate":null,"permissions":[{"accessType":"read","path":rootPath+"foo/bar/","ownerAccountId":id}]}; Precog.createGrant(grant1, function(g1) { Precog.createGrantChild(g1.grantId, grant2, function(g2) { Precog.listGrantChildren(g1.grantId, function(result) { @@ -260,8 +265,8 @@ ensureAccount(function(id, apiKey, rootPath) { }); asyncTest("retrieve grants", function() { - var grant1 = { "type": "read", "path": rootPath+"foo/", "ownerAccountId": id, "expirationDate": null }, - grant2 = { "type": "read", "path": rootPath+"foo/bar/", "ownerAccountId": id, "expirationDate": null }; + var grant1 = {"parentIds":[],"expirationDate":null,"permissions":[{"accessType":"read","path":rootPath+"foo/","ownerAccountId":id}]}, + grant2 = {"parentIds":[],"expirationDate":null,"permissions":[{"accessType":"read","path":rootPath+"foo/bar/","ownerAccountId":id}]}; Precog.createGrant(grant1, function(g1) { Precog.createGrantChild(g1.grantId, grant2, function(g2) { Precog.retrieveGrants(Precog.$.Config.apiKey, function(result) { @@ -275,8 +280,8 @@ ensureAccount(function(id, apiKey, rootPath) { asyncTest("remove grant", function() { - var grant1 = { "type": "read", "path": rootPath+"foo/", "ownerAccountId": id, "expirationDate": null }, - grant2 = { "type": "read", "path": rootPath+"foo/bar/", "ownerAccountId": id, "expirationDate": null }; + var grant1 = {"parentIds":[],"expirationDate":null,"permissions":[{"accessType":"read","path":rootPath+"foo/","ownerAccountId":id}]}, + grant2 = {"parentIds":[],"expirationDate":null,"permissions":[{"accessType":"read","path":rootPath+"foo/bar/","ownerAccountId":id}]}; console.log("in remove grant"); Precog.createGrant(grant1, function(g1) { console.log(g1.grantId); @@ -298,8 +303,8 @@ ensureAccount(function(id, apiKey, rootPath) { */ asyncTest("add grant to key", function() { - var grants1 = { "grants": [{ "type": "read", "path": rootPath+"foo/", "expirationDate": null, "ownerAccountId" : id }] }; - grants2 = { "grants": [{ "type": "read", "path": rootPath+"foo/bar/", "ownerAccountId": id, "expirationDate": null }] }; + var grants1 = {"name":"js-test","description":"","grants":[{"parentIds":[],"expirationDate":null,"permissions":[{"accessType":"read","path":rootPath+"foo/","ownerAccountId":id}]}]}, + grants2 = {"name":"js-test","description":"","grants":[{"parentIds":[],"expirationDate":null,"permissions":[{"accessType":"read","path":rootPath+"foo/bar/","ownerAccountId":id}]}]}; Precog.createKey(grants1, function(result) { var ak = result['apiKey']; diff --git a/precog/php/src/Precog.php b/precog/php/src/Precog.php index 3bb5893..fac6f32 100644 --- a/precog/php/src/Precog.php +++ b/precog/php/src/Precog.php @@ -5,10 +5,10 @@ * Authors: Alissa Pajer, Nathan Lubchenco **/ -define ("BASE_URL", "https://beta.precog.com"); -define ("DEFAULT_VERSION", 1); class PrecogAPI { + const BASE_URL = "https://api.precog.com"; + const DEFAULT_VERSION = 1; private $apiKey = null; private $baseUrl = null; @@ -20,7 +20,7 @@ class PrecogAPI { /* * Initialize a new PrecogAPI object */ - public function __construct($apiKey, $basePath, $baseUrl = BASE_URL, $version = DEFAULT_VERSION) + public function __construct($apiKey, $basePath, $baseUrl = self::BASE_URL, $version = self::DEFAULT_VERSION) { $this->setApiKey($apiKey); $this->setBasePath($basePath); @@ -32,43 +32,43 @@ public function __construct($apiKey, $basePath, $baseUrl = BASE_URL, $version = // *************************** // ****** ACCOUNTS APIS ****** // *************************** - public static function createAccount($email, $password, $baseUrl = BASE_URL, $version = DEFAULT_VERSION) + public static function createAccount($email, $password, $baseUrl = self::BASE_URL, $version = self::DEFAULT_VERSION) { $url = self::baseActionUrl($baseUrl, $version, "accounts", "accounts"); return self::baseRestHelper($url, json_encode(array("email"=>$email, "password"=>$password)), "POST"); } - public static function describeAccount($email, $password, $accountId, $baseUrl = BASE_URL, $version = DEFAULT_VERSION) + public static function describeAccount($email, $password, $accountId, $baseUrl = self::BASE_URL, $version = self::DEFAULT_VERSION) { $url = self::baseActionUrl($baseUrl, $version, "accounts", "accounts").$accountId; return self::baseRestHelper($url, null, "GET", self::authHeaders($email, $password)); } - public static function addGrantToAccount($email, $password, $accountId, $grantId, $baseUrl = BASE_URL, $version = DEFAULT_VERSION) + public static function addGrantToAccount($email, $password, $accountId, $grantId, $baseUrl = self::BASE_URL, $version = self::DEFAULT_VERSION) { $url = self::baseActionUrl($baseUrl, $version, "accounts", "accounts/$accountId")."grants/"; return self::baseRestHelper($url, json_encode(array("grantId"=>$grantId)), "POST", self::authHeaders($email, $password)); } - public static function describePlan($email, $password, $accountId, $baseUrl = BASE_URL, $version = DEFAULT_VERSION) + public static function describePlan($email, $password, $accountId, $baseUrl = self::BASE_URL, $version = self::DEFAULT_VERSION) { $url = self::baseActionUrl($baseUrl, $version, "accounts", "accounts/$accountId")."plan"; return self::baseRestHelper($url, null, "GET", self::authHeaders($email, $password)); } - public static function changePassword($email, $oldPassword, $newPassword, $accountId, $baseUrl = BASE_URL, $version = DEFAULT_VERSION) + public static function changePassword($email, $oldPassword, $newPassword, $accountId, $baseUrl = self::BASE_URL, $version = self::DEFAULT_VERSION) { $url = self::baseActionUrl($baseUrl, $version, "accounts", "accounts/$accountId")."password"; return self::baseRestHelper($url, json_encode(array("password"=>$newPassword)), "PUT", self::authHeaders($email, $oldPassword)); } - public static function deletePlan($email, $password, $accountId, $baseUrl = BASE_URL, $version = DEFAULT_VERSION) + public static function deletePlan($email, $password, $accountId, $baseUrl = self::BASE_URL, $version = self::DEFAULT_VERSION) { $url = self::baseActionUrl($baseUrl, $version, "accounts", "accounts/$accountId")."plan"; return self::baseRestHelper($url, null, "DELETE", self::authHeaders($email, $password)); } - public static function changePlan($email, $password, $accountId, $plan, $baseUrl = BASE_URL, $version = DEFAULT_VERSION) + public static function changePlan($email, $password, $accountId, $plan, $baseUrl = self::BASE_URL, $version = self::DEFAULT_VERSION) { $url = self::baseActionUrl($baseUrl, $version, "accounts", "accounts/$accountId")."plan"; return self::baseRestHelper($url, json_encode(array("type"=>$plan)), "PUT", self::authHeaders($email, $password)); @@ -263,7 +263,7 @@ public function createGrantChild($grantId, $type) return $return; } - + // *************************** // ***** GETTERS/SETTERS ***** @@ -314,7 +314,7 @@ public function setBasePath($value) /********************************* **** PRIVATE helper function **** *********************************/ - private function restHelper($resturl, $params = null, $verb = 'GET', $headers = false) + private function restHelper($resturl, $params = null, $verb = 'GET', $headers = false) { $result = self::baseRestHelper($resturl, $params, $verb, $headers); if($result['ok']) { @@ -328,7 +328,7 @@ private function restHelper($resturl, $params = null, $verb = 'GET', $headers = } } - private static function baseRestHelper($resturl, $params = null, $verb = 'GET', $headers = false) + private static function baseRestHelper($resturl, $params = null, $verb = 'GET', $headers = false) { //echo("$verb $resturl\n"); //if($params) var_dump($params); @@ -359,12 +359,9 @@ private static function baseRestHelper($resturl, $params = null, $verb = 'GET', $stream_contents = stream_get_contents($file_pointer); fclose($file_pointer); } -//if(isset($stream_contents)) var_dump($stream_contents); -//if(isset($stream_meta_data)) var_dump($stream_meta_data); - if ($verb==="DELETE" || $stream_contents !== false) { - + /* * In the case of we're receiving stream data back from the API, * json decode it here. diff --git a/precog/php/test/basetest.php b/precog/php/test/basetest.php index 49aee1c..59e77a2 100644 --- a/precog/php/test/basetest.php +++ b/precog/php/test/basetest.php @@ -24,8 +24,8 @@ abstract class PrecogBaseTest extends UnitTestCase { static $password = "test1234"; public static function serviceInfo() { - $HOST = "beta.precog.com"; - $PORT = null; + $HOST = "devapi.precog.com"; + $PORT = 443; $VERSION = 1; $options = getopt("", array("host:", "port:", "version:")); @@ -43,8 +43,11 @@ public static function serviceInfo() break; } } - - $URL = "http://$HOST" . ($PORT ? ":$PORT" : ""); + if ($PORT == 443){ + $URL = "https://$HOST" . ($PORT ? ":$PORT" : ""); + } else { + $URL = "http://$HOST" . ($PORT ? ":$PORT" : ""); + } return array("baseUrl"=>$URL, "version"=>$VERSION); } diff --git a/precog/php/test/test-add-grant-to-account.php b/precog/php/test/test-add-grant-to-account.php index 9ad2b44..749c815 100644 --- a/precog/php/test/test-add-grant-to-account.php +++ b/precog/php/test/test-add-grant-to-account.php @@ -5,7 +5,17 @@ class AddGrantToAccountTest extends PrecogBaseTest { function testAddGrantToAccount() { $api = PrecogBaseTest::createApi($this->info); - $result = $api->createKey(array("grants"=>array(array("type"=>"read", "path"=>$this->info["path"]."foo/", "ownerAccountId"=> $this->info["accountId"], "expirationDate"=> null)))); + + $grant= array("name"=>"php-test","description"=>"", + "grants"=>array(array( + "parentIds"=> array(), + "expirationDate"=> null, + "permissions"=>array(array("accessType"=>"read", "path"=>$this->info["path"]."foo/","ownerAccountId"=> $this->info["accountId"])) + )) + ); + + $result = $api->createKey($grant); + $apiKey1 = $result["apiKey"]; $randomemail = "testphp.".rand(0, 100000000)."@precog.com"; @@ -13,6 +23,7 @@ function testAddGrantToAccount() { $account2Id = $account2["data"]["accountId"]; $result = $api->describeKey($apiKey1); + $grantId = $result["grants"][0]["grantId"]; $result = $api->addGrantToAccount(PrecogBaseTest::$email, PrecogBaseTest::$password, $account2Id, $grantId); diff --git a/precog/php/test/test-add-grant-to-key.php b/precog/php/test/test-add-grant-to-key.php index 78118c2..5acf10f 100644 --- a/precog/php/test/test-add-grant-to-key.php +++ b/precog/php/test/test-add-grant-to-key.php @@ -5,11 +5,21 @@ class AddGrantToKeyTest extends PrecogBaseTest { function testAddGrantToKey() { $api = PrecogBaseTest::createApi($this->info); - $result = $api->createKey(array("grants"=>array(array("type"=>"read", "path"=>$this->info["path"]."foo/", "ownerAccountId"=> $this->info["accountId"], "expirationDate"=> null)))); + + $grant= array("name"=>"php-test","description"=>"", + "grants"=>array(array( + "parentIds"=> array(), + "expirationDate"=> null, + "permissions"=>array(array("accessType"=>"read", "path"=>$this->info["path"]."foo/","ownerAccountId"=> $this->info["accountId"])) + )) + ); + + $result = $api->createKey($grant); $apiKey1 = $result["apiKey"]; - $result = $api->createKey(array("grants"=>array(array("type"=>"write", "path"=>$this->info["path"]."foo/", "ownerAccountId"=> $this->info["accountId"], "expirationDate"=> null)))); + $result = $api->createKey($grant); $apiKey2 = $result["apiKey"]; $result = $api->describeKey($apiKey2); + $grantId = $result["grants"][0]["grantId"]; $api->addGrantToKey($apiKey1, $grantId); $result = $api->describeKey($apiKey1); diff --git a/precog/php/test/test-create-grant-child.php b/precog/php/test/test-create-grant-child.php index 1613c65..0225cb4 100644 --- a/precog/php/test/test-create-grant-child.php +++ b/precog/php/test/test-create-grant-child.php @@ -4,9 +4,26 @@ class CreateGrantChildTest extends PrecogBaseTest { function testCreateGrantChild() { - $api = PrecogBaseTest::createApi($this->info); - $result = $api->createGrant(array("type"=>"read", "path"=>$this->info["path"]."foo/", "ownerAccountId"=> $this->info["accountId"], "expirationDate"=> null)); - $result = $api->createGrantChild($result["grantId"], array("type"=>"read", "path"=>$this->info["path"]."foo/", "ownerAccountId"=> $this->info["accountId"], "expirationDate"=> null)); + + $api = PrecogBaseTest::createApi($this->info); + + $grant= array( + "parentIds"=> array(), + "expirationDate"=> null, + "permissions"=>array(array("accessType"=>"read", "path"=>$this->info["path"]."foo/","ownerAccountId"=> $this->info["accountId"])) + ); + + $result = $api->createGrant($grant); + + $child_grant= array( + "name"=>"childGrant1", + "description" => "a child grant to test", + "parentIds"=> array($result["grantId"]), + "expirationDate"=> null, + "permissions"=>array(array("accessType"=>"read", "path"=>$this->info["path"]."foo/","ownerAccountId"=> $this->info["accountId"])) + ); + + $result = $api->createGrantChild($result["grantId"], $child_grant); $this->assertTrue(isset($result["grantId"])); } } diff --git a/precog/php/test/test-create-grant.php b/precog/php/test/test-create-grant.php index 46557bb..353c55c 100644 --- a/precog/php/test/test-create-grant.php +++ b/precog/php/test/test-create-grant.php @@ -5,7 +5,14 @@ class CreateGrantTest extends PrecogBaseTest { function testCreateGrant() { $api = PrecogBaseTest::createApi($this->info); - $result = $api->createGrant(array("type"=>"read", "path"=>$this->info['path']."/foo/", "ownerAccountId"=> $this->info["accountId"], "expirationDate"=> null)); + + $grant= array( + "parentIds"=> array(), + "expirationDate"=> null, + "permissions"=>array(array("accessType"=>"read", "path"=>$this->info["path"]."foo/","ownerAccountId"=> $this->info["accountId"])) + ); + + $result = $api->createGrant($grant); $this->assertTrue(isset($result["grantId"])); } } diff --git a/precog/php/test/test-create-key.php b/precog/php/test/test-create-key.php index 6bfbe11..7ce7fce 100644 --- a/precog/php/test/test-create-key.php +++ b/precog/php/test/test-create-key.php @@ -5,7 +5,16 @@ class CreateAPIkeyTest extends PrecogBaseTest { function testCreateAPIkey() { $api = PrecogBaseTest::createApi($this->info); - $result = $api->createKey(array("grants"=>array(array("type"=>"read", "path"=>$this->info["path"]."foo/", "ownerAccountId"=> $this->info["accountId"], "expirationDate"=> null),array("type"=>"read", "path"=>$this->info["path"]."foo2/", "ownerAccountId"=> $this->info["accountId"], "expirationDate"=> null)))); + + $grant= array("name"=>"php-test","description"=>"", + "grants"=>array(array( + "parentIds"=> array(), + "expirationDate"=> null, + "permissions"=>array(array("accessType"=>"read", "path"=>$this->info["path"]."foo/","ownerAccountId"=> $this->info["accountId"])) + )) + ); +print(json_encode($grant)); + $result = $api->createKey($grant); $this->assertTrue(isset($result) && strlen($result["apiKey"]) == 36); } } diff --git a/precog/php/test/test-delete-grant.php b/precog/php/test/test-delete-grant.php index 6158706..28d6596 100644 --- a/precog/php/test/test-delete-grant.php +++ b/precog/php/test/test-delete-grant.php @@ -5,7 +5,16 @@ class DeleteGrantTest extends PrecogBaseTest { function testDeleteGrant() { $api = PrecogBaseTest::createApi($this->info); - $result = $api->createGrant(array("type"=>"read", "path"=>$this->info["path"]."foo/", "ownerAccountId"=> $this->info["accountId"], "expirationDate"=> null)); + + $grant= array( + "parentIds"=> array(), + "expirationDate"=> null, + "permissions"=>array( + array("accessType"=>"read", "path"=>$this->info["path"]."foo/","ownerAccountId"=> $this->info["accountId"]) + ) + ); + + $result = $api->createGrant($grant); $grantId = $result["grantId"]; $result = $api->deleteGrant($grantId); $this->assertTrue($result); diff --git a/precog/php/test/test-delete-key.php b/precog/php/test/test-delete-key.php index 8ae6fa1..13756b1 100644 --- a/precog/php/test/test-delete-key.php +++ b/precog/php/test/test-delete-key.php @@ -5,7 +5,15 @@ class DeleteAPIkeyTest extends PrecogBaseTest { function testDeleteAPIkey() { $api = PrecogBaseTest::createApi($this->info); - $result = $api->createKey(array("grants"=>array(array("type"=>"read", "path"=>$this->info['path']. "/foo/", "ownerAccountId"=> $this->info["accountId"], "expirationDate"=> null)))); + $grant= array("name"=>"php-test","description"=>"", + "grants"=>array(array( + "parentIds"=> array(), + "expirationDate"=> null, + "permissions"=>array(array("accessType"=>"read", "path"=>$this->info["path"]."foo/","ownerAccountId"=> $this->info["accountId"])) + )) + ); + + $result = $api->createKey($grant); $apiKey = $result["apiKey"]; $this->assertTrue($api->deleteKey($apiKey)); $this->assertFalse($api->describeKey($apiKey)); diff --git a/precog/php/test/test-describe-key.php b/precog/php/test/test-describe-key.php index 27ad58f..a8fc94d 100644 --- a/precog/php/test/test-describe-key.php +++ b/precog/php/test/test-describe-key.php @@ -5,7 +5,16 @@ class DescribeAPIkeyTest extends PrecogBaseTest { function testDescribeAPIkey() { $api = PrecogBaseTest::createApi($this->info); - $result = $api->createKey(array("grants"=>array(array("type"=>"read", "path"=>$this->info["path"]."foo/", "ownerAccountId"=> $this->info["accountId"], "expirationDate"=> null)))); + + $grant= array("name"=>"php-test","description"=>"", + "grants"=>array(array( + "parentIds"=> array(), + "expirationDate"=> null, + "permissions"=>array(array("accessType"=>"read", "path"=>$this->info["path"]."foo/","ownerAccountId"=> $this->info["accountId"])) + )) + ); + + $result = $api->createKey($grant); $apiKey = $result["apiKey"]; $result = $api->describeKey($apiKey); $this->assertEqual($apiKey, $result["apiKey"]); diff --git a/precog/php/test/test-list-keys.php b/precog/php/test/test-list-keys.php index 1879c05..bc24bb9 100644 --- a/precog/php/test/test-list-keys.php +++ b/precog/php/test/test-list-keys.php @@ -6,11 +6,17 @@ class ListAPIkeyTest extends PrecogBaseTest { function testListAPIkey() { $api = PrecogBaseTest::createApi($this->info); $authorizingApiKey = $api->getApiKey(); - $result = $api->createKey(array("grants"=>array(array("type"=>"read", "path"=>$this->info["path"]."foo/", "ownerAccountId"=> $this->info["accountId"], "expirationDate"=> null)))); - // var_dump($result); - // var_dump($result["apiKey"]); - $apiKey = $result["apiKey"]; - $result = $api->listKeys(); + + $grant= array("name"=>"php-test","description"=>"", + "grants"=>array(array( + "parentIds"=> array(), + "expirationDate"=> null, + "permissions"=>array( + array("accessType"=>"read", "path"=>$this->info["path"]."foo/","ownerAccountId"=> $this->info["accountId"]) + ) + )) + ); + $this->assertTrue(count($result) > 0); $found = false; foreach ($result as $key => $value) { diff --git a/precog/php/test/test-query.php b/precog/php/test/test-query.php index e6fb317..8dbb4b6 100644 --- a/precog/php/test/test-query.php +++ b/precog/php/test/test-query.php @@ -7,7 +7,7 @@ class QueryTest extends PrecogBaseTest { function setupPath() { $this->api = PrecogBaseTest::createApi($this->info); - $path = "/test/php/query/T" . str_replace(".", "", uniqid(rand(), true)); + $path = $this->info['path']."test/php/query/T" . str_replace(".", "", uniqid(rand(), true)); $r = $this->api->store($path, array('foo' => 42)); return $path; } diff --git a/precog/php/test/test-retrieve-grants.php b/precog/php/test/test-retrieve-grants.php index e6e357a..f36c67e 100644 --- a/precog/php/test/test-retrieve-grants.php +++ b/precog/php/test/test-retrieve-grants.php @@ -5,7 +5,16 @@ class RetrieveGrantsTest extends PrecogBaseTest { function testRetrieveGrants() { $api = PrecogBaseTest::createApi($this->info); - $result = $api->createKey(array("grants"=>array(array("type"=>"read", "path"=>$this->info["path"]."foo/", "ownerAccountId"=> $this->info["accountId"], "expirationDate"=> null)))); + + $grant= array("name"=>"php-test","description"=>"", + "grants"=>array(array( + "parentIds"=> array(), + "expirationDate"=> null, + "permissions"=>array(array("accessType"=>"read", "path"=>$this->info["path"]."foo/","ownerAccountId"=> $this->info["accountId"])) + )) + ); + + $result = $api->createKey($grant); $apiKey = $result["apiKey"]; $result = $api->retrieveGrants($apiKey); $this->assertTrue(is_array($result)); diff --git a/precog/python/precog/precog.py b/precog/python/precog/precog.py index 6d0ab2e..49b9c7a 100644 --- a/precog/python/precog/precog.py +++ b/precog/python/precog/precog.py @@ -34,7 +34,7 @@ __app_name__ = 'precog' __version__ = '2012.10.23' __author__ = 'Gabriel Claramunt' -__author_email__ = 'gabriel [at] xxxxxxx [dot] com' +__author_email__ = 'gabriel [at] precog [dot] com' __description__ = 'Python client library for Precog (http://www.precog.com)' __url__ = 'https://github.com/reportgrid/client-libraries/precog/python' @@ -43,7 +43,7 @@ class API: """API server constants""" Host = 'api.precog.io' - Port = 80 + Port = 443 Version = 1 class Path: @@ -85,7 +85,10 @@ def __getattr__(self, name): # New connection per request, to avoid issues with servers closing connections # We ran into this while testing against the dev cluster. Tests would fail with # a long stack trace and the error CannotSendRequest - self.conn = httplib.HTTPConnection("%s:%d" % (self.host, int(self.port))) + if (self.port == 443 ): + self.conn = httplib.HTTPSConnection("%s:%d" % (self.host, int(self.port))) + else : + self.conn = httplib.HTTPConnection("%s:%d" % (self.host, int(self.port))) name = name.upper() diff --git a/precog/python/precog/test/conftest.py b/precog/python/precog/test/conftest.py index 5600a31..1447d2e 100644 --- a/precog/python/precog/test/conftest.py +++ b/precog/python/precog/test/conftest.py @@ -26,8 +26,8 @@ import pytest def pytest_addoption(parser): - parser.addoption("--host", action="store", default="beta.precog.com", help="The hostname used for the unit test") - parser.addoption("--port", action="store", default=80, type=int, help="The port used for the unit test") + parser.addoption("--host", action="store", default="devapi.precog.com", help="The hostname used for the unit test") + parser.addoption("--port", action="store", default=443, type=int, help="The port used for the unit test") parser.addoption("--apiKey", action="store", default='A3BC1539-E8A9-4207-BB41-3036EC2C6E6D', help="The token used for the unit test") diff --git a/precog/ruby/lib/precog.rb b/precog/ruby/lib/precog.rb index 348ee66..da1059d 100644 --- a/precog/ruby/lib/precog.rb +++ b/precog/ruby/lib/precog.rb @@ -37,7 +37,7 @@ module Precog # API server constants module API HOST = 'api.precog.io' - PORT = 80 + PORT = 443 VERSION = '1' end @@ -80,6 +80,7 @@ def initialize(api_key, host, port) @port = port @version = API::VERSION @conn = Net::HTTP.new(host, port) + @conn.use_ssl = (@port == 443) end def basic_auth(user, password) diff --git a/precog/ruby/test/test_precog.rb b/precog/ruby/test/test_precog.rb index 3925ef9..fd22f3a 100755 --- a/precog/ruby/test/test_precog.rb +++ b/precog/ruby/test/test_precog.rb @@ -26,8 +26,8 @@ class PrecogClientTest < Test::Unit::TestCase - HOST = 'beta.precog.com' - PORT = 80 + HOST = 'devapi.precog.com' + PORT = 443 ROOT_API_KEY = '2D36035A-62F6-465E-A64A-0E37BCC5257E' attr_reader :account_id, :api_key, :no_key_api, :api @@ -71,10 +71,10 @@ def test_create_account_new end def test_describe_account - response = @no_key_api.describe_account("test-rb@precog.com","password","0000000305") + response = @no_key_api.describe_account("test-rb@precog.com","password",@account_id) assert_equal Hash, response.class assert_include response, 'accountId' - assert_equal '0000000305', response['accountId'] + assert_equal @account_id, response['accountId'] assert_include response, 'email' assert_equal 'test-rb@precog.com', response['email'] end @@ -82,11 +82,11 @@ def test_describe_account # def test_add_grant_to_account # # TODO once security API is complete - # # @no_key_api.add_grant_to_account("test-rb@precog.com","password","0000000305", xxxxxx) + # # @no_key_api.add_grant_to_account("test-rb@precog.com","password",@account_id, xxxxxx) # end def test_describe_plan - response=@no_key_api.describe_plan("test-rb@precog.com","password","0000000305") + response=@no_key_api.describe_plan("test-rb@precog.com","password",@account_id) assert_equal Hash, response.class assert_include response, 'type' assert_equal 'Free', response['type'] @@ -94,27 +94,27 @@ def test_describe_plan #Changes an account's plan (only the plan type itself may be changed). Billing for the new plan, if appropriate, will be prorated. def test_change_plan - response=@no_key_api.change_plan("test-rb@precog.com","password","0000000305", "Bronze") + response=@no_key_api.change_plan("test-rb@precog.com","password",@account_id, "Bronze") - response=@no_key_api.describe_plan("test-rb@precog.com","password","0000000305") + response=@no_key_api.describe_plan("test-rb@precog.com","password",@account_id) assert_include response, 'type' assert_equal 'Bronze', response['type'] - response=@no_key_api.change_plan("test-rb@precog.com","password","0000000305", "Free") + response=@no_key_api.change_plan("test-rb@precog.com","password",@account_id, "Free") end #Changes your account access password. This call requires HTTP Basic authentication using the current password. def test_change_password - response=@no_key_api.change_password("test-rb@precog.com","password","0000000305", "xyzzy") - response=@no_key_api.change_password("test-rb@precog.com","xyzzy","0000000305", "password") + response=@no_key_api.change_password("test-rb@precog.com","password",@account_id, "xyzzy") + response=@no_key_api.change_password("test-rb@precog.com","xyzzy",@account_id, "password") end #Deletes an account's plan. This is the same as switching a plan to the free plan. def test_delete_plan - response=@no_key_api.change_plan("test-rb@precog.com","password","0000000305", "Bronze") - response=@no_key_api.delete_plan("test-rb@precog.com","password","0000000305") + response=@no_key_api.change_plan("test-rb@precog.com","password",@account_id, "Bronze") + response=@no_key_api.delete_plan("test-rb@precog.com","password",@account_id) #test it's free after delete - response=@no_key_api.describe_plan("test-rb@precog.com","password","0000000305") + response=@no_key_api.describe_plan("test-rb@precog.com","password",@account_id) assert_equal Hash, response.class assert_include response, 'type' assert_equal 'Free', response['type'] diff --git a/reportgrid/java/pom.xml b/reportgrid/java/pom.xml index 1026cbb..918c0f4 100644 --- a/reportgrid/java/pom.xml +++ b/reportgrid/java/pom.xml @@ -19,8 +19,13 @@ nexus.reportgrid.com reportgrid public Nexus repo - http://nexus.reportgrid.com/content/repositories/public-snapshots + http://nexus.reportgrid.com/content/repositories/public-releases + + nexus.reportgrid.com + reportgrid public SNAPSHOT Nexus repo + http://nexus.reportgrid.com/content/repositories/public-snapshots + @@ -37,4 +42,9 @@ test + + + UTF-8 + UTF-8 + diff --git a/reportgrid/js/src/v1/reportgrid-charts.js b/reportgrid/js/src/v1/reportgrid-charts.js index b6f394e..152f0bc 100644 --- a/reportgrid/js/src/v1/reportgrid-charts.js +++ b/reportgrid/js/src/v1/reportgrid-charts.js @@ -1,1147 +1,1227 @@ -(function(){var ib,jb,Ab,lb,Ba,Ta,ab,sb,Wc,Xb,Xc,ga,Ma,Kd,mb,Yc,Zc,ta,$c,ad,bd,cd,dd,ed,Bb,fd,gd,jc,Ka,Ua,Mb,Ld,kc,hd,Nb,Va,Cb,id,Db,tb,Yb,Eb,qb,Ob,rc,Kc,Zb,jd,kd,Fb,Za,ra,za,s,o,V,Ha,sc,ld,U,ya,Md,Nd,Pa,La,X,Od,Gb,tc,L,nb,Oa,Pb,je,uc,Lc,Pd,Qd,Mc,$b,Hb,Rd,Sd,Td,md,Ud,ac,Vd,sa,nd,od,pd,qd,rd,sd,td,Ib,ud,Nc,vd,wd,Oc,Pc,xd,yd,Qc,Rc,ub,i,Ia,Jb,bb,lc,vc,Ja,Sc,wc,xc,yc,Tc,zd,Ad,bc,vb,Wd,cc,wb,ob,p,J,A,cb,g,w,Z,W,q,ka,R,t,db,xb,Xa,ke,le,Qa,n,Wa,ma,ja,Qb,Rb,me,Xd,Yd,Bd,zc,Sb,Q,dc,Ac,oa,eb,$a,P,Kb,H,G,ha, -ze,Cd,F,Y,Tb,Ea,aa,ne;function E(a,b){function c(){}c.prototype=a;var e=new c,f;for(f in b)e[f]=b[f];return e}function pa(a){return a instanceof Array?function(){return u.iter(a)}:"function"==typeof a.iterator?y(a,a.iterator):a.iterator}function y(a,b){var c=function(){return c.method.apply(c.scope,arguments)};c.scope=a;c.method=b;return c}var j={},v=function(){return G.__string_rec(this,"")},z=function(){};j.Arrays=z;z.__name__=["Arrays"];z.addIf=function(a,b,c){null!=b?b&&a.push(c):null!=c&&a.push(c); -return a};z.add=function(a,b){a.push(b);return a};z["delete"]=function(a,b){u.remove(a,b);return a};z.removef=function(a,b){for(var c=-1,e=0,f=a.length;ec)return!1;a.splice(c,1);return!0};z.deletef=function(a,b){z.removef(a,b);return a};z.filter=function(a,b){for(var c=[],e=0;e(f=b(a[B])))c=f,e=B}return a[e]};z.floatMin=function(a,b){if(0==a.length)return Math.NaN;for(var c=b(a[0]),e,f=1,h=a.length;f(e=b(a[e])))c=e;return c};z.bounds=function(a,b){if(0==a.length)return null;if(null==b)for(var c=a[0],e=0,f=a[0],h=0,l=1,B=a.length;lk(f,a[g])&&(f=a[h=g])}else{c=b(a[0]);e=0;k=b(a[0]);h=0;l=1;for(B=a.length;l(f=b(a[g])))c= -f,e=g;l=1;for(B=a.length;l(e=b(a[B])))c=e;if(f<(e=b(a[B])))f=e}return[c,f]};z.max=function(a,b){if(0==a.length)return null;if(null==b)for(var c=a[0],e=0,f=da.comparef(c),h=1,l=a.length;hf(c,a[B])&&(c=a[e=B])}else{c=b(a[0]);e=0;h=1;for(l=a.length;h>1;b>1;a[f]a||a>e?null:B(a,0,f.length-1)}};var pb=function(){};j.Bools=pb;pb.__name__=["Bools"];pb.format=function(a,b,c,e){return pb.formatf(b,c,e)(a)};pb.formatf= -function(a,b){var b=p.FormatParams.params(a,b,"B"),c=b.shift();switch(c){case "B":return function(a){return a?"true":"false"};case "N":return function(a){return a?"1":"0"};case "R":if(2!=b.length)throw"bool format R requires 2 parameters";return function(a){return a?b[0]:b[1]};default:throw"Unsupported bool format: "+c;}};pb.interpolate=function(a,b,c,e){return pb.interpolatef(b,c,e)(a)};pb.interpolatef=function(a,b,c){if(a==b)return function(){return a};var e=C.interpolatef(0,1,c);return function(c){return 0.5> -e(c)?a:b}};pb.canParse=function(a){a=a.toLowerCase();return"true"==a||"false"==a};pb.parse=function(a){return"true"==a.toLowerCase()};pb.compare=function(a,b){return a==b?0:a?-1:1};var na=function(a,b){this.length=a;this.b=b};j.Bytes=na;na.__name__=["Bytes"];na.alloc=function(a){for(var b=[],c=0;c=f?b.push(f):(2047>=f?b.push(192|f>>6):(65535>=f?b.push(224|f>>12):(b.push(240|f>> -18),b.push(128|f>>12&63)),b.push(128|f>>6&63)),b.push(128|f&63))}return new na(b.length,b)};na.ofStringData=function(a){for(var b=[],c=0,e=a.length;ca||0>b||a+b>this.length)throw new F.OutsideBoundsException;for(var c= -"",e=this.b,f=String.fromCharCode,h=a,l=a+b;hB){if(0==B)break;c+=f(B)}else if(224>B)c+=f((B&63)<<6|e[h++]&127);else if(240>B)var g=e[h++],c=c+f((B&31)<<12|(g&127)<<6|e[h++]&127);else var g=e[h++],k=e[h++],c=c+f((B&15)<<18|(g&127)<<12|k<<6&127|e[h++]&127)}return c},compare:function(a){for(var b=this.b,c=a.b,e=this.lengththis.length&&(b=this.length-a);if(0>a||0>b)throw new F.OutsideBoundsException;return new na(b,this.b.slice(a,a+b))},blit:function(a,b,c,e){null==e&&(e=b.length-c);c+e>b.length&&(e=b.length-c);if(0>a||0>c||0>e||a+e>this.length||c+e>b.length)throw new F.OutsideBoundsException;var f=this.b,b=b.b;if(f==b&&a>c)for(var h=e;0b||0>c||b+c>a.length)throw new F.OutsideBoundsException;for(var a=a.b,e=b,b=b+c;ef)throw"Value out of range";c.b.push(f)}return null!=b&&0f)throw"Value out of range";c.b.push(f)}return null!=b&&0f)throw"Value out of range";c.b.push(f)}return null!=b&&0a){if(-128>a)throw"not a byte";a=a&255|128}if(255b?!0:!1,c=I.lpad(c,"0",4);return b?"-"+c:"+"+c}(c);break;default:throw"Date.format %"+b+"- not implemented yet.";}return c}(this)};va.__format=function(a,b){for(var c=new fb,e=0;;){var f=b.indexOf("%",e);if(0>f)break;c.b+=u.substr(b,e,f-e);c.b+=r.string(va.__format_get(a, -u.substr(b,f+1,1)));e=f+2}c.b+=u.substr(b,e,b.length-e);return c.b};va.format=function(a,b){return va.__format(a,b)};va.delta=function(a,b){var c=new Date;c.setTime(a.getTime()+b);return c};va.getMonthDays=function(a){var b=a.getMonth(),a=a.getFullYear();return 1!=b?va.DAYS_OF_MONTH[b]:0==a%4&&0!=a%100||0==a%400?29:28};va.seconds=function(a){return 1E3*a};va.minutes=function(a){return 6E4*a};va.hours=function(a){return 36E5*a};va.days=function(a){return 864E5*a};va.parse=function(a){var b=a/1E3,c= -b/60,e=c/60;return{ms:a%1E3,seconds:b%60|0,minutes:c%60|0,hours:e%24|0,days:e/24|0}};va.make=function(a){return a.ms+1E3*(a.seconds+60*(a.minutes+60*(a.hours+24*a.days)))};var T=function(a,b){b=b.split("u").join("");this.r=RegExp(a,b)};j.EReg=T;T.__name__=["EReg"];T.prototype={customReplace:function(a,b){for(var c=new fb;this.match(a);){c.b+=r.string(this.matchedLeft());c.b+=r.string(b(this));a=this.matchedRight()}c.b+=r.string(a);return c.b},replace:function(a,b){return a.replace(this.r,b)},split:function(a){return a.replace(this.r, -"#__delim__#").split("#__delim__#")},matchedPos:function(){if(null==this.r.m)throw"No string matched";return{pos:this.r.m.index,len:this.r.m[0].length}},matchedRight:function(){if(null==this.r.m)throw"No string matched";if(null==this.r.r){var a=this.r.m.index+this.r.m[0].length;return this.r.s.substr(a,this.r.s.length-a)}return this.r.r},matchedLeft:function(){if(null==this.r.m)throw"No string matched";return null==this.r.l?this.r.s.substr(0,this.r.m.index):this.r.l},matched:function(a){if(null!= -this.r.m&&0<=a&&ac)switch(b){case "second":return 1E3*Math.floor(a/1E3);case "minute":return 6E4*Math.floor(a/6E4);case "hour":return 36E5*Math.floor(a/36E5);case "day":return b=function(){var b=new Date;b.setTime(a);return b}(this),(new Date(b.getFullYear(),b.getMonth(),b.getDate(), -0,0,0)).getTime();case "week":return 6048E5*Math.floor(a/6048E5);case "month":return b=function(){var b=new Date;b.setTime(a);return b}(this),(new Date(b.getFullYear(),b.getMonth(),1,0,0,0)).getTime();case "year":return b=function(){var b=new Date;b.setTime(a);return b}(this),(new Date(b.getFullYear(),0,1,0,0,0)).getTime();default:return 0}else if(0Math.round(va.getMonthDays(b)/2)?1:0,(new Date(b.getFullYear(),b.getMonth()+c,1,0,0,0)).getTime();case "year":return b= -function(){var b=new Date;b.setTime(a);return b}(this),c=a>(new Date(b.getFullYear(),6,2,0,0,0)).getTime()?1:0,(new Date(b.getFullYear()+c,0,1,0,0,0)).getTime();default:return 0}};Da.snapToWeekDay=function(a,b){var c=new Date;c.setTime(a);var c=c.getDay(),e=0;switch(b.toLowerCase()){case "sunday":e=0;break;case "monday":e=1;break;case "tuesday":e=2;break;case "wednesday":e=3;break;case "thursday":e=4;break;case "friday":e=5;break;case "saturday":e=6;break;default:throw new J.Error("unknown week day '{0}'", -null,b,{fileName:"Dates.hx",lineNumber:186,className:"Dates",methodName:"snapToWeekDay"});}return a-864E5*((c-e)%7)};Da.canParse=function(a){return Da._reparse.match(a)};Da.parse=function(a){var a=a.split("."),b=u.strDate(I.replace(a[0],"T"," "));if(1a.indexOf('"')?'"'+a+'"': -0>a.indexOf("'")?"'"+a+"'":'"'+I.replace(a,'"','\\"')+'"';case "Date":return Da.format(a);default:return r.string(a)}case 7:return Zd.string(a);case 8:return"";case 5:return""}};da.compare=function(a,b){if(null==a&&null==b)return 0;if(null==a)return-1;if(null==b)return 1;var c=K["typeof"](a);switch(c[1]){case 1:case 2:return ab?1:0;case 3:return a==b?0:a?-1:1;case 4:return ea.compare(a,b);case 6:switch(K.getClassName(c[2])){case "Array":return z.compare(a,b);case "String":return D.compare(a, -b);case "Date":return C.compare(a.getTime(),b.getTime());default:return D.compare(r.string(a),r.string(b))}case 7:return Zd.compare(a,b);default:return 0}};da.comparef=function(a){a=K["typeof"](a);switch(a[1]){case 1:case 2:return C.compare;case 3:return pb.compare;case 4:return ea.compare;case 6:switch(K.getClassName(a[2])){case "Array":return z.compare;case "String":return D.compare;case "Date":return Da.compare;default:return function(a,c){return D.compare(r.string(a),r.string(c))}}case 7:return Zd.compare; -default:return da.compare}};da.clone=function(a,b){null==b&&(b=!1);var c=K["typeof"](a);switch(c[1]){case 0:return null;case 1:case 2:case 3:case 7:case 8:case 5:return a;case 4:var e={};ea.copyTo(a,e);return e;case 6:switch(c=c[2],K.getClassName(c)){case "Array":e=[];for(c=0;ca?0:1c?c:a};C.clampSym=function(a,b){return a<-b?-b:a>b?b:a};C.range=function(a,b,c,e){null==e&&(e=!1);null==c&&(c=1);null==b&&(b=a,a=0);if((b-a)/c==Math.POSITIVE_INFINITY)throw new J.Error("infinite range",null,null,{fileName:"Floats.hx",lineNumber:50,className:"Floats",methodName:"range"});var f=[],h=-1;if(e)if(0>c)for(;(e=a+c*++h)>=b;)f.push(e);else for(;(e= -a+c*++h)<=b;)f.push(e);else if(0>c)for(;(e=a+c*++h)>b;)f.push(e);else for(;(e=a+c*++h)a?-1:1};C.abs=function(a){return 0>a?-a:a};C.min=function(a,b){return ab?a:b};C.wrap=function(a,b,c){c=c-b+1;aa&&(a+=b);return a};C.interpolate=function(a,b,c,e){null==c&&(c=1);null==b&&(b=0);if(null==e)e=A.Equations.linear;return b+e(a)*(c-b)};C.interpolatef= -function(a,b,c){null==b&&(b=1);null==a&&(a=0);if(null==c)c=A.Equations.linear;var e=b-a;return function(b){return a+c(b)*e}};C.interpolateClampf=function(a,b,c){if(null==c)c=A.Equations.linear;return function(e,f){var h=f-e;return function(f){return e+c(C.clamp(f,a,b))*h}}};C.format=function(a,b,c,e){return C.formatf(b,c,e)(a)};C.formatf=function(a,b,c){var b=p.FormatParams.params(a,b,"D"),a=b.shift(),e=0b?1:0};C.isNumeric=function(a){return G.__instanceof(a,Bc)||G.__instanceof(a,Dd)};C.equals=function(a,b,c){null==c&&(c=1.0E-5);return Math.isNaN(a)?Math.isNaN(b):Math.isNaN(b)?!1:!Math.isFinite(a)&&!Math.isFinite(b)?0b?"0"+b:""+b)+ -"-"+(10>c?"0"+c:""+c)+" "+(10>e?"0"+e:""+e)+":"+(10>f?"0"+f:""+f)+":"+(10>h?"0"+h:""+h)};u.strDate=function(a){switch(a.length){case 8:var a=a.split(":"),b=new Date;b.setTime(0);b.setUTCHours(a[0]);b.setUTCMinutes(a[1]);b.setUTCSeconds(a[2]);return b;case 10:return a=a.split("-"),new Date(a[0],a[1]-1,a[2],0,0,0);case 19:return a=a.split(" "),b=a[0].split("-"),a=a[1].split(":"),new Date(b[0],b[1]-1,b[2],a[0],a[1],a[2]);default:throw"Invalid date format : "+a;}};u.cca=function(a,b){var c=a.charCodeAt(b); -return c!=c?void 0:c};u.substr=function(a,b,c){if(null!=b&&0!=b&&null!=c&&0>c)return"";if(null==c)c=a.length;0>b?(b=a.length+b,0>b&&(b=0)):0>c&&(c=a.length+c-b);return a.substr(b,c)};u.remove=function(a,b){for(var c=0,e=a.length;c>>24& --1};ba.B3=function(a){return a>>>16&255};ba.B2=function(a){return a>>>8&255};ba.B1=function(a){return a&255};ba.abs=function(a){return Math.abs(a)|0};ba.add=function(a,b){return a+b};ba.alphaFromArgb=function(a){return a>>>24&-1};ba.and=function(a,b){return a&b};ba.baseEncode=function(a,b){if(2>b||36a?"-"+c:c};ba.complement=function(a){return~a}; -ba.compare=function(a,b){return a-b};ba.div=function(a,b){return a/b|0};ba.encodeBE=function(a){var b=new Ca;b.b.push(a>>>24&-1);b.b.push(a>>>16&255);b.b.push(a>>>8&255);b.b.push(a&255);return b.getBytes()};ba.encodeLE=function(a){var b=new Ca;b.b.push(a&255);b.b.push(a>>>8&255);b.b.push(a>>>16&255);b.b.push(a>>>24&-1);return b.getBytes()};ba.decodeBE=function(a,b){null==b&&(b=0);var c=a.b[b+3],e=a.b[b+2],f=a.b[b+1],h=a.b[b];return c+(e<<8)+(f<<16)+(h<<24)};ba.decodeLE=function(a,b){null==b&&(b=0); -var c=a.b[b],e=a.b[b+1],f=a.b[b+2],h=a.b[b+3];return c+(e<<8)+(f<<16)+(h<<24)};ba.eq=function(a,b){return a==b};ba.gt=function(a,b){return a>b};ba.gteq=function(a,b){return a>=b};ba.lt=function(a,b){return a>>24&-1);b.b.push(a[f]>>>16&255);b.b.push(a[f]>>>8&255);b.b.push(a[f]&255)}return b.getBytes()};ba.packLE=function(a){for(var b=new Ca,c=0,e=a.length;c>>8&255);b.b.push(a[f]>>>16&255);b.b.push(a[f]>>>24&-1)}return b.getBytes()};ba.rgbFromArgb=function(a){return a&16777215};ba.sub=function(a,b){return a-b};ba.shl=function(a,b){return a<>b};ba.toColor= -function(a){return{alpha:a>>>24&-1,color:a&16777215}};ba.toFloat=function(a){return 1*a};ba.toInt=function(a){return a&-1};ba.toNativeArray=function(a){return a};ba.unpackLE=function(a){if(null==a||0==a.length)return[];if(0!=a.length%4)throw"Buffer not multiple of 4 bytes";for(var b=[],c=0,e=0,f=a.length;c>>b};ba.xor=function(a,b){return a^b};var Cc=function(){this.h={}};j.IntHash=Cc;Cc.__name__=["IntHash"];Cc.prototype={iterator:function(){return{ref:this.h,it:this.keys(),hasNext:function(){return this.it.hasNext()},next:function(){return this.ref[this.it.next()]}}},keys:function(){var a=[],b;for(b in this.h)this.h.hasOwnProperty(b)&&a.push(b|0);return u.iter(a)},remove:function(a){if(!this.h.hasOwnProperty(a))return!1;delete this.h[a]; -return!0},exists:function(a){return this.h.hasOwnProperty(a)},get:function(a){return this.h[a]},set:function(a,b){this.h[a]=b},h:null,__class__:Cc};var mc=function(){};j.IntHashes=mc;mc.__name__=["IntHashes"];mc.empty=function(a){return 0==mc.count(a)};mc.count=function(a){for(var b=0,a=a.iterator();a.hasNext();)a.next(),b++;return b};mc.clear=function(a){a.h={};if(null!=a.h.__proto__)a.h.__proto__=null,delete a.h.__proto__};var ve=function(a,b){this.min=a;this.max=b};j.IntIter=ve;ve.__name__=["IntIter"]; -ve.prototype={max:null,min:null,__class__:ve};var N=function(){};j.Ints=N;N.__name__=["Ints"];N.range=function(a,b,c){null==c&&(c=1);null==b&&(b=a,a=0);if((b-a)/c==Math.POSITIVE_INFINITY)throw new J.Error("infinite range",null,null,{fileName:"Ints.hx",lineNumber:19,className:"Ints",methodName:"range"});var e=[],f=-1,h;if(0>c)for(;(h=a+c*++f)>b;)e.push(h);else for(;(h=a+c*++f)a?-1:1};N.abs=function(a){return 0>a?-a:a};N.min=function(a,b){return a< -b?a:b};N.max=function(a,b){return a>b?a:b};N.wrap=function(a,b,c){return Math.round(C.wrap(a,b,c))};N.clamp=function(a,b,c){return ac?c:a};N.clampSym=function(a,b){return a<-b?-b:a>b?b:a};N.interpolate=function(a,b,c,e){null==c&&(c=100);null==b&&(b=0);if(null==e)e=A.Equations.linear;return Math.round(b+e(a)*(c-b))};N.interpolatef=function(a,b,c){null==b&&(b=1);null==a&&(a=0);if(null==c)c=A.Equations.linear;var e=b-a;return function(b){return Math.round(a+c(b)*e)}};N.format=function(a,b,c,e){return N.formatf(b, -c,e)(a)};N.formatf=function(a,b,c){return C.formatf(null,p.FormatParams.params(a,b,"I"),c)};N.canParse=function(a){return N._reparse.match(a)};N.parse=function(a){"+"==u.substr(a,0,1)&&(a=u.substr(a,1,null));return r.parseInt(a)};N.compare=function(a,b){return a-b};var Ra=function(){};j.Iterables=Ra;Ra.__name__=["Iterables"];Ra.count=function(a){return M.count(pa(a)())};Ra.indexOf=function(a,b,c){return M.indexOf(pa(a)(),b,c)};Ra.contains=function(a,b,c){return M.contains(pa(a)(),b,c)};Ra.array=function(a){return M.array(pa(a)())}; -Ra.join=function(a,b){null==b&&(b=", ");return M.array(pa(a)()).join(b)};Ra.map=function(a,b){return M.map(pa(a)(),b)};Ra.each=function(a,b){return M.each(pa(a)(),b)};Ra.filter=function(a,b){return M.filter(pa(a)(),b)};Ra.reduce=function(a,b,c){return M.reduce(pa(a)(),b,c)};Ra.random=function(a){return z.random(M.array(pa(a)()))};Ra.any=function(a,b){return M.any(pa(a)(),b)};Ra.all=function(a,b){return M.all(pa(a)(),b)};Ra.last=function(a){return M.last(pa(a)())};Ra.lastf=function(a,b){return M.lastf(pa(a)(), -b)};Ra.first=function(a){return pa(a)().next()};Ra.firstf=function(a,b){return M.firstf(pa(a)(),b)};Ra.order=function(a,b){return z.order(M.array(pa(a)()),b)};Ra.isIterable=function(a){var b=m.isObject(a)&&null==K.getClass(a)?m.fields(a):K.getInstanceFields(K.getClass(a));return!pe.has(b,"iterator")?!1:m.isFunction(m.field(a,"iterator"))};var M=function(){};j.Iterators=M;M.__name__=["Iterators"];M.count=function(a){for(var b=0;a.hasNext();)a.next(),b++;return b};M.indexOf=function(a,b,c){null==c&& -(c=function(a){return b==a});for(var e=0;a.hasNext();){var f=a.next();if(c(f))return e;e++}return-1};M.contains=function(a,b,c){for(null==c&&(c=function(a){return b==a});a.hasNext();){var e=a.next();if(c(e))return!0}return!1};M.array=function(a){for(var b=[];a.hasNext();){var c=a.next();b.push(c)}return b};M.join=function(a,b){null==b&&(b=", ");return M.array(a).join(b)};M.map=function(a,b){for(var c=[],e=0;a.hasNext();){var f=a.next();c.push(b(f,e++))}return c};M.each=function(a,b){for(var c=0;a.hasNext();){var e= -a.next();b(e,c++)}};M.filter=function(a,b){for(var c=[];a.hasNext();){var e=a.next();b(e)&&c.push(e)}return c};M.reduce=function(a,b,c){for(var e=0;a.hasNext();)var f=a.next(),c=b(c,f,e++);return c};M.random=function(a){return z.random(M.array(a))};M.any=function(a,b){for(;a.hasNext();){var c=a.next();if(b(c))return!0}return!1};M.all=function(a,b){for(;a.hasNext();){var c=a.next();if(!b(c))return!1}return!0};M.last=function(a){for(var b=null;a.hasNext();)b=a.next();return b};M.lastf=function(a,b){var c= -M.array(a);c.reverse();return z.lastf(c,b)};M.first=function(a){return a.next()};M.firstf=function(a,b){for(;a.hasNext();){var c=a.next();if(b(c))return c}return null};M.order=function(a,b){return z.order(M.array(a),b)};M.isIterator=function(a){var b=m.isObject(a)&&null==K.getClass(a)?m.fields(a):K.getInstanceFields(K.getClass(a));return!pe.has(b,"next")||!pe.has(b,"hasNext")?!1:m.isFunction(m.field(a,"next"))&&m.isFunction(m.field(a,"hasNext"))};var pe=function(){};j.Lambda=pe;pe.__name__=["Lambda"]; -pe.has=function(a,b,c){if(null==c)for(c=pa(a)();c.hasNext();){if(a=c.next(),a==b)return!0}else for(var e=pa(a)();e.hasNext();)if(a=e.next(),c(a,b))return!0;return!1};var we=function(){};j.List=we;we.__name__=["List"];we.prototype={iterator:function(){return{h:this.h,hasNext:function(){return null!=this.h},next:function(){if(null==this.h)return null;var a=this.h[0];this.h=this.h[1];return a}}},h:null,__class__:we};var ea=function(){};j.Objects=ea;ea.__name__=["Objects"];ea.field=function(a,b,c){return m.hasField(a, -b)?m.field(a,b):c};ea.keys=function(a){return m.fields(a)};ea.values=function(a){for(var b=[],c=0,e=m.fields(a);c=a?0:Math.floor(Math.random()*a)};var fb=function(){this.b=""};j.StringBuf=fb;fb.__name__=["StringBuf"];fb.prototype={toString:function(){return this.b},addSub:function(a,b,c){this.b+=u.substr(a,b,c)},addChar:function(a){this.b+=String.fromCharCode(a)},add:function(a){this.b+=r.string(a)},b:null,__class__:fb};var I=function(){};j.StringTools=I;I.__name__=["StringTools"];I.urlEncode=function(a){return encodeURIComponent(a)}; -I.urlDecode=function(a){return decodeURIComponent(a.split("+").join(" "))};I.htmlEscape=function(a){return a.split("&").join("&").split("<").join("<").split(">").join(">")};I.htmlUnescape=function(a){return a.split(">").join(">").split("<").join("<").split("&").join("&")};I.startsWith=function(a,b){return a.length>=b.length&&u.substr(a,0,b.length)==b};I.endsWith=function(a,b){var c=b.length,e=a.length;return e>=c&&u.substr(a,e-c,c)==b};I.isSpace=function(a,b){var c=u.cca(a,b); -return 9<=c&&13>=c||32==c};I.ltrim=function(a){for(var b=a.length,c=0;c=c)return a;for(var h=b.length;f>>=4;while(0=c};I.isAlpha=function(a,b){var c=u.cca(a,b);return 65<=c&&90>=c||97<=c&&122>=c};I.num=function(a,b){var c=u.cca(a,b);return 0c||9g;){l=g++;l=D._reFormat.matched(l);if(null==l||""==l)break;B.push(p.FormatParams.cleanQuotes(l))}g=[D._reFormat.matchedLeft()]; -e.push(function(a){return function(){return a[0]}}(g));h=[da.formatf(h,B,b,c)];e.push(function(){return function(a,b){return function(){return function(c){return a(b,c)}}()}}()(function(a){return function(b,c){return a[0](c[b])}}(h),f));a=D._reFormat.matchedRight()}return function(a){null==a&&(a=[]);return e.map(function(b){return b(a)}).join("")}};D.formatOne=function(a,b,c,e){return D.formatOnef(b,c,e)(a)};D.formatOnef=function(a,b){var b=p.FormatParams.params(a,b,"S"),c=b.shift();switch(c){case "S":return function(a){return a}; -case "T":return c=1>b.length?20:r.parseInt(b[0]),D.ellipsisf(c,2>b.length?"...":b[1]);case "PR":var e=1>b.length?10:r.parseInt(b[0]),f=2>b.length?" ":b[1];return function(a){return I.rpad(a,f,e)};case "PL":var h=1>b.length?10:r.parseInt(b[0]),l=2>b.length?" ":b[1];return function(a){return I.lpad(a,l,h)};default:throw"Unsupported string format: "+c;}};D.upTo=function(a,b){var c=a.indexOf(b);return 0>c?a:u.substr(a,0,c)};D.startFrom=function(a,b){var c=a.indexOf(b);return 0>c?a:u.substr(a,c+b.length, -null)};D.rtrim=function(a,b){for(var c=a.length;0b.indexOf(e))break;c--}return u.substr(a,0,c)};D.ltrim=function(a,b){for(var c=0;cb.indexOf(e))break;c++}return u.substr(a,c,null)};D.trim=function(a,b){return D.rtrim(D.ltrim(a,b),b)};D.collapse=function(a){return D._reCollapse.replace(I.trim(a)," ")};D.ucfirst=function(a){return null==a?null:a.charAt(0).toUpperCase()+u.substr(a,1,null)};D.lcfirst=function(a){return null==a?null: -a.charAt(0).toLowerCase()+u.substr(a,1,null)};D.empty=function(a){return null==a||""==a};D.isAlphaNum=function(a){return null==a?!1:D.__alphaNumPattern.match(a)};D.digitsOnly=function(a){return null==a?!1:D.__digitsPattern.match(a)};D.ucwords=function(a){return D.__ucwordsPattern.customReplace(null==a?null:a.charAt(0).toUpperCase()+u.substr(a,1,null),D.__upperMatch)};D.ucwordsws=function(a){return D.__ucwordswsPattern.customReplace(null==a?null:a.charAt(0).toUpperCase()+u.substr(a,1,null),D.__upperMatch)}; -D.__upperMatch=function(a){return a.matched(0).toUpperCase()};D.humanize=function(a){return I.replace(D.underscore(a),"_"," ")};D.capitalize=function(a){return u.substr(a,0,1).toUpperCase()+u.substr(a,1,null)};D.succ=function(a){return u.substr(a,0,-1)+String.fromCharCode(u.cca(u.substr(a,-1,null),0)+1)};D.underscore=function(a){a=(new T("::","g")).replace(a,"/");a=(new T("([A-Z]+)([A-Z][a-z])","g")).replace(a,"$1_$2");a=(new T("([a-z\\d])([A-Z])","g")).replace(a,"$1_$2");a=(new T("-","g")).replace(a, -"_");return a.toLowerCase()};D.dasherize=function(a){return I.replace(a,"_","-")};D.repeat=function(a,b){for(var c=[],e=0;e=l-B){f.push(u.substr(a, -h,null));break}for(var g=0;!I.isSpace(a,h+b-g)&&gb?0:a.length-b-1},h=[],l=[],B=[],g=[];e(a,h,l);e(b,B,g);for(var k=[],a=0,b=N.min(h.length,B.length);ae.length;)e.splice(0,0," ");for(;e.length>c.length;)c.splice(0,0," ");for(var f= -[],h=0,l=c.length;hb?u.substr(a,0,N.max(c.length,b-c.length))+c:a};D.ellipsisf=function(a,b){null==b&&(b="...");null==a&&(a=20);return function(c){return c.length>a?u.substr(c,0,N.max(b.length,a-b.length))+b:c}};D.compare=function(a,b){return ab?1:0};var ia={__ename__:["ValueType"],__constructs__:"TNull,TInt,TFloat,TBool,TObject,TFunction,TClass,TEnum,TUnknown".split(","),TNull:["TNull",0]};ia.TNull.toString=v;ia.TNull.__enum__=ia; -ia.TInt=["TInt",1];ia.TInt.toString=v;ia.TInt.__enum__=ia;ia.TFloat=["TFloat",2];ia.TFloat.toString=v;ia.TFloat.__enum__=ia;ia.TBool=["TBool",3];ia.TBool.toString=v;ia.TBool.__enum__=ia;ia.TObject=["TObject",4];ia.TObject.toString=v;ia.TObject.__enum__=ia;ia.TFunction=["TFunction",5];ia.TFunction.toString=v;ia.TFunction.__enum__=ia;ia.TClass=function(a){a=["TClass",6,a];a.__enum__=ia;a.toString=v;return a};ia.TEnum=function(a){a=["TEnum",7,a];a.__enum__=ia;a.toString=v;return a};ia.TUnknown=["TUnknown", -8];ia.TUnknown.toString=v;ia.TUnknown.__enum__=ia;var K=function(){};j.Type=K;K.__name__=["Type"];K.getClass=function(a){return null==a?null:a.__class__};K.getEnum=function(a){return null==a?null:a.__enum__};K.getSuperClass=function(a){return a.__super__};K.getClassName=function(a){return a.__name__.join(".")};K.getEnumName=function(a){return a.__ename__.join(".")};K.resolveClass=function(a){a=j[a];return null==a||!a.__name__?null:a};K.createInstance=function(a,b){switch(b.length){case 0:return new a; -case 1:return new a(b[0]);case 2:return new a(b[0],b[1]);case 3:return new a(b[0],b[1],b[2]);case 4:return new a(b[0],b[1],b[2],b[3]);case 5:return new a(b[0],b[1],b[2],b[3],b[4]);case 6:return new a(b[0],b[1],b[2],b[3],b[4],b[5]);case 7:return new a(b[0],b[1],b[2],b[3],b[4],b[5],b[6]);case 8:return new a(b[0],b[1],b[2],b[3],b[4],b[5],b[6],b[7]);default:throw"Too many arguments";}};K.createEmptyInstance=function(a){function b(){}b.prototype=a.prototype;return new b};K.createEnum=function(a,b,c){var e= -m.field(a,b);if(null==e)throw"No such constructor "+b;if(m.isFunction(e)){if(null==c)throw"Constructor "+b+" need parameters";return e.apply(a,c)}if(null!=c&&0!=c.length)throw"Constructor "+b+" does not need parameters";return e};K.getInstanceFields=function(a){var b=[],c;for(c in a.prototype)b.push(c);u.remove(b,"__class__");u.remove(b,"__properties__");return b};K["typeof"]=function(a){switch(typeof a){case "boolean":return ia.TBool;case "string":return ia.TClass(String);case "number":return Math.ceil(a)== -a%2147483648?ia.TInt:ia.TFloat;case "object":if(null==a)return ia.TNull;var b=a.__enum__;if(null!=b)return ia.TEnum(b);a=a.__class__;return null!=a?ia.TClass(a):ia.TObject;case "function":return a.__name__||a.__ename__?ia.TObject:ia.TFunction;case "undefined":return ia.TNull;default:return ia.TUnknown}};K.enumEq=function(a,b){if(a==b)return!0;try{if(a[0]!=b[0])return!1;for(var c=2,e=a.length;c=this.textSize)throw"Block size "+a+" to small for Pkcs1 with padCount "+this.padCount;return a},setPadCount:function(a){if(a+3>=this.blockSize)throw"Internal padding size exceeds crypt block size";this.padCount=a;this.textSize=this.blockSize-3-this.padCount;return a},blockOverhead:function(){return 3+this.padCount},isBlockPad:function(){return!0}, -calcNumBlocks:function(a){return Math.ceil(a/this.textSize)},unpad:function(a){for(var b=0,c=new Ca;ba.length-b-3-this.padCount)throw"Unexpected short message";if(a.b[b]!=this.typeByte)throw"Expected marker "+this.typeByte+" at position "+b+" ["+la.hexDump(a)+"]";if(++b>=a.length)break;for(;bthis.textSize)throw"Unable to pad block: provided buffer is "+ -a.length+" max is "+this.textSize;var b=new Ca;b.b.push(0);b.b.push(this.typeByte);for(var c=this.blockSize-a.length-3;0>3},doPublic:function(a){return a.modPowInt(this.e,this.n)},doBufferDecrypt:function(a,b,c){for(var e=this.__getBlockSize(),f=e-11,h=0,l=new Ca;ha.length&&(e=a.length-h); -var B=n.ofBytes(a.sub(h,e),!0),B=b(B);if(null==B)return null;B=c.unpad(B.toBytesUnsigned());if(B.length>f)throw"block text length error";l.add(B);h+=e}return l.getBytes()},doBufferEncrypt:function(a,b,c){for(var e=this.__getBlockSize()-11,f=0,h=new Ca;fa.length&&(e=a.length-f);var l=n.ofBytes(c.pad(a.sub(f,e)),!0),l=b(l).toBytesUnsigned();0!=(l.length&1)&&h.b.push(0);h.add(l);f+=e}return h.getBytes()},verify:function(a){return this.doBufferDecrypt(a,y(this,this.doPublic),new Y.PadPkcs1Type1(this.__getBlockSize()))}, -setPublic:function(a,b){this.init();if(null==a||0==a.length)throw new F.NullPointerException("nHex not set: "+a);if(null==b||0==b.length)throw new F.NullPointerException("eHex not set: "+b);var c=la.cleanHexFormat(a);this.n=n.ofString(c,16);if(null==this.n)throw 2;c=r.parseInt("0x"+la.cleanHexFormat(b));if(null==c||0==c)throw 3;this.e=c},encyptText:function(a){return la.toHex(this.encrypt(na.ofString(a)),":")},encryptBlock:function(a){var b=this.__getBlockSize();if(a.length!=b)throw"bad block size"; -for(var a=this.doPublic(n.ofBytes(a,!0)).toBytesUnsigned(),c=a.length,e=0;c>b;){if(0!=a.b[e])throw new F.FatalException("encoded length was "+a.length);e++;c--}0!=e&&(a=a.sub(e,c));if(a.length>1;e.e=r.parseInt(I.startsWith(b,"0x")?b:"0x"+b);for(var h=n.ofInt(e.e);;){e.p=n.randomPrime(a-f,h,10,!0,c);e.q=n.randomPrime(f,h,10,!0, -c);if(0>=e.p.compare(e.q)){var l=e.p;e.p=e.q;e.q=l}var l=e.p.sub(n.getONE()),B=e.q.sub(n.getONE()),g=l.mul(B);if(0==g.gcd(h).compare(n.getONE())){e.n=e.p.mul(e.q);e.d=h.modInverse(g);e.dmp1=e.d.mod(l);e.dmq1=e.d.mod(B);e.coeff=e.q.modInverse(e.p);break}}return e};Y.RSA.__super__=Y.RSAEncrypt;Y.RSA.prototype=E(Y.RSAEncrypt.prototype,{toString:function(){var a=new fb;a.b+=r.string(Y.RSAEncrypt.prototype.toString.call(this));a.b+="Private:\n";a.b+=r.string("D:\t"+this.d.toHex()+"\n");null!=this.p&&(a.b+= -r.string("P:\t"+this.p.toHex()+"\n"));null!=this.q&&(a.b+=r.string("Q:\t"+this.q.toHex()+"\n"));null!=this.dmp1&&(a.b+=r.string("DMP1:\t"+this.dmp1.toHex()+"\n"));null!=this.dmq1&&(a.b+=r.string("DMQ1:\t"+this.dmq1.toHex()+"\n"));null!=this.coeff&&(a.b+=r.string("COEFF:\t"+this.coeff.toHex()+"\n"));return a.b},doPrivate:function(a){if(null==this.p||null==this.q)return a.modPow(this.d,this.n);for(var b=a.mod(this.p).modPow(this.dmp1,this.p),a=a.mod(this.q).modPow(this.dmq1,this.q);0>b.compare(a);)b= -b.add(this.p);return b.sub(a).mul(this.coeff).mod(this.p).mul(this.q).add(a)},recalcCRT:function(){if(null!=this.p&&null!=this.q){if(null==this.dmp1)this.dmp1=this.d.mod(this.p.sub(n.getONE()));if(null==this.dmq1)this.dmq1=this.d.mod(this.q.sub(n.getONE()));if(null==this.coeff)this.coeff=this.q.modInverse(this.p)}},setPrivateEx:function(a,b,c,e,f,h,l,B){this.init();this.setPrivate(a,b,c);if(null!=e&&null!=f){this.p=n.ofString(la.cleanHexFormat(e),16);this.q=n.ofString(la.cleanHexFormat(f),16);this.coeff= -this.dmq1=this.dmp1=null;if(null!=h)this.dmp1=n.ofString(la.cleanHexFormat(h),16);if(null!=l)this.dmq1=n.ofString(la.cleanHexFormat(l),16);if(null!=B)this.coeff=n.ofString(la.cleanHexFormat(B),16);this.recalcCRT()}else throw"Invalid RSA private key ex";},setPrivate:function(a,b,c){this.init();Y.RSAEncrypt.prototype.setPublic.call(this,a,b);if(null!=c&&0this.__getBlockSize();){b=a.length- -this.__getBlockSize();for(e=0;eb||0>c||b+c>a.length)throw new F.OutsideBoundsException; -for(;0b||0>c||b+c>a.length)throw new F.OutsideBoundsException;this.b=a.b;this.pos=b;this.len=c;this.__setEndian(!1)};j["chx.io.BytesInput"]=Ea.BytesInput;Ea.BytesInput.__name__= -["chx","io","BytesInput"];Ea.BytesInput.__super__=Ea.Input;Ea.BytesInput.prototype=E(Ea.Input.prototype,{getPosition:function(){return this.pos},setPosition:function(a){this.len+=this.getPosition()-a;return this.pos=a},peek:function(a){null==a&&(a=this.getPosition());var b=this.getPosition();this.setPosition(a);a=this.readByte();this.setPosition(b);return a},__getBytesAvailable:function(){return 0<=this.len?this.len:0},readBytes:function(a,b,c){if(0>b||0>c||b+c>a.length)throw new F.OutsideBoundsException; -if(0==this.len&&0>>24)),this.writeByte(Rb.toInt(a>>>16)&255),this.writeByte(Rb.toInt(a>>>8)&255), -this.writeByte(Rb.toInt(a&255))):(this.writeByte(Rb.toInt(a&255)),this.writeByte(Rb.toInt(a>>>8)&255),this.writeByte(Rb.toInt(a>>>16)&255),this.writeByte(Rb.toInt(a>>>24)));return this},writeUInt30:function(a){if(0>a||1073741824<=a)throw new F.OverflowException;this.bigEndian?(this.writeByte(a>>>24),this.writeByte(a>>16&255),this.writeByte(a>>8&255),this.writeByte(a&255)):(this.writeByte(a&255),this.writeByte(a>>8&255),this.writeByte(a>>16&255),this.writeByte(a>>>24));return this},writeInt31:function(a){if(-1073741824> -a||1073741824<=a)throw new F.OverflowException;this.bigEndian?(this.writeByte(a>>>24),this.writeByte(a>>16&255),this.writeByte(a>>8&255),this.writeByte(a&255)):(this.writeByte(a&255),this.writeByte(a>>8&255),this.writeByte(a>>16&255),this.writeByte(a>>>24));return this},writeUInt24:function(a){if(0>a||16777216<=a)throw new F.OverflowException;this.bigEndian?(this.writeByte(a>>16),this.writeByte(a>>8&255),this.writeByte(a&255)):(this.writeByte(a&255),this.writeByte(a>>8&255),this.writeByte(a>>16)); -return this},writeInt24:function(a){if(-8388608>a||8388608<=a)throw new F.OverflowException;this.writeUInt24(a&16777215);return this},writeUInt16:function(a){if(0>a||65536<=a)throw new F.OverflowException;this.bigEndian?(this.writeByte(a>>8),this.writeByte(a&255)):(this.writeByte(a&255),this.writeByte(a>>8));return this},writeInt16:function(a){if(-32768>a||32768<=a)throw new F.OverflowException;this.writeUInt16(a&65535);return this},writeUInt8:function(a){return this.writeByte(a)},writeInt8:function(a){if(-128> -a||128<=a)throw new F.OverflowException;this.writeByte(a&255);return this},writeDouble:function(a){this.write(Wa.doubleToBytes(a,this.bigEndian));return this},writeFloat:function(a){this.write(Wa.floatToBytes(a,this.bigEndian));return this},writeFullBytes:function(a,b,c){for(;0b||0>c||b+c>a.length)throw new F.OutsideBoundsException;for(;0x?(x=2,g=0):i='** sprintf: "." came too late **';break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:48==h&&0==x?k|=1:3==x?i="** sprintf: shouldn't have a digit after h,l,L **":2>x?(x=1,B=10*B+(h-48)):g=10*g+(h-48);break;case 100:case 105:i= -!0;c+=aa.Sprintf.formatD(l,k,B,g);break;case 111:i=!0;c+=aa.Sprintf.formatO(l,k,B,g);break;case 120:case 88:i=!0;c+=aa.Sprintf.formatX(l,k,B,g,88==h);break;case 101:case 69:i=!0;c+=aa.Sprintf.formatE(l,k,B,g,69==h);break;case 102:i=!0;c+=aa.Sprintf.formatF(l,k,B,g);break;case 103:case 71:i=!0;c+=aa.Sprintf.formatG(l,k,B,g,71==h);break;case 99:case 67:case 115:case 83:if(99==h||67==h)g=1;i=!0;c+=aa.Sprintf.formatS(l,k,B,g);break;case 37:i=!0;c+="%";e--;break;default:i="** sprintf: "+r.string(h-48)+ -" not supported **"}!0!=i&&aa.Sprintf.DEBUG&&(c+=r.string(i))}return c};aa.Sprintf.finish=function(a,b,c,e,f,h){null==h&&(h="");null==h&&(h="");0>b?h="-"+h:0!=(c&4)?h="+"+h:0!=(c&8)&&(h=" "+h);0==e&&-1Math.abs(a);)a*=10,h--;f=aa.Sprintf.format("%c%+.2d",[f?"E":"e",h]);if(0!=(b&2))for(h=aa.Sprintf.formatF(a,b,1,e)+f;h.lengthe&&(h=Math.round(Math.pow(10,e)*aa.Sprintf.number("0."+h)),r.string(h).length>e&&0!=h?(h="0",f=r.string((Math.abs(aa.Sprintf.number(f))+1)*(0<=aa.Sprintf.number(f)?1:-1))):h=r.string(h)),h.length=c)return!1;this.lock++;return!0},lock:null,__class__:ne.Lock};var qa,Vb,ec,$d,kb,ae,Dc,be,Ec,ce,fa,de,Fc,ee,Lb,Gc,fe,Hc,ge,Ic,he,Fa,Na,Aa,Ga,ua,wa,S,fc,nc,oc,Ed,yb,ie,Uc,gc,xe,qe,zb,Fd,Jc,Gd,re,Hd,Vc,xa,Sa;qa=function(a){this.selection=a};j["dhx.Access"]=qa;qa.__name__=["dhx","Access"];qa.getData=function(a){return m.field(a, -"__dhx_data__")};qa.setData=function(a,b){a.__dhx_data__=b};qa.emptyHtmlDom=function(a){return{__dhx_data__:a}};qa.eventName=function(a){return"__dhx_on__"+a};qa.getEvent=function(a,b){return m.field(a,"__dhx_on__"+b)};qa.hasEvent=function(a,b){return null!=m.field(a,"__dhx_on__"+b)};qa.addEvent=function(a,b,c){a["__dhx_on__"+b]=c};qa.removeEvent=function(a,b){m.deleteField(a,"__dhx_on__"+b)};qa.setTransition=function(a,b){m.hasField(a,"__dhx_transition__")?m.field(a,"__dhx_transition__").owner=b: -a.__dhx_transition__={owner:b}};qa.getTransition=function(a){return m.field(a,"__dhx_transition__")};qa.resetTransition=function(a){m.deleteField(a,"__dhx_transition__")};qa.prototype={_that:function(){return this.selection},selection:null,__class__:qa};Vb=function(a,b){qa.call(this,b);this.name=a;this.qname=ec.qualify(a)};j["dhx.AccessAttribute"]=Vb;Vb.__name__=["dhx","AccessAttribute"];Vb.__super__=qa;Vb.prototype=E(qa.prototype,{"float":function(a){var b=""+a;if(null==this.qname){var c=this.name; -this.selection.eachNode(function(a){a.setAttribute(c,b)})}else{var e=this.qname;this.selection.eachNode(function(a){a.setAttributeNS(e.space,e.local,b)})}return this.selection},string:function(a){if(null==this.qname){var b=this.name;this.selection.eachNode(function(c){c.setAttribute(b,a)})}else{var c=this.qname;this.selection.eachNode(function(b){b.setAttributeNS(c.space,c.local,a)})}return this.selection},remove:function(){if(null==this.qname){var a=this.name;this.selection.eachNode(function(b){b.removeAttribute(a)})}else{var b= -this.qname;this.selection.eachNode(function(a){a.removeAttributeNS(b.space,b.local)})}return this.selection},getFloat:function(){var a=this.get();return Vb.refloat.match(a)?r.parseFloat(Vb.refloat.matched(1)):Math.NaN},get:function(){var a=this.name,b=this.qname;return this.selection.firstNode(function(c){return null==b?c.getAttribute(a):c.getAttributeNS(b.space,b.local)})},qname:null,name:null,__class__:Vb});$d=function(a,b){Vb.call(this,a,b)};j["dhx.AccessDataAttribute"]=$d;$d.__name__=["dhx","AccessDataAttribute"]; -$d.__super__=Vb;$d.prototype=E(Vb.prototype,{data:function(){return this.stringf(function(a){return""+r.string(a)})},floatf:function(a){if(null==this.qname){var b=this.name;this.selection.eachNode(function(c,f){var h=a(m.field(c,"__dhx_data__"),f);null==h?c.removeAttribute(b):c.setAttribute(b,""+h)})}else{var c=this.qname;this.selection.eachNode(function(e,f){var h=a(m.field(e,"__dhx_data__"),f);null==h?e.removeAttributeNS(b):e.setAttributeNS(c.space,c.local,""+h)})}return this.selection},stringf:function(a){if(null== -this.qname){var b=this.name;this.selection.eachNode(function(c,f){var h=a(m.field(c,"__dhx_data__"),f);null==h?c.removeAttribute(b):c.setAttribute(b,h)})}else{var c=this.qname;this.selection.eachNode(function(e,f){var h=a(m.field(e,"__dhx_data__"),f);null==h?e.removeAttributeNS(b):e.setAttributeNS(c.space,c.local,h)})}return this.selection},__class__:$d});kb=function(a){qa.call(this,a)};j["dhx.AccessClassed"]=kb;kb.__name__=["dhx","AccessClassed"];kb.escapeERegChars=function(a){return kb._escapePattern.customReplace(a, -function(a){return"\\"+a.matched(0)})};kb.getRe=function(a){return new T("(^|\\s+)"+kb.escapeERegChars(a)+"(\\s+|$)","g")};kb.__super__=qa;kb.prototype=E(qa.prototype,{get:function(){var a=this.selection.node(),b=a.classList;if(null!=b){for(var a=[],c=0,e=b.length;cb.length)h=b.length;if(le?a:u.substr(a,0,e);if(("mouseenter"==f||"mouseleave"==f)&&!Ga.isIE())b=function(a,b){return function(c,e){return a(b,c,e)}}(wa.listenerEnterLeave,b),f="mouseenter"==f?"mouseover":"mouseout";return this.eachNode(function(e,l){var g=function(a){var c=S.event;S.event=a;try{b(e,l)}catch(f){}S.event=c};null!=m.field(e, -"__dhx_on__"+a)&&(wa.removeEvent(e,f,a,c),m.deleteField(e,"__dhx_on__"+a));null!=b&&(e["__dhx_on__"+a]=g,wa.addEvent(e,f,g,c))})},mapNode:function(a){for(var b=[],c=0,e=this.groups;cb)return null;var c=ec.prefix.get(u.substr(a,0,b));if(null==c)throw"unable to find a namespace for "+c;return new qe(c,u.substr(a,b+1,null))};qe=function(a,b){this.space=a;this.local=b};j["dhx.NSQualifier"]=qe;qe.__name__=["dhx","NSQualifier"];qe.prototype={local:null,space:null,__class__:qe};zb=function(a){wa.call(this,a)};j["dhx.BoundSelection"]=zb;zb.__name__=["dhx","BoundSelection"];zb.__super__=wa;zb.prototype=E(wa.prototype, -{on:function(a,b,c){null==c&&(c=!1);return this.onNode(a,null==b?null:function(a,c){b(m.field(a,"__dhx_data__"),c)},c)},first:function(a){return this.firstNode(function(b){return a(m.field(b,"__dhx_data__"))})},map:function(a){for(var b=[],c=0,e=this.groups;cc.delay)c.flush=c.f(a);c=c.next}a=xa._flush()-b;if(24a?Sa.CUBIC_EQUATION(2*a):2-Sa.CUBIC_EQUATION(2-2*a))};Sa.prototype={_this:function(){return this},createTransition:function(){throw"abstract method";},selectAll:function(a){var b,a=this.createTransition(this.selection.selectAll(a));a._ease=this._ease;var c=this._delay,e=this._duration;b=-1;a.delay(function(a,e){return c[0e._durationMax)e._durationMax=l})):(this._durationMax=b,this.selection.eachNode(function(){e._duration[++c]=e._durationMax})); -return this._this()},delay:function(a,b){null==b&&(b=0);var c=Math.POSITIVE_INFINITY,e=-1,f=this;null!=a?this.selection.eachNode(function(b,l){var g=f._delay[++e]=a(b,l);gl){if(b=!1,0>l)return}else l=1;if(null!=e._stage[c]){if(null==g||g.active!=e._transitionId){e._stage[c]=2;return}}else{if(null==g||g.active>e._transitionId){e._stage[c]=2;return}e._stage[c]=1;null!=e._start&&e._start(f,h);k=e._interpolators[c]=new ca;g.active=e._transitionId;for(i= -e._tweens.keys();i.hasNext();){var x=i.next(),j=e._tweens.get(x);k.set(x,j(f,h))}}i=e._ease(l);for(j=e._tweens.keys();j.hasNext();)x=j.next(),k.get(x)(i);if(1==l&&(e._stage[c]=2,g.active==e._transitionId))l=g.owner,l==e._transitionId&&(m.deleteField(f,"__dhx_transition__"),e._remove&&f.parentNode.removeChild(f)),Sa._inheritid=e._transitionId,null!=e._end&&e._end(f,h),Sa._inheritid=0,g.owner=l}});return b},selection:null,_end:null,_start:null,_step:null,_ease:null,_durationMax:null,_duration:null, -_delay:null,_stage:null,_remove:null,_interpolators:null,_tweens:null,_transitionId:null,__class__:Sa};Ed=function(a){Sa.call(this,a)};j["dhx.UnboundTransition"]=Ed;Ed.__name__=["dhx","UnboundTransition"];Ed.__super__=Sa;Ed.prototype=E(Sa.prototype,{createTransition:function(a){return new Ed(a)},attr:function(a){return new Gc(a,this,this._tweens)},style:function(a){return new Hc(a,this,this._tweens)},text:function(){return new Ic(this,this._tweens)},__class__:Ed});Fd=function(a){Sa.call(this,a)}; -j["dhx.BoundTransition"]=Fd;Fd.__name__=["dhx","BoundTransition"];Fd.__super__=Sa;Fd.prototype=E(Sa.prototype,{createTransition:function(a){return new Fd(a)},end:function(a){return this.endNode(function(b,c){a(m.field(b,"__dhx_data__"),c)})},start:function(a){return this.startNode(function(b,c){a(m.field(b,"__dhx_data__"),c)})},attr:function(a){return new fe(a,this,this._tweens)},style:function(a){return new ge(a,this,this._tweens)},text:function(){return new he(this,this._tweens)},__class__:Fd}); -var hb,rb,se,te;wb={__ename__:["erazor","_Parser","ParseContext"],__constructs__:["literal","code"]};ob=void 0;wb.literal=["literal",0];wb.literal.toString=v;wb.literal.__enum__=wb;wb.code=["code",1];wb.code.toString=v;wb.code.__enum__=wb;ob={__ename__:["erazor","_Parser","ParseResult"],__constructs__:["keepGoing","doneIncludeCurrent","doneSkipCurrent"],keepGoing:["keepGoing",0]};ob.keepGoing.toString=v;ob.keepGoing.__enum__=ob;ob.doneIncludeCurrent=["doneIncludeCurrent",1];ob.doneIncludeCurrent.toString= -v;ob.doneIncludeCurrent.__enum__=ob;ob.doneSkipCurrent=["doneSkipCurrent",2];ob.doneSkipCurrent.toString=v;ob.doneSkipCurrent.__enum__=ob;hb=function(){this.condMatch=new T("^@(?:if|for|while)\\b","");this.inConditionalMatch=new T("^(?:\\}[\\s\r\n]*else if\\b|\\}[\\s\r\n]*else[\\s\r\n]*{)","");this.variableChar=new T("^[_\\w\\.]$","")};j["erazor.Parser"]=hb;hb.__name__=["erazor","Parser"];hb.prototype={parseWithPosition:function(a){this.pos=0;var b=[];this.bracketStack=[];for(this.conditionalStack= -0;""!=a;){this.context=this.parseContext(a);var c=this.parseBlock(a);null!=c.block&&b.push(c);a=u.substr(a,c.length,null);this.pos+=c.length}if(0!=this.bracketStack.length)throw new cc(hb.bracketMismatch,this.pos);return b},parse:function(a){this.pos=0;var b=[];this.bracketStack=[];for(this.conditionalStack=0;""!=a;){this.context=this.parseContext(a);var c=this.parseBlock(a);null!=c.block&&b.push(c.block);a=u.substr(a,c.length,null);this.pos+=c.length}if(0!=this.bracketStack.length)throw new cc(hb.bracketMismatch, -this.pos);return b},escapeLiteral:function(a){return I.replace(a,hb.at+hb.at,hb.at)},parseLiteral:function(a){for(var b=a.length,c=-1;++cc+1&&a.charAt(c+1)!=hb.at)return{block:rb.literal(this.escapeLiteral(u.substr(a,0,c))),length:c,start:this.pos};++c;break;case "}":if(0--this.conditionalStack;break;default:b=!0}if(b)throw new cc(hb.bracketMismatch,this.pos);return{block:rb.codeBlock("}"),length:1,start:this.pos}}if(this.condMatch.match(a))return this.bracketStack.push(wb.code),++this.conditionalStack,this.parseConditional(a); -if("@"==this.peek(a)&&this.isIdentifier(this.peek(a,1)))return this.parseVariable(a);b=this.peek(a,1);var a=this.parseScriptPart(u.substr(a,1,null),b,"{"==b?"}":")"),c=I.trim(u.substr(a,1,a.length-2));return"{"==b?{block:rb.codeBlock(c),length:a.length+1,start:this.pos}:{block:rb.printBlock(c),length:a.length+1,start:this.pos}},parseVariableChar:function(a){return this.variableChar.match(a)?ob.keepGoing:ob.doneSkipCurrent},parseVariable:function(a){var b="",c=null,c=null,a=u.substr(a,1,null);do{c= -this.acceptIdentifier(a);a=u.substr(a,c.length,null);b+=c;for(c=this.peek(a);"("==c||"["==c;)c=this.acceptBracket(a,c),a=u.substr(a,c.length,null),b+=c,c=this.peek(a);if("."==c&&this.isIdentifier(this.peek(a,1)))a=u.substr(a,1,null),b+=".";else break}while(null!=c);return{block:rb.printBlock(b),length:b.length+1,start:this.pos}},peek:function(a,b){null==b&&(b=0);return a.length>b?a.charAt(b):null},parseConditional:function(a){a=this.parseScriptPart(a,"","{");return{block:rb.codeBlock(u.substr(a,1, -null)),length:a.length,start:this.pos}},parseBlock:function(a){return this.context==wb.code?this.parseCodeBlock(a):this.parseLiteral(a)},acceptBracket:function(a,b){return this.parseScriptPart(a,b,"("==b?")":"]")},acceptIdentifier:function(a){var b=!0,c=this;return this.accept(a,function(a){a=c.isIdentifier(a,b);b=!1;return a},!1)},isIdentifier:function(a,b){null==b&&(b=!0);return b?"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"==a:"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"0"<=a&&"9">=a||"_"==a},accept:function(a,b, -c){return this.parseString(a,function(a){return b(a)?ob.keepGoing:ob.doneSkipCurrent},c)},parseContext:function(a){if(this.peek(a)==hb.at&&this.peek(a,1)!=hb.at)return wb.code;if(0h)throw new cc("Unbalanced braces for block: ",this.pos,u.substr(a,0,100));break;case '"':f=!0;break;case "'":e=!0}else f&&'"'==g&&"\\"!=a.charAt(l-1)?f=!1:e&&"'"==g&&"\\"!=a.charAt(l-1)&&(e=!1)}throw new cc("Failed to find a closing delimiter for the script block: ",this.pos,u.substr(a,0,100));},pos:null,conditionalStack:null,bracketStack:null,context:null,variableChar:null,inConditionalMatch:null,condMatch:null,__class__:hb};se=function(a){this.context=a};j["erazor.ScriptBuilder"]=se;se.__name__= -["erazor","ScriptBuilder"];se.prototype={blockToString:function(a){switch(a[1]){case 0:return a=a[2],this.context+".add('"+I.replace(a,"'","\\'")+"');\n";case 1:return a=a[2],a+"\n";case 2:return a=a[2],this.context+".add("+a+");\n"}},build:function(a){for(var b=new fb,c=0;ca;){var b=this.declared.pop();this.locals.set(b.n,b.old)}},duplicate:function(a){for(var b=new ca,c=a.keys();c.hasNext();){var e=c.next();b.set(e,a.get(e))}return b},exprReturn:function(a){try{return this.expr(a)}catch(b){if(G.__instanceof(b, -eb.Stop))switch(b[1]){case 0:throw"Invalid break";case 1:throw"Invalid continue";case 2:return b[2]}else throw b;}return null},execute:function(a){this.locals=new ca;return this.exprReturn(a)},increment:function(a,b,c){switch(a[1]){case 1:var e=a[2],a=this.locals.get(e),f=null==a?this.variables.get(e):a.r;b?(f+=c,null==a?this.variables.set(e,f):a.r=f):null==a?this.variables.set(e,f+c):a.r=f+c;return f;case 5:return e=a[3],a=a[2],a=this.expr(a),f=this.get(a,e),b?(f+=c,this.set(a,e,f)):this.set(a,e, -f+c),f;case 16:return f=a[3],a=a[2],e=this.expr(a),a=this.expr(f),f=e[a],b?(f+=c,e[a]=f):e[a]=f+c,f;default:throw oa.EInvalidOp(0>",function(b,c){return a.expr(b)>>a.expr(c)});this.binops.set(">>>",function(b,c){return a.expr(b)>>>a.expr(c)});this.binops.set("==",function(b,c){return a.expr(b)==a.expr(c)});this.binops.set("!=",function(b,c){return a.expr(b)!=a.expr(c)});this.binops.set(">=",function(b,c){return a.expr(b)>=a.expr(c)});this.binops.set("<=",function(b,c){return a.expr(b)<=a.expr(c)});this.binops.set(">",function(b,c){return a.expr(b)>a.expr(c)});this.binops.set("<",function(b,c){return a.expr(b)< -a.expr(c)});this.binops.set("||",function(b,c){return!0==a.expr(b)||!0==a.expr(c)});this.binops.set("&&",function(b,c){return!0==a.expr(b)&&!0==a.expr(c)});this.binops.set("=",y(this,this.assign));this.binops.set("...",function(b,c){return new ve(a.expr(b),a.expr(c))});this.assignOp("+=",function(a,c){return a+c});this.assignOp("-=",function(a,c){return a-c});this.assignOp("*=",function(a,c){return a*c});this.assignOp("/=",function(a,c){return a/c});this.assignOp("%=",function(a,c){return a%c});this.assignOp("&=", -function(a,c){return a&c});this.assignOp("|=",function(a,c){return a|c});this.assignOp("^=",function(a,c){return a^c});this.assignOp("<<=",function(a,c){return a<>=",function(a,c){return a>>c});this.assignOp(">>>=",function(a,c){return a>>>c})},declared:null,binops:null,locals:null,variables:null,__class__:Ac};Wd=function(){Ac.call(this)};j["erazor.hscript.EnhancedInterp"]=Wd;Wd.__name__=["erazor","hscript","EnhancedInterp"];Wd.__super__=Ac;Wd.prototype=E(Ac.prototype,{call:function(a, -b,c){c=c.concat([null,null,null,null,null]);return b.apply(a,c)},get:function(a,b){if(null==a)throw oa.EInvalidAccess(b);return m.field(a,b)},__class__:Wd});Qb=void 0;Rb=void 0;me=void 0;Xd=void 0;Yd=void 0;Bd=void 0;zc=void 0;Sb=void 0;Q=void 0;Qb=function(a){for(var b=a.length,c=1;b>1<>3,f=na.alloc(e),h=0,l=0,g=0,i=0;il;){var l=l+b,h=h<>l&255}return f}, -initTable:function(){for(var a=[],b=0;256>b;){var c=b++;a[c]=-1}for(var e=0,b=this.base.length;e>l&g]&255}0a)b.onData(c.responseText);else switch(a){case null:case void 0:b.onError("Failed to connect or resolve host");break;case 12029:b.onError("Failed to connect to host");break;case 12007:b.onError("Unknown host");break;default:b.onError("Http Error #"+c.status)}}};if(this.async)c.onreadystatechange=e;var f=this.postData;if(null!= -f)a=!0;else for(var h=this.params.keys();h.hasNext();)var l=h.next(),f=null==f?"":f+"&",f=f+(I.urlEncode(l)+"="+I.urlEncode(this.params.get(l)));try{if(a)c.open("POST",this.url,this.async);else if(null!=f){var g=1>=this.url.split("?").length;c.open("GET",this.url+(g?"?":"&")+f,this.async);f=null}else c.open("GET",this.url,this.async)}catch(i){this.onError(i.toString());return}null==this.headers.get("Content-Type")&&a&&null==this.postData&&c.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); -for(a=this.headers.keys();a.hasNext();)h=a.next(),c.setRequestHeader(h,this.headers.get(h));c.send(f);this.async||e()},setParameter:function(a,b){this.params.set(a,b)},setHeader:function(a,b){this.headers.set(a,b)},params:null,headers:null,postData:null,async:null,url:null,__class__:Bd};Rb=function(){};j["haxe.Int32"]=Rb;Rb.__name__=["haxe","Int32"];Rb.toInt=function(a){if((a>>30&1)!=a>>>31)throw"Overflow "+r.string(a);return a};me=function(){};j["haxe.Log"]=me;me.__name__=["haxe","Log"];me.trace= -function(a,b){G.__trace(a,b)};zc=function(){};j["haxe.Md5"]=zc;zc.__name__=["haxe","Md5"];zc.encode=function(a){return(new zc).doEncode(a)};zc.prototype={doEncode:function(a){for(var a=this.str2blks(a),b=1732584193,c=-271733879,e=-1732584194,f=271733878,h=0;h>>32-b},str2blks:function(a){for(var b=(a.length+ -8>>6)+1,c=[],e=16*b,f=0;f>2]|=u.cca(a,h)<<8*((8*a.length+h)%4),h++;c[h>>2]|=128<<8*((8*a.length+h)%4);a=8*a.length;b=16*b-2;c[b]=a&255;c[b]|=(a>>>8&255)<<8;c[b]|=(a>>>16&255)<<16;c[b]|=(a>>>24&255)<<24;return c},rhex:function(a){for(var b="",c=0;4>c;)var e=c++,b=b+("0123456789abcdef".charAt(a>>8*e+4&15)+"0123456789abcdef".charAt(a>>8*e&15));return b},addme:function(a,b){var c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535},bitAND:function(a, -b){return(a>>>1&b>>>1)<<1|a&1&b&1},bitXOR:function(a,b){return(a>>>1^b>>>1)<<1|a&1^b&1},bitOR:function(a,b){return(a>>>1|b>>>1)<<1|a&1|b&1},__class__:zc};Sb=function(a){var b=this;this.id=setInterval(function(){b.run()},a)};j["haxe.Timer"]=Sb;Sb.__name__=["haxe","Timer"];Sb.delay=function(a,b){var c=new Sb(b);c.run=function(){c.stop();a()};return c};Sb.prototype={run:function(){},stop:function(){if(null!=this.id)clearInterval(this.id),this.id=null},id:null,__class__:Sb};Q={Bytes:function(a,b){this.length= -a;this.b=b}};j["haxe.io.Bytes"]=Q.Bytes;Q.Bytes.__name__=["haxe","io","Bytes"];Q.Bytes.alloc=function(a){for(var b=[],c=0;c=f?b.push(f):(2047>=f?b.push(192|f>>6):(65535>=f?b.push(224|f>>12):(b.push(240|f>>18),b.push(128|f>>12&63)),b.push(128|f>>6&63)),b.push(128|f&63))}return new Q.Bytes(b.length,b)};Q.Bytes.prototype={toString:function(){return this.readString(0,this.length)}, -readString:function(a,b){if(0>a||0>b||a+b>this.length)throw Q.Error.OutsideBounds;for(var c="",e=this.b,f=String.fromCharCode,h=a,l=a+b;hg){if(0==g)break;c+=f(g)}else if(224>g)c+=f((g&63)<<6|e[h++]&127);else if(240>g)var i=e[h++],c=c+f((g&31)<<12|(i&127)<<6|e[h++]&127);else var i=e[h++],k=e[h++],c=c+f((g&15)<<18|(i&127)<<12|k<<6&127|e[h++]&127)}return c},b:null,length:null,__class__:Q.Bytes};Q.BytesBuffer=function(){this.b=[]};j["haxe.io.BytesBuffer"]=Q.BytesBuffer;Q.BytesBuffer.__name__= -["haxe","io","BytesBuffer"];Q.BytesBuffer.prototype={getBytes:function(){var a=new Q.Bytes(this.b.length,this.b);this.b=null;return a},b:null,__class__:Q.BytesBuffer};Q.Input=function(){};j["haxe.io.Input"]=Q.Input;Q.Input.__name__=["haxe","io","Input"];Q.Input.prototype={readString:function(a){var b=Q.Bytes.alloc(a);this.readFullBytes(b,0,a);return b.toString()},readFullBytes:function(a,b,c){for(;0b||0>c||b+ -c>a.length)throw Q.Error.OutsideBounds;for(;0b||0>c||b+c>a.length)throw Q.Error.OutsideBounds;this.b=a.b;this.pos=b;this.len=c};j["haxe.io.BytesInput"]=Q.BytesInput;Q.BytesInput.__name__=["haxe","io","BytesInput"];Q.BytesInput.__super__=Q.Input;Q.BytesInput.prototype=E(Q.Input.prototype,{readBytes:function(a,b,c){if(0>b|| -0>c||b+c>a.length)throw Q.Error.OutsideBounds;if(0==this.len&&0<&|^%~";this.identChars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";var a=[["%"],["*","/"],["+","-"],["<<",">>",">>>"],["|","&","^"],"==,!=,>,<,>=,<=".split(","), -["..."],["&&"],["||"],"=,+=,-=,*=,/=,%=,<<=,>>=,>>>=,|=,&=,^=".split(",")];this.opPriority=new ca;this.opRightAssoc=new ca;for(var b=0,c=a.length;bthis["char"]?a=this.readChar():(a=this["char"],this["char"]=-1);for(;;){switch(a){case 0:return H.TEof; -case 32:case 9:case 13:break;case 10:this.line++;break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:for(var b=1*(a-48),c=0;;)switch(a=this.readChar(),c*=10,a){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:b=10*b+(a-48);break;case 46:if(0>30&1)!=e>>>31)throw"Overflow "+r.string(e);return e}(a))}catch(c){b=$a.CInt32(e)}return b}(this),H.TConst(a)}break;default:return this["char"]= -a,a=b|0,H.TConst(0x;){var j=x++,k=k<<4,j=u.cca(g,j);switch(j){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:k+=j-48;break;case 65:case 66:case 67:case 68:case 69:case 70:k+=j-55;break;case 97:case 98:case 99:case 100:case 101:case 102:k+= -j-87;break;default:this.invalidChar(j)}}127>=k?c.writeByte(k):(2047>=k?c.writeByte(192|k>>6):(c.writeByte(224|k>>12),c.writeByte(128|k>>6&63)),c.writeByte(128|k&63));break;default:this.invalidChar(b)}else if(92==b)e=!0;else if(b==a)break;else 10==b&&this.line++,c.writeByte(b)}return c.getBytes().toString()},readChar:function(){var a;try{a=this.input.readByte()}catch(b){a=0}return a},incPos:function(){},parseExprList:function(a){var b=[],c=this.token();if(c==a)return b;this.tokens.add(c);try{for(;;)switch(b.push(this.parseExpr()), -c=this.token(),c[1]){case 9:break;default:if(c==a)throw"__break__";this.unexpected(c)}}catch(e){if("__break__"!=e)throw e;}return b},parseTypeNext:function(a){var b=this.token(),c=b;switch(c[1]){case 3:if("->"!=c[2])return this.tokens.add(b),a;break;default:return this.tokens.add(b),a}c=b=this.parseType();switch(c[1]){case 1:return c[2].unshift(a),b;default:return Kb.CTFun([a],b)}},parseType:function(){var a=this.token(),b=a;switch(b[1]){case 2:for(var c=[b[2]];;){a=this.token();if(a!=H.TDot)break; -b=a=this.token();switch(b[1]){case 2:c.push(b[2]);break;default:this.unexpected(a)}}var e=null,b=a;switch(b[1]){case 3:if("<"==b[2]){e=[];try{for(;;){e.push(this.parseType());b=a=this.token();switch(b[1]){case 9:continue;case 3:if(">"==b[2])throw"__break__";}this.unexpected(a)}}catch(f){if("__break__"!=f)throw f;}}break;default:this.tokens.add(a)}return this.parseTypeNext(Kb.CTPath(c,e));case 4:return a=this.parseType(),this.ensure(H.TPClose),this.parseTypeNext(Kb.CTParent(a));case 6:c=[];try{for(;;)switch(b= -a=this.token(),b[1]){case 7:throw"__break__";case 2:e=b[2];this.ensure(H.TDoubleDot);c.push({name:e,t:this.parseType()});a=this.token();switch(a[1]){case 9:break;case 7:throw"__break__";default:this.unexpected(a)}break;default:this.unexpected(a)}}catch(h){if("__break__"!=h)throw h;}return this.parseTypeNext(Kb.CTAnon(c));default:return this.unexpected(a)}},parseExprNext:function(a){var b=this.token(),c=b;switch(c[1]){case 3:c=c[2];if(this.unops.get(c)){var e;if(!(e=this.isBlock(a)))switch(a[1]){case 3:e= -!0;break;default:e=!1}return e?(this.tokens.add(b),a):this.parseExprNext(P.EUnop(c,!1,a))}return this.makeBinop(c,a,this.parseExpr());case 8:b=this.token();e=null;c=b;switch(c[1]){case 2:e=c[2];break;default:this.unexpected(b)}return this.parseExprNext(P.EField(a,e));case 4:return this.parseExprNext(P.ECall(a,this.parseExprList(H.TPClose)));case 11:return b=this.parseExpr(),this.ensure(H.TBkClose),this.parseExprNext(P.EArray(a,b));case 13:return b=this.parseExpr(),this.ensure(H.TDoubleDot),c=this.parseExpr(), -P.ETernary(a,b,c);default:return this.tokens.add(b),a}},parseStructure:function(a){return function(b){switch(a){case "if":b=function(a){var b=a.parseExpr(),f=a.parseExpr(),h=null,l=!1,g=a.token();g==H.TSemicolon&&(l=!0,g=a.token());K.enumEq(g,H.TId("else"))?h=a.parseExpr():(a.tokens.add(g),l&&a.tokens.add(H.TSemicolon));return P.EIf(b,f,h)}(b);break;case "var":b=function(a){var b=a.token(),f=null,h=b;switch(h[1]){case 2:f=h[2];break;default:a.unexpected(b)}b=a.token();h=null;b==H.TDoubleDot&&a.allowTypes&& -(h=a.parseType(),b=a.token());var l=null;K.enumEq(b,H.TOp("="))?l=a.parseExpr():a.tokens.add(b);return P.EVar(f,h,l)}(b);break;case "while":b=function(a){var b=a.parseExpr(),a=a.parseExpr();return P.EWhile(b,a)}(b);break;case "for":b=function(a){a.ensure(H.TPOpen);var b=a.token(),f=null,h=b;switch(h[1]){case 2:f=h[2];break;default:a.unexpected(b)}b=a.token();K.enumEq(b,H.TId("in"))||a.unexpected(b);b=a.parseExpr();a.ensure(H.TPClose);a=a.parseExpr();return P.EFor(f,b,a)}(b);break;case "break":b=P.EBreak; -break;case "continue":b=P.EContinue;break;case "else":b=b.unexpected(H.TId(a));break;case "function":b=function(a){var b=a.token(),f=null,h=b;switch(h[1]){case 2:f=b=h[2];break;default:a.tokens.add(b)}a.ensure(H.TPOpen);var l=[],b=a.token();if(b!=H.TPClose)for(var g=!0;g;){var i=null,h=b;switch(h[1]){case 2:i=b=h[2];break;default:a.unexpected(b)}b=a.token();h=null;b==H.TDoubleDot&&a.allowTypes&&(h=a.parseType(),b=a.token());l.push({name:i,t:h});switch(b[1]){case 9:b=a.token();break;case 5:g=!1;break; -default:a.unexpected(b)}}g=null;a.allowTypes&&(b=a.token(),b!=H.TDoubleDot?a.tokens.add(b):g=a.parseType());a=a.parseExpr();return P.EFunction(l,a,f,g)}(b);break;case "return":b=function(a){var b=a.token();a.tokens.add(b);a=b==H.TSemicolon?null:a.parseExpr();return P.EReturn(a)}(b);break;case "new":b=function(a){var b=[],f=a.token(),h=f;switch(h[1]){case 2:f=h[2];b.push(f);break;default:a.unexpected(f)}for(var l=!0;l;)switch(f=a.token(),f[1]){case 8:h=f=a.token();switch(h[1]){case 2:f=h[2];b.push(f); -break;default:a.unexpected(f)}break;case 4:l=!1;break;default:a.unexpected(f)}a=a.parseExprList(H.TPClose);return P.ENew(b.join("."),a)}(b);break;case "throw":b=function(a){a=a.parseExpr();return P.EThrow(a)}(b);break;case "try":b=function(a){var b=a.parseExpr(),f=a.token();K.enumEq(f,H.TId("catch"))||a.unexpected(f);a.ensure(H.TPOpen);var f=a.token(),h;h=f;switch(h[1]){case 2:f=h[2];break;default:f=a.unexpected(f)}h=f;a.ensure(H.TDoubleDot);var l=null;a.allowTypes?l=a.parseType():(f=a.token(),K.enumEq(f, -H.TId("Dynamic"))||a.unexpected(f));a.ensure(H.TPClose);a=a.parseExpr();return P.ETry(b,h,l,a)}(b);break;default:b=null}return b}(this)},makeBinop:function(a,b,c){switch(c[1]){case 6:var e=c[4],f=c[3],h=c[2],a=this.opPriority.get(a)<=this.opPriority.get(h)&&!this.opRightAssoc.exists(a)?P.EBinop(h,this.makeBinop(a,b,f),e):P.EBinop(a,b,c);break;case 22:h=c[4];e=c[3];f=c[2];a=this.opRightAssoc.exists(a)?P.EBinop(a,b,c):P.ETernary(this.makeBinop(a,b,f),e,h);break;default:a=P.EBinop(a,b,c)}return a},makeUnop:function(a, -b){var c;switch(b[1]){case 6:c=b[4];var e=b[3];c=P.EBinop(b[2],this.makeUnop(a,e),c);break;case 22:var f=b[4];c=b[3];e=b[2];c=P.ETernary(this.makeUnop(a,e),c,f);break;default:c=P.EUnop(a,!0,b)}return c},parseExpr:function(){var a=this.token(),b=a;switch(b[1]){case 2:return a=b[2],b=this.parseStructure(a),null==b&&(b=P.EIdent(a)),this.parseExprNext(b);case 1:return b=b[2],this.parseExprNext(P.EConst(b));case 4:return b=this.parseExpr(),this.ensure(H.TPClose),this.parseExprNext(P.EParent(b));case 6:b= -a=this.token();switch(b[1]){case 7:return this.parseExprNext(P.EObject([]));case 2:b=this.token();this.tokens.add(b);this.tokens.add(a);switch(b[1]){case 14:return this.parseExprNext(this.parseObject(0))}break;case 1:b=b[2];if(this.allowJSON)switch(b[1]){case 2:b=this.token();this.tokens.add(b);this.tokens.add(a);switch(b[1]){case 14:return this.parseExprNext(this.parseObject(0))}break;default:this.tokens.add(a)}else this.tokens.add(a);break;default:this.tokens.add(a)}for(b=[];;){b.push(this.parseFullExpr()); -a=this.token();if(a==H.TBrClose)break;this.tokens.add(a)}return P.EBlock(b);case 3:return b=b[2],this.unops.exists(b)?this.makeUnop(b,this.parseExpr()):this.unexpected(a);case 11:b=[];for(a=this.token();a!=H.TBkClose;)this.tokens.add(a),b.push(this.parseExpr()),a=this.token(),a==H.TComma&&(a=this.token());return this.parseExprNext(P.EArrayDecl(b));default:return this.unexpected(a)}},parseObject:function(){var a=[];try{for(;;){var b=this.token(),c=null,e=b;switch(e[1]){case 2:c=e[2];break;case 1:var f= -e[2];this.allowJSON||this.unexpected(b);e=f;switch(e[1]){case 2:c=e[2];break;default:this.unexpected(b)}break;case 7:throw"__break__";default:this.unexpected(b)}this.ensure(H.TDoubleDot);a.push({name:c,e:this.parseExpr()});b=this.token();switch(b[1]){case 7:throw"__break__";case 9:break;default:this.unexpected(b)}}}catch(h){if("__break__"!=h)throw h;}return this.parseExprNext(P.EObject(a))},parseFullExpr:function(){var a=this.parseExpr(),b=this.token();b!=H.TSemicolon&&b!=H.TEof&&(this.isBlock(a)? -this.tokens.add(b):this.unexpected(b));return a},isBlock:function(a){switch(a[1]){case 4:case 21:a=!0;break;case 14:var b=a[3],a=this.isBlock(b);break;case 2:b=a[4];a=null!=b&&this.isBlock(b);break;case 9:var c=a[4],b=a[3],a=null!=c?this.isBlock(c):this.isBlock(b);break;case 6:b=a[4];a=this.isBlock(b);break;case 7:b=a[4];a=!a[3]&&this.isBlock(b);break;case 10:b=a[3];a=this.isBlock(b);break;case 11:b=a[4];a=this.isBlock(b);break;case 15:b=a[2];a=null!=b&&this.isBlock(b);break;default:a=!1}return a}, -mk:function(a){return a},pmax:function(){return 0},pmin:function(){return 0},expr:function(a){return a},ensure:function(a){var b=this.token();b!=a&&this.unexpected(b)},push:function(a){this.tokens.add(a)},unexpected:function(a){throw oa.EUnexpected(this.tokenString(a));},parse:function(a){this.tokens=new Yd;this["char"]=-1;this.input=a;this.ops=[];this.idents=[];for(var a=0,b=this.opChars.length;a").join(">")};G.__trace=function(a,b){var c=null!=b?b.fileName+":"+b.lineNumber+": ":"",c=c+G.__string_rec(a,""),e;"undefined"!=typeof document&&null!=(e=document.getElementById("haxe:trace"))? -e.innerHTML+=G.__unhtml(c)+"
":"undefined"!=typeof console&&null!=console.log&&console.log(c)};G.__string_rec=function(a,b){if(null==a)return"null";if(5<=b.length)return"<...>";var c=typeof a;if("function"==c&&(a.__name__||a.__ename__))c="object";switch(c){case "object":if(a instanceof Array){if(a.__enum__){if(2==a.length)return a[0];for(var c=a[0]+"(",b=b+"\t",e=2,f=a.length;e";case "string":return a; -default:return""+a}};G.__interfLoop=function(a,b){if(null==a)return!1;if(a==b)return!0;var c=a.__interfaces__;if(null!=c)for(var e=0,f=c.length;eb;){var c=b++;n.BI_RC[a]=c;a++}a=u.cca("a",0);for(b=10;37>b;)c=b++,n.BI_RC[a]=c,a++;a=u.cca("A",0);for(b=10;37>b;)c=b++,n.BI_RC[a]=c,a++};n.getZERO=function(){return n.nbv(0)};n.getONE=function(){return n.nbv(1)};n.nbv=function(a){var b=n.nbi();b.fromInt(a);return b};n.nbi=function(){return new n};n.ofString=function(a,b){var c=n.nbi(),e=function(a, -b){c.fromInt(0);for(var e=Math.floor(0.6931471805599453*n.DB/Math.log(b)),f=Math.pow(b,e)|0,h=!1,l=0,g=0,B=0,i=a.length;Bm?"-"==a.charAt(j)&&0==c.sign&&(h=!0):(g=b*g+m,++l>=e&&(c.dMultiply(f),c.dAddOffset(g,0),g=l=0))}0g?"-"==a.charAt(f)&&(h=!0):(h=!1,0==l?(c.chunks[c.t]=g,c.t++):l+e>n.DB?(c.chunks[c.t-1]|=(g&(1<>n.DB-l,c.t++):c.chunks[c.t-1]|=g<=n.DB&&(l-=n.DB))}if(8==e&&0!=(u.cca(a,0)&128))c.sign=-1,0=c;){var g=hn.DB?(f.chunks[f.t-1]|=(g&(1<>n.DB-l,f.t++):f.chunks[f.t-1]|=g<=n.DB&&(l-=n.DB)}if(!b&&0!=(a.b[0]&128))f.sign=-1,0a)return n.ofInt(1);var c=(a>>3)+1, -e=na.alloc(c),f=a&7;b.nextBytes(e,0,c);0c&&(c=1);;){var h=n.random(a,f);e&&(h.testBit(a-1)||h.bitwiseTo(n.getONE().shl(a-1),n.op_or,h));h.isEven()&&h.dAddOffset(1,0);h.primify(a,1);if(0==h.sub(n.getONE()).gcd(b).compare(n.getONE())&&h.isProbablePrime(c))return h}return null};n.op_and=function(a,b){return a&b};n.op_or=function(a,b){return a|b};n.op_xor= -function(a,b){return a^b};n.op_andnot=function(a,b){return a&~b};n.nbits=function(a){var b=1,c;if(0!=(c=a>>>16))a=c,b+=16;if(0!=(c=a>>8))a=c,b+=8;if(0!=(c=a>>4))a=c,b+=4;if(0!=(c=a>>2))a=c,b+=2;0!=a>>1&&(b+=1);return b};n.cbit=function(a){for(var b=0;0!=a;)a&=a-1,++b;return b};n.intAt=function(a,b){var c=n.BI_RC[u.cca(a,b)];return null==c?-1:c};n.int2charCode=function(a){return u.cca(n.BI_RM,a)};n.lbit=function(a){if(0==a)return-1;var b=0;0==(a&65535)&&(a>>=16,b+=16);0==(a&255)&&(a>>=8,b+=8);0==(a& -15)&&(a>>=4,b+=4);0==(a&3)&&(a>>=2,b+=2);0==(a&1)&&++b;return b};n.dumpBi=function(a){var b="sign: "+r.string(a.sign),b=b+(" t: "+a.t);return b+=r.string(a.chunks)};n.prototype={am3:function(a,b,c,e,f,h){for(var l=b&16383,b=b>>14;0<=--h;){var g=this.chunks[a]&16383,i=this.chunks[a]>>14;a++;var k=b*g+i*l,g=l*g+((k&16383)<<14)+c.chunks[e]+f,f=(g>>28)+(k>>14)+b*i;c.chunks[e]=g&268435455;e++}return f},am2:function(a,b,c,e,f,h){for(var l=b&32767,b=b>>15;0<=--h;){var g=this.chunks[a]&32767,i=this.chunks[a]>> -15;a++;var k=b*g+i*l,g=l*g+((k&32767)<<15)+c.chunks[e]+(f&1073741823),f=(g>>>30)+(k>>>15)+b*i+(f>>>30);c.chunks[e]=g&1073741823;e++}return f},am1:function(a,b,c,e,f,h){for(;0<=--h;){var l=b*this.chunks[a]+c.chunks[e]+f;a++;f=Math.floor(l/67108864);c.chunks[e]=l&67108863;e++}return f},rShiftTo:function(a,b){b.sign=this.sign;var c=Math.floor(a/n.DB);if(c>=this.t)b.t=0;else{var e=a%n.DB,f=n.DB-e,h=(1<>e;for(var l=c+1,g=this.t;l>e}0>e|l,l=(this.chunks[g]&f)<=c)return!1;var e=b.shr(c),a=a+1>>1;if(a> -n.lowprimes.length)a=n.lowprimes.length;for(var f=n.nbi(),h=0;ha)return n.getONE();var c=n.nbi(),e=n.nbi(),f=b.convert(this),h=n.nbits(a)-1;for(f.copyTo(c);0<=--h;)if(b.sqrTo(c,e),0<(a&1<a;)this.subTo(n.getONE().shl(a-1),this);for(;!this.isProbablePrime(b);)for(this.dAddOffset(2,0);this.bitLength()>a;)this.subTo(n.getONE().shl(a-1),this)},isProbablePrime:function(a){var b,c=this.abs();if(1==c.t&&c.chunks[0]<=n.lowprimes[n.lowprimes.length-1]){a=0;for(b=n.lowprimes.length;athis.t)return 0;var a=this.chunks[0];if(0==(a&1))return 0;var b=a&3,b=b*(2-(a&15)*b)&15,b=b*(2-(a&255)*b)&255,b=b*(2-((a&65535)*b&65535))&65535,b=b*(2-a*b%n.DV)%n.DV;return 0=n.DV;)this.chunks[b]-=n.DV,++b>=this.t&&(this.chunks[this.t]=0,this.t++),++this.chunks[b]},sigNum:function(){return 0>this.sign?-1:0>=this.t||1==this.t&&0>=this.chunks[0]?0:1},byteValue:function(){return 0== -this.t?this.sign:this.chunks[0]<<24>>24},shortValue:function(){return 0==this.t?this.sign:this.chunks[0]<<16>>16},padTo:function(a){for(;this.tthis.sign?this.neg():this.clone(),a=0>a.sign?a.neg():a.clone();if(0>b.compare(a))var c=b,b=a,a=c;var c=b.getLowestSetBit(),e=a.getLowestSetBit();if(0>e)return b;c>=n.DB;if(a.t>=n.DB;e+=this.sign}else{for(e+= -this.sign;c>=n.DB;e-=a.sign}b.sign=0>e?-1:0;-1>e?(b.chunks[c]=n.DV+e,c++):0=n.DV)a.chunks[c+b.t]-=n.DV,a.chunks[c+b.t+1]=1;c++}0=e.t)){var f=this.abs();if(f.t>n.F2):0),k=n.FV/i,i=1*(1<l&&n.getZERO().subTo(c,c)}}}},copyTo:function(a){for(var b=0,c=this.chunks.length;b>=n.DB;if(a.t>=n.DB;e+=this.sign}else{for(e+=this.sign;c>=n.DB;e+=a.sign}b.sign=0>e?-1:0;0e&&(b.chunks[c]=n.DV+e,c++);b.t=c;b.clamp()},xor:function(a){var b=n.nbi();this.bitwiseTo(a,n.op_xor,b);return b},testBit:function(a){var b=Math.floor(a/n.DB);return b>=this.t?0!=this.sign:0!=(this.chunks[b]&1<a?this.lShiftTo(-a,b):this.rShiftTo(a,b);return b},shl:function(a){var b=n.nbi();0>a?this.rShiftTo(-a, -b):this.lShiftTo(a,b);return b},setBit:function(a){return this.changeBit(a,n.op_or)},or:function(a){var b=n.nbi();this.bitwiseTo(a,n.op_or,b);return b},not:function(){for(var a=n.nbi(),b=0,c=this.t;bthis.sign?this.t*n.DB:-1},flipBit:function(a){return this.changeBit(a,n.op_xor)},clearBit:function(a){return this.changeBit(a, -n.op_andnot)},complement:function(){return this.not()},bitLength:function(){return 0>=this.t?0:n.DB*(this.t-1)+n.nbits(this.chunks[this.t-1]^this.sign&n.DM)},bitCount:function(){for(var a=0,b=this.sign&n.DM,c=0,e=this.t;ca||b.isEven()?new ma.Classic(b):new ma.Montgomery(b);return this.exp(a,c)},modPow:function(a,b){var c=a.bitLength(),e,f=n.nbv(1),h;if(0>=c)return f;e=18>c?1:48>c?3:144>c?4:768>c?5:6;h=8>c?new ma.Classic(b):b.isEven()?new ma.Barrett(b): -new ma.Montgomery(b);var l=[],g=3,i=e-1,k=(1<=i?j=a.chunks[x]>>c-i&k:(j=(a.chunks[x]&(1<>n.DB+c-i));for(g=e;0==(j&1);)j>>=1,--g;if(0>(c-=g))c+=n.DB,--x;if(m)l[j].copyTo(f),m=!1;else{for(;1--c&&(c=n.DB-1,--x),g=a.chunks[x]}return h.revert(f)},modInverse:function(a){var b=a.isEven();if(this.isEven()&&b||0==a.sigNum())return n.getZERO();for(var c=a.clone(),e=this.clone(),f=n.nbv(1),h=n.nbv(0),l=n.nbv(0),g=n.nbv(1);0!=c.sigNum();){for(;c.isEven();){c.rShiftTo(1,c);if(b){if(!f.isEven()||!h.isEven())f.addTo(this,f),h.subTo(a,h);f.rShiftTo(1,f)}else h.isEven()||h.subTo(a,h);h.rShiftTo(1,h)}for(;e.isEven();){e.rShiftTo(1,e);if(b){if(!l.isEven()|| -!g.isEven())l.addTo(this,l),g.subTo(a,g);l.rShiftTo(1,l)}else g.isEven()||g.subTo(a,g);g.rShiftTo(1,g)}0<=c.compare(e)?(c.subTo(e,c),b&&f.subTo(l,f),h.subTo(g,h)):(e.subTo(c,e),b&&l.subTo(f,l),g.subTo(h,g))}if(0!=e.compare(n.getONE()))return n.getZERO();if(0<=g.compare(a))return g.sub(a);0>g.sigNum()&&g.addTo(a,g);return g},modInt:function(a){if(0>=a)return 0;var b=n.DV%a,c=0>this.sign?a-1:0;if(0this.sign&&0this.compare(a)?this:a},max:function(a){return 0this.sign?this.neg():this},toRadix:function(a){null==a&&(a=10);if(2>a||36>e))f=!0,a.b.push(b),h++;for(;0<=c;)8>e?(b=(this.chunks[c]&(1<>(e+=n.DB-8)):(b=this.chunks[c]>>(e-=8)&255,0>=e&&(e+=n.DB,--c)),0>c)!=(this.sign&n.DM)>>c)b[f]=e|this.sign<c?(e=(this.chunks[a]&(1<>(c+=n.DB-8)):(e=this.chunks[a]>>(c-=8)&255,0>=c&&(c+=n.DB,--a)),0!=(e&128)&&(e|=-256),0==f&&(this.sign&128)!=(e&128)&&++f,0this.sign){if(1==this.t)return this.chunks[0]-n.DV;if(0==this.t)return-1}else{if(1==this.t)return this.chunks[0];if(0==this.t)return 0}return(this.chunks[1]&(1<<32-n.DB)-1)<a?-1:0;0a?this.chunks[0]=a+n.DV:this.t=0},am:null,chunks:null,sign:null,t:null,__class__:n};ja={Status:{__ename__:["math","_IEEE754", -"Status"],__constructs__:"Normal,Overflow,Underflow,Denormalized,Quiet,Signalling".split(",")}};ja.Status.Normal=["Normal",0];ja.Status.Normal.toString=v;ja.Status.Normal.__enum__=ja.Status;ja.Status.Overflow=["Overflow",1];ja.Status.Overflow.toString=v;ja.Status.Overflow.__enum__=ja.Status;ja.Status.Underflow=["Underflow",2];ja.Status.Underflow.toString=v;ja.Status.Underflow.__enum__=ja.Status;ja.Status.Denormalized=["Denormalized",3];ja.Status.Denormalized.toString=v;ja.Status.Denormalized.__enum__= -ja.Status;ja.Status.Quiet=["Quiet",4];ja.Status.Quiet.toString=v;ja.Status.Quiet.__enum__=ja.Status;ja.Status.Signalling=["Signalling",5];ja.Status.Signalling.toString=v;ja.Status.Signalling.__enum__=ja.Status;Wa=function(a){this.Size=a;this.BinaryPower=0;this.StatCond64=this.StatCond=ja.Status.Normal;32==this.Size?(this.MaxExp=this.ExpBias=127,this.MinExp=-126,this.MinUnnormExp=-149):(this.Size=64,this.MaxExp=this.ExpBias=1023,this.MinExp=-1022,this.MinUnnormExp=-1074)};j["math.IEEE754"]=Wa;Wa.__name__= -["math","IEEE754"];Wa.floatToBytes=function(a,b){null==b&&(b=!1);var c=new Wa(32);c.setEndian(b);c.rounding=!0;return c.convert(a)};Wa.doubleToBytes=function(a,b){null==b&&(b=!1);var c=new Wa(64);c.setEndian(b);c.rounding=!0;return c.convert(a)};Wa.bytesToFloat=function(a,b){null==b&&(b=!1);if(4!=a.length&&8!=a.length)throw"Bytes must be 4 or 8 bytes long";var c=new Wa(4==a.length?32:64);c.setEndian(b);c.rounding=!0;return b?c.bytesToBin(a):c.bytesToBin(c.littleToBigEndian(a))};Wa.splitFloat=function(a){var b= -{integral:0,decimal:0},c=r.string(a).toLowerCase(),e=c.indexOf("e"),f=0;if(0<=e)f=r.parseInt(u.substr(c,e+1,null));else return e=c.indexOf("."),0<=e?(b.integral=r.parseFloat(u.substr(c,0,e)),b.decimal=r.parseFloat("0."+u.substr(c,e+1,null))):b.integral=r.parseFloat(c),b;c=u.substr(c,0,e);e=c.indexOf(".");c=I.replace(c,".","");0c.length?b.integral=a:(b.integral=r.parseFloat(u.substr(c,0,e)),b.decimal=r.parseFloat("0."+u.substr(c,e+1,null)))):(f+=e, -0==f?b.decimal=r.parseFloat("0."+c):0>f?b.decimal=r.parseFloat("0."+c+"e"+r.string(f)):(b.integral=r.parseFloat(u.substr(c,0,f)),b.decimal=r.parseFloat("0."+u.substr(c,f,null))));return b};Wa.prototype={numStrClipOff:function(a,b){var c="",e=a.toUpperCase(),f="",c="",h=0,l=0,g=e.indexOf("E");-1!=g?(h=g,f=u.substr(a,g+1,a.length),l=r.parseInt(f)):(h=a.length,l=0);-1==a.indexOf(".")&&(e=u.substr(a,0,h),e+=".",a.length!=h&&(e+=u.substr(a,g,a.length)),a=e,g+=1,h+=1);var e=a.indexOf("."),i=0;"-"==a.charAt(i)? -(i++,c="-"):c="";for(var k=i,x=!1;kj;){if(a.charAt(k)=="0123456789".charAt(j)){x=!0;break}j++}k++}k--;j=0;x?(j=e-k,0this.MaxExp?e=c=0:(c=-1,e=1);for(var f=b,h=this.Size;fc;){var f=c++,a=2* -a;1<=a?(e.Result[b+f]=1,a-=1):e.Result[b+f]=0}};b>4)/16,b),b+=4,f((a.b[c]&15)/16,b),b+=4,c++;a=0;c=32==this.Size?9:12;for(b=1;b=this.MinExp&&a<=this.MaxExp&&(this.BinVal[b]=1,b++);var h=b,f=!1;0==this.Result[c]&&(f=!0);this.BinVal[b]=this.Result[c];c++;b++;for(var l=!0;cb;)1==this.Result[c]&&(l=!1),this.BinVal[b]=this.Result[c],c++,b++;for(;2102>h&&1!=this.BinVal[h];)h++; -b=1024-h;if(athis.MaxExp){if(f&&l)return this.StatCond=ja.Status.Overflow,1==this.Result[0]?Math.NEGATIVE_INFINITY:Math.POSITIVE_INFINITY;this.StatCond=!f&&l&&1==this.Result[0]?ja.Status.Quiet:f?ja.Status.Signalling:ja.Status.Quiet;return Math.NaN}return this.Convert2Dec()},toBytes:function(){for(var a=32==this.Size?4:8,b=na.alloc(a),c=0,e=0;cl;)var g=l++,f=f+(Math.pow(2,3-g)|0)*this.Result[c+g];h=f<<4;f=0;c+=4;for(l=0;4>l;)g=l++,f+=(Math.pow(2,3-g)|0)*this.Result[c+g];h|=f;b.b[e++]=h&255;c+=4}if(!this.bigEndian){c=na.alloc(a);e=a-1;for(l=0;le&&1!=this.BinVal[e];)e++;1024-e>=this.MinExp?e++:(b=this.MinExp-1,e=1024-b);b=this.Size-1-f+e;if(1== -this.BinVal[b+1]){c=0;if(1==this.BinVal[b])c=1;else for(h=b+2;0==c&&2102>h;)c=this.BinVal[h],h++;for(h=b;1==c&&0<=h;)0==this.BinVal[h]?(this.BinVal[h]=1,c=0):this.BinVal[h]=0,h--}e-=2;0>e&&(e=0)}for(;2102>e&&1!=this.BinVal[e];)e++;c=1024-e;if(this.StatCond64==ja.Status.Normal)if(b=c,b>=this.MinExp&&b<=this.MaxExp)e++;else{if(bthis.MaxExp? -b=this.MaxExp+1:be;)this.Result[f]=this.BinVal[e],f++,e++;if(b>this.MaxExp||this.StatCond64!=ja.Status.Normal){if(this.StatCond64==ja.Status.Normal)return this.infinity(1==this.Result[0]);this.StatCond=this.StatCond64}e=32==this.Size?8:11;this.BinaryPower=b;b+=this.ExpBias;for(a=1*b;0!=a/2;)f=(a|0)%2,this.Result[e]=f,a=0==f?a/2:a/2-0.5,e--,a=Wa.splitFloat(10*a).integral/10;return this.toBytes()},convert:function(a){this.input=a;this.StatCond64= -this.StatCond=ja.Status.Normal;if(this.input==Math.POSITIVE_INFINITY)return this.infinity(!1);if(this.input==Math.NEGATIVE_INFINITY)return this.infinity(!0);if(Math.isNaN(this.input)){var a=new Ca,b=2;32==this.Size?(a.b.push(255),a.b.push(192)):(a.b.push(255),a.b.push(248),b=6);for(var c=0;cthis.input&&(this.Result[0]=1);a=Math.abs(this.input);b=Wa.splitFloat(a);a=b.integral;b=b.decimal; -for(c=1024;0!=a/2&&0<=c;){for(var e=a;2147483647c;)b*=2,1<=b?(this.BinVal[c]=1,b--):this.BinVal[c]=0,c++;for(c=0;2102>c&&1!=this.BinVal[c];)c++;this.BinaryPower=1024-c;if(this.BinaryPowera;){var b=a++;this.BinVal[b]=0}this.Result=[];for(var c=0,a=this.Size;c< -a;)b=c++,this.Result[b]=0},setEndian:function(a){return this.bigEndian=a},StatCond64:null,StatCond:null,Result:null,MinUnnormExp:null,MinExp:null,MaxExp:null,ExpBias:null,BinVal:null,BinaryPower:null,Size:null,rounding:null,input:null,bigEndian:null,__class__:Wa,__properties__:{set_bigEndian:"setEndian"}};Qa={IPrng:function(){}};j["math.prng.IPrng"]=Qa.IPrng;Qa.IPrng.__name__=["math","prng","IPrng"];Qa.IPrng.prototype={toString:null,next:null,init:null,size:null,__class__:Qa.IPrng};Qa.ArcFour=function(){this.j= -this.i=0;this.S=[];this.setSize(256)};j["math.prng.ArcFour"]=Qa.ArcFour;Qa.ArcFour.__name__=["math","prng","ArcFour"];Qa.ArcFour.__interfaces__=[Qa.IPrng];Qa.ArcFour.prototype={toString:function(){return"ArcFour"},setSize:function(a){if(0!=a%4||32>a)throw"invalid size";return this.size=a},next:function(){if(0==this.S.length)throw"not initialized";var a;this.i=this.i+1&255;this.j=this.j+this.S[this.i]&255;a=this.S[this.i];this.S[this.i]=this.S[this.j];this.S[this.j]=a;return this.S[a+this.S[this.i]& -255]},init:function(a){for(var b,c=0;256>c;)b=c++,this.S[b]=b;for(c=this.j=0;256>c;){var e=c++;this.j=this.j+this.S[e]+a[e%a.length]&255;b=this.S[e];this.S[e]=this.j;this.S[this.j]=b}this.j=this.i=0},size:null,S:null,j:null,i:null,__class__:Qa.ArcFour};Qa.Random=function(a){this.createState(a);this.initialized=!1};j["math.prng.Random"]=Qa.Random;Qa.Random.__name__=["math","prng","Random"];Qa.Random.prototype={createState:function(a){this.state=null==a?new Qa.ArcFour:a;if(null==this.pool){this.pool= -[];for(this.pptr=0;this.pptr>>8,this.pool[this.pptr++]=a&255;this.pptr=0;this.seedTime()}},seedTime:function(){this.seedInt(1E3*(new Date).getTime()|0)},seedInt:function(a){this.pool[this.pptr++]^=a&255;this.pool[this.pptr++]^=a>>8&255;this.pool[this.pptr++]^=a>>16&255;this.pool[this.pptr++]^=a>>24&255;this.pptr>=this.state.size&&(this.pptr-=this.state.size)},nextBytesStream:function(a,b){for(var c=0;cthis.m.t+1)a.t=this.m.t+1,a.clamp();this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);for(this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);0>a.compare(this.r2);)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);0<=a.compare(this.m);)a.subTo(this.m,a)},revert:function(a){return a},convert:function(a){if(0>a.sign||a.t>2*this.m.t)return a.mod(this.m);if(0>a.compare(this.m))return a;var b=n.nbi();a.copyTo(b);this.reduce(b); -return b},q3:null,r2:null,mu:null,m:null,__class__:ma.Barrett};ma.Classic=function(a){this.m=a};j["math.reduction.Classic"]=ma.Classic;ma.Classic.__name__=["math","reduction","Classic"];ma.Classic.__interfaces__=[ma.ModularReduction];ma.Classic.prototype={sqrTo:function(a,b){a.squareTo(b);this.reduce(b)},mulTo:function(a,b,c){a.multiplyTo(b,c);this.reduce(c)},reduce:function(a){a.divRemTo(this.m,null,a)},revert:function(a){return a},convert:function(a){return 0>a.sign||0<=a.compare(this.m)?a.mod(this.m): -a},m:null,__class__:ma.Classic};ma.Montgomery=function(a){this.m=a;this.mp=this.m.invDigit();this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<>15)*this.mpl&this.um)<<15)&n.DM,c=b+this.m.t;for(a.chunks[c]+=this.m.am(0,e,a,b,0,this.m.t);a.chunks[c]>=n.DV;)a.chunks[c]-=n.DV,a.chunks.lengtha.sign&&0=a.expires||a.expires>=(new Date).getTime())&&a.permissions.read)},function(){c(null)})};Ab.complete=function(a,b){var c=new Nd(b);if(null==a.options)a.options={};var e=a.options;if(null!=e.download&&!Ya.isAnonymous(e.download)){var f=e.download;m.deleteField(e,"download");if(!0==f)e.download={position:"auto"}; -else if(G.__instanceof(f,String))e.download={position:f};else throw new J.Error("invalid value for download '{0}'",[f],null,{fileName:"MVPOptions.hx",lineNumber:118,className:"rg.app.charts.MVPOptions",methodName:"complete"});}if(null!=e.map&&Ya.isAnonymous(e.map))e.map=[e.map];c.addAction(Ab.a1);c.addAction(Ab.a2);c.addAction(function(a,b){var c=a.axes,e=!1;null==c&&(c=[]);a.axes=c=c.map(function(a){return G.__instanceof(a,String)?{type:a}:a});for(var f=0,g=c.length;ff)throw new J.Error("the start bound '{0}' is not part of the values {1}",[a,e],null,{fileName:"AxisOrdinal.hx",lineNumber:54,className:"rg.axis.AxisOrdinal",methodName:"scale"});if(0>h)throw new J.Error("the end bound '{0}' is not part of the values {1}",[b,e],null,{fileName:"AxisOrdinal.hx",lineNumber:56,className:"rg.axis.AxisOrdinal",methodName:"scale"});if(0>l)throw new J.Error("the value '{0}' is not part of the values {1}", -[c,e],null,{fileName:"AxisOrdinal.hx",lineNumber:58,className:"rg.axis.AxisOrdinal",methodName:"scale"});return id.distribute(this.scaleDistribution,l-f,h-f+1)},range:function(a,b){var c=this.values(),e=c.indexOf(a),f=c.indexOf(b);if(0>e)throw new J.Error("the start bound '{0}' is not part of the acceptable values {1}",[a,c],null,{fileName:"AxisOrdinal.hx",lineNumber:41,className:"rg.axis.AxisOrdinal",methodName:"range"});if(0>f)throw new J.Error("the end bound '{0}' is not part of the acceptable values {1}", -[b,c],null,{fileName:"AxisOrdinal.hx",lineNumber:43,className:"rg.axis.AxisOrdinal",methodName:"range"});return c.slice(e,f+1)},ticks:function(a,b,c){if(0==c)return[];a=Db.fromArray(this.range(a,b),this.scaleDistribution);return tb.bound(a,c)},toTickmark:function(a,b,c){a=this.range(a,b);return new Db(a.indexOf(c),a,null,this.scaleDistribution)},scaleDistribution:null,__class__:Nb,__properties__:{set_scaleDistribution:"set_scaleDistribution"}};Yb=function(a){Nb.call(this);this._values=a};j["rg.axis.AxisOrdinalFixedValues"]= -Yb;Yb.__name__=["rg","axis","AxisOrdinalFixedValues"];Yb.__super__=Nb;Yb.prototype=E(Nb.prototype,{values:function(){return this._values},_values:null,__class__:Yb});Eb=function(a){Yb.call(this,Eb.valuesByGroup(a));this.groupBy=a};j["rg.axis.AxisGroupByTime"]=Eb;Eb.__name__=["rg","axis","AxisGroupByTime"];Eb.valuesByGroup=function(a){return N.range(Eb.defaultMin(a),Eb.defaultMax(a)+1)};Eb.defaultMin=function(a){switch(a){case "minute":case "hour":case "week":case "month":return 0;case "day":return 1; -default:throw new J.Error("invalid periodicity '{0}' for groupBy min",null,a,{fileName:"AxisGroupByTime.hx",lineNumber:34,className:"rg.axis.AxisGroupByTime",methodName:"defaultMin"});}};Eb.defaultMax=function(a){switch(a){case "minute":return 59;case "hour":return 23;case "day":return 31;case "week":return 6;case "month":return 11;default:throw new J.Error("invalid periodicity '{0}' for groupBy max",null,a,{fileName:"AxisGroupByTime.hx",lineNumber:48,className:"rg.axis.AxisGroupByTime",methodName:"defaultMax"}); -}};Eb.__super__=Yb;Eb.prototype=E(Yb.prototype,{groupBy:null,__class__:Eb});qb=function(){};j["rg.axis.AxisNumeric"]=qb;qb.__name__=["rg","axis","AxisNumeric"];qb.__interfaces__=[Ld];qb._step=function(a,b){var c=Math.pow(10,Math.floor(Math.log(a/b)/2.302585092994046)),e=b/a*c;0.15>=e?c*=10:0.35>=e?c*=5:0.75>=e&&(c*=2);return c};qb.nice=function(a){return Math.pow(10,Math.round(Math.log(a)/2.302585092994046)-1)};qb.niceMin=function(a,b){var c=Math.pow(10,Math.round(Math.log(a)/2.302585092994046)-1); -return Math.floor(b/c)*c};qb.niceMax=function(a,b){var c=Math.pow(10,Math.round(Math.log(a)/2.302585092994046)-1);return Math.ceil(b/c)*c};qb.prototype={createStats:function(a){return new Ob(a)},max:function(a,b){if(null!=b.max)return b.max;var c=qb.niceMax(a.max-a.min,a.max);return 0c?c:0},ticks:function(a,b,c){var e=b-a,f;if(0==a%1&&0==b%1&&10>e&&1<=e)f=C.range(a,b+1,1),e=null;else{var h=qb._step(e, -5),e=qb._step(e,20),e=0==e?[0]:C.range(a,b,e,!0);f=0==h?[0]:C.range(a,b,h,!0)}return tb.bound(null==e?f.map(function(c){return new rc(c,!0,(c-a)/(b-a))}):e.map(function(c){return new rc(c,u.remove(f,c),(c-a)/(b-a))}),c)},scale:function(a,b,c){return a==b?a:C.uninterpolatef(a,b)(c)},__class__:qb};Kc=function(a){Nb.call(this);this.variable=a};j["rg.axis.AxisOrdinalStats"]=Kc;Kc.__name__=["rg","axis","AxisOrdinalStats"];Kc.__super__=Nb;Kc.prototype=E(Nb.prototype,{values:function(){return this.variable.stats.values}, -variable:null,__class__:Kc});Zb=function(a){this.periodicity=a;this.set_scaleDistribution(Va.ScaleFill)};j["rg.axis.AxisTime"]=Zb;Zb.__name__=["rg","axis","AxisTime"];Zb.__interfaces__=[kc];Zb.prototype={createStats:function(a){return new Ob(a)},max:function(a){return a.max},min:function(a){return a.min},set_scaleDistribution:function(a){return this.scaleDistribution=a},scale:function(a,b,c){switch(this.scaleDistribution[1]){case 1:return(c-a)/(b-a);default:return a=this.range(a,b),id.distribute(this.scaleDistribution, -a.indexOf(Da.snap(c,this.periodicity)),a.length)}},range:function(a,b){return U.range(a,b,this.periodicity)},ticks:function(a,b,c){var e=this,f=U.unitsBetween(a,b,this.periodicity),h=this.range(a,b),a=h.map(function(a){return new jd(a,h,e.isMajor(f,a),e.periodicity,e.scaleDistribution)});return tb.bound(a,c)},isMajor:function(a,b){switch(this.periodicity){case "day":if(31>=a)return!0;return 121>a?(function(){var a=new Date;a.setTime(b);return a}(this).getDate(),U.firstInSeries("month",b)||U.firstInSeries("week", -b)):U.firstInSeries("month",b);case "week":return 31>a?!0:7>=function(){var a=new Date;a.setTime(b);return a}(this).getDate();default:var c=m.field(Zb.snapping,this.periodicity),e=U.units(b,this.periodicity);if(null==c)return!0;for(var f=0;fh.to))return 0==e%h.s}c=m.field(Zb.snapping,this.periodicity+"top");null==c&&(c=1);return 0==e%c}},scaleDistribution:null,periodicity:null,__class__:Zb,__properties__:{set_scaleDistribution:"set_scaleDistribution"}};kd=function(){}; -j["rg.axis.ITickmark"]=kd;kd.__name__=["rg","axis","ITickmark"];kd.prototype={label:null,value:null,major:null,delta:null,__class__:kd};Va={__ename__:["rg","axis","ScaleDistribution"],__constructs__:["ScaleFit","ScaleFill","ScaleBefore","ScaleAfter"],ScaleFit:["ScaleFit",0]};Va.ScaleFit.toString=v;Va.ScaleFit.__enum__=Va;Va.ScaleFill=["ScaleFill",1];Va.ScaleFill.toString=v;Va.ScaleFill.__enum__=Va;Va.ScaleBefore=["ScaleBefore",2];Va.ScaleBefore.toString=v;Va.ScaleBefore.__enum__=Va;Va.ScaleAfter= -["ScaleAfter",3];Va.ScaleAfter.toString=v;Va.ScaleAfter.__enum__=Va;id=function(){};j["rg.axis.ScaleDistributions"]=id;id.__name__=["rg","axis","ScaleDistributions"];id.distribute=function(a,b,c){switch(a[1]){case 0:return(b+0.5)/c;case 1:return b/(c-1);case 2:return b/c;case 3:return(b+1)/c}};Cb=function(a,b){this.type=a;this.sortf=b;this.reset()};j["rg.axis.Stats"]=Cb;Cb.__name__=["rg","axis","Stats"];Cb.prototype={addMany:function(a){for(a=pa(a)();a.hasNext();){var b=a.next();this.count++;z.exists(this.values, -b)||this.values.push(b)}null!=this.sortf&&this.values.sort(this.sortf);this.min=this.values[0];this.max=z.last(this.values);return this},add:function(a){this.count++;if(z.exists(this.values,a))return this;this.values.push(a);null!=this.sortf&&this.values.sort(this.sortf);this.min=this.values[0];this.max=z.last(this.values);return this},reset:function(){this.max=this.min=null;this.count=0;this.values=[];return this},type:null,sortf:null,values:null,count:null,max:null,min:null,__class__:Cb};Ob=function(a, -b){if(null==b)b=C.compare;Cb.call(this,a,b)};j["rg.axis.StatsNumeric"]=Ob;Ob.__name__=["rg","axis","StatsNumeric"];Ob.__super__=Cb;Ob.prototype=E(Cb.prototype,{addMany:function(a){Cb.prototype.addMany.call(this,a);for(a=pa(a)();a.hasNext();)this.tot+=a.next();return this},add:function(a){Cb.prototype.add.call(this,a);this.tot+=a;return this},reset:function(){Cb.prototype.reset.call(this);this.tot=0;return this},tot:null,__class__:Ob});rc=function(a,b,c){this.value=a;this.major=b;this.delta=c};j["rg.axis.Tickmark"]= -rc;rc.__name__=["rg","axis","Tickmark"];rc.__interfaces__=[kd];rc.prototype={toString:function(){return tb.string(this)},get_label:function(){return ya.humanize(this.get_value())},get_value:function(){return this.value},get_major:function(){return this.major},get_delta:function(){return this.delta},label:null,value:null,major:null,delta:null,__class__:rc,__properties__:{get_delta:"get_delta",get_major:"get_major",get_value:"get_value",get_label:"get_label"}};Db=function(a,b,c,e){null==c&&(c=!0);this.pos= -a;this.values=b;this.scaleDistribution=e;this.major=c};j["rg.axis.TickmarkOrdinal"]=Db;Db.__name__=["rg","axis","TickmarkOrdinal"];Db.__interfaces__=[kd];Db.fromArray=function(a,b){return a.map(function(c,e){return new Db(e,a,null,b)})};Db.prototype={toString:function(){return tb.string(this)},get_label:function(){return ya.humanize(this.values[this.pos])},label:null,get_value:function(){return this.values[this.pos]},value:null,get_major:function(){return this.major},major:null,get_delta:function(){return id.distribute(this.scaleDistribution, -this.pos,this.values.length)},delta:null,scaleDistribution:null,values:null,pos:null,__class__:Db,__properties__:{get_delta:"get_delta",get_major:"get_major",get_value:"get_value",get_label:"get_label"}};jd=function(a,b,c,e,f){Db.call(this,b.indexOf(a),b,c,f);this.periodicity=e};j["rg.axis.TickmarkTime"]=jd;jd.__name__=["rg","axis","TickmarkTime"];jd.__super__=Db;jd.prototype=E(Db.prototype,{get_label:function(){return U.smartFormat(this.periodicity,this.values[this.pos])},periodicity:null,__class__:jd}); -tb=function(){};j["rg.axis.Tickmarks"]=tb;tb.__name__=["rg","axis","Tickmarks"];tb.bound=function(a,b){if(null==b||a.length<=(2>b?2:b))return a;var c=z.filter(a,function(a){return a.get_major()});if(c.length>b)return tb.reduce(c,b);c=tb.reduce(z.filter(a,function(a){return!a.get_major()}),b-c.length).concat(c);c.sort(function(a,b){return C.compare(a.get_delta(),b.get_delta())});return c};tb.reduce=function(a,b){if(1==b)return[a[0]];if(2==b)return[a[a.length-1]];var c=a.length/b,e=[],f=0;do e.push(a[Math.round(c* -f++)]);while(b>e.length);return e};tb.string=function(a){return da.string(a.get_value())+" ("+(a.get_major()?"Major":"minor")+", "+C.format(a.get_delta())+")"};tb.forFloat=function(a,b,c,e){return new rc(c,e,(c-a)/(b-a))};je=function(a){if(null==a)throw new J.NullArgument("loader","invalid null argument '{0}' for method {1}.{2}()",{fileName:"DataLoader.hx",lineNumber:11,className:"rg.data.DataLoader",methodName:"new"});this.loader=a;this.onLoad=new Id};uc=void 0;Lc=void 0;Pd=void 0;Qd=void 0;Mc=void 0; -$b=void 0;j["rg.data.DataLoader"]=je;je.__name__=["rg","data","DataLoader"];je.prototype={load:function(){var a=this;this.loader(function(b){a.onLoad.dispatch(b)})},onLoad:null,loader:null,__class__:je};Qd=function(){};j["rg.data.DependentVariableProcessor"]=Qd;Qd.__name__=["rg","data","DependentVariableProcessor"];Qd.prototype={process:function(a,b){for(var c=0;cx&&(o=x);c+=o+k+m;e.push(o+k+m);break;case 2:x=k[4];m=k[3];k=k[2];null==x&&(x=1);o=Math.round(b*x);c+=o+k+m;e.push(o+k+m);break;case 3:o=k[4];m=k[3];k=k[2];c+=o+k+m;e.push(o+k+m);break;case 4:m=k[5],x=k[4],j=k[3],k=k[2],e.push(0)}h++}a-=c;if(0a&&this.moreSpaceRequired(c)},iterator:function(){return u.iter(this.children)}, -removeChild:function(a){if(!u.remove(this.children,a))return!1;a.set_parent(null);this.reflow();return!0},addItems:function(a){for(var b=!1,a=pa(a)();a.hasNext();){var c=a.next();null!=c&&(b=!0,this.children.push(c),c.set_parent(this))}b&&this.reflow();return this},addItem:function(a){if(null==a)return this;this.children.push(a);a.set_parent(this);this.reflow();return this},insertItem:function(a,b){if(null==b)return this;if(a>=this.children.length)return this.addItem(b);0>a&&(a=0);this.children.splice(a, -0,b);b.set_parent(this);this.reflow();return this},moreSpaceRequired:function(){},length:null,orientation:null,height:null,width:null,children:null,__class__:Kd,__properties__:{get_length:"get_length"}};mb=function(a){Xc.call(this);this.set_disposition(a)};j["rg.frame.StackItem"]=mb;mb.__name__=["rg","frame","StackItem"];mb.__super__=Xc;mb.prototype=E(Xc.prototype,{set_disposition:function(a){this.disposition=a;null!=this.parent&&this.parent.reflow();return a},set_parent:function(a){null!=this.parent&& -this.parent.removeChild(this);return this.parent=a},parent:null,disposition:null,__class__:mb,__properties__:{set_disposition:"set_disposition"}});nb={};L=void 0;nb.Leadeboard=function(a){this.ready=new pc;this.container=a;this.animated=!0;this.animationDuration=1500;this.animationEase=A.Equations.elasticf();this.animationDelay=150;this._created=0;this.displayGradient=!0;this.colorScale=this.useMax=!1};j["rg.html.chart.Leadeboard"]=nb.Leadeboard;nb.Leadeboard.__name__=["rg","html","chart","Leadeboard"]; -nb.Leadeboard.prototype={id:function(a){return La.id(a,[this.variableDependent.type])},lTitle:function(a){return this.labelDataPointOver(a,this.stats)},lDataPoint:function(a){return this.labelDataPoint(a,this.stats)},lValue:function(a){return this.labelValue(a,this.stats)},lRank:function(a,b){return this.labelRank(a,b,this.stats)},fadeIn:function(a,b){var c=this;S.selectNodeData(a).transition().ease(this.animationEase).duration(null,this.animationDuration).delay(null,this.animationDelay*(b-this._created)).attr("opacity")["float"](1).endNode(function(){c._created++})}, -onClick:function(a){this.click(a)},data:function(a){null!=this.sortDataPoint&&a.sort(this.sortDataPoint);if(null!=this.variableDependent.stats){this.stats=G.__cast(this.variableDependent.stats,Ob);var a=this.list.selectAll("li").data(a,y(this,this.id)),b=a.enter().append("li");b.attr("title").stringf(y(this,this.lTitle));b.append("div").attr("class").stringf(function(a,b){return 0==b%2?"rg_background fill-0":"rg_background"});var c=b.append("div").attr("class").string("rg_labels");if(null!=y(this, +(function(){var mb,nb,Eb,eb,Fa,Ra,fb,vb,ad,$b,bd,ia,Qa,Od,pb,cd,dd,xa,ed,fd,gd,hd,id,jd,Fb,kd,ld,mc,Oa,Ya,Qb,Pd,nc,md,Rb,Za,Gb,nd,Hb,wb,ac,Ib,sb,Sb,vc,Oc,bc,od,pd,Jb,db,ta,V,s,p,X,Ka,wc,qd,W,ya,Ca,Qd,Rd,Pa,aa,Sd,xb,xc,L,qb,Sa,Tb,ne,yc,Pc,Td,Ud,Qc,cc,Kb,Vd,Wd,Xd,rd,Yd,dc,Zd,ua,sd,td,ud,vd,wd,xd,yd,Lb,zd,Rc,Ad,Bd,Sc,Tc,Cd,Dd,Uc,Vc,yb,i,La,Mb,gb,oc,zc,Ma,Wc,Ac,Bc,Cc,Xc,Ed,Fd,ec,zb,$d,fc,Ab,rb,o,J,C,hb,g,x,ca,Y,q,ja,Ua,T,t,Ta,tb,gc,ib,Bb,oe,pe,Va,r,$a,oa,la,Ub,Vb,qe,ae,be,Yc,Dc,Wb,S,hc,Ec,qa,jb,M,Q,Nb, +z,I,ma,Gd,G,ba,Xb,Ha,Z,re;function H(a,b){function c(){}c.prototype=a;var e=new c,f;for(f in b)e[f]=b[f];return e}function ra(a){return a instanceof Array?function(){return u.iter(a)}:"function"==typeof a.iterator?y(a,a.iterator):a.iterator}function y(a,b){var c=function(){return c.method.apply(c.scope,arguments)};c.scope=a;c.method=b;return c}var j={},v=function(){return I.__string_rec(this,"")},B=function(){};j.Arrays=B;B.__name__=["Arrays"];B.addIf=function(a,b,c){null!=b?b&&a.push(c):null!=c&& +a.push(c);return a};B.add=function(a,b){a.push(b);return a};B["delete"]=function(a,b){u.remove(a,b);return a};B.removef=function(a,b){for(var c=-1,e=0,f=a.length;ec)return!1;a.splice(c,1);return!0};B.deletef=function(a,b){B.removef(a,b);return a};B.filter=function(a,b){for(var c=[],e=0;e(f=b(a[A])))c=f,e=A}return a[e]};B.floatMin=function(a,b){if(0==a.length)return Math.NaN;for(var c=b(a[0]),e,f=1,h=a.length;f(e=b(a[e])))c=e;return c};B.bounds=function(a,b){if(0==a.length)return null;if(null==b)for(var c=a[0],e=0,f=a[0],h=0,m=1,A=a.length;mk(f,a[g])&&(f=a[h=g])}else{c=b(a[0]);e=0;k=b(a[0]);h=0;m=1;for(A=a.length;m(f=b(a[g])))c=f,e=g;m=1;for(A=a.length;m(e=b(a[A])))c=e;if(f<(e=b(a[A])))f=e}return[c,f]};B.max=function(a,b){if(0==a.length)return null;if(null==b)for(var c=a[0],e=0,f=fa.comparef(c),h=1,m=a.length;hf(c,a[A])&&(c=a[e=A])}else{c=b(a[0]);e=0;h=1;for(m=a.length;h>1;b>1;a[f]a||a>e?null:A(a,0,f.length-1)}};var ab=function(){};j.Bools=ab;ab.__name__=["Bools"];ab.format=function(a,b,c,e){return ab.formatf(b,c,e)(a)};ab.formatf= +function(a,b){var b=o.FormatParams.params(a,b,"B"),c=b.shift();switch(c){case "B":return function(a){return a?"true":"false"};case "N":return function(a){return a?"1":"0"};case "R":if(2!=b.length)throw"bool format R requires 2 parameters";return function(a){return a?b[0]:b[1]};default:throw"Unsupported bool format: "+c;}};ab.interpolate=function(a,b,c,e){return ab.interpolatef(b,c,e)(a)};ab.interpolatef=function(a,b,c){if(a==b)return function(){return a};var e=D.interpolatef(0,1,c);return function(c){return 0.5> +e(c)?a:b}};ab.canParse=function(a){a=a.toLowerCase();return"true"==a||"false"==a};ab.parse=function(a){return"true"==a.toLowerCase()};ab.compare=function(a,b){return a==b?0:a?-1:1};var pa=function(a,b){this.length=a;this.b=b};j.Bytes=pa;pa.__name__=["Bytes"];pa.alloc=function(a){for(var b=[],c=0;c=f?b.push(f):(2047>=f?b.push(192|f>>6):(65535>=f?b.push(224|f>>12):(b.push(240|f>> +18),b.push(128|f>>12&63)),b.push(128|f>>6&63)),b.push(128|f&63))}return new pa(b.length,b)};pa.ofStringData=function(a){for(var b=[],c=0,e=a.length;ca||0>b||a+b>this.length)throw new G.OutsideBoundsException;for(var c= +"",e=this.b,f=String.fromCharCode,h=a,m=a+b;hA){if(0==A)break;c+=f(A)}else if(224>A)c+=f((A&63)<<6|e[h++]&127);else if(240>A)var g=e[h++],c=c+f((A&31)<<12|(g&127)<<6|e[h++]&127);else var g=e[h++],k=e[h++],c=c+f((A&15)<<18|(g&127)<<12|k<<6&127|e[h++]&127)}return c},compare:function(a){for(var b=this.b,c=a.b,e=this.lengththis.length&&(b=this.length-a);if(0>a||0>b)throw new G.OutsideBoundsException;return new pa(b,this.b.slice(a,a+b))},blit:function(a,b,c,e){null==e&&(e=b.length-c);c+e>b.length&&(e=b.length-c);if(0>a||0>c||0>e||a+e>this.length||c+e>b.length)throw new G.OutsideBoundsException;var f=this.b,b=b.b;if(f==b&&a>c)for(var h=e;0b||0>c||b+c>a.length)throw new G.OutsideBoundsException;for(var a=a.b,e=b,b=b+c;ef)throw"Value out of range";c.b.push(f)}return null!=b&&0f)throw"Value out of range";c.b.push(f)}return null!=b&&0f)throw"Value out of range";c.b.push(f)}return null!=b&&0a){if(-128>a)throw"not a byte";a=a&255|128}if(255b?!0:!1,c=F.lpad(c,"0",4);return b?"-"+c:"+"+c}(c);break;default:throw"Date.format %"+b+"- not implemented yet.";}return c}(this)}; +za.__format=function(a,b){for(var c=new bb,e=0;;){var f=b.indexOf("%",e);if(0>f)break;c.b+=u.substr(b,e,f-e);c.b+=n.string(za.__format_get(a,u.substr(b,f+1,1)));e=f+2}c.b+=u.substr(b,e,b.length-e);return c.b};za.format=function(a,b){return za.__format(a,b)};za.delta=function(a,b){var c=new Date;c.setTime(a.getTime()+b);return c};za.getMonthDays=function(a){var b=a.getMonth(),a=a.getFullYear();return 1!=b?za.DAYS_OF_MONTH[b]:0==a%4&&0!=a%100||0==a%400?29:28};za.seconds=function(a){return 1E3*a};za.minutes= +function(a){return 6E4*a};za.hours=function(a){return 36E5*a};za.days=function(a){return 864E5*a};za.parse=function(a){var b=a/1E3,c=b/60,e=c/60;return{ms:a%1E3,seconds:b%60|0,minutes:c%60|0,hours:e%24|0,days:e/24|0}};za.make=function(a){return a.ms+1E3*(a.seconds+60*(a.minutes+60*(a.hours+24*a.days)))};var R=function(a,b){b=b.split("u").join("");this.r=RegExp(a,b)};j.EReg=R;R.__name__=["EReg"];R.prototype={customReplace:function(a,b){for(var c=new bb;this.match(a);){c.b+=n.string(this.matchedLeft()); +c.b+=n.string(b(this));a=this.matchedRight()}c.b+=n.string(a);return c.b},replace:function(a,b){return a.replace(this.r,b)},split:function(a){return a.replace(this.r,"#__delim__#").split("#__delim__#")},matchedPos:function(){if(null==this.r.m)throw"No string matched";return{pos:this.r.m.index,len:this.r.m[0].length}},matchedRight:function(){if(null==this.r.m)throw"No string matched";if(null==this.r.r){var a=this.r.m.index+this.r.m[0].length;return this.r.s.substr(a,this.r.s.length-a)}return this.r.r}, +matchedLeft:function(){if(null==this.r.m)throw"No string matched";return null==this.r.l?this.r.s.substr(0,this.r.m.index):this.r.l},matched:function(a){if(null!=this.r.m&&0<=a&&ac)switch(b){case "second":return 1E3*Math.floor(a/1E3);case "minute":return 6E4* +Math.floor(a/6E4);case "hour":return 36E5*Math.floor(a/36E5);case "day":return b=function(){var b=new Date;b.setTime(a);return b}(this),(new Date(b.getFullYear(),b.getMonth(),b.getDate(),0,0,0)).getTime();case "week":return 6048E5*Math.floor(a/6048E5);case "month":return b=function(){var b=new Date;b.setTime(a);return b}(this),(new Date(b.getFullYear(),b.getMonth(),1,0,0,0)).getTime();case "year":return b=function(){var b=new Date;b.setTime(a);return b}(this),(new Date(b.getFullYear(),0,1,0,0,0)).getTime(); +default:return 0}else if(0Math.round(za.getMonthDays(b)/2)?1:0,(new Date(b.getFullYear(),b.getMonth()+c,1,0,0,0)).getTime();case "year":return b=function(){var b=new Date;b.setTime(a);return b}(this),c=a>(new Date(b.getFullYear(),6,2,0,0,0)).getTime()?1:0,(new Date(b.getFullYear()+c,0,1,0,0,0)).getTime();default:return 0}};va.snapToWeekDay=function(a,b){var c=new Date;c.setTime(a);var c=c.getDay(),e=0;switch(b.toLowerCase()){case "sunday":e=0;break;case "monday":e= +1;break;case "tuesday":e=2;break;case "wednesday":e=3;break;case "thursday":e=4;break;case "friday":e=5;break;case "saturday":e=6;break;default:throw new J.Error("unknown week day '{0}'",null,b,{fileName:"Dates.hx",lineNumber:186,className:"Dates",methodName:"snapToWeekDay"});}return a-864E5*((c-e)%7)};va.canParse=function(a){return va._reparse.match(a)};va.parse=function(a){var a=a.split("."),b=u.strDate(F.replace(a[0],"T"," "));if(1a.indexOf('"')?'"'+a+'"':0>a.indexOf("'")?"'"+a+"'":'"'+F.replace(a,'"','\\"')+'"';case "Date":return va.format(a);default:return n.string(a)}case 7:return ce.string(a);case 8:return"";case 5:return""}};fa.compare=function(a,b){if(null==a&&null==b)return 0;if(null==a)return-1; +if(null==b)return 1;var c=K["typeof"](a);switch(c[1]){case 1:return D.compare(a,b);case 2:return D.compare(a,b);case 3:return ab.compare(a,b);case 4:return ga.compare(a,b);case 6:switch(K.getClassName(c[2])){case "Array":return B.compare(a,b);case "String":return E.compare(a,b);case "Date":return va.compare(a,b);default:return E.compare(n.string(a),n.string(b))}case 7:return ce.compare(a,b);default:return 0}};fa.comparef=function(a){a=K["typeof"](a);switch(a[1]){case 1:return D.compare;case 2:return D.compare; +case 3:return ab.compare;case 4:return ga.compare;case 6:switch(K.getClassName(a[2])){case "Array":return B.compare;case "String":return E.compare;case "Date":return va.compare;default:return function(a,c){return E.compare(n.string(a),n.string(c))}}case 7:return ce.compare;default:return fa.compare}};fa.clone=function(a,b){null==b&&(b=!1);var c=K["typeof"](a);switch(c[1]){case 0:return null;case 1:return a;case 2:return a;case 3:return a;case 7:return a;case 8:return a;case 5:return a;case 4:var e= +{};ga.copyTo(a,e);return e;case 6:switch(c=c[2],K.getClassName(c)){case "Array":e=[];for(c=0;c +a?0:1c?c:a};D.clampSym=function(a,b){return a<-b?-b:a>b?b:a};D.range=function(a,b,c,e){null==e&&(e=!1);null==c&&(c=1);null==b&&(b=a,a=0);if((b-a)/c==Math.POSITIVE_INFINITY)throw new J.Error("infinite range",null,null,{fileName:"Floats.hx",lineNumber:50,className:"Floats",methodName:"range"});var f=[],h=-1;if(e)if(0>c)for(;(e=a+c*++h)>=b;)f.push(e);else for(;(e=a+c*++h)<=b;)f.push(e);else if(0>c)for(;(e=a+c*++h)>b;)f.push(e);else for(;(e=a+c*++h)a?-1:1};D.abs=function(a){return 0>a?-a:a};D.min=function(a,b){return ab?a:b};D.wrap=function(a,b,c){c=c-b+1;aa&&(a+=b);return a};D.interpolate=function(a,b,c,e){null==c&&(c=1);null==b&&(b=0);if(null==e)e=C.Equations.linear;return b+e(a)*(c-b)};D.interpolatef=function(a,b,c){null==b&&(b=1);null==a&&(a=0);if(null==c)c=C.Equations.linear;var e=b-a;return function(b){return a+ +c(b)*e}};D.interpolateClampf=function(a,b,c){if(null==c)c=C.Equations.linear;return function(e,f){var h=f-e;return function(f){return e+c(D.clamp(f,a,b))*h}}};D.format=function(a,b,c,e){return D.formatf(b,c,e)(a)};D.formatf=function(a,b,c){var b=o.FormatParams.params(a,b,"D"),a=b.shift(),e=0b?1:0};D.isNumeric=function(a){return I.__instanceof(a,Fc)||I.__instanceof(a,Hd)};D.equals=function(a,b,c){null==c&&(c=1.0E-5);return Math.isNaN(a)?Math.isNaN(b):Math.isNaN(b)?!1:!Math.isFinite(a)&&!Math.isFinite(b)?0b?"0"+b:""+b)+"-"+(10>c?"0"+c:""+c)+" "+(10>e?"0"+e:""+e)+":"+(10>f?"0"+f:""+f)+":"+(10>h?"0"+h:""+h)};u.strDate=function(a){switch(a.length){case 8:var a=a.split(":"),b=new Date;b.setTime(0); +b.setUTCHours(a[0]);b.setUTCMinutes(a[1]);b.setUTCSeconds(a[2]);return b;case 10:return a=a.split("-"),new Date(a[0],a[1]-1,a[2],0,0,0);case 19:return a=a.split(" "),b=a[0].split("-"),a=a[1].split(":"),new Date(b[0],b[1]-1,b[2],a[0],a[1],a[2]);default:throw"Invalid date format : "+a;}};u.cca=function(a,b){var c=a.charCodeAt(b);return c!=c?void 0:c};u.substr=function(a,b,c){if(null!=b&&0!=b&&null!=c&&0>c)return"";if(null==c)c=a.length;0>b?(b=a.length+b,0>b&&(b=0)):0>c&&(c=a.length+c-b);return a.substr(b, +c)};u.remove=function(a,b){for(var c=0,e=a.length;c>>24&-1};da.B3=function(a){return a>>>16&255};da.B2=function(a){return a>>>8&255};da.B1=function(a){return a&255};da.abs=function(a){return Math.abs(a)|0};da.add=function(a,b){return a+ +b};da.alphaFromArgb=function(a){return a>>>24&-1};da.and=function(a,b){return a&b};da.baseEncode=function(a,b){if(2>b||36a?"-"+c:c};da.complement=function(a){return~a};da.compare=function(a,b){return a-b};da.div=function(a,b){return a/b|0};da.encodeBE=function(a){var b=new Ga;b.b.push(a>>>24&-1);b.b.push(a>>>16&255);b.b.push(a>>>8&255);b.b.push(a& +255);return b.getBytes()};da.encodeLE=function(a){var b=new Ga;b.b.push(a&255);b.b.push(a>>>8&255);b.b.push(a>>>16&255);b.b.push(a>>>24&-1);return b.getBytes()};da.decodeBE=function(a,b){null==b&&(b=0);var c=a.b[b+3],e=a.b[b+2],f=a.b[b+1],h=a.b[b];return c+(e<<8)+(f<<16)+(h<<24)};da.decodeLE=function(a,b){null==b&&(b=0);var c=a.b[b],e=a.b[b+1],f=a.b[b+2],h=a.b[b+3];return c+(e<<8)+(f<<16)+(h<<24)};da.eq=function(a,b){return a==b};da.gt=function(a,b){return a>b};da.gteq=function(a,b){return a>=b}; +da.lt=function(a,b){return a>>24&-1);b.b.push(a[f]>>>16&255);b.b.push(a[f]>>>8&255);b.b.push(a[f]&255)}return b.getBytes()};da.packLE= +function(a){for(var b=new Ga,c=0,e=a.length;c>>8&255);b.b.push(a[f]>>>16&255);b.b.push(a[f]>>>24&-1)}return b.getBytes()};da.rgbFromArgb=function(a){return a&16777215};da.sub=function(a,b){return a-b};da.shl=function(a,b){return a<>b};da.toColor=function(a){return{alpha:a>>>24&-1,color:a&16777215}};da.toFloat=function(a){return 1*a};da.toInt=function(a){return a&-1};da.toNativeArray=function(a){return a};da.unpackLE= +function(a){if(null==a||0==a.length)return[];if(0!=a.length%4)throw"Buffer not multiple of 4 bytes";for(var b=[],c=0,e=0,f=a.length;c>>b};da.xor=function(a,b){return a^b};var Gc=function(){this.h={}};j.IntHash=Gc;Gc.__name__=["IntHash"];Gc.prototype= +{iterator:function(){return{ref:this.h,it:this.keys(),hasNext:function(){return this.it.hasNext()},next:function(){return this.ref[this.it.next()]}}},keys:function(){var a=[],b;for(b in this.h)this.h.hasOwnProperty(b)&&a.push(b|0);return u.iter(a)},remove:function(a){if(!this.h.hasOwnProperty(a))return!1;delete this.h[a];return!0},exists:function(a){return this.h.hasOwnProperty(a)},get:function(a){return this.h[a]},set:function(a,b){this.h[a]=b},h:null,__class__:Gc};var pc=function(){};j.IntHashes= +pc;pc.__name__=["IntHashes"];pc.empty=function(a){return 0==pc.count(a)};pc.count=function(a){for(var b=0,a=a.iterator();a.hasNext();)a.next(),b++;return b};pc.clear=function(a){a.h={};if(null!=a.h.__proto__)a.h.__proto__=null,delete a.h.__proto__};var ze=function(a,b){this.min=a;this.max=b};j.IntIterator=ze;ze.__name__=["IntIterator"];ze.prototype={max:null,min:null,__class__:ze};var O=function(){};j.Ints=O;O.__name__=["Ints"];O.range=function(a,b,c){null==c&&(c=1);null==b&&(b=a,a=0);if((b-a)/c== +Math.POSITIVE_INFINITY)throw new J.Error("infinite range",null,null,{fileName:"Ints.hx",lineNumber:19,className:"Ints",methodName:"range"});var e=[],f=-1,h;if(0>c)for(;(h=a+c*++f)>b;)e.push(h);else for(;(h=a+c*++f)a?-1:1};O.abs=function(a){return 0>a?-a:a};O.min=function(a,b){return ab?a:b};O.wrap=function(a,b,c){return Math.round(D.wrap(a,b,c))};O.clamp=function(a,b,c){return ac?c:a};O.clampSym=function(a, +b){return a<-b?-b:a>b?b:a};O.interpolate=function(a,b,c,e){null==c&&(c=100);null==b&&(b=0);if(null==e)e=C.Equations.linear;return Math.round(b+e(a)*(c-b))};O.interpolatef=function(a,b,c){null==b&&(b=1);null==a&&(a=0);if(null==c)c=C.Equations.linear;var e=b-a;return function(b){return Math.round(a+c(b)*e)}};O.format=function(a,b,c,e){return O.formatf(b,c,e)(a)};O.formatf=function(a,b,c){return D.formatf(null,o.FormatParams.params(a,b,"I"),c)};O.canParse=function(a){return O._reparse.match(a)};O.parse= +function(a){"+"==u.substr(a,0,1)&&(a=u.substr(a,1,null));return n.parseInt(a)};O.compare=function(a,b){return a-b};var Wa=function(){};j.Iterables=Wa;Wa.__name__=["Iterables"];Wa.count=function(a){return N.count(ra(a)())};Wa.indexOf=function(a,b,c){return N.indexOf(ra(a)(),b,c)};Wa.contains=function(a,b,c){return N.contains(ra(a)(),b,c)};Wa.array=function(a){return N.array(ra(a)())};Wa.join=function(a,b){null==b&&(b=", ");return N.array(ra(a)()).join(b)};Wa.map=function(a,b){return N.map(ra(a)(), +b)};Wa.each=function(a,b){return N.each(ra(a)(),b)};Wa.filter=function(a,b){return N.filter(ra(a)(),b)};Wa.reduce=function(a,b,c){return N.reduce(ra(a)(),b,c)};Wa.random=function(a){return B.random(N.array(ra(a)()))};Wa.any=function(a,b){return N.any(ra(a)(),b)};Wa.all=function(a,b){return N.all(ra(a)(),b)};Wa.last=function(a){return N.last(ra(a)())};Wa.lastf=function(a,b){return N.lastf(ra(a)(),b)};Wa.first=function(a){return ra(a)().next()};Wa.firstf=function(a,b){return N.firstf(ra(a)(),b)};Wa.order= +function(a,b){return B.order(N.array(ra(a)()),b)};Wa.isIterable=function(a){var b=l.isObject(a)&&null==K.getClass(a)?l.fields(a):K.getInstanceFields(K.getClass(a));return!te.has(b,"iterator")?!1:l.isFunction(l.field(a,"iterator"))};var N=function(){};j.Iterators=N;N.__name__=["Iterators"];N.count=function(a){for(var b=0;a.hasNext();)a.next(),b++;return b};N.indexOf=function(a,b,c){null==c&&(c=function(a){return b==a});for(var e=0;a.hasNext();){var f=a.next();if(c(f))return e;e++}return-1};N.contains= +function(a,b,c){for(null==c&&(c=function(a){return b==a});a.hasNext();){var e=a.next();if(c(e))return!0}return!1};N.array=function(a){for(var b=[];a.hasNext();){var c=a.next();b.push(c)}return b};N.join=function(a,b){null==b&&(b=", ");return N.array(a).join(b)};N.map=function(a,b){for(var c=[],e=0;a.hasNext();){var f=a.next();c.push(b(f,e++))}return c};N.each=function(a,b){for(var c=0;a.hasNext();){var e=a.next();b(e,c++)}};N.filter=function(a,b){for(var c=[];a.hasNext();){var e=a.next();b(e)&&c.push(e)}return c}; +N.reduce=function(a,b,c){for(var e=0;a.hasNext();)var f=a.next(),c=b(c,f,e++);return c};N.random=function(a){return B.random(N.array(a))};N.any=function(a,b){for(;a.hasNext();){var c=a.next();if(b(c))return!0}return!1};N.all=function(a,b){for(;a.hasNext();){var c=a.next();if(!b(c))return!1}return!0};N.last=function(a){for(var b=null;a.hasNext();)b=a.next();return b};N.lastf=function(a,b){var c=N.array(a);c.reverse();return B.lastf(c,b)};N.first=function(a){return a.next()};N.firstf=function(a,b){for(;a.hasNext();){var c= +a.next();if(b(c))return c}return null};N.order=function(a,b){return B.order(N.array(a),b)};N.isIterator=function(a){var b=l.isObject(a)&&null==K.getClass(a)?l.fields(a):K.getInstanceFields(K.getClass(a));return!te.has(b,"next")||!te.has(b,"hasNext")?!1:l.isFunction(l.field(a,"next"))&&l.isFunction(l.field(a,"hasNext"))};var te=function(){};j.Lambda=te;te.__name__=["Lambda"];te.has=function(a,b,c){if(null==c)for(c=ra(a)();c.hasNext();){if(a=c.next(),a==b)return!0}else for(var e=ra(a)();e.hasNext();)if(a= +e.next(),c(a,b))return!0;return!1};var Ae=function(){};j.List=Ae;Ae.__name__=["List"];Ae.prototype={iterator:function(){return{h:this.h,hasNext:function(){return null!=this.h},next:function(){if(null==this.h)return null;var a=this.h[0];this.h=this.h[1];return a}}},h:null,__class__:Ae};var ga=function(){};j.Objects=ga;ga.__name__=["Objects"];ga.field=function(a,b,c){return l.hasField(a,b)?l.field(a,b):c};ga.keys=function(a){return l.fields(a)};ga.values=function(a){for(var b=[],c=0,e=l.fields(a);c< +e.length;){var f=e[c];++c;b.push(l.field(a,f))}return b};ga.entries=function(a){for(var b=[],c=0,e=l.fields(a);c=a?0:Math.floor(Math.random()*a)};var bb=function(){this.b=""};j.StringBuf=bb;bb.__name__=["StringBuf"];bb.prototype={toString:function(){return this.b},addSub:function(a,b,c){this.b+=u.substr(a,b,c)},addChar:function(a){this.b+=String.fromCharCode(a)},add:function(a){this.b+=n.string(a)},b:null,__class__:bb};var F=function(){};j.StringTools=F;F.__name__=["StringTools"];F.urlEncode=function(a){return encodeURIComponent(a)};F.urlDecode=function(a){return decodeURIComponent(a.split("+").join(" "))}; +F.htmlEscape=function(a){return a.split("&").join("&").split("<").join("<").split(">").join(">")};F.htmlUnescape=function(a){return a.split(">").join(">").split("<").join("<").split("&").join("&")};F.startsWith=function(a,b){return a.length>=b.length&&u.substr(a,0,b.length)==b};F.endsWith=function(a,b){var c=b.length,e=a.length;return e>=c&&u.substr(a,e-c,c)==b};F.isSpace=function(a,b){var c=u.cca(a,b);return 9<=c&&13>=c||32==c};F.ltrim=function(a){for(var b=a.length,c=0;c=c)return a;for(var h=b.length;f>>=4;while(0=c};F.isAlpha=function(a,b){var c=u.cca(a,b);return 65<=c&&90>=c||97<=c&&122>=c};F.num=function(a,b){var c=u.cca(a,b);return 0c||9g;){m=g++;m=E._reFormat.matched(m);if(null==m||""==m)break;A.push(o.FormatParams.cleanQuotes(m))}g=[E._reFormat.matchedLeft()];e.push(function(a){return function(){return a[0]}}(g));h=[fa.formatf(h,A,b,c)];e.push(function(){return function(a, +b){return function(){return function(c){return a(b,c)}}()}}()(function(a){return function(b,c){return a[0](c[b])}}(h),f));a=E._reFormat.matchedRight()}return function(a){null==a&&(a=[]);return e.map(function(b){return b(a)}).join("")}};E.formatOne=function(a,b,c,e){return E.formatOnef(b,c,e)(a)};E.formatOnef=function(a,b){var b=o.FormatParams.params(a,b,"S"),c=b.shift();switch(c){case "S":return function(a){return a};case "T":return c=1>b.length?20:n.parseInt(b[0]),E.ellipsisf(c,2>b.length?"...": +b[1]);case "PR":var e=1>b.length?10:n.parseInt(b[0]),f=2>b.length?" ":b[1];return function(a){return F.rpad(a,f,e)};case "PL":var h=1>b.length?10:n.parseInt(b[0]),m=2>b.length?" ":b[1];return function(a){return F.lpad(a,m,h)};default:throw"Unsupported string format: "+c;}};E.upTo=function(a,b){var c=a.indexOf(b);return 0>c?a:u.substr(a,0,c)};E.startFrom=function(a,b){var c=a.indexOf(b);return 0>c?a:u.substr(a,c+b.length,null)};E.rtrim=function(a,b){for(var c=a.length;0b.indexOf(e))break;c--}return u.substr(a,0,c)};E.ltrim=function(a,b){for(var c=0;cb.indexOf(e))break;c++}return u.substr(a,c,null)};E.trim=function(a,b){return E.rtrim(E.ltrim(a,b),b)};E.collapse=function(a){return E._reCollapse.replace(F.trim(a)," ")};E.ucfirst=function(a){return null==a?null:a.charAt(0).toUpperCase()+u.substr(a,1,null)};E.lcfirst=function(a){return null==a?null:a.charAt(0).toLowerCase()+u.substr(a,1,null)};E.empty=function(a){return null== +a||""==a};E.isAlphaNum=function(a){return null==a?!1:E.__alphaNumPattern.match(a)};E.digitsOnly=function(a){return null==a?!1:E.__digitsPattern.match(a)};E.ucwords=function(a){return E.__ucwordsPattern.customReplace(null==a?null:a.charAt(0).toUpperCase()+u.substr(a,1,null),E.__upperMatch)};E.ucwordsws=function(a){return E.__ucwordswsPattern.customReplace(null==a?null:a.charAt(0).toUpperCase()+u.substr(a,1,null),E.__upperMatch)};E.__upperMatch=function(a){return a.matched(0).toUpperCase()};E.humanize= +function(a){return F.replace(E.underscore(a),"_"," ")};E.capitalize=function(a){return u.substr(a,0,1).toUpperCase()+u.substr(a,1,null)};E.succ=function(a){return u.substr(a,0,-1)+String.fromCharCode(u.cca(u.substr(a,-1,null),0)+1)};E.underscore=function(a){a=(new R("::","g")).replace(a,"/");a=(new R("([A-Z]+)([A-Z][a-z])","g")).replace(a,"$1_$2");a=(new R("([a-z\\d])([A-Z])","g")).replace(a,"$1_$2");a=(new R("-","g")).replace(a,"_");return a.toLowerCase()};E.dasherize=function(a){return F.replace(a, +"_","-")};E.repeat=function(a,b){for(var c=[],e=0;e=m-A){f.push(u.substr(a,h,null));break}for(var g=0;!F.isSpace(a,h+b-g)&&gb?0:a.length-b-1},h=[],m=[],A=[],g=[];e(a,h,m);e(b,A,g);for(var k=[],a=0,b=O.min(h.length,A.length);ae.length;)e.splice(0,0," ");for(;e.length>c.length;)c.splice(0,0," ");for(var f=[],h=0,m=c.length;hb?u.substr(a,0,O.max(c.length, +b-c.length))+c:a};E.ellipsisf=function(a,b){null==b&&(b="...");null==a&&(a=20);return function(c){return c.length>a?u.substr(c,0,O.max(b.length,a-b.length))+b:c}};E.compare=function(a,b){return ab?1:0};var ka={__ename__:["ValueType"],__constructs__:"TNull,TInt,TFloat,TBool,TObject,TFunction,TClass,TEnum,TUnknown".split(","),TNull:["TNull",0]};ka.TNull.toString=v;ka.TNull.__enum__=ka;ka.TInt=["TInt",1];ka.TInt.toString=v;ka.TInt.__enum__=ka;ka.TFloat=["TFloat",2];ka.TFloat.toString=v;ka.TFloat.__enum__= +ka;ka.TBool=["TBool",3];ka.TBool.toString=v;ka.TBool.__enum__=ka;ka.TObject=["TObject",4];ka.TObject.toString=v;ka.TObject.__enum__=ka;ka.TFunction=["TFunction",5];ka.TFunction.toString=v;ka.TFunction.__enum__=ka;ka.TClass=function(a){a=["TClass",6,a];a.__enum__=ka;a.toString=v;return a};ka.TEnum=function(a){a=["TEnum",7,a];a.__enum__=ka;a.toString=v;return a};ka.TUnknown=["TUnknown",8];ka.TUnknown.toString=v;ka.TUnknown.__enum__=ka;var K=function(){};j.Type=K;K.__name__=["Type"];K.getClass=function(a){return null== +a?null:a.__class__};K.getEnum=function(a){return null==a?null:a.__enum__};K.getSuperClass=function(a){return a.__super__};K.getClassName=function(a){return a.__name__.join(".")};K.getEnumName=function(a){return a.__ename__.join(".")};K.resolveClass=function(a){a=j[a];return null==a||!a.__name__?null:a};K.createInstance=function(a,b){switch(b.length){case 0:return new a;case 1:return new a(b[0]);case 2:return new a(b[0],b[1]);case 3:return new a(b[0],b[1],b[2]);case 4:return new a(b[0],b[1],b[2],b[3]); +case 5:return new a(b[0],b[1],b[2],b[3],b[4]);case 6:return new a(b[0],b[1],b[2],b[3],b[4],b[5]);case 7:return new a(b[0],b[1],b[2],b[3],b[4],b[5],b[6]);case 8:return new a(b[0],b[1],b[2],b[3],b[4],b[5],b[6],b[7]);default:throw"Too many arguments";}};K.createEmptyInstance=function(a){function b(){}b.prototype=a.prototype;return new b};K.createEnum=function(a,b,c){var e=l.field(a,b);if(null==e)throw"No such constructor "+b;if(l.isFunction(e)){if(null==c)throw"Constructor "+b+" need parameters";return e.apply(a, +c)}if(null!=c&&0!=c.length)throw"Constructor "+b+" does not need parameters";return e};K.getInstanceFields=function(a){var b=[],c;for(c in a.prototype)b.push(c);u.remove(b,"__class__");u.remove(b,"__properties__");return b};K["typeof"]=function(a){switch(typeof a){case "boolean":return ka.TBool;case "string":return ka.TClass(String);case "number":return Math.ceil(a)==a%2147483648?ka.TInt:ka.TFloat;case "object":if(null==a)return ka.TNull;var b=a.__enum__;if(null!=b)return ka.TEnum(b);a=a.__class__; +return null!=a?ka.TClass(a):ka.TObject;case "function":return a.__name__||a.__ename__?ka.TObject:ka.TFunction;case "undefined":return ka.TNull;default:return ka.TUnknown}};K.enumEq=function(a,b){if(a==b)return!0;try{if(a[0]!=b[0])return!1;for(var c=2,e=a.length;c=this.textSize)throw"Block size "+a+" to small for Pkcs1 with padCount "+this.padCount;return a},setPadCount:function(a){if(a+3>=this.blockSize)throw"Internal padding size exceeds crypt block size";this.padCount=a;this.textSize=this.blockSize- +3-this.padCount;return a},blockOverhead:function(){return 3+this.padCount},isBlockPad:function(){return!0},calcNumBlocks:function(a){return Math.ceil(a/this.textSize)},unpad:function(a){for(var b=0,c=new Ga;ba.length-b-3-this.padCount)throw"Unexpected short message";if(a.b[b]!=this.typeByte)throw"Expected marker "+this.typeByte+" at position "+b+" ["+na.hexDump(a)+"]";if(++b>=a.length)break;for(;bthis.textSize)throw"Unable to pad block: provided buffer is "+a.length+" max is "+this.textSize;var b=new Ga;b.b.push(0);b.b.push(this.typeByte);for(var c=this.blockSize-a.length-3;0>3},doPublic:function(a){return a.modPowInt(this.e, +this.n)},doBufferDecrypt:function(a,b,c){for(var e=this.__getBlockSize(),f=e-11,h=0,m=new Ga;ha.length&&(e=a.length-h);var A=r.ofBytes(a.sub(h,e),!0),A=b(A);if(null==A)return null;A=c.unpad(A.toBytesUnsigned());if(A.length>f)throw"block text length error";m.add(A);h+=e}return m.getBytes()},doBufferEncrypt:function(a,b,c){for(var e=this.__getBlockSize()-11,f=0,h=new Ga;fa.length&&(e=a.length-f);var m=r.ofBytes(c.pad(a.sub(f,e)),!0),m=b(m).toBytesUnsigned();0!=(m.length& +1)&&h.b.push(0);h.add(m);f+=e}return h.getBytes()},verify:function(a){return this.doBufferDecrypt(a,y(this,this.doPublic),new ba.PadPkcs1Type1(this.__getBlockSize()))},setPublic:function(a,b){this.init();if(null==a||0==a.length)throw new G.NullPointerException("nHex not set: "+a);if(null==b||0==b.length)throw new G.NullPointerException("eHex not set: "+b);var c=na.cleanHexFormat(a);this.n=r.ofString(c,16);if(null==this.n)throw 2;c=n.parseInt("0x"+na.cleanHexFormat(b));if(null==c||0==c)throw 3;this.e= +c},encyptText:function(a){return na.toHex(this.encrypt(pa.ofString(a)),":")},encryptBlock:function(a){var b=this.__getBlockSize();if(a.length!=b)throw"bad block size";for(var a=this.doPublic(r.ofBytes(a,!0)).toBytesUnsigned(),c=a.length,e=0;c>b;){if(0!=a.b[e])throw new G.FatalException("encoded length was "+a.length);e++;c--}0!=e&&(a=a.sub(e,c));if(a.length>1;e.e=n.parseInt(F.startsWith(b,"0x")?b:"0x"+b);for(var h=r.ofInt(e.e);;){e.p=r.randomPrime(a-f,h,10,!0,c);e.q=r.randomPrime(f,h,10,!0,c);if(0>=e.p.compare(e.q)){var m=e.p;e.p=e.q;e.q=m}var m=e.p.sub(r.getONE()),A=e.q.sub(r.getONE()),g=m.mul(A);if(0==g.gcd(h).compare(r.getONE())){e.n=e.p.mul(e.q);e.d=h.modInverse(g);e.dmp1=e.d.mod(m);e.dmq1=e.d.mod(A);e.coeff=e.q.modInverse(e.p);break}}return e};ba.RSA.__super__=ba.RSAEncrypt;ba.RSA.prototype=H(ba.RSAEncrypt.prototype, +{toString:function(){var a=new bb;a.b+=n.string(ba.RSAEncrypt.prototype.toString.call(this));a.b+="Private:\n";a.b+=n.string("D:\t"+this.d.toHex()+"\n");null!=this.p&&(a.b+=n.string("P:\t"+this.p.toHex()+"\n"));null!=this.q&&(a.b+=n.string("Q:\t"+this.q.toHex()+"\n"));null!=this.dmp1&&(a.b+=n.string("DMP1:\t"+this.dmp1.toHex()+"\n"));null!=this.dmq1&&(a.b+=n.string("DMQ1:\t"+this.dmq1.toHex()+"\n"));null!=this.coeff&&(a.b+=n.string("COEFF:\t"+this.coeff.toHex()+"\n"));return a.b},doPrivate:function(a){if(null== +this.p||null==this.q)return a.modPow(this.d,this.n);for(var b=a.mod(this.p).modPow(this.dmp1,this.p),a=a.mod(this.q).modPow(this.dmq1,this.q);0>b.compare(a);)b=b.add(this.p);return b.sub(a).mul(this.coeff).mod(this.p).mul(this.q).add(a)},recalcCRT:function(){if(null!=this.p&&null!=this.q){if(null==this.dmp1)this.dmp1=this.d.mod(this.p.sub(r.getONE()));if(null==this.dmq1)this.dmq1=this.d.mod(this.q.sub(r.getONE()));if(null==this.coeff)this.coeff=this.q.modInverse(this.p)}},setPrivateEx:function(a, +b,c,e,f,h,m,A){this.init();this.setPrivate(a,b,c);if(null!=e&&null!=f){this.p=r.ofString(na.cleanHexFormat(e),16);this.q=r.ofString(na.cleanHexFormat(f),16);this.coeff=this.dmq1=this.dmp1=null;if(null!=h)this.dmp1=r.ofString(na.cleanHexFormat(h),16);if(null!=m)this.dmq1=r.ofString(na.cleanHexFormat(m),16);if(null!=A)this.coeff=r.ofString(na.cleanHexFormat(A),16);this.recalcCRT()}else throw"Invalid RSA private key ex";},setPrivate:function(a,b,c){this.init();ba.RSAEncrypt.prototype.setPublic.call(this, +a,b);if(null!=c&&0this.__getBlockSize();){b=a.length-this.__getBlockSize();for(e=0;eb||0>c||b+c>a.length)throw new G.OutsideBoundsException;for(;0b||0>c||b+c>a.length)throw new G.OutsideBoundsException;this.b=a.b;this.pos=b;this.len=c;this.__setEndian(!1)};j["chx.io.BytesInput"]=Ha.BytesInput;Ha.BytesInput.__name__=["chx","io","BytesInput"];Ha.BytesInput.__super__=Ha.Input;Ha.BytesInput.prototype=H(Ha.Input.prototype,{getPosition:function(){return this.pos},setPosition:function(a){this.len+=this.getPosition()-a;return this.pos=a},peek:function(a){null==a&&(a=this.getPosition()); +var b=this.getPosition();this.setPosition(a);a=this.readByte();this.setPosition(b);return a},__getBytesAvailable:function(){return 0<=this.len?this.len:0},readBytes:function(a,b,c){if(0>b||0>c||b+c>a.length)throw new G.OutsideBoundsException;if(0==this.len&&0>>24)),this.writeByte(Vb.toInt(a>>>16)&255),this.writeByte(Vb.toInt(a>>>8)&255),this.writeByte(Vb.toInt(a&255))):(this.writeByte(Vb.toInt(a&255)),this.writeByte(Vb.toInt(a>>>8)&255),this.writeByte(Vb.toInt(a>>>16)&255),this.writeByte(Vb.toInt(a>>>24)));return this},writeUInt30:function(a){if(0>a||1073741824<=a)throw new G.OverflowException; +this.bigEndian?(this.writeByte(a>>>24),this.writeByte(a>>16&255),this.writeByte(a>>8&255),this.writeByte(a&255)):(this.writeByte(a&255),this.writeByte(a>>8&255),this.writeByte(a>>16&255),this.writeByte(a>>>24));return this},writeInt31:function(a){if(-1073741824>a||1073741824<=a)throw new G.OverflowException;this.bigEndian?(this.writeByte(a>>>24),this.writeByte(a>>16&255),this.writeByte(a>>8&255),this.writeByte(a&255)):(this.writeByte(a&255),this.writeByte(a>>8&255),this.writeByte(a>>16&255),this.writeByte(a>>> +24));return this},writeUInt24:function(a){if(0>a||16777216<=a)throw new G.OverflowException;this.bigEndian?(this.writeByte(a>>16),this.writeByte(a>>8&255),this.writeByte(a&255)):(this.writeByte(a&255),this.writeByte(a>>8&255),this.writeByte(a>>16));return this},writeInt24:function(a){if(-8388608>a||8388608<=a)throw new G.OverflowException;this.writeUInt24(a&16777215);return this},writeUInt16:function(a){if(0>a||65536<=a)throw new G.OverflowException;this.bigEndian?(this.writeByte(a>>8),this.writeByte(a& +255)):(this.writeByte(a&255),this.writeByte(a>>8));return this},writeInt16:function(a){if(-32768>a||32768<=a)throw new G.OverflowException;this.writeUInt16(a&65535);return this},writeUInt8:function(a){return this.writeByte(a)},writeInt8:function(a){if(-128>a||128<=a)throw new G.OverflowException;this.writeByte(a&255);return this},writeDouble:function(a){this.write($a.doubleToBytes(a,this.bigEndian));return this},writeFloat:function(a){this.write($a.floatToBytes(a,this.bigEndian));return this},writeFullBytes:function(a, +b,c){for(;0b||0>c||b+c>a.length)throw new G.OutsideBoundsException;for(;0w?(w=2,g=0):i='** sprintf: "." came too late **';break;case 48:48==h&&0==w?k|=1:3==w?i="** sprintf: shouldn't have a digit after h,l,L **":2>w?(w=1,A=10*A+(h-48)):g=10*g+(h-48);break;case 49:48==h&&0==w?k|=1:3==w?i="** sprintf: shouldn't have a digit after h,l,L **":2>w?(w=1,A=10*A+(h-48)):g=10*g+(h-48);break;case 50:48==h&&0==w?k|=1:3==w?i="** sprintf: shouldn't have a digit after h,l,L **":2>w?(w=1,A=10*A+(h-48)):g=10*g+(h-48);break;case 51:48==h&&0==w?k|=1:3==w?i="** sprintf: shouldn't have a digit after h,l,L **": +2>w?(w=1,A=10*A+(h-48)):g=10*g+(h-48);break;case 52:48==h&&0==w?k|=1:3==w?i="** sprintf: shouldn't have a digit after h,l,L **":2>w?(w=1,A=10*A+(h-48)):g=10*g+(h-48);break;case 53:48==h&&0==w?k|=1:3==w?i="** sprintf: shouldn't have a digit after h,l,L **":2>w?(w=1,A=10*A+(h-48)):g=10*g+(h-48);break;case 54:48==h&&0==w?k|=1:3==w?i="** sprintf: shouldn't have a digit after h,l,L **":2>w?(w=1,A=10*A+(h-48)):g=10*g+(h-48);break;case 55:48==h&&0==w?k|=1:3==w?i="** sprintf: shouldn't have a digit after h,l,L **": +2>w?(w=1,A=10*A+(h-48)):g=10*g+(h-48);break;case 56:48==h&&0==w?k|=1:3==w?i="** sprintf: shouldn't have a digit after h,l,L **":2>w?(w=1,A=10*A+(h-48)):g=10*g+(h-48);break;case 57:48==h&&0==w?k|=1:3==w?i="** sprintf: shouldn't have a digit after h,l,L **":2>w?(w=1,A=10*A+(h-48)):g=10*g+(h-48);break;case 100:i=!0;c+=Z.Sprintf.formatD(m,k,A,g);break;case 105:i=!0;c+=Z.Sprintf.formatD(m,k,A,g);break;case 111:i=!0;c+=Z.Sprintf.formatO(m,k,A,g);break;case 120:i=!0;c+=Z.Sprintf.formatX(m,k,A,g,88==h);break; +case 88:i=!0;c+=Z.Sprintf.formatX(m,k,A,g,88==h);break;case 101:i=!0;c+=Z.Sprintf.formatE(m,k,A,g,69==h);break;case 69:i=!0;c+=Z.Sprintf.formatE(m,k,A,g,69==h);break;case 102:i=!0;c+=Z.Sprintf.formatF(m,k,A,g);break;case 103:i=!0;c+=Z.Sprintf.formatG(m,k,A,g,71==h);break;case 71:i=!0;c+=Z.Sprintf.formatG(m,k,A,g,71==h);break;case 99:if(99==h||67==h)g=1;i=!0;c+=Z.Sprintf.formatS(m,k,A,g);break;case 67:if(99==h||67==h)g=1;i=!0;c+=Z.Sprintf.formatS(m,k,A,g);break;case 115:if(99==h||67==h)g=1;i=!0;c+= +Z.Sprintf.formatS(m,k,A,g);break;case 83:if(99==h||67==h)g=1;i=!0;c+=Z.Sprintf.formatS(m,k,A,g);break;case 37:i=!0;c+="%";e--;break;default:i="** sprintf: "+n.string(h-48)+" not supported **"}!0!=i&&Z.Sprintf.DEBUG&&(c+=n.string(i))}return c};Z.Sprintf.finish=function(a,b,c,e,f,h){null==h&&(h="");null==h&&(h="");0>b?h="-"+h:0!=(c&4)?h="+"+h:0!=(c&8)&&(h=" "+h);0==e&&-1Math.abs(a);)a*=10,h--;f=Z.Sprintf.format("%c%+.2d",[f?"E":"e",h]);if(0!=(b&2))for(h=Z.Sprintf.formatF(a,b,1,e)+ +f;h.lengthe&&(h=Math.round(Math.pow(10,e)*Z.Sprintf.number("0."+h)),n.string(h).length>e&&0!=h? +(h="0",f=n.string((Math.abs(Z.Sprintf.number(f))+1)*(0<=Z.Sprintf.number(f)?1:-1))):h=n.string(h)),h.length=c)return!1;this.lock++;return!0},lock:null,__class__:re.Lock};var sa,Zb,ic,de,ob,ee,Hc,fe,Ic,ge,ha,he,Jc,ie,Ob,Kc,je,Lc,ke,Mc,le,Ia,Na,Ea,Ja,wa,Aa,U,jc,qc,rc,Id,Cb,me,Zc,kc,Be,ue,Db,Jd, +Nc,Kd,ve,Ld,$c,Ba,Xa;sa=function(a){this.selection=a};j["dhx.Access"]=sa;sa.__name__=["dhx","Access"];sa.getData=function(a){return l.field(a,"__dhx_data__")};sa.setData=function(a,b){a.__dhx_data__=b};sa.emptyElement=function(a){return{__dhx_data__:a}};sa.eventName=function(a){return"__dhx_on__"+a};sa.getEvent=function(a,b){return l.field(a,"__dhx_on__"+b)};sa.hasEvent=function(a,b){return null!=l.field(a,"__dhx_on__"+b)};sa.addEvent=function(a,b,c){a["__dhx_on__"+b]=c};sa.removeEvent=function(a, +b){l.deleteField(a,"__dhx_on__"+b)};sa.setTransition=function(a,b){l.hasField(a,"__dhx_transition__")?l.field(a,"__dhx_transition__").owner=b:a.__dhx_transition__={owner:b}};sa.getTransition=function(a){return l.field(a,"__dhx_transition__")};sa.resetTransition=function(a){l.deleteField(a,"__dhx_transition__")};sa.prototype={_that:function(){return this.selection},selection:null,__class__:sa};Zb=function(a,b){sa.call(this,b);this.name=a;this.qname=ic.qualify(a)};j["dhx.AccessAttribute"]=Zb;Zb.__name__= +["dhx","AccessAttribute"];Zb.__super__=sa;Zb.prototype=H(sa.prototype,{"float":function(a){var b=""+a;if(null==this.qname){var c=this.name;this.selection.eachNode(function(a){a.setAttribute(c,b)})}else{var e=this.qname;this.selection.eachNode(function(a){a.setAttributeNS(e.space,e.local,b)})}return this.selection},string:function(a){if(null==this.qname){var b=this.name;this.selection.eachNode(function(c){c.setAttribute(b,a)})}else{var c=this.qname;this.selection.eachNode(function(b){b.setAttributeNS(c.space, +c.local,a)})}return this.selection},remove:function(){if(null==this.qname){var a=this.name;this.selection.eachNode(function(b){b.removeAttribute(a)})}else{var b=this.qname;this.selection.eachNode(function(a){a.removeAttributeNS(b.space,b.local)})}return this.selection},getFloat:function(){var a=this.get();return Zb.refloat.match(a)?n.parseFloat(Zb.refloat.matched(1)):Math.NaN},get:function(){var a=this.name,b=this.qname;return this.selection.firstNode(function(c){return null==b?c.getAttribute(a): +c.getAttributeNS(b.space,b.local)})},qname:null,name:null,__class__:Zb});de=function(a,b){Zb.call(this,a,b)};j["dhx.AccessDataAttribute"]=de;de.__name__=["dhx","AccessDataAttribute"];de.__super__=Zb;de.prototype=H(Zb.prototype,{data:function(){return this.stringf(function(a){return""+n.string(a)})},floatf:function(a){if(null==this.qname){var b=this.name;this.selection.eachNode(function(c,f){var h=a(l.field(c,"__dhx_data__"),f);null==h?c.removeAttribute(b):c.setAttribute(b,""+h)})}else{var c=this.qname; +this.selection.eachNode(function(b,f){var h=a(l.field(b,"__dhx_data__"),f);null==h?b.removeAttributeNS(c.space,c.local):b.setAttributeNS(c.space,c.local,""+h)})}return this.selection},stringf:function(a){if(null==this.qname){var b=this.name;this.selection.eachNode(function(c,f){var h=a(l.field(c,"__dhx_data__"),f);null==h?c.removeAttribute(b):c.setAttribute(b,h)})}else{var c=this.qname;this.selection.eachNode(function(b,f){var h=a(l.field(b,"__dhx_data__"),f);null==h?b.removeAttributeNS(c.space,c.local): +b.setAttributeNS(c.space,c.local,h)})}return this.selection},__class__:de});ob=function(a){sa.call(this,a)};j["dhx.AccessClassed"]=ob;ob.__name__=["dhx","AccessClassed"];ob.escapeERegChars=function(a){return ob._escapePattern.customReplace(a,function(a){return"\\"+a.matched(0)})};ob.getRe=function(a){return new R("(^|\\s+)"+ob.escapeERegChars(a)+"(\\s+|$)","g")};ob.__super__=sa;ob.prototype=H(sa.prototype,{get:function(){var a=this.selection.node(),b=a.classList;if(null!=b){for(var a=[],c=0,e=b.length;c< +e;){var f=c++;a.push(b.item(f))}return a.join(" ")}b=a.className;return null!=b.baseVal?b.baseVal:b},_add:function(a,b){var c=b.classList;if(null!=c)c.add(a);else{var c=b.className,e=null!=c.baseVal,f=e?c.baseVal:c;if(!(new R("(^|\\s+)"+ob.escapeERegChars(a)+"(\\s+|$)","g")).match(f))f=E.collapse(f+" "+a),e?c.baseVal=f:b.className=f}},add:function(a){this.selection.eachNode(function(a,c){return function(e,f){return a(c,e,f)}}(y(this,this._add),a));return this.selection},_remove:function(a,b){var c= +b.classList;if(null!=c)c.remove(a);else{var c=b.className,e=null!=c.baseVal,f=e?c.baseVal:c,h=new R("(^|\\s+)"+ob.escapeERegChars(a)+"(\\s+|$)","g"),f=E.collapse(h.replace(f," "));e?c.baseVal=f:b.className=f}},remove:function(a){this.selection.eachNode(function(a,c){return function(e,f){return a(c,e,f)}}(y(this,this._remove),a));return this.selection},exists:function(a){return this.selection.firstNode(function(b){var c=b.classList;if(null!=c)return c.contains(a);var b=b.className,c=new R("(^|\\s+)"+ +ob.escapeERegChars(a)+"(\\s+|$)","g"),e=b.baseVal;return c.match(null!=e?e:b)})},toggle:function(a){this.exists(a)?this.remove(a):this.add(a);return this.selection},__class__:ob});ee=function(a){ob.call(this,a)};j["dhx.AccessDataClassed"]=ee;ee.__name__=["dhx","AccessDataClassed"];ee.__super__=ob;ee.prototype=H(ob.prototype,{addf:function(a){var b=y(this,this._add);this.selection.eachNode(function(c,e){var f=a(l.field(c,"__dhx_data__"),e);null!=f&&b(f,c,e)});return this.selection},removef:function(a){var b= +y(this,this._remove);this.selection.eachNode(function(c,e){var f=a(l.field(c,"__dhx_data__"),e);null!=f&&b(f,c,e)});return this.selection},__class__:ee});Hc=function(a){sa.call(this,a)};j["dhx.AccessHtml"]=Hc;Hc.__name__=["dhx","AccessHtml"];Hc.__super__=sa;Hc.prototype=H(sa.prototype,{"float":function(a){this.selection.eachNode(function(b){b.innerHTML=""+a});return this.selection},clear:function(){this.selection.eachNode(function(a){a.innerHTML=""});return this.selection},string:function(a){this.selection.eachNode(function(b){b.innerHTML= +a});return this.selection},get:function(){return this.selection.firstNode(function(a){return a.innerHTML})},__class__:Hc});fe=function(a){Hc.call(this,a)};j["dhx.AccessDataHtml"]=fe;fe.__name__=["dhx","AccessDataHtml"];fe.__super__=Hc;fe.prototype=H(Hc.prototype,{data:function(){return this.stringf(function(a){return""+n.string(a)})},floatf:function(a){this.selection.eachNode(function(b,c){var e=a(l.field(b,"__dhx_data__"),c);b.innerHTML=null==e?"":""+e});return this.selection},stringf:function(a){this.selection.eachNode(function(b, +c){var e=a(l.field(b,"__dhx_data__"),c);null==e&&(e="");b.innerHTML=e});return this.selection},__class__:fe});Ic=function(a,b){sa.call(this,b);this.name=a};j["dhx.AccessProperty"]=Ic;Ic.__name__=["dhx","AccessProperty"];Ic.__super__=sa;Ic.prototype=H(sa.prototype,{"float":function(a){var b=""+a,c=this.name;this.selection.eachNode(function(a){a[c]=b});return this.selection},string:function(a){var b=this.name;this.selection.eachNode(function(c){c[b]=a});return this.selection},remove:function(){var a= +this.name;this.selection.eachNode(function(b){l.deleteField(b,a)});return this.selection},get:function(){var a=this.name;return this.selection.firstNode(function(b){return l.field(b,a)})},name:null,__class__:Ic});ge=function(a,b){Ic.call(this,a,b)};j["dhx.AccessDataProperty"]=ge;ge.__name__=["dhx","AccessDataProperty"];ge.__super__=Ic;ge.prototype=H(Ic.prototype,{data:function(){return this.stringf(function(a){return""+n.string(a)})},floatf:function(a){var b=this.name;this.selection.eachNode(function(c, +e){var f=a(l.field(c,"__dhx_data__"),e);null==f?l.deleteField(c,b):c[b]=""+f});return this.selection},stringf:function(a){var b=this.name;this.selection.eachNode(function(c,e){var f=a(l.field(c,"__dhx_data__"),e);null==f?l.deleteField(c,b):c[b]=f});return this.selection},__class__:ge});ha=function(a,b){sa.call(this,b);this.name=a};j["dhx.AccessStyle"]=ha;ha.__name__=["dhx","AccessStyle"];ha._getPropertyName=function(a){if("float"==a||"cssFloat"==a||"styleFloat"==a)return null==ma.document.body.cssFloat? +"styleFloat":"cssFloat";0<=a.indexOf("-")&&(a=E.ucwords(a));return a};ha.getComputedStyleValue=function(a,b){ha.getComputedStyleValue="getComputedStyle"in window?function(a,b){return ma.window.getComputedStyle(a,null).getPropertyValue(b)}:function(a,b){var f=a.currentStyle;null==l.field(f,b)&&(b=ha._getPropertyName(b));return null==l.field(f,b)?"":l.field(f,b)};return ha.getComputedStyleValue(a,b)};ha.setStyleProperty=function(a,b,c,e){ha.setStyleProperty="setProperty"in a.style?function(a,b,c,e){a.style.setProperty(b, +""+c,null==e?"":e)}:function(a,b,c,e){a=a.style;null==l.field(a,b)&&(b=ha._getPropertyName(b));null!=e&&""!=e?a.cssText+=";"+E.dasherize(b)+":"+c+"!important;":a[b]=c};ha.setStyleProperty(a,b,c,e)};ha.removeStyleProperty=function(a){ha.removeStyleProperty="removeProperty"in a.style?function(a,c){a.style.removeProperty(c)}:function(a,c){var e=a.style;null==l.field(e,c)&&(c=ha._getPropertyName(c));l.deleteField(e,c)}};ha.__super__=sa;ha.prototype=H(sa.prototype,{color:function(a,b){var c=this,e=a.toRgbString(); +this.selection.eachNode(function(a){ha.setStyleProperty(a,c.name,e,b)});return this.selection},"float":function(a,b){var c=this;this.selection.eachNode(function(e){ha.setStyleProperty(e,c.name,a,b)});return this.selection},string:function(a,b){var c=this;this.selection.eachNode(function(e){ha.setStyleProperty(e,c.name,a,b)});return this.selection},remove:function(){var a=this;this.selection.eachNode(function(b){ha.removeStyleProperty(b,a.name)});return this.selection},getFloat:function(){var a=this.get(); +return ha.refloat.match(a)?n.parseFloat(ha.refloat.matched(1)):Math.NaN},get:function(){var a=this;return this.selection.firstNode(function(b){return ha.getComputedStyleValue(b,a.name)})},name:null,__class__:ha});he=function(a,b){ha.call(this,a,b)};j["dhx.AccessDataStyle"]=he;he.__name__=["dhx","AccessDataStyle"];he.__super__=ha;he.prototype=H(ha.prototype,{data:function(){return this.stringf(function(a){return""+n.string(a)})},colorf:function(a,b){var c=this;this.selection.eachNode(function(e,f){var h= +a(l.field(e,"__dhx_data__"),f);null==h?ha.removeStyleProperty(e,c.name):ha.setStyleProperty(e,c.name,""+h.toRgbString(),b)});return this.selection},floatf:function(a,b){var c=this;this.selection.eachNode(function(e,f){var h=a(l.field(e,"__dhx_data__"),f);null==h?ha.removeStyleProperty(e,c.name):ha.setStyleProperty(e,c.name,""+h,b)});return this.selection},stringf:function(a,b){var c=this;this.selection.eachNode(function(e,f){var h=a(l.field(e,"__dhx_data__"),f);null==h?ha.removeStyleProperty(e,c.name): +ha.setStyleProperty(e,c.name,h,b)});return this.selection},__class__:he});Jc=function(a){sa.call(this,a)};j["dhx.AccessText"]=Jc;Jc.__name__=["dhx","AccessText"];Jc.__super__=sa;Jc.prototype=H(sa.prototype,{floatNodef:function(a){this.clear();this.selection.eachNode(function(b,c){var e=a(b,c);if(null!=e)b.textContent=""+e});return this.selection},stringNodef:function(a){this.clear();this.selection.eachNode(function(b,c){var e=a(b,c);if(null!=e)b.textContent=e});return this.selection},"float":function(a){this.clear(); +this.selection.eachNode(function(b){b.textContent=""+a});return this.selection},clear:function(){this.selection.eachNode(function(a){a.textContent=""});return this.selection},string:function(a){this.clear();this.selection.eachNode(function(b){b.textContent=a});return this.selection},get:function(){return this.selection.firstNode(function(a){return a.textContent})},__class__:Jc});ie=function(a){Jc.call(this,a)};j["dhx.AccessDataText"]=ie;ie.__name__=["dhx","AccessDataText"];ie.__super__=Jc;ie.prototype= +H(Jc.prototype,{data:function(){return this.stringf(function(a){return""+n.string(a)})},floatf:function(a){this.clear();this.selection.eachNode(function(b,c){var e=a(l.field(b,"__dhx_data__"),c);if(null!=e)b.textContent=""+e});return this.selection},stringf:function(a){this.clear();this.selection.eachNode(function(b,c){var e=a(l.field(b,"__dhx_data__"),c);if(null!=e)b.textContent=e});return this.selection},__class__:ie});Ob=function(a,b){this.transition=a;this.tweens=b};j["dhx.AccessTween"]=Ob;Ob.__name__= +["dhx","AccessTween"];Ob.prototype={_that:function(){return this.transition},transitionFloatTweenf:function(a){return function(b,c,e){return D.interpolatef(e,a(b,c))}},transitionFloatTween:function(a){return function(b,c,e){return D.interpolatef(e,a)}},transitionCharsTweenf:function(a){return function(b,c,e){return E.interpolateCharsf(e,a(b,c))}},transitionCharsTween:function(a){return function(b,c,e){return E.interpolateCharsf(e,a)}},transitionStringTweenf:function(a){return function(b,c,e){return E.interpolatef(e, +a(b,c))}},transitionStringTween:function(a){return function(b,c,e){return E.interpolatef(e,a)}},transitionColorTweenf:function(a){return function(b,c,e){return g.Rgb.interpolatef(e,a(b,c))}},transitionColorTween:function(a){return function(b,c,e){return g.Rgb.interpolatef(e,a)}},tweens:null,transition:null,__class__:Ob};Kc=function(a,b,c){Ob.call(this,b,c);this.name=a;this.qname=ic.qualify(a)};j["dhx.AccessTweenAttribute"]=Kc;Kc.__name__=["dhx","AccessTweenAttribute"];Kc.__super__=Ob;Kc.prototype= +H(Ob.prototype,{floatTweenNodef:function(a){var b=this.name,c;this.tweens.set("attr."+b,null==this.qname?function(c,f){var h=a(c,f,n.parseFloat(c.getAttribute(b)));return function(a){c.setAttribute(b,""+h(a))}}:function(c,f){var h=a(c,f,n.parseFloat(c.getAttributeNS(b.space,b.local)));return function(a){c.setAttributeNS(b.space,b.local,""+h(a))}});return this.transition},"float":function(a){return this.floatTweenNodef(this.transitionFloatTween(a))},floatNodef:function(a){return this.floatTweenNodef(this.transitionFloatTweenf(a))}, +stringTweenNodef:function(a){var b=this.name,c;this.tweens.set("attr."+b,null==this.qname?function(c,f){var h=a(c,f,c.getAttribute(b));return function(a){c.setAttribute(b,h(a))}}:function(c,f){var h=a(c,f,c.getAttributeNS(b.space,b.local));return function(a){c.setAttributeNS(b.space,b.local,h(a))}});return this.transition},string:function(a){return this.stringTweenNodef(this.transitionStringTween(a))},stringNodef:function(a){return this.stringTweenNodef(this.transitionStringTweenf(a))},qname:null, +name:null,__class__:Kc});je=function(a,b,c){Kc.call(this,a,b,c)};j["dhx.AccessDataTweenAttribute"]=je;je.__name__=["dhx","AccessDataTweenAttribute"];je.__super__=Kc;je.prototype=H(Kc.prototype,{floatTweenf:function(a){var b=this.name,c;this.tweens.set("attr."+b,null==this.qname?function(c,f){var h=a(l.field(c,"__dhx_data__"),f,n.parseFloat(c.getAttribute(b)));return function(a){c.setAttribute(b,""+h(a))}}:function(c,f){var h=a(l.field(c,"__dhx_data__"),f,n.parseFloat(c.getAttributeNS(b.space,b.local))); +return function(a){c.setAttributeNS(b.space,b.local,""+h(a))}});return this.transition},stringTweenf:function(a){var b=this.name,c;this.tweens.set("attr."+b,null==this.qname?function(c,f){var h=a(l.field(c,"__dhx_data__"),f,c.getAttribute(b));return function(a){c.setAttribute(b,h(a))}}:function(c,f){var h=a(l.field(c,"__dhx_data__"),f,c.getAttributeNS(b.space,b.local));return function(a){c.setAttributeNS(b.space,b.local,h(a))}});return this.transition},floatf:function(a){return this.floatTweenNodef(this.transitionFloatTweenf(function(b, +c){return a(l.field(b,"__dhx_data__"),c)}))},stringf:function(a){return this.stringTweenNodef(this.transitionStringTweenf(function(b,c){return a(l.field(b,"__dhx_data__"),c)}))},__class__:je});Lc=function(a,b,c){Ob.call(this,b,c);this.name=a};j["dhx.AccessTweenStyle"]=Lc;Lc.__name__=["dhx","AccessTweenStyle"];Lc.__super__=Ob;Lc.prototype=H(Ob.prototype,{colorTweenNodef:function(a,b){null==b&&(b=null);var c=this.name;this.tweens.set("style."+c,function(e,f){var h=a(e,f,g.Colors.parse(ha.getComputedStyleValue(e, +c)));return function(a){ha.setStyleProperty(e,c,h(a).toRgbString(),b)}});return this.transition},color:function(a,b){return this.colorTweenNodef(this.transitionColorTween(g.Colors.parse(a)),b)},colorNodef:function(a,b){return this.colorTweenNodef(this.transitionColorTweenf(a),b)},stringTweenNodef:function(a,b){null==b&&(b=null);var c=this.name;this.tweens.set("style."+c,function(e,f){var h=a(e,f,ha.getComputedStyleValue(e,c));return function(a){ha.setStyleProperty(e,c,h(a),b)}});return this.transition}, +string:function(a,b){return this.stringTweenNodef(this.transitionStringTween(a),b)},stringNodef:function(a,b){return this.stringTweenNodef(this.transitionStringTweenf(a),b)},floatTweenNodef:function(a,b){var c=this.name;this.tweens.set("style."+c,function(e,f){var h=a(e,f,n.parseFloat(ha.getComputedStyleValue(e,c)));return function(a){ha.setStyleProperty(e,c,""+h(a),b)}});return this.transition},"float":function(a,b){return this.floatTweenNodef(this.transitionFloatTween(a),b)},floatNodef:function(a, +b){return this.floatTweenNodef(this.transitionFloatTweenf(a),b)},name:null,__class__:Lc});ke=function(a,b,c){Lc.call(this,a,b,c)};j["dhx.AccessDataTweenStyle"]=ke;ke.__name__=["dhx","AccessDataTweenStyle"];ke.__super__=Lc;ke.prototype=H(Lc.prototype,{colorTweenf:function(a,b){null==b&&(b=null);var c=this.name;this.tweens.set("style."+c,function(e,f){var h=a(l.field(e,"__dhx_data__"),f,g.Colors.parse(ha.getComputedStyleValue(e,c)));return function(a){ha.setStyleProperty(e,c,h(a).toRgbString(),b)}}); +return this.transition},colorf:function(a,b){return this.colorTweenNodef(this.transitionColorTweenf(function(b,e){return a(l.field(b,"__dhx_data__"),e)}),b)},stringTweenf:function(a,b){null==b&&(b=null);var c=this.name;this.tweens.set("style."+c,function(e,f){var h=a(l.field(e,"__dhx_data__"),f,ha.getComputedStyleValue(e,c));return function(a){ha.setStyleProperty(e,c,h(a),b)}});return this.transition},stringf:function(a,b){return this.stringTweenNodef(this.transitionStringTweenf(function(b,e){return a(l.field(b, +"__dhx_data__"),e)}),b)},floatTweenf:function(a,b){null==b&&(b=null);var c=this.name;this.tweens.set("style."+c,function(e,f){var h=a(l.field(e,"__dhx_data__"),f,n.parseFloat(ha.getComputedStyleValue(e,c)));return function(a){ha.setStyleProperty(e,c,""+h(a),b)}});return this.transition},floatf:function(a,b){return this.floatTweenNodef(this.transitionFloatTweenf(function(b,e){return a(l.field(b,"__dhx_data__"),e)}),b)},__class__:ke});Mc=function(a,b){Ob.call(this,a,b)};j["dhx.AccessTweenText"]=Mc; +Mc.__name__=["dhx","AccessTweenText"];Mc.__super__=Ob;Mc.prototype=H(Ob.prototype,{chars:function(a){return this.stringTweenNodef(this.transitionCharsTween(a))},charsNodef:function(a){return this.stringTweenNodef(this.transitionCharsTweenf(a))},stringTweenNodef:function(a){this.tweens.set("text",function(b,c){var e=a(b,c,b.textContent);return function(a){b.textContent=e(a)}});return this.transition},string:function(a){return this.stringTweenNodef(this.transitionStringTween(a))},stringNodef:function(a){return this.stringTweenNodef(this.transitionStringTweenf(a))}, +__class__:Mc});le=function(a,b){Mc.call(this,a,b)};j["dhx.AccessDataTweenText"]=le;le.__name__=["dhx","AccessDataTweenText"];le.__super__=Mc;le.prototype=H(Mc.prototype,{stringTweenf:function(a){this.tweens.set("text",function(b,c){var e=a(l.field(b,"__dhx_data__"),c,d.textContent);return function(a){d.textContent=e(a)}});return this.transition},charsf:function(a){return this.stringTweenNodef(this.transitionCharsTweenf(function(b,c){return a(l.field(b,"__dhx_data__"),c)}))},stringf:function(a){return this.stringTweenNodef(this.transitionStringTweenf(function(b, +c){return a(l.field(b,"__dhx_data__"),c)}))},__class__:le});Ia={__ename__:["dhx","HostType"],__constructs__:"UnknownServer,NodeJs,IE,Firefox,Safari,Chrome,Opera,Unknown".split(","),UnknownServer:["UnknownServer",0]};Ia.UnknownServer.toString=v;Ia.UnknownServer.__enum__=Ia;Ia.NodeJs=["NodeJs",1];Ia.NodeJs.toString=v;Ia.NodeJs.__enum__=Ia;Ia.IE=function(a){a=["IE",2,a];a.__enum__=Ia;a.toString=v;return a};Ia.Firefox=function(a){a=["Firefox",3,a];a.__enum__=Ia;a.toString=v;return a};Ia.Safari=function(a){a= +["Safari",4,a];a.__enum__=Ia;a.toString=v;return a};Ia.Chrome=function(a){a=["Chrome",5,a];a.__enum__=Ia;a.toString=v;return a};Ia.Opera=function(a){a=["Opera",6,a];a.__enum__=Ia;a.toString=v;return a};Ia.Unknown=function(a){a=["Unknown",7,a];a.__enum__=Ia;a.toString=v;return a};Na={__ename__:["dhx","EnvironmentType"],__constructs__:["Mobile","Desktop","Server","UnknownEnvironment"],Mobile:["Mobile",0]};Na.Mobile.toString=v;Na.Mobile.__enum__=Na;Na.Desktop=["Desktop",1];Na.Desktop.toString=v;Na.Desktop.__enum__= +Na;Na.Server=["Server",2];Na.Server.toString=v;Na.Server.__enum__=Na;Na.UnknownEnvironment=["UnknownEnvironment",3];Na.UnknownEnvironment.toString=v;Na.UnknownEnvironment.__enum__=Na;Ea={__ename__:["dhx","OSType"],__constructs__:"Windows,IOs,Android,Mac,Linux,UnknownOs".split(",")};Ea.Windows=function(a){a=["Windows",0,a];a.__enum__=Ea;a.toString=v;return a};Ea.IOs=["IOs",1];Ea.IOs.toString=v;Ea.IOs.__enum__=Ea;Ea.Android=["Android",2];Ea.Android.toString=v;Ea.Android.__enum__=Ea;Ea.Mac=["Mac",3]; +Ea.Mac.toString=v;Ea.Mac.__enum__=Ea;Ea.Linux=["Linux",4];Ea.Linux.toString=v;Ea.Linux.__enum__=Ea;Ea.UnknownOs=["UnknownOs",5];Ea.UnknownOs.toString=v;Ea.UnknownOs.__enum__=Ea;Ja=function(){};j["dhx.ClientHost"]=Ja;Ja.__name__=["dhx","ClientHost"];Ja.isIE=function(){var a;switch(Ja.host[1]){case 2:a=!0;break;default:a=!1}return a};Ja.hostVersion=function(){var a;a=Ja.host;switch(a[1]){case 2:a=a[2];break;case 3:a=a[2];break;case 4:a=a[2];break;case 5:a=a[2];break;case 6:a=a[2];break;default:a=null}return a}; +Ja.hostString=function(){var a;switch(Ja.host[1]){case 0:a="unknown_server";break;case 7:a="unknown";break;case 1:a="nodejs";break;default:a=Ja.host[0]}return a};Ja.osString=function(){return Ja.os[0]};Ja.osVersion=function(){var a;a=Ja.os;switch(a[1]){case 0:a=a[2];break;default:a=null}return a};Ja.environmentString=function(){return Ja.environment[0]};Ja.userAgent=function(){return""+navigator.userAgent};Ja.hasNavigator=function(){return"undefined"!==typeof navigator};I=void 0;ma=void 0;Gd=void 0; +ma=function(){};j["js.Browser"]=ma;ma.__name__=["js","Browser"];ma.createXMLHttpRequest=function(){if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)return new ActiveXObject("Microsoft.XMLHTTP");throw"Unable to create XMLHttpRequest object.";};wa=function(a){this.nodes=a};j["dhx.Group"]=wa;wa.__name__=["dhx","Group"];wa.merge=function(a,b){if(b.length!=a.length)throw"Group length not equal";for(var c=0,e=b.length;cb.length)h= +b.length;if(me?a:u.substr(a,0,e);if(("mouseenter"==f||"mouseleave"==f)&&!Ja.isIE())b=function(a,b){return function(c,e){return a(b,c,e)}}(Aa.listenerEnterLeave,b),f="mouseenter"==f?"mouseover":"mouseout";return this.eachNode(function(e,m){var g=function(a){var c=U.event;U.event=a;try{b(e,m)}catch(f){}U.event=c};null!=l.field(e,"__dhx_on__"+a)&&(Aa.removeEvent(e,f,a,c),l.deleteField(e,"__dhx_on__"+a));null!=b&&(e["__dhx_on__"+a]=g,Aa.addEvent(e, +f,g,c))})},mapNode:function(a){for(var b=[],c=0,e=this.groups;cb)return null;var c=ic.prefix.get(u.substr(a,0,b));if(null==c)throw"unable to find a namespace for "+c;return new ue(c,u.substr(a,b+1,null))};ue=function(a,b){this.space=a;this.local=b};j["dhx.NSQualifier"]=ue;ue.__name__=["dhx","NSQualifier"];ue.prototype={local:null,space:null,__class__:ue};Db=function(a){Aa.call(this,a)};j["dhx.BoundSelection"]=Db;Db.__name__=["dhx","BoundSelection"];Db.__super__= +Aa;Db.prototype=H(Aa.prototype,{on:function(a,b,c){null==c&&(c=!1);return this.onNode(a,null==b?null:function(a,c){b(l.field(a,"__dhx_data__"),c)},c)},first:function(a){return this.firstNode(function(b){return a(l.field(b,"__dhx_data__"))})},map:function(a){for(var b=[],c=0,e=this.groups;cc.delay)c.flush=c.f(a);c=c.next}a=Ba._flush()-b;if(24a?Xa.CUBIC_EQUATION(2*a):2-Xa.CUBIC_EQUATION(2-2*a))};Xa.prototype={_this:function(){return this},createTransition:function(){throw"abstract method";},selectAll:function(a){var b,a=this.createTransition(this.selection.selectAll(a));a._ease=this._ease;var c=this._delay,e=this._duration;b=-1;a.delay(function(a,e){return c[0e._durationMax)e._durationMax=m})):(this._durationMax=b,this.selection.eachNode(function(){e._duration[++c]=e._durationMax}));return this._this()},delay:function(a,b){null==b&&(b=0);var c=Math.POSITIVE_INFINITY,e=-1,f=this;null!=a?this.selection.eachNode(function(b,m){var g=f._delay[++e]=a(b,m);gm){if(b=!1,0>m)return}else m=1;if(null!=e._stage[c]){if(null==g||g.active!=e._transitionId){e._stage[c]=2;return}}else{if(null==g|| +g.active>e._transitionId){e._stage[c]=2;return}e._stage[c]=1;null!=e._start&&e._start(f,h);k=e._interpolators[c]=new ea;g.active=e._transitionId;for(i=e._tweens.keys();i.hasNext();){var w=i.next(),Da=e._tweens.get(w);k.set(w,Da(f,h))}}i=e._ease(m);for(Da=e._tweens.keys();Da.hasNext();)w=Da.next(),k.get(w)(i);if(1==m&&(e._stage[c]=2,g.active==e._transitionId))m=g.owner,m==e._transitionId&&(l.deleteField(f,"__dhx_transition__"),e._remove&&f.parentNode.removeChild(f)),Xa._inheritid=e._transitionId,null!= +e._end&&e._end(f,h),Xa._inheritid=0,g.owner=m}});return b},selection:null,_end:null,_start:null,_step:null,_ease:null,_durationMax:null,_duration:null,_delay:null,_stage:null,_remove:null,_interpolators:null,_tweens:null,_transitionId:null,__class__:Xa};Id=function(a){Xa.call(this,a)};j["dhx.UnboundTransition"]=Id;Id.__name__=["dhx","UnboundTransition"];Id.__super__=Xa;Id.prototype=H(Xa.prototype,{createTransition:function(a){return new Id(a)},attr:function(a){return new Kc(a,this,this._tweens)}, +style:function(a){return new Lc(a,this,this._tweens)},text:function(){return new Mc(this,this._tweens)},__class__:Id});Jd=function(a){Xa.call(this,a)};j["dhx.BoundTransition"]=Jd;Jd.__name__=["dhx","BoundTransition"];Jd.__super__=Xa;Jd.prototype=H(Xa.prototype,{createTransition:function(a){return new Jd(a)},end:function(a){return this.endNode(function(b,c){a(l.field(b,"__dhx_data__"),c)})},start:function(a){return this.startNode(function(b,c){a(l.field(b,"__dhx_data__"),c)})},attr:function(a){return new je(a, +this,this._tweens)},style:function(a){return new ke(a,this,this._tweens)},text:function(){return new le(this,this._tweens)},__class__:Jd});var lb,ub,we,xe;Ab={__ename__:["erazor","_Parser","ParseContext"],__constructs__:["literal","code"]};rb=void 0;Ab.literal=["literal",0];Ab.literal.toString=v;Ab.literal.__enum__=Ab;Ab.code=["code",1];Ab.code.toString=v;Ab.code.__enum__=Ab;rb={__ename__:["erazor","_Parser","ParseResult"],__constructs__:["keepGoing","doneIncludeCurrent","doneSkipCurrent"],keepGoing:["keepGoing", +0]};rb.keepGoing.toString=v;rb.keepGoing.__enum__=rb;rb.doneIncludeCurrent=["doneIncludeCurrent",1];rb.doneIncludeCurrent.toString=v;rb.doneIncludeCurrent.__enum__=rb;rb.doneSkipCurrent=["doneSkipCurrent",2];rb.doneSkipCurrent.toString=v;rb.doneSkipCurrent.__enum__=rb;lb=function(){this.condMatch=new R("^@(?:if|for|while)\\b","");this.inConditionalMatch=new R("^(?:\\}[\\s\r\n]*else if\\b|\\}[\\s\r\n]*else[\\s\r\n]*{)","");this.variableChar=new R("^[_\\w\\.]$","")};j["erazor.Parser"]=lb;lb.__name__= +["erazor","Parser"];lb.prototype={parseWithPosition:function(a){this.pos=0;var b=[];this.bracketStack=[];for(this.conditionalStack=0;""!=a;){this.context=this.parseContext(a);var c=this.parseBlock(a);null!=c.block&&b.push(c);a=u.substr(a,c.length,null);this.pos+=c.length}if(0!=this.bracketStack.length)throw new fc(lb.bracketMismatch,this.pos);return b},parse:function(a){this.pos=0;var b=[];this.bracketStack=[];for(this.conditionalStack=0;""!=a;){this.context=this.parseContext(a);var c=this.parseBlock(a); +null!=c.block&&b.push(c.block);a=u.substr(a,c.length,null);this.pos+=c.length}if(0!=this.bracketStack.length)throw new fc(lb.bracketMismatch,this.pos);return b},escapeLiteral:function(a){return F.replace(a,lb.at+lb.at,lb.at)},parseLiteral:function(a){for(var b=a.length,c=-1;++cc+1&&a.charAt(c+1)!=lb.at)return{block:ub.literal(this.escapeLiteral(u.substr(a,0,c))),length:c,start:this.pos};++c}else if("}"==e)if(0--this.conditionalStack;break;default:b=!0}if(b)throw new fc(lb.bracketMismatch, +this.pos);return{block:ub.codeBlock("}"),length:1,start:this.pos}}if(this.condMatch.match(a))return this.bracketStack.push(Ab.code),++this.conditionalStack,this.parseConditional(a);if("@"==this.peek(a)&&this.isIdentifier(this.peek(a,1)))return this.parseVariable(a);b=this.peek(a,1);var a=this.parseScriptPart(u.substr(a,1,null),b,"{"==b?"}":")"),c=F.trim(u.substr(a,1,a.length-2));return"{"==b?{block:ub.codeBlock(c),length:a.length+1,start:this.pos}:{block:ub.printBlock(c),length:a.length+1,start:this.pos}}, +parseVariableChar:function(a){return this.variableChar.match(a)?rb.keepGoing:rb.doneSkipCurrent},parseVariable:function(a){var b="",c=null,c=null,a=u.substr(a,1,null);do{c=this.acceptIdentifier(a);a=u.substr(a,c.length,null);b+=c;for(c=this.peek(a);"("==c||"["==c;)c=this.acceptBracket(a,c),a=u.substr(a,c.length,null),b+=c,c=this.peek(a);if("."==c&&this.isIdentifier(this.peek(a,1)))a=u.substr(a,1,null),b+=".";else break}while(null!=c);return{block:ub.printBlock(b),length:b.length+1,start:this.pos}}, +peek:function(a,b){null==b&&(b=0);return a.length>b?a.charAt(b):null},parseConditional:function(a){a=this.parseScriptPart(a,"","{");return{block:ub.codeBlock(u.substr(a,1,null)),length:a.length,start:this.pos}},parseBlock:function(a){return this.context==Ab.code?this.parseCodeBlock(a):this.parseLiteral(a)},acceptBracket:function(a,b){return this.parseScriptPart(a,b,"("==b?")":"]")},acceptIdentifier:function(a){var b=!0,c=this;return this.accept(a,function(a){a=c.isIdentifier(a,b);b=!1;return a},!1)}, +isIdentifier:function(a,b){null==b&&(b=!0);return b?"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"==a:"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"0"<=a&&"9">=a||"_"==a},accept:function(a,b,c){return this.parseString(a,function(a){return b(a)?rb.keepGoing:rb.doneSkipCurrent},c)},parseContext:function(a){if(this.peek(a)==lb.at&&this.peek(a,1)!=lb.at)return Ab.code;if(0h)throw new fc("Unbalanced braces for block: ",this.pos,u.substr(a,0,100));}else'"'==g?f=!0:"'"==g&&(e=!0);else f&&'"'==g&&"\\"!=a.charAt(m-1)?f=!1:e&&"'"==g&&"\\"!=a.charAt(m-1)&&(e=!1)}throw new fc("Failed to find a closing delimiter for the script block: ",this.pos,u.substr(a,0,100));},pos:null,conditionalStack:null,bracketStack:null,context:null, +variableChar:null,inConditionalMatch:null,condMatch:null,__class__:lb};we=function(a){this.context=a};j["erazor.ScriptBuilder"]=we;we.__name__=["erazor","ScriptBuilder"];we.prototype={blockToString:function(a){switch(a[1]){case 0:return this.context+".add('"+F.replace(a[2],"'","\\'")+"');\n";case 1:return a[2]+"\n";case 2:return this.context+".add("+a[2]+");\n"}},build:function(a){for(var b=new bb,c=0;ca;){var b=this.declared.pop();this.locals.set(b.n,b.old)}},duplicate:function(a){for(var b= +new ea,c=a.keys();c.hasNext();){var e=c.next();b.set(e,a.get(e))}return b},exprReturn:function(a){try{return this.expr(a)}catch(b){if(I.__instanceof(b,jb.Stop))switch(b[1]){case 0:throw"Invalid break";case 1:throw"Invalid continue";case 2:return b[2]}else throw b;}return null},execute:function(a){this.locals=new ea;return this.exprReturn(a)},increment:function(a,b,c){switch(a[1]){case 1:var e=a[2],f=this.locals.get(e),a=null==f?this.variables.get(e):f.r;b?(a+=c,null==f?this.variables.set(e,a):f.r= +a):null==f?this.variables.set(e,a+c):f.r=a+c;return a;case 5:return e=a[3],f=this.expr(a[2]),a=this.get(f,e),b?(a+=c,this.set(f,e,a)):this.set(f,e,a+c),a;case 16:return f=a[3],e=this.expr(a[2]),f=this.expr(f),a=e[f],b?(a+=c,e[f]=a):e[f]=a+c,a;default:throw qa.EInvalidOp(0>",function(b,c){return a.expr(b)>>a.expr(c)});this.binops.set(">>>",function(b,c){return a.expr(b)>>>a.expr(c)});this.binops.set("==",function(b,c){return a.expr(b)==a.expr(c)});this.binops.set("!=",function(b,c){return a.expr(b)!=a.expr(c)});this.binops.set(">=",function(b,c){return a.expr(b)>=a.expr(c)});this.binops.set("<=",function(b,c){return a.expr(b)<= +a.expr(c)});this.binops.set(">",function(b,c){return a.expr(b)>a.expr(c)});this.binops.set("<",function(b,c){return a.expr(b)>=",function(a,c){return a>>c});this.assignOp(">>>=",function(a,c){return a>>>c})},declared:null,binops:null,locals:null,variables:null,__class__:Ec};$d=function(){Ec.call(this)};j["erazor.hscript.EnhancedInterp"]= +$d;$d.__name__=["erazor","hscript","EnhancedInterp"];$d.__super__=Ec;$d.prototype=H(Ec.prototype,{call:function(a,b,c){c=c.concat([null,null,null,null,null]);return b.apply(a,c)},get:function(a,b){if(null==a)throw qa.EInvalidAccess(b);return l.field(a,b)},__class__:$d});Ub=void 0;Vb=void 0;qe=void 0;ae=void 0;be=void 0;Yc=void 0;Dc=void 0;Wb=void 0;S=void 0;Ub=function(a){for(var b=a.length,c=1;b>1<>3,f=pa.alloc(e),h=0,m=0,g= +0,i=0;im;){var m=m+b,h=h<>m&255}return f},initTable:function(){for(var a=[],b=0;256>b;){var c=b++;a[c]=-1}for(var e=0,b=this.base.length;e>m&g]&255}0a)b.onData(c.responseText);else if(null==a)b.onError("Failed to connect or resolve host");else switch(a){case 12029:b.onError("Failed to connect to host");break; +case 12007:b.onError("Unknown host");break;default:b.onError("Http Error #"+c.status)}}};if(this.async)c.onreadystatechange=e;var f=this.postData;if(null!=f)a=!0;else for(var h=this.params.keys();h.hasNext();)var m=h.next(),f=null==f?"":f+"&",f=f+(F.urlEncode(m)+"="+F.urlEncode(this.params.get(m)));try{if(a)c.open("POST",this.url,this.async);else if(null!=f){var g=1>=this.url.split("?").length;c.open("GET",this.url+(g?"?":"&")+f,this.async);f=null}else c.open("GET",this.url,this.async)}catch(i){this.onError(i.toString()); +return}null==this.headers.get("Content-Type")&&a&&null==this.postData&&c.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(a=this.headers.keys();a.hasNext();)h=a.next(),c.setRequestHeader(h,this.headers.get(h));c.send(f);this.async||e(null)},setParameter:function(a,b){this.params.set(a,b)},setHeader:function(a,b){this.headers.set(a,b)},params:null,headers:null,postData:null,async:null,url:null,__class__:Yc};Vb=function(){};j["haxe.Int32"]=Vb;Vb.__name__=["haxe","Int32"];Vb.toInt= +function(a){if((a>>30&1)!=a>>>31)throw"Overflow "+n.string(a);return a};qe=function(){};j["haxe.Log"]=qe;qe.__name__=["haxe","Log"];qe.trace=function(a,b){I.__trace(a,b)};Dc=function(){};j["haxe.Md5"]=Dc;Dc.__name__=["haxe","Md5"];Dc.encode=function(a){return(new Dc).doEncode(a)};Dc.prototype={doEncode:function(a){for(var a=this.str2blks(a),b=1732584193,c=-271733879,e=-1732584194,f=271733878,h=0;h>>32-b},str2blks:function(a){for(var b=(a.length+8>>6)+1,c=[],e=16*b,f=0;f>2]|=u.cca(a,h)<<8*((8*a.length+h)%4),h++;c[h>>2]|=128<<8*((8*a.length+h)%4);a=8*a.length;b=16*b-2;c[b]=a&255;c[b]|=(a>>>8&255)<<8;c[b]|=(a>>>16&255)<<16;c[b]|=(a>>>24&255)<<24;return c},rhex:function(a){for(var b="",c=0;4>c;)var e=c++,b=b+("0123456789abcdef".charAt(a>>8*e+4&15)+"0123456789abcdef".charAt(a>>8*e&15));return b}, +addme:function(a,b){var c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535},bitAND:function(a,b){return(a>>>1&b>>>1)<<1|a&1&b&1},bitXOR:function(a,b){return(a>>>1^b>>>1)<<1|a&1^b&1},bitOR:function(a,b){return(a>>>1|b>>>1)<<1|a&1|b&1},__class__:Dc};Wb=function(a){var b=this;this.id=setInterval(function(){b.run()},a)};j["haxe.Timer"]=Wb;Wb.__name__=["haxe","Timer"];Wb.delay=function(a,b){var c=new Wb(b);c.run=function(){c.stop();a()};return c};Wb.prototype={run:function(){},stop:function(){if(null!= +this.id)clearInterval(this.id),this.id=null},id:null,__class__:Wb};S={Bytes:function(a,b){this.length=a;this.b=b}};j["haxe.io.Bytes"]=S.Bytes;S.Bytes.__name__=["haxe","io","Bytes"];S.Bytes.alloc=function(a){for(var b=[],c=0;c=f?b.push(f):(2047>=f?b.push(192|f>>6):(65535>=f?b.push(224|f>>12):(b.push(240|f>>18),b.push(128|f>>12&63)),b.push(128|f>>6&63)),b.push(128|f&63))}return new S.Bytes(b.length, +b)};S.Bytes.prototype={toString:function(){return this.readString(0,this.length)},readString:function(a,b){if(0>a||0>b||a+b>this.length)throw S.Error.OutsideBounds;for(var c="",e=this.b,f=String.fromCharCode,h=a,m=a+b;hg){if(0==g)break;c+=f(g)}else if(224>g)c+=f((g&63)<<6|e[h++]&127);else if(240>g)var i=e[h++],c=c+f((g&31)<<12|(i&127)<<6|e[h++]&127);else var i=e[h++],k=e[h++],c=c+f((g&15)<<18|(i&127)<<12|k<<6&127|e[h++]&127)}return c},b:null,length:null,__class__:S.Bytes}; +S.BytesBuffer=function(){this.b=[]};j["haxe.io.BytesBuffer"]=S.BytesBuffer;S.BytesBuffer.__name__=["haxe","io","BytesBuffer"];S.BytesBuffer.prototype={getBytes:function(){var a=new S.Bytes(this.b.length,this.b);this.b=null;return a},b:null,__class__:S.BytesBuffer};S.Input=function(){};j["haxe.io.Input"]=S.Input;S.Input.__name__=["haxe","io","Input"];S.Input.prototype={readString:function(a){var b=S.Bytes.alloc(a);this.readFullBytes(b,0,a);return b.toString()},readFullBytes:function(a,b,c){for(;0< +c;)var e=this.readBytes(a,b,c),b=b+e,c=c-e},readBytes:function(a,b,c){var e=c,f=a.b;if(0>b||0>c||b+c>a.length)throw S.Error.OutsideBounds;for(;0b||0>c||b+c>a.length)throw S.Error.OutsideBounds;this.b=a.b;this.pos=b;this.len=c};j["haxe.io.BytesInput"]=S.BytesInput;S.BytesInput.__name__=["haxe","io","BytesInput"];S.BytesInput.__super__= +S.Input;S.BytesInput.prototype=H(S.Input.prototype,{readBytes:function(a,b,c){if(0>b||0>c||b+c>a.length)throw S.Error.OutsideBounds;if(0==this.len&&0<&|^%~";this.identChars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";var a=[["%"],["*","/"],["+","-"],["<<",">>",">>>"],["|","&","^"],"==,!=,>,<,>=,<=".split(","),["..."],["&&"],["||"],"=,+=,-=,*=,/=,%=,<<=,>>=,>>>=,|=,&=,^=".split(",")];this.opPriority=new ea;this.opRightAssoc=new ea;for(var b=0,c=a.length;bthis["char"]?a=this.readChar():(a=this["char"],this["char"]=-1);for(;;){switch(a){case 0:return z.TEof;case 32:break;case 9:break;case 13:break;case 10:this.line++;break;case 48:for(var b=1*(a-48),c=0;;)switch(a=this.readChar(),c*=10,a){case 48:b=10*b+(a-48);break;case 49:b=10*b+(a-48);break;case 50:b=10*b+(a-48);break;case 51:b=10*b+(a-48);break;case 52:b=10*b+(a-48);break;case 53:b=10*b+(a-48);break;case 54:b= +10*b+(a-48);break;case 55:b=10*b+(a-48);break;case 56:b=10*b+(a-48);break;case 57:b=10*b+(a-48);break;case 46:if(0>30&1)!=e>>>31)throw"Overflow "+n.string(e);return e}(a))}catch(c){b=M.CInt32(e)}return b}(this),z.TConst(a)}break;default:return this["char"]=a,a=b|0,z.TConst(0>30&1)!=e>>>31)throw"Overflow "+n.string(e);return e}(a))}catch(c){b=M.CInt32(e)}return b}(this),z.TConst(a)}break;default:return this["char"]=a,a=b|0,z.TConst(0>30&1)!=e>>>31)throw"Overflow "+n.string(e);return e}(a))}catch(c){b=M.CInt32(e)}return b}(this),z.TConst(a)}break;default:return this["char"]=a,a=b|0,z.TConst(0>30&1)!=e>>>31)throw"Overflow "+n.string(e);return e}(a))}catch(c){b=M.CInt32(e)}return b}(this),z.TConst(a)}break;default:return this["char"]=a,a=b|0,z.TConst(0>30&1)!=e>>>31)throw"Overflow "+n.string(e);return e}(a))}catch(c){b=M.CInt32(e)}return b}(this),z.TConst(a)}break; +default:return this["char"]=a,a=b|0,z.TConst(0>30&1)!=e>>>31)throw"Overflow "+n.string(e);return e}(a))}catch(c){b= +M.CInt32(e)}return b}(this),z.TConst(a)}break;default:return this["char"]=a,a=b|0,z.TConst(0> +30&1)!=e>>>31)throw"Overflow "+n.string(e);return e}(a))}catch(c){b=M.CInt32(e)}return b}(this),z.TConst(a)}break;default:return this["char"]=a,a=b|0,z.TConst(0>30&1)!=e>>>31)throw"Overflow "+n.string(e);return e}(a))}catch(c){b=M.CInt32(e)}return b}(this),z.TConst(a)}break;default:return this["char"]=a,a=b|0,z.TConst(0>30&1)!=e>>>31)throw"Overflow "+n.string(e);return e}(a))}catch(c){b=M.CInt32(e)}return b}(this),z.TConst(a)}break;default:return this["char"]=a,a=b|0,z.TConst(0>30&1)!=e>>>31)throw"Overflow "+n.string(e);return e}(a))}catch(c){b=M.CInt32(e)}return b}(this),z.TConst(a)}break;default:return this["char"]=a,a=b|0,z.TConst(0w;){var Da=w++,k=k<<4,Da=u.cca(g,Da);switch(Da){case 48:k+=Da-48;break;case 49:k+=Da-48;break;case 50:k+=Da-48;break;case 51:k+=Da-48;break;case 52:k+=Da-48;break;case 53:k+=Da-48;break;case 54:k+= +Da-48;break;case 55:k+=Da-48;break;case 56:k+=Da-48;break;case 57:k+=Da-48;break;case 65:k+=Da-55;break;case 66:k+=Da-55;break;case 67:k+=Da-55;break;case 68:k+=Da-55;break;case 69:k+=Da-55;break;case 70:k+=Da-55;break;case 97:k+=Da-87;break;case 98:k+=Da-87;break;case 99:k+=Da-87;break;case 100:k+=Da-87;break;case 101:k+=Da-87;break;case 102:k+=Da-87;break;default:this.invalidChar(Da)}}127>=k?c.writeByte(k):(2047>=k?c.writeByte(192|k>>6):(c.writeByte(224|k>>12),c.writeByte(128|k>>6&63)),c.writeByte(128| +k&63));break;default:this.invalidChar(b)}else if(92==b)e=!0;else if(b==a)break;else 10==b&&this.line++,c.writeByte(b)}return c.getBytes().toString()},readChar:function(){var a;try{a=this.input.readByte()}catch(b){a=0}return a},incPos:function(){},parseExprList:function(a){var b=[],c=this.token();if(c==a)return b;this.tokens.add(c);try{for(;;)switch(b.push(this.parseExpr()),c=this.token(),c[1]){case 9:break;default:if(c==a)throw"__break__";this.unexpected(c)}}catch(e){if("__break__"!=e)throw e;}return b}, +parseTypeNext:function(a){var b=this.token(),c=b;switch(c[1]){case 3:if("->"!=c[2])return this.tokens.add(b),a;break;default:return this.tokens.add(b),a}c=b=this.parseType();switch(c[1]){case 1:return c[2].unshift(a),b;default:return Nb.CTFun([a],b)}},parseType:function(){var a=this.token(),b=a;switch(b[1]){case 2:for(var c=b[2],c=[c];;){a=this.token();if(a!=z.TDot)break;b=a=this.token();switch(b[1]){case 2:c.push(b[2]);break;default:this.unexpected(a)}}var e=null,b=a;switch(b[1]){case 3:if("<"== +b[2]){e=[];try{for(;;){e.push(this.parseType());b=a=this.token();switch(b[1]){case 9:continue;case 3:if(">"==b[2])throw"__break__";}this.unexpected(a)}}catch(f){if("__break__"!=f)throw f;}}break;default:this.tokens.add(a)}return this.parseTypeNext(Nb.CTPath(c,e));case 4:return a=this.parseType(),this.ensure(z.TPClose),this.parseTypeNext(Nb.CTParent(a));case 6:e=[];try{for(;;)switch(b=a=this.token(),b[1]){case 7:throw"__break__";case 2:c=b[2];this.ensure(z.TDoubleDot);e.push({name:c,t:this.parseType()}); +a=this.token();switch(a[1]){case 9:break;case 7:throw"__break__";default:this.unexpected(a)}break;default:this.unexpected(a)}}catch(h){if("__break__"!=h)throw h;}return this.parseTypeNext(Nb.CTAnon(e));default:return this.unexpected(a)}},parseExprNext:function(a){var b=this.token(),c=b;switch(c[1]){case 3:c=c[2];if(this.unops.get(c)){var e;if(!(e=this.isBlock(a)))switch(a[1]){case 3:e=!0;break;default:e=!1}return e?(this.tokens.add(b),a):this.parseExprNext(Q.EUnop(c,!1,a))}return this.makeBinop(c, +a,this.parseExpr());case 8:b=this.token();e=null;c=b;switch(c[1]){case 2:e=c[2];break;default:this.unexpected(b)}return this.parseExprNext(Q.EField(a,e));case 4:return this.parseExprNext(Q.ECall(a,this.parseExprList(z.TPClose)));case 11:return b=this.parseExpr(),this.ensure(z.TBkClose),this.parseExprNext(Q.EArray(a,b));case 13:return b=this.parseExpr(),this.ensure(z.TDoubleDot),c=this.parseExpr(),Q.ETernary(a,b,c);default:return this.tokens.add(b),a}},parseStructure:function(a){return function(b){switch(a){case "if":b= +function(a){var b=a.parseExpr(),f=a.parseExpr(),h=null,m=!1,g=a.token();g==z.TSemicolon&&(m=!0,g=a.token());K.enumEq(g,z.TId("else"))?h=a.parseExpr():(a.tokens.add(g),m&&a.tokens.add(z.TSemicolon));return Q.EIf(b,f,h)}(b);break;case "var":b=function(a){var b=a.token(),f=null,h=b;switch(h[1]){case 2:f=h[2];break;default:a.unexpected(b)}b=a.token();h=null;b==z.TDoubleDot&&a.allowTypes&&(h=a.parseType(),b=a.token());var m=null;K.enumEq(b,z.TOp("="))?m=a.parseExpr():a.tokens.add(b);return Q.EVar(f,h, +m)}(b);break;case "while":b=function(a){var b=a.parseExpr(),a=a.parseExpr();return Q.EWhile(b,a)}(b);break;case "for":b=function(a){a.ensure(z.TPOpen);var b=a.token(),f=null,h=b;switch(h[1]){case 2:f=h[2];break;default:a.unexpected(b)}b=a.token();K.enumEq(b,z.TId("in"))||a.unexpected(b);b=a.parseExpr();a.ensure(z.TPClose);a=a.parseExpr();return Q.EFor(f,b,a)}(b);break;case "break":b=Q.EBreak;break;case "continue":b=Q.EContinue;break;case "else":b=b.unexpected(z.TId(a));break;case "function":b=function(a){var b= +a.token(),f=null,h=b;switch(h[1]){case 2:f=b=h[2];break;default:a.tokens.add(b)}a.ensure(z.TPOpen);var m=[],b=a.token();if(b!=z.TPClose)for(var g=!0;g;){var i=null,h=b;switch(h[1]){case 2:i=b=h[2];break;default:a.unexpected(b)}b=a.token();h=null;b==z.TDoubleDot&&a.allowTypes&&(h=a.parseType(),b=a.token());m.push({name:i,t:h});switch(b[1]){case 9:b=a.token();break;case 5:g=!1;break;default:a.unexpected(b)}}g=null;a.allowTypes&&(b=a.token(),b!=z.TDoubleDot?a.tokens.add(b):g=a.parseType());a=a.parseExpr(); +return Q.EFunction(m,a,f,g)}(b);break;case "return":b=function(a){var b=a.token();a.tokens.add(b);a=b==z.TSemicolon?null:a.parseExpr();return Q.EReturn(a)}(b);break;case "new":b=function(a){var b=[],f=a.token(),h=f;switch(h[1]){case 2:f=h[2];b.push(f);break;default:a.unexpected(f)}for(var m=!0;m;)switch(f=a.token(),f[1]){case 8:h=f=a.token();switch(h[1]){case 2:f=h[2];b.push(f);break;default:a.unexpected(f)}break;case 4:m=!1;break;default:a.unexpected(f)}a=a.parseExprList(z.TPClose);return Q.ENew(b.join("."), +a)}(b);break;case "throw":b=function(a){a=a.parseExpr();return Q.EThrow(a)}(b);break;case "try":b=function(a){var b=a.parseExpr(),f=a.token();K.enumEq(f,z.TId("catch"))||a.unexpected(f);a.ensure(z.TPOpen);var f=a.token(),h;h=f;switch(h[1]){case 2:f=h[2];break;default:f=a.unexpected(f)}h=f;a.ensure(z.TDoubleDot);var m=null;a.allowTypes?m=a.parseType():(f=a.token(),K.enumEq(f,z.TId("Dynamic"))||a.unexpected(f));a.ensure(z.TPClose);a=a.parseExpr();return Q.ETry(b,h,m,a)}(b);break;default:b=null}return b}(this)}, +makeBinop:function(a,b,c){switch(c[1]){case 6:var e=c[4],f=c[3],h=c[2],a=this.opPriority.get(a)<=this.opPriority.get(h)&&!this.opRightAssoc.exists(a)?Q.EBinop(h,this.makeBinop(a,b,f),e):Q.EBinop(a,b,c);break;case 22:e=c[4];f=c[3];h=c[2];a=this.opRightAssoc.exists(a)?Q.EBinop(a,b,c):Q.ETernary(this.makeBinop(a,b,h),f,e);break;default:a=Q.EBinop(a,b,c)}return a},makeUnop:function(a,b){var c;switch(b[1]){case 6:c=b[4];c=Q.EBinop(b[2],this.makeUnop(a,b[3]),c);break;case 22:c=b[4];var e=b[3];c=Q.ETernary(this.makeUnop(a, +b[2]),e,c);break;default:c=Q.EUnop(a,!0,b)}return c},parseExpr:function(){var a=this.token(),b=a;switch(b[1]){case 2:return a=b[2],b=this.parseStructure(a),null==b&&(b=Q.EIdent(a)),this.parseExprNext(b);case 1:return b=b[2],this.parseExprNext(Q.EConst(b));case 4:return b=this.parseExpr(),this.ensure(z.TPClose),this.parseExprNext(Q.EParent(b));case 6:b=a=this.token();switch(b[1]){case 7:return this.parseExprNext(Q.EObject([]));case 2:b=this.token();this.tokens.add(b);this.tokens.add(a);switch(b[1]){case 14:return this.parseExprNext(this.parseObject(0))}break; +case 1:b=b[2];if(this.allowJSON)switch(b[1]){case 2:b=this.token();this.tokens.add(b);this.tokens.add(a);switch(b[1]){case 14:return this.parseExprNext(this.parseObject(0))}break;default:this.tokens.add(a)}else this.tokens.add(a);break;default:this.tokens.add(a)}for(b=[];;){b.push(this.parseFullExpr());a=this.token();if(a==z.TBrClose)break;this.tokens.add(a)}return Q.EBlock(b);case 3:return b=b[2],this.unops.exists(b)?this.makeUnop(b,this.parseExpr()):this.unexpected(a);case 11:b=[];for(a=this.token();a!= +z.TBkClose;)this.tokens.add(a),b.push(this.parseExpr()),a=this.token(),a==z.TComma&&(a=this.token());return this.parseExprNext(Q.EArrayDecl(b));default:return this.unexpected(a)}},parseObject:function(){var a=[];try{for(;;){var b=this.token(),c=null,e=b;switch(e[1]){case 2:c=e[2];break;case 1:var f=e[2];this.allowJSON||this.unexpected(b);e=f;switch(e[1]){case 2:c=e[2];break;default:this.unexpected(b)}break;case 7:throw"__break__";default:this.unexpected(b)}this.ensure(z.TDoubleDot);a.push({name:c, +e:this.parseExpr()});b=this.token();switch(b[1]){case 7:throw"__break__";case 9:break;default:this.unexpected(b)}}}catch(h){if("__break__"!=h)throw h;}return this.parseExprNext(Q.EObject(a))},parseFullExpr:function(){var a=this.parseExpr(),b=this.token();b!=z.TSemicolon&&b!=z.TEof&&(this.isBlock(a)?this.tokens.add(b):this.unexpected(b));return a},isBlock:function(a){switch(a[1]){case 4:a=!0;break;case 21:a=!0;break;case 14:a=this.isBlock(a[3]);break;case 2:a=a[4];a=null!=a&&this.isBlock(a);break; +case 9:var b=a[4],a=a[3],a=null!=b?this.isBlock(b):this.isBlock(a);break;case 6:a=this.isBlock(a[4]);break;case 7:b=a[4];a=!a[3]&&this.isBlock(b);break;case 10:a=this.isBlock(a[3]);break;case 11:a=this.isBlock(a[4]);break;case 15:a=a[2];a=null!=a&&this.isBlock(a);break;default:a=!1}return a},mk:function(a){return a},pmax:function(){return 0},pmin:function(){return 0},expr:function(a){return a},ensure:function(a){var b=this.token();b!=a&&this.unexpected(b)},push:function(a){this.tokens.add(a)},unexpected:function(a){throw qa.EUnexpected(this.tokenString(a)); +},parse:function(a){this.tokens=new be;this["char"]=-1;this.input=a;this.ops=[];this.idents=[];for(var a=0,b=this.opChars.length;a").join(">")};I.__trace=function(a,b){var c=null!=b?b.fileName+":"+b.lineNumber+": ":"",c=c+I.__string_rec(a,""),e;"undefined"!=typeof document&&null!=(e=document.getElementById("haxe:trace"))?e.innerHTML+=I.__unhtml(c)+"
":"undefined"!=typeof console&&null!=console.log&&console.log(c)};I.__string_rec=function(a,b){if(null==a)return"null";if(5<=b.length)return"<...>";var c=typeof a;if("function"== +c&&(a.__name__||a.__ename__))c="object";switch(c){case "object":if(a instanceof Array){if(a.__enum__){if(2==a.length)return a[0];for(var c=a[0]+"(",b=b+"\t",e=2,f=a.length;e";case "string":return a;default:return""+a}};I.__interfLoop=function(a,b){if(null==a)return!1;if(a==b)return!0;var c=a.__interfaces__;if(null!=c)for(var e=0,f=c.length;eb;){var c=b++;r.BI_RC[a]=c;a++}a=u.cca("a", +0);for(b=10;37>b;)c=b++,r.BI_RC[a]=c,a++;a=u.cca("A",0);for(b=10;37>b;)c=b++,r.BI_RC[a]=c,a++};r.getZERO=function(){return r.nbv(0)};r.getONE=function(){return r.nbv(1)};r.nbv=function(a){var b=r.nbi();b.fromInt(a);return b};r.nbi=function(){return new r};r.ofString=function(a,b){var c=r.nbi(),e=function(a,b){c.fromInt(0);for(var e=Math.floor(0.6931471805599453*r.DB/Math.log(b)),f=Math.pow(b,e)|0,h=!1,m=0,g=0,A=0,i=a.length;Al?"-"==a.charAt(j)&&0==c.sign&&(h=!0):(g= +b*g+l,++m>=e&&(c.dMultiply(f),c.dAddOffset(g,0),g=m=0))}0g?"-"==a.charAt(f)&&(h=!0):(h=!1,0==m?(c.chunks[c.t]=g,c.t++):m+e>r.DB?(c.chunks[c.t-1]|=(g&(1<>r.DB-m,c.t++):c.chunks[c.t-1]|=g<=r.DB&&(m-=r.DB))}if(8==e&&0!=(u.cca(a,0)&128))c.sign=-1,0=c;){var g=hr.DB?(f.chunks[f.t-1]|=(g&(1<>r.DB-m,f.t++):f.chunks[f.t-1]|=g<=r.DB&&(m-=r.DB)}if(!b&&0!=(a.b[0]&128))f.sign=-1,0a)return r.ofInt(1);var c=(a>>3)+1,e=pa.alloc(c),f=a&7;b.nextBytes(e,0,c);0c&&(c=1);;){var h=r.random(a,f);e&&(h.testBit(a-1)||h.bitwiseTo(r.getONE().shl(a-1),r.op_or,h));h.isEven()&&h.dAddOffset(1,0);h.primify(a,1);if(0==h.sub(r.getONE()).gcd(b).compare(r.getONE())&&h.isProbablePrime(c))return h}return null};r.op_and=function(a,b){return a&b};r.op_or=function(a,b){return a|b};r.op_xor=function(a,b){return a^b};r.op_andnot=function(a,b){return a&~b};r.nbits=function(a){var b=1,c;if(0!=(c=a>>>16))a=c,b+=16;if(0!=(c=a>>8))a=c,b+=8;if(0!=(c=a>>4))a=c,b+=4;if(0!=(c=a>> +2))a=c,b+=2;0!=a>>1&&(b+=1);return b};r.cbit=function(a){for(var b=0;0!=a;)a&=a-1,++b;return b};r.intAt=function(a,b){var c=r.BI_RC[u.cca(a,b)];return null==c?-1:c};r.int2charCode=function(a){return u.cca(r.BI_RM,a)};r.lbit=function(a){if(0==a)return-1;var b=0;0==(a&65535)&&(a>>=16,b+=16);0==(a&255)&&(a>>=8,b+=8);0==(a&15)&&(a>>=4,b+=4);0==(a&3)&&(a>>=2,b+=2);0==(a&1)&&++b;return b};r.dumpBi=function(a){var b="sign: "+n.string(a.sign),b=b+(" t: "+a.t);return b+=n.string(a.chunks)};r.prototype={am3:function(a, +b,c,e,f,h){for(var m=b&16383,b=b>>14;0<=--h;){var g=this.chunks[a]&16383,i=this.chunks[a]>>14;a++;var k=b*g+i*m,g=m*g+((k&16383)<<14)+c.chunks[e]+f,f=(g>>28)+(k>>14)+b*i;c.chunks[e]=g&268435455;e++}return f},am2:function(a,b,c,e,f,h){for(var m=b&32767,b=b>>15;0<=--h;){var g=this.chunks[a]&32767,i=this.chunks[a]>>15;a++;var k=b*g+i*m,g=m*g+((k&32767)<<15)+c.chunks[e]+(f&1073741823),f=(g>>>30)+(k>>>15)+b*i+(f>>>30);c.chunks[e]=g&1073741823;e++}return f},am1:function(a,b,c,e,f,h){for(;0<=--h;){var m= +b*this.chunks[a]+c.chunks[e]+f;a++;f=Math.floor(m/67108864);c.chunks[e]=m&67108863;e++}return f},rShiftTo:function(a,b){b.sign=this.sign;var c=Math.floor(a/r.DB);if(c>=this.t)b.t=0;else{var e=a%r.DB,f=r.DB-e,h=(1<>e;for(var m=c+1,g=this.t;m>e}0>e|m,m=(this.chunks[g]&f)<=c)return!1;var e=b.shr(c),a=a+1>>1;if(a>r.lowprimes.length)a=r.lowprimes.length;for(var f=r.nbi(),h=0;ha)return r.getONE();var c=r.nbi(),e=r.nbi(),f=b.convert(this),h=r.nbits(a)-1;for(f.copyTo(c);0<=--h;)if(b.sqrTo(c,e),0<(a&1<a;)this.subTo(r.getONE().shl(a-1),this); +for(;!this.isProbablePrime(b);)for(this.dAddOffset(2,0);this.bitLength()>a;)this.subTo(r.getONE().shl(a-1),this)},isProbablePrime:function(a){var b,c=this.abs();if(1==c.t&&c.chunks[0]<=r.lowprimes[r.lowprimes.length-1]){a=0;for(b=r.lowprimes.length;athis.t)return 0;var a=this.chunks[0];if(0==(a&1))return 0;var b=a&3,b=b*(2-(a&15)*b)&15,b=b*(2-(a&255)*b)&255,b=b*(2-((a&65535)*b&65535))&65535,b=b*(2-a*b%r.DV)%r.DV;return 0=r.DV;)this.chunks[b]-=r.DV,++b>=this.t&&(this.chunks[this.t]=0,this.t++),++this.chunks[b]},sigNum:function(){return 0>this.sign?-1:0>=this.t||1==this.t&&0>=this.chunks[0]?0:1},byteValue:function(){return 0==this.t?this.sign:this.chunks[0]<<24>>24},shortValue:function(){return 0==this.t?this.sign:this.chunks[0]<<16>>16},padTo:function(a){for(;this.tthis.sign?this.neg():this.clone(),a=0>a.sign?a.neg():a.clone();if(0>b.compare(a))var c=b,b=a,a=c;var c=b.getLowestSetBit(),e=a.getLowestSetBit();if(0>e)return b;c>=r.DB;if(a.t>=r.DB;e+=this.sign}else{for(e+=this.sign;c>=r.DB;e-=a.sign}b.sign=0>e?-1:0;-1>e?(b.chunks[c]=r.DV+e,c++):0=r.DV)a.chunks[c+b.t]-=r.DV,a.chunks[c+b.t+1]=1;c++}0=e.t)){var f=this.abs();if(f.t>r.F2):0),k=r.FV/i,i=1*(1<m&&r.getZERO().subTo(c, +c)}}}},copyTo:function(a){for(var b=0,c=this.chunks.length;b>=r.DB;if(a.t>=r.DB;e+=this.sign}else{for(e+=this.sign;c>=r.DB;e+=a.sign}b.sign=0>e?-1:0;0e&&(b.chunks[c]= +r.DV+e,c++);b.t=c;b.clamp()},xor:function(a){var b=r.nbi();this.bitwiseTo(a,r.op_xor,b);return b},testBit:function(a){var b=Math.floor(a/r.DB);return b>=this.t?0!=this.sign:0!=(this.chunks[b]&1<a?this.lShiftTo(-a,b):this.rShiftTo(a,b);return b},shl:function(a){var b=r.nbi();0>a?this.rShiftTo(-a,b):this.lShiftTo(a,b);return b},setBit:function(a){return this.changeBit(a,r.op_or)},or:function(a){var b=r.nbi();this.bitwiseTo(a,r.op_or,b);return b},not:function(){for(var a= +r.nbi(),b=0,c=this.t;bthis.sign?this.t*r.DB:-1},flipBit:function(a){return this.changeBit(a,r.op_xor)},clearBit:function(a){return this.changeBit(a,r.op_andnot)},complement:function(){return this.not()},bitLength:function(){return 0>=this.t?0:r.DB*(this.t-1)+r.nbits(this.chunks[this.t- +1]^this.sign&r.DM)},bitCount:function(){for(var a=0,b=this.sign&r.DM,c=0,e=this.t;ca||b.isEven()?new oa.Classic(b):new oa.Montgomery(b);return this.exp(a,c)},modPow:function(a,b){var c=a.bitLength(),e,f=r.nbv(1),h;if(0>=c)return f;e=18>c?1:48>c?3:144>c?4:768>c?5:6;h=8>c?new oa.Classic(b):b.isEven()?new oa.Barrett(b):new oa.Montgomery(b);var m=[],g=3,i=e-1,k=(1<=i?j=a.chunks[w]>>c-i&k:(j=(a.chunks[w]&(1<>r.DB+c-i));for(g=e;0==(j&1);)j>>=1,--g;if(0>(c-=g))c+=r.DB,--w;if(l)m[j].copyTo(f),l=!1;else{for(;1--c&&(c=r.DB-1,--w),g=a.chunks[w]}return h.revert(f)},modInverse:function(a){var b= +a.isEven();if(this.isEven()&&b||0==a.sigNum())return r.getZERO();for(var c=a.clone(),e=this.clone(),f=r.nbv(1),h=r.nbv(0),m=r.nbv(0),g=r.nbv(1);0!=c.sigNum();){for(;c.isEven();){c.rShiftTo(1,c);if(b){if(!f.isEven()||!h.isEven())f.addTo(this,f),h.subTo(a,h);f.rShiftTo(1,f)}else h.isEven()||h.subTo(a,h);h.rShiftTo(1,h)}for(;e.isEven();){e.rShiftTo(1,e);if(b){if(!m.isEven()||!g.isEven())m.addTo(this,m),g.subTo(a,g);m.rShiftTo(1,m)}else g.isEven()||g.subTo(a,g);g.rShiftTo(1,g)}0<=c.compare(e)?(c.subTo(e, +c),b&&f.subTo(m,f),h.subTo(g,h)):(e.subTo(c,e),b&&m.subTo(f,m),g.subTo(h,g))}if(0!=e.compare(r.getONE()))return r.getZERO();if(0<=g.compare(a))return g.sub(a);0>g.sigNum()&&g.addTo(a,g);return g},modInt:function(a){if(0>=a)return 0;var b=r.DV%a,c=0>this.sign?a-1:0;if(0this.sign&&0 +this.compare(a)?this:a},max:function(a){return 0this.sign?this.neg():this},toRadix:function(a){null==a&&(a=10);if(2>a||36>e))f=!0,a.b.push(b),h++;for(;0<=c;)8>e?(b=(this.chunks[c]&(1<>(e+=r.DB-8)):(b=this.chunks[c]>>(e-=8)&255,0>=e&&(e+=r.DB,--c)),0>c)!=(this.sign&r.DM)>>c)b[f]=e|this.sign<c?(e=(this.chunks[a]&(1<>(c+=r.DB-8)):(e=this.chunks[a]>>(c-=8)&255,0>=c&&(c+=r.DB,--a)),0!=(e&128)&&(e|=-256),0==f&&(this.sign&128)!=(e&128)&&++f,0this.sign){if(1==this.t)return this.chunks[0]- +r.DV;if(0==this.t)return-1}else{if(1==this.t)return this.chunks[0];if(0==this.t)return 0}return(this.chunks[1]&(1<<32-r.DB)-1)<a?-1:0;0a?this.chunks[0]=a+r.DV:this.t=0},am:null,chunks:null,sign:null,t:null,__class__:r};la={Status:{__ename__:["math","_IEEE754","Status"],__constructs__:"Normal,Overflow,Underflow,Denormalized,Quiet,Signalling".split(",")}};la.Status.Normal= +["Normal",0];la.Status.Normal.toString=v;la.Status.Normal.__enum__=la.Status;la.Status.Overflow=["Overflow",1];la.Status.Overflow.toString=v;la.Status.Overflow.__enum__=la.Status;la.Status.Underflow=["Underflow",2];la.Status.Underflow.toString=v;la.Status.Underflow.__enum__=la.Status;la.Status.Denormalized=["Denormalized",3];la.Status.Denormalized.toString=v;la.Status.Denormalized.__enum__=la.Status;la.Status.Quiet=["Quiet",4];la.Status.Quiet.toString=v;la.Status.Quiet.__enum__=la.Status;la.Status.Signalling= +["Signalling",5];la.Status.Signalling.toString=v;la.Status.Signalling.__enum__=la.Status;$a=function(a){this.Size=a;this.BinaryPower=0;this.StatCond64=this.StatCond=la.Status.Normal;32==this.Size?(this.MaxExp=this.ExpBias=127,this.MinExp=-126,this.MinUnnormExp=-149):(this.Size=64,this.MaxExp=this.ExpBias=1023,this.MinExp=-1022,this.MinUnnormExp=-1074)};j["math.IEEE754"]=$a;$a.__name__=["math","IEEE754"];$a.floatToBytes=function(a,b){null==b&&(b=!1);var c=new $a(32);c.setEndian(b);c.rounding=!0;return c.convert(a)}; +$a.doubleToBytes=function(a,b){null==b&&(b=!1);var c=new $a(64);c.setEndian(b);c.rounding=!0;return c.convert(a)};$a.bytesToFloat=function(a,b){null==b&&(b=!1);if(4!=a.length&&8!=a.length)throw"Bytes must be 4 or 8 bytes long";var c=new $a(4==a.length?32:64);c.setEndian(b);c.rounding=!0;return b?c.bytesToBin(a):c.bytesToBin(c.littleToBigEndian(a))};$a.splitFloat=function(a){var b={integral:0,decimal:0},c=n.string(a).toLowerCase(),e=c.indexOf("e"),f=0;if(0<=e)f=n.parseInt(u.substr(c,e+1,null));else return e= +c.indexOf("."),0<=e?(b.integral=n.parseFloat(u.substr(c,0,e)),b.decimal=n.parseFloat("0."+u.substr(c,e+1,null))):b.integral=n.parseFloat(c),b;c=u.substr(c,0,e);e=c.indexOf(".");c=F.replace(c,".","");0c.length?b.integral=a:(b.integral=n.parseFloat(u.substr(c,0,e)),b.decimal=n.parseFloat("0."+u.substr(c,e+1,null)))):(f+=e,0==f?b.decimal=n.parseFloat("0."+c):0>f?b.decimal=n.parseFloat("0."+c+"e"+n.string(f)):(b.integral=n.parseFloat(u.substr(c,0,f)), +b.decimal=n.parseFloat("0."+u.substr(c,f,null))));return b};$a.prototype={numStrClipOff:function(a,b){var c="",e=a.toUpperCase(),f="",c="",h=0,m=0,g=e.indexOf("E");-1!=g?(h=g,f=u.substr(a,g+1,a.length),m=n.parseInt(f)):(h=a.length,m=0);-1==a.indexOf(".")&&(e=u.substr(a,0,h),e+=".",a.length!=h&&(e+=u.substr(a,g,a.length)),a=e,g+=1,h+=1);var e=a.indexOf("."),i=0;"-"==a.charAt(i)?(i++,c="-"):c="";for(var k=i,w=!1;kj;){if(a.charAt(k)=="0123456789".charAt(j)){w=!0;break}j++}k++}k--; +j=0;w?(j=e-k,0this.MaxExp?e=c=0:(c=-1,e=1);for(var f=b,h=this.Size;f< +h;)var m=f++,e=e+(this.Result[m]|0)*Math.pow(2,c+b-m);c=e*Math.pow(2,this.BinaryPower);32==this.Size?(b=8,0c;){var f=c++,a=2*a;1<=a?(e.Result[b+f]=1,a-=1):e.Result[b+f]=0}};b>4)/16,b),b+=4,f((a.b[c]&15)/16,b),b+=4,c++;a=0;c=32== +this.Size?9:12;for(b=1;b=this.MinExp&&a<=this.MaxExp&&(this.BinVal[b]=1,b++);var h=b,f=!1;0==this.Result[c]&&(f=!0);this.BinVal[b]=this.Result[c];c++;b++;for(var m=!0;cb;)1==this.Result[c]&&(m=!1),this.BinVal[b]=this.Result[c],c++,b++;for(;2102>h&&1!=this.BinVal[h];)h++;b=1024-h;if(athis.MaxExp){if(f&&m)return this.StatCond=la.Status.Overflow,1==this.Result[0]?Math.NEGATIVE_INFINITY:Math.POSITIVE_INFINITY;this.StatCond=!f&&m&&1==this.Result[0]?la.Status.Quiet:f?la.Status.Signalling:la.Status.Quiet;return Math.NaN}return this.Convert2Dec()},toBytes:function(){for(var a=32==this.Size?4:8,b=pa.alloc(a),c=0,e=0;cm;)var g=m++,f=f+(Math.pow(2,3-g)|0)*this.Result[c+g];h=f<<4;f=0;c+=4;for(m=0;4>m;)g=m++,f+=(Math.pow(2,3-g)|0)*this.Result[c+ +g];h|=f;b.b[e++]=h&255;c+=4}if(!this.bigEndian){c=pa.alloc(a);e=a-1;for(m=0;me&&1!=this.BinVal[e];)e++;1024-e>=this.MinExp?e++:(b=this.MinExp-1,e=1024-b);b=this.Size-1-f+e;if(1==this.BinVal[b+1]){c=0;if(1==this.BinVal[b])c=1;else for(h=b+2;0==c&&2102>h;)c=this.BinVal[h],h++;for(h=b;1==c&&0<=h;)0==this.BinVal[h]? +(this.BinVal[h]=1,c=0):this.BinVal[h]=0,h--}e-=2;0>e&&(e=0)}for(;2102>e&&1!=this.BinVal[e];)e++;c=1024-e;if(this.StatCond64==la.Status.Normal)if(b=c,b>=this.MinExp&&b<=this.MaxExp)e++;else{if(bthis.MaxExp?b=this.MaxExp+1:be;)this.Result[f]=this.BinVal[e],f++,e++;if(b>this.MaxExp||this.StatCond64!= +la.Status.Normal){if(this.StatCond64==la.Status.Normal)return this.infinity(1==this.Result[0]);this.StatCond=this.StatCond64}e=32==this.Size?8:11;this.BinaryPower=b;b+=this.ExpBias;for(a=1*b;0!=a/2;)f=(a|0)%2,this.Result[e]=f,a=0==f?a/2:a/2-0.5,e--,a=$a.splitFloat(10*a).integral/10;return this.toBytes()},convert:function(a){this.input=a;this.StatCond64=this.StatCond=la.Status.Normal;if(this.input==Math.POSITIVE_INFINITY)return this.infinity(!1);if(this.input==Math.NEGATIVE_INFINITY)return this.infinity(!0); +if(Math.isNaN(this.input)){var a=new Ga,b=2;32==this.Size?(a.b.push(255),a.b.push(192)):(a.b.push(255),a.b.push(248),b=6);for(var c=0;cthis.input&&(this.Result[0]=1);a=Math.abs(this.input);b=$a.splitFloat(a);a=b.integral;b=b.decimal;for(c=1024;0!=a/2&&0<=c;){for(var e=a;2147483647c;)b*=2,1<=b?(this.BinVal[c]=1,b--):this.BinVal[c]=0,c++;for(c=0;2102>c&&1!=this.BinVal[c];)c++;this.BinaryPower=1024-c;if(this.BinaryPowera;){var b=a++;this.BinVal[b]=0}this.Result=[];for(var c=0,a=this.Size;ca)throw"invalid size";return this.size=a},next:function(){if(0==this.S.length)throw"not initialized";var a;this.i=this.i+1&255;this.j=this.j+this.S[this.i]&255;a=this.S[this.i];this.S[this.i]=this.S[this.j];this.S[this.j]=a;return this.S[a+this.S[this.i]&255]},init:function(a){for(var b,c=0;256>c;)b=c++,this.S[b]=b;for(c=this.j=0;256>c;){var e=c++;this.j=this.j+this.S[e]+a[e%a.length]&255;b=this.S[e];this.S[e]=this.j;this.S[this.j]= +b}this.j=this.i=0},size:null,S:null,j:null,i:null,__class__:Va.ArcFour};Va.Random=function(a){this.createState(a);this.initialized=!1};j["math.prng.Random"]=Va.Random;Va.Random.__name__=["math","prng","Random"];Va.Random.prototype={createState:function(a){this.state=null==a?new Va.ArcFour:a;if(null==this.pool){this.pool=[];for(this.pptr=0;this.pptr>>8,this.pool[this.pptr++]=a&255;this.pptr=0;this.seedTime()}},seedTime:function(){this.seedInt(1E3* +(new Date).getTime()|0)},seedInt:function(a){this.pool[this.pptr++]^=a&255;this.pool[this.pptr++]^=a>>8&255;this.pool[this.pptr++]^=a>>16&255;this.pool[this.pptr++]^=a>>24&255;this.pptr>=this.state.size&&(this.pptr-=this.state.size)},nextBytesStream:function(a,b){for(var c=0;cthis.m.t+1)a.t=this.m.t+1,a.clamp();this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);for(this.m.multiplyLowerTo(this.q3,this.m.t+ +1,this.r2);0>a.compare(this.r2);)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);0<=a.compare(this.m);)a.subTo(this.m,a)},revert:function(a){return a},convert:function(a){if(0>a.sign||a.t>2*this.m.t)return a.mod(this.m);if(0>a.compare(this.m))return a;var b=r.nbi();a.copyTo(b);this.reduce(b);return b},q3:null,r2:null,mu:null,m:null,__class__:oa.Barrett};oa.Classic=function(a){this.m=a};j["math.reduction.Classic"]=oa.Classic;oa.Classic.__name__=["math","reduction","Classic"];oa.Classic.__interfaces__= +[oa.ModularReduction];oa.Classic.prototype={sqrTo:function(a,b){a.squareTo(b);this.reduce(b)},mulTo:function(a,b,c){a.multiplyTo(b,c);this.reduce(c)},reduce:function(a){a.divRemTo(this.m,null,a)},revert:function(a){return a},convert:function(a){return 0>a.sign||0<=a.compare(this.m)?a.mod(this.m):a},m:null,__class__:oa.Classic};oa.Montgomery=function(a){this.m=a;this.mp=this.m.invDigit();this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<>15)*this.mpl&this.um)<<15)&r.DM,c=b+this.m.t;for(a.chunks[c]+=this.m.am(0,e,a,b,0,this.m.t);a.chunks[c]>=r.DV;)a.chunks[c]-= +r.DV,a.chunks.lengtha.sign&&0=a.expires|| +a.expires>=(new Date).getTime())&&a.permissions.read)},function(){c(null)})};Eb.complete=function(a,b){var c=new Rd(b);if(null==a.options)a.options={};var e=a.options;if(null!=e.download&&!cb.isAnonymous(e.download)){var f=e.download;l.deleteField(e,"download");if(!0==f)e.download={position:"auto"};else if(I.__instanceof(f,String))e.download={position:f};else throw new J.Error("invalid value for download '{0}'",[f],null,{fileName:"MVPOptions.hx",lineNumber:118,className:"rg.app.charts.MVPOptions", +methodName:"complete"});}if(null!=e.map&&cb.isAnonymous(e.map))e.map=[e.map];c.addAction(Eb.a1);c.addAction(Eb.a2);c.addAction(function(a,b){var c=a.axes,e=!1;null==c&&(c=[]);a.axes=c=c.map(function(a){return I.__instanceof(a,String)?{type:a}:a});for(var f=0,g=c.length;ff)throw new J.Error("the start bound '{0}' is not part of the values {1}",[a,e],null,{fileName:"AxisOrdinal.hx",lineNumber:54,className:"rg.axis.AxisOrdinal",methodName:"scale"});if(0>h)throw new J.Error("the end bound '{0}' is not part of the values {1}",[b,e],null,{fileName:"AxisOrdinal.hx",lineNumber:56,className:"rg.axis.AxisOrdinal",methodName:"scale"});if(0>m)throw new J.Error("the value '{0}' is not part of the values {1}",[c,e],null,{fileName:"AxisOrdinal.hx",lineNumber:58,className:"rg.axis.AxisOrdinal", +methodName:"scale"});return nd.distribute(this.scaleDistribution,m-f,h-f+1)},range:function(a,b){var c=this.values(),e=c.indexOf(a),f=c.indexOf(b);if(0>e)throw new J.Error("the start bound '{0}' is not part of the acceptable values {1}",[a,c],null,{fileName:"AxisOrdinal.hx",lineNumber:41,className:"rg.axis.AxisOrdinal",methodName:"range"});if(0>f)throw new J.Error("the end bound '{0}' is not part of the acceptable values {1}",[b,c],null,{fileName:"AxisOrdinal.hx",lineNumber:43,className:"rg.axis.AxisOrdinal", +methodName:"range"});return c.slice(e,f+1)},ticks:function(a,b,c){if(0==c)return[];a=Hb.fromArray(this.range(a,b),this.scaleDistribution);return wb.bound(a,c)},toTickmark:function(a,b,c){a=this.range(a,b);return new Hb(a.indexOf(c),a,null,this.scaleDistribution)},scaleDistribution:null,__class__:Rb,__properties__:{set_scaleDistribution:"set_scaleDistribution"}};ac=function(a){Rb.call(this);this._values=a};j["rg.axis.AxisOrdinalFixedValues"]=ac;ac.__name__=["rg","axis","AxisOrdinalFixedValues"];ac.__super__= +Rb;ac.prototype=H(Rb.prototype,{values:function(){return this._values},_values:null,__class__:ac});Ib=function(a){ac.call(this,Ib.valuesByGroup(a));this.groupBy=a};j["rg.axis.AxisGroupByTime"]=Ib;Ib.__name__=["rg","axis","AxisGroupByTime"];Ib.valuesByGroup=function(a){return O.range(Ib.defaultMin(a),Ib.defaultMax(a)+1)};Ib.defaultMin=function(a){switch(a){case "minute":return 0;case "hour":return 0;case "week":return 0;case "month":return 0;case "day":return 1;default:throw new J.Error("invalid periodicity '{0}' for groupBy min", +null,a,{fileName:"AxisGroupByTime.hx",lineNumber:34,className:"rg.axis.AxisGroupByTime",methodName:"defaultMin"});}};Ib.defaultMax=function(a){switch(a){case "minute":return 59;case "hour":return 23;case "day":return 31;case "week":return 6;case "month":return 11;default:throw new J.Error("invalid periodicity '{0}' for groupBy max",null,a,{fileName:"AxisGroupByTime.hx",lineNumber:48,className:"rg.axis.AxisGroupByTime",methodName:"defaultMax"});}};Ib.__super__=ac;Ib.prototype=H(ac.prototype,{groupBy:null, +__class__:Ib});sb=function(){};j["rg.axis.AxisNumeric"]=sb;sb.__name__=["rg","axis","AxisNumeric"];sb.__interfaces__=[Pd];sb._step=function(a,b){var c=Math.pow(10,Math.floor(Math.log(a/b)/2.302585092994046)),e=b/a*c;0.15>=e?c*=10:0.35>=e?c*=5:0.75>=e&&(c*=2);return c};sb.nice=function(a){return Math.pow(10,Math.round(Math.log(a)/2.302585092994046)-1)};sb.niceMin=function(a,b){var c=Math.pow(10,Math.round(Math.log(a)/2.302585092994046)-1);return Math.floor(b/c)*c};sb.niceMax=function(a,b){var c=Math.pow(10, +Math.round(Math.log(a)/2.302585092994046)-1);return Math.ceil(b/c)*c};sb.prototype={createStats:function(a){return new Sb(a)},max:function(a,b){if(null!=b.max)return b.max;var c=sb.niceMax(a.max-a.min,a.max);return 0c?c:0},ticks:function(a,b,c){var e=b-a,f;if(0==a%1&&0==b%1&&10>e&&1<=e)f=D.range(a,b+1,1),e=null;else{var h=sb._step(e,5),e=sb._step(e,20),e=0==e?[0]:D.range(a,b,e,!0);f=0==h?[0]:D.range(a, +b,h,!0)}return wb.bound(null==e?f.map(function(c){return new vc(c,!0,(c-a)/(b-a))}):e.map(function(c){return new vc(c,u.remove(f,c),(c-a)/(b-a))}),c)},scale:function(a,b,c){return a==b?a:D.uninterpolatef(a,b)(c)},__class__:sb};Oc=function(a){Rb.call(this);this.variable=a};j["rg.axis.AxisOrdinalStats"]=Oc;Oc.__name__=["rg","axis","AxisOrdinalStats"];Oc.__super__=Rb;Oc.prototype=H(Rb.prototype,{values:function(){return this.variable.stats.values},variable:null,__class__:Oc});bc=function(a){this.periodicity= +a;this.set_scaleDistribution(Za.ScaleFill)};j["rg.axis.AxisTime"]=bc;bc.__name__=["rg","axis","AxisTime"];bc.__interfaces__=[nc];bc.prototype={createStats:function(a){return new Sb(a)},max:function(a){return a.max},min:function(a){return a.min},set_scaleDistribution:function(a){return this.scaleDistribution=a},scale:function(a,b,c){switch(this.scaleDistribution[1]){case 1:return(c-a)/(b-a);default:return a=this.range(a,b),nd.distribute(this.scaleDistribution,a.indexOf(va.snap(c,this.periodicity)), +a.length)}},range:function(a,b){return W.range(a,b,this.periodicity)},ticks:function(a,b,c){var e=this,f=W.unitsBetween(a,b,this.periodicity),h=this.range(a,b),a=h.map(function(a){return new od(a,h,e.isMajor(f,a),e.periodicity,e.scaleDistribution)});return wb.bound(a,c)},isMajor:function(a,b){switch(this.periodicity){case "day":if(31>=a)return!0;return 121>a?(function(){var a=new Date;a.setTime(b);return a}(this).getDate(),W.firstInSeries("month",b)||W.firstInSeries("week",b)):W.firstInSeries("month", +b);case "week":return 31>a?!0:7>=function(){var a=new Date;a.setTime(b);return a}(this).getDate();default:var c=l.field(bc.snapping,this.periodicity),e=W.units(b,this.periodicity);if(null==c)return!0;for(var f=0;fh.to))return 0==e%h.s}c=l.field(bc.snapping,this.periodicity+"top");null==c&&(c=1);return 0==e%c}},scaleDistribution:null,periodicity:null,__class__:bc,__properties__:{set_scaleDistribution:"set_scaleDistribution"}};pd=function(){};j["rg.axis.ITickmark"]= +pd;pd.__name__=["rg","axis","ITickmark"];pd.prototype={label:null,value:null,major:null,delta:null,__class__:pd};Za={__ename__:["rg","axis","ScaleDistribution"],__constructs__:["ScaleFit","ScaleFill","ScaleBefore","ScaleAfter"],ScaleFit:["ScaleFit",0]};Za.ScaleFit.toString=v;Za.ScaleFit.__enum__=Za;Za.ScaleFill=["ScaleFill",1];Za.ScaleFill.toString=v;Za.ScaleFill.__enum__=Za;Za.ScaleBefore=["ScaleBefore",2];Za.ScaleBefore.toString=v;Za.ScaleBefore.__enum__=Za;Za.ScaleAfter=["ScaleAfter",3];Za.ScaleAfter.toString= +v;Za.ScaleAfter.__enum__=Za;nd=function(){};j["rg.axis.ScaleDistributions"]=nd;nd.__name__=["rg","axis","ScaleDistributions"];nd.distribute=function(a,b,c){switch(a[1]){case 0:return(b+0.5)/c;case 1:return b/(c-1);case 2:return b/c;case 3:return(b+1)/c}};Gb=function(a,b){this.type=a;this.sortf=b;this.reset()};j["rg.axis.Stats"]=Gb;Gb.__name__=["rg","axis","Stats"];Gb.prototype={addMany:function(a){for(a=ra(a)();a.hasNext();){var b=a.next();this.count++;B.exists(this.values,b)||this.values.push(b)}null!= +this.sortf&&this.values.sort(this.sortf);this.min=this.values[0];this.max=B.last(this.values);return this},add:function(a){this.count++;if(B.exists(this.values,a))return this;this.values.push(a);null!=this.sortf&&this.values.sort(this.sortf);this.min=this.values[0];this.max=B.last(this.values);return this},reset:function(){this.max=this.min=null;this.count=0;this.values=[];return this},type:null,sortf:null,values:null,count:null,max:null,min:null,__class__:Gb};Sb=function(a,b){if(null==b)b=D.compare; +Gb.call(this,a,b)};j["rg.axis.StatsNumeric"]=Sb;Sb.__name__=["rg","axis","StatsNumeric"];Sb.__super__=Gb;Sb.prototype=H(Gb.prototype,{addMany:function(a){Gb.prototype.addMany.call(this,a);for(a=ra(a)();a.hasNext();)this.tot+=a.next();return this},add:function(a){Gb.prototype.add.call(this,a);this.tot+=a;return this},reset:function(){Gb.prototype.reset.call(this);this.tot=0;return this},tot:null,__class__:Sb});vc=function(a,b,c){this.value=a;this.major=b;this.delta=c};j["rg.axis.Tickmark"]=vc;vc.__name__= +["rg","axis","Tickmark"];vc.__interfaces__=[pd];vc.prototype={toString:function(){return wb.string(this)},get_label:function(){return Ca.humanize(this.get_value())},get_value:function(){return this.value},get_major:function(){return this.major},get_delta:function(){return this.delta},label:null,value:null,major:null,delta:null,__class__:vc,__properties__:{get_delta:"get_delta",get_major:"get_major",get_value:"get_value",get_label:"get_label"}};Hb=function(a,b,c,e){null==c&&(c=!0);this.pos=a;this.values= +b;this.scaleDistribution=e;this.major=c};j["rg.axis.TickmarkOrdinal"]=Hb;Hb.__name__=["rg","axis","TickmarkOrdinal"];Hb.__interfaces__=[pd];Hb.fromArray=function(a,b){return a.map(function(c,e){return new Hb(e,a,null,b)})};Hb.prototype={toString:function(){return wb.string(this)},get_label:function(){return Ca.humanize(this.values[this.pos])},label:null,get_value:function(){return this.values[this.pos]},value:null,get_major:function(){return this.major},major:null,get_delta:function(){return nd.distribute(this.scaleDistribution, +this.pos,this.values.length)},delta:null,scaleDistribution:null,values:null,pos:null,__class__:Hb,__properties__:{get_delta:"get_delta",get_major:"get_major",get_value:"get_value",get_label:"get_label"}};od=function(a,b,c,e,f){Hb.call(this,b.indexOf(a),b,c,f);this.periodicity=e};j["rg.axis.TickmarkTime"]=od;od.__name__=["rg","axis","TickmarkTime"];od.__super__=Hb;od.prototype=H(Hb.prototype,{get_label:function(){return W.smartFormat(this.periodicity,this.values[this.pos])},periodicity:null,__class__:od}); +wb=function(){};j["rg.axis.Tickmarks"]=wb;wb.__name__=["rg","axis","Tickmarks"];wb.bound=function(a,b){if(null==b||a.length<=(2>b?2:b))return a;var c=B.filter(a,function(a){return a.get_major()});if(c.length>b)return wb.reduce(c,b);c=wb.reduce(B.filter(a,function(a){return!a.get_major()}),b-c.length).concat(c);c.sort(function(a,b){return D.compare(a.get_delta(),b.get_delta())});return c};wb.reduce=function(a,b){if(1==b)return[a[0]];if(2==b)return[a[a.length-1]];var c=a.length/b,e=[],f=0;do e.push(a[Math.round(c* +f++)]);while(b>e.length);return e};wb.string=function(a){return fa.string(a.get_value())+" ("+(a.get_major()?"Major":"minor")+", "+D.format(a.get_delta())+")"};wb.forFloat=function(a,b,c,e){return new vc(c,e,(c-a)/(b-a))};ne=function(a){if(null==a)throw new J.NullArgument("loader","invalid null argument '{0}' for method {1}.{2}()",{fileName:"DataLoader.hx",lineNumber:11,className:"rg.data.DataLoader",methodName:"new"});this.loader=a;this.onLoad=new Md};yc=void 0;Pc=void 0;Td=void 0;Ud=void 0;Qc=void 0; +cc=void 0;j["rg.data.DataLoader"]=ne;ne.__name__=["rg","data","DataLoader"];ne.prototype={load:function(){var a=this;this.loader(function(b){a.onLoad.dispatch(b)})},onLoad:null,loader:null,__class__:ne};Ud=function(){};j["rg.data.DependentVariableProcessor"]=Ud;Ud.__name__=["rg","data","DependentVariableProcessor"];Ud.prototype={process:function(a,b){for(var c=0;cw&&(n=w);c+=n+k+l;e.push(n+k+l);break;case 2:j=k[4];w=k[3];k=k[2];null==j&&(j=1);n=Math.round(b*j);c+=n+k+w;e.push(n+k+w);break;case 3:w=k[4];j=k[3];k=k[2];c+=w+k+j;e.push(w+k+j);break;case 4:w=k[5],j=k[4],l=k[3],k=k[2],e.push(0)}h++}a-=c;if(0a&&this.moreSpaceRequired(c)},iterator:function(){return u.iter(this.children)},removeChild:function(a){if(!u.remove(this.children, +a))return!1;a.set_parent(null);this.reflow();return!0},addItems:function(a){for(var b=!1,a=ra(a)();a.hasNext();){var c=a.next();null!=c&&(b=!0,this.children.push(c),c.set_parent(this))}b&&this.reflow();return this},addItem:function(a){if(null==a)return this;this.children.push(a);a.set_parent(this);this.reflow();return this},insertItem:function(a,b){if(null==b)return this;if(a>=this.children.length)return this.addItem(b);0>a&&(a=0);this.children.splice(a,0,b);b.set_parent(this);this.reflow();return this}, +moreSpaceRequired:function(){},length:null,orientation:null,height:null,width:null,children:null,__class__:Od,__properties__:{get_length:"get_length"}};pb=function(a){bd.call(this);this.set_disposition(a)};j["rg.frame.StackItem"]=pb;pb.__name__=["rg","frame","StackItem"];pb.__super__=bd;pb.prototype=H(bd.prototype,{set_disposition:function(a){this.disposition=a;null!=this.parent&&this.parent.reflow();return a},set_parent:function(a){null!=this.parent&&this.parent.removeChild(this);return this.parent= +a},parent:null,disposition:null,__class__:pb,__properties__:{set_disposition:"set_disposition"}});qb={};L=void 0;qb.Leadeboard=function(a){this.ready=new sc;this.container=a;this.animated=!0;this.animationDuration=1500;this.animationEase=C.Equations.elasticf();this.animationDelay=150;this._created=0;this.displayGradient=!0;this.colorScale=this.useMax=!1};j["rg.html.chart.Leadeboard"]=qb.Leadeboard;qb.Leadeboard.__name__=["rg","html","chart","Leadeboard"];qb.Leadeboard.prototype={id:function(a){return Pa.id(a, +[this.variableDependent.type])},lTitle:function(a){return this.labelDataPointOver(a,this.stats)},lDataPoint:function(a){return this.labelDataPoint(a,this.stats)},lValue:function(a){return this.labelValue(a,this.stats)},lRank:function(a,b){return this.labelRank(a,b,this.stats)},fadeIn:function(a,b){var c=this;U.selectNodeData(a).transition().ease(this.animationEase).duration(null,this.animationDuration).delay(null,this.animationDelay*(b-this._created)).attr("opacity")["float"](1).endNode(function(){c._created++})}, +onClick:function(a){this.click(a)},data:function(a){null!=this.sortDataPoint&&a.sort(this.sortDataPoint);if(null!=this.variableDependent.stats){this.stats=I.__cast(this.variableDependent.stats,Sb);var a=this.list.selectAll("li").data(a,y(this,this.id)),b=a.enter().append("li");b.attr("title").stringf(y(this,this.lTitle));b.append("div").attr("class").stringf(function(a,b){return 0==b%2?"rg_background fill-0":"rg_background"});var c=b.append("div").attr("class").string("rg_labels");if(null!=y(this, this.labelRank)){var e=c.append("div").text().stringf(y(this,this.lRank));this.colorScale?e.attr("class").stringf(function(a,b){return"rg_rank fill fill-"+b}):e.attr("class").string("rg_rank")}null!=y(this,this.labelDataPoint)&&c.append("span").attr("class").string("rg_description color-0").text().stringf(y(this,this.lDataPoint));null!=y(this,this.labelValue)&&c.append("span").attr("class").string("rg_value color-2").text().stringf(y(this,this.lValue));b.append("div").attr("class").string("clear"); this.displayBar&&(c=b.append("div").attr("class").string("rg_barpadding").append("div").attr("class").string("rg_barcontainer"),c.append("div").attr("class").string("rg_barback fill-0"),c.append("div").attr("class").string("rg_bar fill-0").style("width").stringf(y(this,this.backgroundSize)),b.append("div").attr("class").string("clear"));if(null!=this.click)b.on("click.user",y(this,this.onClick));if(this.animated)b.style("opacity")["float"](0).eachNode(y(this,this.fadeIn));else b.style("opacity")["float"](1); -this.animated?a.exit().transition().ease(this.animationEase).duration(null,this.animationDuration).style("opacity")["float"](0).remove():a.exit().remove();this.ready.dispatch()}},backgroundSize:function(a){return 100*m.field(a,this.variableDependent.type)/(this.useMax?this.stats.max:this.stats.tot)+"%"},setVariables:function(a,b){this.variableDependent=b[0];this.variableIndependent=a[0]},init:function(){var a=this.container.append("div").attr("class").string("leaderboard");this.list=a.append("ul"); -a.append("div").attr("class").string("clear")},labelValue:function(a,b){return Pa.formatValue(b.type,a)},labelRank:function(a,b){return""+(b+1)},labelDataPointOver:function(a,b){return C.format(100*m.field(a,b.type)/(this.useMax?b.max:b.tot),"P:1")},labelDataPoint:function(a){return ya.humanize(m.field(a,this.variableIndependent.type))},stats:null,_created:null,list:null,container:null,displayBar:null,ready:null,colorScale:null,useMax:null,displayGradient:null,sortDataPoint:null,click:null,animationEase:null, -animationDelay:null,animationDuration:null,animated:null,variableDependent:null,variableIndependent:null,__class__:nb.Leadeboard};p=void 0;J=void 0;A=void 0;cb=void 0;g=void 0;w=void 0;Z=void 0;W=void 0;q=void 0;ka=void 0;R=void 0;t=void 0;db=void 0;xb=void 0;Xa=void 0;ke=void 0;le=void 0;g={Rgb:function(a,b,c){this.red=N.clamp(a,0,255);this.green=N.clamp(b,0,255);this.blue=N.clamp(c,0,255)}};j["thx.color.Rgb"]=g.Rgb;g.Rgb.__name__=["thx","color","Rgb"];g.Rgb.fromFloats=function(a,b,c){return new g.Rgb(N.interpolate(a, -0,255,null),N.interpolate(b,0,255,null),N.interpolate(c,0,255,null))};g.Rgb.fromInt=function(a){return new g.Rgb(a>>16&255,a>>8&255,a&255)};g.Rgb.equals=function(a,b){return a.red==b.red&&a.green==b.green&&a.blue==b.blue};g.Rgb.darker=function(a,b,c){return new g.Rgb(N.interpolate(b,a.red,0,c),N.interpolate(b,a.green,0,c),N.interpolate(b,a.blue,0,c))};g.Rgb.lighter=function(a,b,c){return new g.Rgb(N.interpolate(b,a.red,255,c),N.interpolate(b,a.green,255,c),N.interpolate(b,a.blue,255,c))};g.Rgb.interpolate= -function(a,b,c,e){return new g.Rgb(N.interpolate(c,a.red,b.red,e),N.interpolate(c,a.green,b.green,e),N.interpolate(c,a.blue,b.blue,e))};g.Rgb.interpolatef=function(a,b,c){var e=N.interpolatef(a.red,b.red,c),f=N.interpolatef(a.green,b.green,c),h=N.interpolatef(a.blue,b.blue,c);return function(a){return new g.Rgb(e(a),f(a),h(a))}};g.Rgb.contrast=function(a){a=g.Hsl.toHsl(a);return 0.5>a.lightness?new g.Hsl(a.hue,a.saturation,a.lightness+0.5):new g.Hsl(a.hue,a.saturation,a.lightness-0.5)};g.Rgb.contrastBW= -function(a){var b=g.Grey.toGrey(a),a=g.Hsl.toHsl(a);return 0.5>b.grey?new g.Hsl(a.hue,a.saturation,1):new g.Hsl(a.hue,a.saturation,0)};g.Rgb.interpolateBrightness=function(a,b){return g.Rgb.interpolateBrightnessf(b)(a)};g.Rgb.interpolateBrightnessf=function(a){var b=N.interpolatef(0,255,a);return function(a){a=b(a);return new g.Rgb(a,a,a)}};g.Rgb.interpolateHeat=function(a,b,c){return g.Rgb.interpolateHeatf(b,c)(a)};g.Rgb.interpolateHeatf=function(a,b){return g.Rgb.interpolateStepsf([new g.Rgb(0, -0,0),null!=a?a:new g.Rgb(255,127,0),new g.Rgb(255,255,255)],b)};g.Rgb.interpolateRainbow=function(a,b){return g.Rgb.interpolateRainbowf(b)(a)};g.Rgb.interpolateRainbowf=function(a){return g.Rgb.interpolateStepsf([new g.Rgb(0,0,255),new g.Rgb(0,255,255),new g.Rgb(0,255,0),new g.Rgb(255,255,0),new g.Rgb(255,0,0)],a)};g.Rgb.interpolateStepsf=function(a,b){if(0>=a.length)throw new J.Error("invalid number of steps",null,null,{fileName:"Rgb.hx",lineNumber:164,className:"thx.color.Rgb",methodName:"interpolateStepsf"}); -if(1==a.length)return function(){return a[0]};if(2==a.length)return g.Rgb.interpolatef(a[0],a[1],b);for(var c=a.length-1,e=1/c,f=[],h=0;ha?a=0:1=c?c*(1+b):c+b-c*b;c=2*c-b;a=C.circularWrap(a,360);return 60>a?c+(b-c)*a/60:180>a?b:240>a?c+(b-c)*(240-a)/60:c};g.Hsl.toHsl=function(a){var b=a.red/255,c=a.green/255,e=a.blue/255,f=C.min(bc?b:c,e),l=h-f,a=(h+f)/2;0==l?f=b=0:(f=0.5>a?l/(h+f):l/(2-h-f),b=60*(b==h?(c-e)/l+(c>16&255,a>>8&255,a&255)};g.Rgb.equals=function(a,b){return a.red==b.red&&a.green==b.green&&a.blue==b.blue};g.Rgb.darker=function(a,b,c){return new g.Rgb(O.interpolate(b,a.red,0,c),O.interpolate(b,a.green,0,c),O.interpolate(b,a.blue,0,c))};g.Rgb.lighter=function(a,b,c){return new g.Rgb(O.interpolate(b,a.red,255,c),O.interpolate(b,a.green, +255,c),O.interpolate(b,a.blue,255,c))};g.Rgb.interpolate=function(a,b,c,e){return new g.Rgb(O.interpolate(c,a.red,b.red,e),O.interpolate(c,a.green,b.green,e),O.interpolate(c,a.blue,b.blue,e))};g.Rgb.interpolatef=function(a,b,c){var e=O.interpolatef(a.red,b.red,c),f=O.interpolatef(a.green,b.green,c),h=O.interpolatef(a.blue,b.blue,c);return function(a){return new g.Rgb(e(a),f(a),h(a))}};g.Rgb.contrast=function(a){a=g.Hsl.toHsl(a);return 0.5>a.lightness?new g.Hsl(a.hue,a.saturation,a.lightness+0.5): +new g.Hsl(a.hue,a.saturation,a.lightness-0.5)};g.Rgb.contrastBW=function(a){var b=g.Grey.toGrey(a),a=g.Hsl.toHsl(a);return 0.5>b.grey?new g.Hsl(a.hue,a.saturation,1):new g.Hsl(a.hue,a.saturation,0)};g.Rgb.interpolateBrightness=function(a,b){return g.Rgb.interpolateBrightnessf(b)(a)};g.Rgb.interpolateBrightnessf=function(a){var b=O.interpolatef(0,255,a);return function(a){a=b(a);return new g.Rgb(a,a,a)}};g.Rgb.interpolateHeat=function(a,b,c){return g.Rgb.interpolateHeatf(b,c)(a)};g.Rgb.interpolateHeatf= +function(a,b){return g.Rgb.interpolateStepsf([new g.Rgb(0,0,0),null!=a?a:new g.Rgb(255,127,0),new g.Rgb(255,255,255)],b)};g.Rgb.interpolateRainbow=function(a,b){return g.Rgb.interpolateRainbowf(b)(a)};g.Rgb.interpolateRainbowf=function(a){return g.Rgb.interpolateStepsf([new g.Rgb(0,0,255),new g.Rgb(0,255,255),new g.Rgb(0,255,0),new g.Rgb(255,255,0),new g.Rgb(255,0,0)],a)};g.Rgb.interpolateStepsf=function(a,b){if(0>=a.length)throw new J.Error("invalid number of steps",null,null,{fileName:"Rgb.hx", +lineNumber:164,className:"thx.color.Rgb",methodName:"interpolateStepsf"});if(1==a.length)return function(){return a[0]};if(2==a.length)return g.Rgb.interpolatef(a[0],a[1],b);for(var c=a.length-1,e=1/c,f=[],h=0;ha?a=0:1=c?c*(1+b):c+b-c*b;c=2*c-b;a=D.circularWrap(a,360);return 60>a?c+(b-c)*a/60:180>a?b:240>a?c+(b-c)*(240-a)/60:c};g.Hsl.toHsl=function(a){var b=a.red/255,c=a.green/255,e=a.blue/255,f=D.min(bc?b:c,e),m=h-f,a=(h+f)/2;0==m?f=b=0:(f=0.5>a?m/(h+f):m/(2-h-f),b=60*(b==h?(c-e)/m+(c\n\n\n\n'+(null==a?"":a.map(function(a){return''}).join("\n"))+'\n\n\n
'+c+"
\n\n"}, -extractSvg:function(a){var b=new T("","");b.match(a);a=b.matchedRight();c.match(a);return""},findCssSources:function(){return S.selectAll("link").filterNode(function(a){return"stylesheet"==a.rel}).mapNode(function(a){return a.href})},download:function(a,b,c,e){if(!z.exists(Pb.ALLOWED_FORMATS,a))throw new J.Error("The download format '{0}' is not correct",[a],null,{fileName:"RGDownloader.hx",lineNumber:33,className:"rg.interactive.RGDownloader", -methodName:"download"});this.format=a;a=new Bd(this.url(a));a.setHeader("Accept","application/json");a.onError=null!=e?e:function(){};a.onData=function(a,b,c){return function(e){return a(b,c,e)}}(y(this,this.complete),c,e);a.setParameter("html",this.html());a.setParameter("config",this.config());a.request(!0)},url:function(a){return I.replace(this.serviceUrl,"{ext}",a)},tokenId:null,format:null,container:null,serviceUrl:null,__class__:Pb};Oa=function(a,b){this.container=a;this.serviceUrl=b;this.tokenId= -Od.getTokenId()};j["rg.interactive.RGLegacyRenderer"]=Oa;Oa.__name__=["rg","interactive","RGLegacyRenderer"];Oa.getIframeDoc=function(a){var b=null;if(a.contentDocument)b=a.contentDocument;else if(a.contentWindow)b=a.contentWindow.document;else if(null!=ha.window.frames[a.name])b=ha.window.frames[a.name].document;return b};Oa.isIE7orBelow=function(){return document.all&&!document.querySelector};Oa.removeFunctions=function(a){for(var b=0,c=m.fields(a);b\n\n\n\n"+(null==e?"":e.map(function(a){return'