@dropins/storefront-requisition-list 1.4.0-beta.0 → 1.4.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"SharedRequisitionList.js","sources":["/@dropins/storefront-requisition-list/src/components/SharedRequisitionList/SharedRequisitionList.tsx","/@dropins/storefront-requisition-list/src/containers/SharedRequisitionList/SharedRequisitionList.tsx","/@dropins/storefront-requisition-list/src/components/ShareRequisitionListContent/ShareRequisitionListContent.tsx","/@dropins/storefront-requisition-list/src/containers/ShareRequisitionListContent/ShareRequisitionListContent.tsx","/@dropins/storefront-requisition-list/src/lib/constants.ts","/@dropins/storefront-requisition-list/src/components/RequisitionListForm/RequisitionListForm.tsx","/@dropins/storefront-requisition-list/src/hooks/useRequisitionListForm.ts","/@dropins/storefront-requisition-list/src/containers/RequisitionListForm/RequisitionListForm.tsx","/@dropins/storefront-requisition-list/src/hooks/useRequisitionListGrid.tsx","/@dropins/storefront-requisition-list/src/hooks/useRequisitionListEnabled.ts","/@dropins/storefront-requisition-list/src/containers/RequisitionListGrid/RequisitionListGrid.tsx","../../node_modules/@adobe-commerce/elsie/src/icons/Add.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Cart.svg","../../node_modules/@adobe-commerce/elsie/src/icons/ChevronDown.svg","../../node_modules/@adobe-commerce/elsie/src/icons/List.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Minus.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Search.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Trash.svg","/@dropins/storefront-requisition-list/src/hooks/useRequisitionLists.ts","/@dropins/storefront-requisition-list/src/hooks/useRequisitionListAlert.tsx","/@dropins/storefront-requisition-list/src/hooks/useRequisitionListSelectedItems.ts","/@dropins/storefront-requisition-list/src/hooks/useRequisitionListTransfer.ts","/@dropins/storefront-requisition-list/src/lib/requisition-list-item-comparator.ts","/@dropins/storefront-requisition-list/src/containers/RequisitionListSelector/RequisitionListSelector.tsx","/@dropins/storefront-requisition-list/src/components/RequisitionListHeader/RequisitionListHeader.tsx","/@dropins/storefront-requisition-list/src/components/RequisitionListModal/RequisitionListModal.tsx","/@dropins/storefront-requisition-list/src/containers/RequisitionListHeader/RequisitionListHeader.tsx","/@dropins/storefront-requisition-list/src/components/RequisitionListGridWrapper/RequisitionListGridWrapper.tsx","/@dropins/storefront-requisition-list/src/components/RequisitionListActions/RequisitionListActions.tsx","/@dropins/storefront-requisition-list/src/components/EmptyList/EmptyList.tsx","/@dropins/storefront-requisition-list/src/components/NotFound/NotFound.tsx","/@dropins/storefront-requisition-list/src/components/ProductListTable/ProductListTable.tsx","/@dropins/storefront-requisition-list/src/components/BatchActions/BatchActions.tsx","/@dropins/storefront-requisition-list/src/components/PageSizePicker/PageSizePicker.tsx","/@dropins/storefront-requisition-list/src/components/PaginationItemsCounter/PaginationItemsCounter.tsx","/@dropins/storefront-requisition-list/src/components/RequisitionListPicker/RequisitionListPicker.tsx","/@dropins/storefront-requisition-list/src/containers/RequisitionListView/RequisitionListView.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport {\n Button,\n Header,\n InLineAlert,\n ProgressSpinner,\n Table,\n} from '@adobe-commerce/elsie/components';\nimport { SharedRequisitionListResult } from '@/requisitionList/api/getSharedRequisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport '@/requisitionList/components/SharedRequisitionList/SharedRequisitionList.css';\n\nexport type SharedRequisitionListStatus =\n | 'preview_loading'\n | 'preview_loaded'\n | 'preview_error'\n | 'importing'\n | 'import_success'\n | 'import_error';\n\nexport interface SharedRequisitionListProps {\n status: SharedRequisitionListStatus;\n previewData: SharedRequisitionListResult | null;\n errorMessage: string;\n onImport: () => void;\n translations: {\n loading: string;\n previewTitle: string;\n senderLabel: string;\n listNameLabel: string;\n descriptionLabel: string;\n itemsCountLabel: string;\n importButton: string;\n importingButton: string;\n successImport: string;\n skuHeader: string;\n qtyHeader: string;\n optionsHeader: string;\n };\n}\n\nconst getItemOptions = (item: Item): string => {\n if (item.configurable_options?.length) {\n return item.configurable_options\n .map((opt) => `${opt.option_label}: ${opt.value_label}`)\n .join(', ');\n }\n if (item.bundle_options?.length) {\n return item.bundle_options.map((opt) => opt.label).join(', ');\n }\n return '';\n};\n\nexport const SharedRequisitionList: FunctionComponent<\n SharedRequisitionListProps\n> = ({ status, previewData, errorMessage, onImport, translations }) => {\n if (status === 'preview_loading') {\n return (\n <div className=\"shared-requisition-list__loading\">\n <ProgressSpinner />\n <span>{translations.loading}</span>\n </div>\n );\n }\n\n if (status === 'preview_error') {\n return (\n <div className=\"shared-requisition-list__container\">\n <InLineAlert heading={errorMessage} type=\"error\" variant=\"primary\" />\n </div>\n );\n }\n\n if (!previewData) {\n return null;\n }\n\n const listName = previewData.requisitionList.name;\n const items = previewData.requisitionList.items ?? [];\n const isImporting = status === 'importing';\n const isImported = status === 'import_success';\n\n const columns = [\n { label: translations.skuHeader, key: 'sku' },\n { label: translations.qtyHeader, key: 'qty' },\n { label: translations.optionsHeader, key: 'options' },\n ];\n\n const rowData = items.map((item) => ({\n sku: item.sku,\n qty: item.quantity,\n options: getItemOptions(item),\n }));\n\n return (\n <div className=\"shared-requisition-list__preview\">\n <Header\n title={translations.previewTitle}\n aria-label={translations.previewTitle}\n />\n\n {status === 'import_success' && (\n <div className=\"shared-requisition-list__alert-wrapper\">\n <InLineAlert\n heading={translations.successImport.replace('{listName}', listName)}\n type=\"success\"\n variant=\"primary\"\n />\n </div>\n )}\n\n {status === 'import_error' && (\n <div className=\"shared-requisition-list__alert-wrapper\">\n <InLineAlert heading={errorMessage} type=\"error\" variant=\"primary\" />\n </div>\n )}\n\n <div className=\"shared-requisition-list__preview-details\">\n <div className=\"shared-requisition-list__preview-row\">\n <span className=\"shared-requisition-list__preview-label\">\n {translations.senderLabel}\n </span>\n <span className=\"shared-requisition-list__preview-value\">\n {previewData.senderName}\n </span>\n </div>\n <div className=\"shared-requisition-list__preview-row\">\n <span className=\"shared-requisition-list__preview-label\">\n {translations.listNameLabel}\n </span>\n <span className=\"shared-requisition-list__preview-value\">\n {listName}\n </span>\n </div>\n {previewData.requisitionList.description && (\n <div className=\"shared-requisition-list__preview-row\">\n <span className=\"shared-requisition-list__preview-label\">\n {translations.descriptionLabel}\n </span>\n <span className=\"shared-requisition-list__preview-value\">\n {previewData.requisitionList.description}\n </span>\n </div>\n )}\n </div>\n\n {items.length > 0 && (\n <div className=\"shared-requisition-list__table-wrapper\">\n <Table\n columns={columns}\n rowData={rowData}\n data-testid=\"shared-list-items-table\"\n />\n </div>\n )}\n\n <div className=\"shared-requisition-list__actions\">\n <Button\n type=\"button\"\n variant=\"primary\"\n onClick={onImport}\n disabled={isImporting || isImported}\n data-testid=\"import-shared-list-btn\"\n >\n {isImporting\n ? translations.importingButton\n : translations.importButton}\n </Button>\n </div>\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useCallback, useEffect, useRef, useState } from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport {\n getSharedRequisitionList,\n SharedRequisitionListResult,\n} from '@/requisitionList/api/getSharedRequisitionList';\nimport { importSharedRequisitionList } from '@/requisitionList/api/importSharedRequisitionList';\nimport {\n SharedRequisitionList as SharedRequisitionListView,\n SharedRequisitionListStatus,\n} from '@/requisitionList/components/SharedRequisitionList';\n\nexport interface SharedRequisitionListProps {\n /**\n * The share token from the URL (e.g. from ?requisition_id=<token>).\n */\n token: string;\n /**\n * Called with the imported list UID and list name on a successful import.\n * The integration should navigate to the requisition list detail page.\n *\n * Note: this callback is captured at mount time. Pass a stable reference\n * (e.g. a module-level function or a `useCallback` with no deps) so that\n * the closure always holds the correct value.\n */\n routeRequisitionList?: (uid: string, listName: string) => string | void;\n}\n\nexport const SharedRequisitionList: Container<SharedRequisitionListProps> = ({\n token,\n routeRequisitionList,\n}: SharedRequisitionListProps) => {\n const [status, setStatus] = useState<SharedRequisitionListStatus>('preview_loading');\n const [previewData, setPreviewData] =\n useState<SharedRequisitionListResult | null>(null);\n const [errorMessage, setErrorMessage] = useState('');\n const isMountedRef = useRef(true);\n\n const translations = useText({\n loading: 'RequisitionList.SharedRequisitionList.loading',\n previewTitle: 'RequisitionList.SharedRequisitionList.previewTitle',\n senderLabel: 'RequisitionList.SharedRequisitionList.senderLabel',\n listNameLabel: 'RequisitionList.SharedRequisitionList.listNameLabel',\n descriptionLabel: 'RequisitionList.SharedRequisitionList.descriptionLabel',\n itemsCountLabel: 'RequisitionList.SharedRequisitionList.itemsCountLabel',\n importButton: 'RequisitionList.SharedRequisitionList.importButton',\n importingButton: 'RequisitionList.SharedRequisitionList.importingButton',\n errorPreview: 'RequisitionList.SharedRequisitionList.errorPreview',\n successImport: 'RequisitionList.RequisitionListAlert.successImport',\n errorImport: 'RequisitionList.RequisitionListAlert.errorImport',\n skuHeader: 'RequisitionList.SharedRequisitionList.skuHeader',\n qtyHeader: 'RequisitionList.SharedRequisitionList.qtyHeader',\n optionsHeader: 'RequisitionList.SharedRequisitionList.optionsHeader',\n });\n\n useEffect(() => {\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n\n useEffect(() => {\n getSharedRequisitionList(token)\n .then((result) => {\n if (!isMountedRef.current) return;\n\n if (!result) {\n setErrorMessage('');\n setStatus('preview_error');\n return;\n }\n\n setPreviewData(result);\n setStatus('preview_loaded');\n })\n .catch((err: unknown) => {\n if (!isMountedRef.current) return;\n setErrorMessage(err instanceof Error && err.message ? err.message : '');\n setStatus('preview_error');\n });\n }, [token]);\n\n const handleImport = useCallback(() => {\n setStatus('importing');\n setErrorMessage('');\n\n importSharedRequisitionList(token)\n .then(({ requisitionList, userErrors }) => {\n if (!isMountedRef.current) return;\n\n if (userErrors.length > 0) {\n setErrorMessage(userErrors[0].message);\n setStatus('import_error');\n return;\n }\n\n const name = requisitionList?.name ?? '';\n const uid = requisitionList?.uid ?? '';\n\n events.emit('requisitionList/alert', {\n action: 'import',\n type: 'success',\n context: 'requisitionList',\n listName: name,\n });\n\n if (routeRequisitionList) {\n routeRequisitionList(uid, name);\n return;\n }\n\n setStatus('import_success');\n })\n .catch((err: unknown) => {\n if (!isMountedRef.current) return;\n setErrorMessage(err instanceof Error && err.message ? err.message : '');\n setStatus('import_error');\n });\n }, [token, routeRequisitionList]);\n\n // Resolve the translation fallback at render time so effects don't need\n // translations in their dependency arrays.\n const resolvedErrorMessage =\n errorMessage ||\n (status === 'import_error' ? translations.errorImport : translations.errorPreview);\n\n return (\n <SharedRequisitionListView\n status={status}\n previewData={previewData}\n errorMessage={resolvedErrorMessage}\n onImport={handleImport}\n translations={translations}\n />\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport {\n Button,\n Divider,\n Field,\n Input,\n ProgressSpinner,\n MultiSelect,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/requisitionList/components/ShareRequisitionListContent/ShareRequisitionListContent.css';\n\nexport interface ShareRequisitionListContentProps {\n loadingUsers: boolean;\n usersErrorMessage: string | null;\n loadingLink: boolean;\n selectedUserValues: string[];\n multiSelectOptions: Array<{ label: string; value: string }>;\n shareLink: string | null;\n linkErrorMessage: string | null;\n linkCopied: boolean;\n isSubmitting: boolean;\n canSubmit: boolean;\n onSubmitClick: () => void;\n onCopyLinkClick: () => void;\n onSelectedUsersChange: (values: Array<string | number>) => void;\n onUsersFieldInteract: () => void;\n selectionError: string | null;\n submitErrorMessage: string | null;\n isShareSuccess: boolean;\n sharedRecipientEmails: string[];\n}\n\nexport const ShareRequisitionListContent: FunctionComponent<\n ShareRequisitionListContentProps\n> = ({\n loadingUsers,\n usersErrorMessage,\n loadingLink,\n selectedUserValues,\n multiSelectOptions,\n shareLink,\n linkErrorMessage,\n linkCopied,\n isSubmitting,\n canSubmit,\n onSubmitClick,\n onCopyLinkClick,\n onSelectedUsersChange,\n onUsersFieldInteract,\n selectionError,\n submitErrorMessage,\n isShareSuccess,\n sharedRecipientEmails,\n}) => {\n const translations = useText({\n emailInstruction:\n 'RequisitionList.ShareRequisitionListContent.emailInstruction',\n emailLabel: 'RequisitionList.ShareRequisitionListContent.emailLabel',\n emailPlaceholder:\n 'RequisitionList.ShareRequisitionListContent.emailPlaceholder',\n submitLabel: 'RequisitionList.ShareRequisitionListContent.submitLabel',\n linkInstruction:\n 'RequisitionList.ShareRequisitionListContent.linkInstruction',\n copyLink: 'RequisitionList.ShareRequisitionListContent.copyLink',\n linkCopied: 'RequisitionList.ShareRequisitionListContent.linkCopied',\n loadingUsers: 'RequisitionList.ShareRequisitionListContent.loadingUsers',\n loadingLink: 'RequisitionList.ShareRequisitionListContent.loadingLink',\n noUsersAvailable:\n 'RequisitionList.ShareRequisitionListContent.noUsersAvailable',\n maxRecipientsValidation:\n 'RequisitionList.ShareRequisitionListContent.maxRecipientsValidation',\n shareSuccessMessage:\n 'RequisitionList.ShareRequisitionListContent.shareSuccessMessage',\n });\n return (\n <div className=\"share-requisition-list-content\">\n {/* Email section */}\n {isShareSuccess ? (\n <div className=\"share-requisition-list-content__success\">\n <p className=\"share-requisition-list-content__instruction\">\n {translations.shareSuccessMessage}\n </p>\n <div className=\"share-requisition-list-content__recipient-list\">\n {sharedRecipientEmails.map((email) => (\n <p\n key={email}\n className=\"share-requisition-list-content__recipient\"\n >\n {email}\n </p>\n ))}\n </div>\n </div>\n ) : (\n <>\n <p className=\"share-requisition-list-content__instruction\">\n {translations.emailInstruction}\n </p>\n\n <div className=\"share-requisition-list-content__field\">\n {loadingUsers ? (\n <div className=\"share-requisition-list-content__loading\">\n <ProgressSpinner size=\"small\" stroke=\"3\" />\n <span>{translations.loadingUsers}</span>\n </div>\n ) : usersErrorMessage ? (\n <p className=\"dropin-field__hint dropin-field__hint--medium dropin-field__hint--error\">\n {usersErrorMessage}\n </p>\n ) : (\n <Field\n label={translations.emailLabel}\n error={selectionError ?? undefined}\n disabled={isSubmitting}\n onMouseDown={onUsersFieldInteract}\n onKeyDown={onUsersFieldInteract}\n >\n <MultiSelect\n options={multiSelectOptions}\n value={selectedUserValues}\n onChange={onSelectedUsersChange}\n placeholder={translations.emailPlaceholder}\n noResultsText={translations.noUsersAvailable}\n disabled={isSubmitting}\n error={!!selectionError}\n className=\"share-requisition-list-content__multi-select\"\n />\n </Field>\n )}\n </div>\n\n <div className=\"share-requisition-list-content__actions\">\n <Button\n variant=\"primary\"\n onClick={onSubmitClick}\n disabled={!canSubmit}\n type=\"button\"\n data-testid=\"share-submit-btn\"\n >\n {translations.submitLabel}\n </Button>\n </div>\n {submitErrorMessage && (\n <p className=\"dropin-field__hint dropin-field__hint--medium dropin-field__hint--error\">\n {submitErrorMessage}\n </p>\n )}\n </>\n )}\n\n {/* Link section */}\n <Divider\n variant={'secondary'}\n className=\"share-requisition-list-content__divider-secondary\"\n />\n\n <p className=\"share-requisition-list-content__instruction\">\n {translations.linkInstruction}\n </p>\n\n {loadingLink ? (\n <div className=\"share-requisition-list-content__loading\">\n <ProgressSpinner size=\"small\" stroke=\"3\" />\n <span>{translations.loadingLink}</span>\n </div>\n ) : shareLink ? (\n <>\n <div className=\"share-requisition-list-content__link-row\">\n <Input\n readOnly\n value={shareLink}\n data-testid=\"share-link-field\"\n />\n </div>\n\n <div className=\"share-requisition-list-content__actions\">\n <Button\n variant=\"secondary\"\n onClick={onCopyLinkClick}\n type=\"button\"\n data-testid=\"copy-link-btn\"\n >\n {linkCopied ? translations.linkCopied : translations.copyLink}\n </Button>\n </div>\n </>\n ) : linkErrorMessage ? (\n <p className=\"dropin-field__hint dropin-field__hint--medium dropin-field__hint--error\">\n {linkErrorMessage}\n </p>\n ) : null}\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useState, useEffect, useCallback } from 'preact/hooks';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport {\n getCompanyUsers,\n CompanyUser,\n} from '@/requisitionList/api/getCompanyUsers';\nimport {\n shareRequisitionListByToken,\n ShareRequisitionListByTokenResult,\n} from '@/requisitionList/api/shareRequisitionListByToken';\nimport { ShareRequisitionListByEmailError } from '@/requisitionList/api/shareRequisitionListByEmail';\nimport { ShareRequisitionListContent as ShareRequisitionListContentComponent } from '@/requisitionList/components/ShareRequisitionListContent/ShareRequisitionListContent';\nimport { state } from '@/requisitionList/lib/state';\n\nexport interface ShareRequisitionListContentProps {\n requisitionListUid: string;\n isSubmitting: boolean;\n onSubmit: (\n customerUids: string[]\n ) => Promise<Array<ShareRequisitionListByEmailError> | null>;\n currentCustomerEmail?: string;\n /**\n * Called with the already-built relative share URL to allow customization (e.g. making it absolute).\n * Example: (relativeUrl) => `${window.location.origin}${relativeUrl}`\n * Falls back to using the relative URL as-is, built from the storefront path in store config.\n */\n routeSharedRequisitionList?: (relativeUrl: string) => string;\n}\n\nexport const ShareRequisitionListContent: Container<\n ShareRequisitionListContentProps\n> = ({\n requisitionListUid,\n isSubmitting,\n onSubmit,\n currentCustomerEmail,\n routeSharedRequisitionList,\n}: ShareRequisitionListContentProps) => {\n const translations = useText({\n emailInstruction:\n 'RequisitionList.ShareRequisitionListContent.emailInstruction',\n emailLabel: 'RequisitionList.ShareRequisitionListContent.emailLabel',\n emailPlaceholder:\n 'RequisitionList.ShareRequisitionListContent.emailPlaceholder',\n submitLabel: 'RequisitionList.ShareRequisitionListContent.submitLabel',\n linkInstruction:\n 'RequisitionList.ShareRequisitionListContent.linkInstruction',\n copyLink: 'RequisitionList.ShareRequisitionListContent.copyLink',\n linkCopied: 'RequisitionList.ShareRequisitionListContent.linkCopied',\n loadingUsers:\n 'RequisitionList.ShareRequisitionListContent.loadingUsers',\n loadingLink:\n 'RequisitionList.ShareRequisitionListContent.loadingLink',\n noUsersAvailable:\n 'RequisitionList.ShareRequisitionListContent.noUsersAvailable',\n usersLoadError:\n 'RequisitionList.ShareRequisitionListContent.usersLoadError',\n maxRecipientsValidation:\n 'RequisitionList.ShareRequisitionListContent.maxRecipientsValidation',\n shareSuccessMessage:\n 'RequisitionList.ShareRequisitionListContent.shareSuccessMessage',\n });\n\n const [companyUsers, setCompanyUsers] = useState<CompanyUser[]>([]);\n const [loadingUsers, setLoadingUsers] = useState(true);\n const [usersLoadFailed, setUsersLoadFailed] = useState(false);\n const [selectedUids, setSelectedUids] = useState<Set<string>>(new Set());\n\n const [shareLink, setShareLink] = useState<string | null>(null);\n const [loadingLink, setLoadingLink] = useState(true);\n const [linkErrorMessage, setLinkErrorMessage] = useState<string | null>(null);\n const [linkCopied, setLinkCopied] = useState(false);\n const [selectionError, setSelectionError] = useState<string | null>(null);\n const [submitErrorMessage, setSubmitErrorMessage] = useState<string | null>(\n null\n );\n const [isShareSuccess, setIsShareSuccess] = useState(false);\n const [sharedRecipientEmails, setSharedRecipientEmails] = useState<string[]>(\n []\n );\n\n const maxRecipients = (() => {\n const configValue = state.config?.requisition_list_share_max_recipients;\n const parsed = Number(configValue);\n return Number.isFinite(parsed) && parsed > 0 ? parsed : null;\n })();\n\n useEffect(() => {\n getCompanyUsers()\n .then((users: CompanyUser[]) => {\n const colleagues = users.filter((user) => {\n if (\n currentCustomerEmail &&\n user.email.toLowerCase() === currentCustomerEmail.toLowerCase()\n ) {\n return false;\n }\n return true;\n });\n setCompanyUsers(colleagues);\n })\n .catch(() => {\n setUsersLoadFailed(true);\n })\n .finally(() => setLoadingUsers(false));\n }, [currentCustomerEmail]);\n\n useEffect(() => {\n shareRequisitionListByToken(requisitionListUid)\n .then((result: ShareRequisitionListByTokenResult) => {\n if (result.token) {\n const storefrontPath =\n state.config?.requisition_list_share_storefront_path ?? '';\n const relativeUrl = `/${storefrontPath}?requisition_id=${result.token}`;\n const shareLink = routeSharedRequisitionList\n ? routeSharedRequisitionList(relativeUrl)\n : relativeUrl;\n setShareLink(shareLink);\n } else {\n setShareLink(null);\n }\n setLinkErrorMessage(result.errorMessage);\n })\n .finally(() => setLoadingLink(false));\n }, [requisitionListUid, routeSharedRequisitionList]);\n\n const handleSubmit = useCallback(async () => {\n const selectedIds = Array.from(selectedUids);\n const selectedEmails = companyUsers\n .filter((user) => selectedIds.includes(String(user.id)))\n .map((user) => user.email);\n\n const errors = await onSubmit(selectedIds);\n if (!errors) {\n setIsShareSuccess(true);\n setSharedRecipientEmails(selectedEmails);\n setSubmitErrorMessage(null);\n } else {\n setSubmitErrorMessage(errors[0]?.message || null);\n }\n }, [selectedUids, companyUsers, onSubmit]);\n\n const handleCopyLink = useCallback(() => {\n navigator.clipboard.writeText(shareLink!).then(\n () => {\n setLinkCopied(true);\n setTimeout(() => setLinkCopied(false), 3000);\n },\n (err) => {\n console.error('Failed to copy share link to clipboard:', err);\n }\n );\n }, [shareLink]);\n\n const multiSelectOptions = companyUsers.map((user) => ({\n label: `${user.firstname} ${user.lastname} (${user.email})`,\n value: user.id,\n }));\n\n const usersErrorMessage = usersLoadFailed ? translations.usersLoadError : null;\n\n const canSubmit = !isSubmitting && selectedUids.size > 0 && !selectionError;\n\n return (\n <ShareRequisitionListContentComponent\n loadingUsers={loadingUsers}\n usersErrorMessage={usersErrorMessage}\n loadingLink={loadingLink}\n selectedUserValues={Array.from(selectedUids)}\n multiSelectOptions={multiSelectOptions}\n shareLink={shareLink}\n linkErrorMessage={linkErrorMessage}\n linkCopied={linkCopied}\n isSubmitting={isSubmitting}\n canSubmit={canSubmit}\n onSubmitClick={handleSubmit}\n onCopyLinkClick={handleCopyLink}\n onUsersFieldInteract={() => {\n if (selectionError) {\n setSelectionError(null);\n }\n if (submitErrorMessage) {\n setSubmitErrorMessage(null);\n }\n }}\n onSelectedUsersChange={(values: Array<string | number>) => {\n const nextValues = values.map(String);\n if (maxRecipients && nextValues.length > maxRecipients) {\n setSelectionError(\n translations.maxRecipientsValidation.replace(\n '{max}',\n String(maxRecipients)\n )\n );\n return;\n }\n setSelectionError(null);\n setSelectedUids(new Set(nextValues));\n }}\n selectionError={selectionError}\n submitErrorMessage={submitErrorMessage}\n isShareSuccess={isShareSuccess}\n sharedRecipientEmails={sharedRecipientEmails}\n />\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/**\n * Default page size for pagination in requisition lists\n */\nexport const DEFAULT_PAGE_SIZE = 10;\n\n/**\n * Validation constants for requisition list forms\n */\nexport const NAME_MIN_LENGTH = 3;\nexport const NAME_MAX_LENGTH = 40;\nexport const DESCRIPTION_MAX_LENGTH = 255;\n// Allow letters, numbers, spaces, and common punctuation: . , - _ ! ? ' \" ( ) &\nexport const NAME_VALID_CHARS = /^[a-zA-Z0-9\\s.,\\-_!?'\"()&]+$/;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { useState } from 'preact/hooks';\nimport {\n Field,\n Input,\n TextArea,\n Button,\n InLineAlert,\n ProgressSpinner,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport {\n RequisitionListFormMode,\n RequisitionListFormValues,\n} from '@/requisitionList/hooks/useRequisitionListForm';\nimport {\n NAME_MIN_LENGTH,\n NAME_MAX_LENGTH,\n DESCRIPTION_MAX_LENGTH,\n NAME_VALID_CHARS,\n} from '@/requisitionList/lib/constants';\n\nimport '@/requisitionList/components/RequisitionListForm/RequisitionListForm.css';\n\nexport interface RequisitionListFormProps\n extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n mode: RequisitionListFormMode;\n defaultValues?: RequisitionListFormValues;\n error?: string | null;\n onSubmit: (values: RequisitionListFormValues) => Promise<void> | void;\n onCancel: () => void;\n}\n\nexport const RequisitionListForm: FunctionComponent<\n RequisitionListFormProps\n> = ({\n className,\n mode,\n defaultValues = { name: '', description: '' },\n error = null,\n onSubmit,\n onCancel,\n ...props\n}) => {\n const [values, setValues] =\n useState<RequisitionListFormValues>(defaultValues);\n const [touched, setTouched] = useState({\n name: false,\n });\n const [isSubmitting, setIsSubmitting] = useState(false);\n\n const translations = useText({\n actionCancel: `RequisitionList.RequisitionListForm.actionCancel`,\n actionSave: `RequisitionList.RequisitionListForm.actionSave`,\n requiredField: `RequisitionList.RequisitionListForm.requiredField`,\n nameMinLength: `RequisitionList.RequisitionListForm.nameMinLength`,\n nameInvalidCharacters: `RequisitionList.RequisitionListForm.nameInvalidCharacters`,\n floatingLabel: `RequisitionList.RequisitionListForm.floatingLabel`,\n placeholder: `RequisitionList.RequisitionListForm.placeholder`,\n label: `RequisitionList.RequisitionListForm.label`,\n updateTitle: `RequisitionList.RequisitionListForm.updateTitle`,\n createTitle: `RequisitionList.RequisitionListForm.createTitle`,\n });\n\n // Validation functions\n const validateName = (name: string): string => {\n const trimmedName = name.trim();\n\n if (!trimmedName) {\n return translations.requiredField;\n }\n\n if (trimmedName.length < NAME_MIN_LENGTH) {\n return translations.nameMinLength.replace(\n '{min}',\n NAME_MIN_LENGTH.toString()\n );\n }\n\n if (!NAME_VALID_CHARS.test(trimmedName)) {\n return translations.nameInvalidCharacters;\n }\n\n return '';\n };\n\n const handleChange =\n (field: keyof RequisitionListFormValues) => (e: Event) => {\n const target = e.target as HTMLInputElement | HTMLTextAreaElement;\n setValues((prevValues) => ({\n ...prevValues,\n [field]: target.value,\n }));\n };\n\n const handleBlur = (field: keyof RequisitionListFormValues) => () => {\n setTouched((prev) => ({ ...prev, [field]: true }));\n };\n\n const handleSubmit = async (e: Event) => {\n e.preventDefault();\n\n // Mark all fields as touched on submit attempt\n setTouched({ name: true, description: true });\n\n // Validate all fields\n const nameError = validateName(values.name);\n\n if (nameError || isSubmitting) return;\n\n setIsSubmitting(true);\n try {\n await onSubmit({\n name: values.name.trim(),\n description: values.description?.trim() ?? '',\n });\n } catch {\n setIsSubmitting(false);\n }\n };\n\n // Calculate error messages\n const nameError = touched.name ? validateName(values.name) : '';\n\n const title =\n mode === 'update' ? translations.updateTitle : translations.createTitle;\n\n return (\n <div {...props} className={classes(['requisition-list-form', className])}>\n <div className=\"requisition-list-form__title\">\n {title}\n {isSubmitting ? (\n <div\n className={classes([\n 'requisition-list-form_progress-spinner',\n className,\n ])}\n data-testid=\"requisition-list-form-progress-spinner\"\n >\n <ProgressSpinner stroke={'4'} size={'small'} />\n </div>\n ) : null}\n </div>\n\n {error ? (\n <InLineAlert\n type=\"error\"\n className=\"requisition-list-form__notification\"\n variant=\"secondary\"\n heading={error}\n data-testid=\"requisition-list-alert\"\n />\n ) : null}\n\n <form\n className={classes(['requisition-list-form__form', className])}\n onSubmit={handleSubmit}\n >\n <Field error={nameError} disabled={isSubmitting}>\n <Input\n id=\"requisition-list-form-name\"\n name=\"name\"\n type=\"text\"\n floatingLabel={translations.floatingLabel}\n placeholder={translations.placeholder}\n maxLength={NAME_MAX_LENGTH}\n value={values.name}\n onChange={handleChange('name')}\n onBlur={handleBlur('name')}\n />\n </Field>\n\n <Field disabled={isSubmitting}>\n <TextArea\n id=\"requisition-list-form-description\"\n name=\"description\"\n label={translations.label}\n placeholder={translations.label}\n maxLength={DESCRIPTION_MAX_LENGTH}\n value={values.description}\n onChange={handleChange('description')}\n onBlur={handleBlur('description')}\n />\n </Field>\n\n <div className=\"requisition-list-form__actions\">\n <Button\n type=\"button\"\n variant=\"secondary\"\n onClick={onCancel}\n disabled={isSubmitting}\n data-testid=\"requisition-list-form-cancel\"\n >\n {translations.actionCancel}\n </Button>\n <Button\n type=\"submit\"\n disabled={isSubmitting}\n data-testid=\"requisition-list-form-save\"\n >\n {translations.actionSave}\n </Button>\n </div>\n </form>\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useState } from 'preact/hooks';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { createRequisitionList } from '@/requisitionList/api/createRequisitionList/createRequisitionList';\nimport { updateRequisitionList } from '@/requisitionList/api/updateRequisitionList/updateRequisitionList';\n\nexport type RequisitionListFormMode = 'create' | 'update';\nexport type RequisitionListFormValues = { name: string; description?: string };\n\ntype UseRequisitionListFormReturn = {\n error: string | null;\n submit: (\n values: RequisitionListFormValues\n ) => Promise<RequisitionList | null>;\n};\n\nexport function useRequisitionListForm(\n mode: RequisitionListFormMode,\n requisitionListUid?: string,\n onSuccess?: (rl: RequisitionList) => void,\n onError?: (msg: string) => void\n): UseRequisitionListFormReturn {\n const [error, setError] = useState<string | null>(null);\n\n const submit = async (\n values: RequisitionListFormValues\n ): Promise<RequisitionList | null> => {\n setError(null);\n try {\n const description = values.description ?? '';\n const result =\n mode === 'update' && requisitionListUid\n ? await updateRequisitionList(\n requisitionListUid,\n values.name,\n description\n )\n : await createRequisitionList(values.name, description);\n if (result) onSuccess?.(result);\n return result;\n } catch (e: any) {\n const msg = e?.message || 'Unexpected error';\n setError(msg);\n onError?.(msg);\n return null;\n }\n };\n\n return { error, submit };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { RequisitionListForm as RequisitionListFormComponent } from '@/requisitionList/components/RequisitionListForm/RequisitionListForm';\nimport {\n useRequisitionListForm,\n RequisitionListFormMode,\n RequisitionListFormValues,\n} from '@/requisitionList/hooks/useRequisitionListForm';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\n\nexport interface RequisitionListFormProps {\n mode: RequisitionListFormMode;\n requisitionListUid?: string;\n defaultValues?: RequisitionListFormValues;\n onSuccess?: (newList: RequisitionList) => void;\n onError?: (message: string) => void;\n onCancel: () => void;\n}\n\nexport const RequisitionListForm: Container<RequisitionListFormProps> = ({\n mode,\n requisitionListUid,\n defaultValues = { name: '', description: '' },\n onSuccess,\n onError,\n onCancel,\n}) => {\n const { error, submit } = useRequisitionListForm(\n mode,\n requisitionListUid,\n onSuccess,\n onError\n );\n\n const handleSubmit = async (values: RequisitionListFormValues) => {\n await submit(values);\n };\n\n return (\n <RequisitionListFormComponent\n mode={mode}\n defaultValues={defaultValues}\n error={error}\n onSubmit={handleSubmit}\n onCancel={onCancel}\n />\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useMemo, useState, useCallback, useEffect } from 'preact/compat';\nimport { VNode } from 'preact';\nimport { Button } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { RequisitionList as RequisitionListModel } from '@/requisitionList/data/models/requisitionList';\nimport { getRequisitionLists } from '@/requisitionList/api/getRequisitionLists';\nimport { RequisitionLists } from '@/requisitionList/data/models/requisitionLists';\nimport { events } from '@adobe-commerce/event-bus';\nimport { DEFAULT_PAGE_SIZE } from '@/requisitionList/lib/constants';\n\ntype Row = Record<string, VNode | string | number | undefined>;\ntype Callbacks = {\n handleOpenRenameModal: (rl: RequisitionListModel) => void;\n handleOpenDeleteModal: (rl: RequisitionListModel) => void;\n};\n\nexport function useRequisitionListGrid(\n callbacks?: Callbacks,\n routeRequisitionListDetails?: (uid: string) => string | void,\n closeModal?: () => void\n) {\n const translations = useText({\n actionRename: 'RequisitionList.RequisitionListView.actionRename',\n actionDeleteList: 'RequisitionList.RequisitionListView.actionDeleteList',\n });\n\n const [reqLists, setReqLists] = useState<RequisitionLists | null>(null);\n const [isAdding, setIsAdding] = useState(false);\n const [isFetching, setIsFetching] = useState(false);\n\n const handleAddNew = useCallback(() => {\n // Close any open modal before opening create form\n if (closeModal) {\n closeModal();\n }\n setIsAdding(true);\n }, [closeModal]);\n\n const handleCancelCreate = useCallback(() => setIsAdding(false), []);\n\n // Wrap callbacks to close create form when opening modals\n const wrappedCallbacks = useMemo(() => {\n if (!callbacks) return undefined;\n\n return {\n handleOpenRenameModal: (rl: RequisitionListModel) => {\n // Close create form if open - use functional update to avoid dependency on isAdding\n setIsAdding((current) => {\n if (current) return false;\n return current;\n });\n callbacks.handleOpenRenameModal(rl);\n },\n handleOpenDeleteModal: (rl: RequisitionListModel) => {\n // Close create form if open - use functional update to avoid dependency on isAdding\n setIsAdding((current) => {\n if (current) return false;\n return current;\n });\n callbacks.handleOpenDeleteModal(rl);\n },\n };\n }, [callbacks]);\n\n const fetchPage = useCallback(async (page: number, pageSize: number) => {\n setIsFetching(true);\n try {\n const data = await getRequisitionLists(page, pageSize);\n const currentPage = data?.page_info?.current_page ?? 1;\n const totalPages = data?.page_info?.total_pages ?? 0;\n const hasRows = (data?.items?.length ?? 0) > 0;\n\n if (!hasRows && currentPage > 1 && totalPages >= currentPage - 1) {\n const prev = currentPage - 1;\n const prevData = await getRequisitionLists(prev, pageSize);\n setReqLists(prevData);\n } else {\n setReqLists(data);\n }\n } finally {\n setIsFetching(false);\n }\n }, []);\n\n useEffect(() => {\n const requisitionListsEvent = events.on(\n 'requisitionLists/data',\n (data: RequisitionLists) => {\n if (data && data.items) {\n setReqLists(data);\n }\n },\n { eager: true }\n );\n return () => {\n requisitionListsEvent?.off();\n };\n }, []);\n\n useEffect(() => {\n if (!reqLists) {\n void fetchPage(1, DEFAULT_PAGE_SIZE);\n }\n }, [reqLists, fetchPage]);\n\n const handlePageChange = useCallback(\n (page?: number) => {\n const currentPage = page ?? reqLists?.page_info?.current_page ?? 1;\n const currentPageSize =\n reqLists?.page_info?.page_size ?? DEFAULT_PAGE_SIZE;\n return fetchPage(currentPage, currentPageSize);\n },\n [fetchPage, reqLists]\n );\n\n const handlePageSizeChange = useCallback(\n async (pageSize: number) => {\n // Reset to page 1 when changing page size\n await fetchPage(1, pageSize);\n },\n [fetchPage]\n );\n\n const rows: Row[] = useMemo(\n () =>\n (reqLists?.items ?? []).map((rl: RequisitionListModel) => {\n return {\n name: (\n <div className=\"requisition-list-grid-wrapper__name\">\n <div className=\"requisition-list-grid-wrapper__name__title\">\n <a\n href=\"#\"\n onClick={(e: Event): void => {\n e.preventDefault();\n if (routeRequisitionListDetails) {\n const result = routeRequisitionListDetails(rl.uid);\n if (typeof result === 'string') {\n window.location.href = result;\n }\n }\n }}\n >\n {rl.name}\n </a>\n </div>\n {rl.description && (\n <div className=\"requisition-list-grid-wrapper__name__description\">\n {rl.description}\n </div>\n )}\n </div>\n ),\n items_count: rl.items_count,\n last_updated: new Date(rl.updated_at).toLocaleString(),\n actions: (\n <div className=\"requisition-list-grid-wrapper__actions\">\n <Button\n variant=\"tertiary\"\n type=\"button\"\n data-testid=\"rename-button\"\n onClick={() => wrappedCallbacks?.handleOpenRenameModal(rl)}\n >\n {translations.actionRename}\n </Button>\n <Button\n variant=\"tertiary\"\n type=\"button\"\n data-testid=\"delete-button\"\n onClick={() => wrappedCallbacks?.handleOpenDeleteModal(rl)}\n >\n {translations.actionDeleteList}\n </Button>\n </div>\n ),\n };\n }),\n [\n reqLists?.items,\n translations.actionRename,\n translations.actionDeleteList,\n wrappedCallbacks,\n routeRequisitionListDetails,\n ]\n );\n\n return {\n rows,\n isLoading: isFetching || !reqLists,\n pageInfo: reqLists?.page_info,\n totalCount: reqLists?.total_count,\n handlePageChange,\n handlePageSizeChange,\n isAdding,\n handleAddNew,\n handleCancelCreate,\n };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useEffect, useState } from 'preact/compat';\nimport { state } from '@/requisitionList/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nfunction isRequisitionListEnabled(): boolean {\n const config = state.config;\n if (!config) return false;\n return (\n config.is_requisition_list_active === '1' &&\n config.company_enabled === true\n );\n}\n\nexport const useRequisitionListEnabled = () => {\n const [isEnabled, setIsEnabled] = useState<boolean>(isRequisitionListEnabled);\n\n useEffect(() => {\n // Listen for requisition list initialization via event bus\n const configListener = events.on('requisitionList/initialized', () => {\n // Only set false when config explicitly disables; if config is missing\n // (e.g. re-init race), preserve current value so the button doesn't disappear\n const enabled = isRequisitionListEnabled();\n setIsEnabled((prev) => (state.config != null ? enabled : prev));\n });\n\n return () => configListener?.off();\n }, []);\n\n return { isEnabled };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { HTMLAttributes, useState, useCallback } from 'preact/compat';\nimport { Header } from '@adobe-commerce/elsie/components';\nimport { Container, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { RequisitionList as RequisitionListModel } from '@/requisitionList/data/models/requisitionList';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport {\n RequisitionListGridWrapper,\n RequisitionListModal,\n RequisitionListForm,\n NotFound,\n} from '@/requisitionList/components';\nimport { useRequisitionListGrid } from '@/requisitionList/hooks/useRequisitionListGrid';\nimport { useRequisitionListEnabled } from '@/requisitionList/hooks/useRequisitionListEnabled';\nimport { deleteRequisitionList } from '@/requisitionList/api/deleteRequisitionList/deleteRequisitionList';\nimport { updateRequisitionList } from '@/requisitionList/api/updateRequisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface RequisitionListGridProps\n extends HTMLAttributes<HTMLDivElement> {\n routeRequisitionListDetails?: (uid: string) => string | void;\n /**\n * Fallback URL to redirect when requisition lists are not enabled.\n * Defaults to '/customer/account'\n */\n fallbackRoute?: string;\n slots?: {\n Header?: SlotProps;\n };\n}\n\nexport const RequisitionListGrid: Container<RequisitionListGridProps> = ({\n routeRequisitionListDetails,\n fallbackRoute = '/customer/account',\n slots,\n}: RequisitionListGridProps) => {\n const { isEnabled } = useRequisitionListEnabled();\n\n const [modal, setModal] = useState<{\n type: 'rename' | 'delete' | null;\n isOpen: boolean;\n isLoading: boolean;\n requisitionList: RequisitionListModel | null;\n }>({\n type: null,\n isOpen: false,\n isLoading: false,\n requisitionList: null,\n });\n\n const closeModal = useCallback(() => {\n setModal({\n type: null,\n isOpen: false,\n isLoading: false,\n requisitionList: null,\n });\n }, []);\n\n const handleOpenRenameModal = useCallback((rl: RequisitionListModel) => {\n setModal({\n type: 'rename',\n isOpen: true,\n isLoading: false,\n requisitionList: rl,\n });\n }, []);\n\n const handleOpenDeleteModal = useCallback((rl: RequisitionListModel) => {\n setModal({\n type: 'delete',\n isOpen: true,\n isLoading: false,\n requisitionList: rl,\n });\n }, []);\n\n const {\n rows,\n isLoading,\n pageInfo,\n totalCount,\n handlePageChange,\n handlePageSizeChange,\n isAdding,\n handleAddNew,\n handleCancelCreate,\n } = useRequisitionListGrid(\n { handleOpenRenameModal, handleOpenDeleteModal },\n routeRequisitionListDetails,\n closeModal\n );\n\n const handleRenameSubmit = useCallback(\n async (values: { name: string; description?: string }) => {\n /* istanbul ignore next: Defensive check - modal.requisitionList should always be set when this function is called */\n if (!modal.requisitionList) return;\n\n try {\n await updateRequisitionList(\n modal.requisitionList.uid,\n values.name,\n values.description\n );\n events.emit('requisitionList/alert', {\n action: 'update',\n type: 'success',\n context: 'requisitionList',\n });\n await handlePageChange();\n closeModal();\n } catch (error) {\n events.emit('requisitionList/alert', {\n action: 'update',\n type: 'error',\n context: 'requisitionList',\n });\n }\n },\n [modal.requisitionList, handlePageChange, closeModal]\n );\n\n const handleDeleteConfirm = async () => {\n /* istanbul ignore next: Defensive check - modal.requisitionList should always be set when this function is called */\n if (!modal.requisitionList) return;\n setModal({ ...modal, isLoading: true });\n await deleteRequisitionList(modal.requisitionList.uid)\n .then(async () => {\n events.emit('requisitionList/alert', {\n type: 'success',\n action: 'delete',\n context: 'requisitionList',\n });\n })\n .catch(() => {\n events.emit('requisitionList/alert', {\n type: 'error',\n action: 'delete',\n context: 'requisitionList',\n });\n })\n .finally(async () => {\n await handlePageChange();\n closeModal();\n });\n };\n\n const translations = useText({\n containerTitle: `RequisitionList.containerTitle`,\n updateTitle: `RequisitionList.RequisitionListForm.updateTitle`,\n deleteRequisitionListTitle:\n 'RequisitionList.RequisitionListWrapper.deleteRequisitionListTitle',\n deleteRequisitionListMessage:\n 'RequisitionList.RequisitionListWrapper.deleteRequisitionListMessage',\n cancelAction: 'RequisitionList.RequisitionListWrapper.cancelAction',\n confirmAction: 'RequisitionList.RequisitionListWrapper.confirmAction',\n notEnabledTitle: `RequisitionList.RequisitionListsNotEnabled.title`,\n notEnabledMessage: `RequisitionList.RequisitionListsNotEnabled.message`,\n notEnabledActionLabel: `RequisitionList.RequisitionListsNotEnabled.actionLabel`,\n });\n\n const getHeader = useCallback(() => {\n if (slots?.Header) {\n return (\n <Slot\n name=\"Header\"\n aria-label={translations.containerTitle}\n title={translations.containerTitle}\n slot={slots.Header}\n />\n );\n }\n return (\n <Header\n aria-label={translations.containerTitle}\n role=\"region\"\n title={translations.containerTitle}\n />\n );\n }, [slots, translations.containerTitle]);\n\n if (isEnabled === false) {\n return (\n <NotFound\n title={translations.notEnabledTitle}\n message={translations.notEnabledMessage}\n actionLabel={translations.notEnabledActionLabel}\n onAction={() => {\n window.location.href = fallbackRoute;\n }}\n />\n );\n }\n\n return (\n <>\n <RequisitionListGridWrapper\n header={getHeader()}\n rows={rows}\n skeletonRowCount={10}\n isLoading={isLoading}\n pageInfo={pageInfo}\n totalCount={totalCount}\n handlePageChange={handlePageChange}\n handlePageSizeChange={handlePageSizeChange}\n defaultPageSize={10}\n isAdding={isAdding}\n handleAddNew={handleAddNew}\n handleCancelCreate={handleCancelCreate}\n />\n\n {/* Rename Modal */}\n {modal.type === 'rename' && modal.isOpen && modal.requisitionList && (\n <RequisitionListModal\n isOpen={modal.isOpen}\n isLoading={modal.isLoading}\n title={translations.updateTitle}\n modalContent={\n <RequisitionListForm\n mode=\"update\"\n defaultValues={{\n name: modal.requisitionList.name,\n description: modal.requisitionList.description || '',\n }}\n onSubmit={handleRenameSubmit}\n onCancel={closeModal}\n />\n }\n handleModalOnClose={closeModal}\n />\n )}\n\n {/* Delete Confirmation Modal */}\n {modal.type === 'delete' && modal.isOpen && (\n <RequisitionListModal\n isOpen={modal.isOpen}\n isLoading={modal.isLoading}\n title={translations.deleteRequisitionListTitle}\n modalContent={translations.deleteRequisitionListMessage}\n confirmBtnCaption={translations.confirmAction}\n closeBtnCaption={translations.cancelAction}\n handleModalOnClose={closeModal}\n handleModalOnConfirm={handleDeleteConfirm}\n />\n )}\n </>\n );\n};\n","import * as React from \"react\";\nconst SvgAdd = (props) => /* @__PURE__ */ React.createElement(\"svg\", { id: \"Icon_Add_Base\", \"data-name\": \"Icon \\\\u2013 Add \\\\u2013 Base\", xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { id: \"Large\" }, /* @__PURE__ */ React.createElement(\"rect\", { id: \"Placement_area\", \"data-name\": \"Placement area\", width: 24, height: 24, fill: \"#fff\", opacity: 0 }), /* @__PURE__ */ React.createElement(\"g\", { id: \"Add_icon\", \"data-name\": \"Add icon\", transform: \"translate(9.734 9.737)\" }, /* @__PURE__ */ React.createElement(\"line\", { vectorEffect: \"non-scaling-stroke\", id: \"Line_579\", \"data-name\": \"Line 579\", y2: 12.7, transform: \"translate(2.216 -4.087)\", fill: \"none\", stroke: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"line\", { vectorEffect: \"non-scaling-stroke\", id: \"Line_580\", \"data-name\": \"Line 580\", x2: 12.7, transform: \"translate(-4.079 2.263)\", fill: \"none\", stroke: \"currentColor\" }))));\nexport default SvgAdd;\n","import * as React from \"react\";\nconst SvgCart = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { clipPath: \"url(#clip0_102_196)\" }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M18.3601 18.16H6.5601L4.8801 3H2.3501M19.6701 19.59C19.6701 20.3687 19.0388 21 18.2601 21C17.4814 21 16.8501 20.3687 16.8501 19.59C16.8501 18.8113 17.4814 18.18 18.2601 18.18C19.0388 18.18 19.6701 18.8113 19.6701 19.59ZM7.42986 19.59C7.42986 20.3687 6.79858 21 6.01986 21C5.24114 21 4.60986 20.3687 4.60986 19.59C4.60986 18.8113 5.24114 18.18 6.01986 18.18C6.79858 18.18 7.42986 18.8113 7.42986 19.59Z\", stroke: \"currentColor\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M5.25 6.37L20.89 8.06L20.14 14.8H6.19\", stroke: \"currentColor\", strokeLinejoin: \"round\" })), /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"clipPath\", { id: \"clip0_102_196\" }, /* @__PURE__ */ React.createElement(\"rect\", { vectorEffect: \"non-scaling-stroke\", width: 19.29, height: 19.5, fill: \"white\", transform: \"translate(2.3501 2.25)\" }))));\nexport default SvgCart;\n","import * as React from \"react\";\nconst SvgChevronDown = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"square\", strokeLinejoin: \"round\" }));\nexport default SvgChevronDown;\n","import * as React from \"react\";\nconst SvgList = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"rect\", { x: 4.89282, y: 2.75, width: 14.2143, height: 18.5, rx: 2.25, stroke: \"currentColor\", strokeWidth: 1 }), /* @__PURE__ */ React.createElement(\"line\", { x1: 9.85718, y1: 7.67871, x2: 16.2857, y2: 7.67871, stroke: \"currentColor\", strokeWidth: 1 }), /* @__PURE__ */ React.createElement(\"line\", { x1: 9.85718, y1: 11.9644, x2: 16.2857, y2: 11.9644, stroke: \"currentColor\", strokeWidth: 1 }), /* @__PURE__ */ React.createElement(\"line\", { x1: 9.85718, y1: 16.25, x2: 16.2857, y2: 16.25, stroke: \"currentColor\", strokeWidth: 1 }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 7.71429, cy: 7.71429, r: 0.714286, fill: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 7.71429, cy: 11.9999, r: 0.714286, fill: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 7.71429, cy: 16.2856, r: 0.714286, fill: \"currentColor\" }));\nexport default SvgList;\n","import * as React from \"react\";\nconst SvgMinus = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M17.3332 11.75H6.6665\", strokeWidth: 1, strokeLinecap: \"square\", strokeLinejoin: \"round\", vectorEffect: \"non-scaling-stroke\", fill: \"none\", stroke: \"currentColor\" }));\nexport default SvgMinus;\n","import * as React from \"react\";\nconst SvgSearch = (props) => /* @__PURE__ */ React.createElement(\"svg\", { id: \"Icon_Search_Base\", \"data-name\": \"Icon \\\\u2013 Search \\\\u2013 Base\", xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, fill: \"none\", viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { id: \"Large\" }, /* @__PURE__ */ React.createElement(\"rect\", { id: \"Placement_area\", \"data-name\": \"Placement area\", width: 24, height: 24, fill: \"#fff\", opacity: 0 }), /* @__PURE__ */ React.createElement(\"g\", { id: \"Search_icon\", \"data-name\": \"Search icon\", transform: \"translate(3.75 3.75)\" }, /* @__PURE__ */ React.createElement(\"circle\", { vectorEffect: \"non-scaling-stroke\", id: \"Ellipse_186\", \"data-name\": \"Ellipse 186\", cx: 6, cy: 6, r: 6, fill: \"none\", stroke: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"line\", { vectorEffect: \"non-scaling-stroke\", id: \"Line_556\", \"data-name\": \"Line 556\", x2: 6, y2: 6, transform: \"translate(10.5 10.5)\", fill: \"none\", stroke: \"currentColor\" }))));\nexport default SvgSearch;\n","import * as React from \"react\";\nconst SvgTrash = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M1 5H23\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M17.3674 22H6.63446C5.67952 22 4.88992 21.2688 4.8379 20.3338L4 5H20L19.1621 20.3338C19.1119 21.2688 18.3223 22 17.3655 22H17.3674Z\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M9.87189 2H14.1281C14.6085 2 15 2.39766 15 2.88889V5H9V2.88889C9 2.39912 9.39006 2 9.87189 2Z\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M8.87402 8.58057L9.39348 17.682\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M14.6673 8.58057L14.146 17.682\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }));\nexport default SvgTrash;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useEffect, useState } from 'preact/compat';\nimport {\n state,\n setRequisitionLists,\n setRequisitionListsLoading,\n updateRequisitionList,\n} from '@/requisitionList/lib/state';\nimport { getRequisitionLists } from '@/requisitionList/api';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nlet updateCounter = 0; // Counter to track updates across all hooks\n\nexport const useRequisitionLists = () => {\n const [lists, setLists] = useState<RequisitionList[]>(state.requisitionLists);\n const [loading, setLoading] = useState(state.requisitionListsLoading);\n const [lastUpdate, setLastUpdate] = useState(updateCounter);\n\n // Fetch lists if empty on mount\n useEffect(() => {\n if (state.requisitionLists.length === 0 && !state.requisitionListsLoading) {\n setRequisitionListsLoading(true);\n getRequisitionLists(1, 100)\n .then((res: { items: RequisitionList[] }) => {\n const newLists = res?.items || [];\n setRequisitionLists(newLists);\n updateCounter++;\n })\n .catch((error: any) => {\n console.error('Error fetching requisition lists:', error);\n setRequisitionLists([]);\n updateCounter++;\n })\n .finally(() => {\n setRequisitionListsLoading(false);\n });\n }\n }, []);\n\n // Listen to event bus updates\n useEffect(() => {\n const multiListListener = events.on(\n 'requisitionLists/data',\n (payload: RequisitionList[] | null) => {\n if (payload) {\n setRequisitionLists(payload);\n updateCounter++;\n setLastUpdate(updateCounter);\n setLists(state.requisitionLists);\n setLoading(state.requisitionListsLoading);\n }\n }\n );\n\n const singleListListener = events.on(\n 'requisitionList/data',\n (payload: RequisitionList | null) => {\n if (!payload) return;\n\n // Only the FIRST hook instance to receive this should update\n // Use the updateRequisitionList helper which handles both add and update\n updateRequisitionList(payload);\n updateCounter++;\n setLastUpdate(updateCounter);\n setLists([...state.requisitionLists]);\n setLoading(state.requisitionListsLoading);\n }\n );\n\n return () => {\n multiListListener?.off();\n singleListListener?.off();\n };\n }, []);\n\n // Sync with global state when it changes\n useEffect(() => {\n if (lastUpdate !== updateCounter) {\n setLists(state.requisitionLists);\n setLoading(state.requisitionListsLoading);\n setLastUpdate(updateCounter);\n }\n }, [lastUpdate]);\n\n return { lists, loading };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useCallback, useMemo, useState } from 'preact/compat';\nimport { RequisitionListActionPayload } from 'adobe-commerce/event-bus';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nexport interface Alert {\n type: string;\n description: string;\n action?: string;\n sku?: string;\n}\n\nexport function useRequisitionListAlert(\n translationsOverride?: Record<string, string>\n) {\n const [alert, setAlert] = useState<Alert | null>(null);\n\n const defaultTranslations = useText({\n errorCreate: `RequisitionList.RequisitionListAlert.errorCreate`,\n successCreate: `RequisitionList.RequisitionListAlert.successCreate`,\n errorDeleteItem: `RequisitionList.RequisitionListAlert.errorDeleteItem`,\n successDeleteItem: `RequisitionList.RequisitionListAlert.successDeleteItem`,\n errorDeleteReqList: `RequisitionList.RequisitionListAlert.errorDeleteReqList`,\n successDeleteReqList: `RequisitionList.RequisitionListAlert.successDeleteReqList`,\n errorAddToCart: `RequisitionList.RequisitionListAlert.errorAddToCart`,\n successAddToCart: `RequisitionList.RequisitionListAlert.successAddToCart`,\n errorUpdateQuantity: `RequisitionList.RequisitionListAlert.errorUpdateQuantity`,\n successUpdateQuantity: `RequisitionList.RequisitionListAlert.successUpdateQuantity`,\n errorUpdate: `RequisitionList.RequisitionListAlert.errorUpdate`,\n successUpdate: `RequisitionList.RequisitionListAlert.successUpdate`,\n errorMove: `RequisitionList.RequisitionListAlert.errorMove`,\n successMove: `RequisitionList.RequisitionListAlert.successMove`,\n errorAddToRequisitionList: `RequisitionList.RequisitionListAlert.errorAddToRequisitionList`,\n successAddToRequisitionList: `RequisitionList.RequisitionListAlert.successAddToRequisitionList`,\n errorMoveToList: `RequisitionList.RequisitionListAlert.errorMoveToList`,\n successMoveToList: `RequisitionList.RequisitionListAlert.successMoveToList`,\n errorCopyToList: `RequisitionList.RequisitionListAlert.errorCopyToList`,\n successCopyToList: `RequisitionList.RequisitionListAlert.successCopyToList`,\n errorImport: `RequisitionList.RequisitionListAlert.errorImport`,\n successImport: `RequisitionList.RequisitionListAlert.successImport`,\n });\n\n const translations = useMemo(\n () => ({\n ...defaultTranslations,\n ...translationsOverride,\n }),\n [defaultTranslations, translationsOverride]\n );\n\n const messages = useMemo(\n () => ({\n create: {\n // adding context for consistency, although 'create' action only applies to requisition lists\n requisitionList: {\n success: translations.successCreate,\n error: translations.errorCreate,\n },\n },\n add: {\n product: {\n success: translations.successAddToRequisitionList,\n error: translations.errorAddToRequisitionList,\n },\n },\n update: {\n product: {\n success: translations.successUpdateQuantity,\n error: translations.errorUpdateQuantity,\n },\n requisitionList: {\n success: translations.successUpdate,\n error: translations.errorUpdate,\n },\n },\n delete: {\n product: {\n success: translations.successDeleteItem,\n error: translations.errorDeleteItem,\n },\n requisitionList: {\n success: translations.successDeleteReqList,\n error: translations.errorDeleteReqList,\n },\n },\n move: {\n product: {\n success: translations.successMove,\n error: translations.errorMove,\n },\n },\n moveToList: {\n product: {\n success: translations.successMoveToList,\n error: translations.errorMoveToList,\n },\n },\n copyToList: {\n product: {\n success: translations.successCopyToList,\n error: translations.errorCopyToList,\n },\n },\n import: {\n requisitionList: {\n success: translations.successImport,\n error: translations.errorImport,\n },\n },\n }),\n [translations]\n );\n\n const handleRequisitionListAlert = useCallback(\n (payload: RequisitionListActionPayload) => {\n const { type, action, context, skus, message, listName } = payload;\n // Use custom message if provided, otherwise use predefined message\n let description =\n message && message.length > 0\n ? message.join('. ')\n : messages[action][context][type];\n // Substitute named placeholders (e.g. {listName})\n if (listName) {\n description = description.replace('{listName}', listName);\n }\n setAlert({\n type,\n description,\n sku: skus?.[0],\n });\n\n const timer = setTimeout(() => {\n setAlert(null);\n }, 5000);\n\n return () => clearTimeout(timer);\n },\n [messages]\n );\n\n return { alert, setAlert, handleRequisitionListAlert };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useState, useCallback } from 'preact/hooks';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\n\ntype UseRequisitionListSelectedItems = {\n currentRequisitionList: RequisitionList | null;\n setCurrentRequisitionList: (\n value:\n | RequisitionList\n | null\n | ((prev: RequisitionList | null) => RequisitionList | null)\n ) => void;\n selectedItems: Set<string>;\n setSelectedItems: (\n value: Set<string> | ((prev: Set<string>) => Set<string>)\n ) => void;\n handleItemSelection: (itemUid: string, isSelected: boolean) => void;\n handleSelectAll: () => void;\n handleSelectNone: () => void;\n};\n\nexport function useRequisitionListSelectedItems(): UseRequisitionListSelectedItems {\n const [currentRequisitionList, setCurrentRequisitionList] =\n useState<RequisitionList | null>(null);\n const [selectedItems, setSelectedItems] = useState<Set<string>>(new Set());\n\n const handleItemSelection = useCallback(\n (itemUid: string, isSelected: boolean) => {\n setSelectedItems((prev: Set<string>) => {\n const newSet = new Set(prev);\n if (isSelected) {\n newSet.add(itemUid);\n } else {\n newSet.delete(itemUid);\n }\n return newSet;\n });\n },\n []\n );\n\n const handleSelectAll = useCallback(() => {\n const allItemUids = currentRequisitionList?.items?.map(\n (item: Item) => item.uid\n );\n setSelectedItems(new Set(allItemUids));\n }, [currentRequisitionList]);\n\n const handleSelectNone = useCallback(() => {\n setSelectedItems(new Set());\n }, []);\n\n return {\n currentRequisitionList,\n setCurrentRequisitionList,\n selectedItems,\n setSelectedItems,\n handleItemSelection,\n handleSelectAll,\n handleSelectNone,\n };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useCallback, useState } from 'preact/compat';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { RequisitionListActionPayload } from 'adobe-commerce/event-bus';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { moveItemsBetweenRequisitionLists } from '@/requisitionList/api/moveItemsBetweenRequisitionLists';\nimport { copyItemsBetweenRequisitionLists } from '@/requisitionList/api/copyItemsBetweenRequisitionLists';\n\nexport interface UseRequisitionListTransferOptions {\n sourceListUid: string;\n selectedItems: Set<string>;\n currentPageSize: number;\n currentPage: number;\n enrichConfigurableProductsInList: (\n list: RequisitionList\n ) => Promise<RequisitionList>;\n fetchAndMergeProducts: (\n list: RequisitionList\n ) => Promise<RequisitionList>;\n setCurrentRequisitionList: (list: RequisitionList) => void;\n setSelectedItems: (items: Set<string>) => void;\n handleRequisitionListAlert: (\n payload: RequisitionListActionPayload\n ) => void;\n}\n\nexport function useRequisitionListTransfer({\n sourceListUid,\n selectedItems,\n currentPageSize,\n currentPage,\n enrichConfigurableProductsInList,\n fetchAndMergeProducts,\n setCurrentRequisitionList,\n setSelectedItems,\n handleRequisitionListAlert,\n}: UseRequisitionListTransferOptions) {\n const [showMoveToListModal, setShowMoveToListModal] = useState(false);\n const [movingToList, setMovingToList] = useState(false);\n const [showCopyToListModal, setShowCopyToListModal] = useState(false);\n const [copyingToList, setCopyingToList] = useState(false);\n\n const translations = useText({\n successMoveToList: `RequisitionList.RequisitionListAlert.successMoveToList`,\n successCopyToList: `RequisitionList.RequisitionListAlert.successCopyToList`,\n });\n\n const handleMoveToList = useCallback(\n async (destinationListUid: string) => {\n if (selectedItems.size === 0) return;\n\n setMovingToList(true);\n\n try {\n const result = await moveItemsBetweenRequisitionLists(\n sourceListUid,\n destinationListUid,\n Array.from(selectedItems),\n currentPageSize,\n currentPage\n );\n\n if (result?.sourceList) {\n const enrichedWithConfigurable =\n await enrichConfigurableProductsInList(result.sourceList);\n const enrichedList =\n await fetchAndMergeProducts(enrichedWithConfigurable);\n setCurrentRequisitionList(enrichedList);\n setSelectedItems(new Set());\n\n const listName = result.destinationList?.name || '';\n handleRequisitionListAlert({\n action: 'moveToList',\n type: 'success',\n context: 'product',\n message: [\n translations.successMoveToList.replace('{listName}', listName),\n ],\n });\n } else {\n handleRequisitionListAlert({\n action: 'moveToList',\n type: 'error',\n context: 'product',\n });\n }\n } catch {\n handleRequisitionListAlert({\n action: 'moveToList',\n type: 'error',\n context: 'product',\n });\n } finally {\n setMovingToList(false);\n setShowMoveToListModal(false);\n }\n },\n [\n selectedItems,\n sourceListUid,\n currentPageSize,\n currentPage,\n enrichConfigurableProductsInList,\n fetchAndMergeProducts,\n setCurrentRequisitionList,\n setSelectedItems,\n handleRequisitionListAlert,\n translations.successMoveToList,\n ]\n );\n\n const handleCopyToList = useCallback(\n async (destinationListUid: string) => {\n if (selectedItems.size === 0) return;\n\n setCopyingToList(true);\n\n try {\n const result = await copyItemsBetweenRequisitionLists(\n sourceListUid,\n destinationListUid,\n Array.from(selectedItems)\n );\n\n if (result?.destinationList) {\n setSelectedItems(new Set());\n\n const listName = result.destinationList.name || '';\n handleRequisitionListAlert({\n action: 'copyToList',\n type: 'success',\n context: 'product',\n message: [\n translations.successCopyToList.replace('{listName}', listName),\n ],\n });\n } else {\n handleRequisitionListAlert({\n action: 'copyToList',\n type: 'error',\n context: 'product',\n });\n }\n } catch {\n handleRequisitionListAlert({\n action: 'copyToList',\n type: 'error',\n context: 'product',\n });\n } finally {\n setCopyingToList(false);\n setShowCopyToListModal(false);\n }\n },\n [\n selectedItems,\n sourceListUid,\n setSelectedItems,\n handleRequisitionListAlert,\n translations.successCopyToList,\n ]\n );\n\n return {\n showMoveToListModal,\n setShowMoveToListModal,\n movingToList,\n showCopyToListModal,\n setShowCopyToListModal,\n copyingToList,\n handleMoveToList,\n handleCopyToList,\n };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Item } from '@/requisitionList/data/models/item';\n\nexport interface ProductLike {\n sku: string;\n selectedOptions?: string[];\n}\n\n/**\n * Compares a requisition list item to the current product context (sku + selected options).\n * Used to determine if the product is already in a requisition list for active state.\n * Default: only SKU is compared. Option UIDs are compared only when options.matchBySkuOnly is false.\n */\nexport function isMatchingRequisitionListItem(\n requisitionListItem: Item,\n product: ProductLike,\n options?: { matchBySkuOnly?: boolean }\n): boolean {\n const itemSku = requisitionListItem.sku ?? requisitionListItem.product?.sku;\n if (!itemSku || itemSku !== product.sku) {\n return false;\n }\n\n // Default: match by SKU only. Only compare option UIDs when matchBySkuOnly is explicitly false.\n if (options?.matchBySkuOnly !== false) return true;\n\n // Extract without sorting first to allow an early exit\n const itemOptionUids = (requisitionListItem.configurable_options ?? [])\n .map((opt) => opt.value_uid)\n .filter((uid): uid is string => !!uid);\n\n const productOptionUids = (product.selectedOptions ?? [])\n .filter((uid): uid is string => !!uid);\n\n // Early return if they don't have the same number of options\n if (itemOptionUids.length !== productOptionUids.length) {\n return false;\n }\n\n // Sort only after we know lengths match\n itemOptionUids.sort();\n productOptionUids.sort();\n\n // Compare element by element\n return itemOptionUids.every((uid, index) => uid === productOptionUids[index]);\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n HTMLAttributes,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'preact/compat';\nimport { events } from '@adobe-commerce/event-bus';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { RequisitionList } from '../../data/models/requisitionList.js';\nimport { Item } from '@/requisitionList/data/models/item';\nimport {\n Button,\n Card,\n Icon,\n InLineAlert,\n} from '@adobe-commerce/elsie/components';\nimport { addProductsToRequisitionList } from '@/requisitionList/api/addProductsToRequisitionList/addProductsToRequisitionList';\nimport {\n EmptyList,\n RequisitionListModal,\n RequisitionListActions,\n RequisitionListPicker,\n} from '@/requisitionList/components';\nimport { RequisitionListForm } from '@/requisitionList/containers';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { ChevronDown, List } from '@adobe-commerce/elsie/icons';\nimport '@/requisitionList/containers/RequisitionListSelector/RequisitionListSelector.css';\nimport {\n useRequisitionLists,\n useRequisitionListAlert,\n useRequisitionListEnabled,\n} from '@/requisitionList/hooks';\nimport { isMatchingRequisitionListItem } from '@/requisitionList/lib/requisition-list-item-comparator';\nimport { getRequisitionListsFromState } from '@/requisitionList/lib/state';\n\nexport interface RequisitionListSelectorProps\n extends HTMLAttributes<HTMLDivElement> {\n canCreate?: boolean;\n sku: string;\n selectedOptions?: string[];\n quantity?: number;\n matchBySKU?: boolean;\n beforeAddProdToReqList?: () => Promise<void> | void;\n}\n\nexport const RequisitionListSelector: Container<\n RequisitionListSelectorProps\n> = ({\n canCreate = true,\n sku,\n selectedOptions,\n quantity = 1,\n matchBySKU,\n beforeAddProdToReqList,\n}: RequisitionListSelectorProps) => {\n const translations = useText({\n createTitle: `RequisitionList.RequisitionListForm.createTitle`,\n addToRequisitionList: `RequisitionList.RequisitionListForm.addToRequisitionList`,\n emptyList: `RequisitionList.RequisitionListWrapper.emptyList`,\n addToNewRequisitionList: `RequisitionList.RequisitionListSelector.addToNewRequisitionList`,\n addToSelected: `RequisitionList.RequisitionListSelector.addToSelected`,\n });\n const [isAdding, setIsAdding] = useState(false);\n const { lists } = useRequisitionLists();\n const { isEnabled } = useRequisitionListEnabled();\n\n // Keep lists in sync with event bus so active state updates in real time (e.g. when\n // another part of the page adds/removes this product from a list). Mirrors WishlistToggle.\n const [listsFromEvents, setListsFromEvents] = useState<RequisitionList[] | null>(\n null\n );\n\n useEffect(() => {\n const onRequisitionListsData = (payload: RequisitionList[] | null) => {\n if (payload) setListsFromEvents(payload);\n };\n const onRequisitionListData = (payload: RequisitionList | null) => {\n if (!payload) return;\n setListsFromEvents((prev) => {\n const currentLists = prev ?? getRequisitionListsFromState();\n const existingIndex = currentLists.findIndex(\n (list) => list.uid === payload!.uid\n );\n if (existingIndex >= 0) {\n return currentLists.map((list, i) =>\n i === existingIndex ? payload! : list\n );\n }\n return [...currentLists, payload];\n });\n };\n\n const unsubMulti = events.on('requisitionLists/data', onRequisitionListsData);\n const unsubSingle = events.on('requisitionList/data', onRequisitionListData);\n\n return () => {\n unsubMulti?.off();\n unsubSingle?.off();\n };\n }, []);\n\n const listsForActiveCheck = listsFromEvents ?? lists;\n\n const isInRequisitionList = useMemo(() => {\n if (!listsForActiveCheck?.length) return false;\n const productContext = { sku, selectedOptions };\n return listsForActiveCheck.some((list: RequisitionList) =>\n list.items?.some((item: Item) =>\n isMatchingRequisitionListItem(item, productContext, {\n matchBySkuOnly: matchBySKU,\n })\n )\n );\n }, [listsForActiveCheck, sku, selectedOptions, matchBySKU]);\n\n const { alert, setAlert, handleRequisitionListAlert } =\n useRequisitionListAlert();\n\n const [modal, setModal] = useState<{\n isOpen: boolean;\n isLoading: boolean;\n }>({\n isOpen: false,\n isLoading: false,\n });\n\n const handleOpenModal = useCallback(() => {\n setModal({ isOpen: true, isLoading: false });\n }, []);\n\n const handleCloseModal = useCallback(() => {\n setModal({ isOpen: false, isLoading: false });\n setIsAdding(false);\n setAlert(null);\n }, [setAlert]);\n\n const handleAddProdToReqList = useCallback(\n async (requisitionListUid: string) => {\n try {\n // Build the object dynamically, omitting selected_options if not present\n const itemToAdd = {\n sku,\n quantity,\n ...(selectedOptions && selectedOptions.length > 0\n ? { selected_options: selectedOptions }\n : {}),\n };\n\n await addProductsToRequisitionList(requisitionListUid, [itemToAdd]);\n } catch (error) {\n console.error('Error adding product to list:', error);\n throw error;\n }\n },\n [sku, quantity, selectedOptions]\n );\n\n const handleAddProductAndEmitAlert = useCallback(\n async (requisitionListUid: string) => {\n try {\n await handleAddProdToReqList(requisitionListUid);\n\n handleRequisitionListAlert({\n action: 'add',\n type: 'success',\n context: 'product',\n skus: [sku],\n });\n } catch {\n handleRequisitionListAlert({\n action: 'add',\n type: 'error',\n context: 'product',\n skus: [sku],\n });\n } finally {\n setTimeout(() => {\n handleCloseModal();\n }, 2000);\n }\n },\n [sku, handleAddProdToReqList, handleCloseModal, handleRequisitionListAlert]\n );\n\n const handleOpenModalWithValidation = useCallback(() => {\n if (!beforeAddProdToReqList) {\n handleOpenModal();\n return;\n }\n\n Promise.resolve(beforeAddProdToReqList())\n .then(() => {\n handleOpenModal();\n })\n .catch(() => {\n // Validation failed - don't open modal\n });\n }, [beforeAddProdToReqList, handleOpenModal]);\n\n const selectReqListSection =\n lists?.length > 0 ? (\n isAdding ? (\n <button\n type=\"button\"\n aria-label=\"Select a requisition list\"\n role=\"button\"\n className=\"requisition-list-actions\"\n data-testid=\"requisition-list-actions-button\"\n onClick={() => setIsAdding(false)}\n >\n <span\n className=\"requisition-list-actions__title\"\n data-testid=\"requisition-list-actions-button-text\"\n >\n {translations.addToRequisitionList}\n </span>\n <Icon source={ChevronDown} size=\"32\" />\n </button>\n ) : (\n <RequisitionListPicker\n confirmLabel={translations.addToSelected}\n onConfirm={handleAddProductAndEmitAlert}\n />\n )\n ) : (\n <EmptyList textContent={translations.emptyList} />\n );\n\n const createReqListSection = !isAdding ? (\n <RequisitionListActions\n onAddNew={() => {\n setIsAdding(true);\n }}\n />\n ) : (\n <Card variant=\"secondary\">\n <RequisitionListForm\n mode=\"create\"\n onSuccess={async (newList: RequisitionList) => {\n await handleAddProductAndEmitAlert(newList.uid);\n }}\n onError={() => {\n handleRequisitionListAlert({\n action: 'add',\n type: 'error',\n context: 'product',\n skus: [sku],\n });\n }}\n onCancel={() => {\n setIsAdding(false);\n }}\n />\n </Card>\n );\n\n const modalContent = (\n <>\n {alert && (\n <div className=\"requisition-list__alert-wrapper\">\n <InLineAlert\n key={`requisition-list-selector__alert__${sku}`}\n id={`requisition-list-selector__alert__${sku}`}\n heading={alert.description}\n type={alert.type}\n variant=\"primary\"\n className=\"requisition-list-selector__alert\"\n />\n </div>\n )}\n {!alert && (\n <>\n {selectReqListSection}\n {canCreate && createReqListSection}\n </>\n )}\n </>\n );\n\n // Early return after all hooks have been called\n if (isEnabled === null || !isEnabled) {\n return null;\n }\n\n return (\n <div className=\"requisition-list-selector\">\n <Button\n active={isInRequisitionList}\n activeIcon={<Icon source={List} />} // Change icon here for active state, (filled in icon for example)\n aria-label={translations.addToRequisitionList}\n className={isInRequisitionList ? 'requisition-list-selector--active' : undefined}\n data-testid=\"requisition-list-selector\"\n size=\"medium\"\n variant=\"tertiary\"\n icon={<Icon source={List} />}\n onClick={handleOpenModalWithValidation}\n />\n {modal.isOpen && (\n <RequisitionListModal\n isOpen\n isLoading={modal.isLoading}\n title={translations.addToRequisitionList}\n modalContent={modalContent}\n handleModalOnClose={handleCloseModal}\n />\n )}\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport '@/requisitionList/components/RequisitionListHeader/RequisitionListHeader.css';\n\nexport interface RequisitionListHeaderProps\n extends HTMLAttributes<HTMLDivElement> {\n name: string;\n description?: string;\n backLink?: {\n url: string;\n label: string;\n onClick?: (e: Event) => void;\n };\n actions?: {\n onRename?: () => void;\n onDelete?: () => void;\n onShare?: () => void;\n renameLabel?: string;\n deleteLabel?: string;\n shareLabel?: string;\n shareDisabled?: boolean;\n shareDisabledReason?: string;\n };\n}\n\nexport const RequisitionListHeader: FunctionComponent<\n RequisitionListHeaderProps\n> = ({ name, description, backLink, actions, className, ...props }) => {\n return (\n <div {...props} className={`requisition-list-header ${className || ''}`}>\n {/* Back Link */}\n {backLink && (\n <div className=\"requisition-list-header__back\">\n <a\n href={backLink.url}\n className=\"requisition-list-header__back-link\"\n onClick={backLink.onClick}\n >\n <span className=\"requisition-list-header__back-arrow\">&lt;</span>\n {backLink.label}\n </a>\n </div>\n )}\n\n {/* Title and Actions Row */}\n <div className=\"requisition-list-header__main\">\n <div className=\"requisition-list-header__title-section\">\n <h1 className=\"requisition-list-header__title\">{name}</h1>\n {description && (\n <p className=\"requisition-list-header__description\">\n {description}\n </p>\n )}\n </div>\n\n {/* Action Links */}\n {actions &&\n (actions.onRename ||\n actions.onDelete ||\n actions.onShare ||\n actions.shareDisabled) && (\n <div className=\"requisition-list-header__actions\">\n {(actions.onShare || actions.shareDisabled) && (\n <a\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n if (actions.shareDisabled) {\n return;\n }\n actions.onShare?.();\n }}\n className={`requisition-list-header__action-link ${\n actions.shareDisabled\n ? 'requisition-list-header__action-link--disabled'\n : ''\n }`}\n data-testid=\"share-list-btn\"\n aria-disabled={actions.shareDisabled ? 'true' : 'false'}\n aria-label={\n actions.shareDisabled && actions.shareDisabledReason\n ? `${actions.shareLabel} – ${actions.shareDisabledReason}`\n : undefined\n }\n data-disabled-reason={\n actions.shareDisabled\n ? actions.shareDisabledReason\n : undefined\n }\n >\n {actions.shareLabel}\n </a>\n )}\n {actions.onRename && (\n <a\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n actions.onRename?.();\n }}\n className=\"requisition-list-header__action-link\"\n data-testid=\"rename-list-btn\"\n >\n {actions.renameLabel}\n </a>\n )}\n {actions.onDelete && (\n <a\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n actions.onDelete?.();\n }}\n className=\"requisition-list-header__action-link\"\n data-testid=\"delete-list-btn\"\n >\n {actions.deleteLabel}\n </a>\n )}\n </div>\n )}\n </div>\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { FunctionComponent, VNode } from 'preact';\nimport {\n Modal,\n Button,\n ProgressSpinner,\n} from '@adobe-commerce/elsie/components';\nimport '@/requisitionList/components/RequisitionListModal/RequisitionListModal.css';\n\nexport interface RequisitionListModalProps {\n isOpen: boolean;\n isLoading: boolean;\n title: VNode | string;\n modalContent: VNode | string;\n closeBtnCaption?: string;\n confirmBtnCaption?: string;\n handleModalOnClose?: () => void;\n handleModalOnConfirm?: () => void;\n}\n\nexport const RequisitionListModal: FunctionComponent<\n RequisitionListModalProps\n> = ({\n isOpen,\n isLoading,\n title,\n modalContent,\n closeBtnCaption,\n confirmBtnCaption,\n handleModalOnClose,\n handleModalOnConfirm,\n}) => {\n if (!isOpen) return null;\n\n return (\n <Modal\n className=\"requisition-list-modal--overlay\"\n data-testid=\"requisition-list-modal\"\n size={'medium'}\n centered={false}\n title={title}\n onClose={handleModalOnClose}\n backgroundDim={true}\n clickToDismiss={true}\n escapeToDismiss={true}\n role=\"dialog\"\n aria-label={title}\n >\n <div className=\"requisition-list-modal\">\n {isLoading ? (\n <div\n className=\"requisition-list-modal__spinner\"\n data-testid=\"progress-spinner\"\n >\n <ProgressSpinner stroke={'4'} size={'large'} />\n </div>\n ) : null}\n <p>{modalContent}</p>\n <div className=\"requisition-list-modal__buttons\">\n {handleModalOnClose && closeBtnCaption && (\n <Button\n data-testid=\"rl-modal-close-button\"\n type={'button'}\n onClick={handleModalOnClose}\n variant=\"secondary\"\n disabled={isLoading}\n >\n {closeBtnCaption}\n </Button>\n )}\n {handleModalOnConfirm && confirmBtnCaption && (\n <Button\n data-testid=\"rl-modal-confirm-button\"\n type={'button'}\n onClick={handleModalOnConfirm}\n disabled={isLoading}\n >\n {confirmBtnCaption}\n </Button>\n )}\n </div>\n </div>\n </Modal>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useState, useCallback } from 'preact/hooks';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { RequisitionListHeader as RequisitionListHeaderComponent } from '@/requisitionList/components/RequisitionListHeader/RequisitionListHeader';\nimport { RequisitionListForm } from '@/requisitionList/components/RequisitionListForm/RequisitionListForm';\nimport { RequisitionListModal } from '@/requisitionList/components/RequisitionListModal/RequisitionListModal';\nimport { updateRequisitionList } from '@/requisitionList/api/updateRequisitionList';\nimport { deleteRequisitionList } from '@/requisitionList/api/deleteRequisitionList';\nimport {\n shareRequisitionListByEmail,\n ShareRequisitionListByEmailError,\n} from '@/requisitionList/api/shareRequisitionListByEmail';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { ShareRequisitionListContent } from '@/requisitionList/containers/ShareRequisitionListContent';\nimport { state } from '@/requisitionList/lib/state';\n\nexport interface RequisitionListHeaderProps {\n requisitionList: RequisitionList;\n routeRequisitionListGrid?: () => string | void;\n onUpdate?: (updatedList: RequisitionList) => void | Promise<void>;\n onAlert?: (payload: {\n action: string;\n type: string;\n context: string;\n }) => void;\n enrichConfigurableProducts?: (items: Item[]) => Promise<Item[]>;\n currentCustomerEmail?: string;\n routeSharedRequisitionList?: (token: string) => string;\n}\n\nexport const RequisitionListHeader: Container<RequisitionListHeaderProps> = ({\n requisitionList,\n routeRequisitionListGrid,\n onUpdate,\n onAlert,\n enrichConfigurableProducts,\n currentCustomerEmail,\n routeSharedRequisitionList,\n}: RequisitionListHeaderProps) => {\n const [showRenameModal, setShowRenameModal] = useState<boolean>(false);\n const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false);\n const [showShareModal, setShowShareModal] = useState<boolean>(false);\n const [isDeleting, setIsDeleting] = useState<boolean>(false);\n const [isSharing, setIsSharing] = useState<boolean>(false);\n const sharingConfigValue = state.config?.requisition_list_sharing_enabled;\n const isShareEnabled =\n sharingConfigValue !== false && sharingConfigValue !== '0';\n const itemsCount = Number(\n requisitionList.items_count ?? requisitionList.items?.length ?? 0\n );\n const isShareDisabled = itemsCount <= 0 || !state.isCompanyUser;\n\n const translations = useText({\n actionBackToRequisitionLists: `RequisitionList.RequisitionListView.actionBackToRequisitionLists`,\n actionRename: `RequisitionList.RequisitionListView.actionRename`,\n actionDeleteList: `RequisitionList.RequisitionListView.actionDeleteList`,\n actionShare: `RequisitionList.RequisitionListView.actionShare`,\n shareDisabledReason: `RequisitionList.RequisitionListView.shareDisabledReason`,\n shareDisabledNoCompany: `RequisitionList.RequisitionListView.shareDisabledNoCompany`,\n shareListTitle: `RequisitionList.RequisitionListView.shareListTitle`,\n deleteListTitle: `RequisitionList.RequisitionListView.deleteListTitle`,\n deleteListMessage: `RequisitionList.RequisitionListView.deleteListMessage`,\n confirmAction: `RequisitionList.RequisitionListWrapper.confirmAction`,\n cancelAction: `RequisitionList.RequisitionListWrapper.cancelAction`,\n updateTitle: `RequisitionList.RequisitionListForm.updateTitle`,\n });\n\n const handleRename = useCallback(() => {\n setShowRenameModal(true);\n }, []);\n\n const handleRenameSubmit = useCallback(\n async (values: { name: string; description?: string }) => {\n try {\n const updatedList = await updateRequisitionList(\n requisitionList.uid,\n values.name,\n values.description,\n requisitionList.page_info?.page_size,\n requisitionList.page_info?.current_page,\n enrichConfigurableProducts\n );\n if (updatedList) {\n onUpdate?.(updatedList);\n setShowRenameModal(false);\n onAlert?.({\n action: 'update',\n type: 'success',\n context: 'requisitionList',\n });\n } else {\n onAlert?.({\n action: 'update',\n type: 'error',\n context: 'requisitionList',\n });\n }\n } catch (error) {\n onAlert?.({\n action: 'update',\n type: 'error',\n context: 'requisitionList',\n });\n }\n },\n [\n requisitionList.uid,\n requisitionList.page_info,\n onUpdate,\n onAlert,\n enrichConfigurableProducts,\n ]\n );\n\n const handleDeleteList = useCallback(() => {\n setShowDeleteModal(true);\n }, []);\n\n const handleDeleteConfirm = useCallback(async () => {\n setIsDeleting(true);\n try {\n const result = await deleteRequisitionList(requisitionList.uid);\n if (result) {\n const alertPayload = {\n action: 'delete',\n type: 'success',\n context: 'requisitionList',\n };\n\n // Store alert in localStorage before redirecting\n // This ensures the alert is shown after redirect to grid view\n try {\n localStorage.setItem(\n 'requisitionListPendingAlert',\n JSON.stringify(alertPayload)\n );\n } catch (e) {\n // Ignore localStorage errors (e.g., in private browsing mode)\n }\n\n if (routeRequisitionListGrid) {\n const url = routeRequisitionListGrid();\n // If a URL is returned, navigate to it\n if (url && typeof url === 'string') {\n window.location.href = url;\n }\n }\n } else {\n onAlert?.({\n action: 'delete',\n type: 'error',\n context: 'requisitionList',\n });\n }\n } catch (error) {\n onAlert?.({\n action: 'delete',\n type: 'error',\n context: 'requisitionList',\n });\n } finally {\n setIsDeleting(false);\n setShowDeleteModal(false);\n }\n }, [requisitionList.uid, routeRequisitionListGrid, onAlert]);\n\n const handleShare = useCallback(() => {\n setShowShareModal(true);\n }, []);\n\n const handleShareSubmit = useCallback(\n async (\n customerUids: string[]\n ): Promise<Array<ShareRequisitionListByEmailError> | null> => {\n setIsSharing(true);\n try {\n const errors = await shareRequisitionListByEmail(\n requisitionList.uid,\n customerUids\n );\n return errors;\n } catch {\n return [{ code: 'SHARE_FAILED', message: 'Unable to share list.' }];\n } finally {\n setIsSharing(false);\n }\n },\n [requisitionList.uid]\n );\n\n return (\n <>\n <RequisitionListHeaderComponent\n name={requisitionList.name}\n description={requisitionList.description}\n backLink={\n routeRequisitionListGrid\n ? {\n url: '#',\n label: translations.actionBackToRequisitionLists,\n onClick: (e: Event) => {\n e.preventDefault();\n const result = routeRequisitionListGrid();\n // If a URL is returned, navigate to it\n if (result && typeof result === 'string') {\n window.location.href = result;\n }\n },\n }\n : undefined\n }\n actions={{\n onRename: handleRename,\n onDelete: handleDeleteList,\n onShare: isShareEnabled && !isShareDisabled ? handleShare : undefined,\n renameLabel: translations.actionRename,\n deleteLabel: translations.actionDeleteList,\n shareLabel: isShareEnabled ? translations.actionShare : undefined,\n shareDisabled: isShareEnabled && isShareDisabled,\n shareDisabledReason:\n isShareEnabled && isShareDisabled\n ? itemsCount <= 0\n ? translations.shareDisabledReason\n : translations.shareDisabledNoCompany\n : undefined,\n }}\n />\n\n {/* Rename Modal */}\n {showRenameModal && (\n <RequisitionListModal\n isOpen={showRenameModal}\n isLoading={false}\n title={translations.updateTitle}\n modalContent={\n <RequisitionListForm\n mode=\"update\"\n defaultValues={{\n name: requisitionList.name,\n description: requisitionList.description || '',\n }}\n onSubmit={handleRenameSubmit}\n onCancel={() => setShowRenameModal(false)}\n />\n }\n handleModalOnClose={() => setShowRenameModal(false)}\n />\n )}\n\n {/* Delete Confirmation Modal */}\n {showDeleteModal && (\n <RequisitionListModal\n isOpen={showDeleteModal}\n isLoading={isDeleting}\n title={translations.deleteListTitle}\n modalContent={translations.deleteListMessage}\n confirmBtnCaption={translations.confirmAction}\n closeBtnCaption={translations.cancelAction}\n handleModalOnClose={() => setShowDeleteModal(false)}\n handleModalOnConfirm={handleDeleteConfirm}\n />\n )}\n\n {/* Share Modal */}\n {isShareEnabled && showShareModal && (\n <RequisitionListModal\n isOpen={showShareModal}\n isLoading={isSharing}\n title={translations.shareListTitle}\n modalContent={\n <ShareRequisitionListContent\n requisitionListUid={requisitionList.uid}\n isSubmitting={isSharing}\n onSubmit={handleShareSubmit}\n currentCustomerEmail={currentCustomerEmail}\n routeSharedRequisitionList={routeSharedRequisitionList}\n />\n }\n handleModalOnClose={() => setShowShareModal(false)}\n />\n )}\n </>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { HTMLAttributes, useEffect } from 'preact/compat';\nimport { FunctionComponent, VNode } from 'preact';\nimport { VComponent, classes } from '@adobe-commerce/elsie/lib';\nimport {\n RequisitionListActions,\n EmptyList,\n PageSizePicker,\n PaginationItemsCounter,\n} from '@/requisitionList/components';\nimport { RequisitionListForm } from '@/requisitionList/containers';\nimport {\n Pagination,\n Card,\n Table,\n InLineAlert,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport '@/requisitionList/components/RequisitionListGridWrapper/RequisitionListGridWrapper.css';\nimport { useRequisitionListAlert } from '@/requisitionList/hooks';\n\nexport interface RequisitionListGridWrapperProps\n extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n isLoading?: boolean;\n header?: VNode;\n rows: Array<Record<string, VNode | string | number | undefined>>;\n skeletonRowCount: number;\n pageInfo?: {\n total_pages?: number;\n current_page?: number;\n page_size?: number;\n };\n totalCount?: number;\n handlePageChange: (page?: number) => Promise<void>;\n handlePageSizeChange?: (pageSize: number) => Promise<void>;\n defaultPageSize?: number;\n isAdding: boolean;\n handleAddNew: () => void;\n handleCancelCreate: () => void;\n}\n\nexport const RequisitionListGridWrapper: FunctionComponent<\n RequisitionListGridWrapperProps\n> = ({\n className,\n isLoading = false,\n header,\n rows = [],\n skeletonRowCount = 10,\n pageInfo,\n totalCount = 0,\n handlePageChange,\n handlePageSizeChange,\n defaultPageSize = 10,\n isAdding,\n handleAddNew,\n handleCancelCreate,\n ...props\n}) => {\n const translations = useText({\n name: `RequisitionList.RequisitionListWrapper.name`,\n itemsCount: `RequisitionList.RequisitionListWrapper.itemsCount`,\n lastUpdated: `RequisitionList.RequisitionListWrapper.lastUpdated`,\n actions: `RequisitionList.RequisitionListWrapper.actions`,\n emptyList: `RequisitionList.RequisitionListWrapper.emptyList`,\n show: `RequisitionList.PageSizePicker.show`,\n });\n\n const hasAnyItems = (pageInfo?.total_pages ?? 0) > 0;\n const showEmptyList = !isLoading && rows.length === 0 && !hasAnyItems;\n\n const { alert, setAlert, handleRequisitionListAlert } =\n useRequisitionListAlert();\n\n useEffect(() => {\n const alertEvent = events.on(\n 'requisitionList/alert',\n handleRequisitionListAlert\n );\n\n // Check for pending alert in localStorage (e.g., after redirect from deletion)\n try {\n const pendingAlert = localStorage.getItem('requisitionListPendingAlert');\n if (pendingAlert) {\n const alertPayload = JSON.parse(pendingAlert);\n handleRequisitionListAlert(alertPayload);\n localStorage.removeItem('requisitionListPendingAlert');\n }\n } catch (e) {\n // Ignore localStorage errors (e.g., in private browsing mode)\n }\n\n return () => {\n alertEvent?.off();\n };\n }, [handleRequisitionListAlert]);\n\n return (\n <div\n {...props}\n className={classes(['requisition-list-grid-wrapper', className])}\n data-testid=\"requisition-list-grid-wrapper\"\n >\n {/* Requisition List Header */}\n {header && (\n <div\n className={classes([\n 'requisition-list-grid-wrapper__header',\n className,\n ])}\n data-testid=\"requisition-list-grid-wrapper-header\"\n >\n <VComponent node={header} />\n </div>\n )}\n {/* Requisition List alerts go here */}\n {alert && (\n <div className=\"requisition-list__alert-wrapper\">\n <InLineAlert\n heading={alert.description}\n type={alert.type}\n variant=\"primary\"\n onDismiss={() => setAlert(null)}\n />\n </div>\n )}\n\n {showEmptyList ? (\n <EmptyList textContent={translations.emptyList} />\n ) : (\n <>\n {/* Requisition Lists Table */}\n <Table\n columns={[\n { key: 'name', label: translations.name },\n { key: 'items_count', label: translations.itemsCount },\n { key: 'last_updated', label: translations.lastUpdated },\n { key: 'actions', label: translations.actions },\n ]}\n rowData={rows}\n loading={isLoading}\n skeletonRowCount={skeletonRowCount}\n />\n {pageInfo && (\n <div\n className={classes([\n 'requisition-list-grid-wrapper__pagination',\n className,\n ])}\n >\n <PaginationItemsCounter\n pageInfo={pageInfo}\n totalCount={totalCount}\n />\n {(pageInfo.total_pages || 0) > 1 && (\n <Pagination\n totalPages={pageInfo.total_pages}\n currentPage={pageInfo.current_page || 1}\n onChange={handlePageChange}\n disabled={isLoading}\n />\n )}\n <div className=\"requisition-list-grid-wrapper__pagination-picker\">\n <span>{translations.show}</span>\n <PageSizePicker\n currentPageSize={pageInfo.page_size || defaultPageSize}\n onPageSizeChange={\n handlePageSizeChange || (() => Promise.resolve())\n }\n disabled={isLoading}\n />\n </div>\n </div>\n )}\n </>\n )}\n\n {/* Requisition Lists Form */}\n <div\n className={classes([\n 'requisition-list-grid-wrapper__add-new',\n className,\n ])}\n >\n {isAdding ? (\n <Card variant=\"secondary\">\n <RequisitionListForm\n mode=\"create\"\n onSuccess={async () => {\n await handlePageChange();\n handleCancelCreate();\n handleRequisitionListAlert({\n type: 'success',\n action: 'create',\n context: 'requisitionList',\n });\n }}\n onError={() => {\n handleRequisitionListAlert({\n type: 'error',\n action: 'create',\n context: 'requisitionList',\n });\n }}\n onCancel={handleCancelCreate}\n />\n </Card>\n ) : (\n <RequisitionListActions onAddNew={handleAddNew} />\n )}\n </div>\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { Add } from '@adobe-commerce/elsie/icons';\nimport { Icon } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/requisitionList/components/RequisitionListActions/RequisitionListActions.css';\n\nexport interface RequisitionListActionsProps {\n className?: string;\n selectable?: boolean;\n onAddNew?: () => void;\n}\n\nexport const RequisitionListActions: FunctionComponent<\n RequisitionListActionsProps\n> = ({ selectable, className, onAddNew }) => {\n const translations = useText({\n addNewReqListBtn: `RequisitionList.AddNewReqList.addNewReqListBtn`,\n });\n\n return (\n <button\n type=\"button\"\n aria-label={translations.addNewReqListBtn}\n role=\"button\"\n className={classes([\n 'requisition-list-actions',\n ['requisition-list-actions--selectable', selectable],\n className,\n ])}\n data-testid=\"requisition-list-actions-button\"\n onClick={onAddNew}\n >\n <span\n className=\"requisition-list-actions__title\"\n data-testid=\"requisition-list-actions-button-text\"\n >\n {translations.addNewReqListBtn}\n </span>\n <Icon source={Add} size=\"32\" />\n </button>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { FunctionComponent } from 'preact';\nimport { Icon } from '@adobe-commerce/elsie/components';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { List } from '@adobe-commerce/elsie/icons';\nimport '@/requisitionList/components/EmptyList/EmptyList.css';\n\nexport interface EmptyListProps {\n className?: string;\n textContent?: string | null;\n}\n\nexport const EmptyList: FunctionComponent<EmptyListProps> = ({\n className,\n textContent,\n ...props\n}) => {\n return (\n <div\n className={classes(['empty-list', className])}\n data-testid=\"empty-list\"\n {...props}\n >\n <Icon source={List} size={'64'} stroke={'2'} />\n {textContent && <h4>{textContent}</h4>}\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { FunctionComponent } from 'preact';\nimport { Icon, Button } from '@adobe-commerce/elsie/components';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { Search } from '@adobe-commerce/elsie/icons';\nimport '@/requisitionList/components/NotFound/NotFound.css';\n\nexport interface NotFoundProps {\n className?: string;\n title?: string;\n message?: string;\n actionLabel?: string;\n onAction?: () => void;\n}\n\nexport const NotFound: FunctionComponent<NotFoundProps> = ({\n className,\n title = '404 - Not Found',\n message = 'The requisition list you are looking for does not exist.',\n actionLabel,\n onAction,\n ...props\n}) => {\n return (\n <div\n className={classes(['not-found', className])}\n data-testid=\"not-found\"\n {...props}\n >\n <Icon source={Search} size={'64'} stroke={'2'} />\n <h2>{title}</h2>\n {message && <p>{message}</p>}\n {actionLabel && onAction && (\n <Button variant=\"primary\" onClick={onAction}>\n {actionLabel}\n </Button>\n )}\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent, h } from 'preact';\nimport { useState } from 'preact/hooks';\nimport { HTMLAttributes, ChangeEvent } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport {\n Icon,\n Table,\n Checkbox,\n Price,\n Button,\n Field,\n Input,\n Image,\n} from '@adobe-commerce/elsie/components';\nimport { Trash, Cart } from '@adobe-commerce/elsie/icons';\nimport '@/requisitionList/components/ProductListTable/ProductListTable.css';\nimport { RequisitionListModel } from '@/requisitionList/data/models/requisitionList';\nimport { Item, BundleOption } from '@/requisitionList/data/models/item';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nexport interface ProductListTableProps\n extends HTMLAttributes<HTMLDivElement | HTMLFormElement> {\n className?: string;\n items: RequisitionListModel['items'];\n selectedItems: Set<string>;\n currentPage: number;\n pageSize: number;\n canEdit?: boolean;\n handleItemSelection: (itemUid: string, isSelected: boolean) => void;\n handleUpdateQuantity: (itemUid: string, newQuantity: number) => Promise<void>;\n onAddToCart: (itemUids: string[] | undefined) => void;\n onDeleteItem: (itemUids: string[] | undefined) => void;\n}\n\nexport const ProductListTable: FunctionComponent<ProductListTableProps> = ({\n className,\n items,\n selectedItems,\n currentPage,\n pageSize,\n canEdit = true,\n handleItemSelection,\n handleUpdateQuantity,\n onAddToCart,\n onDeleteItem,\n ...props\n}) => {\n const [disabledInputs, setDisabledInputs] = useState<Record<string, boolean>>(\n {}\n );\n const [inputValues, setInputValues] = useState<Record<string, number>>({});\n\n const translations = useText({\n productNameHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.productName',\n skuHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.sku',\n priceHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.price',\n quantityHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.quantity',\n subtotalHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.subtotal',\n actionsHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.actions',\n actionAddToCart: 'RequisitionList.RequisitionListView.actionAddToCart',\n actionDelete: 'RequisitionList.RequisitionListView.actionDelete',\n actionSelect: 'RequisitionList.RequisitionListView.actionSelect',\n itemQuantity:\n 'RequisitionList.RequisitionListView.productListTable.itemQuantity',\n outOfStock:\n 'RequisitionList.RequisitionListView.productListTable.outOfStock',\n onlyXLeftInStock:\n 'RequisitionList.RequisitionListView.productListTable.onlyXLeftInStock',\n });\n const columns = [\n {\n label: '#',\n key: 'index',\n },\n {\n label: 'item',\n key: 'item',\n },\n {\n label: translations.priceHeader,\n key: 'price',\n },\n {\n label: translations.quantityHeader,\n key: 'quantity',\n },\n {\n label: translations.subtotalHeader,\n key: 'subtotal',\n },\n ];\n\n if (canEdit) {\n columns.unshift({\n label: translations.actionSelect,\n key: 'selector',\n });\n columns.push({\n label: translations.actionsHeader,\n key: 'actions',\n });\n }\n\n const handleItemCheckboxChange = (\n event: ChangeEvent<HTMLInputElement>,\n item: Item\n ) => {\n const isSelected = (event.target as HTMLInputElement).checked;\n handleItemSelection(item.uid, isSelected);\n };\n\n const getRowIndex = (index: number): number => {\n return (currentPage - 1) * pageSize + index + 1;\n };\n\n const getImageAlt = (item: Item): string => {\n return item.configured_product?.name || item.product?.name || item.sku;\n };\n\n const getImageSrc = (item: Item): string => {\n return item.configured_product?.images?.length\n ? item.configured_product.images[0]?.url || ''\n : item.product?.images?.length\n ? item.product.images[0]?.url || ''\n : '';\n };\n\n const getProductName = (item: Item): string | undefined => {\n return item.product?.name || item.sku;\n };\n\n const getConfiguredProductName = (item: Item): string | undefined => {\n return item.configured_product?.name;\n };\n\n const getBundleProducts = (\n item: Item\n ): h.JSX<HTMLSpanElement>[] | undefined => {\n if (!item.bundle_options) {\n return;\n }\n\n const bundleProducts = item.bundle_options.map(\n (option: BundleOption, index: number): h.JSX<HTMLSpanElement> => {\n return (\n <span\n key={option.values[0].label || index}\n className=\"requisition-list-view-product-list-table__product-configurable-name\"\n >\n {option.values[0]!.label} x {option.values[0]!.quantity}\n </span>\n );\n }\n );\n return bundleProducts;\n };\n\n const getSku = (item: Item): string | undefined => {\n return item.configured_product?.sku || item.sku;\n };\n\n const getPriceAmount = (item: Item): number => {\n if (Array.isArray(item.bundle_options) && item.bundle_options.length > 0) {\n return item.bundle_options.reduce(\n (previousValue: number, option: BundleOption): number => {\n return (\n previousValue +\n (option.values[0]?.priceV2?.value || 0) *\n (option.values[0]?.quantity || 0)\n );\n },\n 0\n );\n }\n return (\n item.configured_product?.price?.final?.amount?.value ||\n item.product?.price?.final?.amount?.value ||\n 0\n );\n };\n\n const getPriceCurrency = (item: Item): string | undefined => {\n return (\n item.configured_product?.price?.final?.amount?.currency ||\n item.product?.price?.final?.amount?.currency\n );\n };\n\n const getSubtotal = (item: Item): number => {\n return getPriceAmount(item) * item.quantity;\n };\n\n const handleInputChange = (e: ChangeEvent<HTMLInputElement>, item: Item) => {\n const inputValue = +(e.target as HTMLInputElement).value;\n if (inputValue > 0 && !Number.isNaN(e.target.value)) {\n setInputValues((prev) => ({ ...prev, [item.uid]: inputValue }));\n }\n };\n\n const handleInputBlur = async (e: FocusEvent, item: Item) => {\n let newQty = +(e.target as HTMLInputElement).value;\n\n if ((newQty > 0 && newQty !== item.quantity) === false) {\n setInputValues((prev) => ({ ...prev, [item.uid]: item.quantity }));\n return;\n }\n setDisabledInputs((prev) => ({ ...prev, [item.uid]: true }));\n try {\n await handleUpdateQuantity(item.uid, newQty);\n } finally {\n setDisabledInputs((prev) => ({ ...prev, [item.uid]: false }));\n }\n };\n\n const rowData = items.map((item: Item, index: number) => {\n return {\n selector: (\n <label id={`item-selector-${item.sku}-label`}>\n <Checkbox\n className=\"requisition-list-view-product-list-table__checkbox\"\n name={`item-selector-${item.sku}`}\n aria-label={`${translations.actionSelect} ${getProductName(item)}`}\n data-testid={`item-checkbox-${item.sku}`}\n onChange={(e: ChangeEvent<HTMLInputElement>) =>\n handleItemCheckboxChange(e, item)\n }\n value={item.sku}\n checked={selectedItems.has(item.uid)}\n />\n </label>\n ),\n index: (\n <div className=\"requisition-list-view-product-list-table__index-container\">\n {getRowIndex(index)}\n </div>\n ),\n item: (\n <div className=\"requisition-list-view-product-list-table__item-container\">\n <Image\n className=\"requisition-list-view-product-list-table__thumbnail\"\n alt={getImageAlt(item)}\n src={getImageSrc(item)}\n />\n <div className=\"requisition-list-view-product-list-table__item-details\">\n <div className=\"requisition-list-view-product-list-table__product-name\">\n {getProductName(item)}\n </div>\n {item.stock_status === 'OUT_OF_STOCK' && (\n <div className=\"requisition-list-view-product-list-table__out-of-stock\">\n {translations.outOfStock}\n </div>\n )}\n {item.stock_status !== 'OUT_OF_STOCK' &&\n item.only_x_left_in_stock !== null &&\n item.only_x_left_in_stock < item.quantity && (\n <div className=\"requisition-list-view-product-list-table__low-stock\">\n {translations.onlyXLeftInStock.replace(\n '{count}',\n String(item.only_x_left_in_stock)\n )}\n </div>\n )}\n <span className=\"requisition-list-view-product-list-table__product-configurable-name\">\n {getConfiguredProductName(item)}\n </span>\n <div className=\"requisition-list-view-product-list-table__sku\">\n {getSku(item)}\n </div>\n {getBundleProducts(item)}\n </div>\n </div>\n ),\n price: (\n <Price\n className=\"requisition-list-view-product-list-table__price\"\n amount={getPriceAmount(item)}\n currency={getPriceCurrency(item)}\n />\n ),\n quantity: (\n <span className=\"requisition-list-view-product-list-table__quantity\">\n <Field disabled={!!disabledInputs[item.uid]}>\n <Input\n id={`requisition-list-item-quantity-${item.sku}`}\n data-testid={`requisition-list-item-quantity-${item.sku}`}\n name=\"quantity\"\n type=\"text\"\n aria-label={`${translations.itemQuantity} - ${getProductName(\n item\n )}`}\n value={inputValues[item.uid] ?? item.quantity}\n onChange={(e: ChangeEvent<HTMLInputElement>) =>\n handleInputChange(e, item)\n }\n onBlur={(e: FocusEvent) => handleInputBlur(e, item)}\n />\n </Field>\n </span>\n ),\n subtotal: (\n <Price\n className=\"requisition-list-view-product-list-table__price\"\n amount={getSubtotal(item)}\n currency={getPriceCurrency(item)}\n />\n ),\n actions: (\n <div className=\"requisition-list-view__bulk-actions\">\n <Button\n type=\"button\"\n onClick={() => onAddToCart([item.uid])}\n icon={<Icon source={Cart} />}\n aria-label={`${translations.actionAddToCart} - ${getProductName(\n item\n )}`}\n data-testid=\"product-list-table-add-to-cart-button\"\n />\n <Button\n type=\"button\"\n variant=\"secondary\"\n icon={<Icon source={Trash} />}\n onClick={() => onDeleteItem([item.uid])}\n aria-label={`${translations.actionDelete} - ${getProductName(\n item\n )}`}\n data-testid=\"product-list-table-delete-button\"\n />\n </div>\n ),\n };\n });\n\n const table = (\n <Table\n columns={columns}\n rowData={rowData}\n data-testid=\"product-list-table\"\n mobileLayout=\"stacked\"\n />\n );\n\n return (\n <VComponent\n node={h('div', {})}\n className={classes([\n 'requisition-list-view-product-list-table-container',\n className,\n ])}\n data-testid=\"product-list-table-container\"\n {...props}\n >\n {table}\n </VComponent>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { Button, Icon } from '@adobe-commerce/elsie/components';\nimport { Trash, Minus } from '@adobe-commerce/elsie/icons';\nimport '@/requisitionList/components/BatchActions/BatchActions.css';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nexport interface BatchActionsProps\n extends HTMLAttributes<HTMLDivElement | HTMLFormElement> {\n selectedItems: Set<string>;\n deletingItemId: string | null;\n addingToCartItemId: string | null;\n bulkAddingToCart: boolean;\n updatingQuantityItemId: string | null;\n bulkMovingToList?: boolean;\n bulkCopyingToList?: boolean;\n onSelectAll: () => void;\n onSelectNone: () => void;\n onBulkAddToCart: () => void;\n onBulkDelete: () => void;\n onBulkMoveToList?: () => void;\n onBulkCopyToList?: () => void;\n}\n\nexport const BatchActions: FunctionComponent<BatchActionsProps> = ({\n selectedItems,\n deletingItemId,\n addingToCartItemId,\n bulkAddingToCart,\n updatingQuantityItemId,\n bulkMovingToList = false,\n bulkCopyingToList = false,\n onSelectAll,\n onSelectNone,\n onBulkAddToCart,\n onBulkDelete,\n onBulkMoveToList,\n onBulkCopyToList,\n}) => {\n const translations = useText({\n statusDeleting: `RequisitionList.RequisitionListView.statusDeleting`,\n actionSelectAll: `RequisitionList.RequisitionListView.actionSelectAll`,\n actionSelectNone: `RequisitionList.RequisitionListView.actionSelectNone`,\n actionAddToCart: `RequisitionList.RequisitionListView.actionAddToCart`,\n actionDeleteSelectedItems: `RequisitionList.RequisitionListView.actionDeleteSelectedItems`,\n statusBulkAddingToCart: `RequisitionList.RequisitionListView.statusBulkAddingToCart`,\n actionMoveToList: `RequisitionList.RequisitionListView.actionMoveToList`,\n actionCopyToList: `RequisitionList.RequisitionListView.actionCopyToList`,\n });\n\n const isDisabled =\n deletingItemId !== null ||\n addingToCartItemId !== null ||\n bulkAddingToCart ||\n updatingQuantityItemId !== null ||\n bulkMovingToList ||\n bulkCopyingToList;\n\n const hasSelectedItems = selectedItems.size > 0;\n\n return (\n <div className=\"requisition-list-view__batch-actions\">\n <div className=\"requisition-list-view__batch-actions-left\">\n <button\n data-testid=\"bulk-actions-select-toggle-btn\"\n type=\"button\"\n className={`requisition-list-view__batch-actions-select-toggle ${\n hasSelectedItems\n ? 'requisition-list-view__batch-actions-select-toggle--active'\n : ''\n }`}\n onClick={hasSelectedItems ? onSelectNone : onSelectAll}\n disabled={isDisabled}\n aria-label={\n hasSelectedItems\n ? translations.actionSelectNone\n : translations.actionSelectAll\n }\n >\n <Icon source={Minus} />\n </button>\n <button\n type=\"button\"\n className=\"requisition-list-view__batch-actions-select-label\"\n onClick={hasSelectedItems ? onSelectNone : onSelectAll}\n disabled={isDisabled}\n >\n {translations.actionSelectAll}\n </button>\n </div>\n\n {hasSelectedItems && (\n <div className=\"requisition-list-view__batch-actions-buttons\">\n <span\n className=\"requisition-list-view__batch-actions-count-badge\"\n aria-label={`${selectedItems.size} items selected`}\n >\n {selectedItems.size}\n </span>\n {onBulkMoveToList && (\n <Button\n data-testid=\"bulk-actions-move-to-list-btn\"\n type=\"button\"\n variant=\"secondary\"\n onClick={onBulkMoveToList}\n disabled={isDisabled}\n >\n {translations.actionMoveToList}\n </Button>\n )}\n {onBulkCopyToList && (\n <Button\n data-testid=\"bulk-actions-copy-to-list-btn\"\n type=\"button\"\n variant=\"secondary\"\n onClick={onBulkCopyToList}\n disabled={isDisabled}\n >\n {translations.actionCopyToList}\n </Button>\n )}\n <Button\n data-testid=\"bulk-actions-add-to-cart-btn\"\n type=\"button\"\n variant=\"secondary\"\n onClick={onBulkAddToCart}\n disabled={isDisabled}\n >\n {bulkAddingToCart\n ? translations.statusBulkAddingToCart\n : translations.actionAddToCart}\n </Button>\n <button\n data-testid=\"bulk-actions-delete-btn\"\n type=\"button\"\n className=\"requisition-list-view__batch-actions-delete-icon\"\n onClick={onBulkDelete}\n disabled={isDisabled}\n aria-label={translations.actionDeleteSelectedItems}\n >\n <Icon source={Trash} />\n </button>\n </div>\n )}\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { HTMLAttributes } from 'preact/compat';\nimport { Picker } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/requisitionList/components/PageSizePicker/PageSizePicker.css';\n\nexport interface PageSizePickerProps extends HTMLAttributes<HTMLDivElement> {\n currentPageSize: number;\n onPageSizeChange: (pageSize: number) => void;\n disabled?: boolean;\n pageSizeOptions?: number[];\n}\n\nexport const PageSizePicker = ({\n currentPageSize,\n onPageSizeChange,\n disabled = false,\n pageSizeOptions = [10, 25, 50, 100],\n}: PageSizePickerProps) => {\n const translations = useText({\n itemsPerPage: `RequisitionList.PageSizePicker.itemsPerPage`,\n });\n\n const handlePageSizeChange = (event: Event) => {\n const target = event.target as HTMLSelectElement;\n const newPageSize = parseInt(target.value, 10);\n onPageSizeChange(newPageSize);\n };\n\n const options = pageSizeOptions.map((size) => ({\n value: size.toString(),\n text: size.toString(),\n }));\n\n return (\n <Picker\n disabled={disabled}\n data-testid=\"page-size-picker\"\n variant=\"primary\"\n size=\"medium\"\n value={currentPageSize.toString()}\n options={options}\n handleSelect={handlePageSizeChange}\n aria-label={translations.itemsPerPage}\n />\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\n\nimport { PageInfo } from '@/requisitionList/data/models';\nimport { DEFAULT_PAGE_SIZE } from '@/requisitionList/lib/constants';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nimport '@/requisitionList/components/PaginationItemsCounter/PaginationItemsCounter.css';\n\nexport interface PaginationItemsCounterProps {\n pageInfo?: PageInfo;\n totalCount?: number;\n className?: string;\n}\n\nexport const PaginationItemsCounter: FunctionComponent<\n PaginationItemsCounterProps\n> = ({ pageInfo, totalCount, className = '' }) => {\n const translations = useText({\n itemsCounter: `RequisitionList.PaginationItemsCounter.itemsCounter`,\n });\n\n // Don't show counter if no pageInfo or if there's no total count\n if (!pageInfo || !totalCount) {\n return null;\n }\n\n const pageSize = pageInfo.page_size ?? DEFAULT_PAGE_SIZE;\n const currentPage = pageInfo.current_page ?? 1;\n const currentPageSize = pageSize * currentPage;\n const total = totalCount;\n\n const from = currentPageSize - pageSize + 1;\n const to = currentPageSize > total ? total : currentPageSize;\n\n return (\n <span className={`pagination-items-counter ${className}`.trim()}>\n {translations.itemsCounter\n .replace('{from}', from.toString())\n .replace('{to}', to.toString())\n .replace('{total}', total.toString())}\n </span>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { useState } from 'preact/compat';\nimport { Button, Card, Icon } from '@adobe-commerce/elsie/components';\nimport { List } from '@adobe-commerce/elsie/icons';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { useRequisitionLists } from '@/requisitionList/hooks/useRequisitionLists';\nimport '@/requisitionList/components/RequisitionListPicker/RequisitionListPicker.css';\n\nexport interface RequisitionListPickerProps {\n excludeUid?: string;\n confirmLabel: string;\n disabled?: boolean;\n onConfirm: (selectedUid: string) => void;\n}\n\nexport const RequisitionListPicker: FunctionComponent<\n RequisitionListPickerProps\n> = ({ excludeUid, confirmLabel, disabled = false, onConfirm }) => {\n const { lists } = useRequisitionLists();\n const [selectedUid, setSelectedUid] = useState<string | null>(null);\n\n const filteredLists = excludeUid\n ? lists.filter((list: RequisitionList) => list.uid !== excludeUid)\n : lists;\n\n return (\n <Card variant=\"secondary\">\n <form\n onSubmit={(e: Event) => {\n e.preventDefault();\n if (selectedUid) onConfirm(selectedUid);\n }}\n className=\"requisition-list-picker__form\"\n >\n <div className=\"requisition-list-picker__available-lists\">\n {filteredLists.map((list: RequisitionList) => (\n <Card\n key={list.uid}\n variant={selectedUid === list.uid ? 'primary' : 'secondary'}\n onClick={() => setSelectedUid(list.uid)}\n >\n <Icon source={List} />\n <span>{list.name}</span>\n </Card>\n ))}\n </div>\n <div className=\"requisition-list-picker__actions\">\n <Button type=\"submit\" disabled={!selectedUid || disabled}>\n {confirmLabel}\n </Button>\n </div>\n </form>\n </Card>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport {\n HTMLAttributes,\n useState,\n useCallback,\n useEffect,\n} from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport {\n addRequisitionListItemsToCart,\n AddToCartError,\n} from '@/requisitionList/api/addRequisitionListItemsToCart';\nimport { deleteRequisitionListItems } from '@/requisitionList/api/deleteRequisitionListItems';\nimport { updateRequisitionListItems } from '@/requisitionList/api/updateRequisitionListItems';\nimport { getRequisitionList } from '@/requisitionList/api/getRequisitionList';\nimport {\n Pagination,\n InLineAlert,\n ProgressSpinner,\n} from '@adobe-commerce/elsie/components';\nimport { Item, Product } from '@/requisitionList/data/models/item';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { events } from '@adobe-commerce/event-bus';\nimport {\n PageSizePicker,\n EmptyList,\n NotFound,\n RequisitionListModal,\n PaginationItemsCounter,\n RequisitionListPicker,\n} from '@/requisitionList/components';\nimport { ProductListTable } from '@/requisitionList/components/ProductListTable/ProductListTable';\nimport { BatchActions } from '@/requisitionList/components/BatchActions/BatchActions';\nimport { RequisitionListHeader } from '@/requisitionList/containers/RequisitionListHeader';\nimport { useRequisitionListSelectedItems } from '@/requisitionList/hooks/useRequisitionListSelectedItems';\nimport { useRequisitionListAlert } from '@/requisitionList/hooks/useRequisitionListAlert';\nimport { useRequisitionListEnabled } from '@/requisitionList/hooks/useRequisitionListEnabled';\nimport { useRequisitionListTransfer } from '@/requisitionList/hooks/useRequisitionListTransfer';\nimport { isValidBase64Uid } from '@/requisitionList/lib/validate-uid';\nimport { DEFAULT_PAGE_SIZE } from '@/requisitionList/lib/constants';\nimport '@/requisitionList/containers/RequisitionListView/RequisitionListView.css';\n\nexport interface RequisitionListViewProps\n extends HTMLAttributes<HTMLDivElement> {\n /**\n * The UID of the requisition list to display.\n * The UID must be a base64-encoded string.\n * If an invalid UID is provided, the component will render the NotFound state.\n * The component will fetch the requisition list data internally.\n */\n requisitionListUid: string;\n /**\n * When true, skips automatic product data fetching on component mount.\n * Used in tests to prevent API calls.\n */\n skipProductLoading?: boolean;\n /**\n * Number of items per page for pagination.\n * Defaults to DEFAULT_PAGE_SIZE.\n */\n pageSize?: number;\n selectedItems: Set<string>;\n /**\n * Function that returns the URL to the requisition list grid view or performs navigation\n */\n routeRequisitionListGrid?: () => string | void;\n /**\n * Fallback URL to redirect when requisition lists are not enabled.\n * Defaults to '/customer/account'\n */\n fallbackRoute?: string;\n getProductData: (skus: string[]) => Promise<Product[] | null>;\n enrichConfigurableProducts: (items: Item[]) => Promise<Item[]>;\n currentCustomerEmail?: string;\n routeSharedRequisitionList?: (token: string) => string;\n}\n\nexport const RequisitionListView: Container<RequisitionListViewProps> = ({\n requisitionListUid,\n skipProductLoading = false,\n pageSize = DEFAULT_PAGE_SIZE,\n routeRequisitionListGrid,\n fallbackRoute = '/customer/account',\n getProductData,\n enrichConfigurableProducts,\n currentCustomerEmail,\n routeSharedRequisitionList,\n}: RequisitionListViewProps) => {\n const [loadingProducts, setLoadingProducts] = useState<boolean>(false);\n const [deletingItemId, setDeletingItemId] = useState<string | null>(null);\n const [addingToCartItemId, setAddingToCartItemId] = useState<\n string[] | undefined\n >(null);\n const [bulkAddingToCart, setBulkAddingToCart] = useState<boolean>(false);\n const [updatingQuantityItemId, setUpdatingQuantityItemId] = useState<\n string | null\n >(null);\n const [loadingPage, setLoadingPage] = useState<boolean>(false);\n const [currentPageSize, setCurrentPageSize] = useState<number>(pageSize);\n const [initializing, setInitializing] = useState<boolean>(true);\n const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false);\n const [itemsToDelete, setItemsToDelete] = useState<string[]>([]);\n const {\n currentRequisitionList,\n setCurrentRequisitionList,\n selectedItems,\n setSelectedItems,\n handleItemSelection,\n handleSelectAll,\n handleSelectNone,\n } = useRequisitionListSelectedItems();\n\n const translations = useText({\n emptyRequisitionList: `RequisitionList.RequisitionListView.emptyRequisitionList`,\n errorLoadingProducts: `RequisitionList.RequisitionListView.errorLoadingProducts`,\n errorLoadPage: `RequisitionList.RequisitionListView.errorLoadPage`,\n notFoundTitle: `RequisitionList.RequisitionListView.notFoundTitle`,\n notFoundMessage: `RequisitionList.RequisitionListView.notFoundMessage`,\n notFoundActionLabel: `RequisitionList.RequisitionListView.notFoundActionLabel`,\n notEnabledTitle: `RequisitionList.RequisitionListsNotEnabled.title`,\n notEnabledMessage: `RequisitionList.RequisitionListsNotEnabled.message`,\n partialMoveSuccess: `RequisitionList.RequisitionListAlert.partialMoveSuccess`,\n notEnabledActionLabel: `RequisitionList.RequisitionListsNotEnabled.actionLabel`,\n show: `RequisitionList.PageSizePicker.show`,\n deleteItemsTitle: `RequisitionList.RequisitionListView.deleteItemsTitle`,\n deleteItemsMessage: `RequisitionList.RequisitionListView.deleteItemsMessage`,\n confirmAction: `RequisitionList.RequisitionListView.confirmAction`,\n cancelAction: `RequisitionList.RequisitionListView.cancelAction`,\n moveToListTitle: `RequisitionList.RequisitionListView.moveToListTitle`,\n moveToListConfirm: `RequisitionList.RequisitionListView.moveToListConfirm`,\n copyToListTitle: `RequisitionList.RequisitionListView.copyToListTitle`,\n copyToListConfirm: `RequisitionList.RequisitionListView.copyToListConfirm`,\n });\n\n const { alert, setAlert, handleRequisitionListAlert } =\n useRequisitionListAlert();\n\n const { isEnabled } = useRequisitionListEnabled();\n\n useEffect(() => {\n const requisitionListEvent = events.on(\n 'requisitionList/data',\n (payload: RequisitionList) => {\n // Only update from events if it matches our current UID\n if (payload?.uid === requisitionListUid) {\n setCurrentRequisitionList(payload);\n setSelectedItems(new Set());\n }\n }\n );\n // Keep event listener for cross-component alert communication\n const alertEvent = events.on(\n 'requisitionList/alert',\n handleRequisitionListAlert\n );\n return () => {\n requisitionListEvent?.off();\n alertEvent?.off();\n };\n }, [\n handleRequisitionListAlert,\n requisitionListUid,\n setCurrentRequisitionList,\n setSelectedItems,\n ]);\n\n // Sync pageSize prop changes to local state\n useEffect(() => {\n setCurrentPageSize(pageSize);\n }, [pageSize]);\n\n // Function to enrich configurable products\n const enrichConfigurableProductsInList = useCallback(\n async (baseRequisitionList: RequisitionList): Promise<RequisitionList> => {\n if (!baseRequisitionList.items?.length) {\n return baseRequisitionList;\n }\n if (typeof enrichConfigurableProducts !== 'function') {\n return baseRequisitionList;\n }\n\n const enrichedItems = await enrichConfigurableProducts(\n baseRequisitionList.items\n );\n return {\n ...baseRequisitionList,\n items: enrichedItems,\n };\n },\n [enrichConfigurableProducts]\n );\n\n // Function to fetch and merge product data\n const fetchAndMergeProducts = useCallback(\n async (baseRequisitionList: RequisitionList) => {\n // Extract SKUs from requisition list items\n const productSkus =\n baseRequisitionList.items?.map((item: Item) => item.sku) || [];\n\n if (productSkus.length === 0) {\n return baseRequisitionList;\n }\n\n setLoadingProducts(true);\n\n try {\n const fetchedProducts = await getProductData(productSkus);\n if (fetchedProducts) {\n // Create a map of SKU to Product for easy lookup\n const productMap = new Map<string, Product>();\n fetchedProducts.forEach((product: Product) => {\n productMap.set(product.sku, product);\n });\n\n // Update requisition list items with fetched product data\n return {\n ...baseRequisitionList,\n items: baseRequisitionList.items?.map((item: Item) => {\n const fetchedProduct = productMap.get(item.sku);\n return {\n ...item,\n product: fetchedProduct || item.product, // Use fetched product or keep existing\n stock_status: (item.stock_status ||\n fetchedProduct?.stock_status ||\n 'IN_STOCK') as 'IN_STOCK' | 'OUT_OF_STOCK',\n only_x_left_in_stock:\n item.only_x_left_in_stock ??\n fetchedProduct?.only_x_left_in_stock ??\n null,\n };\n }),\n };\n }\n console.warn('No products found');\n return baseRequisitionList;\n } catch (error) {\n console.warn(\n error instanceof Error\n ? error.message\n : translations.errorLoadingProducts\n );\n return baseRequisitionList;\n } finally {\n setLoadingProducts(false);\n }\n },\n [getProductData, translations.errorLoadingProducts]\n );\n\n const {\n showMoveToListModal,\n setShowMoveToListModal,\n movingToList,\n showCopyToListModal,\n setShowCopyToListModal,\n copyingToList,\n handleMoveToList,\n handleCopyToList,\n } = useRequisitionListTransfer({\n sourceListUid: currentRequisitionList?.uid,\n selectedItems,\n currentPageSize,\n currentPage: currentRequisitionList?.page_info?.current_page || 1,\n enrichConfigurableProductsInList,\n fetchAndMergeProducts,\n setCurrentRequisitionList,\n setSelectedItems,\n handleRequisitionListAlert,\n });\n\n // Initialize requisition list from UID\n // Only triggers initial load when UID changes. Page size changes trigger pagination, not re-initialization.\n useEffect(() => {\n if (!requisitionListUid) {\n setInitializing(false);\n return;\n }\n\n // Only initialize if we don't have a list or if the UID changed\n if (\n currentRequisitionList &&\n currentRequisitionList.uid === requisitionListUid\n ) {\n // Same list already loaded, don't re-initialize\n return;\n }\n\n setInitializing(true);\n\n const initializeFromUid = async () => {\n try {\n const fetchedList = await getRequisitionList(\n requisitionListUid,\n 1,\n pageSize,\n enrichConfigurableProducts\n );\n\n if (fetchedList) {\n // List already enriched via getRequisitionList(enrichConfigurableProducts)\n if (!skipProductLoading) {\n const enrichedList = await fetchAndMergeProducts(fetchedList);\n setCurrentRequisitionList(enrichedList);\n } else {\n setCurrentRequisitionList(fetchedList);\n }\n }\n } catch (error) {\n console.error('Failed to initialize requisition list from UID:', error);\n } finally {\n setInitializing(false);\n }\n };\n\n initializeFromUid();\n }, [\n requisitionListUid,\n pageSize,\n skipProductLoading,\n enrichConfigurableProducts,\n fetchAndMergeProducts,\n setCurrentRequisitionList,\n currentRequisitionList,\n ]);\n\n const handleAddItemsToCart = useCallback(\n async (itemUids: string[] | undefined) => {\n if (itemUids && itemUids.length === 1) {\n setBulkAddingToCart(false);\n setAddingToCartItemId(itemUids);\n } else {\n setBulkAddingToCart(true);\n setAddingToCartItemId(null);\n }\n\n try {\n const errors = await addRequisitionListItemsToCart(\n currentRequisitionList.uid,\n itemUids\n );\n\n const totalItems = itemUids?.length || 0;\n const errorCount = errors?.length || 0;\n const successCount = totalItems - errorCount;\n\n // Check for partial success: some items succeeded and some failed\n if (errors && errors.length > 0 && successCount > 0) {\n const alertPayload = {\n action: 'move',\n type: 'error',\n context: 'product',\n message: [\n translations.partialMoveSuccess\n .replace('{successCount}', String(successCount))\n .replace('{failedCount}', String(errorCount)),\n ],\n };\n handleRequisitionListAlert(alertPayload);\n events.emit('requisitionList/alert', alertPayload);\n } else if (errors && errors.length > 0) {\n // All items failed\n const alertPayload = {\n action: 'move',\n type: 'error',\n context: 'product',\n message: errors.map((e: AddToCartError) => e.message),\n };\n handleRequisitionListAlert(alertPayload);\n events.emit('requisitionList/alert', alertPayload);\n } else {\n // All items succeeded\n const alertPayload = {\n action: 'move',\n type: 'success',\n context: 'product',\n };\n handleRequisitionListAlert(alertPayload);\n events.emit('requisitionList/alert', alertPayload);\n }\n } catch (error) {\n const alertPayload = {\n action: 'move',\n type: 'error',\n context: 'product',\n };\n handleRequisitionListAlert(alertPayload);\n events.emit('requisitionList/alert', alertPayload);\n } finally {\n setAddingToCartItemId(null);\n setBulkAddingToCart(false);\n }\n },\n [currentRequisitionList, handleRequisitionListAlert, translations]\n );\n\n const handleDeleteItems = useCallback((itemUids: string[] | undefined) => {\n if (itemUids && itemUids.length > 0) {\n setItemsToDelete(itemUids);\n setShowDeleteModal(true);\n }\n }, []);\n\n const handleConfirmDelete = useCallback(async () => {\n if (itemsToDelete.length === 1) {\n setDeletingItemId(itemsToDelete[0]);\n } else {\n setDeletingItemId('bulk');\n }\n\n try {\n const updatedRequisitionList = await deleteRequisitionListItems(\n currentRequisitionList.uid,\n itemsToDelete,\n currentPageSize,\n currentRequisitionList.page_info.current_page,\n enrichConfigurableProducts\n );\n\n if (updatedRequisitionList) {\n // Enrich configurable products\n const enrichedWithConfigurable = await enrichConfigurableProductsInList(\n updatedRequisitionList\n );\n // Fetch and merge product data to ensure prices are loaded\n const enrichedRequisitionList = await fetchAndMergeProducts(\n enrichedWithConfigurable\n );\n setCurrentRequisitionList(enrichedRequisitionList);\n handleRequisitionListAlert({\n action: 'delete',\n type: 'success',\n context: 'product',\n });\n } else {\n handleRequisitionListAlert({\n action: 'delete',\n type: 'error',\n context: 'product',\n });\n }\n } catch (error) {\n handleRequisitionListAlert({\n action: 'delete',\n type: 'error',\n context: 'product',\n });\n } finally {\n setDeletingItemId(null);\n setShowDeleteModal(false);\n setItemsToDelete([]);\n }\n }, [\n itemsToDelete,\n currentRequisitionList,\n currentPageSize,\n fetchAndMergeProducts,\n setCurrentRequisitionList,\n handleRequisitionListAlert,\n enrichConfigurableProductsInList,\n enrichConfigurableProducts,\n ]);\n\n const handleUpdateQuantity = useCallback(\n async (itemUid: string, newQuantity: number) => {\n setUpdatingQuantityItemId(itemUid);\n\n try {\n // Find the current item to update\n const currentItem = currentRequisitionList.items?.find(\n (item: Item) => item.uid === itemUid\n );\n if (!currentItem) {\n handleRequisitionListAlert({\n action: 'update',\n type: 'error',\n context: 'product',\n });\n return;\n }\n\n // Create updated item with new quantity\n const updatedItem = {\n item_id: currentItem.uid,\n entered_options: currentItem.entered_options,\n selected_options: currentItem.selected_options,\n quantity: newQuantity,\n };\n\n const updatedRequisitionList = await updateRequisitionListItems(\n currentRequisitionList.uid,\n [updatedItem],\n currentPageSize,\n currentRequisitionList.page_info.current_page,\n enrichConfigurableProducts\n );\n\n if (updatedRequisitionList) {\n // List already enriched via updateRequisitionListItems(enrichConfigurableProducts)\n const enrichedRequisitionList = await fetchAndMergeProducts(\n updatedRequisitionList\n );\n setCurrentRequisitionList(enrichedRequisitionList);\n handleRequisitionListAlert({\n action: 'update',\n type: 'success',\n context: 'product',\n });\n } else {\n handleRequisitionListAlert({\n action: 'update',\n type: 'error',\n context: 'product',\n });\n }\n } catch (error) {\n handleRequisitionListAlert({\n action: 'update',\n type: 'error',\n context: 'product',\n });\n } finally {\n setUpdatingQuantityItemId(null);\n }\n },\n [\n currentRequisitionList,\n fetchAndMergeProducts,\n setCurrentRequisitionList,\n currentPageSize,\n handleRequisitionListAlert,\n enrichConfigurableProducts,\n ]\n );\n\n const handlePageChange = useCallback(\n async (page: number) => {\n setLoadingPage(true);\n\n try {\n const updatedRequisitionList = await getRequisitionList(\n currentRequisitionList.uid,\n page,\n currentPageSize,\n enrichConfigurableProducts\n );\n\n if (updatedRequisitionList) {\n // Fetch product data for the new page (list already enriched via getRequisitionList)\n const enrichedWithConfigurable = updatedRequisitionList;\n const updatedListWithProducts = await fetchAndMergeProducts(\n enrichedWithConfigurable\n );\n setCurrentRequisitionList(updatedListWithProducts);\n } else {\n console.warn(translations.errorLoadPage);\n }\n } catch (error) {\n console.warn(\n error instanceof Error ? error.message : translations.errorLoadPage\n );\n } finally {\n setLoadingPage(false);\n }\n },\n [\n currentRequisitionList?.uid,\n fetchAndMergeProducts,\n currentPageSize,\n translations,\n setCurrentRequisitionList,\n enrichConfigurableProducts,\n ]\n );\n\n const handlePageSizeChange = useCallback(\n async (newPageSize: number) => {\n setCurrentPageSize(newPageSize);\n setLoadingPage(true);\n\n try {\n // Reset to page 1 when changing page size\n const updatedRequisitionList = await getRequisitionList(\n currentRequisitionList.uid,\n 1,\n newPageSize,\n enrichConfigurableProducts\n );\n\n if (updatedRequisitionList) {\n // Fetch product data for the new page (list already enriched via getRequisitionList)\n const enrichedWithConfigurable = updatedRequisitionList;\n const updatedListWithProducts = await fetchAndMergeProducts(\n enrichedWithConfigurable\n );\n setCurrentRequisitionList(updatedListWithProducts);\n } else {\n console.warn(translations.errorLoadPage);\n }\n } catch (error) {\n console.warn(translations.errorLoadPage);\n } finally {\n setLoadingPage(false);\n }\n },\n [\n currentRequisitionList?.uid,\n fetchAndMergeProducts,\n translations,\n setCurrentRequisitionList,\n enrichConfigurableProducts,\n ]\n );\n\n const handleUpdate = useCallback(\n async (updatedList: RequisitionList) => {\n // Enrich configurable products\n const enrichedWithConfigurable = await enrichConfigurableProductsInList(\n updatedList\n );\n // With the updated API, the response includes items and page_info\n // but we need to fetch and merge full product data (prices, images, etc.)\n const enrichedList = await fetchAndMergeProducts(\n enrichedWithConfigurable\n );\n setCurrentRequisitionList(enrichedList);\n },\n [\n setCurrentRequisitionList,\n fetchAndMergeProducts,\n enrichConfigurableProductsInList,\n ]\n );\n\n return (\n <div className=\"requisition-list-view__container\">\n {initializing ? (\n <div className=\"requisition-list-view__loading\">\n <ProgressSpinner stroke={'4'} size={'large'} />\n </div>\n ) : isEnabled === false ? (\n <NotFound\n title={translations.notEnabledTitle}\n message={translations.notEnabledMessage}\n actionLabel={translations.notEnabledActionLabel}\n onAction={() => {\n window.location.href = fallbackRoute;\n }}\n />\n ) : !currentRequisitionList ||\n !isValidBase64Uid(currentRequisitionList?.uid) ? (\n <NotFound\n title={translations.notFoundTitle}\n message={translations.notFoundMessage}\n actionLabel={\n routeRequisitionListGrid\n ? translations.notFoundActionLabel\n : undefined\n }\n onAction={\n routeRequisitionListGrid\n ? () => {\n const url = routeRequisitionListGrid();\n if (url && typeof url === 'string') {\n window.location.href = url;\n }\n }\n : undefined\n }\n />\n ) : (\n <>\n <RequisitionListHeader\n requisitionList={currentRequisitionList}\n routeRequisitionListGrid={routeRequisitionListGrid}\n onUpdate={handleUpdate}\n onAlert={handleRequisitionListAlert}\n enrichConfigurableProducts={enrichConfigurableProducts}\n currentCustomerEmail={currentCustomerEmail}\n routeSharedRequisitionList={routeSharedRequisitionList}\n />\n\n {alert && (\n <div className=\"requisition-list__alert-wrapper\">\n <InLineAlert\n heading={alert.description}\n type={alert.type}\n variant=\"primary\"\n onDismiss={() => setAlert(null)}\n />\n </div>\n )}\n\n {currentRequisitionList.items_count === 0 ? (\n <EmptyList\n textContent={`${currentRequisitionList.name} ${translations.emptyRequisitionList}`}\n />\n ) : (\n <>\n <BatchActions\n selectedItems={selectedItems}\n deletingItemId={deletingItemId}\n addingToCartItemId={addingToCartItemId}\n bulkAddingToCart={bulkAddingToCart}\n updatingQuantityItemId={updatingQuantityItemId}\n bulkMovingToList={movingToList}\n bulkCopyingToList={copyingToList}\n onSelectAll={handleSelectAll}\n onSelectNone={handleSelectNone}\n onBulkAddToCart={() =>\n handleAddItemsToCart(Array.from(selectedItems))\n }\n onBulkDelete={() =>\n handleDeleteItems(Array.from(selectedItems))\n }\n onBulkMoveToList={() => setShowMoveToListModal(true)}\n onBulkCopyToList={() => setShowCopyToListModal(true)}\n />\n\n <ProductListTable\n items={currentRequisitionList.items}\n selectedItems={selectedItems}\n currentPage={\n currentRequisitionList.page_info?.current_page || 1\n }\n pageSize={\n currentRequisitionList.page_info?.page_size ||\n DEFAULT_PAGE_SIZE\n }\n handleItemSelection={handleItemSelection}\n handleUpdateQuantity={handleUpdateQuantity}\n onAddToCart={handleAddItemsToCart}\n onDeleteItem={handleDeleteItems}\n />\n\n {/* Pagination */}\n {currentRequisitionList.page_info && (\n <div className=\"requisition-list-view__pagination\">\n <PaginationItemsCounter\n pageInfo={currentRequisitionList.page_info}\n totalCount={currentRequisitionList.items_count}\n />\n {(currentRequisitionList.page_info?.total_pages || 0) > 1 && (\n <Pagination\n totalPages={currentRequisitionList.page_info.total_pages}\n currentPage={\n currentRequisitionList.page_info?.current_page || 1\n }\n onChange={handlePageChange}\n disabled={loadingPage || loadingProducts}\n />\n )}\n <div className=\"requisition-list-view__pagination-picker\">\n <span>{translations.show}</span>\n <PageSizePicker\n currentPageSize={\n currentRequisitionList.page_info?.page_size ||\n DEFAULT_PAGE_SIZE\n }\n onPageSizeChange={handlePageSizeChange}\n disabled={loadingPage || loadingProducts}\n />\n </div>\n </div>\n )}\n </>\n )}\n </>\n )}\n\n {/* Delete Confirmation Modal */}\n {showDeleteModal && (\n <RequisitionListModal\n isOpen={showDeleteModal}\n isLoading={deletingItemId !== null}\n title={translations.deleteItemsTitle}\n modalContent={translations.deleteItemsMessage}\n confirmBtnCaption={translations.confirmAction}\n closeBtnCaption={translations.cancelAction}\n handleModalOnClose={() => {\n setShowDeleteModal(false);\n setItemsToDelete([]);\n }}\n handleModalOnConfirm={handleConfirmDelete}\n />\n )}\n\n {/* Move to Requisition List Modal */}\n {showMoveToListModal && (\n <RequisitionListModal\n isOpen={showMoveToListModal}\n isLoading={movingToList}\n title={translations.moveToListTitle}\n modalContent={\n <RequisitionListPicker\n excludeUid={currentRequisitionList?.uid}\n confirmLabel={translations.moveToListConfirm}\n disabled={movingToList}\n onConfirm={handleMoveToList}\n />\n }\n handleModalOnClose={() => setShowMoveToListModal(false)}\n />\n )}\n\n {/* Copy to Requisition List Modal */}\n {showCopyToListModal && (\n <RequisitionListModal\n isOpen={showCopyToListModal}\n isLoading={copyingToList}\n title={translations.copyToListTitle}\n modalContent={\n <RequisitionListPicker\n excludeUid={currentRequisitionList?.uid}\n confirmLabel={translations.copyToListConfirm}\n disabled={copyingToList}\n onConfirm={handleCopyToList}\n />\n }\n handleModalOnClose={() => setShowCopyToListModal(false)}\n />\n )}\n </div>\n );\n};\n"],"names":["getItemOptions","item","_a","opt","_b","SharedRequisitionList","status","previewData","errorMessage","onImport","translations","jsxs","jsx","ProgressSpinner","InLineAlert","listName","items","isImporting","isImported","columns","rowData","Header","Table","Button","token","routeRequisitionList","setStatus","useState","setPreviewData","setErrorMessage","isMountedRef","useRef","useText","useEffect","getSharedRequisitionList","result","err","handleImport","useCallback","importSharedRequisitionList","requisitionList","userErrors","name","uid","events","resolvedErrorMessage","SharedRequisitionListView","ShareRequisitionListContent","loadingUsers","usersErrorMessage","loadingLink","selectedUserValues","multiSelectOptions","shareLink","linkErrorMessage","linkCopied","isSubmitting","canSubmit","onSubmitClick","onCopyLinkClick","onSelectedUsersChange","onUsersFieldInteract","selectionError","submitErrorMessage","isShareSuccess","sharedRecipientEmails","email","Fragment","Field","MultiSelect","Divider","Input","requisitionListUid","onSubmit","currentCustomerEmail","routeSharedRequisitionList","companyUsers","setCompanyUsers","setLoadingUsers","usersLoadFailed","setUsersLoadFailed","selectedUids","setSelectedUids","setShareLink","setLoadingLink","setLinkErrorMessage","setLinkCopied","setSelectionError","setSubmitErrorMessage","setIsShareSuccess","setSharedRecipientEmails","maxRecipients","configValue","state","parsed","getCompanyUsers","users","colleagues","user","shareRequisitionListByToken","relativeUrl","handleSubmit","selectedIds","selectedEmails","errors","handleCopyLink","ShareRequisitionListContentComponent","values","nextValues","DEFAULT_PAGE_SIZE","NAME_MIN_LENGTH","NAME_MAX_LENGTH","DESCRIPTION_MAX_LENGTH","NAME_VALID_CHARS","RequisitionListForm","className","mode","defaultValues","error","onCancel","props","setValues","touched","setTouched","setIsSubmitting","validateName","trimmedName","handleChange","field","e","target","prevValues","handleBlur","prev","nameError","title","classes","TextArea","useRequisitionListForm","onSuccess","onError","setError","description","updateRequisitionList","createRequisitionList","msg","submit","RequisitionListFormComponent","useRequisitionListGrid","callbacks","routeRequisitionListDetails","closeModal","reqLists","setReqLists","isAdding","setIsAdding","isFetching","setIsFetching","handleAddNew","handleCancelCreate","wrappedCallbacks","useMemo","rl","current","fetchPage","page","pageSize","data","getRequisitionLists","currentPage","totalPages","_c","prevData","requisitionListsEvent","handlePageChange","currentPageSize","handlePageSizeChange","isRequisitionListEnabled","config","useRequisitionListEnabled","isEnabled","setIsEnabled","configListener","enabled","RequisitionListGrid","fallbackRoute","slots","modal","setModal","handleOpenRenameModal","handleOpenDeleteModal","rows","isLoading","pageInfo","totalCount","handleRenameSubmit","handleDeleteConfirm","deleteRequisitionList","getHeader","Slot","NotFound","RequisitionListGridWrapper","RequisitionListModal","SvgAdd","React","SvgCart","SvgChevronDown","SvgList","SvgMinus","SvgSearch","SvgTrash","updateCounter","useRequisitionLists","lists","setLists","loading","setLoading","lastUpdate","setLastUpdate","setRequisitionListsLoading","res","newLists","setRequisitionLists","multiListListener","payload","singleListListener","useRequisitionListAlert","translationsOverride","alert","setAlert","defaultTranslations","messages","handleRequisitionListAlert","type","action","context","skus","message","timer","useRequisitionListSelectedItems","currentRequisitionList","setCurrentRequisitionList","selectedItems","setSelectedItems","handleItemSelection","itemUid","isSelected","newSet","handleSelectAll","allItemUids","handleSelectNone","useRequisitionListTransfer","sourceListUid","enrichConfigurableProductsInList","fetchAndMergeProducts","showMoveToListModal","setShowMoveToListModal","movingToList","setMovingToList","showCopyToListModal","setShowCopyToListModal","copyingToList","setCopyingToList","handleMoveToList","destinationListUid","moveItemsBetweenRequisitionLists","enrichedWithConfigurable","enrichedList","handleCopyToList","copyItemsBetweenRequisitionLists","isMatchingRequisitionListItem","requisitionListItem","product","options","itemSku","itemOptionUids","productOptionUids","index","RequisitionListSelector","canCreate","sku","selectedOptions","quantity","matchBySKU","beforeAddProdToReqList","listsFromEvents","setListsFromEvents","onRequisitionListsData","onRequisitionListData","currentLists","getRequisitionListsFromState","existingIndex","list","i","unsubMulti","unsubSingle","listsForActiveCheck","isInRequisitionList","productContext","handleOpenModal","handleCloseModal","handleAddProdToReqList","itemToAdd","addProductsToRequisitionList","handleAddProductAndEmitAlert","handleOpenModalWithValidation","selectReqListSection","Icon","ChevronDown","RequisitionListPicker","EmptyList","createReqListSection","Card","newList","RequisitionListActions","modalContent","List","RequisitionListHeader","backLink","actions","isOpen","closeBtnCaption","confirmBtnCaption","handleModalOnClose","handleModalOnConfirm","Modal","routeRequisitionListGrid","onUpdate","onAlert","enrichConfigurableProducts","showRenameModal","setShowRenameModal","showDeleteModal","setShowDeleteModal","showShareModal","setShowShareModal","isDeleting","setIsDeleting","isSharing","setIsSharing","sharingConfigValue","isShareEnabled","itemsCount","isShareDisabled","handleRename","updatedList","handleDeleteList","alertPayload","url","handleShare","handleShareSubmit","customerUids","shareRequisitionListByEmail","RequisitionListHeaderComponent","header","skeletonRowCount","defaultPageSize","hasAnyItems","showEmptyList","alertEvent","pendingAlert","VComponent","PaginationItemsCounter","Pagination","PageSizePicker","selectable","onAddNew","Add","textContent","actionLabel","onAction","Search","ProductListTable","canEdit","handleUpdateQuantity","onAddToCart","onDeleteItem","disabledInputs","setDisabledInputs","inputValues","setInputValues","handleItemCheckboxChange","event","getRowIndex","getImageAlt","getImageSrc","_e","_d","_f","getProductName","getConfiguredProductName","getBundleProducts","option","getSku","getPriceAmount","previousValue","_h","_g","getPriceCurrency","getSubtotal","handleInputChange","inputValue","handleInputBlur","newQty","Checkbox","Image","Price","Cart","Trash","table","h","BatchActions","deletingItemId","addingToCartItemId","bulkAddingToCart","updatingQuantityItemId","bulkMovingToList","bulkCopyingToList","onSelectAll","onSelectNone","onBulkAddToCart","onBulkDelete","onBulkMoveToList","onBulkCopyToList","isDisabled","hasSelectedItems","Minus","onPageSizeChange","disabled","pageSizeOptions","newPageSize","size","Picker","total","from","to","excludeUid","confirmLabel","onConfirm","selectedUid","setSelectedUid","filteredLists","RequisitionListView","skipProductLoading","getProductData","loadingProducts","setLoadingProducts","setDeletingItemId","setAddingToCartItemId","setBulkAddingToCart","setUpdatingQuantityItemId","loadingPage","setLoadingPage","setCurrentPageSize","initializing","setInitializing","itemsToDelete","setItemsToDelete","requisitionListEvent","baseRequisitionList","enrichedItems","productSkus","fetchedProducts","productMap","fetchedProduct","fetchedList","getRequisitionList","handleAddItemsToCart","itemUids","addRequisitionListItemsToCart","totalItems","errorCount","successCount","handleDeleteItems","handleConfirmDelete","updatedRequisitionList","deleteRequisitionListItems","enrichedRequisitionList","newQuantity","currentItem","updatedItem","updateRequisitionListItems","updatedListWithProducts","handleUpdate","isValidBase64Uid"],"mappings":"u5CA0DA,MAAMA,GAAkBC,GAAuB,SACzC,OAAAC,EAAAD,EAAK,uBAAL,MAAAC,EAA2B,OACtBD,EAAK,qBACT,IAAKE,GAAQ,GAAGA,EAAI,YAAY,KAAKA,EAAI,WAAW,EAAE,EACtD,KAAK,IAAI,GAEVC,EAAAH,EAAK,iBAAL,MAAAG,EAAqB,OAChBH,EAAK,eAAe,IAAKE,GAAQA,EAAI,KAAK,EAAE,KAAK,IAAI,EAEvD,EACT,EA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ACxD,EAIDG,IACCvP,EAAC8L,GAAA,CACC,OAAQyD,GACR,UAAWE,GACX,MAAO3P,EAAa,gBACpB,aACEE,EAACyS,GAAA,CACC,WAAYrE,GAAA,YAAAA,EAAwB,IACpC,aAActO,EAAa,kBAC3B,SAAU2P,GACV,UAAWO,EAAA,CACb,EAEF,mBAAoB,IAAMR,GAAuB,EAAK,CAAA,CAAA,CACxD,EAEJ,CAEJ","x_google_ignoreList":[11,12,13,14,15,16,17]}
1
+ {"version":3,"file":"SharedRequisitionList.js","sources":["/@dropins/storefront-requisition-list/src/components/SharedRequisitionList/SharedRequisitionList.tsx","/@dropins/storefront-requisition-list/src/containers/SharedRequisitionList/SharedRequisitionList.tsx","/@dropins/storefront-requisition-list/src/components/ShareRequisitionListContent/ShareRequisitionListContent.tsx","/@dropins/storefront-requisition-list/src/containers/ShareRequisitionListContent/ShareRequisitionListContent.tsx","/@dropins/storefront-requisition-list/src/lib/constants.ts","/@dropins/storefront-requisition-list/src/components/RequisitionListForm/RequisitionListForm.tsx","/@dropins/storefront-requisition-list/src/hooks/useRequisitionListForm.ts","/@dropins/storefront-requisition-list/src/containers/RequisitionListForm/RequisitionListForm.tsx","/@dropins/storefront-requisition-list/src/hooks/useRequisitionListGrid.tsx","/@dropins/storefront-requisition-list/src/hooks/useRequisitionListEnabled.ts","/@dropins/storefront-requisition-list/src/containers/RequisitionListGrid/RequisitionListGrid.tsx","../../node_modules/@adobe-commerce/elsie/src/icons/Add.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Cart.svg","../../node_modules/@adobe-commerce/elsie/src/icons/ChevronDown.svg","../../node_modules/@adobe-commerce/elsie/src/icons/List.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Minus.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Search.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Trash.svg","/@dropins/storefront-requisition-list/src/hooks/useRequisitionLists.ts","/@dropins/storefront-requisition-list/src/hooks/useRequisitionListAlert.tsx","/@dropins/storefront-requisition-list/src/hooks/useRequisitionListSelectedItems.ts","/@dropins/storefront-requisition-list/src/hooks/useRequisitionListTransfer.ts","/@dropins/storefront-requisition-list/src/lib/requisition-list-item-comparator.ts","/@dropins/storefront-requisition-list/src/containers/RequisitionListSelector/RequisitionListSelector.tsx","/@dropins/storefront-requisition-list/src/components/RequisitionListHeader/RequisitionListHeader.tsx","/@dropins/storefront-requisition-list/src/components/RequisitionListModal/RequisitionListModal.tsx","/@dropins/storefront-requisition-list/src/containers/RequisitionListHeader/RequisitionListHeader.tsx","/@dropins/storefront-requisition-list/src/components/RequisitionListGridWrapper/RequisitionListGridWrapper.tsx","/@dropins/storefront-requisition-list/src/components/RequisitionListActions/RequisitionListActions.tsx","/@dropins/storefront-requisition-list/src/components/EmptyList/EmptyList.tsx","/@dropins/storefront-requisition-list/src/components/NotFound/NotFound.tsx","/@dropins/storefront-requisition-list/src/components/ProductListTable/ProductListTable.tsx","/@dropins/storefront-requisition-list/src/components/BatchActions/BatchActions.tsx","/@dropins/storefront-requisition-list/src/components/PageSizePicker/PageSizePicker.tsx","/@dropins/storefront-requisition-list/src/components/PaginationItemsCounter/PaginationItemsCounter.tsx","/@dropins/storefront-requisition-list/src/components/RequisitionListPicker/RequisitionListPicker.tsx","/@dropins/storefront-requisition-list/src/containers/RequisitionListView/RequisitionListView.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport {\n Button,\n Header,\n InLineAlert,\n ProgressSpinner,\n Table,\n} from '@adobe-commerce/elsie/components';\nimport { SharedRequisitionListResult } from '@/requisitionList/api/getSharedRequisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport '@/requisitionList/components/SharedRequisitionList/SharedRequisitionList.css';\n\nexport type SharedRequisitionListStatus =\n | 'preview_loading'\n | 'preview_loaded'\n | 'preview_error'\n | 'importing'\n | 'import_success'\n | 'import_error';\n\nexport interface SharedRequisitionListProps {\n status: SharedRequisitionListStatus;\n previewData: SharedRequisitionListResult | null;\n errorMessage: string;\n onImport: () => void;\n translations: {\n loading: string;\n previewTitle: string;\n senderLabel: string;\n listNameLabel: string;\n descriptionLabel: string;\n itemsCountLabel: string;\n importButton: string;\n importingButton: string;\n successImport: string;\n skuHeader: string;\n qtyHeader: string;\n optionsHeader: string;\n };\n}\n\nconst getItemOptions = (item: Item): string => {\n if (item.configurable_options?.length) {\n return item.configurable_options\n .map((opt) => `${opt.option_label}: ${opt.value_label}`)\n .join(', ');\n }\n if (item.bundle_options?.length) {\n return item.bundle_options.map((opt) => opt.label).join(', ');\n }\n return '';\n};\n\nexport const SharedRequisitionList: FunctionComponent<\n SharedRequisitionListProps\n> = ({ status, previewData, errorMessage, onImport, translations }) => {\n if (status === 'preview_loading') {\n return (\n <div className=\"shared-requisition-list__loading\">\n <ProgressSpinner />\n <span>{translations.loading}</span>\n </div>\n );\n }\n\n if (status === 'preview_error') {\n return (\n <div className=\"shared-requisition-list__container\">\n <InLineAlert heading={errorMessage} type=\"error\" variant=\"primary\" />\n </div>\n );\n }\n\n if (!previewData) {\n return null;\n }\n\n const listName = previewData.requisitionList.name;\n const items = previewData.requisitionList.items ?? [];\n const isImporting = status === 'importing';\n const isImported = status === 'import_success';\n\n const columns = [\n { label: translations.skuHeader, key: 'sku' },\n { label: translations.qtyHeader, key: 'qty' },\n { label: translations.optionsHeader, key: 'options' },\n ];\n\n const rowData = items.map((item) => ({\n sku: item.sku,\n qty: item.quantity,\n options: getItemOptions(item),\n }));\n\n return (\n <div className=\"shared-requisition-list__preview\">\n <Header\n title={translations.previewTitle}\n aria-label={translations.previewTitle}\n />\n\n {status === 'import_success' && (\n <div className=\"shared-requisition-list__alert-wrapper\">\n <InLineAlert\n heading={translations.successImport.replace('{listName}', listName)}\n type=\"success\"\n variant=\"primary\"\n />\n </div>\n )}\n\n {status === 'import_error' && (\n <div className=\"shared-requisition-list__alert-wrapper\">\n <InLineAlert heading={errorMessage} type=\"error\" variant=\"primary\" />\n </div>\n )}\n\n <div className=\"shared-requisition-list__preview-details\">\n <div className=\"shared-requisition-list__preview-row\">\n <span className=\"shared-requisition-list__preview-label\">\n {translations.senderLabel}\n </span>\n <span className=\"shared-requisition-list__preview-value\">\n {previewData.senderName}\n </span>\n </div>\n <div className=\"shared-requisition-list__preview-row\">\n <span className=\"shared-requisition-list__preview-label\">\n {translations.listNameLabel}\n </span>\n <span className=\"shared-requisition-list__preview-value\">\n {listName}\n </span>\n </div>\n {previewData.requisitionList.description && (\n <div className=\"shared-requisition-list__preview-row\">\n <span className=\"shared-requisition-list__preview-label\">\n {translations.descriptionLabel}\n </span>\n <span className=\"shared-requisition-list__preview-value\">\n {previewData.requisitionList.description}\n </span>\n </div>\n )}\n </div>\n\n {items.length > 0 && (\n <div className=\"shared-requisition-list__table-wrapper\">\n <Table\n columns={columns}\n rowData={rowData}\n data-testid=\"shared-list-items-table\"\n />\n </div>\n )}\n\n <div className=\"shared-requisition-list__actions\">\n <Button\n type=\"button\"\n variant=\"primary\"\n onClick={onImport}\n disabled={isImporting || isImported}\n data-testid=\"import-shared-list-btn\"\n >\n {isImporting\n ? translations.importingButton\n : translations.importButton}\n </Button>\n </div>\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useCallback, useEffect, useRef, useState } from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport {\n getSharedRequisitionList,\n SharedRequisitionListResult,\n} from '@/requisitionList/api/getSharedRequisitionList';\nimport { importSharedRequisitionList } from '@/requisitionList/api/importSharedRequisitionList';\nimport {\n SharedRequisitionList as SharedRequisitionListView,\n SharedRequisitionListStatus,\n} from '@/requisitionList/components/SharedRequisitionList';\n\nexport interface SharedRequisitionListProps {\n /**\n * The share token from the URL (e.g. from ?requisition_id=<token>).\n */\n token: string;\n /**\n * Called with the imported list UID and list name on a successful import.\n * The integration should navigate to the requisition list detail page.\n *\n * Note: this callback is captured at mount time. Pass a stable reference\n * (e.g. a module-level function or a `useCallback` with no deps) so that\n * the closure always holds the correct value.\n */\n routeRequisitionList?: (uid: string, listName: string) => string | void;\n}\n\nexport const SharedRequisitionList: Container<SharedRequisitionListProps> = ({\n token,\n routeRequisitionList,\n}: SharedRequisitionListProps) => {\n const [status, setStatus] = useState<SharedRequisitionListStatus>('preview_loading');\n const [previewData, setPreviewData] =\n useState<SharedRequisitionListResult | null>(null);\n const [errorMessage, setErrorMessage] = useState('');\n const isMountedRef = useRef(true);\n\n const translations = useText({\n loading: 'RequisitionList.SharedRequisitionList.loading',\n previewTitle: 'RequisitionList.SharedRequisitionList.previewTitle',\n senderLabel: 'RequisitionList.SharedRequisitionList.senderLabel',\n listNameLabel: 'RequisitionList.SharedRequisitionList.listNameLabel',\n descriptionLabel: 'RequisitionList.SharedRequisitionList.descriptionLabel',\n itemsCountLabel: 'RequisitionList.SharedRequisitionList.itemsCountLabel',\n importButton: 'RequisitionList.SharedRequisitionList.importButton',\n importingButton: 'RequisitionList.SharedRequisitionList.importingButton',\n errorPreview: 'RequisitionList.SharedRequisitionList.errorPreview',\n successImport: 'RequisitionList.RequisitionListAlert.successImport',\n errorImport: 'RequisitionList.RequisitionListAlert.errorImport',\n skuHeader: 'RequisitionList.SharedRequisitionList.skuHeader',\n qtyHeader: 'RequisitionList.SharedRequisitionList.qtyHeader',\n optionsHeader: 'RequisitionList.SharedRequisitionList.optionsHeader',\n });\n\n useEffect(() => {\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n\n useEffect(() => {\n getSharedRequisitionList(token)\n .then((result) => {\n if (!isMountedRef.current) return;\n\n if (!result) {\n setErrorMessage('');\n setStatus('preview_error');\n return;\n }\n\n setPreviewData(result);\n setStatus('preview_loaded');\n })\n .catch((err: unknown) => {\n if (!isMountedRef.current) return;\n setErrorMessage(err instanceof Error && err.message ? err.message : '');\n setStatus('preview_error');\n });\n }, [token]);\n\n const handleImport = useCallback(() => {\n setStatus('importing');\n setErrorMessage('');\n\n importSharedRequisitionList(token)\n .then(({ requisitionList, userErrors }) => {\n if (!isMountedRef.current) return;\n\n if (userErrors.length > 0) {\n setErrorMessage(userErrors[0].message);\n setStatus('import_error');\n return;\n }\n\n const name = requisitionList?.name ?? '';\n const uid = requisitionList?.uid ?? '';\n\n events.emit('requisitionList/alert', {\n action: 'import',\n type: 'success',\n context: 'requisitionList',\n listName: name,\n });\n\n if (routeRequisitionList) {\n routeRequisitionList(uid, name);\n return;\n }\n\n setStatus('import_success');\n })\n .catch((err: unknown) => {\n if (!isMountedRef.current) return;\n setErrorMessage(err instanceof Error && err.message ? err.message : '');\n setStatus('import_error');\n });\n }, [token, routeRequisitionList]);\n\n // Resolve the translation fallback at render time so effects don't need\n // translations in their dependency arrays.\n const resolvedErrorMessage =\n errorMessage ||\n (status === 'import_error' ? translations.errorImport : translations.errorPreview);\n\n return (\n <SharedRequisitionListView\n status={status}\n previewData={previewData}\n errorMessage={resolvedErrorMessage}\n onImport={handleImport}\n translations={translations}\n />\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport {\n Button,\n Divider,\n Field,\n Input,\n ProgressSpinner,\n MultiSelect,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/requisitionList/components/ShareRequisitionListContent/ShareRequisitionListContent.css';\n\nexport interface ShareRequisitionListContentProps {\n loadingUsers: boolean;\n usersErrorMessage: string | null;\n loadingLink: boolean;\n selectedUserValues: string[];\n multiSelectOptions: Array<{ label: string; value: string }>;\n shareLink: string | null;\n linkErrorMessage: string | null;\n linkCopied: boolean;\n isSubmitting: boolean;\n canSubmit: boolean;\n onSubmitClick: () => void;\n onCopyLinkClick: () => void;\n onSelectedUsersChange: (values: Array<string | number>) => void;\n onUsersFieldInteract: () => void;\n selectionError: string | null;\n submitErrorMessage: string | null;\n isShareSuccess: boolean;\n sharedRecipientEmails: string[];\n}\n\nexport const ShareRequisitionListContent: FunctionComponent<\n ShareRequisitionListContentProps\n> = ({\n loadingUsers,\n usersErrorMessage,\n loadingLink,\n selectedUserValues,\n multiSelectOptions,\n shareLink,\n linkErrorMessage,\n linkCopied,\n isSubmitting,\n canSubmit,\n onSubmitClick,\n onCopyLinkClick,\n onSelectedUsersChange,\n onUsersFieldInteract,\n selectionError,\n submitErrorMessage,\n isShareSuccess,\n sharedRecipientEmails,\n}) => {\n const translations = useText({\n emailInstruction:\n 'RequisitionList.ShareRequisitionListContent.emailInstruction',\n emailLabel: 'RequisitionList.ShareRequisitionListContent.emailLabel',\n emailPlaceholder:\n 'RequisitionList.ShareRequisitionListContent.emailPlaceholder',\n submitLabel: 'RequisitionList.ShareRequisitionListContent.submitLabel',\n linkInstruction:\n 'RequisitionList.ShareRequisitionListContent.linkInstruction',\n copyLink: 'RequisitionList.ShareRequisitionListContent.copyLink',\n linkCopied: 'RequisitionList.ShareRequisitionListContent.linkCopied',\n loadingUsers: 'RequisitionList.ShareRequisitionListContent.loadingUsers',\n loadingLink: 'RequisitionList.ShareRequisitionListContent.loadingLink',\n noUsersAvailable:\n 'RequisitionList.ShareRequisitionListContent.noUsersAvailable',\n maxRecipientsValidation:\n 'RequisitionList.ShareRequisitionListContent.maxRecipientsValidation',\n shareSuccessMessage:\n 'RequisitionList.ShareRequisitionListContent.shareSuccessMessage',\n });\n return (\n <div className=\"share-requisition-list-content\">\n {/* Email section */}\n {isShareSuccess ? (\n <div className=\"share-requisition-list-content__success\">\n <p className=\"share-requisition-list-content__instruction\">\n {translations.shareSuccessMessage}\n </p>\n <div className=\"share-requisition-list-content__recipient-list\">\n {sharedRecipientEmails.map((email) => (\n <p\n key={email}\n className=\"share-requisition-list-content__recipient\"\n >\n {email}\n </p>\n ))}\n </div>\n </div>\n ) : (\n <>\n <p className=\"share-requisition-list-content__instruction\">\n {translations.emailInstruction}\n </p>\n\n <div className=\"share-requisition-list-content__field\">\n {loadingUsers ? (\n <div className=\"share-requisition-list-content__loading\">\n <ProgressSpinner size=\"small\" stroke=\"3\" />\n <span>{translations.loadingUsers}</span>\n </div>\n ) : usersErrorMessage ? (\n <p className=\"dropin-field__hint dropin-field__hint--medium dropin-field__hint--error\">\n {usersErrorMessage}\n </p>\n ) : (\n <Field\n label={translations.emailLabel}\n error={selectionError ?? undefined}\n disabled={isSubmitting}\n onMouseDown={onUsersFieldInteract}\n onKeyDown={onUsersFieldInteract}\n >\n <MultiSelect\n options={multiSelectOptions}\n value={selectedUserValues}\n onChange={onSelectedUsersChange}\n placeholder={translations.emailPlaceholder}\n noResultsText={translations.noUsersAvailable}\n disabled={isSubmitting}\n error={!!selectionError}\n className=\"share-requisition-list-content__multi-select\"\n />\n </Field>\n )}\n </div>\n\n <div className=\"share-requisition-list-content__actions\">\n <Button\n variant=\"primary\"\n onClick={onSubmitClick}\n disabled={!canSubmit}\n type=\"button\"\n data-testid=\"share-submit-btn\"\n >\n {translations.submitLabel}\n </Button>\n </div>\n {submitErrorMessage && (\n <p className=\"dropin-field__hint dropin-field__hint--medium dropin-field__hint--error\">\n {submitErrorMessage}\n </p>\n )}\n </>\n )}\n\n {/* Link section */}\n <Divider\n variant={'secondary'}\n className=\"share-requisition-list-content__divider-secondary\"\n />\n\n <p className=\"share-requisition-list-content__instruction\">\n {translations.linkInstruction}\n </p>\n\n {loadingLink ? (\n <div className=\"share-requisition-list-content__loading\">\n <ProgressSpinner size=\"small\" stroke=\"3\" />\n <span>{translations.loadingLink}</span>\n </div>\n ) : shareLink ? (\n <>\n <div className=\"share-requisition-list-content__link-row\">\n <Input\n readOnly\n value={shareLink}\n data-testid=\"share-link-field\"\n />\n </div>\n\n <div className=\"share-requisition-list-content__actions\">\n <Button\n variant=\"secondary\"\n onClick={onCopyLinkClick}\n type=\"button\"\n data-testid=\"copy-link-btn\"\n >\n {linkCopied ? translations.linkCopied : translations.copyLink}\n </Button>\n </div>\n </>\n ) : linkErrorMessage ? (\n <p className=\"dropin-field__hint dropin-field__hint--medium dropin-field__hint--error\">\n {linkErrorMessage}\n </p>\n ) : null}\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useState, useEffect, useCallback } from 'preact/hooks';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport {\n getCompanyUsers,\n CompanyUser,\n} from '@/requisitionList/api/getCompanyUsers';\nimport {\n shareRequisitionListByToken,\n ShareRequisitionListByTokenResult,\n} from '@/requisitionList/api/shareRequisitionListByToken';\nimport { ShareRequisitionListByEmailError } from '@/requisitionList/api/shareRequisitionListByEmail';\nimport { ShareRequisitionListContent as ShareRequisitionListContentComponent } from '@/requisitionList/components/ShareRequisitionListContent/ShareRequisitionListContent';\nimport { state } from '@/requisitionList/lib/state';\n\nexport interface ShareRequisitionListContentProps {\n requisitionListUid: string;\n isSubmitting: boolean;\n onSubmit: (\n customerUids: string[]\n ) => Promise<Array<ShareRequisitionListByEmailError> | null>;\n currentCustomerEmail?: string;\n /**\n * Called with the already-built relative share URL to allow customization (e.g. making it absolute).\n * Example: (relativeUrl) => `${window.location.origin}${relativeUrl}`\n * Falls back to using the relative URL as-is, built from the storefront path in store config.\n */\n routeSharedRequisitionList?: (relativeUrl: string) => string;\n}\n\nexport const ShareRequisitionListContent: Container<\n ShareRequisitionListContentProps\n> = ({\n requisitionListUid,\n isSubmitting,\n onSubmit,\n currentCustomerEmail,\n routeSharedRequisitionList,\n}: ShareRequisitionListContentProps) => {\n const translations = useText({\n emailInstruction:\n 'RequisitionList.ShareRequisitionListContent.emailInstruction',\n emailLabel: 'RequisitionList.ShareRequisitionListContent.emailLabel',\n emailPlaceholder:\n 'RequisitionList.ShareRequisitionListContent.emailPlaceholder',\n submitLabel: 'RequisitionList.ShareRequisitionListContent.submitLabel',\n linkInstruction:\n 'RequisitionList.ShareRequisitionListContent.linkInstruction',\n copyLink: 'RequisitionList.ShareRequisitionListContent.copyLink',\n linkCopied: 'RequisitionList.ShareRequisitionListContent.linkCopied',\n loadingUsers:\n 'RequisitionList.ShareRequisitionListContent.loadingUsers',\n loadingLink:\n 'RequisitionList.ShareRequisitionListContent.loadingLink',\n noUsersAvailable:\n 'RequisitionList.ShareRequisitionListContent.noUsersAvailable',\n usersLoadError:\n 'RequisitionList.ShareRequisitionListContent.usersLoadError',\n maxRecipientsValidation:\n 'RequisitionList.ShareRequisitionListContent.maxRecipientsValidation',\n shareSuccessMessage:\n 'RequisitionList.ShareRequisitionListContent.shareSuccessMessage',\n });\n\n const [companyUsers, setCompanyUsers] = useState<CompanyUser[]>([]);\n const [loadingUsers, setLoadingUsers] = useState(true);\n const [usersLoadFailed, setUsersLoadFailed] = useState(false);\n const [selectedUids, setSelectedUids] = useState<Set<string>>(new Set());\n\n const [shareLink, setShareLink] = useState<string | null>(null);\n const [loadingLink, setLoadingLink] = useState(true);\n const [linkErrorMessage, setLinkErrorMessage] = useState<string | null>(null);\n const [linkCopied, setLinkCopied] = useState(false);\n const [selectionError, setSelectionError] = useState<string | null>(null);\n const [submitErrorMessage, setSubmitErrorMessage] = useState<string | null>(\n null\n );\n const [isShareSuccess, setIsShareSuccess] = useState(false);\n const [sharedRecipientEmails, setSharedRecipientEmails] = useState<string[]>(\n []\n );\n\n const maxRecipients = (() => {\n const configValue = state.config?.requisition_list_share_max_recipients;\n const parsed = Number(configValue);\n return Number.isFinite(parsed) && parsed > 0 ? parsed : null;\n })();\n\n useEffect(() => {\n getCompanyUsers()\n .then((users: CompanyUser[]) => {\n const colleagues = users.filter((user) => {\n if (\n currentCustomerEmail &&\n user.email.toLowerCase() === currentCustomerEmail.toLowerCase()\n ) {\n return false;\n }\n return true;\n });\n setCompanyUsers(colleagues);\n })\n .catch(() => {\n setUsersLoadFailed(true);\n })\n .finally(() => setLoadingUsers(false));\n }, [currentCustomerEmail]);\n\n useEffect(() => {\n shareRequisitionListByToken(requisitionListUid)\n .then((result: ShareRequisitionListByTokenResult) => {\n if (result.token) {\n const storefrontPath =\n state.config?.requisition_list_share_storefront_path ?? '';\n const relativeUrl = `/${storefrontPath}?requisition_id=${result.token}`;\n const shareLink = routeSharedRequisitionList\n ? routeSharedRequisitionList(relativeUrl)\n : relativeUrl;\n setShareLink(shareLink);\n } else {\n setShareLink(null);\n }\n setLinkErrorMessage(result.errorMessage);\n })\n .finally(() => setLoadingLink(false));\n }, [requisitionListUid, routeSharedRequisitionList]);\n\n const handleSubmit = useCallback(async () => {\n const selectedIds = Array.from(selectedUids);\n const selectedEmails = companyUsers\n .filter((user) => selectedIds.includes(String(user.id)))\n .map((user) => user.email);\n\n const errors = await onSubmit(selectedIds);\n if (!errors) {\n setIsShareSuccess(true);\n setSharedRecipientEmails(selectedEmails);\n setSubmitErrorMessage(null);\n } else {\n setSubmitErrorMessage(errors[0]?.message || null);\n }\n }, [selectedUids, companyUsers, onSubmit]);\n\n const handleCopyLink = useCallback(() => {\n navigator.clipboard.writeText(shareLink!).then(\n () => {\n setLinkCopied(true);\n setTimeout(() => setLinkCopied(false), 3000);\n },\n (err) => {\n console.error('Failed to copy share link to clipboard:', err);\n }\n );\n }, [shareLink]);\n\n const multiSelectOptions = companyUsers.map((user) => ({\n label: `${user.firstname} ${user.lastname} (${user.email})`,\n value: user.id,\n }));\n\n const usersErrorMessage = usersLoadFailed ? translations.usersLoadError : null;\n\n const canSubmit = !isSubmitting && selectedUids.size > 0 && !selectionError;\n\n return (\n <ShareRequisitionListContentComponent\n loadingUsers={loadingUsers}\n usersErrorMessage={usersErrorMessage}\n loadingLink={loadingLink}\n selectedUserValues={Array.from(selectedUids)}\n multiSelectOptions={multiSelectOptions}\n shareLink={shareLink}\n linkErrorMessage={linkErrorMessage}\n linkCopied={linkCopied}\n isSubmitting={isSubmitting}\n canSubmit={canSubmit}\n onSubmitClick={handleSubmit}\n onCopyLinkClick={handleCopyLink}\n onUsersFieldInteract={() => {\n if (selectionError) {\n setSelectionError(null);\n }\n if (submitErrorMessage) {\n setSubmitErrorMessage(null);\n }\n }}\n onSelectedUsersChange={(values: Array<string | number>) => {\n const nextValues = values.map(String);\n if (maxRecipients && nextValues.length > maxRecipients) {\n setSelectionError(\n translations.maxRecipientsValidation.replace(\n '{max}',\n String(maxRecipients)\n )\n );\n return;\n }\n setSelectionError(null);\n setSelectedUids(new Set(nextValues));\n }}\n selectionError={selectionError}\n submitErrorMessage={submitErrorMessage}\n isShareSuccess={isShareSuccess}\n sharedRecipientEmails={sharedRecipientEmails}\n />\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/**\n * Default page size for pagination in requisition lists\n */\nexport const DEFAULT_PAGE_SIZE = 10;\n\n/**\n * Validation constants for requisition list forms\n */\nexport const NAME_MIN_LENGTH = 3;\nexport const NAME_MAX_LENGTH = 40;\nexport const DESCRIPTION_MAX_LENGTH = 255;\n// Allow letters, numbers, spaces, and common punctuation: . , - _ ! ? ' \" ( ) &\nexport const NAME_VALID_CHARS = /^[a-zA-Z0-9\\s.,\\-_!?'\"()&]+$/;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { useState } from 'preact/hooks';\nimport {\n Field,\n Input,\n TextArea,\n Button,\n InLineAlert,\n ProgressSpinner,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport {\n RequisitionListFormMode,\n RequisitionListFormValues,\n} from '@/requisitionList/hooks/useRequisitionListForm';\nimport {\n NAME_MIN_LENGTH,\n NAME_MAX_LENGTH,\n DESCRIPTION_MAX_LENGTH,\n NAME_VALID_CHARS,\n} from '@/requisitionList/lib/constants';\n\nimport '@/requisitionList/components/RequisitionListForm/RequisitionListForm.css';\n\nexport interface RequisitionListFormProps\n extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n mode: RequisitionListFormMode;\n defaultValues?: RequisitionListFormValues;\n error?: string | null;\n onSubmit: (values: RequisitionListFormValues) => Promise<void> | void;\n onCancel: () => void;\n}\n\nexport const RequisitionListForm: FunctionComponent<\n RequisitionListFormProps\n> = ({\n className,\n mode,\n defaultValues = { name: '', description: '' },\n error = null,\n onSubmit,\n onCancel,\n ...props\n}) => {\n const [values, setValues] =\n useState<RequisitionListFormValues>(defaultValues);\n const [touched, setTouched] = useState({\n name: false,\n });\n const [isSubmitting, setIsSubmitting] = useState(false);\n\n const translations = useText({\n actionCancel: `RequisitionList.RequisitionListForm.actionCancel`,\n actionSave: `RequisitionList.RequisitionListForm.actionSave`,\n requiredField: `RequisitionList.RequisitionListForm.requiredField`,\n nameMinLength: `RequisitionList.RequisitionListForm.nameMinLength`,\n nameInvalidCharacters: `RequisitionList.RequisitionListForm.nameInvalidCharacters`,\n floatingLabel: `RequisitionList.RequisitionListForm.floatingLabel`,\n placeholder: `RequisitionList.RequisitionListForm.placeholder`,\n label: `RequisitionList.RequisitionListForm.label`,\n updateTitle: `RequisitionList.RequisitionListForm.updateTitle`,\n createTitle: `RequisitionList.RequisitionListForm.createTitle`,\n });\n\n // Validation functions\n const validateName = (name: string): string => {\n const trimmedName = name.trim();\n\n if (!trimmedName) {\n return translations.requiredField;\n }\n\n if (trimmedName.length < NAME_MIN_LENGTH) {\n return translations.nameMinLength.replace(\n '{min}',\n NAME_MIN_LENGTH.toString()\n );\n }\n\n if (!NAME_VALID_CHARS.test(trimmedName)) {\n return translations.nameInvalidCharacters;\n }\n\n return '';\n };\n\n const handleChange =\n (field: keyof RequisitionListFormValues) => (e: Event) => {\n const target = e.target as HTMLInputElement | HTMLTextAreaElement;\n setValues((prevValues) => ({\n ...prevValues,\n [field]: target.value,\n }));\n };\n\n const handleBlur = (field: keyof RequisitionListFormValues) => () => {\n setTouched((prev) => ({ ...prev, [field]: true }));\n };\n\n const handleSubmit = async (e: Event) => {\n e.preventDefault();\n\n // Mark all fields as touched on submit attempt\n setTouched({ name: true, description: true });\n\n // Validate all fields\n const nameError = validateName(values.name);\n\n if (nameError || isSubmitting) return;\n\n setIsSubmitting(true);\n try {\n await onSubmit({\n name: values.name.trim(),\n description: values.description?.trim() ?? '',\n });\n } catch {\n setIsSubmitting(false);\n }\n };\n\n // Calculate error messages\n const nameError = touched.name ? validateName(values.name) : '';\n\n const title =\n mode === 'update' ? translations.updateTitle : translations.createTitle;\n\n return (\n <div {...props} className={classes(['requisition-list-form', className])}>\n <div className=\"requisition-list-form__title\">\n {title}\n {isSubmitting ? (\n <div\n className={classes([\n 'requisition-list-form_progress-spinner',\n className,\n ])}\n data-testid=\"requisition-list-form-progress-spinner\"\n >\n <ProgressSpinner stroke={'4'} size={'small'} />\n </div>\n ) : null}\n </div>\n\n {error ? (\n <InLineAlert\n type=\"error\"\n className=\"requisition-list-form__notification\"\n variant=\"secondary\"\n heading={error}\n data-testid=\"requisition-list-alert\"\n />\n ) : null}\n\n <form\n className={classes(['requisition-list-form__form', className])}\n onSubmit={handleSubmit}\n >\n <Field error={nameError} disabled={isSubmitting}>\n <Input\n id=\"requisition-list-form-name\"\n name=\"name\"\n type=\"text\"\n floatingLabel={translations.floatingLabel}\n placeholder={translations.placeholder}\n maxLength={NAME_MAX_LENGTH}\n value={values.name}\n onChange={handleChange('name')}\n onBlur={handleBlur('name')}\n />\n </Field>\n\n <Field disabled={isSubmitting}>\n <TextArea\n id=\"requisition-list-form-description\"\n name=\"description\"\n label={translations.label}\n placeholder={translations.label}\n maxLength={DESCRIPTION_MAX_LENGTH}\n value={values.description}\n onChange={handleChange('description')}\n onBlur={handleBlur('description')}\n />\n </Field>\n\n <div className=\"requisition-list-form__actions\">\n <Button\n type=\"button\"\n variant=\"secondary\"\n onClick={onCancel}\n disabled={isSubmitting}\n data-testid=\"requisition-list-form-cancel\"\n >\n {translations.actionCancel}\n </Button>\n <Button\n type=\"submit\"\n disabled={isSubmitting}\n data-testid=\"requisition-list-form-save\"\n >\n {translations.actionSave}\n </Button>\n </div>\n </form>\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useState } from 'preact/hooks';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { createRequisitionList } from '@/requisitionList/api/createRequisitionList/createRequisitionList';\nimport { updateRequisitionList } from '@/requisitionList/api/updateRequisitionList/updateRequisitionList';\n\nexport type RequisitionListFormMode = 'create' | 'update';\nexport type RequisitionListFormValues = { name: string; description?: string };\n\ntype UseRequisitionListFormReturn = {\n error: string | null;\n submit: (\n values: RequisitionListFormValues\n ) => Promise<RequisitionList | null>;\n};\n\nexport function useRequisitionListForm(\n mode: RequisitionListFormMode,\n requisitionListUid?: string,\n onSuccess?: (rl: RequisitionList) => void,\n onError?: (msg: string) => void\n): UseRequisitionListFormReturn {\n const [error, setError] = useState<string | null>(null);\n\n const submit = async (\n values: RequisitionListFormValues\n ): Promise<RequisitionList | null> => {\n setError(null);\n try {\n const description = values.description ?? '';\n const result =\n mode === 'update' && requisitionListUid\n ? await updateRequisitionList(\n requisitionListUid,\n values.name,\n description\n )\n : await createRequisitionList(values.name, description);\n if (result) onSuccess?.(result);\n return result;\n } catch (e: any) {\n const msg = e?.message || 'Unexpected error';\n setError(msg);\n onError?.(msg);\n return null;\n }\n };\n\n return { error, submit };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { RequisitionListForm as RequisitionListFormComponent } from '@/requisitionList/components/RequisitionListForm/RequisitionListForm';\nimport {\n useRequisitionListForm,\n RequisitionListFormMode,\n RequisitionListFormValues,\n} from '@/requisitionList/hooks/useRequisitionListForm';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\n\nexport interface RequisitionListFormProps {\n mode: RequisitionListFormMode;\n requisitionListUid?: string;\n defaultValues?: RequisitionListFormValues;\n onSuccess?: (newList: RequisitionList) => void;\n onError?: (message: string) => void;\n onCancel: () => void;\n}\n\nexport const RequisitionListForm: Container<RequisitionListFormProps> = ({\n mode,\n requisitionListUid,\n defaultValues = { name: '', description: '' },\n onSuccess,\n onError,\n onCancel,\n}) => {\n const { error, submit } = useRequisitionListForm(\n mode,\n requisitionListUid,\n onSuccess,\n onError\n );\n\n const handleSubmit = async (values: RequisitionListFormValues) => {\n await submit(values);\n };\n\n return (\n <RequisitionListFormComponent\n mode={mode}\n defaultValues={defaultValues}\n error={error}\n onSubmit={handleSubmit}\n onCancel={onCancel}\n />\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useMemo, useState, useCallback, useEffect } from 'preact/compat';\nimport { VNode } from 'preact';\nimport { Button } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { RequisitionList as RequisitionListModel } from '@/requisitionList/data/models/requisitionList';\nimport { getRequisitionLists } from '@/requisitionList/api/getRequisitionLists';\nimport { RequisitionLists } from '@/requisitionList/data/models/requisitionLists';\nimport { events } from '@adobe-commerce/event-bus';\nimport { DEFAULT_PAGE_SIZE } from '@/requisitionList/lib/constants';\n\ntype Row = Record<string, VNode | string | number | undefined>;\ntype Callbacks = {\n handleOpenRenameModal: (rl: RequisitionListModel) => void;\n handleOpenDeleteModal: (rl: RequisitionListModel) => void;\n};\n\nexport function useRequisitionListGrid(\n callbacks?: Callbacks,\n routeRequisitionListDetails?: (uid: string) => string | void,\n closeModal?: () => void\n) {\n const translations = useText({\n actionRename: 'RequisitionList.RequisitionListView.actionRename',\n actionDeleteList: 'RequisitionList.RequisitionListView.actionDeleteList',\n });\n\n const [reqLists, setReqLists] = useState<RequisitionLists | null>(null);\n const [isAdding, setIsAdding] = useState(false);\n const [isFetching, setIsFetching] = useState(false);\n\n const handleAddNew = useCallback(() => {\n // Close any open modal before opening create form\n if (closeModal) {\n closeModal();\n }\n setIsAdding(true);\n }, [closeModal]);\n\n const handleCancelCreate = useCallback(() => setIsAdding(false), []);\n\n // Wrap callbacks to close create form when opening modals\n const wrappedCallbacks = useMemo(() => {\n if (!callbacks) return undefined;\n\n return {\n handleOpenRenameModal: (rl: RequisitionListModel) => {\n // Close create form if open - use functional update to avoid dependency on isAdding\n setIsAdding((current) => {\n if (current) return false;\n return current;\n });\n callbacks.handleOpenRenameModal(rl);\n },\n handleOpenDeleteModal: (rl: RequisitionListModel) => {\n // Close create form if open - use functional update to avoid dependency on isAdding\n setIsAdding((current) => {\n if (current) return false;\n return current;\n });\n callbacks.handleOpenDeleteModal(rl);\n },\n };\n }, [callbacks]);\n\n const fetchPage = useCallback(async (page: number, pageSize: number) => {\n setIsFetching(true);\n try {\n const data = await getRequisitionLists(page, pageSize);\n const currentPage = data?.page_info?.current_page ?? 1;\n const totalPages = data?.page_info?.total_pages ?? 0;\n const hasRows = (data?.items?.length ?? 0) > 0;\n\n if (!hasRows && currentPage > 1 && totalPages >= currentPage - 1) {\n const prev = currentPage - 1;\n const prevData = await getRequisitionLists(prev, pageSize);\n setReqLists(prevData);\n } else {\n setReqLists(data);\n }\n } finally {\n setIsFetching(false);\n }\n }, []);\n\n useEffect(() => {\n const requisitionListsEvent = events.on(\n 'requisitionLists/data',\n (data: RequisitionLists) => {\n if (data && data.items) {\n setReqLists(data);\n }\n },\n { eager: true }\n );\n return () => {\n requisitionListsEvent?.off();\n };\n }, []);\n\n useEffect(() => {\n if (!reqLists) {\n void fetchPage(1, DEFAULT_PAGE_SIZE);\n }\n }, [reqLists, fetchPage]);\n\n const handlePageChange = useCallback(\n (page?: number) => {\n const currentPage = page ?? reqLists?.page_info?.current_page ?? 1;\n const currentPageSize =\n reqLists?.page_info?.page_size ?? DEFAULT_PAGE_SIZE;\n return fetchPage(currentPage, currentPageSize);\n },\n [fetchPage, reqLists]\n );\n\n const handlePageSizeChange = useCallback(\n async (pageSize: number) => {\n // Reset to page 1 when changing page size\n await fetchPage(1, pageSize);\n },\n [fetchPage]\n );\n\n const rows: Row[] = useMemo(\n () =>\n (reqLists?.items ?? []).map((rl: RequisitionListModel) => {\n return {\n name: (\n <div className=\"requisition-list-grid-wrapper__name\">\n <div className=\"requisition-list-grid-wrapper__name__title\">\n <a\n href=\"#\"\n onClick={(e: Event): void => {\n e.preventDefault();\n if (routeRequisitionListDetails) {\n const result = routeRequisitionListDetails(rl.uid);\n if (typeof result === 'string') {\n window.location.href = result;\n }\n }\n }}\n >\n {rl.name}\n </a>\n </div>\n {rl.description && (\n <div className=\"requisition-list-grid-wrapper__name__description\">\n {rl.description}\n </div>\n )}\n </div>\n ),\n items_count: rl.items_count,\n last_updated: new Date(rl.updated_at).toLocaleString(),\n actions: (\n <div className=\"requisition-list-grid-wrapper__actions\">\n <Button\n variant=\"tertiary\"\n type=\"button\"\n data-testid=\"rename-button\"\n onClick={() => wrappedCallbacks?.handleOpenRenameModal(rl)}\n >\n {translations.actionRename}\n </Button>\n <Button\n variant=\"tertiary\"\n type=\"button\"\n data-testid=\"delete-button\"\n onClick={() => wrappedCallbacks?.handleOpenDeleteModal(rl)}\n >\n {translations.actionDeleteList}\n </Button>\n </div>\n ),\n };\n }),\n [\n reqLists?.items,\n translations.actionRename,\n translations.actionDeleteList,\n wrappedCallbacks,\n routeRequisitionListDetails,\n ]\n );\n\n return {\n rows,\n isLoading: isFetching || !reqLists,\n pageInfo: reqLists?.page_info,\n totalCount: reqLists?.total_count,\n handlePageChange,\n handlePageSizeChange,\n isAdding,\n handleAddNew,\n handleCancelCreate,\n };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useEffect, useState } from 'preact/compat';\nimport { state } from '@/requisitionList/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nfunction isRequisitionListEnabled(): boolean {\n const config = state.config;\n if (!config) return false;\n return (\n config.is_requisition_list_active === '1' &&\n config.company_enabled === true\n );\n}\n\nexport const useRequisitionListEnabled = () => {\n const [isEnabled, setIsEnabled] = useState<boolean>(isRequisitionListEnabled);\n\n useEffect(() => {\n // Listen for requisition list initialization via event bus\n const configListener = events.on('requisitionList/initialized', () => {\n // Only set false when config explicitly disables; if config is missing\n // (e.g. re-init race), preserve current value so the button doesn't disappear\n const enabled = isRequisitionListEnabled();\n setIsEnabled((prev) => (state.config != null ? enabled : prev));\n });\n\n return () => configListener?.off();\n }, []);\n\n return { isEnabled };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { HTMLAttributes, useState, useCallback } from 'preact/compat';\nimport { Header } from '@adobe-commerce/elsie/components';\nimport { Container, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { RequisitionList as RequisitionListModel } from '@/requisitionList/data/models/requisitionList';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport {\n RequisitionListGridWrapper,\n RequisitionListModal,\n RequisitionListForm,\n NotFound,\n} from '@/requisitionList/components';\nimport { useRequisitionListGrid } from '@/requisitionList/hooks/useRequisitionListGrid';\nimport { useRequisitionListEnabled } from '@/requisitionList/hooks/useRequisitionListEnabled';\nimport { deleteRequisitionList } from '@/requisitionList/api/deleteRequisitionList/deleteRequisitionList';\nimport { updateRequisitionList } from '@/requisitionList/api/updateRequisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface RequisitionListGridProps\n extends HTMLAttributes<HTMLDivElement> {\n routeRequisitionListDetails?: (uid: string) => string | void;\n /**\n * Fallback URL to redirect when requisition lists are not enabled.\n * Defaults to '/customer/account'\n */\n fallbackRoute?: string;\n slots?: {\n Header?: SlotProps;\n };\n}\n\nexport const RequisitionListGrid: Container<RequisitionListGridProps> = ({\n routeRequisitionListDetails,\n fallbackRoute = '/customer/account',\n slots,\n}: RequisitionListGridProps) => {\n const { isEnabled } = useRequisitionListEnabled();\n\n const [modal, setModal] = useState<{\n type: 'rename' | 'delete' | null;\n isOpen: boolean;\n isLoading: boolean;\n requisitionList: RequisitionListModel | null;\n }>({\n type: null,\n isOpen: false,\n isLoading: false,\n requisitionList: null,\n });\n\n const closeModal = useCallback(() => {\n setModal({\n type: null,\n isOpen: false,\n isLoading: false,\n requisitionList: null,\n });\n }, []);\n\n const handleOpenRenameModal = useCallback((rl: RequisitionListModel) => {\n setModal({\n type: 'rename',\n isOpen: true,\n isLoading: false,\n requisitionList: rl,\n });\n }, []);\n\n const handleOpenDeleteModal = useCallback((rl: RequisitionListModel) => {\n setModal({\n type: 'delete',\n isOpen: true,\n isLoading: false,\n requisitionList: rl,\n });\n }, []);\n\n const {\n rows,\n isLoading,\n pageInfo,\n totalCount,\n handlePageChange,\n handlePageSizeChange,\n isAdding,\n handleAddNew,\n handleCancelCreate,\n } = useRequisitionListGrid(\n { handleOpenRenameModal, handleOpenDeleteModal },\n routeRequisitionListDetails,\n closeModal\n );\n\n const handleRenameSubmit = useCallback(\n async (values: { name: string; description?: string }) => {\n /* istanbul ignore next: Defensive check - modal.requisitionList should always be set when this function is called */\n if (!modal.requisitionList) return;\n\n try {\n await updateRequisitionList(\n modal.requisitionList.uid,\n values.name,\n values.description\n );\n events.emit('requisitionList/alert', {\n action: 'update',\n type: 'success',\n context: 'requisitionList',\n });\n await handlePageChange();\n closeModal();\n } catch (error) {\n events.emit('requisitionList/alert', {\n action: 'update',\n type: 'error',\n context: 'requisitionList',\n });\n }\n },\n [modal.requisitionList, handlePageChange, closeModal]\n );\n\n const handleDeleteConfirm = async () => {\n /* istanbul ignore next: Defensive check - modal.requisitionList should always be set when this function is called */\n if (!modal.requisitionList) return;\n setModal({ ...modal, isLoading: true });\n await deleteRequisitionList(modal.requisitionList.uid)\n .then(async () => {\n events.emit('requisitionList/alert', {\n type: 'success',\n action: 'delete',\n context: 'requisitionList',\n });\n })\n .catch(() => {\n events.emit('requisitionList/alert', {\n type: 'error',\n action: 'delete',\n context: 'requisitionList',\n });\n })\n .finally(async () => {\n await handlePageChange();\n closeModal();\n });\n };\n\n const translations = useText({\n containerTitle: `RequisitionList.containerTitle`,\n updateTitle: `RequisitionList.RequisitionListForm.updateTitle`,\n deleteRequisitionListTitle:\n 'RequisitionList.RequisitionListWrapper.deleteRequisitionListTitle',\n deleteRequisitionListMessage:\n 'RequisitionList.RequisitionListWrapper.deleteRequisitionListMessage',\n cancelAction: 'RequisitionList.RequisitionListWrapper.cancelAction',\n confirmAction: 'RequisitionList.RequisitionListWrapper.confirmAction',\n notEnabledTitle: `RequisitionList.RequisitionListsNotEnabled.title`,\n notEnabledMessage: `RequisitionList.RequisitionListsNotEnabled.message`,\n notEnabledActionLabel: `RequisitionList.RequisitionListsNotEnabled.actionLabel`,\n });\n\n const getHeader = useCallback(() => {\n if (slots?.Header) {\n return (\n <Slot\n name=\"Header\"\n aria-label={translations.containerTitle}\n title={translations.containerTitle}\n slot={slots.Header}\n />\n );\n }\n return (\n <Header\n aria-label={translations.containerTitle}\n role=\"region\"\n title={translations.containerTitle}\n />\n );\n }, [slots, translations.containerTitle]);\n\n if (isEnabled === false) {\n return (\n <NotFound\n title={translations.notEnabledTitle}\n message={translations.notEnabledMessage}\n actionLabel={translations.notEnabledActionLabel}\n onAction={() => {\n window.location.href = fallbackRoute;\n }}\n />\n );\n }\n\n return (\n <>\n <RequisitionListGridWrapper\n header={getHeader()}\n rows={rows}\n skeletonRowCount={10}\n isLoading={isLoading}\n pageInfo={pageInfo}\n totalCount={totalCount}\n handlePageChange={handlePageChange}\n handlePageSizeChange={handlePageSizeChange}\n defaultPageSize={10}\n isAdding={isAdding}\n handleAddNew={handleAddNew}\n handleCancelCreate={handleCancelCreate}\n />\n\n {/* Rename Modal */}\n {modal.type === 'rename' && modal.isOpen && modal.requisitionList && (\n <RequisitionListModal\n isOpen={modal.isOpen}\n isLoading={modal.isLoading}\n title={translations.updateTitle}\n modalContent={\n <RequisitionListForm\n mode=\"update\"\n defaultValues={{\n name: modal.requisitionList.name,\n description: modal.requisitionList.description || '',\n }}\n onSubmit={handleRenameSubmit}\n onCancel={closeModal}\n />\n }\n handleModalOnClose={closeModal}\n />\n )}\n\n {/* Delete Confirmation Modal */}\n {modal.type === 'delete' && modal.isOpen && (\n <RequisitionListModal\n isOpen={modal.isOpen}\n isLoading={modal.isLoading}\n title={translations.deleteRequisitionListTitle}\n modalContent={translations.deleteRequisitionListMessage}\n confirmBtnCaption={translations.confirmAction}\n closeBtnCaption={translations.cancelAction}\n handleModalOnClose={closeModal}\n handleModalOnConfirm={handleDeleteConfirm}\n />\n )}\n </>\n );\n};\n","import * as React from \"react\";\nconst SvgAdd = (props) => /* @__PURE__ */ React.createElement(\"svg\", { id: \"Icon_Add_Base\", \"data-name\": \"Icon \\\\u2013 Add \\\\u2013 Base\", xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { id: \"Large\" }, /* @__PURE__ */ React.createElement(\"rect\", { id: \"Placement_area\", \"data-name\": \"Placement area\", width: 24, height: 24, fill: \"#fff\", opacity: 0 }), /* @__PURE__ */ React.createElement(\"g\", { id: \"Add_icon\", \"data-name\": \"Add icon\", transform: \"translate(9.734 9.737)\" }, /* @__PURE__ */ React.createElement(\"line\", { vectorEffect: \"non-scaling-stroke\", id: \"Line_579\", \"data-name\": \"Line 579\", y2: 12.7, transform: \"translate(2.216 -4.087)\", fill: \"none\", stroke: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"line\", { vectorEffect: \"non-scaling-stroke\", id: \"Line_580\", \"data-name\": \"Line 580\", x2: 12.7, transform: \"translate(-4.079 2.263)\", fill: \"none\", stroke: \"currentColor\" }))));\nexport default SvgAdd;\n","import * as React from \"react\";\nconst SvgCart = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { clipPath: \"url(#clip0_102_196)\" }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M18.3601 18.16H6.5601L4.8801 3H2.3501M19.6701 19.59C19.6701 20.3687 19.0388 21 18.2601 21C17.4814 21 16.8501 20.3687 16.8501 19.59C16.8501 18.8113 17.4814 18.18 18.2601 18.18C19.0388 18.18 19.6701 18.8113 19.6701 19.59ZM7.42986 19.59C7.42986 20.3687 6.79858 21 6.01986 21C5.24114 21 4.60986 20.3687 4.60986 19.59C4.60986 18.8113 5.24114 18.18 6.01986 18.18C6.79858 18.18 7.42986 18.8113 7.42986 19.59Z\", stroke: \"currentColor\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M5.25 6.37L20.89 8.06L20.14 14.8H6.19\", stroke: \"currentColor\", strokeLinejoin: \"round\" })), /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"clipPath\", { id: \"clip0_102_196\" }, /* @__PURE__ */ React.createElement(\"rect\", { vectorEffect: \"non-scaling-stroke\", width: 19.29, height: 19.5, fill: \"white\", transform: \"translate(2.3501 2.25)\" }))));\nexport default SvgCart;\n","import * as React from \"react\";\nconst SvgChevronDown = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"square\", strokeLinejoin: \"round\" }));\nexport default SvgChevronDown;\n","import * as React from \"react\";\nconst SvgList = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"rect\", { x: 4.89282, y: 2.75, width: 14.2143, height: 18.5, rx: 2.25, stroke: \"currentColor\", strokeWidth: 1 }), /* @__PURE__ */ React.createElement(\"line\", { x1: 9.85718, y1: 7.67871, x2: 16.2857, y2: 7.67871, stroke: \"currentColor\", strokeWidth: 1 }), /* @__PURE__ */ React.createElement(\"line\", { x1: 9.85718, y1: 11.9644, x2: 16.2857, y2: 11.9644, stroke: \"currentColor\", strokeWidth: 1 }), /* @__PURE__ */ React.createElement(\"line\", { x1: 9.85718, y1: 16.25, x2: 16.2857, y2: 16.25, stroke: \"currentColor\", strokeWidth: 1 }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 7.71429, cy: 7.71429, r: 0.714286, fill: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 7.71429, cy: 11.9999, r: 0.714286, fill: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"circle\", { cx: 7.71429, cy: 16.2856, r: 0.714286, fill: \"currentColor\" }));\nexport default SvgList;\n","import * as React from \"react\";\nconst SvgMinus = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M17.3332 11.75H6.6665\", strokeWidth: 1, strokeLinecap: \"square\", strokeLinejoin: \"round\", vectorEffect: \"non-scaling-stroke\", fill: \"none\", stroke: \"currentColor\" }));\nexport default SvgMinus;\n","import * as React from \"react\";\nconst SvgSearch = (props) => /* @__PURE__ */ React.createElement(\"svg\", { id: \"Icon_Search_Base\", \"data-name\": \"Icon \\\\u2013 Search \\\\u2013 Base\", xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, fill: \"none\", viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { id: \"Large\" }, /* @__PURE__ */ React.createElement(\"rect\", { id: \"Placement_area\", \"data-name\": \"Placement area\", width: 24, height: 24, fill: \"#fff\", opacity: 0 }), /* @__PURE__ */ React.createElement(\"g\", { id: \"Search_icon\", \"data-name\": \"Search icon\", transform: \"translate(3.75 3.75)\" }, /* @__PURE__ */ React.createElement(\"circle\", { vectorEffect: \"non-scaling-stroke\", id: \"Ellipse_186\", \"data-name\": \"Ellipse 186\", cx: 6, cy: 6, r: 6, fill: \"none\", stroke: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"line\", { vectorEffect: \"non-scaling-stroke\", id: \"Line_556\", \"data-name\": \"Line 556\", x2: 6, y2: 6, transform: \"translate(10.5 10.5)\", fill: \"none\", stroke: \"currentColor\" }))));\nexport default SvgSearch;\n","import * as React from \"react\";\nconst SvgTrash = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M1 5H23\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M17.3674 22H6.63446C5.67952 22 4.88992 21.2688 4.8379 20.3338L4 5H20L19.1621 20.3338C19.1119 21.2688 18.3223 22 17.3655 22H17.3674Z\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M9.87189 2H14.1281C14.6085 2 15 2.39766 15 2.88889V5H9V2.88889C9 2.39912 9.39006 2 9.87189 2Z\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M8.87402 8.58057L9.39348 17.682\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M14.6673 8.58057L14.146 17.682\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }));\nexport default SvgTrash;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useEffect, useState } from 'preact/compat';\nimport {\n state,\n setRequisitionLists,\n setRequisitionListsLoading,\n updateRequisitionList,\n} from '@/requisitionList/lib/state';\nimport { getRequisitionLists } from '@/requisitionList/api';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nlet updateCounter = 0; // Counter to track updates across all hooks\n\nexport const useRequisitionLists = () => {\n const [lists, setLists] = useState<RequisitionList[]>(state.requisitionLists);\n const [loading, setLoading] = useState(state.requisitionListsLoading);\n const [lastUpdate, setLastUpdate] = useState(updateCounter);\n\n // Fetch lists if empty on mount\n useEffect(() => {\n if (state.requisitionLists.length === 0 && !state.requisitionListsLoading) {\n setRequisitionListsLoading(true);\n getRequisitionLists(1, 100)\n .then((res: { items: RequisitionList[] }) => {\n const newLists = res?.items || [];\n setRequisitionLists(newLists);\n updateCounter++;\n })\n .catch((error: any) => {\n console.error('Error fetching requisition lists:', error);\n setRequisitionLists([]);\n updateCounter++;\n })\n .finally(() => {\n setRequisitionListsLoading(false);\n });\n }\n }, []);\n\n // Listen to event bus updates\n useEffect(() => {\n const multiListListener = events.on(\n 'requisitionLists/data',\n (payload: RequisitionList[] | null) => {\n if (payload) {\n setRequisitionLists(payload);\n updateCounter++;\n setLastUpdate(updateCounter);\n setLists(state.requisitionLists);\n setLoading(state.requisitionListsLoading);\n }\n }\n );\n\n const singleListListener = events.on(\n 'requisitionList/data',\n (payload: RequisitionList | null) => {\n if (!payload) return;\n\n // Only the FIRST hook instance to receive this should update\n // Use the updateRequisitionList helper which handles both add and update\n updateRequisitionList(payload);\n updateCounter++;\n setLastUpdate(updateCounter);\n setLists([...state.requisitionLists]);\n setLoading(state.requisitionListsLoading);\n }\n );\n\n return () => {\n multiListListener?.off();\n singleListListener?.off();\n };\n }, []);\n\n // Sync with global state when it changes\n useEffect(() => {\n if (lastUpdate !== updateCounter) {\n setLists(state.requisitionLists);\n setLoading(state.requisitionListsLoading);\n setLastUpdate(updateCounter);\n }\n }, [lastUpdate]);\n\n return { lists, loading };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useCallback, useMemo, useState } from 'preact/compat';\nimport { RequisitionListActionPayload } from 'adobe-commerce/event-bus';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nexport interface Alert {\n type: string;\n description: string;\n action?: string;\n sku?: string;\n}\n\nexport function useRequisitionListAlert(\n translationsOverride?: Record<string, string>\n) {\n const [alert, setAlert] = useState<Alert | null>(null);\n\n const defaultTranslations = useText({\n errorCreate: `RequisitionList.RequisitionListAlert.errorCreate`,\n successCreate: `RequisitionList.RequisitionListAlert.successCreate`,\n errorDeleteItem: `RequisitionList.RequisitionListAlert.errorDeleteItem`,\n successDeleteItem: `RequisitionList.RequisitionListAlert.successDeleteItem`,\n errorDeleteReqList: `RequisitionList.RequisitionListAlert.errorDeleteReqList`,\n successDeleteReqList: `RequisitionList.RequisitionListAlert.successDeleteReqList`,\n errorAddToCart: `RequisitionList.RequisitionListAlert.errorAddToCart`,\n successAddToCart: `RequisitionList.RequisitionListAlert.successAddToCart`,\n errorUpdateQuantity: `RequisitionList.RequisitionListAlert.errorUpdateQuantity`,\n successUpdateQuantity: `RequisitionList.RequisitionListAlert.successUpdateQuantity`,\n errorUpdate: `RequisitionList.RequisitionListAlert.errorUpdate`,\n successUpdate: `RequisitionList.RequisitionListAlert.successUpdate`,\n errorMove: `RequisitionList.RequisitionListAlert.errorMove`,\n successMove: `RequisitionList.RequisitionListAlert.successMove`,\n errorAddToRequisitionList: `RequisitionList.RequisitionListAlert.errorAddToRequisitionList`,\n successAddToRequisitionList: `RequisitionList.RequisitionListAlert.successAddToRequisitionList`,\n errorMoveToList: `RequisitionList.RequisitionListAlert.errorMoveToList`,\n successMoveToList: `RequisitionList.RequisitionListAlert.successMoveToList`,\n errorCopyToList: `RequisitionList.RequisitionListAlert.errorCopyToList`,\n successCopyToList: `RequisitionList.RequisitionListAlert.successCopyToList`,\n errorImport: `RequisitionList.RequisitionListAlert.errorImport`,\n successImport: `RequisitionList.RequisitionListAlert.successImport`,\n });\n\n const translations = useMemo(\n () => ({\n ...defaultTranslations,\n ...translationsOverride,\n }),\n [defaultTranslations, translationsOverride]\n );\n\n const messages = useMemo(\n () => ({\n create: {\n // adding context for consistency, although 'create' action only applies to requisition lists\n requisitionList: {\n success: translations.successCreate,\n error: translations.errorCreate,\n },\n },\n add: {\n product: {\n success: translations.successAddToRequisitionList,\n error: translations.errorAddToRequisitionList,\n },\n },\n update: {\n product: {\n success: translations.successUpdateQuantity,\n error: translations.errorUpdateQuantity,\n },\n requisitionList: {\n success: translations.successUpdate,\n error: translations.errorUpdate,\n },\n },\n delete: {\n product: {\n success: translations.successDeleteItem,\n error: translations.errorDeleteItem,\n },\n requisitionList: {\n success: translations.successDeleteReqList,\n error: translations.errorDeleteReqList,\n },\n },\n move: {\n product: {\n success: translations.successMove,\n error: translations.errorMove,\n },\n },\n moveToList: {\n product: {\n success: translations.successMoveToList,\n error: translations.errorMoveToList,\n },\n },\n copyToList: {\n product: {\n success: translations.successCopyToList,\n error: translations.errorCopyToList,\n },\n },\n import: {\n requisitionList: {\n success: translations.successImport,\n error: translations.errorImport,\n },\n },\n }),\n [translations]\n );\n\n const handleRequisitionListAlert = useCallback(\n (payload: RequisitionListActionPayload) => {\n const { type, action, context, skus, message, listName } = payload;\n // Use custom message if provided, otherwise use predefined message\n let description =\n message && message.length > 0\n ? message.join('. ')\n : messages[action][context][type];\n // Substitute named placeholders (e.g. {listName})\n if (listName) {\n description = description.replace('{listName}', listName);\n }\n setAlert({\n type,\n description,\n sku: skus?.[0],\n });\n\n const timer = setTimeout(() => {\n setAlert(null);\n }, 5000);\n\n return () => clearTimeout(timer);\n },\n [messages]\n );\n\n return { alert, setAlert, handleRequisitionListAlert };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useState, useCallback } from 'preact/hooks';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\n\ntype UseRequisitionListSelectedItems = {\n currentRequisitionList: RequisitionList | null;\n setCurrentRequisitionList: (\n value:\n | RequisitionList\n | null\n | ((prev: RequisitionList | null) => RequisitionList | null)\n ) => void;\n selectedItems: Set<string>;\n setSelectedItems: (\n value: Set<string> | ((prev: Set<string>) => Set<string>)\n ) => void;\n handleItemSelection: (itemUid: string, isSelected: boolean) => void;\n handleSelectAll: () => void;\n handleSelectNone: () => void;\n};\n\nexport function useRequisitionListSelectedItems(): UseRequisitionListSelectedItems {\n const [currentRequisitionList, setCurrentRequisitionList] =\n useState<RequisitionList | null>(null);\n const [selectedItems, setSelectedItems] = useState<Set<string>>(new Set());\n\n const handleItemSelection = useCallback(\n (itemUid: string, isSelected: boolean) => {\n setSelectedItems((prev: Set<string>) => {\n const newSet = new Set(prev);\n if (isSelected) {\n newSet.add(itemUid);\n } else {\n newSet.delete(itemUid);\n }\n return newSet;\n });\n },\n []\n );\n\n const handleSelectAll = useCallback(() => {\n const allItemUids = currentRequisitionList?.items?.map(\n (item: Item) => item.uid\n );\n setSelectedItems(new Set(allItemUids));\n }, [currentRequisitionList]);\n\n const handleSelectNone = useCallback(() => {\n setSelectedItems(new Set());\n }, []);\n\n return {\n currentRequisitionList,\n setCurrentRequisitionList,\n selectedItems,\n setSelectedItems,\n handleItemSelection,\n handleSelectAll,\n handleSelectNone,\n };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useCallback, useState } from 'preact/compat';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { RequisitionListActionPayload } from 'adobe-commerce/event-bus';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { moveItemsBetweenRequisitionLists } from '@/requisitionList/api/moveItemsBetweenRequisitionLists';\nimport { copyItemsBetweenRequisitionLists } from '@/requisitionList/api/copyItemsBetweenRequisitionLists';\n\nexport interface UseRequisitionListTransferOptions {\n sourceListUid: string;\n selectedItems: Set<string>;\n currentPageSize: number;\n currentPage: number;\n enrichConfigurableProductsInList: (\n list: RequisitionList\n ) => Promise<RequisitionList>;\n fetchAndMergeProducts: (\n list: RequisitionList\n ) => Promise<RequisitionList>;\n setCurrentRequisitionList: (list: RequisitionList) => void;\n setSelectedItems: (items: Set<string>) => void;\n handleRequisitionListAlert: (\n payload: RequisitionListActionPayload\n ) => void;\n}\n\nexport function useRequisitionListTransfer({\n sourceListUid,\n selectedItems,\n currentPageSize,\n currentPage,\n enrichConfigurableProductsInList,\n fetchAndMergeProducts,\n setCurrentRequisitionList,\n setSelectedItems,\n handleRequisitionListAlert,\n}: UseRequisitionListTransferOptions) {\n const [showMoveToListModal, setShowMoveToListModal] = useState(false);\n const [movingToList, setMovingToList] = useState(false);\n const [showCopyToListModal, setShowCopyToListModal] = useState(false);\n const [copyingToList, setCopyingToList] = useState(false);\n\n const translations = useText({\n successMoveToList: `RequisitionList.RequisitionListAlert.successMoveToList`,\n successCopyToList: `RequisitionList.RequisitionListAlert.successCopyToList`,\n });\n\n const handleMoveToList = useCallback(\n async (destinationListUid: string) => {\n if (selectedItems.size === 0) return;\n\n setMovingToList(true);\n\n try {\n const result = await moveItemsBetweenRequisitionLists(\n sourceListUid,\n destinationListUid,\n Array.from(selectedItems),\n currentPageSize,\n currentPage\n );\n\n if (result?.sourceList) {\n const enrichedWithConfigurable =\n await enrichConfigurableProductsInList(result.sourceList);\n const enrichedList =\n await fetchAndMergeProducts(enrichedWithConfigurable);\n setCurrentRequisitionList(enrichedList);\n setSelectedItems(new Set());\n\n const listName = result.destinationList?.name || '';\n handleRequisitionListAlert({\n action: 'moveToList',\n type: 'success',\n context: 'product',\n message: [\n translations.successMoveToList.replace('{listName}', listName),\n ],\n });\n } else {\n handleRequisitionListAlert({\n action: 'moveToList',\n type: 'error',\n context: 'product',\n });\n }\n } catch {\n handleRequisitionListAlert({\n action: 'moveToList',\n type: 'error',\n context: 'product',\n });\n } finally {\n setMovingToList(false);\n setShowMoveToListModal(false);\n }\n },\n [\n selectedItems,\n sourceListUid,\n currentPageSize,\n currentPage,\n enrichConfigurableProductsInList,\n fetchAndMergeProducts,\n setCurrentRequisitionList,\n setSelectedItems,\n handleRequisitionListAlert,\n translations.successMoveToList,\n ]\n );\n\n const handleCopyToList = useCallback(\n async (destinationListUid: string) => {\n if (selectedItems.size === 0) return;\n\n setCopyingToList(true);\n\n try {\n const result = await copyItemsBetweenRequisitionLists(\n sourceListUid,\n destinationListUid,\n Array.from(selectedItems)\n );\n\n if (result?.destinationList) {\n setSelectedItems(new Set());\n\n const listName = result.destinationList.name || '';\n handleRequisitionListAlert({\n action: 'copyToList',\n type: 'success',\n context: 'product',\n message: [\n translations.successCopyToList.replace('{listName}', listName),\n ],\n });\n } else {\n handleRequisitionListAlert({\n action: 'copyToList',\n type: 'error',\n context: 'product',\n });\n }\n } catch {\n handleRequisitionListAlert({\n action: 'copyToList',\n type: 'error',\n context: 'product',\n });\n } finally {\n setCopyingToList(false);\n setShowCopyToListModal(false);\n }\n },\n [\n selectedItems,\n sourceListUid,\n setSelectedItems,\n handleRequisitionListAlert,\n translations.successCopyToList,\n ]\n );\n\n return {\n showMoveToListModal,\n setShowMoveToListModal,\n movingToList,\n showCopyToListModal,\n setShowCopyToListModal,\n copyingToList,\n handleMoveToList,\n handleCopyToList,\n };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Item } from '@/requisitionList/data/models/item';\n\nexport interface ProductLike {\n sku: string;\n selectedOptions?: string[];\n}\n\n/**\n * Compares a requisition list item to the current product context (sku + selected options).\n * Used to determine if the product is already in a requisition list for active state.\n * Default: only SKU is compared. Option UIDs are compared only when options.matchBySkuOnly is false.\n */\nexport function isMatchingRequisitionListItem(\n requisitionListItem: Item,\n product: ProductLike,\n options?: { matchBySkuOnly?: boolean }\n): boolean {\n const itemSku = requisitionListItem.sku ?? requisitionListItem.product?.sku;\n if (!itemSku || itemSku !== product.sku) {\n return false;\n }\n\n // Default: match by SKU only. Only compare option UIDs when matchBySkuOnly is explicitly false.\n if (options?.matchBySkuOnly !== false) return true;\n\n // Extract without sorting first to allow an early exit\n const itemOptionUids = (requisitionListItem.configurable_options ?? [])\n .map((opt) => opt.value_uid)\n .filter((uid): uid is string => !!uid);\n\n const productOptionUids = (product.selectedOptions ?? [])\n .filter((uid): uid is string => !!uid);\n\n // Early return if they don't have the same number of options\n if (itemOptionUids.length !== productOptionUids.length) {\n return false;\n }\n\n // Sort only after we know lengths match\n itemOptionUids.sort();\n productOptionUids.sort();\n\n // Compare element by element\n return itemOptionUids.every((uid, index) => uid === productOptionUids[index]);\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n HTMLAttributes,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'preact/compat';\nimport { events } from '@adobe-commerce/event-bus';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { RequisitionList } from '../../data/models/requisitionList.js';\nimport { Item } from '@/requisitionList/data/models/item';\nimport {\n Button,\n Card,\n Icon,\n InLineAlert,\n} from '@adobe-commerce/elsie/components';\nimport { addProductsToRequisitionList } from '@/requisitionList/api/addProductsToRequisitionList/addProductsToRequisitionList';\nimport {\n EmptyList,\n RequisitionListModal,\n RequisitionListActions,\n RequisitionListPicker,\n} from '@/requisitionList/components';\nimport { RequisitionListForm } from '@/requisitionList/containers';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { ChevronDown, List } from '@adobe-commerce/elsie/icons';\nimport '@/requisitionList/containers/RequisitionListSelector/RequisitionListSelector.css';\nimport {\n useRequisitionLists,\n useRequisitionListAlert,\n useRequisitionListEnabled,\n} from '@/requisitionList/hooks';\nimport { isMatchingRequisitionListItem } from '@/requisitionList/lib/requisition-list-item-comparator';\nimport { getRequisitionListsFromState } from '@/requisitionList/lib/state';\n\nexport interface RequisitionListSelectorProps\n extends HTMLAttributes<HTMLDivElement> {\n canCreate?: boolean;\n sku: string;\n selectedOptions?: string[];\n quantity?: number;\n matchBySKU?: boolean;\n beforeAddProdToReqList?: () => Promise<void> | void;\n}\n\nexport const RequisitionListSelector: Container<\n RequisitionListSelectorProps\n> = ({\n canCreate = true,\n sku,\n selectedOptions,\n quantity = 1,\n matchBySKU,\n beforeAddProdToReqList,\n}: RequisitionListSelectorProps) => {\n const translations = useText({\n createTitle: `RequisitionList.RequisitionListForm.createTitle`,\n addToRequisitionList: `RequisitionList.RequisitionListForm.addToRequisitionList`,\n emptyList: `RequisitionList.RequisitionListWrapper.emptyList`,\n addToNewRequisitionList: `RequisitionList.RequisitionListSelector.addToNewRequisitionList`,\n addToSelected: `RequisitionList.RequisitionListSelector.addToSelected`,\n });\n const [isAdding, setIsAdding] = useState(false);\n const { lists } = useRequisitionLists();\n const { isEnabled } = useRequisitionListEnabled();\n\n // Keep lists in sync with event bus so active state updates in real time (e.g. when\n // another part of the page adds/removes this product from a list). Mirrors WishlistToggle.\n const [listsFromEvents, setListsFromEvents] = useState<RequisitionList[] | null>(\n null\n );\n\n useEffect(() => {\n const onRequisitionListsData = (payload: RequisitionList[] | null) => {\n if (payload) setListsFromEvents(payload);\n };\n const onRequisitionListData = (payload: RequisitionList | null) => {\n if (!payload) return;\n setListsFromEvents((prev) => {\n const currentLists = prev ?? getRequisitionListsFromState();\n const existingIndex = currentLists.findIndex(\n (list) => list.uid === payload!.uid\n );\n if (existingIndex >= 0) {\n return currentLists.map((list, i) =>\n i === existingIndex ? payload! : list\n );\n }\n return [...currentLists, payload];\n });\n };\n\n const unsubMulti = events.on('requisitionLists/data', onRequisitionListsData);\n const unsubSingle = events.on('requisitionList/data', onRequisitionListData);\n\n return () => {\n unsubMulti?.off();\n unsubSingle?.off();\n };\n }, []);\n\n const listsForActiveCheck = listsFromEvents ?? lists;\n\n const isInRequisitionList = useMemo(() => {\n if (!listsForActiveCheck?.length) return false;\n const productContext = { sku, selectedOptions };\n return listsForActiveCheck.some((list: RequisitionList) =>\n list.items?.some((item: Item) =>\n isMatchingRequisitionListItem(item, productContext, {\n matchBySkuOnly: matchBySKU,\n })\n )\n );\n }, [listsForActiveCheck, sku, selectedOptions, matchBySKU]);\n\n const { alert, setAlert, handleRequisitionListAlert } =\n useRequisitionListAlert();\n\n const [modal, setModal] = useState<{\n isOpen: boolean;\n isLoading: boolean;\n }>({\n isOpen: false,\n isLoading: false,\n });\n\n const handleOpenModal = useCallback(() => {\n setModal({ isOpen: true, isLoading: false });\n }, []);\n\n const handleCloseModal = useCallback(() => {\n setModal({ isOpen: false, isLoading: false });\n setIsAdding(false);\n setAlert(null);\n }, [setAlert]);\n\n const handleAddProdToReqList = useCallback(\n async (requisitionListUid: string) => {\n try {\n // Build the object dynamically, omitting selected_options if not present\n const itemToAdd = {\n sku,\n quantity,\n ...(selectedOptions && selectedOptions.length > 0\n ? { selected_options: selectedOptions }\n : {}),\n };\n\n await addProductsToRequisitionList(requisitionListUid, [itemToAdd]);\n } catch (error) {\n console.error('Error adding product to list:', error);\n throw error;\n }\n },\n [sku, quantity, selectedOptions]\n );\n\n const handleAddProductAndEmitAlert = useCallback(\n async (requisitionListUid: string) => {\n try {\n await handleAddProdToReqList(requisitionListUid);\n\n handleRequisitionListAlert({\n action: 'add',\n type: 'success',\n context: 'product',\n skus: [sku],\n });\n } catch {\n handleRequisitionListAlert({\n action: 'add',\n type: 'error',\n context: 'product',\n skus: [sku],\n });\n } finally {\n setTimeout(() => {\n handleCloseModal();\n }, 2000);\n }\n },\n [sku, handleAddProdToReqList, handleCloseModal, handleRequisitionListAlert]\n );\n\n const handleOpenModalWithValidation = useCallback(() => {\n if (!beforeAddProdToReqList) {\n handleOpenModal();\n return;\n }\n\n Promise.resolve(beforeAddProdToReqList())\n .then(() => {\n handleOpenModal();\n })\n .catch(() => {\n // Validation failed - don't open modal\n });\n }, [beforeAddProdToReqList, handleOpenModal]);\n\n const selectReqListSection =\n lists?.length > 0 ? (\n isAdding ? (\n <button\n type=\"button\"\n aria-label=\"Select a requisition list\"\n role=\"button\"\n className=\"requisition-list-actions\"\n data-testid=\"requisition-list-actions-button\"\n onClick={() => setIsAdding(false)}\n >\n <span\n className=\"requisition-list-actions__title\"\n data-testid=\"requisition-list-actions-button-text\"\n >\n {translations.addToRequisitionList}\n </span>\n <Icon source={ChevronDown} size=\"32\" />\n </button>\n ) : (\n <RequisitionListPicker\n confirmLabel={translations.addToSelected}\n onConfirm={handleAddProductAndEmitAlert}\n />\n )\n ) : (\n <EmptyList textContent={translations.emptyList} />\n );\n\n const createReqListSection = !isAdding ? (\n <RequisitionListActions\n onAddNew={() => {\n setIsAdding(true);\n }}\n />\n ) : (\n <Card variant=\"secondary\">\n <RequisitionListForm\n mode=\"create\"\n onSuccess={async (newList: RequisitionList) => {\n await handleAddProductAndEmitAlert(newList.uid);\n }}\n onError={() => {\n handleRequisitionListAlert({\n action: 'add',\n type: 'error',\n context: 'product',\n skus: [sku],\n });\n }}\n onCancel={() => {\n setIsAdding(false);\n }}\n />\n </Card>\n );\n\n const modalContent = (\n <>\n {alert && (\n <div className=\"requisition-list__alert-wrapper\">\n <InLineAlert\n key={`requisition-list-selector__alert__${sku}`}\n id={`requisition-list-selector__alert__${sku}`}\n heading={alert.description}\n type={alert.type}\n variant=\"primary\"\n className=\"requisition-list-selector__alert\"\n />\n </div>\n )}\n {!alert && (\n <>\n {selectReqListSection}\n {canCreate && createReqListSection}\n </>\n )}\n </>\n );\n\n // Early return after all hooks have been called\n if (isEnabled === null || !isEnabled) {\n return null;\n }\n\n return (\n <div className=\"requisition-list-selector\">\n <Button\n active={isInRequisitionList}\n activeIcon={<Icon source={List} />} // Change icon here for active state, (filled in icon for example)\n aria-label={translations.addToRequisitionList}\n className={isInRequisitionList ? 'requisition-list-selector--active' : undefined}\n data-testid=\"requisition-list-selector\"\n size=\"medium\"\n variant=\"tertiary\"\n icon={<Icon source={List} />}\n onClick={handleOpenModalWithValidation}\n />\n {modal.isOpen && (\n <RequisitionListModal\n isOpen\n isLoading={modal.isLoading}\n title={translations.addToRequisitionList}\n modalContent={modalContent}\n handleModalOnClose={handleCloseModal}\n />\n )}\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport '@/requisitionList/components/RequisitionListHeader/RequisitionListHeader.css';\n\nexport interface RequisitionListHeaderProps\n extends HTMLAttributes<HTMLDivElement> {\n name: string;\n description?: string;\n backLink?: {\n url: string;\n label: string;\n onClick?: (e: Event) => void;\n };\n actions?: {\n onRename?: () => void;\n onDelete?: () => void;\n onShare?: () => void;\n renameLabel?: string;\n deleteLabel?: string;\n shareLabel?: string;\n shareDisabled?: boolean;\n shareDisabledReason?: string;\n };\n}\n\nexport const RequisitionListHeader: FunctionComponent<\n RequisitionListHeaderProps\n> = ({ name, description, backLink, actions, className, ...props }) => {\n return (\n <div {...props} className={`requisition-list-header ${className || ''}`}>\n {/* Back Link */}\n {backLink && (\n <div className=\"requisition-list-header__back\">\n <a\n href={backLink.url}\n className=\"requisition-list-header__back-link\"\n onClick={backLink.onClick}\n >\n <span className=\"requisition-list-header__back-arrow\">&lt;</span>\n {backLink.label}\n </a>\n </div>\n )}\n\n {/* Title and Actions Row */}\n <div className=\"requisition-list-header__main\">\n <div className=\"requisition-list-header__title-section\">\n <h1 className=\"requisition-list-header__title\">{name}</h1>\n {description && (\n <p className=\"requisition-list-header__description\">\n {description}\n </p>\n )}\n </div>\n\n {/* Action Links */}\n {actions &&\n (actions.onRename ||\n actions.onDelete ||\n actions.onShare ||\n actions.shareDisabled) && (\n <div className=\"requisition-list-header__actions\">\n {(actions.onShare || actions.shareDisabled) && (\n <a\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n if (actions.shareDisabled) {\n return;\n }\n actions.onShare?.();\n }}\n className={`requisition-list-header__action-link ${\n actions.shareDisabled\n ? 'requisition-list-header__action-link--disabled'\n : ''\n }`}\n data-testid=\"share-list-btn\"\n aria-disabled={actions.shareDisabled ? 'true' : 'false'}\n aria-label={\n actions.shareDisabled && actions.shareDisabledReason\n ? `${actions.shareLabel} – ${actions.shareDisabledReason}`\n : undefined\n }\n data-disabled-reason={\n actions.shareDisabled\n ? actions.shareDisabledReason\n : undefined\n }\n >\n {actions.shareLabel}\n </a>\n )}\n {actions.onRename && (\n <a\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n actions.onRename?.();\n }}\n className=\"requisition-list-header__action-link\"\n data-testid=\"rename-list-btn\"\n >\n {actions.renameLabel}\n </a>\n )}\n {actions.onDelete && (\n <a\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n actions.onDelete?.();\n }}\n className=\"requisition-list-header__action-link\"\n data-testid=\"delete-list-btn\"\n >\n {actions.deleteLabel}\n </a>\n )}\n </div>\n )}\n </div>\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { FunctionComponent, VNode } from 'preact';\nimport {\n Modal,\n Button,\n ProgressSpinner,\n} from '@adobe-commerce/elsie/components';\nimport '@/requisitionList/components/RequisitionListModal/RequisitionListModal.css';\n\nexport interface RequisitionListModalProps {\n isOpen: boolean;\n isLoading: boolean;\n title: VNode | string;\n modalContent: VNode | string;\n closeBtnCaption?: string;\n confirmBtnCaption?: string;\n handleModalOnClose?: () => void;\n handleModalOnConfirm?: () => void;\n}\n\nexport const RequisitionListModal: FunctionComponent<\n RequisitionListModalProps\n> = ({\n isOpen,\n isLoading,\n title,\n modalContent,\n closeBtnCaption,\n confirmBtnCaption,\n handleModalOnClose,\n handleModalOnConfirm,\n}) => {\n if (!isOpen) return null;\n\n return (\n <Modal\n className=\"requisition-list-modal--overlay\"\n data-testid=\"requisition-list-modal\"\n size={'medium'}\n centered={false}\n title={title}\n onClose={handleModalOnClose}\n backgroundDim={true}\n clickToDismiss={true}\n escapeToDismiss={true}\n role=\"dialog\"\n aria-label={title}\n >\n <div className=\"requisition-list-modal\">\n {isLoading ? (\n <div\n className=\"requisition-list-modal__spinner\"\n data-testid=\"progress-spinner\"\n >\n <ProgressSpinner stroke={'4'} size={'large'} />\n </div>\n ) : null}\n <p>{modalContent}</p>\n <div className=\"requisition-list-modal__buttons\">\n {handleModalOnClose && closeBtnCaption && (\n <Button\n data-testid=\"rl-modal-close-button\"\n type={'button'}\n onClick={handleModalOnClose}\n variant=\"secondary\"\n disabled={isLoading}\n >\n {closeBtnCaption}\n </Button>\n )}\n {handleModalOnConfirm && confirmBtnCaption && (\n <Button\n data-testid=\"rl-modal-confirm-button\"\n type={'button'}\n onClick={handleModalOnConfirm}\n disabled={isLoading}\n >\n {confirmBtnCaption}\n </Button>\n )}\n </div>\n </div>\n </Modal>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useState, useCallback } from 'preact/hooks';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { RequisitionListHeader as RequisitionListHeaderComponent } from '@/requisitionList/components/RequisitionListHeader/RequisitionListHeader';\nimport { RequisitionListForm } from '@/requisitionList/components/RequisitionListForm/RequisitionListForm';\nimport { RequisitionListModal } from '@/requisitionList/components/RequisitionListModal/RequisitionListModal';\nimport { updateRequisitionList } from '@/requisitionList/api/updateRequisitionList';\nimport { deleteRequisitionList } from '@/requisitionList/api/deleteRequisitionList';\nimport {\n shareRequisitionListByEmail,\n ShareRequisitionListByEmailError,\n} from '@/requisitionList/api/shareRequisitionListByEmail';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { ShareRequisitionListContent } from '@/requisitionList/containers/ShareRequisitionListContent';\nimport { state } from '@/requisitionList/lib/state';\n\nexport interface RequisitionListHeaderProps {\n requisitionList: RequisitionList;\n routeRequisitionListGrid?: () => string | void;\n onUpdate?: (updatedList: RequisitionList) => void | Promise<void>;\n onAlert?: (payload: {\n action: string;\n type: string;\n context: string;\n }) => void;\n enrichConfigurableProducts?: (items: Item[]) => Promise<Item[]>;\n currentCustomerEmail?: string;\n routeSharedRequisitionList?: (relativeUrl: string) => string;\n}\n\nexport const RequisitionListHeader: Container<RequisitionListHeaderProps> = ({\n requisitionList,\n routeRequisitionListGrid,\n onUpdate,\n onAlert,\n enrichConfigurableProducts,\n currentCustomerEmail,\n routeSharedRequisitionList,\n}: RequisitionListHeaderProps) => {\n const [showRenameModal, setShowRenameModal] = useState<boolean>(false);\n const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false);\n const [showShareModal, setShowShareModal] = useState<boolean>(false);\n const [isDeleting, setIsDeleting] = useState<boolean>(false);\n const [isSharing, setIsSharing] = useState<boolean>(false);\n const sharingConfigValue = state.config?.requisition_list_sharing_enabled;\n const isShareEnabled =\n sharingConfigValue !== false && sharingConfigValue !== '0';\n const itemsCount = Number(\n requisitionList.items_count ?? requisitionList.items?.length ?? 0\n );\n const isShareDisabled = itemsCount <= 0 || !state.isCompanyUser;\n\n const translations = useText({\n actionBackToRequisitionLists: `RequisitionList.RequisitionListView.actionBackToRequisitionLists`,\n actionRename: `RequisitionList.RequisitionListView.actionRename`,\n actionDeleteList: `RequisitionList.RequisitionListView.actionDeleteList`,\n actionShare: `RequisitionList.RequisitionListView.actionShare`,\n shareDisabledReason: `RequisitionList.RequisitionListView.shareDisabledReason`,\n shareDisabledNoCompany: `RequisitionList.RequisitionListView.shareDisabledNoCompany`,\n shareListTitle: `RequisitionList.RequisitionListView.shareListTitle`,\n deleteListTitle: `RequisitionList.RequisitionListView.deleteListTitle`,\n deleteListMessage: `RequisitionList.RequisitionListView.deleteListMessage`,\n confirmAction: `RequisitionList.RequisitionListWrapper.confirmAction`,\n cancelAction: `RequisitionList.RequisitionListWrapper.cancelAction`,\n updateTitle: `RequisitionList.RequisitionListForm.updateTitle`,\n });\n\n const handleRename = useCallback(() => {\n setShowRenameModal(true);\n }, []);\n\n const handleRenameSubmit = useCallback(\n async (values: { name: string; description?: string }) => {\n try {\n const updatedList = await updateRequisitionList(\n requisitionList.uid,\n values.name,\n values.description,\n requisitionList.page_info?.page_size,\n requisitionList.page_info?.current_page,\n enrichConfigurableProducts\n );\n if (updatedList) {\n onUpdate?.(updatedList);\n setShowRenameModal(false);\n onAlert?.({\n action: 'update',\n type: 'success',\n context: 'requisitionList',\n });\n } else {\n onAlert?.({\n action: 'update',\n type: 'error',\n context: 'requisitionList',\n });\n }\n } catch (error) {\n onAlert?.({\n action: 'update',\n type: 'error',\n context: 'requisitionList',\n });\n }\n },\n [\n requisitionList.uid,\n requisitionList.page_info,\n onUpdate,\n onAlert,\n enrichConfigurableProducts,\n ]\n );\n\n const handleDeleteList = useCallback(() => {\n setShowDeleteModal(true);\n }, []);\n\n const handleDeleteConfirm = useCallback(async () => {\n setIsDeleting(true);\n try {\n const result = await deleteRequisitionList(requisitionList.uid);\n if (result) {\n const alertPayload = {\n action: 'delete',\n type: 'success',\n context: 'requisitionList',\n };\n\n // Store alert in localStorage before redirecting\n // This ensures the alert is shown after redirect to grid view\n try {\n localStorage.setItem(\n 'requisitionListPendingAlert',\n JSON.stringify(alertPayload)\n );\n } catch (e) {\n // Ignore localStorage errors (e.g., in private browsing mode)\n }\n\n if (routeRequisitionListGrid) {\n const url = routeRequisitionListGrid();\n // If a URL is returned, navigate to it\n if (url && typeof url === 'string') {\n window.location.href = url;\n }\n }\n } else {\n onAlert?.({\n action: 'delete',\n type: 'error',\n context: 'requisitionList',\n });\n }\n } catch (error) {\n onAlert?.({\n action: 'delete',\n type: 'error',\n context: 'requisitionList',\n });\n } finally {\n setIsDeleting(false);\n setShowDeleteModal(false);\n }\n }, [requisitionList.uid, routeRequisitionListGrid, onAlert]);\n\n const handleShare = useCallback(() => {\n setShowShareModal(true);\n }, []);\n\n const handleShareSubmit = useCallback(\n async (\n customerUids: string[]\n ): Promise<Array<ShareRequisitionListByEmailError> | null> => {\n setIsSharing(true);\n try {\n const errors = await shareRequisitionListByEmail(\n requisitionList.uid,\n customerUids\n );\n return errors;\n } catch {\n return [{ code: 'SHARE_FAILED', message: 'Unable to share list.' }];\n } finally {\n setIsSharing(false);\n }\n },\n [requisitionList.uid]\n );\n\n return (\n <>\n <RequisitionListHeaderComponent\n name={requisitionList.name}\n description={requisitionList.description}\n backLink={\n routeRequisitionListGrid\n ? {\n url: '#',\n label: translations.actionBackToRequisitionLists,\n onClick: (e: Event) => {\n e.preventDefault();\n const result = routeRequisitionListGrid();\n // If a URL is returned, navigate to it\n if (result && typeof result === 'string') {\n window.location.href = result;\n }\n },\n }\n : undefined\n }\n actions={{\n onRename: handleRename,\n onDelete: handleDeleteList,\n onShare: isShareEnabled && !isShareDisabled ? handleShare : undefined,\n renameLabel: translations.actionRename,\n deleteLabel: translations.actionDeleteList,\n shareLabel: isShareEnabled ? translations.actionShare : undefined,\n shareDisabled: isShareEnabled && isShareDisabled,\n shareDisabledReason:\n isShareEnabled && isShareDisabled\n ? itemsCount <= 0\n ? translations.shareDisabledReason\n : translations.shareDisabledNoCompany\n : undefined,\n }}\n />\n\n {/* Rename Modal */}\n {showRenameModal && (\n <RequisitionListModal\n isOpen={showRenameModal}\n isLoading={false}\n title={translations.updateTitle}\n modalContent={\n <RequisitionListForm\n mode=\"update\"\n defaultValues={{\n name: requisitionList.name,\n description: requisitionList.description || '',\n }}\n onSubmit={handleRenameSubmit}\n onCancel={() => setShowRenameModal(false)}\n />\n }\n handleModalOnClose={() => setShowRenameModal(false)}\n />\n )}\n\n {/* Delete Confirmation Modal */}\n {showDeleteModal && (\n <RequisitionListModal\n isOpen={showDeleteModal}\n isLoading={isDeleting}\n title={translations.deleteListTitle}\n modalContent={translations.deleteListMessage}\n confirmBtnCaption={translations.confirmAction}\n closeBtnCaption={translations.cancelAction}\n handleModalOnClose={() => setShowDeleteModal(false)}\n handleModalOnConfirm={handleDeleteConfirm}\n />\n )}\n\n {/* Share Modal */}\n {isShareEnabled && showShareModal && (\n <RequisitionListModal\n isOpen={showShareModal}\n isLoading={isSharing}\n title={translations.shareListTitle}\n modalContent={\n <ShareRequisitionListContent\n requisitionListUid={requisitionList.uid}\n isSubmitting={isSharing}\n onSubmit={handleShareSubmit}\n currentCustomerEmail={currentCustomerEmail}\n routeSharedRequisitionList={routeSharedRequisitionList}\n />\n }\n handleModalOnClose={() => setShowShareModal(false)}\n />\n )}\n </>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { HTMLAttributes, useEffect } from 'preact/compat';\nimport { FunctionComponent, VNode } from 'preact';\nimport { VComponent, classes } from '@adobe-commerce/elsie/lib';\nimport {\n RequisitionListActions,\n EmptyList,\n PageSizePicker,\n PaginationItemsCounter,\n} from '@/requisitionList/components';\nimport { RequisitionListForm } from '@/requisitionList/containers';\nimport {\n Pagination,\n Card,\n Table,\n InLineAlert,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport '@/requisitionList/components/RequisitionListGridWrapper/RequisitionListGridWrapper.css';\nimport { useRequisitionListAlert } from '@/requisitionList/hooks';\n\nexport interface RequisitionListGridWrapperProps\n extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n isLoading?: boolean;\n header?: VNode;\n rows: Array<Record<string, VNode | string | number | undefined>>;\n skeletonRowCount: number;\n pageInfo?: {\n total_pages?: number;\n current_page?: number;\n page_size?: number;\n };\n totalCount?: number;\n handlePageChange: (page?: number) => Promise<void>;\n handlePageSizeChange?: (pageSize: number) => Promise<void>;\n defaultPageSize?: number;\n isAdding: boolean;\n handleAddNew: () => void;\n handleCancelCreate: () => void;\n}\n\nexport const RequisitionListGridWrapper: FunctionComponent<\n RequisitionListGridWrapperProps\n> = ({\n className,\n isLoading = false,\n header,\n rows = [],\n skeletonRowCount = 10,\n pageInfo,\n totalCount = 0,\n handlePageChange,\n handlePageSizeChange,\n defaultPageSize = 10,\n isAdding,\n handleAddNew,\n handleCancelCreate,\n ...props\n}) => {\n const translations = useText({\n name: `RequisitionList.RequisitionListWrapper.name`,\n itemsCount: `RequisitionList.RequisitionListWrapper.itemsCount`,\n lastUpdated: `RequisitionList.RequisitionListWrapper.lastUpdated`,\n actions: `RequisitionList.RequisitionListWrapper.actions`,\n emptyList: `RequisitionList.RequisitionListWrapper.emptyList`,\n show: `RequisitionList.PageSizePicker.show`,\n });\n\n const hasAnyItems = (pageInfo?.total_pages ?? 0) > 0;\n const showEmptyList = !isLoading && rows.length === 0 && !hasAnyItems;\n\n const { alert, setAlert, handleRequisitionListAlert } =\n useRequisitionListAlert();\n\n useEffect(() => {\n const alertEvent = events.on(\n 'requisitionList/alert',\n handleRequisitionListAlert\n );\n\n // Check for pending alert in localStorage (e.g., after redirect from deletion)\n try {\n const pendingAlert = localStorage.getItem('requisitionListPendingAlert');\n if (pendingAlert) {\n const alertPayload = JSON.parse(pendingAlert);\n handleRequisitionListAlert(alertPayload);\n localStorage.removeItem('requisitionListPendingAlert');\n }\n } catch (e) {\n // Ignore localStorage errors (e.g., in private browsing mode)\n }\n\n return () => {\n alertEvent?.off();\n };\n }, [handleRequisitionListAlert]);\n\n return (\n <div\n {...props}\n className={classes(['requisition-list-grid-wrapper', className])}\n data-testid=\"requisition-list-grid-wrapper\"\n >\n {/* Requisition List Header */}\n {header && (\n <div\n className={classes([\n 'requisition-list-grid-wrapper__header',\n className,\n ])}\n data-testid=\"requisition-list-grid-wrapper-header\"\n >\n <VComponent node={header} />\n </div>\n )}\n {/* Requisition List alerts go here */}\n {alert && (\n <div className=\"requisition-list__alert-wrapper\">\n <InLineAlert\n heading={alert.description}\n type={alert.type}\n variant=\"primary\"\n onDismiss={() => setAlert(null)}\n />\n </div>\n )}\n\n {showEmptyList ? (\n <EmptyList textContent={translations.emptyList} />\n ) : (\n <>\n {/* Requisition Lists Table */}\n <Table\n columns={[\n { key: 'name', label: translations.name },\n { key: 'items_count', label: translations.itemsCount },\n { key: 'last_updated', label: translations.lastUpdated },\n { key: 'actions', label: translations.actions },\n ]}\n rowData={rows}\n loading={isLoading}\n skeletonRowCount={skeletonRowCount}\n />\n {pageInfo && (\n <div\n className={classes([\n 'requisition-list-grid-wrapper__pagination',\n className,\n ])}\n >\n <PaginationItemsCounter\n pageInfo={pageInfo}\n totalCount={totalCount}\n />\n {(pageInfo.total_pages || 0) > 1 && (\n <Pagination\n totalPages={pageInfo.total_pages}\n currentPage={pageInfo.current_page || 1}\n onChange={handlePageChange}\n disabled={isLoading}\n />\n )}\n <div className=\"requisition-list-grid-wrapper__pagination-picker\">\n <span>{translations.show}</span>\n <PageSizePicker\n currentPageSize={pageInfo.page_size || defaultPageSize}\n onPageSizeChange={\n handlePageSizeChange || (() => Promise.resolve())\n }\n disabled={isLoading}\n />\n </div>\n </div>\n )}\n </>\n )}\n\n {/* Requisition Lists Form */}\n <div\n className={classes([\n 'requisition-list-grid-wrapper__add-new',\n className,\n ])}\n >\n {isAdding ? (\n <Card variant=\"secondary\">\n <RequisitionListForm\n mode=\"create\"\n onSuccess={async () => {\n await handlePageChange();\n handleCancelCreate();\n handleRequisitionListAlert({\n type: 'success',\n action: 'create',\n context: 'requisitionList',\n });\n }}\n onError={() => {\n handleRequisitionListAlert({\n type: 'error',\n action: 'create',\n context: 'requisitionList',\n });\n }}\n onCancel={handleCancelCreate}\n />\n </Card>\n ) : (\n <RequisitionListActions onAddNew={handleAddNew} />\n )}\n </div>\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { Add } from '@adobe-commerce/elsie/icons';\nimport { Icon } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/requisitionList/components/RequisitionListActions/RequisitionListActions.css';\n\nexport interface RequisitionListActionsProps {\n className?: string;\n selectable?: boolean;\n onAddNew?: () => void;\n}\n\nexport const RequisitionListActions: FunctionComponent<\n RequisitionListActionsProps\n> = ({ selectable, className, onAddNew }) => {\n const translations = useText({\n addNewReqListBtn: `RequisitionList.AddNewReqList.addNewReqListBtn`,\n });\n\n return (\n <button\n type=\"button\"\n aria-label={translations.addNewReqListBtn}\n role=\"button\"\n className={classes([\n 'requisition-list-actions',\n ['requisition-list-actions--selectable', selectable],\n className,\n ])}\n data-testid=\"requisition-list-actions-button\"\n onClick={onAddNew}\n >\n <span\n className=\"requisition-list-actions__title\"\n data-testid=\"requisition-list-actions-button-text\"\n >\n {translations.addNewReqListBtn}\n </span>\n <Icon source={Add} size=\"32\" />\n </button>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { FunctionComponent } from 'preact';\nimport { Icon } from '@adobe-commerce/elsie/components';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { List } from '@adobe-commerce/elsie/icons';\nimport '@/requisitionList/components/EmptyList/EmptyList.css';\n\nexport interface EmptyListProps {\n className?: string;\n textContent?: string | null;\n}\n\nexport const EmptyList: FunctionComponent<EmptyListProps> = ({\n className,\n textContent,\n ...props\n}) => {\n return (\n <div\n className={classes(['empty-list', className])}\n data-testid=\"empty-list\"\n {...props}\n >\n <Icon source={List} size={'64'} stroke={'2'} />\n {textContent && <h4>{textContent}</h4>}\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { FunctionComponent } from 'preact';\nimport { Icon, Button } from '@adobe-commerce/elsie/components';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { Search } from '@adobe-commerce/elsie/icons';\nimport '@/requisitionList/components/NotFound/NotFound.css';\n\nexport interface NotFoundProps {\n className?: string;\n title?: string;\n message?: string;\n actionLabel?: string;\n onAction?: () => void;\n}\n\nexport const NotFound: FunctionComponent<NotFoundProps> = ({\n className,\n title = '404 - Not Found',\n message = 'The requisition list you are looking for does not exist.',\n actionLabel,\n onAction,\n ...props\n}) => {\n return (\n <div\n className={classes(['not-found', className])}\n data-testid=\"not-found\"\n {...props}\n >\n <Icon source={Search} size={'64'} stroke={'2'} />\n <h2>{title}</h2>\n {message && <p>{message}</p>}\n {actionLabel && onAction && (\n <Button variant=\"primary\" onClick={onAction}>\n {actionLabel}\n </Button>\n )}\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent, h } from 'preact';\nimport { useState } from 'preact/hooks';\nimport { HTMLAttributes, ChangeEvent } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport {\n Icon,\n Table,\n Checkbox,\n Price,\n Button,\n Field,\n Input,\n Image,\n} from '@adobe-commerce/elsie/components';\nimport { Trash, Cart } from '@adobe-commerce/elsie/icons';\nimport '@/requisitionList/components/ProductListTable/ProductListTable.css';\nimport { RequisitionListModel } from '@/requisitionList/data/models/requisitionList';\nimport { Item, BundleOption } from '@/requisitionList/data/models/item';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nexport interface ProductListTableProps\n extends HTMLAttributes<HTMLDivElement | HTMLFormElement> {\n className?: string;\n items: RequisitionListModel['items'];\n selectedItems: Set<string>;\n currentPage: number;\n pageSize: number;\n canEdit?: boolean;\n handleItemSelection: (itemUid: string, isSelected: boolean) => void;\n handleUpdateQuantity: (itemUid: string, newQuantity: number) => Promise<void>;\n onAddToCart: (itemUids: string[] | undefined) => void;\n onDeleteItem: (itemUids: string[] | undefined) => void;\n}\n\nexport const ProductListTable: FunctionComponent<ProductListTableProps> = ({\n className,\n items,\n selectedItems,\n currentPage,\n pageSize,\n canEdit = true,\n handleItemSelection,\n handleUpdateQuantity,\n onAddToCart,\n onDeleteItem,\n ...props\n}) => {\n const [disabledInputs, setDisabledInputs] = useState<Record<string, boolean>>(\n {}\n );\n const [inputValues, setInputValues] = useState<Record<string, number>>({});\n\n const translations = useText({\n productNameHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.productName',\n skuHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.sku',\n priceHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.price',\n quantityHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.quantity',\n subtotalHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.subtotal',\n actionsHeader:\n 'RequisitionList.RequisitionListView.productListTable.headers.actions',\n actionAddToCart: 'RequisitionList.RequisitionListView.actionAddToCart',\n actionDelete: 'RequisitionList.RequisitionListView.actionDelete',\n actionSelect: 'RequisitionList.RequisitionListView.actionSelect',\n itemQuantity:\n 'RequisitionList.RequisitionListView.productListTable.itemQuantity',\n outOfStock:\n 'RequisitionList.RequisitionListView.productListTable.outOfStock',\n onlyXLeftInStock:\n 'RequisitionList.RequisitionListView.productListTable.onlyXLeftInStock',\n });\n const columns = [\n {\n label: '#',\n key: 'index',\n },\n {\n label: 'item',\n key: 'item',\n },\n {\n label: translations.priceHeader,\n key: 'price',\n },\n {\n label: translations.quantityHeader,\n key: 'quantity',\n },\n {\n label: translations.subtotalHeader,\n key: 'subtotal',\n },\n ];\n\n if (canEdit) {\n columns.unshift({\n label: translations.actionSelect,\n key: 'selector',\n });\n columns.push({\n label: translations.actionsHeader,\n key: 'actions',\n });\n }\n\n const handleItemCheckboxChange = (\n event: ChangeEvent<HTMLInputElement>,\n item: Item\n ) => {\n const isSelected = (event.target as HTMLInputElement).checked;\n handleItemSelection(item.uid, isSelected);\n };\n\n const getRowIndex = (index: number): number => {\n return (currentPage - 1) * pageSize + index + 1;\n };\n\n const getImageAlt = (item: Item): string => {\n return item.configured_product?.name || item.product?.name || item.sku;\n };\n\n const getImageSrc = (item: Item): string => {\n return item.configured_product?.images?.length\n ? item.configured_product.images[0]?.url || ''\n : item.product?.images?.length\n ? item.product.images[0]?.url || ''\n : '';\n };\n\n const getProductName = (item: Item): string | undefined => {\n return item.product?.name || item.sku;\n };\n\n const getConfiguredProductName = (item: Item): string | undefined => {\n return item.configured_product?.name;\n };\n\n const getBundleProducts = (\n item: Item\n ): h.JSX<HTMLSpanElement>[] | undefined => {\n if (!item.bundle_options) {\n return;\n }\n\n const bundleProducts = item.bundle_options.map(\n (option: BundleOption, index: number): h.JSX<HTMLSpanElement> => {\n return (\n <span\n key={option.values[0].label || index}\n className=\"requisition-list-view-product-list-table__product-configurable-name\"\n >\n {option.values[0]!.label} x {option.values[0]!.quantity}\n </span>\n );\n }\n );\n return bundleProducts;\n };\n\n const getSku = (item: Item): string | undefined => {\n return item.configured_product?.sku || item.sku;\n };\n\n const getPriceAmount = (item: Item): number => {\n if (Array.isArray(item.bundle_options) && item.bundle_options.length > 0) {\n return item.bundle_options.reduce(\n (previousValue: number, option: BundleOption): number => {\n return (\n previousValue +\n (option.values[0]?.priceV2?.value || 0) *\n (option.values[0]?.quantity || 0)\n );\n },\n 0\n );\n }\n return (\n item.configured_product?.price?.final?.amount?.value ||\n item.product?.price?.final?.amount?.value ||\n 0\n );\n };\n\n const getPriceCurrency = (item: Item): string | undefined => {\n return (\n item.configured_product?.price?.final?.amount?.currency ||\n item.product?.price?.final?.amount?.currency\n );\n };\n\n const getSubtotal = (item: Item): number => {\n return getPriceAmount(item) * item.quantity;\n };\n\n const handleInputChange = (e: ChangeEvent<HTMLInputElement>, item: Item) => {\n const inputValue = +(e.target as HTMLInputElement).value;\n if (inputValue > 0 && !Number.isNaN(e.target.value)) {\n setInputValues((prev) => ({ ...prev, [item.uid]: inputValue }));\n }\n };\n\n const handleInputBlur = async (e: FocusEvent, item: Item) => {\n let newQty = +(e.target as HTMLInputElement).value;\n\n if ((newQty > 0 && newQty !== item.quantity) === false) {\n setInputValues((prev) => ({ ...prev, [item.uid]: item.quantity }));\n return;\n }\n setDisabledInputs((prev) => ({ ...prev, [item.uid]: true }));\n try {\n await handleUpdateQuantity(item.uid, newQty);\n } finally {\n setDisabledInputs((prev) => ({ ...prev, [item.uid]: false }));\n }\n };\n\n const rowData = items.map((item: Item, index: number) => {\n return {\n selector: (\n <label id={`item-selector-${item.sku}-label`}>\n <Checkbox\n className=\"requisition-list-view-product-list-table__checkbox\"\n name={`item-selector-${item.sku}`}\n aria-label={`${translations.actionSelect} ${getProductName(item)}`}\n data-testid={`item-checkbox-${item.sku}`}\n onChange={(e: ChangeEvent<HTMLInputElement>) =>\n handleItemCheckboxChange(e, item)\n }\n value={item.sku}\n checked={selectedItems.has(item.uid)}\n />\n </label>\n ),\n index: (\n <div className=\"requisition-list-view-product-list-table__index-container\">\n {getRowIndex(index)}\n </div>\n ),\n item: (\n <div className=\"requisition-list-view-product-list-table__item-container\">\n <Image\n className=\"requisition-list-view-product-list-table__thumbnail\"\n alt={getImageAlt(item)}\n src={getImageSrc(item)}\n />\n <div className=\"requisition-list-view-product-list-table__item-details\">\n <div className=\"requisition-list-view-product-list-table__product-name\">\n {getProductName(item)}\n </div>\n {item.stock_status === 'OUT_OF_STOCK' && (\n <div className=\"requisition-list-view-product-list-table__out-of-stock\">\n {translations.outOfStock}\n </div>\n )}\n {item.stock_status !== 'OUT_OF_STOCK' &&\n item.only_x_left_in_stock !== null &&\n item.only_x_left_in_stock < item.quantity && (\n <div className=\"requisition-list-view-product-list-table__low-stock\">\n {translations.onlyXLeftInStock.replace(\n '{count}',\n String(item.only_x_left_in_stock)\n )}\n </div>\n )}\n <span className=\"requisition-list-view-product-list-table__product-configurable-name\">\n {getConfiguredProductName(item)}\n </span>\n <div className=\"requisition-list-view-product-list-table__sku\">\n {getSku(item)}\n </div>\n {getBundleProducts(item)}\n </div>\n </div>\n ),\n price: (\n <Price\n className=\"requisition-list-view-product-list-table__price\"\n amount={getPriceAmount(item)}\n currency={getPriceCurrency(item)}\n />\n ),\n quantity: (\n <span className=\"requisition-list-view-product-list-table__quantity\">\n <Field disabled={!!disabledInputs[item.uid]}>\n <Input\n id={`requisition-list-item-quantity-${item.sku}`}\n data-testid={`requisition-list-item-quantity-${item.sku}`}\n name=\"quantity\"\n type=\"text\"\n aria-label={`${translations.itemQuantity} - ${getProductName(\n item\n )}`}\n value={inputValues[item.uid] ?? item.quantity}\n onChange={(e: ChangeEvent<HTMLInputElement>) =>\n handleInputChange(e, item)\n }\n onBlur={(e: FocusEvent) => handleInputBlur(e, item)}\n />\n </Field>\n </span>\n ),\n subtotal: (\n <Price\n className=\"requisition-list-view-product-list-table__price\"\n amount={getSubtotal(item)}\n currency={getPriceCurrency(item)}\n />\n ),\n actions: (\n <div className=\"requisition-list-view__bulk-actions\">\n <Button\n type=\"button\"\n onClick={() => onAddToCart([item.uid])}\n icon={<Icon source={Cart} />}\n aria-label={`${translations.actionAddToCart} - ${getProductName(\n item\n )}`}\n data-testid=\"product-list-table-add-to-cart-button\"\n />\n <Button\n type=\"button\"\n variant=\"secondary\"\n icon={<Icon source={Trash} />}\n onClick={() => onDeleteItem([item.uid])}\n aria-label={`${translations.actionDelete} - ${getProductName(\n item\n )}`}\n data-testid=\"product-list-table-delete-button\"\n />\n </div>\n ),\n };\n });\n\n const table = (\n <Table\n columns={columns}\n rowData={rowData}\n data-testid=\"product-list-table\"\n mobileLayout=\"stacked\"\n />\n );\n\n return (\n <VComponent\n node={h('div', {})}\n className={classes([\n 'requisition-list-view-product-list-table-container',\n className,\n ])}\n data-testid=\"product-list-table-container\"\n {...props}\n >\n {table}\n </VComponent>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { Button, Icon } from '@adobe-commerce/elsie/components';\nimport { Trash, Minus } from '@adobe-commerce/elsie/icons';\nimport '@/requisitionList/components/BatchActions/BatchActions.css';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nexport interface BatchActionsProps\n extends HTMLAttributes<HTMLDivElement | HTMLFormElement> {\n selectedItems: Set<string>;\n deletingItemId: string | null;\n addingToCartItemId: string | null;\n bulkAddingToCart: boolean;\n updatingQuantityItemId: string | null;\n bulkMovingToList?: boolean;\n bulkCopyingToList?: boolean;\n onSelectAll: () => void;\n onSelectNone: () => void;\n onBulkAddToCart: () => void;\n onBulkDelete: () => void;\n onBulkMoveToList?: () => void;\n onBulkCopyToList?: () => void;\n}\n\nexport const BatchActions: FunctionComponent<BatchActionsProps> = ({\n selectedItems,\n deletingItemId,\n addingToCartItemId,\n bulkAddingToCart,\n updatingQuantityItemId,\n bulkMovingToList = false,\n bulkCopyingToList = false,\n onSelectAll,\n onSelectNone,\n onBulkAddToCart,\n onBulkDelete,\n onBulkMoveToList,\n onBulkCopyToList,\n}) => {\n const translations = useText({\n statusDeleting: `RequisitionList.RequisitionListView.statusDeleting`,\n actionSelectAll: `RequisitionList.RequisitionListView.actionSelectAll`,\n actionSelectNone: `RequisitionList.RequisitionListView.actionSelectNone`,\n actionAddToCart: `RequisitionList.RequisitionListView.actionAddToCart`,\n actionDeleteSelectedItems: `RequisitionList.RequisitionListView.actionDeleteSelectedItems`,\n statusBulkAddingToCart: `RequisitionList.RequisitionListView.statusBulkAddingToCart`,\n actionMoveToList: `RequisitionList.RequisitionListView.actionMoveToList`,\n actionCopyToList: `RequisitionList.RequisitionListView.actionCopyToList`,\n });\n\n const isDisabled =\n deletingItemId !== null ||\n addingToCartItemId !== null ||\n bulkAddingToCart ||\n updatingQuantityItemId !== null ||\n bulkMovingToList ||\n bulkCopyingToList;\n\n const hasSelectedItems = selectedItems.size > 0;\n\n return (\n <div className=\"requisition-list-view__batch-actions\">\n <div className=\"requisition-list-view__batch-actions-left\">\n <button\n data-testid=\"bulk-actions-select-toggle-btn\"\n type=\"button\"\n className={`requisition-list-view__batch-actions-select-toggle ${\n hasSelectedItems\n ? 'requisition-list-view__batch-actions-select-toggle--active'\n : ''\n }`}\n onClick={hasSelectedItems ? onSelectNone : onSelectAll}\n disabled={isDisabled}\n aria-label={\n hasSelectedItems\n ? translations.actionSelectNone\n : translations.actionSelectAll\n }\n >\n <Icon source={Minus} />\n </button>\n <button\n type=\"button\"\n className=\"requisition-list-view__batch-actions-select-label\"\n onClick={hasSelectedItems ? onSelectNone : onSelectAll}\n disabled={isDisabled}\n >\n {translations.actionSelectAll}\n </button>\n </div>\n\n {hasSelectedItems && (\n <div className=\"requisition-list-view__batch-actions-buttons\">\n <span\n className=\"requisition-list-view__batch-actions-count-badge\"\n aria-label={`${selectedItems.size} items selected`}\n >\n {selectedItems.size}\n </span>\n {onBulkMoveToList && (\n <Button\n data-testid=\"bulk-actions-move-to-list-btn\"\n type=\"button\"\n variant=\"secondary\"\n onClick={onBulkMoveToList}\n disabled={isDisabled}\n >\n {translations.actionMoveToList}\n </Button>\n )}\n {onBulkCopyToList && (\n <Button\n data-testid=\"bulk-actions-copy-to-list-btn\"\n type=\"button\"\n variant=\"secondary\"\n onClick={onBulkCopyToList}\n disabled={isDisabled}\n >\n {translations.actionCopyToList}\n </Button>\n )}\n <Button\n data-testid=\"bulk-actions-add-to-cart-btn\"\n type=\"button\"\n variant=\"secondary\"\n onClick={onBulkAddToCart}\n disabled={isDisabled}\n >\n {bulkAddingToCart\n ? translations.statusBulkAddingToCart\n : translations.actionAddToCart}\n </Button>\n <button\n data-testid=\"bulk-actions-delete-btn\"\n type=\"button\"\n className=\"requisition-list-view__batch-actions-delete-icon\"\n onClick={onBulkDelete}\n disabled={isDisabled}\n aria-label={translations.actionDeleteSelectedItems}\n >\n <Icon source={Trash} />\n </button>\n </div>\n )}\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { HTMLAttributes } from 'preact/compat';\nimport { Picker } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport '@/requisitionList/components/PageSizePicker/PageSizePicker.css';\n\nexport interface PageSizePickerProps extends HTMLAttributes<HTMLDivElement> {\n currentPageSize: number;\n onPageSizeChange: (pageSize: number) => void;\n disabled?: boolean;\n pageSizeOptions?: number[];\n}\n\nexport const PageSizePicker = ({\n currentPageSize,\n onPageSizeChange,\n disabled = false,\n pageSizeOptions = [10, 25, 50, 100],\n}: PageSizePickerProps) => {\n const translations = useText({\n itemsPerPage: `RequisitionList.PageSizePicker.itemsPerPage`,\n });\n\n const handlePageSizeChange = (event: Event) => {\n const target = event.target as HTMLSelectElement;\n const newPageSize = parseInt(target.value, 10);\n onPageSizeChange(newPageSize);\n };\n\n const options = pageSizeOptions.map((size) => ({\n value: size.toString(),\n text: size.toString(),\n }));\n\n return (\n <Picker\n disabled={disabled}\n data-testid=\"page-size-picker\"\n variant=\"primary\"\n size=\"medium\"\n value={currentPageSize.toString()}\n options={options}\n handleSelect={handlePageSizeChange}\n aria-label={translations.itemsPerPage}\n />\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\n\nimport { PageInfo } from '@/requisitionList/data/models';\nimport { DEFAULT_PAGE_SIZE } from '@/requisitionList/lib/constants';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nimport '@/requisitionList/components/PaginationItemsCounter/PaginationItemsCounter.css';\n\nexport interface PaginationItemsCounterProps {\n pageInfo?: PageInfo;\n totalCount?: number;\n className?: string;\n}\n\nexport const PaginationItemsCounter: FunctionComponent<\n PaginationItemsCounterProps\n> = ({ pageInfo, totalCount, className = '' }) => {\n const translations = useText({\n itemsCounter: `RequisitionList.PaginationItemsCounter.itemsCounter`,\n });\n\n // Don't show counter if no pageInfo or if there's no total count\n if (!pageInfo || !totalCount) {\n return null;\n }\n\n const pageSize = pageInfo.page_size ?? DEFAULT_PAGE_SIZE;\n const currentPage = pageInfo.current_page ?? 1;\n const currentPageSize = pageSize * currentPage;\n const total = totalCount;\n\n const from = currentPageSize - pageSize + 1;\n const to = currentPageSize > total ? total : currentPageSize;\n\n return (\n <span className={`pagination-items-counter ${className}`.trim()}>\n {translations.itemsCounter\n .replace('{from}', from.toString())\n .replace('{to}', to.toString())\n .replace('{total}', total.toString())}\n </span>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { useState } from 'preact/compat';\nimport { Button, Card, Icon } from '@adobe-commerce/elsie/components';\nimport { List } from '@adobe-commerce/elsie/icons';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { useRequisitionLists } from '@/requisitionList/hooks/useRequisitionLists';\nimport '@/requisitionList/components/RequisitionListPicker/RequisitionListPicker.css';\n\nexport interface RequisitionListPickerProps {\n excludeUid?: string;\n confirmLabel: string;\n disabled?: boolean;\n onConfirm: (selectedUid: string) => void;\n}\n\nexport const RequisitionListPicker: FunctionComponent<\n RequisitionListPickerProps\n> = ({ excludeUid, confirmLabel, disabled = false, onConfirm }) => {\n const { lists } = useRequisitionLists();\n const [selectedUid, setSelectedUid] = useState<string | null>(null);\n\n const filteredLists = excludeUid\n ? lists.filter((list: RequisitionList) => list.uid !== excludeUid)\n : lists;\n\n return (\n <Card variant=\"secondary\">\n <form\n onSubmit={(e: Event) => {\n e.preventDefault();\n if (selectedUid) onConfirm(selectedUid);\n }}\n className=\"requisition-list-picker__form\"\n >\n <div className=\"requisition-list-picker__available-lists\">\n {filteredLists.map((list: RequisitionList) => (\n <Card\n key={list.uid}\n variant={selectedUid === list.uid ? 'primary' : 'secondary'}\n onClick={() => setSelectedUid(list.uid)}\n >\n <Icon source={List} />\n <span>{list.name}</span>\n </Card>\n ))}\n </div>\n <div className=\"requisition-list-picker__actions\">\n <Button type=\"submit\" disabled={!selectedUid || disabled}>\n {confirmLabel}\n </Button>\n </div>\n </form>\n </Card>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport {\n HTMLAttributes,\n useState,\n useCallback,\n useEffect,\n} from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport {\n addRequisitionListItemsToCart,\n AddToCartError,\n} from '@/requisitionList/api/addRequisitionListItemsToCart';\nimport { deleteRequisitionListItems } from '@/requisitionList/api/deleteRequisitionListItems';\nimport { updateRequisitionListItems } from '@/requisitionList/api/updateRequisitionListItems';\nimport { getRequisitionList } from '@/requisitionList/api/getRequisitionList';\nimport {\n Pagination,\n InLineAlert,\n ProgressSpinner,\n} from '@adobe-commerce/elsie/components';\nimport { Item, Product } from '@/requisitionList/data/models/item';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { events } from '@adobe-commerce/event-bus';\nimport {\n PageSizePicker,\n EmptyList,\n NotFound,\n RequisitionListModal,\n PaginationItemsCounter,\n RequisitionListPicker,\n} from '@/requisitionList/components';\nimport { ProductListTable } from '@/requisitionList/components/ProductListTable/ProductListTable';\nimport { BatchActions } from '@/requisitionList/components/BatchActions/BatchActions';\nimport { RequisitionListHeader } from '@/requisitionList/containers/RequisitionListHeader';\nimport { useRequisitionListSelectedItems } from '@/requisitionList/hooks/useRequisitionListSelectedItems';\nimport { useRequisitionListAlert } from '@/requisitionList/hooks/useRequisitionListAlert';\nimport { useRequisitionListEnabled } from '@/requisitionList/hooks/useRequisitionListEnabled';\nimport { useRequisitionListTransfer } from '@/requisitionList/hooks/useRequisitionListTransfer';\nimport { isValidBase64Uid } from '@/requisitionList/lib/validate-uid';\nimport { DEFAULT_PAGE_SIZE } from '@/requisitionList/lib/constants';\nimport '@/requisitionList/containers/RequisitionListView/RequisitionListView.css';\n\nexport interface RequisitionListViewProps\n extends HTMLAttributes<HTMLDivElement> {\n /**\n * The UID of the requisition list to display.\n * The UID must be a base64-encoded string.\n * If an invalid UID is provided, the component will render the NotFound state.\n * The component will fetch the requisition list data internally.\n */\n requisitionListUid: string;\n /**\n * When true, skips automatic product data fetching on component mount.\n * Used in tests to prevent API calls.\n */\n skipProductLoading?: boolean;\n /**\n * Number of items per page for pagination.\n * Defaults to DEFAULT_PAGE_SIZE.\n */\n pageSize?: number;\n selectedItems: Set<string>;\n /**\n * Function that returns the URL to the requisition list grid view or performs navigation\n */\n routeRequisitionListGrid?: () => string | void;\n /**\n * Fallback URL to redirect when requisition lists are not enabled.\n * Defaults to '/customer/account'\n */\n fallbackRoute?: string;\n getProductData: (skus: string[]) => Promise<Product[] | null>;\n enrichConfigurableProducts: (items: Item[]) => Promise<Item[]>;\n currentCustomerEmail?: string;\n routeSharedRequisitionList?: (relativeUrl: string) => string;\n}\n\nexport const RequisitionListView: Container<RequisitionListViewProps> = ({\n requisitionListUid,\n skipProductLoading = false,\n pageSize = DEFAULT_PAGE_SIZE,\n routeRequisitionListGrid,\n fallbackRoute = '/customer/account',\n getProductData,\n enrichConfigurableProducts,\n currentCustomerEmail,\n routeSharedRequisitionList,\n}: RequisitionListViewProps) => {\n const [loadingProducts, setLoadingProducts] = useState<boolean>(false);\n const [deletingItemId, setDeletingItemId] = useState<string | null>(null);\n const [addingToCartItemId, setAddingToCartItemId] = useState<\n string[] | undefined\n >(null);\n const [bulkAddingToCart, setBulkAddingToCart] = useState<boolean>(false);\n const [updatingQuantityItemId, setUpdatingQuantityItemId] = useState<\n string | null\n >(null);\n const [loadingPage, setLoadingPage] = useState<boolean>(false);\n const [currentPageSize, setCurrentPageSize] = useState<number>(pageSize);\n const [initializing, setInitializing] = useState<boolean>(true);\n const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false);\n const [itemsToDelete, setItemsToDelete] = useState<string[]>([]);\n const {\n currentRequisitionList,\n setCurrentRequisitionList,\n selectedItems,\n setSelectedItems,\n handleItemSelection,\n handleSelectAll,\n handleSelectNone,\n } = useRequisitionListSelectedItems();\n\n const translations = useText({\n emptyRequisitionList: `RequisitionList.RequisitionListView.emptyRequisitionList`,\n errorLoadingProducts: `RequisitionList.RequisitionListView.errorLoadingProducts`,\n errorLoadPage: `RequisitionList.RequisitionListView.errorLoadPage`,\n notFoundTitle: `RequisitionList.RequisitionListView.notFoundTitle`,\n notFoundMessage: `RequisitionList.RequisitionListView.notFoundMessage`,\n notFoundActionLabel: `RequisitionList.RequisitionListView.notFoundActionLabel`,\n notEnabledTitle: `RequisitionList.RequisitionListsNotEnabled.title`,\n notEnabledMessage: `RequisitionList.RequisitionListsNotEnabled.message`,\n partialMoveSuccess: `RequisitionList.RequisitionListAlert.partialMoveSuccess`,\n notEnabledActionLabel: `RequisitionList.RequisitionListsNotEnabled.actionLabel`,\n show: `RequisitionList.PageSizePicker.show`,\n deleteItemsTitle: `RequisitionList.RequisitionListView.deleteItemsTitle`,\n deleteItemsMessage: `RequisitionList.RequisitionListView.deleteItemsMessage`,\n confirmAction: `RequisitionList.RequisitionListView.confirmAction`,\n cancelAction: `RequisitionList.RequisitionListView.cancelAction`,\n moveToListTitle: `RequisitionList.RequisitionListView.moveToListTitle`,\n moveToListConfirm: `RequisitionList.RequisitionListView.moveToListConfirm`,\n copyToListTitle: `RequisitionList.RequisitionListView.copyToListTitle`,\n copyToListConfirm: `RequisitionList.RequisitionListView.copyToListConfirm`,\n });\n\n const { alert, setAlert, handleRequisitionListAlert } =\n useRequisitionListAlert();\n\n const { isEnabled } = useRequisitionListEnabled();\n\n useEffect(() => {\n const requisitionListEvent = events.on(\n 'requisitionList/data',\n (payload: RequisitionList) => {\n // Only update from events if it matches our current UID\n if (payload?.uid === requisitionListUid) {\n setCurrentRequisitionList(payload);\n setSelectedItems(new Set());\n }\n }\n );\n // Keep event listener for cross-component alert communication\n const alertEvent = events.on(\n 'requisitionList/alert',\n handleRequisitionListAlert\n );\n return () => {\n requisitionListEvent?.off();\n alertEvent?.off();\n };\n }, [\n handleRequisitionListAlert,\n requisitionListUid,\n setCurrentRequisitionList,\n setSelectedItems,\n ]);\n\n // Sync pageSize prop changes to local state\n useEffect(() => {\n setCurrentPageSize(pageSize);\n }, [pageSize]);\n\n // Function to enrich configurable products\n const enrichConfigurableProductsInList = useCallback(\n async (baseRequisitionList: RequisitionList): Promise<RequisitionList> => {\n if (!baseRequisitionList.items?.length) {\n return baseRequisitionList;\n }\n if (typeof enrichConfigurableProducts !== 'function') {\n return baseRequisitionList;\n }\n\n const enrichedItems = await enrichConfigurableProducts(\n baseRequisitionList.items\n );\n return {\n ...baseRequisitionList,\n items: enrichedItems,\n };\n },\n [enrichConfigurableProducts]\n );\n\n // Function to fetch and merge product data\n const fetchAndMergeProducts = useCallback(\n async (baseRequisitionList: RequisitionList) => {\n // Extract SKUs from requisition list items\n const productSkus =\n baseRequisitionList.items?.map((item: Item) => item.sku) || [];\n\n if (productSkus.length === 0) {\n return baseRequisitionList;\n }\n\n setLoadingProducts(true);\n\n try {\n const fetchedProducts = await getProductData(productSkus);\n if (fetchedProducts) {\n // Create a map of SKU to Product for easy lookup\n const productMap = new Map<string, Product>();\n fetchedProducts.forEach((product: Product) => {\n productMap.set(product.sku, product);\n });\n\n // Update requisition list items with fetched product data\n return {\n ...baseRequisitionList,\n items: baseRequisitionList.items?.map((item: Item) => {\n const fetchedProduct = productMap.get(item.sku);\n return {\n ...item,\n product: fetchedProduct || item.product, // Use fetched product or keep existing\n stock_status: (item.stock_status ||\n fetchedProduct?.stock_status ||\n 'IN_STOCK') as 'IN_STOCK' | 'OUT_OF_STOCK',\n only_x_left_in_stock:\n item.only_x_left_in_stock ??\n fetchedProduct?.only_x_left_in_stock ??\n null,\n };\n }),\n };\n }\n console.warn('No products found');\n return baseRequisitionList;\n } catch (error) {\n console.warn(\n error instanceof Error\n ? error.message\n : translations.errorLoadingProducts\n );\n return baseRequisitionList;\n } finally {\n setLoadingProducts(false);\n }\n },\n [getProductData, translations.errorLoadingProducts]\n );\n\n const {\n showMoveToListModal,\n setShowMoveToListModal,\n movingToList,\n showCopyToListModal,\n setShowCopyToListModal,\n copyingToList,\n handleMoveToList,\n handleCopyToList,\n } = useRequisitionListTransfer({\n sourceListUid: currentRequisitionList?.uid,\n selectedItems,\n currentPageSize,\n currentPage: currentRequisitionList?.page_info?.current_page || 1,\n enrichConfigurableProductsInList,\n fetchAndMergeProducts,\n setCurrentRequisitionList,\n setSelectedItems,\n handleRequisitionListAlert,\n });\n\n // Initialize requisition list from UID\n // Only triggers initial load when UID changes. Page size changes trigger pagination, not re-initialization.\n useEffect(() => {\n if (!requisitionListUid) {\n setInitializing(false);\n return;\n }\n\n // Only initialize if we don't have a list or if the UID changed\n if (\n currentRequisitionList &&\n currentRequisitionList.uid === requisitionListUid\n ) {\n // Same list already loaded, don't re-initialize\n return;\n }\n\n setInitializing(true);\n\n const initializeFromUid = async () => {\n try {\n const fetchedList = await getRequisitionList(\n requisitionListUid,\n 1,\n pageSize,\n enrichConfigurableProducts\n );\n\n if (fetchedList) {\n // List already enriched via getRequisitionList(enrichConfigurableProducts)\n if (!skipProductLoading) {\n const enrichedList = await fetchAndMergeProducts(fetchedList);\n setCurrentRequisitionList(enrichedList);\n } else {\n setCurrentRequisitionList(fetchedList);\n }\n }\n } catch (error) {\n console.error('Failed to initialize requisition list from UID:', error);\n } finally {\n setInitializing(false);\n }\n };\n\n initializeFromUid();\n }, [\n requisitionListUid,\n pageSize,\n skipProductLoading,\n enrichConfigurableProducts,\n fetchAndMergeProducts,\n setCurrentRequisitionList,\n currentRequisitionList,\n ]);\n\n const handleAddItemsToCart = useCallback(\n async (itemUids: string[] | undefined) => {\n if (itemUids && itemUids.length === 1) {\n setBulkAddingToCart(false);\n setAddingToCartItemId(itemUids);\n } else {\n setBulkAddingToCart(true);\n setAddingToCartItemId(null);\n }\n\n try {\n const errors = await addRequisitionListItemsToCart(\n currentRequisitionList.uid,\n itemUids\n );\n\n const totalItems = itemUids?.length || 0;\n const errorCount = errors?.length || 0;\n const successCount = totalItems - errorCount;\n\n // Check for partial success: some items succeeded and some failed\n if (errors && errors.length > 0 && successCount > 0) {\n const alertPayload = {\n action: 'move',\n type: 'error',\n context: 'product',\n message: [\n translations.partialMoveSuccess\n .replace('{successCount}', String(successCount))\n .replace('{failedCount}', String(errorCount)),\n ],\n };\n handleRequisitionListAlert(alertPayload);\n events.emit('requisitionList/alert', alertPayload);\n } else if (errors && errors.length > 0) {\n // All items failed\n const alertPayload = {\n action: 'move',\n type: 'error',\n context: 'product',\n message: errors.map((e: AddToCartError) => e.message),\n };\n handleRequisitionListAlert(alertPayload);\n events.emit('requisitionList/alert', alertPayload);\n } else {\n // All items succeeded\n const alertPayload = {\n action: 'move',\n type: 'success',\n context: 'product',\n };\n handleRequisitionListAlert(alertPayload);\n events.emit('requisitionList/alert', alertPayload);\n }\n } catch (error) {\n const alertPayload = {\n action: 'move',\n type: 'error',\n context: 'product',\n };\n handleRequisitionListAlert(alertPayload);\n events.emit('requisitionList/alert', alertPayload);\n } finally {\n setAddingToCartItemId(null);\n setBulkAddingToCart(false);\n }\n },\n [currentRequisitionList, handleRequisitionListAlert, translations]\n );\n\n const handleDeleteItems = useCallback((itemUids: string[] | undefined) => {\n if (itemUids && itemUids.length > 0) {\n setItemsToDelete(itemUids);\n setShowDeleteModal(true);\n }\n }, []);\n\n const handleConfirmDelete = useCallback(async () => {\n if (itemsToDelete.length === 1) {\n setDeletingItemId(itemsToDelete[0]);\n } else {\n setDeletingItemId('bulk');\n }\n\n try {\n const updatedRequisitionList = await deleteRequisitionListItems(\n currentRequisitionList.uid,\n itemsToDelete,\n currentPageSize,\n currentRequisitionList.page_info.current_page,\n enrichConfigurableProducts\n );\n\n if (updatedRequisitionList) {\n // Enrich configurable products\n const enrichedWithConfigurable = await enrichConfigurableProductsInList(\n updatedRequisitionList\n );\n // Fetch and merge product data to ensure prices are loaded\n const enrichedRequisitionList = await fetchAndMergeProducts(\n enrichedWithConfigurable\n );\n setCurrentRequisitionList(enrichedRequisitionList);\n handleRequisitionListAlert({\n action: 'delete',\n type: 'success',\n context: 'product',\n });\n } else {\n handleRequisitionListAlert({\n action: 'delete',\n type: 'error',\n context: 'product',\n });\n }\n } catch (error) {\n handleRequisitionListAlert({\n action: 'delete',\n type: 'error',\n context: 'product',\n });\n } finally {\n setDeletingItemId(null);\n setShowDeleteModal(false);\n setItemsToDelete([]);\n }\n }, [\n itemsToDelete,\n currentRequisitionList,\n currentPageSize,\n fetchAndMergeProducts,\n setCurrentRequisitionList,\n handleRequisitionListAlert,\n enrichConfigurableProductsInList,\n enrichConfigurableProducts,\n ]);\n\n const handleUpdateQuantity = useCallback(\n async (itemUid: string, newQuantity: number) => {\n setUpdatingQuantityItemId(itemUid);\n\n try {\n // Find the current item to update\n const currentItem = currentRequisitionList.items?.find(\n (item: Item) => item.uid === itemUid\n );\n if (!currentItem) {\n handleRequisitionListAlert({\n action: 'update',\n type: 'error',\n context: 'product',\n });\n return;\n }\n\n // Create updated item with new quantity\n const updatedItem = {\n item_id: currentItem.uid,\n entered_options: currentItem.entered_options,\n selected_options: currentItem.selected_options,\n quantity: newQuantity,\n };\n\n const updatedRequisitionList = await updateRequisitionListItems(\n currentRequisitionList.uid,\n [updatedItem],\n currentPageSize,\n currentRequisitionList.page_info.current_page,\n enrichConfigurableProducts\n );\n\n if (updatedRequisitionList) {\n // List already enriched via updateRequisitionListItems(enrichConfigurableProducts)\n const enrichedRequisitionList = await fetchAndMergeProducts(\n updatedRequisitionList\n );\n setCurrentRequisitionList(enrichedRequisitionList);\n handleRequisitionListAlert({\n action: 'update',\n type: 'success',\n context: 'product',\n });\n } else {\n handleRequisitionListAlert({\n action: 'update',\n type: 'error',\n context: 'product',\n });\n }\n } catch (error) {\n handleRequisitionListAlert({\n action: 'update',\n type: 'error',\n context: 'product',\n });\n } finally {\n setUpdatingQuantityItemId(null);\n }\n },\n [\n currentRequisitionList,\n fetchAndMergeProducts,\n setCurrentRequisitionList,\n currentPageSize,\n handleRequisitionListAlert,\n enrichConfigurableProducts,\n ]\n );\n\n const handlePageChange = useCallback(\n async (page: number) => {\n setLoadingPage(true);\n\n try {\n const updatedRequisitionList = await getRequisitionList(\n currentRequisitionList.uid,\n page,\n currentPageSize,\n enrichConfigurableProducts\n );\n\n if (updatedRequisitionList) {\n // Fetch product data for the new page (list already enriched via getRequisitionList)\n const enrichedWithConfigurable = updatedRequisitionList;\n const updatedListWithProducts = await fetchAndMergeProducts(\n enrichedWithConfigurable\n );\n setCurrentRequisitionList(updatedListWithProducts);\n } else {\n console.warn(translations.errorLoadPage);\n }\n } catch (error) {\n console.warn(\n error instanceof Error ? error.message : translations.errorLoadPage\n );\n } finally {\n setLoadingPage(false);\n }\n },\n [\n currentRequisitionList?.uid,\n fetchAndMergeProducts,\n currentPageSize,\n translations,\n setCurrentRequisitionList,\n enrichConfigurableProducts,\n ]\n );\n\n const handlePageSizeChange = useCallback(\n async (newPageSize: number) => {\n setCurrentPageSize(newPageSize);\n setLoadingPage(true);\n\n try {\n // Reset to page 1 when changing page size\n const updatedRequisitionList = await getRequisitionList(\n currentRequisitionList.uid,\n 1,\n newPageSize,\n enrichConfigurableProducts\n );\n\n if (updatedRequisitionList) {\n // Fetch product data for the new page (list already enriched via getRequisitionList)\n const enrichedWithConfigurable = updatedRequisitionList;\n const updatedListWithProducts = await fetchAndMergeProducts(\n enrichedWithConfigurable\n );\n setCurrentRequisitionList(updatedListWithProducts);\n } else {\n console.warn(translations.errorLoadPage);\n }\n } catch (error) {\n console.warn(translations.errorLoadPage);\n } finally {\n setLoadingPage(false);\n }\n },\n [\n currentRequisitionList?.uid,\n fetchAndMergeProducts,\n translations,\n setCurrentRequisitionList,\n enrichConfigurableProducts,\n ]\n );\n\n const handleUpdate = useCallback(\n async (updatedList: RequisitionList) => {\n // Enrich configurable products\n const enrichedWithConfigurable = await enrichConfigurableProductsInList(\n updatedList\n );\n // With the updated API, the response includes items and page_info\n // but we need to fetch and merge full product data (prices, images, etc.)\n const enrichedList = await fetchAndMergeProducts(\n enrichedWithConfigurable\n );\n setCurrentRequisitionList(enrichedList);\n },\n [\n setCurrentRequisitionList,\n fetchAndMergeProducts,\n enrichConfigurableProductsInList,\n ]\n );\n\n return (\n <div className=\"requisition-list-view__container\">\n {initializing ? (\n <div className=\"requisition-list-view__loading\">\n <ProgressSpinner stroke={'4'} size={'large'} />\n </div>\n ) : isEnabled === false ? (\n <NotFound\n title={translations.notEnabledTitle}\n message={translations.notEnabledMessage}\n actionLabel={translations.notEnabledActionLabel}\n onAction={() => {\n window.location.href = fallbackRoute;\n }}\n />\n ) : !currentRequisitionList ||\n !isValidBase64Uid(currentRequisitionList?.uid) ? (\n <NotFound\n title={translations.notFoundTitle}\n message={translations.notFoundMessage}\n actionLabel={\n routeRequisitionListGrid\n ? translations.notFoundActionLabel\n : undefined\n }\n onAction={\n routeRequisitionListGrid\n ? () => {\n const url = routeRequisitionListGrid();\n if (url && typeof url === 'string') {\n window.location.href = url;\n }\n }\n : undefined\n }\n />\n ) : (\n <>\n <RequisitionListHeader\n requisitionList={currentRequisitionList}\n routeRequisitionListGrid={routeRequisitionListGrid}\n onUpdate={handleUpdate}\n onAlert={handleRequisitionListAlert}\n enrichConfigurableProducts={enrichConfigurableProducts}\n currentCustomerEmail={currentCustomerEmail}\n routeSharedRequisitionList={routeSharedRequisitionList}\n />\n\n {alert && (\n <div className=\"requisition-list__alert-wrapper\">\n <InLineAlert\n heading={alert.description}\n type={alert.type}\n variant=\"primary\"\n onDismiss={() => setAlert(null)}\n />\n </div>\n )}\n\n {currentRequisitionList.items_count === 0 ? (\n <EmptyList\n textContent={`${currentRequisitionList.name} ${translations.emptyRequisitionList}`}\n />\n ) : (\n <>\n <BatchActions\n selectedItems={selectedItems}\n deletingItemId={deletingItemId}\n addingToCartItemId={addingToCartItemId}\n bulkAddingToCart={bulkAddingToCart}\n updatingQuantityItemId={updatingQuantityItemId}\n bulkMovingToList={movingToList}\n bulkCopyingToList={copyingToList}\n onSelectAll={handleSelectAll}\n onSelectNone={handleSelectNone}\n onBulkAddToCart={() =>\n handleAddItemsToCart(Array.from(selectedItems))\n }\n onBulkDelete={() =>\n handleDeleteItems(Array.from(selectedItems))\n }\n onBulkMoveToList={() => setShowMoveToListModal(true)}\n onBulkCopyToList={() => setShowCopyToListModal(true)}\n />\n\n <ProductListTable\n items={currentRequisitionList.items}\n selectedItems={selectedItems}\n currentPage={\n currentRequisitionList.page_info?.current_page || 1\n }\n pageSize={\n currentRequisitionList.page_info?.page_size ||\n DEFAULT_PAGE_SIZE\n }\n handleItemSelection={handleItemSelection}\n handleUpdateQuantity={handleUpdateQuantity}\n onAddToCart={handleAddItemsToCart}\n onDeleteItem={handleDeleteItems}\n />\n\n {/* Pagination */}\n {currentRequisitionList.page_info && (\n <div className=\"requisition-list-view__pagination\">\n <PaginationItemsCounter\n pageInfo={currentRequisitionList.page_info}\n totalCount={currentRequisitionList.items_count}\n />\n {(currentRequisitionList.page_info?.total_pages || 0) > 1 && (\n <Pagination\n totalPages={currentRequisitionList.page_info.total_pages}\n currentPage={\n currentRequisitionList.page_info?.current_page || 1\n }\n onChange={handlePageChange}\n disabled={loadingPage || loadingProducts}\n />\n )}\n <div className=\"requisition-list-view__pagination-picker\">\n <span>{translations.show}</span>\n <PageSizePicker\n currentPageSize={\n currentRequisitionList.page_info?.page_size ||\n DEFAULT_PAGE_SIZE\n }\n onPageSizeChange={handlePageSizeChange}\n disabled={loadingPage || loadingProducts}\n />\n </div>\n </div>\n )}\n </>\n )}\n </>\n )}\n\n {/* Delete Confirmation Modal */}\n {showDeleteModal && (\n <RequisitionListModal\n isOpen={showDeleteModal}\n isLoading={deletingItemId !== null}\n title={translations.deleteItemsTitle}\n modalContent={translations.deleteItemsMessage}\n confirmBtnCaption={translations.confirmAction}\n closeBtnCaption={translations.cancelAction}\n handleModalOnClose={() => {\n setShowDeleteModal(false);\n setItemsToDelete([]);\n }}\n handleModalOnConfirm={handleConfirmDelete}\n />\n )}\n\n {/* Move to Requisition List Modal */}\n {showMoveToListModal && (\n <RequisitionListModal\n isOpen={showMoveToListModal}\n isLoading={movingToList}\n title={translations.moveToListTitle}\n modalContent={\n <RequisitionListPicker\n excludeUid={currentRequisitionList?.uid}\n confirmLabel={translations.moveToListConfirm}\n disabled={movingToList}\n onConfirm={handleMoveToList}\n />\n }\n handleModalOnClose={() => setShowMoveToListModal(false)}\n />\n )}\n\n {/* Copy to Requisition List Modal */}\n {showCopyToListModal && (\n <RequisitionListModal\n isOpen={showCopyToListModal}\n isLoading={copyingToList}\n title={translations.copyToListTitle}\n modalContent={\n <RequisitionListPicker\n excludeUid={currentRequisitionList?.uid}\n confirmLabel={translations.copyToListConfirm}\n disabled={copyingToList}\n onConfirm={handleCopyToList}\n />\n }\n handleModalOnClose={() => setShowCopyToListModal(false)}\n />\n )}\n </div>\n );\n};\n"],"names":["getItemOptions","item","_a","opt","_b","SharedRequisitionList","status","previewData","errorMessage","onImport","translations","jsxs","jsx","ProgressSpinner","InLineAlert","listName","items","isImporting","isImported","columns","rowData","Header","Table","Button","token","routeRequisitionList","setStatus","useState","setPreviewData","setErrorMessage","isMountedRef","useRef","useText","useEffect","getSharedRequisitionList","result","err","handleImport","useCallback","importSharedRequisitionList","requisitionList","userErrors","name","uid","events","resolvedErrorMessage","SharedRequisitionListView","ShareRequisitionListContent","loadingUsers","usersErrorMessage","loadingLink","selectedUserValues","multiSelectOptions","shareLink","linkErrorMessage","linkCopied","isSubmitting","canSubmit","onSubmitClick","onCopyLinkClick","onSelectedUsersChange","onUsersFieldInteract","selectionError","submitErrorMessage","isShareSuccess","sharedRecipientEmails","email","Fragment","Field","MultiSelect","Divider","Input","requisitionListUid","onSubmit","currentCustomerEmail","routeSharedRequisitionList","companyUsers","setCompanyUsers","setLoadingUsers","usersLoadFailed","setUsersLoadFailed","selectedUids","setSelectedUids","setShareLink","setLoadingLink","setLinkErrorMessage","setLinkCopied","setSelectionError","setSubmitErrorMessage","setIsShareSuccess","setSharedRecipientEmails","maxRecipients","configValue","state","parsed","getCompanyUsers","users","colleagues","user","shareRequisitionListByToken","relativeUrl","handleSubmit","selectedIds","selectedEmails","errors","handleCopyLink","ShareRequisitionListContentComponent","values","nextValues","DEFAULT_PAGE_SIZE","NAME_MIN_LENGTH","NAME_MAX_LENGTH","DESCRIPTION_MAX_LENGTH","NAME_VALID_CHARS","RequisitionListForm","className","mode","defaultValues","error","onCancel","props","setValues","touched","setTouched","setIsSubmitting","validateName","trimmedName","handleChange","field","e","target","prevValues","handleBlur","prev","nameError","title","classes","TextArea","useRequisitionListForm","onSuccess","onError","setError","description","updateRequisitionList","createRequisitionList","msg","submit","RequisitionListFormComponent","useRequisitionListGrid","callbacks","routeRequisitionListDetails","closeModal","reqLists","setReqLists","isAdding","setIsAdding","isFetching","setIsFetching","handleAddNew","handleCancelCreate","wrappedCallbacks","useMemo","rl","current","fetchPage","page","pageSize","data","getRequisitionLists","currentPage","totalPages","_c","prevData","requisitionListsEvent","handlePageChange","currentPageSize","handlePageSizeChange","isRequisitionListEnabled","config","useRequisitionListEnabled","isEnabled","setIsEnabled","configListener","enabled","RequisitionListGrid","fallbackRoute","slots","modal","setModal","handleOpenRenameModal","handleOpenDeleteModal","rows","isLoading","pageInfo","totalCount","handleRenameSubmit","handleDeleteConfirm","deleteRequisitionList","getHeader","Slot","NotFound","RequisitionListGridWrapper","RequisitionListModal","SvgAdd","React","SvgCart","SvgChevronDown","SvgList","SvgMinus","SvgSearch","SvgTrash","updateCounter","useRequisitionLists","lists","setLists","loading","setLoading","lastUpdate","setLastUpdate","setRequisitionListsLoading","res","newLists","setRequisitionLists","multiListListener","payload","singleListListener","useRequisitionListAlert","translationsOverride","alert","setAlert","defaultTranslations","messages","handleRequisitionListAlert","type","action","context","skus","message","timer","useRequisitionListSelectedItems","currentRequisitionList","setCurrentRequisitionList","selectedItems","setSelectedItems","handleItemSelection","itemUid","isSelected","newSet","handleSelectAll","allItemUids","handleSelectNone","useRequisitionListTransfer","sourceListUid","enrichConfigurableProductsInList","fetchAndMergeProducts","showMoveToListModal","setShowMoveToListModal","movingToList","setMovingToList","showCopyToListModal","setShowCopyToListModal","copyingToList","setCopyingToList","handleMoveToList","destinationListUid","moveItemsBetweenRequisitionLists","enrichedWithConfigurable","enrichedList","handleCopyToList","copyItemsBetweenRequisitionLists","isMatchingRequisitionListItem","requisitionListItem","product","options","itemSku","itemOptionUids","productOptionUids","index","RequisitionListSelector","canCreate","sku","selectedOptions","quantity","matchBySKU","beforeAddProdToReqList","listsFromEvents","setListsFromEvents","onRequisitionListsData","onRequisitionListData","currentLists","getRequisitionListsFromState","existingIndex","list","i","unsubMulti","unsubSingle","listsForActiveCheck","isInRequisitionList","productContext","handleOpenModal","handleCloseModal","handleAddProdToReqList","itemToAdd","addProductsToRequisitionList","handleAddProductAndEmitAlert","handleOpenModalWithValidation","selectReqListSection","Icon","ChevronDown","RequisitionListPicker","EmptyList","createReqListSection","Card","newList","RequisitionListActions","modalContent","List","RequisitionListHeader","backLink","actions","isOpen","closeBtnCaption","confirmBtnCaption","handleModalOnClose","handleModalOnConfirm","Modal","routeRequisitionListGrid","onUpdate","onAlert","enrichConfigurableProducts","showRenameModal","setShowRenameModal","showDeleteModal","setShowDeleteModal","showShareModal","setShowShareModal","isDeleting","setIsDeleting","isSharing","setIsSharing","sharingConfigValue","isShareEnabled","itemsCount","isShareDisabled","handleRename","updatedList","handleDeleteList","alertPayload","url","handleShare","handleShareSubmit","customerUids","shareRequisitionListByEmail","RequisitionListHeaderComponent","header","skeletonRowCount","defaultPageSize","hasAnyItems","showEmptyList","alertEvent","pendingAlert","VComponent","PaginationItemsCounter","Pagination","PageSizePicker","selectable","onAddNew","Add","textContent","actionLabel","onAction","Search","ProductListTable","canEdit","handleUpdateQuantity","onAddToCart","onDeleteItem","disabledInputs","setDisabledInputs","inputValues","setInputValues","handleItemCheckboxChange","event","getRowIndex","getImageAlt","getImageSrc","_e","_d","_f","getProductName","getConfiguredProductName","getBundleProducts","option","getSku","getPriceAmount","previousValue","_h","_g","getPriceCurrency","getSubtotal","handleInputChange","inputValue","handleInputBlur","newQty","Checkbox","Image","Price","Cart","Trash","table","h","BatchActions","deletingItemId","addingToCartItemId","bulkAddingToCart","updatingQuantityItemId","bulkMovingToList","bulkCopyingToList","onSelectAll","onSelectNone","onBulkAddToCart","onBulkDelete","onBulkMoveToList","onBulkCopyToList","isDisabled","hasSelectedItems","Minus","onPageSizeChange","disabled","pageSizeOptions","newPageSize","size","Picker","total","from","to","excludeUid","confirmLabel","onConfirm","selectedUid","setSelectedUid","filteredLists","RequisitionListView","skipProductLoading","getProductData","loadingProducts","setLoadingProducts","setDeletingItemId","setAddingToCartItemId","setBulkAddingToCart","setUpdatingQuantityItemId","loadingPage","setLoadingPage","setCurrentPageSize","initializing","setInitializing","itemsToDelete","setItemsToDelete","requisitionListEvent","baseRequisitionList","enrichedItems","productSkus","fetchedProducts","productMap","fetchedProduct","fetchedList","getRequisitionList","handleAddItemsToCart","itemUids","addRequisitionListItemsToCart","totalItems","errorCount","successCount","handleDeleteItems","handleConfirmDelete","updatedRequisitionList","deleteRequisitionListItems","enrichedRequisitionList","newQuantity","currentItem","updatedItem","updateRequisitionListItems","updatedListWithProducts","handleUpdate","isValidBase64Uid"],"mappings":"u5CA0DA,MAAMA,GAAkBC,GAAuB,SACzC,OAAAC,EAAAD,EAAK,uBAAL,MAAAC,EAA2B,OACtBD,EAAK,qBACT,IAAKE,GAAQ,GAAGA,EAAI,YAAY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