@edx/frontend-app-subscription-checkout 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/LICENSE +661 -0
  2. package/README.rst +235 -0
  3. package/dist/Main.d.ts +3 -0
  4. package/dist/Main.js +15 -0
  5. package/dist/Main.js.map +1 -0
  6. package/dist/app.d.ts +3 -0
  7. package/dist/app.js +13 -0
  8. package/dist/app.js.map +1 -0
  9. package/dist/checkoutPage/CheckoutPage.d.ts +3 -0
  10. package/dist/checkoutPage/CheckoutPage.js +30 -0
  11. package/dist/checkoutPage/CheckoutPage.js.map +1 -0
  12. package/dist/components/BrandMarks/BrandMarks.d.ts +3 -0
  13. package/dist/components/BrandMarks/BrandMarks.js +9 -0
  14. package/dist/components/BrandMarks/BrandMarks.js.map +1 -0
  15. package/dist/components/CartSummary/CartSummary.d.ts +21 -0
  16. package/dist/components/CartSummary/CartSummary.js +30 -0
  17. package/dist/components/CartSummary/CartSummary.js.map +1 -0
  18. package/dist/components/CartSummary/Messages.d.ts +73 -0
  19. package/dist/components/CartSummary/Messages.js +76 -0
  20. package/dist/components/CartSummary/Messages.js.map +1 -0
  21. package/dist/components/Checkout/Checkout.d.ts +4 -0
  22. package/dist/components/Checkout/Checkout.js +40 -0
  23. package/dist/components/Checkout/Checkout.js.map +1 -0
  24. package/dist/components/CheckoutGate/CheckoutGate.d.ts +7 -0
  25. package/dist/components/CheckoutGate/CheckoutGate.js +35 -0
  26. package/dist/components/CheckoutGate/CheckoutGate.js.map +1 -0
  27. package/dist/components/CourseEnrollmentCard/CourseEnrollmentCard.d.ts +9 -0
  28. package/dist/components/CourseEnrollmentCard/CourseEnrollmentCard.js +31 -0
  29. package/dist/components/CourseEnrollmentCard/CourseEnrollmentCard.js.map +1 -0
  30. package/dist/components/CourseEnrollmentCard/Messages.d.ts +33 -0
  31. package/dist/components/CourseEnrollmentCard/Messages.js +35 -0
  32. package/dist/components/CourseEnrollmentCard/Messages.js.map +1 -0
  33. package/dist/components/EdxUnlimitedBanner/EdxUnlimitedBanner.d.ts +13 -0
  34. package/dist/components/EdxUnlimitedBanner/EdxUnlimitedBanner.js +11 -0
  35. package/dist/components/EdxUnlimitedBanner/EdxUnlimitedBanner.js.map +1 -0
  36. package/dist/components/EnrollmentSummary/EnrollmentSummary.d.ts +15 -0
  37. package/dist/components/EnrollmentSummary/EnrollmentSummary.js +21 -0
  38. package/dist/components/EnrollmentSummary/EnrollmentSummary.js.map +1 -0
  39. package/dist/components/EnrollmentSummary/Messages.d.ts +33 -0
  40. package/dist/components/EnrollmentSummary/Messages.js +35 -0
  41. package/dist/components/EnrollmentSummary/Messages.js.map +1 -0
  42. package/dist/components/PaymentFields/PaymentFields.d.ts +9 -0
  43. package/dist/components/PaymentFields/PaymentFields.js +7 -0
  44. package/dist/components/PaymentFields/PaymentFields.js.map +1 -0
  45. package/dist/components/PaymentForm/Messages.d.ts +88 -0
  46. package/dist/components/PaymentForm/Messages.js +95 -0
  47. package/dist/components/PaymentForm/Messages.js.map +1 -0
  48. package/dist/components/PaymentForm/PaymentForm.d.ts +21 -0
  49. package/dist/components/PaymentForm/PaymentForm.js +69 -0
  50. package/dist/components/PaymentForm/PaymentForm.js.map +1 -0
  51. package/dist/components/StatusScreens/Messages.d.ts +103 -0
  52. package/dist/components/StatusScreens/Messages.js +108 -0
  53. package/dist/components/StatusScreens/Messages.js.map +1 -0
  54. package/dist/components/StatusScreens/StatusScreens.d.ts +23 -0
  55. package/dist/components/StatusScreens/StatusScreens.js +25 -0
  56. package/dist/components/StatusScreens/StatusScreens.js.map +1 -0
  57. package/dist/constants.d.ts +59 -0
  58. package/dist/constants.js +276 -0
  59. package/dist/constants.js.map +1 -0
  60. package/dist/data/hooks/keys.d.ts +14 -0
  61. package/dist/data/hooks/keys.js +15 -0
  62. package/dist/data/hooks/keys.js.map +1 -0
  63. package/dist/data/hooks/useCheckout.d.ts +57 -0
  64. package/dist/data/hooks/useCheckout.js +249 -0
  65. package/dist/data/hooks/useCheckout.js.map +1 -0
  66. package/dist/data/hooks/useCheckoutGate.d.ts +15 -0
  67. package/dist/data/hooks/useCheckoutGate.js +39 -0
  68. package/dist/data/hooks/useCheckoutGate.js.map +1 -0
  69. package/dist/data/hooks/useCheckoutMutations.d.ts +16 -0
  70. package/dist/data/hooks/useCheckoutMutations.js +131 -0
  71. package/dist/data/hooks/useCheckoutMutations.js.map +1 -0
  72. package/dist/data/hooks/useCheckoutQueries.d.ts +30 -0
  73. package/dist/data/hooks/useCheckoutQueries.js +97 -0
  74. package/dist/data/hooks/useCheckoutQueries.js.map +1 -0
  75. package/dist/data/services/subs/urls.d.ts +2 -0
  76. package/dist/data/services/subs/urls.js +4 -0
  77. package/dist/data/services/subs/urls.js.map +1 -0
  78. package/dist/i18n/index.d.ts +1 -0
  79. package/dist/i18n/index.js +2 -0
  80. package/dist/i18n/index.js.map +1 -0
  81. package/dist/index.d.ts +2 -0
  82. package/dist/index.js +3 -0
  83. package/dist/index.js.map +1 -0
  84. package/dist/messages.d.ts +8 -0
  85. package/dist/messages.js +10 -0
  86. package/dist/messages.js.map +1 -0
  87. package/dist/routes.d.ts +18 -0
  88. package/dist/routes.js +67 -0
  89. package/dist/routes.js.map +1 -0
  90. package/dist/slots/ExampleSlot/ExampleSlot.d.ts +3 -0
  91. package/dist/slots/ExampleSlot/ExampleSlot.js +6 -0
  92. package/dist/slots/ExampleSlot/ExampleSlot.js.map +1 -0
  93. package/dist/slots.d.ts +3 -0
  94. package/dist/slots.js +7 -0
  95. package/dist/slots.js.map +1 -0
  96. package/dist/style.scss +14 -0
  97. package/dist/styles/components/brandMarks.scss +54 -0
  98. package/dist/styles/components/cartSummary.scss +18 -0
  99. package/dist/styles/components/checkout.scss +29 -0
  100. package/dist/styles/components/checkoutStepper.scss +9 -0
  101. package/dist/styles/components/courseEnrollmentCard.scss +38 -0
  102. package/dist/styles/components/edxUnlimitedBanner.scss +138 -0
  103. package/dist/styles/components/enrollmentSummary.scss +13 -0
  104. package/dist/styles/components/paymentFields.scss +15 -0
  105. package/dist/styles/components/paymentForm.scss +105 -0
  106. package/dist/styles/components/statusScreens.scss +29 -0
  107. package/dist/styles/components/successScreen.scss +0 -0
  108. package/dist/types.d.ts +222 -0
  109. package/dist/types.js +2 -0
  110. package/dist/types.js.map +1 -0
  111. package/dist/utils/auth.d.ts +7 -0
  112. package/dist/utils/auth.js +28 -0
  113. package/dist/utils/auth.js.map +1 -0
  114. package/dist/utils/billingDetails.d.ts +30 -0
  115. package/dist/utils/billingDetails.js +47 -0
  116. package/dist/utils/billingDetails.js.map +1 -0
  117. package/dist/utils/bootstrapApi.d.ts +20 -0
  118. package/dist/utils/bootstrapApi.js +142 -0
  119. package/dist/utils/bootstrapApi.js.map +1 -0
  120. package/dist/utils/cartApi.d.ts +16 -0
  121. package/dist/utils/cartApi.js +118 -0
  122. package/dist/utils/cartApi.js.map +1 -0
  123. package/dist/utils/checkout.d.ts +6 -0
  124. package/dist/utils/checkout.js +28 -0
  125. package/dist/utils/checkout.js.map +1 -0
  126. package/dist/utils/fetchActiveSubscriptions.d.ts +4 -0
  127. package/dist/utils/fetchActiveSubscriptions.js +36 -0
  128. package/dist/utils/fetchActiveSubscriptions.js.map +1 -0
  129. package/dist/utils/fetchBillingPlans.d.ts +2 -0
  130. package/dist/utils/fetchBillingPlans.js +48 -0
  131. package/dist/utils/fetchBillingPlans.js.map +1 -0
  132. package/dist/utils/graphqlClient.d.ts +16 -0
  133. package/dist/utils/graphqlClient.js +39 -0
  134. package/dist/utils/graphqlClient.js.map +1 -0
  135. package/dist/utils/index.d.ts +3 -0
  136. package/dist/utils/index.js +17 -0
  137. package/dist/utils/index.js.map +1 -0
  138. package/dist/utils/provision.d.ts +25 -0
  139. package/dist/utils/provision.js +95 -0
  140. package/dist/utils/provision.js.map +1 -0
  141. package/dist/utils/queries.d.ts +35 -0
  142. package/dist/utils/queries.js +168 -0
  143. package/dist/utils/queries.js.map +1 -0
  144. package/dist/utils/stripe.d.ts +7 -0
  145. package/dist/utils/stripe.js +43 -0
  146. package/dist/utils/stripe.js.map +1 -0
  147. package/dist/widgets/ExampleHeader/app.d.ts +3 -0
  148. package/dist/widgets/ExampleHeader/app.js +19 -0
  149. package/dist/widgets/ExampleHeader/app.js.map +1 -0
  150. package/dist/widgets/ExampleHeader/index.d.ts +1 -0
  151. package/dist/widgets/ExampleHeader/index.js +2 -0
  152. package/dist/widgets/ExampleHeader/index.js.map +1 -0
  153. package/package.json +85 -0
package/README.rst ADDED
@@ -0,0 +1,235 @@
1
+ frontend-template-application
2
+ #############################
3
+
4
+ |license-badge| |status-badge| |ci-badge|
5
+
6
+ ⚠️ Warning ⚠️
7
+ ***************
8
+
9
+ This template produces a `frontend-base`_ application: a library that plugs
10
+ into the Open edX frontend shell, rather than a standalone micro-frontend
11
+ bundled with its own webpack build. If you are looking for the legacy
12
+ standalone MFE template (pre-``frontend-base``), see `the master branch`_.
13
+
14
+ .. _frontend-base: https://github.com/openedx/frontend-base
15
+ .. _the master branch: https://github.com/openedx/frontend-template-application/tree/master
16
+
17
+ Purpose
18
+ *******
19
+
20
+ This repository is a template for Open edX frontend applications built on
21
+ ``frontend-base``. It is flagged as a Template Repository, meaning it can be
22
+ used as a basis for new GitHub repositories by clicking the green "Use this
23
+ template" button above. The rest of this document describes how to work with
24
+ your new frontend application **after you've created a new repository from
25
+ the template.**
26
+
27
+ Getting Started
28
+ ***************
29
+
30
+ After copying the template repository, you'll want to do a find-and-replace
31
+ to replace all instances of ``frontend-template-application`` with the name
32
+ of your new repository. You should also pick a new ``appId`` and role name
33
+ in ``src/constants.ts``, and a friendly title in ``public/index.html``.
34
+
35
+ Prerequisites
36
+ =============
37
+
38
+ `Tutor`_ is currently recommended as the development environment for your
39
+ new app. You can refer to the `relevant tutor-mfe documentation`_ to get
40
+ started using it.
41
+
42
+ .. _Tutor: https://github.com/overhangio/tutor
43
+
44
+ .. _relevant tutor-mfe documentation: https://github.com/overhangio/tutor-mfe#mfe-development
45
+
46
+ Cloning and Startup
47
+ ===================
48
+
49
+ In the following steps, replace "[PLACEHOLDER]" with the name of the repo
50
+ you created when copying this template above.
51
+
52
+ 1. Clone your new repo:
53
+
54
+ ``git clone https://github.com/openedx/frontend-app-[PLACEHOLDER].git``
55
+
56
+ 2. Use the version of Node specified in the ``.nvmrc`` file.
57
+
58
+ Using other major versions of Node *may* work, but is unsupported. This
59
+ repository includes an ``.nvmrc`` file to help set the correct Node
60
+ version via `nvm <https://github.com/nvm-sh/nvm>`_.
61
+
62
+ 3. Install npm dependencies:
63
+
64
+ ``cd frontend-app-[PLACEHOLDER] && npm install``
65
+
66
+ 4. (Optional) Update the port and public path used for local development by
67
+ editing the ``dev`` script in ``package.json``. The default is
68
+ ``PORT=8080 PUBLIC_PATH=/template``.
69
+
70
+ 5. Start the dev server:
71
+
72
+ ``npm run dev``
73
+
74
+ The dev server will be available at
75
+ `http://apps.local.openedx.io:8080 <http://apps.local.openedx.io:8080>`_
76
+ (or whatever port you configured), under the public path you configured.
77
+
78
+ Local Development Against frontend-base
79
+ =======================================
80
+
81
+ To develop your app and a local checkout of ``frontend-base`` in tandem, use
82
+ the built-in npm workspace support:
83
+
84
+ .. code-block:: sh
85
+
86
+ mkdir -p packages/frontend-base
87
+ sudo mount --bind /path/to/frontend-base packages/frontend-base
88
+ npm install
89
+ npm run dev:packages
90
+
91
+ Bind mounts are used instead of symlinks because Node resolves symlinks to
92
+ their real paths, which breaks hoisted dependency resolution. When you are
93
+ done, unmount with ``sudo umount packages/frontend-base``.
94
+
95
+ Making Your New Project's README File
96
+ =====================================
97
+
98
+ Move ``README-template-frontend-app.rst`` to your project's ``README.rst``
99
+ file. Please fill out all the sections - this helps other developers
100
+ understand your app, how to install it, and how to use it.
101
+
102
+ Developing
103
+ **********
104
+
105
+ This section concerns development of ``frontend-template-application``
106
+ itself, not the templated copy.
107
+
108
+ One of the goals of this repository is for it to function correctly as a
109
+ frontend-base application (``npm install && npm run dev``) even if no
110
+ modifications are made. This ensures that developers get a *practical*
111
+ working example, not just a theoretical one.
112
+
113
+ This also means, of course, that any committed code should be tested and
114
+ subject to both CI and branch protection rules.
115
+
116
+ Project Structure
117
+ =================
118
+
119
+ The layout follows the standard `frontend-base app layout`_:
120
+
121
+ - ``src/app.ts`` - the app configuration imported by ``site.config.*.tsx``
122
+ - ``src/constants.ts`` - the app's ``appId`` and role identifiers
123
+ - ``src/index.ts`` - the package's public exports (this is a library)
124
+ - ``src/routes.tsx`` - the app's react-router routes
125
+ - ``src/Main.tsx`` - the root component for the app's routes
126
+ - ``src/slots.tsx`` - the slot operations the app applies to the shell
127
+ - ``src/slots/`` - the slots this app offers to consumers
128
+ - ``src/style.scss`` - app-scoped runtime styles
129
+
130
+ For more, see the `frontend-base migration how-to`_.
131
+
132
+ .. _frontend-base app layout: https://github.com/openedx/frontend-base/blob/main/docs/how_tos/migrate-frontend-app.md#src-file-structure
133
+ .. _frontend-base migration how-to: https://github.com/openedx/frontend-base/blob/main/docs/how_tos/migrate-frontend-app.md
134
+
135
+ Build Process Notes
136
+ ===================
137
+
138
+ **Library build**
139
+
140
+ ``npm run build`` compiles the library into ``dist/`` via ``tsc`` and
141
+ ``tsc-alias``. This is what gets published and consumed by sites.
142
+
143
+ **CI build**
144
+
145
+ ``npm run build:ci`` runs ``openedx build`` against ``site.config.ci.tsx``
146
+ so webpack traverses the full app graph. This catches issues (like broken
147
+ lazy-loaded imports) that ``tsc`` and Jest would not surface.
148
+
149
+ Internationalization
150
+ ====================
151
+
152
+ Please refer to the `frontend-base i18n howto`_ for documentation on
153
+ internationalization.
154
+
155
+ .. _frontend-base i18n howto: https://github.com/openedx/frontend-base/blob/main/docs/how_tos/i18n.rst
156
+
157
+ Getting Help
158
+ ************
159
+
160
+ If you're having trouble, we have discussion forums at
161
+ https://discuss.openedx.org where you can connect with others in the
162
+ community.
163
+
164
+ Our real-time conversations are on Slack. You can request a `Slack
165
+ invitation`_, then join our `community Slack workspace`_. Because this is a
166
+ frontend repository, the best place to discuss it would be in the
167
+ `#wg-frontend channel`_.
168
+
169
+ For anything non-trivial, the best path is to open an issue in this
170
+ repository with as many details about the issue you are facing as you can
171
+ provide.
172
+
173
+ https://github.com/openedx/frontend-template-application/issues
174
+
175
+ For more information about these options, see the `Getting Help`_ page.
176
+
177
+ .. _Slack invitation: https://openedx.org/slack
178
+ .. _community Slack workspace: https://openedx.slack.com/
179
+ .. _#wg-frontend channel: https://openedx.slack.com/archives/C04BM6YC7A6
180
+ .. _Getting Help: https://openedx.org/getting-help
181
+
182
+ License
183
+ *******
184
+
185
+ The code in this repository is licensed under the AGPLv3 unless otherwise
186
+ noted.
187
+
188
+ Please see `LICENSE <LICENSE>`_ for details.
189
+
190
+ Contributing
191
+ ************
192
+
193
+ Contributions are very welcome. Please read `How To Contribute`_ for details.
194
+
195
+ .. _How To Contribute: https://openedx.org/r/how-to-contribute
196
+
197
+ This project is currently accepting all types of contributions, bug fixes,
198
+ security fixes, maintenance work, or new features. However, please make
199
+ sure to have a discussion about your new feature idea with the maintainers
200
+ prior to beginning development to maximize the chances of your change being
201
+ accepted. You can start a conversation by creating a new issue on this repo
202
+ summarizing your idea.
203
+
204
+ The Open edX Code of Conduct
205
+ ****************************
206
+
207
+ All community members are expected to follow the `Open edX Code of
208
+ Conduct`_.
209
+
210
+ .. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/
211
+
212
+ People
213
+ ******
214
+
215
+ The assigned maintainers for this component and other project details may
216
+ be found in `Backstage`_. Backstage pulls this data from the
217
+ ``catalog-info.yaml`` file in this repo.
218
+
219
+ .. _Backstage: https://open-edx-backstage.herokuapp.com/catalog/default/component/frontend-template-application
220
+
221
+ Reporting Security Issues
222
+ *************************
223
+
224
+ Please do not report security issues in public, and email
225
+ security@openedx.org instead.
226
+
227
+ .. |license-badge| image:: https://img.shields.io/github/license/openedx/frontend-template-application.svg
228
+ :target: https://github.com/openedx/frontend-template-application/blob/main/LICENSE
229
+ :alt: License
230
+
231
+ .. |status-badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen
232
+
233
+ .. |ci-badge| image:: https://github.com/openedx/frontend-template-application/actions/workflows/ci.yml/badge.svg
234
+ :target: https://github.com/openedx/frontend-template-application/actions/workflows/ci.yml
235
+ :alt: Continuous Integration
package/dist/Main.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import './style.scss';
2
+ declare const Main: () => import("react/jsx-runtime").JSX.Element;
3
+ export default Main;
package/dist/Main.js ADDED
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CurrentAppProvider, getSiteConfig, useIntl, } from '@openedx/frontend-base';
3
+ import { Helmet } from 'react-helmet';
4
+ import { Outlet } from 'react-router-dom';
5
+ import { appId } from './constants';
6
+ import messages from './messages';
7
+ import './style.scss';
8
+ const Main = () => {
9
+ const { formatMessage } = useIntl();
10
+ return (_jsxs(CurrentAppProvider, { appId: appId, children: [_jsx(Helmet, { children: _jsx("title", { children: formatMessage(messages['template.page.title'], {
11
+ siteName: getSiteConfig().siteName,
12
+ }) }) }), _jsx("main", { className: "d-flex flex-column flex-grow-1", children: _jsx(Outlet, {}) })] }));
13
+ };
14
+ export default Main;
15
+ //# sourceMappingURL=Main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Main.js","sourceRoot":"","sources":["../src/Main.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,OAAO,GACR,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,cAAc,CAAC;AAEtB,MAAM,IAAI,GAAG,GAAG,EAAE;IAChB,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,OAAO,CACL,MAAC,kBAAkB,IAAC,KAAK,EAAE,KAAK,aAC9B,KAAC,MAAM,cACL,0BACG,aAAa,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE;wBAC9C,QAAQ,EAAE,aAAa,EAAE,CAAC,QAAQ;qBACnC,CAAC,GACI,GACD,EACT,eAAM,SAAS,EAAC,gCAAgC,YAC9C,KAAC,MAAM,KAAG,GACL,IACY,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import {\n CurrentAppProvider,\n getSiteConfig,\n useIntl,\n} from '@openedx/frontend-base';\nimport { Helmet } from 'react-helmet';\nimport { Outlet } from 'react-router-dom';\nimport { appId } from './constants';\nimport messages from './messages';\n\nimport './style.scss';\n\nconst Main = () => {\n const { formatMessage } = useIntl();\n return (\n <CurrentAppProvider appId={appId}>\n <Helmet>\n <title>\n {formatMessage(messages['template.page.title'], {\n siteName: getSiteConfig().siteName,\n })}\n </title>\n </Helmet>\n <main className=\"d-flex flex-column flex-grow-1\">\n <Outlet />\n </main>\n </CurrentAppProvider>\n );\n};\n\nexport default Main;\n"]}
package/dist/app.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { App } from '@openedx/frontend-base';
2
+ declare const app: App;
3
+ export default app;
package/dist/app.js ADDED
@@ -0,0 +1,13 @@
1
+ import { appId } from './constants';
2
+ import routes from './routes';
3
+ import slots from './slots';
4
+ const app = {
5
+ appId,
6
+ routes,
7
+ slots,
8
+ // Environment-specific values (STRIPE_PUBLIC_KEY, VIAX_API_URL) are supplied
9
+ // by site.config.{dev,stage,prod}.tsx at site build time.
10
+ config: {},
11
+ };
12
+ export default app;
13
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,KAAK,MAAM,YAAY,CAAC;AAE/B,MAAM,GAAG,GAAQ;IACf,KAAK;IACL,MAAM;IACN,KAAK;IACL,6EAA6E;IAC7E,0DAA0D;IAC1D,MAAM,EAAE,EAAE;CACX,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { App } from '@openedx/frontend-base';\nimport { appId } from '@src/constants';\nimport routes from '@src/routes';\nimport slots from '@src/slots';\n\nconst app: App = {\n appId,\n routes,\n slots,\n // Environment-specific values (STRIPE_PUBLIC_KEY, VIAX_API_URL) are supplied\n // by site.config.{dev,stage,prod}.tsx at site build time.\n config: {},\n};\n\nexport default app;\n"]}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const CheckoutPage: React.FC;
3
+ export default CheckoutPage;
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Alert, Container } from '@openedx/paragon';
3
+ import { getAppConfig, getSiteConfig } from '@openedx/frontend-base';
4
+ import { appId } from '../constants';
5
+ import CheckoutGate from '../components/CheckoutGate/CheckoutGate';
6
+ const PageWrapper = ({ children }) => (_jsx(Container, { children: children }));
7
+ const CheckoutPage = () => {
8
+ const config = getAppConfig(appId);
9
+ const siteConfig = getSiteConfig();
10
+ const LMS_BASE_URL = siteConfig.lmsBaseUrl.replace(/\/$/, '');
11
+ const stripePublishableKey = config.STRIPE_PUBLIC_KEY;
12
+ const apiUrl = config.VIAX_API_URL;
13
+ const isDevelopment = siteConfig.environment === 'development';
14
+ const edxSessionUrl = `${isDevelopment ? 'https://courses.stage.edx.org' : LMS_BASE_URL}/api/edx-session`;
15
+ console.log('siteConfig ===> ', siteConfig);
16
+ console.log('config ====> ', config);
17
+ console.log('stripePublishableKey ===> ', stripePublishableKey);
18
+ console.log('apiURL ==> ', apiUrl);
19
+ console.log('edxSessionUrl ===> ', edxSessionUrl);
20
+ if (!stripePublishableKey || !apiUrl || !edxSessionUrl) {
21
+ return (_jsx(PageWrapper, { children: _jsxs(Alert, { variant: "danger", children: ["We're having trouble loading the checkout. Please refresh the page or try again in a few moments. If the problem persists,", ' ', _jsx("a", { href: "https://courses.edx.org/support/contact_us", children: "contact support" }), "."] }) }));
22
+ }
23
+ return (_jsx(PageWrapper, { children: _jsx(CheckoutGate, { stripePublishableKey: stripePublishableKey, apiUrl: apiUrl, edxSessionUrl: edxSessionUrl, learnerDashboardUrl: `${LMS_BASE_URL}/dashboard`, onComplete: (_subscriptionBiId) => {
24
+ console.log(_subscriptionBiId);
25
+ // window.location.href = `/checkout/confirmation?sub=${_subscriptionBiId ?? ''}`;
26
+ // Success screen.
27
+ } }) }));
28
+ };
29
+ export default CheckoutPage;
30
+ //# sourceMappingURL=CheckoutPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckoutPage.js","sourceRoot":"","sources":["../../src/checkoutPage/CheckoutPage.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,YAAY,MAAM,yCAAyC,CAAC;AAEnE,MAAM,WAAW,GAA4C,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAC7E,KAAC,SAAS,cAAE,QAAQ,GAAa,CAClC,CAAC;AAEF,MAAM,YAAY,GAAa,GAAG,EAAE;IAClC,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACnC,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,MAAM,YAAY,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC9D,MAAM,oBAAoB,GAAG,MAAM,CAAC,iBAA2B,CAAC;IAChE,MAAM,MAAM,GAAG,MAAM,CAAC,YAAsB,CAAC;IAC7C,MAAM,aAAa,GAAG,UAAU,CAAC,WAAW,KAAK,aAAa,CAAC;IAC/D,MAAM,aAAa,GAAG,GAAG,aAAa,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,YAAY,kBAAkB,CAAC;IAE1G,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;IAC5C,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,oBAAoB,CAAC,CAAC;IAChE,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,aAAa,CAAC,CAAC;IAElD,IAAI,CAAC,oBAAoB,IAAI,CAAC,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QACvD,OAAO,CACL,KAAC,WAAW,cACV,MAAC,KAAK,IAAC,OAAO,EAAC,QAAQ,2IAEwC,GAAG,EAChE,YAAG,IAAI,EAAC,4CAA4C,gCAEhD,SAEE,GACI,CACf,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAC,WAAW,cACV,KAAC,YAAY,IACX,oBAAoB,EAAE,oBAAoB,EAC1C,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,GAAG,YAAY,YAAY,EAChD,UAAU,EAAE,CAAC,iBAAiB,EAAE,EAAE;gBAChC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;gBAC/B,kFAAkF;gBAClF,kBAAkB;YACpB,CAAC,GACD,GACU,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import React from 'react';\nimport { Alert, Container } from '@openedx/paragon';\nimport { getAppConfig, getSiteConfig } from '@openedx/frontend-base';\nimport { appId } from '@src/constants';\nimport CheckoutGate from '../components/CheckoutGate/CheckoutGate';\n\nconst PageWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => (\n <Container>{children}</Container>\n);\n\nconst CheckoutPage: React.FC = () => {\n const config = getAppConfig(appId);\n const siteConfig = getSiteConfig();\n const LMS_BASE_URL = siteConfig.lmsBaseUrl.replace(/\\/$/, '');\n const stripePublishableKey = config.STRIPE_PUBLIC_KEY as string;\n const apiUrl = config.VIAX_API_URL as string;\n const isDevelopment = siteConfig.environment === 'development';\n const edxSessionUrl = `${isDevelopment ? 'https://courses.stage.edx.org' : LMS_BASE_URL}/api/edx-session`;\n\n console.log('siteConfig ===> ', siteConfig);\n console.log('config ====> ', config);\n console.log('stripePublishableKey ===> ', stripePublishableKey);\n console.log('apiURL ==> ', apiUrl);\n console.log('edxSessionUrl ===> ', edxSessionUrl);\n\n if (!stripePublishableKey || !apiUrl || !edxSessionUrl) {\n return (\n <PageWrapper>\n <Alert variant=\"danger\">\n We&apos;re having trouble loading the checkout. Please refresh the\n page or try again in a few moments. If the problem persists,{' '}\n <a href=\"https://courses.edx.org/support/contact_us\">\n contact support\n </a>\n .\n </Alert>\n </PageWrapper>\n );\n }\n\n return (\n <PageWrapper>\n <CheckoutGate\n stripePublishableKey={stripePublishableKey}\n apiUrl={apiUrl}\n edxSessionUrl={edxSessionUrl}\n learnerDashboardUrl={`${LMS_BASE_URL}/dashboard`}\n onComplete={(_subscriptionBiId) => {\n console.log(_subscriptionBiId);\n // window.location.href = `/checkout/confirmation?sub=${_subscriptionBiId ?? ''}`;\n // Success screen.\n }}\n />\n </PageWrapper>\n );\n};\n\nexport default CheckoutPage;\n"]}
@@ -0,0 +1,3 @@
1
+ export declare const CardBrands: () => import("react/jsx-runtime").JSX.Element;
2
+ export declare const PayPalWordmark: () => import("react/jsx-runtime").JSX.Element;
3
+ export declare const EdxUnlimitedLogo: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const Visa = () => (_jsxs("svg", { width: "34", height: "22", viewBox: "0 0 34 22", role: "img", "aria-label": "Visa", children: [_jsx("rect", { width: "34", height: "22", rx: "3", fill: "#1A1F71" }), _jsx("text", { x: "17", y: "15", textAnchor: "middle", fontFamily: "Arial, sans-serif", fontWeight: "700", fontStyle: "italic", fontSize: "10", fill: "#fff", children: "VISA" })] }));
3
+ const Mastercard = () => (_jsxs("svg", { width: "34", height: "22", viewBox: "0 0 34 22", role: "img", "aria-label": "Mastercard", children: [_jsx("rect", { width: "34", height: "22", rx: "3", fill: "#fff", stroke: "#E6E6E6" }), _jsx("circle", { cx: "14", cy: "11", r: "6", fill: "#EB001B" }), _jsx("circle", { cx: "20", cy: "11", r: "6", fill: "#F79E1B", fillOpacity: "0.9" })] }));
4
+ const Amex = () => (_jsxs("svg", { width: "34", height: "22", viewBox: "0 0 34 22", role: "img", "aria-label": "American Express", children: [_jsx("rect", { width: "34", height: "22", rx: "3", fill: "#1F72CD" }), _jsx("text", { x: "17", y: "14", textAnchor: "middle", fontFamily: "Arial, sans-serif", fontWeight: "700", fontSize: "6.5", fill: "#fff", children: "AMEX" })] }));
5
+ const Discover = () => (_jsxs("svg", { width: "34", height: "22", viewBox: "0 0 34 22", role: "img", "aria-label": "Discover", children: [_jsx("rect", { width: "34", height: "22", rx: "3", fill: "#fff", stroke: "#E6E6E6" }), _jsx("circle", { cx: "25", cy: "11", r: "4", fill: "#F47216" }), _jsx("text", { x: "13", y: "14", textAnchor: "middle", fontFamily: "Arial, sans-serif", fontWeight: "700", fontSize: "5", fill: "#231F20", children: "DISCVR" })] }));
6
+ export const CardBrands = () => (_jsxs("div", { className: "brand-marks__card-brands", children: [_jsx(Visa, {}), _jsx(Mastercard, {}), _jsx(Amex, {}), _jsx(Discover, {})] }));
7
+ export const PayPalWordmark = () => (_jsxs("span", { className: "brand-marks__paypal", children: [_jsx("span", { className: "brand-marks__paypal-pay", children: "Pay" }), _jsx("span", { className: "brand-marks__paypal-pal", children: "Pal" })] }));
8
+ export const EdxUnlimitedLogo = () => (_jsx("div", { className: "brand-marks__edx-logo", "aria-label": "edX unlimited", children: _jsxs("div", { className: "brand-marks__edx-logo-text", children: [_jsx("div", { className: "brand-marks__edx-logo-edx", children: "edX" }), _jsx("div", { className: "brand-marks__edx-logo-unlimited", children: "unlimited" })] }) }));
9
+ //# sourceMappingURL=BrandMarks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrandMarks.js","sourceRoot":"","sources":["../../../src/components/BrandMarks/BrandMarks.tsx"],"names":[],"mappings":"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","sourcesContent":["import React from 'react';\n\nconst Visa = () => (\n <svg width=\"34\" height=\"22\" viewBox=\"0 0 34 22\" role=\"img\" aria-label=\"Visa\">\n <rect width=\"34\" height=\"22\" rx=\"3\" fill=\"#1A1F71\" />\n <text\n x=\"17\"\n y=\"15\"\n textAnchor=\"middle\"\n fontFamily=\"Arial, sans-serif\"\n fontWeight=\"700\"\n fontStyle=\"italic\"\n fontSize=\"10\"\n fill=\"#fff\"\n >\n VISA\n </text>\n </svg>\n);\n\nconst Mastercard = () => (\n <svg\n width=\"34\"\n height=\"22\"\n viewBox=\"0 0 34 22\"\n role=\"img\"\n aria-label=\"Mastercard\"\n >\n <rect width=\"34\" height=\"22\" rx=\"3\" fill=\"#fff\" stroke=\"#E6E6E6\" />\n <circle cx=\"14\" cy=\"11\" r=\"6\" fill=\"#EB001B\" />\n <circle cx=\"20\" cy=\"11\" r=\"6\" fill=\"#F79E1B\" fillOpacity=\"0.9\" />\n </svg>\n);\n\nconst Amex = () => (\n <svg\n width=\"34\"\n height=\"22\"\n viewBox=\"0 0 34 22\"\n role=\"img\"\n aria-label=\"American Express\"\n >\n <rect width=\"34\" height=\"22\" rx=\"3\" fill=\"#1F72CD\" />\n <text\n x=\"17\"\n y=\"14\"\n textAnchor=\"middle\"\n fontFamily=\"Arial, sans-serif\"\n fontWeight=\"700\"\n fontSize=\"6.5\"\n fill=\"#fff\"\n >\n AMEX\n </text>\n </svg>\n);\n\nconst Discover = () => (\n <svg\n width=\"34\"\n height=\"22\"\n viewBox=\"0 0 34 22\"\n role=\"img\"\n aria-label=\"Discover\"\n >\n <rect width=\"34\" height=\"22\" rx=\"3\" fill=\"#fff\" stroke=\"#E6E6E6\" />\n <circle cx=\"25\" cy=\"11\" r=\"4\" fill=\"#F47216\" />\n <text\n x=\"13\"\n y=\"14\"\n textAnchor=\"middle\"\n fontFamily=\"Arial, sans-serif\"\n fontWeight=\"700\"\n fontSize=\"5\"\n fill=\"#231F20\"\n >\n DISCVR\n </text>\n </svg>\n);\n\nexport const CardBrands = () => (\n <div className=\"brand-marks__card-brands\">\n <Visa />\n <Mastercard />\n <Amex />\n <Discover />\n </div>\n);\n\nexport const PayPalWordmark = () => (\n <span className=\"brand-marks__paypal\">\n <span className=\"brand-marks__paypal-pay\">Pay</span>\n <span className=\"brand-marks__paypal-pal\">Pal</span>\n </span>\n);\n\nexport const EdxUnlimitedLogo = () => (\n <div className=\"brand-marks__edx-logo\" aria-label=\"edX unlimited\">\n <div className=\"brand-marks__edx-logo-text\">\n <div className=\"brand-marks__edx-logo-edx\">edX</div>\n <div className=\"brand-marks__edx-logo-unlimited\">unlimited</div>\n </div>\n </div>\n);\n"]}
@@ -0,0 +1,21 @@
1
+ import type { CourseDetail } from '../../types';
2
+ export type BillingCycle = 'monthly' | 'annual';
3
+ export interface CartSummaryProps {
4
+ productTitle?: string;
5
+ productBlurb?: string;
6
+ /** Monthly price amount e.g. "39" */
7
+ monthlyAmount?: string;
8
+ /** Annual price amount e.g. "299" */
9
+ annualAmount?: string;
10
+ currency?: string;
11
+ activeSubscriberCount?: number | null;
12
+ defaultCycle?: BillingCycle;
13
+ monthlyRenewalLabel?: string;
14
+ annualRenewalLabel?: string;
15
+ onCycleChange?: (cycle: BillingCycle) => void;
16
+ learnerCount?: number;
17
+ /** When set, shows the course enrollment preview card below the summary card. */
18
+ course?: CourseDetail | null;
19
+ }
20
+ declare const CartSummary: ({ productTitle, productBlurb, monthlyAmount, annualAmount, currency, activeSubscriberCount, defaultCycle, onCycleChange, learnerCount: learnerCountProp, course, }: CartSummaryProps) => import("react/jsx-runtime").JSX.Element;
21
+ export default CartSummary;
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Badge, Card, Icon } from '@openedx/paragon';
4
+ import { Group, People, Institution } from '@openedx/paragon/icons';
5
+ import { useIntl } from '@openedx/frontend-base';
6
+ import { EdxUnlimitedLogo } from '../BrandMarks/BrandMarks';
7
+ import CourseEnrollmentCard from '../CourseEnrollmentCard/CourseEnrollmentCard';
8
+ import messages from './Messages';
9
+ const CartSummary = ({ productTitle = 'edX Subscription', productBlurb = 'Subscribe and get access to hundreds of courses and programs.', monthlyAmount = '39', annualAmount = '299', currency = 'USD', activeSubscriberCount, defaultCycle = 'monthly', onCycleChange, learnerCount: learnerCountProp = 2203, course = null, }) => {
10
+ const { formatMessage } = useIntl();
11
+ const [cycle, setCycle] = useState(defaultCycle);
12
+ const isMonthly = cycle === 'monthly';
13
+ const handleToggle = () => {
14
+ const next = isMonthly ? 'annual' : 'monthly';
15
+ setCycle(next);
16
+ onCycleChange === null || onCycleChange === void 0 ? void 0 : onCycleChange(next);
17
+ };
18
+ const frequency = isMonthly ? 'month' : 'year';
19
+ const amount = isMonthly ? monthlyAmount : annualAmount;
20
+ const learnerCount = (activeSubscriberCount != null ? activeSubscriberCount : learnerCountProp).toLocaleString();
21
+ return (_jsxs("div", { className: "cart-summary ", children: [_jsxs(Card, { className: "cart-summary__card p-3", children: [_jsxs(Card.Section, { className: "d-flex justify-content-between align-items-center p-0 pb-3", children: [_jsx("span", { className: "font-weight-bold text-gray-900", children: formatMessage(messages.summaryHeading) }), _jsxs(Badge, { variant: "light", className: "d-flex align-items-center px-2 py-1", children: [_jsx(Icon, { src: Group, className: "mr-1", style: { width: '1rem', height: '1rem' } }), formatMessage(messages.learnersSubscribed, {
22
+ count: learnerCount,
23
+ })] })] }), _jsx(Card.Divider, {}), _jsx(Card.Section, { className: "p-0 py-3", children: _jsxs("div", { className: "d-flex align-items-start", children: [_jsx(EdxUnlimitedLogo, {}), _jsxs("div", { children: [_jsx("p", { className: "font-weight-bold mb-0 text-primary-500", children: productTitle }), _jsx("p", { className: "small mb-0 text-gray-900", children: productBlurb })] })] }) }), _jsx(Card.Divider, {}), _jsxs(Card.Section, { className: "p-0 py-3", children: [_jsxs("div", { className: "d-flex justify-content-between align-items-center mb-1", children: [_jsx("span", { className: "small text-gray-900", children: isMonthly
24
+ ? formatMessage(messages.monthlySubscription)
25
+ : formatMessage(messages.annualSubscription) }), _jsx("span", { className: "text-success font-weight-bold small", children: formatMessage(messages.trialLabel) })] }), _jsxs("div", { className: "d-flex justify-content-between align-items-center", children: [_jsx("button", { type: "button", className: "btn btn-link p-0 small", onClick: handleToggle, children: isMonthly
26
+ ? formatMessage(messages.switchToAnnual)
27
+ : formatMessage(messages.switchToMonthly) }), _jsxs("span", { className: "small text-gray-900 font-weight-bold", children: ["$", amount, "/", frequency, " ", currency] })] })] }), _jsxs(Card.Section, { className: "d-flex justify-content-between align-items-center px-0", children: [_jsx("span", { className: "font-weight-bold text-gray-900", children: formatMessage(messages.todaysTotal) }), _jsx("span", { className: "font-weight-bold mb-0 text-gray-900", children: formatMessage(messages.todaysTotalValue) })] })] }), course && (_jsx(CourseEnrollmentCard, { course: course, variant: "checkout" })), _jsxs("div", { className: "cart-summary__stats d-none d-lg-flex mt-3", children: [_jsxs("div", { className: "cart-summary__stat d-flex align-items-center mr-4", children: [_jsx(Icon, { src: People, className: "mr-2 text-muted", style: { width: '1.5rem', height: '1.5rem' } }), _jsxs("div", { children: [_jsx("p", { className: "font-weight-bold mb-0", children: formatMessage(messages.learnersCount) }), _jsx("p", { className: "text-muted small mb-0", children: formatMessage(messages.learnersLabel) })] })] }), _jsxs("div", { className: "cart-summary__stat d-flex align-items-center", children: [_jsx(Icon, { src: Institution, className: "mr-2 text-muted", style: { width: '1.5rem', height: '1.5rem' } }), _jsxs("div", { children: [_jsx("p", { className: "font-weight-bold mb-0", children: formatMessage(messages.institutionsCount) }), _jsx("p", { className: "text-muted small mb-0", children: formatMessage(messages.institutionsLabel) })] })] })] })] }));
28
+ };
29
+ export default CartSummary;
30
+ //# sourceMappingURL=CartSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CartSummary.js","sourceRoot":"","sources":["../../../src/components/CartSummary/CartSummary.tsx"],"names":[],"mappings":"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","sourcesContent":["import React, { useState } from 'react';\nimport { Badge, Card, Icon } from '@openedx/paragon';\nimport { Group, People, Institution } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { EdxUnlimitedLogo } from '../BrandMarks/BrandMarks';\nimport CourseEnrollmentCard from '../CourseEnrollmentCard/CourseEnrollmentCard';\nimport type { CourseDetail } from '../../types';\nimport messages from './Messages';\n\nexport type BillingCycle = 'monthly' | 'annual';\n\nexport interface CartSummaryProps {\n productTitle?: string,\n productBlurb?: string,\n /** Monthly price amount e.g. \"39\" */\n monthlyAmount?: string,\n /** Annual price amount e.g. \"299\" */\n annualAmount?: string,\n currency?: string,\n activeSubscriberCount?: number | null,\n defaultCycle?: BillingCycle,\n monthlyRenewalLabel?: string,\n annualRenewalLabel?: string,\n onCycleChange?: (cycle: BillingCycle) => void,\n learnerCount?: number,\n /** When set, shows the course enrollment preview card below the summary card. */\n course?: CourseDetail | null,\n}\n\nconst CartSummary = ({\n productTitle = 'edX Subscription',\n productBlurb = 'Subscribe and get access to hundreds of courses and programs.',\n monthlyAmount = '39',\n annualAmount = '299',\n currency = 'USD',\n activeSubscriberCount,\n defaultCycle = 'monthly',\n onCycleChange,\n learnerCount: learnerCountProp = 2203,\n course = null,\n}: CartSummaryProps) => {\n const { formatMessage } = useIntl();\n const [cycle, setCycle] = useState<BillingCycle>(defaultCycle);\n\n const isMonthly = cycle === 'monthly';\n\n const handleToggle = () => {\n const next: BillingCycle = isMonthly ? 'annual' : 'monthly';\n setCycle(next);\n onCycleChange?.(next);\n };\n\n const frequency = isMonthly ? 'month' : 'year';\n const amount = isMonthly ? monthlyAmount : annualAmount;\n\n const learnerCount = (\n activeSubscriberCount != null ? activeSubscriberCount : learnerCountProp\n ).toLocaleString();\n\n return (\n <div className=\"cart-summary \">\n <Card className=\"cart-summary__card p-3\">\n <Card.Section className=\"d-flex justify-content-between align-items-center p-0 pb-3\">\n <span className=\"font-weight-bold text-gray-900\">\n {formatMessage(messages.summaryHeading)}\n </span>\n <Badge\n variant=\"light\"\n className=\"d-flex align-items-center px-2 py-1\"\n >\n <Icon\n src={Group}\n className=\"mr-1\"\n style={{ width: '1rem', height: '1rem' }}\n />\n {formatMessage(messages.learnersSubscribed, {\n count: learnerCount,\n })}\n </Badge>\n </Card.Section>\n\n <Card.Divider />\n\n <Card.Section className=\"p-0 py-3\">\n <div className=\"d-flex align-items-start\">\n <EdxUnlimitedLogo />\n <div>\n <p className=\"font-weight-bold mb-0 text-primary-500\">\n {productTitle}\n </p>\n <p className=\"small mb-0 text-gray-900\">{productBlurb}</p>\n </div>\n </div>\n </Card.Section>\n\n <Card.Divider />\n\n <Card.Section className=\"p-0 py-3\">\n <div className=\"d-flex justify-content-between align-items-center mb-1\">\n <span className=\"small text-gray-900\">\n {isMonthly\n ? formatMessage(messages.monthlySubscription)\n : formatMessage(messages.annualSubscription)}\n </span>\n <span className=\"text-success font-weight-bold small\">\n {formatMessage(messages.trialLabel)}\n </span>\n </div>\n <div className=\"d-flex justify-content-between align-items-center\">\n <button\n type=\"button\"\n className=\"btn btn-link p-0 small\"\n onClick={handleToggle}\n >\n {isMonthly\n ? formatMessage(messages.switchToAnnual)\n : formatMessage(messages.switchToMonthly)}\n </button>\n <span className=\"small text-gray-900 font-weight-bold\">\n ${amount}/{frequency} {currency}\n </span>\n </div>\n </Card.Section>\n\n <Card.Section className=\"d-flex justify-content-between align-items-center px-0\">\n <span className=\"font-weight-bold text-gray-900\">\n {formatMessage(messages.todaysTotal)}\n </span>\n <span className=\"font-weight-bold mb-0 text-gray-900\">\n {formatMessage(messages.todaysTotalValue)}\n </span>\n </Card.Section>\n </Card>\n\n {course && (\n <CourseEnrollmentCard course={course} variant=\"checkout\" />\n )}\n\n {/* Stats row */}\n <div className=\"cart-summary__stats d-none d-lg-flex mt-3\">\n <div className=\"cart-summary__stat d-flex align-items-center mr-4\">\n <Icon\n src={People}\n className=\"mr-2 text-muted\"\n style={{ width: '1.5rem', height: '1.5rem' }}\n />\n <div>\n <p className=\"font-weight-bold mb-0\">\n {formatMessage(messages.learnersCount)}\n </p>\n <p className=\"text-muted small mb-0\">\n {formatMessage(messages.learnersLabel)}\n </p>\n </div>\n </div>\n <div className=\"cart-summary__stat d-flex align-items-center\">\n <Icon\n src={Institution}\n className=\"mr-2 text-muted\"\n style={{ width: '1.5rem', height: '1.5rem' }}\n />\n <div>\n <p className=\"font-weight-bold mb-0\">\n {formatMessage(messages.institutionsCount)}\n </p>\n <p className=\"text-muted small mb-0\">\n {formatMessage(messages.institutionsLabel)}\n </p>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default CartSummary;\n"]}
@@ -0,0 +1,73 @@
1
+ declare const messages: {
2
+ summaryHeading: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ learnersSubscribed: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
12
+ monthlySubscription: {
13
+ id: string;
14
+ defaultMessage: string;
15
+ description: string;
16
+ };
17
+ annualSubscription: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
22
+ trialLabel: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
27
+ priceDisplay: {
28
+ id: string;
29
+ defaultMessage: string;
30
+ description: string;
31
+ };
32
+ todaysTotal: {
33
+ id: string;
34
+ defaultMessage: string;
35
+ description: string;
36
+ };
37
+ todaysTotalValue: {
38
+ id: string;
39
+ defaultMessage: string;
40
+ description: string;
41
+ };
42
+ switchToAnnual: {
43
+ id: string;
44
+ defaultMessage: string;
45
+ description: string;
46
+ };
47
+ switchToMonthly: {
48
+ id: string;
49
+ defaultMessage: string;
50
+ description: string;
51
+ };
52
+ learnersCount: {
53
+ id: string;
54
+ defaultMessage: string;
55
+ description: string;
56
+ };
57
+ learnersLabel: {
58
+ id: string;
59
+ defaultMessage: string;
60
+ description: string;
61
+ };
62
+ institutionsCount: {
63
+ id: string;
64
+ defaultMessage: string;
65
+ description: string;
66
+ };
67
+ institutionsLabel: {
68
+ id: string;
69
+ defaultMessage: string;
70
+ description: string;
71
+ };
72
+ };
73
+ export default messages;
@@ -0,0 +1,76 @@
1
+ import { defineMessages } from '@openedx/frontend-base';
2
+ const messages = defineMessages({
3
+ // CartSummary
4
+ summaryHeading: {
5
+ id: 'checkout.cartSummary.summaryHeading',
6
+ defaultMessage: 'Summary',
7
+ description: 'Heading for the order summary card',
8
+ },
9
+ learnersSubscribed: {
10
+ id: 'checkout.cartSummary.learnersSubscribed',
11
+ defaultMessage: '{count} learners subscribed',
12
+ description: 'Badge showing number of active learners',
13
+ },
14
+ monthlySubscription: {
15
+ id: 'checkout.cartSummary.monthlySubscription',
16
+ defaultMessage: 'Monthly subscription',
17
+ description: 'Label for monthly billing cycle',
18
+ },
19
+ annualSubscription: {
20
+ id: 'checkout.cartSummary.annualSubscription',
21
+ defaultMessage: 'Annual subscription',
22
+ description: 'Label for annual billing cycle',
23
+ },
24
+ trialLabel: {
25
+ id: 'checkout.cartSummary.trialLabel',
26
+ defaultMessage: '7-day free trial',
27
+ description: 'Free trial badge label',
28
+ },
29
+ priceDisplay: {
30
+ id: 'checkout.cartSummary.priceDisplay',
31
+ defaultMessage: '${amount}/{frequency} USD',
32
+ description: 'Price display e.g. $39/month USD',
33
+ },
34
+ todaysTotal: {
35
+ id: 'checkout.cartSummary.todaysTotal',
36
+ defaultMessage: "Today's total",
37
+ description: "Label for today's total price row",
38
+ },
39
+ todaysTotalValue: {
40
+ id: 'checkout.cartSummary.todaysTotalValue',
41
+ defaultMessage: '$0',
42
+ description: "Today's total amount during trial",
43
+ },
44
+ switchToAnnual: {
45
+ id: 'checkout.cartSummary.switchToAnnual',
46
+ defaultMessage: 'Switch to annual',
47
+ description: 'Toggle button label to switch to annual billing',
48
+ },
49
+ switchToMonthly: {
50
+ id: 'checkout.cartSummary.switchToMonthly',
51
+ defaultMessage: 'Switch to monthly',
52
+ description: 'Toggle button label to switch to monthly billing',
53
+ },
54
+ learnersCount: {
55
+ id: 'checkout.cartSummary.learnersCount',
56
+ defaultMessage: '100M',
57
+ description: 'Total learners stat',
58
+ },
59
+ learnersLabel: {
60
+ id: 'checkout.cartSummary.learnersLabel',
61
+ defaultMessage: 'Learners',
62
+ description: 'Label under the learners count stat',
63
+ },
64
+ institutionsCount: {
65
+ id: 'checkout.cartSummary.institutionsCount',
66
+ defaultMessage: '250+',
67
+ description: 'Expert institutions count stat',
68
+ },
69
+ institutionsLabel: {
70
+ id: 'checkout.cartSummary.institutionsLabel',
71
+ defaultMessage: 'Expert institutions',
72
+ description: 'Label under the institutions count stat',
73
+ },
74
+ });
75
+ export default messages;
76
+ //# sourceMappingURL=Messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Messages.js","sourceRoot":"","sources":["../../../src/components/CartSummary/Messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,cAAc;IACd,cAAc,EAAE;QACd,EAAE,EAAE,qCAAqC;QACzC,cAAc,EAAE,SAAS;QACzB,WAAW,EAAE,oCAAoC;KAClD;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,yCAAyC;QAC7C,cAAc,EAAE,6BAA6B;QAC7C,WAAW,EAAE,yCAAyC;KACvD;IACD,mBAAmB,EAAE;QACnB,EAAE,EAAE,0CAA0C;QAC9C,cAAc,EAAE,sBAAsB;QACtC,WAAW,EAAE,iCAAiC;KAC/C;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,yCAAyC;QAC7C,cAAc,EAAE,qBAAqB;QACrC,WAAW,EAAE,gCAAgC;KAC9C;IACD,UAAU,EAAE;QACV,EAAE,EAAE,iCAAiC;QACrC,cAAc,EAAE,kBAAkB;QAClC,WAAW,EAAE,wBAAwB;KACtC;IACD,YAAY,EAAE;QACZ,EAAE,EAAE,mCAAmC;QACvC,cAAc,EAAE,2BAA2B;QAC3C,WAAW,EAAE,kCAAkC;KAChD;IACD,WAAW,EAAE;QACX,EAAE,EAAE,kCAAkC;QACtC,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,mCAAmC;KACjD;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,uCAAuC;QAC3C,cAAc,EAAE,IAAI;QACpB,WAAW,EAAE,mCAAmC;KACjD;IACD,cAAc,EAAE;QACd,EAAE,EAAE,qCAAqC;QACzC,cAAc,EAAE,kBAAkB;QAClC,WAAW,EAAE,iDAAiD;KAC/D;IACD,eAAe,EAAE;QACf,EAAE,EAAE,sCAAsC;QAC1C,cAAc,EAAE,mBAAmB;QACnC,WAAW,EAAE,kDAAkD;KAChE;IACD,aAAa,EAAE;QACb,EAAE,EAAE,oCAAoC;QACxC,cAAc,EAAE,MAAM;QACtB,WAAW,EAAE,qBAAqB;KACnC;IACD,aAAa,EAAE;QACb,EAAE,EAAE,oCAAoC;QACxC,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,qCAAqC;KACnD;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,wCAAwC;QAC5C,cAAc,EAAE,MAAM;QACtB,WAAW,EAAE,gCAAgC;KAC9C;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,wCAAwC;QAC5C,cAAc,EAAE,qBAAqB;QACrC,WAAW,EAAE,yCAAyC;KACvD;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n // CartSummary\n summaryHeading: {\n id: 'checkout.cartSummary.summaryHeading',\n defaultMessage: 'Summary',\n description: 'Heading for the order summary card',\n },\n learnersSubscribed: {\n id: 'checkout.cartSummary.learnersSubscribed',\n defaultMessage: '{count} learners subscribed',\n description: 'Badge showing number of active learners',\n },\n monthlySubscription: {\n id: 'checkout.cartSummary.monthlySubscription',\n defaultMessage: 'Monthly subscription',\n description: 'Label for monthly billing cycle',\n },\n annualSubscription: {\n id: 'checkout.cartSummary.annualSubscription',\n defaultMessage: 'Annual subscription',\n description: 'Label for annual billing cycle',\n },\n trialLabel: {\n id: 'checkout.cartSummary.trialLabel',\n defaultMessage: '7-day free trial',\n description: 'Free trial badge label',\n },\n priceDisplay: {\n id: 'checkout.cartSummary.priceDisplay',\n defaultMessage: '${amount}/{frequency} USD',\n description: 'Price display e.g. $39/month USD',\n },\n todaysTotal: {\n id: 'checkout.cartSummary.todaysTotal',\n defaultMessage: \"Today's total\",\n description: \"Label for today's total price row\",\n },\n todaysTotalValue: {\n id: 'checkout.cartSummary.todaysTotalValue',\n defaultMessage: '$0',\n description: \"Today's total amount during trial\",\n },\n switchToAnnual: {\n id: 'checkout.cartSummary.switchToAnnual',\n defaultMessage: 'Switch to annual',\n description: 'Toggle button label to switch to annual billing',\n },\n switchToMonthly: {\n id: 'checkout.cartSummary.switchToMonthly',\n defaultMessage: 'Switch to monthly',\n description: 'Toggle button label to switch to monthly billing',\n },\n learnersCount: {\n id: 'checkout.cartSummary.learnersCount',\n defaultMessage: '100M',\n description: 'Total learners stat',\n },\n learnersLabel: {\n id: 'checkout.cartSummary.learnersLabel',\n defaultMessage: 'Learners',\n description: 'Label under the learners count stat',\n },\n institutionsCount: {\n id: 'checkout.cartSummary.institutionsCount',\n defaultMessage: '250+',\n description: 'Expert institutions count stat',\n },\n institutionsLabel: {\n id: 'checkout.cartSummary.institutionsLabel',\n defaultMessage: 'Expert institutions',\n description: 'Label under the institutions count stat',\n },\n});\n\nexport default messages;\n"]}
@@ -0,0 +1,4 @@
1
+ import type { UseCheckoutOptions } from '../../data/hooks/useCheckout';
2
+ export type CheckoutProps = UseCheckoutOptions;
3
+ declare const Checkout: (props: CheckoutProps) => import("react/jsx-runtime").JSX.Element;
4
+ export default Checkout;