@embedreach/components 0.3.33 → 0.3.34

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.
@@ -18681,6 +18681,23 @@ class HttpResponse extends FetchResponse$1 {
18681
18681
  return new HttpResponse(body, normalizeResponseInit(init));
18682
18682
  }
18683
18683
  }
18684
+ function bypass(input, init) {
18685
+ const request = new Request(
18686
+ // If given a Request instance, clone it not to exhaust
18687
+ // the original request's body.
18688
+ input instanceof Request ? input.clone() : input,
18689
+ init
18690
+ );
18691
+ invariant$1(
18692
+ !request.bodyUsed,
18693
+ 'Failed to create a bypassed request to "%s %s": given request instance already has its body read. Make sure to clone the intercepted request if you wish to read its body before bypassing it.',
18694
+ request.method,
18695
+ request.url
18696
+ );
18697
+ const requestClone = request.clone();
18698
+ requestClone.headers.append("accept", "msw/passthrough");
18699
+ return requestClone;
18700
+ }
18684
18701
  checkGlobals();
18685
18702
  var e = [{ name: "Aegean Airlines", iataCode: "A3" }, { name: "Aeroflot", iataCode: "SU" }, { name: "Aerolineas Argentinas", iataCode: "AR" }, { name: "Aeromexico", iataCode: "AM" }, { name: "Air Algerie", iataCode: "AH" }, { name: "Air Arabia", iataCode: "G9" }, { name: "Air Canada", iataCode: "AC" }, { name: "Air China", iataCode: "CA" }, { name: "Air Europa", iataCode: "UX" }, { name: "Air France", iataCode: "AF" }, { name: "Air India", iataCode: "AI" }, { name: "Air Mauritius", iataCode: "MK" }, { name: "Air New Zealand", iataCode: "NZ" }, { name: "Air Niugini", iataCode: "PX" }, { name: "Air Tahiti", iataCode: "VT" }, { name: "Air Tahiti Nui", iataCode: "TN" }, { name: "Air Transat", iataCode: "TS" }, { name: "AirAsia X", iataCode: "D7" }, { name: "AirAsia", iataCode: "AK" }, { name: "Aircalin", iataCode: "SB" }, { name: "Alaska Airlines", iataCode: "AS" }, { name: "Alitalia", iataCode: "AZ" }, { name: "All Nippon Airways", iataCode: "NH" }, { name: "Allegiant Air", iataCode: "G4" }, { name: "American Airlines", iataCode: "AA" }, { name: "Asiana Airlines", iataCode: "OZ" }, { name: "Avianca", iataCode: "AV" }, { name: "Azul Linhas Aereas Brasileiras", iataCode: "AD" }, { name: "Azur Air", iataCode: "ZF" }, { name: "Beijing Capital Airlines", iataCode: "JD" }, { name: "Boliviana de Aviacion", iataCode: "OB" }, { name: "British Airways", iataCode: "BA" }, { name: "Cathay Pacific", iataCode: "CX" }, { name: "Cebu Pacific Air", iataCode: "5J" }, { name: "China Airlines", iataCode: "CI" }, { name: "China Eastern Airlines", iataCode: "MU" }, { name: "China Southern Airlines", iataCode: "CZ" }, { name: "Condor", iataCode: "DE" }, { name: "Copa Airlines", iataCode: "CM" }, { name: "Delta Air Lines", iataCode: "DL" }, { name: "Easyfly", iataCode: "VE" }, { name: "EasyJet", iataCode: "U2" }, { name: "EcoJet", iataCode: "8J" }, { name: "Egyptair", iataCode: "MS" }, { name: "El Al", iataCode: "LY" }, { name: "Emirates Airlines", iataCode: "EK" }, { name: "Ethiopian Airlines", iataCode: "ET" }, { name: "Etihad Airways", iataCode: "EY" }, { name: "EVA Air", iataCode: "BR" }, { name: "Fiji Airways", iataCode: "FJ" }, { name: "Finnair", iataCode: "AY" }, { name: "Flybondi", iataCode: "FO" }, { name: "Flydubai", iataCode: "FZ" }, { name: "FlySafair", iataCode: "FA" }, { name: "Frontier Airlines", iataCode: "F9" }, { name: "Garuda Indonesia", iataCode: "GA" }, { name: "Go First", iataCode: "G8" }, { name: "Gol Linhas Aereas Inteligentes", iataCode: "G3" }, { name: "Hainan Airlines", iataCode: "HU" }, { name: "Hawaiian Airlines", iataCode: "HA" }, { name: "IndiGo Airlines", iataCode: "6E" }, { name: "Japan Airlines", iataCode: "JL" }, { name: "Jeju Air", iataCode: "7C" }, { name: "Jet2", iataCode: "LS" }, { name: "JetBlue Airways", iataCode: "B6" }, { name: "JetSMART", iataCode: "JA" }, { name: "Juneyao Airlines", iataCode: "HO" }, { name: "Kenya Airways", iataCode: "KQ" }, { name: "KLM Royal Dutch Airlines", iataCode: "KL" }, { name: "Korean Air", iataCode: "KE" }, { name: "Kulula.com", iataCode: "MN" }, { name: "LATAM Airlines", iataCode: "LA" }, { name: "Lion Air", iataCode: "JT" }, { name: "LOT Polish Airlines", iataCode: "LO" }, { name: "Lufthansa", iataCode: "LH" }, { name: "Libyan Airlines", iataCode: "LN" }, { name: "Linea Aerea Amaszonas", iataCode: "Z8" }, { name: "Malaysia Airlines", iataCode: "MH" }, { name: "Nordwind Airlines", iataCode: "N4" }, { name: "Norwegian Air Shuttle", iataCode: "DY" }, { name: "Oman Air", iataCode: "WY" }, { name: "Pakistan International Airlines", iataCode: "PK" }, { name: "Pegasus Airlines", iataCode: "PC" }, { name: "Philippine Airlines", iataCode: "PR" }, { name: "Qantas Group", iataCode: "QF" }, { name: "Qatar Airways", iataCode: "QR" }, { name: "Republic Airways", iataCode: "YX" }, { name: "Royal Air Maroc", iataCode: "AT" }, { name: "Ryanair", iataCode: "FR" }, { name: "S7 Airlines", iataCode: "S7" }, { name: "SAS", iataCode: "SK" }, { name: "Satena", iataCode: "9R" }, { name: "Saudia", iataCode: "SV" }, { name: "Shandong Airlines", iataCode: "SC" }, { name: "Sichuan Airlines", iataCode: "3U" }, { name: "Singapore Airlines", iataCode: "SQ" }, { name: "Sky Airline", iataCode: "H2" }, { name: "SkyWest Airlines", iataCode: "OO" }, { name: "South African Airways", iataCode: "SA" }, { name: "Southwest Airlines", iataCode: "WN" }, { name: "SpiceJet", iataCode: "SG" }, { name: "Spirit Airlines", iataCode: "NK" }, { name: "Spring Airlines", iataCode: "9S" }, { name: "SriLankan Airlines", iataCode: "UL" }, { name: "Star Peru", iataCode: "2I" }, { name: "Sun Country Airlines", iataCode: "SY" }, { name: "SunExpress", iataCode: "XQ" }, { name: "TAP Air Portugal", iataCode: "TP" }, { name: "Thai AirAsia", iataCode: "FD" }, { name: "Thai Airways", iataCode: "TG" }, { name: "TUI Airways", iataCode: "BY" }, { name: "Tunisair", iataCode: "TU" }, { name: "Turkish Airlines", iataCode: "TK" }, { name: "Ukraine International", iataCode: "PS" }, { name: "United Airlines", iataCode: "UA" }, { name: "Ural Airlines", iataCode: "U6" }, { name: "VietJet Air", iataCode: "VJ" }, { name: "Vietnam Airlines", iataCode: "VN" }, { name: "Virgin Atlantic Airways", iataCode: "VS" }, { name: "Virgin Australia", iataCode: "VA" }, { name: "VivaAerobus", iataCode: "VB" }, { name: "VOEPASS Linhas Aereas", iataCode: "2Z" }, { name: "Volaris", iataCode: "Y4" }, { name: "WestJet", iataCode: "WS" }, { name: "Wingo", iataCode: "P5" }, { name: "Wizz Air", iataCode: "W6" }];
18686
18703
  var a = [{ name: "Aerospatiale/BAC Concorde", iataTypeCode: "SSC" }, { name: "Airbus A300", iataTypeCode: "AB3" }, { name: "Airbus A310", iataTypeCode: "310" }, { name: "Airbus A310-200", iataTypeCode: "312" }, { name: "Airbus A310-300", iataTypeCode: "313" }, { name: "Airbus A318", iataTypeCode: "318" }, { name: "Airbus A319", iataTypeCode: "319" }, { name: "Airbus A319neo", iataTypeCode: "31N" }, { name: "Airbus A320", iataTypeCode: "320" }, { name: "Airbus A320neo", iataTypeCode: "32N" }, { name: "Airbus A321", iataTypeCode: "321" }, { name: "Airbus A321neo", iataTypeCode: "32Q" }, { name: "Airbus A330", iataTypeCode: "330" }, { name: "Airbus A330-200", iataTypeCode: "332" }, { name: "Airbus A330-300", iataTypeCode: "333" }, { name: "Airbus A330-800neo", iataTypeCode: "338" }, { name: "Airbus A330-900neo", iataTypeCode: "339" }, { name: "Airbus A340", iataTypeCode: "340" }, { name: "Airbus A340-200", iataTypeCode: "342" }, { name: "Airbus A340-300", iataTypeCode: "343" }, { name: "Airbus A340-500", iataTypeCode: "345" }, { name: "Airbus A340-600", iataTypeCode: "346" }, { name: "Airbus A350", iataTypeCode: "350" }, { name: "Airbus A350-900", iataTypeCode: "359" }, { name: "Airbus A350-1000", iataTypeCode: "351" }, { name: "Airbus A380", iataTypeCode: "380" }, { name: "Airbus A380-800", iataTypeCode: "388" }, { name: "Antonov An-12", iataTypeCode: "ANF" }, { name: "Antonov An-24", iataTypeCode: "AN4" }, { name: "Antonov An-26", iataTypeCode: "A26" }, { name: "Antonov An-28", iataTypeCode: "A28" }, { name: "Antonov An-30", iataTypeCode: "A30" }, { name: "Antonov An-32", iataTypeCode: "A32" }, { name: "Antonov An-72", iataTypeCode: "AN7" }, { name: "Antonov An-124 Ruslan", iataTypeCode: "A4F" }, { name: "Antonov An-140", iataTypeCode: "A40" }, { name: "Antonov An-148", iataTypeCode: "A81" }, { name: "Antonov An-158", iataTypeCode: "A58" }, { name: "Antonov An-225 Mriya", iataTypeCode: "A5F" }, { name: "Boeing 707", iataTypeCode: "703" }, { name: "Boeing 717", iataTypeCode: "717" }, { name: "Boeing 720B", iataTypeCode: "B72" }, { name: "Boeing 727", iataTypeCode: "727" }, { name: "Boeing 727-100", iataTypeCode: "721" }, { name: "Boeing 727-200", iataTypeCode: "722" }, { name: "Boeing 737 MAX 7", iataTypeCode: "7M7" }, { name: "Boeing 737 MAX 8", iataTypeCode: "7M8" }, { name: "Boeing 737 MAX 9", iataTypeCode: "7M9" }, { name: "Boeing 737 MAX 10", iataTypeCode: "7MJ" }, { name: "Boeing 737", iataTypeCode: "737" }, { name: "Boeing 737-100", iataTypeCode: "731" }, { name: "Boeing 737-200", iataTypeCode: "732" }, { name: "Boeing 737-300", iataTypeCode: "733" }, { name: "Boeing 737-400", iataTypeCode: "734" }, { name: "Boeing 737-500", iataTypeCode: "735" }, { name: "Boeing 737-600", iataTypeCode: "736" }, { name: "Boeing 737-700", iataTypeCode: "73G" }, { name: "Boeing 737-800", iataTypeCode: "738" }, { name: "Boeing 737-900", iataTypeCode: "739" }, { name: "Boeing 747", iataTypeCode: "747" }, { name: "Boeing 747-100", iataTypeCode: "741" }, { name: "Boeing 747-200", iataTypeCode: "742" }, { name: "Boeing 747-300", iataTypeCode: "743" }, { name: "Boeing 747-400", iataTypeCode: "744" }, { name: "Boeing 747-400D", iataTypeCode: "74J" }, { name: "Boeing 747-8", iataTypeCode: "748" }, { name: "Boeing 747SP", iataTypeCode: "74L" }, { name: "Boeing 747SR", iataTypeCode: "74R" }, { name: "Boeing 757", iataTypeCode: "757" }, { name: "Boeing 757-200", iataTypeCode: "752" }, { name: "Boeing 757-300", iataTypeCode: "753" }, { name: "Boeing 767", iataTypeCode: "767" }, { name: "Boeing 767-200", iataTypeCode: "762" }, { name: "Boeing 767-300", iataTypeCode: "763" }, { name: "Boeing 767-400", iataTypeCode: "764" }, { name: "Boeing 777", iataTypeCode: "777" }, { name: "Boeing 777-200", iataTypeCode: "772" }, { name: "Boeing 777-200LR", iataTypeCode: "77L" }, { name: "Boeing 777-300", iataTypeCode: "773" }, { name: "Boeing 777-300ER", iataTypeCode: "77W" }, { name: "Boeing 787", iataTypeCode: "787" }, { name: "Boeing 787-8", iataTypeCode: "788" }, { name: "Boeing 787-9", iataTypeCode: "789" }, { name: "Boeing 787-10", iataTypeCode: "781" }, { name: "Canadair Challenger", iataTypeCode: "CCJ" }, { name: "Canadair CL-44", iataTypeCode: "CL4" }, { name: "Canadair Regional Jet 100", iataTypeCode: "CR1" }, { name: "Canadair Regional Jet 200", iataTypeCode: "CR2" }, { name: "Canadair Regional Jet 700", iataTypeCode: "CR7" }, { name: "Canadair Regional Jet 705", iataTypeCode: "CRA" }, { name: "Canadair Regional Jet 900", iataTypeCode: "CR9" }, { name: "Canadair Regional Jet 1000", iataTypeCode: "CRK" }, { name: "De Havilland Canada DHC-2 Beaver", iataTypeCode: "DHP" }, { name: "De Havilland Canada DHC-2 Turbo-Beaver", iataTypeCode: "DHR" }, { name: "De Havilland Canada DHC-3 Otter", iataTypeCode: "DHL" }, { name: "De Havilland Canada DHC-4 Caribou", iataTypeCode: "DHC" }, { name: "De Havilland Canada DHC-6 Twin Otter", iataTypeCode: "DHT" }, { name: "De Havilland Canada DHC-7 Dash 7", iataTypeCode: "DH7" }, { name: "De Havilland Canada DHC-8-100 Dash 8 / 8Q", iataTypeCode: "DH1" }, { name: "De Havilland Canada DHC-8-200 Dash 8 / 8Q", iataTypeCode: "DH2" }, { name: "De Havilland Canada DHC-8-300 Dash 8 / 8Q", iataTypeCode: "DH3" }, { name: "De Havilland Canada DHC-8-400 Dash 8Q", iataTypeCode: "DH4" }, { name: "De Havilland DH.104 Dove", iataTypeCode: "DHD" }, { name: "De Havilland DH.114 Heron", iataTypeCode: "DHH" }, { name: "Douglas DC-3", iataTypeCode: "D3F" }, { name: "Douglas DC-6", iataTypeCode: "D6F" }, { name: "Douglas DC-8-50", iataTypeCode: "D8T" }, { name: "Douglas DC-8-62", iataTypeCode: "D8L" }, { name: "Douglas DC-8-72", iataTypeCode: "D8Q" }, { name: "Douglas DC-9-10", iataTypeCode: "D91" }, { name: "Douglas DC-9-20", iataTypeCode: "D92" }, { name: "Douglas DC-9-30", iataTypeCode: "D93" }, { name: "Douglas DC-9-40", iataTypeCode: "D94" }, { name: "Douglas DC-9-50", iataTypeCode: "D95" }, { name: "Douglas DC-10", iataTypeCode: "D10" }, { name: "Douglas DC-10-10", iataTypeCode: "D1X" }, { name: "Douglas DC-10-30", iataTypeCode: "D1Y" }, { name: "Embraer 170", iataTypeCode: "E70" }, { name: "Embraer 175", iataTypeCode: "E75" }, { name: "Embraer 190", iataTypeCode: "E90" }, { name: "Embraer 195", iataTypeCode: "E95" }, { name: "Embraer E190-E2", iataTypeCode: "290" }, { name: "Embraer E195-E2", iataTypeCode: "295" }, { name: "Embraer EMB.110 Bandeirante", iataTypeCode: "EMB" }, { name: "Embraer EMB.120 Brasilia", iataTypeCode: "EM2" }, { name: "Embraer Legacy 600", iataTypeCode: "ER3" }, { name: "Embraer Phenom 100", iataTypeCode: "EP1" }, { name: "Embraer Phenom 300", iataTypeCode: "EP3" }, { name: "Embraer RJ135", iataTypeCode: "ER3" }, { name: "Embraer RJ140", iataTypeCode: "ERD" }, { name: "Embraer RJ145 Amazon", iataTypeCode: "ER4" }, { name: "Ilyushin IL18", iataTypeCode: "IL8" }, { name: "Ilyushin IL62", iataTypeCode: "IL6" }, { name: "Ilyushin IL76", iataTypeCode: "IL7" }, { name: "Ilyushin IL86", iataTypeCode: "ILW" }, { name: "Ilyushin IL96-300", iataTypeCode: "I93" }, { name: "Ilyushin IL114", iataTypeCode: "I14" }, { name: "Lockheed L-182 / 282 / 382 (L-100) Hercules", iataTypeCode: "LOH" }, { name: "Lockheed L-188 Electra", iataTypeCode: "LOE" }, { name: "Lockheed L-1011 Tristar", iataTypeCode: "L10" }, { name: "Lockheed L-1049 Super Constellation", iataTypeCode: "L49" }, { name: "McDonnell Douglas MD11", iataTypeCode: "M11" }, { name: "McDonnell Douglas MD80", iataTypeCode: "M80" }, { name: "McDonnell Douglas MD81", iataTypeCode: "M81" }, { name: "McDonnell Douglas MD82", iataTypeCode: "M82" }, { name: "McDonnell Douglas MD83", iataTypeCode: "M83" }, { name: "McDonnell Douglas MD87", iataTypeCode: "M87" }, { name: "McDonnell Douglas MD88", iataTypeCode: "M88" }, { name: "McDonnell Douglas MD90", iataTypeCode: "M90" }, { name: "Sukhoi Superjet 100-95", iataTypeCode: "SU9" }, { name: "Tupolev Tu-134", iataTypeCode: "TU3" }, { name: "Tupolev Tu-154", iataTypeCode: "TU5" }, { name: "Tupolev Tu-204", iataTypeCode: "T20" }, { name: "Yakovlev Yak-40", iataTypeCode: "YK4" }, { name: "Yakovlev Yak-42", iataTypeCode: "YK2" }];
@@ -20831,8 +20848,6 @@ const createReputationConfigFactory = (platformConfig, businessId, partnerLocati
20831
20848
  return {
20832
20849
  id: f.string.uuid(),
20833
20850
  businessId,
20834
- locationMappings,
20835
- // Backend provides this by reading from partner locations
20836
20851
  emailChannelSenderId: null,
20837
20852
  // Will be set when user configures
20838
20853
  smsChannelSenderId: null,
@@ -22083,12 +22098,16 @@ const setMSWSandboxPlatformId = (platformId) => {
22083
22098
  );
22084
22099
  };
22085
22100
  const measureAndAcquireHandlers = [
22086
- http.get(`${HOSTNAME}/api/businesses/me`, () => {
22087
- const platformData = getSandboxDataForPlatform(currentSandboxPlatformId);
22101
+ http.get(`${HOSTNAME}/api/businesses/me`, async ({ request }) => {
22102
+ const response = await fetch(bypass(request));
22103
+ const originalData = await response.json();
22088
22104
  return HttpResponse.json({
22089
- success: true,
22090
- message: "Success (Sandbox)",
22091
- data: platformData.businessesMe
22105
+ ...originalData,
22106
+ data: {
22107
+ ...originalData.data,
22108
+ data_integration_completed_at: "2025-05-01T00:00:00.000Z",
22109
+ website_tracking_completed_at: "2025-05-01T00:00:00.000Z"
22110
+ }
22092
22111
  });
22093
22112
  }),
22094
22113
  http.get(`${HOSTNAME}/api/ad-accounts`, () => {
@@ -22643,22 +22662,28 @@ function createGoogleReview(platformConfig, partnerLocations, startDate, endDate
22643
22662
  ]);
22644
22663
  const reviewContent = generateReviewContent(platformConfig, rating);
22645
22664
  const location2 = partnerLocations.length > 0 ? f.helpers.arrayElement(partnerLocations) : null;
22665
+ const createdAtDate = f.date.between({ from: startDate, to: endDate });
22646
22666
  const hasReply = f.helpers.weightedArrayElement([
22647
22667
  { weight: 30, value: true },
22648
22668
  // 30% have business replies
22649
22669
  { weight: 70, value: false }
22650
22670
  ]);
22651
- const replyData = hasReply ? {
22652
- source: "google_business_profile",
22653
- reply_comment: generateReplyContent(platformConfig, rating),
22654
- reply_updated_at: f.date.between({
22655
- from: new Date(
22656
- f.date.between({ from: startDate, to: endDate }).getTime() + 24 * 60 * 60 * 1e3
22657
- ),
22658
- // At least 1 day after review
22671
+ const replyData = hasReply ? (() => {
22672
+ const oneDayMs = 24 * 60 * 60 * 1e3;
22673
+ const replyWindowStartMs = Math.min(
22674
+ createdAtDate.getTime() + oneDayMs,
22675
+ endDate.getTime()
22676
+ );
22677
+ const reply_updated_at = replyWindowStartMs === endDate.getTime() ? new Date(replyWindowStartMs).toISOString() : f.date.between({
22678
+ from: new Date(replyWindowStartMs),
22659
22679
  to: endDate
22660
- }).toISOString()
22661
- } : void 0;
22680
+ }).toISOString();
22681
+ return {
22682
+ source: "google_business_profile",
22683
+ reply_comment: generateReplyContent(platformConfig, rating),
22684
+ reply_updated_at
22685
+ };
22686
+ })() : void 0;
22662
22687
  const isLinked = f.helpers.weightedArrayElement([
22663
22688
  { weight: 30, value: true },
22664
22689
  // 30% are linked
@@ -22674,14 +22699,15 @@ function createGoogleReview(platformConfig, partnerLocations, startDate, endDate
22674
22699
  userName,
22675
22700
  // userEmail: faker.internet.email(), // In real Google reviews, email might not be available
22676
22701
  content: reviewContent,
22677
- createdAt: f.date.between({ from: startDate, to: endDate }).toISOString(),
22702
+ createdAt: createdAtDate.toISOString(),
22678
22703
  hasReply,
22679
22704
  isResponded: false,
22680
22705
  // Not applicable for Google reviews
22681
- locationId: location2?.externalId || void 0,
22706
+ locationId: location2?.id || void 0,
22682
22707
  ...replyData ? { replies: replyData } : {},
22683
22708
  partnerUserId: isLinked ? f.string.uuid() : void 0,
22684
- reviewExternalId: f.string.alphanumeric(21)
22709
+ reviewExternalId: f.string.alphanumeric(21),
22710
+ reviewerImageUrl: f.image.url()
22685
22711
  };
22686
22712
  }
22687
22713
  function createInternalFeedback(platformConfig, partnerLocations, startDate, endDate) {
@@ -22725,7 +22751,8 @@ function createInternalFeedback(platformConfig, partnerLocations, startDate, end
22725
22751
  // 40% have customer responses
22726
22752
  { weight: 60, value: false }
22727
22753
  ]),
22728
- locationId: location2?.externalId || void 0
22754
+ locationId: location2?.id || void 0,
22755
+ reviewerImageUrl: f.image.url()
22729
22756
  };
22730
22757
  }
22731
22758
  function generateReviewContent(platformConfig, rating) {
@@ -23292,7 +23319,8 @@ const generateAuditLogData = ({
23292
23319
  cursor,
23293
23320
  limit,
23294
23321
  searchTerm,
23295
- orderBy
23322
+ orderBy,
23323
+ directFeedbackEnabled = true
23296
23324
  }) => {
23297
23325
  const queryStartDate = startDate ? new Date(startDate) : new Date(Date.now() - 30 * 24 * 60 * 60 * 1e3);
23298
23326
  const queryEndDate = endDate ? new Date(endDate) : /* @__PURE__ */ new Date();
@@ -23307,7 +23335,8 @@ const generateAuditLogData = ({
23307
23335
  const allLogs = generateAuditLogPool(
23308
23336
  queryStartDate,
23309
23337
  queryEndDate,
23310
- scaledLogCount
23338
+ scaledLogCount,
23339
+ directFeedbackEnabled
23311
23340
  );
23312
23341
  let filteredLogs = allLogs;
23313
23342
  if (startDate || endDate) {
@@ -23346,10 +23375,10 @@ const generateAuditLogData = ({
23346
23375
  nextCursor
23347
23376
  };
23348
23377
  };
23349
- function generateAuditLogPool(startDate, endDate, count) {
23378
+ function generateAuditLogPool(startDate, endDate, count, directFeedbackEnabled) {
23350
23379
  const logs = [];
23351
23380
  const timeSpan = endDate.getTime() - startDate.getTime();
23352
- const eventSequences = [
23381
+ let eventSequences = [
23353
23382
  // Private Feedback flow
23354
23383
  {
23355
23384
  type: "SURVEY_REQUEST",
@@ -23360,7 +23389,8 @@ function generateAuditLogPool(startDate, endDate, count) {
23360
23389
  "Private feedback request delivered to customer",
23361
23390
  "Customer opened private feedback request",
23362
23391
  "Private feedback completed by customer"
23363
- ]
23392
+ ],
23393
+ isDirectFeedback: true
23364
23394
  },
23365
23395
  // Google Review flow
23366
23396
  {
@@ -23370,7 +23400,8 @@ function generateAuditLogPool(startDate, endDate, count) {
23370
23400
  messages: [
23371
23401
  "Google review request sent to",
23372
23402
  "Google review request delivered to"
23373
- ]
23403
+ ],
23404
+ isDirectFeedback: false
23374
23405
  },
23375
23406
  // Google review flow
23376
23407
  {
@@ -23380,7 +23411,8 @@ function generateAuditLogPool(startDate, endDate, count) {
23380
23411
  messages: [
23381
23412
  "New Google review received from",
23382
23413
  "Response sent to Google review from"
23383
- ]
23414
+ ],
23415
+ isDirectFeedback: false
23384
23416
  },
23385
23417
  // Reminder flows
23386
23418
  {
@@ -23390,7 +23422,8 @@ function generateAuditLogPool(startDate, endDate, count) {
23390
23422
  messages: [
23391
23423
  "Private feedback reminder sent to",
23392
23424
  "Private feedback reminder delivered to"
23393
- ]
23425
+ ],
23426
+ isDirectFeedback: true
23394
23427
  },
23395
23428
  {
23396
23429
  type: "REVIEW_REMINDER",
@@ -23399,9 +23432,13 @@ function generateAuditLogPool(startDate, endDate, count) {
23399
23432
  messages: [
23400
23433
  "Google review reminder sent to",
23401
23434
  "Google review reminder delivered to"
23402
- ]
23435
+ ],
23436
+ isDirectFeedback: false
23403
23437
  }
23404
23438
  ];
23439
+ if (!directFeedbackEnabled) {
23440
+ eventSequences = eventSequences.filter((seq) => !seq.isDirectFeedback);
23441
+ }
23405
23442
  for (let i2 = 0; i2 < count; i2++) {
23406
23443
  const sequence = f.helpers.arrayElement(eventSequences);
23407
23444
  const statusIndex = f.number.int({
@@ -23990,27 +24027,8 @@ const reputationHandlers = [
23990
24027
  data: platformData.reputationData?.gbpConnection || null
23991
24028
  });
23992
24029
  }),
23993
- // Business Branding Update (used in preview step)
23994
- http.put(`${HOSTNAME}/api/businesses/me`, async ({ request }) => {
23995
- const body = await request.json();
23996
- const platformData = getSandboxDataForPlatform(currentSandboxPlatformId);
23997
- const existingBusiness = platformData.businessesMe;
23998
- const updatedBranding = {
23999
- ...existingBusiness?.branding,
24000
- ...body?.branding
24001
- };
24002
- return HttpResponse.json({
24003
- success: true,
24004
- message: "Branding updated successfully (Sandbox)",
24005
- data: {
24006
- ...existingBusiness,
24007
- name: body?.name || existingBusiness?.name || "Updated Brand",
24008
- branding: updatedBranding
24009
- }
24010
- });
24011
- }),
24012
24030
  // Reputation Responses (unified reviews and internal feedback)
24013
- http.get(`${HOSTNAME}/api/reputation/responses`, ({ request }) => {
24031
+ http.get(`${HOSTNAME}/api/reputation/responses`, async ({ request }) => {
24014
24032
  const url = new URL(request.url);
24015
24033
  const startDate = url.searchParams.get("start_date");
24016
24034
  const endDate = url.searchParams.get("end_date");
@@ -24019,6 +24037,21 @@ const reputationHandlers = [
24019
24037
  const limit = parseInt(url.searchParams.get("limit") || "25", 10);
24020
24038
  const searchTerm = url.searchParams.get("search_term");
24021
24039
  const platformData = getSandboxDataForPlatform(currentSandboxPlatformId);
24040
+ let directFeedbackEnabled = false;
24041
+ try {
24042
+ const partnerResponse = await fetch(`${HOSTNAME}/api/partners/me`, {
24043
+ headers: request.headers
24044
+ });
24045
+ if (partnerResponse.ok) {
24046
+ const partnerData = await partnerResponse.json();
24047
+ directFeedbackEnabled = partnerData?.data?.feature_customizations?.reputation?.directFeedbackEnabled ?? false;
24048
+ }
24049
+ } catch (error2) {
24050
+ console.warn(
24051
+ "Failed to fetch partner data in MSW handler, using default directFeedbackEnabled=true",
24052
+ error2
24053
+ );
24054
+ }
24022
24055
  const responsesData = generateReputationResponsesData({
24023
24056
  platformData,
24024
24057
  startDate,
@@ -24028,6 +24061,12 @@ const reputationHandlers = [
24028
24061
  limit,
24029
24062
  searchTerm
24030
24063
  });
24064
+ if (!directFeedbackEnabled) {
24065
+ responsesData.data = responsesData.data.filter(
24066
+ (response) => response.source !== "internal"
24067
+ );
24068
+ responsesData.total = responsesData.data.length;
24069
+ }
24031
24070
  return HttpResponse.json({
24032
24071
  success: true,
24033
24072
  message: "Success (Sandbox)",
@@ -24140,7 +24179,7 @@ const reputationHandlers = [
24140
24179
  });
24141
24180
  }),
24142
24181
  // Reputation Audit Logs
24143
- http.get(`${HOSTNAME}/api/reputation/audit-logs`, ({ request }) => {
24182
+ http.get(`${HOSTNAME}/api/reputation/audit-logs`, async ({ request }) => {
24144
24183
  const url = new URL(request.url);
24145
24184
  const startDate = url.searchParams.get("start_date");
24146
24185
  const endDate = url.searchParams.get("end_date");
@@ -24149,6 +24188,21 @@ const reputationHandlers = [
24149
24188
  const limit = parseInt(url.searchParams.get("limit") || "25", 10);
24150
24189
  const searchTerm = url.searchParams.get("search_term");
24151
24190
  const orderBy = url.searchParams.get("order_by") || "timestamp";
24191
+ let directFeedbackEnabled = false;
24192
+ try {
24193
+ const partnerResponse = await fetch(`${HOSTNAME}/api/partners/me`, {
24194
+ headers: request.headers
24195
+ });
24196
+ if (partnerResponse.ok) {
24197
+ const partnerData = await partnerResponse.json();
24198
+ directFeedbackEnabled = partnerData?.data?.feature_customizations?.reputation?.directFeedbackEnabled ?? false;
24199
+ }
24200
+ } catch (error2) {
24201
+ console.warn(
24202
+ "Failed to fetch partner data in MSW handler, using default directFeedbackEnabled=true",
24203
+ error2
24204
+ );
24205
+ }
24152
24206
  const auditLogResponse = generateAuditLogData({
24153
24207
  startDate,
24154
24208
  endDate,
@@ -24156,7 +24210,8 @@ const reputationHandlers = [
24156
24210
  cursor,
24157
24211
  limit,
24158
24212
  searchTerm,
24159
- orderBy
24213
+ orderBy,
24214
+ directFeedbackEnabled
24160
24215
  });
24161
24216
  return HttpResponse.json({
24162
24217
  success: true,
@@ -24203,149 +24258,30 @@ const reputationHandlers = [
24203
24258
  }
24204
24259
  });
24205
24260
  }),
24206
- // Reputation Automation Template
24207
- http.get(`${HOSTNAME}/api/reputation/reputation-template`, () => {
24208
- const platformData = getSandboxDataForPlatform(currentSandboxPlatformId);
24209
- const businessName = platformData.businessesMe?.name || "Our Business";
24210
- const primaryColor = platformData.businessesMe?.branding?.primaryColor || "#2563eb";
24211
- const feedbackHtml = `<!DOCTYPE html>
24212
- <html>
24213
- <head>
24214
- <meta charset="UTF-8">
24215
- <title>Feedback Request</title>
24216
- <style>
24217
- body { font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px; background: #f5f5f5; }
24218
- .header { background: ${primaryColor}; color: white; padding: 30px 20px; text-align: center; border-radius: 8px 8px 0 0; }
24219
- .content { background: white; padding: 30px 20px; border-radius: 0 0 8px 8px; }
24220
- .button { background: ${primaryColor}; color: white; padding: 14px 28px; text-decoration: none; border-radius: 6px; display: inline-block; margin: 20px 0; font-weight: 600; }
24221
- .rating-scale { display: flex; gap: 8px; justify-content: center; margin: 20px 0; }
24222
- .rating-box { border: 2px solid #ddd; padding: 12px 16px; border-radius: 4px; font-weight: bold; }
24223
- </style>
24224
- </head>
24225
- <body>
24226
- <div class="header">
24227
- <h1>💬 How was your experience?</h1>
24228
- </div>
24229
- <div class="content">
24230
- <p>Hi there! 👋</p>
24231
- <p>Thank you for choosing <strong>${businessName}</strong>! We hope you had a great experience with us.</p>
24232
- <p>We'd love to hear your honest feedback. On a scale of 1-10, how would you rate your experience?</p>
24233
- <div class="rating-scale">
24234
- <div class="rating-box">1</div>
24235
- <div class="rating-box">...</div>
24236
- <div class="rating-box">10</div>
24237
- </div>
24238
- <a href="{{feedback_url}}" class="button">Share Your Feedback</a>
24239
- <p>Your response helps us improve and serve you better.</p>
24240
- <p>Thank you for your time!</p>
24241
- <p>Best regards,<br>The ${businessName} Team</p>
24242
- </div>
24243
- </body>
24244
- </html>`;
24245
- const googleReviewHtml = `<!DOCTYPE html>
24246
- <html>
24247
- <head>
24248
- <meta charset="UTF-8">
24249
- <title>Review Request</title>
24250
- <style>
24251
- body { font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px; background: #f5f5f5; }
24252
- .header { background: ${primaryColor}; color: white; padding: 30px 20px; text-align: center; border-radius: 8px 8px 0 0; }
24253
- .content { background: white; padding: 30px 20px; border-radius: 0 0 8px 8px; }
24254
- .button { background: ${primaryColor}; color: white; padding: 14px 28px; text-decoration: none; border-radius: 6px; display: inline-block; margin: 20px 0; font-weight: 600; }
24255
- .stars { color: #fbbf24; font-size: 24px; }
24256
- </style>
24257
- </head>
24258
- <body>
24259
- <div class="header">
24260
- <h1>⭐ We'd love your Google review!</h1>
24261
- </div>
24262
- <div class="content">
24263
- <p>Hi there! 👋</p>
24264
- <p>Thank you so much for your positive feedback about <strong>${businessName}</strong>!</p>
24265
- <p>Since you had a great experience, we'd be incredibly grateful if you could share your thoughts on Google. It only takes a moment and helps other customers discover us.</p>
24266
- <div class="stars">⭐ ⭐ ⭐ ⭐ ⭐</div>
24267
- <a href="{{external_review_url}}" class="button">Leave a Google Review</a>
24268
- <p>Your support means the world to us and helps our business grow!</p>
24269
- <p>Thank you so much!</p>
24270
- <p>Warmly,<br>The ${businessName} Team</p>
24271
- </div>
24272
- </body>
24273
- </html>`;
24274
- const templates = [
24275
- {
24276
- id: "0199110d-eac1-7211-aeb3-1d9d9b60e77b",
24277
- name: "Private Feedback Request",
24278
- version: "1.0.0",
24279
- status: "active",
24280
- feature: "reputation",
24281
- visibility: "visible",
24282
- contents: {
24283
- name: "reputation-feedback-request",
24284
- description: "Request private direct feedback from customers",
24285
- feature: "reputation",
24286
- triggerMetadata: {
24287
- cooldownSeconds: 86400,
24288
- // 1 day after purchase
24289
- eventFilter: {
24290
- segment_id: "all_customers"
24291
- }
24292
- },
24293
- actionData: [
24294
- {
24295
- type: "send_communication",
24296
- index: 0,
24297
- subject: `How was your experience with ${businessName}?`,
24298
- previewText: "We'd love your honest feedback",
24299
- compiledHtml: feedbackHtml
24300
- }
24301
- ]
24302
- }
24303
- },
24304
- {
24305
- id: "0199110d-eac1-7211-aeb3-1d9d9b60e77c",
24306
- name: "Google Review Request",
24307
- version: "1.0.0",
24308
- status: "active",
24309
- feature: "reputation",
24310
- visibility: "visible",
24311
- contents: {
24312
- name: "reputation-google-review-request",
24313
- description: "Request Google review from satisfied customers (9-10 rating)",
24314
- feature: "reputation",
24315
- triggerMetadata: {
24316
- cooldownSeconds: 0,
24317
- // Sent immediately after positive feedback
24318
- eventFilter: {
24319
- segment_id: "satisfied_customers"
24320
- }
24321
- },
24322
- actionData: [
24323
- {
24324
- type: "send_communication",
24325
- index: 0,
24326
- subject: `Would you leave us a Google review? - ${businessName}`,
24327
- previewText: "Share your positive experience with others",
24328
- compiledHtml: googleReviewHtml
24329
- }
24330
- ]
24331
- }
24332
- }
24333
- ];
24334
- const sortedTemplates = templates.sort(
24335
- (a2, b2) => a2.name.localeCompare(b2.name, void 0, { sensitivity: "base" })
24336
- );
24261
+ // Activate Automations
24262
+ http.post(`${HOSTNAME}/api/reputation/activate-automations`, () => {
24337
24263
  return HttpResponse.json({
24338
24264
  success: true,
24339
24265
  message: "Success (Sandbox)",
24340
- data: sortedTemplates
24266
+ data: {}
24341
24267
  });
24342
24268
  }),
24343
- // Activate Automations
24344
- http.post(`${HOSTNAME}/api/reputation/activate-automations`, () => {
24269
+ // Generate Review Response
24270
+ http.post(`${HOSTNAME}/api/reputation/reviews/generate-response`, () => {
24345
24271
  return HttpResponse.json({
24346
24272
  success: true,
24347
24273
  message: "Success (Sandbox)",
24348
- data: {}
24274
+ data: {
24275
+ response: "This is a test response"
24276
+ }
24277
+ });
24278
+ }),
24279
+ // Post Review Reply - prevent actual replies in sandbox
24280
+ http.post(`${HOSTNAME}/api/reputation/reviews/reply`, () => {
24281
+ return HttpResponse.json({
24282
+ success: true,
24283
+ message: "Reply intercepted (Sandbox)",
24284
+ data: { success: true }
24349
24285
  });
24350
24286
  }),
24351
24287
  // Sync Google Reviews
@@ -24355,7 +24291,41 @@ const reputationHandlers = [
24355
24291
  message: "Success (Sandbox)",
24356
24292
  data: {}
24357
24293
  });
24358
- })
24294
+ }),
24295
+ // finalize onboarding
24296
+ http.post(
24297
+ `${HOSTNAME}/api/reputation/finalize-onboarding`,
24298
+ async ({ request }) => {
24299
+ const body = await request.json();
24300
+ const currentConfig = mockStore.reputationConfig || getSandboxDataForPlatform(currentSandboxPlatformId).reputationData?.reputationConfig;
24301
+ const updatedConfig = {
24302
+ ...currentConfig || {},
24303
+ id: currentConfig?.id || "mock-reputation-config-id",
24304
+ businessId: currentConfig?.businessId || "mock-business-id",
24305
+ emailChannelSenderId: body.emailChannelSenderId || currentConfig?.emailChannelSenderId || null,
24306
+ smsChannelSenderId: body.smsChannelSenderId || currentConfig?.smsChannelSenderId || null,
24307
+ completedOnboardingAt: (/* @__PURE__ */ new Date()).toISOString(),
24308
+ createdAt: currentConfig?.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
24309
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
24310
+ };
24311
+ mockStore.reputationConfig = updatedConfig;
24312
+ const currentLocations = mockStore.partnerLocations || getSandboxDataForPlatform(currentSandboxPlatformId).reputationData?.partnerLocations || [];
24313
+ const locationMappings = {};
24314
+ currentLocations.forEach((location2) => {
24315
+ locationMappings[location2.externalId] = location2.googleBusinessProfilePlaceId || null;
24316
+ });
24317
+ const response = {
24318
+ success: true,
24319
+ message: "Configuration updated successfully (Sandbox)",
24320
+ data: {
24321
+ ...mockStore.reputationConfig,
24322
+ locationMappings
24323
+ // Include current mappings from partner locations
24324
+ }
24325
+ };
24326
+ return HttpResponse.json(response);
24327
+ }
24328
+ )
24359
24329
  ];
24360
24330
  const getHandlersByFeatures = (features) => {
24361
24331
  const allHandlers = [];
package/dist/index.d.ts CHANGED
@@ -225,7 +225,7 @@ export declare enum ReachMergeFieldTypeEnum {
225
225
  DYNAMIC = "dynamic"
226
226
  }
227
227
 
228
- export declare const ReachProvider: ({ authToken, language, children, theme, debug, callbacks, feature, sandbox, clientEntryPoint, hideFeature, }: ReachConfig & _PrivateProps) => JSX_2.Element;
228
+ export declare const ReachProvider: ({ authToken, language, children, theme, debug, callbacks, feature, sandbox, clientEntryPoint, hideFeature, enableFeature, }: ReachConfig & _PrivateProps) => JSX_2.Element;
229
229
 
230
230
  /**
231
231
  * Callback function for requesting new token from parent