@youversion/platform-react-ui 0.4.2 → 0.4.3

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/dist/index.cjs CHANGED
@@ -39,8 +39,10 @@ __export(index_exports, {
39
39
  BOOK_IDS: () => BOOK_IDS,
40
40
  BibleChapterPicker: () => BibleChapterPicker,
41
41
  BibleClient: () => BibleClient,
42
- BibleSDKProvider: () => import_platform_react_hooks4.BibleSDKProvider,
42
+ BibleReader: () => BibleReader,
43
+ BibleSDKProvider: () => import_platform_react_hooks6.BibleSDKProvider,
43
44
  BibleTextView: () => BibleTextView,
45
+ BibleVersionPicker: () => BibleVersionPicker,
44
46
  HighlightsClient: () => HighlightsClient,
45
47
  LanguagesClient: () => LanguagesClient,
46
48
  MemoryStorageStrategy: () => MemoryStorageStrategy,
@@ -12614,7 +12616,7 @@ var ApiClient = class {
12614
12616
  /**
12615
12617
  * Creates an instance of ApiClient.
12616
12618
  *
12617
- * @param config - The API configuration object containing baseUrl, timeout, and appId.
12619
+ * @param config - The API configuration object containing baseUrl, timeout, and appKey.
12618
12620
  */
12619
12621
  constructor(config2) {
12620
12622
  __publicField(this, "baseURL");
@@ -12622,14 +12624,19 @@ var ApiClient = class {
12622
12624
  __publicField(this, "defaultHeaders");
12623
12625
  __publicField(this, "config");
12624
12626
  this.config = {
12625
- version: config2.version || "v1",
12626
12627
  ...config2
12627
12628
  };
12628
- this.baseURL = config2.baseUrl || "https://api-dev.youversion.com";
12629
+ const apiHost = config2.apiHost ?? process.env.YVP_API_HOST ?? "api.youversion.com";
12630
+ if (!apiHost) {
12631
+ throw new Error(
12632
+ "ApiClient requires a host name. Provide an apiHost in the config or set the YVP_API_HOST environment variable."
12633
+ );
12634
+ }
12635
+ this.baseURL = "https://" + apiHost;
12629
12636
  this.timeout = config2.timeout || 1e4;
12630
12637
  this.defaultHeaders = {
12631
12638
  "Content-Type": "application/json",
12632
- "X-YVP-App-Key": this.config.appId,
12639
+ "X-YVP-App-Key": this.config.appKey,
12633
12640
  "X-YVP-Installation-Id": this.config.installationId || "web-sdk-default"
12634
12641
  };
12635
12642
  }
@@ -12768,9 +12775,6 @@ var BibleClient = class {
12768
12775
  __publicField(this, "booleanSchema", external_exports.boolean());
12769
12776
  this.client = client;
12770
12777
  }
12771
- get rootPath() {
12772
- return `/${this.client.config.version}`;
12773
- }
12774
12778
  /**
12775
12779
  * Fetches a collection of Bible versions filtered by language ranges.
12776
12780
  *
@@ -12786,7 +12790,7 @@ var BibleClient = class {
12786
12790
  if (license_id !== void 0) {
12787
12791
  params.license_id = license_id;
12788
12792
  }
12789
- return this.client.get(`${this.rootPath}/bibles`, params);
12793
+ return this.client.get(`/v1/bibles`, params);
12790
12794
  }
12791
12795
  /**
12792
12796
  * Fetches a Bible version by its ID.
@@ -12795,7 +12799,7 @@ var BibleClient = class {
12795
12799
  */
12796
12800
  async getVersion(id) {
12797
12801
  this.versionIdSchema.parse(id);
12798
- return this.client.get(`${this.rootPath}/bibles/${id}`);
12802
+ return this.client.get(`/v1/bibles/${id}`);
12799
12803
  }
12800
12804
  /**
12801
12805
  * Fetches all books for a given Bible version.
@@ -12805,7 +12809,7 @@ var BibleClient = class {
12805
12809
  */
12806
12810
  async getBooks(versionId, canon) {
12807
12811
  this.versionIdSchema.parse(versionId);
12808
- return this.client.get(`${this.rootPath}/bibles/${versionId}/books`, {
12812
+ return this.client.get(`/v1/bibles/${versionId}/books`, {
12809
12813
  ...canon && { canon }
12810
12814
  });
12811
12815
  }
@@ -12818,7 +12822,7 @@ var BibleClient = class {
12818
12822
  async getBook(versionId, book) {
12819
12823
  this.versionIdSchema.parse(versionId);
12820
12824
  this.bookSchema.parse(book);
12821
- return this.client.get(`${this.rootPath}/bibles/${versionId}/books/${book}`);
12825
+ return this.client.get(`/v1/bibles/${versionId}/books/${book}`);
12822
12826
  }
12823
12827
  /**
12824
12828
  * Fetches all chapters for a specific book in a version.
@@ -12830,7 +12834,7 @@ var BibleClient = class {
12830
12834
  this.versionIdSchema.parse(versionId);
12831
12835
  this.bookSchema.parse(book);
12832
12836
  return this.client.get(
12833
- `${this.rootPath}/bibles/${versionId}/books/${book}/chapters`
12837
+ `/v1/bibles/${versionId}/books/${book}/chapters`
12834
12838
  );
12835
12839
  }
12836
12840
  /**
@@ -12845,7 +12849,7 @@ var BibleClient = class {
12845
12849
  this.bookSchema.parse(book);
12846
12850
  this.chapterSchema.parse(chapter);
12847
12851
  return this.client.get(
12848
- `${this.rootPath}/bibles/${versionId}/books/${book}/chapters/${chapter}`
12852
+ `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}`
12849
12853
  );
12850
12854
  }
12851
12855
  /**
@@ -12860,7 +12864,7 @@ var BibleClient = class {
12860
12864
  this.bookSchema.parse(book);
12861
12865
  this.chapterSchema.parse(chapter);
12862
12866
  return this.client.get(
12863
- `${this.rootPath}/bibles/${versionId}/books/${book}/chapters/${chapter}/verses`
12867
+ `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}/verses`
12864
12868
  );
12865
12869
  }
12866
12870
  /**
@@ -12877,7 +12881,7 @@ var BibleClient = class {
12877
12881
  this.chapterSchema.parse(chapter);
12878
12882
  this.verseSchema.parse(verse);
12879
12883
  return this.client.get(
12880
- `${this.rootPath}/bibles/${versionId}/books/${book}/chapters/${chapter}/verses/${verse}`
12884
+ `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}/verses/${verse}`
12881
12885
  );
12882
12886
  }
12883
12887
  /**
@@ -12918,10 +12922,7 @@ var BibleClient = class {
12918
12922
  if (include_notes !== void 0) {
12919
12923
  params.include_notes = include_notes;
12920
12924
  }
12921
- return this.client.get(
12922
- `${this.rootPath}/bibles/${versionId}/passages/${usfm}`,
12923
- params
12924
- );
12925
+ return this.client.get(`/v1/bibles/${versionId}/passages/${usfm}`, params);
12925
12926
  }
12926
12927
  /**
12927
12928
  * Fetches the indexing structure for a Bible version.
@@ -12930,14 +12931,14 @@ var BibleClient = class {
12930
12931
  */
12931
12932
  async getIndex(versionId) {
12932
12933
  this.versionIdSchema.parse(versionId);
12933
- return this.client.get(`${this.rootPath}/bibles/${versionId}/index`);
12934
+ return this.client.get(`/v1/bibles/${versionId}/index`);
12934
12935
  }
12935
12936
  /**
12936
12937
  * Fetches the verse of the day calendar for an entire year.
12937
12938
  * @returns A collection of VOTD objects for all days of the year.
12938
12939
  */
12939
12940
  async getAllVOTDs() {
12940
- return this.client.get(`${this.rootPath}/verse_of_the_days`);
12941
+ return this.client.get(`/v1/verse_of_the_days`);
12941
12942
  }
12942
12943
  /**
12943
12944
  * Fetches the passage_id for the Verse Of The Day.
@@ -12955,7 +12956,7 @@ var BibleClient = class {
12955
12956
  async getVOTD(day) {
12956
12957
  const daySchema = external_exports.number().int().min(1).max(366);
12957
12958
  daySchema.parse(day);
12958
- return this.client.get(`${this.rootPath}/verse_of_the_days/${day}`);
12959
+ return this.client.get(`/v1/verse_of_the_days/${day}`);
12959
12960
  }
12960
12961
  };
12961
12962
  var LanguagesClient = class {
@@ -12972,9 +12973,6 @@ var LanguagesClient = class {
12972
12973
  __publicField(this, "countrySchema", external_exports.string().trim().length(2, "Country code must be a 2-character ISO 3166-1 alpha-2 code").toUpperCase());
12973
12974
  this.client = client;
12974
12975
  }
12975
- get rootPath() {
12976
- return `/${this.client.config.version}`;
12977
- }
12978
12976
  /**
12979
12977
  * Fetches a collection of languages supported in the Platform.
12980
12978
  * @param options Query parameters for pagination and filtering (country is required).
@@ -12992,7 +12990,7 @@ var LanguagesClient = class {
12992
12990
  if (options.page_token !== void 0) {
12993
12991
  params.page_token = options.page_token;
12994
12992
  }
12995
- return this.client.get(`${this.rootPath}/languages`, params);
12993
+ return this.client.get(`/v1/languages`, params);
12996
12994
  }
12997
12995
  /**
12998
12996
  * Fetches details about a specific language in the Platform.
@@ -13001,7 +12999,7 @@ var LanguagesClient = class {
13001
12999
  */
13002
13000
  async getLanguage(languageId) {
13003
13001
  this.languageIdSchema.parse(languageId);
13004
- return this.client.get(`${this.rootPath}/languages/${languageId}`);
13002
+ return this.client.get(`/v1/languages/${languageId}`);
13005
13003
  }
13006
13004
  };
13007
13005
  var _a;
@@ -13018,11 +13016,11 @@ var YouVersionPlatformConfiguration = (_a = class {
13018
13016
  localStorage.setItem("x-yvp-installation-id", newId);
13019
13017
  return newId;
13020
13018
  }
13021
- static get appId() {
13022
- return this._appId;
13019
+ static get appKey() {
13020
+ return this._appKey;
13023
13021
  }
13024
- static set appId(value) {
13025
- this._appId = value;
13022
+ static set appKey(value) {
13023
+ this._appKey = value;
13026
13024
  }
13027
13025
  static get installationId() {
13028
13026
  if (!this._installationId) {
@@ -13060,7 +13058,7 @@ var YouVersionPlatformConfiguration = (_a = class {
13060
13058
  static set previewUserInfo(value) {
13061
13059
  this._previewUserInfo = value;
13062
13060
  }
13063
- }, __publicField(_a, "_appId", null), __publicField(_a, "_installationId", null), __publicField(_a, "_accessToken", null), __publicField(_a, "_apiHost", "api-dev.youversion.com"), __publicField(_a, "_isPreviewMode", false), __publicField(_a, "_previewUserInfo", null), _a);
13061
+ }, __publicField(_a, "_appKey", null), __publicField(_a, "_installationId", null), __publicField(_a, "_accessToken", null), __publicField(_a, "_apiHost", "api.youversion.com"), __publicField(_a, "_isPreviewMode", false), __publicField(_a, "_previewUserInfo", null), _a);
13064
13062
  var HighlightsClient = class {
13065
13063
  /**
13066
13064
  * Creates a new HighlightsClient instance.
@@ -13073,9 +13071,6 @@ var HighlightsClient = class {
13073
13071
  __publicField(this, "colorSchema", external_exports.string().regex(/^[0-9a-f]{6}$/i, "Color must be a 6-character hex string without #"));
13074
13072
  this.client = client;
13075
13073
  }
13076
- get rootPath() {
13077
- return `/${this.client.config.version}`;
13078
- }
13079
13074
  /**
13080
13075
  * Gets the authentication token, either from the provided parameter or from the platform configuration.
13081
13076
  * @param lat Optional explicit long access token. If not provided, retrieves from YouVersionPlatformConfiguration.
@@ -13145,7 +13140,7 @@ var HighlightsClient = class {
13145
13140
  this.validatePassageId(options.passage_id);
13146
13141
  params.passage_id = options.passage_id;
13147
13142
  }
13148
- return this.client.get(`${this.rootPath}/highlights`, params);
13143
+ return this.client.get(`/v1/highlights`, params);
13149
13144
  }
13150
13145
  /**
13151
13146
  * Creates or updates a highlight on a passage.
@@ -13160,7 +13155,7 @@ var HighlightsClient = class {
13160
13155
  this.validatePassageId(data.passage_id);
13161
13156
  this.validateColor(data.color);
13162
13157
  const token = this.getAuthToken(lat);
13163
- return this.client.post(`${this.rootPath}/highlights`, data, { lat: token });
13158
+ return this.client.post(`/v1/highlights`, data, { lat: token });
13164
13159
  }
13165
13160
  /**
13166
13161
  * Clears highlights for a passage.
@@ -13180,7 +13175,7 @@ var HighlightsClient = class {
13180
13175
  this.validateVersionId(options.version_id);
13181
13176
  params.version_id = options.version_id;
13182
13177
  }
13183
- await this.client.delete(`${this.rootPath}/highlights/${passageId}`, params);
13178
+ await this.client.delete(`/v1/highlights/${passageId}`, params);
13184
13179
  }
13185
13180
  };
13186
13181
  var AuthClient = class {
@@ -13464,13 +13459,13 @@ var YouVersionAPI = class {
13464
13459
  Accept: "application/json",
13465
13460
  "Content-Type": "application/json"
13466
13461
  };
13467
- const appId = YouVersionPlatformConfiguration.appId;
13468
- if (appId) {
13469
- headers["X-App-Id"] = appId;
13462
+ const appKey = YouVersionPlatformConfiguration.appKey;
13463
+ if (appKey) {
13464
+ headers["X-YVP-App-Key"] = appKey;
13470
13465
  }
13471
13466
  const installationId = YouVersionPlatformConfiguration.installationId;
13472
13467
  if (installationId) {
13473
- headers["x-yvp-installation-id"] = installationId;
13468
+ headers["X-YVP-Installation-ID"] = installationId;
13474
13469
  }
13475
13470
  const request = new Request(url2.toString(), {
13476
13471
  headers
@@ -13482,15 +13477,15 @@ var URLBuilder = class {
13482
13477
  static get baseURL() {
13483
13478
  return new URL(`https://${YouVersionPlatformConfiguration.apiHost}`);
13484
13479
  }
13485
- static authURL(appId, requiredPermissions = /* @__PURE__ */ new Set(), optionalPermissions = /* @__PURE__ */ new Set()) {
13486
- if (typeof appId !== "string" || appId.trim().length === 0) {
13487
- throw new Error("appId must be a non-empty string");
13480
+ static authURL(appKey, requiredPermissions = /* @__PURE__ */ new Set(), optionalPermissions = /* @__PURE__ */ new Set()) {
13481
+ if (typeof appKey !== "string" || appKey.trim().length === 0) {
13482
+ throw new Error("appKey must be a non-empty string");
13488
13483
  }
13489
13484
  try {
13490
13485
  const url2 = new URL(this.baseURL);
13491
13486
  url2.pathname = "/auth/login";
13492
13487
  const searchParams = new URLSearchParams();
13493
- searchParams.append("app_id", appId);
13488
+ searchParams.append("APP_KEY", appKey);
13494
13489
  searchParams.append("language", "en");
13495
13490
  if (requiredPermissions.size > 0) {
13496
13491
  const requiredList = Array.from(requiredPermissions).map((p) => p.toString());
@@ -13552,11 +13547,11 @@ var YouVersionAPIUsers = class {
13552
13547
  if (!optionalPermissions || !(optionalPermissions instanceof Set)) {
13553
13548
  throw new Error("Invalid optionalPermissions: must be a Set");
13554
13549
  }
13555
- const appId = YouVersionPlatformConfiguration.appId;
13556
- if (!appId) {
13557
- throw new Error("YouVersionPlatformConfiguration.appId must be set before calling signIn");
13550
+ const appKey = YouVersionPlatformConfiguration.appKey;
13551
+ if (!appKey) {
13552
+ throw new Error("YouVersionPlatformConfiguration.appKey must be set before calling signIn");
13558
13553
  }
13559
- const url2 = URLBuilder.authURL(appId, requiredPermissions, optionalPermissions);
13554
+ const url2 = URLBuilder.authURL(appKey, requiredPermissions, optionalPermissions);
13560
13555
  const strategy = AuthenticationStrategyRegistry.get();
13561
13556
  const callbackUrl = await strategy.authenticate(url2);
13562
13557
  const result = new SignInWithYouVersionResult(callbackUrl);
@@ -14202,7 +14197,7 @@ function Root3({
14202
14197
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
14203
14198
  Accordion,
14204
14199
  {
14205
- className: "yv:relative yv:overflow-y-auto yv:bg-background yv:mx-6 yv:shadow-[inset_0_-16px_16px_-12px_rgba(0,0,0,0.1)]",
14200
+ className: "yv:relative yv:overflow-y-auto yv:bg-background yv:mx-6",
14206
14201
  type: "single",
14207
14202
  collapsible: true,
14208
14203
  defaultValue: defaultBook || book || "GEN",
@@ -14270,204 +14265,929 @@ function Trigger3({ asChild = true, children, ...props }) {
14270
14265
  const { books, loading } = (0, import_platform_react_hooks.useBooks)(versionId);
14271
14266
  const currentBook = books?.data?.find((bookItem) => bookItem.id === book);
14272
14267
  const buttonText = loading ? "Loading..." : `${currentBook?.title || "Select a chapter"}${chapter ? ` ${chapter}` : ""}`;
14273
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverTrigger, { asChild, ...props, children: children || /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { variant: background === "light" ? "outline" : "default", children: buttonText }) });
14268
+ const content = typeof children === "function" ? children({ book, chapter, currentBook, loading }) : children || /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { variant: background === "light" ? "outline" : "default", children: buttonText });
14269
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverTrigger, { asChild, ...props, children: content });
14274
14270
  }
14275
14271
  var BibleChapterPicker = Object.assign({}, { Root: Root3, Trigger: Trigger3 });
14276
14272
 
14277
- // src/components/SignInButton.tsx
14278
- var import_react5 = __toESM(require("react"), 1);
14279
- var import_lucide_react3 = require("lucide-react");
14280
-
14281
- // src/providers/YVPProvider.tsx
14282
- var import_react3 = require("react");
14273
+ // src/components/bible-reader.tsx
14274
+ var import_react4 = require("react");
14275
+ var import_react_use_controllable_state3 = require("@radix-ui/react-use-controllable-state");
14276
+ var import_platform_react_hooks4 = require("@youversion/platform-react-hooks");
14283
14277
 
14284
- // src/providers/YVPErrorBoundary.tsx
14278
+ // src/components/bible-version-picker.tsx
14285
14279
  var import_react2 = require("react");
14280
+ var import_react_use_controllable_state2 = require("@radix-ui/react-use-controllable-state");
14281
+ var import_platform_react_hooks2 = require("@youversion/platform-react-hooks");
14282
+
14283
+ // src/components/ui/item.tsx
14284
+ var React6 = require("react");
14285
+ var import_react_slot2 = require("@radix-ui/react-slot");
14286
+ var import_class_variance_authority3 = require("class-variance-authority");
14286
14287
  var import_jsx_runtime7 = require("react/jsx-runtime");
14287
- var YVPErrorBoundary = class extends import_react2.Component {
14288
- constructor(props) {
14289
- super(props);
14290
- this.state = { hasError: false, error: null };
14291
- }
14292
- static getDerivedStateFromError(error46) {
14293
- return { hasError: true, error: error46 };
14294
- }
14295
- componentDidCatch(error46, errorInfo) {
14296
- const { onError } = this.props;
14297
- if (onError) {
14298
- onError(error46, errorInfo);
14288
+ function ItemGroup({ className, ...props }) {
14289
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
14290
+ "div",
14291
+ {
14292
+ role: "list",
14293
+ "data-slot": "item-group",
14294
+ className: cn("yv:group/item-group yv:flex yv:flex-col", className),
14295
+ ...props
14299
14296
  }
14300
- if (process.env.NODE_ENV === "development") {
14301
- console.error("YVP Error Boundary caught error:", error46, errorInfo);
14297
+ );
14298
+ }
14299
+ var itemVariants = (0, import_class_variance_authority3.cva)(
14300
+ "yv:group/item yv:flex yv:items-center yv:border yv:border-transparent yv:text-sm yv:rounded-md yv:transition-colors yv:[a]:hover:bg-accent/50 yv:[a]:transition-colors yv:duration-100 yv:flex-wrap yv:outline-none yv:focus-visible:border-ring yv:focus-visible:ring-ring/50 yv:focus-visible:ring-[3px]",
14301
+ {
14302
+ variants: {
14303
+ variant: {
14304
+ default: "yv:bg-transparent",
14305
+ outline: "yv:border-border",
14306
+ muted: "yv:bg-muted/50"
14307
+ },
14308
+ size: {
14309
+ default: "yv:p-4 yv:gap-4 yv:",
14310
+ sm: "yv:py-3 yv:px-4 yv:gap-2.5"
14311
+ }
14312
+ },
14313
+ defaultVariants: {
14314
+ variant: "default",
14315
+ size: "default"
14302
14316
  }
14303
14317
  }
14304
- render() {
14305
- const { hasError, error: error46 } = this.state;
14306
- const { children, fallback } = this.props;
14307
- const isDevelopment = process.env.NODE_ENV === "development";
14308
- if (hasError) {
14309
- if (fallback) {
14310
- return fallback;
14318
+ );
14319
+ function Item2({
14320
+ className,
14321
+ variant = "default",
14322
+ size = "default",
14323
+ asChild = false,
14324
+ ...props
14325
+ }) {
14326
+ const Comp = asChild ? import_react_slot2.Slot : "div";
14327
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
14328
+ Comp,
14329
+ {
14330
+ "data-slot": "item",
14331
+ "data-variant": variant,
14332
+ "data-size": size,
14333
+ className: cn(itemVariants({ variant, size, className })),
14334
+ ...props
14335
+ }
14336
+ );
14337
+ }
14338
+ var itemMediaVariants = (0, import_class_variance_authority3.cva)(
14339
+ "yv:flex yv:shrink-0 yv:items-center yv:justify-center yv:gap-2 yv:group-has-[[data-slot=item-description]]/item:self-start yv:[&_svg]:pointer-events-none yv:group-has-[[data-slot=item-description]]/item:translate-y-0.5",
14340
+ {
14341
+ variants: {
14342
+ variant: {
14343
+ default: "yv:bg-transparent",
14344
+ icon: "yv:size-8 yv:border yv:rounded-sm yv:bg-muted yv:[&_svg:not([class*=size-])]:size-4",
14345
+ image: "yv:size-10 yv:rounded-sm yv:overflow-hidden yv:[&_img]:size-full yv:[&_img]:object-cover"
14311
14346
  }
14312
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { padding: "20px", textAlign: "center" }, children: [
14313
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { children: "Something went wrong" }),
14314
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: "We encountered an error while loading YouVersion Platform components." }),
14315
- isDevelopment && error46 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { style: { marginTop: "10px" }, children: [
14316
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("summary", { children: "Error details (development only)" }),
14317
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("pre", { style: { textAlign: "left", overflow: "auto" }, children: error46.toString() })
14318
- ] })
14319
- ] });
14347
+ },
14348
+ defaultVariants: {
14349
+ variant: "default"
14320
14350
  }
14321
- return children;
14322
14351
  }
14323
- };
14352
+ );
14353
+ function ItemMedia({
14354
+ className,
14355
+ variant = "default",
14356
+ ...props
14357
+ }) {
14358
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
14359
+ "div",
14360
+ {
14361
+ "data-slot": "item-media",
14362
+ "data-variant": variant,
14363
+ className: cn(itemMediaVariants({ variant, className })),
14364
+ ...props
14365
+ }
14366
+ );
14367
+ }
14368
+ function ItemContent({ className, ...props }) {
14369
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
14370
+ "div",
14371
+ {
14372
+ "data-slot": "item-content",
14373
+ className: cn(
14374
+ "yv:flex yv:flex-1 yv:flex-col yv:gap-1 yv:[&+[data-slot=item-content]]:flex-none",
14375
+ className
14376
+ ),
14377
+ ...props
14378
+ }
14379
+ );
14380
+ }
14381
+ function ItemTitle({ className, ...props }) {
14382
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
14383
+ "div",
14384
+ {
14385
+ "data-slot": "item-title",
14386
+ className: cn(
14387
+ "yv:flex yv:w-fit yv:items-center yv:gap-2 yv:text-sm yv:leading-snug yv:font-medium",
14388
+ className
14389
+ ),
14390
+ ...props
14391
+ }
14392
+ );
14393
+ }
14394
+ function ItemDescription({ className, ...props }) {
14395
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
14396
+ "p",
14397
+ {
14398
+ "data-slot": "item-description",
14399
+ className: cn(
14400
+ "yv:text-muted-foreground yv:line-clamp-2 yv:text-sm yv:leading-normal yv:font-normal yv:text-balance",
14401
+ "yv:[&>a:hover]:text-primary yv:[&>a]:underline yv:[&>a]:underline-offset-4",
14402
+ className
14403
+ ),
14404
+ ...props
14405
+ }
14406
+ );
14407
+ }
14324
14408
 
14325
- // src/providers/YVPProvider.tsx
14409
+ // src/components/bible-version-picker.tsx
14410
+ var import_lucide_react3 = require("lucide-react");
14411
+
14412
+ // src/components/ui/badge.tsx
14413
+ var React7 = require("react");
14414
+ var import_react_slot3 = require("@radix-ui/react-slot");
14415
+ var import_class_variance_authority4 = require("class-variance-authority");
14326
14416
  var import_jsx_runtime8 = require("react/jsx-runtime");
14327
- var YVPContext = (0, import_react3.createContext)(null);
14328
- function YVPProvider({
14329
- config: config2,
14330
- children,
14331
- errorFallback,
14332
- onError,
14333
- theme = "light"
14334
- }) {
14335
- const [authState, setAuthState] = (0, import_react3.useState)({
14336
- isAuthenticated: false,
14337
- isLoading: false,
14338
- accessToken: null,
14339
- result: null,
14340
- error: null
14341
- });
14342
- (0, import_react3.useEffect)(() => {
14343
- const initializeAuth = () => {
14344
- YouVersionPlatformConfiguration.appId = config2.appId;
14345
- YouVersionPlatformConfiguration.installationId = config2.installationId ?? null;
14346
- const strategy = new WebAuthenticationStrategy({
14347
- redirectUri: config2.redirectUri || ""
14348
- });
14349
- AuthenticationStrategyRegistry.register(strategy);
14350
- const existingToken = YouVersionPlatformConfiguration.accessToken;
14351
- if (existingToken) {
14352
- setAuthState({
14353
- isAuthenticated: true,
14354
- isLoading: false,
14355
- accessToken: existingToken,
14356
- result: null,
14357
- error: null
14358
- });
14359
- return;
14360
- }
14361
- WebAuthenticationStrategy.handleCallback();
14362
- const storedCallback = WebAuthenticationStrategy.getStoredCallback();
14363
- if (storedCallback) {
14364
- try {
14365
- const result = new SignInWithYouVersionResult(storedCallback);
14366
- const { accessToken, errorMsg } = result;
14367
- if (accessToken) {
14368
- YouVersionPlatformConfiguration.setAccessToken(accessToken);
14369
- }
14370
- setAuthState({
14371
- isAuthenticated: !!accessToken,
14372
- isLoading: false,
14373
- accessToken: accessToken ?? null,
14374
- result,
14375
- error: errorMsg ? new Error(errorMsg) : null
14376
- });
14377
- } catch (error46) {
14378
- setAuthState({
14379
- isAuthenticated: false,
14380
- isLoading: false,
14381
- accessToken: null,
14382
- result: null,
14383
- error: error46
14384
- });
14385
- }
14386
- } else {
14387
- setAuthState({
14388
- isAuthenticated: false,
14389
- isLoading: false,
14390
- accessToken: null,
14391
- result: null,
14392
- error: null
14393
- });
14417
+ var badgeVariants = (0, import_class_variance_authority4.cva)(
14418
+ "yv:inline-flex yv:items-center yv:justify-center yv:rounded-full yv:border yv:px-2 yv:py-0.5 yv:text-xs yv:font-medium yv:w-fit yv:whitespace-nowrap yv:shrink-0 yv:[&>svg]:size-3 yv:gap-1 yv:[&>svg]:pointer-events-none yv:focus-visible:border-ring yv:focus-visible:ring-ring/50 yv:focus-visible:ring-[3px] yv:aria-invalid:ring-destructive/20 yv:dark:aria-invalid:ring-destructive/40 yv:aria-invalid:border-destructive yv:transition-[color,box-shadow] yv:overflow-hidden",
14419
+ {
14420
+ variants: {
14421
+ variant: {
14422
+ default: "yv:border-transparent yv:bg-primary yv:text-primary-foreground yv:[a&]:hover:bg-primary/90",
14423
+ secondary: "yv:border-transparent yv:bg-muted yv:text-muted-foreground yv:[a&]:hover:bg-muted/90",
14424
+ destructive: "yv:border-transparent yv:bg-destructive yv:text-white yv:[a&]:hover:bg-destructive/90 yv:focus-visible:ring-destructive/20 yv:dark:focus-visible:ring-destructive/40 yv:dark:bg-destructive/60",
14425
+ outline: "yv:text-foreground yv:[a&]:hover:bg-accent yv:[a&]:hover:text-accent-foreground"
14394
14426
  }
14395
- };
14396
- initializeAuth();
14397
- }, [config2.appId, config2.installationId, config2.redirectUri]);
14398
- const signOut = (0, import_react3.useCallback)(() => {
14399
- YouVersionPlatformConfiguration.setAccessToken(null);
14400
- setAuthState({
14401
- isAuthenticated: false,
14402
- isLoading: false,
14403
- accessToken: null,
14404
- result: null,
14405
- error: null
14406
- });
14407
- }, []);
14408
- const fetchUserInfo = (0, import_react3.useCallback)(async () => {
14409
- if (!authState.isAuthenticated || !authState.accessToken) {
14410
- throw new Error("User is not authenticated");
14427
+ },
14428
+ defaultVariants: {
14429
+ variant: "default"
14411
14430
  }
14412
- return YouVersionAPIUsers.userInfo(authState.accessToken);
14413
- }, [authState.isAuthenticated, authState.accessToken]);
14414
- const value = {
14415
- config: config2,
14416
- client: ApiClient,
14417
- auth: authState,
14418
- signOut,
14419
- fetchUserInfo
14420
- };
14421
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(YVPErrorBoundary, { fallback: errorFallback, onError, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(YVPContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "yv:contents", "data-yv-sdk": true, "data-yv-theme": theme, children }) }) });
14431
+ }
14432
+ );
14433
+ function Badge({
14434
+ className,
14435
+ variant,
14436
+ asChild = false,
14437
+ ...props
14438
+ }) {
14439
+ const Comp = asChild ? import_react_slot3.Slot : "span";
14440
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Comp, { "data-slot": "badge", className: cn(badgeVariants({ variant }), className), ...props });
14422
14441
  }
14423
- function useYVP() {
14424
- const context = (0, import_react3.useContext)(YVPContext);
14442
+
14443
+ // src/components/bible-version-picker.tsx
14444
+ var import_jsx_runtime9 = require("react/jsx-runtime");
14445
+ var BibleVersionPickerContext = (0, import_react2.createContext)(null);
14446
+ function useBibleVersionPickerContext() {
14447
+ const context = (0, import_react2.useContext)(BibleVersionPickerContext);
14425
14448
  if (!context) {
14426
- throw new Error("useYVP must be used within a YVPProvider");
14449
+ throw new Error("BibleVersionPicker components must be used within BibleVersionPicker.Root");
14427
14450
  }
14428
14451
  return context;
14429
14452
  }
14430
-
14431
- // src/hooks/useAuthentication.ts
14432
- var import_react4 = require("react");
14433
- function useAuthentication() {
14434
- const { auth, signOut, fetchUserInfo, client: _client } = useYVP();
14435
- const signIn = (0, import_react4.useCallback)(
14436
- async (requiredPermissions = [], optionalPermissions = []) => {
14437
- return await YouVersionAPIUsers.signIn(
14438
- new Set(requiredPermissions),
14439
- new Set(optionalPermissions)
14440
- );
14441
- },
14442
- []
14453
+ function Root4({
14454
+ versionId: controlledVersionId,
14455
+ onVersionChange,
14456
+ background = "light",
14457
+ side = "top",
14458
+ children
14459
+ }) {
14460
+ const [versionId, setVersionIdState] = (0, import_react_use_controllable_state2.useControllableState)({
14461
+ prop: controlledVersionId,
14462
+ defaultProp: controlledVersionId,
14463
+ onChange: onVersionChange
14464
+ });
14465
+ const [selectedLanguageId, setSelectedLanguageId] = (0, import_react2.useState)("en");
14466
+ const [searchQuery, setSearchQuery] = (0, import_react2.useState)("");
14467
+ const [isLanguagesOpen, setIsLanguagesOpen] = (0, import_react2.useState)(false);
14468
+ const { languages: hookLanguages } = (0, import_platform_react_hooks2.useLanguages)({ country: "US" });
14469
+ const languages = (0, import_react2.useMemo)(() => {
14470
+ if (hookLanguages?.data && hookLanguages.data.length > 0) {
14471
+ return hookLanguages.data.map((lang) => ({
14472
+ id: lang.id || "",
14473
+ englishName: lang.display_names?.en || lang.language,
14474
+ name: lang.display_names?.[lang.id] || lang.language
14475
+ }));
14476
+ }
14477
+ return [];
14478
+ }, [hookLanguages?.data]);
14479
+ const { versions } = (0, import_platform_react_hooks2.useVersions)(selectedLanguageId);
14480
+ const filteredVersions = (0, import_platform_react_hooks2.useFilteredVersions)(
14481
+ versions?.data || [],
14482
+ searchQuery,
14483
+ selectedLanguageId
14443
14484
  );
14444
- return {
14445
- auth,
14446
- signIn,
14447
- signOut,
14448
- fetchUserInfo
14449
- };
14485
+ const contextValue = {
14486
+ versionId,
14487
+ setVersionId: setVersionIdState,
14488
+ background,
14489
+ side,
14490
+ languages,
14491
+ selectedLanguageId,
14492
+ setSelectedLanguageId,
14493
+ searchQuery,
14494
+ setSearchQuery,
14495
+ filteredVersions,
14496
+ isLanguagesOpen,
14497
+ setIsLanguagesOpen
14498
+ };
14499
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(BibleVersionPickerContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Popover, { children }) });
14500
+ }
14501
+ function Trigger4({ asChild = true, children, ...props }) {
14502
+ const { versionId, background } = useBibleVersionPickerContext();
14503
+ const { version: version2, loading } = (0, import_platform_react_hooks2.useVersion)(versionId);
14504
+ const content = typeof children === "function" ? children({ version: version2, loading }) : children || /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
14505
+ Button,
14506
+ {
14507
+ variant: background === "light" ? "outline" : "default",
14508
+ className: "yv:cursor-pointer",
14509
+ children: version2?.local_abbreviation || "Select"
14510
+ }
14511
+ );
14512
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PopoverTrigger, { asChild, ...props, children: content });
14450
14513
  }
14451
-
14452
- // src/components/youversion-logo.tsx
14453
- var React8 = require("react");
14454
- var import_jsx_runtime9 = require("react/jsx-runtime");
14455
- function YouVersionLogo(props) {
14514
+ function Content3() {
14515
+ const {
14516
+ searchQuery,
14517
+ setSearchQuery,
14518
+ filteredVersions,
14519
+ versionId,
14520
+ setVersionId,
14521
+ background,
14522
+ side,
14523
+ setIsLanguagesOpen,
14524
+ isLanguagesOpen,
14525
+ languages,
14526
+ selectedLanguageId,
14527
+ setSelectedLanguageId
14528
+ } = useBibleVersionPickerContext();
14529
+ const closeRef = (0, import_react2.useRef)(null);
14530
+ const handleSelectLanguage = (languageId) => {
14531
+ setSelectedLanguageId(languageId);
14532
+ setIsLanguagesOpen(false);
14533
+ };
14534
+ const handleSelectVersion = (versionId2) => {
14535
+ setVersionId(versionId2);
14536
+ setIsLanguagesOpen(false);
14537
+ closeRef.current?.click();
14538
+ };
14456
14539
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
14457
- "svg",
14540
+ PopoverContent,
14458
14541
  {
14459
- xmlns: "http://www.w3.org/2000/svg",
14460
- fill: "none",
14461
- viewBox: "0 0 26 26",
14462
- role: "img",
14463
- "aria-label": "YouVersion",
14464
- ...props,
14542
+ "data-yv-sdk": true,
14543
+ "data-yv-theme": background === "dark" ? "dark" : "light",
14544
+ side,
14545
+ className: "yv:flex yv:flex-col yv:bg-background yv:p-0 yv:h-[66vh] yv:max-h-[66vh] yv:w-96 yv:sm:w-sm yv:overflow-hidden yv:rounded-2xl yv:border-0 yv:shadow-lg",
14465
14546
  children: [
14466
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
14467
- "mask",
14547
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
14548
+ "div",
14468
14549
  {
14469
- id: "youversion-logo-mask",
14470
- width: 26,
14550
+ className: `yv:h-[66vh] yv:absolute yv:inset-0 yv:flex yv:flex-col yv:transition-all yv:duration-300 yv:rounded-2xl yv:origin-center ${isLanguagesOpen ? "yv:opacity-0 yv:pointer-events-none yv:blur-sm yv:scale-95" : "yv:opacity-100 yv:pointer-events-auto yv:blur-none yv:scale-100"}`,
14551
+ children: [
14552
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("section", { className: "yv:bg-muted yv:py-3 yv:w-full yv:rounded-t-2xl yv:px-4 yv:border-b yv:border-border yv:flex yv:flex-row yv:justify-between yv:items-center", children: [
14553
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "yv:flex yv:flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h2", { className: "yv:font-bold yv:text-base yv:line-clamp-1", children: "Bible Versions" }) }),
14554
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "yv:flex yv:items-center yv:gap-2", children: [
14555
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
14556
+ Button,
14557
+ {
14558
+ "aria-label": "Select language",
14559
+ className: "yv:bg-card yv:border yv:border-transparent yv:hover:bg-card yv:hover:border-border",
14560
+ size: "sm",
14561
+ onClick: () => setIsLanguagesOpen(true),
14562
+ variant: "secondary",
14563
+ children: [
14564
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Globe, { size: 16 }),
14565
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "yv:text-sm yv:font-medium yv:line-clamp-1", children: languages.find((language) => language.id === selectedLanguageId)?.englishName }),
14566
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
14567
+ Badge,
14568
+ {
14569
+ variant: "secondary",
14570
+ className: "yv:h-5 yv:min-w-5 yv:rounded-full yv:px-1 yv:font-mono yv:tabular-nums",
14571
+ children: filteredVersions.length
14572
+ }
14573
+ )
14574
+ ]
14575
+ }
14576
+ ),
14577
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PopoverClose, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
14578
+ Button,
14579
+ {
14580
+ ref: closeRef,
14581
+ variant: "ghost",
14582
+ size: "icon",
14583
+ className: "yv:w-8 yv:h-8 yv:text-muted-foreground",
14584
+ children: [
14585
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.X, { size: 16 }),
14586
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "yv:sr-only", children: "Close version selector" })
14587
+ ]
14588
+ }
14589
+ ) })
14590
+ ] })
14591
+ ] }),
14592
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "yv:flex-1 yv:overflow-y-auto yv:py-2", children: filteredVersions && filteredVersions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ItemGroup, { children: filteredVersions.map((version2) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
14593
+ Item2,
14594
+ {
14595
+ className: cn(
14596
+ "yv:hover:bg-muted yv:rounded-[8px]",
14597
+ versionId === version2.id ? "yv:bg-muted" : ""
14598
+ ),
14599
+ size: "sm",
14600
+ variant: "default",
14601
+ role: "listitem",
14602
+ asChild: true,
14603
+ "aria-label": version2.title,
14604
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
14605
+ "button",
14606
+ {
14607
+ type: "button",
14608
+ className: "yv:w-full",
14609
+ onClick: () => handleSelectVersion(version2.id),
14610
+ children: [
14611
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
14612
+ ItemMedia,
14613
+ {
14614
+ variant: "icon",
14615
+ className: "yv:rounded-[8px] yv:size-12 yv:border-border",
14616
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "yv:font-serif yv:font-bold", children: version2.local_abbreviation })
14617
+ }
14618
+ ),
14619
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ItemContent, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ItemTitle, { className: "yv:line-clamp-2", children: version2.title }) })
14620
+ ]
14621
+ }
14622
+ )
14623
+ },
14624
+ version2.id
14625
+ )) }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "yv:w-full yv:flex yv:items-center yv:justify-center yv:py-8 yv:text-center yv:text-muted-foreground yv:text-sm", children: "No versions found" }) }),
14626
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("section", { className: "yv:bg-muted yv:border-t yv:border-border yv:p-4 yv:w-full yv:rounded-b-2xl yv:flex yv:gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "yv:flex-1 yv:relative", children: [
14627
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
14628
+ import_lucide_react3.Search,
14629
+ {
14630
+ size: 13,
14631
+ className: "yv:absolute yv:left-3 yv:top-1/2 yv:-translate-y-1/2 yv:text-muted-foreground"
14632
+ }
14633
+ ),
14634
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
14635
+ Input,
14636
+ {
14637
+ className: "yv:rounded-3xl yv:bg-background yv:pl-9 yv:py-3 yv:border-border",
14638
+ type: "text",
14639
+ placeholder: "Search",
14640
+ value: searchQuery,
14641
+ onChange: (e) => setSearchQuery(e.target.value)
14642
+ }
14643
+ )
14644
+ ] }) })
14645
+ ]
14646
+ }
14647
+ ),
14648
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
14649
+ "div",
14650
+ {
14651
+ className: `yv:h-[66vh] yv:absolute yv:inset-0 yv:flex yv:flex-col yv:transition-all yv:duration-300 yv:rounded-2xl yv:origin-center ${isLanguagesOpen ? "yv:opacity-100 yv:pointer-events-auto yv:blur-none yv:scale-100" : "yv:opacity-0 yv:pointer-events-none yv:blur-sm yv:scale-95"}`,
14652
+ children: [
14653
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("section", { className: "yv:bg-muted yv:py-3 yv:w-full yv:rounded-t-2xl yv:px-4 yv:border-b yv:border-border yv:grid yv:grid-cols-[auto_1fr] yv:gap-2 yv:items-center", children: [
14654
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
14655
+ Button,
14656
+ {
14657
+ onClick: () => setIsLanguagesOpen(false),
14658
+ variant: "ghost",
14659
+ size: "icon",
14660
+ className: "yv:w-8 yv:h-8 yv:text-muted-foreground",
14661
+ children: [
14662
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.ArrowLeft, { size: 16 }),
14663
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "yv:sr-only", children: "Close Language selector" })
14664
+ ]
14665
+ }
14666
+ ),
14667
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h2", { className: "yv:font-bold yv:text-base", children: "Select Language" })
14668
+ ] }),
14669
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ItemGroup, { className: "yv:overflow-y-auto yv:py-2", children: languages.map((language) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
14670
+ Item2,
14671
+ {
14672
+ className: "yv:hover:bg-muted yv:rounded-[8px]",
14673
+ size: "sm",
14674
+ role: "listitem",
14675
+ "aria-label": language.englishName,
14676
+ asChild: true,
14677
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { className: "yv:w-full", onClick: () => handleSelectLanguage(language.id), children: [
14678
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ItemContent, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ItemTitle, { className: "yv:line-clamp-2", children: language.englishName }) }),
14679
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ItemContent, { className: "flex-none text-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ItemDescription, { children: language.name }) })
14680
+ ] })
14681
+ },
14682
+ language.id
14683
+ )) })
14684
+ ]
14685
+ }
14686
+ )
14687
+ ]
14688
+ }
14689
+ );
14690
+ }
14691
+ var BibleVersionPicker = Object.assign({}, { Root: Root4, Trigger: Trigger4, Content: Content3 });
14692
+
14693
+ // src/components/verse.tsx
14694
+ var import_react3 = __toESM(require("react"), 1);
14695
+ var import_isomorphic_dompurify = __toESM(require("isomorphic-dompurify"), 1);
14696
+ var import_platform_react_hooks3 = require("@youversion/platform-react-hooks");
14697
+ var import_jsx_runtime10 = require("react/jsx-runtime");
14698
+ var NON_BREAKING_SPACE = "\xA0";
14699
+ var DOMPURIFY_CONFIG = {
14700
+ ALLOWED_ATTR: ["class", "style", "id"],
14701
+ ALLOW_DATA_ATTR: true
14702
+ };
14703
+ function yvDomTransformer(html) {
14704
+ if (!window || !("DOMParser" in window)) {
14705
+ return html;
14706
+ }
14707
+ const sanitizedHtml = import_isomorphic_dompurify.default.sanitize(html, DOMPURIFY_CONFIG);
14708
+ const parser = new DOMParser();
14709
+ const doc = parser.parseFromString(sanitizedHtml, "text/html");
14710
+ const paragraphs = doc.querySelectorAll(".yv-vlbl");
14711
+ paragraphs.forEach((p) => {
14712
+ const text = p.textContent || "";
14713
+ if (!text.endsWith(NON_BREAKING_SPACE)) {
14714
+ p.textContent = text + NON_BREAKING_SPACE;
14715
+ }
14716
+ });
14717
+ const tables = doc.querySelectorAll("table");
14718
+ tables.forEach((table) => {
14719
+ const rows = table.querySelectorAll("tr");
14720
+ if (rows.length === 0) return;
14721
+ let maxColumns = 0;
14722
+ rows.forEach((row) => {
14723
+ const cells = row.querySelectorAll("td, th");
14724
+ let rowColumnCount = 0;
14725
+ cells.forEach((cell) => {
14726
+ if (cell instanceof HTMLTableCellElement) {
14727
+ const colspan = parseInt(cell.getAttribute("colspan") || "1", 10);
14728
+ rowColumnCount += colspan;
14729
+ } else {
14730
+ rowColumnCount += 1;
14731
+ }
14732
+ });
14733
+ maxColumns = Math.max(maxColumns, rowColumnCount);
14734
+ });
14735
+ if (maxColumns > 1) {
14736
+ rows.forEach((row) => {
14737
+ const cells = row.querySelectorAll("td, th");
14738
+ if (cells.length === 1) {
14739
+ const cell = cells[0];
14740
+ if (cell instanceof HTMLTableCellElement) {
14741
+ const existingColspan = parseInt(cell.getAttribute("colspan") || "1", 10);
14742
+ if (existingColspan < maxColumns) {
14743
+ cell.setAttribute("colspan", maxColumns.toString());
14744
+ }
14745
+ }
14746
+ }
14747
+ });
14748
+ }
14749
+ });
14750
+ const modifiedHtml = doc.body.innerHTML;
14751
+ return modifiedHtml;
14752
+ }
14753
+ var Verse = {
14754
+ /**
14755
+ * Renders a single verse with superscript number and text.
14756
+ *
14757
+ * @param props - The verse properties.
14758
+ * @param props.number - The verse number.
14759
+ * @param props.text - The verse text.
14760
+ * @param props.size - The size variant. Defaults to 'default'.
14761
+ * @returns The rendered verse element.
14762
+ */
14763
+ Text: ({ number: number4, text, size = "default" }) => {
14764
+ if (size === "lg") {
14765
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "yv:[&>p]:inline-block", children: [
14766
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("sup", { className: "yv:text-muted-foreground yv:align-super yv:text-[0.6em]", children: number4 }),
14767
+ "\xA0",
14768
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "yv:font-serif! yv:text-xl yv:text-primary", children: text }),
14769
+ "\xA0"
14770
+ ] });
14771
+ }
14772
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "yv:[&>p]:inline-block", children: [
14773
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("sup", { className: "yv:text-muted-foreground yv:align-super yv:text-[0.6em]", children: number4 }),
14774
+ "\xA0",
14775
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "yv:text-primary", children: text }),
14776
+ "\xA0"
14777
+ ] });
14778
+ },
14779
+ Html: ({
14780
+ html,
14781
+ fontFamily,
14782
+ fontSize,
14783
+ lineHeight,
14784
+ showVerseNumbers = true
14785
+ }) => {
14786
+ const [transformedHtml, setTransformedHtml] = import_react3.default.useState(html);
14787
+ import_react3.default.useEffect(() => {
14788
+ setTransformedHtml(yvDomTransformer(html));
14789
+ }, [html]);
14790
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
14791
+ "section",
14792
+ {
14793
+ style: {
14794
+ ...fontFamily ? { "--yv-reader-font-family": fontFamily } : {},
14795
+ ...fontSize ? { "--yv-reader-font-size": `${fontSize}px` } : {},
14796
+ ...lineHeight ? { "--yv-reader-line-height": lineHeight } : {}
14797
+ },
14798
+ "data-show-verse-numbers": showVerseNumbers,
14799
+ "data-slot": "yv-bible-renderer",
14800
+ dangerouslySetInnerHTML: { __html: transformedHtml }
14801
+ }
14802
+ );
14803
+ }
14804
+ };
14805
+ var BibleTextView = ({
14806
+ reference,
14807
+ fontFamily,
14808
+ fontSize,
14809
+ lineHeight,
14810
+ versionId,
14811
+ showVerseNumbers
14812
+ }) => {
14813
+ const { passage, loading, error: error46 } = (0, import_platform_react_hooks3.usePassage)({
14814
+ versionId,
14815
+ usfm: reference,
14816
+ include_headings: true,
14817
+ include_notes: true
14818
+ });
14819
+ if (loading) {
14820
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
14821
+ Verse.Html,
14822
+ {
14823
+ html: "<span>Loading...</span>",
14824
+ fontFamily,
14825
+ fontSize,
14826
+ lineHeight,
14827
+ showVerseNumbers
14828
+ }
14829
+ );
14830
+ }
14831
+ if (error46) {
14832
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
14833
+ Verse.Html,
14834
+ {
14835
+ html: '<span class="wj">We have run into an error...</span>',
14836
+ fontFamily,
14837
+ fontSize,
14838
+ lineHeight,
14839
+ showVerseNumbers
14840
+ }
14841
+ );
14842
+ }
14843
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
14844
+ Verse.Html,
14845
+ {
14846
+ html: passage?.content || "",
14847
+ fontFamily,
14848
+ fontSize,
14849
+ lineHeight,
14850
+ showVerseNumbers
14851
+ }
14852
+ );
14853
+ };
14854
+
14855
+ // src/components/bible-reader.tsx
14856
+ var import_jsx_runtime11 = require("react/jsx-runtime");
14857
+ var BibleReaderContext = (0, import_react4.createContext)(null);
14858
+ function useBibleReaderContext() {
14859
+ const context = (0, import_react4.useContext)(BibleReaderContext);
14860
+ if (!context) {
14861
+ throw new Error("BibleReader components must be used within BibleReader.Root");
14862
+ }
14863
+ return context;
14864
+ }
14865
+ function Root5({
14866
+ book: controlledBook,
14867
+ defaultBook = "JHN",
14868
+ onBookChange,
14869
+ chapter: controlledChapter,
14870
+ defaultChapter = "1",
14871
+ onChapterChange,
14872
+ versionId: controlledVersionId,
14873
+ defaultVersionId = 111,
14874
+ onVersionChange,
14875
+ fontFamily,
14876
+ fontSize = 16,
14877
+ lineHeight,
14878
+ showVerseNumbers = true,
14879
+ background = "light",
14880
+ children
14881
+ }) {
14882
+ const [book, setBook] = (0, import_react_use_controllable_state3.useControllableState)({
14883
+ prop: controlledBook,
14884
+ defaultProp: defaultBook,
14885
+ onChange: onBookChange
14886
+ });
14887
+ const [chapter, setChapter] = (0, import_react_use_controllable_state3.useControllableState)({
14888
+ prop: controlledChapter,
14889
+ defaultProp: defaultChapter,
14890
+ onChange: onChapterChange
14891
+ });
14892
+ const [versionId, setVersionId] = (0, import_react_use_controllable_state3.useControllableState)({
14893
+ prop: controlledVersionId,
14894
+ defaultProp: defaultVersionId,
14895
+ onChange: onVersionChange
14896
+ });
14897
+ const contextValue = {
14898
+ book,
14899
+ chapter,
14900
+ versionId,
14901
+ setBook,
14902
+ setChapter,
14903
+ setVersionId,
14904
+ fontFamily,
14905
+ fontSize,
14906
+ lineHeight,
14907
+ showVerseNumbers,
14908
+ background
14909
+ };
14910
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(BibleReaderContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
14911
+ "div",
14912
+ {
14913
+ "data-yv-sdk": true,
14914
+ "data-yv-theme": background === "dark" ? "dark" : "light",
14915
+ className: "yv:flex yv:flex-col yv:h-full yv:bg-background yv:text-foreground",
14916
+ children
14917
+ }
14918
+ ) });
14919
+ }
14920
+ function Content4() {
14921
+ const { book, chapter, versionId, fontFamily, fontSize, lineHeight, showVerseNumbers } = useBibleReaderContext();
14922
+ const { books } = (0, import_platform_react_hooks4.useBooks)(versionId);
14923
+ const { version: version2 } = (0, import_platform_react_hooks4.useVersion)(versionId);
14924
+ const bookData = (0, import_react4.useMemo)(() => {
14925
+ return books?.data?.find((b) => b.id === book);
14926
+ }, [books?.data, book]);
14927
+ const usfmReference = `${book}.${chapter}`;
14928
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("main", { className: "yv:*:max-w-lg yv:flex yv:flex-col yv:items-center yv:gap-6 yv:overflow-y-auto yv:px-6 yv:max-sm:px-4 yv:py-12 yv:h-full", children: [
14929
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("h1", { className: "yv:flex yv:gap-2 yv:flex-col yv:justify-center yv:items-center yv:font-serif yv:text-muted-foreground yv:font-medium", children: [
14930
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
14931
+ "span",
14932
+ {
14933
+ className: cn(
14934
+ "yv:leading-none yv:block yv:text-2xl yv:transition-[filter]",
14935
+ !bookData?.title && "yv:blur-sm"
14936
+ ),
14937
+ children: bookData?.title || "Loading..."
14938
+ }
14939
+ ),
14940
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "yv:leading-none yv:block yv:ml-2 yv:text-[2.5rem] yv:font-normal", children: chapter || "-" })
14941
+ ] }),
14942
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
14943
+ BibleTextView,
14944
+ {
14945
+ reference: usfmReference,
14946
+ versionId,
14947
+ fontFamily,
14948
+ fontSize,
14949
+ lineHeight,
14950
+ showVerseNumbers
14951
+ }
14952
+ ),
14953
+ version2?.copyright_short && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("footer", { style: { fontSize }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "yv:text-balance yv:text-[0.75em] yv:text-center yv:text-muted-foreground", children: version2.copyright_short }) })
14954
+ ] });
14955
+ }
14956
+ function Toolbar({ border = "top" }) {
14957
+ const { book, chapter, versionId, setBook, setChapter, setVersionId, background } = useBibleReaderContext();
14958
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
14959
+ "section",
14960
+ {
14961
+ className: cn(
14962
+ "yv:flex yv:justify-center yv:gap-2 yv:p-4 yv:bg-background yv:border-border",
14963
+ border === "top" && "yv:border-t",
14964
+ border === "bottom" && "yv:border-b"
14965
+ ),
14966
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "yv:grid yv:w-full yv:grid-cols-2 yv:items-center yv:max-w-lg yv:gap-1", children: [
14967
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
14968
+ BibleChapterPicker.Root,
14969
+ {
14970
+ book,
14971
+ chapter,
14972
+ onBookChange: setBook,
14973
+ onChapterChange: setChapter,
14974
+ versionId,
14975
+ background,
14976
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(BibleChapterPicker.Trigger, { "aria-label": "Change Bible book and chapter", children: ({ chapter: chapter2, currentBook, loading }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { variant: "secondary", className: "yv:rounded-r-none", disabled: loading, children: loading ? "Loading..." : `${currentBook?.title || "Select"} ${chapter2 || ""}` }) })
14977
+ }
14978
+ ),
14979
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
14980
+ BibleVersionPicker.Root,
14981
+ {
14982
+ versionId,
14983
+ onVersionChange: setVersionId,
14984
+ background,
14985
+ children: [
14986
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(BibleVersionPicker.Trigger, { "aria-label": "Change Bible version", children: ({ version: version2, loading }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { variant: "secondary", className: "yv:rounded-l-none", disabled: loading, children: loading ? "Loading..." : version2?.local_abbreviation || "Select version" }) }),
14987
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(BibleVersionPicker.Content, {})
14988
+ ]
14989
+ }
14990
+ )
14991
+ ] })
14992
+ }
14993
+ );
14994
+ }
14995
+ var BibleReader = Object.assign({}, { Root: Root5, Content: Content4, Toolbar });
14996
+
14997
+ // src/components/SignInButton.tsx
14998
+ var import_react8 = __toESM(require("react"), 1);
14999
+ var import_lucide_react4 = require("lucide-react");
15000
+
15001
+ // src/providers/YVPProvider.tsx
15002
+ var import_react6 = require("react");
15003
+
15004
+ // src/providers/YVPErrorBoundary.tsx
15005
+ var import_react5 = require("react");
15006
+ var import_jsx_runtime12 = require("react/jsx-runtime");
15007
+ var YVPErrorBoundary = class extends import_react5.Component {
15008
+ constructor(props) {
15009
+ super(props);
15010
+ this.state = { hasError: false, error: null };
15011
+ }
15012
+ static getDerivedStateFromError(error46) {
15013
+ return { hasError: true, error: error46 };
15014
+ }
15015
+ componentDidCatch(error46, errorInfo) {
15016
+ const { onError } = this.props;
15017
+ if (onError) {
15018
+ onError(error46, errorInfo);
15019
+ }
15020
+ if (process.env.NODE_ENV === "development") {
15021
+ console.error("YVP Error Boundary caught error:", error46, errorInfo);
15022
+ }
15023
+ }
15024
+ render() {
15025
+ const { hasError, error: error46 } = this.state;
15026
+ const { children, fallback } = this.props;
15027
+ const isDevelopment = process.env.NODE_ENV === "development";
15028
+ if (hasError) {
15029
+ if (fallback) {
15030
+ return fallback;
15031
+ }
15032
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { padding: "20px", textAlign: "center" }, children: [
15033
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h2", { children: "Something went wrong" }),
15034
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: "We encountered an error while loading YouVersion Platform components." }),
15035
+ isDevelopment && error46 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("details", { style: { marginTop: "10px" }, children: [
15036
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("summary", { children: "Error details (development only)" }),
15037
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("pre", { style: { textAlign: "left", overflow: "auto" }, children: error46.toString() })
15038
+ ] })
15039
+ ] });
15040
+ }
15041
+ return children;
15042
+ }
15043
+ };
15044
+
15045
+ // src/providers/YVPProvider.tsx
15046
+ var import_jsx_runtime13 = require("react/jsx-runtime");
15047
+ var YVPContext = (0, import_react6.createContext)(null);
15048
+ function YVPProvider({
15049
+ config: config2,
15050
+ children,
15051
+ errorFallback,
15052
+ onError,
15053
+ theme = "light"
15054
+ }) {
15055
+ const [authState, setAuthState] = (0, import_react6.useState)({
15056
+ isAuthenticated: false,
15057
+ isLoading: false,
15058
+ accessToken: null,
15059
+ result: null,
15060
+ error: null
15061
+ });
15062
+ (0, import_react6.useEffect)(() => {
15063
+ const initializeAuth = () => {
15064
+ YouVersionPlatformConfiguration.appKey = config2.appKey;
15065
+ YouVersionPlatformConfiguration.installationId = config2.installationId ?? null;
15066
+ const strategy = new WebAuthenticationStrategy({
15067
+ redirectUri: config2.redirectUri || ""
15068
+ });
15069
+ AuthenticationStrategyRegistry.register(strategy);
15070
+ const existingToken = YouVersionPlatformConfiguration.accessToken;
15071
+ if (existingToken) {
15072
+ setAuthState({
15073
+ isAuthenticated: true,
15074
+ isLoading: false,
15075
+ accessToken: existingToken,
15076
+ result: null,
15077
+ error: null
15078
+ });
15079
+ return;
15080
+ }
15081
+ WebAuthenticationStrategy.handleCallback();
15082
+ const storedCallback = WebAuthenticationStrategy.getStoredCallback();
15083
+ if (storedCallback) {
15084
+ try {
15085
+ const result = new SignInWithYouVersionResult(storedCallback);
15086
+ const { accessToken, errorMsg } = result;
15087
+ if (accessToken) {
15088
+ YouVersionPlatformConfiguration.setAccessToken(accessToken);
15089
+ }
15090
+ setAuthState({
15091
+ isAuthenticated: !!accessToken,
15092
+ isLoading: false,
15093
+ accessToken: accessToken ?? null,
15094
+ result,
15095
+ error: errorMsg ? new Error(errorMsg) : null
15096
+ });
15097
+ } catch (error46) {
15098
+ setAuthState({
15099
+ isAuthenticated: false,
15100
+ isLoading: false,
15101
+ accessToken: null,
15102
+ result: null,
15103
+ error: error46
15104
+ });
15105
+ }
15106
+ } else {
15107
+ setAuthState({
15108
+ isAuthenticated: false,
15109
+ isLoading: false,
15110
+ accessToken: null,
15111
+ result: null,
15112
+ error: null
15113
+ });
15114
+ }
15115
+ };
15116
+ initializeAuth();
15117
+ }, [config2.appKey, config2.installationId, config2.redirectUri]);
15118
+ const signOut = (0, import_react6.useCallback)(() => {
15119
+ YouVersionPlatformConfiguration.setAccessToken(null);
15120
+ setAuthState({
15121
+ isAuthenticated: false,
15122
+ isLoading: false,
15123
+ accessToken: null,
15124
+ result: null,
15125
+ error: null
15126
+ });
15127
+ }, []);
15128
+ const fetchUserInfo = (0, import_react6.useCallback)(async () => {
15129
+ if (!authState.isAuthenticated || !authState.accessToken) {
15130
+ throw new Error("User is not authenticated");
15131
+ }
15132
+ return YouVersionAPIUsers.userInfo(authState.accessToken);
15133
+ }, [authState.isAuthenticated, authState.accessToken]);
15134
+ const value = {
15135
+ config: config2,
15136
+ client: ApiClient,
15137
+ auth: authState,
15138
+ signOut,
15139
+ fetchUserInfo
15140
+ };
15141
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(YVPErrorBoundary, { fallback: errorFallback, onError, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(YVPContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "yv:contents", "data-yv-sdk": true, "data-yv-theme": theme, children }) }) });
15142
+ }
15143
+ function useYVP() {
15144
+ const context = (0, import_react6.useContext)(YVPContext);
15145
+ if (!context) {
15146
+ throw new Error("useYVP must be used within a YVPProvider");
15147
+ }
15148
+ return context;
15149
+ }
15150
+
15151
+ // src/hooks/useAuthentication.ts
15152
+ var import_react7 = require("react");
15153
+ function useAuthentication() {
15154
+ const { auth, signOut, fetchUserInfo, client: _client } = useYVP();
15155
+ const signIn = (0, import_react7.useCallback)(
15156
+ async (requiredPermissions = [], optionalPermissions = []) => {
15157
+ return await YouVersionAPIUsers.signIn(
15158
+ new Set(requiredPermissions),
15159
+ new Set(optionalPermissions)
15160
+ );
15161
+ },
15162
+ []
15163
+ );
15164
+ return {
15165
+ auth,
15166
+ signIn,
15167
+ signOut,
15168
+ fetchUserInfo
15169
+ };
15170
+ }
15171
+
15172
+ // src/components/youversion-logo.tsx
15173
+ var React11 = require("react");
15174
+ var import_jsx_runtime14 = require("react/jsx-runtime");
15175
+ function YouVersionLogo(props) {
15176
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
15177
+ "svg",
15178
+ {
15179
+ xmlns: "http://www.w3.org/2000/svg",
15180
+ fill: "none",
15181
+ viewBox: "0 0 26 26",
15182
+ role: "img",
15183
+ "aria-label": "YouVersion",
15184
+ ...props,
15185
+ children: [
15186
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
15187
+ "mask",
15188
+ {
15189
+ id: "youversion-logo-mask",
15190
+ width: 26,
14471
15191
  height: 26,
14472
15192
  x: 0,
14473
15193
  y: 0,
@@ -14475,7 +15195,7 @@ function YouVersionLogo(props) {
14475
15195
  style: {
14476
15196
  maskType: "alpha"
14477
15197
  },
14478
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
15198
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14479
15199
  "path",
14480
15200
  {
14481
15201
  fill: "url(#youversion-logo-gradient-a)",
@@ -14486,9 +15206,9 @@ function YouVersionLogo(props) {
14486
15206
  )
14487
15207
  }
14488
15208
  ),
14489
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("g", { mask: "url(#youversion-logo-mask)", children: [
14490
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { fill: "url(#youversion-logo-gradient-c)", d: "M0 0h26v26H0z" }),
14491
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
15209
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("g", { mask: "url(#youversion-logo-mask)", children: [
15210
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { fill: "url(#youversion-logo-gradient-c)", d: "M0 0h26v26H0z" }),
15211
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14492
15212
  "path",
14493
15213
  {
14494
15214
  fill: "#FEF5EB",
@@ -14497,8 +15217,8 @@ function YouVersionLogo(props) {
14497
15217
  clipRule: "evenodd"
14498
15218
  }
14499
15219
  ),
14500
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { fill: "#FF3D4D", d: "M4.774 20.468h4.073v3.055l-2.036-1.019-2.037 1.019v-3.055Z" }),
14501
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
15220
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { fill: "#FF3D4D", d: "M4.774 20.468h4.073v3.055l-2.036-1.019-2.037 1.019v-3.055Z" }),
15221
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14502
15222
  "path",
14503
15223
  {
14504
15224
  fill: "#FEF5EB",
@@ -14506,8 +15226,8 @@ function YouVersionLogo(props) {
14506
15226
  }
14507
15227
  )
14508
15228
  ] }),
14509
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("defs", { children: [
14510
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
15229
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("defs", { children: [
15230
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
14511
15231
  "linearGradient",
14512
15232
  {
14513
15233
  id: "youversion-logo-gradient-a",
@@ -14517,12 +15237,12 @@ function YouVersionLogo(props) {
14517
15237
  y2: 26,
14518
15238
  gradientUnits: "userSpaceOnUse",
14519
15239
  children: [
14520
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("stop", { stopColor: "#C93D34" }),
14521
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("stop", { offset: 1, stopColor: "#7A2629" })
15240
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("stop", { stopColor: "#C93D34" }),
15241
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("stop", { offset: 1, stopColor: "#7A2629" })
14522
15242
  ]
14523
15243
  }
14524
15244
  ),
14525
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
15245
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
14526
15246
  "linearGradient",
14527
15247
  {
14528
15248
  id: "youversion-logo-gradient-c",
@@ -14532,8 +15252,8 @@ function YouVersionLogo(props) {
14532
15252
  y2: 26,
14533
15253
  gradientUnits: "userSpaceOnUse",
14534
15254
  children: [
14535
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("stop", { stopColor: "#C93D34" }),
14536
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("stop", { offset: 1, stopColor: "#7A2629" })
15255
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("stop", { stopColor: "#C93D34" }),
15256
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("stop", { offset: 1, stopColor: "#7A2629" })
14537
15257
  ]
14538
15258
  }
14539
15259
  )
@@ -14544,8 +15264,8 @@ function YouVersionLogo(props) {
14544
15264
  }
14545
15265
 
14546
15266
  // src/components/SignInButton.tsx
14547
- var import_jsx_runtime10 = require("react/jsx-runtime");
14548
- var SignInButton = import_react5.default.forwardRef(
15267
+ var import_jsx_runtime15 = require("react/jsx-runtime");
15268
+ var SignInButton = import_react8.default.forwardRef(
14549
15269
  ({
14550
15270
  background = "light",
14551
15271
  className,
@@ -14561,7 +15281,7 @@ var SignInButton = import_react5.default.forwardRef(
14561
15281
  ...props
14562
15282
  }, ref) => {
14563
15283
  const { signIn, auth } = useAuthentication();
14564
- const [localLoading, setLocalLoading] = import_react5.default.useState(false);
15284
+ const [localLoading, setLocalLoading] = import_react8.default.useState(false);
14565
15285
  const handleClick = async (e) => {
14566
15286
  e.preventDefault();
14567
15287
  if (onClick) {
@@ -14586,9 +15306,9 @@ var SignInButton = import_react5.default.forwardRef(
14586
15306
  if (size === "short") {
14587
15307
  buttonCopy = "Sign in";
14588
15308
  }
14589
- const loadingSpinner = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react3.Loader2, { className: "yv:z-20 yv:absolute yv:left-1/2 yv:top-1/2 yv:animate-spin yv:-translate-x-1/2 yv:-translate-y-1/2 yv:fill-primary-foreground yv:text-primary" });
15309
+ const loadingSpinner = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react4.Loader2, { className: "yv:z-20 yv:absolute yv:left-1/2 yv:top-1/2 yv:animate-spin yv:-translate-x-1/2 yv:-translate-y-1/2 yv:fill-primary-foreground yv:text-primary" });
14590
15310
  if (size === "icon") {
14591
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
15311
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
14592
15312
  Button,
14593
15313
  {
14594
15314
  ...props,
@@ -14611,13 +15331,13 @@ var SignInButton = import_react5.default.forwardRef(
14611
15331
  variant: background === "light" ? "outline" : "default",
14612
15332
  children: [
14613
15333
  buttonLoading ? loadingSpinner : null,
14614
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(YouVersionLogo, {}),
14615
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "yv:sr-only", children: buttonCopy })
15334
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(YouVersionLogo, {}),
15335
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "yv:sr-only", children: buttonCopy })
14616
15336
  ]
14617
15337
  }
14618
15338
  );
14619
15339
  }
14620
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
15340
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
14621
15341
  Button,
14622
15342
  {
14623
15343
  ...props,
@@ -14640,7 +15360,7 @@ var SignInButton = import_react5.default.forwardRef(
14640
15360
  variant: background === "light" ? "outline" : "default",
14641
15361
  children: [
14642
15362
  buttonLoading ? loadingSpinner : null,
14643
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(YouVersionLogo, {}),
15363
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(YouVersionLogo, {}),
14644
15364
  buttonCopy
14645
15365
  ]
14646
15366
  }
@@ -14650,12 +15370,12 @@ var SignInButton = import_react5.default.forwardRef(
14650
15370
  SignInButton.displayName = "SignInButton";
14651
15371
 
14652
15372
  // src/components/verse-of-the-day.tsx
14653
- var import_react8 = __toESM(require("react"), 1);
15373
+ var import_react10 = __toESM(require("react"), 1);
14654
15374
 
14655
15375
  // src/components/icons/votd.tsx
14656
- var import_react6 = require("react");
14657
- var import_jsx_runtime11 = require("react/jsx-runtime");
14658
- var SvgComponent = (props) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
15376
+ var import_react9 = require("react");
15377
+ var import_jsx_runtime16 = require("react/jsx-runtime");
15378
+ var SvgComponent = (props) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
14659
15379
  "svg",
14660
15380
  {
14661
15381
  width: "44",
@@ -14665,8 +15385,8 @@ var SvgComponent = (props) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
14665
15385
  fill: "none",
14666
15386
  xmlns: "http://www.w3.org/2000/svg",
14667
15387
  children: [
14668
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("title", { children: "Sun" }),
14669
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
15388
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("title", { children: "Sun" }),
15389
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
14670
15390
  "path",
14671
15391
  {
14672
15392
  fillRule: "evenodd",
@@ -14680,8 +15400,8 @@ var SvgComponent = (props) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
14680
15400
  );
14681
15401
 
14682
15402
  // src/components/icons/share.tsx
14683
- var import_jsx_runtime12 = require("react/jsx-runtime");
14684
- var SvgComponent2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
15403
+ var import_jsx_runtime17 = require("react/jsx-runtime");
15404
+ var SvgComponent2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
14685
15405
  "svg",
14686
15406
  {
14687
15407
  xmlns: "http://www.w3.org/2000/svg",
@@ -14691,14 +15411,14 @@ var SvgComponent2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
14691
15411
  fill: "none",
14692
15412
  ...props,
14693
15413
  children: [
14694
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
15414
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
14695
15415
  "path",
14696
15416
  {
14697
15417
  fill: "currentColor",
14698
15418
  d: "M16.121 9.187a1 1 0 0 1-1.414 0L13 7.48V15a1 1 0 1 1-2 0V7.348L9.121 9.227a1 1 0 1 1-1.414-1.414l3.52-3.52a1 1 0 0 1 1.414 0l3.48 3.48a1 1 0 0 1 0 1.414Z"
14699
15419
  }
14700
15420
  ),
14701
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
15421
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
14702
15422
  "path",
14703
15423
  {
14704
15424
  fill: "currentColor",
@@ -14710,8 +15430,8 @@ var SvgComponent2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
14710
15430
  );
14711
15431
 
14712
15432
  // src/components/bible-app-logo-lockup.tsx
14713
- var import_jsx_runtime13 = require("react/jsx-runtime");
14714
- var SvgComponent3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
15433
+ var import_jsx_runtime18 = require("react/jsx-runtime");
15434
+ var SvgComponent3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
14715
15435
  "svg",
14716
15436
  {
14717
15437
  xmlns: "http://www.w3.org/2000/svg",
@@ -14721,8 +15441,8 @@ var SvgComponent3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
14721
15441
  fill: "none",
14722
15442
  ...props,
14723
15443
  children: [
14724
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("title", { children: "Bible App" }),
14725
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
15444
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("title", { children: "Bible App" }),
15445
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
14726
15446
  "mask",
14727
15447
  {
14728
15448
  id: "bible-app-logo-lockup-mask",
@@ -14734,7 +15454,7 @@ var SvgComponent3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
14734
15454
  style: {
14735
15455
  maskType: "alpha"
14736
15456
  },
14737
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
15457
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
14738
15458
  "path",
14739
15459
  {
14740
15460
  fill: "url(#bible-app-logo-lockup-gradient-a)",
@@ -14745,9 +15465,9 @@ var SvgComponent3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
14745
15465
  )
14746
15466
  }
14747
15467
  ),
14748
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("g", { mask: "url(#bible-app-logo-lockup-mask)", children: [
14749
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { fill: "url(#bible-app-logo-lockup-gradient-c)", d: "M63.562 0H80v16.438H63.562z" }),
14750
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
15468
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("g", { mask: "url(#bible-app-logo-lockup-mask)", children: [
15469
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { fill: "url(#bible-app-logo-lockup-gradient-c)", d: "M63.562 0H80v16.438H63.562z" }),
15470
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
14751
15471
  "path",
14752
15472
  {
14753
15473
  fill: "#FEF5EB",
@@ -14756,18 +15476,18 @@ var SvgComponent3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
14756
15476
  clipRule: "evenodd"
14757
15477
  }
14758
15478
  ),
14759
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { fill: "#FF3D4D", d: "M66.58 12.94h2.575v1.932l-1.287-.644-1.288.644v-1.931Z" }),
14760
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("g", { fill: "#FEF5EB", clipPath: "url(#bible-app-logo-lockup-clip)", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M70.602 5.614c.173.105.374.156.603.156.219 0 .42-.055.593-.17.178-.113.31-.273.407-.474.1-.206.146-.439.146-.694a1.57 1.57 0 0 0-.142-.694 1.05 1.05 0 0 0-.402-.452 1.135 1.135 0 0 0-.598-.156c-.219 0-.42.055-.598.17a1.15 1.15 0 0 0-.406.474 1.626 1.626 0 0 0-.142.694c0 .265.046.498.142.694.091.197.223.347.397.452Zm-.096-1.16c0-.232.027-.438.087-.616a.906.906 0 0 1 .246-.406.512.512 0 0 1 .356-.142c.133 0 .247.046.357.137.11.091.196.224.26.402.069.174.1.379.1.616 0 .233-.032.439-.09.617a.951.951 0 0 1-.248.41.516.516 0 0 1-.356.142.537.537 0 0 1-.356-.137.95.95 0 0 1-.265-.401 1.995 1.995 0 0 1-.091-.621ZM76.675 9.14a3.91 3.91 0 0 1-.014-.68l.005-.056h-.178l-.005.046a1.256 1.256 0 0 1-.073.36.324.324 0 0 1-.141.16.704.704 0 0 1-.302.05h-.25a.696.696 0 0 1-.17-.013.073.073 0 0 1-.046-.05.654.654 0 0 1-.018-.174v-.78h.178c.082 0 .142.022.183.059.041.036.069.1.082.187.014.096.019.15.023.169l.005.041H76.122l-.004-.05a8.485 8.485 0 0 1-.023-.489v-.164c0-.119.005-.228.01-.324l.004-.05H75.936l-.005.04-.01.07c-.009.077-.022.14-.036.186a.188.188 0 0 1-.073.11c-.032.027-.082.046-.155.046h-.178v-.768c0-.086.009-.141.018-.173.01-.028.023-.041.046-.046a.637.637 0 0 1 .169-.018h.287c.119 0 .201.018.251.046a.241.241 0 0 1 .105.132c.023.064.046.174.06.32l.004.045h.178l-.009-.054a2.264 2.264 0 0 1-.009-.21c0-.12.01-.252.023-.402l.005-.055h-1.832v.164l.046.005a.719.719 0 0 1 .165.023.07.07 0 0 1 .05.05c.009.032.018.087.018.173v1.708c0 .087-.01.142-.018.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.004v.165h1.9v-.05ZM74.543 5.724l-.005-.055a3.91 3.91 0 0 1-.014-.717l.005-.055h-.178l-.005.046a1.678 1.678 0 0 1-.073.38.31.31 0 0 1-.146.173.693.693 0 0 1-.301.054h-.251a.695.695 0 0 1-.17-.013.072.072 0 0 1-.045-.05.653.653 0 0 1-.018-.174V3.587c0-.087.009-.142.018-.174a.072.072 0 0 1 .046-.05.82.82 0 0 1 .168-.023l.046-.004v-.164h-.982V3.34l.046.005a.72.72 0 0 1 .165.023.07.07 0 0 1 .05.05c.009.032.018.087.018.173v1.713c0 .087-.01.141-.018.173a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.005v.164l1.904.005ZM68.762 8.034c-.091-.095-.233-.164-.411-.205a.685.685 0 0 0 .27-.2.61.61 0 0 0 .136-.389.522.522 0 0 0-.21-.434c-.137-.11-.329-.16-.57-.16l-.996-.009V6.806l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.717c0 .087-.01.142-.019.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.004v.169l1.073-.004c.178 0 .329-.028.461-.087a.705.705 0 0 0 .306-.256.666.666 0 0 0 .11-.374.555.555 0 0 0-.17-.439Zm-1.078-.977a.71.71 0 0 1 .018-.173c.01-.032.028-.046.046-.06a.349.349 0 0 1 .142-.018c.164 0 .269.041.333.11.064.073.1.187.1.356a.637.637 0 0 1-.105.383c-.059.083-.173.133-.356.133h-.182v-.73h.004Zm.662 1.818c-.096.091-.242.137-.452.137a.375.375 0 0 1-.146-.019c-.023-.009-.036-.027-.046-.054a.639.639 0 0 1-.018-.17v-.826h.242c.21 0 .352.046.434.128.087.082.132.205.132.379 0 .2-.05.338-.146.425ZM72.232 8.034s-.004 0 0 0c-.004 0-.004 0 0 0a.812.812 0 0 0-.41-.205.686.686 0 0 0 .269-.2.61.61 0 0 0 .137-.389.522.522 0 0 0-.21-.434c-.138-.11-.33-.16-.571-.16l-.996-.009V6.806l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.717c0 .087-.01.142-.018.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.004v.169l1.073-.004c.178 0 .33-.028.462-.087a.706.706 0 0 0 .305-.256.667.667 0 0 0 .11-.374.588.588 0 0 0-.169-.439Zm-.242-1.191c-.004 0-.004 0 0 0Zm-.835.214c0-.082.009-.137.018-.173.009-.032.027-.046.045-.06a.35.35 0 0 1 .142-.018c.164 0 .27.041.333.11.064.073.1.187.1.356a.637.637 0 0 1-.104.383c-.06.083-.174.133-.356.133h-.183v-.73h.004Zm.662 1.818c-.096.091-.242.137-.452.137a.36.36 0 0 1-.147-.019c-.022-.009-.036-.027-.045-.054a.634.634 0 0 1-.019-.17v-.826h.243c.21 0 .351.046.433.128.087.082.133.205.133.379 0 .2-.05.338-.146.425ZM69.2 6.637V6.806l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.717c0 .087-.01.142-.019.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.004v.169h.982V9.03l-.046-.005a.824.824 0 0 1-.169-.023.073.073 0 0 1-.046-.05.654.654 0 0 1-.018-.173V7.062c0-.087.01-.142.018-.174a.073.073 0 0 1 .046-.05.824.824 0 0 1 .17-.023l.045-.004v-.164l-.982-.01ZM68.328 5.724v-.165l-.046-.004a.823.823 0 0 1-.169-.023.072.072 0 0 1-.045-.05.648.648 0 0 1-.019-.174v-.785h1.028v.78c0 .087-.01.142-.019.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.005v.164h.982V5.55l-.046-.004a.821.821 0 0 1-.169-.023.072.072 0 0 1-.045-.05.653.653 0 0 1-.019-.174V3.587c0-.087.01-.142.019-.174a.072.072 0 0 1 .045-.05.821.821 0 0 1 .17-.023l.045-.004v-.169h-.982v.164l.046.005a.719.719 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v.767h-1.028v-.762c0-.087.01-.142.019-.174a.072.072 0 0 1 .045-.05.824.824 0 0 1 .17-.023l.045-.004v-.164h-.982V3.34l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.713c0 .086-.01.141-.019.173a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.005v.169h.982ZM74.465 3.372c.027.023.06.064.1.142l.699 1.287v.503c0 .086-.01.141-.018.173a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.005v.169l.927-.005.05.005v-.165l-.045-.004a.82.82 0 0 1-.169-.023.072.072 0 0 1-.046-.05.652.652 0 0 1-.018-.174v-.616l.539-1.069a1.07 1.07 0 0 1 .132-.205.244.244 0 0 1 .11-.078l.036-.009v-.16h-.703l-.05-.004v.164h.046c.1 0 .164.018.205.041.032.018.05.046.05.096a.673.673 0 0 1-.086.274l-.402.795-.53-1.014a.195.195 0 0 1-.027-.1c0-.014.004-.023.009-.033a.047.047 0 0 1 .027-.022c.028-.019.082-.028.16-.028h.05v-.173h-.885v.178h.05c.004 0 .023.004.05.027ZM74.538 8.701c0-.119.005-.21.01-.278l.004-.055h-.178l-.005.045a1.678 1.678 0 0 1-.073.38.32.32 0 0 1-.142.173.693.693 0 0 1-.3.055h-.252a.696.696 0 0 1-.169-.014.072.072 0 0 1-.046-.05.648.648 0 0 1-.018-.174V7.066c0-.086.01-.141.018-.173a.072.072 0 0 1 .046-.05.824.824 0 0 1 .169-.023l.046-.005v-.164h-.982V6.82l.046.004a.719.719 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.018.087.018.174v1.703c0 .087-.009.142-.018.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.004v.164h1.9l-.005-.054a5.229 5.229 0 0 1-.023-.434Z" }) })
15479
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { fill: "#FF3D4D", d: "M66.58 12.94h2.575v1.932l-1.287-.644-1.288.644v-1.931Z" }),
15480
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("g", { fill: "#FEF5EB", clipPath: "url(#bible-app-logo-lockup-clip)", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M70.602 5.614c.173.105.374.156.603.156.219 0 .42-.055.593-.17.178-.113.31-.273.407-.474.1-.206.146-.439.146-.694a1.57 1.57 0 0 0-.142-.694 1.05 1.05 0 0 0-.402-.452 1.135 1.135 0 0 0-.598-.156c-.219 0-.42.055-.598.17a1.15 1.15 0 0 0-.406.474 1.626 1.626 0 0 0-.142.694c0 .265.046.498.142.694.091.197.223.347.397.452Zm-.096-1.16c0-.232.027-.438.087-.616a.906.906 0 0 1 .246-.406.512.512 0 0 1 .356-.142c.133 0 .247.046.357.137.11.091.196.224.26.402.069.174.1.379.1.616 0 .233-.032.439-.09.617a.951.951 0 0 1-.248.41.516.516 0 0 1-.356.142.537.537 0 0 1-.356-.137.95.95 0 0 1-.265-.401 1.995 1.995 0 0 1-.091-.621ZM76.675 9.14a3.91 3.91 0 0 1-.014-.68l.005-.056h-.178l-.005.046a1.256 1.256 0 0 1-.073.36.324.324 0 0 1-.141.16.704.704 0 0 1-.302.05h-.25a.696.696 0 0 1-.17-.013.073.073 0 0 1-.046-.05.654.654 0 0 1-.018-.174v-.78h.178c.082 0 .142.022.183.059.041.036.069.1.082.187.014.096.019.15.023.169l.005.041H76.122l-.004-.05a8.485 8.485 0 0 1-.023-.489v-.164c0-.119.005-.228.01-.324l.004-.05H75.936l-.005.04-.01.07c-.009.077-.022.14-.036.186a.188.188 0 0 1-.073.11c-.032.027-.082.046-.155.046h-.178v-.768c0-.086.009-.141.018-.173.01-.028.023-.041.046-.046a.637.637 0 0 1 .169-.018h.287c.119 0 .201.018.251.046a.241.241 0 0 1 .105.132c.023.064.046.174.06.32l.004.045h.178l-.009-.054a2.264 2.264 0 0 1-.009-.21c0-.12.01-.252.023-.402l.005-.055h-1.832v.164l.046.005a.719.719 0 0 1 .165.023.07.07 0 0 1 .05.05c.009.032.018.087.018.173v1.708c0 .087-.01.142-.018.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.004v.165h1.9v-.05ZM74.543 5.724l-.005-.055a3.91 3.91 0 0 1-.014-.717l.005-.055h-.178l-.005.046a1.678 1.678 0 0 1-.073.38.31.31 0 0 1-.146.173.693.693 0 0 1-.301.054h-.251a.695.695 0 0 1-.17-.013.072.072 0 0 1-.045-.05.653.653 0 0 1-.018-.174V3.587c0-.087.009-.142.018-.174a.072.072 0 0 1 .046-.05.82.82 0 0 1 .168-.023l.046-.004v-.164h-.982V3.34l.046.005a.72.72 0 0 1 .165.023.07.07 0 0 1 .05.05c.009.032.018.087.018.173v1.713c0 .087-.01.141-.018.173a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.005v.164l1.904.005ZM68.762 8.034c-.091-.095-.233-.164-.411-.205a.685.685 0 0 0 .27-.2.61.61 0 0 0 .136-.389.522.522 0 0 0-.21-.434c-.137-.11-.329-.16-.57-.16l-.996-.009V6.806l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.717c0 .087-.01.142-.019.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.004v.169l1.073-.004c.178 0 .329-.028.461-.087a.705.705 0 0 0 .306-.256.666.666 0 0 0 .11-.374.555.555 0 0 0-.17-.439Zm-1.078-.977a.71.71 0 0 1 .018-.173c.01-.032.028-.046.046-.06a.349.349 0 0 1 .142-.018c.164 0 .269.041.333.11.064.073.1.187.1.356a.637.637 0 0 1-.105.383c-.059.083-.173.133-.356.133h-.182v-.73h.004Zm.662 1.818c-.096.091-.242.137-.452.137a.375.375 0 0 1-.146-.019c-.023-.009-.036-.027-.046-.054a.639.639 0 0 1-.018-.17v-.826h.242c.21 0 .352.046.434.128.087.082.132.205.132.379 0 .2-.05.338-.146.425ZM72.232 8.034s-.004 0 0 0c-.004 0-.004 0 0 0a.812.812 0 0 0-.41-.205.686.686 0 0 0 .269-.2.61.61 0 0 0 .137-.389.522.522 0 0 0-.21-.434c-.138-.11-.33-.16-.571-.16l-.996-.009V6.806l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.717c0 .087-.01.142-.018.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.004v.169l1.073-.004c.178 0 .33-.028.462-.087a.706.706 0 0 0 .305-.256.667.667 0 0 0 .11-.374.588.588 0 0 0-.169-.439Zm-.242-1.191c-.004 0-.004 0 0 0Zm-.835.214c0-.082.009-.137.018-.173.009-.032.027-.046.045-.06a.35.35 0 0 1 .142-.018c.164 0 .27.041.333.11.064.073.1.187.1.356a.637.637 0 0 1-.104.383c-.06.083-.174.133-.356.133h-.183v-.73h.004Zm.662 1.818c-.096.091-.242.137-.452.137a.36.36 0 0 1-.147-.019c-.022-.009-.036-.027-.045-.054a.634.634 0 0 1-.019-.17v-.826h.243c.21 0 .351.046.433.128.087.082.133.205.133.379 0 .2-.05.338-.146.425ZM69.2 6.637V6.806l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.717c0 .087-.01.142-.019.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.004v.169h.982V9.03l-.046-.005a.824.824 0 0 1-.169-.023.073.073 0 0 1-.046-.05.654.654 0 0 1-.018-.173V7.062c0-.087.01-.142.018-.174a.073.073 0 0 1 .046-.05.824.824 0 0 1 .17-.023l.045-.004v-.164l-.982-.01ZM68.328 5.724v-.165l-.046-.004a.823.823 0 0 1-.169-.023.072.072 0 0 1-.045-.05.648.648 0 0 1-.019-.174v-.785h1.028v.78c0 .087-.01.142-.019.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.005v.164h.982V5.55l-.046-.004a.821.821 0 0 1-.169-.023.072.072 0 0 1-.045-.05.653.653 0 0 1-.019-.174V3.587c0-.087.01-.142.019-.174a.072.072 0 0 1 .045-.05.821.821 0 0 1 .17-.023l.045-.004v-.169h-.982v.164l.046.005a.719.719 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v.767h-1.028v-.762c0-.087.01-.142.019-.174a.072.072 0 0 1 .045-.05.824.824 0 0 1 .17-.023l.045-.004v-.164h-.982V3.34l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.713c0 .086-.01.141-.019.173a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.005v.169h.982ZM74.465 3.372c.027.023.06.064.1.142l.699 1.287v.503c0 .086-.01.141-.018.173a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.005v.169l.927-.005.05.005v-.165l-.045-.004a.82.82 0 0 1-.169-.023.072.072 0 0 1-.046-.05.652.652 0 0 1-.018-.174v-.616l.539-1.069a1.07 1.07 0 0 1 .132-.205.244.244 0 0 1 .11-.078l.036-.009v-.16h-.703l-.05-.004v.164h.046c.1 0 .164.018.205.041.032.018.05.046.05.096a.673.673 0 0 1-.086.274l-.402.795-.53-1.014a.195.195 0 0 1-.027-.1c0-.014.004-.023.009-.033a.047.047 0 0 1 .027-.022c.028-.019.082-.028.16-.028h.05v-.173h-.885v.178h.05c.004 0 .023.004.05.027ZM74.538 8.701c0-.119.005-.21.01-.278l.004-.055h-.178l-.005.045a1.678 1.678 0 0 1-.073.38.32.32 0 0 1-.142.173.693.693 0 0 1-.3.055h-.252a.696.696 0 0 1-.169-.014.072.072 0 0 1-.046-.05.648.648 0 0 1-.018-.174V7.066c0-.086.01-.141.018-.173a.072.072 0 0 1 .046-.05.824.824 0 0 1 .169-.023l.046-.005v-.164h-.982V6.82l.046.004a.719.719 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.018.087.018.174v1.703c0 .087-.009.142-.018.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.004v.164h1.9l-.005-.054a5.229 5.229 0 0 1-.023-.434Z" }) })
14761
15481
  ] }),
14762
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
15482
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
14763
15483
  "path",
14764
15484
  {
14765
15485
  fill: "currentColor",
14766
15486
  d: "M1 2.706h3.248c.684 0 1.245.066 1.683.198.438.122.785.298 1.039.526.263.219.443.482.539.789a3.1 3.1 0 0 1 .145.96c0 .394-.088.762-.263 1.104-.176.333-.496.61-.96.829.298.131.543.28.736.447.193.167.346.346.46.54.114.183.193.38.237.59a3.206 3.206 0 0 1-.118 1.71c-.114.342-.307.64-.579.895-.272.245-.627.442-1.065.591-.438.14-.978.21-1.618.21H1V2.707ZM4.431 6.56c.622 0 1.056-.114 1.302-.342.245-.228.368-.557.368-.987 0-.447-.145-.767-.434-.96-.28-.201-.772-.302-1.473-.302H2.538v2.59h1.894Zm0 4.26c.377 0 .688-.035.933-.105.255-.07.452-.17.592-.302.15-.132.255-.29.316-.474s.092-.39.092-.618c0-.473-.136-.833-.408-1.078-.263-.254-.723-.382-1.38-.382H2.537v2.96h1.894Zm6.373-8.114v1.486H9.253V2.706h1.552Zm-.026 2.552v6.838h-1.5V5.258h1.5ZM13.976 8.9c.009.439.061.798.158 1.079.105.28.236.504.394.67.167.167.355.28.566.342.21.062.43.092.657.092.246 0 .474-.043.684-.131.21-.088.395-.224.552-.408.158-.193.28-.443.369-.75.087-.306.131-.683.131-1.13 0-.43-.048-.794-.145-1.092a2.062 2.062 0 0 0-.355-.736 1.314 1.314 0 0 0-.539-.421 1.566 1.566 0 0 0-.631-.132 2.06 2.06 0 0 0-.842.158 1.493 1.493 0 0 0-.565.447 1.9 1.9 0 0 0-.329.697c-.07.263-.105.557-.105.881V8.9Zm.013-6.194v3.446c.272-.36.583-.631.934-.816.36-.192.775-.289 1.249-.289.49 0 .916.088 1.276.263.359.176.657.421.894.737a3.2 3.2 0 0 1 .526 1.144c.123.438.184.925.184 1.46 0 .56-.07 1.07-.21 1.525-.14.447-.342.828-.605 1.144a2.768 2.768 0 0 1-.947.736c-.368.167-.78.25-1.236.25-.412 0-.794-.079-1.144-.236-.351-.158-.671-.421-.96-.79v.816h-1.447v-9.39h1.486Zm8.053 0v9.39h-1.5v-9.39h1.5Zm7.8 7.365c-.123.71-.426 1.262-.908 1.657-.482.386-1.175.578-2.078.578-1.087 0-1.916-.31-2.485-.933-.561-.632-.842-1.517-.842-2.657 0-.587.079-1.109.237-1.565.166-.456.394-.837.684-1.144a2.868 2.868 0 0 1 1.052-.71c.412-.167.863-.25 1.354-.25.526 0 .982.083 1.368.25.386.158.706.386.96.684.254.29.443.64.565 1.052.123.403.184.855.184 1.354v.658h-4.905c.018.622.176 1.127.474 1.512.298.386.75.579 1.354.579.474 0 .829-.092 1.065-.276.237-.184.395-.447.474-.79h1.446Zm-1.368-2.065c0-.561-.132-1.004-.395-1.328-.263-.325-.684-.487-1.262-.487-.553 0-.973.167-1.263.5-.29.324-.456.763-.5 1.315h3.42Zm8.715-5.3h1.578l3.577 9.39h-1.696l-.881-2.393h-3.643l-.868 2.393h-1.644l3.577-9.39Zm2.144 5.668-1.394-3.866-1.381 3.866h2.775Zm3.992-3.116h1.46v.946c.28-.377.6-.661.96-.854.367-.202.788-.303 1.262-.303.482 0 .903.088 1.262.263.36.167.658.408.894.723.246.316.426.697.54 1.145.122.438.184.929.184 1.472 0 .553-.07 1.057-.21 1.513a3.46 3.46 0 0 1-.606 1.157 2.642 2.642 0 0 1-.933.736c-.368.167-.785.25-1.25.25-.368 0-.727-.07-1.078-.21-.35-.14-.68-.399-.986-.776v3.327h-1.5v-9.39Zm1.485 3.537c0 .447.049.82.145 1.118.097.29.224.522.382.697.166.175.355.298.565.368.22.07.447.105.684.105.245 0 .473-.043.684-.131.21-.088.394-.228.552-.421.158-.193.28-.443.368-.75.088-.306.132-.679.132-1.117 0-.447-.048-.82-.145-1.118a1.933 1.933 0 0 0-.368-.737 1.229 1.229 0 0 0-.526-.407 1.718 1.718 0 0 0-.631-.119c-.535 0-.978.176-1.329.526-.342.351-.513.903-.513 1.657v.33Zm6.541-3.537h1.46v.946c.28-.377.6-.661.96-.854a2.585 2.585 0 0 1 1.262-.303c.482 0 .903.088 1.263.263.36.167.657.408.894.723.245.316.425.697.54 1.145.122.438.183.929.183 1.472 0 .553-.07 1.057-.21 1.513a3.46 3.46 0 0 1-.605 1.157 2.642 2.642 0 0 1-.934.736c-.368.167-.784.25-1.25.25a2.88 2.88 0 0 1-1.078-.21c-.35-.14-.679-.399-.986-.776v3.327h-1.499v-9.39Zm1.486 3.537c0 .447.048.82.145 1.118.096.29.223.522.381.697.167.175.355.298.566.368.219.07.447.105.683.105.246 0 .474-.043.684-.131a1.41 1.41 0 0 0 .553-.421c.157-.193.28-.443.368-.75.087-.306.131-.679.131-1.117 0-.447-.048-.82-.144-1.118a1.933 1.933 0 0 0-.369-.737 1.228 1.228 0 0 0-.526-.407 1.717 1.717 0 0 0-.63-.119c-.536 0-.978.176-1.329.526-.342.351-.513.903-.513 1.657v.33Z"
14767
15487
  }
14768
15488
  ),
14769
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("defs", { children: [
14770
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
15489
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("defs", { children: [
15490
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
14771
15491
  "linearGradient",
14772
15492
  {
14773
15493
  id: "bible-app-logo-lockup-gradient-a",
@@ -14777,12 +15497,12 @@ var SvgComponent3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
14777
15497
  y2: 16.438,
14778
15498
  gradientUnits: "userSpaceOnUse",
14779
15499
  children: [
14780
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("stop", { stopColor: "#C93D34" }),
14781
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("stop", { offset: 1, stopColor: "#7A2629" })
15500
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("stop", { stopColor: "#C93D34" }),
15501
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("stop", { offset: 1, stopColor: "#7A2629" })
14782
15502
  ]
14783
15503
  }
14784
15504
  ),
14785
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
15505
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
14786
15506
  "linearGradient",
14787
15507
  {
14788
15508
  id: "bible-app-logo-lockup-gradient-c",
@@ -14792,182 +15512,20 @@ var SvgComponent3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
14792
15512
  y2: 16.438,
14793
15513
  gradientUnits: "userSpaceOnUse",
14794
15514
  children: [
14795
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("stop", { stopColor: "#C93D34" }),
14796
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("stop", { offset: 1, stopColor: "#7A2629" })
15515
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("stop", { stopColor: "#C93D34" }),
15516
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("stop", { offset: 1, stopColor: "#7A2629" })
14797
15517
  ]
14798
15518
  }
14799
15519
  ),
14800
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("clipPath", { id: "bible-app-logo-lockup-clip", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { fill: "#fff", d: "M65.52 2.472h12.521V9.68h-12.52z" }) })
15520
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("clipPath", { id: "bible-app-logo-lockup-clip", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { fill: "#fff", d: "M65.52 2.472h12.521V9.68h-12.52z" }) })
14801
15521
  ] })
14802
15522
  ]
14803
15523
  }
14804
15524
  );
14805
15525
 
14806
- // src/components/verse.tsx
14807
- var import_react7 = __toESM(require("react"), 1);
14808
- var import_isomorphic_dompurify = __toESM(require("isomorphic-dompurify"), 1);
14809
- var import_platform_react_hooks2 = require("@youversion/platform-react-hooks");
14810
- var import_jsx_runtime14 = require("react/jsx-runtime");
14811
- var NON_BREAKING_SPACE = "\xA0";
14812
- var DOMPURIFY_CONFIG = {
14813
- ALLOWED_ATTR: ["class", "style", "id"],
14814
- ALLOW_DATA_ATTR: true
14815
- };
14816
- function yvDomTransformer(html) {
14817
- if (!window || !("DOMParser" in window)) {
14818
- return html;
14819
- }
14820
- const sanitizedHtml = import_isomorphic_dompurify.default.sanitize(html, DOMPURIFY_CONFIG);
14821
- const parser = new DOMParser();
14822
- const doc = parser.parseFromString(sanitizedHtml, "text/html");
14823
- const paragraphs = doc.querySelectorAll(".yv-vlbl");
14824
- paragraphs.forEach((p) => {
14825
- const text = p.textContent || "";
14826
- if (!text.endsWith(NON_BREAKING_SPACE)) {
14827
- p.textContent = text + NON_BREAKING_SPACE;
14828
- }
14829
- });
14830
- const tables = doc.querySelectorAll("table");
14831
- tables.forEach((table) => {
14832
- const rows = table.querySelectorAll("tr");
14833
- if (rows.length === 0) return;
14834
- let maxColumns = 0;
14835
- rows.forEach((row) => {
14836
- const cells = row.querySelectorAll("td, th");
14837
- let rowColumnCount = 0;
14838
- cells.forEach((cell) => {
14839
- if (cell instanceof HTMLTableCellElement) {
14840
- const colspan = parseInt(cell.getAttribute("colspan") || "1", 10);
14841
- rowColumnCount += colspan;
14842
- } else {
14843
- rowColumnCount += 1;
14844
- }
14845
- });
14846
- maxColumns = Math.max(maxColumns, rowColumnCount);
14847
- });
14848
- if (maxColumns > 1) {
14849
- rows.forEach((row) => {
14850
- const cells = row.querySelectorAll("td, th");
14851
- if (cells.length === 1) {
14852
- const cell = cells[0];
14853
- if (cell instanceof HTMLTableCellElement) {
14854
- const existingColspan = parseInt(cell.getAttribute("colspan") || "1", 10);
14855
- if (existingColspan < maxColumns) {
14856
- cell.setAttribute("colspan", maxColumns.toString());
14857
- }
14858
- }
14859
- }
14860
- });
14861
- }
14862
- });
14863
- const modifiedHtml = doc.body.innerHTML;
14864
- return modifiedHtml;
14865
- }
14866
- var Verse = {
14867
- /**
14868
- * Renders a single verse with superscript number and text.
14869
- *
14870
- * @param props - The verse properties.
14871
- * @param props.number - The verse number.
14872
- * @param props.text - The verse text.
14873
- * @param props.size - The size variant. Defaults to 'default'.
14874
- * @returns The rendered verse element.
14875
- */
14876
- Text: ({ number: number4, text, size = "default" }) => {
14877
- if (size === "lg") {
14878
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "yv:[&>p]:inline-block", children: [
14879
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("sup", { className: "yv:text-muted-foreground yv:align-super yv:text-[0.6em]", children: number4 }),
14880
- "\xA0",
14881
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "yv:font-serif! yv:text-xl yv:text-primary", children: text }),
14882
- "\xA0"
14883
- ] });
14884
- }
14885
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "yv:[&>p]:inline-block", children: [
14886
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("sup", { className: "yv:text-muted-foreground yv:align-super yv:text-[0.6em]", children: number4 }),
14887
- "\xA0",
14888
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "yv:text-primary", children: text }),
14889
- "\xA0"
14890
- ] });
14891
- },
14892
- Html: ({
14893
- html,
14894
- fontFamily,
14895
- fontSize,
14896
- lineHeight,
14897
- showVerseNumbers = true
14898
- }) => {
14899
- const [transformedHtml, setTransformedHtml] = import_react7.default.useState(html);
14900
- import_react7.default.useEffect(() => {
14901
- setTransformedHtml(yvDomTransformer(html));
14902
- }, [html]);
14903
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14904
- "section",
14905
- {
14906
- style: {
14907
- ...fontFamily ? { "--yv-reader-font-family": fontFamily } : {},
14908
- ...fontSize ? { "--yv-reader-font-size": `${fontSize}px` } : {},
14909
- ...lineHeight ? { "--yv-reader-line-height": lineHeight } : {}
14910
- },
14911
- "data-show-verse-numbers": showVerseNumbers,
14912
- "data-slot": "yv-bible-renderer",
14913
- dangerouslySetInnerHTML: { __html: transformedHtml }
14914
- }
14915
- );
14916
- }
14917
- };
14918
- var BibleTextView = ({
14919
- reference,
14920
- fontFamily,
14921
- fontSize,
14922
- lineHeight,
14923
- versionId,
14924
- showVerseNumbers
14925
- }) => {
14926
- const { passage, loading, error: error46 } = (0, import_platform_react_hooks2.usePassage)({
14927
- versionId,
14928
- usfm: reference,
14929
- include_headings: true,
14930
- include_notes: true
14931
- });
14932
- if (loading) {
14933
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14934
- Verse.Html,
14935
- {
14936
- html: "<span>Loading...</span>",
14937
- fontFamily,
14938
- fontSize,
14939
- lineHeight,
14940
- showVerseNumbers
14941
- }
14942
- );
14943
- }
14944
- if (error46) {
14945
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14946
- Verse.Html,
14947
- {
14948
- html: '<span class="wj">We have run into an error...</span>',
14949
- fontFamily,
14950
- fontSize,
14951
- lineHeight,
14952
- showVerseNumbers
14953
- }
14954
- );
14955
- }
14956
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14957
- Verse.Html,
14958
- {
14959
- html: passage?.content || "",
14960
- fontFamily,
14961
- fontSize,
14962
- lineHeight,
14963
- showVerseNumbers
14964
- }
14965
- );
14966
- };
14967
-
14968
15526
  // src/components/verse-of-the-day.tsx
14969
- var import_platform_react_hooks3 = require("@youversion/platform-react-hooks");
14970
- var import_jsx_runtime15 = require("react/jsx-runtime");
15527
+ var import_platform_react_hooks5 = require("@youversion/platform-react-hooks");
15528
+ var import_jsx_runtime19 = require("react/jsx-runtime");
14971
15529
  function VerseOfTheDay({
14972
15530
  dayOfYear,
14973
15531
  versionId = 1,
@@ -14978,20 +15536,20 @@ function VerseOfTheDay({
14978
15536
  showBibleAppAttribution = true,
14979
15537
  size = "default"
14980
15538
  }) {
14981
- const day = import_react8.default.useMemo(
14982
- () => dayOfYear || (0, import_platform_react_hooks3.getDayOfYear)(/* @__PURE__ */ new Date()),
15539
+ const day = import_react10.default.useMemo(
15540
+ () => dayOfYear || (0, import_platform_react_hooks5.getDayOfYear)(/* @__PURE__ */ new Date()),
14983
15541
  [dayOfYear]
14984
15542
  );
14985
15543
  const {
14986
15544
  data,
14987
15545
  loading: loadingVerseOfTheDay,
14988
15546
  error: errorVerseOfTheDay
14989
- } = (0, import_platform_react_hooks3.useVerseOfTheDay)(day);
15547
+ } = (0, import_platform_react_hooks5.useVerseOfTheDay)(day);
14990
15548
  const {
14991
15549
  passage,
14992
15550
  loading: loadingPassage,
14993
15551
  error: errorPassage
14994
- } = (0, import_platform_react_hooks3.usePassage)({
15552
+ } = (0, import_platform_react_hooks5.usePassage)({
14995
15553
  versionId,
14996
15554
  usfm: data?.passage_id || "",
14997
15555
  options: {
@@ -15008,34 +15566,34 @@ function VerseOfTheDay({
15008
15566
  } else {
15009
15567
  referenceText = "No verse found";
15010
15568
  }
15011
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
15569
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
15012
15570
  "section",
15013
15571
  {
15014
15572
  "data-size": size,
15015
15573
  className: "yv:data-[size=lg]:p-8 yv:data-[size=default]:p-4 yv:*:shrink-0 yv:font-sans yv:flex yv:flex-col yv:gap-3 yv:max-w-screen-sm yv:p-4 yv:shadow yv:rounded-2xl",
15016
15574
  children: [
15017
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "yv:flex yv:items-center yv:gap-2", children: [
15018
- showSunIcon ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
15575
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "yv:flex yv:items-center yv:gap-2", children: [
15576
+ showSunIcon ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
15019
15577
  "div",
15020
15578
  {
15021
15579
  "data-slot": "card-icon",
15022
15580
  className: "yv:col-start-1 yv:row-start-1 yv:self-start yv:justify-self-start",
15023
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SvgComponent, { className: "yv:shrink-0 yv:h-10 yv:w-10" })
15581
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SvgComponent, { className: "yv:shrink-0 yv:h-10 yv:w-10" })
15024
15582
  }
15025
15583
  ) : null,
15026
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "yv:grow yv:grid", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
15584
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "yv:grow yv:grid", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
15027
15585
  "p",
15028
15586
  {
15029
15587
  className: "trim-both yv:line-clamp-1 yv:text-muted-foreground yv:uppercase yv:text-xs yv:font-medium yv:select-none",
15030
15588
  children: "Verse of The Day"
15031
15589
  }
15032
15590
  ) }),
15033
- showShareButton ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
15591
+ showShareButton ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
15034
15592
  "div",
15035
15593
  {
15036
15594
  "data-slot": "card-action",
15037
15595
  className: "yv:col-start-2 yv:row-span-2 yv:row-start-1 yv:self-start yv:justify-self-end",
15038
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
15596
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
15039
15597
  Button,
15040
15598
  {
15041
15599
  "aria-label": "Share",
@@ -15045,13 +15603,13 @@ function VerseOfTheDay({
15045
15603
  onClick: () => alert("Share: To be implemented..."),
15046
15604
  size: "icon",
15047
15605
  variant: "ghost",
15048
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SvgComponent2, { className: "yv:h-6! yv:w-6!" })
15606
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SvgComponent2, { className: "yv:h-6! yv:w-6!" })
15049
15607
  }
15050
15608
  )
15051
15609
  }
15052
15610
  ) : null
15053
15611
  ] }),
15054
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: passage ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
15612
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { children: passage ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
15055
15613
  Verse.Html,
15056
15614
  {
15057
15615
  fontSize: size === "default" ? 16 : 20,
@@ -15059,13 +15617,13 @@ function VerseOfTheDay({
15059
15617
  html: passage?.content || ""
15060
15618
  }
15061
15619
  ) : null }),
15062
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "yv:text-(--yv-gray-30) yv:font-medium yv:text-sm", children: referenceText }),
15063
- showReadFullChapterButton || showBibleAppAttribution ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
15620
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "yv:text-(--yv-gray-30) yv:font-medium yv:text-sm", children: referenceText }),
15621
+ showReadFullChapterButton || showBibleAppAttribution ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
15064
15622
  "div",
15065
15623
  {
15066
15624
  className: 'yv:grid yv:grid-cols-1 yv:[:has([data-slot="card-action"]):has([data-slot="attribution"])]:grid-cols-2 yv:mt-4 yv:justify-between yv:items-center yv:gap-2 yv:w-full',
15067
15625
  children: [
15068
- showReadFullChapterButton ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
15626
+ showReadFullChapterButton ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
15069
15627
  Button,
15070
15628
  {
15071
15629
  "data-slot": "card-action",
@@ -15075,7 +15633,7 @@ function VerseOfTheDay({
15075
15633
  children: "Read Full Chapter"
15076
15634
  }
15077
15635
  ) : null,
15078
- showBibleAppAttribution ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
15636
+ showBibleAppAttribution ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
15079
15637
  SvgComponent3,
15080
15638
  {
15081
15639
  "data-slot": "attribution",
@@ -15091,7 +15649,7 @@ function VerseOfTheDay({
15091
15649
  }
15092
15650
 
15093
15651
  // src/index.ts
15094
- var import_platform_react_hooks4 = require("@youversion/platform-react-hooks");
15652
+ var import_platform_react_hooks6 = require("@youversion/platform-react-hooks");
15095
15653
  // Annotate the CommonJS export names for ESM import in node:
15096
15654
  0 && (module.exports = {
15097
15655
  ApiClient,
@@ -15101,8 +15659,10 @@ var import_platform_react_hooks4 = require("@youversion/platform-react-hooks");
15101
15659
  BOOK_IDS,
15102
15660
  BibleChapterPicker,
15103
15661
  BibleClient,
15662
+ BibleReader,
15104
15663
  BibleSDKProvider,
15105
15664
  BibleTextView,
15665
+ BibleVersionPicker,
15106
15666
  HighlightsClient,
15107
15667
  LanguagesClient,
15108
15668
  MemoryStorageStrategy,