@feedmepos/mf-menu-portal 0.0.0-stage → 1.0.1-dev.1
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/README.md +30 -2
- package/dist/AddPriceGroupDialog.vue_vue_type_script_setup_true_lang-DhKyG3gY.js +20 -0
- package/dist/App-C6k--u1c.js +8316 -0
- package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-C9OSr8ft.js +98 -0
- package/dist/BindingLinkDialog.vue_vue_type_script_setup_true_lang-BZVQRyRI.js +180 -0
- package/dist/BindingTable.vue_vue_type_script_setup_true_lang-DBzjWI_6.js +179 -0
- package/dist/Catalog-DEYN4dMN.js +374 -0
- package/dist/CatalogBinding-NnPKdPvx.js +315 -0
- package/dist/CatalogEditTabs.vue_vue_type_script_setup_true_lang-OshqaPTE.js +97 -0
- package/dist/CatalogEditor.vue_vue_type_script_setup_true_lang-poznuDXu.js +447 -0
- package/dist/CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-BSMAIkQ2.js +117 -0
- package/dist/Category-BdUP0o34.js +13 -0
- package/dist/Category-CkQiwP9e.js +52 -0
- package/dist/CategoryList.vue_vue_type_script_setup_true_lang-UgNVpYgp.js +797 -0
- package/dist/CookingGuide-CtDkm74r.js +842 -0
- package/dist/FormItem.vue_vue_type_script_setup_true_lang-C2S6QCyR.js +26 -0
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-pY-_msnM.js +1774 -0
- package/dist/Group-D2HngOjr.js +52 -0
- package/dist/Group-DSj7_16V.js +13 -0
- package/dist/GroupList.vue_vue_type_script_setup_true_lang-BmmsSKTt.js +2183 -0
- package/dist/Ingredient-BHqz7kjQ.js +463 -0
- package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-D9jK-Fhn.js +709 -0
- package/dist/ListCountTag.vue_vue_type_script_setup_true_lang-0bjk8Aly.js +15 -0
- package/dist/MenuSetting-DF-cJH7N.js +1228 -0
- package/dist/OrderPacing-CejS9dEI.js +698 -0
- package/dist/OrderPacingFields.vue_vue_type_script_setup_true_lang-C2mixGUk.js +55 -0
- package/dist/PageLayout.vue_vue_type_script_setup_true_lang-B3szUH39.js +41 -0
- package/dist/Preview-1C7jGJuY.js +327 -0
- package/dist/PriceTierNotice.vue_vue_type_script_setup_true_lang-CxKHCptJ.js +26 -0
- package/dist/PrintRoute-BNnMcgTf.js +473 -0
- package/dist/Product-BoUKxogB.js +44 -0
- package/dist/ProductChipSummary.vue_vue_type_script_setup_true_lang-D8DygCBl.js +110 -0
- package/dist/ProductEditorHost.vue_vue_type_script_setup_true_lang-Bm8_FTvr.js +83 -0
- package/dist/ProductFilterMenu.vue_vue_type_script_setup_true_lang-Cgc0Ms_n.js +101 -0
- package/dist/ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-Cx_mW05R.js +1246 -0
- package/dist/ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-CUeYaXYg.js +1955 -0
- package/dist/ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-CeYyZX7g.js +5401 -0
- package/dist/ProductInternalTools-b3sy8bWy.js +2147 -0
- package/dist/ProductInventoryDialog-DO0D8e3Z.js +4 -0
- package/dist/ProductInventoryDialog.vue_vue_type_script_setup_true_lang-y9Mz__o9.js +187 -0
- package/dist/ProductList.vue_vue_type_script_setup_true_lang-n_UYIwwt.js +10353 -0
- package/dist/ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-ClG3Prfm.js +218 -0
- package/dist/Products-7vlFJB0P.js +155 -0
- package/dist/Publish-DTP-CgV-.js +1261 -0
- package/dist/Recipe-C1W8_15H.js +350 -0
- package/dist/Scheduler-JRjozwP_.js +637 -0
- package/dist/ServingSequence-BGT5m7JB.js +336 -0
- package/dist/Setting-CS_M1gMN.js +173 -0
- package/dist/Subcategory-Cgy9CQCz.js +412 -0
- package/dist/Takeaway-Bpo9XA-j.js +48 -0
- package/dist/Takeaway-DO2dmFGP.js +13 -0
- package/dist/TakeawayList.vue_vue_type_script_setup_true_lang-C7KexF7H.js +554 -0
- package/dist/TranslationLanguageSelector.vue_vue_type_script_setup_true_lang-BJZ6VcrT.js +161 -0
- package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-B0j2PNih.js +158 -0
- package/dist/TranslationViewChip.vue_vue_type_script_setup_true_lang-CAkLEmSA.js +69 -0
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BHxmPO7F.js +1213 -0
- package/dist/Unit-Bn5UzMp1.js +385 -0
- package/dist/Variant-DmeGEEkw.js +538 -0
- package/dist/_id_-DC1dJIaj.js +28 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-Bd7W2PYm.js +2008 -0
- package/dist/app.js +8 -0
- package/dist/apps/mf-menu/src/App.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/Entry.vue.d.ts +4 -0
- package/dist/apps/mf-menu/src/app.d.ts +16771 -0
- package/dist/apps/mf-menu/src/assets/icons/index.d.ts +4 -0
- package/dist/apps/mf-menu/src/components/CatalogBindingList.vue.d.ts +9 -0
- package/dist/apps/mf-menu/src/components/CatalogList.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/CategoryImageField.vue.d.ts +17 -0
- package/dist/apps/mf-menu/src/components/CategoryList.vue.d.ts +28 -0
- package/dist/apps/mf-menu/src/components/Fields/RangeSlider.vue.d.ts +23 -0
- package/dist/apps/mf-menu/src/components/GroupList.vue.d.ts +28 -0
- package/dist/apps/mf-menu/src/components/GroupTranslationSideSheet.vue.d.ts +14 -0
- package/dist/apps/mf-menu/src/components/IngredientList.vue.d.ts +15 -0
- package/dist/apps/mf-menu/src/components/MenuHeaderContext.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/components/MenuRestaurantSelector.vue.d.ts +7 -0
- package/dist/apps/mf-menu/src/components/MenuSetting/AddMemberTierDialog.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/components/MenuSetting/AddPriceGroupDialog.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/components/MenuSetting/ConfigurationTab.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/MenuSetting/MemberPricingTab.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/MenuSetting/PriceGroupTab.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/MenuSetting/RuleGroupsTab.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/Navigator.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/components/OrderPacingList.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/PriceTier/PriceTierNotice.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/PrintRouteList.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/Product/LocalizedCurrencySymbol.vue.d.ts +5 -0
- package/dist/apps/mf-menu/src/components/Product/ProductAttributeFilter.vue.d.ts +13 -0
- package/dist/apps/mf-menu/src/components/Product/ProductCategorySelector.vue.d.ts +11 -0
- package/dist/apps/mf-menu/src/components/Product/ProductChipSummary.vue.d.ts +9 -0
- package/dist/apps/mf-menu/src/components/Product/ProductChoicePicker.vue.d.ts +15 -0
- package/dist/apps/mf-menu/src/components/Product/ProductEditorHost.vue.d.ts +26 -0
- package/dist/apps/mf-menu/src/components/Product/ProductFilterMenu.vue.d.ts +26 -0
- package/dist/apps/mf-menu/src/components/Product/ProductForm.vue.d.ts +42 -0
- package/dist/apps/mf-menu/src/components/Product/ProductFormSection.vue.d.ts +41 -0
- package/dist/apps/mf-menu/src/components/Product/ProductGroupCreateSheet.vue.d.ts +19 -0
- package/dist/apps/mf-menu/src/components/Product/ProductGroupSheet.vue.d.ts +56 -0
- package/dist/apps/mf-menu/src/components/Product/ProductInlineCategoryCreateField.vue.d.ts +10 -0
- package/dist/apps/mf-menu/src/components/Product/ProductInlineCreateHost.vue.d.ts +38 -0
- package/dist/apps/mf-menu/src/components/Product/ProductInlineSubcategoryCreateField.vue.d.ts +10 -0
- package/dist/apps/mf-menu/src/components/Product/ProductInventoryDialog.vue.d.ts +12 -0
- package/dist/apps/mf-menu/src/components/Product/ProductLocaleBadge.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/Product/ProductMemberPriceTooltip.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/Product/ProductMoneyField.vue.d.ts +25 -0
- package/dist/apps/mf-menu/src/components/Product/ProductOverviewSheet.vue.d.ts +11 -0
- package/dist/apps/mf-menu/src/components/Product/ProductPacingSheet.vue.d.ts +13 -0
- package/dist/apps/mf-menu/src/components/Product/ProductPriceTierButton.vue.d.ts +11 -0
- package/dist/apps/mf-menu/src/components/Product/ProductPricingSheet.vue.d.ts +26 -0
- package/dist/apps/mf-menu/src/components/Product/ProductPrintRouteSheet.vue.d.ts +12 -0
- package/dist/apps/mf-menu/src/components/Product/ProductQuantityField.vue.d.ts +16 -0
- package/dist/apps/mf-menu/src/components/Product/ProductSummaryCard.vue.d.ts +9 -0
- package/dist/apps/mf-menu/src/components/Product/ProductTakeawaySheet.vue.d.ts +12 -0
- package/dist/apps/mf-menu/src/components/Product/ProductTranslationDialog.vue.d.ts +16 -0
- package/dist/apps/mf-menu/src/components/Product/ProductVariantCreateSheet.vue.d.ts +12 -0
- package/dist/apps/mf-menu/src/components/Product/ProductVariantTranslationSheet.vue.d.ts +13 -0
- package/dist/apps/mf-menu/src/components/Product/inlineCreate.d.ts +23 -0
- package/dist/apps/mf-menu/src/components/Product/labels.d.ts +15 -0
- package/dist/apps/mf-menu/src/components/ProductBatchImage/BatchImageBadge.vue.d.ts +7 -0
- package/dist/apps/mf-menu/src/components/ProductBatchImage/BatchImageDownloadDialog.vue.d.ts +15 -0
- package/dist/apps/mf-menu/src/components/ProductBatchImage/BatchImageFormatChips.vue.d.ts +13 -0
- package/dist/apps/mf-menu/src/components/ProductBatchImage/BatchImageLegacyChip.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/components/ProductBatchImage/BatchImageProgressDialog.vue.d.ts +11 -0
- package/dist/apps/mf-menu/src/components/ProductBatchImage/BatchImageResult.vue.d.ts +14 -0
- package/dist/apps/mf-menu/src/components/ProductBatchImage/BatchImageReview.vue.d.ts +21 -0
- package/dist/apps/mf-menu/src/components/ProductBatchImage/BatchImageThumb.vue.d.ts +15 -0
- package/dist/apps/mf-menu/src/components/ProductBatchImage/BatchImageUpdateFlow.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/ProductBatchImage/BatchImageUpdateSheet.vue.d.ts +34 -0
- package/dist/apps/mf-menu/src/components/ProductBatchImage/batchImageFiles.d.ts +53 -0
- package/dist/apps/mf-menu/src/components/ProductImage/ProductImageCustomFormatDialog.vue.d.ts +40 -0
- package/dist/apps/mf-menu/src/components/ProductImage/ProductImageEditorDialog.vue.d.ts +82 -0
- package/dist/apps/mf-menu/src/components/ProductImage/ProductImageField.vue.d.ts +42 -0
- package/dist/apps/mf-menu/src/components/ProductImage/ProductImageManageSheet.vue.d.ts +47 -0
- package/dist/apps/mf-menu/src/components/ProductImage/ProductImageRegenerateDialog.vue.d.ts +44 -0
- package/dist/apps/mf-menu/src/components/ProductImage/imageBrowser.d.ts +18 -0
- package/dist/apps/mf-menu/src/components/ProductList.vue.d.ts +18 -0
- package/dist/apps/mf-menu/src/components/PublishList.vue.d.ts +14 -0
- package/dist/apps/mf-menu/src/components/RecipeList.vue.d.ts +11 -0
- package/dist/apps/mf-menu/src/components/SchedulerList.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/ServingSequenceList.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/SubcategoryList.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/TakeawayList.vue.d.ts +26 -0
- package/dist/apps/mf-menu/src/components/TranslationSideSheet.vue.d.ts +36 -0
- package/dist/apps/mf-menu/src/components/UnitList.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/V3ToV4MigrationBanner.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/V3ToV4MigrationConfirmDialog.vue.d.ts +12 -0
- package/dist/apps/mf-menu/src/components/VariantList.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/catalog/CatalogEditor.vue.d.ts +14 -0
- package/dist/apps/mf-menu/src/components/catalog/CatalogLinkProductAction.vue.d.ts +7 -0
- package/dist/apps/mf-menu/src/components/catalog/CatalogUsage.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/catalog/tableSemantics.d.ts +7 -0
- package/dist/apps/mf-menu/src/components/feature/ApplyProduct/ApplyProduct.vue.d.ts +33 -0
- package/dist/apps/mf-menu/src/components/feature/CookingGuide/RemoveCookingGuideConfirmation.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/feature/EmptyDataTemplate/Icon.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/components/feature/EmptyDataTemplate/index.d.ts +1 -0
- package/dist/apps/mf-menu/src/components/feature/EmptyDataTemplate/index.vue.d.ts +18 -0
- package/dist/apps/mf-menu/src/components/feature/InventoryBinding/BindingLinkDialog.vue.d.ts +49 -0
- package/dist/apps/mf-menu/src/components/feature/InventoryBinding/BindingTable.vue.d.ts +38 -0
- package/dist/apps/mf-menu/src/components/feature/LinkProduct/LinkProductSideSheet.vue.d.ts +65 -0
- package/dist/apps/mf-menu/src/components/feature/OrderPacing/DeleteOrderPacingConfirmation.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/feature/OrderPacing/OrderPacingFields.vue.d.ts +17 -0
- package/dist/apps/mf-menu/src/components/feature/PrintRoute/RemoveRouteConfirmation.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/TreeEditorOpenner.vue.d.ts +18 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/openner.d.ts +7 -0
- package/dist/apps/mf-menu/src/components/info/TextChip.vue.d.ts +13 -0
- package/dist/apps/mf-menu/src/components/layout/FlatInlineSort.vue.d.ts +25 -0
- package/dist/apps/mf-menu/src/components/layout/FormColumn.vue.d.ts +12 -0
- package/dist/apps/mf-menu/src/components/layout/FormItem.vue.d.ts +17 -0
- package/dist/apps/mf-menu/src/components/layout/FormRow.vue.d.ts +9 -0
- package/dist/apps/mf-menu/src/components/layout/FormSection.vue.d.ts +18 -0
- package/dist/apps/mf-menu/src/components/layout/FullScreenForm.vue.d.ts +31 -0
- package/dist/apps/mf-menu/src/components/layout/FullWrapper.vue.d.ts +9 -0
- package/dist/apps/mf-menu/src/components/layout/LabeledTextField.vue.d.ts +16 -0
- package/dist/apps/mf-menu/src/components/layout/ListCountTag.vue.d.ts +5 -0
- package/dist/apps/mf-menu/src/components/layout/LottieAnimation.vue.d.ts +39 -0
- package/dist/apps/mf-menu/src/components/layout/PageLayout.vue.d.ts +19 -0
- package/dist/apps/mf-menu/src/components/layout/ProgressBar.vue.d.ts +9 -0
- package/dist/apps/mf-menu/src/components/loading/AppLoading.vue.d.ts +20 -0
- package/dist/apps/mf-menu/src/components/loading/PageLoading.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/components/loading/index.d.ts +1 -0
- package/dist/apps/mf-menu/src/components/placeholder/PlaceholderView.vue.d.ts +5 -0
- package/dist/apps/mf-menu/src/components/preview/MenuPreview.vue.d.ts +13 -0
- package/dist/apps/mf-menu/src/components/preview/simulatorPort.d.ts +23 -0
- package/dist/apps/mf-menu/src/components/publish/PublishRevertPreview.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/publish/PublishScheduleDetails.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/publish/publishStatus.d.ts +15 -0
- package/dist/apps/mf-menu/src/components/translation/TranslationLanguageSelector.vue.d.ts +21 -0
- package/dist/apps/mf-menu/src/components/translation/TranslationViewChip.vue.d.ts +12 -0
- package/dist/apps/mf-menu/src/components/translation/localeName.d.ts +11 -0
- package/dist/apps/mf-menu/src/components/translation/localeSymbol.d.ts +15 -0
- package/dist/apps/mf-menu/src/composable/elementPosition.d.ts +17 -0
- package/dist/apps/mf-menu/src/composable/menuNotifier.d.ts +14 -0
- package/dist/apps/mf-menu/src/composable/navigator.d.ts +16 -0
- package/dist/apps/mf-menu/src/composable/useActionFeedback.d.ts +81 -0
- package/dist/apps/mf-menu/src/composable/useEditorValidation.d.ts +21 -0
- package/dist/apps/mf-menu/src/init.d.ts +1 -0
- package/dist/apps/mf-menu/src/main.d.ts +2 -0
- package/dist/apps/mf-menu/src/plugins.d.ts +4 -0
- package/dist/apps/mf-menu/src/router/index.d.ts +2 -0
- package/dist/apps/mf-menu/src/router/shared.d.ts +65 -0
- package/dist/apps/mf-menu/src/sdk/host.d.ts +9 -0
- package/dist/apps/mf-menu/src/sdk/import-export.d.ts +9 -0
- package/dist/apps/mf-menu/src/sdk/provide.d.ts +33 -0
- package/dist/apps/mf-menu/src/sdk/useReadModel.d.ts +16 -0
- package/dist/apps/mf-menu/src/sdk/useSdkMessage.d.ts +11 -0
- package/dist/apps/mf-menu/src/stores/app.d.ts +17 -0
- package/dist/apps/mf-menu/src/utils/ruleValueKey.d.ts +12 -0
- package/dist/apps/mf-menu/src/utils/worker-loader.d.ts +12 -0
- package/dist/apps/mf-menu/src/utils/worker.d.ts +4 -0
- package/dist/apps/mf-menu/src/views/Catalog/Catalog.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Catalog/Edit/CatalogEditTabs.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Catalog/Edit/Category.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Catalog/Edit/Group.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Catalog/Edit/MainSetting.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Catalog/Edit/NamedSetting.vue.d.ts +5 -0
- package/dist/apps/mf-menu/src/views/Catalog/Edit/Product.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Catalog/Edit/Setting.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Catalog/Edit/Takeaway.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Catalog/Edit/[id].vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/CatalogBinding/CatalogBinding.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Category/Category.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/CookingGuide/CookingGuide.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Group/Group.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/ImportExport/ImportDiffPreview.vue.d.ts +25 -0
- package/dist/apps/mf-menu/src/views/ImportExport/ImportExport.vue.d.ts +9 -0
- package/dist/apps/mf-menu/src/views/ImportExport/ImportV3DiffPreview.vue.d.ts +26 -0
- package/dist/apps/mf-menu/src/views/ImportExport/PreviewImportTable.vue.d.ts +30 -0
- package/dist/apps/mf-menu/src/views/Ingredient/Ingredient.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/MenuManagementEditor/CategoryRenameDialog.vue.d.ts +26 -0
- package/dist/apps/mf-menu/src/views/MenuManagementEditor/DetailPane.vue.d.ts +23 -0
- package/dist/apps/mf-menu/src/views/MenuManagementEditor/EditorHistoryControls.vue.d.ts +22 -0
- package/dist/apps/mf-menu/src/views/MenuManagementEditor/MenuManagementEditor.vue.d.ts +10 -0
- package/dist/apps/mf-menu/src/views/MenuManagementEditor/RestaurantAttributesFilter.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/MenuManagementEditor/ScopeSwitcher.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/MenuManagementEditor/TreeFilter.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/MenuManagementEditor/TreePanel.vue.d.ts +9 -0
- package/dist/apps/mf-menu/src/views/MenuManagementEditor/TreeRow.vue.d.ts +25 -0
- package/dist/apps/mf-menu/src/views/MenuSetting/MenuSetting.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/OrderPacing/OrderPacing.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Preview/Preview.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/PrintRoute/PrintRoute.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Product/ProductInternalTools.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Product/Products.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Publish/Publish.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Recipe/Recipe.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Scheduler/Scheduler.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/ServingSequence/ServingSequence.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Subcategory/Subcategory.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Takeaway/Takeaway.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Unit/Unit.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Variant/Variant.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/workers/menu-compute.d.ts +1 -0
- package/dist/apps/mf-menu/src/workers/validate-menu.d.ts +1 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -0
- package/dist/assets/menu-compute-okel5FLc.js +260 -0
- package/dist/assets/validate-menu-DEFGpnQh.js +130 -0
- package/dist/index.vue_vue_type_script_setup_true_lang-CGPDazqs.js +57 -0
- package/dist/mf-menu-portal.css +1 -0
- package/dist/provide-Tmjfji09.js +190840 -0
- package/dist/ruleValueKey-BF52PuHb.js +10 -0
- package/dist/tableSemantics-C9WFO_I_.js +22 -0
- package/dist/useActionFeedback-DoFeBFpl.js +95 -0
- package/dist/useEditorValidation-Ctef5Bxt.js +63 -0
- package/package.json +79 -3
|
@@ -0,0 +1,1955 @@
|
|
|
1
|
+
import { defineComponent as Ft, resolveComponent as U, openBlock as b, createBlock as R, Teleport as Ye, createVNode as z, Transition as Xe, withCtx as I, withKeys as Kt, normalizeClass as Ut, createElementVNode as S, toDisplayString as O, renderSlot as J, createElementBlock as F, Fragment as pt, renderList as xt, createCommentVNode as V, resolveDynamicComponent as Mt, withDirectives as ce, vShow as ue, mergeProps as de, withModifiers as Ve, ref as L, watch as Ne, computed as st, normalizeStyle as Jt, onBeforeUnmount as qe, unref as A } from "vue";
|
|
2
|
+
import { useI18n as Ze } from "@feedmepos/mf-common";
|
|
3
|
+
import { components as B } from "@feedmepos/ui-library";
|
|
4
|
+
import { b as Ge, A as Qe } from "./provide-Tmjfji09.js";
|
|
5
|
+
import { _ as Ke } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
+
const Je = {
|
|
7
|
+
class: /* @__PURE__ */ Ut([
|
|
8
|
+
"flex items-center",
|
|
9
|
+
"px-24 pt-16 pb-8",
|
|
10
|
+
"border-b border-fm-color-neutral-gray-100",
|
|
11
|
+
"space-x-4"
|
|
12
|
+
])
|
|
13
|
+
}, ti = { class: "fm-typo-en-title-sm-600 mr-auto" }, ei = {
|
|
14
|
+
class: /* @__PURE__ */ Ut([
|
|
15
|
+
"flex flex-col",
|
|
16
|
+
"flex-1 overflow-scroll",
|
|
17
|
+
"w-full",
|
|
18
|
+
"px-24"
|
|
19
|
+
])
|
|
20
|
+
}, fn = /* @__PURE__ */ Ft({
|
|
21
|
+
__name: "FullScreenForm",
|
|
22
|
+
props: {
|
|
23
|
+
show: { type: Boolean },
|
|
24
|
+
title: {},
|
|
25
|
+
primaryAction: {},
|
|
26
|
+
secondaryActions: {}
|
|
27
|
+
},
|
|
28
|
+
emits: ["onPrimary", "onCancel"],
|
|
29
|
+
setup(t, { emit: e }) {
|
|
30
|
+
const i = e, o = () => {
|
|
31
|
+
i("onPrimary");
|
|
32
|
+
}, s = () => {
|
|
33
|
+
i("onCancel");
|
|
34
|
+
};
|
|
35
|
+
let n = !1;
|
|
36
|
+
const a = (r) => {
|
|
37
|
+
const l = r.target instanceof Element ? r.target : null;
|
|
38
|
+
n = !!(l != null && l.closest(
|
|
39
|
+
".fm-menu, .fm-menu__content, .fm-select__menu__wrapper"
|
|
40
|
+
)) || !!document.querySelector(".fm-menu__content--opened");
|
|
41
|
+
}, h = () => {
|
|
42
|
+
if (n) {
|
|
43
|
+
n = !1;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
s();
|
|
47
|
+
};
|
|
48
|
+
return (r, l) => {
|
|
49
|
+
const c = U("fm-button"), u = U("fm-form");
|
|
50
|
+
return b(), R(Ye, { to: "body" }, [
|
|
51
|
+
z(Xe, {
|
|
52
|
+
"enter-active-class": "transition-opacity duration-500 ease-in-out",
|
|
53
|
+
"enter-from-class": "opacity-0",
|
|
54
|
+
"enter-to-class": "opacity-100",
|
|
55
|
+
"leave-active-class": "transition-opacity duration-500 ease-in-out",
|
|
56
|
+
"leave-from-class": "opacity-100",
|
|
57
|
+
"leave-to-class": "opacity-0"
|
|
58
|
+
}, {
|
|
59
|
+
default: I(() => [
|
|
60
|
+
r.show ? (b(), R(u, {
|
|
61
|
+
key: 0,
|
|
62
|
+
"blame-form-child-on-validation-failed": "",
|
|
63
|
+
class: Ut([
|
|
64
|
+
"fixed inset-0",
|
|
65
|
+
"flex flex-col",
|
|
66
|
+
"w-screen h-dvh",
|
|
67
|
+
"bg-fm-color-neutral-white z-50"
|
|
68
|
+
]),
|
|
69
|
+
tabindex: "-1",
|
|
70
|
+
role: "dialog",
|
|
71
|
+
"aria-modal": "true",
|
|
72
|
+
"aria-label": r.title,
|
|
73
|
+
onValidationSuccess: o,
|
|
74
|
+
onKeydownCapture: Kt(a, ["esc"]),
|
|
75
|
+
onKeyup: Kt(h, ["esc"])
|
|
76
|
+
}, {
|
|
77
|
+
default: I(() => [
|
|
78
|
+
S("div", Je, [
|
|
79
|
+
S("p", ti, O(r.title), 1),
|
|
80
|
+
J(r.$slots, "append-title"),
|
|
81
|
+
(b(!0), F(pt, null, xt(r.secondaryActions, (d) => (b(), R(c, {
|
|
82
|
+
key: d.label,
|
|
83
|
+
label: d.label,
|
|
84
|
+
variant: "tertiary",
|
|
85
|
+
onClick: d.click
|
|
86
|
+
}, null, 8, ["label", "onClick"]))), 128)),
|
|
87
|
+
z(c, {
|
|
88
|
+
label: r.primaryAction.label,
|
|
89
|
+
disabled: r.primaryAction.disabled,
|
|
90
|
+
type: "submit",
|
|
91
|
+
variant: "primary"
|
|
92
|
+
}, null, 8, ["label", "disabled"])
|
|
93
|
+
]),
|
|
94
|
+
S("div", ei, [
|
|
95
|
+
J(r.$slots, "default")
|
|
96
|
+
])
|
|
97
|
+
]),
|
|
98
|
+
_: 3
|
|
99
|
+
}, 8, ["aria-label"])) : V("", !0)
|
|
100
|
+
]),
|
|
101
|
+
_: 3
|
|
102
|
+
})
|
|
103
|
+
]);
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
function ii(t) {
|
|
108
|
+
return new Promise((e, i) => {
|
|
109
|
+
const o = new FileReader();
|
|
110
|
+
o.onerror = () => i(o.error ?? new Error("Image read failed")), o.onload = () => typeof o.result == "string" ? e(o.result) : i(new Error("Image read failed")), o.readAsDataURL(t);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
const G = /* @__PURE__ */ new Map();
|
|
114
|
+
function pn(t) {
|
|
115
|
+
const e = G.get(t);
|
|
116
|
+
if (e)
|
|
117
|
+
return G.delete(t), G.set(t, e), e;
|
|
118
|
+
const i = (async () => {
|
|
119
|
+
const o = t.startsWith("data:") ? t : `${t}${t.includes("?") ? "&" : "?"}_ts=${Date.now()}`, s = await fetch(o);
|
|
120
|
+
if (!s.ok) throw new Error("Image read failed");
|
|
121
|
+
const n = await s.blob();
|
|
122
|
+
return new File([n], "product-image", {
|
|
123
|
+
type: n.type || "image/jpeg"
|
|
124
|
+
});
|
|
125
|
+
})();
|
|
126
|
+
for (G.set(t, i), i.catch(() => {
|
|
127
|
+
G.get(t) === i && G.delete(t);
|
|
128
|
+
}); G.size > 6; ) G.delete(G.keys().next().value);
|
|
129
|
+
return i;
|
|
130
|
+
}
|
|
131
|
+
async function gn(t) {
|
|
132
|
+
return t ? {
|
|
133
|
+
contentType: t.blob.type,
|
|
134
|
+
fileName: t.fileName,
|
|
135
|
+
width: t.width,
|
|
136
|
+
height: t.height,
|
|
137
|
+
byteLength: t.blob.size,
|
|
138
|
+
bytes: t.blob,
|
|
139
|
+
base64: await ii(t.blob)
|
|
140
|
+
} : null;
|
|
141
|
+
}
|
|
142
|
+
async function me(t) {
|
|
143
|
+
let e = t;
|
|
144
|
+
function i(l, c) {
|
|
145
|
+
var d;
|
|
146
|
+
const u = document.createElement("canvas");
|
|
147
|
+
return u.width = Math.max(1, Math.round(l.width * c)), u.height = Math.max(1, Math.round(l.height * c)), (d = u.getContext("2d")) == null || d.drawImage(l, 0, 0, u.width, u.height), u;
|
|
148
|
+
}
|
|
149
|
+
const o = Math.max(e.width, e.height);
|
|
150
|
+
o > 2e3 && (e = i(e, 2e3 / o));
|
|
151
|
+
const s = e.getContext("2d");
|
|
152
|
+
if (!s) return null;
|
|
153
|
+
const n = getComputedStyle(document.documentElement).getPropertyValue("--fm-color-neutral-white").trim();
|
|
154
|
+
if (!n) return null;
|
|
155
|
+
s.globalCompositeOperation = "destination-over", s.fillStyle = n, s.fillRect(0, 0, e.width, e.height), s.globalCompositeOperation = "source-over";
|
|
156
|
+
let a = 0.75;
|
|
157
|
+
const h = () => new Promise(
|
|
158
|
+
(l) => e.toBlob(l, "image/jpeg", a)
|
|
159
|
+
);
|
|
160
|
+
let r = await h();
|
|
161
|
+
for (; r && r.size > 800 * 1024; ) {
|
|
162
|
+
if (a > 0.5) a -= 0.1;
|
|
163
|
+
else if (Math.max(e.width, e.height) > 64)
|
|
164
|
+
e = i(e, 0.85);
|
|
165
|
+
else return null;
|
|
166
|
+
r = await h();
|
|
167
|
+
}
|
|
168
|
+
return r ? { blob: r, width: e.width, height: e.height } : null;
|
|
169
|
+
}
|
|
170
|
+
async function vn(t) {
|
|
171
|
+
const e = await fetch(t);
|
|
172
|
+
if (!e.ok) throw new Error("Image read failed");
|
|
173
|
+
const i = await e.blob();
|
|
174
|
+
return new File([i], "remy-image", { type: i.type || "image/png" });
|
|
175
|
+
}
|
|
176
|
+
async function bn(t) {
|
|
177
|
+
var i;
|
|
178
|
+
const e = URL.createObjectURL(t);
|
|
179
|
+
try {
|
|
180
|
+
const o = new Image();
|
|
181
|
+
if (await new Promise((r, l) => {
|
|
182
|
+
o.onload = () => r(), o.onerror = () => l(new Error("Image decode failed")), o.src = e;
|
|
183
|
+
}), !o.naturalWidth || !o.naturalHeight) return null;
|
|
184
|
+
const s = Math.min(
|
|
185
|
+
1,
|
|
186
|
+
2e3 / Math.max(o.naturalWidth, o.naturalHeight)
|
|
187
|
+
), n = document.createElement("canvas");
|
|
188
|
+
n.width = Math.max(1, Math.round(o.naturalWidth * s)), n.height = Math.max(1, Math.round(o.naturalHeight * s)), (i = n.getContext("2d")) == null || i.drawImage(o, 0, 0, n.width, n.height);
|
|
189
|
+
const a = await me(n);
|
|
190
|
+
if (!a) return null;
|
|
191
|
+
const h = t.type === "image/jpeg" && Math.max(o.naturalWidth, o.naturalHeight) <= 2e3 && t.size <= 800 * 1024 && t.size <= a.blob.size;
|
|
192
|
+
return {
|
|
193
|
+
...a,
|
|
194
|
+
blob: h ? t : a.blob,
|
|
195
|
+
fileName: t.name.replace(/\.[^.]+$/, "") + ".jpg"
|
|
196
|
+
};
|
|
197
|
+
} finally {
|
|
198
|
+
URL.revokeObjectURL(e);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function te(t, e) {
|
|
202
|
+
var i = Object.keys(t);
|
|
203
|
+
if (Object.getOwnPropertySymbols) {
|
|
204
|
+
var o = Object.getOwnPropertySymbols(t);
|
|
205
|
+
e && (o = o.filter((function(s) {
|
|
206
|
+
return Object.getOwnPropertyDescriptor(t, s).enumerable;
|
|
207
|
+
}))), i.push.apply(i, o);
|
|
208
|
+
}
|
|
209
|
+
return i;
|
|
210
|
+
}
|
|
211
|
+
function w(t) {
|
|
212
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
213
|
+
var i = arguments[e] != null ? arguments[e] : {};
|
|
214
|
+
e % 2 ? te(Object(i), !0).forEach((function(o) {
|
|
215
|
+
$(t, o, i[o]);
|
|
216
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(i)) : te(Object(i)).forEach((function(o) {
|
|
217
|
+
Object.defineProperty(t, o, Object.getOwnPropertyDescriptor(i, o));
|
|
218
|
+
}));
|
|
219
|
+
}
|
|
220
|
+
return t;
|
|
221
|
+
}
|
|
222
|
+
function $(t, e, i) {
|
|
223
|
+
return e in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
|
|
224
|
+
}
|
|
225
|
+
function ni(t, e) {
|
|
226
|
+
if (t == null) return {};
|
|
227
|
+
var i, o, s = (function(a, h) {
|
|
228
|
+
if (a == null) return {};
|
|
229
|
+
var r, l, c = {}, u = Object.keys(a);
|
|
230
|
+
for (l = 0; l < u.length; l++) r = u[l], h.indexOf(r) >= 0 || (c[r] = a[r]);
|
|
231
|
+
return c;
|
|
232
|
+
})(t, e);
|
|
233
|
+
if (Object.getOwnPropertySymbols) {
|
|
234
|
+
var n = Object.getOwnPropertySymbols(t);
|
|
235
|
+
for (o = 0; o < n.length; o++) i = n[o], e.indexOf(i) >= 0 || Object.prototype.propertyIsEnumerable.call(t, i) && (s[i] = t[i]);
|
|
236
|
+
}
|
|
237
|
+
return s;
|
|
238
|
+
}
|
|
239
|
+
function rt(t) {
|
|
240
|
+
return (function(e) {
|
|
241
|
+
if (Array.isArray(e)) return Wt(e);
|
|
242
|
+
})(t) || (function(e) {
|
|
243
|
+
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
|
|
244
|
+
})(t) || (function(e, i) {
|
|
245
|
+
if (e) {
|
|
246
|
+
if (typeof e == "string") return Wt(e, i);
|
|
247
|
+
var o = Object.prototype.toString.call(e).slice(8, -1);
|
|
248
|
+
if (o === "Object" && e.constructor && (o = e.constructor.name), o === "Map" || o === "Set") return Array.from(e);
|
|
249
|
+
if (o === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)) return Wt(e, i);
|
|
250
|
+
}
|
|
251
|
+
})(t) || (function() {
|
|
252
|
+
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
253
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
254
|
+
})();
|
|
255
|
+
}
|
|
256
|
+
function Wt(t, e) {
|
|
257
|
+
(e == null || e > t.length) && (e = t.length);
|
|
258
|
+
for (var i = 0, o = new Array(e); i < e; i++) o[i] = t[i];
|
|
259
|
+
return o;
|
|
260
|
+
}
|
|
261
|
+
var ee, oi, bt, C = (ee = function(t) {
|
|
262
|
+
/*!
|
|
263
|
+
Copyright (c) 2018 Jed Watson.
|
|
264
|
+
Licensed under the MIT License (MIT), see
|
|
265
|
+
http://jedwatson.github.io/classnames
|
|
266
|
+
*/
|
|
267
|
+
(function() {
|
|
268
|
+
var e = {}.hasOwnProperty;
|
|
269
|
+
function i() {
|
|
270
|
+
for (var o = [], s = 0; s < arguments.length; s++) {
|
|
271
|
+
var n = arguments[s];
|
|
272
|
+
if (n) {
|
|
273
|
+
var a = typeof n;
|
|
274
|
+
if (a === "string" || a === "number") o.push(n);
|
|
275
|
+
else if (Array.isArray(n)) {
|
|
276
|
+
if (n.length) {
|
|
277
|
+
var h = i.apply(null, n);
|
|
278
|
+
h && o.push(h);
|
|
279
|
+
}
|
|
280
|
+
} else if (a === "object") if (n.toString === Object.prototype.toString) for (var r in n) e.call(n, r) && n[r] && o.push(r);
|
|
281
|
+
else o.push(n.toString());
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return o.join(" ");
|
|
285
|
+
}
|
|
286
|
+
t.exports ? (i.default = i, t.exports = i) : window.classNames = i;
|
|
287
|
+
})();
|
|
288
|
+
}, ee(bt = { path: oi, exports: {}, require: function(t, e) {
|
|
289
|
+
return (function() {
|
|
290
|
+
throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
|
|
291
|
+
})(e == null && bt.path);
|
|
292
|
+
} }, bt.exports), bt.exports), Y = function(t) {
|
|
293
|
+
return function(e, i) {
|
|
294
|
+
if (!e) return t;
|
|
295
|
+
var o;
|
|
296
|
+
typeof e == "string" ? o = e : i = e;
|
|
297
|
+
var s = t;
|
|
298
|
+
return o && (s += "__" + o), s + (i ? Object.keys(i).reduce((function(n, a) {
|
|
299
|
+
var h = i[a];
|
|
300
|
+
return h && (n += " " + (typeof h == "boolean" ? s + "--" + a : s + "--" + a + "_" + h)), n;
|
|
301
|
+
}), "") : "");
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
function Ot(t, e, i) {
|
|
305
|
+
var o, s, n, a, h;
|
|
306
|
+
function r() {
|
|
307
|
+
var c = Date.now() - a;
|
|
308
|
+
c < e && c >= 0 ? o = setTimeout(r, e - c) : (o = null, i || (h = t.apply(n, s), n = s = null));
|
|
309
|
+
}
|
|
310
|
+
e == null && (e = 100);
|
|
311
|
+
var l = function() {
|
|
312
|
+
n = this, s = arguments, a = Date.now();
|
|
313
|
+
var c = i && !o;
|
|
314
|
+
return o || (o = setTimeout(r, e)), c && (h = t.apply(n, s), n = s = null), h;
|
|
315
|
+
};
|
|
316
|
+
return l.clear = function() {
|
|
317
|
+
o && (clearTimeout(o), o = null);
|
|
318
|
+
}, l.flush = function() {
|
|
319
|
+
o && (h = t.apply(n, s), n = s = null, clearTimeout(o), o = null);
|
|
320
|
+
}, l;
|
|
321
|
+
}
|
|
322
|
+
Ot.debounce = Ot;
|
|
323
|
+
var Pt = Ot, p = function() {
|
|
324
|
+
return p = Object.assign || function(t) {
|
|
325
|
+
for (var e, i = 1, o = arguments.length; i < o; i++) for (var s in e = arguments[i]) Object.prototype.hasOwnProperty.call(e, s) && (t[s] = e[s]);
|
|
326
|
+
return t;
|
|
327
|
+
}, p.apply(this, arguments);
|
|
328
|
+
};
|
|
329
|
+
/*! *****************************************************************************
|
|
330
|
+
Copyright (c) Microsoft Corporation.
|
|
331
|
+
|
|
332
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
333
|
+
purpose with or without fee is hereby granted.
|
|
334
|
+
|
|
335
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
336
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
337
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
338
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
339
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
340
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
341
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
342
|
+
***************************************************************************** */
|
|
343
|
+
function fe(t, e) {
|
|
344
|
+
var i, o;
|
|
345
|
+
return t && e ? (i = "" + t + e[0].toUpperCase() + e.slice(1), o = t + "-" + e) : (i = t || e, o = t || e), { name: i, classname: o };
|
|
346
|
+
}
|
|
347
|
+
function pe(t) {
|
|
348
|
+
return /^blob:/.test(t);
|
|
349
|
+
}
|
|
350
|
+
function ie(t) {
|
|
351
|
+
return pe(t) || (function(e) {
|
|
352
|
+
return /^data:/.test(e);
|
|
353
|
+
})(t);
|
|
354
|
+
}
|
|
355
|
+
function lt(t) {
|
|
356
|
+
return !!(t && t.constructor && t.call && t.apply);
|
|
357
|
+
}
|
|
358
|
+
function T(t) {
|
|
359
|
+
return t === void 0;
|
|
360
|
+
}
|
|
361
|
+
function At(t) {
|
|
362
|
+
return typeof t == "object" && t !== null;
|
|
363
|
+
}
|
|
364
|
+
function $t(t, e, i) {
|
|
365
|
+
var o = {};
|
|
366
|
+
return At(t) ? (Object.keys(e).forEach((function(s) {
|
|
367
|
+
T(t[s]) ? o[s] = e[s] : At(e[s]) ? At(t[s]) ? o[s] = $t(t[s], e[s], i[s]) : o[s] = t[s] ? e[s] : i[s] : e[s] === !0 || e[s] === !1 ? o[s] = !!t[s] : o[s] = t[s];
|
|
368
|
+
})), o) : t ? e : i;
|
|
369
|
+
}
|
|
370
|
+
function wt(t) {
|
|
371
|
+
var e = Number(t);
|
|
372
|
+
return Number.isNaN(e) ? t : e;
|
|
373
|
+
}
|
|
374
|
+
function ne(t) {
|
|
375
|
+
return typeof (t == "number" || /* @__PURE__ */ (function(e) {
|
|
376
|
+
return typeof e == "object" && e !== null;
|
|
377
|
+
})(t) && toString.call(t) == "[object Number]") && !ge(t);
|
|
378
|
+
}
|
|
379
|
+
function ge(t) {
|
|
380
|
+
return t != t;
|
|
381
|
+
}
|
|
382
|
+
function ve(t, e) {
|
|
383
|
+
return Math.sqrt(Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2));
|
|
384
|
+
}
|
|
385
|
+
var ft = function(t, e) {
|
|
386
|
+
t === void 0 && (t = {}), e === void 0 && (e = {}), this.type = "manipulateImage", this.move = t, this.scale = e;
|
|
387
|
+
}, si = function(t, e) {
|
|
388
|
+
e === void 0 && (e = {}), this.type = "resize", this.directions = t, this.params = e;
|
|
389
|
+
}, Yt = function(t) {
|
|
390
|
+
this.type = "move", this.directions = t;
|
|
391
|
+
}, ri = (function() {
|
|
392
|
+
function t(e, i, o, s, n) {
|
|
393
|
+
this.type = "drag", this.nativeEvent = e, this.position = o, this.previousPosition = s, this.element = i, this.anchor = n;
|
|
394
|
+
}
|
|
395
|
+
return t.prototype.shift = function() {
|
|
396
|
+
var e = this, i = e.element, o = e.anchor, s = e.position;
|
|
397
|
+
if (i) {
|
|
398
|
+
var n = i.getBoundingClientRect(), a = n.left, h = n.top;
|
|
399
|
+
return { left: s.left - a - o.left, top: s.top - h - o.top };
|
|
400
|
+
}
|
|
401
|
+
return { left: 0, top: 0 };
|
|
402
|
+
}, t;
|
|
403
|
+
})(), Xt = { name: "DraggableElement", props: { classname: { type: String } }, beforeMount: function() {
|
|
404
|
+
window.addEventListener("mouseup", this.onMouseUp, { passive: !1 }), window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), window.addEventListener("touchend", this.onTouchEnd, { passive: !1 });
|
|
405
|
+
}, beforeUnmount: function() {
|
|
406
|
+
window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
|
|
407
|
+
}, mounted: function() {
|
|
408
|
+
if (!this.$refs.draggable) throw new Error('You should add ref "draggable" to your root element to use draggable mixin');
|
|
409
|
+
this.touches = [], this.hovered = !1;
|
|
410
|
+
}, methods: { onMouseOver: function() {
|
|
411
|
+
this.hovered || (this.hovered = !0, this.$emit("enter"));
|
|
412
|
+
}, onMouseLeave: function() {
|
|
413
|
+
this.hovered && !this.touches.length && (this.hovered = !1, this.$emit("leave"));
|
|
414
|
+
}, onTouchStart: function(t) {
|
|
415
|
+
t.cancelable && !this.disabled && t.touches.length === 1 && (this.touches = rt(t.touches), this.hovered || (this.$emit("enter"), this.hovered = !0), t.touches.length && this.initAnchor(this.touches.reduce((function(e, i) {
|
|
416
|
+
return { clientX: e.clientX + i.clientX / t.touches.length, clientY: e.clientY + i.clientY / t.touches.length };
|
|
417
|
+
}), { clientX: 0, clientY: 0 })), t.preventDefault && t.preventDefault(), t.stopPropagation());
|
|
418
|
+
}, onTouchEnd: function() {
|
|
419
|
+
this.processEnd();
|
|
420
|
+
}, onTouchMove: function(t) {
|
|
421
|
+
this.touches.length && (this.processMove(t, t.touches), t.preventDefault && t.preventDefault(), t.stopPropagation && t.stopPropagation());
|
|
422
|
+
}, onMouseDown: function(t) {
|
|
423
|
+
if (!this.disabled) {
|
|
424
|
+
var e = { fake: !0, clientX: t.clientX, clientY: t.clientY };
|
|
425
|
+
this.touches = [e], this.initAnchor(e), t.stopPropagation();
|
|
426
|
+
}
|
|
427
|
+
}, onMouseMove: function(t) {
|
|
428
|
+
this.touches.length && (this.processMove(t, [{ fake: !0, clientX: t.clientX, clientY: t.clientY }]), t.preventDefault && t.preventDefault());
|
|
429
|
+
}, onMouseUp: function() {
|
|
430
|
+
this.processEnd();
|
|
431
|
+
}, initAnchor: function(t) {
|
|
432
|
+
var e = this.$refs.draggable.getBoundingClientRect(), i = e.left, o = e.right, s = e.bottom, n = e.top;
|
|
433
|
+
this.anchor = { left: t.clientX - i, top: t.clientY - n, bottom: s - t.clientY, right: o - t.clientX };
|
|
434
|
+
}, processMove: function(t, e) {
|
|
435
|
+
var i = rt(e);
|
|
436
|
+
if (this.touches.length) {
|
|
437
|
+
if (this.touches.length === 1 && i.length === 1) {
|
|
438
|
+
var o = this.$refs.draggable;
|
|
439
|
+
this.$emit("drag", new ri(t, o, { left: i[0].clientX, top: i[0].clientY }, { left: this.touches[0].clientX, top: this.touches[0].clientY }, this.anchor));
|
|
440
|
+
}
|
|
441
|
+
this.touches = i;
|
|
442
|
+
}
|
|
443
|
+
}, processEnd: function() {
|
|
444
|
+
this.touches.length && this.$emit("drag-end"), this.hovered && (this.$emit("leave"), this.hovered = !1), this.touches = [];
|
|
445
|
+
} }, emits: ["drag", "drag-end", "leave", "enter"] };
|
|
446
|
+
Xt.render = function(t, e, i, o, s, n) {
|
|
447
|
+
return b(), R("div", { ref: "draggable", class: i.classname, onTouchstart: e[1] || (e[1] = function() {
|
|
448
|
+
return n.onTouchStart && n.onTouchStart.apply(n, arguments);
|
|
449
|
+
}), onMousedown: e[2] || (e[2] = function() {
|
|
450
|
+
return n.onMouseDown && n.onMouseDown.apply(n, arguments);
|
|
451
|
+
}), onMouseover: e[3] || (e[3] = function() {
|
|
452
|
+
return n.onMouseOver && n.onMouseOver.apply(n, arguments);
|
|
453
|
+
}), onMouseleave: e[4] || (e[4] = function() {
|
|
454
|
+
return n.onMouseLeave && n.onMouseLeave.apply(n, arguments);
|
|
455
|
+
}) }, [J(t.$slots, "default")], 34);
|
|
456
|
+
};
|
|
457
|
+
var _t = Y("vue-handler-wrapper"), be = { name: "HandlerWrapper", components: { DraggableElement: Xt }, props: { horizontalPosition: { type: String }, verticalPosition: { type: String }, disabled: { type: Boolean, default: !1 } }, computed: { classes: function() {
|
|
458
|
+
var t;
|
|
459
|
+
if (this.horizontalPosition || this.verticalPosition) {
|
|
460
|
+
var e, i = fe(this.horizontalPosition, this.verticalPosition);
|
|
461
|
+
t = _t(($(e = {}, i.classname, !0), $(e, "disabled", this.disabled), e));
|
|
462
|
+
} else t = _t({ disabled: this.disabled });
|
|
463
|
+
return { root: t, draggable: _t("draggable") };
|
|
464
|
+
} }, emits: ["leave", "enter", "drag", "drag-end"] };
|
|
465
|
+
be.render = function(t, e, i, o, s, n) {
|
|
466
|
+
var a = U("DraggableElement");
|
|
467
|
+
return b(), R("div", { class: n.classes.root }, [z(a, { class: n.classes.draggable, onDrag: e[1] || (e[1] = function(h) {
|
|
468
|
+
return t.$emit("drag", h);
|
|
469
|
+
}), onDragEnd: e[2] || (e[2] = function(h) {
|
|
470
|
+
return t.$emit("drag-end");
|
|
471
|
+
}), onLeave: e[3] || (e[3] = function(h) {
|
|
472
|
+
return t.$emit("leave");
|
|
473
|
+
}), onEnter: e[4] || (e[4] = function(h) {
|
|
474
|
+
return t.$emit("enter");
|
|
475
|
+
}) }, { default: I((function() {
|
|
476
|
+
return [J(t.$slots, "default")];
|
|
477
|
+
})), _: 3 }, 8, ["class"])], 2);
|
|
478
|
+
};
|
|
479
|
+
var ai = Y("vue-line-wrapper"), we = { name: "LineWrapper", components: { DraggableElement: Xt }, props: { position: { type: String, required: !0 }, disabled: { type: Boolean, default: !1 } }, computed: { classname: function() {
|
|
480
|
+
var t;
|
|
481
|
+
return ai(($(t = {}, this.position, !0), $(t, "disabled", this.disabled), t));
|
|
482
|
+
} }, emits: ["leave", "enter", "drag", "drag-end"] };
|
|
483
|
+
we.render = function(t, e, i, o, s, n) {
|
|
484
|
+
var a = U("DraggableElement");
|
|
485
|
+
return b(), R(a, { class: n.classname, onDrag: e[1] || (e[1] = function(h) {
|
|
486
|
+
return t.$emit("drag", h);
|
|
487
|
+
}), onDragEnd: e[2] || (e[2] = function(h) {
|
|
488
|
+
return t.$emit("drag-end");
|
|
489
|
+
}), onLeave: e[3] || (e[3] = function(h) {
|
|
490
|
+
return t.$emit("leave");
|
|
491
|
+
}), onEnter: e[4] || (e[4] = function(h) {
|
|
492
|
+
return t.$emit("enter");
|
|
493
|
+
}) }, { default: I((function() {
|
|
494
|
+
return [J(t.$slots, "default")];
|
|
495
|
+
})), _: 3 }, 8, ["class"]);
|
|
496
|
+
};
|
|
497
|
+
var q = ["left", "right", "top", "bottom"], hi = ["left", "right"], li = ["top", "bottom"], ci = ["left", "top"], ui = ["fill-area", "fit-area", "stencil", "none"], oe = { left: 0, top: 0, width: 0, height: 0 };
|
|
498
|
+
function se(t, e, i) {
|
|
499
|
+
return !(i = i || ["width", "height", "left", "top"]).some((function(o) {
|
|
500
|
+
return t[o] !== e[o];
|
|
501
|
+
}));
|
|
502
|
+
}
|
|
503
|
+
function Z(t) {
|
|
504
|
+
return { left: t.left, top: t.top, right: t.left + t.width, bottom: t.top + t.height };
|
|
505
|
+
}
|
|
506
|
+
function ct(t, e) {
|
|
507
|
+
return { left: t.left - e.left, top: t.top - e.top };
|
|
508
|
+
}
|
|
509
|
+
function _(t) {
|
|
510
|
+
return { left: t.left + t.width / 2, top: t.top + t.height / 2 };
|
|
511
|
+
}
|
|
512
|
+
function gt(t, e) {
|
|
513
|
+
var i = { left: 0, top: 0, right: 0, bottom: 0 };
|
|
514
|
+
return q.forEach((function(o) {
|
|
515
|
+
var s = e[o], n = Z(t)[o];
|
|
516
|
+
i[o] = s !== void 0 && n !== void 0 ? o === "left" || o === "top" ? Math.max(0, s - n) : Math.max(0, n - s) : 0;
|
|
517
|
+
})), i;
|
|
518
|
+
}
|
|
519
|
+
function N(t, e) {
|
|
520
|
+
return { left: t.left - e.left, top: t.top - e.top, width: t.width + e.left + e.right, height: t.height + e.top + e.bottom };
|
|
521
|
+
}
|
|
522
|
+
function St(t) {
|
|
523
|
+
return { left: -t.left, top: -t.top };
|
|
524
|
+
}
|
|
525
|
+
function P(t, e) {
|
|
526
|
+
return p(p({}, t), { left: t.left + e.left, top: t.top + e.top });
|
|
527
|
+
}
|
|
528
|
+
function j(t, e, i, o) {
|
|
529
|
+
if (e !== 1) {
|
|
530
|
+
if (i) {
|
|
531
|
+
var s = _(t);
|
|
532
|
+
return { width: t.width * e, height: t.height * e, left: t.left + t.width * (1 - e) / 2 + (i.left - s.left) * (1 - e), top: t.top + t.height * (1 - e) / 2 + (i.top - s.top) * (1 - e) };
|
|
533
|
+
}
|
|
534
|
+
return { width: t.width * e, height: t.height * e, left: t.left + t.width * (1 - e) / 2, top: t.top + t.height * (1 - e) / 2 };
|
|
535
|
+
}
|
|
536
|
+
return t;
|
|
537
|
+
}
|
|
538
|
+
function y(t) {
|
|
539
|
+
return t.width / t.height;
|
|
540
|
+
}
|
|
541
|
+
function ut(t, e) {
|
|
542
|
+
return Math.min(e.right !== void 0 && e.left !== void 0 ? (e.right - e.left) / t.width : 1 / 0, e.bottom !== void 0 && e.top !== void 0 ? (e.bottom - e.top) / t.height : 1 / 0);
|
|
543
|
+
}
|
|
544
|
+
function dt(t, e) {
|
|
545
|
+
var i = { left: 0, top: 0 }, o = gt(t, e);
|
|
546
|
+
return o.left && o.left > 0 ? i.left = o.left : o.right && o.right > 0 && (i.left = -o.right), o.top && o.top > 0 ? i.top = o.top : o.bottom && o.bottom > 0 && (i.top = -o.bottom), i;
|
|
547
|
+
}
|
|
548
|
+
function Dt(t, e) {
|
|
549
|
+
var i;
|
|
550
|
+
return e.minimum && t < e.minimum ? i = e.minimum : e.maximum && t > e.maximum && (i = e.maximum), i;
|
|
551
|
+
}
|
|
552
|
+
function ye(t, e) {
|
|
553
|
+
var i = y(t), o = y(e);
|
|
554
|
+
return e.width < 1 / 0 && e.height < 1 / 0 ? i > o ? { width: e.width, height: e.width / i } : { width: e.height * i, height: e.height } : e.width < 1 / 0 ? { width: e.width, height: e.width / i } : e.height < 1 / 0 ? { width: e.height * i, height: e.height } : t;
|
|
555
|
+
}
|
|
556
|
+
function ze(t, e) {
|
|
557
|
+
var i = e * Math.PI / 180;
|
|
558
|
+
return { width: Math.abs(t.width * Math.cos(i)) + Math.abs(t.height * Math.sin(i)), height: Math.abs(t.width * Math.sin(i)) + Math.abs(t.height * Math.cos(i)) };
|
|
559
|
+
}
|
|
560
|
+
function ot(t, e) {
|
|
561
|
+
var i = e * Math.PI / 180;
|
|
562
|
+
return { left: t.left * Math.cos(i) - t.top * Math.sin(i), top: t.left * Math.sin(i) + t.top * Math.cos(i) };
|
|
563
|
+
}
|
|
564
|
+
function Et(t, e) {
|
|
565
|
+
var i = gt(D(t, e), e);
|
|
566
|
+
return i.left + i.right + i.top + i.bottom ? i.left + i.right > i.top + i.bottom ? Math.min((t.width + i.left + i.right) / t.width, ut(t, e)) : Math.min((t.height + i.top + i.bottom) / t.height, ut(t, e)) : 1;
|
|
567
|
+
}
|
|
568
|
+
function D(t, e, i) {
|
|
569
|
+
i === void 0 && (i = !1);
|
|
570
|
+
var o = dt(t, e);
|
|
571
|
+
return P(t, i ? St(o) : o);
|
|
572
|
+
}
|
|
573
|
+
function jt(t) {
|
|
574
|
+
return { width: t.right !== void 0 && t.left !== void 0 ? t.right - t.left : 1 / 0, height: t.bottom !== void 0 && t.top !== void 0 ? t.bottom - t.top : 1 / 0 };
|
|
575
|
+
}
|
|
576
|
+
function di(t, e) {
|
|
577
|
+
return p(p({}, t), { minWidth: Math.min(e.width, t.minWidth), minHeight: Math.min(e.height, t.minHeight), maxWidth: Math.min(e.width, t.maxWidth), maxHeight: Math.min(e.height, t.maxHeight) });
|
|
578
|
+
}
|
|
579
|
+
function Re(t, e, i) {
|
|
580
|
+
i === void 0 && (i = !0);
|
|
581
|
+
var o = {};
|
|
582
|
+
return q.forEach((function(s) {
|
|
583
|
+
var n = t[s], a = e[s];
|
|
584
|
+
n !== void 0 && a !== void 0 ? o[s] = s === "left" || s === "top" ? i ? Math.max(n, a) : Math.min(n, a) : i ? Math.min(n, a) : Math.max(n, a) : a !== void 0 ? o[s] = a : n !== void 0 && (o[s] = n);
|
|
585
|
+
})), o;
|
|
586
|
+
}
|
|
587
|
+
function Ct(t, e) {
|
|
588
|
+
return Re(t, e, !0);
|
|
589
|
+
}
|
|
590
|
+
function re(t) {
|
|
591
|
+
var e = t.size, i = t.aspectRatio, o = t.ignoreMinimum, s = t.sizeRestrictions;
|
|
592
|
+
return !!((e.correctRatio || y(e) >= i.minimum && y(e) <= i.maximum) && e.height <= s.maxHeight && e.width <= s.maxWidth && e.width && e.height && (o || e.height >= s.minHeight && e.width >= s.minWidth));
|
|
593
|
+
}
|
|
594
|
+
function ae(t, e) {
|
|
595
|
+
return Math.pow(t.width - e.width, 2) + Math.pow(t.height - e.height, 2);
|
|
596
|
+
}
|
|
597
|
+
function K(t) {
|
|
598
|
+
var e = t.width, i = t.height, o = t.sizeRestrictions, s = { minimum: t.aspectRatio && t.aspectRatio.minimum || 0, maximum: t.aspectRatio && t.aspectRatio.maximum || 1 / 0 }, n = { width: Math.max(o.minWidth, Math.min(o.maxWidth, e)), height: Math.max(o.minHeight, Math.min(o.maxHeight, i)) };
|
|
599
|
+
function a(l, c) {
|
|
600
|
+
return c === void 0 && (c = !1), l.reduce((function(u, d) {
|
|
601
|
+
return re({ size: d, aspectRatio: s, sizeRestrictions: o, ignoreMinimum: c }) && (!u || ae(d, { width: e, height: i }) < ae(u, { width: e, height: i })) ? d : u;
|
|
602
|
+
}), null);
|
|
603
|
+
}
|
|
604
|
+
var h = [];
|
|
605
|
+
s && [s.minimum, s.maximum].forEach((function(l) {
|
|
606
|
+
l && h.push({ width: n.width, height: n.width / l, correctRatio: !0 }, { width: n.height * l, height: n.height, correctRatio: !0 });
|
|
607
|
+
})), re({ size: n, aspectRatio: s, sizeRestrictions: o }) && h.push(n);
|
|
608
|
+
var r = a(h) || a(h, !0);
|
|
609
|
+
return r && { width: r.width, height: r.height };
|
|
610
|
+
}
|
|
611
|
+
function kt(t) {
|
|
612
|
+
var e = t.event, i = t.coordinates, o = t.positionRestrictions, s = o === void 0 ? {} : o, n = P(i, e.directions);
|
|
613
|
+
return P(n, dt(n, s));
|
|
614
|
+
}
|
|
615
|
+
function mi(t) {
|
|
616
|
+
var e = t.coordinates, i = t.transform, o = t.imageSize, s = t.sizeRestrictions, n = t.positionRestrictions, a = t.aspectRatio, h = t.visibleArea, r = function(c, u) {
|
|
617
|
+
return kt({ coordinates: c, positionRestrictions: n, event: new Yt({ left: u.left - c.left, top: u.top - c.top }) });
|
|
618
|
+
}, l = p({}, e);
|
|
619
|
+
return (Array.isArray(i) ? i : [i]).forEach((function(c) {
|
|
620
|
+
var u = {};
|
|
621
|
+
T((u = typeof c == "function" ? c({ coordinates: l, imageSize: o, visibleArea: h }) : c).width) && T(u.height) || (l = (function(d, m) {
|
|
622
|
+
var g = p(p(p({}, d), K({ width: m.width, height: m.height, sizeRestrictions: s, aspectRatio: a })), { left: 0, top: 0 });
|
|
623
|
+
return r(g, { left: d.left, top: d.top });
|
|
624
|
+
})(l, p(p({}, l), u))), T(u.left) && T(u.top) || (l = r(l, p(p({}, l), u)));
|
|
625
|
+
})), l;
|
|
626
|
+
}
|
|
627
|
+
function fi(t) {
|
|
628
|
+
t.event;
|
|
629
|
+
var e = t.getAreaRestrictions, i = t.boundaries, o = t.coordinates, s = t.visibleArea;
|
|
630
|
+
t.aspectRatio;
|
|
631
|
+
var n = t.stencilSize, a = t.sizeRestrictions, h = t.positionRestrictions;
|
|
632
|
+
t.stencilReference;
|
|
633
|
+
var r, l, c, u = p({}, o), d = p({}, s), m = p({}, n);
|
|
634
|
+
r = y(m), l = y(u), c === void 0 && (c = 1e-3), (r === 0 || l === 0 ? Math.abs(l - r) < c : Math.abs(l / r) < 1 + c && Math.abs(l / r) > 1 - c) || (u = p(p({}, u), K({ sizeRestrictions: a, width: u.width, height: u.height, aspectRatio: { minimum: y(m), maximum: y(m) } })));
|
|
635
|
+
var g = Et(d = j(d, u.width * i.width / (d.width * m.width)), e({ visibleArea: d, type: "resize" }));
|
|
636
|
+
return g !== 1 && (d = j(d, g), u = j(u, g)), d = D(d = P(d, ct(_(u), _(d))), e({ visibleArea: d, type: "move" })), { coordinates: u = D(u, Ct(Z(d), h)), visibleArea: d };
|
|
637
|
+
}
|
|
638
|
+
function pi(t) {
|
|
639
|
+
var e = t.event, i = t.getAreaRestrictions, o = t.boundaries, s = t.coordinates, n = t.visibleArea;
|
|
640
|
+
t.aspectRatio, t.stencilSize, t.sizeRestrictions;
|
|
641
|
+
var a = t.positionRestrictions;
|
|
642
|
+
t.stencilReference;
|
|
643
|
+
var h = p({}, s), r = p({}, n);
|
|
644
|
+
if (s && n && e.type !== "manipulateImage") {
|
|
645
|
+
var l = { width: 0, height: 0 };
|
|
646
|
+
r.width, o.width, y(o) > y(h) ? (l.height = 0.8 * o.height, l.width = l.height * y(h)) : (l.width = 0.8 * o.width, l.height = l.width * y(h));
|
|
647
|
+
var c = Et(r = j(r, h.width * o.width / (r.width * l.width)), i({ visibleArea: r, type: "resize" }));
|
|
648
|
+
r = j(r, c), c !== 1 && (l.height /= c, l.width /= c), r = D(r = P(r, ct(_(h), _(r))), i({ visibleArea: r, type: "move" })), h = D(h, Ct(Z(r), a));
|
|
649
|
+
}
|
|
650
|
+
return { coordinates: h, visibleArea: r };
|
|
651
|
+
}
|
|
652
|
+
function gi(t) {
|
|
653
|
+
var e = t.event, i = t.coordinates, o = t.visibleArea, s = t.getAreaRestrictions, n = p({}, o), a = p({}, i);
|
|
654
|
+
if (e.type === "setCoordinates") {
|
|
655
|
+
var h = Math.max(0, a.width - n.width), r = Math.max(0, a.height - n.height);
|
|
656
|
+
h > r ? n = j(n, Math.min(a.width / n.width, ut(n, s({ visibleArea: n, type: "resize" })))) : r > h && (n = j(n, Math.min(a.height / n.height, ut(n, s({ visibleArea: n, type: "resize" }))))), n = D(n = P(n, St(dt(a, Z(n)))), s({ visibleArea: n, type: "move" }));
|
|
657
|
+
}
|
|
658
|
+
return { visibleArea: n, coordinates: a };
|
|
659
|
+
}
|
|
660
|
+
function vi(t) {
|
|
661
|
+
var e = t.imageSize, i = t.visibleArea, o = t.coordinates, s = i || e;
|
|
662
|
+
return { left: (i ? i.left : 0) + s.width / 2 - o.width / 2, top: (i ? i.top : 0) + s.height / 2 - o.height / 2 };
|
|
663
|
+
}
|
|
664
|
+
function bi(t) {
|
|
665
|
+
var e = t.imageSize, i = t.visibleArea, o = t.aspectRatio, s = t.sizeRestrictions, n = i || e, a = Math.min(o.maximum || 1 / 0, Math.max(o.minimum || 0, y(n))), h = n.width < n.height ? { width: 0.8 * n.width, height: 0.8 * n.width / a } : { height: 0.8 * n.height, width: 0.8 * n.height * a };
|
|
666
|
+
return K(p(p({}, h), { aspectRatio: o, sizeRestrictions: s }));
|
|
667
|
+
}
|
|
668
|
+
function wi(t) {
|
|
669
|
+
var e, i, o = t.imageSize, s = t.visibleArea, n = t.boundaries, a = t.aspectRatio, h = t.sizeRestrictions, r = t.stencilSize, l = s || o;
|
|
670
|
+
return y(l) > y(n) ? i = (e = r.height * l.height / n.height) * y(r) : e = (i = r.width * l.width / n.width) / y(r), K({ width: i, height: e, aspectRatio: a, sizeRestrictions: h });
|
|
671
|
+
}
|
|
672
|
+
function yi(t) {
|
|
673
|
+
var e = t.getAreaRestrictions, i = t.coordinates, o = t.imageSize, s = y(t.boundaries);
|
|
674
|
+
if (i) {
|
|
675
|
+
var n = { height: Math.max(i.height, o.height), width: Math.max(i.width, o.width) }, a = ye({ width: y(n) > s ? n.width : n.height * s, height: y(n) > s ? n.width / s : n.height }, jt(e())), h = { left: i.left + i.width / 2 - a.width / 2, top: i.top + i.height / 2 - a.height / 2, width: a.width, height: a.height }, r = gt(i, Z(p({ left: 0, top: 0 }, o))), l = {};
|
|
676
|
+
return !r.left && !r.right && h.width <= o.width && (l.left = 0, l.right = o.width), !r.top && !r.bottom && h.height <= o.height && (l.top = 0, l.bottom = o.height), D(h, l);
|
|
677
|
+
}
|
|
678
|
+
var c = y(o);
|
|
679
|
+
return a = { height: c > s ? o.height : o.width / s, width: c > s ? o.height * s : o.width }, { left: o.width / 2 - a.width / 2, top: o.height / 2 - a.height / 2, width: a.width, height: a.height };
|
|
680
|
+
}
|
|
681
|
+
function yt(t, e) {
|
|
682
|
+
return Re(t, Z(e));
|
|
683
|
+
}
|
|
684
|
+
function zi(t) {
|
|
685
|
+
var e = t.event, i = t.coordinates, o = t.visibleArea, s = t.sizeRestrictions, n = t.getAreaRestrictions, a = t.positionRestrictions, h = t.adjustStencil, r = e.scale, l = e.move, c = p({}, o), u = p({}, i), d = 1, m = 1, g = r.factor && Math.abs(r.factor - 1) > 1e-3;
|
|
686
|
+
c = P(c, { left: l.left || 0, top: l.top || 0 });
|
|
687
|
+
var v = { stencil: { minimum: Math.max(s.minWidth ? s.minWidth / u.width : 0, s.minHeight ? s.minHeight / u.height : 0), maximum: Math.min(s.maxWidth ? s.maxWidth / u.width : 1 / 0, s.maxHeight ? s.maxHeight / u.height : 1 / 0, ut(u, a)) }, area: { maximum: ut(c, n({ visibleArea: c, type: "resize" })) } };
|
|
688
|
+
r.factor && g && (r.factor < 1 ? (m = Math.max(r.factor, v.stencil.minimum)) > 1 && (m = 1) : r.factor > 1 && (m = Math.min(r.factor, Math.min(v.area.maximum, v.stencil.maximum))) < 1 && (m = 1)), m && (c = j(c, m, r.center));
|
|
689
|
+
var M = i.left - o.left, H = o.width + o.left - (i.width + i.left), tt = i.top - o.top, at = o.height + o.top - (i.height + i.top);
|
|
690
|
+
return c = D(c = P(c, dt(c, { left: a.left !== void 0 ? a.left - M * m : void 0, top: a.top !== void 0 ? a.top - tt * m : void 0, bottom: a.bottom !== void 0 ? a.bottom + at * m : void 0, right: a.right !== void 0 ? a.right + H * m : void 0 })), n({ visibleArea: c, type: "move" })), u.width = u.width * m, u.height = u.height * m, u.left = c.left + M * m, u.top = c.top + tt * m, u = D(u, Ct(Z(c), a)), r.factor && g && h && (r.factor > 1 ? d = Math.min(v.area.maximum, r.factor) / m : r.factor < 1 && (d = Math.max(u.height / c.height, u.width / c.width, r.factor / m)), d !== 1 && (c = P(c = D(c = j(c, d, r.factor > 1 ? r.center : _(u)), n({ visibleArea: c, type: "move" })), St(dt(u, Z(c)))))), { coordinates: u, visibleArea: c };
|
|
691
|
+
}
|
|
692
|
+
function Ri(t) {
|
|
693
|
+
var e = t.aspectRatio, i = t.getAreaRestrictions, o = t.coordinates, s = t.visibleArea, n = t.sizeRestrictions, a = t.positionRestrictions, h = t.imageSize, r = t.previousImageSize, l = t.angle, c = p({}, o), u = p({}, s), d = ot(_(p({ left: 0, top: 0 }, r)), l);
|
|
694
|
+
return (c = p(p({}, K({ sizeRestrictions: n, aspectRatio: e, width: c.width, height: c.height })), ot(_(c), l))).left -= d.left - h.width / 2 + c.width / 2, c.top -= d.top - h.height / 2 + c.height / 2, u = j(u, Et(u, i({ visibleArea: u, type: "resize" }))), { coordinates: c = D(c, a), visibleArea: u = D(u = P(u, ct(_(c), _(o))), i({ visibleArea: u, type: "move" })) };
|
|
695
|
+
}
|
|
696
|
+
function Ai(t) {
|
|
697
|
+
var e = t.flip, i = t.previousFlip, o = t.rotate, s = t.getAreaRestrictions, n = t.coordinates, a = t.visibleArea, h = t.imageSize, r = p({}, n), l = p({}, a), c = i.horizontal !== e.horizontal, u = i.vertical !== e.vertical;
|
|
698
|
+
if (c || u) {
|
|
699
|
+
var d = ot({ left: h.width / 2, top: h.height / 2 }, -o), m = ot(_(r), -o), g = ot({ left: c ? d.left - (m.left - d.left) : m.left, top: u ? d.top - (m.top - d.top) : m.top }, o);
|
|
700
|
+
r = P(r, ct(g, _(r))), m = ot(_(l), -o), l = D(l = P(l, ct(g = ot({ left: c ? d.left - (m.left - d.left) : m.left, top: u ? d.top - (m.top - d.top) : m.top }, o), _(l))), s({ visibleArea: l, type: "move" }));
|
|
701
|
+
}
|
|
702
|
+
return { coordinates: r, visibleArea: l };
|
|
703
|
+
}
|
|
704
|
+
function he(t) {
|
|
705
|
+
var e = t.directions, i = t.coordinates, o = t.positionRestrictions, s = o === void 0 ? {} : o, n = t.sizeRestrictions, a = t.preserveRatio, h = t.compensate, r = p({}, e), l = N(i, r).width, c = N(i, r).height;
|
|
706
|
+
l < 0 && (r.left < 0 && r.right < 0 ? (r.left = -(i.width - n.minWidth) / (r.left / r.right), r.right = -(i.width - n.minWidth) / (r.right / r.left)) : r.left < 0 ? r.left = -(i.width - n.minWidth) : r.right < 0 && (r.right = -(i.width - n.minWidth))), c < 0 && (r.top < 0 && r.bottom < 0 ? (r.top = -(i.height - n.minHeight) / (r.top / r.bottom), r.bottom = -(i.height - n.minHeight) / (r.bottom / r.top)) : r.top < 0 ? r.top = -(i.height - n.minHeight) : r.bottom < 0 && (r.bottom = -(i.height - n.minHeight)));
|
|
707
|
+
var u = gt(N(i, r), s);
|
|
708
|
+
h && (u.left && u.left > 0 && u.right === 0 ? (r.right += u.left, r.left -= u.left) : u.right && u.right > 0 && u.left === 0 && (r.left += u.right, r.right -= u.right), u.top && u.top > 0 && u.bottom === 0 ? (r.bottom += u.top, r.top -= u.top) : u.bottom && u.bottom > 0 && u.top === 0 && (r.top += u.bottom, r.bottom -= u.bottom), u = gt(N(i, r), s));
|
|
709
|
+
var d = { width: 1 / 0, height: 1 / 0, left: 1 / 0, right: 1 / 0, top: 1 / 0, bottom: 1 / 0 };
|
|
710
|
+
if (q.forEach((function(v) {
|
|
711
|
+
var M = u[v];
|
|
712
|
+
M && r[v] && (d[v] = Math.max(0, 1 - M / r[v]));
|
|
713
|
+
})), a) {
|
|
714
|
+
var m = Math.min.apply(null, q.map((function(v) {
|
|
715
|
+
return d[v];
|
|
716
|
+
})));
|
|
717
|
+
m !== 1 / 0 && q.forEach((function(v) {
|
|
718
|
+
r[v] *= m;
|
|
719
|
+
}));
|
|
720
|
+
} else q.forEach((function(v) {
|
|
721
|
+
d[v] !== 1 / 0 && (r[v] *= d[v]);
|
|
722
|
+
}));
|
|
723
|
+
if (l = N(i, r).width, c = N(i, r).height, r.right + r.left && (l > n.maxWidth ? d.width = (n.maxWidth - i.width) / (r.right + r.left) : l < n.minWidth && (d.width = (n.minWidth - i.width) / (r.right + r.left))), r.bottom + r.top && (c > n.maxHeight ? d.height = (n.maxHeight - i.height) / (r.bottom + r.top) : c < n.minHeight && (d.height = (n.minHeight - i.height) / (r.bottom + r.top))), a) {
|
|
724
|
+
var g = Math.min(d.width, d.height);
|
|
725
|
+
g !== 1 / 0 && q.forEach((function(v) {
|
|
726
|
+
r[v] *= g;
|
|
727
|
+
}));
|
|
728
|
+
} else d.width !== 1 / 0 && hi.forEach((function(v) {
|
|
729
|
+
r[v] *= d.width;
|
|
730
|
+
})), d.height !== 1 / 0 && li.forEach((function(v) {
|
|
731
|
+
r[v] *= d.height;
|
|
732
|
+
}));
|
|
733
|
+
return r;
|
|
734
|
+
}
|
|
735
|
+
function zt(t, e, i) {
|
|
736
|
+
return e == 0 && i == 0 ? t / 2 : e == 0 ? 0 : i == 0 ? t : t * Math.abs(e / (e + i));
|
|
737
|
+
}
|
|
738
|
+
var xi = Y("vue-simple-handler"), Mi = Y("vue-simple-handler-wrapper"), Vt = { name: "SimpleHandler", components: { HandlerWrapper: be }, props: { defaultClass: { type: String }, hoverClass: { type: String }, wrapperClass: { type: String }, horizontalPosition: { type: String }, verticalPosition: { type: String }, disabled: { type: Boolean, default: !1 } }, data: function() {
|
|
739
|
+
return { hover: !1 };
|
|
740
|
+
}, computed: { classes: function() {
|
|
741
|
+
var t, e = ($(t = {}, this.horizontalPosition, !!this.horizontalPosition), $(t, this.verticalPosition, !!this.verticalPosition), $(t, "".concat(this.horizontalPosition, "-").concat(this.verticalPosition), !!(this.verticalPosition && this.horizontalPosition)), $(t, "hover", this.hover), t);
|
|
742
|
+
return { default: C(xi(e), this.defaultClass, this.hover && this.hoverClass), wrapper: C(Mi(e), this.wrapperClass) };
|
|
743
|
+
} }, methods: { onDrag: function(t) {
|
|
744
|
+
this.$emit("drag", t);
|
|
745
|
+
}, onEnter: function() {
|
|
746
|
+
this.hover = !0;
|
|
747
|
+
}, onLeave: function() {
|
|
748
|
+
this.hover = !1;
|
|
749
|
+
}, onDragEnd: function() {
|
|
750
|
+
this.$emit("drag-end");
|
|
751
|
+
} }, emits: ["drag", "drag-end"] };
|
|
752
|
+
Vt.render = function(t, e, i, o, s, n) {
|
|
753
|
+
var a = U("HandlerWrapper");
|
|
754
|
+
return b(), R(a, { class: n.classes.wrapper, "vertical-position": i.verticalPosition, "horizontal-position": i.horizontalPosition, disabled: i.disabled, onDrag: n.onDrag, onDragEnd: n.onDragEnd, onEnter: n.onEnter, onLeave: n.onLeave }, { default: I((function() {
|
|
755
|
+
return [z("div", { class: n.classes.default }, null, 2)];
|
|
756
|
+
})), _: 1 }, 8, ["class", "vertical-position", "horizontal-position", "disabled", "onDrag", "onDragEnd", "onEnter", "onLeave"]);
|
|
757
|
+
};
|
|
758
|
+
var Si = Y("vue-simple-line"), Ei = Y("vue-simple-line-wrapper"), Nt = { name: "SimpleLine", components: { LineWrapper: we }, props: { defaultClass: { type: String }, hoverClass: { type: String }, wrapperClass: { type: String }, position: { type: String }, disabled: { type: Boolean, default: !1 } }, data: function() {
|
|
759
|
+
return { hover: !1 };
|
|
760
|
+
}, computed: { classes: function() {
|
|
761
|
+
return { root: C(Si($({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass), wrapper: C(Ei($({}, this.position, !0)), this.wrapperClass) };
|
|
762
|
+
} }, methods: { onDrag: function(t) {
|
|
763
|
+
this.$emit("drag", t);
|
|
764
|
+
}, onEnter: function() {
|
|
765
|
+
this.hover = !0;
|
|
766
|
+
}, onLeave: function() {
|
|
767
|
+
this.hover = !1;
|
|
768
|
+
}, onDragEnd: function() {
|
|
769
|
+
this.$emit("drag-end");
|
|
770
|
+
} }, emits: ["drag", "drag-end"] };
|
|
771
|
+
Nt.render = function(t, e, i, o, s, n) {
|
|
772
|
+
var a = U("LineWrapper");
|
|
773
|
+
return b(), R(a, { class: n.classes.wrapper, position: i.position, disabled: i.disabled, onDrag: n.onDrag, onDragEnd: n.onDragEnd, onEnter: n.onEnter, onLeave: n.onLeave }, { default: I((function() {
|
|
774
|
+
return [z("div", { class: n.classes.root }, null, 2)];
|
|
775
|
+
})), _: 1 }, 8, ["class", "position", "disabled", "onDrag", "onDragEnd", "onEnter", "onLeave"]);
|
|
776
|
+
};
|
|
777
|
+
var Lt = Y("vue-bounding-box"), Ci = ["east", "west", null], Ti = ["south", "north", null], Ae = { name: "BoundingBox", props: { width: { type: Number }, height: { type: Number }, transitions: { type: Object }, handlers: { type: Object, default: function() {
|
|
778
|
+
return { eastNorth: !0, north: !0, westNorth: !0, west: !0, westSouth: !0, south: !0, eastSouth: !0, east: !0 };
|
|
779
|
+
} }, handlersComponent: { type: [Object, String], default: function() {
|
|
780
|
+
return Vt;
|
|
781
|
+
} }, handlersClasses: { type: Object, default: function() {
|
|
782
|
+
return {};
|
|
783
|
+
} }, handlersWrappersClasses: { type: Object, default: function() {
|
|
784
|
+
return {};
|
|
785
|
+
} }, lines: { type: Object, default: function() {
|
|
786
|
+
return { west: !0, north: !0, east: !0, south: !0 };
|
|
787
|
+
} }, linesComponent: { type: [Object, String], default: function() {
|
|
788
|
+
return Nt;
|
|
789
|
+
} }, linesClasses: { type: Object, default: function() {
|
|
790
|
+
return {};
|
|
791
|
+
} }, linesWrappersClasses: { type: Object, default: function() {
|
|
792
|
+
return {};
|
|
793
|
+
} }, resizable: { type: Boolean, default: !0 } }, data: function() {
|
|
794
|
+
var t = [];
|
|
795
|
+
return Ci.forEach((function(e) {
|
|
796
|
+
Ti.forEach((function(i) {
|
|
797
|
+
if (e !== i) {
|
|
798
|
+
var o = fe(e, i), s = o.name, n = o.classname;
|
|
799
|
+
t.push({ name: s, classname: n, verticalDirection: i, horizontalDirection: e });
|
|
800
|
+
}
|
|
801
|
+
}));
|
|
802
|
+
})), { points: t };
|
|
803
|
+
}, computed: { style: function() {
|
|
804
|
+
var t = {};
|
|
805
|
+
return this.width && this.height && (t.width = "".concat(this.width, "px"), t.height = "".concat(this.height, "px"), this.transitions && this.transitions.enabled && (t.transition = "".concat(this.transitions.time, "ms ").concat(this.transitions.timingFunction))), t;
|
|
806
|
+
}, classes: function() {
|
|
807
|
+
var t = this.handlersClasses, e = this.handlersWrappersClasses, i = this.linesClasses, o = this.linesWrappersClasses;
|
|
808
|
+
return { root: Lt(), handlers: t, handlersWrappers: e, lines: i, linesWrappers: o };
|
|
809
|
+
}, lineNodes: function() {
|
|
810
|
+
var t = this, e = [];
|
|
811
|
+
return this.points.forEach((function(i) {
|
|
812
|
+
i.horizontalDirection && i.verticalDirection || !t.lines[i.name] || e.push({ name: i.name, component: t.linesComponent, class: C(t.classes.lines.default, t.classes.lines[i.name], !t.resizable && t.classes.lines.disabled), wrapperClass: C(t.classes.linesWrappers.default, t.classes.linesWrappers[i.name], !t.resizable && t.classes.linesWrappers.disabled), hoverClass: t.classes.lines.hover, verticalDirection: i.verticalDirection, horizontalDirection: i.horizontalDirection, disabled: !t.resizable });
|
|
813
|
+
})), e;
|
|
814
|
+
}, handlerNodes: function() {
|
|
815
|
+
var t = this, e = [], i = this.width, o = this.height;
|
|
816
|
+
return this.points.forEach((function(s) {
|
|
817
|
+
if (t.handlers[s.name]) {
|
|
818
|
+
var n = { name: s.name, component: t.handlersComponent, class: C(t.classes.handlers.default, t.classes.handlers[s.name]), wrapperClass: C(t.classes.handlersWrappers.default, t.classes.handlersWrappers[s.name]), hoverClass: t.classes.handlers.hover, verticalDirection: s.verticalDirection, horizontalDirection: s.horizontalDirection, disabled: !t.resizable };
|
|
819
|
+
if (i && o) {
|
|
820
|
+
var a = s.horizontalDirection, h = s.verticalDirection, r = a === "east" ? i : a === "west" ? 0 : i / 2, l = h === "south" ? o : h === "north" ? 0 : o / 2;
|
|
821
|
+
n.wrapperClass = Lt("handler"), n.wrapperStyle = { transform: "translate(".concat(r, "px, ").concat(l, "px)") }, t.transitions && t.transitions.enabled && (n.wrapperStyle.transition = "".concat(t.transitions.time, "ms ").concat(t.transitions.timingFunction));
|
|
822
|
+
} else n.wrapperClass = Lt("handler", $({}, s.classname, !0));
|
|
823
|
+
e.push(n);
|
|
824
|
+
}
|
|
825
|
+
})), e;
|
|
826
|
+
} }, beforeMount: function() {
|
|
827
|
+
window.addEventListener("mouseup", this.onMouseUp, { passive: !1 }), window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), window.addEventListener("touchend", this.onTouchEnd, { passive: !1 });
|
|
828
|
+
}, beforeUnmount: function() {
|
|
829
|
+
window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
|
|
830
|
+
}, mounted: function() {
|
|
831
|
+
this.touches = [];
|
|
832
|
+
}, methods: { onEnd: function() {
|
|
833
|
+
this.$emit("resize-end");
|
|
834
|
+
}, onHandlerDrag: function(t, e, i) {
|
|
835
|
+
var o, s = t.shift(), n = s.left, a = s.top, h = { left: 0, right: 0, top: 0, bottom: 0 };
|
|
836
|
+
e === "west" ? h.left -= n : e === "east" && (h.right += n), i === "north" ? h.top -= a : i === "south" && (h.bottom += a), !i && e ? o = "width" : i && !e && (o = "height"), this.resizable && this.$emit("resize", new si(h, { allowedDirections: { left: e === "west" || !e, right: e === "east" || !e, bottom: i === "south" || !i, top: i === "north" || !i }, preserveAspectRatio: t.nativeEvent && t.nativeEvent.shiftKey, respectDirection: o }));
|
|
837
|
+
} }, emits: ["resize", "resize-end"] };
|
|
838
|
+
Ae.render = function(t, e, i, o, s, n) {
|
|
839
|
+
return b(), R("div", { ref: "box", class: n.classes.root, style: n.style }, [J(t.$slots, "default"), z("div", null, [(b(!0), R(pt, null, xt(n.lineNodes, (function(a) {
|
|
840
|
+
return b(), R(Mt(a.component), { key: a.name, "default-class": a.class, "hover-class": a.hoverClass, "wrapper-class": a.wrapperClass, position: a.name, disabled: a.disabled, onDrag: function(h) {
|
|
841
|
+
return n.onHandlerDrag(h, a.horizontalDirection, a.verticalDirection);
|
|
842
|
+
}, onDragEnd: e[1] || (e[1] = function(h) {
|
|
843
|
+
return n.onEnd();
|
|
844
|
+
}) }, null, 8, ["default-class", "hover-class", "wrapper-class", "position", "disabled", "onDrag"]);
|
|
845
|
+
})), 128))]), (b(!0), R(pt, null, xt(n.handlerNodes, (function(a) {
|
|
846
|
+
return b(), R("div", { key: a.name, style: a.wrapperStyle, class: a.wrapperClass }, [(b(), R(Mt(a.component), { "default-class": a.class, "hover-class": a.hoverClass, "wrapper-class": a.wrapperClass, "horizontal-position": a.horizontalDirection, "vertical-position": a.verticalDirection, disabled: a.disabled, onDrag: function(h) {
|
|
847
|
+
return n.onHandlerDrag(h, a.horizontalDirection, a.verticalDirection);
|
|
848
|
+
}, onDragEnd: e[2] || (e[2] = function(h) {
|
|
849
|
+
return n.onEnd();
|
|
850
|
+
}) }, null, 8, ["default-class", "hover-class", "wrapper-class", "horizontal-position", "vertical-position", "disabled", "onDrag"]))], 6);
|
|
851
|
+
})), 128))], 6);
|
|
852
|
+
};
|
|
853
|
+
var Wi = Y("vue-draggable-area"), xe = { name: "DraggableArea", props: { movable: { type: Boolean, default: !0 }, activationDistance: { type: Number, default: 20 } }, computed: { classnames: function() {
|
|
854
|
+
return { default: Wi() };
|
|
855
|
+
} }, beforeMount: function() {
|
|
856
|
+
window.addEventListener("mouseup", this.onMouseUp, { passive: !1 }), window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), window.addEventListener("touchend", this.onTouchEnd, { passive: !1 });
|
|
857
|
+
}, beforeUnmount: function() {
|
|
858
|
+
window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
|
|
859
|
+
}, mounted: function() {
|
|
860
|
+
this.touches = [], this.touchStarted = !1;
|
|
861
|
+
}, methods: { onTouchStart: function(t) {
|
|
862
|
+
if (t.cancelable) {
|
|
863
|
+
var e = this.movable && t.touches.length === 1;
|
|
864
|
+
e && (this.touches = rt(t.touches)), (this.touchStarted || e) && (t.preventDefault(), t.stopPropagation());
|
|
865
|
+
}
|
|
866
|
+
}, onTouchEnd: function() {
|
|
867
|
+
this.touchStarted = !1, this.processEnd();
|
|
868
|
+
}, onTouchMove: function(t) {
|
|
869
|
+
this.touches.length >= 1 && (this.touchStarted ? (this.processMove(t, t.touches), t.preventDefault(), t.stopPropagation()) : ve({ x: this.touches[0].clientX, y: this.touches[0].clientY }, { x: t.touches[0].clientX, y: t.touches[0].clientY }) > this.activationDistance && (this.initAnchor({ clientX: t.touches[0].clientX, clientY: t.touches[0].clientY }), this.touchStarted = !0));
|
|
870
|
+
}, onMouseDown: function(t) {
|
|
871
|
+
if (this.movable && t.button === 0) {
|
|
872
|
+
var e = { fake: !0, clientX: t.clientX, clientY: t.clientY };
|
|
873
|
+
this.touches = [e], this.initAnchor(e), t.stopPropagation();
|
|
874
|
+
}
|
|
875
|
+
}, onMouseMove: function(t) {
|
|
876
|
+
this.touches.length && (this.processMove(t, [{ fake: !0, clientX: t.clientX, clientY: t.clientY }]), t.preventDefault && t.cancelable && t.preventDefault(), t.stopPropagation());
|
|
877
|
+
}, onMouseUp: function() {
|
|
878
|
+
this.processEnd();
|
|
879
|
+
}, initAnchor: function(t) {
|
|
880
|
+
var e = this.$refs.container.getBoundingClientRect(), i = e.left, o = e.top;
|
|
881
|
+
this.anchor = { x: t.clientX - i, y: t.clientY - o };
|
|
882
|
+
}, processMove: function(t, e) {
|
|
883
|
+
var i = rt(e);
|
|
884
|
+
if (this.touches.length) {
|
|
885
|
+
var o = this.$refs.container.getBoundingClientRect(), s = o.left, n = o.top;
|
|
886
|
+
this.touches.length === 1 && i.length === 1 && this.$emit("move", new Yt({ left: i[0].clientX - (s + this.anchor.x), top: i[0].clientY - (n + this.anchor.y) }));
|
|
887
|
+
}
|
|
888
|
+
}, processEnd: function() {
|
|
889
|
+
this.touches.length && this.$emit("move-end"), this.touches = [];
|
|
890
|
+
} }, emits: ["move", "move-end"] };
|
|
891
|
+
xe.render = function(t, e, i, o, s, n) {
|
|
892
|
+
return b(), R("div", { ref: "container", onTouchstart: e[1] || (e[1] = function() {
|
|
893
|
+
return n.onTouchStart && n.onTouchStart.apply(n, arguments);
|
|
894
|
+
}), onMousedown: e[2] || (e[2] = function() {
|
|
895
|
+
return n.onMouseDown && n.onMouseDown.apply(n, arguments);
|
|
896
|
+
}) }, [J(t.$slots, "default")], 544);
|
|
897
|
+
};
|
|
898
|
+
function It(t) {
|
|
899
|
+
var e, i;
|
|
900
|
+
return { rotate: t.rotate || 0, flip: { horizontal: ((e = t == null ? void 0 : t.flip) === null || e === void 0 ? void 0 : e.horizontal) || !1, vertical: ((i = t == null ? void 0 : t.flip) === null || i === void 0 ? void 0 : i.vertical) || !1 } };
|
|
901
|
+
}
|
|
902
|
+
function _i(t) {
|
|
903
|
+
return new Promise((function(e, i) {
|
|
904
|
+
try {
|
|
905
|
+
if (t) if (/^data:/i.test(t)) e((function(r) {
|
|
906
|
+
r = r.replace(/^data:([^;]+);base64,/gim, "");
|
|
907
|
+
for (var l = atob(r), c = l.length, u = new ArrayBuffer(c), d = new Uint8Array(u), m = 0; m < c; m++) d[m] = l.charCodeAt(m);
|
|
908
|
+
return u;
|
|
909
|
+
})(t));
|
|
910
|
+
else if (/^blob:/i.test(t)) {
|
|
911
|
+
var o = new FileReader();
|
|
912
|
+
o.onload = function(r) {
|
|
913
|
+
e(r.target.result);
|
|
914
|
+
}, n = t, a = function(r) {
|
|
915
|
+
o.readAsArrayBuffer(r);
|
|
916
|
+
}, (h = new XMLHttpRequest()).open("GET", n, !0), h.responseType = "blob", h.onload = function() {
|
|
917
|
+
this.status != 200 && this.status !== 0 || a(this.response);
|
|
918
|
+
}, h.send();
|
|
919
|
+
} else {
|
|
920
|
+
var s = new XMLHttpRequest();
|
|
921
|
+
s.onreadystatechange = function() {
|
|
922
|
+
s.readyState === 4 && (s.status === 200 || s.status === 0 ? e(s.response) : i("Warning: could not load an image to parse its orientation"), s = null);
|
|
923
|
+
}, s.onprogress = function() {
|
|
924
|
+
s.getResponseHeader("content-type") !== "image/jpeg" && s.abort();
|
|
925
|
+
}, s.withCredentials = !1, s.open("GET", t, !0), s.responseType = "arraybuffer", s.send(null);
|
|
926
|
+
}
|
|
927
|
+
else i("Error: the image is empty");
|
|
928
|
+
} catch (r) {
|
|
929
|
+
i(r);
|
|
930
|
+
}
|
|
931
|
+
var n, a, h;
|
|
932
|
+
}));
|
|
933
|
+
}
|
|
934
|
+
function Me(t) {
|
|
935
|
+
var e = t.rotate, i = t.flip, o = t.scaleX, s = t.scaleY, n = "";
|
|
936
|
+
return n += " rotate(" + e + "deg) ", n += " scaleX(" + o * (i.horizontal ? -1 : 1) + ") ", n += " scaleY(" + s * (i.vertical ? -1 : 1) + ") ";
|
|
937
|
+
}
|
|
938
|
+
function Di(t) {
|
|
939
|
+
try {
|
|
940
|
+
var e, i = new DataView(t), o = void 0, s = void 0, n = void 0, a = void 0;
|
|
941
|
+
if (i.getUint8(0) === 255 && i.getUint8(1) === 216) for (var h = i.byteLength, r = 2; r + 1 < h; ) {
|
|
942
|
+
if (i.getUint8(r) === 255 && i.getUint8(r + 1) === 225) {
|
|
943
|
+
n = r;
|
|
944
|
+
break;
|
|
945
|
+
}
|
|
946
|
+
r++;
|
|
947
|
+
}
|
|
948
|
+
if (n && (o = n + 10, (function(m, g, v) {
|
|
949
|
+
var M, H = "";
|
|
950
|
+
for (M = g, v += g; M < v; M++) H += String.fromCharCode(m.getUint8(M));
|
|
951
|
+
return H;
|
|
952
|
+
})(i, n + 4, 4) === "Exif")) {
|
|
953
|
+
var l = i.getUint16(o);
|
|
954
|
+
if (((s = l === 18761) || l === 19789) && i.getUint16(o + 2, s) === 42) {
|
|
955
|
+
var c = i.getUint32(o + 4, s);
|
|
956
|
+
c >= 8 && (a = o + c);
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
if (a) {
|
|
960
|
+
for (var u = i.getUint16(a, s), d = 0; d < u; d++)
|
|
961
|
+
if (r = a + 12 * d + 2, i.getUint16(r, s) === 274) {
|
|
962
|
+
r += 8, e = i.getUint16(r, s), i.setUint16(r, 1, s);
|
|
963
|
+
break;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
return e;
|
|
967
|
+
} catch {
|
|
968
|
+
return null;
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
function le(t, e) {
|
|
972
|
+
var i = e.getBoundingClientRect(), o = i.left, s = i.top, n = { left: 0, top: 0 }, a = 0;
|
|
973
|
+
return t.forEach((function(h) {
|
|
974
|
+
n.left += (h.clientX - o) / t.length, n.top += (h.clientY - s) / t.length;
|
|
975
|
+
})), t.forEach((function(h) {
|
|
976
|
+
a += ve({ x: n.left, y: n.top }, { x: h.clientX - o, y: h.clientY - s });
|
|
977
|
+
})), { centerMass: n, spread: a, count: t.length };
|
|
978
|
+
}
|
|
979
|
+
var Se = { props: { touchMove: { type: Boolean, required: !0 }, mouseMove: { type: Boolean, required: !0 }, touchResize: { type: Boolean, required: !0 }, wheelResize: { type: [Boolean, Object], required: !0 }, eventsFilter: { type: Function, required: !1 } }, beforeMount: function() {
|
|
980
|
+
window.addEventListener("mouseup", this.onMouseUp, { passive: !1 }), window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), window.addEventListener("touchend", this.onTouchEnd, { passive: !1 });
|
|
981
|
+
}, beforeUnmount: function() {
|
|
982
|
+
window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
|
|
983
|
+
}, created: function() {
|
|
984
|
+
this.transforming = !1, this.debouncedProcessEnd = Pt(this.processEnd), this.touches = [];
|
|
985
|
+
}, methods: { processMove: function(t, e) {
|
|
986
|
+
if (this.touches.length) {
|
|
987
|
+
if (this.touches.length === 1 && e.length === 1) this.$emit("move", new ft({ left: this.touches[0].clientX - e[0].clientX, top: this.touches[0].clientY - e[0].clientY }));
|
|
988
|
+
else if (this.touches.length > 1 && this.touchResize) {
|
|
989
|
+
var i = le(e, this.$refs.container), o = this.oldGeometricProperties;
|
|
990
|
+
o.count === i.count && o.count > 1 && this.$emit("resize", new ft({ left: o.centerMass.left - i.centerMass.left, top: o.centerMass.top - i.centerMass.top }, { factor: o.spread / i.spread, center: i.centerMass })), this.oldGeometricProperties = i;
|
|
991
|
+
}
|
|
992
|
+
this.touches = e;
|
|
993
|
+
}
|
|
994
|
+
}, processEnd: function() {
|
|
995
|
+
this.transforming && (this.transforming = !1, this.$emit("transform-end"));
|
|
996
|
+
}, processStart: function() {
|
|
997
|
+
this.transforming = !0, this.debouncedProcessEnd.clear();
|
|
998
|
+
}, processEvent: function(t) {
|
|
999
|
+
return this.eventsFilter ? this.eventsFilter(t, this.transforming) !== !1 : (t.preventDefault(), t.stopPropagation(), !0);
|
|
1000
|
+
}, onTouchStart: function(t) {
|
|
1001
|
+
if (t.cancelable && (this.touchMove || this.touchResize && t.touches.length > 1) && this.processEvent(t)) {
|
|
1002
|
+
var e = this.$refs.container, i = e.getBoundingClientRect(), o = i.left, s = i.top, n = i.bottom, a = i.right;
|
|
1003
|
+
this.touches = rt(t.touches).filter((function(h) {
|
|
1004
|
+
return h.clientX > o && h.clientX < a && h.clientY > s && h.clientY < n;
|
|
1005
|
+
})), this.oldGeometricProperties = le(this.touches, e);
|
|
1006
|
+
}
|
|
1007
|
+
}, onTouchEnd: function(t) {
|
|
1008
|
+
t.touches.length === 0 && (this.touches = [], this.processEnd());
|
|
1009
|
+
}, onTouchMove: function(t) {
|
|
1010
|
+
var e = this;
|
|
1011
|
+
if (this.touches.length) {
|
|
1012
|
+
var i = rt(t.touches).filter((function(o) {
|
|
1013
|
+
return !o.identifier || e.touches.find((function(s) {
|
|
1014
|
+
return s.identifier === o.identifier;
|
|
1015
|
+
}));
|
|
1016
|
+
}));
|
|
1017
|
+
this.processEvent(t) && (this.processMove(t, i), this.processStart());
|
|
1018
|
+
}
|
|
1019
|
+
}, onMouseDown: function(t) {
|
|
1020
|
+
if (this.mouseMove && "buttons" in t && t.buttons === 1 && this.processEvent(t)) {
|
|
1021
|
+
var e = { fake: !0, clientX: t.clientX, clientY: t.clientY };
|
|
1022
|
+
this.touches = [e], this.processStart();
|
|
1023
|
+
}
|
|
1024
|
+
}, onMouseMove: function(t) {
|
|
1025
|
+
this.touches.length && this.processEvent(t) && this.processMove(t, [{ clientX: t.clientX, clientY: t.clientY }]);
|
|
1026
|
+
}, onMouseUp: function() {
|
|
1027
|
+
this.touches = [], this.processEnd();
|
|
1028
|
+
}, onWheel: function(t) {
|
|
1029
|
+
if (this.wheelResize && this.processEvent(t)) {
|
|
1030
|
+
var e = this.$refs.container.getBoundingClientRect(), i = e.left, o = e.top, s = 1 + this.wheelResize.ratio * (a = t.deltaY || t.detail || t.wheelDelta, (h = +a) == 0 || ge(h) ? h : h > 0 ? 1 : -1), n = { left: t.clientX - i, top: t.clientY - o };
|
|
1031
|
+
this.$emit("resize", new ft({}, { factor: s, center: n })), this.touches.length || this.debouncedProcessEnd();
|
|
1032
|
+
}
|
|
1033
|
+
var a, h;
|
|
1034
|
+
} }, emits: ["resize", "move", "transform-end"] };
|
|
1035
|
+
Se.render = function(t, e, i, o, s, n) {
|
|
1036
|
+
return b(), R("div", { ref: "container", onTouchstart: e[1] || (e[1] = function() {
|
|
1037
|
+
return n.onTouchStart && n.onTouchStart.apply(n, arguments);
|
|
1038
|
+
}), onMousedown: e[2] || (e[2] = function() {
|
|
1039
|
+
return n.onMouseDown && n.onMouseDown.apply(n, arguments);
|
|
1040
|
+
}), onWheel: e[3] || (e[3] = function() {
|
|
1041
|
+
return n.onWheel && n.onWheel.apply(n, arguments);
|
|
1042
|
+
}) }, [J(t.$slots, "default")], 544);
|
|
1043
|
+
};
|
|
1044
|
+
var Bt = { components: { TransformableImage: Se }, props: { touchMove: { type: Boolean, required: !0 }, mouseMove: { type: Boolean, required: !0 }, touchResize: { type: Boolean, required: !0 }, wheelResize: { type: [Boolean, Object], required: !0 } }, emits: ["resize", "move"] };
|
|
1045
|
+
Bt.render = function(t, e, i, o, s, n) {
|
|
1046
|
+
var a = U("transformable-image");
|
|
1047
|
+
return b(), R(a, { "touch-move": i.touchMove, "touch-resize": i.touchResize, "mouse-move": i.mouseMove, "wheel-resize": i.wheelResize, onMove: e[1] || (e[1] = function(h) {
|
|
1048
|
+
return t.$emit("move", h);
|
|
1049
|
+
}), onResize: e[2] || (e[2] = function(h) {
|
|
1050
|
+
return t.$emit("resize", h);
|
|
1051
|
+
}) }, { default: I((function() {
|
|
1052
|
+
return [J(t.$slots, "default")];
|
|
1053
|
+
})), _: 3 }, 8, ["touch-move", "touch-resize", "mouse-move", "wheel-resize"]);
|
|
1054
|
+
};
|
|
1055
|
+
var Rt = Y("vue-preview"), Ee = { props: { coordinates: { type: Object }, transitions: { type: Object }, image: { type: Object, default: function() {
|
|
1056
|
+
return {};
|
|
1057
|
+
} }, imageClass: { type: String }, width: { type: Number }, height: { type: Number }, fill: { type: Boolean } }, data: function() {
|
|
1058
|
+
return { calculatedImageSize: { width: 0, height: 0 }, calculatedSize: { width: 0, height: 0 } };
|
|
1059
|
+
}, computed: { classes: function() {
|
|
1060
|
+
return { root: Rt({ fill: this.fill }), wrapper: Rt("wrapper"), imageWrapper: Rt("image-wrapper"), image: C(Rt("image"), this.imageClass) };
|
|
1061
|
+
}, style: function() {
|
|
1062
|
+
if (this.fill) return {};
|
|
1063
|
+
var t = {};
|
|
1064
|
+
return this.width && (t.width = "".concat(this.size.width, "px")), this.height && (t.height = "".concat(this.size.height, "px")), this.transitions && this.transitions.enabled && (t.transition = "".concat(this.transitions.time, "ms ").concat(this.transitions.timingFunction)), t;
|
|
1065
|
+
}, wrapperStyle: function() {
|
|
1066
|
+
var t = { width: "".concat(this.size.width, "px"), height: "".concat(this.size.height, "px"), left: "calc(50% - ".concat(this.size.width / 2, "px)"), top: "calc(50% - ".concat(this.size.height / 2, "px)") };
|
|
1067
|
+
return this.transitions && this.transitions.enabled && (t.transition = "".concat(this.transitions.time, "ms ").concat(this.transitions.timingFunction)), t;
|
|
1068
|
+
}, imageStyle: function() {
|
|
1069
|
+
if (this.coordinates && this.image) {
|
|
1070
|
+
var t = this.coordinates.width / this.size.width, e = w(w({ rotate: 0, flip: { horizontal: !1, vertical: !1 } }, this.image.transforms), {}, { scaleX: 1 / t, scaleY: 1 / t }), i = this.imageSize.width, o = this.imageSize.height, s = ze({ width: i, height: o }, e.rotate), n = { width: "".concat(i, "px"), height: "".concat(o, "px"), left: "0px", top: "0px" }, a = { rotate: { left: (i - s.width) * e.scaleX / 2, top: (o - s.height) * e.scaleY / 2 }, scale: { left: (1 - e.scaleX) * i / 2, top: (1 - e.scaleY) * o / 2 } };
|
|
1071
|
+
return n.transform = `translate(
|
|
1072
|
+
`.concat(-this.coordinates.left / t - a.rotate.left - a.scale.left, "px,").concat(-this.coordinates.top / t - a.rotate.top - a.scale.top, "px) ") + Me(e), this.transitions && this.transitions.enabled && (n.transition = "".concat(this.transitions.time, "ms ").concat(this.transitions.timingFunction)), n;
|
|
1073
|
+
}
|
|
1074
|
+
return {};
|
|
1075
|
+
}, size: function() {
|
|
1076
|
+
return { width: this.width || this.calculatedSize.width, height: this.height || this.calculatedSize.height };
|
|
1077
|
+
}, imageSize: function() {
|
|
1078
|
+
return { width: this.image.width || this.calculatedImageSize.width, height: this.image.height || this.calculatedImageSize.height };
|
|
1079
|
+
} }, watch: { image: function(t) {
|
|
1080
|
+
(t.width || t.height) && this.onChangeImage();
|
|
1081
|
+
} }, mounted: function() {
|
|
1082
|
+
var t = this;
|
|
1083
|
+
this.onChangeImage(), this.$refs.image.addEventListener("load", (function() {
|
|
1084
|
+
t.refreshImage();
|
|
1085
|
+
})), window.addEventListener("resize", this.refresh), window.addEventListener("orientationchange", this.refresh);
|
|
1086
|
+
}, unmounted: function() {
|
|
1087
|
+
window.removeEventListener("resize", this.refresh), window.removeEventListener("orientationchange", this.refresh);
|
|
1088
|
+
}, methods: { refreshImage: function() {
|
|
1089
|
+
var t = this.$refs.image;
|
|
1090
|
+
this.calculatedImageSize.height = t.naturalHeight, this.calculatedImageSize.width = t.naturalWidth;
|
|
1091
|
+
}, refresh: function() {
|
|
1092
|
+
var t = this.$refs.root;
|
|
1093
|
+
this.width || (this.calculatedSize.width = t.clientWidth), this.height || (this.calculatedSize.height = t.clientHeight);
|
|
1094
|
+
}, onChangeImage: function() {
|
|
1095
|
+
var t = this.$refs.image;
|
|
1096
|
+
t && t.complete && this.refreshImage(), this.refresh();
|
|
1097
|
+
} } };
|
|
1098
|
+
Ee.render = function(t, e, i, o, s, n) {
|
|
1099
|
+
return b(), R("div", { ref: "root", class: n.classes.root, style: n.style }, [z("div", { ref: "wrapper", class: n.classes.wrapper, style: n.wrapperStyle }, [ce(z("img", { ref: "image", src: i.image && i.image.src, class: n.classes.image, style: n.imageStyle }, null, 14, ["src"]), [[ue, i.image && i.image.src]])], 6)], 6);
|
|
1100
|
+
};
|
|
1101
|
+
var Ce = { components: { Preview: Ee }, inheritAttrs: !1 };
|
|
1102
|
+
Ce.render = function(t, e, i, o, s, n) {
|
|
1103
|
+
var a = U("preview");
|
|
1104
|
+
return b(), R(a, de(t.$attrs, { fill: !0 }), null, 16);
|
|
1105
|
+
};
|
|
1106
|
+
var Ht = Y("vue-rectangle-stencil"), Te = { name: "RectangleStencil", components: { StencilPreview: Ce, BoundingBox: Ae, DraggableArea: xe }, props: { image: { type: Object }, coordinates: { type: Object }, stencilCoordinates: { type: Object }, handlers: { type: Object }, handlersComponent: { type: [Object, String], default: function() {
|
|
1107
|
+
return Vt;
|
|
1108
|
+
} }, lines: { type: Object }, linesComponent: { type: [Object, String], default: function() {
|
|
1109
|
+
return Nt;
|
|
1110
|
+
} }, aspectRatio: { type: [Number, String] }, minAspectRatio: { type: [Number, String] }, maxAspectRatio: { type: [Number, String] }, movable: { type: Boolean, default: !0 }, resizable: { type: Boolean, default: !0 }, transitions: { type: Object }, movingClass: { type: String }, resizingClass: { type: String }, previewClass: { type: String }, boundingBoxClass: { type: String }, linesClasses: { type: Object, default: function() {
|
|
1111
|
+
return {};
|
|
1112
|
+
} }, linesWrappersClasses: { type: Object, default: function() {
|
|
1113
|
+
return {};
|
|
1114
|
+
} }, handlersClasses: { type: Object, default: function() {
|
|
1115
|
+
return {};
|
|
1116
|
+
} }, handlersWrappersClasses: { type: Object, default: function() {
|
|
1117
|
+
return {};
|
|
1118
|
+
} } }, data: function() {
|
|
1119
|
+
return { moving: !1, resizing: !1 };
|
|
1120
|
+
}, computed: { classes: function() {
|
|
1121
|
+
return { stencil: C(Ht({ movable: this.movable, moving: this.moving, resizing: this.resizing }), this.moving && this.movingClass, this.resizing && this.resizingClass), preview: C(Ht("preview"), this.previewClass), boundingBox: C(Ht("bounding-box"), this.boundingBoxClass) };
|
|
1122
|
+
}, style: function() {
|
|
1123
|
+
var t = this.stencilCoordinates, e = t.height, i = t.width, o = t.left, s = t.top, n = { width: "".concat(i, "px"), height: "".concat(e, "px"), transform: "translate(".concat(o, "px, ").concat(s, "px)") };
|
|
1124
|
+
return this.transitions && this.transitions.enabled && (n.transition = "".concat(this.transitions.time, "ms ").concat(this.transitions.timingFunction)), n;
|
|
1125
|
+
} }, methods: { onMove: function(t) {
|
|
1126
|
+
this.$emit("move", t), this.moving = !0;
|
|
1127
|
+
}, onMoveEnd: function() {
|
|
1128
|
+
this.$emit("move-end"), this.moving = !1;
|
|
1129
|
+
}, onResize: function(t) {
|
|
1130
|
+
this.$emit("resize", t), this.resizing = !0;
|
|
1131
|
+
}, onResizeEnd: function() {
|
|
1132
|
+
this.$emit("resize-end"), this.resizing = !1;
|
|
1133
|
+
}, aspectRatios: function() {
|
|
1134
|
+
return { minimum: this.aspectRatio || this.minAspectRatio, maximum: this.aspectRatio || this.maxAspectRatio };
|
|
1135
|
+
} }, emits: ["resize", "resize-end", "move", "move-end"] };
|
|
1136
|
+
Te.render = function(t, e, i, o, s, n) {
|
|
1137
|
+
var a = U("stencil-preview"), h = U("draggable-area"), r = U("bounding-box");
|
|
1138
|
+
return b(), R("div", { class: n.classes.stencil, style: n.style }, [z(r, { width: i.stencilCoordinates.width, height: i.stencilCoordinates.height, transitions: i.transitions, class: n.classes.boundingBox, handlers: i.handlers, "handlers-component": i.handlersComponent, "handlers-classes": i.handlersClasses, "handlers-wrappers-classes": i.handlersWrappersClasses, lines: i.lines, "lines-component": i.linesComponent, "lines-classes": i.linesClasses, "lines-wrappers-classes": i.linesWrappersClasses, resizable: i.resizable, onResize: n.onResize, onResizeEnd: n.onResizeEnd }, { default: I((function() {
|
|
1139
|
+
return [z(h, { movable: i.movable, onMove: n.onMove, onMoveEnd: n.onMoveEnd }, { default: I((function() {
|
|
1140
|
+
return [z(a, { image: i.image, coordinates: i.coordinates, width: i.stencilCoordinates.width, height: i.stencilCoordinates.height, class: n.classes.preview, transitions: i.transitions }, null, 8, ["image", "coordinates", "width", "height", "class", "transitions"])];
|
|
1141
|
+
})), _: 1 }, 8, ["movable", "onMove", "onMoveEnd"])];
|
|
1142
|
+
})), _: 1 }, 8, ["width", "height", "transitions", "class", "handlers", "handlers-component", "handlers-classes", "handlers-wrappers-classes", "lines", "lines-component", "lines-classes", "lines-wrappers-classes", "resizable", "onResize", "onResizeEnd"])], 6);
|
|
1143
|
+
};
|
|
1144
|
+
var Li = ["transitions"], Q = Y("vue-advanced-cropper"), We = { name: "Cropper", components: { BackgroundWrapper: Bt }, props: { src: { type: String, default: null }, stencilComponent: { type: [Object, String], default: function() {
|
|
1145
|
+
return Te;
|
|
1146
|
+
} }, backgroundWrapperComponent: { type: [Object, String], default: function() {
|
|
1147
|
+
return Bt;
|
|
1148
|
+
} }, stencilProps: { type: Object, default: function() {
|
|
1149
|
+
return {};
|
|
1150
|
+
} }, autoZoom: { type: Boolean, default: !1 }, imageClass: { type: String }, boundariesClass: { type: String }, backgroundClass: { type: String }, foregroundClass: { type: String }, minWidth: { type: [Number, String] }, minHeight: { type: [Number, String] }, maxWidth: { type: [Number, String] }, maxHeight: { type: [Number, String] }, debounce: { type: [Boolean, Number], default: 500 }, transitions: { type: Boolean, default: !0 }, checkOrientation: { type: Boolean, default: !0 }, canvas: { type: [Object, Boolean], default: !0 }, crossOrigin: { type: [Boolean, String], default: void 0 }, transitionTime: { type: Number, default: 300 }, imageRestriction: { type: String, default: "fit-area", validator: function(t) {
|
|
1151
|
+
return ui.indexOf(t) !== -1;
|
|
1152
|
+
} }, roundResult: { type: Boolean, default: !0 }, defaultSize: { type: [Function, Object] }, defaultPosition: { type: [Function, Object] }, defaultVisibleArea: { type: [Function, Object] }, defaultTransforms: { type: [Function, Object] }, defaultBoundaries: { type: [Function, String], validator: function(t) {
|
|
1153
|
+
return !(typeof t == "string" && t !== "fill" && t !== "fit");
|
|
1154
|
+
} }, priority: { type: String, default: "coordinates" }, stencilSize: { type: [Object, Function] }, resizeImage: { type: [Boolean, Object], default: !0 }, moveImage: { type: [Boolean, Object], default: !0 }, autoZoomAlgorithm: { type: Function }, resizeAlgorithm: { type: Function, default: function(t) {
|
|
1155
|
+
var e = t.event, i = t.coordinates, o = t.aspectRatio, s = t.positionRestrictions, n = t.sizeRestrictions, a = p(p({}, i), { right: i.left + i.width, bottom: i.top + i.height }), h = e.params || {}, r = p({}, e.directions), l = h.allowedDirections || { left: !0, right: !0, bottom: !0, top: !0 };
|
|
1156
|
+
n.widthFrozen && (r.left = 0, r.right = 0), n.heightFrozen && (r.top = 0, r.bottom = 0), q.forEach((function(et) {
|
|
1157
|
+
l[et] || (r[et] = 0);
|
|
1158
|
+
}));
|
|
1159
|
+
var c = N(a, r = he({ coordinates: a, directions: r, sizeRestrictions: n, positionRestrictions: s })).width, u = N(a, r).height, d = h.preserveRatio ? y(a) : Dt(c / u, o);
|
|
1160
|
+
if (d) {
|
|
1161
|
+
var m = h.respectDirection;
|
|
1162
|
+
if (m || (m = a.width >= a.height || d === 1 ? "width" : "height"), m === "width") {
|
|
1163
|
+
var g = c / d - a.height;
|
|
1164
|
+
if (l.top && l.bottom) {
|
|
1165
|
+
var v = r.top, M = r.bottom;
|
|
1166
|
+
r.bottom = zt(g, M, v), r.top = zt(g, v, M);
|
|
1167
|
+
} else l.bottom ? r.bottom = g : l.top ? r.top = g : l.right ? r.right = 0 : l.left && (r.left = 0);
|
|
1168
|
+
} else if (m === "height") {
|
|
1169
|
+
var H = a.width - u * d;
|
|
1170
|
+
if (l.left && l.right) {
|
|
1171
|
+
var tt = r.left, at = r.right;
|
|
1172
|
+
r.left = -zt(H, tt, at), r.right = -zt(H, at, tt);
|
|
1173
|
+
} else l.left ? r.left = -H : l.right ? r.right = -H : l.top ? r.top = 0 : l.bottom && (r.bottom = 0);
|
|
1174
|
+
}
|
|
1175
|
+
r = he({ directions: r, coordinates: a, sizeRestrictions: n, positionRestrictions: s, preserveRatio: !0, compensate: h.compensate });
|
|
1176
|
+
}
|
|
1177
|
+
return c = N(a, r).width, u = N(a, r).height, (d = h.preserveRatio ? y(a) : Dt(c / u, o)) && Math.abs(d - c / u) > 1e-3 && q.forEach((function(et) {
|
|
1178
|
+
l[et] || (r[et] = 0);
|
|
1179
|
+
})), kt({ event: new Yt({ left: -r.left, top: -r.top }), coordinates: { width: i.width + r.right + r.left, height: i.height + r.top + r.bottom, left: i.left, top: i.top }, positionRestrictions: s });
|
|
1180
|
+
} }, moveAlgorithm: { type: Function, default: kt }, initStretcher: { type: Function, default: function(t) {
|
|
1181
|
+
var e = t.stretcher, i = t.imageSize, o = y(i);
|
|
1182
|
+
e.style.width = i.width + "px", e.style.height = e.clientWidth / o + "px", e.style.width = e.clientWidth + "px";
|
|
1183
|
+
} }, fitCoordinates: { type: Function, default: function(t) {
|
|
1184
|
+
var e = t.visibleArea, i = t.coordinates, o = t.aspectRatio, s = t.sizeRestrictions, n = t.positionRestrictions, a = p(p({}, i), K({ width: i.width, height: i.height, aspectRatio: o, sizeRestrictions: { maxWidth: e.width, maxHeight: e.height, minHeight: Math.min(e.height, s.minHeight), minWidth: Math.min(e.width, s.minWidth) } }));
|
|
1185
|
+
return a = D(a = P(a, ct(_(i), _(a))), Ct(Z(e), n));
|
|
1186
|
+
} }, fitVisibleArea: { type: Function, default: function(t) {
|
|
1187
|
+
var e = t.visibleArea, i = t.boundaries, o = t.getAreaRestrictions, s = t.coordinates, n = p({}, e);
|
|
1188
|
+
n.height = n.width / y(i), n.top += (e.height - n.height) / 2, (s.height - n.height > 0 || s.width - n.width > 0) && (n = j(n, Math.max(s.height / n.height, s.width / n.width)));
|
|
1189
|
+
var a = St(dt(s, Z(n = j(n, Et(n, o({ visibleArea: n, type: "resize" }))))));
|
|
1190
|
+
return n.width < s.width && (a.left = 0), n.height < s.height && (a.top = 0), n = D(n = P(n, a), o({ visibleArea: n, type: "move" }));
|
|
1191
|
+
} }, areaRestrictionsAlgorithm: { type: Function, default: function(t) {
|
|
1192
|
+
var e = t.visibleArea, i = t.boundaries, o = t.imageSize, s = t.imageRestriction, n = t.type, a = {};
|
|
1193
|
+
return s === "fill-area" ? a = { left: 0, top: 0, right: o.width, bottom: o.height } : s === "fit-area" && (y(i) > y(o) ? (a = { top: 0, bottom: o.height }, e && n === "move" && (e.width > o.width ? (a.left = -(e.width - o.width) / 2, a.right = o.width - a.left) : (a.left = 0, a.right = o.width))) : (a = { left: 0, right: o.width }, e && n === "move" && (e.height > o.height ? (a.top = -(e.height - o.height) / 2, a.bottom = o.height - a.top) : (a.top = 0, a.bottom = o.height)))), a;
|
|
1194
|
+
} }, sizeRestrictionsAlgorithm: { type: Function, default: function(t) {
|
|
1195
|
+
return { minWidth: t.minWidth, minHeight: t.minHeight, maxWidth: t.maxWidth, maxHeight: t.maxHeight };
|
|
1196
|
+
} }, positionRestrictionsAlgorithm: { type: Function, default: function(t) {
|
|
1197
|
+
var e = t.imageSize, i = {};
|
|
1198
|
+
return t.imageRestriction !== "none" && (i = { left: 0, top: 0, right: e.width, bottom: e.height }), i;
|
|
1199
|
+
} } }, data: function() {
|
|
1200
|
+
return { transitionsActive: !1, imageLoaded: !1, imageAttributes: { width: null, height: null, crossOrigin: null, src: null }, defaultImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, appliedImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, boundaries: { width: 0, height: 0 }, visibleArea: null, coordinates: w({}, oe) };
|
|
1201
|
+
}, computed: { image: function() {
|
|
1202
|
+
return { src: this.imageAttributes.src, width: this.imageAttributes.width, height: this.imageAttributes.height, transforms: this.imageTransforms };
|
|
1203
|
+
}, imageTransforms: function() {
|
|
1204
|
+
return { rotate: this.appliedImageTransforms.rotate, flip: { horizontal: this.appliedImageTransforms.flip.horizontal, vertical: this.appliedImageTransforms.flip.vertical }, translateX: this.visibleArea ? this.visibleArea.left / this.coefficient : 0, translateY: this.visibleArea ? this.visibleArea.top / this.coefficient : 0, scaleX: 1 / this.coefficient, scaleY: 1 / this.coefficient };
|
|
1205
|
+
}, imageSize: function() {
|
|
1206
|
+
var t = (function(e) {
|
|
1207
|
+
return e * Math.PI / 180;
|
|
1208
|
+
})(this.imageTransforms.rotate);
|
|
1209
|
+
return { width: Math.abs(this.imageAttributes.width * Math.cos(t)) + Math.abs(this.imageAttributes.height * Math.sin(t)), height: Math.abs(this.imageAttributes.width * Math.sin(t)) + Math.abs(this.imageAttributes.height * Math.cos(t)) };
|
|
1210
|
+
}, initialized: function() {
|
|
1211
|
+
return !!(this.visibleArea && this.imageLoaded);
|
|
1212
|
+
}, settings: function() {
|
|
1213
|
+
var t = $t(this.resizeImage, { touch: !0, wheel: { ratio: 0.1 }, adjustStencil: !0 }, { touch: !1, wheel: !1, adjustStencil: !1 });
|
|
1214
|
+
return { moveImage: $t(this.moveImage, { touch: !0, mouse: !0 }, { touch: !1, mouse: !1 }), resizeImage: t };
|
|
1215
|
+
}, coefficient: function() {
|
|
1216
|
+
return this.visibleArea ? this.visibleArea.width / this.boundaries.width : 0;
|
|
1217
|
+
}, areaRestrictions: function() {
|
|
1218
|
+
return this.imageLoaded ? this.areaRestrictionsAlgorithm({ imageSize: this.imageSize, imageRestriction: this.imageRestriction, boundaries: this.boundaries }) : {};
|
|
1219
|
+
}, transitionsOptions: function() {
|
|
1220
|
+
return { enabled: this.transitionsActive, timingFunction: "ease-in-out", time: 350 };
|
|
1221
|
+
}, sizeRestrictions: function() {
|
|
1222
|
+
if (this.boundaries.width && this.boundaries.height && this.imageSize.width && this.imageSize.height) {
|
|
1223
|
+
var t = this.sizeRestrictionsAlgorithm({ imageSize: this.imageSize, minWidth: T(this.minWidth) ? 0 : wt(this.minWidth), minHeight: T(this.minHeight) ? 0 : wt(this.minHeight), maxWidth: T(this.maxWidth) ? 1 / 0 : wt(this.maxWidth), maxHeight: T(this.maxHeight) ? 1 / 0 : wt(this.maxHeight) });
|
|
1224
|
+
if (t = (function(o) {
|
|
1225
|
+
var s = o.areaRestrictions, n = o.sizeRestrictions, a = o.boundaries, h = o.positionRestrictions, r = p(p({}, n), { minWidth: n.minWidth !== void 0 ? n.minWidth : 0, minHeight: n.minHeight !== void 0 ? n.minHeight : 0, maxWidth: n.maxWidth !== void 0 ? n.maxWidth : 1 / 0, maxHeight: n.maxHeight !== void 0 ? n.maxHeight : 1 / 0 });
|
|
1226
|
+
h.left !== void 0 && h.right !== void 0 && (r.maxWidth = Math.min(r.maxWidth, h.right - h.left)), h.bottom !== void 0 && h.top !== void 0 && (r.maxHeight = Math.min(r.maxHeight, h.bottom - h.top));
|
|
1227
|
+
var l = jt(s), c = ye(a, l);
|
|
1228
|
+
return l.width < 1 / 0 && (!r.maxWidth || r.maxWidth > c.width) && (r.maxWidth = Math.min(r.maxWidth, c.width)), l.height < 1 / 0 && (!r.maxHeight || r.maxHeight > c.height) && (r.maxHeight = Math.min(r.maxHeight, c.height)), r.minWidth > r.maxWidth && (r.minWidth = r.maxWidth, r.widthFrozen = !0), r.minHeight > r.maxHeight && (r.minHeight = r.maxHeight, r.heightFrozen = !0), r;
|
|
1229
|
+
})({ sizeRestrictions: t, areaRestrictions: this.getAreaRestrictions({ visibleArea: this.visibleArea, type: "resize" }), imageSize: this.imageSize, boundaries: this.boundaries, positionRestrictions: this.positionRestrictions, imageRestriction: this.imageRestriction, visibleArea: this.visibleArea, stencilSize: this.getStencilSize() }), this.visibleArea && this.stencilSize) {
|
|
1230
|
+
var e = this.getStencilSize(), i = jt(this.getAreaRestrictions({ visibleArea: this.visibleArea, type: "resize" }));
|
|
1231
|
+
t.maxWidth = Math.min(t.maxWidth, i.width * e.width / this.boundaries.width), t.maxHeight = Math.min(t.maxHeight, i.height * e.height / this.boundaries.height), t.maxWidth < t.minWidth && (t.minWidth = t.maxWidth), t.maxHeight < t.minHeight && (t.minHeight = t.maxHeight);
|
|
1232
|
+
}
|
|
1233
|
+
return t;
|
|
1234
|
+
}
|
|
1235
|
+
return { minWidth: 0, minHeight: 0, maxWidth: 0, maxHeight: 0 };
|
|
1236
|
+
}, positionRestrictions: function() {
|
|
1237
|
+
return this.positionRestrictionsAlgorithm({ imageSize: this.imageSize, imageRestriction: this.imageRestriction });
|
|
1238
|
+
}, classes: function() {
|
|
1239
|
+
return { cropper: Q(), image: C(Q("image"), this.imageClass), stencil: Q("stencil"), boundaries: C(Q("boundaries"), this.boundariesClass), stretcher: C(Q("stretcher")), background: C(Q("background"), this.backgroundClass), foreground: C(Q("foreground"), this.foregroundClass), imageWrapper: C(Q("image-wrapper")), cropperWrapper: C(Q("cropper-wrapper")) };
|
|
1240
|
+
}, stencilCoordinates: function() {
|
|
1241
|
+
if (this.initialized) {
|
|
1242
|
+
var t = this.coordinates, e = t.width, i = t.height, o = t.left, s = t.top;
|
|
1243
|
+
return { width: e / this.coefficient, height: i / this.coefficient, left: (o - this.visibleArea.left) / this.coefficient, top: (s - this.visibleArea.top) / this.coefficient };
|
|
1244
|
+
}
|
|
1245
|
+
return this.defaultCoordinates();
|
|
1246
|
+
}, boundariesStyle: function() {
|
|
1247
|
+
var t = { width: this.boundaries.width ? "".concat(Math.round(this.boundaries.width), "px") : "auto", height: this.boundaries.height ? "".concat(Math.round(this.boundaries.height), "px") : "auto", transition: "opacity ".concat(this.transitionTime, "ms"), pointerEvents: this.imageLoaded ? "all" : "none" };
|
|
1248
|
+
return this.imageLoaded || (t.opacity = "0"), t;
|
|
1249
|
+
}, imageStyle: function() {
|
|
1250
|
+
var t = this.imageAttributes.width > this.imageAttributes.height ? { width: Math.min(1024, this.imageAttributes.width), height: Math.min(1024, this.imageAttributes.width) / (this.imageAttributes.width / this.imageAttributes.height) } : { height: Math.min(1024, this.imageAttributes.height), width: Math.min(1024, this.imageAttributes.height) * (this.imageAttributes.width / this.imageAttributes.height) }, e = { left: (t.width - this.imageSize.width) / (2 * this.coefficient), top: (t.height - this.imageSize.height) / (2 * this.coefficient) }, i = { left: (1 - 1 / this.coefficient) * t.width / 2, top: (1 - 1 / this.coefficient) * t.height / 2 }, o = w(w({}, this.imageTransforms), {}, { scaleX: this.imageTransforms.scaleX * (this.imageAttributes.width / t.width), scaleY: this.imageTransforms.scaleY * (this.imageAttributes.height / t.height) }), s = { width: "".concat(t.width, "px"), height: "".concat(t.height, "px"), left: "0px", top: "0px", transform: "translate(".concat(-e.left - i.left - this.imageTransforms.translateX, "px, ").concat(-e.top - i.top - this.imageTransforms.translateY, "px)") + Me(o) };
|
|
1251
|
+
return this.transitionsOptions.enabled && (s.transition = "".concat(this.transitionsOptions.time, "ms ").concat(this.transitionsOptions.timingFunction)), s;
|
|
1252
|
+
} }, watch: { src: function() {
|
|
1253
|
+
this.onChangeImage();
|
|
1254
|
+
}, stencilComponent: function() {
|
|
1255
|
+
var t = this;
|
|
1256
|
+
this.$nextTick((function() {
|
|
1257
|
+
t.resetCoordinates(), t.runAutoZoom("setCoordinates"), t.onChange();
|
|
1258
|
+
}));
|
|
1259
|
+
}, minWidth: function() {
|
|
1260
|
+
this.onPropsChange();
|
|
1261
|
+
}, maxWidth: function() {
|
|
1262
|
+
this.onPropsChange();
|
|
1263
|
+
}, minHeight: function() {
|
|
1264
|
+
this.onPropsChange();
|
|
1265
|
+
}, maxHeight: function() {
|
|
1266
|
+
this.onPropsChange();
|
|
1267
|
+
}, imageRestriction: function() {
|
|
1268
|
+
this.reset();
|
|
1269
|
+
}, stencilProps: function(t, e) {
|
|
1270
|
+
["aspectRatio", "minAspectRatio", "maxAspectRatio"].find((function(i) {
|
|
1271
|
+
return t[i] !== e[i];
|
|
1272
|
+
})) && this.$nextTick(this.onPropsChange);
|
|
1273
|
+
} }, created: function() {
|
|
1274
|
+
this.debouncedUpdate = Pt(this.update, this.debounce), this.debouncedDisableTransitions = Pt(this.disableTransitions, this.transitionsOptions.time), this.awaiting = !1;
|
|
1275
|
+
}, mounted: function() {
|
|
1276
|
+
this.$refs.image.addEventListener("load", this.onSuccessLoadImage), this.$refs.image.addEventListener("error", this.onFailLoadImage), this.onChangeImage(), window.addEventListener("resize", this.refresh), window.addEventListener("orientationchange", this.refresh);
|
|
1277
|
+
}, unmounted: function() {
|
|
1278
|
+
window.removeEventListener("resize", this.refresh), window.removeEventListener("orientationchange", this.refresh), this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.debouncedUpdate.clear(), this.debouncedDisableTransitions.clear();
|
|
1279
|
+
}, methods: { getResult: function() {
|
|
1280
|
+
var t = this.initialized ? this.prepareResult(w({}, this.coordinates)) : this.defaultCoordinates(), e = { rotate: this.imageTransforms.rotate % 360, flip: w({}, this.imageTransforms.flip) };
|
|
1281
|
+
if (this.src && this.imageLoaded) {
|
|
1282
|
+
var i = this;
|
|
1283
|
+
return { image: this.image, coordinates: t, visibleArea: this.visibleArea ? w({}, this.visibleArea) : null, imageTransforms: e, get canvas() {
|
|
1284
|
+
return i.canvas ? i.getCanvas() : void 0;
|
|
1285
|
+
} };
|
|
1286
|
+
}
|
|
1287
|
+
return { image: this.image, coordinates: t, visibleArea: this.visibleArea ? w({}, this.visibleArea) : null, canvas: void 0, imageTransforms: e };
|
|
1288
|
+
}, zoom: function(t, e) {
|
|
1289
|
+
var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o = i.transitions, s = o === void 0 || o;
|
|
1290
|
+
this.onManipulateImage(new ft({}, { factor: 1 / t, center: e }), { normalize: !1, transitions: s });
|
|
1291
|
+
}, move: function(t, e) {
|
|
1292
|
+
var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o = i.transitions, s = o === void 0 || o;
|
|
1293
|
+
this.onManipulateImage(new ft({ left: t || 0, top: e || 0 }), { normalize: !1, transitions: s });
|
|
1294
|
+
}, setCoordinates: function(t) {
|
|
1295
|
+
var e = this, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o = i.autoZoom, s = o === void 0 || o, n = i.transitions, a = n === void 0 || n;
|
|
1296
|
+
this.$nextTick((function() {
|
|
1297
|
+
e.imageLoaded ? (e.transitionsActive || (a && e.enableTransitions(), e.coordinates = e.applyTransform(t), s && e.runAutoZoom("setCoordinates"), a && e.debouncedDisableTransitions()), e.onChange()) : e.delayedTransforms = t;
|
|
1298
|
+
}));
|
|
1299
|
+
}, refresh: function() {
|
|
1300
|
+
var t = this, e = this.$refs.image;
|
|
1301
|
+
if (this.src && e) return this.initialized ? this.updateVisibleArea().then((function() {
|
|
1302
|
+
t.onChange();
|
|
1303
|
+
})) : this.resetVisibleArea().then((function() {
|
|
1304
|
+
t.onChange();
|
|
1305
|
+
}));
|
|
1306
|
+
}, reset: function() {
|
|
1307
|
+
var t = this;
|
|
1308
|
+
return this.resetVisibleArea().then((function() {
|
|
1309
|
+
t.onChange(!1);
|
|
1310
|
+
}));
|
|
1311
|
+
}, awaitRender: function(t) {
|
|
1312
|
+
var e = this;
|
|
1313
|
+
this.awaiting || (this.awaiting = !0, this.$nextTick((function() {
|
|
1314
|
+
t(), e.awaiting = !1;
|
|
1315
|
+
})));
|
|
1316
|
+
}, prepareResult: function(t) {
|
|
1317
|
+
return this.roundResult ? (function(e) {
|
|
1318
|
+
var i = e.coordinates, o = e.sizeRestrictions, s = e.positionRestrictions, n = { width: Math.round(i.width), height: Math.round(i.height), left: Math.round(i.left), top: Math.round(i.top) };
|
|
1319
|
+
return n.width > o.maxWidth ? n.width = Math.floor(i.width) : n.width < o.minWidth && (n.width = Math.ceil(i.width)), n.height > o.maxHeight ? n.height = Math.floor(i.height) : n.height < o.minHeight && (n.height = Math.ceil(i.height)), D(n, s);
|
|
1320
|
+
})(w(w({}, this.getPublicProperties()), {}, { positionRestrictions: yt(this.positionRestrictions, this.visibleArea), coordinates: t })) : t;
|
|
1321
|
+
}, processAutoZoom: function(t, e, i, o) {
|
|
1322
|
+
var s = this.autoZoomAlgorithm;
|
|
1323
|
+
s || (s = this.stencilSize ? fi : this.autoZoom ? pi : gi);
|
|
1324
|
+
var n = s({ event: { type: t, params: o }, visibleArea: e, coordinates: i, boundaries: this.boundaries, aspectRatio: this.getAspectRatio(), positionRestrictions: this.positionRestrictions, getAreaRestrictions: this.getAreaRestrictions, sizeRestrictions: this.sizeRestrictions, stencilSize: this.getStencilSize() });
|
|
1325
|
+
return w(w({}, n), {}, { changed: !se(n.visibleArea, e) || !se(n.coordinates, i) });
|
|
1326
|
+
}, runAutoZoom: function(t) {
|
|
1327
|
+
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = e.transitions, o = i !== void 0 && i, s = ni(e, Li), n = this.processAutoZoom(t, this.visibleArea, this.coordinates, s), a = n.visibleArea, h = n.coordinates, r = n.changed;
|
|
1328
|
+
o && r && this.enableTransitions(), this.visibleArea = a, this.coordinates = h, o && r && this.debouncedDisableTransitions();
|
|
1329
|
+
}, normalizeEvent: function(t) {
|
|
1330
|
+
return (function(e) {
|
|
1331
|
+
var i = e.event, o = e.visibleArea, s = e.coefficient;
|
|
1332
|
+
if (i.type === "manipulateImage") return p(p({}, i), { move: { left: i.move && i.move.left ? s * i.move.left : 0, top: i.move && i.move.top ? s * i.move.top : 0 }, scale: { factor: i.scale && i.scale.factor ? i.scale.factor : 1, center: i.scale && i.scale.center ? { left: i.scale.center.left * s + o.left, top: i.scale.center.top * s + o.top } : null } });
|
|
1333
|
+
if (i.type === "resize") {
|
|
1334
|
+
var n = p(p({}, i), { directions: p({}, i.directions) });
|
|
1335
|
+
return q.forEach((function(h) {
|
|
1336
|
+
n.directions[h] *= s;
|
|
1337
|
+
})), n;
|
|
1338
|
+
}
|
|
1339
|
+
if (i.type === "move") {
|
|
1340
|
+
var a = p(p({}, i), { directions: p({}, i.directions) });
|
|
1341
|
+
return ci.forEach((function(h) {
|
|
1342
|
+
a.directions[h] *= s;
|
|
1343
|
+
})), a;
|
|
1344
|
+
}
|
|
1345
|
+
return i;
|
|
1346
|
+
})(w(w({}, this.getPublicProperties()), {}, { event: t }));
|
|
1347
|
+
}, getCanvas: function() {
|
|
1348
|
+
if (this.$refs.canvas) {
|
|
1349
|
+
var t = this.$refs.canvas, e = this.$refs.image, i = this.imageTransforms.rotate !== 0 || this.imageTransforms.flip.horizontal || this.imageTransforms.flip.vertical ? (function(h, r, l) {
|
|
1350
|
+
var c = l.rotate, u = l.flip, d = { width: r.naturalWidth, height: r.naturalHeight }, m = ze(d, c), g = h.getContext("2d");
|
|
1351
|
+
h.height = m.height, h.width = m.width, g.save();
|
|
1352
|
+
var v = ot(_(p({ left: 0, top: 0 }, d)), c);
|
|
1353
|
+
return g.translate(-(v.left - m.width / 2), -(v.top - m.height / 2)), g.rotate(c * Math.PI / 180), g.translate(u.horizontal ? d.width : 0, u.vertical ? d.height : 0), g.scale(u.horizontal ? -1 : 1, u.vertical ? -1 : 1), g.drawImage(r, 0, 0, d.width, d.height), g.restore(), h;
|
|
1354
|
+
})(this.$refs.sourceCanvas, e, this.imageTransforms) : e, o = w({ minWidth: 0, minHeight: 0, maxWidth: 1 / 0, maxHeight: 1 / 0, maxArea: this.maxCanvasSize, imageSmoothingEnabled: !0, imageSmoothingQuality: "high", fillColor: "transparent" }, this.canvas), s = function(h) {
|
|
1355
|
+
return h.find((function(r) {
|
|
1356
|
+
return l = r, !Number.isNaN(parseFloat(l)) && isFinite(l);
|
|
1357
|
+
var l;
|
|
1358
|
+
}));
|
|
1359
|
+
}, n = K({ sizeRestrictions: { minWidth: s([o.width, o.minWidth]) || 0, minHeight: s([o.height, o.minHeight]) || 0, maxWidth: s([o.width, o.maxWidth]) || 1 / 0, maxHeight: s([o.height, o.maxHeight]) || 1 / 0 }, width: this.coordinates.width, height: this.coordinates.height, aspectRatio: { minimum: this.coordinates.width / this.coordinates.height, maximum: this.coordinates.width / this.coordinates.height } });
|
|
1360
|
+
if (o.maxArea && n.width * n.height > o.maxArea) {
|
|
1361
|
+
var a = Math.sqrt(o.maxArea / (n.width * n.height));
|
|
1362
|
+
n = { width: Math.round(a * n.width), height: Math.round(a * n.height) };
|
|
1363
|
+
}
|
|
1364
|
+
return (function(h, r, l, c, u) {
|
|
1365
|
+
h.width = c ? c.width : l.width, h.height = c ? c.height : l.height;
|
|
1366
|
+
var d = h.getContext("2d");
|
|
1367
|
+
d.clearRect(0, 0, h.width, h.height), u && (u.imageSmoothingEnabled && (d.imageSmoothingEnabled = u.imageSmoothingEnabled), u.imageSmoothingQuality && (d.imageSmoothingQuality = u.imageSmoothingQuality), u.fillColor && (d.fillStyle = u.fillColor, d.fillRect(0, 0, h.width, h.height), d.save()));
|
|
1368
|
+
var m = l.left < 0 ? -l.left : 0, g = l.top < 0 ? -l.top : 0;
|
|
1369
|
+
d.drawImage(r, l.left + m, l.top + g, l.width, l.height, m * (h.width / l.width), g * (h.height / l.height), h.width, h.height);
|
|
1370
|
+
})(t, i, this.coordinates, n, o), t;
|
|
1371
|
+
}
|
|
1372
|
+
}, update: function() {
|
|
1373
|
+
this.$emit("change", this.getResult());
|
|
1374
|
+
}, applyTransform: function(t) {
|
|
1375
|
+
var e = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], i = this.visibleArea && e ? di(this.sizeRestrictions, this.visibleArea) : this.sizeRestrictions, o = this.visibleArea && e ? yt(this.positionRestrictions, this.visibleArea) : this.positionRestrictions;
|
|
1376
|
+
return mi({ transform: t, coordinates: this.coordinates, imageSize: this.imageSize, sizeRestrictions: i, positionRestrictions: o, aspectRatio: this.getAspectRatio(), visibleArea: this.visibleArea });
|
|
1377
|
+
}, resetCoordinates: function() {
|
|
1378
|
+
var t = this;
|
|
1379
|
+
if (this.$refs.image) {
|
|
1380
|
+
this.$refs.cropper, this.$refs.image;
|
|
1381
|
+
var e = this.defaultSize;
|
|
1382
|
+
e || (e = this.stencilSize ? wi : bi);
|
|
1383
|
+
var i = this.sizeRestrictions;
|
|
1384
|
+
i.minWidth, i.minHeight, i.maxWidth, i.maxHeight;
|
|
1385
|
+
var o = lt(e) ? e({ boundaries: this.boundaries, imageSize: this.imageSize, aspectRatio: this.getAspectRatio(), sizeRestrictions: this.sizeRestrictions, stencilSize: this.getStencilSize(), visibleArea: this.visibleArea }) : e, s = this.defaultPosition || vi, n = [o, function(a) {
|
|
1386
|
+
var h = a.coordinates;
|
|
1387
|
+
return w({}, lt(s) ? s({ coordinates: h, imageSize: t.imageSize, visibleArea: t.visibleArea }) : t.defaultPosition);
|
|
1388
|
+
}];
|
|
1389
|
+
this.delayedTransforms && n.push.apply(n, rt(Array.isArray(this.delayedTransforms) ? this.delayedTransforms : [this.delayedTransforms])), this.coordinates = this.applyTransform(n, !0), this.delayedTransforms = null;
|
|
1390
|
+
}
|
|
1391
|
+
}, clearImage: function() {
|
|
1392
|
+
var t = this;
|
|
1393
|
+
this.imageLoaded = !1, setTimeout((function() {
|
|
1394
|
+
var e = t.$refs.stretcher;
|
|
1395
|
+
e && (e.style.height = "auto", e.style.width = "auto"), t.coordinates = t.defaultCoordinates(), t.boundaries = { width: 0, height: 0 };
|
|
1396
|
+
}), this.transitionTime);
|
|
1397
|
+
}, enableTransitions: function() {
|
|
1398
|
+
this.transitions && (this.transitionsActive = !0);
|
|
1399
|
+
}, disableTransitions: function() {
|
|
1400
|
+
this.transitionsActive = !1;
|
|
1401
|
+
}, updateBoundaries: function() {
|
|
1402
|
+
var t = this, e = this.$refs.stretcher, i = this.$refs.cropper;
|
|
1403
|
+
return this.initStretcher({ cropper: i, stretcher: e, imageSize: this.imageSize }), this.$nextTick().then((function() {
|
|
1404
|
+
var o = { cropper: i, imageSize: t.imageSize };
|
|
1405
|
+
if (lt(t.defaultBoundaries) ? t.boundaries = t.defaultBoundaries(o) : t.defaultBoundaries === "fit" ? t.boundaries = (function(s) {
|
|
1406
|
+
var n = s.cropper, a = s.imageSize, h = n.clientHeight, r = n.clientWidth, l = h, c = a.width * h / a.height;
|
|
1407
|
+
return c > r && (c = r, l = a.height * r / a.width), { width: c, height: l };
|
|
1408
|
+
})(o) : t.boundaries = (function(s) {
|
|
1409
|
+
var n = s.cropper;
|
|
1410
|
+
return { width: n.clientWidth, height: n.clientHeight };
|
|
1411
|
+
})(o), !t.boundaries.width || !t.boundaries.height) throw new Error("It's impossible to fit the cropper in the current container");
|
|
1412
|
+
}));
|
|
1413
|
+
}, resetVisibleArea: function() {
|
|
1414
|
+
var t = this;
|
|
1415
|
+
return this.appliedImageTransforms = w(w({}, this.defaultImageTransforms), {}, { flip: w({}, this.defaultImageTransforms.flip) }), this.updateBoundaries().then((function() {
|
|
1416
|
+
t.priority !== "visible-area" && (t.visibleArea = null, t.resetCoordinates());
|
|
1417
|
+
var e, i, o, s, n, a, h = t.defaultVisibleArea || yi;
|
|
1418
|
+
t.visibleArea = lt(h) ? h({ imageSize: t.imageSize, boundaries: t.boundaries, coordinates: t.priority !== "visible-area" ? t.coordinates : null, getAreaRestrictions: t.getAreaRestrictions, stencilSize: t.getStencilSize() }) : t.defaultVisibleArea, t.visibleArea = (e = { visibleArea: t.visibleArea, boundaries: t.boundaries, getAreaRestrictions: t.getAreaRestrictions }, i = e.visibleArea, o = e.boundaries, s = e.getAreaRestrictions, n = p({}, i), a = y(o), n.width / n.height !== a && (n.height = n.width / a), D(n, s({ visibleArea: n, type: "move" }))), t.priority === "visible-area" ? t.resetCoordinates() : t.coordinates = t.fitCoordinates({ visibleArea: t.visibleArea, coordinates: t.coordinates, aspectRatio: t.getAspectRatio(), positionRestrictions: t.positionRestrictions, sizeRestrictions: t.sizeRestrictions }), t.runAutoZoom("resetVisibleArea");
|
|
1419
|
+
})).catch((function() {
|
|
1420
|
+
t.visibleArea = null;
|
|
1421
|
+
}));
|
|
1422
|
+
}, updateVisibleArea: function() {
|
|
1423
|
+
var t = this;
|
|
1424
|
+
return this.updateBoundaries().then((function() {
|
|
1425
|
+
t.visibleArea = t.fitVisibleArea({ imageSize: t.imageSize, boundaries: t.boundaries, visibleArea: t.visibleArea, coordinates: t.coordinates, getAreaRestrictions: t.getAreaRestrictions }), t.coordinates = t.fitCoordinates({ visibleArea: t.visibleArea, coordinates: t.coordinates, aspectRatio: t.getAspectRatio(), positionRestrictions: t.positionRestrictions, sizeRestrictions: t.sizeRestrictions }), t.runAutoZoom("updateVisibleArea");
|
|
1426
|
+
})).catch((function() {
|
|
1427
|
+
t.visibleArea = null;
|
|
1428
|
+
}));
|
|
1429
|
+
}, onChange: function() {
|
|
1430
|
+
var t = !(arguments.length > 0 && arguments[0] !== void 0) || arguments[0];
|
|
1431
|
+
t && this.debounce ? this.debouncedUpdate() : this.update();
|
|
1432
|
+
}, onChangeImage: function() {
|
|
1433
|
+
var t, e = this;
|
|
1434
|
+
if (this.imageLoaded = !1, this.delayedTransforms = null, this.src) {
|
|
1435
|
+
if ((function(s) {
|
|
1436
|
+
if (ie(s)) return !1;
|
|
1437
|
+
var n = window.location, a = /(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(s) || [], h = { protocol: a[1] || "", host: a[2] || "", port: a[3] || "" }, r = function(l) {
|
|
1438
|
+
return l.port || ((l.protocol || n.protocol) === "http" ? 80 : 433);
|
|
1439
|
+
};
|
|
1440
|
+
return !(!h.protocol && !h.host && !h.port || h.protocol && h.protocol == n.protocol && h.host && h.host == n.host && h.host && r(h) == r(n));
|
|
1441
|
+
})(this.src)) {
|
|
1442
|
+
var i = T(this.crossOrigin) ? this.canvas : this.crossOrigin;
|
|
1443
|
+
i === !0 && (i = "anonymous"), this.imageAttributes.crossOrigin = i || null;
|
|
1444
|
+
}
|
|
1445
|
+
if (this.checkOrientation) {
|
|
1446
|
+
var o = (t = this.src, new Promise((function(s) {
|
|
1447
|
+
_i(t).then((function(n) {
|
|
1448
|
+
var a = Di(n);
|
|
1449
|
+
s(n ? { source: t, arrayBuffer: n, orientation: a } : { source: t, arrayBuffer: null, orientation: null });
|
|
1450
|
+
})).catch((function(n) {
|
|
1451
|
+
console.warn(n), s({ source: t, arrayBuffer: null, orientation: null });
|
|
1452
|
+
}));
|
|
1453
|
+
})));
|
|
1454
|
+
setTimeout((function() {
|
|
1455
|
+
o.then(e.onParseImage);
|
|
1456
|
+
}), this.transitionTime);
|
|
1457
|
+
} else setTimeout((function() {
|
|
1458
|
+
e.onParseImage({ source: e.src });
|
|
1459
|
+
}), this.transitionTime);
|
|
1460
|
+
} else this.clearImage();
|
|
1461
|
+
}, onFailLoadImage: function() {
|
|
1462
|
+
this.imageAttributes.src && (this.clearImage(), this.$emit("error"));
|
|
1463
|
+
}, onSuccessLoadImage: function() {
|
|
1464
|
+
var t = this, e = this.$refs.image;
|
|
1465
|
+
e && !this.imageLoaded && (this.imageAttributes.height = e.naturalHeight, this.imageAttributes.width = e.naturalWidth, this.imageLoaded = !0, this.resetVisibleArea().then((function() {
|
|
1466
|
+
t.$emit("ready"), t.onChange(!1);
|
|
1467
|
+
})));
|
|
1468
|
+
}, onParseImage: function(t) {
|
|
1469
|
+
var e = this, i = t.source, o = t.arrayBuffer, s = t.orientation;
|
|
1470
|
+
this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, o && s && s > 1 ? pe(i) || !ie(i) ? (this.imageAttributes.src = URL.createObjectURL(new Blob([o])), this.imageAttributes.revoke = !0) : this.imageAttributes.src = (function(n) {
|
|
1471
|
+
for (var a = [], h = new Uint8Array(n); h.length > 0; ) {
|
|
1472
|
+
var r = h.subarray(0, 8192);
|
|
1473
|
+
a.push(String.fromCharCode.apply(null, Array.from ? Array.from(r) : r.slice())), h = h.subarray(8192);
|
|
1474
|
+
}
|
|
1475
|
+
return "data:image/jpeg;base64," + btoa(a.join(""));
|
|
1476
|
+
})(o) : this.imageAttributes.src = i, lt(this.defaultTransforms) ? this.appliedImageTransforms = It(this.defaultTransforms()) : At(this.defaultTransforms) ? this.appliedImageTransforms = It(this.defaultTransforms) : this.appliedImageTransforms = (function(n) {
|
|
1477
|
+
var a = It({});
|
|
1478
|
+
if (n) switch (n) {
|
|
1479
|
+
case 2:
|
|
1480
|
+
a.flip.horizontal = !0;
|
|
1481
|
+
break;
|
|
1482
|
+
case 3:
|
|
1483
|
+
a.rotate = -180;
|
|
1484
|
+
break;
|
|
1485
|
+
case 4:
|
|
1486
|
+
a.flip.vertical = !0;
|
|
1487
|
+
break;
|
|
1488
|
+
case 5:
|
|
1489
|
+
a.rotate = 90, a.flip.vertical = !0;
|
|
1490
|
+
break;
|
|
1491
|
+
case 6:
|
|
1492
|
+
a.rotate = 90;
|
|
1493
|
+
break;
|
|
1494
|
+
case 7:
|
|
1495
|
+
a.rotate = 90, a.flip.horizontal = !0;
|
|
1496
|
+
break;
|
|
1497
|
+
case 8:
|
|
1498
|
+
a.rotate = -90;
|
|
1499
|
+
}
|
|
1500
|
+
return a;
|
|
1501
|
+
})(s), this.defaultImageTransforms = w(w({}, this.appliedImageTransforms), {}, { flip: w({}, this.appliedImageTransforms.flip) }), this.$nextTick((function() {
|
|
1502
|
+
var n = e.$refs.image;
|
|
1503
|
+
n && n.complete && ((function(a) {
|
|
1504
|
+
return !!a.naturalWidth;
|
|
1505
|
+
})(n) ? e.onSuccessLoadImage() : e.onFailLoadImage());
|
|
1506
|
+
}));
|
|
1507
|
+
}, onResizeEnd: function() {
|
|
1508
|
+
this.runAutoZoom("resize", { transitions: !0 });
|
|
1509
|
+
}, onMoveEnd: function() {
|
|
1510
|
+
this.runAutoZoom("move", { transitions: !0 });
|
|
1511
|
+
}, onMove: function(t) {
|
|
1512
|
+
var e = this;
|
|
1513
|
+
this.transitionsOptions.enabled || this.awaitRender((function() {
|
|
1514
|
+
e.coordinates = e.moveAlgorithm(w(w({}, e.getPublicProperties()), {}, { positionRestrictions: yt(e.positionRestrictions, e.visibleArea), coordinates: e.coordinates, event: e.normalizeEvent(t) })), e.onChange();
|
|
1515
|
+
}));
|
|
1516
|
+
}, onResize: function(t) {
|
|
1517
|
+
var e = this;
|
|
1518
|
+
this.transitionsOptions.enabled || this.stencilSize && !this.autoZoom || this.awaitRender((function() {
|
|
1519
|
+
var i = e.sizeRestrictions, o = Math.min(e.coordinates.width, e.coordinates.height, 20 * e.coefficient);
|
|
1520
|
+
e.coordinates = e.resizeAlgorithm(w(w({}, e.getPublicProperties()), {}, { positionRestrictions: yt(e.positionRestrictions, e.visibleArea), sizeRestrictions: { maxWidth: Math.min(i.maxWidth, e.visibleArea.width), maxHeight: Math.min(i.maxHeight, e.visibleArea.height), minWidth: Math.max(i.minWidth, o), minHeight: Math.max(i.minHeight, o) }, event: e.normalizeEvent(t) })), e.onChange(), e.ticking = !1;
|
|
1521
|
+
}));
|
|
1522
|
+
}, onManipulateImage: function(t) {
|
|
1523
|
+
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1524
|
+
if (!this.transitionsOptions.enabled) {
|
|
1525
|
+
var i = e.transitions, o = i !== void 0 && i, s = e.normalize, n = s === void 0 || s;
|
|
1526
|
+
o && this.enableTransitions();
|
|
1527
|
+
var a = zi(w(w({}, this.getPublicProperties()), {}, { event: n ? this.normalizeEvent(t) : t, getAreaRestrictions: this.getAreaRestrictions, imageRestriction: this.imageRestriction, adjustStencil: !this.stencilSize && this.settings.resizeImage.adjustStencil })), h = a.visibleArea, r = a.coordinates;
|
|
1528
|
+
this.visibleArea = h, this.coordinates = r, this.runAutoZoom("manipulateImage"), this.onChange(), o && this.debouncedDisableTransitions();
|
|
1529
|
+
}
|
|
1530
|
+
}, onPropsChange: function() {
|
|
1531
|
+
this.coordinates = this.applyTransform(this.coordinates, !0), this.onChange(!1);
|
|
1532
|
+
}, getAreaRestrictions: function() {
|
|
1533
|
+
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = t.visibleArea, i = t.type, o = i === void 0 ? "move" : i;
|
|
1534
|
+
return this.areaRestrictionsAlgorithm({ boundaries: this.boundaries, imageSize: this.imageSize, imageRestriction: this.imageRestriction, visibleArea: e, type: o });
|
|
1535
|
+
}, getAspectRatio: function(t) {
|
|
1536
|
+
var e, i, o = this.stencilProps, s = o.aspectRatio, n = o.minAspectRatio, a = o.maxAspectRatio;
|
|
1537
|
+
if (this.$refs.stencil && this.$refs.stencil.aspectRatios) {
|
|
1538
|
+
var h = this.$refs.stencil.aspectRatios();
|
|
1539
|
+
e = h.minimum, i = h.maximum;
|
|
1540
|
+
}
|
|
1541
|
+
if (T(e) && (e = T(s) ? n : s), T(i) && (i = T(s) ? a : s), !t && (T(e) || T(i))) {
|
|
1542
|
+
var r = this.getStencilSize(), l = r ? y(r) : null;
|
|
1543
|
+
T(e) && (e = ne(l) ? l : void 0), T(i) && (i = ne(l) ? l : void 0);
|
|
1544
|
+
}
|
|
1545
|
+
return { minimum: e, maximum: i };
|
|
1546
|
+
}, getStencilSize: function() {
|
|
1547
|
+
if (this.stencilSize) return t = { currentStencilSize: { width: this.stencilCoordinates.width, height: this.stencilCoordinates.height }, stencilSize: this.stencilSize, boundaries: this.boundaries, coefficient: this.coefficient, coordinates: this.coordinates, aspectRatio: this.getAspectRatio(!0) }, e = t.boundaries, i = t.stencilSize, o = t.aspectRatio, Dt(y(s = lt(i) ? i({ boundaries: e, aspectRatio: o }) : i), o) && (s = K({ sizeRestrictions: { maxWidth: e.width, maxHeight: e.height, minWidth: 0, minHeight: 0 }, width: s.width, height: s.height, aspectRatio: { minimum: o.minimum, maximum: o.maximum } })), (s.width > e.width || s.height > e.height) && (s = K({ sizeRestrictions: { maxWidth: e.width, maxHeight: e.height, minWidth: 0, minHeight: 0 }, width: s.width, height: s.height, aspectRatio: { minimum: y(s), maximum: y(s) } })), s;
|
|
1548
|
+
var t, e, i, o, s;
|
|
1549
|
+
}, getPublicProperties: function() {
|
|
1550
|
+
return { coefficient: this.coefficient, visibleArea: this.visibleArea, coordinates: this.coordinates, boundaries: this.boundaries, sizeRestrictions: this.sizeRestrictions, positionRestrictions: this.positionRestrictions, aspectRatio: this.getAspectRatio(), imageRestriction: this.imageRestriction };
|
|
1551
|
+
}, defaultCoordinates: function() {
|
|
1552
|
+
return w({}, oe);
|
|
1553
|
+
}, flip: function(t, e) {
|
|
1554
|
+
var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o = i.transitions, s = o === void 0 || o;
|
|
1555
|
+
if (!this.transitionsActive) {
|
|
1556
|
+
s && this.enableTransitions();
|
|
1557
|
+
var n = w({}, this.imageTransforms.flip), a = Ai({ flip: { horizontal: t ? !n.horizontal : n.horizontal, vertical: e ? !n.vertical : n.vertical }, previousFlip: n, rotate: this.imageTransforms.rotate, visibleArea: this.visibleArea, coordinates: this.coordinates, imageSize: this.imageSize, positionRestrictions: this.positionRestrictions, sizeRestrictions: this.sizeRestrictions, getAreaRestrictions: this.getAreaRestrictions, aspectRatio: this.getAspectRatio() }), h = a.visibleArea, r = a.coordinates;
|
|
1558
|
+
t && (this.appliedImageTransforms.flip.horizontal = !this.appliedImageTransforms.flip.horizontal), e && (this.appliedImageTransforms.flip.vertical = !this.appliedImageTransforms.flip.vertical), this.visibleArea = h, this.coordinates = r, this.onChange(), s && this.debouncedDisableTransitions();
|
|
1559
|
+
}
|
|
1560
|
+
}, rotate: function(t) {
|
|
1561
|
+
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = e.transitions, o = i === void 0 || i;
|
|
1562
|
+
if (!this.transitionsActive) {
|
|
1563
|
+
o && this.enableTransitions();
|
|
1564
|
+
var s = w({}, this.imageSize);
|
|
1565
|
+
this.appliedImageTransforms.rotate += t;
|
|
1566
|
+
var n = Ri({ visibleArea: this.visibleArea, coordinates: this.coordinates, previousImageSize: s, imageSize: this.imageSize, angle: t, positionRestrictions: this.positionRestrictions, sizeRestrictions: this.sizeRestrictions, getAreaRestrictions: this.getAreaRestrictions, aspectRatio: this.getAspectRatio() }), a = n.visibleArea, h = n.coordinates, r = this.processAutoZoom("rotateImage", a, h);
|
|
1567
|
+
a = r.visibleArea, h = r.coordinates, this.visibleArea = a, this.coordinates = h, this.onChange(), o && this.debouncedDisableTransitions();
|
|
1568
|
+
}
|
|
1569
|
+
} }, emits: ["change", "error", "ready"] }, Ii = { key: 0, ref: "canvas", style: { display: "none" } }, Hi = { key: 1, ref: "sourceCanvas", style: { display: "none" } };
|
|
1570
|
+
We.render = function(t, e, i, o, s, n) {
|
|
1571
|
+
return b(), R("div", { ref: "cropper", class: n.classes.cropper }, [z("div", { ref: "stretcher", class: n.classes.stretcher }, null, 2), z("div", { class: n.classes.boundaries, style: n.boundariesStyle }, [(b(), R(Mt(i.backgroundWrapperComponent), { class: n.classes.cropperWrapper, "wheel-resize": n.settings.resizeImage.wheel, "touch-resize": n.settings.resizeImage.touch, "touch-move": n.settings.moveImage.touch, "mouse-move": n.settings.moveImage.mouse, onMove: n.onManipulateImage, onResize: n.onManipulateImage }, { default: I((function() {
|
|
1572
|
+
return [z("div", { class: n.classes.background, style: n.boundariesStyle }, null, 6), z("div", { class: n.classes.imageWrapper }, [z("img", { ref: "image", crossorigin: s.imageAttributes.crossOrigin, src: s.imageAttributes.src, class: n.classes.image, style: n.imageStyle, onMousedown: e[1] || (e[1] = Ve((function() {
|
|
1573
|
+
}), ["prevent"])) }, null, 46, ["crossorigin", "src"])], 2), z("div", { class: n.classes.foreground, style: n.boundariesStyle }, null, 6), ce((b(), R(Mt(i.stencilComponent), de({ ref: "stencil", image: n.image, coordinates: s.coordinates, "stencil-coordinates": n.stencilCoordinates, transitions: n.transitionsOptions }, i.stencilProps, { onResize: n.onResize, onResizeEnd: n.onResizeEnd, onMove: n.onMove, onMoveEnd: n.onMoveEnd }), null, 16, ["image", "coordinates", "stencil-coordinates", "transitions", "onResize", "onResizeEnd", "onMove", "onMoveEnd"])), [[ue, s.imageLoaded]]), i.canvas ? (b(), R("canvas", Ii, null, 512)) : V("", !0), i.canvas ? (b(), R("canvas", Hi, null, 512)) : V("", !0)];
|
|
1574
|
+
})), _: 1 }, 8, ["class", "wheel-resize", "touch-resize", "touch-move", "mouse-move", "onMove", "onResize"]))], 6)], 2);
|
|
1575
|
+
};
|
|
1576
|
+
const Oi = { class: "range-slider relative flex h-[20px] items-center" }, Pi = ["aria-label", "disabled", "max", "min", "step", "value"], $i = /* @__PURE__ */ Ft({
|
|
1577
|
+
__name: "RangeSlider",
|
|
1578
|
+
props: {
|
|
1579
|
+
modelValue: {},
|
|
1580
|
+
min: { default: 0 },
|
|
1581
|
+
max: { default: 100 },
|
|
1582
|
+
step: { default: 1 },
|
|
1583
|
+
disabled: { type: Boolean, default: !1 },
|
|
1584
|
+
ariaLabel: { default: void 0 },
|
|
1585
|
+
formatValue: { type: Function, default: void 0 }
|
|
1586
|
+
},
|
|
1587
|
+
emits: ["update:modelValue"],
|
|
1588
|
+
setup(t, { emit: e }) {
|
|
1589
|
+
const i = t, o = e, s = L(!1), n = L(i.modelValue);
|
|
1590
|
+
Ne(
|
|
1591
|
+
() => i.modelValue,
|
|
1592
|
+
(c) => {
|
|
1593
|
+
s.value || (n.value = c);
|
|
1594
|
+
}
|
|
1595
|
+
);
|
|
1596
|
+
function a() {
|
|
1597
|
+
s.value = !1, n.value = i.modelValue;
|
|
1598
|
+
}
|
|
1599
|
+
const h = st(() => {
|
|
1600
|
+
const c = i.max - i.min;
|
|
1601
|
+
if (c <= 0) return 0;
|
|
1602
|
+
const u = (n.value - i.min) / c;
|
|
1603
|
+
return Math.min(100, Math.max(0, u * 100));
|
|
1604
|
+
}), r = st(() => {
|
|
1605
|
+
var c;
|
|
1606
|
+
return ((c = i.formatValue) == null ? void 0 : c.call(i, n.value)) ?? null;
|
|
1607
|
+
});
|
|
1608
|
+
function l(c) {
|
|
1609
|
+
const u = Number(c.target.value);
|
|
1610
|
+
Number.isNaN(u) || (n.value = u, o("update:modelValue", u));
|
|
1611
|
+
}
|
|
1612
|
+
return (c, u) => (b(), F("div", Oi, [
|
|
1613
|
+
s.value && r.value ? (b(), F("div", {
|
|
1614
|
+
key: 0,
|
|
1615
|
+
class: "range-slider__bubble fm-typo-en-body-sm-600",
|
|
1616
|
+
style: Jt({ left: `${h.value}%` })
|
|
1617
|
+
}, O(r.value), 5)) : V("", !0),
|
|
1618
|
+
S("input", {
|
|
1619
|
+
"aria-label": c.ariaLabel,
|
|
1620
|
+
class: "range-slider__input",
|
|
1621
|
+
disabled: c.disabled,
|
|
1622
|
+
max: c.max,
|
|
1623
|
+
min: c.min,
|
|
1624
|
+
step: c.step,
|
|
1625
|
+
style: Jt({ "--fill": `${h.value}%` }),
|
|
1626
|
+
type: "range",
|
|
1627
|
+
value: n.value,
|
|
1628
|
+
onBlur: a,
|
|
1629
|
+
onInput: l,
|
|
1630
|
+
onPointercancel: a,
|
|
1631
|
+
onPointerdown: u[0] || (u[0] = (d) => s.value = !c.disabled),
|
|
1632
|
+
onPointerup: a
|
|
1633
|
+
}, null, 44, Pi)
|
|
1634
|
+
]));
|
|
1635
|
+
}
|
|
1636
|
+
}), ji = /* @__PURE__ */ Ke($i, [["__scopeId", "data-v-f1c4dbb8"]]), ki = { class: "flex flex-col gap-4" }, Bi = { class: "fm-typo-en-title-sm-600" }, Fi = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ui = { class: "space-y-16" }, Yi = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xi = { class: "relative h-[280px] w-full overflow-hidden rounded-md bg-fm-color-neutral-gray-100" }, Vi = {
|
|
1637
|
+
key: 0,
|
|
1638
|
+
class: "flex flex-wrap items-center gap-8"
|
|
1639
|
+
}, Ni = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary w-[44px] shrink-0" }, qi = { class: "fm-typo-en-body-md-600" }, Zi = {
|
|
1640
|
+
key: 1,
|
|
1641
|
+
class: "flex gap-8 rounded-md bg-fm-color-system-blue-100 p-12"
|
|
1642
|
+
}, Gi = { class: "flex flex-col gap-4" }, Qi = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-info" }, Ki = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-info" }, Ji = {
|
|
1643
|
+
key: 2,
|
|
1644
|
+
class: "flex items-center gap-12"
|
|
1645
|
+
}, tn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary w-[44px] shrink-0" }, en = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary w-[40px] shrink-0 text-right" }, nn = {
|
|
1646
|
+
key: 3,
|
|
1647
|
+
class: "flex gap-8 rounded-md bg-fm-color-system-orange-100 p-12"
|
|
1648
|
+
}, on = { class: "flex flex-col gap-4" }, sn = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-warning" }, rn = {
|
|
1649
|
+
key: 0,
|
|
1650
|
+
class: "fm-typo-en-body-sm-400 text-fm-color-typo-warning"
|
|
1651
|
+
}, an = {
|
|
1652
|
+
key: 4,
|
|
1653
|
+
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
1654
|
+
}, hn = { class: "flex w-full items-center justify-end gap-8" }, wn = /* @__PURE__ */ Ft({
|
|
1655
|
+
__name: "ProductImageEditorDialog",
|
|
1656
|
+
props: {
|
|
1657
|
+
file: { default: null },
|
|
1658
|
+
mode: { default: "upload" },
|
|
1659
|
+
editView: { default: null },
|
|
1660
|
+
ratioLabel: { default: null },
|
|
1661
|
+
aspectRatio: { default: null },
|
|
1662
|
+
hint: { default: null },
|
|
1663
|
+
index: { default: void 0 },
|
|
1664
|
+
total: { default: void 0 }
|
|
1665
|
+
},
|
|
1666
|
+
emits: ["cancel", "confirm"],
|
|
1667
|
+
setup(t, { emit: e }) {
|
|
1668
|
+
const i = t, o = e, { t: s, n } = Ze(), a = Ge(), h = [
|
|
1669
|
+
{
|
|
1670
|
+
id: "free",
|
|
1671
|
+
label: () => s("menu.product_image.editor.ratio_free"),
|
|
1672
|
+
ratio: null
|
|
1673
|
+
},
|
|
1674
|
+
{ id: "1x1", label: () => "1:1", ratio: 1 },
|
|
1675
|
+
{ id: "16x9", label: () => "16:9", ratio: 16 / 9 }
|
|
1676
|
+
], r = L(!0), l = L("free"), c = L(1), u = L(0), d = L(null), m = L(null), g = L(null), v = L(!1), M = L(null), H = L(1), tt = (f) => n(f, { style: "percent", maximumFractionDigits: 0 }), at = st(() => {
|
|
1677
|
+
const f = g.value, E = f ? Math.min(1, 2e3 / Math.max(f.width, f.height)) : 1;
|
|
1678
|
+
return s("menu.product_image.editor.output_edited", {
|
|
1679
|
+
dimensions: f ? s("menu.product_image.editor.dimensions", {
|
|
1680
|
+
width: n(Math.round(f.width * E), { useGrouping: !1 }),
|
|
1681
|
+
height: n(Math.round(f.height * E), { useGrouping: !1 })
|
|
1682
|
+
}) : s("menu.product_image.editor.unknown_dimensions"),
|
|
1683
|
+
format: s("menu.product_image.editor.jpeg")
|
|
1684
|
+
});
|
|
1685
|
+
}), et = st(() => {
|
|
1686
|
+
var E;
|
|
1687
|
+
const f = Pe.value ?? ((E = h.find((x) => x.id === l.value)) == null ? void 0 : E.ratio);
|
|
1688
|
+
return f ? { aspectRatio: f } : {};
|
|
1689
|
+
});
|
|
1690
|
+
function _e({
|
|
1691
|
+
imageSize: f,
|
|
1692
|
+
visibleArea: E
|
|
1693
|
+
}) {
|
|
1694
|
+
const x = E ?? f, W = et.value.aspectRatio;
|
|
1695
|
+
return W ? x.width / x.height > W ? { width: x.height * W, height: x.height } : { width: x.width, height: x.width / W } : x;
|
|
1696
|
+
}
|
|
1697
|
+
function De(f) {
|
|
1698
|
+
var E, x, W, ht, k;
|
|
1699
|
+
if (u.value = ((E = f.imageTransforms) == null ? void 0 : E.rotate) ?? 0, (x = f.image) != null && x.width && f.image.height && (m.value = {
|
|
1700
|
+
width: f.image.width,
|
|
1701
|
+
height: f.image.height
|
|
1702
|
+
}), (W = f.coordinates) != null && W.width && f.coordinates.height && (g.value = {
|
|
1703
|
+
width: Math.round(f.coordinates.width),
|
|
1704
|
+
height: Math.round(f.coordinates.height)
|
|
1705
|
+
}), (ht = f.image) != null && ht.width && ((k = f.visibleArea) != null && k.width)) {
|
|
1706
|
+
const mt = f.image.width / f.visibleArea.width;
|
|
1707
|
+
M.value ?? (M.value = mt), H.value = mt / M.value, c.value = Number(H.value.toFixed(2));
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
function Le(f) {
|
|
1711
|
+
!d.value || !M.value || (v.value = !0, d.value.zoom(f / H.value));
|
|
1712
|
+
}
|
|
1713
|
+
function Ie(f) {
|
|
1714
|
+
l.value = f, v.value = !0;
|
|
1715
|
+
}
|
|
1716
|
+
const vt = L(!1), He = Qe.join(","), it = L(i.file ?? null), X = L(
|
|
1717
|
+
it.value ? URL.createObjectURL(it.value) : null
|
|
1718
|
+
);
|
|
1719
|
+
function qt() {
|
|
1720
|
+
X.value && URL.revokeObjectURL(X.value), X.value = null;
|
|
1721
|
+
}
|
|
1722
|
+
qe(qt);
|
|
1723
|
+
function Oe(f) {
|
|
1724
|
+
qt(), m.value = null, g.value = null, Zt(), it.value = f, X.value = URL.createObjectURL(f);
|
|
1725
|
+
}
|
|
1726
|
+
const Pe = st(() => i.aspectRatio), $e = st(
|
|
1727
|
+
() => i.editView ? a(i.editView.title) : i.mode === "replace" ? s("menu.product_image.replace.title") : s("menu.product_image.editor.title")
|
|
1728
|
+
), je = st(() => i.hint ? i.hint : i.editView ? a(i.editView.subtitle) : i.mode === "replace" ? s("menu.product_image.replace.hint", {
|
|
1729
|
+
ratio: i.ratioLabel ?? ""
|
|
1730
|
+
}) : i.total && i.total > 1 ? s("menu.product_image.editor.subtitle_counter", {
|
|
1731
|
+
index: i.index ?? 1,
|
|
1732
|
+
total: i.total
|
|
1733
|
+
}) : s("menu.product_image.editor.subtitle_upload"));
|
|
1734
|
+
function ke() {
|
|
1735
|
+
o("cancel"), r.value = !1;
|
|
1736
|
+
}
|
|
1737
|
+
function Zt() {
|
|
1738
|
+
var f;
|
|
1739
|
+
l.value = "free", c.value = 1, u.value = 0, M.value = null, H.value = 1, (f = d.value) == null || f.reset(), v.value = !1;
|
|
1740
|
+
}
|
|
1741
|
+
function Be() {
|
|
1742
|
+
var f;
|
|
1743
|
+
v.value = !0, (f = d.value) == null || f.rotate(90);
|
|
1744
|
+
}
|
|
1745
|
+
async function Fe() {
|
|
1746
|
+
var mt, Gt, Qt;
|
|
1747
|
+
if (!X.value) return null;
|
|
1748
|
+
const f = new Image(), E = X.value;
|
|
1749
|
+
if (await new Promise((nt) => {
|
|
1750
|
+
f.onload = () => nt(), f.onerror = () => nt(), f.src = E;
|
|
1751
|
+
}), !f.naturalWidth || !f.naturalHeight) return null;
|
|
1752
|
+
const x = g.value, W = m.value, ht = !x || !W || u.value % 360 === 0 && x.width >= W.width - 1 && x.height >= W.height - 1;
|
|
1753
|
+
if (i.mode === "edit" && ht && ((mt = it.value) == null ? void 0 : mt.type) === "image/jpeg" && it.value.size <= 800 * 1024 && Math.max(f.naturalWidth, f.naturalHeight) <= 2e3)
|
|
1754
|
+
return {
|
|
1755
|
+
blob: it.value,
|
|
1756
|
+
width: f.naturalWidth,
|
|
1757
|
+
height: f.naturalHeight
|
|
1758
|
+
};
|
|
1759
|
+
let k;
|
|
1760
|
+
if (ht) {
|
|
1761
|
+
k = document.createElement("canvas");
|
|
1762
|
+
const nt = Math.min(
|
|
1763
|
+
1,
|
|
1764
|
+
2e3 / Math.max(f.naturalWidth, f.naturalHeight)
|
|
1765
|
+
);
|
|
1766
|
+
k.width = Math.max(1, Math.round(f.naturalWidth * nt)), k.height = Math.max(1, Math.round(f.naturalHeight * nt));
|
|
1767
|
+
const Tt = k.getContext("2d");
|
|
1768
|
+
if (!Tt) return null;
|
|
1769
|
+
Tt.imageSmoothingQuality = "high", Tt.drawImage(f, 0, 0, k.width, k.height);
|
|
1770
|
+
} else {
|
|
1771
|
+
const nt = (Qt = (Gt = d.value) == null ? void 0 : Gt.getResult()) == null ? void 0 : Qt.canvas;
|
|
1772
|
+
if (!nt) return null;
|
|
1773
|
+
k = nt;
|
|
1774
|
+
}
|
|
1775
|
+
return me(k);
|
|
1776
|
+
}
|
|
1777
|
+
async function Ue() {
|
|
1778
|
+
if (!vt.value) {
|
|
1779
|
+
vt.value = !0;
|
|
1780
|
+
try {
|
|
1781
|
+
if (!it.value) {
|
|
1782
|
+
o("confirm", null), r.value = !1;
|
|
1783
|
+
return;
|
|
1784
|
+
}
|
|
1785
|
+
const f = await Fe(), E = it.value.name.replace(/\.[^.]+$/, "") + ".jpg";
|
|
1786
|
+
if (!f) {
|
|
1787
|
+
o("confirm", null), r.value = !1;
|
|
1788
|
+
return;
|
|
1789
|
+
}
|
|
1790
|
+
o("confirm", { ...f, fileName: E }), r.value = !1;
|
|
1791
|
+
} finally {
|
|
1792
|
+
vt.value = !1;
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
return (f, E) => (b(), R(A(B).FmDialog, {
|
|
1797
|
+
modelValue: r.value,
|
|
1798
|
+
"onUpdate:modelValue": [
|
|
1799
|
+
E[0] || (E[0] = (x) => r.value = x),
|
|
1800
|
+
E[1] || (E[1] = (x) => !x && o("cancel"))
|
|
1801
|
+
]
|
|
1802
|
+
}, {
|
|
1803
|
+
"dialog-header": I(() => [
|
|
1804
|
+
S("div", ki, [
|
|
1805
|
+
S("p", Bi, O($e.value), 1),
|
|
1806
|
+
S("p", Fi, O(je.value), 1)
|
|
1807
|
+
])
|
|
1808
|
+
]),
|
|
1809
|
+
"dialog-footer": I(() => [
|
|
1810
|
+
S("div", hn, [
|
|
1811
|
+
z(A(B).FmButton, {
|
|
1812
|
+
label: A(s)("menu.common.actions.cancel"),
|
|
1813
|
+
variant: "tertiary",
|
|
1814
|
+
onClick: ke
|
|
1815
|
+
}, null, 8, ["label"]),
|
|
1816
|
+
z(A(B).FmButton, {
|
|
1817
|
+
disabled: vt.value,
|
|
1818
|
+
label: i.editView ? A(a)(i.editView.confirmLabel) : A(s)("menu.common.actions.confirm"),
|
|
1819
|
+
variant: "primary",
|
|
1820
|
+
onClick: Ue
|
|
1821
|
+
}, null, 8, ["disabled", "label"])
|
|
1822
|
+
])
|
|
1823
|
+
]),
|
|
1824
|
+
default: I(() => {
|
|
1825
|
+
var x;
|
|
1826
|
+
return [
|
|
1827
|
+
S("div", Ui, [
|
|
1828
|
+
X.value ? (b(), F(pt, { key: 1 }, [
|
|
1829
|
+
S("div", Xi, [
|
|
1830
|
+
z(A(We), {
|
|
1831
|
+
ref_key: "cropperRef",
|
|
1832
|
+
ref: d,
|
|
1833
|
+
canvas: { maxWidth: 4096, maxHeight: 4096 },
|
|
1834
|
+
class: "product-image-editor-preview h-full w-full",
|
|
1835
|
+
debounce: !1,
|
|
1836
|
+
"default-size": _e,
|
|
1837
|
+
src: X.value,
|
|
1838
|
+
"stencil-props": et.value,
|
|
1839
|
+
transitions: !1,
|
|
1840
|
+
onChange: De
|
|
1841
|
+
}, null, 8, ["src", "stencil-props"])
|
|
1842
|
+
]),
|
|
1843
|
+
i.ratioLabel ? V("", !0) : (b(), F("div", Vi, [
|
|
1844
|
+
S("p", Ni, O(A(s)("menu.product_image.editor.ratio")), 1),
|
|
1845
|
+
(b(), F(pt, null, xt(h, (W) => z(A(B).FmButton, {
|
|
1846
|
+
key: W.id,
|
|
1847
|
+
label: W.label(),
|
|
1848
|
+
class: "!h-[26px] !rounded-md !px-8",
|
|
1849
|
+
"bg-color": l.value === W.id ? "primary-oats" : "neutral-gray-100",
|
|
1850
|
+
"text-color": "typo-primary",
|
|
1851
|
+
variant: "tertiary",
|
|
1852
|
+
onClick: (ht) => Ie(W.id)
|
|
1853
|
+
}, {
|
|
1854
|
+
default: I(() => [
|
|
1855
|
+
S("span", qi, O(W.label()), 1)
|
|
1856
|
+
]),
|
|
1857
|
+
_: 2
|
|
1858
|
+
}, 1032, ["label", "bg-color", "onClick"])), 64))
|
|
1859
|
+
])),
|
|
1860
|
+
i.mode === "replace" ? (b(), F("div", Zi, [
|
|
1861
|
+
z(A(B).FmIcon, {
|
|
1862
|
+
class: "shrink-0",
|
|
1863
|
+
color: "system-blue-400",
|
|
1864
|
+
name: "info",
|
|
1865
|
+
outline: "",
|
|
1866
|
+
size: "sm"
|
|
1867
|
+
}),
|
|
1868
|
+
S("div", Gi, [
|
|
1869
|
+
S("p", Qi, O(A(s)("menu.product_image.editor.replace_notice_title")), 1),
|
|
1870
|
+
S("p", Ki, O(A(s)("menu.product_image.editor.replace_notice_body", {
|
|
1871
|
+
ratio: i.ratioLabel ?? ""
|
|
1872
|
+
})), 1)
|
|
1873
|
+
])
|
|
1874
|
+
])) : V("", !0)
|
|
1875
|
+
], 64)) : (b(), R(A(B).FmDropField, {
|
|
1876
|
+
key: 0,
|
|
1877
|
+
accept: A(He),
|
|
1878
|
+
"content-class": "h-[280px] w-full",
|
|
1879
|
+
onFileUpload: Oe
|
|
1880
|
+
}, {
|
|
1881
|
+
"accept-text": I(() => [
|
|
1882
|
+
S("p", Yi, O(A(s)("menu.product_image.replace.accepts")), 1)
|
|
1883
|
+
]),
|
|
1884
|
+
_: 1
|
|
1885
|
+
}, 8, ["accept"])),
|
|
1886
|
+
X.value ? (b(), F("div", Ji, [
|
|
1887
|
+
S("p", tn, O(A(s)("menu.product_image.editor.zoom")), 1),
|
|
1888
|
+
z(A(B).FmIcon, {
|
|
1889
|
+
color: "neutral-gray-400",
|
|
1890
|
+
name: "zoom_out",
|
|
1891
|
+
outline: "",
|
|
1892
|
+
size: "sm"
|
|
1893
|
+
}),
|
|
1894
|
+
z(ji, {
|
|
1895
|
+
"model-value": c.value,
|
|
1896
|
+
"onUpdate:modelValue": Le,
|
|
1897
|
+
"aria-label": A(s)("menu.product_image.editor.zoom"),
|
|
1898
|
+
class: "product-image-editor-zoom flex-1",
|
|
1899
|
+
"format-value": tt,
|
|
1900
|
+
max: 4,
|
|
1901
|
+
min: 1,
|
|
1902
|
+
step: 0.01
|
|
1903
|
+
}, null, 8, ["model-value", "aria-label"]),
|
|
1904
|
+
z(A(B).FmIcon, {
|
|
1905
|
+
color: "neutral-gray-400",
|
|
1906
|
+
name: "zoom_in",
|
|
1907
|
+
outline: "",
|
|
1908
|
+
size: "sm"
|
|
1909
|
+
}),
|
|
1910
|
+
S("span", en, O(tt(c.value)), 1),
|
|
1911
|
+
z(A(B).FmButton, {
|
|
1912
|
+
"aria-label": A(s)("menu.product_image.editor.rotate"),
|
|
1913
|
+
icon: "rotate_right",
|
|
1914
|
+
variant: "tertiary",
|
|
1915
|
+
onClick: Be
|
|
1916
|
+
}, null, 8, ["aria-label"]),
|
|
1917
|
+
z(A(B).FmButton, {
|
|
1918
|
+
"aria-label": A(s)("menu.product_image.editor.reset"),
|
|
1919
|
+
disabled: !v.value,
|
|
1920
|
+
icon: "restart_alt",
|
|
1921
|
+
variant: "tertiary",
|
|
1922
|
+
onClick: Zt
|
|
1923
|
+
}, null, 8, ["aria-label", "disabled"])
|
|
1924
|
+
])) : V("", !0),
|
|
1925
|
+
(x = i.editView) != null && x.noticeTitle ? (b(), F("div", nn, [
|
|
1926
|
+
z(A(B).FmIcon, {
|
|
1927
|
+
class: "shrink-0",
|
|
1928
|
+
color: "system-orange-400",
|
|
1929
|
+
name: "info",
|
|
1930
|
+
outline: "",
|
|
1931
|
+
size: "sm"
|
|
1932
|
+
}),
|
|
1933
|
+
S("div", on, [
|
|
1934
|
+
S("p", sn, O(A(a)(i.editView.noticeTitle)), 1),
|
|
1935
|
+
i.editView.noticeBody ? (b(), F("p", rn, O(A(a)(i.editView.noticeBody)), 1)) : V("", !0)
|
|
1936
|
+
])
|
|
1937
|
+
])) : V("", !0),
|
|
1938
|
+
X.value ? (b(), F("p", an, O(at.value), 1)) : V("", !0)
|
|
1939
|
+
])
|
|
1940
|
+
];
|
|
1941
|
+
}),
|
|
1942
|
+
_: 1
|
|
1943
|
+
}, 8, ["modelValue"]));
|
|
1944
|
+
}
|
|
1945
|
+
});
|
|
1946
|
+
export {
|
|
1947
|
+
fn as _,
|
|
1948
|
+
wn as a,
|
|
1949
|
+
pn as b,
|
|
1950
|
+
bn as c,
|
|
1951
|
+
vn as d,
|
|
1952
|
+
We as f,
|
|
1953
|
+
ii as r,
|
|
1954
|
+
gn as t
|
|
1955
|
+
};
|