diff --git a/README.md b/README.md new file mode 100644 index 0000000..cd82a47 --- /dev/null +++ b/README.md @@ -0,0 +1,52 @@ +### How to show a custom media field with a Hotspot +It is also possible to show the image hotspots on a media type +which was generated through a custom field. + +First you would need to create of course your custom media type. + +> Because the media type in custom fields only supports the compact media uploader, +we need to set the hotspot directly within the media library. + +Head over to your media library and go to the HotSpot image folder `Media > Hotspot Images` +and upload your image. + +Open the context menu and click `Set image hotspot`. + +![](https://res.cloudinary.com/dtgdh7noz/image/upload/v1614600120/Hotspot%20Plugin/Bildschirmfoto_2021-03-01_um_14.01.22_cxdpu4.png) +*Hotspot Image folder in media library* + +Next a new modal will open where you can add your hotspots. Just left-click on a position somewhere on your image to +create a new hotspot. + +![](https://res.cloudinary.com/dtgdh7noz/image/upload/v1614600322/Hotspot%20Plugin/Bildschirmfoto_2021-03-01_um_14.04.49_q9xm4u.png) +*To save the hotspot click apply* + +After you added all your hotspots click **save** to save your new image hotspot file, +which you can choose now for your custom field: for example within your product. + +![](https://res.cloudinary.com/dtgdh7noz/image/upload/v1614600531/Hotspot%20Plugin/Bildschirmfoto_2021-03-01_um_14.08.07_zkkouu.png) +*Choose your hotspot image within your custom field media type* + +##### Storefront integration + +Finally you need some code to show the custom media field with its image hotspots within the Storefront. + +To do so the following code would get the custom media field and show +the hotspots + +``` +{# get the media ID of the custom field #} +{% set hotspotMediaId = page.product.customFields.your_media_custom_field %} + +# fetch media as batch - optimized for performance #} +{% set mediaCollection = searchMedia([hotspotMediaId], context.context) %} + +{# extract single media object #} +{% set hotspotMedia = mediaCollection.get(hotspotMediaId) %} + +{# generate the thumbnail and passing the hotspotEnabled option #} +{% sw_thumbnails 'hotspot-image' with { + media: hotspotMedia, + hotspotEnabled: true +} %} +``` diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..3356e77 --- /dev/null +++ b/composer.json @@ -0,0 +1,32 @@ +{ + "name": "sas/image-hotspot", + "description": "Image Hotspot Plugin for Shopware 6", + "type": "shopware-platform-plugin", + "version":"1.0.0", + "license": "MIT", + "autoload": { + "psr-4": { + "SasImageHotspot\\": "src/" + } + }, + "extra": { + "shopware-plugin-class": "SasImageHotspot\\SasImageHotspot", + "label": { + "de-DE": "Image Hotspot Plugin for Shopware 6", + "en-GB": "Image Hotspot Plugin for Shopware 6" + }, + "plugin-icon":"src/Resources/config/plugin.png", + "description":{ + "de-DE":"Image Hotspot Plugin for Shopware 6", + "en-GB":"Image Hotspot Plugin for Shopware 6" + }, + "manufacturerLink":{ + "de-DE":"https://shapeandshift.dev", + "en-GB":"https://shapeandshift.dev" + }, + "supportLink":{ + "de-DE":"https://shapeandshift.dev", + "en-GB":"https://shapeandshift.dev" + } + } +} diff --git a/src/Content/Extension/MediaEntityExtension.php b/src/Content/Extension/MediaEntityExtension.php new file mode 100644 index 0000000..2fe15de --- /dev/null +++ b/src/Content/Extension/MediaEntityExtension.php @@ -0,0 +1,31 @@ +add( + (new OneToOneAssociationField('hotspotMap', 'id', 'media_id', ImageHotspotMapDefinition::class, false))->addFlags(new CascadeDelete()) + ); + + $collection->add( + (new OneToManyAssociationField('hotspots', ImageHotspotDefinition::class, 'media_id', 'id'))->addFlags(new CascadeDelete()) + ); + } + + public function getDefinitionClass(): string + { + return MediaDefinition::class; + } +} diff --git a/src/Content/ImageHotspot/ImageHotspotCollection.php b/src/Content/ImageHotspot/ImageHotspotCollection.php new file mode 100644 index 0000000..ba43068 --- /dev/null +++ b/src/Content/ImageHotspot/ImageHotspotCollection.php @@ -0,0 +1,27 @@ +setFlags(new PrimaryKey(), new Required()), + + (new FkField('map_id', 'mapId', ImageHotspotMapDefinition::class))->addFlags(new Required()), + + (new FloatField('top', 'top'))->addFlags(new Required()), + (new FloatField('left', 'left'))->addFlags(new Required()), + + (new TranslatedField('description'))->addFlags(new AllowHtml()), + (new TranslatedField('title'))->addFlags(new AllowHtml()), + new TranslatedField('link'), + new TranslatedField('customFields'), + new TranslatedField('openNewTab'), + + new FkField('product_id', 'productId', ProductDefinition::class), + new FkField('media_id', 'mediaId', MediaDefinition::class), + new ManyToOneAssociationField('product', 'product_id', ProductDefinition::class, 'id', false), + new ManyToOneAssociationField('media', 'media_id', MediaDefinition::class, 'id', false), + + new ManyToOneAssociationField('map', 'map_id', ImageHotspotMapDefinition::class, 'id', false), + + (new TranslationsAssociationField(ImageHotspotTranslationDefinition::class, 'sas_image_hotspot_id'))->addFlags(new Required()), + ]); + } +} diff --git a/src/Content/ImageHotspot/ImageHotspotEntity.php b/src/Content/ImageHotspot/ImageHotspotEntity.php new file mode 100644 index 0000000..0ff3551 --- /dev/null +++ b/src/Content/ImageHotspot/ImageHotspotEntity.php @@ -0,0 +1,194 @@ +mapId; + } + + public function setMapId(string $mapId): void + { + $this->mapId = $mapId; + } + + public function getMap(): ?ImageHotspotMapEntity + { + return $this->map; + } + + public function setMap(ImageHotspotMapEntity $map): void + { + $this->map = $map; + } + + public function getTop(): float + { + return $this->top; + } + + public function setTop(float $top): void + { + $this->top = $top; + } + + public function getLeft(): float + { + return $this->left; + } + + public function setLeft(float $left): void + { + $this->left = $left; + } + + public function getDescription(): ?string + { + return $this->description; + } + + public function setDescription(string $description): void + { + $this->description = $description; + } + + public function getProductId(): ?string + { + return $this->productId; + } + + public function setProductId(string $productId): void + { + $this->productId = $productId; + } + + public function getSalesChannelProduct(): ?SalesChannelProductEntity + { + return $this->salesChannelProduct; + } + + public function setSalesChannelProduct(SalesChannelProductEntity $salesChannelProduct): void + { + $this->salesChannelProduct = $salesChannelProduct; + } + + public function getTranslations(): ?ImageHotspotTranslationCollection + { + return $this->translations; + } + + public function setTranslations(ImageHotspotTranslationCollection $translations): void + { + $this->translations = $translations; + } + + public function getLink(): ?string + { + return $this->link; + } + + public function setLink(string $link): void + { + $this->link = $link; + } + + public function getOpenNewTab(): ?bool + { + return $this->openNewTab; + } + + public function setOpenNewTab(bool $openNewTab): void + { + $this->openNewTab = $openNewTab; + } + + public function getTitle(): ?string + { + return $this->title; + } + + public function setTitle(string $title): void + { + $this->title = $title; + } + + public function getMediaId(): ?string + { + return $this->mediaId; + } + + public function setMediaId(?string $mediaId): void + { + $this->mediaId = $mediaId; + } +} diff --git a/src/Content/ImageHotspot/ImageHotspotTranslation/ImageHotspotTranslationCollection.php b/src/Content/ImageHotspot/ImageHotspotTranslation/ImageHotspotTranslationCollection.php new file mode 100644 index 0000000..c7fa457 --- /dev/null +++ b/src/Content/ImageHotspot/ImageHotspotTranslation/ImageHotspotTranslationCollection.php @@ -0,0 +1,27 @@ + true, + ]; + } + + protected function getParentDefinitionClass(): string + { + return ImageHotspotDefinition::class; + } + + protected function defineFields(): FieldCollection + { + return new FieldCollection([ + (new LongTextField('description', 'description'))->addFlags(new AllowHtml()), + (new StringField('title', 'title'))->addFlags(new AllowHtml()), + new StringField('link', 'link'), + new BoolField('open_new_tab', 'openNewTab'), + + new CustomFields(), + ]); + } +} diff --git a/src/Content/ImageHotspot/ImageHotspotTranslation/ImageHotspotTranslationEntity.php b/src/Content/ImageHotspot/ImageHotspotTranslation/ImageHotspotTranslationEntity.php new file mode 100644 index 0000000..c8adfb2 --- /dev/null +++ b/src/Content/ImageHotspot/ImageHotspotTranslation/ImageHotspotTranslationEntity.php @@ -0,0 +1,99 @@ +hotspotId; + } + + public function setHotspotId(string $hotspotId): void + { + $this->hotspotId = $hotspotId; + } + + public function getHotspot(): ?ImageHotspotEntity + { + return $this->hotspot; + } + + public function setHotspot(ImageHotspotEntity $hotspot): void + { + $this->hotspot = $hotspot; + } + + public function getDescription(): string + { + return $this->description; + } + + public function setDescription(string $description): void + { + $this->description = $description; + } + + public function getLink(): ?string + { + return $this->link; + } + + public function setLink(string $link): void + { + $this->link = $link; + } + + public function getOpenNewTab(): ?bool + { + return $this->openNewTab; + } + + public function setOpenNewTab(bool $openNewTab): void + { + $this->openNewTab = $openNewTab; + } + + public function getTitle(): ?string + { + return $this->title; + } + + public function setTitle(string $title): void + { + $this->title = $title; + } +} diff --git a/src/Content/ImageHotspotMap/ImageHotspotMapCollection.php b/src/Content/ImageHotspotMap/ImageHotspotMapCollection.php new file mode 100644 index 0000000..01359ad --- /dev/null +++ b/src/Content/ImageHotspotMap/ImageHotspotMapCollection.php @@ -0,0 +1,27 @@ +setFlags(new PrimaryKey(), new Required()), + + (new FkField('media_id', 'mediaId', MediaDefinition::class))->addFlags(new Required()), + (new TranslatedField('title'))->addFlags(new AllowHtml()), + new OneToOneAssociationField('media', 'media_id', 'id', MediaDefinition::class, false), + (new OneToManyAssociationField('hotspots', ImageHotspotDefinition::class, 'map_id'))->addFlags(new CascadeDelete()), + + new TranslatedField('customFields'), + new TranslationsAssociationField(ImageHotspotMapTranslationDefinition::class, 'sas_image_hotspot_map_id'), + ]); + } +} diff --git a/src/Content/ImageHotspotMap/ImageHotspotMapEntity.php b/src/Content/ImageHotspotMap/ImageHotspotMapEntity.php new file mode 100644 index 0000000..afa1a6a --- /dev/null +++ b/src/Content/ImageHotspotMap/ImageHotspotMapEntity.php @@ -0,0 +1,89 @@ +mediaId; + } + + public function setMediaId(string $mediaId): void + { + $this->mediaId = $mediaId; + } + + public function getHotspots(): ?ImageHotspotCollection + { + return $this->hotspots; + } + + public function setImageHotspots(ImageHotspotCollection $hotspots): void + { + $this->hotspots = $hotspots; + } + + public function getMedia(): ?MediaEntity + { + return $this->media; + } + + public function setMedia(MediaEntity $media): void + { + $this->media = $media; + } + + public function getTitle(): ?string + { + return $this->title; + } + + public function setTitle(string $title): void + { + $this->title = $title; + } + + public function getTranslations(): ?ImageHotspotMapTranslationCollection + { + return $this->translations; + } + + public function setTranslations(ImageHotspotMapTranslationCollection $translations): void + { + $this->translations = $translations; + } +} diff --git a/src/Content/ImageHotspotMap/ImageHotspotMapTranslation/ImageHotspotMapTranslationCollection.php b/src/Content/ImageHotspotMap/ImageHotspotMapTranslation/ImageHotspotMapTranslationCollection.php new file mode 100644 index 0000000..6bd4bd7 --- /dev/null +++ b/src/Content/ImageHotspotMap/ImageHotspotMapTranslation/ImageHotspotMapTranslationCollection.php @@ -0,0 +1,27 @@ +addFlags(new AllowHtml()), + new CustomFields(), + ]); + } +} diff --git a/src/Content/ImageHotspotMap/ImageHotspotMapTranslation/ImageHotspotMapTranslationEntity.php b/src/Content/ImageHotspotMap/ImageHotspotMapTranslation/ImageHotspotMapTranslationEntity.php new file mode 100644 index 0000000..5dc120c --- /dev/null +++ b/src/Content/ImageHotspotMap/ImageHotspotMapTranslation/ImageHotspotMapTranslationEntity.php @@ -0,0 +1,65 @@ +mapId; + } + + public function setMapId(string $mapId): void + { + $this->mapId = $mapId; + } + + public function getMap(): ?ImageHotspotMapEntity + { + return $this->map; + } + + public function setMap(ImageHotspotMapEntity $map): void + { + $this->map = $map; + } + + public function getTitle(): string + { + return $this->title; + } + + public function setTitle(string $title): void + { + $this->title = $title; + } +} diff --git a/src/Migration/Migration1606761373CreateSasImageHotspot.php b/src/Migration/Migration1606761373CreateSasImageHotspot.php new file mode 100644 index 0000000..4bd522d --- /dev/null +++ b/src/Migration/Migration1606761373CreateSasImageHotspot.php @@ -0,0 +1,89 @@ +executeUpdate(' + CREATE TABLE IF NOT EXISTS `sas_image_hotspot_map` ( + `id` BINARY(16) NOT NULL, + `media_id` BINARY(16) NOT NULL, + `created_at` DATETIME(3) NOT NULL, + `updated_at` DATETIME(3) NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk.sas_image_hotspot_map.media_id` FOREIGN KEY (`media_id`) REFERENCES `media` (`id`) ON DELETE CASCADE ON UPDATE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + '); + + $connection->executeUpdate(' + CREATE TABLE IF NOT EXISTS `sas_image_hotspot_map_translation` ( + `sas_image_hotspot_map_id` BINARY(16) NOT NULL, + `language_id` BINARY(16) NOT NULL, + `title` VARCHAR(255) NULL, + `custom_fields` JSON NULL, + `created_at` DATETIME(3) NOT NULL, + `updated_at` DATETIME(3) NULL, + PRIMARY KEY (`sas_image_hotspot_map_id`, `language_id`), + CONSTRAINT `json.sas_image_hotspot_map_translation.custom_fields` CHECK (JSON_VALID(`custom_fields`)), + CONSTRAINT `fk.sas_image_hotspot_map_translation.language_id` FOREIGN KEY (`language_id`) + REFERENCES `language` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `fk.sas_image_hotspot_map_translation.sas_image_hotspot_map_id` FOREIGN KEY (`sas_image_hotspot_map_id`) + REFERENCES `sas_image_hotspot_map` (`id`) ON DELETE CASCADE ON UPDATE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + '); + + $connection->executeUpdate(' + CREATE TABLE IF NOT EXISTS `sas_image_hotspot` ( + `id` BINARY(16) NOT NULL, + `map_id` BINARY(16) NOT NULL, + `product_id` BINARY(16) NULL, + `media_id` BINARY(16) NULL, + `top` FLOAT NOT NULL, + `left` FLOAT NOT NULL, + `created_at` DATETIME(3) NOT NULL, + `updated_at` DATETIME(3) NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk.sas_image_hotspot.product_id` FOREIGN KEY (`product_id`) + REFERENCES `product` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `fk.sas_image_hotspot.media_id` FOREIGN KEY (`media_id`) + REFERENCES `media` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `fk.sas_image_hotspot.map_id` FOREIGN KEY (`map_id`) REFERENCES `sas_image_hotspot_map` (`id`) ON DELETE CASCADE ON UPDATE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + '); + + $connection->executeUpdate(' + CREATE TABLE IF NOT EXISTS `sas_image_hotspot_translation` ( + `sas_image_hotspot_id` BINARY(16) NOT NULL, + `language_id` BINARY(16) NOT NULL, + `title` VARCHAR(255) NULL, + `description` LONGTEXT NULL, + `link` LONGTEXT NULL, + `open_new_tab` TINYINT(1) NOT NULL DEFAULT 1, + `custom_fields` JSON NULL, + `created_at` DATETIME(3) NOT NULL, + `updated_at` DATETIME(3) NULL, + PRIMARY KEY (`sas_image_hotspot_id`, `language_id`), + CONSTRAINT `json.sas_image_hotspot_translation.custom_fields` CHECK (JSON_VALID(`custom_fields`)), + CONSTRAINT `fk.sas_image_hotspot_translation.language_id` FOREIGN KEY (`language_id`) + REFERENCES `language` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `fk.sas_image_hotspot_translation.sas_image_hotspot_id` FOREIGN KEY (`sas_image_hotspot_id`) + REFERENCES `sas_image_hotspot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + '); + } + + public function updateDestructive(Connection $connection): void + { + // implement update destructive + } +} diff --git a/src/Resources/app/administration/.gitignore b/src/Resources/app/administration/.gitignore new file mode 100644 index 0000000..a4dfb30 --- /dev/null +++ b/src/Resources/app/administration/.gitignore @@ -0,0 +1,2 @@ +## node_modules +node_modules diff --git a/src/Resources/app/administration/package-lock.json b/src/Resources/app/administration/package-lock.json new file mode 100644 index 0000000..1b4c1ba --- /dev/null +++ b/src/Resources/app/administration/package-lock.json @@ -0,0 +1,18 @@ +{ + "name": "Resources2", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "jquery": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", + "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==" + }, + "jquery-ui": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/jquery-ui/-/jquery-ui-1.12.1.tgz", + "integrity": "sha1-vLQEXI3QU5wTS8FIjN0+dop6nlE=" + } + } +} diff --git a/src/Resources/app/administration/package.json b/src/Resources/app/administration/package.json new file mode 100644 index 0000000..03c99d4 --- /dev/null +++ b/src/Resources/app/administration/package.json @@ -0,0 +1,10 @@ +{ + "name": "Resources", + "version": "1.0.1", + "main": "index.js", + "license": "MIT", + "dependencies": { + "jquery": "^3.5.1", + "jquery-ui": "^1.12.1" + } +} diff --git a/src/Resources/app/administration/src/component/sas-image-hotspot-map/index.js b/src/Resources/app/administration/src/component/sas-image-hotspot-map/index.js new file mode 100644 index 0000000..28ff6bf --- /dev/null +++ b/src/Resources/app/administration/src/component/sas-image-hotspot-map/index.js @@ -0,0 +1,128 @@ +import './sas-image-hotspot-map.scss'; +import template from './sas-image-hotspot-map.html.twig'; +import $ from 'jquery'; +const utils = Shopware.Utils; + +const { Component } = Shopware; + +Component.register('sas-image-hotspot-map', { + template, + + props: { + map: { + required: true, + type: Object + } + }, + + inject: ['repositoryFactory'], + + computed: { + hotspotRepository() { + return this.repositoryFactory.create('sas_image_hotspot'); + }, + + mediaRepository() { + return this.repositoryFactory.create('media'); + }, + + mapRepository() { + return this.repositoryFactory.create('sas_image_hotspot_map'); + }, + + uploadTag() { + return `sas-image-hotspot-media`; + }, + }, + + data() { + return { + wrapper: null, + el: null, + isLoading: false, + selectedPin: null, + showHotspotModal: false, + } + }, + + mounted() { + this.wrapper = this.$refs.pinMapImageWrapper; + this.el = this.$refs.pinMapImage; + }, + + methods: { + onDeleteDot() { + const id = this.selectedPin.id; + this.showHotspotModal = false; + this.selectedPin = null; + + this.map.hotspots.remove(id); + }, + + onSaveDot() { + this.$emit('on-save-dot', this.map.hotspots.get(this.selectedPin.id)); + + this.selectedPin = null; + this.showHotspotModal = false; + }, + + onDotClick(pin) { + this.selectedPin = pin; + this.showHotspotModal = true; + }, + + onImageClick(e) { + const topOffset = this.el.getBoundingClientRect().top - $(window).scrollTop(); + const leftOffset = this.el.getBoundingClientRect().left - $(window).scrollLeft(); + + const topPx = Math.round( (e.clientY - topOffset - 6) ); + const leftPx = Math.round( (e.clientX - leftOffset - 6) ); + + const top = topPx / this.el.clientHeight * 100; + const left = leftPx / this.el.clientWidth * 100; + + const dotId = utils.createId(); + + const pin = this.hotspotRepository.create(Shopware.Context.api); + pin.top = top; + pin.left = left; + pin.id = dotId; + pin.mapId = this.map.id; + pin.mediaId = null; + pin.productId = null; + + this.map.hotspots.add(pin); + + this.selectedPin = pin; + this.showHotspotModal = true; + }, + + onDraggingEnd(e) { + let pin = this.map.hotspots.get(e.id); + + pin.left = parseInt(e.left) / this.wrapper.clientWidth * 100; + pin.top = parseInt(e.top) / this.wrapper.clientHeight * 100; + }, + + onPinModalClosed() { + this.showHotspotModal = false; + }, + + onSetHotspotMedia([mediaItem]) { + this.selectedPin.mediaId = mediaItem.id; + this.selectedPin.media = mediaItem; + }, + + successfulUpload(media) { + this.mediaRepository.get(media.targetId, Shopware.Context.api).then((mediaItem) => { + this.selectedPin.mediaId = media.targetId; + this.selectedPin.media = mediaItem; + }); + }, + + removeMedia() { + this.selectedPin.mediaId = null; + this.selectedPin.media = null; + } + } +}); diff --git a/src/Resources/app/administration/src/component/sas-image-hotspot-map/sas-image-hotspot-map.html.twig b/src/Resources/app/administration/src/component/sas-image-hotspot-map/sas-image-hotspot-map.html.twig new file mode 100644 index 0000000..adeed7e --- /dev/null +++ b/src/Resources/app/administration/src/component/sas-image-hotspot-map/sas-image-hotspot-map.html.twig @@ -0,0 +1,89 @@ +{% block sas_image_hotspot_map_wrapper %} + + {% block sas_image_hotspot_map_input_fields %} + + + + + {% block sas_image_hotspot_map_title_field %} + + {% endblock %} + + + + {% block sas_image_hotspot_map_image_field %} + + + + + {% endblock %} + + + + + + + {% block sas_image_hotspot_map_link_field %} + + {% endblock %} + + + + {% block sas_image_hotspot_map_open_new_tab_field %} + + {% endblock %} + + + + + + {% block sas_image_hotspot_map_description_field %} + + {% endblock %} + + + + + {% endblock %} + + {% block sas_image_hotspot_map_image %} +
+
+ + +
+
+ {% endblock %} +
+{% endblock %} diff --git a/src/Resources/app/administration/src/component/sas-image-hotspot-map/sas-image-hotspot-map.scss b/src/Resources/app/administration/src/component/sas-image-hotspot-map/sas-image-hotspot-map.scss new file mode 100644 index 0000000..0304988 --- /dev/null +++ b/src/Resources/app/administration/src/component/sas-image-hotspot-map/sas-image-hotspot-map.scss @@ -0,0 +1,116 @@ +.sas-image-hotspot-map-fields { + margin-bottom: 30px; + + .sas-image-hotspot-map-field-actions { + place-self: end; + margin-bottom: 10px; + } + + place-items: end stretch; +} + +.sas-image-hotspot-map-wrapper { + position: relative; + display: inline-block; + + img { + max-width: 100%; + } + + .hotspot-grid-card.sw-card { + .sw-card__content { + padding: 0; + } + } + + .dot { + position: absolute; + width: 12px; + height: 12px; + background: rgba(red, 1); + border-radius: 50%; + cursor: pointer; + box-shadow: 0 0 3px 0 rgba(0, 0, 0, .2); + line-height: 13px; + font-size: 10px; + font-weight: bold; + transition: box-shadow .214s ease-in-out, transform .214s ease-in-out, background .214s ease-in-out; + text-align: center; + + &:before, &:after { + content: ''; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border-radius: 50%; + pointer-events: none; + } + + &.is-active:before { + z-index: 3; + opacity: 1; + transform: scale(1.5); + border-color: red; + } + + &:hover:before { + opacity: 1; + transform: scale(1.4); + animation: borderColor 2s linear infinite; + } + + &:hover:after { + display:none; + } + + &:before { + z-index: 1; + border: 0.15em solid rgba(255, 255, 255, 0.9); + opacity: 0; + transform: scale(2); + transition: transform .25s, opacity .2s; + left: calc(50% - 6px); + top: calc(50% - 6px); + box-sizing: border-box; + } + + &:after { + z-index: 2; + border: 2px solid #fff; + animation: wave 2s infinite; + left: calc(-50% + 4px); + top: calc(-50% + 4px); + } + + &.ui-draggable-dragging { + box-shadow: 0 0 25px 0 rgba(0, 0, 0, .5); + transform: scale3d(1.4, 1.4, 1.4); + background: rgba(red, .7); + } + } +} + +@keyframes wave{ + 0% { + opacity: 1; + transform: scale(1); + } + 100% { + opacity: 0; + transform: scale(2); + } +} + +@keyframes borderColor{ + 0% { + border-color: #fff; + } + 50% { + border-color: red; + } + 100% { + border-color: #fff; + } +} diff --git a/src/Resources/app/administration/src/component/sas-image-hotspot-modal/index.js b/src/Resources/app/administration/src/component/sas-image-hotspot-modal/index.js new file mode 100644 index 0000000..cc34dfc --- /dev/null +++ b/src/Resources/app/administration/src/component/sas-image-hotspot-modal/index.js @@ -0,0 +1,83 @@ +import template from './sas-image-hotspot-modal.html.twig'; + +const { Component } = Shopware; +const { Criteria } = Shopware.Data; + +Component.register('sas-image-hotspot-modal', { + inject: ['repositoryFactory'], + + template, + + props: { + media: { + type: Object, + required: true + } + }, + + data() { + return { + showHotspotModal: false, + isLoading: false, + isSaving: false, + map: null, + } + }, + + computed: { + hotspotRepository() { + return this.repositoryFactory.create('sas_image_hotspot'); + }, + mapRepository() { + return this.repositoryFactory.create('sas_image_hotspot_map'); + }, + }, + + async created() { + await this.onCreatedComponent(); + }, + + methods: { + async onCreatedComponent() { + this.showHotspotModal = true; + await this.fetchMap(); + }, + + async fetchMap() { + this.isLoading = true; + const criteria = new Criteria(); + criteria.addFilter(Criteria.equals('mediaId', this.media.id)); + criteria.setLimit(1); + criteria.addAssociation('media'); + criteria.addAssociation('hotspots.media'); + criteria.addAssociation('hotspots.product'); + + const maps = await this.mapRepository.search(criteria, Shopware.Context.api); + if (!maps || maps.length === 0) { + this.map = this.mapRepository.create(Shopware.Context.api); + this.map.mediaId = this.media.id; + this.map.media = this.media; + } else { + this.map = maps.first(); + } + + this.isLoading = false; + }, + + async onClickSave() { + this.isSaving = true; + + await this.mapRepository.save(this.map, Shopware.Context.api); + + this.isSaving = false; + this.showHotspotModal = false; + this.$emit('on-close-hotspot-modal'); + }, + + onCloseHotspotModal() { + this.map = null; + this.showHotspotModal = false; + this.$emit('on-close-hotspot-modal'); + } + } +}); diff --git a/src/Resources/app/administration/src/component/sas-image-hotspot-modal/sas-image-hotspot-modal.html.twig b/src/Resources/app/administration/src/component/sas-image-hotspot-modal/sas-image-hotspot-modal.html.twig new file mode 100644 index 0000000..6a9b7b7 --- /dev/null +++ b/src/Resources/app/administration/src/component/sas-image-hotspot-modal/sas-image-hotspot-modal.html.twig @@ -0,0 +1,22 @@ +{% block sas_image_hot_spot_modal_inner %} + + + + + + +{% endblock %} diff --git a/src/Resources/app/administration/src/component/sas-image-hotspot/index.js b/src/Resources/app/administration/src/component/sas-image-hotspot/index.js new file mode 100644 index 0000000..59833bd --- /dev/null +++ b/src/Resources/app/administration/src/component/sas-image-hotspot/index.js @@ -0,0 +1,52 @@ +import './sas-image-hotspot.scss'; +import template from './sas-image-hotspot.html.twig'; + +const { Component } = Shopware; +import $ from 'jquery'; +import 'jquery-ui/ui/widgets/draggable'; + +Component.register('sas-image-hotspot', { + template, + + props: { + hotspot: { + required: true, + type: Object, + }, + isActive: { + type: Boolean, + default: false + } + }, + + inject: ['repositoryFactory'], + + data() { + return { + styleObject: {top: this.hotspot.top + '%', left: this.hotspot.left + '%', position: 'absolute'} + } + }, + + mounted() { + $(this.$refs['pin_' + this.hotspot.id]).draggable({ + containment: ".sas-image-hotspot-map-wrapper", + stop: (e) => this.onDraggingEnd(e) + }); + }, + + methods: { + onDotClick() { + this.$emit('on-dot-click', this.hotspot); + }, + + onDraggingEnd(e) { + const targetStyle = e.target.style; + + this.$emit('on-dragging-end', { + top: targetStyle.top, + left: targetStyle.left, + id: this.hotspot.id + }); + } + } +}); diff --git a/src/Resources/app/administration/src/component/sas-image-hotspot/sas-image-hotspot.html.twig b/src/Resources/app/administration/src/component/sas-image-hotspot/sas-image-hotspot.html.twig new file mode 100644 index 0000000..801718d --- /dev/null +++ b/src/Resources/app/administration/src/component/sas-image-hotspot/sas-image-hotspot.html.twig @@ -0,0 +1,11 @@ +{% block sas_image_hotspot_wrapper %} +
+
+ +
+

{{ hotspot.translated.title }}

+
+
+
+
+{% endblock %} diff --git a/src/Resources/app/administration/src/component/sas-image-hotspot/sas-image-hotspot.scss b/src/Resources/app/administration/src/component/sas-image-hotspot/sas-image-hotspot.scss new file mode 100644 index 0000000..5956dd6 --- /dev/null +++ b/src/Resources/app/administration/src/component/sas-image-hotspot/sas-image-hotspot.scss @@ -0,0 +1,75 @@ +.sas-image-hotspot:hover .sas-image-hotspot__desc { + display: block; +} + +.sas-image-hotspot__desc { + background: #fff; + padding: 20px; + width: 300px; + max-width: calc(100vw - 20px); + display: none; + border-radius: 5px; + position: absolute; + border: 1px solid #ccc; + z-index: 3; + top: -15px; + left: 50%; + opacity: 1; + transform-origin: bottom center; + transform: translateY(calc(-100% - 20px)) translateX(-50%); + transition: 0.4s all ease; +} + +.sas-image-hotspot:hover .sas-image-hotspot__desc { + z-index: 4; + opacity: 1; + display: block; + transform: translateY(-100%) translateX(-50%); +} + +.sas-image-hotspot__desc:after { + content: ""; + display: inline-block; + height: 20px; + width: 20px; + position: absolute; + bottom: -10px; + left: 50%; + transform: translateX(-50%) rotate(45deg); + background: #fff; + border-left: 0; + border-top: 0; +} + +.sas-image-hotspot__desc-image { + max-width: 100%; + height: auto; + margin-bottom: 12px; + max-height: 250px; +} + +.sas-image-hotspot__desc-text h4, +.sas-image-hotspot__desc-text .sas-image-hotspot__desc-p { + color: #000; +} + +.sas-image-hotspot__desc-text h4 { + font-size: 18px; + font-weight: 600; + line-height: 1; +} + +.sas-image-hotspot__desc-text .sas-image-hotspot__desc-p { + font-size: 16px; + line-height: 1.2; + font-weight: normal; + display: inline-block; + + ul { + margin-block-start: 0; + margin-block-end: 0; + margin-inline-start: 0; + margin-inline-end: 0; + padding-inline-start: 0; + } +} diff --git a/src/Resources/app/administration/src/extension/component/media/sw-media-library/index.js b/src/Resources/app/administration/src/extension/component/media/sw-media-library/index.js new file mode 100644 index 0000000..dd2cfc5 --- /dev/null +++ b/src/Resources/app/administration/src/extension/component/media/sw-media-library/index.js @@ -0,0 +1,38 @@ +const { Component, Context } = Shopware; +const { Criteria } = Shopware.Data; + +Component.override('sw-media-library', { + methods: { + async loadItems() { + this.isLoading = true; + await this.nextFolders(); + + if (this.folderLoaderDone) { + this.pageItem += 1; + + const criteria = new Criteria(this.pageItem, this.limit); + criteria + .addFilter(Criteria.equals('mediaFolderId', this.folderId)) + .addAssociation('tags') + .addAssociation('productMedia.product') + .addAssociation('categories') + .addAssociation('productManufacturers.products') + .addAssociation('mailTemplateMedia.mailTemplate') + .addAssociation('documentBaseConfigs') + .addAssociation('avatarUser') + .addAssociation('paymentMethods') + .addAssociation('shippingMethods') + .addAssociation('hotspotMap') + .addSorting(Criteria.sort(this.sorting.sortBy, this.sorting.sortDirection)) + .setTerm(this.term); + + const items = await this.mediaRepository.search(criteria, Context.api); + + this.items.push(...items); + this.itemLoaderDone = this.isLoaderDone(criteria, items); + } + + this.isLoading = false; + }, + } +}); diff --git a/src/Resources/app/administration/src/extension/component/media/sw-media-media-item/index.js b/src/Resources/app/administration/src/extension/component/media/sw-media-media-item/index.js new file mode 100644 index 0000000..406e4b6 --- /dev/null +++ b/src/Resources/app/administration/src/extension/component/media/sw-media-media-item/index.js @@ -0,0 +1,21 @@ +import template from './sw-media-media-item.html.twig'; +const { Component } = Shopware; + +Component.override('sw-media-media-item', { + template, + + data() { + return { + showHotspotModal: false + } + }, + + methods: { + onShowHotspotModal() { + this.showHotspotModal = true; + }, + onCloseHotspotModal() { + this.showHotspotModal = false; + } + } +}); diff --git a/src/Resources/app/administration/src/extension/component/media/sw-media-media-item/sw-media-media-item.html.twig b/src/Resources/app/administration/src/extension/component/media/sw-media-media-item/sw-media-media-item.html.twig new file mode 100644 index 0000000..adbf339 --- /dev/null +++ b/src/Resources/app/administration/src/extension/component/media/sw-media-media-item/sw-media-media-item.html.twig @@ -0,0 +1,19 @@ +{% block sw_media_media_item_context_item_rename_item %} + + {{ $tc('sas-image-hotspot-map.general.setHotspot') }} + + + {% parent %} +{% endblock %} + + +{% block sw_media_media_item_move_modal %} + + + {% parent %} +{% endblock %} diff --git a/src/Resources/app/administration/src/extension/component/media/sw-media-preview-v2/index.js b/src/Resources/app/administration/src/extension/component/media/sw-media-preview-v2/index.js new file mode 100644 index 0000000..e9b1fc2 --- /dev/null +++ b/src/Resources/app/administration/src/extension/component/media/sw-media-preview-v2/index.js @@ -0,0 +1,44 @@ +import template from './sw-media-preview-v2.html.twig'; +import './sw-media-preview-v2.scss'; +const { Criteria } = Shopware.Data; + +Shopware.Component.override('sw-media-preview-v2', { + template, + + data() { + return { + showHotspotModal: false + } + }, + + computed: { + mediaCriteria() { + const criteria = new Criteria; + criteria.addAssociation('hotspotMap'); + + return criteria; + } + }, + + methods: { + async fetchSourceIfNecessary() { + if (!this.source) { + return; + } + + if (typeof this.source === 'string') { + this.trueSource = await this.mediaRepository.get(this.source, Shopware.Context.api, this.mediaCriteria); + } else { + this.trueSource = this.source; + } + }, + + onShowHotspotModal() { + this.showHotspotModal = true; + }, + + onCloseHotspotModal() { + this.showHotspotModal = false; + } + } +}); diff --git a/src/Resources/app/administration/src/extension/component/media/sw-media-preview-v2/sw-media-preview-v2.html.twig b/src/Resources/app/administration/src/extension/component/media/sw-media-preview-v2/sw-media-preview-v2.html.twig new file mode 100644 index 0000000..ddc08d4 --- /dev/null +++ b/src/Resources/app/administration/src/extension/component/media/sw-media-preview-v2/sw-media-preview-v2.html.twig @@ -0,0 +1,17 @@ +{% block sw_media_preview_v2_file_type_image %} + {% parent %} + + {% block sas_image_hot_spot_dot %} +
+
+
+ {% endblock %} + + {% block sas_image_hot_spot_modal %} + + {% endblock %} + +{% endblock %} diff --git a/src/Resources/app/administration/src/extension/component/media/sw-media-preview-v2/sw-media-preview-v2.scss b/src/Resources/app/administration/src/extension/component/media/sw-media-preview-v2/sw-media-preview-v2.scss new file mode 100644 index 0000000..a878a3b --- /dev/null +++ b/src/Resources/app/administration/src/extension/component/media/sw-media-preview-v2/sw-media-preview-v2.scss @@ -0,0 +1,101 @@ +@import "~scss/variables"; + +.sw-data-grid__cell-content, .sw-media-upload-v2__preview { + .sas-hotspot-map-wrapper { + display: none!important; + } +} + +.sw-media-preview-v2 { + .sas-hotspot-map-wrapper { + position: absolute; + bottom: 17px!important; + left: 3px!important; + + .dot { + position: absolute; + z-index: 99; + width: 12px; + height: 12px; + background: rgba($color-crimson-500, 1); + border-radius: 50%; + cursor: pointer; + box-shadow: 0 0 3px 0 rgba(0, 0, 0, .2); + line-height: 13px; + font-size: 10px; + font-weight: bold; + transition: box-shadow .214s ease-in-out, transform .214s ease-in-out, background .214s ease-in-out; + text-align: center; + + &:before, &:after { + content: ''; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border-radius: 50%; + pointer-events: none; + } + + &.is-active:before { + z-index: 3; + opacity: 1; + transform: scale(1.5); + border-color: $color-crimson-500; + } + + &:hover:before { + opacity: 1; + transform: scale(1.4); + border-color: $color-crimson-500; + //animation: borderColor 2s linear infinite; + } + + &:hover:after { + display:none; + } + + &:before { + z-index: 1; + border: 0.15em solid rgba(255, 255, 255, 0.9); + opacity: 0; + transform: scale(2); + transition: transform .25s, opacity .2s; + left: calc(50% - 6px); + top: calc(50% - 6px); + box-sizing: border-box; + } + + &:after { + z-index: 2; + border: 2px solid $color-crimson-500; + animation: wave 2s infinite; + left: calc(-50% + 4px); + top: calc(-50% + 4px); + } } + } +} + +@keyframes wave{ + 0% { + opacity: 1; + transform: scale(1); + } + 100% { + opacity: 0; + transform: scale(1.3); + } +} + +@keyframes borderColor{ + 0% { + border-color: #fff; + } + 50% { + border-color: red; + } + 100% { + border-color: #fff; + } +} diff --git a/src/Resources/app/administration/src/extension/component/product/sw-product-image/index.js b/src/Resources/app/administration/src/extension/component/product/sw-product-image/index.js new file mode 100644 index 0000000..042225c --- /dev/null +++ b/src/Resources/app/administration/src/extension/component/product/sw-product-image/index.js @@ -0,0 +1,51 @@ +import template from './sw-product-image.html.twig'; +const { Criteria } = Shopware.Data; + +Shopware.Component.override('sw-product-image', { + template, + + inject: ['repositoryFactory'], + + computed: { + mediaCriteria() { + const criteria = new Criteria; + criteria.addAssociation('hotspotMap'); + + return criteria; + }, + + mediaRepository() { + return this.repositoryFactory.create('media'); + }, + }, + + data() { + return { + media: null, + showHotspotModal: false + } + }, + + async created() { + await this.createdComponent(); + }, + + methods: { + async createdComponent() { + if (!this.mediaId.match(/^[0-9a-f]{32}$/)) { + return; + } + + this.media = await this.mediaRepository.get(this.mediaId, Shopware.Context.api, this.mediaCriteria); + }, + + onShowHotspotModal() { + this.showHotspotModal = true; + }, + + onCloseHotspotModal() { + this.media = null; + this.showHotspotModal = false; + } + } +}); diff --git a/src/Resources/app/administration/src/extension/component/product/sw-product-image/sw-product-image.html.twig b/src/Resources/app/administration/src/extension/component/product/sw-product-image/sw-product-image.html.twig new file mode 100644 index 0000000..5445490 --- /dev/null +++ b/src/Resources/app/administration/src/extension/component/product/sw-product-image/sw-product-image.html.twig @@ -0,0 +1,43 @@ +{% block sw_product_image_preview %} + + + + + + {{ $tc('sw-product.mediaForm.coverSubline') }} + +{% endblock %} + +{% block sw_product_image_context %} + {% block sw_product_image_context_set_hotspot %} + + {{ $tc('sas-image-hotspot-map.general.setHotspot') }} + + + {% parent %} + + {% endblock %} +{% endblock %} + +{% block sw_product_image_preview %} + {% parent %} + {% block sw_product_image_hotspot_modal %} + + {% endblock %} +{% endblock %} diff --git a/src/Resources/app/administration/src/main.js b/src/Resources/app/administration/src/main.js new file mode 100644 index 0000000..4a5d6c8 --- /dev/null +++ b/src/Resources/app/administration/src/main.js @@ -0,0 +1,8 @@ +import './component/sas-image-hotspot'; +import './component/sas-image-hotspot-map'; +import './component/sas-image-hotspot-modal'; +import './module/index'; +import './extension/component/media/sw-media-preview-v2'; +import './extension/component/media/sw-media-library'; +import './extension/component/media/sw-media-media-item'; +import './extension/component/product/sw-product-image'; diff --git a/src/Resources/app/administration/src/module/index.js b/src/Resources/app/administration/src/module/index.js new file mode 100644 index 0000000..a67893f --- /dev/null +++ b/src/Resources/app/administration/src/module/index.js @@ -0,0 +1,8 @@ +Shopware.Module.register('sas-image-hotspot', { + type: 'plugin', + name: 'sas-image-hotspot', + title: 'sas-image-hotspot-map.general.title', + description: 'sas-image-hotspot-map.general.description', + color: '#62ff80', + icon: 'default-shopping-paper-bag', +}); diff --git a/src/Resources/app/administration/src/module/snippet/de-DE.json b/src/Resources/app/administration/src/module/snippet/de-DE.json new file mode 100644 index 0000000..f04c7f9 --- /dev/null +++ b/src/Resources/app/administration/src/module/snippet/de-DE.json @@ -0,0 +1,18 @@ +{ + "sas-image-hotspot-map": { + "general": { + "title": "Bild-Hotspot-Karte", + "description": "Beschreibung", + "setHotspot": "Stellen Sie den Image-Hotspot ein" + }, + "fields": { + "title": "Titel", + "image": "Bild", + "link": "Verknüpfung", + "openNewTab": "Link in neuem Tab öffnen", + "modalTitle": "Hotspot-Detail", + "description": "Beschreibung", + "product": "Kartiertes Produkt" + } + } +} diff --git a/src/Resources/app/administration/src/module/snippet/en-GB.json b/src/Resources/app/administration/src/module/snippet/en-GB.json new file mode 100644 index 0000000..83dd6f6 --- /dev/null +++ b/src/Resources/app/administration/src/module/snippet/en-GB.json @@ -0,0 +1,18 @@ +{ + "sas-image-hotspot-map": { + "general": { + "title": "Image hotspot map", + "description": "Description", + "setHotspot": "Set Image Hotspot" + }, + "fields": { + "title": "Title", + "image": "Image", + "link": "Link", + "openNewTab": "Open link in new tab", + "modalTitle": "Hotspot detail", + "description": "Description", + "product": "Mapped product" + } + } +} diff --git a/src/Resources/app/storefront/dist/storefront/js/sas-image-hotspot.js b/src/Resources/app/storefront/dist/storefront/js/sas-image-hotspot.js new file mode 100644 index 0000000..cda261f --- /dev/null +++ b/src/Resources/app/storefront/dist/storefront/js/sas-image-hotspot.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([["sas-image-hotspot"],{"6KYj":function(e,t,o){"use strict";(function(e){o.d(t,"a",(function(){return l}));var n=o("FGIj"),i=o("gHbT");function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var o=0;ot.y?0:1:t.x/t.y>e.x/e.y?1:0}},{key:"_assertEqualFactors",value:function(e,t){var o=this._roundToTwoDigits(e.x/e.y);return this._roundToTwoDigits(t.x/t.y)===o}},{key:"_getContainerPos",value:function(e){var t=e.getBoundingClientRect();return new r.a(t.left+window.pageXOffset,t.top+window.pageYOffset)}},{key:"_getImagePos",value:function(e){var t=e.getBoundingClientRect();return new r.a(t.left+window.pageXOffset,t.top+window.pageYOffset)}},{key:"_getImageDimensions",value:function(e){var t=e.naturalWidth,o=e.naturalHeight;return new r.a(t,o)}},{key:"_getImageSize",value:function(e){var t=e.getBoundingClientRect();return new r.a(t.width,t.height)}},{key:"_getZoomImageSize",value:function(){var e=this._zoomImage.getBoundingClientRect();return new r.a(e.width,e.height)}},{key:"_getOverlaySize",value:function(e){var t=e.divide(this.options.zoomFactor);return this._overlay.style.width="".concat(Math.ceil(t.x),"px"),this._overlay.style.height="".concat(Math.ceil(t.y),"px"),t}},{key:"_createOverlay",value:function(e){if(this._overlay=e.querySelector(".".concat(this.options.overlayClass)),this._overlay)return this._overlay;var t='
 
');return this._overlay=e.insertAdjacentHTML("beforeend",t),this.$emitter.publish("createOverlay"),this._overlay}},{key:"_removeOverlay",value:function(){var e=document.querySelectorAll(".".concat(this.options.overlayClass));s.a.iterate(e,(function(e){return e.remove()})),this.$emitter.publish("removeOverlay")}},{key:"_createZoomImage",value:function(){if(this._zoomImage=this._zoomImageContainer.querySelector(".".concat(this.options.zoomImageClass)),this._zoomImage)return this._zoomImage;this._zoomImageContainer.style.position="relative";var e='
 
');return this._zoomImage=this._zoomImageContainer.insertAdjacentHTML("beforeend",e),this.$emitter.publish("createZoomImage"),this._zoomImage}},{key:"_removeZoomImage",value:function(){var e=document.querySelectorAll(".".concat(this.options.zoomImageClass));s.a.iterate(e,(function(e){return e.remove()})),this.$emitter.publish("removeZoomImage")}},{key:"_getImageUrl",value:function(e){this._imageUrl=i.a.getDataAttribute(e,this.options.fullImageDataAttribute),this.$emitter.publish("getImageUrl")}},{key:"_stopMagnify",value:function(){var e=this;this._removeZoomImage(),this._removeOverlay();var t=i.a.querySelectorAll(document,this.options.imageSelector);s.a.iterate(t,(function(t){return e._setCursor(t,"default")})),this.$emitter.publish("stopMagnify")}},{key:"_roundToTwoDigits",value:function(e){return Math.round(1e3*e)/1e3}}])&&c(o.prototype,n),u&&c(o,u),t}(n.a);p={zoomFactor:3,imageContainerSelector:".js-magnifier-container",imageSelector:".js-magnifier-image",fullImageDataAttribute:"data-full-image",zoomImageContainerSelector:".js-magnifier-zoom-image-container",overlayClass:"js-magnifier-overlay",zoomImageClass:"js-magnifier-zoom-image",magnifierOverGallery:!1,scaleZoomImage:!1,cursorType:"none"},(g="options")in(y=h)?Object.defineProperty(y,g,{value:p,enumerable:!0,configurable:!0,writable:!0}):y[g]=p}},[["hKGH","runtime","vendor-node","vendor-shared"]]]); \ No newline at end of file diff --git a/src/Resources/app/storefront/src/main.js b/src/Resources/app/storefront/src/main.js new file mode 100644 index 0000000..949d1f1 --- /dev/null +++ b/src/Resources/app/storefront/src/main.js @@ -0,0 +1,7 @@ +import SasImageHotspotPlugin from './plugin/sas-image-hotspot.plugin'; +import SasMagnifierOverridePlugin from './plugin/sas-magnifier-override.plugin'; + +const PluginManager = window.PluginManager; + +PluginManager.register('SasImageHotspot', SasImageHotspotPlugin, '[data-sas-image-hotspot]'); +PluginManager.override('Magnifier', SasMagnifierOverridePlugin, '[data-magnifier]'); diff --git a/src/Resources/app/storefront/src/plugin/sas-image-hotspot.plugin.js b/src/Resources/app/storefront/src/plugin/sas-image-hotspot.plugin.js new file mode 100644 index 0000000..f89a6d3 --- /dev/null +++ b/src/Resources/app/storefront/src/plugin/sas-image-hotspot.plugin.js @@ -0,0 +1,23 @@ +import Plugin from 'src/plugin-system/plugin.class'; +import DomAccess from 'src/helper/dom-access.helper'; + +export default class SasImageHotspotPlugin extends Plugin { + init() { + this._registerEvents(); + } + + _registerEvents() { + this.el.addEventListener('mouseover', e => { + const tooltip = DomAccess.querySelector(document, '.sas-image-hotspot__desc', false); + if (tooltip) { + $(tooltip).on('mouseover', () => { + $(this.el).tooltip('show'); + + $(document).on('mouseleave', '.sas-image-hotspot__desc', () => { + $(this.el).tooltip('hide'); + }); + }); + } + }) + } +} diff --git a/src/Resources/app/storefront/src/plugin/sas-magnifier-override.plugin.js b/src/Resources/app/storefront/src/plugin/sas-magnifier-override.plugin.js new file mode 100644 index 0000000..add2064 --- /dev/null +++ b/src/Resources/app/storefront/src/plugin/sas-magnifier-override.plugin.js @@ -0,0 +1,19 @@ +import MagnifierPlugin from 'src/plugin/magnifier/magnifier.plugin'; +import Iterator from 'src/helper/iterator.helper'; +import DomAccess from 'src/helper/dom-access.helper'; + +export default class SasMagnifierOverridePlugin extends MagnifierPlugin { + _registerEvents() { + Iterator.iterate(this._imageContainers, imageContainer => { + const image = DomAccess.querySelector(imageContainer, this.options.imageSelector, false); + + if (image) { + if (image.parentElement.classList.contains('sas-image-hotspot-map-wrapper')) { + return; + } + image.addEventListener('mousemove', (event) => this._onMouseMove(event, imageContainer, image), false); + imageContainer.addEventListener('mouseout', (event) => this._stopMagnify(event), false); + } + }); + } +} diff --git a/src/Resources/app/storefront/src/scss/abstract/variables.scss b/src/Resources/app/storefront/src/scss/abstract/variables.scss new file mode 100644 index 0000000..d560d7a --- /dev/null +++ b/src/Resources/app/storefront/src/scss/abstract/variables.scss @@ -0,0 +1 @@ +$color-crimson-500: #de294c; diff --git a/src/Resources/app/storefront/src/scss/base.scss b/src/Resources/app/storefront/src/scss/base.scss new file mode 100644 index 0000000..67d95cb --- /dev/null +++ b/src/Resources/app/storefront/src/scss/base.scss @@ -0,0 +1,7 @@ +/* Abstracts */ +@import 'abstract/variables'; + +/* Layout */ +@import 'layout/map'; +@import 'layout/hotspot-popup'; + diff --git a/src/Resources/app/storefront/src/scss/layout/hotspot-popup.scss b/src/Resources/app/storefront/src/scss/layout/hotspot-popup.scss new file mode 100644 index 0000000..f988e83 --- /dev/null +++ b/src/Resources/app/storefront/src/scss/layout/hotspot-popup.scss @@ -0,0 +1,157 @@ +.sas-image-hotspot-tooltip { + opacity: 1!important; + + .tooltip-inner { + background: rgba(0, 0, 0, 0); + max-width: 300px; + + .sas-image-hotspot__desc { + word-break: break-word; + background: #fff; + padding: 20px; + width: 300px; + max-width: calc(100vw - 20px); + border-radius: 5px; + position: absolute; + z-index: 3; + top: 15px; + left: 50%; + opacity: 0.95; + transform-origin: bottom center; + transform: translateY(calc(-100% - 20px)) translateX(-50%); + transition: 0.4s all ease; + display: block; + border: 1px solid #ccc; + + &-image { + max-height: 250px; + } + + &-text { + color: #000; + + h4 { + font-size: 20px; + line-height: 30px; + } + } + } + } + + &.bs-tooltip-bottom { + .sas-image-hotspot__desc { + transform-origin: bottom center; + transform: translateY(calc(0% + 1.25rem)) translateX(-50%); + display: table; + top: 0!important; + + &:after { + content: ""; + display: inline-block; + height: 20px; + width: 20px; + position: absolute; + top: -10px!important; + transform: translateX(-50%) rotate(45deg); + background: #fff; + border: 1px solid #ccc; + border-right: 0; + border-bottom: 0; + } + } + } +} + +.sas-image-hotspot:hover .sas-image-hotspot__desc { + display: block; +} + +.sas-image-hotspot__desc { + background: #fff; + padding: 20px; + width: 300px; + max-width: calc(100vw - 20px); + border-radius: 5px; + position: absolute; + z-index: 3; + top: 10px; + left: 50%; + opacity: 0.95; + transform-origin: bottom center; + transform: translateY(calc(-100% - 20px)) translateX(-50%); + transition: 0.4s all ease; +} + +.sas-image-hotspot:hover .sas-image-hotspot__desc { + z-index: 4; + opacity: 0.95; + display: block; + transform: translateY(-100%) translateX(-50%); +} + +.sas-image-hotspot__desc:after { + content: ""; + display: inline-block; + height: 20px; + width: 20px; + position: absolute; + bottom: -10px; + left: 50%; + transform: translateX(-50%) rotate(45deg); + background: #fff; + border-left: 0; + border-top: 0; +} + +.sas-image-hotspot__desc-image { + max-width: 100%; + height: auto; + margin-bottom: 12px; + max-height: 250px; +} + +.sas-image-hotspot__desc-text h4, +.sas-image-hotspot__desc-text .sas-image-hotspot__desc-p { + color: #000; +} + +.sas-image-hotspot__desc-text h4 { + font-size: 18px; + font-weight: 600; + line-height: 1; +} + +.sas-image-hotspot__desc-text .sas-image-hotspot__desc-p { + font-size: 16px; + line-height: 1.2; + font-weight: normal; + display: inline-block; + + ul { + margin-block-start: 0; + margin-block-end: 0; + margin-inline-start: 0; + margin-inline-end: 0; + padding-inline-start: 0; + } +} + + +@media (max-width:767px) { + .sas-image-hotspot__desc { + display: block; + } +} + +@media (min-width:768px) { + .sas-image-hotspot { + cursor: pointer; + } + + .sas-image-hotspot .sas-image-hotspot__desc { + display: block; + opacity: 1; + transition: none; + transform: translateY(-100%) translateX(-50%); + } +} diff --git a/src/Resources/app/storefront/src/scss/layout/map.scss b/src/Resources/app/storefront/src/scss/layout/map.scss new file mode 100644 index 0000000..e9d9c3a --- /dev/null +++ b/src/Resources/app/storefront/src/scss/layout/map.scss @@ -0,0 +1,150 @@ +.gallery-slider-thumbnails-item-inner { + overflow: hidden; +} + +.cms-element-image .cms-image-container.is-cover .sas-image-hotspot-map-wrapper .cms-image { + object-fit: initial; +} + +.image-zoom-container { + .sas-image-hotspot-map-container { + width: initial; + } + + .sas-image-hotspot-map-wrapper { + justify-content: center; + display: block; + width: unset; + height: unset; + } +} + +.sas-image-hotspot-map-container { + min-height: inherit; + object-fit: contain; + width: 100%; +} + +.sas-image-hotspot-map-wrapper { + position: relative; + margin: 0 auto; + display: flex; + align-items: center; + text-align: center; + min-height: inherit; + max-height: inherit; + min-width: inherit; + max-width: inherit; + width: 80%; + height: 100%; + + .gallery-slider-image.img-fluid { + max-width: 100%; + width: 100%; + object-fit: initial; + } + + &.is-preview { + max-height: 100%; + justify-content: center; + } + + .product-image { + width: 100%; + object-fit: contain; + } + + .sas-image-hotspot-preview { + bottom: 0; + right: 0; + opacity: 0.7; + } + + .sas-image-hotspot { + position: absolute; + z-index: 99; + width: 12px; + height: 12px; + background: rgba($color-crimson-500, 1); + border-radius: 50%; + cursor: pointer; + box-shadow: 0 0 3px 0 rgba(0, 0, 0, .2); + line-height: 13px; + font-size: 10px; + font-weight: bold; + transition: box-shadow .214s ease-in-out, transform .214s ease-in-out, background .214s ease-in-out; + text-align: center; + + &:before, &:after { + content: ''; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border-radius: 50%; + pointer-events: none; + } + + &.is-active:before { + z-index: 3; + opacity: 1; + transform: scale(1.5); + border-color: $color-crimson-500; + } + + &:hover:before { + opacity: 1; + transform: scale(1.4); + border-color: $color-crimson-500; + //animation: borderColor 2s linear infinite; + } + + &:hover:after { + display:none; + } + + &:before { + z-index: 1; + border: 0.15em solid rgba(255, 255, 255, 0.9); + opacity: 0; + transform: scale(2); + transition: transform .25s, opacity .2s; + left: calc(50% - 6px); + top: calc(50% - 6px); + box-sizing: border-box; + } + + &:after { + z-index: 2; + border: 2px solid $color-crimson-500; + animation: wave 2s infinite ease-in-out; + left: calc(-50% + 6px); + top: calc(-50% + 6px); + } + } +} + + +@keyframes wave{ + 0% { + opacity: 1; + transform: scale(1); + } + 100% { + opacity: 0; + transform: scale(2); + } +} + +@keyframes borderColor{ + 0% { + border-color: #fff; + } + 50% { + border-color: red; + } + 100% { + border-color: #fff; + } +} diff --git a/src/Resources/config/plugin.png b/src/Resources/config/plugin.png new file mode 100644 index 0000000..bc6f03c Binary files /dev/null and b/src/Resources/config/plugin.png differ diff --git a/src/Resources/config/services.xml b/src/Resources/config/services.xml new file mode 100644 index 0000000..46b2842 --- /dev/null +++ b/src/Resources/config/services.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Resources/public/administration/css/sas-image-hotspot.css b/src/Resources/public/administration/css/sas-image-hotspot.css new file mode 100644 index 0000000..46d4a8b --- /dev/null +++ b/src/Resources/public/administration/css/sas-image-hotspot.css @@ -0,0 +1 @@ +.sas-image-hotspot__desc{background:#fff;padding:20px;width:300px;max-width:calc(100vw - 20px);display:none;border-radius:5px;position:absolute;border:1px solid #ccc;z-index:3;top:-15px;left:50%;opacity:1;transform-origin:bottom center;transform:translateY(calc(-100% - 20px)) translateX(-50%);transition:all .4s ease}.sas-image-hotspot:hover .sas-image-hotspot__desc{z-index:4;opacity:1;display:block;transform:translateY(-100%) translateX(-50%)}.sas-image-hotspot__desc:after{content:"";display:inline-block;height:20px;width:20px;position:absolute;bottom:-10px;left:50%;transform:translateX(-50%) rotate(45deg);background:#fff;border-left:0;border-top:0}.sas-image-hotspot__desc-image{max-width:100%;height:auto;margin-bottom:12px;max-height:250px}.sas-image-hotspot__desc-text .sas-image-hotspot__desc-p,.sas-image-hotspot__desc-text h4{color:#000}.sas-image-hotspot__desc-text h4{font-size:18px;font-weight:600;line-height:1}.sas-image-hotspot__desc-text .sas-image-hotspot__desc-p{font-size:16px;line-height:1.2;font-weight:400;display:inline-block}.sas-image-hotspot__desc-text .sas-image-hotspot__desc-p ul{margin-block-start:0;margin-block-end:0;margin-inline-start:0;margin-inline-end:0;padding-inline-start:0}.sas-image-hotspot-map-fields{margin-bottom:30px;place-items:end stretch}.sas-image-hotspot-map-fields .sas-image-hotspot-map-field-actions{place-self:end;margin-bottom:10px}.sas-image-hotspot-map-wrapper{position:relative;display:inline-block}.sas-image-hotspot-map-wrapper img{max-width:100%}.sas-image-hotspot-map-wrapper .hotspot-grid-card.sw-card .sw-card__content{padding:0}.sas-image-hotspot-map-wrapper .dot{position:absolute;width:12px;height:12px;background:red;border-radius:50%;cursor:pointer;box-shadow:0 0 3px 0 rgba(0,0,0,.2);line-height:13px;font-size:10px;font-weight:700;transition:box-shadow .214s ease-in-out,transform .214s ease-in-out,background .214s ease-in-out;text-align:center}.sas-image-hotspot-map-wrapper .dot:after,.sas-image-hotspot-map-wrapper .dot:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;pointer-events:none}.sas-image-hotspot-map-wrapper .dot.is-active:before{z-index:3;opacity:1;transform:scale(1.5);border-color:red}.sas-image-hotspot-map-wrapper .dot:hover:before{opacity:1;transform:scale(1.4);animation:borderColor 2s linear infinite}.sas-image-hotspot-map-wrapper .dot:hover:after{display:none}.sas-image-hotspot-map-wrapper .dot:before{z-index:1;border:.15em solid hsla(0,0%,100%,.9);opacity:0;transform:scale(2);transition:transform .25s,opacity .2s;left:calc(50% - 6px);top:calc(50% - 6px);box-sizing:border-box}.sas-image-hotspot-map-wrapper .dot:after{z-index:2;border:2px solid #fff;animation:wave 2s infinite;left:calc(-50% + 4px);top:calc(-50% + 4px)}.sas-image-hotspot-map-wrapper .dot.ui-draggable-dragging{box-shadow:0 0 25px 0 rgba(0,0,0,.5);transform:scale3d(1.4,1.4,1.4);background:rgba(255,0,0,.7)}.sw-data-grid__cell-content .sas-hotspot-map-wrapper,.sw-media-upload-v2__preview .sas-hotspot-map-wrapper{display:none!important}.sw-media-preview-v2 .sas-hotspot-map-wrapper{position:absolute;bottom:17px!important;left:3px!important}.sw-media-preview-v2 .sas-hotspot-map-wrapper .dot{position:absolute;z-index:99;width:12px;height:12px;background:#de294c;border-radius:50%;cursor:pointer;box-shadow:0 0 3px 0 rgba(0,0,0,.2);line-height:13px;font-size:10px;font-weight:700;transition:box-shadow .214s ease-in-out,transform .214s ease-in-out,background .214s ease-in-out;text-align:center}.sw-media-preview-v2 .sas-hotspot-map-wrapper .dot:after,.sw-media-preview-v2 .sas-hotspot-map-wrapper .dot:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;pointer-events:none}.sw-media-preview-v2 .sas-hotspot-map-wrapper .dot.is-active:before{z-index:3;opacity:1;transform:scale(1.5);border-color:#de294c}.sw-media-preview-v2 .sas-hotspot-map-wrapper .dot:hover:before{opacity:1;transform:scale(1.4);border-color:#de294c}.sw-media-preview-v2 .sas-hotspot-map-wrapper .dot:hover:after{display:none}.sw-media-preview-v2 .sas-hotspot-map-wrapper .dot:before{z-index:1;border:.15em solid hsla(0,0%,100%,.9);opacity:0;transform:scale(2);transition:transform .25s,opacity .2s;left:calc(50% - 6px);top:calc(50% - 6px);box-sizing:border-box}.sw-media-preview-v2 .sas-hotspot-map-wrapper .dot:after{z-index:2;border:2px solid #de294c;animation:wave 2s infinite;left:calc(-50% + 4px);top:calc(-50% + 4px)}@keyframes wave{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(1.3)}}@keyframes borderColor{0%{border-color:#fff}50%{border-color:red}to{border-color:#fff}} \ No newline at end of file diff --git a/src/Resources/public/administration/js/sas-image-hotspot.js b/src/Resources/public/administration/js/sas-image-hotspot.js new file mode 100644 index 0000000..27de2c2 --- /dev/null +++ b/src/Resources/public/administration/js/sas-image-hotspot.js @@ -0,0 +1,3 @@ +/*! For license information please see sas-image-hotspot.js.LICENSE.txt */ +(this.webpackJsonp=this.webpackJsonp||[]).push([["sas-image-hotspot"],{"1qy7":function(e,t){e.exports='{% block sas_image_hotspot_map_wrapper %}\n \n {% block sas_image_hotspot_map_input_fields %}\n \n\n \n \n {% block sas_image_hotspot_map_title_field %}\n \n {% endblock %}\n \n\n \n {% block sas_image_hotspot_map_image_field %}\n \n \n \n \n {% endblock %}\n \n\n \n\n \n \n {% block sas_image_hotspot_map_link_field %}\n \n {% endblock %}\n \n\n \n {% block sas_image_hotspot_map_open_new_tab_field %}\n \n {% endblock %}\n \n\n \n\n \n {% block sas_image_hotspot_map_description_field %}\n \n {% endblock %}\n \n\n \n \n {% endblock %}\n\n {% block sas_image_hotspot_map_image %}\n
\n
\n \n \n
\n
\n {% endblock %}\n
\n{% endblock %}\n'},"3vfP":function(e,t){e.exports='{% block sw_media_media_item_context_item_rename_item %}\n \n {{ $tc(\'sas-image-hotspot-map.general.setHotspot\') }}\n \n\n {% parent %}\n{% endblock %}\n\n\n{% block sw_media_media_item_move_modal %}\n \n\n {% parent %}\n{% endblock %}\n'},"4+By":function(e,t,n){var o,i,r;i=[n("DZ3s"),n("o6U+")],void 0===(r="function"==typeof(o=function(e){var t,n=0,o=Array.prototype.slice;return e.cleanData=(t=e.cleanData,function(n){var o,i,r;for(r=0;null!=(i=n[r]);r++)try{(o=e._data(i,"events"))&&o.remove&&e(i).triggerHandler("remove")}catch(e){}t(n)}),e.widget=function(t,n,o){var i,r,s,a={},l=t.split(".")[0],c=l+"-"+(t=t.split(".")[1]);return o||(o=n,n=e.Widget),e.isArray(o)&&(o=e.extend.apply(null,[{}].concat(o))),e.expr[":"][c.toLowerCase()]=function(t){return!!e.data(t,c)},e[l]=e[l]||{},i=e[l][t],r=e[l][t]=function(e,t){if(!this._createWidget)return new r(e,t);arguments.length&&this._createWidget(e,t)},e.extend(r,i,{version:o.version,_proto:e.extend({},o),_childConstructors:[]}),(s=new n).options=e.widget.extend({},s.options),e.each(o,(function(t,o){e.isFunction(o)?a[t]=function(){function e(){return n.prototype[t].apply(this,arguments)}function i(e){return n.prototype[t].apply(this,e)}return function(){var t,n=this._super,r=this._superApply;return this._super=e,this._superApply=i,t=o.apply(this,arguments),this._super=n,this._superApply=r,t}}():a[t]=o})),r.prototype=e.widget.extend(s,{widgetEventPrefix:i&&s.widgetEventPrefix||t},a,{constructor:r,namespace:l,widgetName:t,widgetFullName:c}),i?(e.each(i._childConstructors,(function(t,n){var o=n.prototype;e.widget(o.namespace+"."+o.widgetName,r,n._proto)})),delete i._childConstructors):n._childConstructors.push(r),e.widget.bridge(t,r),r},e.widget.extend=function(t){for(var n,i,r=o.call(arguments,1),s=0,a=r.length;s",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,o){o=e(o||this.defaultElement||this)[0],this.element=e(o),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},o!==this&&(e.data(o,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===o&&this.destroy()}}),this.document=e(o.style?o.ownerDocument:o.document||o),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,(function(e,n){t._removeClass(n,e)})),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,n){var o,i,r,s=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(s={},o=t.split("."),t=o.shift(),o.length){for(i=s[t]=e.widget.extend({},this.options[t]),r=0;r\n \n \n \n \n {{ $tc(\'sw-product.mediaForm.coverSubline\') }}\n \n{% endblock %}\n\n{% block sw_product_image_context %}\n {% block sw_product_image_context_set_hotspot %}\n \n {{ $tc(\'sas-image-hotspot-map.general.setHotspot\') }}\n \n\n {% parent %}\n\n {% endblock %}\n{% endblock %}\n\n{% block sw_product_image_preview %}\n {% parent %}\n {% block sw_product_image_hotspot_modal %}\n \n {% endblock %}\n{% endblock %}\n'},AlCf:function(e,t){e.exports='{% block sas_image_hot_spot_modal_inner %}\n \n \n \n \n \n \n{% endblock %}\n'},B65p:function(e,t,n){},BEgE:function(e,t,n){var o,i,r;i=[n("DZ3s"),n("o6U+")],void 0===(r="function"==typeof(o=function(e){return e.fn.scrollParent=function(t){var n=this.css("position"),o="absolute"===n,i=t?/(auto|scroll|hidden)/:/(auto|scroll)/,r=this.parents().filter((function(){var t=e(this);return(!o||"static"!==t.css("position"))&&i.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))})).eq(0);return"fixed"!==n&&r.length?r:e(this[0].ownerDocument||document)}})?o.apply(t,i):o)||(e.exports=r)},DZ3s:function(e,t,n){var o;!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,(function(n,i){"use strict";var r=[],s=Object.getPrototypeOf,a=r.slice,l=r.flat?function(e){return r.flat.call(e)}:function(e){return r.concat.apply([],e)},c=r.push,u=r.indexOf,p={},d=p.toString,f=p.hasOwnProperty,h=f.toString,m=h.call(Object),g={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},y=function(e){return null!=e&&e===e.window},b=n.document,x={type:!0,src:!0,nonce:!0,noModule:!0};function w(e,t,n){var o,i,r=(n=n||b).createElement("script");if(r.text=e,t)for(o in x)(i=t[o]||t.getAttribute&&t.getAttribute(o))&&r.setAttribute(o,i);n.head.appendChild(r).parentNode.removeChild(r)}function _(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?p[d.call(e)]||"object":typeof e}var C=function(e,t){return new C.fn.init(e,t)};function T(e){var t=!!e&&"length"in e&&e.length,n=_(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}C.fn=C.prototype={jquery:"3.5.1",constructor:C,length:0,toArray:function(){return a.call(this)},get:function(e){return null==e?a.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=C.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return C.each(this,e)},map:function(e){return this.pushStack(C.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(C.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(C.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|"+O+")"+O+"*"),z=new RegExp(O+"|>"),X=new RegExp(F),Y=new RegExp("^"+q+"$"),V={ID:new RegExp("^#("+q+")"),CLASS:new RegExp("^\\.("+q+")"),TAG:new RegExp("^("+q+"|[*])"),ATTR:new RegExp("^"+R),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),bool:new RegExp("^(?:"+I+")$","i"),needsContext:new RegExp("^"+O+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)","i")},Z=/HTML$/i,G=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+O+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},oe=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){d()},se=xe((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{M.apply(N=j.call(w.childNodes),w.childNodes),N[w.childNodes.length].nodeType}catch(e){M={apply:N.length?function(e,t){H.apply(e,j.call(t))}:function(e,t){for(var n=e.length,o=0;e[n++]=t[o++];);e.length=n-1}}}function ae(e,t,o,i){var r,a,c,u,p,h,v,y=t&&t.ownerDocument,w=t?t.nodeType:9;if(o=o||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return o;if(!i&&(d(t),t=t||f,m)){if(11!==w&&(p=Q.exec(e)))if(r=p[1]){if(9===w){if(!(c=t.getElementById(r)))return o;if(c.id===r)return o.push(c),o}else if(y&&(c=y.getElementById(r))&&b(t,c)&&c.id===r)return o.push(c),o}else{if(p[2])return M.apply(o,t.getElementsByTagName(e)),o;if((r=p[3])&&n.getElementsByClassName&&t.getElementsByClassName)return M.apply(o,t.getElementsByClassName(r)),o}if(n.qsa&&!E[e+" "]&&(!g||!g.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(v=e,y=t,1===w&&(z.test(e)||U.test(e))){for((y=ee.test(e)&&ve(t.parentNode)||t)===t&&n.scope||((u=t.getAttribute("id"))?u=u.replace(oe,ie):t.setAttribute("id",u=x)),a=(h=s(e)).length;a--;)h[a]=(u?"#"+u:":scope")+" "+be(h[a]);v=h.join(",")}try{return M.apply(o,y.querySelectorAll(v)),o}catch(t){E(e,!0)}finally{u===x&&t.removeAttribute("id")}}}return l(e.replace(B,"$1"),t,o,i)}function le(){var e=[];return function t(n,i){return e.push(n+" ")>o.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function ce(e){return e[x]=!0,e}function ue(e){var t=f.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function pe(e,t){for(var n=e.split("|"),i=n.length;i--;)o.attrHandle[n[i]]=t}function de(e,t){var n=t&&e,o=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(o)return o;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function he(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&se(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return ce((function(t){return t=+t,ce((function(n,o){for(var i,r=e([],n.length,t),s=r.length;s--;)n[i=r[s]]&&(n[i]=!(o[i]=n[i]))}))}))}function ve(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=ae.support={},r=ae.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Z.test(t||n&&n.nodeName||"HTML")},d=ae.setDocument=function(e){var t,i,s=e?e.ownerDocument||e:w;return s!=f&&9===s.nodeType&&s.documentElement?(h=(f=s).documentElement,m=!r(f),w!=f&&(i=f.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.scope=ue((function(e){return h.appendChild(e).appendChild(f.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.attributes=ue((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ue((function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=K.test(f.getElementsByClassName),n.getById=ue((function(e){return h.appendChild(e).id=x,!f.getElementsByName||!f.getElementsByName(x).length})),n.getById?(o.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},o.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(o.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},o.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,o,i,r=t.getElementById(e);if(r){if((n=r.getAttributeNode("id"))&&n.value===e)return[r];for(i=t.getElementsByName(e),o=0;r=i[o++];)if((n=r.getAttributeNode("id"))&&n.value===e)return[r]}return[]}}),o.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,o=[],i=0,r=t.getElementsByTagName(e);if("*"===e){for(;n=r[i++];)1===n.nodeType&&o.push(n);return o}return r},o.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},v=[],g=[],(n.qsa=K.test(f.querySelectorAll))&&(ue((function(e){var t;h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+O+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+O+"*(?:value|"+I+")"),e.querySelectorAll("[id~="+x+"-]").length||g.push("~="),(t=f.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\["+O+"*name"+O+"*="+O+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),ue((function(e){e.innerHTML="";var t=f.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+O+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=K.test(y=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue((function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),v.push("!=",F)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),t=K.test(h.compareDocumentPosition),b=t||K.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,o=t&&t.parentNode;return e===o||!(!o||1!==o.nodeType||!(n.contains?n.contains(o):e.compareDocumentPosition&&16&e.compareDocumentPosition(o)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return p=!0,0;var o=!e.compareDocumentPosition-!t.compareDocumentPosition;return o||(1&(o=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===o?e==f||e.ownerDocument==w&&b(w,e)?-1:t==f||t.ownerDocument==w&&b(w,t)?1:u?L(u,e)-L(u,t):0:4&o?-1:1)}:function(e,t){if(e===t)return p=!0,0;var n,o=0,i=e.parentNode,r=t.parentNode,s=[e],a=[t];if(!i||!r)return e==f?-1:t==f?1:i?-1:r?1:u?L(u,e)-L(u,t):0;if(i===r)return de(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;s[o]===a[o];)o++;return o?de(s[o],a[o]):s[o]==w?-1:a[o]==w?1:0},f):f},ae.matches=function(e,t){return ae(e,null,null,t)},ae.matchesSelector=function(e,t){if(d(e),n.matchesSelector&&m&&!E[t+" "]&&(!v||!v.test(t))&&(!g||!g.test(t)))try{var o=y.call(e,t);if(o||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return o}catch(e){E(t,!0)}return ae(t,f,null,[e]).length>0},ae.contains=function(e,t){return(e.ownerDocument||e)!=f&&d(e),b(e,t)},ae.attr=function(e,t){(e.ownerDocument||e)!=f&&d(e);var i=o.attrHandle[t.toLowerCase()],r=i&&P.call(o.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==r?r:n.attributes||!m?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},ae.escape=function(e){return(e+"").replace(oe,ie)},ae.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ae.uniqueSort=function(e){var t,o=[],i=0,r=0;if(p=!n.detectDuplicates,u=!n.sortStable&&e.slice(0),e.sort(D),p){for(;t=e[r++];)t===e[r]&&(i=o.push(r));for(;i--;)e.splice(o[i],1)}return u=null,e},i=ae.getText=function(e){var t,n="",o=0,r=e.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===r||4===r)return e.nodeValue}else for(;t=e[o++];)n+=i(t);return n},(o=ae.selectors={cacheLength:50,createPseudo:ce,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ae.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ae.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=s(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&T(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(o){var i=ae.attr(o,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(W," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,o,i){var r="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===o&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,p,d,f,h,m=r!==s?"nextSibling":"previousSibling",g=t.parentNode,v=a&&t.nodeName.toLowerCase(),y=!l&&!a,b=!1;if(g){if(r){for(;m;){for(d=t;d=d[m];)if(a?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[s?g.firstChild:g.lastChild],s&&y){for(b=(f=(c=(u=(p=(d=g)[x]||(d[x]={}))[d.uniqueID]||(p[d.uniqueID]={}))[e]||[])[0]===_&&c[1])&&c[2],d=f&&g.childNodes[f];d=++f&&d&&d[m]||(b=f=0)||h.pop();)if(1===d.nodeType&&++b&&d===t){u[e]=[_,f,b];break}}else if(y&&(b=f=(c=(u=(p=(d=t)[x]||(d[x]={}))[d.uniqueID]||(p[d.uniqueID]={}))[e]||[])[0]===_&&c[1]),!1===b)for(;(d=++f&&d&&d[m]||(b=f=0)||h.pop())&&((a?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++b||(y&&((u=(p=d[x]||(d[x]={}))[d.uniqueID]||(p[d.uniqueID]={}))[e]=[_,b]),d!==t)););return(b-=i)===o||b%o==0&&b/o>=0}}},PSEUDO:function(e,t){var n,i=o.pseudos[e]||o.setFilters[e.toLowerCase()]||ae.error("unsupported pseudo: "+e);return i[x]?i(t):i.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?ce((function(e,n){for(var o,r=i(e,t),s=r.length;s--;)e[o=L(e,r[s])]=!(n[o]=r[s])})):function(e){return i(e,0,n)}):i}},pseudos:{not:ce((function(e){var t=[],n=[],o=a(e.replace(B,"$1"));return o[x]?ce((function(e,t,n,i){for(var r,s=o(e,null,i,[]),a=e.length;a--;)(r=s[a])&&(e[a]=!(t[a]=r))})):function(e,i,r){return t[0]=e,o(t,null,r,n),t[0]=null,!n.pop()}})),has:ce((function(e){return function(t){return ae(e,t).length>0}})),contains:ce((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||i(t)).indexOf(e)>-1}})),lang:ce((function(e){return Y.test(e||"")||ae.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ge((function(){return[0]})),last:ge((function(e,t){return[t-1]})),eq:ge((function(e,t,n){return[n<0?n+t:n]})),even:ge((function(e,t){for(var n=0;nt?t:n;--o>=0;)e.push(o);return e})),gt:ge((function(e,t,n){for(var o=n<0?n+t:n;++o1?function(t,n,o){for(var i=e.length;i--;)if(!e[i](t,n,o))return!1;return!0}:e[0]}function _e(e,t,n,o,i){for(var r,s=[],a=0,l=e.length,c=null!=t;a-1&&(r[c]=!(s[c]=p))}}else v=_e(v===s?v.splice(h,v.length):v),i?i(null,s,v,l):M.apply(s,v)}))}function Te(e){for(var t,n,i,r=e.length,s=o.relative[e[0].type],a=s||o.relative[" "],l=s?1:0,u=xe((function(e){return e===t}),a,!0),p=xe((function(e){return L(t,e)>-1}),a,!0),d=[function(e,n,o){var i=!s&&(o||n!==c)||((t=n).nodeType?u(e,n,o):p(e,n,o));return t=null,i}];l1&&we(d),l>1&&be(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(B,"$1"),n,l0,i=e.length>0,r=function(r,s,a,l,u){var p,h,g,v=0,y="0",b=r&&[],x=[],w=c,C=r||i&&o.find.TAG("*",u),T=_+=null==w?1:Math.random()||.1,k=C.length;for(u&&(c=s==f||s||u);y!==k&&null!=(p=C[y]);y++){if(i&&p){for(h=0,s||p.ownerDocument==f||(d(p),a=!m);g=e[h++];)if(g(p,s||f,a)){l.push(p);break}u&&(_=T)}n&&((p=!g&&p)&&v--,r&&b.push(p))}if(v+=y,n&&y!==v){for(h=0;g=t[h++];)g(b,x,s,a);if(r){if(v>0)for(;y--;)b[y]||x[y]||(x[y]=A.call(l));x=_e(x)}M.apply(l,x),u&&!r&&x.length>0&&v+t.length>1&&ae.uniqueSort(l)}return u&&(_=T,c=w),b};return n?ce(r):r}(r,i))).selector=e}return a},l=ae.select=function(e,t,n,i){var r,l,c,u,p,d="function"==typeof e&&e,f=!i&&s(e=d.selector||e);if(n=n||[],1===f.length){if((l=f[0]=f[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&9===t.nodeType&&m&&o.relative[l[1].type]){if(!(t=(o.find.ID(c.matches[0].replace(te,ne),t)||[])[0]))return n;d&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(r=V.needsContext.test(e)?0:l.length;r--&&(c=l[r],!o.relative[u=c.type]);)if((p=o.find[u])&&(i=p(c.matches[0].replace(te,ne),ee.test(l[0].type)&&ve(t.parentNode)||t))){if(l.splice(r,1),!(e=i.length&&be(l)))return M.apply(n,i),n;break}}return(d||a(e,f))(i,t,!m,n,!t||ee.test(e)&&ve(t.parentNode)||t),n},n.sortStable=x.split("").sort(D).join("")===x,n.detectDuplicates=!!p,d(),n.sortDetached=ue((function(e){return 1&e.compareDocumentPosition(f.createElement("fieldset"))})),ue((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||pe("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ue((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||pe("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ue((function(e){return null==e.getAttribute("disabled")}))||pe(I,(function(e,t,n){var o;if(!n)return!0===e[t]?t.toLowerCase():(o=e.getAttributeNode(t))&&o.specified?o.value:null})),ae}(n);C.find=k,C.expr=k.selectors,C.expr[":"]=C.expr.pseudos,C.uniqueSort=C.unique=k.uniqueSort,C.text=k.getText,C.isXMLDoc=k.isXML,C.contains=k.contains,C.escapeSelector=k.escape;var S=function(e,t,n){for(var o=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&C(e).is(n))break;o.push(e)}return o},E=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=C.expr.match.needsContext;function P(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function A(e,t,n){return v(t)?C.grep(e,(function(e,o){return!!t.call(e,o,e)!==n})):t.nodeType?C.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?C.grep(e,(function(e){return u.call(t,e)>-1!==n})):C.filter(t,e,n)}C.filter=function(e,t,n){var o=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===o.nodeType?C.find.matchesSelector(o,e)?[o]:[]:C.find.matches(e,C.grep(t,(function(e){return 1===e.nodeType})))},C.fn.extend({find:function(e){var t,n,o=this.length,i=this;if("string"!=typeof e)return this.pushStack(C(e).filter((function(){for(t=0;t1?C.uniqueSort(n):n},filter:function(e){return this.pushStack(A(this,e||[],!1))},not:function(e){return this.pushStack(A(this,e||[],!0))},is:function(e){return!!A(this,"string"==typeof e&&D.test(e)?C(e):e||[],!1).length}});var H,M=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(C.fn.init=function(e,t,n){var o,i;if(!e)return this;if(n=n||H,"string"==typeof e){if(!(o="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:M.exec(e))||!o[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(o[1]){if(t=t instanceof C?t[0]:t,C.merge(this,C.parseHTML(o[1],t&&t.nodeType?t.ownerDocument||t:b,!0)),N.test(o[1])&&C.isPlainObject(t))for(o in t)v(this[o])?this[o](t[o]):this.attr(o,t[o]);return this}return(i=b.getElementById(o[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(C):C.makeArray(e,this)}).prototype=C.fn,H=C(b);var j=/^(?:parents|prev(?:Until|All))/,L={children:!0,contents:!0,next:!0,prev:!0};function I(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}C.fn.extend({has:function(e){var t=C(e,this),n=t.length;return this.filter((function(){for(var e=0;e-1:1===n.nodeType&&C.find.matchesSelector(n,e))){r.push(n);break}return this.pushStack(r.length>1?C.uniqueSort(r):r)},index:function(e){return e?"string"==typeof e?u.call(C(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(C.uniqueSort(C.merge(this.get(),C(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),C.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return S(e,"parentNode")},parentsUntil:function(e,t,n){return S(e,"parentNode",n)},next:function(e){return I(e,"nextSibling")},prev:function(e){return I(e,"previousSibling")},nextAll:function(e){return S(e,"nextSibling")},prevAll:function(e){return S(e,"previousSibling")},nextUntil:function(e,t,n){return S(e,"nextSibling",n)},prevUntil:function(e,t,n){return S(e,"previousSibling",n)},siblings:function(e){return E((e.parentNode||{}).firstChild,e)},children:function(e){return E(e.firstChild)},contents:function(e){return null!=e.contentDocument&&s(e.contentDocument)?e.contentDocument:(P(e,"template")&&(e=e.content||e),C.merge([],e.childNodes))}},(function(e,t){C.fn[e]=function(n,o){var i=C.map(this,t,n);return"Until"!==e.slice(-5)&&(o=n),o&&"string"==typeof o&&(i=C.filter(o,i)),this.length>1&&(L[e]||C.uniqueSort(i),j.test(e)&&i.reverse()),this.pushStack(i)}}));var O=/[^\x20\t\r\n\f]+/g;function q(e){return e}function R(e){throw e}function F(e,t,n,o){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(o))}catch(e){n.apply(void 0,[e])}}C.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return C.each(e.match(O)||[],(function(e,n){t[n]=!0})),t}(e):C.extend({},e);var t,n,o,i,r=[],s=[],a=-1,l=function(){for(i=i||e.once,o=t=!0;s.length;a=-1)for(n=s.shift();++a-1;)r.splice(n,1),n<=a&&a--})),this},has:function(e){return e?C.inArray(e,r)>-1:r.length>0},empty:function(){return r&&(r=[]),this},disable:function(){return i=s=[],r=n="",this},disabled:function(){return!r},lock:function(){return i=s=[],n||t||(r=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!o}};return c},C.extend({Deferred:function(e){var t=[["notify","progress",C.Callbacks("memory"),C.Callbacks("memory"),2],["resolve","done",C.Callbacks("once memory"),C.Callbacks("once memory"),0,"resolved"],["reject","fail",C.Callbacks("once memory"),C.Callbacks("once memory"),1,"rejected"]],o="pending",i={state:function(){return o},always:function(){return r.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return C.Deferred((function(n){C.each(t,(function(t,o){var i=v(e[o[4]])&&e[o[4]];r[o[1]]((function(){var e=i&&i.apply(this,arguments);e&&v(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(e,o,i){var r=0;function s(e,t,o,i){return function(){var a=this,l=arguments,c=function(){var n,c;if(!(e=r&&(o!==R&&(a=void 0,l=[n]),t.rejectWith(a,l))}};e?u():(C.Deferred.getStackHook&&(u.stackTrace=C.Deferred.getStackHook()),n.setTimeout(u))}}return C.Deferred((function(n){t[0][3].add(s(0,n,v(i)?i:q,n.notifyWith)),t[1][3].add(s(0,n,v(e)?e:q)),t[2][3].add(s(0,n,v(o)?o:R))})).promise()},promise:function(e){return null!=e?C.extend(e,i):i}},r={};return C.each(t,(function(e,n){var s=n[2],a=n[5];i[n[1]]=s.add,a&&s.add((function(){o=a}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),s.add(n[3].fire),r[n[0]]=function(){return r[n[0]+"With"](this===r?void 0:this,arguments),this},r[n[0]+"With"]=s.fireWith})),i.promise(r),e&&e.call(r,r),r},when:function(e){var t=arguments.length,n=t,o=Array(n),i=a.call(arguments),r=C.Deferred(),s=function(e){return function(n){o[e]=this,i[e]=arguments.length>1?a.call(arguments):n,--t||r.resolveWith(o,i)}};if(t<=1&&(F(e,r.done(s(n)).resolve,r.reject,!t),"pending"===r.state()||v(i[n]&&i[n].then)))return r.then();for(;n--;)F(i[n],s(n),r.reject);return r.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;C.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&W.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},C.readyException=function(e){n.setTimeout((function(){throw e}))};var B=C.Deferred();function $(){b.removeEventListener("DOMContentLoaded",$),n.removeEventListener("load",$),C.ready()}C.fn.ready=function(e){return B.then(e).catch((function(e){C.readyException(e)})),this},C.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--C.readyWait:C.isReady)||(C.isReady=!0,!0!==e&&--C.readyWait>0||B.resolveWith(b,[C]))}}),C.ready.then=B.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?n.setTimeout(C.ready):(b.addEventListener("DOMContentLoaded",$),n.addEventListener("load",$));var U=function(e,t,n,o,i,r,s){var a=0,l=e.length,c=null==n;if("object"===_(n))for(a in i=!0,n)U(e,t,a,n[a],!0,r,s);else if(void 0!==o&&(i=!0,v(o)||(s=!0),c&&(s?(t.call(e,o),t=null):(c=t,t=function(e,t,n){return c.call(C(e),n)})),t))for(;a1,null,!0)},removeData:function(e){return this.each((function(){K.remove(this,e)}))}}),C.extend({queue:function(e,t,n){var o;if(e)return t=(t||"fx")+"queue",o=J.get(e,t),n&&(!o||Array.isArray(n)?o=J.access(e,t,C.makeArray(n)):o.push(n)),o||[]},dequeue:function(e,t){t=t||"fx";var n=C.queue(e,t),o=n.length,i=n.shift(),r=C._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),o--),i&&("fx"===t&&n.unshift("inprogress"),delete r.stop,i.call(e,(function(){C.dequeue(e,t)}),r)),!o&&r&&r.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:C.Callbacks("once memory").add((function(){J.remove(e,[t+"queue",n])}))})}}),C.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,ve=/^$|^module$|\/(?:java|ecma)script/i;fe=b.createDocumentFragment().appendChild(b.createElement("div")),(he=b.createElement("input")).setAttribute("type","radio"),he.setAttribute("checked","checked"),he.setAttribute("name","t"),fe.appendChild(he),g.checkClone=fe.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.innerHTML="",g.noCloneChecked=!!fe.cloneNode(!0).lastChild.defaultValue,fe.innerHTML="",g.option=!!fe.lastChild;var ye={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function be(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&P(e,t)?C.merge([e],n):n}function xe(e,t){for(var n=0,o=e.length;n",""]);var we=/<|&#?\w+;/;function _e(e,t,n,o,i){for(var r,s,a,l,c,u,p=t.createDocumentFragment(),d=[],f=0,h=e.length;f-1)i&&i.push(r);else if(c=se(r),s=be(p.appendChild(r),"script"),c&&xe(s),n)for(u=0;r=s[u++];)ve.test(r.type||"")&&n.push(r);return p}var Ce=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ke=/^([^.]*)(?:\.(.+)|)/;function Se(){return!0}function Ee(){return!1}function De(e,t){return e===function(){try{return b.activeElement}catch(e){}}()==("focus"===t)}function Pe(e,t,n,o,i,r){var s,a;if("object"==typeof t){for(a in"string"!=typeof n&&(o=o||n,n=void 0),t)Pe(e,a,n,o,t[a],r);return e}if(null==o&&null==i?(i=n,o=n=void 0):null==i&&("string"==typeof n?(i=o,o=void 0):(i=o,o=n,n=void 0)),!1===i)i=Ee;else if(!i)return e;return 1===r&&(s=i,(i=function(e){return C().off(e),s.apply(this,arguments)}).guid=s.guid||(s.guid=C.guid++)),e.each((function(){C.event.add(this,t,i,o,n)}))}function Ne(e,t,n){n?(J.set(e,t,!1),C.event.add(e,t,{namespace:!1,handler:function(e){var o,i,r=J.get(this,t);if(1&e.isTrigger&&this[t]){if(r.length)(C.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=a.call(arguments),J.set(this,t,r),o=n(this,t),this[t](),r!==(i=J.get(this,t))||o?J.set(this,t,!1):i={},r!==i)return e.stopImmediatePropagation(),e.preventDefault(),i.value}else r.length&&(J.set(this,t,{value:C.event.trigger(C.extend(r[0],C.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===J.get(e,t)&&C.event.add(e,t,Se)}C.event={global:{},add:function(e,t,n,o,i){var r,s,a,l,c,u,p,d,f,h,m,g=J.get(e);if(Z(e))for(n.handler&&(n=(r=n).handler,i=r.selector),i&&C.find.matchesSelector(re,i),n.guid||(n.guid=C.guid++),(l=g.events)||(l=g.events=Object.create(null)),(s=g.handle)||(s=g.handle=function(t){return void 0!==C&&C.event.triggered!==t.type?C.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(O)||[""]).length;c--;)f=m=(a=ke.exec(t[c])||[])[1],h=(a[2]||"").split(".").sort(),f&&(p=C.event.special[f]||{},f=(i?p.delegateType:p.bindType)||f,p=C.event.special[f]||{},u=C.extend({type:f,origType:m,data:o,handler:n,guid:n.guid,selector:i,needsContext:i&&C.expr.match.needsContext.test(i),namespace:h.join(".")},r),(d=l[f])||((d=l[f]=[]).delegateCount=0,p.setup&&!1!==p.setup.call(e,o,h,s)||e.addEventListener&&e.addEventListener(f,s)),p.add&&(p.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,u):d.push(u),C.event.global[f]=!0)},remove:function(e,t,n,o,i){var r,s,a,l,c,u,p,d,f,h,m,g=J.hasData(e)&&J.get(e);if(g&&(l=g.events)){for(c=(t=(t||"").match(O)||[""]).length;c--;)if(f=m=(a=ke.exec(t[c])||[])[1],h=(a[2]||"").split(".").sort(),f){for(p=C.event.special[f]||{},d=l[f=(o?p.delegateType:p.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=r=d.length;r--;)u=d[r],!i&&m!==u.origType||n&&n.guid!==u.guid||a&&!a.test(u.namespace)||o&&o!==u.selector&&("**"!==o||!u.selector)||(d.splice(r,1),u.selector&&d.delegateCount--,p.remove&&p.remove.call(e,u));s&&!d.length&&(p.teardown&&!1!==p.teardown.call(e,h,g.handle)||C.removeEvent(e,f,g.handle),delete l[f])}else for(f in l)C.event.remove(e,f+t[c],n,o,!0);C.isEmptyObject(l)&&J.remove(e,"handle events")}},dispatch:function(e){var t,n,o,i,r,s,a=new Array(arguments.length),l=C.event.fix(e),c=(J.get(this,"events")||Object.create(null))[l.type]||[],u=C.event.special[l.type]||{};for(a[0]=l,t=1;t=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(r=[],s={},n=0;n-1:C.find(i,this,null,[c]).length),s[i]&&r.push(o);r.length&&a.push({elem:c,handlers:r})}return c=this,l\s*$/g;function je(e,t){return P(e,"table")&&P(11!==t.nodeType?t:t.firstChild,"tr")&&C(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ie(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,o,i,r,s,a;if(1===t.nodeType){if(J.hasData(e)&&(a=J.get(e).events))for(i in J.remove(t,"handle events"),a)for(n=0,o=a[i].length;n1&&"string"==typeof h&&!g.checkClone&&He.test(h))return e.each((function(i){var r=e.eq(i);m&&(t[0]=h.call(this,i,r.html())),Re(r,t,n,o)}));if(d&&(r=(i=_e(t,e[0].ownerDocument,!1,e,o)).firstChild,1===i.childNodes.length&&(i=r),r||o)){for(a=(s=C.map(be(i,"script"),Le)).length;p0&&xe(s,!l&&be(e,"script")),a},cleanData:function(e){for(var t,n,o,i=C.event.special,r=0;void 0!==(n=e[r]);r++)if(Z(n)){if(t=n[J.expando]){if(t.events)for(o in t.events)i[o]?C.event.remove(n,o):C.removeEvent(n,o,t.handle);n[J.expando]=void 0}n[K.expando]&&(n[K.expando]=void 0)}}}),C.fn.extend({detach:function(e){return Fe(this,e,!0)},remove:function(e){return Fe(this,e)},text:function(e){return U(this,(function(e){return void 0===e?C.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Re(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||je(this,e).appendChild(e)}))},prepend:function(){return Re(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=je(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Re(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Re(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(C.cleanData(be(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return C.clone(this,e,t)}))},html:function(e){return U(this,(function(e){var t=this[0]||{},n=0,o=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!ye[(ge.exec(e)||["",""])[1].toLowerCase()]){e=C.htmlPrefilter(e);try{for(;n3,re.removeChild(e)),a}}))}();var Ye=["Webkit","Moz","ms"],Ve=b.createElement("div").style,Ze={};function Ge(e){var t=C.cssProps[e]||Ze[e];return t||(e in Ve?e:Ze[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=Ye.length;n--;)if((e=Ye[n]+t)in Ve)return e}(e)||e)}var Je=/^(none|table(?!-c[ea]).+)/,Ke=/^--/,Qe={position:"absolute",visibility:"hidden",display:"block"},et={letterSpacing:"0",fontWeight:"400"};function tt(e,t,n){var o=oe.exec(t);return o?Math.max(0,o[2]-(n||0))+(o[3]||"px"):t}function nt(e,t,n,o,i,r){var s="width"===t?1:0,a=0,l=0;if(n===(o?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(l+=C.css(e,n+ie[s],!0,i)),o?("content"===n&&(l-=C.css(e,"padding"+ie[s],!0,i)),"margin"!==n&&(l-=C.css(e,"border"+ie[s]+"Width",!0,i))):(l+=C.css(e,"padding"+ie[s],!0,i),"padding"!==n?l+=C.css(e,"border"+ie[s]+"Width",!0,i):a+=C.css(e,"border"+ie[s]+"Width",!0,i));return!o&&r>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-r-l-a-.5))||0),l}function ot(e,t,n){var o=Be(e),i=(!g.boxSizingReliable()||n)&&"border-box"===C.css(e,"boxSizing",!1,o),r=i,s=ze(e,t,o),a="offset"+t[0].toUpperCase()+t.slice(1);if(We.test(s)){if(!n)return s;s="auto"}return(!g.boxSizingReliable()&&i||!g.reliableTrDimensions()&&P(e,"tr")||"auto"===s||!parseFloat(s)&&"inline"===C.css(e,"display",!1,o))&&e.getClientRects().length&&(i="border-box"===C.css(e,"boxSizing",!1,o),(r=a in e)&&(s=e[a])),(s=parseFloat(s)||0)+nt(e,t,n||(i?"border":"content"),r,o,s)+"px"}function it(e,t,n,o,i){return new it.prototype.init(e,t,n,o,i)}C.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=ze(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,o){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,r,s,a=V(t),l=Ke.test(t),c=e.style;if(l||(t=Ge(a)),s=C.cssHooks[t]||C.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(i=s.get(e,!1,o))?i:c[t];"string"===(r=typeof n)&&(i=oe.exec(n))&&i[1]&&(n=ce(e,t,i),r="number"),null!=n&&n==n&&("number"!==r||l||(n+=i&&i[3]||(C.cssNumber[a]?"":"px")),g.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,o))||(l?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,o){var i,r,s,a=V(t);return Ke.test(t)||(t=Ge(a)),(s=C.cssHooks[t]||C.cssHooks[a])&&"get"in s&&(i=s.get(e,!0,n)),void 0===i&&(i=ze(e,t,o)),"normal"===i&&t in et&&(i=et[t]),""===n||n?(r=parseFloat(i),!0===n||isFinite(r)?r||0:i):i}}),C.each(["height","width"],(function(e,t){C.cssHooks[t]={get:function(e,n,o){if(n)return!Je.test(C.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ot(e,t,o):$e(e,Qe,(function(){return ot(e,t,o)}))},set:function(e,n,o){var i,r=Be(e),s=!g.scrollboxSize()&&"absolute"===r.position,a=(s||o)&&"border-box"===C.css(e,"boxSizing",!1,r),l=o?nt(e,t,o,a,r):0;return a&&s&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(r[t])-nt(e,t,"border",!1,r)-.5)),l&&(i=oe.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=C.css(e,t)),tt(0,n,l)}}})),C.cssHooks.marginLeft=Xe(g.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(ze(e,"marginLeft"))||e.getBoundingClientRect().left-$e(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),C.each({margin:"",padding:"",border:"Width"},(function(e,t){C.cssHooks[e+t]={expand:function(n){for(var o=0,i={},r="string"==typeof n?n.split(" "):[n];o<4;o++)i[e+ie[o]+t]=r[o]||r[o-2]||r[0];return i}},"margin"!==e&&(C.cssHooks[e+t].set=tt)})),C.fn.extend({css:function(e,t){return U(this,(function(e,t,n){var o,i,r={},s=0;if(Array.isArray(t)){for(o=Be(e),i=t.length;s1)}}),C.Tween=it,it.prototype={constructor:it,init:function(e,t,n,o,i,r){this.elem=e,this.prop=n,this.easing=i||C.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=o,this.unit=r||(C.cssNumber[n]?"":"px")},cur:function(){var e=it.propHooks[this.prop];return e&&e.get?e.get(this):it.propHooks._default.get(this)},run:function(e){var t,n=it.propHooks[this.prop];return this.options.duration?this.pos=t=C.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):it.propHooks._default.set(this),this}},it.prototype.init.prototype=it.prototype,it.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=C.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){C.fx.step[e.prop]?C.fx.step[e.prop](e):1!==e.elem.nodeType||!C.cssHooks[e.prop]&&null==e.elem.style[Ge(e.prop)]?e.elem[e.prop]=e.now:C.style(e.elem,e.prop,e.now+e.unit)}}},it.propHooks.scrollTop=it.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},C.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},C.fx=it.prototype.init,C.fx.step={};var rt,st,at=/^(?:toggle|show|hide)$/,lt=/queueHooks$/;function ct(){st&&(!1===b.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(ct):n.setTimeout(ct,C.fx.interval),C.fx.tick())}function ut(){return n.setTimeout((function(){rt=void 0})),rt=Date.now()}function pt(e,t){var n,o=0,i={height:e};for(t=t?1:0;o<4;o+=2-t)i["margin"+(n=ie[o])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function dt(e,t,n){for(var o,i=(ft.tweeners[t]||[]).concat(ft.tweeners["*"]),r=0,s=i.length;r1)},removeAttr:function(e){return this.each((function(){C.removeAttr(this,e)}))}}),C.extend({attr:function(e,t,n){var o,i,r=e.nodeType;if(3!==r&&8!==r&&2!==r)return void 0===e.getAttribute?C.prop(e,t,n):(1===r&&C.isXMLDoc(e)||(i=C.attrHooks[t.toLowerCase()]||(C.expr.match.bool.test(t)?ht:void 0)),void 0!==n?null===n?void C.removeAttr(e,t):i&&"set"in i&&void 0!==(o=i.set(e,n,t))?o:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(o=i.get(e,t))?o:null==(o=C.find.attr(e,t))?void 0:o)},attrHooks:{type:{set:function(e,t){if(!g.radioValue&&"radio"===t&&P(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,o=0,i=t&&t.match(O);if(i&&1===e.nodeType)for(;n=i[o++];)e.removeAttribute(n)}}),ht={set:function(e,t,n){return!1===t?C.removeAttr(e,n):e.setAttribute(n,n),n}},C.each(C.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=mt[t]||C.find.attr;mt[t]=function(e,t,o){var i,r,s=t.toLowerCase();return o||(r=mt[s],mt[s]=i,i=null!=n(e,t,o)?s:null,mt[s]=r),i}}));var gt=/^(?:input|select|textarea|button)$/i,vt=/^(?:a|area)$/i;function yt(e){return(e.match(O)||[]).join(" ")}function bt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(O)||[]}C.fn.extend({prop:function(e,t){return U(this,C.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[C.propFix[e]||e]}))}}),C.extend({prop:function(e,t,n){var o,i,r=e.nodeType;if(3!==r&&8!==r&&2!==r)return 1===r&&C.isXMLDoc(e)||(t=C.propFix[t]||t,i=C.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(o=i.set(e,n,t))?o:e[t]=n:i&&"get"in i&&null!==(o=i.get(e,t))?o:e[t]},propHooks:{tabIndex:{get:function(e){var t=C.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||vt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(C.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),C.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){C.propFix[this.toLowerCase()]=this})),C.fn.extend({addClass:function(e){var t,n,o,i,r,s,a,l=0;if(v(e))return this.each((function(t){C(this).addClass(e.call(this,t,bt(this)))}));if((t=xt(e)).length)for(;n=this[l++];)if(i=bt(n),o=1===n.nodeType&&" "+yt(i)+" "){for(s=0;r=t[s++];)o.indexOf(" "+r+" ")<0&&(o+=r+" ");i!==(a=yt(o))&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,o,i,r,s,a,l=0;if(v(e))return this.each((function(t){C(this).removeClass(e.call(this,t,bt(this)))}));if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)for(;n=this[l++];)if(i=bt(n),o=1===n.nodeType&&" "+yt(i)+" "){for(s=0;r=t[s++];)for(;o.indexOf(" "+r+" ")>-1;)o=o.replace(" "+r+" "," ");i!==(a=yt(o))&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e,o="string"===n||Array.isArray(e);return"boolean"==typeof t&&o?t?this.addClass(e):this.removeClass(e):v(e)?this.each((function(n){C(this).toggleClass(e.call(this,n,bt(this),t),t)})):this.each((function(){var t,i,r,s;if(o)for(i=0,r=C(this),s=xt(e);t=s[i++];)r.hasClass(t)?r.removeClass(t):r.addClass(t);else void 0!==e&&"boolean"!==n||((t=bt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,o=0;for(t=" "+e+" ";n=this[o++];)if(1===n.nodeType&&(" "+yt(bt(n))+" ").indexOf(t)>-1)return!0;return!1}});var wt=/\r/g;C.fn.extend({val:function(e){var t,n,o,i=this[0];return arguments.length?(o=v(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=o?e.call(this,n,C(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=C.map(i,(function(e){return null==e?"":e+""}))),(t=C.valHooks[this.type]||C.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=C.valHooks[i.type]||C.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(wt,""):null==n?"":n:void 0}}),C.extend({valHooks:{option:{get:function(e){var t=C.find.attr(e,"value");return null!=t?t:yt(C.text(e))}},select:{get:function(e){var t,n,o,i=e.options,r=e.selectedIndex,s="select-one"===e.type,a=s?null:[],l=s?r+1:i.length;for(o=r<0?l:s?r:0;o-1)&&(n=!0);return n||(e.selectedIndex=-1),r}}}}),C.each(["radio","checkbox"],(function(){C.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=C.inArray(C(e).val(),t)>-1}},g.checkOn||(C.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),g.focusin="onfocusin"in n;var _t=/^(?:focusinfocus|focusoutblur)$/,Ct=function(e){e.stopPropagation()};C.extend(C.event,{trigger:function(e,t,o,i){var r,s,a,l,c,u,p,d,h=[o||b],m=f.call(e,"type")?e.type:e,g=f.call(e,"namespace")?e.namespace.split("."):[];if(s=d=a=o=o||b,3!==o.nodeType&&8!==o.nodeType&&!_t.test(m+C.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),c=m.indexOf(":")<0&&"on"+m,(e=e[C.expando]?e:new C.Event(m,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=g.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=o),t=null==t?[e]:C.makeArray(t,[e]),p=C.event.special[m]||{},i||!p.trigger||!1!==p.trigger.apply(o,t))){if(!i&&!p.noBubble&&!y(o)){for(l=p.delegateType||m,_t.test(l+m)||(s=s.parentNode);s;s=s.parentNode)h.push(s),a=s;a===(o.ownerDocument||b)&&h.push(a.defaultView||a.parentWindow||n)}for(r=0;(s=h[r++])&&!e.isPropagationStopped();)d=s,e.type=r>1?l:p.bindType||m,(u=(J.get(s,"events")||Object.create(null))[e.type]&&J.get(s,"handle"))&&u.apply(s,t),(u=c&&s[c])&&u.apply&&Z(s)&&(e.result=u.apply(s,t),!1===e.result&&e.preventDefault());return e.type=m,i||e.isDefaultPrevented()||p._default&&!1!==p._default.apply(h.pop(),t)||!Z(o)||c&&v(o[m])&&!y(o)&&((a=o[c])&&(o[c]=null),C.event.triggered=m,e.isPropagationStopped()&&d.addEventListener(m,Ct),o[m](),e.isPropagationStopped()&&d.removeEventListener(m,Ct),C.event.triggered=void 0,a&&(o[c]=a)),e.result}},simulate:function(e,t,n){var o=C.extend(new C.Event,n,{type:e,isSimulated:!0});C.event.trigger(o,null,t)}}),C.fn.extend({trigger:function(e,t){return this.each((function(){C.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return C.event.trigger(e,t,n,!0)}}),g.focusin||C.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){C.event.simulate(t,e.target,C.event.fix(e))};C.event.special[t]={setup:function(){var o=this.ownerDocument||this.document||this,i=J.access(o,t);i||o.addEventListener(e,n,!0),J.access(o,t,(i||0)+1)},teardown:function(){var o=this.ownerDocument||this.document||this,i=J.access(o,t)-1;i?J.access(o,t,i):(o.removeEventListener(e,n,!0),J.remove(o,t))}}}));var Tt=n.location,kt={guid:Date.now()},St=/\?/;C.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||C.error("Invalid XML: "+e),t};var Et=/\[\]$/,Dt=/\r?\n/g,Pt=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function At(e,t,n,o){var i;if(Array.isArray(t))C.each(t,(function(t,i){n||Et.test(e)?o(e,i):At(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,o)}));else if(n||"object"!==_(t))o(e,t);else for(i in t)At(e+"["+i+"]",t[i],n,o)}C.param=function(e,t){var n,o=[],i=function(e,t){var n=v(t)?t():t;o[o.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!C.isPlainObject(e))C.each(e,(function(){i(this.name,this.value)}));else for(n in e)At(n,e[n],t,i);return o.join("&")},C.fn.extend({serialize:function(){return C.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=C.prop(this,"elements");return e?C.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!C(this).is(":disabled")&&Nt.test(this.nodeName)&&!Pt.test(e)&&(this.checked||!me.test(e))})).map((function(e,t){var n=C(this).val();return null==n?null:Array.isArray(n)?C.map(n,(function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}})):{name:t.name,value:n.replace(Dt,"\r\n")}})).get()}});var Ht=/%20/g,Mt=/#.*$/,jt=/([?&])_=[^&]*/,Lt=/^(.*?):[ \t]*([^\r\n]*)$/gm,It=/^(?:GET|HEAD)$/,Ot=/^\/\//,qt={},Rt={},Ft="*/".concat("*"),Wt=b.createElement("a");function Bt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var o,i=0,r=t.toLowerCase().match(O)||[];if(v(n))for(;o=r[i++];)"+"===o[0]?(o=o.slice(1)||"*",(e[o]=e[o]||[]).unshift(n)):(e[o]=e[o]||[]).push(n)}}function $t(e,t,n,o){var i={},r=e===Rt;function s(a){var l;return i[a]=!0,C.each(e[a]||[],(function(e,a){var c=a(t,n,o);return"string"!=typeof c||r||i[c]?r?!(l=c):void 0:(t.dataTypes.unshift(c),s(c),!1)})),l}return s(t.dataTypes[0])||!i["*"]&&s("*")}function Ut(e,t){var n,o,i=C.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:o||(o={}))[n]=t[n]);return o&&C.extend(!0,e,o),e}Wt.href=Tt.href,C.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ft,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":C.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ut(Ut(e,C.ajaxSettings),t):Ut(C.ajaxSettings,e)},ajaxPrefilter:Bt(qt),ajaxTransport:Bt(Rt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var o,i,r,s,a,l,c,u,p,d,f=C.ajaxSetup({},t),h=f.context||f,m=f.context&&(h.nodeType||h.jquery)?C(h):C.event,g=C.Deferred(),v=C.Callbacks("once memory"),y=f.statusCode||{},x={},w={},_="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s)for(s={};t=Lt.exec(r);)s[t[1].toLowerCase()+" "]=(s[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=s[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?r:null},setRequestHeader:function(e,t){return null==c&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==c&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)T.always(e[T.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||_;return o&&o.abort(t),k(0,t),this}};if(g.promise(T),f.url=((e||f.url||Tt.href)+"").replace(Ot,Tt.protocol+"//"),f.type=t.method||t.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(O)||[""],null==f.crossDomain){l=b.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Wt.protocol+"//"+Wt.host!=l.protocol+"//"+l.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=C.param(f.data,f.traditional)),$t(qt,f,t,T),c)return T;for(p in(u=C.event&&f.global)&&0==C.active++&&C.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!It.test(f.type),i=f.url.replace(Mt,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Ht,"+")):(d=f.url.slice(i.length),f.data&&(f.processData||"string"==typeof f.data)&&(i+=(St.test(i)?"&":"?")+f.data,delete f.data),!1===f.cache&&(i=i.replace(jt,"$1"),d=(St.test(i)?"&":"?")+"_="+kt.guid+++d),f.url=i+d),f.ifModified&&(C.lastModified[i]&&T.setRequestHeader("If-Modified-Since",C.lastModified[i]),C.etag[i]&&T.setRequestHeader("If-None-Match",C.etag[i])),(f.data&&f.hasContent&&!1!==f.contentType||t.contentType)&&T.setRequestHeader("Content-Type",f.contentType),T.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Ft+"; q=0.01":""):f.accepts["*"]),f.headers)T.setRequestHeader(p,f.headers[p]);if(f.beforeSend&&(!1===f.beforeSend.call(h,T,f)||c))return T.abort();if(_="abort",v.add(f.complete),T.done(f.success),T.fail(f.error),o=$t(Rt,f,t,T)){if(T.readyState=1,u&&m.trigger("ajaxSend",[T,f]),c)return T;f.async&&f.timeout>0&&(a=n.setTimeout((function(){T.abort("timeout")}),f.timeout));try{c=!1,o.send(x,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(e,t,s,l){var p,d,b,x,w,_=t;c||(c=!0,a&&n.clearTimeout(a),o=void 0,r=l||"",T.readyState=e>0?4:0,p=e>=200&&e<300||304===e,s&&(x=function(e,t,n){for(var o,i,r,s,a=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===o&&(o=e.mimeType||t.getResponseHeader("Content-Type"));if(o)for(i in a)if(a[i]&&a[i].test(o)){l.unshift(i);break}if(l[0]in n)r=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){r=i;break}s||(s=i)}r=r||s}if(r)return r!==l[0]&&l.unshift(r),n[r]}(f,T,s)),!p&&C.inArray("script",f.dataTypes)>-1&&(f.converters["text script"]=function(){}),x=function(e,t,n,o){var i,r,s,a,l,c={},u=e.dataTypes.slice();if(u[1])for(s in e.converters)c[s.toLowerCase()]=e.converters[s];for(r=u.shift();r;)if(e.responseFields[r]&&(n[e.responseFields[r]]=t),!l&&o&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=r,r=u.shift())if("*"===r)r=l;else if("*"!==l&&l!==r){if(!(s=c[l+" "+r]||c["* "+r]))for(i in c)if((a=i.split(" "))[1]===r&&(s=c[l+" "+a[0]]||c["* "+a[0]])){!0===s?s=c[i]:!0!==c[i]&&(r=a[0],u.unshift(a[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(e){return{state:"parsererror",error:s?e:"No conversion from "+l+" to "+r}}}return{state:"success",data:t}}(f,x,T,p),p?(f.ifModified&&((w=T.getResponseHeader("Last-Modified"))&&(C.lastModified[i]=w),(w=T.getResponseHeader("etag"))&&(C.etag[i]=w)),204===e||"HEAD"===f.type?_="nocontent":304===e?_="notmodified":(_=x.state,d=x.data,p=!(b=x.error))):(b=_,!e&&_||(_="error",e<0&&(e=0))),T.status=e,T.statusText=(t||_)+"",p?g.resolveWith(h,[d,_,T]):g.rejectWith(h,[T,_,b]),T.statusCode(y),y=void 0,u&&m.trigger(p?"ajaxSuccess":"ajaxError",[T,f,p?d:b]),v.fireWith(h,[T,_]),u&&(m.trigger("ajaxComplete",[T,f]),--C.active||C.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return C.get(e,t,n,"json")},getScript:function(e,t){return C.get(e,void 0,t,"script")}}),C.each(["get","post"],(function(e,t){C[t]=function(e,n,o,i){return v(n)&&(i=i||o,o=n,n=void 0),C.ajax(C.extend({url:e,type:t,dataType:i,data:n,success:o},C.isPlainObject(e)&&e))}})),C.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),C._evalUrl=function(e,t,n){return C.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){C.globalEval(e,t,n)}})},C.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=C(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return v(e)?this.each((function(t){C(this).wrapInner(e.call(this,t))})):this.each((function(){var t=C(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=v(e);return this.each((function(n){C(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){C(this).replaceWith(this.childNodes)})),this}}),C.expr.pseudos.hidden=function(e){return!C.expr.pseudos.visible(e)},C.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},C.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var zt={0:200,1223:204},Xt=C.ajaxSettings.xhr();g.cors=!!Xt&&"withCredentials"in Xt,g.ajax=Xt=!!Xt,C.ajaxTransport((function(e){var t,o;if(g.cors||Xt&&!e.crossDomain)return{send:function(i,r){var s,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(s in e.xhrFields)a[s]=e.xhrFields[s];for(s in e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(s,i[s]);t=function(e){return function(){t&&(t=o=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?r(0,"error"):r(a.status,a.statusText):r(zt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=t(),o=a.onerror=a.ontimeout=t("error"),void 0!==a.onabort?a.onabort=o:a.onreadystatechange=function(){4===a.readyState&&n.setTimeout((function(){t&&o()}))},t=t("abort");try{a.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),C.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),C.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return C.globalEval(e),e}}}),C.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),C.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(o,i){t=C("