@happyvertical/smrt-planner 0.62.5 → 0.62.6

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 (534) hide show
  1. package/app/404.html +18 -18
  2. package/app/_app/immutable/chunks/{CbOFRn1N.js → 21btP0R4.js} +1 -1
  3. package/app/_app/immutable/chunks/{B9ucQYIA.js → 8KoKLERF.js} +1 -1
  4. package/app/_app/immutable/chunks/{IVfnZdeW.js → B1N9X4sc.js} +33 -33
  5. package/app/_app/immutable/chunks/{DqLclqJB.js → BKuS9aY_.js} +1 -1
  6. package/app/_app/immutable/chunks/BSt3Zpcw.js +1 -0
  7. package/app/_app/immutable/chunks/{DkyrxFMJ.js → BlZ_GEbZ.js} +1 -1
  8. package/app/_app/immutable/chunks/{DitEeA6X.js → C2e2zlhC.js} +3 -3
  9. package/app/_app/immutable/chunks/{DPl_ov_p.js → C3sAQYIE.js} +1 -1
  10. package/app/_app/immutable/chunks/{DiysZfH7.js → C9Zasc6Q.js} +1 -1
  11. package/app/_app/immutable/chunks/{DnqxJ6hq.js → CAJ8G3_g.js} +1 -1
  12. package/app/_app/immutable/chunks/{P_haQ8j4.js → CCS83DIe.js} +1 -1
  13. package/app/_app/immutable/chunks/{CtG_Lwvh.js → CVokFrMd.js} +1 -1
  14. package/app/_app/immutable/chunks/CZ15IDt6.js +1 -0
  15. package/app/_app/immutable/chunks/{8hc9FYzo.js → Ci5_Sps_.js} +1 -1
  16. package/app/_app/immutable/chunks/{CTRau-kw.js → CkdqvxRs.js} +1 -1
  17. package/app/_app/immutable/chunks/{D6ZRo7UR.js → Clve4ff2.js} +1 -1
  18. package/app/_app/immutable/chunks/{DRZTI5Jr.js → CoMpGlIE.js} +1 -1
  19. package/app/_app/immutable/chunks/{CxjVOyG6.js → Cr_Y_U0N.js} +1 -1
  20. package/app/_app/immutable/chunks/{BizV6cxC.js → D1Gn2wRJ.js} +1 -1
  21. package/app/_app/immutable/chunks/{Tb0fgM0E.js → D5sQ2Umm.js} +1 -1
  22. package/app/_app/immutable/chunks/{VBANaoR3.js → DX4jMOO7.js} +2 -2
  23. package/app/_app/immutable/chunks/{DKGzf415.js → DscjQjQg.js} +1 -1
  24. package/app/_app/immutable/chunks/{DMtbj61v.js → DuWbl1Oh.js} +1 -1
  25. package/app/_app/immutable/chunks/{DcORu4n4.js → S7FiQFTc.js} +1 -1
  26. package/app/_app/immutable/chunks/{DSeAvFCF.js → SHRXoxhn.js} +1 -1
  27. package/app/_app/immutable/chunks/{4mxo1tpy.js → crptSb4T.js} +1 -1
  28. package/app/_app/immutable/chunks/{Dnf-fyR5.js → gTD3HoIw.js} +1 -1
  29. package/app/_app/immutable/chunks/{Dl8hOaIo.js → hmkL0C6A.js} +1 -1
  30. package/app/_app/immutable/chunks/{CNBdo__C.js → k3Hz_f-J.js} +1 -1
  31. package/app/_app/immutable/entry/{app.4N6G-eXw.js → app.BqYcNAVu.js} +2 -2
  32. package/app/_app/immutable/entry/start.B2TE7a2Y.js +1 -0
  33. package/app/_app/immutable/nodes/{0.Cs1YBu1i.js → 0.3ao9zFu9.js} +1 -1
  34. package/app/_app/immutable/nodes/{1.CdqDj38S.js → 1.B0kCJ1Vy.js} +1 -1
  35. package/app/_app/immutable/nodes/{10.cJaEWiya.js → 10.CHIi5c5-.js} +1 -1
  36. package/app/_app/immutable/nodes/{11.BRSIknzS.js → 11.Dtf4xKim.js} +1 -1
  37. package/app/_app/immutable/nodes/{12.CC8lX_rP.js → 12.B7PiUbGI.js} +1 -1
  38. package/app/_app/immutable/nodes/{13.BeILpUVk.js → 13.81fsgeBq.js} +1 -1
  39. package/app/_app/immutable/nodes/{14.UJ0p0KAl.js → 14.BUQf4Y1E.js} +1 -1
  40. package/app/_app/immutable/nodes/{2.r9chMBT0.js → 2.CixcB0a9.js} +3 -3
  41. package/app/_app/immutable/nodes/{3.Cf7RgPAE.js → 3.nPNmnxjt.js} +1 -1
  42. package/app/_app/immutable/nodes/{4.BJp4hi8y.js → 4.ClDKAbS8.js} +1 -1
  43. package/app/_app/immutable/nodes/{5.BHhmEdIF.js → 5.0HCxvdYs.js} +1 -1
  44. package/app/_app/immutable/nodes/{6.CHTH4fCD.js → 6.NU1dOEjb.js} +1 -1
  45. package/app/_app/immutable/nodes/{7.CBjlj4lR.js → 7.B_ARecF3.js} +1 -1
  46. package/app/_app/immutable/nodes/{8.XYqxqtaE.js → 8.CcH0Wetj.js} +1 -1
  47. package/app/_app/immutable/nodes/{9.B5xmGIfr.js → 9.C6wNa-vK.js} +1 -1
  48. package/app/_app/version.json +1 -1
  49. package/app/advanced-styles/index.html +20 -20
  50. package/app/ai/index.html +24 -24
  51. package/app/blueprint/index.html +19 -19
  52. package/app/cookbook/index.html +19 -19
  53. package/app/index.html +31 -31
  54. package/app/m/ads/AdDeliveryTier/index.html +23 -23
  55. package/app/m/ads/AdEvent/index.html +23 -23
  56. package/app/m/ads/AdFormat/index.html +23 -23
  57. package/app/m/ads/AdGroup/index.html +23 -23
  58. package/app/m/ads/AdVariation/index.html +23 -23
  59. package/app/m/analytics/AnalyticsDataStream/index.html +23 -23
  60. package/app/m/analytics/AnalyticsEvent/index.html +23 -23
  61. package/app/m/analytics/AnalyticsProperty/index.html +23 -23
  62. package/app/m/analytics/AnalyticsReport/index.html +23 -23
  63. package/app/m/approvals/ApprovalEvent/index.html +23 -23
  64. package/app/m/approvals/ApprovalPolicy/index.html +23 -23
  65. package/app/m/approvals/ApprovalRequest/index.html +23 -23
  66. package/app/m/assets/Asset/attachments/index.html +24 -24
  67. package/app/m/assets/Asset/index.html +23 -23
  68. package/app/m/assets/AssetAssociation/index.html +23 -23
  69. package/app/m/assets/AssetMetafield/index.html +23 -23
  70. package/app/m/assets/AssetStatus/index.html +23 -23
  71. package/app/m/assets/AssetType/index.html +23 -23
  72. package/app/m/assets/Folder/index.html +23 -23
  73. package/app/m/chat/AgentSession/index.html +23 -23
  74. package/app/m/chat/ChatMessage/index.html +23 -23
  75. package/app/m/chat/ChatParticipant/index.html +23 -23
  76. package/app/m/chat/ChatReaction/index.html +23 -23
  77. package/app/m/chat/ChatRoom/index.html +23 -23
  78. package/app/m/chat/ChatThread/index.html +23 -23
  79. package/app/m/chat/VoiceGatewayTurn/index.html +23 -23
  80. package/app/m/chat/VoiceSession/index.html +23 -23
  81. package/app/m/commerce/AccountingConnection/index.html +88 -0
  82. package/app/m/commerce/AccountingInvoiceReadback/index.html +88 -0
  83. package/app/m/commerce/AccountingMapping/index.html +88 -0
  84. package/app/m/commerce/AccountingPaymentSync/index.html +88 -0
  85. package/app/m/commerce/Agreement/index.html +23 -23
  86. package/app/m/commerce/Cart/index.html +23 -23
  87. package/app/m/commerce/Contract/index.html +23 -23
  88. package/app/m/commerce/ContractLineItem/index.html +23 -23
  89. package/app/m/commerce/Customer/index.html +23 -23
  90. package/app/m/commerce/DocumentTax/index.html +23 -23
  91. package/app/m/commerce/Estimate/index.html +23 -23
  92. package/app/m/commerce/Fulfillment/index.html +23 -23
  93. package/app/m/commerce/FulfillmentLineItem/index.html +23 -23
  94. package/app/m/commerce/HistoricalCustomerFunds/index.html +23 -23
  95. package/app/m/commerce/HistoricalCustomerFundsAllocation/index.html +23 -23
  96. package/app/m/commerce/HistoricalSalesLine/index.html +23 -23
  97. package/app/m/commerce/Invoice/index.html +23 -23
  98. package/app/m/commerce/InvoiceLineItem/index.html +23 -23
  99. package/app/m/commerce/Lease/index.html +23 -23
  100. package/app/m/commerce/LicenseSale/index.html +23 -23
  101. package/app/m/commerce/Order/index.html +23 -23
  102. package/app/m/commerce/Payment/index.html +23 -23
  103. package/app/m/commerce/PaymentAllocation/index.html +23 -23
  104. package/app/m/commerce/PaymentInstrument/index.html +23 -23
  105. package/app/m/commerce/PaymentIntent/index.html +23 -23
  106. package/app/m/commerce/Payout/index.html +23 -23
  107. package/app/m/commerce/ProductionOrder/index.html +23 -23
  108. package/app/m/commerce/PurchaseContract/index.html +23 -23
  109. package/app/m/commerce/PurchaseOrder/index.html +23 -23
  110. package/app/m/commerce/SalesContract/index.html +23 -23
  111. package/app/m/commerce/SupplierQuote/index.html +23 -23
  112. package/app/m/commerce/TaxCode/index.html +23 -23
  113. package/app/m/commerce/TaxComponent/index.html +23 -23
  114. package/app/m/commerce/TaxSettings/index.html +23 -23
  115. package/app/m/commerce/TaxSummaryReport/index.html +23 -23
  116. package/app/m/commerce/TenantPaymentAccount/index.html +23 -23
  117. package/app/m/commerce/Vendor/index.html +23 -23
  118. package/app/m/commerce/WholesaleOrder/index.html +23 -23
  119. package/app/m/content/Content/articles/index.html +24 -24
  120. package/app/m/content/Content/index.html +23 -23
  121. package/app/m/content/ContentContribution/index.html +23 -23
  122. package/app/m/content/ContentContributionAttachment/index.html +23 -23
  123. package/app/m/content/ContentContributionRevision/index.html +23 -23
  124. package/app/m/content/ContentContributionType/index.html +23 -23
  125. package/app/m/content/ContentContributor/index.html +23 -23
  126. package/app/m/content/ContentCorrection/index.html +23 -23
  127. package/app/m/content/ContentFeedSource/index.html +23 -23
  128. package/app/m/content/ContentGovernanceAssignment/index.html +23 -23
  129. package/app/m/content/ContentGovernancePolicy/index.html +23 -23
  130. package/app/m/content/ContentGovernanceProfile/index.html +23 -23
  131. package/app/m/content/ContentReference/index.html +23 -23
  132. package/app/m/content/ContentReview/index.html +23 -23
  133. package/app/m/content/ContentVersion/index.html +23 -23
  134. package/app/m/events/Event/index.html +23 -23
  135. package/app/m/events/EventParticipant/index.html +23 -23
  136. package/app/m/events/EventSeries/index.html +23 -23
  137. package/app/m/events/EventType/index.html +23 -23
  138. package/app/m/expenses/Expense/index.html +23 -23
  139. package/app/m/facts/Fact/index.html +23 -23
  140. package/app/m/facts/FactContent/index.html +23 -23
  141. package/app/m/facts/FactEvidence/index.html +23 -23
  142. package/app/m/facts/FactSource/index.html +23 -23
  143. package/app/m/facts/FactSubject/index.html +23 -23
  144. package/app/m/facts/FactTag/index.html +23 -23
  145. package/app/m/fields/FieldPolicy/index.html +23 -23
  146. package/app/m/fields/FieldPolicySuggestion/index.html +23 -23
  147. package/app/m/fields/FieldUsageCounter/index.html +23 -23
  148. package/app/m/human-resources/Employment/index.html +23 -23
  149. package/app/m/human-resources/EmploymentTerm/index.html +23 -23
  150. package/app/m/human-resources/HeldQualification/index.html +23 -23
  151. package/app/m/human-resources/Qualification/index.html +23 -23
  152. package/app/m/images/Image/index.html +23 -23
  153. package/app/m/inventory/InventoryLocation/index.html +23 -23
  154. package/app/m/inventory/Lot/index.html +23 -23
  155. package/app/m/inventory/LotCorrection/index.html +23 -23
  156. package/app/m/inventory/LotDocument/index.html +23 -23
  157. package/app/m/inventory/LotStockLevel/index.html +23 -23
  158. package/app/m/inventory/LotUsage/index.html +23 -23
  159. package/app/m/inventory/StockLevel/index.html +23 -23
  160. package/app/m/inventory/StockMovement/index.html +23 -23
  161. package/app/m/ledgers/Account/index.html +23 -23
  162. package/app/m/ledgers/Journal/index.html +23 -23
  163. package/app/m/ledgers/JournalEntry/index.html +23 -23
  164. package/app/m/ledgers/Ledger/index.html +23 -23
  165. package/app/m/manufacturing/Assembly/index.html +23 -23
  166. package/app/m/manufacturing/BillOfMaterials/index.html +23 -23
  167. package/app/m/manufacturing/BomLine/index.html +23 -23
  168. package/app/m/manufacturing/Operation/index.html +23 -23
  169. package/app/m/manufacturing/ProductionRun/index.html +23 -23
  170. package/app/m/manufacturing/ProductionRunCompletion/index.html +23 -23
  171. package/app/m/manufacturing/RoutingStep/index.html +23 -23
  172. package/app/m/marketing/Campaign/index.html +23 -23
  173. package/app/m/marketing/CampaignChannel/index.html +23 -23
  174. package/app/m/marketing/CampaignMetricSnapshot/index.html +23 -23
  175. package/app/m/messages/Account/index.html +23 -23
  176. package/app/m/messages/Attachment/index.html +23 -23
  177. package/app/m/messages/Blacklist/index.html +23 -23
  178. package/app/m/messages/Email/failed-sends/index.html +24 -24
  179. package/app/m/messages/Email/index.html +23 -23
  180. package/app/m/messages/Email/mailbox/index.html +24 -24
  181. package/app/m/messages/EmailAccount/index.html +23 -23
  182. package/app/m/messages/EmailAttachment/index.html +23 -23
  183. package/app/m/messages/EmailFolder/index.html +23 -23
  184. package/app/m/messages/Message/index.html +23 -23
  185. package/app/m/messages/MessagingEndpoint/index.html +23 -23
  186. package/app/m/messages/PersonaMessageRoute/index.html +23 -23
  187. package/app/m/messages/SlackAccount/index.html +23 -23
  188. package/app/m/messages/SlackMessage/index.html +23 -23
  189. package/app/m/messages/SlackMessage/slack-messages/index.html +24 -24
  190. package/app/m/messages/TelegramAccount/index.html +23 -23
  191. package/app/m/messages/Tweet/index.html +23 -23
  192. package/app/m/messages/TwitterAccount/index.html +23 -23
  193. package/app/m/messages/Whitelist/index.html +23 -23
  194. package/app/m/messages/ZulipAccount/index.html +23 -23
  195. package/app/m/places/Place/index.html +23 -23
  196. package/app/m/places/PlaceType/index.html +23 -23
  197. package/app/m/products/Category/index.html +23 -23
  198. package/app/m/products/Material/index.html +23 -23
  199. package/app/m/products/Product/index.html +23 -23
  200. package/app/m/products/Product/ingredients/index.html +24 -24
  201. package/app/m/products/ProductVariant/index.html +23 -23
  202. package/app/m/products/Sku/index.html +23 -23
  203. package/app/m/profiles/ApiKey/index.html +23 -23
  204. package/app/m/profiles/Bot/index.html +23 -23
  205. package/app/m/profiles/MagicLinkToken/index.html +23 -23
  206. package/app/m/profiles/NostrIdentity/index.html +23 -23
  207. package/app/m/profiles/OidcIdentity/index.html +23 -23
  208. package/app/m/profiles/Organization/index.html +23 -23
  209. package/app/m/profiles/Person/index.html +23 -23
  210. package/app/m/profiles/Profile/index.html +23 -23
  211. package/app/m/profiles/ProfileMetadata/index.html +23 -23
  212. package/app/m/profiles/ProfileMetafield/index.html +23 -23
  213. package/app/m/profiles/ProfileRelationship/index.html +23 -23
  214. package/app/m/profiles/ProfileRelationshipTerm/index.html +23 -23
  215. package/app/m/profiles/ProfileRelationshipType/index.html +23 -23
  216. package/app/m/profiles/ProfileType/index.html +23 -23
  217. package/app/m/projects/Comment/index.html +23 -23
  218. package/app/m/projects/Issue/index.html +23 -23
  219. package/app/m/projects/Label/index.html +23 -23
  220. package/app/m/projects/Project/index.html +23 -23
  221. package/app/m/projects/ProjectIntegration/index.html +23 -23
  222. package/app/m/projects/PullRequest/index.html +23 -23
  223. package/app/m/projects/Repository/index.html +23 -23
  224. package/app/m/properties/Property/index.html +23 -23
  225. package/app/m/properties/Zone/index.html +23 -23
  226. package/app/m/reports/RuntimeReport/index.html +23 -23
  227. package/app/m/reports/SmrtPrincipalReportRefreshTask/index.html +23 -23
  228. package/app/m/reports/SmrtReportLock/index.html +23 -23
  229. package/app/m/reports/SmrtReportRefreshTask/index.html +23 -23
  230. package/app/m/reports/SmrtReportRun/index.html +23 -23
  231. package/app/m/reports/SmrtReportSchedule/index.html +23 -23
  232. package/app/m/reports/SmrtReportWatermark/index.html +23 -23
  233. package/app/m/sales/Agreement/index.html +23 -23
  234. package/app/m/sales/AttributionException/index.html +23 -23
  235. package/app/m/sales/AttributionPolicy/index.html +23 -23
  236. package/app/m/sales/Commission/index.html +23 -23
  237. package/app/m/sales/CommissionAdjustment/index.html +23 -23
  238. package/app/m/sales/CommissionPayout/index.html +23 -23
  239. package/app/m/sales/CommissionPlan/index.html +23 -23
  240. package/app/m/sales/Earner/index.html +23 -23
  241. package/app/m/sales/EarnerSourceAttribution/index.html +23 -23
  242. package/app/m/sales/EarningEvent/index.html +23 -23
  243. package/app/m/sales/ExecutedAgreement/index.html +23 -23
  244. package/app/m/sales/Lead/index.html +23 -23
  245. package/app/m/sales/Opportunity/index.html +23 -23
  246. package/app/m/sales/OpportunityConversion/index.html +23 -23
  247. package/app/m/sales/PipelineDefinition/index.html +23 -23
  248. package/app/m/sales/PipelineStage/index.html +23 -23
  249. package/app/m/sales/Referral/index.html +23 -23
  250. package/app/m/sales/ReferralAgreement/index.html +23 -23
  251. package/app/m/sales/ReferralLink/index.html +23 -23
  252. package/app/m/sales/ReferralProgram/index.html +23 -23
  253. package/app/m/sales/ReferralTermSnapshot/index.html +23 -23
  254. package/app/m/sales/ReferralTouch/index.html +23 -23
  255. package/app/m/sales/Referrer/index.html +23 -23
  256. package/app/m/sales/ReferrerIdentifier/index.html +23 -23
  257. package/app/m/sales/SalesActivity/index.html +23 -23
  258. package/app/m/sales/SalesRepresentative/index.html +23 -23
  259. package/app/m/sites/DnsZone/index.html +23 -23
  260. package/app/m/sites/Domain/index.html +23 -23
  261. package/app/m/sites/ProjectDomain/index.html +23 -23
  262. package/app/m/sites/Site/index.html +23 -23
  263. package/app/m/sites/SiteAgentBinding/index.html +23 -23
  264. package/app/m/social/OAuthState/index.html +23 -23
  265. package/app/m/social/SocialAccount/index.html +23 -23
  266. package/app/m/social/SocialPost/index.html +23 -23
  267. package/app/m/social/SocialPostAnalyticsSnapshot/index.html +23 -23
  268. package/app/m/subscriptions/BillingAdjustment/index.html +23 -23
  269. package/app/m/subscriptions/ClientCharge/index.html +23 -23
  270. package/app/m/subscriptions/CreditGrant/index.html +23 -23
  271. package/app/m/subscriptions/PricingRule/index.html +23 -23
  272. package/app/m/subscriptions/RetailCharge/index.html +23 -23
  273. package/app/m/subscriptions/SpendingPolicy/index.html +23 -23
  274. package/app/m/subscriptions/SubscriptionPlan/index.html +23 -23
  275. package/app/m/subscriptions/SubscriptionPlanVersion/index.html +23 -23
  276. package/app/m/subscriptions/TenantSubscription/index.html +23 -23
  277. package/app/m/subscriptions/TenantUsageMetric/index.html +23 -23
  278. package/app/m/support/ServiceTimeEntry/index.html +23 -23
  279. package/app/m/support/SupportAiRun/index.html +23 -23
  280. package/app/m/support/SupportAvailability/index.html +23 -23
  281. package/app/m/support/SupportCase/index.html +23 -23
  282. package/app/m/support/SupportCaseEvent/index.html +23 -23
  283. package/app/m/support/SupportChannelBinding/index.html +23 -23
  284. package/app/m/support/SupportCharge/index.html +23 -23
  285. package/app/m/support/SupportCompensation/index.html +23 -23
  286. package/app/m/support/SupportCompensationPlan/index.html +23 -23
  287. package/app/m/support/SupportEscalation/index.html +23 -23
  288. package/app/m/support/SupportInteraction/index.html +23 -23
  289. package/app/m/support/SupportPlan/index.html +23 -23
  290. package/app/m/support/SupportPolicy/index.html +23 -23
  291. package/app/m/support/SupportQualification/index.html +23 -23
  292. package/app/m/support/SupportServiceTarget/index.html +23 -23
  293. package/app/m/support/SupportSpecialist/index.html +23 -23
  294. package/app/m/support/SupportWorkLink/index.html +23 -23
  295. package/app/m/tags/Tag/index.html +23 -23
  296. package/app/m/tags/TagAlias/index.html +23 -23
  297. package/app/m/timesheets/AttendanceBreak/index.html +23 -23
  298. package/app/m/timesheets/AttendancePunch/index.html +23 -23
  299. package/app/m/timesheets/AttendanceSegment/index.html +23 -23
  300. package/app/m/timesheets/ServiceChargeSnapshot/index.html +23 -23
  301. package/app/m/timesheets/ServiceCompensationSnapshot/index.html +23 -23
  302. package/app/m/timesheets/ServiceTimeEntry/index.html +23 -23
  303. package/app/m/users/Group/index.html +23 -23
  304. package/app/m/users/GroupMember/index.html +23 -23
  305. package/app/m/users/GroupRole/index.html +23 -23
  306. package/app/m/users/Membership/index.html +23 -23
  307. package/app/m/users/MembershipOverride/index.html +23 -23
  308. package/app/m/users/Permission/index.html +23 -23
  309. package/app/m/users/Role/index.html +23 -23
  310. package/app/m/users/RolePermission/index.html +23 -23
  311. package/app/m/users/Session/index.html +23 -23
  312. package/app/m/users/Tenant/index.html +23 -23
  313. package/app/m/users/TenantIntegration/index.html +23 -23
  314. package/app/m/users/TenantPermissionOverride/index.html +23 -23
  315. package/app/m/users/User/index.html +23 -23
  316. package/app/m/video/Character/index.html +23 -23
  317. package/app/m/video/CharacterAsset/index.html +23 -23
  318. package/app/m/video/CompositeJob/index.html +23 -23
  319. package/app/m/video/Performer/index.html +23 -23
  320. package/app/m/video/PerformerAsset/index.html +23 -23
  321. package/app/m/video/Scene/index.html +23 -23
  322. package/app/m/video/SceneAsset/index.html +23 -23
  323. package/app/m/video/VideoComposition/index.html +23 -23
  324. package/app/m/video/VideoCompositionAsset/index.html +23 -23
  325. package/app/m/video/VideoSequence/index.html +23 -23
  326. package/app/m/video/VideoSequenceAsset/index.html +23 -23
  327. package/app/m/video/VideoShot/index.html +23 -23
  328. package/app/m/video/VideoShotAsset/index.html +23 -23
  329. package/app/m/video/VideoShotCharacter/index.html +23 -23
  330. package/app/m/video/VideoWorkflow/index.html +23 -23
  331. package/app/m/voice/VoiceOutput/index.html +23 -23
  332. package/app/m/voice/VoiceProfile/index.html +23 -23
  333. package/app/m/voice/VoiceSample/index.html +23 -23
  334. package/app/mcp.html +2 -2
  335. package/app/packages/ads/index.html +21 -21
  336. package/app/packages/analytics/index.html +21 -21
  337. package/app/packages/app-mcp/index.html +21 -21
  338. package/app/packages/approvals/index.html +21 -21
  339. package/app/packages/assets/index.html +21 -21
  340. package/app/packages/chat/index.html +21 -21
  341. package/app/packages/comments/index.html +21 -21
  342. package/app/packages/commerce/index.html +22 -22
  343. package/app/packages/content/index.html +21 -21
  344. package/app/packages/events/index.html +21 -21
  345. package/app/packages/expenses/index.html +21 -21
  346. package/app/packages/facts/index.html +21 -21
  347. package/app/packages/fields/index.html +21 -21
  348. package/app/packages/human-resources/index.html +21 -21
  349. package/app/packages/images/index.html +21 -21
  350. package/app/packages/index.html +21 -21
  351. package/app/packages/inference/index.html +21 -21
  352. package/app/packages/ingestion/index.html +21 -21
  353. package/app/packages/inventory/index.html +21 -21
  354. package/app/packages/ledgers/index.html +21 -21
  355. package/app/packages/manufacturing/index.html +21 -21
  356. package/app/packages/marketing/index.html +21 -21
  357. package/app/packages/messages/index.html +21 -21
  358. package/app/packages/places/index.html +21 -21
  359. package/app/packages/preferences/index.html +21 -21
  360. package/app/packages/products/index.html +21 -21
  361. package/app/packages/profiles/index.html +21 -21
  362. package/app/packages/projects/index.html +21 -21
  363. package/app/packages/properties/index.html +21 -21
  364. package/app/packages/reactions/index.html +21 -21
  365. package/app/packages/reports/index.html +21 -21
  366. package/app/packages/sales/index.html +21 -21
  367. package/app/packages/sites/index.html +21 -21
  368. package/app/packages/social/index.html +21 -21
  369. package/app/packages/subscriptions/index.html +21 -21
  370. package/app/packages/support/index.html +21 -21
  371. package/app/packages/tags/index.html +21 -21
  372. package/app/packages/timesheets/index.html +21 -21
  373. package/app/packages/users/index.html +21 -21
  374. package/app/packages/video/index.html +21 -21
  375. package/app/packages/voice/index.html +21 -21
  376. package/app/packages/webhooks/index.html +21 -21
  377. package/app/recipes/account-access/help/index.html +21 -21
  378. package/app/recipes/account-access/index.html +23 -23
  379. package/app/recipes/activity/help/index.html +21 -21
  380. package/app/recipes/activity/index.html +23 -23
  381. package/app/recipes/ads.campaigns/help/index.html +21 -21
  382. package/app/recipes/ads.campaigns/index.html +23 -23
  383. package/app/recipes/affiliates.referrals/help/index.html +21 -21
  384. package/app/recipes/affiliates.referrals/index.html +23 -23
  385. package/app/recipes/agreements/help/index.html +21 -21
  386. package/app/recipes/agreements/index.html +23 -23
  387. package/app/recipes/analytics.reports/help/index.html +21 -21
  388. package/app/recipes/analytics.reports/index.html +23 -23
  389. package/app/recipes/approvals.requests/help/index.html +21 -21
  390. package/app/recipes/approvals.requests/index.html +23 -23
  391. package/app/recipes/assets/help/index.html +21 -21
  392. package/app/recipes/assets/index.html +23 -23
  393. package/app/recipes/billing/help/index.html +21 -21
  394. package/app/recipes/billing/index.html +23 -23
  395. package/app/recipes/chat.assistant/help/index.html +21 -21
  396. package/app/recipes/chat.assistant/index.html +23 -23
  397. package/app/recipes/comments/help/index.html +21 -21
  398. package/app/recipes/comments/index.html +23 -23
  399. package/app/recipes/commerce.customers/help/index.html +21 -21
  400. package/app/recipes/commerce.customers/index.html +23 -23
  401. package/app/recipes/commerce.estimates/help/index.html +21 -21
  402. package/app/recipes/commerce.estimates/index.html +23 -23
  403. package/app/recipes/commerce.purchases/help/index.html +21 -21
  404. package/app/recipes/commerce.purchases/index.html +23 -23
  405. package/app/recipes/commerce.sales/help/index.html +21 -21
  406. package/app/recipes/commerce.sales/index.html +23 -23
  407. package/app/recipes/commerce.vendors/help/index.html +21 -21
  408. package/app/recipes/commerce.vendors/index.html +23 -23
  409. package/app/recipes/commerce.wholesale/help/index.html +21 -21
  410. package/app/recipes/commerce.wholesale/index.html +23 -23
  411. package/app/recipes/content.articles/help/index.html +21 -21
  412. package/app/recipes/content.articles/index.html +23 -23
  413. package/app/recipes/events.calendar/help/index.html +21 -21
  414. package/app/recipes/events.calendar/index.html +23 -23
  415. package/app/recipes/expenses.tracking/help/index.html +21 -21
  416. package/app/recipes/expenses.tracking/index.html +23 -23
  417. package/app/recipes/fields.form-customization/help/index.html +21 -21
  418. package/app/recipes/fields.form-customization/index.html +23 -23
  419. package/app/recipes/human-resources.people/help/index.html +21 -21
  420. package/app/recipes/human-resources.people/index.html +23 -23
  421. package/app/recipes/human-resources.qualifications/help/index.html +21 -21
  422. package/app/recipes/human-resources.qualifications/index.html +23 -23
  423. package/app/recipes/ingestion/help/index.html +21 -21
  424. package/app/recipes/ingestion/index.html +23 -23
  425. package/app/recipes/integrations/help/index.html +21 -21
  426. package/app/recipes/integrations/index.html +23 -23
  427. package/app/recipes/inventory.stock/help/index.html +21 -21
  428. package/app/recipes/inventory.stock/index.html +23 -23
  429. package/app/recipes/ledgers.bookkeeping/help/index.html +21 -21
  430. package/app/recipes/ledgers.bookkeeping/index.html +23 -23
  431. package/app/recipes/manufacturing.assemblies/help/index.html +21 -21
  432. package/app/recipes/manufacturing.assemblies/index.html +23 -23
  433. package/app/recipes/manufacturing.production/help/index.html +21 -21
  434. package/app/recipes/manufacturing.production/index.html +23 -23
  435. package/app/recipes/marketing.campaigns/help/index.html +21 -21
  436. package/app/recipes/marketing.campaigns/index.html +23 -23
  437. package/app/recipes/messages/help/index.html +21 -21
  438. package/app/recipes/messages/index.html +23 -23
  439. package/app/recipes/places.locations/help/index.html +21 -21
  440. package/app/recipes/places.locations/index.html +23 -23
  441. package/app/recipes/products/help/index.html +21 -21
  442. package/app/recipes/products/index.html +23 -23
  443. package/app/recipes/profiles.identity/help/index.html +21 -21
  444. package/app/recipes/profiles.identity/index.html +23 -23
  445. package/app/recipes/projects.tracker/help/index.html +21 -21
  446. package/app/recipes/projects.tracker/index.html +23 -23
  447. package/app/recipes/reports.materialized/help/index.html +21 -21
  448. package/app/recipes/reports.materialized/index.html +23 -23
  449. package/app/recipes/reports.runtime/help/index.html +21 -21
  450. package/app/recipes/reports.runtime/index.html +23 -23
  451. package/app/recipes/sales.pipeline/help/index.html +21 -21
  452. package/app/recipes/sales.pipeline/index.html +23 -23
  453. package/app/recipes/social.posts/help/index.html +21 -21
  454. package/app/recipes/social.posts/index.html +23 -23
  455. package/app/recipes/subscriptions.plans/help/index.html +21 -21
  456. package/app/recipes/subscriptions.plans/index.html +23 -23
  457. package/app/recipes/support.tickets/help/index.html +21 -21
  458. package/app/recipes/support.tickets/index.html +23 -23
  459. package/app/recipes/tags.taxonomy/help/index.html +21 -21
  460. package/app/recipes/tags.taxonomy/index.html +23 -23
  461. package/app/recipes/team-collaboration/help/index.html +21 -21
  462. package/app/recipes/team-collaboration/index.html +23 -23
  463. package/app/recipes/timesheets.time-entries/help/index.html +21 -21
  464. package/app/recipes/timesheets.time-entries/index.html +23 -23
  465. package/app/recipes/video.library/help/index.html +21 -21
  466. package/app/recipes/video.library/index.html +23 -23
  467. package/app/recipes/voice.profiles/help/index.html +21 -21
  468. package/app/recipes/voice.profiles/index.html +23 -23
  469. package/app/s/custom-accounts/index.html +19 -19
  470. package/app/s/custom-appointments/index.html +19 -19
  471. package/app/s/custom-billing/index.html +19 -19
  472. package/app/s/custom-bookings/index.html +19 -19
  473. package/app/s/custom-buying/index.html +19 -19
  474. package/app/s/custom-checkout/index.html +19 -19
  475. package/app/s/custom-classes/index.html +19 -19
  476. package/app/s/custom-clients/index.html +19 -19
  477. package/app/s/custom-events/index.html +19 -19
  478. package/app/s/custom-fleet/index.html +19 -19
  479. package/app/s/custom-gigs/index.html +19 -19
  480. package/app/s/custom-giving/index.html +19 -19
  481. package/app/s/custom-instruments/index.html +19 -19
  482. package/app/s/custom-jobs/index.html +19 -19
  483. package/app/s/custom-kitchen/index.html +19 -19
  484. package/app/s/custom-lessons/index.html +19 -19
  485. package/app/s/custom-material/index.html +19 -19
  486. package/app/s/custom-meetings/index.html +19 -19
  487. package/app/s/custom-members/index.html +19 -19
  488. package/app/s/custom-merch/index.html +19 -19
  489. package/app/s/custom-money/index.html +19 -19
  490. package/app/s/custom-paint/index.html +19 -19
  491. package/app/s/custom-parts/index.html +19 -19
  492. package/app/s/custom-rentals/index.html +19 -19
  493. package/app/s/custom-roastery/index.html +19 -19
  494. package/app/s/custom-schedule/index.html +19 -19
  495. package/app/s/custom-shelf/index.html +19 -19
  496. package/app/s/custom-shop/index.html +19 -19
  497. package/app/s/custom-students/index.html +19 -19
  498. package/app/s/custom-wholesale/index.html +19 -19
  499. package/app/s/custom-work/index.html +19 -19
  500. package/app/s/custom-yard/index.html +19 -19
  501. package/app/s/section-access-control/index.html +19 -19
  502. package/app/s/section-account-security/index.html +19 -19
  503. package/app/s/section-accounting/index.html +19 -19
  504. package/app/s/section-agreements/index.html +19 -19
  505. package/app/s/section-analytics/index.html +19 -19
  506. package/app/s/section-approvals/index.html +19 -19
  507. package/app/s/section-assets/index.html +19 -19
  508. package/app/s/section-billing/index.html +19 -19
  509. package/app/s/section-calendar/index.html +19 -19
  510. package/app/s/section-catalog/index.html +19 -19
  511. package/app/s/section-grow/index.html +19 -19
  512. package/app/s/section-make/index.html +19 -19
  513. package/app/s/section-messages/index.html +19 -19
  514. package/app/s/section-more/index.html +19 -19
  515. package/app/s/section-operations/index.html +19 -19
  516. package/app/s/section-places/index.html +19 -19
  517. package/app/s/section-projects/index.html +19 -19
  518. package/app/s/section-publish/index.html +19 -19
  519. package/app/s/section-purchasing/index.html +19 -19
  520. package/app/s/section-reports.runtime/index.html +19 -19
  521. package/app/s/section-sales/index.html +19 -19
  522. package/app/s/section-staff/index.html +19 -19
  523. package/app/s/section-support/index.html +19 -19
  524. package/app/s/section-taxonomy/index.html +19 -19
  525. package/app/s/section-team/index.html +19 -19
  526. package/app/s/section-work/index.html +19 -19
  527. package/dist/catalog/catalog.json +766 -41
  528. package/dist/core/index.js +680 -43
  529. package/dist/smrt-version.d.ts +1 -1
  530. package/dist/smrt-version.js +1 -1
  531. package/package.json +57 -57
  532. package/app/_app/immutable/chunks/Ci5c8JBX.js +0 -1
  533. package/app/_app/immutable/chunks/CmZMmuTY.js +0 -1
  534. package/app/_app/immutable/entry/start.BA1v6NrS.js +0 -1
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CxjVOyG6.js","./DG3qFFTE.js","./COiEfhsA.js","./xihTtKlq.js","./IVfnZdeW.js","./Bq8E3AWP.js","./denq4QT7.js","../assets/currency-metadata.ksbBA8-C.css","../assets/app.V-5Q6-pe.css","./DiysZfH7.js","./Cekjnrta.js","../assets/feedback.DzqKT7fW.css","./DitEeA6X.js","./BaNbYf_w.js","./D3syEjNq.js","../assets/SegmentedControl.2V179a-S.css","./DmfvgI_r.js","../assets/webmcp-ui-context.D9U5lh8x.css","./CbOFRn1N.js","../assets/data.C5MjAC5_.css","./CUyVrfsu.js","./B18A9OMt.js","../assets/forms.CaLOi679.css","./BYcBM-fh.js","../assets/AppShell.thGpRNkw.css","./DSeAvFCF.js","../assets/workspace.DZTCJDO9.css","./Tb0fgM0E.js","./DKGzf415.js","../assets/state.DYNXOUVq.css","./DOL_dsIt.js","../assets/labels.DPtEGJlJ.css","./B9ucQYIA.js","./BizV6cxC.js","./P_haQ8j4.js","../assets/planner.XUJWm45F.css","./D_U_DYjx.js"])))=>i.map(i=>d[i]);
2
- import{$ as e,Mt as t,bt as n,vt as r}from"./DG3qFFTE.js";import{t as i}from"./BaNbYf_w.js";import"./xihTtKlq.js";import{I as a,L as o,O as s,Q as c,St as l,W as u,Z as d,_ as f,_t as p,bt as m,et as h,h as g,ht as _,p as v,x as y,yt as b}from"./IVfnZdeW.js";import{v as x}from"./DitEeA6X.js";import"./D3syEjNq.js";import"./DmfvgI_r.js";import{u as S}from"./CbOFRn1N.js";import{$ as C,A as w,C as ee,D as te,E as ne,F as re,I as ie,L as T,M as ae,N as oe,P as se,R as ce,T as le,X as E,Y as ue,Z as de,b as fe,h as pe,j as me,k as he,n as ge,q as _e,r as ve,z as ye}from"./Tb0fgM0E.js";import{B as be,D as xe,G as Se,H as Ce,J as we,K as Te,M as Ee,V as De,X as Oe,Y as ke,Z as Ae,a as je,b as D,c as Me,d as Ne,l as Pe,n as Fe,r as Ie,s as Le,t as O,v as Re,x as k,z as ze}from"./DKGzf415.js";var Be=[`identifier`,`status`,`date`,`party`,`total`,`money`];function Ve(e){for(let t of[`identifier`,`status`,`date`,`money`,`quantity`,`party`,`title`])if(e.includes(t))return t}function He(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 Be)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),...Ve(t[n]??[])?{role:Ve(t[n]??[])}:{}}))}function Ue(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)?re(e.slice(0,-2)):re(e)}function We(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 Ge=[`text`,`integer`,`decimal`,`boolean`,`datetime`,`json`,`foreignKey`,`crossPackageRef`];function Ke(e){return Ge.includes(e)?e:`text`}var qe=/(Date|^date|period(Start|End))$/;function Je(e,t){return t.type===`datetime`&&!t.system&&qe.test(t.name)&&!e.fields.some(e=>e.name===`allDay`)?`date`:void 0}function Ye(e){return fe(e)[0]}function Xe(e,t){let n=t.ui?{...t.ui}:void 0,r=s(t)?`money`:Je(e,t);return{type:Ke(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}:{},...Ye(e)===t.name?{display:!0}:{}}}function Ze(e,t){return e.includes(`:`)?e:`${t.slice(0,t.lastIndexOf(`:`))}:${e}`}function Qe(e,t){if(!t.related)return!1;let n=Ze(t.related,e.id);return ke(p,n,h).some(t=>t.id===e.id)}function $e(e){return e.fields.flatMap(t=>{if(t.type!==`foreignKey`&&t.type!==`crossPackageRef`||!t.related)return[];let n=m(Ze(t.related,e.id));return n?[{field:t.name,kind:t.type===`crossPackageRef`?`crossPackageRef`:`foreignKey`,relatedCollection:n.model.collection,...Qe(e,t)?{role:`items`}:{}}]:[]})}function j(e){let t=$e(e);return{name:e.collection,objectRef:e.id,className:e.name,idField:`id`,fields:Object.fromEntries(e.fields.map(t=>[t.name,Xe(e,t)])),...t.length?{relationships:t}:{}}}function et(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 tt(e,t){let n=new Set(t);for(let t of e)for(let e of t.models)n.add(e);return n}function nt(e){return v(e.replace(/_?id$/i,``)||e)}function M(e,t,n){let r=Oe(e,t),i=new Set(e.packages.flatMap(e=>(e.recipes??[]).filter(e=>e.exposure===`ui-only`).flatMap(e=>e.models))),a=Ae(e,t).filter(e=>(e.model.exposed||i.has(e.model.id))&&n.has(e.model.id)),o=new Set(ke(e,t,h).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=T(n),a=[e.fk];return{model:e.model.id,field:e.fk,label:(s.get(e.model.id)??0)>1?`${Se(e.model.name,r)} (${nt(e.fk).toLowerCase()})`:Se(e.model.name,r),kind:t,columns:t===`items`?Ue(n,i,{exclude:a}):He(n,i,{exclude:a,max:5}),...t===`items`&&`sortOrder`in n.fields?{sort:`sortOrder`}:{}}});for(let n of Te(e,t))c.push({model:n.model.id,field:n.fk,label:nt(n.fk),kind:`reference`});return c}function rt(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 it(e){return e?async(t,n)=>{let r=rt(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}}:rt}var at=new Set([`foreignKey`,`crossPackageRef`]);function N(e,t){return`/m/${e}/${t}/`}function ot(e,t,n,r=`view`){let i=`${N(e,t)}${encodeURIComponent(n)}/`;return r===`edit`?`${i}edit/`:i}function st(e,t,n,r){return`${N(e,t)}?${encodeURIComponent(n)}=${encodeURIComponent(r)}`}function ct(e,t){let n=new URLSearchParams(e);for(let e of t.fields){if(!at.has(e.type))continue;let t=n.get(e.name);if(t)return{field:e.name,equals:t}}}function lt(e){return e?.equals===void 0?``:`${encodeURIComponent(e.field)}=${encodeURIComponent(e.equals)}`}var P=e=>typeof e==`number`&&Number.isSafeInteger(e)?e:null,ut=(e,t)=>e.fields.some(e=>e.name===t);function dt(e,t){let n=T(j(e)),r=ee(t,n);return Object.values(r).some(e=>P(e)!==null)?r:void 0}function ft(e,t){return!!e.fields.find(e=>e.name===`status`)?.enum?.includes(`draft`)&&typeof t.status==`string`&&t.status!==``&&t.status!==`draft`}function pt(e,t,n){if(!ft(e,t)||![`subtotal`,`taxAmount`,`totalAmount`,`discountTotal`].every(t=>ut(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=d(t,`exclusive`);return{subtotal:r,discount:o,tax:i,total:a,lineAmountType:s,roundingScope:c(t,`line`),showNetSubtotal:s===`inclusive`,taxes:_(n,s).flatMap(e=>e.taxComponentId?[{taxComponentId:e.taxComponentId,name:e.name,percent:e.percent,taxable:e.taxable,tax:e.tax}]:[])}}var F=_e();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`?m(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?st(t.packageId,t.model.name,n.field,n.id):t.path)}var H=e=>typeof e==`number`&&Number.isFinite(e);async function mt(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),c=await B(n,a,o),l=V(r,i,o),u=typeof e.measure==`string`?e.measure:``;if(u===`count`||u===``)return{value:c.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=c.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=s(d);return{value:m?Math.round(p):p,format:m?`money`:d.type===`integer`?`integer`:`decimal`,...m?{currency:`USD`}:{},href:l}}function ht(e,t){return H(e)&&H(t)?e-t:String(e??``).localeCompare(String(t??``))}var gt=new Set([`createdAt`,`updatedAt`]),_t=[`identifier`,`status`,`date`,`money`,`quantity`,`party`,`title`];function vt(e=[]){return _t.find(t=>e.includes(t))}function yt(e,t,n,r){let i=j(e),a=r?[r]:[],o=oe(n),s=o.length?[]:pe(O.apply(e).fields.filter(t=>!a.includes(t.name)&&!xe(e,t))).filter(e=>!e.derive),c=o.length?o:s.map(e=>e.name),l=[...Ue(i,t,{exclude:a}),...He(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=vt(t[n]);return{key:n,label:a??(R.has(r.type)?v(n.replace(/Id$/,``)):v(n)),...o?{role:o}:{}}})}var bt=new Set([`money`,`quantity`]);function xt(e,t){let n={};for(let r of e)(r.summarize??bt.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 St(e,t){let n=ie(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 Ct(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)&&!gt.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*ht(e[t],r[t]))}}let c=yt(a,T(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 ve(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(g(r.related,n))??``]:[t.key,n??null]})),m=xt(c,s),h=!we(a);return{rows:await Promise.all(u.map(async e=>({id:String(e.id),title:await ge(n,a,e,0,o?.field),...h?{href:r(ot(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:St(a,s),...Object.keys(m).length?{summaries:m}:{}}}var wt={"7d":7,"30d":30,"90d":90,"12m":365,all:null},U=864e5;function Tt(e){return e===`7d`||e===`30d`?`day`:e===`90d`?`week`:`month`}function Et(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 Dt(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 Ot(e,t){let n=new Date(e).toISOString();return t===`month`?n.slice(0,7):n.slice(0,10)}var kt=e=>e.type===`datetime`&&!e.system;function W(e){let t=e.fields.filter(kt);return t.find(e=>/^(issue|order|start|created)/i.test(e.name))??t[0]}function At(e){if(typeof e!=`string`&&typeof e!=`number`)return;let t=new Date(e).getTime();return Number.isFinite(t)?t:void 0}async function jt(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),c=typeof e.groupBy==`string`?e.groupBy:``,l=c?a.fields.find(e=>e.name===c):W(a);if(!l)throw Error(c?`${a.name} has no field ${c}`:`${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(wt,f))throw Error(`unknown period ${f}`);let p=wt[f],m=kt(l),h=m?l:W(a),g=p!==null&&h?y-p*U:-1/0,_=await B(n,a,o);h&&g!==-1/0&&(_=_.filter(e=>{let t=At(e[h.name]);return t!==void 0&&t>=g&&t<=y}));let v=new Map,b=(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=Tt(f);if(m){let e=g===-1/0?Math.min(..._.map(e=>At(e[l.name])??y),y):g;for(let t=Et(e,x);t<=y;t=Dt(t,x))v.set(Ot(t,x),{key:t,sum:0,n:0});for(let e of _){let t=At(e[l.name]);if(t===void 0)continue;let n=Et(t,x);b(Ot(n,x),n,e)}}else for(let e of _){let t=e[l.name],n=t==null||t===``?`(none)`:String(t);b(n,n,e)}let S=d?s(d):!1,C=e=>{if(!d)return e.n;let t=u===`avg`&&e.n?e.sum/e.n:e.sum;return S?Math.round(t):t},w=[...v.entries()].map(([e,t])=>({label:e,value:C(t),key:t.key}));return w=m?w.sort((e,t)=>Number(e.key)-Number(t.key)):w.sort((e,t)=>t.value-e.value||e.label.localeCompare(t.label)),{points:w.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)}}te(F,{metric:mt,records:Ct,chart:jt,shortcuts:async(e,t)=>t,shortcuts:it()});function Mt(e){let{relations:t,viewAllHref:n}=e;if(!t)throw Error(`the record page context is missing`);return{relations:t,records:Ct,viewAllHref:n}}async function Nt(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?m(o.model)?.model:void 0,c=pt(i,a,o&&s?await n.listWhere(s,o.field,r.id):[]),l=c?void 0:dt(i,a),u=ie(j(i)),d=u?a[u]:void 0;return{...c?{storedTotals:c}:{},...l?{totals:l}:{},...typeof d==`string`&&d?{currency:d}:{}}}F.register(ne((e,t)=>w(Mt(t))(e,t))),F.register(le(async(e,t)=>{let n=Mt(t),{totals:r,storedTotals:i,currency:a}=await Nt(t,n.relations);return he({...n,totals:()=>r,storedTotals:()=>i,currency:()=>a})(e,t)}));var Pt=[`shortcuts`,`metric`,`records`,`chart`,`note`],Ft={"@happyvertical/smrt-reports/svelte":async()=>({SavedReportsWidget:(await i(async()=>{let{default:e}=await import(`./CxjVOyG6.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,36]),import.meta.url)).default})},It=async(e,t)=>{let n=Ft[e];if(n)return(await n())[t]},Lt=D.filter(e=>e.surfaces?.some(e=>e.kind===`widget`)),Rt=Lt.flatMap(e=>(e.surfaces??[]).flatMap(e=>e.kind===`widget`?[e.type]:[]));ce(F,Lt,It);var zt=new Map(ze(D).map(e=>[`section:${e.id}`,e])),Bt=p.packages.flatMap(e=>e.models.map(e=>e.id)),Vt=[...Pt,...Rt];function Ht(e){let t=zt.get(e);for(let e of t?.recipes??[]){let t=Re(e)[0];if(t)return{id:t.model.id,name:v(t.model.name)}}}function Ut(e,t){let n=ye(zt.get(e)?.recipes[0]),r=Ht(e);return We({lead:r?{...r,plural:f(r.name)}:void 0,dataWidgets:!0,page:n&&Rt.includes(n.type)?n:void 0,override:t})}var Wt=new Map;function Gt(e,t){if(!C.test(e))return;let n=Wt.get(e);return n||(n=E({id:e,allowed:Vt,models:Bt,defaults:Ut(e)}),Wt.set(e,n)),t===void 0?n:E({...n,defaults:Ut(e,t)})}function Kt(e,t){return`detail:${e}.${t}`}var qt=new Map(p.packages.flatMap(e=>e.models.filter(l).map(t=>[ae(t.id),{packageId:e.id,model:t}])));function Jt(e){let[,t,n]=/^detail:([A-Za-z0-9_-]+)\.([A-Za-z0-9_]+)$/.exec(e)??[],r=t&&n?b(t,n):void 0;return t&&r&&l(r)?{packageId:t,model:r}:qt.get(e)}var Yt=new Set(p.packages.flatMap(e=>e.models.filter(l).map(e=>e.id))),Xt=new Map;function Zt(e){let t=Xt.get(e);if(t)return t;let n=Jt(e);if(!n)return;let r=M(p,n.model.id,Yt),i=me(j(n.model),r,{id:e,maxMetrics:2*r.length});return t=E({...i,maxWidgets:Math.max(i.maxWidgets??24,i.defaults.length+24)}),Xt.set(e,t),t}function Qt(e,t){let n=Zt(e),r=Jt(e);if(!n||!r)return;let i=M(p,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 E({...n,defaults:o})}function $t(e,t){return e.startsWith(`detail:`)?Zt(e):Gt(e,t)}function en(e,t){return zt.has(e)||e===`section:${Ee.id}`?!0:e.startsWith(`detail:`)?Jt(e)!==void 0:e.startsWith(`custom:`)&&C.test(e)&&(t?.customSections??[]).some(t=>t.id===e)}var tn=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function nn(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 rn(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 an(e,t){let n=$t(e,t);if(!n)return{override:null,issues:[{widgetId:null,type:null,code:`malformed`,message:`not an overview id`}]};let r=ue(n,t,F);if(r.ok){let e=de(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=de(t),a=new Set(r.issues.flatMap(e=>e.widgetId?[e.widgetId]:[]));if(!i.override)return{override:null,issues:r.issues};let o=ue(n,rn(i.override,a),F);return o.ok?{override:o.override,issues:r.issues}:{override:null,issues:[...r.issues,...o.issues]}}function on(e,t){if(!tn(e))return null;let n=[],r=[];for(let i of Object.keys(e).sort()){if(!en(i,t)){r.push(`Overview ${i} is not a page in this app and was dropped.`);continue}let{override:a,issues:o}=an(i,e[i]);for(let e of o)r.push(nn(i,e));a&&n.push([i,a])}return{overviews:Object.fromEntries(n),dropped:r}}var sn=S,cn=`glass`,ln=`system`,un=[`light`,`dark`,`system`],dn=[`none`,`sm`,`md`,`lg`,`xl`,`full`],fn=[`comfortable`,`touch`],pn=[`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`},mn=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i;function hn(e){if(typeof e!=`string`)return null;let t=mn.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 gn=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function _n(e){if(e===void 0)return{ok:!0,theme:void 0};if(!gn(e))return{ok:!1,error:`The cookbook "theme" must be an object.`};let t={};if(e.preset!==void 0){if(typeof e.preset!=`string`||!sn.includes(e.preset))return{ok:!1,error:`The theme preset must be one of ${sn.join(`, `)}.`};t.preset=e.preset}if(e.colorScheme!==void 0){if(!un.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`,dn],[`density`,fn],[`contrast`,pn]]){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(!gn(e.custom))return{ok:!1,error:`The theme "custom" must be an object.`};let n=hn(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 vn(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 yn(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 bn(e,t=be(D)){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 xn(e,t=D){let n=new Map;for(let e of t){let t=Ce(e).id;for(let r of Re(e))r.key&&n.set(`${K}${t}:${r.packageId}:${r.model.name}:${r.label}`,De(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:De(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`,Sn=new Set([`basic`,`advanced`,`hidden`]),Cn=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 wn(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`&&Sn.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 Tn(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 En(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=>!k.has(e)),i=[...new Set([...je(e.recipes.filter(e=>k.has(e)),k),...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=>k.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=wn(n,`policies[${t}]`);if(typeof e==`string`)return J(`Invalid cookbook: ${e}.`);(o.has(e.objectRef)||Me(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=>Cn.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=Tn(e.layout);if(typeof t==`string`)return J(`Invalid cookbook: ${t}.`);l=xn(bn(t))}let u;if(e.theme!==void 0){let n=_n(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 Dn=e=>({ok:!1,error:e});function On(e,t={}){return En(e,{...t,overviews:on})}function kn(e,t={}){let n;try{n=JSON.parse(e)}catch{return Dn(`This file is not valid JSON.`)}try{return On(n,t)}catch{return Dn(`This file is not a valid cookbook.`)}}var Z=`smrt-planner:cookbook-doc:v1`,An=`smrt-planner:blueprint:v1`,jn=`smrt-planner:cookbook-doc:unreadable`;function Mn(){try{return globalThis.localStorage??null}catch{return null}}function Nn(e){if(!e)return{status:`unavailable`};let t;try{t=e.getItem(Z)}catch{return{status:`unavailable`}}let n=null;try{n=e.getItem(An)}catch{}let r=t===null&&n!==null,i=r?n:t;if(i===null)return{status:`empty`};let a=kn(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,jn,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 Pn(e,t){if(!e)return!1;try{return e.removeItem(t),!0}catch{return!1}}function Fn(e,t){return Q(e,Z,JSON.stringify(t))}function In(e,t={}){let n={$schema:q,version:1,...Fe(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=vn(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 Ln=new Set([`basic`,`advanced`,`hidden`]),Rn=new Set([`api`,`mcp`,`cli`]);function zn(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 Bn(e){let t=new URLSearchParams(e);return t.has(`r`)||t.has(`o`)}function Vn(e){let t={rows:[],narrowed:{}};if(!e)return t;let n;try{n=JSON.parse(zn(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`&&Ln.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=>Rn.has(e));n.length&&(i[e]=n)}return{rows:r,narrowed:i}}function Hn(e){let t=new URLSearchParams(e),n=(t.get(`r`)??``).split(`,`).filter(Boolean),r=je(Ie(n,k),k),i=new Set(r.flatMap(e=>k.get(e)?.models??[])),{rows:a,narrowed:o}=Vn(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 Un=`smrt-planner:shell`;function $(e){let t=Pe(e),n=e.policies.some(e=>e.defaultValue!==void 0&&Me(e));o(Le(e)||n?t.taxRate:void 0),a({pricesIncludeTax:t.pricesIncludeTax,taxRounding:t.taxRounding,currency:t.currency})}var Wn=new class{#e=n(0);get replacementGeneration(){return e(this.#e)}set replacementGeneration(e){r(this.#e,e,!0)}#t=n();get layout(){return e(this.#t)}set layout(e){r(this.#t,e,!0)}#n=n();get name(){return e(this.#n)}set name(e){r(this.#n,e,!0)}#r=n();get description(){return e(this.#r)}set description(e){r(this.#r,e,!0)}#i=n();get specs(){return e(this.#i)}set specs(e){r(this.#i,e,!0)}#a=n();get theme(){return e(this.#a)}set theme(e){r(this.#a,e,!0)}#o=n({});get overviews(){return e(this.#o)}set overviews(e){r(this.#o,e)}#s=n(`unknown`);get persist(){return e(this.#s)}set persist(e){r(this.#s,e,!0)}#c=n(!1);get loaded(){return e(this.#c)}set loaded(e){r(this.#c,e,!0)}hostManaged=!1;#l=n(``);get loadNotice(){return e(this.#l)}set loadNotice(e){r(this.#l,e,!0)}saveBlocked=!1;#u=n(!1);get keepLegacyUrl(){return e(this.#u)}set keepLegacyUrl(e){r(this.#u,e,!0)}replacedBeforeLoad=!1;previousKept=!1;storage=null;timer;snapshot(){return In(t(O.data),{layout:t(this.layout),theme:t(this.theme),overviews:t(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=x(e)?void 0:e}setSpecs(e){let t=e.trimEnd();this.specs=t.trim()?t:void 0}apply(e){O.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=[...O.unavailableRecipes,...O.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(){O.removeUnavailable(),this.scheduleSave()}setTheme(e){this.theme=vn(e)}settings(){return Pe(this.snapshot())}setSettings(e){let t=Ne(this.snapshot(),e);O.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++,O.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=kn(e);return t.ok&&this.replace(t.cookbook),t}hydrate(e,t=u()){this.storage=t;let n=Nn(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(Bn(e)&&(n.status===`loaded`&&!Q(t,`smrt-planner:cookbook-doc:backup`,JSON.stringify(n.cookbook))&&(this.saveBlocked=!0),this.apply(Hn(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=Fn(this.storage,this.snapshot());return this.persist=e?`ok`:`memory`,e&&this.previousKept&&(this.previousKept=!Pn(this.storage,An)),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{et as A,N as C,tt as D,ot as E,M as O,st as S,lt as T,hn as _,Mn as a,Gt as b,q as c,ln as d,cn as f,yn as g,sn as h,Z as i,j as k,dn as l,G as m,Wn as n,On as o,fn as p,$ as r,kn as s,Un as t,pn as u,Qt as v,ct as w,F as x,Kt as y};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Cr_Y_U0N.js","./DG3qFFTE.js","./COiEfhsA.js","./xihTtKlq.js","./B1N9X4sc.js","./Bq8E3AWP.js","./denq4QT7.js","../assets/currency-metadata.ksbBA8-C.css","../assets/app.V-5Q6-pe.css","./C9Zasc6Q.js","./Cekjnrta.js","../assets/feedback.DzqKT7fW.css","./C2e2zlhC.js","./BaNbYf_w.js","./D3syEjNq.js","../assets/SegmentedControl.2V179a-S.css","./DmfvgI_r.js","../assets/webmcp-ui-context.D9U5lh8x.css","./21btP0R4.js","../assets/data.C5MjAC5_.css","./CUyVrfsu.js","./B18A9OMt.js","../assets/forms.CaLOi679.css","./BYcBM-fh.js","../assets/AppShell.thGpRNkw.css","./SHRXoxhn.js","../assets/workspace.DZTCJDO9.css","./D5sQ2Umm.js","./DscjQjQg.js","../assets/state.DYNXOUVq.css","./DOL_dsIt.js","../assets/labels.DPtEGJlJ.css","./8KoKLERF.js","./D1Gn2wRJ.js","./CCS83DIe.js","../assets/planner.XUJWm45F.css","./D_U_DYjx.js"])))=>i.map(i=>d[i]);
2
+ import{$ as e,Mt as t,bt as n,vt as r}from"./DG3qFFTE.js";import{t as i}from"./BaNbYf_w.js";import"./xihTtKlq.js";import{I as a,L as o,O as s,Q as c,St as l,W as u,Z as d,_ as f,_t as p,bt as m,et as h,h as g,ht as _,p as v,x as y,yt as b}from"./B1N9X4sc.js";import{v as x}from"./C2e2zlhC.js";import"./D3syEjNq.js";import"./DmfvgI_r.js";import{u as S}from"./21btP0R4.js";import{$ as C,A as w,C as ee,D as te,E as ne,F as re,I as ie,L as T,M as ae,N as oe,P as se,R as ce,T as le,X as E,Y as ue,Z as de,b as fe,h as pe,j as me,k as he,n as ge,q as _e,r as ve,z as ye}from"./D5sQ2Umm.js";import{B as be,D as xe,G as Se,H as Ce,J as we,K as Te,M as Ee,V as De,X as Oe,Y as ke,Z as Ae,a as je,b as D,c as Me,d as Ne,l as Pe,n as Fe,r as Ie,s as Le,t as O,v as Re,x as k,z as ze}from"./DscjQjQg.js";var Be=[`identifier`,`status`,`date`,`party`,`total`,`money`];function Ve(e){for(let t of[`identifier`,`status`,`date`,`money`,`quantity`,`party`,`title`])if(e.includes(t))return t}function He(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 Be)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),...Ve(t[n]??[])?{role:Ve(t[n]??[])}:{}}))}function Ue(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)?re(e.slice(0,-2)):re(e)}function We(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 Ge=[`text`,`integer`,`decimal`,`boolean`,`datetime`,`json`,`foreignKey`,`crossPackageRef`];function Ke(e){return Ge.includes(e)?e:`text`}var qe=/(Date|^date|period(Start|End))$/;function Je(e,t){return t.type===`datetime`&&!t.system&&qe.test(t.name)&&!e.fields.some(e=>e.name===`allDay`)?`date`:void 0}function Ye(e){return fe(e)[0]}function Xe(e,t){let n=t.ui?{...t.ui}:void 0,r=s(t)?`money`:Je(e,t);return{type:Ke(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}:{},...Ye(e)===t.name?{display:!0}:{}}}function Ze(e,t){return e.includes(`:`)?e:`${t.slice(0,t.lastIndexOf(`:`))}:${e}`}function Qe(e,t){if(!t.related)return!1;let n=Ze(t.related,e.id);return ke(p,n,h).some(t=>t.id===e.id)}function $e(e){return e.fields.flatMap(t=>{if(t.type!==`foreignKey`&&t.type!==`crossPackageRef`||!t.related)return[];let n=m(Ze(t.related,e.id));return n?[{field:t.name,kind:t.type===`crossPackageRef`?`crossPackageRef`:`foreignKey`,relatedCollection:n.model.collection,...Qe(e,t)?{role:`items`}:{}}]:[]})}function j(e){let t=$e(e);return{name:e.collection,objectRef:e.id,className:e.name,idField:`id`,fields:Object.fromEntries(e.fields.map(t=>[t.name,Xe(e,t)])),...t.length?{relationships:t}:{}}}function et(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 tt(e,t){let n=new Set(t);for(let t of e)for(let e of t.models)n.add(e);return n}function nt(e){return v(e.replace(/_?id$/i,``)||e)}function M(e,t,n){let r=Oe(e,t),i=new Set(e.packages.flatMap(e=>(e.recipes??[]).filter(e=>e.exposure===`ui-only`).flatMap(e=>e.models))),a=Ae(e,t).filter(e=>(e.model.exposed||i.has(e.model.id))&&n.has(e.model.id)),o=new Set(ke(e,t,h).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=T(n),a=[e.fk];return{model:e.model.id,field:e.fk,label:(s.get(e.model.id)??0)>1?`${Se(e.model.name,r)} (${nt(e.fk).toLowerCase()})`:Se(e.model.name,r),kind:t,columns:t===`items`?Ue(n,i,{exclude:a}):He(n,i,{exclude:a,max:5}),...t===`items`&&`sortOrder`in n.fields?{sort:`sortOrder`}:{}}});for(let n of Te(e,t))c.push({model:n.model.id,field:n.fk,label:nt(n.fk),kind:`reference`});return c}function rt(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 it(e){return e?async(t,n)=>{let r=rt(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}}:rt}var at=new Set([`foreignKey`,`crossPackageRef`]);function N(e,t){return`/m/${e}/${t}/`}function ot(e,t,n,r=`view`){let i=`${N(e,t)}${encodeURIComponent(n)}/`;return r===`edit`?`${i}edit/`:i}function st(e,t,n,r){return`${N(e,t)}?${encodeURIComponent(n)}=${encodeURIComponent(r)}`}function ct(e,t){let n=new URLSearchParams(e);for(let e of t.fields){if(!at.has(e.type))continue;let t=n.get(e.name);if(t)return{field:e.name,equals:t}}}function lt(e){return e?.equals===void 0?``:`${encodeURIComponent(e.field)}=${encodeURIComponent(e.equals)}`}var P=e=>typeof e==`number`&&Number.isSafeInteger(e)?e:null,ut=(e,t)=>e.fields.some(e=>e.name===t);function dt(e,t){let n=T(j(e)),r=ee(t,n);return Object.values(r).some(e=>P(e)!==null)?r:void 0}function ft(e,t){return!!e.fields.find(e=>e.name===`status`)?.enum?.includes(`draft`)&&typeof t.status==`string`&&t.status!==``&&t.status!==`draft`}function pt(e,t,n){if(!ft(e,t)||![`subtotal`,`taxAmount`,`totalAmount`,`discountTotal`].every(t=>ut(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=d(t,`exclusive`);return{subtotal:r,discount:o,tax:i,total:a,lineAmountType:s,roundingScope:c(t,`line`),showNetSubtotal:s===`inclusive`,taxes:_(n,s).flatMap(e=>e.taxComponentId?[{taxComponentId:e.taxComponentId,name:e.name,percent:e.percent,taxable:e.taxable,tax:e.tax}]:[])}}var F=_e();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`?m(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?st(t.packageId,t.model.name,n.field,n.id):t.path)}var H=e=>typeof e==`number`&&Number.isFinite(e);async function mt(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),c=await B(n,a,o),l=V(r,i,o),u=typeof e.measure==`string`?e.measure:``;if(u===`count`||u===``)return{value:c.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=c.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=s(d);return{value:m?Math.round(p):p,format:m?`money`:d.type===`integer`?`integer`:`decimal`,...m?{currency:`USD`}:{},href:l}}function ht(e,t){return H(e)&&H(t)?e-t:String(e??``).localeCompare(String(t??``))}var gt=new Set([`createdAt`,`updatedAt`]),_t=[`identifier`,`status`,`date`,`money`,`quantity`,`party`,`title`];function vt(e=[]){return _t.find(t=>e.includes(t))}function yt(e,t,n,r){let i=j(e),a=r?[r]:[],o=oe(n),s=o.length?[]:pe(O.apply(e).fields.filter(t=>!a.includes(t.name)&&!xe(e,t))).filter(e=>!e.derive),c=o.length?o:s.map(e=>e.name),l=[...Ue(i,t,{exclude:a}),...He(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=vt(t[n]);return{key:n,label:a??(R.has(r.type)?v(n.replace(/Id$/,``)):v(n)),...o?{role:o}:{}}})}var bt=new Set([`money`,`quantity`]);function xt(e,t){let n={};for(let r of e)(r.summarize??bt.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 St(e,t){let n=ie(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 Ct(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)&&!gt.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*ht(e[t],r[t]))}}let c=yt(a,T(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 ve(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(g(r.related,n))??``]:[t.key,n??null]})),m=xt(c,s),h=!we(a);return{rows:await Promise.all(u.map(async e=>({id:String(e.id),title:await ge(n,a,e,0,o?.field),...h?{href:r(ot(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:St(a,s),...Object.keys(m).length?{summaries:m}:{}}}var wt={"7d":7,"30d":30,"90d":90,"12m":365,all:null},U=864e5;function Tt(e){return e===`7d`||e===`30d`?`day`:e===`90d`?`week`:`month`}function Et(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 Dt(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 Ot(e,t){let n=new Date(e).toISOString();return t===`month`?n.slice(0,7):n.slice(0,10)}var kt=e=>e.type===`datetime`&&!e.system;function W(e){let t=e.fields.filter(kt);return t.find(e=>/^(issue|order|start|created)/i.test(e.name))??t[0]}function At(e){if(typeof e!=`string`&&typeof e!=`number`)return;let t=new Date(e).getTime();return Number.isFinite(t)?t:void 0}async function jt(e,t){let{source:n,href:r}=I(t),i=L(e.model),{model:a}=i,o=z(e,t,a),c=typeof e.groupBy==`string`?e.groupBy:``,l=c?a.fields.find(e=>e.name===c):W(a);if(!l)throw Error(c?`${a.name} has no field ${c}`:`${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(wt,f))throw Error(`unknown period ${f}`);let p=wt[f],m=kt(l),h=m?l:W(a),g=p!==null&&h?y-p*U:-1/0,_=await B(n,a,o);h&&g!==-1/0&&(_=_.filter(e=>{let t=At(e[h.name]);return t!==void 0&&t>=g&&t<=y}));let v=new Map,b=(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=Tt(f);if(m){let e=g===-1/0?Math.min(..._.map(e=>At(e[l.name])??y),y):g;for(let t=Et(e,x);t<=y;t=Dt(t,x))v.set(Ot(t,x),{key:t,sum:0,n:0});for(let e of _){let t=At(e[l.name]);if(t===void 0)continue;let n=Et(t,x);b(Ot(n,x),n,e)}}else for(let e of _){let t=e[l.name],n=t==null||t===``?`(none)`:String(t);b(n,n,e)}let S=d?s(d):!1,C=e=>{if(!d)return e.n;let t=u===`avg`&&e.n?e.sum/e.n:e.sum;return S?Math.round(t):t},w=[...v.entries()].map(([e,t])=>({label:e,value:C(t),key:t.key}));return w=m?w.sort((e,t)=>Number(e.key)-Number(t.key)):w.sort((e,t)=>t.value-e.value||e.label.localeCompare(t.label)),{points:w.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)}}te(F,{metric:mt,records:Ct,chart:jt,shortcuts:async(e,t)=>t,shortcuts:it()});function Mt(e){let{relations:t,viewAllHref:n}=e;if(!t)throw Error(`the record page context is missing`);return{relations:t,records:Ct,viewAllHref:n}}async function Nt(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?m(o.model)?.model:void 0,c=pt(i,a,o&&s?await n.listWhere(s,o.field,r.id):[]),l=c?void 0:dt(i,a),u=ie(j(i)),d=u?a[u]:void 0;return{...c?{storedTotals:c}:{},...l?{totals:l}:{},...typeof d==`string`&&d?{currency:d}:{}}}F.register(ne((e,t)=>w(Mt(t))(e,t))),F.register(le(async(e,t)=>{let n=Mt(t),{totals:r,storedTotals:i,currency:a}=await Nt(t,n.relations);return he({...n,totals:()=>r,storedTotals:()=>i,currency:()=>a})(e,t)}));var Pt=[`shortcuts`,`metric`,`records`,`chart`,`note`],Ft={"@happyvertical/smrt-reports/svelte":async()=>({SavedReportsWidget:(await i(async()=>{let{default:e}=await import(`./Cr_Y_U0N.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,36]),import.meta.url)).default})},It=async(e,t)=>{let n=Ft[e];if(n)return(await n())[t]},Lt=D.filter(e=>e.surfaces?.some(e=>e.kind===`widget`)),Rt=Lt.flatMap(e=>(e.surfaces??[]).flatMap(e=>e.kind===`widget`?[e.type]:[]));ce(F,Lt,It);var zt=new Map(ze(D).map(e=>[`section:${e.id}`,e])),Bt=p.packages.flatMap(e=>e.models.map(e=>e.id)),Vt=[...Pt,...Rt];function Ht(e){let t=zt.get(e);for(let e of t?.recipes??[]){let t=Re(e)[0];if(t)return{id:t.model.id,name:v(t.model.name)}}}function Ut(e,t){let n=ye(zt.get(e)?.recipes[0]),r=Ht(e);return We({lead:r?{...r,plural:f(r.name)}:void 0,dataWidgets:!0,page:n&&Rt.includes(n.type)?n:void 0,override:t})}var Wt=new Map;function Gt(e,t){if(!C.test(e))return;let n=Wt.get(e);return n||(n=E({id:e,allowed:Vt,models:Bt,defaults:Ut(e)}),Wt.set(e,n)),t===void 0?n:E({...n,defaults:Ut(e,t)})}function Kt(e,t){return`detail:${e}.${t}`}var qt=new Map(p.packages.flatMap(e=>e.models.filter(l).map(t=>[ae(t.id),{packageId:e.id,model:t}])));function Jt(e){let[,t,n]=/^detail:([A-Za-z0-9_-]+)\.([A-Za-z0-9_]+)$/.exec(e)??[],r=t&&n?b(t,n):void 0;return t&&r&&l(r)?{packageId:t,model:r}:qt.get(e)}var Yt=new Set(p.packages.flatMap(e=>e.models.filter(l).map(e=>e.id))),Xt=new Map;function Zt(e){let t=Xt.get(e);if(t)return t;let n=Jt(e);if(!n)return;let r=M(p,n.model.id,Yt),i=me(j(n.model),r,{id:e,maxMetrics:2*r.length});return t=E({...i,maxWidgets:Math.max(i.maxWidgets??24,i.defaults.length+24)}),Xt.set(e,t),t}function Qt(e,t){let n=Zt(e),r=Jt(e);if(!n||!r)return;let i=M(p,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 E({...n,defaults:o})}function $t(e,t){return e.startsWith(`detail:`)?Zt(e):Gt(e,t)}function en(e,t){return zt.has(e)||e===`section:${Ee.id}`?!0:e.startsWith(`detail:`)?Jt(e)!==void 0:e.startsWith(`custom:`)&&C.test(e)&&(t?.customSections??[]).some(t=>t.id===e)}var tn=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function nn(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 rn(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 an(e,t){let n=$t(e,t);if(!n)return{override:null,issues:[{widgetId:null,type:null,code:`malformed`,message:`not an overview id`}]};let r=ue(n,t,F);if(r.ok){let e=de(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=de(t),a=new Set(r.issues.flatMap(e=>e.widgetId?[e.widgetId]:[]));if(!i.override)return{override:null,issues:r.issues};let o=ue(n,rn(i.override,a),F);return o.ok?{override:o.override,issues:r.issues}:{override:null,issues:[...r.issues,...o.issues]}}function on(e,t){if(!tn(e))return null;let n=[],r=[];for(let i of Object.keys(e).sort()){if(!en(i,t)){r.push(`Overview ${i} is not a page in this app and was dropped.`);continue}let{override:a,issues:o}=an(i,e[i]);for(let e of o)r.push(nn(i,e));a&&n.push([i,a])}return{overviews:Object.fromEntries(n),dropped:r}}var sn=S,cn=`glass`,ln=`system`,un=[`light`,`dark`,`system`],dn=[`none`,`sm`,`md`,`lg`,`xl`,`full`],fn=[`comfortable`,`touch`],pn=[`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`},mn=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i;function hn(e){if(typeof e!=`string`)return null;let t=mn.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 gn=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function _n(e){if(e===void 0)return{ok:!0,theme:void 0};if(!gn(e))return{ok:!1,error:`The cookbook "theme" must be an object.`};let t={};if(e.preset!==void 0){if(typeof e.preset!=`string`||!sn.includes(e.preset))return{ok:!1,error:`The theme preset must be one of ${sn.join(`, `)}.`};t.preset=e.preset}if(e.colorScheme!==void 0){if(!un.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`,dn],[`density`,fn],[`contrast`,pn]]){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(!gn(e.custom))return{ok:!1,error:`The theme "custom" must be an object.`};let n=hn(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 vn(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 yn(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 bn(e,t=be(D)){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 xn(e,t=D){let n=new Map;for(let e of t){let t=Ce(e).id;for(let r of Re(e))r.key&&n.set(`${K}${t}:${r.packageId}:${r.model.name}:${r.label}`,De(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:De(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`,Sn=new Set([`basic`,`advanced`,`hidden`]),Cn=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 wn(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`&&Sn.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 Tn(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 En(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=>!k.has(e)),i=[...new Set([...je(e.recipes.filter(e=>k.has(e)),k),...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=>k.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=wn(n,`policies[${t}]`);if(typeof e==`string`)return J(`Invalid cookbook: ${e}.`);(o.has(e.objectRef)||Me(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=>Cn.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=Tn(e.layout);if(typeof t==`string`)return J(`Invalid cookbook: ${t}.`);l=xn(bn(t))}let u;if(e.theme!==void 0){let n=_n(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 Dn=e=>({ok:!1,error:e});function On(e,t={}){return En(e,{...t,overviews:on})}function kn(e,t={}){let n;try{n=JSON.parse(e)}catch{return Dn(`This file is not valid JSON.`)}try{return On(n,t)}catch{return Dn(`This file is not a valid cookbook.`)}}var Z=`smrt-planner:cookbook-doc:v1`,An=`smrt-planner:blueprint:v1`,jn=`smrt-planner:cookbook-doc:unreadable`;function Mn(){try{return globalThis.localStorage??null}catch{return null}}function Nn(e){if(!e)return{status:`unavailable`};let t;try{t=e.getItem(Z)}catch{return{status:`unavailable`}}let n=null;try{n=e.getItem(An)}catch{}let r=t===null&&n!==null,i=r?n:t;if(i===null)return{status:`empty`};let a=kn(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,jn,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 Pn(e,t){if(!e)return!1;try{return e.removeItem(t),!0}catch{return!1}}function Fn(e,t){return Q(e,Z,JSON.stringify(t))}function In(e,t={}){let n={$schema:q,version:1,...Fe(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=vn(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 Ln=new Set([`basic`,`advanced`,`hidden`]),Rn=new Set([`api`,`mcp`,`cli`]);function zn(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 Bn(e){let t=new URLSearchParams(e);return t.has(`r`)||t.has(`o`)}function Vn(e){let t={rows:[],narrowed:{}};if(!e)return t;let n;try{n=JSON.parse(zn(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`&&Ln.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=>Rn.has(e));n.length&&(i[e]=n)}return{rows:r,narrowed:i}}function Hn(e){let t=new URLSearchParams(e),n=(t.get(`r`)??``).split(`,`).filter(Boolean),r=je(Ie(n,k),k),i=new Set(r.flatMap(e=>k.get(e)?.models??[])),{rows:a,narrowed:o}=Vn(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 Un=`smrt-planner:shell`;function $(e){let t=Pe(e),n=e.policies.some(e=>e.defaultValue!==void 0&&Me(e));o(Le(e)||n?t.taxRate:void 0),a({pricesIncludeTax:t.pricesIncludeTax,taxRounding:t.taxRounding,currency:t.currency})}var Wn=new class{#e=n(0);get replacementGeneration(){return e(this.#e)}set replacementGeneration(e){r(this.#e,e,!0)}#t=n();get layout(){return e(this.#t)}set layout(e){r(this.#t,e,!0)}#n=n();get name(){return e(this.#n)}set name(e){r(this.#n,e,!0)}#r=n();get description(){return e(this.#r)}set description(e){r(this.#r,e,!0)}#i=n();get specs(){return e(this.#i)}set specs(e){r(this.#i,e,!0)}#a=n();get theme(){return e(this.#a)}set theme(e){r(this.#a,e,!0)}#o=n({});get overviews(){return e(this.#o)}set overviews(e){r(this.#o,e)}#s=n(`unknown`);get persist(){return e(this.#s)}set persist(e){r(this.#s,e,!0)}#c=n(!1);get loaded(){return e(this.#c)}set loaded(e){r(this.#c,e,!0)}hostManaged=!1;#l=n(``);get loadNotice(){return e(this.#l)}set loadNotice(e){r(this.#l,e,!0)}saveBlocked=!1;#u=n(!1);get keepLegacyUrl(){return e(this.#u)}set keepLegacyUrl(e){r(this.#u,e,!0)}replacedBeforeLoad=!1;previousKept=!1;storage=null;timer;snapshot(){return In(t(O.data),{layout:t(this.layout),theme:t(this.theme),overviews:t(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=x(e)?void 0:e}setSpecs(e){let t=e.trimEnd();this.specs=t.trim()?t:void 0}apply(e){O.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=[...O.unavailableRecipes,...O.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(){O.removeUnavailable(),this.scheduleSave()}setTheme(e){this.theme=vn(e)}settings(){return Pe(this.snapshot())}setSettings(e){let t=Ne(this.snapshot(),e);O.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++,O.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=kn(e);return t.ok&&this.replace(t.cookbook),t}hydrate(e,t=u()){this.storage=t;let n=Nn(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(Bn(e)&&(n.status===`loaded`&&!Q(t,`smrt-planner:cookbook-doc:backup`,JSON.stringify(n.cookbook))&&(this.saveBlocked=!0),this.apply(Hn(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=Fn(this.storage,this.snapshot());return this.persist=e?`ok`:`memory`,e&&this.previousKept&&(this.previousKept=!Pn(this.storage,An)),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{et as A,N as C,tt as D,ot as E,M as O,st as S,lt as T,hn as _,Mn as a,Gt as b,q as c,ln as d,cn as f,yn as g,sn as h,Z as i,j as k,dn as l,G as m,Wn as n,On as o,fn as p,$ as r,kn as s,Un as t,pn as u,Qt as v,ct as w,F as x,Kt as y};
@@ -1,4 +1,4 @@
1
- import{$ as e,B as t,Ct as n,Dt as r,E as i,Et as a,F as o,Ft as s,G as c,H as l,I as u,K as d,L as f,Lt as p,Ot as m,Pt as h,U as g,W as _,X as v,Y as y,a as b,bt as x,ct as S,d as C,ft as w,gt as T,ht as E,k as ee,mt as D,pt as O,q as k,st as A,v as j,vt as M}from"./DG3qFFTE.js";import"./xihTtKlq.js";import{a as N}from"./Cekjnrta.js";import"./Bq8E3AWP.js";import{_t as te,bt as P,p as F,u as I,vt as ne}from"./IVfnZdeW.js";import"./denq4QT7.js";import"./D3syEjNq.js";import"./CbOFRn1N.js";y([`click`]),y([`click`,`keydown`]),y([`click`]);var L=[1,1.5,2,3,4,5];L[0],L[L.length-1],y([`click`,`pointerdown`,`pointermove`,`pointerup`]);var R=new Map(Object.entries({menu:`M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z`,search:`M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z`,close:`M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z`,"chevron-right":`M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z`,"chevron-left":`M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z`,"chevron-down":`M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z`,check:`M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z`,add:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`,mic:`M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.04 6.43 5 7.07V21h4v-2.93c2.96-.64 5-3.54 5-7.07h-2z`,alert:`M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1 5h2v6h-2zm0 8h2v2h-2z`,warning:`M1 21h22L12 2 1 21zm12-3h-2v-2h2zm0-4h-2v-4h2z`,info:`M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 15h-2v-6h2zm0-8h-2V7h2z`,home:`M3 10 12 2 21 10v11h-6v-7H9v7H3z`,user:`M12 3a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM4 21v-2c0-4 16-4 16 0v2H4z`,settings:`M10 2h4l1 3 3-1 3 3-1 3 3 1v4l-3 1 1 3-3 3-3-1-1 3h-4l-1-3-3 1-3-3 1-3-3-1v-4l3-1-1-3 3-3 3 1 1-3zm2 6a4 4 0 1 0 0 8 4 4 0 0 0 0-8z`,trash:`M7 3h10v2h4v2H3V5h4V3zm-2 6h14v12H5V9zm4 2v8h2v-8H9zm4 0v8h2v-8h-2z`,edit:`M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z`,calendar:`M7 2h2v2h6V2h2v2h4v18H3V4h4V2zm-2 8v10h14V10H5zm2 2h4v4H7v-4z`,clock:`M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 2a8 8 0 1 1 0 16 8 8 0 0 1 0-16zm-1 2h2v5.5l4 2.5-1 1.5-5-3V6z`,camera:`M9 3h6l2 3h4v15H3V6h4l2-3zm3 5a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm0 2a3 3 0 1 1 0 6 3 3 0 0 1 0-6z`,upload:`M11 16V7l-4 4-1.5-1.5L12 3l6.5 6.5L17 11l-4-4v9h-2zM3 18h18v3H3v-3z`,download:`M11 3h2v9l4-4 1.5 1.5L12 16l-6.5-6.5L7 8l4 4V3zM3 18h18v3H3v-3z`})),z=x([]);function B(t){for(let n=e(z).length-1;n>=0;n--){let r=e(z)[n].paths.get(t);if(r!==void 0)return r}return R.get(t)}var V=d(`<svg xmlns="http://www.w3.org/2000/svg" data-smrt-component="Icon" class="svelte-em2a54"><path></path></svg>`);function H(t,i){m(i,!0);let a=b(i,`size`,3,24),o=b(i,`color`,3,`currentColor`),s=b(i,`viewBox`,3,`0 0 24 24`),c=n(()=>!!i[`aria-label`]),l=n(()=>i.path??(i.name?B(i.name):``)),u=n(()=>typeof a()==`number`?`${a()}px`:a());var d=V(),f=D(d);A(()=>{j(d,`width`,e(u)),j(d,`height`,e(u)),j(d,`viewBox`,s()),j(d,`fill`,o()),j(d,`aria-hidden`,!e(c)),j(d,`aria-label`,i[`aria-label`]),j(d,`role`,e(c)?`img`:void 0),j(f,`d`,e(l))}),g(t,d),r()}var re=c(`<p class="smrt-empty-state__description svelte-1x475nf" data-smrt-part="description"> </p>`),ie=c(`<a class="smrt-empty-state__action svelte-1x475nf" data-smrt-part="trigger"> </a>`),ae=c(`<button type="button" class="smrt-empty-state__action svelte-1x475nf" data-smrt-part="trigger"> </button>`),oe=c(`<div data-smrt-component="EmptyState"><div class="smrt-empty-state__icon svelte-1x475nf" data-smrt-part="icon"><!></div> <h3 class="smrt-empty-state__title svelte-1x475nf" data-smrt-part="title"> </h3> <!> <!></div>`);function se(e,n){let r=b(n,`icon`,3,`inbox`),a=b(n,`size`,3,`md`),c={document:`<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
1
+ import{$ as e,B as t,Ct as n,Dt as r,E as i,Et as a,F as o,Ft as s,G as c,H as l,I as u,K as d,L as f,Lt as p,Ot as m,Pt as h,U as g,W as _,X as v,Y as y,a as b,bt as x,ct as S,d as C,ft as w,gt as T,ht as E,k as ee,mt as D,pt as O,q as k,st as A,v as j,vt as M}from"./DG3qFFTE.js";import"./xihTtKlq.js";import{a as N}from"./Cekjnrta.js";import"./Bq8E3AWP.js";import{_t as te,bt as P,p as F,u as I,vt as ne}from"./B1N9X4sc.js";import"./denq4QT7.js";import"./D3syEjNq.js";import"./21btP0R4.js";y([`click`]),y([`click`,`keydown`]),y([`click`]);var L=[1,1.5,2,3,4,5];L[0],L[L.length-1],y([`click`,`pointerdown`,`pointermove`,`pointerup`]);var R=new Map(Object.entries({menu:`M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z`,search:`M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z`,close:`M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z`,"chevron-right":`M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z`,"chevron-left":`M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z`,"chevron-down":`M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z`,check:`M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z`,add:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`,mic:`M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.04 6.43 5 7.07V21h4v-2.93c2.96-.64 5-3.54 5-7.07h-2z`,alert:`M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1 5h2v6h-2zm0 8h2v2h-2z`,warning:`M1 21h22L12 2 1 21zm12-3h-2v-2h2zm0-4h-2v-4h2z`,info:`M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 15h-2v-6h2zm0-8h-2V7h2z`,home:`M3 10 12 2 21 10v11h-6v-7H9v7H3z`,user:`M12 3a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM4 21v-2c0-4 16-4 16 0v2H4z`,settings:`M10 2h4l1 3 3-1 3 3-1 3 3 1v4l-3 1 1 3-3 3-3-1-1 3h-4l-1-3-3 1-3-3 1-3-3-1v-4l3-1-1-3 3-3 3 1 1-3zm2 6a4 4 0 1 0 0 8 4 4 0 0 0 0-8z`,trash:`M7 3h10v2h4v2H3V5h4V3zm-2 6h14v12H5V9zm4 2v8h2v-8H9zm4 0v8h2v-8h-2z`,edit:`M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z`,calendar:`M7 2h2v2h6V2h2v2h4v18H3V4h4V2zm-2 8v10h14V10H5zm2 2h4v4H7v-4z`,clock:`M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 2a8 8 0 1 1 0 16 8 8 0 0 1 0-16zm-1 2h2v5.5l4 2.5-1 1.5-5-3V6z`,camera:`M9 3h6l2 3h4v15H3V6h4l2-3zm3 5a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm0 2a3 3 0 1 1 0 6 3 3 0 0 1 0-6z`,upload:`M11 16V7l-4 4-1.5-1.5L12 3l6.5 6.5L17 11l-4-4v9h-2zM3 18h18v3H3v-3z`,download:`M11 3h2v9l4-4 1.5 1.5L12 16l-6.5-6.5L7 8l4 4V3zM3 18h18v3H3v-3z`})),z=x([]);function B(t){for(let n=e(z).length-1;n>=0;n--){let r=e(z)[n].paths.get(t);if(r!==void 0)return r}return R.get(t)}var V=d(`<svg xmlns="http://www.w3.org/2000/svg" data-smrt-component="Icon" class="svelte-em2a54"><path></path></svg>`);function H(t,i){m(i,!0);let a=b(i,`size`,3,24),o=b(i,`color`,3,`currentColor`),s=b(i,`viewBox`,3,`0 0 24 24`),c=n(()=>!!i[`aria-label`]),l=n(()=>i.path??(i.name?B(i.name):``)),u=n(()=>typeof a()==`number`?`${a()}px`:a());var d=V(),f=D(d);A(()=>{j(d,`width`,e(u)),j(d,`height`,e(u)),j(d,`viewBox`,s()),j(d,`fill`,o()),j(d,`aria-hidden`,!e(c)),j(d,`aria-label`,i[`aria-label`]),j(d,`role`,e(c)?`img`:void 0),j(f,`d`,e(l))}),g(t,d),r()}var re=c(`<p class="smrt-empty-state__description svelte-1x475nf" data-smrt-part="description"> </p>`),ie=c(`<a class="smrt-empty-state__action svelte-1x475nf" data-smrt-part="trigger"> </a>`),ae=c(`<button type="button" class="smrt-empty-state__action svelte-1x475nf" data-smrt-part="trigger"> </button>`),oe=c(`<div data-smrt-component="EmptyState"><div class="smrt-empty-state__icon svelte-1x475nf" data-smrt-part="icon"><!></div> <h3 class="smrt-empty-state__title svelte-1x475nf" data-smrt-part="title"> </h3> <!> <!></div>`);function se(e,n){let r=b(n,`icon`,3,`inbox`),a=b(n,`size`,3,`md`),c={document:`<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
2
2
  <path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z"/>
3
3
  <path d="M14 2v6h6M16 13H8M16 17H8M10 9H8"/>
4
4
  </svg>`,folder:`<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BGpjZKOE.js","./BaNbYf_w.js","./eBF8D7GD.js"])))=>i.map(i=>d[i]);
2
- import{$ as e,B as t,Ct as n,Dt as r,E as i,Et as a,F as o,Ft as s,G as c,H as l,I as u,J as d,K as f,L as p,Lt as m,Mt as h,Ot as g,P as _,Pt as v,R as y,Rt as b,T as x,U as S,W as C,X as w,Y as T,Z as E,_ as D,_t as O,a as k,bt as A,ct as j,d as M,dt as N,f as P,ft as F,gt as I,ht as L,k as ee,kt as R,lt as te,mt as z,n as ne,nt as re,ot as ie,pt as B,q as ae,r as V,rt as oe,st as H,tt as se,v as U,vt as W,xt as ce,yt as le,z as G}from"./DG3qFFTE.js";import{t as ue}from"./BaNbYf_w.js";import"./xihTtKlq.js";import{r as de}from"./Cekjnrta.js";import{a as K,t as q}from"./Bq8E3AWP.js";import{B as fe,Mt as pe,Pt as J,R as me,W as he}from"./IVfnZdeW.js";import{n as Y}from"./denq4QT7.js";import{C as X,S as ge,b as _e,x as ve}from"./DitEeA6X.js";import{n as ye,r as be}from"./D3syEjNq.js";import{i as xe}from"./CbOFRn1N.js";import{_ as Se,b as Ce,c as we,d as Te,g as Ee,h as De,i as Oe,m as ke,n as Ae,p as je,s as Me}from"./B18A9OMt.js";import{n as Ne}from"./CtG_Lwvh.js";import{n as Pe,r as Fe}from"./DnUMJJeH.js";import{c as Ie,t as Le}from"./eBF8D7GD.js";import{_ as Re,a as ze,g as Be,h as Ve,l as He,n as Ue,p as We,u as Ge}from"./VBANaoR3.js";import{Q as Z,b as Ke,t as qe}from"./DKGzf415.js";import{C as Je,_ as Ye,h as Xe,i as Ze,m as Qe,o as $e,r as et,t as tt,u as nt}from"./B9ucQYIA.js";import{n as rt,t as it}from"./BizV6cxC.js";function at(e,t){let n=t.trim();if(!n)return;let r=e.value,i=typeof document<`u`&&document.activeElement===e,a=e.selectionStart??r.length,o=e.selectionEnd??r.length;!i&&a===0&&o===0&&r.length>0&&(a=r.length,o=r.length);let s=r.slice(0,a),c=r.slice(o),l=`${s.length>0&&!/\s$/.test(s)?` `:``}${n}${/^[\p{L}\p{N}]/u.test(c)?` `:``}`;e.value=`${s}${l}${c}`;let u=s.length+l.length;try{e.setSelectionRange(u,u)}catch{}e.dispatchEvent(new Event(`input`,{bubbles:!0}))}function ot(e){let t=e,n=null,r=null,i=0,a=0,o=null,s=!1,c=!1,l=null;function u(){n&&clearTimeout(n),n=null}function d(){u(),r=null,o=null,s=!1}function f(){n&&(d(),t.onCancel?.())}function p(e){let n=!t.filter||t.filter(e);return n?n===!0?e.target instanceof Element?e.target:null:n:null}function m(){c=!0,l&&clearTimeout(l),l=setTimeout(()=>{c=!1,l=null},400)}return{handlePointerDown(e){if(t.disabled||!e.isPrimary||e.pointerType===`mouse`&&e.button!==0)return;let c=p(e);if(!c)return;d(),r=e.pointerId,i=e.clientX,a=e.clientY,o={target:c,pointerType:e.pointerType||`mouse`,clientX:e.clientX,clientY:e.clientY},t.onPressStart?.(o);let l=o;n=setTimeout(()=>{n=null,s=!0,t.onLongPress(l)},t.delay??500)},handlePointerMove(e){if(!n||e.pointerId!==r)return;let o=t.moveTolerance??10;Math.hypot(e.clientX-i,e.clientY-a)>o&&f()},handlePointerUp(e){if(e.pointerId===r){if(n)f();else if(s&&o){let e=o;m(),d(),t.onRelease?.(e)}else d()}},handlePointerCancel(e){if(e.pointerId===r){if(n)f();else if(s&&o){let e=o;d(),t.onRelease?.(e)}else d()}},handleDragStart(){f()},handleContextMenu(e){t.preventContextMenu&&(n||s)&&e.preventDefault()},handleClick(e){c&&(c=!1,l&&clearTimeout(l),l=null,e.preventDefault(),e.stopPropagation())},cancel(){d()},update(e){t=e,e.disabled&&d()},get pending(){return n!==null},get fired(){return s}}}function st(e,t){let n=ot(t),r=e=>n.handlePointerDown(e),i=e=>n.handlePointerMove(e),a=e=>n.handlePointerUp(e),o=e=>n.handlePointerCancel(e),s=()=>n.handleDragStart(),c=e=>n.handleContextMenu(e),l=e=>n.handleClick(e);return e.addEventListener(`pointerdown`,r),e.addEventListener(`dragstart`,s),e.addEventListener(`contextmenu`,c),e.addEventListener(`click`,l,!0),window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,a),window.addEventListener(`pointercancel`,o),{update(e){n.update(e)},destroy(){n.cancel(),e.removeEventListener(`pointerdown`,r),e.removeEventListener(`dragstart`,s),e.removeEventListener(`contextmenu`,c),e.removeEventListener(`click`,l,!0),window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointercancel`,o)}}}var ct=new WeakMap;async function lt(e,t={}){let n=Math.max(0,t.quietMs??120),r=Math.max(0,t.timeoutMs??5e3),i=Date.now(),a=()=>Math.max(0,r-(Date.now()-i)),o=e=>new Promise(t=>setTimeout(t,e));for(;;){let n=ct.get(e);if(!n||n.size===0||t.signal?.aborted)break;let r=a();if(r===0)return;await Promise.race([Promise.all([...n]),o(r)])}t.signal?.aborted||a()===0||await new Promise(r=>{let i=null,o=[],s=()=>{i&&clearTimeout(i),clearTimeout(l);for(let e of o)e();t.signal?.removeEventListener(`abort`,s),r()},c=()=>{i&&clearTimeout(i),i=setTimeout(s,n)},l=setTimeout(s,a());t.signal?.addEventListener(`abort`,s,{once:!0}),o.push(e.subscribe(e=>{(e.type===`registered`||e.type===`unregistered`)&&c()}));for(let e of t.alsoWatch??[]){let t=e?.subscribe?.(()=>c());t&&o.push(t)}c()})}async function ut(e={}){let t=e.window??(typeof window<`u`?window:void 0),n=e.navigator??(typeof navigator<`u`?navigator:void 0);return!t||!(`SpeechRecognition`in t)&&!(`webkitSpeechRecognition`in t)?`missing`:n&&`brave`in n&&n.brave||/\bElectron\//.test(n?.userAgent??``)?`unreliable`:`works`}function dt(e){return new Worker(new URL(`../workers/local-speech.worker-BzGX7Qdn.js`,import.meta.url).href,{name:e?.name})}var ft=2**28,pt=16,mt=.95;function ht(e){if(e===0)return 1;let t=Math.PI*e;return Math.sin(t)/t}function gt(e,t,n){for(let[e,r]of[[`fromRate`,t],[`toRate`,n]])if(!Number.isFinite(r)||r<=0)throw new Ie(`invalid_argument`,`${e} must be a positive finite number (got ${String(r)})`);let r=Math.floor(e.length*n/t);if(r>ft)throw new Ie(`invalid_argument`,`resampled output would be ${r} samples; the limit is ${ft}`);if(t===n)return e.slice();let i=new Float32Array(r),a=t/n,o=a>1?mt/a:1,s=pt/o,c=e.length-1;for(let t=0;t<r;t+=1){let n=t*a,r=Math.max(0,Math.ceil(n-s)),l=Math.min(c,Math.floor(n+s)),u=0,d=0;for(let t=r;t<=l;t+=1){let r=t-n,i=.5+.5*Math.cos(Math.PI*r/s),a=o*ht(o*r)*i;u+=a*e[t],d+=a}i[t]=d===0?0:u/d}return i}var _t={silenceMs:800,minSpeechMs:150,preRollMs:300,maxUtteranceMs:3e4,sensitivity:.5,calibrateMs:300},vt=.0015,yt=.003,bt=.006,xt=.2,St=.02,Ct=2e3,wt=250;function Tt(e,t,n){return Math.min(n,Math.max(t,e))}function Et(e={}){let t=(e,t,n)=>typeof e==`number`&&Number.isFinite(e)?Math.max(n,e):t;return{silenceMs:t(e.silenceMs,_t.silenceMs,20),minSpeechMs:t(e.minSpeechMs,_t.minSpeechMs,0),preRollMs:t(e.preRollMs,_t.preRollMs,0),maxUtteranceMs:t(e.maxUtteranceMs,_t.maxUtteranceMs,1e3),sensitivity:Tt(typeof e.sensitivity==`number`&&Number.isFinite(e.sensitivity)?e.sensitivity:_t.sensitivity,0,1),calibrateMs:t(e.calibrateMs,_t.calibrateMs,0)}}function Dt(e){let t=e.length;if(t===0)return 0;let n=0;for(let r=0;r<t;r++){let t=e[r];n+=t*t}return Math.sqrt(n/t)}function Ot(e={}){let t=Et(e),n=6-4*t.sensitivity,r=.02-.015*t.sensitivity,i=yt,a=0,o=[],s=!1,c=0,l=0,u=0,d=()=>Math.max(i*n,r),f=()=>Math.max(d()*.6,i*1.5),p=()=>{s=!1,c=0,l=0,u=0};return{get speaking(){return s},get noiseFloor(){return i},get threshold(){return d()},push(e,n=20){let r=[],m=Number.isFinite(e)?Math.max(0,e):0,h=Tt(m/(d()*3),0,1),g=a<t.calibrateMs;if(g&&(a+=n,!s)){o.push(m);let e=[...o].sort((e,t)=>e-t);i=Tt(e[Math.min(e.length-1,Math.floor(e.length*xt))]??yt,vt,bt)}if(!s){if(m>d())c+=n,c>=t.minSpeechMs&&(s=!0,l=0,u=c,r.push({type:`start`,leadMs:t.preRollMs+c}),c=0);else if(g)c=0;else{c=0;let e=n/Ct*(m<i?4:1);i=Tt(i+(m-i)*Math.min(1,e),vt,St)}return{events:r,level:h,speaking:s}}return u+=n,m>f()?l=0:l+=n,l>=t.silenceMs?(r.push({type:`end`,reason:`silence`,trailingSilenceMs:l}),p()):u>=t.maxUtteranceMs&&(r.push({type:`split`}),u=0,l=0),{events:r,level:h,speaking:s}},flush(){let e=[];return s&&e.push({type:`end`,reason:`flush`,trailingSilenceMs:l}),p(),e}}}function kt(e){let t=Et(e),n=Ot(t),r=Math.max(1,Math.round(e.sampleRate*20/1e3)),i=r/e.sampleRate*1e3,a=Math.ceil((t.preRollMs+t.minSpeechMs)/i)+1,o=[],s=new Float32Array,c=null,l=!1,u=(t,n,r)=>{let a=Math.max(0,Math.floor((r-wt)/i)),o=t.slice(0,Math.max(1,t.length-a)),s=0;for(let e of o)s+=e.length;let c=new Float32Array(s),l=0;for(let e of o)c.set(e,l),l+=e.length;e.onUtterance({pcm:c,sampleRate:e.sampleRate,durationMs:s/e.sampleRate*1e3,reason:n})},d=t=>{t!==l&&(l=t,e.onSpeaking?.(t))},f=s=>{let l=n.push(Dt(s),i);e.onLevel?.(l.level),o.push(s),o.length>a&&o.shift(),c&&c.push(s);for(let e of l.events)if(e.type===`start`){c=[...o];let e=Math.ceil(t.preRollMs/i),n=Math.max(0,o.length-Math.ceil(t.minSpeechMs/i));for(let t=n;t<e;t++)c.unshift(new Float32Array(r))}else if(e.type===`end`){let t=c??[];c=null,o.length=0,t.length>0&&u(t,e.reason,e.trailingSilenceMs)}else if(e.type===`split`){let e=c??[];c=[],e.length>0&&u(e,`max`,0)}d(n.speaking)};return{get speaking(){return n.speaking},segmenter:n,push(e){let t=e;s.length>0&&(t=new Float32Array(s.length+e.length),t.set(s,0),t.set(e,s.length));let n=0;for(;n+r<=t.length;)f(t.slice(n,n+r)),n+=r;s=t.slice(n)},flush(){let t=n.flush();for(let e of t)e.type===`end`&&c&&c.length>0&&u(c,`flush`,e.trailingSilenceMs);c=null,o.length=0,s=new Float32Array,d(!1),e.onLevel?.(0)},discard(){n.flush(),c=null,o.length=0,s=new Float32Array,d(!1),e.onLevel?.(0)}}}var At=44,jt=4294967295,Mt=1;function Nt(e){let t=new Int16Array(e.length);for(let n=0;n<e.length;n+=1){let r=e[n];Number.isNaN(r)||(t[n]=Math.min(32767,Math.round((r>1?1:r<-1?-1:r)*32768)))}return t}function Pt(e,t){if(!Number.isInteger(e)||e<1||e*2>jt)throw new Ie(`invalid_argument`,`${t} must be a positive integer sample rate (got ${String(e)})`)}function Ft(e,t,n){for(let r=0;r<n.length;r+=1)e.setUint8(t+r,n.charCodeAt(r))}function It(e,t){Pt(t,`sampleRate`);let n=e.length*2;if(n+At-8>jt)throw new Ie(`invalid_argument`,`too many samples for a single WAV (4 GiB limit)`);let r=e instanceof Int16Array?e:Nt(e),i=new Uint8Array(At+n),a=new DataView(i.buffer);Ft(a,0,`RIFF`),a.setUint32(4,36+n,!0),Ft(a,8,`WAVE`),Ft(a,12,`fmt `),a.setUint32(16,16,!0),a.setUint16(20,Mt,!0),a.setUint16(22,1,!0),a.setUint32(24,t,!0),a.setUint32(28,t*2,!0),a.setUint16(32,2,!0),a.setUint16(34,16,!0),Ft(a,36,`data`),a.setUint32(40,n,!0);for(let e=0;e<r.length;e+=1)a.setInt16(At+e*2,r[e],!0);return i}var Lt=`hv-pcm-tap`,Rt=`
2
+ import{$ as e,B as t,Ct as n,Dt as r,E as i,Et as a,F as o,Ft as s,G as c,H as l,I as u,J as d,K as f,L as p,Lt as m,Mt as h,Ot as g,P as _,Pt as v,R as y,Rt as b,T as x,U as S,W as C,X as w,Y as T,Z as E,_ as D,_t as O,a as k,bt as A,ct as j,d as M,dt as N,f as P,ft as F,gt as I,ht as L,k as ee,kt as R,lt as te,mt as z,n as ne,nt as re,ot as ie,pt as B,q as ae,r as V,rt as oe,st as H,tt as se,v as U,vt as W,xt as ce,yt as le,z as G}from"./DG3qFFTE.js";import{t as ue}from"./BaNbYf_w.js";import"./xihTtKlq.js";import{r as de}from"./Cekjnrta.js";import{a as K,t as q}from"./Bq8E3AWP.js";import{B as fe,Mt as pe,Pt as J,R as me,W as he}from"./B1N9X4sc.js";import{n as Y}from"./denq4QT7.js";import{C as X,S as ge,b as _e,x as ve}from"./C2e2zlhC.js";import{n as ye,r as be}from"./D3syEjNq.js";import{i as xe}from"./21btP0R4.js";import{_ as Se,b as Ce,c as we,d as Te,g as Ee,h as De,i as Oe,m as ke,n as Ae,p as je,s as Me}from"./B18A9OMt.js";import{n as Ne}from"./CVokFrMd.js";import{n as Pe,r as Fe}from"./DnUMJJeH.js";import{c as Ie,t as Le}from"./eBF8D7GD.js";import{_ as Re,a as ze,g as Be,h as Ve,l as He,n as Ue,p as We,u as Ge}from"./DX4jMOO7.js";import{Q as Z,b as Ke,t as qe}from"./DscjQjQg.js";import{C as Je,_ as Ye,h as Xe,i as Ze,m as Qe,o as $e,r as et,t as tt,u as nt}from"./8KoKLERF.js";import{n as rt,t as it}from"./D1Gn2wRJ.js";function at(e,t){let n=t.trim();if(!n)return;let r=e.value,i=typeof document<`u`&&document.activeElement===e,a=e.selectionStart??r.length,o=e.selectionEnd??r.length;!i&&a===0&&o===0&&r.length>0&&(a=r.length,o=r.length);let s=r.slice(0,a),c=r.slice(o),l=`${s.length>0&&!/\s$/.test(s)?` `:``}${n}${/^[\p{L}\p{N}]/u.test(c)?` `:``}`;e.value=`${s}${l}${c}`;let u=s.length+l.length;try{e.setSelectionRange(u,u)}catch{}e.dispatchEvent(new Event(`input`,{bubbles:!0}))}function ot(e){let t=e,n=null,r=null,i=0,a=0,o=null,s=!1,c=!1,l=null;function u(){n&&clearTimeout(n),n=null}function d(){u(),r=null,o=null,s=!1}function f(){n&&(d(),t.onCancel?.())}function p(e){let n=!t.filter||t.filter(e);return n?n===!0?e.target instanceof Element?e.target:null:n:null}function m(){c=!0,l&&clearTimeout(l),l=setTimeout(()=>{c=!1,l=null},400)}return{handlePointerDown(e){if(t.disabled||!e.isPrimary||e.pointerType===`mouse`&&e.button!==0)return;let c=p(e);if(!c)return;d(),r=e.pointerId,i=e.clientX,a=e.clientY,o={target:c,pointerType:e.pointerType||`mouse`,clientX:e.clientX,clientY:e.clientY},t.onPressStart?.(o);let l=o;n=setTimeout(()=>{n=null,s=!0,t.onLongPress(l)},t.delay??500)},handlePointerMove(e){if(!n||e.pointerId!==r)return;let o=t.moveTolerance??10;Math.hypot(e.clientX-i,e.clientY-a)>o&&f()},handlePointerUp(e){if(e.pointerId===r){if(n)f();else if(s&&o){let e=o;m(),d(),t.onRelease?.(e)}else d()}},handlePointerCancel(e){if(e.pointerId===r){if(n)f();else if(s&&o){let e=o;d(),t.onRelease?.(e)}else d()}},handleDragStart(){f()},handleContextMenu(e){t.preventContextMenu&&(n||s)&&e.preventDefault()},handleClick(e){c&&(c=!1,l&&clearTimeout(l),l=null,e.preventDefault(),e.stopPropagation())},cancel(){d()},update(e){t=e,e.disabled&&d()},get pending(){return n!==null},get fired(){return s}}}function st(e,t){let n=ot(t),r=e=>n.handlePointerDown(e),i=e=>n.handlePointerMove(e),a=e=>n.handlePointerUp(e),o=e=>n.handlePointerCancel(e),s=()=>n.handleDragStart(),c=e=>n.handleContextMenu(e),l=e=>n.handleClick(e);return e.addEventListener(`pointerdown`,r),e.addEventListener(`dragstart`,s),e.addEventListener(`contextmenu`,c),e.addEventListener(`click`,l,!0),window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,a),window.addEventListener(`pointercancel`,o),{update(e){n.update(e)},destroy(){n.cancel(),e.removeEventListener(`pointerdown`,r),e.removeEventListener(`dragstart`,s),e.removeEventListener(`contextmenu`,c),e.removeEventListener(`click`,l,!0),window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointercancel`,o)}}}var ct=new WeakMap;async function lt(e,t={}){let n=Math.max(0,t.quietMs??120),r=Math.max(0,t.timeoutMs??5e3),i=Date.now(),a=()=>Math.max(0,r-(Date.now()-i)),o=e=>new Promise(t=>setTimeout(t,e));for(;;){let n=ct.get(e);if(!n||n.size===0||t.signal?.aborted)break;let r=a();if(r===0)return;await Promise.race([Promise.all([...n]),o(r)])}t.signal?.aborted||a()===0||await new Promise(r=>{let i=null,o=[],s=()=>{i&&clearTimeout(i),clearTimeout(l);for(let e of o)e();t.signal?.removeEventListener(`abort`,s),r()},c=()=>{i&&clearTimeout(i),i=setTimeout(s,n)},l=setTimeout(s,a());t.signal?.addEventListener(`abort`,s,{once:!0}),o.push(e.subscribe(e=>{(e.type===`registered`||e.type===`unregistered`)&&c()}));for(let e of t.alsoWatch??[]){let t=e?.subscribe?.(()=>c());t&&o.push(t)}c()})}async function ut(e={}){let t=e.window??(typeof window<`u`?window:void 0),n=e.navigator??(typeof navigator<`u`?navigator:void 0);return!t||!(`SpeechRecognition`in t)&&!(`webkitSpeechRecognition`in t)?`missing`:n&&`brave`in n&&n.brave||/\bElectron\//.test(n?.userAgent??``)?`unreliable`:`works`}function dt(e){return new Worker(new URL(`../workers/local-speech.worker-BzGX7Qdn.js`,import.meta.url).href,{name:e?.name})}var ft=2**28,pt=16,mt=.95;function ht(e){if(e===0)return 1;let t=Math.PI*e;return Math.sin(t)/t}function gt(e,t,n){for(let[e,r]of[[`fromRate`,t],[`toRate`,n]])if(!Number.isFinite(r)||r<=0)throw new Ie(`invalid_argument`,`${e} must be a positive finite number (got ${String(r)})`);let r=Math.floor(e.length*n/t);if(r>ft)throw new Ie(`invalid_argument`,`resampled output would be ${r} samples; the limit is ${ft}`);if(t===n)return e.slice();let i=new Float32Array(r),a=t/n,o=a>1?mt/a:1,s=pt/o,c=e.length-1;for(let t=0;t<r;t+=1){let n=t*a,r=Math.max(0,Math.ceil(n-s)),l=Math.min(c,Math.floor(n+s)),u=0,d=0;for(let t=r;t<=l;t+=1){let r=t-n,i=.5+.5*Math.cos(Math.PI*r/s),a=o*ht(o*r)*i;u+=a*e[t],d+=a}i[t]=d===0?0:u/d}return i}var _t={silenceMs:800,minSpeechMs:150,preRollMs:300,maxUtteranceMs:3e4,sensitivity:.5,calibrateMs:300},vt=.0015,yt=.003,bt=.006,xt=.2,St=.02,Ct=2e3,wt=250;function Tt(e,t,n){return Math.min(n,Math.max(t,e))}function Et(e={}){let t=(e,t,n)=>typeof e==`number`&&Number.isFinite(e)?Math.max(n,e):t;return{silenceMs:t(e.silenceMs,_t.silenceMs,20),minSpeechMs:t(e.minSpeechMs,_t.minSpeechMs,0),preRollMs:t(e.preRollMs,_t.preRollMs,0),maxUtteranceMs:t(e.maxUtteranceMs,_t.maxUtteranceMs,1e3),sensitivity:Tt(typeof e.sensitivity==`number`&&Number.isFinite(e.sensitivity)?e.sensitivity:_t.sensitivity,0,1),calibrateMs:t(e.calibrateMs,_t.calibrateMs,0)}}function Dt(e){let t=e.length;if(t===0)return 0;let n=0;for(let r=0;r<t;r++){let t=e[r];n+=t*t}return Math.sqrt(n/t)}function Ot(e={}){let t=Et(e),n=6-4*t.sensitivity,r=.02-.015*t.sensitivity,i=yt,a=0,o=[],s=!1,c=0,l=0,u=0,d=()=>Math.max(i*n,r),f=()=>Math.max(d()*.6,i*1.5),p=()=>{s=!1,c=0,l=0,u=0};return{get speaking(){return s},get noiseFloor(){return i},get threshold(){return d()},push(e,n=20){let r=[],m=Number.isFinite(e)?Math.max(0,e):0,h=Tt(m/(d()*3),0,1),g=a<t.calibrateMs;if(g&&(a+=n,!s)){o.push(m);let e=[...o].sort((e,t)=>e-t);i=Tt(e[Math.min(e.length-1,Math.floor(e.length*xt))]??yt,vt,bt)}if(!s){if(m>d())c+=n,c>=t.minSpeechMs&&(s=!0,l=0,u=c,r.push({type:`start`,leadMs:t.preRollMs+c}),c=0);else if(g)c=0;else{c=0;let e=n/Ct*(m<i?4:1);i=Tt(i+(m-i)*Math.min(1,e),vt,St)}return{events:r,level:h,speaking:s}}return u+=n,m>f()?l=0:l+=n,l>=t.silenceMs?(r.push({type:`end`,reason:`silence`,trailingSilenceMs:l}),p()):u>=t.maxUtteranceMs&&(r.push({type:`split`}),u=0,l=0),{events:r,level:h,speaking:s}},flush(){let e=[];return s&&e.push({type:`end`,reason:`flush`,trailingSilenceMs:l}),p(),e}}}function kt(e){let t=Et(e),n=Ot(t),r=Math.max(1,Math.round(e.sampleRate*20/1e3)),i=r/e.sampleRate*1e3,a=Math.ceil((t.preRollMs+t.minSpeechMs)/i)+1,o=[],s=new Float32Array,c=null,l=!1,u=(t,n,r)=>{let a=Math.max(0,Math.floor((r-wt)/i)),o=t.slice(0,Math.max(1,t.length-a)),s=0;for(let e of o)s+=e.length;let c=new Float32Array(s),l=0;for(let e of o)c.set(e,l),l+=e.length;e.onUtterance({pcm:c,sampleRate:e.sampleRate,durationMs:s/e.sampleRate*1e3,reason:n})},d=t=>{t!==l&&(l=t,e.onSpeaking?.(t))},f=s=>{let l=n.push(Dt(s),i);e.onLevel?.(l.level),o.push(s),o.length>a&&o.shift(),c&&c.push(s);for(let e of l.events)if(e.type===`start`){c=[...o];let e=Math.ceil(t.preRollMs/i),n=Math.max(0,o.length-Math.ceil(t.minSpeechMs/i));for(let t=n;t<e;t++)c.unshift(new Float32Array(r))}else if(e.type===`end`){let t=c??[];c=null,o.length=0,t.length>0&&u(t,e.reason,e.trailingSilenceMs)}else if(e.type===`split`){let e=c??[];c=[],e.length>0&&u(e,`max`,0)}d(n.speaking)};return{get speaking(){return n.speaking},segmenter:n,push(e){let t=e;s.length>0&&(t=new Float32Array(s.length+e.length),t.set(s,0),t.set(e,s.length));let n=0;for(;n+r<=t.length;)f(t.slice(n,n+r)),n+=r;s=t.slice(n)},flush(){let t=n.flush();for(let e of t)e.type===`end`&&c&&c.length>0&&u(c,`flush`,e.trailingSilenceMs);c=null,o.length=0,s=new Float32Array,d(!1),e.onLevel?.(0)},discard(){n.flush(),c=null,o.length=0,s=new Float32Array,d(!1),e.onLevel?.(0)}}}var At=44,jt=4294967295,Mt=1;function Nt(e){let t=new Int16Array(e.length);for(let n=0;n<e.length;n+=1){let r=e[n];Number.isNaN(r)||(t[n]=Math.min(32767,Math.round((r>1?1:r<-1?-1:r)*32768)))}return t}function Pt(e,t){if(!Number.isInteger(e)||e<1||e*2>jt)throw new Ie(`invalid_argument`,`${t} must be a positive integer sample rate (got ${String(e)})`)}function Ft(e,t,n){for(let r=0;r<n.length;r+=1)e.setUint8(t+r,n.charCodeAt(r))}function It(e,t){Pt(t,`sampleRate`);let n=e.length*2;if(n+At-8>jt)throw new Ie(`invalid_argument`,`too many samples for a single WAV (4 GiB limit)`);let r=e instanceof Int16Array?e:Nt(e),i=new Uint8Array(At+n),a=new DataView(i.buffer);Ft(a,0,`RIFF`),a.setUint32(4,36+n,!0),Ft(a,8,`WAVE`),Ft(a,12,`fmt `),a.setUint32(16,16,!0),a.setUint16(20,Mt,!0),a.setUint16(22,1,!0),a.setUint32(24,t,!0),a.setUint32(28,t*2,!0),a.setUint16(32,2,!0),a.setUint16(34,16,!0),Ft(a,36,`data`),a.setUint32(40,n,!0);for(let e=0;e<r.length;e+=1)a.setInt16(At+e*2,r[e],!0);return i}var Lt=`hv-pcm-tap`,Rt=`
3
3
  class HvPcmTap extends AudioWorkletProcessor {
4
4
  process(inputs) {
5
5
  const channels = inputs[0];
@@ -1 +1 @@
1
- import{D as e,M as t,w as n}from"./IVfnZdeW.js";import{r}from"./DkyrxFMJ.js";var i=`@happyvertical/smrt-assets:Asset`,a=`@happyvertical/smrt-products:ProductAsset`,o=`assets.library`;function s(e,t,n){let r=new Map(t.map(e=>[e.id,e]));return n.filter(t=>t.productId===e).flatMap(e=>{let t=r.get(String(e.assetId)),n=t?.sourceUri;return!t||typeof n!=`string`?[]:[{id:t.id,name:String(t.name??`Product image`),sourceUri:n,mimeType:String(t.mimeType??`image/*`),description:String(t.description??``),sortOrder:Number(e.sortOrder??0)}]}).sort((e,t)=>e.sortOrder-t.sortOrder||e.name.localeCompare(t.name))}function c(e,t,n,o){return[{op:`save`,as:`asset`,model:r(i),values:{name:t.name||`Product image`,sourceUri:n,mimeType:t.type||`image/*`,description:`Image selected for this product in the browser demo.`,sourceType:`browser-demo`}},{op:`save`,model:r(a),values:{productId:e,assetId:{ref:`asset`},relationship:`gallery`,sortOrder:o}}]}function l(e,t){return t.filter(t=>t.productId===e).flatMap(e=>[{op:`delete`,model:r(a),id:e.id},{op:`delete`,model:r(i),id:String(e.assetId)}])}var u=`@happyvertical/smrt-products:Product`,d=`@happyvertical/smrt-products:ProductVariant`,f=`@happyvertical/smrt-products:Sku`,p=`@happyvertical/smrt-inventory:StockLevel`,m=`@happyvertical/smrt-profiles:ProfileType`,h=`@happyvertical/smrt-inventory:InventoryLocation`;function g(r){return{[h]:{from:[],make:()=>(t().locations??[]).map((e,t)=>({id:n(`${h}:sample:${t}`),...e,placeId:``,active:!0}))},[f]:{from:[r(u)],make:([e])=>(e??[]).map((e,t)=>({id:n(`${f}:sample:${e.id}`),productId:e.id,code:`SKU-${String(t+1).padStart(3,`0`)}`,barcode:``,name:String(e.name??``),attributes:``,parentSkuId:``,active:!0}))},[p]:{from:[r(f),r(h)],make:([r,i])=>{let a=t(),o=new Map(a.products.map(e=>[e.name,e.at]));return(r??[]).flatMap(t=>(i??[]).flatMap((r,i)=>{let a=e(`${t.id}:${r.id}`),s=o.get(String(t.name));if(s!==void 0){if(s!==i)return[]}else if(i>0&&a%3==0)return[];let c=10+a%4*5;return[{id:n(`${p}:sample:${t.id}:${r.id}`),skuId:t.id,locationId:r.id,state:`available`,qty:a%5==0?c-3:c+a%40,reorderPoint:c,reorderQuantity:c*3}]}))}}}}function _(e,t){let n=new Map(e.map(e=>[e.id,e.productId])),r=new Map;for(let e of t){let t=n.get(String(e.skuId));typeof t==`string`&&r.set(t,(r.get(t)??0)+Number(e.qty??0))}return r}function v(e,t,n,r=[]){return[...l(e,r),...t.flatMap(e=>[{op:`delete`,model:n(p),match:{skuId:e.id}},{op:`delete`,model:n(f),id:e.id}]),{op:`delete`,model:n(d),match:{productId:e}},{op:`delete`,model:n(u),id:e}]}export{d as a,g as c,a as d,c as f,p as i,i as l,m as n,v as o,s as p,f as r,_ as s,u as t,o as u};
1
+ import{D as e,M as t,w as n}from"./B1N9X4sc.js";import{r}from"./BlZ_GEbZ.js";var i=`@happyvertical/smrt-assets:Asset`,a=`@happyvertical/smrt-products:ProductAsset`,o=`assets.library`;function s(e,t,n){let r=new Map(t.map(e=>[e.id,e]));return n.filter(t=>t.productId===e).flatMap(e=>{let t=r.get(String(e.assetId)),n=t?.sourceUri;return!t||typeof n!=`string`?[]:[{id:t.id,name:String(t.name??`Product image`),sourceUri:n,mimeType:String(t.mimeType??`image/*`),description:String(t.description??``),sortOrder:Number(e.sortOrder??0)}]}).sort((e,t)=>e.sortOrder-t.sortOrder||e.name.localeCompare(t.name))}function c(e,t,n,o){return[{op:`save`,as:`asset`,model:r(i),values:{name:t.name||`Product image`,sourceUri:n,mimeType:t.type||`image/*`,description:`Image selected for this product in the browser demo.`,sourceType:`browser-demo`}},{op:`save`,model:r(a),values:{productId:e,assetId:{ref:`asset`},relationship:`gallery`,sortOrder:o}}]}function l(e,t){return t.filter(t=>t.productId===e).flatMap(e=>[{op:`delete`,model:r(a),id:e.id},{op:`delete`,model:r(i),id:String(e.assetId)}])}var u=`@happyvertical/smrt-products:Product`,d=`@happyvertical/smrt-products:ProductVariant`,f=`@happyvertical/smrt-products:Sku`,p=`@happyvertical/smrt-inventory:StockLevel`,m=`@happyvertical/smrt-profiles:ProfileType`,h=`@happyvertical/smrt-inventory:InventoryLocation`;function g(r){return{[h]:{from:[],make:()=>(t().locations??[]).map((e,t)=>({id:n(`${h}:sample:${t}`),...e,placeId:``,active:!0}))},[f]:{from:[r(u)],make:([e])=>(e??[]).map((e,t)=>({id:n(`${f}:sample:${e.id}`),productId:e.id,code:`SKU-${String(t+1).padStart(3,`0`)}`,barcode:``,name:String(e.name??``),attributes:``,parentSkuId:``,active:!0}))},[p]:{from:[r(f),r(h)],make:([r,i])=>{let a=t(),o=new Map(a.products.map(e=>[e.name,e.at]));return(r??[]).flatMap(t=>(i??[]).flatMap((r,i)=>{let a=e(`${t.id}:${r.id}`),s=o.get(String(t.name));if(s!==void 0){if(s!==i)return[]}else if(i>0&&a%3==0)return[];let c=10+a%4*5;return[{id:n(`${p}:sample:${t.id}:${r.id}`),skuId:t.id,locationId:r.id,state:`available`,qty:a%5==0?c-3:c+a%40,reorderPoint:c,reorderQuantity:c*3}]}))}}}}function _(e,t){let n=new Map(e.map(e=>[e.id,e.productId])),r=new Map;for(let e of t){let t=n.get(String(e.skuId));typeof t==`string`&&r.set(t,(r.get(t)??0)+Number(e.qty??0))}return r}function v(e,t,n,r=[]){return[...l(e,r),...t.flatMap(e=>[{op:`delete`,model:n(p),match:{skuId:e.id}},{op:`delete`,model:n(f),id:e.id}]),{op:`delete`,model:n(d),match:{productId:e}},{op:`delete`,model:n(u),id:e}]}export{d as a,g as c,a as d,c as f,p as i,i as l,m as n,v as o,s as p,f as r,_ as s,u as t,o as u};
@@ -1 +1 @@
1
- import{$ as e,B as t,Ct as n,Dt as r,E as i,Ft as a,G as o,H as s,J as c,L as l,Ot as u,Pt as d,U as f,W as p,Y as m,a as h,bt as ee,d as g,ft as _,ht as v,mt as y,n as b,nt as te,o as x,pt as S,q as C,r as w,st as T,tt as ne,v as E,vt as re}from"./DG3qFFTE.js";import"./xihTtKlq.js";import"./Cekjnrta.js";import{t as ie}from"./Bq8E3AWP.js";import"./IVfnZdeW.js";import{n as D}from"./denq4QT7.js";import{D as O,T as k,f as ae,h as oe}from"./DitEeA6X.js";import{n as se}from"./D3syEjNq.js";import{o as A,u as j}from"./DmfvgI_r.js";import{i as M}from"./B18A9OMt.js";var N=new Set([`$$slots`,`$$events`,`$$legacy`]);function P(e,t){u(t,!0);let n=O(),i=x(t,N),a=null;w(()=>{a=n.registerFocusTool(i)}),b(()=>{a?.()}),r()}var ce=o(`<!> <!>`,1),le=o(`<span class="smrt-shell-layout-editor__muted svelte-xzk327" data-smrt-part="description"> </span>`),ue=o(`<div class="smrt-shell-layout-editor__row svelte-xzk327" data-smrt-part="row"><!></div>`),de=o(`<strong> </strong>`),fe=o(`<!> <!> <!> <!>`,1),F=o(`<span data-smrt-part="label"> </span> <!>`,1),I=o(`<div class="smrt-shell-layout-editor__preview" data-smrt-part="preview"><h3 class="svelte-xzk327"> </h3> <div class="smrt-shell-layout-editor__preview-frame svelte-xzk327" role="group" inert="" data-smrt-part="panel"><!></div></div>`),L=o(`<section class="smrt-shell-layout-editor svelte-xzk327" data-smrt-component="ShellLayoutEditor"><header class="svelte-xzk327"><div><h2 class="svelte-xzk327"> </h2> <p class="svelte-xzk327"> </p></div> <!></header> <fieldset class="smrt-shell-layout-editor__panels svelte-xzk327" data-smrt-part="list"><legend class="svelte-xzk327"> </legend> <!></fieldset> <div class="smrt-shell-layout-editor__body svelte-xzk327" data-smrt-part="body"><div class="smrt-shell-layout-editor__nav" data-smrt-part="list"><div class="smrt-shell-layout-editor__nav-head svelte-xzk327" data-smrt-part="header"><h3 class="svelte-xzk327"> </h3> <!></div> <!></div> <!></div></section>`);function R(o,m){let b=C();u(m,!0);let x=h(m,`preview`,3,!0),{t:w}=ie(),O=te(()=>m.controller??j()),N=`${b}-heading`,P=n(()=>O.sections),R=n(()=>O.panels),z=n(()=>O.applied),B=n(()=>e(P).map(e=>({id:e.id,label:e.heading??w(k[`ui.shell_layout_editor.top_level`]),fixed:e.group===null,root:e.group===null,hidden:e.hidden,custom:e.custom,titleVisible:e.titleVisible,count:e.items.length}))),V=n(()=>e(P).flatMap(e=>e.items.map(t=>({id:t.id,containerId:e.id,label:t.label}))));function H(e,t){t?O.show(e):O.hide(e)}let U=ee(void 0);function pe(t,n){let r=n.currentTarget;O.renameSection(t,r.value),r.value=e(B).find(e=>e.id===t)?.label??``}async function me(){let t=O.createSection(w(k[`ui.shell_layout_editor.new_section_label`]));if(!t)return;await ne();let n=e(U)?.querySelector(`input[data-section-name="${CSS.escape(t)}"]`);n?.focus(),n?.select()}function he(e,t,n){n>0&&!globalThis.confirm?.(w(k[`ui.shell_layout_editor.delete_confirm`],{label:t}))||O.deleteSection(e)}function ge(e){O.moveItem(e.item.id,e.target.containerId,e.target.index)}function _e(e){O.moveSection(e.container.id,e.target)}var W=L(),G=_(W),K=_(G),q=_(K),ve=y(q,!0),ye=v(q,2),be=y(ye,!0);a(K);var xe=v(K,2);{let t=n(()=>!O.customized);D(xe,{variant:`secondary`,size:`sm`,get disabled(){return e(t)},onclick:()=>O.reset(),children:(e,t)=>{d();var n=c();T(e=>s(n,e),[()=>w(k[`ui.shell_layout_editor.reset`])]),f(e,n)},$$slots:{default:!0}})}a(G);var J=v(G,2),Y=_(J),Se=y(Y,!0),Ce=v(Y,2);l(Ce,17,()=>e(R),e=>e.edge,(r,i)=>{var o=ue(),c=_(o),l=t=>{var r=ce(),a=S(r);{let t=n(()=>w(k[`ui.shell_layout_editor.show_panel`],{panel:e(i).label}));M(a,{interaction:!1,get checked(){return e(i).visible},get label(){return e(t)},onchange:t=>O.setPanel(e(i).edge,{visible:t.currentTarget.checked})})}var o=v(a,2);{let t=n(()=>e(i).initial===`expanded`),r=n(()=>!e(i).visible),a=n(()=>w(k[`ui.shell_layout_editor.start_expanded`],{panel:e(i).label}));M(o,{interaction:!1,get checked(){return e(t)},get disabled(){return e(r)},get label(){return e(a)},onchange:t=>O.setPanel(e(i).edge,{initial:t.currentTarget.checked?`expanded`:`collapsed`})})}f(t,r)},u=t=>{var n=le(),r=y(n,!0);T(e=>s(r,e),[()=>w(k[`ui.shell_layout_editor.panel_unavailable`],{panel:e(i).label})]),f(t,n)};t(c,t=>{e(i).available?t(l):t(u,-1)}),a(o),T(()=>E(o,`data-edge`,e(i).edge)),f(r,o)}),a(J);var X=v(J,2),Z=_(X),Q=_(Z),$=_(Q),we=y($,!0),Te=v($,2);D(Te,{variant:`secondary`,size:`sm`,onclick:me,children:(e,t)=>{d();var n=c();T(e=>s(n,e),[()=>w(k[`ui.shell_layout_editor.new_section`])]),f(e,n)},$$slots:{default:!0}}),a(Q);var Ee=v(Q,2);{let r=(r,i)=>{let a=()=>(i?.()).container,o=n(()=>e(B).find(e=>e.id===a().id));var c=p(),l=S(c),u=e=>{var t=de(),n=y(t,!0);T(()=>s(n,a().label)),f(e,t)},d=r=>{var i=fe(),s=S(i);{let t=n(()=>w(k[`ui.shell_layout_editor.section_name`],{label:a().label}));se(s,{class:`smrt-shell-layout-editor__name`,interaction:!1,get"data-section-name"(){return a().id},get"aria-label"(){return e(t)},get value(){return a().label},onchange:e=>pe(a().id,e)})}var c=v(s,2);{let t=n(()=>e(o)?.hidden?`eyeOff`:`eye`),r=n(()=>!e(o)?.hidden),i=n(()=>w(k[`ui.shell_layout_editor.show_entry`],{label:a().label}));A(c,{get icon(){return e(t)},get pressed(){return e(r)},get label(){return e(i)},onclick:()=>H(a().id,!!e(o)?.hidden)})}var l=v(c,2);{let t=n(()=>e(o)?.titleVisible===!1?`headingOff`:`heading`),r=n(()=>e(o)?.titleVisible??!0),i=n(()=>w(k[`ui.shell_layout_editor.show_title_for`],{label:a().label}));A(l,{get icon(){return e(t)},get pressed(){return e(r)},get label(){return e(i)},onclick:()=>O.setSectionTitleVisible(a().id,!(e(o)?.titleVisible??!0))})}var u=v(l,2),d=t=>{{let r=n(()=>w(k[`ui.shell_layout_editor.delete_section`],{label:a().label}));A(t,{icon:`trash`,get label(){return e(r)},onclick:()=>he(a().id,a().label,e(o).count)})}};t(u,t=>{e(o)?.custom&&t(d)}),f(r,i)};t(l,t=>{e(o)?.root?t(u):t(d,-1)}),f(r,c)},a=(t,r)=>{let a=()=>(r?.()).item,o=()=>(r?.()).container,c=n(()=>O.isHidden(a().id));var l=F(),u=S(l);let d;var p=y(u,!0),m=v(u,2);{let t=n(()=>e(c)?`eyeOff`:`eye`),r=n(()=>!e(c)),i=n(()=>w(k[`ui.shell_layout_editor.show_entry`],{label:a().label}));A(m,{get icon(){return e(t)},get pressed(){return e(r)},get label(){return e(i)},onclick:()=>H(a().id,e(c))})}T(e=>{d=i(u,1,`smrt-shell-layout-editor__label svelte-xzk327`,null,d,{"smrt-shell-layout-editor__muted":e}),s(p,a().label)},[()=>e(c)||O.isHidden(o().id)]),f(t,l)},o=n(()=>w(k[`ui.shell_layout_editor.sortable_label`]));oe(Ee,{get containers(){return e(B)},get items(){return e(V)},get label(){return e(o)},reorderContainers:!0,onmove:ge,oncontainermove:_e,containerHeader:r,item:a,$$slots:{containerHeader:!0,item:!0}})}a(Z);var De=v(Z,2),Oe=t=>{var r=I(),i=_(r),o=y(i,!0),c=v(i,2),l=_(c);{let t=n(()=>w(k[`ui.shell_layout_editor.preview_label`]));ae(l,{get items(){return e(z).nav},get groups(){return e(z).groups},get iconComponent(){return m.iconComponent},get"aria-label"(){return e(t)}})}a(c),a(r),T((e,t)=>{s(o,e),E(c,`aria-label`,t)},[()=>w(k[`ui.shell_layout_editor.preview`]),()=>w(k[`ui.shell_layout_editor.preview_label`])]),f(t,r)};t(De,e=>{x()&&e(Oe)}),a(X),a(W),g(W,e=>re(U,e),()=>e(U)),T((e,t,n,r)=>{E(W,`aria-labelledby`,N),E(q,`id`,N),s(ve,e),s(be,t),s(Se,n),s(we,r)},[()=>w(k[`ui.shell_layout_editor.heading`]),()=>w(k[`ui.shell_layout_editor.description`]),()=>w(k[`ui.shell_layout_editor.panels`]),()=>w(k[`ui.shell_layout_editor.navigation`])]),f(o,W),r()}m([`click`]);export{P as n,R as t};
1
+ import{$ as e,B as t,Ct as n,Dt as r,E as i,Ft as a,G as o,H as s,J as c,L as l,Ot as u,Pt as d,U as f,W as p,Y as m,a as h,bt as ee,d as g,ft as _,ht as v,mt as y,n as b,nt as te,o as x,pt as S,q as C,r as w,st as T,tt as ne,v as E,vt as re}from"./DG3qFFTE.js";import"./xihTtKlq.js";import"./Cekjnrta.js";import{t as ie}from"./Bq8E3AWP.js";import"./B1N9X4sc.js";import{n as D}from"./denq4QT7.js";import{D as O,T as k,f as ae,h as oe}from"./C2e2zlhC.js";import{n as se}from"./D3syEjNq.js";import{o as A,u as j}from"./DmfvgI_r.js";import{i as M}from"./B18A9OMt.js";var N=new Set([`$$slots`,`$$events`,`$$legacy`]);function P(e,t){u(t,!0);let n=O(),i=x(t,N),a=null;w(()=>{a=n.registerFocusTool(i)}),b(()=>{a?.()}),r()}var ce=o(`<!> <!>`,1),le=o(`<span class="smrt-shell-layout-editor__muted svelte-xzk327" data-smrt-part="description"> </span>`),ue=o(`<div class="smrt-shell-layout-editor__row svelte-xzk327" data-smrt-part="row"><!></div>`),de=o(`<strong> </strong>`),fe=o(`<!> <!> <!> <!>`,1),F=o(`<span data-smrt-part="label"> </span> <!>`,1),I=o(`<div class="smrt-shell-layout-editor__preview" data-smrt-part="preview"><h3 class="svelte-xzk327"> </h3> <div class="smrt-shell-layout-editor__preview-frame svelte-xzk327" role="group" inert="" data-smrt-part="panel"><!></div></div>`),L=o(`<section class="smrt-shell-layout-editor svelte-xzk327" data-smrt-component="ShellLayoutEditor"><header class="svelte-xzk327"><div><h2 class="svelte-xzk327"> </h2> <p class="svelte-xzk327"> </p></div> <!></header> <fieldset class="smrt-shell-layout-editor__panels svelte-xzk327" data-smrt-part="list"><legend class="svelte-xzk327"> </legend> <!></fieldset> <div class="smrt-shell-layout-editor__body svelte-xzk327" data-smrt-part="body"><div class="smrt-shell-layout-editor__nav" data-smrt-part="list"><div class="smrt-shell-layout-editor__nav-head svelte-xzk327" data-smrt-part="header"><h3 class="svelte-xzk327"> </h3> <!></div> <!></div> <!></div></section>`);function R(o,m){let b=C();u(m,!0);let x=h(m,`preview`,3,!0),{t:w}=ie(),O=te(()=>m.controller??j()),N=`${b}-heading`,P=n(()=>O.sections),R=n(()=>O.panels),z=n(()=>O.applied),B=n(()=>e(P).map(e=>({id:e.id,label:e.heading??w(k[`ui.shell_layout_editor.top_level`]),fixed:e.group===null,root:e.group===null,hidden:e.hidden,custom:e.custom,titleVisible:e.titleVisible,count:e.items.length}))),V=n(()=>e(P).flatMap(e=>e.items.map(t=>({id:t.id,containerId:e.id,label:t.label}))));function H(e,t){t?O.show(e):O.hide(e)}let U=ee(void 0);function pe(t,n){let r=n.currentTarget;O.renameSection(t,r.value),r.value=e(B).find(e=>e.id===t)?.label??``}async function me(){let t=O.createSection(w(k[`ui.shell_layout_editor.new_section_label`]));if(!t)return;await ne();let n=e(U)?.querySelector(`input[data-section-name="${CSS.escape(t)}"]`);n?.focus(),n?.select()}function he(e,t,n){n>0&&!globalThis.confirm?.(w(k[`ui.shell_layout_editor.delete_confirm`],{label:t}))||O.deleteSection(e)}function ge(e){O.moveItem(e.item.id,e.target.containerId,e.target.index)}function _e(e){O.moveSection(e.container.id,e.target)}var W=L(),G=_(W),K=_(G),q=_(K),ve=y(q,!0),ye=v(q,2),be=y(ye,!0);a(K);var xe=v(K,2);{let t=n(()=>!O.customized);D(xe,{variant:`secondary`,size:`sm`,get disabled(){return e(t)},onclick:()=>O.reset(),children:(e,t)=>{d();var n=c();T(e=>s(n,e),[()=>w(k[`ui.shell_layout_editor.reset`])]),f(e,n)},$$slots:{default:!0}})}a(G);var J=v(G,2),Y=_(J),Se=y(Y,!0),Ce=v(Y,2);l(Ce,17,()=>e(R),e=>e.edge,(r,i)=>{var o=ue(),c=_(o),l=t=>{var r=ce(),a=S(r);{let t=n(()=>w(k[`ui.shell_layout_editor.show_panel`],{panel:e(i).label}));M(a,{interaction:!1,get checked(){return e(i).visible},get label(){return e(t)},onchange:t=>O.setPanel(e(i).edge,{visible:t.currentTarget.checked})})}var o=v(a,2);{let t=n(()=>e(i).initial===`expanded`),r=n(()=>!e(i).visible),a=n(()=>w(k[`ui.shell_layout_editor.start_expanded`],{panel:e(i).label}));M(o,{interaction:!1,get checked(){return e(t)},get disabled(){return e(r)},get label(){return e(a)},onchange:t=>O.setPanel(e(i).edge,{initial:t.currentTarget.checked?`expanded`:`collapsed`})})}f(t,r)},u=t=>{var n=le(),r=y(n,!0);T(e=>s(r,e),[()=>w(k[`ui.shell_layout_editor.panel_unavailable`],{panel:e(i).label})]),f(t,n)};t(c,t=>{e(i).available?t(l):t(u,-1)}),a(o),T(()=>E(o,`data-edge`,e(i).edge)),f(r,o)}),a(J);var X=v(J,2),Z=_(X),Q=_(Z),$=_(Q),we=y($,!0),Te=v($,2);D(Te,{variant:`secondary`,size:`sm`,onclick:me,children:(e,t)=>{d();var n=c();T(e=>s(n,e),[()=>w(k[`ui.shell_layout_editor.new_section`])]),f(e,n)},$$slots:{default:!0}}),a(Q);var Ee=v(Q,2);{let r=(r,i)=>{let a=()=>(i?.()).container,o=n(()=>e(B).find(e=>e.id===a().id));var c=p(),l=S(c),u=e=>{var t=de(),n=y(t,!0);T(()=>s(n,a().label)),f(e,t)},d=r=>{var i=fe(),s=S(i);{let t=n(()=>w(k[`ui.shell_layout_editor.section_name`],{label:a().label}));se(s,{class:`smrt-shell-layout-editor__name`,interaction:!1,get"data-section-name"(){return a().id},get"aria-label"(){return e(t)},get value(){return a().label},onchange:e=>pe(a().id,e)})}var c=v(s,2);{let t=n(()=>e(o)?.hidden?`eyeOff`:`eye`),r=n(()=>!e(o)?.hidden),i=n(()=>w(k[`ui.shell_layout_editor.show_entry`],{label:a().label}));A(c,{get icon(){return e(t)},get pressed(){return e(r)},get label(){return e(i)},onclick:()=>H(a().id,!!e(o)?.hidden)})}var l=v(c,2);{let t=n(()=>e(o)?.titleVisible===!1?`headingOff`:`heading`),r=n(()=>e(o)?.titleVisible??!0),i=n(()=>w(k[`ui.shell_layout_editor.show_title_for`],{label:a().label}));A(l,{get icon(){return e(t)},get pressed(){return e(r)},get label(){return e(i)},onclick:()=>O.setSectionTitleVisible(a().id,!(e(o)?.titleVisible??!0))})}var u=v(l,2),d=t=>{{let r=n(()=>w(k[`ui.shell_layout_editor.delete_section`],{label:a().label}));A(t,{icon:`trash`,get label(){return e(r)},onclick:()=>he(a().id,a().label,e(o).count)})}};t(u,t=>{e(o)?.custom&&t(d)}),f(r,i)};t(l,t=>{e(o)?.root?t(u):t(d,-1)}),f(r,c)},a=(t,r)=>{let a=()=>(r?.()).item,o=()=>(r?.()).container,c=n(()=>O.isHidden(a().id));var l=F(),u=S(l);let d;var p=y(u,!0),m=v(u,2);{let t=n(()=>e(c)?`eyeOff`:`eye`),r=n(()=>!e(c)),i=n(()=>w(k[`ui.shell_layout_editor.show_entry`],{label:a().label}));A(m,{get icon(){return e(t)},get pressed(){return e(r)},get label(){return e(i)},onclick:()=>H(a().id,e(c))})}T(e=>{d=i(u,1,`smrt-shell-layout-editor__label svelte-xzk327`,null,d,{"smrt-shell-layout-editor__muted":e}),s(p,a().label)},[()=>e(c)||O.isHidden(o().id)]),f(t,l)},o=n(()=>w(k[`ui.shell_layout_editor.sortable_label`]));oe(Ee,{get containers(){return e(B)},get items(){return e(V)},get label(){return e(o)},reorderContainers:!0,onmove:ge,oncontainermove:_e,containerHeader:r,item:a,$$slots:{containerHeader:!0,item:!0}})}a(Z);var De=v(Z,2),Oe=t=>{var r=I(),i=_(r),o=y(i,!0),c=v(i,2),l=_(c);{let t=n(()=>w(k[`ui.shell_layout_editor.preview_label`]));ae(l,{get items(){return e(z).nav},get groups(){return e(z).groups},get iconComponent(){return m.iconComponent},get"aria-label"(){return e(t)}})}a(c),a(r),T((e,t)=>{s(o,e),E(c,`aria-label`,t)},[()=>w(k[`ui.shell_layout_editor.preview`]),()=>w(k[`ui.shell_layout_editor.preview_label`])]),f(t,r)};t(De,e=>{x()&&e(Oe)}),a(X),a(W),g(W,e=>re(U,e),()=>e(U)),T((e,t,n,r)=>{E(W,`aria-labelledby`,N),E(q,`id`,N),s(ve,e),s(be,t),s(Se,n),s(we,r)},[()=>w(k[`ui.shell_layout_editor.heading`]),()=>w(k[`ui.shell_layout_editor.description`]),()=>w(k[`ui.shell_layout_editor.panels`]),()=>w(k[`ui.shell_layout_editor.navigation`])]),f(o,W),r()}m([`click`]);export{P as n,R as t};
@@ -1,4 +1,4 @@
1
- import{$ as e,B as t,Ct as n,D as r,Dt as i,E as a,Ft as o,G as s,H as c,J as l,L as u,Ot as d,Pt as f,U as p,W as m,X as h,Y as g,a as _,b as v,bt as y,ct as b,ft as x,ht as S,mt as C,pt as w,st as T,v as E,vt as D}from"./DG3qFFTE.js";import"./xihTtKlq.js";import{n as O}from"./denq4QT7.js";import{n as k}from"./D3syEjNq.js";import{b as A,i as j,x as M}from"./B18A9OMt.js";import{A as N,D as P,E as F,O as I,T as L,_ as R,i as z,k as B,n as V,r as ee,t as H,v as U,w as te}from"./DMtbj61v.js";import{nt as W}from"./DKGzf415.js";var ne=s(`<p class="smrt-ai-setup__notice svelte-19u3zp7" role="status" data-smrt-component="AiSetup"> </p>`),G=s(`<option> </option>`),re=s(`<label class="svelte-19u3zp7">Assistant mode <!></label> <p class="smrt-ai-setup__meta svelte-19u3zp7" data-smrt-part="meta">Changing modes happens only when you choose it here.</p>`,1),ie=s(`<p class="smrt-ai-setup__status svelte-19u3zp7" data-smrt-part="status">Inference off</p> <p class="smrt-ai-setup__meta svelte-19u3zp7" data-smrt-part="meta">Build, edit, validate and export your cookbook without a model. No
1
+ import{$ as e,B as t,Ct as n,D as r,Dt as i,E as a,Ft as o,G as s,H as c,J as l,L as u,Ot as d,Pt as f,U as p,W as m,X as h,Y as g,a as _,b as v,bt as y,ct as b,ft as x,ht as S,mt as C,pt as w,st as T,v as E,vt as D}from"./DG3qFFTE.js";import"./xihTtKlq.js";import{n as O}from"./denq4QT7.js";import{n as k}from"./D3syEjNq.js";import{b as A,i as j,x as M}from"./B18A9OMt.js";import{A as N,D as P,E as F,O as I,T as L,_ as R,i as z,k as B,n as V,r as ee,t as H,v as U,w as te}from"./DuWbl1Oh.js";import{nt as W}from"./DscjQjQg.js";var ne=s(`<p class="smrt-ai-setup__notice svelte-19u3zp7" role="status" data-smrt-component="AiSetup"> </p>`),G=s(`<option> </option>`),re=s(`<label class="svelte-19u3zp7">Assistant mode <!></label> <p class="smrt-ai-setup__meta svelte-19u3zp7" data-smrt-part="meta">Changing modes happens only when you choose it here.</p>`,1),ie=s(`<p class="smrt-ai-setup__status svelte-19u3zp7" data-smrt-part="status">Inference off</p> <p class="smrt-ai-setup__meta svelte-19u3zp7" data-smrt-part="meta">Build, edit, validate and export your cookbook without a model. No
2
2
  provider is contacted and no browser model is downloaded.</p>`,1),ae=s(`<p class="smrt-ai-setup__status svelte-19u3zp7" data-smrt-part="status">Server</p> <p class="smrt-ai-setup__meta svelte-19u3zp7" data-smrt-part="meta">This site's server answers the assistant. What you type, and a short
3
3
  summary of your plan, is sent to it. Nothing is downloaded.</p>`,1),oe=s(`<p class="smrt-ai-setup__meta svelte-19u3zp7" data-smrt-part="meta">A key is saved for another address, so it is not used here. Paste it again for this address.</p>`),se=s(`<div class="smrt-ai-setup__field svelte-19u3zp7" data-smrt-part="field"><!> <!></div> <!> <p class="smrt-ai-setup__meta svelte-19u3zp7" data-smrt-part="meta"> <button class="smrt-ai-setup__link svelte-19u3zp7" data-smrt-part="action" type="button">Forget the key</button></p>`,1),ce=s(`<p class="smrt-ai-setup__meta svelte-19u3zp7" data-smrt-part="meta"><strong>Browser access.</strong> </p>`),le=s(`<p data-smrt-part="status"> </p>`),ue=s(`<p class="smrt-ai-setup__status svelte-19u3zp7" data-smrt-part="status" role="status"> </p>`),de=s(`<label class="svelte-19u3zp7">Model provider <!></label> <div class="smrt-ai-setup__field svelte-19u3zp7" data-smrt-part="field"><!> <!></div> <div class="smrt-ai-setup__field svelte-19u3zp7" data-smrt-part="field"><!> <!></div> <!> <!> <p class="smrt-ai-setup__meta svelte-19u3zp7" data-smrt-part="meta">What you type, and a short summary of your plan, is sent to this
4
4
  endpoint.</p> <!> <!> <div class="smrt-ai-setup__actions svelte-19u3zp7" data-smrt-part="actions"><!> <!></div>`,1),fe=s(`<p role="status" class="svelte-19u3zp7">This browser has no WebGPU, which the model needs. Try a recent
@@ -1,2 +1,2 @@
1
- import{$ as e,B as t,Ct as n,Dt as r,Ft as i,G as a,H as o,L as s,Ot as c,Pt as l,U as u,ft as d,ht as f,mt as p,pt as m,st as h}from"./DG3qFFTE.js";import"./xihTtKlq.js";import{At as g}from"./IVfnZdeW.js";var _=a(`<li><code class="svelte-kxkftj"><b> </b> </code></li>`),v=a(`<li class="smrt-connect-tools__none svelte-kxkftj" data-smrt-part="empty">None</li>`),y=a(`<li><code class="svelte-kxkftj"> </code></li>`),b=a(`<mark class="svelte-kxkftj">AI</mark>`),x=a(`<li><code class="svelte-kxkftj"> </code> <!></li>`),S=a(`<article class="svelte-kxkftj"><h3 class="svelte-kxkftj"> </h3> <div class="smrt-connect-tools__grid svelte-kxkftj" data-smrt-part="grid"><div><h4 class="svelte-kxkftj">REST routes <span class="svelte-kxkftj"> </span></h4> <ul class="svelte-kxkftj"></ul></div> <div><h4 class="svelte-kxkftj">MCP tools <span class="svelte-kxkftj"> </span></h4> <ul class="svelte-kxkftj"></ul></div> <div><h4 class="svelte-kxkftj">CLI commands <span class="svelte-kxkftj"> </span></h4> <ul class="svelte-kxkftj"></ul></div> <div><h4 class="svelte-kxkftj">Methods <span class="svelte-kxkftj"> </span> AI-callable</h4> <ul class="svelte-kxkftj"></ul></div></div></article>`),C=a(`<p class="svelte-kxkftj">This app exposes no generated REST, MCP or CLI surface.</p>`),w=a(`<p class="smrt-connect-tools__lede svelte-kxkftj" data-smrt-part="description">For connecting other software or an AI assistant to this app. All of it is
1
+ import{$ as e,B as t,Ct as n,Dt as r,Ft as i,G as a,H as o,L as s,Ot as c,Pt as l,U as u,ft as d,ht as f,mt as p,pt as m,st as h}from"./DG3qFFTE.js";import"./xihTtKlq.js";import{At as g}from"./B1N9X4sc.js";var _=a(`<li><code class="svelte-kxkftj"><b> </b> </code></li>`),v=a(`<li class="smrt-connect-tools__none svelte-kxkftj" data-smrt-part="empty">None</li>`),y=a(`<li><code class="svelte-kxkftj"> </code></li>`),b=a(`<mark class="svelte-kxkftj">AI</mark>`),x=a(`<li><code class="svelte-kxkftj"> </code> <!></li>`),S=a(`<article class="svelte-kxkftj"><h3 class="svelte-kxkftj"> </h3> <div class="smrt-connect-tools__grid svelte-kxkftj" data-smrt-part="grid"><div><h4 class="svelte-kxkftj">REST routes <span class="svelte-kxkftj"> </span></h4> <ul class="svelte-kxkftj"></ul></div> <div><h4 class="svelte-kxkftj">MCP tools <span class="svelte-kxkftj"> </span></h4> <ul class="svelte-kxkftj"></ul></div> <div><h4 class="svelte-kxkftj">CLI commands <span class="svelte-kxkftj"> </span></h4> <ul class="svelte-kxkftj"></ul></div> <div><h4 class="svelte-kxkftj">Methods <span class="svelte-kxkftj"> </span> AI-callable</h4> <ul class="svelte-kxkftj"></ul></div></div></article>`),C=a(`<p class="svelte-kxkftj">This app exposes no generated REST, MCP or CLI surface.</p>`),w=a(`<p class="smrt-connect-tools__lede svelte-kxkftj" data-smrt-part="description">For connecting other software or an AI assistant to this app. All of it is
2
2
  generated by s-m-r-t from the model; none of it was written by hand.</p> <!>`,1),T=a(`<section class="smrt-connect-tools__root svelte-kxkftj" aria-label="Connect other tools" data-smrt-component="ConnectTools"><!></section>`);function E(a,E){c(E,!0);let D=n(()=>E.models.filter(e=>e.exposed));var O=T(),k=d(O);g(k,{title:`Connect other tools`,children:(n,r)=>{var a=w(),c=f(m(a),2);s(c,17,()=>e(D),e=>e.id,(n,r)=>{var a=S(),c=d(a),m=p(c,!0),g=f(c,2),C=d(g),w=d(C),T=f(d(w)),E=p(T,!0);i(w);var D=f(w,2);s(D,21,()=>e(r).rest,e=>e.method+e.path,(t,n)=>{var r=_(),a=d(r),s=d(a),c=p(s,!0),l=f(s);i(a),i(r),h(()=>{o(c,e(n).method),o(l,` /api${e(n).path??``}`)}),u(t,r)},e=>{var t=v();u(e,t)}),i(D),i(C);var O=f(C,2),k=d(O),A=f(d(k)),j=p(A,!0);i(k);var M=f(k,2);s(M,21,()=>e(r).mcp,e=>e.name,(t,n)=>{var r=y(),a=d(r),s=p(a,!0);i(r),h(()=>o(s,e(n).name)),u(t,r)},e=>{var t=v();u(e,t)}),i(M),i(O);var N=f(O,2),P=d(N),F=f(d(P)),I=p(F,!0);i(P);var L=f(P,2);s(L,21,()=>e(r).cli,e=>e.name,(t,n)=>{var r=y(),a=d(r),s=p(a,!0);i(r),h(()=>o(s,e(n).name)),u(t,r)},e=>{var t=v();u(e,t)}),i(L),i(N);var R=f(N,2),z=d(R),B=f(d(z)),V=p(B,!0);l(),i(z);var H=f(z,2);s(H,21,()=>e(r).methods,e=>e.name,(n,r)=>{var a=x(),s=d(a),c=p(s),l=f(s,2),m=e=>{var t=b();u(e,t)};t(l,t=>{e(r).aiCallable&&t(m)}),i(a),h(t=>o(c,`${e(r).name??``}(${t??``})`),[()=>e(r).parameters.join(`, `)]),u(n,a)},e=>{var t=v();u(e,t)}),i(H),i(R),i(g),i(a),h(t=>{o(m,e(r).name),o(E,e(r).rest.length),o(j,e(r).mcp.length),o(I,e(r).cli.length),o(V,t)},[()=>e(r).methods.filter(e=>e.aiCallable).length]),u(n,a)},e=>{var t=C();u(e,t)}),u(n,a)},$$slots:{default:!0}}),i(O),u(a,O),r()}export{E as t};
@@ -1 +1 @@
1
- import{$ as e,bt as t,tt as n,vt as r,xt as i}from"./DG3qFFTE.js";import{F as a,G as o,H as s,N as c,P as ee,U as te,V as l,W as u,_t as d,ct as f,ft as p,pt as m,w as h,z as ne}from"./IVfnZdeW.js";import{_ as re,r as ie}from"./DitEeA6X.js";import{c as ae}from"./DMtbj61v.js";import"./Ci5c8JBX.js";import{i as oe,n as g,o as _,r as v,s as y}from"./VBANaoR3.js";import{M as b,P as x,V as S,W as C,b as w,t as T,v as E,x as D,z as O}from"./DKGzf415.js";import{b as k,v as A,x as j,y as M}from"./B9ucQYIA.js";import{n as N}from"./BizV6cxC.js";import{t as P}from"./P_haQ8j4.js";import{r as F,t as I}from"./DkyrxFMJ.js";import{a as L,c as R,d as z,l as B,n as V}from"./DcORu4n4.js";function H(e,t=A.appliedWork){return j(e.snapshot(),t)}function U(e,t,n){let r=M(e,_,n);if(r.ok){let n=t.theme,i=r.cookbook.theme,o=i?i.colorScheme||!n?.colorScheme?void 0:{...i,colorScheme:n.colorScheme}:n;t.replace(r.cookbook),o&&(t.theme=o),a(e.id),A.select(e.id,k(t.snapshot()))}return r}function W(e,t){return e.document.recipes.every(e=>t.recipes.includes(e))&&e.document.features.every(e=>t.features.includes(e))}function G(e){let t=e.recipes.flatMap(e=>{let t=D.get(e);return t?[t]:[]}),n=O(t).map(e=>{let t=new Set,n=[];for(let r of e.recipes)for(let e of E(r)){let r=S(e.packageId,e.model.name,e.key);t.has(r)||(t.add(r),n.push({id:r,href:`#`,label:e.label,icon:e.icon,description:e.description}))}return{id:`section:${e.id}`,heading:e.label,items:n}}).filter(e=>e.items.length>0),r=x(e.features).map(e=>({id:e.id,href:`#`,label:e.label,icon:e.icon,description:e.description}));return r.length&&n.push({id:`section:${b.id}`,heading:b.label,items:r}),n}function K(e){let t=e.layout;return re([],G(e),void 0,t).groups.map(e=>({id:e.id??String(e.heading),label:e.heading??``,entries:e.items.map(e=>({id:e.id??e.href,label:t?.items?.[e.id??e.href]?.label?.trim()||e.label}))}))}var q={live:`Live`,mock:`Mock`,sample:`Sample`,server:`Server`},se={live:`Runs for real in your browser.`,mock:`Runs in your browser, but a provider is faked.`,sample:`Shows sample data only; it cannot reach what it needs.`,server:`Needs a server, which this browser-only demo does not have.`},ce={live:`success`,mock:`info`,sample:`warning`,server:`default`};function le(e){return e.effectiveDemo??e.demo}function ue(e){if(e)return{mode:e.mode,label:q[e.mode],meaning:se[e.mode],variant:ce[e.mode],reasons:e.reasons,mocked:e.mocked??[]}}function de(e){if(!e)return;if(e.status===`browser-safe`)return`Its package builds for a browser.`;let t=[`Its package does not build for a browser yet`];return e.reason&&t.push(`(${e.reason})`),e.issues?.length&&t.push(`and is tracked in ${e.issues.join(`, `)}`),`${t.join(` `)}.`}var J=`@happyvertical/smrt-commerce:`,fe=`${J}TaxCode`,pe=`${J}TaxComponent`,Y=`${J}TaxSettings`,me=`${J}DocumentTax`;function X(){let e=ee()??.05;return{codes:p(e),fallback:f(e)}}function he(e){try{let t=e?.getItem(oe);if(!t)return;let n=y(t,{dropUnknownRecipes:!0});n.ok&&v(n.cookbook)}catch{}}function ge(){return he(u()),I({storage:u(),defaults:e=>T.apply(e).background,empty:[L,V,me,P],samples:{[fe]:{from:[],make:()=>X().codes.map(e=>({id:e.id,code:e.code,name:e.name,kind:e.kind,appliesTo:e.appliesTo,active:e.active,componentsJson:JSON.stringify(e.components.map(e=>({taxComponentId:e.id,compound:!1})))}))},[pe]:{from:[],make:()=>m(X().codes).map(e=>({id:e.id,name:e.name,percent:e.percent,liabilityAccountId:null,recoverable:e.recoverable,active:!0}))},[Y]:{from:[],make:()=>{let{fallback:e}=X(),t=c();return[{id:h(`${Y}:sample`),defaultSalesTaxCodeId:e.id,defaultPurchaseTaxCodeId:e.id,defaultLineAmountType:t.pricesIncludeTax?`inclusive`:`exclusive`,taxRoundingScope:t.taxRounding}]}},...R(F),[B]:{from:[F(`@happyvertical/smrt-products:Product`)],make:([e])=>(e??[]).map((e,t)=>({id:h(`${B}:sample:${e.id}`),name:`${String(e.name??`Product`)} image`,sourceUri:`data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240"><rect width="240" height="240" fill="hsl(${t*47%360} 40% 82%)"/><circle cx="120" cy="94" r="46" fill="hsl(${(t*47+30)%360} 35% 58%)"/><path d="M44 214c20-55 132-55 152 0" fill="hsl(${(t*47+10)%360} 30% 46%)"/><text x="120" y="224" text-anchor="middle" font-family="sans-serif" font-size="14" fill="white">${String(e.name??``).replace(/[<&>]/g,``)}</text></svg>`)}`,mimeType:`image/svg+xml`,description:`Sample image for ${String(e.name??`this product`)}.`,sourceType:`browser-demo`}))},[z]:{from:[F(`@happyvertical/smrt-products:Product`),F(B)],make:([e,t])=>(e??[]).flatMap((e,n)=>{let r=t?.[n];return r?[{id:h(`${z}:sample:${e.id}`),productId:e.id,assetId:r.id,relationship:`gallery`,sortOrder:0}]:[]})}},children:{models:d.packages.flatMap(e=>e.models),links:e=>C(d,w,e)}})}var _e=new class{#e=t(void 0);get endpoint(){return e(this.#e)}set endpoint(e){r(this.#e,e,!0)}#t=t(!1);get tokenInConfig(){return e(this.#t)}set tokenInConfig(e){r(this.#t,e,!0)}#n=t(void 0);get token(){return e(this.#n)}set token(e){r(this.#n,e,!0)}#r=t(`idle`);get status(){return e(this.#r)}set status(e){r(this.#r,e,!0)}#i=t(void 0);get outcome(){return e(this.#i)}set outcome(e){r(this.#i,e,!0)}get config(){return this.endpoint&&this.token&&!this.tokenInConfig?{endpoint:this.endpoint,token:this.token}:void 0}get needsLink(){return!!this.endpoint&&!this.token&&!this.tokenInConfig}configure(e,t){this.endpoint=e?.endpoint,this.tokenInConfig=e?.tokenInConfig===!0,this.token=e?t:void 0,this.status=`idle`,this.outcome=void 0}async send(e,t){let n=this.config;if(!n||this.status===`sending`)return;this.status=`sending`,this.outcome=void 0;let r=await ae(n,e,t);this.outcome=r,this.status=r.ok?`sent`:`failed`}},Z=`cookbook`,ve=new class{#e=t(null);get open(){return e(this.#e)}set open(e){r(this.#e,e,!0)}#t=t(null);get returnTo(){return e(this.#t)}set returnTo(e){r(this.#t,e,!0)}navigator=null;show(e){this.returnTo=e,this.navigator?this.navigator.open(e):this.set(e)}back(){this.open&&(this.returnTo=this.open),this.navigator?this.navigator.close():this.set(null)}async set(e,t=!0){this.open!==e&&(t?await ie(async()=>{this.open=e,await n()}):this.open=e)}};function ye(e,t){let n=new URLSearchParams(e).get(Z);return n&&t.includes(n)?n:null}function be(e,t){let n=new URLSearchParams(e);t?n.set(Z,t):n.delete(Z);let r=n.toString().replace(/%2C/gi,`,`);return r?`?${r}`:``}var xe=`Planner`;function Q(e,t,n=N,r=xe){let i=e.name?.trim();if(i)return i;let a=t?n.find(e=>e.id===t):void 0;return a&&W(a,e)?a.name:r}function Se(e){return Q(g.snapshot(),A.active,void 0,e)}var Ce=Symbol(`planner-project-persistence-owner`),$=t(0),we={get remembering(){return e($),l()},get recoveryAvailable(){return e($),o().recoveryAvailable()},setRemember(e){let t=te(e);return i($),t},recover(){let e=o().recover();return i($),e},discardRecovery(){let e=o().discardRecovery();return i($),e}};function Te(e){if(!s())return!1;try{e.nativeAssistant?.reset(),g.reset({preserveTheme:!0}),A.active=null,A.appliedWork=null,ne(),a(null),e.dataSource.reset?.(),e.controller.resetWorkspace?.()}finally{i($),e.onreset?.()}return!0}export{H as _,ye as a,_e as c,ue as d,le as f,W as g,U as h,Se as i,ge as l,K as m,Te as n,ve as o,G as p,we as r,be as s,Ce as t,de as u};
1
+ import{$ as e,bt as t,tt as n,vt as r,xt as i}from"./DG3qFFTE.js";import{F as a,G as o,H as s,N as c,P as ee,U as te,V as l,W as u,_t as d,ct as f,ft as p,pt as m,w as h,z as ne}from"./B1N9X4sc.js";import{_ as re,r as ie}from"./C2e2zlhC.js";import{c as ae}from"./DuWbl1Oh.js";import"./CZ15IDt6.js";import{i as oe,n as g,o as _,r as v,s as y}from"./DX4jMOO7.js";import{M as b,P as x,V as S,W as C,b as w,t as T,v as E,x as D,z as O}from"./DscjQjQg.js";import{b as k,v as A,x as j,y as M}from"./8KoKLERF.js";import{n as N}from"./D1Gn2wRJ.js";import{t as P}from"./CCS83DIe.js";import{r as F,t as I}from"./BlZ_GEbZ.js";import{a as L,c as R,d as z,l as B,n as V}from"./S7FiQFTc.js";function H(e,t=A.appliedWork){return j(e.snapshot(),t)}function U(e,t,n){let r=M(e,_,n);if(r.ok){let n=t.theme,i=r.cookbook.theme,o=i?i.colorScheme||!n?.colorScheme?void 0:{...i,colorScheme:n.colorScheme}:n;t.replace(r.cookbook),o&&(t.theme=o),a(e.id),A.select(e.id,k(t.snapshot()))}return r}function W(e,t){return e.document.recipes.every(e=>t.recipes.includes(e))&&e.document.features.every(e=>t.features.includes(e))}function G(e){let t=e.recipes.flatMap(e=>{let t=D.get(e);return t?[t]:[]}),n=O(t).map(e=>{let t=new Set,n=[];for(let r of e.recipes)for(let e of E(r)){let r=S(e.packageId,e.model.name,e.key);t.has(r)||(t.add(r),n.push({id:r,href:`#`,label:e.label,icon:e.icon,description:e.description}))}return{id:`section:${e.id}`,heading:e.label,items:n}}).filter(e=>e.items.length>0),r=x(e.features).map(e=>({id:e.id,href:`#`,label:e.label,icon:e.icon,description:e.description}));return r.length&&n.push({id:`section:${b.id}`,heading:b.label,items:r}),n}function K(e){let t=e.layout;return re([],G(e),void 0,t).groups.map(e=>({id:e.id??String(e.heading),label:e.heading??``,entries:e.items.map(e=>({id:e.id??e.href,label:t?.items?.[e.id??e.href]?.label?.trim()||e.label}))}))}var q={live:`Live`,mock:`Mock`,sample:`Sample`,server:`Server`},se={live:`Runs for real in your browser.`,mock:`Runs in your browser, but a provider is faked.`,sample:`Shows sample data only; it cannot reach what it needs.`,server:`Needs a server, which this browser-only demo does not have.`},ce={live:`success`,mock:`info`,sample:`warning`,server:`default`};function le(e){return e.effectiveDemo??e.demo}function ue(e){if(e)return{mode:e.mode,label:q[e.mode],meaning:se[e.mode],variant:ce[e.mode],reasons:e.reasons,mocked:e.mocked??[]}}function de(e){if(!e)return;if(e.status===`browser-safe`)return`Its package builds for a browser.`;let t=[`Its package does not build for a browser yet`];return e.reason&&t.push(`(${e.reason})`),e.issues?.length&&t.push(`and is tracked in ${e.issues.join(`, `)}`),`${t.join(` `)}.`}var J=`@happyvertical/smrt-commerce:`,fe=`${J}TaxCode`,pe=`${J}TaxComponent`,Y=`${J}TaxSettings`,me=`${J}DocumentTax`;function X(){let e=ee()??.05;return{codes:p(e),fallback:f(e)}}function he(e){try{let t=e?.getItem(oe);if(!t)return;let n=y(t,{dropUnknownRecipes:!0});n.ok&&v(n.cookbook)}catch{}}function ge(){return he(u()),I({storage:u(),defaults:e=>T.apply(e).background,empty:[L,V,me,P],samples:{[fe]:{from:[],make:()=>X().codes.map(e=>({id:e.id,code:e.code,name:e.name,kind:e.kind,appliesTo:e.appliesTo,active:e.active,componentsJson:JSON.stringify(e.components.map(e=>({taxComponentId:e.id,compound:!1})))}))},[pe]:{from:[],make:()=>m(X().codes).map(e=>({id:e.id,name:e.name,percent:e.percent,liabilityAccountId:null,recoverable:e.recoverable,active:!0}))},[Y]:{from:[],make:()=>{let{fallback:e}=X(),t=c();return[{id:h(`${Y}:sample`),defaultSalesTaxCodeId:e.id,defaultPurchaseTaxCodeId:e.id,defaultLineAmountType:t.pricesIncludeTax?`inclusive`:`exclusive`,taxRoundingScope:t.taxRounding}]}},...R(F),[B]:{from:[F(`@happyvertical/smrt-products:Product`)],make:([e])=>(e??[]).map((e,t)=>({id:h(`${B}:sample:${e.id}`),name:`${String(e.name??`Product`)} image`,sourceUri:`data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240"><rect width="240" height="240" fill="hsl(${t*47%360} 40% 82%)"/><circle cx="120" cy="94" r="46" fill="hsl(${(t*47+30)%360} 35% 58%)"/><path d="M44 214c20-55 132-55 152 0" fill="hsl(${(t*47+10)%360} 30% 46%)"/><text x="120" y="224" text-anchor="middle" font-family="sans-serif" font-size="14" fill="white">${String(e.name??``).replace(/[<&>]/g,``)}</text></svg>`)}`,mimeType:`image/svg+xml`,description:`Sample image for ${String(e.name??`this product`)}.`,sourceType:`browser-demo`}))},[z]:{from:[F(`@happyvertical/smrt-products:Product`),F(B)],make:([e,t])=>(e??[]).flatMap((e,n)=>{let r=t?.[n];return r?[{id:h(`${z}:sample:${e.id}`),productId:e.id,assetId:r.id,relationship:`gallery`,sortOrder:0}]:[]})}},children:{models:d.packages.flatMap(e=>e.models),links:e=>C(d,w,e)}})}var _e=new class{#e=t(void 0);get endpoint(){return e(this.#e)}set endpoint(e){r(this.#e,e,!0)}#t=t(!1);get tokenInConfig(){return e(this.#t)}set tokenInConfig(e){r(this.#t,e,!0)}#n=t(void 0);get token(){return e(this.#n)}set token(e){r(this.#n,e,!0)}#r=t(`idle`);get status(){return e(this.#r)}set status(e){r(this.#r,e,!0)}#i=t(void 0);get outcome(){return e(this.#i)}set outcome(e){r(this.#i,e,!0)}get config(){return this.endpoint&&this.token&&!this.tokenInConfig?{endpoint:this.endpoint,token:this.token}:void 0}get needsLink(){return!!this.endpoint&&!this.token&&!this.tokenInConfig}configure(e,t){this.endpoint=e?.endpoint,this.tokenInConfig=e?.tokenInConfig===!0,this.token=e?t:void 0,this.status=`idle`,this.outcome=void 0}async send(e,t){let n=this.config;if(!n||this.status===`sending`)return;this.status=`sending`,this.outcome=void 0;let r=await ae(n,e,t);this.outcome=r,this.status=r.ok?`sent`:`failed`}},Z=`cookbook`,ve=new class{#e=t(null);get open(){return e(this.#e)}set open(e){r(this.#e,e,!0)}#t=t(null);get returnTo(){return e(this.#t)}set returnTo(e){r(this.#t,e,!0)}navigator=null;show(e){this.returnTo=e,this.navigator?this.navigator.open(e):this.set(e)}back(){this.open&&(this.returnTo=this.open),this.navigator?this.navigator.close():this.set(null)}async set(e,t=!0){this.open!==e&&(t?await ie(async()=>{this.open=e,await n()}):this.open=e)}};function ye(e,t){let n=new URLSearchParams(e).get(Z);return n&&t.includes(n)?n:null}function be(e,t){let n=new URLSearchParams(e);t?n.set(Z,t):n.delete(Z);let r=n.toString().replace(/%2C/gi,`,`);return r?`?${r}`:``}var xe=`Planner`;function Q(e,t,n=N,r=xe){let i=e.name?.trim();if(i)return i;let a=t?n.find(e=>e.id===t):void 0;return a&&W(a,e)?a.name:r}function Se(e){return Q(g.snapshot(),A.active,void 0,e)}var Ce=Symbol(`planner-project-persistence-owner`),$=t(0),we={get remembering(){return e($),l()},get recoveryAvailable(){return e($),o().recoveryAvailable()},setRemember(e){let t=te(e);return i($),t},recover(){let e=o().recover();return i($),e},discardRecovery(){let e=o().discardRecovery();return i($),e}};function Te(e){if(!s())return!1;try{e.nativeAssistant?.reset(),g.reset({preserveTheme:!0}),A.active=null,A.appliedWork=null,ne(),a(null),e.dataSource.reset?.(),e.controller.resetWorkspace?.()}finally{i($),e.onreset?.()}return!0}export{H as _,ye as a,_e as c,ue as d,le as f,W as g,U as h,Se as i,ge as l,K as m,Te as n,ve as o,G as p,we as r,be as s,Ce as t,de as u};
@@ -1 +1 @@
1
- import"./DG3qFFTE.js";import{c as e}from"./CTRau-kw.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"./CkdqvxRs.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=["../nodes/0.Cs1YBu1i.js","../chunks/COiEfhsA.js","../chunks/DG3qFFTE.js","../chunks/CTRau-kw.js","../chunks/Dt-HX3Vu.js","../chunks/xihTtKlq.js","../chunks/IVfnZdeW.js","../chunks/Bq8E3AWP.js","../chunks/denq4QT7.js","../assets/currency-metadata.ksbBA8-C.css","../assets/app.V-5Q6-pe.css","../chunks/DitEeA6X.js","../chunks/BaNbYf_w.js","../chunks/Cekjnrta.js","../assets/feedback.DzqKT7fW.css","../chunks/D3syEjNq.js","../assets/SegmentedControl.2V179a-S.css","../chunks/DmfvgI_r.js","../assets/webmcp-ui-context.D9U5lh8x.css","../chunks/CbOFRn1N.js","../assets/data.C5MjAC5_.css","../chunks/CUyVrfsu.js","../chunks/B18A9OMt.js","../assets/forms.CaLOi679.css","../chunks/BYcBM-fh.js","../assets/AppShell.thGpRNkw.css","../chunks/DSeAvFCF.js","../assets/workspace.DZTCJDO9.css","../chunks/DMtbj61v.js","../chunks/CtG_Lwvh.js","../chunks/C7zBd-pD.js","../chunks/CMrsF8nJ.js","../chunks/D042ejzG.js","../chunks/DnUMJJeH.js","../chunks/eBF8D7GD.js","../chunks/VBANaoR3.js","../chunks/Tb0fgM0E.js","../chunks/DKGzf415.js","../assets/state.DYNXOUVq.css","../chunks/DOL_dsIt.js","../assets/labels.DPtEGJlJ.css","../chunks/B9ucQYIA.js","../chunks/BizV6cxC.js","../assets/icons.DYi73sXg.css","../chunks/Ci5c8JBX.js","../chunks/CmZMmuTY.js","../chunks/CNBdo__C.js","../chunks/d934w91N.js","../chunks/DiysZfH7.js","../chunks/P_haQ8j4.js","../assets/planner.XUJWm45F.css","../chunks/D_U_DYjx.js","../chunks/Dl8hOaIo.js","../chunks/DkyrxFMJ.js","../chunks/DcORu4n4.js","../chunks/D6ZRo7UR.js","../chunks/DnqxJ6hq.js","../assets/SectionIcons.liETPdFu.css","../assets/SectionActions.Nj_4KdHP.css","../chunks/BMgzWMdF.js","../chunks/CgAkqYsL.js","../assets/0.DMFSSXO1.css","../nodes/1.CdqDj38S.js","../nodes/2.r9chMBT0.js","../chunks/4mxo1tpy.js","../assets/AiSetup.DtwRxSiT.css","../chunks/DRZTI5Jr.js","../assets/percent.BZCTFHav.css","../chunks/DPl_ov_p.js","../assets/2.CcvU9c2m.css","../nodes/3.Cf7RgPAE.js","../assets/3.fDmgzTPl.css","../nodes/4.BJp4hi8y.js","../assets/4.BQm8MwiL.css","../nodes/5.BHhmEdIF.js","../nodes/6.CHTH4fCD.js","../nodes/7.CBjlj4lR.js","../chunks/DRByVC-c.js","../chunks/DqLclqJB.js","../chunks/CO-Ek-HE.js","../chunks/8hc9FYzo.js","../assets/FieldMapForm.CuEQCAa5.css","../chunks/JBD5vUbP.js","../assets/ModelPage.C23AB0cx.css","../nodes/8.XYqxqtaE.js","../nodes/9.B5xmGIfr.js","../nodes/10.cJaEWiya.js","../assets/10.khIHMNdN.css","../nodes/11.BRSIknzS.js","../chunks/Dnf-fyR5.js","../assets/ConnectTools.D9rQY8ee.css","../assets/11.B9VF0DIb.css","../nodes/12.CC8lX_rP.js","../assets/12.ClLcbD3A.css","../nodes/13.BeILpUVk.js","../assets/13.D_yDa9CL.css","../nodes/14.UJ0p0KAl.js","../assets/14.B4CQH8e1.css"])))=>i.map(i=>d[i]);
2
- import{$ as e,B as t,Ct as n,Dt as r,Ft as i,G as a,H as o,J as s,Ot as c,P as l,U as u,W as d,a as f,bt as p,ct as m,d as h,ft as g,ht as _,i as v,lt as y,pt as b,r as x,st as S,tt as C,vt as w}from"../chunks/DG3qFFTE.js";import{t as T}from"../chunks/BaNbYf_w.js";import"../chunks/xihTtKlq.js";var E={},D=a(`<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>`),O=a(`<!> <!>`,1);function k(a,v){c(v,!0);let T=f(v,`components`,23,()=>[]),E=f(v,`data_0`,3,null),k=f(v,`data_1`,3,null);y(()=>v.stores.page.set(v.page)),m(()=>{v.stores,v.page,v.constructors,T(),v.form,E(),k(),v.stores.page.notify()});let A=p(!1),j=p(!1),M=p(null);x(()=>{let t=v.stores.page.subscribe(()=>{e(A)&&(w(j,!0),C().then(()=>{w(M,document.title||`untitled page`,!0)}))});return w(A,!0),t});let N=n(()=>v.constructors[1]);var P=O(),F=b(P),I=t=>{let r=n(()=>v.constructors[0]);var i=d(),a=b(i);l(a,()=>e(r),(t,n)=>{h(n(t,{get data(){return E()},get form(){return v.form},get params(){return v.page.params},children:(t,n)=>{var r=d(),i=b(r);l(i,()=>e(N),(e,t)=>{h(t(e,{get data(){return k()},get form(){return v.form},get params(){return v.page.params}}),e=>T()[1]=e,()=>T()?.[1])}),u(t,r)},$$slots:{default:!0}}),e=>T()[0]=e,()=>T()?.[0])}),u(t,i)},L=t=>{let r=n(()=>v.constructors[0]);var i=d(),a=b(i);l(a,()=>e(r),(e,t)=>{h(t(e,{get data(){return E()},get form(){return v.form},get params(){return v.page.params}}),e=>T()[0]=e,()=>T()?.[0])}),u(t,i)};t(F,e=>{v.constructors[1]?e(I):e(L,-1)});var R=_(F,2),z=n=>{var r=D(),a=g(r),c=t=>{var n=s();S(()=>o(n,e(M))),u(t,n)};t(a,t=>{e(j)&&t(c)}),i(r),u(n,r)};t(R,t=>{e(A)&&t(z)}),u(a,P),r()}var A=v(k),j=[()=>T(()=>import(`../nodes/0.Cs1YBu1i.js`),__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,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61]),import.meta.url),()=>T(()=>import(`../nodes/1.CdqDj38S.js`),__vite__mapDeps([62,2,1,5,46,3,4]),import.meta.url),()=>T(()=>import(`../nodes/2.r9chMBT0.js`),__vite__mapDeps([63,2,1,5,13,7,14,6,8,9,10,11,12,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,51,52,44,49,53,54,59,64,65,66,67,68,69]),import.meta.url),()=>T(()=>import(`../nodes/3.Cf7RgPAE.js`),__vite__mapDeps([70,2,1,5,6,7,8,9,10,35,12,11,13,14,15,16,17,18,19,20,21,22,23,24,25,36,37,38,39,40,47,59,71]),import.meta.url),()=>T(()=>import(`../nodes/4.BJp4hi8y.js`),__vite__mapDeps([72,2,1,5,6,7,8,9,10,28,12,13,14,11,15,16,17,18,19,20,21,22,23,24,25,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,47,64,65,73]),import.meta.url),()=>T(()=>import(`../nodes/5.BHhmEdIF.js`),__vite__mapDeps([74,2,1,3,4,5,45,47]),import.meta.url),()=>T(()=>import(`../nodes/6.CHTH4fCD.js`),__vite__mapDeps([75,2,1,3,4,5,45,47]),import.meta.url),()=>T(()=>import(`../nodes/7.CBjlj4lR.js`),__vite__mapDeps([76,1,2,5,6,7,8,9,10,77,4,78,3,13,14,15,16,26,11,12,17,18,19,20,21,22,23,24,25,27,45,46,36,37,38,39,40,35,79,48,41,42,49,50,51,56,57,53,54,60,80,66,32,67,81,82,83]),import.meta.url),()=>T(()=>import(`../nodes/8.XYqxqtaE.js`),__vite__mapDeps([84,1,2,5,6,7,8,9,10,37,13,14,15,16,19,20,38,77,4,78,3,26,11,12,17,18,21,22,23,24,25,27,45,46,36,39,40,35,79,48,41,42,49,50,51,56,57,53,54,60,80,66,32,67,81,82,83]),import.meta.url),()=>T(()=>import(`../nodes/9.B5xmGIfr.js`),__vite__mapDeps([85,1,2,5,6,7,8,9,10,37,13,14,15,16,19,20,38,77,4,78,3,26,11,12,17,18,21,22,23,24,25,27,45,46,36,39,40,35,79,48,41,42,49,50,51,56,57,53,54,60,80,66,32,67,81,82,83]),import.meta.url),()=>T(()=>import(`../nodes/10.cJaEWiya.js`),__vite__mapDeps([86,2,1,5,6,7,8,9,10,17,18,22,15,16,23,68,44,11,12,13,14,19,20,21,24,25,26,27,87]),import.meta.url),()=>T(()=>import(`../nodes/11.BRSIknzS.js`),__vite__mapDeps([88,1,2,5,6,7,8,9,10,77,4,89,90,91]),import.meta.url),()=>T(()=>import(`../nodes/12.CC8lX_rP.js`),__vite__mapDeps([92,1,2,5,6,7,8,9,10,15,16,22,23,37,13,14,19,20,38,56,57,77,4,80,36,17,18,39,24,40,51,53,66,21,32,12,67,81,93]),import.meta.url),()=>T(()=>import(`../nodes/13.BeILpUVk.js`),__vite__mapDeps([94,1,2,5,6,7,8,9,10,37,13,14,15,16,19,20,38,56,57,77,4,82,89,90,95]),import.meta.url),()=>T(()=>import(`../nodes/14.UJ0p0KAl.js`),__vite__mapDeps([96,1,2,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,46,3,4,36,37,38,39,40,35,79,42,51,56,57,55,58,60,97]),import.meta.url)],M=[],N={"/":[2],"/advanced-styles":[3],"/ai":[4],"/blueprint":[5],"/cookbook":[6],"/m/[package]/[model]":[7],"/m/[package]/[model]/[view]":[8],"/m/[package]/[model]/[view]/edit":[9],"/packages":[10],"/packages/[id]":[11],"/recipes/[id]":[12],"/recipes/[id]/help":[13],"/s/[section]":[14]},P={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},F=Object.fromEntries(Object.entries(P.transport).map(([e,t])=>[e,t.decode])),I=Object.fromEntries(Object.entries(P.transport).map(([e,t])=>[e,t.encode])),L=!1,R=(e,t)=>F[e](t),z=()=>T(()=>import(`../chunks/Bjy-W4x2.js`).then(e=>e.default),[],import.meta.url);export{R as decode,F as decoders,N as dictionary,I as encoders,z as get_error_template,L as hash,P as hooks,E as matchers,j as nodes,A as root,M as server_loads};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.3ao9zFu9.js","../chunks/COiEfhsA.js","../chunks/DG3qFFTE.js","../chunks/CkdqvxRs.js","../chunks/Dt-HX3Vu.js","../chunks/xihTtKlq.js","../chunks/B1N9X4sc.js","../chunks/Bq8E3AWP.js","../chunks/denq4QT7.js","../assets/currency-metadata.ksbBA8-C.css","../assets/app.V-5Q6-pe.css","../chunks/C2e2zlhC.js","../chunks/BaNbYf_w.js","../chunks/Cekjnrta.js","../assets/feedback.DzqKT7fW.css","../chunks/D3syEjNq.js","../assets/SegmentedControl.2V179a-S.css","../chunks/DmfvgI_r.js","../assets/webmcp-ui-context.D9U5lh8x.css","../chunks/21btP0R4.js","../assets/data.C5MjAC5_.css","../chunks/CUyVrfsu.js","../chunks/B18A9OMt.js","../assets/forms.CaLOi679.css","../chunks/BYcBM-fh.js","../assets/AppShell.thGpRNkw.css","../chunks/SHRXoxhn.js","../assets/workspace.DZTCJDO9.css","../chunks/DuWbl1Oh.js","../chunks/CVokFrMd.js","../chunks/C7zBd-pD.js","../chunks/CMrsF8nJ.js","../chunks/D042ejzG.js","../chunks/DnUMJJeH.js","../chunks/eBF8D7GD.js","../chunks/DX4jMOO7.js","../chunks/D5sQ2Umm.js","../chunks/DscjQjQg.js","../assets/state.DYNXOUVq.css","../chunks/DOL_dsIt.js","../assets/labels.DPtEGJlJ.css","../chunks/8KoKLERF.js","../chunks/D1Gn2wRJ.js","../assets/icons.DYi73sXg.css","../chunks/CZ15IDt6.js","../chunks/BSt3Zpcw.js","../chunks/k3Hz_f-J.js","../chunks/d934w91N.js","../chunks/C9Zasc6Q.js","../chunks/CCS83DIe.js","../assets/planner.XUJWm45F.css","../chunks/D_U_DYjx.js","../chunks/hmkL0C6A.js","../chunks/BlZ_GEbZ.js","../chunks/S7FiQFTc.js","../chunks/Clve4ff2.js","../chunks/CAJ8G3_g.js","../assets/SectionIcons.liETPdFu.css","../assets/SectionActions.Nj_4KdHP.css","../chunks/BMgzWMdF.js","../chunks/CgAkqYsL.js","../assets/0.DMFSSXO1.css","../nodes/1.B0kCJ1Vy.js","../nodes/2.CixcB0a9.js","../chunks/crptSb4T.js","../assets/AiSetup.DtwRxSiT.css","../chunks/CoMpGlIE.js","../assets/percent.BZCTFHav.css","../chunks/C3sAQYIE.js","../assets/2.CcvU9c2m.css","../nodes/3.nPNmnxjt.js","../assets/3.fDmgzTPl.css","../nodes/4.ClDKAbS8.js","../assets/4.BQm8MwiL.css","../nodes/5.0HCxvdYs.js","../nodes/6.NU1dOEjb.js","../nodes/7.B_ARecF3.js","../chunks/DRByVC-c.js","../chunks/BKuS9aY_.js","../chunks/CO-Ek-HE.js","../chunks/Ci5_Sps_.js","../assets/FieldMapForm.CuEQCAa5.css","../chunks/JBD5vUbP.js","../assets/ModelPage.C23AB0cx.css","../nodes/8.CcH0Wetj.js","../nodes/9.C6wNa-vK.js","../nodes/10.CHIi5c5-.js","../assets/10.khIHMNdN.css","../nodes/11.Dtf4xKim.js","../chunks/gTD3HoIw.js","../assets/ConnectTools.D9rQY8ee.css","../assets/11.B9VF0DIb.css","../nodes/12.B7PiUbGI.js","../assets/12.ClLcbD3A.css","../nodes/13.81fsgeBq.js","../assets/13.D_yDa9CL.css","../nodes/14.BUQf4Y1E.js","../assets/14.B4CQH8e1.css"])))=>i.map(i=>d[i]);
2
+ import{$ as e,B as t,Ct as n,Dt as r,Ft as i,G as a,H as o,J as s,Ot as c,P as l,U as u,W as d,a as f,bt as p,ct as m,d as h,ft as g,ht as _,i as v,lt as y,pt as b,r as x,st as S,tt as C,vt as w}from"../chunks/DG3qFFTE.js";import{t as T}from"../chunks/BaNbYf_w.js";import"../chunks/xihTtKlq.js";var E={},D=a(`<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>`),O=a(`<!> <!>`,1);function k(a,v){c(v,!0);let T=f(v,`components`,23,()=>[]),E=f(v,`data_0`,3,null),k=f(v,`data_1`,3,null);y(()=>v.stores.page.set(v.page)),m(()=>{v.stores,v.page,v.constructors,T(),v.form,E(),k(),v.stores.page.notify()});let A=p(!1),j=p(!1),M=p(null);x(()=>{let t=v.stores.page.subscribe(()=>{e(A)&&(w(j,!0),C().then(()=>{w(M,document.title||`untitled page`,!0)}))});return w(A,!0),t});let N=n(()=>v.constructors[1]);var P=O(),F=b(P),I=t=>{let r=n(()=>v.constructors[0]);var i=d(),a=b(i);l(a,()=>e(r),(t,n)=>{h(n(t,{get data(){return E()},get form(){return v.form},get params(){return v.page.params},children:(t,n)=>{var r=d(),i=b(r);l(i,()=>e(N),(e,t)=>{h(t(e,{get data(){return k()},get form(){return v.form},get params(){return v.page.params}}),e=>T()[1]=e,()=>T()?.[1])}),u(t,r)},$$slots:{default:!0}}),e=>T()[0]=e,()=>T()?.[0])}),u(t,i)},L=t=>{let r=n(()=>v.constructors[0]);var i=d(),a=b(i);l(a,()=>e(r),(e,t)=>{h(t(e,{get data(){return E()},get form(){return v.form},get params(){return v.page.params}}),e=>T()[0]=e,()=>T()?.[0])}),u(t,i)};t(F,e=>{v.constructors[1]?e(I):e(L,-1)});var R=_(F,2),z=n=>{var r=D(),a=g(r),c=t=>{var n=s();S(()=>o(n,e(M))),u(t,n)};t(a,t=>{e(j)&&t(c)}),i(r),u(n,r)};t(R,t=>{e(A)&&t(z)}),u(a,P),r()}var A=v(k),j=[()=>T(()=>import(`../nodes/0.3ao9zFu9.js`),__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,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61]),import.meta.url),()=>T(()=>import(`../nodes/1.B0kCJ1Vy.js`),__vite__mapDeps([62,2,1,5,46,3,4]),import.meta.url),()=>T(()=>import(`../nodes/2.CixcB0a9.js`),__vite__mapDeps([63,2,1,5,13,7,14,6,8,9,10,11,12,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,51,52,44,49,53,54,59,64,65,66,67,68,69]),import.meta.url),()=>T(()=>import(`../nodes/3.nPNmnxjt.js`),__vite__mapDeps([70,2,1,5,6,7,8,9,10,35,12,11,13,14,15,16,17,18,19,20,21,22,23,24,25,36,37,38,39,40,47,59,71]),import.meta.url),()=>T(()=>import(`../nodes/4.ClDKAbS8.js`),__vite__mapDeps([72,2,1,5,6,7,8,9,10,28,12,13,14,11,15,16,17,18,19,20,21,22,23,24,25,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,47,64,65,73]),import.meta.url),()=>T(()=>import(`../nodes/5.0HCxvdYs.js`),__vite__mapDeps([74,2,1,3,4,5,45,47]),import.meta.url),()=>T(()=>import(`../nodes/6.NU1dOEjb.js`),__vite__mapDeps([75,2,1,3,4,5,45,47]),import.meta.url),()=>T(()=>import(`../nodes/7.B_ARecF3.js`),__vite__mapDeps([76,1,2,5,6,7,8,9,10,77,4,78,3,13,14,15,16,26,11,12,17,18,19,20,21,22,23,24,25,27,45,46,36,37,38,39,40,35,79,48,41,42,49,50,51,56,57,53,54,60,80,66,32,67,81,82,83]),import.meta.url),()=>T(()=>import(`../nodes/8.CcH0Wetj.js`),__vite__mapDeps([84,1,2,5,6,7,8,9,10,37,13,14,15,16,19,20,38,77,4,78,3,26,11,12,17,18,21,22,23,24,25,27,45,46,36,39,40,35,79,48,41,42,49,50,51,56,57,53,54,60,80,66,32,67,81,82,83]),import.meta.url),()=>T(()=>import(`../nodes/9.C6wNa-vK.js`),__vite__mapDeps([85,1,2,5,6,7,8,9,10,37,13,14,15,16,19,20,38,77,4,78,3,26,11,12,17,18,21,22,23,24,25,27,45,46,36,39,40,35,79,48,41,42,49,50,51,56,57,53,54,60,80,66,32,67,81,82,83]),import.meta.url),()=>T(()=>import(`../nodes/10.CHIi5c5-.js`),__vite__mapDeps([86,2,1,5,6,7,8,9,10,17,18,22,15,16,23,68,44,11,12,13,14,19,20,21,24,25,26,27,87]),import.meta.url),()=>T(()=>import(`../nodes/11.Dtf4xKim.js`),__vite__mapDeps([88,1,2,5,6,7,8,9,10,77,4,89,90,91]),import.meta.url),()=>T(()=>import(`../nodes/12.B7PiUbGI.js`),__vite__mapDeps([92,1,2,5,6,7,8,9,10,15,16,22,23,37,13,14,19,20,38,56,57,77,4,80,36,17,18,39,24,40,51,53,66,21,32,12,67,81,93]),import.meta.url),()=>T(()=>import(`../nodes/13.81fsgeBq.js`),__vite__mapDeps([94,1,2,5,6,7,8,9,10,37,13,14,15,16,19,20,38,56,57,77,4,82,89,90,95]),import.meta.url),()=>T(()=>import(`../nodes/14.BUQf4Y1E.js`),__vite__mapDeps([96,1,2,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,46,3,4,36,37,38,39,40,35,79,42,51,56,57,55,58,60,97]),import.meta.url)],M=[],N={"/":[2],"/advanced-styles":[3],"/ai":[4],"/blueprint":[5],"/cookbook":[6],"/m/[package]/[model]":[7],"/m/[package]/[model]/[view]":[8],"/m/[package]/[model]/[view]/edit":[9],"/packages":[10],"/packages/[id]":[11],"/recipes/[id]":[12],"/recipes/[id]/help":[13],"/s/[section]":[14]},P={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},F=Object.fromEntries(Object.entries(P.transport).map(([e,t])=>[e,t.decode])),I=Object.fromEntries(Object.entries(P.transport).map(([e,t])=>[e,t.encode])),L=!1,R=(e,t)=>F[e](t),z=()=>T(()=>import(`../chunks/Bjy-W4x2.js`).then(e=>e.default),[],import.meta.url);export{R as decode,F as decoders,N as dictionary,I as encoders,z as get_error_template,L as hash,P as hooks,E as matchers,j as nodes,A as root,M as server_loads};
@@ -0,0 +1 @@
1
+ export{l as load_css,o as start}from"../chunks/CkdqvxRs.js";
@@ -1,4 +1,4 @@
1
- import{n as e}from"../chunks/COiEfhsA.js";import{$ as t,B as n,Ct as r,Dt as i,E as a,F as o,Ft as s,G as c,H as l,J as u,L as d,Lt as f,Ot as p,Pt as m,R as h,T as g,U as _,W as v,X as y,Y as b,Z as x,a as S,b as C,bt as w,ct as T,d as E,dt as D,ft as O,gt as k,ht as A,k as j,kt as ee,l as M,mt as N,nt as P,ot as F,pt as I,r as L,s as te,st as R,ut as ne,v as z,vt as B,wt as re,z as ie}from"../chunks/DG3qFFTE.js";import{a as ae,i as oe,n as V,r as se,t as ce,u as le}from"../chunks/CTRau-kw.js";import"../chunks/xihTtKlq.js";import{a as ue,i as de,n as H,o as fe,p as pe,s as me,t as U,vt as he,xt as ge,yt as _e}from"../chunks/IVfnZdeW.js";import{n as W}from"../chunks/denq4QT7.js";import{i as ve,m as ye,n as be,p as xe,t as Se}from"../chunks/DitEeA6X.js";import{n as Ce}from"../chunks/DSeAvFCF.js";import{u as G}from"../chunks/DmfvgI_r.js";import{c as we,d as Te,h as Ee,s as De}from"../chunks/CbOFRn1N.js";import{A as Oe,C as ke,D as Ae,E as je,S as Me,b as Ne,i as K,j as Pe,n as Fe,r as Ie,s as Le,t as Re}from"../chunks/DMtbj61v.js";import"../chunks/Ci5c8JBX.js";import"../chunks/CmZMmuTY.js";import{t as q}from"../chunks/CNBdo__C.js";import{T as ze,m as Be,n as J,o as Ve,t as He,w as Ue}from"../chunks/VBANaoR3.js";import{M as Y,P as We,U as Ge,V as Ke,b as qe,g as Je,nt as Ye,t as X,u as Xe,v as Ze,z as Qe}from"../chunks/DKGzf415.js";import{g as Z,h as $e,v as et}from"../chunks/B9ucQYIA.js";import{n as tt,t as nt}from"../chunks/BizV6cxC.js";import"../chunks/d934w91N.js";import{a as rt,n as it,s as at,t as ot,u as st}from"../chunks/DiysZfH7.js";import{r as ct,t as lt}from"../chunks/D_U_DYjx.js";import{_ as ut,a as dt,c as ft,d as pt,f as mt,h as ht,i as gt,l as _t,m as vt,o as Q,r as yt,s as bt,t as xt}from"../chunks/Dl8hOaIo.js";import{n as St}from"../chunks/P_haQ8j4.js";import{t as Ct}from"../chunks/D6ZRo7UR.js";import{a as wt,i as Tt,n as Et,r as Dt}from"../chunks/BMgzWMdF.js";import{n as Ot}from"../chunks/CgAkqYsL.js";var kt=e({prerender:()=>!0,trailingSlash:()=>At}),At=`always`,jt=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20128%20128'%20role='img'%3e%3cdefs%3e%3clinearGradient%20id='flame'%20x1='26'%20y1='16'%20x2='101'%20y2='112'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23f05b2b'/%3e%3cstop%20offset='1'%20stop-color='%23c9381e'/%3e%3c/linearGradient%3e%3clinearGradient%20id='heat'%20x1='51'%20y1='49'%20x2='72'%20y2='111'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23ffd33d'/%3e%3cstop%20offset='1'%20stop-color='%23f2a817'/%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20fill='url(%23flame)'%20d='M64%205c-3%2018-15%2026-13%2043-9-5-13-13-13-22C20%2043%2015%2062%2022%2082c7%2022%2023%2037%2042%2041%2022-4%2039-21%2043-43%203-17-3-32-18-45%202%2011%200%2018-6%2025C84%2036%2075%2019%2064%205Z'%20/%3e%3cpath%20fill='url(%23heat)'%20d='M64%2045c-2%2015-14%2022-13%2038-5-4-8-9-9-15-7%2010-8%2020-4%2030%205%2012%2014%2020%2026%2023%2013-3%2023-12%2027-25%203-11%200-20-8-29%200%207-2%2012-6%2016%201-16-5-27-13-38Z'%20/%3e%3c!--%20The%20glasses%20render%20as%20two%20stacked%20stroke%20groups:%20a%20pale%20warm%20casing%20under%20a%20dark%20warm-charcoal%20stroke.%20The%20casing%20keeps%20the%20dark%20strokes%20legible%20where%20they%20leave%20the%20flame%20body%20(temple%20tips,%20lower%20rims)%20on%20dark%20backgrounds,%20and%20reads%20as%20a%20rim%20light%20against%20the%20flame%20on%20light%20ones.%20--%3e%3cg%20fill='none'%20stroke='%23ffe3ae'%20stroke-opacity='0.85'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cpath%20stroke-width='14'%20d='M7%2063c12-4%2027-5%2043-1M78%2062c16-4%2031-3%2043%201'/%3e%3crect%20x='12'%20y='58'%20width='46'%20height='35'%20rx='13'%20stroke-width='14'/%3e%3crect%20x='70'%20y='58'%20width='46'%20height='35'%20rx='13'%20stroke-width='14'/%3e%3cpath%20stroke-width='13'%20d='M57%2066c5-4%209-4%2014%200'/%3e%3c/g%3e%3cg%20fill='none'%20stroke='%2333221b'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cpath%20stroke-width='8'%20d='M7%2063c12-4%2027-5%2043-1M78%2062c16-4%2031-3%2043%201'/%3e%3crect%20x='12'%20y='58'%20width='46'%20height='35'%20rx='13'%20stroke-width='8'/%3e%3crect%20x='70'%20y='58'%20width='46'%20height='35'%20rx='13'%20stroke-width='8'/%3e%3cpath%20stroke-width='7'%20d='M57%2066c5-4%209-4%2014%200'/%3e%3c/g%3e%3c/svg%3e`,Mt=c(`<a class="smrt-ai-status-icons__cap svelte-nioco2" data-smrt-part="icon"><!></a>`),Nt=c(`<div class="smrt-ai-status-icons__root svelte-nioco2" role="group" aria-label="AI models" data-smrt-component="AiStatusIcons"></div>`);function Pt(e,n){p(n,!1);let r={think:Ie,hear:Re,speak:Fe};M();var a=Nt();d(a,5,()=>K.capabilities,e=>e.id,(e,n)=>{var i=Mt(),a=O(i);Ye(a,{get path(){return r[t(n).id]},size:20}),s(i),R(e=>{z(i,`href`,e),z(i,`data-state`,t(n).state),z(i,`aria-label`,t(n).label),z(i,`title`,t(n).label)},[()=>U(`/ai/`)]),_(e,i)}),s(a),_(e,a),i()}function Ft(e){let t=e.target;return!t||typeof t.closest!=`function`?!1:e.type===`input`?t.matches(`textarea, input[type="text"], input:not([type])`):e.type===`click`&&t.closest(`.smrt-dictation-button__root`)!==null}function It(e){let t=[{label:`Help me plan my app`,prompt:`Help me plan my app. Ask me what my business needs before adding recipes.`}],n=e[0];return n?(t.push({label:`Report on ${n.label}`,prompt:`Create a runtime report counting ${n.label} in the sample data.`}),n.dateField&&t.push({label:`${n.label} by month`,prompt:`Create a runtime report counting ${n.label} by month using ${n.dateField} in the sample data.`}),n.amountField&&t.push({label:`${n.label} totals`,prompt:`Create a runtime report showing the total ${n.amountField} for ${n.label} in the sample data.`}),t):[...t,{label:`What should my app track?`,prompt:`Help me work out what my business app should track. Ask about my business first.`}]}var Lt=c(`<div><!></div>`);function Rt(e,n){p(n,!0);let a=S(n,`answered`,3,null),o=it(ct()),c=r(()=>J.settings().currency),l=r(()=>o.fieldsFor(n.proposal.spec.source)),u=w(k(a())),d=w(null);function f(e){B(u,e,!0),n.onoutcome?.(e)}function m(e){f({status:`saved`,report:{id:e.id,title:e.title}}),ot(t(d),e)}var h=Lt(),g=O(h);st(g,{get proposal(){return n.proposal},get confirm(){return o.save},reportHref:e=>U(rt(e)),onsaved:m,ondecline:()=>f({status:`declined`}),get outcome(){return t(u)},get fields(){return t(l)},get currency(){return t(c)}}),s(h),E(h,e=>B(d,e),()=>t(d)),_(e,h),i()}var zt=c(`<span role="status" aria-live="polite"> </span> <progress max="100" aria-label="Speech model download" class="svelte-w5gfst"> </progress>`,1),Bt=c(`<span class="smrt-voice-typing__error svelte-w5gfst" role="alert" data-smrt-part="error"> </span>`),Vt=c(`<span>The speech model is already on this device. Turn on voice typing to
1
+ import{n as e}from"../chunks/COiEfhsA.js";import{$ as t,B as n,Ct as r,Dt as i,E as a,F as o,Ft as s,G as c,H as l,J as u,L as d,Lt as f,Ot as p,Pt as m,R as h,T as g,U as _,W as v,X as y,Y as b,Z as x,a as S,b as C,bt as w,ct as T,d as E,dt as D,ft as O,gt as k,ht as A,k as j,kt as ee,l as M,mt as N,nt as P,ot as F,pt as I,r as L,s as te,st as R,ut as ne,v as z,vt as B,wt as re,z as ie}from"../chunks/DG3qFFTE.js";import{a as ae,i as oe,n as V,r as se,t as ce,u as le}from"../chunks/CkdqvxRs.js";import"../chunks/xihTtKlq.js";import{a as ue,i as de,n as H,o as fe,p as pe,s as me,t as U,vt as he,xt as ge,yt as _e}from"../chunks/B1N9X4sc.js";import{n as W}from"../chunks/denq4QT7.js";import{i as ve,m as ye,n as be,p as xe,t as Se}from"../chunks/C2e2zlhC.js";import{n as Ce}from"../chunks/SHRXoxhn.js";import{u as G}from"../chunks/DmfvgI_r.js";import{c as we,d as Te,h as Ee,s as De}from"../chunks/21btP0R4.js";import{A as Oe,C as ke,D as Ae,E as je,S as Me,b as Ne,i as K,j as Pe,n as Fe,r as Ie,s as Le,t as Re}from"../chunks/DuWbl1Oh.js";import"../chunks/CZ15IDt6.js";import"../chunks/BSt3Zpcw.js";import{t as q}from"../chunks/k3Hz_f-J.js";import{T as ze,m as Be,n as J,o as Ve,t as He,w as Ue}from"../chunks/DX4jMOO7.js";import{M as Y,P as We,U as Ge,V as Ke,b as qe,g as Je,nt as Ye,t as X,u as Xe,v as Ze,z as Qe}from"../chunks/DscjQjQg.js";import{g as Z,h as $e,v as et}from"../chunks/8KoKLERF.js";import{n as tt,t as nt}from"../chunks/D1Gn2wRJ.js";import"../chunks/d934w91N.js";import{a as rt,n as it,s as at,t as ot,u as st}from"../chunks/C9Zasc6Q.js";import{r as ct,t as lt}from"../chunks/D_U_DYjx.js";import{_ as ut,a as dt,c as ft,d as pt,f as mt,h as ht,i as gt,l as _t,m as vt,o as Q,r as yt,s as bt,t as xt}from"../chunks/hmkL0C6A.js";import{n as St}from"../chunks/CCS83DIe.js";import{t as Ct}from"../chunks/Clve4ff2.js";import{a as wt,i as Tt,n as Et,r as Dt}from"../chunks/BMgzWMdF.js";import{n as Ot}from"../chunks/CgAkqYsL.js";var kt=e({prerender:()=>!0,trailingSlash:()=>At}),At=`always`,jt=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20128%20128'%20role='img'%3e%3cdefs%3e%3clinearGradient%20id='flame'%20x1='26'%20y1='16'%20x2='101'%20y2='112'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23f05b2b'/%3e%3cstop%20offset='1'%20stop-color='%23c9381e'/%3e%3c/linearGradient%3e%3clinearGradient%20id='heat'%20x1='51'%20y1='49'%20x2='72'%20y2='111'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23ffd33d'/%3e%3cstop%20offset='1'%20stop-color='%23f2a817'/%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20fill='url(%23flame)'%20d='M64%205c-3%2018-15%2026-13%2043-9-5-13-13-13-22C20%2043%2015%2062%2022%2082c7%2022%2023%2037%2042%2041%2022-4%2039-21%2043-43%203-17-3-32-18-45%202%2011%200%2018-6%2025C84%2036%2075%2019%2064%205Z'%20/%3e%3cpath%20fill='url(%23heat)'%20d='M64%2045c-2%2015-14%2022-13%2038-5-4-8-9-9-15-7%2010-8%2020-4%2030%205%2012%2014%2020%2026%2023%2013-3%2023-12%2027-25%203-11%200-20-8-29%200%207-2%2012-6%2016%201-16-5-27-13-38Z'%20/%3e%3c!--%20The%20glasses%20render%20as%20two%20stacked%20stroke%20groups:%20a%20pale%20warm%20casing%20under%20a%20dark%20warm-charcoal%20stroke.%20The%20casing%20keeps%20the%20dark%20strokes%20legible%20where%20they%20leave%20the%20flame%20body%20(temple%20tips,%20lower%20rims)%20on%20dark%20backgrounds,%20and%20reads%20as%20a%20rim%20light%20against%20the%20flame%20on%20light%20ones.%20--%3e%3cg%20fill='none'%20stroke='%23ffe3ae'%20stroke-opacity='0.85'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cpath%20stroke-width='14'%20d='M7%2063c12-4%2027-5%2043-1M78%2062c16-4%2031-3%2043%201'/%3e%3crect%20x='12'%20y='58'%20width='46'%20height='35'%20rx='13'%20stroke-width='14'/%3e%3crect%20x='70'%20y='58'%20width='46'%20height='35'%20rx='13'%20stroke-width='14'/%3e%3cpath%20stroke-width='13'%20d='M57%2066c5-4%209-4%2014%200'/%3e%3c/g%3e%3cg%20fill='none'%20stroke='%2333221b'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cpath%20stroke-width='8'%20d='M7%2063c12-4%2027-5%2043-1M78%2062c16-4%2031-3%2043%201'/%3e%3crect%20x='12'%20y='58'%20width='46'%20height='35'%20rx='13'%20stroke-width='8'/%3e%3crect%20x='70'%20y='58'%20width='46'%20height='35'%20rx='13'%20stroke-width='8'/%3e%3cpath%20stroke-width='7'%20d='M57%2066c5-4%209-4%2014%200'/%3e%3c/g%3e%3c/svg%3e`,Mt=c(`<a class="smrt-ai-status-icons__cap svelte-nioco2" data-smrt-part="icon"><!></a>`),Nt=c(`<div class="smrt-ai-status-icons__root svelte-nioco2" role="group" aria-label="AI models" data-smrt-component="AiStatusIcons"></div>`);function Pt(e,n){p(n,!1);let r={think:Ie,hear:Re,speak:Fe};M();var a=Nt();d(a,5,()=>K.capabilities,e=>e.id,(e,n)=>{var i=Mt(),a=O(i);Ye(a,{get path(){return r[t(n).id]},size:20}),s(i),R(e=>{z(i,`href`,e),z(i,`data-state`,t(n).state),z(i,`aria-label`,t(n).label),z(i,`title`,t(n).label)},[()=>U(`/ai/`)]),_(e,i)}),s(a),_(e,a),i()}function Ft(e){let t=e.target;return!t||typeof t.closest!=`function`?!1:e.type===`input`?t.matches(`textarea, input[type="text"], input:not([type])`):e.type===`click`&&t.closest(`.smrt-dictation-button__root`)!==null}function It(e){let t=[{label:`Help me plan my app`,prompt:`Help me plan my app. Ask me what my business needs before adding recipes.`}],n=e[0];return n?(t.push({label:`Report on ${n.label}`,prompt:`Create a runtime report counting ${n.label} in the sample data.`}),n.dateField&&t.push({label:`${n.label} by month`,prompt:`Create a runtime report counting ${n.label} by month using ${n.dateField} in the sample data.`}),n.amountField&&t.push({label:`${n.label} totals`,prompt:`Create a runtime report showing the total ${n.amountField} for ${n.label} in the sample data.`}),t):[...t,{label:`What should my app track?`,prompt:`Help me work out what my business app should track. Ask about my business first.`}]}var Lt=c(`<div><!></div>`);function Rt(e,n){p(n,!0);let a=S(n,`answered`,3,null),o=it(ct()),c=r(()=>J.settings().currency),l=r(()=>o.fieldsFor(n.proposal.spec.source)),u=w(k(a())),d=w(null);function f(e){B(u,e,!0),n.onoutcome?.(e)}function m(e){f({status:`saved`,report:{id:e.id,title:e.title}}),ot(t(d),e)}var h=Lt(),g=O(h);st(g,{get proposal(){return n.proposal},get confirm(){return o.save},reportHref:e=>U(rt(e)),onsaved:m,ondecline:()=>f({status:`declined`}),get outcome(){return t(u)},get fields(){return t(l)},get currency(){return t(c)}}),s(h),E(h,e=>B(d,e),()=>t(d)),_(e,h),i()}var zt=c(`<span role="status" aria-live="polite"> </span> <progress max="100" aria-label="Speech model download" class="svelte-w5gfst"> </progress>`,1),Bt=c(`<span class="smrt-voice-typing__error svelte-w5gfst" role="alert" data-smrt-part="error"> </span>`),Vt=c(`<span>The speech model is already on this device. Turn on voice typing to
2
2
  talk to the assistant?</span>`),Ht=c(`<span> </span>`),Ut=c(`<button type="button">Cancel</button>`),Wt=c(`<button type="button"> </button> <button type="button">Not now</button>`,1),Gt=c(`<div class="smrt-voice-typing__root svelte-w5gfst" role="group" aria-label="Voice typing" data-smrt-component="VoiceTyping"><svg class="smrt-voice-typing__icon svelte-w5gfst" viewBox="0 0 24 24" aria-hidden="true" data-smrt-part="icon"><path d="M12 15a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3Zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.92V22h2v-3.08A7 7 0 0 0 19 12h-2Z"></path></svg> <div class="smrt-voice-typing__text svelte-w5gfst" data-smrt-part="body"><!></div> <div class="smrt-voice-typing__actions svelte-w5gfst" data-smrt-part="actions"><!></div></div>`);function Kt(e,a){p(a,!0);let o=r(()=>Math.round(a.voice.size/1e6)),c=r(()=>Math.round(a.voice.progress*100)),u=r(()=>a.voice.status===`offer`||a.voice.status===`downloading`||a.voice.status===`error`);var d=v(),f=I(d),m=e=>{var r=Gt(),i=A(O(r),2),u=O(i),d=e=>{var n=zt(),r=I(n),i=N(r),o=A(r,2),s=N(o);R(()=>{l(i,`${a.voice.cached?`Turning on voice typing`:`Downloading speech model`}
3
3
  ${t(c)??``}%`),C(o,t(c)),l(s,`${t(c)??``}%`)}),_(e,n)},f=e=>{var t=Bt(),n=N(t);R(()=>l(n,`Voice typing could not start: ${a.voice.error??``}`)),_(e,t)},p=e=>{var t=Vt();_(e,t)},m=e=>{var n=Ht(),r=N(n);R(e=>l(r,`Your browser can't do voice typing on its own. Download a ${e??``} speech model to talk to the assistant?`),[()=>je(t(o))]),_(e,n)};n(u,e=>{a.voice.status===`downloading`?e(d):a.voice.status===`error`?e(f,1):a.voice.cached?e(p,2):e(m,-1)}),s(i);var h=A(i,2),g=O(h),v=e=>{var t=Ut();y(`click`,t,()=>a.voice.cancel()),_(e,t)},b=e=>{var t=Wt(),n=I(t),r=N(n,!0),i=A(n,2);R(()=>l(r,a.voice.status===`error`?`Try again`:a.voice.cached?`Turn on`:`Download`)),y(`click`,n,()=>void a.voice.enable()),y(`click`,i,()=>a.voice.dismiss()),_(e,t)};n(g,e=>{a.voice.status===`downloading`?e(v):e(b,-1)}),s(h),s(r),_(e,r)};n(f,e=>{t(u)&&e(m)}),_(e,d),i()}b([`click`]);var qt=c(`<div class="smrt-browser-assistant__offer svelte-12q53fs" data-smrt-part="status" role="group" aria-label="Theme change"><!></div>`),Jt=c(`<p class="smrt-browser-assistant__offer-note svelte-12q53fs" data-smrt-part="status" role="status">Theme restored.</p>`),Yt=c(`<!> <!> <!>`,1),Xt=c(`<li><b> </b> </li>`),Zt=c(`<ul class="smrt-browser-assistant__offer-menu svelte-12q53fs" data-smrt-part="list"></ul>`),Qt=c(`<small class="svelte-12q53fs">Replaces your recipes, menu and sample records.</small>`),$t=c(`<div class="smrt-browser-assistant__offer svelte-12q53fs" data-smrt-part="status" role="group"><div class="smrt-browser-assistant__offer-text svelte-12q53fs" data-smrt-part="description"><strong> </strong> <span class="svelte-12q53fs"> </span> <!></div> <!> <!> <!></div>`),en=c(`<p class="smrt-browser-assistant__offer-note svelte-12q53fs" data-smrt-part="status" role="status"> </p>`),tn=c(`<p class="smrt-browser-assistant__offer-note svelte-12q53fs" data-smrt-part="error" role="alert"> </p>`),nn=c(`<div class="smrt-browser-assistant__panel svelte-12q53fs" data-smrt-part="panel" role="status"><h2 class="svelte-12q53fs">Assistant unavailable</h2> <p class="svelte-12q53fs">The assistant runs a small model on your graphics card using WebGPU, and
4
4
  this browser does not offer it. Try a recent Chrome, Edge or Safari on a
@@ -1 +1 @@
1
- import{Dt as e,G as t,H as n,Ot as r,U as i,ht as a,mt as o,pt as s,st as c}from"../chunks/DG3qFFTE.js";import"../chunks/xihTtKlq.js";import{t as l}from"../chunks/CNBdo__C.js";var u=t(`<h1> </h1> <p> </p>`,1);function d(t,d){r(d,!0);var f=u(),p=s(f),m=o(p,!0),h=a(p,2),g=o(h,!0);c(()=>{n(m,l.status),n(g,l.error?.message)}),i(t,f),e()}export{d as component};
1
+ import{Dt as e,G as t,H as n,Ot as r,U as i,ht as a,mt as o,pt as s,st as c}from"../chunks/DG3qFFTE.js";import"../chunks/xihTtKlq.js";import{t as l}from"../chunks/k3Hz_f-J.js";var u=t(`<h1> </h1> <p> </p>`,1);function d(t,d){r(d,!0);var f=u(),p=s(f),m=o(p,!0),h=a(p,2),g=o(h,!0);c(()=>{n(m,l.status),n(g,l.error?.message)}),i(t,f),e()}export{d as component};
@@ -1,3 +1,3 @@
1
- import{$ as e,A as t,B as n,Ct as r,Dt as i,E as a,Ft as o,G as s,H as c,J as l,L as u,M as ee,Ot as d,Pt as f,U as p,X as m,Y as h,_ as g,at as _,bt as v,ft as y,ht as b,mt as x,p as S,pt as C,st as w,ut as T,v as E,vt as D}from"../chunks/DG3qFFTE.js";import"../chunks/xihTtKlq.js";import{Ct as O,_t as k,a as A,p as j,t as M,vt as N,wt as P}from"../chunks/IVfnZdeW.js";import{p as te}from"../chunks/DmfvgI_r.js";import{i as F}from"../chunks/B18A9OMt.js";import{t as ne}from"../chunks/DPl_ov_p.js";var I=s(`<p class="svelte-disfw2">Nothing selected yet. Choose a package below.</p>`),L=s(`<li><a class="svelte-disfw2"> </a></li>`),R=s(`<ul class="smrt-packages-page__chips svelte-disfw2" data-smrt-part="list"></ul> <button type="button" class="smrt-packages-page__secondary svelte-disfw2" data-smrt-part="action">Clear selection</button>`,1),z=s(`<p class="smrt-packages-page__meta svelte-disfw2" data-smrt-part="meta"> </p>`),re=s(`<li data-smrt-part="item"><h3 class="svelte-disfw2"><a> </a></h3> <p class="smrt-packages-page__description svelte-disfw2" data-smrt-part="description"> </p> <p class="smrt-packages-page__meta svelte-disfw2" data-smrt-part="meta"><!></p> <!> <!></li>`),ie=s(`<li class="smrt-packages-page__none svelte-disfw2" data-smrt-part="empty"> </li>`),ae=s(`<main class="svelte-disfw2"><header class="svelte-disfw2"><p class="smrt-packages-page__meta svelte-disfw2" data-smrt-part="meta"><a>Planner</a> / All packages</p> <h1 class="svelte-disfw2">All packages</h1> <p class="svelte-disfw2">The whole catalog, a package at a time. Recipes on the Planner page are
1
+ import{$ as e,A as t,B as n,Ct as r,Dt as i,E as a,Ft as o,G as s,H as c,J as l,L as u,M as ee,Ot as d,Pt as f,U as p,X as m,Y as h,_ as g,at as _,bt as v,ft as y,ht as b,mt as x,p as S,pt as C,st as w,ut as T,v as E,vt as D}from"../chunks/DG3qFFTE.js";import"../chunks/xihTtKlq.js";import{Ct as O,_t as k,a as A,p as j,t as M,vt as N,wt as P}from"../chunks/B1N9X4sc.js";import{p as te}from"../chunks/DmfvgI_r.js";import{i as F}from"../chunks/B18A9OMt.js";import{t as ne}from"../chunks/C3sAQYIE.js";var I=s(`<p class="svelte-disfw2">Nothing selected yet. Choose a package below.</p>`),L=s(`<li><a class="svelte-disfw2"> </a></li>`),R=s(`<ul class="smrt-packages-page__chips svelte-disfw2" data-smrt-part="list"></ul> <button type="button" class="smrt-packages-page__secondary svelte-disfw2" data-smrt-part="action">Clear selection</button>`,1),z=s(`<p class="smrt-packages-page__meta svelte-disfw2" data-smrt-part="meta"> </p>`),re=s(`<li data-smrt-part="item"><h3 class="svelte-disfw2"><a> </a></h3> <p class="smrt-packages-page__description svelte-disfw2" data-smrt-part="description"> </p> <p class="smrt-packages-page__meta svelte-disfw2" data-smrt-part="meta"><!></p> <!> <!></li>`),ie=s(`<li class="smrt-packages-page__none svelte-disfw2" data-smrt-part="empty"> </li>`),ae=s(`<main class="svelte-disfw2"><header class="svelte-disfw2"><p class="smrt-packages-page__meta svelte-disfw2" data-smrt-part="meta"><a>Planner</a> / All packages</p> <h1 class="svelte-disfw2">All packages</h1> <p class="svelte-disfw2">The whole catalog, a package at a time. Recipes on the Planner page are
2
2
  the smaller way in: they add one section of an app, not every model in a
3
3
  package. Your picks live in the URL, so you can share the mock-up.</p></header> <section aria-label="Your selection" class="smrt-packages-page__selection svelte-disfw2" data-smrt-part="summary"><h2 class="svelte-disfw2">Your app</h2> <!> <p class="smrt-packages-page__notice svelte-disfw2" role="status" aria-live="polite" data-smrt-part="status"> </p></section> <section aria-label="Package catalog"><h2 class="svelte-disfw2">Packages <small class="svelte-disfw2"> </small></h2> <label class="smrt-packages-page__search svelte-disfw2" data-smrt-part="search"><span class="smrt-packages-page__visually-hidden svelte-disfw2" data-smrt-part="label">Search packages</span> <input type="search" placeholder="Search packages, models and fields" class="svelte-disfw2"/></label> <ul class="smrt-packages-page__cards svelte-disfw2" data-smrt-part="list"></ul></section></main>`);function B(s,h){d(h,!0);let B=v(``),V=v(``),H=r(()=>O(k.packages,e(B)));function oe(e){let t=new Set(A.ids),n=t.has(e);A.toggle(e);let r=A.ids.filter(n=>!t.has(n)&&n!==e);D(V,n?`Removed ${j(e)}.`:r.length?`Added ${j(e)} and the packages it needs: ${r.map(j).join(`, `)}.`:`Added ${j(e)}.`,!0)}var U=ae();t(`disfw2`,e=>{_(()=>{T.title=`All packages · smrt planner`})});var W=y(U),G=y(W),K=y(G);f(),o(G),f(4),o(W);var q=b(W,2),J=b(y(q),2),se=e=>{var t=I();p(e,t)},ce=e=>{var t=R(),n=C(t);u(n,20,()=>A.ids,e=>e,(e,t)=>{var n=L(),r=y(n),i=x(r,!0);o(n),w((e,t)=>{E(r,`href`,e),c(i,t)},[()=>M(`/packages/${t}/`),()=>j(t)]),p(e,n)}),o(n);var r=b(n,2);m(`click`,r,()=>A.clear()),p(e,t)};n(J,e=>{A.ids.length===0?e(se):e(ce,-1)});var le=b(J,2),ue=x(le,!0);o(q);var Y=b(q,2),X=y(Y),de=b(y(X)),fe=x(de);o(X);var Z=b(X,2),Q=b(y(Z),2);g(Q),o(Z);var $=b(Z,2);u($,29,()=>e(H),e=>e.id,(t,i)=>{let s=r(()=>A.has(e(i).id)),u=r(()=>A.requiredBy(e(i).id));var d=re();let f;var m=y(d),h=y(m),g=x(h,!0);o(m);var _=b(m,2),v=x(_,!0),S=b(_,2),C=y(S),T=t=>{var n=l();w((e,t)=>c(n,`${e??``} models · ${t??``} generated surfaces`),[()=>N(e(i)).length,()=>P(e(i))]),p(t,n)},D=r(()=>N(e(i)).length),O=t=>{var n=l();w(()=>c(n,`${e(i).models.length??``} internal models · closed: no generated surfaces`)),p(t,n)};n(C,t=>{e(D)?t(T):t(O,-1)}),o(S);var k=b(S,2),I=t=>{var n=z(),r=x(n);w(e=>c(r,`Needs: ${e??``}`),[()=>e(i).dependencies.map(j).join(`, `)]),p(t,n)};n(k,t=>{e(i).dependencies.length&&t(I)});var L=b(k,2);{let t=r(()=>e(s)&&e(u).length>0),n=r(()=>`Include ${j(e(i).id)} in my app`),a=r(()=>e(s)&&e(u).length>0?`In your app (needed by ${e(u).map(j).join(`, `)})`:e(s)?`In your app`:`Add to my app`);F(L,{get checked(){return e(s)},get disabled(){return e(t)},onchange:()=>oe(e(i).id),get"aria-label"(){return e(n)},get label(){return e(a)}})}o(d),w((t,n)=>{f=a(d,1,`svelte-disfw2`,null,f,{"smrt-packages-page__selected":e(s)}),E(h,`href`,t),c(g,n),c(v,e(i).description)},[()=>M(`/packages/${e(i).id}/`),()=>j(e(i).id)]),ee(d,()=>te,()=>({duration:ne(`medium2`,300)})),p(t,d)},t=>{var n=ie(),r=x(n);w(()=>c(r,`No packages match "${e(B)??``}".`)),p(t,n)}),o($),o(Y),o(U),w(t=>{E(K,`href`,t),c(ue,e(V)),c(fe,`${e(H).length??``} of ${k.packages.length??``}`)},[()=>M(`/`)]),S(Q,()=>e(B),e=>D(B,e)),p(s,U),i()}h([`click`]);export{B as component};
@@ -1 +1 @@
1
- import{n as e}from"../chunks/COiEfhsA.js";import{$ as t,A as n,B as r,Ct as i,Dt as a,Ft as o,G as s,H as c,J as l,L as u,Ot as d,U as f,W as p,ft as m,ht as h,it as g,mt as _,pt as v,st as y,ut as b,v as x}from"../chunks/DG3qFFTE.js";import"../chunks/xihTtKlq.js";import{_t as S,p as C,t as w,vt as T,xt as E}from"../chunks/IVfnZdeW.js";import{t as D}from"../chunks/DRByVC-c.js";import{t as O}from"../chunks/Dnf-fyR5.js";var k=e({entries:()=>A,load:()=>j}),A=()=>S.packages.map(e=>({id:e.id})),j=({params:e})=>(E(e.id)||D(404,`Unknown package ${e.id}`),{id:e.id}),M=s(`<!><a> </a>`,1),N=s(`<p class="smrt-package-page__meta svelte-1md22of" data-smrt-part="meta">Needs: <!></p>`),P=s(`<li><a> </a> <span class="smrt-package-page__meta svelte-1md22of" data-smrt-part="meta"> </span></li>`),F=s(`<main data-smrt-component="PackagePage" class="svelte-1md22of"><header class="svelte-1md22of"><h1 class="svelte-1md22of"> </h1> <p class="smrt-package-page__meta svelte-1md22of" data-smrt-part="meta"><code> </code></p> <p class="svelte-1md22of"> </p> <!></header> <section class="svelte-1md22of"><h2 class="svelte-1md22of">Models</h2> <ul class="svelte-1md22of"></ul></section> <!></main>`),I=s(`<a>Back to the Planner</a>`),L=s(`<main data-smrt-component="PackagePage" class="svelte-1md22of"><h1 class="svelte-1md22of">Unknown package</h1> <p class="svelte-1md22of">No package is called <code> </code>.<!></p></main>`);function R(e,n){d(n,!0);let s=i(()=>E(n.id));var g=p(),b=v(g),S=e=>{var n=F(),i=m(n),a=m(i),d=_(a,!0),p=h(a,2),g=m(p),b=_(g);o(p);var S=h(p,2),E=_(S,!0),D=h(S,2),k=e=>{var n=N(),i=h(m(n));u(i,18,()=>t(s).dependencies,e=>e,(e,n,i)=>{var a=M(),o=v(a),s=e=>{var t=l(`,`);f(e,t)};r(o,e=>{t(i)>0&&e(s)});var u=h(o),d=_(u,!0);y((e,t)=>{x(u,`href`,e),c(d,t)},[()=>w(`/packages/${n}/`),()=>C(n)]),f(e,a)}),o(n),f(e,n)};r(D,e=>{t(s).dependencies.length&&e(k)}),o(i);var A=h(i,2),j=h(m(A),2);u(j,21,()=>T(t(s)),e=>e.id,(e,n)=>{var r=P(),i=m(r),a=_(i,!0),l=h(i,2),u=_(l);o(r),y((e,r)=>{x(i,`href`,e),c(a,t(n).name),c(u,`${r??``} fields`)},[()=>w(`/m/${t(s).id}/${t(n).name}/`),()=>t(n).fields.filter(e=>!e.system).length]),f(e,r)}),o(j),o(A);var I=h(A,2);O(I,{get models(){return t(s).models}}),o(n),y(e=>{c(d,e),c(b,`${t(s).packageName??``}@${t(s).version??``}`),c(E,t(s).description)},[()=>C(t(s).id)]),f(e,n)},D=e=>{var t=L(),i=h(m(t),2),a=h(m(i)),s=_(a,!0),l=h(a,2),u=e=>{var t=I();y(()=>x(t,`href`,n.backHref)),f(e,t)};r(l,e=>{n.backHref&&e(u)}),o(i),o(t),y(()=>c(s,n.id)),f(e,t)};r(b,e=>{t(s)?e(S):e(D,-1)}),f(e,g),a()}function z(e,t){d(t,!0),n(`88mplm`,e=>{g(e=>{b.title=`${e??``} · smrt planner`},[()=>C(t.data.id)])}),R(e,{get id(){return t.data.id}}),a()}export{z as component,k as universal};
1
+ import{n as e}from"../chunks/COiEfhsA.js";import{$ as t,A as n,B as r,Ct as i,Dt as a,Ft as o,G as s,H as c,J as l,L as u,Ot as d,U as f,W as p,ft as m,ht as h,it as g,mt as _,pt as v,st as y,ut as b,v as x}from"../chunks/DG3qFFTE.js";import"../chunks/xihTtKlq.js";import{_t as S,p as C,t as w,vt as T,xt as E}from"../chunks/B1N9X4sc.js";import{t as D}from"../chunks/DRByVC-c.js";import{t as O}from"../chunks/gTD3HoIw.js";var k=e({entries:()=>A,load:()=>j}),A=()=>S.packages.map(e=>({id:e.id})),j=({params:e})=>(E(e.id)||D(404,`Unknown package ${e.id}`),{id:e.id}),M=s(`<!><a> </a>`,1),N=s(`<p class="smrt-package-page__meta svelte-1md22of" data-smrt-part="meta">Needs: <!></p>`),P=s(`<li><a> </a> <span class="smrt-package-page__meta svelte-1md22of" data-smrt-part="meta"> </span></li>`),F=s(`<main data-smrt-component="PackagePage" class="svelte-1md22of"><header class="svelte-1md22of"><h1 class="svelte-1md22of"> </h1> <p class="smrt-package-page__meta svelte-1md22of" data-smrt-part="meta"><code> </code></p> <p class="svelte-1md22of"> </p> <!></header> <section class="svelte-1md22of"><h2 class="svelte-1md22of">Models</h2> <ul class="svelte-1md22of"></ul></section> <!></main>`),I=s(`<a>Back to the Planner</a>`),L=s(`<main data-smrt-component="PackagePage" class="svelte-1md22of"><h1 class="svelte-1md22of">Unknown package</h1> <p class="svelte-1md22of">No package is called <code> </code>.<!></p></main>`);function R(e,n){d(n,!0);let s=i(()=>E(n.id));var g=p(),b=v(g),S=e=>{var n=F(),i=m(n),a=m(i),d=_(a,!0),p=h(a,2),g=m(p),b=_(g);o(p);var S=h(p,2),E=_(S,!0),D=h(S,2),k=e=>{var n=N(),i=h(m(n));u(i,18,()=>t(s).dependencies,e=>e,(e,n,i)=>{var a=M(),o=v(a),s=e=>{var t=l(`,`);f(e,t)};r(o,e=>{t(i)>0&&e(s)});var u=h(o),d=_(u,!0);y((e,t)=>{x(u,`href`,e),c(d,t)},[()=>w(`/packages/${n}/`),()=>C(n)]),f(e,a)}),o(n),f(e,n)};r(D,e=>{t(s).dependencies.length&&e(k)}),o(i);var A=h(i,2),j=h(m(A),2);u(j,21,()=>T(t(s)),e=>e.id,(e,n)=>{var r=P(),i=m(r),a=_(i,!0),l=h(i,2),u=_(l);o(r),y((e,r)=>{x(i,`href`,e),c(a,t(n).name),c(u,`${r??``} fields`)},[()=>w(`/m/${t(s).id}/${t(n).name}/`),()=>t(n).fields.filter(e=>!e.system).length]),f(e,r)}),o(j),o(A);var I=h(A,2);O(I,{get models(){return t(s).models}}),o(n),y(e=>{c(d,e),c(b,`${t(s).packageName??``}@${t(s).version??``}`),c(E,t(s).description)},[()=>C(t(s).id)]),f(e,n)},D=e=>{var t=L(),i=h(m(t),2),a=h(m(i)),s=_(a,!0),l=h(a,2),u=e=>{var t=I();y(()=>x(t,`href`,n.backHref)),f(e,t)};r(l,e=>{n.backHref&&e(u)}),o(i),o(t),y(()=>c(s,n.id)),f(e,t)};r(b,e=>{t(s)?e(S):e(D,-1)}),f(e,g),a()}function z(e,t){d(t,!0),n(`88mplm`,e=>{g(e=>{b.title=`${e??``} · smrt planner`},[()=>C(t.data.id)])}),R(e,{get id(){return t.data.id}}),a()}export{z as component,k as universal};