@embedreach/components 0.3.34 → 0.3.35

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.
@@ -18699,6 +18699,38 @@ function bypass(input, init) {
18699
18699
  return requestClone;
18700
18700
  }
18701
18701
  checkGlobals();
18702
+ let getRandomValues;
18703
+ const rnds8 = new Uint8Array(16);
18704
+ function rng() {
18705
+ if (!getRandomValues) {
18706
+ getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
18707
+ if (!getRandomValues) {
18708
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
18709
+ }
18710
+ }
18711
+ return getRandomValues(rnds8);
18712
+ }
18713
+ const byteToHex = [];
18714
+ for (let i2 = 0; i2 < 256; ++i2) {
18715
+ byteToHex.push((i2 + 256).toString(16).slice(1));
18716
+ }
18717
+ function unsafeStringify(arr, offset = 0) {
18718
+ return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
18719
+ }
18720
+ const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
18721
+ const native = {
18722
+ randomUUID
18723
+ };
18724
+ function v4(options, buf, offset) {
18725
+ if (native.randomUUID && !buf && !options) {
18726
+ return native.randomUUID();
18727
+ }
18728
+ options = options || {};
18729
+ const rnds = options.random || (options.rng || rng)();
18730
+ rnds[6] = rnds[6] & 15 | 64;
18731
+ rnds[8] = rnds[8] & 63 | 128;
18732
+ return unsafeStringify(rnds);
18733
+ }
18702
18734
  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" }];
18703
18735
  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" }];
18704
18736
  var r = [{ name: "Adelaide International Airport", iataCode: "ADL" }, { name: "Adolfo Suarez Madrid-Barajas Airport", iataCode: "MAD" }, { name: "Aeroparque Jorge Newbery Airport", iataCode: "AEP" }, { name: "Afonso Pena International Airport", iataCode: "CWB" }, { name: "Alfonso Bonilla Aragon International Airport", iataCode: "CLO" }, { name: "Amsterdam Airport Schiphol", iataCode: "AMS" }, { name: "Arturo Merino Benitez International Airport", iataCode: "SCL" }, { name: "Auckland International Airport", iataCode: "AKL" }, { name: "Beijing Capital International Airport", iataCode: "PEK" }, { name: "Belem Val de Cans International Airport", iataCode: "BEL" }, { name: "Belo Horizonte Tancredo Neves International Airport", iataCode: "CNF" }, { name: "Berlin-Tegel Airport", iataCode: "TXL" }, { name: "Bole International Airport", iataCode: "ADD" }, { name: "Brasilia-Presidente Juscelino Kubitschek International Airport", iataCode: "BSB" }, { name: "Brisbane International Airport", iataCode: "BNE" }, { name: "Brussels Airport", iataCode: "BRU" }, { name: "Cairns Airport", iataCode: "CNS" }, { name: "Cairo International Airport", iataCode: "CAI" }, { name: "Canberra Airport", iataCode: "CBR" }, { name: "Capetown International Airport", iataCode: "CPT" }, { name: "Charles de Gaulle International Airport", iataCode: "CDG" }, { name: "Charlotte Douglas International Airport", iataCode: "CLT" }, { name: "Chengdu Shuangliu International Airport", iataCode: "CTU" }, { name: "Chhatrapati Shivaji International Airport", iataCode: "BOM" }, { name: "Chicago O'Hare International Airport", iataCode: "ORD" }, { name: "Chongqing Jiangbei International Airport", iataCode: "CKG" }, { name: "Christchurch International Airport", iataCode: "CHC" }, { name: "Copenhagen Kastrup Airport", iataCode: "CPH" }, { name: "Dallas Fort Worth International Airport", iataCode: "DFW" }, { name: "Daniel K. Inouye International Airport", iataCode: "HNL" }, { name: "Denver International Airport", iataCode: "DEN" }, { name: "Don Mueang International Airport", iataCode: "DMK" }, { name: "Dubai International Airport", iataCode: "DXB" }, { name: "Dublin Airport", iataCode: "DUB" }, { name: "Dusseldorf Airport", iataCode: "DUS" }, { name: "El Dorado International Airport", iataCode: "BOG" }, { name: "Eleftherios Venizelos International Airport", iataCode: "ATH" }, { name: "Faa'a International Airport", iataCode: "PPT" }, { name: "Fort Lauderdale Hollywood International Airport", iataCode: "FLL" }, { name: "Fortaleza Pinto Martins International Airport", iataCode: "FOR" }, { name: "Frankfurt am Main Airport", iataCode: "FRA" }, { name: "George Bush Intercontinental Houston Airport", iataCode: "IAH" }, { name: "Gold Coast Airport", iataCode: "OOL" }, { name: "Guarulhos - Governador Andre Franco Montoro International Airport", iataCode: "GRU" }, { name: "Hartsfield-Jackson Atlanta International Airport", iataCode: "ATL" }, { name: "Helsinki Vantaa Airport", iataCode: "HEL" }, { name: "Hobart International Airport", iataCode: "HBA" }, { name: "Hong Kong International Airport", iataCode: "HKG" }, { name: "Houari Boumediene Airport", iataCode: "ALG" }, { name: "Hurgada International Airport", iataCode: "HRG" }, { name: "Incheon International Airport", iataCode: "ICN" }, { name: "Indira Gandhi International Airport", iataCode: "DEL" }, { name: "Istanbul Airport", iataCode: "IST" }, { name: "Jacksons International Airport", iataCode: "POM" }, { name: "Jeju International Airport", iataCode: "CJU" }, { name: "John F Kennedy International Airport", iataCode: "JFK" }, { name: "Jorge Chavez International Airport", iataCode: "LIM" }, { name: "Jose Maria Cordova International Airport", iataCode: "MDE" }, { name: "Josep Tarradellas Barcelona-El Prat Airport", iataCode: "BCN" }, { name: "Kahului Airport", iataCode: "OGG" }, { name: "King Abdulaziz International Airport", iataCode: "JED" }, { name: "Kuala Lumpur International Airport", iataCode: "KUL" }, { name: "Kunming Changshui International Airport", iataCode: "KMG" }, { name: "La Tontouta International Airport", iataCode: "NOU" }, { name: "Leonardo da Vinci-Fiumicino Airport", iataCode: "FCO" }, { name: "London Heathrow Airport", iataCode: "LHR" }, { name: "Los Angeles International Airport", iataCode: "LAX" }, { name: "McCarran International Airport", iataCode: "LAS" }, { name: "Melbourne International Airport", iataCode: "MEL" }, { name: "Mexico City International Airport", iataCode: "MEX" }, { name: "Miami International Airport", iataCode: "MIA" }, { name: "Ministro Pistarini International Airport", iataCode: "EZE" }, { name: "Minneapolis-St Paul International/Wold-Chamberlain Airport", iataCode: "MSP" }, { name: "Mohammed V International Airport", iataCode: "CMN" }, { name: "Moscow Domodedovo Airport", iataCode: "DME" }, { name: "Munich Airport", iataCode: "MUC" }, { name: "Murtala Muhammed International Airport", iataCode: "LOS" }, { name: "Nadi International Airport", iataCode: "NAN" }, { name: "Nairobi Jomo Kenyatta International Airport", iataCode: "NBO" }, { name: "Narita International Airport", iataCode: "NRT" }, { name: "Newark Liberty International Airport", iataCode: "EWR" }, { name: "Ninoy Aquino International Airport", iataCode: "MNL" }, { name: "Noumea Magenta Airport", iataCode: "GEA" }, { name: "O. R. Tambo International Airport", iataCode: "JNB" }, { name: "Orlando International Airport", iataCode: "MCO" }, { name: "Oslo Lufthavn", iataCode: "OSL" }, { name: "Perth Airport", iataCode: "PER" }, { name: "Phoenix Sky Harbor International Airport", iataCode: "PHX" }, { name: "Recife Guararapes-Gilberto Freyre International Airport", iataCode: "REC" }, { name: "Rio de Janeiro Galeao International Airport", iataCode: "GIG" }, { name: "Salgado Filho International Airport", iataCode: "POA" }, { name: "Salvador Deputado Luis Eduardo Magalhaes International Airport", iataCode: "SSA" }, { name: "San Francisco International Airport", iataCode: "SFO" }, { name: "Santos Dumont Airport", iataCode: "SDU" }, { name: "Sao Paulo-Congonhas Airport", iataCode: "CGH" }, { name: "Seattle Tacoma International Airport", iataCode: "SEA" }, { name: "Shanghai Hongqiao International Airport", iataCode: "SHA" }, { name: "Shanghai Pudong International Airport", iataCode: "PVG" }, { name: "Shenzhen Bao'an International Airport", iataCode: "SZX" }, { name: "Sheremetyevo International Airport", iataCode: "SVO" }, { name: "Singapore Changi Airport", iataCode: "SIN" }, { name: "Soekarno-Hatta International Airport", iataCode: "CGK" }, { name: 'Stockholm-Arlanda Airport"', iataCode: "ARN" }, { name: "Suvarnabhumi Airport", iataCode: "BKK" }, { name: "Sydney Kingsford Smith International Airport", iataCode: "SYD" }, { name: "Taiwan Taoyuan International Airport", iataCode: "TPE" }, { name: "Tan Son Nhat International Airport", iataCode: "SGN" }, { name: "Tokyo Haneda International Airport", iataCode: "HND" }, { name: "Toronto Pearson International Airport", iataCode: "YYZ" }, { name: "Tunis Carthage International Airport", iataCode: "TUN" }, { name: "Vancouver International Airport", iataCode: "YVR" }, { name: "Vienna International Airport", iataCode: "VIE" }, { name: "Viracopos International Airport", iataCode: "VCP" }, { name: "Vnukovo International Airport", iataCode: "VKO" }, { name: "Wellington International Airport", iataCode: "WLG" }, { name: "Xi'an Xianyang International Airport", iataCode: "XIY" }, { name: "Zhukovsky International Airport", iataCode: "ZIA" }, { name: "Zurich Airport", iataCode: "ZRH" }];
@@ -21446,7 +21478,11 @@ const createWebPresenceContentFactory = (platformConfig, businessConfig) => {
21446
21478
  const createSandboxMeasureAndAcquireData = (platformId, businessId) => {
21447
21479
  const platformConfigKey = getPlatformConfigKey(platformId);
21448
21480
  const platformConfig = {
21449
- id: platformConfigKey
21481
+ id: platformConfigKey,
21482
+ name: platformConfigKey === "goose" ? "Paws Pet Hotel" : platformConfigKey === "renterra" ? "Tomers Rentals" : "Default",
21483
+ brandColors: [],
21484
+ locationNames: [],
21485
+ locationAreas: []
21450
21486
  };
21451
21487
  const businessConfig = getBusinessConfig(platformId);
21452
21488
  const businessesMe = createBusinessDataFactory(
@@ -21690,38 +21726,6 @@ function parseDateRange(startDateString, endDateString, defaultDays = 30) {
21690
21726
  endDate
21691
21727
  };
21692
21728
  }
21693
- let getRandomValues;
21694
- const rnds8 = new Uint8Array(16);
21695
- function rng() {
21696
- if (!getRandomValues) {
21697
- getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
21698
- if (!getRandomValues) {
21699
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
21700
- }
21701
- }
21702
- return getRandomValues(rnds8);
21703
- }
21704
- const byteToHex = [];
21705
- for (let i2 = 0; i2 < 256; ++i2) {
21706
- byteToHex.push((i2 + 256).toString(16).slice(1));
21707
- }
21708
- function unsafeStringify(arr, offset = 0) {
21709
- return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
21710
- }
21711
- const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
21712
- const native = {
21713
- randomUUID
21714
- };
21715
- function v4(options, buf, offset) {
21716
- if (native.randomUUID && true && !options) {
21717
- return native.randomUUID();
21718
- }
21719
- options = options || {};
21720
- const rnds = options.random || (options.rng || rng)();
21721
- rnds[6] = rnds[6] & 15 | 64;
21722
- rnds[8] = rnds[8] & 63 | 128;
21723
- return unsafeStringify(rnds);
21724
- }
21725
21729
  function scaleChannelMetrics(channelMetrics, options) {
21726
21730
  const {
21727
21731
  requestedDays,
@@ -23787,7 +23791,7 @@ function calculateNPSBreakdown(totalResponses, targetNPS) {
23787
23791
  passiveCount
23788
23792
  };
23789
23793
  }
23790
- const mockStore = {
23794
+ const mockStore$1 = {
23791
23795
  reputationConfig: null,
23792
23796
  partnerLocations: null
23793
23797
  };
@@ -23804,7 +23808,7 @@ const reputationHandlers = [
23804
23808
  // Partner Locations
23805
23809
  http.get(`${HOSTNAME}/api/partner-locations`, () => {
23806
23810
  const platformData = getSandboxDataForPlatform(currentSandboxPlatformId);
23807
- const locations = mockStore.partnerLocations || platformData.reputationData?.partnerLocations || [];
23811
+ const locations = mockStore$1.partnerLocations || platformData.reputationData?.partnerLocations || [];
23808
23812
  return HttpResponse.json({
23809
23813
  success: true,
23810
23814
  message: "Success (Sandbox)",
@@ -23820,12 +23824,12 @@ const reputationHandlers = [
23820
23824
  const locationId = params.id;
23821
23825
  const body = await request.json();
23822
23826
  const platformData = getSandboxDataForPlatform(currentSandboxPlatformId);
23823
- if (!mockStore.partnerLocations) {
23824
- mockStore.partnerLocations = [
23827
+ if (!mockStore$1.partnerLocations) {
23828
+ mockStore$1.partnerLocations = [
23825
23829
  ...platformData.reputationData?.partnerLocations || []
23826
23830
  ];
23827
23831
  }
23828
- const locationIndex = mockStore.partnerLocations.findIndex(
23832
+ const locationIndex = mockStore$1.partnerLocations.findIndex(
23829
23833
  (loc) => loc.externalId === locationId
23830
23834
  );
23831
23835
  if (locationIndex === -1) {
@@ -23837,15 +23841,15 @@ const reputationHandlers = [
23837
23841
  { status: 404 }
23838
23842
  );
23839
23843
  }
23840
- mockStore.partnerLocations[locationIndex] = {
23841
- ...mockStore.partnerLocations[locationIndex],
23844
+ mockStore$1.partnerLocations[locationIndex] = {
23845
+ ...mockStore$1.partnerLocations[locationIndex],
23842
23846
  googleBusinessProfilePlaceId: body.googleBusinessProfilePlaceId || null,
23843
23847
  updatedAt: /* @__PURE__ */ new Date()
23844
23848
  };
23845
23849
  return HttpResponse.json({
23846
23850
  success: true,
23847
23851
  message: "Partner location updated successfully (Sandbox)",
23848
- data: mockStore.partnerLocations[locationIndex]
23852
+ data: mockStore$1.partnerLocations[locationIndex]
23849
23853
  });
23850
23854
  }
23851
23855
  ),
@@ -23873,8 +23877,8 @@ const reputationHandlers = [
23873
23877
  }),
23874
23878
  // Reputation Config
23875
23879
  http.get(`${HOSTNAME}/api/reputation/config`, () => {
23876
- if (mockStore.reputationConfig) {
23877
- const currentLocations = mockStore.partnerLocations || getSandboxDataForPlatform(currentSandboxPlatformId).reputationData?.partnerLocations || [];
23880
+ if (mockStore$1.reputationConfig) {
23881
+ const currentLocations = mockStore$1.partnerLocations || getSandboxDataForPlatform(currentSandboxPlatformId).reputationData?.partnerLocations || [];
23878
23882
  const locationMappings = {};
23879
23883
  currentLocations.forEach((location2) => {
23880
23884
  locationMappings[location2.externalId] = location2.googleBusinessProfilePlaceId || null;
@@ -23883,7 +23887,7 @@ const reputationHandlers = [
23883
23887
  success: true,
23884
23888
  message: "Success (Sandbox)",
23885
23889
  data: {
23886
- ...mockStore.reputationConfig,
23890
+ ...mockStore$1.reputationConfig,
23887
23891
  locationMappings
23888
23892
  // Always return current mappings from partner locations
23889
23893
  }
@@ -23892,7 +23896,7 @@ const reputationHandlers = [
23892
23896
  }
23893
23897
  const platformData = getSandboxDataForPlatform(currentSandboxPlatformId);
23894
23898
  const initialConfig = platformData.reputationData?.reputationConfig || null;
23895
- mockStore.reputationConfig = initialConfig;
23899
+ mockStore$1.reputationConfig = initialConfig;
23896
23900
  const response = {
23897
23901
  success: true,
23898
23902
  message: "Success (Sandbox)",
@@ -23902,7 +23906,7 @@ const reputationHandlers = [
23902
23906
  }),
23903
23907
  http.post(`${HOSTNAME}/api/reputation/config`, async ({ request }) => {
23904
23908
  const body = await request.json();
23905
- const currentConfig = mockStore.reputationConfig || getSandboxDataForPlatform(currentSandboxPlatformId).reputationData?.reputationConfig;
23909
+ const currentConfig = mockStore$1.reputationConfig || getSandboxDataForPlatform(currentSandboxPlatformId).reputationData?.reputationConfig;
23906
23910
  if (currentConfig) {
23907
23911
  const updatedConfig = {
23908
23912
  ...currentConfig,
@@ -23913,9 +23917,9 @@ const reputationHandlers = [
23913
23917
  completedOnboardingAt: body.completedOnboardingAt || currentConfig.completedOnboardingAt,
23914
23918
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
23915
23919
  };
23916
- mockStore.reputationConfig = updatedConfig;
23920
+ mockStore$1.reputationConfig = updatedConfig;
23917
23921
  }
23918
- const currentLocations = mockStore.partnerLocations || getSandboxDataForPlatform(currentSandboxPlatformId).reputationData?.partnerLocations || [];
23922
+ const currentLocations = mockStore$1.partnerLocations || getSandboxDataForPlatform(currentSandboxPlatformId).reputationData?.partnerLocations || [];
23919
23923
  const locationMappings = {};
23920
23924
  currentLocations.forEach((location2) => {
23921
23925
  locationMappings[location2.externalId] = location2.googleBusinessProfilePlaceId || null;
@@ -23924,7 +23928,7 @@ const reputationHandlers = [
23924
23928
  success: true,
23925
23929
  message: "Configuration updated successfully (Sandbox)",
23926
23930
  data: {
23927
- ...mockStore.reputationConfig,
23931
+ ...mockStore$1.reputationConfig,
23928
23932
  locationMappings
23929
23933
  // Include current mappings from partner locations
23930
23934
  }
@@ -24081,6 +24085,7 @@ const reputationHandlers = [
24081
24085
  const locationIds = url.searchParams.get("location_ids");
24082
24086
  const platformData = getSandboxDataForPlatform(currentSandboxPlatformId);
24083
24087
  const queryParams = {
24088
+ platform: "google_business_profile",
24084
24089
  start_date: startDate || void 0,
24085
24090
  end_date: endDate || void 0,
24086
24091
  location_ids: locationIds ? locationIds.split(",").filter(Boolean) : void 0
@@ -24297,7 +24302,7 @@ const reputationHandlers = [
24297
24302
  `${HOSTNAME}/api/reputation/finalize-onboarding`,
24298
24303
  async ({ request }) => {
24299
24304
  const body = await request.json();
24300
- const currentConfig = mockStore.reputationConfig || getSandboxDataForPlatform(currentSandboxPlatformId).reputationData?.reputationConfig;
24305
+ const currentConfig = mockStore$1.reputationConfig || getSandboxDataForPlatform(currentSandboxPlatformId).reputationData?.reputationConfig;
24301
24306
  const updatedConfig = {
24302
24307
  ...currentConfig || {},
24303
24308
  id: currentConfig?.id || "mock-reputation-config-id",
@@ -24308,8 +24313,8 @@ const reputationHandlers = [
24308
24313
  createdAt: currentConfig?.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
24309
24314
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
24310
24315
  };
24311
- mockStore.reputationConfig = updatedConfig;
24312
- const currentLocations = mockStore.partnerLocations || getSandboxDataForPlatform(currentSandboxPlatformId).reputationData?.partnerLocations || [];
24316
+ mockStore$1.reputationConfig = updatedConfig;
24317
+ const currentLocations = mockStore$1.partnerLocations || getSandboxDataForPlatform(currentSandboxPlatformId).reputationData?.partnerLocations || [];
24313
24318
  const locationMappings = {};
24314
24319
  currentLocations.forEach((location2) => {
24315
24320
  locationMappings[location2.externalId] = location2.googleBusinessProfilePlaceId || null;
@@ -24318,7 +24323,7 @@ const reputationHandlers = [
24318
24323
  success: true,
24319
24324
  message: "Configuration updated successfully (Sandbox)",
24320
24325
  data: {
24321
- ...mockStore.reputationConfig,
24326
+ ...mockStore$1.reputationConfig,
24322
24327
  locationMappings
24323
24328
  // Include current mappings from partner locations
24324
24329
  }
@@ -24327,10 +24332,706 @@ const reputationHandlers = [
24327
24332
  }
24328
24333
  )
24329
24334
  ];
24335
+ const generatePlainPhoneNumber = () => {
24336
+ const areaCode = f.number.int({ min: 200, max: 999 });
24337
+ const centralOffice = f.number.int({ min: 200, max: 999 });
24338
+ const lineNumber = f.number.int({ min: 0, max: 9999 }).toString().padStart(4, "0");
24339
+ return `${areaCode}${centralOffice}${lineNumber}`;
24340
+ };
24341
+ const createVoiceAgentFactory = (businessId) => {
24342
+ return {
24343
+ id: f.string.uuid(),
24344
+ businessId,
24345
+ name: "Voice AI Agent",
24346
+ createdAt: f.date.past().toISOString(),
24347
+ updatedAt: f.date.recent().toISOString()
24348
+ };
24349
+ };
24350
+ const createKnowledgeFactory = (businessId) => {
24351
+ const titles = [
24352
+ "Business Hours",
24353
+ "Services Offered",
24354
+ "Contact Information",
24355
+ "Pricing Information",
24356
+ "Delivery Options",
24357
+ "Return Policy",
24358
+ "Location Details",
24359
+ "Special Offers"
24360
+ ];
24361
+ const contents = [
24362
+ "We are open Monday through Friday from 9am to 6pm.",
24363
+ "We offer professional services including consulting and support.",
24364
+ "You can reach us via phone or email for assistance.",
24365
+ "Our pricing is competitive and flexible based on your needs.",
24366
+ "We offer multiple delivery and shipping options to choose from.",
24367
+ "We have a 30-day return policy on all products.",
24368
+ "Our main location is in downtown and we have multiple branches.",
24369
+ "Check our website regularly for special offers and promotions."
24370
+ ];
24371
+ const titleIndex = f.number.int({ min: 0, max: titles.length - 1 });
24372
+ return {
24373
+ id: f.string.uuid(),
24374
+ business_id: businessId,
24375
+ title: titles[titleIndex],
24376
+ content: contents[titleIndex],
24377
+ created_at: f.date.past().toISOString(),
24378
+ updated_at: f.date.recent().toISOString(),
24379
+ website_scan_id: null
24380
+ };
24381
+ };
24382
+ const createWebsiteScanFactory = (businessId, url, status = "in-progress") => {
24383
+ const created = f.date.past().toISOString();
24384
+ const updated = f.date.recent().toISOString();
24385
+ const base = {
24386
+ id: f.string.uuid(),
24387
+ businessId,
24388
+ url,
24389
+ status,
24390
+ createdAt: created,
24391
+ updatedAt: updated
24392
+ };
24393
+ if (status === "failed") {
24394
+ return {
24395
+ ...base,
24396
+ errorMessage: "Unable to scan website. Please check the URL and try again."
24397
+ };
24398
+ }
24399
+ return base;
24400
+ };
24401
+ const generateScannedKnowledgeItems = (businessId, scanId, count = 8) => {
24402
+ const titles = [
24403
+ "Business Description",
24404
+ "Operating Hours",
24405
+ "Services & Products",
24406
+ "Contact Details",
24407
+ "Location Address",
24408
+ "Special Instructions",
24409
+ "Pricing Structure",
24410
+ "Frequently Asked Questions"
24411
+ ];
24412
+ const contents = [
24413
+ `We are a reputable business specializing in quality services and customer satisfaction. ${f.company.catchPhrase()}`,
24414
+ `Our business operates from ${f.number.int({ min: 8, max: 9 })}am to ${f.number.int({ min: 5, max: 8 })}pm, ${f.helpers.arrayElement(["Monday-Friday", "Monday-Saturday"])}.`,
24415
+ `We offer ${f.number.int({ min: 5, max: 15 })} main services: ${Array.from({ length: f.number.int({ min: 3, max: 5 }) }, () => f.commerce.productName()).join(", ")}.`,
24416
+ `Contact us at ${generatePlainPhoneNumber()} or ${f.internet.email()} for more information.`,
24417
+ `Located at ${f.location.streetAddress()}, ${f.location.city()}, ${f.location.state()}.`,
24418
+ `Appointments must be scheduled at least 24 hours in advance. Please bring a valid ID for verification when arriving on site.`,
24419
+ `Starting at $${f.number.int({ min: 20, max: 999 })}. Payment accepted via credit card, debit card, or cash on delivery.`,
24420
+ `Q: What is your refund policy? A: We offer full refunds within 30 days of purchase with original receipt. Q: Do you offer rush delivery? A: Yes, expedited shipping is available for an additional $25 fee.`
24421
+ ];
24422
+ const itemsToGenerate = Math.min(count, titles.length);
24423
+ return Array.from({ length: itemsToGenerate }, (_2, index) => ({
24424
+ id: f.string.uuid(),
24425
+ business_id: businessId,
24426
+ website_scan_id: scanId,
24427
+ title: titles[index],
24428
+ content: contents[index],
24429
+ created_at: f.date.past().toISOString(),
24430
+ updated_at: f.date.recent().toISOString()
24431
+ }));
24432
+ };
24433
+ const createPhoneNumberFactory = (agentId, number) => {
24434
+ const generatedNumber = generatePlainPhoneNumber();
24435
+ return {
24436
+ id: f.string.uuid(),
24437
+ agentId,
24438
+ number: generatedNumber,
24439
+ forwardingEnabled: false,
24440
+ createdAt: f.date.past().toISOString(),
24441
+ updatedAt: f.date.recent().toISOString()
24442
+ };
24443
+ };
24444
+ const createCallFactory = (agentId) => {
24445
+ const createdAt = f.date.recent();
24446
+ const answeredAt = f.date.between({ from: createdAt, to: /* @__PURE__ */ new Date() });
24447
+ const duration = f.number.int({ min: 30, max: 1800 });
24448
+ const endedAt = new Date(answeredAt.getTime() + duration * 1e3);
24449
+ const summaries = [
24450
+ "Customer inquired about business hours and services offered. Provided information about our operating schedule and explained our consultation process.",
24451
+ "Client called to schedule an appointment for next week. Confirmed availability and provided pricing information for the requested service.",
24452
+ "Customer had questions about our delivery options and return policy. Explained shipping costs and our satisfaction guarantee.",
24453
+ "Business inquiry about partnership opportunities. Shared information about our collaboration process and requested more details about their needs.",
24454
+ "Customer needed assistance with an existing order. Located their order details and provided status update with estimated delivery time.",
24455
+ "Prospective client called for pricing information. Provided detailed quote and explained our service packages and payment options.",
24456
+ "Customer reported a positive experience with our previous service and wanted to schedule a follow-up appointment.",
24457
+ "Inquiry about location and parking availability. Provided address details and information about nearby parking options."
24458
+ ];
24459
+ return {
24460
+ id: f.string.uuid(),
24461
+ agentId,
24462
+ fromNumber: generatePlainPhoneNumber(),
24463
+ duration,
24464
+ location: `${f.location.city()}, ${f.location.state({ abbreviated: true })}`,
24465
+ recordingUrl: f.datatype.boolean({ probability: 0.8 }) ? `https://example.com/recording/${f.string.uuid()}.mp3` : void 0,
24466
+ aiSummary: f.helpers.arrayElement(summaries),
24467
+ status: "completed",
24468
+ createdAt: createdAt.toISOString(),
24469
+ answeredAt: answeredAt.toISOString(),
24470
+ endedAt: endedAt.toISOString()
24471
+ };
24472
+ };
24473
+ const knowledgeStore = /* @__PURE__ */ new Map();
24474
+ const mockStore = {
24475
+ agents: [],
24476
+ knowledgeItems: [],
24477
+ scans: [],
24478
+ scannedKnowledge: {},
24479
+ phoneNumbers: [],
24480
+ testCalls: [],
24481
+ forwardingTests: [],
24482
+ calls: []
24483
+ };
24484
+ const getOrCreateAgent = (businessId) => {
24485
+ let agent = mockStore.agents.find((a2) => a2.businessId === businessId);
24486
+ if (!agent) {
24487
+ agent = createVoiceAgentFactory(businessId);
24488
+ mockStore.agents.push(agent);
24489
+ const phoneNumber = createPhoneNumberFactory(agent.id);
24490
+ mockStore.phoneNumbers.push(phoneNumber);
24491
+ const initialKnowledge = [
24492
+ createKnowledgeFactory(agent.businessId),
24493
+ createKnowledgeFactory(agent.businessId)
24494
+ ];
24495
+ mockStore.knowledgeItems.push(...initialKnowledge);
24496
+ initialKnowledge.forEach((item) => {
24497
+ knowledgeStore.set(item.id, item);
24498
+ });
24499
+ const initialCalls = [
24500
+ createCallFactory(agent.id),
24501
+ createCallFactory(agent.id),
24502
+ createCallFactory(agent.id),
24503
+ createCallFactory(agent.id),
24504
+ createCallFactory(agent.id)
24505
+ ];
24506
+ mockStore.calls.push(...initialCalls);
24507
+ }
24508
+ return agent;
24509
+ };
24510
+ const voiceHandlers = [
24511
+ // Get voice agents
24512
+ http.get(`${HOSTNAME}/api/voice/agents`, async () => {
24513
+ const agent = getOrCreateAgent("mock-business-id");
24514
+ return HttpResponse.json({
24515
+ success: true,
24516
+ message: "Success (Sandbox)",
24517
+ data: [agent]
24518
+ });
24519
+ }),
24520
+ // Get knowledge items from webscan-knowledge (business-scoped)
24521
+ http.get(`${HOSTNAME}/api/webscan-knowledge`, async () => {
24522
+ return HttpResponse.json({
24523
+ success: true,
24524
+ message: "Success (Sandbox)",
24525
+ data: {
24526
+ items: mockStore.knowledgeItems,
24527
+ total: mockStore.knowledgeItems.length
24528
+ }
24529
+ });
24530
+ }),
24531
+ // Create knowledge item (business-scoped)
24532
+ http.post(`${HOSTNAME}/api/webscan-knowledge`, async ({ request }) => {
24533
+ const body = await request.json();
24534
+ const websiteScanId = body.website_scan_id ?? null;
24535
+ const existingKnowledge = mockStore.knowledgeItems.find(
24536
+ (item) => item.title === body.title && item.content === body.content && item.website_scan_id === websiteScanId
24537
+ );
24538
+ if (existingKnowledge) {
24539
+ knowledgeStore.set(existingKnowledge.id, existingKnowledge);
24540
+ return HttpResponse.json({
24541
+ success: true,
24542
+ message: "Duplicate knowledge skipped (Sandbox)",
24543
+ data: existingKnowledge
24544
+ });
24545
+ }
24546
+ const knowledge = {
24547
+ id: crypto.randomUUID(),
24548
+ website_scan_id: websiteScanId,
24549
+ business_id: "mock-business-id",
24550
+ title: body.title,
24551
+ content: body.content,
24552
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
24553
+ updated_at: (/* @__PURE__ */ new Date()).toISOString()
24554
+ };
24555
+ mockStore.knowledgeItems.push(knowledge);
24556
+ knowledgeStore.set(knowledge.id, knowledge);
24557
+ if (websiteScanId && mockStore.scannedKnowledge[websiteScanId]) {
24558
+ const existingItems = mockStore.scannedKnowledge[websiteScanId];
24559
+ const existingIds = new Set(existingItems.map((item) => item.id));
24560
+ const contentKey = `${knowledge.title}|${knowledge.content}`;
24561
+ const existingContent = new Set(
24562
+ existingItems.map((item) => `${item.title}|${item.content}`)
24563
+ );
24564
+ if (!existingIds.has(knowledge.id) && !existingContent.has(contentKey)) {
24565
+ const scannedKnowledgeItem = {
24566
+ ...knowledge,
24567
+ website_scan_id: websiteScanId
24568
+ };
24569
+ mockStore.scannedKnowledge[websiteScanId].push(scannedKnowledgeItem);
24570
+ }
24571
+ }
24572
+ return HttpResponse.json({
24573
+ success: true,
24574
+ message: "Knowledge item created (Sandbox)",
24575
+ data: knowledge
24576
+ });
24577
+ }),
24578
+ // Update knowledge item (business-scoped)
24579
+ http.put(
24580
+ `${HOSTNAME}/api/webscan-knowledge/:knowledgeId`,
24581
+ async ({ request, params }) => {
24582
+ const knowledgeId = typeof params.knowledgeId === "string" ? params.knowledgeId : Array.isArray(params.knowledgeId) ? params.knowledgeId[0] : "";
24583
+ const body = await request.json();
24584
+ const item = knowledgeStore.get(knowledgeId);
24585
+ if (!item) {
24586
+ return HttpResponse.json(
24587
+ {
24588
+ success: false,
24589
+ message: `Knowledge item with ID ${knowledgeId} not found (Sandbox)`
24590
+ },
24591
+ { status: 404 }
24592
+ );
24593
+ }
24594
+ const updatedItem = {
24595
+ ...item,
24596
+ ...body.title !== void 0 ? { title: body.title } : {},
24597
+ ...body.content !== void 0 ? { content: body.content } : {},
24598
+ updated_at: (/* @__PURE__ */ new Date()).toISOString()
24599
+ };
24600
+ knowledgeStore.set(knowledgeId, updatedItem);
24601
+ const sourceIdx = mockStore.knowledgeItems.findIndex(
24602
+ (k2) => k2.id === knowledgeId
24603
+ );
24604
+ if (sourceIdx !== -1) {
24605
+ mockStore.knowledgeItems[sourceIdx] = {
24606
+ ...mockStore.knowledgeItems[sourceIdx],
24607
+ ...updatedItem
24608
+ };
24609
+ }
24610
+ for (const scanId in mockStore.scannedKnowledge) {
24611
+ const index = mockStore.scannedKnowledge[scanId].findIndex(
24612
+ (k2) => k2.id === knowledgeId
24613
+ );
24614
+ if (index !== -1) {
24615
+ mockStore.scannedKnowledge[scanId][index] = {
24616
+ ...mockStore.scannedKnowledge[scanId][index],
24617
+ ...updatedItem
24618
+ };
24619
+ break;
24620
+ }
24621
+ }
24622
+ return HttpResponse.json({
24623
+ success: true,
24624
+ message: "Knowledge updated (Sandbox)",
24625
+ data: updatedItem
24626
+ });
24627
+ }
24628
+ ),
24629
+ // Delete knowledge item (business-scoped)
24630
+ http.delete(
24631
+ `${HOSTNAME}/api/webscan-knowledge/:knowledgeId`,
24632
+ ({ params }) => {
24633
+ const knowledgeId = typeof params.knowledgeId === "string" ? params.knowledgeId : Array.isArray(params.knowledgeId) ? params.knowledgeId[0] : "";
24634
+ const item = knowledgeStore.get(knowledgeId);
24635
+ if (!item) {
24636
+ return HttpResponse.json(
24637
+ {
24638
+ success: false,
24639
+ message: `Knowledge item with ID ${knowledgeId} not found (Sandbox)`
24640
+ },
24641
+ { status: 404 }
24642
+ );
24643
+ }
24644
+ knowledgeStore.delete(knowledgeId);
24645
+ const knowledgeIndex = mockStore.knowledgeItems.findIndex(
24646
+ (k2) => k2.id === knowledgeId
24647
+ );
24648
+ if (knowledgeIndex !== -1) {
24649
+ mockStore.knowledgeItems.splice(knowledgeIndex, 1);
24650
+ }
24651
+ for (const scanId in mockStore.scannedKnowledge) {
24652
+ const index = mockStore.scannedKnowledge[scanId].findIndex(
24653
+ (k2) => k2.id === knowledgeId
24654
+ );
24655
+ if (index !== -1) {
24656
+ mockStore.scannedKnowledge[scanId].splice(index, 1);
24657
+ break;
24658
+ }
24659
+ }
24660
+ return HttpResponse.json({
24661
+ success: true,
24662
+ message: "Knowledge deleted (Sandbox)",
24663
+ data: null
24664
+ });
24665
+ }
24666
+ ),
24667
+ // Start website scan
24668
+ http.post(`${HOSTNAME}/api/webscans/`, async ({ request }) => {
24669
+ const body = await request.json();
24670
+ const agent = getOrCreateAgent("mock-business-id");
24671
+ const scan = createWebsiteScanFactory(
24672
+ agent.businessId,
24673
+ body.url,
24674
+ "in-progress"
24675
+ );
24676
+ mockStore.scans.push(scan);
24677
+ const scannedItems = generateScannedKnowledgeItems(
24678
+ agent.businessId,
24679
+ scan.id,
24680
+ 8
24681
+ );
24682
+ mockStore.scannedKnowledge[scan.id] = scannedItems;
24683
+ scannedItems.forEach((item) => {
24684
+ knowledgeStore.set(item.id, item);
24685
+ });
24686
+ setTimeout(() => {
24687
+ const scanIndex = mockStore.scans.findIndex((s2) => s2.id === scan.id);
24688
+ if (scanIndex !== -1) {
24689
+ mockStore.scans[scanIndex] = {
24690
+ ...scan,
24691
+ status: "completed",
24692
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
24693
+ };
24694
+ const knowledgeItems = scannedItems.map((item) => ({
24695
+ id: item.id,
24696
+ business_id: item.business_id,
24697
+ title: item.title,
24698
+ content: item.content,
24699
+ created_at: item.created_at,
24700
+ website_scan_id: item.website_scan_id,
24701
+ updated_at: item.updated_at
24702
+ }));
24703
+ knowledgeItems.forEach((item) => {
24704
+ knowledgeStore.set(item.id, item);
24705
+ });
24706
+ }
24707
+ }, 5e3);
24708
+ return HttpResponse.json({
24709
+ success: true,
24710
+ message: "Scan started (Sandbox)",
24711
+ data: scan
24712
+ });
24713
+ }),
24714
+ // Get scan status
24715
+ http.get(`${HOSTNAME}/api/webscans/:scanId`, ({ params }) => {
24716
+ const { scanId } = params;
24717
+ const scan = mockStore.scans.find((s2) => s2.id === scanId);
24718
+ if (!scan) {
24719
+ return HttpResponse.json(
24720
+ {
24721
+ success: false,
24722
+ message: `Scan with ID ${scanId} not found (Sandbox)`
24723
+ },
24724
+ { status: 404 }
24725
+ );
24726
+ }
24727
+ return HttpResponse.json({
24728
+ success: true,
24729
+ message: "Success (Sandbox)",
24730
+ data: scan
24731
+ });
24732
+ }),
24733
+ // Cancel scan
24734
+ http.post(
24735
+ `${HOSTNAME}/api/webscans/:scanId/cancel`,
24736
+ async ({ request, params }) => {
24737
+ const { scanId } = params;
24738
+ const body = await request.json();
24739
+ const scanIndex = mockStore.scans.findIndex((s2) => s2.id === scanId);
24740
+ if (scanIndex === -1) {
24741
+ return HttpResponse.json(
24742
+ {
24743
+ success: false,
24744
+ message: `Scan with ID ${scanId} not found (Sandbox)`
24745
+ },
24746
+ { status: 404 }
24747
+ );
24748
+ }
24749
+ const updatedScan = {
24750
+ ...mockStore.scans[scanIndex],
24751
+ ...body
24752
+ };
24753
+ mockStore.scans[scanIndex] = updatedScan;
24754
+ return HttpResponse.json({
24755
+ success: true,
24756
+ message: "Scan updated (Sandbox)",
24757
+ data: updatedScan
24758
+ });
24759
+ }
24760
+ ),
24761
+ // Get scanned knowledge items
24762
+ http.get(`${HOSTNAME}/api/webscans/:scanId/knowledge`, ({ params }) => {
24763
+ const { scanId } = params;
24764
+ const scannedKnowledgeItems = mockStore.scannedKnowledge[scanId] || [];
24765
+ return HttpResponse.json({
24766
+ success: true,
24767
+ message: "Success (Sandbox)",
24768
+ data: scannedKnowledgeItems
24769
+ });
24770
+ }),
24771
+ // Get test call token
24772
+ http.get(`${HOSTNAME}/api/voice/agents/:agentId/test-call-token`, () => {
24773
+ const token = `test_${Date.now()}_${Math.random().toString(36).substring(7)}`;
24774
+ const expiresAt = new Date(Date.now() + 15 * 60 * 1e3).toISOString();
24775
+ return HttpResponse.json({
24776
+ success: true,
24777
+ message: "Success (Sandbox)",
24778
+ data: {
24779
+ token,
24780
+ expiresAt
24781
+ }
24782
+ });
24783
+ }),
24784
+ // Initiate test call
24785
+ http.post(
24786
+ `${HOSTNAME}/api/voice/agents/:agentId/test-calls`,
24787
+ async ({ params, request }) => {
24788
+ const agentId = params.agentId;
24789
+ const body = await request.json();
24790
+ const testCall = {
24791
+ id: `test-call-${Date.now()}`,
24792
+ agentId,
24793
+ token: body.token,
24794
+ status: "connecting",
24795
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
24796
+ };
24797
+ mockStore.testCalls.push(testCall);
24798
+ setTimeout(() => {
24799
+ const callIndex = mockStore.testCalls.findIndex(
24800
+ (c2) => c2.id === testCall.id
24801
+ );
24802
+ if (callIndex !== -1) {
24803
+ mockStore.testCalls[callIndex].status = "connected";
24804
+ }
24805
+ }, 2e3);
24806
+ return HttpResponse.json({
24807
+ success: true,
24808
+ message: "Test call initiated (Sandbox)",
24809
+ data: testCall
24810
+ });
24811
+ }
24812
+ ),
24813
+ // End test call
24814
+ http.post(
24815
+ `${HOSTNAME}/api/voice/agents/:agentId/test-calls/:callId/end`,
24816
+ ({ params }) => {
24817
+ const { callId } = params;
24818
+ const callIndex = mockStore.testCalls.findIndex((c2) => c2.id === callId);
24819
+ if (callIndex === -1) {
24820
+ return HttpResponse.json(
24821
+ {
24822
+ success: false,
24823
+ message: `Test call with ID ${callId} not found (Sandbox)`
24824
+ },
24825
+ { status: 404 }
24826
+ );
24827
+ }
24828
+ const call = mockStore.testCalls[callIndex];
24829
+ call.status = "ended";
24830
+ call.endedAt = (/* @__PURE__ */ new Date()).toISOString();
24831
+ call.duration = Math.floor(
24832
+ (Date.now() - new Date(call.createdAt).getTime()) / 1e3
24833
+ );
24834
+ return HttpResponse.json({
24835
+ success: true,
24836
+ message: "Test call ended (Sandbox)",
24837
+ data: call
24838
+ });
24839
+ }
24840
+ ),
24841
+ // Get test call status
24842
+ http.get(
24843
+ `${HOSTNAME}/api/voice/agents/:agentId/test-calls/:callId`,
24844
+ ({ params }) => {
24845
+ const { callId } = params;
24846
+ const call = mockStore.testCalls.find((c2) => c2.id === callId);
24847
+ if (!call) {
24848
+ return HttpResponse.json(
24849
+ {
24850
+ success: false,
24851
+ message: `Test call with ID ${callId} not found (Sandbox)`
24852
+ },
24853
+ { status: 404 }
24854
+ );
24855
+ }
24856
+ return HttpResponse.json({
24857
+ success: true,
24858
+ message: "Success (Sandbox)",
24859
+ data: call
24860
+ });
24861
+ }
24862
+ ),
24863
+ // Get phone numbers for an agent
24864
+ http.get(
24865
+ `${HOSTNAME}/api/voice/agents/:agentId/phone-numbers`,
24866
+ ({ params }) => {
24867
+ const { agentId } = params;
24868
+ const phoneNumbers = mockStore.phoneNumbers.filter(
24869
+ (pn) => pn.agentId === agentId
24870
+ );
24871
+ return HttpResponse.json({
24872
+ success: true,
24873
+ message: "Success (Sandbox)",
24874
+ data: phoneNumbers
24875
+ });
24876
+ }
24877
+ ),
24878
+ // Create phone number for an agent
24879
+ http.post(
24880
+ `${HOSTNAME}/api/voice/agents/:agentId/phone-numbers`,
24881
+ ({ params }) => {
24882
+ const { agentId } = params;
24883
+ const phoneNumber = createPhoneNumberFactory(agentId);
24884
+ mockStore.phoneNumbers.push(phoneNumber);
24885
+ return HttpResponse.json({
24886
+ success: true,
24887
+ message: "Phone number created (Sandbox)",
24888
+ data: phoneNumber
24889
+ });
24890
+ }
24891
+ ),
24892
+ // Update phone number
24893
+ http.put(
24894
+ `${HOSTNAME}/api/voice/agents/:agentId/phone-numbers/:phoneNumberId`,
24895
+ async ({ params, request }) => {
24896
+ const { agentId, phoneNumberId } = params;
24897
+ const body = await request.json();
24898
+ const phoneNumberIndex = mockStore.phoneNumbers.findIndex(
24899
+ (pn) => pn.id === phoneNumberId && pn.agentId === agentId
24900
+ );
24901
+ if (phoneNumberIndex === -1) {
24902
+ return HttpResponse.json(
24903
+ { success: false, message: "Phone number not found" },
24904
+ { status: 404 }
24905
+ );
24906
+ }
24907
+ const updatedPhoneNumber = {
24908
+ ...mockStore.phoneNumbers[phoneNumberIndex],
24909
+ ...body,
24910
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
24911
+ };
24912
+ mockStore.phoneNumbers[phoneNumberIndex] = updatedPhoneNumber;
24913
+ return HttpResponse.json({
24914
+ success: true,
24915
+ message: "Phone number updated (Sandbox)",
24916
+ data: updatedPhoneNumber
24917
+ });
24918
+ }
24919
+ ),
24920
+ // Start forwarding test
24921
+ http.post(
24922
+ `${HOSTNAME}/api/voice/agents/:agentId/phone-numbers/:phoneNumberId/forwarding-tests`,
24923
+ async ({ params }) => {
24924
+ const agentId = params.agentId;
24925
+ const phoneNumberId = params.phoneNumberId;
24926
+ const test = {
24927
+ id: `forwarding-test-${Date.now()}`,
24928
+ agentId,
24929
+ phoneNumberId,
24930
+ status: "in-progress",
24931
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
24932
+ };
24933
+ mockStore.forwardingTests.push(test);
24934
+ setTimeout(() => {
24935
+ const testIndex = mockStore.forwardingTests.findIndex(
24936
+ (t2) => t2.id === test.id
24937
+ );
24938
+ if (testIndex !== -1 && mockStore.forwardingTests[testIndex].status === "in-progress") {
24939
+ mockStore.forwardingTests[testIndex] = {
24940
+ ...mockStore.forwardingTests[testIndex],
24941
+ status: "success",
24942
+ message: "Call was successfully forwarded to your number",
24943
+ completedAt: (/* @__PURE__ */ new Date()).toISOString()
24944
+ };
24945
+ }
24946
+ }, 15e3);
24947
+ return HttpResponse.json({
24948
+ success: true,
24949
+ message: "Forwarding test started (Sandbox)",
24950
+ data: test
24951
+ });
24952
+ }
24953
+ ),
24954
+ // Get forwarding test status
24955
+ http.get(
24956
+ `${HOSTNAME}/api/voice/agents/:agentId/phone-numbers/:phoneNumberId/forwarding-tests/:testId`,
24957
+ ({ params }) => {
24958
+ const { testId } = params;
24959
+ const test = mockStore.forwardingTests.find((t2) => t2.id === testId);
24960
+ if (!test) {
24961
+ return HttpResponse.json(
24962
+ {
24963
+ success: false,
24964
+ message: `Forwarding test with ID ${testId} not found (Sandbox)`
24965
+ },
24966
+ { status: 404 }
24967
+ );
24968
+ }
24969
+ return HttpResponse.json({
24970
+ success: true,
24971
+ message: "Success (Sandbox)",
24972
+ data: test
24973
+ });
24974
+ }
24975
+ ),
24976
+ // Cancel forwarding test
24977
+ http.post(
24978
+ `${HOSTNAME}/api/voice/agents/:agentId/phone-numbers/:phoneNumberId/forwarding-tests/:testId/cancel`,
24979
+ ({ params }) => {
24980
+ const { testId } = params;
24981
+ const testIndex = mockStore.forwardingTests.findIndex(
24982
+ (t2) => t2.id === testId
24983
+ );
24984
+ if (testIndex === -1) {
24985
+ return HttpResponse.json(
24986
+ {
24987
+ success: false,
24988
+ message: `Forwarding test with ID ${testId} not found (Sandbox)`
24989
+ },
24990
+ { status: 404 }
24991
+ );
24992
+ }
24993
+ const test = mockStore.forwardingTests[testIndex];
24994
+ test.status = "cancelled";
24995
+ test.completedAt = (/* @__PURE__ */ new Date()).toISOString();
24996
+ return HttpResponse.json({
24997
+ success: true,
24998
+ message: "Forwarding test cancelled (Sandbox)",
24999
+ data: test
25000
+ });
25001
+ }
25002
+ ),
25003
+ // Get calls for an agent
25004
+ http.get(`${HOSTNAME}/api/voice/calls`, ({ request }) => {
25005
+ const url = new URL(request.url);
25006
+ const agentId = url.searchParams.get("agentId");
25007
+ if (!agentId) {
25008
+ return HttpResponse.json(
25009
+ {
25010
+ success: false,
25011
+ message: "agentId query parameter is required (Sandbox)"
25012
+ },
25013
+ { status: 400 }
25014
+ );
25015
+ }
25016
+ const agentCalls = mockStore.calls.filter((c2) => c2.agentId === agentId);
25017
+ agentCalls.sort(
25018
+ (a2, b2) => new Date(b2.createdAt).getTime() - new Date(a2.createdAt).getTime()
25019
+ );
25020
+ return HttpResponse.json({
25021
+ success: true,
25022
+ message: "Success (Sandbox)",
25023
+ data: agentCalls
25024
+ });
25025
+ })
25026
+ ];
24330
25027
  const getHandlersByFeatures = (features) => {
24331
25028
  const allHandlers = [];
24332
25029
  if (features.includes("all")) {
24333
- return [...measureAndAcquireHandlers, ...reputationHandlers];
25030
+ return [
25031
+ ...measureAndAcquireHandlers,
25032
+ ...reputationHandlers,
25033
+ ...voiceHandlers
25034
+ ];
24334
25035
  }
24335
25036
  if (features.includes("measure") || features.includes("acquire")) {
24336
25037
  allHandlers.push(...measureAndAcquireHandlers);
@@ -24338,6 +25039,9 @@ const getHandlersByFeatures = (features) => {
24338
25039
  if (features.includes("reputation")) {
24339
25040
  allHandlers.push(...reputationHandlers);
24340
25041
  }
25042
+ if (features.includes("voice")) {
25043
+ allHandlers.push(...voiceHandlers);
25044
+ }
24341
25045
  return allHandlers;
24342
25046
  };
24343
25047
  getHandlersByFeatures(["all"]);