@vendure/dashboard 3.7.1-master-202607140305 → 3.7.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.
Files changed (50) hide show
  1. package/dist/bundle/chunks/{2SSKDMRQ-V0WKsSRc.js → 2SSKDMRQ-CGPzX7ok.js} +2 -2
  2. package/dist/bundle/chunks/{AP7HFJJL-BBddTq2E.js → AP7HFJJL-BANaC6nc.js} +1 -1
  3. package/dist/bundle/chunks/{WDYDFRGG-D26K3Vrv.js → WDYDFRGG-DWwEqh2h.js} +2 -2
  4. package/dist/bundle/chunks/{locale-jQNDhpzW.js → locale--aauL66m.js} +1 -1
  5. package/dist/bundle/chunks/{main-B15rd9Eg.js → main-DVt3RsH7.js} +58 -919
  6. package/dist/bundle/chunks/{use-job-queue-polling-DeVrn1rW.js → use-job-queue-polling-mUjHlukj.js} +1328 -12522
  7. package/dist/bundle/lib.js +584 -577
  8. package/dist/bundle/main.js +4 -2
  9. package/dist/plugin/service/metrics.service.js +1 -1
  10. package/dist/vite/lib-externals.d.ts +44 -0
  11. package/dist/vite/lib-externals.js +80 -0
  12. package/dist/vite/vite-plugin-config.js +8 -0
  13. package/package.json +4 -3
  14. package/src/app/routes/_authenticated/_orders/components/edit-order-table.tsx +79 -44
  15. package/src/lib/components/layout/nav-main.tsx +3 -1
  16. package/src/lib/framework/document-introspection/add-custom-fields.ts +2 -2
  17. package/src/lib/framework/document-introspection/include-only-selected-list-fields.ts +4 -1
  18. package/src/lib/framework/extension-api/custom-providers.ts +1 -1
  19. package/dist/vite/.vendure-dashboard-temp/compiler/4341-310b0b9d-e6f1-423a-bc14-79424bdf705f/dev-config.js +0 -251
  20. package/dist/vite/.vendure-dashboard-temp/compiler/4341-310b0b9d-e6f1-423a-bc14-79424bdf705f/package.json +0 -4
  21. package/dist/vite/.vendure-dashboard-temp/compiler/4341-310b0b9d-e6f1-423a-bc14-79424bdf705f/test-plugins/nav-modifier-plugin/nav-modifier-plugin.js +0 -23
  22. package/dist/vite/.vendure-dashboard-temp/compiler/4341-310b0b9d-e6f1-423a-bc14-79424bdf705f/test-plugins/reviews/api/api-extensions.js +0 -99
  23. package/dist/vite/.vendure-dashboard-temp/compiler/4341-310b0b9d-e6f1-423a-bc14-79424bdf705f/test-plugins/reviews/api/product-entity.resolver.js +0 -73
  24. package/dist/vite/.vendure-dashboard-temp/compiler/4341-310b0b9d-e6f1-423a-bc14-79424bdf705f/test-plugins/reviews/api/product-review-admin.resolver.js +0 -146
  25. package/dist/vite/.vendure-dashboard-temp/compiler/4341-310b0b9d-e6f1-423a-bc14-79424bdf705f/test-plugins/reviews/api/product-review-entity.resolver.js +0 -79
  26. package/dist/vite/.vendure-dashboard-temp/compiler/4341-310b0b9d-e6f1-423a-bc14-79424bdf705f/test-plugins/reviews/api/product-review-shop.resolver.js +0 -79
  27. package/dist/vite/.vendure-dashboard-temp/compiler/4341-310b0b9d-e6f1-423a-bc14-79424bdf705f/test-plugins/reviews/entities/product-review-translation.entity.js +0 -47
  28. package/dist/vite/.vendure-dashboard-temp/compiler/4341-310b0b9d-e6f1-423a-bc14-79424bdf705f/test-plugins/reviews/entities/product-review.entity.js +0 -90
  29. package/dist/vite/.vendure-dashboard-temp/compiler/4341-310b0b9d-e6f1-423a-bc14-79424bdf705f/test-plugins/reviews/generated-admin-types.js +0 -1021
  30. package/dist/vite/.vendure-dashboard-temp/compiler/4341-310b0b9d-e6f1-423a-bc14-79424bdf705f/test-plugins/reviews/generated-shop-types.js +0 -974
  31. package/dist/vite/.vendure-dashboard-temp/compiler/4341-310b0b9d-e6f1-423a-bc14-79424bdf705f/test-plugins/reviews/reviews-plugin.js +0 -46
  32. package/dist/vite/.vendure-dashboard-temp/compiler/4341-310b0b9d-e6f1-423a-bc14-79424bdf705f/test-plugins/reviews/types.js +0 -2
  33. package/dist/vite/.vendure-dashboard-temp/gql-tada/4341-310b0b9d-e6f1-423a-bc14-79424bdf705f/schema.graphql +0 -6844
  34. package/dist/vite/.vendure-dashboard-temp/gql-tada/4341-310b0b9d-e6f1-423a-bc14-79424bdf705f/tsconfig.json +0 -10
  35. /package/dist/vite/.vendure-dashboard-temp/compiler/{3415-45ea35af-1ad9-41c6-bb49-f9b5df410aba → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/dev-config.js +0 -0
  36. /package/dist/vite/.vendure-dashboard-temp/compiler/{3415-45ea35af-1ad9-41c6-bb49-f9b5df410aba → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/package.json +0 -0
  37. /package/dist/vite/.vendure-dashboard-temp/compiler/{3415-45ea35af-1ad9-41c6-bb49-f9b5df410aba → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/nav-modifier-plugin/nav-modifier-plugin.js +0 -0
  38. /package/dist/vite/.vendure-dashboard-temp/compiler/{3415-45ea35af-1ad9-41c6-bb49-f9b5df410aba → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/api/api-extensions.js +0 -0
  39. /package/dist/vite/.vendure-dashboard-temp/compiler/{3415-45ea35af-1ad9-41c6-bb49-f9b5df410aba → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/api/product-entity.resolver.js +0 -0
  40. /package/dist/vite/.vendure-dashboard-temp/compiler/{3415-45ea35af-1ad9-41c6-bb49-f9b5df410aba → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/api/product-review-admin.resolver.js +0 -0
  41. /package/dist/vite/.vendure-dashboard-temp/compiler/{3415-45ea35af-1ad9-41c6-bb49-f9b5df410aba → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/api/product-review-entity.resolver.js +0 -0
  42. /package/dist/vite/.vendure-dashboard-temp/compiler/{3415-45ea35af-1ad9-41c6-bb49-f9b5df410aba → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/api/product-review-shop.resolver.js +0 -0
  43. /package/dist/vite/.vendure-dashboard-temp/compiler/{3415-45ea35af-1ad9-41c6-bb49-f9b5df410aba → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/entities/product-review-translation.entity.js +0 -0
  44. /package/dist/vite/.vendure-dashboard-temp/compiler/{3415-45ea35af-1ad9-41c6-bb49-f9b5df410aba → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/entities/product-review.entity.js +0 -0
  45. /package/dist/vite/.vendure-dashboard-temp/compiler/{3415-45ea35af-1ad9-41c6-bb49-f9b5df410aba → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/generated-admin-types.js +0 -0
  46. /package/dist/vite/.vendure-dashboard-temp/compiler/{3415-45ea35af-1ad9-41c6-bb49-f9b5df410aba → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/generated-shop-types.js +0 -0
  47. /package/dist/vite/.vendure-dashboard-temp/compiler/{3415-45ea35af-1ad9-41c6-bb49-f9b5df410aba → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/reviews-plugin.js +0 -0
  48. /package/dist/vite/.vendure-dashboard-temp/compiler/{3415-45ea35af-1ad9-41c6-bb49-f9b5df410aba → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/test-plugins/reviews/types.js +0 -0
  49. /package/dist/vite/.vendure-dashboard-temp/gql-tada/{3415-45ea35af-1ad9-41c6-bb49-f9b5df410aba → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/schema.graphql +0 -0
  50. /package/dist/vite/.vendure-dashboard-temp/gql-tada/{3415-45ea35af-1ad9-41c6-bb49-f9b5df410aba → 3313-17d5f23c-1ffd-4e86-b905-7235d2fbfa10}/tsconfig.json +0 -0
@@ -1,11 +1,15 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { c as createLucideIcon, nX as Subscribable, nY as Mutation, nZ as notifyManager, n_ as matchMutation, n$ as noop, o0 as hashQueryKeyByOptions, o1 as Query, o2 as matchQuery, o3 as focusManager, o4 as onlineManager, o5 as resolveStaleTime, o6 as functionalUpdate, o7 as infiniteQueryBehavior, o8 as hashKey, o9 as partialMatchKey, oa as skipToken, nQ as useRouter, ob as useStore, oc as usePrevious, od as trimPathRight, oe as useLayoutEffect, of as getLocationChangeInfo, og as batch$1, oh as handleHashScroll, oi as replaceEqualDeep, oj as rootRouteId, ok as SafeFragment, ol as matchContext, om as CatchBoundary, on as ErrorComponent, oo as warning, op as Match$1, oq as routerContext, or as useHydrated, os as deepEqual, ot as escapeHtml, nB as loadI18nMessages, nL as useQueryClient, nG as keepPreviousData, ou as QueryClientProvider, ov as UserSettingsProvider, ow as ThemeProvider, ox as AuthProvider, oy as ServerConfigProvider, oz as ChannelProvider, oA as AlertsProvider, l9 as CustomProviders, oB as createRootRouteWithContext, nO as Outlet, oC as createFileRoute, df as objectType, oD as redirect, du as stringType, mY as useAuth, nR as useRouterState, oE as Navigate, gz as LoginForm, hu as LoginBranding, eK as useNavigate, go as AppLayout, oF as endOfDay, oG as startOfMonth, bD as useUserSettings, nf as usePermissions, kB as getDashboardWidgetRegistry, eP as Page, eQ as PageTitle, eR as PageActionBar, mh as ActionBarItem, gm as DateRangePicker, dR as Button, eT as PageLayout, ms as FullWidthPageBlock, kE as WidgetFiltersProvider, j3 as GridLayout, kC as getDashboardWidget, ne as usePaginatedList, nJ as useMutation, mI as api, eN as toast, kZ as getMutationName, fE as DataTableBulkActionItem, oH as Trash, mQ as graphql, nK as useQuery, gj as useGeneratedColumns, fY as DataTable, h0 as CountrySelector, jx as Sheet, jE as SheetTrigger, jz as SheetContent, jC as SheetHeader, jD as SheetTitle, jA as SheetDescription, jq as ScrollArea, mA as ListPage, dS as Plus, nN as Link, h7 as DetailPageButton, e$ as BooleanDisplayBadge, dT as Badge, mV as setSettingsStoreValueDocument, oI as createColumnHelper, g$ as CopyableText, jZ as Switch$1, iI as Dialog, iQ as DialogTrigger, iK as DialogContent, iN as DialogHeader, iH as DialogTitle, iL as DialogDescription, f1 as JsonViewer, iM as DialogFooter, dQ as Input, na as useLocalFormat, bR as DropdownMenu, bS as DropdownMenuTrigger, bT as Ellipsis, bV as DropdownMenuContent, bW as DropdownMenuItem, oJ as Clock, oK as Check, oL as RefreshCw, oM as ChevronDown, oN as EllipsisVertical, gN as AssignToChannelBulkAction, mZ as useChannel, hw as RemoveFromChannelBulkAction, mM as configurableOperationFragment, nz as useForm, nt as LS_KEY_SHIPPING_TEST_ADDRESS, hV as AccordionItem, hW as AccordionTrigger, hU as AccordionContent, j2 as Form, eW as FormFieldWrapper, bF as Select, bG as SelectTrigger, bI as SelectValue, bJ as SelectContent, bK as SelectItem, nu as LS_KEY_SHIPPING_TEST_ORDER, oO as useReactTable, oP as getCoreRowModel, j_ as Table, k4 as TableHeader, k5 as TableRow, k3 as TableHead, oQ as flexRender, j$ as TableBody, k1 as TableCell, hv as ProductVariantSelector, hN as VendureImage, bZ as Trash2, f3 as Money, io as Card, it as CardHeader, iu as CardTitle, iq as CardContent, i7 as Alert, i8 as AlertDescription, hT as Accordion, hK as RichTextDescriptionCell, nw as SUPER_ADMIN_ROLE_CODE, no as CUSTOMER_ROLE_CODE, oR as Layers, gT as ChannelCodeLabel, hD as RoleCodeLabel, oS as getInitialConfigArgValue, gW as ConfigurableOperationInput, mK as getEntityDuplicatorsDocument, mJ as duplicateEntityDocument, oT as Copy, h9 as ErrorPage, kM as extendDetailFormQuery, kT as addCustomFields, mD as getDetailQueryOptions, eM as useDetailPage, eU as PageBlock, eV as DetailFormGrid, eY as CustomFieldsPageBlock, mL as assetFragment, hb as FacetValueSelector, ha as FacetValueChip, gP as usePriceFactor, fJ as FacetValueFacetedFilter, hG as StockLevelLabel, mP as errorResultFragment, mO as configurableOperationDefFragment, bC as useServerConfig, hH as CustomerCell, hI as OrderStateCell, hJ as OrderMoneyCell, eJ as NEW_ENTITY_PATH, hl as LanguageSelector, mS as schemaLanguageCodes, ff as NumberInput, hr as PaginatedListDataTable, hq as PaginatedListDataTableKey, h6 as CustomerSelector, nH as queryOptions, oU as useDebounce, oV as useQueries, bX as Folder, oW as Search, oX as ChevronRight, oY as getExpandedRowModel, fS as getItemParentId, fV as calculateDragTargetPosition, fU as isCircularReference, fW as calculateSiblingIndex, oZ as deleteAssetsDocument, cW as enumType, cP as coerce, gH as AssetGallery, mz as detailPageRouteLoader, hL as TaxCategorySelector, hS as ZoneSelector, kb as Textarea, gZ as ConfigurableOperationSelector, eX as TranslatableFormFieldWrapper, fu as RichTextInput, n8 as useGroupedPermissions, ki as TooltipProvider, kg as Tooltip, kj as TooltipTrigger, o_ as Info, kh as TooltipContent, gU as ChannelSelector, gY as ConfigurableOperationMultiSelector, fb as DateTimeInput, dU as X, cM as arrayType, dP as useFieldArray, nW as a, k6 as Tabs, k8 as TabsList, k9 as TabsTrigger, o$ as Link$1, k7 as TabsContent, iy as Command, iC as CommandInput, iE as CommandList, iA as CommandEmpty, iD as CommandItem, cO as booleanType, cl as ZodIssueCode, dq as recordType, nA as useWatch, C as Checkbox, nx as Controller, iU as Field, iX as FieldError, fe as MoneyInput, g_ as ConfirmationDialog, hY as AlertDialog, h$ as AlertDialogContent, i2 as AlertDialogHeader, hX as AlertDialogTitle, i0 as AlertDialogDescription, i1 as AlertDialogFooter, h_ as AlertDialogCancel, hZ as AlertDialogAction, hs as PermissionGuard, nd as usePage, fw as SlugInput, gR as AssignedFacetValues, gQ as AssignedChannels, h8 as EntityAssets, dX as Separator, h2 as CustomFieldsForm, iZ as FieldLabel, n2 as useDynamicTranslations, p0 as getTypeForState, bH as cn, nq as DEFAULT_CHANNEL_CODE, ft as createRelationSelectorConfig, fs as RelationSelector, j9 as Label, p1 as CircleAlert, m_ as useCustomFieldConfig, gn as LabeledData, iv as Collapsible, iw as CollapsibleTrigger, ix as CollapsibleContent, p2 as Globe, mg as HistoryEntry, p3 as SquarePen, hj as useHistoryNoteEditor, hh as HistoryTimelineWithGrouping, hg as HistoryNoteInput, he as HistoryNoteEditor, hf as HistoryNoteEntry, nI as useInfiniteQuery, jW as Skeleton, kV as getFieldsFromDocumentNode, fP as getColumnVisibility, p4 as Pencil, p5 as stateTypeToBadgeVariant, p6 as ChevronLeft, h3 as CustomerAddressForm$1, p7 as Users, h4 as CustomerGroupChip, h5 as CustomerGroupSelector, p8 as Eye, i9 as AlertTitle, n9 as useJobQueuePolling, hF as SellerSelector, h1 as CurrencySelector, p9 as updateTagDocument, pa as deleteTagDocument, pb as tagListDocument, pc as createTagDocument, ji as Popover, jn as PopoverTrigger, pd as ChevronsUpDown, jj as PopoverContent, iB as CommandGroup, pe as Settings2, pf as assetDetailDocument, pg as assetUpdateDocument, gF as AssetFocalPointEditor, gM as AssetProperties, gK as AssetPreviewSelector, ph as Focus, hE as RoleSelector, hn as MultiSelect, pi as useRedirectToListOnNotFound, fl as SingleRelationInput, lH as useGeneratedForm, de as numberType, f4 as AffixedInput, iJ as DialogClose, pj as createRouter, lu as useDashboardExtensions, kL as registerDefaults, lb as executeDashboardExtensionCallbacks, jX as Toaster, jY as Spinner, mE as useExtendedRouter, n0 as useDisplayLocale, nk as useUiLanguageLoader, kP as setCustomFieldsMap, iR as DirectionProvider, kQ as clearCustomFieldsMap } from "./use-job-queue-polling-DeVrn1rW.js";
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { c as createLucideIcon, nt as loadI18nMessages, nD as UserSettingsProvider, nE as ThemeProvider, nF as AuthProvider, nG as ServerConfigProvider, nH as ChannelProvider, nI as AlertsProvider, l5 as CustomProviders, df as objectType, du as stringType, mU as useAuth, gv as LoginForm, hq as LoginBranding, gk as AppLayout, nJ as endOfDay, nK as startOfMonth, bD as useUserSettings, nb as usePermissions, kx as getDashboardWidgetRegistry, eL as Page, eM as PageTitle, eN as PageActionBar, md as ActionBarItem, gi as DateRangePicker, dP as Button, eP as PageLayout, mo as FullWidthPageBlock, kA as WidgetFiltersProvider, i$ as GridLayout, ky as getDashboardWidget, na as usePaginatedList, mE as api, kV as getMutationName, fA as DataTableBulkActionItem, nL as Trash, mM as graphql, gf as useGeneratedColumns, fU as DataTable, gY as CountrySelector, jt as Sheet, jA as SheetTrigger, jv as SheetContent, jy as SheetHeader, jz as SheetTitle, jw as SheetDescription, jm as ScrollArea, mw as ListPage, dQ as Plus, h3 as DetailPageButton, eX as BooleanDisplayBadge, dR as Badge, mR as setSettingsStoreValueDocument, nM as createColumnHelper, gX as CopyableText, jV as Switch$1, iE as Dialog, iM as DialogTrigger, iG as DialogContent, iJ as DialogHeader, iD as DialogTitle, iH as DialogDescription, eZ as JsonViewer, iI as DialogFooter, dO as Input, n6 as useLocalFormat, bR as DropdownMenu, bS as DropdownMenuTrigger, bT as Ellipsis, bV as DropdownMenuContent, bW as DropdownMenuItem, nN as Clock, nO as Check, nP as RefreshCw, nQ as ChevronDown, nR as EllipsisVertical, gJ as AssignToChannelBulkAction, mV as useChannel, hs as RemoveFromChannelBulkAction, mI as configurableOperationFragment, np as LS_KEY_SHIPPING_TEST_ADDRESS, hR as AccordionItem, hS as AccordionTrigger, hQ as AccordionContent, i_ as Form, eS as FormFieldWrapper, bF as Select, bG as SelectTrigger, bI as SelectValue, bJ as SelectContent, bK as SelectItem, nq as LS_KEY_SHIPPING_TEST_ORDER, nS as useReactTable, nT as getCoreRowModel, jW as Table, k0 as TableHeader, k1 as TableRow, j$ as TableHead, nU as flexRender, jX as TableBody, jZ as TableCell, hr as ProductVariantSelector, hJ as VendureImage, bZ as Trash2, e$ as Money, ij as Card, ip as CardHeader, iq as CardTitle, il as CardContent, i3 as Alert, i4 as AlertDescription, hP as Accordion, hG as RichTextDescriptionCell, ns as SUPER_ADMIN_ROLE_CODE, nk as CUSTOMER_ROLE_CODE, nV as Layers, gP as ChannelCodeLabel, hz as RoleCodeLabel, mG as getEntityDuplicatorsDocument, nW as getInitialConfigArgValue, gS as ConfigurableOperationInput, mF as duplicateEntityDocument, nX as Copy, h5 as ErrorPage, kI as extendDetailFormQuery, kP as addCustomFields, mz as getDetailQueryOptions, eJ as useDetailPage, eQ as PageBlock, eR as DetailFormGrid, eU as CustomFieldsPageBlock, mH as assetFragment, h7 as FacetValueSelector, h6 as FacetValueChip, gL as usePriceFactor, fF as FacetValueFacetedFilter, hC as StockLevelLabel, mL as errorResultFragment, mK as configurableOperationDefFragment, bC as useServerConfig, hD as CustomerCell, hE as OrderStateCell, hF as OrderMoneyCell, eH as NEW_ENTITY_PATH, hh as LanguageSelector, mO as schemaLanguageCodes, fb as NumberInput, hn as PaginatedListDataTable, hm as PaginatedListDataTableKey, h2 as CustomerSelector, nY as useDebounce, bX as Folder, nZ as Search, n_ as ChevronRight, n$ as getExpandedRowModel, fO as getItemParentId, fR as calculateDragTargetPosition, fQ as isCircularReference, fS as calculateSiblingIndex, o0 as deleteAssetsDocument, cW as enumType, cP as coerce, gD as AssetGallery, mv as detailPageRouteLoader, hH as TaxCategorySelector, hO as ZoneSelector, k7 as Textarea, gV as ConfigurableOperationSelector, eT as TranslatableFormFieldWrapper, fq as RichTextInput, n4 as useGroupedPermissions, ke as TooltipProvider, kc as Tooltip, kf as TooltipTrigger, o1 as Info, kd as TooltipContent, gQ as ChannelSelector, gU as ConfigurableOperationMultiSelector, f7 as DateTimeInput, dS as X, cM as arrayType, nC as a, k2 as Tabs, k4 as TabsList, k5 as TabsTrigger, o2 as Link$1, k3 as TabsContent, iu as Command, iy as CommandInput, iA as CommandList, iw as CommandEmpty, iz as CommandItem, cO as booleanType, cl as ZodIssueCode, dq as recordType, C as Checkbox, iQ as Field, iT as FieldError, fa as MoneyInput, gW as ConfirmationDialog, hU as AlertDialog, hX as AlertDialogContent, h_ as AlertDialogHeader, hT as AlertDialogTitle, hY as AlertDialogDescription, hZ as AlertDialogFooter, hW as AlertDialogCancel, hV as AlertDialogAction, ho as PermissionGuard, n9 as usePage, fs as SlugInput, gN as AssignedFacetValues, gM as AssignedChannels, h4 as EntityAssets, dV as Separator, g_ as CustomFieldsForm, iV as FieldLabel, m_ as useDynamicTranslations, o3 as getTypeForState, bH as cn, nm as DEFAULT_CHANNEL_CODE, fp as createRelationSelectorConfig, fo as RelationSelector, j5 as Label, o4 as CircleAlert, mW as useCustomFieldConfig, gj as LabeledData, ir as Collapsible, is as CollapsibleTrigger, it as CollapsibleContent, o5 as Globe, mc as HistoryEntry, o6 as SquarePen, hf as useHistoryNoteEditor, hd as HistoryTimelineWithGrouping, hc as HistoryNoteInput, ha as HistoryNoteEditor, hb as HistoryNoteEntry, jS as Skeleton, kR as getFieldsFromDocumentNode, fL as getColumnVisibility, o7 as Pencil, o8 as stateTypeToBadgeVariant, o9 as ChevronLeft, g$ as CustomerAddressForm$1, oa as Users, h0 as CustomerGroupChip, h1 as CustomerGroupSelector, ob as Eye, i5 as AlertTitle, n5 as useJobQueuePolling, hB as SellerSelector, gZ as CurrencySelector, oc as tagListDocument, od as updateTagDocument, oe as deleteTagDocument, of as createTagDocument, je as Popover, jj as PopoverTrigger, og as ChevronsUpDown, jf as PopoverContent, ix as CommandGroup, oh as Settings2, oi as assetDetailDocument, oj as assetUpdateDocument, gB as AssetFocalPointEditor, gI as AssetProperties, gG as AssetPreviewSelector, ok as Focus, hA as RoleSelector, hj as MultiSelect, ol as useRedirectToListOnNotFound, fh as SingleRelationInput, lD as useGeneratedForm, de as numberType, f0 as AffixedInput, iF as DialogClose, jU as Spinner, lq as useDashboardExtensions, kH as registerDefaults, l7 as executeDashboardExtensionCallbacks, jT as Toaster, mA as useExtendedRouter, mY as useDisplayLocale, ng as useUiLanguageLoader, kL as setCustomFieldsMap, iN as DirectionProvider, kM as clearCustomFieldsMap } from "./use-job-queue-polling-mUjHlukj.js";
3
+ import { toast } from "sonner";
3
4
  import { i18n } from "@lingui/core";
4
5
  import { I18nProvider as I18nProvider$1, useLingui, Trans } from "@lingui/react";
6
+ import { useMatches, createRootRouteWithContext, HeadContent, Outlet, createFileRoute, redirect, useRouterState, Navigate, useNavigate, Link, useLocation, createRouter, RouterProvider } from "@tanstack/react-router";
5
7
  import * as React from "react";
6
- import React__default, { useRef, createElement as createElement$1, useState, useEffect, isValidElement, useMemo, useCallback, Fragment as Fragment$1, forwardRef, useImperativeHandle } from "react";
8
+ import React__default, { useState, useEffect, isValidElement, useRef, useMemo, useCallback, Fragment as Fragment$1, forwardRef, useImperativeHandle } from "react";
7
9
  import { createPortal } from "react-dom";
8
10
  import { createRoot as createRoot$1 } from "react-dom/client";
11
+ import { useQueryClient, onlineManager, QueryClient, keepPreviousData, QueryClientProvider, useMutation, useQuery, queryOptions, useQueries, useInfiniteQuery } from "@tanstack/react-query";
12
+ import { useForm, useFieldArray, useWatch, Controller } from "react-hook-form";
9
13
  import { uiConfig } from "virtual:vendure-ui-config";
10
14
  const __iconNode$B = [
11
15
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
@@ -332,896 +336,6 @@ const __iconNode = [
332
336
  ["rect", { width: "8", height: "8", x: "13", y: "13", rx: "2", key: "1cgmvn" }]
333
337
  ];
334
338
  const Workflow = createLucideIcon("Workflow", __iconNode);
335
- var MutationCache = class extends Subscribable {
336
- constructor(config = {}) {
337
- super();
338
- this.config = config;
339
- this.#mutations = /* @__PURE__ */ new Set();
340
- this.#scopes = /* @__PURE__ */ new Map();
341
- this.#mutationId = 0;
342
- }
343
- #mutations;
344
- #scopes;
345
- #mutationId;
346
- build(client, options, state) {
347
- const mutation = new Mutation({
348
- client,
349
- mutationCache: this,
350
- mutationId: ++this.#mutationId,
351
- options: client.defaultMutationOptions(options),
352
- state
353
- });
354
- this.add(mutation);
355
- return mutation;
356
- }
357
- add(mutation) {
358
- this.#mutations.add(mutation);
359
- const scope = scopeFor(mutation);
360
- if (typeof scope === "string") {
361
- const scopedMutations = this.#scopes.get(scope);
362
- if (scopedMutations) {
363
- scopedMutations.push(mutation);
364
- } else {
365
- this.#scopes.set(scope, [mutation]);
366
- }
367
- }
368
- this.notify({ type: "added", mutation });
369
- }
370
- remove(mutation) {
371
- if (this.#mutations.delete(mutation)) {
372
- const scope = scopeFor(mutation);
373
- if (typeof scope === "string") {
374
- const scopedMutations = this.#scopes.get(scope);
375
- if (scopedMutations) {
376
- if (scopedMutations.length > 1) {
377
- const index = scopedMutations.indexOf(mutation);
378
- if (index !== -1) {
379
- scopedMutations.splice(index, 1);
380
- }
381
- } else if (scopedMutations[0] === mutation) {
382
- this.#scopes.delete(scope);
383
- }
384
- }
385
- }
386
- }
387
- this.notify({ type: "removed", mutation });
388
- }
389
- canRun(mutation) {
390
- const scope = scopeFor(mutation);
391
- if (typeof scope === "string") {
392
- const mutationsWithSameScope = this.#scopes.get(scope);
393
- const firstPendingMutation = mutationsWithSameScope?.find(
394
- (m) => m.state.status === "pending"
395
- );
396
- return !firstPendingMutation || firstPendingMutation === mutation;
397
- } else {
398
- return true;
399
- }
400
- }
401
- runNext(mutation) {
402
- const scope = scopeFor(mutation);
403
- if (typeof scope === "string") {
404
- const foundMutation = this.#scopes.get(scope)?.find((m) => m !== mutation && m.state.isPaused);
405
- return foundMutation?.continue() ?? Promise.resolve();
406
- } else {
407
- return Promise.resolve();
408
- }
409
- }
410
- clear() {
411
- notifyManager.batch(() => {
412
- this.#mutations.forEach((mutation) => {
413
- this.notify({ type: "removed", mutation });
414
- });
415
- this.#mutations.clear();
416
- this.#scopes.clear();
417
- });
418
- }
419
- getAll() {
420
- return Array.from(this.#mutations);
421
- }
422
- find(filters) {
423
- const defaultedFilters = { exact: true, ...filters };
424
- return this.getAll().find(
425
- (mutation) => matchMutation(defaultedFilters, mutation)
426
- );
427
- }
428
- findAll(filters = {}) {
429
- return this.getAll().filter((mutation) => matchMutation(filters, mutation));
430
- }
431
- notify(event) {
432
- notifyManager.batch(() => {
433
- this.listeners.forEach((listener) => {
434
- listener(event);
435
- });
436
- });
437
- }
438
- resumePausedMutations() {
439
- const pausedMutations = this.getAll().filter((x) => x.state.isPaused);
440
- return notifyManager.batch(
441
- () => Promise.all(
442
- pausedMutations.map((mutation) => mutation.continue().catch(noop))
443
- )
444
- );
445
- }
446
- };
447
- function scopeFor(mutation) {
448
- return mutation.options.scope?.id;
449
- }
450
- var QueryCache = class extends Subscribable {
451
- constructor(config = {}) {
452
- super();
453
- this.config = config;
454
- this.#queries = /* @__PURE__ */ new Map();
455
- }
456
- #queries;
457
- build(client, options, state) {
458
- const queryKey = options.queryKey;
459
- const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options);
460
- let query = this.get(queryHash);
461
- if (!query) {
462
- query = new Query({
463
- client,
464
- queryKey,
465
- queryHash,
466
- options: client.defaultQueryOptions(options),
467
- state,
468
- defaultOptions: client.getQueryDefaults(queryKey)
469
- });
470
- this.add(query);
471
- }
472
- return query;
473
- }
474
- add(query) {
475
- if (!this.#queries.has(query.queryHash)) {
476
- this.#queries.set(query.queryHash, query);
477
- this.notify({
478
- type: "added",
479
- query
480
- });
481
- }
482
- }
483
- remove(query) {
484
- const queryInMap = this.#queries.get(query.queryHash);
485
- if (queryInMap) {
486
- query.destroy();
487
- if (queryInMap === query) {
488
- this.#queries.delete(query.queryHash);
489
- }
490
- this.notify({ type: "removed", query });
491
- }
492
- }
493
- clear() {
494
- notifyManager.batch(() => {
495
- this.getAll().forEach((query) => {
496
- this.remove(query);
497
- });
498
- });
499
- }
500
- get(queryHash) {
501
- return this.#queries.get(queryHash);
502
- }
503
- getAll() {
504
- return [...this.#queries.values()];
505
- }
506
- find(filters) {
507
- const defaultedFilters = { exact: true, ...filters };
508
- return this.getAll().find(
509
- (query) => matchQuery(defaultedFilters, query)
510
- );
511
- }
512
- findAll(filters = {}) {
513
- const queries = this.getAll();
514
- return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries;
515
- }
516
- notify(event) {
517
- notifyManager.batch(() => {
518
- this.listeners.forEach((listener) => {
519
- listener(event);
520
- });
521
- });
522
- }
523
- onFocus() {
524
- notifyManager.batch(() => {
525
- this.getAll().forEach((query) => {
526
- query.onFocus();
527
- });
528
- });
529
- }
530
- onOnline() {
531
- notifyManager.batch(() => {
532
- this.getAll().forEach((query) => {
533
- query.onOnline();
534
- });
535
- });
536
- }
537
- };
538
- var QueryClient = class {
539
- #queryCache;
540
- #mutationCache;
541
- #defaultOptions;
542
- #queryDefaults;
543
- #mutationDefaults;
544
- #mountCount;
545
- #unsubscribeFocus;
546
- #unsubscribeOnline;
547
- constructor(config = {}) {
548
- this.#queryCache = config.queryCache || new QueryCache();
549
- this.#mutationCache = config.mutationCache || new MutationCache();
550
- this.#defaultOptions = config.defaultOptions || {};
551
- this.#queryDefaults = /* @__PURE__ */ new Map();
552
- this.#mutationDefaults = /* @__PURE__ */ new Map();
553
- this.#mountCount = 0;
554
- }
555
- mount() {
556
- this.#mountCount++;
557
- if (this.#mountCount !== 1) return;
558
- this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {
559
- if (focused) {
560
- await this.resumePausedMutations();
561
- this.#queryCache.onFocus();
562
- }
563
- });
564
- this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {
565
- if (online) {
566
- await this.resumePausedMutations();
567
- this.#queryCache.onOnline();
568
- }
569
- });
570
- }
571
- unmount() {
572
- this.#mountCount--;
573
- if (this.#mountCount !== 0) return;
574
- this.#unsubscribeFocus?.();
575
- this.#unsubscribeFocus = void 0;
576
- this.#unsubscribeOnline?.();
577
- this.#unsubscribeOnline = void 0;
578
- }
579
- isFetching(filters) {
580
- return this.#queryCache.findAll({ ...filters, fetchStatus: "fetching" }).length;
581
- }
582
- isMutating(filters) {
583
- return this.#mutationCache.findAll({ ...filters, status: "pending" }).length;
584
- }
585
- /**
586
- * Imperative (non-reactive) way to retrieve data for a QueryKey.
587
- * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
588
- *
589
- * Hint: Do not use this function inside a component, because it won't receive updates.
590
- * Use `useQuery` to create a `QueryObserver` that subscribes to changes.
591
- */
592
- getQueryData(queryKey) {
593
- const options = this.defaultQueryOptions({ queryKey });
594
- return this.#queryCache.get(options.queryHash)?.state.data;
595
- }
596
- ensureQueryData(options) {
597
- const defaultedOptions = this.defaultQueryOptions(options);
598
- const query = this.#queryCache.build(this, defaultedOptions);
599
- const cachedData = query.state.data;
600
- if (cachedData === void 0) {
601
- return this.fetchQuery(options);
602
- }
603
- if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) {
604
- void this.prefetchQuery(defaultedOptions);
605
- }
606
- return Promise.resolve(cachedData);
607
- }
608
- getQueriesData(filters) {
609
- return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {
610
- const data = state.data;
611
- return [queryKey, data];
612
- });
613
- }
614
- setQueryData(queryKey, updater, options) {
615
- const defaultedOptions = this.defaultQueryOptions({ queryKey });
616
- const query = this.#queryCache.get(
617
- defaultedOptions.queryHash
618
- );
619
- const prevData = query?.state.data;
620
- const data = functionalUpdate(updater, prevData);
621
- if (data === void 0) {
622
- return void 0;
623
- }
624
- return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true });
625
- }
626
- setQueriesData(filters, updater, options) {
627
- return notifyManager.batch(
628
- () => this.#queryCache.findAll(filters).map(({ queryKey }) => [
629
- queryKey,
630
- this.setQueryData(queryKey, updater, options)
631
- ])
632
- );
633
- }
634
- getQueryState(queryKey) {
635
- const options = this.defaultQueryOptions({ queryKey });
636
- return this.#queryCache.get(
637
- options.queryHash
638
- )?.state;
639
- }
640
- removeQueries(filters) {
641
- const queryCache = this.#queryCache;
642
- notifyManager.batch(() => {
643
- queryCache.findAll(filters).forEach((query) => {
644
- queryCache.remove(query);
645
- });
646
- });
647
- }
648
- resetQueries(filters, options) {
649
- const queryCache = this.#queryCache;
650
- return notifyManager.batch(() => {
651
- queryCache.findAll(filters).forEach((query) => {
652
- query.reset();
653
- });
654
- return this.refetchQueries(
655
- {
656
- type: "active",
657
- ...filters
658
- },
659
- options
660
- );
661
- });
662
- }
663
- cancelQueries(filters, cancelOptions = {}) {
664
- const defaultedCancelOptions = { revert: true, ...cancelOptions };
665
- const promises = notifyManager.batch(
666
- () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions))
667
- );
668
- return Promise.all(promises).then(noop).catch(noop);
669
- }
670
- invalidateQueries(filters, options = {}) {
671
- return notifyManager.batch(() => {
672
- this.#queryCache.findAll(filters).forEach((query) => {
673
- query.invalidate();
674
- });
675
- if (filters?.refetchType === "none") {
676
- return Promise.resolve();
677
- }
678
- return this.refetchQueries(
679
- {
680
- ...filters,
681
- type: filters?.refetchType ?? filters?.type ?? "active"
682
- },
683
- options
684
- );
685
- });
686
- }
687
- refetchQueries(filters, options = {}) {
688
- const fetchOptions = {
689
- ...options,
690
- cancelRefetch: options.cancelRefetch ?? true
691
- };
692
- const promises = notifyManager.batch(
693
- () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => {
694
- let promise = query.fetch(void 0, fetchOptions);
695
- if (!fetchOptions.throwOnError) {
696
- promise = promise.catch(noop);
697
- }
698
- return query.state.fetchStatus === "paused" ? Promise.resolve() : promise;
699
- })
700
- );
701
- return Promise.all(promises).then(noop);
702
- }
703
- fetchQuery(options) {
704
- const defaultedOptions = this.defaultQueryOptions(options);
705
- if (defaultedOptions.retry === void 0) {
706
- defaultedOptions.retry = false;
707
- }
708
- const query = this.#queryCache.build(this, defaultedOptions);
709
- return query.isStaleByTime(
710
- resolveStaleTime(defaultedOptions.staleTime, query)
711
- ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);
712
- }
713
- prefetchQuery(options) {
714
- return this.fetchQuery(options).then(noop).catch(noop);
715
- }
716
- fetchInfiniteQuery(options) {
717
- options.behavior = infiniteQueryBehavior(options.pages);
718
- return this.fetchQuery(options);
719
- }
720
- prefetchInfiniteQuery(options) {
721
- return this.fetchInfiniteQuery(options).then(noop).catch(noop);
722
- }
723
- ensureInfiniteQueryData(options) {
724
- options.behavior = infiniteQueryBehavior(options.pages);
725
- return this.ensureQueryData(options);
726
- }
727
- resumePausedMutations() {
728
- if (onlineManager.isOnline()) {
729
- return this.#mutationCache.resumePausedMutations();
730
- }
731
- return Promise.resolve();
732
- }
733
- getQueryCache() {
734
- return this.#queryCache;
735
- }
736
- getMutationCache() {
737
- return this.#mutationCache;
738
- }
739
- getDefaultOptions() {
740
- return this.#defaultOptions;
741
- }
742
- setDefaultOptions(options) {
743
- this.#defaultOptions = options;
744
- }
745
- setQueryDefaults(queryKey, options) {
746
- this.#queryDefaults.set(hashKey(queryKey), {
747
- queryKey,
748
- defaultOptions: options
749
- });
750
- }
751
- getQueryDefaults(queryKey) {
752
- const defaults = [...this.#queryDefaults.values()];
753
- const result = {};
754
- defaults.forEach((queryDefault) => {
755
- if (partialMatchKey(queryKey, queryDefault.queryKey)) {
756
- Object.assign(result, queryDefault.defaultOptions);
757
- }
758
- });
759
- return result;
760
- }
761
- setMutationDefaults(mutationKey, options) {
762
- this.#mutationDefaults.set(hashKey(mutationKey), {
763
- mutationKey,
764
- defaultOptions: options
765
- });
766
- }
767
- getMutationDefaults(mutationKey) {
768
- const defaults = [...this.#mutationDefaults.values()];
769
- const result = {};
770
- defaults.forEach((queryDefault) => {
771
- if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {
772
- Object.assign(result, queryDefault.defaultOptions);
773
- }
774
- });
775
- return result;
776
- }
777
- defaultQueryOptions(options) {
778
- if (options._defaulted) {
779
- return options;
780
- }
781
- const defaultedOptions = {
782
- ...this.#defaultOptions.queries,
783
- ...this.getQueryDefaults(options.queryKey),
784
- ...options,
785
- _defaulted: true
786
- };
787
- if (!defaultedOptions.queryHash) {
788
- defaultedOptions.queryHash = hashQueryKeyByOptions(
789
- defaultedOptions.queryKey,
790
- defaultedOptions
791
- );
792
- }
793
- if (defaultedOptions.refetchOnReconnect === void 0) {
794
- defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always";
795
- }
796
- if (defaultedOptions.throwOnError === void 0) {
797
- defaultedOptions.throwOnError = !!defaultedOptions.suspense;
798
- }
799
- if (!defaultedOptions.networkMode && defaultedOptions.persister) {
800
- defaultedOptions.networkMode = "offlineFirst";
801
- }
802
- if (defaultedOptions.queryFn === skipToken) {
803
- defaultedOptions.enabled = false;
804
- }
805
- return defaultedOptions;
806
- }
807
- defaultMutationOptions(options) {
808
- if (options?._defaulted) {
809
- return options;
810
- }
811
- return {
812
- ...this.#defaultOptions.mutations,
813
- ...options?.mutationKey && this.getMutationDefaults(options.mutationKey),
814
- ...options,
815
- _defaulted: true
816
- };
817
- }
818
- clear() {
819
- this.#queryCache.clear();
820
- this.#mutationCache.clear();
821
- }
822
- };
823
- function Transitioner() {
824
- const router = useRouter();
825
- const mountLoadForRouter = React.useRef({
826
- router,
827
- mounted: false
828
- });
829
- const [isTransitioning, setIsTransitioning] = React.useState(false);
830
- const isLoading = useStore(router.stores.isLoading, (value) => value);
831
- const hasPendingMatches = useStore(router.stores.hasPendingMatches, (value) => value);
832
- const previousIsLoading = usePrevious(isLoading);
833
- const isAnyPending = isLoading || isTransitioning || hasPendingMatches;
834
- const previousIsAnyPending = usePrevious(isAnyPending);
835
- const isPagePending = isLoading || hasPendingMatches;
836
- const previousIsPagePending = usePrevious(isPagePending);
837
- router.startTransition = (fn) => {
838
- setIsTransitioning(true);
839
- React.startTransition(() => {
840
- fn();
841
- setIsTransitioning(false);
842
- });
843
- };
844
- React.useEffect(() => {
845
- const unsub = router.history.subscribe(router.load);
846
- const nextLocation = router.buildLocation({
847
- to: router.latestLocation.pathname,
848
- search: true,
849
- params: true,
850
- hash: true,
851
- state: true,
852
- _includeValidateSearch: true
853
- });
854
- if (trimPathRight(router.latestLocation.publicHref) !== trimPathRight(nextLocation.publicHref)) router.commitLocation({
855
- ...nextLocation,
856
- replace: true
857
- });
858
- return () => {
859
- unsub();
860
- };
861
- }, [router, router.history]);
862
- useLayoutEffect(() => {
863
- if (typeof window !== "undefined" && router.ssr || mountLoadForRouter.current.router === router && mountLoadForRouter.current.mounted) return;
864
- mountLoadForRouter.current = {
865
- router,
866
- mounted: true
867
- };
868
- const tryLoad = async () => {
869
- try {
870
- await router.load();
871
- } catch (err) {
872
- console.error(err);
873
- }
874
- };
875
- tryLoad();
876
- }, [router]);
877
- useLayoutEffect(() => {
878
- if (previousIsLoading && !isLoading) router.emit({
879
- type: "onLoad",
880
- ...getLocationChangeInfo(router.stores.location.state, router.stores.resolvedLocation.state)
881
- });
882
- }, [
883
- previousIsLoading,
884
- router,
885
- isLoading
886
- ]);
887
- useLayoutEffect(() => {
888
- if (previousIsPagePending && !isPagePending) router.emit({
889
- type: "onBeforeRouteMount",
890
- ...getLocationChangeInfo(router.stores.location.state, router.stores.resolvedLocation.state)
891
- });
892
- }, [
893
- isPagePending,
894
- previousIsPagePending,
895
- router
896
- ]);
897
- useLayoutEffect(() => {
898
- if (previousIsAnyPending && !isAnyPending) {
899
- const changeInfo = getLocationChangeInfo(router.stores.location.state, router.stores.resolvedLocation.state);
900
- router.emit({
901
- type: "onResolved",
902
- ...changeInfo
903
- });
904
- batch$1(() => {
905
- router.stores.status.setState(() => "idle");
906
- router.stores.resolvedLocation.setState(() => router.stores.location.state);
907
- });
908
- if (changeInfo.hrefChanged) handleHashScroll(router);
909
- }
910
- }, [
911
- isAnyPending,
912
- previousIsAnyPending,
913
- router
914
- ]);
915
- return null;
916
- }
917
- function Matches() {
918
- const router = useRouter();
919
- const PendingComponent = router.routesById[rootRouteId].options.pendingComponent ?? router.options.defaultPendingComponent;
920
- const pendingElement = PendingComponent ? /* @__PURE__ */ jsx(PendingComponent, {}) : null;
921
- const inner = /* @__PURE__ */ jsxs(typeof document !== "undefined" && router.ssr ? SafeFragment : React.Suspense, {
922
- fallback: pendingElement,
923
- children: [/* @__PURE__ */ jsx(Transitioner, {}), /* @__PURE__ */ jsx(MatchesInner, {})]
924
- });
925
- return router.options.InnerWrap ? /* @__PURE__ */ jsx(router.options.InnerWrap, { children: inner }) : inner;
926
- }
927
- function MatchesInner() {
928
- const router = useRouter();
929
- const matchId = useStore(router.stores.firstMatchId, (id) => id);
930
- const resetKey = useStore(router.stores.loadedAt, (loadedAt) => loadedAt);
931
- const matchComponent = matchId ? /* @__PURE__ */ jsx(Match$1, { matchId }) : null;
932
- return /* @__PURE__ */ jsx(matchContext.Provider, {
933
- value: matchId,
934
- children: router.options.disableGlobalCatchBoundary ? matchComponent : /* @__PURE__ */ jsx(CatchBoundary, {
935
- getResetKey: () => resetKey,
936
- errorComponent: ErrorComponent,
937
- onCatch: process.env.NODE_ENV !== "production" ? (error) => {
938
- warning(false, `The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`);
939
- warning(false, error.message || error.toString());
940
- } : void 0,
941
- children: matchComponent
942
- })
943
- });
944
- }
945
- function useMatches(opts) {
946
- const router = useRouter();
947
- const previousResult = React.useRef(void 0);
948
- return useStore(router.stores.activeMatchesSnapshot, (matches) => {
949
- const selected = matches;
950
- if (router.options.defaultStructuralSharing) {
951
- const shared = replaceEqualDeep(previousResult.current, selected);
952
- previousResult.current = shared;
953
- return shared;
954
- }
955
- return selected;
956
- });
957
- }
958
- function RouterContextProvider({ router, children: children2, ...rest }) {
959
- if (Object.keys(rest).length > 0) router.update({
960
- ...router.options,
961
- ...rest,
962
- context: {
963
- ...router.options.context,
964
- ...rest.context
965
- }
966
- });
967
- const provider = /* @__PURE__ */ jsx(routerContext.Provider, {
968
- value: router,
969
- children: children2
970
- });
971
- if (router.options.Wrap) return /* @__PURE__ */ jsx(router.options.Wrap, { children: provider });
972
- return provider;
973
- }
974
- function RouterProvider({ router, ...rest }) {
975
- return /* @__PURE__ */ jsx(RouterContextProvider, {
976
- router,
977
- ...rest,
978
- children: /* @__PURE__ */ jsx(Matches, {})
979
- });
980
- }
981
- function useLocation(opts) {
982
- const router = useRouter();
983
- const previousResult = useRef(void 0);
984
- return useStore(router.stores.location, (location) => {
985
- const selected = location;
986
- if (router.options.defaultStructuralSharing) {
987
- const shared = replaceEqualDeep(previousResult.current, selected);
988
- previousResult.current = shared;
989
- return shared;
990
- }
991
- return selected;
992
- });
993
- }
994
- function Asset({ tag, attrs, children: children2, nonce }) {
995
- switch (tag) {
996
- case "title":
997
- return /* @__PURE__ */ jsx("title", {
998
- ...attrs,
999
- suppressHydrationWarning: true,
1000
- children: children2
1001
- });
1002
- case "meta":
1003
- return /* @__PURE__ */ jsx("meta", {
1004
- ...attrs,
1005
- suppressHydrationWarning: true
1006
- });
1007
- case "link":
1008
- return /* @__PURE__ */ jsx("link", {
1009
- ...attrs,
1010
- nonce,
1011
- suppressHydrationWarning: true
1012
- });
1013
- case "style":
1014
- return /* @__PURE__ */ jsx("style", {
1015
- ...attrs,
1016
- dangerouslySetInnerHTML: { __html: children2 },
1017
- nonce
1018
- });
1019
- case "script":
1020
- return /* @__PURE__ */ jsx(Script, {
1021
- attrs,
1022
- children: children2
1023
- });
1024
- default:
1025
- return null;
1026
- }
1027
- }
1028
- function Script({ attrs, children: children2 }) {
1029
- useRouter();
1030
- const hydrated = useHydrated();
1031
- const dataScript = typeof attrs?.type === "string" && attrs.type !== "" && attrs.type !== "text/javascript" && attrs.type !== "module";
1032
- if (process.env.NODE_ENV !== "production" && attrs?.src && typeof children2 === "string" && children2.trim().length) console.warn("[TanStack Router] <Script> received both `src` and `children`. The `children` content will be ignored. Remove `children` or remove `src`.");
1033
- React.useEffect(() => {
1034
- if (dataScript) return;
1035
- if (attrs?.src) {
1036
- const normSrc = (() => {
1037
- try {
1038
- const base = document.baseURI || window.location.href;
1039
- return new URL(attrs.src, base).href;
1040
- } catch {
1041
- return attrs.src;
1042
- }
1043
- })();
1044
- if (Array.from(document.querySelectorAll("script[src]")).find((el) => el.src === normSrc)) return;
1045
- const script = document.createElement("script");
1046
- for (const [key, value] of Object.entries(attrs)) if (key !== "suppressHydrationWarning" && value !== void 0 && value !== false) script.setAttribute(key, typeof value === "boolean" ? "" : String(value));
1047
- document.head.appendChild(script);
1048
- return () => {
1049
- if (script.parentNode) script.parentNode.removeChild(script);
1050
- };
1051
- }
1052
- if (typeof children2 === "string") {
1053
- const typeAttr = typeof attrs?.type === "string" ? attrs.type : "text/javascript";
1054
- const nonceAttr = typeof attrs?.nonce === "string" ? attrs.nonce : void 0;
1055
- if (Array.from(document.querySelectorAll("script:not([src])")).find((el) => {
1056
- if (!(el instanceof HTMLScriptElement)) return false;
1057
- const sType = el.getAttribute("type") ?? "text/javascript";
1058
- const sNonce = el.getAttribute("nonce") ?? void 0;
1059
- return el.textContent === children2 && sType === typeAttr && sNonce === nonceAttr;
1060
- })) return;
1061
- const script = document.createElement("script");
1062
- script.textContent = children2;
1063
- if (attrs) {
1064
- for (const [key, value] of Object.entries(attrs)) if (key !== "suppressHydrationWarning" && value !== void 0 && value !== false) script.setAttribute(key, typeof value === "boolean" ? "" : String(value));
1065
- }
1066
- document.head.appendChild(script);
1067
- return () => {
1068
- if (script.parentNode) script.parentNode.removeChild(script);
1069
- };
1070
- }
1071
- }, [
1072
- attrs,
1073
- children2,
1074
- dataScript
1075
- ]);
1076
- if (dataScript && typeof children2 === "string") return /* @__PURE__ */ jsx("script", {
1077
- ...attrs,
1078
- suppressHydrationWarning: true,
1079
- dangerouslySetInnerHTML: { __html: children2 }
1080
- });
1081
- if (!hydrated) {
1082
- if (attrs?.src) return /* @__PURE__ */ jsx("script", {
1083
- ...attrs,
1084
- suppressHydrationWarning: true
1085
- });
1086
- if (typeof children2 === "string") return /* @__PURE__ */ jsx("script", {
1087
- ...attrs,
1088
- dangerouslySetInnerHTML: { __html: children2 },
1089
- suppressHydrationWarning: true
1090
- });
1091
- }
1092
- return null;
1093
- }
1094
- var useTags = () => {
1095
- const router = useRouter();
1096
- const nonce = router.options.ssr?.nonce;
1097
- const routeMeta = useStore(router.stores.activeMatchesSnapshot, (matches) => {
1098
- return matches.map((match) => match.meta).filter(Boolean);
1099
- }, deepEqual);
1100
- const meta = React.useMemo(() => {
1101
- const resultMeta = [];
1102
- const metaByAttribute = {};
1103
- let title;
1104
- for (let i = routeMeta.length - 1; i >= 0; i--) {
1105
- const metas = routeMeta[i];
1106
- for (let j = metas.length - 1; j >= 0; j--) {
1107
- const m = metas[j];
1108
- if (!m) continue;
1109
- if (m.title) {
1110
- if (!title) title = {
1111
- tag: "title",
1112
- children: m.title
1113
- };
1114
- } else if ("script:ld+json" in m) try {
1115
- const json = JSON.stringify(m["script:ld+json"]);
1116
- resultMeta.push({
1117
- tag: "script",
1118
- attrs: { type: "application/ld+json" },
1119
- children: escapeHtml(json)
1120
- });
1121
- } catch {
1122
- }
1123
- else {
1124
- const attribute = m.name ?? m.property;
1125
- if (attribute) if (metaByAttribute[attribute]) continue;
1126
- else metaByAttribute[attribute] = true;
1127
- resultMeta.push({
1128
- tag: "meta",
1129
- attrs: {
1130
- ...m,
1131
- nonce
1132
- }
1133
- });
1134
- }
1135
- }
1136
- }
1137
- if (title) resultMeta.push(title);
1138
- if (nonce) resultMeta.push({
1139
- tag: "meta",
1140
- attrs: {
1141
- property: "csp-nonce",
1142
- content: nonce
1143
- }
1144
- });
1145
- resultMeta.reverse();
1146
- return resultMeta;
1147
- }, [routeMeta, nonce]);
1148
- const links = useStore(router.stores.activeMatchesSnapshot, (matches) => {
1149
- const constructed = matches.map((match) => match.links).filter(Boolean).flat(1).map((link) => ({
1150
- tag: "link",
1151
- attrs: {
1152
- ...link,
1153
- nonce
1154
- }
1155
- }));
1156
- const manifest = router.ssr?.manifest;
1157
- const assets = matches.map((match) => manifest?.routes[match.routeId]?.assets ?? []).filter(Boolean).flat(1).filter((asset) => asset.tag === "link").map((asset) => ({
1158
- tag: "link",
1159
- attrs: {
1160
- ...asset.attrs,
1161
- suppressHydrationWarning: true,
1162
- nonce
1163
- }
1164
- }));
1165
- return [...constructed, ...assets];
1166
- }, deepEqual);
1167
- const preloadLinks = useStore(router.stores.activeMatchesSnapshot, (matches) => {
1168
- const preloadLinks2 = [];
1169
- matches.map((match) => router.looseRoutesById[match.routeId]).forEach((route) => router.ssr?.manifest?.routes[route.id]?.preloads?.filter(Boolean).forEach((preload) => {
1170
- preloadLinks2.push({
1171
- tag: "link",
1172
- attrs: {
1173
- rel: "modulepreload",
1174
- href: preload,
1175
- nonce
1176
- }
1177
- });
1178
- }));
1179
- return preloadLinks2;
1180
- }, deepEqual);
1181
- const styles = useStore(router.stores.activeMatchesSnapshot, (matches) => matches.map((match) => match.styles).flat(1).filter(Boolean).map(({ children: children2, ...attrs }) => ({
1182
- tag: "style",
1183
- attrs: {
1184
- ...attrs,
1185
- nonce
1186
- },
1187
- children: children2
1188
- })), deepEqual);
1189
- const headScripts = useStore(router.stores.activeMatchesSnapshot, (matches) => matches.map((match) => match.headScripts).flat(1).filter(Boolean).map(({ children: children2, ...script }) => ({
1190
- tag: "script",
1191
- attrs: {
1192
- ...script,
1193
- nonce
1194
- },
1195
- children: children2
1196
- })), deepEqual);
1197
- return uniqBy([
1198
- ...meta,
1199
- ...preloadLinks,
1200
- ...links,
1201
- ...styles,
1202
- ...headScripts
1203
- ], (d) => {
1204
- return JSON.stringify(d);
1205
- });
1206
- };
1207
- function uniqBy(arr, fn) {
1208
- const seen = /* @__PURE__ */ new Set();
1209
- return arr.filter((item) => {
1210
- const key = fn(item);
1211
- if (seen.has(key)) return false;
1212
- seen.add(key);
1213
- return true;
1214
- });
1215
- }
1216
- function HeadContent() {
1217
- const tags = useTags();
1218
- const nonce = useRouter().options.ssr?.nonce;
1219
- return /* @__PURE__ */ jsx(Fragment, { children: tags.map((tag) => /* @__PURE__ */ createElement$1(Asset, {
1220
- ...tag,
1221
- key: `tsr-meta-${JSON.stringify(tag)}`,
1222
- nonce
1223
- })) });
1224
- }
1225
339
  const defaultLocale = "en";
1226
340
  async function dynamicActivate(locale, onActivate) {
1227
341
  const messages = await loadI18nMessages(locale);
@@ -3818,7 +2932,7 @@ var TanstackQueryDevtools = class {
3818
2932
  if (this.#Component) {
3819
2933
  Devtools = this.#Component;
3820
2934
  } else {
3821
- Devtools = lazy(() => import("./WDYDFRGG-D26K3Vrv.js"));
2935
+ Devtools = lazy(() => import("./WDYDFRGG-DWwEqh2h.js"));
3822
2936
  this.#Component = Devtools;
3823
2937
  }
3824
2938
  setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
@@ -3956,7 +3070,7 @@ var TanstackQueryDevtoolsPanel = class {
3956
3070
  if (this.#Component) {
3957
3071
  Devtools = this.#Component;
3958
3072
  } else {
3959
- Devtools = lazy(() => import("./2SSKDMRQ-V0WKsSRc.js"));
3073
+ Devtools = lazy(() => import("./2SSKDMRQ-CGPzX7ok.js"));
3960
3074
  this.#Component = Devtools;
3961
3075
  }
3962
3076
  setupStyleSheet(this.#styleNonce, this.#shadowDOMTarget);
@@ -17912,7 +17026,7 @@ function orderHistoryUtils(order) {
17912
17026
  }) => {
17913
17027
  const success = "bg-success text-success-foreground";
17914
17028
  const destructive = "bg-destructive text-destructive-foreground";
17915
- const warning2 = "bg-warning text-warning-foreground";
17029
+ const warning = "bg-warning text-warning-foreground";
17916
17030
  const regular = "bg-muted text-muted-foreground";
17917
17031
  if (type === "ORDER_PAYMENT_TRANSITION" && data.to === "Settled") {
17918
17032
  return success;
@@ -17926,7 +17040,7 @@ function orderHistoryUtils(order) {
17926
17040
  if (type === "ORDER_CANCELLATION") {
17927
17041
  const lines = data.lines;
17928
17042
  const hasRefundData = lines && lines.length > 0 || data.reason;
17929
- return hasRefundData ? warning2 : destructive;
17043
+ return hasRefundData ? warning : destructive;
17930
17044
  }
17931
17045
  if (type === "ORDER_STATE_TRANSITION" && data.to === "Cancelled") {
17932
17046
  return destructive;
@@ -24361,6 +23475,52 @@ function ShippingMethodSelector({
24361
23475
  id: "5I+a3G"
24362
23476
  } }) }) });
24363
23477
  }
23478
+ function QuantityCell({
23479
+ line,
23480
+ onAdjustLine,
23481
+ onRemoveLine
23482
+ }) {
23483
+ const [localValue, setLocalValue] = useState(String(line.quantity));
23484
+ useEffect(() => {
23485
+ setLocalValue(String(line.quantity));
23486
+ }, [line.quantity]);
23487
+ const commitValue = (removeOnZero) => {
23488
+ const numValue = localValue === "" ? 0 : Number(localValue);
23489
+ if (numValue <= 0 || Number.isNaN(numValue)) {
23490
+ if (removeOnZero) {
23491
+ onRemoveLine({
23492
+ lineId: line.id
23493
+ });
23494
+ } else {
23495
+ setLocalValue(String(line.quantity));
23496
+ }
23497
+ } else if (numValue !== line.quantity) {
23498
+ onAdjustLine({
23499
+ lineId: line.id,
23500
+ quantity: numValue,
23501
+ customFields: line.customFields
23502
+ });
23503
+ }
23504
+ };
23505
+ return /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
23506
+ /* @__PURE__ */ jsx(Input, { type: "number", value: localValue, min: 0, placeholder: "0", "data-testid": "order-line-quantity", onChange: (e) => setLocalValue(e.target.value), onKeyDown: (e) => {
23507
+ if (e.key === "Enter") {
23508
+ e.preventDefault();
23509
+ commitValue(true);
23510
+ }
23511
+ }, onBlur: () => commitValue(false) }),
23512
+ /* @__PURE__ */ jsx(Button, { variant: "outline", type: "button", size: "icon", onClick: () => onRemoveLine({
23513
+ lineId: line.id
23514
+ }), children: /* @__PURE__ */ jsx(Trash2, {}) }),
23515
+ line.customFields && /* @__PURE__ */ jsx(OrderLineCustomFieldsForm, { onUpdate: (customFields) => {
23516
+ onAdjustLine({
23517
+ lineId: line.id,
23518
+ quantity: line.quantity,
23519
+ customFields
23520
+ });
23521
+ }, value: line.customFields })
23522
+ ] });
23523
+ }
24364
23524
  function EditOrderTable({
24365
23525
  order,
24366
23526
  eligibleShippingMethods,
@@ -24435,28 +23595,7 @@ function EditOrderTable({
24435
23595
  accessorKey: "quantity",
24436
23596
  cell: ({
24437
23597
  row
24438
- }) => {
24439
- return /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
24440
- /* @__PURE__ */ jsx(Input, { type: "number", value: row.original.quantity, min: 0, "data-testid": "order-line-quantity", onChange: (e) => {
24441
- const value = Number.isNaN(e.target.valueAsNumber) ? 0 : e.target.valueAsNumber;
24442
- onAdjustLine({
24443
- lineId: row.original.id,
24444
- quantity: value,
24445
- customFields: row.original.customFields
24446
- });
24447
- } }),
24448
- /* @__PURE__ */ jsx(Button, { variant: "outline", type: "button", size: "icon", disabled: row.original.quantity === 0, onClick: () => onRemoveLine({
24449
- lineId: row.original.id
24450
- }), children: /* @__PURE__ */ jsx(Trash2, {}) }),
24451
- row.original.customFields && /* @__PURE__ */ jsx(OrderLineCustomFieldsForm, { onUpdate: (customFields) => {
24452
- onAdjustLine({
24453
- lineId: row.original.id,
24454
- quantity: row.original.quantity,
24455
- customFields
24456
- });
24457
- }, value: row.original.customFields })
24458
- ] });
24459
- }
23598
+ }) => /* @__PURE__ */ jsx(QuantityCell, { line: row.original, onAdjustLine, onRemoveLine })
24460
23599
  }, {
24461
23600
  header: _t(
24462
23601
  /*i18n*/