diff --git a/samples/features/json/Dapper-Orm/.gitignore b/samples/features/json/Dapper-Orm/.gitignore
new file mode 100644
index 00000000..c88ab1e1
--- /dev/null
+++ b/samples/features/json/Dapper-Orm/.gitignore
@@ -0,0 +1,9 @@
+*.xproj.user
+.vs/*
+.vscode/*
+bin/*
+obj/*
+*.sln
+*.log
+*.lock.json
+appsettings.development.json
\ No newline at end of file
diff --git a/samples/features/json/Dapper-Orm/Controllers/ProductController.cs b/samples/features/json/Dapper-Orm/Controllers/ProductController.cs
new file mode 100644
index 00000000..8d5a8da2
--- /dev/null
+++ b/samples/features/json/Dapper-Orm/Controllers/ProductController.cs
@@ -0,0 +1,100 @@
+using Dapper;
+using Microsoft.AspNetCore.Mvc;
+using System.Data;
+using System.IO;
+using System.Threading.Tasks;
+
+// For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
+
+namespace ProductCatalog.Controllers
+{
+ [Route("api/[controller]")]
+ public class ProductController : Controller
+ {
+ IDbConnection connection = null;
+
+ public ProductController(IDbConnection connection)
+ {
+ this.connection = connection;
+ }
+
+ // GET api/Product
+ [HttpGet]
+ public void Get()
+ {
+ var QUERY =
+@"select ProductID, Name, Color, Price, Quantity, JSON_VALUE(Data, '$.MadeIn') as MadeIn, JSON_QUERY(Tags) as Tags
+ from Product
+ FOR JSON PATH";
+
+ connection.QueryInto(Response.Body, QUERY);
+ }
+
+ // GET api/Product/17
+ [HttpGet("{id}")]
+ public void Get(int id)
+ {
+ connection.QueryInto(Response.Body,
+ @"select ProductID, Name, Color, Price, Quantity, JSON_VALUE(Data, '$.MadeIn') as MadeIn, JSON_QUERY(Tags) as Tags
+ from Product
+ where ProductID = @id
+ FOR JSON PATH, WITHOUT_ARRAY_WRAPPER", new { id }, defaultOutput: "{}");
+ }
+
+ // POST api/Product
+ [HttpPost]
+ public async Task Post()
+ {
+ string product = new StreamReader(Request.Body).ReadToEnd();
+ await connection.ExecuteAsync("EXEC dbo.InsertProductFromJson @product", new { product });
+ }
+
+ // PATCH api/Product
+ [HttpPatch]
+ public async Task Patch(int id)
+ {
+ string product = new StreamReader(Request.Body).ReadToEnd();
+ await connection.ExecuteAsync("EXEC dbo.UpsertProductFromJson @id, @product", new { id, product });
+ }
+
+ // PUT api/Product/5
+ [HttpPut("{id}")]
+ public async Task Put(int id)
+ {
+ string product = new StreamReader(Request.Body).ReadToEnd();
+ await connection.ExecuteAsync("EXEC dbo.UpdateProductFromJson @id, @product", new { id, product });
+ }
+
+ // DELETE api/Product/5
+ [HttpDelete("{id}")]
+ public async Task Delete(int id)
+ {
+ string product = new StreamReader(Request.Body).ReadToEnd();
+ await connection.ExecuteAsync("delete Product where ProductId = @id", new { id });
+ }
+
+ [HttpGet("Report1")]
+ public void Report1()
+ {
+ var QUERY =
+@"select [key] = ISNULL(Color,'N/A'), value = AVG(Quantity)
+ from Product
+ group by Color
+ FOR JSON PATH";
+
+ connection.QueryInto(Response.Body, QUERY);
+ }
+
+ // GET api/Product/Report2
+ [HttpGet("Report2")]
+ public void Report2()
+ {
+ connection.QueryInto(Response.Body, @"
+select ISNULL(Color,'N/A') as x,
+ AVG (Price) / MAX(Price) as y
+from Product
+group by Color
+FOR JSON PATH");
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/features/json/Dapper-Orm/ProductCatalog.xproj b/samples/features/json/Dapper-Orm/ProductCatalog.xproj
new file mode 100644
index 00000000..30ed9f6d
--- /dev/null
+++ b/samples/features/json/Dapper-Orm/ProductCatalog.xproj
@@ -0,0 +1,22 @@
+
+
+
+ 14.0
+ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+
+
+
+ 7e230e5a-b0b6-4f56-9561-942fd1817b80
+ product_catalog
+ .\obj
+ .\bin\
+ v4.6
+
+
+ 2.0
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/json/Dapper-Orm/Program.cs b/samples/features/json/Dapper-Orm/Program.cs
new file mode 100644
index 00000000..ec5d2cc0
--- /dev/null
+++ b/samples/features/json/Dapper-Orm/Program.cs
@@ -0,0 +1,21 @@
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using System.IO;
+
+namespace ProductCatalog
+{
+ public class Program
+ {
+ public static void Main(string[] args)
+ {
+ var host = new WebHostBuilder()
+ .UseKestrel()
+ .UseContentRoot(Directory.GetCurrentDirectory())
+ .UseIISIntegration()
+ .UseStartup()
+ .Build();
+
+ host.Run();
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/features/json/Dapper-Orm/Properties/launchSettings.json b/samples/features/json/Dapper-Orm/Properties/launchSettings.json
new file mode 100644
index 00000000..4766fc15
--- /dev/null
+++ b/samples/features/json/Dapper-Orm/Properties/launchSettings.json
@@ -0,0 +1,28 @@
+{
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:8929/",
+ "sslPort": 0
+ }
+ },
+ "profiles": {
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "launchUrl": "api/Product",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "ProductCatalog": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "launchUrl": "http://localhost:5000/api/Product",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/features/json/Dapper-Orm/README.md b/samples/features/json/Dapper-Orm/README.md
new file mode 100644
index 00000000..eda66224
--- /dev/null
+++ b/samples/features/json/Dapper-Orm/README.md
@@ -0,0 +1,118 @@
+# Building Web Apps using Dapper ORM and SQL/JSON functionalities
+
+This project contains an example implementation of ASP.NET REST Service/App that enables you to get or modify list of products in catalog and show reports.
+
+## Contents
+
+[About this sample](#about-this-sample)
+[Before you begin](#before-you-begin)
+[Run this sample](#run-this-sample)
+[Sample details](#sample-details)
+[Disclaimers](#disclaimers)
+[Related links](#related-links)
+
+
+
+## About this sample
+
+- **Applies to:** SQL Server 2016 (or higher), Azure SQL Database
+- **Key features:** JSON functions in SQL Server 2016/Azure SQL Database, Dapper ORM
+- **Programming Language:** C#, Transact-SQL
+- **Authors:** Jovan Popovic
+
+
+
+## Before you begin
+
+To run this sample, you need the following prerequisites.
+
+**Software prerequisites:**
+
+1. SQL Server 2016 (or higher) or an Azure SQL Database
+2. Visual Studio 2015+ or Visual Studio Code Editor with the ASP.NET Core 1.0 (or higher)
+
+**Azure prerequisites:**
+
+1. Permission to create an Azure SQL Database
+
+
+
+## Run this sample
+
+1. Create a database on SQL Server 2016 or Azure SQL Database and set compatibility level to 130+.
+
+2. From SQL Server Management Studio or Sql Server Data Tools connect to your SQL Server 2016 or Azure SQL database and execute [sql-scripts/setup.sql](sql-scripts/setup.sql) script that will create and populate Product table and create required stored procedures.
+
+3. From Visual Studio 2015, open the **ProductCatalog.xproj** file from the root directory. Restore packages using right-click menu on the project in Visual Studio and by choosing Restore Packages item. As an alternative, you may run **dotnet restore** from the command line (from the root folder of application).
+
+4. Add a connection string in appsettings.json or appsettings.development.json file. An example of the content of appsettings.development.json is shown in the following configuration:
+
+```
+{
+ "ConnectionStrings": {
+ "ProductCatalog": "Server=.;Database=ProductCatalog;Integrated Security=true"
+ }
+}
+```
+
+If database is hosted on Azure you can add something like:
+```
+{
+ "ConnectionStrings": {
+ "ProductCatalog": "Server=<>.database.windows.net;Database=ProductCatalog;User Id=<>;Password=<>"
+ }
+}
+```
+
+5. Build solution using Ctrl+Shift+B, right-click on project + Build, Build/Build Solution from menu, or **dotnet build** command from the command line (from the root folder of application).
+
+6. Run the sample app using F5 or Ctrl+F5 in Visual Studio 2015, or using **dotnet run** executed in the command prompt of the project root folder.
+ 1. Open /api/Product Url to get all products from database,
+ 2. Open /api/Product/18 Url to get the product with id,
+ 3. Send POST Http request to /api/Product Url with JSON like {"Name":"Blade","Color":"Magenta","Price":18.0000,"Quantity":45} in the body of request to create new product,
+ 4. Send PUT Http request with JSON like {"Name":"Blade","Color":"Magenta","Price":18.0000,"Quantity":45} in the body of request to update the product with specified id,
+ 5. Send DELETE Http request /api/Product/18 Url to delete the product with specified id(18),
+ 6. Open index.html to see how JavaScript client-side app can use underlying REST API,
+ 7. Open report.html to see how you can create reports with pie/bar charts using D3 library and underlying REST API.
+
+
+
+## Sample details
+
+This sample application shows how to create REST API that returns list of products, single product, or update products in table.
+Dapper ORM framework is used for data access. Dapper-Stream extension is used to integrate Dapper with SQL/JSON functionalities.
+Server-side code is implemented using ASP.NET.
+SQL Server JSON functions are used to format product data that will be sent to front-end page.
+Client-side code is inplemented using various JavaScript components.
+
+
+
+## Disclaimers
+The code included in this sample is not intended demonstrate some general guidance and architectural patterns for web development. It contains minimal code required to create REST API, and it does not use some patterns such as Repository. Sample uses built-in ASP.NET Core Dependency Injection mechanism; however, this is not prerequisite.
+You can easily modify this code to fit the architecture of your application.
+
+
+
+## Related Links
+
+The architecture is based on a samples presented in [Building REST API using SQL Server JSON functionalities](http://sqlblog.com/blogs/davide_mauri/archive/2017/04/30/pass-appdev-recording-building-rest-api-with-sql-server-using-json-functions.aspx) PASS AppDev webinar.
+You can find more information about the components that are used in this sample on these locations:
+- Server-side components
+ - [ASP.NET](http://www.asp.net).
+ - [JSON Support in Sql Server](https://msdn.microsoft.com/en-us/library/dn921897.aspx).
+ - [Dapper](https://github.com/StackExchange/Dapper) framework is used for data access.
+- Front-end components used in this sample are:
+ - [JQuery library](https://jquery.com/) that is used to define UI logic in the front-end application.
+ - [JQuery DataTable plugin](https://datatables.net/) that is used to display list of products in a table.
+ - [JQuery View Engine](https://jocapc.github.io/jquery-view-engine/) that is used to populate HTML form using JSON model object.
+ - [Twitter Bootstrap](http://getbootstrap.com/) that is used to style application.
+ - [D3 library](https://d3js.org/) that is use to display pie/bar charts.
+
+## Code of Conduct
+This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
+
+## License
+These samples and templates are all licensed under the MIT license. See the license.txt file in the root.
+
+## Questions
+Email questions to: [sqlserversamples@microsoft.com](mailto: sqlserversamples@microsoft.com).
\ No newline at end of file
diff --git a/samples/features/json/Dapper-Orm/Startup.cs b/samples/features/json/Dapper-Orm/Startup.cs
new file mode 100644
index 00000000..a5aa6c66
--- /dev/null
+++ b/samples/features/json/Dapper-Orm/Startup.cs
@@ -0,0 +1,45 @@
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Logging;
+using System.Data;
+using System.Data.SqlClient;
+
+namespace ProductCatalog
+{
+ public class Startup
+ {
+ public Startup(IHostingEnvironment env)
+ {
+ var builder = new ConfigurationBuilder()
+ .SetBasePath(env.ContentRootPath)
+ .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
+ .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
+ .AddEnvironmentVariables();
+ Configuration = builder.Build();
+ }
+
+ public IConfigurationRoot Configuration { get; }
+
+ // This method gets called by the runtime. Use this method to add services to the container.
+ public void ConfigureServices(IServiceCollection services)
+ {
+ string ConnString = Configuration["ConnectionStrings:ProductCatalog"];
+ services.AddTransient(_ => new SqlConnection(ConnString));
+
+ // Add framework services.
+ services.AddMvc();
+ }
+
+ // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
+ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
+ {
+ loggerFactory.AddConsole(Configuration.GetSection("Logging"));
+ loggerFactory.AddDebug();
+
+ app.UseStaticFiles();
+ app.UseMvc();
+ }
+ }
+}
diff --git a/samples/features/json/Dapper-Orm/app.config b/samples/features/json/Dapper-Orm/app.config
new file mode 100644
index 00000000..49aadfaa
--- /dev/null
+++ b/samples/features/json/Dapper-Orm/app.config
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/samples/features/json/Dapper-Orm/appsettings.json b/samples/features/json/Dapper-Orm/appsettings.json
new file mode 100644
index 00000000..1f127645
--- /dev/null
+++ b/samples/features/json/Dapper-Orm/appsettings.json
@@ -0,0 +1,13 @@
+{
+ "Logging": {
+ "IncludeScopes": false,
+ "LogLevel": {
+ "Default": "Debug",
+ "System": "Information",
+ "Microsoft": "Information"
+ }
+ },
+ "ConnectionStrings": {
+ "ProductCatalog": "Server=.\\SQLEXPRESS;Database=ProductCatalog;Trusted_Connection=True;"
+ }
+}
diff --git a/samples/features/json/Dapper-Orm/project.json b/samples/features/json/Dapper-Orm/project.json
new file mode 100644
index 00000000..f91e0e89
--- /dev/null
+++ b/samples/features/json/Dapper-Orm/project.json
@@ -0,0 +1,47 @@
+{
+ "dependencies": {
+ "Dapper": "1.50.2",
+ "Dapper.Stream": "0.1.0",
+ "Microsoft.AspNetCore.Mvc": "1.0.0",
+ "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
+ "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
+ "Microsoft.AspNetCore.StaticFiles": "1.0.0",
+ "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
+ "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
+ "Microsoft.Extensions.Configuration.Json": "1.0.0",
+ "Microsoft.Extensions.Logging": "1.0.0",
+ "Microsoft.Extensions.Logging.Console": "1.0.0",
+ "Microsoft.Extensions.Logging.Debug": "1.0.0",
+ "System.Data.Common": "4.3.0",
+ "System.Data.SqlClient": "4.3.0"
+ },
+
+ "tools": {
+ "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
+ "version": "1.0.0-preview1-final",
+ "imports": "portable-net45+win8+dnxcore50"
+ }
+ },
+
+ "frameworks": {
+ "net451": {}
+ },
+
+ "buildOptions": {
+ "emitEntryPoint": true,
+ "preserveCompilationContext": true
+ },
+
+ "publishOptions": {
+ "include": [
+ "wwwroot",
+ "Views",
+ "appsettings.json",
+ "web.config"
+ ]
+ },
+
+ "scripts": {
+ "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
+ }
+}
diff --git a/samples/features/json/Dapper-Orm/sql-scripts/setup.sql b/samples/features/json/Dapper-Orm/sql-scripts/setup.sql
new file mode 100644
index 00000000..67682b40
--- /dev/null
+++ b/samples/features/json/Dapper-Orm/sql-scripts/setup.sql
@@ -0,0 +1,119 @@
+USE master
+GO
+
+DROP DATABASE IF EXISTS ProductCatalog
+GO
+
+CREATE DATABASE ProductCatalog
+GO
+
+USE ProductCatalog
+GO
+
+DROP TABLE IF EXISTS Product
+GO
+
+CREATE TABLE Product (
+ ProductID int IDENTITY PRIMARY KEY,
+ Name nvarchar(50) NOT NULL,
+ Color nvarchar(15) NULL,
+ Size nvarchar(5) NULL,
+ Price money NOT NULL,
+ Quantity int NULL,
+ Data nvarchar(4000),
+ Tags nvarchar(4000)
+)
+GO
+
+SET IDENTITY_INSERT Product ON
+GO
+
+DECLARE @products NVARCHAR(MAX) =
+N'[{"ProductID":15,"Name":"Adjustable Race","Color":"Magenta","Size":"62","Price":100.0000,"Quantity":75,"Data":{"Type":"Part","MadeIn":"China"}},{"ProductID":16,"Name":"Bearing Ball","Color":"Magenta","Size":"62","Price":15.9900,"Quantity":90,"Data":{"ManufacturingCost":11.672700,"Type":"Part","MadeIn":"China"},"Tags":["promo"]},{"ProductID":17,"Name":"BB Ball Bearing","Color":"Magenta","Size":"62","Price":28.9900,"Quantity":80,"Data":{"ManufacturingCost":21.162700,"Type":"Part","MadeIn":"China"}},{"ProductID":18,"Name":"Blade","Color":"Magenta","Size":"62","Price":18.0000,"Quantity":45,"Data":{},"Tags":["new"]},{"ProductID":19,"Name":"Sport-100 Helmet, Red","Color":"Red","Size":"72","Price":41.9900,"Quantity":38,"Data":{"ManufacturingCost":30.652700,"Type":"Еquipment","MadeIn":"China"},"Tags":["promo"]},{"ProductID":20,"Name":"Sport-100 Helmet, Black","Color":"Black","Size":"72","Price":31.4900,"Quantity":60,"Data":{"ManufacturingCost":22.987700,"Type":"Еquipment","MadeIn":"China"},"Tags":["new","promo"]},{"ProductID":21,"Name":"Mountain Bike Socks, M","Color":"White","Size":"M","Price":560.9900,"Quantity":30,"Data":{"Type":"Clothes"},"Tags":["sales","promo"]},{"ProductID":22,"Name":"Mountain Bike Socks, L","Color":"White","Size":"L","Price":120.9900,"Quantity":20,"Data":{"ManufacturingCost":88.322700,"Type":"Clothes"},"Tags":["sales","promo"]},{"ProductID":23,"Name":"Long-Sleeve Logo Jersey, XL","Color":"Multi","Size":"XL","Price":44.9900,"Quantity":60,"Data":{"ManufacturingCost":32.842700,"Type":"Clothes"},"Tags":["sales","promo"]},{"ProductID":24,"Name":"Road-650 Black, 52","Color":"Black","Size":"52","Price":704.6900,"Quantity":70,"Data":{"Type":"Bike","MadeIn":"UK"}},{"ProductID":25,"Name":"Mountain-100 Silver, 38","Color":"Silver","Size":"38","Price":359.9900,"Quantity":45,"Data":{"ManufacturingCost":262.792700,"Type":"Bike","MadeIn":"UK"},"Tags":["promo"]},{"ProductID":26,"Name":"Road-250 Black, 48","Color":"Black","Size":"48","Price":299.0200,"Quantity":25,"Data":{"ManufacturingCost":218.284600,"Type":"Bike","MadeIn":"UK"},"Tags":["new","promo"]},{"ProductID":27,"Name":"ML Bottom Bracket","Price":101.2400,"Quantity":50,"Data":{"Type":"Part","MadeIn":"China"}},{"ProductID":28,"Name":"HL Bottom Bracket","Price":121.4900,"Quantity":65,"Data":{"ManufacturingCost":88.687700,"Type":"Part","MadeIn":"China"}}]'
+INSERT INTO Product (ProductID, Name, Color, Size, Price, Quantity, Data, Tags)
+SELECT ProductID, Name, Color, Size, Price, Quantity, Data, Tags
+FROM OPENJSON (@products) WITH(
+ ProductID int,
+ Name nvarchar(50),
+ Color nvarchar(15),
+ Size nvarchar(5),
+ Price money,
+ Quantity int,
+ Data nvarchar(MAX) AS JSON,
+ Tags nvarchar(MAX) AS JSON
+)
+GO
+
+SET IDENTITY_INSERT Product OFF
+GO
+
+CREATE PROCEDURE dbo.InsertProductFromJson(@ProductJson NVARCHAR(MAX))
+AS BEGIN
+
+ INSERT INTO dbo.Product(Name,Color,Size,Price,Quantity,Data,Tags)
+ OUTPUT INSERTED.ProductID
+ SELECT Name,Color,Size,Price,Quantity,Data,Tags
+ FROM OPENJSON(@ProductJson)
+ WITH ( Name nvarchar(100) N'strict $."Name"',
+ Color nvarchar(30),
+ Size nvarchar(10),
+ Price money N'strict $."Price"',
+ Quantity int,
+ Data nvarchar(max) AS JSON,
+ Tags nvarchar(max) AS JSON) as json
+END
+GO
+
+CREATE PROCEDURE dbo.UpdateProductFromJson(@ProductID int, @ProductJson NVARCHAR(MAX))
+AS BEGIN
+
+ UPDATE dbo.Product SET
+ Name = json.Name,
+ Color = json.Color,
+ Size = json.Size,
+ Price = json.Price,
+ Quantity = json.Quantity,
+ Data = ISNULL(json.Data, dbo.Product.Data),
+ Tags = ISNULL(json.Tags,dbo.Product.Tags)
+ FROM OPENJSON(@ProductJson)
+ WITH ( Name nvarchar(100) N'strict $."Name"',
+ Color nvarchar(30),
+ Size nvarchar(10),
+ Price money N'strict $."Price"',
+ Quantity int,
+ Data nvarchar(max) AS JSON,
+ Tags nvarchar(max) AS JSON) as json
+ WHERE dbo.Product.ProductID = @ProductID
+
+END
+GO
+
+CREATE PROCEDURE dbo.UpsertProductFromJson(@ProductID int, @ProductJson NVARCHAR(MAX))
+AS BEGIN
+
+ MERGE INTO dbo.Product
+ USING ( SELECT Name,Color,Size,Price,Quantity,Data,Tags
+ FROM OPENJSON(@ProductJson)
+ WITH (
+ Name nvarchar(100) N'strict $."Name"',
+ Color nvarchar(30),
+ Size nvarchar(10),
+ Price money N'strict $."Price"',
+ Quantity int,
+ Data nvarchar(max) AS JSON,
+ Tags nvarchar(max) AS JSON)) as json
+ ON (dbo.Product.ProductID = @ProductID)
+ WHEN MATCHED THEN
+ UPDATE SET
+ Name = json.Name,
+ Color = json.Color,
+ Size = json.Size,
+ Price = json.Price,
+ Quantity = json.Quantity,
+ Data = json.Data,
+ Tags = json.Tags
+ WHEN NOT MATCHED THEN
+ INSERT (Name,Color,Size,Price,Quantity,Data,Tags)
+ VALUES (json.Name,json.Color,json.Size,json.Price,json.Quantity,json.Data,json.Tags);
+END
+GO
\ No newline at end of file
diff --git a/samples/features/json/Dapper-Orm/web.config b/samples/features/json/Dapper-Orm/web.config
new file mode 100644
index 00000000..dc0514fc
--- /dev/null
+++ b/samples/features/json/Dapper-Orm/web.config
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/features/json/Dapper-Orm/wwwroot/favicon.ico b/samples/features/json/Dapper-Orm/wwwroot/favicon.ico
new file mode 100644
index 00000000..118d4df9
Binary files /dev/null and b/samples/features/json/Dapper-Orm/wwwroot/favicon.ico differ
diff --git a/samples/features/json/Dapper-Orm/wwwroot/index.html b/samples/features/json/Dapper-Orm/wwwroot/index.html
new file mode 100644
index 00000000..085e1b5c
--- /dev/null
+++ b/samples/features/json/Dapper-Orm/wwwroot/index.html
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+ Products
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
", { valign: "top", colSpan: ba(a), "class": a.oClasses.sRowEmpty }).html(c))[0]; w(a, "aoHeaderCallback", "header", [g(a.nTHead).children("tr")[0],
+ Ma(a), h, n, j]); w(a, "aoFooterCallback", "footer", [g(a.nTFoot).children("tr")[0], Ma(a), h, n, j]); d = g(a.nTBody); d.children().detach(); d.append(g(b)); w(a, "aoDrawCallback", "draw", [a]); a.bSorted = !1; a.bFiltered = !1; a.bDrawing = !1
+ }
+ } function R(a, b) { var c = a.oFeatures, d = c.bFilter; c.bSort && mb(a); d ? ga(a, a.oPreviousSearch) : a.aiDisplay = a.aiDisplayMaster.slice(); !0 !== b && (a._iDisplayStart = 0); a._drawHold = b; M(a); a._drawHold = !1 } function nb(a) {
+ var b = a.oClasses, c = g(a.nTable), c = g("").insertBefore(c), d = a.oFeatures, e = g("",
+ { id: a.sTableId + "_wrapper", "class": b.sWrapper + (a.nTFoot ? "" : " " + b.sNoFooter) }); a.nHolding = c[0]; a.nTableWrapper = e[0]; a.nTableReinsertBefore = a.nTable.nextSibling; for (var f = a.sDom.split(""), h, i, j, n, l, r, q = 0; q < f.length; q++) {
+ h = null; i = f[q]; if ("<" == i) {
+ j = g("")[0]; n = f[q + 1]; if ("'" == n || '"' == n) {
+ l = ""; for (r = 2; f[q + r] != n;) l += f[q + r], r++; "H" == l ? l = b.sJUIHeader : "F" == l && (l = b.sJUIFooter); -1 != l.indexOf(".") ? (n = l.split("."), j.id = n[0].substr(1, n[0].length - 1), j.className = n[1]) : "#" == l.charAt(0) ? j.id = l.substr(1, l.length -
+ 1) : j.className = l; q += r
+ } e.append(j); e = g(j)
+ } else if (">" == i) e = e.parent(); else if ("l" == i && d.bPaginate && d.bLengthChange) h = ob(a); else if ("f" == i && d.bFilter) h = pb(a); else if ("r" == i && d.bProcessing) h = qb(a); else if ("t" == i) h = rb(a); else if ("i" == i && d.bInfo) h = sb(a); else if ("p" == i && d.bPaginate) h = tb(a); else if (0 !== m.ext.feature.length) { j = m.ext.feature; r = 0; for (n = j.length; r < n; r++) if (i == j[r].cFeature) { h = j[r].fnInit(a); break } } h && (j = a.aanFeatures, j[i] || (j[i] = []), j[i].push(h), e.append(h))
+ } c.replaceWith(e); a.nHolding = null
+ }
+ function ea(a, b) { var c = g(b).children("tr"), d, e, f, h, i, j, n, l, r, q; a.splice(0, a.length); f = 0; for (j = c.length; f < j; f++) a.push([]); f = 0; for (j = c.length; f < j; f++) { d = c[f]; for (e = d.firstChild; e;) { if ("TD" == e.nodeName.toUpperCase() || "TH" == e.nodeName.toUpperCase()) { l = 1 * e.getAttribute("colspan"); r = 1 * e.getAttribute("rowspan"); l = !l || 0 === l || 1 === l ? 1 : l; r = !r || 0 === r || 1 === r ? 1 : r; h = 0; for (i = a[f]; i[h];) h++; n = h; q = 1 === l ? !0 : !1; for (i = 0; i < l; i++) for (h = 0; h < r; h++) a[f + h][n + i] = { cell: e, unique: q }, a[f + h].nTr = d } e = e.nextSibling } } } function qa(a,
+ b, c) { var d = []; c || (c = a.aoHeader, b && (c = [], ea(c, b))); for (var b = 0, e = c.length; b < e; b++) for (var f = 0, h = c[b].length; f < h; f++) if (c[b][f].unique && (!d[f] || !a.bSortCellsTop)) d[f] = c[b][f].cell; return d } function ra(a, b, c) {
+ w(a, "aoServerParams", "serverParams", [b]); if (b && g.isArray(b)) { var d = {}, e = /(.*?)\[\]$/; g.each(b, function (a, b) { var c = b.name.match(e); c ? (c = c[0], d[c] || (d[c] = []), d[c].push(b.value)) : d[b.name] = b.value }); b = d } var f, h = a.ajax, i = a.oInstance, j = function (b) { w(a, null, "xhr", [a, b, a.jqXHR]); c(b) }; if (g.isPlainObject(h) &&
+ h.data) { f = h.data; var n = g.isFunction(f) ? f(b, a) : f, b = g.isFunction(f) && n ? n : g.extend(!0, b, n); delete h.data } n = { data: b, success: function (b) { var c = b.error || b.sError; c && J(a, 0, c); a.json = b; j(b) }, dataType: "json", cache: !1, type: a.sServerMethod, error: function (b, c) { var f = w(a, null, "xhr", [a, null, a.jqXHR]); -1 === g.inArray(!0, f) && ("parsererror" == c ? J(a, 0, "Invalid JSON response", 1) : 4 === b.readyState && J(a, 0, "Ajax error", 7)); C(a, !1) } }; a.oAjaxData = b; w(a, null, "preXhr", [a, b]); a.fnServerData ? a.fnServerData.call(i, a.sAjaxSource,
+ g.map(b, function (a, b) { return { name: b, value: a } }), j, a) : a.sAjaxSource || "string" === typeof h ? a.jqXHR = g.ajax(g.extend(n, { url: h || a.sAjaxSource })) : g.isFunction(h) ? a.jqXHR = h.call(i, b, j, a) : (a.jqXHR = g.ajax(g.extend(n, h)), h.data = f)
+ } function lb(a) { return a.bAjaxDataGet ? (a.iDraw++, C(a, !0), ra(a, ub(a), function (b) { vb(a, b) }), !1) : !0 } function ub(a) {
+ var b = a.aoColumns, c = b.length, d = a.oFeatures, e = a.oPreviousSearch, f = a.aoPreSearchCols, h, i = [], j, n, l, r = V(a); h = a._iDisplayStart; j = !1 !== d.bPaginate ? a._iDisplayLength : -1; var q = function (a,
+ b) { i.push({ name: a, value: b }) }; q("sEcho", a.iDraw); q("iColumns", c); q("sColumns", D(b, "sName").join(",")); q("iDisplayStart", h); q("iDisplayLength", j); var k = { draw: a.iDraw, columns: [], order: [], start: h, length: j, search: { value: e.sSearch, regex: e.bRegex } }; for (h = 0; h < c; h++) n = b[h], l = f[h], j = "function" == typeof n.mData ? "function" : n.mData, k.columns.push({ data: j, name: n.sName, searchable: n.bSearchable, orderable: n.bSortable, search: { value: l.sSearch, regex: l.bRegex } }), q("mDataProp_" + h, j), d.bFilter && (q("sSearch_" + h, l.sSearch),
+ q("bRegex_" + h, l.bRegex), q("bSearchable_" + h, n.bSearchable)), d.bSort && q("bSortable_" + h, n.bSortable); d.bFilter && (q("sSearch", e.sSearch), q("bRegex", e.bRegex)); d.bSort && (g.each(r, function (a, b) { k.order.push({ column: b.col, dir: b.dir }); q("iSortCol_" + a, b.col); q("sSortDir_" + a, b.dir) }), q("iSortingCols", r.length)); b = m.ext.legacy.ajax; return null === b ? a.sAjaxSource ? i : k : b ? i : k
+ } function vb(a, b) {
+ var c = sa(a, b), d = b.sEcho !== k ? b.sEcho : b.draw, e = b.iTotalRecords !== k ? b.iTotalRecords : b.recordsTotal, f = b.iTotalDisplayRecords !==
+ k ? b.iTotalDisplayRecords : b.recordsFiltered; if (d) { if (1 * d < a.iDraw) return; a.iDraw = 1 * d } oa(a); a._iRecordsTotal = parseInt(e, 10); a._iRecordsDisplay = parseInt(f, 10); d = 0; for (e = c.length; d < e; d++) L(a, c[d]); a.aiDisplay = a.aiDisplayMaster.slice(); a.bAjaxDataGet = !1; M(a); a._bInitComplete || ta(a, b); a.bAjaxDataGet = !0; C(a, !1)
+ } function sa(a, b) { var c = g.isPlainObject(a.ajax) && a.ajax.dataSrc !== k ? a.ajax.dataSrc : a.sAjaxDataProp; return "data" === c ? b.aaData || b[c] : "" !== c ? P(c)(b) : b } function pb(a) {
+ var b = a.oClasses, c = a.sTableId, d = a.oLanguage,
+ e = a.oPreviousSearch, f = a.aanFeatures, h = '', i = d.sSearch, i = i.match(/_INPUT_/) ? i.replace("_INPUT_", h) : i + h, b = g("", { id: !f.f ? c + "_filter" : null, "class": b.sFilter }).append(g("").append(i)), f = function () { var b = !this.value ? "" : this.value; b != e.sSearch && (ga(a, { sSearch: b, bRegex: e.bRegex, bSmart: e.bSmart, bCaseInsensitive: e.bCaseInsensitive }), a._iDisplayStart = 0, M(a)) }, h = null !== a.searchDelay ? a.searchDelay : "ssp" === z(a) ? 400 : 0, j = g("input", b).val(e.sSearch).attr("placeholder",
+ d.sSearchPlaceholder).bind("keyup.DT search.DT input.DT paste.DT cut.DT", h ? ua(f, h) : f).bind("keypress.DT", function (a) { if (13 == a.keyCode) return !1 }).attr("aria-controls", c); g(a.nTable).on("search.dt.DT", function (b, c) { if (a === c) try { j[0] !== T.activeElement && j.val(e.sSearch) } catch (f) { } }); return b[0]
+ } function ga(a, b, c) {
+ var d = a.oPreviousSearch, e = a.aoPreSearchCols, f = function (a) { d.sSearch = a.sSearch; d.bRegex = a.bRegex; d.bSmart = a.bSmart; d.bCaseInsensitive = a.bCaseInsensitive }; Ia(a); if ("ssp" != z(a)) {
+ wb(a, b.sSearch,
+ c, b.bEscapeRegex !== k ? !b.bEscapeRegex : b.bRegex, b.bSmart, b.bCaseInsensitive); f(b); for (b = 0; b < e.length; b++) xb(a, e[b].sSearch, b, e[b].bEscapeRegex !== k ? !e[b].bEscapeRegex : e[b].bRegex, e[b].bSmart, e[b].bCaseInsensitive); yb(a)
+ } else f(b); a.bFiltered = !0; w(a, null, "search", [a])
+ } function yb(a) { for (var b = m.ext.search, c = a.aiDisplay, d, e, f = 0, h = b.length; f < h; f++) { for (var i = [], j = 0, g = c.length; j < g; j++) e = c[j], d = a.aoData[e], b[f](a, d._aFilterData, e, d._aData, j) && i.push(e); c.length = 0; c.push.apply(c, i) } } function xb(a, b, c, d, e,
+ f) { if ("" !== b) for (var h = a.aiDisplay, d = Ra(b, d, e, f), e = h.length - 1; 0 <= e; e--) b = a.aoData[h[e]]._aFilterData[c], d.test(b) || h.splice(e, 1) } function wb(a, b, c, d, e, f) { var d = Ra(b, d, e, f), e = a.oPreviousSearch.sSearch, f = a.aiDisplayMaster, h; 0 !== m.ext.search.length && (c = !0); h = zb(a); if (0 >= b.length) a.aiDisplay = f.slice(); else { if (h || c || e.length > b.length || 0 !== b.indexOf(e) || a.bSorted) a.aiDisplay = f.slice(); b = a.aiDisplay; for (c = b.length - 1; 0 <= c; c--) d.test(a.aoData[b[c]]._sFilterRow) || b.splice(c, 1) } } function Ra(a, b, c, d) {
+ a = b ? a : va(a);
+ c && (a = "^(?=.*?" + g.map(a.match(/"[^"]+"|[^ ]+/g) || [""], function (a) { if ('"' === a.charAt(0)) var b = a.match(/^"(.*)"$/), a = b ? b[1] : a; return a.replace('"', "") }).join(")(?=.*?") + ").*$"); return RegExp(a, d ? "i" : "")
+ } function va(a) { return a.replace(Zb, "\\$1") } function zb(a) {
+ var b = a.aoColumns, c, d, e, f, h, i, j, g, l = m.ext.type.search; c = !1; d = 0; for (f = a.aoData.length; d < f; d++) if (g = a.aoData[d], !g._aFilterData) {
+ i = []; e = 0; for (h = b.length; e < h; e++) c = b[e], c.bSearchable ? (j = y(a, d, e, "filter"), l[c.sType] && (j = l[c.sType](j)), null === j && (j =
+ ""), "string" !== typeof j && j.toString && (j = j.toString())) : j = "", j.indexOf && -1 !== j.indexOf("&") && (wa.innerHTML = j, j = $b ? wa.textContent : wa.innerText), j.replace && (j = j.replace(/[\r\n]/g, "")), i.push(j); g._aFilterData = i; g._sFilterRow = i.join(" "); c = !0
+ } return c
+ } function Ab(a) { return { search: a.sSearch, smart: a.bSmart, regex: a.bRegex, caseInsensitive: a.bCaseInsensitive } } function Bb(a) { return { sSearch: a.search, bSmart: a.smart, bRegex: a.regex, bCaseInsensitive: a.caseInsensitive } } function sb(a) {
+ var b = a.sTableId, c = a.aanFeatures.i,
+ d = g("", { "class": a.oClasses.sInfo, id: !c ? b + "_info" : null }); c || (a.aoDrawCallback.push({ fn: Cb, sName: "information" }), d.attr("role", "status").attr("aria-live", "polite"), g(a.nTable).attr("aria-describedby", b + "_info")); return d[0]
+ } function Cb(a) {
+ var b = a.aanFeatures.i; if (0 !== b.length) {
+ var c = a.oLanguage, d = a._iDisplayStart + 1, e = a.fnDisplayEnd(), f = a.fnRecordsTotal(), h = a.fnRecordsDisplay(), i = h ? c.sInfo : c.sInfoEmpty; h !== f && (i += " " + c.sInfoFiltered); i += c.sInfoPostFix; i = Db(a, i); c = c.fnInfoCallback; null !== c && (i =
+ c.call(a.oInstance, a, d, e, f, h, i)); g(b).html(i)
+ }
+ } function Db(a, b) { var c = a.fnFormatNumber, d = a._iDisplayStart + 1, e = a._iDisplayLength, f = a.fnRecordsDisplay(), h = -1 === e; return b.replace(/_START_/g, c.call(a, d)).replace(/_END_/g, c.call(a, a.fnDisplayEnd())).replace(/_MAX_/g, c.call(a, a.fnRecordsTotal())).replace(/_TOTAL_/g, c.call(a, f)).replace(/_PAGE_/g, c.call(a, h ? 1 : Math.ceil(d / e))).replace(/_PAGES_/g, c.call(a, h ? 1 : Math.ceil(f / e))) } function ha(a) {
+ var b, c, d = a.iInitDisplayStart, e = a.aoColumns, f; c = a.oFeatures; var h =
+ a.bDeferLoading; if (a.bInitialised) { nb(a); kb(a); fa(a, a.aoHeader); fa(a, a.aoFooter); C(a, !0); c.bAutoWidth && Ha(a); b = 0; for (c = e.length; b < c; b++) f = e[b], f.sWidth && (f.nTh.style.width = u(f.sWidth)); w(a, null, "preInit", [a]); R(a); e = z(a); if ("ssp" != e || h) "ajax" == e ? ra(a, [], function (c) { var f = sa(a, c); for (b = 0; b < f.length; b++) L(a, f[b]); a.iInitDisplayStart = d; R(a); C(a, !1); ta(a, c) }, a) : (C(a, !1), ta(a)) } else setTimeout(function () { ha(a) }, 200)
+ } function ta(a, b) {
+ a._bInitComplete = !0; (b || a.oInit.aaData) && Y(a); w(a, "aoInitComplete", "init",
+ [a, b])
+ } function Sa(a, b) { var c = parseInt(b, 10); a._iDisplayLength = c; Ta(a); w(a, null, "length", [a, c]) } function ob(a) {
+ for (var b = a.oClasses, c = a.sTableId, d = a.aLengthMenu, e = g.isArray(d[0]), f = e ? d[0] : d, d = e ? d[1] : d, e = g("", { name: c + "_length", "aria-controls": c, "class": b.sLengthSelect }), h = 0, i = f.length; h < i; h++) e[0][h] = new Option(d[h], f[h]); var j = g("").addClass(b.sLength); a.aanFeatures.l || (j[0].id = c + "_length"); j.children().append(a.oLanguage.sLengthMenu.replace("_MENU_", e[0].outerHTML)); g("select",
+ j).val(a._iDisplayLength).bind("change.DT", function () { Sa(a, g(this).val()); M(a) }); g(a.nTable).bind("length.dt.DT", function (b, c, f) { a === c && g("select", j).val(f) }); return j[0]
+ } function tb(a) {
+ var b = a.sPaginationType, c = m.ext.pager[b], d = "function" === typeof c, e = function (a) { M(a) }, b = g("").addClass(a.oClasses.sPaging + b)[0], f = a.aanFeatures; d || c.fnInit(a, b, e); f.p || (b.id = a.sTableId + "_paginate", a.aoDrawCallback.push({
+ fn: function (a) {
+ if (d) {
+ var b = a._iDisplayStart, g = a._iDisplayLength, n = a.fnRecordsDisplay(), l = -1 ===
+ g, b = l ? 0 : Math.ceil(b / g), g = l ? 1 : Math.ceil(n / g), n = c(b, g), k, l = 0; for (k = f.p.length; l < k; l++) Qa(a, "pageButton")(a, f.p[l], l, n, b, g)
+ } else c.fnUpdate(a, e)
+ }, sName: "pagination"
+ })); return b
+ } function Ua(a, b, c) {
+ var d = a._iDisplayStart, e = a._iDisplayLength, f = a.fnRecordsDisplay(); 0 === f || -1 === e ? d = 0 : "number" === typeof b ? (d = b * e, d > f && (d = 0)) : "first" == b ? d = 0 : "previous" == b ? (d = 0 <= e ? d - e : 0, 0 > d && (d = 0)) : "next" == b ? d + e < f && (d += e) : "last" == b ? d = Math.floor((f - 1) / e) * e : J(a, 0, "Unknown paging action: " + b, 5); b = a._iDisplayStart !== d; a._iDisplayStart =
+ d; b && (w(a, null, "page", [a]), c && M(a)); return b
+ } function qb(a) { return g("", { id: !a.aanFeatures.r ? a.sTableId + "_processing" : null, "class": a.oClasses.sProcessing }).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0] } function C(a, b) { a.oFeatures.bProcessing && g(a.aanFeatures.r).css("display", b ? "block" : "none"); w(a, null, "processing", [a, b]) } function rb(a) {
+ var b = g(a.nTable); b.attr("role", "grid"); var c = a.oScroll; if ("" === c.sX && "" === c.sY) return a.nTable; var d = c.sX, e = c.sY, f = a.oClasses, h = b.children("caption"),
+ i = h.length ? h[0]._captionSide : null, j = g(b[0].cloneNode(!1)), n = g(b[0].cloneNode(!1)), l = b.children("tfoot"); c.sX && "100%" === b.attr("width") && b.removeAttr("width"); l.length || (l = null); j = g("", { "class": f.sScrollWrapper }).append(g("", { "class": f.sScrollHead }).css({ overflow: "hidden", position: "relative", border: 0, width: d ? !d ? null : u(d) : "100%" }).append(g("", { "class": f.sScrollHeadInner }).css({ "box-sizing": "content-box", width: c.sXInner || "100%" }).append(j.removeAttr("id").css("margin-left", 0).append("top" ===
+ i ? h : null).append(b.children("thead"))))).append(g("", { "class": f.sScrollBody }).css({ position: "relative", overflow: "auto", width: !d ? null : u(d) }).append(b)); l && j.append(g("", { "class": f.sScrollFoot }).css({ overflow: "hidden", border: 0, width: d ? !d ? null : u(d) : "100%" }).append(g("", { "class": f.sScrollFootInner }).append(n.removeAttr("id").css("margin-left", 0).append("bottom" === i ? h : null).append(b.children("tfoot"))))); var b = j.children(), k = b[0], f = b[1], q = l ? b[2] : null; if (d) g(f).on("scroll.DT", function () {
+ var a =
+ this.scrollLeft; k.scrollLeft = a; l && (q.scrollLeft = a)
+ }); g(f).css(e && c.bCollapse ? "max-height" : "height", e); a.nScrollHead = k; a.nScrollBody = f; a.nScrollFoot = q; a.aoDrawCallback.push({ fn: Z, sName: "scrolling" }); return j[0]
+ } function Z(a) {
+ var b = a.oScroll, c = b.sX, d = b.sXInner, e = b.sY, b = b.iBarWidth, f = g(a.nScrollHead), h = f[0].style, i = f.children("div"), j = i[0].style, n = i.children("table"), i = a.nScrollBody, l = g(i), k = i.style, q = g(a.nScrollFoot).children("div"), m = q.children("table"), o = g(a.nTHead), E = g(a.nTable), p = E[0], t = p.style,
+ N = a.nTFoot ? g(a.nTFoot) : null, Eb = a.oBrowser, w = Eb.bScrollOversize, s, v, O, x, y = [], z = [], A = [], B, C = function (a) { a = a.style; a.paddingTop = "0"; a.paddingBottom = "0"; a.borderTopWidth = "0"; a.borderBottomWidth = "0"; a.height = 0 }; E.children("thead, tfoot").remove(); x = o.clone().prependTo(E); o = o.find("tr"); v = x.find("tr"); x.find("th, td").removeAttr("tabindex"); N && (O = N.clone().prependTo(E), s = N.find("tr"), O = O.find("tr")); c || (k.width = "100%", f[0].style.width = "100%"); g.each(qa(a, x), function (b, c) { B = la(a, b); c.style.width = a.aoColumns[B].sWidth });
+ N && H(function (a) { a.style.width = "" }, O); f = E.outerWidth(); if ("" === c) { t.width = "100%"; if (w && (E.find("tbody").height() > i.offsetHeight || "scroll" == l.css("overflow-y"))) t.width = u(E.outerWidth() - b); f = E.outerWidth() } else "" !== d && (t.width = u(d), f = E.outerWidth()); H(C, v); H(function (a) { A.push(a.innerHTML); y.push(u(g(a).css("width"))) }, v); H(function (a, b) { a.style.width = y[b] }, o); g(v).height(0); N && (H(C, O), H(function (a) { z.push(u(g(a).css("width"))) }, O), H(function (a, b) { a.style.width = z[b] }, s), g(O).height(0)); H(function (a,
+ b) { a.innerHTML = '
' + A[b] + "
"; a.style.width = y[b] }, v); N && H(function (a, b) { a.innerHTML = ""; a.style.width = z[b] }, O); if (E.outerWidth() < f) { s = i.scrollHeight > i.offsetHeight || "scroll" == l.css("overflow-y") ? f + b : f; if (w && (i.scrollHeight > i.offsetHeight || "scroll" == l.css("overflow-y"))) t.width = u(s - b); ("" === c || "" !== d) && J(a, 1, "Possible column misalignment", 6) } else s = "100%"; k.width = u(s); h.width = u(s); N && (a.nScrollFoot.style.width = u(s)); !e && w && (k.height =
+ u(p.offsetHeight + b)); c = E.outerWidth(); n[0].style.width = u(c); j.width = u(c); d = E.height() > i.clientHeight || "scroll" == l.css("overflow-y"); e = "padding" + (Eb.bScrollbarLeft ? "Left" : "Right"); j[e] = d ? b + "px" : "0px"; N && (m[0].style.width = u(c), q[0].style.width = u(c), q[0].style[e] = d ? b + "px" : "0px"); l.scroll(); if ((a.bSorted || a.bFiltered) && !a._drawHold) i.scrollTop = 0
+ } function H(a, b, c) {
+ for (var d = 0, e = 0, f = b.length, h, i; e < f;) {
+ h = b[e].firstChild; for (i = c ? c[e].firstChild : null; h;) 1 === h.nodeType && (c ? a(h, i, d) : a(h, d), d++), h = h.nextSibling,
+ i = c ? i.nextSibling : null; e++
+ }
+ } function Ha(a) {
+ var b = a.nTable, c = a.aoColumns, d = a.oScroll, e = d.sY, f = d.sX, h = d.sXInner, i = c.length, j = $(a, "bVisible"), n = g("th", a.nTHead), l = b.getAttribute("width"), k = b.parentNode, q = !1, m, o, p; p = a.oBrowser; d = p.bScrollOversize; (m = b.style.width) && -1 !== m.indexOf("%") && (l = m); for (m = 0; m < j.length; m++) o = c[j[m]], null !== o.sWidth && (o.sWidth = Fb(o.sWidthOrig, k), q = !0); if (d || !q && !f && !e && i == ba(a) && i == n.length) for (m = 0; m < i; m++) c[m].sWidth = u(n.eq(m).width()); else {
+ i = g(b).clone().css("visibility", "hidden").removeAttr("id");
+ i.find("tbody tr").remove(); var t = g("
").appendTo(i.find("tbody")); i.find("thead, tfoot").remove(); i.append(g(a.nTHead).clone()).append(g(a.nTFoot).clone()); i.find("tfoot th, tfoot td").css("width", ""); n = qa(a, i.find("thead")[0]); for (m = 0; m < j.length; m++) o = c[j[m]], n[m].style.width = null !== o.sWidthOrig && "" !== o.sWidthOrig ? u(o.sWidthOrig) : ""; if (a.aoData.length) for (m = 0; m < j.length; m++) q = j[m], o = c[q], g(Gb(a, q)).clone(!1).append(o.sContentPadding).appendTo(t); q = g("").css(f || e ? {
+ position: "absolute", top: 0,
+ left: 0, height: 1, right: 0, overflow: "hidden"
+ } : {}).append(i).appendTo(k); f && h ? i.width(h) : f ? (i.css("width", "auto"), i.width() < k.clientWidth && i.width(k.clientWidth)) : e ? i.width(k.clientWidth) : l && i.width(l); if (f) { for (m = h = 0; m < j.length; m++) o = c[j[m]], e = p.bBounding ? n[m].getBoundingClientRect().width : g(n[m]).outerWidth(), h += null === o.sWidthOrig ? e : parseInt(o.sWidth, 10) + e - g(n[m]).width(); i.width(u(h)); b.style.width = u(h) } for (m = 0; m < j.length; m++) if (o = c[j[m]], p = g(n[m]).width()) o.sWidth = u(p); b.style.width = u(i.css("width"));
+ q.remove()
+ } l && (b.style.width = u(l)); if ((l || f) && !a._reszEvt) b = function () { g(Fa).bind("resize.DT-" + a.sInstance, ua(function () { Y(a) })) }, d ? setTimeout(b, 1E3) : b(), a._reszEvt = !0
+ } function ua(a, b) { var c = b !== k ? b : 200, d, e; return function () { var b = this, h = +new Date, i = arguments; d && h < d + c ? (clearTimeout(e), e = setTimeout(function () { d = k; a.apply(b, i) }, c)) : (d = h, a.apply(b, i)) } } function Fb(a, b) { if (!a) return 0; var c = g("").css("width", u(a)).appendTo(b || T.body), d = c[0].offsetWidth; c.remove(); return d } function Gb(a, b) {
+ var c =
+ Hb(a, b); if (0 > c) return null; var d = a.aoData[c]; return !d.nTr ? g("
").html(y(a, c, b, "display"))[0] : d.anCells[b]
+ } function Hb(a, b) { for (var c, d = -1, e = -1, f = 0, h = a.aoData.length; f < h; f++) c = y(a, f, b, "display") + "", c = c.replace(ac, ""), c.length > d && (d = c.length, e = f); return e } function u(a) { return null === a ? "0px" : "number" == typeof a ? 0 > a ? "0px" : a + "px" : a.match(/\d$/) ? a + "px" : a } function Ib() {
+ var a = m.__scrollbarWidth; if (a === k) {
+ var b = g("").css({
+ position: "absolute", top: 0, left: 0, width: "100%", height: 150, padding: 0, overflow: "scroll",
+ visibility: "hidden"
+ }).appendTo("body"), a = b[0].offsetWidth - b[0].clientWidth; m.__scrollbarWidth = a; b.remove()
+ } return a
+ } function V(a) {
+ var b, c, d = [], e = a.aoColumns, f, h, i, j; b = a.aaSortingFixed; c = g.isPlainObject(b); var n = []; f = function (a) { a.length && !g.isArray(a[0]) ? n.push(a) : n.push.apply(n, a) }; g.isArray(b) && f(b); c && b.pre && f(b.pre); f(a.aaSorting); c && b.post && f(b.post); for (a = 0; a < n.length; a++) {
+ j = n[a][0]; f = e[j].aDataSort; b = 0; for (c = f.length; b < c; b++) h = f[b], i = e[h].sType || "string", n[a]._idx === k && (n[a]._idx = g.inArray(n[a][1],
+ e[h].asSorting)), d.push({ src: j, col: h, dir: n[a][1], index: n[a]._idx, type: i, formatter: m.ext.type.order[i + "-pre"] })
+ } return d
+ } function mb(a) {
+ var b, c, d = [], e = m.ext.type.order, f = a.aoData, h = 0, i, g = a.aiDisplayMaster, n; Ia(a); n = V(a); b = 0; for (c = n.length; b < c; b++) i = n[b], i.formatter && h++, Jb(a, i.col); if ("ssp" != z(a) && 0 !== n.length) {
+ b = 0; for (c = g.length; b < c; b++) d[g[b]] = b; h === n.length ? g.sort(function (a, b) {
+ var c, e, h, i, g = n.length, j = f[a]._aSortData, k = f[b]._aSortData; for (h = 0; h < g; h++) if (i = n[h], c = j[i.col], e = k[i.col], c = c < e ? -1 : c >
+ e ? 1 : 0, 0 !== c) return "asc" === i.dir ? c : -c; c = d[a]; e = d[b]; return c < e ? -1 : c > e ? 1 : 0
+ }) : g.sort(function (a, b) { var c, h, i, g, j = n.length, k = f[a]._aSortData, m = f[b]._aSortData; for (i = 0; i < j; i++) if (g = n[i], c = k[g.col], h = m[g.col], g = e[g.type + "-" + g.dir] || e["string-" + g.dir], c = g(c, h), 0 !== c) return c; c = d[a]; h = d[b]; return c < h ? -1 : c > h ? 1 : 0 })
+ } a.bSorted = !0
+ } function Kb(a) {
+ for (var b, c, d = a.aoColumns, e = V(a), a = a.oLanguage.oAria, f = 0, h = d.length; f < h; f++) {
+ c = d[f]; var i = c.asSorting; b = c.sTitle.replace(/<.*?>/g, ""); var g = c.nTh; g.removeAttribute("aria-sort");
+ c.bSortable && (0 < e.length && e[0].col == f ? (g.setAttribute("aria-sort", "asc" == e[0].dir ? "ascending" : "descending"), c = i[e[0].index + 1] || i[0]) : c = i[0], b += "asc" === c ? a.sSortAscending : a.sSortDescending); g.setAttribute("aria-label", b)
+ }
+ } function Va(a, b, c, d) {
+ var e = a.aaSorting, f = a.aoColumns[b].asSorting, h = function (a, b) { var c = a._idx; c === k && (c = g.inArray(a[1], f)); return c + 1 < f.length ? c + 1 : b ? null : 0 }; "number" === typeof e[0] && (e = a.aaSorting = [e]); c && a.oFeatures.bSortMulti ? (c = g.inArray(b, D(e, "0")), -1 !== c ? (b = h(e[c], !0), null ===
+ b && 1 === e.length && (b = 0), null === b ? e.splice(c, 1) : (e[c][1] = f[b], e[c]._idx = b)) : (e.push([b, f[0], 0]), e[e.length - 1]._idx = 0)) : e.length && e[0][0] == b ? (b = h(e[0]), e.length = 1, e[0][1] = f[b], e[0]._idx = b) : (e.length = 0, e.push([b, f[0]]), e[0]._idx = 0); R(a); "function" == typeof d && d(a)
+ } function Pa(a, b, c, d) { var e = a.aoColumns[c]; Wa(b, {}, function (b) { !1 !== e.bSortable && (a.oFeatures.bProcessing ? (C(a, !0), setTimeout(function () { Va(a, c, b.shiftKey, d); "ssp" !== z(a) && C(a, !1) }, 0)) : Va(a, c, b.shiftKey, d)) }) } function xa(a) {
+ var b = a.aLastSort,
+ c = a.oClasses.sSortColumn, d = V(a), e = a.oFeatures, f, h; if (e.bSort && e.bSortClasses) { e = 0; for (f = b.length; e < f; e++) h = b[e].src, g(D(a.aoData, "anCells", h)).removeClass(c + (2 > e ? e + 1 : 3)); e = 0; for (f = d.length; e < f; e++) h = d[e].src, g(D(a.aoData, "anCells", h)).addClass(c + (2 > e ? e + 1 : 3)) } a.aLastSort = d
+ } function Jb(a, b) {
+ var c = a.aoColumns[b], d = m.ext.order[c.sSortDataType], e; d && (e = d.call(a.oInstance, a, b, aa(a, b))); for (var f, h = m.ext.type.order[c.sType + "-pre"], i = 0, g = a.aoData.length; i < g; i++) if (c = a.aoData[i], c._aSortData || (c._aSortData =
+ []), !c._aSortData[b] || d) f = d ? e[i] : y(a, i, b, "sort"), c._aSortData[b] = h ? h(f) : f
+ } function ya(a) { if (a.oFeatures.bStateSave && !a.bDestroying) { var b = { time: +new Date, start: a._iDisplayStart, length: a._iDisplayLength, order: g.extend(!0, [], a.aaSorting), search: Ab(a.oPreviousSearch), columns: g.map(a.aoColumns, function (b, d) { return { visible: b.bVisible, search: Ab(a.aoPreSearchCols[d]) } }) }; w(a, "aoStateSaveParams", "stateSaveParams", [a, b]); a.oSavedState = b; a.fnStateSaveCallback.call(a.oInstance, a, b) } } function Lb(a) {
+ var b, c, d =
+ a.aoColumns; if (a.oFeatures.bStateSave) {
+ var e = a.fnStateLoadCallback.call(a.oInstance, a); if (e && e.time && (b = w(a, "aoStateLoadParams", "stateLoadParams", [a, e]), -1 === g.inArray(!1, b) && (b = a.iStateDuration, !(0 < b && e.time < +new Date - 1E3 * b) && d.length === e.columns.length))) {
+ a.oLoadedState = g.extend(!0, {}, e); e.start !== k && (a._iDisplayStart = e.start, a.iInitDisplayStart = e.start); e.length !== k && (a._iDisplayLength = e.length); e.order !== k && (a.aaSorting = [], g.each(e.order, function (b, c) {
+ a.aaSorting.push(c[0] >= d.length ? [0, c[1]] :
+ c)
+ })); e.search !== k && g.extend(a.oPreviousSearch, Bb(e.search)); b = 0; for (c = e.columns.length; b < c; b++) { var f = e.columns[b]; f.visible !== k && (d[b].bVisible = f.visible); f.search !== k && g.extend(a.aoPreSearchCols[b], Bb(f.search)) } w(a, "aoStateLoaded", "stateLoaded", [a, e])
+ }
+ }
+ } function za(a) { var b = m.settings, a = g.inArray(a, D(b, "nTable")); return -1 !== a ? b[a] : null } function J(a, b, c, d) {
+ c = "DataTables warning: " + (a ? "table id=" + a.sTableId + " - " : "") + c; d && (c += ". For more information about this error, please see http://datatables.net/tn/" +
+ d); if (b) Fa.console && console.log && console.log(c); else if (b = m.ext, b = b.sErrMode || b.errMode, a && w(a, null, "error", [a, d, c]), "alert" == b) alert(c); else { if ("throw" == b) throw Error(c); "function" == typeof b && b(a, d, c) }
+ } function F(a, b, c, d) { g.isArray(c) ? g.each(c, function (c, f) { g.isArray(f) ? F(a, b, f[0], f[1]) : F(a, b, f) }) : (d === k && (d = c), b[c] !== k && (a[d] = b[c])) } function Mb(a, b, c) {
+ var d, e; for (e in b) b.hasOwnProperty(e) && (d = b[e], g.isPlainObject(d) ? (g.isPlainObject(a[e]) || (a[e] = {}), g.extend(!0, a[e], d)) : a[e] = c && "data" !== e && "aaData" !==
+ e && g.isArray(d) ? d.slice() : d); return a
+ } function Wa(a, b, c) { g(a).bind("click.DT", b, function (b) { a.blur(); c(b) }).bind("keypress.DT", b, function (a) { 13 === a.which && (a.preventDefault(), c(a)) }).bind("selectstart.DT", function () { return !1 }) } function A(a, b, c, d) { c && a[b].push({ fn: c, sName: d }) } function w(a, b, c, d) { var e = []; b && (e = g.map(a[b].slice().reverse(), function (b) { return b.fn.apply(a.oInstance, d) })); null !== c && (b = g.Event(c + ".dt"), g(a.nTable).trigger(b, d), e.push(b.result)); return e } function Ta(a) {
+ var b = a._iDisplayStart,
+ c = a.fnDisplayEnd(), d = a._iDisplayLength; b >= c && (b = c - d); b -= b % d; if (-1 === d || 0 > b) b = 0; a._iDisplayStart = b
+ } function Qa(a, b) { var c = a.renderer, d = m.ext.renderer[b]; return g.isPlainObject(c) && c[b] ? d[c[b]] || d._ : "string" === typeof c ? d[c] || d._ : d._ } function z(a) { return a.oFeatures.bServerSide ? "ssp" : a.ajax || a.sAjaxSource ? "ajax" : "dom" } function Aa(a, b) {
+ var c = [], c = Nb.numbers_length, d = Math.floor(c / 2); b <= c ? c = W(0, b) : a <= d ? (c = W(0, c - 2), c.push("ellipsis"), c.push(b - 1)) : (a >= b - 1 - d ? c = W(b - (c - 2), b) : (c = W(a - d + 2, a + d - 1), c.push("ellipsis"),
+ c.push(b - 1)), c.splice(0, 0, "ellipsis"), c.splice(0, 0, 0)); c.DT_el = "span"; return c
+ } function db(a) { g.each({ num: function (b) { return Ba(b, a) }, "num-fmt": function (b) { return Ba(b, a, Xa) }, "html-num": function (b) { return Ba(b, a, Ca) }, "html-num-fmt": function (b) { return Ba(b, a, Ca, Xa) } }, function (b, c) { v.type.order[b + a + "-pre"] = c; b.match(/^html\-/) && (v.type.search[b + a] = v.type.search.html) }) } function Ob(a) {
+ return function () {
+ var b = [za(this[m.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments)); return m.ext.internal[a].apply(this,
+ b)
+ }
+ } var m, v, t, p, s, Ya = {}, Pb = /[\r\n]/g, Ca = /<.*?>/g, bc = /^[\w\+\-]/, cc = /[\w\+\-]$/, Zb = RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)", "g"), Xa = /[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi, K = function (a) { return !a || !0 === a || "-" === a ? !0 : !1 }, Qb = function (a) { var b = parseInt(a, 10); return !isNaN(b) && isFinite(a) ? b : null }, Rb = function (a, b) { Ya[b] || (Ya[b] = RegExp(va(b), "g")); return "string" === typeof a && "." !== b ? a.replace(/\./g, "").replace(Ya[b], ".") : a }, Za = function (a, b, c) {
+ var d = "string" === typeof a;
+ if (K(a)) return !0; b && d && (a = Rb(a, b)); c && d && (a = a.replace(Xa, "")); return !isNaN(parseFloat(a)) && isFinite(a)
+ }, Sb = function (a, b, c) { return K(a) ? !0 : !(K(a) || "string" === typeof a) ? null : Za(a.replace(Ca, ""), b, c) ? !0 : null }, D = function (a, b, c) { var d = [], e = 0, f = a.length; if (c !== k) for (; e < f; e++) a[e] && a[e][b] && d.push(a[e][b][c]); else for (; e < f; e++) a[e] && d.push(a[e][b]); return d }, ia = function (a, b, c, d) { var e = [], f = 0, h = b.length; if (d !== k) for (; f < h; f++) a[b[f]][c] && e.push(a[b[f]][c][d]); else for (; f < h; f++) e.push(a[b[f]][c]); return e },
+ W = function (a, b) { var c = [], d; b === k ? (b = 0, d = a) : (d = b, b = a); for (var e = b; e < d; e++) c.push(e); return c }, Tb = function (a) { for (var b = [], c = 0, d = a.length; c < d; c++) a[c] && b.push(a[c]); return b }, Oa = function (a) { var b = [], c, d, e = a.length, f, h = 0; d = 0; a: for (; d < e; d++) { c = a[d]; for (f = 0; f < h; f++) if (b[f] === c) continue a; b.push(c); h++ } return b }, B = function (a, b, c) { a[b] !== k && (a[c] = a[b]) }, ca = /\[.*?\]$/, U = /\(\)$/, wa = g("
")[0], $b = wa.textContent !== k, ac = /<.*?>/g; m = function (a) {
+ this.$ = function (a, b) { return this.api(!0).$(a, b) }; this._ = function (a,
+ b) { return this.api(!0).rows(a, b).data() }; this.api = function (a) { return a ? new t(za(this[v.iApiIndex])) : new t(this) }; this.fnAddData = function (a, b) { var c = this.api(!0), d = g.isArray(a) && (g.isArray(a[0]) || g.isPlainObject(a[0])) ? c.rows.add(a) : c.row.add(a); (b === k || b) && c.draw(); return d.flatten().toArray() }; this.fnAdjustColumnSizing = function (a) { var b = this.api(!0).columns.adjust(), c = b.settings()[0], d = c.oScroll; a === k || a ? b.draw(!1) : ("" !== d.sX || "" !== d.sY) && Z(c) }; this.fnClearTable = function (a) {
+ var b = this.api(!0).clear();
+ (a === k || a) && b.draw()
+ }; this.fnClose = function (a) { this.api(!0).row(a).child.hide() }; this.fnDeleteRow = function (a, b, c) { var d = this.api(!0), a = d.rows(a), e = a.settings()[0], g = e.aoData[a[0][0]]; a.remove(); b && b.call(this, e, g); (c === k || c) && d.draw(); return g }; this.fnDestroy = function (a) { this.api(!0).destroy(a) }; this.fnDraw = function (a) { this.api(!0).draw(a) }; this.fnFilter = function (a, b, c, d, e, g) { e = this.api(!0); null === b || b === k ? e.search(a, c, d, g) : e.column(b).search(a, c, d, g); e.draw() }; this.fnGetData = function (a, b) {
+ var c =
+ this.api(!0); if (a !== k) { var d = a.nodeName ? a.nodeName.toLowerCase() : ""; return b !== k || "td" == d || "th" == d ? c.cell(a, b).data() : c.row(a).data() || null } return c.data().toArray()
+ }; this.fnGetNodes = function (a) { var b = this.api(!0); return a !== k ? b.row(a).node() : b.rows().nodes().flatten().toArray() }; this.fnGetPosition = function (a) { var b = this.api(!0), c = a.nodeName.toUpperCase(); return "TR" == c ? b.row(a).index() : "TD" == c || "TH" == c ? (a = b.cell(a).index(), [a.row, a.columnVisible, a.column]) : null }; this.fnIsOpen = function (a) { return this.api(!0).row(a).child.isShown() };
+ this.fnOpen = function (a, b, c) { return this.api(!0).row(a).child(b, c).show().child()[0] }; this.fnPageChange = function (a, b) { var c = this.api(!0).page(a); (b === k || b) && c.draw(!1) }; this.fnSetColumnVis = function (a, b, c) { a = this.api(!0).column(a).visible(b); (c === k || c) && a.columns.adjust().draw() }; this.fnSettings = function () { return za(this[v.iApiIndex]) }; this.fnSort = function (a) { this.api(!0).order(a).draw() }; this.fnSortListener = function (a, b, c) { this.api(!0).order.listener(a, b, c) }; this.fnUpdate = function (a, b, c, d, e) {
+ var g =
+ this.api(!0); c === k || null === c ? g.row(b).data(a) : g.cell(b, c).data(a); (e === k || e) && g.columns.adjust(); (d === k || d) && g.draw(); return 0
+ }; this.fnVersionCheck = v.fnVersionCheck; var b = this, c = a === k, d = this.length; c && (a = {}); this.oApi = this.internal = v.internal; for (var e in m.ext.internal) e && (this[e] = Ob(e)); this.each(function () {
+ var f = {}, f = 1 < d ? Mb(f, a, !0) : a, e = 0, i, j = this.getAttribute("id"), n = !1, l = m.defaults, r = g(this); if ("table" != this.nodeName.toLowerCase()) J(null, 0, "Non-table node initialisation (" + this.nodeName + ")", 2);
+ else {
+ eb(l); fb(l.column); I(l, l, !0); I(l.column, l.column, !0); I(l, g.extend(f, r.data())); var q = m.settings, e = 0; for (i = q.length; e < i; e++) { var p = q[e]; if (p.nTable == this || p.nTHead.parentNode == this || p.nTFoot && p.nTFoot.parentNode == this) { e = f.bRetrieve !== k ? f.bRetrieve : l.bRetrieve; if (c || e) return p.oInstance; if (f.bDestroy !== k ? f.bDestroy : l.bDestroy) { p.oInstance.fnDestroy(); break } else { J(p, 0, "Cannot reinitialise DataTable", 3); return } } if (p.sTableId == this.id) { q.splice(e, 1); break } } if (null === j || "" === j) this.id = j = "DataTables_Table_" +
+ m.ext._unique++; var o = g.extend(!0, {}, m.models.oSettings, { sDestroyWidth: r[0].style.width, sInstance: j, sTableId: j }); o.nTable = this; o.oApi = b.internal; o.oInit = f; q.push(o); o.oInstance = 1 === b.length ? b : r.dataTable(); eb(f); f.oLanguage && S(f.oLanguage); f.aLengthMenu && !f.iDisplayLength && (f.iDisplayLength = g.isArray(f.aLengthMenu[0]) ? f.aLengthMenu[0][0] : f.aLengthMenu[0]); f = Mb(g.extend(!0, {}, l), f); F(o.oFeatures, f, "bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender".split(" "));
+ F(o, f, ["asStripeClasses", "ajax", "fnServerData", "fnFormatNumber", "sServerMethod", "aaSorting", "aaSortingFixed", "aLengthMenu", "sPaginationType", "sAjaxSource", "sAjaxDataProp", "iStateDuration", "sDom", "bSortCellsTop", "iTabIndex", "fnStateLoadCallback", "fnStateSaveCallback", "renderer", "searchDelay", "rowId", ["iCookieDuration", "iStateDuration"], ["oSearch", "oPreviousSearch"], ["aoSearchCols", "aoPreSearchCols"], ["iDisplayLength", "_iDisplayLength"], ["bJQueryUI", "bJUI"]]); F(o.oScroll, f, [["sScrollX", "sX"], ["sScrollXInner",
+ "sXInner"], ["sScrollY", "sY"], ["bScrollCollapse", "bCollapse"]]); F(o.oLanguage, f, "fnInfoCallback"); A(o, "aoDrawCallback", f.fnDrawCallback, "user"); A(o, "aoServerParams", f.fnServerParams, "user"); A(o, "aoStateSaveParams", f.fnStateSaveParams, "user"); A(o, "aoStateLoadParams", f.fnStateLoadParams, "user"); A(o, "aoStateLoaded", f.fnStateLoaded, "user"); A(o, "aoRowCallback", f.fnRowCallback, "user"); A(o, "aoRowCreatedCallback", f.fnCreatedRow, "user"); A(o, "aoHeaderCallback", f.fnHeaderCallback, "user"); A(o, "aoFooterCallback",
+ f.fnFooterCallback, "user"); A(o, "aoInitComplete", f.fnInitComplete, "user"); A(o, "aoPreDrawCallback", f.fnPreDrawCallback, "user"); o.rowIdFn = P(f.rowId); j = o.oClasses; f.bJQueryUI ? (g.extend(j, m.ext.oJUIClasses, f.oClasses), f.sDom === l.sDom && "lfrtip" === l.sDom && (o.sDom = '<"H"lfr>t<"F"ip>'), o.renderer) ? g.isPlainObject(o.renderer) && !o.renderer.header && (o.renderer.header = "jqueryui") : o.renderer = "jqueryui" : g.extend(j, m.ext.classes, f.oClasses); r.addClass(j.sTable); if ("" !== o.oScroll.sX || "" !== o.oScroll.sY) o.oScroll.iBarWidth =
+ Ib(); o.iInitDisplayStart === k && (o.iInitDisplayStart = f.iDisplayStart, o._iDisplayStart = f.iDisplayStart); null !== f.iDeferLoading && (o.bDeferLoading = !0, e = g.isArray(f.iDeferLoading), o._iRecordsDisplay = e ? f.iDeferLoading[0] : f.iDeferLoading, o._iRecordsTotal = e ? f.iDeferLoading[1] : f.iDeferLoading); var t = o.oLanguage; g.extend(!0, t, f.oLanguage); "" !== t.sUrl && (g.ajax({ dataType: "json", url: t.sUrl, success: function (a) { S(a); I(l.oLanguage, a); g.extend(true, t, a); ha(o) }, error: function () { ha(o) } }), n = !0); null === f.asStripeClasses &&
+ (o.asStripeClasses = [j.sStripeOdd, j.sStripeEven]); var e = o.asStripeClasses, s = r.children("tbody").find("tr").eq(0); -1 !== g.inArray(!0, g.map(e, function (a) { return s.hasClass(a) })) && (g("tbody tr", this).removeClass(e.join(" ")), o.asDestroyStripes = e.slice()); q = []; e = this.getElementsByTagName("thead"); 0 !== e.length && (ea(o.aoHeader, e[0]), q = qa(o)); if (null === f.aoColumns) { p = []; e = 0; for (i = q.length; e < i; e++) p.push(null) } else p = f.aoColumns; e = 0; for (i = p.length; e < i; e++) Ga(o, q ? q[e] : null); ib(o, f.aoColumnDefs, p, function (a,
+ b) { ka(o, a, b) }); if (s.length) { var u = function (a, b) { return a.getAttribute("data-" + b) !== null ? b : null }; g.each(na(o, s[0]).cells, function (a, b) { var c = o.aoColumns[a]; if (c.mData === a) { var d = u(b, "sort") || u(b, "order"), e = u(b, "filter") || u(b, "search"); if (d !== null || e !== null) { c.mData = { _: a + ".display", sort: d !== null ? a + ".@data-" + d : k, type: d !== null ? a + ".@data-" + d : k, filter: e !== null ? a + ".@data-" + e : k }; ka(o, a) } } }) } var v = o.oFeatures; f.bStateSave && (v.bStateSave = !0, Lb(o, f), A(o, "aoDrawCallback", ya, "state_save")); if (f.aaSorting === k) {
+ q =
+ o.aaSorting; e = 0; for (i = q.length; e < i; e++) q[e][1] = o.aoColumns[e].asSorting[0]
+ } xa(o); v.bSort && A(o, "aoDrawCallback", function () { if (o.bSorted) { var a = V(o), b = {}; g.each(a, function (a, c) { b[c.src] = c.dir }); w(o, null, "order", [o, a, b]); Kb(o) } }); A(o, "aoDrawCallback", function () { (o.bSorted || z(o) === "ssp" || v.bDeferRender) && xa(o) }, "sc"); gb(o); e = r.children("caption").each(function () { this._captionSide = r.css("caption-side") }); i = r.children("thead"); 0 === i.length && (i = g("").appendTo(this)); o.nTHead = i[0]; i = r.children("tbody");
+ 0 === i.length && (i = g("").appendTo(this)); o.nTBody = i[0]; i = r.children("tfoot"); if (0 === i.length && 0 < e.length && ("" !== o.oScroll.sX || "" !== o.oScroll.sY)) i = g("").appendTo(this); 0 === i.length || 0 === i.children().length ? r.addClass(j.sNoFooter) : 0 < i.length && (o.nTFoot = i[0], ea(o.aoFooter, o.nTFoot)); if (f.aaData) for (e = 0; e < f.aaData.length; e++) L(o, f.aaData[e]); else (o.bDeferLoading || "dom" == z(o)) && ma(o, g(o.nTBody).children("tr")); o.aiDisplay = o.aiDisplayMaster.slice(); o.bInitialised = !0; !1 === n && ha(o)
+ }
+ }); b = null;
+ return this
+ }; var Ub = [], x = Array.prototype, dc = function (a) { var b, c, d = m.settings, e = g.map(d, function (a) { return a.nTable }); if (a) { if (a.nTable && a.oApi) return [a]; if (a.nodeName && "table" === a.nodeName.toLowerCase()) return b = g.inArray(a, e), -1 !== b ? [d[b]] : null; if (a && "function" === typeof a.settings) return a.settings().toArray(); "string" === typeof a ? c = g(a) : a instanceof g && (c = a) } else return []; if (c) return c.map(function () { b = g.inArray(this, e); return -1 !== b ? d[b] : null }).toArray() }; t = function (a, b) {
+ if (!(this instanceof t)) return new t(a,
+ b); var c = [], d = function (a) { (a = dc(a)) && c.push.apply(c, a) }; if (g.isArray(a)) for (var e = 0, f = a.length; e < f; e++) d(a[e]); else d(a); this.context = Oa(c); b && this.push.apply(this, b.toArray ? b.toArray() : b); this.selector = { rows: null, cols: null, opts: null }; t.extend(this, this, Ub)
+ }; m.Api = t; t.prototype = {
+ any: function () { return 0 !== this.count() }, concat: x.concat, context: [], count: function () { return this.flatten().length }, each: function (a) { for (var b = 0, c = this.length; b < c; b++) a.call(this, this[b], b, this); return this }, eq: function (a) {
+ var b =
+ this.context; return b.length > a ? new t(b[a], this[a]) : null
+ }, filter: function (a) { var b = []; if (x.filter) b = x.filter.call(this, a, this); else for (var c = 0, d = this.length; c < d; c++) a.call(this, this[c], c, this) && b.push(this[c]); return new t(this.context, b) }, flatten: function () { var a = []; return new t(this.context, a.concat.apply(a, this.toArray())) }, join: x.join, indexOf: x.indexOf || function (a, b) { for (var c = b || 0, d = this.length; c < d; c++) if (this[c] === a) return c; return -1 }, iterator: function (a, b, c, d) {
+ var e = [], f, h, g, j, n, l = this.context,
+ m, q, p = this.selector; "string" === typeof a && (d = c, c = b, b = a, a = !1); h = 0; for (g = l.length; h < g; h++) { var o = new t(l[h]); if ("table" === b) f = c.call(o, l[h], h), f !== k && e.push(f); else if ("columns" === b || "rows" === b) f = c.call(o, l[h], this[h], h), f !== k && e.push(f); else if ("column" === b || "column-rows" === b || "row" === b || "cell" === b) { q = this[h]; "column-rows" === b && (m = Da(l[h], p.opts)); j = 0; for (n = q.length; j < n; j++) f = q[j], f = "cell" === b ? c.call(o, l[h], f.row, f.column, h, j) : c.call(o, l[h], f, h, j, m), f !== k && e.push(f) } } return e.length || d ? (a = new t(l, a ?
+ e.concat.apply([], e) : e), b = a.selector, b.rows = p.rows, b.cols = p.cols, b.opts = p.opts, a) : this
+ }, lastIndexOf: x.lastIndexOf || function (a, b) { return this.indexOf.apply(this.toArray.reverse(), arguments) }, length: 0, map: function (a) { var b = []; if (x.map) b = x.map.call(this, a, this); else for (var c = 0, d = this.length; c < d; c++) b.push(a.call(this, this[c], c)); return new t(this.context, b) }, pluck: function (a) { return this.map(function (b) { return b[a] }) }, pop: x.pop, push: x.push, reduce: x.reduce || function (a, b) {
+ return hb(this, a, b, 0, this.length,
+ 1)
+ }, reduceRight: x.reduceRight || function (a, b) { return hb(this, a, b, this.length - 1, -1, -1) }, reverse: x.reverse, selector: null, shift: x.shift, sort: x.sort, splice: x.splice, toArray: function () { return x.slice.call(this) }, to$: function () { return g(this) }, toJQuery: function () { return g(this) }, unique: function () { return new t(this.context, Oa(this)) }, unshift: x.unshift
+ }; t.extend = function (a, b, c) {
+ if (c.length && b && (b instanceof t || b.__dt_wrapper)) {
+ var d, e, f, h = function (a, b, c) {
+ return function () {
+ var d = b.apply(a, arguments); t.extend(d,
+ d, c.methodExt); return d
+ }
+ }; d = 0; for (e = c.length; d < e; d++) f = c[d], b[f.name] = "function" === typeof f.val ? h(a, f.val, f) : g.isPlainObject(f.val) ? {} : f.val, b[f.name].__dt_wrapper = !0, t.extend(a, b[f.name], f.propExt)
+ }
+ }; t.register = p = function (a, b) {
+ if (g.isArray(a)) for (var c = 0, d = a.length; c < d; c++) t.register(a[c], b); else for (var e = a.split("."), f = Ub, h, i, c = 0, d = e.length; c < d; c++) {
+ h = (i = -1 !== e[c].indexOf("()")) ? e[c].replace("()", "") : e[c]; var j; a: { j = 0; for (var n = f.length; j < n; j++) if (f[j].name === h) { j = f[j]; break a } j = null } j || (j = {
+ name: h,
+ val: {}, methodExt: [], propExt: []
+ }, f.push(j)); c === d - 1 ? j.val = b : f = i ? j.methodExt : j.propExt
+ }
+ }; t.registerPlural = s = function (a, b, c) { t.register(a, c); t.register(b, function () { var a = c.apply(this, arguments); return a === this ? this : a instanceof t ? a.length ? g.isArray(a[0]) ? new t(a.context, a[0]) : a[0] : k : a }) }; p("tables()", function (a) {
+ var b; if (a) {
+ b = t; var c = this.context; if ("number" === typeof a) a = [c[a]]; else var d = g.map(c, function (a) { return a.nTable }), a = g(d).filter(a).map(function () { var a = g.inArray(this, d); return c[a] }).toArray();
+ b = new b(a)
+ } else b = this; return b
+ }); p("table()", function (a) { var a = this.tables(a), b = a.context; return b.length ? new t(b[0]) : a }); s("tables().nodes()", "table().node()", function () { return this.iterator("table", function (a) { return a.nTable }, 1) }); s("tables().body()", "table().body()", function () { return this.iterator("table", function (a) { return a.nTBody }, 1) }); s("tables().header()", "table().header()", function () { return this.iterator("table", function (a) { return a.nTHead }, 1) }); s("tables().footer()", "table().footer()",
+ function () { return this.iterator("table", function (a) { return a.nTFoot }, 1) }); s("tables().containers()", "table().container()", function () { return this.iterator("table", function (a) { return a.nTableWrapper }, 1) }); p("draw()", function (a) { return this.iterator("table", function (b) { "page" === a ? M(b) : ("string" === typeof a && (a = "full-hold" === a ? !1 : !0), R(b, !1 === a)) }) }); p("page()", function (a) { return a === k ? this.page.info().page : this.iterator("table", function (b) { Ua(b, a) }) }); p("page.info()", function () {
+ if (0 === this.context.length) return k;
+ var a = this.context[0], b = a._iDisplayStart, c = a._iDisplayLength, d = a.fnRecordsDisplay(), e = -1 === c; return { page: e ? 0 : Math.floor(b / c), pages: e ? 1 : Math.ceil(d / c), start: b, end: a.fnDisplayEnd(), length: c, recordsTotal: a.fnRecordsTotal(), recordsDisplay: d, serverSide: "ssp" === z(a) }
+ }); p("page.len()", function (a) { return a === k ? 0 !== this.context.length ? this.context[0]._iDisplayLength : k : this.iterator("table", function (b) { Sa(b, a) }) }); var Vb = function (a, b, c) {
+ if (c) { var d = new t(a); d.one("draw", function () { c(d.ajax.json()) }) } if ("ssp" ==
+ z(a)) R(a, b); else { C(a, !0); var e = a.jqXHR; e && 4 !== e.readyState && e.abort(); ra(a, [], function (c) { oa(a); for (var c = sa(a, c), d = 0, e = c.length; d < e; d++) L(a, c[d]); R(a, b); C(a, !1) }) }
+ }; p("ajax.json()", function () { var a = this.context; if (0 < a.length) return a[0].json }); p("ajax.params()", function () { var a = this.context; if (0 < a.length) return a[0].oAjaxData }); p("ajax.reload()", function (a, b) { return this.iterator("table", function (c) { Vb(c, !1 === b, a) }) }); p("ajax.url()", function (a) {
+ var b = this.context; if (a === k) {
+ if (0 === b.length) return k;
+ b = b[0]; return b.ajax ? g.isPlainObject(b.ajax) ? b.ajax.url : b.ajax : b.sAjaxSource
+ } return this.iterator("table", function (b) { g.isPlainObject(b.ajax) ? b.ajax.url = a : b.ajax = a })
+ }); p("ajax.url().load()", function (a, b) { return this.iterator("table", function (c) { Vb(c, !1 === b, a) }) }); var $a = function (a, b, c, d, e) {
+ var f = [], h, i, j, n, l, m; j = typeof b; if (!b || "string" === j || "function" === j || b.length === k) b = [b]; j = 0; for (n = b.length; j < n; j++) {
+ i = b[j] && b[j].split ? b[j].split(",") : [b[j]]; l = 0; for (m = i.length; l < m; l++) (h = c("string" === typeof i[l] ?
+ g.trim(i[l]) : i[l])) && h.length && f.push.apply(f, h)
+ } a = v.selector[a]; if (a.length) { j = 0; for (n = a.length; j < n; j++) f = a[j](d, e, f) } return f
+ }, ab = function (a) { a || (a = {}); a.filter && a.search === k && (a.search = a.filter); return g.extend({ search: "none", order: "current", page: "all" }, a) }, bb = function (a) { for (var b = 0, c = a.length; b < c; b++) if (0 < a[b].length) return a[0] = a[b], a[0].length = 1, a.length = 1, a.context = [a.context[b]], a; a.length = 0; return a }, Da = function (a, b) {
+ var c, d, e, f = [], h = a.aiDisplay; c = a.aiDisplayMaster; var i = b.search; d = b.order;
+ e = b.page; if ("ssp" == z(a)) return "removed" === i ? [] : W(0, c.length); if ("current" == e) { c = a._iDisplayStart; for (d = a.fnDisplayEnd() ; c < d; c++) f.push(h[c]) } else if ("current" == d || "applied" == d) f = "none" == i ? c.slice() : "applied" == i ? h.slice() : g.map(c, function (a) { return -1 === g.inArray(a, h) ? a : null }); else if ("index" == d || "original" == d) { c = 0; for (d = a.aoData.length; c < d; c++) "none" == i ? f.push(c) : (e = g.inArray(c, h), (-1 === e && "removed" == i || 0 <= e && "applied" == i) && f.push(c)) } return f
+ }; p("rows()", function (a, b) {
+ a === k ? a = "" : g.isPlainObject(a) &&
+ (b = a, a = ""); var b = ab(b), c = this.iterator("table", function (c) {
+ var e = b; return $a("row", a, function (a) { var b = Qb(a); if (b !== null && !e) return [b]; var i = Da(c, e); if (b !== null && g.inArray(b, i) !== -1) return [b]; if (!a) return i; if (typeof a === "function") return g.map(i, function (b) { var e = c.aoData[b]; return a(b, e._aData, e.nTr) ? b : null }); b = Tb(ia(c.aoData, i, "nTr")); if (a.nodeName && g.inArray(a, b) !== -1) return [a._DT_RowIndex]; if (typeof a === "string" && a.charAt(0) === "#") { i = c.aIds[a.replace(/^#/, "")]; if (i !== k) return [i.idx] } return g(b).filter(a).map(function () { return this._DT_RowIndex }).toArray() },
+ c, e)
+ }, 1); c.selector.rows = a; c.selector.opts = b; return c
+ }); p("rows().nodes()", function () { return this.iterator("row", function (a, b) { return a.aoData[b].nTr || k }, 1) }); p("rows().data()", function () { return this.iterator(!0, "rows", function (a, b) { return ia(a.aoData, b, "_aData") }, 1) }); s("rows().cache()", "row().cache()", function (a) { return this.iterator("row", function (b, c) { var d = b.aoData[c]; return "search" === a ? d._aFilterData : d._aSortData }, 1) }); s("rows().invalidate()", "row().invalidate()", function (a) {
+ return this.iterator("row",
+ function (b, c) { da(b, c, a) })
+ }); s("rows().indexes()", "row().index()", function () { return this.iterator("row", function (a, b) { return b }, 1) }); s("rows().ids()", "row().id()", function (a) { for (var b = [], c = this.context, d = 0, e = c.length; d < e; d++) for (var f = 0, g = this[d].length; f < g; f++) { var i = c[d].rowIdFn(c[d].aoData[this[d][f]]._aData); b.push((!0 === a ? "#" : "") + i) } return new t(c, b) }); s("rows().remove()", "row().remove()", function () {
+ var a = this; this.iterator("row", function (b, c, d) {
+ var e = b.aoData; e.splice(c, 1); for (var f = 0, g = e.length; f <
+ g; f++) null !== e[f].nTr && (e[f].nTr._DT_RowIndex = f); pa(b.aiDisplayMaster, c); pa(b.aiDisplay, c); pa(a[d], c, !1); Ta(b)
+ }); this.iterator("table", function (a) { for (var c = 0, d = a.aoData.length; c < d; c++) a.aoData[c].idx = c }); return this
+ }); p("rows.add()", function (a) { var b = this.iterator("table", function (b) { var c, f, g, i = []; f = 0; for (g = a.length; f < g; f++) c = a[f], c.nodeName && "TR" === c.nodeName.toUpperCase() ? i.push(ma(b, c)[0]) : i.push(L(b, c)); return i }, 1), c = this.rows(-1); c.pop(); c.push.apply(c, b.toArray()); return c }); p("row()", function (a,
+ b) { return bb(this.rows(a, b)) }); p("row().data()", function (a) { var b = this.context; if (a === k) return b.length && this.length ? b[0].aoData[this[0]]._aData : k; b[0].aoData[this[0]]._aData = a; da(b[0], this[0], "data"); return this }); p("row().node()", function () { var a = this.context; return a.length && this.length ? a[0].aoData[this[0]].nTr || null : null }); p("row.add()", function (a) {
+ a instanceof g && a.length && (a = a[0]); var b = this.iterator("table", function (b) { return a.nodeName && "TR" === a.nodeName.toUpperCase() ? ma(b, a)[0] : L(b, a) });
+ return this.row(b[0])
+ }); var cb = function (a, b) { var c = a.context; if (c.length && (c = c[0].aoData[b !== k ? b : a[0]]) && c._details) c._details.remove(), c._detailsShow = k, c._details = k }, Wb = function (a, b) {
+ var c = a.context; if (c.length && a.length) {
+ var d = c[0].aoData[a[0]]; if (d._details) {
+ (d._detailsShow = b) ? d._details.insertAfter(d.nTr) : d._details.detach(); var e = c[0], f = new t(e), g = e.aoData; f.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details"); 0 < D(g, "_details").length && (f.on("draw.dt.DT_details", function (a,
+ b) { e === b && f.rows({ page: "current" }).eq(0).each(function (a) { a = g[a]; a._detailsShow && a._details.insertAfter(a.nTr) }) }), f.on("column-visibility.dt.DT_details", function (a, b) { if (e === b) for (var c, d = ba(b), f = 0, k = g.length; f < k; f++) c = g[f], c._details && c._details.children("td[colspan]").attr("colspan", d) }), f.on("destroy.dt.DT_details", function (a, b) { if (e === b) for (var c = 0, d = g.length; c < d; c++) g[c]._details && cb(f, c) }))
+ }
+ }
+ }; p("row().child()", function (a, b) {
+ var c = this.context; if (a === k) return c.length && this.length ? c[0].aoData[this[0]]._details :
+ k; if (!0 === a) this.child.show(); else if (!1 === a) cb(this); else if (c.length && this.length) { var d = c[0], c = c[0].aoData[this[0]], e = [], f = function (a, b) { if (g.isArray(a) || a instanceof g) for (var c = 0, k = a.length; c < k; c++) f(a[c], b); else a.nodeName && "tr" === a.nodeName.toLowerCase() ? e.push(a) : (c = g("
"] }, sa = da(y), ta = sa.appendChild(y.createElement("div")); ra.optgroup = ra.option, ra.tbody = ra.tfoot = ra.colgroup = ra.caption = ra.thead, ra.th = ra.td; function ua(a, b) { var c, d, e = 0, f = typeof a.getElementsByTagName !== K ? a.getElementsByTagName(b || "*") : typeof a.querySelectorAll !== K ? a.querySelectorAll(b || "*") : void 0; if (!f) for (f = [], c = a.childNodes || a; null != (d = c[e]) ; e++) !b || m.nodeName(d, b) ? f.push(d) : m.merge(f, ua(d, b)); return void 0 === b || b && m.nodeName(a, b) ? m.merge([a], f) : f } function va(a) { W.test(a.type) && (a.defaultChecked = a.checked) } function wa(a, b) { return m.nodeName(a, "table") && m.nodeName(11 !== b.nodeType ? b : b.firstChild, "tr") ? a.getElementsByTagName("tbody")[0] || a.appendChild(a.ownerDocument.createElement("tbody")) : a } function xa(a) { return a.type = (null !== m.find.attr(a, "type")) + "/" + a.type, a } function ya(a) { var b = pa.exec(a.type); return b ? a.type = b[1] : a.removeAttribute("type"), a } function za(a, b) { for (var c, d = 0; null != (c = a[d]) ; d++) m._data(c, "globalEval", !b || m._data(b[d], "globalEval")) } function Aa(a, b) { if (1 === b.nodeType && m.hasData(a)) { var c, d, e, f = m._data(a), g = m._data(b, f), h = f.events; if (h) { delete g.handle, g.events = {}; for (c in h) for (d = 0, e = h[c].length; e > d; d++) m.event.add(b, c, h[c][d]) } g.data && (g.data = m.extend({}, g.data)) } } function Ba(a, b) { var c, d, e; if (1 === b.nodeType) { if (c = b.nodeName.toLowerCase(), !k.noCloneEvent && b[m.expando]) { e = m._data(b); for (d in e.events) m.removeEvent(b, d, e.handle); b.removeAttribute(m.expando) } "script" === c && b.text !== a.text ? (xa(b).text = a.text, ya(b)) : "object" === c ? (b.parentNode && (b.outerHTML = a.outerHTML), k.html5Clone && a.innerHTML && !m.trim(b.innerHTML) && (b.innerHTML = a.innerHTML)) : "input" === c && W.test(a.type) ? (b.defaultChecked = b.checked = a.checked, b.value !== a.value && (b.value = a.value)) : "option" === c ? b.defaultSelected = b.selected = a.defaultSelected : ("input" === c || "textarea" === c) && (b.defaultValue = a.defaultValue) } } m.extend({ clone: function (a, b, c) { var d, e, f, g, h, i = m.contains(a.ownerDocument, a); if (k.html5Clone || m.isXMLDoc(a) || !ga.test("<" + a.nodeName + ">") ? f = a.cloneNode(!0) : (ta.innerHTML = a.outerHTML, ta.removeChild(f = ta.firstChild)), !(k.noCloneEvent && k.noCloneChecked || 1 !== a.nodeType && 11 !== a.nodeType || m.isXMLDoc(a))) for (d = ua(f), h = ua(a), g = 0; null != (e = h[g]) ; ++g) d[g] && Ba(e, d[g]); if (b) if (c) for (h = h || ua(a), d = d || ua(f), g = 0; null != (e = h[g]) ; g++) Aa(e, d[g]); else Aa(a, f); return d = ua(f, "script"), d.length > 0 && za(d, !i && ua(a, "script")), d = h = e = null, f }, buildFragment: function (a, b, c, d) { for (var e, f, g, h, i, j, l, n = a.length, o = da(b), p = [], q = 0; n > q; q++) if (f = a[q], f || 0 === f) if ("object" === m.type(f)) m.merge(p, f.nodeType ? [f] : f); else if (la.test(f)) { h = h || o.appendChild(b.createElement("div")), i = (ja.exec(f) || ["", ""])[1].toLowerCase(), l = ra[i] || ra._default, h.innerHTML = l[1] + f.replace(ia, "<$1>$2>") + l[2], e = l[0]; while (e--) h = h.lastChild; if (!k.leadingWhitespace && ha.test(f) && p.push(b.createTextNode(ha.exec(f)[0])), !k.tbody) { f = "table" !== i || ka.test(f) ? "
" !== l[1] || ka.test(f) ? 0 : h : h.firstChild, e = f && f.childNodes.length; while (e--) m.nodeName(j = f.childNodes[e], "tbody") && !j.childNodes.length && f.removeChild(j) } m.merge(p, h.childNodes), h.textContent = ""; while (h.firstChild) h.removeChild(h.firstChild); h = o.lastChild } else p.push(b.createTextNode(f)); h && o.removeChild(h), k.appendChecked || m.grep(ua(p, "input"), va), q = 0; while (f = p[q++]) if ((!d || -1 === m.inArray(f, d)) && (g = m.contains(f.ownerDocument, f), h = ua(o.appendChild(f), "script"), g && za(h), c)) { e = 0; while (f = h[e++]) oa.test(f.type || "") && c.push(f) } return h = null, o }, cleanData: function (a, b) { for (var d, e, f, g, h = 0, i = m.expando, j = m.cache, l = k.deleteExpando, n = m.event.special; null != (d = a[h]) ; h++) if ((b || m.acceptData(d)) && (f = d[i], g = f && j[f])) { if (g.events) for (e in g.events) n[e] ? m.event.remove(d, e) : m.removeEvent(d, e, g.handle); j[f] && (delete j[f], l ? delete d[i] : typeof d.removeAttribute !== K ? d.removeAttribute(i) : d[i] = null, c.push(f)) } } }), m.fn.extend({ text: function (a) { return V(this, function (a) { return void 0 === a ? m.text(this) : this.empty().append((this[0] && this[0].ownerDocument || y).createTextNode(a)) }, null, a, arguments.length) }, append: function () { return this.domManip(arguments, function (a) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var b = wa(this, a); b.appendChild(a) } }) }, prepend: function () { return this.domManip(arguments, function (a) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var b = wa(this, a); b.insertBefore(a, b.firstChild) } }) }, before: function () { return this.domManip(arguments, function (a) { this.parentNode && this.parentNode.insertBefore(a, this) }) }, after: function () { return this.domManip(arguments, function (a) { this.parentNode && this.parentNode.insertBefore(a, this.nextSibling) }) }, remove: function (a, b) { for (var c, d = a ? m.filter(a, this) : this, e = 0; null != (c = d[e]) ; e++) b || 1 !== c.nodeType || m.cleanData(ua(c)), c.parentNode && (b && m.contains(c.ownerDocument, c) && za(ua(c, "script")), c.parentNode.removeChild(c)); return this }, empty: function () { for (var a, b = 0; null != (a = this[b]) ; b++) { 1 === a.nodeType && m.cleanData(ua(a, !1)); while (a.firstChild) a.removeChild(a.firstChild); a.options && m.nodeName(a, "select") && (a.options.length = 0) } return this }, clone: function (a, b) { return a = null == a ? !1 : a, b = null == b ? a : b, this.map(function () { return m.clone(this, a, b) }) }, html: function (a) { return V(this, function (a) { var b = this[0] || {}, c = 0, d = this.length; if (void 0 === a) return 1 === b.nodeType ? b.innerHTML.replace(fa, "") : void 0; if (!("string" != typeof a || ma.test(a) || !k.htmlSerialize && ga.test(a) || !k.leadingWhitespace && ha.test(a) || ra[(ja.exec(a) || ["", ""])[1].toLowerCase()])) { a = a.replace(ia, "<$1>$2>"); try { for (; d > c; c++) b = this[c] || {}, 1 === b.nodeType && (m.cleanData(ua(b, !1)), b.innerHTML = a); b = 0 } catch (e) { } } b && this.empty().append(a) }, null, a, arguments.length) }, replaceWith: function () { var a = arguments[0]; return this.domManip(arguments, function (b) { a = this.parentNode, m.cleanData(ua(this)), a && a.replaceChild(b, this) }), a && (a.length || a.nodeType) ? this : this.remove() }, detach: function (a) { return this.remove(a, !0) }, domManip: function (a, b) { a = e.apply([], a); var c, d, f, g, h, i, j = 0, l = this.length, n = this, o = l - 1, p = a[0], q = m.isFunction(p); if (q || l > 1 && "string" == typeof p && !k.checkClone && na.test(p)) return this.each(function (c) { var d = n.eq(c); q && (a[0] = p.call(this, c, d.html())), d.domManip(a, b) }); if (l && (i = m.buildFragment(a, this[0].ownerDocument, !1, this), c = i.firstChild, 1 === i.childNodes.length && (i = c), c)) { for (g = m.map(ua(i, "script"), xa), f = g.length; l > j; j++) d = i, j !== o && (d = m.clone(d, !0, !0), f && m.merge(g, ua(d, "script"))), b.call(this[j], d, j); if (f) for (h = g[g.length - 1].ownerDocument, m.map(g, ya), j = 0; f > j; j++) d = g[j], oa.test(d.type || "") && !m._data(d, "globalEval") && m.contains(h, d) && (d.src ? m._evalUrl && m._evalUrl(d.src) : m.globalEval((d.text || d.textContent || d.innerHTML || "").replace(qa, ""))); i = c = null } return this } }), m.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (a, b) { m.fn[a] = function (a) { for (var c, d = 0, e = [], g = m(a), h = g.length - 1; h >= d; d++) c = d === h ? this : this.clone(!0), m(g[d])[b](c), f.apply(e, c.get()); return this.pushStack(e) } }); var Ca, Da = {}; function Ea(b, c) { var d, e = m(c.createElement(b)).appendTo(c.body), f = a.getDefaultComputedStyle && (d = a.getDefaultComputedStyle(e[0])) ? d.display : m.css(e[0], "display"); return e.detach(), f } function Fa(a) { var b = y, c = Da[a]; return c || (c = Ea(a, b), "none" !== c && c || (Ca = (Ca || m("")).appendTo(b.documentElement), b = (Ca[0].contentWindow || Ca[0].contentDocument).document, b.write(), b.close(), c = Ea(a, b), Ca.detach()), Da[a] = c), c } !function () { var a; k.shrinkWrapBlocks = function () { if (null != a) return a; a = !1; var b, c, d; return c = y.getElementsByTagName("body")[0], c && c.style ? (b = y.createElement("div"), d = y.createElement("div"), d.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", c.appendChild(d).appendChild(b), typeof b.style.zoom !== K && (b.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1", b.appendChild(y.createElement("div")).style.width = "5px", a = 3 !== b.offsetWidth), c.removeChild(d), a) : void 0 } }(); var Ga = /^margin/, Ha = new RegExp("^(" + S + ")(?!px)[a-z%]+$", "i"), Ia, Ja, Ka = /^(top|right|bottom|left)$/; a.getComputedStyle ? (Ia = function (b) { return b.ownerDocument.defaultView.opener ? b.ownerDocument.defaultView.getComputedStyle(b, null) : a.getComputedStyle(b, null) }, Ja = function (a, b, c) { var d, e, f, g, h = a.style; return c = c || Ia(a), g = c ? c.getPropertyValue(b) || c[b] : void 0, c && ("" !== g || m.contains(a.ownerDocument, a) || (g = m.style(a, b)), Ha.test(g) && Ga.test(b) && (d = h.width, e = h.minWidth, f = h.maxWidth, h.minWidth = h.maxWidth = h.width = g, g = c.width, h.width = d, h.minWidth = e, h.maxWidth = f)), void 0 === g ? g : g + "" }) : y.documentElement.currentStyle && (Ia = function (a) { return a.currentStyle }, Ja = function (a, b, c) { var d, e, f, g, h = a.style; return c = c || Ia(a), g = c ? c[b] : void 0, null == g && h && h[b] && (g = h[b]), Ha.test(g) && !Ka.test(b) && (d = h.left, e = a.runtimeStyle, f = e && e.left, f && (e.left = a.currentStyle.left), h.left = "fontSize" === b ? "1em" : g, g = h.pixelLeft + "px", h.left = d, f && (e.left = f)), void 0 === g ? g : g + "" || "auto" }); function La(a, b) { return { get: function () { var c = a(); if (null != c) return c ? void delete this.get : (this.get = b).apply(this, arguments) } } } !function () { var b, c, d, e, f, g, h; if (b = y.createElement("div"), b.innerHTML = "
a", d = b.getElementsByTagName("a")[0], c = d && d.style) { c.cssText = "float:left;opacity:.5", k.opacity = "0.5" === c.opacity, k.cssFloat = !!c.cssFloat, b.style.backgroundClip = "content-box", b.cloneNode(!0).style.backgroundClip = "", k.clearCloneStyle = "content-box" === b.style.backgroundClip, k.boxSizing = "" === c.boxSizing || "" === c.MozBoxSizing || "" === c.WebkitBoxSizing, m.extend(k, { reliableHiddenOffsets: function () { return null == g && i(), g }, boxSizingReliable: function () { return null == f && i(), f }, pixelPosition: function () { return null == e && i(), e }, reliableMarginRight: function () { return null == h && i(), h } }); function i() { var b, c, d, i; c = y.getElementsByTagName("body")[0], c && c.style && (b = y.createElement("div"), d = y.createElement("div"), d.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", c.appendChild(d).appendChild(b), b.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute", e = f = !1, h = !0, a.getComputedStyle && (e = "1%" !== (a.getComputedStyle(b, null) || {}).top, f = "4px" === (a.getComputedStyle(b, null) || { width: "4px" }).width, i = b.appendChild(y.createElement("div")), i.style.cssText = b.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0", i.style.marginRight = i.style.width = "0", b.style.width = "1px", h = !parseFloat((a.getComputedStyle(i, null) || {}).marginRight), b.removeChild(i)), b.innerHTML = "
t
", i = b.getElementsByTagName("td"), i[0].style.cssText = "margin:0;border:0;padding:0;display:none", g = 0 === i[0].offsetHeight, g && (i[0].style.display = "", i[1].style.display = "none", g = 0 === i[0].offsetHeight), c.removeChild(d)) } } }(), m.swap = function (a, b, c, d) { var e, f, g = {}; for (f in b) g[f] = a.style[f], a.style[f] = b[f]; e = c.apply(a, d || []); for (f in b) a.style[f] = g[f]; return e }; var Ma = /alpha\([^)]*\)/i, Na = /opacity\s*=\s*([^)]*)/, Oa = /^(none|table(?!-c[ea]).+)/, Pa = new RegExp("^(" + S + ")(.*)$", "i"), Qa = new RegExp("^([+-])=(" + S + ")", "i"), Ra = { position: "absolute", visibility: "hidden", display: "block" }, Sa = { letterSpacing: "0", fontWeight: "400" }, Ta = ["Webkit", "O", "Moz", "ms"]; function Ua(a, b) { if (b in a) return b; var c = b.charAt(0).toUpperCase() + b.slice(1), d = b, e = Ta.length; while (e--) if (b = Ta[e] + c, b in a) return b; return d } function Va(a, b) { for (var c, d, e, f = [], g = 0, h = a.length; h > g; g++) d = a[g], d.style && (f[g] = m._data(d, "olddisplay"), c = d.style.display, b ? (f[g] || "none" !== c || (d.style.display = ""), "" === d.style.display && U(d) && (f[g] = m._data(d, "olddisplay", Fa(d.nodeName)))) : (e = U(d), (c && "none" !== c || !e) && m._data(d, "olddisplay", e ? c : m.css(d, "display")))); for (g = 0; h > g; g++) d = a[g], d.style && (b && "none" !== d.style.display && "" !== d.style.display || (d.style.display = b ? f[g] || "" : "none")); return a } function Wa(a, b, c) { var d = Pa.exec(b); return d ? Math.max(0, d[1] - (c || 0)) + (d[2] || "px") : b } function Xa(a, b, c, d, e) { for (var f = c === (d ? "border" : "content") ? 4 : "width" === b ? 1 : 0, g = 0; 4 > f; f += 2) "margin" === c && (g += m.css(a, c + T[f], !0, e)), d ? ("content" === c && (g -= m.css(a, "padding" + T[f], !0, e)), "margin" !== c && (g -= m.css(a, "border" + T[f] + "Width", !0, e))) : (g += m.css(a, "padding" + T[f], !0, e), "padding" !== c && (g += m.css(a, "border" + T[f] + "Width", !0, e))); return g } function Ya(a, b, c) { var d = !0, e = "width" === b ? a.offsetWidth : a.offsetHeight, f = Ia(a), g = k.boxSizing && "border-box" === m.css(a, "boxSizing", !1, f); if (0 >= e || null == e) { if (e = Ja(a, b, f), (0 > e || null == e) && (e = a.style[b]), Ha.test(e)) return e; d = g && (k.boxSizingReliable() || e === a.style[b]), e = parseFloat(e) || 0 } return e + Xa(a, b, c || (g ? "border" : "content"), d, f) + "px" } m.extend({ cssHooks: { opacity: { get: function (a, b) { if (b) { var c = Ja(a, "opacity"); return "" === c ? "1" : c } } } }, cssNumber: { columnCount: !0, fillOpacity: !0, flexGrow: !0, flexShrink: !0, fontWeight: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: { "float": k.cssFloat ? "cssFloat" : "styleFloat" }, style: function (a, b, c, d) { if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) { var e, f, g, h = m.camelCase(b), i = a.style; if (b = m.cssProps[h] || (m.cssProps[h] = Ua(i, h)), g = m.cssHooks[b] || m.cssHooks[h], void 0 === c) return g && "get" in g && void 0 !== (e = g.get(a, !1, d)) ? e : i[b]; if (f = typeof c, "string" === f && (e = Qa.exec(c)) && (c = (e[1] + 1) * e[2] + parseFloat(m.css(a, b)), f = "number"), null != c && c === c && ("number" !== f || m.cssNumber[h] || (c += "px"), k.clearCloneStyle || "" !== c || 0 !== b.indexOf("background") || (i[b] = "inherit"), !(g && "set" in g && void 0 === (c = g.set(a, c, d))))) try { i[b] = c } catch (j) { } } }, css: function (a, b, c, d) { var e, f, g, h = m.camelCase(b); return b = m.cssProps[h] || (m.cssProps[h] = Ua(a.style, h)), g = m.cssHooks[b] || m.cssHooks[h], g && "get" in g && (f = g.get(a, !0, c)), void 0 === f && (f = Ja(a, b, d)), "normal" === f && b in Sa && (f = Sa[b]), "" === c || c ? (e = parseFloat(f), c === !0 || m.isNumeric(e) ? e || 0 : f) : f } }), m.each(["height", "width"], function (a, b) { m.cssHooks[b] = { get: function (a, c, d) { return c ? Oa.test(m.css(a, "display")) && 0 === a.offsetWidth ? m.swap(a, Ra, function () { return Ya(a, b, d) }) : Ya(a, b, d) : void 0 }, set: function (a, c, d) { var e = d && Ia(a); return Wa(a, c, d ? Xa(a, b, d, k.boxSizing && "border-box" === m.css(a, "boxSizing", !1, e), e) : 0) } } }), k.opacity || (m.cssHooks.opacity = { get: function (a, b) { return Na.test((b && a.currentStyle ? a.currentStyle.filter : a.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : b ? "1" : "" }, set: function (a, b) { var c = a.style, d = a.currentStyle, e = m.isNumeric(b) ? "alpha(opacity=" + 100 * b + ")" : "", f = d && d.filter || c.filter || ""; c.zoom = 1, (b >= 1 || "" === b) && "" === m.trim(f.replace(Ma, "")) && c.removeAttribute && (c.removeAttribute("filter"), "" === b || d && !d.filter) || (c.filter = Ma.test(f) ? f.replace(Ma, e) : f + " " + e) } }), m.cssHooks.marginRight = La(k.reliableMarginRight, function (a, b) { return b ? m.swap(a, { display: "inline-block" }, Ja, [a, "marginRight"]) : void 0 }), m.each({ margin: "", padding: "", border: "Width" }, function (a, b) { m.cssHooks[a + b] = { expand: function (c) { for (var d = 0, e = {}, f = "string" == typeof c ? c.split(" ") : [c]; 4 > d; d++) e[a + T[d] + b] = f[d] || f[d - 2] || f[0]; return e } }, Ga.test(a) || (m.cssHooks[a + b].set = Wa) }), m.fn.extend({ css: function (a, b) { return V(this, function (a, b, c) { var d, e, f = {}, g = 0; if (m.isArray(b)) { for (d = Ia(a), e = b.length; e > g; g++) f[b[g]] = m.css(a, b[g], !1, d); return f } return void 0 !== c ? m.style(a, b, c) : m.css(a, b) }, a, b, arguments.length > 1) }, show: function () { return Va(this, !0) }, hide: function () { return Va(this) }, toggle: function (a) { return "boolean" == typeof a ? a ? this.show() : this.hide() : this.each(function () { U(this) ? m(this).show() : m(this).hide() }) } }); function Za(a, b, c, d, e) {
+ return new Za.prototype.init(a, b, c, d, e)
+ } m.Tween = Za, Za.prototype = { constructor: Za, init: function (a, b, c, d, e, f) { this.elem = a, this.prop = c, this.easing = e || "swing", this.options = b, this.start = this.now = this.cur(), this.end = d, this.unit = f || (m.cssNumber[c] ? "" : "px") }, cur: function () { var a = Za.propHooks[this.prop]; return a && a.get ? a.get(this) : Za.propHooks._default.get(this) }, run: function (a) { var b, c = Za.propHooks[this.prop]; return this.options.duration ? this.pos = b = m.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) : this.pos = b = a, this.now = (this.end - this.start) * b + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), c && c.set ? c.set(this) : Za.propHooks._default.set(this), this } }, Za.prototype.init.prototype = Za.prototype, Za.propHooks = { _default: { get: function (a) { var b; return null == a.elem[a.prop] || a.elem.style && null != a.elem.style[a.prop] ? (b = m.css(a.elem, a.prop, ""), b && "auto" !== b ? b : 0) : a.elem[a.prop] }, set: function (a) { m.fx.step[a.prop] ? m.fx.step[a.prop](a) : a.elem.style && (null != a.elem.style[m.cssProps[a.prop]] || m.cssHooks[a.prop]) ? m.style(a.elem, a.prop, a.now + a.unit) : a.elem[a.prop] = a.now } } }, Za.propHooks.scrollTop = Za.propHooks.scrollLeft = { set: function (a) { a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now) } }, m.easing = { linear: function (a) { return a }, swing: function (a) { return .5 - Math.cos(a * Math.PI) / 2 } }, m.fx = Za.prototype.init, m.fx.step = {}; var $a, _a, ab = /^(?:toggle|show|hide)$/, bb = new RegExp("^(?:([+-])=|)(" + S + ")([a-z%]*)$", "i"), cb = /queueHooks$/, db = [ib], eb = { "*": [function (a, b) { var c = this.createTween(a, b), d = c.cur(), e = bb.exec(b), f = e && e[3] || (m.cssNumber[a] ? "" : "px"), g = (m.cssNumber[a] || "px" !== f && +d) && bb.exec(m.css(c.elem, a)), h = 1, i = 20; if (g && g[3] !== f) { f = f || g[3], e = e || [], g = +d || 1; do h = h || ".5", g /= h, m.style(c.elem, a, g + f); while (h !== (h = c.cur() / d) && 1 !== h && --i) } return e && (g = c.start = +g || +d || 0, c.unit = f, c.end = e[1] ? g + (e[1] + 1) * e[2] : +e[2]), c }] }; function fb() { return setTimeout(function () { $a = void 0 }), $a = m.now() } function gb(a, b) { var c, d = { height: a }, e = 0; for (b = b ? 1 : 0; 4 > e; e += 2 - b) c = T[e], d["margin" + c] = d["padding" + c] = a; return b && (d.opacity = d.width = a), d } function hb(a, b, c) { for (var d, e = (eb[b] || []).concat(eb["*"]), f = 0, g = e.length; g > f; f++) if (d = e[f].call(c, b, a)) return d } function ib(a, b, c) { var d, e, f, g, h, i, j, l, n = this, o = {}, p = a.style, q = a.nodeType && U(a), r = m._data(a, "fxshow"); c.queue || (h = m._queueHooks(a, "fx"), null == h.unqueued && (h.unqueued = 0, i = h.empty.fire, h.empty.fire = function () { h.unqueued || i() }), h.unqueued++, n.always(function () { n.always(function () { h.unqueued--, m.queue(a, "fx").length || h.empty.fire() }) })), 1 === a.nodeType && ("height" in b || "width" in b) && (c.overflow = [p.overflow, p.overflowX, p.overflowY], j = m.css(a, "display"), l = "none" === j ? m._data(a, "olddisplay") || Fa(a.nodeName) : j, "inline" === l && "none" === m.css(a, "float") && (k.inlineBlockNeedsLayout && "inline" !== Fa(a.nodeName) ? p.zoom = 1 : p.display = "inline-block")), c.overflow && (p.overflow = "hidden", k.shrinkWrapBlocks() || n.always(function () { p.overflow = c.overflow[0], p.overflowX = c.overflow[1], p.overflowY = c.overflow[2] })); for (d in b) if (e = b[d], ab.exec(e)) { if (delete b[d], f = f || "toggle" === e, e === (q ? "hide" : "show")) { if ("show" !== e || !r || void 0 === r[d]) continue; q = !0 } o[d] = r && r[d] || m.style(a, d) } else j = void 0; if (m.isEmptyObject(o)) "inline" === ("none" === j ? Fa(a.nodeName) : j) && (p.display = j); else { r ? "hidden" in r && (q = r.hidden) : r = m._data(a, "fxshow", {}), f && (r.hidden = !q), q ? m(a).show() : n.done(function () { m(a).hide() }), n.done(function () { var b; m._removeData(a, "fxshow"); for (b in o) m.style(a, b, o[b]) }); for (d in o) g = hb(q ? r[d] : 0, d, n), d in r || (r[d] = g.start, q && (g.end = g.start, g.start = "width" === d || "height" === d ? 1 : 0)) } } function jb(a, b) { var c, d, e, f, g; for (c in a) if (d = m.camelCase(c), e = b[d], f = a[c], m.isArray(f) && (e = f[1], f = a[c] = f[0]), c !== d && (a[d] = f, delete a[c]), g = m.cssHooks[d], g && "expand" in g) { f = g.expand(f), delete a[d]; for (c in f) c in a || (a[c] = f[c], b[c] = e) } else b[d] = e } function kb(a, b, c) { var d, e, f = 0, g = db.length, h = m.Deferred().always(function () { delete i.elem }), i = function () { if (e) return !1; for (var b = $a || fb(), c = Math.max(0, j.startTime + j.duration - b), d = c / j.duration || 0, f = 1 - d, g = 0, i = j.tweens.length; i > g; g++) j.tweens[g].run(f); return h.notifyWith(a, [j, f, c]), 1 > f && i ? c : (h.resolveWith(a, [j]), !1) }, j = h.promise({ elem: a, props: m.extend({}, b), opts: m.extend(!0, { specialEasing: {} }, c), originalProperties: b, originalOptions: c, startTime: $a || fb(), duration: c.duration, tweens: [], createTween: function (b, c) { var d = m.Tween(a, j.opts, b, c, j.opts.specialEasing[b] || j.opts.easing); return j.tweens.push(d), d }, stop: function (b) { var c = 0, d = b ? j.tweens.length : 0; if (e) return this; for (e = !0; d > c; c++) j.tweens[c].run(1); return b ? h.resolveWith(a, [j, b]) : h.rejectWith(a, [j, b]), this } }), k = j.props; for (jb(k, j.opts.specialEasing) ; g > f; f++) if (d = db[f].call(j, a, k, j.opts)) return d; return m.map(k, hb, j), m.isFunction(j.opts.start) && j.opts.start.call(a, j), m.fx.timer(m.extend(i, { elem: a, anim: j, queue: j.opts.queue })), j.progress(j.opts.progress).done(j.opts.done, j.opts.complete).fail(j.opts.fail).always(j.opts.always) } m.Animation = m.extend(kb, { tweener: function (a, b) { m.isFunction(a) ? (b = a, a = ["*"]) : a = a.split(" "); for (var c, d = 0, e = a.length; e > d; d++) c = a[d], eb[c] = eb[c] || [], eb[c].unshift(b) }, prefilter: function (a, b) { b ? db.unshift(a) : db.push(a) } }), m.speed = function (a, b, c) { var d = a && "object" == typeof a ? m.extend({}, a) : { complete: c || !c && b || m.isFunction(a) && a, duration: a, easing: c && b || b && !m.isFunction(b) && b }; return d.duration = m.fx.off ? 0 : "number" == typeof d.duration ? d.duration : d.duration in m.fx.speeds ? m.fx.speeds[d.duration] : m.fx.speeds._default, (null == d.queue || d.queue === !0) && (d.queue = "fx"), d.old = d.complete, d.complete = function () { m.isFunction(d.old) && d.old.call(this), d.queue && m.dequeue(this, d.queue) }, d }, m.fn.extend({ fadeTo: function (a, b, c, d) { return this.filter(U).css("opacity", 0).show().end().animate({ opacity: b }, a, c, d) }, animate: function (a, b, c, d) { var e = m.isEmptyObject(a), f = m.speed(b, c, d), g = function () { var b = kb(this, m.extend({}, a), f); (e || m._data(this, "finish")) && b.stop(!0) }; return g.finish = g, e || f.queue === !1 ? this.each(g) : this.queue(f.queue, g) }, stop: function (a, b, c) { var d = function (a) { var b = a.stop; delete a.stop, b(c) }; return "string" != typeof a && (c = b, b = a, a = void 0), b && a !== !1 && this.queue(a || "fx", []), this.each(function () { var b = !0, e = null != a && a + "queueHooks", f = m.timers, g = m._data(this); if (e) g[e] && g[e].stop && d(g[e]); else for (e in g) g[e] && g[e].stop && cb.test(e) && d(g[e]); for (e = f.length; e--;) f[e].elem !== this || null != a && f[e].queue !== a || (f[e].anim.stop(c), b = !1, f.splice(e, 1)); (b || !c) && m.dequeue(this, a) }) }, finish: function (a) { return a !== !1 && (a = a || "fx"), this.each(function () { var b, c = m._data(this), d = c[a + "queue"], e = c[a + "queueHooks"], f = m.timers, g = d ? d.length : 0; for (c.finish = !0, m.queue(this, a, []), e && e.stop && e.stop.call(this, !0), b = f.length; b--;) f[b].elem === this && f[b].queue === a && (f[b].anim.stop(!0), f.splice(b, 1)); for (b = 0; g > b; b++) d[b] && d[b].finish && d[b].finish.call(this); delete c.finish }) } }), m.each(["toggle", "show", "hide"], function (a, b) { var c = m.fn[b]; m.fn[b] = function (a, d, e) { return null == a || "boolean" == typeof a ? c.apply(this, arguments) : this.animate(gb(b, !0), a, d, e) } }), m.each({ slideDown: gb("show"), slideUp: gb("hide"), slideToggle: gb("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function (a, b) { m.fn[a] = function (a, c, d) { return this.animate(b, a, c, d) } }), m.timers = [], m.fx.tick = function () { var a, b = m.timers, c = 0; for ($a = m.now() ; c < b.length; c++) a = b[c], a() || b[c] !== a || b.splice(c--, 1); b.length || m.fx.stop(), $a = void 0 }, m.fx.timer = function (a) { m.timers.push(a), a() ? m.fx.start() : m.timers.pop() }, m.fx.interval = 13, m.fx.start = function () { _a || (_a = setInterval(m.fx.tick, m.fx.interval)) }, m.fx.stop = function () { clearInterval(_a), _a = null }, m.fx.speeds = { slow: 600, fast: 200, _default: 400 }, m.fn.delay = function (a, b) { return a = m.fx ? m.fx.speeds[a] || a : a, b = b || "fx", this.queue(b, function (b, c) { var d = setTimeout(b, a); c.stop = function () { clearTimeout(d) } }) }, function () { var a, b, c, d, e; b = y.createElement("div"), b.setAttribute("className", "t"), b.innerHTML = "
a", d = b.getElementsByTagName("a")[0], c = y.createElement("select"), e = c.appendChild(y.createElement("option")), a = b.getElementsByTagName("input")[0], d.style.cssText = "top:1px", k.getSetAttribute = "t" !== b.className, k.style = /top/.test(d.getAttribute("style")), k.hrefNormalized = "/a" === d.getAttribute("href"), k.checkOn = !!a.value, k.optSelected = e.selected, k.enctype = !!y.createElement("form").enctype, c.disabled = !0, k.optDisabled = !e.disabled, a = y.createElement("input"), a.setAttribute("value", ""), k.input = "" === a.getAttribute("value"), a.value = "t", a.setAttribute("type", "radio"), k.radioValue = "t" === a.value }(); var lb = /\r/g; m.fn.extend({ val: function (a) { var b, c, d, e = this[0]; { if (arguments.length) return d = m.isFunction(a), this.each(function (c) { var e; 1 === this.nodeType && (e = d ? a.call(this, c, m(this).val()) : a, null == e ? e = "" : "number" == typeof e ? e += "" : m.isArray(e) && (e = m.map(e, function (a) { return null == a ? "" : a + "" })), b = m.valHooks[this.type] || m.valHooks[this.nodeName.toLowerCase()], b && "set" in b && void 0 !== b.set(this, e, "value") || (this.value = e)) }); if (e) return b = m.valHooks[e.type] || m.valHooks[e.nodeName.toLowerCase()], b && "get" in b && void 0 !== (c = b.get(e, "value")) ? c : (c = e.value, "string" == typeof c ? c.replace(lb, "") : null == c ? "" : c) } } }), m.extend({ valHooks: { option: { get: function (a) { var b = m.find.attr(a, "value"); return null != b ? b : m.trim(m.text(a)) } }, select: { get: function (a) { for (var b, c, d = a.options, e = a.selectedIndex, f = "select-one" === a.type || 0 > e, g = f ? null : [], h = f ? e + 1 : d.length, i = 0 > e ? h : f ? e : 0; h > i; i++) if (c = d[i], !(!c.selected && i !== e || (k.optDisabled ? c.disabled : null !== c.getAttribute("disabled")) || c.parentNode.disabled && m.nodeName(c.parentNode, "optgroup"))) { if (b = m(c).val(), f) return b; g.push(b) } return g }, set: function (a, b) { var c, d, e = a.options, f = m.makeArray(b), g = e.length; while (g--) if (d = e[g], m.inArray(m.valHooks.option.get(d), f) >= 0) try { d.selected = c = !0 } catch (h) { d.scrollHeight } else d.selected = !1; return c || (a.selectedIndex = -1), e } } } }), m.each(["radio", "checkbox"], function () { m.valHooks[this] = { set: function (a, b) { return m.isArray(b) ? a.checked = m.inArray(m(a).val(), b) >= 0 : void 0 } }, k.checkOn || (m.valHooks[this].get = function (a) { return null === a.getAttribute("value") ? "on" : a.value }) }); var mb, nb, ob = m.expr.attrHandle, pb = /^(?:checked|selected)$/i, qb = k.getSetAttribute, rb = k.input; m.fn.extend({ attr: function (a, b) { return V(this, m.attr, a, b, arguments.length > 1) }, removeAttr: function (a) { return this.each(function () { m.removeAttr(this, a) }) } }), m.extend({ attr: function (a, b, c) { var d, e, f = a.nodeType; if (a && 3 !== f && 8 !== f && 2 !== f) return typeof a.getAttribute === K ? m.prop(a, b, c) : (1 === f && m.isXMLDoc(a) || (b = b.toLowerCase(), d = m.attrHooks[b] || (m.expr.match.bool.test(b) ? nb : mb)), void 0 === c ? d && "get" in d && null !== (e = d.get(a, b)) ? e : (e = m.find.attr(a, b), null == e ? void 0 : e) : null !== c ? d && "set" in d && void 0 !== (e = d.set(a, c, b)) ? e : (a.setAttribute(b, c + ""), c) : void m.removeAttr(a, b)) }, removeAttr: function (a, b) { var c, d, e = 0, f = b && b.match(E); if (f && 1 === a.nodeType) while (c = f[e++]) d = m.propFix[c] || c, m.expr.match.bool.test(c) ? rb && qb || !pb.test(c) ? a[d] = !1 : a[m.camelCase("default-" + c)] = a[d] = !1 : m.attr(a, c, ""), a.removeAttribute(qb ? c : d) }, attrHooks: { type: { set: function (a, b) { if (!k.radioValue && "radio" === b && m.nodeName(a, "input")) { var c = a.value; return a.setAttribute("type", b), c && (a.value = c), b } } } } }), nb = { set: function (a, b, c) { return b === !1 ? m.removeAttr(a, c) : rb && qb || !pb.test(c) ? a.setAttribute(!qb && m.propFix[c] || c, c) : a[m.camelCase("default-" + c)] = a[c] = !0, c } }, m.each(m.expr.match.bool.source.match(/\w+/g), function (a, b) { var c = ob[b] || m.find.attr; ob[b] = rb && qb || !pb.test(b) ? function (a, b, d) { var e, f; return d || (f = ob[b], ob[b] = e, e = null != c(a, b, d) ? b.toLowerCase() : null, ob[b] = f), e } : function (a, b, c) { return c ? void 0 : a[m.camelCase("default-" + b)] ? b.toLowerCase() : null } }), rb && qb || (m.attrHooks.value = { set: function (a, b, c) { return m.nodeName(a, "input") ? void (a.defaultValue = b) : mb && mb.set(a, b, c) } }), qb || (mb = { set: function (a, b, c) { var d = a.getAttributeNode(c); return d || a.setAttributeNode(d = a.ownerDocument.createAttribute(c)), d.value = b += "", "value" === c || b === a.getAttribute(c) ? b : void 0 } }, ob.id = ob.name = ob.coords = function (a, b, c) { var d; return c ? void 0 : (d = a.getAttributeNode(b)) && "" !== d.value ? d.value : null }, m.valHooks.button = { get: function (a, b) { var c = a.getAttributeNode(b); return c && c.specified ? c.value : void 0 }, set: mb.set }, m.attrHooks.contenteditable = { set: function (a, b, c) { mb.set(a, "" === b ? !1 : b, c) } }, m.each(["width", "height"], function (a, b) { m.attrHooks[b] = { set: function (a, c) { return "" === c ? (a.setAttribute(b, "auto"), c) : void 0 } } })), k.style || (m.attrHooks.style = { get: function (a) { return a.style.cssText || void 0 }, set: function (a, b) { return a.style.cssText = b + "" } }); var sb = /^(?:input|select|textarea|button|object)$/i, tb = /^(?:a|area)$/i; m.fn.extend({ prop: function (a, b) { return V(this, m.prop, a, b, arguments.length > 1) }, removeProp: function (a) { return a = m.propFix[a] || a, this.each(function () { try { this[a] = void 0, delete this[a] } catch (b) { } }) } }), m.extend({ propFix: { "for": "htmlFor", "class": "className" }, prop: function (a, b, c) { var d, e, f, g = a.nodeType; if (a && 3 !== g && 8 !== g && 2 !== g) return f = 1 !== g || !m.isXMLDoc(a), f && (b = m.propFix[b] || b, e = m.propHooks[b]), void 0 !== c ? e && "set" in e && void 0 !== (d = e.set(a, c, b)) ? d : a[b] = c : e && "get" in e && null !== (d = e.get(a, b)) ? d : a[b] }, propHooks: { tabIndex: { get: function (a) { var b = m.find.attr(a, "tabindex"); return b ? parseInt(b, 10) : sb.test(a.nodeName) || tb.test(a.nodeName) && a.href ? 0 : -1 } } } }), k.hrefNormalized || m.each(["href", "src"], function (a, b) { m.propHooks[b] = { get: function (a) { return a.getAttribute(b, 4) } } }), k.optSelected || (m.propHooks.selected = { get: function (a) { var b = a.parentNode; return b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex), null } }), m.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () { m.propFix[this.toLowerCase()] = this }), k.enctype || (m.propFix.enctype = "encoding"); var ub = /[\t\r\n\f]/g; m.fn.extend({ addClass: function (a) { var b, c, d, e, f, g, h = 0, i = this.length, j = "string" == typeof a && a; if (m.isFunction(a)) return this.each(function (b) { m(this).addClass(a.call(this, b, this.className)) }); if (j) for (b = (a || "").match(E) || []; i > h; h++) if (c = this[h], d = 1 === c.nodeType && (c.className ? (" " + c.className + " ").replace(ub, " ") : " ")) { f = 0; while (e = b[f++]) d.indexOf(" " + e + " ") < 0 && (d += e + " "); g = m.trim(d), c.className !== g && (c.className = g) } return this }, removeClass: function (a) { var b, c, d, e, f, g, h = 0, i = this.length, j = 0 === arguments.length || "string" == typeof a && a; if (m.isFunction(a)) return this.each(function (b) { m(this).removeClass(a.call(this, b, this.className)) }); if (j) for (b = (a || "").match(E) || []; i > h; h++) if (c = this[h], d = 1 === c.nodeType && (c.className ? (" " + c.className + " ").replace(ub, " ") : "")) { f = 0; while (e = b[f++]) while (d.indexOf(" " + e + " ") >= 0) d = d.replace(" " + e + " ", " "); g = a ? m.trim(d) : "", c.className !== g && (c.className = g) } return this }, toggleClass: function (a, b) { var c = typeof a; return "boolean" == typeof b && "string" === c ? b ? this.addClass(a) : this.removeClass(a) : this.each(m.isFunction(a) ? function (c) { m(this).toggleClass(a.call(this, c, this.className, b), b) } : function () { if ("string" === c) { var b, d = 0, e = m(this), f = a.match(E) || []; while (b = f[d++]) e.hasClass(b) ? e.removeClass(b) : e.addClass(b) } else (c === K || "boolean" === c) && (this.className && m._data(this, "__className__", this.className), this.className = this.className || a === !1 ? "" : m._data(this, "__className__") || "") }) }, hasClass: function (a) { for (var b = " " + a + " ", c = 0, d = this.length; d > c; c++) if (1 === this[c].nodeType && (" " + this[c].className + " ").replace(ub, " ").indexOf(b) >= 0) return !0; return !1 } }), m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function (a, b) { m.fn[b] = function (a, c) { return arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b) } }), m.fn.extend({ hover: function (a, b) { return this.mouseenter(a).mouseleave(b || a) }, bind: function (a, b, c) { return this.on(a, null, b, c) }, unbind: function (a, b) { return this.off(a, null, b) }, delegate: function (a, b, c, d) { return this.on(b, a, c, d) }, undelegate: function (a, b, c) { return 1 === arguments.length ? this.off(a, "**") : this.off(b, a || "**", c) } }); var vb = m.now(), wb = /\?/, xb = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; m.parseJSON = function (b) { if (a.JSON && a.JSON.parse) return a.JSON.parse(b + ""); var c, d = null, e = m.trim(b + ""); return e && !m.trim(e.replace(xb, function (a, b, e, f) { return c && b && (d = 0), 0 === d ? a : (c = e || b, d += !f - !e, "") })) ? Function("return " + e)() : m.error("Invalid JSON: " + b) }, m.parseXML = function (b) { var c, d; if (!b || "string" != typeof b) return null; try { a.DOMParser ? (d = new DOMParser, c = d.parseFromString(b, "text/xml")) : (c = new ActiveXObject("Microsoft.XMLDOM"), c.async = "false", c.loadXML(b)) } catch (e) { c = void 0 } return c && c.documentElement && !c.getElementsByTagName("parsererror").length || m.error("Invalid XML: " + b), c }; var yb, zb, Ab = /#.*$/, Bb = /([?&])_=[^&]*/, Cb = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm, Db = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, Eb = /^(?:GET|HEAD)$/, Fb = /^\/\//, Gb = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, Hb = {}, Ib = {}, Jb = "*/".concat("*"); try { zb = location.href } catch (Kb) { zb = y.createElement("a"), zb.href = "", zb = zb.href } yb = Gb.exec(zb.toLowerCase()) || []; function Lb(a) { return function (b, c) { "string" != typeof b && (c = b, b = "*"); var d, e = 0, f = b.toLowerCase().match(E) || []; if (m.isFunction(c)) while (d = f[e++]) "+" === d.charAt(0) ? (d = d.slice(1) || "*", (a[d] = a[d] || []).unshift(c)) : (a[d] = a[d] || []).push(c) } } function Mb(a, b, c, d) { var e = {}, f = a === Ib; function g(h) { var i; return e[h] = !0, m.each(a[h] || [], function (a, h) { var j = h(b, c, d); return "string" != typeof j || f || e[j] ? f ? !(i = j) : void 0 : (b.dataTypes.unshift(j), g(j), !1) }), i } return g(b.dataTypes[0]) || !e["*"] && g("*") } function Nb(a, b) { var c, d, e = m.ajaxSettings.flatOptions || {}; for (d in b) void 0 !== b[d] && ((e[d] ? a : c || (c = {}))[d] = b[d]); return c && m.extend(!0, a, c), a } function Ob(a, b, c) { var d, e, f, g, h = a.contents, i = a.dataTypes; while ("*" === i[0]) i.shift(), void 0 === e && (e = a.mimeType || b.getResponseHeader("Content-Type")); if (e) for (g in h) if (h[g] && h[g].test(e)) { i.unshift(g); break } if (i[0] in c) f = i[0]; else { for (g in c) { if (!i[0] || a.converters[g + " " + i[0]]) { f = g; break } d || (d = g) } f = f || d } return f ? (f !== i[0] && i.unshift(f), c[f]) : void 0 } function Pb(a, b, c, d) { var e, f, g, h, i, j = {}, k = a.dataTypes.slice(); if (k[1]) for (g in a.converters) j[g.toLowerCase()] = a.converters[g]; f = k.shift(); while (f) if (a.responseFields[f] && (c[a.responseFields[f]] = b), !i && d && a.dataFilter && (b = a.dataFilter(b, a.dataType)), i = f, f = k.shift()) if ("*" === f) f = i; else if ("*" !== i && i !== f) { if (g = j[i + " " + f] || j["* " + f], !g) for (e in j) if (h = e.split(" "), h[1] === f && (g = j[i + " " + h[0]] || j["* " + h[0]])) { g === !0 ? g = j[e] : j[e] !== !0 && (f = h[0], k.unshift(h[1])); break } if (g !== !0) if (g && a["throws"]) b = g(b); else try { b = g(b) } catch (l) { return { state: "parsererror", error: g ? l : "No conversion from " + i + " to " + f } } } return { state: "success", data: b } } m.extend({ active: 0, lastModified: {}, etag: {}, ajaxSettings: { url: zb, type: "GET", isLocal: Db.test(yb[1]), global: !0, processData: !0, async: !0, contentType: "application/x-www-form-urlencoded; charset=UTF-8", accepts: { "*": Jb, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, converters: { "* text": String, "text html": !0, "text json": m.parseJSON, "text xml": m.parseXML }, flatOptions: { url: !0, context: !0 } }, ajaxSetup: function (a, b) { return b ? Nb(Nb(a, m.ajaxSettings), b) : Nb(m.ajaxSettings, a) }, ajaxPrefilter: Lb(Hb), ajaxTransport: Lb(Ib), ajax: function (a, b) { "object" == typeof a && (b = a, a = void 0), b = b || {}; var c, d, e, f, g, h, i, j, k = m.ajaxSetup({}, b), l = k.context || k, n = k.context && (l.nodeType || l.jquery) ? m(l) : m.event, o = m.Deferred(), p = m.Callbacks("once memory"), q = k.statusCode || {}, r = {}, s = {}, t = 0, u = "canceled", v = { readyState: 0, getResponseHeader: function (a) { var b; if (2 === t) { if (!j) { j = {}; while (b = Cb.exec(f)) j[b[1].toLowerCase()] = b[2] } b = j[a.toLowerCase()] } return null == b ? null : b }, getAllResponseHeaders: function () { return 2 === t ? f : null }, setRequestHeader: function (a, b) { var c = a.toLowerCase(); return t || (a = s[c] = s[c] || a, r[a] = b), this }, overrideMimeType: function (a) { return t || (k.mimeType = a), this }, statusCode: function (a) { var b; if (a) if (2 > t) for (b in a) q[b] = [q[b], a[b]]; else v.always(a[v.status]); return this }, abort: function (a) { var b = a || u; return i && i.abort(b), x(0, b), this } }; if (o.promise(v).complete = p.add, v.success = v.done, v.error = v.fail, k.url = ((a || k.url || zb) + "").replace(Ab, "").replace(Fb, yb[1] + "//"), k.type = b.method || b.type || k.method || k.type, k.dataTypes = m.trim(k.dataType || "*").toLowerCase().match(E) || [""], null == k.crossDomain && (c = Gb.exec(k.url.toLowerCase()), k.crossDomain = !(!c || c[1] === yb[1] && c[2] === yb[2] && (c[3] || ("http:" === c[1] ? "80" : "443")) === (yb[3] || ("http:" === yb[1] ? "80" : "443")))), k.data && k.processData && "string" != typeof k.data && (k.data = m.param(k.data, k.traditional)), Mb(Hb, k, b, v), 2 === t) return v; h = m.event && k.global, h && 0 === m.active++ && m.event.trigger("ajaxStart"), k.type = k.type.toUpperCase(), k.hasContent = !Eb.test(k.type), e = k.url, k.hasContent || (k.data && (e = k.url += (wb.test(e) ? "&" : "?") + k.data, delete k.data), k.cache === !1 && (k.url = Bb.test(e) ? e.replace(Bb, "$1_=" + vb++) : e + (wb.test(e) ? "&" : "?") + "_=" + vb++)), k.ifModified && (m.lastModified[e] && v.setRequestHeader("If-Modified-Since", m.lastModified[e]), m.etag[e] && v.setRequestHeader("If-None-Match", m.etag[e])), (k.data && k.hasContent && k.contentType !== !1 || b.contentType) && v.setRequestHeader("Content-Type", k.contentType), v.setRequestHeader("Accept", k.dataTypes[0] && k.accepts[k.dataTypes[0]] ? k.accepts[k.dataTypes[0]] + ("*" !== k.dataTypes[0] ? ", " + Jb + "; q=0.01" : "") : k.accepts["*"]); for (d in k.headers) v.setRequestHeader(d, k.headers[d]); if (k.beforeSend && (k.beforeSend.call(l, v, k) === !1 || 2 === t)) return v.abort(); u = "abort"; for (d in { success: 1, error: 1, complete: 1 }) v[d](k[d]); if (i = Mb(Ib, k, b, v)) { v.readyState = 1, h && n.trigger("ajaxSend", [v, k]), k.async && k.timeout > 0 && (g = setTimeout(function () { v.abort("timeout") }, k.timeout)); try { t = 1, i.send(r, x) } catch (w) { if (!(2 > t)) throw w; x(-1, w) } } else x(-1, "No Transport"); function x(a, b, c, d) { var j, r, s, u, w, x = b; 2 !== t && (t = 2, g && clearTimeout(g), i = void 0, f = d || "", v.readyState = a > 0 ? 4 : 0, j = a >= 200 && 300 > a || 304 === a, c && (u = Ob(k, v, c)), u = Pb(k, u, v, j), j ? (k.ifModified && (w = v.getResponseHeader("Last-Modified"), w && (m.lastModified[e] = w), w = v.getResponseHeader("etag"), w && (m.etag[e] = w)), 204 === a || "HEAD" === k.type ? x = "nocontent" : 304 === a ? x = "notmodified" : (x = u.state, r = u.data, s = u.error, j = !s)) : (s = x, (a || !x) && (x = "error", 0 > a && (a = 0))), v.status = a, v.statusText = (b || x) + "", j ? o.resolveWith(l, [r, x, v]) : o.rejectWith(l, [v, x, s]), v.statusCode(q), q = void 0, h && n.trigger(j ? "ajaxSuccess" : "ajaxError", [v, k, j ? r : s]), p.fireWith(l, [v, x]), h && (n.trigger("ajaxComplete", [v, k]), --m.active || m.event.trigger("ajaxStop"))) } return v }, getJSON: function (a, b, c) { return m.get(a, b, c, "json") }, getScript: function (a, b) { return m.get(a, void 0, b, "script") } }), m.each(["get", "post"], function (a, b) { m[b] = function (a, c, d, e) { return m.isFunction(c) && (e = e || d, d = c, c = void 0), m.ajax({ url: a, type: b, dataType: e, data: c, success: d }) } }), m._evalUrl = function (a) { return m.ajax({ url: a, type: "GET", dataType: "script", async: !1, global: !1, "throws": !0 }) }, m.fn.extend({ wrapAll: function (a) { if (m.isFunction(a)) return this.each(function (b) { m(this).wrapAll(a.call(this, b)) }); if (this[0]) { var b = m(a, this[0].ownerDocument).eq(0).clone(!0); this[0].parentNode && b.insertBefore(this[0]), b.map(function () { var a = this; while (a.firstChild && 1 === a.firstChild.nodeType) a = a.firstChild; return a }).append(this) } return this }, wrapInner: function (a) { return this.each(m.isFunction(a) ? function (b) { m(this).wrapInner(a.call(this, b)) } : function () { var b = m(this), c = b.contents(); c.length ? c.wrapAll(a) : b.append(a) }) }, wrap: function (a) { var b = m.isFunction(a); return this.each(function (c) { m(this).wrapAll(b ? a.call(this, c) : a) }) }, unwrap: function () { return this.parent().each(function () { m.nodeName(this, "body") || m(this).replaceWith(this.childNodes) }).end() } }), m.expr.filters.hidden = function (a) { return a.offsetWidth <= 0 && a.offsetHeight <= 0 || !k.reliableHiddenOffsets() && "none" === (a.style && a.style.display || m.css(a, "display")) }, m.expr.filters.visible = function (a) { return !m.expr.filters.hidden(a) }; var Qb = /%20/g, Rb = /\[\]$/, Sb = /\r?\n/g, Tb = /^(?:submit|button|image|reset|file)$/i, Ub = /^(?:input|select|textarea|keygen)/i; function Vb(a, b, c, d) { var e; if (m.isArray(b)) m.each(b, function (b, e) { c || Rb.test(a) ? d(a, e) : Vb(a + "[" + ("object" == typeof e ? b : "") + "]", e, c, d) }); else if (c || "object" !== m.type(b)) d(a, b); else for (e in b) Vb(a + "[" + e + "]", b[e], c, d) } m.param = function (a, b) { var c, d = [], e = function (a, b) { b = m.isFunction(b) ? b() : null == b ? "" : b, d[d.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b) }; if (void 0 === b && (b = m.ajaxSettings && m.ajaxSettings.traditional), m.isArray(a) || a.jquery && !m.isPlainObject(a)) m.each(a, function () { e(this.name, this.value) }); else for (c in a) Vb(c, a[c], b, e); return d.join("&").replace(Qb, "+") }, m.fn.extend({ serialize: function () { return m.param(this.serializeArray()) }, serializeArray: function () { return this.map(function () { var a = m.prop(this, "elements"); return a ? m.makeArray(a) : this }).filter(function () { var a = this.type; return this.name && !m(this).is(":disabled") && Ub.test(this.nodeName) && !Tb.test(a) && (this.checked || !W.test(a)) }).map(function (a, b) { var c = m(this).val(); return null == c ? null : m.isArray(c) ? m.map(c, function (a) { return { name: b.name, value: a.replace(Sb, "\r\n") } }) : { name: b.name, value: c.replace(Sb, "\r\n") } }).get() } }), m.ajaxSettings.xhr = void 0 !== a.ActiveXObject ? function () { return !this.isLocal && /^(get|post|head|put|delete|options)$/i.test(this.type) && Zb() || $b() } : Zb; var Wb = 0, Xb = {}, Yb = m.ajaxSettings.xhr(); a.attachEvent && a.attachEvent("onunload", function () { for (var a in Xb) Xb[a](void 0, !0) }), k.cors = !!Yb && "withCredentials" in Yb, Yb = k.ajax = !!Yb, Yb && m.ajaxTransport(function (a) { if (!a.crossDomain || k.cors) { var b; return { send: function (c, d) { var e, f = a.xhr(), g = ++Wb; if (f.open(a.type, a.url, a.async, a.username, a.password), a.xhrFields) for (e in a.xhrFields) f[e] = a.xhrFields[e]; a.mimeType && f.overrideMimeType && f.overrideMimeType(a.mimeType), a.crossDomain || c["X-Requested-With"] || (c["X-Requested-With"] = "XMLHttpRequest"); for (e in c) void 0 !== c[e] && f.setRequestHeader(e, c[e] + ""); f.send(a.hasContent && a.data || null), b = function (c, e) { var h, i, j; if (b && (e || 4 === f.readyState)) if (delete Xb[g], b = void 0, f.onreadystatechange = m.noop, e) 4 !== f.readyState && f.abort(); else { j = {}, h = f.status, "string" == typeof f.responseText && (j.text = f.responseText); try { i = f.statusText } catch (k) { i = "" } h || !a.isLocal || a.crossDomain ? 1223 === h && (h = 204) : h = j.text ? 200 : 404 } j && d(h, i, j, f.getAllResponseHeaders()) }, a.async ? 4 === f.readyState ? setTimeout(b) : f.onreadystatechange = Xb[g] = b : b() }, abort: function () { b && b(void 0, !0) } } } }); function Zb() { try { return new a.XMLHttpRequest } catch (b) { } } function $b() { try { return new a.ActiveXObject("Microsoft.XMLHTTP") } catch (b) { } } m.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function (a) { return m.globalEval(a), a } } }), m.ajaxPrefilter("script", function (a) { void 0 === a.cache && (a.cache = !1), a.crossDomain && (a.type = "GET", a.global = !1) }), m.ajaxTransport("script", function (a) { if (a.crossDomain) { var b, c = y.head || m("head")[0] || y.documentElement; return { send: function (d, e) { b = y.createElement("script"), b.async = !0, a.scriptCharset && (b.charset = a.scriptCharset), b.src = a.url, b.onload = b.onreadystatechange = function (a, c) { (c || !b.readyState || /loaded|complete/.test(b.readyState)) && (b.onload = b.onreadystatechange = null, b.parentNode && b.parentNode.removeChild(b), b = null, c || e(200, "success")) }, c.insertBefore(b, c.firstChild) }, abort: function () { b && b.onload(void 0, !0) } } } }); var _b = [], ac = /(=)\?(?=&|$)|\?\?/; m.ajaxSetup({ jsonp: "callback", jsonpCallback: function () { var a = _b.pop() || m.expando + "_" + vb++; return this[a] = !0, a } }), m.ajaxPrefilter("json jsonp", function (b, c, d) { var e, f, g, h = b.jsonp !== !1 && (ac.test(b.url) ? "url" : "string" == typeof b.data && !(b.contentType || "").indexOf("application/x-www-form-urlencoded") && ac.test(b.data) && "data"); return h || "jsonp" === b.dataTypes[0] ? (e = b.jsonpCallback = m.isFunction(b.jsonpCallback) ? b.jsonpCallback() : b.jsonpCallback, h ? b[h] = b[h].replace(ac, "$1" + e) : b.jsonp !== !1 && (b.url += (wb.test(b.url) ? "&" : "?") + b.jsonp + "=" + e), b.converters["script json"] = function () { return g || m.error(e + " was not called"), g[0] }, b.dataTypes[0] = "json", f = a[e], a[e] = function () { g = arguments }, d.always(function () { a[e] = f, b[e] && (b.jsonpCallback = c.jsonpCallback, _b.push(e)), g && m.isFunction(f) && f(g[0]), g = f = void 0 }), "script") : void 0 }), m.parseHTML = function (a, b, c) { if (!a || "string" != typeof a) return null; "boolean" == typeof b && (c = b, b = !1), b = b || y; var d = u.exec(a), e = !c && []; return d ? [b.createElement(d[1])] : (d = m.buildFragment([a], b, e), e && e.length && m(e).remove(), m.merge([], d.childNodes)) }; var bc = m.fn.load; m.fn.load = function (a, b, c) { if ("string" != typeof a && bc) return bc.apply(this, arguments); var d, e, f, g = this, h = a.indexOf(" "); return h >= 0 && (d = m.trim(a.slice(h, a.length)), a = a.slice(0, h)), m.isFunction(b) ? (c = b, b = void 0) : b && "object" == typeof b && (f = "POST"), g.length > 0 && m.ajax({ url: a, type: f, dataType: "html", data: b }).done(function (a) { e = arguments, g.html(d ? m("
").append(m.parseHTML(a)).find(d) : a) }).complete(c && function (a, b) { g.each(c, e || [a.responseText, b, a]) }), this }, m.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function (a, b) { m.fn[b] = function (a) { return this.on(b, a) } }), m.expr.filters.animated = function (a) { return m.grep(m.timers, function (b) { return a === b.elem }).length }; var cc = a.document.documentElement; function dc(a) { return m.isWindow(a) ? a : 9 === a.nodeType ? a.defaultView || a.parentWindow : !1 } m.offset = { setOffset: function (a, b, c) { var d, e, f, g, h, i, j, k = m.css(a, "position"), l = m(a), n = {}; "static" === k && (a.style.position = "relative"), h = l.offset(), f = m.css(a, "top"), i = m.css(a, "left"), j = ("absolute" === k || "fixed" === k) && m.inArray("auto", [f, i]) > -1, j ? (d = l.position(), g = d.top, e = d.left) : (g = parseFloat(f) || 0, e = parseFloat(i) || 0), m.isFunction(b) && (b = b.call(a, c, h)), null != b.top && (n.top = b.top - h.top + g), null != b.left && (n.left = b.left - h.left + e), "using" in b ? b.using.call(a, n) : l.css(n) } }, m.fn.extend({ offset: function (a) { if (arguments.length) return void 0 === a ? this : this.each(function (b) { m.offset.setOffset(this, a, b) }); var b, c, d = { top: 0, left: 0 }, e = this[0], f = e && e.ownerDocument; if (f) return b = f.documentElement, m.contains(b, e) ? (typeof e.getBoundingClientRect !== K && (d = e.getBoundingClientRect()), c = dc(f), { top: d.top + (c.pageYOffset || b.scrollTop) - (b.clientTop || 0), left: d.left + (c.pageXOffset || b.scrollLeft) - (b.clientLeft || 0) }) : d }, position: function () { if (this[0]) { var a, b, c = { top: 0, left: 0 }, d = this[0]; return "fixed" === m.css(d, "position") ? b = d.getBoundingClientRect() : (a = this.offsetParent(), b = this.offset(), m.nodeName(a[0], "html") || (c = a.offset()), c.top += m.css(a[0], "borderTopWidth", !0), c.left += m.css(a[0], "borderLeftWidth", !0)), { top: b.top - c.top - m.css(d, "marginTop", !0), left: b.left - c.left - m.css(d, "marginLeft", !0) } } }, offsetParent: function () { return this.map(function () { var a = this.offsetParent || cc; while (a && !m.nodeName(a, "html") && "static" === m.css(a, "position")) a = a.offsetParent; return a || cc }) } }), m.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function (a, b) { var c = /Y/.test(b); m.fn[a] = function (d) { return V(this, function (a, d, e) { var f = dc(a); return void 0 === e ? f ? b in f ? f[b] : f.document.documentElement[d] : a[d] : void (f ? f.scrollTo(c ? m(f).scrollLeft() : e, c ? e : m(f).scrollTop()) : a[d] = e) }, a, d, arguments.length, null) } }), m.each(["top", "left"], function (a, b) { m.cssHooks[b] = La(k.pixelPosition, function (a, c) { return c ? (c = Ja(a, b), Ha.test(c) ? m(a).position()[b] + "px" : c) : void 0 }) }), m.each({ Height: "height", Width: "width" }, function (a, b) { m.each({ padding: "inner" + a, content: b, "": "outer" + a }, function (c, d) { m.fn[d] = function (d, e) { var f = arguments.length && (c || "boolean" != typeof d), g = c || (d === !0 || e === !0 ? "margin" : "border"); return V(this, function (b, c, d) { var e; return m.isWindow(b) ? b.document.documentElement["client" + a] : 9 === b.nodeType ? (e = b.documentElement, Math.max(b.body["scroll" + a], e["scroll" + a], b.body["offset" + a], e["offset" + a], e["client" + a])) : void 0 === d ? m.css(b, c, g) : m.style(b, c, d, g) }, b, f ? d : void 0, f, null) } }) }), m.fn.size = function () { return this.length }, m.fn.andSelf = m.fn.addBack, "function" == typeof define && define.amd && define("jquery", [], function () { return m }); var ec = a.jQuery, fc = a.$; return m.noConflict = function (b) { return a.$ === m && (a.$ = fc), b && a.jQuery === m && (a.jQuery = ec), m }, typeof b === K && (a.jQuery = a.$ = m), m
+});
\ No newline at end of file
diff --git a/samples/features/json/Dapper-Orm/wwwroot/media/js/jquery.serializejson.js b/samples/features/json/Dapper-Orm/wwwroot/media/js/jquery.serializejson.js
new file mode 100644
index 00000000..6dfe014d
--- /dev/null
+++ b/samples/features/json/Dapper-Orm/wwwroot/media/js/jquery.serializejson.js
@@ -0,0 +1,10 @@
+/*!
+ SerializeJSON jQuery plugin.
+ https://github.com/marioizquierdo/jquery.serializeJSON
+ version 2.7.2 (Dec, 2015)
+
+ Copyright (c) 2012, 2015 Mario Izquierdo
+ Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
+ and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
+*/
+!function(e){if("function"==typeof define&&define.amd)define(["jquery"],e);else if("object"==typeof exports){var n=require("jquery");module.exports=e(n)}else e(window.jQuery||window.Zepto||window.$)}(function(e){"use strict";e.fn.serializeJSON=function(n){var r,t,a,i,s,u,o,l,p,c,d;return r=e.serializeJSON,t=this,a=r.setupOpts(n),i=t.serializeArray(),r.readCheckboxUncheckedValues(i,a,t),s={},e.each(i,function(e,n){u=n.name,o=n.value,l=r.extractTypeAndNameWithNoType(u),p=l.nameWithNoType,c=l.type,c||(c=r.tryToFindTypeFromDataAttr(u,t)),r.validateType(u,c,a),"skip"!==c&&(d=r.splitInputNameIntoKeysArray(p),o=r.parseValue(o,u,c,a),r.deepSet(s,d,o,a))}),s},e.serializeJSON={defaultOptions:{checkboxUncheckedValue:void 0,parseNumbers:!1,parseBooleans:!1,parseNulls:!1,parseAll:!1,parseWithFunction:null,customTypes:{},defaultTypes:{string:function(e){return String(e)},number:function(e){return Number(e)},"boolean":function(e){var n=["false","null","undefined","","0"];return-1===n.indexOf(e)},"null":function(e){var n=["false","null","undefined","","0"];return-1===n.indexOf(e)?e:null},array:function(e){return JSON.parse(e)},object:function(e){return JSON.parse(e)},auto:function(n){return e.serializeJSON.parseValue(n,null,null,{parseNumbers:!0,parseBooleans:!0,parseNulls:!0})},skip:null},useIntKeysAsArrayIndex:!1},setupOpts:function(n){var r,t,a,i,s,u;u=e.serializeJSON,null==n&&(n={}),a=u.defaultOptions||{},t=["checkboxUncheckedValue","parseNumbers","parseBooleans","parseNulls","parseAll","parseWithFunction","customTypes","defaultTypes","useIntKeysAsArrayIndex"];for(r in n)if(-1===t.indexOf(r))throw new Error("serializeJSON ERROR: invalid option '"+r+"'. Please use one of "+t.join(", "));return i=function(e){return n[e]!==!1&&""!==n[e]&&(n[e]||a[e])},s=i("parseAll"),{checkboxUncheckedValue:i("checkboxUncheckedValue"),parseNumbers:s||i("parseNumbers"),parseBooleans:s||i("parseBooleans"),parseNulls:s||i("parseNulls"),parseWithFunction:i("parseWithFunction"),typeFunctions:e.extend({},i("defaultTypes"),i("customTypes")),useIntKeysAsArrayIndex:i("useIntKeysAsArrayIndex")}},parseValue:function(n,r,t,a){var i,s;return i=e.serializeJSON,s=n,a.typeFunctions&&t&&a.typeFunctions[t]?s=a.typeFunctions[t](n):a.parseNumbers&&i.isNumeric(n)?s=Number(n):!a.parseBooleans||"true"!==n&&"false"!==n?a.parseNulls&&"null"==n&&(s=null):s="true"===n,a.parseWithFunction&&!t&&(s=a.parseWithFunction(s,r)),s},isObject:function(e){return e===Object(e)},isUndefined:function(e){return void 0===e},isValidArrayIndex:function(e){return/^[0-9]+$/.test(String(e))},isNumeric:function(e){return e-parseFloat(e)>=0},optionKeys:function(e){if(Object.keys)return Object.keys(e);var n,r=[];for(n in e)r.push(n);return r},readCheckboxUncheckedValues:function(n,r,t){var a,i,s,u,o;null==r&&(r={}),o=e.serializeJSON,a="input[type=checkbox][name]:not(:checked):not([disabled])",i=t.find(a).add(t.filter(a)),i.each(function(t,a){s=e(a),u=s.attr("data-unchecked-value"),u?n.push({name:a.name,value:u}):o.isUndefined(r.checkboxUncheckedValue)||n.push({name:a.name,value:r.checkboxUncheckedValue})})},extractTypeAndNameWithNoType:function(e){var n;return(n=e.match(/(.*):([^:]+)$/))?{nameWithNoType:n[1],type:n[2]}:{nameWithNoType:e,type:null}},tryToFindTypeFromDataAttr:function(e,n){var r,t,a,i;return r=e.replace(/(:|\.|\[|\]|\s)/g,"\\$1"),t='[name="'+r+'"]',a=n.find(t).add(n.filter(t)),i=a.attr("data-value-type"),i||null},validateType:function(n,r,t){var a,i;if(i=e.serializeJSON,a=i.optionKeys(t?t.typeFunctions:i.defaultOptions.defaultTypes),r&&-1===a.indexOf(r))throw new Error("serializeJSON ERROR: Invalid type "+r+" found in input name '"+n+"', please use one of "+a.join(", "));return!0},splitInputNameIntoKeysArray:function(n){var r,t;return t=e.serializeJSON,r=n.split("["),r=e.map(r,function(e){return e.replace(/\]/g,"")}),""===r[0]&&r.shift(),r},deepSet:function(n,r,t,a){var i,s,u,o,l,p;if(null==a&&(a={}),p=e.serializeJSON,p.isUndefined(n))throw new Error("ArgumentError: param 'o' expected to be an object or array, found undefined");if(!r||0===r.length)throw new Error("ArgumentError: param 'keys' expected to be an array with least one element");i=r[0],1===r.length?""===i?n.push(t):n[i]=t:(s=r[1],""===i&&(o=n.length-1,l=n[o],i=p.isObject(l)&&(p.isUndefined(l[s])||r.length>2)?o:o+1),""===s?(p.isUndefined(n[i])||!e.isArray(n[i]))&&(n[i]=[]):a.useIntKeysAsArrayIndex&&p.isValidArrayIndex(s)?(p.isUndefined(n[i])||!e.isArray(n[i]))&&(n[i]=[]):(p.isUndefined(n[i])||!p.isObject(n[i]))&&(n[i]={}),u=r.slice(1),p.deepSet(n[i],u,t,a))}}});
\ No newline at end of file
diff --git a/samples/features/json/Dapper-Orm/wwwroot/media/js/jquery.view-engine.js b/samples/features/json/Dapper-Orm/wwwroot/media/js/jquery.view-engine.js
new file mode 100644
index 00000000..9f49d28b
--- /dev/null
+++ b/samples/features/json/Dapper-Orm/wwwroot/media/js/jquery.view-engine.js
@@ -0,0 +1,265 @@
+/*
+* File: jquery.view-engine.js
+* Version: 1.0.1
+* Author: Jovan Popovic
+*
+* Copyright 2017 Jovan Popovic, all rights reserved.
+*
+* This source file is free software, under either the GPL v2 license or a
+* BSD style license, as supplied with this software.
+*
+* This source file is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+* or FITNESS FOR A PARTICULAR PURPOSE.
+*
+* This file contains implementation of the JQuery templating engine that load JSON
+* objects into the HTML code. It is based on Alexandre Caprais notemplate plugin
+* with several enchancements that are added to this plugin.
+*/
+
+(function ($) {
+ $.fn.view = function (obj, options) {
+
+ if (!(typeof obj == "object")) {
+ console.error("Object should be provided as a model instead of " + (typeof obj));
+ throw "Object should be provided as a model instead of " + (typeof obj);
+ }
+ function loadSelect(nSelect, aoValues, name) {
+ ///
+ ///Load options into the select list
+ ///
+ ///Select list
+ ///Array of object containin the options
+ ///Name of the select list
+ for (i = 0; i < aoValues.length; i++) {
+ $("")
+ .attr("value", aoValues[i].value || aoValues[i])
+ .text(aoValues[i].text || aoValues[i])
+ .attr("selected", aoValues[i].selected)
+ .appendTo($(nSelect));
+ }
+ }
+
+ function setElementValue(element, value, name) {
+ var type = element.type || element.tagName;
+ if (type == null && element.length == 1) {
+ type = element[0].type || element[0].tagName; //select returns undefined if called directly
+ }
+ if (type==null)
+ return;
+ type = type.toLowerCase();
+ switch (type) {
+
+ case 'text':
+ case 'hidden':
+ case 'date':
+ case 'week':
+ case 'month':
+ case 'time':
+ case 'email':
+ case 'url':
+ case 'tel':
+ case 'color':
+ case 'datetime-local':
+ case 'number':
+ case 'range':
+ case 'submit':
+ case 'button':
+ $(element).val(value);
+ break;
+
+ case 'radio':
+ if (value.toString().toLowerCase() == element.value.toLowerCase()) {
+ $(element).attr("checked", "checked");
+ }
+ break;
+
+ case 'checkbox':
+ if (value) {
+ $(element).attr("checked", true).attr("value",true);
+ }
+ break;
+
+ case 'select':
+ case 'select-one':
+ case 'datalist':
+ if (typeof value == "string" || typeof value == "number" || typeof value == "boolean") {
+ $(element).val(value);
+ } else if (value.constructor == Array) {
+ loadSelect(element, value, name);
+ } else {
+ console.error("Cannot bind " + value + " to " + type);
+ }
+ break;
+
+ case 'select-multiple':
+ var select = element[0];
+ if (element[0].options == null || typeof (element[0].options) == "undefined") {
+ select = element;
+ }
+ if (select.options.length > 1) {
+ //If select list is not empty use values array to select options
+ var values = value.constructor == Array ? value : [value];
+ for (var i = 0; i < select.options.length; i++) {
+ for (var j = 0; j < values.length; j++) {
+ select.options[i].selected |= select.options[i].value == values[j];
+ }
+ }
+ } else {
+ //ELSE: Instead of selecting values use values array to populate select list
+ loadSelect(element, value, name);
+ }
+ break;
+
+ case 'option':
+ var $option = $(element);
+ // value can be object {value,text,selected} or scalar
+ $option.attr("value", value.value || value);
+ $option.text(value.text || value.value || value);
+ if (value.selected)
+ $option.attr("selected", true);
+ break;
+
+ case 'a':
+ var href = $(element).attr("href");
+ var iPosition = href.indexOf('#');
+ if (iPosition > 1000000) {
+ href = href.substr(0, iPosition) + '&' + name + '=' + value + href.substr(iPosition)
+ } else {
+ iPosition = href.indexOf('?');
+ if (iPosition > 0) // if parameters in the URL exists add new pair using &
+ href += '&' + name + '=' + value;
+ else//otherwise attach the name=value pair to the URL
+ href = href + '?' + name + '=' + value;
+ }
+ $(element).attr("href", href);
+ break;
+ case 'img':
+ var $img = $(element);
+ if (typeof value == "string") {
+ //Assumption is that value is in the HREF$ALT format
+ var iPosition = value.indexOf('$');
+ var src = "";
+ var alt = "";
+ if (iPosition > 0) {
+ src = value.substring(0, iPosition);
+ alt = value.substring(iPosition + 1);
+ }
+ else {
+ src = value;
+ }
+ $img.attr("src", src);
+ $img.attr("alt", alt);
+ } else {
+ $img.attr("src", obj.src);
+ $img.attr("alt", obj.alt);
+ $img.attr("title", obj.title);
+ }
+ break;
+ case 'form':
+ {
+ var $form = $(element);
+ if (typeof value == "string" || typeof value == "number") {
+ var action = $form.attr("action");
+ if (action.indexOf("{{" + name + "}}") > 0) {
+ $form.attr("action", action.replace("{{" + name + "}}", value));
+ } else {
+ $form.attr("action", action + value);
+ }
+ }
+ break;
+ }
+ case 'textarea':
+ default:
+ try {
+ $(element).html(value.toString());
+ } catch (exc) {
+ console.error(exc);
+ }
+ }
+ }
+
+ function bind(data, domNode, name) {
+
+ if (data == null)
+ return;
+
+ if (data.constructor == Object) {
+ if (domNode.length >= 1 && domNode[0].tagName == "OPTION")
+ {
+ // Shortcut: if tag is OPTION and data is object - set the value of OPTION
+ setElementValue(domNode[0], data, name);
+ return;
+ }
+ else {
+ for (var prop in data) {
+ if (prop == null || typeof prop == "undefined")
+ continue;
+ else {
+ //Find an element with class, id, or name that matches the property name
+ var sSelector = ".bind-" + prop + ", #" + prop + ', [name="' + prop + '"]';
+ bind(data[prop], jQuery(sSelector, domNode), prop);
+ }
+ }
+ }
+ }
+ else if (data.constructor == Array) {
+ if ( domNode.tagName == "SELECT" || domNode.tagName == "DATALIST"
+ || domNode.length == 1 && (domNode[0].tagName == "SELECT" || domNode[0].tagName == "DATALIST")
+ ) {
+ setElementValue(domNode, data, name);
+ return;
+ } else
+ {
+ // Clone the element that will be used as template (e.g.
or
)
+ var template = $(domNode).clone(true);
+ for (var i = data.length - 1; i > 0 ; i--){
+ // Put the clone of template on the second place and puth other after.
+ var target = template.clone(true).insertAfter( $(domNode));
+ // Bind i-th object into the new placeholder.
+ bind(data[i], target, name);
+ }
+ // Bind 0-th object into the element used as a prototype (the first one).
+ bind(data[0], $(domNode), name);
+ }
+ } // End Array
+ else {
+ // Scalar value
+ if (domNode.length > 0) {
+ // If someone needs to bind scalar into multiple elements:
+ for (var i = 0; i < domNode.length; i++)
+ setElementValue(domNode[i], data, name);
+ }
+ else {
+ setElementValue(domNode, data, name);
+ }
+ }
+ } //function bind() ends
+
+ function init(placeholder) {
+ if (placeholder.data("jquery-view-template") != null && placeholder.data("jquery-view-template") != "") {
+ var template = placeholder.data("jquery-view-template");
+ placeholder.html(template);
+ } else {
+ var template = placeholder.html()
+ placeholder.data("jquery-view-template", template);
+ }
+ }
+
+ var defaults = {
+ onLoading: jQuery.noop,
+ onLoaded: jQuery.noop
+ };
+
+ properties = $.extend(defaults, options);
+
+ return this.each(function () {
+
+ init($(this));
+ properties.onLoading();
+ bind(obj, this);
+ properties.onLoaded();
+
+ });
+ };
+})(jQuery);
\ No newline at end of file
diff --git a/samples/features/json/Dapper-Orm/wwwroot/media/js/products.js b/samples/features/json/Dapper-Orm/wwwroot/media/js/products.js
new file mode 100644
index 00000000..809190f0
--- /dev/null
+++ b/samples/features/json/Dapper-Orm/wwwroot/media/js/products.js
@@ -0,0 +1,116 @@
+ROOT_API_URL = "/api/Product/";
+
+// ProductController is an object that contains actions the will be executed on
+// get, save (create or update), delete
+var ProductController =
+ function ($table, $modal) {
+
+ return {
+
+ getProduct: function (productID) {
+ $.ajax(ROOT_API_URL + productID, {dataType: "json"})
+ .done( function (json) {
+ $modal.view(json);
+ })
+ .fail(function () {
+ toastr.error('An error occured while trying to get the product.');
+ });
+
+ },
+
+ saveProduct: function (productID, product) {
+ $.ajax({
+ contentType: 'application/json',
+ method: (productID == "") ? "POST" : "PUT",
+ url: ROOT_API_URL + productID,
+ processData: false,
+ data: product,
+ }).fail(function (msg) {
+ toastr.error('An error occured while trying to save the product.');
+ }).done(function () {
+ toastr.success("Product is successfully saved!");
+ $table.ajax.reload(null, false);
+ $modal.modal('hide');
+ });
+ },
+
+ deleteProduct: function (productID) {
+ $.ajax({
+ method: "DELETE",
+ url: ROOT_API_URL + productID
+ }).fail(function (msg) {
+ toastr.error('An error occured while trying to delete the product.', 'Product cannot be deleted!');
+ }).done(function () {
+ toastr.success("Product is successfully deleted!");
+ $table.ajax.reload(null, false);
+ });
+ }
+ }
+ };
+
+$(document).ready(function () {
+
+ // DataTable setup
+ var $table = $('#example').DataTable({
+ "ajax": {
+ "url": ROOT_API_URL,
+ "dataSrc": ""
+ },
+ "columns": [
+ { "data": "Name" },
+ { "data": "Color", "defaultContent": "" },
+ { "data": "Price", sType: 'numeric', "defaultContent": "" },
+ { "data": "Quantity", "defaultContent": "" },
+ { "data": "MadeIn", "defaultContent": "" },
+ { "data": "Tags", "defaultContent": "" },
+ {
+ "data": "ProductID",
+ "sortable": false,
+ "render": function (data) {
+ return '';
+ }
+ },
+ {
+ "data": "ProductID",
+ "sortable": false,
+ "render": function (data) {
+ return '';
+ }
+ }
+ ]
+ });// end DataTable setup
+
+ // Bootstrap modal setup
+ $modal = $('#myModal');
+
+ $modal.on('hide.bs.modal', function () {
+ $(this).find("input[type!=checkbox],textarea,select").val('').end();
+ $(this).find("input:checkbox").prop('checked', false);
+ });
+
+ $("#cancelButton", $modal).on("click", function () {
+ $modal.modal('hide');
+ });
+ // end modal setup
+
+ var ctrl = ProductController($table, $modal);
+
+ $table.on("click", "button.edit",
+ function () {
+ ctrl.getProduct(this.attributes["data-id"].value);
+ });
+
+ $table.on("click", "button.delete",
+ function () {
+ ctrl.deleteProduct(this.attributes["data-id"].value);
+ });
+
+ $('body').on("click", "#submitButton",
+ function (e) {
+ e.preventDefault();
+ var $form = $("#ProductForm");
+ var productId = $("#ProductID", $form).val();
+ var product = JSON.stringify($form.serializeJSON({ checkboxUncheckedValue: "false", parseAll: true }));
+ ctrl.saveProduct(productId, product);
+ });
+});
\ No newline at end of file
diff --git a/samples/features/json/Dapper-Orm/wwwroot/media/js/toastr.min.js b/samples/features/json/Dapper-Orm/wwwroot/media/js/toastr.min.js
new file mode 100644
index 00000000..ab9c66c1
--- /dev/null
+++ b/samples/features/json/Dapper-Orm/wwwroot/media/js/toastr.min.js
@@ -0,0 +1,2 @@
+!function(e){e(["jquery"],function(e){return function(){function t(e,t,n){return f({type:O.error,iconClass:g().iconClasses.error,message:e,optionsOverride:n,title:t})}function n(t,n){return t||(t=g()),v=e("#"+t.containerId),v.length?v:(n&&(v=c(t)),v)}function i(e,t,n){return f({type:O.info,iconClass:g().iconClasses.info,message:e,optionsOverride:n,title:t})}function o(e){w=e}function s(e,t,n){return f({type:O.success,iconClass:g().iconClasses.success,message:e,optionsOverride:n,title:t})}function a(e,t,n){return f({type:O.warning,iconClass:g().iconClasses.warning,message:e,optionsOverride:n,title:t})}function r(e){var t=g();v||n(t),l(e,t)||u(t)}function d(t){var i=g();return v||n(i),t&&0===e(":focus",t).length?void h(t):void(v.children().length&&v.remove())}function u(t){for(var n=v.children(),i=n.length-1;i>=0;i--)l(e(n[i]),t)}function l(t,n){return t&&0===e(":focus",t).length?(t[n.hideMethod]({duration:n.hideDuration,easing:n.hideEasing,complete:function(){h(t)}}),!0):!1}function c(t){return v=e("").attr("id",t.containerId).addClass(t.positionClass).attr("aria-live","polite").attr("role","alert"),v.appendTo(e(t.target)),v}function p(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",target:"body",closeHtml:'',newestOnTop:!0,preventDuplicates:!1,progressBar:!1}}function m(e){w&&w(e)}function f(t){function i(t){return!e(":focus",l).length||t?(clearTimeout(O.intervalId),l[r.hideMethod]({duration:r.hideDuration,easing:r.hideEasing,complete:function(){h(l),r.onHidden&&"hidden"!==b.state&&r.onHidden(),b.state="hidden",b.endTime=new Date,m(b)}})):void 0}function o(){(r.timeOut>0||r.extendedTimeOut>0)&&(u=setTimeout(i,r.extendedTimeOut),O.maxHideTime=parseFloat(r.extendedTimeOut),O.hideEta=(new Date).getTime()+O.maxHideTime)}function s(){clearTimeout(u),O.hideEta=0,l.stop(!0,!0)[r.showMethod]({duration:r.showDuration,easing:r.showEasing})}function a(){var e=(O.hideEta-(new Date).getTime())/O.maxHideTime*100;f.width(e+"%")}var r=g(),d=t.iconClass||r.iconClass;if("undefined"!=typeof t.optionsOverride&&(r=e.extend(r,t.optionsOverride),d=t.optionsOverride.iconClass||d),r.preventDuplicates){if(t.message===C)return;C=t.message}T++,v=n(r,!0);var u=null,l=e(""),c=e(""),p=e(""),f=e(""),w=e(r.closeHtml),O={intervalId:null,hideEta:null,maxHideTime:null},b={toastId:T,state:"visible",startTime:new Date,options:r,map:t};return t.iconClass&&l.addClass(r.toastClass).addClass(d),t.title&&(c.append(t.title).addClass(r.titleClass),l.append(c)),t.message&&(p.append(t.message).addClass(r.messageClass),l.append(p)),r.closeButton&&(w.addClass("toast-close-button").attr("role","button"),l.prepend(w)),r.progressBar&&(f.addClass("toast-progress"),l.prepend(f)),l.hide(),r.newestOnTop?v.prepend(l):v.append(l),l[r.showMethod]({duration:r.showDuration,easing:r.showEasing,complete:r.onShown}),r.timeOut>0&&(u=setTimeout(i,r.timeOut),O.maxHideTime=parseFloat(r.timeOut),O.hideEta=(new Date).getTime()+O.maxHideTime,r.progressBar&&(O.intervalId=setInterval(a,10))),l.hover(s,o),!r.onclick&&r.tapToDismiss&&l.click(i),r.closeButton&&w&&w.click(function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&e.cancelBubble!==!0&&(e.cancelBubble=!0),i(!0)}),r.onclick&&l.click(function(){r.onclick(),i()}),m(b),r.debug&&console&&console.log(b),l}function g(){return e.extend({},p(),b.options)}function h(e){v||(v=n()),e.is(":visible")||(e.remove(),e=null,0===v.children().length&&(v.remove(),C=void 0))}var v,w,C,T=0,O={error:"error",info:"info",success:"success",warning:"warning"},b={clear:r,remove:d,error:t,getContainer:n,info:i,options:{},subscribe:o,success:s,version:"2.1.0",warning:a};return b}()})}("function"==typeof define&&define.amd?define:function(e,t){"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):window.toastr=t(window.jQuery)});
+//# sourceMappingURL=toastr.js.map
diff --git a/samples/features/json/Dapper-Orm/wwwroot/report.html b/samples/features/json/Dapper-Orm/wwwroot/report.html
new file mode 100644
index 00000000..7c47131b
--- /dev/null
+++ b/samples/features/json/Dapper-Orm/wwwroot/report.html
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+