@wix/himalaya-cli 0.1871.0 → 0.1872.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 (180) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-module.d.ts +3 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/portfolio/src/index.d.ts +19 -0
  3. package/dist/cli.mjs +89 -39
  4. package/fixtures/wix-canned.json +8 -0
  5. package/guides/release-notes.md +18 -0
  6. package/guides/sdk-reference.json +8 -1
  7. package/package.json +2 -2
  8. package/template-icons/professional-services.png +0 -0
  9. package/templates/bare-fashion/config.ts +37 -2
  10. package/templates/bare-fashion/dev/index.ts +4006 -48
  11. package/templates/bare-fashion/himalaya.content.json +15 -0
  12. package/templates/bare-fashion/tier5-src/_shared/member-account-routes.ts +56 -0
  13. package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
  14. package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
  15. package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
  16. package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
  17. package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
  18. package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
  19. package/templates/branded-lite/dev/index.ts +2 -1
  20. package/templates/branded-lite/tier5-src/_shared/portfolio-details.ts +70 -0
  21. package/templates/branded-lite/tier5-src/himi-branded-lite-coupons/index.ts +13 -2
  22. package/templates/branded-lite/tier5-src/himi-branded-lite-portfolio/index.ts +90 -9
  23. package/templates/branded-lite/tier5-src/himi-branded-lite-portfolio-project/index.ts +53 -4
  24. package/templates/branded-lite/tier5-src/himi-events-list/index.ts +5 -1
  25. package/templates/community-club/tier5-src/himi-events-list/index.ts +5 -1
  26. package/templates/conference/config.ts +43 -1
  27. package/templates/conference/dev/index.ts +4127 -0
  28. package/templates/conference/himalaya.content.json +18 -0
  29. package/templates/conference/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
  30. package/templates/conference/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
  31. package/templates/conference/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
  32. package/templates/conference/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
  33. package/templates/conference/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
  34. package/templates/conference/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
  35. package/templates/conference/tier5-src/himi-events-list/index.ts +5 -1
  36. package/templates/conference/tier5-src/wix-spaces-delete-account/index.ts +59 -0
  37. package/templates/events-meetups/tier5-src/himi-events-list/index.ts +5 -1
  38. package/templates/gym-fitness/tier5-src/himi-events-list/index.ts +5 -1
  39. package/templates/medical-services/config.ts +42 -0
  40. package/templates/medical-services/dev/index.ts +4136 -0
  41. package/templates/medical-services/himalaya.content.json +18 -0
  42. package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
  43. package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
  44. package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
  45. package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
  46. package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
  47. package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
  48. package/templates/medical-services/tier5-src/wix-spaces-delete-account/index.ts +59 -0
  49. package/templates/nonprofit-cause/tier5-src/himi-events-list/index.ts +5 -1
  50. package/templates/podcast-creator/tier5-src/himi-events-list/index.ts +5 -1
  51. package/templates/portfolio-creative/dev/index.ts +2 -1
  52. package/templates/portfolio-creative/tier5-src/_shared/portfolio-details.ts +70 -0
  53. package/templates/portfolio-creative/tier5-src/himi-branded-lite-portfolio/index.ts +90 -9
  54. package/templates/portfolio-creative/tier5-src/himi-branded-lite-portfolio-project/index.ts +53 -4
  55. package/templates/portfolio-creative/tier5-src/himi-events-list/index.ts +5 -1
  56. package/templates/professional-services/README.md +55 -0
  57. package/templates/professional-services/config.ts +436 -0
  58. package/templates/professional-services/dev/index.ts +44772 -0
  59. package/templates/professional-services/himalaya.content.json +100 -0
  60. package/templates/professional-services/himalaya.template.json +16 -0
  61. package/templates/professional-services/icon.png +0 -0
  62. package/templates/professional-services/platforms.json +1 -0
  63. package/templates/professional-services/tier5-src/_shared/app-locale.ts +70 -0
  64. package/templates/professional-services/tier5-src/_shared/booking-location.ts +147 -0
  65. package/templates/professional-services/tier5-src/_shared/booking-session.ts +224 -0
  66. package/templates/professional-services/tier5-src/_shared/branded-lite-hosted.ts +282 -0
  67. package/templates/professional-services/tier5-src/_shared/branded-load-state.ts +109 -0
  68. package/templates/professional-services/tier5-src/_shared/business-chat-copy.ts +40 -0
  69. package/templates/professional-services/tier5-src/_shared/business-chat-history.ts +51 -0
  70. package/templates/professional-services/tier5-src/_shared/business-chat-message-model.ts +177 -0
  71. package/templates/professional-services/tier5-src/_shared/business-chat-model.ts +56 -0
  72. package/templates/professional-services/tier5-src/_shared/business-chat-presenter.ts +587 -0
  73. package/templates/professional-services/tier5-src/_shared/business-chat-transport.ts +164 -0
  74. package/templates/professional-services/tier5-src/_shared/chat-live.ts +242 -0
  75. package/templates/professional-services/tier5-src/_shared/collection-contract.ts +232 -0
  76. package/templates/professional-services/tier5-src/_shared/collection-query.ts +201 -0
  77. package/templates/professional-services/tier5-src/_shared/collection-service.ts +429 -0
  78. package/templates/professional-services/tier5-src/_shared/detail-presence.ts +51 -0
  79. package/templates/professional-services/tier5-src/_shared/engine-intl.ts +538 -0
  80. package/templates/professional-services/tier5-src/_shared/event-registration.ts +86 -0
  81. package/templates/professional-services/tier5-src/_shared/events-inline-options.ts +77 -0
  82. package/templates/professional-services/tier5-src/_shared/faq-list.ts +405 -0
  83. package/templates/professional-services/tier5-src/_shared/featured-event.ts +63 -0
  84. package/templates/professional-services/tier5-src/_shared/group-member-count.ts +15 -0
  85. package/templates/professional-services/tier5-src/_shared/group-privacy.ts +14 -0
  86. package/templates/professional-services/tier5-src/_shared/guest-sign-in.ts +36 -0
  87. package/templates/professional-services/tier5-src/_shared/himi-account.ts +222 -0
  88. package/templates/professional-services/tier5-src/_shared/himi-blog-hidden.ts +66 -0
  89. package/templates/professional-services/tier5-src/_shared/himi-blog-post-row.ts +214 -0
  90. package/templates/professional-services/tier5-src/_shared/himi-blog-saved.ts +64 -0
  91. package/templates/professional-services/tier5-src/_shared/himi-booking-saved.ts +88 -0
  92. package/templates/professional-services/tier5-src/_shared/himi-bookings.ts +318 -0
  93. package/templates/professional-services/tier5-src/_shared/himi-copy.ts +123 -0
  94. package/templates/professional-services/tier5-src/_shared/himi-events.ts +92 -0
  95. package/templates/professional-services/tier5-src/_shared/himi-media.ts +33 -0
  96. package/templates/professional-services/tier5-src/_shared/himi-store.ts +7 -0
  97. package/templates/professional-services/tier5-src/_shared/himi-text.ts +24 -0
  98. package/templates/professional-services/tier5-src/_shared/host-events.ts +66 -0
  99. package/templates/professional-services/tier5-src/_shared/hosted-checkout.ts +70 -0
  100. package/templates/professional-services/tier5-src/_shared/iap-attendance-form.ts +106 -0
  101. package/templates/professional-services/tier5-src/_shared/iap-attendance-purchase.ts +235 -0
  102. package/templates/professional-services/tier5-src/_shared/iap-attendance.ts +38 -0
  103. package/templates/professional-services/tier5-src/_shared/iap-worker.ts +127 -0
  104. package/templates/professional-services/tier5-src/_shared/inbox-rooms.ts +163 -0
  105. package/templates/professional-services/tier5-src/_shared/local-preferences.ts +38 -0
  106. package/templates/professional-services/tier5-src/_shared/member-access.ts +63 -0
  107. package/templates/professional-services/tier5-src/_shared/member-account-routes.ts +56 -0
  108. package/templates/professional-services/tier5-src/_shared/member-avatar.ts +76 -0
  109. package/templates/professional-services/tier5-src/_shared/member-bookings.ts +107 -0
  110. package/templates/professional-services/tier5-src/_shared/member-read.ts +82 -0
  111. package/templates/professional-services/tier5-src/_shared/member-screen.ts +99 -0
  112. package/templates/professional-services/tier5-src/_shared/notification-target.ts +141 -0
  113. package/templates/professional-services/tier5-src/_shared/offset-page.ts +10 -0
  114. package/templates/professional-services/tier5-src/_shared/online-actions.ts +76 -0
  115. package/templates/professional-services/tier5-src/_shared/owner-load-error.ts +348 -0
  116. package/templates/professional-services/tier5-src/_shared/payment-setup.ts +6 -0
  117. package/templates/professional-services/tier5-src/_shared/portfolio-details.ts +70 -0
  118. package/templates/professional-services/tier5-src/_shared/pricing-plan-display.ts +64 -0
  119. package/templates/professional-services/tier5-src/_shared/relative-time.ts +21 -0
  120. package/templates/professional-services/tier5-src/_shared/result-snackbar.ts +26 -0
  121. package/templates/professional-services/tier5-src/_shared/rich-body.ts +78 -0
  122. package/templates/professional-services/tier5-src/_shared/rich-content-link.ts +34 -0
  123. package/templates/professional-services/tier5-src/_shared/sign-in-sheet.ts +18 -0
  124. package/templates/professional-services/tier5-src/_shared/staff-name.ts +18 -0
  125. package/templates/professional-services/tier5-src/_shared/weekly-goal.ts +111 -0
  126. package/templates/professional-services/tier5-src/_shared/wix-bi.ts +85 -0
  127. package/templates/professional-services/tier5-src/_shared/wix-member-links.ts +114 -0
  128. package/templates/professional-services/tier5-src/_shared/wix-service-price.ts +146 -0
  129. package/templates/professional-services/tier5-src/business-chat/index.ts +797 -0
  130. package/templates/professional-services/tier5-src/business-contact/index.ts +6 -0
  131. package/templates/professional-services/tier5-src/himi-blog-feed/index.ts +444 -0
  132. package/templates/professional-services/tier5-src/himi-blog-post/index.ts +1239 -0
  133. package/templates/professional-services/tier5-src/himi-booking-account/index.ts +278 -0
  134. package/templates/professional-services/tier5-src/himi-booking-bookings/index.ts +475 -0
  135. package/templates/professional-services/tier5-src/himi-booking-service/index.ts +1197 -0
  136. package/templates/professional-services/tier5-src/himi-booking-services/index.ts +795 -0
  137. package/templates/professional-services/tier5-src/himi-booking-time/index.ts +1840 -0
  138. package/templates/professional-services/tier5-src/himi-branded-lite-coupons/index.ts +96 -0
  139. package/templates/professional-services/tier5-src/himi-branded-lite-faq/index.ts +6 -0
  140. package/templates/professional-services/tier5-src/himi-branded-lite-file-share/index.ts +12 -0
  141. package/templates/professional-services/tier5-src/himi-branded-lite-group/index.ts +310 -0
  142. package/templates/professional-services/tier5-src/himi-branded-lite-group-about/index.ts +240 -0
  143. package/templates/professional-services/tier5-src/himi-branded-lite-my-groups/index.ts +237 -0
  144. package/templates/professional-services/tier5-src/himi-branded-lite-notifications/index.ts +263 -0
  145. package/templates/professional-services/tier5-src/himi-branded-lite-plans/index.ts +498 -0
  146. package/templates/professional-services/tier5-src/himi-branded-lite-portfolio/index.ts +136 -0
  147. package/templates/professional-services/tier5-src/himi-branded-lite-portfolio-project/index.ts +198 -0
  148. package/templates/professional-services/tier5-src/himi-events-detail/index.ts +1306 -0
  149. package/templates/professional-services/tier5-src/himi-events-list/index.ts +171 -0
  150. package/templates/professional-services/tier5-src/himi-events-my-events/index.ts +227 -0
  151. package/templates/professional-services/tier5-src/himi-events-rsvp/index.ts +230 -0
  152. package/templates/professional-services/tier5-src/himi-professional-services-community/index.ts +318 -0
  153. package/templates/professional-services/tier5-src/himi-professional-services-home/index.ts +772 -0
  154. package/templates/professional-services/tier5-src/himi-store-account/index.ts +1514 -0
  155. package/templates/professional-services/tier5-src/wix-spaces-coupon-detail/index.ts +43 -0
  156. package/templates/professional-services/tier5-src/wix-spaces-my-subscriptions/index.ts +89 -0
  157. package/templates/professional-services/tier5-src/wix-spaces-subscription-detail/index.ts +139 -0
  158. package/templates/professional-services/tokens.json +456 -0
  159. package/templates/restaurant/tier5-src/himi-events-list/index.ts +5 -1
  160. package/templates/salon-spa/config.ts +42 -0
  161. package/templates/salon-spa/dev/index.ts +4136 -0
  162. package/templates/salon-spa/himalaya.content.json +18 -0
  163. package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
  164. package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
  165. package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
  166. package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
  167. package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
  168. package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
  169. package/templates/salon-spa/tier5-src/wix-spaces-delete-account/index.ts +59 -0
  170. package/templates/wholesale-store/config.ts +43 -1
  171. package/templates/wholesale-store/dev/index.ts +4136 -0
  172. package/templates/wholesale-store/himalaya.content.json +18 -0
  173. package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
  174. package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
  175. package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
  176. package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
  177. package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
  178. package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
  179. package/templates/wholesale-store/tier5-src/wix-spaces-delete-account/index.ts +59 -0
  180. package/templates/yoga-studio/tier5-src/himi-events-list/index.ts +5 -1
@@ -0,0 +1,198 @@
1
+ import { descriptionBody } from "../_shared/rich-body.js";
2
+ // himi-branded-lite-portfolio-project — real Wix Portfolio project detail.
3
+ // The public project row is resolved again from Wix, then its ordered project
4
+ // items supply the actual image/video/text story. No sample project is invented.
5
+ //
6
+ // The project's collection (`collection`), its "Location" detail (`location`), its Client, Year and
7
+ // Duration details as fact chips (`facts`) and every other detail (`details`) come from the same
8
+ // list read (_shared/portfolio-details.ts). Each collapses when the project has none. `share`
9
+ // opens the system share sheet with the project's page on the site when Wix gives one, else the
10
+ // site's own address when the screen passes it (`siteUrl` load param); with neither, no share.
11
+ import { defineService } from "@himalaya/state";
12
+ import { listCollections, listProjectItems, listProjects, portfolioCoverRef, type WixPortfolioProjectItem } from "@himalaya/wix-portfolio";
13
+ import { share as shareSheet } from "@himalaya/share";
14
+ import { collectionNames, projectCollection, projectDetails, type ProjectDetailRow, type ProjectFact } from "../_shared/portfolio-details.js";
15
+ import { wixMediaUrl, WIX_DETAIL_IMAGE } from "@himalaya/wix-media";
16
+ import { copyParam, stashCopy } from "../_shared/himi-copy.js";
17
+ import { presence, type PresenceFlags } from "../_shared/detail-presence.js";
18
+
19
+ interface MediaRow {
20
+ id: string;
21
+ title: string;
22
+ description: string;
23
+ image: string;
24
+ videoUrl: string;
25
+ hasImage: boolean;
26
+ noImage: boolean;
27
+ hasVideo: boolean;
28
+ noVideo: boolean;
29
+ hasMedia: boolean;
30
+ noMedia: boolean;
31
+ }
32
+
33
+ interface State extends PresenceFlags {
34
+ status: "loading" | "ready" | "error";
35
+ id: string;
36
+ title: string;
37
+ initial: string;
38
+ description: string;
39
+ coverImage: string;
40
+ items: MediaRow[];
41
+ emptyText: string;
42
+ isLoading: boolean;
43
+ notLoading: boolean;
44
+ isErrored: boolean;
45
+ notErrored: boolean;
46
+ hasCover: boolean;
47
+ noCover: boolean;
48
+ hasItems: boolean;
49
+ noItems: boolean;
50
+ hideContent: boolean;
51
+ noEmpty: boolean;
52
+ collection: string;
53
+ noCollection: boolean;
54
+ location: string;
55
+ noLocation: boolean;
56
+ facts: ProjectFact[];
57
+ noFacts: boolean;
58
+ details: ProjectDetailRow[];
59
+ noDetails: boolean;
60
+ /** The project's page on the published site ("" when Wix gives none: no share). */
61
+ shareUrl: string;
62
+ noShare: boolean;
63
+ }
64
+
65
+ const NO_DETAILS = {
66
+ collection: "", noCollection: true, location: "", noLocation: true, facts: [] as ProjectFact[], noFacts: true,
67
+ details: [] as ProjectDetailRow[], noDetails: true, shareUrl: "", noShare: true,
68
+ };
69
+
70
+ function inputId(): string {
71
+ const input = (globalThis as { himalaya?: { input?: { id?: unknown } } }).himalaya?.input;
72
+ return typeof input?.id === "string" ? input.id : "";
73
+ }
74
+
75
+ function imageOf(item: WixPortfolioProjectItem): string {
76
+ return wixMediaUrl(portfolioCoverRef(item.image), WIX_DETAIL_IMAGE);
77
+ }
78
+
79
+ function row(item: WixPortfolioProjectItem, index: number): MediaRow {
80
+ const image = imageOf(item);
81
+ const videoUrl = typeof item.video?.videoInfo?.url === "string" ? item.video.videoInfo.url : "";
82
+ const hasImage = Boolean(image);
83
+ const hasVideo = !hasImage && /^https?:\/\//i.test(videoUrl);
84
+ return {
85
+ id: item.id || `portfolio-item-${index}`,
86
+ title: (item.title ?? "").trim(),
87
+ description: descriptionBody(item.description).bodyText,
88
+ image,
89
+ videoUrl: hasVideo ? videoUrl : "",
90
+ hasImage,
91
+ noImage: !hasImage,
92
+ hasVideo,
93
+ noVideo: !hasVideo,
94
+ hasMedia: hasImage || hasVideo,
95
+ noMedia: !hasImage && !hasVideo,
96
+ };
97
+ }
98
+
99
+ function derive(state: State): State {
100
+ const hasContent = Boolean(state.title);
101
+ const hasItems = state.items.length > 0;
102
+ return {
103
+ ...state,
104
+ isLoading: state.status === "loading",
105
+ notLoading: state.status !== "loading",
106
+ isErrored: state.status === "error",
107
+ notErrored: state.status !== "error",
108
+ hasCover: Boolean(state.coverImage),
109
+ noCover: !state.coverImage,
110
+ hasItems,
111
+ noItems: !hasItems,
112
+ hideContent: state.status !== "ready" || !hasContent,
113
+ noEmpty: state.status !== "ready" || hasContent,
114
+ };
115
+ }
116
+
117
+ function unavailableProject(state: State, status: "ready" | "error", id: string, emptyText: string): State {
118
+ return derive({
119
+ ...state,
120
+ status,
121
+ id,
122
+ title: "",
123
+ initial: "",
124
+ description: "",
125
+ coverImage: "",
126
+ items: [],
127
+ emptyText,
128
+ ...NO_DETAILS,
129
+ // A project that is not there is `missing`; one that failed to load is not — the
130
+ // error card speaks, and nothing claims the project was removed.
131
+ ...presence(status === "ready" ? "missing" : "failed"),
132
+ });
133
+ }
134
+
135
+ /** A project page on the web (https only): the share sheet carries nothing else. */
136
+ function shareUrlOf(raw: unknown): string {
137
+ const url = typeof raw === "string" ? raw.trim() : "";
138
+ return /^https:\/\/[^\s]+$/i.test(url) ? url : "";
139
+ }
140
+
141
+ const svc = defineService<State, { load: (state: State, arg?: unknown) => Promise<State>; share: (state: State) => Promise<State> }>("himiBrandedPortfolioProject", {
142
+ state: derive({
143
+ status: "loading", id: "", title: "", initial: "", description: "", coverImage: "", items: [], emptyText: "", ...NO_DETAILS,
144
+ isLoading: true, notLoading: false, isErrored: false, notErrored: true,
145
+ hasCover: false, noCover: true, hasItems: false, noItems: true, hideContent: true, noEmpty: true, ...presence("loading"),
146
+ }),
147
+ actions: {
148
+ load: async (state, arg) => {
149
+ stashCopy(arg);
150
+ const id = inputId();
151
+ if (!id) return unavailableProject(state, "ready", "", copyParam("portfolioProject.emptyText", "This project is no longer available."));
152
+ try {
153
+ const [projects, collections] = await Promise.all([
154
+ listProjects(100),
155
+ // The collection name is extra: a failed read leaves the project without it.
156
+ listCollections(100).then((r) => r.collections ?? []).catch(() => []),
157
+ ]);
158
+ const project = (projects.projects ?? []).find((candidate) => candidate.id === id && candidate.hidden !== true);
159
+ if (!project) return unavailableProject(state, "ready", id, copyParam("portfolioProject.emptyText", "This project is no longer available."));
160
+ const response = await listProjectItems(id, 100);
161
+ const items = (response.items ?? [])
162
+ .slice()
163
+ .sort((a, b) => (a.sortOrder ?? 0) - (b.sortOrder ?? 0))
164
+ .map(row);
165
+ const details = projectDetails(project);
166
+ const collection = projectCollection(project, collectionNames(collections)).name;
167
+ // A site with no Portfolio page gives no project url: the site itself is what to share.
168
+ const shareUrl = shareUrlOf(project.url) || shareUrlOf((arg as { siteUrl?: unknown } | undefined)?.siteUrl);
169
+ return derive({
170
+ ...state,
171
+ status: "ready",
172
+ id,
173
+ title: (project.title || copyParam("portfolioProject.projectFallbackName", "Project")).trim(),
174
+ initial: ((project.title || "P").trim()[0] || "P").toUpperCase(),
175
+ description: descriptionBody(project.description).bodyText,
176
+ coverImage: wixMediaUrl(portfolioCoverRef(project.coverImage), WIX_DETAIL_IMAGE),
177
+ items,
178
+ emptyText: items.length ? "" : copyParam("portfolioProject.noMediaText", "This project has no published media yet."),
179
+ collection, noCollection: !collection,
180
+ location: details.location, noLocation: !details.location,
181
+ facts: details.facts, noFacts: details.facts.length === 0,
182
+ details: details.others, noDetails: details.others.length === 0,
183
+ shareUrl, noShare: !shareUrl,
184
+ ...presence("found"),
185
+ });
186
+ } catch {
187
+ return unavailableProject(state, "error", id, copyParam("portfolioProject.errorText", "This project could not be loaded. Try again."));
188
+ }
189
+ },
190
+ share: async (state) => {
191
+ if (!state.shareUrl) return state;
192
+ try { await shareSheet({ subject: state.title, text: state.title, url: state.shareUrl }); } catch { /* the sheet is best-effort */ }
193
+ return state;
194
+ },
195
+ },
196
+ });
197
+ svc.load();
198
+ export { svc };