@happyvertical/smrt-planner 0.74.5 → 0.74.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents/commands.md +4 -1
- package/app/404.html +19 -19
- package/app/_app/immutable/chunks/{C1Rbcsvu.js → B3o6Rknr.js} +1 -1
- package/app/_app/immutable/chunks/{CiINyVEk.js → BCsG0yPA.js} +1 -1
- package/app/_app/immutable/chunks/BGH1Gldc.js +1 -0
- package/app/_app/immutable/chunks/{WDVtXo2s.js → BJmHlVD1.js} +1 -1
- package/app/_app/immutable/chunks/{B8noGqnu.js → BKEjwN7e.js} +1 -1
- package/app/_app/immutable/chunks/{DhKFeipJ.js → BLV4V97V.js} +3 -3
- package/app/_app/immutable/chunks/{D8_a77lI.js → BZZ38Fef.js} +1 -1
- package/app/_app/immutable/chunks/{BGpjZKOE.js → Bd49elEu.js} +2 -2
- package/app/_app/immutable/chunks/{BPaV-i4c.js → BwBnFWTa.js} +33 -33
- package/app/_app/immutable/chunks/{B2kj4s2l.js → C7j9p6vn.js} +1 -1
- package/app/_app/immutable/chunks/{DVCkUshu.js → CEjXJ7B5.js} +1 -1
- package/app/_app/immutable/chunks/{CzmhvqMm.js → CFdogvBd.js} +3 -3
- package/app/_app/immutable/chunks/CFgtBHwg.js +1 -0
- package/app/_app/immutable/chunks/{BkSRyxbi.js → CG2udJB7.js} +1 -1
- package/app/_app/immutable/chunks/{KNztSa_l.js → CGNVdAL6.js} +1 -1
- package/app/_app/immutable/chunks/{CQAoEXjB.js → CLDya5cW.js} +1 -1
- package/app/_app/immutable/chunks/{CtiX5NFR.js → CPOo7Mqy.js} +1 -1
- package/app/_app/immutable/chunks/{b2GOCpmX.js → CVX9TZgG.js} +1 -1
- package/app/_app/immutable/chunks/{BiAf4NGZ.js → Cgft4hMd.js} +1 -1
- package/app/_app/immutable/chunks/CkZrdLlG.js +38 -0
- package/app/_app/immutable/chunks/CxDpjDOz.js +1 -0
- package/app/_app/immutable/chunks/{BxCA1K_Z.js → CxVU31nv.js} +1 -1
- package/app/_app/immutable/chunks/{DQNfLdtf.js → DE9CTDAV.js} +1 -1
- package/app/_app/immutable/chunks/{DZ5qF5iM.js → DVxLQ65y.js} +2 -2
- package/app/_app/immutable/chunks/{lz97ExFx.js → D_AJgyg6.js} +1 -1
- package/app/_app/immutable/chunks/{CwqhfF5S.js → DjTOAaC5.js} +1 -1
- package/app/_app/immutable/chunks/{Dk7NIdWv.js → DxQ526Ze.js} +1 -1
- package/app/_app/immutable/chunks/{BU4tRNdG.js → JHfxjU4N.js} +1 -1
- package/app/_app/immutable/chunks/{7_8HgNgS.js → M1DpuAbK.js} +1 -1
- package/app/_app/immutable/chunks/{CTfrvbzN.js → bD_sGBgs.js} +1 -1
- package/app/_app/immutable/chunks/{C2YvuM4r.js → byX4M-gX.js} +1 -1
- package/app/_app/immutable/chunks/{Bqb0DfWr.js → sfaSS89b.js} +1 -1
- package/app/_app/immutable/entry/{app.CHTRmY95.js → app.Bbt1uEk8.js} +2 -2
- package/app/_app/immutable/entry/start.CTwAFOOc.js +1 -0
- package/app/_app/immutable/nodes/{0.glZzlkGQ.js → 0.DyXyhD8a.js} +1 -1
- package/app/_app/immutable/nodes/{1.DjY9Eis2.js → 1.DFgz_IHY.js} +1 -1
- package/app/_app/immutable/nodes/{10.DElJAFbA.js → 10.eYxVuitX.js} +1 -1
- package/app/_app/immutable/nodes/{11.DbDn7R1J.js → 11.bulbdqZB.js} +1 -1
- package/app/_app/immutable/nodes/{12.Dj6PkVWP.js → 12.EUFRmQcz.js} +1 -1
- package/app/_app/immutable/nodes/{13.Cwrhywif.js → 13.C5qDqgvb.js} +1 -1
- package/app/_app/immutable/nodes/{14.lrr_EO_Y.js → 14.9gnImIo3.js} +1 -1
- package/app/_app/immutable/nodes/{2.DtHnaQUb.js → 2.C8-sA1CW.js} +3 -3
- package/app/_app/immutable/nodes/{3.DHu3lavu.js → 3.B7pD_eCW.js} +1 -1
- package/app/_app/immutable/nodes/{4.CKqhELdP.js → 4.Du3MpFN8.js} +1 -1
- package/app/_app/immutable/nodes/{5.CPA3EQEE.js → 5.B_PGwkx4.js} +1 -1
- package/app/_app/immutable/nodes/{6.DVFNf2is.js → 6.BSi9Wxku.js} +1 -1
- package/app/_app/immutable/nodes/{7.D5ht7t0i.js → 7.BaglK1vh.js} +1 -1
- package/app/_app/immutable/nodes/{8.DXqsfPDi.js → 8.BvuwXwI-.js} +1 -1
- package/app/_app/immutable/nodes/{9.C8j4PwYb.js → 9.xgjYpIpr.js} +1 -1
- package/app/_app/immutable/workers/local-speech.worker-YQAn1epy.js +47 -0
- package/app/_app/version.json +1 -1
- package/app/advanced-styles/index.html +21 -21
- package/app/ai/index.html +25 -25
- package/app/blueprint/index.html +20 -20
- package/app/cookbook/index.html +20 -20
- package/app/index.html +28 -28
- package/app/m/ads/AdDeliveryTier/index.html +24 -24
- package/app/m/ads/AdEvent/index.html +24 -24
- package/app/m/ads/AdFormat/index.html +24 -24
- package/app/m/ads/AdGroup/index.html +24 -24
- package/app/m/ads/AdVariation/index.html +24 -24
- package/app/m/analytics/AnalyticsDataStream/index.html +24 -24
- package/app/m/analytics/AnalyticsEvent/index.html +24 -24
- package/app/m/analytics/AnalyticsProperty/index.html +24 -24
- package/app/m/analytics/AnalyticsReport/index.html +24 -24
- package/app/m/approvals/ApprovalEvent/index.html +24 -24
- package/app/m/approvals/ApprovalPolicy/index.html +24 -24
- package/app/m/approvals/ApprovalRequest/index.html +24 -24
- package/app/m/assets/Asset/attachments/index.html +25 -25
- package/app/m/assets/Asset/index.html +24 -24
- package/app/m/assets/AssetAssociation/index.html +24 -24
- package/app/m/assets/AssetMetafield/index.html +24 -24
- package/app/m/assets/AssetStatus/index.html +24 -24
- package/app/m/assets/AssetType/index.html +24 -24
- package/app/m/assets/Folder/index.html +24 -24
- package/app/m/chat/AgentSession/index.html +24 -24
- package/app/m/chat/ChatMessage/index.html +24 -24
- package/app/m/chat/ChatParticipant/index.html +24 -24
- package/app/m/chat/ChatReaction/index.html +24 -24
- package/app/m/chat/ChatRoom/index.html +24 -24
- package/app/m/chat/ChatThread/index.html +24 -24
- package/app/m/chat/VoiceGatewayTurn/index.html +24 -24
- package/app/m/chat/VoiceSession/index.html +24 -24
- package/app/m/commerce/AccountingConnection/index.html +24 -24
- package/app/m/commerce/AccountingInvoiceReadback/index.html +24 -24
- package/app/m/commerce/AccountingMapping/index.html +24 -24
- package/app/m/commerce/AccountingPaymentSync/index.html +24 -24
- package/app/m/commerce/Agreement/index.html +24 -24
- package/app/m/commerce/Cart/index.html +24 -24
- package/app/m/commerce/Contract/index.html +24 -24
- package/app/m/commerce/ContractLineItem/index.html +24 -24
- package/app/m/commerce/Customer/index.html +24 -24
- package/app/m/commerce/DocumentTax/index.html +24 -24
- package/app/m/commerce/Estimate/index.html +24 -24
- package/app/m/commerce/Fulfillment/index.html +24 -24
- package/app/m/commerce/FulfillmentLineItem/index.html +24 -24
- package/app/m/commerce/HistoricalCustomerFunds/index.html +24 -24
- package/app/m/commerce/HistoricalCustomerFundsAllocation/index.html +24 -24
- package/app/m/commerce/HistoricalSalesLine/index.html +24 -24
- package/app/m/commerce/Invoice/index.html +24 -24
- package/app/m/commerce/InvoiceLineItem/index.html +24 -24
- package/app/m/commerce/Lease/index.html +24 -24
- package/app/m/commerce/LicenseSale/index.html +24 -24
- package/app/m/commerce/Order/index.html +24 -24
- package/app/m/commerce/Payment/index.html +24 -24
- package/app/m/commerce/PaymentAllocation/index.html +24 -24
- package/app/m/commerce/PaymentInstrument/index.html +24 -24
- package/app/m/commerce/PaymentIntent/index.html +24 -24
- package/app/m/commerce/Payout/index.html +24 -24
- package/app/m/commerce/ProductionOrder/index.html +24 -24
- package/app/m/commerce/PurchaseContract/index.html +24 -24
- package/app/m/commerce/PurchaseOrder/index.html +24 -24
- package/app/m/commerce/SalesContract/index.html +24 -24
- package/app/m/commerce/SupplierQuote/index.html +24 -24
- package/app/m/commerce/TaxCode/index.html +24 -24
- package/app/m/commerce/TaxComponent/index.html +24 -24
- package/app/m/commerce/TaxSettings/index.html +24 -24
- package/app/m/commerce/TaxSummaryReport/index.html +24 -24
- package/app/m/commerce/TenantPaymentAccount/index.html +24 -24
- package/app/m/commerce/Vendor/index.html +24 -24
- package/app/m/commerce/WholesaleOrder/index.html +24 -24
- package/app/m/content/Content/articles/index.html +25 -25
- package/app/m/content/Content/index.html +24 -24
- package/app/m/content/ContentContribution/index.html +24 -24
- package/app/m/content/ContentContributionAttachment/index.html +24 -24
- package/app/m/content/ContentContributionRevision/index.html +24 -24
- package/app/m/content/ContentContributionType/index.html +24 -24
- package/app/m/content/ContentContributor/index.html +24 -24
- package/app/m/content/ContentCorrection/index.html +24 -24
- package/app/m/content/ContentFeedSource/index.html +24 -24
- package/app/m/content/ContentGovernanceAssignment/index.html +24 -24
- package/app/m/content/ContentGovernancePolicy/index.html +24 -24
- package/app/m/content/ContentGovernanceProfile/index.html +24 -24
- package/app/m/content/ContentReference/index.html +24 -24
- package/app/m/content/ContentReview/index.html +24 -24
- package/app/m/content/ContentVersion/index.html +24 -24
- package/app/m/events/Event/index.html +24 -24
- package/app/m/events/EventParticipant/index.html +24 -24
- package/app/m/events/EventSeries/index.html +24 -24
- package/app/m/events/EventType/index.html +24 -24
- package/app/m/expenses/Expense/index.html +24 -24
- package/app/m/facts/Fact/index.html +24 -24
- package/app/m/facts/FactContent/index.html +24 -24
- package/app/m/facts/FactEvidence/index.html +24 -24
- package/app/m/facts/FactSource/index.html +24 -24
- package/app/m/facts/FactSubject/index.html +24 -24
- package/app/m/facts/FactTag/index.html +24 -24
- package/app/m/fields/FieldPolicy/index.html +24 -24
- package/app/m/fields/FieldPolicySuggestion/index.html +24 -24
- package/app/m/fields/FieldUsageCounter/index.html +24 -24
- package/app/m/human-resources/Employment/index.html +24 -24
- package/app/m/human-resources/EmploymentTerm/index.html +24 -24
- package/app/m/human-resources/HeldQualification/index.html +24 -24
- package/app/m/human-resources/Qualification/index.html +24 -24
- package/app/m/images/Image/index.html +24 -24
- package/app/m/inventory/InventoryLocation/index.html +24 -24
- package/app/m/inventory/Lot/index.html +24 -24
- package/app/m/inventory/LotCorrection/index.html +24 -24
- package/app/m/inventory/LotDocument/index.html +24 -24
- package/app/m/inventory/LotStockLevel/index.html +24 -24
- package/app/m/inventory/LotUsage/index.html +24 -24
- package/app/m/inventory/StockLevel/index.html +24 -24
- package/app/m/inventory/StockMovement/index.html +24 -24
- package/app/m/ledgers/Account/index.html +24 -24
- package/app/m/ledgers/Journal/index.html +24 -24
- package/app/m/ledgers/JournalEntry/index.html +24 -24
- package/app/m/ledgers/Ledger/index.html +24 -24
- package/app/m/manufacturing/Assembly/index.html +24 -24
- package/app/m/manufacturing/BillOfMaterials/index.html +24 -24
- package/app/m/manufacturing/BomLine/index.html +24 -24
- package/app/m/manufacturing/Operation/index.html +24 -24
- package/app/m/manufacturing/ProductionRun/index.html +24 -24
- package/app/m/manufacturing/ProductionRunCompletion/index.html +24 -24
- package/app/m/manufacturing/RoutingStep/index.html +24 -24
- package/app/m/marketing/Campaign/index.html +24 -24
- package/app/m/marketing/CampaignChannel/index.html +24 -24
- package/app/m/marketing/CampaignMetricSnapshot/index.html +24 -24
- package/app/m/messages/Account/index.html +24 -24
- package/app/m/messages/Attachment/index.html +24 -24
- package/app/m/messages/Blacklist/index.html +24 -24
- package/app/m/messages/Email/failed-sends/index.html +25 -25
- package/app/m/messages/Email/index.html +24 -24
- package/app/m/messages/Email/mailbox/index.html +25 -25
- package/app/m/messages/EmailAccount/index.html +24 -24
- package/app/m/messages/EmailAttachment/index.html +24 -24
- package/app/m/messages/EmailFolder/index.html +24 -24
- package/app/m/messages/Message/index.html +24 -24
- package/app/m/messages/MessagingEndpoint/index.html +24 -24
- package/app/m/messages/PersonaMessageRoute/index.html +24 -24
- package/app/m/messages/SlackAccount/index.html +24 -24
- package/app/m/messages/SlackMessage/index.html +24 -24
- package/app/m/messages/SlackMessage/slack-messages/index.html +25 -25
- package/app/m/messages/TelegramAccount/index.html +24 -24
- package/app/m/messages/Tweet/index.html +24 -24
- package/app/m/messages/TwitterAccount/index.html +24 -24
- package/app/m/messages/Whitelist/index.html +24 -24
- package/app/m/messages/ZulipAccount/index.html +24 -24
- package/app/m/places/Place/index.html +24 -24
- package/app/m/places/PlaceType/index.html +24 -24
- package/app/m/products/Category/index.html +24 -24
- package/app/m/products/Material/index.html +24 -24
- package/app/m/products/Product/index.html +24 -24
- package/app/m/products/Product/ingredients/index.html +25 -25
- package/app/m/products/ProductVariant/index.html +24 -24
- package/app/m/products/Sku/index.html +24 -24
- package/app/m/profiles/ApiKey/index.html +24 -24
- package/app/m/profiles/Bot/index.html +24 -24
- package/app/m/profiles/MagicLinkToken/index.html +24 -24
- package/app/m/profiles/NostrIdentity/index.html +24 -24
- package/app/m/profiles/OidcIdentity/index.html +24 -24
- package/app/m/profiles/Organization/index.html +24 -24
- package/app/m/profiles/Person/index.html +24 -24
- package/app/m/profiles/Profile/index.html +24 -24
- package/app/m/profiles/ProfileMetadata/index.html +24 -24
- package/app/m/profiles/ProfileMetafield/index.html +24 -24
- package/app/m/profiles/ProfileRelationship/index.html +24 -24
- package/app/m/profiles/ProfileRelationshipTerm/index.html +24 -24
- package/app/m/profiles/ProfileRelationshipType/index.html +24 -24
- package/app/m/profiles/ProfileType/index.html +24 -24
- package/app/m/projects/Comment/index.html +24 -24
- package/app/m/projects/Issue/index.html +24 -24
- package/app/m/projects/Label/index.html +24 -24
- package/app/m/projects/Project/index.html +24 -24
- package/app/m/projects/ProjectIntegration/index.html +24 -24
- package/app/m/projects/PullRequest/index.html +24 -24
- package/app/m/projects/Repository/index.html +24 -24
- package/app/m/properties/Property/index.html +24 -24
- package/app/m/properties/Zone/index.html +24 -24
- package/app/m/reports/RuntimeReport/index.html +24 -24
- package/app/m/reports/SmrtPrincipalReportRefreshTask/index.html +24 -24
- package/app/m/reports/SmrtReportLock/index.html +24 -24
- package/app/m/reports/SmrtReportRefreshTask/index.html +24 -24
- package/app/m/reports/SmrtReportRun/index.html +24 -24
- package/app/m/reports/SmrtReportSchedule/index.html +24 -24
- package/app/m/reports/SmrtReportWatermark/index.html +24 -24
- package/app/m/sales/Agreement/index.html +24 -24
- package/app/m/sales/AttributionException/index.html +24 -24
- package/app/m/sales/AttributionPolicy/index.html +24 -24
- package/app/m/sales/Commission/index.html +24 -24
- package/app/m/sales/CommissionAdjustment/index.html +24 -24
- package/app/m/sales/CommissionPayout/index.html +24 -24
- package/app/m/sales/CommissionPlan/index.html +24 -24
- package/app/m/sales/Earner/index.html +24 -24
- package/app/m/sales/EarnerSourceAttribution/index.html +24 -24
- package/app/m/sales/EarningEvent/index.html +24 -24
- package/app/m/sales/ExecutedAgreement/index.html +24 -24
- package/app/m/sales/Lead/index.html +24 -24
- package/app/m/sales/Opportunity/index.html +24 -24
- package/app/m/sales/OpportunityConversion/index.html +24 -24
- package/app/m/sales/PipelineDefinition/index.html +24 -24
- package/app/m/sales/PipelineStage/index.html +24 -24
- package/app/m/sales/Referral/index.html +24 -24
- package/app/m/sales/ReferralAgreement/index.html +24 -24
- package/app/m/sales/ReferralLink/index.html +24 -24
- package/app/m/sales/ReferralProgram/index.html +24 -24
- package/app/m/sales/ReferralTermSnapshot/index.html +24 -24
- package/app/m/sales/ReferralTouch/index.html +24 -24
- package/app/m/sales/Referrer/index.html +24 -24
- package/app/m/sales/ReferrerIdentifier/index.html +24 -24
- package/app/m/sales/SalesActivity/index.html +24 -24
- package/app/m/sales/SalesRepresentative/index.html +24 -24
- package/app/m/sites/DnsZone/index.html +24 -24
- package/app/m/sites/Domain/index.html +24 -24
- package/app/m/sites/ProjectDomain/index.html +24 -24
- package/app/m/sites/Site/index.html +24 -24
- package/app/m/sites/SiteAgentBinding/index.html +24 -24
- package/app/m/social/OAuthState/index.html +24 -24
- package/app/m/social/SocialAccount/index.html +24 -24
- package/app/m/social/SocialPost/index.html +24 -24
- package/app/m/social/SocialPostAnalyticsSnapshot/index.html +24 -24
- package/app/m/subscriptions/BillingAdjustment/index.html +24 -24
- package/app/m/subscriptions/ClientCharge/index.html +24 -24
- package/app/m/subscriptions/CreditGrant/index.html +24 -24
- package/app/m/subscriptions/PricingRule/index.html +24 -24
- package/app/m/subscriptions/RetailCharge/index.html +24 -24
- package/app/m/subscriptions/SpendingPolicy/index.html +24 -24
- package/app/m/subscriptions/SubscriptionPlan/index.html +24 -24
- package/app/m/subscriptions/SubscriptionPlanVersion/index.html +24 -24
- package/app/m/subscriptions/TenantSubscription/index.html +24 -24
- package/app/m/subscriptions/TenantUsageMetric/index.html +24 -24
- package/app/m/support/ServiceTimeEntry/index.html +24 -24
- package/app/m/support/SupportAiRun/index.html +24 -24
- package/app/m/support/SupportAvailability/index.html +24 -24
- package/app/m/support/SupportCase/index.html +24 -24
- package/app/m/support/SupportCaseEvent/index.html +24 -24
- package/app/m/support/SupportChannelBinding/index.html +24 -24
- package/app/m/support/SupportCharge/index.html +24 -24
- package/app/m/support/SupportCompensation/index.html +24 -24
- package/app/m/support/SupportCompensationPlan/index.html +24 -24
- package/app/m/support/SupportEscalation/index.html +24 -24
- package/app/m/support/SupportInteraction/index.html +24 -24
- package/app/m/support/SupportPlan/index.html +24 -24
- package/app/m/support/SupportPolicy/index.html +24 -24
- package/app/m/support/SupportQualification/index.html +24 -24
- package/app/m/support/SupportServiceTarget/index.html +24 -24
- package/app/m/support/SupportSpecialist/index.html +24 -24
- package/app/m/support/SupportWorkLink/index.html +24 -24
- package/app/m/tags/Tag/index.html +24 -24
- package/app/m/tags/TagAlias/index.html +24 -24
- package/app/m/timesheets/AttendanceBreak/index.html +24 -24
- package/app/m/timesheets/AttendancePunch/index.html +24 -24
- package/app/m/timesheets/AttendanceSegment/index.html +24 -24
- package/app/m/timesheets/ServiceChargeSnapshot/index.html +24 -24
- package/app/m/timesheets/ServiceCompensationSnapshot/index.html +24 -24
- package/app/m/timesheets/ServiceTimeEntry/index.html +24 -24
- package/app/m/users/Group/index.html +24 -24
- package/app/m/users/GroupMember/index.html +24 -24
- package/app/m/users/GroupRole/index.html +24 -24
- package/app/m/users/Membership/index.html +24 -24
- package/app/m/users/MembershipOverride/index.html +24 -24
- package/app/m/users/Permission/index.html +24 -24
- package/app/m/users/Role/index.html +24 -24
- package/app/m/users/RolePermission/index.html +24 -24
- package/app/m/users/Session/index.html +24 -24
- package/app/m/users/Tenant/index.html +24 -24
- package/app/m/users/TenantGuestGrant/index.html +24 -24
- package/app/m/users/TenantIntegration/index.html +24 -24
- package/app/m/users/TenantPermissionOverride/index.html +24 -24
- package/app/m/users/User/index.html +24 -24
- package/app/m/video/Character/index.html +24 -24
- package/app/m/video/CharacterAsset/index.html +24 -24
- package/app/m/video/CompositeJob/index.html +24 -24
- package/app/m/video/Performer/index.html +24 -24
- package/app/m/video/PerformerAsset/index.html +24 -24
- package/app/m/video/Scene/index.html +24 -24
- package/app/m/video/SceneAsset/index.html +24 -24
- package/app/m/video/VideoComposition/index.html +24 -24
- package/app/m/video/VideoCompositionAsset/index.html +24 -24
- package/app/m/video/VideoSequence/index.html +24 -24
- package/app/m/video/VideoSequenceAsset/index.html +24 -24
- package/app/m/video/VideoShot/index.html +24 -24
- package/app/m/video/VideoShotAsset/index.html +24 -24
- package/app/m/video/VideoShotCharacter/index.html +24 -24
- package/app/m/video/VideoWorkflow/index.html +24 -24
- package/app/m/voice/VoiceOutput/index.html +24 -24
- package/app/m/voice/VoiceProfile/index.html +24 -24
- package/app/m/voice/VoiceSample/index.html +24 -24
- package/app/mcp.html +1837 -4
- package/app/packages/ads/index.html +22 -22
- package/app/packages/analytics/index.html +22 -22
- package/app/packages/app-mcp/index.html +22 -22
- package/app/packages/approvals/index.html +22 -22
- package/app/packages/assets/index.html +22 -22
- package/app/packages/chat/index.html +22 -22
- package/app/packages/comments/index.html +22 -22
- package/app/packages/commerce/index.html +22 -22
- package/app/packages/content/index.html +22 -22
- package/app/packages/events/index.html +22 -22
- package/app/packages/expenses/index.html +22 -22
- package/app/packages/facts/index.html +22 -22
- package/app/packages/fields/index.html +22 -22
- package/app/packages/human-resources/index.html +22 -22
- package/app/packages/images/index.html +22 -22
- package/app/packages/index.html +21 -21
- package/app/packages/inference/index.html +22 -22
- package/app/packages/ingestion/index.html +22 -22
- package/app/packages/inventory/index.html +22 -22
- package/app/packages/ledgers/index.html +22 -22
- package/app/packages/manufacturing/index.html +22 -22
- package/app/packages/marketing/index.html +22 -22
- package/app/packages/messages/index.html +22 -22
- package/app/packages/places/index.html +22 -22
- package/app/packages/preferences/index.html +22 -22
- package/app/packages/products/index.html +22 -22
- package/app/packages/profiles/index.html +22 -22
- package/app/packages/projects/index.html +22 -22
- package/app/packages/properties/index.html +22 -22
- package/app/packages/reactions/index.html +22 -22
- package/app/packages/reports/index.html +22 -22
- package/app/packages/sales/index.html +22 -22
- package/app/packages/sites/index.html +22 -22
- package/app/packages/social/index.html +22 -22
- package/app/packages/subscriptions/index.html +22 -22
- package/app/packages/support/index.html +22 -22
- package/app/packages/tags/index.html +22 -22
- package/app/packages/timesheets/index.html +22 -22
- package/app/packages/users/index.html +22 -22
- package/app/packages/video/index.html +22 -22
- package/app/packages/voice/index.html +22 -22
- package/app/packages/webhooks/index.html +22 -22
- package/app/recipes/account-access/help/index.html +22 -22
- package/app/recipes/account-access/index.html +24 -24
- package/app/recipes/activity/help/index.html +22 -22
- package/app/recipes/activity/index.html +24 -24
- package/app/recipes/ads.campaigns/help/index.html +22 -22
- package/app/recipes/ads.campaigns/index.html +24 -24
- package/app/recipes/affiliates.referrals/help/index.html +22 -22
- package/app/recipes/affiliates.referrals/index.html +24 -24
- package/app/recipes/agreements/help/index.html +22 -22
- package/app/recipes/agreements/index.html +24 -24
- package/app/recipes/analytics.reports/help/index.html +22 -22
- package/app/recipes/analytics.reports/index.html +24 -24
- package/app/recipes/approvals.requests/help/index.html +22 -22
- package/app/recipes/approvals.requests/index.html +24 -24
- package/app/recipes/assets/help/index.html +22 -22
- package/app/recipes/assets/index.html +24 -24
- package/app/recipes/billing/help/index.html +22 -22
- package/app/recipes/billing/index.html +24 -24
- package/app/recipes/chat.assistant/help/index.html +22 -22
- package/app/recipes/chat.assistant/index.html +24 -24
- package/app/recipes/comments/help/index.html +22 -22
- package/app/recipes/comments/index.html +24 -24
- package/app/recipes/commerce.customers/help/index.html +22 -22
- package/app/recipes/commerce.customers/index.html +24 -24
- package/app/recipes/commerce.estimates/help/index.html +22 -22
- package/app/recipes/commerce.estimates/index.html +24 -24
- package/app/recipes/commerce.purchases/help/index.html +22 -22
- package/app/recipes/commerce.purchases/index.html +24 -24
- package/app/recipes/commerce.sales/help/index.html +22 -22
- package/app/recipes/commerce.sales/index.html +24 -24
- package/app/recipes/commerce.vendors/help/index.html +22 -22
- package/app/recipes/commerce.vendors/index.html +24 -24
- package/app/recipes/commerce.wholesale/help/index.html +22 -22
- package/app/recipes/commerce.wholesale/index.html +24 -24
- package/app/recipes/content.articles/help/index.html +22 -22
- package/app/recipes/content.articles/index.html +24 -24
- package/app/recipes/events.calendar/help/index.html +22 -22
- package/app/recipes/events.calendar/index.html +24 -24
- package/app/recipes/expenses.tracking/help/index.html +22 -22
- package/app/recipes/expenses.tracking/index.html +24 -24
- package/app/recipes/fields.form-customization/help/index.html +22 -22
- package/app/recipes/fields.form-customization/index.html +24 -24
- package/app/recipes/human-resources.people/help/index.html +22 -22
- package/app/recipes/human-resources.people/index.html +24 -24
- package/app/recipes/human-resources.qualifications/help/index.html +22 -22
- package/app/recipes/human-resources.qualifications/index.html +24 -24
- package/app/recipes/ingestion/help/index.html +22 -22
- package/app/recipes/ingestion/index.html +24 -24
- package/app/recipes/integrations/help/index.html +22 -22
- package/app/recipes/integrations/index.html +24 -24
- package/app/recipes/inventory.stock/help/index.html +22 -22
- package/app/recipes/inventory.stock/index.html +24 -24
- package/app/recipes/ledgers.bookkeeping/help/index.html +22 -22
- package/app/recipes/ledgers.bookkeeping/index.html +24 -24
- package/app/recipes/manufacturing.assemblies/help/index.html +22 -22
- package/app/recipes/manufacturing.assemblies/index.html +24 -24
- package/app/recipes/manufacturing.production/help/index.html +22 -22
- package/app/recipes/manufacturing.production/index.html +24 -24
- package/app/recipes/marketing.campaigns/help/index.html +22 -22
- package/app/recipes/marketing.campaigns/index.html +24 -24
- package/app/recipes/messages/help/index.html +22 -22
- package/app/recipes/messages/index.html +24 -24
- package/app/recipes/places.locations/help/index.html +22 -22
- package/app/recipes/places.locations/index.html +24 -24
- package/app/recipes/products/help/index.html +22 -22
- package/app/recipes/products/index.html +24 -24
- package/app/recipes/profiles.identity/help/index.html +22 -22
- package/app/recipes/profiles.identity/index.html +24 -24
- package/app/recipes/projects.tracker/help/index.html +22 -22
- package/app/recipes/projects.tracker/index.html +24 -24
- package/app/recipes/reports.materialized/help/index.html +22 -22
- package/app/recipes/reports.materialized/index.html +24 -24
- package/app/recipes/reports.runtime/help/index.html +22 -22
- package/app/recipes/reports.runtime/index.html +24 -24
- package/app/recipes/sales.pipeline/help/index.html +22 -22
- package/app/recipes/sales.pipeline/index.html +24 -24
- package/app/recipes/social.posts/help/index.html +22 -22
- package/app/recipes/social.posts/index.html +24 -24
- package/app/recipes/subscriptions.plans/help/index.html +22 -22
- package/app/recipes/subscriptions.plans/index.html +24 -24
- package/app/recipes/support.tickets/help/index.html +22 -22
- package/app/recipes/support.tickets/index.html +24 -24
- package/app/recipes/tags.taxonomy/help/index.html +22 -22
- package/app/recipes/tags.taxonomy/index.html +24 -24
- package/app/recipes/team-collaboration/help/index.html +22 -22
- package/app/recipes/team-collaboration/index.html +24 -24
- package/app/recipes/timesheets.time-entries/help/index.html +22 -22
- package/app/recipes/timesheets.time-entries/index.html +24 -24
- package/app/recipes/video.library/help/index.html +22 -22
- package/app/recipes/video.library/index.html +24 -24
- package/app/recipes/voice.profiles/help/index.html +22 -22
- package/app/recipes/voice.profiles/index.html +24 -24
- package/app/s/custom-accounts/index.html +20 -20
- package/app/s/custom-appointments/index.html +20 -20
- package/app/s/custom-billing/index.html +20 -20
- package/app/s/custom-bookings/index.html +20 -20
- package/app/s/custom-buying/index.html +20 -20
- package/app/s/custom-checkout/index.html +20 -20
- package/app/s/custom-classes/index.html +20 -20
- package/app/s/custom-clients/index.html +20 -20
- package/app/s/custom-events/index.html +20 -20
- package/app/s/custom-fleet/index.html +20 -20
- package/app/s/custom-gigs/index.html +20 -20
- package/app/s/custom-giving/index.html +20 -20
- package/app/s/custom-instruments/index.html +20 -20
- package/app/s/custom-jobs/index.html +20 -20
- package/app/s/custom-kitchen/index.html +20 -20
- package/app/s/custom-lessons/index.html +20 -20
- package/app/s/custom-material/index.html +20 -20
- package/app/s/custom-meetings/index.html +20 -20
- package/app/s/custom-members/index.html +20 -20
- package/app/s/custom-merch/index.html +20 -20
- package/app/s/custom-money/index.html +20 -20
- package/app/s/custom-paint/index.html +20 -20
- package/app/s/custom-parts/index.html +20 -20
- package/app/s/custom-rentals/index.html +20 -20
- package/app/s/custom-roastery/index.html +20 -20
- package/app/s/custom-schedule/index.html +20 -20
- package/app/s/custom-shelf/index.html +20 -20
- package/app/s/custom-shop/index.html +20 -20
- package/app/s/custom-students/index.html +20 -20
- package/app/s/custom-wholesale/index.html +20 -20
- package/app/s/custom-work/index.html +20 -20
- package/app/s/custom-yard/index.html +20 -20
- package/app/s/section-access-control/index.html +20 -20
- package/app/s/section-account-security/index.html +20 -20
- package/app/s/section-accounting/index.html +20 -20
- package/app/s/section-agreements/index.html +20 -20
- package/app/s/section-analytics/index.html +20 -20
- package/app/s/section-approvals/index.html +20 -20
- package/app/s/section-assets/index.html +20 -20
- package/app/s/section-billing/index.html +20 -20
- package/app/s/section-calendar/index.html +20 -20
- package/app/s/section-catalog/index.html +20 -20
- package/app/s/section-grow/index.html +20 -20
- package/app/s/section-make/index.html +20 -20
- package/app/s/section-messages/index.html +20 -20
- package/app/s/section-more/index.html +20 -20
- package/app/s/section-operations/index.html +20 -20
- package/app/s/section-places/index.html +20 -20
- package/app/s/section-projects/index.html +20 -20
- package/app/s/section-publish/index.html +20 -20
- package/app/s/section-purchasing/index.html +20 -20
- package/app/s/section-reports.runtime/index.html +20 -20
- package/app/s/section-sales/index.html +20 -20
- package/app/s/section-staff/index.html +20 -20
- package/app/s/section-support/index.html +20 -20
- package/app/s/section-taxonomy/index.html +20 -20
- package/app/s/section-team/index.html +20 -20
- package/app/s/section-work/index.html +20 -20
- package/dist/assistant/engine-host.d.ts +8 -0
- package/dist/assistant/engine-host.d.ts.map +1 -0
- package/dist/assistant/engine-host.js +18 -0
- package/dist/assistant/engine.d.ts +2 -2
- package/dist/assistant/engine.d.ts.map +1 -1
- package/dist/assistant/engine.js +2 -14
- package/dist/catalog/catalog.json +41 -41
- package/dist/core/index.js +43 -43
- package/dist/smrt-version.d.ts +1 -1
- package/dist/smrt-version.js +1 -1
- package/package.json +57 -57
- package/app/_app/immutable/assets/ort-wasm-simd-threaded.asyncify.CxOG5pUO.wasm +0 -0
- package/app/_app/immutable/chunks/CD45uyRP.js +0 -1
- package/app/_app/immutable/chunks/CMgP05SN.js +0 -42
- package/app/_app/immutable/chunks/DldLW0Wy.js +0 -1
- package/app/_app/immutable/chunks/DzAsw_-n.js +0 -1
- package/app/_app/immutable/entry/start.Dp2ozaPp.js +0 -1
- package/app/_app/immutable/workers/assets/ort-wasm-simd-threaded.asyncify-CxOG5pUO.wasm +0 -0
- package/app/_app/immutable/workers/local-speech.worker-BzGX7Qdn.js +0 -51
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,bt as t,tt as n,vt as r,xt as i}from"./DG3qFFTE.js";import{F as a,G as o,H as s,N as c,P as ee,U as te,V as l,W as u,_t as d,ct as f,ft as p,pt as m,w as h,z as ne}from"./
|
|
1
|
+
import{$ as e,bt as t,tt as n,vt as r,xt as i}from"./DG3qFFTE.js";import{F as a,G as o,H as s,N as c,P as ee,U as te,V as l,W as u,_t as d,ct as f,ft as p,pt as m,w as h,z as ne}from"./BwBnFWTa.js";import{_ as re,r as ie}from"./BLV4V97V.js";import{c as ae}from"./CFdogvBd.js";import"./CxDpjDOz.js";import{i as oe,n as g,o as _,r as v,s as y}from"./DVxLQ65y.js";import{M as b,P as x,V as S,W as C,b as w,t as T,v as E,x as D,z as O}from"./DxQ526Ze.js";import{b as k,v as A,x as j,y as M}from"./BKEjwN7e.js";import{n as N}from"./BJmHlVD1.js";import{t as P}from"./DE9CTDAV.js";import{r as F,t as I}from"./D_AJgyg6.js";import{a as L,c as R,d as z,l as B,n as V}from"./B3o6Rknr.js";function H(e,t=A.appliedWork){return j(e.snapshot(),t)}function U(e,t,n){let r=M(e,_,n);if(r.ok){let n=t.theme,i=r.cookbook.theme,o=i?i.colorScheme||!n?.colorScheme?void 0:{...i,colorScheme:n.colorScheme}:n;t.replace(r.cookbook),o&&(t.theme=o),a(e.id),A.select(e.id,k(t.snapshot()))}return r}function W(e,t){return e.document.recipes.every(e=>t.recipes.includes(e))&&e.document.features.every(e=>t.features.includes(e))}function G(e){let t=e.recipes.flatMap(e=>{let t=D.get(e);return t?[t]:[]}),n=O(t).map(e=>{let t=new Set,n=[];for(let r of e.recipes)for(let e of E(r)){let r=S(e.packageId,e.model.name,e.key);t.has(r)||(t.add(r),n.push({id:r,href:`#`,label:e.label,icon:e.icon,description:e.description}))}return{id:`section:${e.id}`,heading:e.label,items:n}}).filter(e=>e.items.length>0),r=x(e.features).map(e=>({id:e.id,href:`#`,label:e.label,icon:e.icon,description:e.description}));return r.length&&n.push({id:`section:${b.id}`,heading:b.label,items:r}),n}function K(e){let t=e.layout;return re([],G(e),void 0,t).groups.map(e=>({id:e.id??String(e.heading),label:e.heading??``,entries:e.items.map(e=>({id:e.id??e.href,label:t?.items?.[e.id??e.href]?.label?.trim()||e.label}))}))}var q={live:`Live`,mock:`Mock`,sample:`Sample`,server:`Server`},se={live:`Runs for real in your browser.`,mock:`Runs in your browser, but a provider is faked.`,sample:`Shows sample data only; it cannot reach what it needs.`,server:`Needs a server, which this browser-only demo does not have.`},ce={live:`success`,mock:`info`,sample:`warning`,server:`default`};function le(e){return e.effectiveDemo??e.demo}function ue(e){if(e)return{mode:e.mode,label:q[e.mode],meaning:se[e.mode],variant:ce[e.mode],reasons:e.reasons,mocked:e.mocked??[]}}function de(e){if(!e)return;if(e.status===`browser-safe`)return`Its package builds for a browser.`;let t=[`Its package does not build for a browser yet`];return e.reason&&t.push(`(${e.reason})`),e.issues?.length&&t.push(`and is tracked in ${e.issues.join(`, `)}`),`${t.join(` `)}.`}var J=`@happyvertical/smrt-commerce:`,fe=`${J}TaxCode`,pe=`${J}TaxComponent`,Y=`${J}TaxSettings`,me=`${J}DocumentTax`;function X(){let e=ee()??.05;return{codes:p(e),fallback:f(e)}}function he(e){try{let t=e?.getItem(oe);if(!t)return;let n=y(t,{dropUnknownRecipes:!0});n.ok&&v(n.cookbook)}catch{}}function ge(){return he(u()),I({storage:u(),defaults:e=>T.apply(e).background,empty:[L,V,me,P],samples:{[fe]:{from:[],make:()=>X().codes.map(e=>({id:e.id,code:e.code,name:e.name,kind:e.kind,appliesTo:e.appliesTo,active:e.active,componentsJson:JSON.stringify(e.components.map(e=>({taxComponentId:e.id,compound:!1})))}))},[pe]:{from:[],make:()=>m(X().codes).map(e=>({id:e.id,name:e.name,percent:e.percent,liabilityAccountId:null,recoverable:e.recoverable,active:!0}))},[Y]:{from:[],make:()=>{let{fallback:e}=X(),t=c();return[{id:h(`${Y}:sample`),defaultSalesTaxCodeId:e.id,defaultPurchaseTaxCodeId:e.id,defaultLineAmountType:t.pricesIncludeTax?`inclusive`:`exclusive`,taxRoundingScope:t.taxRounding}]}},...R(F),[B]:{from:[F(`@happyvertical/smrt-products:Product`)],make:([e])=>(e??[]).map((e,t)=>({id:h(`${B}:sample:${e.id}`),name:`${String(e.name??`Product`)} image`,sourceUri:`data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240"><rect width="240" height="240" fill="hsl(${t*47%360} 40% 82%)"/><circle cx="120" cy="94" r="46" fill="hsl(${(t*47+30)%360} 35% 58%)"/><path d="M44 214c20-55 132-55 152 0" fill="hsl(${(t*47+10)%360} 30% 46%)"/><text x="120" y="224" text-anchor="middle" font-family="sans-serif" font-size="14" fill="white">${String(e.name??``).replace(/[<&>]/g,``)}</text></svg>`)}`,mimeType:`image/svg+xml`,description:`Sample image for ${String(e.name??`this product`)}.`,sourceType:`browser-demo`}))},[z]:{from:[F(`@happyvertical/smrt-products:Product`),F(B)],make:([e,t])=>(e??[]).flatMap((e,n)=>{let r=t?.[n];return r?[{id:h(`${z}:sample:${e.id}`),productId:e.id,assetId:r.id,relationship:`gallery`,sortOrder:0}]:[]})}},children:{models:d.packages.flatMap(e=>e.models),links:e=>C(d,w,e)}})}var _e=new class{#e=t(void 0);get endpoint(){return e(this.#e)}set endpoint(e){r(this.#e,e,!0)}#t=t(!1);get tokenInConfig(){return e(this.#t)}set tokenInConfig(e){r(this.#t,e,!0)}#n=t(void 0);get token(){return e(this.#n)}set token(e){r(this.#n,e,!0)}#r=t(`idle`);get status(){return e(this.#r)}set status(e){r(this.#r,e,!0)}#i=t(void 0);get outcome(){return e(this.#i)}set outcome(e){r(this.#i,e,!0)}get config(){return this.endpoint&&this.token&&!this.tokenInConfig?{endpoint:this.endpoint,token:this.token}:void 0}get needsLink(){return!!this.endpoint&&!this.token&&!this.tokenInConfig}configure(e,t){this.endpoint=e?.endpoint,this.tokenInConfig=e?.tokenInConfig===!0,this.token=e?t:void 0,this.status=`idle`,this.outcome=void 0}async send(e,t){let n=this.config;if(!n||this.status===`sending`)return;this.status=`sending`,this.outcome=void 0;let r=await ae(n,e,t);this.outcome=r,this.status=r.ok?`sent`:`failed`}},Z=`cookbook`,ve=new class{#e=t(null);get open(){return e(this.#e)}set open(e){r(this.#e,e,!0)}#t=t(null);get returnTo(){return e(this.#t)}set returnTo(e){r(this.#t,e,!0)}navigator=null;show(e){this.returnTo=e,this.navigator?this.navigator.open(e):this.set(e)}back(){this.open&&(this.returnTo=this.open),this.navigator?this.navigator.close():this.set(null)}async set(e,t=!0){this.open!==e&&(t?await ie(async()=>{this.open=e,await n()}):this.open=e)}};function ye(e,t){let n=new URLSearchParams(e).get(Z);return n&&t.includes(n)?n:null}function be(e,t){let n=new URLSearchParams(e);t?n.set(Z,t):n.delete(Z);let r=n.toString().replace(/%2C/gi,`,`);return r?`?${r}`:``}var xe=`Planner`;function Q(e,t,n=N,r=xe){let i=e.name?.trim();if(i)return i;let a=t?n.find(e=>e.id===t):void 0;return a&&W(a,e)?a.name:r}function Se(e){return Q(g.snapshot(),A.active,void 0,e)}var Ce=Symbol(`planner-project-persistence-owner`),$=t(0),we={get remembering(){return e($),l()},get recoveryAvailable(){return e($),o().recoveryAvailable()},setRemember(e){let t=te(e);return i($),t},recover(){let e=o().recover();return i($),e},discardRecovery(){let e=o().discardRecovery();return i($),e}};function Te(e){if(!s())return!1;try{e.nativeAssistant?.reset(),g.reset({preserveTheme:!0}),A.active=null,A.appliedWork=null,ne(),a(null),e.dataSource.reset?.(),e.controller.resetWorkspace?.()}finally{i($),e.onreset?.()}return!0}export{H as _,ye as a,_e as c,ue as d,le as f,W as g,U as h,Se as i,ge as l,K as m,Te as n,ve as o,G as p,we as r,be as s,Ce as t,de as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./
|
|
2
|
-
import{t as e}from"./BaNbYf_w.js";import{a as t,i as n,n as r,o as i,r as a,s as o}from"./eBF8D7GD.js";var s={"audio/webm":`webm`,"video/webm":`webm`,"audio/mp4":`m4a`,"audio/m4a":`m4a`,"audio/x-m4a":`m4a`,"video/mp4":`mp4`,"audio/wav":`wav`,"audio/wave":`wav`,"audio/x-wav":`wav`,"audio/vnd.wave":`wav`,"audio/ogg":`ogg`,"application/ogg":`ogg`,"audio/mpeg":`mp3`,"audio/mp3":`mp3`,"audio/mpga":`mp3`,"audio/flac":`flac`,"audio/x-flac":`flac`};function c(e){return e?.split(`;`)[0]?.trim().toLowerCase()||void 0}function l(e){let t=c(e);return t?s[t]:void 0}async function u(e,n={}){let r=d(e)?e:{data:e},{adapter:i,signal:o}=n;o?.throwIfAborted();let s=ee(n.maxBytes,i),c=r.data,u=typeof Blob<`u`&&c instanceof Blob?c.type:void 0,m=n.mimeType??r.mimeType??r.contentType??(u||void 0)??`application/octet-stream`,h;if(typeof Blob<`u`&&c instanceof Blob)p(c.size,s,i),h=c.type===m?c:new Blob([c],{type:m});else if(c instanceof Uint8Array)p(c.byteLength,s,i),h=new Blob([g(c)],{type:m});else if(c instanceof ArrayBuffer)p(c.byteLength,s,i),h=new Blob([c],{type:m});else if(f(c)){let e=await te(c,s,i,o);h=new Blob(e,{type:m})}else throw new a(`Unsupported audio input: expected Blob, Buffer, Uint8Array, ArrayBuffer, or ReadableStream`,i);if(h.size===0)throw new t(`Audio input is empty`,i);let _=n.deriveExtension===!1?void 0:l(m),v=n.defaultBasename??`audio`,y=r.filename??(_?`${v}.${_}`:v);return{blob:h,mimeType:m,bytes:h.size,filename:y,durationSeconds:r.durationSeconds}}function d(e){return typeof e==`object`&&!!e&&`data`in e&&!(typeof Blob<`u`&&e instanceof Blob)&&!(e instanceof Uint8Array)&&!(e instanceof ArrayBuffer)&&!f(e)}function f(e){return typeof e==`object`&&!!e&&typeof e.getReader==`function`}function ee(e,t){if(e===void 0)return 1/0;if(Number.isNaN(e)||e<=0)throw new a(`maxBytes must be a positive number`,t);return e}function p(e,t,n){if(e>t)throw new r(`Audio input exceeds maxBytes (${e} > ${t} bytes)`,t,n)}async function te(e,t,n,i){let a=e.getReader(),o=[],s=0,c=()=>{a.cancel(i?.reason).catch(()=>void 0)};i?.addEventListener(`abort`,c,{once:!0});try{for(;;){let{done:e,value:c}=await a.read();if(i?.throwIfAborted(),e)break;if(s+=m(c,n),s>t)throw await a.cancel().catch(()=>void 0),new r(`Audio stream exceeds maxBytes (more than ${t} bytes)`,t,n);o.push(h(c))}}finally{i?.removeEventListener(`abort`,c),a.releaseLock()}return o}function m(e,t){if(e instanceof Uint8Array||e instanceof ArrayBuffer)return e.byteLength;throw new a(`Audio stream chunks must be Uint8Array or ArrayBuffer`,t)}function h(e){return e instanceof Uint8Array?g(e):new Uint8Array(e.slice(0))}function g(e){let t=new Uint8Array(e.byteLength);return t.set(e),t}async function _(e,...t){for(let n of t)n&&await n(e)}var v={type:[`HAVE_SPEECH_TRANSCRIBER_TYPE`,`HAVE_SPEECH_STT_TYPE`,`HAVE_SPEECH_STT_ADAPTER`,`STT_ADAPTER`],baseUrl:[`HAVE_SPEECH_TRANSCRIBER_BASE_URL`,`HAVE_SPEECH_STT_BASE_URL`,`STT_BASE_URL`],model:[`HAVE_SPEECH_TRANSCRIBER_MODEL`,`HAVE_SPEECH_STT_MODEL`,`STT_MODEL`],apiKey:[`HAVE_SPEECH_TRANSCRIBER_API_KEY`,`HAVE_SPEECH_STT_API_KEY`,`STT_API_KEY`,`SPEECH_API_KEY`],timeoutMs:[`HAVE_SPEECH_TRANSCRIBER_TIMEOUT`,`HAVE_SPEECH_TRANSCRIBER_TIMEOUT_MS`,`HAVE_SPEECH_STT_TIMEOUT_MS`,`STT_TIMEOUT_MS`],maxBytes:[`HAVE_SPEECH_TRANSCRIBER_MAX_BYTES`,`STT_MAX_BYTES`],headers:[`HAVE_SPEECH_TRANSCRIBER_HEADERS`,`STT_HEADERS`],path:[`HAVE_SPEECH_TRANSCRIBER_PATH`,`HAVE_SPEECH_STT_PATH`,`STT_PATH`]};function y(e){return{type:x(e,...v.type),baseUrl:x(e,...v.baseUrl),model:x(e,...v.model),apiKey:x(e,...v.apiKey),timeoutMs:S(x(e,...v.timeoutMs)),maxBytes:S(x(e,...v.maxBytes)),headers:re(e,v.headers),path:x(e,...v.path)}}function ne(e={},t={}){let n=y(t.env??C()),r=b(n.headers,t.headers,e.headers);return{type:e.type??n.type,baseUrl:(e.baseUrl??n.baseUrl)?.trim(),model:e.model??n.model,apiKey:e.apiKey??n.apiKey,timeoutMs:e.timeoutMs??n.timeoutMs,maxBytes:e.maxBytes??n.maxBytes,headers:r,fetch:e.fetch??t.fetch,path:n.path}}function b(...e){let t=e.filter(e=>!!e);if(t.length===0)return;let n=new Headers;for(let e of t)new Headers(e).forEach((e,t)=>{n.set(t,e)});return n}function x(e,...t){for(let n of t){let t=e[n];if(t?.trim())return t.trim()}}function S(e){if(!e)return;let t=Number.parseInt(e,10);return Number.isFinite(t)?t:void 0}function C(){return{}}function re(e,t){for(let n of t){let t=e[n]?.trim();if(!t)continue;let r;try{r=JSON.parse(t)}catch{throw new a(`${n} must be a JSON object of header names to string values`)}if(!r||typeof r!=`object`||Array.isArray(r)||!Object.values(r).every(e=>typeof e==`string`))throw new a(`${n} must be a JSON object of header names to string values`);return r}}var ie=new Map;function ae(e,t){ie.set(e,t)}var w={device:[`HAVE_SPEECH_TRANSCRIBER_DEVICE`],dtype:[`HAVE_SPEECH_TRANSCRIBER_DTYPE`],cacheDir:[`HAVE_SPEECH_TRANSCRIBER_CACHE_DIR`],modelHost:[`HAVE_SPEECH_TRANSCRIBER_MODEL_HOST`]};function T(e={},t={}){let n=t.env??C(),r=ne({model:e.model,maxBytes:e.maxBytes},{env:n});return{...e,type:`local`,model:r.model,maxBytes:r.maxBytes,device:e.device??x(n,...w.device),dtype:e.dtype??x(n,...w.dtype),cacheDir:e.cacheDir??x(n,...w.cacheDir),modelHost:e.modelHost??x(n,...w.modelHost)}}var E=`@huggingface/transformers`,D=`Local transcription needs the optional peer dependency ${E}. Install it with \`pnpm add ${E}\` (or npm/yarn equivalent).`;async function O(e){let t;try{t=typeof e==`function`?await e():e??await oe()}catch(e){if(e instanceof a)throw e;let t=new a(`${D} (${le(e)})`,`local`);throw t.cause=e,t}let n=t,r=typeof n?.pipeline==`function`?n:n?.default;if(typeof r?.pipeline!=`function`)throw new a(`${E} did not export pipeline(); expected v4 or later`,`local`);return r}function oe(){return e(()=>import(`./CMgP05SN.js`),__vite__mapDeps([0,1,2]),import.meta.url)}async function se(e,t){let n=t.device===`auto`?await k():t.device,r=n=>e.pipeline(`automatic-speech-recognition`,t.model,{device:n,...t.dtype?{dtype:t.dtype}:{},...t.revision?{revision:t.revision}:{},...t.cacheDir?{cache_dir:t.cacheDir}:{},...t.onProgress?{progress_callback:t.onProgress}:{}});try{return{pipeline:await r(n),device:n}}catch(e){if(t.device===`auto`&&n===`webgpu`)return{pipeline:await r(`wasm`),device:`wasm`};throw e}}async function k(){if(ce())return`cpu`;let e=globalThis.navigator?.gpu;if(e)try{if(await e.requestAdapter())return`webgpu`}catch{}return`wasm`}function ce(){return!!globalThis.process?.versions?.node}function le(e){return e instanceof Error?e.message:String(e)}function A(e,t){return t?t.aborted?(e.catch(()=>void 0),Promise.reject(t.reason)):new Promise((n,r)=>{let i=()=>r(t.reason);t.addEventListener(`abort`,i,{once:!0}),e.then(e=>{t.removeEventListener(`abort`,i),n(e)},e=>{t.removeEventListener(`abort`,i),r(e)})}):e}var j=16e3,M=`local`,N=new Set([`audio/wav`,`audio/wave`,`audio/x-wav`,`audio/vnd.wave`]),P=new Set([`audio/pcm`,`audio/x-pcm`,`audio/raw`]);async function F(e,t){return I(await A(R(e,t),t.signal))}function I(e){return ge(he(e.samples),e.sampleRate,j)}function ue(e,t){let n=c(t);return!!(n&&(N.has(n)||P.has(n))||z(e))}async function L(e,t){if(t.decodeAudio){let n=await t.decodeAudio({bytes:e,mimeType:t.mimeType,signal:t.signal});return ye(n),n}if(ve())return G(e)}async function R(e,n){let r=c(n.mimeType);if(r&&N.has(r)||z(e))return B(e);if(r&&P.has(r))return fe(e,n);let i=await L(e,n);if(i)return i;throw new t(`Cannot decode '${n.mimeType}' audio on this runtime: pass WAV or audio/pcm, or supply a decodeAudio hook (e.g. ffmpeg) for compressed formats`,M)}function z(e){return e.byteLength>=12&&J(e,0,4)===`RIFF`&&J(e,8,4)===`WAVE`}function B(e){if(!z(e))throw new t(`Invalid WAV data: missing RIFF/WAVE header`,M);let n=new DataView(e.buffer,e.byteOffset,e.byteLength),r,i=12;for(;i+8<=e.byteLength;){let a=J(e,i,4),o=n.getUint32(i+4,!0),s=i+8;if(a===`fmt `)r=de(n,s,o);else if(a===`data`){if(!r)throw new t(`Invalid WAV data: data chunk before fmt chunk`,M);let n=e.byteLength-s,i=o===0||o>n?n:o;return{samples:W(e.subarray(s,s+i),r.channels,r.encoding),sampleRate:r.sampleRate}}i=s+o+o%2}throw new t(`Invalid WAV data: no data chunk`,M)}var V=1,H=3,U=65534;function de(e,n,r){if(r<16)throw new t(`Invalid WAV data: fmt chunk too short`,M);let i=e.getUint16(n,!0),a=e.getUint16(n+2,!0),o=e.getUint32(n+4,!0),s=e.getUint16(n+14,!0);i===U&&r>=26&&(i=e.getUint16(n+24,!0));let c=i===V?{8:`u8`,16:`s16le`,24:`s24le`,32:`s32le`}[s]:i===H?{32:`f32le`,64:`f64le`}[s]:void 0;if(!c||a<1||o<1)throw new t(`Unsupported WAV encoding (format ${i}, ${s}-bit, ${a} channels); use PCM or IEEE float, or supply a decodeAudio hook`,M);return{channels:a,sampleRate:o,encoding:c}}function fe(e,n){let r=be(n.mimeType),i=K(r.rate)??q(n.sampleRate,`sampleRate`),a=K(r.channels)??q(n.channels,`channels`)??1,o=(r.encoding??`s16le`).toLowerCase();if(!i)throw new t(`Raw PCM audio needs a sample rate: use 'audio/pcm;rate=16000' or AudioInput.sampleRate`,M);if(o!==`s16le`&&o!==`f32le`)throw new t(`Unsupported raw PCM encoding '${o}' (expected s16le or f32le)`,M);return{samples:W(e,a,o),sampleRate:i}}var pe={u8:1,s16le:2,s24le:3,s32le:4,f32le:4,f64le:8};function W(e,t,n){let r=pe[n],i=Math.floor(e.byteLength/(r*t)),a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=Array.from({length:t},()=>new Float32Array(i));for(let e=0;e<i;e++)for(let i=0;i<t;i++){let s=(e*t+i)*r;o[i][e]=me(a,s,n)}return o}function me(e,t,n){switch(n){case`u8`:return(e.getUint8(t)-128)/128;case`s16le`:return e.getInt16(t,!0)/32768;case`s24le`:return(e.getUint8(t)|e.getUint8(t+1)<<8|e.getInt8(t+2)<<16)/8388608;case`s32le`:return e.getInt32(t,!0)/2147483648;case`f32le`:return e.getFloat32(t,!0);case`f64le`:return e.getFloat64(t,!0)}}function he(e){if(e instanceof Float32Array)return e;if(e.length===1)return e[0];let t=Math.min(...e.map(e=>e.length)),n=new Float32Array(t);for(let r of e)for(let i=0;i<t;i++)n[i]=n[i]+r[i]/e.length;return n}function ge(e,t,n){if(t===n||e.length===0)return e;let r=t/n,i=r>1?_e(e,Math.round(r)):e,a=Math.max(1,Math.round(e.length/r)),o=new Float32Array(a);for(let e=0;e<a;e++){let t=e*r,n=Math.floor(t),a=Math.min(n+1,i.length-1),s=t-n;o[e]=i[n]*(1-s)+i[a]*s}return o}function _e(e,t){if(t<=1)return e;let n=new Float32Array(e.length),r=Math.floor(t/2),i=0,a=0,o=0,s=0;for(let c=0;c<e.length;c++){let l=Math.max(0,c-r),u=Math.min(e.length,c-r+t);for(;s<u;)i+=e[s],a++,s++;for(;o<l;)i-=e[o],a--,o++;n[c]=i/a}return n}function ve(){return typeof globalThis.OfflineAudioContext==`function`}async function G(e){let n=new OfflineAudioContext(1,1,j),r=new Uint8Array(e.byteLength);r.set(e);let i;try{i=await n.decodeAudioData(r.buffer)}catch(e){throw new t(`The browser could not decode the audio: ${xe(e)}`,M)}return{samples:Array.from({length:i.numberOfChannels},(e,t)=>i.getChannelData(t)),sampleRate:i.sampleRate}}function ye(e){let t=e?.samples instanceof Float32Array?[e.samples]:e?.samples;if(!Array.isArray(t)||t.length===0||!t.every(e=>e instanceof Float32Array)||!(e.sampleRate>0))throw new a(`decodeAudio must return { samples: Float32Array | Float32Array[], sampleRate }`,M)}function be(e){let t={};for(let n of e.split(`;`).slice(1)){let[e,r]=n.split(`=`);e&&r&&(t[e.trim().toLowerCase()]=r.trim().replace(/^"|"$/g,``))}return t}function K(e){let t=e?Number.parseInt(e,10):NaN;return Number.isFinite(t)&&t>0?t:void 0}function q(e,n){if(e!=null){if(!Number.isInteger(e)||e<1)throw new t(`AudioInput.${n} must be a positive integer, got ${String(e)}`,M);return e}}function J(e,t,n){return String.fromCharCode(...e.subarray(t,t+n))}function xe(e){return e instanceof Error?e.message:String(e)}var Se=`onnx-community/whisper-base`,Ce=30,we=30,Te=new Set([`whisper`,`lite-whisper`]),Y=class{type=`local`;options;model;maxBytes;onUsage;runtime;pipelines=new Map;queue=Promise.resolve();constructor(e={}){this.options=e,this.model=e.model?.trim()||`onnx-community/whisper-base`,this.maxBytes=e.maxBytes??26214400,this.onUsage=e.onUsage}async preload(e,t){await A(this.loadPipeline(e?.trim()||this.model),t)}async isCached(e){try{let t=await this.loadRuntime();if(!t.ModelRegistry)return!1;let{dtype:n,revision:r,cacheDir:i}=this.options,a=this.options.device??`auto`,o=a===`auto`?await k():a;return await t.ModelRegistry.is_pipeline_cached(`automatic-speech-recognition`,e?.trim()||this.model,{device:o,...n?{dtype:n}:{},...r?{revision:r}:{},...i?{cache_dir:i}:{}})}catch{return!1}}async transcribe(e){let{signal:t}=e,n=await u(e.audio,{mimeType:e.mimeType,maxBytes:e.maxBytes??this.maxBytes,adapter:this.type,signal:t}),r=Oe(e.audio),i=await F(new Uint8Array(await n.blob.arrayBuffer()),{mimeType:n.mimeType,sampleRate:r.sampleRate,channels:r.channels,decodeAudio:this.options.decodeAudio,signal:t});t?.throwIfAborted();let a=e.model?.trim()||this.model,o=await A(this.loadPipeline(a),t),s=i.length/j,c=await A(this.enqueue(()=>this.run(o.pipeline,i,s,e,a)),t),l={operation:`transcription`,provider:this.type,model:a,audioSeconds:s,bytes:n.bytes},d={...Ee(c,e.timestampGranularities?.includes(`word`)??!1),language:e.language,durationSeconds:s,provider:this.type,model:a,raw:c,usage:l};return await _(l,this.onUsage,e.onUsage),d}async dispose(){await this.queue;let e=[...this.pipelines.values()];this.pipelines.clear(),await Promise.all(e.map(async e=>{let{pipeline:t}=await e.catch(()=>({pipeline:void 0}));await t?.dispose?.()}))}async run(e,t,n,r,a){let{signal:o}=r;o?.throwIfAborted();let s=await this.loadRuntime(),c={};if(Te.has(e.model?.config?.model_type??`whisper`)){let t=r.timestampGranularities??[];t.includes(`word`)?c.return_timestamps=`word`:t.includes(`segment`)&&(c.return_timestamps=!0);let i=this.options.chunkLengthSeconds??Ce;i>0&&n>we&&(c.chunk_length_s=i),r.language&&!De(e,a)&&(c.language=r.language,c.task=`transcribe`)}let l;o&&s.InterruptableStoppingCriteria&&(l=new s.InterruptableStoppingCriteria,c.stopping_criteria=l);let u=()=>l?.interrupt();o?.addEventListener(`abort`,u,{once:!0});try{let n=await e(t,c);return Array.isArray(n)?n[0]??{text:``}:n}catch(e){if(o?.aborted)throw o.reason;let t=c.return_timestamps===`word`&&/cross attentions/i.test(X(e))?` (word timestamps need a model exported with cross attentions, e.g. onnx-community/whisper-base_timestamped)`:``;throw new i(this.type,`Local transcription failed: ${X(e)}${t}`,{cause:e})}finally{o?.removeEventListener(`abort`,u)}}enqueue(e){let t=this.queue.then(e,e);return this.queue=t.catch(()=>void 0),t}loadRuntime(){if(!this.runtime){let{transformers:e,configureEnv:t,modelHost:n}=this.options;this.runtime=O(e).then(e=>(e.env&&(n&&(e.env.remoteHost=n),t?.(e.env)),e)),this.runtime.catch(()=>{this.runtime=void 0})}return this.runtime}loadPipeline(e){let t=this.pipelines.get(e);return t||(t=this.loadRuntime().then(t=>se(t,{model:e,device:this.options.device??`auto`,dtype:this.options.dtype,revision:this.options.revision,cacheDir:this.options.cacheDir,onProgress:this.options.onProgress}).catch(t=>{throw t instanceof a?t:new i(this.type,`Failed to load local model '${e}': ${X(t)}`,{cause:t})})),this.pipelines.set(e,t),t.catch(()=>{this.pipelines.get(e)===t&&this.pipelines.delete(e)})),t}};function Ee(e,t){let n={text:(e.text??``).trim()},r=e.chunks;return r?.length&&(t?n.words=r.filter(e=>e.text.trim()).map(e=>({word:e.text.trim(),startSeconds:e.timestamp[0],endSeconds:e.timestamp[1]??e.timestamp[0]})):n.segments=r.map(e=>({text:e.text.trim(),startSeconds:e.timestamp[0],endSeconds:e.timestamp[1]??void 0}))),n}function De(e,t){let n=e.model?.generation_config?.is_multilingual;return typeof n==`boolean`?!n:/\.en(?:$|[-_])/i.test(t)}function Oe(e){return e&&typeof e==`object`&&`data`in e&&!(e instanceof Uint8Array)?{sampleRate:e.sampleRate,channels:e.channels}:{}}function X(e){return e instanceof Error?e.message:String(e)}var ke=`audio/pcm;rate=${j};encoding=f32le`;function Ae(e={},t=globalThis){let n=e.onProgress,r=new Y({...T(e),maxBytes:1/0,onProgress:e=>{n?.(e),t.postMessage({kind:`progress`,progress:Le(e)})}}),i=new Map,a=e=>t.postMessage(e),o=e=>{let t=e.data;if(!t||typeof t!=`object`)return;if(t.kind===`abort`){i.get(t.id)?.abort();return}let n=new AbortController;i.set(t.id,n),(t.kind===`isCached`?r.isCached(t.model).then(e=>{a({kind:`result`,id:t.id,cached:e})}):t.kind===`preload`?r.preload(t.model,n.signal).then(()=>{a({kind:`result`,id:t.id})}):Promise.resolve().then(()=>r.transcribe({audio:Me(t.audio),model:t.model,language:t.language,timestampGranularities:t.timestampGranularities,signal:n.signal})).then(e=>{a({kind:`result`,id:t.id,result:e})})).catch(e=>{a({kind:`error`,id:t.id,error:Fe(e)})}).finally(()=>i.delete(t.id))};return t.addEventListener(`message`,o),async()=>{t.removeEventListener(`message`,o);for(let e of i.values())e.abort();await r.dispose()}}var je=class{type=`local`;endpoint;options;calls=new Map;nextId=1;closed=!1;closing=new AbortController;listener=e=>this.onMessage(e.data);constructor(e,t={}){this.endpoint=e,this.options=t,e.addEventListener(`message`,this.listener)}async isCached(e){try{let{cached:t}=await this.call({kind:`isCached`,model:e},void 0);return t===!0}catch{return!1}}async preload(e,t){await this.call({kind:`preload`,model:e},t)}async transcribe(e){this.assertOpen();let{signal:t}=e,{audio:n,bytes:r}=await A(this.prepare(e),this.closing.signal),{result:a}=await this.call({kind:`transcribe`,audio:n,model:e.model,language:e.language,timestampGranularities:e.timestampGranularities},t,Pe(n));if(!a)throw new i(this.type,`Worker returned no result`);let o={...a.usage??{operation:`transcription`,provider:this.type},bytes:r};return await _(o,this.options.onUsage,e.onUsage),{...a,usage:o}}close(){if(!this.closed){this.closed=!0,this.endpoint.removeEventListener(`message`,this.listener),this.closing.abort(Z());for(let[e,t]of this.calls)this.endpoint.postMessage({kind:`abort`,id:e}),t.reject(Z());this.calls.clear()}}async prepare(e){let{signal:t}=e,n=await u(e.audio,{mimeType:e.mimeType,maxBytes:e.maxBytes??this.options.maxBytes??26214400,adapter:this.type,signal:t}),r=new Uint8Array(await n.blob.arrayBuffer());if(!ue(r,n.mimeType)){let e=await A(L(r,{mimeType:n.mimeType,decodeAudio:this.options.decodeAudio,signal:t}),t);if(e)return{audio:{kind:`decoded`,samples:(e.samples instanceof Float32Array?[e.samples]:e.samples).map(Q),sampleRate:e.sampleRate},bytes:n.bytes}}let i=typeof e.audio==`object`&&`data`in e.audio&&!(e.audio instanceof Uint8Array)?e.audio:void 0;return{audio:{kind:`encoded`,bytes:Q(r),mimeType:n.mimeType,sampleRate:i?.sampleRate,channels:i?.channels},bytes:n.bytes}}assertOpen(){if(this.closed)throw Z()}call(e,t,n=[]){this.assertOpen(),t?.throwIfAborted();let r=this.nextId++;return new Promise((i,a)=>{let o=()=>{this.calls.delete(r),this.endpoint.postMessage({kind:`abort`,id:r}),a(t?.reason)},s=()=>t?.removeEventListener(`abort`,o);this.calls.set(r,{resolve:e=>{s(),i(e)},reject:e=>{s(),a(e)}}),t?.addEventListener(`abort`,o,{once:!0}),this.endpoint.postMessage({...e,id:r},n)})}onMessage(e){if(!e||typeof e!=`object`)return;if(e.kind===`progress`){this.options.onProgress?.(e.progress);return}let t=this.calls.get(e.id);t&&(this.calls.delete(e.id),e.kind===`result`?t.resolve({result:e.result,cached:e.cached}):t.reject(Ie(e.error)))}};function Z(){return new a(`Worker client closed`,`local`)}function Me(e){if(e.kind===`decoded`){let t=I({samples:e.samples,sampleRate:e.sampleRate});return{data:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),mimeType:ke}}return{data:e.bytes,mimeType:e.mimeType,sampleRate:e.sampleRate,channels:e.channels}}function Q(e){let{buffer:t}=e;return Ne(t)&&e.byteOffset===0&&e.byteLength===t.byteLength?e:e.slice()}function Ne(e){return Object.prototype.toString.call(e)===`[object ArrayBuffer]`}function Pe(e){let t=e.kind===`decoded`?e.samples:[e.bytes];return[...new Set(t.map(e=>e.buffer))]}function Fe(e){return e instanceof r?{name:e.name,message:e.message,code:e.code,maxBytes:e.maxBytes}:e instanceof n?{name:e.name,message:e.message,code:e.code}:e instanceof Error?{name:e.name,message:e.message}:{name:`Error`,message:String(e)}}function Ie(e){switch(e.name){case`SpeechConfigurationError`:return new a(e.message,`local`);case`SpeechInvalidAudioError`:return new t(e.message,`local`);case`SpeechAudioTooLargeError`:return new r(e.message,e.maxBytes??NaN,`local`);case`SpeechProviderError`:return new i(`local`,e.message);case`SpeechProviderUnavailableError`:return new o(`local`,e.message);case`AbortError`:return new DOMException(e.message,`AbortError`);default:{let t=Error(e.message);return t.name=e.name,t}}}function Le(e){let t={status:e.status};for(let[n,r]of Object.entries(e))(r===null||[`string`,`number`,`boolean`].includes(typeof r))&&(t[n]=r);return t}function $(e={},t={}){return new Y(T(e,t))}async function Re(){try{return await O(void 0),!0}catch{return!1}}ae(`local`,(e,t)=>$({...e,type:`local`},t));export{Se as DEFAULT_LOCAL_MODEL,j as LOCAL_SAMPLE_RATE,w as LOCAL_TRANSCRIBER_ENV_KEYS,Y as LocalTranscriber,je as LocalTranscriberWorkerClient,D as TRANSFORMERS_INSTALL_HINT,E as TRANSFORMERS_PACKAGE,$ as createLocalTranscriber,F as decodeToPcm16k,Re as isLocalTranscriberAvailable,Ae as serveLocalTranscriber};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CkZrdLlG.js","./COiEfhsA.js","./BaNbYf_w.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./BaNbYf_w.js";import{a as t,i as n,n as r,o as i,r as a,s as o}from"./eBF8D7GD.js";var s={"audio/webm":`webm`,"video/webm":`webm`,"audio/mp4":`m4a`,"audio/m4a":`m4a`,"audio/x-m4a":`m4a`,"video/mp4":`mp4`,"audio/wav":`wav`,"audio/wave":`wav`,"audio/x-wav":`wav`,"audio/vnd.wave":`wav`,"audio/ogg":`ogg`,"application/ogg":`ogg`,"audio/mpeg":`mp3`,"audio/mp3":`mp3`,"audio/mpga":`mp3`,"audio/flac":`flac`,"audio/x-flac":`flac`};function c(e){return e?.split(`;`)[0]?.trim().toLowerCase()||void 0}function l(e){let t=c(e);return t?s[t]:void 0}async function u(e,n={}){let r=d(e)?e:{data:e},{adapter:i,signal:o}=n;o?.throwIfAborted();let s=ee(n.maxBytes,i),c=r.data,u=typeof Blob<`u`&&c instanceof Blob?c.type:void 0,m=n.mimeType??r.mimeType??r.contentType??(u||void 0)??`application/octet-stream`,h;if(typeof Blob<`u`&&c instanceof Blob)p(c.size,s,i),h=c.type===m?c:new Blob([c],{type:m});else if(c instanceof Uint8Array)p(c.byteLength,s,i),h=new Blob([g(c)],{type:m});else if(c instanceof ArrayBuffer)p(c.byteLength,s,i),h=new Blob([c],{type:m});else if(f(c)){let e=await te(c,s,i,o);h=new Blob(e,{type:m})}else throw new a(`Unsupported audio input: expected Blob, Buffer, Uint8Array, ArrayBuffer, or ReadableStream`,i);if(h.size===0)throw new t(`Audio input is empty`,i);let _=n.deriveExtension===!1?void 0:l(m),v=n.defaultBasename??`audio`,y=r.filename??(_?`${v}.${_}`:v);return{blob:h,mimeType:m,bytes:h.size,filename:y,durationSeconds:r.durationSeconds}}function d(e){return typeof e==`object`&&!!e&&`data`in e&&!(typeof Blob<`u`&&e instanceof Blob)&&!(e instanceof Uint8Array)&&!(e instanceof ArrayBuffer)&&!f(e)}function f(e){return typeof e==`object`&&!!e&&typeof e.getReader==`function`}function ee(e,t){if(e===void 0)return 1/0;if(Number.isNaN(e)||e<=0)throw new a(`maxBytes must be a positive number`,t);return e}function p(e,t,n){if(e>t)throw new r(`Audio input exceeds maxBytes (${e} > ${t} bytes)`,t,n)}async function te(e,t,n,i){let a=e.getReader(),o=[],s=0,c=()=>{a.cancel(i?.reason).catch(()=>void 0)};i?.addEventListener(`abort`,c,{once:!0});try{for(;;){let{done:e,value:c}=await a.read();if(i?.throwIfAborted(),e)break;if(s+=m(c,n),s>t)throw await a.cancel().catch(()=>void 0),new r(`Audio stream exceeds maxBytes (more than ${t} bytes)`,t,n);o.push(h(c))}}finally{i?.removeEventListener(`abort`,c),a.releaseLock()}return o}function m(e,t){if(e instanceof Uint8Array||e instanceof ArrayBuffer)return e.byteLength;throw new a(`Audio stream chunks must be Uint8Array or ArrayBuffer`,t)}function h(e){return e instanceof Uint8Array?g(e):new Uint8Array(e.slice(0))}function g(e){let t=new Uint8Array(e.byteLength);return t.set(e),t}async function _(e,...t){for(let n of t)n&&await n(e)}var v={type:[`HAVE_SPEECH_TRANSCRIBER_TYPE`,`HAVE_SPEECH_STT_TYPE`,`HAVE_SPEECH_STT_ADAPTER`,`STT_ADAPTER`],baseUrl:[`HAVE_SPEECH_TRANSCRIBER_BASE_URL`,`HAVE_SPEECH_STT_BASE_URL`,`STT_BASE_URL`],model:[`HAVE_SPEECH_TRANSCRIBER_MODEL`,`HAVE_SPEECH_STT_MODEL`,`STT_MODEL`],apiKey:[`HAVE_SPEECH_TRANSCRIBER_API_KEY`,`HAVE_SPEECH_STT_API_KEY`,`STT_API_KEY`,`SPEECH_API_KEY`],timeoutMs:[`HAVE_SPEECH_TRANSCRIBER_TIMEOUT`,`HAVE_SPEECH_TRANSCRIBER_TIMEOUT_MS`,`HAVE_SPEECH_STT_TIMEOUT_MS`,`STT_TIMEOUT_MS`],maxBytes:[`HAVE_SPEECH_TRANSCRIBER_MAX_BYTES`,`STT_MAX_BYTES`],headers:[`HAVE_SPEECH_TRANSCRIBER_HEADERS`,`STT_HEADERS`],path:[`HAVE_SPEECH_TRANSCRIBER_PATH`,`HAVE_SPEECH_STT_PATH`,`STT_PATH`]};function y(e){return{type:x(e,...v.type),baseUrl:x(e,...v.baseUrl),model:x(e,...v.model),apiKey:x(e,...v.apiKey),timeoutMs:S(x(e,...v.timeoutMs)),maxBytes:S(x(e,...v.maxBytes)),headers:re(e,v.headers),path:x(e,...v.path)}}function ne(e={},t={}){let n=y(t.env??C()),r=b(n.headers,t.headers,e.headers);return{type:e.type??n.type,baseUrl:(e.baseUrl??n.baseUrl)?.trim(),model:e.model??n.model,apiKey:e.apiKey??n.apiKey,timeoutMs:e.timeoutMs??n.timeoutMs,maxBytes:e.maxBytes??n.maxBytes,headers:r,fetch:e.fetch??t.fetch,path:n.path}}function b(...e){let t=e.filter(e=>!!e);if(t.length===0)return;let n=new Headers;for(let e of t)new Headers(e).forEach((e,t)=>{n.set(t,e)});return n}function x(e,...t){for(let n of t){let t=e[n];if(t?.trim())return t.trim()}}function S(e){if(!e)return;let t=Number.parseInt(e,10);return Number.isFinite(t)?t:void 0}function C(){return{}}function re(e,t){for(let n of t){let t=e[n]?.trim();if(!t)continue;let r;try{r=JSON.parse(t)}catch{throw new a(`${n} must be a JSON object of header names to string values`)}if(!r||typeof r!=`object`||Array.isArray(r)||!Object.values(r).every(e=>typeof e==`string`))throw new a(`${n} must be a JSON object of header names to string values`);return r}}var ie=new Map;function ae(e,t){ie.set(e,t)}var w={device:[`HAVE_SPEECH_TRANSCRIBER_DEVICE`],dtype:[`HAVE_SPEECH_TRANSCRIBER_DTYPE`],cacheDir:[`HAVE_SPEECH_TRANSCRIBER_CACHE_DIR`],modelHost:[`HAVE_SPEECH_TRANSCRIBER_MODEL_HOST`]};function T(e={},t={}){let n=t.env??C(),r=ne({model:e.model,maxBytes:e.maxBytes},{env:n});return{...e,type:`local`,model:r.model,maxBytes:r.maxBytes,device:e.device??x(n,...w.device),dtype:e.dtype??x(n,...w.dtype),cacheDir:e.cacheDir??x(n,...w.cacheDir),modelHost:e.modelHost??x(n,...w.modelHost)}}var E=`@huggingface/transformers`,D=`Local transcription needs the optional peer dependency ${E}. Install it with \`pnpm add ${E}\` (or npm/yarn equivalent).`;async function O(e){let t;try{t=typeof e==`function`?await e():e??await oe()}catch(e){if(e instanceof a)throw e;let t=new a(`${D} (${le(e)})`,`local`);throw t.cause=e,t}let n=t,r=typeof n?.pipeline==`function`?n:n?.default;if(typeof r?.pipeline!=`function`)throw new a(`${E} did not export pipeline(); expected v4 or later`,`local`);return r}function oe(){return e(()=>import(`./CkZrdLlG.js`),__vite__mapDeps([0,1,2]),import.meta.url)}async function se(e,t){let n=t.device===`auto`?await k():t.device,r=n=>e.pipeline(`automatic-speech-recognition`,t.model,{device:n,...t.dtype?{dtype:t.dtype}:{},...t.revision?{revision:t.revision}:{},...t.cacheDir?{cache_dir:t.cacheDir}:{},...t.onProgress?{progress_callback:t.onProgress}:{}});try{return{pipeline:await r(n),device:n}}catch(e){if(t.device===`auto`&&n===`webgpu`)return{pipeline:await r(`wasm`),device:`wasm`};throw e}}async function k(){if(ce())return`cpu`;let e=globalThis.navigator?.gpu;if(e)try{if(await e.requestAdapter())return`webgpu`}catch{}return`wasm`}function ce(){return!!globalThis.process?.versions?.node}function le(e){return e instanceof Error?e.message:String(e)}function A(e,t){return t?t.aborted?(e.catch(()=>void 0),Promise.reject(t.reason)):new Promise((n,r)=>{let i=()=>r(t.reason);t.addEventListener(`abort`,i,{once:!0}),e.then(e=>{t.removeEventListener(`abort`,i),n(e)},e=>{t.removeEventListener(`abort`,i),r(e)})}):e}var j=16e3,M=`local`,N=new Set([`audio/wav`,`audio/wave`,`audio/x-wav`,`audio/vnd.wave`]),P=new Set([`audio/pcm`,`audio/x-pcm`,`audio/raw`]);async function F(e,t){return I(await A(R(e,t),t.signal))}function I(e){return ge(he(e.samples),e.sampleRate,j)}function ue(e,t){let n=c(t);return!!(n&&(N.has(n)||P.has(n))||z(e))}async function L(e,t){if(t.decodeAudio){let n=await t.decodeAudio({bytes:e,mimeType:t.mimeType,signal:t.signal});return ye(n),n}if(ve())return G(e)}async function R(e,n){let r=c(n.mimeType);if(r&&N.has(r)||z(e))return B(e);if(r&&P.has(r))return fe(e,n);let i=await L(e,n);if(i)return i;throw new t(`Cannot decode '${n.mimeType}' audio on this runtime: pass WAV or audio/pcm, or supply a decodeAudio hook (e.g. ffmpeg) for compressed formats`,M)}function z(e){return e.byteLength>=12&&J(e,0,4)===`RIFF`&&J(e,8,4)===`WAVE`}function B(e){if(!z(e))throw new t(`Invalid WAV data: missing RIFF/WAVE header`,M);let n=new DataView(e.buffer,e.byteOffset,e.byteLength),r,i=12;for(;i+8<=e.byteLength;){let a=J(e,i,4),o=n.getUint32(i+4,!0),s=i+8;if(a===`fmt `)r=de(n,s,o);else if(a===`data`){if(!r)throw new t(`Invalid WAV data: data chunk before fmt chunk`,M);let n=e.byteLength-s,i=o===0||o>n?n:o;return{samples:W(e.subarray(s,s+i),r.channels,r.encoding),sampleRate:r.sampleRate}}i=s+o+o%2}throw new t(`Invalid WAV data: no data chunk`,M)}var V=1,H=3,U=65534;function de(e,n,r){if(r<16)throw new t(`Invalid WAV data: fmt chunk too short`,M);let i=e.getUint16(n,!0),a=e.getUint16(n+2,!0),o=e.getUint32(n+4,!0),s=e.getUint16(n+14,!0);i===U&&r>=26&&(i=e.getUint16(n+24,!0));let c=i===V?{8:`u8`,16:`s16le`,24:`s24le`,32:`s32le`}[s]:i===H?{32:`f32le`,64:`f64le`}[s]:void 0;if(!c||a<1||o<1)throw new t(`Unsupported WAV encoding (format ${i}, ${s}-bit, ${a} channels); use PCM or IEEE float, or supply a decodeAudio hook`,M);return{channels:a,sampleRate:o,encoding:c}}function fe(e,n){let r=be(n.mimeType),i=K(r.rate)??q(n.sampleRate,`sampleRate`),a=K(r.channels)??q(n.channels,`channels`)??1,o=(r.encoding??`s16le`).toLowerCase();if(!i)throw new t(`Raw PCM audio needs a sample rate: use 'audio/pcm;rate=16000' or AudioInput.sampleRate`,M);if(o!==`s16le`&&o!==`f32le`)throw new t(`Unsupported raw PCM encoding '${o}' (expected s16le or f32le)`,M);return{samples:W(e,a,o),sampleRate:i}}var pe={u8:1,s16le:2,s24le:3,s32le:4,f32le:4,f64le:8};function W(e,t,n){let r=pe[n],i=Math.floor(e.byteLength/(r*t)),a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=Array.from({length:t},()=>new Float32Array(i));for(let e=0;e<i;e++)for(let i=0;i<t;i++){let s=(e*t+i)*r;o[i][e]=me(a,s,n)}return o}function me(e,t,n){switch(n){case`u8`:return(e.getUint8(t)-128)/128;case`s16le`:return e.getInt16(t,!0)/32768;case`s24le`:return(e.getUint8(t)|e.getUint8(t+1)<<8|e.getInt8(t+2)<<16)/8388608;case`s32le`:return e.getInt32(t,!0)/2147483648;case`f32le`:return e.getFloat32(t,!0);case`f64le`:return e.getFloat64(t,!0)}}function he(e){if(e instanceof Float32Array)return e;if(e.length===1)return e[0];let t=Math.min(...e.map(e=>e.length)),n=new Float32Array(t);for(let r of e)for(let i=0;i<t;i++)n[i]=n[i]+r[i]/e.length;return n}function ge(e,t,n){if(t===n||e.length===0)return e;let r=t/n,i=r>1?_e(e,Math.round(r)):e,a=Math.max(1,Math.round(e.length/r)),o=new Float32Array(a);for(let e=0;e<a;e++){let t=e*r,n=Math.floor(t),a=Math.min(n+1,i.length-1),s=t-n;o[e]=i[n]*(1-s)+i[a]*s}return o}function _e(e,t){if(t<=1)return e;let n=new Float32Array(e.length),r=Math.floor(t/2),i=0,a=0,o=0,s=0;for(let c=0;c<e.length;c++){let l=Math.max(0,c-r),u=Math.min(e.length,c-r+t);for(;s<u;)i+=e[s],a++,s++;for(;o<l;)i-=e[o],a--,o++;n[c]=i/a}return n}function ve(){return typeof globalThis.OfflineAudioContext==`function`}async function G(e){let n=new OfflineAudioContext(1,1,j),r=new Uint8Array(e.byteLength);r.set(e);let i;try{i=await n.decodeAudioData(r.buffer)}catch(e){throw new t(`The browser could not decode the audio: ${xe(e)}`,M)}return{samples:Array.from({length:i.numberOfChannels},(e,t)=>i.getChannelData(t)),sampleRate:i.sampleRate}}function ye(e){let t=e?.samples instanceof Float32Array?[e.samples]:e?.samples;if(!Array.isArray(t)||t.length===0||!t.every(e=>e instanceof Float32Array)||!(e.sampleRate>0))throw new a(`decodeAudio must return { samples: Float32Array | Float32Array[], sampleRate }`,M)}function be(e){let t={};for(let n of e.split(`;`).slice(1)){let[e,r]=n.split(`=`);e&&r&&(t[e.trim().toLowerCase()]=r.trim().replace(/^"|"$/g,``))}return t}function K(e){let t=e?Number.parseInt(e,10):NaN;return Number.isFinite(t)&&t>0?t:void 0}function q(e,n){if(e!=null){if(!Number.isInteger(e)||e<1)throw new t(`AudioInput.${n} must be a positive integer, got ${String(e)}`,M);return e}}function J(e,t,n){return String.fromCharCode(...e.subarray(t,t+n))}function xe(e){return e instanceof Error?e.message:String(e)}var Se=`onnx-community/whisper-base`,Ce=30,we=30,Te=new Set([`whisper`,`lite-whisper`]),Y=class{type=`local`;options;model;maxBytes;onUsage;runtime;pipelines=new Map;queue=Promise.resolve();constructor(e={}){this.options=e,this.model=e.model?.trim()||`onnx-community/whisper-base`,this.maxBytes=e.maxBytes??26214400,this.onUsage=e.onUsage}async preload(e,t){await A(this.loadPipeline(e?.trim()||this.model),t)}async isCached(e){try{let t=await this.loadRuntime();if(!t.ModelRegistry)return!1;let{dtype:n,revision:r,cacheDir:i}=this.options,a=this.options.device??`auto`,o=a===`auto`?await k():a;return await t.ModelRegistry.is_pipeline_cached(`automatic-speech-recognition`,e?.trim()||this.model,{device:o,...n?{dtype:n}:{},...r?{revision:r}:{},...i?{cache_dir:i}:{}})}catch{return!1}}async transcribe(e){let{signal:t}=e,n=await u(e.audio,{mimeType:e.mimeType,maxBytes:e.maxBytes??this.maxBytes,adapter:this.type,signal:t}),r=Oe(e.audio),i=await F(new Uint8Array(await n.blob.arrayBuffer()),{mimeType:n.mimeType,sampleRate:r.sampleRate,channels:r.channels,decodeAudio:this.options.decodeAudio,signal:t});t?.throwIfAborted();let a=e.model?.trim()||this.model,o=await A(this.loadPipeline(a),t),s=i.length/j,c=await A(this.enqueue(()=>this.run(o.pipeline,i,s,e,a)),t),l={operation:`transcription`,provider:this.type,model:a,audioSeconds:s,bytes:n.bytes},d={...Ee(c,e.timestampGranularities?.includes(`word`)??!1),language:e.language,durationSeconds:s,provider:this.type,model:a,raw:c,usage:l};return await _(l,this.onUsage,e.onUsage),d}async dispose(){await this.queue;let e=[...this.pipelines.values()];this.pipelines.clear(),await Promise.all(e.map(async e=>{let{pipeline:t}=await e.catch(()=>({pipeline:void 0}));await t?.dispose?.()}))}async run(e,t,n,r,a){let{signal:o}=r;o?.throwIfAborted();let s=await this.loadRuntime(),c={};if(Te.has(e.model?.config?.model_type??`whisper`)){let t=r.timestampGranularities??[];t.includes(`word`)?c.return_timestamps=`word`:t.includes(`segment`)&&(c.return_timestamps=!0);let i=this.options.chunkLengthSeconds??Ce;i>0&&n>we&&(c.chunk_length_s=i),r.language&&!De(e,a)&&(c.language=r.language,c.task=`transcribe`)}let l;o&&s.InterruptableStoppingCriteria&&(l=new s.InterruptableStoppingCriteria,c.stopping_criteria=l);let u=()=>l?.interrupt();o?.addEventListener(`abort`,u,{once:!0});try{let n=await e(t,c);return Array.isArray(n)?n[0]??{text:``}:n}catch(e){if(o?.aborted)throw o.reason;let t=c.return_timestamps===`word`&&/cross attentions/i.test(X(e))?` (word timestamps need a model exported with cross attentions, e.g. onnx-community/whisper-base_timestamped)`:``;throw new i(this.type,`Local transcription failed: ${X(e)}${t}`,{cause:e})}finally{o?.removeEventListener(`abort`,u)}}enqueue(e){let t=this.queue.then(e,e);return this.queue=t.catch(()=>void 0),t}loadRuntime(){if(!this.runtime){let{transformers:e,configureEnv:t,modelHost:n}=this.options;this.runtime=O(e).then(e=>(e.env&&(n&&(e.env.remoteHost=n),t?.(e.env)),e)),this.runtime.catch(()=>{this.runtime=void 0})}return this.runtime}loadPipeline(e){let t=this.pipelines.get(e);return t||(t=this.loadRuntime().then(t=>se(t,{model:e,device:this.options.device??`auto`,dtype:this.options.dtype,revision:this.options.revision,cacheDir:this.options.cacheDir,onProgress:this.options.onProgress}).catch(t=>{throw t instanceof a?t:new i(this.type,`Failed to load local model '${e}': ${X(t)}`,{cause:t})})),this.pipelines.set(e,t),t.catch(()=>{this.pipelines.get(e)===t&&this.pipelines.delete(e)})),t}};function Ee(e,t){let n={text:(e.text??``).trim()},r=e.chunks;return r?.length&&(t?n.words=r.filter(e=>e.text.trim()).map(e=>({word:e.text.trim(),startSeconds:e.timestamp[0],endSeconds:e.timestamp[1]??e.timestamp[0]})):n.segments=r.map(e=>({text:e.text.trim(),startSeconds:e.timestamp[0],endSeconds:e.timestamp[1]??void 0}))),n}function De(e,t){let n=e.model?.generation_config?.is_multilingual;return typeof n==`boolean`?!n:/\.en(?:$|[-_])/i.test(t)}function Oe(e){return e&&typeof e==`object`&&`data`in e&&!(e instanceof Uint8Array)?{sampleRate:e.sampleRate,channels:e.channels}:{}}function X(e){return e instanceof Error?e.message:String(e)}var ke=`audio/pcm;rate=${j};encoding=f32le`;function Ae(e={},t=globalThis){let n=e.onProgress,r=new Y({...T(e),maxBytes:1/0,onProgress:e=>{n?.(e),t.postMessage({kind:`progress`,progress:Le(e)})}}),i=new Map,a=e=>t.postMessage(e),o=e=>{let t=e.data;if(!t||typeof t!=`object`)return;if(t.kind===`abort`){i.get(t.id)?.abort();return}let n=new AbortController;i.set(t.id,n),(t.kind===`isCached`?r.isCached(t.model).then(e=>{a({kind:`result`,id:t.id,cached:e})}):t.kind===`preload`?r.preload(t.model,n.signal).then(()=>{a({kind:`result`,id:t.id})}):Promise.resolve().then(()=>r.transcribe({audio:Me(t.audio),model:t.model,language:t.language,timestampGranularities:t.timestampGranularities,signal:n.signal})).then(e=>{a({kind:`result`,id:t.id,result:e})})).catch(e=>{a({kind:`error`,id:t.id,error:Fe(e)})}).finally(()=>i.delete(t.id))};return t.addEventListener(`message`,o),async()=>{t.removeEventListener(`message`,o);for(let e of i.values())e.abort();await r.dispose()}}var je=class{type=`local`;endpoint;options;calls=new Map;nextId=1;closed=!1;closing=new AbortController;listener=e=>this.onMessage(e.data);constructor(e,t={}){this.endpoint=e,this.options=t,e.addEventListener(`message`,this.listener)}async isCached(e){try{let{cached:t}=await this.call({kind:`isCached`,model:e},void 0);return t===!0}catch{return!1}}async preload(e,t){await this.call({kind:`preload`,model:e},t)}async transcribe(e){this.assertOpen();let{signal:t}=e,{audio:n,bytes:r}=await A(this.prepare(e),this.closing.signal),{result:a}=await this.call({kind:`transcribe`,audio:n,model:e.model,language:e.language,timestampGranularities:e.timestampGranularities},t,Pe(n));if(!a)throw new i(this.type,`Worker returned no result`);let o={...a.usage??{operation:`transcription`,provider:this.type},bytes:r};return await _(o,this.options.onUsage,e.onUsage),{...a,usage:o}}close(){if(!this.closed){this.closed=!0,this.endpoint.removeEventListener(`message`,this.listener),this.closing.abort(Z());for(let[e,t]of this.calls)this.endpoint.postMessage({kind:`abort`,id:e}),t.reject(Z());this.calls.clear()}}async prepare(e){let{signal:t}=e,n=await u(e.audio,{mimeType:e.mimeType,maxBytes:e.maxBytes??this.options.maxBytes??26214400,adapter:this.type,signal:t}),r=new Uint8Array(await n.blob.arrayBuffer());if(!ue(r,n.mimeType)){let e=await A(L(r,{mimeType:n.mimeType,decodeAudio:this.options.decodeAudio,signal:t}),t);if(e)return{audio:{kind:`decoded`,samples:(e.samples instanceof Float32Array?[e.samples]:e.samples).map(Q),sampleRate:e.sampleRate},bytes:n.bytes}}let i=typeof e.audio==`object`&&`data`in e.audio&&!(e.audio instanceof Uint8Array)?e.audio:void 0;return{audio:{kind:`encoded`,bytes:Q(r),mimeType:n.mimeType,sampleRate:i?.sampleRate,channels:i?.channels},bytes:n.bytes}}assertOpen(){if(this.closed)throw Z()}call(e,t,n=[]){this.assertOpen(),t?.throwIfAborted();let r=this.nextId++;return new Promise((i,a)=>{let o=()=>{this.calls.delete(r),this.endpoint.postMessage({kind:`abort`,id:r}),a(t?.reason)},s=()=>t?.removeEventListener(`abort`,o);this.calls.set(r,{resolve:e=>{s(),i(e)},reject:e=>{s(),a(e)}}),t?.addEventListener(`abort`,o,{once:!0}),this.endpoint.postMessage({...e,id:r},n)})}onMessage(e){if(!e||typeof e!=`object`)return;if(e.kind===`progress`){this.options.onProgress?.(e.progress);return}let t=this.calls.get(e.id);t&&(this.calls.delete(e.id),e.kind===`result`?t.resolve({result:e.result,cached:e.cached}):t.reject(Ie(e.error)))}};function Z(){return new a(`Worker client closed`,`local`)}function Me(e){if(e.kind===`decoded`){let t=I({samples:e.samples,sampleRate:e.sampleRate});return{data:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),mimeType:ke}}return{data:e.bytes,mimeType:e.mimeType,sampleRate:e.sampleRate,channels:e.channels}}function Q(e){let{buffer:t}=e;return Ne(t)&&e.byteOffset===0&&e.byteLength===t.byteLength?e:e.slice()}function Ne(e){return Object.prototype.toString.call(e)===`[object ArrayBuffer]`}function Pe(e){let t=e.kind===`decoded`?e.samples:[e.bytes];return[...new Set(t.map(e=>e.buffer))]}function Fe(e){return e instanceof r?{name:e.name,message:e.message,code:e.code,maxBytes:e.maxBytes}:e instanceof n?{name:e.name,message:e.message,code:e.code}:e instanceof Error?{name:e.name,message:e.message}:{name:`Error`,message:String(e)}}function Ie(e){switch(e.name){case`SpeechConfigurationError`:return new a(e.message,`local`);case`SpeechInvalidAudioError`:return new t(e.message,`local`);case`SpeechAudioTooLargeError`:return new r(e.message,e.maxBytes??NaN,`local`);case`SpeechProviderError`:return new i(`local`,e.message);case`SpeechProviderUnavailableError`:return new o(`local`,e.message);case`AbortError`:return new DOMException(e.message,`AbortError`);default:{let t=Error(e.message);return t.name=e.name,t}}}function Le(e){let t={status:e.status};for(let[n,r]of Object.entries(e))(r===null||[`string`,`number`,`boolean`].includes(typeof r))&&(t[n]=r);return t}function $(e={},t={}){return new Y(T(e,t))}async function Re(){try{return await O(void 0),!0}catch{return!1}}ae(`local`,(e,t)=>$({...e,type:`local`},t));export{Se as DEFAULT_LOCAL_MODEL,j as LOCAL_SAMPLE_RATE,w as LOCAL_TRANSCRIBER_ENV_KEYS,Y as LocalTranscriber,je as LocalTranscriberWorkerClient,D as TRANSFORMERS_INSTALL_HINT,E as TRANSFORMERS_PACKAGE,$ as createLocalTranscriber,F as decodeToPcm16k,Re as isLocalTranscriberAvailable,Ae as serveLocalTranscriber};
|