@happyvertical/smrt-planner 0.57.17 → 0.57.18

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 (485) hide show
  1. package/app/404.html +18 -18
  2. package/app/_app/immutable/chunks/{xfjCb9hA.js → 3YcXW6yo.js} +1 -1
  3. package/app/_app/immutable/chunks/{BPtTI21R.js → B094Upwj.js} +1 -1
  4. package/app/_app/immutable/chunks/{DdiQBZrC.js → B5cHPql0.js} +1 -1
  5. package/app/_app/immutable/chunks/{BF1b-PyI.js → B6l3em0z.js} +1 -1
  6. package/app/_app/immutable/chunks/{Cp6EyiHL.js → BKaViC3K.js} +1 -1
  7. package/app/_app/immutable/chunks/{JHAQM1Si.js → BMzaHFhM.js} +1 -1
  8. package/app/_app/immutable/chunks/{eI3Mmq4z.js → BSd70kcz.js} +1 -1
  9. package/app/_app/immutable/chunks/{jGR6M6GD.js → BkH1cevg.js} +1 -1
  10. package/app/_app/immutable/chunks/{DtyQVtuI.js → BqoDi2ah.js} +21 -21
  11. package/app/_app/immutable/chunks/{H-AOqvBm.js → C3_MyZ8U.js} +1 -1
  12. package/app/_app/immutable/chunks/{CHp1-Djt.js → CEnFvaV_.js} +1 -1
  13. package/app/_app/immutable/chunks/{47rG5f1n.js → CR7v6iSc.js} +1 -1
  14. package/app/_app/immutable/chunks/{LqlI_3J_.js → CRAFzMd4.js} +3 -3
  15. package/app/_app/immutable/chunks/{DiDXEaeE.js → CYV1bZYS.js} +2 -2
  16. package/app/_app/immutable/chunks/{BkEeNbLN.js → CckqctPA.js} +1 -1
  17. package/app/_app/immutable/chunks/{pwK8zqRY.js → CguB2Z-c.js} +1 -1
  18. package/app/_app/immutable/chunks/CmzwyvUc.js +1 -0
  19. package/app/_app/immutable/chunks/{BEQ1toJ7.js → Cwt6a32V.js} +1 -1
  20. package/app/_app/immutable/chunks/{Dij7Mzy3.js → D18ccNbM.js} +1 -1
  21. package/app/_app/immutable/chunks/{BRb3XNWx.js → D4ZXuDn5.js} +1 -1
  22. package/app/_app/immutable/chunks/{CMr90D2v.js → D4xI8dt4.js} +1 -1
  23. package/app/_app/immutable/chunks/{BXYF4p6C.js → DNKv-5Rn.js} +1 -1
  24. package/app/_app/immutable/chunks/DdwZKwdT.js +1 -0
  25. package/app/_app/immutable/chunks/Do3aLnHk.js +1 -0
  26. package/app/_app/immutable/chunks/{ca0lfv12.js → WxmttVik.js} +1 -1
  27. package/app/_app/immutable/chunks/{DkYxX008.js → cgG95It7.js} +1 -1
  28. package/app/_app/immutable/chunks/{Dbk0PTBM.js → masgq8Qh.js} +1 -1
  29. package/app/_app/immutable/chunks/{cGI232sj.js → qBSxbVXE.js} +1 -1
  30. package/app/_app/immutable/chunks/{CWmRZDhs.js → yoo-DzHO.js} +1 -1
  31. package/app/_app/immutable/entry/{app.DBMyUqvv.js → app.Bfo_XQ_u.js} +2 -2
  32. package/app/_app/immutable/entry/start.COZRMvoH.js +1 -0
  33. package/app/_app/immutable/nodes/{0.DiMcia2m.js → 0.CpAyxFG1.js} +1 -1
  34. package/app/_app/immutable/nodes/{1.D-mIIzUL.js → 1.BIIgo6hP.js} +1 -1
  35. package/app/_app/immutable/nodes/{10.BFt6ON7M.js → 10.p-z5jbqI.js} +1 -1
  36. package/app/_app/immutable/nodes/{11.Cxs1R6fC.js → 11.DikmsDwP.js} +1 -1
  37. package/app/_app/immutable/nodes/{12.BCudMLPz.js → 12.OJHha47l.js} +1 -1
  38. package/app/_app/immutable/nodes/{13.DAt_b1gK.js → 13.B5uFEHhN.js} +1 -1
  39. package/app/_app/immutable/nodes/{14.CQQuhb60.js → 14.DSqhro7V.js} +1 -1
  40. package/app/_app/immutable/nodes/{2.U2UZdfCQ.js → 2.BsxeuTRf.js} +3 -3
  41. package/app/_app/immutable/nodes/{3.BNTsN4bw.js → 3.4GrrsC59.js} +1 -1
  42. package/app/_app/immutable/nodes/{4.eKv786mR.js → 4.CyWWMczB.js} +1 -1
  43. package/app/_app/immutable/nodes/{5.k0okSbWb.js → 5.B3AevRqW.js} +1 -1
  44. package/app/_app/immutable/nodes/{6.RSsmFdBk.js → 6.DOjCozUO.js} +1 -1
  45. package/app/_app/immutable/nodes/{7.BZAahN28.js → 7.BVKnH6b6.js} +1 -1
  46. package/app/_app/immutable/nodes/{8.B9PW4VE1.js → 8.wnGurkrO.js} +1 -1
  47. package/app/_app/immutable/nodes/{9.DYbPqDvx.js → 9.PyL2mnd3.js} +1 -1
  48. package/app/_app/version.json +1 -1
  49. package/app/advanced-styles/index.html +21 -21
  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/Agreement/index.html +23 -23
  82. package/app/m/commerce/Cart/index.html +23 -23
  83. package/app/m/commerce/Contract/index.html +23 -23
  84. package/app/m/commerce/ContractLineItem/index.html +23 -23
  85. package/app/m/commerce/Customer/index.html +23 -23
  86. package/app/m/commerce/DocumentTax/index.html +23 -23
  87. package/app/m/commerce/Estimate/index.html +23 -23
  88. package/app/m/commerce/Fulfillment/index.html +23 -23
  89. package/app/m/commerce/FulfillmentLineItem/index.html +23 -23
  90. package/app/m/commerce/HistoricalCustomerFunds/index.html +23 -23
  91. package/app/m/commerce/HistoricalCustomerFundsAllocation/index.html +23 -23
  92. package/app/m/commerce/HistoricalSalesLine/index.html +23 -23
  93. package/app/m/commerce/Invoice/index.html +23 -23
  94. package/app/m/commerce/InvoiceLineItem/index.html +23 -23
  95. package/app/m/commerce/Lease/index.html +23 -23
  96. package/app/m/commerce/LicenseSale/index.html +23 -23
  97. package/app/m/commerce/Order/index.html +23 -23
  98. package/app/m/commerce/Payment/index.html +23 -23
  99. package/app/m/commerce/PaymentAllocation/index.html +23 -23
  100. package/app/m/commerce/PaymentInstrument/index.html +23 -23
  101. package/app/m/commerce/PaymentIntent/index.html +23 -23
  102. package/app/m/commerce/Payout/index.html +23 -23
  103. package/app/m/commerce/ProductionOrder/index.html +23 -23
  104. package/app/m/commerce/PurchaseContract/index.html +23 -23
  105. package/app/m/commerce/PurchaseOrder/index.html +23 -23
  106. package/app/m/commerce/SalesContract/index.html +23 -23
  107. package/app/m/commerce/SupplierQuote/index.html +23 -23
  108. package/app/m/commerce/TaxCode/index.html +23 -23
  109. package/app/m/commerce/TaxComponent/index.html +23 -23
  110. package/app/m/commerce/TaxSettings/index.html +23 -23
  111. package/app/m/commerce/TaxSummaryReport/index.html +23 -23
  112. package/app/m/commerce/TenantPaymentAccount/index.html +23 -23
  113. package/app/m/commerce/Vendor/index.html +23 -23
  114. package/app/m/commerce/WholesaleOrder/index.html +23 -23
  115. package/app/m/content/Content/index.html +23 -23
  116. package/app/m/content/ContentContribution/index.html +23 -23
  117. package/app/m/content/ContentContributionAttachment/index.html +23 -23
  118. package/app/m/content/ContentContributionRevision/index.html +23 -23
  119. package/app/m/content/ContentContributionType/index.html +23 -23
  120. package/app/m/content/ContentContributor/index.html +23 -23
  121. package/app/m/content/ContentCorrection/index.html +23 -23
  122. package/app/m/content/ContentFeedSource/index.html +23 -23
  123. package/app/m/content/ContentGovernanceAssignment/index.html +23 -23
  124. package/app/m/content/ContentGovernancePolicy/index.html +23 -23
  125. package/app/m/content/ContentGovernanceProfile/index.html +23 -23
  126. package/app/m/content/ContentReference/index.html +23 -23
  127. package/app/m/content/ContentReview/index.html +23 -23
  128. package/app/m/content/ContentVersion/index.html +23 -23
  129. package/app/m/events/Event/index.html +23 -23
  130. package/app/m/events/EventParticipant/index.html +23 -23
  131. package/app/m/events/EventSeries/index.html +23 -23
  132. package/app/m/events/EventType/index.html +23 -23
  133. package/app/m/expenses/Expense/index.html +23 -23
  134. package/app/m/facts/Fact/index.html +23 -23
  135. package/app/m/facts/FactContent/index.html +23 -23
  136. package/app/m/facts/FactEvidence/index.html +23 -23
  137. package/app/m/facts/FactSource/index.html +23 -23
  138. package/app/m/facts/FactSubject/index.html +23 -23
  139. package/app/m/facts/FactTag/index.html +23 -23
  140. package/app/m/fields/FieldPolicy/index.html +23 -23
  141. package/app/m/fields/FieldPolicySuggestion/index.html +23 -23
  142. package/app/m/fields/FieldUsageCounter/index.html +23 -23
  143. package/app/m/images/Image/index.html +23 -23
  144. package/app/m/inventory/InventoryLocation/index.html +23 -23
  145. package/app/m/inventory/Lot/index.html +88 -0
  146. package/app/m/inventory/LotCorrection/index.html +88 -0
  147. package/app/m/inventory/LotDocument/index.html +88 -0
  148. package/app/m/inventory/LotStockLevel/index.html +88 -0
  149. package/app/m/inventory/LotUsage/index.html +88 -0
  150. package/app/m/inventory/StockLevel/index.html +23 -23
  151. package/app/m/inventory/StockMovement/index.html +23 -23
  152. package/app/m/ledgers/Account/index.html +23 -23
  153. package/app/m/ledgers/Journal/index.html +23 -23
  154. package/app/m/ledgers/JournalEntry/index.html +23 -23
  155. package/app/m/ledgers/Ledger/index.html +23 -23
  156. package/app/m/manufacturing/Assembly/index.html +23 -23
  157. package/app/m/manufacturing/BillOfMaterials/index.html +23 -23
  158. package/app/m/manufacturing/BomLine/index.html +23 -23
  159. package/app/m/manufacturing/Operation/index.html +23 -23
  160. package/app/m/manufacturing/ProductionRun/index.html +23 -23
  161. package/app/m/manufacturing/ProductionRunCompletion/index.html +23 -23
  162. package/app/m/manufacturing/RoutingStep/index.html +23 -23
  163. package/app/m/marketing/Campaign/index.html +23 -23
  164. package/app/m/marketing/CampaignChannel/index.html +23 -23
  165. package/app/m/marketing/CampaignMetricSnapshot/index.html +23 -23
  166. package/app/m/messages/Account/index.html +23 -23
  167. package/app/m/messages/Attachment/index.html +23 -23
  168. package/app/m/messages/Blacklist/index.html +23 -23
  169. package/app/m/messages/Email/failed-sends/index.html +24 -24
  170. package/app/m/messages/Email/index.html +23 -23
  171. package/app/m/messages/Email/mailbox/index.html +24 -24
  172. package/app/m/messages/EmailAccount/index.html +23 -23
  173. package/app/m/messages/EmailAttachment/index.html +23 -23
  174. package/app/m/messages/EmailFolder/index.html +23 -23
  175. package/app/m/messages/Message/index.html +23 -23
  176. package/app/m/messages/MessagingEndpoint/index.html +23 -23
  177. package/app/m/messages/PersonaMessageRoute/index.html +23 -23
  178. package/app/m/messages/SlackAccount/index.html +23 -23
  179. package/app/m/messages/SlackMessage/index.html +23 -23
  180. package/app/m/messages/TelegramAccount/index.html +23 -23
  181. package/app/m/messages/Tweet/index.html +23 -23
  182. package/app/m/messages/TwitterAccount/index.html +23 -23
  183. package/app/m/messages/Whitelist/index.html +23 -23
  184. package/app/m/messages/ZulipAccount/index.html +23 -23
  185. package/app/m/places/Place/index.html +23 -23
  186. package/app/m/places/PlaceType/index.html +23 -23
  187. package/app/m/products/Category/index.html +23 -23
  188. package/app/m/products/Material/index.html +23 -23
  189. package/app/m/products/Product/index.html +23 -23
  190. package/app/m/products/Product/ingredients/index.html +24 -24
  191. package/app/m/products/ProductVariant/index.html +23 -23
  192. package/app/m/products/Sku/index.html +23 -23
  193. package/app/m/profiles/ApiKey/index.html +23 -23
  194. package/app/m/profiles/Bot/index.html +23 -23
  195. package/app/m/profiles/MagicLinkToken/index.html +23 -23
  196. package/app/m/profiles/NostrIdentity/index.html +23 -23
  197. package/app/m/profiles/OidcIdentity/index.html +23 -23
  198. package/app/m/profiles/Organization/index.html +23 -23
  199. package/app/m/profiles/Person/index.html +23 -23
  200. package/app/m/profiles/Profile/index.html +23 -23
  201. package/app/m/profiles/ProfileMetadata/index.html +23 -23
  202. package/app/m/profiles/ProfileMetafield/index.html +23 -23
  203. package/app/m/profiles/ProfileRelationship/index.html +23 -23
  204. package/app/m/profiles/ProfileRelationshipTerm/index.html +23 -23
  205. package/app/m/profiles/ProfileRelationshipType/index.html +23 -23
  206. package/app/m/profiles/ProfileType/index.html +23 -23
  207. package/app/m/projects/Comment/index.html +23 -23
  208. package/app/m/projects/Issue/index.html +23 -23
  209. package/app/m/projects/Label/index.html +23 -23
  210. package/app/m/projects/Project/index.html +23 -23
  211. package/app/m/projects/ProjectIntegration/index.html +23 -23
  212. package/app/m/projects/PullRequest/index.html +23 -23
  213. package/app/m/projects/Repository/index.html +23 -23
  214. package/app/m/properties/Property/index.html +23 -23
  215. package/app/m/properties/Zone/index.html +23 -23
  216. package/app/m/reports/RuntimeReport/index.html +23 -23
  217. package/app/m/reports/SmrtPrincipalReportRefreshTask/index.html +23 -23
  218. package/app/m/reports/SmrtReportLock/index.html +23 -23
  219. package/app/m/reports/SmrtReportRefreshTask/index.html +23 -23
  220. package/app/m/reports/SmrtReportRun/index.html +23 -23
  221. package/app/m/reports/SmrtReportSchedule/index.html +23 -23
  222. package/app/m/reports/SmrtReportWatermark/index.html +23 -23
  223. package/app/m/sales/Agreement/index.html +23 -23
  224. package/app/m/sales/AttributionException/index.html +23 -23
  225. package/app/m/sales/AttributionPolicy/index.html +23 -23
  226. package/app/m/sales/Commission/index.html +23 -23
  227. package/app/m/sales/CommissionAdjustment/index.html +23 -23
  228. package/app/m/sales/CommissionPayout/index.html +23 -23
  229. package/app/m/sales/CommissionPlan/index.html +23 -23
  230. package/app/m/sales/Earner/index.html +23 -23
  231. package/app/m/sales/EarnerSourceAttribution/index.html +23 -23
  232. package/app/m/sales/EarningEvent/index.html +23 -23
  233. package/app/m/sales/ExecutedAgreement/index.html +23 -23
  234. package/app/m/sales/Lead/index.html +23 -23
  235. package/app/m/sales/Opportunity/index.html +23 -23
  236. package/app/m/sales/OpportunityConversion/index.html +23 -23
  237. package/app/m/sales/PipelineDefinition/index.html +23 -23
  238. package/app/m/sales/PipelineStage/index.html +23 -23
  239. package/app/m/sales/Referral/index.html +23 -23
  240. package/app/m/sales/ReferralAgreement/index.html +23 -23
  241. package/app/m/sales/ReferralLink/index.html +23 -23
  242. package/app/m/sales/ReferralProgram/index.html +23 -23
  243. package/app/m/sales/ReferralTermSnapshot/index.html +23 -23
  244. package/app/m/sales/ReferralTouch/index.html +23 -23
  245. package/app/m/sales/Referrer/index.html +23 -23
  246. package/app/m/sales/SalesActivity/index.html +23 -23
  247. package/app/m/sales/SalesRepresentative/index.html +23 -23
  248. package/app/m/sites/Site/index.html +23 -23
  249. package/app/m/sites/SiteAgentBinding/index.html +23 -23
  250. package/app/m/social/OAuthState/index.html +23 -23
  251. package/app/m/social/SocialAccount/index.html +23 -23
  252. package/app/m/social/SocialPost/index.html +23 -23
  253. package/app/m/social/SocialPostAnalyticsSnapshot/index.html +23 -23
  254. package/app/m/subscriptions/BillingAdjustment/index.html +23 -23
  255. package/app/m/subscriptions/ClientCharge/index.html +23 -23
  256. package/app/m/subscriptions/CreditGrant/index.html +23 -23
  257. package/app/m/subscriptions/PricingRule/index.html +23 -23
  258. package/app/m/subscriptions/RetailCharge/index.html +23 -23
  259. package/app/m/subscriptions/SpendingPolicy/index.html +23 -23
  260. package/app/m/subscriptions/SubscriptionPlan/index.html +23 -23
  261. package/app/m/subscriptions/SubscriptionPlanVersion/index.html +23 -23
  262. package/app/m/subscriptions/TenantSubscription/index.html +23 -23
  263. package/app/m/subscriptions/TenantUsageMetric/index.html +23 -23
  264. package/app/m/support/ServiceTimeEntry/index.html +23 -23
  265. package/app/m/support/SupportAiRun/index.html +23 -23
  266. package/app/m/support/SupportAvailability/index.html +23 -23
  267. package/app/m/support/SupportCase/index.html +23 -23
  268. package/app/m/support/SupportCaseEvent/index.html +23 -23
  269. package/app/m/support/SupportChannelBinding/index.html +23 -23
  270. package/app/m/support/SupportCharge/index.html +23 -23
  271. package/app/m/support/SupportCompensation/index.html +23 -23
  272. package/app/m/support/SupportCompensationPlan/index.html +23 -23
  273. package/app/m/support/SupportEscalation/index.html +23 -23
  274. package/app/m/support/SupportInteraction/index.html +23 -23
  275. package/app/m/support/SupportPlan/index.html +23 -23
  276. package/app/m/support/SupportPolicy/index.html +23 -23
  277. package/app/m/support/SupportQualification/index.html +23 -23
  278. package/app/m/support/SupportServiceTarget/index.html +23 -23
  279. package/app/m/support/SupportSpecialist/index.html +23 -23
  280. package/app/m/support/SupportWorkLink/index.html +23 -23
  281. package/app/m/tags/Tag/index.html +23 -23
  282. package/app/m/tags/TagAlias/index.html +23 -23
  283. package/app/m/timesheets/AttendanceBreak/index.html +23 -23
  284. package/app/m/timesheets/AttendancePunch/index.html +23 -23
  285. package/app/m/timesheets/AttendanceSegment/index.html +23 -23
  286. package/app/m/timesheets/ServiceChargeSnapshot/index.html +23 -23
  287. package/app/m/timesheets/ServiceCompensationSnapshot/index.html +23 -23
  288. package/app/m/timesheets/ServiceTimeEntry/index.html +23 -23
  289. package/app/m/users/Group/index.html +23 -23
  290. package/app/m/users/GroupMember/index.html +23 -23
  291. package/app/m/users/GroupRole/index.html +23 -23
  292. package/app/m/users/Membership/index.html +23 -23
  293. package/app/m/users/MembershipOverride/index.html +23 -23
  294. package/app/m/users/Permission/index.html +23 -23
  295. package/app/m/users/Role/index.html +23 -23
  296. package/app/m/users/RolePermission/index.html +23 -23
  297. package/app/m/users/Session/index.html +23 -23
  298. package/app/m/users/Tenant/index.html +23 -23
  299. package/app/m/users/TenantIntegration/index.html +23 -23
  300. package/app/m/users/TenantPermissionOverride/index.html +23 -23
  301. package/app/m/users/User/index.html +23 -23
  302. package/app/m/video/Character/index.html +23 -23
  303. package/app/m/video/CharacterAsset/index.html +23 -23
  304. package/app/m/video/CompositeJob/index.html +23 -23
  305. package/app/m/video/Performer/index.html +23 -23
  306. package/app/m/video/PerformerAsset/index.html +23 -23
  307. package/app/m/video/Scene/index.html +23 -23
  308. package/app/m/video/SceneAsset/index.html +23 -23
  309. package/app/m/video/VideoComposition/index.html +23 -23
  310. package/app/m/video/VideoCompositionAsset/index.html +23 -23
  311. package/app/m/video/VideoSequence/index.html +23 -23
  312. package/app/m/video/VideoSequenceAsset/index.html +23 -23
  313. package/app/m/video/VideoShot/index.html +23 -23
  314. package/app/m/video/VideoShotAsset/index.html +23 -23
  315. package/app/m/video/VideoShotCharacter/index.html +23 -23
  316. package/app/m/video/VideoWorkflow/index.html +23 -23
  317. package/app/m/voice/VoiceOutput/index.html +23 -23
  318. package/app/m/voice/VoiceProfile/index.html +23 -23
  319. package/app/m/voice/VoiceSample/index.html +23 -23
  320. package/app/mcp.html +2 -2
  321. package/app/packages/ads/index.html +21 -21
  322. package/app/packages/analytics/index.html +21 -21
  323. package/app/packages/approvals/index.html +21 -21
  324. package/app/packages/assets/index.html +21 -21
  325. package/app/packages/chat/index.html +21 -21
  326. package/app/packages/comments/index.html +21 -21
  327. package/app/packages/commerce/index.html +21 -21
  328. package/app/packages/content/index.html +21 -21
  329. package/app/packages/events/index.html +21 -21
  330. package/app/packages/expenses/index.html +21 -21
  331. package/app/packages/facts/index.html +21 -21
  332. package/app/packages/fields/index.html +21 -21
  333. package/app/packages/human-resources/index.html +21 -21
  334. package/app/packages/images/index.html +21 -21
  335. package/app/packages/index.html +21 -21
  336. package/app/packages/ingestion/index.html +21 -21
  337. package/app/packages/inventory/index.html +22 -22
  338. package/app/packages/ledgers/index.html +21 -21
  339. package/app/packages/manufacturing/index.html +21 -21
  340. package/app/packages/marketing/index.html +21 -21
  341. package/app/packages/messages/index.html +21 -21
  342. package/app/packages/places/index.html +21 -21
  343. package/app/packages/preferences/index.html +21 -21
  344. package/app/packages/products/index.html +21 -21
  345. package/app/packages/profiles/index.html +21 -21
  346. package/app/packages/projects/index.html +21 -21
  347. package/app/packages/properties/index.html +21 -21
  348. package/app/packages/reports/index.html +21 -21
  349. package/app/packages/sales/index.html +21 -21
  350. package/app/packages/sites/index.html +21 -21
  351. package/app/packages/social/index.html +21 -21
  352. package/app/packages/subscriptions/index.html +21 -21
  353. package/app/packages/support/index.html +21 -21
  354. package/app/packages/tags/index.html +21 -21
  355. package/app/packages/timesheets/index.html +21 -21
  356. package/app/packages/users/index.html +22 -22
  357. package/app/packages/video/index.html +21 -21
  358. package/app/packages/voice/index.html +21 -21
  359. package/app/packages/webhooks/index.html +21 -21
  360. package/app/recipes/account-access/help/index.html +22 -22
  361. package/app/recipes/account-access/index.html +23 -23
  362. package/app/recipes/activity/help/index.html +21 -21
  363. package/app/recipes/activity/index.html +23 -23
  364. package/app/recipes/agreements/help/index.html +21 -21
  365. package/app/recipes/agreements/index.html +23 -23
  366. package/app/recipes/analytics.reports/help/index.html +21 -21
  367. package/app/recipes/analytics.reports/index.html +23 -23
  368. package/app/recipes/assets/help/index.html +21 -21
  369. package/app/recipes/assets/index.html +23 -23
  370. package/app/recipes/billing/help/index.html +21 -21
  371. package/app/recipes/billing/index.html +23 -23
  372. package/app/recipes/chat.assistant/help/index.html +21 -21
  373. package/app/recipes/chat.assistant/index.html +23 -23
  374. package/app/recipes/comments/help/index.html +21 -21
  375. package/app/recipes/comments/index.html +23 -23
  376. package/app/recipes/commerce.customers/help/index.html +21 -21
  377. package/app/recipes/commerce.customers/index.html +23 -23
  378. package/app/recipes/commerce.estimates/help/index.html +21 -21
  379. package/app/recipes/commerce.estimates/index.html +23 -23
  380. package/app/recipes/commerce.purchases/help/index.html +21 -21
  381. package/app/recipes/commerce.purchases/index.html +23 -23
  382. package/app/recipes/commerce.sales/help/index.html +21 -21
  383. package/app/recipes/commerce.sales/index.html +23 -23
  384. package/app/recipes/commerce.vendors/help/index.html +21 -21
  385. package/app/recipes/commerce.vendors/index.html +23 -23
  386. package/app/recipes/commerce.wholesale/help/index.html +21 -21
  387. package/app/recipes/commerce.wholesale/index.html +23 -23
  388. package/app/recipes/events.calendar/help/index.html +21 -21
  389. package/app/recipes/events.calendar/index.html +23 -23
  390. package/app/recipes/expenses.tracking/help/index.html +21 -21
  391. package/app/recipes/expenses.tracking/index.html +23 -23
  392. package/app/recipes/fields.form-customization/help/index.html +21 -21
  393. package/app/recipes/fields.form-customization/index.html +23 -23
  394. package/app/recipes/ingestion/help/index.html +21 -21
  395. package/app/recipes/ingestion/index.html +23 -23
  396. package/app/recipes/integrations/help/index.html +21 -21
  397. package/app/recipes/integrations/index.html +23 -23
  398. package/app/recipes/inventory.stock/help/index.html +22 -22
  399. package/app/recipes/inventory.stock/index.html +23 -23
  400. package/app/recipes/ledgers.bookkeeping/help/index.html +21 -21
  401. package/app/recipes/ledgers.bookkeeping/index.html +23 -23
  402. package/app/recipes/messages/help/index.html +21 -21
  403. package/app/recipes/messages/index.html +23 -23
  404. package/app/recipes/products/help/index.html +21 -21
  405. package/app/recipes/products/index.html +23 -23
  406. package/app/recipes/projects.tracker/help/index.html +21 -21
  407. package/app/recipes/projects.tracker/index.html +23 -23
  408. package/app/recipes/reports.materialized/help/index.html +21 -21
  409. package/app/recipes/reports.materialized/index.html +23 -23
  410. package/app/recipes/reports.runtime/help/index.html +21 -21
  411. package/app/recipes/reports.runtime/index.html +23 -23
  412. package/app/recipes/sales.pipeline/help/index.html +21 -21
  413. package/app/recipes/sales.pipeline/index.html +23 -23
  414. package/app/recipes/tags.taxonomy/help/index.html +21 -21
  415. package/app/recipes/tags.taxonomy/index.html +23 -23
  416. package/app/recipes/team-collaboration/help/index.html +21 -21
  417. package/app/recipes/team-collaboration/index.html +23 -23
  418. package/app/recipes/timesheets.time-entries/help/index.html +21 -21
  419. package/app/recipes/timesheets.time-entries/index.html +23 -23
  420. package/app/s/custom-accounts/index.html +19 -19
  421. package/app/s/custom-appointments/index.html +19 -19
  422. package/app/s/custom-billing/index.html +19 -19
  423. package/app/s/custom-bookings/index.html +19 -19
  424. package/app/s/custom-buying/index.html +19 -19
  425. package/app/s/custom-checkout/index.html +19 -19
  426. package/app/s/custom-classes/index.html +19 -19
  427. package/app/s/custom-clients/index.html +19 -19
  428. package/app/s/custom-events/index.html +19 -19
  429. package/app/s/custom-fleet/index.html +19 -19
  430. package/app/s/custom-gigs/index.html +19 -19
  431. package/app/s/custom-giving/index.html +19 -19
  432. package/app/s/custom-instruments/index.html +19 -19
  433. package/app/s/custom-jobs/index.html +19 -19
  434. package/app/s/custom-kitchen/index.html +19 -19
  435. package/app/s/custom-lessons/index.html +19 -19
  436. package/app/s/custom-material/index.html +19 -19
  437. package/app/s/custom-meetings/index.html +19 -19
  438. package/app/s/custom-members/index.html +19 -19
  439. package/app/s/custom-merch/index.html +19 -19
  440. package/app/s/custom-money/index.html +19 -19
  441. package/app/s/custom-paint/index.html +19 -19
  442. package/app/s/custom-parts/index.html +19 -19
  443. package/app/s/custom-rentals/index.html +19 -19
  444. package/app/s/custom-roastery/index.html +19 -19
  445. package/app/s/custom-schedule/index.html +19 -19
  446. package/app/s/custom-shelf/index.html +19 -19
  447. package/app/s/custom-shop/index.html +19 -19
  448. package/app/s/custom-students/index.html +19 -19
  449. package/app/s/custom-wholesale/index.html +19 -19
  450. package/app/s/custom-work/index.html +19 -19
  451. package/app/s/custom-yard/index.html +19 -19
  452. package/app/s/section-access-control/index.html +19 -19
  453. package/app/s/section-account-security/index.html +19 -19
  454. package/app/s/section-accounting/index.html +19 -19
  455. package/app/s/section-activity/index.html +19 -19
  456. package/app/s/section-agreements/index.html +19 -19
  457. package/app/s/section-analytics/index.html +19 -19
  458. package/app/s/section-assets/index.html +19 -19
  459. package/app/s/section-billing/index.html +19 -19
  460. package/app/s/section-calendar/index.html +19 -19
  461. package/app/s/section-catalog/index.html +19 -19
  462. package/app/s/section-chat.assistant/index.html +19 -19
  463. package/app/s/section-comments/index.html +19 -19
  464. package/app/s/section-fields.form-customization/index.html +19 -19
  465. package/app/s/section-ingestion/index.html +19 -19
  466. package/app/s/section-integrations/index.html +19 -19
  467. package/app/s/section-messages/index.html +19 -19
  468. package/app/s/section-more/index.html +19 -19
  469. package/app/s/section-operations/index.html +19 -19
  470. package/app/s/section-projects/index.html +19 -19
  471. package/app/s/section-purchasing/index.html +19 -19
  472. package/app/s/section-reports.materialized/index.html +19 -19
  473. package/app/s/section-reports.runtime/index.html +19 -19
  474. package/app/s/section-sales/index.html +19 -19
  475. package/app/s/section-taxonomy/index.html +19 -19
  476. package/app/s/section-team/index.html +19 -19
  477. package/app/s/section-work/index.html +19 -19
  478. package/dist/catalog/catalog.json +937 -39
  479. package/dist/smrt-version.d.ts +1 -1
  480. package/dist/smrt-version.js +1 -1
  481. package/package.json +54 -54
  482. package/app/_app/immutable/chunks/BDBI1GHG.js +0 -1
  483. package/app/_app/immutable/chunks/BRphH2sp.js +0 -1
  484. package/app/_app/immutable/chunks/Die26Dpp.js +0 -1
  485. package/app/_app/immutable/entry/start.wMO3ZYuE.js +0 -1
@@ -1,4 +1,4 @@
1
- import{$ as e,B as t,Ct as n,D as r,Dt as i,E as a,F as o,Ft as s,G as c,H as l,J as u,K as d,L as f,Lt as p,M as m,Ot as h,P as g,Pt as _,R as v,Rt as y,T as b,U as x,W as S,X as C,Y as w,Z as T,a as E,bt as D,ct as ee,d as O,ft as k,g as A,gt as j,ht as M,j as N,mt as P,n as te,nt as F,pt as I,q as L,st as R,v as z,vt as B,z as ne}from"./DG3qFFTE.js";import"./xihTtKlq.js";import{i as re,o as V,r as H,t as ie}from"./Bv5jGtB8.js";import{a as U,t as ae}from"./YUSKx8_q.js";import{Et as oe,O as se,bt as W,d as G,h as ce,jt as K,kt as le,m as q,wt as J}from"./DtyQVtuI.js";import{n as ue,t as de}from"./DK8Blf1Y.js";import{n as Y,r as fe}from"./By9nPosf.js";import{a as pe,d as me,l as he,m as ge,o as _e,s as X}from"./DIE02RSm.js";import{t as ve}from"./Dij7Mzy3.js";import{b as ye,d as be,l as xe,n as Se,u as Ce}from"./Bs5WxZDd.js";import{$ as we,et as Te}from"./jGR6M6GD.js";var Ee=/^[A-Za-z][A-Za-z0-9]{0,31}$/,De=/^[A-Za-z_][A-Za-z0-9_.-]{0,63}$/,Oe=/^(?:(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*:)?[A-Za-z][A-Za-z0-9_]{0,63}$/,ke=160,Ae=200,je=1e4;function Me(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ne(e,t){let n=new Set;for(let r of t){if(!Ee.test(r.key))throw Error(`widget "${e}": invalid option key "${r.key}"`);if(n.has(r.key))throw Error(`widget "${e}": duplicate option key "${r.key}"`);if(n.add(r.key),r.type===`enum`&&!r.choices?.length)throw Error(`widget "${e}": enum option "${r.key}" needs choices`);if(r.default!==void 0&&r.default!==null&&Fe(r,r.default,void 0).issue)throw Error(`widget "${e}": default of option "${r.key}" is invalid`)}}function Pe(e,t){return{issue:{key:e,code:t}}}function Fe(e,t,n){let{key:r}=e;switch(e.type){case`text`:case`markdown`:{if(typeof t!=`string`)return Pe(r,`invalid_type`);let n=e.maxLength??(e.type===`markdown`?je:Ae);return t.length>n?Pe(r,`too_long`):{value:t}}case`identifier`:return typeof t==`string`?De.test(t)?{value:t}:Pe(r,`invalid_format`):Pe(r,`invalid_type`);case`model`:return typeof t==`string`?t.length>ke||!Oe.test(t)?Pe(r,`invalid_format`):n?.models&&!n.models.includes(t)?Pe(r,`not_allowed`):{value:t}:Pe(r,`invalid_type`);case`enum`:return typeof t==`string`?e.choices?.some(e=>e.value===t)?{value:t}:Pe(r,`not_in_choices`):Pe(r,`invalid_type`);case`boolean`:return typeof t==`boolean`?{value:t}:Pe(r,`invalid_type`);case`integer`:case`number`:return typeof t!=`number`||!Number.isFinite(t)||e.type===`integer`&&!Number.isSafeInteger(t)?Pe(r,`invalid_type`):e.min!==void 0&&t<e.min||e.max!==void 0&&t>e.max?Pe(r,`out_of_range`):{value:t}}}function Ie(e){let t={};for(let n of e)n.default!==void 0&&n.default!==null&&(t[n.key]=n.default);return t}function Le(e,t,n,r){if(e.default!==void 0&&e.default!==null){let i=Fe(e,e.default,t);i.issue?r.push(i.issue):i.value!==void 0&&(n[e.key]=i.value)}else e.required&&r.push({key:e.key,code:`required`})}function Re(e,t,n){let r=[],i=t==null?{}:Me(t)?t:{};if(t!=null&&!Me(t))return r.push({key:``,code:`invalid_type`}),{ok:!1,issues:r};let a=new Set(e.map(e=>e.key));for(let e of Object.keys(i))a.has(e)||r.push({key:e,code:`unknown_option`});let o={};for(let t of e){let e=Object.hasOwn(i,t.key)?i[t.key]:void 0;if(e==null||e===``&&t.type!==`text`&&t.type!==`markdown`){Le(t,n,o,r);continue}let a=Fe(t,e,n);a.issue?r.push(a.issue):a.value!==void 0&&(o[t.key]=a.value)}return r.length>0?{ok:!1,issues:r}:{ok:!0,options:o}}function ze(e,t){let n=e??{},r=t??{},i=new Set([...Object.keys(n),...Object.keys(r)]);for(let e of i)if((n[e]??null)!==(r[e]??null))return!1;return!0}var Be=/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/,Ve=/^[A-Za-z0-9][A-Za-z0-9_.:-]{0,95}$/,He=/^[a-z][a-z0-9-]{0,31}$/;function Ue(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function We(e){return typeof e==`number`&&Number.isInteger(e)&&e>=1&&e<=4}function Ge(e){if(e===void 0)return{};if(!Ue(e))return null;let t={};for(let[n,r]of Object.entries(e))if(r===null||typeof r==`string`||typeof r==`boolean`||typeof r==`number`&&Number.isFinite(r))t[n]=r;else return null;return t}function Ke(e,t){let n=Ue(e)&&typeof e.id==`string`?e.id:null,r=Ue(e)&&typeof e.type==`string`?e.type:null,i=e=>(t.push({widgetId:n,type:r,code:`malformed`,message:e}),null);if(!Ue(e))return i(`widget is not an object`);if(n===null||!Be.test(n))return i(`widget id is missing or invalid`);if(r===null)return i(`widget type is missing`);if(!We(e.span))return t.push({widgetId:n,type:r,code:`invalid_span`,message:`span must be an integer from 1 to 4`}),null;let a=Ge(e.options);if(a===null)return t.push({widgetId:n,type:r,code:`invalid_options`,message:`options must be an object of primitive values`}),null;let o={id:n,type:r,span:e.span,options:a};if(e.version!==void 0){if(typeof e.version!=`number`||!Number.isSafeInteger(e.version)||e.version<1)return i(`version must be a positive integer`);o.version=e.version}return o}function qe(e){let t=[],n=[],r=Ue(e)&&Array.isArray(e.widgets)?e.widgets:null;if(r===null)return e!=null&&t.push({widgetId:null,type:null,code:`malformed`,message:`overview must be an object with a widgets array`}),{document:{widgets:n},issues:t};let i=new Set;for(let e of r){let r=Ke(e,t);r&&(i.has(r.id)?t.push({widgetId:r.id,type:r.type,code:`duplicate_id`,message:`widget id appears more than once`}):(i.add(r.id),n.push(r)))}return{document:{widgets:n},issues:t}}function Je(e){let t=[];if(e==null)return{override:null,issues:t};if(!Ue(e)||e.version!==1)return t.push({widgetId:null,type:null,code:`malformed`,message:`override must be an object with version 1`}),{override:null,issues:t};let n={version:1},r=e=>{if(!Array.isArray(e))return;let t=e.filter(e=>typeof e==`string`&&Be.test(e));return[...new Set(t)]},i=r(e.order);i?.length&&(n.order=i);let a=r(e.removed);if(a?.length&&(n.removed=a),Array.isArray(e.added)){let{document:r}=qe({widgets:e.added});r.widgets.length&&(n.added=r.widgets);let i=e.added.length-r.widgets.length;i>0&&t.push({widgetId:null,type:null,code:`malformed`,message:`${i} added widget(s) were malformed and dropped`})}if(Ue(e.changed)){let t={};for(let[n,r]of Object.entries(e.changed)){if(!Be.test(n)||!Ue(r))continue;let e={};We(r.span)&&(e.span=r.span);let i=r.options===void 0?void 0:Ge(r.options);i&&(e.options=i),typeof r.version==`number`&&Number.isSafeInteger(r.version)&&r.version>=1&&(e.version=r.version),Object.keys(e).length&&(t[n]=e)}Object.keys(t).length&&(n.changed=t)}return{override:Ye(n)?null:n,issues:t}}function Ye(e){return e===null||!e.order?.length&&!e.removed?.length&&!e.added?.length&&!Object.keys(e.changed??{}).length}function Xe(e){let t={id:e.id,type:e.type,span:e.span,options:{...e.options}};return e.version!==void 0&&(t.version=e.version),t}function Ze(e,t){if(Ye(t)||t===null)return{widgets:e.widgets.map(Xe)};let n=new Set(t.removed??[]),r=new Set(e.widgets.map(e=>e.id)),i=[];for(let r of e.widgets){if(n.has(r.id))continue;let e=Xe(r),a=t.changed?.[r.id];a&&(a.span!==void 0&&(e.span=a.span),a.options!==void 0&&(e.options={...a.options}),a.version!==void 0&&(e.version=a.version)),i.push(e)}for(let e of t.added??[])r.has(e.id)||i.push(Xe(e));let a=t.order;if(a?.length){let e=new Map(i.map(e=>[e.id,e])),t=a.filter((t,n)=>e.has(t)&&a.indexOf(t)===n),n=new Set(t),r=t.map(t=>e.get(t)),o=0;return{widgets:i.map(e=>n.has(e.id)?r[o++]:e)}}return{widgets:i}}function Qe(e,t){let n=new Map(e.widgets.map(e=>[e.id,e])),r=new Set(t.widgets.map(e=>e.id)),i={version:1},a=e.widgets.filter(e=>!r.has(e.id)).map(e=>e.id);a.length&&(i.removed=a);let o=t.widgets.filter(e=>!n.has(e.id)).map(Xe);o.length&&(i.added=o);let s={};for(let e of t.widgets){let t=n.get(e.id);if(!t)continue;let r={};e.span!==t.span&&(r.span=e.span);let i=(e.version??1)!==(t.version??1);(!ze(e.options,t.options)||i)&&(r.options={...e.options},e.version!==void 0&&(r.version=e.version)),Object.keys(r).length&&(s[e.id]=r)}Object.keys(s).length&&(i.changed=s);let c=Ze(e,i).widgets.map(e=>e.id),l=t.widgets.map(e=>e.id);return c.some((e,t)=>e!==l[t])&&(i.order=l),Ye(i)?null:i}function $e(e){let t=new Set(e),n=1;for(let e of t){let t=/^w(\d+)$/.exec(e);if(!t)continue;let r=Number(t[1]);Number.isSafeInteger(r)&&r<2**53-1&&(n=Math.max(n,r+1))}for(;n<2**53-1&&t.has(`w${n}`);)n+=1;if(!t.has(`w${n}`))return`w${n}`;for(n=1;t.has(`w${n}`);n+=1);return`w${n}`}function et(e,{registry:t,definition:n}){let r=[],i=[],a=new Set,o=n.maxWidgets??24,s=(e,t,n,i={})=>{r.push({widgetId:e.id,type:e.type,code:t,message:n,...i})};for(let r of e.widgets){if(a.has(r.id)){s(r,`duplicate_id`,`widget id appears more than once`);continue}a.add(r.id);let e=t.get(r.type);if(!e){s(r,`unknown_type`,`widget type is not registered`);continue}if(n.allowed&&!n.allowed.includes(r.type)||e.allowedIn&&!e.allowedIn.includes(n.id)){s(r,`type_not_allowed`,`widget type is not allowed in this overview`);continue}if(i.length>=o){s(r,`too_many`,`an overview holds at most ${o} widgets`);continue}let c=r.version??1,l=r.options;if(c>e.version){s(r,`future_version`,`options were written by a newer widget version`);continue}if(c<e.version){let t=null;try{t=e.migrate?e.migrate({...r.options},c):null}catch{t=null}if(!t||!Ue(t)){s(r,`migration_failed`,`no migration from version ${c}`);continue}l=t}let u=Re(e.options,l,{models:n.models});u.ok?i.push({id:r.id,type:r.type,span:Math.min(e.maxSpan,Math.max(e.minSpan,r.span)),options:u.options,version:e.version}):s(r,`invalid_options`,`options do not match the widget schema`,{options:u.issues})}return{document:{widgets:i},issues:r}}function tt(e,t,n){let r=et({widgets:[...e.defaults]},{registry:n,definition:e}),i=Je(t),a=et(Ze(r.document,i.override),{registry:n,definition:e});return{base:r.document,document:a.document,override:i.override,issues:[...r.issues,...i.issues,...a.issues],overrideIssues:[...i.issues,...a.issues]}}function nt(e,t,n){let r=tt(e,t,n);return r.overrideIssues.length>0?{ok:!1,issues:r.overrideIssues}:{ok:!0,override:Qe(r.base,r.document)}}function rt(e){if(!Ve.test(e.id))throw Error(`defineOverview: invalid overview id "${e.id}"`);let t=new Set;for(let n of e.defaults){if(!Be.test(n.id)||t.has(n.id))throw Error(`defineOverview: invalid or duplicate widget id "${n.id}"`);t.add(n.id)}return Object.freeze({...e,defaults:Object.freeze([...e.defaults])})}function it(e){if(!He.test(e.type))throw Error(`registerWidget: invalid widget type "${e.type}"`);let t=e.version??1;if(!Number.isSafeInteger(t)||t<1)throw Error(`widget "${e.type}": version must be a positive integer`);let n=e.minSpan??1,r=e.maxSpan??4;if(!Number.isInteger(n)||!Number.isInteger(r)||n<1||r>4||n>r)throw Error(`widget "${e.type}": invalid span range`);let i=Math.min(r,Math.max(n,e.defaultSpan??n));for(let t of e.allowedIn??[])if(!Ve.test(t))throw Error(`widget "${e.type}": invalid allowedIn id "${t}"`);return Ne(e.type,e.options),Object.freeze({...e,options:Object.freeze([...e.options]),version:t,defaultSpan:i,minSpan:n,maxSpan:r})}var at=class{#e=new Map;register(e,t={}){let n=it(e);if(this.#e.has(e.type)&&!t.replace)throw Error(`registerWidget: "${e.type}" is already registered`);return this.#e.set(e.type,n),()=>{this.#e.get(e.type)===n&&this.#e.delete(e.type)}}get(e){return this.#e.get(e)}has(e){return this.#e.has(e)}types(){return[...this.#e.keys()]}list(){return[...this.#e.values()]}};function ot(){return new at}var st=ot();function ct(e){return typeof e==`object`&&!!e&&`default`in e}async function lt(e,t=st){let n=new Map;return await Promise.all([...new Set(e)].map(async e=>{let r=t.get(e);if(r){if(r.component)n.set(e,r.component);else if(r.loadComponent)try{let t=await r.loadComponent();n.set(e,ct(t)?t.default:t)}catch{}}})),n}function ut(e){return JSON.stringify([e.type,e.version??1,e.options])}var dt=class{#e;#t;#n=D(null);#r=D({});#i=new Map;#a=null;#o=n(()=>{let t=tt(this.#e.definition,this.#e.override?this.#e.override():e(this.#n),this.#t);return this.#c(Qe(t.base,t.document)),t});constructor(e){this.#e=e,this.#t=e.registry??st;let t=typeof e.loaded==`function`?e.loaded():e.loaded;t&&this.#s(t)}#s(e){let t={};for(let n of e.widgets)t[n.id]={key:ut(n),status:n.status,data:n.data,error:n.error?.code};B(this.#r,t)}get definition(){return this.#e.definition}get registry(){return this.#t}get document(){return e(this.#o).document}get base(){return e(this.#o).base}get override(){return Qe(e(this.#o).base,e(this.#o).document)}get committedOverride(){let e=this.override;this.#c(e);let t=this.#a;return t?t.values.at(-1):e}#c(e){let t=this.#a;if(!t||ft(e,t.prior))return;let n=t.values.findIndex(t=>ft(t,e));this.#a=n<0||n===t.values.length-1?null:{prior:e,values:t.values.slice(n+1)}}#l(e){if(this.#e.override){let t=this.override;this.#c(t);let n=this.#a;this.#a=n?{prior:n.prior,values:[...n.values,e]}:{prior:t,values:[e]}}else B(this.#n,e);this.#e.onchange?.(e)}get issues(){return e(this.#o).issues}get customized(){return!Ye(this.override)}get canCustomize(){return!this.#e.canCustomize||this.#e.canCustomize()}get full(){let e=this.#e.definition.maxWidgets??24;return this.document.widgets.length>=e}get addable(){let{allowed:e,id:t}=this.#e.definition;return this.#t.list().filter(n=>(!e||e.includes(n.type))&&(!n.allowedIn||n.allowedIn.includes(t)))}entry(t){let n=e(this.#r)[t.id];return n&&n.key===ut(t)?n:{status:this.#e.loadWidget?`loading`:`ready`}}#u(){return this.#e.definition.models}#d(){return this.canCustomize?null:{ok:!1,reason:`not_allowed`}}#f(t,n){let r=et(t,{registry:this.#t,definition:this.#e.definition}),i=Qe(e(this.#o).base,r.document);return ft(i,this.committedOverride)?{ok:!1,reason:`unchanged`}:(this.#l(i),this.#h(r.document.widgets),{ok:!0,id:n})}#p(){let t=this.override;return[...e(this.#o).base.widgets.map(e=>e.id),...this.document.widgets.map(e=>e.id),...t?.removed??[],...(t?.added??[]).map(e=>e.id)]}add(e,t={}){let n=this.#d();if(n)return n;let r=this.addable.find(t=>t.type===e);if(!r)return{ok:!1,reason:`unknown_type`};if(this.full)return{ok:!1,reason:`limit`};let i=Re(r.options,{...Ie(r.options),...t},{models:this.#u()});if(!i.ok)return{ok:!1,reason:`invalid_options`,issues:i.issues};let a=$e(this.#p());return this.#f({widgets:[...this.document.widgets,{id:a,type:e,span:r.defaultSpan,options:i.options,version:r.version}]},a)}#m(e){return this.document.widgets.find(t=>t.id===e)}remove(e){return this.#d()||(this.#m(e)?this.#f({widgets:this.document.widgets.filter(t=>t.id!==e)},e):{ok:!1,reason:`unknown_widget`})}move(e,t){let n=this.#d();if(n)return n;let r=this.#m(e);if(!r)return{ok:!1,reason:`unknown_widget`};let i=this.document.widgets.filter(t=>t.id!==e),a=Math.max(0,Math.min(t,i.length));return i.splice(a,0,r),this.#f({widgets:i},e)}resize(e,t){return this.#d()||(this.#m(e)?this.#f({widgets:this.document.widgets.map(n=>n.id===e?{...n,span:Math.round(t)}:n)},e):{ok:!1,reason:`unknown_widget`})}setOptions(e,t){let n=this.#d();if(n)return n;let r=this.#m(e),i=r?this.#t.get(r.type):void 0;if(!r||!i)return{ok:!1,reason:`unknown_widget`};let a=Re(i.options,t,{models:this.#u()});return a.ok?this.#f({widgets:this.document.widgets.map(t=>t.id===e?{...t,options:a.options,version:i.version}:t)},e):{ok:!1,reason:`invalid_options`,issues:a.issues}}resetWidget(t){let n=this.#d();if(n)return n;let r=e(this.#o).base.widgets.find(e=>e.id===t);return r?this.#f({widgets:this.document.widgets.some(e=>e.id===t)?this.document.widgets.map(e=>e.id===t?{...r}:e):[...this.document.widgets,{...r}]},t):this.remove(t)}reset(){return this.#d()||(Ye(this.committedOverride)?{ok:!1,reason:`unchanged`}:(this.#l(null),this.#h(e(this.#o).base.widgets),{ok:!0,id:``}))}restore(e){let t=this.#d();if(t)return t;let{override:n}=Je(e),r=tt(this.#e.definition,n,this.#t),i=Qe(r.base,r.document);return ft(i,this.committedOverride)?{ok:!1,reason:`unchanged`}:(this.#l(i),this.#h(r.document.widgets),{ok:!0,id:``})}reload(e){let t=this.#m(e);t&&this.#g(t)}sync(){this.#h(this.document.widgets)}#h(t){F(()=>{let n=new Set(t.map(e=>e.id)),r={};for(let[t,i]of Object.entries(e(this.#r)))n.has(t)&&(r[t]=i);for(let[e,t]of this.#i)n.has(e)||(t.abort(),this.#i.delete(e));if(B(this.#r,r),this.#e.loadWidget)for(let n of t){let t=e(this.#r)[n.id];(!t||t.key!==ut(n))&&this.#g(n)}})}#g(t){let n=this.#e.loadWidget;if(!n)return;let r=ut(t);this.#i.get(t.id)?.abort();let i=new AbortController;this.#i.set(t.id,i),B(this.#r,{...e(this.#r),[t.id]:{key:r,status:`loading`}});let a=n=>{i.signal.aborted||(this.#i.get(t.id)===i&&this.#i.delete(t.id),e(this.#r)[t.id]?.key===r&&B(this.#r,{...e(this.#r),[t.id]:{key:r,...n}}))};Promise.resolve().then(()=>i.signal.aborted?void 0:n(t,i.signal)).then(e=>a({status:`ready`,data:e}),()=>a({status:`error`,error:`load_failed`}))}destroy(){for(let e of this.#i.values())e.abort();this.#i.clear()}};function ft(e,t){return JSON.stringify(e??null)===JSON.stringify(t??null)}function pt(e){return new dt(e)}function mt(e){return de.get(e.trim().toUpperCase())??2}var ht=`–`;function gt(e){try{return Intl.getCanonicalLocales(e)[0]??`en`}catch{return`en`}}function _t(e,{format:t=`integer`,currency:n=`USD`,locale:r,compact:i=!1}){if(typeof e!=`number`||!Number.isFinite(e))return ht;let a=gt(r),o=i?{notation:`compact`,maximumFractionDigits:1}:{};switch(t){case`money`:{let t=/^[A-Za-z]{3}$/.test(n)?n.toUpperCase():`USD`,r=mt(t);return new Intl.NumberFormat(a,{style:`currency`,currency:t,...o}).format(e/10**r)}case`percent`:return new Intl.NumberFormat(a,{style:`percent`,maximumFractionDigits:1}).format(e);case`decimal`:return new Intl.NumberFormat(a,{maximumFractionDigits:2,...o}).format(e);default:return new Intl.NumberFormat(a,{maximumFractionDigits:0,...o}).format(e)}}function vt(e,t,n){let r=new Date(/^\d{4}-\d{2}-\d{2} \d/.test(e)?`${e.replace(` `,`T`)}Z`:e);if(Number.isNaN(r.getTime()))return e;let i=gt(n),a=e=>new Intl.DateTimeFormat(i,{timeZone:`UTC`,...e}).format(r);switch(t){case`year`:return a({year:`numeric`});case`quarter`:return`Q${Math.floor(r.getUTCMonth()/3)+1} ${r.getUTCFullYear()}`;case`month`:return a({month:`short`,year:`numeric`});case`week`:case`day`:return a({month:`short`,day:`numeric`});default:return a({month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`})}}var yt=200,bt=4,xt=2e4;function St(e){let t=e.trim();if(!t||t.length>2048||/[\u0000-\u001f\u007f\s<>"'`\\]/.test(t))return null;if(/^https?:\/\//i.test(t))try{return new URL(t),t}catch{return null}return/^mailto:[^\s?]+(\?.*)?$/i.test(t)||t.startsWith(`#`)||t.startsWith(`/`)&&!t.startsWith(`//`)?t:null}var Ct=e=>e!==void 0&&/[A-Za-z0-9]/.test(e);function wt(e,t){let n=[],r=``,i=()=>{r&&n.push({type:`text`,text:r}),r=``},a=0;for(;a<e.length;){let o=e[a];if(o===`\\`&&a+1<e.length&&/[\\`*_[\]()#>-]/.test(e[a+1]))r+=e[a+1],a+=2;else{if(o==="`"){let t=e.indexOf("`",a+1);if(t>a+1){i(),n.push({type:`code`,text:e.slice(a+1,t)}),a=t+1;continue}}if(t<bt&&e.startsWith(`**`,a)){let r=e.indexOf(`**`,a+2);if(r>a+2){i(),n.push({type:`strong`,children:wt(e.slice(a+2,r),t+1)}),a=r+2;continue}}if(t<bt&&(o===`*`||o===`_`)&&e[a+1]!==` `&&!(o===`_`&&Ct(e[a-1]))){let r=e.indexOf(o,a+1);if(r>a+1&&e[r-1]!==` `&&!(o===`_`&&Ct(e[r+1]))){i(),n.push({type:`em`,children:wt(e.slice(a+1,r),t+1)}),a=r+1;continue}}if(o===`[`&&t<bt){let r=e.indexOf(`](`,a+1),o=r>0?e.indexOf(`)`,r+2):-1;if(r>0&&o>0){let s=e.slice(a+1,r),c=St(e.slice(r+2,o));i(),c?n.push({type:`link`,href:c,children:wt(s,t+1)}):n.push(...wt(s,t+1)),a=o+1;continue}}r+=o,a+=1}}return i(),n}function Tt(e){let t=e.slice(0,xt).replace(/\r\n?/g,`
1
+ import{$ as e,B as t,Ct as n,D as r,Dt as i,E as a,F as o,Ft as s,G as c,H as l,J as u,K as d,L as f,Lt as p,M as m,Ot as h,P as g,Pt as _,R as v,Rt as y,T as b,U as x,W as S,X as C,Y as w,Z as T,a as E,bt as D,ct as ee,d as O,ft as k,g as A,gt as j,ht as M,j as N,mt as P,n as te,nt as F,pt as I,q as L,st as R,v as z,vt as B,z as ne}from"./DG3qFFTE.js";import"./xihTtKlq.js";import{i as re,o as V,r as H,t as ie}from"./Bv5jGtB8.js";import{a as U,t as ae}from"./YUSKx8_q.js";import{Et as oe,O as se,bt as W,d as G,h as ce,jt as K,kt as le,m as q,wt as J}from"./BqoDi2ah.js";import{n as ue,t as de}from"./DK8Blf1Y.js";import{n as Y,r as fe}from"./By9nPosf.js";import{a as pe,d as me,l as he,m as ge,o as _e,s as X}from"./DIE02RSm.js";import{t as ve}from"./D18ccNbM.js";import{b as ye,d as be,l as xe,n as Se,u as Ce}from"./Bs5WxZDd.js";import{$ as we,et as Te}from"./BkH1cevg.js";var Ee=/^[A-Za-z][A-Za-z0-9]{0,31}$/,De=/^[A-Za-z_][A-Za-z0-9_.-]{0,63}$/,Oe=/^(?:(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*:)?[A-Za-z][A-Za-z0-9_]{0,63}$/,ke=160,Ae=200,je=1e4;function Me(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ne(e,t){let n=new Set;for(let r of t){if(!Ee.test(r.key))throw Error(`widget "${e}": invalid option key "${r.key}"`);if(n.has(r.key))throw Error(`widget "${e}": duplicate option key "${r.key}"`);if(n.add(r.key),r.type===`enum`&&!r.choices?.length)throw Error(`widget "${e}": enum option "${r.key}" needs choices`);if(r.default!==void 0&&r.default!==null&&Fe(r,r.default,void 0).issue)throw Error(`widget "${e}": default of option "${r.key}" is invalid`)}}function Pe(e,t){return{issue:{key:e,code:t}}}function Fe(e,t,n){let{key:r}=e;switch(e.type){case`text`:case`markdown`:{if(typeof t!=`string`)return Pe(r,`invalid_type`);let n=e.maxLength??(e.type===`markdown`?je:Ae);return t.length>n?Pe(r,`too_long`):{value:t}}case`identifier`:return typeof t==`string`?De.test(t)?{value:t}:Pe(r,`invalid_format`):Pe(r,`invalid_type`);case`model`:return typeof t==`string`?t.length>ke||!Oe.test(t)?Pe(r,`invalid_format`):n?.models&&!n.models.includes(t)?Pe(r,`not_allowed`):{value:t}:Pe(r,`invalid_type`);case`enum`:return typeof t==`string`?e.choices?.some(e=>e.value===t)?{value:t}:Pe(r,`not_in_choices`):Pe(r,`invalid_type`);case`boolean`:return typeof t==`boolean`?{value:t}:Pe(r,`invalid_type`);case`integer`:case`number`:return typeof t!=`number`||!Number.isFinite(t)||e.type===`integer`&&!Number.isSafeInteger(t)?Pe(r,`invalid_type`):e.min!==void 0&&t<e.min||e.max!==void 0&&t>e.max?Pe(r,`out_of_range`):{value:t}}}function Ie(e){let t={};for(let n of e)n.default!==void 0&&n.default!==null&&(t[n.key]=n.default);return t}function Le(e,t,n,r){if(e.default!==void 0&&e.default!==null){let i=Fe(e,e.default,t);i.issue?r.push(i.issue):i.value!==void 0&&(n[e.key]=i.value)}else e.required&&r.push({key:e.key,code:`required`})}function Re(e,t,n){let r=[],i=t==null?{}:Me(t)?t:{};if(t!=null&&!Me(t))return r.push({key:``,code:`invalid_type`}),{ok:!1,issues:r};let a=new Set(e.map(e=>e.key));for(let e of Object.keys(i))a.has(e)||r.push({key:e,code:`unknown_option`});let o={};for(let t of e){let e=Object.hasOwn(i,t.key)?i[t.key]:void 0;if(e==null||e===``&&t.type!==`text`&&t.type!==`markdown`){Le(t,n,o,r);continue}let a=Fe(t,e,n);a.issue?r.push(a.issue):a.value!==void 0&&(o[t.key]=a.value)}return r.length>0?{ok:!1,issues:r}:{ok:!0,options:o}}function ze(e,t){let n=e??{},r=t??{},i=new Set([...Object.keys(n),...Object.keys(r)]);for(let e of i)if((n[e]??null)!==(r[e]??null))return!1;return!0}var Be=/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/,Ve=/^[A-Za-z0-9][A-Za-z0-9_.:-]{0,95}$/,He=/^[a-z][a-z0-9-]{0,31}$/;function Ue(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function We(e){return typeof e==`number`&&Number.isInteger(e)&&e>=1&&e<=4}function Ge(e){if(e===void 0)return{};if(!Ue(e))return null;let t={};for(let[n,r]of Object.entries(e))if(r===null||typeof r==`string`||typeof r==`boolean`||typeof r==`number`&&Number.isFinite(r))t[n]=r;else return null;return t}function Ke(e,t){let n=Ue(e)&&typeof e.id==`string`?e.id:null,r=Ue(e)&&typeof e.type==`string`?e.type:null,i=e=>(t.push({widgetId:n,type:r,code:`malformed`,message:e}),null);if(!Ue(e))return i(`widget is not an object`);if(n===null||!Be.test(n))return i(`widget id is missing or invalid`);if(r===null)return i(`widget type is missing`);if(!We(e.span))return t.push({widgetId:n,type:r,code:`invalid_span`,message:`span must be an integer from 1 to 4`}),null;let a=Ge(e.options);if(a===null)return t.push({widgetId:n,type:r,code:`invalid_options`,message:`options must be an object of primitive values`}),null;let o={id:n,type:r,span:e.span,options:a};if(e.version!==void 0){if(typeof e.version!=`number`||!Number.isSafeInteger(e.version)||e.version<1)return i(`version must be a positive integer`);o.version=e.version}return o}function qe(e){let t=[],n=[],r=Ue(e)&&Array.isArray(e.widgets)?e.widgets:null;if(r===null)return e!=null&&t.push({widgetId:null,type:null,code:`malformed`,message:`overview must be an object with a widgets array`}),{document:{widgets:n},issues:t};let i=new Set;for(let e of r){let r=Ke(e,t);r&&(i.has(r.id)?t.push({widgetId:r.id,type:r.type,code:`duplicate_id`,message:`widget id appears more than once`}):(i.add(r.id),n.push(r)))}return{document:{widgets:n},issues:t}}function Je(e){let t=[];if(e==null)return{override:null,issues:t};if(!Ue(e)||e.version!==1)return t.push({widgetId:null,type:null,code:`malformed`,message:`override must be an object with version 1`}),{override:null,issues:t};let n={version:1},r=e=>{if(!Array.isArray(e))return;let t=e.filter(e=>typeof e==`string`&&Be.test(e));return[...new Set(t)]},i=r(e.order);i?.length&&(n.order=i);let a=r(e.removed);if(a?.length&&(n.removed=a),Array.isArray(e.added)){let{document:r}=qe({widgets:e.added});r.widgets.length&&(n.added=r.widgets);let i=e.added.length-r.widgets.length;i>0&&t.push({widgetId:null,type:null,code:`malformed`,message:`${i} added widget(s) were malformed and dropped`})}if(Ue(e.changed)){let t={};for(let[n,r]of Object.entries(e.changed)){if(!Be.test(n)||!Ue(r))continue;let e={};We(r.span)&&(e.span=r.span);let i=r.options===void 0?void 0:Ge(r.options);i&&(e.options=i),typeof r.version==`number`&&Number.isSafeInteger(r.version)&&r.version>=1&&(e.version=r.version),Object.keys(e).length&&(t[n]=e)}Object.keys(t).length&&(n.changed=t)}return{override:Ye(n)?null:n,issues:t}}function Ye(e){return e===null||!e.order?.length&&!e.removed?.length&&!e.added?.length&&!Object.keys(e.changed??{}).length}function Xe(e){let t={id:e.id,type:e.type,span:e.span,options:{...e.options}};return e.version!==void 0&&(t.version=e.version),t}function Ze(e,t){if(Ye(t)||t===null)return{widgets:e.widgets.map(Xe)};let n=new Set(t.removed??[]),r=new Set(e.widgets.map(e=>e.id)),i=[];for(let r of e.widgets){if(n.has(r.id))continue;let e=Xe(r),a=t.changed?.[r.id];a&&(a.span!==void 0&&(e.span=a.span),a.options!==void 0&&(e.options={...a.options}),a.version!==void 0&&(e.version=a.version)),i.push(e)}for(let e of t.added??[])r.has(e.id)||i.push(Xe(e));let a=t.order;if(a?.length){let e=new Map(i.map(e=>[e.id,e])),t=a.filter((t,n)=>e.has(t)&&a.indexOf(t)===n),n=new Set(t),r=t.map(t=>e.get(t)),o=0;return{widgets:i.map(e=>n.has(e.id)?r[o++]:e)}}return{widgets:i}}function Qe(e,t){let n=new Map(e.widgets.map(e=>[e.id,e])),r=new Set(t.widgets.map(e=>e.id)),i={version:1},a=e.widgets.filter(e=>!r.has(e.id)).map(e=>e.id);a.length&&(i.removed=a);let o=t.widgets.filter(e=>!n.has(e.id)).map(Xe);o.length&&(i.added=o);let s={};for(let e of t.widgets){let t=n.get(e.id);if(!t)continue;let r={};e.span!==t.span&&(r.span=e.span);let i=(e.version??1)!==(t.version??1);(!ze(e.options,t.options)||i)&&(r.options={...e.options},e.version!==void 0&&(r.version=e.version)),Object.keys(r).length&&(s[e.id]=r)}Object.keys(s).length&&(i.changed=s);let c=Ze(e,i).widgets.map(e=>e.id),l=t.widgets.map(e=>e.id);return c.some((e,t)=>e!==l[t])&&(i.order=l),Ye(i)?null:i}function $e(e){let t=new Set(e),n=1;for(let e of t){let t=/^w(\d+)$/.exec(e);if(!t)continue;let r=Number(t[1]);Number.isSafeInteger(r)&&r<2**53-1&&(n=Math.max(n,r+1))}for(;n<2**53-1&&t.has(`w${n}`);)n+=1;if(!t.has(`w${n}`))return`w${n}`;for(n=1;t.has(`w${n}`);n+=1);return`w${n}`}function et(e,{registry:t,definition:n}){let r=[],i=[],a=new Set,o=n.maxWidgets??24,s=(e,t,n,i={})=>{r.push({widgetId:e.id,type:e.type,code:t,message:n,...i})};for(let r of e.widgets){if(a.has(r.id)){s(r,`duplicate_id`,`widget id appears more than once`);continue}a.add(r.id);let e=t.get(r.type);if(!e){s(r,`unknown_type`,`widget type is not registered`);continue}if(n.allowed&&!n.allowed.includes(r.type)||e.allowedIn&&!e.allowedIn.includes(n.id)){s(r,`type_not_allowed`,`widget type is not allowed in this overview`);continue}if(i.length>=o){s(r,`too_many`,`an overview holds at most ${o} widgets`);continue}let c=r.version??1,l=r.options;if(c>e.version){s(r,`future_version`,`options were written by a newer widget version`);continue}if(c<e.version){let t=null;try{t=e.migrate?e.migrate({...r.options},c):null}catch{t=null}if(!t||!Ue(t)){s(r,`migration_failed`,`no migration from version ${c}`);continue}l=t}let u=Re(e.options,l,{models:n.models});u.ok?i.push({id:r.id,type:r.type,span:Math.min(e.maxSpan,Math.max(e.minSpan,r.span)),options:u.options,version:e.version}):s(r,`invalid_options`,`options do not match the widget schema`,{options:u.issues})}return{document:{widgets:i},issues:r}}function tt(e,t,n){let r=et({widgets:[...e.defaults]},{registry:n,definition:e}),i=Je(t),a=et(Ze(r.document,i.override),{registry:n,definition:e});return{base:r.document,document:a.document,override:i.override,issues:[...r.issues,...i.issues,...a.issues],overrideIssues:[...i.issues,...a.issues]}}function nt(e,t,n){let r=tt(e,t,n);return r.overrideIssues.length>0?{ok:!1,issues:r.overrideIssues}:{ok:!0,override:Qe(r.base,r.document)}}function rt(e){if(!Ve.test(e.id))throw Error(`defineOverview: invalid overview id "${e.id}"`);let t=new Set;for(let n of e.defaults){if(!Be.test(n.id)||t.has(n.id))throw Error(`defineOverview: invalid or duplicate widget id "${n.id}"`);t.add(n.id)}return Object.freeze({...e,defaults:Object.freeze([...e.defaults])})}function it(e){if(!He.test(e.type))throw Error(`registerWidget: invalid widget type "${e.type}"`);let t=e.version??1;if(!Number.isSafeInteger(t)||t<1)throw Error(`widget "${e.type}": version must be a positive integer`);let n=e.minSpan??1,r=e.maxSpan??4;if(!Number.isInteger(n)||!Number.isInteger(r)||n<1||r>4||n>r)throw Error(`widget "${e.type}": invalid span range`);let i=Math.min(r,Math.max(n,e.defaultSpan??n));for(let t of e.allowedIn??[])if(!Ve.test(t))throw Error(`widget "${e.type}": invalid allowedIn id "${t}"`);return Ne(e.type,e.options),Object.freeze({...e,options:Object.freeze([...e.options]),version:t,defaultSpan:i,minSpan:n,maxSpan:r})}var at=class{#e=new Map;register(e,t={}){let n=it(e);if(this.#e.has(e.type)&&!t.replace)throw Error(`registerWidget: "${e.type}" is already registered`);return this.#e.set(e.type,n),()=>{this.#e.get(e.type)===n&&this.#e.delete(e.type)}}get(e){return this.#e.get(e)}has(e){return this.#e.has(e)}types(){return[...this.#e.keys()]}list(){return[...this.#e.values()]}};function ot(){return new at}var st=ot();function ct(e){return typeof e==`object`&&!!e&&`default`in e}async function lt(e,t=st){let n=new Map;return await Promise.all([...new Set(e)].map(async e=>{let r=t.get(e);if(r){if(r.component)n.set(e,r.component);else if(r.loadComponent)try{let t=await r.loadComponent();n.set(e,ct(t)?t.default:t)}catch{}}})),n}function ut(e){return JSON.stringify([e.type,e.version??1,e.options])}var dt=class{#e;#t;#n=D(null);#r=D({});#i=new Map;#a=null;#o=n(()=>{let t=tt(this.#e.definition,this.#e.override?this.#e.override():e(this.#n),this.#t);return this.#c(Qe(t.base,t.document)),t});constructor(e){this.#e=e,this.#t=e.registry??st;let t=typeof e.loaded==`function`?e.loaded():e.loaded;t&&this.#s(t)}#s(e){let t={};for(let n of e.widgets)t[n.id]={key:ut(n),status:n.status,data:n.data,error:n.error?.code};B(this.#r,t)}get definition(){return this.#e.definition}get registry(){return this.#t}get document(){return e(this.#o).document}get base(){return e(this.#o).base}get override(){return Qe(e(this.#o).base,e(this.#o).document)}get committedOverride(){let e=this.override;this.#c(e);let t=this.#a;return t?t.values.at(-1):e}#c(e){let t=this.#a;if(!t||ft(e,t.prior))return;let n=t.values.findIndex(t=>ft(t,e));this.#a=n<0||n===t.values.length-1?null:{prior:e,values:t.values.slice(n+1)}}#l(e){if(this.#e.override){let t=this.override;this.#c(t);let n=this.#a;this.#a=n?{prior:n.prior,values:[...n.values,e]}:{prior:t,values:[e]}}else B(this.#n,e);this.#e.onchange?.(e)}get issues(){return e(this.#o).issues}get customized(){return!Ye(this.override)}get canCustomize(){return!this.#e.canCustomize||this.#e.canCustomize()}get full(){let e=this.#e.definition.maxWidgets??24;return this.document.widgets.length>=e}get addable(){let{allowed:e,id:t}=this.#e.definition;return this.#t.list().filter(n=>(!e||e.includes(n.type))&&(!n.allowedIn||n.allowedIn.includes(t)))}entry(t){let n=e(this.#r)[t.id];return n&&n.key===ut(t)?n:{status:this.#e.loadWidget?`loading`:`ready`}}#u(){return this.#e.definition.models}#d(){return this.canCustomize?null:{ok:!1,reason:`not_allowed`}}#f(t,n){let r=et(t,{registry:this.#t,definition:this.#e.definition}),i=Qe(e(this.#o).base,r.document);return ft(i,this.committedOverride)?{ok:!1,reason:`unchanged`}:(this.#l(i),this.#h(r.document.widgets),{ok:!0,id:n})}#p(){let t=this.override;return[...e(this.#o).base.widgets.map(e=>e.id),...this.document.widgets.map(e=>e.id),...t?.removed??[],...(t?.added??[]).map(e=>e.id)]}add(e,t={}){let n=this.#d();if(n)return n;let r=this.addable.find(t=>t.type===e);if(!r)return{ok:!1,reason:`unknown_type`};if(this.full)return{ok:!1,reason:`limit`};let i=Re(r.options,{...Ie(r.options),...t},{models:this.#u()});if(!i.ok)return{ok:!1,reason:`invalid_options`,issues:i.issues};let a=$e(this.#p());return this.#f({widgets:[...this.document.widgets,{id:a,type:e,span:r.defaultSpan,options:i.options,version:r.version}]},a)}#m(e){return this.document.widgets.find(t=>t.id===e)}remove(e){return this.#d()||(this.#m(e)?this.#f({widgets:this.document.widgets.filter(t=>t.id!==e)},e):{ok:!1,reason:`unknown_widget`})}move(e,t){let n=this.#d();if(n)return n;let r=this.#m(e);if(!r)return{ok:!1,reason:`unknown_widget`};let i=this.document.widgets.filter(t=>t.id!==e),a=Math.max(0,Math.min(t,i.length));return i.splice(a,0,r),this.#f({widgets:i},e)}resize(e,t){return this.#d()||(this.#m(e)?this.#f({widgets:this.document.widgets.map(n=>n.id===e?{...n,span:Math.round(t)}:n)},e):{ok:!1,reason:`unknown_widget`})}setOptions(e,t){let n=this.#d();if(n)return n;let r=this.#m(e),i=r?this.#t.get(r.type):void 0;if(!r||!i)return{ok:!1,reason:`unknown_widget`};let a=Re(i.options,t,{models:this.#u()});return a.ok?this.#f({widgets:this.document.widgets.map(t=>t.id===e?{...t,options:a.options,version:i.version}:t)},e):{ok:!1,reason:`invalid_options`,issues:a.issues}}resetWidget(t){let n=this.#d();if(n)return n;let r=e(this.#o).base.widgets.find(e=>e.id===t);return r?this.#f({widgets:this.document.widgets.some(e=>e.id===t)?this.document.widgets.map(e=>e.id===t?{...r}:e):[...this.document.widgets,{...r}]},t):this.remove(t)}reset(){return this.#d()||(Ye(this.committedOverride)?{ok:!1,reason:`unchanged`}:(this.#l(null),this.#h(e(this.#o).base.widgets),{ok:!0,id:``}))}restore(e){let t=this.#d();if(t)return t;let{override:n}=Je(e),r=tt(this.#e.definition,n,this.#t),i=Qe(r.base,r.document);return ft(i,this.committedOverride)?{ok:!1,reason:`unchanged`}:(this.#l(i),this.#h(r.document.widgets),{ok:!0,id:``})}reload(e){let t=this.#m(e);t&&this.#g(t)}sync(){this.#h(this.document.widgets)}#h(t){F(()=>{let n=new Set(t.map(e=>e.id)),r={};for(let[t,i]of Object.entries(e(this.#r)))n.has(t)&&(r[t]=i);for(let[e,t]of this.#i)n.has(e)||(t.abort(),this.#i.delete(e));if(B(this.#r,r),this.#e.loadWidget)for(let n of t){let t=e(this.#r)[n.id];(!t||t.key!==ut(n))&&this.#g(n)}})}#g(t){let n=this.#e.loadWidget;if(!n)return;let r=ut(t);this.#i.get(t.id)?.abort();let i=new AbortController;this.#i.set(t.id,i),B(this.#r,{...e(this.#r),[t.id]:{key:r,status:`loading`}});let a=n=>{i.signal.aborted||(this.#i.get(t.id)===i&&this.#i.delete(t.id),e(this.#r)[t.id]?.key===r&&B(this.#r,{...e(this.#r),[t.id]:{key:r,...n}}))};Promise.resolve().then(()=>i.signal.aborted?void 0:n(t,i.signal)).then(e=>a({status:`ready`,data:e}),()=>a({status:`error`,error:`load_failed`}))}destroy(){for(let e of this.#i.values())e.abort();this.#i.clear()}};function ft(e,t){return JSON.stringify(e??null)===JSON.stringify(t??null)}function pt(e){return new dt(e)}function mt(e){return de.get(e.trim().toUpperCase())??2}var ht=`–`;function gt(e){try{return Intl.getCanonicalLocales(e)[0]??`en`}catch{return`en`}}function _t(e,{format:t=`integer`,currency:n=`USD`,locale:r,compact:i=!1}){if(typeof e!=`number`||!Number.isFinite(e))return ht;let a=gt(r),o=i?{notation:`compact`,maximumFractionDigits:1}:{};switch(t){case`money`:{let t=/^[A-Za-z]{3}$/.test(n)?n.toUpperCase():`USD`,r=mt(t);return new Intl.NumberFormat(a,{style:`currency`,currency:t,...o}).format(e/10**r)}case`percent`:return new Intl.NumberFormat(a,{style:`percent`,maximumFractionDigits:1}).format(e);case`decimal`:return new Intl.NumberFormat(a,{maximumFractionDigits:2,...o}).format(e);default:return new Intl.NumberFormat(a,{maximumFractionDigits:0,...o}).format(e)}}function vt(e,t,n){let r=new Date(/^\d{4}-\d{2}-\d{2} \d/.test(e)?`${e.replace(` `,`T`)}Z`:e);if(Number.isNaN(r.getTime()))return e;let i=gt(n),a=e=>new Intl.DateTimeFormat(i,{timeZone:`UTC`,...e}).format(r);switch(t){case`year`:return a({year:`numeric`});case`quarter`:return`Q${Math.floor(r.getUTCMonth()/3)+1} ${r.getUTCFullYear()}`;case`month`:return a({month:`short`,year:`numeric`});case`week`:case`day`:return a({month:`short`,day:`numeric`});default:return a({month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`})}}var yt=200,bt=4,xt=2e4;function St(e){let t=e.trim();if(!t||t.length>2048||/[\u0000-\u001f\u007f\s<>"'`\\]/.test(t))return null;if(/^https?:\/\//i.test(t))try{return new URL(t),t}catch{return null}return/^mailto:[^\s?]+(\?.*)?$/i.test(t)||t.startsWith(`#`)||t.startsWith(`/`)&&!t.startsWith(`//`)?t:null}var Ct=e=>e!==void 0&&/[A-Za-z0-9]/.test(e);function wt(e,t){let n=[],r=``,i=()=>{r&&n.push({type:`text`,text:r}),r=``},a=0;for(;a<e.length;){let o=e[a];if(o===`\\`&&a+1<e.length&&/[\\`*_[\]()#>-]/.test(e[a+1]))r+=e[a+1],a+=2;else{if(o==="`"){let t=e.indexOf("`",a+1);if(t>a+1){i(),n.push({type:`code`,text:e.slice(a+1,t)}),a=t+1;continue}}if(t<bt&&e.startsWith(`**`,a)){let r=e.indexOf(`**`,a+2);if(r>a+2){i(),n.push({type:`strong`,children:wt(e.slice(a+2,r),t+1)}),a=r+2;continue}}if(t<bt&&(o===`*`||o===`_`)&&e[a+1]!==` `&&!(o===`_`&&Ct(e[a-1]))){let r=e.indexOf(o,a+1);if(r>a+1&&e[r-1]!==` `&&!(o===`_`&&Ct(e[r+1]))){i(),n.push({type:`em`,children:wt(e.slice(a+1,r),t+1)}),a=r+1;continue}}if(o===`[`&&t<bt){let r=e.indexOf(`](`,a+1),o=r>0?e.indexOf(`)`,r+2):-1;if(r>0&&o>0){let s=e.slice(a+1,r),c=St(e.slice(r+2,o));i(),c?n.push({type:`link`,href:c,children:wt(s,t+1)}):n.push(...wt(s,t+1)),a=o+1;continue}}r+=o,a+=1}}return i(),n}function Tt(e){let t=e.slice(0,xt).replace(/\r\n?/g,`
2
2
  `).split(`
3
3
  `),n=[],r=[],i=null,a=()=>{r.length&&n.push({type:`paragraph`,children:wt(r.join(` `),0)}),r=[]},o=()=>{i&&n.push({type:`list`,...i}),i=null};for(let e=0;e<t.length&&n.length<yt;e+=1){let s=t[e];if(/^\s*```/.test(s)){a(),o();let r=[];for(e+=1;e<t.length&&!/^\s*```/.test(t[e]);)r.push(t[e]),e+=1;n.push({type:`code`,text:r.join(`
4
4
  `)});continue}if(s.trim()===``){a(),o();continue}let c=/^(#{1,3})\s+(.*\S)\s*$/.exec(s);if(c){a(),o(),n.push({type:`heading`,level:c[1].length,children:wt(c[2],0)});continue}let l=/^\s*[-*]\s+(.*\S)\s*$/.exec(s),u=/^\s*\d+[.)]\s+(.*\S)\s*$/.exec(s);if(l||u){a();let e=u!==null;i&&i.ordered!==e&&o(),i??={ordered:e,items:[]},i.items.push(wt((l??u)?.[1]??``,0));continue}let d=/^\s*>\s?(.*)$/.exec(s);d?(a(),o(),n.push({type:`quote`,children:wt(d[1],0)})):(o(),r.push(s.trim()))}return a(),o(),n.slice(0,yt)}var Z=U({"ui.overview.label":`Overview widgets`,"ui.overview.empty":`There are no widgets on this overview yet.`,"ui.overview.toolbar":`Customize overview`,"ui.overview.add":`Add widget`,"ui.overview.add_title":`Add a widget`,"ui.overview.add_none":`No more widgets can be added to this overview.`,"ui.overview.reset":`Reset overview to default`,"ui.overview.move":`Move {widget}`,"ui.overview.resize":`Resize {widget}`,"ui.overview.resize_value":`{span} of {max} columns`,"ui.overview.configure":`Configure {widget}`,"ui.overview.remove":`Remove {widget}`,"ui.overview.item":`{widget}, position {position} of {count}`,"ui.overview.announce_pickup":`Picked up {widget}. Use the arrow keys to choose a position, then Space or Enter to drop. Escape cancels.`,"ui.overview.announce_position":`{widget}, position {position} of {count}.`,"ui.overview.announce_drop":`Moved {widget} to position {position} of {count}.`,"ui.overview.announce_cancel":`Cancelled moving {widget}.`,"ui.overview.announce_failed":`Could not move {widget}. The order was restored.`,"ui.overview.announce_resized":`{widget} is now {span} of {max} columns wide.`,"ui.overview.announce_removed":`Removed {widget}.`,"ui.overview.announce_added":`Added {widget}.`,"ui.overview.announce_configured":`Updated {widget}.`,"ui.overview.announce_reset":`Overview reset to its default.`,"ui.overview.announce_denied":`You cannot change this overview.`,"ui.overview.assistant_applied":`The assistant updated this overview.`,"ui.overview.assistant_undo":`Undo`,"ui.overview.assistant_dismiss":`Dismiss`,"ui.overview.assistant_undone":`The assistant change was undone.`,"ui.overview.assistant_changed_since":`The overview changed after the assistant edit, so it was not undone.`,"ui.overview.assistant_undo_failed":`The assistant change could not be undone.`,"ui.overview.loading":`Loading`,"ui.overview.error":`This widget could not be loaded.`,"ui.overview.retry":`Try again`,"ui.overview.unavailable":`This widget is not available.`,"ui.overview.no_data":`Nothing to show yet.`,"ui.overview.options_title":`Configure {widget}`,"ui.overview.options_new_title":`Add {widget}`,"ui.overview.options_save":`Save`,"ui.overview.options_cancel":`Cancel`,"ui.overview.options_none":`This widget has no options.`,"ui.overview.options_choose":`Choose`,"ui.overview.options_failed":`Some options need attention.`,"ui.overview.issue_required":`This field is required.`,"ui.overview.issue_invalid_type":`This value is not valid.`,"ui.overview.issue_too_long":`This value is too long.`,"ui.overview.issue_out_of_range":`This value is out of range.`,"ui.overview.issue_not_in_choices":`Choose one of the listed values.`,"ui.overview.issue_invalid_format":`Use letters, digits and the simple separators only.`,"ui.overview.issue_not_allowed":`This is not available on this overview.`,"ui.overview.issue_unknown_option":`This option is not recognised.`,"ui.overview.widget.metric.title":`Metric`,"ui.overview.widget.metric.description":`One number, such as a count or a total.`,"ui.overview.widget.chart.title":`Chart`,"ui.overview.widget.chart.description":`Values grouped over a period, as bars or a line.`,"ui.overview.widget.records.title":`Record list`,"ui.overview.widget.records.description":`The latest or top records of a model.`,"ui.overview.widget.line_items.title":`Line items`,"ui.overview.widget.line_items.description":`A document's lines with their totals.`,"ui.overview.widget.related.title":`Related records`,"ui.overview.widget.related.description":`Records linked to this one, a tab per kind, with totals.`,"ui.overview.widget.shortcuts.title":`Shortcuts`,"ui.overview.widget.shortcuts.description":`Cards that link to a section’s pages.`,"ui.overview.widget.note.title":`Note`,"ui.overview.widget.note.description":`Text with simple formatting.`,"ui.overview.opt.title":`Title`,"ui.overview.opt.title_help":`Shown above the widget. Leave empty for the default.`,"ui.overview.opt.model":`Model`,"ui.overview.opt.model_help":`Which records the widget reads.`,"ui.overview.opt.measure":`Measure`,"ui.overview.opt.measure_count":`Count`,"ui.overview.opt.measure_sum":`Sum`,"ui.overview.opt.measure_avg":`Average`,"ui.overview.opt.measure_min":`Smallest`,"ui.overview.opt.measure_max":`Largest`,"ui.overview.opt.field":`Field`,"ui.overview.opt.field_help":`The field to sum or average.`,"ui.overview.opt.filter":`Filter`,"ui.overview.opt.filter_help":`A named filter the data source offers.`,"ui.overview.opt.group_by":`Group by`,"ui.overview.opt.period":`Period`,"ui.overview.opt.period_7d":`Last 7 days`,"ui.overview.opt.period_30d":`Last 30 days`,"ui.overview.opt.period_90d":`Last 90 days`,"ui.overview.opt.period_12m":`Last 12 months`,"ui.overview.opt.period_all":`All time`,"ui.overview.opt.style":`Style`,"ui.overview.opt.style_bar":`Bars`,"ui.overview.opt.style_line":`Line`,"ui.overview.opt.style_table":`Table`,"ui.overview.opt.style_pie":`Donut`,"ui.overview.opt.style_stat":`Headline number`,"ui.overview.opt.sort":`Sort by`,"ui.overview.opt.direction":`Direction`,"ui.overview.opt.direction_desc":`Newest or largest first`,"ui.overview.opt.direction_asc":`Oldest or smallest first`,"ui.overview.opt.limit":`Rows`,"ui.overview.opt.parent_field":`Link to this record`,"ui.overview.opt.parent_field_help":`With the parent filter: the field that points at this record, when Field is the one to measure.`,"ui.overview.opt.relation":`Relation`,"ui.overview.opt.relation_help":`The line-item relation to show, as its key (OrderLine-orderId). Leave empty for the first one.`,"ui.overview.opt.relations":`Relations`,"ui.overview.opt.relations_help":`Which related records get a tab, as relation keys separated by commas (Order-customerId). Leave empty for all of them.`,"ui.overview.opt.columns":`Columns`,"ui.overview.opt.columns_help":`Field names to show as columns, separated by commas. Leave empty for a plain list.`,"ui.overview.opt.summaries":`Totals row`,"ui.overview.opt.summaries_help":`Count the rows and add up money and quantity columns. On by default when there are such columns.`,"ui.overview.opt.section":`Section`,"ui.overview.opt.section_help":`The navigation section whose pages are shown.`,"ui.overview.opt.body":`Text`,"ui.overview.opt.body_help":`Supports headings, lists, bold, italic, code and links.`,"ui.overview.metric.change_up":`Up {value} from the previous period`,"ui.overview.metric.change_down":`Down {value} from the previous period`,"ui.overview.chart.summary":`Chart with {count} values`,"ui.overview.chart.table":`Chart data`,"ui.overview.chart.label_column":`Label`,"ui.overview.chart.value_column":`Value`,"ui.overview.records.empty":`No records to show.`,"ui.overview.records.view_all":`View all`,"ui.overview.records.total":`{count} in total`,"ui.overview.table.total":`Total`,"ui.overview.related.empty":`No related records yet.`,"ui.overview.line_items.empty":`No line items.`,"ui.overview.line_items.subtotal":`Subtotal`,"ui.overview.line_items.discount":`Discount`,"ui.overview.line_items.tax":`Tax`,"ui.overview.line_items.total":`Total`,"ui.overview.line_items.subtotal_excluding_tax":`Subtotal (excl. tax)`,"ui.overview.line_items.discount_included":`Includes discounts of`,"ui.overview.line_items.tax_on":`{label} on`,"ui.overview.line_items.tax_included":`Includes {label} of`,"ui.overview.line_items.rounded_document":`Rounded per document`,"ui.overview.line_items.computed":`(from the lines)`,"ui.overview.line_items.mismatch":`Lines add up to {amount}.`,"ui.overview.line_items.mismatch_subtotal":`The recorded subtotal is {amount}.`,"ui.overview.line_items.mismatch_total":`The recorded total is {amount}.`,"ui.overview.shortcuts.empty":`No pages to show.`,"ui.overview.shortcuts.records_one":`{count} record`,"ui.overview.shortcuts.records_other":`{count} records`,"ui.cookbook.menu_entries":`Menu entries`,"ui.cookbook.section_not_found":`Section not found`,"ui.cookbook.section_not_found_hint":`This section is not in your app.`});function Et(e){let{pointer:t,start:n,rtl:r,gridWidth:i,gap:a,min:o,max:s}=e,c=Math.max(1,Math.floor(e.columns)),l=r?n-t:t-n,u=(i-a*(c-1))/c,d=u+a>0?Math.round((l+a)/(u+a)):o;return Math.max(o,Math.min(s,c,d))}function Dt(e,t,n,r,i){let a;switch(e){case`ArrowRight`:a=t+(i?-1:1);break;case`ArrowLeft`:a=t+(i?1:-1);break;case`ArrowUp`:a=t+1;break;case`ArrowDown`:a=t-1;break;case`Home`:a=n;break;case`End`:a=r;break;default:return null}return Math.max(n,Math.min(r,a))}var Ot=c(`<p class="smrt-widget-form__none svelte-1jw9hhr"> </p>`),kt=c(`<small class="smrt-widget-form__hint svelte-1jw9hhr"> </small>`),At=c(`<small class="smrt-widget-form__error svelte-1jw9hhr" role="alert"> </small>`),jt=c(`<div class="smrt-widget-form__check svelte-1jw9hhr"><!> <!> <!></div>`),Mt=c(`<option> </option>`),Nt=c(`<!> <!>`,1),Pt=c(`<option> </option> <!> <!>`,1),Ft=c(`<!> <!> <!> <!>`,1);function It(r,a){h(a,!0);let{t:o}=ae(),c=n(()=>a.definition.options);function d(){let e={},t={};for(let n of a.definition.options){let r=a.initial[n.key];n.type===`boolean`?t[n.key]=r===!0:e[n.key]=r==null?``:String(r)}return{text:e,flags:t}}let p=F(d),m=j(p.text),v=j(p.flags),y=D(j({})),b=D(!1);function C(){let t={};for(let n of e(c)){if(n.type===`boolean`){t[n.key]=v[n.key]===!0;continue}let e=m[n.key]??``;n.type===`markdown`?t[n.key]=e:e.trim()===``||(n.type===`integer`||n.type===`number`?t[n.key]=Number(e):t[n.key]=e.trim())}return t}let w={required:Z[`ui.overview.issue_required`],invalid_type:Z[`ui.overview.issue_invalid_type`],too_long:Z[`ui.overview.issue_too_long`],out_of_range:Z[`ui.overview.issue_out_of_range`],not_in_choices:Z[`ui.overview.issue_not_in_choices`],invalid_format:Z[`ui.overview.issue_invalid_format`],not_allowed:Z[`ui.overview.issue_not_allowed`],unknown_option:Z[`ui.overview.issue_unknown_option`]};function T(e){return o(w[e]??Z[`ui.overview.issue_invalid_type`])}function E(){let e=C(),t=a.onsave(e);if(t===null)return;let n={};for(let e of t)n[e.key]??=T(e.code);B(y,n,!0),B(b,!0)}let ee=e=>o(e.label),O=e=>e.help?o(e.help):void 0,A=e=>!e.required&&(e.default===void 0||e.default===null),N=n(()=>new Set((a.models??[]).map(e=>e.value))),te=n(()=>a.optionsEditor??a.definition.optionsEditor);var L=S(),z=I(L),ne=t=>{var n=S(),r=I(n);g(r,()=>e(te),(e,t)=>{t(e,{get definition(){return a.definition},get initial(){return a.initial},get models(){return a.models},get onsave(){return a.onsave},get oncancel(){return a.oncancel}})}),x(t,n)},re=r=>{be(r,{onsubmit:E,novalidate:!0,children:(r,i)=>{var d=Ft(),p=I(d),h=e=>{V(e,{variant:`error`,children:(e,t)=>{_();var n=u();R(e=>l(n,e),[()=>o(Z[`ui.overview.options_failed`])]),x(e,n)},$$slots:{default:!0}})};t(p,t=>{e(b)&&t(h)});var g=M(p,2),C=e=>{var t=Ot(),n=P(t,!0);R(e=>l(n,e),[()=>o(Z[`ui.overview.options_none`])]),x(e,t)};t(g,t=>{e(c).length===0&&t(C)});var w=M(g,2);f(w,17,()=>e(c),e=>e.key,(r,i)=>{var c=S(),u=I(c),d=r=>{var a=jt(),o=k(a),c=()=>v[e(i).key]===!0,u=t=>v[e(i).key]=t;{let t=n(()=>ee(e(i)));fe(o,{get name(){return e(i).key},get label(){return e(t)},get checked(){return c()},set checked(e){u(e)}})}var d=M(o,2),f=t=>{var n=kt(),r=P(n,!0);R(e=>l(r,e),[()=>O(e(i))]),x(t,n)},p=n(()=>O(e(i)));t(d,t=>{e(p)&&t(f)});var m=M(d,2),h=t=>{var n=At(),r=P(n,!0);R(()=>l(r,e(y)[e(i).key])),x(t,n)};t(m,t=>{e(y)[e(i).key]&&t(h)}),s(a),x(r,a)},p=r=>{{let s=n(()=>ee(e(i))),c=n(()=>O(e(i)));xe(r,{get label(){return e(s)},get hint(){return e(c)},get error(){return e(y)[e(i).key]},get required(){return e(i).required},children:(r,s)=>{var c=S(),u=I(c),d=t=>{var n=()=>m[e(i).key]??``,r=t=>m[e(i).key]=t;Se(t,{get name(){return e(i).key},rows:6,get value(){return n()},set value(e){r(e)}})},p=r=>{var a=()=>m[e(i).key]??``,s=t=>m[e(i).key]=t;ye(r,{get name(){return e(i).key},get value(){return a()},set value(e){s(e)},children:(r,a)=>{var s=Nt(),c=I(s),u=e=>{var t=Mt(),n=P(t,!0);t.value=t.__value=``,R(e=>l(n,e),[()=>o(Z[`ui.overview.options_choose`])]),x(e,t)},d=n(()=>A(e(i)));t(c,t=>{e(d)&&t(u)});var p=M(c,2);f(p,17,()=>e(i).choices??[],e=>e.value,(t,n)=>{var r=Mt(),i=P(r,!0),a={};R(t=>{l(i,t),a!==(a=e(n).value)&&(r.value=(r.__value=a)??``)},[()=>o(e(n).label)]),x(t,r)}),x(r,s)},$$slots:{default:!0}})},h=r=>{var s=()=>m[e(i).key]??``,c=t=>m[e(i).key]=t;ye(r,{get name(){return e(i).key},get value(){return s()},set value(e){c(e)},children:(r,s)=>{var c=Pt(),u=I(c),d=P(u,!0);u.value=u.__value=``;var p=M(u,2),h=t=>{var n=Mt(),r=P(n,!0),a={};R(()=>{l(r,m[e(i).key]),a!==(a=m[e(i).key])&&(n.value=(n.__value=a)??``)}),x(t,n)},g=n(()=>m[e(i).key]&&!e(N).has(m[e(i).key]));t(p,t=>{e(g)&&t(h)});var _=M(p,2);f(_,17,()=>a.models,e=>e.value,(t,n)=>{var r=Mt(),i=P(r,!0),a={};R(()=>{l(i,e(n).label),a!==(a=e(n).value)&&(r.value=(r.__value=a)??``)}),x(t,r)}),R(e=>l(d,e),[()=>o(Z[`ui.overview.options_choose`])]),x(r,c)},$$slots:{default:!0}})},g=t=>{var r=()=>m[e(i).key]??``,a=t=>m[e(i).key]=String(t);{let o=n(()=>e(i).type===`integer`||e(i).type===`number`?`number`:`text`),s=n(()=>e(i).type===`integer`?`1`:e(i).type===`number`?`any`:void 0),c=n(()=>e(i).type===`text`?e(i).maxLength??200:void 0);Y(t,{get name(){return e(i).key},get type(){return e(o)},get step(){return e(s)},get min(){return e(i).min},get max(){return e(i).max},get maxlength(){return e(c)},get value(){return r()},set value(e){a(e)}})}};t(u,t=>{e(i).type===`markdown`?t(d):e(i).type===`enum`?t(p,1):e(i).type===`model`&&a.models&&a.models.length>0?t(h,2):t(g,-1)}),x(r,c)},$$slots:{default:!0}})}};t(u,t=>{e(i).type===`boolean`?t(d):t(p,-1)}),x(r,c)});var T=M(w,2);Ce(T,{children:(e,t)=>{var n=Nt(),r=I(n);ue(r,{type:`button`,variant:`ghost`,get onclick(){return a.oncancel},children:(e,t)=>{_();var n=u();R(e=>l(n,e),[()=>o(Z[`ui.overview.options_cancel`])]),x(e,n)},$$slots:{default:!0}});var i=M(r,2);ue(i,{type:`submit`,variant:`primary`,children:(e,t)=>{_();var n=u();R(e=>l(n,e),[()=>o(Z[`ui.overview.options_save`])]),x(e,n)},$$slots:{default:!0}}),x(e,n)},$$slots:{default:!0}}),x(r,d)},$$slots:{default:!0}})};t(z,t=>{e(te)?t(ne):t(re,-1)}),x(r,L),i()}var Lt=c(`<p class="smrt-overview__state svelte-1liasmg"> </p>`),Rt=c(`<p class="smrt-overview__state svelte-1liasmg" role="status"> </p> <!>`,1),zt=c(`<article class="smrt-overview__widget svelte-1liasmg"><!> <div class="smrt-overview__content"><!></div></article>`),Bt=c(`<div class="smrt-overview__toolbar svelte-1liasmg" role="toolbar"><!> <!></div>`),Vt=c(`<p class="smrt-overview__empty svelte-1liasmg"> </p>`),Ht=c(`<div class="smrt-overview__resize svelte-1liasmg" role="slider" tabindex="0" aria-orientation="horizontal"></div>`),Ut=c(`<div class="smrt-overview__chrome svelte-1liasmg"><button type="button" class="smrt-overview__handle svelte-1liasmg" data-smrt-overview-handle=""><span aria-hidden="true">⠿</span></button> <span class="smrt-overview__chrome-title svelte-1liasmg" aria-hidden="true"> </span> <!> <!></div> <div class="smrt-overview__inert" inert=""><!></div> <!>`,1),Wt=c(`<div role="listitem" class="smrt-overview__item svelte-1liasmg"><div class="smrt-overview__tile svelte-1liasmg"><!></div></div>`),Gt=c(`<p> </p>`),Kt=c(`<small class="svelte-1liasmg"> </small>`),qt=c(`<span class="smrt-overview__choice svelte-1liasmg"><!> <span class="smrt-overview__choice-text svelte-1liasmg"><strong> </strong> <!></span></span>`),Jt=c(`<li><!></li>`),Yt=c(`<ul class="smrt-overview__choices svelte-1liasmg"></ul>`),Xt=c(`<!> <!>`,1),Zt=c(`<div class="smrt-overview svelte-1liasmg" data-smrt-component="OverviewGrid"><!> <!> <div class="smrt-overview__list svelte-1liasmg" role="list"></div> <div class="smrt-overview__live svelte-1liasmg" role="status" aria-live="polite" aria-atomic="true"> </div></div> <!>`,1);function Qt(r,a){let c=L();h(a,!0);let d=(r,i=p)=>{let d=n(()=>a.components?.get(i().widget.type)??i().def?.component);var f=zt(),m=k(f);N(m,()=>e(Fe),!1,(e,n)=>{A(e,()=>({class:`smrt-overview__title`,id:`${c}-title-${i().widget.id??``}`}),void 0,void 0,void 0,`svelte-1liasmg`);var r=S(),s=I(r),d=e=>{var t=S(),n=I(t);o(n,()=>a.heading,()=>i().widget,()=>i().title),x(e,t)},f=e=>{var t=u();R(()=>l(t,i().title)),x(e,t)};t(s,e=>{a.heading?e(d):e(f,-1)}),x(n,r)});var h=M(m,2),v=k(h),b=e=>{var t=Lt(),n=P(t,!0);R(e=>l(n,e),[()=>w(Z[`ui.overview.unavailable`])]),x(e,t)},C=e=>{var t=Lt(),n=P(t,!0);R(e=>l(n,e),[()=>w(Z[`ui.overview.loading`])]),x(e,t)},T=e=>{var t=Rt(),n=I(t),r=P(n,!0),o=M(n,2);ue(o,{type:`button`,variant:`ghost`,size:`sm`,onclick:()=>a.controller.reload(i().widget.id),children:(e,t)=>{_();var n=u();R(e=>l(n,e),[()=>w(Z[`ui.overview.retry`])]),x(e,n)},$$slots:{default:!0}}),R(e=>l(r,e),[()=>w(Z[`ui.overview.error`])]),x(e,t)},E=t=>{var r=S(),o=I(r);{let t=n(()=>be(i())),r=n(()=>e(V)?`card`:y());g(o,()=>e(d),(n,o)=>{o(n,{get id(){return i().widget.id},get options(){return i().widget.options},get data(){return i().data},get span(){return e(t)},get title(){return i().title},get locale(){return j},get iconComponent(){return a.iconComponent},get presentation(){return e(r)}})})}x(t,r)},D=e=>{var t=Lt(),n=P(t,!0);R(e=>l(n,e),[()=>w(Z[`ui.overview.unavailable`])]),x(e,t)};t(v,t=>{i().def?i().status===`loading`?t(C,1):i().status===`error`?t(T,2):e(d)?t(E,3):t(D,-1):t(b)}),s(h),s(f),R(()=>{z(f,`aria-labelledby`,`${c}-title-${i().widget.id??``}`),z(h,`aria-busy`,i().status===`loading`)}),x(r,f)},v=E(a,`headingLevel`,3,2),y=E(a,`presentation`,3,`card`),{t:w,locale:j}=ae(),te=`__smrt-overview__`,re=he(),V=n(()=>a.controller.canCustomize&&(a.editing??re?.editing??!1)),ie=n(()=>a.label??w(Z[`ui.overview.label`])),U=n(()=>a.controller.registry),oe=n(()=>a.controller.document.widgets.map(t=>{let n=e(U).get(t.type),r=typeof t.options.title==`string`?t.options.title.trim():``,i=a.controller.entry(t);return{widget:t,def:n,title:r||(n?w(n.title):t.type),status:i.status,data:i.data}})),se=n(()=>new Map(e(oe).map(e=>[e.widget.id,e])));ee(()=>{a.controller.document,F(()=>a.controller.sync())});let W=D(void 0),G=D(void 0),ce=D(``),K=D(null),le=D(!1),q=D(null);function J(e){B(ce,e,!0)}function de(e){switch(e.type){case`pickup`:return w(Z[`ui.overview.announce_pickup`],{widget:e.item});case`position`:return w(Z[`ui.overview.announce_position`],{widget:e.item,position:e.position,count:e.count});case`drop`:return w(Z[`ui.overview.announce_drop`],{widget:e.item,position:e.position,count:e.count});case`cancel`:return w(Z[`ui.overview.announce_cancel`],{widget:e.item});case`failed`:return w(Z[`ui.overview.announce_failed`],{widget:e.item});default:return``}}let Y=pe({root:()=>e(W),selectors:{container:`[data-smrt-overview-list]`,containerKey:`smrtOverviewList`,item:`[data-smrt-overview-item]`,itemKey:`smrtOverviewItem`},containers:()=>[{id:te,label:e(ie)}],itemIds:()=>e(oe).map(e=>e.widget.id),itemLabel:t=>e(se).get(t)?.title,allowSameContainerReorder:()=>!0,enabled:()=>e(V),orientation:()=>`vertical`,flow:()=>!0,announce:de,focusTarget:e=>e.querySelector(`[data-smrt-overview-handle]`),commit(e){let t=a.controller.move(e.itemId,e.target.index);if(!t.ok&&t.reason!==`unchanged`)throw Error(t.reason)}}),fe=n(()=>Y.drag?.itemId),ge=n(()=>Y.drag?.target.index),ve=n(()=>e(oe).filter(t=>t.widget.id!==e(fe)).length);function ye(t){if(e(ge)===void 0||e(fe)===void 0||e(oe)[t].widget.id===e(fe))return;let n=0;for(let r=0;r<t;r+=1)e(oe)[r].widget.id!==e(fe)&&(n+=1);if(n===e(ge))return`before`;if(e(ge)>=e(ve)&&n===e(ve)-1)return`after`}function be(t){return e(K)?.id===t.widget.id?e(K).span:t.widget.span}function xe(){return e(W)!==void 0&&getComputedStyle(e(W)).direction===`rtl`}function Se(e,t){let n=a.controller.resize(e.widget.id,t);n.ok?J(w(Z[`ui.overview.announce_resized`],{widget:e.title,span:t,max:e.def?.maxSpan??4})):n.reason===`not_allowed`&&J(w(Z[`ui.overview.announce_denied`]))}function Ce(e,t){if(!t.def)return;let n=Dt(e.key,t.widget.span,t.def.minSpan,t.def.maxSpan,xe());n!==null&&(e.preventDefault(),n!==t.widget.span&&Se(t,n))}function we(e,t){e.button===0&&t.def&&(e.preventDefault(),e.currentTarget.setPointerCapture?.(e.pointerId),B(K,{id:t.widget.id,span:t.widget.span},!0))}function Te(t,n){if(e(K)?.id!==n.widget.id||!n.def||!e(G))return;let r=t.currentTarget.closest(`[data-smrt-overview-item]`);if(!r)return;let i=e(G).getBoundingClientRect(),a=r.getBoundingClientRect(),o=xe(),s=getComputedStyle(e(G)).gridTemplateColumns.split(` `).filter(Boolean).length,c=Et({pointer:t.clientX,start:o?a.right:a.left,rtl:o,gridWidth:i.width,columns:s||1,gap:0,min:n.def.minSpan,max:n.def.maxSpan});c!==e(K).span&&B(K,{id:n.widget.id,span:c},!0)}function Ee(t,n){if(e(K)?.id!==n.widget.id)return;let r=e(K).span;B(K,null);let i=t.currentTarget;i.hasPointerCapture?.(t.pointerId)&&i.releasePointerCapture(t.pointerId),r!==n.widget.span&&Se(n,r)}function De(e){a.controller.remove(e.widget.id).ok&&J(w(Z[`ui.overview.announce_removed`],{widget:e.title}))}function Oe(){a.controller.reset().ok&&J(w(Z[`ui.overview.announce_reset`]))}function ke(e){B(q,{id:e.widget.id,type:e.widget.type,initial:e.widget.options},!0)}function Ae(t){let n=e(U).get(t);return n?w(n.title):t}function je(t){let n=a.controller.add(t);if(B(le,!1),n.ok)J(w(Z[`ui.overview.announce_added`],{widget:Ae(t)}));else if(n.reason===`invalid_options`){let n=e(U).get(t);B(q,{id:null,type:t,initial:n?Ie(n.options):{}},!0)}}function Me(t){let n=e(q);if(!n)return null;let r=n.id===null?a.controller.add(n.type,t):a.controller.setOptions(n.id,t);return r.ok?(J(w(Z[n.id===null?`ui.overview.announce_added`:`ui.overview.announce_configured`],{widget:Ae(n.type)})),B(q,null),null):r.reason===`invalid_options`?r.issues??[]:(r.reason===`not_allowed`&&J(w(Z[`ui.overview.announce_denied`])),B(q,null),null)}let Ne=n(()=>e(q)?e(U).get(e(q).type):void 0),Pe=n(()=>e(q)?w(Z[e(q).id===null?`ui.overview.options_new_title`:`ui.overview.options_title`],{widget:Ae(e(q).type)}):``),Fe=n(()=>`h${v()}`);var Le=Zt(),Re=I(Le),ze=k(Re),Be=t=>{var r=Bt(),i=k(r);{let t=n(()=>w(Z[`ui.overview.add`])),r=n(()=>a.controller.full||a.controller.addable.length===0);_e(i,{icon:`add`,get label(){return e(t)},get disabled(){return e(r)},onclick:()=>B(le,!0)})}var o=M(i,2);{let t=n(()=>w(Z[`ui.overview.reset`])),r=n(()=>!a.controller.customized);_e(o,{icon:`undo`,get label(){return e(t)},get disabled(){return e(r)},onclick:Oe})}s(r),R(e=>z(r,`aria-label`,e),[()=>w(Z[`ui.overview.toolbar`])]),x(t,r)};t(ze,t=>{e(V)&&t(Be)});var Ve=M(ze,2),He=e=>{var t=Vt(),n=P(t,!0);R(e=>l(n,e),[()=>w(Z[`ui.overview.empty`])]),x(e,t)};t(Ve,t=>{e(V)&&e(oe).length===0&&t(He)});var Ue=M(Ve,2);z(Ue,`data-smrt-overview-list`,te),f(Ue,31,()=>e(oe),e=>e.widget.id,(r,i,a)=>{let o=n(()=>ye(e(a)));var c=Wt();let u;var f=k(c),p=k(f),h=r=>{var a=Ut(),o=I(a),c=k(o),u=M(c,2),f=P(u,!0),p=M(u,2),m=t=>{{let r=n(()=>w(Z[`ui.overview.configure`],{widget:e(i).title}));_e(t,{icon:`settings`,get label(){return e(r)},onclick:()=>ke(e(i))})}};t(p,t=>{e(i).def&&e(i).def.options.length>0&&t(m)});var h=M(p,2);{let t=n(()=>w(Z[`ui.overview.remove`],{widget:e(i).title}));_e(h,{icon:`trash`,get label(){return e(t)},onclick:()=>De(e(i))})}s(o);var g=M(o,2),_=k(g);d(_,()=>e(i)),s(g);var v=M(g,2),y=t=>{var n=Ht();R((t,r,a)=>{z(n,`aria-label`,t),z(n,`aria-valuemin`,e(i).def.minSpan),z(n,`aria-valuemax`,e(i).def.maxSpan),z(n,`aria-valuenow`,r),z(n,`aria-valuetext`,a)},[()=>w(Z[`ui.overview.resize`],{widget:e(i).title}),()=>be(e(i)),()=>w(Z[`ui.overview.resize_value`],{span:be(e(i)),max:e(i).def.maxSpan})]),C(`keydown`,n,t=>Ce(t,e(i))),C(`pointerdown`,n,t=>we(t,e(i))),C(`pointermove`,n,t=>Te(t,e(i))),C(`pointerup`,n,t=>Ee(t,e(i))),T(`pointercancel`,n,t=>Ee(t,e(i))),x(t,n)};t(v,t=>{e(i).def&&t(y)}),R(t=>{z(c,`draggable`,Y.nativeDraggable),z(c,`aria-label`,t),z(c,`aria-pressed`,e(fe)===e(i).widget.id),z(u,`title`,e(i).title),l(f,e(i).title)},[()=>w(Z[`ui.overview.move`],{widget:e(i).title})]),C(`click`,c,()=>Y.consumeClick(e(i).widget.id)),C(`keydown`,c,t=>Y.keydown(t,e(i).widget.id)),T(`blur`,c,t=>Y.blur(t,e(i).widget.id)),C(`pointerdown`,c,t=>Y.pointerDown(t,e(i).widget.id)),C(`pointermove`,c,e=>Y.pointerMove(e)),C(`pointerup`,c,e=>Y.pointerUp(e)),T(`pointercancel`,c,e=>Y.pointerCancel(e)),T(`dragstart`,c,t=>Y.dragStart(t,e(i).widget.id)),T(`dragend`,c,()=>Y.dragEnd()),x(r,a)},g=t=>{d(t,()=>e(i))};t(p,t=>{e(V)?t(h):t(g,-1)}),s(f),s(c),R((t,n)=>{z(c,`data-span`,t),z(c,`data-smrt-overview-item`,e(i).widget.id),z(c,`data-dragging`,e(fe)===e(i).widget.id?``:void 0),z(c,`data-drop`,e(o)),u=b(c,``,u,{"--smrt-overview-grid-span":n})},[()=>be(e(i)),()=>be(e(i))]),T(`dragover`,c,e=>e.preventDefault()),T(`drop`,c,t=>{Y.drag&&(t.stopPropagation(),Y.dropOnItem(t,te,e(a)))}),m(c,()=>me,null),x(r,c)}),s(Ue),O(Ue,e=>B(G,e),()=>e(G));var We=M(Ue,2),Ge=P(We);s(Re),O(Re,e=>B(W,e),()=>e(W));var Ke=M(Re,2),qe=r=>{var i=Xt(),o=I(i),c=()=>e(le),u=e=>B(le,e,!0);{let r=n(()=>w(Z[`ui.overview.add_title`]));H(o,{get open(){return c()},set open(e){u(e)},get title(){return e(r)},size:`sm`,children:(n,r)=>{var i=S(),o=I(i),c=e=>{var t=Gt(),n=P(t,!0);R(e=>l(n,e),[()=>w(Z[`ui.overview.add_none`])]),x(e,t)},u=n=>{var r=Yt();f(r,21,()=>a.controller.addable,e=>e.type,(n,r)=>{var i=Jt(),o=k(i);ue(o,{type:`button`,variant:`ghost`,fullWidth:!0,onclick:()=>je(e(r).type),children:(n,i)=>{var o=qt(),c=k(o),u=t=>{X(t,{get name(){return e(r).icon},get iconComponent(){return a.iconComponent}})};t(c,t=>{e(r).icon&&t(u)});var d=M(c,2),f=k(d),p=P(f,!0),m=M(f,2),h=t=>{var n=Kt(),i=P(n,!0);R(e=>l(i,e),[()=>w(e(r).description)]),x(t,n)};t(m,t=>{e(r).description&&t(h)}),s(d),s(o),R(e=>l(p,e),[()=>w(e(r).title)]),x(n,o)},$$slots:{default:!0}}),s(i),x(n,i)}),s(r),x(n,r)};t(o,e=>{a.controller.addable.length===0||a.controller.full?e(c):e(u,-1)}),x(n,i)},$$slots:{default:!0}})}var d=M(o,2),p=()=>e(q)!==null,m=e=>{e||B(q,null)};H(d,{get open(){return p()},set open(e){m(e)},get title(){return e(Pe)},size:`md`,children:(r,i)=>{var o=S(),s=I(o),c=t=>{var r=S(),i=I(r);ne(i,()=>`${e(q).id??`new`}:${e(q).type}`,t=>{{let r=n(()=>a.optionEditors?.get(e(q).type)??e(Ne).optionsEditor);It(t,{get definition(){return e(Ne)},get initial(){return e(q).initial},get models(){return a.models},get optionsEditor(){return e(r)},onsave:Me,oncancel:()=>B(q,null)})}}),x(t,r)};t(s,t=>{e(q)&&e(Ne)&&t(c)}),x(r,o)},$$slots:{default:!0}}),x(r,i)};t(Ke,t=>{e(V)&&t(qe)}),R(()=>{z(Re,`data-editing`,e(V)?``:void 0),z(Re,`data-presentation`,y()),z(Ue,`aria-label`,e(ie)),l(Ge,`${e(ce)??``}${Y.announcement?` ${Y.announcement}`:``}`)}),T(`dragover`,Ue,e=>e.preventDefault()),T(`drop`,Ue,e=>{Y.drag&&Y.dropOnContainer(e,te)}),x(r,Le),i()}w([`click`,`keydown`,`pointerdown`,`pointermove`,`pointerup`]);var $t=[`title`,`identifier`,`status`,`money`,`quantity`,`date`,`party`,`subtotal`,`tax`,`discount`,`total`],en=new Set([`integer`,`decimal`]),tn=new Set([`foreignKey`,`crossPackageRef`]),nn=/(?:^|[a-z])(?:amount|total|price|cost)$|^(?:subtotal|tax|discount)$/i,rn=/^subtotal(?:Amount)?$|[a-z]Subtotal(?:Amount)?$/,an=/^tax(?:Amount|Total)?$|[a-z]Tax(?:Amount|Total)?$/,on=/^discount(?:Amount|Total)?$|[a-z]Discount(?:Amount|Total)?$/,sn=/^(?:total|grandTotal)(?:Amount)?$|^amountTotal$/,cn=/(?:rate|percent|percentage|pct|ratio)$/i,ln=/^(?:status|state)$|[a-z](?:Status|State)$/,un=/^(?:number|reference|code|ref)$|[a-z](?:Number|Reference|Code)$/,dn=/^(?:phone|mobile|fax|postal|zip|country|currency|language|locale|tax|vat|account|routing|card|area|promo|coupon|discount|sort|tracking|billing|shipping|iban|swift|bank|unit|line|street|house|building)/i,fn=/^date$|[a-z](?:At|Date|On|Until)$/,pn=/^(?:quantity|qty)|(?:Quantity|Qty)$/,mn=[`name`,`title`,`label`,`displayName`],hn=/customer|vendor|supplier|client|party|profile|contact|person|people|member|company|organi[sz]ation|payer|payee|buyer|seller|licensee|lessee/i;function gn(e){let t=e.role;return t===void 0?null:(Array.isArray(t)?t:[t]).filter(e=>$t.includes(e))}function _n(e){return e.format??e.ui?.format}function vn(e){return _n(e)===`money`||e.type===`integer`&&e.ui?.widget===`currency`}function yn(e){return Array.isArray(e.enum)&&e.enum.length>0}function bn(e,t){return e?.find(e=>e.field===t)}function xn(e,t,n){let r=[],{type:i}=t,a=en.has(i),o=cn.test(e);if(i===`text`&&(yn(t)&&ln.test(e)&&r.push(`status`),un.test(e)&&!dn.test(e)&&t.ui?.widget!==`phone`&&r.push(`identifier`)),i===`integer`&&!o&&nn.test(e)&&r.push(`money`),a&&pn.test(e)&&r.push(`quantity`),i===`datetime`&&fn.test(e)&&r.push(`date`),tn.has(i)){let t=n?.relatedCollection??``,i=e.replace(/Id$/,``);i!==`tenant`&&(hn.test(i)||hn.test(t))&&r.push(`party`)}return a&&!o&&(rn.test(e)?r.push(`subtotal`):an.test(e)?r.push(`tax`):on.test(e)?r.push(`discount`):sn.test(e)&&r.push(`total`)),r}function Sn(e){let t=new Set(e);return $t.filter(e=>t.has(e))}function Cn(e){let t={},n=Object.entries(e.fields).filter(([e])=>!e.startsWith(`_`)&&!e.startsWith(`$`)),r=n.some(([,e])=>e.display===!0);for(let[r,i]of n){let n=new Set,a=gn(i);if(a)for(let e of a)n.add(e);else for(let t of xn(r,i,bn(e.relationships,r)))n.add(t);vn(i)&&n.add(`money`);let o=_n(i);(o===`date`||o===`datetime`)&&i.type===`datetime`&&n.add(`date`),i.display===!0&&n.add(`title`),t[r]=Sn(n)}if(!r&&!Object.values(t).some(e=>e.includes(`title`)))for(let n of mn){let r=e.fields[n];if(r?.type===`text`&&gn(r)===null){t[n]=Sn([...t[n]??[],`title`]);break}}return t}function wn(e,t){return Object.keys(e).find(n=>e[n]?.includes(t))}function Tn(e){let t=Object.entries(e.fields);return t.find(([,e])=>e.type===`text`&&e.ui?.widget===`currency`)?.[0]??t.find(([e,t])=>t.type===`text`&&/^currency(?:Code)?$/.test(e))?.[0]}function En(e){return wn(e,`identifier`)!==void 0&&(wn(e,`party`)!==void 0||wn(e,`total`)!==void 0)}var Dn=new Set([`id`,`tenantId`,`createdAt`,`updatedAt`,`createdBy`,`updatedBy`]),On=[`createdAt`,`updatedAt`];function kn(e){let t=e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1 $2`).replace(/[_-]+/g,` `).trim();if(t===``)return e;let n=t.toLowerCase();return n.charAt(0).toUpperCase()+n.slice(1)}function An(e,t){return(t.type===`foreignKey`||t.type===`crossPackageRef`)&&/.[a-z]Id$/.test(e)?kn(e.slice(0,-2)):kn(e)}function jn(e){let t=kn(e.className),n=t.slice(-1);return{singular:t,plural:/(s|x|z|ch|sh)$/i.test(t)?`${t}es`:/[^aeiou]y$/i.test(t)?`${t.slice(0,-1)}ies`:n===``?t:`${t}s`}}function Mn(e,t){let n=e.ui?.widget;if(e.type===`text`)return Array.isArray(e.enum)&&e.enum.length>0?`select`:n===`textarea`?`textarea`:n===`email`?`email`:n===`url`?`url`:n===`phone`?`tel`:`text`;if(e.type===`integer`)return t?.includes(`money`)??(n===`currency`||(e.format??e.ui?.format)===`money`)?`money`:`integer`;switch(e.type){case`decimal`:return`decimal`;case`boolean`:return`boolean`;case`datetime`:return`datetime`;case`json`:return`json`;default:return`reference`}}function Nn(e,t){return t===void 0?e.required===!0&&e.nullable!==!0:t}function Pn(e,t){return t&&t.objectRef!==e.objectRef?`Field policy is for '${t.objectRef}', not '${e.objectRef}'.`:null}function Fn(e){return!e.startsWith(`_`)&&!e.startsWith(`$`)}function In(e){let t=e.some(e=>e.definition.ui?.basic===!0),n=new Set;for(let r of e)(r.definition.ui?.basic===!0||r.definition.ui?.basic!==!1&&!t)&&n.add(r.name);return n}function Ln(e,t){return(e.order??2**53-1)-(t.order??2**53-1)||e.index-t.index}function Rn(e,t,n){let{mode:r,include:i,exclude:a}=n,o=new Set(a??[]),s=Object.entries(e.fields).map(([e,t],n)=>({name:e,definition:t,index:n})).filter(t=>Fn(t.name)&&!Dn.has(t.name)&&t.name!==e.idField),c=t?null:In(s),l=Cn(e),u=e=>{let n=t?.fields[e.name];if(t&&!n)return null;let r=n?n.visibility:c?.has(e.name)?`basic`:`advanced`;if(r===`hidden`)return null;let i=n?.label?.trim(),a=n?.help??e.definition.description??null,o=l[e.name]??[],s=Mn(e.definition,o);return{name:e.name,label:i||An(e.name,e.definition),help:a&&a.trim()!==``?a:null,type:e.definition.type,kind:s,required:Nn(e.definition,n?.required),tier:r,group:n?.group??e.definition.ui?.group??null,order:n?.order??e.definition.ui?.order??null,definition:e.definition,roles:o,...s===`select`?{options:[...e.definition.enum??[]]}:{}}},d=s.map(e=>({c:e,field:u(e)})).filter(e=>e.field!==null).filter(e=>!o.has(e.c.name)),f=t=>{let n=e.fields[t];return!n||o.has(t)?null:{name:t,label:kn(t),help:null,type:n.type,kind:`datetime`,required:!1,tier:`advanced`,group:null,order:null,definition:n,roles:l[t]??[]}};if(i){let e=new Map(d.map(e=>[e.c.name,e.field])),t=[];for(let n of i){if(o.has(n))continue;if(r!==`edit`&&On.includes(n)){let e=f(n);e&&t.push(e);continue}let i=e.get(n);i&&t.push(i)}return t}let p=d.map(e=>e.field).map((e,t)=>({field:e,order:e.order,index:t})).sort(Ln).map(e=>e.field);if(r===`list`){let e=n.maxListColumns??6;return p.filter(e=>e.tier===`basic`&&e.kind!==`json`&&e.kind!==`textarea`&&e.kind!==`reference`).slice(0,Math.max(0,e))}if(r===`view`){let e=On.map(f).filter(e=>e!==null);return[...p,...e]}return p}function zn(e){let t=new Map;for(let n of e){let e=t.get(n.group)??[];e.push(n),t.set(n.group,e)}return[...t.entries()]}function Bn(e){return`${e.model.split(/[:/]/).pop()??e.model}-${e.field}`.replace(/[^A-Za-z0-9_.-]+/g,`-`).slice(0,64)}function Vn(e){return de.get(e.trim().toUpperCase())??2}function Hn(e,t){if(typeof e!=`number`||!Number.isSafeInteger(e))return null;let n=e<0,r=String(Math.abs(e)),i;if(t<=0)i=r;else{let e=r.padStart(t+1,`0`);i=`${e.slice(0,-t)}.${e.slice(-t)}`}return n?`-${i}`:i}function Un(e,t){let n=e.trim().replace(/[,\s]/g,``),r=(t>0?/^(-?)(\d+)(?:\.(\d*))?$/:/^(-?)(\d+)$/).exec(n);if(!r)return null;let[,i,a,o=``]=r;if(o.length>Math.max(0,t))return null;let s=Number(`${a}${o.padEnd(Math.max(0,t),`0`)}`);return Number.isSafeInteger(s)?i===`-`&&s!==0?-s:s:null}function Wn(e){return String(e).padStart(2,`0`)}function Gn(e){if(e==null||e===``)return``;let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?``:`${t.getFullYear()}-${Wn(t.getMonth()+1)}-${Wn(t.getDate())}T${Wn(t.getHours())}:${Wn(t.getMinutes())}`}function Kn(e,t,n={}){if(e.kind===`boolean`)return t===!0||t===`true`;if(t==null)return``;switch(e.kind){case`money`:return Hn(t,Vn(n.currency??`USD`))??``;case`datetime`:return Gn(t);case`json`:return typeof t==`string`?t:JSON.stringify(t,null,2);default:return String(t)}}function qn(e,t,n={}){let r={};for(let i of e)r[i.name]=Kn(i,t[i.name],n);return r}function Jn(e,t,n={}){let r={};for(let i of e){let e=t?.fields[i.name],a=e?.hasDefault===!0?e.defaultValue:i.definition.default;r[i.name]=Kn(i,a,n)}return r}function Yn(e,t,n={}){let r={},i={},a=Vn(n.currency??`USD`);for(let o of e){let e=t[o.name];if(o.kind===`boolean`){r[o.name]=e===!0||e===`true`;continue}let s=typeof e==`string`?e:``,c=s.trim();if(c===``)o.required?i[o.name]=`required`:(o.kind===`text`||o.kind===`textarea`||o.kind===`email`||o.kind===`url`||o.kind===`tel`||o.kind===`select`)&&o.definition.nullable!==!0?r[o.name]=``:r[o.name]=null;else switch(o.kind){case`integer`:{let e=/^-?\d+$/.test(c)?Number(c):NaN;Number.isSafeInteger(e)?r[o.name]=e:i[o.name]=`invalid_integer`;break}case`decimal`:{let e=Number(c);Number.isFinite(e)?r[o.name]=e:i[o.name]=`invalid_decimal`;break}case`money`:{let e=Un(c,a);e===null?i[o.name]=`invalid_money`:r[o.name]=e;break}case`datetime`:{let e=n.record?.[o.name],t=e==null||e===``?null:e instanceof Date?e:new Date(e);if(t&&!Number.isNaN(t.getTime())&&c===Gn(t)){r[o.name]=t.toISOString();break}let a=new Date(c);Number.isNaN(a.getTime())?i[o.name]=`invalid_datetime`:r[o.name]=a.toISOString();break}case`json`:try{r[o.name]=JSON.parse(c)}catch{i[o.name]=`invalid_json`}break;case`reference`:r[o.name]=c;break;default:r[o.name]=s}}return{values:r,errors:i}}function Xn(e,t,n={}){let r=e.definition?.format??e.definition?.ui?.format;if(e.kind===`boolean`)return t==null?``:t===!0||t===`true`?n.yes??`Yes`:n.no??`No`;if(t==null||t===``)return``;try{switch(e.kind){case`integer`:return typeof t==`number`?new Intl.NumberFormat(n.locale,{maximumFractionDigits:0}).format(t):String(t);case`decimal`:return r===`percent`&&typeof t==`number`?new Intl.NumberFormat(n.locale,{style:`percent`,maximumFractionDigits:4}).format(t):typeof t==`number`?new Intl.NumberFormat(n.locale,{maximumFractionDigits:6}).format(t):String(t);case`money`:{let e=(n.currency??`USD`).trim().toUpperCase(),r=Vn(e);return typeof t!=`number`||!Number.isSafeInteger(t)?String(t):new Intl.NumberFormat(n.locale,{style:`currency`,currency:e}).format(t/10**r)}case`datetime`:{let e=t instanceof Date?t:new Date(t);return Number.isNaN(e.getTime())?String(t):new Intl.DateTimeFormat(n.locale,{dateStyle:`medium`,...r===`date`?{}:{timeStyle:`short`},...n.timeZone?{timeZone:n.timeZone}:{}}).format(e)}case`json`:{let e=Zn(t);return er(e)?``:typeof e==`string`?e:JSON.stringify(e)}default:return String(t)}}catch{return String(t)}}function Zn(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.parse(t)}catch{return e}}function Qn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $n(e){return e==null||e===``}function er(e){return $n(e)?!0:Array.isArray(e)?e.length===0:Qn(e)?Object.values(e).every($n):!1}function tr(e){let t=Zn(e);if(!Qn(t))return null;let n=[];for(let[e,r]of Object.entries(t))$n(r)||n.push({key:e,value:typeof r==`object`&&r?JSON.stringify(r):String(r)});return n.length>0?n:null}function nr(e){return e.length>12?`${e.slice(0,8)}…`:e}function rr(e,t){let n=[];for(let r of e)if(!(t&&r.id!==t))for(let e of r.items){if(e.hidden)continue;let t=St(e.item.href);t&&n.push({id:e.id,label:e.label,href:t,...e.item.icon?{icon:e.item.icon}:{},...e.item.description?{description:e.item.description}:{}})}return{items:n}}function Q(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ir=/^[A-Za-z_][A-Za-z0-9_.-]{0,63}$/;function ar(e,t=6){if(typeof e!=`string`)return[];let n=[];for(let r of e.split(`,`)){let e=r.trim();if(ir.test(e)&&!n.includes(e)&&(n.push(e),n.length===t))break}return n}function or(e){return e.join(`,`)}var sr={active:`success`,accepted:`success`,approved:`success`,completed:`success`,confirmed:`success`,delivered:`success`,fulfilled:`success`,paid:`success`,settled:`success`,shipped:`success`,open:`info`,pending:`info`,processing:`info`,sent:`info`,viewed:`info`,partial:`warning`,overdue:`warning`,on_hold:`warning`,suspended:`warning`,declined:`error`,failed:`error`,rejected:`error`,refunded:`default`,cancelled:`default`,canceled:`default`,draft:`default`,inactive:`default`,void:`default`,written_off:`default`};function cr(e,t){if(typeof e!=`string`)return`default`;let n=e.trim().toLowerCase().replace(/[\s-]+/g,`_`);return t?.[e]??t?.[n]??sr[n]??`default`}function lr(e){return typeof e!=`string`||e.trim()===``?``:kn(e.trim())}function ur(e,t,n={}){if(t==null||t===``)return``;switch(e.role){case`money`:return Xn({kind:`money`},t,{currency:n.currency,locale:n.locale});case`date`:return typeof t==`string`&&!/^\d{4}-\d{2}-\d{2}/.test(t)?t:Xn({kind:`datetime`,definition:{format:`date`}},t,{locale:n.locale,timeZone:n.timeZone??`UTC`});case`quantity`:return Xn({kind:`decimal`},t,{locale:n.locale});case`status`:return lr(t);default:return typeof t==`number`?Xn({kind:`decimal`},t,{locale:n.locale}):typeof t==`boolean`?t?`✓`:``:typeof t==`string`?t:JSON.stringify(t)}}function dr(e){return e===`money`||e===`quantity`}function fr(e){return e.summarize??dr(e.role)}function pr(e){if(!Q(e)||!Array.isArray(e.rows))return[];let t=[];for(let n of e.rows.slice(0,50)){if(!Q(n))continue;let e=Q(n.cells)?n.cells:void 0;(typeof n.title==`string`||e)&&t.push({id:typeof n.id==`string`?n.id:String(t.length),title:typeof n.title==`string`?n.title:``,...typeof n.subtitle==`string`?{subtitle:n.subtitle}:{},...typeof n.meta==`string`?{meta:n.meta}:{},...typeof n.href==`string`?{href:n.href}:{},...e?{cells:e}:{}})}return t}var mr=new Set([`title`,`identifier`,`status`,`money`,`quantity`,`date`,`party`,`subtotal`,`tax`,`discount`,`total`]);function hr(e,t){let n=[];if(Array.isArray(t))for(let e of t)Q(e)&&typeof e.key==`string`&&ir.test(e.key)&&n.push({key:e.key,label:typeof e.label==`string`&&e.label!==``?e.label:kn(e.key),...typeof e.role==`string`&&mr.has(e.role)?{role:e.role}:{},...typeof e.summarize==`boolean`?{summarize:e.summarize}:{}});return(e.length>0?e:n.map(e=>e.key)).slice(0,6).map(e=>n.find(t=>t.key===e)??{key:e,label:kn(e)})}var gr=[`related`,`line-items`,`records`,`metric`,`chart`,`note`];function _r(e){return`detail:${e.replace(/^@/,``).replace(/[/:]+/g,`.`).replace(/[^A-Za-z0-9_.-]/g,`-`).replace(/^[^A-Za-z0-9]+/,``)||`record`}`}function vr(e,t,n){let r=`${e}-${Bn(t)}`.replace(/[^A-Za-z0-9_-]+/g,`-`).slice(0,60),i=r;for(let e=2;n.has(i);e+=1)i=`${r}-${e}`;return n.add(i),i}function yr(e,t,n={}){let r=t.filter(e=>e.kind===`children`),i=t.filter(e=>e.kind===`items`),a=[],o=[],s=new Set;for(let e of[...i,...r])o.includes(e.model)||o.push(e.model);if(n.metrics!==!1){let e=n.maxMetrics??4,t=[];for(let n of r){if(t.length>=e)break;t.push({id:vr(`count`,n,s),type:`metric`,span:1,options:{title:n.label,model:n.model,measure:`count`,field:n.field,filter:`parent`}});let r=(n.columns??[]).find(e=>e.role===`money`);!r||t.length>=e||t.push({id:vr(`sum`,n,s),type:`metric`,span:1,options:{title:`${n.label} · ${r.label}`,model:n.model,measure:`sum`,field:r.key,filter:`parent`,parentField:n.field}})}a.push(...t)}let c=i[0];if(c&&a.push({id:vr(`items`,c,s),type:`line-items`,span:4,options:{title:c.label,relation:Bn(c)}}),n.related===`panels`)for(let e of r)a.push({id:vr(`records`,e,s),type:`records`,span:2,options:{title:e.label,model:e.model,field:e.field,filter:`parent`,sort:`createdAt`,direction:`desc`,limit:5,...(e.columns??[]).length>0?{columns:or((e.columns??[]).map(e=>e.key))}:{}}});else r.length>0&&(s.add(`related`),a.push({id:`related`,type:`related`,span:4,options:{limit:5}}));return rt({id:n.id??_r(e.objectRef),allowed:gr,models:o.length>0?o:void 0,defaults:a})}function br(e){return e===`exclusive`||e===`inclusive`||e===`none`}function xr(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return br(t.lineAmountType)&&(t.roundingScope===`line`||t.roundingScope===`document`)&&Number.isSafeInteger(t.subtotal)&&Number.isSafeInteger(t.discount)&&Number.isSafeInteger(t.tax)&&Number.isSafeInteger(t.total)&&Array.isArray(t.taxes)}function Sr(e){let t=new Map;for(let n of e){if(!n||typeof n.taxComponentId!=`string`||typeof n.name!=`string`||typeof n.percent!=`string`||!Number.isSafeInteger(n.taxable)||!Number.isSafeInteger(n.tax))continue;let e=`${n.taxComponentId}\u0000${n.name}\u0000${n.percent}`,r=t.get(e);if(!r){t.set(e,{...n});continue}let i=r.taxable+n.taxable,a=r.tax+n.tax;Number.isSafeInteger(i)&&Number.isSafeInteger(a)&&(r.taxable=i,r.tax=a)}return[...t.values()]}function Cr(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`(^|[^\\d.])${n}\\s?%`).test(e)?e:`${e} ${t}%`}function wr(e){return typeof e==`number`&&Number.isSafeInteger(e)?e:null}function Tr(e){let t=0;for(let n of e){if(n==null||n===``)continue;let e=wr(n);if(e===null||(t+=e,!Number.isSafeInteger(t)))return null}return t}function Er(e,t){let n=e?.lineAmountType===`inclusive`,r=wr(e?.subtotal),i=wr(e?.discount),a=wr(e?.tax),o=wr(e?.total),s=[],c=t===null?null:n?a===null?null:t-a:t,l=r??c;l!==null&&s.push({key:`subtotal`,value:l,computed:r===null}),i!==null&&i!==0&&s.push({key:`discount`,value:i,computed:!1,included:!0}),a!==null&&a!==0&&s.push({key:`tax`,value:a,computed:!1});let u=o??(l===null||a===null?null:l+a);u!==null&&s.push({key:`total`,value:u,computed:o===null});let d=null;if(c!==null){if(r!==null&&r!==c)d={field:`subtotal`,recorded:r,lines:c};else if(r===null&&o!==null&&a!==null){let e=c+a;e!==o&&(d={field:`total`,recorded:o,lines:e})}}return{lines:s,lineSum:t,mismatch:d}}function Dr(e,t){let n=e.filter(e=>e.kind===`children`);return t.length===0?n.slice(0,20):t.map(e=>n.find(t=>Bn(t)===e)).filter(e=>e!==void 0)}function Or(e,t){return{title:e.label,model:e.model,field:e.field,filter:`parent`,sort:`createdAt`,direction:`desc`,limit:t,columns:or((e.columns??[]).map(e=>e.key))}}function kr(e,t,n){let r=Q(t)?t:{},i=pr(r),a=(e.columns??[]).map(e=>e.key),o=[...Array.isArray(r.columns)?r.columns:[],...e.columns??[]],s={};if(Q(r.summaries))for(let[e,t]of Object.entries(r.summaries))typeof t==`number`&&Number.isFinite(t)&&(s[e]=t);let c=typeof r.total==`number`&&Number.isFinite(r.total)?r.total:i.length,l=typeof r.href==`string`?r.href:void 0;return{key:Bn(e),label:e.label,rows:i,total:c,columns:hr(a,o),...n??l?{href:n??l}:{},...typeof r.currency==`string`?{currency:r.currency}:{},...typeof r.timeZone==`string`?{timeZone:r.timeZone}:{},...Object.keys(s).length>0?{summaries:s}:{}}}function Ar(e){return async(t,n)=>{let r=ar(t.relations,20),i=typeof t.limit==`number`?t.limit:5,a=Dr(e.relations,r),o=await Promise.allSettled(a.map(t=>new Promise(r=>r(e.records(Or(t,i),n))))),s=[],c;if(o.forEach((t,n)=>{let r=a[n];r&&(t.status===`rejected`?c??=t.reason:s.push(kr(r,t.value,e.viewAllHref?.(r))))}),s.length===0&&c!==void 0)throw c;return{tabs:s}}}function jr(e,t){let n=e.filter(e=>e.kind===`items`);return typeof t==`string`&&t!==``?n.find(e=>Bn(e)===t):n[0]}function Mr(e,t){return{title:e.label,model:e.model,field:e.field,filter:`parent`,sort:e.sort??`createdAt`,direction:`asc`,limit:t,columns:or((e.columns??[]).map(e=>e.key))}}function Nr(e){return async(t,n)=>{let r=jr(e.relations,t.relation),i=e.totals?.(),a=e.storedTotals?.(),o=e.currency?.();if(!r)return{rows:[],columns:[],...i?{totals:i}:{},...a?{storedTotals:a}:{}};let s=typeof t.limit==`number`?t.limit:50,c=kr(r,await e.records(Mr(r,s),n),void 0);return{rows:c.rows,columns:c.columns,...c.total===void 0?{}:{total:c.total},...i?{totals:i}:{},...a?{storedTotals:a}:{},...c.currency??o?{currency:c.currency??o}:{},...c.summaries?{summaries:c.summaries}:{},...c.href?{href:c.href}:{}}}}var Pr=U({"ui.overview.no_data":`Nothing to show yet.`,"ui.overview.metric.change_up":`Up {value} from the previous period`,"ui.overview.metric.change_down":`Down {value} from the previous period`,"ui.overview.chart.summary":`Chart with {count} values`,"ui.overview.chart.table":`Chart data`,"ui.overview.chart.label_column":`Label`,"ui.overview.chart.value_column":`Value`,"ui.overview.chart.peak":`Peak {value} · {label}`,"ui.overview.chart.latest":`Latest {value} · {label}`,"ui.overview.chart.explore":`Use the arrow keys to read each value; Home and End jump to the first and last.`,"ui.overview.chart.point":`{label}: {value}`}),Fr=c(`<tr><th scope="row" class="svelte-75pkr"> </th><td class="svelte-75pkr"> </td></tr>`),Ir=c(`<table><caption class="svelte-75pkr"> </caption><thead class="svelte-75pkr"><tr><th scope="col" class="svelte-75pkr"> </th><th scope="col" class="svelte-75pkr"> </th></tr></thead><tbody class="svelte-75pkr"></tbody></table>`),Lr=d(`<line class="smrt-chart__grid svelte-75pkr" x1="0" x2="100" vector-effect="non-scaling-stroke"></line>`),Rr=d(`<line class="smrt-chart__guide svelte-75pkr" y1="0" y2="40" vector-effect="non-scaling-stroke"></line>`),zr=c(`<span class="smrt-chart__dot svelte-75pkr" aria-hidden="true"></span> <span class="smrt-chart__tip svelte-75pkr" aria-hidden="true"><span> </span><strong> </strong></span>`,1),Br=c(`<svg class="smrt-chart__line svelte-75pkr" viewBox="0 0 100 40" preserveAspectRatio="none"><!><polyline fill="none" stroke="currentColor" stroke-width="2" vector-effect="non-scaling-stroke"></polyline><!></svg> <!>`,1),Vr=c(`<p class="smrt-chart__empty svelte-75pkr" data-smrt-component="Chart"> </p>`),Hr=c(`<div class="smrt-chart smrt-chart--table svelte-75pkr" data-smrt-component="Chart"><!></div>`),Ur=c(`<p class="smrt-chart__delta svelte-75pkr"><span aria-hidden="true"> </span> </p>`),Wr=c(`<div class="smrt-chart smrt-chart--stat svelte-75pkr" data-smrt-component="Chart"><p class="smrt-chart__headline svelte-75pkr"> </p> <p class="smrt-chart__caption svelte-75pkr"> </p> <!></div>`),Gr=d(`<circle class="smrt-chart__slice svelte-75pkr" cx="21" cy="21" r="15.9155" fill="none" stroke-width="6" pathLength="100" transform="rotate(-90 21 21)"></circle>`),Kr=c(`<li class="smrt-chart__legend-item svelte-75pkr"><span class="smrt-chart__swatch svelte-75pkr"></span> <span class="smrt-chart__label svelte-75pkr"> </span> <span class="smrt-chart__value svelte-75pkr"> </span></li>`),qr=c(`<div class="smrt-chart smrt-chart--pie svelte-75pkr" data-smrt-component="Chart"><svg class="smrt-chart__donut svelte-75pkr" viewBox="0 0 42 42" role="img"></svg> <ul class="smrt-chart__legend svelte-75pkr" aria-hidden="true"></ul> <!></div>`),Jr=c(`<span> </span>`),Yr=c(`<p class="smrt-chart__values svelte-75pkr" aria-hidden="true"></p>`),Xr=c(`<div class="smrt-chart__plot svelte-75pkr" role="slider" tabindex="0" aria-orientation="horizontal"><!></div>`),Zr=c(`<div class="smrt-chart__plot svelte-75pkr"><!></div>`),Qr=c(`<span class="svelte-75pkr"> </span>`),$r=c(`<p class="smrt-chart__axis svelte-75pkr" aria-hidden="true"></p>`),ei=c(`<span class="smrt-chart__table svelte-75pkr"> </span>`),ti=c(`<p class="smrt-chart__readout svelte-75pkr"><span> </span> <span> </span></p>`),ni=c(`<div class="smrt-chart smrt-chart--line svelte-75pkr" data-smrt-component="Chart"><div><!> <div class="smrt-chart__body svelte-75pkr"><!> <!></div></div> <!> <!> <!></div>`),ri=c(`<li class="smrt-chart__row svelte-75pkr"><span class="smrt-chart__label svelte-75pkr"> </span> <span class="smrt-chart__track svelte-75pkr" aria-hidden="true"><span class="smrt-chart__bar svelte-75pkr"></span></span> <span class="smrt-chart__value svelte-75pkr"> </span></li>`),ii=c(`<ul class="smrt-chart__bars svelte-75pkr" data-smrt-component="Chart"></ul>`);function ai(o,c){let u=L();h(c,!0);let d=(t,n=p)=>{var i=Ir(),o=k(i),c=P(o,!0),u=M(o),d=k(u),m=k(d),h=P(m,!0),g=M(m),_=P(g,!0);s(d),s(u);var y=M(u);f(y,21,()=>e(N),v,(t,n)=>{var r=Fr(),i=k(r),a=P(i,!0),o=M(i),c=P(o,!0);s(r),R(t=>{l(a,e(n).label),l(c,t)},[()=>re(e(n).value)]),x(t,r)}),s(y),s(i),R((e,t,o)=>{a(i,1,r(n()?`smrt-chart__table`:`smrt-chart__data`),`svelte-75pkr`),l(c,e),l(h,t),l(_,o)},[()=>A(Pr[`ui.overview.chart.table`]),()=>A(Pr[`ui.overview.chart.label_column`]),()=>A(Pr[`ui.overview.chart.value_column`])]),x(t,i)},m=(n,r=p)=>{var i=Br(),a=I(i),o=k(a),c=e=>{var t=S(),n=I(t);f(n,16,()=>[4,20,36],e=>e,(e,t)=>{var n=Lr();R(()=>{z(n,`y1`,t),z(n,`y2`,t)}),x(e,n)}),x(e,t)};t(o,t=>{e(fe)&&t(c)});var u=M(o),d=M(u),m=t=>{var n=Rr();R(()=>{z(n,`x1`,e(X).x),z(n,`x2`,e(X).x)}),x(t,n)};t(d,t=>{e(X)&&t(m)}),s(a);var h=M(a,2),g=t=>{var n=zr(),r=I(n);let i;var a=M(r,2);let o;var c=k(a),u=P(c,!0),d=M(c),f=P(d,!0);s(a),R(t=>{i=b(r,``,i,{"inset-inline-start":`${e(X).x??``}%`,"inset-block-start":`${e(X).y/40*100}%`}),z(a,`data-edge`,e(X).x<15?`start`:e(X).x>85?`end`:void 0),o=b(a,``,o,{"inset-inline-start":`${e(X).x??``}%`}),l(u,e(X).label),l(f,t)},[()=>re(e(X).value)]),x(t,n)};t(h,t=>{e(X)&&t(g)}),R(()=>{z(a,`role`,r()?void 0:`img`),z(a,`aria-label`,r()?void 0:e(de)),z(a,`aria-hidden`,r()?`true`:void 0),z(u,`points`,e(se))}),x(n,i)},g=E(c,`style`,3,`bar`),_=E(c,`title`,3,``),y=E(c,`locale`,3,`en`),w=E(c,`size`,3,`regular`),ee=E(c,`readout`,3,!0);function O(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}let{t:A}=ae(),j=n(()=>O(c.data)?c.data:null),N=n(()=>{if(!e(j)||!Array.isArray(e(j).points))return[];let t=[];for(let n of e(j).points.slice(0,60))O(n)&&typeof n.label==`string`&&typeof n.value==`number`&&Number.isFinite(n.value)&&t.push({label:n.label,value:n.value});return t}),te=[`bar`,`line`,`table`,`pie`,`stat`],F=n(()=>te.find(e=>e===g())??`bar`);function ne(){return w()!==`compact`&&(c.valueAxis??w()===`tall`)}let re=t=>_t(t,{format:e(j)?.format??`integer`,currency:e(j)?.currency,locale:y()}),V=n(()=>Math.max(0,...e(N).map(e=>e.value))),H=n(()=>Math.min(0,...e(N).map(e=>e.value)));function ie(e){if(e<=0)return 0;let t=10**Math.floor(Math.log10(e));return([1,2,2.5,5,10].find(n=>e/t<=n)??10)*t}let U=n(()=>ne()&&e(V)>0?ie(e(V)/2)*2:e(V)),oe=n(()=>e(U)-e(H)||1),se=n(()=>e(N).map((t,n)=>{let r=e(N).length===1?50:n/(e(N).length-1)*100,i=36-(t.value-e(H))/e(oe)*32;return`${r.toFixed(2)},${i.toFixed(2)}`}).join(` `)),W=n(()=>e(N).reduce((e,t)=>e+Math.max(0,t.value),0)),G=n(()=>{let t=0;return e(N).map((n,r)=>{let i=e(W)>0?Math.max(0,n.value)/e(W)*100:0,a={...n,index:r,share:i,offset:t};return t+=i,a})}),ce=e=>_t(e/100,{format:`percent`,locale:y()}),K=n(()=>e(N).at(-1)),le=n(()=>{if(e(j)&&typeof e(j).delta==`number`&&Number.isFinite(e(j).delta))return e(j).delta;let t=e(N).at(-2);return!e(K)||!t||t.value===0?null:(e(K).value-t.value)/Math.abs(t.value)*100}),q=n(()=>e(le)===null||e(le)===0?``:A(Pr[e(le)>0?`ui.overview.metric.change_up`:`ui.overview.metric.change_down`],{value:_t(Math.abs(e(le))/100,{format:`percent`,locale:y()})})),J=n(()=>{if(e(N).length<=2)return e(N).map(e=>e.label);let t=e(N)[Math.floor((e(N).length-1)/2)];return[e(N)[0].label,t.label,e(N)[e(N).length-1].label]}),ue=n(()=>e(N).reduce((e,t)=>!e||t.value>e.value?t:e,null)),de=n(()=>`${_()}. ${A(Pr[`ui.overview.chart.summary`],{count:e(N).length})}`),Y=n(()=>w()===`compact`),fe=n(ne),pe=n(()=>!e(Y)&&(c.explore??w()===`tall`)),me=t=>_t(t,{format:e(j)?.format??`integer`,currency:e(j)?.currency,locale:y(),compact:!0}),he=n(()=>[e(U),(e(U)+e(H))/2,e(H)]);function ge(t){let n=e(N)[t];return{x:e(N).length===1?50:t/(e(N).length-1)*100,y:36-((n?.value??0)-e(H))/e(oe)*32}}let _e=D(null),X=n(()=>e(_e)!==null&&e(N)[e(_e)]?{...e(N)[e(_e)],...ge(e(_e))}:null),ve=n(()=>e(X)?A(Pr[`ui.overview.chart.point`],{label:e(X).label,value:re(e(X).value)}):``);function ye(t){let n=t.currentTarget.getBoundingClientRect();if(n.width<=0||e(N).length===0)return;let r=Math.min(1,Math.max(0,(t.clientX-n.left)/n.width));B(_e,Math.round(r*(e(N).length-1)),!0)}function be(t){let n=e(N).length-1;if(n<0)return;let r=e(_e)??-1,i=t.key===`ArrowRight`||t.key===`ArrowUp`?Math.min(n,r+1):t.key===`ArrowLeft`||t.key===`ArrowDown`?Math.max(0,r<0?n:r-1):t.key===`Home`?0:t.key===`End`?n:null;i!==null&&(t.preventDefault(),B(_e,i,!0))}var xe=S(),Se=I(xe),Ce=e=>{var t=Vr(),n=P(t,!0);R(e=>l(n,e),[()=>A(Pr[`ui.overview.no_data`])]),x(e,t)},we=e=>{var t=Hr(),n=k(t);d(n,()=>!1),s(t),x(e,t)},Te=n=>{var r=S(),i=I(r),a=n=>{var r=Wr(),i=k(r),a=P(i,!0),o=M(i,2),c=P(o,!0),u=M(o,2),d=t=>{var n=Ur(),r=k(n),i=P(r,!0),a=M(r);s(n),R(()=>{z(n,`data-direction`,(e(le)??0)>0?`up`:`down`),l(i,(e(le)??0)>0?`▲`:`▼`),l(a,` ${e(q)??``}`)}),x(t,n)};t(u,t=>{e(q)&&t(d)}),s(r),R(t=>{l(a,t),l(c,e(K).label)},[()=>re(e(K).value)]),x(n,r)};t(i,t=>{e(K)&&t(a)}),x(n,r)},Ee=n=>{var r=S(),i=I(r),a=n=>{var r=qr(),i=k(r);f(i,21,()=>e(G),e=>e.index,(n,r)=>{var i=S(),a=I(i),o=t=>{var n=Gr();R(()=>{z(n,`data-slot`,e(r).index%8),z(n,`stroke-dasharray`,`${e(r).share??``} ${100-e(r).share}`),z(n,`stroke-dashoffset`,-e(r).offset)}),x(t,n)};t(a,t=>{e(r).share>0&&t(o)}),x(n,i)}),s(i);var a=M(i,2);f(a,21,()=>e(G),e=>e.index,(t,n)=>{var r=Kr(),i=k(r),a=M(i,2),o=P(a,!0),c=M(a,2),u=P(c);s(r),R((t,r)=>{z(i,`data-slot`,e(n).index%8),l(o,e(n).label),l(u,`${t??``} · ${r??``}`)},[()=>re(e(n).value),()=>ce(e(n).share)]),x(t,r)}),s(a);var o=M(a,2);d(o,()=>!0),s(r),R(()=>z(i,`aria-label`,e(de))),x(n,r)},o=e=>{var t=Vr(),n=P(t,!0);R(e=>l(n,e),[()=>A(Pr[`ui.overview.no_data`])]),x(e,t)};t(i,t=>{e(W)>0?t(a):t(o,-1)}),x(n,r)},De=n=>{var r=ni(),i=k(r);let o;var c=k(i),p=t=>{var n=Yr();f(n,21,()=>e(he),v,(t,n)=>{var r=Jr(),i=P(r,!0);R(e=>l(i,e),[()=>me(e(n))]),x(t,r)}),s(n),x(t,n)};t(c,t=>{e(fe)&&t(p)});var h=M(c,2),g=k(h),_=t=>{var n=Xr();z(n,`aria-valuemin`,0);var r=k(n);m(r,()=>!0),s(n),R((t,r)=>{z(n,`aria-label`,e(de)),z(n,`aria-describedby`,`${u}-explore`),z(n,`aria-valuemax`,t),z(n,`aria-valuenow`,e(_e)??e(N).length-1),z(n,`aria-valuetext`,r)},[()=>Math.max(0,e(N).length-1),()=>e(ve)||(e(K)?A(Pr[`ui.overview.chart.point`],{label:e(K).label,value:re(e(K).value)}):``)]),C(`pointermove`,n,ye),T(`pointerleave`,n,()=>B(_e,null)),C(`keydown`,n,be),T(`blur`,n,()=>B(_e,null)),x(t,n)},y=e=>{var t=Zr(),n=k(t);m(n,()=>!1),s(t),x(e,t)};t(g,t=>{e(pe)?t(_):t(y,-1)});var b=M(g,2),S=t=>{var n=$r();f(n,21,()=>e(J),v,(t,n)=>{var r=Qr(),i=P(r,!0);R(()=>l(i,e(n))),x(t,r)}),s(n),x(t,n)};t(b,t=>{e(Y)||t(S)}),s(h),s(i);var E=M(i,2),D=e=>{var t=ei(),n=P(t,!0);R(e=>{z(t,`id`,`${u}-explore`),l(n,e)},[()=>A(Pr[`ui.overview.chart.explore`])]),x(e,t)};t(E,t=>{e(pe)&&t(D)});var O=M(E,2),j=t=>{var n=ti(),r=k(n),i=P(r,!0),a=M(r,2),o=P(a,!0);s(n),R((e,t)=>{l(i,e),l(o,t)},[()=>A(Pr[`ui.overview.chart.peak`],{value:re(e(ue).value),label:e(ue).label}),()=>A(Pr[`ui.overview.chart.latest`],{value:re(e(K).value),label:e(K).label})]),x(t,n)};t(O,t=>{ee()&&!e(Y)&&e(ue)&&e(K)&&t(j)});var te=M(O,2);d(te,()=>!0),s(r),R(()=>{z(r,`data-size`,w()),o=a(i,1,`smrt-chart__frame svelte-75pkr`,null,o,{"smrt-chart__frame--axis":e(fe)})}),x(n,r)},Oe=t=>{var n=ii();f(n,21,()=>e(N),v,(t,n)=>{var r=ri(),i=k(r),a=P(i,!0),o=M(i,2),c=k(o);let u;s(o);var d=M(o,2),f=P(d,!0);s(r),R((t,r)=>{l(a,e(n).label),u=b(c,``,u,{"inline-size":t}),l(f,r)},[()=>`${e(V)>0?Math.max(0,e(n).value)/e(V)*100:0}%`,()=>re(e(n).value)]),x(t,r)}),s(n),R(()=>z(n,`aria-label`,e(de))),x(t,n)};t(Se,t=>{e(N).length===0?t(Ce):e(F)===`table`?t(we,1):e(F)===`stat`?t(Te,2):e(F)===`pie`?t(Ee,3):e(F)===`line`?t(De,4):t(Oe,-1)}),x(o,xe),i()}w([`pointermove`,`keydown`]);var oi=c(`<div data-smrt-component="ChartWidget"><!></div>`);function si(t,r){h(r,!0);var a=oi(),o=k(a);{let t=n(()=>r.data??null),i=n(()=>String(r.options.style??`bar`));ai(o,{get data(){return e(t)},get style(){return e(i)},get title(){return r.title},get locale(){return r.locale}})}s(a),x(t,a),i()}var ci=c(`<a class="smrt-metric__value svelte-16na9c5"> </a>`),li=c(`<p class="smrt-metric__value svelte-16na9c5"> </p>`),ui=c(`<p class="smrt-metric__label svelte-16na9c5"> </p>`),di=c(`<p class="smrt-metric__change svelte-16na9c5"><span aria-hidden="true"> </span> </p>`),fi=c(`<div class="smrt-metric svelte-16na9c5" data-smrt-component="MetricWidget"><!> <!> <!></div>`),pi=c(`<p class="smrt-metric__label svelte-16na9c5" data-smrt-component="MetricWidget"> </p>`);function mi(r,a){h(a,!0);let{t:o}=ae(),c=n(()=>Q(a.data)?a.data:null),u=n(()=>e(c)!==null&&typeof e(c).value==`number`&&Number.isFinite(e(c).value)),d=n(()=>e(u)&&e(c)?_t(e(c).value,{format:e(c).format,currency:e(c).currency,locale:a.locale}):``),f=n(()=>e(c)&&typeof e(c).change==`number`&&Number.isFinite(e(c).change)?e(c).change:null),p=n(()=>e(f)===null||e(f)===0?``:o(Z[e(f)>0?`ui.overview.metric.change_up`:`ui.overview.metric.change_down`],{value:_t(Math.abs(e(f))/100,{format:`percent`,locale:a.locale})})),m=n(()=>e(c)&&typeof e(c).href==`string`?St(e(c).href):null);var g=S(),_=I(g),v=n=>{var r=fi(),i=k(r),a=t=>{var n=ci(),r=P(n,!0);R(()=>{z(n,`href`,e(m)),l(r,e(d))}),x(t,n)},o=t=>{var n=li(),r=P(n,!0);R(()=>l(r,e(d))),x(t,n)};t(i,t=>{e(m)?t(a):t(o,-1)});var u=M(i,2),h=t=>{var n=ui(),r=P(n,!0);R(()=>l(r,e(c).label)),x(t,n)};t(u,t=>{typeof e(c).label==`string`&&e(c).label&&t(h)});var g=M(u,2),_=t=>{var n=di(),r=k(n),i=P(r,!0),a=M(r);s(n),R(()=>{z(n,`data-direction`,(e(f)??0)>0?`up`:`down`),l(i,(e(f)??0)>0?`▲`:`▼`),l(a,` ${e(p)??``}`)}),x(t,n)};t(g,t=>{e(p)&&t(_)}),s(r),x(n,r)},y=e=>{var t=pi(),n=P(t,!0);R(e=>l(n,e),[()=>o(Z[`ui.overview.no_data`])]),x(e,t)};t(_,t=>{e(u)&&e(c)?t(v):t(y,-1)}),x(r,g),i()}var hi=(n,r=p)=>{var i=S(),a=I(i);f(a,17,r,v,(n,r)=>{var i=S(),a=I(i),o=t=>{var n=u();R(()=>l(n,e(r).text)),x(t,n)},c=t=>{var n=gi(),i=P(n,!0);R(()=>l(i,e(r).text)),x(t,n)},d=t=>{var n=_i();hi(k(n),()=>e(r).children),s(n),x(t,n)},f=t=>{var n=vi();hi(k(n),()=>e(r).children),s(n),x(t,n)},p=t=>{var n=yi();hi(k(n),()=>e(r).children),s(n),R(()=>z(n,`href`,e(r).href)),x(t,n)};t(a,t=>{e(r).type===`text`?t(o):e(r).type===`code`?t(c,1):e(r).type===`strong`?t(d,2):e(r).type===`em`?t(f,3):e(r).type===`link`&&t(p,4)}),x(n,i)}),x(n,i)},gi=c(`<code class="svelte-h4l6y5"> </code>`),_i=c(`<strong><!></strong>`),vi=c(`<em><!></em>`),yi=c(`<a rel="noopener noreferrer" class="svelte-h4l6y5"><!></a>`),bi=c(`<p class="smrt-note__empty svelte-h4l6y5" data-smrt-component="NoteWidget"> </p>`),xi=c(`<p class="smrt-note__heading svelte-h4l6y5"><strong><!></strong></p>`),Si=c(`<p class="svelte-h4l6y5"><!></p>`),Ci=c(`<blockquote class="svelte-h4l6y5"><!></blockquote>`),wi=c(`<li><!></li>`),Ti=c(`<ol class="svelte-h4l6y5"></ol>`),Ei=c(`<ul class="svelte-h4l6y5"></ul>`),Di=c(`<pre class="svelte-h4l6y5"><code class="svelte-h4l6y5"> </code></pre>`),Oi=c(`<div class="smrt-note svelte-h4l6y5" data-smrt-component="NoteWidget"></div>`);function ki(r,a){h(a,!0);let{t:o}=ae(),c=n(()=>Tt(typeof a.options.body==`string`?a.options.body:``));var u=S(),d=I(u),p=e=>{var t=bi(),n=P(t,!0);R(e=>l(n,e),[()=>o(Z[`ui.overview.no_data`])]),x(e,t)},m=n=>{var r=Oi();f(r,21,()=>e(c),v,(n,r)=>{var i=S(),a=I(i),o=t=>{var n=xi(),i=k(n);hi(k(i),()=>e(r).children),s(i),s(n),R(()=>z(n,`data-level`,e(r).level)),x(t,n)},c=t=>{var n=Si();hi(k(n),()=>e(r).children),s(n),x(t,n)},u=t=>{var n=Ci();hi(k(n),()=>e(r).children),s(n),x(t,n)},d=n=>{var i=S(),a=I(i),o=t=>{var n=Ti();f(n,21,()=>e(r).items,v,(t,n)=>{var r=wi();hi(k(r),()=>e(n)),s(r),x(t,r)}),s(n),x(t,n)},c=t=>{var n=Ei();f(n,21,()=>e(r).items,v,(t,n)=>{var r=wi();hi(k(r),()=>e(n)),s(r),x(t,r)}),s(n),x(t,n)};t(a,t=>{e(r).ordered?t(o):t(c,-1)}),x(n,i)},p=t=>{var n=Di(),i=k(n),a=P(i,!0);s(n),R(()=>l(a,e(r).text)),x(t,n)};t(a,t=>{e(r).type===`heading`?t(o):e(r).type===`paragraph`?t(c,1):e(r).type===`quote`?t(u,2):e(r).type===`list`?t(d,3):e(r).type===`code`&&t(p,4)}),x(n,i)}),s(r),x(n,r)};t(d,t=>{e(c).length===0?t(p):t(m,-1)}),x(r,u),i()}var Ai=c(`<code class="svelte-13uvxec"> </code>`),ji=c(`<a class="smrt-record-table__link svelte-13uvxec"><!></a>`),Mi=c(`<div class="smrt-record-table svelte-13uvxec" data-smrt-component="RecordTable" role="group"><!></div>`);function Ni(r,a){h(a,!0);let o=(r,i)=>{let o=()=>(i?.()).column,c=()=>(i?.()).row,d=()=>(i?.()).value,f=n(()=>e(m).get(o().id)),p=n(()=>e(f)?ur(e(f),d(),e(y)):String(d()??``)),h=n(()=>e(p)===``&&o().id===e(g)?c().title:e(p));var v=S(),b=I(v),C=n=>{var r=ji(),i=k(r),a=t=>{var n=Ai(),r=P(n,!0);R(()=>l(r,e(h))),x(t,n)},o=t=>{var n=u();R(()=>l(n,e(h))),x(t,n)};t(i,t=>{e(f)?.role===`identifier`?t(a):t(o,-1)}),s(r),R(()=>z(r,`href`,c().href)),x(n,r)},w=t=>{{let r=n(()=>cr(d(),a.statusTones));K(t,{size:`sm`,get variant(){return e(r)},children:(t,n)=>{_();var r=u();R(()=>l(r,e(h))),x(t,r)},$$slots:{default:!0}})}},T=t=>{var n=Ai(),r=P(n,!0);R(()=>l(r,e(h))),x(t,n)},E=t=>{var n=u();R(()=>l(n,e(h))),x(t,n)};t(b,t=>{o().id===e(g)&&c().href&&e(h)!==``?t(C):e(f)?.role===`status`&&e(h)!==``?t(w,1):e(f)?.role===`identifier`&&e(h)!==``?t(T,2):t(E,-1)}),x(r,v)},c=E(a,`summaries`,3,!1),d=E(a,`total`,3,null),{t:f}=ae(),p=n(()=>a.rows.map(e=>({id:e.id,title:e.title,href:typeof e.href==`string`?St(e.href):null,cells:e.cells??{}}))),m=n(()=>new Map(a.columns.map(e=>[e.key,e]))),g=n(()=>a.columns[0]?.key),v=n(()=>d()===null||d()<=a.rows.length),y=n(()=>({currency:a.currency,locale:a.locale,timeZone:a.timeZone})),b=n(()=>a.columns.map(t=>({id:t.key,label:t.label,accessor:`cells.${t.key}`,...dr(t.role)?{align:`right`}:{},summaryFormat:n=>ur(t,n,e(y))}))),C=n(()=>{if(!c()||a.columns.length===0)return;let t={},n=d()??a.rows.length;e(g)&&!dr(e(m).get(e(g))?.role)&&(t[e(g)]=()=>f(Z[`ui.overview.records.total`],{count:new Intl.NumberFormat(a.locale).format(n)}));for(let n of a.columns){if(!fr(n))continue;let r=a.summaryValues?.[n.key];typeof r==`number`&&Number.isFinite(r)?t[n.key]=()=>ur(n,r,e(y)):e(v)?t[n.key]=`sum`:t[n.key]=()=>``}return t});var w=Mi(),T=k(w);{let t=n(()=>f(Z[`ui.overview.table.total`]));ve(T,{get data(){return e(p)},get columns(){return e(b)},rowKey:`id`,get cell(){return o},dense:!0,size:`sm`,hoverable:!1,phoneLayout:`cards`,get summaries(){return e(C)},get summaryLabel(){return e(t)}})}s(w),R(()=>z(w,`aria-label`,a.label)),x(r,w),i()}var Pi=c(`<p class="smrt-records__foot smrt-records__foot--end svelte-1ouw4wc" data-smrt-component="RecordListWidget"><a class="svelte-1ouw4wc"> </a></p>`),Fi=c(`<!> <!>`,1),Ii=c(`<p class="smrt-records__empty svelte-1ouw4wc" data-smrt-component="RecordListWidget"> </p>`),Li=c(`<a class="smrt-records__title svelte-1ouw4wc"> </a>`),Ri=c(`<span class="smrt-records__title svelte-1ouw4wc"> </span>`),zi=c(`<span class="smrt-records__sub svelte-1ouw4wc"> </span>`),Bi=c(`<span class="smrt-records__meta svelte-1ouw4wc"> </span>`),Vi=c(`<li class="smrt-records__row svelte-1ouw4wc"><span class="smrt-records__main svelte-1ouw4wc"><!> <!></span> <!></li>`),Hi=c(`<ul class="smrt-records svelte-1ouw4wc" data-smrt-component="RecordListWidget"></ul>`),Ui=c(`<span> </span>`),Wi=c(`<a class="svelte-1ouw4wc"> </a>`),Gi=c(`<p class="smrt-records__foot svelte-1ouw4wc" data-smrt-component="RecordListWidget"><!> <!></p>`);function Ki(r,a){h(a,!0);let{t:o}=ae(),c=n(()=>{if(!Q(a.data)||!Array.isArray(a.data.rows))return[];let e=[];for(let t of a.data.rows.slice(0,50))Q(t)&&typeof t.title==`string`&&e.push({id:typeof t.id==`string`?t.id:String(e.length),title:t.title,subtitle:typeof t.subtitle==`string`?t.subtitle:void 0,meta:typeof t.meta==`string`?t.meta:void 0,href:typeof t.href==`string`?St(t.href):null});return e}),u=n(()=>Q(a.data)&&typeof a.data.total==`number`&&a.data.total>e(c).length?a.data.total:null),d=n(()=>Q(a.data)&&typeof a.data.href==`string`?St(a.data.href):null),p=n(()=>hr(ar(a.options?.columns),Q(a.data)?a.data.columns:void 0)),m=n(()=>pr(a.data)),g=n(()=>typeof a.options?.summaries==`boolean`?a.options.summaries:e(p).some(e=>fr(e))),_=n(()=>Q(a.data)&&typeof a.data.total==`number`&&Number.isFinite(a.data.total)?a.data.total:null),v=n(()=>{if(!Q(a.data)||!Q(a.data.summaries))return;let e={};for(let[t,n]of Object.entries(a.data.summaries))typeof n==`number`&&Number.isFinite(n)&&(e[t]=n);return e});var y=Fi(),b=I(y),S=r=>{var i=Fi(),c=I(i);{let t=n(()=>Q(a.data)&&typeof a.data.currency==`string`?a.data.currency:void 0),r=n(()=>Q(a.data)&&typeof a.data.timeZone==`string`?a.data.timeZone:void 0);Ni(c,{get rows(){return e(m)},get columns(){return e(p)},get locale(){return a.locale},get label(){return a.title},get currency(){return e(t)},get timeZone(){return e(r)},get summaries(){return e(g)},get summaryValues(){return e(v)},get total(){return e(_)}})}var u=M(c,2),f=t=>{var n=Pi(),r=k(n),i=P(r,!0);s(n),R(t=>{z(r,`href`,e(d)),l(i,t)},[()=>o(Z[`ui.overview.records.view_all`])]),x(t,n)};t(u,t=>{e(d)&&t(f)}),x(r,i)},C=e=>{var t=Ii(),n=P(t,!0);R(e=>l(n,e),[()=>o(Z[`ui.overview.records.empty`])]),x(e,t)},w=n=>{var r=Hi();f(r,21,()=>e(c),e=>e.id,(n,r)=>{var i=Vi(),a=k(i),o=k(a),c=t=>{var n=Li(),i=P(n,!0);R(()=>{z(n,`href`,e(r).href),l(i,e(r).title)}),x(t,n)},u=t=>{var n=Ri(),i=P(n,!0);R(()=>l(i,e(r).title)),x(t,n)};t(o,t=>{e(r).href?t(c):t(u,-1)});var d=M(o,2),f=t=>{var n=zi(),i=P(n,!0);R(()=>l(i,e(r).subtitle)),x(t,n)};t(d,t=>{e(r).subtitle&&t(f)}),s(a);var p=M(a,2),m=t=>{var n=Bi(),i=P(n,!0);R(()=>l(i,e(r).meta)),x(t,n)};t(p,t=>{e(r).meta&&t(m)}),s(i),x(n,i)}),s(r),x(n,r)};t(b,t=>{e(p).length>0&&e(m).length>0?t(S):e(c).length===0?t(C,1):t(w,-1)});var T=M(b,2),E=n=>{var r=Gi(),i=k(r),c=t=>{var n=Ui(),r=P(n,!0);R(e=>l(r,e),[()=>o(Z[`ui.overview.records.total`],{count:new Intl.NumberFormat(a.locale).format(e(u))})]),x(t,n)};t(i,t=>{e(u)!==null&&t(c)});var f=M(i,2),p=t=>{var n=Wi(),r=P(n,!0);R(t=>{z(n,`href`,e(d)),l(r,t)},[()=>o(Z[`ui.overview.records.view_all`])]),x(t,n)};t(f,t=>{e(d)&&t(p)}),s(r),x(n,r)};t(T,t=>{e(p).length===0&&(e(u)!==null||e(d))&&t(E)}),x(r,y),i()}var qi=c(`<p class="smrt-shortcuts__empty svelte-1nfxkds" data-smrt-component="ShortcutsWidget"> </p>`),Ji=c(`<span class="smrt-shortcuts__desc svelte-1nfxkds"> </span>`),Yi=c(`<span class="smrt-shortcuts__foot svelte-1nfxkds"><span class="smrt-shortcuts__count svelte-1nfxkds"> </span></span>`),Xi=c(`<li class="smrt-shortcuts__card svelte-1nfxkds"><a class="smrt-shortcuts__link svelte-1nfxkds"><span class="smrt-shortcuts__heading svelte-1nfxkds"><span class="smrt-shortcuts__icon svelte-1nfxkds"><!></span> <span class="smrt-shortcuts__title svelte-1nfxkds"> </span></span> <!> <!></a></li>`),Zi=c(`<ul class="smrt-shortcuts svelte-1nfxkds" data-smrt-component="ShortcutsWidget"></ul>`);function Qi(r,a){h(a,!0);let o=E(a,`presentation`,3,`card`),{t:c}=ae(),u=n(()=>new Intl.NumberFormat(a.locale)),d=n(()=>new Intl.PluralRules(a.locale)),p=t=>c(Z[e(d).select(t)===`one`?`ui.overview.shortcuts.records_one`:`ui.overview.shortcuts.records_other`],{count:e(u).format(t)}),m=n(()=>{if(!Q(a.data)||!Array.isArray(a.data.items))return[];let e=[];for(let t of a.data.items.slice(0,48)){if(!Q(t)||typeof t.label!=`string`)continue;let n=typeof t.href==`string`?St(t.href):null;n&&e.push({id:typeof t.id==`string`?t.id:n,label:t.label,href:n,icon:typeof t.icon==`string`?t.icon:ge,description:typeof t.description==`string`?t.description:void 0,count:typeof t.count==`number`&&Number.isFinite(t.count)&&t.count>=0?t.count:void 0})}return e});var g=S(),_=I(g),v=e=>{var t=qi(),n=P(t,!0);R(e=>l(n,e),[()=>c(Z[`ui.overview.shortcuts.empty`])]),x(e,t)},y=n=>{var r=Zi();f(r,21,()=>e(m),e=>e.id,(n,r)=>{var i=Xi(),o=k(i),c=k(o),u=k(c),d=k(u);X(d,{get name(){return e(r).icon},size:28,get iconComponent(){return a.iconComponent}}),s(u);var f=M(u,2),m=P(f,!0);s(c);var h=M(c,2),g=t=>{var n=Ji(),i=P(n,!0);R(()=>{z(n,`title`,e(r).description),l(i,e(r).description)}),x(t,n)};t(h,t=>{e(r).description&&t(g)});var _=M(h,2),v=t=>{var n=Yi(),i=k(n),a=P(i,!0);s(n),R(e=>l(a,e),[()=>p(e(r).count)]),x(t,n)};t(_,t=>{e(r).count!==void 0&&t(v)}),s(o),s(i),R(()=>{z(o,`href`,e(r).href),l(m,e(r).label)}),x(n,i)}),s(r),R(()=>z(r,`data-presentation`,o())),x(n,r)};t(_,t=>{e(m).length===0?t(v):t(y,-1)}),x(r,g),i()}var $i={key:`title`,type:`text`,label:`ui.overview.opt.title`,help:`ui.overview.opt.title_help`,maxLength:80},ea={key:`model`,type:`model`,label:`ui.overview.opt.model`,help:`ui.overview.opt.model_help`,required:!0},ta={key:`filter`,type:`identifier`,label:`ui.overview.opt.filter`,help:`ui.overview.opt.filter_help`},na={key:`field`,type:`identifier`,label:`ui.overview.opt.field`,help:`ui.overview.opt.field_help`},ra={key:`parentField`,type:`identifier`,label:`ui.overview.opt.parent_field`,help:`ui.overview.opt.parent_field_help`},ia={key:`columns`,type:`text`,label:`ui.overview.opt.columns`,help:`ui.overview.opt.columns_help`,maxLength:400},aa={key:`summaries`,type:`boolean`,label:`ui.overview.opt.summaries`,help:`ui.overview.opt.summaries_help`},oa=e=>({key:`measure`,type:`enum`,label:`ui.overview.opt.measure`,default:`count`,choices:e.map(e=>({value:e,label:`ui.overview.opt.measure_${e}`}))});function sa(e){return{type:`metric`,title:`ui.overview.widget.metric.title`,description:`ui.overview.widget.metric.description`,icon:`layers`,options:[$i,ea,oa([`count`,`sum`,`avg`,`min`,`max`]),na,ta,ra],component:mi,load:e}}function ca(e,t){return t>=1&&t<2?{...e}:null}function la(e){return{type:`chart`,title:`ui.overview.widget.chart.title`,description:`ui.overview.widget.chart.description`,icon:`repeat`,options:[$i,ea,{key:`groupBy`,type:`identifier`,label:`ui.overview.opt.group_by`},oa([`count`,`sum`,`avg`]),na,{key:`period`,type:`enum`,label:`ui.overview.opt.period`,default:`30d`,choices:[`7d`,`30d`,`90d`,`12m`,`all`].map(e=>({value:e,label:`ui.overview.opt.period_${e}`}))},{key:`style`,type:`enum`,label:`ui.overview.opt.style`,default:`bar`,choices:[{value:`bar`,label:`ui.overview.opt.style_bar`},{value:`line`,label:`ui.overview.opt.style_line`},{value:`table`,label:`ui.overview.opt.style_table`},{value:`pie`,label:`ui.overview.opt.style_pie`},{value:`stat`,label:`ui.overview.opt.style_stat`}]},ta],component:si,load:e,version:2,migrate:ca,defaultSpan:2}}function ua(e){return{type:`records`,title:`ui.overview.widget.records.title`,description:`ui.overview.widget.records.description`,icon:`fileText`,options:[$i,ea,{key:`sort`,type:`identifier`,label:`ui.overview.opt.sort`},na,{key:`direction`,type:`enum`,label:`ui.overview.opt.direction`,default:`desc`,choices:[{value:`desc`,label:`ui.overview.opt.direction_desc`},{value:`asc`,label:`ui.overview.opt.direction_asc`}]},{key:`limit`,type:`integer`,label:`ui.overview.opt.limit`,default:5,min:1,max:20},ta,ia,aa],component:Ki,load:e,defaultSpan:2}}function da(e){return{type:`shortcuts`,title:`ui.overview.widget.shortcuts.title`,description:`ui.overview.widget.shortcuts.description`,icon:`home`,options:[$i,{key:`section`,type:`identifier`,label:`ui.overview.opt.section`,help:`ui.overview.opt.section_help`}],component:Qi,load:e,defaultSpan:4}}function fa(){return{type:`note`,title:`ui.overview.widget.note.title`,description:`ui.overview.widget.note.description`,icon:`fileText`,options:[$i,{key:`body`,type:`markdown`,label:`ui.overview.opt.body`,help:`ui.overview.opt.body_help`,default:``,maxLength:4e3}],component:ki,defaultSpan:2}}function pa(e=st,t={},n={}){let r=[e.register(fa(),n)];return t.metric&&r.push(e.register(sa(t.metric),n)),t.chart&&r.push(e.register(la(t.chart),n)),t.records&&r.push(e.register(ua(t.records),n)),t.shortcuts&&r.push(e.register(da(t.shortcuts),n)),()=>{for(let e of r)e()}}var ma=c(`<p class="smrt-line-items__empty svelte-1q5no7f"> </p>`),ha=c(`<div class="smrt-line-items__total svelte-1q5no7f"><dt class="svelte-1q5no7f"> </dt><dd class="svelte-1q5no7f"> </dd></div>`),ga=c(`<div class="smrt-line-items__total smrt-line-items__total--muted svelte-1q5no7f"><dt class="svelte-1q5no7f"> </dt></div>`),_a=c(`<dd class="svelte-1q5no7f"> </dd>`),va=c(`<div class="smrt-line-items__total smrt-line-items__total--muted svelte-1q5no7f"><dt class="svelte-1q5no7f"> </dt> <!></div>`),ya=c(`<dl class="smrt-line-items__totals svelte-1q5no7f" data-money-snapshot="stored"><!> <!> <!> <!> <div class="smrt-line-items__total smrt-line-items__total--grand svelte-1q5no7f"><dt class="svelte-1q5no7f"> </dt><dd class="svelte-1q5no7f"> </dd></div> <!></dl>`),ba=c(`<span class="smrt-line-items__computed svelte-1q5no7f"> </span>`),xa=c(`<div><dt class="svelte-1q5no7f"> <!></dt> <dd class="svelte-1q5no7f"> </dd></div>`),Sa=c(`<dl class="smrt-line-items__totals svelte-1q5no7f"></dl>`),Ca=c(`<p class="smrt-line-items__flag svelte-1q5no7f"><strong> </strong> </p>`),wa=c(`<p class="smrt-line-items__foot svelte-1q5no7f"><a class="svelte-1q5no7f"> </a></p>`),Ta=c(`<div class="smrt-line-items svelte-1q5no7f" data-smrt-component="LineItemsWidget"><!> <!> <!> <!></div>`);function Ea(r,o){h(o,!0);let{t:c}=ae(),u=n(()=>pr(o.data)),d=n(()=>hr([],Q(o.data)?o.data.columns:void 0)),p=n(()=>Q(o.data)&&typeof o.data.total==`number`&&Number.isFinite(o.data.total)?o.data.total:e(u).length),m=n(()=>Q(o.data)&&typeof o.data.currency==`string`?o.data.currency:void 0),g=n(()=>{if(!Q(o.data)||!Q(o.data.summaries))return;let e={};for(let[t,n]of Object.entries(o.data.summaries))typeof n==`number`&&Number.isFinite(n)&&(e[t]=n);return e}),_=n(()=>[...e(d)].reverse().find(e=>e.role===`money`&&e.summarize!==!1)?.key),v=n(()=>{if(!e(_))return null;let t=e(g)?.[e(_)];return typeof t==`number`?t:e(p)>e(u).length?null:Tr(e(u).map(t=>t.cells?.[e(_)]))}),y=n(()=>Er(Q(o.data)&&Q(o.data.totals)?o.data.totals:void 0,e(v))),b=n(()=>Q(o.data)&&xr(o.data.storedTotals)?o.data.storedTotals:void 0),C=n(()=>e(b)?Sr(e(b).taxes).filter(e=>e.tax!==0):[]),w=n(()=>e(C).length>0),T=n(()=>Q(o.data)&&typeof o.data.href==`string`?St(o.data.href):null);function E(t){return ur({role:`money`},t,{currency:e(m),locale:o.locale})}let D={subtotal:Z[`ui.overview.line_items.subtotal`],discount:Z[`ui.overview.line_items.discount`],tax:Z[`ui.overview.line_items.tax`],total:Z[`ui.overview.line_items.total`]};var ee=Ta(),O=k(ee),A=t=>{Ni(t,{get rows(){return e(u)},get columns(){return e(d)},get locale(){return o.locale},get label(){return o.title},get currency(){return e(m)},summaries:!0,get summaryValues(){return e(g)},get total(){return e(p)}})},j=e=>{var t=ma(),n=P(t,!0);R(e=>l(n,e),[()=>c(Z[`ui.overview.line_items.empty`])]),x(e,t)};t(O,t=>{e(u).length>0&&e(d).length>0?t(A):t(j,-1)});var N=M(O,2),te=n=>{var r=ya(),i=k(r),a=t=>{var n=ha(),r=k(n),i=P(r,!0),a=M(r),o=P(a,!0);s(n),R((e,t)=>{l(i,e),l(o,t)},[()=>c(Z[`ui.overview.line_items.subtotal`]),()=>E(e(b).subtotal)]),x(t,n)};t(i,t=>{(e(b).lineAmountType!==`inclusive`||!e(w))&&t(a)});var o=M(i,2),u=t=>{var n=ga(),r=k(n),i=P(r);s(n),R((e,t)=>l(i,`${e??``} ${t??``}`),[()=>c(Z[`ui.overview.line_items.discount_included`]),()=>E(Math.abs(e(b).discount))]),x(t,n)};t(o,t=>{e(b).discount!==0&&t(u)});var d=M(o,2);f(d,17,()=>e(C),e=>`${e.taxComponentId}-${e.name}-${e.percent}`,(n,r)=>{var i=va(),a=k(i),o=P(a),u=M(a,2),d=t=>{var n=_a(),i=P(n,!0);R(e=>l(i,e),[()=>E(e(r).tax)]),x(t,n)};t(u,t=>{e(b).lineAmountType!==`inclusive`&&t(d)}),s(i),R((e,t)=>l(o,`${e??``} ${t??``}`),[()=>c(Z[e(b).lineAmountType===`inclusive`?`ui.overview.line_items.tax_included`:`ui.overview.line_items.tax_on`],{label:Cr(e(r).name,e(r).percent)}),()=>E(e(b).lineAmountType===`inclusive`?e(r).tax:e(r).taxable)]),x(n,i)});var p=M(d,2),m=e=>{var t=ga(),n=k(t),r=P(n,!0);s(t),R(e=>l(r,e),[()=>c(Z[`ui.overview.line_items.rounded_document`])]),x(e,t)};t(p,t=>{e(b).roundingScope===`document`&&t(m)});var h=M(p,2),g=k(h),_=P(g,!0),v=M(g),y=P(v,!0);s(h);var S=M(h,2),T=t=>{var n=ha(),r=k(n),i=P(r,!0),a=M(r),o=P(a,!0);s(n),R((e,t)=>{l(i,e),l(o,t)},[()=>c(Z[`ui.overview.line_items.subtotal_excluding_tax`]),()=>E(e(b).subtotal)]),x(t,n)};t(S,t=>{e(b).lineAmountType===`inclusive`&&e(w)&&e(b).showNetSubtotal&&t(T)}),s(r),R((e,t)=>{l(_,e),l(y,t)},[()=>c(Z[`ui.overview.line_items.total`]),()=>E(e(b).total)]),x(n,r)},F=n=>{var r=Sa();f(r,21,()=>e(y).lines,e=>e.key,(n,r)=>{var i=S(),o=I(i),u=t=>{var n=ga(),i=k(n),a=P(i);s(n),R((e,t)=>l(a,`${e??``} ${t??``}`),[()=>c(Z[`ui.overview.line_items.discount_included`]),()=>E(Math.abs(e(r).value))]),x(t,n)},d=n=>{var i=xa();let o;var u=k(i),d=k(u),f=M(d),p=e=>{var t=ba(),n=P(t,!0);R(e=>l(n,e),[()=>c(Z[`ui.overview.line_items.computed`])]),x(e,t)};t(f,t=>{e(r).computed&&t(p)}),s(u);var m=M(u,2),h=P(m,!0);s(i),R((t,n)=>{o=a(i,1,`smrt-line-items__total svelte-1q5no7f`,null,o,{"smrt-line-items__total--grand":e(r).key===`total`}),l(d,`${t??``} `),l(h,n)},[()=>c(D[e(r).key]),()=>e(r).key===`discount`?`−${E(e(r).value)}`:E(e(r).value)]),x(n,i)};t(o,t=>{e(r).included?t(u):t(d,-1)}),x(n,i)}),s(r),x(n,r)};t(N,t=>{e(b)?t(te):e(y).lines.length>0&&t(F,1)});var L=M(N,2),B=t=>{var n=Ca(),r=k(n),i=P(r,!0),a=M(r);s(n),R((e,t)=>{l(i,e),l(a,` ${t??``}`)},[()=>c(Z[`ui.overview.line_items.mismatch`],{amount:E(e(y).mismatch.lines)}),()=>c(Z[e(y).mismatch.field===`subtotal`?`ui.overview.line_items.mismatch_subtotal`:`ui.overview.line_items.mismatch_total`],{amount:E(e(y).mismatch.recorded)})]),x(t,n)};t(L,t=>{!e(b)&&e(y).mismatch&&t(B)});var ne=M(L,2),re=t=>{var n=wa(),r=k(n),i=P(r,!0);s(n),R(t=>{z(r,`href`,e(T)),l(i,t)},[()=>c(Z[`ui.overview.records.view_all`])]),x(t,n)};t(ne,t=>{e(T)&&t(re)}),s(ee),x(r,ee),i()}var Da=c(`<p class="smrt-related__empty svelte-ka1ryg" data-smrt-component="RelatedWidget"> </p>`),Oa=c(`<a> </a>`),ka=c(`<li><!></li>`),Aa=c(`<ul class="smrt-related__list svelte-ka1ryg"></ul>`),ja=c(`<p class="smrt-related__foot svelte-ka1ryg"><a class="svelte-ka1ryg"> </a></p>`),Ma=c(`<!> <!>`,1),Na=c(`<div class="smrt-related svelte-ka1ryg" data-smrt-component="RelatedWidget"><!></div>`);function Pa(r,a){h(a,!0);let{t:o}=ae(),c=n(()=>{if(!Q(a.data)||!Array.isArray(a.data.tabs))return[];let e=[];for(let t of a.data.tabs){if(!Q(t)||typeof t.key!=`string`)continue;let n=pr(t),r=typeof t.total==`number`&&Number.isFinite(t.total)?t.total:n.length;if(n.length===0||r===0)continue;let i=hr([],t.columns),a={};if(Q(t.summaries))for(let[e,n]of Object.entries(t.summaries))typeof n==`number`&&Number.isFinite(n)&&(a[e]=n);e.push({key:t.key,label:typeof t.label==`string`?t.label:t.key,rows:n,total:r,columns:i,href:typeof t.href==`string`?St(t.href):null,currency:typeof t.currency==`string`?t.currency:void 0,timeZone:typeof t.timeZone==`string`?t.timeZone:void 0,summaries:a})}return e}),d=D(null),p=n(()=>e(c).find(t=>t.key===e(d))??e(c)[0]);var m=S(),g=I(m),_=e=>{var t=Da(),n=P(t,!0);R(e=>l(n,e),[()=>o(Z[`ui.overview.related.empty`])]),x(e,t)},v=r=>{var i=Na(),m=k(i);{let r=n(()=>e(c).map(e=>({id:e.key,label:e.label,count:e.total})));we(m,{get tabs(){return e(r)},get active(){return e(p).key},onchange:e=>B(d,e,!0),size:`sm`,variant:`secondary`,get"aria-label"(){return a.title},children:(r,i)=>{var c=S(),d=I(c);ne(d,()=>e(p).key,r=>{var i=Ma(),c=I(i),d=t=>{Ni(t,{get rows(){return e(p).rows},get columns(){return e(p).columns},get locale(){return a.locale},get label(){return e(p).label},get currency(){return e(p).currency},get timeZone(){return e(p).timeZone},summaries:!0,get summaryValues(){return e(p).summaries},get total(){return e(p).total}})},m=r=>{var i=Aa();f(i,21,()=>e(p).rows,e=>e.id,(r,i)=>{var a=ka(),o=k(a),c=t=>{var n=Oa(),r=P(n,!0);R(t=>{z(n,`href`,t),l(r,e(i).title)},[()=>St(e(i).href)]),x(t,n)},d=n(()=>e(i).href&&St(e(i).href)),f=t=>{var n=u();R(()=>l(n,e(i).title)),x(t,n)};t(o,t=>{e(d)?t(c):t(f,-1)}),s(a),x(r,a)}),s(i),x(r,i)};t(c,t=>{e(p).columns.length>0?t(d):t(m,-1)});var h=M(c,2),g=t=>{var n=ja(),r=k(n),i=P(r,!0);s(n),R(t=>{z(r,`href`,e(p).href),l(i,t)},[()=>o(Z[`ui.overview.records.view_all`])]),x(t,n)};t(h,t=>{e(p).href&&t(g)}),x(r,i)}),x(r,c)},$$slots:{default:!0}})}s(i),x(r,i)};t(g,t=>{e(p)?t(v,-1):t(_)}),x(r,m),i()}function Fa(e){return{type:`related`,title:`ui.overview.widget.related.title`,description:`ui.overview.widget.related.description`,icon:`layers`,options:[{key:`title`,type:`text`,label:`ui.overview.opt.title`,help:`ui.overview.opt.title_help`,maxLength:80},{key:`relations`,type:`text`,label:`ui.overview.opt.relations`,help:`ui.overview.opt.relations_help`,maxLength:1e3},{key:`limit`,type:`integer`,label:`ui.overview.opt.limit`,default:5,min:1,max:20}],component:Pa,load:e,defaultSpan:4}}function Ia(e){return{type:`line-items`,title:`ui.overview.widget.line_items.title`,description:`ui.overview.widget.line_items.description`,icon:`fileText`,options:[{key:`title`,type:`text`,label:`ui.overview.opt.title`,help:`ui.overview.opt.title_help`,maxLength:80},{key:`relation`,type:`identifier`,label:`ui.overview.opt.relation`,help:`ui.overview.opt.relation_help`},{key:`limit`,type:`integer`,label:`ui.overview.opt.limit`,default:50,min:1,max:50}],component:Ea,load:e,defaultSpan:4}}function La(e=st,t,n={}){let r=[e.register(Fa(Ar(t)),n),e.register(Ia(Nr(t)),n)];return()=>{for(let e of r)e()}}var $=U({"ui.screens.create_title":`New {name}`,"ui.screens.edit_title":`Edit {name}`,"ui.screens.create_action":`New {name}`,"ui.screens.edit":`Edit`,"ui.screens.delete":`Delete`,"ui.screens.delete_title":`Delete this {name}?`,"ui.screens.delete_message":`This cannot be undone.`,"ui.screens.back":`Back to {name}`,"ui.screens.save":`Save`,"ui.screens.cancel":`Cancel`,"ui.screens.search":`Search {name}`,"ui.screens.empty_title":`No {name} yet`,"ui.screens.empty_search":`Nothing matches this search.`,"ui.screens.more_details":`More details`,"ui.screens.more_actions":`More actions`,"ui.screens.derived_hint":`Worked out from the line items.`,"ui.screens.select_none":`Not set`,"ui.screens.items":`Line items`,"ui.screens.details":`Details`,"ui.screens.show_empty":`Show empty fields ({count})`,"ui.screens.advanced_fields":`Advanced fields`,"ui.screens.not_set":`Not set`,"ui.screens.yes":`Yes`,"ui.screens.no":`No`,"ui.screens.load_failed":`Could not load this data.`,"ui.screens.save_failed":`Could not save your changes.`,"ui.screens.delete_failed":`Could not delete this record.`,"ui.screens.not_found":`This record no longer exists.`,"ui.screens.view_all":`View all`,"ui.screens.related":`Related records`,"ui.screens.error.required":`This field is required.`,"ui.screens.error.invalid_integer":`Enter a whole number.`,"ui.screens.error.invalid_decimal":`Enter a number.`,"ui.screens.error.invalid_money":`Enter an amount such as 12.50.`,"ui.screens.error.invalid_datetime":`Enter a valid date and time.`,"ui.screens.error.invalid_json":`Enter valid JSON.`}),Ra=(e,t=p)=>{var n=za(),r=P(n,!0);R(e=>{z(n,`title`,t()),l(r,e)},[()=>nr(t())]),x(e,n)},za=c(`<code> </code>`),Ba=c(`<h2 class="smrt-detail-screen__group-title svelte-c1e3gm"> </h2>`),Va=c(`<span class="smrt-detail-screen__empty svelte-c1e3gm"> </span>`),Ha=c(`<div class="svelte-c1e3gm"><dt class="svelte-c1e3gm"> </dt> <dd class="svelte-c1e3gm"> </dd></div>`),Ua=c(`<dl class="smrt-detail-screen__pairs svelte-c1e3gm"></dl>`),Wa=c(`<pre class="smrt-detail-screen__block svelte-c1e3gm"> </pre>`),Ga=c(`<a> </a>`),Ka=c(`<a class="smrt-detail-screen__reference"><!></a>`),qa=c(`<span class="smrt-detail-screen__reference"> </span>`),Ja=c(`<div class="smrt-detail-screen__field svelte-c1e3gm"><dt class="svelte-c1e3gm"> </dt> <dd class="svelte-c1e3gm"><!></dd></div>`),Ya=c(`<section class="smrt-detail-screen__group"><!> <dl class="smrt-detail-screen__fields svelte-c1e3gm"></dl></section>`),Xa=c(`<!> <!> <!> <!>`,1),Za=c(`<!> <!> <!> <!> <!>`,1),Qa=c(`<!> <article data-smrt-component="DetailScreen"><!></article> <!>`,1);function $a(r,c){h(c,!0);let d=(r,i=p)=>{var a=S(),o=I(a);f(o,17,()=>zn(i()),([e,t])=>e??``,(r,i)=>{var a=n(()=>y(e(i),2));let o=()=>e(a)[0],d=()=>e(a)[1];var p=Ya(),m=k(p),h=e=>{var t=Ba(),n=P(t,!0);R(()=>l(n,o())),x(e,t)};t(m,e=>{o()&&e(h)});var g=M(m,2);f(g,21,d,e=>e.name,(r,i)=>{let a=n(()=>ie(e(i)));var o=Ja(),d=k(o),p=P(d,!0),m=M(d,2),h=k(m),g=e=>{var t=Va(),n=P(t,!0);R(e=>l(n,e),[()=>T($[`ui.screens.not_set`])]),x(e,t)},_=r=>{let o=n(()=>tr(c.record[e(i).name]));var u=S(),d=I(u),p=t=>{var n=Ua();f(n,21,()=>e(o),e=>e.key,(t,n)=>{var r=Ha(),i=k(r),a=P(i,!0),o=M(i,2),c=P(o,!0);s(r),R(t=>{l(a,t),l(c,e(n).value)},[()=>kn(e(n).key)]),x(t,r)}),s(n),x(t,n)},m=t=>{var n=Wa(),r=P(n,!0);R(()=>l(r,e(a))),x(t,n)};t(d,t=>{e(o)?t(p):t(m,-1)}),x(r,u)},v=t=>{var n=Wa(),r=P(n,!0);R(()=>l(r,e(a))),x(t,n)},y=t=>{var n=Ga(),r=P(n,!0);R(t=>{z(n,`href`,t),l(r,e(a))},[()=>U(e(i),e(a))]),x(t,n)},b=n(()=>U(e(i),e(a))),C=r=>{let o=n(()=>c.hrefFor?.(e(i),e(a))),d=n(()=>se(e(i),e(a)));var f=S(),p=I(f),m=n=>{var r=Ka(),i=k(r),c=t=>{var n=u();R(()=>l(n,e(d))),x(t,n)},f=t=>{Ra(t,()=>e(a))};t(i,t=>{e(d)?t(c):t(f,-1)}),s(r),R(()=>z(r,`href`,e(o))),x(n,r)},h=t=>{var n=qa(),r=P(n,!0);R(()=>l(r,e(d))),x(t,n)},g=t=>{Ra(t,()=>e(a))};t(p,t=>{e(o)?t(m):e(d)?t(h,1):t(g,-1)}),x(r,f)},w=t=>{var n=u();R(()=>l(n,e(a))),x(t,n)};t(h,t=>{e(a)===``?t(g):e(i).kind===`json`?t(_,1):e(i).kind===`textarea`?t(v,2):e(b)?t(y,3):e(i).kind===`reference`?t(C,4):t(w,-1)}),s(m),s(o),R(()=>l(p,e(i).label)),x(r,o)}),s(g),s(p),x(r,p)}),x(r,a)},m=E(c,`policy`,3,null),g=E(c,`showHeader`,3,!0),v=E(c,`deleting`,3,!1),b=E(c,`relations`,19,()=>[]),C=E(c,`hideEmpty`,3,!1),w=E(c,`variant`,3,`plain`),{t:T}=ae(),ee=n(()=>jn(c.definition)),O=n(()=>Pn(c.definition,m())),A=n(()=>e(O)?[]:Rn(c.definition,m(),{mode:`view`,include:c.fields})),j=n(()=>c.exclude?e(A).filter(e=>!c.exclude.includes(e.name)):e(A)),N=n(()=>C()?e(j).filter(e=>ie(e)!==``):e(j)),te=n(()=>C()?e(j).filter(e=>ie(e)===``):[]),F=n(()=>e(N).filter(e=>e.tier===`basic`)),L=n(()=>e(N).filter(e=>e.tier===`advanced`)),ne=n(()=>{if(c.title)return c.title;let t=e(A).find(e=>e.kind===`text`&&e.tier===`basic`),n=t?c.record[t.name]:void 0;return typeof n==`string`&&n.trim()!==``?n:e(ee).singular}),H=n(()=>({currency:c.currency,locale:c.locale,yes:T($[`ui.screens.yes`]),no:T($[`ui.screens.no`])}));function ie(t){return Xn(t,c.record[t.name],e(H))}function U(e,t){return e.kind===`email`?`mailto:${t}`:e.kind===`url`&&/^https?:\/\//i.test(t)?t:null}function oe(e){return b().find(t=>t.kind===`reference`&&t.field===e.name)?.model}function se(e,t){let n=oe(e),r=n?c.labels?.[n]?.(t):void 0;return r&&r.trim()!==``?r:void 0}let W=D(!1),G=D(!1);async function ce(){B(G,!1);try{await c.ondelete?.(),B(W,!1)}catch{B(G,!0),B(W,!1)}}var K=Qa(),q=I(K),J=n=>{Te(n,{get title(){return e(ne)},actions:n=>{var r=Xa(),i=I(r),a=t=>{ue(t,{variant:`ghost`,get onclick(){return c.onback},children:(t,n)=>{_();var r=u();R(e=>l(r,e),[()=>c.backLabel??T($[`ui.screens.back`],{name:e(ee).plural.toLowerCase()})]),x(t,r)},$$slots:{default:!0}})};t(i,e=>{c.onback&&e(a)});var s=M(i,2),d=e=>{var t=S(),n=I(t);o(n,()=>c.extraActions),x(e,t)};t(s,e=>{c.extraActions&&e(d)});var f=M(s,2),p=e=>{ue(e,{variant:`secondary`,get onclick(){return c.onedit},children:(e,t)=>{_();var n=u();R(e=>l(n,e),[()=>T($[`ui.screens.edit`])]),x(e,n)},$$slots:{default:!0}})};t(f,e=>{c.onedit&&e(p)});var m=M(f,2),h=e=>{ue(e,{variant:`danger`,onclick:()=>B(W,!0),children:(e,t)=>{_();var n=u();R(e=>l(n,e),[()=>T($[`ui.screens.delete`])]),x(e,n)},$$slots:{default:!0}})};t(m,e=>{c.ondelete&&e(h)}),x(n,r)},$$slots:{actions:!0}})};t(q,e=>{g()&&e(J)});var de=M(q,2);let Y;var fe=k(de),pe=t=>{V(t,{variant:`error`,children:(t,n)=>{_();var r=u();R(()=>l(r,e(O))),x(t,r)},$$slots:{default:!0}})},me=r=>{var i=Za(),a=I(i),s=e=>{V(e,{variant:`error`,dismissible:!0,ondismiss:()=>B(G,!1),children:(e,t)=>{_();var n=u();R(e=>l(n,e),[()=>T($[`ui.screens.delete_failed`])]),x(e,n)},$$slots:{default:!0}})};t(a,t=>{e(G)&&t(s)});var f=M(a,2);d(f,()=>e(F));var m=M(f,2),h=t=>{{let r=n(()=>T($[`ui.screens.more_details`]));le(t,{get title(){return e(r)},children:(t,n)=>{d(t,()=>e(L))},$$slots:{default:!0}})}};t(m,t=>{e(L).length>0&&t(h)});var g=M(m,2),v=t=>{{let r=n(()=>T($[`ui.screens.show_empty`],{count:e(te).length}));le(t,{get title(){return e(r)},children:(t,n)=>{d(t,()=>e(te))},$$slots:{default:!0}})}};t(g,t=>{e(te).length>0&&t(v)});var y=M(g,2);o(y,()=>c.children??p),x(r,i)};t(fe,t=>{e(O)?t(pe):t(me,-1)}),s(de);var he=M(de,2),ge=t=>{{let r=n(()=>T($[`ui.screens.delete_title`],{name:e(ee).singular.toLowerCase()})),i=n(()=>T($[`ui.screens.delete_message`])),a=n(()=>T($[`ui.screens.delete`])),o=n(()=>T($[`ui.screens.cancel`]));re(t,{get open(){return e(W)},get title(){return e(r)},get message(){return e(i)},get confirmLabel(){return e(a)},get cancelLabel(){return e(o)},destructive:!0,get loading(){return v()},onconfirm:ce,oncancel:()=>B(W,!1)})}};t(he,e=>{c.ondelete&&e(ge)}),R(e=>{Y=a(de,1,`smrt-detail-screen svelte-c1e3gm`,null,Y,{"smrt-detail-screen--card":w()===`card`}),z(de,`aria-label`,e)},[()=>w()===`card`?T($[`ui.screens.details`]):e(ne)]),x(r,K),i()}var eo=c(`<small class="smrt-edit-form__hint svelte-6ki7lf"> </small>`),to=c(`<small class="smrt-edit-form__error svelte-6ki7lf" role="alert"> </small>`),no=c(`<div class="smrt-edit-form__check svelte-6ki7lf"><!> <!> <!></div>`),ro=c(`<option> </option>`),io=c(`<!> <!> <!>`,1),ao=c(`<legend class="svelte-6ki7lf"> </legend>`),oo=c(`<fieldset class="smrt-edit-form__group svelte-6ki7lf"><!> <!></fieldset>`),so=c(`<!> <!>`,1),co=c(`<!> <!> <!> <!>`,1),lo=c(`<!> <section class="smrt-edit-form svelte-6ki7lf" data-smrt-component="EditForm"><!></section>`,1);function uo(r,a){h(a,!0);let o=(r,i=p)=>{var o=S(),c=I(o),u=t=>{{let r=n(()=>ge(i())),o=n(()=>T($[`ui.screens.derived_hint`]));xe(t,{get label(){return e(r)},get hint(){return e(o)},children:(t,r)=>{{let r=n(()=>Xn(i(),a.record?.[i().name],{currency:m()}));Y(t,{get name(){return i().name},readonly:!0,get value(){return e(r)}})}},$$slots:{default:!0}})}},d=n(()=>ne(i())),h=r=>{var a=no(),o=k(a),c=()=>e(U)[i().name]===!0,u=t=>e(U)[i().name]=t;fe(o,{get name(){return i().name},get label(){return i().label},get disabled(){return e(X)},get checked(){return c()},set checked(e){u(e)}});var d=M(o,2),f=e=>{var t=eo(),n=P(t,!0);R(()=>l(n,i().help)),x(e,t)};t(d,e=>{i().help&&e(f)});var p=M(d,2),m=e=>{var t=to(),n=P(t,!0);R(e=>l(n,e),[()=>pe(i())]),x(e,t)},h=n(()=>pe(i()));t(p,t=>{e(h)&&t(m)}),s(a),x(r,a)},g=r=>{{let a=n(()=>ge(i())),o=n(()=>he(i())),s=n(()=>pe(i()));xe(r,{get label(){return e(a)},get hint(){return e(o)},get error(){return e(s)},get required(){return i().required},children:(r,a)=>{var o=S(),s=I(o),c=r=>{var a=()=>J(i().name),o=e=>de(i().name,e);ye(r,{get name(){return i().name},get disabled(){return e(X)},get required(){return i().required},get value(){return a()},set value(e){o(e)},children:(r,a)=>{var o=io(),s=I(o),c=e=>{var t=ro(),n=P(t,!0);t.value=t.__value=``,R(e=>l(n,e),[()=>T($[`ui.screens.select_none`])]),x(e,t)},u=n(()=>!i().required||J(i().name)===``);t(s,t=>{e(u)&&t(c)});var d=M(s,2);f(d,16,()=>i().options??[],e=>e,(e,t)=>{var n=ro(),r=P(n,!0),i={};R(e=>{l(r,e),i!==(i=t)&&(n.value=(n.__value=i)??``)},[()=>lr(t)]),x(e,n)});var p=M(d,2),m=e=>{var t=ro(),n=P(t,!0),r={};R((e,i)=>{l(n,e),r!==(r=i)&&(t.value=(t.__value=r)??``)},[()=>J(i().name),()=>J(i().name)]),x(e,t)},h=n(()=>J(i().name)!==``&&!(i().options??[]).includes(J(i().name)));t(p,t=>{e(h)&&t(m)}),x(r,o)},$$slots:{default:!0}})},u=t=>{var r=()=>J(i().name),a=e=>de(i().name,e);{let o=n(()=>i().kind===`json`?8:4);Se(t,{get name(){return i().name},get rows(){return e(o)},get disabled(){return e(X)},get required(){return i().required},get value(){return r()},set value(e){a(e)}})}},d=t=>{var r=()=>J(i().name),a=e=>de(i().name,e);{let o=n(()=>i().kind===`email`?`email`:i().kind===`url`?`url`:i().kind===`tel`?`tel`:i().kind===`integer`||i().kind===`decimal`?`number`:i().kind===`datetime`?`datetime-local`:`text`),s=n(()=>i().kind===`integer`?`1`:i().kind===`decimal`?`any`:void 0),c=n(()=>i().kind===`money`?`decimal`:void 0);Y(t,{get name(){return i().name},get type(){return e(o)},get step(){return e(s)},get inputmode(){return e(c)},get disabled(){return e(X)},get required(){return i().required},get value(){return r()},set value(e){a(e)}})}};t(s,e=>{i().kind===`select`?e(c):i().kind===`textarea`||i().kind===`json`?e(u,1):e(d,-1)}),x(r,o)},$$slots:{default:!0}})}};t(c,t=>{e(d)?t(u):i().kind===`boolean`?t(h,1):t(g,-1)}),x(r,o)},c=(r,i=p)=>{var a=S(),c=I(a);f(c,17,()=>zn(i()),([e,t])=>e??``,(r,i)=>{var a=n(()=>y(e(i),2));let c=()=>e(a)[0],u=()=>e(a)[1];var d=oo(),p=k(d),m=e=>{var t=ao(),n=P(t,!0);R(()=>l(n,c())),x(e,t)};t(p,e=>{c()&&e(m)});var h=M(p,2);f(h,17,u,e=>e.name,(t,n)=>{o(t,()=>e(n))}),s(d),x(r,d)}),x(r,a)},d=E(a,`policy`,3,null),m=E(a,`currency`,3,`USD`),g=E(a,`showHeader`,3,!0),v=E(a,`submitting`,3,!1),b=E(a,`fieldErrors`,19,()=>({})),C=E(a,`error`,3,null),w=E(a,`derivedFields`,19,()=>[]),{t:T}=ae(),O=n(()=>a.record===void 0),A=n(()=>jn(a.definition)),N=n(()=>Pn(a.definition,d())),te=n(()=>a.title??T($[e(O)?`ui.screens.create_title`:`ui.screens.edit_title`],{name:e(A).singular.toLowerCase()})),L=n(()=>e(N)?[]:Rn(a.definition,d(),{mode:`edit`,include:a.fields})),ne=e=>w().includes(e.name),re=n(()=>e(L).filter(e=>e.tier===`basic`)),H=n(()=>e(L).filter(e=>e.tier===`advanced`));function ie(){return a.record?qn(e(L),a.record,{currency:m()}):Jn(e(L),d(),{currency:m()})}let U=D(j(ie())),oe=D(j({})),se=D(j({})),W=D(!1),G=D(!1),ce=D(!1),K=n(()=>`${a.definition.objectRef}:${a.record?String(a.record[a.definition.idField??`id`]):`new`}:${e(L).map(e=>e.name).join(`,`)}`),q=F(()=>e(K));ee(()=>{let t=e(K);t!==q&&(q=t,F(()=>{B(U,ie(),!0),B(oe,{},!0),B(se,{},!0),B(W,!1)}))});function J(t){let n=e(U)[t];return typeof n==`string`?n:``}function de(t,n){e(U)[t]=String(n??``)}function pe(t){let n=e(oe)[t.name];return n?T($[`ui.screens.error.${n}`]):b()[t.name]??e(se)[t.name]}let me=n(()=>e(H).some(t=>e(oe)[t.name]||b()[t.name]||e(se)[t.name]));function he(e){return e.help??void 0}function ge(e){return e.kind===`money`?`${e.label} (${m()})`:e.label}async function _e(){if(e(G)||v())return;B(W,!1),B(se,{},!0);let t=Yn(e(L).filter(e=>!ne(e)),e(U),{currency:m(),record:a.record});if(B(oe,t.errors,!0),Object.keys(t.errors).length>0)e(H).some(e=>t.errors[e.name])&&B(ce,!0);else{B(G,!0);try{let n=await a.onsubmit(t.values,{isNew:e(O)});n?.fieldErrors&&(B(se,{...n.fieldErrors},!0),e(H).some(e=>n.fieldErrors?.[e.name])&&B(ce,!0))}catch{B(W,!0)}finally{B(G,!1)}}}let X=n(()=>e(G)||v()),ve=n(()=>C()??(e(W)?T($[`ui.screens.save_failed`]):null));var we=lo(),Ee=I(we),De=t=>{Te(t,{get title(){return e(te)}})};t(Ee,e=>{g()&&e(De)});var Oe=M(Ee,2),ke=k(Oe),Ae=t=>{V(t,{variant:`error`,children:(t,n)=>{_();var r=u();R(()=>l(r,e(N))),x(t,r)},$$slots:{default:!0}})},je=r=>{be(r,{onsubmit:_e,novalidate:!0,children:(r,i)=>{var o=co(),s=I(o),d=t=>{V(t,{variant:`error`,children:(t,n)=>{_();var r=u();R(()=>l(r,e(ve))),x(t,r)},$$slots:{default:!0}})};t(s,t=>{e(ve)&&t(d)});var f=M(s,2);c(f,()=>e(re));var p=M(f,2),m=t=>{var r=()=>e(ce)||e(me),i=e=>B(ce,e,!0);{let a=n(()=>T($[`ui.screens.advanced_fields`]));le(t,{get title(){return e(a)},get open(){return r()},set open(e){i(e)},children:(t,n)=>{c(t,()=>e(H))},$$slots:{default:!0}})}};t(p,t=>{e(H).length>0&&t(m)});var h=M(p,2);Ce(h,{children:(n,r)=>{var i=so(),o=I(i),s=t=>{ue(t,{type:`button`,variant:`ghost`,get disabled(){return e(X)},get onclick(){return a.oncancel},children:(e,t)=>{_();var n=u();R(e=>l(n,e),[()=>T($[`ui.screens.cancel`])]),x(e,n)},$$slots:{default:!0}})};t(o,e=>{a.oncancel&&e(s)});var c=M(o,2);ue(c,{type:`submit`,variant:`primary`,get loading(){return e(X)},get disabled(){return e(X)},children:(e,t)=>{_();var n=u();R(e=>l(n,e),[()=>T($[`ui.screens.save`])]),x(e,n)},$$slots:{default:!0}}),x(n,i)},$$slots:{default:!0}}),x(r,o)},$$slots:{default:!0}})};t(ke,t=>{e(N)?t(Ae):t(je,-1)}),s(Oe),R(()=>z(Oe,`aria-label`,e(te))),x(r,we),i()}var fo=c(` <code class="smrt-record-header__id svelte-uiz8xl"> </code>`,1),po=c(`<code class="smrt-record-header__id smrt-record-header__id--chip svelte-uiz8xl"> </code>`),mo=c(`<span class="smrt-record-header__sr svelte-uiz8xl"> </span> `,1),ho=c(`<span aria-hidden="true">⋯</span>`),go=c(`<div class="smrt-record-header__menu svelte-uiz8xl"><!> <!></div>`),_o=c(`<code> </code>`),vo=c(`<a><!></a>`),yo=c(`<a> </a>`),bo=c(`<div class="smrt-record-header__fact svelte-uiz8xl"><dt class="svelte-uiz8xl"> </dt> <dd class="svelte-uiz8xl"><!></dd></div>`),xo=c(`<dl class="smrt-record-header__facts svelte-uiz8xl"></dl>`),So=c(`<header class="smrt-record-header svelte-uiz8xl" data-smrt-component="RecordHeader"><!> <div class="smrt-record-header__row svelte-uiz8xl"><div class="smrt-record-header__identity svelte-uiz8xl"><h1 class="smrt-record-header__title svelte-uiz8xl"><!></h1> <!> <!></div> <div class="smrt-record-header__actions svelte-uiz8xl"><!> <!></div></div> <!> <!></header> <!>`,1);function Co(r,a){h(a,!0);let c=E(a,`relations`,19,()=>[]),d=E(a,`deleting`,3,!1),{t:p}=ae(),m=n(()=>jn(a.definition)),g=n(()=>!!(a.extraActions||a.ondelete)),v=D(!1),y=D(!1),b=D(!1);async function C(){B(b,!1);try{await a.ondelete?.(),B(y,!1)}catch{B(b,!0),B(y,!1)}}function w(e,t){let n=c().find(t=>t.kind===`reference`&&t.field===e.name)?.model,r=n?a.labels?.[n]?.(t):void 0;return r&&r.trim()!==``?r:void 0}function T(e){let t=a.record[e.field.name];return e.kind===`date`?Xn({kind:`datetime`,definition:{format:`date`}},t,{locale:a.locale}):Xn(e.field,t,{currency:a.currency,locale:a.locale})}function ee(e,t){if(e.field.kind===`email`)return`mailto:${t}`;if(e.field.kind===`tel`)return`tel:${t.replace(/[^\d+]/g,``)}`}var O=So(),A=I(O),j=k(A),N=t=>{ue(t,{variant:`ghost`,size:`sm`,get onclick(){return a.onback},children:(t,n)=>{_();var r=u();R(e=>l(r,e),[()=>a.backLabel??p($[`ui.screens.back`],{name:e(m).plural.toLowerCase()})]),x(t,r)},$$slots:{default:!0}})};t(j,e=>{a.onback&&e(N)});var te=M(j,2),F=k(te),L=k(F),ne=k(L),H=e=>{var t=fo(),n=I(t,!0),r=M(n),i=P(r,!0);R(e=>{l(n,e),l(i,a.model.identifier.value)},[()=>a.model.heading.slice(0,a.model.heading.length-a.model.identifier.value.length)]),x(e,t)},ie=e=>{var t=u();R(()=>l(t,a.model.heading)),x(e,t)};t(ne,e=>{a.model.headingIdentifier&&a.model.identifier?e(H):e(ie,-1)}),s(L);var U=M(L,2),se=e=>{var t=po(),n=P(t,!0);R(()=>{z(t,`title`,a.model.identifier.field.label),l(n,a.model.identifier.value)}),x(e,t)};t(U,e=>{a.model.identifier&&!a.model.headingIdentifier&&e(se)});var W=M(U,2),G=t=>{{let r=n(()=>cr(a.model.status.value,a.statusTones));K(t,{get variant(){return e(r)},children:(e,t)=>{var n=mo(),r=I(n),i=P(r),o=M(r,1,!0);R(e=>{l(i,`${a.model.status.field.label??``}:`),l(o,e)},[()=>lr(a.model.status.value)]),x(e,n)},$$slots:{default:!0}})}};t(W,e=>{a.model.status&&e(G)}),s(F);var ce=M(F,2),le=k(ce),q=e=>{ue(e,{variant:`primary`,get onclick(){return a.onedit},children:(e,t)=>{_();var n=u();R(e=>l(n,e),[()=>p($[`ui.screens.edit`])]),x(e,n)},$$slots:{default:!0}})};t(le,e=>{a.onedit&&e(q)});var J=M(le,2),de=r=>{{let i=e=>{var t=ho();x(e,t)},c=n(()=>p($[`ui.screens.more_actions`])),d=n(()=>p($[`ui.screens.more_actions`]));oe(r,{get label(){return e(c)},get triggerLabel(){return e(d)},variant:`icon`,placement:`bottom-end`,get open(){return e(v)},set open(e){B(v,e,!0)},trigger:i,children:(e,n)=>{var r=go(),i=k(r),c=e=>{var t=S(),n=I(t);o(n,()=>a.extraActions),x(e,t)};t(i,e=>{a.extraActions&&e(c)});var d=M(i,2),f=e=>{ue(e,{variant:`danger`,onclick:()=>{B(v,!1),B(y,!0)},children:(e,t)=>{_();var n=u();R(e=>l(n,e),[()=>p($[`ui.screens.delete`])]),x(e,n)},$$slots:{default:!0}})};t(d,e=>{a.ondelete&&e(f)}),s(r),x(e,r)},$$slots:{trigger:!0,default:!0}})}};t(J,t=>{e(g)&&t(de)}),s(ce),s(te);var Y=M(te,2),fe=r=>{var i=xo();f(i,21,()=>a.model.facts,e=>e.field.name,(r,i)=>{let o=n(()=>T(e(i)));var c=bo(),d=k(c),f=P(d,!0),p=M(d,2),m=k(p),h=r=>{let c=n(()=>a.hrefFor?.(e(i).field,e(o))),d=n(()=>w(e(i).field,e(o)));var f=S(),p=I(f),m=n=>{var r=vo(),i=k(r),a=t=>{var n=u();R(()=>l(n,e(d))),x(t,n)},f=t=>{var n=_o(),r=P(n,!0);R(t=>{z(n,`title`,e(o)),l(r,t)},[()=>nr(e(o))]),x(t,n)};t(i,t=>{e(d)?t(a):t(f,-1)}),s(r),R(()=>z(r,`href`,e(c))),x(n,r)},h=t=>{var n=u();R(()=>l(n,e(d))),x(t,n)},g=t=>{var n=_o(),r=P(n,!0);R(t=>{z(n,`title`,e(o)),l(r,t)},[()=>nr(e(o))]),x(t,n)};t(p,t=>{e(c)?t(m):e(d)?t(h,1):t(g,-1)}),x(r,f)},g=t=>{var n=yo(),r=P(n,!0);R(t=>{z(n,`href`,t),l(r,e(o))},[()=>ee(e(i),e(o))]),x(t,n)},_=n(()=>e(i).kind===`contact`&&ee(e(i),e(o))),v=t=>{var n=u();R(()=>l(n,e(o))),x(t,n)};t(m,t=>{e(i).kind===`party`?t(h):e(_)?t(g,1):t(v,-1)}),s(p),s(c),R(()=>l(f,e(i).field.label)),x(r,c)}),s(i),x(r,i)};t(Y,e=>{a.model.facts.length>0&&e(fe)});var pe=M(Y,2),me=e=>{V(e,{variant:`error`,dismissible:!0,ondismiss:()=>B(b,!1),children:(e,t)=>{_();var n=u();R(e=>l(n,e),[()=>p($[`ui.screens.delete_failed`])]),x(e,n)},$$slots:{default:!0}})};t(pe,t=>{e(b)&&t(me)}),s(A);var he=M(A,2),ge=t=>{{let r=n(()=>p($[`ui.screens.delete_title`],{name:e(m).singular.toLowerCase()})),i=n(()=>p($[`ui.screens.delete_message`])),a=n(()=>p($[`ui.screens.delete`])),o=n(()=>p($[`ui.screens.cancel`]));re(t,{get open(){return e(y)},get title(){return e(r)},get message(){return e(i)},get confirmLabel(){return e(a)},get cancelLabel(){return e(o)},destructive:!0,get loading(){return d()},onconfirm:C,oncancel:()=>B(y,!1)})}};t(he,e=>{a.ondelete&&e(ge)}),x(r,O),i()}function wo(e){return e==null?!1:typeof e!=`string`||e.trim()!==``}function To(e,t){return(e.roles??[]).includes(t)}function Eo(e,t,n,r,i={}){let{singular:a}=jn(e),o=t.filter(e=>wo(n[e.name])),s=e=>o.find(t=>To(t,e)),c=[],l=s(`title`),u=s(`identifier`),d=s(`status`),f=u?String(n[u.name]):void 0,p,m=!1;i.title?p=i.title:f&&En(r)?(p=`${a} ${f}`,m=!0):l?p=String(n[l.name]):f?(p=f,m=!0):p=a,l&&!m&&!i.title&&c.push(l.name);let h={heading:p,headingIdentifier:m,facts:[],shown:c};u&&f&&(h.identifier={field:u,value:f},c.push(u.name)),d&&(h.status={field:d,value:String(n[d.name])},c.push(d.name));let g=i.maxFacts??4,_=(e,t)=>{!t||c.includes(t.name)||h.facts.length>=g||(h.facts.push({kind:e,field:t}),c.push(t.name))};return _(`party`,s(`party`)),_(`date`,o.find(e=>To(e,`date`)&&e.name!==`createdAt`&&e.name!==`updatedAt`)),_(`money`,s(`total`)??s(`money`)),_(`contact`,o.find(e=>e.kind===`email`)),_(`contact`,o.find(e=>e.kind===`tel`)),h}function Do(e,t,n){let r={};for(let i of[`subtotal`,`discount`,`tax`,`total`]){let a=Object.keys(t).find(e=>t[e]?.includes(i)&&(!n||n.some(t=>t.name===e)));if(!a)continue;let o=e[a];r[i]=typeof o==`number`&&Number.isSafeInteger(o)?o:null}return br(e.lineAmountType)&&(!n||n.some(e=>e.name===`lineAmountType`))&&(r.lineAmountType=e.lineAmountType),r}function Oo(e){return Object.keys(e).filter(t=>[`subtotal`,`discount`,`tax`,`total`].some(n=>e[t]?.includes(n)))}var ko=c(`<span class="smrt-record-screen__count svelte-1ijjiku"> </span>`),Ao=c(`<a class="smrt-record-screen__view-all svelte-1ijjiku"> </a>`),jo=c(`<span class="smrt-record-screen__widget-heading svelte-1ijjiku"><span class="smrt-record-screen__widget-title"> <!></span> <!></span>`),Mo=c(`<section class="smrt-record-screen__items svelte-1ijjiku"><!></section>`),No=c(`<!> <!>`,1),Po=c(`<aside class="smrt-record-screen__aside svelte-1ijjiku"><h2 class="smrt-record-screen__aside-title svelte-1ijjiku"> </h2> <!></aside>`),Fo=c(`<div class="smrt-record-screen__sheet-body svelte-1ijjiku"><!></div>`),Io=c(`<section class="smrt-record-screen__sheet svelte-1ijjiku" data-smrt-component="RecordScreen"><!></section>`),Lo=c(`<div data-smrt-component="RecordScreen"><div class="smrt-record-screen__main svelte-1ijjiku"><!> <!> <section class="smrt-record-screen__related svelte-1ijjiku"><!></section></div> <!></div> <!>`,1);function Ro(r,c){h(c,!0);let u=(r,i=p,a=p)=>{let o=n(()=>i().type===`records`&&fe(i())&&q.entry(i()).status===`ready`?e(K)[i().id]:void 0);var u=jo(),d=k(u),f=k(d,!0),m=M(f),h=t=>{var n=ko(),r=P(n);R(e=>l(r,` · ${e??``}`),[()=>new Intl.NumberFormat(c.locale).format(e(o).count)]),x(t,n)};t(m,t=>{e(o)&&e(o).count!==null&&t(h)}),s(d);var g=M(d,2),_=t=>{var n=Ao(),r=P(n,!0);R(t=>{z(n,`href`,e(o).href),l(r,t)},[()=>b($[`ui.screens.view_all`])]),x(t,n)};t(g,t=>{e(o)?.href&&t(_)}),s(u),R(()=>l(f,a())),x(r,u)},d=r=>{var i=No(),a=I(i),l=t=>{var r=S(),i=I(r);ne(i,()=>e(T),t=>{{let r=n(()=>c.fieldErrors??{});uo(t,{get definition(){return c.definition},get policy(){return f()},get currency(){return e(U)},get fields(){return c.fields},get record(){return c.record},showHeader:!1,get submitting(){return v()},get fieldErrors(){return e(r)},get error(){return y()},get onsubmit(){return c.onsave},oncancel:me,get derivedFields(){return e(oe)}})}}),x(t,r)};t(a,e=>{c.onsave&&e(l)});var u=M(a,2),d=e=>{var t=Mo(),n=k(t);o(n,()=>c.items),s(t),R(e=>z(t,`aria-label`,e),[()=>b($[`ui.screens.items`])]),x(e,t)};t(u,e=>{c.items&&e(d)}),x(r,i)},f=E(c,`policy`,3,null),m=E(c,`relations`,19,()=>[]),g=E(c,`canCustomize`,3,!0),_=E(c,`deleting`,3,!1),v=E(c,`submitting`,3,!1),y=E(c,`error`,3,null),{t:b}=ae(),C=n(()=>jn(c.definition)),w=n(()=>c.definition.idField??`id`),T=n(()=>c.record[e(w)]===void 0||c.record[e(w)]===null?``:String(c.record[e(w)])),O=n(()=>c.mode===`edit`),A=n(()=>b($[`ui.screens.edit_title`],{name:e(C).singular.toLowerCase()})),N=n(()=>Cn(c.definition)),L=n(()=>Pn(c.definition,f())?[]:Rn(c.definition,f(),{mode:`view`,include:c.fields})),re=n(()=>Eo(c.definition,e(L),c.record,e(N),{title:c.title})),V=n(()=>m().some(e=>e.kind===`items`)),H=n(()=>Tn(c.definition)),U=n(()=>{if(c.currency)return c.currency;let t=e(H)?c.record[e(H)]:void 0;return typeof t==`string`&&/^[A-Za-z]{3}$/.test(t.trim())?t.trim().toUpperCase():void 0}),oe=n(()=>c.derivedFields??(e(V)?Oo(e(N)):[])),se=F(()=>{let t=c.loaders?.records;if(c.registry&&!t)return c.registry;let n=ot();if(c.registry)for(let e of c.registry.list())n.register(e);else pa(n,c.loaders??{});if(t){let r=ot();La(r,{relations:m(),records:t,viewAllHref:e=>c.viewAllHref?.(e),totals:()=>Do(c.record,e(N),e(L)),storedTotals:()=>c.lineItemStoredTotals?.(),currency:()=>e(U)});for(let e of r.list())n.has(e.type)||n.register(e)}return n}),W=F(()=>c.overview??yr(c.definition,m())),G=F(()=>c.override!==void 0),ce=n(()=>m().filter(e=>e.kind!==`reference`)),K=D(j({}));function le(t,n){if(t.type!==`records`)return n;let r=fe(t);if(!r||!Q(n))return n;let{total:i,href:a,...o}=n,s=Array.isArray(o.rows)?o.rows.length:null,l=typeof i==`number`&&i>(s??0)&&Array.isArray(o.columns)&&o.columns.length>0;return B(K,{...e(K),[t.id]:{count:typeof i==`number`&&Number.isFinite(i)?i:s,href:c.viewAllHref?.(r)??(typeof a==`string`?St(a):null)}},!0),l?{...o,total:i}:o}let q=pt({definition:W,registry:se,override:G?()=>c.override??null:void 0,onchange:e=>c.onoverviewchange?.(e),canCustomize:()=>g(),loadWidget:(t,n)=>{let r=se.get(t.type)?.load;if(!r)return Promise.resolve(void 0);let i={...c.widgetContext,overviewId:W.id,signal:n,locale:typeof c.widgetContext?.locale==`string`?c.widgetContext.locale:c.locale,record:{model:c.definition.objectRef,id:e(T)}};return Promise.resolve(r(t.options,i)).then(e=>le(t,e))}});te(()=>q.destroy());let J=n(()=>e(V)&&q.document.widgets.some(e=>e.type===`line-items`)),ue=n(()=>[...e(re).shown,...e(H)?[e(H)]:[],...e(J)?Oo(e(N)):[]]),de=F(()=>e(T));ee(()=>{let t=e(T);t!==de&&(de=t,F(()=>{for(let e of q.document.widgets)q.reload(e.id)}))}),ee(()=>{G&&(c.override,F(()=>q.sync()))});let Y=n(()=>{let t=[];for(let n of e(ce))t.some(e=>e.value===n.model)||t.push({value:n.model,label:n.label});return t});function fe(t){let{filter:n,model:r,field:i}=t.options;if(n===`parent`)return e(ce).find(e=>e.model===r&&e.field===i)}let pe=D(!0);ee(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(`(min-width: 48rem)`),t=()=>{B(pe,e.matches,!0)};return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)});function me(){c.oncancel?.()}var he=Lo(),ge=I(he);let _e;var X=k(ge),ve=k(X);{let t=n(()=>e(O)?void 0:c.onedit);Co(ve,{get definition(){return c.definition},get model(){return e(re)},get record(){return c.record},get relations(){return m()},get hrefFor(){return c.hrefFor},get labels(){return c.labels},get currency(){return e(U)},get locale(){return c.locale},get backLabel(){return c.backLabel},get deleting(){return _()},get statusTones(){return c.statusTones},get onback(){return c.onback},get onedit(){return e(t)},get ondelete(){return c.ondelete},get extraActions(){return c.extraActions}})}var ye=M(ve,2);$a(ye,{get definition(){return c.definition},get policy(){return f()},get record(){return c.record},get relations(){return m()},get fields(){return c.fields},get currency(){return e(U)},get locale(){return c.locale},get hrefFor(){return c.hrefFor},get labels(){return c.labels},showHeader:!1,get exclude(){return e(ue)},hideEmpty:!0,variant:`card`,children:(e,t)=>{var n=S(),r=I(n);o(r,()=>c.children??p),x(e,n)},$$slots:{default:!0}});var be=M(ye,2),xe=k(be);{let t=n(()=>b($[`ui.screens.related`]));Qt(xe,{get controller(){return q},get editing(){return c.layoutEditing},presentation:`plain`,headingLevel:2,get heading(){return u},get label(){return e(t)},get models(){return e(Y)}})}s(be),s(X);var Se=M(X,2),Ce=t=>{var n=Po(),r=k(n),i=P(r,!0),a=M(r,2);d(a),s(n),R(()=>{z(n,`aria-label`,e(A)),l(i,e(A))}),x(t,n)};t(Se,t=>{e(O)&&e(pe)&&t(Ce)}),s(ge);var we=M(ge,2),Te=n=>{var r=Io(),i=k(r);ie(i,{get open(){return e(O)},get title(){return e(A)},onclose:me,variant:`page`,children:(n,r)=>{var i=S(),a=I(i),o=e=>{var t=Fo(),n=k(t);d(n),s(t),x(e,t)};t(a,t=>{e(O)&&t(o)}),x(n,i)},$$slots:{default:!0}}),s(r),x(n,r)};t(we,t=>{e(pe)||t(Te)}),R(t=>{_e=a(ge,1,`smrt-record-screen svelte-1ijjiku`,null,_e,{"smrt-record-screen--edit":e(O)}),z(ge,`data-mode`,c.mode),z(be,`aria-label`,t)},[()=>b($[`ui.screens.related`])]),x(r,he),i()}var zo=[`name`,`title`,`label`,`code`];function Bo(e){let t=e.display?.label,n=new Set(e.fields.map(e=>e.name));return[...t?[t]:[],...zo].filter((e,t,r)=>n.has(e)&&r.indexOf(e)===t)}function Vo(e,t){for(let n of Bo(e)){let e=t[n];if(typeof e==`string`&&e.trim()!==``)return e}}var Ho=e=>e.type===`foreignKey`||e.type===`crossPackageRef`,Uo=[/^customer/i,/^vendor/i,/^profile/i,/^product/i,/^invoice/i,/^order/i,/^payment/i,/^contract/i];function Wo(e){if(Bo(e).some(e=>e!==`code`))return;let t=e.fields.filter(e=>!e.system),n=wn(Cn({objectRef:e.id,className:e.name,fields:Object.fromEntries(t.map(e=>[e.name,{type:Go.has(e.type)?e.type:`text`,...e.enum?.length?{enum:e.enum}:{},...e.ui?{ui:{...e.ui}}:{}}]))}),`identifier`);return n?t.find(e=>e.name===n):void 0}var Go=new Set([`text`,`integer`,`decimal`,`boolean`,`datetime`,`json`,`foreignKey`,`crossPackageRef`]);function Ko(e,t){let n=Wo(e),r=n?t[n.name]:void 0;return typeof r==`string`&&r.trim()!==``?r:void 0}function qo(e,t){let n=e.filter(e=>Ho(e)&&typeof t[e.name]==`string`&&t[e.name]!==``);for(let e of Uo){let t=n.find(t=>e.test(t.name));if(t)return t}}var Jo=/(paid|allocated|issue|^date$|createdat)/i;function Yo(e,t,n,r=e.fields){let i=Vo(e,t);if(i)return i;let a=Ko(e,t);if(a)return a;let o=qo(r,t),s=o?.related?n(o,String(t[o.name])):void 0;if(e.fields.find(e=>e.name===`amount`&&e.type===`integer`)&&typeof t.amount==`number`){let n=e.fields.find(e=>e.type===`datetime`&&Jo.test(e.name)&&t[e.name]);return Zo([s,G(t.amount),n?String(t[n.name]).slice(0,10):void 0])}return Zo([s,typeof t.description==`string`&&t.description.trim()!==``?t.description:void 0])}function Xo(e,t,n,r){if(Vo(e,t))return n;let i=Ko(e,t);return i&&i===n?`${r} ${i}`:n}function Zo(e){let t=e.filter(e=>!!e);return t.filter((e,n)=>t.indexOf(e)===n).join(` · `)||void 0}function Qo(e){return(e.type===`foreignKey`||e.type===`crossPackageRef`)&&typeof e.related==`string`}function $o(e,t){if(e.type===`boolean`)return`boolean`;if(Qo(e))return`relation`;if(e.enum&&e.enum.length>0)return`enum`;if(e.ui?.widget)return e.ui.widget;if(e.type===`json`&&t!==void 0&&(J[t]??[]).includes(e.name))return`address`;if(se(e))return`money`;if(q(e))return`percent`;switch(e.type){case`datetime`:return`datetime`;case`integer`:return`integer`;case`decimal`:return`decimal`;case`json`:return`json`;default:return`text`}}var es=e=>typeof e==`number`&&Number.isFinite(e)?e:0;function ts(e){let t=e.name;if(e.type===`json`)return 99;if(/^(name|title|label|code)$|Number$|^number$/.test(t))return 0;if(t===`reference`&&e.type===`text`)return .5;if(t===`description`&&e.type===`text`)return 5.9;if(Qo(e))return/^(customer|vendor|profile)/i.test(t)?1:/^(contract|.*(journal|account))/i.test(t)?7:2;if((e.enum?.length??0)>0&&/(status|state|stage)$/i.test(t))return 3;if(/^(totalAmount|amount|total)$/.test(t))return 4;if(e.type===`datetime`){if(/^start(date|at)?$/i.test(t))return 1.2;if(/^due/i.test(t))return 5;if(/(issue|paid|allocated|^date$)/i.test(t))return 5.2}return 6}function ns(e,t=6){let n=e.filter(e=>e.type!==`json`),r=new Set(n.slice(0,3)),i=n.filter(e=>r.has(e)||ts(e)<6||[`integer`,`decimal`,`boolean`,`datetime`].includes(e.type)||(e.enum?.length??0)>0||Qo(e)).map((e,t)=>({f:e,i:t,rank:ts(e)})).sort((e,t)=>e.rank-t.rank||e.i-t.i).map(e=>e.f),a=n.find(e=>e.name===`totalAmount`);if(a&&n.some(e=>e.name===`amountPaid`)){let e={...a,name:`amountDue`,label:`Amount due`,required:!1,derive:e=>es(e.totalAmount)-es(e.amountPaid)},t=i.findIndex(e=>e.name===`totalAmount`);i.splice(t<0?i.length:t+1,0,e)}let o=n.some(e=>e.name===`allDay`);return i.slice(0,t).map(e=>o&&e.type===`datetime`&&/^(start|end)(date|at)$/i.test(e.name)?{...e,showTime:!0}:e)}function rs(e,t){return e.derive?e.derive(t):t[e.name]}function is(e,t,n){return e.filter(e=>e[t]===n)}function as(e){if(e.default!==void 0&&e.default!==null)return e.default;let t=e.enum??[];return t.length>0&&(e.required||/(status|state|stage)$/i.test(e.name))?t.includes(`draft`)?`draft`:t[0]:e.type===`boolean`?!1:e.type===`text`?``:null}function os(e){let t={};for(let n of e)t[n.name]=as(n);return t}function ss(e,t,n){return{...os(e),[t]:n}}var cs=e=>e==null||typeof e==`string`&&e.trim()===``;function ls(e,t,n=new Set){let r={};for(let i of e)i.required&&i.type!==`boolean`&&!n.has(i.name)&&cs(t[i.name])&&(r[i.name]=`${i.label} is required.`);return r}function us(e,t){let n=e.filter(e=>t[e.name]).map(e=>e.label);return n.length===0?``:`Cannot save yet: ${n.join(`, `)} ${n.length===1?`is`:`are`} required.`}function ds(e,t,n,r){return Yo(e,n,(e,t)=>e.related?r.get(ce(e.related,t)):void 0,t)??``}var fs=`@happyvertical/smrt-profiles:Profile`,ps=`@happyvertical/smrt-commerce:Customer`,ms=`@happyvertical/smrt-commerce:Vendor`,hs=20;function gs(e){let t=W(e);if(!t)throw Error(`The catalog has no model ${e}`);return t.model}function _s(e){return String(e??``).slice(0,8)}function vs(e){return e.fields.some(e=>e.name===`profileId`&&e.related===`@happyvertical/smrt-profiles:Profile`)}async function ys(e,t){return typeof t.profileId==`string`&&t.profileId?e.get(gs(fs),t.profileId):void 0}var bs=3;async function xs(e,t,n,r=0,i){if(vs(t)){let t=await ys(e,n),r=t&&Vo(gs(`@happyvertical/smrt-profiles:Profile`),t);if(r)return r}let a=qo(t.fields,n);if(a&&a.name===i){let e=Yo(t,n,()=>void 0);if(e)return e}let o=a?.related?W(a.related)?.model:void 0,s;if(a&&o&&r<bs){let t=await e.get(o,String(n[a.name]));t&&(s=await xs(e,o,t,r+1))}return Yo(t,n,()=>s)??_s(n.id)}async function Ss(e,t,n){let r=new Map;for(let i of t){let t=i.related;if(!t)continue;let a=W(t)?.model;if(!a)continue;let o=new Set(n.map(e=>e[i.name]).filter(e=>typeof e==`string`&&e!==``));for(let n of o){if(r.has(ce(t,n)))continue;let i=await e.get(a,n);i&&r.set(ce(t,n),await xs(e,a,i))}}return r}var Cs=(e,t)=>e.toLowerCase().includes(t.trim().toLowerCase());async function ws(e,t,n){let r=[];for(let i of await e.list(t)){let a=await xs(e,t,i);if(Cs(a,n)&&r.push({id:i.id,label:a}),r.length>=hs)break}return r}async function Ts(e,t,n){let r=await e.get(t,n);return r?{id:r.id,label:await xs(e,t,r)}:null}var Es=e=>typeof e==`string`&&e!==``?e:void 0;async function Ds(e,t){let n=await ys(e,t);return{...n?{id:n.id}:{},name:(n&&Vo(gs(`@happyvertical/smrt-profiles:Profile`),n))??_s(t.id),...Es(n?.email)?{email:Es(n?.email)}:{}}}async function Os(e,t){return{id:t.id,...Es(t.profileId)?{profileId:Es(t.profileId)}:{},profile:await Ds(e,t),status:Es(t.status)??``,...Es(t.customerType)?{customerType:Es(t.customerType)}:{},...typeof t.creditLimit==`number`?{creditLimitMinor:t.creditLimit}:{},...Es(t.paymentTerms)?{paymentTerms:Es(t.paymentTerms)}:{}}}async function ks(e,t){return{id:t.id,...Es(t.profileId)?{profileId:Es(t.profileId)}:{},profile:await Ds(e,t),status:Es(t.status)??``,...typeof t.leadTimeDays==`number`?{leadTimeDays:t.leadTimeDays}:{},...Es(t.currency)?{currency:Es(t.currency)}:{}}}async function As(e,t){let n=[];for(let r of await e.list(gs(ps))){let i=await Os(e,r);if(Cs(i.profile.name,t)&&n.push(i),n.length>=hs)break}return n}async function js(e,t){let n=await e.get(gs(ps),t);return n?Os(e,n):null}async function Ms(e,t){let n=[];for(let r of await e.list(gs(ms))){let i=await ks(e,r);if(Cs(i.profile.name,t)&&n.push(i),n.length>=hs)break}return n}async function Ns(e,t){let n=await e.get(gs(ms),t);return n?ks(e,n):null}export{yr as A,pt as B,Do as C,ai as D,pa as E,Tn as F,Je as G,lt as H,Cn as I,et as K,Qt as L,ar as M,rr as N,Nr as O,kn as P,vt as R,Ro as S,Fa as T,nt as U,ot as V,rt as W,ds as _,Ts as a,Bo as b,ws as c,ss as d,os as f,ls as g,ns as h,js as i,_r as j,Ar as k,Ms as l,us as m,xs as n,Ns as o,rs as p,Ve as q,Ss as r,As as s,vs as t,_s as u,is as v,Ia as w,Xo as x,$o as y,_t as z};
@@ -1 +1 @@
1
- import{D as e,M as t,w as n}from"./DtyQVtuI.js";import{r}from"./BRb3XNWx.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"./BqoDi2ah.js";import{r}from"./D4ZXuDn5.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,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.DiMcia2m.js","../chunks/COiEfhsA.js","../chunks/DG3qFFTE.js","../chunks/BRphH2sp.js","../chunks/Dt-HX3Vu.js","../chunks/xihTtKlq.js","../chunks/DtyQVtuI.js","../chunks/YUSKx8_q.js","../chunks/DK8Blf1Y.js","../assets/currency-metadata.ksbBA8-C.css","../assets/app.BHwMQ9Zv.css","../chunks/LqlI_3J_.js","../chunks/BaNbYf_w.js","../chunks/Bv5jGtB8.js","../assets/feedback.qFktqYFY.css","../chunks/By9nPosf.js","../assets/SegmentedControl.DMqHG5fn.css","../chunks/DIE02RSm.js","../assets/webmcp-ui-context.hO24Ni5w.css","../chunks/Dij7Mzy3.js","../assets/data.CVlX_W0i.css","../chunks/CUyVrfsu.js","../chunks/Bs5WxZDd.js","../assets/forms.BRdbPdvs.css","../chunks/BYcBM-fh.js","../assets/AppShell.Y0ysizZK.css","../chunks/CHp1-Djt.js","../assets/workspace.C40zM0Mb.css","../chunks/BXYF4p6C.js","../chunks/H-AOqvBm.js","../chunks/C7zBd-pD.js","../chunks/CMrsF8nJ.js","../chunks/D042ejzG.js","../chunks/BEfnNZ_r.js","../chunks/BQxY8kkL.js","../chunks/DiDXEaeE.js","../chunks/cGI232sj.js","../chunks/jGR6M6GD.js","../assets/state.C0UZEhxS.css","../assets/labels.Dxa6EyRI.css","../chunks/pwK8zqRY.js","../chunks/xfjCb9hA.js","../assets/icons.DFiHs25V.css","../chunks/BDBI1GHG.js","../chunks/Die26Dpp.js","../chunks/Cp6EyiHL.js","../chunks/d934w91N.js","../chunks/BF1b-PyI.js","../chunks/ca0lfv12.js","../assets/planner.DOQVfcOi.css","../chunks/D_U_DYjx.js","../chunks/BEQ1toJ7.js","../chunks/BRb3XNWx.js","../chunks/CWmRZDhs.js","../chunks/Dbk0PTBM.js","../chunks/DkYxX008.js","../assets/SectionIcons.BGFcFuOf.css","../assets/SectionActions.BE1CPmxk.css","../chunks/BMgzWMdF.js","../chunks/CgAkqYsL.js","../assets/0.BaRFeYGU.css","../nodes/1.D-mIIzUL.js","../nodes/2.U2UZdfCQ.js","../chunks/JHAQM1Si.js","../assets/AiSetup.CrvuNhMR.css","../chunks/47rG5f1n.js","../assets/percent.BGI-foAF.css","../chunks/BkEeNbLN.js","../assets/2.D3Ee82Nk.css","../nodes/3.BNTsN4bw.js","../assets/3.D518dbB5.css","../nodes/4.eKv786mR.js","../assets/4.B3vt1gMJ.css","../nodes/5.k0okSbWb.js","../nodes/6.RSsmFdBk.js","../nodes/7.BZAahN28.js","../chunks/DRByVC-c.js","../chunks/eI3Mmq4z.js","../chunks/CO-Ek-HE.js","../chunks/CMr90D2v.js","../assets/FieldMapForm.C8SZ3t4N.css","../chunks/JBD5vUbP.js","../assets/ModelPage.SIoeO-AU.css","../nodes/8.B9PW4VE1.js","../nodes/9.DYbPqDvx.js","../nodes/10.BFt6ON7M.js","../assets/10.CdYxvH4G.css","../nodes/11.Cxs1R6fC.js","../chunks/DdiQBZrC.js","../assets/ConnectTools.DTleL8YA.css","../assets/11.nOT5Z4Fv.css","../nodes/12.BCudMLPz.js","../assets/12.F7A7zP4J.css","../nodes/13.DAt_b1gK.js","../assets/13.JoySu8W5.css","../nodes/14.CQQuhb60.js","../assets/14.VAFbAoxW.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.DiMcia2m.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]),import.meta.url),()=>T(()=>import(`../nodes/1.D-mIIzUL.js`),__vite__mapDeps([61,2,1,5,45,3,4]),import.meta.url),()=>T(()=>import(`../nodes/2.U2UZdfCQ.js`),__vite__mapDeps([62,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,50,51,43,48,52,53,58,63,64,65,66,67,68]),import.meta.url),()=>T(()=>import(`../nodes/3.BNTsN4bw.js`),__vite__mapDeps([69,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,46,58,70]),import.meta.url),()=>T(()=>import(`../nodes/4.eKv786mR.js`),__vite__mapDeps([71,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,46,63,64,72]),import.meta.url),()=>T(()=>import(`../nodes/5.k0okSbWb.js`),__vite__mapDeps([73,2,1,3,4,5,44,46]),import.meta.url),()=>T(()=>import(`../nodes/6.RSsmFdBk.js`),__vite__mapDeps([74,2,1,3,4,5,44,46]),import.meta.url),()=>T(()=>import(`../nodes/7.BZAahN28.js`),__vite__mapDeps([75,1,2,5,6,7,8,9,10,76,4,77,3,13,14,15,16,26,11,12,17,18,19,20,21,22,23,24,25,27,44,45,36,37,38,39,35,78,47,40,41,48,49,50,55,56,52,53,59,79,65,32,66,80,81,82]),import.meta.url),()=>T(()=>import(`../nodes/8.B9PW4VE1.js`),__vite__mapDeps([83,1,2,5,6,7,8,9,10,37,13,14,15,16,19,20,38,76,4,77,3,26,11,12,17,18,21,22,23,24,25,27,44,45,36,39,35,78,47,40,41,48,49,50,55,56,52,53,59,79,65,32,66,80,81,82]),import.meta.url),()=>T(()=>import(`../nodes/9.DYbPqDvx.js`),__vite__mapDeps([84,1,2,5,6,7,8,9,10,37,13,14,15,16,19,20,38,76,4,77,3,26,11,12,17,18,21,22,23,24,25,27,44,45,36,39,35,78,47,40,41,48,49,50,55,56,52,53,59,79,65,32,66,80,81,82]),import.meta.url),()=>T(()=>import(`../nodes/10.BFt6ON7M.js`),__vite__mapDeps([85,2,1,5,6,7,8,9,10,17,18,22,15,16,23,67,43,11,12,13,14,19,20,21,24,25,26,27,86]),import.meta.url),()=>T(()=>import(`../nodes/11.Cxs1R6fC.js`),__vite__mapDeps([87,1,2,5,6,7,8,9,10,76,4,88,89,90]),import.meta.url),()=>T(()=>import(`../nodes/12.BCudMLPz.js`),__vite__mapDeps([91,1,2,5,6,7,8,9,10,15,16,22,23,37,13,14,19,20,38,55,56,76,4,79,36,17,18,39,50,52,65,21,32,12,66,80,92]),import.meta.url),()=>T(()=>import(`../nodes/13.DAt_b1gK.js`),__vite__mapDeps([93,1,2,5,6,7,8,9,10,37,13,14,15,16,19,20,38,55,56,76,4,81,88,89,94]),import.meta.url),()=>T(()=>import(`../nodes/14.CQQuhb60.js`),__vite__mapDeps([95,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,45,3,4,36,37,38,39,35,78,41,50,55,56,54,57,59,96]),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.CpAyxFG1.js","../chunks/COiEfhsA.js","../chunks/DG3qFFTE.js","../chunks/CmzwyvUc.js","../chunks/Dt-HX3Vu.js","../chunks/xihTtKlq.js","../chunks/BqoDi2ah.js","../chunks/YUSKx8_q.js","../chunks/DK8Blf1Y.js","../assets/currency-metadata.ksbBA8-C.css","../assets/app.BHwMQ9Zv.css","../chunks/CRAFzMd4.js","../chunks/BaNbYf_w.js","../chunks/Bv5jGtB8.js","../assets/feedback.qFktqYFY.css","../chunks/By9nPosf.js","../assets/SegmentedControl.DMqHG5fn.css","../chunks/DIE02RSm.js","../assets/webmcp-ui-context.hO24Ni5w.css","../chunks/D18ccNbM.js","../assets/data.CVlX_W0i.css","../chunks/CUyVrfsu.js","../chunks/Bs5WxZDd.js","../assets/forms.BRdbPdvs.css","../chunks/BYcBM-fh.js","../assets/AppShell.Y0ysizZK.css","../chunks/CEnFvaV_.js","../assets/workspace.C40zM0Mb.css","../chunks/DNKv-5Rn.js","../chunks/C3_MyZ8U.js","../chunks/C7zBd-pD.js","../chunks/CMrsF8nJ.js","../chunks/D042ejzG.js","../chunks/BEfnNZ_r.js","../chunks/BQxY8kkL.js","../chunks/CYV1bZYS.js","../chunks/qBSxbVXE.js","../chunks/BkH1cevg.js","../assets/state.C0UZEhxS.css","../assets/labels.Dxa6EyRI.css","../chunks/CguB2Z-c.js","../chunks/3YcXW6yo.js","../assets/icons.DFiHs25V.css","../chunks/DdwZKwdT.js","../chunks/Do3aLnHk.js","../chunks/BKaViC3K.js","../chunks/d934w91N.js","../chunks/B6l3em0z.js","../chunks/WxmttVik.js","../assets/planner.DOQVfcOi.css","../chunks/D_U_DYjx.js","../chunks/Cwt6a32V.js","../chunks/D4ZXuDn5.js","../chunks/yoo-DzHO.js","../chunks/masgq8Qh.js","../chunks/cgG95It7.js","../assets/SectionIcons.BGFcFuOf.css","../assets/SectionActions.BE1CPmxk.css","../chunks/BMgzWMdF.js","../chunks/CgAkqYsL.js","../assets/0.BaRFeYGU.css","../nodes/1.BIIgo6hP.js","../nodes/2.BsxeuTRf.js","../chunks/BMzaHFhM.js","../assets/AiSetup.CrvuNhMR.css","../chunks/CR7v6iSc.js","../assets/percent.BGI-foAF.css","../chunks/CckqctPA.js","../assets/2.D3Ee82Nk.css","../nodes/3.4GrrsC59.js","../assets/3.D518dbB5.css","../nodes/4.CyWWMczB.js","../assets/4.B3vt1gMJ.css","../nodes/5.B3AevRqW.js","../nodes/6.DOjCozUO.js","../nodes/7.BVKnH6b6.js","../chunks/DRByVC-c.js","../chunks/BSd70kcz.js","../chunks/CO-Ek-HE.js","../chunks/D4xI8dt4.js","../assets/FieldMapForm.C8SZ3t4N.css","../chunks/JBD5vUbP.js","../assets/ModelPage.SIoeO-AU.css","../nodes/8.wnGurkrO.js","../nodes/9.PyL2mnd3.js","../nodes/10.p-z5jbqI.js","../assets/10.CdYxvH4G.css","../nodes/11.DikmsDwP.js","../chunks/B5cHPql0.js","../assets/ConnectTools.DTleL8YA.css","../assets/11.nOT5Z4Fv.css","../nodes/12.OJHha47l.js","../assets/12.F7A7zP4J.css","../nodes/13.B5uFEHhN.js","../assets/13.JoySu8W5.css","../nodes/14.DSqhro7V.js","../assets/14.VAFbAoxW.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.CpAyxFG1.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]),import.meta.url),()=>T(()=>import(`../nodes/1.BIIgo6hP.js`),__vite__mapDeps([61,2,1,5,45,3,4]),import.meta.url),()=>T(()=>import(`../nodes/2.BsxeuTRf.js`),__vite__mapDeps([62,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,50,51,43,48,52,53,58,63,64,65,66,67,68]),import.meta.url),()=>T(()=>import(`../nodes/3.4GrrsC59.js`),__vite__mapDeps([69,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,46,58,70]),import.meta.url),()=>T(()=>import(`../nodes/4.CyWWMczB.js`),__vite__mapDeps([71,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,46,63,64,72]),import.meta.url),()=>T(()=>import(`../nodes/5.B3AevRqW.js`),__vite__mapDeps([73,2,1,3,4,5,44,46]),import.meta.url),()=>T(()=>import(`../nodes/6.DOjCozUO.js`),__vite__mapDeps([74,2,1,3,4,5,44,46]),import.meta.url),()=>T(()=>import(`../nodes/7.BVKnH6b6.js`),__vite__mapDeps([75,1,2,5,6,7,8,9,10,76,4,77,3,13,14,15,16,26,11,12,17,18,19,20,21,22,23,24,25,27,44,45,36,37,38,39,35,78,47,40,41,48,49,50,55,56,52,53,59,79,65,32,66,80,81,82]),import.meta.url),()=>T(()=>import(`../nodes/8.wnGurkrO.js`),__vite__mapDeps([83,1,2,5,6,7,8,9,10,37,13,14,15,16,19,20,38,76,4,77,3,26,11,12,17,18,21,22,23,24,25,27,44,45,36,39,35,78,47,40,41,48,49,50,55,56,52,53,59,79,65,32,66,80,81,82]),import.meta.url),()=>T(()=>import(`../nodes/9.PyL2mnd3.js`),__vite__mapDeps([84,1,2,5,6,7,8,9,10,37,13,14,15,16,19,20,38,76,4,77,3,26,11,12,17,18,21,22,23,24,25,27,44,45,36,39,35,78,47,40,41,48,49,50,55,56,52,53,59,79,65,32,66,80,81,82]),import.meta.url),()=>T(()=>import(`../nodes/10.p-z5jbqI.js`),__vite__mapDeps([85,2,1,5,6,7,8,9,10,17,18,22,15,16,23,67,43,11,12,13,14,19,20,21,24,25,26,27,86]),import.meta.url),()=>T(()=>import(`../nodes/11.DikmsDwP.js`),__vite__mapDeps([87,1,2,5,6,7,8,9,10,76,4,88,89,90]),import.meta.url),()=>T(()=>import(`../nodes/12.OJHha47l.js`),__vite__mapDeps([91,1,2,5,6,7,8,9,10,15,16,22,23,37,13,14,19,20,38,55,56,76,4,79,36,17,18,39,50,52,65,21,32,12,66,80,92]),import.meta.url),()=>T(()=>import(`../nodes/13.B5uFEHhN.js`),__vite__mapDeps([93,1,2,5,6,7,8,9,10,37,13,14,15,16,19,20,38,55,56,76,4,81,88,89,94]),import.meta.url),()=>T(()=>import(`../nodes/14.DSqhro7V.js`),__vite__mapDeps([95,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,45,3,4,36,37,38,39,35,78,41,50,55,56,54,57,59,96]),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/CmzwyvUc.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,F as a,Ft as o,G as s,H as c,J as l,L as u,Lt as d,Ot as f,Pt as p,R as m,T as h,U as g,W as _,X as v,Y as y,Z as b,a as x,b as S,bt as C,ct as w,d as T,dt as E,ft as D,gt as O,ht as k,k as A,kt as ee,l as j,mt as M,nt as N,ot as P,pt as F,r as I,s as te,st as L,ut as ne,v as R,vt as z,wt as B,z as re}from"../chunks/DG3qFFTE.js";import{a as ie,i as ae,n as V,r as oe,t as se,u as ce}from"../chunks/BRphH2sp.js";import"../chunks/xihTtKlq.js";import{a as le,i as ue,n as H,o as de,p as fe,s as pe,t as U,vt as me,xt as he,yt as ge}from"../chunks/DtyQVtuI.js";import{n as W}from"../chunks/DK8Blf1Y.js";import{i as _e,m as ve,n as ye,p as be,t as xe}from"../chunks/LqlI_3J_.js";import{n as Se}from"../chunks/CHp1-Djt.js";import{u as Ce}from"../chunks/DIE02RSm.js";import{c as G,d as we,h as Te,s as Ee}from"../chunks/Dij7Mzy3.js";import{A as De,C as Oe,D as ke,E as Ae,S as je,b as Me,i as K,j as Ne,n as Pe,r as Fe,s as Ie,t as Le}from"../chunks/BXYF4p6C.js";import"../chunks/BDBI1GHG.js";import"../chunks/Die26Dpp.js";import{t as q}from"../chunks/Cp6EyiHL.js";import{T as Re,m as ze,n as J,o as Be,t as Ve,w as He}from"../chunks/DiDXEaeE.js";import{M as Y,P as Ue,U as We,V as Ge,b as X,g as Ke,nt as qe,t as Z,u as Je,v as Ye,z as Xe}from"../chunks/jGR6M6GD.js";import{g as Q,h as Ze,v as Qe}from"../chunks/pwK8zqRY.js";import{n as $e,t as et}from"../chunks/xfjCb9hA.js";import"../chunks/d934w91N.js";import{a as tt,n as nt,s as rt,t as it,u as at}from"../chunks/BF1b-PyI.js";import{r as ot,t as st}from"../chunks/D_U_DYjx.js";import{_ as ct,a as lt,c as ut,d as dt,f as ft,h as pt,i as mt,l as ht,m as gt,o as $,r as _t,s as vt,t as yt}from"../chunks/BEQ1toJ7.js";import{n as bt}from"../chunks/ca0lfv12.js";import{t as xt}from"../chunks/Dbk0PTBM.js";import{a as St,i as Ct,n as wt,r as Tt}from"../chunks/BMgzWMdF.js";import{n as Et}from"../chunks/CgAkqYsL.js";var Dt=e({prerender:()=>!0,trailingSlash:()=>Ot}),Ot=`always`,kt=`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`,At=s(`<a class="cap svelte-nioco2"><!></a>`),jt=s(`<div class="ai-status svelte-nioco2" role="group" aria-label="AI models"></div>`);function Mt(e,n){f(n,!1);let r={think:Fe,hear:Le,speak:Pe};j();var a=jt();u(a,5,()=>K.capabilities,e=>e.id,(e,n)=>{var i=At(),a=D(i);qe(a,{get path(){return r[t(n).id]},size:20}),o(i),L(e=>{R(i,`href`,e),R(i,`data-state`,t(n).state),R(i,`aria-label`,t(n).label),R(i,`title`,t(n).label)},[()=>U(`/ai/`)]),g(e,i)}),o(a),g(e,a),i()}function Nt(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`)!==null}function Pt(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 Ft=s(`<div><!></div>`);function It(e,n){f(n,!0);let a=x(n,`answered`,3,null),s=nt(ot()),c=r(()=>J.settings().currency),l=r(()=>s.fieldsFor(n.proposal.spec.source)),u=C(O(a())),d=C(null);function p(e){z(u,e,!0),n.onoutcome?.(e)}function m(e){p({status:`saved`,report:{id:e.id,title:e.title}}),it(t(d),e)}var h=Ft(),_=D(h);at(_,{get proposal(){return n.proposal},get confirm(){return s.save},reportHref:e=>U(tt(e)),onsaved:m,ondecline:()=>p({status:`declined`}),get outcome(){return t(u)},get fields(){return t(l)},get currency(){return t(c)}}),o(h),T(h,e=>z(d,e),()=>t(d)),g(e,h),i()}var Lt=s(`<span role="status" aria-live="polite"> </span> <progress max="100" aria-label="Speech model download" class="svelte-w5gfst"> </progress>`,1),Rt=s(`<span class="error svelte-w5gfst" role="alert"> </span>`),zt=s(`<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,F as a,Ft as o,G as s,H as c,J as l,L as u,Lt as d,Ot as f,Pt as p,R as m,T as h,U as g,W as _,X as v,Y as y,Z as b,a as x,b as S,bt as C,ct as w,d as T,dt as E,ft as D,gt as O,ht as k,k as A,kt as ee,l as j,mt as M,nt as N,ot as P,pt as F,r as I,s as te,st as L,ut as ne,v as R,vt as z,wt as B,z as re}from"../chunks/DG3qFFTE.js";import{a as ie,i as ae,n as V,r as oe,t as se,u as ce}from"../chunks/CmzwyvUc.js";import"../chunks/xihTtKlq.js";import{a as le,i as ue,n as H,o as de,p as fe,s as pe,t as U,vt as me,xt as he,yt as ge}from"../chunks/BqoDi2ah.js";import{n as W}from"../chunks/DK8Blf1Y.js";import{i as _e,m as ve,n as ye,p as be,t as xe}from"../chunks/CRAFzMd4.js";import{n as Se}from"../chunks/CEnFvaV_.js";import{u as Ce}from"../chunks/DIE02RSm.js";import{c as G,d as we,h as Te,s as Ee}from"../chunks/D18ccNbM.js";import{A as De,C as Oe,D as ke,E as Ae,S as je,b as Me,i as K,j as Ne,n as Pe,r as Fe,s as Ie,t as Le}from"../chunks/DNKv-5Rn.js";import"../chunks/DdwZKwdT.js";import"../chunks/Do3aLnHk.js";import{t as q}from"../chunks/BKaViC3K.js";import{T as Re,m as ze,n as J,o as Be,t as Ve,w as He}from"../chunks/CYV1bZYS.js";import{M as Y,P as Ue,U as We,V as Ge,b as X,g as Ke,nt as qe,t as Z,u as Je,v as Ye,z as Xe}from"../chunks/BkH1cevg.js";import{g as Q,h as Ze,v as Qe}from"../chunks/CguB2Z-c.js";import{n as $e,t as et}from"../chunks/3YcXW6yo.js";import"../chunks/d934w91N.js";import{a as tt,n as nt,s as rt,t as it,u as at}from"../chunks/B6l3em0z.js";import{r as ot,t as st}from"../chunks/D_U_DYjx.js";import{_ as ct,a as lt,c as ut,d as dt,f as ft,h as pt,i as mt,l as ht,m as gt,o as $,r as _t,s as vt,t as yt}from"../chunks/Cwt6a32V.js";import{n as bt}from"../chunks/WxmttVik.js";import{t as xt}from"../chunks/masgq8Qh.js";import{a as St,i as Ct,n as wt,r as Tt}from"../chunks/BMgzWMdF.js";import{n as Et}from"../chunks/CgAkqYsL.js";var Dt=e({prerender:()=>!0,trailingSlash:()=>Ot}),Ot=`always`,kt=`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`,At=s(`<a class="cap svelte-nioco2"><!></a>`),jt=s(`<div class="ai-status svelte-nioco2" role="group" aria-label="AI models"></div>`);function Mt(e,n){f(n,!1);let r={think:Fe,hear:Le,speak:Pe};j();var a=jt();u(a,5,()=>K.capabilities,e=>e.id,(e,n)=>{var i=At(),a=D(i);qe(a,{get path(){return r[t(n).id]},size:20}),o(i),L(e=>{R(i,`href`,e),R(i,`data-state`,t(n).state),R(i,`aria-label`,t(n).label),R(i,`title`,t(n).label)},[()=>U(`/ai/`)]),g(e,i)}),o(a),g(e,a),i()}function Nt(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`)!==null}function Pt(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 Ft=s(`<div><!></div>`);function It(e,n){f(n,!0);let a=x(n,`answered`,3,null),s=nt(ot()),c=r(()=>J.settings().currency),l=r(()=>s.fieldsFor(n.proposal.spec.source)),u=C(O(a())),d=C(null);function p(e){z(u,e,!0),n.onoutcome?.(e)}function m(e){p({status:`saved`,report:{id:e.id,title:e.title}}),it(t(d),e)}var h=Ft(),_=D(h);at(_,{get proposal(){return n.proposal},get confirm(){return s.save},reportHref:e=>U(tt(e)),onsaved:m,ondecline:()=>p({status:`declined`}),get outcome(){return t(u)},get fields(){return t(l)},get currency(){return t(c)}}),o(h),T(h,e=>z(d,e),()=>t(d)),g(e,h),i()}var Lt=s(`<span role="status" aria-live="polite"> </span> <progress max="100" aria-label="Speech model download" class="svelte-w5gfst"> </progress>`,1),Rt=s(`<span class="error svelte-w5gfst" role="alert"> </span>`),zt=s(`<span>The speech model is already on this device. Turn on voice typing to
2
2
  talk to the assistant?</span>`),Bt=s(`<span> </span>`),Vt=s(`<button type="button">Cancel</button>`),Ht=s(`<button type="button"> </button> <button type="button">Not now</button>`,1),Ut=s(`<div class="voice svelte-w5gfst" role="group" aria-label="Voice typing"><svg class="icon svelte-w5gfst" viewBox="0 0 24 24" aria-hidden="true"><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="text svelte-w5gfst"><!></div> <div class="actions svelte-w5gfst"><!></div></div>`);function Wt(e,a){f(a,!0);let s=r(()=>Math.round(a.voice.size/1e6)),l=r(()=>Math.round(a.voice.progress*100)),u=r(()=>a.voice.status===`offer`||a.voice.status===`downloading`||a.voice.status===`error`);var d=_(),p=F(d),m=e=>{var r=Ut(),i=k(D(r),2),u=D(i),d=e=>{var n=Lt(),r=F(n),i=M(r),o=k(r,2),s=M(o);L(()=>{c(i,`${a.voice.cached?`Turning on voice typing`:`Downloading speech model`}
3
3
  ${t(l)??``}%`),S(o,t(l)),c(s,`${t(l)??``}%`)}),g(e,n)},f=e=>{var t=Rt(),n=M(t);L(()=>c(n,`Voice typing could not start: ${a.voice.error??``}`)),g(e,t)},p=e=>{var t=zt();g(e,t)},m=e=>{var n=Bt(),r=M(n);L(e=>c(r,`Your browser can't do voice typing on its own. Download a ${e??``} speech model to talk to the assistant?`),[()=>Ae(t(s))]),g(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)}),o(i);var h=k(i,2),_=D(h),y=e=>{var t=Vt();v(`click`,t,()=>a.voice.cancel()),g(e,t)},b=e=>{var t=Ht(),n=F(t),r=M(n,!0),i=k(n,2);L(()=>c(r,a.voice.status===`error`?`Try again`:a.voice.cached?`Turn on`:`Download`)),v(`click`,n,()=>void a.voice.enable()),v(`click`,i,()=>a.voice.dismiss()),g(e,t)};n(_,e=>{a.voice.status===`downloading`?e(y):e(b,-1)}),o(h),o(r),g(e,r)};n(p,e=>{t(u)&&e(m)}),g(e,d),i()}y([`click`]);var Gt=s(`<div class="offer svelte-12q53fs" role="group" aria-label="Theme change"><!></div>`),Kt=s(`<p class="offer-note svelte-12q53fs" role="status">Theme restored.</p>`),qt=s(`<!> <!> <!>`,1),Jt=s(`<li><b> </b> </li>`),Yt=s(`<ul class="offer-menu svelte-12q53fs"></ul>`),Xt=s(`<small class="svelte-12q53fs">Replaces your recipes, menu and sample records.</small>`),Zt=s(`<div class="offer svelte-12q53fs" role="group"><div class="offer-text svelte-12q53fs"><strong> </strong> <span class="svelte-12q53fs"> </span> <!></div> <!> <!> <!></div>`),Qt=s(`<p class="offer-note svelte-12q53fs" role="status"> </p>`),$t=s(`<p class="offer-note svelte-12q53fs" role="alert"> </p>`),en=s(`<div class="panel svelte-12q53fs" 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/Cp6EyiHL.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/BKaViC3K.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,St as k,_t as A,a as j,p as M,t as N,vt as P}from"../chunks/DtyQVtuI.js";import{p as te}from"../chunks/DIE02RSm.js";import{i as F}from"../chunks/Bs5WxZDd.js";import{t as ne}from"../chunks/BkEeNbLN.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="chips svelte-disfw2"></ul> <button type="button" class="secondary svelte-disfw2">Clear selection</button>`,1),re=s(`<p class="meta svelte-disfw2"> </p>`),ie=s(`<li><h3 class="svelte-disfw2"><a> </a></h3> <p class="description svelte-disfw2"> </p> <p class="meta svelte-disfw2"><!></p> <!> <!></li>`),ae=s(`<li class="none svelte-disfw2"> </li>`),oe=s(`<main class="svelte-disfw2"><header class="svelte-disfw2"><p class="meta svelte-disfw2"><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,St as k,_t as A,a as j,p as M,t as N,vt as P}from"../chunks/BqoDi2ah.js";import{p as te}from"../chunks/DIE02RSm.js";import{i as F}from"../chunks/Bs5WxZDd.js";import{t as ne}from"../chunks/CckqctPA.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="chips svelte-disfw2"></ul> <button type="button" class="secondary svelte-disfw2">Clear selection</button>`,1),re=s(`<p class="meta svelte-disfw2"> </p>`),ie=s(`<li><h3 class="svelte-disfw2"><a> </a></h3> <p class="description svelte-disfw2"> </p> <p class="meta svelte-disfw2"><!></p> <!> <!></li>`),ae=s(`<li class="none svelte-disfw2"> </li>`),oe=s(`<main class="svelte-disfw2"><header class="svelte-disfw2"><p class="meta svelte-disfw2"><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="selection svelte-disfw2"><h2 class="svelte-disfw2">Your app</h2> <!> <p class="notice svelte-disfw2" role="status" aria-live="polite"> </p></section> <section aria-label="Package catalog"><h2 class="svelte-disfw2">Packages <small class="svelte-disfw2"> </small></h2> <label class="search svelte-disfw2"><span class="visually-hidden svelte-disfw2">Search packages</span> <input type="search" placeholder="Search packages, models and fields" class="svelte-disfw2"/></label> <ul class="cards svelte-disfw2"></ul></section></main>`);function z(s,h){d(h,!0);let z=v(``),B=v(``),V=r(()=>k(A.packages,e(z)));function se(e){let t=new Set(j.ids),n=t.has(e);j.toggle(e);let r=j.ids.filter(n=>!t.has(n)&&n!==e);D(B,n?`Removed ${M(e)}.`:r.length?`Added ${M(e)} and the packages it needs: ${r.map(M).join(`, `)}.`:`Added ${M(e)}.`,!0)}var H=oe();t(`disfw2`,e=>{_(()=>{T.title=`All packages · smrt planner`})});var U=y(H),W=y(U),G=y(W);f(),o(W),f(4),o(U);var K=b(U,2),q=b(y(K),2),ce=e=>{var t=I();p(e,t)},le=e=>{var t=R(),n=C(t);u(n,20,()=>j.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)},[()=>N(`/packages/${t}/`),()=>M(t)]),p(e,n)}),o(n);var r=b(n,2);m(`click`,r,()=>j.clear()),p(e,t)};n(q,e=>{j.ids.length===0?e(ce):e(le,-1)});var ue=b(q,2),de=x(ue,!0);o(K);var J=b(K,2),Y=y(J),X=b(y(Y)),fe=x(X);o(Y);var Z=b(Y,2),Q=b(y(Z),2);g(Q),o(Z);var $=b(Z,2);u($,29,()=>e(V),e=>e.id,(t,i)=>{let s=r(()=>j.has(e(i).id)),u=r(()=>j.requiredBy(e(i).id));var d=ie();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`),[()=>P(e(i)).length,()=>O(e(i))]),p(t,n)},D=r(()=>P(e(i)).length),k=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(k,-1)}),o(S);var A=b(S,2),I=t=>{var n=re(),r=x(n);w(e=>c(r,`Needs: ${e??``}`),[()=>e(i).dependencies.map(M).join(`, `)]),p(t,n)};n(A,t=>{e(i).dependencies.length&&t(I)});var L=b(A,2);{let t=r(()=>e(s)&&e(u).length>0),n=r(()=>`Include ${M(e(i).id)} in my app`),a=r(()=>e(s)&&e(u).length>0?`In your app (needed by ${e(u).map(M).join(`, `)})`:e(s)?`In your app`:`Add to my app`);F(L,{get checked(){return e(s)},get disabled(){return e(t)},onchange:()=>se(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,{selected:e(s)}),E(h,`href`,t),c(g,n),c(v,e(i).description)},[()=>N(`/packages/${e(i).id}/`),()=>M(e(i).id)]),ee(d,()=>te,()=>({duration:ne(`medium2`,300)})),p(t,d)},t=>{var n=ae(),r=x(n);w(()=>c(r,`No packages match "${e(z)??``}".`)),p(t,n)}),o($),o(J),o(H),w(t=>{E(G,`href`,t),c(de,e(B)),c(fe,`${e(V).length??``} of ${A.packages.length??``}`)},[()=>N(`/`)]),S(Q,()=>e(z),e=>D(z,e)),p(s,H),i()}h([`click`]);export{z 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/DtyQVtuI.js";import{t as D}from"../chunks/DRByVC-c.js";import{t as O}from"../chunks/DdiQBZrC.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="meta svelte-1md22of">Needs: <!></p>`),P=s(`<li><a> </a> <span class="meta svelte-1md22of"> </span></li>`),F=s(`<main class="svelte-1md22of"><header class="svelte-1md22of"><h1 class="svelte-1md22of"> </h1> <p class="meta svelte-1md22of"><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 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/BqoDi2ah.js";import{t as D}from"../chunks/DRByVC-c.js";import{t as O}from"../chunks/B5cHPql0.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="meta svelte-1md22of">Needs: <!></p>`),P=s(`<li><a> </a> <span class="meta svelte-1md22of"> </span></li>`),F=s(`<main class="svelte-1md22of"><header class="svelte-1md22of"><h1 class="svelte-1md22of"> </h1> <p class="meta svelte-1md22of"><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 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};