@covet-pics/covet-pics-widget 0.168.0 → 0.168.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/covet-pics-widget.cjs.entry.js +22 -7
- package/dist/cjs/covet-pics-widget.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/covet-pics-widget/covet-pics-widget.js +24 -2
- package/dist/collection/services/gallery-loader-service.js +7 -2
- package/dist/collection/store/url.js +11 -4
- package/dist/covet-pics-widget/covet-pics-widget.esm.js +1 -1
- package/dist/covet-pics-widget/p-5ae26b01.entry.js +4 -0
- package/dist/esm/covet-pics-widget.entry.js +22 -7
- package/dist/esm/covet-pics-widget.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/covet-pics-widget/covet-pics-widget.d.ts +4 -0
- package/dist/types/components.d.ts +8 -0
- package/dist/types/services/gallery-loader-service.d.ts +2 -1
- package/dist/types/store/url.d.ts +2 -1
- package/package.json +1 -1
- package/dist/covet-pics-widget/p-309600e2.entry.js +0 -4
|
@@ -14,7 +14,7 @@ var getters = require('./getters-D8jVc2zI.js');
|
|
|
14
14
|
const STANDARD_GALLERY_URL = "/api/v1/embed/:id";
|
|
15
15
|
const PRODUCT_GALLERY_URL = "/api/v1/shop/:shop/product/:handle";
|
|
16
16
|
class GalleryLoaderService {
|
|
17
|
-
constructor(env, previewMode) {
|
|
17
|
+
constructor(env, previewMode, customUrl) {
|
|
18
18
|
this.page = 0;
|
|
19
19
|
this.isLoading = false;
|
|
20
20
|
this.totalPages = 1;
|
|
@@ -25,6 +25,8 @@ class GalleryLoaderService {
|
|
|
25
25
|
this.sortType = "";
|
|
26
26
|
this._customSettings = {};
|
|
27
27
|
this._selectedFilters = [];
|
|
28
|
+
// _customUrl can be either a string OR null, defaults to null
|
|
29
|
+
this._customUrl = null;
|
|
28
30
|
this._environment = "production";
|
|
29
31
|
if (typeof previewMode === "boolean") {
|
|
30
32
|
this.previewMode = previewMode;
|
|
@@ -32,9 +34,12 @@ class GalleryLoaderService {
|
|
|
32
34
|
if (typeof env === "string" && Object.keys(utils.BASE_API_URLS).includes(env)) {
|
|
33
35
|
this._environment = env;
|
|
34
36
|
}
|
|
37
|
+
if (typeof customUrl === "string" && customUrl) {
|
|
38
|
+
this._customUrl = customUrl;
|
|
39
|
+
}
|
|
35
40
|
}
|
|
36
41
|
get baseUrl() {
|
|
37
|
-
return utils.BASE_API_URLS[this._environment];
|
|
42
|
+
return this._customUrl || utils.BASE_API_URLS[this._environment];
|
|
38
43
|
}
|
|
39
44
|
// returns `standard_gallery` or `product_gallery`
|
|
40
45
|
get galleryType() {
|
|
@@ -695,7 +700,8 @@ const slice$4 = popup.createSlice({
|
|
|
695
700
|
initialState: {
|
|
696
701
|
baseUrl: "",
|
|
697
702
|
environment: "",
|
|
698
|
-
baseBeaconsUrl: ""
|
|
703
|
+
baseBeaconsUrl: "",
|
|
704
|
+
customUrl: null
|
|
699
705
|
},
|
|
700
706
|
reducers: {
|
|
701
707
|
setEnvironment: (url, action) => {
|
|
@@ -703,13 +709,19 @@ const slice$4 = popup.createSlice({
|
|
|
703
709
|
typeof env === "string" && Object.keys(BASE_API_URLS).includes(env)
|
|
704
710
|
? url.environment = env
|
|
705
711
|
: url.environment = "production";
|
|
706
|
-
url.baseUrl = BASE_API_URLS[url.environment];
|
|
707
|
-
url.baseBeaconsUrl = `${
|
|
712
|
+
url.baseUrl = url.customUrl || BASE_API_URLS[url.environment];
|
|
713
|
+
url.baseBeaconsUrl = `${url.baseUrl}${BEACONS_URL}/`;
|
|
714
|
+
return url;
|
|
715
|
+
},
|
|
716
|
+
setCustomUrl: (url, action) => {
|
|
717
|
+
url.customUrl = action.payload || null;
|
|
718
|
+
url.baseUrl = url.customUrl || BASE_API_URLS[url.environment];
|
|
719
|
+
url.baseBeaconsUrl = `${url.baseUrl}${BEACONS_URL}/`;
|
|
708
720
|
return url;
|
|
709
721
|
},
|
|
710
722
|
}
|
|
711
723
|
});
|
|
712
|
-
const { setEnvironment } = slice$4.actions;
|
|
724
|
+
const { setEnvironment, setCustomUrl } = slice$4.actions;
|
|
713
725
|
var urlReducer = slice$4.reducer;
|
|
714
726
|
|
|
715
727
|
const slice$3 = popup.createSlice({
|
|
@@ -1123,6 +1135,9 @@ const CovetPicsWidget = class {
|
|
|
1123
1135
|
this.appStore = configureStore();
|
|
1124
1136
|
const widgetIdParams = storeUtils.getWidgetId(this.galleryEmbedId, this.shop, this.photoRequestId, this.el);
|
|
1125
1137
|
this.appStore.dispatch(widgetIdUpdated(widgetIdParams));
|
|
1138
|
+
if (this.baseUrl) {
|
|
1139
|
+
this.appStore.dispatch(setCustomUrl(this.baseUrl));
|
|
1140
|
+
}
|
|
1126
1141
|
this.appStore.dispatch(setEnvironment(this.environment));
|
|
1127
1142
|
this.appStore.dispatch(setPreviewMode(this.previewMode));
|
|
1128
1143
|
this.appState = this.appStore.getState();
|
|
@@ -1133,7 +1148,7 @@ const CovetPicsWidget = class {
|
|
|
1133
1148
|
}
|
|
1134
1149
|
setupLoader() {
|
|
1135
1150
|
const uri = window.location;
|
|
1136
|
-
this.loader = new GalleryLoaderService(this.environment, this.previewMode);
|
|
1151
|
+
this.loader = new GalleryLoaderService(this.environment, this.previewMode, this.baseUrl);
|
|
1137
1152
|
if (typeof this.customSettings === "string") {
|
|
1138
1153
|
this.loader.setCustomSettings(JSON.parse(this.customSettings));
|
|
1139
1154
|
}
|
|
@@ -22,7 +22,7 @@ var patchBrowser = () => {
|
|
|
22
22
|
|
|
23
23
|
patchBrowser().then(async (options) => {
|
|
24
24
|
await appGlobals.globalScripts();
|
|
25
|
-
return index.bootstrapLazy([["covet-pics-post.cjs",[[1,"covet-pics-post",{"postId":[2,"post-id"],"environment":[1],"item":[32],"fetchingError":[32]}]]],["covet-pics-crop-text.cjs",[[0,"covet-pics-crop-text",{"text":[1],"textClass":[1,"text-class"],"textColor":[1,"text-color"],"ratio":[16],"cropCSS":[32]}]]],["covet-pics-star-rating.cjs",[[1,"covet-pics-star-rating",{"rating":[2],"ratingCount":[2,"rating-count"],"starColor":[1,"star-color"],"emptyStarColor":[1,"empty-star-color"],"starBorderColor":[1,"star-border-color"],"starBorderWidth":[2,"star-border-width"],"starSize":[2,"star-size"],"spaceStars":[2,"space-stars"],"spaceStarsText":[2,"space-stars-text"],"showLabel":[4,"show-label"],"label":[1]}]]],["covet-pics-highlighted-hotspots_2.cjs",[[0,"covet-pics-highlighted-page",{"thumbnailUrl":[1,"thumbnail-url"],"thumbnailAlt":[1,"thumbnail-alt"],"ariaLabel":[1,"aria-label"],"thumbnailLayout":[1,"thumbnail-layout"],"videoUrl":[1,"video-url"],"videoPoster":[1,"video-poster"],"thumbnailCarouselImages":[16,"thumbnail-carousel-images"],"productLinks":[16,"product-links"],"productBaseImgAlt":[1,"product-base-img-alt"],"reverseClass":[1,"reverse-class"],"isMobile":[4,"is-mobile"],"pageIndex":[2,"page-index"],"caption":[1],"rating":[2],"createdTime":[1,"created-time"],"userName":[1,"user-name"],"mainSliderIndex":[2,"main-slider-index"],"pageId":[2,"page-id"],"appStore":[16,"app-store"],"hideHotspots":[32],"activeProductIndex":[32],"hoverHotspot":[32]},[[0,"changeActiveHotspot","onChangeActiveHotspot"]]],[0,"covet-pics-highlighted-hotspots",{"links":[16],"activeHotspot":[2,"active-hotspot"],"thumbnailUrl":[1,"thumbnail-url"],"hoverHotspot":[2,"hover-hotspot"],"isMobile":[4,"is-mobile"],"productBaseImgAlt":[1,"product-base-img-alt"],"pageId":[2,"page-id"],"appStore":[16,"app-store"]},null,{"thumbnailUrl":["refreshHotspot"],"activeHotspot":["activeHotspotHandler"]}]]],["covet-pics-popup-freeflow-carousel_2.cjs",[[0,"covet-pics-popup-freeflow-carousel",{"item":[16],"isEnabled":[4,"is-enabled"],"dataLoaded":[1,"data-loaded"],"sliderIndex":[32],"videoPlay":[64],"videoPause":[64],"videoSoundOn":[64],"videoSoundOff":[64],"pauseAllVideos":[64]},null,{"isEnabled":["enableSlider"],"dataLoaded":["lazyLoadMedia"],"sliderIndex":["updateSliderIndex"]}],[1,"covet-pics-popup-freeflow-links",{"links":[16],"itemCreatedTime":[1,"item-created-time"],"isSliderEnabled":[4,"is-slider-enabled"]},null,{"isSliderEnabled":["enableSlider"]}]]],["covet-pics-direct-buy_7.cjs",[[0,"covet-pics-popup-slide",{"item":[16],"showCaption":[4,"show-caption"],"showStarRating":[4,"show-star-rating"],"dataLoaded":[32],"isPlaying":[32],"isMuted":[32],"carouselIndex":[32],"videoProgress":[32],"showCarouselVideoControls":[32],"loadMedia":[64],"videoPlay":[64],"videoPause":[64],"videoSoundOff":[64],"videoSoundOn":[64]}],[1,"covet-pics-direct-buy",{"product":[8],"moneyFormat":[1,"money-format"],"appStore":[16,"app-store"],"selectedOptions":[32],"settings":[32]}],[0,"covet-pics-hotspots",{"links":[16],"backgroundColor":[1,"background-color"],"textColor":[1,"text-color"],"showNumbers":[4,"show-numbers"]},[[0,"linkInactivate","linkInactivateHandler"],[0,"linkActivate","linkActivateHandler"]]],[0,"covet-pics-popup-links",{"links":[16],"greyBorderClass":[1,"grey-border-class"],"itemCreatedTime":[1,"item-created-time"],"appStore":[16,"app-store"],"settings":[32]}],[0,"covet-pics-popup-review",{"rating":[2],"caption":[1],"username":[1],"itemType":[1,"item-type"],"verified":[4],"createdTime":[1,"created-time"],"reviewCSS":[32]},null,{"caption":["watchPropHandler"]}],[0,"covet-pics-popup-shared-links",{"item":[16],"galleryEmbedId":[2,"gallery-embed-id"],"showShareLink":[32],"copyLinkCopied":[32]}],[0,"covet-pics-popup-slider",{"item":[16],"getSwiperState":[64]}]]],["covet-pics-gallery-header_6.cjs",[[0,"covet-pics-gallery-header",{"rating":[2],"productTitle":[1,"product-title"],"breakdown":[16],"appStore":[16,"app-store"],"showBreakdownDropdown":[32],"showSortDropdown":[32],"isDesktopScreen":[32]}],[1,"covet-pics-popup",{"appStore":[16,"app-store"],"item":[32],"product":[32],"directBuyIsOpen":[32],"popupTabIndex":[32],"settings":[32],"isPreviousEnable":[32],"isNextEnable":[32],"openPopup":[64],"closePopup":[64]},[[4,"addToCart:covetPics","addToCartHandler"],[16,"productLinkClicked","productLinkClickedHandler"]],{"item":["itemChangedHandler"]}],[1,"covet-pics-popup-freeflow",{"appStore":[16,"app-store"],"settings":[32],"items":[32],"sliderIndex":[32],"tabIndex":[32],"openPopupFreeflow":[64],"closePopupFreeflow":[64]},null,{"sliderIndex":["updateSliderIndex"],"items":["updateItems"]}],[0,"covet-pics-gallery-item",{"altTag":[1,"alt-tag"],"highlighted":[4],"imageUrl":[1,"image-url"],"rating":[2],"itemWidth":[2,"item-width"],"userName":[1,"user-name"],"createdTime":[1,"created-time"],"caption":[1],"itemType":[1,"item-type"],"imageHighResolutionUrl":[1,"image-high-resolution-url"],"imageResponsiveSizes":[1,"image-responsive-sizes"],"itemId":[1,"item-id"],"itemSource":[1,"item-source"],"links":[16],"url":[1],"videoUrl":[1,"video-url"],"itemIndex":[2,"item-index"],"itemSize":[1,"item-size"],"appStore":[16,"app-store"],"tabIndex":[32],"sliderIndex":[32],"showImageAsVideoPoster":[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"]],{"sliderIndex":["autoPlayVideos"]}],[0,"covet-pics-gallery-item-detail",{"altTag":[1,"alt-tag"],"highlighted":[4],"verified":[4],"imageUrl":[1,"image-url"],"imageHighResolutionUrl":[1,"image-high-resolution-url"],"imageResponsiveSizes":[1,"image-responsive-sizes"],"videoUrl":[1,"video-url"],"itemId":[1,"item-id"],"itemSource":[1,"item-source"],"itemType":[1,"item-type"],"links":[16],"url":[1],"rating":[2],"userName":[1,"user-name"],"caption":[1],"createdTime":[1,"created-time"],"itemIndex":[2,"item-index"],"itemSize":[1,"item-size"],"appStore":[16,"app-store"],"tabIndex":[32],"captionCSS":[32],"reviewClass":[32],"starOnlyClass":[32],"highlightedClass":[32],"sliderIndex":[32],"showImageAsVideoPoster":[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"],[8,"elementResize","elementResizeHandler"]],{"sliderIndex":["autoPlayVideos"]}],[1,"covet-pics-upload",{"standalone":[4],"appStore":[16,"app-store"],"starRating":[32],"isFormValid":[32],"showFormWarning":[32],"thumbnailLinks":[32],"toShowLinks":[32],"dropedImagesNumber":[32],"isAnimating":[32],"notificationMessage":[32],"isNotificationActive":[32],"widgetWidth":[32],"uploadTabIndex":[32],"openUpload":[64]}]]],["covet-pics-gallery-grid_3.cjs",[[0,"covet-pics-gallery-grid",{"items":[16],"breakdown":[16],"productTitle":[1,"product-title"],"rating":[2],"filtersEnabled":[4,"filters-enabled"],"filters":[16],"showLoadMore":[4,"show-load-more"],"appStore":[16,"app-store"],"sharedItemId":[1,"shared-item-id"],"showSort":[32],"isGridDisabled":[32],"isDesktopScreen":[32],"itemSize":[32],"isFilterModalShow":[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[9,"mousedown","handleClickOutside"],[0,"itemLoaded","handleItemLoaded"]],{"items":["itemsChangeHandler"]}],[0,"covet-pics-gallery-slider",{"items":[16],"sharedItemId":[1,"shared-item-id"],"sliderStyle":[1,"slider-style"],"appStore":[16,"app-store"],"itemSize":[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[0,"itemLoaded","handleItemLoaded"]],{"items":["itemsChangeHandler"]}],[0,"covet-pics-highlighted",{"numberOfPages":[2,"number-of-pages"],"items":[16],"appStore":[16,"app-store"],"productLinks":[32],"mainSliderIndex":[32],"mainSliderAnimatingSlides":[32],"windowHeight":[32],"isDesktopScreen":[32]},[[0,"pageLoaded","handleItemLoaded"]]]]],["covet-pics-widget.cjs",[[1,"covet-pics-widget",{"shop":[1],"galleryEmbedId":[2,"gallery-embed-id"],"shopifyProductId":[2,"shopify-product-id"],"environment":[1],"customSettings":[1,"custom-settings"],"hideElements":[1,"hide-elements"],"previewMode":[4,"preview-mode"],"photoRequestId":[2,"photo-request-id"],"lazyLoad":[4,"lazy-load"],"isLoading":[32],"minNumberOfPhotos":[32],"items":[32],"appStore":[32],"fetchingError":[32],"updateUploadWidgetCoverPreview":[64],"updatePreviewSettings":[64]},[[0,"sortUpdated","sortUpdatedHandler"],[0,"filtersUpdated","filtersUpdatedHandler"],[0,"nextPage","nextPageHandler"],[4,"popupFreeflowNextPage","nextPageHandlerFreeflow"]]]]]], options);
|
|
25
|
+
return index.bootstrapLazy([["covet-pics-post.cjs",[[1,"covet-pics-post",{"postId":[2,"post-id"],"environment":[1],"item":[32],"fetchingError":[32]}]]],["covet-pics-crop-text.cjs",[[0,"covet-pics-crop-text",{"text":[1],"textClass":[1,"text-class"],"textColor":[1,"text-color"],"ratio":[16],"cropCSS":[32]}]]],["covet-pics-star-rating.cjs",[[1,"covet-pics-star-rating",{"rating":[2],"ratingCount":[2,"rating-count"],"starColor":[1,"star-color"],"emptyStarColor":[1,"empty-star-color"],"starBorderColor":[1,"star-border-color"],"starBorderWidth":[2,"star-border-width"],"starSize":[2,"star-size"],"spaceStars":[2,"space-stars"],"spaceStarsText":[2,"space-stars-text"],"showLabel":[4,"show-label"],"label":[1]}]]],["covet-pics-highlighted-hotspots_2.cjs",[[0,"covet-pics-highlighted-page",{"thumbnailUrl":[1,"thumbnail-url"],"thumbnailAlt":[1,"thumbnail-alt"],"ariaLabel":[1,"aria-label"],"thumbnailLayout":[1,"thumbnail-layout"],"videoUrl":[1,"video-url"],"videoPoster":[1,"video-poster"],"thumbnailCarouselImages":[16,"thumbnail-carousel-images"],"productLinks":[16,"product-links"],"productBaseImgAlt":[1,"product-base-img-alt"],"reverseClass":[1,"reverse-class"],"isMobile":[4,"is-mobile"],"pageIndex":[2,"page-index"],"caption":[1],"rating":[2],"createdTime":[1,"created-time"],"userName":[1,"user-name"],"mainSliderIndex":[2,"main-slider-index"],"pageId":[2,"page-id"],"appStore":[16,"app-store"],"hideHotspots":[32],"activeProductIndex":[32],"hoverHotspot":[32]},[[0,"changeActiveHotspot","onChangeActiveHotspot"]]],[0,"covet-pics-highlighted-hotspots",{"links":[16],"activeHotspot":[2,"active-hotspot"],"thumbnailUrl":[1,"thumbnail-url"],"hoverHotspot":[2,"hover-hotspot"],"isMobile":[4,"is-mobile"],"productBaseImgAlt":[1,"product-base-img-alt"],"pageId":[2,"page-id"],"appStore":[16,"app-store"]},null,{"thumbnailUrl":["refreshHotspot"],"activeHotspot":["activeHotspotHandler"]}]]],["covet-pics-popup-freeflow-carousel_2.cjs",[[0,"covet-pics-popup-freeflow-carousel",{"item":[16],"isEnabled":[4,"is-enabled"],"dataLoaded":[1,"data-loaded"],"sliderIndex":[32],"videoPlay":[64],"videoPause":[64],"videoSoundOn":[64],"videoSoundOff":[64],"pauseAllVideos":[64]},null,{"isEnabled":["enableSlider"],"dataLoaded":["lazyLoadMedia"],"sliderIndex":["updateSliderIndex"]}],[1,"covet-pics-popup-freeflow-links",{"links":[16],"itemCreatedTime":[1,"item-created-time"],"isSliderEnabled":[4,"is-slider-enabled"]},null,{"isSliderEnabled":["enableSlider"]}]]],["covet-pics-direct-buy_7.cjs",[[0,"covet-pics-popup-slide",{"item":[16],"showCaption":[4,"show-caption"],"showStarRating":[4,"show-star-rating"],"dataLoaded":[32],"isPlaying":[32],"isMuted":[32],"carouselIndex":[32],"videoProgress":[32],"showCarouselVideoControls":[32],"loadMedia":[64],"videoPlay":[64],"videoPause":[64],"videoSoundOff":[64],"videoSoundOn":[64]}],[1,"covet-pics-direct-buy",{"product":[8],"moneyFormat":[1,"money-format"],"appStore":[16,"app-store"],"selectedOptions":[32],"settings":[32]}],[0,"covet-pics-hotspots",{"links":[16],"backgroundColor":[1,"background-color"],"textColor":[1,"text-color"],"showNumbers":[4,"show-numbers"]},[[0,"linkInactivate","linkInactivateHandler"],[0,"linkActivate","linkActivateHandler"]]],[0,"covet-pics-popup-links",{"links":[16],"greyBorderClass":[1,"grey-border-class"],"itemCreatedTime":[1,"item-created-time"],"appStore":[16,"app-store"],"settings":[32]}],[0,"covet-pics-popup-review",{"rating":[2],"caption":[1],"username":[1],"itemType":[1,"item-type"],"verified":[4],"createdTime":[1,"created-time"],"reviewCSS":[32]},null,{"caption":["watchPropHandler"]}],[0,"covet-pics-popup-shared-links",{"item":[16],"galleryEmbedId":[2,"gallery-embed-id"],"showShareLink":[32],"copyLinkCopied":[32]}],[0,"covet-pics-popup-slider",{"item":[16],"getSwiperState":[64]}]]],["covet-pics-gallery-header_6.cjs",[[0,"covet-pics-gallery-header",{"rating":[2],"productTitle":[1,"product-title"],"breakdown":[16],"appStore":[16,"app-store"],"showBreakdownDropdown":[32],"showSortDropdown":[32],"isDesktopScreen":[32]}],[1,"covet-pics-popup",{"appStore":[16,"app-store"],"item":[32],"product":[32],"directBuyIsOpen":[32],"popupTabIndex":[32],"settings":[32],"isPreviousEnable":[32],"isNextEnable":[32],"openPopup":[64],"closePopup":[64]},[[4,"addToCart:covetPics","addToCartHandler"],[16,"productLinkClicked","productLinkClickedHandler"]],{"item":["itemChangedHandler"]}],[1,"covet-pics-popup-freeflow",{"appStore":[16,"app-store"],"settings":[32],"items":[32],"sliderIndex":[32],"tabIndex":[32],"openPopupFreeflow":[64],"closePopupFreeflow":[64]},null,{"sliderIndex":["updateSliderIndex"],"items":["updateItems"]}],[0,"covet-pics-gallery-item",{"altTag":[1,"alt-tag"],"highlighted":[4],"imageUrl":[1,"image-url"],"rating":[2],"itemWidth":[2,"item-width"],"userName":[1,"user-name"],"createdTime":[1,"created-time"],"caption":[1],"itemType":[1,"item-type"],"imageHighResolutionUrl":[1,"image-high-resolution-url"],"imageResponsiveSizes":[1,"image-responsive-sizes"],"itemId":[1,"item-id"],"itemSource":[1,"item-source"],"links":[16],"url":[1],"videoUrl":[1,"video-url"],"itemIndex":[2,"item-index"],"itemSize":[1,"item-size"],"appStore":[16,"app-store"],"tabIndex":[32],"sliderIndex":[32],"showImageAsVideoPoster":[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"]],{"sliderIndex":["autoPlayVideos"]}],[0,"covet-pics-gallery-item-detail",{"altTag":[1,"alt-tag"],"highlighted":[4],"verified":[4],"imageUrl":[1,"image-url"],"imageHighResolutionUrl":[1,"image-high-resolution-url"],"imageResponsiveSizes":[1,"image-responsive-sizes"],"videoUrl":[1,"video-url"],"itemId":[1,"item-id"],"itemSource":[1,"item-source"],"itemType":[1,"item-type"],"links":[16],"url":[1],"rating":[2],"userName":[1,"user-name"],"caption":[1],"createdTime":[1,"created-time"],"itemIndex":[2,"item-index"],"itemSize":[1,"item-size"],"appStore":[16,"app-store"],"tabIndex":[32],"captionCSS":[32],"reviewClass":[32],"starOnlyClass":[32],"highlightedClass":[32],"sliderIndex":[32],"showImageAsVideoPoster":[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"],[8,"elementResize","elementResizeHandler"]],{"sliderIndex":["autoPlayVideos"]}],[1,"covet-pics-upload",{"standalone":[4],"appStore":[16,"app-store"],"starRating":[32],"isFormValid":[32],"showFormWarning":[32],"thumbnailLinks":[32],"toShowLinks":[32],"dropedImagesNumber":[32],"isAnimating":[32],"notificationMessage":[32],"isNotificationActive":[32],"widgetWidth":[32],"uploadTabIndex":[32],"openUpload":[64]}]]],["covet-pics-gallery-grid_3.cjs",[[0,"covet-pics-gallery-grid",{"items":[16],"breakdown":[16],"productTitle":[1,"product-title"],"rating":[2],"filtersEnabled":[4,"filters-enabled"],"filters":[16],"showLoadMore":[4,"show-load-more"],"appStore":[16,"app-store"],"sharedItemId":[1,"shared-item-id"],"showSort":[32],"isGridDisabled":[32],"isDesktopScreen":[32],"itemSize":[32],"isFilterModalShow":[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[9,"mousedown","handleClickOutside"],[0,"itemLoaded","handleItemLoaded"]],{"items":["itemsChangeHandler"]}],[0,"covet-pics-gallery-slider",{"items":[16],"sharedItemId":[1,"shared-item-id"],"sliderStyle":[1,"slider-style"],"appStore":[16,"app-store"],"itemSize":[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[0,"itemLoaded","handleItemLoaded"]],{"items":["itemsChangeHandler"]}],[0,"covet-pics-highlighted",{"numberOfPages":[2,"number-of-pages"],"items":[16],"appStore":[16,"app-store"],"productLinks":[32],"mainSliderIndex":[32],"mainSliderAnimatingSlides":[32],"windowHeight":[32],"isDesktopScreen":[32]},[[0,"pageLoaded","handleItemLoaded"]]]]],["covet-pics-widget.cjs",[[1,"covet-pics-widget",{"shop":[1],"galleryEmbedId":[2,"gallery-embed-id"],"shopifyProductId":[2,"shopify-product-id"],"environment":[1],"baseUrl":[1,"base-url"],"customSettings":[1,"custom-settings"],"hideElements":[1,"hide-elements"],"previewMode":[4,"preview-mode"],"photoRequestId":[2,"photo-request-id"],"lazyLoad":[4,"lazy-load"],"isLoading":[32],"minNumberOfPhotos":[32],"items":[32],"appStore":[32],"fetchingError":[32],"updateUploadWidgetCoverPreview":[64],"updatePreviewSettings":[64]},[[0,"sortUpdated","sortUpdatedHandler"],[0,"filtersUpdated","filtersUpdatedHandler"],[0,"nextPage","nextPageHandler"],[4,"popupFreeflowNextPage","nextPageHandlerFreeflow"]]]]]], options);
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
exports.setNonce = index.setNonce;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -9,7 +9,7 @@ var appGlobals = require('./app-globals-eqDkvgYO.js');
|
|
|
9
9
|
const defineCustomElements = async (win, options) => {
|
|
10
10
|
if (typeof window === 'undefined') return undefined;
|
|
11
11
|
await appGlobals.globalScripts();
|
|
12
|
-
return index.bootstrapLazy([["covet-pics-post.cjs",[[1,"covet-pics-post",{"postId":[2,"post-id"],"environment":[1],"item":[32],"fetchingError":[32]}]]],["covet-pics-crop-text.cjs",[[0,"covet-pics-crop-text",{"text":[1],"textClass":[1,"text-class"],"textColor":[1,"text-color"],"ratio":[16],"cropCSS":[32]}]]],["covet-pics-star-rating.cjs",[[1,"covet-pics-star-rating",{"rating":[2],"ratingCount":[2,"rating-count"],"starColor":[1,"star-color"],"emptyStarColor":[1,"empty-star-color"],"starBorderColor":[1,"star-border-color"],"starBorderWidth":[2,"star-border-width"],"starSize":[2,"star-size"],"spaceStars":[2,"space-stars"],"spaceStarsText":[2,"space-stars-text"],"showLabel":[4,"show-label"],"label":[1]}]]],["covet-pics-highlighted-hotspots_2.cjs",[[0,"covet-pics-highlighted-page",{"thumbnailUrl":[1,"thumbnail-url"],"thumbnailAlt":[1,"thumbnail-alt"],"ariaLabel":[1,"aria-label"],"thumbnailLayout":[1,"thumbnail-layout"],"videoUrl":[1,"video-url"],"videoPoster":[1,"video-poster"],"thumbnailCarouselImages":[16,"thumbnail-carousel-images"],"productLinks":[16,"product-links"],"productBaseImgAlt":[1,"product-base-img-alt"],"reverseClass":[1,"reverse-class"],"isMobile":[4,"is-mobile"],"pageIndex":[2,"page-index"],"caption":[1],"rating":[2],"createdTime":[1,"created-time"],"userName":[1,"user-name"],"mainSliderIndex":[2,"main-slider-index"],"pageId":[2,"page-id"],"appStore":[16,"app-store"],"hideHotspots":[32],"activeProductIndex":[32],"hoverHotspot":[32]},[[0,"changeActiveHotspot","onChangeActiveHotspot"]]],[0,"covet-pics-highlighted-hotspots",{"links":[16],"activeHotspot":[2,"active-hotspot"],"thumbnailUrl":[1,"thumbnail-url"],"hoverHotspot":[2,"hover-hotspot"],"isMobile":[4,"is-mobile"],"productBaseImgAlt":[1,"product-base-img-alt"],"pageId":[2,"page-id"],"appStore":[16,"app-store"]},null,{"thumbnailUrl":["refreshHotspot"],"activeHotspot":["activeHotspotHandler"]}]]],["covet-pics-popup-freeflow-carousel_2.cjs",[[0,"covet-pics-popup-freeflow-carousel",{"item":[16],"isEnabled":[4,"is-enabled"],"dataLoaded":[1,"data-loaded"],"sliderIndex":[32],"videoPlay":[64],"videoPause":[64],"videoSoundOn":[64],"videoSoundOff":[64],"pauseAllVideos":[64]},null,{"isEnabled":["enableSlider"],"dataLoaded":["lazyLoadMedia"],"sliderIndex":["updateSliderIndex"]}],[1,"covet-pics-popup-freeflow-links",{"links":[16],"itemCreatedTime":[1,"item-created-time"],"isSliderEnabled":[4,"is-slider-enabled"]},null,{"isSliderEnabled":["enableSlider"]}]]],["covet-pics-direct-buy_7.cjs",[[0,"covet-pics-popup-slide",{"item":[16],"showCaption":[4,"show-caption"],"showStarRating":[4,"show-star-rating"],"dataLoaded":[32],"isPlaying":[32],"isMuted":[32],"carouselIndex":[32],"videoProgress":[32],"showCarouselVideoControls":[32],"loadMedia":[64],"videoPlay":[64],"videoPause":[64],"videoSoundOff":[64],"videoSoundOn":[64]}],[1,"covet-pics-direct-buy",{"product":[8],"moneyFormat":[1,"money-format"],"appStore":[16,"app-store"],"selectedOptions":[32],"settings":[32]}],[0,"covet-pics-hotspots",{"links":[16],"backgroundColor":[1,"background-color"],"textColor":[1,"text-color"],"showNumbers":[4,"show-numbers"]},[[0,"linkInactivate","linkInactivateHandler"],[0,"linkActivate","linkActivateHandler"]]],[0,"covet-pics-popup-links",{"links":[16],"greyBorderClass":[1,"grey-border-class"],"itemCreatedTime":[1,"item-created-time"],"appStore":[16,"app-store"],"settings":[32]}],[0,"covet-pics-popup-review",{"rating":[2],"caption":[1],"username":[1],"itemType":[1,"item-type"],"verified":[4],"createdTime":[1,"created-time"],"reviewCSS":[32]},null,{"caption":["watchPropHandler"]}],[0,"covet-pics-popup-shared-links",{"item":[16],"galleryEmbedId":[2,"gallery-embed-id"],"showShareLink":[32],"copyLinkCopied":[32]}],[0,"covet-pics-popup-slider",{"item":[16],"getSwiperState":[64]}]]],["covet-pics-gallery-header_6.cjs",[[0,"covet-pics-gallery-header",{"rating":[2],"productTitle":[1,"product-title"],"breakdown":[16],"appStore":[16,"app-store"],"showBreakdownDropdown":[32],"showSortDropdown":[32],"isDesktopScreen":[32]}],[1,"covet-pics-popup",{"appStore":[16,"app-store"],"item":[32],"product":[32],"directBuyIsOpen":[32],"popupTabIndex":[32],"settings":[32],"isPreviousEnable":[32],"isNextEnable":[32],"openPopup":[64],"closePopup":[64]},[[4,"addToCart:covetPics","addToCartHandler"],[16,"productLinkClicked","productLinkClickedHandler"]],{"item":["itemChangedHandler"]}],[1,"covet-pics-popup-freeflow",{"appStore":[16,"app-store"],"settings":[32],"items":[32],"sliderIndex":[32],"tabIndex":[32],"openPopupFreeflow":[64],"closePopupFreeflow":[64]},null,{"sliderIndex":["updateSliderIndex"],"items":["updateItems"]}],[0,"covet-pics-gallery-item",{"altTag":[1,"alt-tag"],"highlighted":[4],"imageUrl":[1,"image-url"],"rating":[2],"itemWidth":[2,"item-width"],"userName":[1,"user-name"],"createdTime":[1,"created-time"],"caption":[1],"itemType":[1,"item-type"],"imageHighResolutionUrl":[1,"image-high-resolution-url"],"imageResponsiveSizes":[1,"image-responsive-sizes"],"itemId":[1,"item-id"],"itemSource":[1,"item-source"],"links":[16],"url":[1],"videoUrl":[1,"video-url"],"itemIndex":[2,"item-index"],"itemSize":[1,"item-size"],"appStore":[16,"app-store"],"tabIndex":[32],"sliderIndex":[32],"showImageAsVideoPoster":[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"]],{"sliderIndex":["autoPlayVideos"]}],[0,"covet-pics-gallery-item-detail",{"altTag":[1,"alt-tag"],"highlighted":[4],"verified":[4],"imageUrl":[1,"image-url"],"imageHighResolutionUrl":[1,"image-high-resolution-url"],"imageResponsiveSizes":[1,"image-responsive-sizes"],"videoUrl":[1,"video-url"],"itemId":[1,"item-id"],"itemSource":[1,"item-source"],"itemType":[1,"item-type"],"links":[16],"url":[1],"rating":[2],"userName":[1,"user-name"],"caption":[1],"createdTime":[1,"created-time"],"itemIndex":[2,"item-index"],"itemSize":[1,"item-size"],"appStore":[16,"app-store"],"tabIndex":[32],"captionCSS":[32],"reviewClass":[32],"starOnlyClass":[32],"highlightedClass":[32],"sliderIndex":[32],"showImageAsVideoPoster":[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"],[8,"elementResize","elementResizeHandler"]],{"sliderIndex":["autoPlayVideos"]}],[1,"covet-pics-upload",{"standalone":[4],"appStore":[16,"app-store"],"starRating":[32],"isFormValid":[32],"showFormWarning":[32],"thumbnailLinks":[32],"toShowLinks":[32],"dropedImagesNumber":[32],"isAnimating":[32],"notificationMessage":[32],"isNotificationActive":[32],"widgetWidth":[32],"uploadTabIndex":[32],"openUpload":[64]}]]],["covet-pics-gallery-grid_3.cjs",[[0,"covet-pics-gallery-grid",{"items":[16],"breakdown":[16],"productTitle":[1,"product-title"],"rating":[2],"filtersEnabled":[4,"filters-enabled"],"filters":[16],"showLoadMore":[4,"show-load-more"],"appStore":[16,"app-store"],"sharedItemId":[1,"shared-item-id"],"showSort":[32],"isGridDisabled":[32],"isDesktopScreen":[32],"itemSize":[32],"isFilterModalShow":[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[9,"mousedown","handleClickOutside"],[0,"itemLoaded","handleItemLoaded"]],{"items":["itemsChangeHandler"]}],[0,"covet-pics-gallery-slider",{"items":[16],"sharedItemId":[1,"shared-item-id"],"sliderStyle":[1,"slider-style"],"appStore":[16,"app-store"],"itemSize":[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[0,"itemLoaded","handleItemLoaded"]],{"items":["itemsChangeHandler"]}],[0,"covet-pics-highlighted",{"numberOfPages":[2,"number-of-pages"],"items":[16],"appStore":[16,"app-store"],"productLinks":[32],"mainSliderIndex":[32],"mainSliderAnimatingSlides":[32],"windowHeight":[32],"isDesktopScreen":[32]},[[0,"pageLoaded","handleItemLoaded"]]]]],["covet-pics-widget.cjs",[[1,"covet-pics-widget",{"shop":[1],"galleryEmbedId":[2,"gallery-embed-id"],"shopifyProductId":[2,"shopify-product-id"],"environment":[1],"customSettings":[1,"custom-settings"],"hideElements":[1,"hide-elements"],"previewMode":[4,"preview-mode"],"photoRequestId":[2,"photo-request-id"],"lazyLoad":[4,"lazy-load"],"isLoading":[32],"minNumberOfPhotos":[32],"items":[32],"appStore":[32],"fetchingError":[32],"updateUploadWidgetCoverPreview":[64],"updatePreviewSettings":[64]},[[0,"sortUpdated","sortUpdatedHandler"],[0,"filtersUpdated","filtersUpdatedHandler"],[0,"nextPage","nextPageHandler"],[4,"popupFreeflowNextPage","nextPageHandlerFreeflow"]]]]]], options);
|
|
12
|
+
return index.bootstrapLazy([["covet-pics-post.cjs",[[1,"covet-pics-post",{"postId":[2,"post-id"],"environment":[1],"item":[32],"fetchingError":[32]}]]],["covet-pics-crop-text.cjs",[[0,"covet-pics-crop-text",{"text":[1],"textClass":[1,"text-class"],"textColor":[1,"text-color"],"ratio":[16],"cropCSS":[32]}]]],["covet-pics-star-rating.cjs",[[1,"covet-pics-star-rating",{"rating":[2],"ratingCount":[2,"rating-count"],"starColor":[1,"star-color"],"emptyStarColor":[1,"empty-star-color"],"starBorderColor":[1,"star-border-color"],"starBorderWidth":[2,"star-border-width"],"starSize":[2,"star-size"],"spaceStars":[2,"space-stars"],"spaceStarsText":[2,"space-stars-text"],"showLabel":[4,"show-label"],"label":[1]}]]],["covet-pics-highlighted-hotspots_2.cjs",[[0,"covet-pics-highlighted-page",{"thumbnailUrl":[1,"thumbnail-url"],"thumbnailAlt":[1,"thumbnail-alt"],"ariaLabel":[1,"aria-label"],"thumbnailLayout":[1,"thumbnail-layout"],"videoUrl":[1,"video-url"],"videoPoster":[1,"video-poster"],"thumbnailCarouselImages":[16,"thumbnail-carousel-images"],"productLinks":[16,"product-links"],"productBaseImgAlt":[1,"product-base-img-alt"],"reverseClass":[1,"reverse-class"],"isMobile":[4,"is-mobile"],"pageIndex":[2,"page-index"],"caption":[1],"rating":[2],"createdTime":[1,"created-time"],"userName":[1,"user-name"],"mainSliderIndex":[2,"main-slider-index"],"pageId":[2,"page-id"],"appStore":[16,"app-store"],"hideHotspots":[32],"activeProductIndex":[32],"hoverHotspot":[32]},[[0,"changeActiveHotspot","onChangeActiveHotspot"]]],[0,"covet-pics-highlighted-hotspots",{"links":[16],"activeHotspot":[2,"active-hotspot"],"thumbnailUrl":[1,"thumbnail-url"],"hoverHotspot":[2,"hover-hotspot"],"isMobile":[4,"is-mobile"],"productBaseImgAlt":[1,"product-base-img-alt"],"pageId":[2,"page-id"],"appStore":[16,"app-store"]},null,{"thumbnailUrl":["refreshHotspot"],"activeHotspot":["activeHotspotHandler"]}]]],["covet-pics-popup-freeflow-carousel_2.cjs",[[0,"covet-pics-popup-freeflow-carousel",{"item":[16],"isEnabled":[4,"is-enabled"],"dataLoaded":[1,"data-loaded"],"sliderIndex":[32],"videoPlay":[64],"videoPause":[64],"videoSoundOn":[64],"videoSoundOff":[64],"pauseAllVideos":[64]},null,{"isEnabled":["enableSlider"],"dataLoaded":["lazyLoadMedia"],"sliderIndex":["updateSliderIndex"]}],[1,"covet-pics-popup-freeflow-links",{"links":[16],"itemCreatedTime":[1,"item-created-time"],"isSliderEnabled":[4,"is-slider-enabled"]},null,{"isSliderEnabled":["enableSlider"]}]]],["covet-pics-direct-buy_7.cjs",[[0,"covet-pics-popup-slide",{"item":[16],"showCaption":[4,"show-caption"],"showStarRating":[4,"show-star-rating"],"dataLoaded":[32],"isPlaying":[32],"isMuted":[32],"carouselIndex":[32],"videoProgress":[32],"showCarouselVideoControls":[32],"loadMedia":[64],"videoPlay":[64],"videoPause":[64],"videoSoundOff":[64],"videoSoundOn":[64]}],[1,"covet-pics-direct-buy",{"product":[8],"moneyFormat":[1,"money-format"],"appStore":[16,"app-store"],"selectedOptions":[32],"settings":[32]}],[0,"covet-pics-hotspots",{"links":[16],"backgroundColor":[1,"background-color"],"textColor":[1,"text-color"],"showNumbers":[4,"show-numbers"]},[[0,"linkInactivate","linkInactivateHandler"],[0,"linkActivate","linkActivateHandler"]]],[0,"covet-pics-popup-links",{"links":[16],"greyBorderClass":[1,"grey-border-class"],"itemCreatedTime":[1,"item-created-time"],"appStore":[16,"app-store"],"settings":[32]}],[0,"covet-pics-popup-review",{"rating":[2],"caption":[1],"username":[1],"itemType":[1,"item-type"],"verified":[4],"createdTime":[1,"created-time"],"reviewCSS":[32]},null,{"caption":["watchPropHandler"]}],[0,"covet-pics-popup-shared-links",{"item":[16],"galleryEmbedId":[2,"gallery-embed-id"],"showShareLink":[32],"copyLinkCopied":[32]}],[0,"covet-pics-popup-slider",{"item":[16],"getSwiperState":[64]}]]],["covet-pics-gallery-header_6.cjs",[[0,"covet-pics-gallery-header",{"rating":[2],"productTitle":[1,"product-title"],"breakdown":[16],"appStore":[16,"app-store"],"showBreakdownDropdown":[32],"showSortDropdown":[32],"isDesktopScreen":[32]}],[1,"covet-pics-popup",{"appStore":[16,"app-store"],"item":[32],"product":[32],"directBuyIsOpen":[32],"popupTabIndex":[32],"settings":[32],"isPreviousEnable":[32],"isNextEnable":[32],"openPopup":[64],"closePopup":[64]},[[4,"addToCart:covetPics","addToCartHandler"],[16,"productLinkClicked","productLinkClickedHandler"]],{"item":["itemChangedHandler"]}],[1,"covet-pics-popup-freeflow",{"appStore":[16,"app-store"],"settings":[32],"items":[32],"sliderIndex":[32],"tabIndex":[32],"openPopupFreeflow":[64],"closePopupFreeflow":[64]},null,{"sliderIndex":["updateSliderIndex"],"items":["updateItems"]}],[0,"covet-pics-gallery-item",{"altTag":[1,"alt-tag"],"highlighted":[4],"imageUrl":[1,"image-url"],"rating":[2],"itemWidth":[2,"item-width"],"userName":[1,"user-name"],"createdTime":[1,"created-time"],"caption":[1],"itemType":[1,"item-type"],"imageHighResolutionUrl":[1,"image-high-resolution-url"],"imageResponsiveSizes":[1,"image-responsive-sizes"],"itemId":[1,"item-id"],"itemSource":[1,"item-source"],"links":[16],"url":[1],"videoUrl":[1,"video-url"],"itemIndex":[2,"item-index"],"itemSize":[1,"item-size"],"appStore":[16,"app-store"],"tabIndex":[32],"sliderIndex":[32],"showImageAsVideoPoster":[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"]],{"sliderIndex":["autoPlayVideos"]}],[0,"covet-pics-gallery-item-detail",{"altTag":[1,"alt-tag"],"highlighted":[4],"verified":[4],"imageUrl":[1,"image-url"],"imageHighResolutionUrl":[1,"image-high-resolution-url"],"imageResponsiveSizes":[1,"image-responsive-sizes"],"videoUrl":[1,"video-url"],"itemId":[1,"item-id"],"itemSource":[1,"item-source"],"itemType":[1,"item-type"],"links":[16],"url":[1],"rating":[2],"userName":[1,"user-name"],"caption":[1],"createdTime":[1,"created-time"],"itemIndex":[2,"item-index"],"itemSize":[1,"item-size"],"appStore":[16,"app-store"],"tabIndex":[32],"captionCSS":[32],"reviewClass":[32],"starOnlyClass":[32],"highlightedClass":[32],"sliderIndex":[32],"showImageAsVideoPoster":[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"],[8,"elementResize","elementResizeHandler"]],{"sliderIndex":["autoPlayVideos"]}],[1,"covet-pics-upload",{"standalone":[4],"appStore":[16,"app-store"],"starRating":[32],"isFormValid":[32],"showFormWarning":[32],"thumbnailLinks":[32],"toShowLinks":[32],"dropedImagesNumber":[32],"isAnimating":[32],"notificationMessage":[32],"isNotificationActive":[32],"widgetWidth":[32],"uploadTabIndex":[32],"openUpload":[64]}]]],["covet-pics-gallery-grid_3.cjs",[[0,"covet-pics-gallery-grid",{"items":[16],"breakdown":[16],"productTitle":[1,"product-title"],"rating":[2],"filtersEnabled":[4,"filters-enabled"],"filters":[16],"showLoadMore":[4,"show-load-more"],"appStore":[16,"app-store"],"sharedItemId":[1,"shared-item-id"],"showSort":[32],"isGridDisabled":[32],"isDesktopScreen":[32],"itemSize":[32],"isFilterModalShow":[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[9,"mousedown","handleClickOutside"],[0,"itemLoaded","handleItemLoaded"]],{"items":["itemsChangeHandler"]}],[0,"covet-pics-gallery-slider",{"items":[16],"sharedItemId":[1,"shared-item-id"],"sliderStyle":[1,"slider-style"],"appStore":[16,"app-store"],"itemSize":[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[0,"itemLoaded","handleItemLoaded"]],{"items":["itemsChangeHandler"]}],[0,"covet-pics-highlighted",{"numberOfPages":[2,"number-of-pages"],"items":[16],"appStore":[16,"app-store"],"productLinks":[32],"mainSliderIndex":[32],"mainSliderAnimatingSlides":[32],"windowHeight":[32],"isDesktopScreen":[32]},[[0,"pageLoaded","handleItemLoaded"]]]]],["covet-pics-widget.cjs",[[1,"covet-pics-widget",{"shop":[1],"galleryEmbedId":[2,"gallery-embed-id"],"shopifyProductId":[2,"shopify-product-id"],"environment":[1],"baseUrl":[1,"base-url"],"customSettings":[1,"custom-settings"],"hideElements":[1,"hide-elements"],"previewMode":[4,"preview-mode"],"photoRequestId":[2,"photo-request-id"],"lazyLoad":[4,"lazy-load"],"isLoading":[32],"minNumberOfPhotos":[32],"items":[32],"appStore":[32],"fetchingError":[32],"updateUploadWidgetCoverPreview":[64],"updatePreviewSettings":[64]},[[0,"sortUpdated","sortUpdatedHandler"],[0,"filtersUpdated","filtersUpdatedHandler"],[0,"nextPage","nextPageHandler"],[4,"popupFreeflowNextPage","nextPageHandlerFreeflow"]]]]]], options);
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
exports.setNonce = index.setNonce;
|
|
@@ -6,7 +6,7 @@ import { GalleryLoaderService } from "../../services/gallery-loader-service";
|
|
|
6
6
|
import { ResizeObserver } from "@juggle/resize-observer";
|
|
7
7
|
import { sendToGoogleAnalytics, findSharedItemPopup } from "../../utils/utils";
|
|
8
8
|
import { widgetIdUpdated, widgetGalleryIdUpdated, widgetShopIdUpdated } from "../../store/widgetId";
|
|
9
|
-
import { setEnvironment } from "../../store/url";
|
|
9
|
+
import { setEnvironment, setCustomUrl } from "../../store/url";
|
|
10
10
|
import { widgetWidthUpdated, windowHeightUpdated } from "../../store/size";
|
|
11
11
|
import { setPreviewHoverMode, setPreviewMode, setPreviewPopupMode } from "../../store/preview";
|
|
12
12
|
import { setAnalytics } from "../../store/analytics";
|
|
@@ -170,6 +170,9 @@ export class CovetPicsWidget {
|
|
|
170
170
|
this.appStore = configureStore();
|
|
171
171
|
const widgetIdParams = getWidgetId(this.galleryEmbedId, this.shop, this.photoRequestId, this.el);
|
|
172
172
|
this.appStore.dispatch(widgetIdUpdated(widgetIdParams));
|
|
173
|
+
if (this.baseUrl) {
|
|
174
|
+
this.appStore.dispatch(setCustomUrl(this.baseUrl));
|
|
175
|
+
}
|
|
173
176
|
this.appStore.dispatch(setEnvironment(this.environment));
|
|
174
177
|
this.appStore.dispatch(setPreviewMode(this.previewMode));
|
|
175
178
|
this.appState = this.appStore.getState();
|
|
@@ -180,7 +183,7 @@ export class CovetPicsWidget {
|
|
|
180
183
|
}
|
|
181
184
|
setupLoader() {
|
|
182
185
|
const uri = window.location;
|
|
183
|
-
this.loader = new GalleryLoaderService(this.environment, this.previewMode);
|
|
186
|
+
this.loader = new GalleryLoaderService(this.environment, this.previewMode, this.baseUrl);
|
|
184
187
|
if (typeof this.customSettings === "string") {
|
|
185
188
|
this.loader.setCustomSettings(JSON.parse(this.customSettings));
|
|
186
189
|
}
|
|
@@ -476,6 +479,25 @@ export class CovetPicsWidget {
|
|
|
476
479
|
"setter": false,
|
|
477
480
|
"reflect": false
|
|
478
481
|
},
|
|
482
|
+
"baseUrl": {
|
|
483
|
+
"type": "string",
|
|
484
|
+
"attribute": "base-url",
|
|
485
|
+
"mutable": false,
|
|
486
|
+
"complexType": {
|
|
487
|
+
"original": "string",
|
|
488
|
+
"resolved": "string",
|
|
489
|
+
"references": {}
|
|
490
|
+
},
|
|
491
|
+
"required": false,
|
|
492
|
+
"optional": false,
|
|
493
|
+
"docs": {
|
|
494
|
+
"tags": [],
|
|
495
|
+
"text": "Custom API base URL (overrides environment-based URL)"
|
|
496
|
+
},
|
|
497
|
+
"getter": false,
|
|
498
|
+
"setter": false,
|
|
499
|
+
"reflect": false
|
|
500
|
+
},
|
|
479
501
|
"customSettings": {
|
|
480
502
|
"type": "string",
|
|
481
503
|
"attribute": "custom-settings",
|
|
@@ -5,7 +5,7 @@ import { BASE_API_URLS } from "../utils/utils";
|
|
|
5
5
|
const STANDARD_GALLERY_URL = "/api/v1/embed/:id";
|
|
6
6
|
const PRODUCT_GALLERY_URL = "/api/v1/shop/:shop/product/:handle";
|
|
7
7
|
export class GalleryLoaderService {
|
|
8
|
-
constructor(env, previewMode) {
|
|
8
|
+
constructor(env, previewMode, customUrl) {
|
|
9
9
|
this.page = 0;
|
|
10
10
|
this.isLoading = false;
|
|
11
11
|
this.totalPages = 1;
|
|
@@ -16,6 +16,8 @@ export class GalleryLoaderService {
|
|
|
16
16
|
this.sortType = "";
|
|
17
17
|
this._customSettings = {};
|
|
18
18
|
this._selectedFilters = [];
|
|
19
|
+
// _customUrl can be either a string OR null, defaults to null
|
|
20
|
+
this._customUrl = null;
|
|
19
21
|
this._environment = "production";
|
|
20
22
|
if (typeof previewMode === "boolean") {
|
|
21
23
|
this.previewMode = previewMode;
|
|
@@ -23,9 +25,12 @@ export class GalleryLoaderService {
|
|
|
23
25
|
if (typeof env === "string" && Object.keys(BASE_API_URLS).includes(env)) {
|
|
24
26
|
this._environment = env;
|
|
25
27
|
}
|
|
28
|
+
if (typeof customUrl === "string" && customUrl) {
|
|
29
|
+
this._customUrl = customUrl;
|
|
30
|
+
}
|
|
26
31
|
}
|
|
27
32
|
get baseUrl() {
|
|
28
|
-
return BASE_API_URLS[this._environment];
|
|
33
|
+
return this._customUrl || BASE_API_URLS[this._environment];
|
|
29
34
|
}
|
|
30
35
|
// returns `standard_gallery` or `product_gallery`
|
|
31
36
|
get galleryType() {
|
|
@@ -14,7 +14,8 @@ const slice = createSlice({
|
|
|
14
14
|
initialState: {
|
|
15
15
|
baseUrl: "",
|
|
16
16
|
environment: "",
|
|
17
|
-
baseBeaconsUrl: ""
|
|
17
|
+
baseBeaconsUrl: "",
|
|
18
|
+
customUrl: null
|
|
18
19
|
},
|
|
19
20
|
reducers: {
|
|
20
21
|
setEnvironment: (url, action) => {
|
|
@@ -22,11 +23,17 @@ const slice = createSlice({
|
|
|
22
23
|
typeof env === "string" && Object.keys(BASE_API_URLS).includes(env)
|
|
23
24
|
? url.environment = env
|
|
24
25
|
: url.environment = "production";
|
|
25
|
-
url.baseUrl = BASE_API_URLS[url.environment];
|
|
26
|
-
url.baseBeaconsUrl = `${
|
|
26
|
+
url.baseUrl = url.customUrl || BASE_API_URLS[url.environment];
|
|
27
|
+
url.baseBeaconsUrl = `${url.baseUrl}${BEACONS_URL}/`;
|
|
28
|
+
return url;
|
|
29
|
+
},
|
|
30
|
+
setCustomUrl: (url, action) => {
|
|
31
|
+
url.customUrl = action.payload || null;
|
|
32
|
+
url.baseUrl = url.customUrl || BASE_API_URLS[url.environment];
|
|
33
|
+
url.baseBeaconsUrl = `${url.baseUrl}${BEACONS_URL}/`;
|
|
27
34
|
return url;
|
|
28
35
|
},
|
|
29
36
|
}
|
|
30
37
|
});
|
|
31
|
-
export const { setEnvironment } = slice.actions;
|
|
38
|
+
export const { setEnvironment, setCustomUrl } = slice.actions;
|
|
32
39
|
export default slice.reducer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright by Space Squirrel Ltd.
|
|
3
3
|
*/
|
|
4
|
-
import{p as e,b as t}from"./p-C-mGosc6.js";export{s as setNonce}from"./p-C-mGosc6.js";import{g as i}from"./p-CWiAxP5O.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((async e=>(await i(),t([["p-49fe4508",[[1,"covet-pics-post",{postId:[2,"post-id"],environment:[1],item:[32],fetchingError:[32]}]]],["p-5624938d",[[0,"covet-pics-crop-text",{text:[1],textClass:[1,"text-class"],textColor:[1,"text-color"],ratio:[16],cropCSS:[32]}]]],["p-cb32cd08",[[1,"covet-pics-star-rating",{rating:[2],ratingCount:[2,"rating-count"],starColor:[1,"star-color"],emptyStarColor:[1,"empty-star-color"],starBorderColor:[1,"star-border-color"],starBorderWidth:[2,"star-border-width"],starSize:[2,"star-size"],spaceStars:[2,"space-stars"],spaceStarsText:[2,"space-stars-text"],showLabel:[4,"show-label"],label:[1]}]]],["p-8e246791",[[0,"covet-pics-highlighted-page",{thumbnailUrl:[1,"thumbnail-url"],thumbnailAlt:[1,"thumbnail-alt"],ariaLabel:[1,"aria-label"],thumbnailLayout:[1,"thumbnail-layout"],videoUrl:[1,"video-url"],videoPoster:[1,"video-poster"],thumbnailCarouselImages:[16,"thumbnail-carousel-images"],productLinks:[16,"product-links"],productBaseImgAlt:[1,"product-base-img-alt"],reverseClass:[1,"reverse-class"],isMobile:[4,"is-mobile"],pageIndex:[2,"page-index"],caption:[1],rating:[2],createdTime:[1,"created-time"],userName:[1,"user-name"],mainSliderIndex:[2,"main-slider-index"],pageId:[2,"page-id"],appStore:[16,"app-store"],hideHotspots:[32],activeProductIndex:[32],hoverHotspot:[32]},[[0,"changeActiveHotspot","onChangeActiveHotspot"]]],[0,"covet-pics-highlighted-hotspots",{links:[16],activeHotspot:[2,"active-hotspot"],thumbnailUrl:[1,"thumbnail-url"],hoverHotspot:[2,"hover-hotspot"],isMobile:[4,"is-mobile"],productBaseImgAlt:[1,"product-base-img-alt"],pageId:[2,"page-id"],appStore:[16,"app-store"]},null,{thumbnailUrl:["refreshHotspot"],activeHotspot:["activeHotspotHandler"]}]]],["p-b6eb92eb",[[0,"covet-pics-popup-freeflow-carousel",{item:[16],isEnabled:[4,"is-enabled"],dataLoaded:[1,"data-loaded"],sliderIndex:[32],videoPlay:[64],videoPause:[64],videoSoundOn:[64],videoSoundOff:[64],pauseAllVideos:[64]},null,{isEnabled:["enableSlider"],dataLoaded:["lazyLoadMedia"],sliderIndex:["updateSliderIndex"]}],[1,"covet-pics-popup-freeflow-links",{links:[16],itemCreatedTime:[1,"item-created-time"],isSliderEnabled:[4,"is-slider-enabled"]},null,{isSliderEnabled:["enableSlider"]}]]],["p-f94cd032",[[0,"covet-pics-popup-slide",{item:[16],showCaption:[4,"show-caption"],showStarRating:[4,"show-star-rating"],dataLoaded:[32],isPlaying:[32],isMuted:[32],carouselIndex:[32],videoProgress:[32],showCarouselVideoControls:[32],loadMedia:[64],videoPlay:[64],videoPause:[64],videoSoundOff:[64],videoSoundOn:[64]}],[1,"covet-pics-direct-buy",{product:[8],moneyFormat:[1,"money-format"],appStore:[16,"app-store"],selectedOptions:[32],settings:[32]}],[0,"covet-pics-hotspots",{links:[16],backgroundColor:[1,"background-color"],textColor:[1,"text-color"],showNumbers:[4,"show-numbers"]},[[0,"linkInactivate","linkInactivateHandler"],[0,"linkActivate","linkActivateHandler"]]],[0,"covet-pics-popup-links",{links:[16],greyBorderClass:[1,"grey-border-class"],itemCreatedTime:[1,"item-created-time"],appStore:[16,"app-store"],settings:[32]}],[0,"covet-pics-popup-review",{rating:[2],caption:[1],username:[1],itemType:[1,"item-type"],verified:[4],createdTime:[1,"created-time"],reviewCSS:[32]},null,{caption:["watchPropHandler"]}],[0,"covet-pics-popup-shared-links",{item:[16],galleryEmbedId:[2,"gallery-embed-id"],showShareLink:[32],copyLinkCopied:[32]}],[0,"covet-pics-popup-slider",{item:[16],getSwiperState:[64]}]]],["p-40055ed4",[[0,"covet-pics-gallery-header",{rating:[2],productTitle:[1,"product-title"],breakdown:[16],appStore:[16,"app-store"],showBreakdownDropdown:[32],showSortDropdown:[32],isDesktopScreen:[32]}],[1,"covet-pics-popup",{appStore:[16,"app-store"],item:[32],product:[32],directBuyIsOpen:[32],popupTabIndex:[32],settings:[32],isPreviousEnable:[32],isNextEnable:[32],openPopup:[64],closePopup:[64]},[[4,"addToCart:covetPics","addToCartHandler"],[16,"productLinkClicked","productLinkClickedHandler"]],{item:["itemChangedHandler"]}],[1,"covet-pics-popup-freeflow",{appStore:[16,"app-store"],settings:[32],items:[32],sliderIndex:[32],tabIndex:[32],openPopupFreeflow:[64],closePopupFreeflow:[64]},null,{sliderIndex:["updateSliderIndex"],items:["updateItems"]}],[0,"covet-pics-gallery-item",{altTag:[1,"alt-tag"],highlighted:[4],imageUrl:[1,"image-url"],rating:[2],itemWidth:[2,"item-width"],userName:[1,"user-name"],createdTime:[1,"created-time"],caption:[1],itemType:[1,"item-type"],imageHighResolutionUrl:[1,"image-high-resolution-url"],imageResponsiveSizes:[1,"image-responsive-sizes"],itemId:[1,"item-id"],itemSource:[1,"item-source"],links:[16],url:[1],videoUrl:[1,"video-url"],itemIndex:[2,"item-index"],itemSize:[1,"item-size"],appStore:[16,"app-store"],tabIndex:[32],sliderIndex:[32],showImageAsVideoPoster:[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"]],{sliderIndex:["autoPlayVideos"]}],[0,"covet-pics-gallery-item-detail",{altTag:[1,"alt-tag"],highlighted:[4],verified:[4],imageUrl:[1,"image-url"],imageHighResolutionUrl:[1,"image-high-resolution-url"],imageResponsiveSizes:[1,"image-responsive-sizes"],videoUrl:[1,"video-url"],itemId:[1,"item-id"],itemSource:[1,"item-source"],itemType:[1,"item-type"],links:[16],url:[1],rating:[2],userName:[1,"user-name"],caption:[1],createdTime:[1,"created-time"],itemIndex:[2,"item-index"],itemSize:[1,"item-size"],appStore:[16,"app-store"],tabIndex:[32],captionCSS:[32],reviewClass:[32],starOnlyClass:[32],highlightedClass:[32],sliderIndex:[32],showImageAsVideoPoster:[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"],[8,"elementResize","elementResizeHandler"]],{sliderIndex:["autoPlayVideos"]}],[1,"covet-pics-upload",{standalone:[4],appStore:[16,"app-store"],starRating:[32],isFormValid:[32],showFormWarning:[32],thumbnailLinks:[32],toShowLinks:[32],dropedImagesNumber:[32],isAnimating:[32],notificationMessage:[32],isNotificationActive:[32],widgetWidth:[32],uploadTabIndex:[32],openUpload:[64]}]]],["p-802afafc",[[0,"covet-pics-gallery-grid",{items:[16],breakdown:[16],productTitle:[1,"product-title"],rating:[2],filtersEnabled:[4,"filters-enabled"],filters:[16],showLoadMore:[4,"show-load-more"],appStore:[16,"app-store"],sharedItemId:[1,"shared-item-id"],showSort:[32],isGridDisabled:[32],isDesktopScreen:[32],itemSize:[32],isFilterModalShow:[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[9,"mousedown","handleClickOutside"],[0,"itemLoaded","handleItemLoaded"]],{items:["itemsChangeHandler"]}],[0,"covet-pics-gallery-slider",{items:[16],sharedItemId:[1,"shared-item-id"],sliderStyle:[1,"slider-style"],appStore:[16,"app-store"],itemSize:[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[0,"itemLoaded","handleItemLoaded"]],{items:["itemsChangeHandler"]}],[0,"covet-pics-highlighted",{numberOfPages:[2,"number-of-pages"],items:[16],appStore:[16,"app-store"],productLinks:[32],mainSliderIndex:[32],mainSliderAnimatingSlides:[32],windowHeight:[32],isDesktopScreen:[32]},[[0,"pageLoaded","handleItemLoaded"]]]]],["p-
|
|
4
|
+
import{p as e,b as t}from"./p-C-mGosc6.js";export{s as setNonce}from"./p-C-mGosc6.js";import{g as i}from"./p-CWiAxP5O.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((async e=>(await i(),t([["p-49fe4508",[[1,"covet-pics-post",{postId:[2,"post-id"],environment:[1],item:[32],fetchingError:[32]}]]],["p-5624938d",[[0,"covet-pics-crop-text",{text:[1],textClass:[1,"text-class"],textColor:[1,"text-color"],ratio:[16],cropCSS:[32]}]]],["p-cb32cd08",[[1,"covet-pics-star-rating",{rating:[2],ratingCount:[2,"rating-count"],starColor:[1,"star-color"],emptyStarColor:[1,"empty-star-color"],starBorderColor:[1,"star-border-color"],starBorderWidth:[2,"star-border-width"],starSize:[2,"star-size"],spaceStars:[2,"space-stars"],spaceStarsText:[2,"space-stars-text"],showLabel:[4,"show-label"],label:[1]}]]],["p-8e246791",[[0,"covet-pics-highlighted-page",{thumbnailUrl:[1,"thumbnail-url"],thumbnailAlt:[1,"thumbnail-alt"],ariaLabel:[1,"aria-label"],thumbnailLayout:[1,"thumbnail-layout"],videoUrl:[1,"video-url"],videoPoster:[1,"video-poster"],thumbnailCarouselImages:[16,"thumbnail-carousel-images"],productLinks:[16,"product-links"],productBaseImgAlt:[1,"product-base-img-alt"],reverseClass:[1,"reverse-class"],isMobile:[4,"is-mobile"],pageIndex:[2,"page-index"],caption:[1],rating:[2],createdTime:[1,"created-time"],userName:[1,"user-name"],mainSliderIndex:[2,"main-slider-index"],pageId:[2,"page-id"],appStore:[16,"app-store"],hideHotspots:[32],activeProductIndex:[32],hoverHotspot:[32]},[[0,"changeActiveHotspot","onChangeActiveHotspot"]]],[0,"covet-pics-highlighted-hotspots",{links:[16],activeHotspot:[2,"active-hotspot"],thumbnailUrl:[1,"thumbnail-url"],hoverHotspot:[2,"hover-hotspot"],isMobile:[4,"is-mobile"],productBaseImgAlt:[1,"product-base-img-alt"],pageId:[2,"page-id"],appStore:[16,"app-store"]},null,{thumbnailUrl:["refreshHotspot"],activeHotspot:["activeHotspotHandler"]}]]],["p-b6eb92eb",[[0,"covet-pics-popup-freeflow-carousel",{item:[16],isEnabled:[4,"is-enabled"],dataLoaded:[1,"data-loaded"],sliderIndex:[32],videoPlay:[64],videoPause:[64],videoSoundOn:[64],videoSoundOff:[64],pauseAllVideos:[64]},null,{isEnabled:["enableSlider"],dataLoaded:["lazyLoadMedia"],sliderIndex:["updateSliderIndex"]}],[1,"covet-pics-popup-freeflow-links",{links:[16],itemCreatedTime:[1,"item-created-time"],isSliderEnabled:[4,"is-slider-enabled"]},null,{isSliderEnabled:["enableSlider"]}]]],["p-f94cd032",[[0,"covet-pics-popup-slide",{item:[16],showCaption:[4,"show-caption"],showStarRating:[4,"show-star-rating"],dataLoaded:[32],isPlaying:[32],isMuted:[32],carouselIndex:[32],videoProgress:[32],showCarouselVideoControls:[32],loadMedia:[64],videoPlay:[64],videoPause:[64],videoSoundOff:[64],videoSoundOn:[64]}],[1,"covet-pics-direct-buy",{product:[8],moneyFormat:[1,"money-format"],appStore:[16,"app-store"],selectedOptions:[32],settings:[32]}],[0,"covet-pics-hotspots",{links:[16],backgroundColor:[1,"background-color"],textColor:[1,"text-color"],showNumbers:[4,"show-numbers"]},[[0,"linkInactivate","linkInactivateHandler"],[0,"linkActivate","linkActivateHandler"]]],[0,"covet-pics-popup-links",{links:[16],greyBorderClass:[1,"grey-border-class"],itemCreatedTime:[1,"item-created-time"],appStore:[16,"app-store"],settings:[32]}],[0,"covet-pics-popup-review",{rating:[2],caption:[1],username:[1],itemType:[1,"item-type"],verified:[4],createdTime:[1,"created-time"],reviewCSS:[32]},null,{caption:["watchPropHandler"]}],[0,"covet-pics-popup-shared-links",{item:[16],galleryEmbedId:[2,"gallery-embed-id"],showShareLink:[32],copyLinkCopied:[32]}],[0,"covet-pics-popup-slider",{item:[16],getSwiperState:[64]}]]],["p-40055ed4",[[0,"covet-pics-gallery-header",{rating:[2],productTitle:[1,"product-title"],breakdown:[16],appStore:[16,"app-store"],showBreakdownDropdown:[32],showSortDropdown:[32],isDesktopScreen:[32]}],[1,"covet-pics-popup",{appStore:[16,"app-store"],item:[32],product:[32],directBuyIsOpen:[32],popupTabIndex:[32],settings:[32],isPreviousEnable:[32],isNextEnable:[32],openPopup:[64],closePopup:[64]},[[4,"addToCart:covetPics","addToCartHandler"],[16,"productLinkClicked","productLinkClickedHandler"]],{item:["itemChangedHandler"]}],[1,"covet-pics-popup-freeflow",{appStore:[16,"app-store"],settings:[32],items:[32],sliderIndex:[32],tabIndex:[32],openPopupFreeflow:[64],closePopupFreeflow:[64]},null,{sliderIndex:["updateSliderIndex"],items:["updateItems"]}],[0,"covet-pics-gallery-item",{altTag:[1,"alt-tag"],highlighted:[4],imageUrl:[1,"image-url"],rating:[2],itemWidth:[2,"item-width"],userName:[1,"user-name"],createdTime:[1,"created-time"],caption:[1],itemType:[1,"item-type"],imageHighResolutionUrl:[1,"image-high-resolution-url"],imageResponsiveSizes:[1,"image-responsive-sizes"],itemId:[1,"item-id"],itemSource:[1,"item-source"],links:[16],url:[1],videoUrl:[1,"video-url"],itemIndex:[2,"item-index"],itemSize:[1,"item-size"],appStore:[16,"app-store"],tabIndex:[32],sliderIndex:[32],showImageAsVideoPoster:[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"]],{sliderIndex:["autoPlayVideos"]}],[0,"covet-pics-gallery-item-detail",{altTag:[1,"alt-tag"],highlighted:[4],verified:[4],imageUrl:[1,"image-url"],imageHighResolutionUrl:[1,"image-high-resolution-url"],imageResponsiveSizes:[1,"image-responsive-sizes"],videoUrl:[1,"video-url"],itemId:[1,"item-id"],itemSource:[1,"item-source"],itemType:[1,"item-type"],links:[16],url:[1],rating:[2],userName:[1,"user-name"],caption:[1],createdTime:[1,"created-time"],itemIndex:[2,"item-index"],itemSize:[1,"item-size"],appStore:[16,"app-store"],tabIndex:[32],captionCSS:[32],reviewClass:[32],starOnlyClass:[32],highlightedClass:[32],sliderIndex:[32],showImageAsVideoPoster:[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"],[8,"elementResize","elementResizeHandler"]],{sliderIndex:["autoPlayVideos"]}],[1,"covet-pics-upload",{standalone:[4],appStore:[16,"app-store"],starRating:[32],isFormValid:[32],showFormWarning:[32],thumbnailLinks:[32],toShowLinks:[32],dropedImagesNumber:[32],isAnimating:[32],notificationMessage:[32],isNotificationActive:[32],widgetWidth:[32],uploadTabIndex:[32],openUpload:[64]}]]],["p-802afafc",[[0,"covet-pics-gallery-grid",{items:[16],breakdown:[16],productTitle:[1,"product-title"],rating:[2],filtersEnabled:[4,"filters-enabled"],filters:[16],showLoadMore:[4,"show-load-more"],appStore:[16,"app-store"],sharedItemId:[1,"shared-item-id"],showSort:[32],isGridDisabled:[32],isDesktopScreen:[32],itemSize:[32],isFilterModalShow:[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[9,"mousedown","handleClickOutside"],[0,"itemLoaded","handleItemLoaded"]],{items:["itemsChangeHandler"]}],[0,"covet-pics-gallery-slider",{items:[16],sharedItemId:[1,"shared-item-id"],sliderStyle:[1,"slider-style"],appStore:[16,"app-store"],itemSize:[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[0,"itemLoaded","handleItemLoaded"]],{items:["itemsChangeHandler"]}],[0,"covet-pics-highlighted",{numberOfPages:[2,"number-of-pages"],items:[16],appStore:[16,"app-store"],productLinks:[32],mainSliderIndex:[32],mainSliderAnimatingSlides:[32],windowHeight:[32],isDesktopScreen:[32]},[[0,"pageLoaded","handleItemLoaded"]]]]],["p-5ae26b01",[[1,"covet-pics-widget",{shop:[1],galleryEmbedId:[2,"gallery-embed-id"],shopifyProductId:[2,"shopify-product-id"],environment:[1],baseUrl:[1,"base-url"],customSettings:[1,"custom-settings"],hideElements:[1,"hide-elements"],previewMode:[4,"preview-mode"],photoRequestId:[2,"photo-request-id"],lazyLoad:[4,"lazy-load"],isLoading:[32],minNumberOfPhotos:[32],items:[32],appStore:[32],fetchingError:[32],updateUploadWidgetCoverPreview:[64],updatePreviewSettings:[64]},[[0,"sortUpdated","sortUpdatedHandler"],[0,"filtersUpdated","filtersUpdatedHandler"],[0,"nextPage","nextPageHandler"],[4,"popupFreeflowNextPage","nextPageHandlerFreeflow"]]]]]],e))));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright by Space Squirrel Ltd.
|
|
3
|
+
*/
|
|
4
|
+
import{r as t,c as e,h as i,H as o,g as s}from"./p-C-mGosc6.js";import{B as r,s as n,f as h}from"./p-BODOgEuN.js";import{c as a,a as l,p as d,b as c,s as u}from"./p-B68hw7d9.js";import{m as _,s as p}from"./p-BJA1jk-5.js";import{s as m}from"./p-CP5h6CHJ.js";import{g as f,s as b}from"./p-Mc-D_Wnh.js";import{g}from"./p-C5ofYrUT.js";class v{constructor(t,e,i){this.page=0,this.isLoading=!1,this.totalPages=1,this.previewSettings={},this.previewHoverMode=!1,this.previewPopupMode=!1,this.previewMode=!1,this.sortType="",this._customSettings={},this._selectedFilters=[],this._customUrl=null,this._environment="production","boolean"==typeof e&&(this.previewMode=e),"string"==typeof t&&Object.keys(r).includes(t)&&(this._environment=t),"string"==typeof i&&i&&(this._customUrl=i)}get baseUrl(){return this._customUrl||r[this._environment]}get galleryType(){return this.productHandle?"product_gallery":"standard_gallery"}setCustomSettings(t){return this._customSettings=Object.assign({},t),Object.keys(this._customSettings).forEach((t=>null===this._customSettings[t]?delete this._customSettings[t]:this._customSettings[t])),this._customSettings}setSelectedFilters(t){return this._selectedFilters=[...t]}standardGalleryUrl(){return"/api/v1/embed/:id".replace(":id",this.embedId)}productGalleryUrl(){return"/api/v1/shop/:shop/product/:handle".replace(":shop",this.shopDomain).replace(":handle",this.productHandle)}galleryUrl(){if("testing"===this._environment)return"http://localhost:3000/embed";let t=this.baseUrl;return t+=this.productHandle?this.productGalleryUrl():this.standardGalleryUrl(),this.previewMode&&(t+="/preview"),""!==this.sortType&&(t+=`?sort_by=${this.sortType}`),t}resetPagination(){this.page=0,this.totalPages=1}async fetchItems(){if(this.isLoading||this.page>=this.totalPages)return;this.isLoading=!0,this.page+=1;let t=this.galleryUrl();const e=[];this.page>1&&e.push(`page=${this.page}`),this._selectedFilters.length>0&&(this.previewMode?this.previewSettings.filters=this._selectedFilters:this._selectedFilters.forEach((t=>e.push(encodeURIComponent("filters[]")+"="+encodeURIComponent(t))))),e.length>0&&(t+=`?${e.join("&")}`);const i=await fetch(t,this.fetchOptions);if(!i.ok)throw new Error(`${i.status}`);const o=await i.json();return o.items=this.getItemsWithLocaleLinks(o.items),this.data=Object.assign({},o),this.data.settings=Object.assign(Object.assign({},this.data.settings),this._customSettings),o.settings=void 0!==this.previewSettings.settings?Object.assign(Object.assign(Object.assign({},o.settings),this._customSettings),this.previewSettings.settings):Object.assign(Object.assign({},o.settings),this._customSettings),this.totalPages=o.total_pages,this.galleryId=o.gallery_id,this.shopId=o.shop_id,this.isLoading=!1,o}getItemsWithLocaleLinks(t){return t.forEach((t=>(t.links&&t.links.length>0&&t.links.forEach((t=>(t.link=(t=>{const e=window.location.hostname;let i=t;const o=window.Shopify;return void 0!==o&&o.routes&&o.routes.root&&"/"!==o.routes.root?i.replace(`${e}/`,`${e}${o.routes.root}`):i})(t.link),t))),t))),t}get fetchOptions(){const t={},e={},i=Object.keys(this.previewSettings);return this.previewMode&&(e.method="POST",e.headers={"Content-Type":"application/json"},i.length>0&&(i.forEach((e=>{const i=e.replace(/^(gallery_embed\[)/,"").replace(/\]$/,"");t[i]=this.previewSettings[e]})),e.body=JSON.stringify(t))),e}}var w,y=[],O="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(w||(w={}));var S,x=function(t){return Object.freeze(t)},E=function(t,e){this.inlineSize=t,this.blockSize=e,x(this)},k=function(){function t(t,e,i,o){return this.x=t,this.y=e,this.width=i,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,x(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),I=function(t){return t instanceof SVGElement&&"getBBox"in t},C=function(t){if(I(t)){var e=t.getBBox();return!e.width&&!e.height}return!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},U=function(t){var e;if(t instanceof Element)return!0;var i=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(i&&t instanceof i.Element)},z="undefined"!=typeof window?window:{},j=new WeakMap,F=/auto|scroll/,P=/^tb|vertical/,M=/msie|trident/i.test(z.navigator&&z.navigator.userAgent),R=function(t){return parseFloat(t||"0")},D=function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=!1),new E((i?e:t)||0,(i?t:e)||0)},B=x({devicePixelContentBoxSize:D(),borderBoxSize:D(),contentBoxSize:D(),contentRect:new k(0,0,0,0)}),H=function(t,e){if(void 0===e&&(e=!1),j.has(t)&&!e)return j.get(t);if(C(t))return j.set(t,B),B;var i=getComputedStyle(t),o=I(t)&&t.ownerSVGElement&&t.getBBox(),s=!M&&"border-box"===i.boxSizing,r=P.test(i.writingMode||""),n=!o&&F.test(i.overflowY||""),h=!o&&F.test(i.overflowX||""),a=o?0:R(i.paddingTop),l=o?0:R(i.paddingRight),d=o?0:R(i.paddingBottom),c=o?0:R(i.paddingLeft),u=o?0:R(i.borderTopWidth),_=o?0:R(i.borderRightWidth),p=o?0:R(i.borderBottomWidth),m=c+l,f=a+d,b=(o?0:R(i.borderLeftWidth))+_,g=u+p,v=h?t.offsetHeight-g-t.clientHeight:0,w=n?t.offsetWidth-b-t.clientWidth:0,y=s?m+b:0,O=s?f+g:0,S=o?o.width:R(i.width)-y-w,E=o?o.height:R(i.height)-O-v,U=S+m+w+b,z=E+f+v+g,H=x({devicePixelContentBoxSize:D(Math.round(S*devicePixelRatio),Math.round(E*devicePixelRatio),r),borderBoxSize:D(U,z,r),contentBoxSize:D(S,E,r),contentRect:new k(c,a,S,E)});return j.set(t,H),H},T=function(t,e,i){var o=H(t,i),s=o.borderBoxSize,r=o.contentBoxSize,n=o.devicePixelContentBoxSize;switch(e){case w.DEVICE_PIXEL_CONTENT_BOX:return n;case w.BORDER_BOX:return s;default:return r}},A=function(t){var e=H(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=x([e.borderBoxSize]),this.contentBoxSize=x([e.contentBoxSize]),this.devicePixelContentBoxSize=x([e.devicePixelContentBoxSize])},W=function(t){if(C(t))return 1/0;for(var e=0,i=t.parentNode;i;)e+=1,i=i.parentNode;return e},$=function(){var t=1/0,e=[];y.forEach((function(i){if(0!==i.activeTargets.length){var o=[];i.activeTargets.forEach((function(e){var i=new A(e.target),s=W(e.target);o.push(i),e.lastReportedSize=T(e.target,e.observedBox),s<t&&(t=s)})),e.push((function(){i.callback.call(i.observer,o,i.observer)})),i.activeTargets.splice(0,i.activeTargets.length)}}));for(var i=0,o=e;i<o.length;i++)(0,o[i])();return t},G=function(t){y.forEach((function(e){e.activeTargets.splice(0,e.activeTargets.length),e.skippedTargets.splice(0,e.skippedTargets.length),e.observationTargets.forEach((function(i){i.isActive()&&(W(i.target)>t?e.activeTargets.push(i):e.skippedTargets.push(i))}))}))},L=[],N=0,V={attributes:!0,characterData:!0,childList:!0,subtree:!0},q=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],J=function(t){return void 0===t&&(t=0),Date.now()+t},Y=!1,K=new(function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!Y){Y=!0;var i,o=J(t);i=function(){var i=!1;try{i=function(){var t,e=0;for(G(e);y.some((function(t){return t.activeTargets.length>0}));)e=$(),G(e);return y.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:O}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=O),window.dispatchEvent(t)),e>0}()}finally{if(Y=!1,t=o-J(),!N)return;i?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!S){var e=0,i=document.createTextNode("");new MutationObserver((function(){return L.splice(0).forEach((function(t){return t()}))})).observe(i,{characterData:!0}),S=function(){i.textContent="".concat(e?e--:e++)}}L.push(t),S()}((function(){requestAnimationFrame(i)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,V)};document.body?e():z.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),q.forEach((function(e){return z.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),q.forEach((function(e){return z.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}()),Z=function(t){!N&&t>0&&K.start(),!(N+=t)&&K.stop()},Q=function(){function t(t,e){this.target=t,this.observedBox=e||w.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=T(this.target,this.observedBox,!0);return I(t=this.target)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),X=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},tt=new WeakMap,et=function(t,e){for(var i=0;i<t.length;i+=1)if(t[i].target===e)return i;return-1},it=function(){function t(){}return t.connect=function(t,e){var i=new X(t,e);tt.set(t,i)},t.observe=function(t,e,i){var o=tt.get(t),s=0===o.observationTargets.length;et(o.observationTargets,e)<0&&(s&&y.push(o),o.observationTargets.push(new Q(e,i&&i.box)),Z(1),K.schedule())},t.unobserve=function(t,e){var i=tt.get(t),o=et(i.observationTargets,e);o>=0&&(1===i.observationTargets.length&&y.splice(y.indexOf(i),1),i.observationTargets.splice(o,1),Z(-1))},t.disconnect=function(t){var e=this,i=tt.get(t);i.observationTargets.slice().forEach((function(i){return e.unobserve(t,i.target)})),i.activeTargets.splice(0,i.activeTargets.length)},t}(),ot=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");it.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!U(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");it.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!U(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");it.unobserve(this,t)},t.prototype.disconnect=function(){it.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const st=a({name:"widgetId",initialState:{embedId:null,productHandle:null,shopDomain:null,galleryId:null,shopId:null,photoRequestId:null},reducers:{widgetIdUpdated:(t,e)=>{const{embedId:i,productHandle:o,shopDomain:s,photoRequestId:r}=e.payload;t.embedId=i,t.productHandle=o,t.shopDomain=s,t.photoRequestId=r},widgetGalleryIdUpdated:(t,e)=>{t.galleryId=e.payload},widgetShopIdUpdated:(t,e)=>{t.shopId=e.payload}}}),{widgetIdUpdated:rt,widgetGalleryIdUpdated:nt,widgetShopIdUpdated:ht}=st.actions;var at=st.reducer;const lt={production:"https://app.covet.pics",development:"http://localhost:3000",staging:"https://covetstaging.spacesquirrel.net",testing:"http://localhost:3000/testing_db"},dt="/api/v1/beacons",ct=a({name:"url",initialState:{baseUrl:"",environment:"",baseBeaconsUrl:"",customUrl:null},reducers:{setEnvironment:(t,e)=>{const i=e.payload;return t.environment="string"==typeof i&&Object.keys(lt).includes(i)?i:"production",t.baseUrl=t.customUrl||lt[t.environment],t.baseBeaconsUrl=`${t.baseUrl}${dt}/`,t},setCustomUrl:(t,e)=>(t.customUrl=e.payload||null,t.baseUrl=t.customUrl||lt[t.environment],t.baseBeaconsUrl=`${t.baseUrl}${dt}/`,t)}}),{setEnvironment:ut,setCustomUrl:_t}=ct.actions;var pt=ct.reducer;const mt=a({name:"size",initialState:{widgetWidth:320,windowHeight:600,isDesktopScreen:!0},reducers:{widgetWidthUpdated:(t,e)=>{t.widgetWidth=e.payload,t.isDesktopScreen=e.payload>=800},windowHeightUpdated:(t,e)=>{t.windowHeight=e.payload}}}),{widgetWidthUpdated:ft,windowHeightUpdated:bt}=mt.actions;var gt=mt.reducer;const vt=a({name:"preview",initialState:{hoverMode:!1,popupMode:!1,mode:!1},reducers:{setPreviewHoverMode:(t,e)=>{t.hoverMode=e.payload},setPreviewPopupMode:(t,e)=>{t.popupMode=e.payload},setPreviewMode:(t,e)=>{t.mode=e.payload}}}),{setPreviewHoverMode:wt,setPreviewPopupMode:yt,setPreviewMode:Ot}=vt.actions;var St=vt.reducer;const xt=a({name:"analytics",initialState:!1,reducers:{setAnalytics:(t,e)=>e.payload}}),{setAnalytics:Et}=xt.actions;var kt=xt.reducer;const It=t=>(t._arrowsDesktopType=`arrows-${t.arrow_graphics_type.toString().replace("_","-")}`,t._arrowsDesktopSizeType=t.arrow_size.toString().replace("_arrow",""),t._arrowsDesktopPosition=t.desktop_arrow_position.toString().replace("sidebar_",""),t._arrowsMobileColorTheme=t.mobile_arrow_color_theme.toString().replace("mob_",""),t._arrowsMobilePosition=t.mobile_arrow_position.toString().replace("mob_",""),t._arrowsMobileType=t.mobile_arrow_graphics_type.toString().replace("mob_","arrows-").replace("_","-"),t._buyButtonStyle=t.popup_buy_button_style.replace("buy_btn_","").replace("_","-"),t._closeButtonType=t.close_button_type.toString().split("_").join("-"),t._closeButtonСolorTheme=`close-button-color-theme-${t.close_button_color_theme.toString().replace("_btn","")}`,t),Ct=a({name:"settings",initialState:It({add_to_cart_button_caption:"Add to cart",arrow_color_theme:"light",arrow_custom_box_color:"#000000",arrow_custom_color:"#d3d3d3",arrow_graphics_type:"type_1",arrow_size:"standard",arrow_size_custom:48,background_color:"#000000",close_button_color_theme:"dark_btn",close_button_custom_box_color:"#000000",close_button_custom_color:"#d3d3d3",close_button_position:"side",close_button_size:"standard",close_button_type:"btn_type_1",customer_photo_item_label:"Add Your Photo",customer_photo_item_position:null,customer_photo_upload_body:"We would love to see it in action",customer_photo_upload_button_selector:"",customer_photo_upload_complete_body:"Thank you for your awesome photo! You will see it on the site once it’s approved",customer_photo_upload_complete_close_label:"Close",customer_photo_upload_drop_files_label:"Drag & Drop photos here",customer_photo_upload_form_body_placeholder:"Say something about your image",customer_photo_upload_form_email_placeholder:"E-mail",customer_photo_upload_form_legal_message:"",customer_photo_upload_form_name_placeholder:"Nickname",customer_photo_upload_form_send_label:"Send",customer_photo_upload_form_uploading:"Uploading...",customer_photo_upload_title:"Show It off",customer_widget_cover:null,desktop_arrow_position:"middle",direct_add_to_cart:!0,display_type:"grid",font_family:"Source Sans Pro",gallery_highlight:!1,gallery_highlight_every:0,gallery_highlight_every_start:0,gallery_mobile_photos_per_row:2,gallery_photos_count:0,gallery_photos_per_row:4,header_show_average_rating:!0,header_show_breakdown:!0,header_show_sort:!0,header_type:"header-1",hide_branding:!1,hide_social_links:!1,highlight_hotspots_layout:"hotspot-tall",highlight_layout:"slider",highlight_products_layout:"layout-1",hotspots:{enabled:!1,background_color:"#000000",show_numbers:!1,text_color:"#ffffff"},item_reveal_content:"",item_animation_duration:1,item_animation_type:"hover-animation-1",item_hover_background_opacity:80,item_hover_border_color:"#C1ACAC",item_hover_color_from:"#000000",item_hover_color_to:"#000000",item_hover_disabled:!1,item_hover_icon:!1,item_label_color:"#FFFFFF",item_label_font_size:15,item_label_font_style:"Normal",item_label_text:"SHOP THIS LOOK",item_mobile_padding:0,item_open_link:!1,item_padding:1,item_style:"standard",item_without_product_label_text:"SEE MORE",load_more_border_width:4,load_more_button_color:"#000000",load_more_button_style:"btn_style_1",load_more_font_size:14,load_more_font_style:"bold",load_more_padding:6,load_more_text:"MORE",mobile_arrow_color_theme:"mob_light",mobile_arrow_custom_box_color:"#000000",mobile_arrow_custom_color:"#d3d3d3",mobile_arrow_graphics_type:"mob_type_1",mobile_arrow_position:"mob_top",money_format:"{{amount}}",multiple_filter_enabled:!1,padding:0,pagination:"button",popup_animation:!0,popup_background_color:"#000000",popup_background_opacity:80,popup_buy_button_background_color:"#444444",popup_buy_button_background_hover_color:"#000000",popup_buy_button_text_color:"#FFFFFF",popup_buy_button_text_hover_color:"#000000",popup_custom_link_label:"Visit",popup_disable_modal:!1,popup_feed_show_caption:!0,popup_feed_show_navigation_arrows:!1,popup_feed_show_star_rating:!0,popup_feed_sound_on:!0,popup_image_size:"responsive",popup_products_button_caption:"Buy Now",popup_products_title:"SHOP THIS LOOK",popup_products_title_disabled:!1,popup_style:"standard",popup_buy_button_style:"buy_btn_style_1",popup_products_view_type:"grid_view",price_label_caption:"Price",primary_color:"#222222",secondary_color:"#BFBFBF",select_label_caption:"Select",show_header:!1,show_price:!0,show_price_in_popup:!0,show_review:!0,slideshow_autoplay:0,slideshow_arrows_desktop_align:"start",slideshow_arrows_mobile_align:"start",slideshow_arrows_desktop_position:"top",slideshow_arrows_mobile_position:"top",slideshow_scrollbar_desktop_align:"start",slideshow_scrollbar_mobile_align:"start",slideshow_scrollbar_desktop_position:"top",slideshow_scrollbar_mobile_position:"top",slideshow_load_more:!0,slideshow_video_auto_play:!1,slideshow_mobile_photos_per_row:2,slideshow_photos_per_row:4,slideshow_crop_mode:!1,slideshow_style:"regular",slideshow_desktop_pagination_style:"none",slideshow_mobile_pagination_style:"dots",star_color:"#FCD02C",tags_color:"#86848A",tags_active_color:"#302F33",tags_font_size:12,tags_font_weight:"",tags_padding:0,tags_reset_button_text:"",tags_style:"style_1",tags_wrap:"scroll",upload_show_star_rating:!0}),reducers:{setSettings:(t,e)=>{const i={};return Object.keys(e.payload).forEach((t=>{void 0!==e.payload[t]&&(i[t]=e.payload[t])})),It(Object.assign(Object.assign({},t),i))}}}),{setSettings:Ut}=Ct.actions,zt=l({analytics:kt,size:gt,sort:p,url:pt,preview:St,popup:d,modals:_,slider:m,widgetId:at,settings:Ct.reducer}),jt=class{constructor(i){t(this,i),this.updateUploadWidgetCover=e(this,"updateUploadWidgetCover",7),this.elementResize=e(this,"elementResize",7),this.previewMode=!1,this.lazyLoad=!1,this.isLoading=!0,this.items=[],this.fetchingError=null,this.fontsLoaded=!1,this.filters={}}async sortUpdatedHandler(t){this.loader.resetPagination(),this.loader.sortType=t.detail;const e=await this.loader.fetchItems();void 0!==e&&(this.items=[],this.items=[...this.getItemsWithUpload(e.items)])}async filtersUpdatedHandler(t){const e=t.detail.resetFilters;this.appState.preview.mode&&delete this.loader.previewSettings.filters;const i=()=>{Object.keys(this.filters).forEach((t=>this.filters[t]=!1)),this.loader.setSelectedFilters([])};if(e)i();else{const e=t.detail.filter;this.appState.settings.multiple_filter_enabled||this.filters[e]||i(),this.filters[e]=!this.filters[e]}const o=Object.keys(this.filters).filter((t=>this.filters[t]));this.loader.setSelectedFilters(o),this.loader.resetPagination();const s=await this.loader.fetchItems();void 0!==s&&(this.items=[],this.items=[...this.getItemsWithUpload(s.items)])}async nextPageHandler(){const t=await this.loader.fetchItems();void 0!==t&&(this.items=[...this.items,...t.items])}async nextPageHandlerFreeflow(t){if(t.detail.embedId===this.appState.widgetId.embedId){const t=await this.loader.fetchItems();void 0!==t&&(this.items=[...this.items,...t.items],this.appStore.dispatch(u(this.items)))}}async updateUploadWidgetCoverPreview(t){this.updateUploadWidgetCover.emit({image:t})}async updatePreviewSettings(t,e,i){this.removeModals(),this.loader.previewHoverMode=e,this.loader.previewPopupMode=i,this.appStore.dispatch(wt(e)),this.appStore.dispatch(yt(i)),this.fontsLoaded=!1,this.loader.previewSettings=Object.assign(Object.assign({},this.loader.previewSettings),t),this.loader.resetPagination(),this.loadData()}componentWillLoad(){this.lazyLoad?this.setupLazyLoading():this.initApp()}setupLazyLoading(){this.el.style.setProperty("--covet-widget-min-height","5px"),this.intersectionObserver=this.observeElementVisibility(this.el,(()=>{this.initApp(),this.widgetResizeObserver(),this.el.style.setProperty("--covet-widget-min-height","0")}))}componentDidLoad(){this.lazyLoad||this.widgetResizeObserver()}disconnectedCallback(){this.unsubscribe(),this.resizeObserver&&this.resizeObserver.disconnect(),this.intersectionObserver&&this.intersectionObserver.disconnect()}observeElementVisibility(t,e){const i=new IntersectionObserver((o=>{o.length>0&&o[0].isIntersecting&&(e(),i.unobserve(t))}));return i.observe(t),i}initApp(){this.initAppStore(),this.setupLoader(),this.loadData()}widgetResizeObserver(){this.resizeObserver=new ot((()=>{this.appState.size.windowHeight!==window.innerHeight&&this.appStore.dispatch(bt(window.innerHeight));const t=this.appState.size.widgetWidth!==this.el.getBoundingClientRect().width;this.isWidgetWrapExist()&&t&&(this.setWidgetWidth(),this.elementResize.emit())})),this.isWidgetWrapExist()&&this.resizeObserver.observe(this.el.parentElement)}initAppStore(){this.appStore=c({reducer:zt});const t=f(this.galleryEmbedId,this.shop,this.photoRequestId,this.el);this.appStore.dispatch(rt(t)),this.baseUrl&&this.appStore.dispatch(_t(this.baseUrl)),this.appStore.dispatch(ut(this.environment)),this.appStore.dispatch(Ot(this.previewMode)),this.appState=this.appStore.getState(),this.unsubscribe=this.appStore.subscribe((()=>{this.appState=this.appStore.getState()})),this.setWidgetWidth()}setupLoader(){const t=window.location;if(this.loader=new v(this.environment,this.previewMode,this.baseUrl),"string"==typeof this.customSettings&&this.loader.setCustomSettings(JSON.parse(this.customSettings)),void 0===this.galleryEmbedId||0===this.galleryEmbedId){if(void 0!==this.shopifyProductId?this.loader.productHandle=`shopify/${this.shopifyProductId}`:null!==this.el.getAttribute("data-product")?this.loader.productHandle=this.el.getAttribute("data-product"):-1!==t.pathname.indexOf("/products/")&&(this.loader.productHandle=t.pathname.match(/\/products\/([a-zA-Z0-9\-\_\%]+)/)[1]),this.el.hasAttribute("data-shop")&&(this.shop=this.el.getAttribute("data-shop")),void 0===this.shop)return this.fetchingError="The Covet.pics gallery embed has not loaded due to a missing Embed ID. Please make sure to fill in the correct Embed ID",void(this.isLoading=!1);this.loader.shopDomain=this.shop}else this.loader.embedId=this.galleryEmbedId}async loadData(){if(null===this.fetchingError){this.isLoading=!0;try{const t=await this.loader.fetchItems();return this.appStore.dispatch(nt(this.loader.galleryId)),this.appStore.dispatch(ht(this.loader.shopId)),this.appStore.dispatch(Et(!!this.loader.data.analytics&&this.loader.data.analytics)),void 0===t?!1:(this.appStore.dispatch(Ut(t.settings)),this.minNumberOfPhotos=t.settings.min_number_of_photos,this.items="highlight"===this.loader.data.settings.display_type?[...t.items]:[...this.getItemsWithUpload(t.items)],this.hideElementsIfEmpty(),this.fontsLoaded||this.loadFont(),this.hasEnoughPhotos&&g(this.appState)&&n("Covet.pics Gallery View","Covet.pics Gallery","Covet.pics Gallery View - "+this.galleryEmbedId),this.hasEnoughPhotos&&b(this.appState,"gallery_view"),this.sharedItemId=await this.findAndLoadSharedItemId(),this.initFilters(),this.isLoading=!1,!0)}catch(t){return"404"===t.message&&(this.fetchingError="The Covet.pics gallery embed has not loaded because the embed does not exist. Please verify that the correct Embed ID is being used"),this.isLoading=!1,this.fetchingError}}}removeModals(){["covet-pics-upload","covet-pics-popup","covet-pics-popup-freeflow"].forEach((t=>{const e=document.querySelector(`${t}`);null!==e&&e.remove()}))}async findAndLoadSharedItemId(){return new Promise((async t=>{if(this.loader.previewPopupMode){const e=this.items.find((t=>"upload_widget"!==t.source));return t(void 0!==e?e.id.toString():"none")}const e=h(this.loader.embedId,this.loader.galleryType);if(null===e)return t("none");if(-1!==this.items.findIndex((t=>t.id===parseInt(e))))return t(e.toString());const i=await this.loader.fetchItems();return void 0===i?t("none"):(this.items=[...this.items,...i.items],t(this.findAndLoadSharedItemId()))}))}setWidgetWidth(){const t=this.isWidgetWrapExist()?this.el.getBoundingClientRect().width:320;return this.appStore.dispatch(ft(t))}isWidgetWrapExist(){return void 0!==this.el.parentElement&&this.el.parentElement instanceof HTMLElement}get hasEnoughPhotos(){return 0!==this.items.length&&(null===this.minNumberOfPhotos||void 0!==this.loader&&void 0!==this.loader.data&&!(void 0!==this.loader.data.items&&this.loader.data.items.length<this.minNumberOfPhotos&&1===this.loader.page))}initFilters(){const t=this.loader.previewSettings.filters;this.loader.data.filters.list.forEach((t=>this.filters[t]=!1)),this.appState.preview.mode&&void 0!==t&&t.forEach((t=>this.filters[t]=!0))}loadFont(){if(this.loader.data.settings.font_family){const t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href","https://fonts.googleapis.com/css2?family="+this.loader.data.settings.font_family.split(" ").join("+")+":wght@300;400;600;700&display=swap"),document.head.appendChild(t)}this.fontsLoaded=!0}setWidgetCSSVariables(){let t={};return this.loader.data.settings.font_family&&""!==this.loader.data.settings.font_family&&(t["--covet-internal-font-family"]=`${this.appState.settings.font_family}`),t}getItemsWithUpload(t){return this.loader.data.settings.customer_photo_item_position?(t.splice(this.loader.data.settings.customer_photo_item_position-1,0,{source:"upload_widget",imageUrl:null!==this.appState.settings.customer_widget_cover?this.appState.settings.customer_widget_cover:void 0}),t):t}renderSliderGallery(){return i(o,{style:this.setWidgetCSSVariables(),class:"needsclick"},i("covet-pics-gallery-slider",{items:this.items,"shared-item-id":this.sharedItemId,"slider-style":this.loader.data.settings.slideshow_style,appStore:this.appStore}))}renderGridGallery(){var t,e,s;return i(o,{style:this.setWidgetCSSVariables(),class:"needsclick"},i("covet-pics-gallery-grid",{items:this.items,rating:null===(t=this.loader.data.reviews)||void 0===t?void 0:t.rating,"rating-count":null===(e=this.loader.data.reviews)||void 0===e?void 0:e.rating_count,"product-title":this.loader.data.product_title,breakdown:null===(s=this.loader.data.reviews)||void 0===s?void 0:s.breakdown,"filters-enabled":this.loader.data.filters.enabled,"shared-item-id":this.sharedItemId,filters:this.filters,"show-load-more":"button"===this.appState.settings.pagination&&!this.isLoading&&this.loader.totalPages>this.loader.page&&this.items.length>0,appStore:this.appStore}))}renderHighlighted(){return i(o,{style:this.setWidgetCSSVariables(),class:"highlighted"},i("covet-pics-highlighted",{numberOfPages:this.loader.data.items.length,items:this.loader.data.items,appStore:this.appStore}))}hideElementsIfEmpty(){let t=this.hideElements;t||(t=this.loader.data.settings.selector_to_hide);const e=this.loader.data.items;(void 0===e||0!==e.length)&&this.hasEnoughPhotos||""===t||document.querySelectorAll(t).forEach((t=>t.style.display="none"))}renderUploadStandalone(){return i("covet-pics-upload",{standalone:!0,appStore:this.appStore})}renderError(){return i(o,null,i("p",{class:"error-message"},this.fetchingError))}render(){if(!this.isLoading&&null!==this.fetchingError)return this.renderError();if(!this.isLoading&&this.hasEnoughPhotos){const t=this.loader.data.settings.display_type;return"upload-standalone"===t?this.renderUploadStandalone():"slider"===t?this.renderSliderGallery():"highlight"===t?this.renderHighlighted():this.renderGridGallery()}}get el(){return s(this)}};jt.style=":host{--covet-font-family:var(--covet-custom-font-family, var(--covet-internal-font-family)), sans-serif}:host{font-family:var(--covet-font-family);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:block;min-height:var(--covet-widget-min-height)}:host .error-message{text-align:center;border:2px dashed;padding:20px}";export{jt as covet_pics_widget}
|
|
@@ -12,7 +12,7 @@ import { g as getUseAnalytics } from './getters-C5ofYrUT.js';
|
|
|
12
12
|
const STANDARD_GALLERY_URL = "/api/v1/embed/:id";
|
|
13
13
|
const PRODUCT_GALLERY_URL = "/api/v1/shop/:shop/product/:handle";
|
|
14
14
|
class GalleryLoaderService {
|
|
15
|
-
constructor(env, previewMode) {
|
|
15
|
+
constructor(env, previewMode, customUrl) {
|
|
16
16
|
this.page = 0;
|
|
17
17
|
this.isLoading = false;
|
|
18
18
|
this.totalPages = 1;
|
|
@@ -23,6 +23,8 @@ class GalleryLoaderService {
|
|
|
23
23
|
this.sortType = "";
|
|
24
24
|
this._customSettings = {};
|
|
25
25
|
this._selectedFilters = [];
|
|
26
|
+
// _customUrl can be either a string OR null, defaults to null
|
|
27
|
+
this._customUrl = null;
|
|
26
28
|
this._environment = "production";
|
|
27
29
|
if (typeof previewMode === "boolean") {
|
|
28
30
|
this.previewMode = previewMode;
|
|
@@ -30,9 +32,12 @@ class GalleryLoaderService {
|
|
|
30
32
|
if (typeof env === "string" && Object.keys(BASE_API_URLS$1).includes(env)) {
|
|
31
33
|
this._environment = env;
|
|
32
34
|
}
|
|
35
|
+
if (typeof customUrl === "string" && customUrl) {
|
|
36
|
+
this._customUrl = customUrl;
|
|
37
|
+
}
|
|
33
38
|
}
|
|
34
39
|
get baseUrl() {
|
|
35
|
-
return BASE_API_URLS$1[this._environment];
|
|
40
|
+
return this._customUrl || BASE_API_URLS$1[this._environment];
|
|
36
41
|
}
|
|
37
42
|
// returns `standard_gallery` or `product_gallery`
|
|
38
43
|
get galleryType() {
|
|
@@ -693,7 +698,8 @@ const slice$4 = createSlice({
|
|
|
693
698
|
initialState: {
|
|
694
699
|
baseUrl: "",
|
|
695
700
|
environment: "",
|
|
696
|
-
baseBeaconsUrl: ""
|
|
701
|
+
baseBeaconsUrl: "",
|
|
702
|
+
customUrl: null
|
|
697
703
|
},
|
|
698
704
|
reducers: {
|
|
699
705
|
setEnvironment: (url, action) => {
|
|
@@ -701,13 +707,19 @@ const slice$4 = createSlice({
|
|
|
701
707
|
typeof env === "string" && Object.keys(BASE_API_URLS).includes(env)
|
|
702
708
|
? url.environment = env
|
|
703
709
|
: url.environment = "production";
|
|
704
|
-
url.baseUrl = BASE_API_URLS[url.environment];
|
|
705
|
-
url.baseBeaconsUrl = `${
|
|
710
|
+
url.baseUrl = url.customUrl || BASE_API_URLS[url.environment];
|
|
711
|
+
url.baseBeaconsUrl = `${url.baseUrl}${BEACONS_URL}/`;
|
|
712
|
+
return url;
|
|
713
|
+
},
|
|
714
|
+
setCustomUrl: (url, action) => {
|
|
715
|
+
url.customUrl = action.payload || null;
|
|
716
|
+
url.baseUrl = url.customUrl || BASE_API_URLS[url.environment];
|
|
717
|
+
url.baseBeaconsUrl = `${url.baseUrl}${BEACONS_URL}/`;
|
|
706
718
|
return url;
|
|
707
719
|
},
|
|
708
720
|
}
|
|
709
721
|
});
|
|
710
|
-
const { setEnvironment } = slice$4.actions;
|
|
722
|
+
const { setEnvironment, setCustomUrl } = slice$4.actions;
|
|
711
723
|
var urlReducer = slice$4.reducer;
|
|
712
724
|
|
|
713
725
|
const slice$3 = createSlice({
|
|
@@ -1121,6 +1133,9 @@ const CovetPicsWidget = class {
|
|
|
1121
1133
|
this.appStore = configureStore();
|
|
1122
1134
|
const widgetIdParams = getWidgetId(this.galleryEmbedId, this.shop, this.photoRequestId, this.el);
|
|
1123
1135
|
this.appStore.dispatch(widgetIdUpdated(widgetIdParams));
|
|
1136
|
+
if (this.baseUrl) {
|
|
1137
|
+
this.appStore.dispatch(setCustomUrl(this.baseUrl));
|
|
1138
|
+
}
|
|
1124
1139
|
this.appStore.dispatch(setEnvironment(this.environment));
|
|
1125
1140
|
this.appStore.dispatch(setPreviewMode(this.previewMode));
|
|
1126
1141
|
this.appState = this.appStore.getState();
|
|
@@ -1131,7 +1146,7 @@ const CovetPicsWidget = class {
|
|
|
1131
1146
|
}
|
|
1132
1147
|
setupLoader() {
|
|
1133
1148
|
const uri = window.location;
|
|
1134
|
-
this.loader = new GalleryLoaderService(this.environment, this.previewMode);
|
|
1149
|
+
this.loader = new GalleryLoaderService(this.environment, this.previewMode, this.baseUrl);
|
|
1135
1150
|
if (typeof this.customSettings === "string") {
|
|
1136
1151
|
this.loader.setCustomSettings(JSON.parse(this.customSettings));
|
|
1137
1152
|
}
|
|
@@ -20,5 +20,5 @@ var patchBrowser = () => {
|
|
|
20
20
|
|
|
21
21
|
patchBrowser().then(async (options) => {
|
|
22
22
|
await globalScripts();
|
|
23
|
-
return bootstrapLazy([["covet-pics-post",[[1,"covet-pics-post",{"postId":[2,"post-id"],"environment":[1],"item":[32],"fetchingError":[32]}]]],["covet-pics-crop-text",[[0,"covet-pics-crop-text",{"text":[1],"textClass":[1,"text-class"],"textColor":[1,"text-color"],"ratio":[16],"cropCSS":[32]}]]],["covet-pics-star-rating",[[1,"covet-pics-star-rating",{"rating":[2],"ratingCount":[2,"rating-count"],"starColor":[1,"star-color"],"emptyStarColor":[1,"empty-star-color"],"starBorderColor":[1,"star-border-color"],"starBorderWidth":[2,"star-border-width"],"starSize":[2,"star-size"],"spaceStars":[2,"space-stars"],"spaceStarsText":[2,"space-stars-text"],"showLabel":[4,"show-label"],"label":[1]}]]],["covet-pics-highlighted-hotspots_2",[[0,"covet-pics-highlighted-page",{"thumbnailUrl":[1,"thumbnail-url"],"thumbnailAlt":[1,"thumbnail-alt"],"ariaLabel":[1,"aria-label"],"thumbnailLayout":[1,"thumbnail-layout"],"videoUrl":[1,"video-url"],"videoPoster":[1,"video-poster"],"thumbnailCarouselImages":[16,"thumbnail-carousel-images"],"productLinks":[16,"product-links"],"productBaseImgAlt":[1,"product-base-img-alt"],"reverseClass":[1,"reverse-class"],"isMobile":[4,"is-mobile"],"pageIndex":[2,"page-index"],"caption":[1],"rating":[2],"createdTime":[1,"created-time"],"userName":[1,"user-name"],"mainSliderIndex":[2,"main-slider-index"],"pageId":[2,"page-id"],"appStore":[16,"app-store"],"hideHotspots":[32],"activeProductIndex":[32],"hoverHotspot":[32]},[[0,"changeActiveHotspot","onChangeActiveHotspot"]]],[0,"covet-pics-highlighted-hotspots",{"links":[16],"activeHotspot":[2,"active-hotspot"],"thumbnailUrl":[1,"thumbnail-url"],"hoverHotspot":[2,"hover-hotspot"],"isMobile":[4,"is-mobile"],"productBaseImgAlt":[1,"product-base-img-alt"],"pageId":[2,"page-id"],"appStore":[16,"app-store"]},null,{"thumbnailUrl":["refreshHotspot"],"activeHotspot":["activeHotspotHandler"]}]]],["covet-pics-popup-freeflow-carousel_2",[[0,"covet-pics-popup-freeflow-carousel",{"item":[16],"isEnabled":[4,"is-enabled"],"dataLoaded":[1,"data-loaded"],"sliderIndex":[32],"videoPlay":[64],"videoPause":[64],"videoSoundOn":[64],"videoSoundOff":[64],"pauseAllVideos":[64]},null,{"isEnabled":["enableSlider"],"dataLoaded":["lazyLoadMedia"],"sliderIndex":["updateSliderIndex"]}],[1,"covet-pics-popup-freeflow-links",{"links":[16],"itemCreatedTime":[1,"item-created-time"],"isSliderEnabled":[4,"is-slider-enabled"]},null,{"isSliderEnabled":["enableSlider"]}]]],["covet-pics-direct-buy_7",[[0,"covet-pics-popup-slide",{"item":[16],"showCaption":[4,"show-caption"],"showStarRating":[4,"show-star-rating"],"dataLoaded":[32],"isPlaying":[32],"isMuted":[32],"carouselIndex":[32],"videoProgress":[32],"showCarouselVideoControls":[32],"loadMedia":[64],"videoPlay":[64],"videoPause":[64],"videoSoundOff":[64],"videoSoundOn":[64]}],[1,"covet-pics-direct-buy",{"product":[8],"moneyFormat":[1,"money-format"],"appStore":[16,"app-store"],"selectedOptions":[32],"settings":[32]}],[0,"covet-pics-hotspots",{"links":[16],"backgroundColor":[1,"background-color"],"textColor":[1,"text-color"],"showNumbers":[4,"show-numbers"]},[[0,"linkInactivate","linkInactivateHandler"],[0,"linkActivate","linkActivateHandler"]]],[0,"covet-pics-popup-links",{"links":[16],"greyBorderClass":[1,"grey-border-class"],"itemCreatedTime":[1,"item-created-time"],"appStore":[16,"app-store"],"settings":[32]}],[0,"covet-pics-popup-review",{"rating":[2],"caption":[1],"username":[1],"itemType":[1,"item-type"],"verified":[4],"createdTime":[1,"created-time"],"reviewCSS":[32]},null,{"caption":["watchPropHandler"]}],[0,"covet-pics-popup-shared-links",{"item":[16],"galleryEmbedId":[2,"gallery-embed-id"],"showShareLink":[32],"copyLinkCopied":[32]}],[0,"covet-pics-popup-slider",{"item":[16],"getSwiperState":[64]}]]],["covet-pics-gallery-header_6",[[0,"covet-pics-gallery-header",{"rating":[2],"productTitle":[1,"product-title"],"breakdown":[16],"appStore":[16,"app-store"],"showBreakdownDropdown":[32],"showSortDropdown":[32],"isDesktopScreen":[32]}],[1,"covet-pics-popup",{"appStore":[16,"app-store"],"item":[32],"product":[32],"directBuyIsOpen":[32],"popupTabIndex":[32],"settings":[32],"isPreviousEnable":[32],"isNextEnable":[32],"openPopup":[64],"closePopup":[64]},[[4,"addToCart:covetPics","addToCartHandler"],[16,"productLinkClicked","productLinkClickedHandler"]],{"item":["itemChangedHandler"]}],[1,"covet-pics-popup-freeflow",{"appStore":[16,"app-store"],"settings":[32],"items":[32],"sliderIndex":[32],"tabIndex":[32],"openPopupFreeflow":[64],"closePopupFreeflow":[64]},null,{"sliderIndex":["updateSliderIndex"],"items":["updateItems"]}],[0,"covet-pics-gallery-item",{"altTag":[1,"alt-tag"],"highlighted":[4],"imageUrl":[1,"image-url"],"rating":[2],"itemWidth":[2,"item-width"],"userName":[1,"user-name"],"createdTime":[1,"created-time"],"caption":[1],"itemType":[1,"item-type"],"imageHighResolutionUrl":[1,"image-high-resolution-url"],"imageResponsiveSizes":[1,"image-responsive-sizes"],"itemId":[1,"item-id"],"itemSource":[1,"item-source"],"links":[16],"url":[1],"videoUrl":[1,"video-url"],"itemIndex":[2,"item-index"],"itemSize":[1,"item-size"],"appStore":[16,"app-store"],"tabIndex":[32],"sliderIndex":[32],"showImageAsVideoPoster":[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"]],{"sliderIndex":["autoPlayVideos"]}],[0,"covet-pics-gallery-item-detail",{"altTag":[1,"alt-tag"],"highlighted":[4],"verified":[4],"imageUrl":[1,"image-url"],"imageHighResolutionUrl":[1,"image-high-resolution-url"],"imageResponsiveSizes":[1,"image-responsive-sizes"],"videoUrl":[1,"video-url"],"itemId":[1,"item-id"],"itemSource":[1,"item-source"],"itemType":[1,"item-type"],"links":[16],"url":[1],"rating":[2],"userName":[1,"user-name"],"caption":[1],"createdTime":[1,"created-time"],"itemIndex":[2,"item-index"],"itemSize":[1,"item-size"],"appStore":[16,"app-store"],"tabIndex":[32],"captionCSS":[32],"reviewClass":[32],"starOnlyClass":[32],"highlightedClass":[32],"sliderIndex":[32],"showImageAsVideoPoster":[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"],[8,"elementResize","elementResizeHandler"]],{"sliderIndex":["autoPlayVideos"]}],[1,"covet-pics-upload",{"standalone":[4],"appStore":[16,"app-store"],"starRating":[32],"isFormValid":[32],"showFormWarning":[32],"thumbnailLinks":[32],"toShowLinks":[32],"dropedImagesNumber":[32],"isAnimating":[32],"notificationMessage":[32],"isNotificationActive":[32],"widgetWidth":[32],"uploadTabIndex":[32],"openUpload":[64]}]]],["covet-pics-gallery-grid_3",[[0,"covet-pics-gallery-grid",{"items":[16],"breakdown":[16],"productTitle":[1,"product-title"],"rating":[2],"filtersEnabled":[4,"filters-enabled"],"filters":[16],"showLoadMore":[4,"show-load-more"],"appStore":[16,"app-store"],"sharedItemId":[1,"shared-item-id"],"showSort":[32],"isGridDisabled":[32],"isDesktopScreen":[32],"itemSize":[32],"isFilterModalShow":[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[9,"mousedown","handleClickOutside"],[0,"itemLoaded","handleItemLoaded"]],{"items":["itemsChangeHandler"]}],[0,"covet-pics-gallery-slider",{"items":[16],"sharedItemId":[1,"shared-item-id"],"sliderStyle":[1,"slider-style"],"appStore":[16,"app-store"],"itemSize":[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[0,"itemLoaded","handleItemLoaded"]],{"items":["itemsChangeHandler"]}],[0,"covet-pics-highlighted",{"numberOfPages":[2,"number-of-pages"],"items":[16],"appStore":[16,"app-store"],"productLinks":[32],"mainSliderIndex":[32],"mainSliderAnimatingSlides":[32],"windowHeight":[32],"isDesktopScreen":[32]},[[0,"pageLoaded","handleItemLoaded"]]]]],["covet-pics-widget",[[1,"covet-pics-widget",{"shop":[1],"galleryEmbedId":[2,"gallery-embed-id"],"shopifyProductId":[2,"shopify-product-id"],"environment":[1],"customSettings":[1,"custom-settings"],"hideElements":[1,"hide-elements"],"previewMode":[4,"preview-mode"],"photoRequestId":[2,"photo-request-id"],"lazyLoad":[4,"lazy-load"],"isLoading":[32],"minNumberOfPhotos":[32],"items":[32],"appStore":[32],"fetchingError":[32],"updateUploadWidgetCoverPreview":[64],"updatePreviewSettings":[64]},[[0,"sortUpdated","sortUpdatedHandler"],[0,"filtersUpdated","filtersUpdatedHandler"],[0,"nextPage","nextPageHandler"],[4,"popupFreeflowNextPage","nextPageHandlerFreeflow"]]]]]], options);
|
|
23
|
+
return bootstrapLazy([["covet-pics-post",[[1,"covet-pics-post",{"postId":[2,"post-id"],"environment":[1],"item":[32],"fetchingError":[32]}]]],["covet-pics-crop-text",[[0,"covet-pics-crop-text",{"text":[1],"textClass":[1,"text-class"],"textColor":[1,"text-color"],"ratio":[16],"cropCSS":[32]}]]],["covet-pics-star-rating",[[1,"covet-pics-star-rating",{"rating":[2],"ratingCount":[2,"rating-count"],"starColor":[1,"star-color"],"emptyStarColor":[1,"empty-star-color"],"starBorderColor":[1,"star-border-color"],"starBorderWidth":[2,"star-border-width"],"starSize":[2,"star-size"],"spaceStars":[2,"space-stars"],"spaceStarsText":[2,"space-stars-text"],"showLabel":[4,"show-label"],"label":[1]}]]],["covet-pics-highlighted-hotspots_2",[[0,"covet-pics-highlighted-page",{"thumbnailUrl":[1,"thumbnail-url"],"thumbnailAlt":[1,"thumbnail-alt"],"ariaLabel":[1,"aria-label"],"thumbnailLayout":[1,"thumbnail-layout"],"videoUrl":[1,"video-url"],"videoPoster":[1,"video-poster"],"thumbnailCarouselImages":[16,"thumbnail-carousel-images"],"productLinks":[16,"product-links"],"productBaseImgAlt":[1,"product-base-img-alt"],"reverseClass":[1,"reverse-class"],"isMobile":[4,"is-mobile"],"pageIndex":[2,"page-index"],"caption":[1],"rating":[2],"createdTime":[1,"created-time"],"userName":[1,"user-name"],"mainSliderIndex":[2,"main-slider-index"],"pageId":[2,"page-id"],"appStore":[16,"app-store"],"hideHotspots":[32],"activeProductIndex":[32],"hoverHotspot":[32]},[[0,"changeActiveHotspot","onChangeActiveHotspot"]]],[0,"covet-pics-highlighted-hotspots",{"links":[16],"activeHotspot":[2,"active-hotspot"],"thumbnailUrl":[1,"thumbnail-url"],"hoverHotspot":[2,"hover-hotspot"],"isMobile":[4,"is-mobile"],"productBaseImgAlt":[1,"product-base-img-alt"],"pageId":[2,"page-id"],"appStore":[16,"app-store"]},null,{"thumbnailUrl":["refreshHotspot"],"activeHotspot":["activeHotspotHandler"]}]]],["covet-pics-popup-freeflow-carousel_2",[[0,"covet-pics-popup-freeflow-carousel",{"item":[16],"isEnabled":[4,"is-enabled"],"dataLoaded":[1,"data-loaded"],"sliderIndex":[32],"videoPlay":[64],"videoPause":[64],"videoSoundOn":[64],"videoSoundOff":[64],"pauseAllVideos":[64]},null,{"isEnabled":["enableSlider"],"dataLoaded":["lazyLoadMedia"],"sliderIndex":["updateSliderIndex"]}],[1,"covet-pics-popup-freeflow-links",{"links":[16],"itemCreatedTime":[1,"item-created-time"],"isSliderEnabled":[4,"is-slider-enabled"]},null,{"isSliderEnabled":["enableSlider"]}]]],["covet-pics-direct-buy_7",[[0,"covet-pics-popup-slide",{"item":[16],"showCaption":[4,"show-caption"],"showStarRating":[4,"show-star-rating"],"dataLoaded":[32],"isPlaying":[32],"isMuted":[32],"carouselIndex":[32],"videoProgress":[32],"showCarouselVideoControls":[32],"loadMedia":[64],"videoPlay":[64],"videoPause":[64],"videoSoundOff":[64],"videoSoundOn":[64]}],[1,"covet-pics-direct-buy",{"product":[8],"moneyFormat":[1,"money-format"],"appStore":[16,"app-store"],"selectedOptions":[32],"settings":[32]}],[0,"covet-pics-hotspots",{"links":[16],"backgroundColor":[1,"background-color"],"textColor":[1,"text-color"],"showNumbers":[4,"show-numbers"]},[[0,"linkInactivate","linkInactivateHandler"],[0,"linkActivate","linkActivateHandler"]]],[0,"covet-pics-popup-links",{"links":[16],"greyBorderClass":[1,"grey-border-class"],"itemCreatedTime":[1,"item-created-time"],"appStore":[16,"app-store"],"settings":[32]}],[0,"covet-pics-popup-review",{"rating":[2],"caption":[1],"username":[1],"itemType":[1,"item-type"],"verified":[4],"createdTime":[1,"created-time"],"reviewCSS":[32]},null,{"caption":["watchPropHandler"]}],[0,"covet-pics-popup-shared-links",{"item":[16],"galleryEmbedId":[2,"gallery-embed-id"],"showShareLink":[32],"copyLinkCopied":[32]}],[0,"covet-pics-popup-slider",{"item":[16],"getSwiperState":[64]}]]],["covet-pics-gallery-header_6",[[0,"covet-pics-gallery-header",{"rating":[2],"productTitle":[1,"product-title"],"breakdown":[16],"appStore":[16,"app-store"],"showBreakdownDropdown":[32],"showSortDropdown":[32],"isDesktopScreen":[32]}],[1,"covet-pics-popup",{"appStore":[16,"app-store"],"item":[32],"product":[32],"directBuyIsOpen":[32],"popupTabIndex":[32],"settings":[32],"isPreviousEnable":[32],"isNextEnable":[32],"openPopup":[64],"closePopup":[64]},[[4,"addToCart:covetPics","addToCartHandler"],[16,"productLinkClicked","productLinkClickedHandler"]],{"item":["itemChangedHandler"]}],[1,"covet-pics-popup-freeflow",{"appStore":[16,"app-store"],"settings":[32],"items":[32],"sliderIndex":[32],"tabIndex":[32],"openPopupFreeflow":[64],"closePopupFreeflow":[64]},null,{"sliderIndex":["updateSliderIndex"],"items":["updateItems"]}],[0,"covet-pics-gallery-item",{"altTag":[1,"alt-tag"],"highlighted":[4],"imageUrl":[1,"image-url"],"rating":[2],"itemWidth":[2,"item-width"],"userName":[1,"user-name"],"createdTime":[1,"created-time"],"caption":[1],"itemType":[1,"item-type"],"imageHighResolutionUrl":[1,"image-high-resolution-url"],"imageResponsiveSizes":[1,"image-responsive-sizes"],"itemId":[1,"item-id"],"itemSource":[1,"item-source"],"links":[16],"url":[1],"videoUrl":[1,"video-url"],"itemIndex":[2,"item-index"],"itemSize":[1,"item-size"],"appStore":[16,"app-store"],"tabIndex":[32],"sliderIndex":[32],"showImageAsVideoPoster":[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"]],{"sliderIndex":["autoPlayVideos"]}],[0,"covet-pics-gallery-item-detail",{"altTag":[1,"alt-tag"],"highlighted":[4],"verified":[4],"imageUrl":[1,"image-url"],"imageHighResolutionUrl":[1,"image-high-resolution-url"],"imageResponsiveSizes":[1,"image-responsive-sizes"],"videoUrl":[1,"video-url"],"itemId":[1,"item-id"],"itemSource":[1,"item-source"],"itemType":[1,"item-type"],"links":[16],"url":[1],"rating":[2],"userName":[1,"user-name"],"caption":[1],"createdTime":[1,"created-time"],"itemIndex":[2,"item-index"],"itemSize":[1,"item-size"],"appStore":[16,"app-store"],"tabIndex":[32],"captionCSS":[32],"reviewClass":[32],"starOnlyClass":[32],"highlightedClass":[32],"sliderIndex":[32],"showImageAsVideoPoster":[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"],[8,"elementResize","elementResizeHandler"]],{"sliderIndex":["autoPlayVideos"]}],[1,"covet-pics-upload",{"standalone":[4],"appStore":[16,"app-store"],"starRating":[32],"isFormValid":[32],"showFormWarning":[32],"thumbnailLinks":[32],"toShowLinks":[32],"dropedImagesNumber":[32],"isAnimating":[32],"notificationMessage":[32],"isNotificationActive":[32],"widgetWidth":[32],"uploadTabIndex":[32],"openUpload":[64]}]]],["covet-pics-gallery-grid_3",[[0,"covet-pics-gallery-grid",{"items":[16],"breakdown":[16],"productTitle":[1,"product-title"],"rating":[2],"filtersEnabled":[4,"filters-enabled"],"filters":[16],"showLoadMore":[4,"show-load-more"],"appStore":[16,"app-store"],"sharedItemId":[1,"shared-item-id"],"showSort":[32],"isGridDisabled":[32],"isDesktopScreen":[32],"itemSize":[32],"isFilterModalShow":[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[9,"mousedown","handleClickOutside"],[0,"itemLoaded","handleItemLoaded"]],{"items":["itemsChangeHandler"]}],[0,"covet-pics-gallery-slider",{"items":[16],"sharedItemId":[1,"shared-item-id"],"sliderStyle":[1,"slider-style"],"appStore":[16,"app-store"],"itemSize":[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[0,"itemLoaded","handleItemLoaded"]],{"items":["itemsChangeHandler"]}],[0,"covet-pics-highlighted",{"numberOfPages":[2,"number-of-pages"],"items":[16],"appStore":[16,"app-store"],"productLinks":[32],"mainSliderIndex":[32],"mainSliderAnimatingSlides":[32],"windowHeight":[32],"isDesktopScreen":[32]},[[0,"pageLoaded","handleItemLoaded"]]]]],["covet-pics-widget",[[1,"covet-pics-widget",{"shop":[1],"galleryEmbedId":[2,"gallery-embed-id"],"shopifyProductId":[2,"shopify-product-id"],"environment":[1],"baseUrl":[1,"base-url"],"customSettings":[1,"custom-settings"],"hideElements":[1,"hide-elements"],"previewMode":[4,"preview-mode"],"photoRequestId":[2,"photo-request-id"],"lazyLoad":[4,"lazy-load"],"isLoading":[32],"minNumberOfPhotos":[32],"items":[32],"appStore":[32],"fetchingError":[32],"updateUploadWidgetCoverPreview":[64],"updatePreviewSettings":[64]},[[0,"sortUpdated","sortUpdatedHandler"],[0,"filtersUpdated","filtersUpdatedHandler"],[0,"nextPage","nextPageHandler"],[4,"popupFreeflowNextPage","nextPageHandlerFreeflow"]]]]]], options);
|
|
24
24
|
});
|
package/dist/esm/loader.js
CHANGED
|
@@ -8,7 +8,7 @@ import { g as globalScripts } from './app-globals-CWiAxP5O.js';
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await globalScripts();
|
|
11
|
-
return bootstrapLazy([["covet-pics-post",[[1,"covet-pics-post",{"postId":[2,"post-id"],"environment":[1],"item":[32],"fetchingError":[32]}]]],["covet-pics-crop-text",[[0,"covet-pics-crop-text",{"text":[1],"textClass":[1,"text-class"],"textColor":[1,"text-color"],"ratio":[16],"cropCSS":[32]}]]],["covet-pics-star-rating",[[1,"covet-pics-star-rating",{"rating":[2],"ratingCount":[2,"rating-count"],"starColor":[1,"star-color"],"emptyStarColor":[1,"empty-star-color"],"starBorderColor":[1,"star-border-color"],"starBorderWidth":[2,"star-border-width"],"starSize":[2,"star-size"],"spaceStars":[2,"space-stars"],"spaceStarsText":[2,"space-stars-text"],"showLabel":[4,"show-label"],"label":[1]}]]],["covet-pics-highlighted-hotspots_2",[[0,"covet-pics-highlighted-page",{"thumbnailUrl":[1,"thumbnail-url"],"thumbnailAlt":[1,"thumbnail-alt"],"ariaLabel":[1,"aria-label"],"thumbnailLayout":[1,"thumbnail-layout"],"videoUrl":[1,"video-url"],"videoPoster":[1,"video-poster"],"thumbnailCarouselImages":[16,"thumbnail-carousel-images"],"productLinks":[16,"product-links"],"productBaseImgAlt":[1,"product-base-img-alt"],"reverseClass":[1,"reverse-class"],"isMobile":[4,"is-mobile"],"pageIndex":[2,"page-index"],"caption":[1],"rating":[2],"createdTime":[1,"created-time"],"userName":[1,"user-name"],"mainSliderIndex":[2,"main-slider-index"],"pageId":[2,"page-id"],"appStore":[16,"app-store"],"hideHotspots":[32],"activeProductIndex":[32],"hoverHotspot":[32]},[[0,"changeActiveHotspot","onChangeActiveHotspot"]]],[0,"covet-pics-highlighted-hotspots",{"links":[16],"activeHotspot":[2,"active-hotspot"],"thumbnailUrl":[1,"thumbnail-url"],"hoverHotspot":[2,"hover-hotspot"],"isMobile":[4,"is-mobile"],"productBaseImgAlt":[1,"product-base-img-alt"],"pageId":[2,"page-id"],"appStore":[16,"app-store"]},null,{"thumbnailUrl":["refreshHotspot"],"activeHotspot":["activeHotspotHandler"]}]]],["covet-pics-popup-freeflow-carousel_2",[[0,"covet-pics-popup-freeflow-carousel",{"item":[16],"isEnabled":[4,"is-enabled"],"dataLoaded":[1,"data-loaded"],"sliderIndex":[32],"videoPlay":[64],"videoPause":[64],"videoSoundOn":[64],"videoSoundOff":[64],"pauseAllVideos":[64]},null,{"isEnabled":["enableSlider"],"dataLoaded":["lazyLoadMedia"],"sliderIndex":["updateSliderIndex"]}],[1,"covet-pics-popup-freeflow-links",{"links":[16],"itemCreatedTime":[1,"item-created-time"],"isSliderEnabled":[4,"is-slider-enabled"]},null,{"isSliderEnabled":["enableSlider"]}]]],["covet-pics-direct-buy_7",[[0,"covet-pics-popup-slide",{"item":[16],"showCaption":[4,"show-caption"],"showStarRating":[4,"show-star-rating"],"dataLoaded":[32],"isPlaying":[32],"isMuted":[32],"carouselIndex":[32],"videoProgress":[32],"showCarouselVideoControls":[32],"loadMedia":[64],"videoPlay":[64],"videoPause":[64],"videoSoundOff":[64],"videoSoundOn":[64]}],[1,"covet-pics-direct-buy",{"product":[8],"moneyFormat":[1,"money-format"],"appStore":[16,"app-store"],"selectedOptions":[32],"settings":[32]}],[0,"covet-pics-hotspots",{"links":[16],"backgroundColor":[1,"background-color"],"textColor":[1,"text-color"],"showNumbers":[4,"show-numbers"]},[[0,"linkInactivate","linkInactivateHandler"],[0,"linkActivate","linkActivateHandler"]]],[0,"covet-pics-popup-links",{"links":[16],"greyBorderClass":[1,"grey-border-class"],"itemCreatedTime":[1,"item-created-time"],"appStore":[16,"app-store"],"settings":[32]}],[0,"covet-pics-popup-review",{"rating":[2],"caption":[1],"username":[1],"itemType":[1,"item-type"],"verified":[4],"createdTime":[1,"created-time"],"reviewCSS":[32]},null,{"caption":["watchPropHandler"]}],[0,"covet-pics-popup-shared-links",{"item":[16],"galleryEmbedId":[2,"gallery-embed-id"],"showShareLink":[32],"copyLinkCopied":[32]}],[0,"covet-pics-popup-slider",{"item":[16],"getSwiperState":[64]}]]],["covet-pics-gallery-header_6",[[0,"covet-pics-gallery-header",{"rating":[2],"productTitle":[1,"product-title"],"breakdown":[16],"appStore":[16,"app-store"],"showBreakdownDropdown":[32],"showSortDropdown":[32],"isDesktopScreen":[32]}],[1,"covet-pics-popup",{"appStore":[16,"app-store"],"item":[32],"product":[32],"directBuyIsOpen":[32],"popupTabIndex":[32],"settings":[32],"isPreviousEnable":[32],"isNextEnable":[32],"openPopup":[64],"closePopup":[64]},[[4,"addToCart:covetPics","addToCartHandler"],[16,"productLinkClicked","productLinkClickedHandler"]],{"item":["itemChangedHandler"]}],[1,"covet-pics-popup-freeflow",{"appStore":[16,"app-store"],"settings":[32],"items":[32],"sliderIndex":[32],"tabIndex":[32],"openPopupFreeflow":[64],"closePopupFreeflow":[64]},null,{"sliderIndex":["updateSliderIndex"],"items":["updateItems"]}],[0,"covet-pics-gallery-item",{"altTag":[1,"alt-tag"],"highlighted":[4],"imageUrl":[1,"image-url"],"rating":[2],"itemWidth":[2,"item-width"],"userName":[1,"user-name"],"createdTime":[1,"created-time"],"caption":[1],"itemType":[1,"item-type"],"imageHighResolutionUrl":[1,"image-high-resolution-url"],"imageResponsiveSizes":[1,"image-responsive-sizes"],"itemId":[1,"item-id"],"itemSource":[1,"item-source"],"links":[16],"url":[1],"videoUrl":[1,"video-url"],"itemIndex":[2,"item-index"],"itemSize":[1,"item-size"],"appStore":[16,"app-store"],"tabIndex":[32],"sliderIndex":[32],"showImageAsVideoPoster":[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"]],{"sliderIndex":["autoPlayVideos"]}],[0,"covet-pics-gallery-item-detail",{"altTag":[1,"alt-tag"],"highlighted":[4],"verified":[4],"imageUrl":[1,"image-url"],"imageHighResolutionUrl":[1,"image-high-resolution-url"],"imageResponsiveSizes":[1,"image-responsive-sizes"],"videoUrl":[1,"video-url"],"itemId":[1,"item-id"],"itemSource":[1,"item-source"],"itemType":[1,"item-type"],"links":[16],"url":[1],"rating":[2],"userName":[1,"user-name"],"caption":[1],"createdTime":[1,"created-time"],"itemIndex":[2,"item-index"],"itemSize":[1,"item-size"],"appStore":[16,"app-store"],"tabIndex":[32],"captionCSS":[32],"reviewClass":[32],"starOnlyClass":[32],"highlightedClass":[32],"sliderIndex":[32],"showImageAsVideoPoster":[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"],[8,"elementResize","elementResizeHandler"]],{"sliderIndex":["autoPlayVideos"]}],[1,"covet-pics-upload",{"standalone":[4],"appStore":[16,"app-store"],"starRating":[32],"isFormValid":[32],"showFormWarning":[32],"thumbnailLinks":[32],"toShowLinks":[32],"dropedImagesNumber":[32],"isAnimating":[32],"notificationMessage":[32],"isNotificationActive":[32],"widgetWidth":[32],"uploadTabIndex":[32],"openUpload":[64]}]]],["covet-pics-gallery-grid_3",[[0,"covet-pics-gallery-grid",{"items":[16],"breakdown":[16],"productTitle":[1,"product-title"],"rating":[2],"filtersEnabled":[4,"filters-enabled"],"filters":[16],"showLoadMore":[4,"show-load-more"],"appStore":[16,"app-store"],"sharedItemId":[1,"shared-item-id"],"showSort":[32],"isGridDisabled":[32],"isDesktopScreen":[32],"itemSize":[32],"isFilterModalShow":[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[9,"mousedown","handleClickOutside"],[0,"itemLoaded","handleItemLoaded"]],{"items":["itemsChangeHandler"]}],[0,"covet-pics-gallery-slider",{"items":[16],"sharedItemId":[1,"shared-item-id"],"sliderStyle":[1,"slider-style"],"appStore":[16,"app-store"],"itemSize":[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[0,"itemLoaded","handleItemLoaded"]],{"items":["itemsChangeHandler"]}],[0,"covet-pics-highlighted",{"numberOfPages":[2,"number-of-pages"],"items":[16],"appStore":[16,"app-store"],"productLinks":[32],"mainSliderIndex":[32],"mainSliderAnimatingSlides":[32],"windowHeight":[32],"isDesktopScreen":[32]},[[0,"pageLoaded","handleItemLoaded"]]]]],["covet-pics-widget",[[1,"covet-pics-widget",{"shop":[1],"galleryEmbedId":[2,"gallery-embed-id"],"shopifyProductId":[2,"shopify-product-id"],"environment":[1],"customSettings":[1,"custom-settings"],"hideElements":[1,"hide-elements"],"previewMode":[4,"preview-mode"],"photoRequestId":[2,"photo-request-id"],"lazyLoad":[4,"lazy-load"],"isLoading":[32],"minNumberOfPhotos":[32],"items":[32],"appStore":[32],"fetchingError":[32],"updateUploadWidgetCoverPreview":[64],"updatePreviewSettings":[64]},[[0,"sortUpdated","sortUpdatedHandler"],[0,"filtersUpdated","filtersUpdatedHandler"],[0,"nextPage","nextPageHandler"],[4,"popupFreeflowNextPage","nextPageHandlerFreeflow"]]]]]], options);
|
|
11
|
+
return bootstrapLazy([["covet-pics-post",[[1,"covet-pics-post",{"postId":[2,"post-id"],"environment":[1],"item":[32],"fetchingError":[32]}]]],["covet-pics-crop-text",[[0,"covet-pics-crop-text",{"text":[1],"textClass":[1,"text-class"],"textColor":[1,"text-color"],"ratio":[16],"cropCSS":[32]}]]],["covet-pics-star-rating",[[1,"covet-pics-star-rating",{"rating":[2],"ratingCount":[2,"rating-count"],"starColor":[1,"star-color"],"emptyStarColor":[1,"empty-star-color"],"starBorderColor":[1,"star-border-color"],"starBorderWidth":[2,"star-border-width"],"starSize":[2,"star-size"],"spaceStars":[2,"space-stars"],"spaceStarsText":[2,"space-stars-text"],"showLabel":[4,"show-label"],"label":[1]}]]],["covet-pics-highlighted-hotspots_2",[[0,"covet-pics-highlighted-page",{"thumbnailUrl":[1,"thumbnail-url"],"thumbnailAlt":[1,"thumbnail-alt"],"ariaLabel":[1,"aria-label"],"thumbnailLayout":[1,"thumbnail-layout"],"videoUrl":[1,"video-url"],"videoPoster":[1,"video-poster"],"thumbnailCarouselImages":[16,"thumbnail-carousel-images"],"productLinks":[16,"product-links"],"productBaseImgAlt":[1,"product-base-img-alt"],"reverseClass":[1,"reverse-class"],"isMobile":[4,"is-mobile"],"pageIndex":[2,"page-index"],"caption":[1],"rating":[2],"createdTime":[1,"created-time"],"userName":[1,"user-name"],"mainSliderIndex":[2,"main-slider-index"],"pageId":[2,"page-id"],"appStore":[16,"app-store"],"hideHotspots":[32],"activeProductIndex":[32],"hoverHotspot":[32]},[[0,"changeActiveHotspot","onChangeActiveHotspot"]]],[0,"covet-pics-highlighted-hotspots",{"links":[16],"activeHotspot":[2,"active-hotspot"],"thumbnailUrl":[1,"thumbnail-url"],"hoverHotspot":[2,"hover-hotspot"],"isMobile":[4,"is-mobile"],"productBaseImgAlt":[1,"product-base-img-alt"],"pageId":[2,"page-id"],"appStore":[16,"app-store"]},null,{"thumbnailUrl":["refreshHotspot"],"activeHotspot":["activeHotspotHandler"]}]]],["covet-pics-popup-freeflow-carousel_2",[[0,"covet-pics-popup-freeflow-carousel",{"item":[16],"isEnabled":[4,"is-enabled"],"dataLoaded":[1,"data-loaded"],"sliderIndex":[32],"videoPlay":[64],"videoPause":[64],"videoSoundOn":[64],"videoSoundOff":[64],"pauseAllVideos":[64]},null,{"isEnabled":["enableSlider"],"dataLoaded":["lazyLoadMedia"],"sliderIndex":["updateSliderIndex"]}],[1,"covet-pics-popup-freeflow-links",{"links":[16],"itemCreatedTime":[1,"item-created-time"],"isSliderEnabled":[4,"is-slider-enabled"]},null,{"isSliderEnabled":["enableSlider"]}]]],["covet-pics-direct-buy_7",[[0,"covet-pics-popup-slide",{"item":[16],"showCaption":[4,"show-caption"],"showStarRating":[4,"show-star-rating"],"dataLoaded":[32],"isPlaying":[32],"isMuted":[32],"carouselIndex":[32],"videoProgress":[32],"showCarouselVideoControls":[32],"loadMedia":[64],"videoPlay":[64],"videoPause":[64],"videoSoundOff":[64],"videoSoundOn":[64]}],[1,"covet-pics-direct-buy",{"product":[8],"moneyFormat":[1,"money-format"],"appStore":[16,"app-store"],"selectedOptions":[32],"settings":[32]}],[0,"covet-pics-hotspots",{"links":[16],"backgroundColor":[1,"background-color"],"textColor":[1,"text-color"],"showNumbers":[4,"show-numbers"]},[[0,"linkInactivate","linkInactivateHandler"],[0,"linkActivate","linkActivateHandler"]]],[0,"covet-pics-popup-links",{"links":[16],"greyBorderClass":[1,"grey-border-class"],"itemCreatedTime":[1,"item-created-time"],"appStore":[16,"app-store"],"settings":[32]}],[0,"covet-pics-popup-review",{"rating":[2],"caption":[1],"username":[1],"itemType":[1,"item-type"],"verified":[4],"createdTime":[1,"created-time"],"reviewCSS":[32]},null,{"caption":["watchPropHandler"]}],[0,"covet-pics-popup-shared-links",{"item":[16],"galleryEmbedId":[2,"gallery-embed-id"],"showShareLink":[32],"copyLinkCopied":[32]}],[0,"covet-pics-popup-slider",{"item":[16],"getSwiperState":[64]}]]],["covet-pics-gallery-header_6",[[0,"covet-pics-gallery-header",{"rating":[2],"productTitle":[1,"product-title"],"breakdown":[16],"appStore":[16,"app-store"],"showBreakdownDropdown":[32],"showSortDropdown":[32],"isDesktopScreen":[32]}],[1,"covet-pics-popup",{"appStore":[16,"app-store"],"item":[32],"product":[32],"directBuyIsOpen":[32],"popupTabIndex":[32],"settings":[32],"isPreviousEnable":[32],"isNextEnable":[32],"openPopup":[64],"closePopup":[64]},[[4,"addToCart:covetPics","addToCartHandler"],[16,"productLinkClicked","productLinkClickedHandler"]],{"item":["itemChangedHandler"]}],[1,"covet-pics-popup-freeflow",{"appStore":[16,"app-store"],"settings":[32],"items":[32],"sliderIndex":[32],"tabIndex":[32],"openPopupFreeflow":[64],"closePopupFreeflow":[64]},null,{"sliderIndex":["updateSliderIndex"],"items":["updateItems"]}],[0,"covet-pics-gallery-item",{"altTag":[1,"alt-tag"],"highlighted":[4],"imageUrl":[1,"image-url"],"rating":[2],"itemWidth":[2,"item-width"],"userName":[1,"user-name"],"createdTime":[1,"created-time"],"caption":[1],"itemType":[1,"item-type"],"imageHighResolutionUrl":[1,"image-high-resolution-url"],"imageResponsiveSizes":[1,"image-responsive-sizes"],"itemId":[1,"item-id"],"itemSource":[1,"item-source"],"links":[16],"url":[1],"videoUrl":[1,"video-url"],"itemIndex":[2,"item-index"],"itemSize":[1,"item-size"],"appStore":[16,"app-store"],"tabIndex":[32],"sliderIndex":[32],"showImageAsVideoPoster":[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"]],{"sliderIndex":["autoPlayVideos"]}],[0,"covet-pics-gallery-item-detail",{"altTag":[1,"alt-tag"],"highlighted":[4],"verified":[4],"imageUrl":[1,"image-url"],"imageHighResolutionUrl":[1,"image-high-resolution-url"],"imageResponsiveSizes":[1,"image-responsive-sizes"],"videoUrl":[1,"video-url"],"itemId":[1,"item-id"],"itemSource":[1,"item-source"],"itemType":[1,"item-type"],"links":[16],"url":[1],"rating":[2],"userName":[1,"user-name"],"caption":[1],"createdTime":[1,"created-time"],"itemIndex":[2,"item-index"],"itemSize":[1,"item-size"],"appStore":[16,"app-store"],"tabIndex":[32],"captionCSS":[32],"reviewClass":[32],"starOnlyClass":[32],"highlightedClass":[32],"sliderIndex":[32],"showImageAsVideoPoster":[32]},[[10,"updateUploadWidgetCover","updateUploadWidgetCoverHandler"],[8,"elementResize","elementResizeHandler"]],{"sliderIndex":["autoPlayVideos"]}],[1,"covet-pics-upload",{"standalone":[4],"appStore":[16,"app-store"],"starRating":[32],"isFormValid":[32],"showFormWarning":[32],"thumbnailLinks":[32],"toShowLinks":[32],"dropedImagesNumber":[32],"isAnimating":[32],"notificationMessage":[32],"isNotificationActive":[32],"widgetWidth":[32],"uploadTabIndex":[32],"openUpload":[64]}]]],["covet-pics-gallery-grid_3",[[0,"covet-pics-gallery-grid",{"items":[16],"breakdown":[16],"productTitle":[1,"product-title"],"rating":[2],"filtersEnabled":[4,"filters-enabled"],"filters":[16],"showLoadMore":[4,"show-load-more"],"appStore":[16,"app-store"],"sharedItemId":[1,"shared-item-id"],"showSort":[32],"isGridDisabled":[32],"isDesktopScreen":[32],"itemSize":[32],"isFilterModalShow":[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[9,"mousedown","handleClickOutside"],[0,"itemLoaded","handleItemLoaded"]],{"items":["itemsChangeHandler"]}],[0,"covet-pics-gallery-slider",{"items":[16],"sharedItemId":[1,"shared-item-id"],"sliderStyle":[1,"slider-style"],"appStore":[16,"app-store"],"itemSize":[32]},[[0,"imageLoaded","imagesLoadedHandler"],[0,"itemClicked","itemClickedHandler"],[8,"previousPopupEvent","prevPopupHandler"],[8,"nextPopupEvent","nextPopupHandler"],[8,"elementResize","elementResizeHandler"],[0,"itemLoaded","handleItemLoaded"]],{"items":["itemsChangeHandler"]}],[0,"covet-pics-highlighted",{"numberOfPages":[2,"number-of-pages"],"items":[16],"appStore":[16,"app-store"],"productLinks":[32],"mainSliderIndex":[32],"mainSliderAnimatingSlides":[32],"windowHeight":[32],"isDesktopScreen":[32]},[[0,"pageLoaded","handleItemLoaded"]]]]],["covet-pics-widget",[[1,"covet-pics-widget",{"shop":[1],"galleryEmbedId":[2,"gallery-embed-id"],"shopifyProductId":[2,"shopify-product-id"],"environment":[1],"baseUrl":[1,"base-url"],"customSettings":[1,"custom-settings"],"hideElements":[1,"hide-elements"],"previewMode":[4,"preview-mode"],"photoRequestId":[2,"photo-request-id"],"lazyLoad":[4,"lazy-load"],"isLoading":[32],"minNumberOfPhotos":[32],"items":[32],"appStore":[32],"fetchingError":[32],"updateUploadWidgetCoverPreview":[64],"updatePreviewSettings":[64]},[[0,"sortUpdated","sortUpdatedHandler"],[0,"filtersUpdated","filtersUpdatedHandler"],[0,"nextPage","nextPageHandler"],[4,"popupFreeflowNextPage","nextPageHandlerFreeflow"]]]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export { defineCustomElements };
|
|
@@ -18,6 +18,10 @@ export declare class CovetPicsWidget {
|
|
|
18
18
|
* App environment: shows which API base URL has to be used
|
|
19
19
|
*/
|
|
20
20
|
environment: string;
|
|
21
|
+
/**
|
|
22
|
+
* Custom API base URL (overrides environment-based URL)
|
|
23
|
+
*/
|
|
24
|
+
baseUrl: string;
|
|
21
25
|
/**
|
|
22
26
|
* App customSettings for testing new layouts
|
|
23
27
|
*/
|
|
@@ -607,6 +607,10 @@ export namespace Components {
|
|
|
607
607
|
"standalone": boolean;
|
|
608
608
|
}
|
|
609
609
|
interface CovetPicsWidget {
|
|
610
|
+
/**
|
|
611
|
+
* Custom API base URL (overrides environment-based URL)
|
|
612
|
+
*/
|
|
613
|
+
"baseUrl": string;
|
|
610
614
|
/**
|
|
611
615
|
* App customSettings for testing new layouts
|
|
612
616
|
*/
|
|
@@ -1640,6 +1644,10 @@ declare namespace LocalJSX {
|
|
|
1640
1644
|
"standalone"?: boolean;
|
|
1641
1645
|
}
|
|
1642
1646
|
interface CovetPicsWidget {
|
|
1647
|
+
/**
|
|
1648
|
+
* Custom API base URL (overrides environment-based URL)
|
|
1649
|
+
*/
|
|
1650
|
+
"baseUrl"?: string;
|
|
1643
1651
|
/**
|
|
1644
1652
|
* App customSettings for testing new layouts
|
|
1645
1653
|
*/
|
|
@@ -16,7 +16,8 @@ export declare class GalleryLoaderService {
|
|
|
16
16
|
private _environment;
|
|
17
17
|
private _customSettings;
|
|
18
18
|
private _selectedFilters;
|
|
19
|
-
|
|
19
|
+
private _customUrl;
|
|
20
|
+
constructor(env: string, previewMode?: boolean, customUrl?: string);
|
|
20
21
|
get baseUrl(): any;
|
|
21
22
|
get galleryType(): "product_gallery" | "standard_gallery";
|
|
22
23
|
setCustomSettings(settings: object): object;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export declare const setEnvironment: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "url/setEnvironment">;
|
|
1
|
+
export declare const setEnvironment: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "url/setEnvironment">, setCustomUrl: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "url/setCustomUrl">;
|
|
2
2
|
declare const _default: import("redux").Reducer<{
|
|
3
3
|
baseUrl: string;
|
|
4
4
|
environment: string;
|
|
5
5
|
baseBeaconsUrl: string;
|
|
6
|
+
customUrl: any;
|
|
6
7
|
}>;
|
|
7
8
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright by Space Squirrel Ltd.
|
|
3
|
-
*/
|
|
4
|
-
import{r as t,c as e,h as i,H as o,g as s}from"./p-C-mGosc6.js";import{B as r,s as n,f as h}from"./p-BODOgEuN.js";import{c as a,a as l,p as d,b as c,s as u}from"./p-B68hw7d9.js";import{m as _,s as p}from"./p-BJA1jk-5.js";import{s as m}from"./p-CP5h6CHJ.js";import{g as f,s as b}from"./p-Mc-D_Wnh.js";import{g}from"./p-C5ofYrUT.js";class v{constructor(t,e){this.page=0,this.isLoading=!1,this.totalPages=1,this.previewSettings={},this.previewHoverMode=!1,this.previewPopupMode=!1,this.previewMode=!1,this.sortType="",this._customSettings={},this._selectedFilters=[],this._environment="production","boolean"==typeof e&&(this.previewMode=e),"string"==typeof t&&Object.keys(r).includes(t)&&(this._environment=t)}get baseUrl(){return r[this._environment]}get galleryType(){return this.productHandle?"product_gallery":"standard_gallery"}setCustomSettings(t){return this._customSettings=Object.assign({},t),Object.keys(this._customSettings).forEach((t=>null===this._customSettings[t]?delete this._customSettings[t]:this._customSettings[t])),this._customSettings}setSelectedFilters(t){return this._selectedFilters=[...t]}standardGalleryUrl(){return"/api/v1/embed/:id".replace(":id",this.embedId)}productGalleryUrl(){return"/api/v1/shop/:shop/product/:handle".replace(":shop",this.shopDomain).replace(":handle",this.productHandle)}galleryUrl(){if("testing"===this._environment)return"http://localhost:3000/embed";let t=this.baseUrl;return t+=this.productHandle?this.productGalleryUrl():this.standardGalleryUrl(),this.previewMode&&(t+="/preview"),""!==this.sortType&&(t+=`?sort_by=${this.sortType}`),t}resetPagination(){this.page=0,this.totalPages=1}async fetchItems(){if(this.isLoading||this.page>=this.totalPages)return;this.isLoading=!0,this.page+=1;let t=this.galleryUrl();const e=[];this.page>1&&e.push(`page=${this.page}`),this._selectedFilters.length>0&&(this.previewMode?this.previewSettings.filters=this._selectedFilters:this._selectedFilters.forEach((t=>e.push(encodeURIComponent("filters[]")+"="+encodeURIComponent(t))))),e.length>0&&(t+=`?${e.join("&")}`);const i=await fetch(t,this.fetchOptions);if(!i.ok)throw new Error(`${i.status}`);const o=await i.json();return o.items=this.getItemsWithLocaleLinks(o.items),this.data=Object.assign({},o),this.data.settings=Object.assign(Object.assign({},this.data.settings),this._customSettings),o.settings=void 0!==this.previewSettings.settings?Object.assign(Object.assign(Object.assign({},o.settings),this._customSettings),this.previewSettings.settings):Object.assign(Object.assign({},o.settings),this._customSettings),this.totalPages=o.total_pages,this.galleryId=o.gallery_id,this.shopId=o.shop_id,this.isLoading=!1,o}getItemsWithLocaleLinks(t){return t.forEach((t=>(t.links&&t.links.length>0&&t.links.forEach((t=>(t.link=(t=>{const e=window.location.hostname;let i=t;const o=window.Shopify;return void 0!==o&&o.routes&&o.routes.root&&"/"!==o.routes.root?i.replace(`${e}/`,`${e}${o.routes.root}`):i})(t.link),t))),t))),t}get fetchOptions(){const t={},e={},i=Object.keys(this.previewSettings);return this.previewMode&&(e.method="POST",e.headers={"Content-Type":"application/json"},i.length>0&&(i.forEach((e=>{const i=e.replace(/^(gallery_embed\[)/,"").replace(/\]$/,"");t[i]=this.previewSettings[e]})),e.body=JSON.stringify(t))),e}}var w,y=[],O="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(w||(w={}));var S,x=function(t){return Object.freeze(t)},E=function(t,e){this.inlineSize=t,this.blockSize=e,x(this)},k=function(){function t(t,e,i,o){return this.x=t,this.y=e,this.width=i,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,x(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),I=function(t){return t instanceof SVGElement&&"getBBox"in t},z=function(t){if(I(t)){var e=t.getBBox();return!e.width&&!e.height}return!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},j=function(t){var e;if(t instanceof Element)return!0;var i=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(i&&t instanceof i.Element)},C="undefined"!=typeof window?window:{},F=new WeakMap,P=/auto|scroll/,U=/^tb|vertical/,M=/msie|trident/i.test(C.navigator&&C.navigator.userAgent),R=function(t){return parseFloat(t||"0")},D=function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=!1),new E((i?e:t)||0,(i?t:e)||0)},B=x({devicePixelContentBoxSize:D(),borderBoxSize:D(),contentBoxSize:D(),contentRect:new k(0,0,0,0)}),H=function(t,e){if(void 0===e&&(e=!1),F.has(t)&&!e)return F.get(t);if(z(t))return F.set(t,B),B;var i=getComputedStyle(t),o=I(t)&&t.ownerSVGElement&&t.getBBox(),s=!M&&"border-box"===i.boxSizing,r=U.test(i.writingMode||""),n=!o&&P.test(i.overflowY||""),h=!o&&P.test(i.overflowX||""),a=o?0:R(i.paddingTop),l=o?0:R(i.paddingRight),d=o?0:R(i.paddingBottom),c=o?0:R(i.paddingLeft),u=o?0:R(i.borderTopWidth),_=o?0:R(i.borderRightWidth),p=o?0:R(i.borderBottomWidth),m=c+l,f=a+d,b=(o?0:R(i.borderLeftWidth))+_,g=u+p,v=h?t.offsetHeight-g-t.clientHeight:0,w=n?t.offsetWidth-b-t.clientWidth:0,y=s?m+b:0,O=s?f+g:0,S=o?o.width:R(i.width)-y-w,E=o?o.height:R(i.height)-O-v,j=S+m+w+b,C=E+f+v+g,H=x({devicePixelContentBoxSize:D(Math.round(S*devicePixelRatio),Math.round(E*devicePixelRatio),r),borderBoxSize:D(j,C,r),contentBoxSize:D(S,E,r),contentRect:new k(c,a,S,E)});return F.set(t,H),H},T=function(t,e,i){var o=H(t,i),s=o.borderBoxSize,r=o.contentBoxSize,n=o.devicePixelContentBoxSize;switch(e){case w.DEVICE_PIXEL_CONTENT_BOX:return n;case w.BORDER_BOX:return s;default:return r}},A=function(t){var e=H(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=x([e.borderBoxSize]),this.contentBoxSize=x([e.contentBoxSize]),this.devicePixelContentBoxSize=x([e.devicePixelContentBoxSize])},W=function(t){if(z(t))return 1/0;for(var e=0,i=t.parentNode;i;)e+=1,i=i.parentNode;return e},$=function(){var t=1/0,e=[];y.forEach((function(i){if(0!==i.activeTargets.length){var o=[];i.activeTargets.forEach((function(e){var i=new A(e.target),s=W(e.target);o.push(i),e.lastReportedSize=T(e.target,e.observedBox),s<t&&(t=s)})),e.push((function(){i.callback.call(i.observer,o,i.observer)})),i.activeTargets.splice(0,i.activeTargets.length)}}));for(var i=0,o=e;i<o.length;i++)(0,o[i])();return t},G=function(t){y.forEach((function(e){e.activeTargets.splice(0,e.activeTargets.length),e.skippedTargets.splice(0,e.skippedTargets.length),e.observationTargets.forEach((function(i){i.isActive()&&(W(i.target)>t?e.activeTargets.push(i):e.skippedTargets.push(i))}))}))},L=[],N=0,V={attributes:!0,characterData:!0,childList:!0,subtree:!0},q=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],J=function(t){return void 0===t&&(t=0),Date.now()+t},Y=!1,K=new(function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!Y){Y=!0;var i,o=J(t);i=function(){var i=!1;try{i=function(){var t,e=0;for(G(e);y.some((function(t){return t.activeTargets.length>0}));)e=$(),G(e);return y.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:O}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=O),window.dispatchEvent(t)),e>0}()}finally{if(Y=!1,t=o-J(),!N)return;i?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!S){var e=0,i=document.createTextNode("");new MutationObserver((function(){return L.splice(0).forEach((function(t){return t()}))})).observe(i,{characterData:!0}),S=function(){i.textContent="".concat(e?e--:e++)}}L.push(t),S()}((function(){requestAnimationFrame(i)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,V)};document.body?e():C.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),q.forEach((function(e){return C.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),q.forEach((function(e){return C.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}()),Z=function(t){!N&&t>0&&K.start(),!(N+=t)&&K.stop()},Q=function(){function t(t,e){this.target=t,this.observedBox=e||w.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=T(this.target,this.observedBox,!0);return I(t=this.target)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),X=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},tt=new WeakMap,et=function(t,e){for(var i=0;i<t.length;i+=1)if(t[i].target===e)return i;return-1},it=function(){function t(){}return t.connect=function(t,e){var i=new X(t,e);tt.set(t,i)},t.observe=function(t,e,i){var o=tt.get(t),s=0===o.observationTargets.length;et(o.observationTargets,e)<0&&(s&&y.push(o),o.observationTargets.push(new Q(e,i&&i.box)),Z(1),K.schedule())},t.unobserve=function(t,e){var i=tt.get(t),o=et(i.observationTargets,e);o>=0&&(1===i.observationTargets.length&&y.splice(y.indexOf(i),1),i.observationTargets.splice(o,1),Z(-1))},t.disconnect=function(t){var e=this,i=tt.get(t);i.observationTargets.slice().forEach((function(i){return e.unobserve(t,i.target)})),i.activeTargets.splice(0,i.activeTargets.length)},t}(),ot=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");it.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!j(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");it.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!j(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");it.unobserve(this,t)},t.prototype.disconnect=function(){it.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const st=a({name:"widgetId",initialState:{embedId:null,productHandle:null,shopDomain:null,galleryId:null,shopId:null,photoRequestId:null},reducers:{widgetIdUpdated:(t,e)=>{const{embedId:i,productHandle:o,shopDomain:s,photoRequestId:r}=e.payload;t.embedId=i,t.productHandle=o,t.shopDomain=s,t.photoRequestId=r},widgetGalleryIdUpdated:(t,e)=>{t.galleryId=e.payload},widgetShopIdUpdated:(t,e)=>{t.shopId=e.payload}}}),{widgetIdUpdated:rt,widgetGalleryIdUpdated:nt,widgetShopIdUpdated:ht}=st.actions;var at=st.reducer;const lt={production:"https://app.covet.pics",development:"http://localhost:3000",staging:"https://covetstaging.spacesquirrel.net",testing:"http://localhost:3000/testing_db"},dt=a({name:"url",initialState:{baseUrl:"",environment:"",baseBeaconsUrl:""},reducers:{setEnvironment:(t,e)=>{const i=e.payload;return t.environment="string"==typeof i&&Object.keys(lt).includes(i)?i:"production",t.baseUrl=lt[t.environment],t.baseBeaconsUrl=`${lt[t.environment]}/api/v1/beacons/`,t}}}),{setEnvironment:ct}=dt.actions;var ut=dt.reducer;const _t=a({name:"size",initialState:{widgetWidth:320,windowHeight:600,isDesktopScreen:!0},reducers:{widgetWidthUpdated:(t,e)=>{t.widgetWidth=e.payload,t.isDesktopScreen=e.payload>=800},windowHeightUpdated:(t,e)=>{t.windowHeight=e.payload}}}),{widgetWidthUpdated:pt,windowHeightUpdated:mt}=_t.actions;var ft=_t.reducer;const bt=a({name:"preview",initialState:{hoverMode:!1,popupMode:!1,mode:!1},reducers:{setPreviewHoverMode:(t,e)=>{t.hoverMode=e.payload},setPreviewPopupMode:(t,e)=>{t.popupMode=e.payload},setPreviewMode:(t,e)=>{t.mode=e.payload}}}),{setPreviewHoverMode:gt,setPreviewPopupMode:vt,setPreviewMode:wt}=bt.actions;var yt=bt.reducer;const Ot=a({name:"analytics",initialState:!1,reducers:{setAnalytics:(t,e)=>e.payload}}),{setAnalytics:St}=Ot.actions;var xt=Ot.reducer;const Et=t=>(t._arrowsDesktopType=`arrows-${t.arrow_graphics_type.toString().replace("_","-")}`,t._arrowsDesktopSizeType=t.arrow_size.toString().replace("_arrow",""),t._arrowsDesktopPosition=t.desktop_arrow_position.toString().replace("sidebar_",""),t._arrowsMobileColorTheme=t.mobile_arrow_color_theme.toString().replace("mob_",""),t._arrowsMobilePosition=t.mobile_arrow_position.toString().replace("mob_",""),t._arrowsMobileType=t.mobile_arrow_graphics_type.toString().replace("mob_","arrows-").replace("_","-"),t._buyButtonStyle=t.popup_buy_button_style.replace("buy_btn_","").replace("_","-"),t._closeButtonType=t.close_button_type.toString().split("_").join("-"),t._closeButtonСolorTheme=`close-button-color-theme-${t.close_button_color_theme.toString().replace("_btn","")}`,t),kt=a({name:"settings",initialState:Et({add_to_cart_button_caption:"Add to cart",arrow_color_theme:"light",arrow_custom_box_color:"#000000",arrow_custom_color:"#d3d3d3",arrow_graphics_type:"type_1",arrow_size:"standard",arrow_size_custom:48,background_color:"#000000",close_button_color_theme:"dark_btn",close_button_custom_box_color:"#000000",close_button_custom_color:"#d3d3d3",close_button_position:"side",close_button_size:"standard",close_button_type:"btn_type_1",customer_photo_item_label:"Add Your Photo",customer_photo_item_position:null,customer_photo_upload_body:"We would love to see it in action",customer_photo_upload_button_selector:"",customer_photo_upload_complete_body:"Thank you for your awesome photo! You will see it on the site once it’s approved",customer_photo_upload_complete_close_label:"Close",customer_photo_upload_drop_files_label:"Drag & Drop photos here",customer_photo_upload_form_body_placeholder:"Say something about your image",customer_photo_upload_form_email_placeholder:"E-mail",customer_photo_upload_form_legal_message:"",customer_photo_upload_form_name_placeholder:"Nickname",customer_photo_upload_form_send_label:"Send",customer_photo_upload_form_uploading:"Uploading...",customer_photo_upload_title:"Show It off",customer_widget_cover:null,desktop_arrow_position:"middle",direct_add_to_cart:!0,display_type:"grid",font_family:"Source Sans Pro",gallery_highlight:!1,gallery_highlight_every:0,gallery_highlight_every_start:0,gallery_mobile_photos_per_row:2,gallery_photos_count:0,gallery_photos_per_row:4,header_show_average_rating:!0,header_show_breakdown:!0,header_show_sort:!0,header_type:"header-1",hide_branding:!1,hide_social_links:!1,highlight_hotspots_layout:"hotspot-tall",highlight_layout:"slider",highlight_products_layout:"layout-1",hotspots:{enabled:!1,background_color:"#000000",show_numbers:!1,text_color:"#ffffff"},item_reveal_content:"",item_animation_duration:1,item_animation_type:"hover-animation-1",item_hover_background_opacity:80,item_hover_border_color:"#C1ACAC",item_hover_color_from:"#000000",item_hover_color_to:"#000000",item_hover_disabled:!1,item_hover_icon:!1,item_label_color:"#FFFFFF",item_label_font_size:15,item_label_font_style:"Normal",item_label_text:"SHOP THIS LOOK",item_mobile_padding:0,item_open_link:!1,item_padding:1,item_style:"standard",item_without_product_label_text:"SEE MORE",load_more_border_width:4,load_more_button_color:"#000000",load_more_button_style:"btn_style_1",load_more_font_size:14,load_more_font_style:"bold",load_more_padding:6,load_more_text:"MORE",mobile_arrow_color_theme:"mob_light",mobile_arrow_custom_box_color:"#000000",mobile_arrow_custom_color:"#d3d3d3",mobile_arrow_graphics_type:"mob_type_1",mobile_arrow_position:"mob_top",money_format:"{{amount}}",multiple_filter_enabled:!1,padding:0,pagination:"button",popup_animation:!0,popup_background_color:"#000000",popup_background_opacity:80,popup_buy_button_background_color:"#444444",popup_buy_button_background_hover_color:"#000000",popup_buy_button_text_color:"#FFFFFF",popup_buy_button_text_hover_color:"#000000",popup_custom_link_label:"Visit",popup_disable_modal:!1,popup_feed_show_caption:!0,popup_feed_show_navigation_arrows:!1,popup_feed_show_star_rating:!0,popup_feed_sound_on:!0,popup_image_size:"responsive",popup_products_button_caption:"Buy Now",popup_products_title:"SHOP THIS LOOK",popup_products_title_disabled:!1,popup_style:"standard",popup_buy_button_style:"buy_btn_style_1",popup_products_view_type:"grid_view",price_label_caption:"Price",primary_color:"#222222",secondary_color:"#BFBFBF",select_label_caption:"Select",show_header:!1,show_price:!0,show_price_in_popup:!0,show_review:!0,slideshow_autoplay:0,slideshow_arrows_desktop_align:"start",slideshow_arrows_mobile_align:"start",slideshow_arrows_desktop_position:"top",slideshow_arrows_mobile_position:"top",slideshow_scrollbar_desktop_align:"start",slideshow_scrollbar_mobile_align:"start",slideshow_scrollbar_desktop_position:"top",slideshow_scrollbar_mobile_position:"top",slideshow_load_more:!0,slideshow_video_auto_play:!1,slideshow_mobile_photos_per_row:2,slideshow_photos_per_row:4,slideshow_crop_mode:!1,slideshow_style:"regular",slideshow_desktop_pagination_style:"none",slideshow_mobile_pagination_style:"dots",star_color:"#FCD02C",tags_color:"#86848A",tags_active_color:"#302F33",tags_font_size:12,tags_font_weight:"",tags_padding:0,tags_reset_button_text:"",tags_style:"style_1",tags_wrap:"scroll",upload_show_star_rating:!0}),reducers:{setSettings:(t,e)=>{const i={};return Object.keys(e.payload).forEach((t=>{void 0!==e.payload[t]&&(i[t]=e.payload[t])})),Et(Object.assign(Object.assign({},t),i))}}}),{setSettings:It}=kt.actions,zt=l({analytics:xt,size:ft,sort:p,url:ut,preview:yt,popup:d,modals:_,slider:m,widgetId:at,settings:kt.reducer}),jt=class{constructor(i){t(this,i),this.updateUploadWidgetCover=e(this,"updateUploadWidgetCover",7),this.elementResize=e(this,"elementResize",7),this.previewMode=!1,this.lazyLoad=!1,this.isLoading=!0,this.items=[],this.fetchingError=null,this.fontsLoaded=!1,this.filters={}}async sortUpdatedHandler(t){this.loader.resetPagination(),this.loader.sortType=t.detail;const e=await this.loader.fetchItems();void 0!==e&&(this.items=[],this.items=[...this.getItemsWithUpload(e.items)])}async filtersUpdatedHandler(t){const e=t.detail.resetFilters;this.appState.preview.mode&&delete this.loader.previewSettings.filters;const i=()=>{Object.keys(this.filters).forEach((t=>this.filters[t]=!1)),this.loader.setSelectedFilters([])};if(e)i();else{const e=t.detail.filter;this.appState.settings.multiple_filter_enabled||this.filters[e]||i(),this.filters[e]=!this.filters[e]}const o=Object.keys(this.filters).filter((t=>this.filters[t]));this.loader.setSelectedFilters(o),this.loader.resetPagination();const s=await this.loader.fetchItems();void 0!==s&&(this.items=[],this.items=[...this.getItemsWithUpload(s.items)])}async nextPageHandler(){const t=await this.loader.fetchItems();void 0!==t&&(this.items=[...this.items,...t.items])}async nextPageHandlerFreeflow(t){if(t.detail.embedId===this.appState.widgetId.embedId){const t=await this.loader.fetchItems();void 0!==t&&(this.items=[...this.items,...t.items],this.appStore.dispatch(u(this.items)))}}async updateUploadWidgetCoverPreview(t){this.updateUploadWidgetCover.emit({image:t})}async updatePreviewSettings(t,e,i){this.removeModals(),this.loader.previewHoverMode=e,this.loader.previewPopupMode=i,this.appStore.dispatch(gt(e)),this.appStore.dispatch(vt(i)),this.fontsLoaded=!1,this.loader.previewSettings=Object.assign(Object.assign({},this.loader.previewSettings),t),this.loader.resetPagination(),this.loadData()}componentWillLoad(){this.lazyLoad?this.setupLazyLoading():this.initApp()}setupLazyLoading(){this.el.style.setProperty("--covet-widget-min-height","5px"),this.intersectionObserver=this.observeElementVisibility(this.el,(()=>{this.initApp(),this.widgetResizeObserver(),this.el.style.setProperty("--covet-widget-min-height","0")}))}componentDidLoad(){this.lazyLoad||this.widgetResizeObserver()}disconnectedCallback(){this.unsubscribe(),this.resizeObserver&&this.resizeObserver.disconnect(),this.intersectionObserver&&this.intersectionObserver.disconnect()}observeElementVisibility(t,e){const i=new IntersectionObserver((o=>{o.length>0&&o[0].isIntersecting&&(e(),i.unobserve(t))}));return i.observe(t),i}initApp(){this.initAppStore(),this.setupLoader(),this.loadData()}widgetResizeObserver(){this.resizeObserver=new ot((()=>{this.appState.size.windowHeight!==window.innerHeight&&this.appStore.dispatch(mt(window.innerHeight));const t=this.appState.size.widgetWidth!==this.el.getBoundingClientRect().width;this.isWidgetWrapExist()&&t&&(this.setWidgetWidth(),this.elementResize.emit())})),this.isWidgetWrapExist()&&this.resizeObserver.observe(this.el.parentElement)}initAppStore(){this.appStore=c({reducer:zt});const t=f(this.galleryEmbedId,this.shop,this.photoRequestId,this.el);this.appStore.dispatch(rt(t)),this.appStore.dispatch(ct(this.environment)),this.appStore.dispatch(wt(this.previewMode)),this.appState=this.appStore.getState(),this.unsubscribe=this.appStore.subscribe((()=>{this.appState=this.appStore.getState()})),this.setWidgetWidth()}setupLoader(){const t=window.location;if(this.loader=new v(this.environment,this.previewMode),"string"==typeof this.customSettings&&this.loader.setCustomSettings(JSON.parse(this.customSettings)),void 0===this.galleryEmbedId||0===this.galleryEmbedId){if(void 0!==this.shopifyProductId?this.loader.productHandle=`shopify/${this.shopifyProductId}`:null!==this.el.getAttribute("data-product")?this.loader.productHandle=this.el.getAttribute("data-product"):-1!==t.pathname.indexOf("/products/")&&(this.loader.productHandle=t.pathname.match(/\/products\/([a-zA-Z0-9\-\_\%]+)/)[1]),this.el.hasAttribute("data-shop")&&(this.shop=this.el.getAttribute("data-shop")),void 0===this.shop)return this.fetchingError="The Covet.pics gallery embed has not loaded due to a missing Embed ID. Please make sure to fill in the correct Embed ID",void(this.isLoading=!1);this.loader.shopDomain=this.shop}else this.loader.embedId=this.galleryEmbedId}async loadData(){if(null===this.fetchingError){this.isLoading=!0;try{const t=await this.loader.fetchItems();return this.appStore.dispatch(nt(this.loader.galleryId)),this.appStore.dispatch(ht(this.loader.shopId)),this.appStore.dispatch(St(!!this.loader.data.analytics&&this.loader.data.analytics)),void 0===t?!1:(this.appStore.dispatch(It(t.settings)),this.minNumberOfPhotos=t.settings.min_number_of_photos,this.items="highlight"===this.loader.data.settings.display_type?[...t.items]:[...this.getItemsWithUpload(t.items)],this.hideElementsIfEmpty(),this.fontsLoaded||this.loadFont(),this.hasEnoughPhotos&&g(this.appState)&&n("Covet.pics Gallery View","Covet.pics Gallery","Covet.pics Gallery View - "+this.galleryEmbedId),this.hasEnoughPhotos&&b(this.appState,"gallery_view"),this.sharedItemId=await this.findAndLoadSharedItemId(),this.initFilters(),this.isLoading=!1,!0)}catch(t){return"404"===t.message&&(this.fetchingError="The Covet.pics gallery embed has not loaded because the embed does not exist. Please verify that the correct Embed ID is being used"),this.isLoading=!1,this.fetchingError}}}removeModals(){["covet-pics-upload","covet-pics-popup","covet-pics-popup-freeflow"].forEach((t=>{const e=document.querySelector(`${t}`);null!==e&&e.remove()}))}async findAndLoadSharedItemId(){return new Promise((async t=>{if(this.loader.previewPopupMode){const e=this.items.find((t=>"upload_widget"!==t.source));return t(void 0!==e?e.id.toString():"none")}const e=h(this.loader.embedId,this.loader.galleryType);if(null===e)return t("none");if(-1!==this.items.findIndex((t=>t.id===parseInt(e))))return t(e.toString());const i=await this.loader.fetchItems();return void 0===i?t("none"):(this.items=[...this.items,...i.items],t(this.findAndLoadSharedItemId()))}))}setWidgetWidth(){const t=this.isWidgetWrapExist()?this.el.getBoundingClientRect().width:320;return this.appStore.dispatch(pt(t))}isWidgetWrapExist(){return void 0!==this.el.parentElement&&this.el.parentElement instanceof HTMLElement}get hasEnoughPhotos(){return 0!==this.items.length&&(null===this.minNumberOfPhotos||void 0!==this.loader&&void 0!==this.loader.data&&!(void 0!==this.loader.data.items&&this.loader.data.items.length<this.minNumberOfPhotos&&1===this.loader.page))}initFilters(){const t=this.loader.previewSettings.filters;this.loader.data.filters.list.forEach((t=>this.filters[t]=!1)),this.appState.preview.mode&&void 0!==t&&t.forEach((t=>this.filters[t]=!0))}loadFont(){if(this.loader.data.settings.font_family){const t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href","https://fonts.googleapis.com/css2?family="+this.loader.data.settings.font_family.split(" ").join("+")+":wght@300;400;600;700&display=swap"),document.head.appendChild(t)}this.fontsLoaded=!0}setWidgetCSSVariables(){let t={};return this.loader.data.settings.font_family&&""!==this.loader.data.settings.font_family&&(t["--covet-internal-font-family"]=`${this.appState.settings.font_family}`),t}getItemsWithUpload(t){return this.loader.data.settings.customer_photo_item_position?(t.splice(this.loader.data.settings.customer_photo_item_position-1,0,{source:"upload_widget",imageUrl:null!==this.appState.settings.customer_widget_cover?this.appState.settings.customer_widget_cover:void 0}),t):t}renderSliderGallery(){return i(o,{style:this.setWidgetCSSVariables(),class:"needsclick"},i("covet-pics-gallery-slider",{items:this.items,"shared-item-id":this.sharedItemId,"slider-style":this.loader.data.settings.slideshow_style,appStore:this.appStore}))}renderGridGallery(){var t,e,s;return i(o,{style:this.setWidgetCSSVariables(),class:"needsclick"},i("covet-pics-gallery-grid",{items:this.items,rating:null===(t=this.loader.data.reviews)||void 0===t?void 0:t.rating,"rating-count":null===(e=this.loader.data.reviews)||void 0===e?void 0:e.rating_count,"product-title":this.loader.data.product_title,breakdown:null===(s=this.loader.data.reviews)||void 0===s?void 0:s.breakdown,"filters-enabled":this.loader.data.filters.enabled,"shared-item-id":this.sharedItemId,filters:this.filters,"show-load-more":"button"===this.appState.settings.pagination&&!this.isLoading&&this.loader.totalPages>this.loader.page&&this.items.length>0,appStore:this.appStore}))}renderHighlighted(){return i(o,{style:this.setWidgetCSSVariables(),class:"highlighted"},i("covet-pics-highlighted",{numberOfPages:this.loader.data.items.length,items:this.loader.data.items,appStore:this.appStore}))}hideElementsIfEmpty(){let t=this.hideElements;t||(t=this.loader.data.settings.selector_to_hide);const e=this.loader.data.items;(void 0===e||0!==e.length)&&this.hasEnoughPhotos||""===t||document.querySelectorAll(t).forEach((t=>t.style.display="none"))}renderUploadStandalone(){return i("covet-pics-upload",{standalone:!0,appStore:this.appStore})}renderError(){return i(o,null,i("p",{class:"error-message"},this.fetchingError))}render(){if(!this.isLoading&&null!==this.fetchingError)return this.renderError();if(!this.isLoading&&this.hasEnoughPhotos){const t=this.loader.data.settings.display_type;return"upload-standalone"===t?this.renderUploadStandalone():"slider"===t?this.renderSliderGallery():"highlight"===t?this.renderHighlighted():this.renderGridGallery()}}get el(){return s(this)}};jt.style=":host{--covet-font-family:var(--covet-custom-font-family, var(--covet-internal-font-family)), sans-serif}:host{font-family:var(--covet-font-family);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:block;min-height:var(--covet-widget-min-height)}:host .error-message{text-align:center;border:2px dashed;padding:20px}";export{jt as covet_pics_widget}
|