@alwith/module-auth 0.1.8 → 0.1.10

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 (203) hide show
  1. package/README.md +1 -1
  2. package/dist/chunk-01py4vpp.js +2 -0
  3. package/dist/chunk-1agdfzjz.js +2 -0
  4. package/dist/chunk-1mwjz4f1.js +2 -0
  5. package/dist/chunk-1sf9m7x2.js +2 -0
  6. package/dist/chunk-2j5re92x.js +2 -0
  7. package/dist/chunk-38vgcbpq.js +2 -0
  8. package/dist/chunk-3amxesw3.js +2 -0
  9. package/dist/chunk-3q1e1ksh.js +2 -0
  10. package/dist/chunk-3rpgxz1z.js +2 -0
  11. package/dist/chunk-3vpcfe38.js +2 -0
  12. package/dist/chunk-41jxjz9n.js +2 -0
  13. package/dist/chunk-4gegjx79.js +2 -0
  14. package/dist/chunk-4mwvph27.js +2 -0
  15. package/dist/chunk-5zpeb8cj.js +2 -0
  16. package/dist/chunk-6f02m6jw.js +2 -0
  17. package/dist/chunk-6t0bw1wy.js +2 -0
  18. package/dist/chunk-74hpp4me.js +2 -0
  19. package/dist/chunk-7pdpmxg2.js +2 -0
  20. package/dist/chunk-7y7stqn0.js +2 -0
  21. package/dist/chunk-8nzgysac.js +2 -0
  22. package/dist/chunk-8w0zccsf.js +0 -0
  23. package/dist/chunk-96emfz6b.js +2 -0
  24. package/dist/chunk-9h4j75af.js +2 -0
  25. package/dist/chunk-afy09ajr.js +2 -0
  26. package/dist/chunk-ax8zmvs0.js +2 -0
  27. package/dist/chunk-b5zfgr86.js +2 -0
  28. package/dist/chunk-b7v6g7a0.js +2 -0
  29. package/dist/chunk-bcyk6es8.js +2 -0
  30. package/dist/chunk-c9banqkx.js +2 -0
  31. package/dist/chunk-ctvwa8d3.js +2 -0
  32. package/dist/chunk-d13j3xks.js +2 -0
  33. package/dist/chunk-d4ezh3c4.js +6 -0
  34. package/dist/chunk-e20z911q.js +1 -0
  35. package/dist/chunk-enze3bpk.js +2 -0
  36. package/dist/chunk-ezj6gpm0.js +2 -0
  37. package/dist/chunk-f0awr1g7.js +2 -0
  38. package/dist/chunk-g8nah79y.js +2 -0
  39. package/dist/chunk-gq64get1.js +2 -0
  40. package/dist/chunk-gv5he3xg.js +2 -0
  41. package/dist/chunk-h994ssre.js +2 -0
  42. package/dist/chunk-hscsc9kx.js +2 -0
  43. package/dist/chunk-htw56xtp.js +2 -0
  44. package/dist/chunk-j03we9jz.js +2 -0
  45. package/dist/chunk-j2922k42.js +2 -0
  46. package/dist/chunk-jampyjt1.js +2 -0
  47. package/dist/chunk-jf77909y.js +2 -0
  48. package/dist/chunk-jppe84sk.js +2 -0
  49. package/dist/chunk-khnyadsg.js +0 -0
  50. package/dist/chunk-kqsxaxk8.js +2 -0
  51. package/dist/chunk-kwq26qhs.js +2 -0
  52. package/dist/chunk-m3e7wah7.js +2 -0
  53. package/dist/chunk-m96z2xh6.js +2 -0
  54. package/dist/chunk-mdqxdcxh.js +2 -0
  55. package/dist/chunk-mfrnyj0b.js +2 -0
  56. package/dist/chunk-mjsqb1wk.js +1 -0
  57. package/dist/chunk-nbfhs21c.js +2 -0
  58. package/dist/chunk-pbwt3qj9.js +0 -0
  59. package/dist/chunk-pe1mn10v.js +2 -0
  60. package/dist/chunk-pha0eyam.js +2 -0
  61. package/dist/chunk-pwsarey8.js +2 -0
  62. package/dist/chunk-qd5jhh2h.js +1 -0
  63. package/dist/chunk-qy364wgy.js +2 -0
  64. package/dist/chunk-rerywpwe.js +2 -0
  65. package/dist/chunk-rfxpf1eq.js +2 -0
  66. package/dist/chunk-rrhhytq1.js +2 -0
  67. package/dist/chunk-t6snsees.js +2 -0
  68. package/dist/chunk-t858h8ch.js +2 -0
  69. package/dist/chunk-tvmvzc41.js +2 -0
  70. package/dist/chunk-v5akzbxg.js +2 -0
  71. package/dist/chunk-v890qhc2.js +1 -0
  72. package/dist/chunk-v9czb1e6.js +2 -0
  73. package/dist/chunk-vt1sfk87.js +2 -0
  74. package/dist/chunk-w5yer870.js +2 -0
  75. package/dist/chunk-wa475kmq.js +2 -0
  76. package/dist/chunk-wfsdbf7j.js +2 -0
  77. package/dist/chunk-x61q358n.js +2 -0
  78. package/dist/chunk-xrw9s1th.js +2 -0
  79. package/dist/chunk-zar89jcs.js +3 -0
  80. package/dist/chunk-zkwggfj2.js +2 -0
  81. package/dist/client.d.ts +1 -1
  82. package/dist/client.js +1 -1
  83. package/dist/index.d.ts +6 -6
  84. package/dist/index.js +1 -1
  85. package/dist/oauth.js +1 -1
  86. package/dist/password.js +1 -1
  87. package/dist/pets/assets.d.ts +8 -8
  88. package/dist/pets/assets.js +1 -1
  89. package/dist/pets/client.d.ts +2 -2
  90. package/dist/pets/client.js +1 -1
  91. package/dist/pets/core/engine.d.ts +2 -2
  92. package/dist/pets/core/engine.js +1 -1
  93. package/dist/pets/core/host.d.ts +3 -3
  94. package/dist/pets/core/host.js +1 -1
  95. package/dist/pets/core/index.d.ts +11 -11
  96. package/dist/pets/core/index.js +1 -1
  97. package/dist/pets/core/lib/account-state.d.ts +1 -1
  98. package/dist/pets/core/lib/account-state.js +1 -1
  99. package/dist/pets/core/lib/bubble-outline.js +1 -1
  100. package/dist/pets/core/lib/draw-result.d.ts +1 -1
  101. package/dist/pets/core/lib/draw-result.js +1 -1
  102. package/dist/pets/core/lib/endpoints.d.ts +1 -1
  103. package/dist/pets/core/lib/endpoints.js +1 -1
  104. package/dist/pets/core/lib/gacha-pools.d.ts +1 -1
  105. package/dist/pets/core/lib/gacha-pools.js +1 -1
  106. package/dist/pets/core/lib/loading-progress.js +1 -1
  107. package/dist/pets/core/lib/pet-animation-sync.d.ts +2 -2
  108. package/dist/pets/core/lib/pet-animation-sync.js +1 -1
  109. package/dist/pets/core/lib/pet-bubble-state.d.ts +1 -1
  110. package/dist/pets/core/lib/pet-bubble-state.js +1 -1
  111. package/dist/pets/core/lib/pet-drag.d.ts +2 -2
  112. package/dist/pets/core/lib/pet-drag.js +1 -1
  113. package/dist/pets/core/lib/pet-presentation.d.ts +3 -3
  114. package/dist/pets/core/lib/pet-presentation.js +1 -1
  115. package/dist/pets/core/lib/pet-session-context.js +1 -1
  116. package/dist/pets/core/lib/preload-images.js +1 -1
  117. package/dist/pets/core/lib/presentation-readiness.js +1 -1
  118. package/dist/pets/core/lib/rarity.d.ts +1 -1
  119. package/dist/pets/core/lib/rarity.js +1 -1
  120. package/dist/pets/core/lib/recharge.js +1 -1
  121. package/dist/pets/core/lib/reply-submission.d.ts +1 -1
  122. package/dist/pets/core/lib/reply-submission.js +1 -1
  123. package/dist/pets/core/lib/resource-sync.js +1 -1
  124. package/dist/pets/core/lib/runtime-types.d.ts +1 -1
  125. package/dist/pets/core/lib/settings.js +1 -1
  126. package/dist/pets/core/lib/sprite-config.d.ts +2 -2
  127. package/dist/pets/core/lib/sprite-config.js +1 -1
  128. package/dist/pets/core/lib/vibemon-resources.d.ts +1 -1
  129. package/dist/pets/core/lib/vibemon-resources.js +1 -1
  130. package/dist/pets/core/lib/view-request.js +1 -1
  131. package/dist/pets/core/lib/window-frame.d.ts +1 -1
  132. package/dist/pets/core/lib/window-frame.js +1 -1
  133. package/dist/pets/core/lib/window-manager.d.ts +1 -1
  134. package/dist/pets/core/lib/window-manager.js +1 -1
  135. package/dist/pets/core/session-icon.js +1 -5
  136. package/dist/pets/core/types.js +1 -1
  137. package/dist/pets/host.js +1 -1
  138. package/dist/pets/index.d.ts +6 -6
  139. package/dist/pets/index.js +1 -1
  140. package/dist/pets/react/assets.js +1 -1
  141. package/dist/pets/react/components/album-view.d.ts +1 -1
  142. package/dist/pets/react/components/album-view.js +1 -1
  143. package/dist/pets/react/components/back-to-home.js +1 -1
  144. package/dist/pets/react/components/equip-view.d.ts +1 -1
  145. package/dist/pets/react/components/equip-view.js +1 -1
  146. package/dist/pets/react/components/gem-balance.js +1 -1
  147. package/dist/pets/react/components/home-view.js +1 -1
  148. package/dist/pets/react/components/insufficient-points-dialog.js +1 -1
  149. package/dist/pets/react/components/intro-overlay.js +1 -1
  150. package/dist/pets/react/components/loading-view.js +1 -1
  151. package/dist/pets/react/components/onboarding-guide.js +1 -1
  152. package/dist/pets/react/components/pet-bubble-background.js +1 -1
  153. package/dist/pets/react/components/pet-lounge.js +1 -1
  154. package/dist/pets/react/components/pet-mode-button.js +1 -1
  155. package/dist/pets/react/components/pet-window.js +1 -1
  156. package/dist/pets/react/components/pull-overlay.d.ts +1 -1
  157. package/dist/pets/react/components/pull-overlay.js +1 -1
  158. package/dist/pets/react/components/pull-video.js +1 -1
  159. package/dist/pets/react/components/pull-view.d.ts +1 -1
  160. package/dist/pets/react/components/pull-view.js +1 -1
  161. package/dist/pets/react/components/quick-reply.js +1 -2
  162. package/dist/pets/react/components/session-icon.d.ts +2 -2
  163. package/dist/pets/react/components/session-icon.js +1 -1
  164. package/dist/pets/react/components/single-pet-toast.js +1 -1
  165. package/dist/pets/react/components/sprite-renderer.d.ts +1 -1
  166. package/dist/pets/react/components/sprite-renderer.js +1 -1
  167. package/dist/pets/react/components/vibemon-empty-state.js +1 -1
  168. package/dist/pets/react/components/vibemon-header.js +1 -1
  169. package/dist/pets/react/components/vibemon-page.js +1 -1
  170. package/dist/pets/react/components/vibemon-scene.js +1 -1
  171. package/dist/pets/react/components/video-fader.js +1 -1
  172. package/dist/pets/react/components/wish-button.js +1 -1
  173. package/dist/pets/react/index.d.ts +5 -5
  174. package/dist/pets/react/index.js +1 -1
  175. package/dist/pets/react/lib/account-state.d.ts +1 -1
  176. package/dist/pets/react/lib/account-state.js +1 -1
  177. package/dist/pets/react/lib/card-image.js +1 -1
  178. package/dist/pets/react/lib/resource-sync.d.ts +2 -2
  179. package/dist/pets/react/lib/resource-sync.js +1 -1
  180. package/dist/pets/react/lib/season.js +1 -1
  181. package/dist/pets/react/lib/use-season.d.ts +1 -1
  182. package/dist/pets/react/lib/use-season.js +1 -1
  183. package/dist/pets/react/lib/utils.js +1 -1
  184. package/dist/pets/react/ui/button.d.ts +2 -2
  185. package/dist/pets/react/ui/button.js +1 -1
  186. package/dist/pets/react/ui/card.js +1 -1
  187. package/dist/pets/react/ui/input-group.d.ts +3 -3
  188. package/dist/pets/react/ui/input-group.js +1 -1
  189. package/dist/pets/react/ui/textarea.js +1 -1
  190. package/dist/pets/resource-package.d.ts +2 -2
  191. package/dist/pets/resource-package.js +1 -1
  192. package/dist/pets/resources.d.ts +5 -5
  193. package/dist/pets/resources.js +1 -1
  194. package/dist/pets/selection.d.ts +1 -1
  195. package/dist/pets/selection.js +1 -1
  196. package/dist/pets/sheet-layout.js +1 -1
  197. package/dist/pets/types.js +1 -0
  198. package/dist/state.d.ts +2 -2
  199. package/dist/state.js +1 -1
  200. package/dist/token-storage.d.ts +1 -1
  201. package/dist/token-storage.js +1 -1
  202. package/dist/types.js +1 -0
  203. package/package.json +13 -12
@@ -0,0 +1,2 @@
1
+ import{Q}from"./chunk-jppe84sk.js";import{Je,Qe,et}from"./chunk-tvmvzc41.js";import{i}from"./chunk-h994ssre.js";import{o}from"./chunk-xrw9s1th.js";import{t}from"./chunk-mjsqb1wk.js";import{B}from"./chunk-t6snsees.js";import{T}from"./chunk-t858h8ch.js";import{p}from"./chunk-w5yer870.js";import{Loader2 as k}from"lucide-react";import{useMemo as x,useState as V}from"react";import{jsxDEV as e,Fragment as d}from"react/jsx-dev-runtime";var c=8;function h({direction:r,disabled:a,onClick:n}){let s=r==="previous";return e(t,{"aria-label":s?"Previous album page":"Next album page",disabled:a,onClick:n,className:o("absolute top-[55.870%] z-20 size-[2.917cqw] bg-transparent p-0 shadow-none transition-none hover:bg-transparent disabled:opacity-100",s?"left-[20.521%]":"left-[76.563%]"),children:e("img",{src:Je,alt:"",className:o("h-[63.9%] w-[46.2%] max-w-none select-none",s&&"-scale-x-100",a&&"opacity-50")},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function N(){return e("div",{className:"relative h-full w-full",children:[e("svg",{viewBox:"0 0 200 288",preserveAspectRatio:"none","aria-hidden":!0,className:"absolute inset-0 h-full w-full opacity-25",children:e("rect",{x:"6.16",y:"7.76",width:"187.69",height:"272.47",rx:"14",fill:"none",stroke:"#8687CE",strokeWidth:"5",strokeDasharray:"25 25"},void 0,!1,void 0,this)},void 0,!1,void 0,this),e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"67",height:"80",viewBox:"0 0 67 80",fill:"none",className:"absolute top-[50%] left-[50%] h-[27.5%] w-[33.1%] max-w-none translate-x-[-50%] translate-y-[-50%] select-none",children:e("path",{d:"M46.2449 32.0803V22.6882C46.2449 15.4054 40.3462 9.50669 33.0634 9.50669C25.7807 9.50669 19.882 15.415 19.882 22.6977V32.0899H46.2449V32.0803ZM9.69759 32.1853L9.68804 31.8894V21.5714C9.68804 15.854 11.9597 10.3657 16.0067 6.3187C20.0538 2.27168 25.5325 0 31.2595 0H34.877C46.789 0 56.4388 9.65941 56.4388 21.5619V32.1853C61.9939 32.9584 66.1269 37.7118 66.1269 43.3242V67.9786C66.1269 74.1923 61.0967 79.2224 54.883 79.2224H11.2439C5.03015 79.2224 0 74.1923 0 67.9786V43.3337C0 37.7213 4.13293 32.968 9.69759 32.1853ZM30.4672 57.5747V64.9242C30.4672 66.3559 31.6317 67.5204 33.0634 67.5204C34.4952 67.5204 35.6596 66.3559 35.6596 64.9242V57.5747C38.8572 56.3243 40.7184 52.974 40.0789 49.6047C39.4394 46.2258 36.4996 43.7823 33.0634 43.7823C29.6273 43.7823 26.6779 46.2258 26.048 49.6047C25.4084 52.974 27.2697 56.3243 30.4672 57.5747Z",fill:"#8687CE",fillOpacity:"0.25"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function M({cards:r}){return e(d,{children:[e("img",{src:Qe,alt:"","aria-hidden":!0,className:"pointer-events-none absolute top-[14.158%] left-[14.583%] h-[79.313%] w-[74.067%] max-w-none select-none",style:{maskImage:"linear-gradient(to bottom, rgba(255,255,255,0.8) 0%, #fff 25.66%, #fff 93.71%, rgba(255,255,255,0.2) 100%)",WebkitMaskImage:"linear-gradient(to bottom, rgba(255,255,255,0.8) 0%, #fff 25.66%, #fff 93.71%, rgba(255,255,255,0.2) 100%)"}},void 0,!1,void 0,this),e("div",{"data-testid":"album-book",className:"absolute top-[32.917%] left-[25.729%] grid h-[50.574%] w-[48.542%] grid-cols-4 grid-rows-2 gap-x-[4.721%] gap-y-[4.943%]",children:r.map((a,n)=>e("div",{className:"relative",children:a?e("img",{src:i(a.gacha_url??a.cover_url),alt:`${a.name} ${a.rarity_name} card`,className:"h-full w-full object-contain drop-shadow-[0_8px_9px_rgba(15,8,64,0.24)] select-none"},void 0,!1,void 0,this):e(N,{},void 0,!1,void 0,this)},a?`${a.vibemon_uuid}-${n}`:`locked-${n}`,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function $e({onBack:r,onWish:a,onEquip:n,ownedCards:s,ownedLoaded:v,availablePoints:w,pointsLoaded:C}){let[y,f]=V(0),u=x(()=>Q(s).flatMap((g)=>Array.from({length:g.duplicate_count},()=>g)),[s]),m=Math.ceil(u.length/c),l=m===0?0:Math.min(y,m-1),b=[...u.slice(l*c,(l+1)*c)];while(b.length<c)b.push(null);return e(p,{backdrop:e(d,{children:[e("img",{src:et,alt:"","aria-hidden":!0,className:"pointer-events-none absolute inset-0 h-full w-full object-cover select-none"},void 0,!1,void 0,this),e("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 bg-[#422053]/20"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[e(T,{onBack:r,onWish:a,sectionAction:{kind:"equip",onClick:n},availablePoints:w,pointsLoaded:C},void 0,!1,void 0,this),!v?e("div",{"data-testid":"vibemon-owned-loading",className:"absolute inset-0 flex items-center justify-center text-[#DCC9FF]",children:e(k,{className:"size-8 animate-spin"},void 0,!1,void 0,this)},void 0,!1,void 0,this):u.length===0?e(B,{onWish:a},void 0,!1,void 0,this):e(d,{children:[e(M,{cards:b},void 0,!1,void 0,this),m>1&&e(d,{children:[e(h,{direction:"previous",disabled:l===0,onClick:()=>f(l-1)},void 0,!1,void 0,this),e(h,{direction:"next",disabled:l>=m-1,onClick:()=>f(l+1)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}
2
+ export{$e};
@@ -0,0 +1,2 @@
1
+ import{dt}from"./chunk-tvmvzc41.js";import{t}from"./chunk-mjsqb1wk.js";import{jsxDEV as e}from"react/jsx-dev-runtime";function B({onWish:o}){return e("div",{className:"absolute inset-x-0 top-[18%] bottom-[8%] flex flex-col items-center justify-center",children:[e("img",{src:dt,alt:"",className:"w-[10.938cqw] shrink-0 drop-shadow-[0_18px_28px_rgba(31,15,92,0.35)] select-none"},void 0,!1,void 0,this),e("p",{className:"mt-[1.5cqh] max-w-[19.792cqw] px-[1.25cqw] text-center text-[0.938cqw] leading-relaxed text-white/60",children:["No Vibémon to keep your lobby company~",e("br",{},void 0,!1,void 0,this),"draw one home!"]},void 0,!0,void 0,this),e(t,{onClick:o,className:"mt-[4cqh] h-[5.5cqh] min-w-[10.417cqw] rounded-full border border-white/75 bg-[linear-gradient(180deg,#C579F2_0%,#8A4FDB_100%)] px-[1.875cqw] text-[1.25cqw] font-black text-white shadow-[0_8px_18px_rgba(50,20,126,0.35),inset_0_2px_2px_rgba(255,255,255,0.5)] hover:bg-[linear-gradient(180deg,#CF87F6_0%,#9458E2_100%)]",style:{fontFamily:"Outfit, system-ui, sans-serif"},children:"Go Pull"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
2
+ export{B};
@@ -0,0 +1,2 @@
1
+ import{E}from"./chunk-wa475kmq.js";import{f,g,mt}from"./chunk-tvmvzc41.js";import{t}from"./chunk-mjsqb1wk.js";import{M}from"./chunk-wfsdbf7j.js";import{N}from"./chunk-j2922k42.js";import{We}from"./chunk-mfrnyj0b.js";import{useState as l}from"react";import{jsxDEV as o,Fragment as m}from"react/jsx-dev-runtime";function s({action:e}){let[c,n]=l(!1),a=e.kind==="album";return o(t,{"aria-label":a?"Album":"Vibémon",onClick:e.onClick,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),className:"relative size-[3.333cqw] bg-transparent p-0 shadow-none hover:bg-transparent",children:[o("img",{src:a?mt:g,alt:"",className:"size-full object-contain transition-transform duration-150 select-none",style:{transform:c?"translateY(-2px) scale(1.05)":"none"}},void 0,!1,void 0,this),a&&e.hasUnseen&&o("span",{className:"absolute top-0 right-0 size-2 rounded-full bg-[#F74640]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function T({onBack:e,onWish:c,sectionAction:n,availablePoints:a,pointsLoaded:i}){return o(m,{children:[o(M,{onClick:e,label:"Back",iconSrc:f,className:"absolute top-[5.333%] left-[6.25%] z-30 gap-[0.729cqw] text-[#BCACE0] hover:text-[#BCACE0] [&_img]:size-[3.021cqw] [&_span]:text-[1.667cqw]"},void 0,!1,void 0,this),o("div",{className:"absolute top-[5%] right-[6.25%] z-30 flex h-[5.5cqh] items-center gap-[2.292cqw]",children:[o(s,{action:n},void 0,!1,void 0,this),o(We,{onClick:c,className:"size-[3.333cqw]"},void 0,!1,void 0,this),o(N,{amount:a,onAdd:E,loaded:i,className:"h-[5.5cqh] min-w-0 rounded-[7.813cqw] py-0 pr-[0.417cqw] pl-[0.729cqw] [&_[data-slot=gem-balance-add-icon]]:size-[2.5cqw] [&>[data-slot=gem-balance-add]]:ms-[1.094cqw] [&>[data-slot=gem-balance-add]]:size-[2.5cqw] [&>[data-slot=gem-balance-amount]]:text-[1.563cqw] [&>[data-slot=gem-balance-icon]]:me-[0.156cqw] [&>[data-slot=gem-balance-icon]]:size-[2.5cqw]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}
2
+ export{T};
@@ -0,0 +1,2 @@
1
+ import o from"@alwith/module-auth/assets/pets/card-draw/album-icon.png?url";import r from"@alwith/module-auth/assets/pets/card-draw/dialog-close.png?url";import t from"@alwith/module-auth/assets/pets/card-draw/empty-pet.png?url";import e from"@alwith/module-auth/assets/pets/card-draw/gem-plus.svg?url";import m from"@alwith/module-auth/assets/pets/card-draw/gem.svg?url";import p from"@alwith/module-auth/assets/pets/card-draw/new-tag.svg?url";import i from"@alwith/module-auth/assets/pets/card-draw/not-enough-dialog.png?url";import n from"@alwith/module-auth/assets/pets/card-draw/placeholder-card.png?url";import u from"@alwith/module-auth/assets/pets/card-draw/proceed-active.png?url";import a from"@alwith/module-auth/assets/pets/card-draw/proceed-default.png?url";import d from"@alwith/module-auth/assets/pets/card-draw/proceed-hover.png?url";import h from"@alwith/module-auth/assets/pets/card-draw/pull-album-icon-transparent.png?url";import b from"@alwith/module-auth/assets/pets/card-draw/pull-back-transparent.png?url";import B from"@alwith/module-auth/assets/pets/card-draw/pull-gem.svg?url";import k from"@alwith/module-auth/assets/pets/card-draw/pull-page-background.png?url";import w from"@alwith/module-auth/assets/pets/card-draw/pull-texture.png?url";import A from"@alwith/module-auth/assets/pets/card-draw/pull-vibemon-icon-transparent.png?url";import v from"@alwith/module-auth/assets/pets/card-draw/result-aura.webp?url";import T from"@alwith/module-auth/assets/pets/card-draw/wish-default.png?url";import I from"@alwith/module-auth/assets/pets/card-draw/wish.webp?url";import V from"@alwith/module-auth/assets/pets/vibemon/album/arrow.svg?url";import C from"@alwith/module-auth/assets/pets/vibemon/album/book.webp?url";import M from"@alwith/module-auth/assets/pets/vibemon/album/page-bg.webp?url";import y from"@alwith/module-auth/assets/pets/vibemon/equip/page-bg.webp?url";import R from"@alwith/module-auth/assets/pets/vibemon/equip/single-pet-toast.png?url";import E from"@alwith/module-auth/assets/pets/vibemon/guide/arrow.svg?url";import J from"@alwith/module-auth/assets/pets/vibemon/guide/bubble-texture-home.png?url";import K from"@alwith/module-auth/assets/pets/vibemon/guide/bubble-texture-pull.png?url";import N from"@alwith/module-auth/assets/pets/vibemon/guide/hand-shape.svg?url";import Q from"@alwith/module-auth/assets/pets/vibemon/guide/hand-sheen.png?url";import X from"@alwith/module-auth/assets/pets/vibemon/guide/hand.svg?url";import Z from"@alwith/module-auth/assets/pets/vibemon/guide/mascot.png?url";import _ from"@alwith/module-auth/assets/pets/vibemon/guide/ring.svg?url";import oo from"@alwith/module-auth/assets/pets/vibemon/home/album-icon-hover.png?url";import ro from"@alwith/module-auth/assets/pets/vibemon/home/album-icon.png?url";import to from"@alwith/module-auth/assets/pets/vibemon/home/album-text.png?url";import eo from"@alwith/module-auth/assets/pets/vibemon/home/home-bg.webp?url";import mo from"@alwith/module-auth/assets/pets/vibemon/home/intro.mp4?url&no-inline";import po from"@alwith/module-auth/assets/pets/vibemon/home/pull.mp4?url&no-inline";import io from"@alwith/module-auth/assets/pets/vibemon/home/pull.webm?url&no-inline";import lo from"@alwith/module-auth/assets/pets/vibemon/home/vibemon-icon-hover.png?url";import no from"@alwith/module-auth/assets/pets/vibemon/home/vibemon-icon.png?url";import uo from"@alwith/module-auth/assets/pets/vibemon/home/vibemon-text.png?url";import co from"@alwith/module-auth/assets/pets/vibemon/home/wish-icon-hover.png?url";import so from"@alwith/module-auth/assets/pets/vibemon/home/wish-icon.png?url";import ao from"@alwith/module-auth/assets/pets/vibemon/home/wish-text.png?url";import fo from"@alwith/module-auth/assets/pets/vibemon/loading/background.webp?url";import go from"@alwith/module-auth/assets/pets/vibemon/loading/logo.webp?url";import xo from"@alwith/module-auth/assets/pets/vibemon/multi-draw/bg-sr.png?url";import Uo from"@alwith/module-auth/assets/pets/vibemon/multi-draw/bg-ssr.png?url";var s={vibemon:{icon:no,hover:lo,text:uo},wish:{icon:so,hover:co,text:ao},album:{icon:ro,hover:oo,text:to}},Ye={default:a,hover:d,active:u},U=eo,Ke=mo,Xe=po,Ze=io,D=E,L=J,O=K,x=Z,q=X,S=N,H=Q,G=_,Je=V,Qe=C,et=M,tt=y,nt=R,ot=fo,rt=go,it=xo,st=Uo,at=I,lt=T,P=p,ct=i,ut=r,dt=t,z=m,F=e,c=w,W=B,j=k,f=b,g=A,Y=h,mt=o,l=n,pt=v;
2
+ export{s,Ye,U,Ke,Xe,Ze,D,L,O,x,q,S,H,G,Je,Qe,et,tt,nt,ot,rt,it,st,at,lt,P,ct,ut,dt,z,F,c,W,j,f,g,Y,mt,l,pt};
@@ -0,0 +1,2 @@
1
+ async function Lt(t,a,l){a.handleDragStart(l);let o=null;try{let n=(await t.call("position")).x;o=await t.moved((i)=>{let e=i.x-n;if(Math.abs(e)>2)a.setFacing(e<0),n=i.x}),await t.call("drag")}finally{o?.(),a.handleDragEnd()}}
2
+ export{Lt};
@@ -0,0 +1 @@
1
+ import{cn as e}from"cn";import{jsxDEV as a}from"react/jsx-dev-runtime";function qe({className:r,...i}){return a("textarea",{"data-slot":"textarea",className:e("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 md:text-sm",r),...i},void 0,!1,void 0,this)}export{qe};
@@ -0,0 +1,2 @@
1
+ var s={working:{fps:7,loop:!0},empty:{fps:6,loop:!0},done:{fps:7,loop:!1},wait:{fps:7,loop:!0},drag:{fps:7,loop:!0},error:{fps:7,loop:!0},hover:{fps:6,loop:!0}};function ne(r,t,i){let p=i.states.map((o)=>o.id),e=(...o)=>o.find((m)=>p.includes(m))??p[0],a={idle:e("empty","working"),"idle-alt":e("empty","working"),groom:e("empty","working"),"groom-alt":e("empty","working"),run:e("drag","working"),sleep:e("empty","working"),sit:e("working","empty"),interact:e("done","hover","empty"),jump:e("done","empty"),scared:e("drag","empty"),wait:e("wait","empty"),error:e("error","wait","empty"),hover:e("hover","empty")},n=i.frameWidth;return{name:r,frameSize:n,frameHeight:i.frameHeight,renderSize:n,cropX:0,cropY:0,cropW:n,cropH:i.frameHeight,spritesheet:t,facing:"right",behaviorMap:a,states:i.states.map((o)=>({...o,...s[o.id]??{fps:6,loop:!0}}))}}function oe(r,t){if(t.config!==void 0)return t.config;if(t.sheetName===null||t.layout===null)throw Error("Vibemon has no animation");return ne(t.name??r,t.sheetName,t.layout)}
2
+ export{ne,oe};
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-htw56xtp.js";var Rt=()=>e().assets.getMyVibemons(),Pn=()=>e().assets.getVibemonCatalog(),pe=()=>e().assets.getPointAccount(),Et=()=>e().assets.getGachaFirstDraw(),kt=()=>e().assets.markVibemonFirstVisit(),It=()=>e().assets.getActiveGachaPools(),At=(t)=>e().assets.getGachaPoolDetail(t),Vt=(t,o)=>e().assets.drawGachaPool(t,o);
2
+ export{Rt,Pn,pe,Et,kt,It,At,Vt};
@@ -0,0 +1,2 @@
1
+ import{jsxDEV as e}from"react/jsx-dev-runtime";function p({backdrop:t,children:i}){return e("div",{className:"[container-type:size] relative h-full w-full overflow-hidden bg-[#0E0750]",children:[t,e("div",{className:"absolute inset-0 flex items-center justify-center",children:e("div",{"data-testid":"vibemon-stage",className:"[container-type:size] relative",style:{width:"min(100cqw, 160cqh)",aspectRatio:"8 / 5"},children:i},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
2
+ export{p};
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-htw56xtp.js";var E=()=>e().windows.openRecharge();
2
+ export{E};
@@ -0,0 +1,2 @@
1
+ import{o}from"./chunk-xrw9s1th.js";import{t}from"./chunk-mjsqb1wk.js";import{jsxDEV as e}from"react/jsx-dev-runtime";function M({onClick:n,className:s,disabled:i=!1,label:l="Home",iconSrc:a}){return e(t,{variant:"ghost",className:o("h-auto gap-2 p-0 text-[#8A55C5]/80 hover:bg-transparent hover:text-[#8A55C5]/80",s),disabled:i,onClick:n,children:[a===void 0?e("svg",{viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",className:"size-7 shrink-0",children:e("path",{d:"M12.5709 8.57642V3.93455C12.5867 3.8165 12.5756 3.69641 12.5382 3.5833C12.5009 3.4702 12.4384 3.36704 12.3555 3.28158C12.2055 3.1325 12.0026 3.04883 11.7911 3.04883C11.5796 3.04883 11.3767 3.1325 11.2267 3.28158L3.36348 11.9028C3.21724 12.0686 3.13655 12.2821 3.13655 12.5031C3.13655 12.7242 3.21724 12.9377 3.36348 13.1035L11.1838 21.6749C11.4769 21.9248 12.0112 22.0656 12.3557 21.7208C12.534 21.5431 12.6114 21.3927 12.5857 21.1608V16.4383C17.0974 16.4383 21.2356 19.2604 22.8549 23.2291C23.0887 23.8033 23.9213 23.7437 24.066 23.1416C24.2809 22.2415 24.3892 21.3193 24.3886 20.3938C24.3908 13.8674 19.1001 8.57642 12.5709 8.57642Z",fill:"currentColor"},void 0,!1,void 0,this)},void 0,!1,void 0,this):e("img",{src:a,alt:"",className:"size-7 shrink-0"},void 0,!1,void 0,this),e("span",{className:"text-[20px] leading-none font-semibold select-none",children:l},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
2
+ export{M};
@@ -0,0 +1,2 @@
1
+ import{useLayoutEffect as k,useRef as t,useState as D}from"react";import{jsxDEV as m}from"react/jsx-dev-runtime";var z=1,G=100,K=1000;function C({src:u,sources:l,playing:F=!0,active:c=!0,background:H,onFirstFrame:R,onComplete:L,onError:S}){let p=t(null),h=t(null),a=t(0),y=t(!1),A=t(u===void 0?{sources:l}:{src:u});A.current=u===void 0?{sources:l}:{src:u};let[O,v]=D(0),[q,E]=D(!1),n=u??l.map((e)=>`${e.type}:${e.src}`).join("|"),I=t(n),g=t(L),w=t(R),M=t(S);return g.current=L,w.current=R,M.current=S,k(()=>{let e=p.current;if(e===null)throw Error("Video player is not mounted");if(!c)return;if(y.current=!1,I.current!==n)a.current=0;I.current=n;let o=A.current;if("src"in o)e.src=o.src;else{let s=e.querySelectorAll("source");o.sources.forEach((r,d)=>{s[d].setAttribute("src",r.src)})}e.defaultMuted=!0,e.muted=!0;let i=()=>{y.current=!0};return e.addEventListener("error",i),e.load(),()=>{a.current=e.currentTime,e.removeEventListener("error",i),e.pause(),e.removeAttribute("src");for(let s of e.querySelectorAll("source"))s.removeAttribute("src");e.load()}},[n,c]),k(()=>{let e=p.current,o=h.current;if(e===null||o===null)throw Error("Video player is not mounted");if(o.style.opacity="0",v(0),E(!1),!F){if(a.current=0,c)e.pause(),e.currentTime=0;return}if(!c)return;e.currentTime=a.current;let i=!1,s=!1,r=!1,d=!1,T=null,b=null,V=null,N=()=>{if(s||!e.duration)return;if(e.duration-e.currentTime<z)s=!0,v(1)},_=()=>{if(r)return;b=setTimeout(()=>{E(!0),v(0),V=setTimeout(()=>{if(r)return;r=!0,g.current()},K)},G)},f=()=>{if(i||r)return;r=!0,E(!0),M.current()};if(T=e.requestVideoFrameCallback(()=>{if(i||r||d||e.dataset.sourceKey!==n)return;d=!0,o.style.opacity="1",w.current()}),e.addEventListener("timeupdate",N),e.addEventListener("ended",_),e.addEventListener("error",f),y.current)f();else e.play().catch(f);return()=>{if(i=!0,e.removeEventListener("timeupdate",N),e.removeEventListener("ended",_),e.removeEventListener("error",f),T!==null)e.cancelVideoFrameCallback(T);if(b)clearTimeout(b);if(V)clearTimeout(V)}},[n,F,c]),m("div",{ref:h,"data-video-presentation":!0,className:"pointer-events-none absolute inset-0 z-20",style:{opacity:0,background:H},children:[m("video",{ref:p,"data-source-key":n,preload:"auto",muted:!0,playsInline:!0,className:"absolute inset-0 z-20 h-full w-full object-cover",style:{visibility:q?"hidden":"visible"},children:l===void 0?null:l.map((e)=>m("source",{type:e.type},`${e.type}:${e.src}`,!1,void 0,this))},void 0,!1,void 0,this),m("div",{className:"pointer-events-none absolute inset-0 z-20 bg-white transition-opacity duration-1000 ease-in",style:{opacity:O}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
2
+ export{C};
@@ -0,0 +1,2 @@
1
+ import{cn as o}from"cn";
2
+ export{o};
@@ -0,0 +1,3 @@
1
+ import{e,we}from"./chunk-htw56xtp.js";import{vt}from"./chunk-pha0eyam.js";import{a}from"./chunk-6f02m6jw.js";import{d}from"./chunk-rfxpf1eq.js";import{t}from"./chunk-mjsqb1wk.js";import{De,Le,V,Oe}from"./chunk-e20z911q.js";import{He}from"./chunk-38vgcbpq.js";import{le}from"./chunk-3q1e1ksh.js";import{cn as oe}from"cn";import{ArrowUpIcon as We,CheckIcon as qe,PanelsTopLeftIcon as Ke,PencilLineIcon as Qe,XIcon as Xe}from"lucide-react";import{useCallback as ke,useEffect as se,useEffectEvent as Ye,useLayoutEffect as Ce,useRef as x,useState as w}from"react";import{useTranslation as Ze}from"react-i18next";import{jsxDEV as o}from"react/jsx-dev-runtime";var ie=18,re=ie/2,Je={color:"var(--popover-foreground)",borderRadius:16,border:"1px solid var(--border)"},$e=(v)=>v.split(/[\\/]/).findLast(Boolean)??"",en=(v,r)=>[$e(v.cwd),v.title||r].filter(Boolean).join(" / ");function Ft({maxHeight:v}){let r=e(),_=d(),Me=a(),[Ne,ae]=w(320);se(()=>{let n=!1;if(ae(320),v===void 0&&_.pet!=="")r.assets.resources.inspect(_.pet).then((l)=>{if(n)return;let s=l?.config?.bubbleAreaHeight;if(s!==void 0&&(typeof s!=="number"||!Number.isFinite(s)))throw Error("Pet bubble height must be a finite number");ae(Math.max(typeof s==="number"?s:0,320))}).catch(r.onError);return()=>{n=!0}},[r,Me,_.pet,v]);let{t:i}=Ze("common"),[u,Se]=w(()=>r.sessions.snapshot()),[k,D]=w(""),[j,H]=w(!1),[g,C]=w(null),[ce,W]=w(!1),[q,ue]=w(!1),[Be,K]=w(""),[S,Q]=w(!1),[Te,de]=w(null),pe=x(null),F=x(!1),B=x(!1),f=x(null),X=x(null),E=x(null),me=x(u),fe=x(null),be=x(null),Y=ke((n)=>K(n instanceof Error?n.message:String(n)),[]),c=u?.binding??null,p=u,M=u,T=c?.connectionEpoch??null,A=c?.sessionId??null,Ae=c?.bindingRevision??-1,Pe=u?.owner??"",Z=u?.access!=="writable"||u.executionId!==null,ze=u!==null,O=ke(()=>{if(E.current?.abort(),E.current=null,Q(!1),de(null),D(""),H(!1),C(null),W(!1),X.current=null,K(""),F.current=!1,B.current=!1,f.current!==null)cancelAnimationFrame(f.current);f.current=null},[]);se(()=>{let n=(s)=>{let I=me.current;if(I===null||s===null||!we(I.binding,s.binding))O();if(me.current=s,s!==null){if(s.state==="running")W(!0);C((N)=>N===null?N:vt(N,s.state,s.since))}Se(s)},l=r.sessions.subscribe(n);return n(r.sessions.snapshot()),document.addEventListener("vibemon:dismiss",O),()=>{if(l(),document.removeEventListener("vibemon:dismiss",O),E.current?.abort(),f.current!==null)cancelAnimationFrame(f.current)}},[r,O]);let L=()=>{if(c!==null)r.windows.call("bubble-interact",{binding:c}).catch(r.onError)},P=async(n)=>{if(E.current!==null)return;let l=new AbortController;E.current=l,L(),Q(!0),K("");try{await n(l.signal)}catch(s){if(!l.signal.aborted)Y(s)}finally{if(E.current===l)E.current=null,Q(!1)}},Re=()=>r.windows.call("focus"),Fe=(n)=>{if(c===null||u===null)throw Error("Pet conversation unavailable");return L(),r.windows.call("session-menu",{binding:c,candidates:u.candidates,position:n,onSelect:(l)=>P(()=>r.sessions.select(c,l))})},m=u?.state==="running",y=u?.state==="requires_action"||u?.prompt!=null,h=u?.prompt??null,Ge=async(n,l,s)=>{if(c===null)throw Error(i("petMode.openToReply"));if(await r.sessions.answer(c,crypto.randomUUID(),n.token,l),!s.aborted)de(n.token)},ge=!S&&!Z&&!m&&!y&&k.trim()!==""&&ze,he=async(n)=>{if(c===null||M===null)throw Error(i("petMode.openToReply"));let l=k.trim();X.current=M.reply?.messageId??null,C({sessionId:c.sessionId,text:l,startedAt:Date.now(),accepted:!1,sawRunning:!1,completed:!1});try{if(await r.sessions.send(c,crypto.randomUUID(),l),n.aborted)return;C((s)=>s===null?null:{...s,accepted:!0}),D("")}catch(s){if(!n.aborted)C(null);throw s}},J=()=>{if(c!==null)P(async(n)=>{await r.sessions.openChat(c),n.throwIfAborted()})},z=Be||u?.error,ee=g?.completed||ce&&(p?.state==="idle"||p?.state==="done"),G=M!==null&&!m&&!y&&!z&&ee&&M.reply?.messageId!==X.current?M.reply:null,ne=z?null:y?i("runState.requires_action"):m?i("petMode.thinking"):g?.completed?null:g?.accepted?i("petMode.sent"):null,xe=g!==null,R=xe||ce,te=M?.userMessage??null,ve=ee&&!m?null:(m||R)&&te!==null&&(g===null||te.timestamp>=g.startedAt)?te.text:xe?g.text:null,U=!R&&!m&&!y,b=R&&ee&&!m&&!y&&!z,Ue=G?.messageId,_e=G?.text,ye=c!==null,Ve=Ye(()=>{if(c!==null)r.windows.call("dismiss-result",{binding:c}).catch(r.onError)});se(()=>{if(!b||q||!ye)return;let n=setTimeout(Ve,1e4);return()=>clearTimeout(n)},[b,q,ye,T,A,Ae,Ue,_e,r]);let Ee=y?320:b?260:m?240:320;Ce(()=>{let n=fe.current;if(n===null)return;let l=!1,s=()=>{let N=Math.ceil(n.getBoundingClientRect().height)+6;if(!l&&N>=32)r.windows.call("bubble-size",{width:Ee+re*2,height:N}).catch(r.onError)},I=new ResizeObserver(s);return I.observe(n),s(),()=>{l=!0,I.disconnect()}},[r,Ee,A]);let Ie=p?i(p.windowLabel==="main"?"petMode.openMain":"petMode.openChat"):i("petMode.openFull");Ce(()=>{if(k===""){H(!1);return}if(j||R||m)return;if(k.includes(`
2
+ `)){H(!0);return}let n=pe.current;if(n===null)return;let l=()=>{let I=Math.ceil(Number.parseFloat(getComputedStyle(n).minHeight));if(n.scrollHeight>I)H(!0)};l();let s=new ResizeObserver(l);return s.observe(n),()=>s.disconnect()},[k,j,R,m]);let je=U?De:"div";return o("div",{ref:fe,"data-pet-bubble":!0,className:"relative pb-1.5",style:{paddingTop:re,paddingInline:re},onPointerEnter:()=>ue(!0),onPointerLeave:()=>ue(!1),children:[A!==null&&o(He,{cardRef:be},void 0,!1,void 0,this),A!==null&&o("div",{ref:be,"data-pet-bubble-card":!0,role:"presentation",onClick:(n)=>{if(b&&n.target.closest("button")===null)J()},style:{...Je,position:"relative",background:"transparent",borderColor:"transparent",boxShadow:"none",animation:"none",maxHeight:(v??Ne)-6},className:oe("overflow-y-auto p-2",b?"grid cursor-pointer grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-1 px-3":m?"flex flex-col gap-1 py-1.5":"flex flex-col gap-2"),children:[ve&&o("p",{className:"line-clamp-2 text-sm break-words whitespace-pre-wrap",children:ve},void 0,!1,void 0,this),G!==null&&o("p",{className:"line-clamp-2 text-sm break-words whitespace-pre-wrap",children:G.text},void 0,!1,void 0,this),z&&o("p",{role:"alert",className:"text-muted-foreground text-xs",children:z},void 0,!1,void 0,this),h!==null&&o("section",{"aria-label":i(h.kind==="permission"?"petMode.permission":"petMode.question"),className:"flex min-w-0 flex-col gap-2",children:[o("p",{className:"text-sm break-words whitespace-pre-wrap",children:h.title},void 0,!1,void 0,this),h.detail!==""&&o("pre",{className:"text-muted-foreground max-h-24 overflow-auto text-xs break-words whitespace-pre-wrap",children:h.detail},void 0,!1,void 0,this),h.options.length>0&&!Z?o("div",{className:"flex flex-wrap gap-1",children:h.options.map((n)=>o(t,{size:"xs",className:"h-auto min-h-6 max-w-full whitespace-normal",disabled:S||Te===h.token,onClick:()=>void P((l)=>Ge(h,n.id,l)),children:n.label},n.id,!1,void 0,this))},void 0,!1,void 0,this):o(t,{size:"xs",onClick:J,children:i("petMode.openToAnswer")},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o(je,{className:b?"col-start-1 row-start-2":void 0,children:[U&&o(Oe,{ref:pe,rows:1,className:"field-sizing-fixed max-h-[calc(3lh+1rem)] min-h-[calc(1lh+1rem)] min-w-0 overflow-y-auto",style:{height:j?"calc(3lh + 1rem)":"calc(1lh + 1rem)"},value:k,placeholder:i("petMode.placeholder"),"aria-label":i("petMode.placeholder"),disabled:S||Z||!Pe||T===null,onChange:(n)=>{L(),D(n.target.value)},onFocus:()=>{L(),Re().catch(Y)},onCompositionStart:()=>{if(f.current!==null)cancelAnimationFrame(f.current);f.current=null,B.current=!1,F.current=!0},onCompositionEnd:()=>{if(F.current=!1,B.current=!0,f.current!==null)cancelAnimationFrame(f.current);f.current=requestAnimationFrame(()=>{B.current=!1,f.current=null})},onKeyDown:(n)=>{if(n.key!=="Enter"||n.shiftKey||F.current||n.nativeEvent.isComposing||B.current||n.nativeEvent.keyCode===229)return;if(n.preventDefault(),ge)P(he)}},void 0,!1,void 0,this),o(Le,{align:"block-end",className:oe("shrink-0",(b||m)&&"gap-1 p-0"),children:[o("div",{className:oe("flex min-w-0 items-center gap-2",!b&&"flex-1"),children:[ne&&o("p",{role:"status",className:"text-muted-foreground text-xs",children:m&&!y?o("span",{className:"shimmer",children:ne},void 0,!1,void 0,this):ne},void 0,!1,void 0,this),U?o(V,{className:"min-w-0 flex-1 justify-start",title:i("petMode.chooseSession"),"aria-label":i("petMode.chooseSession"),"aria-haspopup":"menu",disabled:S||T===null,onClick:(n)=>{let l=n.currentTarget.getBoundingClientRect();Fe({x:l.left,y:l.bottom}).catch(Y)},children:[p&&o("span",{role:"img","aria-label":i(p.windowLabel==="main"?"navigation.mainWindow":"navigation.chatWindow"),"data-icon":"inline-start",className:"inline-flex shrink-0",children:o(le,{name:p.windowLabel,icons:r.sessionIcons},void 0,!1,void 0,this)},void 0,!1,void 0,this),o("span",{className:"min-w-0 flex-1 truncate text-start",title:p?[p.cwd,p.title||i("collection.defaultChatTitle")].filter(Boolean).join(" / "):"",children:p?en(p,i("collection.defaultChatTitle")):""},void 0,!1,void 0,this)]},void 0,!0,void 0,this):!m&&o(V,{size:"icon-xs",className:b?"size-5":void 0,title:i("petMode.continue"),"aria-label":i("petMode.continue"),disabled:S||y||g!==null&&!g.accepted,onClick:()=>{L(),C(null),W(!1)},children:o(Qe,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U&&o(V,{size:"icon-xs",variant:"default",className:"size-5 shrink-0",title:i("petMode.send"),"aria-label":i("petMode.send"),disabled:!ge,onClick:()=>void P(he),children:o(We,{className:"size-3"},void 0,!1,void 0,this)},void 0,!1,void 0,this),o(V,{size:"icon-xs",className:"size-5 shrink-0",title:Ie,"aria-label":Ie,disabled:T===null||!p,onClick:J,children:p&&r.sessionIcons?o(le,{name:p.windowLabel,icons:r.sessionIcons},void 0,!1,void 0,this):o(Ke,{className:"size-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),b&&o("span",{role:"img","aria-label":i("petMode.completed"),title:i("petMode.completed"),className:"col-start-2 row-span-2 row-start-1 inline-flex size-7 items-center justify-center rounded-full bg-[var(--vibemon-completed-background)] text-[var(--vibemon-completed-foreground)]",children:o(qe,{className:"size-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q&&T!==null&&A!==null&&o(t,{variant:"outline",size:"icon-xs",className:"text-muted-foreground absolute top-1 left-1 cursor-pointer rounded-full",style:{width:ie,height:ie},title:i("close"),"aria-label":i("close"),onClick:()=>void r.windows.call("bubble-close").catch(r.onError),children:o(Xe,{className:"size-2.5"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
3
+ export{Ft};
@@ -0,0 +1,2 @@
1
+ import{nt}from"./chunk-tvmvzc41.js";import{t}from"./chunk-mjsqb1wk.js";import{AnimatePresence as r,motion as l,useReducedMotion as u}from"motion/react";import{useEffect as c}from"react";import{jsxDEV as e}from"react/jsx-dev-runtime";var Zt="This is your only pet. It’s equipped by default and can’t be unequipped ~",Jt=3000;function Ge({requestId:o,onClose:i}){let n=u(),a=o>0;return c(()=>{if(o===0)return;let s=window.setTimeout(i,Jt);return()=>window.clearTimeout(s)},[o,i]),e("div",{className:"pointer-events-none absolute bottom-[7.067%] left-1/2 z-30 h-[4.583cqw] w-[52.604cqw] -translate-x-1/2",children:e(r,{initial:!1,children:a&&e(l.div,{"data-testid":"single-pet-toast",className:"pointer-events-auto relative size-full",initial:{opacity:0,y:n?0:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:n?0:"100%"},transition:n?{duration:0}:{duration:0.3,ease:[0.16,1,0.3,1]},children:[e("img",{src:nt,alt:"","aria-hidden":!0,className:"absolute inset-0 size-full max-w-none select-none"},void 0,!1,void 0,this),e("span",{role:"status",className:"sr-only",children:Zt},void 0,!1,void 0,this),e(t,{"aria-label":"Close",onClick:i,className:"absolute top-1/4 right-[5.743%] aspect-square h-1/2 rounded-full border-0 bg-transparent p-0 shadow-none transition-none hover:bg-white/10 focus-visible:border-white focus-visible:ring-white/70 active:translate-y-0",children:e("span",{className:"sr-only",children:"Close"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)}
2
+ export{Zt,Jt,Ge};
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { LoginResponse, OAuthExchangeResponse, OAuthProvider, OAuthSessionResponse, SsoExchangeResponse } from "./types.js";
1
+ import type { LoginResponse, OAuthExchangeResponse, OAuthProvider, OAuthSessionResponse, SsoExchangeResponse } from "./types";
2
2
  export type SendCodePurpose = "LOGIN" | "REGISTER";
3
3
  export interface AuthClientHost {
4
4
  publicPost: <T>(path: string, body?: unknown) => Promise<T>;
package/dist/client.js CHANGED
@@ -1 +1 @@
1
- function E({publicPost:t,apiPost:d,platform:c,arch:r,getDeviceId:u,onLogoutError:h,logInfo:p}){async function _(e,n="LOGIN"){await t("/api/v1/auth/send-code",{login_type:"EMAIL",email:e,purpose:n})}async function y(e,n){let[i,a,o]=await Promise.all([c(),r(),u()]);return t("/api/v1/auth/login",{email:e,code:n,login_type:"EMAIL",client_type:"DESKTOP",client_name:`Tauri-${i}-${a}`,device_id:o})}async function v(e,n){let[i,a,o]=await Promise.all([c(),r(),u()]);return t("/api/v1/auth/login",{email:e,password:n,login_type:"PASSWORD",client_type:"DESKTOP",client_name:`Tauri-${i}-${a}`,device_id:o})}async function f(e){return t("/api/v1/auth/email-exists",{email:e})}async function g(e,n,i){let[a,o,s]=await Promise.all([c(),r(),u()]);return t("/api/v1/auth/register",{email:e,code:n,password:i,client_type:"DESKTOP",client_name:`Tauri-${a}-${o}`,device_id:s})}async function O(){try{await d("/api/v1/auth/logout")}catch(e){h(e)}}function S(e){switch(e){case"macos":return"MACOS";case"windows":return"WINDOWS";case"linux":return"LINUX";default:throw Error(`unsupported desktop platform for OAuth: ${e}`)}}async function w(e,n,i){let[a,o,s]=await Promise.all([c(),r(),u()]),l={provider:e,client_type:"DESKTOP",platform:S(a),return_target:"APP_LOGIN",client_name:`Tauri-${a}-${o}`,device_id:s,client_code_challenge:n,...i!==void 0?{loopback_port:i}:{}};return p(`[oauth] POST /api/v1/auth/oauth/sessions request: ${JSON.stringify(l)}`),t("/api/v1/auth/oauth/sessions",l)}async function T(e,n){return t("/api/v1/auth/oauth/tickets/exchange",{ticket:e,client_code_verifier:n})}async function m(){return d("/api/v1/sso/otp")}async function A(e){return t("/api/v1/sso/exchange",{otp:e,client_type:"DESKTOP"})}return{sendVerificationCode:_,loginWithCode:y,loginWithPassword:v,emailExists:f,register:g,logoutApi:O,createOAuthSession:w,exchangeOAuthTicket:T,getSsoOtp:m,exchangeSsoCode:A}}export{E as createAuthClient};
1
+ import{mn}from"./chunk-ezj6gpm0.js";export{mn as createAuthClient};
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export * from "./types.js";
2
- export * from "./password.js";
3
- export * from "./oauth.js";
4
- export * from "./token-storage.js";
5
- export * from "./client.js";
6
- export * from "./state.js";
1
+ export * from "./types";
2
+ export * from "./password";
3
+ export * from "./oauth";
4
+ export * from "./token-storage";
5
+ export * from "./client";
6
+ export * from "./state";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export*from"./types.js";export*from"./password.js";export*from"./oauth.js";export*from"./token-storage.js";export*from"./client.js";export*from"./state.js";
1
+ import"./chunk-8w0zccsf.js";import{on}from"./chunk-jf77909y.js";import{rn,sn,an,ln,un,dn}from"./chunk-c9banqkx.js";import{pn,fn}from"./chunk-m96z2xh6.js";import{mn}from"./chunk-ezj6gpm0.js";import{nn}from"./chunk-d13j3xks.js";export{pn as authStoreName,un as clearOAuthState,sn as computeCodeChallenge,mn as createAuthClient,nn as createAuthState,fn as createTokenStorage,rn as generateCodeVerifier,on as isValidPassword,dn as oauthErrorKey,an as storeOAuthState,ln as takeOAuthState};
package/dist/oauth.js CHANGED
@@ -1 +1 @@
1
- function r(e){let n="";for(let o of e)n+=String.fromCharCode(o);return btoa(n).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function a(){let e=new Uint8Array(32);return crypto.getRandomValues(e),r(e)}async function u(e){let n=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(e));return r(new Uint8Array(n))}var t=null;function l(e){t=e}function c(){let e=t;return t=null,e}function s(){t=null}var i=[["OAUTH_SESSION_EXPIRED","signIn.oauthSessionExpired"],["OAUTH_VERIFICATION_FAILED","signIn.oauthVerificationFailed"],["OAUTH_EMAIL_REQUIRED","signIn.oauthEmailRequired"],["OAUTH_IDENTITY_CONFLICT","signIn.oauthIdentityConflict"],["OAUTH_RATE_LIMITED","signIn.tooManyRequests"],["OAUTH_PROVIDER_UNAVAILABLE","signIn.oauthProviderUnavailable"],["OAUTH_CONFIG_UNAVAILABLE","signIn.oauthConfigUnavailable"],["ACCOUNT_DISABLED","signIn.accountDisabled"]];function I(e){for(let[n,o]of i)if(e.includes(n))return o;return"signIn.signInFailed"}export{s as clearOAuthState,u as computeCodeChallenge,a as generateCodeVerifier,I as oauthErrorKey,l as storeOAuthState,c as takeOAuthState};
1
+ import{rn,sn,an,ln,un,dn}from"./chunk-c9banqkx.js";export{un as clearOAuthState,sn as computeCodeChallenge,rn as generateCodeVerifier,dn as oauthErrorKey,an as storeOAuthState,ln as takeOAuthState};
package/dist/password.js CHANGED
@@ -1 +1 @@
1
- var s=/^(?=.*[A-Za-z])(?=.*\d)[\x21-\x7E]{8,26}$/;function n(t){return s.test(t)}export{n as isValidPassword};
1
+ import{on}from"./chunk-jf77909y.js";export{on as isValidPassword};
@@ -1,6 +1,12 @@
1
- import { type PetAssetsHost } from "./host.js";
2
- import type { MyVibemonItem, VibemonCatalogItem, VibemonResourceDescriptor } from "./types.js";
1
+ import { type PetAssetsHost } from "./host";
2
+ import type { MyVibemonItem, VibemonCatalogItem, VibemonResourceDescriptor } from "./types";
3
3
  export declare function createPetAssets(host: PetAssetsHost): {
4
+ markVibemonFirstVisit: () => Promise<import("./types").VibemonFirstVisitResponse>;
5
+ getGachaFirstDraw: () => Promise<import("./types").GachaFirstDrawResponse>;
6
+ getActiveGachaPools: () => Promise<import("./types").GachaPoolSummary[]>;
7
+ getGachaPoolDetail: (id: string) => Promise<import("./types").GachaPoolDetailResponse>;
8
+ getPointAccount: () => Promise<import("./types").PointAccountData>;
9
+ drawGachaPool(poolId: string, drawType: import("./types").DrawType): Promise<import("./types").DrawResponse>;
4
10
  getMyVibemons: (params?: Parameters<(params?: import("./types").GetMyVibemonsParams) => Promise<MyVibemonItem[]>>[0]) => Promise<{
5
11
  resource_url?: string | null;
6
12
  resource_package_format?: number | null;
@@ -56,11 +62,5 @@ export declare function createPetAssets(host: PetAssetsHost): {
56
62
  };
57
63
  ensureResource(id: string): Promise<import("./resources").CachedPetResource>;
58
64
  dispose(): void;
59
- markVibemonFirstVisit: () => Promise<import("./types").VibemonFirstVisitResponse>;
60
- getGachaFirstDraw: () => Promise<import("./types").GachaFirstDrawResponse>;
61
- getActiveGachaPools: () => Promise<import("./types").GachaPoolSummary[]>;
62
- getGachaPoolDetail: (id: string) => Promise<import("./types").GachaPoolDetailResponse>;
63
- getPointAccount: () => Promise<import("./types").PointAccountData>;
64
- drawGachaPool(poolId: string, drawType: import("./types").DrawType): Promise<import("./types").DrawResponse>;
65
65
  };
66
66
  export type PetAssets = ReturnType<typeof createPetAssets>;
@@ -1 +1 @@
1
- import{createPetClient as k}from"./client.js";import{accountKey as V,assertAccount as s}from"./host.js";import{IMAGE_ASSETS as q}from"./resource-package.js";import{createPetResources as C}from"./resources.js";import{createPetSelection as x}from"./selection.js";function N(o){let w=k(o),a=C(o),p=new Map,f=new Map,u=null,m=!1,g=0,d=null,y="",S=!1,_=0,b=new Set;function l(){_++;for(let e of b)e()}function c(){if(S)throw Error("Vibemon asset service disposed");let e=o.account(),n=e===null?"":`${V(e)}/${e.revision}`;if(y!==n)y=n,u=null,m=!1,g++,d=null,a.cancel();return e}async function v(e){let n=c(),r=e===void 0?++g:g,t=await w.getMyVibemons(e);if(n===null)throw Error("Sign in to use Vibemon");if(s(o,n),c(),e===void 0&&r===g)u=t,m=!0,await o.storage.set(`vibemon.owned.${V(n)}`,t),s(o,n),l();return Promise.all(t.map(async(i)=>({...i,...await h({...i,uuid:i.vibemon_uuid})})))}async function I(){let e=c();if(e===null)return null;if(m)return u;let n=await o.storage.get(`vibemon.owned.${V(e)}`);return s(o,e),u=n??null,l(),u}async function M(){let e=c(),n=await w.getVibemonCatalog();if(e===null)throw Error("Sign in to use Vibemon");return s(o,e),c(),d=n,l(),n}async function E(e){let n=(p.get(e)??0)+1;p.set(e,n);let r=await w.getVibemonDetail(e);if(p.get(e)!==n)throw Error("Vibemon detail request superseded");if(r.uuid!==e)throw Error("Vibemon detail ID mismatch");return r}async function R(e){let n=c();if(n===null)throw Error("Sign in to use Vibemon");try{return await a.ensure(e)}catch(r){s(o,n),o.onResourceError?.(r,e.uuid);let t=await a.cached(e.uuid);if(t!==null)return t;throw r}}async function h(e){if((e.resource_package_format??0)===0)return{};let n=c();if(n===null)throw Error("Sign in to use Vibemon");try{let r=await R(e),t=await a.visuals(r);return s(o,n),Object.fromEntries(q.filter((i)=>(i in t)).map((i)=>[`${i}_url`,t[i]??null]))}catch{return s(o,n),Object.fromEntries(q.map((r)=>[`${r}_url`,null]))}}async function P(e){let n=c();if(n===null)throw Error("Sign in to use Vibemon");try{let r=await E(e);return await h(r)}catch(r){s(o,n),o.onResourceError?.(r,e);let t=await a.inspect(e);if(t===null)return{};let i=await a.visuals(t);return Object.fromEntries(Object.entries(i).map(([A,D])=>[`${A}_url`,D]))}}function j(e,n){c();let r=JSON.stringify([y,e,n??null]),t=f.get(r);if(t)return t;let i=P(e).finally(()=>{if(f.get(r)===i)f.delete(r)});return f.set(r,i),i}let O=x(o,async(e)=>{if(c(),m&&u?.some((n)=>n.vibemon_uuid===e))return u;return v()});return{...w,getMyVibemons:v,getVibemonCatalog:M,getVibemonDetail:E,resolveImages:j,resources:a,restoreOwned:I,get revision(){return _},snapshot:()=>({account:c(),owned:u,catalog:d}),invalidate(){c(),l()},subscribe(e){return b.add(e),()=>{b.delete(e)}},selection:{get:O.get,async select(e){c(),await O.select(e),l()}},async ensureResource(e){let n=c();if(n===null)throw Error("Sign in to use Vibemon");if(!(u??await v()).some((t)=>t.vibemon_uuid===e))throw Error("This account does not own this Vibemon");try{let t=await E(e);return s(o,n),await R(t)}catch(t){s(o,n);let i=await a.cached(e);if(i!==null)return o.onResourceError?.(t,e),i;throw t}},dispose(){S=!0,u=null,d=null,a.dispose(),l(),b.clear()}}}export{N as createPetAssets};
1
+ import{gn}from"../chunk-qy364wgy.js";import"../chunk-afy09ajr.js";import"../chunk-3amxesw3.js";import"../chunk-nbfhs21c.js";import"../chunk-ax8zmvs0.js";import"../chunk-rerywpwe.js";import"../chunk-4gegjx79.js";export{gn as createPetAssets};
@@ -1,5 +1,5 @@
1
- import { type PetAssetsHost } from "./host.js";
2
- import type { DrawResponse, DrawType, GachaFirstDrawResponse, GachaPoolDetailResponse, GachaPoolSummary, GetMyVibemonsParams, MyVibemonItem, PointAccountData, VibemonCatalogItem, VibemonFirstVisitResponse } from "./types.js";
1
+ import { type PetAssetsHost } from "./host";
2
+ import type { DrawResponse, DrawType, GachaFirstDrawResponse, GachaPoolDetailResponse, GachaPoolSummary, GetMyVibemonsParams, MyVibemonItem, PointAccountData, VibemonCatalogItem, VibemonFirstVisitResponse } from "./types";
3
3
  export declare function createPetClient(host: Pick<PetAssetsHost, "account" | "request">): {
4
4
  getVibemonDetail: (id: string) => Promise<VibemonCatalogItem>;
5
5
  getVibemonCatalog: () => Promise<VibemonCatalogItem[]>;
@@ -1 +1 @@
1
- import{assertAccount as s}from"./host.js";function l(o){async function e(a,t,c){let i=o.account();if(i===null)throw Error("Sign in to use Vibemon");let n=await o.request(a,t,c);return s(o,i),n}let r=!1;return{getVibemonDetail:(a)=>e(`/api/v1/vibemons/${encodeURIComponent(a)}`,"GET"),getVibemonCatalog:()=>e("/api/v1/vibemons/catalog","GET"),getMyVibemons:(a={})=>{let t=new URLSearchParams;for(let[i,n]of Object.entries(a))if(n!==void 0)t.set(i,String(n));let c=t.size>0?`?${t}`:"";return e(`/api/v1/vibemons/mine${c}`,"GET")},markVibemonFirstVisit:()=>e("/api/v1/vibemons/first-visit","POST"),getGachaFirstDraw:()=>e("/api/v1/gacha/first-draw","GET"),getActiveGachaPools:()=>e("/api/v1/gacha/pools","GET"),getGachaPoolDetail:(a)=>e(`/api/v1/gacha/pools/${encodeURIComponent(a)}`,"GET"),getPointAccount:()=>e("/api/v1/points/account","GET"),async drawGachaPool(a,t){if(r)throw Error("A draw is already pending");r=!0;try{return await e("/api/v1/gacha/draw","POST",{pool_uuid:a,draw_type:t})}finally{r=!1}}}}export{l as createPetClient};
1
+ import{ye}from"../chunk-afy09ajr.js";import"../chunk-rerywpwe.js";export{ye as createPetClient};
@@ -1,5 +1,5 @@
1
- import type { RunState } from "./lib/runtime-types.js";
2
- import type { VibemonNotification, VibemonSpriteConfig } from "./types.js";
1
+ import type { RunState } from "./lib/runtime-types";
2
+ import type { VibemonNotification, VibemonSpriteConfig } from "./types";
3
3
  interface Position {
4
4
  x: number;
5
5
  y: number;
@@ -1 +1 @@
1
- import{availableMonitors as a,getCurrentWindow as o,moveVibemonWindow as h}from"./lib/window-frame.js";var d=60000,l=24,u=90;class c{currentBehavior="idle";flipped=!1;position={x:200,y:200};targetPosition=null;screenBounds={x:0,y:0,width:1920,height:1080};behaviorTimer=null;sleepTimer=null;moveTimerId=null;isDragging=!1;isPresenting=!1;isHatching=!1;destroyed=!1;suspended=!1;behaviorBeforeDrag="idle";working=!1;sessionAnimation=null;onStateChange;onNotification;config;constructor(i,e,t){this.config=i,this.onStateChange=e,this.onNotification=t}stateOf(i){return this.config.behaviorMap[i]??this.config.behaviorMap.idle}async start(i){if(await this.updateScreenBounds(),i===void 0){let e=await o().outerPosition();this.position={x:e.x,y:e.y}}else if(i){let e=await o().outerSize();if((await a()).some((n)=>i.x+e.width>n.position.x&&i.x<n.position.x+n.size.width&&i.y+e.height>n.position.y&&i.y<n.position.y+n.size.height))this.position={x:i.x,y:i.y};else{let n=this.screenBounds.x+this.screenBounds.width-e.width,r=this.screenBounds.y+this.screenBounds.height-e.height;this.position={x:Math.min(Math.max(i.x,this.screenBounds.x),n),y:Math.min(Math.max(i.y,this.screenBounds.y),r)}}await h(this.position.x,this.position.y)}else{let e=await o().outerSize(),t=await o().scaleFactor(),s=Math.round(l*t),n=Math.round(u*t);this.position={x:this.screenBounds.x+this.screenBounds.width-e.width-s,y:this.screenBounds.y+this.screenBounds.height-e.height-n},await h(this.position.x,this.position.y)}if(this.setBehavior("idle"),this.sessionAnimation!==null)this.applySessionAnimation();this.resetSleepTimer()}destroy(){if(this.destroyed=!0,this.behaviorTimer)clearTimeout(this.behaviorTimer);if(this.sleepTimer)clearTimeout(this.sleepTimer);if(this.moveTimerId)clearInterval(this.moveTimerId)}suspend(){if(this.suspended=!0,this.cancelMovement(),this.targetPosition=null,this.sleepTimer)clearTimeout(this.sleepTimer);this.sleepTimer=null}resume(){if(this.destroyed)throw Error("Cannot resume a destroyed Vibemon engine");if(this.suspended=!1,this.sessionAnimation!==null)this.applySessionAnimation();else this.setBehavior(this.restBehavior());this.resetSleepTimer()}async presentAt(i){if(this.isDragging||this.isPresenting||this.destroyed)throw Error("Vibemon cannot be presented right now");this.isPresenting=!0,this.cancelMovement(),this.targetPosition=null;try{if(this.position=await i(),this.destroyed)throw Error("Vibemon engine changed during presentation")}finally{if(this.isPresenting=!1,!this.destroyed&&!this.suspended){if(this.sessionAnimation!==null)this.applySessionAnimation();else if(this.currentBehavior!=="wait"&&this.currentBehavior!=="error")this.setBehavior(this.restBehavior());this.resetSleepTimer()}}}restBehavior(){return this.working?"sit":"idle"}setWorking(i){if(this.working===i)return;if(this.working=i,this.destroyed||this.suspended||this.isDragging)return;let e=this.currentBehavior==="idle"||this.currentBehavior==="sit"||this.currentBehavior==="sleep",t=this.restBehavior();if(e&&t!==this.currentBehavior)this.setBehavior(t),this.resetSleepTimer()}setSessionState(i,e,t){let s=this.sessionAnimation;if(s!==null&&s.sessionId===i&&s.state===e&&s.failed===t)return;if(this.sessionAnimation={sessionId:i,state:e,failed:t},this.setWorking(e==="running"&&!t),s!==null&&s.sessionId===i&&s.state==="done"&&e==="idle"&&!t&&this.currentBehavior==="jump"&&this.behaviorTimer!==null)return;if(!this.destroyed&&!this.suspended&&!this.isDragging&&!this.isPresenting)this.applySessionAnimation()}applySessionAnimation(){let i=this.sessionAnimation;if(i===null)throw Error("Session animation requires a Runtime snapshot");let e=i.failed?"task-error":i.state==="running"?"running":i.state==="requires_action"?"info":i.state==="done"?"task-complete":"idle";this.handleNotification({type:e,message:"",sourceWindow:""})}handleNotification(i){if(this.suspended)return;if(this.isHatching)return;if(this.onNotification(i),this.resetSleepTimer(),this.behaviorTimer)clearTimeout(this.behaviorTimer);if(this.currentBehavior==="sleep"){this.setBehavior("scared"),this.behaviorTimer=setTimeout(()=>{if(!this.destroyed&&!this.isDragging&&!this.isPresenting)if(this.sessionAnimation!==null)this.applySessionAnimation();else this.handleNotification(i)},500);return}if(this.cancelMovement(),i.type==="info"){this.setBehavior("wait");return}if(i.type==="task-error"){this.setBehavior(this.config.behaviorMap.error?"error":"wait");return}if(i.type==="running"){this.setBehavior("sit");return}if(i.type==="task-complete"){this.setBehavior("jump");let e=this.config.states.find((s)=>s.id===this.stateOf("jump")),t=e?e.frames/e.fps*1000:800;this.behaviorTimer=setTimeout(()=>{if(!this.destroyed&&!this.isDragging)this.setBehavior(this.restBehavior())},t);return}this.setBehavior(this.restBehavior())}handleClick(){if(this.isHatching)return;this.resetSleepTimer()}dismissError(){if(this.currentBehavior!=="error")return;this.cancelMovement(),this.setBehavior(this.restBehavior()),this.resetSleepTimer()}flipForDirection(i){return this.config.facing==="left"?!i:i}handleDragStart(i){if(this.isPresenting)throw Error("Vibemon presentation is in progress");if(this.isHatching)return;if(this.behaviorBeforeDrag=this.currentBehavior,this.isDragging=!0,this.cancelMovement(),this.resetSleepTimer(),i!==void 0)this.flipped=this.flipForDirection(i);this.setBehavior("scared")}setFacing(i){let e=this.flipForDirection(i);if(this.flipped===e)return;this.flipped=e,this.onStateChange(this.stateOf(this.currentBehavior),this.flipped,!1)}handleDragEnd(){if(this.destroyed)return;if(this.isDragging=!1,this.cancelMovement(),this.flipped=!1,this.sessionAnimation!==null)this.applySessionAnimation();else if(this.behaviorBeforeDrag==="wait"||this.behaviorBeforeDrag==="error")this.setBehavior(this.behaviorBeforeDrag);else this.setBehavior(this.restBehavior());this.syncPositionFromWindow()}debugSpeed=8;setDebugSpeed(i){this.debugSpeed=i}stop(){this.cancelMovement(),this.setBehavior("idle")}debugSetBehavior(i){if(this.cancelMovement(),i in this.config.behaviorMap)this.setBehavior(i);else this.currentBehavior="idle",this.onStateChange(i,this.flipped,!0)}getDebugSpeed(){return this.debugSpeed}async debugRun(){this.cancelMovement(),await this.syncPositionFromWindow();let i=await o().outerSize(),e=[{x:this.screenBounds.x,y:this.screenBounds.y},{x:this.screenBounds.x+this.screenBounds.width-i.width,y:this.screenBounds.y},{x:this.screenBounds.x+this.screenBounds.width-i.width,y:this.screenBounds.y+this.screenBounds.height-i.height},{x:this.screenBounds.x,y:this.screenBounds.y+this.screenBounds.height-i.height}],t=0,s=()=>{if(this.destroyed)return;let n=e[t%e.length];t++;let r=n.x-this.position.x;if(Math.abs(r)>1)this.flipped=r<0;this.setBehavior("run"),this.startMovement(n,this.debugSpeed,s)};s()}setBehavior(i){this.currentBehavior=i,this.onStateChange(this.stateOf(i),this.flipped,!0)}async syncPositionFromWindow(){if(this.destroyed)return;let i;try{i=await o().outerPosition()}catch(e){if(this.destroyed)return;throw e}if(this.destroyed)return;this.position={x:i.x,y:i.y}}async updateScreenBounds(){let i=await a();if(i.length>0){let e=i[0];this.screenBounds={x:e.position.x,y:e.position.y,width:e.size.width,height:e.size.height}}}startMovement(i,e,t){if(this.isPresenting||this.suspended)return;this.cancelMovement(),this.targetPosition=i,this.moveTimerId=setInterval(()=>{if(this.destroyed||this.isDragging||!this.targetPosition||this.currentBehavior!=="run"){if(this.moveTimerId)clearInterval(this.moveTimerId);this.moveTimerId=null;return}let s=this.targetPosition.x-this.position.x,n=this.targetPosition.y-this.position.y,r=Math.hypot(s,n);if(r<e){if(this.position={...this.targetPosition},this.targetPosition=null,this.moveTimerId)clearInterval(this.moveTimerId),this.moveTimerId=null;if(h(this.position.x,this.position.y),t)t();else this.setBehavior("idle");return}this.position.x+=s/r*e,this.position.y+=n/r*e,h(this.position.x,this.position.y)},16)}cancelMovement(){if(this.moveTimerId)clearInterval(this.moveTimerId),this.moveTimerId=null;if(this.behaviorTimer)clearTimeout(this.behaviorTimer),this.behaviorTimer=null}resetSleepTimer(){if(this.sleepTimer)clearTimeout(this.sleepTimer);if(this.suspended)return;this.sleepTimer=setTimeout(()=>{if(!this.destroyed&&!this.isDragging&&this.currentBehavior==="idle")this.cancelMovement(),this.setBehavior("sleep")},d)}}export{c as VibemonEngine};
1
+ import{K}from"../../chunk-gv5he3xg.js";import"../../chunk-7y7stqn0.js";import"../../chunk-htw56xtp.js";export{K as VibemonEngine};
@@ -1,6 +1,6 @@
1
- import type { PetAccount, PetAssets, PetStorage } from "../index.js";
2
- import type { SessionIcons } from "./session-icon.js";
3
- import type { VibemonSpriteConfig } from "./types.js";
1
+ import type { PetAccount, PetAssets, PetStorage } from "../index";
2
+ import type { SessionIcons } from "./session-icon";
3
+ import type { VibemonSpriteConfig } from "./types";
4
4
  export type RunState = "running" | "requires_action" | "done" | "idle";
5
5
  export interface PetBinding {
6
6
  connectionEpoch: string;
@@ -1 +1 @@
1
- var i=null;function e(n){if(i!==null)throw Error("Vibemon already initialized in this window");return i=n,()=>{if(i===n)i=null}}function r(){if(i===null)throw Error("Vibemon has not initialized");return i}function t(n,o){return n.connectionEpoch===o.connectionEpoch&&n.agentId===o.agentId&&n.sessionId===o.sessionId&&n.incarnation===o.incarnation&&n.bindingRevision===o.bindingRevision}export{e as configureVibemon,t as sameBinding,r as vibemonHost};
1
+ import{tn,e,we}from"../../chunk-htw56xtp.js";export{tn as configureVibemon,we as sameBinding,e as vibemonHost};
@@ -1,11 +1,11 @@
1
- export * from "./host.js";
2
- export { initializeSettings, refreshSettings } from "./lib/settings.js";
3
- export { getVibemonState, updateVibemonState } from "./lib/account-state.js";
4
- export { syncVibemonResources, resourceSyncStatus, observeResourceSync, subscribeResourceSync, type ResourceSyncStatus } from "./lib/resource-sync.js";
5
- export { loadVibemonResource } from "./lib/vibemon-resources.js";
6
- export { requestVibemonView } from "./lib/view-request.js";
7
- export { sessionIconSvg, type SessionIcons } from "./session-icon.js";
8
- export { PetSessionContext, type PetSurface, type PetSurfaceLabel } from "./lib/pet-session-context.js";
9
- export { createSpriteConfig, spriteConfig } from "./lib/sprite-config.js";
10
- export { VibemonEngine } from "./engine.js";
11
- export type * from "./types.js";
1
+ export * from "./host";
2
+ export { initializeSettings, refreshSettings } from "./lib/settings";
3
+ export { getVibemonState, updateVibemonState } from "./lib/account-state";
4
+ export { syncVibemonResources, resourceSyncStatus, observeResourceSync, subscribeResourceSync, type ResourceSyncStatus } from "./lib/resource-sync";
5
+ export { loadVibemonResource } from "./lib/vibemon-resources";
6
+ export { requestVibemonView } from "./lib/view-request";
7
+ export { sessionIconSvg, type SessionIcons } from "./session-icon";
8
+ export { PetSessionContext, type PetSurface, type PetSurfaceLabel } from "./lib/pet-session-context";
9
+ export { createSpriteConfig, spriteConfig } from "./lib/sprite-config";
10
+ export { VibemonEngine } from "./engine";
11
+ export type * from "./types";
@@ -1 +1 @@
1
- export*from"./host.js";import{initializeSettings as t,refreshSettings as i}from"./lib/settings.js";import{getVibemonState as s,updateVibemonState as m}from"./lib/account-state.js";import{syncVibemonResources as p,resourceSyncStatus as c,observeResourceSync as x,subscribeResourceSync as S}from"./lib/resource-sync.js";import{loadVibemonResource as u}from"./lib/vibemon-resources.js";import{requestVibemonView as g}from"./lib/view-request.js";import{sessionIconSvg as y}from"./session-icon.js";import{PetSessionContext as C}from"./lib/pet-session-context.js";import{createSpriteConfig as l,spriteConfig as v}from"./lib/sprite-config.js";import{VibemonEngine as q}from"./engine.js";export{C as PetSessionContext,q as VibemonEngine,l as createSpriteConfig,s as getVibemonState,t as initializeSettings,u as loadVibemonResource,x as observeResourceSync,i as refreshSettings,g as requestVibemonView,c as resourceSyncStatus,y as sessionIconSvg,v as spriteConfig,S as subscribeResourceSync,p as syncVibemonResources,m as updateVibemonState};
1
+ import{tn,e,we}from"../../chunk-htw56xtp.js";import{w,Kt}from"../../chunk-01py4vpp.js";import"../../chunk-pbwt3qj9.js";import"../../chunk-rerywpwe.js";import"../../chunk-afy09ajr.js";import"../../chunk-ax8zmvs0.js";import"../../chunk-4gegjx79.js";import"../../chunk-nbfhs21c.js";import"../../chunk-3amxesw3.js";import"../../chunk-qy364wgy.js";import"../../chunk-khnyadsg.js";import{Z,h}from"../../chunk-6f02m6jw.js";import{jt,Tt,Yt,te}from"../../chunk-ctvwa8d3.js";import{ne,oe}from"../../chunk-v9czb1e6.js";import{v}from"../../chunk-41jxjz9n.js";import{Wt}from"../../chunk-6t0bw1wy.js";import{_}from"../../chunk-d4ezh3c4.js";import{bt}from"../../chunk-74hpp4me.js";import"../../chunk-7y7stqn0.js";import{K}from"../../chunk-gv5he3xg.js";export{bt as PetSessionContext,K as VibemonEngine,tn as configureVibemon,ne as createSpriteConfig,Z as getVibemonState,Kt as initializeSettings,v as loadVibemonResource,Tt as observeResourceSync,w as refreshSettings,Wt as requestVibemonView,jt as resourceSyncStatus,we as sameBinding,_ as sessionIconSvg,oe as spriteConfig,Yt as subscribeResourceSync,te as syncVibemonResources,h as updateVibemonState,e as vibemonHost};
@@ -1,4 +1,4 @@
1
- import { type PetAccountState } from "./settings.js";
1
+ import { type PetAccountState } from "./settings";
2
2
  export declare function getVibemonScopeSync(): string | null;
3
3
  export declare function currentState(): PetAccountState;
4
4
  export declare const getVibemonState: () => Promise<PetAccountState>;
@@ -1 +1 @@
1
- import{accountKey as m,assertAccount as r}from"../../index.js";import{vibemonHost as l}from"../host.js";import{getSettingSync as a,refreshSettings as d,setSetting as b,updateSettingCache as S}from"./settings.js";var c={pet:"",enabled:!1,position:null};function f(){let n=l().account();return n===null?null:m(n)}function p(){let n=f();return n===null?c:a("vibemon.accounts")[n]??c}var x=()=>Promise.try(()=>p());async function g(n){let t=l(),i=t.account(),e=f();if(i===null||e===null)throw Error("Sign in to use Vibemon");if(n.pet!==void 0){let o=a("vibemon.accounts");S("vibemon.accounts",{...o,[e]:{...o[e]??c,pet:n.pet}});try{await t.assets.selection.select(n.pet||null)}finally{await d()}}r(t,i);let{enabled:s,position:u}=n;if(s!==void 0||u!==void 0){let o=a("vibemon.accounts");await b("vibemon.accounts",{...o,[e]:{...o[e]??c,...s!==void 0?{enabled:s}:{},...u!==void 0?{position:u}:{}}})}r(t,i)}async function V(n,t){if(t||p().pet==="")await g({pet:n})}export{p as currentState,V as equipVibemonAfterDraw,f as getVibemonScopeSync,x as getVibemonState,g as updateVibemonState};
1
+ import{a,X,Z,h,de}from"../../../chunk-6f02m6jw.js";import"../../../chunk-01py4vpp.js";import"../../../chunk-khnyadsg.js";import"../../../chunk-pbwt3qj9.js";import"../../../chunk-htw56xtp.js";import"../../../chunk-qy364wgy.js";import"../../../chunk-afy09ajr.js";import"../../../chunk-3amxesw3.js";import"../../../chunk-nbfhs21c.js";import"../../../chunk-ax8zmvs0.js";import"../../../chunk-rerywpwe.js";import"../../../chunk-4gegjx79.js";export{X as currentState,de as equipVibemonAfterDraw,a as getVibemonScopeSync,Z as getVibemonState,h as updateVibemonState};
@@ -1 +1 @@
1
- function v(n,o,k,y,r,l){let t=n+k,c=o+y,x=n+k/2;r=Math.min(r,k/2,y/2);let e=r*0.5522847498307936;return[{kind:"move",x:n+r,y:o},{kind:"line",x:t-r,y:o},{kind:"curve",control1X:t-r+e,control1Y:o,control2X:t,control2Y:o+r-e,x:t,y:o+r},{kind:"line",x:t,y:c-r},{kind:"curve",control1X:t,control1Y:c-r+e,control2X:t-r+e,control2Y:c,x:t-r,y:c},{kind:"line",x:x+l,y:c},{kind:"line",x:x+1,y:c+l-1},{kind:"curve",control1X:x+0.5,control1Y:c+l-0.5,control2X:x-0.5,control2Y:c+l-0.5,x:x-1,y:c+l-1},{kind:"line",x:x-l,y:c},{kind:"line",x:n+r,y:c},{kind:"curve",control1X:n+r-e,control1Y:c,control2X:n,control2Y:c-r+e,x:n,y:c-r},{kind:"line",x:n,y:o+r},{kind:"curve",control1X:n,control1Y:o+r-e,control2X:n+r-e,control2Y:o,x:n+r,y:o},{kind:"close"}]}function i(n){return n.map(X).join(" ")}function X(n){switch(n.kind){case"move":return`M${n.x},${n.y}`;case"line":return`L${n.x},${n.y}`;case"curve":return`C${n.control1X},${n.control1Y} ${n.control2X},${n.control2Y} ${n.x},${n.y}`;case"close":return"Z"}}function u(n,o){return n.map((k)=>Y(k,o))}function Y(n,o){switch(n.kind){case"move":case"line":return{kind:n.kind,x:n.x*o,y:n.y*o};case"curve":return{kind:"curve",control1X:n.control1X*o,control1Y:n.control1Y*o,control2X:n.control2X*o,control2Y:n.control2Y*o,x:n.x*o,y:n.y*o};case"close":return n}}export{i as backdropSvgPath,v as bubbleOutline,u as scaleBackdropPath};
1
+ import{Bt,Ut,Dt}from"../../../chunk-f0awr1g7.js";export{Ut as backdropSvgPath,Bt as bubbleOutline,Dt as scaleBackdropPath};
@@ -1,4 +1,4 @@
1
- import type { DrawResultItem } from "./endpoints.js";
1
+ import type { DrawResultItem } from "./endpoints";
2
2
  export type DrawResultRarity = "R" | "SR" | "SSR";
3
3
  export interface CardDrawRewardViewModel {
4
4
  kind: "card";
@@ -1 +1 @@
1
- var i=(r)=>{if(r==="R"||r==="SR"||r==="SSR")return r;throw Error(`[vibemon] unsupported draw rarity: ${r}`)},a=(r,n,e)=>{if(r===null)throw Error(`[vibemon] drawn white card at index ${n.draw_index} is missing ${e}`);return r},d=(r)=>({kind:"card",drawIndex:r.draw_index,vibemonUuid:r.vibemon_uuid,vibemonName:r.vibemon_name,singleImageUrl:r.gacha_url??"",multiImageUrl:r.multi_draw_url??"",rarity:i(r.rarity_code),isNew:!r.is_duplicate}),u=(r)=>{if(r==="UC"||r==="C")return r;throw Error(`[vibemon] unsupported white-card rarity: ${r}`)},w=(r)=>{if(r.reward_type!=="WHITE_CARD"){if(!r.vibemon_uuid)throw Error("Vibemon draw result is missing its ID");return d(r)}return{kind:"white-card",drawIndex:r.draw_index,rarity:u(r.rarity_code),exchangePoints:r.exchange_points,singleImageUrl:a(r.gacha_url,r,"gacha_url"),multiImageUrl:a(r.multi_draw_url,r,"multi_draw_url")}};export{w as createDrawReward};
1
+ import{Ct}from"../../../chunk-jampyjt1.js";export{Ct as createDrawReward};
@@ -1,4 +1,4 @@
1
- export type * from "../../index.js";
1
+ export type * from "../../index";
2
2
  export declare const getMyVibemons: () => Promise<{
3
3
  resource_url?: string | null;
4
4
  resource_package_format?: number | null;
@@ -1 +1 @@
1
- import{vibemonHost as t}from"../host.js";var a=()=>t().assets.getMyVibemons(),c=()=>t().assets.getVibemonCatalog(),i=()=>t().assets.getPointAccount(),r=()=>t().assets.getGachaFirstDraw(),n=()=>t().assets.markVibemonFirstVisit(),g=()=>t().assets.getActiveGachaPools(),m=(o)=>t().assets.getGachaPoolDetail(o),l=(o,s)=>t().assets.drawGachaPool(o,s);export{l as drawGachaPool,g as getActiveGachaPools,r as getGachaFirstDraw,m as getGachaPoolDetail,a as getMyVibemons,i as getPointAccount,c as getVibemonCatalog,n as markVibemonFirstVisit};
1
+ import{Rt,Pn,pe,Et,kt,It,At,Vt}from"../../../chunk-vt1sfk87.js";import"../../../chunk-htw56xtp.js";export{Vt as drawGachaPool,It as getActiveGachaPools,Et as getGachaFirstDraw,At as getGachaPoolDetail,Rt as getMyVibemons,pe as getPointAccount,Pn as getVibemonCatalog,kt as markVibemonFirstVisit};
@@ -1,4 +1,4 @@
1
- import { type GachaPoolDetailResponse, type GachaPoolSummary } from "./endpoints.js";
1
+ import { type GachaPoolDetailResponse, type GachaPoolSummary } from "./endpoints";
2
2
  export type GachaPoolStatus = "UPCOMING" | "ACTIVE" | "ENDED" | "UNAVAILABLE";
3
3
  export interface GachaPoolViewModel {
4
4
  poolUuid: string;
@@ -1 +1 @@
1
- import{vibemonHost as d}from"../host.js";import{getActiveGachaPools as f,getGachaPoolDetail as m}from"./endpoints.js";var i={SSR:5,SR:4,R:3,UC:2,C:1};function u(e){let t=e.items.filter((o)=>(o.reward_type==="VIBEMON"||o.reward_type==null)&&Boolean(o.vibemon_uuid)&&o.status===1),r=t[0];if(r===void 0)throw Error(`[vibemon] gacha pool ${e.uuid} has no active Vibemon item`);return t.slice(1).reduce((o,a)=>{if(i[a.rarity_code]-i[o.rarity_code]>0)return a;return o},r)}function _(e,t){if(t.uuid!==e.uuid)throw Error(`[vibemon] gacha pool detail UUID ${t.uuid} does not match catalog UUID ${e.uuid}`);if(t.multi_count!==10)throw Error(`[vibemon] gacha pool ${t.uuid} multi_count must be 10, received ${t.multi_count}`);let r=u(t);return{poolUuid:t.uuid,name:t.name,sidebarSelectedImageUrl:r.vibemon_sidebar_selected_url??"",sidebarHoverImageUrl:r.vibemon_sidebar_hover_url??"",sidebarUnselectedImageUrl:r.vibemon_sidebar_unselected_url??"",pageBackgroundImageUrl:r.vibemon_background_url??"",poolCardImageUrl:r.vibemon_pool_card_url??"",status:t.status===1?"ACTIVE":"UNAVAILABLE",startsAt:e.start_time,endsAt:e.end_time,singlePrice:t.next_single_actual_cost??e.single_cost,multiPrice:t.next_multi_actual_cost??e.multi_cost,currencyType:e.currency_type,canDraw:t.status===1,isDefault:e.is_default===1}}function g(e,t){if(e.length===0)throw Error("[vibemon] active gacha pool catalog is empty");let r=new Map(t.map((a)=>[a.uuid,a]));return{pools:[...e].toSorted((a,n)=>a.sort_order-n.sort_order).map((a)=>{let n=r.get(a.uuid);if(n===void 0)throw Error(`[vibemon] gacha pool ${a.uuid} is missing its detail response`);return _(a,n)})}}function h(e){let t=e.pools.flatMap((r)=>[r.sidebarSelectedImageUrl,r.sidebarHoverImageUrl,r.sidebarUnselectedImageUrl,r.poolCardImageUrl,r.pageBackgroundImageUrl]);return[...new Set(t.filter(Boolean))]}async function U(){let t=[...await f()].toSorted((o,a)=>o.sort_order-a.sort_order),r=await Promise.all(t.map((o)=>m(o.uuid)));return await Promise.all(r.map(async(o)=>{let a=u(o),n=await d().assets.resolveImages(a.vibemon_uuid,a.vibemon_resource_url);for(let[c,l]of Object.entries(n))Object.assign(a,{[`vibemon_${c}`]:l})})),g(t,r)}function s(e,t,r){let o=Date.parse(t);if(Number.isNaN(o))throw Error(`[vibemon] gacha pool ${e.poolUuid} has invalid ${r}: ${t}`);return o}function b(e,t){if(e.status==="UNAVAILABLE")return e.status;if(e.startsAt!==null&&t<s(e,e.startsAt,"startsAt"))return"UPCOMING";if(e.endsAt!==null&&t>=s(e,e.endsAt,"endsAt"))return"ENDED";return e.status}function w(e){let t=e.find((o)=>o.isDefault);if(t!==void 0)return t;let r=e[0];if(r===void 0)throw Error("[vibemon] gacha pool catalog has no visible pools");return r}function I(e,t){return e.filter((r)=>b(r,t)!=="ENDED")}export{g as createGachaPoolCatalog,h as gachaPoolImageUrls,w as getDefaultGachaPool,I as getVisibleGachaPools,U as loadGachaPoolCatalog,b as resolveGachaPoolStatus};
1
+ import{en,xt,St,me,Pt,_t}from"../../../chunk-pe1mn10v.js";import"../../../chunk-vt1sfk87.js";import"../../../chunk-htw56xtp.js";export{en as createGachaPoolCatalog,xt as gachaPoolImageUrls,Pt as getDefaultGachaPool,_t as getVisibleGachaPools,St as loadGachaPoolCatalog,me as resolveGachaPoolStatus};
@@ -1 +1 @@
1
- function r(n,o,c){let t=Math.min(1,Math.max(0,o)),a=Math.min(t,n+Math.max(0,t-n)*12*c);return t===1&&a>=0.999?1:a}export{r as advanceLoadingProgress};
1
+ import{yt}from"../../../chunk-b5zfgr86.js";export{yt as advanceLoadingProgress};
@@ -1,5 +1,5 @@
1
- import type { VibemonEngine } from "../engine.js";
2
- import type { RunState } from "./runtime-types.js";
1
+ import type { VibemonEngine } from "../engine";
2
+ import type { RunState } from "./runtime-types";
3
3
  export declare class PetAnimationSync {
4
4
  private engine;
5
5
  private states;
@@ -1 +1 @@
1
- class n{engine=null;states=[];sessionId=null;failed=!1;bindingRevision=-1;historicalDone=!1;pendingPrompt=!1;attach(s){this.engine=s,this.historicalDone=this.state()==="done",this.apply()}bind(s,i,t=0){let e=this.sessionId!==s||this.bindingRevision!==t;if(this.sessionId=s,this.failed=i,this.bindingRevision=t,e)this.pendingPrompt=!1,this.engine?.setSessionState(null,null,!1),this.historicalDone=this.state()==="done";this.apply()}prompt(s,i,t){if(s!==this.sessionId||i!==this.bindingRevision)return;this.pendingPrompt=t,this.apply()}update(s,i="event"){let t=this.state();if(this.states=s,this.state()!==t)this.historicalDone=i==="snapshot"&&this.state()==="done";this.apply()}state(){return this.states.find((s)=>s.sessionId===this.sessionId)?.state??null}apply(){let s=this.state();this.engine?.setSessionState(this.sessionId,this.pendingPrompt?"requires_action":s==="done"&&this.historicalDone?"idle":s,this.pendingPrompt?!1:this.failed)}}export{n as PetAnimationSync};
1
+ import{he}from"../../../chunk-mdqxdcxh.js";export{he as PetAnimationSync};
@@ -1,4 +1,4 @@
1
- import type { RunState } from "./runtime-types.js";
1
+ import type { RunState } from "./runtime-types";
2
2
  export declare class PetBubbleState {
3
3
  private readonly apply;
4
4
  private requested;
@@ -1 +1 @@
1
- class r{apply;requested=!1;interacting=!1;visible=null;state=null;prompt=null;sessionId=null;revision=-1;ownerLabel="";observed=!1;constructor(e){this.apply=e}bind(e,s){if(this.sessionId===e&&this.revision===s)return;let t=this.requested&&e!==null;this.sessionId=e,this.revision=s,this.ownerLabel="",this.reset(),this.requested=t}owner(e){if(this.ownerLabel!==""&&this.ownerLabel!==e)this.reset();this.ownerLabel=e}reset(){this.requested=!1,this.interacting=!1,this.visible=null,this.state=null,this.prompt=null,this.observed=!1,this.publish()}update(e,s,t){if(e!==null&&t!==null){let i=this.observed&&(e!==this.state||s!==this.prompt);if(this.state=e,this.prompt=s,this.observed=!0,i&&(e==="running"||e==="requires_action"||s!==null))this.requested=!0}if(this.visible=t,t&&!this.interacting)this.requested=!1;this.publish()}open(){if(this.sessionId===null)return;this.requested=!0,this.interacting=!0,this.publish()}interact(){if(!this.requested)return;this.interacting=!0,this.publish()}close(){this.requested=!1,this.interacting=!1,this.publish()}publish(){this.apply(this.requested&&(this.interacting||this.visible===!1))}}export{r as PetBubbleState};
1
+ import{ge}from"../../../chunk-3vpcfe38.js";export{ge as PetBubbleState};
@@ -1,3 +1,3 @@
1
- import type { VibemonEngine } from "../engine.js";
2
- import type { PetWindowHost } from "../host.js";
1
+ import type { VibemonEngine } from "../engine";
2
+ import type { PetWindowHost } from "../host";
3
3
  export declare function dragPet(windows: Pick<PetWindowHost, "call" | "moved">, engine: Pick<VibemonEngine, "handleDragStart" | "setFacing" | "handleDragEnd">, movingLeft: boolean): Promise<void>;
@@ -1 +1 @@
1
- async function r(a,t,c){t.handleDragStart(c);let l=null;try{let i=(await a.call("position")).x;l=await a.moved((o)=>{let s=o.x-i;if(Math.abs(s)>2)t.setFacing(s<0),i=o.x}),await a.call("drag")}finally{l?.(),t.handleDragEnd()}}export{r as dragPet};
1
+ import{Lt}from"../../../chunk-v5akzbxg.js";export{Lt as dragPet};
@@ -1,6 +1,6 @@
1
- import type { VibemonEngine } from "../engine.js";
2
- import type { PetWindowHost } from "../host.js";
3
- import type { PresentationReadiness } from "./presentation-readiness.js";
1
+ import type { VibemonEngine } from "../engine";
2
+ import type { PetWindowHost } from "../host";
3
+ import type { PresentationReadiness } from "./presentation-readiness";
4
4
  type PresentationEngine = Pick<VibemonEngine, "resume" | "presentAt">;
5
5
  export declare function presentVibemon<T extends PresentationEngine>(ready: PresentationReadiness<T>, windows: Pick<PetWindowHost, "call">, petId: string): Promise<void>;
6
6
  export {};
@@ -1 +1 @@
1
- async function i(a,n,t){let e=await a.wait(t,Date.now()+15000);await e.presentAt(async()=>(e.resume(),a.requireFreshFrame(t),await a.wait(t,Date.now()+15000),a.assertReady(t,e),await n.call("present"),n.call("position")))}export{i as presentVibemon};
1
+ import{wt}from"../../../chunk-96emfz6b.js";export{wt as presentVibemon};
@@ -1 +1 @@
1
- class t{surfaces={main:{sessionId:null,visible:!1},chat:{sessionId:null,visible:!1}};selectedWindow=null;target(){if(this.selectedWindow!==null){let s=this.surfaces[this.selectedWindow].sessionId;if(s!==null)return s;this.selectedWindow=null}return this.surfaces.chat.sessionId??this.surfaces.main.sessionId}surface(s,e){this.surfaces[s]=e,this.target()}select(s){if(this.surfaces.chat.sessionId===s)this.selectedWindow="chat";else if(this.surfaces.main.sessionId===s)this.selectedWindow="main";else throw Error("The conversation is no longer current")}collapse(s){this.surfaces.chat={...this.surfaces.chat,sessionId:s},this.selectedWindow=null}reset(){this.selectedWindow=null}}export{t as PetSessionContext};
1
+ import{bt}from"../../../chunk-74hpp4me.js";export{bt as PetSessionContext};
@@ -1 +1 @@
1
- var t=new Map;function i(e){let n=t.get(e);if(n)return t.delete(e),t.set(e,n),n;let a=new Image;a.src=e;let o=a.decode().then(()=>a).catch((s)=>{if(t.get(e)===o)t.delete(e);throw Error(`[vibemon] preload failed: ${e}`,{cause:s})});if(t.set(e,o),t.size>64)t.delete(t.keys().next().value);return o}async function c(e,n){let a=0;await Promise.all(e.map(async(o)=>{await i(o),n(++a)}))}export{c as preloadImages};
1
+ import{ve}from"../../../chunk-9h4j75af.js";export{ve as preloadImages};
@@ -1 +1 @@
1
- class l{current=null;listeners=new Set;begin(e,t){this.current={petId:e,generation:t,value:null,drawn:!1,error:null},this.notify()}positioned(e,t,r){let i=this.current;if(i?.petId!==e||i.generation!==t)return;i.value=r,this.notify()}drawn(e,t){let r=this.current;if(r?.petId!==e||r.generation!==t||r.drawn)return;r.drawn=!0,this.notify()}requireFreshFrame(e){if(this.current?.petId!==e)throw Error("Vibemon resource changed");this.current.drawn=!1,this.notify()}fail(e,t,r){let i=this.current;if(i?.petId!==e||i.generation!==t)return;i.error=r,this.notify()}invalidate(){if(this.current===null)return;this.current.error=Error("Vibemon resource was unloaded"),this.notify()}reset(){this.invalidate(),this.current=null,this.notify()}assertReady(e,t){let r=this.current;if(r?.petId!==e||r.value!==t||!r.drawn||r.error!==null)throw Error("Vibemon resource changed during presentation")}notify(){for(let e of this.listeners)e()}waitingStage(){let e=this.current;if(e===null)return"resource-loading";if(e.value===null)return"initial-position";if(!e.drawn)return"canvas-frame";return"ready"}wait(e,t){let r=this.current?.generation;return new Promise((i,u)=>{let a=()=>{clearTimeout(c),this.listeners.delete(o)},s=(n)=>{a(),u(n)},o=()=>{if(Date.now()>=t){s(Error(`Vibemon presentation timed out [stage=${this.waitingStage()}]`));return}let n=this.current;if(!n)return;if(r??=n.generation,n.petId!==e||r!==void 0&&r!==n.generation)s(Error("Vibemon resource changed during presentation"));else if(n.error)s(n.error);else if(n.drawn&&n.value!==null)a(),i(n.value)},c=setTimeout(()=>s(Error(`Vibemon presentation timed out [stage=${this.waitingStage()}]`)),Math.max(0,t-Date.now()));this.listeners.add(o),o()})}}export{l as PresentationReadiness};
1
+ import{ue}from"../../../chunk-kwq26qhs.js";export{ue as PresentationReadiness};
@@ -1,2 +1,2 @@
1
- import type { MyVibemonItem } from "./endpoints.js";
1
+ import type { MyVibemonItem } from "./endpoints";
2
2
  export declare function sortByRarityDesc<T extends Pick<MyVibemonItem, "rarity_code">>(items: T[]): T[];
@@ -1 +1 @@
1
- var n=["SSR","SR","R","UC","C"],e=(r)=>{let t=n.indexOf(r);return t===-1?n.length:t};function R(r){return[...r].toSorted((t,o)=>e(t.rarity_code)-e(o.rarity_code))}export{R as sortByRarityDesc};
1
+ import{Q}from"../../../chunk-jppe84sk.js";export{Q as sortByRarityDesc};
@@ -1 +1 @@
1
- import{vibemonHost as o}from"../host.js";var n=()=>o().windows.openRecharge();export{n as openAccountUrl};
1
+ import{E}from"../../../chunk-wa475kmq.js";import"../../../chunk-htw56xtp.js";export{E as openAccountUrl};
@@ -1,4 +1,4 @@
1
- import type { RunState } from "./runtime-types.js";
1
+ import type { RunState } from "./runtime-types";
2
2
  export interface PetSubmission {
3
3
  sessionId: string;
4
4
  text: string;
@@ -1 +1 @@
1
- function t(e,r,n){if(n<e.startedAt)return e;if(r==="running")return{...e,sawRunning:!0,completed:!1};if(r==="requires_action")return{...e,completed:!1};if(r==="done"||r==="idle"&&e.sawRunning)return{...e,completed:!0};return e}export{t as advancePetSubmission};
1
+ import{vt}from"../../../chunk-pha0eyam.js";export{vt as advancePetSubmission};
@@ -1 +1 @@
1
- import{createStore as m}from"zustand/vanilla";import{accountKey as h,matchesResource as S}from"../../index.js";import{vibemonHost as g}from"../host.js";var f=m(()=>({status:"idle"})),x=()=>f.getState().status,b=(e)=>f.setState({status:e}),z=(e)=>f.subscribe((n)=>e(n.status)),c=null;async function E(){let e=g();if(e.synchronizeResources!==void 0)return e.synchronizeResources();let n=e.account();if(n===null)return;let u=`${h(n)}/${n.revision}`,o=()=>{let t=e.account();return t!==null&&`${h(t)}/${t.revision}`===u};if(c?.scope===u)return c.operation;let a=(t)=>{if(o())b(t)},p=(t,s)=>{if(!o())return;if(e.onResourceSyncError)e.onResourceSyncError(t,s);else console.warn("[vibemon] resource sync failed",s,t)},l=(async()=>{a("checking");try{let t=await e.assets.getVibemonCatalog();if(!o())return;let s=new Set,y=0,d=!1;if(await Promise.all(Array.from({length:Math.min(6,t.length)},async()=>{while(o()&&y<t.length){let r=t[y++];try{let i=await e.assets.resources.inspect(r.uuid);if(i&&S(i,r))continue;a("updating"),await e.assets.resources.ensure(r),s.add(r.uuid)}catch(i){d=!0,p(i,{phase:"resource",petId:r.uuid})}}})),o())try{await e.resourcesSynchronized?.(s)}catch(r){if(o())e.onError(r)}a(d?"error":s.size===0?"idle":"done")}catch(t){a("error"),p(t,{phase:"catalog"})}})();c={scope:u,operation:l};try{await l}finally{if(c?.operation===l)c=null}}export{b as observeResourceSync,x as resourceSyncStatus,z as subscribeResourceSync,E as syncVibemonResources,f as vibemonSyncStore};
1
+ import{ee,jt,Tt,Yt,te}from"../../../chunk-ctvwa8d3.js";import"../../../chunk-khnyadsg.js";import"../../../chunk-pbwt3qj9.js";import"../../../chunk-htw56xtp.js";import"../../../chunk-qy364wgy.js";import"../../../chunk-afy09ajr.js";import"../../../chunk-3amxesw3.js";import"../../../chunk-nbfhs21c.js";import"../../../chunk-ax8zmvs0.js";import"../../../chunk-rerywpwe.js";import"../../../chunk-4gegjx79.js";export{Tt as observeResourceSync,jt as resourceSyncStatus,Yt as subscribeResourceSync,te as syncVibemonResources,ee as vibemonSyncStore};
@@ -1 +1 @@
1
- export type { RunState } from "../host.js";
1
+ export type { RunState } from "../host";
@@ -1 +1 @@
1
- import{vibemonHost as s}from"../host.js";var e={"vibemon.accounts":{},"vibemon.introSeen":{},"vibemon.albumHasUnseen":{},"vibemon.onboardingStep":{}},i=new Set,r=0;async function c(){let t=++r,n=s(),a=await Promise.all(Object.keys(e).map(async(o)=>[o,await n.storage.get(o)??{}]));if(r!==t)return;e=Object.fromEntries(a);for(let o of i)o()}async function p(){let t=s().subscribeStorage(()=>{c().catch(s().onError)});return await c(),()=>{r++,t()}}var b=(t)=>(i.add(t),()=>{i.delete(t)}),u=(t)=>e[t],f=(t)=>Promise.resolve(e[t]);function m(t,n){r++,e={...e,[t]:n};for(let a of i)a()}async function S(t,n){await s().storage.set(t,n),await c()}export{f as getSetting,u as getSettingSync,p as initializeSettings,c as refreshSettings,S as setSetting,b as subscribeSettings,m as updateSettingCache};
1
+ import{w,Kt,Nt,u,be,Mt,R}from"../../../chunk-01py4vpp.js";import"../../../chunk-htw56xtp.js";export{be as getSetting,u as getSettingSync,Kt as initializeSettings,w as refreshSettings,R as setSetting,Nt as subscribeSettings,Mt as updateSettingCache};
@@ -1,4 +1,4 @@
1
- import type { CachedPetMetadata, SheetLayout } from "../../index.js";
2
- import type { VibemonSpriteConfig } from "../types.js";
1
+ import type { CachedPetMetadata, SheetLayout } from "../../index";
2
+ import type { VibemonSpriteConfig } from "../types";
3
3
  export declare function createSpriteConfig(name: string, sheetName: string, layout: SheetLayout): VibemonSpriteConfig;
4
4
  export declare function spriteConfig(id: string, resource: CachedPetMetadata): VibemonSpriteConfig;
@@ -1 +1 @@
1
- var f={working:{fps:7,loop:!0},empty:{fps:6,loop:!0},done:{fps:7,loop:!1},wait:{fps:7,loop:!0},drag:{fps:7,loop:!0},error:{fps:7,loop:!0},hover:{fps:6,loop:!0}};function s(i,t,r){let n=r.states.map((o)=>o.id),e=(...o)=>o.find((m)=>n.includes(m))??n[0],a={idle:e("empty","working"),"idle-alt":e("empty","working"),groom:e("empty","working"),"groom-alt":e("empty","working"),run:e("drag","working"),sleep:e("empty","working"),sit:e("working","empty"),interact:e("done","hover","empty"),jump:e("done","empty"),scared:e("drag","empty"),wait:e("wait","empty"),error:e("error","wait","empty"),hover:e("hover","empty")},p=r.frameWidth;return{name:i,frameSize:p,frameHeight:r.frameHeight,renderSize:p,cropX:0,cropY:0,cropW:p,cropH:r.frameHeight,spritesheet:t,facing:"right",behaviorMap:a,states:r.states.map((o)=>({...o,...f[o.id]??{fps:6,loop:!0}}))}}function g(i,t){if(t.config!==void 0)return t.config;if(t.sheetName===null||t.layout===null)throw Error("Vibemon has no animation");return s(t.name??i,t.sheetName,t.layout)}export{s as createSpriteConfig,g as spriteConfig};
1
+ import{ne,oe}from"../../../chunk-v9czb1e6.js";export{ne as createSpriteConfig,oe as spriteConfig};
@@ -1,3 +1,3 @@
1
- import { type SpriteResource } from "../host.js";
1
+ import { type SpriteResource } from "../host";
2
2
  export declare function verifyVibemonResource(id: string): Promise<boolean>;
3
3
  export declare function loadVibemonResource(id: string): Promise<SpriteResource>;