Payment Gateway added
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1,3 +1,7 @@
|
|||||||
|
*.log
|
||||||
|
.env.*
|
||||||
|
backend/razorpay.env
|
||||||
|
backend/src/main/resources/application-local.properties
|
||||||
|
counter-frontend/.env
|
||||||
ordering-site/*
|
ordering-site/*
|
||||||
ordering_site/
|
ordering_site/
|
||||||
counter-frontend/
|
|
||||||
6
backend/.gitignore
vendored
6
backend/.gitignore
vendored
@@ -31,3 +31,9 @@ build/
|
|||||||
|
|
||||||
### VS Code ###
|
### VS Code ###
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
||||||
|
### Razorpay secrets (NEVER commit live keys) ###
|
||||||
|
razorpay.env
|
||||||
|
|
||||||
|
### Logs ###
|
||||||
|
*.log
|
||||||
|
|||||||
@@ -87,6 +87,12 @@
|
|||||||
<artifactId>bucket4j-core</artifactId>
|
<artifactId>bucket4j-core</artifactId>
|
||||||
<version>8.10.1</version>
|
<version>8.10.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- Razorpay Payments -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.razorpay</groupId>
|
||||||
|
<artifactId>razorpay-java</artifactId>
|
||||||
|
<version>1.4.8</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
8
backend/razorpay.env.example
Normal file
8
backend/razorpay.env.example
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Copy to razorpay.env (gitignored) and fill in your Razorpay live keys.
|
||||||
|
# Source before starting the backend:
|
||||||
|
# set -a && source razorpay.env && set +a && ./mvnw spring-boot:run
|
||||||
|
|
||||||
|
export RAZORPAY_KEY_ID=rzp_live_xxxxxxxx
|
||||||
|
export RAZORPAY_KEY_SECRET=your_secret_here
|
||||||
|
# Optional — set after creating a webhook in Razorpay Dashboard
|
||||||
|
# export RAZORPAY_WEBHOOK_SECRET=whsec_xxxxxxxx
|
||||||
22
backend/run-with-razorpay.sh
Executable file
22
backend/run-with-razorpay.sh
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Start the backend with Razorpay credentials loaded from razorpay.env
|
||||||
|
set -euo pipefail
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
if [[ ! -f razorpay.env ]]; then
|
||||||
|
echo "Missing razorpay.env — copy razorpay.env.example and fill in your keys."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
set -a
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
source ./razorpay.env
|
||||||
|
set +a
|
||||||
|
|
||||||
|
if [[ -z "${RAZORPAY_KEY_ID:-}" || -z "${RAZORPAY_KEY_SECRET:-}" ]]; then
|
||||||
|
echo "RAZORPAY_KEY_ID / RAZORPAY_KEY_SECRET must be set in razorpay.env"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Starting backend with Razorpay key: ${RAZORPAY_KEY_ID:0:12}..."
|
||||||
|
exec ./mvnw spring-boot:run
|
||||||
@@ -62,6 +62,10 @@ public class SecurityConfig {
|
|||||||
// ── PUBLIC: Device log ingestion (ESP32 Bill-Bot devices, no JWT) ──
|
// ── PUBLIC: Device log ingestion (ESP32 Bill-Bot devices, no JWT) ──
|
||||||
.requestMatchers(HttpMethod.POST, "/api/device-logs").permitAll()
|
.requestMatchers(HttpMethod.POST, "/api/device-logs").permitAll()
|
||||||
|
|
||||||
|
// ── PUBLIC: Razorpay webhook (authenticated via X-Razorpay-Signature) ──
|
||||||
|
.requestMatchers(HttpMethod.POST, "/api/payments/webhook").permitAll()
|
||||||
|
.requestMatchers(HttpMethod.GET, "/api/payments/config").permitAll()
|
||||||
|
|
||||||
// ── PUBLIC: Notifications read (admin frontend polls this before login guard kicks in) ──
|
// ── PUBLIC: Notifications read (admin frontend polls this before login guard kicks in) ──
|
||||||
.requestMatchers(HttpMethod.GET, "/api/notifications/**").permitAll()
|
.requestMatchers(HttpMethod.GET, "/api/notifications/**").permitAll()
|
||||||
|
|
||||||
@@ -76,6 +80,9 @@ public class SecurityConfig {
|
|||||||
.requestMatchers(HttpMethod.GET, "/api/wallet/balance/**").authenticated()
|
.requestMatchers(HttpMethod.GET, "/api/wallet/balance/**").authenticated()
|
||||||
.requestMatchers(HttpMethod.GET, "/api/wallet/transactions/**").authenticated()
|
.requestMatchers(HttpMethod.GET, "/api/wallet/transactions/**").authenticated()
|
||||||
.requestMatchers(HttpMethod.POST, "/api/wallet/topup").authenticated()
|
.requestMatchers(HttpMethod.POST, "/api/wallet/topup").authenticated()
|
||||||
|
.requestMatchers(HttpMethod.POST, "/api/payments/create").authenticated()
|
||||||
|
.requestMatchers(HttpMethod.POST, "/api/payments/verify").authenticated()
|
||||||
|
.requestMatchers(HttpMethod.GET, "/api/payments/history").authenticated()
|
||||||
.requestMatchers(HttpMethod.POST, "/api/coupons/redeem").authenticated()
|
.requestMatchers(HttpMethod.POST, "/api/coupons/redeem").authenticated()
|
||||||
.requestMatchers(HttpMethod.POST, "/api/feedback/**").authenticated()
|
.requestMatchers(HttpMethod.POST, "/api/feedback/**").authenticated()
|
||||||
.requestMatchers(HttpMethod.GET, "/api/feedback/**").authenticated()
|
.requestMatchers(HttpMethod.GET, "/api/feedback/**").authenticated()
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ public class OrderController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private TokenService tokenService;
|
private TokenService tokenService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private com.rit.canteen.sales.service.OrderPlacementService orderPlacementService;
|
||||||
|
|
||||||
private static final ThreadLocal<List<Map<String, Object>>> requestConflicts = new ThreadLocal<>();
|
private static final ThreadLocal<List<Map<String, Object>>> requestConflicts = new ThreadLocal<>();
|
||||||
|
|
||||||
// ── STAFF/MASTER: all orders ──────────────────────────────────────────
|
// ── STAFF/MASTER: all orders ──────────────────────────────────────────
|
||||||
@@ -138,105 +141,42 @@ public class OrderController {
|
|||||||
order.setOrderType("POS");
|
order.setOrderType("POS");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (order.getItems() == null || order.getItems().isEmpty()) {
|
// Customers cannot mark an order as paid via RAZORPAY without going through PaymentController
|
||||||
return ResponseEntity.badRequest().body(Map.of("success", false, "message", "Order must have items"));
|
if (!isStaff() && order.getPaymentMethod() != null
|
||||||
}
|
&& !"RITZ_TOKEN".equalsIgnoreCase(order.getPaymentMethod())) {
|
||||||
|
|
||||||
// ── SECURITY: Server-side price verification ──────────────────────
|
|
||||||
BigDecimal serverTotal = BigDecimal.ZERO;
|
|
||||||
for (OrderItem item : order.getItems()) {
|
|
||||||
if (item.getProductId() != null) {
|
|
||||||
Optional<Product> productOpt = productRepository.findById(item.getProductId());
|
|
||||||
if (productOpt.isEmpty()) {
|
|
||||||
return ResponseEntity.badRequest().body(Map.of(
|
|
||||||
"success", false, "message", "Product not found: " + item.getProductId()));
|
|
||||||
}
|
|
||||||
Product product = productOpt.get();
|
|
||||||
// Use offer price if present, otherwise base price
|
|
||||||
BigDecimal unitPrice = (product.getOfferPrice() != null && product.getOfferPrice().compareTo(BigDecimal.ZERO) > 0)
|
|
||||||
? product.getOfferPrice() : product.getPrice();
|
|
||||||
|
|
||||||
// Add parcel fee if selected and parcellable
|
|
||||||
if (item.getProductName() != null && item.getProductName().endsWith(" (Parcel)") && product.isParcellable()) {
|
|
||||||
unitPrice = unitPrice.add(BigDecimal.valueOf(5));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update item's saved price so it reflects the unitPrice + parcel fee
|
|
||||||
item.setPrice(unitPrice);
|
|
||||||
|
|
||||||
serverTotal = serverTotal.add(unitPrice.multiply(BigDecimal.valueOf(item.getQuantity())));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Allow ±5 tolerance for rounding differences
|
|
||||||
if (serverTotal.subtract(order.getTotalAmount()).abs().compareTo(new BigDecimal("5")) > 0) {
|
|
||||||
return ResponseEntity.badRequest().body(Map.of(
|
return ResponseEntity.badRequest().body(Map.of(
|
||||||
"success", false,
|
"success", false,
|
||||||
"message", "Price mismatch detected. Please refresh and try again.",
|
"message", "Online payments must be completed via Razorpay checkout first."
|
||||||
"serverTotal", serverTotal,
|
|
||||||
"clientTotal", order.getTotalAmount()
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
// Always use server-calculated total
|
|
||||||
order.setTotalAmount(serverTotal);
|
|
||||||
|
|
||||||
// ── Stock check & update ──────────────────────────────────────────
|
if (order.getPaymentMethod() == null || order.getPaymentMethod().isBlank()) {
|
||||||
List<Map<String, Object>> stockConflicts = new ArrayList<>();
|
order.setPaymentMethod(isStaff() ? "CASH" : "RITZ_TOKEN");
|
||||||
requestConflicts.remove();
|
|
||||||
|
|
||||||
for (OrderItem item : order.getItems()) {
|
|
||||||
Long productId = item.getProductId();
|
|
||||||
if (productId != null) {
|
|
||||||
int updatedRows = productRepository.decrementStock(productId, item.getQuantity());
|
|
||||||
if (updatedRows == 0) {
|
|
||||||
Product p = productRepository.findById(productId).orElse(null);
|
|
||||||
int left = (p != null && p.getStock() != null) ? p.getStock() : 0;
|
|
||||||
Map<String, Object> conflict = new HashMap<>();
|
|
||||||
conflict.put("productId", productId);
|
|
||||||
conflict.put("productName", item.getProductName());
|
|
||||||
conflict.put("requested", item.getQuantity());
|
|
||||||
conflict.put("available", left);
|
|
||||||
stockConflicts.add(conflict);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stockConflicts.isEmpty()) {
|
|
||||||
requestConflicts.set(stockConflicts);
|
|
||||||
throw new RuntimeException("CONCURRENCY_STOCK_FAILURE");
|
|
||||||
}
|
|
||||||
|
|
||||||
// ── Complete Order Details ────────────────────────────────────────
|
|
||||||
for (OrderItem item : order.getItems()) {
|
|
||||||
item.setOrder(order);
|
|
||||||
if (item.getStallName() == null || item.getStallName().isEmpty() || item.getStallName().equals("Unknown Stall")) {
|
|
||||||
item.setStallName("RIT Canteen");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LocalDateTime now = LocalDateTime.now();
|
|
||||||
order.setCreatedAt(now);
|
|
||||||
LocalDateTime startOfDay = now.toLocalDate().atStartOfDay();
|
|
||||||
long todaysOrderCount = orderRepository.countByCreatedAtGreaterThanEqual(startOfDay);
|
|
||||||
order.setDisplayOrderId(String.format("%03d", todaysOrderCount + 1));
|
|
||||||
|
|
||||||
// ── Token payment ────────────────────────────────────────────────
|
|
||||||
if ("RITZ_TOKEN".equals(order.getPaymentMethod())) {
|
|
||||||
try {
|
try {
|
||||||
tokenService.spend(order.getUserId(), order.getTotalAmount(), "ORD-" + order.getDisplayOrderId());
|
var result = orderPlacementService.placeOrder(order, true);
|
||||||
} catch (RuntimeException e) {
|
if (!result.success) {
|
||||||
if ("INSUFFICIENT_TOKENS".equals(e.getMessage())) throw new RuntimeException("INSUFFICIENT_TOKENS");
|
Map<String, Object> body = new HashMap<>();
|
||||||
throw e;
|
body.put("success", false);
|
||||||
|
body.put("message", result.message);
|
||||||
|
if (result.errorType != null) body.put("errorType", result.errorType);
|
||||||
|
if (result.conflicts != null) body.put("conflicts", result.conflicts);
|
||||||
|
if (result.serverTotal != null) body.put("serverTotal", result.serverTotal);
|
||||||
|
return ResponseEntity.badRequest().body(body);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Order savedOrder = orderRepository.save(order);
|
|
||||||
return ResponseEntity.ok(Map.of(
|
return ResponseEntity.ok(Map.of(
|
||||||
"success", true,
|
"success", true,
|
||||||
"orderNumber", savedOrder.getOrderNumber(),
|
"orderNumber", result.orderNumber,
|
||||||
"displayOrderId", savedOrder.getDisplayOrderId(),
|
"displayOrderId", result.displayOrderId,
|
||||||
"message", "Order placed successfully"
|
"message", "Order placed successfully"
|
||||||
));
|
));
|
||||||
|
} catch (com.rit.canteen.sales.service.OrderPlacementService.StockConflictException e) {
|
||||||
|
requestConflicts.set(e.conflicts);
|
||||||
|
throw new RuntimeException("CONCURRENCY_STOCK_FAILURE");
|
||||||
|
} catch (com.rit.canteen.sales.service.OrderPlacementService.InsufficientTokensException e) {
|
||||||
|
throw new RuntimeException("INSUFFICIENT_TOKENS");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── CUSTOMER: own orders ──────────────────────────────────────────────
|
// ── CUSTOMER: own orders ──────────────────────────────────────────────
|
||||||
|
|||||||
@@ -0,0 +1,224 @@
|
|||||||
|
package com.rit.canteen.sales.controller;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.rit.canteen.sales.model.PaymentSession;
|
||||||
|
import com.rit.canteen.sales.repository.PaymentSessionRepository;
|
||||||
|
import com.rit.canteen.sales.service.PaymentService;
|
||||||
|
import com.rit.canteen.sales.service.RazorpayService;
|
||||||
|
import io.jsonwebtoken.Claims;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.core.Authentication;
|
||||||
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/payments")
|
||||||
|
public class PaymentController {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(PaymentController.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PaymentService paymentService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RazorpayService razorpayService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PaymentSessionRepository paymentSessionRepository;
|
||||||
|
|
||||||
|
private final ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a Razorpay order for either food checkout or wallet top-up.
|
||||||
|
*
|
||||||
|
* Body for wallet:
|
||||||
|
* { "purpose": "WALLET_TOPUP", "amount": 100 }
|
||||||
|
*
|
||||||
|
* Body for food order:
|
||||||
|
* { "purpose": "ORDER", "order": { userId, items, totalAmount, orderType } }
|
||||||
|
*/
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createPayment(@RequestBody Map<String, Object> body) {
|
||||||
|
try {
|
||||||
|
Long userId = requireUserId();
|
||||||
|
String purpose = body.get("purpose") != null ? body.get("purpose").toString().toUpperCase() : "";
|
||||||
|
|
||||||
|
if ("WALLET_TOPUP".equals(purpose)) {
|
||||||
|
if (body.get("amount") == null) {
|
||||||
|
return ResponseEntity.badRequest().body(Map.of("success", false, "message", "amount is required"));
|
||||||
|
}
|
||||||
|
BigDecimal amount = new BigDecimal(body.get("amount").toString());
|
||||||
|
Map<String, Object> result = paymentService.createWalletTopupSession(userId, amount);
|
||||||
|
return ResponseEntity.ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("ORDER".equals(purpose)) {
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
Map<String, Object> order = body.get("order") instanceof Map
|
||||||
|
? (Map<String, Object>) body.get("order")
|
||||||
|
: body; // allow flat body for convenience
|
||||||
|
|
||||||
|
// Force userId from JWT — never trust client for identity
|
||||||
|
order.put("userId", userId);
|
||||||
|
Map<String, Object> result = paymentService.createOrderPaymentSession(userId, order);
|
||||||
|
if (Boolean.FALSE.equals(result.get("success"))) {
|
||||||
|
return ResponseEntity.badRequest().body(result);
|
||||||
|
}
|
||||||
|
return ResponseEntity.ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseEntity.badRequest().body(Map.of(
|
||||||
|
"success", false,
|
||||||
|
"message", "purpose must be ORDER or WALLET_TOPUP"
|
||||||
|
));
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
return ResponseEntity.badRequest().body(Map.of("success", false, "message", e.getMessage()));
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
return ResponseEntity.status(503).body(Map.of("success", false, "message", e.getMessage()));
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
return ResponseEntity.status(403).body(Map.of("success", false, "message", e.getMessage()));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("Create payment failed", e);
|
||||||
|
return ResponseEntity.status(500).body(Map.of(
|
||||||
|
"success", false,
|
||||||
|
"message", e.getMessage() != null ? e.getMessage() : "Failed to create payment"
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verify Razorpay checkout response and fulfill (place order / credit wallet).
|
||||||
|
* Only after this succeeds should the client show the order QR.
|
||||||
|
*/
|
||||||
|
@PostMapping("/verify")
|
||||||
|
public ResponseEntity<?> verifyPayment(@RequestBody Map<String, Object> body) {
|
||||||
|
try {
|
||||||
|
Long userId = requireUserId();
|
||||||
|
String orderId = str(body.get("razorpayOrderId"), body.get("razorpay_order_id"));
|
||||||
|
String paymentId = str(body.get("razorpayPaymentId"), body.get("razorpay_payment_id"));
|
||||||
|
String signature = str(body.get("razorpaySignature"), body.get("razorpay_signature"));
|
||||||
|
|
||||||
|
Map<String, Object> result = paymentService.verifyAndFulfill(userId, orderId, paymentId, signature);
|
||||||
|
return ResponseEntity.ok(result);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
return ResponseEntity.badRequest().body(Map.of("success", false, "message", e.getMessage()));
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
return ResponseEntity.status(403).body(Map.of("success", false, "message", e.getMessage()));
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
return ResponseEntity.status(409).body(Map.of("success", false, "message", e.getMessage()));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("Verify payment failed", e);
|
||||||
|
return ResponseEntity.status(500).body(Map.of(
|
||||||
|
"success", false,
|
||||||
|
"message", e.getMessage() != null ? e.getMessage() : "Payment verification failed"
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Public webhook endpoint. Configure in Razorpay Dashboard:
|
||||||
|
* URL: https://<your-host>/api/payments/webhook
|
||||||
|
* Events: payment.captured
|
||||||
|
* Set RAZORPAY_WEBHOOK_SECRET to the dashboard secret.
|
||||||
|
*/
|
||||||
|
@PostMapping("/webhook")
|
||||||
|
public ResponseEntity<?> webhook(
|
||||||
|
@RequestBody String rawBody,
|
||||||
|
@RequestHeader(value = "X-Razorpay-Signature", required = false) String signature) {
|
||||||
|
try {
|
||||||
|
if (razorpayService.hasWebhookSecret()) {
|
||||||
|
if (signature == null || !razorpayService.verifyWebhookSignature(rawBody, signature)) {
|
||||||
|
log.warn("Rejected Razorpay webhook with invalid signature");
|
||||||
|
return ResponseEntity.status(400).body(Map.of("error", "Invalid signature"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.warn("Webhook received but RAZORPAY_WEBHOOK_SECRET is not set — processing cautiously");
|
||||||
|
}
|
||||||
|
|
||||||
|
JsonNode root = objectMapper.readTree(rawBody);
|
||||||
|
String event = root.path("event").asText("");
|
||||||
|
if ("payment.captured".equals(event) || "payment.authorized".equals(event)) {
|
||||||
|
JsonNode entity = root.path("payload").path("payment").path("entity");
|
||||||
|
String paymentId = entity.path("id").asText(null);
|
||||||
|
String orderId = entity.path("order_id").asText(null);
|
||||||
|
if (paymentId != null && orderId != null) {
|
||||||
|
paymentService.handlePaymentCapturedWebhook(orderId, paymentId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Always 200 so Razorpay does not retry endlessly on unknown events
|
||||||
|
return ResponseEntity.ok(Map.of("received", true));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("Webhook processing error", e);
|
||||||
|
// Return 200 to avoid noisy retries for parse errors; log for ops
|
||||||
|
return ResponseEntity.ok(Map.of("received", true, "error", e.getMessage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the payment history for the authenticated user.
|
||||||
|
*/
|
||||||
|
@GetMapping("/history")
|
||||||
|
public ResponseEntity<?> paymentHistory() {
|
||||||
|
try {
|
||||||
|
Long userId = requireUserId();
|
||||||
|
List<PaymentSession> sessions = paymentSessionRepository.findByUserIdOrderByCreatedAtDesc(userId);
|
||||||
|
List<Map<String, Object>> list = sessions.stream().map(s -> {
|
||||||
|
Map<String, Object> m = new LinkedHashMap<>();
|
||||||
|
m.put("id", s.getId());
|
||||||
|
m.put("purpose", s.getPurpose().name());
|
||||||
|
m.put("status", s.getStatus().name());
|
||||||
|
m.put("amount", s.getAmountInr());
|
||||||
|
m.put("razorpayOrderId", s.getRazorpayOrderId());
|
||||||
|
m.put("razorpayPaymentId", s.getRazorpayPaymentId());
|
||||||
|
m.put("orderNumber", s.getFulfillmentOrderNumber());
|
||||||
|
m.put("createdAt", s.getCreatedAt());
|
||||||
|
m.put("fulfilledAt", s.getFulfilledAt());
|
||||||
|
m.put("failureReason", s.getFailureReason());
|
||||||
|
return m;
|
||||||
|
}).toList();
|
||||||
|
return ResponseEntity.ok(list);
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
return ResponseEntity.status(403).body(Map.of("success", false, "message", e.getMessage()));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("Payment history failed", e);
|
||||||
|
return ResponseEntity.status(500).body(Map.of("success", false, "message", "Failed to fetch payment history"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Health/config check for the ordering app (does not expose secret). */
|
||||||
|
@GetMapping("/config")
|
||||||
|
public ResponseEntity<?> config() {
|
||||||
|
Map<String, Object> resp = new LinkedHashMap<>();
|
||||||
|
resp.put("enabled", razorpayService.isConfigured());
|
||||||
|
if (razorpayService.isConfigured()) {
|
||||||
|
resp.put("keyId", razorpayService.getKeyId());
|
||||||
|
}
|
||||||
|
return ResponseEntity.ok(resp);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Long requireUserId() {
|
||||||
|
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
|
||||||
|
if (auth != null && auth.getDetails() instanceof Claims claims) {
|
||||||
|
Object uid = claims.get("userId");
|
||||||
|
if (uid != null) {
|
||||||
|
return uid instanceof Integer ? ((Integer) uid).longValue() : (Long) uid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new SecurityException("Authentication required");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String str(Object primary, Object fallback) {
|
||||||
|
if (primary != null && !primary.toString().isBlank()) return primary.toString();
|
||||||
|
if (fallback != null && !fallback.toString().isBlank()) return fallback.toString();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -70,9 +70,21 @@ public class WalletController {
|
|||||||
return ResponseEntity.ok(userList);
|
return ResponseEntity.ok(userList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manual / admin wallet credit.
|
||||||
|
* Customers MUST use Razorpay via POST /api/payments/create (purpose=WALLET_TOPUP).
|
||||||
|
* Free top-up is restricted to staff/manager/master only.
|
||||||
|
*/
|
||||||
@PostMapping("/topup")
|
@PostMapping("/topup")
|
||||||
public ResponseEntity<?> topUp(@RequestBody Map<String, Object> request) {
|
public ResponseEntity<?> topUp(@RequestBody Map<String, Object> request) {
|
||||||
try {
|
try {
|
||||||
|
if (!isStaff()) {
|
||||||
|
return ResponseEntity.status(403).body(Map.of(
|
||||||
|
"success", false,
|
||||||
|
"error", "Customer wallet top-up requires online payment. Use the Top Up screen (Razorpay)."
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
Long userId = Long.valueOf(request.get("userId").toString());
|
Long userId = Long.valueOf(request.get("userId").toString());
|
||||||
if (!canAccessUser(userId)) {
|
if (!canAccessUser(userId)) {
|
||||||
return ResponseEntity.status(403).body(Map.of("error", "Access denied"));
|
return ResponseEntity.status(403).body(Map.of("error", "Access denied"));
|
||||||
@@ -88,7 +100,7 @@ public class WalletController {
|
|||||||
Map.of("error", "Single transaction limit exceeded (Max: 5,000 Ritz Tokens)"));
|
Map.of("error", "Single transaction limit exceeded (Max: 5,000 Ritz Tokens)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
String ref = request.getOrDefault("referenceId", "TOPUP-" + System.currentTimeMillis()).toString();
|
String ref = request.getOrDefault("referenceId", "TOPUP-STAFF-" + System.currentTimeMillis()).toString();
|
||||||
User updatedUser = tokenService.topUp(userId, amount, ref);
|
User updatedUser = tokenService.topUp(userId, amount, ref);
|
||||||
return ResponseEntity.ok(Map.of(
|
return ResponseEntity.ok(Map.of(
|
||||||
"success", true,
|
"success", true,
|
||||||
@@ -100,6 +112,19 @@ public class WalletController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isStaff() {
|
||||||
|
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
|
||||||
|
if (auth == null || !auth.isAuthenticated()) return false;
|
||||||
|
if (auth.getDetails() instanceof Claims claims) {
|
||||||
|
String role = (String) claims.get("role");
|
||||||
|
return "MASTER".equals(role) || "MANAGER".equals(role) || "STAFF".equals(role);
|
||||||
|
}
|
||||||
|
return auth.getAuthorities().stream()
|
||||||
|
.anyMatch(a -> a.getAuthority().equals("ROLE_MASTER")
|
||||||
|
|| a.getAuthority().equals("ROLE_MANAGER")
|
||||||
|
|| a.getAuthority().equals("ROLE_STAFF"));
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/transactions/all")
|
@GetMapping("/transactions/all")
|
||||||
public ResponseEntity<List<TokenTransaction>> getAllTransactions() {
|
public ResponseEntity<List<TokenTransaction>> getAllTransactions() {
|
||||||
return ResponseEntity.ok(tokenService.getAllTransactions());
|
return ResponseEntity.ok(tokenService.getAllTransactions());
|
||||||
|
|||||||
@@ -0,0 +1,147 @@
|
|||||||
|
package com.rit.canteen.sales.model;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tracks a Razorpay payment from creation through fulfillment.
|
||||||
|
* Ensures order placement / wallet credit only happens after verified payment,
|
||||||
|
* and is idempotent across client retries and webhooks.
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "payment_sessions", indexes = {
|
||||||
|
@Index(name = "idx_payment_sessions_user", columnList = "user_id"),
|
||||||
|
@Index(name = "idx_payment_sessions_status", columnList = "status")
|
||||||
|
})
|
||||||
|
public class PaymentSession {
|
||||||
|
|
||||||
|
public enum Purpose {
|
||||||
|
ORDER,
|
||||||
|
WALLET_TOPUP
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum Status {
|
||||||
|
CREATED,
|
||||||
|
PAID,
|
||||||
|
FULFILLED,
|
||||||
|
FULFILLED_AS_CREDIT,
|
||||||
|
FAILED,
|
||||||
|
EXPIRED
|
||||||
|
}
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(name = "user_id", nullable = false)
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
@Column(nullable = false, length = 32)
|
||||||
|
private Purpose purpose;
|
||||||
|
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
@Column(nullable = false, length = 32)
|
||||||
|
private Status status = Status.CREATED;
|
||||||
|
|
||||||
|
/** Amount in INR (rupees), not paise */
|
||||||
|
@Column(nullable = false, precision = 12, scale = 2)
|
||||||
|
private BigDecimal amountInr;
|
||||||
|
|
||||||
|
@Column(nullable = false, length = 8)
|
||||||
|
private String currency = "INR";
|
||||||
|
|
||||||
|
@Column(name = "razorpay_order_id", nullable = false, unique = true, length = 64)
|
||||||
|
private String razorpayOrderId;
|
||||||
|
|
||||||
|
@Column(name = "razorpay_payment_id", unique = true, length = 64)
|
||||||
|
private String razorpayPaymentId;
|
||||||
|
|
||||||
|
@Column(name = "razorpay_signature", length = 256)
|
||||||
|
private String razorpaySignature;
|
||||||
|
|
||||||
|
/** Serialized cart/order payload for ORDER purpose (JSON text) */
|
||||||
|
@Column(name = "order_payload", columnDefinition = "TEXT")
|
||||||
|
private String orderPayload;
|
||||||
|
|
||||||
|
@Column(name = "fulfillment_order_number", length = 64)
|
||||||
|
private String fulfillmentOrderNumber;
|
||||||
|
|
||||||
|
@Column(name = "fulfillment_display_id", length = 32)
|
||||||
|
private String fulfillmentDisplayId;
|
||||||
|
|
||||||
|
@Column(name = "failure_reason", length = 512)
|
||||||
|
private String failureReason;
|
||||||
|
|
||||||
|
@Column(name = "created_at", nullable = false)
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
|
||||||
|
@Column(name = "updated_at", nullable = false)
|
||||||
|
private LocalDateTime updatedAt;
|
||||||
|
|
||||||
|
@Column(name = "fulfilled_at")
|
||||||
|
private LocalDateTime fulfilledAt;
|
||||||
|
|
||||||
|
@PrePersist
|
||||||
|
protected void onCreate() {
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
if (createdAt == null) createdAt = now;
|
||||||
|
if (updatedAt == null) updatedAt = now;
|
||||||
|
if (status == null) status = Status.CREATED;
|
||||||
|
if (currency == null) currency = "INR";
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreUpdate
|
||||||
|
protected void onUpdate() {
|
||||||
|
updatedAt = LocalDateTime.now();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() { return id; }
|
||||||
|
public void setId(Long id) { this.id = id; }
|
||||||
|
|
||||||
|
public Long getUserId() { return userId; }
|
||||||
|
public void setUserId(Long userId) { this.userId = userId; }
|
||||||
|
|
||||||
|
public Purpose getPurpose() { return purpose; }
|
||||||
|
public void setPurpose(Purpose purpose) { this.purpose = purpose; }
|
||||||
|
|
||||||
|
public Status getStatus() { return status; }
|
||||||
|
public void setStatus(Status status) { this.status = status; }
|
||||||
|
|
||||||
|
public BigDecimal getAmountInr() { return amountInr; }
|
||||||
|
public void setAmountInr(BigDecimal amountInr) { this.amountInr = amountInr; }
|
||||||
|
|
||||||
|
public String getCurrency() { return currency; }
|
||||||
|
public void setCurrency(String currency) { this.currency = currency; }
|
||||||
|
|
||||||
|
public String getRazorpayOrderId() { return razorpayOrderId; }
|
||||||
|
public void setRazorpayOrderId(String razorpayOrderId) { this.razorpayOrderId = razorpayOrderId; }
|
||||||
|
|
||||||
|
public String getRazorpayPaymentId() { return razorpayPaymentId; }
|
||||||
|
public void setRazorpayPaymentId(String razorpayPaymentId) { this.razorpayPaymentId = razorpayPaymentId; }
|
||||||
|
|
||||||
|
public String getRazorpaySignature() { return razorpaySignature; }
|
||||||
|
public void setRazorpaySignature(String razorpaySignature) { this.razorpaySignature = razorpaySignature; }
|
||||||
|
|
||||||
|
public String getOrderPayload() { return orderPayload; }
|
||||||
|
public void setOrderPayload(String orderPayload) { this.orderPayload = orderPayload; }
|
||||||
|
|
||||||
|
public String getFulfillmentOrderNumber() { return fulfillmentOrderNumber; }
|
||||||
|
public void setFulfillmentOrderNumber(String fulfillmentOrderNumber) { this.fulfillmentOrderNumber = fulfillmentOrderNumber; }
|
||||||
|
|
||||||
|
public String getFulfillmentDisplayId() { return fulfillmentDisplayId; }
|
||||||
|
public void setFulfillmentDisplayId(String fulfillmentDisplayId) { this.fulfillmentDisplayId = fulfillmentDisplayId; }
|
||||||
|
|
||||||
|
public String getFailureReason() { return failureReason; }
|
||||||
|
public void setFailureReason(String failureReason) { this.failureReason = failureReason; }
|
||||||
|
|
||||||
|
public LocalDateTime getCreatedAt() { return createdAt; }
|
||||||
|
public void setCreatedAt(LocalDateTime createdAt) { this.createdAt = createdAt; }
|
||||||
|
|
||||||
|
public LocalDateTime getUpdatedAt() { return updatedAt; }
|
||||||
|
public void setUpdatedAt(LocalDateTime updatedAt) { this.updatedAt = updatedAt; }
|
||||||
|
|
||||||
|
public LocalDateTime getFulfilledAt() { return fulfilledAt; }
|
||||||
|
public void setFulfilledAt(LocalDateTime fulfilledAt) { this.fulfilledAt = fulfilledAt; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.rit.canteen.sales.repository;
|
||||||
|
|
||||||
|
import com.rit.canteen.sales.model.PaymentSession;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface PaymentSessionRepository extends JpaRepository<PaymentSession, Long> {
|
||||||
|
Optional<PaymentSession> findByRazorpayOrderId(String razorpayOrderId);
|
||||||
|
Optional<PaymentSession> findByRazorpayPaymentId(String razorpayPaymentId);
|
||||||
|
boolean existsByRazorpayPaymentId(String razorpayPaymentId);
|
||||||
|
List<PaymentSession> findByUserIdOrderByCreatedAtDesc(Long userId);
|
||||||
|
}
|
||||||
@@ -9,12 +9,16 @@ import org.springframework.stereotype.Repository;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public interface TokenTransactionRepository extends JpaRepository<TokenTransaction, Long> {
|
public interface TokenTransactionRepository extends JpaRepository<TokenTransaction, Long> {
|
||||||
List<TokenTransaction> findByUserIdOrderByTimestampDesc(Long userId);
|
List<TokenTransaction> findByUserIdOrderByTimestampDesc(Long userId);
|
||||||
List<TokenTransaction> findAllByOrderByTimestampDesc();
|
List<TokenTransaction> findAllByOrderByTimestampDesc();
|
||||||
|
|
||||||
|
Optional<TokenTransaction> findByReferenceId(String referenceId);
|
||||||
|
boolean existsByReferenceId(String referenceId);
|
||||||
|
|
||||||
@Query("SELECT SUM(t.amount) FROM TokenTransaction t WHERE t.type = :type")
|
@Query("SELECT SUM(t.amount) FROM TokenTransaction t WHERE t.type = :type")
|
||||||
BigDecimal sumByType(@Param("type") TokenTransaction.TransactionType type);
|
BigDecimal sumByType(@Param("type") TokenTransaction.TransactionType type);
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,259 @@
|
|||||||
|
package com.rit.canteen.sales.service;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.rit.canteen.sales.model.Order;
|
||||||
|
import com.rit.canteen.sales.model.OrderItem;
|
||||||
|
import com.rit.canteen.sales.model.Product;
|
||||||
|
import com.rit.canteen.sales.repository.OrderRepository;
|
||||||
|
import com.rit.canteen.sales.repository.ProductRepository;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shared order placement used by direct Ritz-token checkout and post-payment Razorpay fulfillment.
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OrderPlacementService {
|
||||||
|
|
||||||
|
public static class PlacementResult {
|
||||||
|
public final boolean success;
|
||||||
|
public final String orderNumber;
|
||||||
|
public final String displayOrderId;
|
||||||
|
public final String message;
|
||||||
|
public final String errorType;
|
||||||
|
public final List<Map<String, Object>> conflicts;
|
||||||
|
public final BigDecimal serverTotal;
|
||||||
|
|
||||||
|
private PlacementResult(boolean success, String orderNumber, String displayOrderId,
|
||||||
|
String message, String errorType, List<Map<String, Object>> conflicts,
|
||||||
|
BigDecimal serverTotal) {
|
||||||
|
this.success = success;
|
||||||
|
this.orderNumber = orderNumber;
|
||||||
|
this.displayOrderId = displayOrderId;
|
||||||
|
this.message = message;
|
||||||
|
this.errorType = errorType;
|
||||||
|
this.conflicts = conflicts;
|
||||||
|
this.serverTotal = serverTotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PlacementResult ok(String orderNumber, String displayOrderId) {
|
||||||
|
return new PlacementResult(true, orderNumber, displayOrderId, "Order placed successfully", null, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PlacementResult fail(String message, String errorType, List<Map<String, Object>> conflicts) {
|
||||||
|
return new PlacementResult(false, null, null, message, errorType, conflicts, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PlacementResult priceMismatch(BigDecimal serverTotal, BigDecimal clientTotal) {
|
||||||
|
return new PlacementResult(false, null, null,
|
||||||
|
"Price mismatch detected. Please refresh and try again.",
|
||||||
|
"PRICE_ERROR", null, serverTotal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OrderRepository orderRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProductRepository productRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TokenService tokenService;
|
||||||
|
|
||||||
|
private final ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validates items and returns the server-side total. Does not mutate stock.
|
||||||
|
*/
|
||||||
|
public BigDecimal calculateServerTotal(List<OrderItem> items) {
|
||||||
|
if (items == null || items.isEmpty()) {
|
||||||
|
throw new IllegalArgumentException("Order must have items");
|
||||||
|
}
|
||||||
|
BigDecimal serverTotal = BigDecimal.ZERO;
|
||||||
|
for (OrderItem item : items) {
|
||||||
|
if (item.getProductId() == null) {
|
||||||
|
throw new IllegalArgumentException("Each item must have a productId");
|
||||||
|
}
|
||||||
|
Product product = productRepository.findById(item.getProductId())
|
||||||
|
.orElseThrow(() -> new IllegalArgumentException("Product not found: " + item.getProductId()));
|
||||||
|
|
||||||
|
BigDecimal unitPrice = (product.getOfferPrice() != null && product.getOfferPrice().compareTo(BigDecimal.ZERO) > 0)
|
||||||
|
? product.getOfferPrice() : product.getPrice();
|
||||||
|
|
||||||
|
if (item.getProductName() != null && item.getProductName().endsWith(" (Parcel)") && product.isParcellable()) {
|
||||||
|
unitPrice = unitPrice.add(BigDecimal.valueOf(5));
|
||||||
|
}
|
||||||
|
item.setPrice(unitPrice);
|
||||||
|
serverTotal = serverTotal.add(unitPrice.multiply(BigDecimal.valueOf(item.getQuantity())));
|
||||||
|
}
|
||||||
|
return serverTotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Soft stock availability check (no decrement).
|
||||||
|
*/
|
||||||
|
public List<Map<String, Object>> checkStock(List<OrderItem> items) {
|
||||||
|
List<Map<String, Object>> conflicts = new ArrayList<>();
|
||||||
|
for (OrderItem item : items) {
|
||||||
|
if (item.getProductId() == null) continue;
|
||||||
|
Product p = productRepository.findById(item.getProductId()).orElse(null);
|
||||||
|
int left = (p != null && p.getStock() != null) ? p.getStock() : 0;
|
||||||
|
if (left < item.getQuantity()) {
|
||||||
|
Map<String, Object> conflict = new HashMap<>();
|
||||||
|
conflict.put("productId", item.getProductId());
|
||||||
|
conflict.put("productName", item.getProductName());
|
||||||
|
conflict.put("requested", item.getQuantity());
|
||||||
|
conflict.put("available", left);
|
||||||
|
conflicts.add(conflict);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return conflicts;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Places an order after payment authorization (Ritz tokens or verified Razorpay).
|
||||||
|
*
|
||||||
|
* Uses REQUIRES_NEW so a stock failure can roll back only the order attempt,
|
||||||
|
* allowing the payment flow to credit the wallet as a fallback without
|
||||||
|
* UnexpectedRollbackException on the outer transaction.
|
||||||
|
*
|
||||||
|
* @param deductRitzTokens if true, spends wallet tokens; if false, assumes external payment already captured
|
||||||
|
*/
|
||||||
|
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||||
|
public PlacementResult placeOrder(Order order, boolean deductRitzTokens) {
|
||||||
|
if (order.getItems() == null || order.getItems().isEmpty()) {
|
||||||
|
return PlacementResult.fail("Order must have items", "VALIDATION_ERROR", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
BigDecimal serverTotal;
|
||||||
|
try {
|
||||||
|
serverTotal = calculateServerTotal(order.getItems());
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
return PlacementResult.fail(e.getMessage(), "VALIDATION_ERROR", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (order.getTotalAmount() != null
|
||||||
|
&& serverTotal.subtract(order.getTotalAmount()).abs().compareTo(new BigDecimal("5")) > 0) {
|
||||||
|
return PlacementResult.priceMismatch(serverTotal, order.getTotalAmount());
|
||||||
|
}
|
||||||
|
order.setTotalAmount(serverTotal);
|
||||||
|
|
||||||
|
// Stock decrement
|
||||||
|
List<Map<String, Object>> stockConflicts = new ArrayList<>();
|
||||||
|
for (OrderItem item : order.getItems()) {
|
||||||
|
Long productId = item.getProductId();
|
||||||
|
if (productId != null) {
|
||||||
|
int updatedRows = productRepository.decrementStock(productId, item.getQuantity());
|
||||||
|
if (updatedRows == 0) {
|
||||||
|
Product p = productRepository.findById(productId).orElse(null);
|
||||||
|
int left = (p != null && p.getStock() != null) ? p.getStock() : 0;
|
||||||
|
Map<String, Object> conflict = new HashMap<>();
|
||||||
|
conflict.put("productId", productId);
|
||||||
|
conflict.put("productName", item.getProductName());
|
||||||
|
conflict.put("requested", item.getQuantity());
|
||||||
|
conflict.put("available", left);
|
||||||
|
stockConflicts.add(conflict);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!stockConflicts.isEmpty()) {
|
||||||
|
// Rollback transaction via exception so stock decrements reverse
|
||||||
|
throw new StockConflictException(stockConflicts);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (OrderItem item : order.getItems()) {
|
||||||
|
item.setOrder(order);
|
||||||
|
if (item.getStallName() == null || item.getStallName().isEmpty() || "Unknown Stall".equals(item.getStallName())) {
|
||||||
|
item.setStallName("RIT Canteen");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
order.setCreatedAt(now);
|
||||||
|
LocalDateTime startOfDay = now.toLocalDate().atStartOfDay();
|
||||||
|
long todaysOrderCount = orderRepository.countByCreatedAtGreaterThanEqual(startOfDay);
|
||||||
|
order.setDisplayOrderId(String.format("%03d", todaysOrderCount + 1));
|
||||||
|
|
||||||
|
if (deductRitzTokens && "RITZ_TOKEN".equals(order.getPaymentMethod())) {
|
||||||
|
try {
|
||||||
|
tokenService.spend(order.getUserId(), order.getTotalAmount(), "ORD-" + order.getDisplayOrderId());
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
if ("INSUFFICIENT_TOKENS".equals(e.getMessage())) {
|
||||||
|
throw new InsufficientTokensException();
|
||||||
|
}
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Order saved = orderRepository.save(order);
|
||||||
|
return PlacementResult.ok(saved.getOrderNumber(), saved.getDisplayOrderId());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Order buildOrderFromPayload(String json, Long userId, String paymentMethod) {
|
||||||
|
try {
|
||||||
|
Map<String, Object> map = objectMapper.readValue(json, new TypeReference<>() {});
|
||||||
|
Order order = new Order();
|
||||||
|
order.setUserId(userId);
|
||||||
|
order.setPaymentMethod(paymentMethod);
|
||||||
|
order.setOrderType(map.get("orderType") != null ? map.get("orderType").toString() : "MY_ORDER");
|
||||||
|
if (map.get("totalAmount") != null) {
|
||||||
|
order.setTotalAmount(new BigDecimal(map.get("totalAmount").toString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
List<Map<String, Object>> itemsRaw = (List<Map<String, Object>>) map.get("items");
|
||||||
|
List<OrderItem> items = new ArrayList<>();
|
||||||
|
if (itemsRaw != null) {
|
||||||
|
for (Map<String, Object> ir : itemsRaw) {
|
||||||
|
OrderItem item = new OrderItem();
|
||||||
|
if (ir.get("productId") != null) {
|
||||||
|
item.setProductId(Long.valueOf(ir.get("productId").toString()));
|
||||||
|
}
|
||||||
|
item.setProductName(ir.get("productName") != null ? ir.get("productName").toString() : null);
|
||||||
|
if (ir.get("price") != null) {
|
||||||
|
item.setPrice(new BigDecimal(ir.get("price").toString()));
|
||||||
|
}
|
||||||
|
item.setQuantity(ir.get("quantity") != null ? Integer.parseInt(ir.get("quantity").toString()) : 1);
|
||||||
|
if (ir.get("stallId") != null && !"null".equals(String.valueOf(ir.get("stallId")))) {
|
||||||
|
item.setStallId(Long.valueOf(ir.get("stallId").toString()));
|
||||||
|
}
|
||||||
|
item.setStallName(ir.get("stallName") != null ? ir.get("stallName").toString() : null);
|
||||||
|
items.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
order.setItems(items);
|
||||||
|
return order;
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new IllegalArgumentException("Invalid order payload: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String serializeOrderPayload(Map<String, Object> payload) {
|
||||||
|
try {
|
||||||
|
return objectMapper.writeValueAsString(payload);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new IllegalArgumentException("Could not serialize order payload");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class StockConflictException extends RuntimeException {
|
||||||
|
public final List<Map<String, Object>> conflicts;
|
||||||
|
public StockConflictException(List<Map<String, Object>> conflicts) {
|
||||||
|
super("CONCURRENCY_STOCK_FAILURE");
|
||||||
|
this.conflicts = conflicts;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class InsufficientTokensException extends RuntimeException {
|
||||||
|
public InsufficientTokensException() {
|
||||||
|
super("INSUFFICIENT_TOKENS");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,411 @@
|
|||||||
|
package com.rit.canteen.sales.service;
|
||||||
|
|
||||||
|
import com.razorpay.Order;
|
||||||
|
import com.razorpay.Payment;
|
||||||
|
import com.rit.canteen.sales.model.OrderItem;
|
||||||
|
import com.rit.canteen.sales.model.PaymentSession;
|
||||||
|
import com.rit.canteen.sales.model.User;
|
||||||
|
import com.rit.canteen.sales.repository.PaymentSessionRepository;
|
||||||
|
import com.rit.canteen.sales.repository.TokenTransactionRepository;
|
||||||
|
import com.rit.canteen.sales.repository.UserRepository;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PaymentService {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(PaymentService.class);
|
||||||
|
private static final BigDecimal MIN_TOPUP = new BigDecimal("50");
|
||||||
|
private static final BigDecimal MAX_TOPUP = new BigDecimal("5000");
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RazorpayService razorpayService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PaymentSessionRepository paymentSessionRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OrderPlacementService orderPlacementService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TokenService tokenService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TokenTransactionRepository tokenTransactionRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserRepository userRepository;
|
||||||
|
|
||||||
|
public Map<String, Object> createWalletTopupSession(Long userId, BigDecimal amountInr) throws Exception {
|
||||||
|
ensureConfigured();
|
||||||
|
if (amountInr == null || amountInr.compareTo(MIN_TOPUP) < 0) {
|
||||||
|
throw new IllegalArgumentException("Minimum top up amount is ₹50");
|
||||||
|
}
|
||||||
|
if (amountInr.compareTo(MAX_TOPUP) > 0) {
|
||||||
|
throw new IllegalArgumentException("Maximum top up per transaction is ₹5,000");
|
||||||
|
}
|
||||||
|
// Normalize to 2 decimals
|
||||||
|
amountInr = amountInr.setScale(2, RoundingMode.HALF_UP);
|
||||||
|
if (amountInr.stripTrailingZeros().scale() > 0) {
|
||||||
|
// Ritz tokens are whole units
|
||||||
|
throw new IllegalArgumentException("Top up amount must be a whole number of rupees");
|
||||||
|
}
|
||||||
|
|
||||||
|
User user = userRepository.findById(userId)
|
||||||
|
.orElseThrow(() -> new IllegalArgumentException("User not found"));
|
||||||
|
|
||||||
|
String receipt = "TOP-" + userId + "-" + System.currentTimeMillis();
|
||||||
|
Map<String, String> notes = Map.of(
|
||||||
|
"purpose", "WALLET_TOPUP",
|
||||||
|
"userId", String.valueOf(userId)
|
||||||
|
);
|
||||||
|
|
||||||
|
Order rzOrder = razorpayService.createOrder(amountInr, receipt, notes);
|
||||||
|
|
||||||
|
PaymentSession session = new PaymentSession();
|
||||||
|
session.setUserId(userId);
|
||||||
|
session.setPurpose(PaymentSession.Purpose.WALLET_TOPUP);
|
||||||
|
session.setStatus(PaymentSession.Status.CREATED);
|
||||||
|
session.setAmountInr(amountInr);
|
||||||
|
session.setCurrency("INR");
|
||||||
|
session.setRazorpayOrderId(rzOrder.get("id"));
|
||||||
|
session.setCreatedAt(LocalDateTime.now());
|
||||||
|
session.setUpdatedAt(LocalDateTime.now());
|
||||||
|
paymentSessionRepository.save(session);
|
||||||
|
|
||||||
|
return checkoutPayload(session, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public Map<String, Object> createOrderPaymentSession(Long userId, Map<String, Object> orderRequest) throws Exception {
|
||||||
|
ensureConfigured();
|
||||||
|
User user = userRepository.findById(userId)
|
||||||
|
.orElseThrow(() -> new IllegalArgumentException("User not found"));
|
||||||
|
|
||||||
|
// Build temporary order for validation
|
||||||
|
String payloadJson = orderPlacementService.serializeOrderPayload(orderRequest);
|
||||||
|
com.rit.canteen.sales.model.Order draft =
|
||||||
|
orderPlacementService.buildOrderFromPayload(payloadJson, userId, "RAZORPAY");
|
||||||
|
|
||||||
|
BigDecimal serverTotal = orderPlacementService.calculateServerTotal(draft.getItems());
|
||||||
|
if (serverTotal.compareTo(BigDecimal.ONE) < 0) {
|
||||||
|
throw new IllegalArgumentException("Order total must be at least ₹1");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Map<String, Object>> stockConflicts = orderPlacementService.checkStock(draft.getItems());
|
||||||
|
if (!stockConflicts.isEmpty()) {
|
||||||
|
Map<String, Object> err = new LinkedHashMap<>();
|
||||||
|
err.put("success", false);
|
||||||
|
err.put("errorType", "STOCK_ERROR");
|
||||||
|
err.put("message", "Some items are no longer available in the requested quantity.");
|
||||||
|
err.put("conflicts", stockConflicts);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Persist validated total + items into payload
|
||||||
|
orderRequest.put("totalAmount", serverTotal);
|
||||||
|
List<Map<String, Object>> normalizedItems = new ArrayList<>();
|
||||||
|
for (OrderItem item : draft.getItems()) {
|
||||||
|
Map<String, Object> m = new LinkedHashMap<>();
|
||||||
|
m.put("productId", item.getProductId());
|
||||||
|
m.put("productName", item.getProductName());
|
||||||
|
m.put("price", item.getPrice());
|
||||||
|
m.put("quantity", item.getQuantity());
|
||||||
|
m.put("stallId", item.getStallId());
|
||||||
|
m.put("stallName", item.getStallName());
|
||||||
|
normalizedItems.add(m);
|
||||||
|
}
|
||||||
|
orderRequest.put("items", normalizedItems);
|
||||||
|
orderRequest.put("orderType", orderRequest.getOrDefault("orderType", "MY_ORDER"));
|
||||||
|
payloadJson = orderPlacementService.serializeOrderPayload(orderRequest);
|
||||||
|
|
||||||
|
String receipt = "ORD-" + userId + "-" + System.currentTimeMillis();
|
||||||
|
Map<String, String> notes = Map.of(
|
||||||
|
"purpose", "ORDER",
|
||||||
|
"userId", String.valueOf(userId)
|
||||||
|
);
|
||||||
|
|
||||||
|
Order rzOrder = razorpayService.createOrder(serverTotal, receipt, notes);
|
||||||
|
|
||||||
|
PaymentSession session = new PaymentSession();
|
||||||
|
session.setUserId(userId);
|
||||||
|
session.setPurpose(PaymentSession.Purpose.ORDER);
|
||||||
|
session.setStatus(PaymentSession.Status.CREATED);
|
||||||
|
session.setAmountInr(serverTotal);
|
||||||
|
session.setCurrency("INR");
|
||||||
|
session.setRazorpayOrderId(rzOrder.get("id"));
|
||||||
|
session.setOrderPayload(payloadJson);
|
||||||
|
session.setCreatedAt(LocalDateTime.now());
|
||||||
|
session.setUpdatedAt(LocalDateTime.now());
|
||||||
|
paymentSessionRepository.save(session);
|
||||||
|
|
||||||
|
return checkoutPayload(session, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verifies Razorpay checkout response and fulfills the payment session.
|
||||||
|
* Idempotent: replaying the same payment returns the previous fulfillment result.
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
public Map<String, Object> verifyAndFulfill(Long userId, String razorpayOrderId,
|
||||||
|
String razorpayPaymentId, String razorpaySignature) throws Exception {
|
||||||
|
ensureConfigured();
|
||||||
|
|
||||||
|
if (razorpayOrderId == null || razorpayPaymentId == null || razorpaySignature == null) {
|
||||||
|
throw new IllegalArgumentException("Missing payment verification fields");
|
||||||
|
}
|
||||||
|
|
||||||
|
PaymentSession session = paymentSessionRepository.findByRazorpayOrderId(razorpayOrderId)
|
||||||
|
.orElseThrow(() -> new IllegalArgumentException("Unknown payment session"));
|
||||||
|
|
||||||
|
if (!session.getUserId().equals(userId)) {
|
||||||
|
throw new SecurityException("Payment session does not belong to this user");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Idempotent success
|
||||||
|
if (session.getStatus() == PaymentSession.Status.FULFILLED
|
||||||
|
|| session.getStatus() == PaymentSession.Status.FULFILLED_AS_CREDIT) {
|
||||||
|
return buildFulfillmentResponse(session);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Another path may have already stored this payment id
|
||||||
|
Optional<PaymentSession> byPayment = paymentSessionRepository.findByRazorpayPaymentId(razorpayPaymentId);
|
||||||
|
if (byPayment.isPresent() && !byPayment.get().getId().equals(session.getId())) {
|
||||||
|
throw new IllegalStateException("Payment already linked to another session");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!razorpayService.verifyPaymentSignature(razorpayOrderId, razorpayPaymentId, razorpaySignature)) {
|
||||||
|
session.setStatus(PaymentSession.Status.FAILED);
|
||||||
|
session.setFailureReason("Invalid payment signature");
|
||||||
|
paymentSessionRepository.save(session);
|
||||||
|
throw new SecurityException("Payment signature verification failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Server-side confirmation with Razorpay API
|
||||||
|
Payment payment = razorpayService.fetchPayment(razorpayPaymentId);
|
||||||
|
if (!razorpayService.isPaymentCaptured(payment)) {
|
||||||
|
session.setStatus(PaymentSession.Status.FAILED);
|
||||||
|
session.setFailureReason("Payment not captured: " + payment.get("status"));
|
||||||
|
paymentSessionRepository.save(session);
|
||||||
|
throw new IllegalStateException("Payment has not been captured yet. Status: " + payment.get("status"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ensure payment is for this order
|
||||||
|
String paymentOrderId = payment.get("order_id");
|
||||||
|
if (paymentOrderId != null && !razorpayOrderId.equals(paymentOrderId)) {
|
||||||
|
session.setStatus(PaymentSession.Status.FAILED);
|
||||||
|
session.setFailureReason("Payment order mismatch");
|
||||||
|
paymentSessionRepository.save(session);
|
||||||
|
throw new SecurityException("Payment does not match Razorpay order");
|
||||||
|
}
|
||||||
|
|
||||||
|
BigDecimal paidInr = razorpayService.paymentAmountInr(payment);
|
||||||
|
if (paidInr.compareTo(session.getAmountInr()) != 0) {
|
||||||
|
session.setStatus(PaymentSession.Status.FAILED);
|
||||||
|
session.setFailureReason("Amount mismatch: paid=" + paidInr + " expected=" + session.getAmountInr());
|
||||||
|
paymentSessionRepository.save(session);
|
||||||
|
throw new SecurityException("Paid amount does not match expected amount");
|
||||||
|
}
|
||||||
|
|
||||||
|
session.setRazorpayPaymentId(razorpayPaymentId);
|
||||||
|
session.setRazorpaySignature(razorpaySignature);
|
||||||
|
session.setStatus(PaymentSession.Status.PAID);
|
||||||
|
paymentSessionRepository.save(session);
|
||||||
|
|
||||||
|
return fulfillSession(session);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Webhook-driven fulfillment when client disconnects after paying.
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
public void handlePaymentCapturedWebhook(String razorpayOrderId, String razorpayPaymentId) {
|
||||||
|
try {
|
||||||
|
PaymentSession session = paymentSessionRepository.findByRazorpayOrderId(razorpayOrderId).orElse(null);
|
||||||
|
if (session == null) {
|
||||||
|
log.warn("Webhook for unknown order {}", razorpayOrderId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (session.getStatus() == PaymentSession.Status.FULFILLED
|
||||||
|
|| session.getStatus() == PaymentSession.Status.FULFILLED_AS_CREDIT) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verify via API
|
||||||
|
Payment payment = razorpayService.fetchPayment(razorpayPaymentId);
|
||||||
|
if (!razorpayService.isPaymentCaptured(payment)) {
|
||||||
|
log.warn("Webhook payment {} not captured", razorpayPaymentId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BigDecimal paidInr = razorpayService.paymentAmountInr(payment);
|
||||||
|
if (paidInr.compareTo(session.getAmountInr()) != 0) {
|
||||||
|
log.error("Webhook amount mismatch for order {}", razorpayOrderId);
|
||||||
|
session.setStatus(PaymentSession.Status.FAILED);
|
||||||
|
session.setFailureReason("Webhook amount mismatch");
|
||||||
|
paymentSessionRepository.save(session);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
session.setRazorpayPaymentId(razorpayPaymentId);
|
||||||
|
session.setStatus(PaymentSession.Status.PAID);
|
||||||
|
paymentSessionRepository.save(session);
|
||||||
|
fulfillSession(session);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("Webhook fulfillment failed for order {}: {}", razorpayOrderId, e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String, Object> fulfillSession(PaymentSession session) throws Exception {
|
||||||
|
if (session.getPurpose() == PaymentSession.Purpose.WALLET_TOPUP) {
|
||||||
|
return fulfillWalletTopup(session);
|
||||||
|
}
|
||||||
|
return fulfillOrder(session);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String, Object> fulfillWalletTopup(PaymentSession session) {
|
||||||
|
String ref = "RZP-" + session.getRazorpayPaymentId();
|
||||||
|
if (tokenTransactionRepository.existsByReferenceId(ref)) {
|
||||||
|
session.setStatus(PaymentSession.Status.FULFILLED);
|
||||||
|
session.setFulfilledAt(LocalDateTime.now());
|
||||||
|
paymentSessionRepository.save(session);
|
||||||
|
User user = userRepository.findById(session.getUserId()).orElse(null);
|
||||||
|
Map<String, Object> resp = buildFulfillmentResponse(session);
|
||||||
|
if (user != null) resp.put("newBalance", user.getRitzTokenBalance());
|
||||||
|
return resp;
|
||||||
|
}
|
||||||
|
|
||||||
|
User updated = tokenService.topUp(session.getUserId(), session.getAmountInr(), ref);
|
||||||
|
session.setStatus(PaymentSession.Status.FULFILLED);
|
||||||
|
session.setFulfilledAt(LocalDateTime.now());
|
||||||
|
paymentSessionRepository.save(session);
|
||||||
|
|
||||||
|
Map<String, Object> resp = buildFulfillmentResponse(session);
|
||||||
|
resp.put("newBalance", updated.getRitzTokenBalance());
|
||||||
|
resp.put("message", "Successfully added " + session.getAmountInr() + " Ritz Tokens");
|
||||||
|
return resp;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String, Object> fulfillOrder(PaymentSession session) {
|
||||||
|
try {
|
||||||
|
com.rit.canteen.sales.model.Order order = orderPlacementService.buildOrderFromPayload(
|
||||||
|
session.getOrderPayload(), session.getUserId(), "RAZORPAY");
|
||||||
|
order.setTotalAmount(session.getAmountInr());
|
||||||
|
|
||||||
|
OrderPlacementService.PlacementResult result =
|
||||||
|
orderPlacementService.placeOrder(order, false);
|
||||||
|
|
||||||
|
if (!result.success) {
|
||||||
|
// Should not normally reach here for stock (throws), but handle validation failures
|
||||||
|
return creditAsFallback(session, result.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
session.setStatus(PaymentSession.Status.FULFILLED);
|
||||||
|
session.setFulfillmentOrderNumber(result.orderNumber);
|
||||||
|
session.setFulfillmentDisplayId(result.displayOrderId);
|
||||||
|
session.setFulfilledAt(LocalDateTime.now());
|
||||||
|
paymentSessionRepository.save(session);
|
||||||
|
return buildFulfillmentResponse(session);
|
||||||
|
} catch (OrderPlacementService.StockConflictException e) {
|
||||||
|
log.warn("Stock conflict after payment {}; crediting wallet as fallback", session.getRazorpayPaymentId());
|
||||||
|
return creditAsFallback(session,
|
||||||
|
"Payment received, but some items went out of stock. ₹"
|
||||||
|
+ session.getAmountInr() + " has been credited to your Ritz wallet.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String, Object> creditAsFallback(PaymentSession session, String reason) {
|
||||||
|
String ref = "RZP-FALLBACK-" + session.getRazorpayPaymentId();
|
||||||
|
if (!tokenTransactionRepository.existsByReferenceId(ref)) {
|
||||||
|
tokenService.topUp(session.getUserId(), session.getAmountInr(), ref);
|
||||||
|
}
|
||||||
|
session.setStatus(PaymentSession.Status.FULFILLED_AS_CREDIT);
|
||||||
|
session.setFailureReason(reason);
|
||||||
|
session.setFulfilledAt(LocalDateTime.now());
|
||||||
|
paymentSessionRepository.save(session);
|
||||||
|
|
||||||
|
User user = userRepository.findById(session.getUserId()).orElse(null);
|
||||||
|
Map<String, Object> resp = new LinkedHashMap<>();
|
||||||
|
resp.put("success", true);
|
||||||
|
resp.put("type", "WALLET_CREDIT_FALLBACK");
|
||||||
|
resp.put("purpose", session.getPurpose().name());
|
||||||
|
resp.put("status", session.getStatus().name());
|
||||||
|
resp.put("message", reason);
|
||||||
|
resp.put("creditedAmount", session.getAmountInr());
|
||||||
|
if (user != null) resp.put("newBalance", user.getRitzTokenBalance());
|
||||||
|
resp.put("razorpayPaymentId", session.getRazorpayPaymentId());
|
||||||
|
return resp;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String, Object> buildFulfillmentResponse(PaymentSession session) {
|
||||||
|
Map<String, Object> resp = new LinkedHashMap<>();
|
||||||
|
resp.put("success", true);
|
||||||
|
resp.put("purpose", session.getPurpose().name());
|
||||||
|
resp.put("status", session.getStatus().name());
|
||||||
|
resp.put("razorpayOrderId", session.getRazorpayOrderId());
|
||||||
|
resp.put("razorpayPaymentId", session.getRazorpayPaymentId());
|
||||||
|
resp.put("amount", session.getAmountInr());
|
||||||
|
|
||||||
|
if (session.getPurpose() == PaymentSession.Purpose.ORDER
|
||||||
|
&& session.getStatus() == PaymentSession.Status.FULFILLED) {
|
||||||
|
resp.put("type", "ORDER");
|
||||||
|
resp.put("orderNumber", session.getFulfillmentOrderNumber());
|
||||||
|
resp.put("displayOrderId", session.getFulfillmentDisplayId());
|
||||||
|
resp.put("message", "Order placed successfully");
|
||||||
|
} else if (session.getPurpose() == PaymentSession.Purpose.WALLET_TOPUP) {
|
||||||
|
resp.put("type", "WALLET_TOPUP");
|
||||||
|
User user = userRepository.findById(session.getUserId()).orElse(null);
|
||||||
|
if (user != null) resp.put("newBalance", user.getRitzTokenBalance());
|
||||||
|
resp.put("message", "Wallet top-up successful");
|
||||||
|
} else if (session.getStatus() == PaymentSession.Status.FULFILLED_AS_CREDIT) {
|
||||||
|
resp.put("type", "WALLET_CREDIT_FALLBACK");
|
||||||
|
resp.put("message", session.getFailureReason());
|
||||||
|
User user = userRepository.findById(session.getUserId()).orElse(null);
|
||||||
|
if (user != null) resp.put("newBalance", user.getRitzTokenBalance());
|
||||||
|
}
|
||||||
|
return resp;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String, Object> checkoutPayload(PaymentSession session, User user) {
|
||||||
|
Map<String, Object> resp = new LinkedHashMap<>();
|
||||||
|
resp.put("success", true);
|
||||||
|
resp.put("paymentSessionId", session.getId());
|
||||||
|
resp.put("keyId", razorpayService.getKeyId());
|
||||||
|
resp.put("razorpayOrderId", session.getRazorpayOrderId());
|
||||||
|
resp.put("amount", RazorpayService.toPaise(session.getAmountInr())); // paise for Checkout.js
|
||||||
|
resp.put("amountInr", session.getAmountInr());
|
||||||
|
resp.put("currency", session.getCurrency());
|
||||||
|
resp.put("purpose", session.getPurpose().name());
|
||||||
|
resp.put("name", "Tillo Canteen");
|
||||||
|
resp.put("description", session.getPurpose() == PaymentSession.Purpose.WALLET_TOPUP
|
||||||
|
? "Ritz Wallet Top-up"
|
||||||
|
: "Food Order Payment");
|
||||||
|
|
||||||
|
Map<String, Object> prefill = new LinkedHashMap<>();
|
||||||
|
prefill.put("name", user.getName() != null ? user.getName() : "");
|
||||||
|
prefill.put("contact", user.getMobileNumber() != null ? user.getMobileNumber() : "");
|
||||||
|
if (user.getEmail() != null) prefill.put("email", user.getEmail());
|
||||||
|
resp.put("prefill", prefill);
|
||||||
|
|
||||||
|
Map<String, String> notes = new LinkedHashMap<>();
|
||||||
|
notes.put("paymentSessionId", String.valueOf(session.getId()));
|
||||||
|
notes.put("userId", String.valueOf(user.getId()));
|
||||||
|
resp.put("notes", notes);
|
||||||
|
return resp;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ensureConfigured() {
|
||||||
|
if (!razorpayService.isConfigured()) {
|
||||||
|
throw new IllegalStateException(
|
||||||
|
"Razorpay is not configured on the server. Set RAZORPAY_KEY_ID and RAZORPAY_KEY_SECRET.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,166 @@
|
|||||||
|
package com.rit.canteen.sales.service;
|
||||||
|
|
||||||
|
import com.razorpay.Order;
|
||||||
|
import com.razorpay.Payment;
|
||||||
|
import com.razorpay.RazorpayClient;
|
||||||
|
import com.razorpay.RazorpayException;
|
||||||
|
import com.razorpay.Utils;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.crypto.Mac;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.HexFormat;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Thin wrapper around the official Razorpay Java SDK.
|
||||||
|
* Secret key never leaves the server.
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class RazorpayService {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(RazorpayService.class);
|
||||||
|
|
||||||
|
@Value("${razorpay.key.id:}")
|
||||||
|
private String keyId;
|
||||||
|
|
||||||
|
@Value("${razorpay.key.secret:}")
|
||||||
|
private String keySecret;
|
||||||
|
|
||||||
|
@Value("${razorpay.webhook.secret:}")
|
||||||
|
private String webhookSecret;
|
||||||
|
|
||||||
|
public boolean isConfigured() {
|
||||||
|
return keyId != null && !keyId.isBlank()
|
||||||
|
&& keySecret != null && !keySecret.isBlank();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKeyId() {
|
||||||
|
return keyId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasWebhookSecret() {
|
||||||
|
return webhookSecret != null && !webhookSecret.isBlank();
|
||||||
|
}
|
||||||
|
|
||||||
|
private RazorpayClient client() throws RazorpayException {
|
||||||
|
if (!isConfigured()) {
|
||||||
|
throw new RazorpayException("Razorpay is not configured. Set RAZORPAY_KEY_ID and RAZORPAY_KEY_SECRET.");
|
||||||
|
}
|
||||||
|
return new RazorpayClient(keyId, keySecret);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a Razorpay Order for the given INR amount.
|
||||||
|
* @param amountInr amount in rupees (e.g. 120.00)
|
||||||
|
* @param receipt short unique receipt id (max 40 chars for Razorpay)
|
||||||
|
* @param notes optional notes map
|
||||||
|
*/
|
||||||
|
public Order createOrder(BigDecimal amountInr, String receipt, Map<String, String> notes) throws RazorpayException {
|
||||||
|
long amountPaise = toPaise(amountInr);
|
||||||
|
if (amountPaise < 100) {
|
||||||
|
throw new RazorpayException("Minimum payment amount is ₹1.00");
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject options = new JSONObject();
|
||||||
|
options.put("amount", amountPaise);
|
||||||
|
options.put("currency", "INR");
|
||||||
|
options.put("receipt", receipt != null && receipt.length() > 40 ? receipt.substring(0, 40) : receipt);
|
||||||
|
options.put("payment_capture", 1); // auto-capture
|
||||||
|
|
||||||
|
if (notes != null && !notes.isEmpty()) {
|
||||||
|
JSONObject notesJson = new JSONObject();
|
||||||
|
notes.forEach(notesJson::put);
|
||||||
|
options.put("notes", notesJson);
|
||||||
|
}
|
||||||
|
|
||||||
|
Order order = client().orders.create(options);
|
||||||
|
log.info("Created Razorpay order {} for {} paise", order.get("id"), amountPaise);
|
||||||
|
return order;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verifies checkout signature: HMAC_SHA256(orderId|paymentId, secret)
|
||||||
|
*/
|
||||||
|
public boolean verifyPaymentSignature(String orderId, String paymentId, String signature) {
|
||||||
|
if (orderId == null || paymentId == null || signature == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
JSONObject attributes = new JSONObject();
|
||||||
|
attributes.put("razorpay_order_id", orderId);
|
||||||
|
attributes.put("razorpay_payment_id", paymentId);
|
||||||
|
attributes.put("razorpay_signature", signature);
|
||||||
|
return Utils.verifyPaymentSignature(attributes, keySecret);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("Payment signature verification failed: {}", e.getMessage());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verifies Razorpay webhook signature using X-Razorpay-Signature header.
|
||||||
|
*/
|
||||||
|
public boolean verifyWebhookSignature(String body, String signatureHeader) {
|
||||||
|
if (!hasWebhookSecret() || body == null || signatureHeader == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return Utils.verifyWebhookSignature(body, signatureHeader, webhookSecret);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("Webhook signature verification failed: {}", e.getMessage());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches payment from Razorpay API to double-check status/amount server-side.
|
||||||
|
*/
|
||||||
|
public Payment fetchPayment(String paymentId) throws RazorpayException {
|
||||||
|
return client().payments.fetch(paymentId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPaymentCaptured(Payment payment) {
|
||||||
|
if (payment == null) return false;
|
||||||
|
String status = payment.get("status");
|
||||||
|
return "captured".equalsIgnoreCase(status) || "authorized".equalsIgnoreCase(status);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal paymentAmountInr(Payment payment) {
|
||||||
|
if (payment == null) return BigDecimal.ZERO;
|
||||||
|
Object amountObj = payment.get("amount");
|
||||||
|
long paise;
|
||||||
|
if (amountObj instanceof Number n) {
|
||||||
|
paise = n.longValue();
|
||||||
|
} else {
|
||||||
|
paise = Long.parseLong(String.valueOf(amountObj));
|
||||||
|
}
|
||||||
|
return BigDecimal.valueOf(paise).divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long toPaise(BigDecimal amountInr) {
|
||||||
|
return amountInr
|
||||||
|
.setScale(2, RoundingMode.HALF_UP)
|
||||||
|
.multiply(BigDecimal.valueOf(100))
|
||||||
|
.setScale(0, RoundingMode.HALF_UP)
|
||||||
|
.longValueExact();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Constant-time hex HMAC for any custom checks */
|
||||||
|
public String hmacSha256Hex(String data, String secret) {
|
||||||
|
try {
|
||||||
|
Mac mac = Mac.getInstance("HmacSHA256");
|
||||||
|
mac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
|
||||||
|
return HexFormat.of().formatHex(mac.doFinal(data.getBytes(StandardCharsets.UTF_8)));
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("HMAC computation failed", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -62,3 +62,12 @@ spring.datasource.hikari.connection-timeout=20000
|
|||||||
logging.level.org.apache.coyote.http11.Http11InputBuffer=ERROR
|
logging.level.org.apache.coyote.http11.Http11InputBuffer=ERROR
|
||||||
logging.level.org.apache.tomcat.util.http.parser.HttpParser=ERROR
|
logging.level.org.apache.tomcat.util.http.parser.HttpParser=ERROR
|
||||||
|
|
||||||
|
# ============================================================
|
||||||
|
# RAZORPAY — REQUIRED for online payments (ordering site + wallet top-up)
|
||||||
|
# Set via environment variables. NEVER commit live secrets to git.
|
||||||
|
# ============================================================
|
||||||
|
razorpay.key.id=${RAZORPAY_KEY_ID:rzp_live_TFJG984gtJCqrs}
|
||||||
|
razorpay.key.secret=${RAZORPAY_KEY_SECRET:LlAsZ6qzx94qgzXQu9GbQLMZ}
|
||||||
|
# Optional but strongly recommended in production (Razorpay Dashboard → Webhooks)
|
||||||
|
razorpay.webhook.secret=${RAZORPAY_WEBHOOK_SECRET:}
|
||||||
|
|
||||||
|
|||||||
BIN
counter-frontend/dist/assets/college-logo-B5J1bvCK.png
vendored
Normal file
BIN
counter-frontend/dist/assets/college-logo-B5J1bvCK.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
2
counter-frontend/dist/assets/index-8tt0cn-G.css
vendored
Normal file
2
counter-frontend/dist/assets/index-8tt0cn-G.css
vendored
Normal file
File diff suppressed because one or more lines are too long
99
counter-frontend/dist/assets/index-C3UP9F-T.js
vendored
Normal file
99
counter-frontend/dist/assets/index-C3UP9F-T.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
counter-frontend/dist/assets/ritchennai-jdoyOWFh.webp
vendored
Normal file
BIN
counter-frontend/dist/assets/ritchennai-jdoyOWFh.webp
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
BIN
counter-frontend/dist/assets/tillo_spinner-CB6jjk74.gif
vendored
Normal file
BIN
counter-frontend/dist/assets/tillo_spinner-CB6jjk74.gif
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.8 MiB |
14
counter-frontend/dist/index.html
vendored
Normal file
14
counter-frontend/dist/index.html
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>Counter POS</title>
|
||||||
|
<script type="module" crossorigin src="/assets/index-C3UP9F-T.js"></script>
|
||||||
|
<link rel="stylesheet" crossorigin href="/assets/index-8tt0cn-G.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
1
counter-frontend/node_modules/.bin/acorn
generated
vendored
Symbolic link
1
counter-frontend/node_modules/.bin/acorn
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../acorn/bin/acorn
|
||||||
1
counter-frontend/node_modules/.bin/autoprefixer
generated
vendored
Symbolic link
1
counter-frontend/node_modules/.bin/autoprefixer
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../autoprefixer/bin/autoprefixer
|
||||||
1
counter-frontend/node_modules/.bin/baseline-browser-mapping
generated
vendored
Symbolic link
1
counter-frontend/node_modules/.bin/baseline-browser-mapping
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../baseline-browser-mapping/dist/cli.cjs
|
||||||
1
counter-frontend/node_modules/.bin/browserslist
generated
vendored
Symbolic link
1
counter-frontend/node_modules/.bin/browserslist
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../browserslist/cli.js
|
||||||
1
counter-frontend/node_modules/.bin/eslint
generated
vendored
Symbolic link
1
counter-frontend/node_modules/.bin/eslint
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../eslint/bin/eslint.js
|
||||||
1
counter-frontend/node_modules/.bin/jiti
generated
vendored
Symbolic link
1
counter-frontend/node_modules/.bin/jiti
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../jiti/lib/jiti-cli.mjs
|
||||||
1
counter-frontend/node_modules/.bin/js-yaml
generated
vendored
Symbolic link
1
counter-frontend/node_modules/.bin/js-yaml
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../js-yaml/bin/js-yaml.js
|
||||||
1
counter-frontend/node_modules/.bin/jsesc
generated
vendored
Symbolic link
1
counter-frontend/node_modules/.bin/jsesc
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../jsesc/bin/jsesc
|
||||||
1
counter-frontend/node_modules/.bin/json5
generated
vendored
Symbolic link
1
counter-frontend/node_modules/.bin/json5
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../json5/lib/cli.js
|
||||||
1
counter-frontend/node_modules/.bin/nanoid
generated
vendored
Symbolic link
1
counter-frontend/node_modules/.bin/nanoid
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../nanoid/bin/nanoid.cjs
|
||||||
1
counter-frontend/node_modules/.bin/node-which
generated
vendored
Symbolic link
1
counter-frontend/node_modules/.bin/node-which
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../which/bin/node-which
|
||||||
1
counter-frontend/node_modules/.bin/parser
generated
vendored
Symbolic link
1
counter-frontend/node_modules/.bin/parser
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../@babel/parser/bin/babel-parser.js
|
||||||
1
counter-frontend/node_modules/.bin/rolldown
generated
vendored
Symbolic link
1
counter-frontend/node_modules/.bin/rolldown
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../rolldown/bin/cli.mjs
|
||||||
1
counter-frontend/node_modules/.bin/semver
generated
vendored
Symbolic link
1
counter-frontend/node_modules/.bin/semver
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../semver/bin/semver.js
|
||||||
1
counter-frontend/node_modules/.bin/tsc
generated
vendored
Symbolic link
1
counter-frontend/node_modules/.bin/tsc
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../typescript/bin/tsc
|
||||||
1
counter-frontend/node_modules/.bin/tsserver
generated
vendored
Symbolic link
1
counter-frontend/node_modules/.bin/tsserver
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../typescript/bin/tsserver
|
||||||
1
counter-frontend/node_modules/.bin/update-browserslist-db
generated
vendored
Symbolic link
1
counter-frontend/node_modules/.bin/update-browserslist-db
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../update-browserslist-db/cli.js
|
||||||
1
counter-frontend/node_modules/.bin/vite
generated
vendored
Symbolic link
1
counter-frontend/node_modules/.bin/vite
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../vite/bin/vite.js
|
||||||
2870
counter-frontend/node_modules/.package-lock.json
generated
vendored
Normal file
2870
counter-frontend/node_modules/.package-lock.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
74
counter-frontend/node_modules/.vite/deps/_metadata.json
generated
vendored
Normal file
74
counter-frontend/node_modules/.vite/deps/_metadata.json
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
{
|
||||||
|
"hash": "9cdbac26",
|
||||||
|
"configHash": "315230d9",
|
||||||
|
"lockfileHash": "e081472a",
|
||||||
|
"browserHash": "6b7b94cf",
|
||||||
|
"optimized": {
|
||||||
|
"date-fns": {
|
||||||
|
"src": "../../date-fns/index.js",
|
||||||
|
"file": "date-fns.js",
|
||||||
|
"fileHash": "2ee4f16f",
|
||||||
|
"needsInterop": false
|
||||||
|
},
|
||||||
|
"framer-motion": {
|
||||||
|
"src": "../../framer-motion/dist/es/index.mjs",
|
||||||
|
"file": "framer-motion.js",
|
||||||
|
"fileHash": "64e1429b",
|
||||||
|
"needsInterop": false
|
||||||
|
},
|
||||||
|
"lucide-react": {
|
||||||
|
"src": "../../lucide-react/dist/esm/lucide-react.js",
|
||||||
|
"file": "lucide-react.js",
|
||||||
|
"fileHash": "712bfbf0",
|
||||||
|
"needsInterop": false
|
||||||
|
},
|
||||||
|
"qrcode.react": {
|
||||||
|
"src": "../../qrcode.react/lib/esm/index.js",
|
||||||
|
"file": "qrcode__react.js",
|
||||||
|
"fileHash": "8f444abd",
|
||||||
|
"needsInterop": false
|
||||||
|
},
|
||||||
|
"react-dom": {
|
||||||
|
"src": "../../react-dom/index.js",
|
||||||
|
"file": "react-dom.js",
|
||||||
|
"fileHash": "c940c610",
|
||||||
|
"needsInterop": true
|
||||||
|
},
|
||||||
|
"react-dom/client": {
|
||||||
|
"src": "../../react-dom/client.js",
|
||||||
|
"file": "react-dom_client.js",
|
||||||
|
"fileHash": "58ab655a",
|
||||||
|
"needsInterop": true
|
||||||
|
},
|
||||||
|
"react-router-dom": {
|
||||||
|
"src": "../../react-router-dom/dist/index.mjs",
|
||||||
|
"file": "react-router-dom.js",
|
||||||
|
"fileHash": "ae3c0c04",
|
||||||
|
"needsInterop": false
|
||||||
|
},
|
||||||
|
"react": {
|
||||||
|
"src": "../../react/index.js",
|
||||||
|
"file": "react.js",
|
||||||
|
"fileHash": "92583b6b",
|
||||||
|
"needsInterop": true
|
||||||
|
},
|
||||||
|
"react/jsx-dev-runtime": {
|
||||||
|
"src": "../../react/jsx-dev-runtime.js",
|
||||||
|
"file": "react_jsx-dev-runtime.js",
|
||||||
|
"fileHash": "ae51fb87",
|
||||||
|
"needsInterop": true
|
||||||
|
},
|
||||||
|
"react/jsx-runtime": {
|
||||||
|
"src": "../../react/jsx-runtime.js",
|
||||||
|
"file": "react_jsx-runtime.js",
|
||||||
|
"fileHash": "34707780",
|
||||||
|
"needsInterop": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"chunks": {
|
||||||
|
"react-QWdP705l": {
|
||||||
|
"file": "react-QWdP705l.js",
|
||||||
|
"isDynamicEntry": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12789
counter-frontend/node_modules/.vite/deps/date-fns.js
generated
vendored
Normal file
12789
counter-frontend/node_modules/.vite/deps/date-fns.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
counter-frontend/node_modules/.vite/deps/date-fns.js.map
generated
vendored
Normal file
1
counter-frontend/node_modules/.vite/deps/date-fns.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
13792
counter-frontend/node_modules/.vite/deps/framer-motion.js
generated
vendored
Normal file
13792
counter-frontend/node_modules/.vite/deps/framer-motion.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
counter-frontend/node_modules/.vite/deps/framer-motion.js.map
generated
vendored
Normal file
1
counter-frontend/node_modules/.vite/deps/framer-motion.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
44548
counter-frontend/node_modules/.vite/deps/lucide-react.js
generated
vendored
Normal file
44548
counter-frontend/node_modules/.vite/deps/lucide-react.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
counter-frontend/node_modules/.vite/deps/lucide-react.js.map
generated
vendored
Normal file
1
counter-frontend/node_modules/.vite/deps/lucide-react.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
counter-frontend/node_modules/.vite/deps/package.json
generated
vendored
Normal file
3
counter-frontend/node_modules/.vite/deps/package.json
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
1186
counter-frontend/node_modules/.vite/deps/qrcode__react.js
generated
vendored
Normal file
1186
counter-frontend/node_modules/.vite/deps/qrcode__react.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
counter-frontend/node_modules/.vite/deps/qrcode__react.js.map
generated
vendored
Normal file
1
counter-frontend/node_modules/.vite/deps/qrcode__react.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
799
counter-frontend/node_modules/.vite/deps/react-QWdP705l.js
generated
vendored
Normal file
799
counter-frontend/node_modules/.vite/deps/react-QWdP705l.js
generated
vendored
Normal file
@@ -0,0 +1,799 @@
|
|||||||
|
//#region \0rolldown/runtime.js
|
||||||
|
var __create = Object.create;
|
||||||
|
var __defProp = Object.defineProperty;
|
||||||
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||||
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||||
|
var __getProtoOf = Object.getPrototypeOf;
|
||||||
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||||
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
||||||
|
var __exportAll = (all, no_symbols) => {
|
||||||
|
let target = {};
|
||||||
|
for (var name in all) __defProp(target, name, {
|
||||||
|
get: all[name],
|
||||||
|
enumerable: true
|
||||||
|
});
|
||||||
|
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
||||||
|
return target;
|
||||||
|
};
|
||||||
|
var __copyProps = (to, from, except, desc) => {
|
||||||
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
||||||
|
key = keys[i];
|
||||||
|
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
||||||
|
get: ((k) => from[k]).bind(null, key),
|
||||||
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
};
|
||||||
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
||||||
|
value: mod,
|
||||||
|
enumerable: true
|
||||||
|
}) : target, mod));
|
||||||
|
//#endregion
|
||||||
|
//#region node_modules/react/cjs/react.development.js
|
||||||
|
/**
|
||||||
|
* @license React
|
||||||
|
* react.development.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
var require_react_development = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||||
|
(function() {
|
||||||
|
function defineDeprecationWarning(methodName, info) {
|
||||||
|
Object.defineProperty(Component.prototype, methodName, { get: function() {
|
||||||
|
console.warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);
|
||||||
|
} });
|
||||||
|
}
|
||||||
|
function getIteratorFn(maybeIterable) {
|
||||||
|
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
||||||
|
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
||||||
|
return "function" === typeof maybeIterable ? maybeIterable : null;
|
||||||
|
}
|
||||||
|
function warnNoop(publicInstance, callerName) {
|
||||||
|
publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
|
||||||
|
var warningKey = publicInstance + "." + callerName;
|
||||||
|
didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, publicInstance), didWarnStateUpdateForUnmountedComponent[warningKey] = !0);
|
||||||
|
}
|
||||||
|
function Component(props, context, updater) {
|
||||||
|
this.props = props;
|
||||||
|
this.context = context;
|
||||||
|
this.refs = emptyObject;
|
||||||
|
this.updater = updater || ReactNoopUpdateQueue;
|
||||||
|
}
|
||||||
|
function ComponentDummy() {}
|
||||||
|
function PureComponent(props, context, updater) {
|
||||||
|
this.props = props;
|
||||||
|
this.context = context;
|
||||||
|
this.refs = emptyObject;
|
||||||
|
this.updater = updater || ReactNoopUpdateQueue;
|
||||||
|
}
|
||||||
|
function noop() {}
|
||||||
|
function testStringCoercion(value) {
|
||||||
|
return "" + value;
|
||||||
|
}
|
||||||
|
function checkKeyStringCoercion(value) {
|
||||||
|
try {
|
||||||
|
testStringCoercion(value);
|
||||||
|
var JSCompiler_inline_result = !1;
|
||||||
|
} catch (e) {
|
||||||
|
JSCompiler_inline_result = !0;
|
||||||
|
}
|
||||||
|
if (JSCompiler_inline_result) {
|
||||||
|
JSCompiler_inline_result = console;
|
||||||
|
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
||||||
|
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
||||||
|
JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
|
||||||
|
return testStringCoercion(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getComponentNameFromType(type) {
|
||||||
|
if (null == type) return null;
|
||||||
|
if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
||||||
|
if ("string" === typeof type) return type;
|
||||||
|
switch (type) {
|
||||||
|
case REACT_FRAGMENT_TYPE: return "Fragment";
|
||||||
|
case REACT_PROFILER_TYPE: return "Profiler";
|
||||||
|
case REACT_STRICT_MODE_TYPE: return "StrictMode";
|
||||||
|
case REACT_SUSPENSE_TYPE: return "Suspense";
|
||||||
|
case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList";
|
||||||
|
case REACT_ACTIVITY_TYPE: return "Activity";
|
||||||
|
}
|
||||||
|
if ("object" === typeof type) switch ("number" === typeof type.tag && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof) {
|
||||||
|
case REACT_PORTAL_TYPE: return "Portal";
|
||||||
|
case REACT_CONTEXT_TYPE: return type.displayName || "Context";
|
||||||
|
case REACT_CONSUMER_TYPE: return (type._context.displayName || "Context") + ".Consumer";
|
||||||
|
case REACT_FORWARD_REF_TYPE:
|
||||||
|
var innerType = type.render;
|
||||||
|
type = type.displayName;
|
||||||
|
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
||||||
|
return type;
|
||||||
|
case REACT_MEMO_TYPE: return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
||||||
|
case REACT_LAZY_TYPE:
|
||||||
|
innerType = type._payload;
|
||||||
|
type = type._init;
|
||||||
|
try {
|
||||||
|
return getComponentNameFromType(type(innerType));
|
||||||
|
} catch (x) {}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
function getTaskName(type) {
|
||||||
|
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
||||||
|
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>";
|
||||||
|
try {
|
||||||
|
var name = getComponentNameFromType(type);
|
||||||
|
return name ? "<" + name + ">" : "<...>";
|
||||||
|
} catch (x) {
|
||||||
|
return "<...>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getOwner() {
|
||||||
|
var dispatcher = ReactSharedInternals.A;
|
||||||
|
return null === dispatcher ? null : dispatcher.getOwner();
|
||||||
|
}
|
||||||
|
function UnknownOwner() {
|
||||||
|
return Error("react-stack-top-frame");
|
||||||
|
}
|
||||||
|
function hasValidKey(config) {
|
||||||
|
if (hasOwnProperty.call(config, "key")) {
|
||||||
|
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
||||||
|
if (getter && getter.isReactWarning) return !1;
|
||||||
|
}
|
||||||
|
return void 0 !== config.key;
|
||||||
|
}
|
||||||
|
function defineKeyPropWarningGetter(props, displayName) {
|
||||||
|
function warnAboutAccessingKey() {
|
||||||
|
specialPropKeyWarningShown || (specialPropKeyWarningShown = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName));
|
||||||
|
}
|
||||||
|
warnAboutAccessingKey.isReactWarning = !0;
|
||||||
|
Object.defineProperty(props, "key", {
|
||||||
|
get: warnAboutAccessingKey,
|
||||||
|
configurable: !0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function elementRefGetterWithDeprecationWarning() {
|
||||||
|
var componentName = getComponentNameFromType(this.type);
|
||||||
|
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
|
||||||
|
componentName = this.props.ref;
|
||||||
|
return void 0 !== componentName ? componentName : null;
|
||||||
|
}
|
||||||
|
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
||||||
|
var refProp = props.ref;
|
||||||
|
type = {
|
||||||
|
$$typeof: REACT_ELEMENT_TYPE,
|
||||||
|
type,
|
||||||
|
key,
|
||||||
|
props,
|
||||||
|
_owner: owner
|
||||||
|
};
|
||||||
|
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
||||||
|
enumerable: !1,
|
||||||
|
get: elementRefGetterWithDeprecationWarning
|
||||||
|
}) : Object.defineProperty(type, "ref", {
|
||||||
|
enumerable: !1,
|
||||||
|
value: null
|
||||||
|
});
|
||||||
|
type._store = {};
|
||||||
|
Object.defineProperty(type._store, "validated", {
|
||||||
|
configurable: !1,
|
||||||
|
enumerable: !1,
|
||||||
|
writable: !0,
|
||||||
|
value: 0
|
||||||
|
});
|
||||||
|
Object.defineProperty(type, "_debugInfo", {
|
||||||
|
configurable: !1,
|
||||||
|
enumerable: !1,
|
||||||
|
writable: !0,
|
||||||
|
value: null
|
||||||
|
});
|
||||||
|
Object.defineProperty(type, "_debugStack", {
|
||||||
|
configurable: !1,
|
||||||
|
enumerable: !1,
|
||||||
|
writable: !0,
|
||||||
|
value: debugStack
|
||||||
|
});
|
||||||
|
Object.defineProperty(type, "_debugTask", {
|
||||||
|
configurable: !1,
|
||||||
|
enumerable: !1,
|
||||||
|
writable: !0,
|
||||||
|
value: debugTask
|
||||||
|
});
|
||||||
|
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
function cloneAndReplaceKey(oldElement, newKey) {
|
||||||
|
newKey = ReactElement(oldElement.type, newKey, oldElement.props, oldElement._owner, oldElement._debugStack, oldElement._debugTask);
|
||||||
|
oldElement._store && (newKey._store.validated = oldElement._store.validated);
|
||||||
|
return newKey;
|
||||||
|
}
|
||||||
|
function validateChildKeys(node) {
|
||||||
|
isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
|
||||||
|
}
|
||||||
|
function isValidElement(object) {
|
||||||
|
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
||||||
|
}
|
||||||
|
function escape(key) {
|
||||||
|
var escaperLookup = {
|
||||||
|
"=": "=0",
|
||||||
|
":": "=2"
|
||||||
|
};
|
||||||
|
return "$" + key.replace(/[=:]/g, function(match) {
|
||||||
|
return escaperLookup[match];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function getElementKey(element, index) {
|
||||||
|
return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
|
||||||
|
}
|
||||||
|
function resolveThenable(thenable) {
|
||||||
|
switch (thenable.status) {
|
||||||
|
case "fulfilled": return thenable.value;
|
||||||
|
case "rejected": throw thenable.reason;
|
||||||
|
default: switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(function(fulfilledValue) {
|
||||||
|
"pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
|
||||||
|
}, function(error) {
|
||||||
|
"pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
||||||
|
})), thenable.status) {
|
||||||
|
case "fulfilled": return thenable.value;
|
||||||
|
case "rejected": throw thenable.reason;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw thenable;
|
||||||
|
}
|
||||||
|
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
||||||
|
var type = typeof children;
|
||||||
|
if ("undefined" === type || "boolean" === type) children = null;
|
||||||
|
var invokeCallback = !1;
|
||||||
|
if (null === children) invokeCallback = !0;
|
||||||
|
else switch (type) {
|
||||||
|
case "bigint":
|
||||||
|
case "string":
|
||||||
|
case "number":
|
||||||
|
invokeCallback = !0;
|
||||||
|
break;
|
||||||
|
case "object": switch (children.$$typeof) {
|
||||||
|
case REACT_ELEMENT_TYPE:
|
||||||
|
case REACT_PORTAL_TYPE:
|
||||||
|
invokeCallback = !0;
|
||||||
|
break;
|
||||||
|
case REACT_LAZY_TYPE: return invokeCallback = children._init, mapIntoArray(invokeCallback(children._payload), array, escapedPrefix, nameSoFar, callback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (invokeCallback) {
|
||||||
|
invokeCallback = children;
|
||||||
|
callback = callback(invokeCallback);
|
||||||
|
var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
|
||||||
|
isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
|
||||||
|
return c;
|
||||||
|
})) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(callback, escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(userProvidedKeyEscapeRegex, "$&/") + "/") + childKey), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
invokeCallback = 0;
|
||||||
|
childKey = "" === nameSoFar ? "." : nameSoFar + ":";
|
||||||
|
if (isArrayImpl(children)) for (var i = 0; i < children.length; i++) nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(nameSoFar, array, escapedPrefix, type, callback);
|
||||||
|
else if (i = getIteratorFn(children), "function" === typeof i) for (i === children.entries && (didWarnAboutMaps || console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."), didWarnAboutMaps = !0), children = i.call(children), i = 0; !(nameSoFar = children.next()).done;) nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(nameSoFar, array, escapedPrefix, type, callback);
|
||||||
|
else if ("object" === type) {
|
||||||
|
if ("function" === typeof children.then) return mapIntoArray(resolveThenable(children), array, escapedPrefix, nameSoFar, callback);
|
||||||
|
array = String(children);
|
||||||
|
throw Error("Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead.");
|
||||||
|
}
|
||||||
|
return invokeCallback;
|
||||||
|
}
|
||||||
|
function mapChildren(children, func, context) {
|
||||||
|
if (null == children) return children;
|
||||||
|
var result = [], count = 0;
|
||||||
|
mapIntoArray(children, result, "", "", function(child) {
|
||||||
|
return func.call(context, child, count++);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
function lazyInitializer(payload) {
|
||||||
|
if (-1 === payload._status) {
|
||||||
|
var ioInfo = payload._ioInfo;
|
||||||
|
null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());
|
||||||
|
ioInfo = payload._result;
|
||||||
|
var thenable = ioInfo();
|
||||||
|
thenable.then(function(moduleObject) {
|
||||||
|
if (0 === payload._status || -1 === payload._status) {
|
||||||
|
payload._status = 1;
|
||||||
|
payload._result = moduleObject;
|
||||||
|
var _ioInfo = payload._ioInfo;
|
||||||
|
null != _ioInfo && (_ioInfo.end = performance.now());
|
||||||
|
void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
|
||||||
|
}
|
||||||
|
}, function(error) {
|
||||||
|
if (0 === payload._status || -1 === payload._status) {
|
||||||
|
payload._status = 2;
|
||||||
|
payload._result = error;
|
||||||
|
var _ioInfo2 = payload._ioInfo;
|
||||||
|
null != _ioInfo2 && (_ioInfo2.end = performance.now());
|
||||||
|
void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ioInfo = payload._ioInfo;
|
||||||
|
if (null != ioInfo) {
|
||||||
|
ioInfo.value = thenable;
|
||||||
|
var displayName = thenable.displayName;
|
||||||
|
"string" === typeof displayName && (ioInfo.name = displayName);
|
||||||
|
}
|
||||||
|
-1 === payload._status && (payload._status = 0, payload._result = thenable);
|
||||||
|
}
|
||||||
|
if (1 === payload._status) return ioInfo = payload._result, void 0 === ioInfo && console.error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", ioInfo), "default" in ioInfo || console.error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", ioInfo), ioInfo.default;
|
||||||
|
throw payload._result;
|
||||||
|
}
|
||||||
|
function resolveDispatcher() {
|
||||||
|
var dispatcher = ReactSharedInternals.H;
|
||||||
|
null === dispatcher && console.error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.");
|
||||||
|
return dispatcher;
|
||||||
|
}
|
||||||
|
function releaseAsyncTransition() {
|
||||||
|
ReactSharedInternals.asyncTransitions--;
|
||||||
|
}
|
||||||
|
function enqueueTask(task) {
|
||||||
|
if (null === enqueueTaskImpl) try {
|
||||||
|
var requireString = ("require" + Math.random()).slice(0, 7);
|
||||||
|
enqueueTaskImpl = (module && module[requireString]).call(module, "timers").setImmediate;
|
||||||
|
} catch (_err) {
|
||||||
|
enqueueTaskImpl = function(callback) {
|
||||||
|
!1 === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = !0, "undefined" === typeof MessageChannel && console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));
|
||||||
|
var channel = new MessageChannel();
|
||||||
|
channel.port1.onmessage = callback;
|
||||||
|
channel.port2.postMessage(void 0);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return enqueueTaskImpl(task);
|
||||||
|
}
|
||||||
|
function aggregateErrors(errors) {
|
||||||
|
return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
|
||||||
|
}
|
||||||
|
function popActScope(prevActQueue, prevActScopeDepth) {
|
||||||
|
prevActScopeDepth !== actScopeDepth - 1 && console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");
|
||||||
|
actScopeDepth = prevActScopeDepth;
|
||||||
|
}
|
||||||
|
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
||||||
|
var queue = ReactSharedInternals.actQueue;
|
||||||
|
if (null !== queue) if (0 !== queue.length) try {
|
||||||
|
flushActQueue(queue);
|
||||||
|
enqueueTask(function() {
|
||||||
|
return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
} catch (error) {
|
||||||
|
ReactSharedInternals.thrownErrors.push(error);
|
||||||
|
}
|
||||||
|
else ReactSharedInternals.actQueue = null;
|
||||||
|
0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
|
||||||
|
}
|
||||||
|
function flushActQueue(queue) {
|
||||||
|
if (!isFlushing) {
|
||||||
|
isFlushing = !0;
|
||||||
|
var i = 0;
|
||||||
|
try {
|
||||||
|
for (; i < queue.length; i++) {
|
||||||
|
var callback = queue[i];
|
||||||
|
do {
|
||||||
|
ReactSharedInternals.didUsePromise = !1;
|
||||||
|
var continuation = callback(!1);
|
||||||
|
if (null !== continuation) {
|
||||||
|
if (ReactSharedInternals.didUsePromise) {
|
||||||
|
queue[i] = callback;
|
||||||
|
queue.splice(0, i);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
callback = continuation;
|
||||||
|
} else break;
|
||||||
|
} while (1);
|
||||||
|
}
|
||||||
|
queue.length = 0;
|
||||||
|
} catch (error) {
|
||||||
|
queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
|
||||||
|
} finally {
|
||||||
|
isFlushing = !1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
||||||
|
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
|
||||||
|
isMounted: function() {
|
||||||
|
return !1;
|
||||||
|
},
|
||||||
|
enqueueForceUpdate: function(publicInstance) {
|
||||||
|
warnNoop(publicInstance, "forceUpdate");
|
||||||
|
},
|
||||||
|
enqueueReplaceState: function(publicInstance) {
|
||||||
|
warnNoop(publicInstance, "replaceState");
|
||||||
|
},
|
||||||
|
enqueueSetState: function(publicInstance) {
|
||||||
|
warnNoop(publicInstance, "setState");
|
||||||
|
}
|
||||||
|
}, assign = Object.assign, emptyObject = {};
|
||||||
|
Object.freeze(emptyObject);
|
||||||
|
Component.prototype.isReactComponent = {};
|
||||||
|
Component.prototype.setState = function(partialState, callback) {
|
||||||
|
if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState) throw Error("takes an object of state variables to update or a function which returns an object of state variables.");
|
||||||
|
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
||||||
|
};
|
||||||
|
Component.prototype.forceUpdate = function(callback) {
|
||||||
|
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
||||||
|
};
|
||||||
|
var deprecatedAPIs = {
|
||||||
|
isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
|
||||||
|
replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
|
||||||
|
};
|
||||||
|
for (fnName in deprecatedAPIs) deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
||||||
|
ComponentDummy.prototype = Component.prototype;
|
||||||
|
deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
|
||||||
|
deprecatedAPIs.constructor = PureComponent;
|
||||||
|
assign(deprecatedAPIs, Component.prototype);
|
||||||
|
deprecatedAPIs.isPureReactComponent = !0;
|
||||||
|
var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = {
|
||||||
|
H: null,
|
||||||
|
A: null,
|
||||||
|
T: null,
|
||||||
|
S: null,
|
||||||
|
actQueue: null,
|
||||||
|
asyncTransitions: 0,
|
||||||
|
isBatchingLegacy: !1,
|
||||||
|
didScheduleLegacyUpdate: !1,
|
||||||
|
didUsePromise: !1,
|
||||||
|
thrownErrors: [],
|
||||||
|
getCurrentStack: null,
|
||||||
|
recentlyCreatedOwnerStacks: 0
|
||||||
|
}, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
deprecatedAPIs = { react_stack_bottom_frame: function(callStackForError) {
|
||||||
|
return callStackForError();
|
||||||
|
} };
|
||||||
|
var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
|
||||||
|
var didWarnAboutElementRef = {};
|
||||||
|
var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(deprecatedAPIs, UnknownOwner)();
|
||||||
|
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
||||||
|
var didWarnAboutMaps = !1, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
|
||||||
|
if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
|
||||||
|
var event = new window.ErrorEvent("error", {
|
||||||
|
bubbles: !0,
|
||||||
|
cancelable: !0,
|
||||||
|
message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
|
||||||
|
error
|
||||||
|
});
|
||||||
|
if (!window.dispatchEvent(event)) return;
|
||||||
|
} else if ("object" === typeof process && "function" === typeof process.emit) {
|
||||||
|
process.emit("uncaughtException", error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.error(error);
|
||||||
|
}, didWarnAboutMessageChannel = !1, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = !1, isFlushing = !1, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
|
||||||
|
queueMicrotask(function() {
|
||||||
|
return queueMicrotask(callback);
|
||||||
|
});
|
||||||
|
} : enqueueTask;
|
||||||
|
deprecatedAPIs = Object.freeze({
|
||||||
|
__proto__: null,
|
||||||
|
c: function(size) {
|
||||||
|
return resolveDispatcher().useMemoCache(size);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var fnName = {
|
||||||
|
map: mapChildren,
|
||||||
|
forEach: function(children, forEachFunc, forEachContext) {
|
||||||
|
mapChildren(children, function() {
|
||||||
|
forEachFunc.apply(this, arguments);
|
||||||
|
}, forEachContext);
|
||||||
|
},
|
||||||
|
count: function(children) {
|
||||||
|
var n = 0;
|
||||||
|
mapChildren(children, function() {
|
||||||
|
n++;
|
||||||
|
});
|
||||||
|
return n;
|
||||||
|
},
|
||||||
|
toArray: function(children) {
|
||||||
|
return mapChildren(children, function(child) {
|
||||||
|
return child;
|
||||||
|
}) || [];
|
||||||
|
},
|
||||||
|
only: function(children) {
|
||||||
|
if (!isValidElement(children)) throw Error("React.Children.only expected to receive a single React element child.");
|
||||||
|
return children;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.Activity = REACT_ACTIVITY_TYPE;
|
||||||
|
exports.Children = fnName;
|
||||||
|
exports.Component = Component;
|
||||||
|
exports.Fragment = REACT_FRAGMENT_TYPE;
|
||||||
|
exports.Profiler = REACT_PROFILER_TYPE;
|
||||||
|
exports.PureComponent = PureComponent;
|
||||||
|
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
||||||
|
exports.Suspense = REACT_SUSPENSE_TYPE;
|
||||||
|
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
||||||
|
exports.__COMPILER_RUNTIME = deprecatedAPIs;
|
||||||
|
exports.act = function(callback) {
|
||||||
|
var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
|
||||||
|
actScopeDepth++;
|
||||||
|
var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = !1;
|
||||||
|
try {
|
||||||
|
var result = callback();
|
||||||
|
} catch (error) {
|
||||||
|
ReactSharedInternals.thrownErrors.push(error);
|
||||||
|
}
|
||||||
|
if (0 < ReactSharedInternals.thrownErrors.length) throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
||||||
|
if (null !== result && "object" === typeof result && "function" === typeof result.then) {
|
||||||
|
var thenable = result;
|
||||||
|
queueSeveralMicrotasks(function() {
|
||||||
|
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = !0, console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"));
|
||||||
|
});
|
||||||
|
return { then: function(resolve, reject) {
|
||||||
|
didAwaitActCall = !0;
|
||||||
|
thenable.then(function(returnValue) {
|
||||||
|
popActScope(prevActQueue, prevActScopeDepth);
|
||||||
|
if (0 === prevActScopeDepth) {
|
||||||
|
try {
|
||||||
|
flushActQueue(queue), enqueueTask(function() {
|
||||||
|
return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
||||||
|
});
|
||||||
|
} catch (error$0) {
|
||||||
|
ReactSharedInternals.thrownErrors.push(error$0);
|
||||||
|
}
|
||||||
|
if (0 < ReactSharedInternals.thrownErrors.length) {
|
||||||
|
var _thrownError = aggregateErrors(ReactSharedInternals.thrownErrors);
|
||||||
|
ReactSharedInternals.thrownErrors.length = 0;
|
||||||
|
reject(_thrownError);
|
||||||
|
}
|
||||||
|
} else resolve(returnValue);
|
||||||
|
}, function(error) {
|
||||||
|
popActScope(prevActQueue, prevActScopeDepth);
|
||||||
|
0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
|
||||||
|
});
|
||||||
|
} };
|
||||||
|
}
|
||||||
|
var returnValue$jscomp$0 = result;
|
||||||
|
popActScope(prevActQueue, prevActScopeDepth);
|
||||||
|
0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
|
||||||
|
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = !0, console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"));
|
||||||
|
}), ReactSharedInternals.actQueue = null);
|
||||||
|
if (0 < ReactSharedInternals.thrownErrors.length) throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
||||||
|
return { then: function(resolve, reject) {
|
||||||
|
didAwaitActCall = !0;
|
||||||
|
0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
|
||||||
|
return recursivelyFlushAsyncActWork(returnValue$jscomp$0, resolve, reject);
|
||||||
|
})) : resolve(returnValue$jscomp$0);
|
||||||
|
} };
|
||||||
|
};
|
||||||
|
exports.cache = function(fn) {
|
||||||
|
return function() {
|
||||||
|
return fn.apply(null, arguments);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
exports.cacheSignal = function() {
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
exports.captureOwnerStack = function() {
|
||||||
|
var getCurrentStack = ReactSharedInternals.getCurrentStack;
|
||||||
|
return null === getCurrentStack ? null : getCurrentStack();
|
||||||
|
};
|
||||||
|
exports.cloneElement = function(element, config, children) {
|
||||||
|
if (null === element || void 0 === element) throw Error("The argument must be a React element, but you passed " + element + ".");
|
||||||
|
var props = assign({}, element.props), key = element.key, owner = element._owner;
|
||||||
|
if (null != config) {
|
||||||
|
var JSCompiler_inline_result;
|
||||||
|
a: {
|
||||||
|
if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(config, "ref").get) && JSCompiler_inline_result.isReactWarning) {
|
||||||
|
JSCompiler_inline_result = !1;
|
||||||
|
break a;
|
||||||
|
}
|
||||||
|
JSCompiler_inline_result = void 0 !== config.ref;
|
||||||
|
}
|
||||||
|
JSCompiler_inline_result && (owner = getOwner());
|
||||||
|
hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
|
||||||
|
for (propName in config) !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
|
||||||
|
}
|
||||||
|
var propName = arguments.length - 2;
|
||||||
|
if (1 === propName) props.children = children;
|
||||||
|
else if (1 < propName) {
|
||||||
|
JSCompiler_inline_result = Array(propName);
|
||||||
|
for (var i = 0; i < propName; i++) JSCompiler_inline_result[i] = arguments[i + 2];
|
||||||
|
props.children = JSCompiler_inline_result;
|
||||||
|
}
|
||||||
|
props = ReactElement(element.type, key, props, owner, element._debugStack, element._debugTask);
|
||||||
|
for (key = 2; key < arguments.length; key++) validateChildKeys(arguments[key]);
|
||||||
|
return props;
|
||||||
|
};
|
||||||
|
exports.createContext = function(defaultValue) {
|
||||||
|
defaultValue = {
|
||||||
|
$$typeof: REACT_CONTEXT_TYPE,
|
||||||
|
_currentValue: defaultValue,
|
||||||
|
_currentValue2: defaultValue,
|
||||||
|
_threadCount: 0,
|
||||||
|
Provider: null,
|
||||||
|
Consumer: null
|
||||||
|
};
|
||||||
|
defaultValue.Provider = defaultValue;
|
||||||
|
defaultValue.Consumer = {
|
||||||
|
$$typeof: REACT_CONSUMER_TYPE,
|
||||||
|
_context: defaultValue
|
||||||
|
};
|
||||||
|
defaultValue._currentRenderer = null;
|
||||||
|
defaultValue._currentRenderer2 = null;
|
||||||
|
return defaultValue;
|
||||||
|
};
|
||||||
|
exports.createElement = function(type, config, children) {
|
||||||
|
for (var i = 2; i < arguments.length; i++) validateChildKeys(arguments[i]);
|
||||||
|
i = {};
|
||||||
|
var key = null;
|
||||||
|
if (null != config) for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = !0, console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config) hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
|
||||||
|
var childrenLength = arguments.length - 2;
|
||||||
|
if (1 === childrenLength) i.children = children;
|
||||||
|
else if (1 < childrenLength) {
|
||||||
|
for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++) childArray[_i] = arguments[_i + 2];
|
||||||
|
Object.freeze && Object.freeze(childArray);
|
||||||
|
i.children = childArray;
|
||||||
|
}
|
||||||
|
if (type && type.defaultProps) for (propName in childrenLength = type.defaultProps, childrenLength) void 0 === i[propName] && (i[propName] = childrenLength[propName]);
|
||||||
|
key && defineKeyPropWarningGetter(i, "function" === typeof type ? type.displayName || type.name || "Unknown" : type);
|
||||||
|
var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
||||||
|
return ReactElement(type, key, i, getOwner(), propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack, propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
|
||||||
|
};
|
||||||
|
exports.createRef = function() {
|
||||||
|
var refObject = { current: null };
|
||||||
|
Object.seal(refObject);
|
||||||
|
return refObject;
|
||||||
|
};
|
||||||
|
exports.forwardRef = function(render) {
|
||||||
|
null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).") : "function" !== typeof render ? console.error("forwardRef requires a render function but was given %s.", null === render ? "null" : typeof render) : 0 !== render.length && 2 !== render.length && console.error("forwardRef render functions accept exactly two parameters: props and ref. %s", 1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined.");
|
||||||
|
null != render && null != render.defaultProps && console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");
|
||||||
|
var elementType = {
|
||||||
|
$$typeof: REACT_FORWARD_REF_TYPE,
|
||||||
|
render
|
||||||
|
}, ownName;
|
||||||
|
Object.defineProperty(elementType, "displayName", {
|
||||||
|
enumerable: !1,
|
||||||
|
configurable: !0,
|
||||||
|
get: function() {
|
||||||
|
return ownName;
|
||||||
|
},
|
||||||
|
set: function(name) {
|
||||||
|
ownName = name;
|
||||||
|
render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return elementType;
|
||||||
|
};
|
||||||
|
exports.isValidElement = isValidElement;
|
||||||
|
exports.lazy = function(ctor) {
|
||||||
|
ctor = {
|
||||||
|
_status: -1,
|
||||||
|
_result: ctor
|
||||||
|
};
|
||||||
|
var lazyType = {
|
||||||
|
$$typeof: REACT_LAZY_TYPE,
|
||||||
|
_payload: ctor,
|
||||||
|
_init: lazyInitializer
|
||||||
|
}, ioInfo = {
|
||||||
|
name: "lazy",
|
||||||
|
start: -1,
|
||||||
|
end: -1,
|
||||||
|
value: null,
|
||||||
|
owner: null,
|
||||||
|
debugStack: Error("react-stack-top-frame"),
|
||||||
|
debugTask: console.createTask ? console.createTask("lazy()") : null
|
||||||
|
};
|
||||||
|
ctor._ioInfo = ioInfo;
|
||||||
|
lazyType._debugInfo = [{ awaited: ioInfo }];
|
||||||
|
return lazyType;
|
||||||
|
};
|
||||||
|
exports.memo = function(type, compare) {
|
||||||
|
type ?? console.error("memo: The first argument must be a component. Instead received: %s", null === type ? "null" : typeof type);
|
||||||
|
compare = {
|
||||||
|
$$typeof: REACT_MEMO_TYPE,
|
||||||
|
type,
|
||||||
|
compare: void 0 === compare ? null : compare
|
||||||
|
};
|
||||||
|
var ownName;
|
||||||
|
Object.defineProperty(compare, "displayName", {
|
||||||
|
enumerable: !1,
|
||||||
|
configurable: !0,
|
||||||
|
get: function() {
|
||||||
|
return ownName;
|
||||||
|
},
|
||||||
|
set: function(name) {
|
||||||
|
ownName = name;
|
||||||
|
type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return compare;
|
||||||
|
};
|
||||||
|
exports.startTransition = function(scope) {
|
||||||
|
var prevTransition = ReactSharedInternals.T, currentTransition = {};
|
||||||
|
currentTransition._updatedFibers = /* @__PURE__ */ new Set();
|
||||||
|
ReactSharedInternals.T = currentTransition;
|
||||||
|
try {
|
||||||
|
var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
|
||||||
|
null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
|
||||||
|
"object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop, reportGlobalError));
|
||||||
|
} catch (error) {
|
||||||
|
reportGlobalError(error);
|
||||||
|
} finally {
|
||||||
|
null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.unstable_useCacheRefresh = function() {
|
||||||
|
return resolveDispatcher().useCacheRefresh();
|
||||||
|
};
|
||||||
|
exports.use = function(usable) {
|
||||||
|
return resolveDispatcher().use(usable);
|
||||||
|
};
|
||||||
|
exports.useActionState = function(action, initialState, permalink) {
|
||||||
|
return resolveDispatcher().useActionState(action, initialState, permalink);
|
||||||
|
};
|
||||||
|
exports.useCallback = function(callback, deps) {
|
||||||
|
return resolveDispatcher().useCallback(callback, deps);
|
||||||
|
};
|
||||||
|
exports.useContext = function(Context) {
|
||||||
|
var dispatcher = resolveDispatcher();
|
||||||
|
Context.$$typeof === REACT_CONSUMER_TYPE && console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?");
|
||||||
|
return dispatcher.useContext(Context);
|
||||||
|
};
|
||||||
|
exports.useDebugValue = function(value, formatterFn) {
|
||||||
|
return resolveDispatcher().useDebugValue(value, formatterFn);
|
||||||
|
};
|
||||||
|
exports.useDeferredValue = function(value, initialValue) {
|
||||||
|
return resolveDispatcher().useDeferredValue(value, initialValue);
|
||||||
|
};
|
||||||
|
exports.useEffect = function(create, deps) {
|
||||||
|
create ?? console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?");
|
||||||
|
return resolveDispatcher().useEffect(create, deps);
|
||||||
|
};
|
||||||
|
exports.useEffectEvent = function(callback) {
|
||||||
|
return resolveDispatcher().useEffectEvent(callback);
|
||||||
|
};
|
||||||
|
exports.useId = function() {
|
||||||
|
return resolveDispatcher().useId();
|
||||||
|
};
|
||||||
|
exports.useImperativeHandle = function(ref, create, deps) {
|
||||||
|
return resolveDispatcher().useImperativeHandle(ref, create, deps);
|
||||||
|
};
|
||||||
|
exports.useInsertionEffect = function(create, deps) {
|
||||||
|
create ?? console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?");
|
||||||
|
return resolveDispatcher().useInsertionEffect(create, deps);
|
||||||
|
};
|
||||||
|
exports.useLayoutEffect = function(create, deps) {
|
||||||
|
create ?? console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?");
|
||||||
|
return resolveDispatcher().useLayoutEffect(create, deps);
|
||||||
|
};
|
||||||
|
exports.useMemo = function(create, deps) {
|
||||||
|
return resolveDispatcher().useMemo(create, deps);
|
||||||
|
};
|
||||||
|
exports.useOptimistic = function(passthrough, reducer) {
|
||||||
|
return resolveDispatcher().useOptimistic(passthrough, reducer);
|
||||||
|
};
|
||||||
|
exports.useReducer = function(reducer, initialArg, init) {
|
||||||
|
return resolveDispatcher().useReducer(reducer, initialArg, init);
|
||||||
|
};
|
||||||
|
exports.useRef = function(initialValue) {
|
||||||
|
return resolveDispatcher().useRef(initialValue);
|
||||||
|
};
|
||||||
|
exports.useState = function(initialState) {
|
||||||
|
return resolveDispatcher().useState(initialState);
|
||||||
|
};
|
||||||
|
exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
|
||||||
|
return resolveDispatcher().useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
||||||
|
};
|
||||||
|
exports.useTransition = function() {
|
||||||
|
return resolveDispatcher().useTransition();
|
||||||
|
};
|
||||||
|
exports.version = "19.2.5";
|
||||||
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
||||||
|
})();
|
||||||
|
}));
|
||||||
|
//#endregion
|
||||||
|
//#region node_modules/react/index.js
|
||||||
|
var require_react = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||||
|
module.exports = require_react_development();
|
||||||
|
}));
|
||||||
|
//#endregion
|
||||||
|
export { __toESM as i, __commonJSMin as n, __exportAll as r, require_react as t };
|
||||||
|
|
||||||
|
//# sourceMappingURL=react-QWdP705l.js.map
|
||||||
1
counter-frontend/node_modules/.vite/deps/react-QWdP705l.js.map
generated
vendored
Normal file
1
counter-frontend/node_modules/.vite/deps/react-QWdP705l.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
185
counter-frontend/node_modules/.vite/deps/react-dom.js
generated
vendored
Normal file
185
counter-frontend/node_modules/.vite/deps/react-dom.js
generated
vendored
Normal file
@@ -0,0 +1,185 @@
|
|||||||
|
import { n as __commonJSMin, t as require_react } from "./react-QWdP705l.js";
|
||||||
|
//#region node_modules/react-dom/cjs/react-dom.development.js
|
||||||
|
/**
|
||||||
|
* @license React
|
||||||
|
* react-dom.development.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
var require_react_dom_development = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||||
|
(function() {
|
||||||
|
function noop() {}
|
||||||
|
function testStringCoercion(value) {
|
||||||
|
return "" + value;
|
||||||
|
}
|
||||||
|
function createPortal$1(children, containerInfo, implementation) {
|
||||||
|
var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
|
||||||
|
try {
|
||||||
|
testStringCoercion(key);
|
||||||
|
var JSCompiler_inline_result = !1;
|
||||||
|
} catch (e) {
|
||||||
|
JSCompiler_inline_result = !0;
|
||||||
|
}
|
||||||
|
JSCompiler_inline_result && (console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", "function" === typeof Symbol && Symbol.toStringTag && key[Symbol.toStringTag] || key.constructor.name || "Object"), testStringCoercion(key));
|
||||||
|
return {
|
||||||
|
$$typeof: REACT_PORTAL_TYPE,
|
||||||
|
key: null == key ? null : "" + key,
|
||||||
|
children,
|
||||||
|
containerInfo,
|
||||||
|
implementation
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function getCrossOriginStringAs(as, input) {
|
||||||
|
if ("font" === as) return "";
|
||||||
|
if ("string" === typeof input) return "use-credentials" === input ? input : "";
|
||||||
|
}
|
||||||
|
function getValueDescriptorExpectingObjectForWarning(thing) {
|
||||||
|
return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : "something with type \"" + typeof thing + "\"";
|
||||||
|
}
|
||||||
|
function getValueDescriptorExpectingEnumForWarning(thing) {
|
||||||
|
return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : "string" === typeof thing ? JSON.stringify(thing) : "number" === typeof thing ? "`" + thing + "`" : "something with type \"" + typeof thing + "\"";
|
||||||
|
}
|
||||||
|
function resolveDispatcher() {
|
||||||
|
var dispatcher = ReactSharedInternals.H;
|
||||||
|
null === dispatcher && console.error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.");
|
||||||
|
return dispatcher;
|
||||||
|
}
|
||||||
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
||||||
|
var React = require_react(), Internals = {
|
||||||
|
d: {
|
||||||
|
f: noop,
|
||||||
|
r: function() {
|
||||||
|
throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.");
|
||||||
|
},
|
||||||
|
D: noop,
|
||||||
|
C: noop,
|
||||||
|
L: noop,
|
||||||
|
m: noop,
|
||||||
|
X: noop,
|
||||||
|
S: noop,
|
||||||
|
M: noop
|
||||||
|
},
|
||||||
|
p: 0,
|
||||||
|
findDOMNode: null
|
||||||
|
}, REACT_PORTAL_TYPE = Symbol.for("react.portal"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
||||||
|
"function" === typeof Map && null != Map.prototype && "function" === typeof Map.prototype.forEach && "function" === typeof Set && null != Set.prototype && "function" === typeof Set.prototype.clear && "function" === typeof Set.prototype.forEach || console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
|
||||||
|
exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
|
||||||
|
exports.createPortal = function(children, container) {
|
||||||
|
var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
|
||||||
|
if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType) throw Error("Target container is not a DOM element.");
|
||||||
|
return createPortal$1(children, container, null, key);
|
||||||
|
};
|
||||||
|
exports.flushSync = function(fn) {
|
||||||
|
var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
|
||||||
|
try {
|
||||||
|
if (ReactSharedInternals.T = null, Internals.p = 2, fn) return fn();
|
||||||
|
} finally {
|
||||||
|
ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f() && console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.preconnect = function(href, options) {
|
||||||
|
"string" === typeof href && href ? null != options && "object" !== typeof options ? console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.", getValueDescriptorExpectingEnumForWarning(options)) : null != options && "string" !== typeof options.crossOrigin && console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.", getValueDescriptorExpectingObjectForWarning(options.crossOrigin)) : console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", getValueDescriptorExpectingObjectForWarning(href));
|
||||||
|
"string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
|
||||||
|
};
|
||||||
|
exports.prefetchDNS = function(href) {
|
||||||
|
if ("string" !== typeof href || !href) console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", getValueDescriptorExpectingObjectForWarning(href));
|
||||||
|
else if (1 < arguments.length) {
|
||||||
|
var options = arguments[1];
|
||||||
|
"object" === typeof options && options.hasOwnProperty("crossOrigin") ? console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.", getValueDescriptorExpectingEnumForWarning(options)) : console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.", getValueDescriptorExpectingEnumForWarning(options));
|
||||||
|
}
|
||||||
|
"string" === typeof href && Internals.d.D(href);
|
||||||
|
};
|
||||||
|
exports.preinit = function(href, options) {
|
||||||
|
"string" === typeof href && href ? null == options || "object" !== typeof options ? console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.", getValueDescriptorExpectingEnumForWarning(options)) : "style" !== options.as && "script" !== options.as && console.error("ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are \"style\" and \"script\".", getValueDescriptorExpectingEnumForWarning(options.as)) : console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", getValueDescriptorExpectingObjectForWarning(href));
|
||||||
|
if ("string" === typeof href && options && "string" === typeof options.as) {
|
||||||
|
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
|
||||||
|
"style" === as ? Internals.d.S(href, "string" === typeof options.precedence ? options.precedence : void 0, {
|
||||||
|
crossOrigin,
|
||||||
|
integrity,
|
||||||
|
fetchPriority
|
||||||
|
}) : "script" === as && Internals.d.X(href, {
|
||||||
|
crossOrigin,
|
||||||
|
integrity,
|
||||||
|
fetchPriority,
|
||||||
|
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.preinitModule = function(href, options) {
|
||||||
|
var encountered = "";
|
||||||
|
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
||||||
|
void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "script" !== options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingEnumForWarning(options.as) + ".");
|
||||||
|
if (encountered) console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s", encountered);
|
||||||
|
else switch (encountered = options && "string" === typeof options.as ? options.as : "script", encountered) {
|
||||||
|
case "script": break;
|
||||||
|
default: encountered = getValueDescriptorExpectingEnumForWarning(encountered), console.error("ReactDOM.preinitModule(): Currently the only supported \"as\" type for this function is \"script\" but received \"%s\" instead. This warning was generated for `href` \"%s\". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)", encountered, href);
|
||||||
|
}
|
||||||
|
if ("string" === typeof href) if ("object" === typeof options && null !== options) {
|
||||||
|
if (null == options.as || "script" === options.as) encountered = getCrossOriginStringAs(options.as, options.crossOrigin), Internals.d.M(href, {
|
||||||
|
crossOrigin: encountered,
|
||||||
|
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
||||||
|
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
||||||
|
});
|
||||||
|
} else options ?? Internals.d.M(href);
|
||||||
|
};
|
||||||
|
exports.preload = function(href, options) {
|
||||||
|
var encountered = "";
|
||||||
|
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
||||||
|
null == options || "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : "string" === typeof options.as && options.as || (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
||||||
|
encountered && console.error("ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel=\"preload\" as=\"...\" />` tag.%s", encountered);
|
||||||
|
if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
|
||||||
|
encountered = options.as;
|
||||||
|
var crossOrigin = getCrossOriginStringAs(encountered, options.crossOrigin);
|
||||||
|
Internals.d.L(href, encountered, {
|
||||||
|
crossOrigin,
|
||||||
|
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
||||||
|
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
|
||||||
|
type: "string" === typeof options.type ? options.type : void 0,
|
||||||
|
fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
|
||||||
|
referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
|
||||||
|
imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
|
||||||
|
imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
|
||||||
|
media: "string" === typeof options.media ? options.media : void 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.preloadModule = function(href, options) {
|
||||||
|
var encountered = "";
|
||||||
|
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
||||||
|
void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "string" !== typeof options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
||||||
|
encountered && console.error("ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel=\"modulepreload\" as=\"...\" />` tag.%s", encountered);
|
||||||
|
"string" === typeof href && (options ? (encountered = getCrossOriginStringAs(options.as, options.crossOrigin), Internals.d.m(href, {
|
||||||
|
as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
|
||||||
|
crossOrigin: encountered,
|
||||||
|
integrity: "string" === typeof options.integrity ? options.integrity : void 0
|
||||||
|
})) : Internals.d.m(href));
|
||||||
|
};
|
||||||
|
exports.requestFormReset = function(form) {
|
||||||
|
Internals.d.r(form);
|
||||||
|
};
|
||||||
|
exports.unstable_batchedUpdates = function(fn, a) {
|
||||||
|
return fn(a);
|
||||||
|
};
|
||||||
|
exports.useFormState = function(action, initialState, permalink) {
|
||||||
|
return resolveDispatcher().useFormState(action, initialState, permalink);
|
||||||
|
};
|
||||||
|
exports.useFormStatus = function() {
|
||||||
|
return resolveDispatcher().useHostTransitionStatus();
|
||||||
|
};
|
||||||
|
exports.version = "19.2.5";
|
||||||
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
||||||
|
})();
|
||||||
|
}));
|
||||||
|
//#endregion
|
||||||
|
//#region node_modules/react-dom/index.js
|
||||||
|
var require_react_dom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||||
|
module.exports = require_react_dom_development();
|
||||||
|
}));
|
||||||
|
//#endregion
|
||||||
|
export default require_react_dom();
|
||||||
|
export { require_react_dom as t };
|
||||||
|
|
||||||
|
//# sourceMappingURL=react-dom.js.map
|
||||||
1
counter-frontend/node_modules/.vite/deps/react-dom.js.map
generated
vendored
Normal file
1
counter-frontend/node_modules/.vite/deps/react-dom.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
14384
counter-frontend/node_modules/.vite/deps/react-dom_client.js
generated
vendored
Normal file
14384
counter-frontend/node_modules/.vite/deps/react-dom_client.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
counter-frontend/node_modules/.vite/deps/react-dom_client.js.map
generated
vendored
Normal file
1
counter-frontend/node_modules/.vite/deps/react-dom_client.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
10181
counter-frontend/node_modules/.vite/deps/react-router-dom.js
generated
vendored
Normal file
10181
counter-frontend/node_modules/.vite/deps/react-router-dom.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
counter-frontend/node_modules/.vite/deps/react-router-dom.js.map
generated
vendored
Normal file
1
counter-frontend/node_modules/.vite/deps/react-router-dom.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
counter-frontend/node_modules/.vite/deps/react.js
generated
vendored
Normal file
2
counter-frontend/node_modules/.vite/deps/react.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
import { t as require_react } from "./react-QWdP705l.js";
|
||||||
|
export default require_react();
|
||||||
204
counter-frontend/node_modules/.vite/deps/react_jsx-dev-runtime.js
generated
vendored
Normal file
204
counter-frontend/node_modules/.vite/deps/react_jsx-dev-runtime.js
generated
vendored
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
import { n as __commonJSMin, t as require_react } from "./react-QWdP705l.js";
|
||||||
|
//#region node_modules/react/cjs/react-jsx-dev-runtime.development.js
|
||||||
|
/**
|
||||||
|
* @license React
|
||||||
|
* react-jsx-dev-runtime.development.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
var require_react_jsx_dev_runtime_development = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||||
|
(function() {
|
||||||
|
function getComponentNameFromType(type) {
|
||||||
|
if (null == type) return null;
|
||||||
|
if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
||||||
|
if ("string" === typeof type) return type;
|
||||||
|
switch (type) {
|
||||||
|
case REACT_FRAGMENT_TYPE: return "Fragment";
|
||||||
|
case REACT_PROFILER_TYPE: return "Profiler";
|
||||||
|
case REACT_STRICT_MODE_TYPE: return "StrictMode";
|
||||||
|
case REACT_SUSPENSE_TYPE: return "Suspense";
|
||||||
|
case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList";
|
||||||
|
case REACT_ACTIVITY_TYPE: return "Activity";
|
||||||
|
}
|
||||||
|
if ("object" === typeof type) switch ("number" === typeof type.tag && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof) {
|
||||||
|
case REACT_PORTAL_TYPE: return "Portal";
|
||||||
|
case REACT_CONTEXT_TYPE: return type.displayName || "Context";
|
||||||
|
case REACT_CONSUMER_TYPE: return (type._context.displayName || "Context") + ".Consumer";
|
||||||
|
case REACT_FORWARD_REF_TYPE:
|
||||||
|
var innerType = type.render;
|
||||||
|
type = type.displayName;
|
||||||
|
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
||||||
|
return type;
|
||||||
|
case REACT_MEMO_TYPE: return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
||||||
|
case REACT_LAZY_TYPE:
|
||||||
|
innerType = type._payload;
|
||||||
|
type = type._init;
|
||||||
|
try {
|
||||||
|
return getComponentNameFromType(type(innerType));
|
||||||
|
} catch (x) {}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
function testStringCoercion(value) {
|
||||||
|
return "" + value;
|
||||||
|
}
|
||||||
|
function checkKeyStringCoercion(value) {
|
||||||
|
try {
|
||||||
|
testStringCoercion(value);
|
||||||
|
var JSCompiler_inline_result = !1;
|
||||||
|
} catch (e) {
|
||||||
|
JSCompiler_inline_result = !0;
|
||||||
|
}
|
||||||
|
if (JSCompiler_inline_result) {
|
||||||
|
JSCompiler_inline_result = console;
|
||||||
|
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
||||||
|
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
||||||
|
JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
|
||||||
|
return testStringCoercion(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getTaskName(type) {
|
||||||
|
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
||||||
|
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>";
|
||||||
|
try {
|
||||||
|
var name = getComponentNameFromType(type);
|
||||||
|
return name ? "<" + name + ">" : "<...>";
|
||||||
|
} catch (x) {
|
||||||
|
return "<...>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getOwner() {
|
||||||
|
var dispatcher = ReactSharedInternals.A;
|
||||||
|
return null === dispatcher ? null : dispatcher.getOwner();
|
||||||
|
}
|
||||||
|
function UnknownOwner() {
|
||||||
|
return Error("react-stack-top-frame");
|
||||||
|
}
|
||||||
|
function hasValidKey(config) {
|
||||||
|
if (hasOwnProperty.call(config, "key")) {
|
||||||
|
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
||||||
|
if (getter && getter.isReactWarning) return !1;
|
||||||
|
}
|
||||||
|
return void 0 !== config.key;
|
||||||
|
}
|
||||||
|
function defineKeyPropWarningGetter(props, displayName) {
|
||||||
|
function warnAboutAccessingKey() {
|
||||||
|
specialPropKeyWarningShown || (specialPropKeyWarningShown = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName));
|
||||||
|
}
|
||||||
|
warnAboutAccessingKey.isReactWarning = !0;
|
||||||
|
Object.defineProperty(props, "key", {
|
||||||
|
get: warnAboutAccessingKey,
|
||||||
|
configurable: !0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function elementRefGetterWithDeprecationWarning() {
|
||||||
|
var componentName = getComponentNameFromType(this.type);
|
||||||
|
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
|
||||||
|
componentName = this.props.ref;
|
||||||
|
return void 0 !== componentName ? componentName : null;
|
||||||
|
}
|
||||||
|
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
||||||
|
var refProp = props.ref;
|
||||||
|
type = {
|
||||||
|
$$typeof: REACT_ELEMENT_TYPE,
|
||||||
|
type,
|
||||||
|
key,
|
||||||
|
props,
|
||||||
|
_owner: owner
|
||||||
|
};
|
||||||
|
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
||||||
|
enumerable: !1,
|
||||||
|
get: elementRefGetterWithDeprecationWarning
|
||||||
|
}) : Object.defineProperty(type, "ref", {
|
||||||
|
enumerable: !1,
|
||||||
|
value: null
|
||||||
|
});
|
||||||
|
type._store = {};
|
||||||
|
Object.defineProperty(type._store, "validated", {
|
||||||
|
configurable: !1,
|
||||||
|
enumerable: !1,
|
||||||
|
writable: !0,
|
||||||
|
value: 0
|
||||||
|
});
|
||||||
|
Object.defineProperty(type, "_debugInfo", {
|
||||||
|
configurable: !1,
|
||||||
|
enumerable: !1,
|
||||||
|
writable: !0,
|
||||||
|
value: null
|
||||||
|
});
|
||||||
|
Object.defineProperty(type, "_debugStack", {
|
||||||
|
configurable: !1,
|
||||||
|
enumerable: !1,
|
||||||
|
writable: !0,
|
||||||
|
value: debugStack
|
||||||
|
});
|
||||||
|
Object.defineProperty(type, "_debugTask", {
|
||||||
|
configurable: !1,
|
||||||
|
enumerable: !1,
|
||||||
|
writable: !0,
|
||||||
|
value: debugTask
|
||||||
|
});
|
||||||
|
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
|
||||||
|
var children = config.children;
|
||||||
|
if (void 0 !== children) if (isStaticChildren) if (isArrayImpl(children)) {
|
||||||
|
for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++) validateChildKeys(children[isStaticChildren]);
|
||||||
|
Object.freeze && Object.freeze(children);
|
||||||
|
} else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
||||||
|
else validateChildKeys(children);
|
||||||
|
if (hasOwnProperty.call(config, "key")) {
|
||||||
|
children = getComponentNameFromType(type);
|
||||||
|
var keys = Object.keys(config).filter(function(k) {
|
||||||
|
return "key" !== k;
|
||||||
|
});
|
||||||
|
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
||||||
|
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", isStaticChildren, children, keys, children), didWarnAboutKeySpread[children + isStaticChildren] = !0);
|
||||||
|
}
|
||||||
|
children = null;
|
||||||
|
void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
|
||||||
|
hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
|
||||||
|
if ("key" in config) {
|
||||||
|
maybeKey = {};
|
||||||
|
for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
|
||||||
|
} else maybeKey = config;
|
||||||
|
children && defineKeyPropWarningGetter(maybeKey, "function" === typeof type ? type.displayName || type.name || "Unknown" : type);
|
||||||
|
return ReactElement(type, children, maybeKey, getOwner(), debugStack, debugTask);
|
||||||
|
}
|
||||||
|
function validateChildKeys(node) {
|
||||||
|
isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
|
||||||
|
}
|
||||||
|
function isValidElement(object) {
|
||||||
|
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
||||||
|
}
|
||||||
|
var React = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
React = { react_stack_bottom_frame: function(callStackForError) {
|
||||||
|
return callStackForError();
|
||||||
|
} };
|
||||||
|
var specialPropKeyWarningShown;
|
||||||
|
var didWarnAboutElementRef = {};
|
||||||
|
var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(React, UnknownOwner)();
|
||||||
|
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
||||||
|
var didWarnAboutKeySpread = {};
|
||||||
|
exports.Fragment = REACT_FRAGMENT_TYPE;
|
||||||
|
exports.jsxDEV = function(type, config, maybeKey, isStaticChildren) {
|
||||||
|
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
||||||
|
return jsxDEVImpl(type, config, maybeKey, isStaticChildren, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
}));
|
||||||
|
//#endregion
|
||||||
|
//#region node_modules/react/jsx-dev-runtime.js
|
||||||
|
var require_jsx_dev_runtime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||||
|
module.exports = require_react_jsx_dev_runtime_development();
|
||||||
|
}));
|
||||||
|
//#endregion
|
||||||
|
export default require_jsx_dev_runtime();
|
||||||
|
|
||||||
|
//# sourceMappingURL=react_jsx-dev-runtime.js.map
|
||||||
1
counter-frontend/node_modules/.vite/deps/react_jsx-dev-runtime.js.map
generated
vendored
Normal file
1
counter-frontend/node_modules/.vite/deps/react_jsx-dev-runtime.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
209
counter-frontend/node_modules/.vite/deps/react_jsx-runtime.js
generated
vendored
Normal file
209
counter-frontend/node_modules/.vite/deps/react_jsx-runtime.js
generated
vendored
Normal file
@@ -0,0 +1,209 @@
|
|||||||
|
import { n as __commonJSMin, t as require_react } from "./react-QWdP705l.js";
|
||||||
|
//#region node_modules/react/cjs/react-jsx-runtime.development.js
|
||||||
|
/**
|
||||||
|
* @license React
|
||||||
|
* react-jsx-runtime.development.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
var require_react_jsx_runtime_development = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||||
|
(function() {
|
||||||
|
function getComponentNameFromType(type) {
|
||||||
|
if (null == type) return null;
|
||||||
|
if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
||||||
|
if ("string" === typeof type) return type;
|
||||||
|
switch (type) {
|
||||||
|
case REACT_FRAGMENT_TYPE: return "Fragment";
|
||||||
|
case REACT_PROFILER_TYPE: return "Profiler";
|
||||||
|
case REACT_STRICT_MODE_TYPE: return "StrictMode";
|
||||||
|
case REACT_SUSPENSE_TYPE: return "Suspense";
|
||||||
|
case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList";
|
||||||
|
case REACT_ACTIVITY_TYPE: return "Activity";
|
||||||
|
}
|
||||||
|
if ("object" === typeof type) switch ("number" === typeof type.tag && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof) {
|
||||||
|
case REACT_PORTAL_TYPE: return "Portal";
|
||||||
|
case REACT_CONTEXT_TYPE: return type.displayName || "Context";
|
||||||
|
case REACT_CONSUMER_TYPE: return (type._context.displayName || "Context") + ".Consumer";
|
||||||
|
case REACT_FORWARD_REF_TYPE:
|
||||||
|
var innerType = type.render;
|
||||||
|
type = type.displayName;
|
||||||
|
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
||||||
|
return type;
|
||||||
|
case REACT_MEMO_TYPE: return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
||||||
|
case REACT_LAZY_TYPE:
|
||||||
|
innerType = type._payload;
|
||||||
|
type = type._init;
|
||||||
|
try {
|
||||||
|
return getComponentNameFromType(type(innerType));
|
||||||
|
} catch (x) {}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
function testStringCoercion(value) {
|
||||||
|
return "" + value;
|
||||||
|
}
|
||||||
|
function checkKeyStringCoercion(value) {
|
||||||
|
try {
|
||||||
|
testStringCoercion(value);
|
||||||
|
var JSCompiler_inline_result = !1;
|
||||||
|
} catch (e) {
|
||||||
|
JSCompiler_inline_result = !0;
|
||||||
|
}
|
||||||
|
if (JSCompiler_inline_result) {
|
||||||
|
JSCompiler_inline_result = console;
|
||||||
|
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
||||||
|
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
||||||
|
JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
|
||||||
|
return testStringCoercion(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getTaskName(type) {
|
||||||
|
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
||||||
|
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>";
|
||||||
|
try {
|
||||||
|
var name = getComponentNameFromType(type);
|
||||||
|
return name ? "<" + name + ">" : "<...>";
|
||||||
|
} catch (x) {
|
||||||
|
return "<...>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getOwner() {
|
||||||
|
var dispatcher = ReactSharedInternals.A;
|
||||||
|
return null === dispatcher ? null : dispatcher.getOwner();
|
||||||
|
}
|
||||||
|
function UnknownOwner() {
|
||||||
|
return Error("react-stack-top-frame");
|
||||||
|
}
|
||||||
|
function hasValidKey(config) {
|
||||||
|
if (hasOwnProperty.call(config, "key")) {
|
||||||
|
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
||||||
|
if (getter && getter.isReactWarning) return !1;
|
||||||
|
}
|
||||||
|
return void 0 !== config.key;
|
||||||
|
}
|
||||||
|
function defineKeyPropWarningGetter(props, displayName) {
|
||||||
|
function warnAboutAccessingKey() {
|
||||||
|
specialPropKeyWarningShown || (specialPropKeyWarningShown = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName));
|
||||||
|
}
|
||||||
|
warnAboutAccessingKey.isReactWarning = !0;
|
||||||
|
Object.defineProperty(props, "key", {
|
||||||
|
get: warnAboutAccessingKey,
|
||||||
|
configurable: !0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function elementRefGetterWithDeprecationWarning() {
|
||||||
|
var componentName = getComponentNameFromType(this.type);
|
||||||
|
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
|
||||||
|
componentName = this.props.ref;
|
||||||
|
return void 0 !== componentName ? componentName : null;
|
||||||
|
}
|
||||||
|
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
||||||
|
var refProp = props.ref;
|
||||||
|
type = {
|
||||||
|
$$typeof: REACT_ELEMENT_TYPE,
|
||||||
|
type,
|
||||||
|
key,
|
||||||
|
props,
|
||||||
|
_owner: owner
|
||||||
|
};
|
||||||
|
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
||||||
|
enumerable: !1,
|
||||||
|
get: elementRefGetterWithDeprecationWarning
|
||||||
|
}) : Object.defineProperty(type, "ref", {
|
||||||
|
enumerable: !1,
|
||||||
|
value: null
|
||||||
|
});
|
||||||
|
type._store = {};
|
||||||
|
Object.defineProperty(type._store, "validated", {
|
||||||
|
configurable: !1,
|
||||||
|
enumerable: !1,
|
||||||
|
writable: !0,
|
||||||
|
value: 0
|
||||||
|
});
|
||||||
|
Object.defineProperty(type, "_debugInfo", {
|
||||||
|
configurable: !1,
|
||||||
|
enumerable: !1,
|
||||||
|
writable: !0,
|
||||||
|
value: null
|
||||||
|
});
|
||||||
|
Object.defineProperty(type, "_debugStack", {
|
||||||
|
configurable: !1,
|
||||||
|
enumerable: !1,
|
||||||
|
writable: !0,
|
||||||
|
value: debugStack
|
||||||
|
});
|
||||||
|
Object.defineProperty(type, "_debugTask", {
|
||||||
|
configurable: !1,
|
||||||
|
enumerable: !1,
|
||||||
|
writable: !0,
|
||||||
|
value: debugTask
|
||||||
|
});
|
||||||
|
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
|
||||||
|
var children = config.children;
|
||||||
|
if (void 0 !== children) if (isStaticChildren) if (isArrayImpl(children)) {
|
||||||
|
for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++) validateChildKeys(children[isStaticChildren]);
|
||||||
|
Object.freeze && Object.freeze(children);
|
||||||
|
} else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
||||||
|
else validateChildKeys(children);
|
||||||
|
if (hasOwnProperty.call(config, "key")) {
|
||||||
|
children = getComponentNameFromType(type);
|
||||||
|
var keys = Object.keys(config).filter(function(k) {
|
||||||
|
return "key" !== k;
|
||||||
|
});
|
||||||
|
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
||||||
|
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", isStaticChildren, children, keys, children), didWarnAboutKeySpread[children + isStaticChildren] = !0);
|
||||||
|
}
|
||||||
|
children = null;
|
||||||
|
void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
|
||||||
|
hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
|
||||||
|
if ("key" in config) {
|
||||||
|
maybeKey = {};
|
||||||
|
for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
|
||||||
|
} else maybeKey = config;
|
||||||
|
children && defineKeyPropWarningGetter(maybeKey, "function" === typeof type ? type.displayName || type.name || "Unknown" : type);
|
||||||
|
return ReactElement(type, children, maybeKey, getOwner(), debugStack, debugTask);
|
||||||
|
}
|
||||||
|
function validateChildKeys(node) {
|
||||||
|
isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
|
||||||
|
}
|
||||||
|
function isValidElement(object) {
|
||||||
|
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
||||||
|
}
|
||||||
|
var React = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
React = { react_stack_bottom_frame: function(callStackForError) {
|
||||||
|
return callStackForError();
|
||||||
|
} };
|
||||||
|
var specialPropKeyWarningShown;
|
||||||
|
var didWarnAboutElementRef = {};
|
||||||
|
var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(React, UnknownOwner)();
|
||||||
|
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
||||||
|
var didWarnAboutKeySpread = {};
|
||||||
|
exports.Fragment = REACT_FRAGMENT_TYPE;
|
||||||
|
exports.jsx = function(type, config, maybeKey) {
|
||||||
|
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
||||||
|
return jsxDEVImpl(type, config, maybeKey, !1, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
|
||||||
|
};
|
||||||
|
exports.jsxs = function(type, config, maybeKey) {
|
||||||
|
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
||||||
|
return jsxDEVImpl(type, config, maybeKey, !0, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
}));
|
||||||
|
//#endregion
|
||||||
|
//#region node_modules/react/jsx-runtime.js
|
||||||
|
var require_jsx_runtime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||||
|
module.exports = require_react_jsx_runtime_development();
|
||||||
|
}));
|
||||||
|
//#endregion
|
||||||
|
export default require_jsx_runtime();
|
||||||
|
export { require_jsx_runtime as t };
|
||||||
|
|
||||||
|
//# sourceMappingURL=react_jsx-runtime.js.map
|
||||||
1
counter-frontend/node_modules/.vite/deps/react_jsx-runtime.js.map
generated
vendored
Normal file
1
counter-frontend/node_modules/.vite/deps/react_jsx-runtime.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
128
counter-frontend/node_modules/@alloc/quick-lru/index.d.ts
generated
vendored
Normal file
128
counter-frontend/node_modules/@alloc/quick-lru/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
declare namespace QuickLRU {
|
||||||
|
interface Options<KeyType, ValueType> {
|
||||||
|
/**
|
||||||
|
The maximum number of milliseconds an item should remain in the cache.
|
||||||
|
|
||||||
|
@default Infinity
|
||||||
|
|
||||||
|
By default, `maxAge` will be `Infinity`, which means that items will never expire.
|
||||||
|
Lazy expiration upon the next write or read call.
|
||||||
|
|
||||||
|
Individual expiration of an item can be specified by the `set(key, value, maxAge)` method.
|
||||||
|
*/
|
||||||
|
readonly maxAge?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
The maximum number of items before evicting the least recently used items.
|
||||||
|
*/
|
||||||
|
readonly maxSize: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Called right before an item is evicted from the cache.
|
||||||
|
|
||||||
|
Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`).
|
||||||
|
*/
|
||||||
|
onEviction?: (key: KeyType, value: ValueType) => void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare class QuickLRU<KeyType, ValueType>
|
||||||
|
implements Iterable<[KeyType, ValueType]> {
|
||||||
|
/**
|
||||||
|
The stored item count.
|
||||||
|
*/
|
||||||
|
readonly size: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Simple ["Least Recently Used" (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29).
|
||||||
|
|
||||||
|
The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop.
|
||||||
|
|
||||||
|
@example
|
||||||
|
```
|
||||||
|
import QuickLRU = require('quick-lru');
|
||||||
|
|
||||||
|
const lru = new QuickLRU({maxSize: 1000});
|
||||||
|
|
||||||
|
lru.set('🦄', '🌈');
|
||||||
|
|
||||||
|
lru.has('🦄');
|
||||||
|
//=> true
|
||||||
|
|
||||||
|
lru.get('🦄');
|
||||||
|
//=> '🌈'
|
||||||
|
```
|
||||||
|
*/
|
||||||
|
constructor(options: QuickLRU.Options<KeyType, ValueType>);
|
||||||
|
|
||||||
|
[Symbol.iterator](): IterableIterator<[KeyType, ValueType]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Set an item. Returns the instance.
|
||||||
|
|
||||||
|
Individual expiration of an item can be specified with the `maxAge` option. If not specified, the global `maxAge` value will be used in case it is specified in the constructor, otherwise the item will never expire.
|
||||||
|
|
||||||
|
@returns The list instance.
|
||||||
|
*/
|
||||||
|
set(key: KeyType, value: ValueType, options?: {maxAge?: number}): this;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get an item.
|
||||||
|
|
||||||
|
@returns The stored item or `undefined`.
|
||||||
|
*/
|
||||||
|
get(key: KeyType): ValueType | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Check if an item exists.
|
||||||
|
*/
|
||||||
|
has(key: KeyType): boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get an item without marking it as recently used.
|
||||||
|
|
||||||
|
@returns The stored item or `undefined`.
|
||||||
|
*/
|
||||||
|
peek(key: KeyType): ValueType | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Delete an item.
|
||||||
|
|
||||||
|
@returns `true` if the item is removed or `false` if the item doesn't exist.
|
||||||
|
*/
|
||||||
|
delete(key: KeyType): boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Delete all items.
|
||||||
|
*/
|
||||||
|
clear(): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Update the `maxSize` in-place, discarding items as necessary. Insertion order is mostly preserved, though this is not a strong guarantee.
|
||||||
|
|
||||||
|
Useful for on-the-fly tuning of cache sizes in live systems.
|
||||||
|
*/
|
||||||
|
resize(maxSize: number): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Iterable for all the keys.
|
||||||
|
*/
|
||||||
|
keys(): IterableIterator<KeyType>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Iterable for all the values.
|
||||||
|
*/
|
||||||
|
values(): IterableIterator<ValueType>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Iterable for all entries, starting with the oldest (ascending in recency).
|
||||||
|
*/
|
||||||
|
entriesAscending(): IterableIterator<[KeyType, ValueType]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Iterable for all entries, starting with the newest (descending in recency).
|
||||||
|
*/
|
||||||
|
entriesDescending(): IterableIterator<[KeyType, ValueType]>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export = QuickLRU;
|
||||||
263
counter-frontend/node_modules/@alloc/quick-lru/index.js
generated
vendored
Normal file
263
counter-frontend/node_modules/@alloc/quick-lru/index.js
generated
vendored
Normal file
@@ -0,0 +1,263 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
class QuickLRU {
|
||||||
|
constructor(options = {}) {
|
||||||
|
if (!(options.maxSize && options.maxSize > 0)) {
|
||||||
|
throw new TypeError('`maxSize` must be a number greater than 0');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof options.maxAge === 'number' && options.maxAge === 0) {
|
||||||
|
throw new TypeError('`maxAge` must be a number greater than 0');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.maxSize = options.maxSize;
|
||||||
|
this.maxAge = options.maxAge || Infinity;
|
||||||
|
this.onEviction = options.onEviction;
|
||||||
|
this.cache = new Map();
|
||||||
|
this.oldCache = new Map();
|
||||||
|
this._size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
_emitEvictions(cache) {
|
||||||
|
if (typeof this.onEviction !== 'function') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const [key, item] of cache) {
|
||||||
|
this.onEviction(key, item.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_deleteIfExpired(key, item) {
|
||||||
|
if (typeof item.expiry === 'number' && item.expiry <= Date.now()) {
|
||||||
|
if (typeof this.onEviction === 'function') {
|
||||||
|
this.onEviction(key, item.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.delete(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
_getOrDeleteIfExpired(key, item) {
|
||||||
|
const deleted = this._deleteIfExpired(key, item);
|
||||||
|
if (deleted === false) {
|
||||||
|
return item.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_getItemValue(key, item) {
|
||||||
|
return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
_peek(key, cache) {
|
||||||
|
const item = cache.get(key);
|
||||||
|
|
||||||
|
return this._getItemValue(key, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
_set(key, value) {
|
||||||
|
this.cache.set(key, value);
|
||||||
|
this._size++;
|
||||||
|
|
||||||
|
if (this._size >= this.maxSize) {
|
||||||
|
this._size = 0;
|
||||||
|
this._emitEvictions(this.oldCache);
|
||||||
|
this.oldCache = this.cache;
|
||||||
|
this.cache = new Map();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_moveToRecent(key, item) {
|
||||||
|
this.oldCache.delete(key);
|
||||||
|
this._set(key, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
* _entriesAscending() {
|
||||||
|
for (const item of this.oldCache) {
|
||||||
|
const [key, value] = item;
|
||||||
|
if (!this.cache.has(key)) {
|
||||||
|
const deleted = this._deleteIfExpired(key, value);
|
||||||
|
if (deleted === false) {
|
||||||
|
yield item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const item of this.cache) {
|
||||||
|
const [key, value] = item;
|
||||||
|
const deleted = this._deleteIfExpired(key, value);
|
||||||
|
if (deleted === false) {
|
||||||
|
yield item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get(key) {
|
||||||
|
if (this.cache.has(key)) {
|
||||||
|
const item = this.cache.get(key);
|
||||||
|
|
||||||
|
return this._getItemValue(key, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.oldCache.has(key)) {
|
||||||
|
const item = this.oldCache.get(key);
|
||||||
|
if (this._deleteIfExpired(key, item) === false) {
|
||||||
|
this._moveToRecent(key, item);
|
||||||
|
return item.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
set(key, value, {maxAge = this.maxAge === Infinity ? undefined : Date.now() + this.maxAge} = {}) {
|
||||||
|
if (this.cache.has(key)) {
|
||||||
|
this.cache.set(key, {
|
||||||
|
value,
|
||||||
|
maxAge
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this._set(key, {value, expiry: maxAge});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
has(key) {
|
||||||
|
if (this.cache.has(key)) {
|
||||||
|
return !this._deleteIfExpired(key, this.cache.get(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.oldCache.has(key)) {
|
||||||
|
return !this._deleteIfExpired(key, this.oldCache.get(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
peek(key) {
|
||||||
|
if (this.cache.has(key)) {
|
||||||
|
return this._peek(key, this.cache);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.oldCache.has(key)) {
|
||||||
|
return this._peek(key, this.oldCache);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delete(key) {
|
||||||
|
const deleted = this.cache.delete(key);
|
||||||
|
if (deleted) {
|
||||||
|
this._size--;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.oldCache.delete(key) || deleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
clear() {
|
||||||
|
this.cache.clear();
|
||||||
|
this.oldCache.clear();
|
||||||
|
this._size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
resize(newSize) {
|
||||||
|
if (!(newSize && newSize > 0)) {
|
||||||
|
throw new TypeError('`maxSize` must be a number greater than 0');
|
||||||
|
}
|
||||||
|
|
||||||
|
const items = [...this._entriesAscending()];
|
||||||
|
const removeCount = items.length - newSize;
|
||||||
|
if (removeCount < 0) {
|
||||||
|
this.cache = new Map(items);
|
||||||
|
this.oldCache = new Map();
|
||||||
|
this._size = items.length;
|
||||||
|
} else {
|
||||||
|
if (removeCount > 0) {
|
||||||
|
this._emitEvictions(items.slice(0, removeCount));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.oldCache = new Map(items.slice(removeCount));
|
||||||
|
this.cache = new Map();
|
||||||
|
this._size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.maxSize = newSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
* keys() {
|
||||||
|
for (const [key] of this) {
|
||||||
|
yield key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
* values() {
|
||||||
|
for (const [, value] of this) {
|
||||||
|
yield value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
* [Symbol.iterator]() {
|
||||||
|
for (const item of this.cache) {
|
||||||
|
const [key, value] = item;
|
||||||
|
const deleted = this._deleteIfExpired(key, value);
|
||||||
|
if (deleted === false) {
|
||||||
|
yield [key, value.value];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const item of this.oldCache) {
|
||||||
|
const [key, value] = item;
|
||||||
|
if (!this.cache.has(key)) {
|
||||||
|
const deleted = this._deleteIfExpired(key, value);
|
||||||
|
if (deleted === false) {
|
||||||
|
yield [key, value.value];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
* entriesDescending() {
|
||||||
|
let items = [...this.cache];
|
||||||
|
for (let i = items.length - 1; i >= 0; --i) {
|
||||||
|
const item = items[i];
|
||||||
|
const [key, value] = item;
|
||||||
|
const deleted = this._deleteIfExpired(key, value);
|
||||||
|
if (deleted === false) {
|
||||||
|
yield [key, value.value];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
items = [...this.oldCache];
|
||||||
|
for (let i = items.length - 1; i >= 0; --i) {
|
||||||
|
const item = items[i];
|
||||||
|
const [key, value] = item;
|
||||||
|
if (!this.cache.has(key)) {
|
||||||
|
const deleted = this._deleteIfExpired(key, value);
|
||||||
|
if (deleted === false) {
|
||||||
|
yield [key, value.value];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
* entriesAscending() {
|
||||||
|
for (const [key, value] of this._entriesAscending()) {
|
||||||
|
yield [key, value.value];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get size() {
|
||||||
|
if (!this._size) {
|
||||||
|
return this.oldCache.size;
|
||||||
|
}
|
||||||
|
|
||||||
|
let oldCacheSize = 0;
|
||||||
|
for (const key of this.oldCache.keys()) {
|
||||||
|
if (!this.cache.has(key)) {
|
||||||
|
oldCacheSize++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Math.min(this._size + oldCacheSize, this.maxSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = QuickLRU;
|
||||||
9
counter-frontend/node_modules/@alloc/quick-lru/license
generated
vendored
Normal file
9
counter-frontend/node_modules/@alloc/quick-lru/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
43
counter-frontend/node_modules/@alloc/quick-lru/package.json
generated
vendored
Normal file
43
counter-frontend/node_modules/@alloc/quick-lru/package.json
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"name": "@alloc/quick-lru",
|
||||||
|
"version": "5.2.0",
|
||||||
|
"description": "Simple “Least Recently Used” (LRU) cache",
|
||||||
|
"license": "MIT",
|
||||||
|
"repository": "sindresorhus/quick-lru",
|
||||||
|
"funding": "https://github.com/sponsors/sindresorhus",
|
||||||
|
"author": {
|
||||||
|
"name": "Sindre Sorhus",
|
||||||
|
"email": "sindresorhus@gmail.com",
|
||||||
|
"url": "https://sindresorhus.com"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "xo && nyc ava && tsd"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"index.js",
|
||||||
|
"index.d.ts"
|
||||||
|
],
|
||||||
|
"keywords": [
|
||||||
|
"lru",
|
||||||
|
"quick",
|
||||||
|
"cache",
|
||||||
|
"caching",
|
||||||
|
"least",
|
||||||
|
"recently",
|
||||||
|
"used",
|
||||||
|
"fast",
|
||||||
|
"map",
|
||||||
|
"hash",
|
||||||
|
"buffer"
|
||||||
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"ava": "^2.0.0",
|
||||||
|
"coveralls": "^3.0.3",
|
||||||
|
"nyc": "^15.0.0",
|
||||||
|
"tsd": "^0.11.0",
|
||||||
|
"xo": "^0.26.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
139
counter-frontend/node_modules/@alloc/quick-lru/readme.md
generated
vendored
Normal file
139
counter-frontend/node_modules/@alloc/quick-lru/readme.md
generated
vendored
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
# quick-lru [](https://travis-ci.org/sindresorhus/quick-lru) [](https://coveralls.io/github/sindresorhus/quick-lru?branch=master)
|
||||||
|
|
||||||
|
> Simple [“Least Recently Used” (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29)
|
||||||
|
|
||||||
|
Useful when you need to cache something and limit memory usage.
|
||||||
|
|
||||||
|
Inspired by the [`hashlru` algorithm](https://github.com/dominictarr/hashlru#algorithm), but instead uses [`Map`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map) to support keys of any type, not just strings, and values can be `undefined`.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```
|
||||||
|
$ npm install quick-lru
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```js
|
||||||
|
const QuickLRU = require('quick-lru');
|
||||||
|
|
||||||
|
const lru = new QuickLRU({maxSize: 1000});
|
||||||
|
|
||||||
|
lru.set('🦄', '🌈');
|
||||||
|
|
||||||
|
lru.has('🦄');
|
||||||
|
//=> true
|
||||||
|
|
||||||
|
lru.get('🦄');
|
||||||
|
//=> '🌈'
|
||||||
|
```
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
### new QuickLRU(options?)
|
||||||
|
|
||||||
|
Returns a new instance.
|
||||||
|
|
||||||
|
### options
|
||||||
|
|
||||||
|
Type: `object`
|
||||||
|
|
||||||
|
#### maxSize
|
||||||
|
|
||||||
|
*Required*\
|
||||||
|
Type: `number`
|
||||||
|
|
||||||
|
The maximum number of items before evicting the least recently used items.
|
||||||
|
|
||||||
|
#### maxAge
|
||||||
|
|
||||||
|
Type: `number`\
|
||||||
|
Default: `Infinity`
|
||||||
|
|
||||||
|
The maximum number of milliseconds an item should remain in cache.
|
||||||
|
By default maxAge will be Infinity, which means that items will never expire.
|
||||||
|
|
||||||
|
Lazy expiration happens upon the next `write` or `read` call.
|
||||||
|
|
||||||
|
Individual expiration of an item can be specified by the `set(key, value, options)` method.
|
||||||
|
|
||||||
|
#### onEviction
|
||||||
|
|
||||||
|
*Optional*\
|
||||||
|
Type: `(key, value) => void`
|
||||||
|
|
||||||
|
Called right before an item is evicted from the cache.
|
||||||
|
|
||||||
|
Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`).
|
||||||
|
|
||||||
|
### Instance
|
||||||
|
|
||||||
|
The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop.
|
||||||
|
|
||||||
|
Both `key` and `value` can be of any type.
|
||||||
|
|
||||||
|
#### .set(key, value, options?)
|
||||||
|
|
||||||
|
Set an item. Returns the instance.
|
||||||
|
|
||||||
|
Individual expiration of an item can be specified with the `maxAge` option. If not specified, the global `maxAge` value will be used in case it is specified on the constructor, otherwise the item will never expire.
|
||||||
|
|
||||||
|
#### .get(key)
|
||||||
|
|
||||||
|
Get an item.
|
||||||
|
|
||||||
|
#### .has(key)
|
||||||
|
|
||||||
|
Check if an item exists.
|
||||||
|
|
||||||
|
#### .peek(key)
|
||||||
|
|
||||||
|
Get an item without marking it as recently used.
|
||||||
|
|
||||||
|
#### .delete(key)
|
||||||
|
|
||||||
|
Delete an item.
|
||||||
|
|
||||||
|
Returns `true` if the item is removed or `false` if the item doesn't exist.
|
||||||
|
|
||||||
|
#### .clear()
|
||||||
|
|
||||||
|
Delete all items.
|
||||||
|
|
||||||
|
#### .resize(maxSize)
|
||||||
|
|
||||||
|
Update the `maxSize`, discarding items as necessary. Insertion order is mostly preserved, though this is not a strong guarantee.
|
||||||
|
|
||||||
|
Useful for on-the-fly tuning of cache sizes in live systems.
|
||||||
|
|
||||||
|
#### .keys()
|
||||||
|
|
||||||
|
Iterable for all the keys.
|
||||||
|
|
||||||
|
#### .values()
|
||||||
|
|
||||||
|
Iterable for all the values.
|
||||||
|
|
||||||
|
#### .entriesAscending()
|
||||||
|
|
||||||
|
Iterable for all entries, starting with the oldest (ascending in recency).
|
||||||
|
|
||||||
|
#### .entriesDescending()
|
||||||
|
|
||||||
|
Iterable for all entries, starting with the newest (descending in recency).
|
||||||
|
|
||||||
|
#### .size
|
||||||
|
|
||||||
|
The stored item count.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<b>
|
||||||
|
<a href="https://tidelift.com/subscription/pkg/npm-quick-lru?utm_source=npm-quick-lru&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||||
|
</b>
|
||||||
|
<br>
|
||||||
|
<sub>
|
||||||
|
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||||
|
</sub>
|
||||||
|
</div>
|
||||||
22
counter-frontend/node_modules/@babel/code-frame/LICENSE
generated
vendored
Normal file
22
counter-frontend/node_modules/@babel/code-frame/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
19
counter-frontend/node_modules/@babel/code-frame/README.md
generated
vendored
Normal file
19
counter-frontend/node_modules/@babel/code-frame/README.md
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# @babel/code-frame
|
||||||
|
|
||||||
|
> Generate errors that contain a code frame that point to source locations.
|
||||||
|
|
||||||
|
See our website [@babel/code-frame](https://babeljs.io/docs/babel-code-frame) for more information.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
Using npm:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install --save-dev @babel/code-frame
|
||||||
|
```
|
||||||
|
|
||||||
|
or using yarn:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
yarn add @babel/code-frame --dev
|
||||||
|
```
|
||||||
217
counter-frontend/node_modules/@babel/code-frame/lib/index.js
generated
vendored
Normal file
217
counter-frontend/node_modules/@babel/code-frame/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,217 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
|
|
||||||
|
var picocolors = require('picocolors');
|
||||||
|
var jsTokens = require('js-tokens');
|
||||||
|
var helperValidatorIdentifier = require('@babel/helper-validator-identifier');
|
||||||
|
|
||||||
|
function isColorSupported() {
|
||||||
|
return (typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors.isColorSupported
|
||||||
|
);
|
||||||
|
}
|
||||||
|
const compose = (f, g) => v => f(g(v));
|
||||||
|
function buildDefs(colors) {
|
||||||
|
return {
|
||||||
|
keyword: colors.cyan,
|
||||||
|
capitalized: colors.yellow,
|
||||||
|
jsxIdentifier: colors.yellow,
|
||||||
|
punctuator: colors.yellow,
|
||||||
|
number: colors.magenta,
|
||||||
|
string: colors.green,
|
||||||
|
regex: colors.magenta,
|
||||||
|
comment: colors.gray,
|
||||||
|
invalid: compose(compose(colors.white, colors.bgRed), colors.bold),
|
||||||
|
gutter: colors.gray,
|
||||||
|
marker: compose(colors.red, colors.bold),
|
||||||
|
message: compose(colors.red, colors.bold),
|
||||||
|
reset: colors.reset
|
||||||
|
};
|
||||||
|
}
|
||||||
|
const defsOn = buildDefs(picocolors.createColors(true));
|
||||||
|
const defsOff = buildDefs(picocolors.createColors(false));
|
||||||
|
function getDefs(enabled) {
|
||||||
|
return enabled ? defsOn : defsOff;
|
||||||
|
}
|
||||||
|
|
||||||
|
const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]);
|
||||||
|
const NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
|
||||||
|
const BRACKET = /^[()[\]{}]$/;
|
||||||
|
let tokenize;
|
||||||
|
const JSX_TAG = /^[a-z][\w-]*$/i;
|
||||||
|
const getTokenType = function (token, offset, text) {
|
||||||
|
if (token.type === "name") {
|
||||||
|
const tokenValue = token.value;
|
||||||
|
if (helperValidatorIdentifier.isKeyword(tokenValue) || helperValidatorIdentifier.isStrictReservedWord(tokenValue, true) || sometimesKeywords.has(tokenValue)) {
|
||||||
|
return "keyword";
|
||||||
|
}
|
||||||
|
if (JSX_TAG.test(tokenValue) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === "</")) {
|
||||||
|
return "jsxIdentifier";
|
||||||
|
}
|
||||||
|
const firstChar = String.fromCodePoint(tokenValue.codePointAt(0));
|
||||||
|
if (firstChar !== firstChar.toLowerCase()) {
|
||||||
|
return "capitalized";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (token.type === "punctuator" && BRACKET.test(token.value)) {
|
||||||
|
return "bracket";
|
||||||
|
}
|
||||||
|
if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
|
||||||
|
return "punctuator";
|
||||||
|
}
|
||||||
|
return token.type;
|
||||||
|
};
|
||||||
|
tokenize = function* (text) {
|
||||||
|
let match;
|
||||||
|
while (match = jsTokens.default.exec(text)) {
|
||||||
|
const token = jsTokens.matchToToken(match);
|
||||||
|
yield {
|
||||||
|
type: getTokenType(token, match.index, text),
|
||||||
|
value: token.value
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
function highlight(text) {
|
||||||
|
if (text === "") return "";
|
||||||
|
const defs = getDefs(true);
|
||||||
|
let highlighted = "";
|
||||||
|
for (const {
|
||||||
|
type,
|
||||||
|
value
|
||||||
|
} of tokenize(text)) {
|
||||||
|
if (type in defs) {
|
||||||
|
highlighted += value.split(NEWLINE$1).map(str => defs[type](str)).join("\n");
|
||||||
|
} else {
|
||||||
|
highlighted += value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return highlighted;
|
||||||
|
}
|
||||||
|
|
||||||
|
let deprecationWarningShown = false;
|
||||||
|
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
||||||
|
function getMarkerLines(loc, source, opts, startLineBaseZero) {
|
||||||
|
const startLoc = Object.assign({
|
||||||
|
column: 0,
|
||||||
|
line: -1
|
||||||
|
}, loc.start);
|
||||||
|
const endLoc = Object.assign({}, startLoc, loc.end);
|
||||||
|
const {
|
||||||
|
linesAbove = 2,
|
||||||
|
linesBelow = 3
|
||||||
|
} = opts || {};
|
||||||
|
const startLine = startLoc.line - startLineBaseZero;
|
||||||
|
const startColumn = startLoc.column;
|
||||||
|
const endLine = endLoc.line - startLineBaseZero;
|
||||||
|
const endColumn = endLoc.column;
|
||||||
|
let start = Math.max(startLine - (linesAbove + 1), 0);
|
||||||
|
let end = Math.min(source.length, endLine + linesBelow);
|
||||||
|
if (startLine === -1) {
|
||||||
|
start = 0;
|
||||||
|
}
|
||||||
|
if (endLine === -1) {
|
||||||
|
end = source.length;
|
||||||
|
}
|
||||||
|
const lineDiff = endLine - startLine;
|
||||||
|
const markerLines = {};
|
||||||
|
if (lineDiff) {
|
||||||
|
for (let i = 0; i <= lineDiff; i++) {
|
||||||
|
const lineNumber = i + startLine;
|
||||||
|
if (!startColumn) {
|
||||||
|
markerLines[lineNumber] = true;
|
||||||
|
} else if (i === 0) {
|
||||||
|
const sourceLength = source[lineNumber - 1].length;
|
||||||
|
markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
|
||||||
|
} else if (i === lineDiff) {
|
||||||
|
markerLines[lineNumber] = [0, endColumn];
|
||||||
|
} else {
|
||||||
|
const sourceLength = source[lineNumber - i].length;
|
||||||
|
markerLines[lineNumber] = [0, sourceLength];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (startColumn === endColumn) {
|
||||||
|
if (startColumn) {
|
||||||
|
markerLines[startLine] = [startColumn, 0];
|
||||||
|
} else {
|
||||||
|
markerLines[startLine] = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
markerLines[startLine] = [startColumn, endColumn - startColumn];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
start,
|
||||||
|
end,
|
||||||
|
markerLines
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function codeFrameColumns(rawLines, loc, opts = {}) {
|
||||||
|
const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode;
|
||||||
|
const startLineBaseZero = (opts.startLine || 1) - 1;
|
||||||
|
const defs = getDefs(shouldHighlight);
|
||||||
|
const lines = rawLines.split(NEWLINE);
|
||||||
|
const {
|
||||||
|
start,
|
||||||
|
end,
|
||||||
|
markerLines
|
||||||
|
} = getMarkerLines(loc, lines, opts, startLineBaseZero);
|
||||||
|
const hasColumns = loc.start && typeof loc.start.column === "number";
|
||||||
|
const numberMaxWidth = String(end + startLineBaseZero).length;
|
||||||
|
const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines;
|
||||||
|
let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => {
|
||||||
|
const number = start + 1 + index;
|
||||||
|
const paddedNumber = ` ${number + startLineBaseZero}`.slice(-numberMaxWidth);
|
||||||
|
const gutter = ` ${paddedNumber} |`;
|
||||||
|
const hasMarker = markerLines[number];
|
||||||
|
const lastMarkerLine = !markerLines[number + 1];
|
||||||
|
if (hasMarker) {
|
||||||
|
let markerLine = "";
|
||||||
|
if (Array.isArray(hasMarker)) {
|
||||||
|
const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
|
||||||
|
const numberOfMarkers = hasMarker[1] || 1;
|
||||||
|
markerLine = ["\n ", defs.gutter(gutter.replace(/\d/g, " ")), " ", markerSpacing, defs.marker("^").repeat(numberOfMarkers)].join("");
|
||||||
|
if (lastMarkerLine && opts.message) {
|
||||||
|
markerLine += " " + defs.message(opts.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [defs.marker(">"), defs.gutter(gutter), line.length > 0 ? ` ${line}` : "", markerLine].join("");
|
||||||
|
} else {
|
||||||
|
return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : ""}`;
|
||||||
|
}
|
||||||
|
}).join("\n");
|
||||||
|
if (opts.message && !hasColumns) {
|
||||||
|
frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`;
|
||||||
|
}
|
||||||
|
if (shouldHighlight) {
|
||||||
|
return defs.reset(frame);
|
||||||
|
} else {
|
||||||
|
return frame;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function index (rawLines, lineNumber, colNumber, opts = {}) {
|
||||||
|
if (!deprecationWarningShown) {
|
||||||
|
deprecationWarningShown = true;
|
||||||
|
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
|
||||||
|
if (process.emitWarning) {
|
||||||
|
process.emitWarning(message, "DeprecationWarning");
|
||||||
|
} else {
|
||||||
|
const deprecationError = new Error(message);
|
||||||
|
deprecationError.name = "DeprecationWarning";
|
||||||
|
console.warn(new Error(message));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
colNumber = Math.max(colNumber, 0);
|
||||||
|
const location = {
|
||||||
|
start: {
|
||||||
|
column: colNumber,
|
||||||
|
line: lineNumber
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return codeFrameColumns(rawLines, location, opts);
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.codeFrameColumns = codeFrameColumns;
|
||||||
|
exports.default = index;
|
||||||
|
exports.highlight = highlight;
|
||||||
|
//# sourceMappingURL=index.js.map
|
||||||
1
counter-frontend/node_modules/@babel/code-frame/lib/index.js.map
generated
vendored
Normal file
1
counter-frontend/node_modules/@babel/code-frame/lib/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
32
counter-frontend/node_modules/@babel/code-frame/package.json
generated
vendored
Normal file
32
counter-frontend/node_modules/@babel/code-frame/package.json
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"name": "@babel/code-frame",
|
||||||
|
"version": "7.29.7",
|
||||||
|
"description": "Generate errors that contain a code frame that point to source locations.",
|
||||||
|
"author": "The Babel Team (https://babel.dev/team)",
|
||||||
|
"homepage": "https://babel.dev/docs/en/next/babel-code-frame",
|
||||||
|
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen",
|
||||||
|
"license": "MIT",
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/babel/babel.git",
|
||||||
|
"directory": "packages/babel-code-frame"
|
||||||
|
},
|
||||||
|
"main": "./lib/index.js",
|
||||||
|
"dependencies": {
|
||||||
|
"@babel/helper-validator-identifier": "^7.29.7",
|
||||||
|
"js-tokens": "^4.0.0",
|
||||||
|
"picocolors": "^1.1.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"charcodes": "^0.2.0",
|
||||||
|
"import-meta-resolve": "^4.1.0",
|
||||||
|
"strip-ansi": "^4.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6.9.0"
|
||||||
|
},
|
||||||
|
"type": "commonjs"
|
||||||
|
}
|
||||||
22
counter-frontend/node_modules/@babel/compat-data/LICENSE
generated
vendored
Normal file
22
counter-frontend/node_modules/@babel/compat-data/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
19
counter-frontend/node_modules/@babel/compat-data/README.md
generated
vendored
Normal file
19
counter-frontend/node_modules/@babel/compat-data/README.md
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# @babel/compat-data
|
||||||
|
|
||||||
|
> The compat-data to determine required Babel plugins
|
||||||
|
|
||||||
|
See our website [@babel/compat-data](https://babeljs.io/docs/babel-compat-data) for more information.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
Using npm:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install --save @babel/compat-data
|
||||||
|
```
|
||||||
|
|
||||||
|
or using yarn:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
yarn add @babel/compat-data
|
||||||
|
```
|
||||||
2
counter-frontend/node_modules/@babel/compat-data/corejs2-built-ins.js
generated
vendored
Normal file
2
counter-frontend/node_modules/@babel/compat-data/corejs2-built-ins.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
// Todo (Babel 8): remove this file as Babel 8 drop support of core-js 2
|
||||||
|
module.exports = require("./data/corejs2-built-ins.json");
|
||||||
2
counter-frontend/node_modules/@babel/compat-data/corejs3-shipped-proposals.js
generated
vendored
Normal file
2
counter-frontend/node_modules/@babel/compat-data/corejs3-shipped-proposals.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
// Todo (Babel 8): remove this file now that it is included in babel-plugin-polyfill-corejs3
|
||||||
|
module.exports = require("./data/corejs3-shipped-proposals.json");
|
||||||
2120
counter-frontend/node_modules/@babel/compat-data/data/corejs2-built-ins.json
generated
vendored
Normal file
2120
counter-frontend/node_modules/@babel/compat-data/data/corejs2-built-ins.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
5
counter-frontend/node_modules/@babel/compat-data/data/corejs3-shipped-proposals.json
generated
vendored
Normal file
5
counter-frontend/node_modules/@babel/compat-data/data/corejs3-shipped-proposals.json
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[
|
||||||
|
"esnext.promise.all-settled",
|
||||||
|
"esnext.string.match-all",
|
||||||
|
"esnext.global-this"
|
||||||
|
]
|
||||||
18
counter-frontend/node_modules/@babel/compat-data/data/native-modules.json
generated
vendored
Normal file
18
counter-frontend/node_modules/@babel/compat-data/data/native-modules.json
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"es6.module": {
|
||||||
|
"chrome": "61",
|
||||||
|
"and_chr": "61",
|
||||||
|
"edge": "16",
|
||||||
|
"firefox": "60",
|
||||||
|
"and_ff": "60",
|
||||||
|
"node": "13.2.0",
|
||||||
|
"opera": "48",
|
||||||
|
"op_mob": "45",
|
||||||
|
"safari": "10.1",
|
||||||
|
"ios": "10.3",
|
||||||
|
"samsung": "8.2",
|
||||||
|
"android": "61",
|
||||||
|
"electron": "2.0",
|
||||||
|
"ios_saf": "10.3"
|
||||||
|
}
|
||||||
|
}
|
||||||
38
counter-frontend/node_modules/@babel/compat-data/data/overlapping-plugins.json
generated
vendored
Normal file
38
counter-frontend/node_modules/@babel/compat-data/data/overlapping-plugins.json
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"transform-async-to-generator": [
|
||||||
|
"bugfix/transform-async-arrows-in-class"
|
||||||
|
],
|
||||||
|
"transform-parameters": [
|
||||||
|
"bugfix/transform-edge-default-parameters",
|
||||||
|
"bugfix/transform-safari-id-destructuring-collision-in-function-expression"
|
||||||
|
],
|
||||||
|
"transform-function-name": [
|
||||||
|
"bugfix/transform-edge-function-name"
|
||||||
|
],
|
||||||
|
"transform-block-scoping": [
|
||||||
|
"bugfix/transform-safari-block-shadowing",
|
||||||
|
"bugfix/transform-safari-for-shadowing"
|
||||||
|
],
|
||||||
|
"transform-destructuring": [
|
||||||
|
"bugfix/transform-safari-rest-destructuring-rhs-array"
|
||||||
|
],
|
||||||
|
"transform-template-literals": [
|
||||||
|
"bugfix/transform-tagged-template-caching"
|
||||||
|
],
|
||||||
|
"transform-optional-chaining": [
|
||||||
|
"bugfix/transform-v8-spread-parameters-in-optional-chaining"
|
||||||
|
],
|
||||||
|
"proposal-optional-chaining": [
|
||||||
|
"bugfix/transform-v8-spread-parameters-in-optional-chaining"
|
||||||
|
],
|
||||||
|
"transform-class-properties": [
|
||||||
|
"bugfix/transform-v8-static-class-fields-redefine-readonly",
|
||||||
|
"bugfix/transform-firefox-class-in-computed-class-key",
|
||||||
|
"bugfix/transform-safari-class-field-initializer-scope"
|
||||||
|
],
|
||||||
|
"proposal-class-properties": [
|
||||||
|
"bugfix/transform-v8-static-class-fields-redefine-readonly",
|
||||||
|
"bugfix/transform-firefox-class-in-computed-class-key",
|
||||||
|
"bugfix/transform-safari-class-field-initializer-scope"
|
||||||
|
]
|
||||||
|
}
|
||||||
231
counter-frontend/node_modules/@babel/compat-data/data/plugin-bugfixes.json
generated
vendored
Normal file
231
counter-frontend/node_modules/@babel/compat-data/data/plugin-bugfixes.json
generated
vendored
Normal file
@@ -0,0 +1,231 @@
|
|||||||
|
{
|
||||||
|
"bugfix/transform-async-arrows-in-class": {
|
||||||
|
"chrome": "55",
|
||||||
|
"opera": "42",
|
||||||
|
"edge": "15",
|
||||||
|
"firefox": "52",
|
||||||
|
"safari": "11",
|
||||||
|
"node": "7.6",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "11",
|
||||||
|
"samsung": "6",
|
||||||
|
"opera_mobile": "42",
|
||||||
|
"electron": "1.6"
|
||||||
|
},
|
||||||
|
"bugfix/transform-edge-default-parameters": {
|
||||||
|
"chrome": "49",
|
||||||
|
"opera": "36",
|
||||||
|
"edge": "18",
|
||||||
|
"firefox": "52",
|
||||||
|
"safari": "10",
|
||||||
|
"node": "6",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "10",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "36",
|
||||||
|
"electron": "0.37"
|
||||||
|
},
|
||||||
|
"bugfix/transform-edge-function-name": {
|
||||||
|
"chrome": "51",
|
||||||
|
"opera": "38",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "53",
|
||||||
|
"safari": "10",
|
||||||
|
"node": "6.5",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "10",
|
||||||
|
"samsung": "5",
|
||||||
|
"rhino": "1.9",
|
||||||
|
"opera_mobile": "41",
|
||||||
|
"electron": "1.2"
|
||||||
|
},
|
||||||
|
"bugfix/transform-safari-block-shadowing": {
|
||||||
|
"chrome": "49",
|
||||||
|
"opera": "36",
|
||||||
|
"edge": "12",
|
||||||
|
"firefox": "44",
|
||||||
|
"safari": "11",
|
||||||
|
"node": "6",
|
||||||
|
"deno": "1",
|
||||||
|
"ie": "11",
|
||||||
|
"ios": "11",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "36",
|
||||||
|
"electron": "0.37"
|
||||||
|
},
|
||||||
|
"bugfix/transform-safari-for-shadowing": {
|
||||||
|
"chrome": "49",
|
||||||
|
"opera": "36",
|
||||||
|
"edge": "12",
|
||||||
|
"firefox": "4",
|
||||||
|
"safari": "11",
|
||||||
|
"node": "6",
|
||||||
|
"deno": "1",
|
||||||
|
"ie": "11",
|
||||||
|
"ios": "11",
|
||||||
|
"samsung": "5",
|
||||||
|
"rhino": "1.7.13",
|
||||||
|
"opera_mobile": "36",
|
||||||
|
"electron": "0.37"
|
||||||
|
},
|
||||||
|
"bugfix/transform-safari-id-destructuring-collision-in-function-expression": {
|
||||||
|
"chrome": "49",
|
||||||
|
"opera": "36",
|
||||||
|
"edge": "14",
|
||||||
|
"firefox": "2",
|
||||||
|
"safari": "16.3",
|
||||||
|
"node": "6",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "16.3",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "36",
|
||||||
|
"electron": "0.37"
|
||||||
|
},
|
||||||
|
"bugfix/transform-safari-rest-destructuring-rhs-array": {
|
||||||
|
"chrome": "49",
|
||||||
|
"opera": "36",
|
||||||
|
"edge": "14",
|
||||||
|
"firefox": "34",
|
||||||
|
"safari": "14.1",
|
||||||
|
"node": "6",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "14.5",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "36",
|
||||||
|
"electron": "0.37"
|
||||||
|
},
|
||||||
|
"bugfix/transform-tagged-template-caching": {
|
||||||
|
"chrome": "41",
|
||||||
|
"opera": "28",
|
||||||
|
"edge": "12",
|
||||||
|
"firefox": "34",
|
||||||
|
"safari": "13",
|
||||||
|
"node": "4",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "13",
|
||||||
|
"samsung": "3.4",
|
||||||
|
"rhino": "1.7.14",
|
||||||
|
"opera_mobile": "28",
|
||||||
|
"electron": "0.21"
|
||||||
|
},
|
||||||
|
"bugfix/transform-v8-spread-parameters-in-optional-chaining": {
|
||||||
|
"chrome": "91",
|
||||||
|
"opera": "77",
|
||||||
|
"edge": "91",
|
||||||
|
"firefox": "74",
|
||||||
|
"safari": "13.1",
|
||||||
|
"node": "16.9",
|
||||||
|
"deno": "1.9",
|
||||||
|
"ios": "13.4",
|
||||||
|
"samsung": "16",
|
||||||
|
"opera_mobile": "64",
|
||||||
|
"electron": "13.0"
|
||||||
|
},
|
||||||
|
"transform-optional-chaining": {
|
||||||
|
"chrome": "80",
|
||||||
|
"opera": "67",
|
||||||
|
"edge": "80",
|
||||||
|
"firefox": "74",
|
||||||
|
"safari": "13.1",
|
||||||
|
"node": "14",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "13.4",
|
||||||
|
"samsung": "13",
|
||||||
|
"rhino": "1.8",
|
||||||
|
"opera_mobile": "57",
|
||||||
|
"electron": "8.0"
|
||||||
|
},
|
||||||
|
"proposal-optional-chaining": {
|
||||||
|
"chrome": "80",
|
||||||
|
"opera": "67",
|
||||||
|
"edge": "80",
|
||||||
|
"firefox": "74",
|
||||||
|
"safari": "13.1",
|
||||||
|
"node": "14",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "13.4",
|
||||||
|
"samsung": "13",
|
||||||
|
"rhino": "1.8",
|
||||||
|
"opera_mobile": "57",
|
||||||
|
"electron": "8.0"
|
||||||
|
},
|
||||||
|
"transform-parameters": {
|
||||||
|
"chrome": "49",
|
||||||
|
"opera": "36",
|
||||||
|
"edge": "15",
|
||||||
|
"firefox": "52",
|
||||||
|
"safari": "10",
|
||||||
|
"node": "6",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "10",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "36",
|
||||||
|
"electron": "0.37"
|
||||||
|
},
|
||||||
|
"transform-async-to-generator": {
|
||||||
|
"chrome": "55",
|
||||||
|
"opera": "42",
|
||||||
|
"edge": "15",
|
||||||
|
"firefox": "52",
|
||||||
|
"safari": "10.1",
|
||||||
|
"node": "7.6",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "10.3",
|
||||||
|
"samsung": "6",
|
||||||
|
"opera_mobile": "42",
|
||||||
|
"electron": "1.6"
|
||||||
|
},
|
||||||
|
"transform-template-literals": {
|
||||||
|
"chrome": "41",
|
||||||
|
"opera": "28",
|
||||||
|
"edge": "13",
|
||||||
|
"firefox": "34",
|
||||||
|
"safari": "9",
|
||||||
|
"node": "4",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "9",
|
||||||
|
"samsung": "3.4",
|
||||||
|
"rhino": "1.9",
|
||||||
|
"opera_mobile": "28",
|
||||||
|
"electron": "0.21"
|
||||||
|
},
|
||||||
|
"transform-function-name": {
|
||||||
|
"chrome": "51",
|
||||||
|
"opera": "38",
|
||||||
|
"edge": "14",
|
||||||
|
"firefox": "53",
|
||||||
|
"safari": "10",
|
||||||
|
"node": "6.5",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "10",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "41",
|
||||||
|
"electron": "1.2"
|
||||||
|
},
|
||||||
|
"transform-destructuring": {
|
||||||
|
"chrome": "51",
|
||||||
|
"opera": "38",
|
||||||
|
"edge": "15",
|
||||||
|
"firefox": "53",
|
||||||
|
"safari": "10",
|
||||||
|
"node": "6.5",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "10",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "41",
|
||||||
|
"electron": "1.2"
|
||||||
|
},
|
||||||
|
"transform-block-scoping": {
|
||||||
|
"chrome": "50",
|
||||||
|
"opera": "37",
|
||||||
|
"edge": "14",
|
||||||
|
"firefox": "53",
|
||||||
|
"safari": "10",
|
||||||
|
"node": "6",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "10",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "37",
|
||||||
|
"electron": "1.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
843
counter-frontend/node_modules/@babel/compat-data/data/plugins.json
generated
vendored
Normal file
843
counter-frontend/node_modules/@babel/compat-data/data/plugins.json
generated
vendored
Normal file
@@ -0,0 +1,843 @@
|
|||||||
|
{
|
||||||
|
"transform-explicit-resource-management": {
|
||||||
|
"chrome": "141",
|
||||||
|
"edge": "141",
|
||||||
|
"firefox": "141",
|
||||||
|
"node": "25",
|
||||||
|
"electron": "39.0"
|
||||||
|
},
|
||||||
|
"transform-duplicate-named-capturing-groups-regex": {
|
||||||
|
"chrome": "126",
|
||||||
|
"opera": "112",
|
||||||
|
"edge": "126",
|
||||||
|
"firefox": "129",
|
||||||
|
"safari": "17.4",
|
||||||
|
"node": "23",
|
||||||
|
"ios": "17.4",
|
||||||
|
"rhino": "1.9",
|
||||||
|
"electron": "31.0"
|
||||||
|
},
|
||||||
|
"transform-regexp-modifiers": {
|
||||||
|
"chrome": "125",
|
||||||
|
"opera": "111",
|
||||||
|
"edge": "125",
|
||||||
|
"firefox": "132",
|
||||||
|
"node": "23",
|
||||||
|
"samsung": "27",
|
||||||
|
"electron": "31.0"
|
||||||
|
},
|
||||||
|
"transform-unicode-sets-regex": {
|
||||||
|
"chrome": "112",
|
||||||
|
"opera": "98",
|
||||||
|
"edge": "112",
|
||||||
|
"firefox": "116",
|
||||||
|
"safari": "17",
|
||||||
|
"node": "20",
|
||||||
|
"deno": "1.32",
|
||||||
|
"ios": "17",
|
||||||
|
"samsung": "23",
|
||||||
|
"opera_mobile": "75",
|
||||||
|
"electron": "24.0"
|
||||||
|
},
|
||||||
|
"bugfix/transform-v8-static-class-fields-redefine-readonly": {
|
||||||
|
"chrome": "98",
|
||||||
|
"opera": "84",
|
||||||
|
"edge": "98",
|
||||||
|
"firefox": "75",
|
||||||
|
"safari": "15",
|
||||||
|
"node": "12",
|
||||||
|
"deno": "1.18",
|
||||||
|
"ios": "15",
|
||||||
|
"samsung": "11",
|
||||||
|
"opera_mobile": "52",
|
||||||
|
"electron": "17.0"
|
||||||
|
},
|
||||||
|
"bugfix/transform-firefox-class-in-computed-class-key": {
|
||||||
|
"chrome": "74",
|
||||||
|
"opera": "62",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "126",
|
||||||
|
"safari": "16",
|
||||||
|
"node": "12",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "16",
|
||||||
|
"samsung": "11",
|
||||||
|
"opera_mobile": "53",
|
||||||
|
"electron": "6.0"
|
||||||
|
},
|
||||||
|
"bugfix/transform-safari-class-field-initializer-scope": {
|
||||||
|
"chrome": "74",
|
||||||
|
"opera": "62",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "69",
|
||||||
|
"safari": "16",
|
||||||
|
"node": "12",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "16",
|
||||||
|
"samsung": "11",
|
||||||
|
"opera_mobile": "53",
|
||||||
|
"electron": "6.0"
|
||||||
|
},
|
||||||
|
"transform-class-static-block": {
|
||||||
|
"chrome": "94",
|
||||||
|
"opera": "80",
|
||||||
|
"edge": "94",
|
||||||
|
"firefox": "93",
|
||||||
|
"safari": "16.4",
|
||||||
|
"node": "16.11",
|
||||||
|
"deno": "1.14",
|
||||||
|
"ios": "16.4",
|
||||||
|
"samsung": "17",
|
||||||
|
"opera_mobile": "66",
|
||||||
|
"electron": "15.0"
|
||||||
|
},
|
||||||
|
"proposal-class-static-block": {
|
||||||
|
"chrome": "94",
|
||||||
|
"opera": "80",
|
||||||
|
"edge": "94",
|
||||||
|
"firefox": "93",
|
||||||
|
"safari": "16.4",
|
||||||
|
"node": "16.11",
|
||||||
|
"deno": "1.14",
|
||||||
|
"ios": "16.4",
|
||||||
|
"samsung": "17",
|
||||||
|
"opera_mobile": "66",
|
||||||
|
"electron": "15.0"
|
||||||
|
},
|
||||||
|
"transform-private-property-in-object": {
|
||||||
|
"chrome": "91",
|
||||||
|
"opera": "77",
|
||||||
|
"edge": "91",
|
||||||
|
"firefox": "90",
|
||||||
|
"safari": "15",
|
||||||
|
"node": "16.9",
|
||||||
|
"deno": "1.9",
|
||||||
|
"ios": "15",
|
||||||
|
"samsung": "16",
|
||||||
|
"opera_mobile": "64",
|
||||||
|
"electron": "13.0"
|
||||||
|
},
|
||||||
|
"proposal-private-property-in-object": {
|
||||||
|
"chrome": "91",
|
||||||
|
"opera": "77",
|
||||||
|
"edge": "91",
|
||||||
|
"firefox": "90",
|
||||||
|
"safari": "15",
|
||||||
|
"node": "16.9",
|
||||||
|
"deno": "1.9",
|
||||||
|
"ios": "15",
|
||||||
|
"samsung": "16",
|
||||||
|
"opera_mobile": "64",
|
||||||
|
"electron": "13.0"
|
||||||
|
},
|
||||||
|
"transform-class-properties": {
|
||||||
|
"chrome": "74",
|
||||||
|
"opera": "62",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "90",
|
||||||
|
"safari": "14.1",
|
||||||
|
"node": "12",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "14.5",
|
||||||
|
"samsung": "11",
|
||||||
|
"opera_mobile": "53",
|
||||||
|
"electron": "6.0"
|
||||||
|
},
|
||||||
|
"proposal-class-properties": {
|
||||||
|
"chrome": "74",
|
||||||
|
"opera": "62",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "90",
|
||||||
|
"safari": "14.1",
|
||||||
|
"node": "12",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "14.5",
|
||||||
|
"samsung": "11",
|
||||||
|
"opera_mobile": "53",
|
||||||
|
"electron": "6.0"
|
||||||
|
},
|
||||||
|
"transform-private-methods": {
|
||||||
|
"chrome": "84",
|
||||||
|
"opera": "70",
|
||||||
|
"edge": "84",
|
||||||
|
"firefox": "90",
|
||||||
|
"safari": "15",
|
||||||
|
"node": "14.6",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "15",
|
||||||
|
"samsung": "14",
|
||||||
|
"opera_mobile": "60",
|
||||||
|
"electron": "10.0"
|
||||||
|
},
|
||||||
|
"proposal-private-methods": {
|
||||||
|
"chrome": "84",
|
||||||
|
"opera": "70",
|
||||||
|
"edge": "84",
|
||||||
|
"firefox": "90",
|
||||||
|
"safari": "15",
|
||||||
|
"node": "14.6",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "15",
|
||||||
|
"samsung": "14",
|
||||||
|
"opera_mobile": "60",
|
||||||
|
"electron": "10.0"
|
||||||
|
},
|
||||||
|
"transform-numeric-separator": {
|
||||||
|
"chrome": "75",
|
||||||
|
"opera": "62",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "70",
|
||||||
|
"safari": "13",
|
||||||
|
"node": "12.5",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "13",
|
||||||
|
"samsung": "11",
|
||||||
|
"rhino": "1.7.14",
|
||||||
|
"opera_mobile": "54",
|
||||||
|
"electron": "6.0"
|
||||||
|
},
|
||||||
|
"proposal-numeric-separator": {
|
||||||
|
"chrome": "75",
|
||||||
|
"opera": "62",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "70",
|
||||||
|
"safari": "13",
|
||||||
|
"node": "12.5",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "13",
|
||||||
|
"samsung": "11",
|
||||||
|
"rhino": "1.7.14",
|
||||||
|
"opera_mobile": "54",
|
||||||
|
"electron": "6.0"
|
||||||
|
},
|
||||||
|
"transform-logical-assignment-operators": {
|
||||||
|
"chrome": "85",
|
||||||
|
"opera": "71",
|
||||||
|
"edge": "85",
|
||||||
|
"firefox": "79",
|
||||||
|
"safari": "14",
|
||||||
|
"node": "15",
|
||||||
|
"deno": "1.2",
|
||||||
|
"ios": "14",
|
||||||
|
"samsung": "14",
|
||||||
|
"opera_mobile": "60",
|
||||||
|
"electron": "10.0"
|
||||||
|
},
|
||||||
|
"proposal-logical-assignment-operators": {
|
||||||
|
"chrome": "85",
|
||||||
|
"opera": "71",
|
||||||
|
"edge": "85",
|
||||||
|
"firefox": "79",
|
||||||
|
"safari": "14",
|
||||||
|
"node": "15",
|
||||||
|
"deno": "1.2",
|
||||||
|
"ios": "14",
|
||||||
|
"samsung": "14",
|
||||||
|
"opera_mobile": "60",
|
||||||
|
"electron": "10.0"
|
||||||
|
},
|
||||||
|
"transform-nullish-coalescing-operator": {
|
||||||
|
"chrome": "80",
|
||||||
|
"opera": "67",
|
||||||
|
"edge": "80",
|
||||||
|
"firefox": "72",
|
||||||
|
"safari": "13.1",
|
||||||
|
"node": "14",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "13.4",
|
||||||
|
"samsung": "13",
|
||||||
|
"rhino": "1.8",
|
||||||
|
"opera_mobile": "57",
|
||||||
|
"electron": "8.0"
|
||||||
|
},
|
||||||
|
"proposal-nullish-coalescing-operator": {
|
||||||
|
"chrome": "80",
|
||||||
|
"opera": "67",
|
||||||
|
"edge": "80",
|
||||||
|
"firefox": "72",
|
||||||
|
"safari": "13.1",
|
||||||
|
"node": "14",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "13.4",
|
||||||
|
"samsung": "13",
|
||||||
|
"rhino": "1.8",
|
||||||
|
"opera_mobile": "57",
|
||||||
|
"electron": "8.0"
|
||||||
|
},
|
||||||
|
"transform-optional-chaining": {
|
||||||
|
"chrome": "91",
|
||||||
|
"opera": "77",
|
||||||
|
"edge": "91",
|
||||||
|
"firefox": "74",
|
||||||
|
"safari": "13.1",
|
||||||
|
"node": "16.9",
|
||||||
|
"deno": "1.9",
|
||||||
|
"ios": "13.4",
|
||||||
|
"samsung": "16",
|
||||||
|
"opera_mobile": "64",
|
||||||
|
"electron": "13.0"
|
||||||
|
},
|
||||||
|
"proposal-optional-chaining": {
|
||||||
|
"chrome": "91",
|
||||||
|
"opera": "77",
|
||||||
|
"edge": "91",
|
||||||
|
"firefox": "74",
|
||||||
|
"safari": "13.1",
|
||||||
|
"node": "16.9",
|
||||||
|
"deno": "1.9",
|
||||||
|
"ios": "13.4",
|
||||||
|
"samsung": "16",
|
||||||
|
"opera_mobile": "64",
|
||||||
|
"electron": "13.0"
|
||||||
|
},
|
||||||
|
"transform-json-strings": {
|
||||||
|
"chrome": "66",
|
||||||
|
"opera": "53",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "62",
|
||||||
|
"safari": "12",
|
||||||
|
"node": "10",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "12",
|
||||||
|
"samsung": "9",
|
||||||
|
"rhino": "1.7.14",
|
||||||
|
"opera_mobile": "47",
|
||||||
|
"electron": "3.0"
|
||||||
|
},
|
||||||
|
"proposal-json-strings": {
|
||||||
|
"chrome": "66",
|
||||||
|
"opera": "53",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "62",
|
||||||
|
"safari": "12",
|
||||||
|
"node": "10",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "12",
|
||||||
|
"samsung": "9",
|
||||||
|
"rhino": "1.7.14",
|
||||||
|
"opera_mobile": "47",
|
||||||
|
"electron": "3.0"
|
||||||
|
},
|
||||||
|
"transform-optional-catch-binding": {
|
||||||
|
"chrome": "66",
|
||||||
|
"opera": "53",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "58",
|
||||||
|
"safari": "11.1",
|
||||||
|
"node": "10",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "11.3",
|
||||||
|
"samsung": "9",
|
||||||
|
"opera_mobile": "47",
|
||||||
|
"electron": "3.0"
|
||||||
|
},
|
||||||
|
"proposal-optional-catch-binding": {
|
||||||
|
"chrome": "66",
|
||||||
|
"opera": "53",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "58",
|
||||||
|
"safari": "11.1",
|
||||||
|
"node": "10",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "11.3",
|
||||||
|
"samsung": "9",
|
||||||
|
"opera_mobile": "47",
|
||||||
|
"electron": "3.0"
|
||||||
|
},
|
||||||
|
"transform-parameters": {
|
||||||
|
"chrome": "49",
|
||||||
|
"opera": "36",
|
||||||
|
"edge": "18",
|
||||||
|
"firefox": "52",
|
||||||
|
"safari": "16.3",
|
||||||
|
"node": "6",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "16.3",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "36",
|
||||||
|
"electron": "0.37"
|
||||||
|
},
|
||||||
|
"transform-async-generator-functions": {
|
||||||
|
"chrome": "63",
|
||||||
|
"opera": "50",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "57",
|
||||||
|
"safari": "12",
|
||||||
|
"node": "10",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "12",
|
||||||
|
"samsung": "8",
|
||||||
|
"opera_mobile": "46",
|
||||||
|
"electron": "3.0"
|
||||||
|
},
|
||||||
|
"proposal-async-generator-functions": {
|
||||||
|
"chrome": "63",
|
||||||
|
"opera": "50",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "57",
|
||||||
|
"safari": "12",
|
||||||
|
"node": "10",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "12",
|
||||||
|
"samsung": "8",
|
||||||
|
"opera_mobile": "46",
|
||||||
|
"electron": "3.0"
|
||||||
|
},
|
||||||
|
"transform-object-rest-spread": {
|
||||||
|
"chrome": "60",
|
||||||
|
"opera": "47",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "55",
|
||||||
|
"safari": "11.1",
|
||||||
|
"node": "8.3",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "11.3",
|
||||||
|
"samsung": "8",
|
||||||
|
"opera_mobile": "44",
|
||||||
|
"electron": "2.0"
|
||||||
|
},
|
||||||
|
"proposal-object-rest-spread": {
|
||||||
|
"chrome": "60",
|
||||||
|
"opera": "47",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "55",
|
||||||
|
"safari": "11.1",
|
||||||
|
"node": "8.3",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "11.3",
|
||||||
|
"samsung": "8",
|
||||||
|
"opera_mobile": "44",
|
||||||
|
"electron": "2.0"
|
||||||
|
},
|
||||||
|
"transform-dotall-regex": {
|
||||||
|
"chrome": "62",
|
||||||
|
"opera": "49",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "78",
|
||||||
|
"safari": "11.1",
|
||||||
|
"node": "8.10",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "11.3",
|
||||||
|
"samsung": "8",
|
||||||
|
"rhino": "1.7.15",
|
||||||
|
"opera_mobile": "46",
|
||||||
|
"electron": "3.0"
|
||||||
|
},
|
||||||
|
"transform-unicode-property-regex": {
|
||||||
|
"chrome": "64",
|
||||||
|
"opera": "51",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "78",
|
||||||
|
"safari": "11.1",
|
||||||
|
"node": "10",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "11.3",
|
||||||
|
"samsung": "9",
|
||||||
|
"rhino": "1.9",
|
||||||
|
"opera_mobile": "47",
|
||||||
|
"electron": "3.0"
|
||||||
|
},
|
||||||
|
"proposal-unicode-property-regex": {
|
||||||
|
"chrome": "64",
|
||||||
|
"opera": "51",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "78",
|
||||||
|
"safari": "11.1",
|
||||||
|
"node": "10",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "11.3",
|
||||||
|
"samsung": "9",
|
||||||
|
"rhino": "1.9",
|
||||||
|
"opera_mobile": "47",
|
||||||
|
"electron": "3.0"
|
||||||
|
},
|
||||||
|
"transform-named-capturing-groups-regex": {
|
||||||
|
"chrome": "64",
|
||||||
|
"opera": "51",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "78",
|
||||||
|
"safari": "11.1",
|
||||||
|
"node": "10",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "11.3",
|
||||||
|
"samsung": "9",
|
||||||
|
"rhino": "1.9",
|
||||||
|
"opera_mobile": "47",
|
||||||
|
"electron": "3.0"
|
||||||
|
},
|
||||||
|
"transform-async-to-generator": {
|
||||||
|
"chrome": "55",
|
||||||
|
"opera": "42",
|
||||||
|
"edge": "15",
|
||||||
|
"firefox": "52",
|
||||||
|
"safari": "11",
|
||||||
|
"node": "7.6",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "11",
|
||||||
|
"samsung": "6",
|
||||||
|
"opera_mobile": "42",
|
||||||
|
"electron": "1.6"
|
||||||
|
},
|
||||||
|
"transform-exponentiation-operator": {
|
||||||
|
"chrome": "52",
|
||||||
|
"opera": "39",
|
||||||
|
"edge": "14",
|
||||||
|
"firefox": "52",
|
||||||
|
"safari": "10.1",
|
||||||
|
"node": "7",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "10.3",
|
||||||
|
"samsung": "6",
|
||||||
|
"rhino": "1.7.14",
|
||||||
|
"opera_mobile": "41",
|
||||||
|
"electron": "1.3"
|
||||||
|
},
|
||||||
|
"transform-template-literals": {
|
||||||
|
"chrome": "41",
|
||||||
|
"opera": "28",
|
||||||
|
"edge": "13",
|
||||||
|
"firefox": "34",
|
||||||
|
"safari": "13",
|
||||||
|
"node": "4",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "13",
|
||||||
|
"samsung": "3.4",
|
||||||
|
"rhino": "1.9",
|
||||||
|
"opera_mobile": "28",
|
||||||
|
"electron": "0.21"
|
||||||
|
},
|
||||||
|
"transform-literals": {
|
||||||
|
"chrome": "44",
|
||||||
|
"opera": "31",
|
||||||
|
"edge": "12",
|
||||||
|
"firefox": "53",
|
||||||
|
"safari": "9",
|
||||||
|
"node": "4",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "9",
|
||||||
|
"samsung": "4",
|
||||||
|
"rhino": "1.7.15",
|
||||||
|
"opera_mobile": "32",
|
||||||
|
"electron": "0.30"
|
||||||
|
},
|
||||||
|
"transform-function-name": {
|
||||||
|
"chrome": "51",
|
||||||
|
"opera": "38",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "53",
|
||||||
|
"safari": "10",
|
||||||
|
"node": "6.5",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "10",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "41",
|
||||||
|
"electron": "1.2"
|
||||||
|
},
|
||||||
|
"transform-arrow-functions": {
|
||||||
|
"chrome": "47",
|
||||||
|
"opera": "34",
|
||||||
|
"edge": "13",
|
||||||
|
"firefox": "43",
|
||||||
|
"safari": "10",
|
||||||
|
"node": "6",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "10",
|
||||||
|
"samsung": "5",
|
||||||
|
"rhino": "1.7.13",
|
||||||
|
"opera_mobile": "34",
|
||||||
|
"electron": "0.36"
|
||||||
|
},
|
||||||
|
"transform-block-scoped-functions": {
|
||||||
|
"chrome": "41",
|
||||||
|
"opera": "28",
|
||||||
|
"edge": "12",
|
||||||
|
"firefox": "46",
|
||||||
|
"safari": "10",
|
||||||
|
"node": "4",
|
||||||
|
"deno": "1",
|
||||||
|
"ie": "11",
|
||||||
|
"ios": "10",
|
||||||
|
"samsung": "3.4",
|
||||||
|
"opera_mobile": "28",
|
||||||
|
"electron": "0.21"
|
||||||
|
},
|
||||||
|
"transform-classes": {
|
||||||
|
"chrome": "46",
|
||||||
|
"opera": "33",
|
||||||
|
"edge": "13",
|
||||||
|
"firefox": "45",
|
||||||
|
"safari": "10",
|
||||||
|
"node": "5",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "10",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "33",
|
||||||
|
"electron": "0.36"
|
||||||
|
},
|
||||||
|
"transform-object-super": {
|
||||||
|
"chrome": "46",
|
||||||
|
"opera": "33",
|
||||||
|
"edge": "13",
|
||||||
|
"firefox": "45",
|
||||||
|
"safari": "10",
|
||||||
|
"node": "5",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "10",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "33",
|
||||||
|
"electron": "0.36"
|
||||||
|
},
|
||||||
|
"transform-shorthand-properties": {
|
||||||
|
"chrome": "43",
|
||||||
|
"opera": "30",
|
||||||
|
"edge": "12",
|
||||||
|
"firefox": "33",
|
||||||
|
"safari": "9",
|
||||||
|
"node": "4",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "9",
|
||||||
|
"samsung": "4",
|
||||||
|
"rhino": "1.7.14",
|
||||||
|
"opera_mobile": "30",
|
||||||
|
"electron": "0.27"
|
||||||
|
},
|
||||||
|
"transform-duplicate-keys": {
|
||||||
|
"chrome": "42",
|
||||||
|
"opera": "29",
|
||||||
|
"edge": "12",
|
||||||
|
"firefox": "34",
|
||||||
|
"safari": "9",
|
||||||
|
"node": "4",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "9",
|
||||||
|
"samsung": "3.4",
|
||||||
|
"opera_mobile": "29",
|
||||||
|
"electron": "0.25"
|
||||||
|
},
|
||||||
|
"transform-computed-properties": {
|
||||||
|
"chrome": "44",
|
||||||
|
"opera": "31",
|
||||||
|
"edge": "12",
|
||||||
|
"firefox": "34",
|
||||||
|
"safari": "7.1",
|
||||||
|
"node": "4",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "8",
|
||||||
|
"samsung": "4",
|
||||||
|
"rhino": "1.8",
|
||||||
|
"opera_mobile": "32",
|
||||||
|
"electron": "0.30"
|
||||||
|
},
|
||||||
|
"transform-for-of": {
|
||||||
|
"chrome": "51",
|
||||||
|
"opera": "38",
|
||||||
|
"edge": "15",
|
||||||
|
"firefox": "53",
|
||||||
|
"safari": "10",
|
||||||
|
"node": "6.5",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "10",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "41",
|
||||||
|
"electron": "1.2"
|
||||||
|
},
|
||||||
|
"transform-sticky-regex": {
|
||||||
|
"chrome": "49",
|
||||||
|
"opera": "36",
|
||||||
|
"edge": "13",
|
||||||
|
"firefox": "3",
|
||||||
|
"safari": "10",
|
||||||
|
"node": "6",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "10",
|
||||||
|
"samsung": "5",
|
||||||
|
"rhino": "1.7.15",
|
||||||
|
"opera_mobile": "36",
|
||||||
|
"electron": "0.37"
|
||||||
|
},
|
||||||
|
"transform-unicode-escapes": {
|
||||||
|
"chrome": "44",
|
||||||
|
"opera": "31",
|
||||||
|
"edge": "12",
|
||||||
|
"firefox": "53",
|
||||||
|
"safari": "9",
|
||||||
|
"node": "4",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "9",
|
||||||
|
"samsung": "4",
|
||||||
|
"rhino": "1.7.15",
|
||||||
|
"opera_mobile": "32",
|
||||||
|
"electron": "0.30"
|
||||||
|
},
|
||||||
|
"transform-unicode-regex": {
|
||||||
|
"chrome": "50",
|
||||||
|
"opera": "37",
|
||||||
|
"edge": "13",
|
||||||
|
"firefox": "46",
|
||||||
|
"safari": "12",
|
||||||
|
"node": "6",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "12",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "37",
|
||||||
|
"electron": "1.1"
|
||||||
|
},
|
||||||
|
"transform-spread": {
|
||||||
|
"chrome": "46",
|
||||||
|
"opera": "33",
|
||||||
|
"edge": "13",
|
||||||
|
"firefox": "45",
|
||||||
|
"safari": "10",
|
||||||
|
"node": "5",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "10",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "33",
|
||||||
|
"electron": "0.36"
|
||||||
|
},
|
||||||
|
"transform-destructuring": {
|
||||||
|
"chrome": "51",
|
||||||
|
"opera": "38",
|
||||||
|
"edge": "15",
|
||||||
|
"firefox": "53",
|
||||||
|
"safari": "14.1",
|
||||||
|
"node": "6.5",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "14.5",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "41",
|
||||||
|
"electron": "1.2"
|
||||||
|
},
|
||||||
|
"transform-block-scoping": {
|
||||||
|
"chrome": "50",
|
||||||
|
"opera": "37",
|
||||||
|
"edge": "14",
|
||||||
|
"firefox": "53",
|
||||||
|
"safari": "11",
|
||||||
|
"node": "6",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "11",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "37",
|
||||||
|
"electron": "1.1"
|
||||||
|
},
|
||||||
|
"transform-typeof-symbol": {
|
||||||
|
"chrome": "48",
|
||||||
|
"opera": "35",
|
||||||
|
"edge": "12",
|
||||||
|
"firefox": "36",
|
||||||
|
"safari": "9",
|
||||||
|
"node": "6",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "9",
|
||||||
|
"samsung": "5",
|
||||||
|
"rhino": "1.8",
|
||||||
|
"opera_mobile": "35",
|
||||||
|
"electron": "0.37"
|
||||||
|
},
|
||||||
|
"transform-new-target": {
|
||||||
|
"chrome": "46",
|
||||||
|
"opera": "33",
|
||||||
|
"edge": "14",
|
||||||
|
"firefox": "41",
|
||||||
|
"safari": "10",
|
||||||
|
"node": "5",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "10",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "33",
|
||||||
|
"electron": "0.36"
|
||||||
|
},
|
||||||
|
"transform-regenerator": {
|
||||||
|
"chrome": "50",
|
||||||
|
"opera": "37",
|
||||||
|
"edge": "13",
|
||||||
|
"firefox": "53",
|
||||||
|
"safari": "10",
|
||||||
|
"node": "6",
|
||||||
|
"deno": "1",
|
||||||
|
"ios": "10",
|
||||||
|
"samsung": "5",
|
||||||
|
"opera_mobile": "37",
|
||||||
|
"electron": "1.1"
|
||||||
|
},
|
||||||
|
"transform-member-expression-literals": {
|
||||||
|
"chrome": "7",
|
||||||
|
"opera": "12",
|
||||||
|
"edge": "12",
|
||||||
|
"firefox": "2",
|
||||||
|
"safari": "5.1",
|
||||||
|
"node": "0.4",
|
||||||
|
"deno": "1",
|
||||||
|
"ie": "9",
|
||||||
|
"android": "4",
|
||||||
|
"ios": "6",
|
||||||
|
"phantom": "1.9",
|
||||||
|
"samsung": "1",
|
||||||
|
"rhino": "1.7.13",
|
||||||
|
"opera_mobile": "12",
|
||||||
|
"electron": "0.20"
|
||||||
|
},
|
||||||
|
"transform-property-literals": {
|
||||||
|
"chrome": "7",
|
||||||
|
"opera": "12",
|
||||||
|
"edge": "12",
|
||||||
|
"firefox": "2",
|
||||||
|
"safari": "5.1",
|
||||||
|
"node": "0.4",
|
||||||
|
"deno": "1",
|
||||||
|
"ie": "9",
|
||||||
|
"android": "4",
|
||||||
|
"ios": "6",
|
||||||
|
"phantom": "1.9",
|
||||||
|
"samsung": "1",
|
||||||
|
"rhino": "1.7.13",
|
||||||
|
"opera_mobile": "12",
|
||||||
|
"electron": "0.20"
|
||||||
|
},
|
||||||
|
"transform-reserved-words": {
|
||||||
|
"chrome": "13",
|
||||||
|
"opera": "10.50",
|
||||||
|
"edge": "12",
|
||||||
|
"firefox": "2",
|
||||||
|
"safari": "3.1",
|
||||||
|
"node": "0.6",
|
||||||
|
"deno": "1",
|
||||||
|
"ie": "9",
|
||||||
|
"android": "4.4",
|
||||||
|
"ios": "6",
|
||||||
|
"phantom": "1.9",
|
||||||
|
"samsung": "1",
|
||||||
|
"rhino": "1.7.13",
|
||||||
|
"opera_mobile": "10.1",
|
||||||
|
"electron": "0.20"
|
||||||
|
},
|
||||||
|
"transform-export-namespace-from": {
|
||||||
|
"chrome": "72",
|
||||||
|
"deno": "1.0",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "80",
|
||||||
|
"node": "13.2.0",
|
||||||
|
"opera": "60",
|
||||||
|
"opera_mobile": "51",
|
||||||
|
"safari": "14.1",
|
||||||
|
"ios": "14.5",
|
||||||
|
"samsung": "11.0",
|
||||||
|
"android": "72",
|
||||||
|
"electron": "5.0"
|
||||||
|
},
|
||||||
|
"proposal-export-namespace-from": {
|
||||||
|
"chrome": "72",
|
||||||
|
"deno": "1.0",
|
||||||
|
"edge": "79",
|
||||||
|
"firefox": "80",
|
||||||
|
"node": "13.2.0",
|
||||||
|
"opera": "60",
|
||||||
|
"opera_mobile": "51",
|
||||||
|
"safari": "14.1",
|
||||||
|
"ios": "14.5",
|
||||||
|
"samsung": "11.0",
|
||||||
|
"android": "72",
|
||||||
|
"electron": "5.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
2
counter-frontend/node_modules/@babel/compat-data/native-modules.js
generated
vendored
Normal file
2
counter-frontend/node_modules/@babel/compat-data/native-modules.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
|
||||||
|
module.exports = require("./data/native-modules.json");
|
||||||
2
counter-frontend/node_modules/@babel/compat-data/overlapping-plugins.js
generated
vendored
Normal file
2
counter-frontend/node_modules/@babel/compat-data/overlapping-plugins.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
|
||||||
|
module.exports = require("./data/overlapping-plugins.json");
|
||||||
40
counter-frontend/node_modules/@babel/compat-data/package.json
generated
vendored
Normal file
40
counter-frontend/node_modules/@babel/compat-data/package.json
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"name": "@babel/compat-data",
|
||||||
|
"version": "7.29.7",
|
||||||
|
"author": "The Babel Team (https://babel.dev/team)",
|
||||||
|
"license": "MIT",
|
||||||
|
"description": "The compat-data to determine required Babel plugins",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/babel/babel.git",
|
||||||
|
"directory": "packages/babel-compat-data"
|
||||||
|
},
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"exports": {
|
||||||
|
"./plugins": "./plugins.js",
|
||||||
|
"./native-modules": "./native-modules.js",
|
||||||
|
"./corejs2-built-ins": "./corejs2-built-ins.js",
|
||||||
|
"./corejs3-shipped-proposals": "./corejs3-shipped-proposals.js",
|
||||||
|
"./overlapping-plugins": "./overlapping-plugins.js",
|
||||||
|
"./plugin-bugfixes": "./plugin-bugfixes.js"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build-data": "./scripts/download-compat-table.sh && node ./scripts/build-data.mjs && node ./scripts/build-modules-support.mjs && node ./scripts/build-bugfixes-targets.mjs"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"babel",
|
||||||
|
"compat-table",
|
||||||
|
"compat-data"
|
||||||
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"@mdn/browser-compat-data": "^6.0.8",
|
||||||
|
"core-js-compat": "^3.48.0",
|
||||||
|
"electron-to-chromium": "^1.5.278"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6.9.0"
|
||||||
|
},
|
||||||
|
"type": "commonjs"
|
||||||
|
}
|
||||||
2
counter-frontend/node_modules/@babel/compat-data/plugin-bugfixes.js
generated
vendored
Normal file
2
counter-frontend/node_modules/@babel/compat-data/plugin-bugfixes.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
|
||||||
|
module.exports = require("./data/plugin-bugfixes.json");
|
||||||
2
counter-frontend/node_modules/@babel/compat-data/plugins.js
generated
vendored
Normal file
2
counter-frontend/node_modules/@babel/compat-data/plugins.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly
|
||||||
|
module.exports = require("./data/plugins.json");
|
||||||
22
counter-frontend/node_modules/@babel/core/LICENSE
generated
vendored
Normal file
22
counter-frontend/node_modules/@babel/core/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
19
counter-frontend/node_modules/@babel/core/README.md
generated
vendored
Normal file
19
counter-frontend/node_modules/@babel/core/README.md
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# @babel/core
|
||||||
|
|
||||||
|
> Babel compiler core.
|
||||||
|
|
||||||
|
See our website [@babel/core](https://babeljs.io/docs/babel-core) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20core%22+is%3Aopen) associated with this package.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
Using npm:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install --save-dev @babel/core
|
||||||
|
```
|
||||||
|
|
||||||
|
or using yarn:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
yarn add @babel/core --dev
|
||||||
|
```
|
||||||
5
counter-frontend/node_modules/@babel/core/lib/config/cache-contexts.js
generated
vendored
Normal file
5
counter-frontend/node_modules/@babel/core/lib/config/cache-contexts.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
0 && 0;
|
||||||
|
|
||||||
|
//# sourceMappingURL=cache-contexts.js.map
|
||||||
1
counter-frontend/node_modules/@babel/core/lib/config/cache-contexts.js.map
generated
vendored
Normal file
1
counter-frontend/node_modules/@babel/core/lib/config/cache-contexts.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"names":[],"sources":["../../src/config/cache-contexts.ts"],"sourcesContent":["import type { ConfigContext } from \"./config-chain.ts\";\nimport type {\n CallerMetadata,\n TargetsListOrObject,\n} from \"./validation/options.ts\";\n\nexport type { ConfigContext as FullConfig };\n\nexport type FullPreset = {\n targets: TargetsListOrObject;\n} & ConfigContext;\nexport type FullPlugin = {\n assumptions: Record<string, boolean>;\n} & FullPreset;\n\n// Context not including filename since it is used in places that cannot\n// process 'ignore'/'only' and other filename-based logic.\nexport type SimpleConfig = {\n envName: string;\n caller: CallerMetadata | undefined;\n};\nexport type SimplePreset = {\n targets: TargetsListOrObject;\n} & SimpleConfig;\nexport type SimplePlugin = {\n assumptions: Record<string, boolean>;\n} & SimplePreset;\n"],"mappings":"","ignoreList":[]}
|
||||||
261
counter-frontend/node_modules/@babel/core/lib/config/caching.js
generated
vendored
Normal file
261
counter-frontend/node_modules/@babel/core/lib/config/caching.js
generated
vendored
Normal file
@@ -0,0 +1,261 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.assertSimpleType = assertSimpleType;
|
||||||
|
exports.makeStrongCache = makeStrongCache;
|
||||||
|
exports.makeStrongCacheSync = makeStrongCacheSync;
|
||||||
|
exports.makeWeakCache = makeWeakCache;
|
||||||
|
exports.makeWeakCacheSync = makeWeakCacheSync;
|
||||||
|
function _gensync() {
|
||||||
|
const data = require("gensync");
|
||||||
|
_gensync = function () {
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
var _async = require("../gensync-utils/async.js");
|
||||||
|
var _util = require("./util.js");
|
||||||
|
const synchronize = gen => {
|
||||||
|
return _gensync()(gen).sync;
|
||||||
|
};
|
||||||
|
function* genTrue() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
function makeWeakCache(handler) {
|
||||||
|
return makeCachedFunction(WeakMap, handler);
|
||||||
|
}
|
||||||
|
function makeWeakCacheSync(handler) {
|
||||||
|
return synchronize(makeWeakCache(handler));
|
||||||
|
}
|
||||||
|
function makeStrongCache(handler) {
|
||||||
|
return makeCachedFunction(Map, handler);
|
||||||
|
}
|
||||||
|
function makeStrongCacheSync(handler) {
|
||||||
|
return synchronize(makeStrongCache(handler));
|
||||||
|
}
|
||||||
|
function makeCachedFunction(CallCache, handler) {
|
||||||
|
const callCacheSync = new CallCache();
|
||||||
|
const callCacheAsync = new CallCache();
|
||||||
|
const futureCache = new CallCache();
|
||||||
|
return function* cachedFunction(arg, data) {
|
||||||
|
const asyncContext = yield* (0, _async.isAsync)();
|
||||||
|
const callCache = asyncContext ? callCacheAsync : callCacheSync;
|
||||||
|
const cached = yield* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data);
|
||||||
|
if (cached.valid) return cached.value;
|
||||||
|
const cache = new CacheConfigurator(data);
|
||||||
|
const handlerResult = handler(arg, cache);
|
||||||
|
let finishLock;
|
||||||
|
let value;
|
||||||
|
if ((0, _util.isIterableIterator)(handlerResult)) {
|
||||||
|
value = yield* (0, _async.onFirstPause)(handlerResult, () => {
|
||||||
|
finishLock = setupAsyncLocks(cache, futureCache, arg);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
value = handlerResult;
|
||||||
|
}
|
||||||
|
updateFunctionCache(callCache, cache, arg, value);
|
||||||
|
if (finishLock) {
|
||||||
|
futureCache.delete(arg);
|
||||||
|
finishLock.release(value);
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function* getCachedValue(cache, arg, data) {
|
||||||
|
const cachedValue = cache.get(arg);
|
||||||
|
if (cachedValue) {
|
||||||
|
for (const {
|
||||||
|
value,
|
||||||
|
valid
|
||||||
|
} of cachedValue) {
|
||||||
|
if (yield* valid(data)) return {
|
||||||
|
valid: true,
|
||||||
|
value
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
valid: false,
|
||||||
|
value: null
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data) {
|
||||||
|
const cached = yield* getCachedValue(callCache, arg, data);
|
||||||
|
if (cached.valid) {
|
||||||
|
return cached;
|
||||||
|
}
|
||||||
|
if (asyncContext) {
|
||||||
|
const cached = yield* getCachedValue(futureCache, arg, data);
|
||||||
|
if (cached.valid) {
|
||||||
|
const value = yield* (0, _async.waitFor)(cached.value.promise);
|
||||||
|
return {
|
||||||
|
valid: true,
|
||||||
|
value
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
valid: false,
|
||||||
|
value: null
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function setupAsyncLocks(config, futureCache, arg) {
|
||||||
|
const finishLock = new Lock();
|
||||||
|
updateFunctionCache(futureCache, config, arg, finishLock);
|
||||||
|
return finishLock;
|
||||||
|
}
|
||||||
|
function updateFunctionCache(cache, config, arg, value) {
|
||||||
|
if (!config.configured()) config.forever();
|
||||||
|
let cachedValue = cache.get(arg);
|
||||||
|
config.deactivate();
|
||||||
|
switch (config.mode()) {
|
||||||
|
case "forever":
|
||||||
|
cachedValue = [{
|
||||||
|
value,
|
||||||
|
valid: genTrue
|
||||||
|
}];
|
||||||
|
cache.set(arg, cachedValue);
|
||||||
|
break;
|
||||||
|
case "invalidate":
|
||||||
|
cachedValue = [{
|
||||||
|
value,
|
||||||
|
valid: config.validator()
|
||||||
|
}];
|
||||||
|
cache.set(arg, cachedValue);
|
||||||
|
break;
|
||||||
|
case "valid":
|
||||||
|
if (cachedValue) {
|
||||||
|
cachedValue.push({
|
||||||
|
value,
|
||||||
|
valid: config.validator()
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
cachedValue = [{
|
||||||
|
value,
|
||||||
|
valid: config.validator()
|
||||||
|
}];
|
||||||
|
cache.set(arg, cachedValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class CacheConfigurator {
|
||||||
|
constructor(data) {
|
||||||
|
this._active = true;
|
||||||
|
this._never = false;
|
||||||
|
this._forever = false;
|
||||||
|
this._invalidate = false;
|
||||||
|
this._configured = false;
|
||||||
|
this._pairs = [];
|
||||||
|
this._data = void 0;
|
||||||
|
this._data = data;
|
||||||
|
}
|
||||||
|
simple() {
|
||||||
|
return makeSimpleConfigurator(this);
|
||||||
|
}
|
||||||
|
mode() {
|
||||||
|
if (this._never) return "never";
|
||||||
|
if (this._forever) return "forever";
|
||||||
|
if (this._invalidate) return "invalidate";
|
||||||
|
return "valid";
|
||||||
|
}
|
||||||
|
forever() {
|
||||||
|
if (!this._active) {
|
||||||
|
throw new Error("Cannot change caching after evaluation has completed.");
|
||||||
|
}
|
||||||
|
if (this._never) {
|
||||||
|
throw new Error("Caching has already been configured with .never()");
|
||||||
|
}
|
||||||
|
this._forever = true;
|
||||||
|
this._configured = true;
|
||||||
|
}
|
||||||
|
never() {
|
||||||
|
if (!this._active) {
|
||||||
|
throw new Error("Cannot change caching after evaluation has completed.");
|
||||||
|
}
|
||||||
|
if (this._forever) {
|
||||||
|
throw new Error("Caching has already been configured with .forever()");
|
||||||
|
}
|
||||||
|
this._never = true;
|
||||||
|
this._configured = true;
|
||||||
|
}
|
||||||
|
using(handler) {
|
||||||
|
if (!this._active) {
|
||||||
|
throw new Error("Cannot change caching after evaluation has completed.");
|
||||||
|
}
|
||||||
|
if (this._never || this._forever) {
|
||||||
|
throw new Error("Caching has already been configured with .never or .forever()");
|
||||||
|
}
|
||||||
|
this._configured = true;
|
||||||
|
const key = handler(this._data);
|
||||||
|
const fn = (0, _async.maybeAsync)(handler, `You appear to be using an async cache handler, but Babel has been called synchronously`);
|
||||||
|
if ((0, _async.isThenable)(key)) {
|
||||||
|
return key.then(key => {
|
||||||
|
this._pairs.push([key, fn]);
|
||||||
|
return key;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this._pairs.push([key, fn]);
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
invalidate(handler) {
|
||||||
|
this._invalidate = true;
|
||||||
|
return this.using(handler);
|
||||||
|
}
|
||||||
|
validator() {
|
||||||
|
const pairs = this._pairs;
|
||||||
|
return function* (data) {
|
||||||
|
for (const [key, fn] of pairs) {
|
||||||
|
if (key !== (yield* fn(data))) return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
deactivate() {
|
||||||
|
this._active = false;
|
||||||
|
}
|
||||||
|
configured() {
|
||||||
|
return this._configured;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function makeSimpleConfigurator(cache) {
|
||||||
|
function cacheFn(val) {
|
||||||
|
if (typeof val === "boolean") {
|
||||||
|
if (val) cache.forever();else cache.never();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return cache.using(() => assertSimpleType(val()));
|
||||||
|
}
|
||||||
|
cacheFn.forever = () => cache.forever();
|
||||||
|
cacheFn.never = () => cache.never();
|
||||||
|
cacheFn.using = cb => cache.using(() => assertSimpleType(cb()));
|
||||||
|
cacheFn.invalidate = cb => cache.invalidate(() => assertSimpleType(cb()));
|
||||||
|
return cacheFn;
|
||||||
|
}
|
||||||
|
function assertSimpleType(value) {
|
||||||
|
if ((0, _async.isThenable)(value)) {
|
||||||
|
throw new Error(`You appear to be using an async cache handler, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously handle your caching logic.`);
|
||||||
|
}
|
||||||
|
if (value != null && typeof value !== "string" && typeof value !== "boolean" && typeof value !== "number") {
|
||||||
|
throw new Error("Cache keys must be either string, boolean, number, null, or undefined.");
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
class Lock {
|
||||||
|
constructor() {
|
||||||
|
this.released = false;
|
||||||
|
this.promise = void 0;
|
||||||
|
this._resolve = void 0;
|
||||||
|
this.promise = new Promise(resolve => {
|
||||||
|
this._resolve = resolve;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
release(value) {
|
||||||
|
this.released = true;
|
||||||
|
this._resolve(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
0 && 0;
|
||||||
|
|
||||||
|
//# sourceMappingURL=caching.js.map
|
||||||
1
counter-frontend/node_modules/@babel/core/lib/config/caching.js.map
generated
vendored
Normal file
1
counter-frontend/node_modules/@babel/core/lib/config/caching.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
469
counter-frontend/node_modules/@babel/core/lib/config/config-chain.js
generated
vendored
Normal file
469
counter-frontend/node_modules/@babel/core/lib/config/config-chain.js
generated
vendored
Normal file
@@ -0,0 +1,469 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.buildPresetChain = buildPresetChain;
|
||||||
|
exports.buildPresetChainWalker = void 0;
|
||||||
|
exports.buildRootChain = buildRootChain;
|
||||||
|
function _path() {
|
||||||
|
const data = require("path");
|
||||||
|
_path = function () {
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
function _debug() {
|
||||||
|
const data = require("debug");
|
||||||
|
_debug = function () {
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
var _options = require("./validation/options.js");
|
||||||
|
var _patternToRegex = require("./pattern-to-regex.js");
|
||||||
|
var _printer = require("./printer.js");
|
||||||
|
var _rewriteStackTrace = require("../errors/rewrite-stack-trace.js");
|
||||||
|
var _configError = require("../errors/config-error.js");
|
||||||
|
var _index = require("./files/index.js");
|
||||||
|
var _caching = require("./caching.js");
|
||||||
|
var _configDescriptors = require("./config-descriptors.js");
|
||||||
|
const debug = _debug()("babel:config:config-chain");
|
||||||
|
function* buildPresetChain(arg, context) {
|
||||||
|
const chain = yield* buildPresetChainWalker(arg, context);
|
||||||
|
if (!chain) return null;
|
||||||
|
return {
|
||||||
|
plugins: dedupDescriptors(chain.plugins),
|
||||||
|
presets: dedupDescriptors(chain.presets),
|
||||||
|
options: chain.options.map(o => createConfigChainOptions(o)),
|
||||||
|
files: new Set()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
const buildPresetChainWalker = exports.buildPresetChainWalker = makeChainWalker({
|
||||||
|
root: preset => loadPresetDescriptors(preset),
|
||||||
|
env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),
|
||||||
|
overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),
|
||||||
|
overridesEnv: (preset, index, envName) => loadPresetOverridesEnvDescriptors(preset)(index)(envName),
|
||||||
|
createLogger: () => () => {}
|
||||||
|
});
|
||||||
|
const loadPresetDescriptors = (0, _caching.makeWeakCacheSync)(preset => buildRootDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors));
|
||||||
|
const loadPresetEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, envName)));
|
||||||
|
const loadPresetOverridesDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index)));
|
||||||
|
const loadPresetOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(index => (0, _caching.makeStrongCacheSync)(envName => buildOverrideEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index, envName))));
|
||||||
|
function* buildRootChain(opts, context) {
|
||||||
|
let configReport, babelRcReport;
|
||||||
|
const programmaticLogger = new _printer.ConfigPrinter();
|
||||||
|
const programmaticChain = yield* loadProgrammaticChain({
|
||||||
|
options: opts,
|
||||||
|
dirname: context.cwd
|
||||||
|
}, context, undefined, programmaticLogger);
|
||||||
|
if (!programmaticChain) return null;
|
||||||
|
const programmaticReport = yield* programmaticLogger.output();
|
||||||
|
let configFile;
|
||||||
|
if (typeof opts.configFile === "string") {
|
||||||
|
configFile = yield* (0, _index.loadConfig)(opts.configFile, context.cwd, context.envName, context.caller);
|
||||||
|
} else if (opts.configFile !== false) {
|
||||||
|
configFile = yield* (0, _index.findRootConfig)(context.root, context.envName, context.caller);
|
||||||
|
}
|
||||||
|
let {
|
||||||
|
babelrc,
|
||||||
|
babelrcRoots
|
||||||
|
} = opts;
|
||||||
|
let babelrcRootsDirectory = context.cwd;
|
||||||
|
const configFileChain = emptyChain();
|
||||||
|
const configFileLogger = new _printer.ConfigPrinter();
|
||||||
|
if (configFile) {
|
||||||
|
const validatedFile = validateConfigFile(configFile);
|
||||||
|
const result = yield* loadFileChain(validatedFile, context, undefined, configFileLogger);
|
||||||
|
if (!result) return null;
|
||||||
|
configReport = yield* configFileLogger.output();
|
||||||
|
if (babelrc === undefined) {
|
||||||
|
babelrc = validatedFile.options.babelrc;
|
||||||
|
}
|
||||||
|
if (babelrcRoots === undefined) {
|
||||||
|
babelrcRootsDirectory = validatedFile.dirname;
|
||||||
|
babelrcRoots = validatedFile.options.babelrcRoots;
|
||||||
|
}
|
||||||
|
mergeChain(configFileChain, result);
|
||||||
|
}
|
||||||
|
let ignoreFile, babelrcFile;
|
||||||
|
let isIgnored = false;
|
||||||
|
const fileChain = emptyChain();
|
||||||
|
if ((babelrc === true || babelrc === undefined) && typeof context.filename === "string") {
|
||||||
|
const pkgData = yield* (0, _index.findPackageData)(context.filename);
|
||||||
|
if (pkgData && babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)) {
|
||||||
|
({
|
||||||
|
ignore: ignoreFile,
|
||||||
|
config: babelrcFile
|
||||||
|
} = yield* (0, _index.findRelativeConfig)(pkgData, context.envName, context.caller));
|
||||||
|
if (ignoreFile) {
|
||||||
|
fileChain.files.add(ignoreFile.filepath);
|
||||||
|
}
|
||||||
|
if (ignoreFile && shouldIgnore(context, ignoreFile.ignore, null, ignoreFile.dirname)) {
|
||||||
|
isIgnored = true;
|
||||||
|
}
|
||||||
|
if (babelrcFile && !isIgnored) {
|
||||||
|
const validatedFile = validateBabelrcFile(babelrcFile);
|
||||||
|
const babelrcLogger = new _printer.ConfigPrinter();
|
||||||
|
const result = yield* loadFileChain(validatedFile, context, undefined, babelrcLogger);
|
||||||
|
if (!result) {
|
||||||
|
isIgnored = true;
|
||||||
|
} else {
|
||||||
|
babelRcReport = yield* babelrcLogger.output();
|
||||||
|
mergeChain(fileChain, result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (babelrcFile && isIgnored) {
|
||||||
|
fileChain.files.add(babelrcFile.filepath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (context.showConfig) {
|
||||||
|
console.log(`Babel configs on "${context.filename}" (ascending priority):\n` + [configReport, babelRcReport, programmaticReport].filter(x => !!x).join("\n\n") + "\n-----End Babel configs-----");
|
||||||
|
}
|
||||||
|
const chain = mergeChain(mergeChain(mergeChain(emptyChain(), configFileChain), fileChain), programmaticChain);
|
||||||
|
return {
|
||||||
|
plugins: isIgnored ? [] : dedupDescriptors(chain.plugins),
|
||||||
|
presets: isIgnored ? [] : dedupDescriptors(chain.presets),
|
||||||
|
options: isIgnored ? [] : chain.options.map(o => createConfigChainOptions(o)),
|
||||||
|
fileHandling: isIgnored ? "ignored" : "transpile",
|
||||||
|
ignore: ignoreFile || undefined,
|
||||||
|
babelrc: babelrcFile || undefined,
|
||||||
|
config: configFile || undefined,
|
||||||
|
files: chain.files
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory) {
|
||||||
|
if (typeof babelrcRoots === "boolean") return babelrcRoots;
|
||||||
|
const absoluteRoot = context.root;
|
||||||
|
if (babelrcRoots === undefined) {
|
||||||
|
return pkgData.directories.includes(absoluteRoot);
|
||||||
|
}
|
||||||
|
let babelrcPatterns = babelrcRoots;
|
||||||
|
if (!Array.isArray(babelrcPatterns)) {
|
||||||
|
babelrcPatterns = [babelrcPatterns];
|
||||||
|
}
|
||||||
|
babelrcPatterns = babelrcPatterns.map(pat => {
|
||||||
|
return typeof pat === "string" ? _path().resolve(babelrcRootsDirectory, pat) : pat;
|
||||||
|
});
|
||||||
|
if (babelrcPatterns.length === 1 && babelrcPatterns[0] === absoluteRoot) {
|
||||||
|
return pkgData.directories.includes(absoluteRoot);
|
||||||
|
}
|
||||||
|
return babelrcPatterns.some(pat => {
|
||||||
|
if (typeof pat === "string") {
|
||||||
|
pat = (0, _patternToRegex.default)(pat, babelrcRootsDirectory);
|
||||||
|
}
|
||||||
|
return pkgData.directories.some(directory => {
|
||||||
|
return matchPattern(pat, babelrcRootsDirectory, directory, context);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const validateConfigFile = (0, _caching.makeWeakCacheSync)(file => ({
|
||||||
|
filepath: file.filepath,
|
||||||
|
dirname: file.dirname,
|
||||||
|
options: (0, _options.validate)("configfile", file.options, file.filepath)
|
||||||
|
}));
|
||||||
|
const validateBabelrcFile = (0, _caching.makeWeakCacheSync)(file => ({
|
||||||
|
filepath: file.filepath,
|
||||||
|
dirname: file.dirname,
|
||||||
|
options: (0, _options.validate)("babelrcfile", file.options, file.filepath)
|
||||||
|
}));
|
||||||
|
const validateExtendFile = (0, _caching.makeWeakCacheSync)(file => ({
|
||||||
|
filepath: file.filepath,
|
||||||
|
dirname: file.dirname,
|
||||||
|
options: (0, _options.validate)("extendsfile", file.options, file.filepath)
|
||||||
|
}));
|
||||||
|
const loadProgrammaticChain = makeChainWalker({
|
||||||
|
root: input => buildRootDescriptors(input, "base", _configDescriptors.createCachedDescriptors),
|
||||||
|
env: (input, envName) => buildEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, envName),
|
||||||
|
overrides: (input, index) => buildOverrideDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index),
|
||||||
|
overridesEnv: (input, index, envName) => buildOverrideEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index, envName),
|
||||||
|
createLogger: (input, context, baseLogger) => buildProgrammaticLogger(input, context, baseLogger)
|
||||||
|
});
|
||||||
|
const loadFileChainWalker = makeChainWalker({
|
||||||
|
root: file => loadFileDescriptors(file),
|
||||||
|
env: (file, envName) => loadFileEnvDescriptors(file)(envName),
|
||||||
|
overrides: (file, index) => loadFileOverridesDescriptors(file)(index),
|
||||||
|
overridesEnv: (file, index, envName) => loadFileOverridesEnvDescriptors(file)(index)(envName),
|
||||||
|
createLogger: (file, context, baseLogger) => buildFileLogger(file.filepath, context, baseLogger)
|
||||||
|
});
|
||||||
|
function* loadFileChain(input, context, files, baseLogger) {
|
||||||
|
const chain = yield* loadFileChainWalker(input, context, files, baseLogger);
|
||||||
|
chain == null || chain.files.add(input.filepath);
|
||||||
|
return chain;
|
||||||
|
}
|
||||||
|
const loadFileDescriptors = (0, _caching.makeWeakCacheSync)(file => buildRootDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors));
|
||||||
|
const loadFileEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, envName)));
|
||||||
|
const loadFileOverridesDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index)));
|
||||||
|
const loadFileOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => (0, _caching.makeStrongCacheSync)(envName => buildOverrideEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index, envName))));
|
||||||
|
function buildFileLogger(filepath, context, baseLogger) {
|
||||||
|
if (!baseLogger) {
|
||||||
|
return () => {};
|
||||||
|
}
|
||||||
|
return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Config, {
|
||||||
|
filepath
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function buildRootDescriptors({
|
||||||
|
dirname,
|
||||||
|
options
|
||||||
|
}, alias, descriptors) {
|
||||||
|
return descriptors(dirname, options, alias);
|
||||||
|
}
|
||||||
|
function buildProgrammaticLogger(_, context, baseLogger) {
|
||||||
|
var _context$caller;
|
||||||
|
if (!baseLogger) {
|
||||||
|
return () => {};
|
||||||
|
}
|
||||||
|
return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Programmatic, {
|
||||||
|
callerName: (_context$caller = context.caller) == null ? void 0 : _context$caller.name
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function buildEnvDescriptors({
|
||||||
|
dirname,
|
||||||
|
options
|
||||||
|
}, alias, descriptors, envName) {
|
||||||
|
var _options$env;
|
||||||
|
const opts = (_options$env = options.env) == null ? void 0 : _options$env[envName];
|
||||||
|
return opts ? descriptors(dirname, opts, `${alias}.env["${envName}"]`) : null;
|
||||||
|
}
|
||||||
|
function buildOverrideDescriptors({
|
||||||
|
dirname,
|
||||||
|
options
|
||||||
|
}, alias, descriptors, index) {
|
||||||
|
var _options$overrides;
|
||||||
|
const opts = (_options$overrides = options.overrides) == null ? void 0 : _options$overrides[index];
|
||||||
|
if (!opts) throw new Error("Assertion failure - missing override");
|
||||||
|
return descriptors(dirname, opts, `${alias}.overrides[${index}]`);
|
||||||
|
}
|
||||||
|
function buildOverrideEnvDescriptors({
|
||||||
|
dirname,
|
||||||
|
options
|
||||||
|
}, alias, descriptors, index, envName) {
|
||||||
|
var _options$overrides2, _override$env;
|
||||||
|
const override = (_options$overrides2 = options.overrides) == null ? void 0 : _options$overrides2[index];
|
||||||
|
if (!override) throw new Error("Assertion failure - missing override");
|
||||||
|
const opts = (_override$env = override.env) == null ? void 0 : _override$env[envName];
|
||||||
|
return opts ? descriptors(dirname, opts, `${alias}.overrides[${index}].env["${envName}"]`) : null;
|
||||||
|
}
|
||||||
|
function makeChainWalker({
|
||||||
|
root,
|
||||||
|
env,
|
||||||
|
overrides,
|
||||||
|
overridesEnv,
|
||||||
|
createLogger
|
||||||
|
}) {
|
||||||
|
return function* chainWalker(input, context, files = new Set(), baseLogger) {
|
||||||
|
const {
|
||||||
|
dirname
|
||||||
|
} = input;
|
||||||
|
const flattenedConfigs = [];
|
||||||
|
const rootOpts = root(input);
|
||||||
|
if (configIsApplicable(rootOpts, dirname, context, input.filepath)) {
|
||||||
|
flattenedConfigs.push({
|
||||||
|
config: rootOpts,
|
||||||
|
envName: undefined,
|
||||||
|
index: undefined
|
||||||
|
});
|
||||||
|
const envOpts = env(input, context.envName);
|
||||||
|
if (envOpts && configIsApplicable(envOpts, dirname, context, input.filepath)) {
|
||||||
|
flattenedConfigs.push({
|
||||||
|
config: envOpts,
|
||||||
|
envName: context.envName,
|
||||||
|
index: undefined
|
||||||
|
});
|
||||||
|
}
|
||||||
|
(rootOpts.options.overrides || []).forEach((_, index) => {
|
||||||
|
const overrideOps = overrides(input, index);
|
||||||
|
if (configIsApplicable(overrideOps, dirname, context, input.filepath)) {
|
||||||
|
flattenedConfigs.push({
|
||||||
|
config: overrideOps,
|
||||||
|
index,
|
||||||
|
envName: undefined
|
||||||
|
});
|
||||||
|
const overrideEnvOpts = overridesEnv(input, index, context.envName);
|
||||||
|
if (overrideEnvOpts && configIsApplicable(overrideEnvOpts, dirname, context, input.filepath)) {
|
||||||
|
flattenedConfigs.push({
|
||||||
|
config: overrideEnvOpts,
|
||||||
|
index,
|
||||||
|
envName: context.envName
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (flattenedConfigs.some(({
|
||||||
|
config: {
|
||||||
|
options: {
|
||||||
|
ignore,
|
||||||
|
only
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}) => shouldIgnore(context, ignore, only, dirname))) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const chain = emptyChain();
|
||||||
|
const logger = createLogger(input, context, baseLogger);
|
||||||
|
for (const {
|
||||||
|
config,
|
||||||
|
index,
|
||||||
|
envName
|
||||||
|
} of flattenedConfigs) {
|
||||||
|
if (!(yield* mergeExtendsChain(chain, config.options, dirname, context, files, baseLogger))) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
logger(config, index, envName);
|
||||||
|
yield* mergeChainOpts(chain, config);
|
||||||
|
}
|
||||||
|
return chain;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function* mergeExtendsChain(chain, opts, dirname, context, files, baseLogger) {
|
||||||
|
if (opts.extends === undefined) return true;
|
||||||
|
const file = yield* (0, _index.loadConfig)(opts.extends, dirname, context.envName, context.caller);
|
||||||
|
if (files.has(file)) {
|
||||||
|
throw new Error(`Configuration cycle detected loading ${file.filepath}.\n` + `File already loaded following the config chain:\n` + Array.from(files, file => ` - ${file.filepath}`).join("\n"));
|
||||||
|
}
|
||||||
|
files.add(file);
|
||||||
|
const fileChain = yield* loadFileChain(validateExtendFile(file), context, files, baseLogger);
|
||||||
|
files.delete(file);
|
||||||
|
if (!fileChain) return false;
|
||||||
|
mergeChain(chain, fileChain);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
function mergeChain(target, source) {
|
||||||
|
target.options.push(...source.options);
|
||||||
|
target.plugins.push(...source.plugins);
|
||||||
|
target.presets.push(...source.presets);
|
||||||
|
for (const file of source.files) {
|
||||||
|
target.files.add(file);
|
||||||
|
}
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
function* mergeChainOpts(target, {
|
||||||
|
options,
|
||||||
|
plugins,
|
||||||
|
presets
|
||||||
|
}) {
|
||||||
|
target.options.push(options);
|
||||||
|
target.plugins.push(...(yield* plugins()));
|
||||||
|
target.presets.push(...(yield* presets()));
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
function emptyChain() {
|
||||||
|
return {
|
||||||
|
options: [],
|
||||||
|
presets: [],
|
||||||
|
plugins: [],
|
||||||
|
files: new Set()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function createConfigChainOptions(opts) {
|
||||||
|
const options = Object.assign({}, opts);
|
||||||
|
delete options.extends;
|
||||||
|
delete options.env;
|
||||||
|
delete options.overrides;
|
||||||
|
delete options.plugins;
|
||||||
|
delete options.presets;
|
||||||
|
delete options.passPerPreset;
|
||||||
|
delete options.ignore;
|
||||||
|
delete options.only;
|
||||||
|
delete options.test;
|
||||||
|
delete options.include;
|
||||||
|
delete options.exclude;
|
||||||
|
if (hasOwnProperty.call(options, "sourceMap")) {
|
||||||
|
options.sourceMaps = options.sourceMap;
|
||||||
|
delete options.sourceMap;
|
||||||
|
}
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
function dedupDescriptors(items) {
|
||||||
|
const map = new Map();
|
||||||
|
const descriptors = [];
|
||||||
|
for (const item of items) {
|
||||||
|
if (typeof item.value === "function") {
|
||||||
|
const fnKey = item.value;
|
||||||
|
let nameMap = map.get(fnKey);
|
||||||
|
if (!nameMap) {
|
||||||
|
nameMap = new Map();
|
||||||
|
map.set(fnKey, nameMap);
|
||||||
|
}
|
||||||
|
let desc = nameMap.get(item.name);
|
||||||
|
if (!desc) {
|
||||||
|
desc = {
|
||||||
|
value: item
|
||||||
|
};
|
||||||
|
descriptors.push(desc);
|
||||||
|
if (!item.ownPass) nameMap.set(item.name, desc);
|
||||||
|
} else {
|
||||||
|
desc.value = item;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
descriptors.push({
|
||||||
|
value: item
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return descriptors.reduce((acc, desc) => {
|
||||||
|
acc.push(desc.value);
|
||||||
|
return acc;
|
||||||
|
}, []);
|
||||||
|
}
|
||||||
|
function configIsApplicable({
|
||||||
|
options
|
||||||
|
}, dirname, context, configName) {
|
||||||
|
return (options.test === undefined || configFieldIsApplicable(context, options.test, dirname, configName)) && (options.include === undefined || configFieldIsApplicable(context, options.include, dirname, configName)) && (options.exclude === undefined || !configFieldIsApplicable(context, options.exclude, dirname, configName));
|
||||||
|
}
|
||||||
|
function configFieldIsApplicable(context, test, dirname, configName) {
|
||||||
|
const patterns = Array.isArray(test) ? test : [test];
|
||||||
|
return matchesPatterns(context, patterns, dirname, configName);
|
||||||
|
}
|
||||||
|
function ignoreListReplacer(_key, value) {
|
||||||
|
if (value instanceof RegExp) {
|
||||||
|
return String(value);
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
function shouldIgnore(context, ignore, only, dirname) {
|
||||||
|
if (ignore && matchesPatterns(context, ignore, dirname)) {
|
||||||
|
var _context$filename;
|
||||||
|
const message = `No config is applied to "${(_context$filename = context.filename) != null ? _context$filename : "(unknown)"}" because it matches one of \`ignore: ${JSON.stringify(ignore, ignoreListReplacer)}\` from "${dirname}"`;
|
||||||
|
debug(message);
|
||||||
|
if (context.showConfig) {
|
||||||
|
console.log(message);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (only && !matchesPatterns(context, only, dirname)) {
|
||||||
|
var _context$filename2;
|
||||||
|
const message = `No config is applied to "${(_context$filename2 = context.filename) != null ? _context$filename2 : "(unknown)"}" because it fails to match one of \`only: ${JSON.stringify(only, ignoreListReplacer)}\` from "${dirname}"`;
|
||||||
|
debug(message);
|
||||||
|
if (context.showConfig) {
|
||||||
|
console.log(message);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
function matchesPatterns(context, patterns, dirname, configName) {
|
||||||
|
return patterns.some(pattern => matchPattern(pattern, dirname, context.filename, context, configName));
|
||||||
|
}
|
||||||
|
function matchPattern(pattern, dirname, pathToTest, context, configName) {
|
||||||
|
if (typeof pattern === "function") {
|
||||||
|
return !!(0, _rewriteStackTrace.endHiddenCallStack)(pattern)(pathToTest, {
|
||||||
|
dirname,
|
||||||
|
envName: context.envName,
|
||||||
|
caller: context.caller
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (typeof pathToTest !== "string") {
|
||||||
|
throw new _configError.default(`Configuration contains string/RegExp pattern, but no filename was passed to Babel`, configName);
|
||||||
|
}
|
||||||
|
if (typeof pattern === "string") {
|
||||||
|
pattern = (0, _patternToRegex.default)(pattern, dirname);
|
||||||
|
}
|
||||||
|
return pattern.test(pathToTest);
|
||||||
|
}
|
||||||
|
0 && 0;
|
||||||
|
|
||||||
|
//# sourceMappingURL=config-chain.js.map
|
||||||
1
counter-frontend/node_modules/@babel/core/lib/config/config-chain.js.map
generated
vendored
Normal file
1
counter-frontend/node_modules/@babel/core/lib/config/config-chain.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
190
counter-frontend/node_modules/@babel/core/lib/config/config-descriptors.js
generated
vendored
Normal file
190
counter-frontend/node_modules/@babel/core/lib/config/config-descriptors.js
generated
vendored
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.createCachedDescriptors = createCachedDescriptors;
|
||||||
|
exports.createDescriptor = createDescriptor;
|
||||||
|
exports.createUncachedDescriptors = createUncachedDescriptors;
|
||||||
|
function _gensync() {
|
||||||
|
const data = require("gensync");
|
||||||
|
_gensync = function () {
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
var _functional = require("../gensync-utils/functional.js");
|
||||||
|
var _index = require("./files/index.js");
|
||||||
|
var _item = require("./item.js");
|
||||||
|
var _caching = require("./caching.js");
|
||||||
|
var _resolveTargets = require("./resolve-targets.js");
|
||||||
|
function isEqualDescriptor(a, b) {
|
||||||
|
var _a$file, _b$file, _a$file2, _b$file2;
|
||||||
|
return a.name === b.name && a.value === b.value && a.options === b.options && a.dirname === b.dirname && a.alias === b.alias && a.ownPass === b.ownPass && ((_a$file = a.file) == null ? void 0 : _a$file.request) === ((_b$file = b.file) == null ? void 0 : _b$file.request) && ((_a$file2 = a.file) == null ? void 0 : _a$file2.resolved) === ((_b$file2 = b.file) == null ? void 0 : _b$file2.resolved);
|
||||||
|
}
|
||||||
|
function* handlerOf(value) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
function optionsWithResolvedBrowserslistConfigFile(options, dirname) {
|
||||||
|
if (typeof options.browserslistConfigFile === "string") {
|
||||||
|
options.browserslistConfigFile = (0, _resolveTargets.resolveBrowserslistConfigFile)(options.browserslistConfigFile, dirname);
|
||||||
|
}
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
function createCachedDescriptors(dirname, options, alias) {
|
||||||
|
const {
|
||||||
|
plugins,
|
||||||
|
presets,
|
||||||
|
passPerPreset
|
||||||
|
} = options;
|
||||||
|
return {
|
||||||
|
options: optionsWithResolvedBrowserslistConfigFile(options, dirname),
|
||||||
|
plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname)(alias) : () => handlerOf([]),
|
||||||
|
presets: presets ? () => createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset) : () => handlerOf([])
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function createUncachedDescriptors(dirname, options, alias) {
|
||||||
|
return {
|
||||||
|
options: optionsWithResolvedBrowserslistConfigFile(options, dirname),
|
||||||
|
plugins: (0, _functional.once)(() => createPluginDescriptors(options.plugins || [], dirname, alias)),
|
||||||
|
presets: (0, _functional.once)(() => createPresetDescriptors(options.presets || [], dirname, alias, !!options.passPerPreset))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
const PRESET_DESCRIPTOR_CACHE = new WeakMap();
|
||||||
|
const createCachedPresetDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {
|
||||||
|
const dirname = cache.using(dir => dir);
|
||||||
|
return (0, _caching.makeStrongCacheSync)(alias => (0, _caching.makeStrongCache)(function* (passPerPreset) {
|
||||||
|
const descriptors = yield* createPresetDescriptors(items, dirname, alias, passPerPreset);
|
||||||
|
return descriptors.map(desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc));
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
const PLUGIN_DESCRIPTOR_CACHE = new WeakMap();
|
||||||
|
const createCachedPluginDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {
|
||||||
|
const dirname = cache.using(dir => dir);
|
||||||
|
return (0, _caching.makeStrongCache)(function* (alias) {
|
||||||
|
const descriptors = yield* createPluginDescriptors(items, dirname, alias);
|
||||||
|
return descriptors.map(desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
const DEFAULT_OPTIONS = {};
|
||||||
|
function loadCachedDescriptor(cache, desc) {
|
||||||
|
const {
|
||||||
|
value,
|
||||||
|
options = DEFAULT_OPTIONS
|
||||||
|
} = desc;
|
||||||
|
if (options === false) return desc;
|
||||||
|
let cacheByOptions = cache.get(value);
|
||||||
|
if (!cacheByOptions) {
|
||||||
|
cacheByOptions = new WeakMap();
|
||||||
|
cache.set(value, cacheByOptions);
|
||||||
|
}
|
||||||
|
let possibilities = cacheByOptions.get(options);
|
||||||
|
if (!possibilities) {
|
||||||
|
possibilities = [];
|
||||||
|
cacheByOptions.set(options, possibilities);
|
||||||
|
}
|
||||||
|
if (!possibilities.includes(desc)) {
|
||||||
|
const matches = possibilities.filter(possibility => isEqualDescriptor(possibility, desc));
|
||||||
|
if (matches.length > 0) {
|
||||||
|
return matches[0];
|
||||||
|
}
|
||||||
|
possibilities.push(desc);
|
||||||
|
}
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
function* createPresetDescriptors(items, dirname, alias, passPerPreset) {
|
||||||
|
return yield* createDescriptors("preset", items, dirname, alias, passPerPreset);
|
||||||
|
}
|
||||||
|
function* createPluginDescriptors(items, dirname, alias) {
|
||||||
|
return yield* createDescriptors("plugin", items, dirname, alias);
|
||||||
|
}
|
||||||
|
function* createDescriptors(type, items, dirname, alias, ownPass) {
|
||||||
|
const descriptors = yield* _gensync().all(items.map((item, index) => createDescriptor(item, dirname, {
|
||||||
|
type,
|
||||||
|
alias: `${alias}$${index}`,
|
||||||
|
ownPass: !!ownPass
|
||||||
|
})));
|
||||||
|
assertNoDuplicates(descriptors);
|
||||||
|
return descriptors;
|
||||||
|
}
|
||||||
|
function* createDescriptor(pair, dirname, {
|
||||||
|
type,
|
||||||
|
alias,
|
||||||
|
ownPass
|
||||||
|
}) {
|
||||||
|
const desc = (0, _item.getItemDescriptor)(pair);
|
||||||
|
if (desc) {
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
let name;
|
||||||
|
let options;
|
||||||
|
let value = pair;
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
if (value.length === 3) {
|
||||||
|
[value, options, name] = value;
|
||||||
|
} else {
|
||||||
|
[value, options] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let file = undefined;
|
||||||
|
let filepath = null;
|
||||||
|
if (typeof value === "string") {
|
||||||
|
if (typeof type !== "string") {
|
||||||
|
throw new Error("To resolve a string-based item, the type of item must be given");
|
||||||
|
}
|
||||||
|
const resolver = type === "plugin" ? _index.loadPlugin : _index.loadPreset;
|
||||||
|
const request = value;
|
||||||
|
({
|
||||||
|
filepath,
|
||||||
|
value
|
||||||
|
} = yield* resolver(value, dirname));
|
||||||
|
file = {
|
||||||
|
request,
|
||||||
|
resolved: filepath
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (!value) {
|
||||||
|
throw new Error(`Unexpected falsy value: ${String(value)}`);
|
||||||
|
}
|
||||||
|
if (typeof value === "object" && value.__esModule) {
|
||||||
|
if (value.default) {
|
||||||
|
value = value.default;
|
||||||
|
} else {
|
||||||
|
throw new Error("Must export a default export when using ES6 modules.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (typeof value !== "object" && typeof value !== "function") {
|
||||||
|
throw new Error(`Unsupported format: ${typeof value}. Expected an object or a function.`);
|
||||||
|
}
|
||||||
|
if (filepath !== null && typeof value === "object" && value) {
|
||||||
|
throw new Error(`Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`);
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
name,
|
||||||
|
alias: filepath || alias,
|
||||||
|
value,
|
||||||
|
options,
|
||||||
|
dirname,
|
||||||
|
ownPass,
|
||||||
|
file
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function assertNoDuplicates(items) {
|
||||||
|
const map = new Map();
|
||||||
|
for (const item of items) {
|
||||||
|
if (typeof item.value !== "function") continue;
|
||||||
|
let nameMap = map.get(item.value);
|
||||||
|
if (!nameMap) {
|
||||||
|
nameMap = new Set();
|
||||||
|
map.set(item.value, nameMap);
|
||||||
|
}
|
||||||
|
if (nameMap.has(item.name)) {
|
||||||
|
const conflicts = items.filter(i => i.value === item.value);
|
||||||
|
throw new Error([`Duplicate plugin/preset detected.`, `If you'd like to use two separate instances of a plugin,`, `they need separate names, e.g.`, ``, ` plugins: [`, ` ['some-plugin', {}],`, ` ['some-plugin', {}, 'some unique name'],`, ` ]`, ``, `Duplicates detected are:`, `${JSON.stringify(conflicts, null, 2)}`].join("\n"));
|
||||||
|
}
|
||||||
|
nameMap.add(item.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
0 && 0;
|
||||||
|
|
||||||
|
//# sourceMappingURL=config-descriptors.js.map
|
||||||
1
counter-frontend/node_modules/@babel/core/lib/config/config-descriptors.js.map
generated
vendored
Normal file
1
counter-frontend/node_modules/@babel/core/lib/config/config-descriptors.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
290
counter-frontend/node_modules/@babel/core/lib/config/files/configuration.js
generated
vendored
Normal file
290
counter-frontend/node_modules/@babel/core/lib/config/files/configuration.js
generated
vendored
Normal file
@@ -0,0 +1,290 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.ROOT_CONFIG_FILENAMES = void 0;
|
||||||
|
exports.findConfigUpwards = findConfigUpwards;
|
||||||
|
exports.findRelativeConfig = findRelativeConfig;
|
||||||
|
exports.findRootConfig = findRootConfig;
|
||||||
|
exports.loadConfig = loadConfig;
|
||||||
|
exports.resolveShowConfigPath = resolveShowConfigPath;
|
||||||
|
function _debug() {
|
||||||
|
const data = require("debug");
|
||||||
|
_debug = function () {
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
function _fs() {
|
||||||
|
const data = require("fs");
|
||||||
|
_fs = function () {
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
function _path() {
|
||||||
|
const data = require("path");
|
||||||
|
_path = function () {
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
function _json() {
|
||||||
|
const data = require("json5");
|
||||||
|
_json = function () {
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
function _gensync() {
|
||||||
|
const data = require("gensync");
|
||||||
|
_gensync = function () {
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
var _caching = require("../caching.js");
|
||||||
|
var _configApi = require("../helpers/config-api.js");
|
||||||
|
var _utils = require("./utils.js");
|
||||||
|
var _moduleTypes = require("./module-types.js");
|
||||||
|
var _patternToRegex = require("../pattern-to-regex.js");
|
||||||
|
var _configError = require("../../errors/config-error.js");
|
||||||
|
var fs = require("../../gensync-utils/fs.js");
|
||||||
|
require("module");
|
||||||
|
var _rewriteStackTrace = require("../../errors/rewrite-stack-trace.js");
|
||||||
|
var _async = require("../../gensync-utils/async.js");
|
||||||
|
const debug = _debug()("babel:config:loading:files:configuration");
|
||||||
|
const ROOT_CONFIG_FILENAMES = exports.ROOT_CONFIG_FILENAMES = ["babel.config.js", "babel.config.cjs", "babel.config.mjs", "babel.config.json", "babel.config.cts", "babel.config.ts", "babel.config.mts"];
|
||||||
|
const RELATIVE_CONFIG_FILENAMES = [".babelrc", ".babelrc.js", ".babelrc.cjs", ".babelrc.mjs", ".babelrc.json", ".babelrc.cts"];
|
||||||
|
const BABELIGNORE_FILENAME = ".babelignore";
|
||||||
|
const runConfig = (0, _caching.makeWeakCache)(function* runConfig(options, cache) {
|
||||||
|
yield* [];
|
||||||
|
return {
|
||||||
|
options: (0, _rewriteStackTrace.endHiddenCallStack)(options)((0, _configApi.makeConfigAPI)(cache)),
|
||||||
|
cacheNeedsConfiguration: !cache.configured()
|
||||||
|
};
|
||||||
|
});
|
||||||
|
function* readConfigCode(filepath, data) {
|
||||||
|
if (!_fs().existsSync(filepath)) return null;
|
||||||
|
let options = yield* (0, _moduleTypes.default)(filepath, (yield* (0, _async.isAsync)()) ? "auto" : "require", "You appear to be using a native ECMAScript module configuration " + "file, which is only supported when running Babel asynchronously " + "or when using the Node.js `--experimental-require-module` flag.", "You appear to be using a configuration file that contains top-level " + "await, which is only supported when running Babel asynchronously.");
|
||||||
|
let cacheNeedsConfiguration = false;
|
||||||
|
if (typeof options === "function") {
|
||||||
|
({
|
||||||
|
options,
|
||||||
|
cacheNeedsConfiguration
|
||||||
|
} = yield* runConfig(options, data));
|
||||||
|
}
|
||||||
|
if (!options || typeof options !== "object" || Array.isArray(options)) {
|
||||||
|
throw new _configError.default(`Configuration should be an exported JavaScript object.`, filepath);
|
||||||
|
}
|
||||||
|
if (typeof options.then === "function") {
|
||||||
|
options.catch == null || options.catch(() => {});
|
||||||
|
throw new _configError.default(`You appear to be using an async configuration, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously return your config.`, filepath);
|
||||||
|
}
|
||||||
|
if (cacheNeedsConfiguration) throwConfigError(filepath);
|
||||||
|
return buildConfigFileObject(options, filepath);
|
||||||
|
}
|
||||||
|
const cfboaf = new WeakMap();
|
||||||
|
function buildConfigFileObject(options, filepath) {
|
||||||
|
let configFilesByFilepath = cfboaf.get(options);
|
||||||
|
if (!configFilesByFilepath) {
|
||||||
|
cfboaf.set(options, configFilesByFilepath = new Map());
|
||||||
|
}
|
||||||
|
let configFile = configFilesByFilepath.get(filepath);
|
||||||
|
if (!configFile) {
|
||||||
|
configFile = {
|
||||||
|
filepath,
|
||||||
|
dirname: _path().dirname(filepath),
|
||||||
|
options
|
||||||
|
};
|
||||||
|
configFilesByFilepath.set(filepath, configFile);
|
||||||
|
}
|
||||||
|
return configFile;
|
||||||
|
}
|
||||||
|
const packageToBabelConfig = (0, _caching.makeWeakCacheSync)(file => {
|
||||||
|
const babel = file.options.babel;
|
||||||
|
if (babel === undefined) return null;
|
||||||
|
if (typeof babel !== "object" || Array.isArray(babel) || babel === null) {
|
||||||
|
throw new _configError.default(`.babel property must be an object`, file.filepath);
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
filepath: file.filepath,
|
||||||
|
dirname: file.dirname,
|
||||||
|
options: babel
|
||||||
|
};
|
||||||
|
});
|
||||||
|
const readConfigJSON5 = (0, _utils.makeStaticFileCache)((filepath, content) => {
|
||||||
|
let options;
|
||||||
|
try {
|
||||||
|
options = _json().parse(content);
|
||||||
|
} catch (err) {
|
||||||
|
throw new _configError.default(`Error while parsing config - ${err.message}`, filepath);
|
||||||
|
}
|
||||||
|
if (!options) throw new _configError.default(`No config detected`, filepath);
|
||||||
|
if (typeof options !== "object") {
|
||||||
|
throw new _configError.default(`Config returned typeof ${typeof options}`, filepath);
|
||||||
|
}
|
||||||
|
if (Array.isArray(options)) {
|
||||||
|
throw new _configError.default(`Expected config object but found array`, filepath);
|
||||||
|
}
|
||||||
|
delete options.$schema;
|
||||||
|
return {
|
||||||
|
filepath,
|
||||||
|
dirname: _path().dirname(filepath),
|
||||||
|
options
|
||||||
|
};
|
||||||
|
});
|
||||||
|
const readIgnoreConfig = (0, _utils.makeStaticFileCache)((filepath, content) => {
|
||||||
|
const ignoreDir = _path().dirname(filepath);
|
||||||
|
const ignorePatterns = content.split("\n").map(line => line.replace(/#.*$/, "").trim()).filter(Boolean);
|
||||||
|
for (const pattern of ignorePatterns) {
|
||||||
|
if (pattern.startsWith("!")) {
|
||||||
|
throw new _configError.default(`Negation of file paths is not supported.`, filepath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
filepath,
|
||||||
|
dirname: _path().dirname(filepath),
|
||||||
|
ignore: ignorePatterns.map(pattern => (0, _patternToRegex.default)(pattern, ignoreDir))
|
||||||
|
};
|
||||||
|
});
|
||||||
|
function findConfigUpwards(rootDir) {
|
||||||
|
let dirname = rootDir;
|
||||||
|
for (;;) {
|
||||||
|
for (const filename of ROOT_CONFIG_FILENAMES) {
|
||||||
|
if (_fs().existsSync(_path().join(dirname, filename))) {
|
||||||
|
return dirname;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const nextDir = _path().dirname(dirname);
|
||||||
|
if (dirname === nextDir) break;
|
||||||
|
dirname = nextDir;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
function* findRelativeConfig(packageData, envName, caller) {
|
||||||
|
let config = null;
|
||||||
|
let ignore = null;
|
||||||
|
const dirname = _path().dirname(packageData.filepath);
|
||||||
|
for (const loc of packageData.directories) {
|
||||||
|
if (!config) {
|
||||||
|
var _packageData$pkg;
|
||||||
|
config = yield* loadOneConfig(RELATIVE_CONFIG_FILENAMES, loc, envName, caller, ((_packageData$pkg = packageData.pkg) == null ? void 0 : _packageData$pkg.dirname) === loc ? packageToBabelConfig(packageData.pkg) : null);
|
||||||
|
}
|
||||||
|
if (!ignore) {
|
||||||
|
const ignoreLoc = _path().join(loc, BABELIGNORE_FILENAME);
|
||||||
|
ignore = yield* readIgnoreConfig(ignoreLoc);
|
||||||
|
if (ignore) {
|
||||||
|
debug("Found ignore %o from %o.", ignore.filepath, dirname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
config,
|
||||||
|
ignore
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function findRootConfig(dirname, envName, caller) {
|
||||||
|
return loadOneConfig(ROOT_CONFIG_FILENAMES, dirname, envName, caller);
|
||||||
|
}
|
||||||
|
function* loadOneConfig(names, dirname, envName, caller, previousConfig = null) {
|
||||||
|
const configs = yield* _gensync().all(names.map(filename => readConfig(_path().join(dirname, filename), envName, caller)));
|
||||||
|
const config = configs.reduce((previousConfig, config) => {
|
||||||
|
if (config && previousConfig) {
|
||||||
|
throw new _configError.default(`Multiple configuration files found. Please remove one:\n` + ` - ${_path().basename(previousConfig.filepath)}\n` + ` - ${config.filepath}\n` + `from ${dirname}`);
|
||||||
|
}
|
||||||
|
return config || previousConfig;
|
||||||
|
}, previousConfig);
|
||||||
|
if (config) {
|
||||||
|
debug("Found configuration %o from %o.", config.filepath, dirname);
|
||||||
|
}
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
function* loadConfig(name, dirname, envName, caller) {
|
||||||
|
const filepath = (((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, {
|
||||||
|
paths: [b]
|
||||||
|
}, M = require("module")) => {
|
||||||
|
let f = M._findPath(r, M._nodeModulePaths(b).concat(b));
|
||||||
|
if (f) return f;
|
||||||
|
f = new Error(`Cannot resolve module '${r}'`);
|
||||||
|
f.code = "MODULE_NOT_FOUND";
|
||||||
|
throw f;
|
||||||
|
})(name, {
|
||||||
|
paths: [dirname]
|
||||||
|
});
|
||||||
|
const conf = yield* readConfig(filepath, envName, caller);
|
||||||
|
if (!conf) {
|
||||||
|
throw new _configError.default(`Config file contains no configuration data`, filepath);
|
||||||
|
}
|
||||||
|
debug("Loaded config %o from %o.", name, dirname);
|
||||||
|
return conf;
|
||||||
|
}
|
||||||
|
function readConfig(filepath, envName, caller) {
|
||||||
|
const ext = _path().extname(filepath);
|
||||||
|
switch (ext) {
|
||||||
|
case ".js":
|
||||||
|
case ".cjs":
|
||||||
|
case ".mjs":
|
||||||
|
case ".ts":
|
||||||
|
case ".cts":
|
||||||
|
case ".mts":
|
||||||
|
return readConfigCode(filepath, {
|
||||||
|
envName,
|
||||||
|
caller
|
||||||
|
});
|
||||||
|
default:
|
||||||
|
return readConfigJSON5(filepath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function* resolveShowConfigPath(dirname) {
|
||||||
|
const targetPath = process.env.BABEL_SHOW_CONFIG_FOR;
|
||||||
|
if (targetPath != null) {
|
||||||
|
const absolutePath = _path().resolve(dirname, targetPath);
|
||||||
|
const stats = yield* fs.stat(absolutePath);
|
||||||
|
if (!stats.isFile()) {
|
||||||
|
throw new Error(`${absolutePath}: BABEL_SHOW_CONFIG_FOR must refer to a regular file, directories are not supported.`);
|
||||||
|
}
|
||||||
|
return absolutePath;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
function throwConfigError(filepath) {
|
||||||
|
throw new _configError.default(`\
|
||||||
|
Caching was left unconfigured. Babel's plugins, presets, and .babelrc.js files can be configured
|
||||||
|
for various types of caching, using the first param of their handler functions:
|
||||||
|
|
||||||
|
module.exports = function(api) {
|
||||||
|
// The API exposes the following:
|
||||||
|
|
||||||
|
// Cache the returned value forever and don't call this function again.
|
||||||
|
api.cache(true);
|
||||||
|
|
||||||
|
// Don't cache at all. Not recommended because it will be very slow.
|
||||||
|
api.cache(false);
|
||||||
|
|
||||||
|
// Cached based on the value of some function. If this function returns a value different from
|
||||||
|
// a previously-encountered value, the plugins will re-evaluate.
|
||||||
|
var env = api.cache(() => process.env.NODE_ENV);
|
||||||
|
|
||||||
|
// If testing for a specific env, we recommend specifics to avoid instantiating a plugin for
|
||||||
|
// any possible NODE_ENV value that might come up during plugin execution.
|
||||||
|
var isProd = api.cache(() => process.env.NODE_ENV === "production");
|
||||||
|
|
||||||
|
// .cache(fn) will perform a linear search though instances to find the matching plugin based
|
||||||
|
// based on previous instantiated plugins. If you want to recreate the plugin and discard the
|
||||||
|
// previous instance whenever something changes, you may use:
|
||||||
|
var isProd = api.cache.invalidate(() => process.env.NODE_ENV === "production");
|
||||||
|
|
||||||
|
// Note, we also expose the following more-verbose versions of the above examples:
|
||||||
|
api.cache.forever(); // api.cache(true)
|
||||||
|
api.cache.never(); // api.cache(false)
|
||||||
|
api.cache.using(fn); // api.cache(fn)
|
||||||
|
|
||||||
|
// Return the value that will be cached.
|
||||||
|
return { };
|
||||||
|
};`, filepath);
|
||||||
|
}
|
||||||
|
0 && 0;
|
||||||
|
|
||||||
|
//# sourceMappingURL=configuration.js.map
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user