@happyvertical/smrt-planner 0.57.38 → 0.57.40

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.
Files changed (535) hide show
  1. package/app/404.html +18 -18
  2. package/app/_app/immutable/chunks/{BgSEQhz3.js → BAwEK5g5.js} +1 -1
  3. package/app/_app/immutable/chunks/{BKJ9ELUP.js → BBzpxK-8.js} +2 -2
  4. package/app/_app/immutable/chunks/BGpjZKOE.js +2 -0
  5. package/app/_app/immutable/chunks/{dJCEV3u7.js → Bikltb61.js} +1 -1
  6. package/app/_app/immutable/chunks/{DooRD8BN.js → BoItyfDx.js} +1 -1
  7. package/app/_app/immutable/chunks/{DAA-yz6J.js → BytZpJV4.js} +1 -1
  8. package/app/_app/immutable/chunks/{2umBkqxi.js → Bz6UsD_f.js} +3 -3
  9. package/app/_app/immutable/chunks/CBHn82fo.js +1 -0
  10. package/app/_app/immutable/chunks/{Q-HwUGau.js → CF92oapa.js} +1 -1
  11. package/app/_app/immutable/chunks/{DKDlfpxH.js → CGy-IxPQ.js} +1 -1
  12. package/app/_app/immutable/chunks/{BUsBpizP.js → CUNj1yy1.js} +1 -1
  13. package/app/_app/immutable/chunks/{J7CdXZxV.js → CX6N0Q6b.js} +1 -1
  14. package/app/_app/immutable/chunks/{CmO-K8eJ.js → CaTJsbff.js} +1 -1
  15. package/app/_app/immutable/chunks/{DFqdDA0z.js → CgeTxqIE.js} +3 -3
  16. package/app/_app/immutable/chunks/{DQ2bNQSn.js → CijPG3jg.js} +1 -1
  17. package/app/_app/immutable/chunks/{BETauCCm.js → CrCEAfXG.js} +1 -1
  18. package/app/_app/immutable/chunks/D00XWXiM.js +1 -0
  19. package/app/_app/immutable/chunks/{Da_0GNuu.js → D4QMl-tN.js} +1 -1
  20. package/app/_app/immutable/chunks/{CiUDI5Ay.js → D75d6u7q.js} +1 -1
  21. package/app/_app/immutable/chunks/{DlnkaADl.js → DPhUHp9B.js} +1 -1
  22. package/app/_app/immutable/chunks/{BFMS_WAY.js → DV-QPPmm.js} +1 -1
  23. package/app/_app/immutable/chunks/{CNsBPi6n.js → DVHELJ71.js} +1 -1
  24. package/app/_app/immutable/chunks/{Daa4F5N1.js → DmNUwu-S.js} +1 -1
  25. package/app/_app/immutable/chunks/{CJCM0Xnh.js → Ds81oecv.js} +1 -1
  26. package/app/_app/immutable/chunks/{Cz174day.js → DvjvjwnR.js} +1 -1
  27. package/app/_app/immutable/chunks/{C-DHThw2.js → DwJwsALF.js} +1 -1
  28. package/app/_app/immutable/chunks/{BoJ-8pRr.js → cXr3doj-.js} +1 -1
  29. package/app/_app/immutable/chunks/eBF8D7GD.js +1 -0
  30. package/app/_app/immutable/chunks/{RBRsUKgn.js → f1wD15Gj.js} +33 -33
  31. package/app/_app/immutable/chunks/{IvaX0muk.js → mQ6O0Tem.js} +1 -1
  32. package/app/_app/immutable/chunks/yk0CbPfJ.js +1 -0
  33. package/app/_app/immutable/entry/{app.BhyntTj6.js → app.Ci1kI5es.js} +2 -2
  34. package/app/_app/immutable/entry/start.6TiI-_oR.js +1 -0
  35. package/app/_app/immutable/nodes/{0.CxPs4-vS.js → 0.Z902gPeD.js} +1 -1
  36. package/app/_app/immutable/nodes/{1.Dr-lT0AH.js → 1.Ccdu2St_.js} +1 -1
  37. package/app/_app/immutable/nodes/{10.BAr3S609.js → 10.Dyma18OU.js} +1 -1
  38. package/app/_app/immutable/nodes/{11.CEv4lkki.js → 11.Cu6DiI7h.js} +1 -1
  39. package/app/_app/immutable/nodes/{12.Cl5muBV_.js → 12.FH2vqMr8.js} +1 -1
  40. package/app/_app/immutable/nodes/{13.CQpr96eO.js → 13.Be1MlzbM.js} +1 -1
  41. package/app/_app/immutable/nodes/{14.CM4YWhvt.js → 14.DM_cZGhH.js} +1 -1
  42. package/app/_app/immutable/nodes/{2.BgT79DEX.js → 2.CjNkW-UL.js} +3 -3
  43. package/app/_app/immutable/nodes/{3.BUwyOY6E.js → 3.TF7PiZW5.js} +1 -1
  44. package/app/_app/immutable/nodes/{4.CN_nGqb6.js → 4.YRTy9VBr.js} +1 -1
  45. package/app/_app/immutable/nodes/{5.C4k3O6YO.js → 5.BgL37Avs.js} +1 -1
  46. package/app/_app/immutable/nodes/{6.Brkgf6kx.js → 6.C57oZZy1.js} +1 -1
  47. package/app/_app/immutable/nodes/{7.BLiMsUN6.js → 7.CvchC13t.js} +1 -1
  48. package/app/_app/immutable/nodes/{8.BRFR3tbY.js → 8.CTFwoCm2.js} +1 -1
  49. package/app/_app/immutable/nodes/{9.BPnmT4h5.js → 9.CZeQtlqV.js} +1 -1
  50. package/app/_app/immutable/workers/local-speech.worker-BzGX7Qdn.js +51 -0
  51. package/app/_app/version.json +1 -1
  52. package/app/advanced-styles/index.html +21 -21
  53. package/app/ai/index.html +25 -25
  54. package/app/blueprint/index.html +19 -19
  55. package/app/cookbook/index.html +19 -19
  56. package/app/index.html +27 -27
  57. package/app/m/ads/AdDeliveryTier/index.html +23 -23
  58. package/app/m/ads/AdEvent/index.html +23 -23
  59. package/app/m/ads/AdFormat/index.html +23 -23
  60. package/app/m/ads/AdGroup/index.html +23 -23
  61. package/app/m/ads/AdVariation/index.html +23 -23
  62. package/app/m/analytics/AnalyticsDataStream/index.html +23 -23
  63. package/app/m/analytics/AnalyticsEvent/index.html +23 -23
  64. package/app/m/analytics/AnalyticsProperty/index.html +23 -23
  65. package/app/m/analytics/AnalyticsReport/index.html +23 -23
  66. package/app/m/approvals/ApprovalEvent/index.html +23 -23
  67. package/app/m/approvals/ApprovalPolicy/index.html +23 -23
  68. package/app/m/approvals/ApprovalRequest/index.html +23 -23
  69. package/app/m/assets/Asset/attachments/index.html +24 -24
  70. package/app/m/assets/Asset/index.html +23 -23
  71. package/app/m/assets/AssetAssociation/index.html +23 -23
  72. package/app/m/assets/AssetMetafield/index.html +23 -23
  73. package/app/m/assets/AssetStatus/index.html +23 -23
  74. package/app/m/assets/AssetType/index.html +23 -23
  75. package/app/m/assets/Folder/index.html +23 -23
  76. package/app/m/chat/AgentSession/index.html +23 -23
  77. package/app/m/chat/ChatMessage/index.html +23 -23
  78. package/app/m/chat/ChatParticipant/index.html +23 -23
  79. package/app/m/chat/ChatReaction/index.html +23 -23
  80. package/app/m/chat/ChatRoom/index.html +23 -23
  81. package/app/m/chat/ChatThread/index.html +23 -23
  82. package/app/m/chat/VoiceGatewayTurn/index.html +23 -23
  83. package/app/m/chat/VoiceSession/index.html +23 -23
  84. package/app/m/commerce/Agreement/index.html +23 -23
  85. package/app/m/commerce/Cart/index.html +23 -23
  86. package/app/m/commerce/Contract/index.html +23 -23
  87. package/app/m/commerce/ContractLineItem/index.html +23 -23
  88. package/app/m/commerce/Customer/index.html +23 -23
  89. package/app/m/commerce/DocumentTax/index.html +23 -23
  90. package/app/m/commerce/Estimate/index.html +23 -23
  91. package/app/m/commerce/Fulfillment/index.html +23 -23
  92. package/app/m/commerce/FulfillmentLineItem/index.html +23 -23
  93. package/app/m/commerce/HistoricalCustomerFunds/index.html +23 -23
  94. package/app/m/commerce/HistoricalCustomerFundsAllocation/index.html +23 -23
  95. package/app/m/commerce/HistoricalSalesLine/index.html +23 -23
  96. package/app/m/commerce/Invoice/index.html +23 -23
  97. package/app/m/commerce/InvoiceLineItem/index.html +23 -23
  98. package/app/m/commerce/Lease/index.html +23 -23
  99. package/app/m/commerce/LicenseSale/index.html +23 -23
  100. package/app/m/commerce/Order/index.html +23 -23
  101. package/app/m/commerce/Payment/index.html +23 -23
  102. package/app/m/commerce/PaymentAllocation/index.html +23 -23
  103. package/app/m/commerce/PaymentInstrument/index.html +23 -23
  104. package/app/m/commerce/PaymentIntent/index.html +23 -23
  105. package/app/m/commerce/Payout/index.html +23 -23
  106. package/app/m/commerce/ProductionOrder/index.html +23 -23
  107. package/app/m/commerce/PurchaseContract/index.html +23 -23
  108. package/app/m/commerce/PurchaseOrder/index.html +23 -23
  109. package/app/m/commerce/SalesContract/index.html +23 -23
  110. package/app/m/commerce/SupplierQuote/index.html +23 -23
  111. package/app/m/commerce/TaxCode/index.html +23 -23
  112. package/app/m/commerce/TaxComponent/index.html +23 -23
  113. package/app/m/commerce/TaxSettings/index.html +23 -23
  114. package/app/m/commerce/TaxSummaryReport/index.html +23 -23
  115. package/app/m/commerce/TenantPaymentAccount/index.html +23 -23
  116. package/app/m/commerce/Vendor/index.html +23 -23
  117. package/app/m/commerce/WholesaleOrder/index.html +23 -23
  118. package/app/m/content/Content/articles/index.html +24 -24
  119. package/app/m/content/Content/index.html +23 -23
  120. package/app/m/content/ContentContribution/index.html +23 -23
  121. package/app/m/content/ContentContributionAttachment/index.html +23 -23
  122. package/app/m/content/ContentContributionRevision/index.html +23 -23
  123. package/app/m/content/ContentContributionType/index.html +23 -23
  124. package/app/m/content/ContentContributor/index.html +23 -23
  125. package/app/m/content/ContentCorrection/index.html +23 -23
  126. package/app/m/content/ContentFeedSource/index.html +23 -23
  127. package/app/m/content/ContentGovernanceAssignment/index.html +23 -23
  128. package/app/m/content/ContentGovernancePolicy/index.html +23 -23
  129. package/app/m/content/ContentGovernanceProfile/index.html +23 -23
  130. package/app/m/content/ContentReference/index.html +23 -23
  131. package/app/m/content/ContentReview/index.html +23 -23
  132. package/app/m/content/ContentVersion/index.html +23 -23
  133. package/app/m/events/Event/index.html +23 -23
  134. package/app/m/events/EventParticipant/index.html +23 -23
  135. package/app/m/events/EventSeries/index.html +23 -23
  136. package/app/m/events/EventType/index.html +23 -23
  137. package/app/m/expenses/Expense/index.html +23 -23
  138. package/app/m/facts/Fact/index.html +23 -23
  139. package/app/m/facts/FactContent/index.html +23 -23
  140. package/app/m/facts/FactEvidence/index.html +23 -23
  141. package/app/m/facts/FactSource/index.html +23 -23
  142. package/app/m/facts/FactSubject/index.html +23 -23
  143. package/app/m/facts/FactTag/index.html +23 -23
  144. package/app/m/fields/FieldPolicy/index.html +23 -23
  145. package/app/m/fields/FieldPolicySuggestion/index.html +23 -23
  146. package/app/m/fields/FieldUsageCounter/index.html +23 -23
  147. package/app/m/human-resources/Employment/index.html +23 -23
  148. package/app/m/human-resources/EmploymentTerm/index.html +23 -23
  149. package/app/m/human-resources/HeldQualification/index.html +23 -23
  150. package/app/m/human-resources/Qualification/index.html +23 -23
  151. package/app/m/images/Image/index.html +23 -23
  152. package/app/m/inventory/InventoryLocation/index.html +23 -23
  153. package/app/m/inventory/Lot/index.html +23 -23
  154. package/app/m/inventory/LotCorrection/index.html +23 -23
  155. package/app/m/inventory/LotDocument/index.html +23 -23
  156. package/app/m/inventory/LotStockLevel/index.html +23 -23
  157. package/app/m/inventory/LotUsage/index.html +23 -23
  158. package/app/m/inventory/StockLevel/index.html +23 -23
  159. package/app/m/inventory/StockMovement/index.html +23 -23
  160. package/app/m/ledgers/Account/index.html +23 -23
  161. package/app/m/ledgers/Journal/index.html +23 -23
  162. package/app/m/ledgers/JournalEntry/index.html +23 -23
  163. package/app/m/ledgers/Ledger/index.html +23 -23
  164. package/app/m/manufacturing/Assembly/index.html +23 -23
  165. package/app/m/manufacturing/BillOfMaterials/index.html +23 -23
  166. package/app/m/manufacturing/BomLine/index.html +23 -23
  167. package/app/m/manufacturing/Operation/index.html +23 -23
  168. package/app/m/manufacturing/ProductionRun/index.html +23 -23
  169. package/app/m/manufacturing/ProductionRunCompletion/index.html +23 -23
  170. package/app/m/manufacturing/RoutingStep/index.html +23 -23
  171. package/app/m/marketing/Campaign/index.html +23 -23
  172. package/app/m/marketing/CampaignChannel/index.html +23 -23
  173. package/app/m/marketing/CampaignMetricSnapshot/index.html +23 -23
  174. package/app/m/messages/Account/index.html +23 -23
  175. package/app/m/messages/Attachment/index.html +23 -23
  176. package/app/m/messages/Blacklist/index.html +23 -23
  177. package/app/m/messages/Email/failed-sends/index.html +24 -24
  178. package/app/m/messages/Email/index.html +23 -23
  179. package/app/m/messages/Email/mailbox/index.html +24 -24
  180. package/app/m/messages/EmailAccount/index.html +23 -23
  181. package/app/m/messages/EmailAttachment/index.html +23 -23
  182. package/app/m/messages/EmailFolder/index.html +23 -23
  183. package/app/m/messages/Message/index.html +23 -23
  184. package/app/m/messages/MessagingEndpoint/index.html +23 -23
  185. package/app/m/messages/PersonaMessageRoute/index.html +23 -23
  186. package/app/m/messages/SlackAccount/index.html +23 -23
  187. package/app/m/messages/SlackMessage/index.html +23 -23
  188. package/app/m/messages/SlackMessage/slack-messages/index.html +24 -24
  189. package/app/m/messages/TelegramAccount/index.html +23 -23
  190. package/app/m/messages/Tweet/index.html +23 -23
  191. package/app/m/messages/TwitterAccount/index.html +23 -23
  192. package/app/m/messages/Whitelist/index.html +23 -23
  193. package/app/m/messages/ZulipAccount/index.html +23 -23
  194. package/app/m/places/Place/index.html +23 -23
  195. package/app/m/places/PlaceType/index.html +23 -23
  196. package/app/m/products/Category/index.html +23 -23
  197. package/app/m/products/Material/index.html +23 -23
  198. package/app/m/products/Product/index.html +23 -23
  199. package/app/m/products/Product/ingredients/index.html +24 -24
  200. package/app/m/products/ProductVariant/index.html +23 -23
  201. package/app/m/products/Sku/index.html +23 -23
  202. package/app/m/profiles/ApiKey/index.html +23 -23
  203. package/app/m/profiles/Bot/index.html +23 -23
  204. package/app/m/profiles/MagicLinkToken/index.html +23 -23
  205. package/app/m/profiles/NostrIdentity/index.html +23 -23
  206. package/app/m/profiles/OidcIdentity/index.html +23 -23
  207. package/app/m/profiles/Organization/index.html +23 -23
  208. package/app/m/profiles/Person/index.html +23 -23
  209. package/app/m/profiles/Profile/index.html +23 -23
  210. package/app/m/profiles/ProfileMetadata/index.html +23 -23
  211. package/app/m/profiles/ProfileMetafield/index.html +23 -23
  212. package/app/m/profiles/ProfileRelationship/index.html +23 -23
  213. package/app/m/profiles/ProfileRelationshipTerm/index.html +23 -23
  214. package/app/m/profiles/ProfileRelationshipType/index.html +23 -23
  215. package/app/m/profiles/ProfileType/index.html +23 -23
  216. package/app/m/projects/Comment/index.html +23 -23
  217. package/app/m/projects/Issue/index.html +23 -23
  218. package/app/m/projects/Label/index.html +23 -23
  219. package/app/m/projects/Project/index.html +23 -23
  220. package/app/m/projects/ProjectIntegration/index.html +23 -23
  221. package/app/m/projects/PullRequest/index.html +23 -23
  222. package/app/m/projects/Repository/index.html +23 -23
  223. package/app/m/properties/Property/index.html +23 -23
  224. package/app/m/properties/Zone/index.html +23 -23
  225. package/app/m/reports/RuntimeReport/index.html +23 -23
  226. package/app/m/reports/SmrtPrincipalReportRefreshTask/index.html +23 -23
  227. package/app/m/reports/SmrtReportLock/index.html +23 -23
  228. package/app/m/reports/SmrtReportRefreshTask/index.html +23 -23
  229. package/app/m/reports/SmrtReportRun/index.html +23 -23
  230. package/app/m/reports/SmrtReportSchedule/index.html +23 -23
  231. package/app/m/reports/SmrtReportWatermark/index.html +23 -23
  232. package/app/m/sales/Agreement/index.html +23 -23
  233. package/app/m/sales/AttributionException/index.html +23 -23
  234. package/app/m/sales/AttributionPolicy/index.html +23 -23
  235. package/app/m/sales/Commission/index.html +23 -23
  236. package/app/m/sales/CommissionAdjustment/index.html +23 -23
  237. package/app/m/sales/CommissionPayout/index.html +23 -23
  238. package/app/m/sales/CommissionPlan/index.html +23 -23
  239. package/app/m/sales/Earner/index.html +23 -23
  240. package/app/m/sales/EarnerSourceAttribution/index.html +23 -23
  241. package/app/m/sales/EarningEvent/index.html +23 -23
  242. package/app/m/sales/ExecutedAgreement/index.html +23 -23
  243. package/app/m/sales/Lead/index.html +23 -23
  244. package/app/m/sales/Opportunity/index.html +23 -23
  245. package/app/m/sales/OpportunityConversion/index.html +23 -23
  246. package/app/m/sales/PipelineDefinition/index.html +23 -23
  247. package/app/m/sales/PipelineStage/index.html +23 -23
  248. package/app/m/sales/Referral/index.html +23 -23
  249. package/app/m/sales/ReferralAgreement/index.html +23 -23
  250. package/app/m/sales/ReferralLink/index.html +23 -23
  251. package/app/m/sales/ReferralProgram/index.html +23 -23
  252. package/app/m/sales/ReferralTermSnapshot/index.html +23 -23
  253. package/app/m/sales/ReferralTouch/index.html +23 -23
  254. package/app/m/sales/Referrer/index.html +23 -23
  255. package/app/m/sales/SalesActivity/index.html +23 -23
  256. package/app/m/sales/SalesRepresentative/index.html +23 -23
  257. package/app/m/sites/Site/index.html +23 -23
  258. package/app/m/sites/SiteAgentBinding/index.html +23 -23
  259. package/app/m/social/OAuthState/index.html +23 -23
  260. package/app/m/social/SocialAccount/index.html +23 -23
  261. package/app/m/social/SocialPost/index.html +23 -23
  262. package/app/m/social/SocialPostAnalyticsSnapshot/index.html +23 -23
  263. package/app/m/subscriptions/BillingAdjustment/index.html +23 -23
  264. package/app/m/subscriptions/ClientCharge/index.html +23 -23
  265. package/app/m/subscriptions/CreditGrant/index.html +23 -23
  266. package/app/m/subscriptions/PricingRule/index.html +23 -23
  267. package/app/m/subscriptions/RetailCharge/index.html +23 -23
  268. package/app/m/subscriptions/SpendingPolicy/index.html +23 -23
  269. package/app/m/subscriptions/SubscriptionPlan/index.html +23 -23
  270. package/app/m/subscriptions/SubscriptionPlanVersion/index.html +23 -23
  271. package/app/m/subscriptions/TenantSubscription/index.html +23 -23
  272. package/app/m/subscriptions/TenantUsageMetric/index.html +23 -23
  273. package/app/m/support/ServiceTimeEntry/index.html +23 -23
  274. package/app/m/support/SupportAiRun/index.html +23 -23
  275. package/app/m/support/SupportAvailability/index.html +23 -23
  276. package/app/m/support/SupportCase/index.html +23 -23
  277. package/app/m/support/SupportCaseEvent/index.html +23 -23
  278. package/app/m/support/SupportChannelBinding/index.html +23 -23
  279. package/app/m/support/SupportCharge/index.html +23 -23
  280. package/app/m/support/SupportCompensation/index.html +23 -23
  281. package/app/m/support/SupportCompensationPlan/index.html +23 -23
  282. package/app/m/support/SupportEscalation/index.html +23 -23
  283. package/app/m/support/SupportInteraction/index.html +23 -23
  284. package/app/m/support/SupportPlan/index.html +23 -23
  285. package/app/m/support/SupportPolicy/index.html +23 -23
  286. package/app/m/support/SupportQualification/index.html +23 -23
  287. package/app/m/support/SupportServiceTarget/index.html +23 -23
  288. package/app/m/support/SupportSpecialist/index.html +23 -23
  289. package/app/m/support/SupportWorkLink/index.html +23 -23
  290. package/app/m/tags/Tag/index.html +23 -23
  291. package/app/m/tags/TagAlias/index.html +23 -23
  292. package/app/m/timesheets/AttendanceBreak/index.html +23 -23
  293. package/app/m/timesheets/AttendancePunch/index.html +23 -23
  294. package/app/m/timesheets/AttendanceSegment/index.html +23 -23
  295. package/app/m/timesheets/ServiceChargeSnapshot/index.html +23 -23
  296. package/app/m/timesheets/ServiceCompensationSnapshot/index.html +23 -23
  297. package/app/m/timesheets/ServiceTimeEntry/index.html +23 -23
  298. package/app/m/users/Group/index.html +23 -23
  299. package/app/m/users/GroupMember/index.html +23 -23
  300. package/app/m/users/GroupRole/index.html +23 -23
  301. package/app/m/users/Membership/index.html +23 -23
  302. package/app/m/users/MembershipOverride/index.html +23 -23
  303. package/app/m/users/Permission/index.html +23 -23
  304. package/app/m/users/Role/index.html +23 -23
  305. package/app/m/users/RolePermission/index.html +23 -23
  306. package/app/m/users/Session/index.html +23 -23
  307. package/app/m/users/Tenant/index.html +23 -23
  308. package/app/m/users/TenantIntegration/index.html +23 -23
  309. package/app/m/users/TenantPermissionOverride/index.html +23 -23
  310. package/app/m/users/User/index.html +23 -23
  311. package/app/m/video/Character/index.html +23 -23
  312. package/app/m/video/CharacterAsset/index.html +23 -23
  313. package/app/m/video/CompositeJob/index.html +23 -23
  314. package/app/m/video/Performer/index.html +23 -23
  315. package/app/m/video/PerformerAsset/index.html +23 -23
  316. package/app/m/video/Scene/index.html +23 -23
  317. package/app/m/video/SceneAsset/index.html +23 -23
  318. package/app/m/video/VideoComposition/index.html +23 -23
  319. package/app/m/video/VideoCompositionAsset/index.html +23 -23
  320. package/app/m/video/VideoSequence/index.html +23 -23
  321. package/app/m/video/VideoSequenceAsset/index.html +23 -23
  322. package/app/m/video/VideoShot/index.html +23 -23
  323. package/app/m/video/VideoShotAsset/index.html +23 -23
  324. package/app/m/video/VideoShotCharacter/index.html +23 -23
  325. package/app/m/video/VideoWorkflow/index.html +23 -23
  326. package/app/m/voice/VoiceOutput/index.html +23 -23
  327. package/app/m/voice/VoiceProfile/index.html +23 -23
  328. package/app/m/voice/VoiceSample/index.html +23 -23
  329. package/app/mcp.html +2 -2
  330. package/app/packages/ads/index.html +21 -21
  331. package/app/packages/analytics/index.html +21 -21
  332. package/app/packages/approvals/index.html +21 -21
  333. package/app/packages/assets/index.html +21 -21
  334. package/app/packages/chat/index.html +21 -21
  335. package/app/packages/comments/index.html +21 -21
  336. package/app/packages/commerce/index.html +21 -21
  337. package/app/packages/content/index.html +21 -21
  338. package/app/packages/events/index.html +21 -21
  339. package/app/packages/expenses/index.html +21 -21
  340. package/app/packages/facts/index.html +21 -21
  341. package/app/packages/fields/index.html +21 -21
  342. package/app/packages/human-resources/index.html +21 -21
  343. package/app/packages/images/index.html +21 -21
  344. package/app/packages/index.html +20 -20
  345. package/app/packages/ingestion/index.html +21 -21
  346. package/app/packages/inventory/index.html +21 -21
  347. package/app/packages/ledgers/index.html +21 -21
  348. package/app/packages/manufacturing/index.html +21 -21
  349. package/app/packages/marketing/index.html +21 -21
  350. package/app/packages/messages/index.html +21 -21
  351. package/app/packages/places/index.html +21 -21
  352. package/app/packages/preferences/index.html +21 -21
  353. package/app/packages/products/index.html +21 -21
  354. package/app/packages/profiles/index.html +21 -21
  355. package/app/packages/projects/index.html +21 -21
  356. package/app/packages/properties/index.html +21 -21
  357. package/app/packages/reactions/index.html +21 -21
  358. package/app/packages/reports/index.html +21 -21
  359. package/app/packages/sales/index.html +21 -21
  360. package/app/packages/sites/index.html +21 -21
  361. package/app/packages/social/index.html +21 -21
  362. package/app/packages/subscriptions/index.html +21 -21
  363. package/app/packages/support/index.html +21 -21
  364. package/app/packages/tags/index.html +21 -21
  365. package/app/packages/timesheets/index.html +21 -21
  366. package/app/packages/users/index.html +21 -21
  367. package/app/packages/video/index.html +21 -21
  368. package/app/packages/voice/index.html +21 -21
  369. package/app/packages/webhooks/index.html +21 -21
  370. package/app/recipes/account-access/help/index.html +21 -21
  371. package/app/recipes/account-access/index.html +23 -23
  372. package/app/recipes/activity/help/index.html +21 -21
  373. package/app/recipes/activity/index.html +23 -23
  374. package/app/recipes/ads.campaigns/help/index.html +21 -21
  375. package/app/recipes/ads.campaigns/index.html +23 -23
  376. package/app/recipes/affiliates.referrals/help/index.html +21 -21
  377. package/app/recipes/affiliates.referrals/index.html +23 -23
  378. package/app/recipes/agreements/help/index.html +21 -21
  379. package/app/recipes/agreements/index.html +23 -23
  380. package/app/recipes/analytics.reports/help/index.html +21 -21
  381. package/app/recipes/analytics.reports/index.html +23 -23
  382. package/app/recipes/approvals.requests/help/index.html +21 -21
  383. package/app/recipes/approvals.requests/index.html +23 -23
  384. package/app/recipes/assets/help/index.html +21 -21
  385. package/app/recipes/assets/index.html +23 -23
  386. package/app/recipes/billing/help/index.html +21 -21
  387. package/app/recipes/billing/index.html +23 -23
  388. package/app/recipes/chat.assistant/help/index.html +21 -21
  389. package/app/recipes/chat.assistant/index.html +23 -23
  390. package/app/recipes/comments/help/index.html +21 -21
  391. package/app/recipes/comments/index.html +23 -23
  392. package/app/recipes/commerce.customers/help/index.html +21 -21
  393. package/app/recipes/commerce.customers/index.html +23 -23
  394. package/app/recipes/commerce.estimates/help/index.html +21 -21
  395. package/app/recipes/commerce.estimates/index.html +23 -23
  396. package/app/recipes/commerce.purchases/help/index.html +21 -21
  397. package/app/recipes/commerce.purchases/index.html +23 -23
  398. package/app/recipes/commerce.sales/help/index.html +21 -21
  399. package/app/recipes/commerce.sales/index.html +23 -23
  400. package/app/recipes/commerce.vendors/help/index.html +21 -21
  401. package/app/recipes/commerce.vendors/index.html +23 -23
  402. package/app/recipes/commerce.wholesale/help/index.html +21 -21
  403. package/app/recipes/commerce.wholesale/index.html +23 -23
  404. package/app/recipes/content.articles/help/index.html +21 -21
  405. package/app/recipes/content.articles/index.html +23 -23
  406. package/app/recipes/events.calendar/help/index.html +21 -21
  407. package/app/recipes/events.calendar/index.html +23 -23
  408. package/app/recipes/expenses.tracking/help/index.html +21 -21
  409. package/app/recipes/expenses.tracking/index.html +23 -23
  410. package/app/recipes/fields.form-customization/help/index.html +21 -21
  411. package/app/recipes/fields.form-customization/index.html +23 -23
  412. package/app/recipes/human-resources.people/help/index.html +21 -21
  413. package/app/recipes/human-resources.people/index.html +23 -23
  414. package/app/recipes/human-resources.qualifications/help/index.html +21 -21
  415. package/app/recipes/human-resources.qualifications/index.html +23 -23
  416. package/app/recipes/ingestion/help/index.html +21 -21
  417. package/app/recipes/ingestion/index.html +23 -23
  418. package/app/recipes/integrations/help/index.html +21 -21
  419. package/app/recipes/integrations/index.html +23 -23
  420. package/app/recipes/inventory.stock/help/index.html +21 -21
  421. package/app/recipes/inventory.stock/index.html +23 -23
  422. package/app/recipes/ledgers.bookkeeping/help/index.html +21 -21
  423. package/app/recipes/ledgers.bookkeeping/index.html +23 -23
  424. package/app/recipes/manufacturing.assemblies/help/index.html +21 -21
  425. package/app/recipes/manufacturing.assemblies/index.html +23 -23
  426. package/app/recipes/manufacturing.production/help/index.html +21 -21
  427. package/app/recipes/manufacturing.production/index.html +23 -23
  428. package/app/recipes/marketing.campaigns/help/index.html +21 -21
  429. package/app/recipes/marketing.campaigns/index.html +23 -23
  430. package/app/recipes/messages/help/index.html +21 -21
  431. package/app/recipes/messages/index.html +23 -23
  432. package/app/recipes/places.locations/help/index.html +21 -21
  433. package/app/recipes/places.locations/index.html +23 -23
  434. package/app/recipes/products/help/index.html +21 -21
  435. package/app/recipes/products/index.html +23 -23
  436. package/app/recipes/projects.tracker/help/index.html +21 -21
  437. package/app/recipes/projects.tracker/index.html +23 -23
  438. package/app/recipes/reports.materialized/help/index.html +21 -21
  439. package/app/recipes/reports.materialized/index.html +23 -23
  440. package/app/recipes/reports.runtime/help/index.html +21 -21
  441. package/app/recipes/reports.runtime/index.html +23 -23
  442. package/app/recipes/sales.pipeline/help/index.html +21 -21
  443. package/app/recipes/sales.pipeline/index.html +23 -23
  444. package/app/recipes/social.posts/help/index.html +21 -21
  445. package/app/recipes/social.posts/index.html +23 -23
  446. package/app/recipes/subscriptions.plans/help/index.html +21 -21
  447. package/app/recipes/subscriptions.plans/index.html +23 -23
  448. package/app/recipes/support.tickets/help/index.html +21 -21
  449. package/app/recipes/support.tickets/index.html +23 -23
  450. package/app/recipes/tags.taxonomy/help/index.html +21 -21
  451. package/app/recipes/tags.taxonomy/index.html +23 -23
  452. package/app/recipes/team-collaboration/help/index.html +21 -21
  453. package/app/recipes/team-collaboration/index.html +23 -23
  454. package/app/recipes/timesheets.time-entries/help/index.html +21 -21
  455. package/app/recipes/timesheets.time-entries/index.html +23 -23
  456. package/app/recipes/video.library/help/index.html +21 -21
  457. package/app/recipes/video.library/index.html +23 -23
  458. package/app/recipes/voice.profiles/help/index.html +21 -21
  459. package/app/recipes/voice.profiles/index.html +23 -23
  460. package/app/s/custom-accounts/index.html +19 -19
  461. package/app/s/custom-appointments/index.html +19 -19
  462. package/app/s/custom-billing/index.html +19 -19
  463. package/app/s/custom-bookings/index.html +19 -19
  464. package/app/s/custom-buying/index.html +19 -19
  465. package/app/s/custom-checkout/index.html +19 -19
  466. package/app/s/custom-classes/index.html +19 -19
  467. package/app/s/custom-clients/index.html +19 -19
  468. package/app/s/custom-events/index.html +19 -19
  469. package/app/s/custom-fleet/index.html +19 -19
  470. package/app/s/custom-gigs/index.html +19 -19
  471. package/app/s/custom-giving/index.html +19 -19
  472. package/app/s/custom-instruments/index.html +19 -19
  473. package/app/s/custom-jobs/index.html +19 -19
  474. package/app/s/custom-kitchen/index.html +19 -19
  475. package/app/s/custom-lessons/index.html +19 -19
  476. package/app/s/custom-material/index.html +19 -19
  477. package/app/s/custom-meetings/index.html +19 -19
  478. package/app/s/custom-members/index.html +19 -19
  479. package/app/s/custom-merch/index.html +19 -19
  480. package/app/s/custom-money/index.html +19 -19
  481. package/app/s/custom-paint/index.html +19 -19
  482. package/app/s/custom-parts/index.html +19 -19
  483. package/app/s/custom-rentals/index.html +19 -19
  484. package/app/s/custom-roastery/index.html +19 -19
  485. package/app/s/custom-schedule/index.html +19 -19
  486. package/app/s/custom-shelf/index.html +19 -19
  487. package/app/s/custom-shop/index.html +19 -19
  488. package/app/s/custom-students/index.html +19 -19
  489. package/app/s/custom-wholesale/index.html +19 -19
  490. package/app/s/custom-work/index.html +19 -19
  491. package/app/s/custom-yard/index.html +19 -19
  492. package/app/s/section-access-control/index.html +19 -19
  493. package/app/s/section-account-security/index.html +19 -19
  494. package/app/s/section-accounting/index.html +19 -19
  495. package/app/s/section-activity/index.html +19 -19
  496. package/app/s/section-agreements/index.html +19 -19
  497. package/app/s/section-analytics/index.html +19 -19
  498. package/app/s/section-approvals/index.html +19 -19
  499. package/app/s/section-assets/index.html +19 -19
  500. package/app/s/section-billing/index.html +19 -19
  501. package/app/s/section-calendar/index.html +19 -19
  502. package/app/s/section-catalog/index.html +19 -19
  503. package/app/s/section-chat.assistant/index.html +19 -19
  504. package/app/s/section-comments/index.html +19 -19
  505. package/app/s/section-fields.form-customization/index.html +19 -19
  506. package/app/s/section-grow/index.html +19 -19
  507. package/app/s/section-ingestion/index.html +19 -19
  508. package/app/s/section-integrations/index.html +19 -19
  509. package/app/s/section-make/index.html +19 -19
  510. package/app/s/section-messages/index.html +19 -19
  511. package/app/s/section-more/index.html +19 -19
  512. package/app/s/section-operations/index.html +19 -19
  513. package/app/s/section-places/index.html +19 -19
  514. package/app/s/section-projects/index.html +19 -19
  515. package/app/s/section-publish/index.html +19 -19
  516. package/app/s/section-purchasing/index.html +19 -19
  517. package/app/s/section-reports.materialized/index.html +19 -19
  518. package/app/s/section-reports.runtime/index.html +19 -19
  519. package/app/s/section-sales/index.html +19 -19
  520. package/app/s/section-staff/index.html +19 -19
  521. package/app/s/section-support/index.html +19 -19
  522. package/app/s/section-taxonomy/index.html +19 -19
  523. package/app/s/section-team/index.html +19 -19
  524. package/app/s/section-work/index.html +19 -19
  525. package/dist/catalog/catalog.json +39 -39
  526. package/dist/smrt-version.d.ts +1 -1
  527. package/dist/smrt-version.js +1 -1
  528. package/package.json +57 -57
  529. package/app/_app/immutable/chunks/BQxY8kkL.js +0 -1
  530. package/app/_app/immutable/chunks/BYQHpKqY.js +0 -1
  531. package/app/_app/immutable/chunks/Bcfb5I9y.js +0 -2
  532. package/app/_app/immutable/chunks/BdAUBSMe.js +0 -1
  533. package/app/_app/immutable/chunks/C82OMTPv.js +0 -1
  534. package/app/_app/immutable/entry/start.C-zr6uRW.js +0 -1
  535. package/app/_app/immutable/workers/local-speech.worker-CU_DjhLr.js +0 -51
package/app/404.html CHANGED
@@ -3,35 +3,35 @@
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <link href="/_app/immutable/entry/start.C-zr6uRW.js" rel="modulepreload">
7
- <link href="/_app/immutable/chunks/CmO-K8eJ.js" rel="modulepreload">
6
+ <link href="/_app/immutable/entry/start.6TiI-_oR.js" rel="modulepreload">
7
+ <link href="/_app/immutable/chunks/CaTJsbff.js" rel="modulepreload">
8
8
  <link href="/_app/immutable/chunks/DG3qFFTE.js" rel="modulepreload">
9
9
  <link href="/_app/immutable/chunks/COiEfhsA.js" rel="modulepreload">
10
10
  <link href="/_app/immutable/chunks/Dt-HX3Vu.js" rel="modulepreload">
11
- <link href="/_app/immutable/entry/app.BhyntTj6.js" rel="modulepreload">
11
+ <link href="/_app/immutable/entry/app.Ci1kI5es.js" rel="modulepreload">
12
12
  <link href="/_app/immutable/chunks/BaNbYf_w.js" rel="modulepreload">
13
13
  <link href="/_app/immutable/chunks/xihTtKlq.js" rel="modulepreload">
14
- <link href="/_app/immutable/nodes/0.CxPs4-vS.js" rel="modulepreload">
15
- <link href="/_app/immutable/chunks/RBRsUKgn.js" rel="modulepreload">
14
+ <link href="/_app/immutable/nodes/0.Z902gPeD.js" rel="modulepreload">
15
+ <link href="/_app/immutable/chunks/f1wD15Gj.js" rel="modulepreload">
16
16
  <link href="/_app/immutable/chunks/Bq8E3AWP.js" rel="modulepreload">
17
17
  <link href="/_app/immutable/chunks/DK8Blf1Y.js" rel="modulepreload">
18
- <link href="/_app/immutable/chunks/DFqdDA0z.js" rel="modulepreload">
18
+ <link href="/_app/immutable/chunks/CgeTxqIE.js" rel="modulepreload">
19
19
  <link href="/_app/immutable/chunks/BLUInGBV.js" rel="modulepreload">
20
20
  <link href="/_app/immutable/chunks/v8gneLl4.js" rel="modulepreload">
21
21
  <link href="/_app/immutable/chunks/DIE02RSm.js" rel="modulepreload">
22
- <link href="/_app/immutable/chunks/BdAUBSMe.js" rel="modulepreload">
22
+ <link href="/_app/immutable/chunks/D00XWXiM.js" rel="modulepreload">
23
23
  <link href="/_app/immutable/chunks/CUyVrfsu.js" rel="modulepreload">
24
24
  <link href="/_app/immutable/chunks/CGVkRTMI.js" rel="modulepreload">
25
25
  <link href="/_app/immutable/chunks/BYcBM-fh.js" rel="modulepreload">
26
- <link href="/_app/immutable/chunks/BYQHpKqY.js" rel="modulepreload">
27
- <link href="/_app/immutable/chunks/C82OMTPv.js" rel="modulepreload">
28
- <link href="/_app/immutable/chunks/BgSEQhz3.js" rel="modulepreload">
26
+ <link href="/_app/immutable/chunks/CBHn82fo.js" rel="modulepreload">
27
+ <link href="/_app/immutable/chunks/yk0CbPfJ.js" rel="modulepreload">
28
+ <link href="/_app/immutable/chunks/BAwEK5g5.js" rel="modulepreload">
29
29
  <link href="/_app/immutable/chunks/d934w91N.js" rel="modulepreload">
30
- <link href="/_app/immutable/chunks/DlnkaADl.js" rel="modulepreload">
31
- <link href="/_app/immutable/chunks/Da_0GNuu.js" rel="modulepreload">
32
- <link href="/_app/immutable/chunks/DQ2bNQSn.js" rel="modulepreload">
33
- <link href="/_app/immutable/chunks/Daa4F5N1.js" rel="modulepreload">
34
- <link href="/_app/immutable/chunks/IvaX0muk.js" rel="modulepreload">
30
+ <link href="/_app/immutable/chunks/DPhUHp9B.js" rel="modulepreload">
31
+ <link href="/_app/immutable/chunks/D4QMl-tN.js" rel="modulepreload">
32
+ <link href="/_app/immutable/chunks/CijPG3jg.js" rel="modulepreload">
33
+ <link href="/_app/immutable/chunks/DmNUwu-S.js" rel="modulepreload">
34
+ <link href="/_app/immutable/chunks/mQ6O0Tem.js" rel="modulepreload">
35
35
  <link href="/_app/immutable/chunks/BMgzWMdF.js" rel="modulepreload">
36
36
  <link href="/_app/immutable/chunks/CgAkqYsL.js" rel="modulepreload">
37
37
 
@@ -51,15 +51,15 @@
51
51
  <div style="display: contents">
52
52
  <script>
53
53
  {
54
- __sveltekit_1cns6cx = {
54
+ __sveltekit_1meutlc = {
55
55
  base: ""
56
56
  };
57
57
 
58
58
  const element = document.currentScript.parentElement;
59
59
 
60
60
  Promise.all([
61
- import("/_app/immutable/entry/start.C-zr6uRW.js"),
62
- import("/_app/immutable/entry/app.BhyntTj6.js")
61
+ import("/_app/immutable/entry/start.6TiI-_oR.js"),
62
+ import("/_app/immutable/entry/app.Ci1kI5es.js")
63
63
  ]).then(([kit, app]) => {
64
64
  kit.start(app, element);
65
65
  });
@@ -1 +1 @@
1
- import"./DG3qFFTE.js";import{c as e}from"./CmO-K8eJ.js";var t={get data(){return e.data},get error(){return e.error},get form(){return e.form},get params(){return e.params},get route(){return e.route},get state(){return e.state},get status(){return e.status},get url(){return e.url}};export{t};
1
+ import"./DG3qFFTE.js";import{c as e}from"./CaTJsbff.js";var t={get data(){return e.data},get error(){return e.error},get form(){return e.form},get params(){return e.params},get route(){return e.route},get state(){return e.state},get status(){return e.status},get url(){return e.url}};export{t};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dJCEV3u7.js","./DG3qFFTE.js","./COiEfhsA.js","./xihTtKlq.js","./RBRsUKgn.js","./Bq8E3AWP.js","./DK8Blf1Y.js","../assets/currency-metadata.ksbBA8-C.css","../assets/app.CkDD91u6.css","./BETauCCm.js","./BLUInGBV.js","../assets/feedback.nSgE8ogy.css","./DFqdDA0z.js","./BaNbYf_w.js","./v8gneLl4.js","../assets/SegmentedControl.CH_vc242.css","./DIE02RSm.js","../assets/webmcp-ui-context.hO24Ni5w.css","./BdAUBSMe.js","../assets/data.B71l2JEr.css","./CUyVrfsu.js","./CGVkRTMI.js","../assets/forms.Zvn0Ncy0.css","./BYcBM-fh.js","../assets/AppShell.RGlXvmKf.css","./CJCM0Xnh.js","../assets/workspace.C40zM0Mb.css","./BUsBpizP.js","./CiUDI5Ay.js","../assets/state.C0UZEhxS.css","../assets/labels.Gb0NBp4g.css","./DAA-yz6J.js","./C-DHThw2.js","./CNsBPi6n.js","../assets/planner.DOQVfcOi.css","./D_U_DYjx.js"])))=>i.map(i=>d[i]);
2
- import{$ as e,Et as t,Mt as n,bt as r,vt as i}from"./DG3qFFTE.js";import{t as a}from"./BaNbYf_w.js";import"./xihTtKlq.js";import{I as o,L as s,O as c,Q as l,St as u,W as d,Z as f,_ as p,_t as m,bt as h,et as g,h as _,ht as v,p as y,x as b,yt as x}from"./RBRsUKgn.js";import{v as S}from"./DFqdDA0z.js";import"./v8gneLl4.js";import"./DIE02RSm.js";import{u as ee}from"./BdAUBSMe.js";import{A as C,C as te,E as ne,F as re,G as ie,I as ae,M as oe,N as se,O as ce,P as le,T as ue,U as de,V as fe,W as w,b as pe,h as me,j as he,k as ge,n as _e,q as ve,r as ye,w as be}from"./BUsBpizP.js";import{B as xe,D as Se,G as Ce,H as we,J as Te,K as Ee,M as De,V as Oe,X as ke,Y as Ae,Z as je,a as Me,b as T,c as Ne,d as Pe,l as Fe,n as Ie,r as Le,s as Re,t as E,v as ze,x as D,z as Be}from"./CiUDI5Ay.js";function Ve(e){let t=e?.surfaces?.find(e=>e.kind===`widget`&&e.sectionDefault===!0);return t?{id:t.type,type:t.type,span:4,options:{}}:void 0}function He(e){let t=e.lastIndexOf(`#`);if(t<=0||t===e.length-1)return null;let n=e.slice(0,t),r=e.slice(t+1);return n.startsWith(`.`)||n.startsWith(`/`)||/\s/.test(n)||!/^[A-Za-z_$][\w$]*$/.test(r)?null:{specifier:n,exportName:r}}function O(e,t){let n=He(e);return n?Promise.resolve(t(n.specifier,n.exportName)).then(t=>{if(t==null)throw Error(`export "${e}" was not found`);return t}):Promise.reject(Error(`invalid export ref "${e}"`))}function k(e){let t;return()=>(t??=e(),t)}function Ue(e){return typeof e==`object`&&!!e&&`default`in e&&!!e.default}function We(e,t,n){let r=k(()=>O(e.export,t)),i=e.optionsEditor?k(()=>O(e.optionsEditor,t)):void 0,a=e.data?.load?k(()=>O(e.data?.load,t)):void 0,o={type:e.type,title:e.label,options:e.options??[],loadComponent:async()=>{let e=await r();return Ue(e)?e.default:e}};return e.description!==void 0&&(o.description=e.description),e.icon!==void 0&&(o.icon=e.icon),e.version!==void 0&&(o.version=e.version),e.allowedIn&&(o.allowedIn=e.allowedIn),e.defaultSpan!==void 0&&(o.defaultSpan=e.defaultSpan),e.minSpan!==void 0&&(o.minSpan=e.minSpan),e.maxSpan!==void 0&&(o.maxSpan=e.maxSpan),n&&(o.migrate=n),i&&(o.loadOptionsEditor=async()=>{let e=await i();return Ue(e)?e.default:e}),a&&(o.load=async(t,n)=>{let r=await a();if(typeof r!=`function`)throw Error(`loader "${e.data?.load}" is not a function`);return r(t,n)}),o}async function Ge(e,t,n,r={}){let i=[],a=[],o=[];for(let s of t)if(!r.enabled||r.enabled(s.id))for(let t of s.surfaces??[]){if(t.kind!==`widget`)continue;let c=(e,n)=>a.push({recipeId:s.id,type:t.type,reason:e,message:n});if(e.has(t.type)&&!r.replace){c(`duplicate_type`,`"${t.type}" is already registered`);continue}let l;if(t.migrate)try{let e=await O(t.migrate,n);if(typeof e!=`function`)throw Error(`not a function`);l=e}catch(e){c(`unresolved`,`migrate "${t.migrate}": ${e instanceof Error?e.message:String(e)}`);continue}try{o.push(e.register(We(t,n,l),{replace:r.replace})),i.push(t.type)}catch(e){c(`invalid`,e instanceof Error?e.message:String(e))}}return{registered:i,skipped:a,dispose:()=>{for(let e of o.splice(0))e()}}}var Ke=[`identifier`,`status`,`date`,`party`,`total`,`money`];function qe(e){for(let t of[`identifier`,`status`,`date`,`money`,`quantity`,`party`,`title`])if(e.includes(t))return t}function Je(e,t,n={}){let r=new Set(n.exclude??[]),i=n.max??4,a=Object.keys(t).filter(t=>!r.has(t)&&t in e.fields),o=e=>a.find(n=>t[n]?.includes(e)),s=[],c=e=>{e&&!s.includes(e)&&s.push(e)};c(o(`identifier`)??o(`title`));for(let e of Ke)e!==`identifier`&&(e===`money`&&s.some(e=>t[e]?.includes(`money`))||c(e===`date`?a.find(e=>t[e]?.includes(`date`)&&e!==`createdAt`&&e!==`updatedAt`)??o(`date`):o(e)));return s.slice(0,i).map(n=>({key:n,label:A(n,e),...qe(t[n]??[])?{role:qe(t[n]??[])}:{}}))}function Ye(e,t,n={}){let r=new Set(n.exclude??[]),i=Object.keys(t).filter(t=>!r.has(t)&&t in e.fields),a=i.filter(t=>e.fields[t]?.type===`text`),o=a.find(e=>/^(?:description|title|name|label)$/.test(e))??a.find(e=>t[e]?.includes(`title`))??a.find(e=>!t[e]?.includes(`identifier`)),s=i.find(e=>t[e]?.includes(`quantity`)),c=i.filter(e=>t[e]?.includes(`money`)),l=c.find(e=>/unit|price|rate/i.test(e)),u=c.find(e=>/^(?:amount|lineTotal|total|lineAmount)$/.test(e))??[...c].reverse().find(e=>e!==l),d=[];return o&&d.push({key:o,label:A(o,e)}),s&&d.push({key:s,label:A(s,e),role:`quantity`}),l&&d.push({key:l,label:A(l,e),role:`money`,summarize:!1}),u&&u!==l&&d.push({key:u,label:A(u,e),role:`money`}),d}function A(e,t){let n=t.fields[e];return n&&(n.type===`foreignKey`||n.type===`crossPackageRef`)&&/.[a-z]Id$/.test(e)?le(e.slice(0,-2)):le(e)}function Xe(e){if(e.dataWidgets&&e.page)return[e.page];let t=[{id:`shortcuts`,type:`shortcuts`,span:4,options:{}}];if(e.dataWidgets&&e.lead){let n=e.lead,r=e.override,i=r&&typeof r==`object`&&!Array.isArray(r)?r:void 0,a=i?.changed;a&&typeof a==`object`&&!Array.isArray(a)&&Object.hasOwn(a,`count`)&&!(Array.isArray(i?.removed)&&i.removed.includes(`count`))&&t.push({id:`count`,type:`metric`,span:1,options:{title:n.plural,model:n.id,measure:`count`}}),t.push({id:`latest`,type:`records`,span:4,options:{title:`${n.name} records`,model:n.id,limit:5,summaries:!1}})}return t}var Ze=[`text`,`integer`,`decimal`,`boolean`,`datetime`,`json`,`foreignKey`,`crossPackageRef`];function Qe(e){return Ze.includes(e)?e:`text`}var $e=/(Date|^date|period(Start|End))$/;function et(e,t){return t.type===`datetime`&&!t.system&&$e.test(t.name)&&!e.fields.some(e=>e.name===`allDay`)?`date`:void 0}function tt(e){return pe(e)[0]}function nt(e,t){let n=t.ui?{...t.ui}:void 0,r=c(t)?`money`:et(e,t);return{type:Qe(t.type),required:t.required,nullable:!t.required,...t.default===void 0?{}:{default:t.default},...t.description?{description:t.description}:{},...n?{ui:n}:{},...t.enum?.length?{enum:[...t.enum]}:{},...r?{format:r}:{},...tt(e)===t.name?{display:!0}:{}}}function rt(e,t){return e.includes(`:`)?e:`${t.slice(0,t.lastIndexOf(`:`))}:${e}`}function it(e,t){if(!t.related)return!1;let n=rt(t.related,e.id);return Ae(m,n,g).some(t=>t.id===e.id)}function at(e){return e.fields.flatMap(t=>{if(t.type!==`foreignKey`&&t.type!==`crossPackageRef`||!t.related)return[];let n=h(rt(t.related,e.id));return n?[{field:t.name,kind:t.type===`crossPackageRef`?`crossPackageRef`:`foreignKey`,relatedCollection:n.model.collection,...it(e,t)?{role:`items`}:{}}]:[]})}function j(e){let t=at(e);return{name:e.collection,objectRef:e.id,className:e.name,idField:`id`,fields:Object.fromEntries(e.fields.map(t=>[t.name,nt(e,t)])),...t.length?{relationships:t}:{}}}function ot(e,t){return{objectRef:e.id,fields:Object.fromEntries(t.map((e,t)=>[e.name,{visibility:`basic`,label:e.label,help:e.help??null,order:t,required:e.required}]))}}function st(e,t){let n=new Set(t);for(let t of e)for(let e of t.models)n.add(e);return n}function ct(e){return y(e.replace(/_?id$/i,``)||e)}function M(e,t,n){let r=ke(e,t),i=new Set(e.packages.flatMap(e=>(e.recipes??[]).filter(e=>e.exposure===`ui-only`).flatMap(e=>e.models))),a=je(e,t).filter(e=>(e.model.exposed||i.has(e.model.id))&&n.has(e.model.id)),o=new Set(Ae(e,t,g).map(e=>e.id)),s=new Map;for(let e of a)s.set(e.model.id,(s.get(e.model.id)??0)+1);let c=a.map(e=>{let t=o.has(e.model.id)?`items`:`children`,n=j(e.model),i=ae(n),a=[e.fk];return{model:e.model.id,field:e.fk,label:(s.get(e.model.id)??0)>1?`${Ce(e.model.name,r)} (${ct(e.fk).toLowerCase()})`:Ce(e.model.name,r),kind:t,columns:t===`items`?Ye(n,i,{exclude:a}):Je(n,i,{exclude:a,max:5}),...t===`items`&&`sortOrder`in n.fields?{sort:`sortOrder`}:{}}});for(let n of Ee(e,t))c.push({model:n.model.id,field:n.fk,label:ct(n.fk),kind:`reference`});return c}var lt=Symbol(`smrt-cookbook`);function ut(){return t(lt)}function dt(e,t){let{sections:n}=t;if(!n)throw Error(`the cookbook widget context is missing`);let r=typeof e.section==`string`?e.section:``,i=r?n.find(e=>e.id===`section:${r}`||e.id===`custom:${r}`)?.id:t.overviewId;if(!i)throw Error(`unknown section ${r}`);return se(n,i)}function ft(e){return e?async(t,n)=>{let r=dt(t,n);try{let t=await e(n,r.items.map(e=>({...e})));if(!Array.isArray(t))return r;let i=new Set,a=[];for(let e of t){if(!e||typeof e.href!=`string`)continue;let t=typeof e.id==`string`&&e.id?e.id:e.href;i.has(t)&&(t=`${t}#${a.length}`),i.add(t),a.push({...e,id:t})}return{items:a}}catch(e){if(n.signal?.aborted)throw e;return r}}:dt}var pt=new Set([`foreignKey`,`crossPackageRef`]);function N(e,t){return`/m/${e}/${t}/`}function mt(e,t,n,r=`view`){let i=`${N(e,t)}${encodeURIComponent(n)}/`;return r===`edit`?`${i}edit/`:i}function ht(e,t,n,r){return`${N(e,t)}?${encodeURIComponent(n)}=${encodeURIComponent(r)}`}function gt(e,t){let n=new URLSearchParams(e);for(let e of t.fields){if(!pt.has(e.type))continue;let t=n.get(e.name);if(t)return{field:e.name,equals:t}}}function _t(e){return e?.equals===void 0?``:`${encodeURIComponent(e.field)}=${encodeURIComponent(e.equals)}`}var P=e=>typeof e==`number`&&Number.isSafeInteger(e)?e:null,vt=(e,t)=>e.fields.some(e=>e.name===t);function yt(e,t){let n=ae(j(e)),r=te(t,n);return Object.values(r).some(e=>P(e)!==null)?r:void 0}function bt(e,t){return!!e.fields.find(e=>e.name===`status`)?.enum?.includes(`draft`)&&typeof t.status==`string`&&t.status!==``&&t.status!==`draft`}function xt(e,t,n){if(!bt(e,t)||![`subtotal`,`taxAmount`,`totalAmount`,`discountTotal`].every(t=>vt(e,t)))return;let r=P(t.subtotal),i=P(t.taxAmount),a=P(t.totalAmount),o=P(t.discountTotal)??0;if(r===null||i===null||a===null)return;let s=f(t,`exclusive`);return{subtotal:r,discount:o,tax:i,total:a,lineAmountType:s,roundingScope:l(t,`line`),showNetSubtotal:s===`inclusive`,taxes:v(n,s).flatMap(e=>e.taxComponentId?[{taxComponentId:e.taxComponentId,name:e.name,percent:e.percent,taxable:e.taxable,tax:e.tax}]:[])}}var F=fe();function I(e){let{source:t,href:n}=e;if(!t||!n)throw Error(`the planner widget context is missing`);return{source:t,href:n}}function L(e){let t=typeof e==`string`?h(e):void 0;if(!t)throw Error(`unknown model ${String(e)}`);return{model:t.model,packageId:t.pkg.id,path:N(t.pkg.id,t.model.name)}}var R=new Set([`foreignKey`,`crossPackageRef`]);function z(e,t,n){let r=e.filter;if(typeof r!=`string`||r===``)return;if(r!==`parent`)throw Error(`unknown filter ${r}`);let{record:i}=t;if(!i?.id)throw Error(`the parent filter needs a record`);let a=typeof e.parentField==`string`&&e.parentField?e.parentField:e.field,o=typeof a==`string`?a:``,s=n.fields.find(e=>e.name===o);if(!s||!R.has(s.type))throw Error(`${n.name} has no reference field ${o}`);return{field:o,id:i.id}}async function B(e,t,n){return n?e.listWhere(t,n.field,n.id):e.list(t)}function V(e,t,n){return e(n?ht(t.packageId,t.model.name,n.field,n.id):t.path)}var H=e=>typeof e==`number`&&Number.isFinite(e);async function St(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),s=await B(n,a,o),l=V(r,i,o),u=typeof e.measure==`string`?e.measure:``;if(u===`count`||u===``)return{value:s.length,format:`integer`,href:l};let d=a.fields.find(t=>t.name===e.field);if(!d||d.type!==`integer`&&d.type!==`decimal`)throw Error(`${u} needs a numeric field of ${a.name}`);let f=s.map(e=>e[d.name]).filter(H),p=0;if(f.length){if(u===`sum`||u===`avg`)p=f.reduce((e,t)=>e+t,0),u===`avg`&&(p/=f.length);else if(u===`min`)p=Math.min(...f);else if(u===`max`)p=Math.max(...f);else throw Error(`unknown measure ${u}`)}let m=c(d);return{value:m?Math.round(p):p,format:m?`money`:d.type===`integer`?`integer`:`decimal`,...m?{currency:`USD`}:{},href:l}}function Ct(e,t){return H(e)&&H(t)?e-t:String(e??``).localeCompare(String(t??``))}var wt=new Set([`createdAt`,`updatedAt`]),Tt=[`identifier`,`status`,`date`,`money`,`quantity`,`party`,`title`];function Et(e=[]){return Tt.find(t=>e.includes(t))}function Dt(e,t,n,r){let i=j(e),a=r?[r]:[],o=oe(n),s=o.length?[]:me(E.apply(e).fields.filter(t=>!a.includes(t.name)&&!Se(e,t))).filter(e=>!e.derive),c=o.length?o:s.map(e=>e.name),l=[...Ye(i,t,{exclude:a}),...Je(i,t,{exclude:a,max:c.length+8})];return c.map(n=>{let r=e.fields.find(e=>e.name===n);if(!r)throw Error(`${e.name} has no field ${n}`);let i=l.find(e=>e.key===n),a=s.find(e=>e.name===n)?.label;if(i)return a?{...i,label:a}:i;let o=Et(t[n]);return{key:n,label:a??(R.has(r.type)?y(n.replace(/Id$/,``)):y(n)),...o?{role:o}:{}}})}var Ot=new Set([`money`,`quantity`]);function kt(e,t){let n={};for(let r of e)(r.summarize??Ot.has(r.role))&&(n[r.key]=t.reduce((e,t)=>{let n=t[r.key];return H(n)?e+n:e},0));return n}function At(e,t){let n=re(j(e)),r=new Set(t.map(e=>n?e[n]:void 0).filter(e=>typeof e==`string`&&e!==``));return r.size===1?[...r][0]??`USD`:`USD`}async function jt(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),s=await B(n,a,o);if(typeof e.sort==`string`&&e.sort){if(!a.fields.find(t=>t.name===e.sort)&&!wt.has(e.sort))throw Error(`${a.name} has no field ${e.sort}`);let t=s.some(t=>t[e.sort]!==void 0)?e.sort:W(a)?.name;if(t){let n=e.direction===`asc`?1:-1;s=[...s].sort((e,r)=>n*Ct(e[t],r[t]))}}let c=Dt(a,ae(j(a)),e.columns,o?.field),l=H(e.limit)?e.limit:5,u=s.slice(0,l),d=a.fields.filter(e=>R.has(e.type)&&c.some(t=>t.key===e.name)),f=await ye(n,d,u),p=e=>Object.fromEntries(c.map(t=>{let n=e[t.key],r=d.find(e=>e.name===t.key);return r?.related&&typeof n==`string`&&n?[t.key,f.get(_(r.related,n))??``]:[t.key,n??null]})),m=kt(c,s),h=!Te(a);return{rows:await Promise.all(u.map(async e=>({id:String(e.id),title:await _e(n,a,e,0,o?.field),...h?{href:r(mt(i.packageId,a.name,String(e.id)))}:{},cells:p(e)}))),...e.summaries===!1?{}:{total:s.length},...h?{href:V(r,i,o)}:{},columns:c,currency:At(a,s),...Object.keys(m).length?{summaries:m}:{}}}var Mt={"7d":7,"30d":30,"90d":90,"12m":365,all:null},U=864e5;function Nt(e){return e===`7d`||e===`30d`?`day`:e===`90d`?`week`:`month`}function Pt(e,t){let n=new Date(e);if(t===`month`)return Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),1);let r=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate());return t===`week`?r-(n.getUTCDay()+6)%7*U:r}function Ft(e,t){if(t===`month`){let t=new Date(e);return Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,1)}return e+(t===`week`?7:1)*U}function It(e,t){let n=new Date(e).toISOString();return t===`month`?n.slice(0,7):n.slice(0,10)}var Lt=e=>e.type===`datetime`&&!e.system;function W(e){let t=e.fields.filter(Lt);return t.find(e=>/^(issue|order|start|created)/i.test(e.name))??t[0]}function Rt(e){if(typeof e!=`string`&&typeof e!=`number`)return;let t=new Date(e).getTime();return Number.isFinite(t)?t:void 0}async function zt(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),s=typeof e.groupBy==`string`?e.groupBy:``,l=s?a.fields.find(e=>e.name===s):W(a);if(!l)throw Error(s?`${a.name} has no field ${s}`:`${a.name} has no date field to chart; choose a group-by field`);let u=typeof e.measure==`string`?e.measure:``,d;if(u&&u!==`count`){if(u!==`sum`&&u!==`avg`)throw Error(`unknown measure ${u}`);if(d=a.fields.find(t=>t.name===e.field),!d||d.type!==`integer`&&d.type!==`decimal`)throw Error(`${u} needs a numeric field of ${a.name}`)}let f=typeof e.period==`string`?e.period:`30d`;if(!Object.hasOwn(Mt,f))throw Error(`unknown period ${f}`);let p=Mt[f],m=Lt(l),h=m?l:W(a),g=p!==null&&h?b-p*U:-1/0,_=await B(n,a,o);h&&g!==-1/0&&(_=_.filter(e=>{let t=Rt(e[h.name]);return t!==void 0&&t>=g&&t<=b}));let v=new Map,y=(e,t,n)=>{let r=v.get(e)??{key:t,sum:0,n:0};if(d){let e=n[d.name];if(!H(e))return;r.sum+=e}r.n+=1,v.set(e,r)},x=Nt(f);if(m){let e=g===-1/0?Math.min(..._.map(e=>Rt(e[l.name])??b),b):g;for(let t=Pt(e,x);t<=b;t=Ft(t,x))v.set(It(t,x),{key:t,sum:0,n:0});for(let e of _){let t=Rt(e[l.name]);if(t===void 0)continue;let n=Pt(t,x);y(It(n,x),n,e)}}else for(let e of _){let t=e[l.name],n=t==null||t===``?`(none)`:String(t);y(n,n,e)}let S=d?c(d):!1,ee=e=>{if(!d)return e.n;let t=u===`avg`&&e.n?e.sum/e.n:e.sum;return S?Math.round(t):t},C=[...v.entries()].map(([e,t])=>({label:e,value:ee(t),key:t.key}));return C=m?C.sort((e,t)=>Number(e.key)-Number(t.key)):C.sort((e,t)=>t.value-e.value||e.label.localeCompare(t.label)),{points:C.map(({label:e,value:t})=>({label:e,value:t})),format:d?S?`money`:d.type===`integer`?`integer`:`decimal`:`integer`,...S?{currency:`USD`}:{},href:V(r,i,o)}}ne(F,{metric:St,records:jt,chart:zt,shortcuts:async(e,t)=>t,shortcuts:ft()});function Bt(e){let{relations:t,viewAllHref:n}=e;if(!t)throw Error(`the record page context is missing`);return{relations:t,records:jt,viewAllHref:n}}async function Vt(e,t){let{source:n}=I(e),r=e.record;if(!r?.id)throw Error(`line items need a record`);let{model:i}=L(r.model),a=await n.get(i,r.id);if(!a)return{};let o=t.find(e=>e.kind===`items`),s=o?h(o.model)?.model:void 0,c=xt(i,a,o&&s?await n.listWhere(s,o.field,r.id):[]),l=c?void 0:yt(i,a),u=re(j(i)),d=u?a[u]:void 0;return{...c?{storedTotals:c}:{},...l?{totals:l}:{},...typeof d==`string`&&d?{currency:d}:{}}}F.register(ue((e,t)=>ge(Bt(t))(e,t))),F.register(be(async(e,t)=>{let n=Bt(t),{totals:r,storedTotals:i,currency:a}=await Vt(t,n.relations);return ce({...n,totals:()=>r,storedTotals:()=>i,currency:()=>a})(e,t)}));var Ht=[`shortcuts`,`metric`,`records`,`chart`,`note`],Ut={"@happyvertical/smrt-reports/svelte":async()=>({SavedReportsWidget:(await a(async()=>{let{default:e}=await import(`./dJCEV3u7.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35]),import.meta.url)).default})},Wt=async(e,t)=>{let n=Ut[e];if(n)return(await n())[t]},Gt=T.filter(e=>e.surfaces?.some(e=>e.kind===`widget`)),Kt=Gt.flatMap(e=>(e.surfaces??[]).flatMap(e=>e.kind===`widget`?[e.type]:[]));Ge(F,Gt,Wt);var qt=new Map(Be(T).map(e=>[`section:${e.id}`,e])),Jt=m.packages.flatMap(e=>e.models.map(e=>e.id)),Yt=[...Ht,...Kt];function Xt(e){let t=qt.get(e);for(let e of t?.recipes??[]){let t=ze(e)[0];if(t)return{id:t.model.id,name:y(t.model.name)}}}function Zt(e,t){let n=Ve(qt.get(e)?.recipes[0]),r=Xt(e);return Xe({lead:r?{...r,plural:p(r.name)}:void 0,dataWidgets:!0,page:n&&Kt.includes(n.type)?n:void 0,override:t})}var Qt=new Map;function $t(e,t){if(!ve.test(e))return;let n=Qt.get(e);return n||(n=w({id:e,allowed:Yt,models:Jt,defaults:Zt(e)}),Qt.set(e,n)),t===void 0?n:w({...n,defaults:Zt(e,t)})}function en(e,t){return`detail:${e}.${t}`}var tn=new Map(m.packages.flatMap(e=>e.models.filter(u).map(t=>[he(t.id),{packageId:e.id,model:t}])));function nn(e){let[,t,n]=/^detail:([A-Za-z0-9_-]+)\.([A-Za-z0-9_]+)$/.exec(e)??[],r=t&&n?x(t,n):void 0;return t&&r&&u(r)?{packageId:t,model:r}:tn.get(e)}var rn=new Set(m.packages.flatMap(e=>e.models.filter(u).map(e=>e.id))),an=new Map;function on(e){let t=an.get(e);if(t)return t;let n=nn(e);if(!n)return;let r=M(m,n.model.id,rn),i=C(j(n.model),r,{id:e,maxMetrics:2*r.length});return t=w({...i,maxWidgets:Math.max(i.maxWidgets??24,i.defaults.length+24)}),an.set(e,t),t}function sn(e,t){let n=on(e),r=nn(e);if(!n||!r)return;let i=M(m,r.model.id,t),a=0,o=n.defaults.filter(e=>e.type===`line-items`?i.some(e=>e.kind===`items`):e.type===`related`?i.some(e=>e.kind===`children`):t.has(String(e.options.model))?e.type!==`metric`||(a+=1,a<=4):!1);return w({...n,defaults:o})}function cn(e,t){return e.startsWith(`detail:`)?on(e):$t(e,t)}function ln(e,t){return qt.has(e)||e===`section:${De.id}`?!0:e.startsWith(`detail:`)?nn(e)!==void 0:e.startsWith(`custom:`)&&ve.test(e)&&(t?.customSections??[]).some(t=>t.id===e)}var un=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function dn(e,t){let n=t.widgetId?`widget ${t.widgetId}${t.type?` (${t.type})`:``}`:`an entry`,r=t.options?.length?`: ${t.options.map(e=>`${e.key} ${e.code}`).join(`, `)}`:``;return`Overview ${e}: ${n} was dropped (${t.code}${r}).`}function fn(e,t){let n={...e};return e.added&&(n.added=e.added.filter(e=>!t.has(e.id))),e.changed&&(n.changed=Object.fromEntries(Object.entries(e.changed).filter(([e])=>!t.has(e)))),n}function pn(e,t){let n=cn(e,t);if(!n)return{override:null,issues:[{widgetId:null,type:null,code:`malformed`,message:`not an overview id`}]};let r=de(n,t,F);if(r.ok){let e=ie(t).override?.changed?.count;return e&&n.defaults.some(e=>e.id===`count`)?{override:{...r.override??{version:1},changed:{...r.override?.changed,count:e}},issues:[]}:{override:r.override,issues:[]}}let i=ie(t),a=new Set(r.issues.flatMap(e=>e.widgetId?[e.widgetId]:[]));if(!i.override)return{override:null,issues:r.issues};let o=de(n,fn(i.override,a),F);return o.ok?{override:o.override,issues:r.issues}:{override:null,issues:[...r.issues,...o.issues]}}function mn(e,t){if(!un(e))return null;let n=[],r=[];for(let i of Object.keys(e).sort()){if(!ln(i,t)){r.push(`Overview ${i} is not a page in this app and was dropped.`);continue}let{override:a,issues:o}=pn(i,e[i]);for(let e of o)r.push(dn(i,e));a&&n.push([i,a])}return{overviews:Object.fromEntries(n),dropped:r}}var hn=ee,gn=`glass`,_n=`system`,vn=[`light`,`dark`,`system`],yn=[`none`,`sm`,`md`,`lg`,`xl`,`full`],bn=[`comfortable`,`touch`],xn=[`auto`,`standard`,`more`],G={"system-ui":`system-ui, -apple-system, "Segoe UI", sans-serif`,Inter:`Inter, system-ui, sans-serif`,Georgia:`Georgia, "Times New Roman", serif`,"ui-rounded":`ui-rounded, "SF Pro Rounded", system-ui, sans-serif`,"ui-monospace":`ui-monospace, "SF Mono", Menlo, monospace`},Sn=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i;function Cn(e){if(typeof e!=`string`)return null;let t=Sn.exec(e.trim());if(!t)return null;let n=t[1].toLowerCase();return n.length===3&&(n=[...n].map(e=>e+e).join(``)),`#${n}`}var wn=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function Tn(e){if(e===void 0)return{ok:!0,theme:void 0};if(!wn(e))return{ok:!1,error:`The cookbook "theme" must be an object.`};let t={};if(e.preset!==void 0){if(typeof e.preset!=`string`||!hn.includes(e.preset))return{ok:!1,error:`The theme preset must be one of ${hn.join(`, `)}.`};t.preset=e.preset}if(e.colorScheme!==void 0){if(!vn.includes(e.colorScheme))return{ok:!1,error:`The theme colorScheme must be light, dark or system.`};t.colorScheme=e.colorScheme}for(let[n,r]of[[`borderRadius`,yn],[`density`,bn],[`contrast`,xn]]){let i=e[n];if(i!==void 0){if(!r.includes(i))return{ok:!1,error:`The theme ${n} must be one of ${r.join(`, `)}.`};t[n]=i}}if(e.fontFamily!==void 0){if(typeof e.fontFamily!=`string`||!Object.hasOwn(G,e.fontFamily))return{ok:!1,error:`The theme font must be one of ${Object.keys(G).join(`, `)}.`};t.fontFamily=e.fontFamily}if(e.custom!==void 0){if(!wn(e.custom))return{ok:!1,error:`The theme "custom" must be an object.`};let n=Cn(e.custom.primary);if(!n)return{ok:!1,error:`The theme custom primary must be a hex colour like #c2410c.`};let r={primary:n};if(e.custom.fontFamily!==void 0){let t=e.custom.fontFamily;if(typeof t!=`string`||!Object.hasOwn(G,t))return{ok:!1,error:`The theme font must be one of ${Object.keys(G).join(`, `)}.`};r.fontFamily=t}t.custom=r}if(e.customCss!==void 0){if(typeof e.customCss!=`string`)return{ok:!1,error:`The theme customCss must be a string.`};if(Array.from(e.customCss).length>65536)return{ok:!1,error:`The theme customCss is too long (65,536 characters maximum).`};e.customCss&&(t.customCss=e.customCss)}return{ok:!0,theme:Object.keys(t).length?t:void 0}}function En(e){if(!e)return;let t={};return e.preset&&(t.preset=e.preset),e.colorScheme&&(t.colorScheme=e.colorScheme),e.borderRadius&&(t.borderRadius=e.borderRadius),e.density&&(t.density=e.density),e.contrast&&(t.contrast=e.contrast),e.fontFamily&&(t.fontFamily=e.fontFamily),e.custom&&(t.custom={...e.custom}),e.customCss&&(t.customCss=e.customCss),Object.keys(t).length?t:void 0}function Dn(e){let t=e?.colorScheme??`system`,n=e?.custom?`brand colour ${e.custom.primary}`:e?.preset??`glass`;return t===`system`?n:`${n}, ${t}`}var K=`section:`;function On(e,t=xe(T)){let n=Object.keys(t).sort((e,t)=>t.length-e.length);if(!n.length)return e;let r=e=>{if(!e.startsWith(K))return e;let r=e.slice(8);for(let e of n){if(r===e)return`${K}${t[e]}`;if(r.startsWith(`${e}:`))return`${K}${t[e]}${r.slice(e.length)}`}return e},i=e=>e.startsWith(K)&&n.includes(e.slice(8)),a=e=>[...new Set(e)],o={...e};if(e.sectionOrder&&(o.sectionOrder=a(e.sectionOrder.map(r))),e.hidden&&(o.hidden=a(e.hidden.filter(e=>!i(e)).map(r))),e.itemOrder){let t={};for(let[n,i]of Object.entries(e.itemOrder)){let e=r(n);t[e]=a([...t[e]??[],...i.map(r)])}o.itemOrder=t}return e.moved&&(o.moved=Object.fromEntries(Object.entries(e.moved).map(([e,t])=>[r(e),r(t)]))),o}function kn(e,t=T){let n=new Map;for(let e of t){let t=we(e).id;for(let r of ze(e))r.key&&n.set(`${K}${t}:${r.packageId}:${r.model.name}:${r.label}`,Oe(r.packageId,r.model.name,r.key))}let r=e=>{let t=n.get(e);if(t)return t;if(!e.startsWith(K))return e;let r=e.slice(8).split(`:`);return r.length<3||!r[1]||!r[2]?e:Oe(r[1],r[2])},i=e=>[...new Set(e)],a=(e,t)=>{let n={};for(let[i,a]of Object.entries(e)){let e=r(i);e in n||(n[e]=t(a))}return n},o={...e};return e.hidden&&(o.hidden=i(e.hidden.map(r))),e.itemOrder&&(o.itemOrder=a(e.itemOrder,e=>i(e.map(r)))),e.moved&&(o.moved=a(e.moved,r)),e.items&&(o.items=a(e.items,e=>e)),o}var q=`https://s-m-r-t.dev/schemas/cookbook/v1.json`,An=new Set([`basic`,`advanced`,`hidden`]),jn=new Set([`api`,`mcp`,`cli`]),J=e=>({ok:!1,error:e}),Y=e=>typeof e==`object`&&!!e&&!Array.isArray(e),X=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`);function Mn(e,t){if(!Y(e))return`${t} is not an object`;let{objectRef:n,fieldName:r}=e;if(typeof n!=`string`||!n)return`${t} has no objectRef`;if(typeof r!=`string`||!r)return`${t} has no fieldName`;if(e.scopeType!==`app`)return`${t} must have scopeType "app"`;let i={objectRef:n,fieldName:r,scopeType:`app`};for(let n of[`defaultValue`,`help`,`label`]){let r=e[n];if(r!==void 0){if(typeof r!=`string`&&r!==null)return`${t}.${n} is invalid`;i[n]=r}}if(e.visibility!==void 0){let n=e.visibility;if(n!==null&&!(typeof n==`string`&&An.has(n)))return`${t}.visibility is invalid`;i.visibility=n}if(e.displayOrder!==void 0){let n=e.displayOrder;if(n!==null&&!(typeof n==`number`&&Number.isFinite(n)))return`${t}.displayOrder is invalid`;i.displayOrder=n}if(e.locked!==void 0){if(e.locked!==null&&typeof e.locked!=`boolean`)return`${t}.locked is invalid`;i.locked=e.locked}return i}function Nn(e){if(!Y(e)||e.version!==1)return`layout must be an object with version 1`;for(let t of[`sectionOrder`,`hidden`])if(e[t]!==void 0&&!X(e[t]))return`layout.${t} must be a list of strings`;for(let t of[`itemOrder`,`moved`,`panels`])if(e[t]!==void 0&&!Y(e[t]))return`layout.${t} must be an object`;let t=e.itemOrder;if(Y(t)){for(let[e,n]of Object.entries(t))if(e===`__proto__`||!X(n))return`layout.itemOrder.${e} must be a list of strings`}let n=e.moved;if(Y(n)){for(let[e,t]of Object.entries(n))if(e===`__proto__`||typeof t!=`string`)return`layout.moved.${e} must be a string`}return e}function Pn(e,t={}){if(!Y(e))return J(`This is not a cookbook: expected a JSON object.`);if(e.$schema!==void 0&&e.$schema!==`https://s-m-r-t.dev/schemas/cookbook/v1.json`&&e.$schema!==`https://s-m-r-t.dev/schemas/blueprint/v1.json`)return J(`This is not a cookbook: its "$schema" is not a cookbook schema this planner knows.`);let{version:n}=e;if(n===void 0)return J(`This is not a cookbook: it has no "version".`);if(typeof n!=`number`||!Number.isInteger(n))return J(`The cookbook "version" must be a whole number.`);if(n>1)return J(`This cookbook is version ${n}, newer than this planner understands (1). Update the planner or re-export it.`);if(n!==1)return J(`Cookbook version ${n} is not supported (this planner reads version 1).`);if(!X(e.recipes))return J(`The cookbook "recipes" must be a list of recipe ids.`);let r=e.recipes.filter(e=>!D.has(e)),i=[...new Set([...Me(e.recipes.filter(e=>D.has(e)),D),...r])].sort(),a=[];if(e.features!==void 0){if(!X(e.features))return J(`The cookbook "features" must be a list of model names.`);let t=new Set;for(let n of e.features){if(t.has(n))return J(`The cookbook lists the feature ${n} more than once.`);t.add(n)}a=[...e.features].sort()}let o=new Set([...i.flatMap(e=>D.get(e)?.models??[]),...a]);if(!Array.isArray(e.policies))return J(`The cookbook "policies" must be a list.`);let s=[];for(let[t,n]of e.policies.entries()){let e=Mn(n,`policies[${t}]`);if(typeof e==`string`)return J(`Invalid cookbook: ${e}.`);(o.has(e.objectRef)||Ne(e))&&s.push(e)}let c;if(e.exposure!==void 0){if(!Y(e.exposure))return J(`The cookbook "exposure" must be an object.`);let t=[];for(let[n,r]of Object.entries(e.exposure)){if(!X(r)||!r.every(e=>jn.has(e)))return J(`Invalid cookbook: exposure for ${n} must list api, mcp or cli.`);r.length&&o.has(n)&&t.push([n,[...r]])}c=Object.fromEntries(t)}let l;if(e.layout!==void 0){let t=Nn(e.layout);if(typeof t==`string`)return J(`Invalid cookbook: ${t}.`);l=kn(On(t))}let u;if(e.theme!==void 0){let n=Tn(e.theme);if(n.ok)u=n.theme;else if(!t.dropUnknownRecipes)return J(n.error)}let d,f=[];if(e.overviews!==void 0){if(t.overviews){let n=t.overviews(e.overviews,l);if(!n)return J(`The cookbook "overviews" must be an object.`);d=n.overviews,f=n.dropped}else{if(!Y(e.overviews))return J(`The cookbook "overviews" must be an object.`);Object.keys(e.overviews).length&&(f=[`Page customisations (overviews) are not kept by this host and were dropped.`])}}let p={$schema:q,version:1,recipes:i,features:a,policies:s};for(let t of[`name`,`description`]){let n=e[t];if(n!==void 0){if(typeof n!=`string`)return J(`The cookbook "${t}" must be a string.`);n.trim()&&(p[t]=n.trim())}}if(e.specs!==void 0){if(typeof e.specs!=`string`)return J(`The cookbook "specs" must be a string.`);e.specs.trim()&&(p.specs=e.specs.trim())}return c&&Object.keys(c).length&&(p.exposure=c),l&&(p.layout=l),u&&(p.theme=u),d&&Object.keys(d).length&&(p.overviews=d),f.length?{ok:!0,cookbook:p,dropped:f}:{ok:!0,cookbook:p}}var Fn=e=>({ok:!1,error:e});function In(e,t={}){return Pn(e,{...t,overviews:mn})}function Ln(e,t={}){let n;try{n=JSON.parse(e)}catch{return Fn(`This file is not valid JSON.`)}try{return In(n,t)}catch{return Fn(`This file is not a valid cookbook.`)}}var Z=`smrt-planner:cookbook-doc:v1`,Rn=`smrt-planner:blueprint:v1`,zn=`smrt-planner:cookbook-doc:unreadable`;function Bn(){try{return globalThis.localStorage??null}catch{return null}}function Vn(e){if(!e)return{status:`unavailable`};let t;try{t=e.getItem(Z)}catch{return{status:`unavailable`}}let n=null;try{n=e.getItem(Rn)}catch{}let r=t===null&&n!==null,i=r?n:t;if(i===null)return{status:`empty`};let a=Ln(i,{dropUnknownRecipes:!0});if(a.ok)return r&&Q(e,Z,JSON.stringify(a.cookbook)),{status:`loaded`,cookbook:a.cookbook,previousKept:n!==null,...a.dropped?{dropped:a.dropped}:{}};t=i;let o=Q(e,zn,t);return{status:`unreadable`,reason:a.error,keptAside:o}}function Q(e,t,n){if(!e)return!1;try{return e.setItem(t,n),!0}catch{return!1}}function Hn(e,t){if(!e)return!1;try{return e.removeItem(t),!0}catch{return!1}}function Un(e,t){return Q(e,Z,JSON.stringify(t))}function Wn(e,t={}){let n={$schema:q,version:1,...Ie(e)};t.name&&(n.name=t.name),t.description&&(n.description=t.description),t.specs&&(n.specs=t.specs),t.layout&&(n.layout=t.layout);let r=En(t.theme);r&&(n.theme=r);let i=t.overviews??{},a=Object.keys(i).sort();return a.length&&(n.overviews=Object.fromEntries(a.map(e=>[e,i[e]]))),n}var Gn=new Set([`basic`,`advanced`,`hidden`]),Kn=new Set([`api`,`mcp`,`cli`]);function qn(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t+`=`.repeat((4-t.length%4)%4));return new TextDecoder().decode(Uint8Array.from(n,e=>e.charCodeAt(0)))}function Jn(e){let t=new URLSearchParams(e);return t.has(`r`)||t.has(`o`)}function Yn(e){let t={rows:[],narrowed:{}};if(!e)return t;let n;try{n=JSON.parse(qn(e))}catch{return t}if(!n||typeof n!=`object`)return t;let r=[];for(let[e,t]of Object.entries(n.r??{}))if(t&&typeof t==`object`)for(let[n,i]of Object.entries(t)){if(!i||typeof i!=`object`)continue;let t={objectRef:e,fieldName:n,scopeType:`app`};typeof i.v==`string`&&Gn.has(i.v)&&(t.visibility=i.v),typeof i.l==`string`&&(t.label=i.l),(typeof i.h==`string`||i.h===null)&&(t.help=i.h),(typeof i.d==`string`||i.d===null)&&(t.defaultValue=i.d),typeof i.o==`number`&&Number.isFinite(i.o)&&(t.displayOrder=i.o),typeof i.k==`boolean`&&(t.locked=i.k),r.push(t)}let i={};for(let[e,t]of Object.entries(n.x??{})){if(!Array.isArray(t))continue;let n=t.filter(e=>Kn.has(e));n.length&&(i[e]=n)}return{rows:r,narrowed:i}}function Xn(e){let t=new URLSearchParams(e),n=(t.get(`r`)??``).split(`,`).filter(Boolean),r=Me(Le(n,D),D),i=new Set(r.flatMap(e=>D.get(e)?.models??[])),{rows:a,narrowed:o}=Yn(t.get(`o`)??``),s={$schema:q,version:1,recipes:r,features:[],policies:a.filter(e=>i.has(e.objectRef))},c=Object.fromEntries(Object.entries(o).filter(([e])=>i.has(e)));return Object.keys(c).length&&(s.exposure=c),s}var Zn=`smrt-planner:shell`;function $(e){let t=Fe(e),n=e.policies.some(e=>e.defaultValue!==void 0&&Ne(e));s(Re(e)||n?t.taxRate:void 0),o({pricesIncludeTax:t.pricesIncludeTax,taxRounding:t.taxRounding,currency:t.currency})}var Qn=new class{#e=r(0);get replacementGeneration(){return e(this.#e)}set replacementGeneration(e){i(this.#e,e,!0)}#t=r();get layout(){return e(this.#t)}set layout(e){i(this.#t,e,!0)}#n=r();get name(){return e(this.#n)}set name(e){i(this.#n,e,!0)}#r=r();get description(){return e(this.#r)}set description(e){i(this.#r,e,!0)}#i=r();get specs(){return e(this.#i)}set specs(e){i(this.#i,e,!0)}#a=r();get theme(){return e(this.#a)}set theme(e){i(this.#a,e,!0)}#o=r({});get overviews(){return e(this.#o)}set overviews(e){i(this.#o,e)}#s=r(`unknown`);get persist(){return e(this.#s)}set persist(e){i(this.#s,e,!0)}#c=r(!1);get loaded(){return e(this.#c)}set loaded(e){i(this.#c,e,!0)}hostManaged=!1;#l=r(``);get loadNotice(){return e(this.#l)}set loadNotice(e){i(this.#l,e,!0)}saveBlocked=!1;#u=r(!1);get keepLegacyUrl(){return e(this.#u)}set keepLegacyUrl(e){i(this.#u,e,!0)}replacedBeforeLoad=!1;previousKept=!1;storage=null;timer;snapshot(){return Wn(n(E.data),{layout:n(this.layout),theme:n(this.theme),overviews:n(this.overviews),name:this.name,description:this.description,specs:this.specs})}overview(e){return Object.hasOwn(this.overviews,e)?this.overviews[e]:null}setOverview(e,t){let n=Object.fromEntries(Object.entries(this.overviews).filter(([t])=>t!==e));t&&(n[e]=t),this.overviews=n}setLayout(e){this.layout=S(e)?void 0:e}setSpecs(e){let t=e.trimEnd();this.specs=t.trim()?t:void 0}apply(e){E.load(e),this.layout=e.layout,this.theme=e.theme,this.name=e.name,this.description=e.description,this.specs=e.specs,this.overviews={...e.overviews??{}},$(e)}get unavailableNotice(){let e=[...E.unavailableRecipes,...E.unavailableFeatures];if(!e.length)return``;let t=e.length;return`${t} ${t===1?`recipe`:`recipes`} in this cookbook ${t===1?`isn't`:`aren't`} available in this version: ${e.join(`, `)}. They are kept when you save or export.`}removeUnavailable(){E.removeUnavailable(),this.scheduleSave()}setTheme(e){this.theme=En(e)}settings(){return Fe(this.snapshot())}setSettings(e){let t=Pe(this.snapshot(),e);E.rows=t.policies.map(e=>({...e})),$(t)}replace(e){this.replacementGeneration++,this.apply(e),this.loaded||(this.replacedBeforeLoad=!0),this.saveBlocked=!1,this.keepLegacyUrl=!1}reset(e={}){this.replacementGeneration++,E.clear(),$({policies:[]}),this.layout=void 0,e.preserveTheme||(this.theme=void 0),this.name=void 0,this.description=void 0,this.specs=void 0,this.overviews={},this.saveBlocked=!1,this.keepLegacyUrl=!1}importText(e){let t=Ln(e);return t.ok&&this.replace(t.cookbook),t}hydrate(e,t=d()){this.storage=t;let n=Vn(t);n.status===`loaded`&&(this.previousKept=n.previousKept),n.status===`loaded`&&!this.replacedBeforeLoad?(this.apply(n.cookbook),n.dropped?.length&&(this.loadNotice=`Some saved page customisations could not be used and were removed: ${n.dropped.join(` `)}`)):n.status===`unreadable`&&(this.saveBlocked=!n.keptAside,this.loadNotice=n.keptAside?`The saved cookbook could not be read (${n.reason}) and was kept aside; starting empty.`:`The saved cookbook could not be read (${n.reason}). Starting empty without overwriting it; import or reset to save again.`);let r=!1;if(Jn(e)&&(n.status===`loaded`&&!Q(t,`smrt-planner:cookbook-doc:backup`,JSON.stringify(n.cookbook))&&(this.saveBlocked=!0),this.apply(Xn(e)),r=!0),this.persist=n.status===`unavailable`?`memory`:`unknown`,this.loaded=!0,r){let e=this.save();this.keepLegacyUrl=!e}return r}save(){if(clearTimeout(this.timer),this.timer=void 0,!this.loaded)return!1;if(this.hostManaged)return!0;if(this.saveBlocked)return this.persist=`memory`,!1;let e=Un(this.storage,this.snapshot());return this.persist=e?`ok`:`memory`,e&&this.previousKept&&(this.previousKept=!Hn(this.storage,Rn)),e&&(this.keepLegacyUrl=!1),e}scheduleSave(){this.loaded&&!this.hostManaged&&(clearTimeout(this.timer),this.timer=setTimeout(()=>this.save(),300))}flush(){this.timer!==void 0&&this.save()}};export{j as A,N as C,ut as D,mt as E,st as O,ht as S,_t as T,Cn as _,Bn as a,$t as b,q as c,_n as d,gn as f,Dn as g,hn as h,Z as i,ot as j,M as k,yn as l,G as m,Qn as n,In as o,bn as p,$ as r,Ln as s,Zn as t,xn as u,sn as v,gt as w,F as x,en as y};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Bikltb61.js","./DG3qFFTE.js","./COiEfhsA.js","./xihTtKlq.js","./f1wD15Gj.js","./Bq8E3AWP.js","./DK8Blf1Y.js","../assets/currency-metadata.ksbBA8-C.css","../assets/app.CkDD91u6.css","./CrCEAfXG.js","./BLUInGBV.js","../assets/feedback.nSgE8ogy.css","./CgeTxqIE.js","./BaNbYf_w.js","./v8gneLl4.js","../assets/SegmentedControl.CH_vc242.css","./DIE02RSm.js","../assets/webmcp-ui-context.hO24Ni5w.css","./D00XWXiM.js","../assets/data.B71l2JEr.css","./CUyVrfsu.js","./CGVkRTMI.js","../assets/forms.Zvn0Ncy0.css","./BYcBM-fh.js","../assets/AppShell.RGlXvmKf.css","./Ds81oecv.js","../assets/workspace.C40zM0Mb.css","./CUNj1yy1.js","./D75d6u7q.js","../assets/state.C0UZEhxS.css","../assets/labels.Gb0NBp4g.css","./BytZpJV4.js","./DwJwsALF.js","./DVHELJ71.js","../assets/planner.DOQVfcOi.css","./D_U_DYjx.js"])))=>i.map(i=>d[i]);
2
+ import{$ as e,Et as t,Mt as n,bt as r,vt as i}from"./DG3qFFTE.js";import{t as a}from"./BaNbYf_w.js";import"./xihTtKlq.js";import{I as o,L as s,O as c,Q as l,St as u,W as d,Z as f,_ as p,_t as m,bt as h,et as g,h as _,ht as v,p as y,x as b,yt as x}from"./f1wD15Gj.js";import{v as S}from"./CgeTxqIE.js";import"./v8gneLl4.js";import"./DIE02RSm.js";import{u as ee}from"./D00XWXiM.js";import{A as C,C as te,E as ne,F as re,G as ie,I as ae,M as oe,N as se,O as ce,P as le,T as ue,U as de,V as fe,W as w,b as pe,h as me,j as he,k as ge,n as _e,q as ve,r as ye,w as be}from"./CUNj1yy1.js";import{B as xe,D as Se,G as Ce,H as we,J as Te,K as Ee,M as De,V as Oe,X as ke,Y as Ae,Z as je,a as Me,b as T,c as Ne,d as Pe,l as Fe,n as Ie,r as Le,s as Re,t as E,v as ze,x as D,z as Be}from"./D75d6u7q.js";function Ve(e){let t=e?.surfaces?.find(e=>e.kind===`widget`&&e.sectionDefault===!0);return t?{id:t.type,type:t.type,span:4,options:{}}:void 0}function He(e){let t=e.lastIndexOf(`#`);if(t<=0||t===e.length-1)return null;let n=e.slice(0,t),r=e.slice(t+1);return n.startsWith(`.`)||n.startsWith(`/`)||/\s/.test(n)||!/^[A-Za-z_$][\w$]*$/.test(r)?null:{specifier:n,exportName:r}}function O(e,t){let n=He(e);return n?Promise.resolve(t(n.specifier,n.exportName)).then(t=>{if(t==null)throw Error(`export "${e}" was not found`);return t}):Promise.reject(Error(`invalid export ref "${e}"`))}function k(e){let t;return()=>(t??=e(),t)}function Ue(e){return typeof e==`object`&&!!e&&`default`in e&&!!e.default}function We(e,t,n){let r=k(()=>O(e.export,t)),i=e.optionsEditor?k(()=>O(e.optionsEditor,t)):void 0,a=e.data?.load?k(()=>O(e.data?.load,t)):void 0,o={type:e.type,title:e.label,options:e.options??[],loadComponent:async()=>{let e=await r();return Ue(e)?e.default:e}};return e.description!==void 0&&(o.description=e.description),e.icon!==void 0&&(o.icon=e.icon),e.version!==void 0&&(o.version=e.version),e.allowedIn&&(o.allowedIn=e.allowedIn),e.defaultSpan!==void 0&&(o.defaultSpan=e.defaultSpan),e.minSpan!==void 0&&(o.minSpan=e.minSpan),e.maxSpan!==void 0&&(o.maxSpan=e.maxSpan),n&&(o.migrate=n),i&&(o.loadOptionsEditor=async()=>{let e=await i();return Ue(e)?e.default:e}),a&&(o.load=async(t,n)=>{let r=await a();if(typeof r!=`function`)throw Error(`loader "${e.data?.load}" is not a function`);return r(t,n)}),o}async function Ge(e,t,n,r={}){let i=[],a=[],o=[];for(let s of t)if(!r.enabled||r.enabled(s.id))for(let t of s.surfaces??[]){if(t.kind!==`widget`)continue;let c=(e,n)=>a.push({recipeId:s.id,type:t.type,reason:e,message:n});if(e.has(t.type)&&!r.replace){c(`duplicate_type`,`"${t.type}" is already registered`);continue}let l;if(t.migrate)try{let e=await O(t.migrate,n);if(typeof e!=`function`)throw Error(`not a function`);l=e}catch(e){c(`unresolved`,`migrate "${t.migrate}": ${e instanceof Error?e.message:String(e)}`);continue}try{o.push(e.register(We(t,n,l),{replace:r.replace})),i.push(t.type)}catch(e){c(`invalid`,e instanceof Error?e.message:String(e))}}return{registered:i,skipped:a,dispose:()=>{for(let e of o.splice(0))e()}}}var Ke=[`identifier`,`status`,`date`,`party`,`total`,`money`];function qe(e){for(let t of[`identifier`,`status`,`date`,`money`,`quantity`,`party`,`title`])if(e.includes(t))return t}function Je(e,t,n={}){let r=new Set(n.exclude??[]),i=n.max??4,a=Object.keys(t).filter(t=>!r.has(t)&&t in e.fields),o=e=>a.find(n=>t[n]?.includes(e)),s=[],c=e=>{e&&!s.includes(e)&&s.push(e)};c(o(`identifier`)??o(`title`));for(let e of Ke)e!==`identifier`&&(e===`money`&&s.some(e=>t[e]?.includes(`money`))||c(e===`date`?a.find(e=>t[e]?.includes(`date`)&&e!==`createdAt`&&e!==`updatedAt`)??o(`date`):o(e)));return s.slice(0,i).map(n=>({key:n,label:A(n,e),...qe(t[n]??[])?{role:qe(t[n]??[])}:{}}))}function Ye(e,t,n={}){let r=new Set(n.exclude??[]),i=Object.keys(t).filter(t=>!r.has(t)&&t in e.fields),a=i.filter(t=>e.fields[t]?.type===`text`),o=a.find(e=>/^(?:description|title|name|label)$/.test(e))??a.find(e=>t[e]?.includes(`title`))??a.find(e=>!t[e]?.includes(`identifier`)),s=i.find(e=>t[e]?.includes(`quantity`)),c=i.filter(e=>t[e]?.includes(`money`)),l=c.find(e=>/unit|price|rate/i.test(e)),u=c.find(e=>/^(?:amount|lineTotal|total|lineAmount)$/.test(e))??[...c].reverse().find(e=>e!==l),d=[];return o&&d.push({key:o,label:A(o,e)}),s&&d.push({key:s,label:A(s,e),role:`quantity`}),l&&d.push({key:l,label:A(l,e),role:`money`,summarize:!1}),u&&u!==l&&d.push({key:u,label:A(u,e),role:`money`}),d}function A(e,t){let n=t.fields[e];return n&&(n.type===`foreignKey`||n.type===`crossPackageRef`)&&/.[a-z]Id$/.test(e)?le(e.slice(0,-2)):le(e)}function Xe(e){if(e.dataWidgets&&e.page)return[e.page];let t=[{id:`shortcuts`,type:`shortcuts`,span:4,options:{}}];if(e.dataWidgets&&e.lead){let n=e.lead,r=e.override,i=r&&typeof r==`object`&&!Array.isArray(r)?r:void 0,a=i?.changed;a&&typeof a==`object`&&!Array.isArray(a)&&Object.hasOwn(a,`count`)&&!(Array.isArray(i?.removed)&&i.removed.includes(`count`))&&t.push({id:`count`,type:`metric`,span:1,options:{title:n.plural,model:n.id,measure:`count`}}),t.push({id:`latest`,type:`records`,span:4,options:{title:`${n.name} records`,model:n.id,limit:5,summaries:!1}})}return t}var Ze=[`text`,`integer`,`decimal`,`boolean`,`datetime`,`json`,`foreignKey`,`crossPackageRef`];function Qe(e){return Ze.includes(e)?e:`text`}var $e=/(Date|^date|period(Start|End))$/;function et(e,t){return t.type===`datetime`&&!t.system&&$e.test(t.name)&&!e.fields.some(e=>e.name===`allDay`)?`date`:void 0}function tt(e){return pe(e)[0]}function nt(e,t){let n=t.ui?{...t.ui}:void 0,r=c(t)?`money`:et(e,t);return{type:Qe(t.type),required:t.required,nullable:!t.required,...t.default===void 0?{}:{default:t.default},...t.description?{description:t.description}:{},...n?{ui:n}:{},...t.enum?.length?{enum:[...t.enum]}:{},...r?{format:r}:{},...tt(e)===t.name?{display:!0}:{}}}function rt(e,t){return e.includes(`:`)?e:`${t.slice(0,t.lastIndexOf(`:`))}:${e}`}function it(e,t){if(!t.related)return!1;let n=rt(t.related,e.id);return Ae(m,n,g).some(t=>t.id===e.id)}function at(e){return e.fields.flatMap(t=>{if(t.type!==`foreignKey`&&t.type!==`crossPackageRef`||!t.related)return[];let n=h(rt(t.related,e.id));return n?[{field:t.name,kind:t.type===`crossPackageRef`?`crossPackageRef`:`foreignKey`,relatedCollection:n.model.collection,...it(e,t)?{role:`items`}:{}}]:[]})}function j(e){let t=at(e);return{name:e.collection,objectRef:e.id,className:e.name,idField:`id`,fields:Object.fromEntries(e.fields.map(t=>[t.name,nt(e,t)])),...t.length?{relationships:t}:{}}}function ot(e,t){return{objectRef:e.id,fields:Object.fromEntries(t.map((e,t)=>[e.name,{visibility:`basic`,label:e.label,help:e.help??null,order:t,required:e.required}]))}}function st(e,t){let n=new Set(t);for(let t of e)for(let e of t.models)n.add(e);return n}function ct(e){return y(e.replace(/_?id$/i,``)||e)}function M(e,t,n){let r=ke(e,t),i=new Set(e.packages.flatMap(e=>(e.recipes??[]).filter(e=>e.exposure===`ui-only`).flatMap(e=>e.models))),a=je(e,t).filter(e=>(e.model.exposed||i.has(e.model.id))&&n.has(e.model.id)),o=new Set(Ae(e,t,g).map(e=>e.id)),s=new Map;for(let e of a)s.set(e.model.id,(s.get(e.model.id)??0)+1);let c=a.map(e=>{let t=o.has(e.model.id)?`items`:`children`,n=j(e.model),i=ae(n),a=[e.fk];return{model:e.model.id,field:e.fk,label:(s.get(e.model.id)??0)>1?`${Ce(e.model.name,r)} (${ct(e.fk).toLowerCase()})`:Ce(e.model.name,r),kind:t,columns:t===`items`?Ye(n,i,{exclude:a}):Je(n,i,{exclude:a,max:5}),...t===`items`&&`sortOrder`in n.fields?{sort:`sortOrder`}:{}}});for(let n of Ee(e,t))c.push({model:n.model.id,field:n.fk,label:ct(n.fk),kind:`reference`});return c}var lt=Symbol(`smrt-cookbook`);function ut(){return t(lt)}function dt(e,t){let{sections:n}=t;if(!n)throw Error(`the cookbook widget context is missing`);let r=typeof e.section==`string`?e.section:``,i=r?n.find(e=>e.id===`section:${r}`||e.id===`custom:${r}`)?.id:t.overviewId;if(!i)throw Error(`unknown section ${r}`);return se(n,i)}function ft(e){return e?async(t,n)=>{let r=dt(t,n);try{let t=await e(n,r.items.map(e=>({...e})));if(!Array.isArray(t))return r;let i=new Set,a=[];for(let e of t){if(!e||typeof e.href!=`string`)continue;let t=typeof e.id==`string`&&e.id?e.id:e.href;i.has(t)&&(t=`${t}#${a.length}`),i.add(t),a.push({...e,id:t})}return{items:a}}catch(e){if(n.signal?.aborted)throw e;return r}}:dt}var pt=new Set([`foreignKey`,`crossPackageRef`]);function N(e,t){return`/m/${e}/${t}/`}function mt(e,t,n,r=`view`){let i=`${N(e,t)}${encodeURIComponent(n)}/`;return r===`edit`?`${i}edit/`:i}function ht(e,t,n,r){return`${N(e,t)}?${encodeURIComponent(n)}=${encodeURIComponent(r)}`}function gt(e,t){let n=new URLSearchParams(e);for(let e of t.fields){if(!pt.has(e.type))continue;let t=n.get(e.name);if(t)return{field:e.name,equals:t}}}function _t(e){return e?.equals===void 0?``:`${encodeURIComponent(e.field)}=${encodeURIComponent(e.equals)}`}var P=e=>typeof e==`number`&&Number.isSafeInteger(e)?e:null,vt=(e,t)=>e.fields.some(e=>e.name===t);function yt(e,t){let n=ae(j(e)),r=te(t,n);return Object.values(r).some(e=>P(e)!==null)?r:void 0}function bt(e,t){return!!e.fields.find(e=>e.name===`status`)?.enum?.includes(`draft`)&&typeof t.status==`string`&&t.status!==``&&t.status!==`draft`}function xt(e,t,n){if(!bt(e,t)||![`subtotal`,`taxAmount`,`totalAmount`,`discountTotal`].every(t=>vt(e,t)))return;let r=P(t.subtotal),i=P(t.taxAmount),a=P(t.totalAmount),o=P(t.discountTotal)??0;if(r===null||i===null||a===null)return;let s=f(t,`exclusive`);return{subtotal:r,discount:o,tax:i,total:a,lineAmountType:s,roundingScope:l(t,`line`),showNetSubtotal:s===`inclusive`,taxes:v(n,s).flatMap(e=>e.taxComponentId?[{taxComponentId:e.taxComponentId,name:e.name,percent:e.percent,taxable:e.taxable,tax:e.tax}]:[])}}var F=fe();function I(e){let{source:t,href:n}=e;if(!t||!n)throw Error(`the planner widget context is missing`);return{source:t,href:n}}function L(e){let t=typeof e==`string`?h(e):void 0;if(!t)throw Error(`unknown model ${String(e)}`);return{model:t.model,packageId:t.pkg.id,path:N(t.pkg.id,t.model.name)}}var R=new Set([`foreignKey`,`crossPackageRef`]);function z(e,t,n){let r=e.filter;if(typeof r!=`string`||r===``)return;if(r!==`parent`)throw Error(`unknown filter ${r}`);let{record:i}=t;if(!i?.id)throw Error(`the parent filter needs a record`);let a=typeof e.parentField==`string`&&e.parentField?e.parentField:e.field,o=typeof a==`string`?a:``,s=n.fields.find(e=>e.name===o);if(!s||!R.has(s.type))throw Error(`${n.name} has no reference field ${o}`);return{field:o,id:i.id}}async function B(e,t,n){return n?e.listWhere(t,n.field,n.id):e.list(t)}function V(e,t,n){return e(n?ht(t.packageId,t.model.name,n.field,n.id):t.path)}var H=e=>typeof e==`number`&&Number.isFinite(e);async function St(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),s=await B(n,a,o),l=V(r,i,o),u=typeof e.measure==`string`?e.measure:``;if(u===`count`||u===``)return{value:s.length,format:`integer`,href:l};let d=a.fields.find(t=>t.name===e.field);if(!d||d.type!==`integer`&&d.type!==`decimal`)throw Error(`${u} needs a numeric field of ${a.name}`);let f=s.map(e=>e[d.name]).filter(H),p=0;if(f.length){if(u===`sum`||u===`avg`)p=f.reduce((e,t)=>e+t,0),u===`avg`&&(p/=f.length);else if(u===`min`)p=Math.min(...f);else if(u===`max`)p=Math.max(...f);else throw Error(`unknown measure ${u}`)}let m=c(d);return{value:m?Math.round(p):p,format:m?`money`:d.type===`integer`?`integer`:`decimal`,...m?{currency:`USD`}:{},href:l}}function Ct(e,t){return H(e)&&H(t)?e-t:String(e??``).localeCompare(String(t??``))}var wt=new Set([`createdAt`,`updatedAt`]),Tt=[`identifier`,`status`,`date`,`money`,`quantity`,`party`,`title`];function Et(e=[]){return Tt.find(t=>e.includes(t))}function Dt(e,t,n,r){let i=j(e),a=r?[r]:[],o=oe(n),s=o.length?[]:me(E.apply(e).fields.filter(t=>!a.includes(t.name)&&!Se(e,t))).filter(e=>!e.derive),c=o.length?o:s.map(e=>e.name),l=[...Ye(i,t,{exclude:a}),...Je(i,t,{exclude:a,max:c.length+8})];return c.map(n=>{let r=e.fields.find(e=>e.name===n);if(!r)throw Error(`${e.name} has no field ${n}`);let i=l.find(e=>e.key===n),a=s.find(e=>e.name===n)?.label;if(i)return a?{...i,label:a}:i;let o=Et(t[n]);return{key:n,label:a??(R.has(r.type)?y(n.replace(/Id$/,``)):y(n)),...o?{role:o}:{}}})}var Ot=new Set([`money`,`quantity`]);function kt(e,t){let n={};for(let r of e)(r.summarize??Ot.has(r.role))&&(n[r.key]=t.reduce((e,t)=>{let n=t[r.key];return H(n)?e+n:e},0));return n}function At(e,t){let n=re(j(e)),r=new Set(t.map(e=>n?e[n]:void 0).filter(e=>typeof e==`string`&&e!==``));return r.size===1?[...r][0]??`USD`:`USD`}async function jt(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),s=await B(n,a,o);if(typeof e.sort==`string`&&e.sort){if(!a.fields.find(t=>t.name===e.sort)&&!wt.has(e.sort))throw Error(`${a.name} has no field ${e.sort}`);let t=s.some(t=>t[e.sort]!==void 0)?e.sort:W(a)?.name;if(t){let n=e.direction===`asc`?1:-1;s=[...s].sort((e,r)=>n*Ct(e[t],r[t]))}}let c=Dt(a,ae(j(a)),e.columns,o?.field),l=H(e.limit)?e.limit:5,u=s.slice(0,l),d=a.fields.filter(e=>R.has(e.type)&&c.some(t=>t.key===e.name)),f=await ye(n,d,u),p=e=>Object.fromEntries(c.map(t=>{let n=e[t.key],r=d.find(e=>e.name===t.key);return r?.related&&typeof n==`string`&&n?[t.key,f.get(_(r.related,n))??``]:[t.key,n??null]})),m=kt(c,s),h=!Te(a);return{rows:await Promise.all(u.map(async e=>({id:String(e.id),title:await _e(n,a,e,0,o?.field),...h?{href:r(mt(i.packageId,a.name,String(e.id)))}:{},cells:p(e)}))),...e.summaries===!1?{}:{total:s.length},...h?{href:V(r,i,o)}:{},columns:c,currency:At(a,s),...Object.keys(m).length?{summaries:m}:{}}}var Mt={"7d":7,"30d":30,"90d":90,"12m":365,all:null},U=864e5;function Nt(e){return e===`7d`||e===`30d`?`day`:e===`90d`?`week`:`month`}function Pt(e,t){let n=new Date(e);if(t===`month`)return Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),1);let r=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate());return t===`week`?r-(n.getUTCDay()+6)%7*U:r}function Ft(e,t){if(t===`month`){let t=new Date(e);return Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,1)}return e+(t===`week`?7:1)*U}function It(e,t){let n=new Date(e).toISOString();return t===`month`?n.slice(0,7):n.slice(0,10)}var Lt=e=>e.type===`datetime`&&!e.system;function W(e){let t=e.fields.filter(Lt);return t.find(e=>/^(issue|order|start|created)/i.test(e.name))??t[0]}function Rt(e){if(typeof e!=`string`&&typeof e!=`number`)return;let t=new Date(e).getTime();return Number.isFinite(t)?t:void 0}async function zt(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),s=typeof e.groupBy==`string`?e.groupBy:``,l=s?a.fields.find(e=>e.name===s):W(a);if(!l)throw Error(s?`${a.name} has no field ${s}`:`${a.name} has no date field to chart; choose a group-by field`);let u=typeof e.measure==`string`?e.measure:``,d;if(u&&u!==`count`){if(u!==`sum`&&u!==`avg`)throw Error(`unknown measure ${u}`);if(d=a.fields.find(t=>t.name===e.field),!d||d.type!==`integer`&&d.type!==`decimal`)throw Error(`${u} needs a numeric field of ${a.name}`)}let f=typeof e.period==`string`?e.period:`30d`;if(!Object.hasOwn(Mt,f))throw Error(`unknown period ${f}`);let p=Mt[f],m=Lt(l),h=m?l:W(a),g=p!==null&&h?b-p*U:-1/0,_=await B(n,a,o);h&&g!==-1/0&&(_=_.filter(e=>{let t=Rt(e[h.name]);return t!==void 0&&t>=g&&t<=b}));let v=new Map,y=(e,t,n)=>{let r=v.get(e)??{key:t,sum:0,n:0};if(d){let e=n[d.name];if(!H(e))return;r.sum+=e}r.n+=1,v.set(e,r)},x=Nt(f);if(m){let e=g===-1/0?Math.min(..._.map(e=>Rt(e[l.name])??b),b):g;for(let t=Pt(e,x);t<=b;t=Ft(t,x))v.set(It(t,x),{key:t,sum:0,n:0});for(let e of _){let t=Rt(e[l.name]);if(t===void 0)continue;let n=Pt(t,x);y(It(n,x),n,e)}}else for(let e of _){let t=e[l.name],n=t==null||t===``?`(none)`:String(t);y(n,n,e)}let S=d?c(d):!1,ee=e=>{if(!d)return e.n;let t=u===`avg`&&e.n?e.sum/e.n:e.sum;return S?Math.round(t):t},C=[...v.entries()].map(([e,t])=>({label:e,value:ee(t),key:t.key}));return C=m?C.sort((e,t)=>Number(e.key)-Number(t.key)):C.sort((e,t)=>t.value-e.value||e.label.localeCompare(t.label)),{points:C.map(({label:e,value:t})=>({label:e,value:t})),format:d?S?`money`:d.type===`integer`?`integer`:`decimal`:`integer`,...S?{currency:`USD`}:{},href:V(r,i,o)}}ne(F,{metric:St,records:jt,chart:zt,shortcuts:async(e,t)=>t,shortcuts:ft()});function Bt(e){let{relations:t,viewAllHref:n}=e;if(!t)throw Error(`the record page context is missing`);return{relations:t,records:jt,viewAllHref:n}}async function Vt(e,t){let{source:n}=I(e),r=e.record;if(!r?.id)throw Error(`line items need a record`);let{model:i}=L(r.model),a=await n.get(i,r.id);if(!a)return{};let o=t.find(e=>e.kind===`items`),s=o?h(o.model)?.model:void 0,c=xt(i,a,o&&s?await n.listWhere(s,o.field,r.id):[]),l=c?void 0:yt(i,a),u=re(j(i)),d=u?a[u]:void 0;return{...c?{storedTotals:c}:{},...l?{totals:l}:{},...typeof d==`string`&&d?{currency:d}:{}}}F.register(ue((e,t)=>ge(Bt(t))(e,t))),F.register(be(async(e,t)=>{let n=Bt(t),{totals:r,storedTotals:i,currency:a}=await Vt(t,n.relations);return ce({...n,totals:()=>r,storedTotals:()=>i,currency:()=>a})(e,t)}));var Ht=[`shortcuts`,`metric`,`records`,`chart`,`note`],Ut={"@happyvertical/smrt-reports/svelte":async()=>({SavedReportsWidget:(await a(async()=>{let{default:e}=await import(`./Bikltb61.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35]),import.meta.url)).default})},Wt=async(e,t)=>{let n=Ut[e];if(n)return(await n())[t]},Gt=T.filter(e=>e.surfaces?.some(e=>e.kind===`widget`)),Kt=Gt.flatMap(e=>(e.surfaces??[]).flatMap(e=>e.kind===`widget`?[e.type]:[]));Ge(F,Gt,Wt);var qt=new Map(Be(T).map(e=>[`section:${e.id}`,e])),Jt=m.packages.flatMap(e=>e.models.map(e=>e.id)),Yt=[...Ht,...Kt];function Xt(e){let t=qt.get(e);for(let e of t?.recipes??[]){let t=ze(e)[0];if(t)return{id:t.model.id,name:y(t.model.name)}}}function Zt(e,t){let n=Ve(qt.get(e)?.recipes[0]),r=Xt(e);return Xe({lead:r?{...r,plural:p(r.name)}:void 0,dataWidgets:!0,page:n&&Kt.includes(n.type)?n:void 0,override:t})}var Qt=new Map;function $t(e,t){if(!ve.test(e))return;let n=Qt.get(e);return n||(n=w({id:e,allowed:Yt,models:Jt,defaults:Zt(e)}),Qt.set(e,n)),t===void 0?n:w({...n,defaults:Zt(e,t)})}function en(e,t){return`detail:${e}.${t}`}var tn=new Map(m.packages.flatMap(e=>e.models.filter(u).map(t=>[he(t.id),{packageId:e.id,model:t}])));function nn(e){let[,t,n]=/^detail:([A-Za-z0-9_-]+)\.([A-Za-z0-9_]+)$/.exec(e)??[],r=t&&n?x(t,n):void 0;return t&&r&&u(r)?{packageId:t,model:r}:tn.get(e)}var rn=new Set(m.packages.flatMap(e=>e.models.filter(u).map(e=>e.id))),an=new Map;function on(e){let t=an.get(e);if(t)return t;let n=nn(e);if(!n)return;let r=M(m,n.model.id,rn),i=C(j(n.model),r,{id:e,maxMetrics:2*r.length});return t=w({...i,maxWidgets:Math.max(i.maxWidgets??24,i.defaults.length+24)}),an.set(e,t),t}function sn(e,t){let n=on(e),r=nn(e);if(!n||!r)return;let i=M(m,r.model.id,t),a=0,o=n.defaults.filter(e=>e.type===`line-items`?i.some(e=>e.kind===`items`):e.type===`related`?i.some(e=>e.kind===`children`):t.has(String(e.options.model))?e.type!==`metric`||(a+=1,a<=4):!1);return w({...n,defaults:o})}function cn(e,t){return e.startsWith(`detail:`)?on(e):$t(e,t)}function ln(e,t){return qt.has(e)||e===`section:${De.id}`?!0:e.startsWith(`detail:`)?nn(e)!==void 0:e.startsWith(`custom:`)&&ve.test(e)&&(t?.customSections??[]).some(t=>t.id===e)}var un=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function dn(e,t){let n=t.widgetId?`widget ${t.widgetId}${t.type?` (${t.type})`:``}`:`an entry`,r=t.options?.length?`: ${t.options.map(e=>`${e.key} ${e.code}`).join(`, `)}`:``;return`Overview ${e}: ${n} was dropped (${t.code}${r}).`}function fn(e,t){let n={...e};return e.added&&(n.added=e.added.filter(e=>!t.has(e.id))),e.changed&&(n.changed=Object.fromEntries(Object.entries(e.changed).filter(([e])=>!t.has(e)))),n}function pn(e,t){let n=cn(e,t);if(!n)return{override:null,issues:[{widgetId:null,type:null,code:`malformed`,message:`not an overview id`}]};let r=de(n,t,F);if(r.ok){let e=ie(t).override?.changed?.count;return e&&n.defaults.some(e=>e.id===`count`)?{override:{...r.override??{version:1},changed:{...r.override?.changed,count:e}},issues:[]}:{override:r.override,issues:[]}}let i=ie(t),a=new Set(r.issues.flatMap(e=>e.widgetId?[e.widgetId]:[]));if(!i.override)return{override:null,issues:r.issues};let o=de(n,fn(i.override,a),F);return o.ok?{override:o.override,issues:r.issues}:{override:null,issues:[...r.issues,...o.issues]}}function mn(e,t){if(!un(e))return null;let n=[],r=[];for(let i of Object.keys(e).sort()){if(!ln(i,t)){r.push(`Overview ${i} is not a page in this app and was dropped.`);continue}let{override:a,issues:o}=pn(i,e[i]);for(let e of o)r.push(dn(i,e));a&&n.push([i,a])}return{overviews:Object.fromEntries(n),dropped:r}}var hn=ee,gn=`glass`,_n=`system`,vn=[`light`,`dark`,`system`],yn=[`none`,`sm`,`md`,`lg`,`xl`,`full`],bn=[`comfortable`,`touch`],xn=[`auto`,`standard`,`more`],G={"system-ui":`system-ui, -apple-system, "Segoe UI", sans-serif`,Inter:`Inter, system-ui, sans-serif`,Georgia:`Georgia, "Times New Roman", serif`,"ui-rounded":`ui-rounded, "SF Pro Rounded", system-ui, sans-serif`,"ui-monospace":`ui-monospace, "SF Mono", Menlo, monospace`},Sn=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i;function Cn(e){if(typeof e!=`string`)return null;let t=Sn.exec(e.trim());if(!t)return null;let n=t[1].toLowerCase();return n.length===3&&(n=[...n].map(e=>e+e).join(``)),`#${n}`}var wn=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function Tn(e){if(e===void 0)return{ok:!0,theme:void 0};if(!wn(e))return{ok:!1,error:`The cookbook "theme" must be an object.`};let t={};if(e.preset!==void 0){if(typeof e.preset!=`string`||!hn.includes(e.preset))return{ok:!1,error:`The theme preset must be one of ${hn.join(`, `)}.`};t.preset=e.preset}if(e.colorScheme!==void 0){if(!vn.includes(e.colorScheme))return{ok:!1,error:`The theme colorScheme must be light, dark or system.`};t.colorScheme=e.colorScheme}for(let[n,r]of[[`borderRadius`,yn],[`density`,bn],[`contrast`,xn]]){let i=e[n];if(i!==void 0){if(!r.includes(i))return{ok:!1,error:`The theme ${n} must be one of ${r.join(`, `)}.`};t[n]=i}}if(e.fontFamily!==void 0){if(typeof e.fontFamily!=`string`||!Object.hasOwn(G,e.fontFamily))return{ok:!1,error:`The theme font must be one of ${Object.keys(G).join(`, `)}.`};t.fontFamily=e.fontFamily}if(e.custom!==void 0){if(!wn(e.custom))return{ok:!1,error:`The theme "custom" must be an object.`};let n=Cn(e.custom.primary);if(!n)return{ok:!1,error:`The theme custom primary must be a hex colour like #c2410c.`};let r={primary:n};if(e.custom.fontFamily!==void 0){let t=e.custom.fontFamily;if(typeof t!=`string`||!Object.hasOwn(G,t))return{ok:!1,error:`The theme font must be one of ${Object.keys(G).join(`, `)}.`};r.fontFamily=t}t.custom=r}if(e.customCss!==void 0){if(typeof e.customCss!=`string`)return{ok:!1,error:`The theme customCss must be a string.`};if(Array.from(e.customCss).length>65536)return{ok:!1,error:`The theme customCss is too long (65,536 characters maximum).`};e.customCss&&(t.customCss=e.customCss)}return{ok:!0,theme:Object.keys(t).length?t:void 0}}function En(e){if(!e)return;let t={};return e.preset&&(t.preset=e.preset),e.colorScheme&&(t.colorScheme=e.colorScheme),e.borderRadius&&(t.borderRadius=e.borderRadius),e.density&&(t.density=e.density),e.contrast&&(t.contrast=e.contrast),e.fontFamily&&(t.fontFamily=e.fontFamily),e.custom&&(t.custom={...e.custom}),e.customCss&&(t.customCss=e.customCss),Object.keys(t).length?t:void 0}function Dn(e){let t=e?.colorScheme??`system`,n=e?.custom?`brand colour ${e.custom.primary}`:e?.preset??`glass`;return t===`system`?n:`${n}, ${t}`}var K=`section:`;function On(e,t=xe(T)){let n=Object.keys(t).sort((e,t)=>t.length-e.length);if(!n.length)return e;let r=e=>{if(!e.startsWith(K))return e;let r=e.slice(8);for(let e of n){if(r===e)return`${K}${t[e]}`;if(r.startsWith(`${e}:`))return`${K}${t[e]}${r.slice(e.length)}`}return e},i=e=>e.startsWith(K)&&n.includes(e.slice(8)),a=e=>[...new Set(e)],o={...e};if(e.sectionOrder&&(o.sectionOrder=a(e.sectionOrder.map(r))),e.hidden&&(o.hidden=a(e.hidden.filter(e=>!i(e)).map(r))),e.itemOrder){let t={};for(let[n,i]of Object.entries(e.itemOrder)){let e=r(n);t[e]=a([...t[e]??[],...i.map(r)])}o.itemOrder=t}return e.moved&&(o.moved=Object.fromEntries(Object.entries(e.moved).map(([e,t])=>[r(e),r(t)]))),o}function kn(e,t=T){let n=new Map;for(let e of t){let t=we(e).id;for(let r of ze(e))r.key&&n.set(`${K}${t}:${r.packageId}:${r.model.name}:${r.label}`,Oe(r.packageId,r.model.name,r.key))}let r=e=>{let t=n.get(e);if(t)return t;if(!e.startsWith(K))return e;let r=e.slice(8).split(`:`);return r.length<3||!r[1]||!r[2]?e:Oe(r[1],r[2])},i=e=>[...new Set(e)],a=(e,t)=>{let n={};for(let[i,a]of Object.entries(e)){let e=r(i);e in n||(n[e]=t(a))}return n},o={...e};return e.hidden&&(o.hidden=i(e.hidden.map(r))),e.itemOrder&&(o.itemOrder=a(e.itemOrder,e=>i(e.map(r)))),e.moved&&(o.moved=a(e.moved,r)),e.items&&(o.items=a(e.items,e=>e)),o}var q=`https://s-m-r-t.dev/schemas/cookbook/v1.json`,An=new Set([`basic`,`advanced`,`hidden`]),jn=new Set([`api`,`mcp`,`cli`]),J=e=>({ok:!1,error:e}),Y=e=>typeof e==`object`&&!!e&&!Array.isArray(e),X=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`);function Mn(e,t){if(!Y(e))return`${t} is not an object`;let{objectRef:n,fieldName:r}=e;if(typeof n!=`string`||!n)return`${t} has no objectRef`;if(typeof r!=`string`||!r)return`${t} has no fieldName`;if(e.scopeType!==`app`)return`${t} must have scopeType "app"`;let i={objectRef:n,fieldName:r,scopeType:`app`};for(let n of[`defaultValue`,`help`,`label`]){let r=e[n];if(r!==void 0){if(typeof r!=`string`&&r!==null)return`${t}.${n} is invalid`;i[n]=r}}if(e.visibility!==void 0){let n=e.visibility;if(n!==null&&!(typeof n==`string`&&An.has(n)))return`${t}.visibility is invalid`;i.visibility=n}if(e.displayOrder!==void 0){let n=e.displayOrder;if(n!==null&&!(typeof n==`number`&&Number.isFinite(n)))return`${t}.displayOrder is invalid`;i.displayOrder=n}if(e.locked!==void 0){if(e.locked!==null&&typeof e.locked!=`boolean`)return`${t}.locked is invalid`;i.locked=e.locked}return i}function Nn(e){if(!Y(e)||e.version!==1)return`layout must be an object with version 1`;for(let t of[`sectionOrder`,`hidden`])if(e[t]!==void 0&&!X(e[t]))return`layout.${t} must be a list of strings`;for(let t of[`itemOrder`,`moved`,`panels`])if(e[t]!==void 0&&!Y(e[t]))return`layout.${t} must be an object`;let t=e.itemOrder;if(Y(t)){for(let[e,n]of Object.entries(t))if(e===`__proto__`||!X(n))return`layout.itemOrder.${e} must be a list of strings`}let n=e.moved;if(Y(n)){for(let[e,t]of Object.entries(n))if(e===`__proto__`||typeof t!=`string`)return`layout.moved.${e} must be a string`}return e}function Pn(e,t={}){if(!Y(e))return J(`This is not a cookbook: expected a JSON object.`);if(e.$schema!==void 0&&e.$schema!==`https://s-m-r-t.dev/schemas/cookbook/v1.json`&&e.$schema!==`https://s-m-r-t.dev/schemas/blueprint/v1.json`)return J(`This is not a cookbook: its "$schema" is not a cookbook schema this planner knows.`);let{version:n}=e;if(n===void 0)return J(`This is not a cookbook: it has no "version".`);if(typeof n!=`number`||!Number.isInteger(n))return J(`The cookbook "version" must be a whole number.`);if(n>1)return J(`This cookbook is version ${n}, newer than this planner understands (1). Update the planner or re-export it.`);if(n!==1)return J(`Cookbook version ${n} is not supported (this planner reads version 1).`);if(!X(e.recipes))return J(`The cookbook "recipes" must be a list of recipe ids.`);let r=e.recipes.filter(e=>!D.has(e)),i=[...new Set([...Me(e.recipes.filter(e=>D.has(e)),D),...r])].sort(),a=[];if(e.features!==void 0){if(!X(e.features))return J(`The cookbook "features" must be a list of model names.`);let t=new Set;for(let n of e.features){if(t.has(n))return J(`The cookbook lists the feature ${n} more than once.`);t.add(n)}a=[...e.features].sort()}let o=new Set([...i.flatMap(e=>D.get(e)?.models??[]),...a]);if(!Array.isArray(e.policies))return J(`The cookbook "policies" must be a list.`);let s=[];for(let[t,n]of e.policies.entries()){let e=Mn(n,`policies[${t}]`);if(typeof e==`string`)return J(`Invalid cookbook: ${e}.`);(o.has(e.objectRef)||Ne(e))&&s.push(e)}let c;if(e.exposure!==void 0){if(!Y(e.exposure))return J(`The cookbook "exposure" must be an object.`);let t=[];for(let[n,r]of Object.entries(e.exposure)){if(!X(r)||!r.every(e=>jn.has(e)))return J(`Invalid cookbook: exposure for ${n} must list api, mcp or cli.`);r.length&&o.has(n)&&t.push([n,[...r]])}c=Object.fromEntries(t)}let l;if(e.layout!==void 0){let t=Nn(e.layout);if(typeof t==`string`)return J(`Invalid cookbook: ${t}.`);l=kn(On(t))}let u;if(e.theme!==void 0){let n=Tn(e.theme);if(n.ok)u=n.theme;else if(!t.dropUnknownRecipes)return J(n.error)}let d,f=[];if(e.overviews!==void 0){if(t.overviews){let n=t.overviews(e.overviews,l);if(!n)return J(`The cookbook "overviews" must be an object.`);d=n.overviews,f=n.dropped}else{if(!Y(e.overviews))return J(`The cookbook "overviews" must be an object.`);Object.keys(e.overviews).length&&(f=[`Page customisations (overviews) are not kept by this host and were dropped.`])}}let p={$schema:q,version:1,recipes:i,features:a,policies:s};for(let t of[`name`,`description`]){let n=e[t];if(n!==void 0){if(typeof n!=`string`)return J(`The cookbook "${t}" must be a string.`);n.trim()&&(p[t]=n.trim())}}if(e.specs!==void 0){if(typeof e.specs!=`string`)return J(`The cookbook "specs" must be a string.`);e.specs.trim()&&(p.specs=e.specs.trim())}return c&&Object.keys(c).length&&(p.exposure=c),l&&(p.layout=l),u&&(p.theme=u),d&&Object.keys(d).length&&(p.overviews=d),f.length?{ok:!0,cookbook:p,dropped:f}:{ok:!0,cookbook:p}}var Fn=e=>({ok:!1,error:e});function In(e,t={}){return Pn(e,{...t,overviews:mn})}function Ln(e,t={}){let n;try{n=JSON.parse(e)}catch{return Fn(`This file is not valid JSON.`)}try{return In(n,t)}catch{return Fn(`This file is not a valid cookbook.`)}}var Z=`smrt-planner:cookbook-doc:v1`,Rn=`smrt-planner:blueprint:v1`,zn=`smrt-planner:cookbook-doc:unreadable`;function Bn(){try{return globalThis.localStorage??null}catch{return null}}function Vn(e){if(!e)return{status:`unavailable`};let t;try{t=e.getItem(Z)}catch{return{status:`unavailable`}}let n=null;try{n=e.getItem(Rn)}catch{}let r=t===null&&n!==null,i=r?n:t;if(i===null)return{status:`empty`};let a=Ln(i,{dropUnknownRecipes:!0});if(a.ok)return r&&Q(e,Z,JSON.stringify(a.cookbook)),{status:`loaded`,cookbook:a.cookbook,previousKept:n!==null,...a.dropped?{dropped:a.dropped}:{}};t=i;let o=Q(e,zn,t);return{status:`unreadable`,reason:a.error,keptAside:o}}function Q(e,t,n){if(!e)return!1;try{return e.setItem(t,n),!0}catch{return!1}}function Hn(e,t){if(!e)return!1;try{return e.removeItem(t),!0}catch{return!1}}function Un(e,t){return Q(e,Z,JSON.stringify(t))}function Wn(e,t={}){let n={$schema:q,version:1,...Ie(e)};t.name&&(n.name=t.name),t.description&&(n.description=t.description),t.specs&&(n.specs=t.specs),t.layout&&(n.layout=t.layout);let r=En(t.theme);r&&(n.theme=r);let i=t.overviews??{},a=Object.keys(i).sort();return a.length&&(n.overviews=Object.fromEntries(a.map(e=>[e,i[e]]))),n}var Gn=new Set([`basic`,`advanced`,`hidden`]),Kn=new Set([`api`,`mcp`,`cli`]);function qn(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t+`=`.repeat((4-t.length%4)%4));return new TextDecoder().decode(Uint8Array.from(n,e=>e.charCodeAt(0)))}function Jn(e){let t=new URLSearchParams(e);return t.has(`r`)||t.has(`o`)}function Yn(e){let t={rows:[],narrowed:{}};if(!e)return t;let n;try{n=JSON.parse(qn(e))}catch{return t}if(!n||typeof n!=`object`)return t;let r=[];for(let[e,t]of Object.entries(n.r??{}))if(t&&typeof t==`object`)for(let[n,i]of Object.entries(t)){if(!i||typeof i!=`object`)continue;let t={objectRef:e,fieldName:n,scopeType:`app`};typeof i.v==`string`&&Gn.has(i.v)&&(t.visibility=i.v),typeof i.l==`string`&&(t.label=i.l),(typeof i.h==`string`||i.h===null)&&(t.help=i.h),(typeof i.d==`string`||i.d===null)&&(t.defaultValue=i.d),typeof i.o==`number`&&Number.isFinite(i.o)&&(t.displayOrder=i.o),typeof i.k==`boolean`&&(t.locked=i.k),r.push(t)}let i={};for(let[e,t]of Object.entries(n.x??{})){if(!Array.isArray(t))continue;let n=t.filter(e=>Kn.has(e));n.length&&(i[e]=n)}return{rows:r,narrowed:i}}function Xn(e){let t=new URLSearchParams(e),n=(t.get(`r`)??``).split(`,`).filter(Boolean),r=Me(Le(n,D),D),i=new Set(r.flatMap(e=>D.get(e)?.models??[])),{rows:a,narrowed:o}=Yn(t.get(`o`)??``),s={$schema:q,version:1,recipes:r,features:[],policies:a.filter(e=>i.has(e.objectRef))},c=Object.fromEntries(Object.entries(o).filter(([e])=>i.has(e)));return Object.keys(c).length&&(s.exposure=c),s}var Zn=`smrt-planner:shell`;function $(e){let t=Fe(e),n=e.policies.some(e=>e.defaultValue!==void 0&&Ne(e));s(Re(e)||n?t.taxRate:void 0),o({pricesIncludeTax:t.pricesIncludeTax,taxRounding:t.taxRounding,currency:t.currency})}var Qn=new class{#e=r(0);get replacementGeneration(){return e(this.#e)}set replacementGeneration(e){i(this.#e,e,!0)}#t=r();get layout(){return e(this.#t)}set layout(e){i(this.#t,e,!0)}#n=r();get name(){return e(this.#n)}set name(e){i(this.#n,e,!0)}#r=r();get description(){return e(this.#r)}set description(e){i(this.#r,e,!0)}#i=r();get specs(){return e(this.#i)}set specs(e){i(this.#i,e,!0)}#a=r();get theme(){return e(this.#a)}set theme(e){i(this.#a,e,!0)}#o=r({});get overviews(){return e(this.#o)}set overviews(e){i(this.#o,e)}#s=r(`unknown`);get persist(){return e(this.#s)}set persist(e){i(this.#s,e,!0)}#c=r(!1);get loaded(){return e(this.#c)}set loaded(e){i(this.#c,e,!0)}hostManaged=!1;#l=r(``);get loadNotice(){return e(this.#l)}set loadNotice(e){i(this.#l,e,!0)}saveBlocked=!1;#u=r(!1);get keepLegacyUrl(){return e(this.#u)}set keepLegacyUrl(e){i(this.#u,e,!0)}replacedBeforeLoad=!1;previousKept=!1;storage=null;timer;snapshot(){return Wn(n(E.data),{layout:n(this.layout),theme:n(this.theme),overviews:n(this.overviews),name:this.name,description:this.description,specs:this.specs})}overview(e){return Object.hasOwn(this.overviews,e)?this.overviews[e]:null}setOverview(e,t){let n=Object.fromEntries(Object.entries(this.overviews).filter(([t])=>t!==e));t&&(n[e]=t),this.overviews=n}setLayout(e){this.layout=S(e)?void 0:e}setSpecs(e){let t=e.trimEnd();this.specs=t.trim()?t:void 0}apply(e){E.load(e),this.layout=e.layout,this.theme=e.theme,this.name=e.name,this.description=e.description,this.specs=e.specs,this.overviews={...e.overviews??{}},$(e)}get unavailableNotice(){let e=[...E.unavailableRecipes,...E.unavailableFeatures];if(!e.length)return``;let t=e.length;return`${t} ${t===1?`recipe`:`recipes`} in this cookbook ${t===1?`isn't`:`aren't`} available in this version: ${e.join(`, `)}. They are kept when you save or export.`}removeUnavailable(){E.removeUnavailable(),this.scheduleSave()}setTheme(e){this.theme=En(e)}settings(){return Fe(this.snapshot())}setSettings(e){let t=Pe(this.snapshot(),e);E.rows=t.policies.map(e=>({...e})),$(t)}replace(e){this.replacementGeneration++,this.apply(e),this.loaded||(this.replacedBeforeLoad=!0),this.saveBlocked=!1,this.keepLegacyUrl=!1}reset(e={}){this.replacementGeneration++,E.clear(),$({policies:[]}),this.layout=void 0,e.preserveTheme||(this.theme=void 0),this.name=void 0,this.description=void 0,this.specs=void 0,this.overviews={},this.saveBlocked=!1,this.keepLegacyUrl=!1}importText(e){let t=Ln(e);return t.ok&&this.replace(t.cookbook),t}hydrate(e,t=d()){this.storage=t;let n=Vn(t);n.status===`loaded`&&(this.previousKept=n.previousKept),n.status===`loaded`&&!this.replacedBeforeLoad?(this.apply(n.cookbook),n.dropped?.length&&(this.loadNotice=`Some saved page customisations could not be used and were removed: ${n.dropped.join(` `)}`)):n.status===`unreadable`&&(this.saveBlocked=!n.keptAside,this.loadNotice=n.keptAside?`The saved cookbook could not be read (${n.reason}) and was kept aside; starting empty.`:`The saved cookbook could not be read (${n.reason}). Starting empty without overwriting it; import or reset to save again.`);let r=!1;if(Jn(e)&&(n.status===`loaded`&&!Q(t,`smrt-planner:cookbook-doc:backup`,JSON.stringify(n.cookbook))&&(this.saveBlocked=!0),this.apply(Xn(e)),r=!0),this.persist=n.status===`unavailable`?`memory`:`unknown`,this.loaded=!0,r){let e=this.save();this.keepLegacyUrl=!e}return r}save(){if(clearTimeout(this.timer),this.timer=void 0,!this.loaded)return!1;if(this.hostManaged)return!0;if(this.saveBlocked)return this.persist=`memory`,!1;let e=Un(this.storage,this.snapshot());return this.persist=e?`ok`:`memory`,e&&this.previousKept&&(this.previousKept=!Hn(this.storage,Rn)),e&&(this.keepLegacyUrl=!1),e}scheduleSave(){this.loaded&&!this.hostManaged&&(clearTimeout(this.timer),this.timer=setTimeout(()=>this.save(),300))}flush(){this.timer!==void 0&&this.save()}};export{j as A,N as C,ut as D,mt as E,st as O,ht as S,_t as T,Cn as _,Bn as a,$t as b,q as c,_n as d,gn as f,Dn as g,hn as h,Z as i,ot as j,M as k,yn as l,G as m,Qn as n,In as o,bn as p,$ as r,Ln as s,Zn as t,xn as u,sn as v,gt as w,F as x,en as y};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CMgP05SN.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(`./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 +1 @@
1
- import{$ as e,Ct as t,Dt as n,Ot as r}from"./DG3qFFTE.js";import"./xihTtKlq.js";import{t as i}from"./RBRsUKgn.js";import{n as a}from"./BKJ9ELUP.js";import{a as o,i as s,n as c,o as l}from"./BETauCCm.js";import{r as u}from"./D_U_DYjx.js";function d(d,f){r(f,!0);let p=c(u()),m=t(()=>a.settings().currency);{let n=t(()=>i(s)),r=t(()=>p.sourceInfo());l(d,{get options(){return f.options},get title(){return f.title},get locale(){return f.locale},get client(){return p.client},reportHref:e=>i(o(e)),get listHref(){return e(n)},get sources(){return e(r)},authorLabel:e=>e===`planner`?`you`:void 0,get currency(){return e(m)}})}n()}export{d as default};
1
+ import{$ as e,Ct as t,Dt as n,Ot as r}from"./DG3qFFTE.js";import"./xihTtKlq.js";import{t as i}from"./f1wD15Gj.js";import{n as a}from"./BBzpxK-8.js";import{a as o,i as s,n as c,o as l}from"./CrCEAfXG.js";import{r as u}from"./D_U_DYjx.js";function d(d,f){r(f,!0);let p=c(u()),m=t(()=>a.settings().currency);{let n=t(()=>i(s)),r=t(()=>p.sourceInfo());l(d,{get options(){return f.options},get title(){return f.title},get locale(){return f.locale},get client(){return p.client},reportHref:e=>i(o(e)),get listHref(){return e(n)},get sources(){return e(r)},authorLabel:e=>e===`planner`?`you`:void 0,get currency(){return e(m)}})}n()}export{d as default};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CMrsF8nJ.js","./C7zBd-pD.js","./D042ejzG.js","./BaNbYf_w.js","./BBmlFBgo.js","./COiEfhsA.js","./BiGt7FLz.js","./CsPuvW_W.js","./CGVkRTMI.js","./DG3qFFTE.js","./xihTtKlq.js","./Bq8E3AWP.js","./DK8Blf1Y.js","../assets/currency-metadata.ksbBA8-C.css","./v8gneLl4.js","../assets/SegmentedControl.CH_vc242.css","../assets/forms.Zvn0Ncy0.css","./Dbjm4OuC.js"])))=>i.map(i=>d[i]);
2
- import{n as e}from"./COiEfhsA.js";import{t}from"./BaNbYf_w.js";import{c as n,l as r,o as i,s as a,u as o}from"./DFqdDA0z.js";import{M as s}from"./2umBkqxi.js";import{a as c,i as l,n as u,o as d,r as f,s as p,t as m}from"./C7zBd-pD.js";import{t as h}from"./CMrsF8nJ.js";import"./CsPuvW_W.js";function g(e){return!e.type||e.type===`webllm`}function _(e){return e.type===`transformers-llm`}async function v(e={}){if(g(e)){let{WebLLMAdapter:n}=await t(async()=>{let{WebLLMAdapter:e}=await import(`./CMrsF8nJ.js`);return{WebLLMAdapter:e}},__vite__mapDeps([0,1,2,3]),import.meta.url);return new n(e)}throw _(e)?new p(`transformers-llm`,[`webllm`]):new p(String(e.type),[`webllm`,`transformers-llm`])}function y(e){return!e.type||e.type===`browser-speech`}function b(e){return e.type===`whisper-local`||e.type===`whisper-wasm`||e.type===`moonshine`}function x(e){return e.type===`whisper-cpp`}async function S(e={}){if(y(e)){let{BrowserSpeechSTTAdapter:n}=await t(async()=>{let{BrowserSpeechSTTAdapter:e}=await import(`./BBmlFBgo.js`).then(e=>e.t);return{BrowserSpeechSTTAdapter:e}},__vite__mapDeps([4,5,1]),import.meta.url);return new n(e)}if(x(e)){let{WhisperCppSTTAdapter:n}=await t(async()=>{let{WhisperCppSTTAdapter:e}=await import(`./BiGt7FLz.js`).then(e=>e.t);return{WhisperCppSTTAdapter:e}},__vite__mapDeps([6,5,1,2,3]),import.meta.url);return new n(e)}if(b(e)){let{LocalSpeechSTTAdapter:n}=await t(async()=>{let{LocalSpeechSTTAdapter:e}=await import(`./CsPuvW_W.js`).then(e=>e.t);return{LocalSpeechSTTAdapter:e}},__vite__mapDeps([7,5,8,9,10,11,12,13,14,15,16,1,2,3]),import.meta.url);return new n(e)}throw new p(String(e.type),[`browser-speech`,`whisper-cpp`,`whisper-local`,`whisper-wasm`,`moonshine`])}function C(e={type:`browser-speech`}){let t=null;return()=>(t??=(async()=>{let t=await S(e);return t.getCapabilities().requiresDownload||await t.ensureInitialized(),t})().catch(e=>{throw t=null,e}),t)}function w(e){return!e.type||e.type===`browser-synthesis`}function T(e){return e.type===`transformers`}async function E(e={}){if(w(e)){let{BrowserSynthesisTTSAdapter:n}=await t(async()=>{let{BrowserSynthesisTTSAdapter:e}=await import(`./Dbjm4OuC.js`);return{BrowserSynthesisTTSAdapter:e}},__vite__mapDeps([17,1]),import.meta.url);return new n(e)}throw T(e)?new p(`transformers`,[`browser-synthesis`]):new p(String(e.type),[`browser-synthesis`])}var D=e({BrowserAIError:()=>m,CapabilityNotAvailableError:()=>u,InitializationError:()=>f,ModelLoadError:()=>l,ModelNotDownloadedError:()=>c,PermissionDeniedError:()=>d,RECOMMENDED_MODELS:()=>h,UnsupportedAdapterError:()=>p,WHISPER_LOCAL_DEFAULT_MODEL:()=>WHISPER_LOCAL_DEFAULT_MODEL,WHISPER_LOCAL_DEFAULT_SIZE_BYTES:()=>WHISPER_LOCAL_DEFAULT_SIZE_BYTES,canEnableSmrtMode:()=>i,detectCapabilities:()=>a,getLLM:()=>v,getSTT:()=>S,getTTS:()=>E,hasLLM:()=>n,hasSTT:()=>r,hasTTS:()=>o,probeBrowserSpeech:()=>s});export{C as n,D as t};
2
+ import{n as e}from"./COiEfhsA.js";import{t}from"./BaNbYf_w.js";import{c as n,l as r,o as i,s as a,u as o}from"./CgeTxqIE.js";import{M as s}from"./Bz6UsD_f.js";import{a as c,i as l,n as u,o as d,r as f,s as p,t as m}from"./C7zBd-pD.js";import{t as h}from"./CMrsF8nJ.js";import"./CsPuvW_W.js";function g(e){return!e.type||e.type===`webllm`}function _(e){return e.type===`transformers-llm`}async function v(e={}){if(g(e)){let{WebLLMAdapter:n}=await t(async()=>{let{WebLLMAdapter:e}=await import(`./CMrsF8nJ.js`);return{WebLLMAdapter:e}},__vite__mapDeps([0,1,2,3]),import.meta.url);return new n(e)}throw _(e)?new p(`transformers-llm`,[`webllm`]):new p(String(e.type),[`webllm`,`transformers-llm`])}function y(e){return!e.type||e.type===`browser-speech`}function b(e){return e.type===`whisper-local`||e.type===`whisper-wasm`||e.type===`moonshine`}function x(e){return e.type===`whisper-cpp`}async function S(e={}){if(y(e)){let{BrowserSpeechSTTAdapter:n}=await t(async()=>{let{BrowserSpeechSTTAdapter:e}=await import(`./BBmlFBgo.js`).then(e=>e.t);return{BrowserSpeechSTTAdapter:e}},__vite__mapDeps([4,5,1]),import.meta.url);return new n(e)}if(x(e)){let{WhisperCppSTTAdapter:n}=await t(async()=>{let{WhisperCppSTTAdapter:e}=await import(`./BiGt7FLz.js`).then(e=>e.t);return{WhisperCppSTTAdapter:e}},__vite__mapDeps([6,5,1,2,3]),import.meta.url);return new n(e)}if(b(e)){let{LocalSpeechSTTAdapter:n}=await t(async()=>{let{LocalSpeechSTTAdapter:e}=await import(`./CsPuvW_W.js`).then(e=>e.t);return{LocalSpeechSTTAdapter:e}},__vite__mapDeps([7,5,8,9,10,11,12,13,14,15,16,1,2,3]),import.meta.url);return new n(e)}throw new p(String(e.type),[`browser-speech`,`whisper-cpp`,`whisper-local`,`whisper-wasm`,`moonshine`])}function C(e={type:`browser-speech`}){let t=null;return()=>(t??=(async()=>{let t=await S(e);return t.getCapabilities().requiresDownload||await t.ensureInitialized(),t})().catch(e=>{throw t=null,e}),t)}function w(e){return!e.type||e.type===`browser-synthesis`}function T(e){return e.type===`transformers`}async function E(e={}){if(w(e)){let{BrowserSynthesisTTSAdapter:n}=await t(async()=>{let{BrowserSynthesisTTSAdapter:e}=await import(`./Dbjm4OuC.js`);return{BrowserSynthesisTTSAdapter:e}},__vite__mapDeps([17,1]),import.meta.url);return new n(e)}throw T(e)?new p(`transformers`,[`browser-synthesis`]):new p(String(e.type),[`browser-synthesis`])}var D=e({BrowserAIError:()=>m,CapabilityNotAvailableError:()=>u,InitializationError:()=>f,ModelLoadError:()=>l,ModelNotDownloadedError:()=>c,PermissionDeniedError:()=>d,RECOMMENDED_MODELS:()=>h,UnsupportedAdapterError:()=>p,WHISPER_LOCAL_DEFAULT_MODEL:()=>WHISPER_LOCAL_DEFAULT_MODEL,WHISPER_LOCAL_DEFAULT_SIZE_BYTES:()=>WHISPER_LOCAL_DEFAULT_SIZE_BYTES,canEnableSmrtMode:()=>i,detectCapabilities:()=>a,getLLM:()=>v,getSTT:()=>S,getTTS:()=>E,hasLLM:()=>n,hasSTT:()=>r,hasTTS:()=>o,probeBrowserSpeech:()=>s});export{C as n,D as t};