@erpsquad/common 1.8.81 → 1.8.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +253 -253
- package/README.md +979 -979
- package/dist/_virtual/index/index.esm10.js +3 -3
- package/dist/_virtual/index/index.esm11.js +3 -3
- package/dist/_virtual/index/index.esm4.js +1 -1
- package/dist/_virtual/index/index.esm5.js +3 -3
- package/dist/_virtual/index/index.esm6.js +3 -3
- package/dist/_virtual/index/index.esm7.js +3 -3
- package/dist/_virtual/index/index.esm8.js +3 -3
- package/dist/_virtual/index/index.esm9.js +3 -3
- package/dist/_virtual/index/index10.js +1 -1
- package/dist/_virtual/index/index11.js +1 -1
- package/dist/_virtual/index/index4.js +1 -1
- package/dist/_virtual/index/index5.js +1 -1
- package/dist/_virtual/index/index6.js +1 -1
- package/dist/_virtual/index/index7.js +1 -1
- package/dist/_virtual/index/index8.js +1 -1
- package/dist/_virtual/index/index9.js +1 -1
- package/dist/api-client/api.accounting/api/index.esm.js.map +1 -1
- package/dist/api-client/api.accounting/api/index.js.map +1 -1
- package/dist/api-client/api.accounting/api-types.d.ts +15883 -15883
- package/dist/api-client/api.drive/api/index.esm.js.map +1 -1
- package/dist/api-client/api.drive/api/index.js.map +1 -1
- package/dist/api-client/api.drive/api-types.d.ts +696 -696
- package/dist/api-client/api.hrms/api/index.esm.js.map +1 -1
- package/dist/api-client/api.hrms/api/index.js.map +1 -1
- package/dist/api-client/api.inventory/api/index.esm.js.map +1 -1
- package/dist/api-client/api.inventory/api/index.js.map +1 -1
- package/dist/api-client/api.inventory/api-types.d.ts +6110 -6110
- package/dist/api-client/api.manufacturing/api/index.esm.js.map +1 -1
- package/dist/api-client/api.manufacturing/api/index.js.map +1 -1
- package/dist/api-client/api.manufacturing/api-types.d.ts +10066 -10066
- package/dist/api-client/api.purchase/api/index.esm.js.map +1 -1
- package/dist/api-client/api.purchase/api/index.js.map +1 -1
- package/dist/api-client/api.purchase/api-types.d.ts +6715 -6715
- package/dist/api-client/api.rbac/api/index.esm.js.map +1 -1
- package/dist/api-client/api.rbac/api/index.esm2.js.map +1 -1
- package/dist/api-client/api.rbac/api/index.js.map +1 -1
- package/dist/api-client/api.rbac/api/index2.js.map +1 -1
- package/dist/api-client/api.rbac/api-types.d.ts +1753 -1753
- package/dist/api-client/api.rental/api/index.esm.js.map +1 -1
- package/dist/api-client/api.rental/api/index.js.map +1 -1
- package/dist/api-client/api.rental/api-types.d.ts +15666 -15666
- package/dist/api-client/api.sales/api/index.esm.js.map +1 -1
- package/dist/api-client/api.sales/api/index.js.map +1 -1
- package/dist/api-client/api.sales/api-types.d.ts +8258 -8258
- package/dist/api-client/api.system-feature/api/index.esm.js.map +1 -1
- package/dist/api-client/api.system-feature/api/index.js.map +1 -1
- package/dist/api-client/api.system-feature/api-types.d.ts +2875 -2875
- package/dist/api-client/api.user/api/index.esm.js.map +1 -1
- package/dist/api-client/api.user/api/index.js.map +1 -1
- package/dist/api-client/api.user/api-types.d.ts +95 -95
- package/dist/api-client/api.workflow-automation/api/index.esm.js.map +1 -1
- package/dist/api-client/api.workflow-automation/api/index.js.map +1 -1
- package/dist/api-client/index.d.ts +39 -39
- package/dist/components/accordion/accordion/index.esm.js.map +1 -1
- package/dist/components/accordion/accordion/index.js.map +1 -1
- package/dist/components/accordion/accordion.d.ts +1 -1
- package/dist/components/action-bar/action-bar/index.esm.js +1 -1
- package/dist/components/action-bar/action-bar/index.esm.js.map +1 -1
- package/dist/components/action-bar/action-bar/index.js +5 -5
- package/dist/components/action-bar/action-bar/index.js.map +1 -1
- package/dist/components/action-bar/action-bar.d.ts +1 -1
- package/dist/components/activity-tag/activity-tag/index.esm.js.map +1 -1
- package/dist/components/activity-tag/activity-tag/index.js.map +1 -1
- package/dist/components/alert/alert/index.esm.js.map +1 -1
- package/dist/components/alert/alert/index.js.map +1 -1
- package/dist/components/button/button/index.esm.js.map +1 -1
- package/dist/components/button/button/index.js.map +1 -1
- package/dist/components/change-user-password-modal/change-user-password-modal/index.esm.js.map +1 -1
- package/dist/components/change-user-password-modal/change-user-password-modal/index.js.map +1 -1
- package/dist/components/checkbox/checkbox/index.esm.js.map +1 -1
- package/dist/components/checkbox/checkbox/index.js.map +1 -1
- package/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/chip/chip/index.esm.js.map +1 -1
- package/dist/components/chip/chip/index.js.map +1 -1
- package/dist/components/chip-generator/chip-generator/index.esm.js.map +1 -1
- package/dist/components/chip-generator/chip-generator/index.js.map +1 -1
- package/dist/components/date-picker/date-picker/index.esm.js.map +1 -1
- package/dist/components/date-picker/date-picker/index.js.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +1 -1
- package/dist/components/date-time-picker/date-time-picker/index.esm.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker/index.js.map +1 -1
- package/dist/components/editor/custom-editor/index.esm.js.map +1 -1
- package/dist/components/editor/custom-editor/index.js.map +1 -1
- package/dist/components/filter/components/delete-group/index.esm.js +0 -1
- package/dist/components/filter/components/delete-group/index.esm.js.map +1 -1
- package/dist/components/filter/components/delete-group/index.js +1 -1
- package/dist/components/filter/components/delete-group/index.js.map +1 -1
- package/dist/components/filter/filter/index.esm.js +1 -1
- package/dist/components/filter/filter/index.esm.js.map +1 -1
- package/dist/components/filter/filter/index.js +7 -7
- package/dist/components/filter/filter/index.js.map +1 -1
- package/dist/components/footer/footer.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/dynamic-select/index.esm.js.map +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/dynamic-select/index.js.map +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/media.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/phone.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/select.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/text.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/time.d.ts +1 -1
- package/dist/components/form-control/form-parser/form-switcher.d.ts +1 -1
- package/dist/components/header/header/index.esm.js.map +1 -1
- package/dist/components/header/header/index.js.map +1 -1
- package/dist/components/header/redux/actionCreator/index.esm.js +1 -1
- package/dist/components/header/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/components/header/redux/actionCreator/index.js +1 -1
- package/dist/components/header/redux/actionCreator/index.js.map +1 -1
- package/dist/components/icons/action/index.esm.js.map +1 -1
- package/dist/components/icons/action/index.js.map +1 -1
- package/dist/components/icons/action-arrow.d.ts +3 -3
- package/dist/components/icons/add-circle.d.ts +3 -3
- package/dist/components/icons/arrow-bidirectional.d.ts +3 -3
- package/dist/components/icons/arrow-circle-down.d.ts +3 -3
- package/dist/components/icons/arrow-down-three.d.ts +3 -3
- package/dist/components/icons/arrow-down-two.d.ts +3 -3
- package/dist/components/icons/arrow-down.d.ts +3 -3
- package/dist/components/icons/arrow-up-down.d.ts +3 -3
- package/dist/components/icons/arrow-up-two.d.ts +3 -3
- package/dist/components/icons/assignments.d.ts +3 -3
- package/dist/components/icons/blank-circle.d.ts +3 -3
- package/dist/components/icons/block-filled.d.ts +3 -3
- package/dist/components/icons/calendar-add.d.ts +3 -3
- package/dist/components/icons/calendar.d.ts +3 -3
- package/dist/components/icons/checkbox-square.d.ts +3 -3
- package/dist/components/icons/circular-arrow-setting.d.ts +3 -3
- package/dist/components/icons/clock.d.ts +3 -3
- package/dist/components/icons/close.d.ts +3 -3
- package/dist/components/icons/coin-outline.d.ts +3 -3
- package/dist/components/icons/copy.d.ts +3 -3
- package/dist/components/icons/coupon.d.ts +3 -3
- package/dist/components/icons/criteria/index.esm.js.map +1 -1
- package/dist/components/icons/criteria/index.js.map +1 -1
- package/dist/components/icons/cross/index.esm.js.map +1 -1
- package/dist/components/icons/cross/index.js.map +1 -1
- package/dist/components/icons/cross-hire.d.ts +3 -3
- package/dist/components/icons/custom-styled-icon.d.ts +3 -3
- package/dist/components/icons/dashboard.d.ts +3 -3
- package/dist/components/icons/document-download.d.ts +3 -3
- package/dist/components/icons/document.d.ts +3 -3
- package/dist/components/icons/dollar-circle-filled.d.ts +3 -3
- package/dist/components/icons/dollar-circle.d.ts +3 -3
- package/dist/components/icons/edit.d.ts +3 -3
- package/dist/components/icons/email.d.ts +3 -3
- package/dist/components/icons/export.d.ts +3 -3
- package/dist/components/icons/eye-off.d.ts +3 -3
- package/dist/components/icons/eye-plus-circle.d.ts +3 -3
- package/dist/components/icons/eye.d.ts +3 -3
- package/dist/components/icons/filled-circle.d.ts +3 -3
- package/dist/components/icons/filter-remove.d.ts +3 -3
- package/dist/components/icons/filter.d.ts +3 -3
- package/dist/components/icons/folder-save.d.ts +3 -3
- package/dist/components/icons/grid.d.ts +3 -3
- package/dist/components/icons/hashtag.d.ts +3 -3
- package/dist/components/icons/image.d.ts +3 -3
- package/dist/components/icons/import.d.ts +3 -3
- package/dist/components/icons/info-circle.d.ts +3 -3
- package/dist/components/icons/info.d.ts +3 -3
- package/dist/components/icons/link-horizontal.d.ts +3 -3
- package/dist/components/icons/link.d.ts +3 -3
- package/dist/components/icons/location.d.ts +3 -3
- package/dist/components/icons/lowest-lead-time.d.ts +3 -3
- package/dist/components/icons/lowest-min-qty.d.ts +3 -3
- package/dist/components/icons/lowest-price.d.ts +3 -3
- package/dist/components/icons/more.d.ts +3 -3
- package/dist/components/icons/notification.d.ts +3 -3
- package/dist/components/icons/paper-clip.d.ts +3 -3
- package/dist/components/icons/paragraph.d.ts +3 -3
- package/dist/components/icons/payment-request.d.ts +3 -3
- package/dist/components/icons/phone.d.ts +3 -3
- package/dist/components/icons/printer.d.ts +3 -3
- package/dist/components/icons/process-calendar.d.ts +3 -3
- package/dist/components/icons/promotion.d.ts +3 -3
- package/dist/components/icons/radio-button.d.ts +3 -3
- package/dist/components/icons/receipt-filled.d.ts +3 -3
- package/dist/components/icons/receipt-outline.d.ts +3 -3
- package/dist/components/icons/receipt.d.ts +3 -3
- package/dist/components/icons/refresh-icon.d.ts +3 -3
- package/dist/components/icons/replace.d.ts +3 -3
- package/dist/components/icons/save.d.ts +3 -3
- package/dist/components/icons/search-status.d.ts +3 -3
- package/dist/components/icons/search.d.ts +3 -3
- package/dist/components/icons/settings-fallback.d.ts +3 -3
- package/dist/components/icons/share/index.esm.js.map +1 -1
- package/dist/components/icons/share/index.js.map +1 -1
- package/dist/components/icons/sort-arrow-icon.d.ts +3 -3
- package/dist/components/icons/stacked-layer.d.ts +3 -3
- package/dist/components/icons/start-filled.d.ts +3 -3
- package/dist/components/icons/three-dot-icon.d.ts +3 -3
- package/dist/components/icons/tick-circle-filled.d.ts +3 -3
- package/dist/components/icons/tick-circle.d.ts +3 -3
- package/dist/components/icons/tick-octagon.d.ts +3 -3
- package/dist/components/icons/tick.d.ts +3 -3
- package/dist/components/icons/toggle-switch.d.ts +3 -3
- package/dist/components/icons/trash.d.ts +3 -3
- package/dist/components/icons/wave.d.ts +3 -3
- package/dist/components/icons/with-out-tick-octagon.d.ts +3 -3
- package/dist/components/icons/work-centre.d.ts +3 -3
- package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.esm.js +1 -1
- package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.js +1 -1
- package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.js.map +1 -1
- package/dist/components/label-value/label-value/index.esm.js.map +1 -1
- package/dist/components/label-value/label-value/index.js.map +1 -1
- package/dist/components/listing/listing/index.esm.js.map +1 -1
- package/dist/components/listing/listing/index.js.map +1 -1
- package/dist/components/loaders/erp-loader/index.esm.js.map +1 -1
- package/dist/components/loaders/erp-loader/index.js.map +1 -1
- package/dist/components/loaders/form-loader/index.esm.js.map +1 -1
- package/dist/components/loaders/form-loader/index.js.map +1 -1
- package/dist/components/loaders/modal-loader/index.esm.js.map +1 -1
- package/dist/components/loaders/modal-loader/index.js.map +1 -1
- package/dist/components/loaders/page-loader/index.esm.js.map +1 -1
- package/dist/components/loaders/page-loader/index.js.map +1 -1
- package/dist/components/location-select.d.ts +1 -1
- package/dist/components/material-editable-table/components/inline-edit-fields/index.esm.js.map +1 -1
- package/dist/components/material-editable-table/components/inline-edit-fields/index.js.map +1 -1
- package/dist/components/material-editable-table/material-editable-table/index.esm.js.map +1 -1
- package/dist/components/material-editable-table/material-editable-table/index.js.map +1 -1
- package/dist/components/material-editable-table/material-editable-table.d.ts +1 -1
- package/dist/components/material-table/material-table.d.ts +1 -1
- package/dist/components/menu/menu/index.esm.js.map +1 -1
- package/dist/components/menu/menu/index.js.map +1 -1
- package/dist/components/modal/modal/index.esm.js.map +1 -1
- package/dist/components/modal/modal/index.js.map +1 -1
- package/dist/components/page-navigator/page-navigator/index.esm.js.map +1 -1
- package/dist/components/page-navigator/page-navigator/index.js.map +1 -1
- package/dist/components/phone-input/phone-input.d.ts +1 -1
- package/dist/components/providers/ERPUIProvider/index.esm.js.map +1 -1
- package/dist/components/providers/ERPUIProvider/index.js.map +1 -1
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/reports-title-bar/redux/actionCreator/index.esm.js +1 -1
- package/dist/components/reports-title-bar/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/components/reports-title-bar/redux/actionCreator/index.js +1 -1
- package/dist/components/reports-title-bar/redux/actionCreator/index.js.map +1 -1
- package/dist/components/reset-password-modal/reset-password-modal/index.esm.js.map +1 -1
- package/dist/components/reset-password-modal/reset-password-modal/index.js.map +1 -1
- package/dist/components/search-bar/search-bar/index.esm.js.map +1 -1
- package/dist/components/search-bar/search-bar/index.js.map +1 -1
- package/dist/components/searchable-select/index.esm.js.map +1 -1
- package/dist/components/searchable-select/index.js.map +1 -1
- package/dist/components/select/controller/chip-or-placeholder/index.esm.js.map +1 -1
- package/dist/components/select/controller/chip-or-placeholder/index.js.map +1 -1
- package/dist/components/select/select/index.esm.js.map +1 -1
- package/dist/components/select/select/index.js.map +1 -1
- package/dist/components/select/select-search/index.esm.js.map +1 -1
- package/dist/components/select/select-search/index.js.map +1 -1
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/share-modal/redux/actionCreator/index.esm.js +1 -1
- package/dist/components/share-modal/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/components/share-modal/redux/actionCreator/index.js +1 -1
- package/dist/components/share-modal/redux/actionCreator/index.js.map +1 -1
- package/dist/components/sub-header-doc/sub-header-doc/index.esm.js.map +1 -1
- package/dist/components/sub-header-doc/sub-header-doc/index.js.map +1 -1
- package/dist/components/switches/android-12-switch/index.esm.js.map +1 -1
- package/dist/components/switches/android-12-switch/index.js.map +1 -1
- package/dist/components/switches/android-12-switch.d.ts +3 -1
- package/dist/components/text-area/text-area/index.esm.js.map +1 -1
- package/dist/components/text-area/text-area/index.js.map +1 -1
- package/dist/components/text-field/text-field/index.esm.js.map +1 -1
- package/dist/components/text-field/text-field/index.js.map +1 -1
- package/dist/components/text-field/text-field.d.ts +1 -1
- package/dist/components/time-picker/time-picker/index.esm.js.map +1 -1
- package/dist/components/time-picker/time-picker/index.js.map +1 -1
- package/dist/components/time-picker/time-picker.d.ts +1 -1
- package/dist/components/toast/toast/index.esm.js.map +1 -1
- package/dist/components/toast/toast/index.js.map +1 -1
- package/dist/components/toggle/toggle/index.esm.js.map +1 -1
- package/dist/components/toggle/toggle/index.js.map +1 -1
- package/dist/components/typography/typography/index.esm.js.map +1 -1
- package/dist/components/typography/typography/index.js.map +1 -1
- package/dist/components/upload/upload/index.esm.js +2 -2
- package/dist/components/upload/upload/index.esm.js.map +1 -1
- package/dist/components/upload/upload/index.js +11 -11
- package/dist/components/upload/upload/index.js.map +1 -1
- package/dist/components/upload-media/upload-media.d.ts +1 -1
- package/dist/constants/defaultColumns/index.esm.js.map +1 -1
- package/dist/constants/defaultColumns/index.js.map +1 -1
- package/dist/constants/modules/index.esm.js.map +1 -1
- package/dist/constants/modules/index.js.map +1 -1
- package/dist/constants/pathnames/pathname/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.accounting/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.accounting/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.crm/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.crm/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.document/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.document/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.hrms/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.hrms/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.inventory/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.inventory/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.manufacturing/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.manufacturing/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.office/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.office/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.procurement/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.procurement/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.project/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.project/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.quotes/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.quotes/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.rental/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.rental/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.user/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.user/index.js.map +1 -1
- package/dist/constants/route-page-map/index.esm.js.map +1 -1
- package/dist/constants/route-page-map/index.js.map +1 -1
- package/dist/constants/status/index.esm.js.map +1 -1
- package/dist/constants/status/index.js.map +1 -1
- package/dist/contexts/AuthContext/index.esm.js +1 -1
- package/dist/contexts/AuthContext/index.esm.js.map +1 -1
- package/dist/contexts/AuthContext/index.js +1 -1
- package/dist/contexts/AuthContext/index.js.map +1 -1
- package/dist/contexts/languageContext/index.esm.js +1 -1
- package/dist/contexts/languageContext/index.esm.js.map +1 -1
- package/dist/contexts/languageContext/index.js +1 -1
- package/dist/contexts/languageContext/index.js.map +1 -1
- package/dist/contexts/page-context/index.esm.js.map +1 -1
- package/dist/contexts/page-context/index.js.map +1 -1
- package/dist/hooks/use-translations/index.esm.js.map +1 -1
- package/dist/hooks/use-translations/index.js.map +1 -1
- package/dist/hooks/useApi/index.esm.js.map +1 -1
- package/dist/hooks/useApi/index.js.map +1 -1
- package/dist/hooks/useDataFetcher/index.esm.js.map +1 -1
- package/dist/hooks/useDataFetcher/index.js.map +1 -1
- package/dist/layout/fullScreen/fullScreen/index.esm.js.map +1 -1
- package/dist/layout/fullScreen/fullScreen/index.js.map +1 -1
- package/dist/layout/sidebarScreen/sidebarScreen/index.esm.js.map +1 -1
- package/dist/layout/sidebarScreen/sidebarScreen/index.js.map +1 -1
- package/dist/node_modules/@glideapps/glide-data-grid-cells/dist/js/article-cell-editor-JDI676YI/index.esm.js +1 -1
- package/dist/node_modules/@glideapps/glide-data-grid-cells/dist/js/article-cell-editor-JDI676YI/index.js +2 -2
- package/dist/node_modules/@glideapps/glide-data-grid-cells/dist/js/article-cell-editor-JDI676YI/index.js.map +1 -1
- package/dist/node_modules/@mui/system/colorManipulator/index.esm.js +2 -2
- package/dist/node_modules/@mui/system/colorManipulator/index.js +1 -1
- package/dist/node_modules/@mui/system/colorManipulator/index.js.map +1 -1
- package/dist/node_modules/@mui/system/createStyled/index.esm.js +6 -6
- package/dist/node_modules/@mui/system/createStyled/index.js +1 -1
- package/dist/node_modules/@mui/system/createStyled/index.js.map +1 -1
- package/dist/node_modules/@mui/system/useThemeWithoutDefault/index.esm.js +1 -1
- package/dist/node_modules/@mui/system/useThemeWithoutDefault/index.js +1 -1
- package/dist/node_modules/{material-react-table/node_modules/@tanstack → @tanstack}/react-virtual/dist/esm/index/index.esm.js +2 -2
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index/index.esm.js.map +1 -0
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index/index.js +2 -0
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index/index.js.map +1 -0
- package/dist/node_modules/{@glideapps/glide-data-grid-cells/node_modules/@toast-ui → @toast-ui}/react-editor/dist/esm/index/index.esm.js +2 -2
- package/dist/node_modules/@toast-ui/react-editor/dist/esm/index/index.esm.js.map +1 -0
- package/dist/node_modules/@toast-ui/react-editor/dist/esm/index/index.js +2 -0
- package/dist/node_modules/@toast-ui/react-editor/dist/esm/index/index.js.map +1 -0
- package/dist/node_modules/material-react-table/dist/index.esm/index.esm.js +1 -1
- package/dist/node_modules/material-react-table/dist/index.esm/index.js +1 -1
- package/dist/node_modules/material-react-table/dist/index.esm/index.js.map +1 -1
- package/dist/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/redux/actionCreator/index.js.map +1 -1
- package/dist/redux/module-reducer/index.esm.js.map +1 -1
- package/dist/redux/module-reducer/index.js.map +1 -1
- package/dist/redux/store/index.esm.js.map +1 -1
- package/dist/redux/store/index.js.map +1 -1
- package/dist/server/index.esm.js.map +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/src/components/accordion/accordion.d.ts +1 -1
- package/dist/src/components/action-bar/action-bar.d.ts +1 -1
- package/dist/src/components/checkbox/checkbox.d.ts +1 -1
- package/dist/src/components/date-picker/date-picker.d.ts +1 -1
- package/dist/src/components/footer/footer.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/media.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/phone.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/select.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/text.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/time.d.ts +1 -1
- package/dist/src/components/form-control/form-parser/form-switcher.d.ts +1 -1
- package/dist/src/components/icons/action-arrow.d.ts +3 -3
- package/dist/src/components/icons/add-circle.d.ts +3 -3
- package/dist/src/components/icons/arrow-bidirectional.d.ts +3 -3
- package/dist/src/components/icons/arrow-circle-down.d.ts +3 -3
- package/dist/src/components/icons/arrow-down-three.d.ts +3 -3
- package/dist/src/components/icons/arrow-down-two.d.ts +3 -3
- package/dist/src/components/icons/arrow-down.d.ts +3 -3
- package/dist/src/components/icons/arrow-up-down.d.ts +3 -3
- package/dist/src/components/icons/arrow-up-two.d.ts +3 -3
- package/dist/src/components/icons/assignments.d.ts +3 -3
- package/dist/src/components/icons/blank-circle.d.ts +3 -3
- package/dist/src/components/icons/block-filled.d.ts +3 -3
- package/dist/src/components/icons/calendar-add.d.ts +3 -3
- package/dist/src/components/icons/calendar.d.ts +3 -3
- package/dist/src/components/icons/checkbox-square.d.ts +3 -3
- package/dist/src/components/icons/circular-arrow-setting.d.ts +3 -3
- package/dist/src/components/icons/clock.d.ts +3 -3
- package/dist/src/components/icons/close.d.ts +3 -3
- package/dist/src/components/icons/coin-outline.d.ts +3 -3
- package/dist/src/components/icons/copy.d.ts +3 -3
- package/dist/src/components/icons/coupon.d.ts +3 -3
- package/dist/src/components/icons/cross-hire.d.ts +3 -3
- package/dist/src/components/icons/custom-styled-icon.d.ts +3 -3
- package/dist/src/components/icons/dashboard.d.ts +3 -3
- package/dist/src/components/icons/document-download.d.ts +3 -3
- package/dist/src/components/icons/document.d.ts +3 -3
- package/dist/src/components/icons/dollar-circle-filled.d.ts +3 -3
- package/dist/src/components/icons/dollar-circle.d.ts +3 -3
- package/dist/src/components/icons/edit.d.ts +3 -3
- package/dist/src/components/icons/email.d.ts +3 -3
- package/dist/src/components/icons/export.d.ts +3 -3
- package/dist/src/components/icons/eye-off.d.ts +3 -3
- package/dist/src/components/icons/eye-plus-circle.d.ts +3 -3
- package/dist/src/components/icons/eye.d.ts +3 -3
- package/dist/src/components/icons/filled-circle.d.ts +3 -3
- package/dist/src/components/icons/filter-remove.d.ts +3 -3
- package/dist/src/components/icons/filter.d.ts +3 -3
- package/dist/src/components/icons/folder-save.d.ts +3 -3
- package/dist/src/components/icons/grid.d.ts +3 -3
- package/dist/src/components/icons/hashtag.d.ts +3 -3
- package/dist/src/components/icons/image.d.ts +3 -3
- package/dist/src/components/icons/import.d.ts +3 -3
- package/dist/src/components/icons/info-circle.d.ts +3 -3
- package/dist/src/components/icons/info.d.ts +3 -3
- package/dist/src/components/icons/link-horizontal.d.ts +3 -3
- package/dist/src/components/icons/link.d.ts +3 -3
- package/dist/src/components/icons/location.d.ts +3 -3
- package/dist/src/components/icons/lowest-lead-time.d.ts +3 -3
- package/dist/src/components/icons/lowest-min-qty.d.ts +3 -3
- package/dist/src/components/icons/lowest-price.d.ts +3 -3
- package/dist/src/components/icons/more.d.ts +3 -3
- package/dist/src/components/icons/notification.d.ts +3 -3
- package/dist/src/components/icons/paper-clip.d.ts +3 -3
- package/dist/src/components/icons/paragraph.d.ts +3 -3
- package/dist/src/components/icons/payment-request.d.ts +3 -3
- package/dist/src/components/icons/phone.d.ts +3 -3
- package/dist/src/components/icons/printer.d.ts +3 -3
- package/dist/src/components/icons/process-calendar.d.ts +3 -3
- package/dist/src/components/icons/promotion.d.ts +3 -3
- package/dist/src/components/icons/radio-button.d.ts +3 -3
- package/dist/src/components/icons/receipt-filled.d.ts +3 -3
- package/dist/src/components/icons/receipt-outline.d.ts +3 -3
- package/dist/src/components/icons/receipt.d.ts +3 -3
- package/dist/src/components/icons/refresh-icon.d.ts +3 -3
- package/dist/src/components/icons/replace.d.ts +3 -3
- package/dist/src/components/icons/save.d.ts +3 -3
- package/dist/src/components/icons/search-status.d.ts +3 -3
- package/dist/src/components/icons/search.d.ts +3 -3
- package/dist/src/components/icons/settings-fallback.d.ts +3 -3
- package/dist/src/components/icons/sort-arrow-icon.d.ts +3 -3
- package/dist/src/components/icons/stacked-layer.d.ts +3 -3
- package/dist/src/components/icons/start-filled.d.ts +3 -3
- package/dist/src/components/icons/three-dot-icon.d.ts +3 -3
- package/dist/src/components/icons/tick-circle-filled.d.ts +3 -3
- package/dist/src/components/icons/tick-circle.d.ts +3 -3
- package/dist/src/components/icons/tick-octagon.d.ts +3 -3
- package/dist/src/components/icons/tick.d.ts +3 -3
- package/dist/src/components/icons/toggle-switch.d.ts +3 -3
- package/dist/src/components/icons/trash.d.ts +3 -3
- package/dist/src/components/icons/wave.d.ts +3 -3
- package/dist/src/components/icons/with-out-tick-octagon.d.ts +3 -3
- package/dist/src/components/icons/work-centre.d.ts +3 -3
- package/dist/src/components/location-select.d.ts +1 -1
- package/dist/src/components/material-editable-table/material-editable-table.d.ts +1 -1
- package/dist/src/components/material-table/material-table.d.ts +1 -1
- package/dist/src/components/phone-input/phone-input.d.ts +1 -1
- package/dist/src/components/radio/radio.d.ts +1 -1
- package/dist/src/components/select/select.d.ts +1 -1
- package/dist/src/components/switches/android-12-switch.d.ts +3 -1
- package/dist/src/components/text-field/text-field.d.ts +1 -1
- package/dist/src/components/time-picker/time-picker.d.ts +1 -1
- package/dist/src/components/upload-media/upload-media.d.ts +1 -1
- package/dist/src/utils/common-utility.d.ts +1 -1
- package/dist/style.css +69 -69
- package/dist/styles/index.d.ts +1 -1
- package/dist/theme/theme-impl/index.esm.js.map +1 -1
- package/dist/theme/theme-impl/index.js.map +1 -1
- package/dist/utils/api/index.esm.js +6 -6
- package/dist/utils/api/index.esm.js.map +1 -1
- package/dist/utils/api/index.js +1 -1
- package/dist/utils/api/index.js.map +1 -1
- package/dist/utils/common/index.esm.js +6 -6
- package/dist/utils/common/index.esm.js.map +1 -1
- package/dist/utils/common/index.js +1 -1
- package/dist/utils/common/index.js.map +1 -1
- package/dist/utils/common-utility.d.ts +1 -1
- package/dist/utils/date-range/index.esm.js.map +1 -1
- package/dist/utils/date-range/index.js.map +1 -1
- package/dist/utils/i18n/index.esm.js.map +1 -1
- package/dist/utils/i18n/index.js.map +1 -1
- package/dist/utils/menu-filter/index.esm.js.map +1 -1
- package/dist/utils/menu-filter/index.js.map +1 -1
- package/dist/views/404/index.esm.js.map +1 -1
- package/dist/views/404/index.js.map +1 -1
- package/dist/views/afterAuth/dashboard/dashboard/index.esm.js.map +1 -1
- package/dist/views/afterAuth/dashboard/dashboard/index.js.map +1 -1
- package/dist/views/afterAuth/dashboard/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/views/afterAuth/dashboard/redux/actionCreator/index.js.map +1 -1
- package/dist/views/afterAuth/dashboard/redux/reducer/index.esm.js.map +1 -1
- package/dist/views/afterAuth/dashboard/redux/reducer/index.js.map +1 -1
- package/dist/views/afterAuth/dashboard/redux/state/index.esm.js.map +1 -1
- package/dist/views/afterAuth/dashboard/redux/state/index.js.map +1 -1
- package/dist/views/afterAuth/page-view/page-view/index.esm.js.map +1 -1
- package/dist/views/afterAuth/page-view/page-view/index.js.map +1 -1
- package/dist/views/afterAuth/page-view/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/views/afterAuth/page-view/redux/actionCreator/index.js.map +1 -1
- package/dist/views/afterAuth/page-view/redux/reducer/index.esm.js.map +1 -1
- package/dist/views/afterAuth/page-view/redux/reducer/index.js.map +1 -1
- package/dist/views/afterAuth/page-view/redux/state/index.esm.js.map +1 -1
- package/dist/views/afterAuth/page-view/redux/state/index.js.map +1 -1
- package/dist/views/afterAuth/page-view/utils/default-data/index.esm.js.map +1 -1
- package/dist/views/afterAuth/page-view/utils/default-data/index.js.map +1 -1
- package/dist/views/afterAuth/page-view/utils/local-data/index.esm.js.map +1 -1
- package/dist/views/afterAuth/page-view/utils/local-data/index.js.map +1 -1
- package/dist/views/beforeAuth/change-password/change-password/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/change-password/change-password/index.js.map +1 -1
- package/dist/views/beforeAuth/components/activity-tag-data/activity-tag-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/activity-tag-data/activity-tag-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/calendar-data/calendar-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/calendar-data/calendar-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/gantt-data/gantt-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/gantt-data/gantt-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/grid-data/grid-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/grid-data/grid-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/kanbann-content/kanbann-raw/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/kanbann-content/kanbann-raw/index.js.map +1 -1
- package/dist/views/beforeAuth/components/list-content/column-raw/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/list-content/column-raw/index.js.map +1 -1
- package/dist/views/beforeAuth/components/list-content/list-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/list-content/list-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/multiline-data/multiline-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/multiline-data/multiline-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/share-modal-data/share-modal-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/share-modal-data/share-modal-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/shared-pages-data/shared-pages-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/shared-pages-data/shared-pages-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/tabs-data/tabs-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/tabs-data/tabs-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/user-dashboard-data/user-dashboard-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/user-dashboard-data/user-dashboard-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/user-dropdown-data/user-dropdown-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/user-dropdown-data/user-dropdown-data/index.js.map +1 -1
- package/dist/views/beforeAuth/forgot-password/forgot-password/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/forgot-password/forgot-password/index.js.map +1 -1
- package/dist/views/beforeAuth/landing/landing/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/landing/landing/index.js.map +1 -1
- package/dist/views/beforeAuth/reset-password/reset-password/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/reset-password/reset-password/index.js.map +1 -1
- package/dist/views/form-builder/custom-form/index.esm.js.map +1 -1
- package/dist/views/form-builder/custom-form/index.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/checkbox/index.esm.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/checkbox/index.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/column-width/index.esm.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/column-width/index.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/field-select/index.esm.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/field-select/index.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/section/index.esm.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/section/index.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/select/index.esm.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/select/index.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/table-form/index.esm.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/table-form/index.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/text/index.esm.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/text/index.js.map +1 -1
- package/dist/views/form-builder/field_properties/index.esm.js.map +1 -1
- package/dist/views/form-builder/field_properties/index.js.map +1 -1
- package/dist/views/form-builder/form-fields/index.esm.js.map +1 -1
- package/dist/views/form-builder/form-fields/index.js.map +1 -1
- package/dist/views/form-builder/redux/actionCreator/index.esm.js +1 -1
- package/dist/views/form-builder/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/views/form-builder/redux/actionCreator/index.js +1 -1
- package/dist/views/form-builder/redux/actionCreator/index.js.map +1 -1
- package/dist/views/form-builder/redux/reducer/index.esm.js.map +1 -1
- package/dist/views/form-builder/redux/reducer/index.js.map +1 -1
- package/dist/views/form-builder/redux/state/index.esm.js.map +1 -1
- package/dist/views/form-builder/redux/state/index.js.map +1 -1
- package/dist/views/form-builder/utils/common/index.esm.js.map +1 -1
- package/dist/views/form-builder/utils/common/index.js.map +1 -1
- package/dist/views/index.d.ts +8 -8
- package/dist/views/privateRoute/index.esm.js.map +1 -1
- package/dist/views/privateRoute/index.js.map +1 -1
- package/dist/views/template-editor/add-template/add-template/index.esm.js.map +1 -1
- package/dist/views/template-editor/add-template/add-template/index.js.map +1 -1
- package/dist/views/template-editor/company-selection-modal/company-selection-modal/index.esm.js.map +1 -1
- package/dist/views/template-editor/company-selection-modal/company-selection-modal/index.js.map +1 -1
- package/dist/views/template-editor/components/EditorCanvas/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/EditorCanvas/index.js.map +1 -1
- package/dist/views/template-editor/components/EditorHeader/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/EditorHeader/index.js.map +1 -1
- package/dist/views/template-editor/components/EditorSection/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/EditorSection/index.js.map +1 -1
- package/dist/views/template-editor/components/EditorSidebar/index.esm.js +1 -1
- package/dist/views/template-editor/components/EditorSidebar/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/EditorSidebar/index.js +1 -1
- package/dist/views/template-editor/components/EditorSidebar/index.js.map +1 -1
- package/dist/views/template-editor/components/SectionFlowEditor/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/SectionFlowEditor/index.js.map +1 -1
- package/dist/views/template-editor/components/SectionFormatPanel/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/SectionFormatPanel/index.js.map +1 -1
- package/dist/views/template-editor/components/controllers/AlignmentControl/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/controllers/AlignmentControl/index.js.map +1 -1
- package/dist/views/template-editor/components/controllers/ButtonControls/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/controllers/ButtonControls/index.js.map +1 -1
- package/dist/views/template-editor/components/controllers/CodeControls/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/controllers/CodeControls/index.js.map +1 -1
- package/dist/views/template-editor/components/controllers/DividerControls/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/controllers/DividerControls/index.js.map +1 -1
- package/dist/views/template-editor/components/controllers/ImageControls/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/controllers/ImageControls/index.js.map +1 -1
- package/dist/views/template-editor/components/controllers/SignatureControls/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/controllers/SignatureControls/index.js.map +1 -1
- package/dist/views/template-editor/components/controllers/TableControls/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/controllers/TableControls/index.js.map +1 -1
- package/dist/views/template-editor/components/controllers/TextControls/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/controllers/TextControls/index.js.map +1 -1
- package/dist/views/template-editor/components/controllers/border-control/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/controllers/border-control/index.js.map +1 -1
- package/dist/views/template-editor/edit-section-modal/edit-section-modal/index.esm.js.map +1 -1
- package/dist/views/template-editor/edit-section-modal/edit-section-modal/index.js.map +1 -1
- package/dist/views/template-editor/routes/index.esm.js.map +1 -1
- package/dist/views/template-editor/routes/index.js.map +1 -1
- package/dist/views/template-editor/template-modal/html-thumbnail-preview/index.esm.js.map +1 -1
- package/dist/views/template-editor/template-modal/html-thumbnail-preview/index.js.map +1 -1
- package/dist/views/template-editor/template-modal/template-modal/index.esm.js.map +1 -1
- package/dist/views/template-editor/template-modal/template-modal/index.js.map +1 -1
- package/dist/views/template-editor/template-name-modal/template-name-modal/index.esm.js.map +1 -1
- package/dist/views/template-editor/template-name-modal/template-name-modal/index.js.map +1 -1
- package/dist/views/template-editor/templates/index.esm.js +1 -1
- package/dist/views/template-editor/templates/index.esm.js.map +1 -1
- package/dist/views/template-editor/templates/index.js +1 -1
- package/dist/views/template-editor/templates/index.js.map +1 -1
- package/dist/views/template-editor/utils/common/index.esm.js.map +1 -1
- package/dist/views/template-editor/utils/common/index.js.map +1 -1
- package/dist/views/template-editor/utils/constant/index.esm.js.map +1 -1
- package/dist/views/template-editor/utils/constant/index.js.map +1 -1
- package/dist/views/template-editor/utils/default-data/index.esm.js.map +1 -1
- package/dist/views/template-editor/utils/default-data/index.js.map +1 -1
- package/dist/views/template-editor/utils/style-extractor/index.esm.js.map +1 -1
- package/dist/views/template-editor/utils/style-extractor/index.js.map +1 -1
- package/dist/vite-env.d.ts +23 -23
- package/package.json +299 -299
- package/src/styles/README.md +287 -287
- package/src/styles/all.scss +7 -7
- package/src/styles/animations.scss +5 -5
- package/src/styles/css/reset.css +1 -1
- package/src/styles/index.d.ts +1 -1
- package/src/styles/index.ts +1 -1
- package/src/styles/mixins.scss +5 -5
- package/src/styles/sass/main.scss +11 -11
- package/src/styles/utils.scss +5 -5
- package/src/styles/variables.scss +4 -4
- package/dist/node_modules/@glideapps/glide-data-grid-cells/node_modules/@toast-ui/react-editor/dist/esm/index/index.esm.js.map +0 -1
- package/dist/node_modules/@glideapps/glide-data-grid-cells/node_modules/@toast-ui/react-editor/dist/esm/index/index.js +0 -2
- package/dist/node_modules/@glideapps/glide-data-grid-cells/node_modules/@toast-ui/react-editor/dist/esm/index/index.js.map +0 -1
- package/dist/node_modules/material-react-table/node_modules/@tanstack/react-virtual/dist/esm/index/index.esm.js.map +0 -1
- package/dist/node_modules/material-react-table/node_modules/@tanstack/react-virtual/dist/esm/index/index.js +0 -2
- package/dist/node_modules/material-react-table/node_modules/@tanstack/react-virtual/dist/esm/index/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../src/hooks/use-translations.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../src/hooks/use-translations.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { useLocation } from 'react-router-dom'\nimport { useTranslation } from 'react-i18next'\nimport { loadModuleTranslations } from '../utils/translations'\nimport modules from '../constants/modules'\n\n// Global state to prevent duplicate calls across all hook instances\nlet globalLastLoadedModules = ''\nlet globalIsLoading = false\nlet globalInitialLoad = true\n\nexport const useAppTranslations = () => {\n\tconst [isLoading, setIsLoading] = useState(globalInitialLoad)\n\tconst location = useLocation()\n\tconst { t } = useTranslation()\n\n\tuseEffect(() => {\n\t\tconst erpModules = modules(t)\n\t\tconst currentPath = location.pathname.toLowerCase()\n\n\t\tconst matchedModule = erpModules.find(\n\t\t\t(mod) =>\n\t\t\t\tmod.link.toLowerCase() === currentPath ||\n\t\t\t\tmod.connectedRoutes?.some((route: string) => currentPath.startsWith(route.toLowerCase()))\n\t\t)\n\n\t\tlet modulesToLoad: string[] = []\n\n\t\tif (matchedModule?.translationModule) {\n\t\t\tmodulesToLoad = [...matchedModule.translationModule, 'common']\n\t\t} else if (!matchedModule && currentPath === '/dashboard') {\n\t\t\tmodulesToLoad = ['common']\n\t\t}\n\n\t\tif (modulesToLoad.length > 0) {\n\t\t\tconst moduleKey = [...modulesToLoad].sort().join(',')\n\n\t\t\t// Skip if same modules are already loaded or currently loading\n\t\t\tif (globalLastLoadedModules === moduleKey || globalIsLoading) {\n\t\t\t\tif (globalInitialLoad) {\n\t\t\t\t\tsetIsLoading(false)\n\t\t\t\t\tglobalInitialLoad = false\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tglobalIsLoading = true\n\t\t\tglobalLastLoadedModules = moduleKey\n\t\t\tsetIsLoading(true)\n\n\t\t\tloadModuleTranslations(modulesToLoad).finally(() => {\n\t\t\t\tglobalIsLoading = false\n\t\t\t\tsetIsLoading(false)\n\t\t\t\tglobalInitialLoad = false\n\t\t\t})\n\t\t} else {\n\t\t\t// No modules to load, but still need to handle initial load state\n\t\t\tif (globalInitialLoad) {\n\t\t\t\tsetIsLoading(false)\n\t\t\t\tglobalInitialLoad = false\n\t\t\t}\n\t\t}\n\t}, [location.pathname, t])\n\n\treturn { isLoading }\n};\n\nexport default useAppTranslations;\n"],"names":[],"mappings":";;;;;AAOA,IAAI,0BAA0B;AAC9B,IAAI,kBAAkB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use-translations.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/hooks/use-translations.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { useLocation } from 'react-router-dom'\nimport { useTranslation } from 'react-i18next'\nimport { loadModuleTranslations } from '../utils/translations'\nimport modules from '../constants/modules'\n\n// Global state to prevent duplicate calls across all hook instances\nlet globalLastLoadedModules = ''\nlet globalIsLoading = false\nlet globalInitialLoad = true\n\nexport const useAppTranslations = () => {\n\tconst [isLoading, setIsLoading] = useState(globalInitialLoad)\n\tconst location = useLocation()\n\tconst { t } = useTranslation()\n\n\tuseEffect(() => {\n\t\tconst erpModules = modules(t)\n\t\tconst currentPath = location.pathname.toLowerCase()\n\n\t\tconst matchedModule = erpModules.find(\n\t\t\t(mod) =>\n\t\t\t\tmod.link.toLowerCase() === currentPath ||\n\t\t\t\tmod.connectedRoutes?.some((route: string) => currentPath.startsWith(route.toLowerCase()))\n\t\t)\n\n\t\tlet modulesToLoad: string[] = []\n\n\t\tif (matchedModule?.translationModule) {\n\t\t\tmodulesToLoad = [...matchedModule.translationModule, 'common']\n\t\t} else if (!matchedModule && currentPath === '/dashboard') {\n\t\t\tmodulesToLoad = ['common']\n\t\t}\n\n\t\tif (modulesToLoad.length > 0) {\n\t\t\tconst moduleKey = [...modulesToLoad].sort().join(',')\n\n\t\t\t// Skip if same modules are already loaded or currently loading\n\t\t\tif (globalLastLoadedModules === moduleKey || globalIsLoading) {\n\t\t\t\tif (globalInitialLoad) {\n\t\t\t\t\tsetIsLoading(false)\n\t\t\t\t\tglobalInitialLoad = false\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tglobalIsLoading = true\n\t\t\tglobalLastLoadedModules = moduleKey\n\t\t\tsetIsLoading(true)\n\n\t\t\tloadModuleTranslations(modulesToLoad).finally(() => {\n\t\t\t\tglobalIsLoading = false\n\t\t\t\tsetIsLoading(false)\n\t\t\t\tglobalInitialLoad = false\n\t\t\t})\n\t\t} else {\n\t\t\t// No modules to load, but still need to handle initial load state\n\t\t\tif (globalInitialLoad) {\n\t\t\t\tsetIsLoading(false)\n\t\t\t\tglobalInitialLoad = false\n\t\t\t}\n\t\t}\n\t}, [location.pathname, t])\n\n\treturn { isLoading }\n};\n\nexport default useAppTranslations;\n"],"names":["globalLastLoadedModules","globalIsLoading","globalInitialLoad","useAppTranslations","isLoading","setIsLoading","useState","location","useLocation","t","useTranslation","useEffect","erpModules","modules","currentPath","pathname","toLowerCase","matchedModule","find","mod","link","_a","connectedRoutes","some","route","startsWith","modulesToLoad","translationModule","length","moduleKey","sort","join","loadModuleTranslations","finally"],"mappings":"iPAOA,IAAIA,EAA0B,GAC1BC,GAAkB,EAClBC,GAAoB,EAEjB,MAAMC,EAAqB,KACjC,MAAOC,EAAWC,GAAgBC,EAAAA,SAASJ,GACrCK,EAAWC,EAAAA,eACXC,EAAEA,GAAMC,mBAkDd,OAhDAC,EAAAA,UAAU,KACT,MAAMC,EAAaC,EAAAA,QAAQJ,GACrBK,EAAcP,EAASQ,SAASC,cAEhCC,EAAgBL,EAAWM,KAC/BC,UACA,OAAAA,EAAIC,KAAKJ,gBAAkBF,IAC3B,OAAAO,IAAIC,sBAAJ,EAAAD,EAAqBE,KAAMC,GAAkBV,EAAYW,WAAWD,EAAMR,mBAG5E,IAAIU,EAA0B,GAQ9B,UANIT,WAAeU,mBAClBD,EAAgB,IAAIT,EAAcU,kBAAmB,UAC1CV,GAAiC,eAAhBH,IAC5BY,EAAgB,CAAC,WAGdA,EAAcE,OAAS,EAAG,CAC7B,MAAMC,EAAY,IAAIH,GAAeI,OAAOC,KAAK,KAGjD,GAAI/B,IAA4B6B,GAAa5B,EAK5C,YAJIC,IACHG,GAAa,GACbH,GAAoB,IAKtBD,GAAkB,EAClBD,EAA0B6B,EAC1BxB,GAAa,GAEb2B,yBAAuBN,GAAeO,QAAQ,KAC7ChC,GAAkB,EAClBI,GAAa,GACbH,GAAoB,GAEtB,MAEKA,IACHG,GAAa,GACbH,GAAoB,IAGpB,CAACK,EAASQ,SAAUN,IAEhB,CAAEL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../src/hooks/useApi.tsx"],"sourcesContent":["import { enqueueSnackbar } from 'notistack';\
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../src/hooks/useApi.tsx"],"sourcesContent":["import { enqueueSnackbar } from 'notistack';\nimport { useCallback, useState } from 'react';\ninterface UseApiProps {\n apiFunc: any;\n onSuccess?: any;\n onError?: any;\n enableLoading?: any;\n successMessage?: string;\n errorMessage?: string | null;\n loadingState?: any;\n showError?: boolean;\n}\n\ntype ApiResponse = {\n meta?: {\n requestStatus?: string;\n };\n error?: {\n message?: string;\n };\n payload?: any\n};\n\ntype Callback = () => void;\n\nfunction apiHelper({\n res,\n callBack,\n showError = true,\n errorCallback,\n succsessMessage = null,\n}: {\n res: ApiResponse;\n callBack?: Callback;\n showError?: boolean;\n errorCallback?: (error: any) => void;\n succsessMessage?: string | null;\n}): void {\n if (res?.meta?.requestStatus === \"rejected\") {\n const errorMessage = (() => {\n try {\n return res.error?.message ? JSON.parse(res.error.message) : null;\n } catch {\n return { message: \"Something went wrong\" };\n }\n })();\n\n const message =\n errorMessage?.message?.replace(\"Error:\", \"\").trim() ||\n \"Something went wrong\";\n if (showError) {\n enqueueSnackbar(message, { variant: \"error\" });\n }\n\n if (errorCallback && typeof errorCallback === \"function\") {\n errorCallback(message);\n }\n return;\n }\n if (succsessMessage) {\n enqueueSnackbar(succsessMessage);\n }\n if (callBack && typeof callBack === \"function\") {\n callBack();\n }\n}\n\nexport default function useApi() {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState(null);\n\n const callApi = useCallback(async ({\n apiFunc,\n onSuccess,\n onError,\n successMessage,\n errorMessage,\n loadingState,\n enableLoading = true,\n showError = true,\n }: UseApiProps) => {\n if (enableLoading) setLoading(true);\n loadingState?.(true);\n const response = await apiFunc();\n if (enableLoading) setLoading(false);\n loadingState?.(false);\n apiHelper(\n {\n res: response,\n callBack: () => {\n onSuccess?.(response);\n },\n errorCallback: (err) => {\n onError?.(response);\n setError(errorMessage || err);\n },\n succsessMessage: successMessage,\n showError,\n }\n )\n\n return { response, error }\n\n }, [])\n\n return { callApi, loading, error };\n}\n"],"names":["_a"],"mappings":";;AAyBA,SAAS,UAAU;AAAA,EACf;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA,kBAAkB;AACtB,GAMS;;AACL,QAAI,gCAAK,SAAL,mBAAW,mBAAkB,YAAY;AACzC,UAAM,gBAAgB,MAAM;;AACxB,UAAI;AACA,iBAAOA,MAAA,IAAI,UAAJ,gBAAAA,IAAW,WAAU,KAAK,MAAM,IAAI,MAAM,OAAO,IAAI;AAAA,MAChE,QAAQ;AACJ,eAAO,EAAE,SAAS,uBAAA;AAAA,MACtB;AAAA,IACJ,GAAA;AAEA,UAAM,YACF,kDAAc,YAAd,mBAAuB,QAAQ,UAAU,IAAI,WAC7C;AACJ,QAAI,WAAW;AACX,sBAAgB,SAAS,EAAE,SAAS,QAAA,CAAS;AAAA,IACjD;AAEA,QAAI,iBAAiB,OAAO,kBAAkB,YAAY;AACtD,oBAAc,OAAO;AAAA,IACzB;AACA;AAAA,EACJ;AACA,MAAI,iBAAiB;AACjB,oBAAgB,eAAe;AAAA,EACnC;AACA,MAAI,YAAY,OAAO,aAAa,YAAY;AAC5C,aAAA;AAAA,EACJ;AACJ;AAEA,SAAwB,SAAS;AAC7B,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAC5C,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,IAAI;AAEvC,QAAM,UAAU,YAAY,OAAO;AAAA,IAC/B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB,YAAY;AAAA,EAAA,MACG;AACf,QAAI,0BAA0B,IAAI;AAClC,iDAAe;AACf,UAAM,WAAW,MAAM,QAAA;AACvB,QAAI,0BAA0B,KAAK;AACnC,iDAAe;AACf;AAAA,MACI;AAAA,QACI,KAAK;AAAA,QACL,UAAU,MAAM;AACZ,iDAAY;AAAA,QAChB;AAAA,QACA,eAAe,CAAC,QAAQ;AACpB,6CAAU;AACV,mBAAS,gBAAgB,GAAG;AAAA,QAChC;AAAA,QACA,iBAAiB;AAAA,QACjB;AAAA,MAAA;AAAA,IACJ;AAGJ,WAAO,EAAE,UAAU,MAAA;AAAA,EAEvB,GAAG,CAAA,CAAE;AAEL,SAAO,EAAE,SAAS,SAAS,MAAA;AAC/B;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/hooks/useApi.tsx"],"sourcesContent":["import { enqueueSnackbar } from 'notistack';\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/hooks/useApi.tsx"],"sourcesContent":["import { enqueueSnackbar } from 'notistack';\nimport { useCallback, useState } from 'react';\ninterface UseApiProps {\n apiFunc: any;\n onSuccess?: any;\n onError?: any;\n enableLoading?: any;\n successMessage?: string;\n errorMessage?: string | null;\n loadingState?: any;\n showError?: boolean;\n}\n\ntype ApiResponse = {\n meta?: {\n requestStatus?: string;\n };\n error?: {\n message?: string;\n };\n payload?: any\n};\n\ntype Callback = () => void;\n\nfunction apiHelper({\n res,\n callBack,\n showError = true,\n errorCallback,\n succsessMessage = null,\n}: {\n res: ApiResponse;\n callBack?: Callback;\n showError?: boolean;\n errorCallback?: (error: any) => void;\n succsessMessage?: string | null;\n}): void {\n if (res?.meta?.requestStatus === \"rejected\") {\n const errorMessage = (() => {\n try {\n return res.error?.message ? JSON.parse(res.error.message) : null;\n } catch {\n return { message: \"Something went wrong\" };\n }\n })();\n\n const message =\n errorMessage?.message?.replace(\"Error:\", \"\").trim() ||\n \"Something went wrong\";\n if (showError) {\n enqueueSnackbar(message, { variant: \"error\" });\n }\n\n if (errorCallback && typeof errorCallback === \"function\") {\n errorCallback(message);\n }\n return;\n }\n if (succsessMessage) {\n enqueueSnackbar(succsessMessage);\n }\n if (callBack && typeof callBack === \"function\") {\n callBack();\n }\n}\n\nexport default function useApi() {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState(null);\n\n const callApi = useCallback(async ({\n apiFunc,\n onSuccess,\n onError,\n successMessage,\n errorMessage,\n loadingState,\n enableLoading = true,\n showError = true,\n }: UseApiProps) => {\n if (enableLoading) setLoading(true);\n loadingState?.(true);\n const response = await apiFunc();\n if (enableLoading) setLoading(false);\n loadingState?.(false);\n apiHelper(\n {\n res: response,\n callBack: () => {\n onSuccess?.(response);\n },\n errorCallback: (err) => {\n onError?.(response);\n setError(errorMessage || err);\n },\n succsessMessage: successMessage,\n showError,\n }\n )\n\n return { response, error }\n\n }, [])\n\n return { callApi, loading, error };\n}\n"],"names":["loading","setLoading","useState","error","setError","callApi","useCallback","async","apiFunc","onSuccess","onError","successMessage","errorMessage","loadingState","enableLoading","showError","response","res","callBack","errorCallback","succsessMessage","_a","meta","requestStatus","message","JSON","parse","_b","replace","trim","enqueueSnackbar","variant","apiHelper","err"],"mappings":"4KAmEA,WACI,MAAOA,EAASC,GAAcC,EAAAA,UAAS,IAChCC,EAAOC,GAAYF,EAAAA,SAAS,MAoCnC,MAAO,CAAEG,QAlCOC,EAAAA,YAAYC,OACxBC,UACAC,YACAC,UACAC,iBACAC,eACAC,eACAC,iBAAgB,EAChBC,aAAY,MAERD,MAA0B,GAC9B,MAAAD,GAAAA,GAAe,GACf,MAAMG,QAAiBR,IAkBvB,OAjBIM,MAA0B,GAC9B,MAAAD,GAAAA,GAAe,GA5DvB,UAAmBI,IACfA,EAAAC,SACAA,EAAAH,UACAA,GAAY,EAAAI,cACZA,EAAAC,gBACAA,EAAkB,eAQlB,GAAiC,cAA7B,OAAAC,EAAA,MAAAJ,OAAA,EAAAA,EAAKK,WAAL,EAAAD,EAAWE,eAA8B,CACzC,MAAMX,cACF,IACI,OAAO,OAAAS,EAAAJ,EAAId,YAAJ,EAAAkB,EAAWG,SAAUC,KAAKC,MAAMT,EAAId,MAAMqB,SAAW,IAChE,CAAA,MACI,MAAO,CAAEA,QAAS,uBACtB,CACJ,KAEMA,GACF,OAAAG,EAAA,MAAAf,OAAA,EAAAA,EAAcY,kBAASI,QAAQ,SAAU,IAAIC,SAC7C,uBAQJ,OAPId,GACAe,EAAAA,gBAAgBN,EAAS,CAAEO,QAAS,eAGpCZ,GAA0C,mBAAlBA,GACxBA,EAAcK,GAGtB,CACIJ,GACAU,EAAAA,gBAAgBV,GAEhBF,GAAgC,mBAAbA,GACnBA,GAER,CAqBQc,CACI,CACIf,IAAKD,EACLE,SAAU,KACN,MAAAT,GAAAA,EAAYO,IAEhBG,cAAgBc,IACZ,MAAAvB,GAAAA,EAAUM,GACVZ,EAASQ,GAAgBqB,IAE7Bb,gBAAiBT,EACjBI,cAID,CAAEC,WAAUb,UAEpB,IAEeH,UAASG,QAC/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../src/hooks/useDataFetcher.tsx"],"sourcesContent":["import { useCallback } from 'react';\
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../src/hooks/useDataFetcher.tsx"],"sourcesContent":["import { useCallback } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { usePages } from './use-pages';\n\ninterface FilterParams {\n\tskip: number;\n\tlimit: number;\n\tsearch?: string;\n\tselect?: string;\n\torder?: string;\n\tfilters?: string;\n}\n\ninterface ActivePage {\n\tsort?: { id: string; desc: boolean };\n\tfilterQueryString?: string;\n\tsearch?: string;\n\tvisible_columns?: { visible: boolean; accessorKey: string }[];\n}\n\nexport const useDataFetcher = (\n\tcols?: ActivePage,\n\tpagination: { skip: number; limit: number },\n\tfetchAction: (filters: FilterParams) => void,\n\tcustomeFilter: any = '',\n\tcustomDeps?: any[],\n\tshowCreatedBy: boolean = true,\n\tcustomFields?: any = []\n) => {\n\tconst { activePage } = usePages();\n\tconst dispatch = useDispatch();\n\tconst updatedCols = Array.isArray(cols) ? cols : activePage?.visible_columns;\n\n\tconst getProcessedFilters = useCallback(() => {\n\t\tconst { filterQueryString } = activePage || {};\n\t\tconst queryString = filterQueryString?.replaceAll(/[()]/g, \"\") || '';\n\t\tconst extraQueryString = queryString.length ? `&${queryString}` : '';\n\t\tlet filters = customeFilter;\n\n\t\tif (extraQueryString) {\n\t\t\tfilters = filters ? `(${filters}${extraQueryString})` : `(${extraQueryString})`;\n\t\t} else if (filters) {\n\t\t\tfilters = `(${filters})`;\n\t\t}\n\n\t\treturn filters || undefined;\n\t\t//eslint-disable-next-line\n\t}, [activePage.filterQueryString, customeFilter]);\n\n\tconst fetchData = useCallback(() => {\n\t\tif (!fetchAction) {\n\t\t\treturn;\n\t\t}\n\t\tconst { sort = null, search } = activePage;\n\t\tif (!Array.isArray(cols) && activePage?.visible_columns?.length == 0) return;\n\t\tconst filters = getProcessedFilters();\n\t\tconst visibleColumns = updatedCols\n\t\t\t?.filter((vc) => vc.visible)\n\n\t\tconst selectPayload = visibleColumns?.length > 0 ? `[${visibleColumns\n\t\t\t?.map((item) =>\n\t\t\t\titem.accessorKey?.includes(\".\")\n\t\t\t\t\t? item.accessorKey.split(\".\")[0]\n\t\t\t\t\t: item.accessorKey\n\t\t\t)}${showCreatedBy ? ',created_at,created_by_data' : ''}${customFields?.length ? `,${customFields?.join(',')}` : ''}]` : undefined\n\t\tconst payload: FilterParams = {\n\t\t\tskip: activePage?.skip || pagination?.skip,\n\t\t\tlimit: pagination.limit,\n\t\t\tsearch,\n\t\t\tselect: selectPayload,\n\t\t\t...(sort && { order: `${sort.id}:${sort.desc ? -1 : 1}` }),\n\t\t\t...(filters && { filters }),\n\t\t};\n\n\t\tdispatch(fetchAction(payload));\n\t\t//eslint-disable-next-line\n\t}, [\n\t\tupdatedCols?.length,\n\t\tactivePage.sort,\n\t\tactivePage.filterQueryString,\n\t\tactivePage.search,\n\t\t// pagination?.skip,\n\t\tactivePage?.skip,\n\t\tpagination?.limit,\n\t\tdispatch,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t...(customDeps || []),\n\t]);\n\n\n\n\treturn fetchData;\n};\n\nexport default useDataFetcher;\n"],"names":["_a"],"mappings":";;;AAoBO,MAAM,iBAAiB,CAC7B,MACA,YACA,aACA,gBAAqB,IACrB,YACA,gBAAyB,MACzB,eAAqB,CAAA,MACjB;AACJ,QAAM,EAAE,WAAA,IAAe,SAAA;AACvB,QAAM,WAAW,YAAA;AACjB,QAAM,cAAc,MAAM,QAAQ,IAAI,IAAI,OAAO,yCAAY;AAE7D,QAAM,sBAAsB,YAAY,MAAM;AAC7C,UAAM,EAAE,sBAAsB,cAAc,CAAA;AAC5C,UAAM,eAAc,uDAAmB,WAAW,SAAS,QAAO;AAClE,UAAM,mBAAmB,YAAY,SAAS,IAAI,WAAW,KAAK;AAClE,QAAI,UAAU;AAEd,QAAI,kBAAkB;AACrB,gBAAU,UAAU,IAAI,OAAO,GAAG,gBAAgB,MAAM,IAAI,gBAAgB;AAAA,IAC7E,WAAW,SAAS;AACnB,gBAAU,IAAI,OAAO;AAAA,IACtB;AAEA,WAAO,WAAW;AAAA,EAEnB,GAAG,CAAC,WAAW,mBAAmB,aAAa,CAAC;AAEhD,QAAM,YAAY,YAAY,MAAM;;AACnC,QAAI,CAAC,aAAa;AACjB;AAAA,IACD;AACA,UAAM,EAAE,OAAO,MAAM,OAAA,IAAW;AAChC,QAAI,CAAC,MAAM,QAAQ,IAAI,OAAK,8CAAY,oBAAZ,mBAA6B,WAAU,EAAG;AACtE,UAAM,UAAU,oBAAA;AAChB,UAAM,iBAAiB,2CACpB,OAAO,CAAC,OAAO,GAAG;AAErB,UAAM,iBAAgB,iDAAgB,UAAS,IAAI,IAAI,iDACpD;AAAA,MAAI,CAAC,SAAA;;AACN,iBAAAA,MAAA,KAAK,gBAAL,gBAAAA,IAAkB,SAAS,QACxB,KAAK,YAAY,MAAM,GAAG,EAAE,CAAC,IAC7B,KAAK;AAAA;AAAA,KACR,GAAG,gBAAgB,gCAAgC,EAAE,IAAG,6CAAc,UAAS,IAAI,6CAAc,KAAK,IAAI,KAAK,EAAE,MAAM;AACzH,UAAM,UAAwB;AAAA,MAC7B,OAAM,yCAAY,UAAQ,yCAAY;AAAA,MACtC,OAAO,WAAW;AAAA,MAClB;AAAA,MACA,QAAQ;AAAA,MACR,GAAI,QAAQ,EAAE,OAAO,GAAG,KAAK,EAAE,IAAI,KAAK,OAAO,KAAK,CAAC,GAAA;AAAA,MACrD,GAAI,WAAW,EAAE,QAAA;AAAA,IAAQ;AAG1B,aAAS,YAAY,OAAO,CAAC;AAAA,EAE9B,GAAG;AAAA,IACF,2CAAa;AAAA,IACb,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA;AAAA,IAEX,yCAAY;AAAA,IACZ,yCAAY;AAAA,IACZ;AAAA;AAAA,IAEA,GAAI,cAAc,CAAA;AAAA,EAAC,CACnB;AAID,SAAO;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/hooks/useDataFetcher.tsx"],"sourcesContent":["import { useCallback } from 'react';\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/hooks/useDataFetcher.tsx"],"sourcesContent":["import { useCallback } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { usePages } from './use-pages';\n\ninterface FilterParams {\n\tskip: number;\n\tlimit: number;\n\tsearch?: string;\n\tselect?: string;\n\torder?: string;\n\tfilters?: string;\n}\n\ninterface ActivePage {\n\tsort?: { id: string; desc: boolean };\n\tfilterQueryString?: string;\n\tsearch?: string;\n\tvisible_columns?: { visible: boolean; accessorKey: string }[];\n}\n\nexport const useDataFetcher = (\n\tcols?: ActivePage,\n\tpagination: { skip: number; limit: number },\n\tfetchAction: (filters: FilterParams) => void,\n\tcustomeFilter: any = '',\n\tcustomDeps?: any[],\n\tshowCreatedBy: boolean = true,\n\tcustomFields?: any = []\n) => {\n\tconst { activePage } = usePages();\n\tconst dispatch = useDispatch();\n\tconst updatedCols = Array.isArray(cols) ? cols : activePage?.visible_columns;\n\n\tconst getProcessedFilters = useCallback(() => {\n\t\tconst { filterQueryString } = activePage || {};\n\t\tconst queryString = filterQueryString?.replaceAll(/[()]/g, \"\") || '';\n\t\tconst extraQueryString = queryString.length ? `&${queryString}` : '';\n\t\tlet filters = customeFilter;\n\n\t\tif (extraQueryString) {\n\t\t\tfilters = filters ? `(${filters}${extraQueryString})` : `(${extraQueryString})`;\n\t\t} else if (filters) {\n\t\t\tfilters = `(${filters})`;\n\t\t}\n\n\t\treturn filters || undefined;\n\t\t//eslint-disable-next-line\n\t}, [activePage.filterQueryString, customeFilter]);\n\n\tconst fetchData = useCallback(() => {\n\t\tif (!fetchAction) {\n\t\t\treturn;\n\t\t}\n\t\tconst { sort = null, search } = activePage;\n\t\tif (!Array.isArray(cols) && activePage?.visible_columns?.length == 0) return;\n\t\tconst filters = getProcessedFilters();\n\t\tconst visibleColumns = updatedCols\n\t\t\t?.filter((vc) => vc.visible)\n\n\t\tconst selectPayload = visibleColumns?.length > 0 ? `[${visibleColumns\n\t\t\t?.map((item) =>\n\t\t\t\titem.accessorKey?.includes(\".\")\n\t\t\t\t\t? item.accessorKey.split(\".\")[0]\n\t\t\t\t\t: item.accessorKey\n\t\t\t)}${showCreatedBy ? ',created_at,created_by_data' : ''}${customFields?.length ? `,${customFields?.join(',')}` : ''}]` : undefined\n\t\tconst payload: FilterParams = {\n\t\t\tskip: activePage?.skip || pagination?.skip,\n\t\t\tlimit: pagination.limit,\n\t\t\tsearch,\n\t\t\tselect: selectPayload,\n\t\t\t...(sort && { order: `${sort.id}:${sort.desc ? -1 : 1}` }),\n\t\t\t...(filters && { filters }),\n\t\t};\n\n\t\tdispatch(fetchAction(payload));\n\t\t//eslint-disable-next-line\n\t}, [\n\t\tupdatedCols?.length,\n\t\tactivePage.sort,\n\t\tactivePage.filterQueryString,\n\t\tactivePage.search,\n\t\t// pagination?.skip,\n\t\tactivePage?.skip,\n\t\tpagination?.limit,\n\t\tdispatch,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t...(customDeps || []),\n\t]);\n\n\n\n\treturn fetchData;\n};\n\nexport default useDataFetcher;\n"],"names":["useDataFetcher","cols","pagination","fetchAction","customeFilter","customDeps","showCreatedBy","customFields","activePage","usePages","dispatch","useDispatch","updatedCols","Array","isArray","visible_columns","getProcessedFilters","useCallback","filterQueryString","queryString","replaceAll","extraQueryString","length","filters","sort","search","_a","visibleColumns","filter","vc","visible","selectPayload","map","item","accessorKey","includes","split","join","payload","skip","limit","select","order","id","desc"],"mappings":"uJAoBO,MAAMA,EAAiB,CAC7BC,EACAC,EACAC,EACAC,EAAqB,GACrBC,EACAC,GAAyB,EACzBC,EAAqB,MAErB,MAAMC,WAAEA,GAAeC,aACjBC,EAAWC,EAAAA,cACXC,EAAcC,MAAMC,QAAQb,GAAQA,EAAO,MAAAO,OAAA,EAAAA,EAAYO,gBAEvDC,EAAsBC,EAAAA,YAAY,KACvC,MAAMC,kBAAEA,GAAsBV,GAAc,CAAA,EACtCW,GAAc,MAAAD,OAAA,EAAAA,EAAmBE,WAAW,QAAS,MAAO,GAC5DC,EAAmBF,EAAYG,OAAS,IAAIH,IAAgB,GAClE,IAAII,EAAUnB,EAQd,OANIiB,EACHE,EAAUA,EAAU,IAAIA,IAAUF,KAAsB,IAAIA,KAClDE,IACVA,EAAU,IAAIA,MAGRA,QAAW,GAEhB,CAACf,EAAWU,kBAAmBd,IA4ClC,OA1CkBa,EAAAA,YAAY,WAC7B,IAAKd,EACJ,OAED,MAAMqB,KAAEA,EAAO,KAAAC,OAAMA,GAAWjB,EAChC,IAAKK,MAAMC,QAAQb,IAAgD,IAAvC,OAAAyB,EAAA,MAAAlB,OAAA,EAAAA,EAAYO,sBAAZ,EAAAW,EAA6BJ,QAAa,OACtE,MAAMC,EAAUP,IACVW,EAAiB,MAAAf,OAAA,EAAAA,EACpBgB,OAAQC,GAAOA,EAAGC,SAEfC,GAAgB,MAAAJ,OAAA,EAAAA,EAAgBL,QAAS,EAAI,IAAI,MAAAK,OAAA,EAAAA,EACpDK,IAAKC,UACN,OAAA,OAAAP,EAAAO,EAAKC,kBAAL,EAAAR,EAAkBS,SAAS,MACxBF,EAAKC,YAAYE,MAAM,KAAK,GAC5BH,EAAKC,gBACL5B,EAAgB,8BAAgC,MAAK,MAAAC,OAAA,EAAAA,EAAce,QAAS,IAAI,MAAAf,OAAA,EAAAA,EAAc8B,KAAK,OAAS,WAAQ,EACnHC,EAAwB,CAC7BC,MAAM,MAAA/B,OAAA,EAAAA,EAAY+B,QAAQ,MAAArC,OAAA,EAAAA,EAAYqC,MACtCC,MAAOtC,EAAWsC,MAClBf,SACAgB,OAAQV,KACJP,GAAQ,CAAEkB,MAAO,GAAGlB,EAAKmB,MAAMnB,EAAKoB,MAAO,EAAK,QAChDrB,GAAW,CAAEA,YAGlBb,EAASP,EAAYmC,KAEnB,CACF,MAAA1B,OAAA,EAAAA,EAAaU,OACbd,EAAWgB,KACXhB,EAAWU,kBACXV,EAAWiB,OAEX,MAAAjB,OAAA,EAAAA,EAAY+B,KACZ,MAAArC,OAAA,EAAAA,EAAYsC,MACZ9B,KAEIL,GAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../../src/layout/fullScreen/fullScreen.tsx"],"sourcesContent":["import CssBaseline from '@mui/material/CssBaseline';\
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../src/layout/fullScreen/fullScreen.tsx"],"sourcesContent":["import CssBaseline from '@mui/material/CssBaseline';\nimport Box from '@mui/material/Box';\n\nimport AppBar from '../../components/appbar/appbar';\nimport ActivityArea from '../../components/activityArea/activityArea';\n\nimport drawerWidth from '../../constants/mui.constants';\n\nexport interface IFullscreenLayoutProps {\n children: React.ReactNode;\n}\n\nexport const FullscreenLayout = (props: IFullscreenLayoutProps) => {\n\tconst { children } = props;\n\treturn (\n\t\t<Box sx={{ display: 'flex' }}>\n\t\t\t<CssBaseline />\n\t\t\t<AppBar width={drawerWidth} />\n\t\t\t<ActivityArea>{children}</ActivityArea>\n\t\t</Box>\n\t);\n};\n\nexport default FullscreenLayout;\n"],"names":["AppBar"],"mappings":";;;;;;AAYO,MAAM,mBAAmB,CAAC,UAAkC;AAClE,QAAM,EAAE,aAAa;AACrB,8BACE,KAAA,EAAI,IAAI,EAAE,SAAS,UACnB,UAAA;AAAA,IAAA,oBAAC,aAAA,EAAY;AAAA,IACb,oBAACA,eAAA,EAAO,OAAO,YAAA,CAAa;AAAA,IAC5B,oBAAC,gBAAc,SAAA,CAAS;AAAA,EAAA,GACzB;AAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/layout/fullScreen/fullScreen.tsx"],"sourcesContent":["import CssBaseline from '@mui/material/CssBaseline';\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/layout/fullScreen/fullScreen.tsx"],"sourcesContent":["import CssBaseline from '@mui/material/CssBaseline';\nimport Box from '@mui/material/Box';\n\nimport AppBar from '../../components/appbar/appbar';\nimport ActivityArea from '../../components/activityArea/activityArea';\n\nimport drawerWidth from '../../constants/mui.constants';\n\nexport interface IFullscreenLayoutProps {\n children: React.ReactNode;\n}\n\nexport const FullscreenLayout = (props: IFullscreenLayoutProps) => {\n\tconst { children } = props;\n\treturn (\n\t\t<Box sx={{ display: 'flex' }}>\n\t\t\t<CssBaseline />\n\t\t\t<AppBar width={drawerWidth} />\n\t\t\t<ActivityArea>{children}</ActivityArea>\n\t\t</Box>\n\t);\n};\n\nexport default FullscreenLayout;\n"],"names":["FullscreenLayout","props","children","Box","sx","display","jsx","CssBaseline","AppBar","width","drawerWidth","ActivityArea"],"mappings":"8aAYO,MAAMA,EAAoBC,IAChC,MAAMC,SAAEA,GAAaD;AACrB,cACEE,EAAAA,QAAA,CAAIC,GAAI,CAAEC,QAAS,QACnBH,SAAA;eAAAI,EAAAA,IAACC,EAAAA,QAAA;eACDD,EAAAA,IAACE,EAAAA,cAAA,CAAOC,MAAOC,EAAAA;qBACdC,EAAAA,cAAcT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../../src/layout/sidebarScreen/sidebarScreen.tsx"],"sourcesContent":["import { useEffect, useState, useCallback, useMemo } from 'react';\r\n\r\nimport { useTheme } from '@mui/material/styles';\r\nimport Box from '@mui/material/Box';\r\n\r\nimport AppBar from '../../components/appbar/appbar';\r\nimport SideBar from '../../components/sidebar/sidebar';\r\nimport ActivityArea from '../../components/activityArea/activityArea';\r\n\r\nimport drawerWidth from '../../constants/mui.constants';\r\n// const drawerWidth = 240;\r\nimport { useLanguage } from '../../hooks/useLangauge';\r\nimport { getToken } from '@/utils';\r\nimport { getV1Settings } from '../../api-client/api.manufacturing/api';\r\n\r\n// Local storage key for drawer state\r\nconst DRAWER_STATE_KEY = '_is_drawer_open';\r\n\r\n// Interface for better type safety\r\nexport interface ISidebarLayoutProps {\r\n\tmenu: any[];\r\n\tchildren: React.ReactNode;\r\n\tdashboardPath?: string;\r\n}\r\n\r\nexport const SidebarLayout = (props: ISidebarLayoutProps) => {\r\n\tconst theme = useTheme();\r\n\tconst { currentLanguage } = useLanguage();\r\n\tconst isRtl = useMemo(\r\n\t\t() => currentLanguage?.direction === 'rtl',\r\n\t\t[currentLanguage]\r\n\t);\r\n\t// Enhanced state management\r\n\tconst [forcedOpen, setForcedOpen] = useState(true);\r\n\tconst [hoverOpen, setHoverOpen] = useState(false);\r\n\tconst [isInitialized, setIsInitialized] = useState(false);\r\n\r\n\t// Memoized computed state for actual drawer open status\r\n\tconst isDrawerOpen = forcedOpen || (!forcedOpen && hoverOpen);\r\n\r\n\t// Enhanced drawer control functions with better state management\r\n\tconst handleDrawerOpen = useCallback(() => {\r\n\t\tsetForcedOpen(true);\r\n\t\tsetHoverOpen(false); // Clear hover state when forcing open\r\n\t\ttry {\r\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'true');\r\n\t\t} catch (error) {\r\n\t\t\tconsole.warn('Failed to save drawer state to localStorage:', error);\r\n\t\t}\r\n\t}, []);\r\n\r\n\tconst handleDrawerClose = useCallback(() => {\r\n\t\tsetForcedOpen(false);\r\n\t\twindow.localStorage.setItem('_is_drawer_open', 'false');\r\n\t}, []);\r\n\r\n\tconst [wipSettingsData, setWipSettingsData] = useState<any>(null);\r\n\r\n\tconst getSettings = useCallback(async () => {\r\n\t\t// getToken returns { \"x-token\": string; \"x-timezone\": number }, but API expects string type for \"x-timezone\"\r\n\t\tconst tokenData = getToken();\r\n\t\tconst apiParams = {\r\n\t\t\t'x-token': tokenData['x-token'],\r\n\t\t\t'x-timezone': String(tokenData['x-timezone'])\r\n\t\t};\r\n\t\tconst response = await getV1Settings(apiParams);\r\n\t\t// The \"data\" property may not exist on GetV1SettingsResponses, so check existence safely\r\n\t\tconst data = (response && (response as any)?.data?.settings?.[0]) || null;\r\n\t\tsetWipSettingsData(data);\r\n\t}, []);\r\n\tuseEffect(() => {\r\n\t\tgetSettings();\r\n\t}, [getSettings]);\r\n\r\n\tconst [manufacturingSubmenu, setManufacturingSubmenu] = useState<any>(\r\n\t\tprops.menu\r\n\t);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (wipSettingsData && Array.isArray(props?.menu)) {\r\n\t\t\tconsole.log('wipSettingsData: ', wipSettingsData);\r\n\t\t\tconst _new = props.menu.filter((item) => {\r\n\t\t\t\tif (!wipSettingsData?.enable_production_planning) {\r\n\t\t\t\t\treturn item.label !== 'Plans';\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn item;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tsetManufacturingSubmenu(_new);\r\n\t\t}\r\n\t}, [wipSettingsData, props.menu]);\r\n\t// const module_type = '';\r\n\r\n\tconst handleMouseEnter = () => {\r\n\t\tif (!forcedOpen) {\r\n\t\t\tsetOpen(true);\r\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'true');\r\n\t\t}\r\n\t};\r\n\r\n\tconst handleMouseLeave = useCallback(() => {\r\n\t\tif (!forcedOpen && isInitialized) {\r\n\t\t\tsetHoverOpen(false);\r\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'false');\r\n\t\t}\r\n\t}, [forcedOpen, isInitialized]);\r\n\r\n\t// Toggle function for programmatic control\r\n\tconst toggleDrawer = useCallback(() => {\r\n\t\tif (forcedOpen) {\r\n\t\t\thandleDrawerClose();\r\n\t\t} else {\r\n\t\t\thandleDrawerOpen();\r\n\t\t}\r\n\t}, [forcedOpen, handleDrawerClose, handleDrawerOpen]);\r\n\r\n\t// Enhanced initialization with error handling\r\n\tuseEffect(() => {\r\n\t\tconst initializeDrawerState = () => {\r\n\t\t\ttry {\r\n\t\t\t\tif (typeof window !== 'undefined' && window.localStorage) {\r\n\t\t\t\t\tconst savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\r\n\t\t\t\t\tconst shouldBeOpen = savedState === 'true';\r\n\r\n\t\t\t\t\tsetForcedOpen(shouldBeOpen);\r\n\t\t\t\t\tsetHoverOpen(false); // Ensure hover state is reset\r\n\t\t\t\t\tsetIsInitialized(true);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Fallback for environments without localStorage\r\n\t\t\t\t\tsetForcedOpen(true);\r\n\t\t\t\t\tsetIsInitialized(true);\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.warn('Failed to read drawer state from localStorage:', error);\r\n\t\t\t\t// Fallback to default state\r\n\t\t\t\tsetForcedOpen(true);\r\n\t\t\t\tsetIsInitialized(true);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tinitializeDrawerState();\r\n\t}, []);\r\n\r\n\t// Handle window focus to sync state across tabs\r\n\tuseEffect(() => {\r\n\t\tconst handleWindowFocus = () => {\r\n\t\t\ttry {\r\n\t\t\t\tif (typeof window !== 'undefined' && window.localStorage) {\r\n\t\t\t\t\tconst savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\r\n\t\t\t\t\tconst shouldBeOpen = savedState === 'true';\r\n\r\n\t\t\t\t\tif (shouldBeOpen !== forcedOpen) {\r\n\t\t\t\t\t\tsetForcedOpen(shouldBeOpen);\r\n\t\t\t\t\t\tsetHoverOpen(false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.warn('Failed to sync drawer state on window focus:', error);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\twindow.addEventListener('focus', handleWindowFocus);\r\n\r\n\t\treturn () => {\r\n\t\t\twindow.removeEventListener('focus', handleWindowFocus);\r\n\t\t};\r\n\t}, [forcedOpen]);\r\n\r\n\t// Prevent rendering until initialization is complete\r\n\tif (!isInitialized) {\r\n\t\treturn (\r\n\t\t\t<Box\r\n\t\t\t\tsx={{\r\n\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\tminHeight: '100vh',\r\n\t\t\t\t\talignItems: 'center',\r\n\t\t\t\t\tjustifyContent: 'center'\r\n\t\t\t\t}}>\r\n\t\t\t\t{/* Optional loading indicator */}\r\n\t\t\t\t<Box>Loading...</Box>\r\n\t\t\t</Box>\r\n\t\t);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Box\r\n\t\t\tsx={{\r\n\t\t\t\tdisplay: 'flex',\r\n\t\t\t\tminHeight: '100vh',\r\n\t\t\t\tdirection: isRtl ? 'rtl' : 'ltr'\r\n\t\t\t}}>\r\n\t\t\t<AppBar\r\n\t\t\t\topen={forcedOpen}\r\n\t\t\t\thandleDrawerOpen={handleDrawerOpen}\r\n\t\t\t\thandleDrawerClose={handleDrawerClose}\r\n\t\t\t\ttoggleDrawer={toggleDrawer}\r\n\t\t\t\twidth={drawerWidth}\r\n\t\t\t\tforcedOpen={forcedOpen}\r\n\t\t\t\thoverOpen={hoverOpen}\r\n\t\t\t/>\r\n\r\n\t\t\t<SideBar\r\n\t\t\t\topen={forcedOpen}\r\n\t\t\t\tforcedOpen={forcedOpen}\r\n\t\t\t\thoverOpen={hoverOpen}\r\n\t\t\t\thandleDrawerClose={handleDrawerClose}\r\n\t\t\t\thandleDrawerOpen={handleDrawerOpen}\r\n\t\t\t\ttoggleDrawer={toggleDrawer}\r\n\t\t\t\twidth={drawerWidth}\r\n\t\t\t\ttheme={theme}\r\n\t\t\t\tmenu={manufacturingSubmenu}\r\n\t\t\t\thandleMouseEnter={handleMouseEnter}\r\n\t\t\t\thandleMouseLeave={handleMouseLeave}\r\n\t\t\t\tisInitialized={isInitialized}\r\n\t\t\t\tdashboardPath={props.dashboardPath}\r\n\t\t\t/>\r\n\r\n\t\t\t<ActivityArea\r\n\t\t\t\tisDrawerOpen={isDrawerOpen}\r\n\t\t\t\tdrawerWidth={drawerWidth}\r\n\t\t\t\tforcedOpen={forcedOpen}>\r\n\t\t\t\t{props.children}\r\n\t\t\t</ActivityArea>\r\n\t\t</Box>\r\n\t);\r\n};\r\n\r\nexport default SidebarLayout;\r\n"],"names":["AppBar","SideBar"],"mappings":";;;;;;;;;;;AAgBA,MAAM,mBAAmB;AASlB,MAAM,gBAAgB,CAAC,UAA+B;AAC5D,QAAM,QAAQ,SAAA;AACd,QAAM,EAAE,gBAAA,IAAoB,YAAA;AAC5B,QAAM,QAAQ;AAAA,IACb,OAAM,mDAAiB,eAAc;AAAA,IACrC,CAAC,eAAe;AAAA,EAAA;AAGjB,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,IAAI;AACjD,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAChD,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,KAAK;AAGxD,QAAM,eAAe,cAAe,CAAC,cAAc;AAGnD,QAAM,mBAAmB,YAAY,MAAM;AAC1C,kBAAc,IAAI;AAClB,iBAAa,KAAK;AAClB,QAAI;AACH,aAAO,aAAa,QAAQ,kBAAkB,MAAM;AAAA,IACrD,SAAS,OAAO;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f,MAAI,CAAC,eAAe;AACnB,WACC;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,IAAI;AAAA,UACH,SAAS;AAAA,UACT,WAAW;AAAA,UACX,YAAY;AAAA,UACZ,gBAAgB;AAAA,QAAA;AAAA,QAGjB,UAAA,oBAAC,OAAI,UAAA,aAAA,CAAU;AAAA,MAAA;AAAA,IAAA;AAAA,EAGlB;AAEA,SACC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,IAAI;AAAA,QACH,SAAS;AAAA,QACT,WAAW;AAAA,QACX,WAAW,QAAQ,QAAQ;AAAA,MAAA;AAAA,MAE5B,UAAA;AAAA,QAAA;AAAA,UAACA;AAAAA,UAAA;AAAA,YACA,MAAM;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA,OAAO;AAAA,YACP;AAAA,YACA;AAAA,UAAA;AAAA,QAAA;AAAA,QAGD;AAAA,UAACC;AAAAA,UAAA;AAAA,YACA,MAAM;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,OAAO;AAAA,YACP;AAAA,YACA,MAAM;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA,eAAe,MAAM;AAAA,UAAA;AAAA,QAAA;AAAA,QAGtB;AAAA,UAAC;AAAA,UAAA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACC,UAAA,MAAM;AAAA,UAAA;AAAA,QAAA;AAAA,MACR;AAAA,IAAA;AAAA,EAAA;AAGH;"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../src/layout/sidebarScreen/sidebarScreen.tsx"],"sourcesContent":["import { useEffect, useState, useCallback, useMemo } from 'react';\n\nimport { useTheme } from '@mui/material/styles';\nimport Box from '@mui/material/Box';\n\nimport AppBar from '../../components/appbar/appbar';\nimport SideBar from '../../components/sidebar/sidebar';\nimport ActivityArea from '../../components/activityArea/activityArea';\n\nimport drawerWidth from '../../constants/mui.constants';\n// const drawerWidth = 240;\nimport { useLanguage } from '../../hooks/useLangauge';\nimport { getToken } from '@/utils';\nimport { getV1Settings } from '../../api-client/api.manufacturing/api';\n\n// Local storage key for drawer state\nconst DRAWER_STATE_KEY = '_is_drawer_open';\n\n// Interface for better type safety\nexport interface ISidebarLayoutProps {\n\tmenu: any[];\n\tchildren: React.ReactNode;\n\tdashboardPath?: string;\n}\n\nexport const SidebarLayout = (props: ISidebarLayoutProps) => {\n\tconst theme = useTheme();\n\tconst { currentLanguage } = useLanguage();\n\tconst isRtl = useMemo(\n\t\t() => currentLanguage?.direction === 'rtl',\n\t\t[currentLanguage]\n\t);\n\t// Enhanced state management\n\tconst [forcedOpen, setForcedOpen] = useState(true);\n\tconst [hoverOpen, setHoverOpen] = useState(false);\n\tconst [isInitialized, setIsInitialized] = useState(false);\n\n\t// Memoized computed state for actual drawer open status\n\tconst isDrawerOpen = forcedOpen || (!forcedOpen && hoverOpen);\n\n\t// Enhanced drawer control functions with better state management\n\tconst handleDrawerOpen = useCallback(() => {\n\t\tsetForcedOpen(true);\n\t\tsetHoverOpen(false); // Clear hover state when forcing open\n\t\ttry {\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'true');\n\t\t} catch (error) {\n\t\t\tconsole.warn('Failed to save drawer state to localStorage:', error);\n\t\t}\n\t}, []);\n\n\tconst handleDrawerClose = useCallback(() => {\n\t\tsetForcedOpen(false);\n\t\twindow.localStorage.setItem('_is_drawer_open', 'false');\n\t}, []);\n\n\tconst [wipSettingsData, setWipSettingsData] = useState<any>(null);\n\n\tconst getSettings = useCallback(async () => {\n\t\t// getToken returns { \"x-token\": string; \"x-timezone\": number }, but API expects string type for \"x-timezone\"\n\t\tconst tokenData = getToken();\n\t\tconst apiParams = {\n\t\t\t'x-token': tokenData['x-token'],\n\t\t\t'x-timezone': String(tokenData['x-timezone'])\n\t\t};\n\t\tconst response = await getV1Settings(apiParams);\n\t\t// The \"data\" property may not exist on GetV1SettingsResponses, so check existence safely\n\t\tconst data = (response && (response as any)?.data?.settings?.[0]) || null;\n\t\tsetWipSettingsData(data);\n\t}, []);\n\tuseEffect(() => {\n\t\tgetSettings();\n\t}, [getSettings]);\n\n\tconst [manufacturingSubmenu, setManufacturingSubmenu] = useState<any>(\n\t\tprops.menu\n\t);\n\n\tuseEffect(() => {\n\t\tif (wipSettingsData && Array.isArray(props?.menu)) {\n\t\t\tconsole.log('wipSettingsData: ', wipSettingsData);\n\t\t\tconst _new = props.menu.filter((item) => {\n\t\t\t\tif (!wipSettingsData?.enable_production_planning) {\n\t\t\t\t\treturn item.label !== 'Plans';\n\t\t\t\t} else {\n\t\t\t\t\treturn item;\n\t\t\t\t}\n\t\t\t});\n\t\t\tsetManufacturingSubmenu(_new);\n\t\t}\n\t}, [wipSettingsData, props.menu]);\n\t// const module_type = '';\n\n\tconst handleMouseEnter = () => {\n\t\tif (!forcedOpen) {\n\t\t\tsetOpen(true);\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'true');\n\t\t}\n\t};\n\n\tconst handleMouseLeave = useCallback(() => {\n\t\tif (!forcedOpen && isInitialized) {\n\t\t\tsetHoverOpen(false);\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'false');\n\t\t}\n\t}, [forcedOpen, isInitialized]);\n\n\t// Toggle function for programmatic control\n\tconst toggleDrawer = useCallback(() => {\n\t\tif (forcedOpen) {\n\t\t\thandleDrawerClose();\n\t\t} else {\n\t\t\thandleDrawerOpen();\n\t\t}\n\t}, [forcedOpen, handleDrawerClose, handleDrawerOpen]);\n\n\t// Enhanced initialization with error handling\n\tuseEffect(() => {\n\t\tconst initializeDrawerState = () => {\n\t\t\ttry {\n\t\t\t\tif (typeof window !== 'undefined' && window.localStorage) {\n\t\t\t\t\tconst savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\n\t\t\t\t\tconst shouldBeOpen = savedState === 'true';\n\n\t\t\t\t\tsetForcedOpen(shouldBeOpen);\n\t\t\t\t\tsetHoverOpen(false); // Ensure hover state is reset\n\t\t\t\t\tsetIsInitialized(true);\n\t\t\t\t} else {\n\t\t\t\t\t// Fallback for environments without localStorage\n\t\t\t\t\tsetForcedOpen(true);\n\t\t\t\t\tsetIsInitialized(true);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn('Failed to read drawer state from localStorage:', error);\n\t\t\t\t// Fallback to default state\n\t\t\t\tsetForcedOpen(true);\n\t\t\t\tsetIsInitialized(true);\n\t\t\t}\n\t\t};\n\n\t\tinitializeDrawerState();\n\t}, []);\n\n\t// Handle window focus to sync state across tabs\n\tuseEffect(() => {\n\t\tconst handleWindowFocus = () => {\n\t\t\ttry {\n\t\t\t\tif (typeof window !== 'undefined' && window.localStorage) {\n\t\t\t\t\tconst savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\n\t\t\t\t\tconst shouldBeOpen = savedState === 'true';\n\n\t\t\t\t\tif (shouldBeOpen !== forcedOpen) {\n\t\t\t\t\t\tsetForcedOpen(shouldBeOpen);\n\t\t\t\t\t\tsetHoverOpen(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn('Failed to sync drawer state on window focus:', error);\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener('focus', handleWindowFocus);\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener('focus', handleWindowFocus);\n\t\t};\n\t}, [forcedOpen]);\n\n\t// Prevent rendering until initialization is complete\n\tif (!isInitialized) {\n\t\treturn (\n\t\t\t<Box\n\t\t\t\tsx={{\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tminHeight: '100vh',\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tjustifyContent: 'center'\n\t\t\t\t}}>\n\t\t\t\t{/* Optional loading indicator */}\n\t\t\t\t<Box>Loading...</Box>\n\t\t\t</Box>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Box\n\t\t\tsx={{\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tminHeight: '100vh',\n\t\t\t\tdirection: isRtl ? 'rtl' : 'ltr'\n\t\t\t}}>\n\t\t\t<AppBar\n\t\t\t\topen={forcedOpen}\n\t\t\t\thandleDrawerOpen={handleDrawerOpen}\n\t\t\t\thandleDrawerClose={handleDrawerClose}\n\t\t\t\ttoggleDrawer={toggleDrawer}\n\t\t\t\twidth={drawerWidth}\n\t\t\t\tforcedOpen={forcedOpen}\n\t\t\t\thoverOpen={hoverOpen}\n\t\t\t/>\n\n\t\t\t<SideBar\n\t\t\t\topen={forcedOpen}\n\t\t\t\tforcedOpen={forcedOpen}\n\t\t\t\thoverOpen={hoverOpen}\n\t\t\t\thandleDrawerClose={handleDrawerClose}\n\t\t\t\thandleDrawerOpen={handleDrawerOpen}\n\t\t\t\ttoggleDrawer={toggleDrawer}\n\t\t\t\twidth={drawerWidth}\n\t\t\t\ttheme={theme}\n\t\t\t\tmenu={manufacturingSubmenu}\n\t\t\t\thandleMouseEnter={handleMouseEnter}\n\t\t\t\thandleMouseLeave={handleMouseLeave}\n\t\t\t\tisInitialized={isInitialized}\n\t\t\t\tdashboardPath={props.dashboardPath}\n\t\t\t/>\n\n\t\t\t<ActivityArea\n\t\t\t\tisDrawerOpen={isDrawerOpen}\n\t\t\t\tdrawerWidth={drawerWidth}\n\t\t\t\tforcedOpen={forcedOpen}>\n\t\t\t\t{props.children}\n\t\t\t</ActivityArea>\n\t\t</Box>\n\t);\n};\n\nexport default SidebarLayout;\n"],"names":["AppBar","SideBar"],"mappings":";;;;;;;;;;;AAgBA,MAAM,mBAAmB;AASlB,MAAM,gBAAgB,CAAC,UAA+B;AAC5D,QAAM,QAAQ,SAAA;AACd,QAAM,EAAE,gBAAA,IAAoB,YAAA;AAC5B,QAAM,QAAQ;AAAA,IACb,OAAM,mDAAiB,eAAc;AAAA,IACrC,CAAC,eAAe;AAAA,EAAA;AAGjB,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,IAAI;AACjD,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KA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../src/layout/sidebarScreen/sidebarScreen.tsx"],"sourcesContent":["import { useEffect, useState, useCallback, useMemo } from 'react';\r\n\r\nimport { useTheme } from '@mui/material/styles';\r\nimport Box from '@mui/material/Box';\r\n\r\nimport AppBar from '../../components/appbar/appbar';\r\nimport SideBar from '../../components/sidebar/sidebar';\r\nimport ActivityArea from '../../components/activityArea/activityArea';\r\n\r\nimport drawerWidth from '../../constants/mui.constants';\r\n// const drawerWidth = 240;\r\nimport { useLanguage } from '../../hooks/useLangauge';\r\nimport { getToken } from '@/utils';\r\nimport { getV1Settings } from '../../api-client/api.manufacturing/api';\r\n\r\n// Local storage key for drawer state\r\nconst DRAWER_STATE_KEY = '_is_drawer_open';\r\n\r\n// Interface for better type safety\r\nexport interface ISidebarLayoutProps {\r\n\tmenu: any[];\r\n\tchildren: React.ReactNode;\r\n\tdashboardPath?: string;\r\n}\r\n\r\nexport const SidebarLayout = (props: ISidebarLayoutProps) => {\r\n\tconst theme = useTheme();\r\n\tconst { currentLanguage } = useLanguage();\r\n\tconst isRtl = useMemo(\r\n\t\t() => currentLanguage?.direction === 'rtl',\r\n\t\t[currentLanguage]\r\n\t);\r\n\t// Enhanced state management\r\n\tconst [forcedOpen, setForcedOpen] = useState(true);\r\n\tconst [hoverOpen, setHoverOpen] = useState(false);\r\n\tconst [isInitialized, setIsInitialized] = useState(false);\r\n\r\n\t// Memoized computed state for actual drawer open status\r\n\tconst isDrawerOpen = forcedOpen || (!forcedOpen && hoverOpen);\r\n\r\n\t// Enhanced drawer control functions with better state management\r\n\tconst handleDrawerOpen = useCallback(() => {\r\n\t\tsetForcedOpen(true);\r\n\t\tsetHoverOpen(false); // Clear hover state when forcing open\r\n\t\ttry {\r\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'true');\r\n\t\t} catch (error) {\r\n\t\t\tconsole.warn('Failed to save drawer state to localStorage:', error);\r\n\t\t}\r\n\t}, []);\r\n\r\n\tconst handleDrawerClose = useCallback(() => {\r\n\t\tsetForcedOpen(false);\r\n\t\twindow.localStorage.setItem('_is_drawer_open', 'false');\r\n\t}, []);\r\n\r\n\tconst [wipSettingsData, setWipSettingsData] = useState<any>(null);\r\n\r\n\tconst getSettings = useCallback(async () => {\r\n\t\t// getToken returns { \"x-token\": string; \"x-timezone\": number }, but API expects string type for \"x-timezone\"\r\n\t\tconst tokenData = getToken();\r\n\t\tconst apiParams = {\r\n\t\t\t'x-token': tokenData['x-token'],\r\n\t\t\t'x-timezone': String(tokenData['x-timezone'])\r\n\t\t};\r\n\t\tconst response = await getV1Settings(apiParams);\r\n\t\t// The \"data\" property may not exist on GetV1SettingsResponses, so check existence safely\r\n\t\tconst data = (response && (response as any)?.data?.settings?.[0]) || null;\r\n\t\tsetWipSettingsData(data);\r\n\t}, []);\r\n\tuseEffect(() => {\r\n\t\tgetSettings();\r\n\t}, [getSettings]);\r\n\r\n\tconst [manufacturingSubmenu, setManufacturingSubmenu] = useState<any>(\r\n\t\tprops.menu\r\n\t);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (wipSettingsData && Array.isArray(props?.menu)) {\r\n\t\t\tconsole.log('wipSettingsData: ', wipSettingsData);\r\n\t\t\tconst _new = props.menu.filter((item) => {\r\n\t\t\t\tif (!wipSettingsData?.enable_production_planning) {\r\n\t\t\t\t\treturn item.label !== 'Plans';\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn item;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tsetManufacturingSubmenu(_new);\r\n\t\t}\r\n\t}, [wipSettingsData, props.menu]);\r\n\t// const module_type = '';\r\n\r\n\tconst handleMouseEnter = () => {\r\n\t\tif (!forcedOpen) {\r\n\t\t\tsetOpen(true);\r\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'true');\r\n\t\t}\r\n\t};\r\n\r\n\tconst handleMouseLeave = useCallback(() => {\r\n\t\tif (!forcedOpen && isInitialized) {\r\n\t\t\tsetHoverOpen(false);\r\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'false');\r\n\t\t}\r\n\t}, [forcedOpen, isInitialized]);\r\n\r\n\t// Toggle function for programmatic control\r\n\tconst toggleDrawer = useCallback(() => {\r\n\t\tif (forcedOpen) {\r\n\t\t\thandleDrawerClose();\r\n\t\t} else {\r\n\t\t\thandleDrawerOpen();\r\n\t\t}\r\n\t}, [forcedOpen, handleDrawerClose, handleDrawerOpen]);\r\n\r\n\t// Enhanced initialization with error handling\r\n\tuseEffect(() => {\r\n\t\tconst initializeDrawerState = () => {\r\n\t\t\ttry {\r\n\t\t\t\tif (typeof window !== 'undefined' && window.localStorage) {\r\n\t\t\t\t\tconst savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\r\n\t\t\t\t\tconst shouldBeOpen = savedState === 'true';\r\n\r\n\t\t\t\t\tsetForcedOpen(shouldBeOpen);\r\n\t\t\t\t\tsetHoverOpen(false); // Ensure hover state is reset\r\n\t\t\t\t\tsetIsInitialized(true);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Fallback for environments without localStorage\r\n\t\t\t\t\tsetForcedOpen(true);\r\n\t\t\t\t\tsetIsInitialized(true);\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.warn('Failed to read drawer state from localStorage:', error);\r\n\t\t\t\t// Fallback to default state\r\n\t\t\t\tsetForcedOpen(true);\r\n\t\t\t\tsetIsInitialized(true);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tinitializeDrawerState();\r\n\t}, []);\r\n\r\n\t// Handle window focus to sync state across tabs\r\n\tuseEffect(() => {\r\n\t\tconst handleWindowFocus = () => {\r\n\t\t\ttry {\r\n\t\t\t\tif (typeof window !== 'undefined' && window.localStorage) {\r\n\t\t\t\t\tconst savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\r\n\t\t\t\t\tconst shouldBeOpen = savedState === 'true';\r\n\r\n\t\t\t\t\tif (shouldBeOpen !== forcedOpen) {\r\n\t\t\t\t\t\tsetForcedOpen(shouldBeOpen);\r\n\t\t\t\t\t\tsetHoverOpen(false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.warn('Failed to sync drawer state on window focus:', error);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\twindow.addEventListener('focus', handleWindowFocus);\r\n\r\n\t\treturn () => {\r\n\t\t\twindow.removeEventListener('focus', handleWindowFocus);\r\n\t\t};\r\n\t}, [forcedOpen]);\r\n\r\n\t// Prevent rendering until initialization is complete\r\n\tif (!isInitialized) {\r\n\t\treturn (\r\n\t\t\t<Box\r\n\t\t\t\tsx={{\r\n\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\tminHeight: '100vh',\r\n\t\t\t\t\talignItems: 'center',\r\n\t\t\t\t\tjustifyContent: 'center'\r\n\t\t\t\t}}>\r\n\t\t\t\t{/* Optional loading indicator */}\r\n\t\t\t\t<Box>Loading...</Box>\r\n\t\t\t</Box>\r\n\t\t);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<Box\r\n\t\t\tsx={{\r\n\t\t\t\tdisplay: 'flex',\r\n\t\t\t\tminHeight: '100vh',\r\n\t\t\t\tdirection: isRtl ? 'rtl' : 'ltr'\r\n\t\t\t}}>\r\n\t\t\t<AppBar\r\n\t\t\t\topen={forcedOpen}\r\n\t\t\t\thandleDrawerOpen={handleDrawerOpen}\r\n\t\t\t\thandleDrawerClose={handleDrawerClose}\r\n\t\t\t\ttoggleDrawer={toggleDrawer}\r\n\t\t\t\twidth={drawerWidth}\r\n\t\t\t\tforcedOpen={forcedOpen}\r\n\t\t\t\thoverOpen={hoverOpen}\r\n\t\t\t/>\r\n\r\n\t\t\t<SideBar\r\n\t\t\t\topen={forcedOpen}\r\n\t\t\t\tforcedOpen={forcedOpen}\r\n\t\t\t\thoverOpen={hoverOpen}\r\n\t\t\t\thandleDrawerClose={handleDrawerClose}\r\n\t\t\t\thandleDrawerOpen={handleDrawerOpen}\r\n\t\t\t\ttoggleDrawer={toggleDrawer}\r\n\t\t\t\twidth={drawerWidth}\r\n\t\t\t\ttheme={theme}\r\n\t\t\t\tmenu={manufacturingSubmenu}\r\n\t\t\t\thandleMouseEnter={handleMouseEnter}\r\n\t\t\t\thandleMouseLeave={handleMouseLeave}\r\n\t\t\t\tisInitialized={isInitialized}\r\n\t\t\t\tdashboardPath={props.dashboardPath}\r\n\t\t\t/>\r\n\r\n\t\t\t<ActivityArea\r\n\t\t\t\tisDrawerOpen={isDrawerOpen}\r\n\t\t\t\tdrawerWidth={drawerWidth}\r\n\t\t\t\tforcedOpen={forcedOpen}>\r\n\t\t\t\t{props.children}\r\n\t\t\t</ActivityArea>\r\n\t\t</Box>\r\n\t);\r\n};\r\n\r\nexport default SidebarLayout;\r\n"],"names":["DRAWER_STATE_KEY","SidebarLayout","props","theme","useTheme","currentLanguage","useLanguage","isRtl","useMemo","direction","forcedOpen","setForcedOpen","useState","hoverOpen","setHoverOpen","isInitialized","setIsInitialized","isDrawerOpen","handleDrawerOpen","useCallback","window","localStorage","setItem","error","handleDrawerClose","wipSettingsData","setWipSettingsData","getSettings","async","tokenData","getToken","apiParams","String","response","getV1Settings","data","_b","_a","settings","useEffect","manufacturingSubmenu","setManufacturingSubmenu","menu","Array","isArray","_new","filter","item","enable_production_planning","label","handleMouseLeave","toggleDrawer","savedState","getItem","initializeDrawerState","handleWindowFocus","shouldBeOpen","addEventListener","removeEventListener","jsxs","Box","sx","display","minHeight","children","jsx","AppBar","open","width","drawerWidth","SideBar","handleMouseEnter","setOpen","dashboardPath","ActivityArea","alignItems","justifyContent"],"mappings":"gpBAgBA,MAAMA,EAAmB,kBASZC,EAAiBC,IAC7B,MAAMC,EAAQC,EAAAA,WACRC,gBAAEA,GAAoBC,gBACtBC,EAAQC,EAAAA,QACb,IAAqC,eAA/BH,WAAiBI,WACvB,CAACJ,KAGKK,EAAYC,GAAiBC,EAAAA,UAAS,IACtCC,EAAWC,GAAgBF,EAAAA,UAAS,IACpCG,EAAeC,GAAoBJ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AAQrD,GAG/CW,EAFoC,SAAfyC,GAGrBtC,GAAa,GACbE,GAAiB,EAClB,MAECL,GAAc,GACdK,GAAiB,EAEnB,OAASO,GAGRZ,GAAc,GACdK,GAAiB,EAClB,GAGDsC,IACE,IAGHf,EAAAA,UAAU,KACT,MAAMgB,EAAoB,KACzB,IACC,GAAsB,oBAAXnC,QAA0BA,OAAOC,aAAc,CACzD,MACMmC,EAA8B,SADjBpC,OAAOC,aAAagC,QAAQrD,GAG3CwD,IAAiB9C,IACpBC,EAAc6C,GACd1C,GAAa,GAEf,CACD,OAASS,GAET,GAKD,OAFAH,OAAOqC,iBAAiB,QAASF,GAE1B,KACNnC,OAAOsC,oBAAoB,QAASH,KAEnC,CAAC7C,IAGCK,iBAgBJ4C,EAAAA,KAACC,EAAAA,QAAA,CACAC,GAAI,CACHC,QAAS,OACTC,UAAW,QACXtD,UAAWF,EAAQ,MAAQ,OAE5ByD,SAAA;eAAAC,EAAAA,IAACC,EAAAA,cAAA,CACAC,KAAMzD,EACNQ,mBACAM,oBACA2B,eACAiB,MAAOC,EAAAA,QACP3D,aACAG;eAGDoD,EAAAA,IAACK,EAAAA,QAAA,CACAH,KAAMzD,EACNA,aACAG,YACAW,oBACAN,mBACAiC,eACAiB,MAAOC,EAAAA,QACPlE,QACAuC,KAAMF,EACN+B,iBAtHsB,KACnB7D,IACJ8D,SAAQ,GACRpD,OAAOC,aAAaC,QAAQtB,EAAkB,UAoH7CkD,mBACAnC,gBACA0D,cAAevE,EAAMuE;eAGtBR,EAAAA,IAACS,EAAAA,aAAA,CACAzD,eAAAoD,YACAA,EAAAA,QACA3D,aACCsD,SAAA9D,EAAM8D,6BAlDRC,EAAAA,IAACL,EAAAA,QAAA,CACAC,GAAI,CACHC,QAAS,OACTC,UAAW,QACXY,WAAY,SACZC,eAAgB,UAGjBZ,0BAAAC,IAACL,EAAAA,SAAII,SAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/layout/sidebarScreen/sidebarScreen.tsx"],"sourcesContent":["import { useEffect, useState, useCallback, useMemo } from 'react';\n\nimport { useTheme } from '@mui/material/styles';\nimport Box from '@mui/material/Box';\n\nimport AppBar from '../../components/appbar/appbar';\nimport SideBar from '../../components/sidebar/sidebar';\nimport ActivityArea from '../../components/activityArea/activityArea';\n\nimport drawerWidth from '../../constants/mui.constants';\n// const drawerWidth = 240;\nimport { useLanguage } from '../../hooks/useLangauge';\nimport { getToken } from '@/utils';\nimport { getV1Settings } from '../../api-client/api.manufacturing/api';\n\n// Local storage key for drawer state\nconst DRAWER_STATE_KEY = '_is_drawer_open';\n\n// Interface for better type safety\nexport interface ISidebarLayoutProps {\n\tmenu: any[];\n\tchildren: React.ReactNode;\n\tdashboardPath?: string;\n}\n\nexport const SidebarLayout = (props: ISidebarLayoutProps) => {\n\tconst theme = useTheme();\n\tconst { currentLanguage } = useLanguage();\n\tconst isRtl = useMemo(\n\t\t() => currentLanguage?.direction === 'rtl',\n\t\t[currentLanguage]\n\t);\n\t// Enhanced state management\n\tconst [forcedOpen, setForcedOpen] = useState(true);\n\tconst [hoverOpen, setHoverOpen] = useState(false);\n\tconst [isInitialized, setIsInitialized] = useState(false);\n\n\t// Memoized computed state for actual drawer open status\n\tconst isDrawerOpen = forcedOpen || (!forcedOpen && hoverOpen);\n\n\t// Enhanced drawer control functions with better state management\n\tconst handleDrawerOpen = useCallback(() => {\n\t\tsetForcedOpen(true);\n\t\tsetHoverOpen(false); // Clear hover state when forcing open\n\t\ttry {\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'true');\n\t\t} catch (error) {\n\t\t\tconsole.warn('Failed to save drawer state to localStorage:', error);\n\t\t}\n\t}, []);\n\n\tconst handleDrawerClose = useCallback(() => {\n\t\tsetForcedOpen(false);\n\t\twindow.localStorage.setItem('_is_drawer_open', 'false');\n\t}, []);\n\n\tconst [wipSettingsData, setWipSettingsData] = useState<any>(null);\n\n\tconst getSettings = useCallback(async () => {\n\t\t// getToken returns { \"x-token\": string; \"x-timezone\": number }, but API expects string type for \"x-timezone\"\n\t\tconst tokenData = getToken();\n\t\tconst apiParams = {\n\t\t\t'x-token': tokenData['x-token'],\n\t\t\t'x-timezone': String(tokenData['x-timezone'])\n\t\t};\n\t\tconst response = await getV1Settings(apiParams);\n\t\t// The \"data\" property may not exist on GetV1SettingsResponses, so check existence safely\n\t\tconst data = (response && (response as any)?.data?.settings?.[0]) || null;\n\t\tsetWipSettingsData(data);\n\t}, []);\n\tuseEffect(() => {\n\t\tgetSettings();\n\t}, [getSettings]);\n\n\tconst [manufacturingSubmenu, setManufacturingSubmenu] = useState<any>(\n\t\tprops.menu\n\t);\n\n\tuseEffect(() => {\n\t\tif (wipSettingsData && Array.isArray(props?.menu)) {\n\t\t\tconsole.log('wipSettingsData: ', wipSettingsData);\n\t\t\tconst _new = props.menu.filter((item) => {\n\t\t\t\tif (!wipSettingsData?.enable_production_planning) {\n\t\t\t\t\treturn item.label !== 'Plans';\n\t\t\t\t} else {\n\t\t\t\t\treturn item;\n\t\t\t\t}\n\t\t\t});\n\t\t\tsetManufacturingSubmenu(_new);\n\t\t}\n\t}, [wipSettingsData, props.menu]);\n\t// const module_type = '';\n\n\tconst handleMouseEnter = () => {\n\t\tif (!forcedOpen) {\n\t\t\tsetOpen(true);\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'true');\n\t\t}\n\t};\n\n\tconst handleMouseLeave = useCallback(() => {\n\t\tif (!forcedOpen && isInitialized) {\n\t\t\tsetHoverOpen(false);\n\t\t\twindow.localStorage.setItem(DRAWER_STATE_KEY, 'false');\n\t\t}\n\t}, [forcedOpen, isInitialized]);\n\n\t// Toggle function for programmatic control\n\tconst toggleDrawer = useCallback(() => {\n\t\tif (forcedOpen) {\n\t\t\thandleDrawerClose();\n\t\t} else {\n\t\t\thandleDrawerOpen();\n\t\t}\n\t}, [forcedOpen, handleDrawerClose, handleDrawerOpen]);\n\n\t// Enhanced initialization with error handling\n\tuseEffect(() => {\n\t\tconst initializeDrawerState = () => {\n\t\t\ttry {\n\t\t\t\tif (typeof window !== 'undefined' && window.localStorage) {\n\t\t\t\t\tconst savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\n\t\t\t\t\tconst shouldBeOpen = savedState === 'true';\n\n\t\t\t\t\tsetForcedOpen(shouldBeOpen);\n\t\t\t\t\tsetHoverOpen(false); // Ensure hover state is reset\n\t\t\t\t\tsetIsInitialized(true);\n\t\t\t\t} else {\n\t\t\t\t\t// Fallback for environments without localStorage\n\t\t\t\t\tsetForcedOpen(true);\n\t\t\t\t\tsetIsInitialized(true);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn('Failed to read drawer state from localStorage:', error);\n\t\t\t\t// Fallback to default state\n\t\t\t\tsetForcedOpen(true);\n\t\t\t\tsetIsInitialized(true);\n\t\t\t}\n\t\t};\n\n\t\tinitializeDrawerState();\n\t}, []);\n\n\t// Handle window focus to sync state across tabs\n\tuseEffect(() => {\n\t\tconst handleWindowFocus = () => {\n\t\t\ttry {\n\t\t\t\tif (typeof window !== 'undefined' && window.localStorage) {\n\t\t\t\t\tconst savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\n\t\t\t\t\tconst shouldBeOpen = savedState === 'true';\n\n\t\t\t\t\tif (shouldBeOpen !== forcedOpen) {\n\t\t\t\t\t\tsetForcedOpen(shouldBeOpen);\n\t\t\t\t\t\tsetHoverOpen(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn('Failed to sync drawer state on window focus:', error);\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener('focus', handleWindowFocus);\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener('focus', handleWindowFocus);\n\t\t};\n\t}, [forcedOpen]);\n\n\t// Prevent rendering until initialization is complete\n\tif (!isInitialized) {\n\t\treturn (\n\t\t\t<Box\n\t\t\t\tsx={{\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tminHeight: '100vh',\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tjustifyContent: 'center'\n\t\t\t\t}}>\n\t\t\t\t{/* Optional loading indicator */}\n\t\t\t\t<Box>Loading...</Box>\n\t\t\t</Box>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Box\n\t\t\tsx={{\n\t\t\t\tdisplay: 'flex',\n\t\t\t\tminHeight: '100vh',\n\t\t\t\tdirection: isRtl ? 'rtl' : 'ltr'\n\t\t\t}}>\n\t\t\t<AppBar\n\t\t\t\topen={forcedOpen}\n\t\t\t\thandleDrawerOpen={handleDrawerOpen}\n\t\t\t\thandleDrawerClose={handleDrawerClose}\n\t\t\t\ttoggleDrawer={toggleDrawer}\n\t\t\t\twidth={drawerWidth}\n\t\t\t\tforcedOpen={forcedOpen}\n\t\t\t\thoverOpen={hoverOpen}\n\t\t\t/>\n\n\t\t\t<SideBar\n\t\t\t\topen={forcedOpen}\n\t\t\t\tforcedOpen={forcedOpen}\n\t\t\t\thoverOpen={hoverOpen}\n\t\t\t\thandleDrawerClose={handleDrawerClose}\n\t\t\t\thandleDrawerOpen={handleDrawerOpen}\n\t\t\t\ttoggleDrawer={toggleDrawer}\n\t\t\t\twidth={drawerWidth}\n\t\t\t\ttheme={theme}\n\t\t\t\tmenu={manufacturingSubmenu}\n\t\t\t\thandleMouseEnter={handleMouseEnter}\n\t\t\t\thandleMouseLeave={handleMouseLeave}\n\t\t\t\tisInitialized={isInitialized}\n\t\t\t\tdashboardPath={props.dashboardPath}\n\t\t\t/>\n\n\t\t\t<ActivityArea\n\t\t\t\tisDrawerOpen={isDrawerOpen}\n\t\t\t\tdrawerWidth={drawerWidth}\n\t\t\t\tforcedOpen={forcedOpen}>\n\t\t\t\t{props.children}\n\t\t\t</ActivityArea>\n\t\t</Box>\n\t);\n};\n\nexport default SidebarLayout;\n"],"names":["DRAWER_STATE_KEY","SidebarLayout","props","theme","useTheme","currentLanguage","useLanguage","isRtl","useMemo","direction","forcedOpen","setForcedOpen","useState","hoverOpen","setHoverOpen","isInitialized","setIsInitialized","isDrawerOpen","handleDrawerOpen","useCallback","window","localStorage","setItem","error","handleDrawerClose","wipSettingsData","setWipSettingsData","getSettings","async","tokenData","getToken","apiParams","String","response","getV1Settings","data","_b","_a","settings","useEffect","manufacturingSubmenu","setManufacturingSubmenu","menu","Array","isArray","_new","filter","item","enable_production_planning","label","handleMouseLeave","toggleDrawer","savedState","getItem","initializeDrawerState","handleWindowFocus","shouldBeOpen","addEventListener","removeEventListener","jsxs","Box","sx","display","minHeight","children","jsx","AppBar","open","width","drawerWidth","SideBar","handleMouseEnter","setOpen","dashboardPath","ActivityArea","alignItems","justifyContent"],"mappings":"gpBAgBA,MAAMA,EAAmB,kBASZC,EAAiBC,IAC7B,MAAMC,EAAQC,EAAAA,WACRC,gBAAEA,GAAoBC,gBACtBC,EAAQC,EAAAA,QACb,IAAqC,eAA/BH,WAAiBI,WACvB,CAACJ,KAGKK,EAAYC,GAAiBC,EAAAA,UAAS,IACtCC,EAAWC,GAAgBF,EAAAA,UAAS,IACpCG,EAAeC,GAAoBJ,EAAAA,UAAS,GAG7CK,EAAeP,IAAgBA,GAAcG,EAG7CK,EAAmBC,EAAAA,YAAY,KACpCR,GAAc,GACdG,GAAa,GACb,IACCM,OAAOC,aAAaC,QAAQtB,EAAkB,OAC/C,OAASuB,GAET,GACE,IAEGC,EAAoBL,EAAAA,YAAY,KACrCR,GAAc,GACdS,OAAOC,aAAaC,QAAQ,kBAAmB,UAC7C,KAEIG,EAAiBC,GAAsBd,EAAAA,SAAc,MAEtDe,EAAcR,EAAAA,YAAYS,kBAE/B,MAAMC,EAAYC,EAAAA,WACZC,EAAY,CACjB,UAAWF,EAAU,WACrB,aAAcG,OAAOH,EAAU,gBAE1BI,QAAiBC,EAAAA,cAAcH,GAE/BI,EAAQF,IAAa,OAAAG,EAAA,OAAAC,EAAA,MAAAJ,OAAA,EAAAA,EAAkBE,WAAlB,EAAAE,EAAwBC,mBAAW,KAAO,KACrEZ,EAAmBS,I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SAAA;eAAAC,EAAAA,IAACC,EAAAA,cAAA,CACAC,KAAMzD,EACNQ,mBACAM,oBACA2B,eACAiB,MAAOC,EAAAA,QACP3D,aACAG;eAGDoD,EAAAA,IAACK,EAAAA,QAAA,CACAH,KAAMzD,EACNA,aACAG,YACAW,oBACAN,mBACAiC,eACAiB,MAAOC,EAAAA,QACPlE,QACAuC,KAAMF,EACN+B,iBAtHsB,KACnB7D,IACJ8D,SAAQ,GACRpD,OAAOC,aAAaC,QAAQtB,EAAkB,UAoH7CkD,mBACAnC,gBACA0D,cAAevE,EAAMuE;eAGtBR,EAAAA,IAACS,EAAAA,aAAA,CACAzD,eAAAoD,YACAA,EAAAA,QACA3D,aACCsD,SAAA9D,EAAM8D,6BAlDRC,EAAAA,IAACL,EAAAA,QAAA,CACAC,GAAI,CACHC,QAAS,OACTC,UAAW,QACXY,WAAY,SACZC,eAAgB,UAGjBZ,0BAAAC,IAACL,EAAAA,SAAII,SAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { styled_default } from "../chunk-ST7UZKI3/index.esm.js";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { Editor as default_1 } from "
|
|
3
|
+
import { Editor as default_1 } from "../../../../../@toast-ui/react-editor/dist/esm/index/index.esm.js";
|
|
4
4
|
var Wrapper = /* @__PURE__ */ styled_default("div")({
|
|
5
5
|
name: "Wrapper",
|
|
6
6
|
class: "wkyirgj",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../chunk-ST7UZKI3/index.js"),t=require("react"),a=require("
|
|
2
|
-
return n.createElement(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../chunk-ST7UZKI3/index.js"),t=require("react"),a=require("../../../../../@toast-ui/react-editor/dist/esm/index/index.js");function i(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=/* @__PURE__ */Object.create(null);return e&&Object.keys(e).forEach(function(a){if("default"!==a){var i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:function(){return e[a]}})}}),t.default=e,t}var n=/* @__PURE__ */i(t),r=/* @__PURE__ */e.styled_default("div")({name:"Wrapper",class:"wkyirgj",propsAsIs:!1});exports.default=e=>{const[t,i]=n.useState(e.value.data.markdown),o=n.useCallback(e=>{e.stopPropagation()},[]),l=n.useCallback(()=>{e.onFinishedEditing({...e.value,data:{...e.value.data,markdown:t}})},[e,t]),s=n.useCallback(()=>{e.onFinishedEditing(void 0)},[e]);/* @__PURE__ */
|
|
2
|
+
return n.createElement(r,{id:"markdown-wysiwyg",onKeyDown:o},/* @__PURE__ */n.createElement(a.Editor,{initialEditType:"wysiwyg",autofocus:!0,initialValue:e.value.data.markdown,hideModeSwitch:!0,onChange:i,height:"75vh",usageStatistics:!1,toolbarItems:[["heading","bold","italic","strike"],["hr","quote"],["ul","ol","task","indent","outdent"],["table","link"],["code","codeblock"]]}),/* @__PURE__ */n.createElement("div",{className:"footer"},/* @__PURE__ */n.createElement("button",{className:"close-button",onClick:s},"Close"),/* @__PURE__ */n.createElement("button",{className:"save-button",onClick:l},"Save")))};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../node_modules/@glideapps/glide-data-grid-cells/dist/js/article-cell-editor-JDI676YI.js"],"sourcesContent":["import {\n styled_default\n} from \"./chunk-ST7UZKI3.js\";\n\n// src/cells/article-cell-editor.tsx\nimport * as React from \"react\";\nimport { Editor } from \"@toast-ui/react-editor\";\nvar Wrapper = /* @__PURE__ */ styled_default(\"div\")({\n name: \"Wrapper\",\n class: \"wkyirgj\",\n propsAsIs: false\n});\nvar ArticleCellEditor = (p) => {\n const [tempValue, setTempValue] = React.useState(p.value.data.markdown);\n const onKeyDown = React.useCallback((e) => {\n e.stopPropagation();\n }, []);\n const onSave = React.useCallback(() => {\n p.onFinishedEditing({\n ...p.value,\n data: {\n ...p.value.data,\n markdown: tempValue\n }\n });\n }, [p, tempValue]);\n const onClose = React.useCallback(() => {\n p.onFinishedEditing(void 0);\n }, [p]);\n return /* @__PURE__ */ React.createElement(Wrapper, {\n id: \"markdown-wysiwyg\",\n onKeyDown\n }, /* @__PURE__ */ React.createElement(Editor, {\n initialEditType: \"wysiwyg\",\n autofocus: true,\n initialValue: p.value.data.markdown,\n hideModeSwitch: true,\n onChange: setTempValue,\n height: \"75vh\",\n usageStatistics: false,\n toolbarItems: [[\"heading\", \"bold\", \"italic\", \"strike\"], [\"hr\", \"quote\"], [\"ul\", \"ol\", \"task\", \"indent\", \"outdent\"], [\"table\", \"link\"], [\"code\", \"codeblock\"]]\n }), /* @__PURE__ */ React.createElement(\"div\", {\n className: \"footer\"\n }, /* @__PURE__ */ React.createElement(\"button\", {\n className: \"close-button\",\n onClick: onClose\n }, \"Close\"), /* @__PURE__ */ React.createElement(\"button\", {\n className: \"save-button\",\n onClick: onSave\n }, \"Save\")));\n};\nvar article_cell_editor_default = ArticleCellEditor;\nexport {\n article_cell_editor_default as default\n};\n"],"names":["Wrapper","styled_default","name","class","propsAsIs","p","tempValue","setTempValue","React","useState","value","data","markdown","onKeyDown","useCallback","e","stopPropagation","onSave","onFinishedEditing","onClose","createElement","id","Editor","initialEditType","autofocus","initialValue","hideModeSwitch","onChange","height","usageStatistics","toolbarItems","className","onClick"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../node_modules/@glideapps/glide-data-grid-cells/dist/js/article-cell-editor-JDI676YI.js"],"sourcesContent":["import {\n styled_default\n} from \"./chunk-ST7UZKI3.js\";\n\n// src/cells/article-cell-editor.tsx\nimport * as React from \"react\";\nimport { Editor } from \"@toast-ui/react-editor\";\nvar Wrapper = /* @__PURE__ */ styled_default(\"div\")({\n name: \"Wrapper\",\n class: \"wkyirgj\",\n propsAsIs: false\n});\nvar ArticleCellEditor = (p) => {\n const [tempValue, setTempValue] = React.useState(p.value.data.markdown);\n const onKeyDown = React.useCallback((e) => {\n e.stopPropagation();\n }, []);\n const onSave = React.useCallback(() => {\n p.onFinishedEditing({\n ...p.value,\n data: {\n ...p.value.data,\n markdown: tempValue\n }\n });\n }, [p, tempValue]);\n const onClose = React.useCallback(() => {\n p.onFinishedEditing(void 0);\n }, [p]);\n return /* @__PURE__ */ React.createElement(Wrapper, {\n id: \"markdown-wysiwyg\",\n onKeyDown\n }, /* @__PURE__ */ React.createElement(Editor, {\n initialEditType: \"wysiwyg\",\n autofocus: true,\n initialValue: p.value.data.markdown,\n hideModeSwitch: true,\n onChange: setTempValue,\n height: \"75vh\",\n usageStatistics: false,\n toolbarItems: [[\"heading\", \"bold\", \"italic\", \"strike\"], [\"hr\", \"quote\"], [\"ul\", \"ol\", \"task\", \"indent\", \"outdent\"], [\"table\", \"link\"], [\"code\", \"codeblock\"]]\n }), /* @__PURE__ */ React.createElement(\"div\", {\n className: \"footer\"\n }, /* @__PURE__ */ React.createElement(\"button\", {\n className: \"close-button\",\n onClick: onClose\n }, \"Close\"), /* @__PURE__ */ React.createElement(\"button\", {\n className: \"save-button\",\n onClick: onSave\n }, \"Save\")));\n};\nvar article_cell_editor_default = ArticleCellEditor;\nexport {\n article_cell_editor_default as default\n};\n"],"names":["Wrapper","styled_default","name","class","propsAsIs","p","tempValue","setTempValue","React","useState","value","data","markdown","onKeyDown","useCallback","e","stopPropagation","onSave","onFinishedEditing","onClose","createElement","id","Editor","initialEditType","autofocus","initialValue","hideModeSwitch","onChange","height","usageStatistics","toolbarItems","className","onClick"],"mappings":"0hBAOIA,iBAA0BC,EAAAA,eAAe,MAAfA,CAAsB,CAClDC,KAAM,UACNC,MAAO,UACPC,WAAW,oBAEYC,IACvB,MAAOC,EAAWC,GAAgBC,EAAMC,SAASJ,EAAEK,MAAMC,KAAKC,UACxDC,EAAYL,EAAMM,YAAaC,IACnCA,EAAEC,mBACD,IACGC,EAAST,EAAMM,YAAY,KAC/BT,EAAEa,kBAAkB,IACfb,EAAEK,MACLC,KAAM,IACDN,EAAEK,MAAMC,KACXC,SAAUN,MAGb,CAACD,EAAGC,IACDa,EAAUX,EAAMM,YAAY,KAChCT,EAAEa,uBAAkB,IACnB,CAACb;AACJ,OAAuBG,EAAMY,cAAcpB,EAAS,CAClDqB,GAAI,mBACJR,4BACiBL,EAAMY,cAAcE,SAAQ,CAC7CC,gBAAiB,UACjBC,WAAW,EACXC,aAAcpB,EAAEK,MAAMC,KAAKC,SAC3Bc,gBAAgB,EAChBC,SAAUpB,EACVqB,OAAQ,OACRC,iBAAiB,EACjBC,aAAc,CAAC,CAAC,UAAW,OAAQ,SAAU,UAAW,CAAC,KAAM,SAAU,CAAC,KAAM,KAAM,OAAQ,SAAU,WAAY,CAAC,QAAS,QAAS,CAAC,OAAQ,+BAC9HtB,EAAMY,cAAc,MAAO,CAC7CW,UAAW,yBACMvB,EAAMY,cAAc,SAAU,CAC/CW,UAAW,eACXC,QAASb,GACR,wBAA0BX,EAAMY,cAAc,SAAU,CACzDW,UAAW,cACXC,QAASf,GACR","x_google_ignoreList":[0]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __exports as colorManipulator } from "../../../../_virtual/colorManipulator/index.esm.js";
|
|
2
|
-
import require$$1 from "../../../../_virtual/index/index.
|
|
3
|
-
import require$$2 from "../../../../_virtual/index/index.
|
|
2
|
+
import require$$1 from "../../../../_virtual/index/index.esm4.js";
|
|
3
|
+
import require$$2 from "../../../../_virtual/index/index.esm5.js";
|
|
4
4
|
import { i as interopRequireDefaultExports } from "../../../@babel/runtime/helpers/interopRequireDefault/index.esm.js";
|
|
5
5
|
var define_process_env_default = {};
|
|
6
6
|
var _interopRequireDefault = interopRequireDefaultExports;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/colorManipulator/index.js"),r=require("../../../../_virtual/index/
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/colorManipulator/index.js"),r=require("../../../../_virtual/index/index4.js"),t=require("../../../../_virtual/index/index5.js"),n=require("../../../@babel/runtime/helpers/interopRequireDefault/index.js"),o={},a=n.interopRequireDefaultExports;Object.defineProperty(e.__exports,"__esModule",{value:!0});var s=e.__exports.alpha=b;e.__exports.blend=function(e,r,t,n=1){const o=(e,r)=>Math.round((e**(1/n)*(1-t)+r**(1/n)*t)**n),a=x(e),s=x(r);return v({type:"rgb",values:[o(a.values[0],s.values[0]),o(a.values[1],s.values[1]),o(a.values[2],s.values[2])]})},e.__exports.colorChannel=void 0;var l=e.__exports.darken=m;e.__exports.decomposeColor=x;var u=e.__exports.emphasize=M,p=e.__exports.getContrastRatio=function(e,r){const t=y(e),n=y(r);return(Math.max(t,n)+.05)/(Math.min(t,n)+.05)};e.__exports.getLuminance=y,e.__exports.hexToRgb=_,e.__exports.hslToRgb=g;var i=e.__exports.lighten=O;e.__exports.private_safeAlpha=function(e,r,t){try{return b(e,r)}catch(n){return e}},e.__exports.private_safeColorChannel=void 0,e.__exports.private_safeDarken=function(e,r,t){try{return m(e,r)}catch(n){return e}},e.__exports.private_safeEmphasize=function(e,r,t){try{return M(e,r)}catch(n){return e}},e.__exports.private_safeLighten=function(e,r,t){try{return O(e,r)}catch(n){return e}},e.__exports.recomposeColor=v,e.__exports.rgbToHex=function(e){if(0===e.indexOf("#"))return e;const{values:r}=x(e);return`#${r.map((e,r)=>function(e){const r=e.toString(16);return 1===r.length?`0${r}`:r}(3===r?Math.round(255*e):e)).join("")}`};var c=a(r.default),f=a(t.default);function h(e,r=0,t=1){return(0,f.default)(e,r,t)}function _(e){e=e.slice(1);const r=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let t=e.match(r);return t&&1===t[0].length&&(t=t.map(e=>e+e)),t?`rgb${4===t.length?"a":""}(${t.map((e,r)=>r<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3).join(", ")})`:""}function x(e){if(e.type)return e;if("#"===e.charAt(0))return x(_(e));const r=e.indexOf("("),t=e.substring(0,r);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(t))throw new Error("production"!==o.NODE_ENV?`MUI: Unsupported \`${e}\` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`:(0,c.default)(9,e));let n,a=e.substring(r+1,e.length-1);if("color"===t){if(a=a.split(" "),n=a.shift(),4===a.length&&"/"===a[3].charAt(0)&&(a[3]=a[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(n))throw new Error("production"!==o.NODE_ENV?`MUI: unsupported \`${n}\` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`:(0,c.default)(10,n))}else a=a.split(",");return a=a.map(e=>parseFloat(e)),{type:t,values:a,colorSpace:n}}const d=e=>{const r=x(e);return r.values.slice(0,3).map((e,t)=>-1!==r.type.indexOf("hsl")&&0!==t?`${e}%`:e).join(" ")};function v(e){const{type:r,colorSpace:t}=e;let{values:n}=e;return-1!==r.indexOf("rgb")?n=n.map((e,r)=>r<3?parseInt(e,10):e):-1!==r.indexOf("hsl")&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),n=-1!==r.indexOf("color")?`${t} ${n.join(" ")}`:`${n.join(", ")}`,`${r}(${n})`}function g(e){e=x(e);const{values:r}=e,t=r[0],n=r[1]/100,o=r[2]/100,a=n*Math.min(o,1-o),s=(e,r=(e+t/30)%12)=>o-a*Math.max(Math.min(r-3,9-r,1),-1);let l="rgb";const u=[Math.round(255*s(0)),Math.round(255*s(8)),Math.round(255*s(4))];return"hsla"===e.type&&(l+="a",u.push(r[3])),v({type:l,values:u})}function y(e){let r="hsl"===(e=x(e)).type||"hsla"===e.type?x(g(e)).values:e.values;return r=r.map(r=>("color"!==e.type&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*r[0]+.7152*r[1]+.0722*r[2]).toFixed(3))}function b(e,r){return e=x(e),r=h(r),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]=`/${r}`:e.values[3]=r,v(e)}function m(e,r){if(e=x(e),r=h(r),-1!==e.type.indexOf("hsl"))e.values[2]*=1-r;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(let t=0;t<3;t+=1)e.values[t]*=1-r;return v(e)}function O(e,r){if(e=x(e),r=h(r),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*r;else if(-1!==e.type.indexOf("rgb"))for(let t=0;t<3;t+=1)e.values[t]+=(255-e.values[t])*r;else if(-1!==e.type.indexOf("color"))for(let t=0;t<3;t+=1)e.values[t]+=(1-e.values[t])*r;return v(e)}function M(e,r=.15){return y(e)>.5?m(e,r):O(e,r)}e.__exports.colorChannel=d,e.__exports.private_safeColorChannel=(e,r)=>{try{return d(e)}catch(t){return e}},exports.default=e.__exports,exports.alpha=s,exports.darken=l,exports.emphasize=u,exports.getContrastRatio=p,exports.lighten=i;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../node_modules/@mui/system/colorManipulator.js"],"sourcesContent":["\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.alpha = alpha;\nexports.blend = blend;\nexports.colorChannel = void 0;\nexports.darken = darken;\nexports.decomposeColor = decomposeColor;\nexports.emphasize = emphasize;\nexports.getContrastRatio = getContrastRatio;\nexports.getLuminance = getLuminance;\nexports.hexToRgb = hexToRgb;\nexports.hslToRgb = hslToRgb;\nexports.lighten = lighten;\nexports.private_safeAlpha = private_safeAlpha;\nexports.private_safeColorChannel = void 0;\nexports.private_safeDarken = private_safeDarken;\nexports.private_safeEmphasize = private_safeEmphasize;\nexports.private_safeLighten = private_safeLighten;\nexports.recomposeColor = recomposeColor;\nexports.rgbToHex = rgbToHex;\nvar _formatMuiErrorMessage2 = _interopRequireDefault(require(\"@mui/utils/formatMuiErrorMessage\"));\nvar _clamp = _interopRequireDefault(require(\"@mui/utils/clamp\"));\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/**\n * Returns a number whose value is limited to the given range.\n * @param {number} value The value to be clamped\n * @param {number} min The lower boundary of the output range\n * @param {number} max The upper boundary of the output range\n * @returns {number} A number in the range [min, max]\n */\nfunction clampWrapper(value, min = 0, max = 1) {\n if (process.env.NODE_ENV !== 'production') {\n if (value < min || value > max) {\n console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);\n }\n }\n return (0, _clamp.default)(value, min, max);\n}\n\n/**\n * Converts a color from CSS hex format to CSS rgb format.\n * @param {string} color - Hex color, i.e. #nnn or #nnnnnn\n * @returns {string} A CSS rgb color string\n */\nfunction hexToRgb(color) {\n color = color.slice(1);\n const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, 'g');\n let colors = color.match(re);\n if (colors && colors[0].length === 1) {\n colors = colors.map(n => n + n);\n }\n return colors ? `rgb${colors.length === 4 ? 'a' : ''}(${colors.map((n, index) => {\n return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;\n }).join(', ')})` : '';\n}\nfunction intToHex(int) {\n const hex = int.toString(16);\n return hex.length === 1 ? `0${hex}` : hex;\n}\n\n/**\n * Returns an object with the type and values of a color.\n *\n * Note: Does not support rgb % values.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {object} - A MUI color object: {type: string, values: number[]}\n */\nfunction decomposeColor(color) {\n // Idempotent\n if (color.type) {\n return color;\n }\n if (color.charAt(0) === '#') {\n return decomposeColor(hexToRgb(color));\n }\n const marker = color.indexOf('(');\n const type = color.substring(0, marker);\n if (['rgb', 'rgba', 'hsl', 'hsla', 'color'].indexOf(type) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: Unsupported \\`${color}\\` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` : (0, _formatMuiErrorMessage2.default)(9, color));\n }\n let values = color.substring(marker + 1, color.length - 1);\n let colorSpace;\n if (type === 'color') {\n values = values.split(' ');\n colorSpace = values.shift();\n if (values.length === 4 && values[3].charAt(0) === '/') {\n values[3] = values[3].slice(1);\n }\n if (['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].indexOf(colorSpace) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: unsupported \\`${colorSpace}\\` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.` : (0, _formatMuiErrorMessage2.default)(10, colorSpace));\n }\n } else {\n values = values.split(',');\n }\n values = values.map(value => parseFloat(value));\n return {\n type,\n values,\n colorSpace\n };\n}\n\n/**\n * Returns a channel created from the input color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {string} - The channel for the color, that can be used in rgba or hsla colors\n */\nconst colorChannel = color => {\n const decomposedColor = decomposeColor(color);\n return decomposedColor.values.slice(0, 3).map((val, idx) => decomposedColor.type.indexOf('hsl') !== -1 && idx !== 0 ? `${val}%` : val).join(' ');\n};\nexports.colorChannel = colorChannel;\nconst private_safeColorChannel = (color, warning) => {\n try {\n return colorChannel(color);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n};\n\n/**\n * Converts a color object with type and values to a string.\n * @param {object} color - Decomposed color\n * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color'\n * @param {array} color.values - [n,n,n] or [n,n,n,n]\n * @returns {string} A CSS color string\n */\nexports.private_safeColorChannel = private_safeColorChannel;\nfunction recomposeColor(color) {\n const {\n type,\n colorSpace\n } = color;\n let {\n values\n } = color;\n if (type.indexOf('rgb') !== -1) {\n // Only convert the first 3 values to int (i.e. not alpha)\n values = values.map((n, i) => i < 3 ? parseInt(n, 10) : n);\n } else if (type.indexOf('hsl') !== -1) {\n values[1] = `${values[1]}%`;\n values[2] = `${values[2]}%`;\n }\n if (type.indexOf('color') !== -1) {\n values = `${colorSpace} ${values.join(' ')}`;\n } else {\n values = `${values.join(', ')}`;\n }\n return `${type}(${values})`;\n}\n\n/**\n * Converts a color from CSS rgb format to CSS hex format.\n * @param {string} color - RGB color, i.e. rgb(n, n, n)\n * @returns {string} A CSS rgb color string, i.e. #nnnnnn\n */\nfunction rgbToHex(color) {\n // Idempotent\n if (color.indexOf('#') === 0) {\n return color;\n }\n const {\n values\n } = decomposeColor(color);\n return `#${values.map((n, i) => intToHex(i === 3 ? Math.round(255 * n) : n)).join('')}`;\n}\n\n/**\n * Converts a color from hsl format to rgb format.\n * @param {string} color - HSL color values\n * @returns {string} rgb color values\n */\nfunction hslToRgb(color) {\n color = decomposeColor(color);\n const {\n values\n } = color;\n const h = values[0];\n const s = values[1] / 100;\n const l = values[2] / 100;\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n let type = 'rgb';\n const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];\n if (color.type === 'hsla') {\n type += 'a';\n rgb.push(values[3]);\n }\n return recomposeColor({\n type,\n values: rgb\n });\n}\n/**\n * The relative brightness of any point in a color space,\n * normalized to 0 for darkest black and 1 for lightest white.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {number} The relative brightness of the color in the range 0 - 1\n */\nfunction getLuminance(color) {\n color = decomposeColor(color);\n let rgb = color.type === 'hsl' || color.type === 'hsla' ? decomposeColor(hslToRgb(color)).values : color.values;\n rgb = rgb.map(val => {\n if (color.type !== 'color') {\n val /= 255; // normalized\n }\n return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;\n });\n\n // Truncate at 3 digits\n return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));\n}\n\n/**\n * Calculates the contrast ratio between two colors.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} A contrast ratio value in the range 0 - 21.\n */\nfunction getContrastRatio(foreground, background) {\n const lumA = getLuminance(foreground);\n const lumB = getLuminance(background);\n return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);\n}\n\n/**\n * Sets the absolute transparency of a color.\n * Any existing alpha values are overwritten.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} value - value to set the alpha channel to in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction alpha(color, value) {\n color = decomposeColor(color);\n value = clampWrapper(value);\n if (color.type === 'rgb' || color.type === 'hsl') {\n color.type += 'a';\n }\n if (color.type === 'color') {\n color.values[3] = `/${value}`;\n } else {\n color.values[3] = value;\n }\n return recomposeColor(color);\n}\nfunction private_safeAlpha(color, value, warning) {\n try {\n return alpha(color, value);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darkens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction darken(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] *= 1 - coefficient;\n } else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] *= 1 - coefficient;\n }\n }\n return recomposeColor(color);\n}\nfunction private_safeDarken(color, coefficient, warning) {\n try {\n return darken(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Lightens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction lighten(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] += (100 - color.values[2]) * coefficient;\n } else if (color.type.indexOf('rgb') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (255 - color.values[i]) * coefficient;\n }\n } else if (color.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (1 - color.values[i]) * coefficient;\n }\n }\n return recomposeColor(color);\n}\nfunction private_safeLighten(color, coefficient, warning) {\n try {\n return lighten(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darken or lighten a color, depending on its luminance.\n * Light colors are darkened, dark colors are lightened.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient=0.15 - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction emphasize(color, coefficient = 0.15) {\n return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);\n}\nfunction private_safeEmphasize(color, coefficient, warning) {\n try {\n return emphasize(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Blend a transparent overlay color with a background color, resulting in a single\n * RGB color.\n * @param {string} background - CSS color\n * @param {string} overlay - CSS color\n * @param {number} opacity - Opacity multiplier in the range 0 - 1\n * @param {number} [gamma=1.0] - Gamma correction factor. For gamma-correct blending, 2.2 is usual.\n */\nfunction blend(background, overlay, opacity, gamma = 1.0) {\n const blendChannel = (b, o) => Math.round((b ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);\n const backgroundColor = decomposeColor(background);\n const overlayColor = decomposeColor(overlay);\n const rgb = [blendChannel(backgroundColor.values[0], overlayColor.values[0]), blendChannel(backgroundColor.values[1], overlayColor.values[1]), blendChannel(backgroundColor.values[2], overlayColor.values[2])];\n return recomposeColor({\n type: 'rgb',\n values: rgb\n });\n}"],"names":["_interopRequireDefault","require$$0","Object","defineProperty","colorManipulator","value","alpha_1","alpha","blend","background","overlay","opacity","gamma","blendChannel","b","o","Math","round","backgroundColor","decomposeColor","overlayColor","recomposeColor","type","values","colorChannel","darken_1","darken","emphasize_1","emphasize","getContrastRatio_1","getContrastRatio","foreground","lumA","getLuminance","lumB","max","min","hexToRgb","hslToRgb","lighten_1","lighten","private_safeAlpha","color","warning","error","private_safeColorChannel","private_safeDarken","coefficient","private_safeEmphasize","private_safeLighten","rgbToHex","indexOf","map","n","i","int","hex","toString","length","intToHex","join","_formatMuiErrorMessage2","require$$1","_clamp","require$$2","clampWrapper","default","slice","re","RegExp","colors","match","index","parseInt","charAt","marker","substring","Error","define_process_env_default","NODE_ENV","colorSpace","split","shift","parseFloat","decomposedColor","val","idx","h","s","l","a","f","k","rgb","push","Number","toFixed"],"mappings":"2TAEIA,EAAyBC,EAAAA,6BAC7BC,OAAOC,eAAeC,EAAAA,UAAS,aAAc,CAC3CC,OAAO,IAET,IAAAC,EAAAF,EAAAA,UAAAG,MAAgBA,EAChBH,EAAAA,UAAAI,MA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,KACtC,OAAOd,EAAaS,GAAS,GAAMhB,EAAOgB,EAAOK,GAAeP,EAAQE,EAAOK,EACjF,CA/NA3C,EAAAA,UAAAoB,aAAuBA,EAmBvBpB,EAAAA,UAAAyC,yBAlBiC,CAACH,EAAOC,KACvC,IACE,OAAOnB,EAAakB,EAAK,OAClBE,GAIP,OAAOF,CAAA","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/@mui/system/colorManipulator.js"],"sourcesContent":["\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.alpha = alpha;\nexports.blend = blend;\nexports.colorChannel = void 0;\nexports.darken = darken;\nexports.decomposeColor = decomposeColor;\nexports.emphasize = emphasize;\nexports.getContrastRatio = getContrastRatio;\nexports.getLuminance = getLuminance;\nexports.hexToRgb = hexToRgb;\nexports.hslToRgb = hslToRgb;\nexports.lighten = lighten;\nexports.private_safeAlpha = private_safeAlpha;\nexports.private_safeColorChannel = void 0;\nexports.private_safeDarken = private_safeDarken;\nexports.private_safeEmphasize = private_safeEmphasize;\nexports.private_safeLighten = private_safeLighten;\nexports.recomposeColor = recomposeColor;\nexports.rgbToHex = rgbToHex;\nvar _formatMuiErrorMessage2 = _interopRequireDefault(require(\"@mui/utils/formatMuiErrorMessage\"));\nvar _clamp = _interopRequireDefault(require(\"@mui/utils/clamp\"));\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/**\n * Returns a number whose value is limited to the given range.\n * @param {number} value The value to be clamped\n * @param {number} min The lower boundary of the output range\n * @param {number} max The upper boundary of the output range\n * @returns {number} A number in the range [min, max]\n */\nfunction clampWrapper(value, min = 0, max = 1) {\n if (process.env.NODE_ENV !== 'production') {\n if (value < min || value > max) {\n console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);\n }\n }\n return (0, _clamp.default)(value, min, max);\n}\n\n/**\n * Converts a color from CSS hex format to CSS rgb format.\n * @param {string} color - Hex color, i.e. #nnn or #nnnnnn\n * @returns {string} A CSS rgb color string\n */\nfunction hexToRgb(color) {\n color = color.slice(1);\n const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, 'g');\n let colors = color.match(re);\n if (colors && colors[0].length === 1) {\n colors = colors.map(n => n + n);\n }\n return colors ? `rgb${colors.length === 4 ? 'a' : ''}(${colors.map((n, index) => {\n return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;\n }).join(', ')})` : '';\n}\nfunction intToHex(int) {\n const hex = int.toString(16);\n return hex.length === 1 ? `0${hex}` : hex;\n}\n\n/**\n * Returns an object with the type and values of a color.\n *\n * Note: Does not support rgb % values.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {object} - A MUI color object: {type: string, values: number[]}\n */\nfunction decomposeColor(color) {\n // Idempotent\n if (color.type) {\n return color;\n }\n if (color.charAt(0) === '#') {\n return decomposeColor(hexToRgb(color));\n }\n const marker = color.indexOf('(');\n const type = color.substring(0, marker);\n if (['rgb', 'rgba', 'hsl', 'hsla', 'color'].indexOf(type) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: Unsupported \\`${color}\\` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` : (0, _formatMuiErrorMessage2.default)(9, color));\n }\n let values = color.substring(marker + 1, color.length - 1);\n let colorSpace;\n if (type === 'color') {\n values = values.split(' ');\n colorSpace = values.shift();\n if (values.length === 4 && values[3].charAt(0) === '/') {\n values[3] = values[3].slice(1);\n }\n if (['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].indexOf(colorSpace) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: unsupported \\`${colorSpace}\\` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.` : (0, _formatMuiErrorMessage2.default)(10, colorSpace));\n }\n } else {\n values = values.split(',');\n }\n values = values.map(value => parseFloat(value));\n return {\n type,\n values,\n colorSpace\n };\n}\n\n/**\n * Returns a channel created from the input color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {string} - The channel for the color, that can be used in rgba or hsla colors\n */\nconst colorChannel = color => {\n const decomposedColor = decomposeColor(color);\n return decomposedColor.values.slice(0, 3).map((val, idx) => decomposedColor.type.indexOf('hsl') !== -1 && idx !== 0 ? `${val}%` : val).join(' ');\n};\nexports.colorChannel = colorChannel;\nconst private_safeColorChannel = (color, warning) => {\n try {\n return colorChannel(color);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n};\n\n/**\n * Converts a color object with type and values to a string.\n * @param {object} color - Decomposed color\n * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color'\n * @param {array} color.values - [n,n,n] or [n,n,n,n]\n * @returns {string} A CSS color string\n */\nexports.private_safeColorChannel = private_safeColorChannel;\nfunction recomposeColor(color) {\n const {\n type,\n colorSpace\n } = color;\n let {\n values\n } = color;\n if (type.indexOf('rgb') !== -1) {\n // Only convert the first 3 values to int (i.e. not alpha)\n values = values.map((n, i) => i < 3 ? parseInt(n, 10) : n);\n } else if (type.indexOf('hsl') !== -1) {\n values[1] = `${values[1]}%`;\n values[2] = `${values[2]}%`;\n }\n if (type.indexOf('color') !== -1) {\n values = `${colorSpace} ${values.join(' ')}`;\n } else {\n values = `${values.join(', ')}`;\n }\n return `${type}(${values})`;\n}\n\n/**\n * Converts a color from CSS rgb format to CSS hex format.\n * @param {string} color - RGB color, i.e. rgb(n, n, n)\n * @returns {string} A CSS rgb color string, i.e. #nnnnnn\n */\nfunction rgbToHex(color) {\n // Idempotent\n if (color.indexOf('#') === 0) {\n return color;\n }\n const {\n values\n } = decomposeColor(color);\n return `#${values.map((n, i) => intToHex(i === 3 ? Math.round(255 * n) : n)).join('')}`;\n}\n\n/**\n * Converts a color from hsl format to rgb format.\n * @param {string} color - HSL color values\n * @returns {string} rgb color values\n */\nfunction hslToRgb(color) {\n color = decomposeColor(color);\n const {\n values\n } = color;\n const h = values[0];\n const s = values[1] / 100;\n const l = values[2] / 100;\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n let type = 'rgb';\n const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];\n if (color.type === 'hsla') {\n type += 'a';\n rgb.push(values[3]);\n }\n return recomposeColor({\n type,\n values: rgb\n });\n}\n/**\n * The relative brightness of any point in a color space,\n * normalized to 0 for darkest black and 1 for lightest white.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {number} The relative brightness of the color in the range 0 - 1\n */\nfunction getLuminance(color) {\n color = decomposeColor(color);\n let rgb = color.type === 'hsl' || color.type === 'hsla' ? decomposeColor(hslToRgb(color)).values : color.values;\n rgb = rgb.map(val => {\n if (color.type !== 'color') {\n val /= 255; // normalized\n }\n return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;\n });\n\n // Truncate at 3 digits\n return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));\n}\n\n/**\n * Calculates the contrast ratio between two colors.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} A contrast ratio value in the range 0 - 21.\n */\nfunction getContrastRatio(foreground, background) {\n const lumA = getLuminance(foreground);\n const lumB = getLuminance(background);\n return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);\n}\n\n/**\n * Sets the absolute transparency of a color.\n * Any existing alpha values are overwritten.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} value - value to set the alpha channel to in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction alpha(color, value) {\n color = decomposeColor(color);\n value = clampWrapper(value);\n if (color.type === 'rgb' || color.type === 'hsl') {\n color.type += 'a';\n }\n if (color.type === 'color') {\n color.values[3] = `/${value}`;\n } else {\n color.values[3] = value;\n }\n return recomposeColor(color);\n}\nfunction private_safeAlpha(color, value, warning) {\n try {\n return alpha(color, value);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darkens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction darken(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] *= 1 - coefficient;\n } else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] *= 1 - coefficient;\n }\n }\n return recomposeColor(color);\n}\nfunction private_safeDarken(color, coefficient, warning) {\n try {\n return darken(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Lightens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction lighten(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] += (100 - color.values[2]) * coefficient;\n } else if (color.type.indexOf('rgb') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (255 - color.values[i]) * coefficient;\n }\n } else if (color.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (1 - color.values[i]) * coefficient;\n }\n }\n return recomposeColor(color);\n}\nfunction private_safeLighten(color, coefficient, warning) {\n try {\n return lighten(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darken or lighten a color, depending on its luminance.\n * Light colors are darkened, dark colors are lightened.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient=0.15 - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction emphasize(color, coefficient = 0.15) {\n return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);\n}\nfunction private_safeEmphasize(color, coefficient, warning) {\n try {\n return emphasize(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Blend a transparent overlay color with a background color, resulting in a single\n * RGB color.\n * @param {string} background - CSS color\n * @param {string} overlay - CSS color\n * @param {number} opacity - Opacity multiplier in the range 0 - 1\n * @param {number} [gamma=1.0] - Gamma correction factor. For gamma-correct blending, 2.2 is usual.\n */\nfunction blend(background, overlay, opacity, gamma = 1.0) {\n const blendChannel = (b, o) => Math.round((b ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);\n const backgroundColor = decomposeColor(background);\n const overlayColor = decomposeColor(overlay);\n const rgb = [blendChannel(backgroundColor.values[0], overlayColor.values[0]), blendChannel(backgroundColor.values[1], overlayColor.values[1]), blendChannel(backgroundColor.values[2], overlayColor.values[2])];\n return recomposeColor({\n type: 'rgb',\n values: rgb\n });\n}"],"names":["_interopRequireDefault","require$$0","Object","defineProperty","colorManipulator","value","alpha_1","alpha","blend","background","overlay","opacity","gamma","blendChannel","b","o","Math","round","backgroundColor","decomposeColor","overlayColor","recomposeColor","type","values","colorChannel","darken_1","darken","emphasize_1","emphasize","getContrastRatio_1","getContrastRatio","foreground","lumA","getLuminance","lumB","max","min","hexToRgb","hslToRgb","lighten_1","lighten","private_safeAlpha","color","warning","error","private_safeColorChannel","private_safeDarken","coefficient","private_safeEmphasize","private_safeLighten","rgbToHex","indexOf","map","n","i","int","hex","toString","length","intToHex","join","_formatMuiErrorMessage2","require$$1","_clamp","require$$2","clampWrapper","default","slice","re","RegExp","colors","match","index","parseInt","charAt","marker","substring","Error","define_process_env_default","NODE_ENV","colorSpace","split","shift","parseFloat","decomposedColor","val","idx","h","s","l","a","f","k","rgb","push","Number","toFixed"],"mappings":"yTAEIA,EAAyBC,EAAAA,6BAC7BC,OAAOC,eAAeC,EAAAA,UAAS,aAAc,CAC3CC,OAAO,IAET,IAAAC,EAAAF,EAAAA,UAAAG,MAAgBA,EAChBH,EAAAA,UAAAI,MAmWA,SAAeC,EAAYC,EAASC,EAASC,EAAQ,GACnD,MAAMC,EAAe,CAACC,EAAGC,IAAMC,KAAKC,OAAOH,IAAM,EAAIF,IAAU,EAAID,GAAWI,IAAM,EAAIH,GAASD,IAAYC,GACvGM,EAAkBC,EAAeV,GACjCW,EAAeD,EAAeT,GAEpC,OAAOW,EAAe,CACpBC,KAAM,MACNC,OAHU,CAACV,EAAaK,EAAgBK,OAAO,GAAIH,EAAaG,OAAO,IAAKV,EAAaK,EAAgBK,OAAO,GAAIH,EAAaG,OAAO,IAAKV,EAAaK,EAAgBK,OAAO,GAAIH,EAAaG,OAAO,MAK7M,EA3WAnB,EAAAA,UAAAoB,kBAAuB,EACvB,IAAAC,EAAArB,EAAAA,UAAAs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,IAAM,EAAIwB,OAAA,IACgB,IAA9BL,EAAMpB,KAAK6B,QAAQ,SAAiD,IAAhCT,EAAMpB,KAAK6B,QAAQ,SAChE,IAAA,IAASG,EAAI,EAAGA,EAAI,EAAGA,GAAK,EAC1BZ,EAAMnB,OAAO+B,IAAM,EAAIP,EAG3B,OAAO1B,EAAeqB,EACxB,CAkBA,SAASF,EAAQE,EAAOK,GAGtB,GAFAL,EAAQvB,EAAeuB,GACvBK,EAAckB,EAAalB,IACO,IAA9BL,EAAMpB,KAAK6B,QAAQ,OACrBT,EAAMnB,OAAO,KAAO,IAAMmB,EAAMnB,OAAO,IAAMwB,WACN,IAA9BL,EAAMpB,KAAK6B,QAAQ,OAC5B,IAAA,IAASG,EAAI,EAAGA,EAAI,EAAGA,GAAK,EAC1BZ,EAAMnB,OAAO+B,KAAO,IAAMZ,EAAMnB,OAAO+B,IAAMP,WAEN,IAAhCL,EAAMpB,KAAK6B,QAAQ,SAC5B,IAAA,IAASG,EAAI,EAAGA,EAAI,EAAGA,GAAK,EAC1BZ,EAAMnB,OAAO+B,KAAO,EAAIZ,EAAMnB,OAAO+B,IAAMP,EAG/C,OAAO1B,EAAeqB,EACxB,CAmBA,SAASd,EAAUc,EAAOK,EAAc,KACtC,OAAOd,EAAaS,GAAS,GAAMhB,EAAOgB,EAAOK,GAAeP,EAAQE,EAAOK,EACjF,CA/NA3C,EAAAA,UAAAoB,aAAuBA,EAmBvBpB,EAAAA,UAAAyC,yBAlBiC,CAACH,EAAOC,KACvC,IACE,OAAOnB,EAAakB,EAAK,OAClBE,GAIP,OAAOF,CAAA","x_google_ignoreList":[0]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { __exports as createStyled$1 } from "../../../../_virtual/createStyled/index.esm.js";
|
|
2
2
|
import { __require as require_extends } from "../../../@babel/runtime/helpers/extends/index.esm.js";
|
|
3
3
|
import { __require as requireObjectWithoutPropertiesLoose } from "../../../@babel/runtime/helpers/objectWithoutPropertiesLoose/index.esm.js";
|
|
4
|
-
import require$$1 from "../../../../_virtual/index/index.
|
|
5
|
-
import require$$4 from "../../../../_virtual/index/index.
|
|
6
|
-
import require$$5 from "../../../../_virtual/index/index.
|
|
7
|
-
import require$$6 from "../../../../_virtual/index/index.
|
|
8
|
-
import require$$7 from "../../../../_virtual/index/index.
|
|
9
|
-
import require$$8 from "../../../../_virtual/index/index.
|
|
4
|
+
import require$$1 from "../../../../_virtual/index/index.esm6.js";
|
|
5
|
+
import require$$4 from "../../../../_virtual/index/index.esm7.js";
|
|
6
|
+
import require$$5 from "../../../../_virtual/index/index.esm8.js";
|
|
7
|
+
import require$$6 from "../../../../_virtual/index/index.esm9.js";
|
|
8
|
+
import require$$7 from "../../../../_virtual/index/index.esm10.js";
|
|
9
|
+
import require$$8 from "../../../../_virtual/index/index.esm11.js";
|
|
10
10
|
import { i as interopRequireDefaultExports } from "../../../@babel/runtime/helpers/interopRequireDefault/index.esm.js";
|
|
11
11
|
var define_process_env_default = {};
|
|
12
12
|
var _interopRequireDefault = interopRequireDefaultExports;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/createStyled/index.js"),t=require("../../../@babel/runtime/helpers/extends/index.js"),r=require("../../../@babel/runtime/helpers/objectWithoutPropertiesLoose/index.js"),o=require("../../../../_virtual/index/
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/createStyled/index.js"),t=require("../../../@babel/runtime/helpers/extends/index.js"),r=require("../../../@babel/runtime/helpers/objectWithoutPropertiesLoose/index.js"),o=require("../../../../_virtual/index/index6.js"),n=require("../../../../_virtual/index/index7.js"),s=require("../../../../_virtual/index/index8.js"),a=require("../../../../_virtual/index/index9.js"),i=require("../../../../_virtual/index/index10.js"),u=require("../../../../_virtual/index/index11.js"),l=require("../../../@babel/runtime/helpers/interopRequireDefault/index.js"),d={},f=l.interopRequireDefaultExports;Object.defineProperty(e.__exports,"__esModule",{value:!0});var p=e.__exports.default=function(e={}){const{themeId:t,defaultTheme:r=g,rootShouldForwardProp:o=q,slotShouldForwardProp:n=q}=e,s=e=>(0,j.default)((0,c.default)({},e,{theme:k((0,c.default)({},e,{defaultTheme:r,themeId:t}))}));return s.__mui_systemSx=!0,(e,a={})=>{(0,y.internal_processStyles)(e,e=>e.filter(e=>!(null!=e&&e.__mui_systemSx)));const{name:i,slot:u,skipVariantsResolver:l,skipSx:f,overridesResolver:p=R(A(u))}=a,x=(0,m.default)(a,S),j=i&&i.startsWith("Mui")||u?"components":"custom",w=void 0!==l?l:u&&"Root"!==u&&"root"!==u||!1,b=f||!1;let O;"production"!==d.NODE_ENV&&i&&(O=`${i}-${A(u||"Root")}`);let P=q;"Root"===u||"root"===u?P=o:u?P=n:function(e){return"string"==typeof e&&e.charCodeAt(0)>96}(e)&&(P=void 0);const g=(0,y.default)(e,(0,c.default)({shouldForwardProp:P,label:O},x)),D=e=>"function"==typeof e&&e.__emotion_real!==e||(0,h.isPlainObject)(e)?o=>{const n=k({theme:o.theme,defaultTheme:r,themeId:t});return C(e,(0,c.default)({},o,{theme:n}),n.modularCssLayers?j:void 0)}:e,E=(o,...n)=>{let a=D(o);const l=n?n.map(D):[];i&&p&&l.push(e=>{const o=k((0,c.default)({},e,{defaultTheme:r,themeId:t}));if(!o.components||!o.components[i]||!o.components[i].styleOverrides)return null;const n=o.components[i].styleOverrides,s={};return Object.entries(n).forEach(([t,r])=>{s[t]=C(r,(0,c.default)({},e,{theme:o}),o.modularCssLayers?"theme":void 0)}),p(e,s)}),i&&!w&&l.push(e=>{var o;const n=k((0,c.default)({},e,{defaultTheme:r,themeId:t}));return C({variants:null==n||null==(o=n.components)||null==(o=o[i])?void 0:o.variants},(0,c.default)({},e,{theme:n}),n.modularCssLayers?"theme":void 0)}),b||l.push(s);const f=l.length-n.length;if(Array.isArray(o)&&f>0){const e=new Array(f).fill("");a=[...o,...e],a.raw=[...o.raw,...e]}const m=g(a,...l);if("production"!==d.NODE_ENV){let t;i&&(t=`${i}${(0,_.default)(u||"")}`),void 0===t&&(t=`Styled(${(0,v.default)(e)})`),m.displayName=t}return e.muiName&&(m.muiName=e.muiName),m};return g.withConfig&&(E.withConfig=g.withConfig),E}};e.__exports.shouldForwardProp=q,e.__exports.systemDefaultTheme=void 0;var c=f(t.__require()),m=f(r.__require()),y=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=O(void 0);if(t&&t.has(e))return t.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var s=o?Object.getOwnPropertyDescriptor(e,n):null;s&&(s.get||s.set)?Object.defineProperty(r,n,s):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}(o.default),h=n.default,_=f(s.default),v=f(a.default),x=f(i.default),j=f(u.default);const w=["ownerState"],b=["variants"],S=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function O(e){if("function"!=typeof WeakMap)return null;var t=/* @__PURE__ */new WeakMap,r=/* @__PURE__ */new WeakMap;return(O=function(e){return e?r:t})(e)}function q(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}function P(e,t){return t&&e&&"object"==typeof e&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}const g=e.__exports.systemDefaultTheme=(0,x.default)(),A=e=>e?e.charAt(0).toLowerCase()+e.slice(1):e;function k({defaultTheme:e,theme:t,themeId:r}){return o=t,0===Object.keys(o).length?e:t[r]||t;var o}function R(e){return e?(t,r)=>r[e]:null}function C(e,t,r){let{ownerState:o}=t,n=(0,m.default)(t,w);const s="function"==typeof e?e((0,c.default)({ownerState:o},n)):e;if(Array.isArray(s))return s.flatMap(e=>C(e,(0,c.default)({ownerState:o},n),r));if(s&&"object"==typeof s&&Array.isArray(s.variants)){const{variants:e=[]}=s;let t=(0,m.default)(s,b);return e.forEach(e=>{let s=!0;if("function"==typeof e.props?s=e.props((0,c.default)({ownerState:o},n,o)):Object.keys(e.props).forEach(t=>{(null==o?void 0:o[t])!==e.props[t]&&n[t]!==e.props[t]&&(s=!1)}),s){Array.isArray(t)||(t=[t]);const s="function"==typeof e.style?e.style((0,c.default)({ownerState:o},n,o)):e.style;t.push(r?P((0,y.internal_serializeStyles)(s),r):s)}}),t}return r?P((0,y.internal_serializeStyles)(s),r):s}exports.default=p;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|