diff --git a/Certificates/DotNet Foundation CA.pfx b/Certificates/DotNet Foundation CA.pfx
new file mode 100644
index 000000000..67ce2e415
Binary files /dev/null and b/Certificates/DotNet Foundation CA.pfx differ
diff --git a/Certificates/eShopOnContainers.pfx b/Certificates/eShopOnContainers.pfx
new file mode 100644
index 000000000..c5962c1c2
Binary files /dev/null and b/Certificates/eShopOnContainers.pfx differ
diff --git a/cli-windows/add-firewall-rules-for-sts-auth-thru-docker.ps1 b/cli-windows/add-firewall-rules-for-sts-auth-thru-docker.ps1
index 271b6a77d..c9728ccbb 100644
--- a/cli-windows/add-firewall-rules-for-sts-auth-thru-docker.ps1
+++ b/cli-windows/add-firewall-rules-for-sts-auth-thru-docker.ps1
@@ -21,6 +21,8 @@ try {
Write-Host "Rule found"
}
catch [Exception] {
- New-NetFirewallRule -DisplayName eShopOnContainers-Inbound -Confirm -Description "eShopOnContainers Inbound Rule for port range 5100-5150" -LocalAddress Any -LocalPort 5100-5150 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Inbound
- New-NetFirewallRule -DisplayName eShopOnContainers-Outbound -Confirm -Description "eShopOnContainers Outbound Rule for port range 5100-5150" -LocalAddress Any -LocalPort 5100-5150 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Outbound
+ New-NetFirewallRule -DisplayName eShopOnContainers-Inbound-http -Confirm -Description "eShopOnContainers Inbound Rule for port range 5100-5150" -LocalAddress Any -LocalPort 5100-5150 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Inbound
+ New-NetFirewallRule -DisplayName eShopOnContainers-Inbound-https -Confirm -Description "eShopOnContainers Inbound Rule for port range 4100-4150" -LocalAddress Any -LocalPort 4100-4150 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Inbound
+ New-NetFirewallRule -DisplayName eShopOnContainers-Outbound-http -Confirm -Description "eShopOnContainers Outbound Rule for port range 4100-4150" -LocalAddress Any -LocalPort 4400-4150 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Outbound
+ New-NetFirewallRule -DisplayName eShopOnContainers-Outbound-https -Confirm -Description "eShopOnContainers Outbound Rule for port range 4100-4150" -LocalAddress Any -LocalPort 4100-4150 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Outbound
}
\ No newline at end of file
diff --git a/docker-compose.dcproj b/docker-compose.dcproj
index 296c4b5e0..0a5eabea4 100644
--- a/docker-compose.dcproj
+++ b/docker-compose.dcproj
@@ -3,7 +3,7 @@
fea0c318-ffed-4d39-8781-265718ca43dd
True
- http://localhost:5100
+ https://localhost:4100
webmvc
Linux
2.1
diff --git a/docker-compose.override.yml b/docker-compose.override.yml
index 969cfb922..d17430bb4 100644
--- a/docker-compose.override.yml
+++ b/docker-compose.override.yml
@@ -30,11 +30,11 @@ services:
identity.api:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- - ASPNETCORE_URLS=http://0.0.0.0:80
- - SpaClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5104
+ - ASPNETCORE_URLS=http://0.0.0.0:80;https://+:443
+ - SpaClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5104;https://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:4104
- XamarinCallback=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105/xamarincallback #localhost do not work for UWP login, so we have to use "external" IP always
- ConnectionString=${ESHOP_AZURE_IDENTITY_DB:-Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word}
- - MvcClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5100 #Local: You need to open your local dev-machine firewall at range 5100-5110.
+ - MvcClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5100;https://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:4100 #Local: You need to open your local dev-machine firewall at range 5100-5110.
- LocationApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5109
- MarketingApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5110
- BasketApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5103
@@ -45,7 +45,11 @@ services:
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
ports:
- - "5105:80"
+ - "5105:80"
+ - "4105:443"
+ volumes:
+ - ${APPDATA}/ASP.NET/Https:/root/.aspnet/https:rw
+ - ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:rw
basket.api:
environment:
@@ -188,7 +192,7 @@ services:
- ASPNETCORE_ENVIRONMENT=Development
- IdentityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110.
ports:
- - "5200:80"
+ - "5200:80"
volumes:
- ./src/ApiGateways/Mobile.Bff.Shopping/apigw:${ESHOP_OCELOT_VOLUME_SPEC:-/app/configuration}
@@ -206,7 +210,7 @@ services:
- ASPNETCORE_ENVIRONMENT=Development
- IdentityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110.
ports:
- - "5202:80"
+ - "5202:80"
volumes:
- ./src/ApiGateways/Web.Bff.Shopping/apigw:${ESHOP_OCELOT_VOLUME_SPEC:-/app/configuration}
@@ -277,7 +281,7 @@ services:
webspa:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- - ASPNETCORE_URLS=http://0.0.0.0:80
+ - ASPNETCORE_URLS=http://+:80;https://+:443
- IdentityUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
- PurchaseUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202
- MarketingUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5203
@@ -293,11 +297,15 @@ services:
- SignalrHubUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202
ports:
- "5104:80"
+ - "4104:443"
+ volumes:
+ - ${APPDATA}/ASP.NET/Https:/root/.aspnet/https:rw
+ - ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:rw
webmvc:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- - ASPNETCORE_URLS=http://0.0.0.0:80
+ - ASPNETCORE_URLS=http://+:80;https://+:443
- PurchaseUrl=http://webshoppingapigw
- IdentityUrl=http://10.0.75.1:5105 # Local Mac: Use http://docker.for.mac.localhost:5105 || Local Windows: Use 10.0.75.1 in a "Docker for Windows" environment, if using "localhost" from browser. || #Remote access: Use ${ESHOP_EXTERNAL_DNS_NAME_OR_IP} if using external IP or DNS name from browser.
- MarketingUrl=http://webmarketingapigw
@@ -314,4 +322,7 @@ services:
- UseLoadTest=${USE_LOADTEST:-False}
ports:
- "5100:80"
-
+ - "4100:443"
+ volumes:
+ - ${APPDATA}/ASP.NET/Https:/root/.aspnet/https:rw
+ - ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:rw
diff --git a/eShopOnContainers-ServicesAndWebApps.sln b/eShopOnContainers-ServicesAndWebApps.sln
index 583b4499c..89d0275f4 100644
--- a/eShopOnContainers-ServicesAndWebApps.sln
+++ b/eShopOnContainers-ServicesAndWebApps.sln
@@ -42,8 +42,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebMVC", "src\Web\WebMVC\We
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ordering.Infrastructure", "src\Services\Ordering\Ordering.Infrastructure\Ordering.Infrastructure.csproj", "{95F1F07C-4D92-4742-BD07-E5B805AAB651}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Identity.API", "src\Services\Identity\Identity.API\Identity.API.csproj", "{A579E108-5445-403D-A407-339AC4D1611B}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebSPA", "src\Web\WebSPA\WebSPA.csproj", "{F16E3C6A-1C94-4EAB-BE91-099618060B68}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BuildingBlocks", "BuildingBlocks", "{DB0EFB20-B024-4E5E-A75C-52143C131D25}"
@@ -150,6 +148,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Payment", "Payment", "{C61C
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Payment.API", "src\Services\Payment\Payment.API\Payment.API.csproj", "{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Identity.API", "src\Services\Identity\Identity.API\Identity.API.csproj", "{8967991B-D758-4C01-B266-DE11330458DD}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
@@ -404,54 +404,6 @@ Global
{95F1F07C-4D92-4742-BD07-E5B805AAB651}.Release|x64.Build.0 = Release|Any CPU
{95F1F07C-4D92-4742-BD07-E5B805AAB651}.Release|x86.ActiveCfg = Release|Any CPU
{95F1F07C-4D92-4742-BD07-E5B805AAB651}.Release|x86.Build.0 = Release|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|Any CPU.Build.0 = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|ARM.ActiveCfg = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|ARM.Build.0 = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|iPhone.Build.0 = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|x64.ActiveCfg = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|x64.Build.0 = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|x86.ActiveCfg = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|x86.Build.0 = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Debug|ARM.Build.0 = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Debug|iPhone.ActiveCfg = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Debug|iPhone.Build.0 = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Debug|x64.ActiveCfg = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Debug|x64.Build.0 = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Debug|x86.ActiveCfg = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Debug|x86.Build.0 = Debug|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Release|Any CPU.Build.0 = Release|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Release|ARM.ActiveCfg = Release|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Release|ARM.Build.0 = Release|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Release|iPhone.ActiveCfg = Release|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Release|iPhone.Build.0 = Release|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Release|x64.ActiveCfg = Release|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Release|x64.Build.0 = Release|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Release|x86.ActiveCfg = Release|Any CPU
- {A579E108-5445-403D-A407-339AC4D1611B}.Release|x86.Build.0 = Release|Any CPU
{F16E3C6A-1C94-4EAB-BE91-099618060B68}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{F16E3C6A-1C94-4EAB-BE91-099618060B68}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{F16E3C6A-1C94-4EAB-BE91-099618060B68}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
@@ -1844,6 +1796,54 @@ Global
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Release|x64.Build.0 = Release|Any CPU
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Release|x86.ActiveCfg = Release|Any CPU
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84}.Release|x86.Build.0 = Release|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.AppStore|Any CPU.Build.0 = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.AppStore|ARM.ActiveCfg = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.AppStore|ARM.Build.0 = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.AppStore|iPhone.Build.0 = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.AppStore|x64.ActiveCfg = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.AppStore|x64.Build.0 = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.AppStore|x86.ActiveCfg = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.AppStore|x86.Build.0 = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Debug|ARM.Build.0 = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Debug|iPhone.Build.0 = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Debug|x64.Build.0 = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Debug|x86.Build.0 = Debug|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Release|ARM.ActiveCfg = Release|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Release|ARM.Build.0 = Release|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Release|iPhone.Build.0 = Release|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Release|x64.ActiveCfg = Release|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Release|x64.Build.0 = Release|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Release|x86.ActiveCfg = Release|Any CPU
+ {8967991B-D758-4C01-B266-DE11330458DD}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1862,7 +1862,6 @@ Global
{F5598DCB-6DDE-4661-AD9D-A55612DA7E76} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B}
{F0333D8E-0B27-42B7-B2C6-78F3657624E2} = {E279BF0F-7F66-4F3A-A3AB-2CDA66C1CD04}
{95F1F07C-4D92-4742-BD07-E5B805AAB651} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B}
- {A579E108-5445-403D-A407-339AC4D1611B} = {24CD3B53-141E-4A07-9B0D-796641E1CF78}
{F16E3C6A-1C94-4EAB-BE91-099618060B68} = {E279BF0F-7F66-4F3A-A3AB-2CDA66C1CD04}
{DB0EFB20-B024-4E5E-A75C-52143C131D25} = {932D8224-11F6-4D07-B109-DA28AD288A63}
{807BB76E-B2BB-47A2-A57B-3D1B20FF5E7F} = {DB0EFB20-B024-4E5E-A75C-52143C131D25}
@@ -1910,6 +1909,7 @@ Global
{120CABB3-0FEA-4B40-B4B5-2D3041798C80} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B}
{C61C5CFE-4876-4A46-A96E-5BBF596A984A} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8}
{0AB40131-8AD7-436F-9C6B-EDA59CFA3A84} = {C61C5CFE-4876-4A46-A96E-5BBF596A984A}
+ {8967991B-D758-4C01-B266-DE11330458DD} = {24CD3B53-141E-4A07-9B0D-796641E1CF78}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {25728519-5F0F-4973-8A64-0A81EB4EA8D9}
diff --git a/src/ApiGateways/ApiGw-Base/Dockerfile b/src/ApiGateways/ApiGw-Base/Dockerfile
index 7fdd5f073..3126d6e37 100644
--- a/src/ApiGateways/ApiGw-Base/Dockerfile
+++ b/src/ApiGateways/ApiGw-Base/Dockerfile
@@ -1,8 +1,8 @@
-FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
+FROM microsoft/dotnet:2.1.3-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
-FROM microsoft/dotnet:2.1-sdk AS build
+FROM microsoft/dotnet:2.1.401-sdk AS build
WORKDIR /src
COPY src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj src/ApiGateways/ApiGw-Base/
RUN dotnet restore src/ApiGateways/ApiGw-Base/
diff --git a/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj b/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj
index d3b1a049b..9ab762c58 100644
--- a/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj
+++ b/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj
@@ -1,15 +1,16 @@
-
- netcoreapp2.1
-
+
+ netcoreapp2.1
+ 2.1.3
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
diff --git a/src/ApiGateways/ApiGw-Base/Properties/launchSettings.json b/src/ApiGateways/ApiGw-Base/Properties/launchSettings.json
index 2308ca466..7c7e1f477 100644
--- a/src/ApiGateways/ApiGw-Base/Properties/launchSettings.json
+++ b/src/ApiGateways/ApiGw-Base/Properties/launchSettings.json
@@ -13,7 +13,8 @@
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
- }
+ },
+ "use64Bit": true
},
"OcelotApiGw": {
"commandName": "Project",
diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile
index 7787dd159..b955542f9 100644
--- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile
+++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile
@@ -1,8 +1,8 @@
-FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
+FROM microsoft/dotnet:2.1.3-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
-FROM microsoft/dotnet:2.1-sdk AS build
+FROM microsoft/dotnet:2.1.401-sdk AS build
WORKDIR /src
COPY . .
WORKDIR /src/src/ApiGateways/Mobile.Bff.Shopping/aggregator
diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj
index d49c6a18f..704911946 100644
--- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj
+++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj
@@ -1,20 +1,21 @@
-
- netcoreapp2.1
- Mobile.Shopping.HttpAggregator
- Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
- ..\..\..\docker-compose.dcproj
-
+
+ netcoreapp2.1
+ 2.1.3
+ Mobile.Shopping.HttpAggregator
+ Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
+ ..\..\..\docker-compose.dcproj
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json
index 925e70b0d..adfd79888 100644
--- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json
+++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json
@@ -14,7 +14,8 @@
"launchUrl": "api/values",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
- }
+ },
+ "use64Bit": true
},
"PurchaseForMvc": {
"commandName": "Project",
diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs
index 1d24e8312..9b068cd60 100644
--- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs
+++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs
@@ -19,166 +19,176 @@ using System.Net.Http;
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
{
- public class Startup
- {
- public Startup(IConfiguration configuration)
- {
- Configuration = configuration;
- }
-
- public IConfiguration Configuration { get; }
-
- // This method gets called by the runtime. Use this method to add services to the container.
- public void ConfigureServices(IServiceCollection services)
- {
- services.AddCustomMvc(Configuration)
- .AddCustomAuthentication(Configuration)
- .AddHttpServices();
- }
-
- // 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)
- {
- var pathBase = Configuration["PATH_BASE"];
-
- if (!string.IsNullOrEmpty(pathBase))
- {
- loggerFactory.CreateLogger("init").LogDebug($"Using PATH BASE '{pathBase}'");
- app.UsePathBase(pathBase);
- }
-
- app.UseCors("CorsPolicy");
-
- if (env.IsDevelopment())
- {
- app.UseDeveloperExceptionPage();
- }
-
- app.UseAuthentication();
-
- app.UseMvc();
-
- app.UseSwagger().UseSwaggerUI(c =>
- {
- c.SwaggerEndpoint($"{ (!string.IsNullOrEmpty(pathBase) ? pathBase : string.Empty) }/swagger/v1/swagger.json", "Purchase BFF V1");
- c.ConfigureOAuth2("Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregatorwaggerui", "", "", "Purchase BFF Swagger UI");
- });
- }
- }
-
- public static class ServiceCollectionExtensions
- {
- public static IServiceCollection AddCustomMvc(this IServiceCollection services, IConfiguration configuration)
- {
- services.AddOptions();
- services.Configure(configuration.GetSection("urls"));
-
- services.AddMvc();
-
- services.AddSwaggerGen(options =>
- {
- options.DescribeAllEnumsAsStrings();
- options.SwaggerDoc("v1", new Swashbuckle.AspNetCore.Swagger.Info
- {
- Title = "Shopping Aggregator for Mobile Clients",
- Version = "v1",
- Description = "Shopping Aggregator for Mobile Clients",
- TermsOfService = "Terms Of Service"
- });
-
- options.AddSecurityDefinition("oauth2", new OAuth2Scheme
- {
- Type = "oauth2",
- Flow = "implicit",
- AuthorizationUrl = $"{configuration.GetValue("IdentityUrlExternal")}/connect/authorize",
- TokenUrl = $"{configuration.GetValue("IdentityUrlExternal")}/connect/token",
- Scopes = new Dictionary()
- {
- { "mobileshoppingagg", "Shopping Aggregator for Mobile Clients" }
- }
- });
-
- options.OperationFilter();
- });
-
- services.AddCors(options =>
- {
- options.AddPolicy("CorsPolicy",
- builder => builder.AllowAnyOrigin()
- .AllowAnyMethod()
- .AllowAnyHeader()
- .AllowCredentials());
- });
-
- return services;
- }
- public static IServiceCollection AddCustomAuthentication(this IServiceCollection services, IConfiguration configuration)
- {
- JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
- var identityUrl = configuration.GetValue("urls:identity");
- services.AddAuthentication(options =>
- {
- options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
- options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
-
- }).AddJwtBearer(options =>
- {
- options.Authority = identityUrl;
- options.RequireHttpsMetadata = false;
- options.Audience = "mobileshoppingagg";
- options.Events = new JwtBearerEvents()
- {
- OnAuthenticationFailed = async ctx =>
- {
- int i = 0;
- },
- OnTokenValidated = async ctx =>
- {
- int i = 0;
- }
- };
- });
-
- return services;
- }
- public static IServiceCollection AddHttpServices(this IServiceCollection services)
- {
- //register delegating handlers
- services.AddTransient();
- services.AddSingleton();
-
- //register http services
- services.AddHttpClient()
- .AddHttpMessageHandler()
- .AddPolicyHandler(GetRetryPolicy())
- .AddPolicyHandler(GetCircuitBreakerPolicy());
-
- services.AddHttpClient()
- .AddPolicyHandler(GetRetryPolicy())
- .AddPolicyHandler(GetCircuitBreakerPolicy());
-
- services.AddHttpClient()
- .AddPolicyHandler(GetRetryPolicy())
- .AddPolicyHandler(GetCircuitBreakerPolicy());
-
-
-
- return services;
- }
-
- static IAsyncPolicy GetRetryPolicy()
- {
- return HttpPolicyExtensions
- .HandleTransientHttpError()
- .OrResult(msg => msg.StatusCode == System.Net.HttpStatusCode.NotFound)
- .WaitAndRetryAsync(6, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)));
-
- }
- static IAsyncPolicy GetCircuitBreakerPolicy()
- {
- return HttpPolicyExtensions
- .HandleTransientHttpError()
- .CircuitBreakerAsync(5, TimeSpan.FromSeconds(30));
- }
- }
+ public class Startup
+ {
+ public Startup(IConfiguration configuration)
+ {
+ Configuration = configuration;
+ }
+
+ public IConfiguration Configuration { get; }
+
+ // This method gets called by the runtime. Use this method to add services to the container.
+ public void ConfigureServices(IServiceCollection services)
+ {
+ services
+ .AddCustomMvc(Configuration)
+ .AddCustomAuthentication(Configuration)
+ .AddHttpServices();
+ //services.AddHttpsRedirection(opts =>
+ //{
+ // opts.HttpsPort = 4120;
+ //});
+ }
+
+ // 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)
+ {
+ string pathBase = Configuration["PATH_BASE"];
+
+ if (!string.IsNullOrEmpty(pathBase))
+ {
+ loggerFactory.CreateLogger("init").LogDebug($"Using PATH BASE '{pathBase}'");
+ app.UsePathBase(pathBase);
+ }
+
+ app.UseCors("CorsPolicy");
+
+ if (env.IsDevelopment())
+ {
+ app.UseDeveloperExceptionPage();
+ }
+
+ app.UseAuthentication();
+
+ app.UseMvc();
+
+ app.UseSwagger().UseSwaggerUI(c =>
+ {
+ c.SwaggerEndpoint($"{ (!string.IsNullOrEmpty(pathBase) ? pathBase : string.Empty) }/swagger/v1/swagger.json", "Purchase BFF V1");
+ c.ConfigureOAuth2("Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregatorwaggerui", "", "", "Purchase BFF Swagger UI");
+ });
+ }
+ }
+
+ public static class ServiceCollectionExtensions
+ {
+ public static IServiceCollection AddCustomMvc(this IServiceCollection services, IConfiguration configuration)
+ {
+ services.AddOptions();
+ services.Configure(configuration.GetSection("urls"));
+
+ services
+ .AddMvc()
+ .SetCompatibilityVersion(AspNetCore.Mvc.CompatibilityVersion.Version_2_1)
+ ;
+
+ services.AddSwaggerGen(options =>
+ {
+ options.DescribeAllEnumsAsStrings();
+ options.SwaggerDoc("v1", new Swashbuckle.AspNetCore.Swagger.Info
+ {
+ Title = "Shopping Aggregator for Mobile Clients",
+ Version = "v1",
+ Description = "Shopping Aggregator for Mobile Clients",
+ TermsOfService = "Terms Of Service"
+ });
+
+ options.AddSecurityDefinition("oauth2", new OAuth2Scheme
+ {
+ Type = "oauth2",
+ Flow = "implicit",
+ AuthorizationUrl = $"{configuration.GetValue("IdentityUrlExternal")}/connect/authorize",
+ TokenUrl = $"{configuration.GetValue("IdentityUrlExternal")}/connect/token",
+ Scopes = new Dictionary()
+ {
+ { "mobileshoppingagg", "Shopping Aggregator for Mobile Clients" }
+ }
+ });
+
+ options.OperationFilter();
+ });
+
+ services.AddCors(options =>
+ {
+ options.AddPolicy("CorsPolicy",
+ builder => builder.AllowAnyOrigin()
+ .AllowAnyMethod()
+ .AllowAnyHeader()
+ .AllowCredentials());
+ });
+
+ return services;
+ }
+ public static IServiceCollection AddCustomAuthentication(this IServiceCollection services, IConfiguration configuration)
+ {
+ JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
+ var identityUrl = configuration.GetValue("urls:identity");
+ services.AddAuthentication(options =>
+ {
+ options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
+ options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
+
+ }).AddJwtBearer(options =>
+ {
+ options.Authority = identityUrl;
+ options.RequireHttpsMetadata = false;
+ options.Audience = "mobileshoppingagg";
+ options.Events = new JwtBearerEvents()
+ {
+#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
+ OnAuthenticationFailed = async ctx =>
+#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
+ {
+ },
+#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
+ OnTokenValidated = async ctx =>
+#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
+ {
+ }
+ };
+ });
+
+ return services;
+ }
+ public static IServiceCollection AddHttpServices(this IServiceCollection services)
+ {
+ //register delegating handlers
+ services.AddTransient();
+ services.AddSingleton();
+
+ //register http services
+ services.AddHttpClient()
+ .AddHttpMessageHandler()
+ .AddPolicyHandler(GetRetryPolicy())
+ .AddPolicyHandler(GetCircuitBreakerPolicy());
+
+ services.AddHttpClient()
+ .AddPolicyHandler(GetRetryPolicy())
+ .AddPolicyHandler(GetCircuitBreakerPolicy());
+
+ services.AddHttpClient()
+ .AddPolicyHandler(GetRetryPolicy())
+ .AddPolicyHandler(GetCircuitBreakerPolicy());
+
+
+
+ return services;
+ }
+
+ static IAsyncPolicy GetRetryPolicy()
+ {
+ return HttpPolicyExtensions
+ .HandleTransientHttpError()
+ .OrResult(msg => msg.StatusCode == System.Net.HttpStatusCode.NotFound)
+ .WaitAndRetryAsync(6, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)));
+
+ }
+ static IAsyncPolicy GetCircuitBreakerPolicy()
+ {
+ return HttpPolicyExtensions
+ .HandleTransientHttpError()
+ .CircuitBreakerAsync(5, TimeSpan.FromSeconds(30));
+ }
+ }
}
diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/appsettings.json b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/appsettings.json
index 26bb0ac7a..e1efd9d6e 100644
--- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/appsettings.json
+++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/appsettings.json
@@ -1,15 +1,23 @@
{
- "Logging": {
- "IncludeScopes": false,
- "Debug": {
- "LogLevel": {
- "Default": "Warning"
- }
- },
- "Console": {
- "LogLevel": {
- "Default": "Warning"
- }
- }
- }
+ "Logging": {
+ "IncludeScopes": false,
+ "Debug": {
+ "LogLevel": {
+ "Default": "Warning"
+ }
+ },
+ "Console": {
+ "LogLevel": {
+ "Default": "Warning"
+ }
+ }
+ },
+ "Kestrel": {
+ "Certificates": {
+ "Default": {
+ "Path": "./synergydev.pfx",
+ "Password": "RH@ssl2018"
+ }
+ }
+ }
}
diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile b/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile
index d4940d436..c9572c9ab 100644
--- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile
+++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile
@@ -1,8 +1,8 @@
-FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
+FROM microsoft/dotnet:2.1.3-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
-FROM microsoft/dotnet:2.1-sdk AS build
+FROM microsoft/dotnet:2.1.401-sdk AS build
WORKDIR /src
COPY . .
WORKDIR /src/src/ApiGateways/Web.Bff.Shopping/aggregator
diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Properties/launchSettings.json b/src/ApiGateways/Web.Bff.Shopping/aggregator/Properties/launchSettings.json
index 925e70b0d..adfd79888 100644
--- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Properties/launchSettings.json
+++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Properties/launchSettings.json
@@ -14,7 +14,8 @@
"launchUrl": "api/values",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
- }
+ },
+ "use64Bit": true
},
"PurchaseForMvc": {
"commandName": "Project",
diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs
index e4a080289..515641e34 100644
--- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs
+++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs
@@ -11,7 +11,6 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Polly;
using Polly.Extensions.Http;
-using Polly.Timeout;
using Swashbuckle.AspNetCore.Swagger;
using System;
using System.Collections.Generic;
@@ -20,168 +19,178 @@ using System.Net.Http;
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator
{
- public class Startup
- {
- public Startup(IConfiguration configuration)
- {
- Configuration = configuration;
- }
-
- public IConfiguration Configuration { get; }
-
- // This method gets called by the runtime. Use this method to add services to the container.
- public void ConfigureServices(IServiceCollection services)
- {
- services.AddCustomMvc(Configuration)
- .AddCustomAuthentication(Configuration)
- .AddApplicationServices();
- }
-
- // 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)
- {
- var pathBase = Configuration["PATH_BASE"];
- if (!string.IsNullOrEmpty(pathBase))
- {
- loggerFactory.CreateLogger("init").LogDebug($"Using PATH BASE '{pathBase}'");
- app.UsePathBase(pathBase);
- }
-
- app.UseCors("CorsPolicy");
-
- if (env.IsDevelopment())
- {
- app.UseDeveloperExceptionPage();
- }
-
- app.UseAuthentication();
-
- app.UseMvc();
-
- app.UseSwagger().UseSwaggerUI(c =>
- {
- c.SwaggerEndpoint($"{ (!string.IsNullOrEmpty(pathBase) ? pathBase : string.Empty) }/swagger/v1/swagger.json", "Purchase BFF V1");
- //c.ConfigureOAuth2("Microsoft.eShopOnContainers.Web.Shopping.HttpAggregatorwaggerui", "", "", "Purchase BFF Swagger UI");
- });
-
-
- }
- }
-
- public static class ServiceCollectionExtensions
- {
- public static IServiceCollection AddCustomAuthentication(this IServiceCollection services, IConfiguration configuration)
- {
- JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
- var identityUrl = configuration.GetValue("urls:identity");
- services.AddAuthentication(options =>
- {
- options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
- options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
-
- }).AddJwtBearer(options =>
- {
- options.Authority = identityUrl;
- options.RequireHttpsMetadata = false;
- options.Audience = "webshoppingagg";
- options.Events = new JwtBearerEvents()
- {
- OnAuthenticationFailed = async ctx =>
- {
- int i = 0;
- },
- OnTokenValidated = async ctx =>
- {
- int i = 0;
- }
- };
- });
-
- return services;
- }
- public static IServiceCollection AddCustomMvc(this IServiceCollection services, IConfiguration configuration)
- {
- services.AddOptions();
- services.Configure(configuration.GetSection("urls"));
-
- services.AddMvc();
-
- services.AddSwaggerGen(options =>
- {
- options.DescribeAllEnumsAsStrings();
- options.SwaggerDoc("v1", new Swashbuckle.AspNetCore.Swagger.Info
- {
- Title = "Shopping Aggregator for Web Clients",
- Version = "v1",
- Description = "Shopping Aggregator for Web Clients",
- TermsOfService = "Terms Of Service"
- });
-
- options.AddSecurityDefinition("oauth2", new OAuth2Scheme
- {
- Type = "oauth2",
- Flow = "implicit",
- AuthorizationUrl = $"{configuration.GetValue("IdentityUrlExternal")}/connect/authorize",
- TokenUrl = $"{configuration.GetValue("IdentityUrlExternal")}/connect/token",
- Scopes = new Dictionary()
- {
- { "webshoppingagg", "Shopping Aggregator for Web Clients" }
- }
- });
-
- options.OperationFilter();
- });
-
- services.AddCors(options =>
- {
- options.AddPolicy("CorsPolicy",
- builder => builder.AllowAnyOrigin()
- .AllowAnyMethod()
- .AllowAnyHeader()
- .AllowCredentials());
- });
-
- return services;
- }
- public static IServiceCollection AddApplicationServices(this IServiceCollection services)
- {
- //register delegating handlers
- services.AddTransient();
- services.AddSingleton();
-
- //register http services
-
- services.AddHttpClient()
- .AddHttpMessageHandler()
- .AddPolicyHandler(GetRetryPolicy())
- .AddPolicyHandler(GetCircuitBreakerPolicy());
-
- services.AddHttpClient()
- .AddPolicyHandler(GetRetryPolicy())
- .AddPolicyHandler(GetCircuitBreakerPolicy());
-
- services.AddHttpClient()
- .AddHttpMessageHandler()
- .AddPolicyHandler(GetRetryPolicy())
- .AddPolicyHandler(GetCircuitBreakerPolicy());
-
-
- return services;
- }
-
- static IAsyncPolicy GetRetryPolicy()
- {
- return HttpPolicyExtensions
- .HandleTransientHttpError()
- .OrResult(msg => msg.StatusCode == System.Net.HttpStatusCode.NotFound)
- .WaitAndRetryAsync(6, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)));
-
- }
- static IAsyncPolicy GetCircuitBreakerPolicy()
- {
- return HttpPolicyExtensions
- .HandleTransientHttpError()
- .CircuitBreakerAsync(5, TimeSpan.FromSeconds(30));
- }
- }
+ public class Startup
+ {
+ public Startup(IConfiguration configuration)
+ {
+ Configuration = configuration;
+ }
+
+ public IConfiguration Configuration { get; }
+
+ // This method gets called by the runtime. Use this method to add services to the container.
+ public void ConfigureServices(IServiceCollection services)
+ {
+ services
+ .AddCustomMvc(Configuration)
+ .AddCustomAuthentication(Configuration)
+ .AddApplicationServices();
+ }
+
+ // 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)
+ {
+ var pathBase = Configuration["PATH_BASE"];
+ if (!string.IsNullOrEmpty(pathBase))
+ {
+ loggerFactory.CreateLogger("init").LogDebug($"Using PATH BASE '{pathBase}'");
+ app.UsePathBase(pathBase);
+ }
+
+ app.UseCors("CorsPolicy");
+
+ if (env.IsDevelopment())
+ {
+ app.UseDeveloperExceptionPage();
+ }
+ app.UseAuthentication();
+
+ app.UseMvc();
+
+ app.UseSwagger().UseSwaggerUI(c =>
+ {
+ c.SwaggerEndpoint($"{ (!string.IsNullOrEmpty(pathBase) ? pathBase : string.Empty) }/swagger/v1/swagger.json", "Purchase BFF V1");
+ //c.ConfigureOAuth2("Microsoft.eShopOnContainers.Web.Shopping.HttpAggregatorwaggerui", "", "", "Purchase BFF Swagger UI");
+ });
+
+
+ }
+ }
+
+ public static class ServiceCollectionExtensions
+ {
+ public static IServiceCollection AddCustomAuthentication(this IServiceCollection services, IConfiguration configuration)
+ {
+ JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
+ string identityUrl = configuration.GetValue("urls:identity");
+ services.AddAuthentication(options =>
+ {
+ options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
+ options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
+
+ })
+ .AddJwtBearer(options =>
+ {
+ options.Authority = identityUrl;
+ options.RequireHttpsMetadata = false;
+ options.Audience = "webshoppingagg";
+ options.Events = new JwtBearerEvents()
+ {
+#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
+ OnAuthenticationFailed = async ctx =>
+#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
+ {
+ },
+#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
+ OnTokenValidated = async ctx =>
+#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
+ {
+ }
+ };
+ });
+
+ return services;
+ }
+ public static IServiceCollection AddCustomMvc(this IServiceCollection services, IConfiguration configuration)
+ {
+ services.AddOptions();
+ services.Configure(configuration.GetSection("urls"));
+
+ services
+ .AddMvc()
+ .SetCompatibilityVersion(AspNetCore.Mvc.CompatibilityVersion.Version_2_1)
+ ;
+
+ services.AddSwaggerGen(options =>
+ {
+ options.DescribeAllEnumsAsStrings();
+ options.SwaggerDoc("v1", new Info
+ {
+ Title = "Shopping Aggregator for Web Clients",
+ Version = "v1",
+ Description = "Shopping Aggregator for Web Clients",
+ TermsOfService = "Terms Of Service"
+ });
+
+ options.AddSecurityDefinition("oauth2", new OAuth2Scheme
+ {
+ Type = "oauth2",
+ Flow = "implicit",
+ AuthorizationUrl = $"{configuration.GetValue("IdentityUrlExternal")}/connect/authorize",
+ TokenUrl = $"{configuration.GetValue("IdentityUrlExternal")}/connect/token",
+ Scopes = new Dictionary()
+ {
+ { "webshoppingagg", "Shopping Aggregator for Web Clients" }
+ }
+ });
+
+ options.OperationFilter();
+ });
+
+ services.AddCors(options =>
+ {
+ options
+ .AddPolicy(
+ "CorsPolicy",
+ builder =>
+ builder
+ .AllowAnyOrigin()
+ .AllowAnyMethod()
+ .AllowAnyHeader()
+ .AllowCredentials());
+ });
+
+ return services;
+ }
+ public static IServiceCollection AddApplicationServices(this IServiceCollection services)
+ {
+ //register delegating handlers
+ services.AddTransient();
+ services.AddHttpContextAccessor();
+
+ //register http services
+
+ services.AddHttpClient()
+ .AddHttpMessageHandler()
+ .AddPolicyHandler(GetRetryPolicy())
+ .AddPolicyHandler(GetCircuitBreakerPolicy());
+
+ services.AddHttpClient()
+ .AddPolicyHandler(GetRetryPolicy())
+ .AddPolicyHandler(GetCircuitBreakerPolicy());
+
+ services.AddHttpClient()
+ .AddHttpMessageHandler()
+ .AddPolicyHandler(GetRetryPolicy())
+ .AddPolicyHandler(GetCircuitBreakerPolicy());
+
+
+ return services;
+ }
+
+ static IAsyncPolicy GetRetryPolicy()
+ {
+ return HttpPolicyExtensions
+ .HandleTransientHttpError()
+ .OrResult(msg => msg.StatusCode == System.Net.HttpStatusCode.NotFound)
+ .WaitAndRetryAsync(6, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)));
+
+ }
+ static IAsyncPolicy GetCircuitBreakerPolicy()
+ {
+ return HttpPolicyExtensions
+ .HandleTransientHttpError()
+ .CircuitBreakerAsync(5, TimeSpan.FromSeconds(30));
+ }
+ }
}
diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj b/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj
index 7a0f6cc01..7150eb320 100644
--- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj
+++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj
@@ -1,21 +1,23 @@
-
- netcoreapp2.1
- Web.Shopping.HttpAggregator
- Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator
- ..\..\..\docker-compose.dcproj
-
+
+ netcoreapp2.1
+ 2.1.3
+ Web.Shopping.HttpAggregator
+ Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator
+ ..\..\..\docker-compose.dcproj
+ 0890cb23-79b5-408d-9aeb-13e6ff218d71
+
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj
index 5ffc3c9eb..80c1e7035 100644
--- a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj
+++ b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj
@@ -6,10 +6,10 @@
-
-
-
-
+
+
+
+
diff --git a/src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj b/src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj
index ce659345f..6d177205d 100644
--- a/src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj
+++ b/src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj
@@ -13,7 +13,7 @@
-
+
\ No newline at end of file
diff --git a/src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/Microsoft.Extensions.HealthChecks.AzureStorage.csproj b/src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/Microsoft.Extensions.HealthChecks.AzureStorage.csproj
index 844098052..6c282d3b9 100644
--- a/src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/Microsoft.Extensions.HealthChecks.AzureStorage.csproj
+++ b/src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/Microsoft.Extensions.HealthChecks.AzureStorage.csproj
@@ -16,11 +16,11 @@
-
+
-
-
+
+
diff --git a/src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj b/src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj
index 5e63cac75..609ded8cd 100644
--- a/src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj
+++ b/src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj
@@ -9,12 +9,12 @@
-
+
-
+
diff --git a/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj b/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj
index ad891e6bd..bc37e16dc 100644
--- a/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj
+++ b/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/src/Services/Basket/Basket.API/Basket.API.csproj b/src/Services/Basket/Basket.API/Basket.API.csproj
index 36fc95496..746ac9d71 100644
--- a/src/Services/Basket/Basket.API/Basket.API.csproj
+++ b/src/Services/Basket/Basket.API/Basket.API.csproj
@@ -1,36 +1,37 @@
-
- netcoreapp2.1
- $(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
- ..\..\..\..\docker-compose.dcproj
-
+
+ netcoreapp2.1
+ 2.1.3
+ $(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
+ ..\..\..\..\docker-compose.dcproj
+
-
-
- PreserveNewest
-
-
+
+
+ PreserveNewest
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/src/Services/Basket/Basket.API/Dockerfile b/src/Services/Basket/Basket.API/Dockerfile
index 7027cfc2d..b2e124070 100644
--- a/src/Services/Basket/Basket.API/Dockerfile
+++ b/src/Services/Basket/Basket.API/Dockerfile
@@ -1,8 +1,8 @@
-FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
+FROM microsoft/dotnet:2.1.3-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
-FROM microsoft/dotnet:2.1-sdk AS build
+FROM microsoft/dotnet:2.1.401-sdk AS build
WORKDIR /src
COPY . .
WORKDIR /src/src/Services/Basket/Basket.API
diff --git a/src/Services/Basket/Basket.API/Properties/launchSettings.json b/src/Services/Basket/Basket.API/Properties/launchSettings.json
index 60a56b153..f2b851cc1 100644
--- a/src/Services/Basket/Basket.API/Properties/launchSettings.json
+++ b/src/Services/Basket/Basket.API/Properties/launchSettings.json
@@ -14,7 +14,8 @@
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
- }
+ },
+ "use64Bit": true
},
"Microsoft.eShopOnContainers.Services.Basket.API": {
"commandName": "Project",
diff --git a/src/Services/Basket/Basket.API/Startup.cs b/src/Services/Basket/Basket.API/Startup.cs
index 7d65ba8b4..874bade77 100644
--- a/src/Services/Basket/Basket.API/Startup.cs
+++ b/src/Services/Basket/Basket.API/Startup.cs
@@ -34,281 +34,283 @@ using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Services.Basket.API
{
- public class Startup
- {
- public Startup(IConfiguration configuration)
- {
- Configuration = configuration;
- }
-
- public IConfiguration Configuration { get; }
-
-
- // This method gets called by the runtime. Use this method to add services to the container.
- public IServiceProvider ConfigureServices(IServiceCollection services)
- {
- RegisterAppInsights(services);
-
- // Add framework services.
- services.AddMvc(options =>
- {
- options.Filters.Add(typeof(HttpGlobalExceptionFilter));
- options.Filters.Add(typeof(ValidateModelStateFilter));
-
- }).AddControllersAsServices();
-
- ConfigureAuthService(services);
-
- services.AddHealthChecks(checks =>
- {
- checks.AddValueTaskCheck("HTTP Endpoint", () => new ValueTask(HealthCheckResult.Healthy("Ok")),
- TimeSpan.Zero //No cache for this HealthCheck, better just for demos
- );
- });
-
- services.Configure(Configuration);
-
- //By connecting here we are making sure that our service
- //cannot start until redis is ready. This might slow down startup,
- //but given that there is a delay on resolving the ip address
- //and then creating the connection it seems reasonable to move
- //that cost to startup instead of having the first request pay the
- //penalty.
- services.AddSingleton(sp =>
- {
- var settings = sp.GetRequiredService>().Value;
- var configuration = ConfigurationOptions.Parse(settings.ConnectionString, true);
-
- configuration.ResolveDns = true;
-
- return ConnectionMultiplexer.Connect(configuration);
- });
-
-
- if (Configuration.GetValue("AzureServiceBusEnabled"))
- {
- services.AddSingleton(sp =>
- {
- var logger = sp.GetRequiredService>();
-
- var serviceBusConnectionString = Configuration["EventBusConnection"];
- var serviceBusConnection = new ServiceBusConnectionStringBuilder(serviceBusConnectionString);
-
- return new DefaultServiceBusPersisterConnection(serviceBusConnection, logger);
- });
- }
- else
- {
- services.AddSingleton(sp =>
- {
- var logger = sp.GetRequiredService>();
-
- var factory = new ConnectionFactory()
- {
- HostName = Configuration["EventBusConnection"]
- };
-
- if (!string.IsNullOrEmpty(Configuration["EventBusUserName"]))
- {
- factory.UserName = Configuration["EventBusUserName"];
- }
-
- if (!string.IsNullOrEmpty(Configuration["EventBusPassword"]))
- {
- factory.Password = Configuration["EventBusPassword"];
- }
-
- var retryCount = 5;
- if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"]))
- {
- retryCount = int.Parse(Configuration["EventBusRetryCount"]);
- }
-
- return new DefaultRabbitMQPersistentConnection(factory, logger, retryCount);
- });
- }
-
- RegisterEventBus(services);
-
- services.AddSwaggerGen(options =>
- {
- options.DescribeAllEnumsAsStrings();
- options.SwaggerDoc("v1", new Info
- {
- Title = "Basket HTTP API",
- Version = "v1",
- Description = "The Basket Service HTTP API",
- TermsOfService = "Terms Of Service"
- });
-
- options.AddSecurityDefinition("oauth2", new OAuth2Scheme
- {
- Type = "oauth2",
- Flow = "implicit",
- AuthorizationUrl = $"{Configuration.GetValue("IdentityUrlExternal")}/connect/authorize",
- TokenUrl = $"{Configuration.GetValue("IdentityUrlExternal")}/connect/token",
- Scopes = new Dictionary()
- {
- { "basket", "Basket API" }
- }
- });
-
- options.OperationFilter();
- });
-
- services.AddCors(options =>
- {
- options.AddPolicy("CorsPolicy",
- builder => builder.AllowAnyOrigin()
- .AllowAnyMethod()
- .AllowAnyHeader()
- .AllowCredentials());
- });
- services.AddSingleton();
- services.AddTransient();
- services.AddTransient();
-
- services.AddOptions();
-
- var container = new ContainerBuilder();
- container.Populate(services);
-
- return new AutofacServiceProvider(container.Build());
- }
-
-
- // 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.AddAzureWebAppDiagnostics();
- loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace);
-
- var pathBase = Configuration["PATH_BASE"];
- if (!string.IsNullOrEmpty(pathBase))
- {
- app.UsePathBase(pathBase);
- }
+ public class Startup
+ {
+ public Startup(IConfiguration configuration)
+ {
+ Configuration = configuration;
+ }
+
+ public IConfiguration Configuration { get; }
+
+
+ // This method gets called by the runtime. Use this method to add services to the container.
+ public IServiceProvider ConfigureServices(IServiceCollection services)
+ {
+ RegisterAppInsights(services);
+
+ // Add framework services.
+ services.AddMvc(options =>
+ {
+ options.Filters.Add(typeof(HttpGlobalExceptionFilter));
+ options.Filters.Add(typeof(ValidateModelStateFilter));
+ })
+ .AddControllersAsServices()
+ .SetCompatibilityVersion(AspNetCore.Mvc.CompatibilityVersion.Version_2_1)
+ ;
+
+ ConfigureAuthService(services);
+
+ services.AddHealthChecks(checks =>
+ {
+ checks.AddValueTaskCheck("HTTP Endpoint", () => new ValueTask(HealthCheckResult.Healthy("Ok")),
+ TimeSpan.Zero //No cache for this HealthCheck, better just for demos
+ );
+ });
+
+ services.Configure(Configuration);
+
+ //By connecting here we are making sure that our service
+ //cannot start until redis is ready. This might slow down startup,
+ //but given that there is a delay on resolving the ip address
+ //and then creating the connection it seems reasonable to move
+ //that cost to startup instead of having the first request pay the
+ //penalty.
+ services.AddSingleton(sp =>
+ {
+ var settings = sp.GetRequiredService>().Value;
+ var configuration = ConfigurationOptions.Parse(settings.ConnectionString, true);
+
+ configuration.ResolveDns = true;
+
+ return ConnectionMultiplexer.Connect(configuration);
+ });
+
+
+ if (Configuration.GetValue("AzureServiceBusEnabled"))
+ {
+ services.AddSingleton(sp =>
+ {
+ var logger = sp.GetRequiredService>();
+
+ var serviceBusConnectionString = Configuration["EventBusConnection"];
+ var serviceBusConnection = new ServiceBusConnectionStringBuilder(serviceBusConnectionString);
+
+ return new DefaultServiceBusPersisterConnection(serviceBusConnection, logger);
+ });
+ }
+ else
+ {
+ services.AddSingleton(sp =>
+ {
+ var logger = sp.GetRequiredService>();
+
+ var factory = new ConnectionFactory()
+ {
+ HostName = Configuration["EventBusConnection"]
+ };
+
+ if (!string.IsNullOrEmpty(Configuration["EventBusUserName"]))
+ {
+ factory.UserName = Configuration["EventBusUserName"];
+ }
+
+ if (!string.IsNullOrEmpty(Configuration["EventBusPassword"]))
+ {
+ factory.Password = Configuration["EventBusPassword"];
+ }
+
+ var retryCount = 5;
+ if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"]))
+ {
+ retryCount = int.Parse(Configuration["EventBusRetryCount"]);
+ }
+
+ return new DefaultRabbitMQPersistentConnection(factory, logger, retryCount);
+ });
+ }
+
+ RegisterEventBus(services);
+
+ services.AddSwaggerGen(options =>
+ {
+ options.DescribeAllEnumsAsStrings();
+ options.SwaggerDoc("v1", new Info
+ {
+ Title = "Basket HTTP API",
+ Version = "v1",
+ Description = "The Basket Service HTTP API",
+ TermsOfService = "Terms Of Service"
+ });
+
+ options.AddSecurityDefinition("oauth2", new OAuth2Scheme
+ {
+ Type = "oauth2",
+ Flow = "implicit",
+ AuthorizationUrl = $"{Configuration.GetValue("IdentityUrlExternal")}/connect/authorize",
+ TokenUrl = $"{Configuration.GetValue("IdentityUrlExternal")}/connect/token",
+ Scopes = new Dictionary()
+ {
+ { "basket", "Basket API" }
+ }
+ });
+
+ options.OperationFilter();
+ });
+
+ services.AddCors(options =>
+ {
+ options.AddPolicy("CorsPolicy",
+ builder => builder.AllowAnyOrigin()
+ .AllowAnyMethod()
+ .AllowAnyHeader()
+ .AllowCredentials());
+ });
+ services.AddSingleton();
+ services.AddTransient();
+ services.AddTransient();
+
+ services.AddOptions();
+
+ var container = new ContainerBuilder();
+ container.Populate(services);
+
+ return new AutofacServiceProvider(container.Build());
+ }
+
+
+ // 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.AddAzureWebAppDiagnostics();
+ loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace);
+
+ var pathBase = Configuration["PATH_BASE"];
+ if (!string.IsNullOrEmpty(pathBase))
+ {
+ app.UsePathBase(pathBase);
+ }
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
- app.Map("/liveness", lapp => lapp.Run(async ctx => ctx.Response.StatusCode = 200));
+ app.Map("/liveness", lapp => lapp.Run(async ctx => ctx.Response.StatusCode = 200));
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
- app.UseStaticFiles();
- app.UseCors("CorsPolicy");
-
- ConfigureAuth(app);
-
- app.UseMvcWithDefaultRoute();
-
- app.UseSwagger()
- .UseSwaggerUI(c =>
- {
- c.SwaggerEndpoint($"{ (!string.IsNullOrEmpty(pathBase) ? pathBase : string.Empty) }/swagger/v1/swagger.json", "Basket.API V1");
- c.OAuthClientId ("basketswaggerui");
- c.OAuthAppName("Basket Swagger UI");
- });
-
- ConfigureEventBus(app);
-
- }
-
- private void RegisterAppInsights(IServiceCollection services)
- {
- services.AddApplicationInsightsTelemetry(Configuration);
- var orchestratorType = Configuration.GetValue("OrchestratorType");
-
- if (orchestratorType?.ToUpper() == "K8S")
- {
- // Enable K8s telemetry initializer
- services.EnableKubernetes();
- }
- if (orchestratorType?.ToUpper() == "SF")
- {
- // Enable SF telemetry initializer
- services.AddSingleton((serviceProvider) =>
- new FabricTelemetryInitializer());
- }
- }
-
- private void ConfigureAuthService(IServiceCollection services)
- {
- // prevent from mapping "sub" claim to nameidentifier.
- JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
-
- var identityUrl = Configuration.GetValue("IdentityUrl");
-
- services.AddAuthentication(options =>
- {
- options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
- options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
-
- }).AddJwtBearer(options =>
- {
- options.Authority = identityUrl;
- options.RequireHttpsMetadata = false;
- options.Audience = "basket";
- });
- }
-
- protected virtual void ConfigureAuth(IApplicationBuilder app)
- {
- if (Configuration.GetValue("UseLoadTest"))
- {
- app.UseMiddleware();
- }
-
- app.UseAuthentication();
- }
-
- private void RegisterEventBus(IServiceCollection services)
- {
- var subscriptionClientName = Configuration["SubscriptionClientName"];
-
- if (Configuration.GetValue("AzureServiceBusEnabled"))
- {
- services.AddSingleton(sp =>
- {
- var serviceBusPersisterConnection = sp.GetRequiredService();
- var iLifetimeScope = sp.GetRequiredService();
- var logger = sp.GetRequiredService>();
- var eventBusSubcriptionsManager = sp.GetRequiredService();
-
- return new EventBusServiceBus(serviceBusPersisterConnection, logger,
- eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope);
- });
- }
- else
- {
- services.AddSingleton(sp =>
- {
- var rabbitMQPersistentConnection = sp.GetRequiredService();
- var iLifetimeScope = sp.GetRequiredService();
- var logger = sp.GetRequiredService>();
- var eventBusSubcriptionsManager = sp.GetRequiredService();
-
- var retryCount = 5;
- if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"]))
- {
- retryCount = int.Parse(Configuration["EventBusRetryCount"]);
- }
-
- return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount);
- });
- }
-
- services.AddSingleton();
-
- services.AddTransient();
- services.AddTransient();
- }
-
- private void ConfigureEventBus(IApplicationBuilder app)
- {
- var eventBus = app.ApplicationServices.GetRequiredService();
-
- eventBus.Subscribe();
- eventBus.Subscribe();
- }
- }
+ app.UseStaticFiles();
+ app.UseCors("CorsPolicy");
+
+ ConfigureAuth(app);
+
+ app.UseMvcWithDefaultRoute();
+
+ app.UseSwagger()
+ .UseSwaggerUI(c =>
+ {
+ c.SwaggerEndpoint($"{ (!string.IsNullOrEmpty(pathBase) ? pathBase : string.Empty) }/swagger/v1/swagger.json", "Basket.API V1");
+ c.OAuthClientId("basketswaggerui");
+ c.OAuthAppName("Basket Swagger UI");
+ });
+
+ ConfigureEventBus(app);
+
+ }
+
+ private void RegisterAppInsights(IServiceCollection services)
+ {
+ services.AddApplicationInsightsTelemetry(Configuration);
+ var orchestratorType = Configuration.GetValue("OrchestratorType");
+
+ if (orchestratorType?.ToUpper() == "K8S")
+ {
+ // Enable K8s telemetry initializer
+ services.EnableKubernetes();
+ }
+ if (orchestratorType?.ToUpper() == "SF")
+ {
+ // Enable SF telemetry initializer
+ services.AddSingleton((serviceProvider) =>
+ new FabricTelemetryInitializer());
+ }
+ }
+
+ private void ConfigureAuthService(IServiceCollection services)
+ {
+ // prevent from mapping "sub" claim to nameidentifier.
+ JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
+
+ var identityUrl = Configuration.GetValue("IdentityUrl");
+
+ services.AddAuthentication(options =>
+ {
+ options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
+ options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
+
+ }).AddJwtBearer(options =>
+ {
+ options.Authority = identityUrl;
+ options.RequireHttpsMetadata = false;
+ options.Audience = "basket";
+ });
+ }
+
+ protected virtual void ConfigureAuth(IApplicationBuilder app)
+ {
+ if (Configuration.GetValue("UseLoadTest"))
+ {
+ app.UseMiddleware();
+ }
+
+ app.UseAuthentication();
+ }
+
+ private void RegisterEventBus(IServiceCollection services)
+ {
+ var subscriptionClientName = Configuration["SubscriptionClientName"];
+
+ if (Configuration.GetValue("AzureServiceBusEnabled"))
+ {
+ services.AddSingleton(sp =>
+ {
+ var serviceBusPersisterConnection = sp.GetRequiredService();
+ var iLifetimeScope = sp.GetRequiredService();
+ var logger = sp.GetRequiredService>();
+ var eventBusSubcriptionsManager = sp.GetRequiredService();
+
+ return new EventBusServiceBus(serviceBusPersisterConnection, logger,
+ eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope);
+ });
+ }
+ else
+ {
+ services.AddSingleton(sp =>
+ {
+ var rabbitMQPersistentConnection = sp.GetRequiredService();
+ var iLifetimeScope = sp.GetRequiredService();
+ var logger = sp.GetRequiredService>();
+ var eventBusSubcriptionsManager = sp.GetRequiredService();
+
+ var retryCount = 5;
+ if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"]))
+ {
+ retryCount = int.Parse(Configuration["EventBusRetryCount"]);
+ }
+
+ return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount);
+ });
+ }
+
+ services.AddSingleton();
+
+ services.AddTransient();
+ services.AddTransient();
+ }
+
+ private void ConfigureEventBus(IApplicationBuilder app)
+ {
+ var eventBus = app.ApplicationServices.GetRequiredService();
+
+ eventBus.Subscribe();
+ eventBus.Subscribe();
+ }
+ }
}
diff --git a/src/Services/Basket/Basket.API/appsettings.json b/src/Services/Basket/Basket.API/appsettings.json
index 4bff4d70d..7db3bf6d8 100644
--- a/src/Services/Basket/Basket.API/appsettings.json
+++ b/src/Services/Basket/Basket.API/appsettings.json
@@ -1,24 +1,24 @@
{
- "Logging": {
- "IncludeScopes": false,
- "LogLevel": {
- "Default": "Debug",
- "System": "Information",
- "Microsoft": "Information"
- }
- },
- "IdentityUrl": "http://localhost:5105",
- "ConnectionString": "127.0.0.1",
- "AzureServiceBusEnabled": false,
- "SubscriptionClientName": "Basket",
- "ApplicationInsights": {
- "InstrumentationKey": ""
- },
- "EventBusRetryCount": 5,
- "UseVault": false,
- "Vault": {
- "Name": "eshop",
- "ClientId": "your-clien-id",
- "ClientSecret": "your-client-secret"
- }
+ "Logging": {
+ "IncludeScopes": false,
+ "LogLevel": {
+ "Default": "Debug",
+ "System": "Information",
+ "Microsoft": "Information"
+ }
+ },
+ "IdentityUrl": "https://localhost:4105",
+ "ConnectionString": "127.0.0.1",
+ "AzureServiceBusEnabled": false,
+ "SubscriptionClientName": "Basket",
+ "ApplicationInsights": {
+ "InstrumentationKey": ""
+ },
+ "EventBusRetryCount": 5,
+ "UseVault": false,
+ "Vault": {
+ "Name": "eshop",
+ "ClientId": "your-clien-id",
+ "ClientSecret": "your-client-secret"
+ }
}
\ No newline at end of file
diff --git a/src/Services/Catalog/Catalog.API/Catalog.API.csproj b/src/Services/Catalog/Catalog.API/Catalog.API.csproj
index 90abe593a..9aede66bf 100644
--- a/src/Services/Catalog/Catalog.API/Catalog.API.csproj
+++ b/src/Services/Catalog/Catalog.API/Catalog.API.csproj
@@ -35,13 +35,13 @@
-
-
+
+
-
-
-
-
+
+
+
+
diff --git a/src/Services/Catalog/Catalog.API/Dockerfile b/src/Services/Catalog/Catalog.API/Dockerfile
index 4cbc9c8aa..e21218e69 100644
--- a/src/Services/Catalog/Catalog.API/Dockerfile
+++ b/src/Services/Catalog/Catalog.API/Dockerfile
@@ -1,8 +1,8 @@
-FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
+FROM microsoft/dotnet:2.1.3-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
-FROM microsoft/dotnet:2.1-sdk AS build
+FROM microsoft/dotnet:2.1.401-sdk AS build
WORKDIR /src
COPY . .
WORKDIR /src/src/Services/Catalog/Catalog.API
diff --git a/src/Services/Catalog/Catalog.API/Properties/launchSettings.json b/src/Services/Catalog/Catalog.API/Properties/launchSettings.json
index 2b21ca280..658fc7d23 100644
--- a/src/Services/Catalog/Catalog.API/Properties/launchSettings.json
+++ b/src/Services/Catalog/Catalog.API/Properties/launchSettings.json
@@ -14,7 +14,8 @@
"launchUrl": "/swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
- }
+ },
+ "use64Bit": true
},
"Microsoft.eShopOnContainers.Services.Catalog.API": {
"commandName": "Project",
diff --git a/src/Services/Catalog/Catalog.API/Startup.cs b/src/Services/Catalog/Catalog.API/Startup.cs
index 408f870af..91c5a5ad2 100644
--- a/src/Services/Catalog/Catalog.API/Startup.cs
+++ b/src/Services/Catalog/Catalog.API/Startup.cs
@@ -32,299 +32,302 @@ using System.Reflection;
namespace Microsoft.eShopOnContainers.Services.Catalog.API
{
- public class Startup
- {
- public Startup(IConfiguration configuration)
- {
- Configuration = configuration;
- }
-
- public IConfiguration Configuration { get; }
-
- public IServiceProvider ConfigureServices(IServiceCollection services)
- {
- services.AddAppInsight(Configuration)
- .AddCustomMVC(Configuration)
- .AddCustomDbContext(Configuration)
- .AddCustomOptions(Configuration)
- .AddIntegrationServices(Configuration)
- .AddEventBus(Configuration)
- .AddSwagger();
-
- var container = new ContainerBuilder();
- container.Populate(services);
- return new AutofacServiceProvider(container.Build());
-
- }
-
- public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
- {
- //Configure logs
-
- loggerFactory.AddAzureWebAppDiagnostics();
- loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace);
-
- var pathBase = Configuration["PATH_BASE"];
-
- if (!string.IsNullOrEmpty(pathBase))
- {
- loggerFactory.CreateLogger("init").LogDebug($"Using PATH BASE '{pathBase}'");
- app.UsePathBase(pathBase);
- }
+ public class Startup
+ {
+ public Startup(IConfiguration configuration)
+ {
+ Configuration = configuration;
+ }
+
+ public IConfiguration Configuration { get; }
+
+ public IServiceProvider ConfigureServices(IServiceCollection services)
+ {
+ services.AddAppInsight(Configuration)
+ .AddCustomMVC(Configuration)
+ .AddCustomDbContext(Configuration)
+ .AddCustomOptions(Configuration)
+ .AddIntegrationServices(Configuration)
+ .AddEventBus(Configuration)
+ .AddSwagger();
+
+ var container = new ContainerBuilder();
+ container.Populate(services);
+ return new AutofacServiceProvider(container.Build());
+
+ }
+
+ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
+ {
+ //Configure logs
+
+ loggerFactory.AddAzureWebAppDiagnostics();
+ loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace);
+
+ var pathBase = Configuration["PATH_BASE"];
+
+ if (!string.IsNullOrEmpty(pathBase))
+ {
+ loggerFactory.CreateLogger("init").LogDebug($"Using PATH BASE '{pathBase}'");
+ app.UsePathBase(pathBase);
+ }
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
- app.Map("/liveness", lapp => lapp.Run(async ctx => ctx.Response.StatusCode = 200));
+ app.Map("/liveness", lapp => lapp.Run(async ctx => ctx.Response.StatusCode = 200));
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
- app.UseCors("CorsPolicy");
-
- app.UseMvcWithDefaultRoute();
-
- app.UseSwagger()
- .UseSwaggerUI(c =>
- {
- c.SwaggerEndpoint($"{ (!string.IsNullOrEmpty(pathBase) ? pathBase : string.Empty) }/swagger/v1/swagger.json", "Catalog.API V1");
- });
-
- ConfigureEventBus(app);
- }
-
- protected virtual void ConfigureEventBus(IApplicationBuilder app)
- {
- var eventBus = app.ApplicationServices.GetRequiredService();
- eventBus.Subscribe();
- eventBus.Subscribe();
- }
- }
-
- public static class CustomExtensionMethods
- {
- public static IServiceCollection AddAppInsight(this IServiceCollection services, IConfiguration configuration)
- {
- services.AddApplicationInsightsTelemetry(configuration);
- var orchestratorType = configuration.GetValue("OrchestratorType");
-
- if (orchestratorType?.ToUpper() == "K8S")
- {
- // Enable K8s telemetry initializer
- services.EnableKubernetes();
- }
- if (orchestratorType?.ToUpper() == "SF")
- {
- // Enable SF telemetry initializer
- services.AddSingleton((serviceProvider) =>
- new FabricTelemetryInitializer());
- }
-
- return services;
- }
-
- public static IServiceCollection AddCustomMVC(this IServiceCollection services, IConfiguration configuration)
- {
- services.AddHealthChecks(checks =>
- {
- var minutes = 1;
- if (int.TryParse(configuration["HealthCheck:Timeout"], out var minutesParsed))
- {
- minutes = minutesParsed;
- }
- checks.AddSqlCheck("CatalogDb", configuration["ConnectionString"], TimeSpan.FromMinutes(minutes));
-
- var accountName = configuration.GetValue("AzureStorageAccountName");
- var accountKey = configuration.GetValue("AzureStorageAccountKey");
- if (!string.IsNullOrEmpty(accountName) && !string.IsNullOrEmpty(accountKey))
- {
- checks.AddAzureBlobStorageCheck(accountName, accountKey);
- }
- });
-
- services.AddMvc(options =>
- {
- options.Filters.Add(typeof(HttpGlobalExceptionFilter));
- }).AddControllersAsServices();
-
- services.AddCors(options =>
- {
- options.AddPolicy("CorsPolicy",
- builder => builder.AllowAnyOrigin()
- .AllowAnyMethod()
- .AllowAnyHeader()
- .AllowCredentials());
- });
-
- return services;
- }
-
- public static IServiceCollection AddCustomDbContext(this IServiceCollection services, IConfiguration configuration)
- {
- services.AddDbContext(options =>
- {
- options.UseSqlServer(configuration["ConnectionString"],
- sqlServerOptionsAction: sqlOptions =>
- {
- sqlOptions.MigrationsAssembly(typeof(Startup).GetTypeInfo().Assembly.GetName().Name);
- //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
- sqlOptions.EnableRetryOnFailure(maxRetryCount: 10, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
- });
-
- // Changing default behavior when client evaluation occurs to throw.
- // Default in EF Core would be to log a warning when client evaluation is performed.
- options.ConfigureWarnings(warnings => warnings.Throw(RelationalEventId.QueryClientEvaluationWarning));
- //Check Client vs. Server evaluation: https://docs.microsoft.com/en-us/ef/core/querying/client-eval
- });
-
- services.AddDbContext(options =>
- {
- options.UseSqlServer(configuration["ConnectionString"],
- sqlServerOptionsAction: sqlOptions =>
- {
- sqlOptions.MigrationsAssembly(typeof(Startup).GetTypeInfo().Assembly.GetName().Name);
- //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
- sqlOptions.EnableRetryOnFailure(maxRetryCount: 10, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
- });
- });
-
- return services;
- }
-
- public static IServiceCollection AddCustomOptions(this IServiceCollection services, IConfiguration configuration)
- {
- services.Configure(configuration);
- services.Configure(options =>
- {
- options.InvalidModelStateResponseFactory = context =>
- {
- var problemDetails = new ValidationProblemDetails(context.ModelState)
- {
- Instance = context.HttpContext.Request.Path,
- Status = StatusCodes.Status400BadRequest,
- Detail = "Please refer to the errors property for additional details."
- };
-
- return new BadRequestObjectResult(problemDetails)
- {
- ContentTypes = { "application/problem+json", "application/problem+xml" }
- };
- };
- });
-
- return services;
- }
-
- public static IServiceCollection AddSwagger(this IServiceCollection services)
- {
- services.AddSwaggerGen(options =>
- {
- options.DescribeAllEnumsAsStrings();
- options.SwaggerDoc("v1", new Swashbuckle.AspNetCore.Swagger.Info
- {
- Title = "eShopOnContainers - Catalog HTTP API",
- Version = "v1",
- Description = "The Catalog Microservice HTTP API. This is a Data-Driven/CRUD microservice sample",
- TermsOfService = "Terms Of Service"
- });
- });
-
- return services;
-
- }
-
- public static IServiceCollection AddIntegrationServices(this IServiceCollection services, IConfiguration configuration)
- {
- services.AddTransient>(
- sp => (DbConnection c) => new IntegrationEventLogService(c));
-
- services.AddTransient();
-
- if (configuration.GetValue("AzureServiceBusEnabled"))
- {
- services.AddSingleton(sp =>
- {
- var settings = sp.GetRequiredService>().Value;
- var logger = sp.GetRequiredService>();
-
- var serviceBusConnection = new ServiceBusConnectionStringBuilder(settings.EventBusConnection);
-
- return new DefaultServiceBusPersisterConnection(serviceBusConnection, logger);
- });
- }
- else
- {
- services.AddSingleton(sp =>
- {
- var settings = sp.GetRequiredService>().Value;
- var logger = sp.GetRequiredService>();
-
- var factory = new ConnectionFactory()
- {
- HostName = configuration["EventBusConnection"]
- };
-
- if (!string.IsNullOrEmpty(configuration["EventBusUserName"]))
- {
- factory.UserName = configuration["EventBusUserName"];
- }
-
- if (!string.IsNullOrEmpty(configuration["EventBusPassword"]))
- {
- factory.Password = configuration["EventBusPassword"];
- }
-
- var retryCount = 5;
- if (!string.IsNullOrEmpty(configuration["EventBusRetryCount"]))
- {
- retryCount = int.Parse(configuration["EventBusRetryCount"]);
- }
-
- return new DefaultRabbitMQPersistentConnection(factory, logger, retryCount);
- });
- }
-
- return services;
- }
-
- public static IServiceCollection AddEventBus(this IServiceCollection services, IConfiguration configuration)
- {
- var subscriptionClientName = configuration["SubscriptionClientName"];
-
- if (configuration.GetValue("AzureServiceBusEnabled"))
- {
- services.AddSingleton(sp =>
- {
- var serviceBusPersisterConnection = sp.GetRequiredService();
- var iLifetimeScope = sp.GetRequiredService();
- var logger = sp.GetRequiredService>();
- var eventBusSubcriptionsManager = sp.GetRequiredService();
-
- return new EventBusServiceBus(serviceBusPersisterConnection, logger,
- eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope);
- });
-
- }
- else
- {
- services.AddSingleton(sp =>
- {
- var rabbitMQPersistentConnection = sp.GetRequiredService();
- var iLifetimeScope = sp.GetRequiredService();
- var logger = sp.GetRequiredService>();
- var eventBusSubcriptionsManager = sp.GetRequiredService();
-
- var retryCount = 5;
- if (!string.IsNullOrEmpty(configuration["EventBusRetryCount"]))
- {
- retryCount = int.Parse(configuration["EventBusRetryCount"]);
- }
-
- return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount);
- });
- }
-
- services.AddSingleton();
- services.AddTransient();
- services.AddTransient();
-
- return services;
- }
- }
+ app.UseCors("CorsPolicy");
+
+ app.UseMvcWithDefaultRoute();
+
+ app.UseSwagger()
+ .UseSwaggerUI(c =>
+ {
+ c.SwaggerEndpoint($"{ (!string.IsNullOrEmpty(pathBase) ? pathBase : string.Empty) }/swagger/v1/swagger.json", "Catalog.API V1");
+ });
+
+ ConfigureEventBus(app);
+ }
+
+ protected virtual void ConfigureEventBus(IApplicationBuilder app)
+ {
+ var eventBus = app.ApplicationServices.GetRequiredService();
+ eventBus.Subscribe();
+ eventBus.Subscribe();
+ }
+ }
+
+ public static class CustomExtensionMethods
+ {
+ public static IServiceCollection AddAppInsight(this IServiceCollection services, IConfiguration configuration)
+ {
+ services.AddApplicationInsightsTelemetry(configuration);
+ var orchestratorType = configuration.GetValue("OrchestratorType");
+
+ if (orchestratorType?.ToUpper() == "K8S")
+ {
+ // Enable K8s telemetry initializer
+ services.EnableKubernetes();
+ }
+ if (orchestratorType?.ToUpper() == "SF")
+ {
+ // Enable SF telemetry initializer
+ services.AddSingleton((serviceProvider) =>
+ new FabricTelemetryInitializer());
+ }
+
+ return services;
+ }
+
+ public static IServiceCollection AddCustomMVC(this IServiceCollection services, IConfiguration configuration)
+ {
+ services.AddHealthChecks(checks =>
+ {
+ var minutes = 1;
+ if (int.TryParse(configuration["HealthCheck:Timeout"], out int minutesParsed))
+ {
+ minutes = minutesParsed;
+ }
+ checks.AddSqlCheck("CatalogDb", configuration["ConnectionString"], TimeSpan.FromMinutes(minutes));
+
+ var accountName = configuration.GetValue("AzureStorageAccountName");
+ var accountKey = configuration.GetValue("AzureStorageAccountKey");
+ if (!string.IsNullOrEmpty(accountName) && !string.IsNullOrEmpty(accountKey))
+ {
+ checks.AddAzureBlobStorageCheck(accountName, accountKey);
+ }
+ });
+
+ services.AddMvc(options =>
+ {
+ options.Filters.Add(typeof(HttpGlobalExceptionFilter));
+ })
+ .AddControllersAsServices()
+ .SetCompatibilityVersion(CompatibilityVersion.Version_2_1)
+ ;
+
+ services.AddCors(options =>
+ {
+ options.AddPolicy("CorsPolicy",
+ builder => builder.AllowAnyOrigin()
+ .AllowAnyMethod()
+ .AllowAnyHeader()
+ .AllowCredentials());
+ });
+
+ return services;
+ }
+
+ public static IServiceCollection AddCustomDbContext(this IServiceCollection services, IConfiguration configuration)
+ {
+ services.AddDbContext(options =>
+ {
+ options.UseSqlServer(configuration["ConnectionString"],
+ sqlServerOptionsAction: sqlOptions =>
+ {
+ sqlOptions.MigrationsAssembly(typeof(Startup).GetTypeInfo().Assembly.GetName().Name);
+ //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
+ sqlOptions.EnableRetryOnFailure(maxRetryCount: 10, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
+ });
+
+ // Changing default behavior when client evaluation occurs to throw.
+ // Default in EF Core would be to log a warning when client evaluation is performed.
+ options.ConfigureWarnings(warnings => warnings.Throw(RelationalEventId.QueryClientEvaluationWarning));
+ //Check Client vs. Server evaluation: https://docs.microsoft.com/en-us/ef/core/querying/client-eval
+ });
+
+ services.AddDbContext(options =>
+ {
+ options.UseSqlServer(configuration["ConnectionString"],
+ sqlServerOptionsAction: sqlOptions =>
+ {
+ sqlOptions.MigrationsAssembly(typeof(Startup).GetTypeInfo().Assembly.GetName().Name);
+ //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
+ sqlOptions.EnableRetryOnFailure(maxRetryCount: 10, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
+ });
+ });
+
+ return services;
+ }
+
+ public static IServiceCollection AddCustomOptions(this IServiceCollection services, IConfiguration configuration)
+ {
+ services.Configure(configuration);
+ services.Configure(options =>
+ {
+ options.InvalidModelStateResponseFactory = context =>
+ {
+ var problemDetails = new ValidationProblemDetails(context.ModelState)
+ {
+ Instance = context.HttpContext.Request.Path,
+ Status = StatusCodes.Status400BadRequest,
+ Detail = "Please refer to the errors property for additional details."
+ };
+
+ return new BadRequestObjectResult(problemDetails)
+ {
+ ContentTypes = { "application/problem+json", "application/problem+xml" }
+ };
+ };
+ });
+
+ return services;
+ }
+
+ public static IServiceCollection AddSwagger(this IServiceCollection services)
+ {
+ services.AddSwaggerGen(options =>
+ {
+ options.DescribeAllEnumsAsStrings();
+ options.SwaggerDoc("v1", new Swashbuckle.AspNetCore.Swagger.Info
+ {
+ Title = "eShopOnContainers - Catalog HTTP API",
+ Version = "v1",
+ Description = "The Catalog Microservice HTTP API. This is a Data-Driven/CRUD microservice sample",
+ TermsOfService = "Terms Of Service"
+ });
+ });
+
+ return services;
+
+ }
+
+ public static IServiceCollection AddIntegrationServices(this IServiceCollection services, IConfiguration configuration)
+ {
+ services.AddTransient>(
+ sp => (DbConnection c) => new IntegrationEventLogService(c));
+
+ services.AddTransient();
+
+ if (configuration.GetValue("AzureServiceBusEnabled"))
+ {
+ services.AddSingleton(sp =>
+ {
+ var settings = sp.GetRequiredService>().Value;
+ var logger = sp.GetRequiredService>();
+
+ var serviceBusConnection = new ServiceBusConnectionStringBuilder(settings.EventBusConnection);
+
+ return new DefaultServiceBusPersisterConnection(serviceBusConnection, logger);
+ });
+ }
+ else
+ {
+ services.AddSingleton(sp =>
+ {
+ var settings = sp.GetRequiredService>().Value;
+ var logger = sp.GetRequiredService>();
+
+ var factory = new ConnectionFactory()
+ {
+ HostName = configuration["EventBusConnection"]
+ };
+
+ if (!string.IsNullOrEmpty(configuration["EventBusUserName"]))
+ {
+ factory.UserName = configuration["EventBusUserName"];
+ }
+
+ if (!string.IsNullOrEmpty(configuration["EventBusPassword"]))
+ {
+ factory.Password = configuration["EventBusPassword"];
+ }
+
+ var retryCount = 5;
+ if (!string.IsNullOrEmpty(configuration["EventBusRetryCount"]))
+ {
+ retryCount = int.Parse(configuration["EventBusRetryCount"]);
+ }
+
+ return new DefaultRabbitMQPersistentConnection(factory, logger, retryCount);
+ });
+ }
+
+ return services;
+ }
+
+ public static IServiceCollection AddEventBus(this IServiceCollection services, IConfiguration configuration)
+ {
+ var subscriptionClientName = configuration["SubscriptionClientName"];
+
+ if (configuration.GetValue("AzureServiceBusEnabled"))
+ {
+ services.AddSingleton(sp =>
+ {
+ var serviceBusPersisterConnection = sp.GetRequiredService();
+ var iLifetimeScope = sp.GetRequiredService();
+ var logger = sp.GetRequiredService>();
+ var eventBusSubcriptionsManager = sp.GetRequiredService();
+
+ return new EventBusServiceBus(serviceBusPersisterConnection, logger,
+ eventBusSubcriptionsManager, subscriptionClientName, iLifetimeScope);
+ });
+
+ }
+ else
+ {
+ services.AddSingleton(sp =>
+ {
+ var rabbitMQPersistentConnection = sp.GetRequiredService();
+ var iLifetimeScope = sp.GetRequiredService();
+ var logger = sp.GetRequiredService>();
+ var eventBusSubcriptionsManager = sp.GetRequiredService();
+
+ var retryCount = 5;
+ if (!string.IsNullOrEmpty(configuration["EventBusRetryCount"]))
+ {
+ retryCount = int.Parse(configuration["EventBusRetryCount"]);
+ }
+
+ return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount);
+ });
+ }
+
+ services.AddSingleton();
+ services.AddTransient();
+ services.AddTransient();
+
+ return services;
+ }
+ }
}
diff --git a/src/Services/Identity/Identity.API/.bowerrc b/src/Services/Identity/Identity.API/.bowerrc
deleted file mode 100644
index 6406626ab..000000000
--- a/src/Services/Identity/Identity.API/.bowerrc
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "directory": "wwwroot/lib"
-}
diff --git a/src/Services/Identity/Identity.API/Dockerfile b/src/Services/Identity/Identity.API/Dockerfile
index 3931a135b..7656ef331 100644
--- a/src/Services/Identity/Identity.API/Dockerfile
+++ b/src/Services/Identity/Identity.API/Dockerfile
@@ -1,9 +1,10 @@
ARG NODE_IMAGE=node:8.11
-FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
+FROM microsoft/dotnet:2.1.3-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
+EXPOSE 443
-FROM microsoft/dotnet:2.1-sdk as dotnet-build
+FROM microsoft/dotnet:2.1.401-sdk as dotnet-build
WORKDIR /src
FROM ${NODE_IMAGE} as node-build
@@ -16,6 +17,7 @@ FROM dotnet-build as build
WORKDIR /src/src/Services/Identity/Identity.API/wwwroot
COPY --from=node-build /web/wwwroot .
WORKDIR /src
+COPY src/Services/Identity/Identity.API/Setup/eShopOnContainers.pfx /root/.aspnet/https/
COPY . .
WORKDIR /src/src/Services/Identity/Identity.API
RUN dotnet restore -nowarn:msb3202,nu1503
diff --git a/src/Services/Identity/Identity.API/Identity.API.csproj b/src/Services/Identity/Identity.API/Identity.API.csproj
index 96a45e5ef..4c41b555e 100644
--- a/src/Services/Identity/Identity.API/Identity.API.csproj
+++ b/src/Services/Identity/Identity.API/Identity.API.csproj
@@ -1,59 +1,66 @@
-
- netcoreapp2.1
- aspnet-eShopOnContainers.Identity-90487118-103c-4ff0-b9da-e5e26f7ab0c5
- ..\..\..\..\docker-compose.dcproj
-
-
-
-
- PreserveNewest
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PreserveNewest
-
-
-
-
-
-
+
+ netcoreapp2.1
+ 2.1.3
+ aspnet-eShopOnContainers.Identity-90487118-103c-4ff0-b9da-e5e26f7ab0c5
+ ..\..\..\..\docker-compose.dcproj
+
+
+
+
+ PreserveNewest
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PreserveNewest
+
+
+
+
+
+
diff --git a/src/Services/Identity/Identity.API/Properties/launchSettings.json b/src/Services/Identity/Identity.API/Properties/launchSettings.json
index e52e9f99c..a0a287770 100644
--- a/src/Services/Identity/Identity.API/Properties/launchSettings.json
+++ b/src/Services/Identity/Identity.API/Properties/launchSettings.json
@@ -3,8 +3,8 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
- "applicationUrl": "http://localhost:54010/",
- "sslPort": 0
+ "applicationUrl": "http://localhost:5105/",
+ "sslPort": 4105
}
},
"profiles": {
@@ -14,7 +14,8 @@
"launchUrl": "http://localhost:55105",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
- }
+ },
+ "use64Bit": true
},
"eShopOnContainers.Identity": {
"commandName": "Project",
diff --git a/src/Services/Identity/Identity.API/Setup/DotNet Foundation CA.pfx b/src/Services/Identity/Identity.API/Setup/DotNet Foundation CA.pfx
new file mode 100644
index 000000000..67ce2e415
Binary files /dev/null and b/src/Services/Identity/Identity.API/Setup/DotNet Foundation CA.pfx differ
diff --git a/src/Services/Identity/Identity.API/Setup/eShopOnContainers.pfx b/src/Services/Identity/Identity.API/Setup/eShopOnContainers.pfx
new file mode 100644
index 000000000..c5962c1c2
Binary files /dev/null and b/src/Services/Identity/Identity.API/Setup/eShopOnContainers.pfx differ
diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs
index 255bb82b5..d4943033d 100644
--- a/src/Services/Identity/Identity.API/Startup.cs
+++ b/src/Services/Identity/Identity.API/Startup.cs
@@ -22,163 +22,177 @@ using System.Reflection;
namespace Microsoft.eShopOnContainers.Services.Identity.API
{
- public class Startup
- {
- public Startup(IConfiguration configuration)
- {
- Configuration = configuration;
- }
-
- public IConfiguration Configuration { get; }
-
- // This method gets called by the runtime. Use this method to add services to the container.
- public IServiceProvider ConfigureServices(IServiceCollection services)
- {
- RegisterAppInsights(services);
-
- // Add framework services.
- services.AddDbContext(options =>
- options.UseSqlServer(Configuration["ConnectionString"],
- sqlServerOptionsAction: sqlOptions =>
- {
- sqlOptions.MigrationsAssembly(typeof(Startup).GetTypeInfo().Assembly.GetName().Name);
- //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
- sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
- }));
-
- services.AddIdentity()
- .AddEntityFrameworkStores()
- .AddDefaultTokenProviders();
-
- services.Configure(Configuration);
-
- services.AddMvc();
-
- if (Configuration.GetValue("IsClusterEnv") == bool.TrueString)
- {
- services.AddDataProtection(opts =>
- {
- opts.ApplicationDiscriminator = "eshop.identity";
- })
- .PersistKeysToRedis(ConnectionMultiplexer.Connect(Configuration["DPConnectionString"]), "DataProtection-Keys");
- }
-
- services.AddHealthChecks(checks =>
- {
- var minutes = 1;
- if (int.TryParse(Configuration["HealthCheck:Timeout"], out var minutesParsed))
- {
- minutes = minutesParsed;
- }
- checks.AddSqlCheck("Identity_Db", Configuration["ConnectionString"], TimeSpan.FromMinutes(minutes));
- });
-
- services.AddTransient, EFLoginService>();
- services.AddTransient();
-
- var connectionString = Configuration["ConnectionString"];
- var migrationsAssembly = typeof(Startup).GetTypeInfo().Assembly.GetName().Name;
-
- // Adds IdentityServer
- services.AddIdentityServer(x => x.IssuerUri = "null")
- .AddSigningCredential(Certificate.Get())
- .AddAspNetIdentity()
- .AddConfigurationStore(options =>
- {
- options.ConfigureDbContext = builder => builder.UseSqlServer(connectionString,
- sqlServerOptionsAction: sqlOptions =>
- {
- sqlOptions.MigrationsAssembly(migrationsAssembly);
- //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
- sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
- });
- })
- .AddOperationalStore(options =>
- {
- options.ConfigureDbContext = builder => builder.UseSqlServer(connectionString,
- sqlServerOptionsAction: sqlOptions =>
- {
- sqlOptions.MigrationsAssembly(migrationsAssembly);
- //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
- sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
- });
- })
- .Services.AddTransient();
-
- var container = new ContainerBuilder();
- container.Populate(services);
-
- return new AutofacServiceProvider(container.Build());
- }
-
- // 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();
- loggerFactory.AddAzureWebAppDiagnostics();
- loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace);
-
- if (env.IsDevelopment())
- {
- app.UseDeveloperExceptionPage();
- app.UseDatabaseErrorPage();
- }
- else
- {
- app.UseExceptionHandler("/Home/Error");
- }
-
- var pathBase = Configuration["PATH_BASE"];
- if (!string.IsNullOrEmpty(pathBase))
- {
- loggerFactory.CreateLogger("init").LogDebug($"Using PATH BASE '{pathBase}'");
- app.UsePathBase(pathBase);
- }
+ public class Startup
+ {
+ public Startup(IConfiguration configuration)
+ {
+ Configuration = configuration;
+ }
+
+ public IConfiguration Configuration { get; }
+
+ // This method gets called by the runtime. Use this method to add services to the container.
+ public IServiceProvider ConfigureServices(IServiceCollection services)
+ {
+ RegisterAppInsights(services);
+
+ // Add framework services.
+ services.AddDbContext(options =>
+ options.UseSqlServer(Configuration["ConnectionString"],
+ sqlServerOptionsAction: sqlOptions =>
+ {
+ sqlOptions.MigrationsAssembly(typeof(Startup).GetTypeInfo().Assembly.GetName().Name);
+ //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
+ sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
+ }));
+
+ services.AddIdentity()
+ .AddEntityFrameworkStores()
+ .AddDefaultTokenProviders();
+
+ services.Configure(Configuration);
+
+ services
+ .AddMvc(opts=>
+ {
+ opts.SslPort = 4105;
+ opts.RequireHttpsPermanent = true;
+ })
+ .SetCompatibilityVersion(AspNetCore.Mvc.CompatibilityVersion.Version_2_1)
+ ;
+
+ if (Configuration.GetValue("IsClusterEnv") == bool.TrueString)
+ {
+ services.AddDataProtection(opts =>
+ {
+ opts.ApplicationDiscriminator = "eshop.identity";
+ })
+ .PersistKeysToRedis(ConnectionMultiplexer.Connect(Configuration["DPConnectionString"]), "DataProtection-Keys");
+ }
+
+ services.AddHealthChecks(checks =>
+ {
+ int minutes = 1;
+ if (int.TryParse(Configuration["HealthCheck:Timeout"], out int minutesParsed))
+ {
+ minutes = minutesParsed;
+ }
+ checks.AddSqlCheck("Identity_Db", Configuration["ConnectionString"], TimeSpan.FromMinutes(minutes));
+ });
+
+ services.AddTransient, EFLoginService>();
+ services.AddTransient();
+
+ string connectionString = Configuration["ConnectionString"];
+ string migrationsAssembly = typeof(Startup).GetTypeInfo().Assembly.GetName().Name;
+
+ // Adds IdentityServer
+ services.AddIdentityServer(x => x.IssuerUri = "null")
+ .AddSigningCredential(Certificate.Get())
+ .AddAspNetIdentity()
+ .AddConfigurationStore(options =>
+ {
+ options.ConfigureDbContext = builder => builder.UseSqlServer(connectionString,
+ sqlServerOptionsAction: sqlOptions =>
+ {
+ sqlOptions.MigrationsAssembly(migrationsAssembly);
+ //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
+ sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
+ });
+ })
+ .AddOperationalStore(options =>
+ {
+ options.ConfigureDbContext = builder => builder.UseSqlServer(connectionString,
+ sqlServerOptionsAction: sqlOptions =>
+ {
+ sqlOptions.MigrationsAssembly(migrationsAssembly);
+ //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency
+ sqlOptions.EnableRetryOnFailure(maxRetryCount: 15, maxRetryDelay: TimeSpan.FromSeconds(30), errorNumbersToAdd: null);
+ });
+ })
+ .Services.AddTransient();
+
+ services.AddHttpsRedirection(opts =>
+ {
+ opts.HttpsPort = 4105;
+ });
+
+ ContainerBuilder container = new ContainerBuilder();
+ container.Populate(services);
+
+ return new AutofacServiceProvider(container.Build());
+ }
+
+ // 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();
+ loggerFactory.AddAzureWebAppDiagnostics();
+ loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace);
+
+ if (env.IsDevelopment())
+ {
+ app.UseDeveloperExceptionPage();
+ app.UseDatabaseErrorPage();
+ }
+ else
+ {
+ app.UseExceptionHandler("/Home/Error");
+ app.UseHsts();
+ }
+
+ app.UseHttpsRedirection();
+ string pathBase = Configuration["PATH_BASE"];
+ if (!string.IsNullOrEmpty(pathBase))
+ {
+ loggerFactory.CreateLogger("init").LogDebug($"Using PATH BASE '{pathBase}'");
+ app.UsePathBase(pathBase);
+ }
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
- app.Map("/liveness", lapp => lapp.Run(async ctx => ctx.Response.StatusCode = 200));
+ app.Map("/liveness", lapp => lapp.Run(async ctx => ctx.Response.StatusCode = 200));
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
- app.UseStaticFiles();
-
-
- // Make work identity server redirections in Edge and lastest versions of browers. WARN: Not valid in a production environment.
- app.Use(async (context, next) =>
- {
- context.Response.Headers.Add("Content-Security-Policy", "script-src 'unsafe-inline'");
- await next();
- });
-
- app.UseForwardedHeaders();
- // Adds IdentityServer
- app.UseIdentityServer();
-
- app.UseMvc(routes =>
- {
- routes.MapRoute(
- name: "default",
- template: "{controller=Home}/{action=Index}/{id?}");
- });
- }
-
- private void RegisterAppInsights(IServiceCollection services)
- {
- services.AddApplicationInsightsTelemetry(Configuration);
- var orchestratorType = Configuration.GetValue("OrchestratorType");
-
- if (orchestratorType?.ToUpper() == "K8S")
- {
- // Enable K8s telemetry initializer
- services.EnableKubernetes();
- }
- if (orchestratorType?.ToUpper() == "SF")
- {
- // Enable SF telemetry initializer
- services.AddSingleton((serviceProvider) =>
- new FabricTelemetryInitializer());
- }
- }
- }
+ app.UseStaticFiles();
+
+
+ // Make work identity server redirections in Edge and lastest versions of browers. WARN: Not valid in a production environment.
+ app.Use(async (context, next) =>
+ {
+ context.Response.Headers.Add("Content-Security-Policy", "script-src 'unsafe-inline'");
+ await next();
+ });
+
+ app.UseForwardedHeaders();
+ // Adds IdentityServer
+ app.UseIdentityServer();
+
+ app.UseMvc(routes =>
+ {
+ routes.MapRoute(
+ name: "default",
+ template: "{controller=Home}/{action=Index}/{id?}");
+ });
+ }
+
+ private void RegisterAppInsights(IServiceCollection services)
+ {
+ services.AddApplicationInsightsTelemetry(Configuration);
+ string orchestratorType = Configuration.GetValue("OrchestratorType");
+
+ if (orchestratorType?.ToUpper() == "K8S")
+ {
+ // Enable K8s telemetry initializer
+ services.EnableKubernetes();
+ }
+ if (orchestratorType?.ToUpper() == "SF")
+ {
+ // Enable SF telemetry initializer
+ services.AddSingleton((serviceProvider) =>
+ new FabricTelemetryInitializer());
+ }
+ }
+ }
}
diff --git a/src/Services/Identity/Identity.API/appsettings.json b/src/Services/Identity/Identity.API/appsettings.json
index c5a109218..7b7b88801 100644
--- a/src/Services/Identity/Identity.API/appsettings.json
+++ b/src/Services/Identity/Identity.API/appsettings.json
@@ -1,25 +1,33 @@
{
- "ConnectionString": "Server=tcp:127.0.0.1,5433;Database=Microsoft.eShopOnContainers.Services.IdentityDb;User Id=sa;Password=Pass@word;",
- "IsClusterEnv": "False",
- "MvcClient": "http://localhost:5100",
- "SpaClient": "http://localhost:5104",
- "XamarinCallback": "http://localhost:5105/xamarincallback",
- "UseCustomizationData": false,
- "Logging": {
- "IncludeScopes": false,
- "LogLevel": {
- "Default": "Trace",
- "System": "Information",
- "Microsoft": "Information"
- }
- },
- "ApplicationInsights": {
- "InstrumentationKey": ""
- },
- "UseVault": false,
- "Vault": {
- "Name": "eshop",
- "ClientId": "your-clien-id",
- "ClientSecret": "your-client-secret"
- }
+ "ConnectionString": "Server=tcp:127.0.0.1,5433;Database=Microsoft.eShopOnContainers.Services.IdentityDb;User Id=sa;Password=Pass@word;",
+ "IsClusterEnv": "False",
+ "MvcClient": "https://localhost:4100",
+ "SpaClient": "https://localhost:4104",
+ "XamarinCallback": "https://localhost:4105/xamarincallback",
+ "UseCustomizationData": false,
+ "Logging": {
+ "IncludeScopes": false,
+ "LogLevel": {
+ "Default": "Trace",
+ "System": "Information",
+ "Microsoft": "Information"
+ }
+ },
+ "ApplicationInsights": {
+ "InstrumentationKey": ""
+ },
+ "UseVault": false,
+ "Vault": {
+ "Name": "eshop",
+ "ClientId": "your-clien-id",
+ "ClientSecret": "your-client-secret"
+ },
+ "Kestrel": {
+ "Certificates": {
+ "Default": {
+ "Path": "./Setup/eshopOnContainers.pfx",
+ "Password": "D0tNet@"
+ }
+ }
+ }
}
diff --git a/src/Services/Identity/Identity.API/bower.json b/src/Services/Identity/Identity.API/bower.json
deleted file mode 100644
index f6d44b1c0..000000000
--- a/src/Services/Identity/Identity.API/bower.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "name": "asp.net",
- "private": true,
- "dependencies": {
- "bootstrap": "v3.3.7",
- "jquery": "2.2.0",
- "jquery-validation": "1.14.0",
- "jquery-validation-unobtrusive": "3.2.6"
- }
-}
diff --git a/src/Services/Identity/Identity.API/libman.json b/src/Services/Identity/Identity.API/libman.json
new file mode 100644
index 000000000..589d47ace
--- /dev/null
+++ b/src/Services/Identity/Identity.API/libman.json
@@ -0,0 +1,228 @@
+{
+ "defaultProvider": "cdnjs",
+ "libraries": [
+ {
+ "destination": "wwwroot/lib/bootstrap",
+ "files": [
+ "dist/css/bootstrap.css",
+ "dist/css/bootstrap.css.map",
+ "dist/css/bootstrap.min.css",
+ "dist/css/bootstrap.min.css.map",
+ "dist/css/bootstrap-theme.css",
+ "dist/css/bootstrap-theme.css.map",
+ "dist/css/bootstrap-theme.min.css",
+ "dist/css/bootstrap-theme.min.css.map",
+ "dist/fonts/glyphicons-halflings-regular.eot",
+ "dist/fonts/glyphicons-halflings-regular.svg",
+ "dist/fonts/glyphicons-halflings-regular.ttf",
+ "dist/fonts/glyphicons-halflings-regular.woff",
+ "dist/fonts/glyphicons-halflings-regular.woff2",
+ "dist/js/bootstrap.js",
+ "dist/js/bootstrap.min.js",
+ "fonts/glyphicons-halflings-regular.eot",
+ "fonts/glyphicons-halflings-regular.svg",
+ "fonts/glyphicons-halflings-regular.ttf",
+ "fonts/glyphicons-halflings-regular.woff",
+ "fonts/glyphicons-halflings-regular.woff2"
+ ],
+ "library": "bootstrap@3.3.7",
+ "provider": "unpkg"
+ },
+ {
+ "destination": "wwwroot/lib/jquery",
+ "files": [
+ "jquery.js",
+ "jquery.min.js",
+ "jquery.min.map"
+ ],
+ "library": "jquery@2.2.0"
+ },
+ {
+ "destination": "wwwroot/lib/jquery-validation/",
+ "files": [
+ "additional-methods.js",
+ "additional-methods.min.js",
+ "jquery.validate.js",
+ "jquery.validate.min.js",
+ "localization/messages_ar.js",
+ "localization/messages_ar.min.js",
+ "localization/messages_ar.min.js.map",
+ "localization/messages_bg.js",
+ "localization/messages_bg.min.js",
+ "localization/messages_bg.min.js.map",
+ "localization/messages_bn_BD.js",
+ "localization/messages_bn_BD.min.js",
+ "localization/messages_bn_BD.min.js.map",
+ "localization/messages_ca.js",
+ "localization/messages_ca.min.js",
+ "localization/messages_ca.min.js.map",
+ "localization/messages_cs.js",
+ "localization/messages_cs.min.js",
+ "localization/messages_cs.min.js.map",
+ "localization/messages_da.js",
+ "localization/messages_da.min.js",
+ "localization/messages_da.min.js.map",
+ "localization/messages_de.js",
+ "localization/messages_de.min.js",
+ "localization/messages_de.min.js.map",
+ "localization/messages_el.js",
+ "localization/messages_el.min.js",
+ "localization/messages_el.min.js.map",
+ "localization/messages_es.js",
+ "localization/messages_es.min.js",
+ "localization/messages_es.min.js.map",
+ "localization/messages_es_AR.js",
+ "localization/messages_es_AR.min.js",
+ "localization/messages_es_AR.min.js.map",
+ "localization/messages_es_PE.js",
+ "localization/messages_es_PE.min.js",
+ "localization/messages_es_PE.min.js.map",
+ "localization/messages_et.js",
+ "localization/messages_et.min.js",
+ "localization/messages_et.min.js.map",
+ "localization/messages_eu.js",
+ "localization/messages_eu.min.js",
+ "localization/messages_eu.min.js.map",
+ "localization/messages_fa.js",
+ "localization/messages_fa.min.js",
+ "localization/messages_fa.min.js.map",
+ "localization/messages_fi.js",
+ "localization/messages_fi.min.js",
+ "localization/messages_fi.min.js.map",
+ "localization/messages_fr.js",
+ "localization/messages_fr.min.js",
+ "localization/messages_fr.min.js.map",
+ "localization/messages_ge.js",
+ "localization/messages_ge.min.js",
+ "localization/messages_ge.min.js.map",
+ "localization/messages_gl.js",
+ "localization/messages_gl.min.js",
+ "localization/messages_gl.min.js.map",
+ "localization/messages_he.js",
+ "localization/messages_he.min.js",
+ "localization/messages_he.min.js.map",
+ "localization/messages_hr.js",
+ "localization/messages_hr.min.js",
+ "localization/messages_hr.min.js.map",
+ "localization/messages_hu.js",
+ "localization/messages_hu.min.js",
+ "localization/messages_hu.min.js.map",
+ "localization/messages_hy_AM.js",
+ "localization/messages_hy_AM.min.js",
+ "localization/messages_hy_AM.min.js.map",
+ "localization/messages_id.js",
+ "localization/messages_id.min.js",
+ "localization/messages_id.min.js.map",
+ "localization/messages_is.js",
+ "localization/messages_is.min.js",
+ "localization/messages_is.min.js.map",
+ "localization/messages_it.js",
+ "localization/messages_it.min.js",
+ "localization/messages_it.min.js.map",
+ "localization/messages_ja.js",
+ "localization/messages_ja.min.js",
+ "localization/messages_ja.min.js.map",
+ "localization/messages_ka.js",
+ "localization/messages_ka.min.js",
+ "localization/messages_ka.min.js.map",
+ "localization/messages_kk.js",
+ "localization/messages_kk.min.js",
+ "localization/messages_kk.min.js.map",
+ "localization/messages_ko.js",
+ "localization/messages_ko.min.js",
+ "localization/messages_ko.min.js.map",
+ "localization/messages_lt.js",
+ "localization/messages_lt.min.js",
+ "localization/messages_lt.min.js.map",
+ "localization/messages_lv.js",
+ "localization/messages_lv.min.js",
+ "localization/messages_lv.min.js.map",
+ "localization/messages_my.js",
+ "localization/messages_my.min.js",
+ "localization/messages_my.min.js.map",
+ "localization/messages_nl.js",
+ "localization/messages_nl.min.js",
+ "localization/messages_nl.min.js.map",
+ "localization/messages_no.js",
+ "localization/messages_no.min.js",
+ "localization/messages_no.min.js.map",
+ "localization/messages_pl.js",
+ "localization/messages_pl.min.js",
+ "localization/messages_pl.min.js.map",
+ "localization/messages_pt_BR.js",
+ "localization/messages_pt_BR.min.js",
+ "localization/messages_pt_BR.min.js.map",
+ "localization/messages_pt_PT.js",
+ "localization/messages_pt_PT.min.js",
+ "localization/messages_pt_PT.min.js.map",
+ "localization/messages_ro.js",
+ "localization/messages_ro.min.js",
+ "localization/messages_ro.min.js.map",
+ "localization/messages_ru.js",
+ "localization/messages_ru.min.js",
+ "localization/messages_ru.min.js.map",
+ "localization/messages_si.js",
+ "localization/messages_si.min.js",
+ "localization/messages_si.min.js.map",
+ "localization/messages_sk.js",
+ "localization/messages_sk.min.js",
+ "localization/messages_sk.min.js.map",
+ "localization/messages_sl.js",
+ "localization/messages_sl.min.js",
+ "localization/messages_sl.min.js.map",
+ "localization/messages_sr.js",
+ "localization/messages_sr.min.js",
+ "localization/messages_sr.min.js.map",
+ "localization/messages_sr_lat.js",
+ "localization/messages_sr_lat.min.js",
+ "localization/messages_sr_lat.min.js.map",
+ "localization/messages_sv.js",
+ "localization/messages_sv.min.js",
+ "localization/messages_sv.min.js.map",
+ "localization/messages_th.js",
+ "localization/messages_th.min.js",
+ "localization/messages_th.min.js.map",
+ "localization/messages_tj.js",
+ "localization/messages_tj.min.js",
+ "localization/messages_tj.min.js.map",
+ "localization/messages_tr.js",
+ "localization/messages_tr.min.js",
+ "localization/messages_tr.min.js.map",
+ "localization/messages_uk.js",
+ "localization/messages_uk.min.js",
+ "localization/messages_uk.min.js.map",
+ "localization/messages_vi.js",
+ "localization/messages_vi.min.js",
+ "localization/messages_vi.min.js.map",
+ "localization/messages_zh.js",
+ "localization/messages_zh.min.js",
+ "localization/messages_zh.min.js.map",
+ "localization/messages_zh_TW.js",
+ "localization/messages_zh_TW.min.js",
+ "localization/messages_zh_TW.min.js.map",
+ "localization/methods_de.js",
+ "localization/methods_de.min.js",
+ "localization/methods_de.min.js.map",
+ "localization/methods_es_CL.js",
+ "localization/methods_es_CL.min.js",
+ "localization/methods_es_CL.min.js.map",
+ "localization/methods_fi.js",
+ "localization/methods_fi.min.js",
+ "localization/methods_fi.min.js.map",
+ "localization/methods_nl.js",
+ "localization/methods_nl.min.js",
+ "localization/methods_nl.min.js.map",
+ "localization/methods_pt.js",
+ "localization/methods_pt.min.js",
+ "localization/methods_pt.min.js.map"
+ ],
+ "library": "jquery-validate@1.14.0"
+ },
+ {
+ "destination": "wwwroot/lib/jquery-validation-unobtrusive",
+ "files": [ "jquery.validate.unobtrusive.js", "jquery.validate.unobtrusive.min.js" ],
+ "library": "jquery-validation-unobtrusive@3.2.6"
+ }
+ ],
+ "version": "1.0"
+}
\ No newline at end of file
diff --git a/src/Services/Identity/Identity.API/wwwroot/lib/bootstrap/.bower.json b/src/Services/Identity/Identity.API/wwwroot/lib/bootstrap/.bower.json
deleted file mode 100644
index 1e99b6299..000000000
--- a/src/Services/Identity/Identity.API/wwwroot/lib/bootstrap/.bower.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "name": "bootstrap",
- "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
- "keywords": [
- "css",
- "js",
- "less",
- "mobile-first",
- "responsive",
- "front-end",
- "framework",
- "web"
- ],
- "homepage": "http://getbootstrap.com",
- "license": "MIT",
- "moduleType": "globals",
- "main": [
- "less/bootstrap.less",
- "dist/js/bootstrap.js"
- ],
- "ignore": [
- "/.*",
- "_config.yml",
- "CNAME",
- "composer.json",
- "CONTRIBUTING.md",
- "docs",
- "js/tests",
- "test-infra"
- ],
- "dependencies": {
- "jquery": "1.9.1 - 3"
- },
- "version": "3.3.7",
- "_release": "3.3.7",
- "_resolution": {
- "type": "version",
- "tag": "v3.3.7",
- "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86"
- },
- "_source": "https://github.com/twbs/bootstrap.git",
- "_target": "v3.3.7",
- "_originalSource": "bootstrap",
- "_direct": true
-}
\ No newline at end of file
diff --git a/src/Services/Identity/Identity.API/wwwroot/lib/bootstrap/LICENSE b/src/Services/Identity/Identity.API/wwwroot/lib/bootstrap/LICENSE
deleted file mode 100644
index 7a300022c..000000000
--- a/src/Services/Identity/Identity.API/wwwroot/lib/bootstrap/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2011-2016 Twitter, Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/src/Services/Identity/Identity.API/wwwroot/lib/bootstrap/dist/js/npm.js b/src/Services/Identity/Identity.API/wwwroot/lib/bootstrap/dist/js/npm.js
deleted file mode 100644
index bf6aa8060..000000000
--- a/src/Services/Identity/Identity.API/wwwroot/lib/bootstrap/dist/js/npm.js
+++ /dev/null
@@ -1,13 +0,0 @@
-// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
-require('../../js/transition.js')
-require('../../js/alert.js')
-require('../../js/button.js')
-require('../../js/carousel.js')
-require('../../js/collapse.js')
-require('../../js/dropdown.js')
-require('../../js/modal.js')
-require('../../js/tooltip.js')
-require('../../js/popover.js')
-require('../../js/scrollspy.js')
-require('../../js/tab.js')
-require('../../js/affix.js')
\ No newline at end of file
diff --git a/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation-unobtrusive/.bower.json b/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation-unobtrusive/.bower.json
deleted file mode 100644
index ccf48121d..000000000
--- a/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation-unobtrusive/.bower.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "name": "jquery-validation-unobtrusive",
- "version": "3.2.6",
- "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive",
- "description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.",
- "main": [
- "jquery.validate.unobtrusive.js"
- ],
- "ignore": [
- "**/.*",
- "*.json",
- "*.md",
- "*.txt",
- "gulpfile.js"
- ],
- "keywords": [
- "jquery",
- "asp.net",
- "mvc",
- "validation",
- "unobtrusive"
- ],
- "authors": [
- "Microsoft"
- ],
- "license": "http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm",
- "repository": {
- "type": "git",
- "url": "git://github.com/aspnet/jquery-validation-unobtrusive.git"
- },
- "dependencies": {
- "jquery-validation": ">=1.8",
- "jquery": ">=1.8"
- },
- "_release": "3.2.6",
- "_resolution": {
- "type": "version",
- "tag": "v3.2.6",
- "commit": "13386cd1b5947d8a5d23a12b531ce3960be1eba7"
- },
- "_source": "git://github.com/aspnet/jquery-validation-unobtrusive.git",
- "_target": "3.2.6",
- "_originalSource": "jquery-validation-unobtrusive"
-}
\ No newline at end of file
diff --git a/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js b/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js
index be9a38a4c..973ee384d 100644
--- a/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js
+++ b/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js
@@ -1,5 +1 @@
-/*
-** Unobtrusive validation support library for jQuery and jQuery Validate
-** Copyright (C) Microsoft Corporation. All rights reserved.
-*/
-!function(a){function e(a,e,n){a.rules[e]=n,a.message&&(a.messages[e]=a.message)}function n(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function t(a){return a.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function r(a){return a.substr(0,a.lastIndexOf(".")+1)}function i(a,e){return 0===a.indexOf("*.")&&(a=a.replace("*.",e)),a}function o(e,n){var r=a(this).find("[data-valmsg-for='"+t(n[0].name)+"']"),i=r.attr("data-valmsg-replace"),o=i?a.parseJSON(i)!==!1:null;r.removeClass("field-validation-valid").addClass("field-validation-error"),e.data("unobtrusiveContainer",r),o?(r.empty(),e.removeClass("input-validation-error").appendTo(r)):e.hide()}function d(e,n){var t=a(this).find("[data-valmsg-summary=true]"),r=t.find("ul");r&&r.length&&n.errorList.length&&(r.empty(),t.addClass("validation-summary-errors").removeClass("validation-summary-valid"),a.each(n.errorList,function(){a("").html(this.message).appendTo(r)}))}function s(e){var n=e.data("unobtrusiveContainer");if(n){var t=n.attr("data-valmsg-replace"),r=t?a.parseJSON(t):null;n.addClass("field-validation-valid").removeClass("field-validation-error"),e.removeData("unobtrusiveContainer"),r&&n.empty()}}function l(e){var n=a(this),t="__jquery_unobtrusive_validation_form_reset";if(!n.data(t)){n.data(t,!0);try{n.data("validator").resetForm()}finally{n.removeData(t)}n.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors"),n.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}}function m(e){var n=a(e),t=n.data(v),r=a.proxy(l,e),i=p.unobtrusive.options||{},m=function(n,t){var r=i[n];r&&a.isFunction(r)&&r.apply(e,t)};return t||(t={options:{errorClass:i.errorClass||"input-validation-error",errorElement:i.errorElement||"span",errorPlacement:function(){o.apply(e,arguments),m("errorPlacement",arguments)},invalidHandler:function(){d.apply(e,arguments),m("invalidHandler",arguments)},messages:{},rules:{},success:function(){s.apply(e,arguments),m("success",arguments)}},attachValidation:function(){n.off("reset."+v,r).on("reset."+v,r).validate(this.options)},validate:function(){return n.validate(),n.valid()}},n.data(v,t)),t}var u,p=a.validator,v="unobtrusiveValidation";p.unobtrusive={adapters:[],parseElement:function(e,n){var t,r,i,o=a(e),d=o.parents("form")[0];d&&(t=m(d),t.options.rules[e.name]=r={},t.options.messages[e.name]=i={},a.each(this.adapters,function(){var n="data-val-"+this.name,t=o.attr(n),s={};void 0!==t&&(n+="-",a.each(this.params,function(){s[this]=o.attr(n+this)}),this.adapt({element:e,form:d,message:t,params:s,rules:r,messages:i}))}),a.extend(r,{__dummy__:!0}),n||t.attachValidation())},parse:function(e){var n=a(e),t=n.parents().addBack().filter("form").add(n.find("form")).has("[data-val=true]");n.find("[data-val=true]").each(function(){p.unobtrusive.parseElement(this,!0)}),t.each(function(){var a=m(this);a&&a.attachValidation()})}},u=p.unobtrusive.adapters,u.add=function(a,e,n){return n||(n=e,e=[]),this.push({name:a,params:e,adapt:n}),this},u.addBool=function(a,n){return this.add(a,function(t){e(t,n||a,!0)})},u.addMinMax=function(a,n,t,r,i,o){return this.add(a,[i||"min",o||"max"],function(a){var i=a.params.min,o=a.params.max;i&&o?e(a,r,[i,o]):i?e(a,n,i):o&&e(a,t,o)})},u.addSingleVal=function(a,n,t){return this.add(a,[n||"val"],function(r){e(r,t||a,r.params[n])})},p.addMethod("__dummy__",function(a,e,n){return!0}),p.addMethod("regex",function(a,e,n){var t;return this.optional(e)?!0:(t=new RegExp(n).exec(a),t&&0===t.index&&t[0].length===a.length)}),p.addMethod("nonalphamin",function(a,e,n){var t;return n&&(t=a.match(/\W/g),t=t&&t.length>=n),t}),p.methods.extension?(u.addSingleVal("accept","mimtype"),u.addSingleVal("extension","extension")):u.addSingleVal("extension","extension","accept"),u.addSingleVal("regex","pattern"),u.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"),u.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range"),u.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength"),u.add("equalto",["other"],function(n){var o=r(n.element.name),d=n.params.other,s=i(d,o),l=a(n.form).find(":input").filter("[name='"+t(s)+"']")[0];e(n,"equalTo",l)}),u.add("required",function(a){("INPUT"!==a.element.tagName.toUpperCase()||"CHECKBOX"!==a.element.type.toUpperCase())&&e(a,"required",!0)}),u.add("remote",["url","type","additionalfields"],function(o){var d={url:o.params.url,type:o.params.type||"GET",data:{}},s=r(o.element.name);a.each(n(o.params.additionalfields||o.element.name),function(e,n){var r=i(n,s);d.data[r]=function(){var e=a(o.form).find(":input").filter("[name='"+t(r)+"']");return e.is(":checkbox")?e.filter(":checked").val()||e.filter(":hidden").val()||"":e.is(":radio")?e.filter(":checked").val()||"":e.val()}}),e(o,"remote",d)}),u.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&e(a,"minlength",a.params.min),a.params.nonalphamin&&e(a,"nonalphamin",a.params.nonalphamin),a.params.regex&&e(a,"regex",a.params.regex)}),a(function(){p.unobtrusive.parse(document)})}(jQuery);
\ No newline at end of file
+!function(a){function e(a,e,n){a.rules[e]=n,a.message&&(a.messages[e]=a.message)}function n(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function t(a){return a.replace(/([!"#$%&'()*+,.\/:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function r(a){return a.substr(0,a.lastIndexOf(".")+1)}function i(a,e){return 0===a.indexOf("*.")&&(a=a.replace("*.",e)),a}function o(e,n){var r=a(this).find("[data-valmsg-for='"+t(n[0].name)+"']"),i=r.attr("data-valmsg-replace"),o=i?a.parseJSON(i)!==!1:null;r.removeClass("field-validation-valid").addClass("field-validation-error"),e.data("unobtrusiveContainer",r),o?(r.empty(),e.removeClass("input-validation-error").appendTo(r)):e.hide()}function d(e,n){var t=a(this).find("[data-valmsg-summary=true]"),r=t.find("ul");r&&r.length&&n.errorList.length&&(r.empty(),t.addClass("validation-summary-errors").removeClass("validation-summary-valid"),a.each(n.errorList,function(){a("").html(this.message).appendTo(r)}))}function s(e){var n=e.data("unobtrusiveContainer");if(n){var t=n.attr("data-valmsg-replace"),r=t?a.parseJSON(t):null;n.addClass("field-validation-valid").removeClass("field-validation-error"),e.removeData("unobtrusiveContainer"),r&&n.empty()}}function l(e){var n=a(this),t="__jquery_unobtrusive_validation_form_reset";if(!n.data(t)){n.data(t,!0);try{n.data("validator").resetForm()}finally{n.removeData(t)}n.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors"),n.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}}function m(e){var n=a(e),t=n.data(v),r=a.proxy(l,e),i=p.unobtrusive.options||{},m=function(n,t){var r=i[n];r&&a.isFunction(r)&&r.apply(e,t)};return t||(t={options:{errorClass:i.errorClass||"input-validation-error",errorElement:i.errorElement||"span",errorPlacement:function(){o.apply(e,arguments),m("errorPlacement",arguments)},invalidHandler:function(){d.apply(e,arguments),m("invalidHandler",arguments)},messages:{},rules:{},success:function(){s.apply(e,arguments),m("success",arguments)}},attachValidation:function(){n.off("reset."+v,r).on("reset."+v,r).validate(this.options)},validate:function(){return n.validate(),n.valid()}},n.data(v,t)),t}var u,p=a.validator,v="unobtrusiveValidation";p.unobtrusive={adapters:[],parseElement:function(e,n){var t,r,i,o=a(e),d=o.parents("form")[0];d&&(t=m(d),t.options.rules[e.name]=r={},t.options.messages[e.name]=i={},a.each(this.adapters,function(){var n="data-val-"+this.name,t=o.attr(n),s={};void 0!==t&&(n+="-",a.each(this.params,function(){s[this]=o.attr(n+this)}),this.adapt({element:e,form:d,message:t,params:s,rules:r,messages:i}))}),a.extend(r,{__dummy__:!0}),n||t.attachValidation())},parse:function(e){var n=a(e),t=n.parents().addBack().filter("form").add(n.find("form")).has("[data-val=true]");n.find("[data-val=true]").each(function(){p.unobtrusive.parseElement(this,!0)}),t.each(function(){var a=m(this);a&&a.attachValidation()})}},u=p.unobtrusive.adapters,u.add=function(a,e,n){return n||(n=e,e=[]),this.push({name:a,params:e,adapt:n}),this},u.addBool=function(a,n){return this.add(a,function(t){e(t,n||a,!0)})},u.addMinMax=function(a,n,t,r,i,o){return this.add(a,[i||"min",o||"max"],function(a){var i=a.params.min,o=a.params.max;i&&o?e(a,r,[i,o]):i?e(a,n,i):o&&e(a,t,o)})},u.addSingleVal=function(a,n,t){return this.add(a,[n||"val"],function(r){e(r,t||a,r.params[n])})},p.addMethod("__dummy__",function(a,e,n){return!0}),p.addMethod("regex",function(a,e,n){var t;return this.optional(e)?!0:(t=new RegExp(n).exec(a),t&&0===t.index&&t[0].length===a.length)}),p.addMethod("nonalphamin",function(a,e,n){var t;return n&&(t=a.match(/\W/g),t=t&&t.length>=n),t}),p.methods.extension?(u.addSingleVal("accept","mimtype"),u.addSingleVal("extension","extension")):u.addSingleVal("extension","extension","accept"),u.addSingleVal("regex","pattern"),u.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"),u.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range"),u.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength"),u.add("equalto",["other"],function(n){var o=r(n.element.name),d=n.params.other,s=i(d,o),l=a(n.form).find(":input").filter("[name='"+t(s)+"']")[0];e(n,"equalTo",l)}),u.add("required",function(a){("INPUT"!==a.element.tagName.toUpperCase()||"CHECKBOX"!==a.element.type.toUpperCase())&&e(a,"required",!0)}),u.add("remote",["url","type","additionalfields"],function(o){var d={url:o.params.url,type:o.params.type||"GET",data:{}},s=r(o.element.name);a.each(n(o.params.additionalfields||o.element.name),function(e,n){var r=i(n,s);d.data[r]=function(){var e=a(o.form).find(":input").filter("[name='"+t(r)+"']");return e.is(":checkbox")?e.filter(":checked").val()||e.filter(":hidden").val()||"":e.is(":radio")?e.filter(":checked").val()||"":e.val()}}),e(o,"remote",d)}),u.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&e(a,"minlength",a.params.min),a.params.nonalphamin&&e(a,"nonalphamin",a.params.nonalphamin),a.params.regex&&e(a,"regex",a.params.regex)}),a(function(){p.unobtrusive.parse(document)})}(jQuery);
\ No newline at end of file
diff --git a/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation/.bower.json b/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation/.bower.json
deleted file mode 100644
index cab34a4a6..000000000
--- a/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation/.bower.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "name": "jquery-validation",
- "homepage": "http://jqueryvalidation.org/",
- "repository": {
- "type": "git",
- "url": "git://github.com/jzaefferer/jquery-validation.git"
- },
- "authors": [
- "Jörn Zaefferer "
- ],
- "description": "Form validation made easy",
- "main": "dist/jquery.validate.js",
- "keywords": [
- "forms",
- "validation",
- "validate"
- ],
- "license": "MIT",
- "ignore": [
- "**/.*",
- "node_modules",
- "bower_components",
- "test",
- "demo",
- "lib"
- ],
- "dependencies": {
- "jquery": ">= 1.7.2"
- },
- "version": "1.14.0",
- "_release": "1.14.0",
- "_resolution": {
- "type": "version",
- "tag": "1.14.0",
- "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48"
- },
- "_source": "git://github.com/jzaefferer/jquery-validation.git",
- "_target": ">=1.8",
- "_originalSource": "jquery-validation"
-}
\ No newline at end of file
diff --git a/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation/LICENSE.md b/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation/LICENSE.md
deleted file mode 100644
index dc377cc03..000000000
--- a/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation/LICENSE.md
+++ /dev/null
@@ -1,22 +0,0 @@
-The MIT License (MIT)
-=====================
-
-Copyright Jörn Zaefferer
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation/dist/additional-methods.js b/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation/dist/additional-methods.js
deleted file mode 100644
index df41fbd40..000000000
--- a/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation/dist/additional-methods.js
+++ /dev/null
@@ -1,998 +0,0 @@
-/*!
- * jQuery Validation Plugin v1.14.0
- *
- * http://jqueryvalidation.org/
- *
- * Copyright (c) 2015 Jörn Zaefferer
- * Released under the MIT license
- */
-(function( factory ) {
- if ( typeof define === "function" && define.amd ) {
- define( ["jquery", "./jquery.validate"], factory );
- } else {
- factory( jQuery );
- }
-}(function( $ ) {
-
-(function() {
-
- function stripHtml(value) {
- // remove html tags and space chars
- return value.replace(/<.[^<>]*?>/g, " ").replace(/ | /gi, " ")
- // remove punctuation
- .replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g, "");
- }
-
- $.validator.addMethod("maxWords", function(value, element, params) {
- return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length <= params;
- }, $.validator.format("Please enter {0} words or less."));
-
- $.validator.addMethod("minWords", function(value, element, params) {
- return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params;
- }, $.validator.format("Please enter at least {0} words."));
-
- $.validator.addMethod("rangeWords", function(value, element, params) {
- var valueStripped = stripHtml(value),
- regex = /\b\w+\b/g;
- return this.optional(element) || valueStripped.match(regex).length >= params[0] && valueStripped.match(regex).length <= params[1];
- }, $.validator.format("Please enter between {0} and {1} words."));
-
-}());
-
-// Accept a value from a file input based on a required mimetype
-$.validator.addMethod("accept", function(value, element, param) {
- // Split mime on commas in case we have multiple types we can accept
- var typeParam = typeof param === "string" ? param.replace(/\s/g, "").replace(/,/g, "|") : "image/*",
- optionalValue = this.optional(element),
- i, file;
-
- // Element is optional
- if (optionalValue) {
- return optionalValue;
- }
-
- if ($(element).attr("type") === "file") {
- // If we are using a wildcard, make it regex friendly
- typeParam = typeParam.replace(/\*/g, ".*");
-
- // Check if the element has a FileList before checking each file
- if (element.files && element.files.length) {
- for (i = 0; i < element.files.length; i++) {
- file = element.files[i];
-
- // Grab the mimetype from the loaded file, verify it matches
- if (!file.type.match(new RegExp( "\\.?(" + typeParam + ")$", "i"))) {
- return false;
- }
- }
- }
- }
-
- // Either return true because we've validated each file, or because the
- // browser does not support element.files and the FileList feature
- return true;
-}, $.validator.format("Please enter a value with a valid mimetype."));
-
-$.validator.addMethod("alphanumeric", function(value, element) {
- return this.optional(element) || /^\w+$/i.test(value);
-}, "Letters, numbers, and underscores only please");
-
-/*
- * Dutch bank account numbers (not 'giro' numbers) have 9 digits
- * and pass the '11 check'.
- * We accept the notation with spaces, as that is common.
- * acceptable: 123456789 or 12 34 56 789
- */
-$.validator.addMethod("bankaccountNL", function(value, element) {
- if (this.optional(element)) {
- return true;
- }
- if (!(/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(value))) {
- return false;
- }
- // now '11 check'
- var account = value.replace(/ /g, ""), // remove spaces
- sum = 0,
- len = account.length,
- pos, factor, digit;
- for ( pos = 0; pos < len; pos++ ) {
- factor = len - pos;
- digit = account.substring(pos, pos + 1);
- sum = sum + factor * digit;
- }
- return sum % 11 === 0;
-}, "Please specify a valid bank account number");
-
-$.validator.addMethod("bankorgiroaccountNL", function(value, element) {
- return this.optional(element) ||
- ($.validator.methods.bankaccountNL.call(this, value, element)) ||
- ($.validator.methods.giroaccountNL.call(this, value, element));
-}, "Please specify a valid bank or giro account number");
-
-/**
- * BIC is the business identifier code (ISO 9362). This BIC check is not a guarantee for authenticity.
- *
- * BIC pattern: BBBBCCLLbbb (8 or 11 characters long; bbb is optional)
- *
- * BIC definition in detail:
- * - First 4 characters - bank code (only letters)
- * - Next 2 characters - ISO 3166-1 alpha-2 country code (only letters)
- * - Next 2 characters - location code (letters and digits)
- * a. shall not start with '0' or '1'
- * b. second character must be a letter ('O' is not allowed) or one of the following digits ('0' for test (therefore not allowed), '1' for passive participant and '2' for active participant)
- * - Last 3 characters - branch code, optional (shall not start with 'X' except in case of 'XXX' for primary office) (letters and digits)
- */
-$.validator.addMethod("bic", function(value, element) {
- return this.optional( element ) || /^([A-Z]{6}[A-Z2-9][A-NP-Z1-2])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test( value );
-}, "Please specify a valid BIC code");
-
-/*
- * Código de identificación fiscal ( CIF ) is the tax identification code for Spanish legal entities
- * Further rules can be found in Spanish on http://es.wikipedia.org/wiki/C%C3%B3digo_de_identificaci%C3%B3n_fiscal
- */
-$.validator.addMethod( "cifES", function( value ) {
- "use strict";
-
- var num = [],
- controlDigit, sum, i, count, tmp, secondDigit;
-
- value = value.toUpperCase();
-
- // Quick format test
- if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) {
- return false;
- }
-
- for ( i = 0; i < 9; i++ ) {
- num[ i ] = parseInt( value.charAt( i ), 10 );
- }
-
- // Algorithm for checking CIF codes
- sum = num[ 2 ] + num[ 4 ] + num[ 6 ];
- for ( count = 1; count < 8; count += 2 ) {
- tmp = ( 2 * num[ count ] ).toString();
- secondDigit = tmp.charAt( 1 );
-
- sum += parseInt( tmp.charAt( 0 ), 10 ) + ( secondDigit === "" ? 0 : parseInt( secondDigit, 10 ) );
- }
-
- /* The first (position 1) is a letter following the following criteria:
- * A. Corporations
- * B. LLCs
- * C. General partnerships
- * D. Companies limited partnerships
- * E. Communities of goods
- * F. Cooperative Societies
- * G. Associations
- * H. Communities of homeowners in horizontal property regime
- * J. Civil Societies
- * K. Old format
- * L. Old format
- * M. Old format
- * N. Nonresident entities
- * P. Local authorities
- * Q. Autonomous bodies, state or not, and the like, and congregations and religious institutions
- * R. Congregations and religious institutions (since 2008 ORDER EHA/451/2008)
- * S. Organs of State Administration and regions
- * V. Agrarian Transformation
- * W. Permanent establishments of non-resident in Spain
- */
- if ( /^[ABCDEFGHJNPQRSUVW]{1}/.test( value ) ) {
- sum += "";
- controlDigit = 10 - parseInt( sum.charAt( sum.length - 1 ), 10 );
- value += controlDigit;
- return ( num[ 8 ].toString() === String.fromCharCode( 64 + controlDigit ) || num[ 8 ].toString() === value.charAt( value.length - 1 ) );
- }
-
- return false;
-
-}, "Please specify a valid CIF number." );
-
-/*
- * Brazillian CPF number (Cadastrado de Pessoas Físicas) is the equivalent of a Brazilian tax registration number.
- * CPF numbers have 11 digits in total: 9 numbers followed by 2 check numbers that are being used for validation.
- */
-$.validator.addMethod("cpfBR", function(value) {
- // Removing special characters from value
- value = value.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "");
-
- // Checking value to have 11 digits only
- if (value.length !== 11) {
- return false;
- }
-
- var sum = 0,
- firstCN, secondCN, checkResult, i;
-
- firstCN = parseInt(value.substring(9, 10), 10);
- secondCN = parseInt(value.substring(10, 11), 10);
-
- checkResult = function(sum, cn) {
- var result = (sum * 10) % 11;
- if ((result === 10) || (result === 11)) {result = 0;}
- return (result === cn);
- };
-
- // Checking for dump data
- if (value === "" ||
- value === "00000000000" ||
- value === "11111111111" ||
- value === "22222222222" ||
- value === "33333333333" ||
- value === "44444444444" ||
- value === "55555555555" ||
- value === "66666666666" ||
- value === "77777777777" ||
- value === "88888888888" ||
- value === "99999999999"
- ) {
- return false;
- }
-
- // Step 1 - using first Check Number:
- for ( i = 1; i <= 9; i++ ) {
- sum = sum + parseInt(value.substring(i - 1, i), 10) * (11 - i);
- }
-
- // If first Check Number (CN) is valid, move to Step 2 - using second Check Number:
- if ( checkResult(sum, firstCN) ) {
- sum = 0;
- for ( i = 1; i <= 10; i++ ) {
- sum = sum + parseInt(value.substring(i - 1, i), 10) * (12 - i);
- }
- return checkResult(sum, secondCN);
- }
- return false;
-
-}, "Please specify a valid CPF number");
-
-/* NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator
- * Redistributed under the the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0
- * Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings)
- */
-$.validator.addMethod("creditcardtypes", function(value, element, param) {
- if (/[^0-9\-]+/.test(value)) {
- return false;
- }
-
- value = value.replace(/\D/g, "");
-
- var validTypes = 0x0000;
-
- if (param.mastercard) {
- validTypes |= 0x0001;
- }
- if (param.visa) {
- validTypes |= 0x0002;
- }
- if (param.amex) {
- validTypes |= 0x0004;
- }
- if (param.dinersclub) {
- validTypes |= 0x0008;
- }
- if (param.enroute) {
- validTypes |= 0x0010;
- }
- if (param.discover) {
- validTypes |= 0x0020;
- }
- if (param.jcb) {
- validTypes |= 0x0040;
- }
- if (param.unknown) {
- validTypes |= 0x0080;
- }
- if (param.all) {
- validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080;
- }
- if (validTypes & 0x0001 && /^(5[12345])/.test(value)) { //mastercard
- return value.length === 16;
- }
- if (validTypes & 0x0002 && /^(4)/.test(value)) { //visa
- return value.length === 16;
- }
- if (validTypes & 0x0004 && /^(3[47])/.test(value)) { //amex
- return value.length === 15;
- }
- if (validTypes & 0x0008 && /^(3(0[012345]|[68]))/.test(value)) { //dinersclub
- return value.length === 14;
- }
- if (validTypes & 0x0010 && /^(2(014|149))/.test(value)) { //enroute
- return value.length === 15;
- }
- if (validTypes & 0x0020 && /^(6011)/.test(value)) { //discover
- return value.length === 16;
- }
- if (validTypes & 0x0040 && /^(3)/.test(value)) { //jcb
- return value.length === 16;
- }
- if (validTypes & 0x0040 && /^(2131|1800)/.test(value)) { //jcb
- return value.length === 15;
- }
- if (validTypes & 0x0080) { //unknown
- return true;
- }
- return false;
-}, "Please enter a valid credit card number.");
-
-/**
- * Validates currencies with any given symbols by @jameslouiz
- * Symbols can be optional or required. Symbols required by default
- *
- * Usage examples:
- * currency: ["£", false] - Use false for soft currency validation
- * currency: ["$", false]
- * currency: ["RM", false] - also works with text based symbols such as "RM" - Malaysia Ringgit etc
- *
- *
- *
- * Soft symbol checking
- * currencyInput: {
- * currency: ["$", false]
- * }
- *
- * Strict symbol checking (default)
- * currencyInput: {
- * currency: "$"
- * //OR
- * currency: ["$", true]
- * }
- *
- * Multiple Symbols
- * currencyInput: {
- * currency: "$,£,¢"
- * }
- */
-$.validator.addMethod("currency", function(value, element, param) {
- var isParamString = typeof param === "string",
- symbol = isParamString ? param : param[0],
- soft = isParamString ? true : param[1],
- regex;
-
- symbol = symbol.replace(/,/g, "");
- symbol = soft ? symbol + "]" : symbol + "]?";
- regex = "^[" + symbol + "([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$";
- regex = new RegExp(regex);
- return this.optional(element) || regex.test(value);
-
-}, "Please specify a valid currency");
-
-$.validator.addMethod("dateFA", function(value, element) {
- return this.optional(element) || /^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(value);
-}, $.validator.messages.date);
-
-/**
- * Return true, if the value is a valid date, also making this formal check dd/mm/yyyy.
- *
- * @example $.validator.methods.date("01/01/1900")
- * @result true
- *
- * @example $.validator.methods.date("01/13/1990")
- * @result false
- *
- * @example $.validator.methods.date("01.01.1900")
- * @result false
- *
- * @example
- * @desc Declares an optional input element whose value must be a valid date.
- *
- * @name $.validator.methods.dateITA
- * @type Boolean
- * @cat Plugins/Validate/Methods
- */
-$.validator.addMethod("dateITA", function(value, element) {
- var check = false,
- re = /^\d{1,2}\/\d{1,2}\/\d{4}$/,
- adata, gg, mm, aaaa, xdata;
- if ( re.test(value)) {
- adata = value.split("/");
- gg = parseInt(adata[0], 10);
- mm = parseInt(adata[1], 10);
- aaaa = parseInt(adata[2], 10);
- xdata = new Date(Date.UTC(aaaa, mm - 1, gg, 12, 0, 0, 0));
- if ( ( xdata.getUTCFullYear() === aaaa ) && ( xdata.getUTCMonth () === mm - 1 ) && ( xdata.getUTCDate() === gg ) ) {
- check = true;
- } else {
- check = false;
- }
- } else {
- check = false;
- }
- return this.optional(element) || check;
-}, $.validator.messages.date);
-
-$.validator.addMethod("dateNL", function(value, element) {
- return this.optional(element) || /^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(value);
-}, $.validator.messages.date);
-
-// Older "accept" file extension method. Old docs: http://docs.jquery.com/Plugins/Validation/Methods/accept
-$.validator.addMethod("extension", function(value, element, param) {
- param = typeof param === "string" ? param.replace(/,/g, "|") : "png|jpe?g|gif";
- return this.optional(element) || value.match(new RegExp("\\.(" + param + ")$", "i"));
-}, $.validator.format("Please enter a value with a valid extension."));
-
-/**
- * Dutch giro account numbers (not bank numbers) have max 7 digits
- */
-$.validator.addMethod("giroaccountNL", function(value, element) {
- return this.optional(element) || /^[0-9]{1,7}$/.test(value);
-}, "Please specify a valid giro account number");
-
-/**
- * IBAN is the international bank account number.
- * It has a country - specific format, that is checked here too
- */
-$.validator.addMethod("iban", function(value, element) {
- // some quick simple tests to prevent needless work
- if (this.optional(element)) {
- return true;
- }
-
- // remove spaces and to upper case
- var iban = value.replace(/ /g, "").toUpperCase(),
- ibancheckdigits = "",
- leadingZeroes = true,
- cRest = "",
- cOperator = "",
- countrycode, ibancheck, charAt, cChar, bbanpattern, bbancountrypatterns, ibanregexp, i, p;
-
- // check the country code and find the country specific format
- countrycode = iban.substring(0, 2);
- bbancountrypatterns = {
- "AL": "\\d{8}[\\dA-Z]{16}",
- "AD": "\\d{8}[\\dA-Z]{12}",
- "AT": "\\d{16}",
- "AZ": "[\\dA-Z]{4}\\d{20}",
- "BE": "\\d{12}",
- "BH": "[A-Z]{4}[\\dA-Z]{14}",
- "BA": "\\d{16}",
- "BR": "\\d{23}[A-Z][\\dA-Z]",
- "BG": "[A-Z]{4}\\d{6}[\\dA-Z]{8}",
- "CR": "\\d{17}",
- "HR": "\\d{17}",
- "CY": "\\d{8}[\\dA-Z]{16}",
- "CZ": "\\d{20}",
- "DK": "\\d{14}",
- "DO": "[A-Z]{4}\\d{20}",
- "EE": "\\d{16}",
- "FO": "\\d{14}",
- "FI": "\\d{14}",
- "FR": "\\d{10}[\\dA-Z]{11}\\d{2}",
- "GE": "[\\dA-Z]{2}\\d{16}",
- "DE": "\\d{18}",
- "GI": "[A-Z]{4}[\\dA-Z]{15}",
- "GR": "\\d{7}[\\dA-Z]{16}",
- "GL": "\\d{14}",
- "GT": "[\\dA-Z]{4}[\\dA-Z]{20}",
- "HU": "\\d{24}",
- "IS": "\\d{22}",
- "IE": "[\\dA-Z]{4}\\d{14}",
- "IL": "\\d{19}",
- "IT": "[A-Z]\\d{10}[\\dA-Z]{12}",
- "KZ": "\\d{3}[\\dA-Z]{13}",
- "KW": "[A-Z]{4}[\\dA-Z]{22}",
- "LV": "[A-Z]{4}[\\dA-Z]{13}",
- "LB": "\\d{4}[\\dA-Z]{20}",
- "LI": "\\d{5}[\\dA-Z]{12}",
- "LT": "\\d{16}",
- "LU": "\\d{3}[\\dA-Z]{13}",
- "MK": "\\d{3}[\\dA-Z]{10}\\d{2}",
- "MT": "[A-Z]{4}\\d{5}[\\dA-Z]{18}",
- "MR": "\\d{23}",
- "MU": "[A-Z]{4}\\d{19}[A-Z]{3}",
- "MC": "\\d{10}[\\dA-Z]{11}\\d{2}",
- "MD": "[\\dA-Z]{2}\\d{18}",
- "ME": "\\d{18}",
- "NL": "[A-Z]{4}\\d{10}",
- "NO": "\\d{11}",
- "PK": "[\\dA-Z]{4}\\d{16}",
- "PS": "[\\dA-Z]{4}\\d{21}",
- "PL": "\\d{24}",
- "PT": "\\d{21}",
- "RO": "[A-Z]{4}[\\dA-Z]{16}",
- "SM": "[A-Z]\\d{10}[\\dA-Z]{12}",
- "SA": "\\d{2}[\\dA-Z]{18}",
- "RS": "\\d{18}",
- "SK": "\\d{20}",
- "SI": "\\d{15}",
- "ES": "\\d{20}",
- "SE": "\\d{20}",
- "CH": "\\d{5}[\\dA-Z]{12}",
- "TN": "\\d{20}",
- "TR": "\\d{5}[\\dA-Z]{17}",
- "AE": "\\d{3}\\d{16}",
- "GB": "[A-Z]{4}\\d{14}",
- "VG": "[\\dA-Z]{4}\\d{16}"
- };
-
- bbanpattern = bbancountrypatterns[countrycode];
- // As new countries will start using IBAN in the
- // future, we only check if the countrycode is known.
- // This prevents false negatives, while almost all
- // false positives introduced by this, will be caught
- // by the checksum validation below anyway.
- // Strict checking should return FALSE for unknown
- // countries.
- if (typeof bbanpattern !== "undefined") {
- ibanregexp = new RegExp("^[A-Z]{2}\\d{2}" + bbanpattern + "$", "");
- if (!(ibanregexp.test(iban))) {
- return false; // invalid country specific format
- }
- }
-
- // now check the checksum, first convert to digits
- ibancheck = iban.substring(4, iban.length) + iban.substring(0, 4);
- for (i = 0; i < ibancheck.length; i++) {
- charAt = ibancheck.charAt(i);
- if (charAt !== "0") {
- leadingZeroes = false;
- }
- if (!leadingZeroes) {
- ibancheckdigits += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(charAt);
- }
- }
-
- // calculate the result of: ibancheckdigits % 97
- for (p = 0; p < ibancheckdigits.length; p++) {
- cChar = ibancheckdigits.charAt(p);
- cOperator = "" + cRest + "" + cChar;
- cRest = cOperator % 97;
- }
- return cRest === 1;
-}, "Please specify a valid IBAN");
-
-$.validator.addMethod("integer", function(value, element) {
- return this.optional(element) || /^-?\d+$/.test(value);
-}, "A positive or negative non-decimal number please");
-
-$.validator.addMethod("ipv4", function(value, element) {
- return this.optional(element) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(value);
-}, "Please enter a valid IP v4 address.");
-
-$.validator.addMethod("ipv6", function(value, element) {
- return this.optional(element) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(value);
-}, "Please enter a valid IP v6 address.");
-
-$.validator.addMethod("lettersonly", function(value, element) {
- return this.optional(element) || /^[a-z]+$/i.test(value);
-}, "Letters only please");
-
-$.validator.addMethod("letterswithbasicpunc", function(value, element) {
- return this.optional(element) || /^[a-z\-.,()'"\s]+$/i.test(value);
-}, "Letters or punctuation only please");
-
-$.validator.addMethod("mobileNL", function(value, element) {
- return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(value);
-}, "Please specify a valid mobile number");
-
-/* For UK phone functions, do the following server side processing:
- * Compare original input with this RegEx pattern:
- * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$
- * Extract $1 and set $prefix to '+44' if $1 is '44', otherwise set $prefix to '0'
- * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2.
- * A number of very detailed GB telephone number RegEx patterns can also be found at:
- * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers
- */
-$.validator.addMethod("mobileUK", function(phone_number, element) {
- phone_number = phone_number.replace(/\(|\)|\s+|-/g, "");
- return this.optional(element) || phone_number.length > 9 &&
- phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/);
-}, "Please specify a valid mobile number");
-
-/*
- * The número de identidad de extranjero ( NIE )is a code used to identify the non-nationals in Spain
- */
-$.validator.addMethod( "nieES", function( value ) {
- "use strict";
-
- value = value.toUpperCase();
-
- // Basic format test
- if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) {
- return false;
- }
-
- // Test NIE
- //T
- if ( /^[T]{1}/.test( value ) ) {
- return ( value[ 8 ] === /^[T]{1}[A-Z0-9]{8}$/.test( value ) );
- }
-
- //XYZ
- if ( /^[XYZ]{1}/.test( value ) ) {
- return (
- value[ 8 ] === "TRWAGMYFPDXBNJZSQVHLCKE".charAt(
- value.replace( "X", "0" )
- .replace( "Y", "1" )
- .replace( "Z", "2" )
- .substring( 0, 8 ) % 23
- )
- );
- }
-
- return false;
-
-}, "Please specify a valid NIE number." );
-
-/*
- * The Número de Identificación Fiscal ( NIF ) is the way tax identification used in Spain for individuals
- */
-$.validator.addMethod( "nifES", function( value ) {
- "use strict";
-
- value = value.toUpperCase();
-
- // Basic format test
- if ( !value.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)") ) {
- return false;
- }
-
- // Test NIF
- if ( /^[0-9]{8}[A-Z]{1}$/.test( value ) ) {
- return ( "TRWAGMYFPDXBNJZSQVHLCKE".charAt( value.substring( 8, 0 ) % 23 ) === value.charAt( 8 ) );
- }
- // Test specials NIF (starts with K, L or M)
- if ( /^[KLM]{1}/.test( value ) ) {
- return ( value[ 8 ] === String.fromCharCode( 64 ) );
- }
-
- return false;
-
-}, "Please specify a valid NIF number." );
-
-jQuery.validator.addMethod( "notEqualTo", function( value, element, param ) {
- return this.optional(element) || !$.validator.methods.equalTo.call( this, value, element, param );
-}, "Please enter a different value, values must not be the same." );
-
-$.validator.addMethod("nowhitespace", function(value, element) {
- return this.optional(element) || /^\S+$/i.test(value);
-}, "No white space please");
-
-/**
-* Return true if the field value matches the given format RegExp
-*
-* @example $.validator.methods.pattern("AR1004",element,/^AR\d{4}$/)
-* @result true
-*
-* @example $.validator.methods.pattern("BR1004",element,/^AR\d{4}$/)
-* @result false
-*
-* @name $.validator.methods.pattern
-* @type Boolean
-* @cat Plugins/Validate/Methods
-*/
-$.validator.addMethod("pattern", function(value, element, param) {
- if (this.optional(element)) {
- return true;
- }
- if (typeof param === "string") {
- param = new RegExp("^(?:" + param + ")$");
- }
- return param.test(value);
-}, "Invalid format.");
-
-/**
- * Dutch phone numbers have 10 digits (or 11 and start with +31).
- */
-$.validator.addMethod("phoneNL", function(value, element) {
- return this.optional(element) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(value);
-}, "Please specify a valid phone number.");
-
-/* For UK phone functions, do the following server side processing:
- * Compare original input with this RegEx pattern:
- * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$
- * Extract $1 and set $prefix to '+44' if $1 is '44', otherwise set $prefix to '0'
- * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2.
- * A number of very detailed GB telephone number RegEx patterns can also be found at:
- * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers
- */
-$.validator.addMethod("phoneUK", function(phone_number, element) {
- phone_number = phone_number.replace(/\(|\)|\s+|-/g, "");
- return this.optional(element) || phone_number.length > 9 &&
- phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/);
-}, "Please specify a valid phone number");
-
-/**
- * matches US phone number format
- *
- * where the area code may not start with 1 and the prefix may not start with 1
- * allows '-' or ' ' as a separator and allows parens around area code
- * some people may want to put a '1' in front of their number
- *
- * 1(212)-999-2345 or
- * 212 999 2344 or
- * 212-999-0983
- *
- * but not
- * 111-123-5434
- * and not
- * 212 123 4567
- */
-$.validator.addMethod("phoneUS", function(phone_number, element) {
- phone_number = phone_number.replace(/\s+/g, "");
- return this.optional(element) || phone_number.length > 9 &&
- phone_number.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/);
-}, "Please specify a valid phone number");
-
-/* For UK phone functions, do the following server side processing:
- * Compare original input with this RegEx pattern:
- * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$
- * Extract $1 and set $prefix to '+44' if $1 is '44', otherwise set $prefix to '0'
- * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2.
- * A number of very detailed GB telephone number RegEx patterns can also be found at:
- * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers
- */
-//Matches UK landline + mobile, accepting only 01-3 for landline or 07 for mobile to exclude many premium numbers
-$.validator.addMethod("phonesUK", function(phone_number, element) {
- phone_number = phone_number.replace(/\(|\)|\s+|-/g, "");
- return this.optional(element) || phone_number.length > 9 &&
- phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/);
-}, "Please specify a valid uk phone number");
-
-/**
- * Matches a valid Canadian Postal Code
- *
- * @example jQuery.validator.methods.postalCodeCA( "H0H 0H0", element )
- * @result true
- *
- * @example jQuery.validator.methods.postalCodeCA( "H0H0H0", element )
- * @result false
- *
- * @name jQuery.validator.methods.postalCodeCA
- * @type Boolean
- * @cat Plugins/Validate/Methods
- */
-$.validator.addMethod( "postalCodeCA", function( value, element ) {
- return this.optional( element ) || /^[ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d$/.test( value );
-}, "Please specify a valid postal code" );
-
-/*
-* Valida CEPs do brasileiros:
-*
-* Formatos aceitos:
-* 99999-999
-* 99.999-999
-* 99999999
-*/
-$.validator.addMethod("postalcodeBR", function(cep_value, element) {
- return this.optional(element) || /^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test( cep_value );
-}, "Informe um CEP válido.");
-
-/* Matches Italian postcode (CAP) */
-$.validator.addMethod("postalcodeIT", function(value, element) {
- return this.optional(element) || /^\d{5}$/.test(value);
-}, "Please specify a valid postal code");
-
-$.validator.addMethod("postalcodeNL", function(value, element) {
- return this.optional(element) || /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(value);
-}, "Please specify a valid postal code");
-
-// Matches UK postcode. Does not match to UK Channel Islands that have their own postcodes (non standard UK)
-$.validator.addMethod("postcodeUK", function(value, element) {
- return this.optional(element) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(value);
-}, "Please specify a valid UK postcode");
-
-/*
- * Lets you say "at least X inputs that match selector Y must be filled."
- *
- * The end result is that neither of these inputs:
- *
- *
- *
- *
- * ...will validate unless at least one of them is filled.
- *
- * partnumber: {require_from_group: [1,".productinfo"]},
- * description: {require_from_group: [1,".productinfo"]}
- *
- * options[0]: number of fields that must be filled in the group
- * options[1]: CSS selector that defines the group of conditionally required fields
- */
-$.validator.addMethod("require_from_group", function(value, element, options) {
- var $fields = $(options[1], element.form),
- $fieldsFirst = $fields.eq(0),
- validator = $fieldsFirst.data("valid_req_grp") ? $fieldsFirst.data("valid_req_grp") : $.extend({}, this),
- isValid = $fields.filter(function() {
- return validator.elementValue(this);
- }).length >= options[0];
-
- // Store the cloned validator for future validation
- $fieldsFirst.data("valid_req_grp", validator);
-
- // If element isn't being validated, run each require_from_group field's validation rules
- if (!$(element).data("being_validated")) {
- $fields.data("being_validated", true);
- $fields.each(function() {
- validator.element(this);
- });
- $fields.data("being_validated", false);
- }
- return isValid;
-}, $.validator.format("Please fill at least {0} of these fields."));
-
-/*
- * Lets you say "either at least X inputs that match selector Y must be filled,
- * OR they must all be skipped (left blank)."
- *
- * The end result, is that none of these inputs:
- *
- *
- *
- *
- *
- * ...will validate unless either at least two of them are filled,
- * OR none of them are.
- *
- * partnumber: {skip_or_fill_minimum: [2,".productinfo"]},
- * description: {skip_or_fill_minimum: [2,".productinfo"]},
- * color: {skip_or_fill_minimum: [2,".productinfo"]}
- *
- * options[0]: number of fields that must be filled in the group
- * options[1]: CSS selector that defines the group of conditionally required fields
- *
- */
-$.validator.addMethod("skip_or_fill_minimum", function(value, element, options) {
- var $fields = $(options[1], element.form),
- $fieldsFirst = $fields.eq(0),
- validator = $fieldsFirst.data("valid_skip") ? $fieldsFirst.data("valid_skip") : $.extend({}, this),
- numberFilled = $fields.filter(function() {
- return validator.elementValue(this);
- }).length,
- isValid = numberFilled === 0 || numberFilled >= options[0];
-
- // Store the cloned validator for future validation
- $fieldsFirst.data("valid_skip", validator);
-
- // If element isn't being validated, run each skip_or_fill_minimum field's validation rules
- if (!$(element).data("being_validated")) {
- $fields.data("being_validated", true);
- $fields.each(function() {
- validator.element(this);
- });
- $fields.data("being_validated", false);
- }
- return isValid;
-}, $.validator.format("Please either skip these fields or fill at least {0} of them."));
-
-/* Validates US States and/or Territories by @jdforsythe
- * Can be case insensitive or require capitalization - default is case insensitive
- * Can include US Territories or not - default does not
- * Can include US Military postal abbreviations (AA, AE, AP) - default does not
- *
- * Note: "States" always includes DC (District of Colombia)
- *
- * Usage examples:
- *
- * This is the default - case insensitive, no territories, no military zones
- * stateInput: {
- * caseSensitive: false,
- * includeTerritories: false,
- * includeMilitary: false
- * }
- *
- * Only allow capital letters, no territories, no military zones
- * stateInput: {
- * caseSensitive: false
- * }
- *
- * Case insensitive, include territories but not military zones
- * stateInput: {
- * includeTerritories: true
- * }
- *
- * Only allow capital letters, include territories and military zones
- * stateInput: {
- * caseSensitive: true,
- * includeTerritories: true,
- * includeMilitary: true
- * }
- *
- *
- *
- */
-
-$.validator.addMethod("stateUS", function(value, element, options) {
- var isDefault = typeof options === "undefined",
- caseSensitive = ( isDefault || typeof options.caseSensitive === "undefined" ) ? false : options.caseSensitive,
- includeTerritories = ( isDefault || typeof options.includeTerritories === "undefined" ) ? false : options.includeTerritories,
- includeMilitary = ( isDefault || typeof options.includeMilitary === "undefined" ) ? false : options.includeMilitary,
- regex;
-
- if (!includeTerritories && !includeMilitary) {
- regex = "^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$";
- } else if (includeTerritories && includeMilitary) {
- regex = "^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$";
- } else if (includeTerritories) {
- regex = "^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$";
- } else {
- regex = "^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$";
- }
-
- regex = caseSensitive ? new RegExp(regex) : new RegExp(regex, "i");
- return this.optional(element) || regex.test(value);
-},
-"Please specify a valid state");
-
-// TODO check if value starts with <, otherwise don't try stripping anything
-$.validator.addMethod("strippedminlength", function(value, element, param) {
- return $(value).text().length >= param;
-}, $.validator.format("Please enter at least {0} characters"));
-
-$.validator.addMethod("time", function(value, element) {
- return this.optional(element) || /^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(value);
-}, "Please enter a valid time, between 00:00 and 23:59");
-
-$.validator.addMethod("time12h", function(value, element) {
- return this.optional(element) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(value);
-}, "Please enter a valid time in 12-hour am/pm format");
-
-// same as url, but TLD is optional
-$.validator.addMethod("url2", function(value, element) {
- return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);
-}, $.validator.messages.url);
-
-/**
- * Return true, if the value is a valid vehicle identification number (VIN).
- *
- * Works with all kind of text inputs.
- *
- * @example
- * @desc Declares a required input element whose value must be a valid vehicle identification number.
- *
- * @name $.validator.methods.vinUS
- * @type Boolean
- * @cat Plugins/Validate/Methods
- */
-$.validator.addMethod("vinUS", function(v) {
- if (v.length !== 17) {
- return false;
- }
-
- var LL = [ "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ],
- VL = [ 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 7, 9, 2, 3, 4, 5, 6, 7, 8, 9 ],
- FL = [ 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 ],
- rs = 0,
- i, n, d, f, cd, cdv;
-
- for (i = 0; i < 17; i++) {
- f = FL[i];
- d = v.slice(i, i + 1);
- if (i === 8) {
- cdv = d;
- }
- if (!isNaN(d)) {
- d *= f;
- } else {
- for (n = 0; n < LL.length; n++) {
- if (d.toUpperCase() === LL[n]) {
- d = VL[n];
- d *= f;
- if (isNaN(cdv) && n === 8) {
- cdv = LL[n];
- }
- break;
- }
- }
- }
- rs += d;
- }
- cd = rs % 11;
- if (cd === 10) {
- cd = "X";
- }
- if (cd === cdv) {
- return true;
- }
- return false;
-}, "The specified vehicle identification number (VIN) is invalid.");
-
-$.validator.addMethod("zipcodeUS", function(value, element) {
- return this.optional(element) || /^\d{5}(-\d{4})?$/.test(value);
-}, "The specified US ZIP Code is invalid");
-
-$.validator.addMethod("ziprange", function(value, element) {
- return this.optional(element) || /^90[2-5]\d\{2\}-\d{4}$/.test(value);
-}, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx");
-
-}));
\ No newline at end of file
diff --git a/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation/dist/additional-methods.min.js b/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation/dist/additional-methods.min.js
deleted file mode 100644
index b63c3ca12..000000000
--- a/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation/dist/additional-methods.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015
- * http://jqueryvalidation.org/
- * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */
-!function(a){"function"==typeof define&&define.amd?define(["jquery","./jquery.validate.min"],a):a(jQuery)}(function(a){!function(){function b(a){return a.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g,"")}a.validator.addMethod("maxWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length<=d},a.validator.format("Please enter {0} words or less.")),a.validator.addMethod("minWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length>=d},a.validator.format("Please enter at least {0} words.")),a.validator.addMethod("rangeWords",function(a,c,d){var e=b(a),f=/\b\w+\b/g;return this.optional(c)||e.match(f).length>=d[0]&&e.match(f).length<=d[1]},a.validator.format("Please enter between {0} and {1} words."))}(),a.validator.addMethod("accept",function(b,c,d){var e,f,g="string"==typeof d?d.replace(/\s/g,"").replace(/,/g,"|"):"image/*",h=this.optional(c);if(h)return h;if("file"===a(c).attr("type")&&(g=g.replace(/\*/g,".*"),c.files&&c.files.length))for(e=0;ec;c++)d=h-c,e=f.substring(c,c+1),g+=d*e;return g%11===0},"Please specify a valid bank account number"),a.validator.addMethod("bankorgiroaccountNL",function(b,c){return this.optional(c)||a.validator.methods.bankaccountNL.call(this,b,c)||a.validator.methods.giroaccountNL.call(this,b,c)},"Please specify a valid bank or giro account number"),a.validator.addMethod("bic",function(a,b){return this.optional(b)||/^([A-Z]{6}[A-Z2-9][A-NP-Z1-2])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test(a)},"Please specify a valid BIC code"),a.validator.addMethod("cifES",function(a){"use strict";var b,c,d,e,f,g,h=[];if(a=a.toUpperCase(),!a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)"))return!1;for(d=0;9>d;d++)h[d]=parseInt(a.charAt(d),10);for(c=h[2]+h[4]+h[6],e=1;8>e;e+=2)f=(2*h[e]).toString(),g=f.charAt(1),c+=parseInt(f.charAt(0),10)+(""===g?0:parseInt(g,10));return/^[ABCDEFGHJNPQRSUVW]{1}/.test(a)?(c+="",b=10-parseInt(c.charAt(c.length-1),10),a+=b,h[8].toString()===String.fromCharCode(64+b)||h[8].toString()===a.charAt(a.length-1)):!1},"Please specify a valid CIF number."),a.validator.addMethod("cpfBR",function(a){if(a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,""),11!==a.length)return!1;var b,c,d,e,f=0;if(b=parseInt(a.substring(9,10),10),c=parseInt(a.substring(10,11),10),d=function(a,b){var c=10*a%11;return(10===c||11===c)&&(c=0),c===b},""===a||"00000000000"===a||"11111111111"===a||"22222222222"===a||"33333333333"===a||"44444444444"===a||"55555555555"===a||"66666666666"===a||"77777777777"===a||"88888888888"===a||"99999999999"===a)return!1;for(e=1;9>=e;e++)f+=parseInt(a.substring(e-1,e),10)*(11-e);if(d(f,b)){for(f=0,e=1;10>=e;e++)f+=parseInt(a.substring(e-1,e),10)*(12-e);return d(f,c)}return!1},"Please specify a valid CPF number"),a.validator.addMethod("creditcardtypes",function(a,b,c){if(/[^0-9\-]+/.test(a))return!1;a=a.replace(/\D/g,"");var d=0;return c.mastercard&&(d|=1),c.visa&&(d|=2),c.amex&&(d|=4),c.dinersclub&&(d|=8),c.enroute&&(d|=16),c.discover&&(d|=32),c.jcb&&(d|=64),c.unknown&&(d|=128),c.all&&(d=255),1&d&&/^(5[12345])/.test(a)?16===a.length:2&d&&/^(4)/.test(a)?16===a.length:4&d&&/^(3[47])/.test(a)?15===a.length:8&d&&/^(3(0[012345]|[68]))/.test(a)?14===a.length:16&d&&/^(2(014|149))/.test(a)?15===a.length:32&d&&/^(6011)/.test(a)?16===a.length:64&d&&/^(3)/.test(a)?16===a.length:64&d&&/^(2131|1800)/.test(a)?15===a.length:128&d?!0:!1},"Please enter a valid credit card number."),a.validator.addMethod("currency",function(a,b,c){var d,e="string"==typeof c,f=e?c:c[0],g=e?!0:c[1];return f=f.replace(/,/g,""),f=g?f+"]":f+"]?",d="^["+f+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$",d=new RegExp(d),this.optional(b)||d.test(a)},"Please specify a valid currency"),a.validator.addMethod("dateFA",function(a,b){return this.optional(b)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(a)},a.validator.messages.date),a.validator.addMethod("dateITA",function(a,b){var c,d,e,f,g,h=!1,i=/^\d{1,2}\/\d{1,2}\/\d{4}$/;return i.test(a)?(c=a.split("/"),d=parseInt(c[0],10),e=parseInt(c[1],10),f=parseInt(c[2],10),g=new Date(Date.UTC(f,e-1,d,12,0,0,0)),h=g.getUTCFullYear()===f&&g.getUTCMonth()===e-1&&g.getUTCDate()===d?!0:!1):h=!1,this.optional(b)||h},a.validator.messages.date),a.validator.addMethod("dateNL",function(a,b){return this.optional(b)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(a)},a.validator.messages.date),a.validator.addMethod("extension",function(a,b,c){return c="string"==typeof c?c.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(b)||a.match(new RegExp("\\.("+c+")$","i"))},a.validator.format("Please enter a value with a valid extension.")),a.validator.addMethod("giroaccountNL",function(a,b){return this.optional(b)||/^[0-9]{1,7}$/.test(a)},"Please specify a valid giro account number"),a.validator.addMethod("iban",function(a,b){if(this.optional(b))return!0;var c,d,e,f,g,h,i,j,k,l=a.replace(/ /g,"").toUpperCase(),m="",n=!0,o="",p="";if(c=l.substring(0,2),h={AL:"\\d{8}[\\dA-Z]{16}",AD:"\\d{8}[\\dA-Z]{12}",AT:"\\d{16}",AZ:"[\\dA-Z]{4}\\d{20}",BE:"\\d{12}",BH:"[A-Z]{4}[\\dA-Z]{14}",BA:"\\d{16}",BR:"\\d{23}[A-Z][\\dA-Z]",BG:"[A-Z]{4}\\d{6}[\\dA-Z]{8}",CR:"\\d{17}",HR:"\\d{17}",CY:"\\d{8}[\\dA-Z]{16}",CZ:"\\d{20}",DK:"\\d{14}",DO:"[A-Z]{4}\\d{20}",EE:"\\d{16}",FO:"\\d{14}",FI:"\\d{14}",FR:"\\d{10}[\\dA-Z]{11}\\d{2}",GE:"[\\dA-Z]{2}\\d{16}",DE:"\\d{18}",GI:"[A-Z]{4}[\\dA-Z]{15}",GR:"\\d{7}[\\dA-Z]{16}",GL:"\\d{14}",GT:"[\\dA-Z]{4}[\\dA-Z]{20}",HU:"\\d{24}",IS:"\\d{22}",IE:"[\\dA-Z]{4}\\d{14}",IL:"\\d{19}",IT:"[A-Z]\\d{10}[\\dA-Z]{12}",KZ:"\\d{3}[\\dA-Z]{13}",KW:"[A-Z]{4}[\\dA-Z]{22}",LV:"[A-Z]{4}[\\dA-Z]{13}",LB:"\\d{4}[\\dA-Z]{20}",LI:"\\d{5}[\\dA-Z]{12}",LT:"\\d{16}",LU:"\\d{3}[\\dA-Z]{13}",MK:"\\d{3}[\\dA-Z]{10}\\d{2}",MT:"[A-Z]{4}\\d{5}[\\dA-Z]{18}",MR:"\\d{23}",MU:"[A-Z]{4}\\d{19}[A-Z]{3}",MC:"\\d{10}[\\dA-Z]{11}\\d{2}",MD:"[\\dA-Z]{2}\\d{18}",ME:"\\d{18}",NL:"[A-Z]{4}\\d{10}",NO:"\\d{11}",PK:"[\\dA-Z]{4}\\d{16}",PS:"[\\dA-Z]{4}\\d{21}",PL:"\\d{24}",PT:"\\d{21}",RO:"[A-Z]{4}[\\dA-Z]{16}",SM:"[A-Z]\\d{10}[\\dA-Z]{12}",SA:"\\d{2}[\\dA-Z]{18}",RS:"\\d{18}",SK:"\\d{20}",SI:"\\d{15}",ES:"\\d{20}",SE:"\\d{20}",CH:"\\d{5}[\\dA-Z]{12}",TN:"\\d{20}",TR:"\\d{5}[\\dA-Z]{17}",AE:"\\d{3}\\d{16}",GB:"[A-Z]{4}\\d{14}",VG:"[\\dA-Z]{4}\\d{16}"},g=h[c],"undefined"!=typeof g&&(i=new RegExp("^[A-Z]{2}\\d{2}"+g+"$",""),!i.test(l)))return!1;for(d=l.substring(4,l.length)+l.substring(0,4),j=0;j9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/)},"Please specify a valid mobile number"),a.validator.addMethod("nieES",function(a){"use strict";return a=a.toUpperCase(),a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")?/^[T]{1}/.test(a)?a[8]===/^[T]{1}[A-Z0-9]{8}$/.test(a):/^[XYZ]{1}/.test(a)?a[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.replace("X","0").replace("Y","1").replace("Z","2").substring(0,8)%23):!1:!1},"Please specify a valid NIE number."),a.validator.addMethod("nifES",function(a){"use strict";return a=a.toUpperCase(),a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")?/^[0-9]{8}[A-Z]{1}$/.test(a)?"TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.substring(8,0)%23)===a.charAt(8):/^[KLM]{1}/.test(a)?a[8]===String.fromCharCode(64):!1:!1},"Please specify a valid NIF number."),jQuery.validator.addMethod("notEqualTo",function(b,c,d){return this.optional(c)||!a.validator.methods.equalTo.call(this,b,c,d)},"Please enter a different value, values must not be the same."),a.validator.addMethod("nowhitespace",function(a,b){return this.optional(b)||/^\S+$/i.test(a)},"No white space please"),a.validator.addMethod("pattern",function(a,b,c){return this.optional(b)?!0:("string"==typeof c&&(c=new RegExp("^(?:"+c+")$")),c.test(a))},"Invalid format."),a.validator.addMethod("phoneNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid phone number."),a.validator.addMethod("phoneUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)},"Please specify a valid phone number"),a.validator.addMethod("phoneUS",function(a,b){return a=a.replace(/\s+/g,""),this.optional(b)||a.length>9&&a.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/)},"Please specify a valid phone number"),a.validator.addMethod("phonesUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/)},"Please specify a valid uk phone number"),a.validator.addMethod("postalCodeCA",function(a,b){return this.optional(b)||/^[ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeBR",function(a,b){return this.optional(b)||/^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(a)},"Informe um CEP válido."),a.validator.addMethod("postalcodeIT",function(a,b){return this.optional(b)||/^\d{5}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeNL",function(a,b){return this.optional(b)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postcodeUK",function(a,b){return this.optional(b)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(a)},"Please specify a valid UK postcode"),a.validator.addMethod("require_from_group",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_req_grp")?f.data("valid_req_grp"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length>=d[0];return f.data("valid_req_grp",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),h},a.validator.format("Please fill at least {0} of these fields.")),a.validator.addMethod("skip_or_fill_minimum",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_skip")?f.data("valid_skip"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length,i=0===h||h>=d[0];return f.data("valid_skip",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),i},a.validator.format("Please either skip these fields or fill at least {0} of them.")),a.validator.addMethod("stateUS",function(a,b,c){var d,e="undefined"==typeof c,f=e||"undefined"==typeof c.caseSensitive?!1:c.caseSensitive,g=e||"undefined"==typeof c.includeTerritories?!1:c.includeTerritories,h=e||"undefined"==typeof c.includeMilitary?!1:c.includeMilitary;return d=g||h?g&&h?"^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":g?"^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":"^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$":"^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$",d=f?new RegExp(d):new RegExp(d,"i"),this.optional(b)||d.test(a)},"Please specify a valid state"),a.validator.addMethod("strippedminlength",function(b,c,d){return a(b).text().length>=d},a.validator.format("Please enter at least {0} characters")),a.validator.addMethod("time",function(a,b){return this.optional(b)||/^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(a)},"Please enter a valid time, between 00:00 and 23:59"),a.validator.addMethod("time12h",function(a,b){return this.optional(b)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(a)},"Please enter a valid time in 12-hour am/pm format"),a.validator.addMethod("url2",function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},a.validator.messages.url),a.validator.addMethod("vinUS",function(a){if(17!==a.length)return!1;var b,c,d,e,f,g,h=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],i=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],j=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],k=0;for(b=0;17>b;b++){if(e=j[b],d=a.slice(b,b+1),8===b&&(g=d),isNaN(d)){for(c=0;c" )
- .attr( "name", validator.submitButton.name )
- .val( $( validator.submitButton ).val() )
- .appendTo( validator.currentForm );
- }
- result = validator.settings.submitHandler.call( validator, validator.currentForm, event );
- if ( validator.submitButton ) {
- // and clean up afterwards; thanks to no-block-scope, hidden can be referenced
- hidden.remove();
- }
- if ( result !== undefined ) {
- return result;
- }
- return false;
- }
- return true;
- }
-
- // prevent submit for invalid forms or custom submit handlers
- if ( validator.cancelSubmit ) {
- validator.cancelSubmit = false;
- return handle();
- }
- if ( validator.form() ) {
- if ( validator.pendingRequest ) {
- validator.formSubmitted = true;
- return false;
- }
- return handle();
- } else {
- validator.focusInvalid();
- return false;
- }
- });
- }
-
- return validator;
- },
- // http://jqueryvalidation.org/valid/
- valid: function() {
- var valid, validator, errorList;
-
- if ( $( this[ 0 ] ).is( "form" ) ) {
- valid = this.validate().form();
- } else {
- errorList = [];
- valid = true;
- validator = $( this[ 0 ].form ).validate();
- this.each( function() {
- valid = validator.element( this ) && valid;
- errorList = errorList.concat( validator.errorList );
- });
- validator.errorList = errorList;
- }
- return valid;
- },
-
- // http://jqueryvalidation.org/rules/
- rules: function( command, argument ) {
- var element = this[ 0 ],
- settings, staticRules, existingRules, data, param, filtered;
-
- if ( command ) {
- settings = $.data( element.form, "validator" ).settings;
- staticRules = settings.rules;
- existingRules = $.validator.staticRules( element );
- switch ( command ) {
- case "add":
- $.extend( existingRules, $.validator.normalizeRule( argument ) );
- // remove messages from rules, but allow them to be set separately
- delete existingRules.messages;
- staticRules[ element.name ] = existingRules;
- if ( argument.messages ) {
- settings.messages[ element.name ] = $.extend( settings.messages[ element.name ], argument.messages );
- }
- break;
- case "remove":
- if ( !argument ) {
- delete staticRules[ element.name ];
- return existingRules;
- }
- filtered = {};
- $.each( argument.split( /\s/ ), function( index, method ) {
- filtered[ method ] = existingRules[ method ];
- delete existingRules[ method ];
- if ( method === "required" ) {
- $( element ).removeAttr( "aria-required" );
- }
- });
- return filtered;
- }
- }
-
- data = $.validator.normalizeRules(
- $.extend(
- {},
- $.validator.classRules( element ),
- $.validator.attributeRules( element ),
- $.validator.dataRules( element ),
- $.validator.staticRules( element )
- ), element );
-
- // make sure required is at front
- if ( data.required ) {
- param = data.required;
- delete data.required;
- data = $.extend( { required: param }, data );
- $( element ).attr( "aria-required", "true" );
- }
-
- // make sure remote is at back
- if ( data.remote ) {
- param = data.remote;
- delete data.remote;
- data = $.extend( data, { remote: param });
- }
-
- return data;
- }
-});
-
-// Custom selectors
-$.extend( $.expr[ ":" ], {
- // http://jqueryvalidation.org/blank-selector/
- blank: function( a ) {
- return !$.trim( "" + $( a ).val() );
- },
- // http://jqueryvalidation.org/filled-selector/
- filled: function( a ) {
- return !!$.trim( "" + $( a ).val() );
- },
- // http://jqueryvalidation.org/unchecked-selector/
- unchecked: function( a ) {
- return !$( a ).prop( "checked" );
- }
-});
-
-// constructor for validator
-$.validator = function( options, form ) {
- this.settings = $.extend( true, {}, $.validator.defaults, options );
- this.currentForm = form;
- this.init();
-};
-
-// http://jqueryvalidation.org/jQuery.validator.format/
-$.validator.format = function( source, params ) {
- if ( arguments.length === 1 ) {
- return function() {
- var args = $.makeArray( arguments );
- args.unshift( source );
- return $.validator.format.apply( this, args );
- };
- }
- if ( arguments.length > 2 && params.constructor !== Array ) {
- params = $.makeArray( arguments ).slice( 1 );
- }
- if ( params.constructor !== Array ) {
- params = [ params ];
- }
- $.each( params, function( i, n ) {
- source = source.replace( new RegExp( "\\{" + i + "\\}", "g" ), function() {
- return n;
- });
- });
- return source;
-};
-
-$.extend( $.validator, {
-
- defaults: {
- messages: {},
- groups: {},
- rules: {},
- errorClass: "error",
- validClass: "valid",
- errorElement: "label",
- focusCleanup: false,
- focusInvalid: true,
- errorContainer: $( [] ),
- errorLabelContainer: $( [] ),
- onsubmit: true,
- ignore: ":hidden",
- ignoreTitle: false,
- onfocusin: function( element ) {
- this.lastActive = element;
-
- // Hide error label and remove error class on focus if enabled
- if ( this.settings.focusCleanup ) {
- if ( this.settings.unhighlight ) {
- this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass );
- }
- this.hideThese( this.errorsFor( element ) );
- }
- },
- onfocusout: function( element ) {
- if ( !this.checkable( element ) && ( element.name in this.submitted || !this.optional( element ) ) ) {
- this.element( element );
- }
- },
- onkeyup: function( element, event ) {
- // Avoid revalidate the field when pressing one of the following keys
- // Shift => 16
- // Ctrl => 17
- // Alt => 18
- // Caps lock => 20
- // End => 35
- // Home => 36
- // Left arrow => 37
- // Up arrow => 38
- // Right arrow => 39
- // Down arrow => 40
- // Insert => 45
- // Num lock => 144
- // AltGr key => 225
- var excludedKeys = [
- 16, 17, 18, 20, 35, 36, 37,
- 38, 39, 40, 45, 144, 225
- ];
-
- if ( event.which === 9 && this.elementValue( element ) === "" || $.inArray( event.keyCode, excludedKeys ) !== -1 ) {
- return;
- } else if ( element.name in this.submitted || element === this.lastElement ) {
- this.element( element );
- }
- },
- onclick: function( element ) {
- // click on selects, radiobuttons and checkboxes
- if ( element.name in this.submitted ) {
- this.element( element );
-
- // or option elements, check parent select in that case
- } else if ( element.parentNode.name in this.submitted ) {
- this.element( element.parentNode );
- }
- },
- highlight: function( element, errorClass, validClass ) {
- if ( element.type === "radio" ) {
- this.findByName( element.name ).addClass( errorClass ).removeClass( validClass );
- } else {
- $( element ).addClass( errorClass ).removeClass( validClass );
- }
- },
- unhighlight: function( element, errorClass, validClass ) {
- if ( element.type === "radio" ) {
- this.findByName( element.name ).removeClass( errorClass ).addClass( validClass );
- } else {
- $( element ).removeClass( errorClass ).addClass( validClass );
- }
- }
- },
-
- // http://jqueryvalidation.org/jQuery.validator.setDefaults/
- setDefaults: function( settings ) {
- $.extend( $.validator.defaults, settings );
- },
-
- messages: {
- required: "This field is required.",
- remote: "Please fix this field.",
- email: "Please enter a valid email address.",
- url: "Please enter a valid URL.",
- date: "Please enter a valid date.",
- dateISO: "Please enter a valid date ( ISO ).",
- number: "Please enter a valid number.",
- digits: "Please enter only digits.",
- creditcard: "Please enter a valid credit card number.",
- equalTo: "Please enter the same value again.",
- maxlength: $.validator.format( "Please enter no more than {0} characters." ),
- minlength: $.validator.format( "Please enter at least {0} characters." ),
- rangelength: $.validator.format( "Please enter a value between {0} and {1} characters long." ),
- range: $.validator.format( "Please enter a value between {0} and {1}." ),
- max: $.validator.format( "Please enter a value less than or equal to {0}." ),
- min: $.validator.format( "Please enter a value greater than or equal to {0}." )
- },
-
- autoCreateRanges: false,
-
- prototype: {
-
- init: function() {
- this.labelContainer = $( this.settings.errorLabelContainer );
- this.errorContext = this.labelContainer.length && this.labelContainer || $( this.currentForm );
- this.containers = $( this.settings.errorContainer ).add( this.settings.errorLabelContainer );
- this.submitted = {};
- this.valueCache = {};
- this.pendingRequest = 0;
- this.pending = {};
- this.invalid = {};
- this.reset();
-
- var groups = ( this.groups = {} ),
- rules;
- $.each( this.settings.groups, function( key, value ) {
- if ( typeof value === "string" ) {
- value = value.split( /\s/ );
- }
- $.each( value, function( index, name ) {
- groups[ name ] = key;
- });
- });
- rules = this.settings.rules;
- $.each( rules, function( key, value ) {
- rules[ key ] = $.validator.normalizeRule( value );
- });
-
- function delegate( event ) {
- var validator = $.data( this.form, "validator" ),
- eventType = "on" + event.type.replace( /^validate/, "" ),
- settings = validator.settings;
- if ( settings[ eventType ] && !$( this ).is( settings.ignore ) ) {
- settings[ eventType ].call( validator, this, event );
- }
- }
-
- $( this.currentForm )
- .on( "focusin.validate focusout.validate keyup.validate",
- ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " +
- "[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " +
- "[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " +
- "[type='radio'], [type='checkbox']", delegate)
- // Support: Chrome, oldIE
- // "select" is provided as event.target when clicking a option
- .on("click.validate", "select, option, [type='radio'], [type='checkbox']", delegate);
-
- if ( this.settings.invalidHandler ) {
- $( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler );
- }
-
- // Add aria-required to any Static/Data/Class required fields before first validation
- // Screen readers require this attribute to be present before the initial submission http://www.w3.org/TR/WCAG-TECHS/ARIA2.html
- $( this.currentForm ).find( "[required], [data-rule-required], .required" ).attr( "aria-required", "true" );
- },
-
- // http://jqueryvalidation.org/Validator.form/
- form: function() {
- this.checkForm();
- $.extend( this.submitted, this.errorMap );
- this.invalid = $.extend({}, this.errorMap );
- if ( !this.valid() ) {
- $( this.currentForm ).triggerHandler( "invalid-form", [ this ]);
- }
- this.showErrors();
- return this.valid();
- },
-
- checkForm: function() {
- this.prepareForm();
- for ( var i = 0, elements = ( this.currentElements = this.elements() ); elements[ i ]; i++ ) {
- this.check( elements[ i ] );
- }
- return this.valid();
- },
-
- // http://jqueryvalidation.org/Validator.element/
- element: function( element ) {
- var cleanElement = this.clean( element ),
- checkElement = this.validationTargetFor( cleanElement ),
- result = true;
-
- this.lastElement = checkElement;
-
- if ( checkElement === undefined ) {
- delete this.invalid[ cleanElement.name ];
- } else {
- this.prepareElement( checkElement );
- this.currentElements = $( checkElement );
-
- result = this.check( checkElement ) !== false;
- if ( result ) {
- delete this.invalid[ checkElement.name ];
- } else {
- this.invalid[ checkElement.name ] = true;
- }
- }
- // Add aria-invalid status for screen readers
- $( element ).attr( "aria-invalid", !result );
-
- if ( !this.numberOfInvalids() ) {
- // Hide error containers on last error
- this.toHide = this.toHide.add( this.containers );
- }
- this.showErrors();
- return result;
- },
-
- // http://jqueryvalidation.org/Validator.showErrors/
- showErrors: function( errors ) {
- if ( errors ) {
- // add items to error list and map
- $.extend( this.errorMap, errors );
- this.errorList = [];
- for ( var name in errors ) {
- this.errorList.push({
- message: errors[ name ],
- element: this.findByName( name )[ 0 ]
- });
- }
- // remove items from success list
- this.successList = $.grep( this.successList, function( element ) {
- return !( element.name in errors );
- });
- }
- if ( this.settings.showErrors ) {
- this.settings.showErrors.call( this, this.errorMap, this.errorList );
- } else {
- this.defaultShowErrors();
- }
- },
-
- // http://jqueryvalidation.org/Validator.resetForm/
- resetForm: function() {
- if ( $.fn.resetForm ) {
- $( this.currentForm ).resetForm();
- }
- this.submitted = {};
- this.lastElement = null;
- this.prepareForm();
- this.hideErrors();
- var i, elements = this.elements()
- .removeData( "previousValue" )
- .removeAttr( "aria-invalid" );
-
- if ( this.settings.unhighlight ) {
- for ( i = 0; elements[ i ]; i++ ) {
- this.settings.unhighlight.call( this, elements[ i ],
- this.settings.errorClass, "" );
- }
- } else {
- elements.removeClass( this.settings.errorClass );
- }
- },
-
- numberOfInvalids: function() {
- return this.objectLength( this.invalid );
- },
-
- objectLength: function( obj ) {
- /* jshint unused: false */
- var count = 0,
- i;
- for ( i in obj ) {
- count++;
- }
- return count;
- },
-
- hideErrors: function() {
- this.hideThese( this.toHide );
- },
-
- hideThese: function( errors ) {
- errors.not( this.containers ).text( "" );
- this.addWrapper( errors ).hide();
- },
-
- valid: function() {
- return this.size() === 0;
- },
-
- size: function() {
- return this.errorList.length;
- },
-
- focusInvalid: function() {
- if ( this.settings.focusInvalid ) {
- try {
- $( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || [])
- .filter( ":visible" )
- .focus()
- // manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find
- .trigger( "focusin" );
- } catch ( e ) {
- // ignore IE throwing errors when focusing hidden elements
- }
- }
- },
-
- findLastActive: function() {
- var lastActive = this.lastActive;
- return lastActive && $.grep( this.errorList, function( n ) {
- return n.element.name === lastActive.name;
- }).length === 1 && lastActive;
- },
-
- elements: function() {
- var validator = this,
- rulesCache = {};
-
- // select all valid inputs inside the form (no submit or reset buttons)
- return $( this.currentForm )
- .find( "input, select, textarea" )
- .not( ":submit, :reset, :image, :disabled" )
- .not( this.settings.ignore )
- .filter( function() {
- if ( !this.name && validator.settings.debug && window.console ) {
- console.error( "%o has no name assigned", this );
- }
-
- // select only the first element for each name, and only those with rules specified
- if ( this.name in rulesCache || !validator.objectLength( $( this ).rules() ) ) {
- return false;
- }
-
- rulesCache[ this.name ] = true;
- return true;
- });
- },
-
- clean: function( selector ) {
- return $( selector )[ 0 ];
- },
-
- errors: function() {
- var errorClass = this.settings.errorClass.split( " " ).join( "." );
- return $( this.settings.errorElement + "." + errorClass, this.errorContext );
- },
-
- reset: function() {
- this.successList = [];
- this.errorList = [];
- this.errorMap = {};
- this.toShow = $( [] );
- this.toHide = $( [] );
- this.currentElements = $( [] );
- },
-
- prepareForm: function() {
- this.reset();
- this.toHide = this.errors().add( this.containers );
- },
-
- prepareElement: function( element ) {
- this.reset();
- this.toHide = this.errorsFor( element );
- },
-
- elementValue: function( element ) {
- var val,
- $element = $( element ),
- type = element.type;
-
- if ( type === "radio" || type === "checkbox" ) {
- return this.findByName( element.name ).filter(":checked").val();
- } else if ( type === "number" && typeof element.validity !== "undefined" ) {
- return element.validity.badInput ? false : $element.val();
- }
-
- val = $element.val();
- if ( typeof val === "string" ) {
- return val.replace(/\r/g, "" );
- }
- return val;
- },
-
- check: function( element ) {
- element = this.validationTargetFor( this.clean( element ) );
-
- var rules = $( element ).rules(),
- rulesCount = $.map( rules, function( n, i ) {
- return i;
- }).length,
- dependencyMismatch = false,
- val = this.elementValue( element ),
- result, method, rule;
-
- for ( method in rules ) {
- rule = { method: method, parameters: rules[ method ] };
- try {
-
- result = $.validator.methods[ method ].call( this, val, element, rule.parameters );
-
- // if a method indicates that the field is optional and therefore valid,
- // don't mark it as valid when there are no other rules
- if ( result === "dependency-mismatch" && rulesCount === 1 ) {
- dependencyMismatch = true;
- continue;
- }
- dependencyMismatch = false;
-
- if ( result === "pending" ) {
- this.toHide = this.toHide.not( this.errorsFor( element ) );
- return;
- }
-
- if ( !result ) {
- this.formatAndAdd( element, rule );
- return false;
- }
- } catch ( e ) {
- if ( this.settings.debug && window.console ) {
- console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e );
- }
- if ( e instanceof TypeError ) {
- e.message += ". Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.";
- }
-
- throw e;
- }
- }
- if ( dependencyMismatch ) {
- return;
- }
- if ( this.objectLength( rules ) ) {
- this.successList.push( element );
- }
- return true;
- },
-
- // return the custom message for the given element and validation method
- // specified in the element's HTML5 data attribute
- // return the generic message if present and no method specific message is present
- customDataMessage: function( element, method ) {
- return $( element ).data( "msg" + method.charAt( 0 ).toUpperCase() +
- method.substring( 1 ).toLowerCase() ) || $( element ).data( "msg" );
- },
-
- // return the custom message for the given element name and validation method
- customMessage: function( name, method ) {
- var m = this.settings.messages[ name ];
- return m && ( m.constructor === String ? m : m[ method ]);
- },
-
- // return the first defined argument, allowing empty strings
- findDefined: function() {
- for ( var i = 0; i < arguments.length; i++) {
- if ( arguments[ i ] !== undefined ) {
- return arguments[ i ];
- }
- }
- return undefined;
- },
-
- defaultMessage: function( element, method ) {
- return this.findDefined(
- this.customMessage( element.name, method ),
- this.customDataMessage( element, method ),
- // title is never undefined, so handle empty string as undefined
- !this.settings.ignoreTitle && element.title || undefined,
- $.validator.messages[ method ],
- "Warning: No message defined for " + element.name + ""
- );
- },
-
- formatAndAdd: function( element, rule ) {
- var message = this.defaultMessage( element, rule.method ),
- theregex = /\$?\{(\d+)\}/g;
- if ( typeof message === "function" ) {
- message = message.call( this, rule.parameters, element );
- } else if ( theregex.test( message ) ) {
- message = $.validator.format( message.replace( theregex, "{$1}" ), rule.parameters );
- }
- this.errorList.push({
- message: message,
- element: element,
- method: rule.method
- });
-
- this.errorMap[ element.name ] = message;
- this.submitted[ element.name ] = message;
- },
-
- addWrapper: function( toToggle ) {
- if ( this.settings.wrapper ) {
- toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) );
- }
- return toToggle;
- },
-
- defaultShowErrors: function() {
- var i, elements, error;
- for ( i = 0; this.errorList[ i ]; i++ ) {
- error = this.errorList[ i ];
- if ( this.settings.highlight ) {
- this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass );
- }
- this.showLabel( error.element, error.message );
- }
- if ( this.errorList.length ) {
- this.toShow = this.toShow.add( this.containers );
- }
- if ( this.settings.success ) {
- for ( i = 0; this.successList[ i ]; i++ ) {
- this.showLabel( this.successList[ i ] );
- }
- }
- if ( this.settings.unhighlight ) {
- for ( i = 0, elements = this.validElements(); elements[ i ]; i++ ) {
- this.settings.unhighlight.call( this, elements[ i ], this.settings.errorClass, this.settings.validClass );
- }
- }
- this.toHide = this.toHide.not( this.toShow );
- this.hideErrors();
- this.addWrapper( this.toShow ).show();
- },
-
- validElements: function() {
- return this.currentElements.not( this.invalidElements() );
- },
-
- invalidElements: function() {
- return $( this.errorList ).map(function() {
- return this.element;
- });
- },
-
- showLabel: function( element, message ) {
- var place, group, errorID,
- error = this.errorsFor( element ),
- elementID = this.idOrName( element ),
- describedBy = $( element ).attr( "aria-describedby" );
- if ( error.length ) {
- // refresh error/success class
- error.removeClass( this.settings.validClass ).addClass( this.settings.errorClass );
- // replace message on existing label
- error.html( message );
- } else {
- // create error element
- error = $( "<" + this.settings.errorElement + ">" )
- .attr( "id", elementID + "-error" )
- .addClass( this.settings.errorClass )
- .html( message || "" );
-
- // Maintain reference to the element to be placed into the DOM
- place = error;
- if ( this.settings.wrapper ) {
- // make sure the element is visible, even in IE
- // actually showing the wrapped element is handled elsewhere
- place = error.hide().show().wrap( "<" + this.settings.wrapper + "/>" ).parent();
- }
- if ( this.labelContainer.length ) {
- this.labelContainer.append( place );
- } else if ( this.settings.errorPlacement ) {
- this.settings.errorPlacement( place, $( element ) );
- } else {
- place.insertAfter( element );
- }
-
- // Link error back to the element
- if ( error.is( "label" ) ) {
- // If the error is a label, then associate using 'for'
- error.attr( "for", elementID );
- } else if ( error.parents( "label[for='" + elementID + "']" ).length === 0 ) {
- // If the element is not a child of an associated label, then it's necessary
- // to explicitly apply aria-describedby
-
- errorID = error.attr( "id" ).replace( /(:|\.|\[|\]|\$)/g, "\\$1");
- // Respect existing non-error aria-describedby
- if ( !describedBy ) {
- describedBy = errorID;
- } else if ( !describedBy.match( new RegExp( "\\b" + errorID + "\\b" ) ) ) {
- // Add to end of list if not already present
- describedBy += " " + errorID;
- }
- $( element ).attr( "aria-describedby", describedBy );
-
- // If this element is grouped, then assign to all elements in the same group
- group = this.groups[ element.name ];
- if ( group ) {
- $.each( this.groups, function( name, testgroup ) {
- if ( testgroup === group ) {
- $( "[name='" + name + "']", this.currentForm )
- .attr( "aria-describedby", error.attr( "id" ) );
- }
- });
- }
- }
- }
- if ( !message && this.settings.success ) {
- error.text( "" );
- if ( typeof this.settings.success === "string" ) {
- error.addClass( this.settings.success );
- } else {
- this.settings.success( error, element );
- }
- }
- this.toShow = this.toShow.add( error );
- },
-
- errorsFor: function( element ) {
- var name = this.idOrName( element ),
- describer = $( element ).attr( "aria-describedby" ),
- selector = "label[for='" + name + "'], label[for='" + name + "'] *";
-
- // aria-describedby should directly reference the error element
- if ( describer ) {
- selector = selector + ", #" + describer.replace( /\s+/g, ", #" );
- }
- return this
- .errors()
- .filter( selector );
- },
-
- idOrName: function( element ) {
- return this.groups[ element.name ] || ( this.checkable( element ) ? element.name : element.id || element.name );
- },
-
- validationTargetFor: function( element ) {
-
- // If radio/checkbox, validate first element in group instead
- if ( this.checkable( element ) ) {
- element = this.findByName( element.name );
- }
-
- // Always apply ignore filter
- return $( element ).not( this.settings.ignore )[ 0 ];
- },
-
- checkable: function( element ) {
- return ( /radio|checkbox/i ).test( element.type );
- },
-
- findByName: function( name ) {
- return $( this.currentForm ).find( "[name='" + name + "']" );
- },
-
- getLength: function( value, element ) {
- switch ( element.nodeName.toLowerCase() ) {
- case "select":
- return $( "option:selected", element ).length;
- case "input":
- if ( this.checkable( element ) ) {
- return this.findByName( element.name ).filter( ":checked" ).length;
- }
- }
- return value.length;
- },
-
- depend: function( param, element ) {
- return this.dependTypes[typeof param] ? this.dependTypes[typeof param]( param, element ) : true;
- },
-
- dependTypes: {
- "boolean": function( param ) {
- return param;
- },
- "string": function( param, element ) {
- return !!$( param, element.form ).length;
- },
- "function": function( param, element ) {
- return param( element );
- }
- },
-
- optional: function( element ) {
- var val = this.elementValue( element );
- return !$.validator.methods.required.call( this, val, element ) && "dependency-mismatch";
- },
-
- startRequest: function( element ) {
- if ( !this.pending[ element.name ] ) {
- this.pendingRequest++;
- this.pending[ element.name ] = true;
- }
- },
-
- stopRequest: function( element, valid ) {
- this.pendingRequest--;
- // sometimes synchronization fails, make sure pendingRequest is never < 0
- if ( this.pendingRequest < 0 ) {
- this.pendingRequest = 0;
- }
- delete this.pending[ element.name ];
- if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) {
- $( this.currentForm ).submit();
- this.formSubmitted = false;
- } else if (!valid && this.pendingRequest === 0 && this.formSubmitted ) {
- $( this.currentForm ).triggerHandler( "invalid-form", [ this ]);
- this.formSubmitted = false;
- }
- },
-
- previousValue: function( element ) {
- return $.data( element, "previousValue" ) || $.data( element, "previousValue", {
- old: null,
- valid: true,
- message: this.defaultMessage( element, "remote" )
- });
- },
-
- // cleans up all forms and elements, removes validator-specific events
- destroy: function() {
- this.resetForm();
-
- $( this.currentForm )
- .off( ".validate" )
- .removeData( "validator" );
- }
-
- },
-
- classRuleSettings: {
- required: { required: true },
- email: { email: true },
- url: { url: true },
- date: { date: true },
- dateISO: { dateISO: true },
- number: { number: true },
- digits: { digits: true },
- creditcard: { creditcard: true }
- },
-
- addClassRules: function( className, rules ) {
- if ( className.constructor === String ) {
- this.classRuleSettings[ className ] = rules;
- } else {
- $.extend( this.classRuleSettings, className );
- }
- },
-
- classRules: function( element ) {
- var rules = {},
- classes = $( element ).attr( "class" );
-
- if ( classes ) {
- $.each( classes.split( " " ), function() {
- if ( this in $.validator.classRuleSettings ) {
- $.extend( rules, $.validator.classRuleSettings[ this ]);
- }
- });
- }
- return rules;
- },
-
- normalizeAttributeRule: function( rules, type, method, value ) {
-
- // convert the value to a number for number inputs, and for text for backwards compability
- // allows type="date" and others to be compared as strings
- if ( /min|max/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) {
- value = Number( value );
-
- // Support Opera Mini, which returns NaN for undefined minlength
- if ( isNaN( value ) ) {
- value = undefined;
- }
- }
-
- if ( value || value === 0 ) {
- rules[ method ] = value;
- } else if ( type === method && type !== "range" ) {
-
- // exception: the jquery validate 'range' method
- // does not test for the html5 'range' type
- rules[ method ] = true;
- }
- },
-
- attributeRules: function( element ) {
- var rules = {},
- $element = $( element ),
- type = element.getAttribute( "type" ),
- method, value;
-
- for ( method in $.validator.methods ) {
-
- // support for in both html5 and older browsers
- if ( method === "required" ) {
- value = element.getAttribute( method );
-
- // Some browsers return an empty string for the required attribute
- // and non-HTML5 browsers might have required="" markup
- if ( value === "" ) {
- value = true;
- }
-
- // force non-HTML5 browsers to return bool
- value = !!value;
- } else {
- value = $element.attr( method );
- }
-
- this.normalizeAttributeRule( rules, type, method, value );
- }
-
- // maxlength may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs
- if ( rules.maxlength && /-1|2147483647|524288/.test( rules.maxlength ) ) {
- delete rules.maxlength;
- }
-
- return rules;
- },
-
- dataRules: function( element ) {
- var rules = {},
- $element = $( element ),
- type = element.getAttribute( "type" ),
- method, value;
-
- for ( method in $.validator.methods ) {
- value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() );
- this.normalizeAttributeRule( rules, type, method, value );
- }
- return rules;
- },
-
- staticRules: function( element ) {
- var rules = {},
- validator = $.data( element.form, "validator" );
-
- if ( validator.settings.rules ) {
- rules = $.validator.normalizeRule( validator.settings.rules[ element.name ] ) || {};
- }
- return rules;
- },
-
- normalizeRules: function( rules, element ) {
- // handle dependency check
- $.each( rules, function( prop, val ) {
- // ignore rule when param is explicitly false, eg. required:false
- if ( val === false ) {
- delete rules[ prop ];
- return;
- }
- if ( val.param || val.depends ) {
- var keepRule = true;
- switch ( typeof val.depends ) {
- case "string":
- keepRule = !!$( val.depends, element.form ).length;
- break;
- case "function":
- keepRule = val.depends.call( element, element );
- break;
- }
- if ( keepRule ) {
- rules[ prop ] = val.param !== undefined ? val.param : true;
- } else {
- delete rules[ prop ];
- }
- }
- });
-
- // evaluate parameters
- $.each( rules, function( rule, parameter ) {
- rules[ rule ] = $.isFunction( parameter ) ? parameter( element ) : parameter;
- });
-
- // clean number parameters
- $.each([ "minlength", "maxlength" ], function() {
- if ( rules[ this ] ) {
- rules[ this ] = Number( rules[ this ] );
- }
- });
- $.each([ "rangelength", "range" ], function() {
- var parts;
- if ( rules[ this ] ) {
- if ( $.isArray( rules[ this ] ) ) {
- rules[ this ] = [ Number( rules[ this ][ 0 ]), Number( rules[ this ][ 1 ] ) ];
- } else if ( typeof rules[ this ] === "string" ) {
- parts = rules[ this ].replace(/[\[\]]/g, "" ).split( /[\s,]+/ );
- rules[ this ] = [ Number( parts[ 0 ]), Number( parts[ 1 ] ) ];
- }
- }
- });
-
- if ( $.validator.autoCreateRanges ) {
- // auto-create ranges
- if ( rules.min != null && rules.max != null ) {
- rules.range = [ rules.min, rules.max ];
- delete rules.min;
- delete rules.max;
- }
- if ( rules.minlength != null && rules.maxlength != null ) {
- rules.rangelength = [ rules.minlength, rules.maxlength ];
- delete rules.minlength;
- delete rules.maxlength;
- }
- }
-
- return rules;
- },
-
- // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true}
- normalizeRule: function( data ) {
- if ( typeof data === "string" ) {
- var transformed = {};
- $.each( data.split( /\s/ ), function() {
- transformed[ this ] = true;
- });
- data = transformed;
- }
- return data;
- },
-
- // http://jqueryvalidation.org/jQuery.validator.addMethod/
- addMethod: function( name, method, message ) {
- $.validator.methods[ name ] = method;
- $.validator.messages[ name ] = message !== undefined ? message : $.validator.messages[ name ];
- if ( method.length < 3 ) {
- $.validator.addClassRules( name, $.validator.normalizeRule( name ) );
- }
- },
-
- methods: {
-
- // http://jqueryvalidation.org/required-method/
- required: function( value, element, param ) {
- // check if dependency is met
- if ( !this.depend( param, element ) ) {
- return "dependency-mismatch";
- }
- if ( element.nodeName.toLowerCase() === "select" ) {
- // could be an array for select-multiple or a string, both are fine this way
- var val = $( element ).val();
- return val && val.length > 0;
- }
- if ( this.checkable( element ) ) {
- return this.getLength( value, element ) > 0;
- }
- return value.length > 0;
- },
-
- // http://jqueryvalidation.org/email-method/
- email: function( value, element ) {
- // From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address
- // Retrieved 2014-01-14
- // If you have a problem with this implementation, report a bug against the above spec
- // Or use custom methods to implement your own email validation
- return this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value );
- },
-
- // http://jqueryvalidation.org/url-method/
- url: function( value, element ) {
-
- // Copyright (c) 2010-2013 Diego Perini, MIT licensed
- // https://gist.github.com/dperini/729294
- // see also https://mathiasbynens.be/demo/url-regex
- // modified to allow protocol-relative URLs
- return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value );
- },
-
- // http://jqueryvalidation.org/date-method/
- date: function( value, element ) {
- return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() );
- },
-
- // http://jqueryvalidation.org/dateISO-method/
- dateISO: function( value, element ) {
- return this.optional( element ) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test( value );
- },
-
- // http://jqueryvalidation.org/number-method/
- number: function( value, element ) {
- return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value );
- },
-
- // http://jqueryvalidation.org/digits-method/
- digits: function( value, element ) {
- return this.optional( element ) || /^\d+$/.test( value );
- },
-
- // http://jqueryvalidation.org/creditcard-method/
- // based on http://en.wikipedia.org/wiki/Luhn_algorithm
- creditcard: function( value, element ) {
- if ( this.optional( element ) ) {
- return "dependency-mismatch";
- }
- // accept only spaces, digits and dashes
- if ( /[^0-9 \-]+/.test( value ) ) {
- return false;
- }
- var nCheck = 0,
- nDigit = 0,
- bEven = false,
- n, cDigit;
-
- value = value.replace( /\D/g, "" );
-
- // Basing min and max length on
- // http://developer.ean.com/general_info/Valid_Credit_Card_Types
- if ( value.length < 13 || value.length > 19 ) {
- return false;
- }
-
- for ( n = value.length - 1; n >= 0; n--) {
- cDigit = value.charAt( n );
- nDigit = parseInt( cDigit, 10 );
- if ( bEven ) {
- if ( ( nDigit *= 2 ) > 9 ) {
- nDigit -= 9;
- }
- }
- nCheck += nDigit;
- bEven = !bEven;
- }
-
- return ( nCheck % 10 ) === 0;
- },
-
- // http://jqueryvalidation.org/minlength-method/
- minlength: function( value, element, param ) {
- var length = $.isArray( value ) ? value.length : this.getLength( value, element );
- return this.optional( element ) || length >= param;
- },
-
- // http://jqueryvalidation.org/maxlength-method/
- maxlength: function( value, element, param ) {
- var length = $.isArray( value ) ? value.length : this.getLength( value, element );
- return this.optional( element ) || length <= param;
- },
-
- // http://jqueryvalidation.org/rangelength-method/
- rangelength: function( value, element, param ) {
- var length = $.isArray( value ) ? value.length : this.getLength( value, element );
- return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] );
- },
-
- // http://jqueryvalidation.org/min-method/
- min: function( value, element, param ) {
- return this.optional( element ) || value >= param;
- },
-
- // http://jqueryvalidation.org/max-method/
- max: function( value, element, param ) {
- return this.optional( element ) || value <= param;
- },
-
- // http://jqueryvalidation.org/range-method/
- range: function( value, element, param ) {
- return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] );
- },
-
- // http://jqueryvalidation.org/equalTo-method/
- equalTo: function( value, element, param ) {
- // bind to the blur event of the target in order to revalidate whenever the target field is updated
- // TODO find a way to bind the event just once, avoiding the unbind-rebind overhead
- var target = $( param );
- if ( this.settings.onfocusout ) {
- target.off( ".validate-equalTo" ).on( "blur.validate-equalTo", function() {
- $( element ).valid();
- });
- }
- return value === target.val();
- },
-
- // http://jqueryvalidation.org/remote-method/
- remote: function( value, element, param ) {
- if ( this.optional( element ) ) {
- return "dependency-mismatch";
- }
-
- var previous = this.previousValue( element ),
- validator, data;
-
- if (!this.settings.messages[ element.name ] ) {
- this.settings.messages[ element.name ] = {};
- }
- previous.originalMessage = this.settings.messages[ element.name ].remote;
- this.settings.messages[ element.name ].remote = previous.message;
-
- param = typeof param === "string" && { url: param } || param;
-
- if ( previous.old === value ) {
- return previous.valid;
- }
-
- previous.old = value;
- validator = this;
- this.startRequest( element );
- data = {};
- data[ element.name ] = value;
- $.ajax( $.extend( true, {
- mode: "abort",
- port: "validate" + element.name,
- dataType: "json",
- data: data,
- context: validator.currentForm,
- success: function( response ) {
- var valid = response === true || response === "true",
- errors, message, submitted;
-
- validator.settings.messages[ element.name ].remote = previous.originalMessage;
- if ( valid ) {
- submitted = validator.formSubmitted;
- validator.prepareElement( element );
- validator.formSubmitted = submitted;
- validator.successList.push( element );
- delete validator.invalid[ element.name ];
- validator.showErrors();
- } else {
- errors = {};
- message = response || validator.defaultMessage( element, "remote" );
- errors[ element.name ] = previous.message = $.isFunction( message ) ? message( value ) : message;
- validator.invalid[ element.name ] = true;
- validator.showErrors( errors );
- }
- previous.valid = valid;
- validator.stopRequest( element, valid );
- }
- }, param ) );
- return "pending";
- }
- }
-
-});
-
-// ajax mode: abort
-// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]});
-// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()
-
-var pendingRequests = {},
- ajax;
-// Use a prefilter if available (1.5+)
-if ( $.ajaxPrefilter ) {
- $.ajaxPrefilter(function( settings, _, xhr ) {
- var port = settings.port;
- if ( settings.mode === "abort" ) {
- if ( pendingRequests[port] ) {
- pendingRequests[port].abort();
- }
- pendingRequests[port] = xhr;
- }
- });
-} else {
- // Proxy ajax
- ajax = $.ajax;
- $.ajax = function( settings ) {
- var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode,
- port = ( "port" in settings ? settings : $.ajaxSettings ).port;
- if ( mode === "abort" ) {
- if ( pendingRequests[port] ) {
- pendingRequests[port].abort();
- }
- pendingRequests[port] = ajax.apply(this, arguments);
- return pendingRequests[port];
- }
- return ajax.apply(this, arguments);
- };
-}
-
-}));
\ No newline at end of file
diff --git a/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation/dist/jquery.validate.min.js b/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation/dist/jquery.validate.min.js
deleted file mode 100644
index 643837b90..000000000
--- a/src/Services/Identity/Identity.API/wwwroot/lib/jquery-validation/dist/jquery.validate.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! jQuery Validation Plugin - v1.14.0 - 6/30/2015
- * http://jqueryvalidation.org/
- * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */
-!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return c.settings.submitHandler?(c.submitButton&&(d=a("").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),e=c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),void 0!==e?e:!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,d=d.concat(c.errorList)}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){return!!a.trim(""+a(b).val())},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||-1!==a.inArray(c.keyCode,d)||(b.name in this.submitted||b===this.lastElement)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this.form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!a(this).is(e.ignore)&&e[d].call(c,this,b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler),a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c=this.clean(b),d=this.validationTargetFor(c),e=!0;return this.lastElement=d,void 0===d?delete this.invalid[c.name]:(this.prepareElement(d),this.currentElements=a(d),e=this.check(d)!==!1,e?delete this.invalid[d.name]:this.invalid[d.name]=!0),a(b).attr("aria-invalid",!e),this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),e},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors();var b,c=this.elements().removeData("previousValue").removeAttr("aria-invalid");if(this.settings.unhighlight)for(b=0;c[b];b++)this.settings.unhighlight.call(this,c[b],this.settings.errorClass,"");else c.removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d=a(b),e=b.type;return"radio"===e||"checkbox"===e?this.findByName(b.name).filter(":checked").val():"number"===e&&"undefined"!=typeof b.validity?b.validity.badInput?!1:d.val():(c=d.val(),"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f=a(b).rules(),g=a.map(f,function(a,b){return b}).length,h=!1,i=this.elementValue(b);for(d in f){e={method:d,parameters:f[d]};try{if(c=a.validator.methods[d].call(this,i,b,e.parameters),"dependency-mismatch"===c&&1===g){h=!0;continue}if(h=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(j){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",j),j instanceof TypeError&&(j.message+=". Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),j}}if(!h)return this.objectLength(f)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;aWarning: No message defined for "+b.name+"")},formatAndAdd:function(b,c){var d=this.defaultMessage(b,c.method),e=/\$?\{(\d+)\}/g;"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({message:d,element:b,method:c.method}),this.errorMap[b.name]=d,this.submitted[b.name]=d},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g=this.errorsFor(b),h=this.idOrName(b),i=a(b).attr("aria-describedby");g.length?(g.removeClass(this.settings.validClass).addClass(this.settings.errorClass),g.html(c)):(g=a("<"+this.settings.errorElement+">").attr("id",h+"-error").addClass(this.settings.errorClass).html(c||""),d=g,this.settings.wrapper&&(d=g.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b),g.is("label")?g.attr("for",h):0===g.parents("label[for='"+h+"']").length&&(f=g.attr("id").replace(/(:|\.|\[|\]|\$)/g,"\\$1"),i?i.match(new RegExp("\\b"+f+"\\b"))||(i+=" "+f):i=f,a(b).attr("aria-describedby",i),e=this.groups[b.name],e&&a.each(this.groups,function(b,c){c===e&&a("[name='"+b+"']",this.currentForm).attr("aria-describedby",g.attr("id"))}))),!c&&this.settings.success&&(g.text(""),"string"==typeof this.settings.success?g.addClass(this.settings.success):this.settings.success(g,b)),this.toShow=this.toShow.add(g)},errorsFor:function(b){var c=this.idOrName(b),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+d.replace(/\s+/g,", #")),this.errors().filter(e)},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+b+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a[c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||d>=e},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.off(".validate-equalTo").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e,f,g=this.previousValue(c);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),g.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=g.message,d="string"==typeof d&&{url:d}||d,g.old===b?g.valid:(g.old=b,e=this,this.startRequest(c),f={},f[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:f,context:e.currentForm,success:function(d){var f,h,i,j=d===!0||"true"===d;e.settings.messages[c.name].remote=g.originalMessage,j?(i=e.formSubmitted,e.prepareElement(c),e.formSubmitted=i,e.successList.push(c),delete e.invalid[c.name],e.showErrors()):(f={},h=d||e.defaultMessage(c,"remote"),f[c.name]=g.message=a.isFunction(h)?h(b):h,e.invalid[c.name]=!0,e.showErrors(f)),g.valid=j,e.stopRequest(c,j)}},d)),"pending")}}});var b,c={};a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)})});
\ No newline at end of file
diff --git a/src/Services/Identity/Identity.API/wwwroot/lib/jquery/.bower.json b/src/Services/Identity/Identity.API/wwwroot/lib/jquery/.bower.json
deleted file mode 100644
index 419488b5b..000000000
--- a/src/Services/Identity/Identity.API/wwwroot/lib/jquery/.bower.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "name": "jquery",
- "main": "dist/jquery.js",
- "license": "MIT",
- "ignore": [
- "package.json"
- ],
- "keywords": [
- "jquery",
- "javascript",
- "browser",
- "library"
- ],
- "homepage": "https://github.com/jquery/jquery-dist",
- "version": "2.2.0",
- "_release": "2.2.0",
- "_resolution": {
- "type": "version",
- "tag": "2.2.0",
- "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5"
- },
- "_source": "git://github.com/jquery/jquery-dist.git",
- "_target": "2.2.0",
- "_originalSource": "jquery"
-}
\ No newline at end of file
diff --git a/src/Services/Identity/Identity.API/wwwroot/lib/jquery/LICENSE.txt b/src/Services/Identity/Identity.API/wwwroot/lib/jquery/LICENSE.txt
deleted file mode 100644
index 5312a4c86..000000000
--- a/src/Services/Identity/Identity.API/wwwroot/lib/jquery/LICENSE.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-Copyright jQuery Foundation and other contributors, https://jquery.org/
-
-This software consists of voluntary contributions made by many
-individuals. For exact contribution history, see the revision history
-available at https://github.com/jquery/jquery
-
-The following license applies to all parts of this software except as
-documented below:
-
-====
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-====
-
-All files located in the node_modules and external directories are
-externally maintained libraries used by this software which have their
-own licenses; we recommend you read them, as their terms may differ from
-the terms above.
diff --git a/src/Services/Identity/Identity.API/wwwroot/lib/jquery/dist/jquery.js b/src/Services/Identity/Identity.API/wwwroot/lib/jquery/dist/jquery.js
deleted file mode 100644
index 1e0ba9974..000000000
--- a/src/Services/Identity/Identity.API/wwwroot/lib/jquery/dist/jquery.js
+++ /dev/null
@@ -1,9831 +0,0 @@
-/*!
- * jQuery JavaScript Library v2.2.0
- * http://jquery.com/
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: 2016-01-08T20:02Z
- */
-
-(function( global, factory ) {
-
- if ( typeof module === "object" && typeof module.exports === "object" ) {
- // For CommonJS and CommonJS-like environments where a proper `window`
- // is present, execute the factory and get jQuery.
- // For environments that do not have a `window` with a `document`
- // (such as Node.js), expose a factory as module.exports.
- // This accentuates the need for the creation of a real `window`.
- // e.g. var jQuery = require("jquery")(window);
- // See ticket #14549 for more info.
- module.exports = global.document ?
- factory( global, true ) :
- function( w ) {
- if ( !w.document ) {
- throw new Error( "jQuery requires a window with a document" );
- }
- return factory( w );
- };
- } else {
- factory( global );
- }
-
-// Pass this if window is not defined yet
-}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
-
-// Support: Firefox 18+
-// Can't be in strict mode, several libs including ASP.NET trace
-// the stack via arguments.caller.callee and Firefox dies if
-// you try to trace through "use strict" call chains. (#13335)
-//"use strict";
-var arr = [];
-
-var document = window.document;
-
-var slice = arr.slice;
-
-var concat = arr.concat;
-
-var push = arr.push;
-
-var indexOf = arr.indexOf;
-
-var class2type = {};
-
-var toString = class2type.toString;
-
-var hasOwn = class2type.hasOwnProperty;
-
-var support = {};
-
-
-
-var
- version = "2.2.0",
-
- // Define a local copy of jQuery
- jQuery = function( selector, context ) {
-
- // The jQuery object is actually just the init constructor 'enhanced'
- // Need init if jQuery is called (just allow error to be thrown if not included)
- return new jQuery.fn.init( selector, context );
- },
-
- // Support: Android<4.1
- // Make sure we trim BOM and NBSP
- rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
-
- // Matches dashed string for camelizing
- rmsPrefix = /^-ms-/,
- rdashAlpha = /-([\da-z])/gi,
-
- // Used by jQuery.camelCase as callback to replace()
- fcamelCase = function( all, letter ) {
- return letter.toUpperCase();
- };
-
-jQuery.fn = jQuery.prototype = {
-
- // The current version of jQuery being used
- jquery: version,
-
- constructor: jQuery,
-
- // Start with an empty selector
- selector: "",
-
- // The default length of a jQuery object is 0
- length: 0,
-
- toArray: function() {
- return slice.call( this );
- },
-
- // Get the Nth element in the matched element set OR
- // Get the whole matched element set as a clean array
- get: function( num ) {
- return num != null ?
-
- // Return just the one element from the set
- ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
-
- // Return all the elements in a clean array
- slice.call( this );
- },
-
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function( elems ) {
-
- // Build a new jQuery matched element set
- var ret = jQuery.merge( this.constructor(), elems );
-
- // Add the old object onto the stack (as a reference)
- ret.prevObject = this;
- ret.context = this.context;
-
- // Return the newly-formed element set
- return ret;
- },
-
- // Execute a callback for every element in the matched set.
- each: function( callback ) {
- return jQuery.each( this, callback );
- },
-
- map: function( callback ) {
- return this.pushStack( jQuery.map( this, function( elem, i ) {
- return callback.call( elem, i, elem );
- } ) );
- },
-
- slice: function() {
- return this.pushStack( slice.apply( this, arguments ) );
- },
-
- first: function() {
- return this.eq( 0 );
- },
-
- last: function() {
- return this.eq( -1 );
- },
-
- eq: function( i ) {
- var len = this.length,
- j = +i + ( i < 0 ? len : 0 );
- return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
- },
-
- end: function() {
- return this.prevObject || this.constructor();
- },
-
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push: push,
- sort: arr.sort,
- splice: arr.splice
-};
-
-jQuery.extend = jQuery.fn.extend = function() {
- var options, name, src, copy, copyIsArray, clone,
- target = arguments[ 0 ] || {},
- i = 1,
- length = arguments.length,
- deep = false;
-
- // Handle a deep copy situation
- if ( typeof target === "boolean" ) {
- deep = target;
-
- // Skip the boolean and the target
- target = arguments[ i ] || {};
- i++;
- }
-
- // Handle case when target is a string or something (possible in deep copy)
- if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
- target = {};
- }
-
- // Extend jQuery itself if only one argument is passed
- if ( i === length ) {
- target = this;
- i--;
- }
-
- for ( ; i < length; i++ ) {
-
- // Only deal with non-null/undefined values
- if ( ( options = arguments[ i ] ) != null ) {
-
- // Extend the base object
- for ( name in options ) {
- src = target[ name ];
- copy = options[ name ];
-
- // Prevent never-ending loop
- if ( target === copy ) {
- continue;
- }
-
- // Recurse if we're merging plain objects or arrays
- if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
- ( copyIsArray = jQuery.isArray( copy ) ) ) ) {
-
- if ( copyIsArray ) {
- copyIsArray = false;
- clone = src && jQuery.isArray( src ) ? src : [];
-
- } else {
- clone = src && jQuery.isPlainObject( src ) ? src : {};
- }
-
- // Never move original objects, clone them
- target[ name ] = jQuery.extend( deep, clone, copy );
-
- // Don't bring in undefined values
- } else if ( copy !== undefined ) {
- target[ name ] = copy;
- }
- }
- }
- }
-
- // Return the modified object
- return target;
-};
-
-jQuery.extend( {
-
- // Unique for each copy of jQuery on the page
- expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
-
- // Assume jQuery is ready without the ready module
- isReady: true,
-
- error: function( msg ) {
- throw new Error( msg );
- },
-
- noop: function() {},
-
- isFunction: function( obj ) {
- return jQuery.type( obj ) === "function";
- },
-
- isArray: Array.isArray,
-
- isWindow: function( obj ) {
- return obj != null && obj === obj.window;
- },
-
- isNumeric: function( obj ) {
-
- // parseFloat NaNs numeric-cast false positives (null|true|false|"")
- // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
- // subtraction forces infinities to NaN
- // adding 1 corrects loss of precision from parseFloat (#15100)
- var realStringObj = obj && obj.toString();
- return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;
- },
-
- isPlainObject: function( obj ) {
-
- // Not plain objects:
- // - Any object or value whose internal [[Class]] property is not "[object Object]"
- // - DOM nodes
- // - window
- if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
- return false;
- }
-
- if ( obj.constructor &&
- !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
- return false;
- }
-
- // If the function hasn't returned already, we're confident that
- // |obj| is a plain object, created by {} or constructed with new Object
- return true;
- },
-
- isEmptyObject: function( obj ) {
- var name;
- for ( name in obj ) {
- return false;
- }
- return true;
- },
-
- type: function( obj ) {
- if ( obj == null ) {
- return obj + "";
- }
-
- // Support: Android<4.0, iOS<6 (functionish RegExp)
- return typeof obj === "object" || typeof obj === "function" ?
- class2type[ toString.call( obj ) ] || "object" :
- typeof obj;
- },
-
- // Evaluates a script in a global context
- globalEval: function( code ) {
- var script,
- indirect = eval;
-
- code = jQuery.trim( code );
-
- if ( code ) {
-
- // If the code includes a valid, prologue position
- // strict mode pragma, execute code by injecting a
- // script tag into the document.
- if ( code.indexOf( "use strict" ) === 1 ) {
- script = document.createElement( "script" );
- script.text = code;
- document.head.appendChild( script ).parentNode.removeChild( script );
- } else {
-
- // Otherwise, avoid the DOM node creation, insertion
- // and removal by using an indirect global eval
-
- indirect( code );
- }
- }
- },
-
- // Convert dashed to camelCase; used by the css and data modules
- // Support: IE9-11+
- // Microsoft forgot to hump their vendor prefix (#9572)
- camelCase: function( string ) {
- return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
- },
-
- nodeName: function( elem, name ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
- },
-
- each: function( obj, callback ) {
- var length, i = 0;
-
- if ( isArrayLike( obj ) ) {
- length = obj.length;
- for ( ; i < length; i++ ) {
- if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
- break;
- }
- }
- } else {
- for ( i in obj ) {
- if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
- break;
- }
- }
- }
-
- return obj;
- },
-
- // Support: Android<4.1
- trim: function( text ) {
- return text == null ?
- "" :
- ( text + "" ).replace( rtrim, "" );
- },
-
- // results is for internal usage only
- makeArray: function( arr, results ) {
- var ret = results || [];
-
- if ( arr != null ) {
- if ( isArrayLike( Object( arr ) ) ) {
- jQuery.merge( ret,
- typeof arr === "string" ?
- [ arr ] : arr
- );
- } else {
- push.call( ret, arr );
- }
- }
-
- return ret;
- },
-
- inArray: function( elem, arr, i ) {
- return arr == null ? -1 : indexOf.call( arr, elem, i );
- },
-
- merge: function( first, second ) {
- var len = +second.length,
- j = 0,
- i = first.length;
-
- for ( ; j < len; j++ ) {
- first[ i++ ] = second[ j ];
- }
-
- first.length = i;
-
- return first;
- },
-
- grep: function( elems, callback, invert ) {
- var callbackInverse,
- matches = [],
- i = 0,
- length = elems.length,
- callbackExpect = !invert;
-
- // Go through the array, only saving the items
- // that pass the validator function
- for ( ; i < length; i++ ) {
- callbackInverse = !callback( elems[ i ], i );
- if ( callbackInverse !== callbackExpect ) {
- matches.push( elems[ i ] );
- }
- }
-
- return matches;
- },
-
- // arg is for internal usage only
- map: function( elems, callback, arg ) {
- var length, value,
- i = 0,
- ret = [];
-
- // Go through the array, translating each of the items to their new values
- if ( isArrayLike( elems ) ) {
- length = elems.length;
- for ( ; i < length; i++ ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret.push( value );
- }
- }
-
- // Go through every key on the object,
- } else {
- for ( i in elems ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret.push( value );
- }
- }
- }
-
- // Flatten any nested arrays
- return concat.apply( [], ret );
- },
-
- // A global GUID counter for objects
- guid: 1,
-
- // Bind a function to a context, optionally partially applying any
- // arguments.
- proxy: function( fn, context ) {
- var tmp, args, proxy;
-
- if ( typeof context === "string" ) {
- tmp = fn[ context ];
- context = fn;
- fn = tmp;
- }
-
- // Quick check to determine if target is callable, in the spec
- // this throws a TypeError, but we will just return undefined.
- if ( !jQuery.isFunction( fn ) ) {
- return undefined;
- }
-
- // Simulated bind
- args = slice.call( arguments, 2 );
- proxy = function() {
- return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
- };
-
- // Set the guid of unique handler to the same of original handler, so it can be removed
- proxy.guid = fn.guid = fn.guid || jQuery.guid++;
-
- return proxy;
- },
-
- now: Date.now,
-
- // jQuery.support is not used in Core but other projects attach their
- // properties to it so it needs to exist.
- support: support
-} );
-
-// JSHint would error on this code due to the Symbol not being defined in ES5.
-// Defining this global in .jshintrc would create a danger of using the global
-// unguarded in another place, it seems safer to just disable JSHint for these
-// three lines.
-/* jshint ignore: start */
-if ( typeof Symbol === "function" ) {
- jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
-}
-/* jshint ignore: end */
-
-// Populate the class2type map
-jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
-function( i, name ) {
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
-} );
-
-function isArrayLike( obj ) {
-
- // Support: iOS 8.2 (not reproducible in simulator)
- // `in` check used to prevent JIT error (gh-2145)
- // hasOwn isn't used here due to false negatives
- // regarding Nodelist length in IE
- var length = !!obj && "length" in obj && obj.length,
- type = jQuery.type( obj );
-
- if ( type === "function" || jQuery.isWindow( obj ) ) {
- return false;
- }
-
- return type === "array" || length === 0 ||
- typeof length === "number" && length > 0 && ( length - 1 ) in obj;
-}
-var Sizzle =
-/*!
- * Sizzle CSS Selector Engine v2.2.1
- * http://sizzlejs.com/
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: 2015-10-17
- */
-(function( window ) {
-
-var i,
- support,
- Expr,
- getText,
- isXML,
- tokenize,
- compile,
- select,
- outermostContext,
- sortInput,
- hasDuplicate,
-
- // Local document vars
- setDocument,
- document,
- docElem,
- documentIsHTML,
- rbuggyQSA,
- rbuggyMatches,
- matches,
- contains,
-
- // Instance-specific data
- expando = "sizzle" + 1 * new Date(),
- preferredDoc = window.document,
- dirruns = 0,
- done = 0,
- classCache = createCache(),
- tokenCache = createCache(),
- compilerCache = createCache(),
- sortOrder = function( a, b ) {
- if ( a === b ) {
- hasDuplicate = true;
- }
- return 0;
- },
-
- // General-purpose constants
- MAX_NEGATIVE = 1 << 31,
-
- // Instance methods
- hasOwn = ({}).hasOwnProperty,
- arr = [],
- pop = arr.pop,
- push_native = arr.push,
- push = arr.push,
- slice = arr.slice,
- // Use a stripped-down indexOf as it's faster than native
- // http://jsperf.com/thor-indexof-vs-for/5
- indexOf = function( list, elem ) {
- var i = 0,
- len = list.length;
- for ( ; i < len; i++ ) {
- if ( list[i] === elem ) {
- return i;
- }
- }
- return -1;
- },
-
- booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
-
- // Regular expressions
-
- // http://www.w3.org/TR/css3-selectors/#whitespace
- whitespace = "[\\x20\\t\\r\\n\\f]",
-
- // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
- identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
-
- // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
- attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
- // Operator (capture 2)
- "*([*^$|!~]?=)" + whitespace +
- // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
- "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
- "*\\]",
-
- pseudos = ":(" + identifier + ")(?:\\((" +
- // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
- // 1. quoted (capture 3; capture 4 or capture 5)
- "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
- // 2. simple (capture 6)
- "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
- // 3. anything else (capture 2)
- ".*" +
- ")\\)|)",
-
- // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
- rwhitespace = new RegExp( whitespace + "+", "g" ),
- rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
-
- rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
- rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
-
- rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
-
- rpseudo = new RegExp( pseudos ),
- ridentifier = new RegExp( "^" + identifier + "$" ),
-
- matchExpr = {
- "ID": new RegExp( "^#(" + identifier + ")" ),
- "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
- "TAG": new RegExp( "^(" + identifier + "|[*])" ),
- "ATTR": new RegExp( "^" + attributes ),
- "PSEUDO": new RegExp( "^" + pseudos ),
- "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
- "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
- "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
- "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
- // For use in libraries implementing .is()
- // We use this for POS matching in `select`
- "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
- whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
- },
-
- rinputs = /^(?:input|select|textarea|button)$/i,
- rheader = /^h\d$/i,
-
- rnative = /^[^{]+\{\s*\[native \w/,
-
- // Easily-parseable/retrievable ID or TAG or CLASS selectors
- rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
-
- rsibling = /[+~]/,
- rescape = /'|\\/g,
-
- // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
- runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
- funescape = function( _, escaped, escapedWhitespace ) {
- var high = "0x" + escaped - 0x10000;
- // NaN means non-codepoint
- // Support: Firefox<24
- // Workaround erroneous numeric interpretation of +"0x"
- return high !== high || escapedWhitespace ?
- escaped :
- high < 0 ?
- // BMP codepoint
- String.fromCharCode( high + 0x10000 ) :
- // Supplemental Plane codepoint (surrogate pair)
- String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
- },
-
- // Used for iframes
- // See setDocument()
- // Removing the function wrapper causes a "Permission Denied"
- // error in IE
- unloadHandler = function() {
- setDocument();
- };
-
-// Optimize for push.apply( _, NodeList )
-try {
- push.apply(
- (arr = slice.call( preferredDoc.childNodes )),
- preferredDoc.childNodes
- );
- // Support: Android<4.0
- // Detect silently failing push.apply
- arr[ preferredDoc.childNodes.length ].nodeType;
-} catch ( e ) {
- push = { apply: arr.length ?
-
- // Leverage slice if possible
- function( target, els ) {
- push_native.apply( target, slice.call(els) );
- } :
-
- // Support: IE<9
- // Otherwise append directly
- function( target, els ) {
- var j = target.length,
- i = 0;
- // Can't trust NodeList.length
- while ( (target[j++] = els[i++]) ) {}
- target.length = j - 1;
- }
- };
-}
-
-function Sizzle( selector, context, results, seed ) {
- var m, i, elem, nid, nidselect, match, groups, newSelector,
- newContext = context && context.ownerDocument,
-
- // nodeType defaults to 9, since context defaults to document
- nodeType = context ? context.nodeType : 9;
-
- results = results || [];
-
- // Return early from calls with invalid selector or context
- if ( typeof selector !== "string" || !selector ||
- nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
-
- return results;
- }
-
- // Try to shortcut find operations (as opposed to filters) in HTML documents
- if ( !seed ) {
-
- if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
- setDocument( context );
- }
- context = context || document;
-
- if ( documentIsHTML ) {
-
- // If the selector is sufficiently simple, try using a "get*By*" DOM method
- // (excepting DocumentFragment context, where the methods don't exist)
- if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
-
- // ID selector
- if ( (m = match[1]) ) {
-
- // Document context
- if ( nodeType === 9 ) {
- if ( (elem = context.getElementById( m )) ) {
-
- // Support: IE, Opera, Webkit
- // TODO: identify versions
- // getElementById can match elements by name instead of ID
- if ( elem.id === m ) {
- results.push( elem );
- return results;
- }
- } else {
- return results;
- }
-
- // Element context
- } else {
-
- // Support: IE, Opera, Webkit
- // TODO: identify versions
- // getElementById can match elements by name instead of ID
- if ( newContext && (elem = newContext.getElementById( m )) &&
- contains( context, elem ) &&
- elem.id === m ) {
-
- results.push( elem );
- return results;
- }
- }
-
- // Type selector
- } else if ( match[2] ) {
- push.apply( results, context.getElementsByTagName( selector ) );
- return results;
-
- // Class selector
- } else if ( (m = match[3]) && support.getElementsByClassName &&
- context.getElementsByClassName ) {
-
- push.apply( results, context.getElementsByClassName( m ) );
- return results;
- }
- }
-
- // Take advantage of querySelectorAll
- if ( support.qsa &&
- !compilerCache[ selector + " " ] &&
- (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
-
- if ( nodeType !== 1 ) {
- newContext = context;
- newSelector = selector;
-
- // qSA looks outside Element context, which is not what we want
- // Thanks to Andrew Dupont for this workaround technique
- // Support: IE <=8
- // Exclude object elements
- } else if ( context.nodeName.toLowerCase() !== "object" ) {
-
- // Capture the context ID, setting it first if necessary
- if ( (nid = context.getAttribute( "id" )) ) {
- nid = nid.replace( rescape, "\\$&" );
- } else {
- context.setAttribute( "id", (nid = expando) );
- }
-
- // Prefix every selector in the list
- groups = tokenize( selector );
- i = groups.length;
- nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']";
- while ( i-- ) {
- groups[i] = nidselect + " " + toSelector( groups[i] );
- }
- newSelector = groups.join( "," );
-
- // Expand context for sibling selectors
- newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
- context;
- }
-
- if ( newSelector ) {
- try {
- push.apply( results,
- newContext.querySelectorAll( newSelector )
- );
- return results;
- } catch ( qsaError ) {
- } finally {
- if ( nid === expando ) {
- context.removeAttribute( "id" );
- }
- }
- }
- }
- }
- }
-
- // All others
- return select( selector.replace( rtrim, "$1" ), context, results, seed );
-}
-
-/**
- * Create key-value caches of limited size
- * @returns {function(string, object)} Returns the Object data after storing it on itself with
- * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
- * deleting the oldest entry
- */
-function createCache() {
- var keys = [];
-
- function cache( key, value ) {
- // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
- if ( keys.push( key + " " ) > Expr.cacheLength ) {
- // Only keep the most recent entries
- delete cache[ keys.shift() ];
- }
- return (cache[ key + " " ] = value);
- }
- return cache;
-}
-
-/**
- * Mark a function for special use by Sizzle
- * @param {Function} fn The function to mark
- */
-function markFunction( fn ) {
- fn[ expando ] = true;
- return fn;
-}
-
-/**
- * Support testing using an element
- * @param {Function} fn Passed the created div and expects a boolean result
- */
-function assert( fn ) {
- var div = document.createElement("div");
-
- try {
- return !!fn( div );
- } catch (e) {
- return false;
- } finally {
- // Remove from its parent by default
- if ( div.parentNode ) {
- div.parentNode.removeChild( div );
- }
- // release memory in IE
- div = null;
- }
-}
-
-/**
- * Adds the same handler for all of the specified attrs
- * @param {String} attrs Pipe-separated list of attributes
- * @param {Function} handler The method that will be applied
- */
-function addHandle( attrs, handler ) {
- var arr = attrs.split("|"),
- i = arr.length;
-
- while ( i-- ) {
- Expr.attrHandle[ arr[i] ] = handler;
- }
-}
-
-/**
- * Checks document order of two siblings
- * @param {Element} a
- * @param {Element} b
- * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
- */
-function siblingCheck( a, b ) {
- var cur = b && a,
- diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
- ( ~b.sourceIndex || MAX_NEGATIVE ) -
- ( ~a.sourceIndex || MAX_NEGATIVE );
-
- // Use IE sourceIndex if available on both nodes
- if ( diff ) {
- return diff;
- }
-
- // Check if b follows a
- if ( cur ) {
- while ( (cur = cur.nextSibling) ) {
- if ( cur === b ) {
- return -1;
- }
- }
- }
-
- return a ? 1 : -1;
-}
-
-/**
- * Returns a function to use in pseudos for input types
- * @param {String} type
- */
-function createInputPseudo( type ) {
- return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === type;
- };
-}
-
-/**
- * Returns a function to use in pseudos for buttons
- * @param {String} type
- */
-function createButtonPseudo( type ) {
- return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return (name === "input" || name === "button") && elem.type === type;
- };
-}
-
-/**
- * Returns a function to use in pseudos for positionals
- * @param {Function} fn
- */
-function createPositionalPseudo( fn ) {
- return markFunction(function( argument ) {
- argument = +argument;
- return markFunction(function( seed, matches ) {
- var j,
- matchIndexes = fn( [], seed.length, argument ),
- i = matchIndexes.length;
-
- // Match elements found at the specified indexes
- while ( i-- ) {
- if ( seed[ (j = matchIndexes[i]) ] ) {
- seed[j] = !(matches[j] = seed[j]);
- }
- }
- });
- });
-}
-
-/**
- * Checks a node for validity as a Sizzle context
- * @param {Element|Object=} context
- * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
- */
-function testContext( context ) {
- return context && typeof context.getElementsByTagName !== "undefined" && context;
-}
-
-// Expose support vars for convenience
-support = Sizzle.support = {};
-
-/**
- * Detects XML nodes
- * @param {Element|Object} elem An element or a document
- * @returns {Boolean} True iff elem is a non-HTML XML node
- */
-isXML = Sizzle.isXML = function( elem ) {
- // documentElement is verified for cases where it doesn't yet exist
- // (such as loading iframes in IE - #4833)
- var documentElement = elem && (elem.ownerDocument || elem).documentElement;
- return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
-
-/**
- * Sets document-related variables once based on the current document
- * @param {Element|Object} [doc] An element or document object to use to set the document
- * @returns {Object} Returns the current document
- */
-setDocument = Sizzle.setDocument = function( node ) {
- var hasCompare, parent,
- doc = node ? node.ownerDocument || node : preferredDoc;
-
- // Return early if doc is invalid or already selected
- if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
- return document;
- }
-
- // Update global variables
- document = doc;
- docElem = document.documentElement;
- documentIsHTML = !isXML( document );
-
- // Support: IE 9-11, Edge
- // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
- if ( (parent = document.defaultView) && parent.top !== parent ) {
- // Support: IE 11
- if ( parent.addEventListener ) {
- parent.addEventListener( "unload", unloadHandler, false );
-
- // Support: IE 9 - 10 only
- } else if ( parent.attachEvent ) {
- parent.attachEvent( "onunload", unloadHandler );
- }
- }
-
- /* Attributes
- ---------------------------------------------------------------------- */
-
- // Support: IE<8
- // Verify that getAttribute really returns attributes and not properties
- // (excepting IE8 booleans)
- support.attributes = assert(function( div ) {
- div.className = "i";
- return !div.getAttribute("className");
- });
-
- /* getElement(s)By*
- ---------------------------------------------------------------------- */
-
- // Check if getElementsByTagName("*") returns only elements
- support.getElementsByTagName = assert(function( div ) {
- div.appendChild( document.createComment("") );
- return !div.getElementsByTagName("*").length;
- });
-
- // Support: IE<9
- support.getElementsByClassName = rnative.test( document.getElementsByClassName );
-
- // Support: IE<10
- // Check if getElementById returns elements by name
- // The broken getElementById methods don't pick up programatically-set names,
- // so use a roundabout getElementsByName test
- support.getById = assert(function( div ) {
- docElem.appendChild( div ).id = expando;
- return !document.getElementsByName || !document.getElementsByName( expando ).length;
- });
-
- // ID find and filter
- if ( support.getById ) {
- Expr.find["ID"] = function( id, context ) {
- if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
- var m = context.getElementById( id );
- return m ? [ m ] : [];
- }
- };
- Expr.filter["ID"] = function( id ) {
- var attrId = id.replace( runescape, funescape );
- return function( elem ) {
- return elem.getAttribute("id") === attrId;
- };
- };
- } else {
- // Support: IE6/7
- // getElementById is not reliable as a find shortcut
- delete Expr.find["ID"];
-
- Expr.filter["ID"] = function( id ) {
- var attrId = id.replace( runescape, funescape );
- return function( elem ) {
- var node = typeof elem.getAttributeNode !== "undefined" &&
- elem.getAttributeNode("id");
- return node && node.value === attrId;
- };
- };
- }
-
- // Tag
- Expr.find["TAG"] = support.getElementsByTagName ?
- function( tag, context ) {
- if ( typeof context.getElementsByTagName !== "undefined" ) {
- return context.getElementsByTagName( tag );
-
- // DocumentFragment nodes don't have gEBTN
- } else if ( support.qsa ) {
- return context.querySelectorAll( tag );
- }
- } :
-
- function( tag, context ) {
- var elem,
- tmp = [],
- i = 0,
- // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
- results = context.getElementsByTagName( tag );
-
- // Filter out possible comments
- if ( tag === "*" ) {
- while ( (elem = results[i++]) ) {
- if ( elem.nodeType === 1 ) {
- tmp.push( elem );
- }
- }
-
- return tmp;
- }
- return results;
- };
-
- // Class
- Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
- if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
- return context.getElementsByClassName( className );
- }
- };
-
- /* QSA/matchesSelector
- ---------------------------------------------------------------------- */
-
- // QSA and matchesSelector support
-
- // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
- rbuggyMatches = [];
-
- // qSa(:focus) reports false when true (Chrome 21)
- // We allow this because of a bug in IE8/9 that throws an error
- // whenever `document.activeElement` is accessed on an iframe
- // So, we allow :focus to pass through QSA all the time to avoid the IE error
- // See http://bugs.jquery.com/ticket/13378
- rbuggyQSA = [];
-
- if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
- // Build QSA regex
- // Regex strategy adopted from Diego Perini
- assert(function( div ) {
- // Select is set to empty string on purpose
- // This is to test IE's treatment of not explicitly
- // setting a boolean content attribute,
- // since its presence should be enough
- // http://bugs.jquery.com/ticket/12359
- docElem.appendChild( div ).innerHTML = "" +
- "";
-
- // Support: IE8, Opera 11-12.16
- // Nothing should be selected when empty strings follow ^= or $= or *=
- // The test attribute must be unknown in Opera but "safe" for WinRT
- // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
- if ( div.querySelectorAll("[msallowcapture^='']").length ) {
- rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
- }
-
- // Support: IE8
- // Boolean attributes and "value" are not treated correctly
- if ( !div.querySelectorAll("[selected]").length ) {
- rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
- }
-
- // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
- if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
- rbuggyQSA.push("~=");
- }
-
- // Webkit/Opera - :checked should return selected option elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- // IE8 throws error here and will not see later tests
- if ( !div.querySelectorAll(":checked").length ) {
- rbuggyQSA.push(":checked");
- }
-
- // Support: Safari 8+, iOS 8+
- // https://bugs.webkit.org/show_bug.cgi?id=136851
- // In-page `selector#id sibing-combinator selector` fails
- if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
- rbuggyQSA.push(".#.+[+~]");
- }
- });
-
- assert(function( div ) {
- // Support: Windows 8 Native Apps
- // The type and name attributes are restricted during .innerHTML assignment
- var input = document.createElement("input");
- input.setAttribute( "type", "hidden" );
- div.appendChild( input ).setAttribute( "name", "D" );
-
- // Support: IE8
- // Enforce case-sensitivity of name attribute
- if ( div.querySelectorAll("[name=d]").length ) {
- rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
- }
-
- // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
- // IE8 throws error here and will not see later tests
- if ( !div.querySelectorAll(":enabled").length ) {
- rbuggyQSA.push( ":enabled", ":disabled" );
- }
-
- // Opera 10-11 does not throw on post-comma invalid pseudos
- div.querySelectorAll("*,:x");
- rbuggyQSA.push(",.*:");
- });
- }
-
- if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
- docElem.webkitMatchesSelector ||
- docElem.mozMatchesSelector ||
- docElem.oMatchesSelector ||
- docElem.msMatchesSelector) )) ) {
-
- assert(function( div ) {
- // Check to see if it's possible to do matchesSelector
- // on a disconnected node (IE 9)
- support.disconnectedMatch = matches.call( div, "div" );
-
- // This should fail with an exception
- // Gecko does not error, returns false instead
- matches.call( div, "[s!='']:x" );
- rbuggyMatches.push( "!=", pseudos );
- });
- }
-
- rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
- rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
-
- /* Contains
- ---------------------------------------------------------------------- */
- hasCompare = rnative.test( docElem.compareDocumentPosition );
-
- // Element contains another
- // Purposefully self-exclusive
- // As in, an element does not contain itself
- contains = hasCompare || rnative.test( docElem.contains ) ?
- function( a, b ) {
- var adown = a.nodeType === 9 ? a.documentElement : a,
- bup = b && b.parentNode;
- return a === bup || !!( bup && bup.nodeType === 1 && (
- adown.contains ?
- adown.contains( bup ) :
- a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
- ));
- } :
- function( a, b ) {
- if ( b ) {
- while ( (b = b.parentNode) ) {
- if ( b === a ) {
- return true;
- }
- }
- }
- return false;
- };
-
- /* Sorting
- ---------------------------------------------------------------------- */
-
- // Document order sorting
- sortOrder = hasCompare ?
- function( a, b ) {
-
- // Flag for duplicate removal
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
- }
-
- // Sort on method existence if only one input has compareDocumentPosition
- var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
- if ( compare ) {
- return compare;
- }
-
- // Calculate position if both inputs belong to the same document
- compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
- a.compareDocumentPosition( b ) :
-
- // Otherwise we know they are disconnected
- 1;
-
- // Disconnected nodes
- if ( compare & 1 ||
- (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
-
- // Choose the first element that is related to our preferred document
- if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
- return -1;
- }
- if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
- return 1;
- }
-
- // Maintain original order
- return sortInput ?
- ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
- 0;
- }
-
- return compare & 4 ? -1 : 1;
- } :
- function( a, b ) {
- // Exit early if the nodes are identical
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
- }
-
- var cur,
- i = 0,
- aup = a.parentNode,
- bup = b.parentNode,
- ap = [ a ],
- bp = [ b ];
-
- // Parentless nodes are either documents or disconnected
- if ( !aup || !bup ) {
- return a === document ? -1 :
- b === document ? 1 :
- aup ? -1 :
- bup ? 1 :
- sortInput ?
- ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
- 0;
-
- // If the nodes are siblings, we can do a quick check
- } else if ( aup === bup ) {
- return siblingCheck( a, b );
- }
-
- // Otherwise we need full lists of their ancestors for comparison
- cur = a;
- while ( (cur = cur.parentNode) ) {
- ap.unshift( cur );
- }
- cur = b;
- while ( (cur = cur.parentNode) ) {
- bp.unshift( cur );
- }
-
- // Walk down the tree looking for a discrepancy
- while ( ap[i] === bp[i] ) {
- i++;
- }
-
- return i ?
- // Do a sibling check if the nodes have a common ancestor
- siblingCheck( ap[i], bp[i] ) :
-
- // Otherwise nodes in our document sort first
- ap[i] === preferredDoc ? -1 :
- bp[i] === preferredDoc ? 1 :
- 0;
- };
-
- return document;
-};
-
-Sizzle.matches = function( expr, elements ) {
- return Sizzle( expr, null, null, elements );
-};
-
-Sizzle.matchesSelector = function( elem, expr ) {
- // Set document vars if needed
- if ( ( elem.ownerDocument || elem ) !== document ) {
- setDocument( elem );
- }
-
- // Make sure that attribute selectors are quoted
- expr = expr.replace( rattributeQuotes, "='$1']" );
-
- if ( support.matchesSelector && documentIsHTML &&
- !compilerCache[ expr + " " ] &&
- ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
- ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
-
- try {
- var ret = matches.call( elem, expr );
-
- // IE 9's matchesSelector returns false on disconnected nodes
- if ( ret || support.disconnectedMatch ||
- // As well, disconnected nodes are said to be in a document
- // fragment in IE 9
- elem.document && elem.document.nodeType !== 11 ) {
- return ret;
- }
- } catch (e) {}
- }
-
- return Sizzle( expr, document, null, [ elem ] ).length > 0;
-};
-
-Sizzle.contains = function( context, elem ) {
- // Set document vars if needed
- if ( ( context.ownerDocument || context ) !== document ) {
- setDocument( context );
- }
- return contains( context, elem );
-};
-
-Sizzle.attr = function( elem, name ) {
- // Set document vars if needed
- if ( ( elem.ownerDocument || elem ) !== document ) {
- setDocument( elem );
- }
-
- var fn = Expr.attrHandle[ name.toLowerCase() ],
- // Don't get fooled by Object.prototype properties (jQuery #13807)
- val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
- fn( elem, name, !documentIsHTML ) :
- undefined;
-
- return val !== undefined ?
- val :
- support.attributes || !documentIsHTML ?
- elem.getAttribute( name ) :
- (val = elem.getAttributeNode(name)) && val.specified ?
- val.value :
- null;
-};
-
-Sizzle.error = function( msg ) {
- throw new Error( "Syntax error, unrecognized expression: " + msg );
-};
-
-/**
- * Document sorting and removing duplicates
- * @param {ArrayLike} results
- */
-Sizzle.uniqueSort = function( results ) {
- var elem,
- duplicates = [],
- j = 0,
- i = 0;
-
- // Unless we *know* we can detect duplicates, assume their presence
- hasDuplicate = !support.detectDuplicates;
- sortInput = !support.sortStable && results.slice( 0 );
- results.sort( sortOrder );
-
- if ( hasDuplicate ) {
- while ( (elem = results[i++]) ) {
- if ( elem === results[ i ] ) {
- j = duplicates.push( i );
- }
- }
- while ( j-- ) {
- results.splice( duplicates[ j ], 1 );
- }
- }
-
- // Clear input after sorting to release objects
- // See https://github.com/jquery/sizzle/pull/225
- sortInput = null;
-
- return results;
-};
-
-/**
- * Utility function for retrieving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
-getText = Sizzle.getText = function( elem ) {
- var node,
- ret = "",
- i = 0,
- nodeType = elem.nodeType;
-
- if ( !nodeType ) {
- // If no nodeType, this is expected to be an array
- while ( (node = elem[i++]) ) {
- // Do not traverse comment nodes
- ret += getText( node );
- }
- } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
- // Use textContent for elements
- // innerText usage removed for consistency of new lines (jQuery #11153)
- if ( typeof elem.textContent === "string" ) {
- return elem.textContent;
- } else {
- // Traverse its children
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
- ret += getText( elem );
- }
- }
- } else if ( nodeType === 3 || nodeType === 4 ) {
- return elem.nodeValue;
- }
- // Do not include comment or processing instruction nodes
-
- return ret;
-};
-
-Expr = Sizzle.selectors = {
-
- // Can be adjusted by the user
- cacheLength: 50,
-
- createPseudo: markFunction,
-
- match: matchExpr,
-
- attrHandle: {},
-
- find: {},
-
- relative: {
- ">": { dir: "parentNode", first: true },
- " ": { dir: "parentNode" },
- "+": { dir: "previousSibling", first: true },
- "~": { dir: "previousSibling" }
- },
-
- preFilter: {
- "ATTR": function( match ) {
- match[1] = match[1].replace( runescape, funescape );
-
- // Move the given value to match[3] whether quoted or unquoted
- match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
-
- if ( match[2] === "~=" ) {
- match[3] = " " + match[3] + " ";
- }
-
- return match.slice( 0, 4 );
- },
-
- "CHILD": function( match ) {
- /* matches from matchExpr["CHILD"]
- 1 type (only|nth|...)
- 2 what (child|of-type)
- 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
- 4 xn-component of xn+y argument ([+-]?\d*n|)
- 5 sign of xn-component
- 6 x of xn-component
- 7 sign of y-component
- 8 y of y-component
- */
- match[1] = match[1].toLowerCase();
-
- if ( match[1].slice( 0, 3 ) === "nth" ) {
- // nth-* requires argument
- if ( !match[3] ) {
- Sizzle.error( match[0] );
- }
-
- // numeric x and y parameters for Expr.filter.CHILD
- // remember that false/true cast respectively to 0/1
- match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
- match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
-
- // other types prohibit arguments
- } else if ( match[3] ) {
- Sizzle.error( match[0] );
- }
-
- return match;
- },
-
- "PSEUDO": function( match ) {
- var excess,
- unquoted = !match[6] && match[2];
-
- if ( matchExpr["CHILD"].test( match[0] ) ) {
- return null;
- }
-
- // Accept quoted arguments as-is
- if ( match[3] ) {
- match[2] = match[4] || match[5] || "";
-
- // Strip excess characters from unquoted arguments
- } else if ( unquoted && rpseudo.test( unquoted ) &&
- // Get excess from tokenize (recursively)
- (excess = tokenize( unquoted, true )) &&
- // advance to the next closing parenthesis
- (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
-
- // excess is a negative index
- match[0] = match[0].slice( 0, excess );
- match[2] = unquoted.slice( 0, excess );
- }
-
- // Return only captures needed by the pseudo filter method (type and argument)
- return match.slice( 0, 3 );
- }
- },
-
- filter: {
-
- "TAG": function( nodeNameSelector ) {
- var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
- return nodeNameSelector === "*" ?
- function() { return true; } :
- function( elem ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
- };
- },
-
- "CLASS": function( className ) {
- var pattern = classCache[ className + " " ];
-
- return pattern ||
- (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
- classCache( className, function( elem ) {
- return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
- });
- },
-
- "ATTR": function( name, operator, check ) {
- return function( elem ) {
- var result = Sizzle.attr( elem, name );
-
- if ( result == null ) {
- return operator === "!=";
- }
- if ( !operator ) {
- return true;
- }
-
- result += "";
-
- return operator === "=" ? result === check :
- operator === "!=" ? result !== check :
- operator === "^=" ? check && result.indexOf( check ) === 0 :
- operator === "*=" ? check && result.indexOf( check ) > -1 :
- operator === "$=" ? check && result.slice( -check.length ) === check :
- operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
- operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
- false;
- };
- },
-
- "CHILD": function( type, what, argument, first, last ) {
- var simple = type.slice( 0, 3 ) !== "nth",
- forward = type.slice( -4 ) !== "last",
- ofType = what === "of-type";
-
- return first === 1 && last === 0 ?
-
- // Shortcut for :nth-*(n)
- function( elem ) {
- return !!elem.parentNode;
- } :
-
- function( elem, context, xml ) {
- var cache, uniqueCache, outerCache, node, nodeIndex, start,
- dir = simple !== forward ? "nextSibling" : "previousSibling",
- parent = elem.parentNode,
- name = ofType && elem.nodeName.toLowerCase(),
- useCache = !xml && !ofType,
- diff = false;
-
- if ( parent ) {
-
- // :(first|last|only)-(child|of-type)
- if ( simple ) {
- while ( dir ) {
- node = elem;
- while ( (node = node[ dir ]) ) {
- if ( ofType ?
- node.nodeName.toLowerCase() === name :
- node.nodeType === 1 ) {
-
- return false;
- }
- }
- // Reverse direction for :only-* (if we haven't yet done so)
- start = dir = type === "only" && !start && "nextSibling";
- }
- return true;
- }
-
- start = [ forward ? parent.firstChild : parent.lastChild ];
-
- // non-xml :nth-child(...) stores cache data on `parent`
- if ( forward && useCache ) {
-
- // Seek `elem` from a previously-cached index
-
- // ...in a gzip-friendly way
- node = parent;
- outerCache = node[ expando ] || (node[ expando ] = {});
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ node.uniqueID ] ||
- (outerCache[ node.uniqueID ] = {});
-
- cache = uniqueCache[ type ] || [];
- nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
- diff = nodeIndex && cache[ 2 ];
- node = nodeIndex && parent.childNodes[ nodeIndex ];
-
- while ( (node = ++nodeIndex && node && node[ dir ] ||
-
- // Fallback to seeking `elem` from the start
- (diff = nodeIndex = 0) || start.pop()) ) {
-
- // When found, cache indexes on `parent` and break
- if ( node.nodeType === 1 && ++diff && node === elem ) {
- uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
- break;
- }
- }
-
- } else {
- // Use previously-cached element index if available
- if ( useCache ) {
- // ...in a gzip-friendly way
- node = elem;
- outerCache = node[ expando ] || (node[ expando ] = {});
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ node.uniqueID ] ||
- (outerCache[ node.uniqueID ] = {});
-
- cache = uniqueCache[ type ] || [];
- nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
- diff = nodeIndex;
- }
-
- // xml :nth-child(...)
- // or :nth-last-child(...) or :nth(-last)?-of-type(...)
- if ( diff === false ) {
- // Use the same loop as above to seek `elem` from the start
- while ( (node = ++nodeIndex && node && node[ dir ] ||
- (diff = nodeIndex = 0) || start.pop()) ) {
-
- if ( ( ofType ?
- node.nodeName.toLowerCase() === name :
- node.nodeType === 1 ) &&
- ++diff ) {
-
- // Cache the index of each encountered element
- if ( useCache ) {
- outerCache = node[ expando ] || (node[ expando ] = {});
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ node.uniqueID ] ||
- (outerCache[ node.uniqueID ] = {});
-
- uniqueCache[ type ] = [ dirruns, diff ];
- }
-
- if ( node === elem ) {
- break;
- }
- }
- }
- }
- }
-
- // Incorporate the offset, then check against cycle size
- diff -= last;
- return diff === first || ( diff % first === 0 && diff / first >= 0 );
- }
- };
- },
-
- "PSEUDO": function( pseudo, argument ) {
- // pseudo-class names are case-insensitive
- // http://www.w3.org/TR/selectors/#pseudo-classes
- // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
- // Remember that setFilters inherits from pseudos
- var args,
- fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
- Sizzle.error( "unsupported pseudo: " + pseudo );
-
- // The user may use createPseudo to indicate that
- // arguments are needed to create the filter function
- // just as Sizzle does
- if ( fn[ expando ] ) {
- return fn( argument );
- }
-
- // But maintain support for old signatures
- if ( fn.length > 1 ) {
- args = [ pseudo, pseudo, "", argument ];
- return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
- markFunction(function( seed, matches ) {
- var idx,
- matched = fn( seed, argument ),
- i = matched.length;
- while ( i-- ) {
- idx = indexOf( seed, matched[i] );
- seed[ idx ] = !( matches[ idx ] = matched[i] );
- }
- }) :
- function( elem ) {
- return fn( elem, 0, args );
- };
- }
-
- return fn;
- }
- },
-
- pseudos: {
- // Potentially complex pseudos
- "not": markFunction(function( selector ) {
- // Trim the selector passed to compile
- // to avoid treating leading and trailing
- // spaces as combinators
- var input = [],
- results = [],
- matcher = compile( selector.replace( rtrim, "$1" ) );
-
- return matcher[ expando ] ?
- markFunction(function( seed, matches, context, xml ) {
- var elem,
- unmatched = matcher( seed, null, xml, [] ),
- i = seed.length;
-
- // Match elements unmatched by `matcher`
- while ( i-- ) {
- if ( (elem = unmatched[i]) ) {
- seed[i] = !(matches[i] = elem);
- }
- }
- }) :
- function( elem, context, xml ) {
- input[0] = elem;
- matcher( input, null, xml, results );
- // Don't keep the element (issue #299)
- input[0] = null;
- return !results.pop();
- };
- }),
-
- "has": markFunction(function( selector ) {
- return function( elem ) {
- return Sizzle( selector, elem ).length > 0;
- };
- }),
-
- "contains": markFunction(function( text ) {
- text = text.replace( runescape, funescape );
- return function( elem ) {
- return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
- };
- }),
-
- // "Whether an element is represented by a :lang() selector
- // is based solely on the element's language value
- // being equal to the identifier C,
- // or beginning with the identifier C immediately followed by "-".
- // The matching of C against the element's language value is performed case-insensitively.
- // The identifier C does not have to be a valid language name."
- // http://www.w3.org/TR/selectors/#lang-pseudo
- "lang": markFunction( function( lang ) {
- // lang value must be a valid identifier
- if ( !ridentifier.test(lang || "") ) {
- Sizzle.error( "unsupported lang: " + lang );
- }
- lang = lang.replace( runescape, funescape ).toLowerCase();
- return function( elem ) {
- var elemLang;
- do {
- if ( (elemLang = documentIsHTML ?
- elem.lang :
- elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
-
- elemLang = elemLang.toLowerCase();
- return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
- }
- } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
- return false;
- };
- }),
-
- // Miscellaneous
- "target": function( elem ) {
- var hash = window.location && window.location.hash;
- return hash && hash.slice( 1 ) === elem.id;
- },
-
- "root": function( elem ) {
- return elem === docElem;
- },
-
- "focus": function( elem ) {
- return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
- },
-
- // Boolean properties
- "enabled": function( elem ) {
- return elem.disabled === false;
- },
-
- "disabled": function( elem ) {
- return elem.disabled === true;
- },
-
- "checked": function( elem ) {
- // In CSS3, :checked should return both checked and selected elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- var nodeName = elem.nodeName.toLowerCase();
- return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
- },
-
- "selected": function( elem ) {
- // Accessing this property makes selected-by-default
- // options in Safari work properly
- if ( elem.parentNode ) {
- elem.parentNode.selectedIndex;
- }
-
- return elem.selected === true;
- },
-
- // Contents
- "empty": function( elem ) {
- // http://www.w3.org/TR/selectors/#empty-pseudo
- // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
- // but not by others (comment: 8; processing instruction: 7; etc.)
- // nodeType < 6 works because attributes (2) do not appear as children
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
- if ( elem.nodeType < 6 ) {
- return false;
- }
- }
- return true;
- },
-
- "parent": function( elem ) {
- return !Expr.pseudos["empty"]( elem );
- },
-
- // Element/input types
- "header": function( elem ) {
- return rheader.test( elem.nodeName );
- },
-
- "input": function( elem ) {
- return rinputs.test( elem.nodeName );
- },
-
- "button": function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === "button" || name === "button";
- },
-
- "text": function( elem ) {
- var attr;
- return elem.nodeName.toLowerCase() === "input" &&
- elem.type === "text" &&
-
- // Support: IE<8
- // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
- ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
- },
-
- // Position-in-collection
- "first": createPositionalPseudo(function() {
- return [ 0 ];
- }),
-
- "last": createPositionalPseudo(function( matchIndexes, length ) {
- return [ length - 1 ];
- }),
-
- "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
- return [ argument < 0 ? argument + length : argument ];
- }),
-
- "even": createPositionalPseudo(function( matchIndexes, length ) {
- var i = 0;
- for ( ; i < length; i += 2 ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "odd": createPositionalPseudo(function( matchIndexes, length ) {
- var i = 1;
- for ( ; i < length; i += 2 ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
- var i = argument < 0 ? argument + length : argument;
- for ( ; --i >= 0; ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
- var i = argument < 0 ? argument + length : argument;
- for ( ; ++i < length; ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- })
- }
-};
-
-Expr.pseudos["nth"] = Expr.pseudos["eq"];
-
-// Add button/input type pseudos
-for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
- Expr.pseudos[ i ] = createInputPseudo( i );
-}
-for ( i in { submit: true, reset: true } ) {
- Expr.pseudos[ i ] = createButtonPseudo( i );
-}
-
-// Easy API for creating new setFilters
-function setFilters() {}
-setFilters.prototype = Expr.filters = Expr.pseudos;
-Expr.setFilters = new setFilters();
-
-tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
- var matched, match, tokens, type,
- soFar, groups, preFilters,
- cached = tokenCache[ selector + " " ];
-
- if ( cached ) {
- return parseOnly ? 0 : cached.slice( 0 );
- }
-
- soFar = selector;
- groups = [];
- preFilters = Expr.preFilter;
-
- while ( soFar ) {
-
- // Comma and first run
- if ( !matched || (match = rcomma.exec( soFar )) ) {
- if ( match ) {
- // Don't consume trailing commas as valid
- soFar = soFar.slice( match[0].length ) || soFar;
- }
- groups.push( (tokens = []) );
- }
-
- matched = false;
-
- // Combinators
- if ( (match = rcombinators.exec( soFar )) ) {
- matched = match.shift();
- tokens.push({
- value: matched,
- // Cast descendant combinators to space
- type: match[0].replace( rtrim, " " )
- });
- soFar = soFar.slice( matched.length );
- }
-
- // Filters
- for ( type in Expr.filter ) {
- if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
- (match = preFilters[ type ]( match ))) ) {
- matched = match.shift();
- tokens.push({
- value: matched,
- type: type,
- matches: match
- });
- soFar = soFar.slice( matched.length );
- }
- }
-
- if ( !matched ) {
- break;
- }
- }
-
- // Return the length of the invalid excess
- // if we're just parsing
- // Otherwise, throw an error or return tokens
- return parseOnly ?
- soFar.length :
- soFar ?
- Sizzle.error( selector ) :
- // Cache the tokens
- tokenCache( selector, groups ).slice( 0 );
-};
-
-function toSelector( tokens ) {
- var i = 0,
- len = tokens.length,
- selector = "";
- for ( ; i < len; i++ ) {
- selector += tokens[i].value;
- }
- return selector;
-}
-
-function addCombinator( matcher, combinator, base ) {
- var dir = combinator.dir,
- checkNonElements = base && dir === "parentNode",
- doneName = done++;
-
- return combinator.first ?
- // Check against closest ancestor/preceding element
- function( elem, context, xml ) {
- while ( (elem = elem[ dir ]) ) {
- if ( elem.nodeType === 1 || checkNonElements ) {
- return matcher( elem, context, xml );
- }
- }
- } :
-
- // Check against all ancestor/preceding elements
- function( elem, context, xml ) {
- var oldCache, uniqueCache, outerCache,
- newCache = [ dirruns, doneName ];
-
- // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
- if ( xml ) {
- while ( (elem = elem[ dir ]) ) {
- if ( elem.nodeType === 1 || checkNonElements ) {
- if ( matcher( elem, context, xml ) ) {
- return true;
- }
- }
- }
- } else {
- while ( (elem = elem[ dir ]) ) {
- if ( elem.nodeType === 1 || checkNonElements ) {
- outerCache = elem[ expando ] || (elem[ expando ] = {});
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
-
- if ( (oldCache = uniqueCache[ dir ]) &&
- oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
-
- // Assign to newCache so results back-propagate to previous elements
- return (newCache[ 2 ] = oldCache[ 2 ]);
- } else {
- // Reuse newcache so results back-propagate to previous elements
- uniqueCache[ dir ] = newCache;
-
- // A match means we're done; a fail means we have to keep checking
- if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
- return true;
- }
- }
- }
- }
- }
- };
-}
-
-function elementMatcher( matchers ) {
- return matchers.length > 1 ?
- function( elem, context, xml ) {
- var i = matchers.length;
- while ( i-- ) {
- if ( !matchers[i]( elem, context, xml ) ) {
- return false;
- }
- }
- return true;
- } :
- matchers[0];
-}
-
-function multipleContexts( selector, contexts, results ) {
- var i = 0,
- len = contexts.length;
- for ( ; i < len; i++ ) {
- Sizzle( selector, contexts[i], results );
- }
- return results;
-}
-
-function condense( unmatched, map, filter, context, xml ) {
- var elem,
- newUnmatched = [],
- i = 0,
- len = unmatched.length,
- mapped = map != null;
-
- for ( ; i < len; i++ ) {
- if ( (elem = unmatched[i]) ) {
- if ( !filter || filter( elem, context, xml ) ) {
- newUnmatched.push( elem );
- if ( mapped ) {
- map.push( i );
- }
- }
- }
- }
-
- return newUnmatched;
-}
-
-function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
- if ( postFilter && !postFilter[ expando ] ) {
- postFilter = setMatcher( postFilter );
- }
- if ( postFinder && !postFinder[ expando ] ) {
- postFinder = setMatcher( postFinder, postSelector );
- }
- return markFunction(function( seed, results, context, xml ) {
- var temp, i, elem,
- preMap = [],
- postMap = [],
- preexisting = results.length,
-
- // Get initial elements from seed or context
- elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
-
- // Prefilter to get matcher input, preserving a map for seed-results synchronization
- matcherIn = preFilter && ( seed || !selector ) ?
- condense( elems, preMap, preFilter, context, xml ) :
- elems,
-
- matcherOut = matcher ?
- // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
- postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
-
- // ...intermediate processing is necessary
- [] :
-
- // ...otherwise use results directly
- results :
- matcherIn;
-
- // Find primary matches
- if ( matcher ) {
- matcher( matcherIn, matcherOut, context, xml );
- }
-
- // Apply postFilter
- if ( postFilter ) {
- temp = condense( matcherOut, postMap );
- postFilter( temp, [], context, xml );
-
- // Un-match failing elements by moving them back to matcherIn
- i = temp.length;
- while ( i-- ) {
- if ( (elem = temp[i]) ) {
- matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
- }
- }
- }
-
- if ( seed ) {
- if ( postFinder || preFilter ) {
- if ( postFinder ) {
- // Get the final matcherOut by condensing this intermediate into postFinder contexts
- temp = [];
- i = matcherOut.length;
- while ( i-- ) {
- if ( (elem = matcherOut[i]) ) {
- // Restore matcherIn since elem is not yet a final match
- temp.push( (matcherIn[i] = elem) );
- }
- }
- postFinder( null, (matcherOut = []), temp, xml );
- }
-
- // Move matched elements from seed to results to keep them synchronized
- i = matcherOut.length;
- while ( i-- ) {
- if ( (elem = matcherOut[i]) &&
- (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
-
- seed[temp] = !(results[temp] = elem);
- }
- }
- }
-
- // Add elements to results, through postFinder if defined
- } else {
- matcherOut = condense(
- matcherOut === results ?
- matcherOut.splice( preexisting, matcherOut.length ) :
- matcherOut
- );
- if ( postFinder ) {
- postFinder( null, results, matcherOut, xml );
- } else {
- push.apply( results, matcherOut );
- }
- }
- });
-}
-
-function matcherFromTokens( tokens ) {
- var checkContext, matcher, j,
- len = tokens.length,
- leadingRelative = Expr.relative[ tokens[0].type ],
- implicitRelative = leadingRelative || Expr.relative[" "],
- i = leadingRelative ? 1 : 0,
-
- // The foundational matcher ensures that elements are reachable from top-level context(s)
- matchContext = addCombinator( function( elem ) {
- return elem === checkContext;
- }, implicitRelative, true ),
- matchAnyContext = addCombinator( function( elem ) {
- return indexOf( checkContext, elem ) > -1;
- }, implicitRelative, true ),
- matchers = [ function( elem, context, xml ) {
- var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
- (checkContext = context).nodeType ?
- matchContext( elem, context, xml ) :
- matchAnyContext( elem, context, xml ) );
- // Avoid hanging onto element (issue #299)
- checkContext = null;
- return ret;
- } ];
-
- for ( ; i < len; i++ ) {
- if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
- matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
- } else {
- matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
-
- // Return special upon seeing a positional matcher
- if ( matcher[ expando ] ) {
- // Find the next relative operator (if any) for proper handling
- j = ++i;
- for ( ; j < len; j++ ) {
- if ( Expr.relative[ tokens[j].type ] ) {
- break;
- }
- }
- return setMatcher(
- i > 1 && elementMatcher( matchers ),
- i > 1 && toSelector(
- // If the preceding token was a descendant combinator, insert an implicit any-element `*`
- tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
- ).replace( rtrim, "$1" ),
- matcher,
- i < j && matcherFromTokens( tokens.slice( i, j ) ),
- j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
- j < len && toSelector( tokens )
- );
- }
- matchers.push( matcher );
- }
- }
-
- return elementMatcher( matchers );
-}
-
-function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
- var bySet = setMatchers.length > 0,
- byElement = elementMatchers.length > 0,
- superMatcher = function( seed, context, xml, results, outermost ) {
- var elem, j, matcher,
- matchedCount = 0,
- i = "0",
- unmatched = seed && [],
- setMatched = [],
- contextBackup = outermostContext,
- // We must always have either seed elements or outermost context
- elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
- // Use integer dirruns iff this is the outermost matcher
- dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
- len = elems.length;
-
- if ( outermost ) {
- outermostContext = context === document || context || outermost;
- }
-
- // Add elements passing elementMatchers directly to results
- // Support: IE<9, Safari
- // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id
- for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
- if ( byElement && elem ) {
- j = 0;
- if ( !context && elem.ownerDocument !== document ) {
- setDocument( elem );
- xml = !documentIsHTML;
- }
- while ( (matcher = elementMatchers[j++]) ) {
- if ( matcher( elem, context || document, xml) ) {
- results.push( elem );
- break;
- }
- }
- if ( outermost ) {
- dirruns = dirrunsUnique;
- }
- }
-
- // Track unmatched elements for set filters
- if ( bySet ) {
- // They will have gone through all possible matchers
- if ( (elem = !matcher && elem) ) {
- matchedCount--;
- }
-
- // Lengthen the array for every element, matched or not
- if ( seed ) {
- unmatched.push( elem );
- }
- }
- }
-
- // `i` is now the count of elements visited above, and adding it to `matchedCount`
- // makes the latter nonnegative.
- matchedCount += i;
-
- // Apply set filters to unmatched elements
- // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
- // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
- // no element matchers and no seed.
- // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
- // case, which will result in a "00" `matchedCount` that differs from `i` but is also
- // numerically zero.
- if ( bySet && i !== matchedCount ) {
- j = 0;
- while ( (matcher = setMatchers[j++]) ) {
- matcher( unmatched, setMatched, context, xml );
- }
-
- if ( seed ) {
- // Reintegrate element matches to eliminate the need for sorting
- if ( matchedCount > 0 ) {
- while ( i-- ) {
- if ( !(unmatched[i] || setMatched[i]) ) {
- setMatched[i] = pop.call( results );
- }
- }
- }
-
- // Discard index placeholder values to get only actual matches
- setMatched = condense( setMatched );
- }
-
- // Add matches to results
- push.apply( results, setMatched );
-
- // Seedless set matches succeeding multiple successful matchers stipulate sorting
- if ( outermost && !seed && setMatched.length > 0 &&
- ( matchedCount + setMatchers.length ) > 1 ) {
-
- Sizzle.uniqueSort( results );
- }
- }
-
- // Override manipulation of globals by nested matchers
- if ( outermost ) {
- dirruns = dirrunsUnique;
- outermostContext = contextBackup;
- }
-
- return unmatched;
- };
-
- return bySet ?
- markFunction( superMatcher ) :
- superMatcher;
-}
-
-compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
- var i,
- setMatchers = [],
- elementMatchers = [],
- cached = compilerCache[ selector + " " ];
-
- if ( !cached ) {
- // Generate a function of recursive functions that can be used to check each element
- if ( !match ) {
- match = tokenize( selector );
- }
- i = match.length;
- while ( i-- ) {
- cached = matcherFromTokens( match[i] );
- if ( cached[ expando ] ) {
- setMatchers.push( cached );
- } else {
- elementMatchers.push( cached );
- }
- }
-
- // Cache the compiled function
- cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
-
- // Save selector and tokenization
- cached.selector = selector;
- }
- return cached;
-};
-
-/**
- * A low-level selection function that works with Sizzle's compiled
- * selector functions
- * @param {String|Function} selector A selector or a pre-compiled
- * selector function built with Sizzle.compile
- * @param {Element} context
- * @param {Array} [results]
- * @param {Array} [seed] A set of elements to match against
- */
-select = Sizzle.select = function( selector, context, results, seed ) {
- var i, tokens, token, type, find,
- compiled = typeof selector === "function" && selector,
- match = !seed && tokenize( (selector = compiled.selector || selector) );
-
- results = results || [];
-
- // Try to minimize operations if there is only one selector in the list and no seed
- // (the latter of which guarantees us context)
- if ( match.length === 1 ) {
-
- // Reduce context if the leading compound selector is an ID
- tokens = match[0] = match[0].slice( 0 );
- if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
- support.getById && context.nodeType === 9 && documentIsHTML &&
- Expr.relative[ tokens[1].type ] ) {
-
- context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
- if ( !context ) {
- return results;
-
- // Precompiled matchers will still verify ancestry, so step up a level
- } else if ( compiled ) {
- context = context.parentNode;
- }
-
- selector = selector.slice( tokens.shift().value.length );
- }
-
- // Fetch a seed set for right-to-left matching
- i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
- while ( i-- ) {
- token = tokens[i];
-
- // Abort if we hit a combinator
- if ( Expr.relative[ (type = token.type) ] ) {
- break;
- }
- if ( (find = Expr.find[ type ]) ) {
- // Search, expanding context for leading sibling combinators
- if ( (seed = find(
- token.matches[0].replace( runescape, funescape ),
- rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
- )) ) {
-
- // If seed is empty or no tokens remain, we can return early
- tokens.splice( i, 1 );
- selector = seed.length && toSelector( tokens );
- if ( !selector ) {
- push.apply( results, seed );
- return results;
- }
-
- break;
- }
- }
- }
- }
-
- // Compile and execute a filtering function if one is not provided
- // Provide `match` to avoid retokenization if we modified the selector above
- ( compiled || compile( selector, match ) )(
- seed,
- context,
- !documentIsHTML,
- results,
- !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
- );
- return results;
-};
-
-// One-time assignments
-
-// Sort stability
-support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
-
-// Support: Chrome 14-35+
-// Always assume duplicates if they aren't passed to the comparison function
-support.detectDuplicates = !!hasDuplicate;
-
-// Initialize against the default document
-setDocument();
-
-// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
-// Detached nodes confoundingly follow *each other*
-support.sortDetached = assert(function( div1 ) {
- // Should return 1, but returns 4 (following)
- return div1.compareDocumentPosition( document.createElement("div") ) & 1;
-});
-
-// Support: IE<8
-// Prevent attribute/property "interpolation"
-// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
-if ( !assert(function( div ) {
- div.innerHTML = "";
- return div.firstChild.getAttribute("href") === "#" ;
-}) ) {
- addHandle( "type|href|height|width", function( elem, name, isXML ) {
- if ( !isXML ) {
- return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
- }
- });
-}
-
-// Support: IE<9
-// Use defaultValue in place of getAttribute("value")
-if ( !support.attributes || !assert(function( div ) {
- div.innerHTML = "";
- div.firstChild.setAttribute( "value", "" );
- return div.firstChild.getAttribute( "value" ) === "";
-}) ) {
- addHandle( "value", function( elem, name, isXML ) {
- if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
- return elem.defaultValue;
- }
- });
-}
-
-// Support: IE<9
-// Use getAttributeNode to fetch booleans when getAttribute lies
-if ( !assert(function( div ) {
- return div.getAttribute("disabled") == null;
-}) ) {
- addHandle( booleans, function( elem, name, isXML ) {
- var val;
- if ( !isXML ) {
- return elem[ name ] === true ? name.toLowerCase() :
- (val = elem.getAttributeNode( name )) && val.specified ?
- val.value :
- null;
- }
- });
-}
-
-return Sizzle;
-
-})( window );
-
-
-
-jQuery.find = Sizzle;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[ ":" ] = jQuery.expr.pseudos;
-jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
-jQuery.text = Sizzle.getText;
-jQuery.isXMLDoc = Sizzle.isXML;
-jQuery.contains = Sizzle.contains;
-
-
-
-var dir = function( elem, dir, until ) {
- var matched = [],
- truncate = until !== undefined;
-
- while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
- if ( elem.nodeType === 1 ) {
- if ( truncate && jQuery( elem ).is( until ) ) {
- break;
- }
- matched.push( elem );
- }
- }
- return matched;
-};
-
-
-var siblings = function( n, elem ) {
- var matched = [];
-
- for ( ; n; n = n.nextSibling ) {
- if ( n.nodeType === 1 && n !== elem ) {
- matched.push( n );
- }
- }
-
- return matched;
-};
-
-
-var rneedsContext = jQuery.expr.match.needsContext;
-
-var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ );
-
-
-
-var risSimple = /^.[^:#\[\.,]*$/;
-
-// Implement the identical functionality for filter and not
-function winnow( elements, qualifier, not ) {
- if ( jQuery.isFunction( qualifier ) ) {
- return jQuery.grep( elements, function( elem, i ) {
- /* jshint -W018 */
- return !!qualifier.call( elem, i, elem ) !== not;
- } );
-
- }
-
- if ( qualifier.nodeType ) {
- return jQuery.grep( elements, function( elem ) {
- return ( elem === qualifier ) !== not;
- } );
-
- }
-
- if ( typeof qualifier === "string" ) {
- if ( risSimple.test( qualifier ) ) {
- return jQuery.filter( qualifier, elements, not );
- }
-
- qualifier = jQuery.filter( qualifier, elements );
- }
-
- return jQuery.grep( elements, function( elem ) {
- return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
- } );
-}
-
-jQuery.filter = function( expr, elems, not ) {
- var elem = elems[ 0 ];
-
- if ( not ) {
- expr = ":not(" + expr + ")";
- }
-
- return elems.length === 1 && elem.nodeType === 1 ?
- jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
- jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
- return elem.nodeType === 1;
- } ) );
-};
-
-jQuery.fn.extend( {
- find: function( selector ) {
- var i,
- len = this.length,
- ret = [],
- self = this;
-
- if ( typeof selector !== "string" ) {
- return this.pushStack( jQuery( selector ).filter( function() {
- for ( i = 0; i < len; i++ ) {
- if ( jQuery.contains( self[ i ], this ) ) {
- return true;
- }
- }
- } ) );
- }
-
- for ( i = 0; i < len; i++ ) {
- jQuery.find( selector, self[ i ], ret );
- }
-
- // Needed because $( selector, context ) becomes $( context ).find( selector )
- ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
- ret.selector = this.selector ? this.selector + " " + selector : selector;
- return ret;
- },
- filter: function( selector ) {
- return this.pushStack( winnow( this, selector || [], false ) );
- },
- not: function( selector ) {
- return this.pushStack( winnow( this, selector || [], true ) );
- },
- is: function( selector ) {
- return !!winnow(
- this,
-
- // If this is a positional/relative selector, check membership in the returned set
- // so $("p:first").is("p:last") won't return true for a doc with two "p".
- typeof selector === "string" && rneedsContext.test( selector ) ?
- jQuery( selector ) :
- selector || [],
- false
- ).length;
- }
-} );
-
-
-// Initialize a jQuery object
-
-
-// A central reference to the root jQuery(document)
-var rootjQuery,
-
- // A simple way to check for HTML strings
- // Prioritize #id over to avoid XSS via location.hash (#9521)
- // Strict HTML recognition (#11290: must start with <)
- rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
-
- init = jQuery.fn.init = function( selector, context, root ) {
- var match, elem;
-
- // HANDLE: $(""), $(null), $(undefined), $(false)
- if ( !selector ) {
- return this;
- }
-
- // Method init() accepts an alternate rootjQuery
- // so migrate can support jQuery.sub (gh-2101)
- root = root || rootjQuery;
-
- // Handle HTML strings
- if ( typeof selector === "string" ) {
- if ( selector[ 0 ] === "<" &&
- selector[ selector.length - 1 ] === ">" &&
- selector.length >= 3 ) {
-
- // Assume that strings that start and end with <> are HTML and skip the regex check
- match = [ null, selector, null ];
-
- } else {
- match = rquickExpr.exec( selector );
- }
-
- // Match html or make sure no context is specified for #id
- if ( match && ( match[ 1 ] || !context ) ) {
-
- // HANDLE: $(html) -> $(array)
- if ( match[ 1 ] ) {
- context = context instanceof jQuery ? context[ 0 ] : context;
-
- // Option to run scripts is true for back-compat
- // Intentionally let the error be thrown if parseHTML is not present
- jQuery.merge( this, jQuery.parseHTML(
- match[ 1 ],
- context && context.nodeType ? context.ownerDocument || context : document,
- true
- ) );
-
- // HANDLE: $(html, props)
- if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
- for ( match in context ) {
-
- // Properties of context are called as methods if possible
- if ( jQuery.isFunction( this[ match ] ) ) {
- this[ match ]( context[ match ] );
-
- // ...and otherwise set as attributes
- } else {
- this.attr( match, context[ match ] );
- }
- }
- }
-
- return this;
-
- // HANDLE: $(#id)
- } else {
- elem = document.getElementById( match[ 2 ] );
-
- // Support: Blackberry 4.6
- // gEBID returns nodes no longer in the document (#6963)
- if ( elem && elem.parentNode ) {
-
- // Inject the element directly into the jQuery object
- this.length = 1;
- this[ 0 ] = elem;
- }
-
- this.context = document;
- this.selector = selector;
- return this;
- }
-
- // HANDLE: $(expr, $(...))
- } else if ( !context || context.jquery ) {
- return ( context || root ).find( selector );
-
- // HANDLE: $(expr, context)
- // (which is just equivalent to: $(context).find(expr)
- } else {
- return this.constructor( context ).find( selector );
- }
-
- // HANDLE: $(DOMElement)
- } else if ( selector.nodeType ) {
- this.context = this[ 0 ] = selector;
- this.length = 1;
- return this;
-
- // HANDLE: $(function)
- // Shortcut for document ready
- } else if ( jQuery.isFunction( selector ) ) {
- return root.ready !== undefined ?
- root.ready( selector ) :
-
- // Execute immediately if ready is not present
- selector( jQuery );
- }
-
- if ( selector.selector !== undefined ) {
- this.selector = selector.selector;
- this.context = selector.context;
- }
-
- return jQuery.makeArray( selector, this );
- };
-
-// Give the init function the jQuery prototype for later instantiation
-init.prototype = jQuery.fn;
-
-// Initialize central reference
-rootjQuery = jQuery( document );
-
-
-var rparentsprev = /^(?:parents|prev(?:Until|All))/,
-
- // Methods guaranteed to produce a unique set when starting from a unique set
- guaranteedUnique = {
- children: true,
- contents: true,
- next: true,
- prev: true
- };
-
-jQuery.fn.extend( {
- has: function( target ) {
- var targets = jQuery( target, this ),
- l = targets.length;
-
- return this.filter( function() {
- var i = 0;
- for ( ; i < l; i++ ) {
- if ( jQuery.contains( this, targets[ i ] ) ) {
- return true;
- }
- }
- } );
- },
-
- closest: function( selectors, context ) {
- var cur,
- i = 0,
- l = this.length,
- matched = [],
- pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
- jQuery( selectors, context || this.context ) :
- 0;
-
- for ( ; i < l; i++ ) {
- for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
-
- // Always skip document fragments
- if ( cur.nodeType < 11 && ( pos ?
- pos.index( cur ) > -1 :
-
- // Don't pass non-elements to Sizzle
- cur.nodeType === 1 &&
- jQuery.find.matchesSelector( cur, selectors ) ) ) {
-
- matched.push( cur );
- break;
- }
- }
- }
-
- return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
- },
-
- // Determine the position of an element within the set
- index: function( elem ) {
-
- // No argument, return index in parent
- if ( !elem ) {
- return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
- }
-
- // Index in selector
- if ( typeof elem === "string" ) {
- return indexOf.call( jQuery( elem ), this[ 0 ] );
- }
-
- // Locate the position of the desired element
- return indexOf.call( this,
-
- // If it receives a jQuery object, the first element is used
- elem.jquery ? elem[ 0 ] : elem
- );
- },
-
- add: function( selector, context ) {
- return this.pushStack(
- jQuery.uniqueSort(
- jQuery.merge( this.get(), jQuery( selector, context ) )
- )
- );
- },
-
- addBack: function( selector ) {
- return this.add( selector == null ?
- this.prevObject : this.prevObject.filter( selector )
- );
- }
-} );
-
-function sibling( cur, dir ) {
- while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
- return cur;
-}
-
-jQuery.each( {
- parent: function( elem ) {
- var parent = elem.parentNode;
- return parent && parent.nodeType !== 11 ? parent : null;
- },
- parents: function( elem ) {
- return dir( elem, "parentNode" );
- },
- parentsUntil: function( elem, i, until ) {
- return dir( elem, "parentNode", until );
- },
- next: function( elem ) {
- return sibling( elem, "nextSibling" );
- },
- prev: function( elem ) {
- return sibling( elem, "previousSibling" );
- },
- nextAll: function( elem ) {
- return dir( elem, "nextSibling" );
- },
- prevAll: function( elem ) {
- return dir( elem, "previousSibling" );
- },
- nextUntil: function( elem, i, until ) {
- return dir( elem, "nextSibling", until );
- },
- prevUntil: function( elem, i, until ) {
- return dir( elem, "previousSibling", until );
- },
- siblings: function( elem ) {
- return siblings( ( elem.parentNode || {} ).firstChild, elem );
- },
- children: function( elem ) {
- return siblings( elem.firstChild );
- },
- contents: function( elem ) {
- return elem.contentDocument || jQuery.merge( [], elem.childNodes );
- }
-}, function( name, fn ) {
- jQuery.fn[ name ] = function( until, selector ) {
- var matched = jQuery.map( this, fn, until );
-
- if ( name.slice( -5 ) !== "Until" ) {
- selector = until;
- }
-
- if ( selector && typeof selector === "string" ) {
- matched = jQuery.filter( selector, matched );
- }
-
- if ( this.length > 1 ) {
-
- // Remove duplicates
- if ( !guaranteedUnique[ name ] ) {
- jQuery.uniqueSort( matched );
- }
-
- // Reverse order for parents* and prev-derivatives
- if ( rparentsprev.test( name ) ) {
- matched.reverse();
- }
- }
-
- return this.pushStack( matched );
- };
-} );
-var rnotwhite = ( /\S+/g );
-
-
-
-// Convert String-formatted options into Object-formatted ones
-function createOptions( options ) {
- var object = {};
- jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
- object[ flag ] = true;
- } );
- return object;
-}
-
-/*
- * Create a callback list using the following parameters:
- *
- * options: an optional list of space-separated options that will change how
- * the callback list behaves or a more traditional option object
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible options:
- *
- * once: will ensure the callback list can only be fired once (like a Deferred)
- *
- * memory: will keep track of previous values and will call any callback added
- * after the list has been fired right away with the latest "memorized"
- * values (like a Deferred)
- *
- * unique: will ensure a callback can only be added once (no duplicate in the list)
- *
- * stopOnFalse: interrupt callings when a callback returns false
- *
- */
-jQuery.Callbacks = function( options ) {
-
- // Convert options from String-formatted to Object-formatted if needed
- // (we check in cache first)
- options = typeof options === "string" ?
- createOptions( options ) :
- jQuery.extend( {}, options );
-
- var // Flag to know if list is currently firing
- firing,
-
- // Last fire value for non-forgettable lists
- memory,
-
- // Flag to know if list was already fired
- fired,
-
- // Flag to prevent firing
- locked,
-
- // Actual callback list
- list = [],
-
- // Queue of execution data for repeatable lists
- queue = [],
-
- // Index of currently firing callback (modified by add/remove as needed)
- firingIndex = -1,
-
- // Fire callbacks
- fire = function() {
-
- // Enforce single-firing
- locked = options.once;
-
- // Execute callbacks for all pending executions,
- // respecting firingIndex overrides and runtime changes
- fired = firing = true;
- for ( ; queue.length; firingIndex = -1 ) {
- memory = queue.shift();
- while ( ++firingIndex < list.length ) {
-
- // Run callback and check for early termination
- if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
- options.stopOnFalse ) {
-
- // Jump to end and forget the data so .add doesn't re-fire
- firingIndex = list.length;
- memory = false;
- }
- }
- }
-
- // Forget the data if we're done with it
- if ( !options.memory ) {
- memory = false;
- }
-
- firing = false;
-
- // Clean up if we're done firing for good
- if ( locked ) {
-
- // Keep an empty list if we have data for future add calls
- if ( memory ) {
- list = [];
-
- // Otherwise, this object is spent
- } else {
- list = "";
- }
- }
- },
-
- // Actual Callbacks object
- self = {
-
- // Add a callback or a collection of callbacks to the list
- add: function() {
- if ( list ) {
-
- // If we have memory from a past run, we should fire after adding
- if ( memory && !firing ) {
- firingIndex = list.length - 1;
- queue.push( memory );
- }
-
- ( function add( args ) {
- jQuery.each( args, function( _, arg ) {
- if ( jQuery.isFunction( arg ) ) {
- if ( !options.unique || !self.has( arg ) ) {
- list.push( arg );
- }
- } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
-
- // Inspect recursively
- add( arg );
- }
- } );
- } )( arguments );
-
- if ( memory && !firing ) {
- fire();
- }
- }
- return this;
- },
-
- // Remove a callback from the list
- remove: function() {
- jQuery.each( arguments, function( _, arg ) {
- var index;
- while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
- list.splice( index, 1 );
-
- // Handle firing indexes
- if ( index <= firingIndex ) {
- firingIndex--;
- }
- }
- } );
- return this;
- },
-
- // Check if a given callback is in the list.
- // If no argument is given, return whether or not list has callbacks attached.
- has: function( fn ) {
- return fn ?
- jQuery.inArray( fn, list ) > -1 :
- list.length > 0;
- },
-
- // Remove all callbacks from the list
- empty: function() {
- if ( list ) {
- list = [];
- }
- return this;
- },
-
- // Disable .fire and .add
- // Abort any current/pending executions
- // Clear all callbacks and values
- disable: function() {
- locked = queue = [];
- list = memory = "";
- return this;
- },
- disabled: function() {
- return !list;
- },
-
- // Disable .fire
- // Also disable .add unless we have memory (since it would have no effect)
- // Abort any pending executions
- lock: function() {
- locked = queue = [];
- if ( !memory ) {
- list = memory = "";
- }
- return this;
- },
- locked: function() {
- return !!locked;
- },
-
- // Call all callbacks with the given context and arguments
- fireWith: function( context, args ) {
- if ( !locked ) {
- args = args || [];
- args = [ context, args.slice ? args.slice() : args ];
- queue.push( args );
- if ( !firing ) {
- fire();
- }
- }
- return this;
- },
-
- // Call all the callbacks with the given arguments
- fire: function() {
- self.fireWith( this, arguments );
- return this;
- },
-
- // To know if the callbacks have already been called at least once
- fired: function() {
- return !!fired;
- }
- };
-
- return self;
-};
-
-
-jQuery.extend( {
-
- Deferred: function( func ) {
- var tuples = [
-
- // action, add listener, listener list, final state
- [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ],
- [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ],
- [ "notify", "progress", jQuery.Callbacks( "memory" ) ]
- ],
- state = "pending",
- promise = {
- state: function() {
- return state;
- },
- always: function() {
- deferred.done( arguments ).fail( arguments );
- return this;
- },
- then: function( /* fnDone, fnFail, fnProgress */ ) {
- var fns = arguments;
- return jQuery.Deferred( function( newDefer ) {
- jQuery.each( tuples, function( i, tuple ) {
- var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
-
- // deferred[ done | fail | progress ] for forwarding actions to newDefer
- deferred[ tuple[ 1 ] ]( function() {
- var returned = fn && fn.apply( this, arguments );
- if ( returned && jQuery.isFunction( returned.promise ) ) {
- returned.promise()
- .progress( newDefer.notify )
- .done( newDefer.resolve )
- .fail( newDefer.reject );
- } else {
- newDefer[ tuple[ 0 ] + "With" ](
- this === promise ? newDefer.promise() : this,
- fn ? [ returned ] : arguments
- );
- }
- } );
- } );
- fns = null;
- } ).promise();
- },
-
- // Get a promise for this deferred
- // If obj is provided, the promise aspect is added to the object
- promise: function( obj ) {
- return obj != null ? jQuery.extend( obj, promise ) : promise;
- }
- },
- deferred = {};
-
- // Keep pipe for back-compat
- promise.pipe = promise.then;
-
- // Add list-specific methods
- jQuery.each( tuples, function( i, tuple ) {
- var list = tuple[ 2 ],
- stateString = tuple[ 3 ];
-
- // promise[ done | fail | progress ] = list.add
- promise[ tuple[ 1 ] ] = list.add;
-
- // Handle state
- if ( stateString ) {
- list.add( function() {
-
- // state = [ resolved | rejected ]
- state = stateString;
-
- // [ reject_list | resolve_list ].disable; progress_list.lock
- }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
- }
-
- // deferred[ resolve | reject | notify ]
- deferred[ tuple[ 0 ] ] = function() {
- deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments );
- return this;
- };
- deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
- } );
-
- // Make the deferred a promise
- promise.promise( deferred );
-
- // Call given func if any
- if ( func ) {
- func.call( deferred, deferred );
- }
-
- // All done!
- return deferred;
- },
-
- // Deferred helper
- when: function( subordinate /* , ..., subordinateN */ ) {
- var i = 0,
- resolveValues = slice.call( arguments ),
- length = resolveValues.length,
-
- // the count of uncompleted subordinates
- remaining = length !== 1 ||
- ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
-
- // the master Deferred.
- // If resolveValues consist of only a single Deferred, just use that.
- deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
-
- // Update function for both resolve and progress values
- updateFunc = function( i, contexts, values ) {
- return function( value ) {
- contexts[ i ] = this;
- values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
- if ( values === progressValues ) {
- deferred.notifyWith( contexts, values );
- } else if ( !( --remaining ) ) {
- deferred.resolveWith( contexts, values );
- }
- };
- },
-
- progressValues, progressContexts, resolveContexts;
-
- // Add listeners to Deferred subordinates; treat others as resolved
- if ( length > 1 ) {
- progressValues = new Array( length );
- progressContexts = new Array( length );
- resolveContexts = new Array( length );
- for ( ; i < length; i++ ) {
- if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
- resolveValues[ i ].promise()
- .progress( updateFunc( i, progressContexts, progressValues ) )
- .done( updateFunc( i, resolveContexts, resolveValues ) )
- .fail( deferred.reject );
- } else {
- --remaining;
- }
- }
- }
-
- // If we're not waiting on anything, resolve the master
- if ( !remaining ) {
- deferred.resolveWith( resolveContexts, resolveValues );
- }
-
- return deferred.promise();
- }
-} );
-
-
-// The deferred used on DOM ready
-var readyList;
-
-jQuery.fn.ready = function( fn ) {
-
- // Add the callback
- jQuery.ready.promise().done( fn );
-
- return this;
-};
-
-jQuery.extend( {
-
- // Is the DOM ready to be used? Set to true once it occurs.
- isReady: false,
-
- // A counter to track how many items to wait for before
- // the ready event fires. See #6781
- readyWait: 1,
-
- // Hold (or release) the ready event
- holdReady: function( hold ) {
- if ( hold ) {
- jQuery.readyWait++;
- } else {
- jQuery.ready( true );
- }
- },
-
- // Handle when the DOM is ready
- ready: function( wait ) {
-
- // Abort if there are pending holds or we're already ready
- if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
- return;
- }
-
- // Remember that the DOM is ready
- jQuery.isReady = true;
-
- // If a normal DOM Ready event fired, decrement, and wait if need be
- if ( wait !== true && --jQuery.readyWait > 0 ) {
- return;
- }
-
- // If there are functions bound, to execute
- readyList.resolveWith( document, [ jQuery ] );
-
- // Trigger any bound ready events
- if ( jQuery.fn.triggerHandler ) {
- jQuery( document ).triggerHandler( "ready" );
- jQuery( document ).off( "ready" );
- }
- }
-} );
-
-/**
- * The ready event handler and self cleanup method
- */
-function completed() {
- document.removeEventListener( "DOMContentLoaded", completed );
- window.removeEventListener( "load", completed );
- jQuery.ready();
-}
-
-jQuery.ready.promise = function( obj ) {
- if ( !readyList ) {
-
- readyList = jQuery.Deferred();
-
- // Catch cases where $(document).ready() is called
- // after the browser event has already occurred.
- // Support: IE9-10 only
- // Older IE sometimes signals "interactive" too soon
- if ( document.readyState === "complete" ||
- ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
-
- // Handle it asynchronously to allow scripts the opportunity to delay ready
- window.setTimeout( jQuery.ready );
-
- } else {
-
- // Use the handy event callback
- document.addEventListener( "DOMContentLoaded", completed );
-
- // A fallback to window.onload, that will always work
- window.addEventListener( "load", completed );
- }
- }
- return readyList.promise( obj );
-};
-
-// Kick off the DOM ready check even if the user does not
-jQuery.ready.promise();
-
-
-
-
-// Multifunctional method to get and set values of a collection
-// The value/s can optionally be executed if it's a function
-var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
- var i = 0,
- len = elems.length,
- bulk = key == null;
-
- // Sets many values
- if ( jQuery.type( key ) === "object" ) {
- chainable = true;
- for ( i in key ) {
- access( elems, fn, i, key[ i ], true, emptyGet, raw );
- }
-
- // Sets one value
- } else if ( value !== undefined ) {
- chainable = true;
-
- if ( !jQuery.isFunction( value ) ) {
- raw = true;
- }
-
- if ( bulk ) {
-
- // Bulk operations run against the entire set
- if ( raw ) {
- fn.call( elems, value );
- fn = null;
-
- // ...except when executing function values
- } else {
- bulk = fn;
- fn = function( elem, key, value ) {
- return bulk.call( jQuery( elem ), value );
- };
- }
- }
-
- if ( fn ) {
- for ( ; i < len; i++ ) {
- fn(
- elems[ i ], key, raw ?
- value :
- value.call( elems[ i ], i, fn( elems[ i ], key ) )
- );
- }
- }
- }
-
- return chainable ?
- elems :
-
- // Gets
- bulk ?
- fn.call( elems ) :
- len ? fn( elems[ 0 ], key ) : emptyGet;
-};
-var acceptData = function( owner ) {
-
- // Accepts only:
- // - Node
- // - Node.ELEMENT_NODE
- // - Node.DOCUMENT_NODE
- // - Object
- // - Any
- /* jshint -W018 */
- return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
-};
-
-
-
-
-function Data() {
- this.expando = jQuery.expando + Data.uid++;
-}
-
-Data.uid = 1;
-
-Data.prototype = {
-
- register: function( owner, initial ) {
- var value = initial || {};
-
- // If it is a node unlikely to be stringify-ed or looped over
- // use plain assignment
- if ( owner.nodeType ) {
- owner[ this.expando ] = value;
-
- // Otherwise secure it in a non-enumerable, non-writable property
- // configurability must be true to allow the property to be
- // deleted with the delete operator
- } else {
- Object.defineProperty( owner, this.expando, {
- value: value,
- writable: true,
- configurable: true
- } );
- }
- return owner[ this.expando ];
- },
- cache: function( owner ) {
-
- // We can accept data for non-element nodes in modern browsers,
- // but we should not, see #8335.
- // Always return an empty object.
- if ( !acceptData( owner ) ) {
- return {};
- }
-
- // Check if the owner object already has a cache
- var value = owner[ this.expando ];
-
- // If not, create one
- if ( !value ) {
- value = {};
-
- // We can accept data for non-element nodes in modern browsers,
- // but we should not, see #8335.
- // Always return an empty object.
- if ( acceptData( owner ) ) {
-
- // If it is a node unlikely to be stringify-ed or looped over
- // use plain assignment
- if ( owner.nodeType ) {
- owner[ this.expando ] = value;
-
- // Otherwise secure it in a non-enumerable property
- // configurable must be true to allow the property to be
- // deleted when data is removed
- } else {
- Object.defineProperty( owner, this.expando, {
- value: value,
- configurable: true
- } );
- }
- }
- }
-
- return value;
- },
- set: function( owner, data, value ) {
- var prop,
- cache = this.cache( owner );
-
- // Handle: [ owner, key, value ] args
- if ( typeof data === "string" ) {
- cache[ data ] = value;
-
- // Handle: [ owner, { properties } ] args
- } else {
-
- // Copy the properties one-by-one to the cache object
- for ( prop in data ) {
- cache[ prop ] = data[ prop ];
- }
- }
- return cache;
- },
- get: function( owner, key ) {
- return key === undefined ?
- this.cache( owner ) :
- owner[ this.expando ] && owner[ this.expando ][ key ];
- },
- access: function( owner, key, value ) {
- var stored;
-
- // In cases where either:
- //
- // 1. No key was specified
- // 2. A string key was specified, but no value provided
- //
- // Take the "read" path and allow the get method to determine
- // which value to return, respectively either:
- //
- // 1. The entire cache object
- // 2. The data stored at the key
- //
- if ( key === undefined ||
- ( ( key && typeof key === "string" ) && value === undefined ) ) {
-
- stored = this.get( owner, key );
-
- return stored !== undefined ?
- stored : this.get( owner, jQuery.camelCase( key ) );
- }
-
- // When the key is not a string, or both a key and value
- // are specified, set or extend (existing objects) with either:
- //
- // 1. An object of properties
- // 2. A key and value
- //
- this.set( owner, key, value );
-
- // Since the "set" path can have two possible entry points
- // return the expected data based on which path was taken[*]
- return value !== undefined ? value : key;
- },
- remove: function( owner, key ) {
- var i, name, camel,
- cache = owner[ this.expando ];
-
- if ( cache === undefined ) {
- return;
- }
-
- if ( key === undefined ) {
- this.register( owner );
-
- } else {
-
- // Support array or space separated string of keys
- if ( jQuery.isArray( key ) ) {
-
- // If "name" is an array of keys...
- // When data is initially created, via ("key", "val") signature,
- // keys will be converted to camelCase.
- // Since there is no way to tell _how_ a key was added, remove
- // both plain key and camelCase key. #12786
- // This will only penalize the array argument path.
- name = key.concat( key.map( jQuery.camelCase ) );
- } else {
- camel = jQuery.camelCase( key );
-
- // Try the string as a key before any manipulation
- if ( key in cache ) {
- name = [ key, camel ];
- } else {
-
- // If a key with the spaces exists, use it.
- // Otherwise, create an array by matching non-whitespace
- name = camel;
- name = name in cache ?
- [ name ] : ( name.match( rnotwhite ) || [] );
- }
- }
-
- i = name.length;
-
- while ( i-- ) {
- delete cache[ name[ i ] ];
- }
- }
-
- // Remove the expando if there's no more data
- if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
-
- // Support: Chrome <= 35-45+
- // Webkit & Blink performance suffers when deleting properties
- // from DOM nodes, so set to undefined instead
- // https://code.google.com/p/chromium/issues/detail?id=378607
- if ( owner.nodeType ) {
- owner[ this.expando ] = undefined;
- } else {
- delete owner[ this.expando ];
- }
- }
- },
- hasData: function( owner ) {
- var cache = owner[ this.expando ];
- return cache !== undefined && !jQuery.isEmptyObject( cache );
- }
-};
-var dataPriv = new Data();
-
-var dataUser = new Data();
-
-
-
-// Implementation Summary
-//
-// 1. Enforce API surface and semantic compatibility with 1.9.x branch
-// 2. Improve the module's maintainability by reducing the storage
-// paths to a single mechanism.
-// 3. Use the same single mechanism to support "private" and "user" data.
-// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
-// 5. Avoid exposing implementation details on user objects (eg. expando properties)
-// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
-
-var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
- rmultiDash = /[A-Z]/g;
-
-function dataAttr( elem, key, data ) {
- var name;
-
- // If nothing was found internally, try to fetch any
- // data from the HTML5 data-* attribute
- if ( data === undefined && elem.nodeType === 1 ) {
- name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
- data = elem.getAttribute( name );
-
- if ( typeof data === "string" ) {
- try {
- data = data === "true" ? true :
- data === "false" ? false :
- data === "null" ? null :
-
- // Only convert to a number if it doesn't change the string
- +data + "" === data ? +data :
- rbrace.test( data ) ? jQuery.parseJSON( data ) :
- data;
- } catch ( e ) {}
-
- // Make sure we set the data so it isn't changed later
- dataUser.set( elem, key, data );
- } else {
- data = undefined;
- }
- }
- return data;
-}
-
-jQuery.extend( {
- hasData: function( elem ) {
- return dataUser.hasData( elem ) || dataPriv.hasData( elem );
- },
-
- data: function( elem, name, data ) {
- return dataUser.access( elem, name, data );
- },
-
- removeData: function( elem, name ) {
- dataUser.remove( elem, name );
- },
-
- // TODO: Now that all calls to _data and _removeData have been replaced
- // with direct calls to dataPriv methods, these can be deprecated.
- _data: function( elem, name, data ) {
- return dataPriv.access( elem, name, data );
- },
-
- _removeData: function( elem, name ) {
- dataPriv.remove( elem, name );
- }
-} );
-
-jQuery.fn.extend( {
- data: function( key, value ) {
- var i, name, data,
- elem = this[ 0 ],
- attrs = elem && elem.attributes;
-
- // Gets all values
- if ( key === undefined ) {
- if ( this.length ) {
- data = dataUser.get( elem );
-
- if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
- i = attrs.length;
- while ( i-- ) {
-
- // Support: IE11+
- // The attrs elements can be null (#14894)
- if ( attrs[ i ] ) {
- name = attrs[ i ].name;
- if ( name.indexOf( "data-" ) === 0 ) {
- name = jQuery.camelCase( name.slice( 5 ) );
- dataAttr( elem, name, data[ name ] );
- }
- }
- }
- dataPriv.set( elem, "hasDataAttrs", true );
- }
- }
-
- return data;
- }
-
- // Sets multiple values
- if ( typeof key === "object" ) {
- return this.each( function() {
- dataUser.set( this, key );
- } );
- }
-
- return access( this, function( value ) {
- var data, camelKey;
-
- // The calling jQuery object (element matches) is not empty
- // (and therefore has an element appears at this[ 0 ]) and the
- // `value` parameter was not undefined. An empty jQuery object
- // will result in `undefined` for elem = this[ 0 ] which will
- // throw an exception if an attempt to read a data cache is made.
- if ( elem && value === undefined ) {
-
- // Attempt to get data from the cache
- // with the key as-is
- data = dataUser.get( elem, key ) ||
-
- // Try to find dashed key if it exists (gh-2779)
- // This is for 2.2.x only
- dataUser.get( elem, key.replace( rmultiDash, "-$&" ).toLowerCase() );
-
- if ( data !== undefined ) {
- return data;
- }
-
- camelKey = jQuery.camelCase( key );
-
- // Attempt to get data from the cache
- // with the key camelized
- data = dataUser.get( elem, camelKey );
- if ( data !== undefined ) {
- return data;
- }
-
- // Attempt to "discover" the data in
- // HTML5 custom data-* attrs
- data = dataAttr( elem, camelKey, undefined );
- if ( data !== undefined ) {
- return data;
- }
-
- // We tried really hard, but the data doesn't exist.
- return;
- }
-
- // Set the data...
- camelKey = jQuery.camelCase( key );
- this.each( function() {
-
- // First, attempt to store a copy or reference of any
- // data that might've been store with a camelCased key.
- var data = dataUser.get( this, camelKey );
-
- // For HTML5 data-* attribute interop, we have to
- // store property names with dashes in a camelCase form.
- // This might not apply to all properties...*
- dataUser.set( this, camelKey, value );
-
- // *... In the case of properties that might _actually_
- // have dashes, we need to also store a copy of that
- // unchanged property.
- if ( key.indexOf( "-" ) > -1 && data !== undefined ) {
- dataUser.set( this, key, value );
- }
- } );
- }, null, value, arguments.length > 1, null, true );
- },
-
- removeData: function( key ) {
- return this.each( function() {
- dataUser.remove( this, key );
- } );
- }
-} );
-
-
-jQuery.extend( {
- queue: function( elem, type, data ) {
- var queue;
-
- if ( elem ) {
- type = ( type || "fx" ) + "queue";
- queue = dataPriv.get( elem, type );
-
- // Speed up dequeue by getting out quickly if this is just a lookup
- if ( data ) {
- if ( !queue || jQuery.isArray( data ) ) {
- queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
- } else {
- queue.push( data );
- }
- }
- return queue || [];
- }
- },
-
- dequeue: function( elem, type ) {
- type = type || "fx";
-
- var queue = jQuery.queue( elem, type ),
- startLength = queue.length,
- fn = queue.shift(),
- hooks = jQuery._queueHooks( elem, type ),
- next = function() {
- jQuery.dequeue( elem, type );
- };
-
- // If the fx queue is dequeued, always remove the progress sentinel
- if ( fn === "inprogress" ) {
- fn = queue.shift();
- startLength--;
- }
-
- if ( fn ) {
-
- // Add a progress sentinel to prevent the fx queue from being
- // automatically dequeued
- if ( type === "fx" ) {
- queue.unshift( "inprogress" );
- }
-
- // Clear up the last queue stop function
- delete hooks.stop;
- fn.call( elem, next, hooks );
- }
-
- if ( !startLength && hooks ) {
- hooks.empty.fire();
- }
- },
-
- // Not public - generate a queueHooks object, or return the current one
- _queueHooks: function( elem, type ) {
- var key = type + "queueHooks";
- return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
- empty: jQuery.Callbacks( "once memory" ).add( function() {
- dataPriv.remove( elem, [ type + "queue", key ] );
- } )
- } );
- }
-} );
-
-jQuery.fn.extend( {
- queue: function( type, data ) {
- var setter = 2;
-
- if ( typeof type !== "string" ) {
- data = type;
- type = "fx";
- setter--;
- }
-
- if ( arguments.length < setter ) {
- return jQuery.queue( this[ 0 ], type );
- }
-
- return data === undefined ?
- this :
- this.each( function() {
- var queue = jQuery.queue( this, type, data );
-
- // Ensure a hooks for this queue
- jQuery._queueHooks( this, type );
-
- if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
- jQuery.dequeue( this, type );
- }
- } );
- },
- dequeue: function( type ) {
- return this.each( function() {
- jQuery.dequeue( this, type );
- } );
- },
- clearQueue: function( type ) {
- return this.queue( type || "fx", [] );
- },
-
- // Get a promise resolved when queues of a certain type
- // are emptied (fx is the type by default)
- promise: function( type, obj ) {
- var tmp,
- count = 1,
- defer = jQuery.Deferred(),
- elements = this,
- i = this.length,
- resolve = function() {
- if ( !( --count ) ) {
- defer.resolveWith( elements, [ elements ] );
- }
- };
-
- if ( typeof type !== "string" ) {
- obj = type;
- type = undefined;
- }
- type = type || "fx";
-
- while ( i-- ) {
- tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
- if ( tmp && tmp.empty ) {
- count++;
- tmp.empty.add( resolve );
- }
- }
- resolve();
- return defer.promise( obj );
- }
-} );
-var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
-
-var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
-
-
-var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
-
-var isHidden = function( elem, el ) {
-
- // isHidden might be called from jQuery#filter function;
- // in that case, element will be second argument
- elem = el || elem;
- return jQuery.css( elem, "display" ) === "none" ||
- !jQuery.contains( elem.ownerDocument, elem );
- };
-
-
-
-function adjustCSS( elem, prop, valueParts, tween ) {
- var adjusted,
- scale = 1,
- maxIterations = 20,
- currentValue = tween ?
- function() { return tween.cur(); } :
- function() { return jQuery.css( elem, prop, "" ); },
- initial = currentValue(),
- unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
-
- // Starting value computation is required for potential unit mismatches
- initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
- rcssNum.exec( jQuery.css( elem, prop ) );
-
- if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
-
- // Trust units reported by jQuery.css
- unit = unit || initialInUnit[ 3 ];
-
- // Make sure we update the tween properties later on
- valueParts = valueParts || [];
-
- // Iteratively approximate from a nonzero starting point
- initialInUnit = +initial || 1;
-
- do {
-
- // If previous iteration zeroed out, double until we get *something*.
- // Use string for doubling so we don't accidentally see scale as unchanged below
- scale = scale || ".5";
-
- // Adjust and apply
- initialInUnit = initialInUnit / scale;
- jQuery.style( elem, prop, initialInUnit + unit );
-
- // Update scale, tolerating zero or NaN from tween.cur()
- // Break the loop if scale is unchanged or perfect, or if we've just had enough.
- } while (
- scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
- );
- }
-
- if ( valueParts ) {
- initialInUnit = +initialInUnit || +initial || 0;
-
- // Apply relative offset (+=/-=) if specified
- adjusted = valueParts[ 1 ] ?
- initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
- +valueParts[ 2 ];
- if ( tween ) {
- tween.unit = unit;
- tween.start = initialInUnit;
- tween.end = adjusted;
- }
- }
- return adjusted;
-}
-var rcheckableType = ( /^(?:checkbox|radio)$/i );
-
-var rtagName = ( /<([\w:-]+)/ );
-
-var rscriptType = ( /^$|\/(?:java|ecma)script/i );
-
-
-
-// We have to close these tags to support XHTML (#13200)
-var wrapMap = {
-
- // Support: IE9
- option: [ 1, "" ],
-
- // XHTML parsers do not magically insert elements in the
- // same way that tag soup parsers do. So we cannot shorten
- // this by omitting or other required elements.
- thead: [ 1, "" ],
- col: [ 2, "" ],
- tr: [ 2, "" ],
- td: [ 3, "" ],
-
- _default: [ 0, "", "" ]
-};
-
-// Support: IE9
-wrapMap.optgroup = wrapMap.option;
-
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
-
-
-function getAll( context, tag ) {
-
- // Support: IE9-11+
- // Use typeof to avoid zero-argument method invocation on host objects (#15151)
- var ret = typeof context.getElementsByTagName !== "undefined" ?
- context.getElementsByTagName( tag || "*" ) :
- typeof context.querySelectorAll !== "undefined" ?
- context.querySelectorAll( tag || "*" ) :
- [];
-
- return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
- jQuery.merge( [ context ], ret ) :
- ret;
-}
-
-
-// Mark scripts as having already been evaluated
-function setGlobalEval( elems, refElements ) {
- var i = 0,
- l = elems.length;
-
- for ( ; i < l; i++ ) {
- dataPriv.set(
- elems[ i ],
- "globalEval",
- !refElements || dataPriv.get( refElements[ i ], "globalEval" )
- );
- }
-}
-
-
-var rhtml = /<|?\w+;/;
-
-function buildFragment( elems, context, scripts, selection, ignored ) {
- var elem, tmp, tag, wrap, contains, j,
- fragment = context.createDocumentFragment(),
- nodes = [],
- i = 0,
- l = elems.length;
-
- for ( ; i < l; i++ ) {
- elem = elems[ i ];
-
- if ( elem || elem === 0 ) {
-
- // Add nodes directly
- if ( jQuery.type( elem ) === "object" ) {
-
- // Support: Android<4.1, PhantomJS<2
- // push.apply(_, arraylike) throws on ancient WebKit
- jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
-
- // Convert non-html into a text node
- } else if ( !rhtml.test( elem ) ) {
- nodes.push( context.createTextNode( elem ) );
-
- // Convert html into DOM nodes
- } else {
- tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
-
- // Deserialize a standard representation
- tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
- wrap = wrapMap[ tag ] || wrapMap._default;
- tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
-
- // Descend through wrappers to the right content
- j = wrap[ 0 ];
- while ( j-- ) {
- tmp = tmp.lastChild;
- }
-
- // Support: Android<4.1, PhantomJS<2
- // push.apply(_, arraylike) throws on ancient WebKit
- jQuery.merge( nodes, tmp.childNodes );
-
- // Remember the top-level container
- tmp = fragment.firstChild;
-
- // Ensure the created nodes are orphaned (#12392)
- tmp.textContent = "";
- }
- }
- }
-
- // Remove wrapper from fragment
- fragment.textContent = "";
-
- i = 0;
- while ( ( elem = nodes[ i++ ] ) ) {
-
- // Skip elements already in the context collection (trac-4087)
- if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
- if ( ignored ) {
- ignored.push( elem );
- }
- continue;
- }
-
- contains = jQuery.contains( elem.ownerDocument, elem );
-
- // Append to fragment
- tmp = getAll( fragment.appendChild( elem ), "script" );
-
- // Preserve script evaluation history
- if ( contains ) {
- setGlobalEval( tmp );
- }
-
- // Capture executables
- if ( scripts ) {
- j = 0;
- while ( ( elem = tmp[ j++ ] ) ) {
- if ( rscriptType.test( elem.type || "" ) ) {
- scripts.push( elem );
- }
- }
- }
- }
-
- return fragment;
-}
-
-
-( function() {
- var fragment = document.createDocumentFragment(),
- div = fragment.appendChild( document.createElement( "div" ) ),
- input = document.createElement( "input" );
-
- // Support: Android 4.0-4.3, Safari<=5.1
- // Check state lost if the name is set (#11217)
- // Support: Windows Web Apps (WWA)
- // `name` and `type` must use .setAttribute for WWA (#14901)
- input.setAttribute( "type", "radio" );
- input.setAttribute( "checked", "checked" );
- input.setAttribute( "name", "t" );
-
- div.appendChild( input );
-
- // Support: Safari<=5.1, Android<4.2
- // Older WebKit doesn't clone checked state correctly in fragments
- support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
- // Support: IE<=11+
- // Make sure textarea (and checkbox) defaultValue is properly cloned
- div.innerHTML = "";
- support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
-} )();
-
-
-var
- rkeyEvent = /^key/,
- rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
- rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
-
-function returnTrue() {
- return true;
-}
-
-function returnFalse() {
- return false;
-}
-
-// Support: IE9
-// See #13393 for more info
-function safeActiveElement() {
- try {
- return document.activeElement;
- } catch ( err ) { }
-}
-
-function on( elem, types, selector, data, fn, one ) {
- var origFn, type;
-
- // Types can be a map of types/handlers
- if ( typeof types === "object" ) {
-
- // ( types-Object, selector, data )
- if ( typeof selector !== "string" ) {
-
- // ( types-Object, data )
- data = data || selector;
- selector = undefined;
- }
- for ( type in types ) {
- on( elem, type, selector, data, types[ type ], one );
- }
- return elem;
- }
-
- if ( data == null && fn == null ) {
-
- // ( types, fn )
- fn = selector;
- data = selector = undefined;
- } else if ( fn == null ) {
- if ( typeof selector === "string" ) {
-
- // ( types, selector, fn )
- fn = data;
- data = undefined;
- } else {
-
- // ( types, data, fn )
- fn = data;
- data = selector;
- selector = undefined;
- }
- }
- if ( fn === false ) {
- fn = returnFalse;
- } else if ( !fn ) {
- return this;
- }
-
- if ( one === 1 ) {
- origFn = fn;
- fn = function( event ) {
-
- // Can use an empty set, since event contains the info
- jQuery().off( event );
- return origFn.apply( this, arguments );
- };
-
- // Use same guid so caller can remove using origFn
- fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
- }
- return elem.each( function() {
- jQuery.event.add( this, types, fn, data, selector );
- } );
-}
-
-/*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
-jQuery.event = {
-
- global: {},
-
- add: function( elem, types, handler, data, selector ) {
-
- var handleObjIn, eventHandle, tmp,
- events, t, handleObj,
- special, handlers, type, namespaces, origType,
- elemData = dataPriv.get( elem );
-
- // Don't attach events to noData or text/comment nodes (but allow plain objects)
- if ( !elemData ) {
- return;
- }
-
- // Caller can pass in an object of custom data in lieu of the handler
- if ( handler.handler ) {
- handleObjIn = handler;
- handler = handleObjIn.handler;
- selector = handleObjIn.selector;
- }
-
- // Make sure that the handler has a unique ID, used to find/remove it later
- if ( !handler.guid ) {
- handler.guid = jQuery.guid++;
- }
-
- // Init the element's event structure and main handler, if this is the first
- if ( !( events = elemData.events ) ) {
- events = elemData.events = {};
- }
- if ( !( eventHandle = elemData.handle ) ) {
- eventHandle = elemData.handle = function( e ) {
-
- // Discard the second event of a jQuery.event.trigger() and
- // when an event is called after a page has unloaded
- return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
- jQuery.event.dispatch.apply( elem, arguments ) : undefined;
- };
- }
-
- // Handle multiple events separated by a space
- types = ( types || "" ).match( rnotwhite ) || [ "" ];
- t = types.length;
- while ( t-- ) {
- tmp = rtypenamespace.exec( types[ t ] ) || [];
- type = origType = tmp[ 1 ];
- namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
-
- // There *must* be a type, no attaching namespace-only handlers
- if ( !type ) {
- continue;
- }
-
- // If event changes its type, use the special event handlers for the changed type
- special = jQuery.event.special[ type ] || {};
-
- // If selector defined, determine special event api type, otherwise given type
- type = ( selector ? special.delegateType : special.bindType ) || type;
-
- // Update special based on newly reset type
- special = jQuery.event.special[ type ] || {};
-
- // handleObj is passed to all event handlers
- handleObj = jQuery.extend( {
- type: type,
- origType: origType,
- data: data,
- handler: handler,
- guid: handler.guid,
- selector: selector,
- needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
- namespace: namespaces.join( "." )
- }, handleObjIn );
-
- // Init the event handler queue if we're the first
- if ( !( handlers = events[ type ] ) ) {
- handlers = events[ type ] = [];
- handlers.delegateCount = 0;
-
- // Only use addEventListener if the special events handler returns false
- if ( !special.setup ||
- special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
-
- if ( elem.addEventListener ) {
- elem.addEventListener( type, eventHandle );
- }
- }
- }
-
- if ( special.add ) {
- special.add.call( elem, handleObj );
-
- if ( !handleObj.handler.guid ) {
- handleObj.handler.guid = handler.guid;
- }
- }
-
- // Add to the element's handler list, delegates in front
- if ( selector ) {
- handlers.splice( handlers.delegateCount++, 0, handleObj );
- } else {
- handlers.push( handleObj );
- }
-
- // Keep track of which events have ever been used, for event optimization
- jQuery.event.global[ type ] = true;
- }
-
- },
-
- // Detach an event or set of events from an element
- remove: function( elem, types, handler, selector, mappedTypes ) {
-
- var j, origCount, tmp,
- events, t, handleObj,
- special, handlers, type, namespaces, origType,
- elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
-
- if ( !elemData || !( events = elemData.events ) ) {
- return;
- }
-
- // Once for each type.namespace in types; type may be omitted
- types = ( types || "" ).match( rnotwhite ) || [ "" ];
- t = types.length;
- while ( t-- ) {
- tmp = rtypenamespace.exec( types[ t ] ) || [];
- type = origType = tmp[ 1 ];
- namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
-
- // Unbind all events (on this namespace, if provided) for the element
- if ( !type ) {
- for ( type in events ) {
- jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
- }
- continue;
- }
-
- special = jQuery.event.special[ type ] || {};
- type = ( selector ? special.delegateType : special.bindType ) || type;
- handlers = events[ type ] || [];
- tmp = tmp[ 2 ] &&
- new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
-
- // Remove matching events
- origCount = j = handlers.length;
- while ( j-- ) {
- handleObj = handlers[ j ];
-
- if ( ( mappedTypes || origType === handleObj.origType ) &&
- ( !handler || handler.guid === handleObj.guid ) &&
- ( !tmp || tmp.test( handleObj.namespace ) ) &&
- ( !selector || selector === handleObj.selector ||
- selector === "**" && handleObj.selector ) ) {
- handlers.splice( j, 1 );
-
- if ( handleObj.selector ) {
- handlers.delegateCount--;
- }
- if ( special.remove ) {
- special.remove.call( elem, handleObj );
- }
- }
- }
-
- // Remove generic event handler if we removed something and no more handlers exist
- // (avoids potential for endless recursion during removal of special event handlers)
- if ( origCount && !handlers.length ) {
- if ( !special.teardown ||
- special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
-
- jQuery.removeEvent( elem, type, elemData.handle );
- }
-
- delete events[ type ];
- }
- }
-
- // Remove data and the expando if it's no longer used
- if ( jQuery.isEmptyObject( events ) ) {
- dataPriv.remove( elem, "handle events" );
- }
- },
-
- dispatch: function( event ) {
-
- // Make a writable jQuery.Event from the native event object
- event = jQuery.event.fix( event );
-
- var i, j, ret, matched, handleObj,
- handlerQueue = [],
- args = slice.call( arguments ),
- handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
- special = jQuery.event.special[ event.type ] || {};
-
- // Use the fix-ed jQuery.Event rather than the (read-only) native event
- args[ 0 ] = event;
- event.delegateTarget = this;
-
- // Call the preDispatch hook for the mapped type, and let it bail if desired
- if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
- return;
- }
-
- // Determine handlers
- handlerQueue = jQuery.event.handlers.call( this, event, handlers );
-
- // Run delegates first; they may want to stop propagation beneath us
- i = 0;
- while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
- event.currentTarget = matched.elem;
-
- j = 0;
- while ( ( handleObj = matched.handlers[ j++ ] ) &&
- !event.isImmediatePropagationStopped() ) {
-
- // Triggered event must either 1) have no namespace, or 2) have namespace(s)
- // a subset or equal to those in the bound event (both can have no namespace).
- if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
-
- event.handleObj = handleObj;
- event.data = handleObj.data;
-
- ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
- handleObj.handler ).apply( matched.elem, args );
-
- if ( ret !== undefined ) {
- if ( ( event.result = ret ) === false ) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
- }
- }
- }
-
- // Call the postDispatch hook for the mapped type
- if ( special.postDispatch ) {
- special.postDispatch.call( this, event );
- }
-
- return event.result;
- },
-
- handlers: function( event, handlers ) {
- var i, matches, sel, handleObj,
- handlerQueue = [],
- delegateCount = handlers.delegateCount,
- cur = event.target;
-
- // Support (at least): Chrome, IE9
- // Find delegate handlers
- // Black-hole SVG