@inappstory/react-sdk 1.16.7 → 1.16.9

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.
@@ -4678,7 +4678,7 @@ class StoryFeedStatisticV1Service {
4678
4678
 
4679
4679
  /***/ },
4680
4680
 
4681
- /***/ 7233
4681
+ /***/ 7737
4682
4682
  (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4683
4683
 
4684
4684
 
@@ -4697,7 +4697,8 @@ __webpack_require__.d(__webpack_exports__, {
4697
4697
  Lf: () => (/* reexport */ GameSession),
4698
4698
  rp: () => (/* reexport */ GameSessionFactory),
4699
4699
  Uy: () => (/* reexport */ GameShareModule),
4700
- rK: () => (/* reexport */ GameStoryLocalDataModule)
4700
+ rK: () => (/* reexport */ GameStoryLocalDataModule),
4701
+ ey: () => (/* reexport */ GameTextInputModule)
4701
4702
  });
4702
4703
 
4703
4704
  // UNUSED EXPORTS: GameForegroundTimeoutError, GameSplashLottieScreen
@@ -4851,7 +4852,7 @@ class GameClientConfig {
4851
4852
  value: void 0
4852
4853
  });
4853
4854
  const storyManagerConfig = this.storyManager.config;
4854
- const sdkVersion = "1.16.7";
4855
+ const sdkVersion = "1.16.9";
4855
4856
  const placeholders = this.storyManager.rootStore.placeholderStore.placeholders;
4856
4857
  const session = this.storyManager.rootStore.sessionStore.session;
4857
4858
  this.sessionId = session.id;
@@ -5228,7 +5229,8 @@ class Game {
5228
5229
  return (0,external_deepmerge_["default"])(this.config.toJSON(), {
5229
5230
  clientConfig: Object.assign({ fullScreen: this.isReaderInFullscreen(), screenOrientation: this.screenOptions.orientation, variables: this.storyManager.config.options, safeAreaInsets: payload.safeAreaInsets, widescreen: payload.isWidescreen, dir: this.languageDirection, nonce: (0,helpers/* getNonce */.m9)(), sdkFeatures: {
5230
5231
  gameShouldForegroundCallback: true,
5231
- writeToClipboard: true
5232
+ writeToClipboard: true,
5233
+ showTextInput: true
5232
5234
  } }, this.clientConfig.toJSON())
5233
5235
  });
5234
5236
  }
@@ -5958,6 +5960,36 @@ class GameLoggerModule {
5958
5960
  }
5959
5961
  }
5960
5962
 
5963
+ // EXTERNAL MODULE: ../core/src/helpers/showSystemTextInput.ts
5964
+ var showSystemTextInput = __webpack_require__(1207);
5965
+ ;// ../core/src/domain/gameCenter/modules/gameTextInputModule/gameTextInputModule.ts
5966
+
5967
+ class GameTextInputModule {
5968
+ constructor() {
5969
+ Object.defineProperty(this, "handleShowTextInput", {
5970
+ enumerable: true,
5971
+ configurable: true,
5972
+ writable: true,
5973
+ value: (session, payload) => {
5974
+ try {
5975
+ const { id, cb, config } = JSON.parse(payload);
5976
+ const value = (0,showSystemTextInput/* showSystemTextInputFromGameConfig */.g)(config);
5977
+ session.sendMessage("cb", {
5978
+ cb,
5979
+ arguments: JSON.stringify([id, value])
5980
+ });
5981
+ }
5982
+ catch (error) {
5983
+ console.error(error);
5984
+ }
5985
+ }
5986
+ });
5987
+ }
5988
+ attach(session, _game) {
5989
+ session.on("showTextInput" /* GameSessionEvent.ShowTextInput */, (payload) => this.handleShowTextInput(session, payload));
5990
+ }
5991
+ }
5992
+
5961
5993
  ;// ../core/src/domain/gameCenter/modules/index.ts
5962
5994
 
5963
5995
 
@@ -5969,6 +6001,7 @@ class GameLoggerModule {
5969
6001
 
5970
6002
 
5971
6003
 
6004
+
5972
6005
  ;// ../core/src/domain/gameCenter/index.ts
5973
6006
 
5974
6007
 
@@ -6095,7 +6128,7 @@ let IamApi = (() => {
6095
6128
  }, {
6096
6129
  params: {
6097
6130
  fields: messageFieldsWithPrefix,
6098
- expand: "messages.slides"
6131
+ expand: "messages.slides,messages.custom_attributes"
6099
6132
  },
6100
6133
  signal
6101
6134
  });
@@ -6111,13 +6144,21 @@ let IamApi = (() => {
6111
6144
  });
6112
6145
  return response.data;
6113
6146
  }
6114
- async fetchById(messageId, signal) {
6115
- const response = await api["default"].get(`inappmessaging/message/${messageId}`, {
6147
+ async fetchById(messageId, options = {}) {
6148
+ const body = {
6149
+ tags: (0,helpers/* filterTags */._N)(this.storyManager.config.tags),
6150
+ targeting: Boolean(options.targeting)
6151
+ };
6152
+ const pos = this.storyManager.config.options.pos;
6153
+ if (pos != null && pos !== "") {
6154
+ body.options = { pos: pos.toString() };
6155
+ }
6156
+ const response = await api["default"].post(`inappmessaging/message/${messageId}`, body, {
6116
6157
  params: {
6117
- expand: "slides",
6158
+ expand: "slides,custom_attributes",
6118
6159
  fields: messageFields
6119
6160
  },
6120
- signal
6161
+ signal: options.signal
6121
6162
  });
6122
6163
  const messageDto = response.data;
6123
6164
  if (!messageDto)
@@ -6908,6 +6949,12 @@ let IamMessage = (() => {
6908
6949
  writable: true,
6909
6950
  value: ""
6910
6951
  });
6952
+ Object.defineProperty(this, "_customAttributes", {
6953
+ enumerable: true,
6954
+ configurable: true,
6955
+ writable: true,
6956
+ value: void 0
6957
+ });
6911
6958
  Object.defineProperty(this, "_openTime", {
6912
6959
  enumerable: true,
6913
6960
  configurable: true,
@@ -6973,6 +7020,9 @@ let IamMessage = (() => {
6973
7020
  get disableClose() {
6974
7021
  return this._disableClose;
6975
7022
  }
7023
+ get customAttributes() {
7024
+ return this._customAttributes;
7025
+ }
6976
7026
  destroy() { }
6977
7027
  updateByDto(messageDto) {
6978
7028
  var _b, _c, _d;
@@ -6986,6 +7036,7 @@ let IamMessage = (() => {
6986
7036
  this._hasLimit = Boolean(messageDto.has_limit);
6987
7037
  this._appearanceOptions = new IamAppearanceOptionsFactory().create(this._type, messageDto.appearance);
6988
7038
  this._needPlaceholders = messageDto.need_placeholders;
7039
+ this._customAttributes = messageDto.custom_attributes;
6989
7040
  this.updateMessageSlides(messageDto.slides);
6990
7041
  }
6991
7042
  hasEvent(eventName) {
@@ -7001,7 +7052,8 @@ let IamMessage = (() => {
7001
7052
  return {
7002
7053
  id: this._id,
7003
7054
  campaignName: this._campaignName,
7004
- type: this._type
7055
+ type: this._type,
7056
+ extraFields: this._customAttributes
7005
7057
  };
7006
7058
  }
7007
7059
  updateMessageSlides(slideDtos) {
@@ -7367,7 +7419,10 @@ class IamDisplayService {
7367
7419
  .checkOtherReadersAreClosed()
7368
7420
  .checkShowOnlyIfLoaded(options.showOnlyIfLoaded)
7369
7421
  .validate();
7370
- const message = await this.iamStore.findById(messageId, { signal: options.signal });
7422
+ const message = await this.iamStore.findById(messageId, {
7423
+ signal: options.signal,
7424
+ targeting: options.targeting
7425
+ });
7371
7426
  if (message.hasLimit)
7372
7427
  await this.checkMesageLimit(messageId, options.signal);
7373
7428
  this.logger.debug("message resolved by id", {
@@ -7486,7 +7541,7 @@ class IamDisplayService {
7486
7541
  /* harmony import */ var _session__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6317);
7487
7542
  /* harmony import */ var _stories__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5804);
7488
7543
  /* harmony import */ var _feeds__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8);
7489
- /* harmony import */ var _gameCenter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7233);
7544
+ /* harmony import */ var _gameCenter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7737);
7490
7545
  /* harmony import */ var _placeholders__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7241);
7491
7546
  /* harmony import */ var _storyManagerConfig__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(712);
7492
7547
  /* harmony import */ var _inAppMessaging__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(632);
@@ -7633,7 +7688,7 @@ var api = __webpack_require__(861);
7633
7688
 
7634
7689
 
7635
7690
  const openFields = "session,server_timestamp,user_key,share,preview_aspect_ratio,placeholders,image_placeholders,is_allow_ugc,is_allow_statistic_v2,is_game_reader_default_fullscreen,debug_session_key";
7636
- const openFeatures = "animation,data,deeplink,placeholder,resetTimers,gameReader,sendApi,swipeUpItems,imgPlaceholder,vod,closeStoryApi,slideTimerEndApi,multislideIam,scrollview";
7691
+ const openFeatures = "animation,data,deeplink,placeholder,resetTimers,gameReader,sendApi,swipeUpItems,imgPlaceholder,vod,closeStoryApi,slideTimerEndApi,multislideIam,scrollview,textInputApi";
7637
7692
  class SessionApi {
7638
7693
  async open(payload) {
7639
7694
  var _a;
@@ -7891,6 +7946,14 @@ var feeds = __webpack_require__(8);
7891
7946
 
7892
7947
 
7893
7948
 
7949
+ const STORY_BASE_EXPAND_FIELDS = ["slides", "custom_attributes"];
7950
+ function buildStoryUrl(id, feedSlug) {
7951
+ return `${feedSlug === feeds/* UGCFeedSlug */.rT ? "ugc/" : ""}story/${id}`;
7952
+ }
7953
+ function buildStoryExpandParam(fetchShareUrl) {
7954
+ const expandFields = fetchShareUrl ? [...STORY_BASE_EXPAND_FIELDS, "share_url"] : STORY_BASE_EXPAND_FIELDS;
7955
+ return expandFields.join(",");
7956
+ }
7894
7957
  class StoriesApi {
7895
7958
  constructor(storyManager) {
7896
7959
  Object.defineProperty(this, "storyManager", {
@@ -7901,26 +7964,49 @@ class StoriesApi {
7901
7964
  });
7902
7965
  }
7903
7966
  async fetchStorySlides({ id, feedSlug }) {
7904
- const { url, params } = this.getStoryRequestConfig(id, feedSlug);
7905
- const response = await src_api["default"].get(url, { params });
7967
+ const response = await src_api["default"].get(buildStoryUrl(id, feedSlug), {
7968
+ params: {
7969
+ expand: buildStoryExpandParam(),
7970
+ fields: ["id", "slides"].join(",")
7971
+ }
7972
+ });
7906
7973
  return response.data;
7907
7974
  }
7908
- async fetchStory({ id, feedSlug, fetchShareUrl, once }) {
7909
- const { url, params } = this.getStoryRequestConfig(id, feedSlug, true, fetchShareUrl, once);
7910
- const response = await src_api["default"].get(url, { params });
7975
+ async fetchStory({ id, feedSlug, fetchShareUrl, once, targeting }) {
7976
+ const body = {
7977
+ tags: (0,helpers/* filterTags */._N)(this.storyManager.config.tags),
7978
+ targeting: Boolean(targeting)
7979
+ };
7980
+ const pos = this.storyManager.config.options.pos;
7981
+ if (pos != null && pos !== "") {
7982
+ body.options = { pos: pos.toString() };
7983
+ }
7984
+ const response = await src_api["default"].post(buildStoryUrl(id, feedSlug), body, {
7985
+ params: {
7986
+ expand: buildStoryExpandParam(fetchShareUrl),
7987
+ once: Number(Boolean(once))
7988
+ }
7989
+ });
7911
7990
  if (response.status === 204 && once)
7912
7991
  throw new IasStoryAlreadyShownError(id.toString());
7913
7992
  return response.data;
7914
7993
  }
7915
7994
  async fetchStoryContext({ ids }) {
7916
- const { url, params } = this.getStoryContextRequestConfig(ids);
7917
- const response = await src_api["default"].get(url, { params });
7995
+ const response = await src_api["default"].get("story-context", {
7996
+ params: {
7997
+ id: ids.join(","),
7998
+ fields: "widgetsData"
7999
+ }
8000
+ });
7918
8001
  return response.data;
7919
8002
  }
7920
8003
  async fetchStoryCSS() {
7921
8004
  var _a;
7922
- const { url, params } = this.getStoryCSSRequestConfig();
7923
- const response = await src_api["default"].get(url, { params });
8005
+ const response = await src_api["default"].get("story-context", {
8006
+ params: {
8007
+ fields: "style"
8008
+ }
8009
+ });
7924
8010
  return (_a = response.data.style) !== null && _a !== void 0 ? _a : "";
7925
8011
  }
7926
8012
  async setStoryLike(storyId, like) {
@@ -7966,45 +8052,6 @@ class StoriesApi {
7966
8052
  data: { data }
7967
8053
  });
7968
8054
  }
7969
- getStoryRequestConfig(id, feedSlug, allFields = false, fetchShareUrl, once) {
7970
- const expandFields = ["slides"];
7971
- if (fetchShareUrl) {
7972
- expandFields.push("share_url");
7973
- }
7974
- const config = {
7975
- url: `${feedSlug === feeds/* UGCFeedSlug */.rT ? "ugc/" : ""}story/${id}`,
7976
- method: "GET",
7977
- params: { expand: expandFields.join(",") /* , src_list: "true" */ }
7978
- };
7979
- config.params.once = Number(Boolean(once));
7980
- if (!allFields) {
7981
- if (config.params != null) {
7982
- config.params.fields = ["id", "slides"].join(",");
7983
- }
7984
- }
7985
- return config;
7986
- }
7987
- getStoryCSSRequestConfig() {
7988
- const config = {
7989
- url: `story-context`,
7990
- method: "GET",
7991
- params: {
7992
- fields: "style"
7993
- }
7994
- };
7995
- return config;
7996
- }
7997
- getStoryContextRequestConfig(ids) {
7998
- const config = {
7999
- url: `story-context`,
8000
- method: "GET",
8001
- params: {
8002
- id: ids.join(","),
8003
- fields: "widgetsData"
8004
- }
8005
- };
8006
- return config;
8007
- }
8008
8055
  }
8009
8056
 
8010
8057
  ;// ../core/src/domain/stories/api/storyFeedsApi.ts
@@ -8600,7 +8647,7 @@ let Story = (() => {
8600
8647
  get _title() { return story_classPrivateFieldGet(this, _Story__title_accessor_storage, "f"); }
8601
8648
  set _title(value) { story_classPrivateFieldSet(this, _Story__title_accessor_storage, value, "f"); }
8602
8649
  constructor(storyDto) {
8603
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
8650
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
8604
8651
  Object.defineProperty(this, "id", {
8605
8652
  enumerable: true,
8606
8653
  configurable: true,
@@ -8742,12 +8789,6 @@ let Story = (() => {
8742
8789
  writable: true,
8743
8790
  value: void 0
8744
8791
  });
8745
- Object.defineProperty(this, "_parsedSlideImage", {
8746
- enumerable: true,
8747
- configurable: true,
8748
- writable: true,
8749
- value: null
8750
- });
8751
8792
  Object.defineProperty(this, "_videoCoverSrc", {
8752
8793
  enumerable: true,
8753
8794
  configurable: true,
@@ -8766,6 +8807,12 @@ let Story = (() => {
8766
8807
  writable: true,
8767
8808
  value: false
8768
8809
  });
8810
+ Object.defineProperty(this, "_customAttributes", {
8811
+ enumerable: true,
8812
+ configurable: true,
8813
+ writable: true,
8814
+ value: null
8815
+ });
8769
8816
  _Story__slidesLoaded_accessor_storage.set(this, story_runInitializers(this, __slidesLoaded_initializers, false));
8770
8817
  _Story__error_accessor_storage.set(this, (story_runInitializers(this, __slidesLoaded_extraInitializers), story_runInitializers(this, __error_initializers, null)));
8771
8818
  _Story__context_accessor_storage.set(this, (story_runInitializers(this, __error_extraInitializers), story_runInitializers(this, __context_initializers, void 0)));
@@ -8802,10 +8849,11 @@ let Story = (() => {
8802
8849
  this.deeplink = (_v = storyDto.deeplink) !== null && _v !== void 0 ? _v : "";
8803
8850
  this.hideTimeline = (_w = storyDto.hide_timeline) !== null && _w !== void 0 ? _w : false;
8804
8851
  this.ugcPayload = (_x = storyDto.payload) !== null && _x !== void 0 ? _x : {};
8805
- this._shareUrl = (_y = storyDto.share_url) !== null && _y !== void 0 ? _y : null;
8852
+ this._customAttributes = (_y = storyDto.custom_attributes) !== null && _y !== void 0 ? _y : null;
8853
+ this._shareUrl = (_z = storyDto.share_url) !== null && _z !== void 0 ? _z : null;
8806
8854
  this._image = StoryImageSet.createByRawData(storyDto.image);
8807
8855
  this._videoCover = StoryImageSet.createByRawData(storyDto.video_cover);
8808
- const slides = (_z = storyDto.slides) !== null && _z !== void 0 ? _z : [];
8856
+ const slides = (_0 = storyDto.slides) !== null && _0 !== void 0 ? _0 : [];
8809
8857
  this.setSlides(slides);
8810
8858
  }
8811
8859
  get like() {
@@ -8867,6 +8915,12 @@ let Story = (() => {
8867
8915
  }
8868
8916
  return null;
8869
8917
  }
8918
+ get customAttributes() {
8919
+ return this._customAttributes;
8920
+ }
8921
+ setCustomAttributes(customAttributes) {
8922
+ this._customAttributes = customAttributes !== null && customAttributes !== void 0 ? customAttributes : null;
8923
+ }
8870
8924
  setSlides(slideDtos) {
8871
8925
  if (this._slidesLoaded || !slideDtos.length)
8872
8926
  return;
@@ -10775,6 +10829,7 @@ __webpack_require__.d(__webpack_exports__, {
10775
10829
  B0: () => (/* reexport */ clipboard/* Clipboard */.B),
10776
10830
  Pv: () => (/* reexport */ SCREEN_ORIENTATIONS),
10777
10831
  W$: () => (/* reexport */ tags/* TagsValidator */.W$),
10832
+ gR: () => (/* reexport */ textInputValidator/* TextInputValidator */.g),
10778
10833
  B7: () => (/* reexport */ applyInternalFontFamilyPrefix),
10779
10834
  sY: () => (/* reexport */ awaitMacrotask),
10780
10835
  lj: () => (/* reexport */ encodeSVG),
@@ -10788,17 +10843,20 @@ __webpack_require__.d(__webpack_exports__, {
10788
10843
  LQ: () => (/* reexport */ localStorage/* localStorageGet */.LQ),
10789
10844
  Fn: () => (/* reexport */ localStorage/* localStorageSet */.Fn),
10790
10845
  Xi: () => (/* reexport */ localStorage/* lsIsAvailable */.Xi),
10846
+ mj: () => (/* reexport */ textInputValidator/* mapTextInputType */.m),
10791
10847
  vb: () => (/* reexport */ decorators/* mobxObserver */.vb),
10792
10848
  dV: () => (/* reexport */ decorators/* noConcurrent */.dV),
10793
10849
  VX: () => (/* reexport */ decorators/* queryCache */.VX),
10794
10850
  yh: () => (/* reexport */ replaceAll),
10795
10851
  xu: () => (/* reexport */ decorators/* safeCustomElement */.xu),
10796
10852
  oi: () => (/* reexport */ safeJson),
10853
+ MO: () => (/* reexport */ showSystemTextInput/* showSystemTextInputFromCardConfig */.M),
10797
10854
  yy: () => (/* reexport */ sleep),
10855
+ kM: () => (/* reexport */ subscribeIsDesktopMode),
10798
10856
  jA: () => (/* reexport */ waitMinTimeToTransition)
10799
10857
  });
10800
10858
 
10801
- // UNUSED EXPORTS: INTERNAL_FONT_FAMILY_NAMES, IasTagsCountError, IasTagsLengthError, TAGS_COUNT_LIMIT, TAG_LENGTH_LIMIT, checkUrlProtocol, debug, eventOptions, fontFaceAsCss, initAndLoadFonts, install, isPassiveSupported, isProduction, onAllMediaLoaded
10859
+ // UNUSED EXPORTS: INTERNAL_FONT_FAMILY_NAMES, IasTagsCountError, IasTagsLengthError, TAGS_COUNT_LIMIT, TAG_LENGTH_LIMIT, checkUrlProtocol, debug, eventOptions, fontFaceAsCss, initAndLoadFonts, install, isPassiveSupported, isProduction, onAllMediaLoaded, recalculateIsDesktopMode, showSystemTextInputFromGameConfig
10802
10860
 
10803
10861
  ;// ../core/src/helpers/awaitMacrotask.ts
10804
10862
  /** Schedules a macrotask so pending microtasks can run before continuing. */
@@ -11206,15 +11264,35 @@ checkStyle = () => true } = {}) => {
11206
11264
 
11207
11265
  ;// external "bowser"
11208
11266
 
11267
+ // EXTERNAL MODULE: external "lodash-es"
11268
+ var external_lodash_es_ = __webpack_require__(1630);
11209
11269
  ;// ../core/src/helpers/isDesktopMode.ts
11210
11270
 
11211
- const browser = __WEBPACK_EXTERNAL_MODULE_bowser_default__.getParser(window.navigator.userAgent);
11212
- const ua = browser.parse();
11271
+
11213
11272
  /** platform type, can be either `"desktop"`, `"tablet"` or `"mobile"`
11214
11273
  * https://bowser-js.github.io/bowser/docs/parser.js.html#line241
11215
- *
11216
11274
  */
11217
- const isDesktopMode = ua.getPlatformType() !== "mobile";
11275
+ function computeIsDesktopMode() {
11276
+ const browser = __WEBPACK_EXTERNAL_MODULE_bowser_default__.getParser(window.navigator.userAgent);
11277
+ return browser.getPlatformType() !== "mobile";
11278
+ }
11279
+ let isDesktopMode = computeIsDesktopMode();
11280
+ const listeners = new Set();
11281
+ function recalculateIsDesktopMode() {
11282
+ const prev = isDesktopMode;
11283
+ isDesktopMode = computeIsDesktopMode();
11284
+ if (prev !== isDesktopMode) {
11285
+ listeners.forEach((listener) => listener());
11286
+ }
11287
+ }
11288
+ function subscribeIsDesktopMode(listener) {
11289
+ listeners.add(listener);
11290
+ return () => listeners.delete(listener);
11291
+ }
11292
+ const debouncedRecalculateIsDesktopMode = (0,external_lodash_es_.debounce)(recalculateIsDesktopMode, 150);
11293
+ if (typeof window !== "undefined") {
11294
+ window.addEventListener("resize", debouncedRecalculateIsDesktopMode);
11295
+ }
11218
11296
 
11219
11297
  ;// ../core/src/helpers/safeJson.ts
11220
11298
  function safeJson(input) {
@@ -11231,6 +11309,10 @@ function safeJson(input) {
11231
11309
  }
11232
11310
  }
11233
11311
 
11312
+ // EXTERNAL MODULE: ../core/src/helpers/showSystemTextInput.ts
11313
+ var showSystemTextInput = __webpack_require__(1207);
11314
+ // EXTERNAL MODULE: ../core/src/helpers/textInputValidator.ts
11315
+ var textInputValidator = __webpack_require__(125);
11234
11316
  ;// ../core/src/helpers/index.ts
11235
11317
 
11236
11318
 
@@ -11251,6 +11333,8 @@ function safeJson(input) {
11251
11333
 
11252
11334
 
11253
11335
 
11336
+
11337
+
11254
11338
 
11255
11339
 
11256
11340
 
@@ -12036,6 +12120,45 @@ async function hasLossyWebP() {
12036
12120
  }
12037
12121
 
12038
12122
 
12123
+ /***/ },
12124
+
12125
+ /***/ 1207
12126
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12127
+
12128
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12129
+ /* harmony export */ M: () => (/* binding */ showSystemTextInputFromCardConfig),
12130
+ /* harmony export */ g: () => (/* binding */ showSystemTextInputFromGameConfig)
12131
+ /* harmony export */ });
12132
+ /* harmony import */ var _textInputValidator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(125);
12133
+
12134
+ function showSystemTextInputFromCardConfig(config) {
12135
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
12136
+ const message = (_e = (_d = (_c = (_b = (_a = config.configV2) === null || _a === void 0 ? void 0 : _a.main) === null || _b === void 0 ? void 0 : _b.question) === null || _c === void 0 ? void 0 : _c.text) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : "";
12137
+ const defaultValue = (_j = (_h = (_g = (_f = config.configV2) === null || _f === void 0 ? void 0 : _f.main) === null || _g === void 0 ? void 0 : _g.input) === null || _h === void 0 ? void 0 : _h.value) !== null && _j !== void 0 ? _j : "";
12138
+ const type = (_o = (_m = (_l = (_k = config.configV2) === null || _k === void 0 ? void 0 : _k.main) === null || _l === void 0 ? void 0 : _l.input) === null || _m === void 0 ? void 0 : _m.type) !== null && _o !== void 0 ? _o : "";
12139
+ return showSystemTextInput({ message, defaultValue, type });
12140
+ }
12141
+ function showSystemTextInputFromGameConfig(config) {
12142
+ var _a, _b, _c, _d, _e;
12143
+ const message = (_c = (_a = config.title) !== null && _a !== void 0 ? _a : (_b = config.input) === null || _b === void 0 ? void 0 : _b.placeholder) !== null && _c !== void 0 ? _c : "";
12144
+ const type = (_e = (_d = config.input) === null || _d === void 0 ? void 0 : _d.type) !== null && _e !== void 0 ? _e : "";
12145
+ return showSystemTextInput({ message, defaultValue: "", type });
12146
+ }
12147
+ function showSystemTextInput(options) {
12148
+ const { message, defaultValue, type } = options;
12149
+ let currentDefault = defaultValue;
12150
+ while (true) {
12151
+ const result = window.prompt(message, currentDefault);
12152
+ if (result === null)
12153
+ return "";
12154
+ if (_textInputValidator__WEBPACK_IMPORTED_MODULE_0__/* .TextInputValidator */ .g.validateValue(result, type)) {
12155
+ return result.trim();
12156
+ }
12157
+ currentDefault = result;
12158
+ }
12159
+ }
12160
+
12161
+
12039
12162
  /***/ },
12040
12163
 
12041
12164
  /***/ 5928
@@ -12122,6 +12245,52 @@ class TagsValidator {
12122
12245
 
12123
12246
 
12124
12247
 
12248
+ /***/ },
12249
+
12250
+ /***/ 125
12251
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12252
+
12253
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12254
+ /* harmony export */ g: () => (/* binding */ TextInputValidator)
12255
+ /* harmony export */ });
12256
+ const mapTextInputType = (configType) => {
12257
+ switch (configType) {
12258
+ case "":
12259
+ return "text";
12260
+ case "tel":
12261
+ return "tel";
12262
+ case "email":
12263
+ return "email";
12264
+ default:
12265
+ return "text";
12266
+ }
12267
+ };
12268
+ class TextInputValidator {
12269
+ static isEmailValid(email) {
12270
+ return /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(email);
12271
+ }
12272
+ static isTelephoneValid(mask, telephone) {
12273
+ if (mask)
12274
+ return mask.replace(/\s/g, "").length === telephone.length && telephone.length > 0;
12275
+ return /^\d+$/.test(telephone);
12276
+ }
12277
+ static validateValue(value, configType, options) {
12278
+ var _a, _b;
12279
+ const inputType = mapTextInputType(configType);
12280
+ if (inputType === "email")
12281
+ return TextInputValidator.isEmailValid(value);
12282
+ if (inputType === "tel") {
12283
+ return TextInputValidator.isTelephoneValid((_a = options === null || options === void 0 ? void 0 : options.phoneMask) !== null && _a !== void 0 ? _a : "", (_b = options === null || options === void 0 ? void 0 : options.phone) !== null && _b !== void 0 ? _b : value);
12284
+ }
12285
+ return true;
12286
+ }
12287
+ }
12288
+
12289
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, [
12290
+ /* harmony export */ "m", 0, /* binding */ mapTextInputType
12291
+ /* harmony export */ ]);
12292
+
12293
+
12125
12294
  /***/ },
12126
12295
 
12127
12296
  /***/ 9690
@@ -12167,7 +12336,7 @@ __webpack_require__.d(__webpack_exports__, {
12167
12336
  Cc: () => (/* reexport */ storyManager/* storyManager */.jR)
12168
12337
  });
12169
12338
 
12170
- // UNUSED EXPORTS: AppearanceManagerTypeException, BaseStoryReaderEvent, CTASource, CloseStoryEvent, CloseStoryReaderAction, CloseStoryReaderEvent, DesktopGameGeometry, DesktopStoryGeometry, DislikeStoryEvent, FAVORITE_CARD_ID, FavoriteStoryCardViewModel, FavoriteStoryEvent, FeedCoverageAnalytics, FeedCoverageAnalyticsCalculator, FeedCoverageAnalyticsFactory, GAME_CUSTOM_SCREEN_PREVIEW_ID, GameCloseButtonBehavior, GameGeometryFactory, GameReaderViewModel, GameReaderViewModelFactory, GoodsWidgetEvent, HybridAppPlatform, INTERNAL_FONT_FAMILY_NAMES, IasGameAlreadyOpenError, IasGameAnonymousOpen, IasNoOpenedGameError, IasTagsCountError, IasTagsLengthError, LikeStoryEvent, MobileGameGeometry, MobileStoryGeometry, NarrativeDataCache, NullStorySlideViewModel, STORY_READER_WINDOW_REFERER, SafeAreaFrameCalculator, SharePanelDefault, SharePanelViewModel, ShareStoryEvent, ShareStoryWithPathEvent, ShareType, ShowSlideEvent, ShowStoryEvent, ShowStoryFailed, StoriesListEvents, StoriesListOptionsDefault, StoryActionPanelViewModel, StoryActionSource, StoryCardViewModel, StoryCardViewStatisticV2Event, StoryEvent, StoryGeometryFactory, StoryGoodsWidgetViewModel, StoryListViewModelFactory, StoryManagerEvent, StoryManagerLinkEventSource, StoryReaderViewModel, StoryReaderViewModelFactory, StoryRect, StorySlideApiHandlers, StorySlideApiHandlersFactory, StorySlideViewModel, StoryTimelineController, StoryTimelineViewModel, StoryViewModel, TAGS_COUNT_LIMIT, TAG_LENGTH_LIMIT, TagsValidator, TextInputViewModel, Timer, TimerEvent, TypedEventEmitter, UGC_CARD_ID, applyInternalFontFamilyPrefix, awaitMacrotask, checkUrlProtocol, debug, encodeSVG, eventOptions, filterTags, focusElementOnIOS, fontFaceAsCss, getNonce, hasLossyWebP, inAppMessaging, initAndLoadFonts, install, isGameCustomScreenPreviewId, isNumeric, isPassiveSupported, isProduction, localStorageGet, localStorageSet, lsIsAvailable, mobxObserver, noConcurrent, onAllMediaLoaded, queryCache, replaceAll, safeCustomElement, safeJson, sleep, waitMinTimeToTransition
12339
+ // UNUSED EXPORTS: AppearanceManagerTypeException, BaseStoryReaderEvent, CTASource, CloseStoryEvent, CloseStoryReaderAction, CloseStoryReaderEvent, DesktopGameGeometry, DesktopStoryGeometry, DislikeStoryEvent, FAVORITE_CARD_ID, FavoriteStoryCardViewModel, FavoriteStoryEvent, FeedCoverageAnalytics, FeedCoverageAnalyticsCalculator, FeedCoverageAnalyticsFactory, GAME_CUSTOM_SCREEN_PREVIEW_ID, GameCloseButtonBehavior, GameGeometryFactory, GameReaderViewModel, GameReaderViewModelFactory, GoodsWidgetEvent, HybridAppPlatform, INTERNAL_FONT_FAMILY_NAMES, IasGameAlreadyOpenError, IasGameAnonymousOpen, IasNoOpenedGameError, IasTagsCountError, IasTagsLengthError, LikeStoryEvent, MobileGameGeometry, MobileStoryGeometry, NarrativeDataCache, NullStorySlideViewModel, STORY_READER_WINDOW_REFERER, SafeAreaFrameCalculator, SharePanelDefault, SharePanelViewModel, ShareStoryEvent, ShareStoryWithPathEvent, ShareType, ShowSlideEvent, ShowStoryEvent, ShowStoryFailed, StoriesListEvents, StoriesListOptionsDefault, StoryActionPanelViewModel, StoryActionSource, StoryCardViewModel, StoryCardViewStatisticV2Event, StoryEvent, StoryGeometryFactory, StoryGoodsWidgetViewModel, StoryListViewModelFactory, StoryManagerEvent, StoryManagerLinkEventSource, StoryReaderViewModel, StoryReaderViewModelFactory, StoryRect, StorySlideApiHandlers, StorySlideApiHandlersFactory, StorySlideViewModel, StoryTimelineController, StoryTimelineViewModel, StoryViewModel, TAGS_COUNT_LIMIT, TAG_LENGTH_LIMIT, TagsValidator, TextInputValidator, TextInputViewModel, Timer, TimerEvent, TypedEventEmitter, UGC_CARD_ID, applyInternalFontFamilyPrefix, awaitMacrotask, checkUrlProtocol, debug, encodeSVG, eventOptions, filterTags, focusElementOnIOS, fontFaceAsCss, getNonce, hasLossyWebP, inAppMessaging, initAndLoadFonts, install, isGameCustomScreenPreviewId, isNumeric, isPassiveSupported, isProduction, localStorageGet, localStorageSet, lsIsAvailable, mapTextInputType, mobxObserver, noConcurrent, onAllMediaLoaded, queryCache, recalculateIsDesktopMode, replaceAll, safeCustomElement, safeJson, showSystemTextInputFromCardConfig, showSystemTextInputFromGameConfig, sleep, subscribeIsDesktopMode, waitMinTimeToTransition
12171
12340
 
12172
12341
  // EXTERNAL MODULE: ../core/src/storyManager/index.ts
12173
12342
  var storyManager = __webpack_require__(4445);
@@ -12418,8 +12587,8 @@ __webpack_require__.d(__webpack_exports__, {
12418
12587
  var viewModels = __webpack_require__(4474);
12419
12588
  // EXTERNAL MODULE: external "mobx"
12420
12589
  var external_mobx_ = __webpack_require__(4980);
12421
- // EXTERNAL MODULE: ../core/src/domain/gameCenter/index.ts + 31 modules
12422
- var gameCenter = __webpack_require__(7233);
12590
+ // EXTERNAL MODULE: ../core/src/domain/gameCenter/index.ts + 32 modules
12591
+ var gameCenter = __webpack_require__(7737);
12423
12592
  ;// ../core/src/readers/gameReader/errors.ts
12424
12593
  class IasGameAlreadyOpenError extends Error {
12425
12594
  constructor(gameId) {
@@ -12528,6 +12697,7 @@ let GameReaderViewModel = (() => {
12528
12697
  let __gameShouldBeShown_decorators;
12529
12698
  let __gameShouldBeShown_initializers = [];
12530
12699
  let __gameShouldBeShown_extraInitializers = [];
12700
+ let _get_safeAreaInsets_decorators;
12531
12701
  let _get_needApplySafeAreaInsets_decorators;
12532
12702
  let _get_closeBtnVisible_decorators;
12533
12703
  let _get_dir_decorators;
@@ -12626,7 +12796,7 @@ let GameReaderViewModel = (() => {
12626
12796
  writable: true,
12627
12797
  value: void 0
12628
12798
  });
12629
- Object.defineProperty(this, "safeAreaInsets", {
12799
+ Object.defineProperty(this, "nativeSafeAreaInsets", {
12630
12800
  enumerable: true,
12631
12801
  configurable: true,
12632
12802
  writable: true,
@@ -12664,10 +12834,16 @@ let GameReaderViewModel = (() => {
12664
12834
  new gameCenter/* GameNavigationModule */.vL(this.storyManager),
12665
12835
  new gameCenter/* GameStoryLocalDataModule */.rK(this.storyManager),
12666
12836
  new gameCenter/* GameLocalDataModule */.yf(this.storyManager),
12837
+ new gameCenter/* GameTextInputModule */.ey(),
12667
12838
  new gameCenter/* GameShareModule */.Uy(this.storyManager, this),
12668
12839
  this.gameLogger
12669
12840
  ];
12670
- this.safeAreaInsets = this.getSafeAreaInsets();
12841
+ this.nativeSafeAreaInsets = this.getFallbackSafeAreaInsets();
12842
+ }
12843
+ get safeAreaInsets() {
12844
+ var _b;
12845
+ const hybridApp = this.storyManager.config.hybridApp;
12846
+ return (_b = hybridApp === null || hybridApp === void 0 ? void 0 : hybridApp.safeAreaInsets) !== null && _b !== void 0 ? _b : this.nativeSafeAreaInsets;
12671
12847
  }
12672
12848
  get needApplySafeAreaInsets() {
12673
12849
  var _b, _c, _d, _e;
@@ -12969,11 +13145,6 @@ let GameReaderViewModel = (() => {
12969
13145
  }
12970
13146
  this.emit(gameCenter/* GameReaderEvent */.G.Close);
12971
13147
  }
12972
- getSafeAreaInsets() {
12973
- var _b;
12974
- const hybridApp = this.storyManager.config.hybridApp;
12975
- return (_b = hybridApp === null || hybridApp === void 0 ? void 0 : hybridApp.safeAreaInsets) !== null && _b !== void 0 ? _b : this.getFallbackSafeAreaInsets();
12976
- }
12977
13148
  getFallbackSafeAreaInsets() {
12978
13149
  const html = getComputedStyle(document.documentElement);
12979
13150
  const getPropValue = (prop) => parseFloat(html.getPropertyValue(prop)) || 0;
@@ -13006,6 +13177,7 @@ let GameReaderViewModel = (() => {
13006
13177
  __gameError_decorators = [external_mobx_.observable];
13007
13178
  __closeBtnVisible_decorators = [external_mobx_.observable];
13008
13179
  __gameShouldBeShown_decorators = [external_mobx_.observable];
13180
+ _get_safeAreaInsets_decorators = [external_mobx_.computed];
13009
13181
  _get_needApplySafeAreaInsets_decorators = [external_mobx_.computed];
13010
13182
  _get_closeBtnVisible_decorators = [external_mobx_.computed];
13011
13183
  _get_dir_decorators = [external_mobx_.computed];
@@ -13027,6 +13199,7 @@ let GameReaderViewModel = (() => {
13027
13199
  __esDecorate(_a, null, __gameError_decorators, { kind: "accessor", name: "_gameError", static: false, private: false, access: { has: obj => "_gameError" in obj, get: obj => obj._gameError, set: (obj, value) => { obj._gameError = value; } }, metadata: _metadata }, __gameError_initializers, __gameError_extraInitializers);
13028
13200
  __esDecorate(_a, null, __closeBtnVisible_decorators, { kind: "accessor", name: "_closeBtnVisible", static: false, private: false, access: { has: obj => "_closeBtnVisible" in obj, get: obj => obj._closeBtnVisible, set: (obj, value) => { obj._closeBtnVisible = value; } }, metadata: _metadata }, __closeBtnVisible_initializers, __closeBtnVisible_extraInitializers);
13029
13201
  __esDecorate(_a, null, __gameShouldBeShown_decorators, { kind: "accessor", name: "_gameShouldBeShown", static: false, private: false, access: { has: obj => "_gameShouldBeShown" in obj, get: obj => obj._gameShouldBeShown, set: (obj, value) => { obj._gameShouldBeShown = value; } }, metadata: _metadata }, __gameShouldBeShown_initializers, __gameShouldBeShown_extraInitializers);
13202
+ __esDecorate(_a, null, _get_safeAreaInsets_decorators, { kind: "getter", name: "safeAreaInsets", static: false, private: false, access: { has: obj => "safeAreaInsets" in obj, get: obj => obj.safeAreaInsets }, metadata: _metadata }, null, _instanceExtraInitializers);
13030
13203
  __esDecorate(_a, null, _get_needApplySafeAreaInsets_decorators, { kind: "getter", name: "needApplySafeAreaInsets", static: false, private: false, access: { has: obj => "needApplySafeAreaInsets" in obj, get: obj => obj.needApplySafeAreaInsets }, metadata: _metadata }, null, _instanceExtraInitializers);
13031
13204
  __esDecorate(_a, null, _get_closeBtnVisible_decorators, { kind: "getter", name: "closeBtnVisible", static: false, private: false, access: { has: obj => "closeBtnVisible" in obj, get: obj => obj.closeBtnVisible }, metadata: _metadata }, null, _instanceExtraInitializers);
13032
13205
  __esDecorate(_a, null, _get_dir_decorators, { kind: "getter", name: "dir", static: false, private: false, access: { has: obj => "dir" in obj, get: obj => obj.dir }, metadata: _metadata }, null, _instanceExtraInitializers);
@@ -13454,8 +13627,8 @@ var helpers = __webpack_require__(4884);
13454
13627
  var UI = __webpack_require__(7340);
13455
13628
  // EXTERNAL MODULE: ../core/src/api/index.ts + 8 modules
13456
13629
  var api = __webpack_require__(861);
13457
- // EXTERNAL MODULE: ../core/src/domain/gameCenter/index.ts + 31 modules
13458
- var gameCenter = __webpack_require__(7233);
13630
+ // EXTERNAL MODULE: ../core/src/domain/gameCenter/index.ts + 32 modules
13631
+ var gameCenter = __webpack_require__(7737);
13459
13632
  ;// ../core/src/readers/inAppMessaging/iamMessage/actions/openGameAction.ts
13460
13633
 
13461
13634
  class OpenGameAction {
@@ -13851,7 +14024,8 @@ let IamReaderViewModel = (() => {
13851
14024
  payload: this.activeMessage.payload,
13852
14025
  message: this.activeMessage.toPublicDto(),
13853
14026
  name: widgetEvent.type,
13854
- data: widgetEvent.widgetPayload
14027
+ data: widgetEvent.widgetPayload,
14028
+ extraFields: this.activeMessage.customAttributes
13855
14029
  });
13856
14030
  this.storyManager.emit(types/* StoryManagerEvent */.ph.WidgetEvent, {
13857
14031
  name: widgetEvent.type,
@@ -13861,7 +14035,8 @@ let IamReaderViewModel = (() => {
13861
14035
  emitCloseEvent(message) {
13862
14036
  this.emit(IamReaderEvent.Close, {
13863
14037
  payload: message.payload,
13864
- message: message.toPublicDto()
14038
+ message: message.toPublicDto(),
14039
+ extraFields: message.customAttributes
13865
14040
  });
13866
14041
  }
13867
14042
  setActiveMessage(message) {
@@ -13978,7 +14153,8 @@ class OpenUrlAction {
13978
14153
  url,
13979
14154
  elementId: payload.elementId,
13980
14155
  payload: this.iamMessage.payload,
13981
- }
14156
+ },
14157
+ extraFields: this.iamMessage.customAttributes
13982
14158
  };
13983
14159
  this.storyManager.storyLinkClickHandler(event);
13984
14160
  this.iamReader.emit(IamReaderEvent.ClickOnButton, event);
@@ -14275,7 +14451,9 @@ class IamSlideApiHandlers {
14275
14451
  const widgetsData = this.iamMessage.context.widgetsData;
14276
14452
  return (_a = widgetsData._narrative_saved_data) !== null && _a !== void 0 ? _a : null;
14277
14453
  }
14278
- showCardTextInput(id, config) { }
14454
+ showCardTextInput(id, config) {
14455
+ this.iamMessage.showCardTextInput(id, config);
14456
+ }
14279
14457
  setCardSessionValue(key, value) {
14280
14458
  this.activeMessageNarrativeDataCache.set(key, value);
14281
14459
  }
@@ -14602,6 +14780,9 @@ let IamMultiSlideMessageViewModel = (() => {
14602
14780
  get disableClose() {
14603
14781
  return this.iamMessage.disableClose;
14604
14782
  }
14783
+ get customAttributes() {
14784
+ return this.iamMessage.customAttributes;
14785
+ }
14605
14786
  get slidesAnalytics() {
14606
14787
  return Array.from(this.slidesMetrics.values()).map(metrics => {
14607
14788
  var _b;
@@ -14697,6 +14878,11 @@ let IamMultiSlideMessageViewModel = (() => {
14697
14878
  this.toast = new UI/* Toast */.y8(Object.assign(Object.assign({}, options), { mountPoint: this.$root }));
14698
14879
  this.toast.show(options.content);
14699
14880
  }
14881
+ showCardTextInput(id, config) {
14882
+ var _b;
14883
+ const value = (0,helpers/* showSystemTextInputFromCardConfig */.MO)(config);
14884
+ (_b = this.slideApi) === null || _b === void 0 ? void 0 : _b.setTextInputResult(id, value);
14885
+ }
14700
14886
  onShowSlide(index) {
14701
14887
  this._activeSlideIndex = index;
14702
14888
  this.slidesMetrics.set(index, {
@@ -19642,8 +19828,8 @@ let StoryViewModel = (() => {
19642
19828
  var api = __webpack_require__(861);
19643
19829
  // EXTERNAL MODULE: ../core/src/api/exceptions/apiRequestError.ts
19644
19830
  var apiRequestError = __webpack_require__(663);
19645
- // EXTERNAL MODULE: ../core/src/domain/gameCenter/index.ts + 31 modules
19646
- var gameCenter = __webpack_require__(7233);
19831
+ // EXTERNAL MODULE: ../core/src/domain/gameCenter/index.ts + 32 modules
19832
+ var gameCenter = __webpack_require__(7737);
19647
19833
  ;// ../core/src/readers/storyReader/storyViewModel/storySlideApiHandlers/actions/openGameAction.ts
19648
19834
 
19649
19835
  class OpenGameAction {
@@ -20719,7 +20905,8 @@ class ShowStoryOnceStrategy {
20719
20905
  const story = await storyStore.fetchStoryById({
20720
20906
  storyId: payload.storyId,
20721
20907
  feedSlug: "",
20722
- once: true
20908
+ once: true,
20909
+ targeting: payload.targeting
20723
20910
  });
20724
20911
  this.throwIfAborted(payload.signal);
20725
20912
  if (story.error)
@@ -20775,7 +20962,8 @@ class ShowStoryStrategy {
20775
20962
  const story = await storyStore.fetchStoryById({
20776
20963
  storyId: payload.storyId,
20777
20964
  feedSlug: "",
20778
- fetchShareUrl: payload.fetchShareUrl
20965
+ fetchShareUrl: payload.fetchShareUrl,
20966
+ targeting: payload.targeting
20779
20967
  });
20780
20968
  this.throwIfAborted(payload.signal);
20781
20969
  this.openStoryReader(story, payload);
@@ -20899,6 +21087,12 @@ class BaseStoryReaderEvent {
20899
21087
  writable: true,
20900
21088
  value: null
20901
21089
  });
21090
+ Object.defineProperty(this, "extraFields", {
21091
+ enumerable: true,
21092
+ configurable: true,
21093
+ writable: true,
21094
+ value: null
21095
+ });
20902
21096
  Object.defineProperty(this, "slideEventPayload", {
20903
21097
  enumerable: true,
20904
21098
  configurable: true,
@@ -20915,10 +21109,11 @@ class BaseStoryReaderEvent {
20915
21109
  this.feedSlug = feedType === domain/* StoryFeedType */.Wf.DEFAULT ? feedSlug : null;
20916
21110
  this.filter = filter;
20917
21111
  this.actionSource = feedType != null ? this.getStorySourceByFeedType(feedType) : types/* StoryActionSource */.Vq.direct;
21112
+ this.extraFields = story.model.customAttributes;
20918
21113
  this.slideEventPayload = (_d = (_c = story.activeSlide.eventPayload) === null || _c === void 0 ? void 0 : _c.payload) !== null && _d !== void 0 ? _d : null;
20919
21114
  }
20920
21115
  toJSON() {
20921
- return Object.assign({ id: this.story.id, index: this.story.activeSlideIndex, title: this.title, tags: this.tags, slidesCount: this.slidesCount, feed: this.feedSlug, filter: this.filter, source: this.actionSource, ugcPayload: this.ugcPayload, payload: this.slideEventPayload }, this.payload);
21116
+ return Object.assign({ id: this.story.id, index: this.story.activeSlideIndex, title: this.title, tags: this.tags, slidesCount: this.slidesCount, feed: this.feedSlug, filter: this.filter, source: this.actionSource, ugcPayload: this.ugcPayload, extraFields: this.extraFields, payload: this.slideEventPayload }, this.payload);
20922
21117
  }
20923
21118
  getStorySourceByFeedType(feedType) {
20924
21119
  switch (feedType) {
@@ -22528,7 +22723,7 @@ let IamStore = (() => {
22528
22723
  const message = this._messages.get(messageId.toString());
22529
22724
  if (message)
22530
22725
  return message;
22531
- return this.fetchById(messageId, options.signal);
22726
+ return this.fetchById(messageId, options);
22532
22727
  }
22533
22728
  findAllByEvent(eventName) {
22534
22729
  let messages = Array.from(this._messages.values()).filter(message => message.hasEvent(eventName));
@@ -22539,10 +22734,10 @@ let IamStore = (() => {
22539
22734
  async updateMessageUserData(messageId, data) {
22540
22735
  return this.iamApi.updateUserData(messageId, data);
22541
22736
  }
22542
- async fetchById(messageId, signal) {
22737
+ async fetchById(messageId, options = {}) {
22543
22738
  await this.rootStore.sessionStore.open();
22544
- const messageContext = await this.fetchMessageContext({ messageIds: [messageId], signal });
22545
- const messageDto = await this.iamApi.fetchById(messageId, signal);
22739
+ const messageContext = await this.fetchMessageContext({ messageIds: [messageId], signal: options.signal });
22740
+ const messageDto = await this.iamApi.fetchById(messageId, options);
22546
22741
  return this.createMessageByDto(messageDto, messageContext);
22547
22742
  }
22548
22743
  async fetchAll(params) {
@@ -22962,13 +23157,13 @@ let StoryStore = (() => {
22962
23157
  this.storiesApi.markStoryAsOpened(session.userKey, story.id);
22963
23158
  this.rootStore.onboardingFeedStore.removeStoryFromOnboardingFeedsById(story.id);
22964
23159
  }
22965
- async fetchStoryById({ storyId, feedSlug, fetchShareUrl, once }) {
23160
+ async fetchStoryById({ storyId, feedSlug, fetchShareUrl, once, targeting }) {
22966
23161
  let story = this.findStoryById(storyId);
22967
23162
  if (story === null || story === void 0 ? void 0 : story.slidesLoaded)
22968
23163
  return story;
22969
23164
  await this.rootStore.sessionStore.open();
22970
23165
  await this.fetchStoryCSS();
22971
- story = await this.fetchStory({ storyId, feedSlug, fetchShareUrl, once });
23166
+ story = await this.fetchStory({ storyId, feedSlug, fetchShareUrl, once, targeting });
22972
23167
  const storyContext = await this.fetchStoryContext({
22973
23168
  id: story.id,
22974
23169
  feedSlug
@@ -23010,6 +23205,7 @@ let StoryStore = (() => {
23010
23205
  story.setError(null);
23011
23206
  story.setContext(storyContext);
23012
23207
  const storyDto = await this.storiesApi.fetchStorySlides({ id: story.id, feedSlug });
23208
+ story.setCustomAttributes(storyDto.custom_attributes);
23013
23209
  story.setSlides((_b = storyDto.slides) !== null && _b !== void 0 ? _b : []);
23014
23210
  story.applyFontPrefix(this.storyManager.config.fontPrefix);
23015
23211
  story.updatePlaceholders(this.rootStore.placeholderStore.placeholders);
@@ -23020,9 +23216,9 @@ let StoryStore = (() => {
23020
23216
  story.setError(error);
23021
23217
  }
23022
23218
  }
23023
- async fetchStory({ storyId, feedSlug, fetchShareUrl, once }) {
23219
+ async fetchStory({ storyId, feedSlug, fetchShareUrl, once, targeting }) {
23024
23220
  var _b;
23025
- const storyDto = await this.storiesApi.fetchStory({ id: storyId, feedSlug, fetchShareUrl, once });
23221
+ const storyDto = await this.storiesApi.fetchStory({ id: storyId, feedSlug, fetchShareUrl, once, targeting });
23026
23222
  const story = this.addStoryByDto(storyDto);
23027
23223
  story.setSlides((_b = storyDto.slides) !== null && _b !== void 0 ? _b : []);
23028
23224
  story.applyFontPrefix(this.storyManager.config.fontPrefix);
@@ -23420,7 +23616,7 @@ class UgcEditorStore {
23420
23616
  const session = await this.storyManager.rootStore.sessionStore.open();
23421
23617
  const ugcEditorConfigDto = await this.ugcEditorApi.fetchUgcEditorConfig();
23422
23618
  const storyManagerConfig = this.storyManager.config;
23423
- const sdkVersion = "1.16.7";
23619
+ const sdkVersion = "1.16.9";
23424
23620
  this._config = {
23425
23621
  sessionId: session.id,
23426
23622
  apiKey: storyManagerConfig.apiKey,
@@ -23896,11 +24092,11 @@ class StoryManager extends types/* TypedEventEmitter */.Xl {
23896
24092
  return api/* deviceDescriptor */.c2.deviceId;
23897
24093
  }
23898
24094
  get sdkVersionName() {
23899
- const sdkVersionName = "1.16.7";
24095
+ const sdkVersionName = "1.16.9";
23900
24096
  return sdkVersionName || "0.0.0";
23901
24097
  }
23902
24098
  get sdkVersionCode() {
23903
- const sdkVersionCode = 11607;
24099
+ const sdkVersionCode = 11609;
23904
24100
  return sdkVersionCode ? parseInt(sdkVersionCode) : 0;
23905
24101
  }
23906
24102
  get lang() {
@@ -23964,7 +24160,7 @@ class StoryManager extends types/* TypedEventEmitter */.Xl {
23964
24160
  this.rootStore.storyManagerConfigStore.setConfig(configDto);
23965
24161
  }
23966
24162
  setUserAgent(userAgent) {
23967
- const sdkVersionCode = 11607;
24163
+ const sdkVersionCode = 11609;
23968
24164
  const buildVersion = sdkVersionCode ? parseInt(sdkVersionCode) : 0;
23969
24165
  // According to RFC5987, HTTP header values can legitimately be supplied using the ISO-8859-1 encoding.
23970
24166
  this._userAgent = `${userAgent} ${convertStrToLatin1(navigator.userAgent)}`;
@@ -25905,24 +26101,48 @@ var screenOrientationLock_module_update = injectStylesIntoStyleTag_default()(scr
25905
26101
 
25906
26102
  /* harmony default export */ const ScreenOrientationLock_screenOrientationLock_module = (screenOrientationLock_module/* default */.A && screenOrientationLock_module/* default */.A.locals ? screenOrientationLock_module/* default */.A.locals : undefined);
25907
26103
 
26104
+ ;// ./src/hooks/useIsDesktopMode.ts
26105
+
26106
+
26107
+ function useIsDesktopMode() {
26108
+ const [desktopMode, setDesktopMode] = __WEBPACK_EXTERNAL_MODULE_react_useState__(helpers/* isDesktopMode */.ML);
26109
+ __WEBPACK_EXTERNAL_MODULE_react_useEffect__(() => {
26110
+ return (0,helpers/* subscribeIsDesktopMode */.kM)(() => {
26111
+ setDesktopMode(helpers/* isDesktopMode */.ML);
26112
+ });
26113
+ }, []);
26114
+ return desktopMode;
26115
+ }
26116
+
26117
+ ;// ./src/hooks/index.ts
26118
+
26119
+
25908
26120
  ;// ./src/UI/ScreenOrientationLock/ScreenOrientationLock.tsx
25909
26121
 
25910
26122
 
25911
26123
 
25912
26124
 
26125
+
25913
26126
  const src_orientation = (0,src/* getOrientation */.vc)();
25914
26127
  const ScreenOrientationLock = (props) => {
25915
26128
  const [isWrong, setIsWrong] = __WEBPACK_EXTERNAL_MODULE_react_useState__(false);
26129
+ const desktopMode = useIsDesktopMode();
25916
26130
  const checkScreenOrientation = __WEBPACK_EXTERNAL_MODULE_react_useCallback__(() => {
25917
- if (src/* isDesktopMode */.ML)
26131
+ if (desktopMode) {
26132
+ setIsWrong(false);
26133
+ props.onOrientationChange({
26134
+ type: src_orientation.type,
26135
+ isWrong: false
26136
+ });
25918
26137
  return;
26138
+ }
25919
26139
  const isWrong = src_orientation.type !== props.orientation;
25920
26140
  props.onOrientationChange({
25921
26141
  type: src_orientation.type,
25922
26142
  isWrong: isWrong
25923
26143
  });
25924
26144
  setIsWrong(isWrong);
25925
- }, [props.orientation]);
26145
+ }, [desktopMode, props.orientation]);
25926
26146
  __WEBPACK_EXTERNAL_MODULE_react_useEffect__(() => {
25927
26147
  checkScreenOrientation();
25928
26148
  src_orientation.addEventListener("change", checkScreenOrientation);
@@ -26650,12 +26870,14 @@ var storyReader = __webpack_require__(9320);
26650
26870
 
26651
26871
 
26652
26872
 
26873
+
26653
26874
  const VERTICAL_PADDING = {
26654
26875
  TOP: 50,
26655
26876
  BOTTOM: 50
26656
26877
  };
26657
26878
  const useStoryGeometry = (viewport, story) => {
26658
26879
  const { storyReaderOptions } = useIASProvider();
26880
+ const desktopMode = useIsDesktopMode();
26659
26881
  return __WEBPACK_EXTERNAL_MODULE_react_useMemo__(() => {
26660
26882
  var _a;
26661
26883
  const safeAreaFrameCalculator = new storyReader/* SafeAreaFrameCalculator */.Wn(viewport.vw, viewport.vh);
@@ -26677,7 +26899,7 @@ const useStoryGeometry = (viewport, story) => {
26677
26899
  isDesktopGeometry,
26678
26900
  correctionPaddingStyle
26679
26901
  };
26680
- }, [storyReaderOptions.actionPanelBottomOffset, viewport, story]);
26902
+ }, [storyReaderOptions.actionPanelBottomOffset, viewport, story, desktopMode]);
26681
26903
  };
26682
26904
 
26683
26905
  ;// ./src/StoryReader/hooks/index.ts
@@ -26689,12 +26911,13 @@ const useStoryGeometry = (viewport, story) => {
26689
26911
  ;// ./src/GameReader/hooks/useGameGeometry.ts
26690
26912
 
26691
26913
 
26692
- const useGameGeometry = () => {
26914
+
26915
+ const useGameGeometry = (desktopMode) => {
26693
26916
  const { vw, vh } = useWindowViewport();
26694
- const gameGeometry = new gameReader/* GameGeometryFactory */.DE().create({
26917
+ const gameGeometry = __WEBPACK_EXTERNAL_MODULE_react_useMemo__(() => new gameReader/* GameGeometryFactory */.DE().create({
26695
26918
  vw,
26696
26919
  vh
26697
- });
26920
+ }), [vw, vh, desktopMode]);
26698
26921
  const isDesktopGeometry = gameGeometry instanceof gameReader/* DesktopGameGeometry */.bb;
26699
26922
  return { isDesktopGeometry, gameGeometry };
26700
26923
  };
@@ -26912,12 +27135,14 @@ const useAppearanceManager_useAppearanceManager = ({ commonOptions, gameReaderOp
26912
27135
 
26913
27136
 
26914
27137
 
27138
+
26915
27139
  const GameReader = __WEBPACK_EXTERNAL_MODULE_mobx_react_lite_9dacf130_observer__(({ gameReader }) => {
26916
27140
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
26917
27141
  const { gameReaderOptions: options } = useIASProvider();
26918
27142
  const gameReaderIframeRef = __WEBPACK_EXTERNAL_MODULE_react_useRef__(null);
26919
27143
  const { sharePanelOpeningParams, handleShareComplete, closeSharePanel } = useSharePanel(gameReader);
26920
- const { gameGeometry, isDesktopGeometry } = useGameGeometry();
27144
+ const isDesktopMode = useIsDesktopMode();
27145
+ const { gameGeometry, isDesktopGeometry } = useGameGeometry(isDesktopMode);
26921
27146
  const game = gameReader.game;
26922
27147
  const isWidescreen = isDesktopGeometry && ((_a = game === null || game === void 0 ? void 0 : game.screenOptions.widescreen) !== null && _a !== void 0 ? _a : true);
26923
27148
  useEscKey(() => {
@@ -28536,30 +28761,13 @@ const useTextInputModalBodyStyles = ({ config }) => {
28536
28761
  };
28537
28762
 
28538
28763
  ;// ./src/StoryReader/Story/Widgets/TextInputModal/TextInputModalBody/hooks/useTextInputForm/validator.ts
28539
- class Validator {
28540
- static isEmailValid(email) {
28541
- return /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(email);
28542
- }
28543
- static isTelephoneValid(mask, telephone) {
28544
- if (mask)
28545
- return mask.replace(/\s/g, "").length === telephone.length && telephone.length > 0;
28546
- return /^\d+$/.test(telephone);
28547
- }
28548
- }
28764
+
28549
28765
 
28550
28766
  ;// ./src/StoryReader/Story/Widgets/TextInputModal/TextInputModalBody/helpers/mapConfigTypeToInputType.ts
28551
- const mapConfigTypeToInputType = (configType) => {
28552
- switch (configType) {
28553
- case "":
28554
- return "text";
28555
- case "tel":
28556
- return "tel";
28557
- case "email":
28558
- return "email";
28559
- default:
28560
- return "text";
28561
- }
28562
- };
28767
+
28768
+
28769
+ ;// ./src/StoryReader/Story/Widgets/TextInputModal/TextInputModalBody/helpers/index.ts
28770
+
28563
28771
 
28564
28772
  ;// ./src/StoryReader/Story/Widgets/TextInputModal/TextInputModalBody/controls/TelephoneInput/phoneMasks.ts
28565
28773
  const phoneMasks = {
@@ -28815,11 +29023,11 @@ const useTextInputForm = (config) => {
28815
29023
  };
28816
29024
  const validate = (value) => {
28817
29025
  var _a;
28818
- const inputType = mapConfigTypeToInputType((_a = config === null || config === void 0 ? void 0 : config.configV2.main.input.type) !== null && _a !== void 0 ? _a : "");
29026
+ const inputType = (0,helpers/* mapTextInputType */.mj)((_a = config === null || config === void 0 ? void 0 : config.configV2.main.input.type) !== null && _a !== void 0 ? _a : "");
28819
29027
  if (inputType === "email")
28820
- return Validator.isEmailValid(value);
29028
+ return helpers/* TextInputValidator */.gR.isEmailValid(value);
28821
29029
  if (inputType === "tel")
28822
- return Validator.isTelephoneValid(getPhoneMask(), telephone.phone);
29030
+ return helpers/* TextInputValidator */.gR.isTelephoneValid(getPhoneMask(), telephone.phone);
28823
29031
  return true;
28824
29032
  };
28825
29033
  const handleChange = (value) => {
@@ -29384,7 +29592,7 @@ const TextInputModalBody = (_a) => {
29384
29592
  const placeholder = String(config.configV2.main.input.text.placeholder).trim();
29385
29593
  const buttonName = String(config.configV2.main.button.text.value).trim();
29386
29594
  const question = String(config.configV2.main.question.text.value).trim();
29387
- const inputType = mapConfigTypeToInputType(config.configV2.main.input.type);
29595
+ const inputType = (0,helpers/* mapTextInputType */.mj)(config.configV2.main.input.type);
29388
29596
  const onSubmit = ({ value }) => {
29389
29597
  props.onComplete({ result: true, value });
29390
29598
  setIsVisible(false);