import flat from 'flat';

export default flat({
  notification: {
    common: {
      account: 'Account',
      product: 'Product',
      paymentAmount: 'Payment amount',
      refundAmount: 'Refund amount',
      stakeAmount: 'Stake amount',
      returnAmount: 'Return amount',
      slashAmount: 'Slash amount',
      slashReason: 'Slash reason',
      refundPeriod: 'Refund period',
      validityPeriod: 'Service period',
      paymentPeriod: 'Payment period',
      trialPeriod: 'Trial period',
      viewSubscription: 'View subscription',
      viewInvoice: 'View invoice',
      viewTxHash: 'View transaction',
      trialDuration: 'Trial duration',
      duration: 'Duration',
      permanent: 'Permanent',
      nftAddress: 'NFT Address',
      month: 'month',
      months: 'months',
      day: 'day',
      days: 'days',
      minute: 'minute',
      minutes: 'minutes',
      cancellationReason: 'Cancellation reason',
      renewNow: 'Pay now',
      addFunds: 'Add funds',
      amount: 'Amount',
      rewardAmount: 'Reward amount',
      rewardDetail: 'Reward detail',
      currentBalance: 'Current balance',
      prepaid: 'Prepaid',
      postpaid: 'Postpaid',
      paidType: 'Paid type',
      expandPayment: 'In addition, you have successfully purchased the following products:',
      trialProduct: 'Trial product:',
      subscribeProduct: 'Subscribed product:',
      paymentQuantity: 'Payment quantity',
      qty: '{count} unit',
      failReason: 'Failure reason',
      balanceReminder: 'Balance reminder',
      subscriptionId: 'Subscription ID',
      shouldPayAmount: 'Should pay amount',
      billedAmount: 'Billed amount',
      viewCreditGrant: 'View Credit Balance',
      manageCredit: 'Manage Credits',
      reloadCredits: 'Reload Credits',
      invoiceNumber: 'Invoice Number',
      payer: 'Payer',
      webhookEndpointId: 'Webhook Endpoint ID',
      webhookUrl: 'Webhook URL',
      description: 'Description',
      failedCount: 'Failed Count',
      viewWebhook: 'View Webhook',
    },

    billingDiscrepancy: {
      title: '{productName} billing discrepancy',
      body: 'A billing discrepancy has been detected for {productName}. Please review your billing details.',
    },

    webhookEndpointFailed: {
      title: 'System Alert: Webhook Failure ({webhookUrl})',
      body: 'Your webhook endpoint has failed {failedCount} times in a row. Please check your endpoint configuration immediately.',
    },

    sendTo: 'Sent to',
    mintNFT: {
      title: '{collection} NFT minted',
      message: 'A new {collection} NFT has been minted and sent to your wallet. Please check your wallet to view it.',
    },

    usageReportEmpty: {
      title: 'No usage report for {productName}',
      body: 'No usage report has been detected for {productName}. Please verify your usage reporting configuration.',
    },

    meteringSubscriptionDetection: {
      title: '[{appName}] Metering subscription detection',
      body: 'During {startTimeStr} - {endTimeStr}, a total of {totalCount} subscriptions with usage-based billing were scanned.\nOf these, {normalCount} were normal, while {abnormalCount} had anomalies, including {unreportedCount} unreported subscriptions and {discrepantCount} with billing discrepancies.\n\nAbnormal subscriptions:',
      healthyBody:
        'During {startTimeStr} - {endTimeStr}, a total of {totalCount} subscriptions with usage-based billing were scanned, and all subscriptions were functioning normally.',
      view: 'Manage subscriptions',
    },

    healthReport: {
      title: 'Payment Kit Daily Data Report',
      period: 'Data period: {start} – {end} (UTC)',
      attentionSummary: '⚠️ {count} items need attention',
      attentionSummaryEmpty: '✅ No items need attention today',
      attentionEmpty: 'No items need attention',
      attentionUnreportedLabel: 'Metering anomaly subscriptions',
      attentionUnreportedValue: '{count} total, IDs: {ids}',
      attentionDiscrepantLabel: 'Billing discrepancy subscriptions',
      attentionDiscrepantValue: '{count} total, IDs: {ids}',
      attentionPendingConsumptionLabel: 'Overdue consumption',
      attentionPendingConsumptionValue: '{customers} customers, total {amount}',
      attentionRefundLabel: 'Refunds',
      attentionRefundValue: '{refundCount} refunds, total {refundAmount}',
      attentionPastDueLabel: 'Past due subscriptions',
      attentionPastDueValue: '{count}',
      coreMetricsTitle: '💰 Core Operating Metrics',
      coreRevenueLabel: 'Revenue',
      coreRevenueValue: '{revenue}',
      coreNewSubscriptionsLabel: 'New subscriptions',
      coreNewSubscriptionsValue: '{count}',
      coreCanceledSubscriptionsLabel: 'Canceled subscriptions',
      coreCanceledSubscriptionsValue: '{count}',
      corePaymentSuccessRateLabel: 'Payment success rate',
      corePaymentSuccessRateValue: '{rate}% ({succeeded}, {failed})',
      paymentSuccessCount: 'Success {count}',
      paymentFailedCount: 'Failed {count}',
      viewDataOverview: 'Data Overview',
      viewSubscriptions: 'View Subscriptions',
      viewOverdue: 'View Overdue Consumption',
    },

    subscriptionTrialStart: {
      title: '{productName} Trial Active',
      body: 'Your {productName} trial is now active. You have full access until {subscriptionTrialEnd}.',
    },

    subscriptionTrialWillEnd: {
      title: 'Trial Ending Soon: {productName}',
      body: 'Your trial for {productName} ends in {willRenewDuration}. To ensure uninterrupted service, please check your payment details.',
      unableToPayBody:
        'Your trial ends in {willRenewDuration}, but your current balance ({balance}) is below the renewal price ({price}). Please add funds to ensure uninterrupted service.',
      unableToPayReason:
        'The estimated renewal is {price}, but your balance is only {balance}. Please add funds to avoid payment failure.',
    },

    subscriptionSucceed: {
      title: '{productName} is ready to use',
      body: 'Your subscription is confirmed. You can now access {productName} or manage your deployment settings below.',
    },

    oneTimePaymentSucceeded: {
      title: 'Purchase Confirmed: {productName}',
      body: 'We have received your payment for {productName} on {at}. Your service is ready to use.',
    },

    subscriptionUpgraded: {
      title: 'Upgrade Complete: {productName}',
      body: 'Your {productName} plan was successfully upgraded on {at}. All new features are available immediately.',
    },

    subscriptionWillRenew: {
      title: 'Upcoming renewal: {productName}',
      body: 'Just a heads up that your subscription for {productName} will renew on {at}. No action is needed if you want to keep running.',
      unableToPayBody:
        'Your subscription to {productName} is scheduled for automatic payment on {at}({willRenewDuration} later). If you have any questions or need assistance, please feel free to contact us.',
      unableToPayReason:
        'The estimated payment amount is {price}, but your current balance is insufficient ({balance}). Please ensure your account has enough balance to avoid payment failure.',
      renewAmount: 'Payment amount',
      estimatedAmountNote: 'Estimate {amount}, billed based on final usage',
      estimatedAmountNoteRate: 'Estimate {amount}, based on the exchange rate at billing time',
      estimatedAmountNoteRateAndUsage: 'Estimate {amount}, based on final usage and the exchange rate at billing time',
    },

    subscriptionRenewed: {
      title: 'Payment Successful: {productName}',
      body: 'Your renewal for {productName} was processed on {at}. No further action is needed.',
      noExpenseIncurred: 'No expenses incurred during the service period',
    },

    subscriptionRenewFailed: {
      title: 'Action Required: Payment for {productName} failed',
      body: "We couldn't process the renewal for {productName} on {at}. To prevent your App from going offline, please update your payment method.",
      reason: {
        noDidWallet: 'You have not connected a DID Wallet. Please connect your DID Wallet to ensure sufficient balance',
        noDelegation: 'Your DID Wallet has not been authorized. Please update authorization',
        noTransferPermission:
          'Your DID Wallet has not granted transfer permission to the application. Please update authorization',
        noTokenPermission:
          'Your DID Wallet has not granted token transfer permission to the application. Please update authorization',
        noTransferTo:
          'Your DID Wallet has not granted automatic payment permission to the application. Please update authorization',
        noEnoughAllowance: 'The deduction amount exceeds the single transfer limit. Please update authorization',
        noToken: 'Your account has no tokens. Please add funds',
        noEnoughToken: 'Your account token balance is {balance}, which is insufficient for {price}. Please add funds',
        noSupported: 'Automatic payment with tokens is not supported. Please check your package',
        txSendFailed: 'Failed to send automatic payment transaction',
      },
    },

    autoRechargeFailed: {
      title: 'Action Required: Auto Top-Up Failed',
      body: "We couldn't process your auto top-up for {creditCurrencyName} on {at}. Please update your payment method to ensure your services stay online.",
      reason: {
        noDidWallet: 'You have not connected a DID Wallet. Please connect your DID Wallet to ensure sufficient balance',
        noDelegation: 'Your DID Wallet has not been authorized. Please update authorization',
        noTransferPermission:
          'Your DID Wallet has not granted transfer permission to the application. Please update authorization',
        noTokenPermission:
          'Your DID Wallet has not granted token transfer permission to the application. Please update authorization',
        noTransferTo:
          'Your DID Wallet has not granted automatic payment permission to the application. Please update authorization',
        noEnoughAllowance: 'The deduction amount exceeds the single transfer limit. Please update authorization',
        noToken: 'Your account has no tokens. Please add funds',
        noEnoughToken: 'Your account token balance is {balance}, which is insufficient for {price}. Please add funds',
        noSupported: 'Automatic payment with tokens is not supported. Please check your package',
        txSendFailed: 'Failed to send automatic payment transaction',
        // Skipped reasons (dynamic pricing)
        slippageExceeded:
          'Current {paymentCurrency} rate is {currentRate}, below your limit of {minAcceptableRate}. System will auto-retry when rate recovers.',
        exchangeRateNotSupported:
          '{paymentCurrency} rate is not available for your payment method. Please check your payment method configuration.',
        exchangeRateFetchFailed:
          'Unable to retrieve {paymentCurrency} rate at this time. System will auto-retry shortly.',
      },
      // For skipped scenarios (no invoice)
      titleSkipped: 'Auto Top-Up Skipped',
      titleSkippedSlippageExceeded: 'Auto Top-Up Skipped: Rate Below Your Limit',
      titleSkippedExchangeRateNotSupported: 'Auto Top-Up Skipped: Currency Not Supported',
      titleSkippedExchangeRateFetchFailed: 'Auto Top-Up Skipped: Rate Unavailable',
      bodySkipped: 'Your {creditCurrencyName} auto top-up scheduled for {at} was skipped. Details:',
      adjustSettings: 'Adjust Settings',
    },

    autoRechargeDailyLimitExceeded: {
      title: 'Auto Top-Up daily limit reached',
      body: 'Your {creditCurrencyName} balance is low, but auto top-up was not triggered because you have reached the daily recharge limit on {at}. You can manually reload or wait until tomorrow for automatic top-up.',
      dailyLimit: 'Daily Limit',
      dailyUsed: 'Used Today',
    },

    subscriptionRefundSucceeded: {
      title: 'Refund Processed: {productName}',
      body: 'A refund of {refundInfo} for {productName} was processed on {at}. It may take a few days to appear in your account.',
    },

    oneTimePaymentRefundSucceeded: {
      title: '{productName} refund successful',
      body: 'Your purchase of {productName} has been successfully refunded on {at}, with a refund amount of {refundInfo}. If you have any questions, please feel free to contact us.',
      titleNoProduct: 'You have a refund from invoice {invoiceNumber}',
      bodyNoProduct:
        'You have a refund from invoice {invoiceNumber} that has been successfully processed on {at}, with a refund amount of {refundInfo}. If you have any questions, please feel free to contact us.',
    },

    subscriptionStakeReturnSucceeded: {
      title: '{productName} stake return successful',
      body: 'The stake for your subscription to {productName} has been returned on {at}, with a return amount of {refundInfo}. If you have any questions, please feel free to contact us.',
    },

    subscriptionStakeSlashSucceeded: {
      title: '{productName} stake slashed',
      body: 'The stake for your subscription to {productName} has been slashed on {at}, with a slash amount of {slashInfo}. If you have any questions, please feel free to contact us.',
    },

    customerRewardSucceeded: {
      title: 'Thanks for your reward of {amount}',
      body: 'Thank you for your reward on {at}. The reward amount is {amount}. Your support is our driving force. Thank you for your generous support!',
      received: '{address} has received {amount}',
      viewDetail: 'View Reference',
    },

    customerRevenueSucceeded: {
      donate: {
        title: 'New Tip Received!',
        body: 'You received a tip of {amount} from {user} on {at}. Nice work!',
        tipDetail: 'View Tip Reference',
      },
      payment: {
        title: 'Payment Received',
        body: 'You received a payment of {amount} from {user} on {at}.',
      },
      sender: 'Payer',
      viewDetail: 'View Details',
      sent: '{address} has sent {amount}',
    },
    subscriptWillCanceled: {
      title: 'Subscription Cancelled: {productName}',
      body: "This subscription has been cancelled and will end on {at}. If this was a mistake, or if you'd like to reactivate, you can do so below.",
      pastDue:
        'Your {productName} subscription will be automatically cancelled by the system after {at} ({willCancelDuration} later) due to repeated automatic payment failures. Please resolve the automatic payment issue manually to avoid service interruption. If you have any questions, please feel free to contact us.',
      renewAmount: 'Deduction amount',
      cancelReason: 'Cancel reason',
      revokeStake: 'Revoke stake',
      adminCanceled: 'Admin canceled',
      customerCanceled: 'User-initiated cancellation',
      paymentDisputed: 'Payment disputed',
      paymentFailed: 'Payment failed',
      stakeRevoked: 'Stake revoked',
    },

    subscriptionCanceled: {
      title: '{productName} subscription canceled',
      body: 'Your subscription to {productName} has been canceled on {at}. If you have any questions, please feel free to contact us.',
      adminCanceled: 'Admin canceled',
      adminCanceledAndRefunded: 'Admin canceled and refunded, please check for the refund email',
      adminCanceledAndStakeReturned: 'Admin canceled and returned the stake, please check for the stake return email',
      adminCanceledAndSlashed: 'Admin canceled and slashed stake, please check for the stake slash email',
      adminCanceledAndRefundedAndStakeReturned:
        'The administrator has canceled the subscription and refunded, and the stake has been returned, please check for the refund and stake return email.',
      adminCanceledAndRefundedAndStakeSlashed:
        'The administrator has canceled the subscription and refunded, and the stake has been slashed, please check for the refund and stake slash email.',
      customerCanceled: 'User-initiated cancellation',
      customerCanceledAndStakeReturned:
        'User-initiated cancellation, the stake will be returned later, please check for the stake return email',
      paymentFailed: 'Payment failed',
      stakeRevoked: 'Stake revoked',
    },

    overdraftProtectionExhausted: {
      title: 'Insufficient Stake for SubGuard™',
      body: 'Your subscription to {productName} has insufficient staked amount for SubGuard™. Please increase your stake to maintain the service or disable it if no longer needed.',
    },

    aggregatedSubscriptionRenewed: {
      title: '{count} Subscriptions Renewed',
      body: 'During {startTime} - {endTime}, {count} subscriptions were successfully renewed, total amount: {totalAmount}.\n\nSubscription List:\n{subscriptionList}',
    },

    creditInsufficient: {
      title: 'Service Risk: Low Credit Balance',
      bodyWithSubscription:
        'Your credits ({availableAmount}) are too low to maintain your {subscriptionName} subscription. Please reload now to ensure your App stays online.',
      exhaustedTitle: 'Credit Balance Exhausted – Please Reload',
      exhaustedBodyWithSubscription:
        'Your credit balance is fully exhausted and can no longer cover your subscription to {subscriptionName}. To ensure uninterrupted service, please reload your account.',
      exhaustedBodyWithoutSubscription:
        'Your credit balance is fully exhausted. To ensure uninterrupted service, please reload your account.',
      meterEventName: 'Service',
      availableCredit: 'Available Balance',
      requiredCredit: 'Required Credit',
      pendingAmount: 'Outstanding Amount',
    },

    creditGrantGranted: {
      title: 'Congratulations! Your credits are now active',
      body: 'You have been granted {grantedAmount} in usage credits, activated on {at}, valid until {expiresAt}. Enjoy your service!',
      bodyNoExpire: 'You have been granted {grantedAmount} in usage credits, activated on {at}. Enjoy your service!',
      grantedCredit: 'Granted Credit',
      validUntil: 'Valid Until',
      neverExpires: 'Never Expires',
    },

    creditLowBalance: {
      title: 'Low Balance Alert',
      body: 'Your {currency} balance is down to {lowBalancePercentage}. Please reload soon to prevent service interruption.',
      remainingBalance: 'Remaining Balance',
      status: 'Status',
      lessThanOnePercent: 'less than 1%',
    },

    subscriptionSlippageWarning: {
      title: 'Rate Alert: {productName} Renewal',
      body: 'Your {productName} subscription will renew in {timeUntilRenewal}. The current exchange rate ({currentRate}) is below your minimum acceptable rate ({minAcceptableRate}). If the rate does not recover before renewal, automatic payment may fail.',
      currentRate: 'Current Rate',
      minAcceptableRate: 'Minimum Acceptable Rate',
      renewalTime: 'Renewal Time',
      adjustSlippage: 'Adjust Slippage Settings',
    },

    subscriptionSlippageExceeded: {
      title: 'Payment Paused: {productName}',
      body: 'Your {productName} subscription renewal has been paused because the current exchange rate ({currentRate}) is below your minimum acceptable rate ({minAcceptableRate}). The system will not auto-retry. Please pay manually to restore your subscription.',
      currentRate: 'Current Rate',
      minAcceptableRate: 'Minimum Acceptable Rate',
      payNow: 'Pay Now',
      adjustSlippage: 'Adjust Slippage Settings',
    },

    exchangeRateAlert: {
      spread_exceeded: {
        title: 'Exchange Rate Alert: High Spread Detected ({symbol})',
        body: 'The exchange rate spread for {symbol} has reached {spreadPercent}%, exceeding the threshold of {threshold}%. This may indicate rate source instability.',
      },
      providers_unavailable: {
        title: 'Exchange Rate Alert: All Providers Unavailable ({symbol})',
        body: 'All exchange rate providers for {symbol} are currently unavailable. Exchange rate queries will fail until providers recover.',
      },
      timestamp: 'Time',
      symbol: 'Symbol',
      spread: 'Spread',
      providers: 'Provider Rates',
      viewProviders: 'View Provider Settings',
    },
  },
});
