myshell-react-lib 0.1.0

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 (151) hide show
  1. package/README.md +268 -0
  2. package/dist/assets/audio-playing.json +3657 -0
  3. package/dist/index.cjs +9654 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +1431 -0
  6. package/dist/index.d.ts +1431 -0
  7. package/dist/index.js +8788 -0
  8. package/dist/index.js.map +1 -0
  9. package/package.json +140 -0
  10. package/src/common/assets/audio-playing.json +3657 -0
  11. package/src/common/constants/constants.ts +24 -0
  12. package/src/common/constants/types/common.ts +10 -0
  13. package/src/common/hooks/useAudioPlayer.tsx +198 -0
  14. package/src/common/hooks/useDevice.ts +26 -0
  15. package/src/common/hooks/useNativeBridge.ts +42 -0
  16. package/src/common/hooks/useNotification.tsx +179 -0
  17. package/src/common/hooks/useWindowWidth.ts +19 -0
  18. package/src/common/utils/common-helper.ts +81 -0
  19. package/src/components/ItemDemo.tsx +15 -0
  20. package/src/components/accordion.tsx +126 -0
  21. package/src/components/alert-dialog.tsx +148 -0
  22. package/src/components/alert.tsx +65 -0
  23. package/src/components/aspect-ratio.tsx +7 -0
  24. package/src/components/audio-player.tsx +58 -0
  25. package/src/components/avatar.tsx +133 -0
  26. package/src/components/badge.tsx +65 -0
  27. package/src/components/button/button.styles.ts +258 -0
  28. package/src/components/button/button.tsx +215 -0
  29. package/src/components/button/icon-button.styles.ts +101 -0
  30. package/src/components/button/icon-button.tsx +100 -0
  31. package/src/components/button/index.tsx +3 -0
  32. package/src/components/button/link-button.tsx +184 -0
  33. package/src/components/cascader.tsx +175 -0
  34. package/src/components/checkbox.tsx +135 -0
  35. package/src/components/command.tsx +155 -0
  36. package/src/components/context-menu.tsx +198 -0
  37. package/src/components/count-down.tsx +83 -0
  38. package/src/components/custom-notification.tsx +95 -0
  39. package/src/components/dialog.tsx +158 -0
  40. package/src/components/drawer.tsx +116 -0
  41. package/src/components/dropdown-menu.tsx +196 -0
  42. package/src/components/energy-progress.tsx +55 -0
  43. package/src/components/form.tsx +201 -0
  44. package/src/components/group.tsx +9 -0
  45. package/src/components/guide.tsx +243 -0
  46. package/src/components/icon.tsx +89 -0
  47. package/src/components/icons/outline/DownIcon.tsx +18 -0
  48. package/src/components/icons/outline/FilterIcon.tsx +21 -0
  49. package/src/components/icons/outline/arrow-left.tsx +16 -0
  50. package/src/components/icons/outline/arrow-up-tray.tsx +16 -0
  51. package/src/components/icons/outline/check-circle.tsx +17 -0
  52. package/src/components/icons/outline/config.tsx +42 -0
  53. package/src/components/icons/outline/pencil-square.tsx +16 -0
  54. package/src/components/icons/outline/trash.tsx +17 -0
  55. package/src/components/icons/outline/window.tsx +16 -0
  56. package/src/components/icons/outline/x-circle.tsx +17 -0
  57. package/src/components/icons/outline/x-mark.tsx +16 -0
  58. package/src/components/icons/solid/audio-playing.tsx +31 -0
  59. package/src/components/icons/solid/caret-down.tsx +14 -0
  60. package/src/components/icons/solid/code.tsx +18 -0
  61. package/src/components/icons/solid/drag.tsx +14 -0
  62. package/src/components/icons/solid/phone.tsx +23 -0
  63. package/src/components/icons/solid/rectangle-group.tsx +14 -0
  64. package/src/components/image.tsx +151 -0
  65. package/src/components/input.tsx +118 -0
  66. package/src/components/label.tsx +26 -0
  67. package/src/components/link.tsx +123 -0
  68. package/src/components/marquee/index.css +15 -0
  69. package/src/components/marquee/marquee.tsx +220 -0
  70. package/src/components/masonry.tsx +138 -0
  71. package/src/components/menubar.tsx +234 -0
  72. package/src/components/mobile/m-tooltip.tsx +34 -0
  73. package/src/components/modal.tsx +561 -0
  74. package/src/components/navigation-bar.tsx +100 -0
  75. package/src/components/number-input.tsx +143 -0
  76. package/src/components/page-content.tsx +16 -0
  77. package/src/components/popover.tsx +191 -0
  78. package/src/components/progress.tsx +80 -0
  79. package/src/components/radio-group.tsx +44 -0
  80. package/src/components/scroll-area.tsx +49 -0
  81. package/src/components/search-bar.tsx +140 -0
  82. package/src/components/secondary-navigation-bar.tsx +307 -0
  83. package/src/components/select.tsx +273 -0
  84. package/src/components/separator.tsx +31 -0
  85. package/src/components/sheet.tsx +143 -0
  86. package/src/components/skeleton.tsx +20 -0
  87. package/src/components/slider.tsx +160 -0
  88. package/src/components/spinner.tsx +48 -0
  89. package/src/components/swiper/index.module.scss +88 -0
  90. package/src/components/swiper/index.tsx +319 -0
  91. package/src/components/switch.tsx +67 -0
  92. package/src/components/tabs.tsx +325 -0
  93. package/src/components/textarea.tsx +71 -0
  94. package/src/components/toast/toast.tsx +182 -0
  95. package/src/components/toast/toaster.tsx +160 -0
  96. package/src/components/toast/use-toast.tsx +248 -0
  97. package/src/components/toggle-group.tsx +64 -0
  98. package/src/components/toggle.tsx +46 -0
  99. package/src/components/tooltip.tsx +283 -0
  100. package/src/components/typography.tsx +437 -0
  101. package/src/index.ts +66 -0
  102. package/src/lib/utils.ts +62 -0
  103. package/src/stories/Accordion.stories.tsx +64 -0
  104. package/src/stories/AccordionItem.stories.tsx +48 -0
  105. package/src/stories/Avatar.stories.ts +58 -0
  106. package/src/stories/Badge.stories.tsx +40 -0
  107. package/src/stories/BannerSwiper.stories.tsx +102 -0
  108. package/src/stories/Button.stories.tsx +543 -0
  109. package/src/stories/Checkbox.stories.tsx +161 -0
  110. package/src/stories/Configure.mdx +341 -0
  111. package/src/stories/CssProperties.mdx +30 -0
  112. package/src/stories/Description.stories.ts +70 -0
  113. package/src/stories/Display.stories.ts +64 -0
  114. package/src/stories/FeaturedSwiper.stories.tsx +6978 -0
  115. package/src/stories/GridSwiper.stories.tsx +1407 -0
  116. package/src/stories/Guide.stories.tsx +247 -0
  117. package/src/stories/Heading.stories.ts +89 -0
  118. package/src/stories/Icon.stories.ts +77 -0
  119. package/src/stories/IconButton.stories.tsx +301 -0
  120. package/src/stories/IconTextButton.stories.ts +59 -0
  121. package/src/stories/Image.stories.ts +55 -0
  122. package/src/stories/Input.stories.tsx +203 -0
  123. package/src/stories/Modal.stories.tsx +144 -0
  124. package/src/stories/NavigationBar.stories.tsx +81 -0
  125. package/src/stories/Notification.stories.tsx +276 -0
  126. package/src/stories/Popover.stories.tsx +100 -0
  127. package/src/stories/SearchBar.stories.ts +43 -0
  128. package/src/stories/SecondaryNavigationBar.stories.tsx +199 -0
  129. package/src/stories/Select.stories.tsx +107 -0
  130. package/src/stories/Separator.stories.tsx +49 -0
  131. package/src/stories/Spinner.stories.tsx +48 -0
  132. package/src/stories/SubHeading.stories.ts +64 -0
  133. package/src/stories/Swich.stories.tsx +69 -0
  134. package/src/stories/Tabs.stories.tsx +90 -0
  135. package/src/stories/Text.stories.ts +78 -0
  136. package/src/stories/Textarea.stories.tsx +155 -0
  137. package/src/stories/Toast.stories.tsx +424 -0
  138. package/src/stories/Tooltip.stories.tsx +244 -0
  139. package/src/stories/ViewAutoSwiper.stories.tsx +1408 -0
  140. package/src/styles/components-dark.scss +212 -0
  141. package/src/styles/components-light.scss +210 -0
  142. package/src/styles/design-dark.scss +330 -0
  143. package/src/styles/design-light.scss +345 -0
  144. package/src/styles/design2-dark.scss +319 -0
  145. package/src/styles/design2-light.scss +364 -0
  146. package/src/styles/font.css +19 -0
  147. package/src/styles/global.scss +251 -0
  148. package/src/styles/md-viewer.scss +155 -0
  149. package/src/styles/new-tokens.scss +255 -0
  150. package/src/styles/tokens.scss +401 -0
  151. package/src/types/scss.d.ts +24 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/xiaoguang/code/myshell-react-lib/dist/index.js","../src/components/accordion.tsx","../src/lib/utils.ts","../src/components/icon.tsx","../src/components/separator.tsx","../src/components/typography.tsx","../src/components/icons/outline/DownIcon.tsx","../src/components/alert.tsx","../src/components/alert-dialog.tsx","../src/components/button/button.tsx","../src/common/utils/common-helper.ts","../src/components/image.tsx","../src/components/button/button.styles.ts","../src/components/aspect-ratio.tsx","../src/components/audio-player.tsx","../src/common/hooks/useAudioPlayer.tsx","../src/common/hooks/useDevice.ts","../src/common/hooks/useWindowWidth.ts","../src/components/button/icon-button.tsx","../src/components/tooltip.tsx","../src/components/popover.tsx","../src/components/button/icon-button.styles.ts","../src/components/icons/solid/audio-playing.tsx","../node_modules/@radix-ui/react-primitive/src/primitive.tsx","../src/components/avatar.tsx","../src/components/badge.tsx","../src/components/cascader.tsx","../src/components/dropdown-menu.tsx","../src/components/checkbox.tsx","../src/components/command.tsx","../src/components/dialog.tsx","../src/components/context-menu.tsx","../src/components/count-down.tsx","../src/components/drawer.tsx","../src/components/form.tsx","../src/components/label.tsx","../src/components/group.tsx","../src/components/guide.tsx","../src/components/input.tsx","../src/components/link.tsx","../src/common/hooks/useNativeBridge.ts","../src/components/masonry.tsx","../src/components/menubar.tsx","../src/components/modal.tsx","../node_modules/@radix-ui/react-focus-scope/src/focus-scope.tsx","../node_modules/@radix-ui/react-compose-refs/src/composeRefs.tsx","../node_modules/@radix-ui/react-use-callback-ref/src/useCallbackRef.tsx","../src/components/search-bar.tsx","../src/components/energy-progress.tsx","../src/components/progress.tsx","../src/components/navigation-bar.tsx","../node_modules/decimal.js/decimal.mjs","../src/components/number-input.tsx","../src/components/page-content.tsx","../src/components/radio-group.tsx","../src/components/scroll-area.tsx","../src/components/secondary-navigation-bar.tsx","../src/components/icons/outline/FilterIcon.tsx","../src/components/select.tsx","../src/components/sheet.tsx","../src/components/skeleton.tsx","../src/components/slider.tsx","../src/components/spinner.tsx","../src/components/switch.tsx","../src/components/tabs.tsx","../src/components/textarea.tsx","../src/components/toggle.tsx","../src/components/toggle-group.tsx","../src/components/toast/toast.tsx","../src/components/toast/toaster.tsx","../src/components/toast/use-toast.tsx","../src/components/swiper/index.tsx","../src/components/swiper/index.module.scss","../src/components/custom-notification.tsx","../src/common/hooks/useNotification.tsx"],"names":["AccordionPrimitive","React","clsx","twMerge","cn","inputs","cva","jsx","iconVariants","variants","size","xs","sm","md","lg","xl","color","default","subtle","subtler","subtlest","disabled","bolder","inverse","rotate","defaultVariants","Icon","forwardRef","props","ref","children","component","className","passProps","Com","displayName","SeparatorPrimitive","Separator","React2","orientation","decorative","Root","sanitize","colorMap","static","brand","critical","warning","success","lineClampMap","displayVariants","lineClamp","headingVariants","h1","h2","h3","h4","h5","subHeadingVariants","textVariants","weight","regular","medium","semibold","descriptionVariants","HComponentMap","h6","TextComponentMap","p","blockquote","span","code","bold","italic","strikethrough","underline","renderBlock","strong","defaultValue","underlineValue","strikethroughValue","strongValue","italicValue","dangerouText","text","ADD_ATTR","FORBID_TAGS","FORBID_ATTR","Heading","React3","dangerous","Comp","dangerouslySetInnerHTML","__html","Display","Title","SubHeading","SubTitle","Text","Paragraph","Description","DownIcon","xmlns","width","height","viewBox","fill","d","DownIcon_default","jsxs","Accordion","AccordionItem","React4","triggerClassName","sticky","label","count","Item","AccordionTrigger","AccordionContent","headerClassName","rest","Header","Trigger","Content","alertVariants","variant","destructive","info","error","Alert","React5","role","AlertTitle","AlertDescription","AlertDialogPrimitive","Slot","Loader2","CDN_URL","getAssetsUrl","url","isString","trim","startsWith","clamp","value","min","max","Math","isClient","window","isIosApp","navigator","test","userAgent","webkit","str","String","RCImage","imageVariants","rounded","none","full","object","contain","cover","Image","imgClassName","placeholder","src","fallback","isBackgroud","preview","fetchPriority","loading","otherProps","rootClassName","BASE_BUTTON","SIZE_CLASSES","base","withPadding","iconSize","COLOR_THEMES","primary","secondary","tertiary","link","plain","chat","VARIANT_BASE","opacity","solid","SPECIAL_LAYOUTS","buttonVariants","gray","compoundVariants","Fragment","Button","React6","iconClassName","icon","iconDirection","asChild","noStyle","iconOutBox","isBlock","autoFocus","asset","assetNumber","disable","renderIcon","alt","direction","AlertDialog","AlertDialogPortal","Portal","AlertDialogTrigger","React7","AlertDialogOverlay","Overlay","AlertDialogContent","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogAction","Action","AlertDialogCancel","Cancel","AspectRatioPrimitive","AspectRatio","PlayIcon","useAudio","useCallback","useImperativeHandle","useLayoutEffect","useRef","isMobile","useState","useEffect","useWindowWidth","windowWidth","setWindowWidth","handleResize","innerWidth","addEventListener","removeEventListener","useDevice","device","setDevice","isWeixin","setIsWeixin","toLowerCase","indexOf","phone","tablet","isIos","apple","ipod","useIsMobileByWindowWidth","audioAPI","getAudioAPI","AudioContext","webkitAudioContext","context","gainNode","createGain","gain","currentSourceNode","buffer","createBuffer","source","createBufferSource","connect","destination","start","once","play","arrayBuffer","decodeAudioData","slice","audioBuffer","state","stop","resume","pause","suspend","IosAudioPlayer","audioRef","audioApi","loadTask","current","handlePlay","paused","Promise","reject","currentTime","resolve","handleLoad","fetch","then","response","catch","console","log","load","type","listener","options","duration","muted","useMedia","TooltipPrimitive","PopoverPrimitive","PopoverRoot","PopoverTrigger","PopoverAnchor","Anchor","PopoverContent","React8","align","side","sideOffset","alignOffset","arrowPadding","showArrow","container","forceMount","Arrow","Popover","open","title","content","anchor","hasOpenState","isMTooltip","modal","openChangeCallback","onOpenChange","onClick","e","preventDefault","stopPropagation","onCloseAutoFocus","TooltipProvider","Provider","TooltipTrigger","TooltipArrow","Tooltip","React9","defaultOpen","description","titleDangerous","descriptionDangerous","contentClassName","isDesktop","defaultTitleColor","defaultDescColor","TooltipContent","arrowClassName","iconButtonVariants","iconSizeVariants","IconButton","React10","IconEle","hoverText","hoverSide","iconCls","isValidElement","cloneElement","Lottie","ReactDOM","NODES","Primitive","reduce","primitive","node","Node","React11","forwardedRef","primitiveProps","Symbol","for","avatarVariants","AvatarRoot","React12","AvatarImage","onLoad","onError","loadingStatus","setLoadingStatus","event","handleError","img","Avatar","rootStyle","border","defaultSrc","style","badgeVariants","status","unRead","cardUnRead","public","private","hidden","new","Badge","unReadCount","Check","ChevronDown","useToggle","DropdownMenuPrimitive","ChevronRight","Circle","DropdownMenu","DropdownMenuTrigger","DropdownMenuGroup","Group","DropdownMenuPortal","DropdownMenuSub","Sub","DropdownMenuRadioGroup","RadioGroup","DropdownMenuSubTrigger","React13","inset","SubTrigger","DropdownMenuSubContent","SubContent","DropdownMenuContent","DropdownMenuItem","DropdownMenuCheckboxItem","checked","CheckboxItem","ItemIndicator","DropdownMenuRadioItem","RadioItem","DropdownMenuLabel","Label","DropdownMenuSeparator","DropdownMenuShortcut","CheckboxPrimitive","CheckIcon","CheckIconBrand","checkboxVariants","checkbox","circle","radio","Checkbox","React14","labelClassName","caption","captionClassName","Component","Indicator","Command","CommandPrimitive","Search","DialogPrimitive","X","Dialog","DialogPortal","DialogClose","Close","DialogTrigger","React15","DialogOverlay","DialogContent","hideClose","maskClosable","overlayClose","onClose","overlayClassName","DialogHeader","DialogFooter","DialogTitle","DialogDescription","React16","CommandDialog","CommandInput","Input","CommandList","List","CommandEmpty","Empty","CommandGroup","CommandSeparator","CommandItem","CommandShortcut","ContextMenuPrimitive","ContextMenu","ContextMenuTrigger","ContextMenuGroup","ContextMenuPortal","ContextMenuSub","ContextMenuRadioGroup","ContextMenuSubTrigger","React17","ContextMenuSubContent","ContextMenuContent","ContextMenuItem","ContextMenuCheckboxItem","ContextMenuRadioItem","ContextMenuLabel","ContextMenuSeparator","ContextMenuShortcut","dayjs","utc","useMemo","extend","Drawer","DrawerPrimitive","shouldScaleBackground","DrawerTrigger","DrawerPortal","DrawerClose","DrawerOverlay","React18","DrawerContent","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription","Controller","FormProvider","useFormContext","LabelPrimitive","labelVariants","React19","Form","FormFieldContext","React20","createContext","FormField","name","useFormField","fieldContext","useContext","itemContext","FormItemContext","getFieldState","formState","fieldState","Error","id","formItemId","formDescriptionId","formMessageId","formLayoutVariants","layout","Vertical","Horizontal","FormItem","useId","cls","FormLabel","required","htmlFor","FormControl","FormDescription","FormMessage","body","message","driver","Guide","steps","showProgress","showOverlay","hasSkip","hasCloseBtn","hasPrevBtn","hasNextBtn","allowClose","skipText","prevBtnText","nextBtnText","doneBtnText","onComplete","onSkip","driverRef","buttons","push","overlayOpacity","animate","showButtons","length","progressText","onDestroyed","onPopoverRender","popover","config","closeBtn","closeButton","display","innerHTML","onclick","destroy","wrapper","arrow","footer","footerButtons","skipBtn","document","createElement","innerText","insertBefore","firstChild","previousButton","nextButton","progress","drive","React21","autoComplete","isFull","outline","background","shadow","readOnly","inputVariants","LinkComponent","useNativeBridge","callNative","action","data","messageHandlers","reactNative","postMessage","ReactNativeWebView","JSON","stringify","getIosUrl","path","nativeGoBack","Link","href","scroll","replace","prefetch","back","pathname","externalLink","formatPath","isMobPath","rel","target","link_default","Children","MenubarPrimitive","MenubarMenu","Menu","MenubarGroup","MenubarPortal","MenubarSub","MenubarRadioGroup","Menubar","React23","MenubarTrigger","MenubarSubTrigger","MenubarSubContent","MenubarContent","MenubarItem","MenubarCheckboxItem","MenubarRadioItem","MenubarLabel","MenubarSeparator","MenubarShortcut","displayname","CheckCircleIcon","ExclamationTriangleIcon","InformationCircleIcon","XCircleIcon","XMarkIcon","setRef","composeRefs","refs","hasCleanup","cleanups","map","cleanup","i","useComposedRefs","React24","useCallbackRef","callback","callbackRef","React25","args","AUTOFOCUS_ON_MOUNT","AUTOFOCUS_ON_UNMOUNT","EVENT_OPTIONS","bubbles","cancelable","FOCUS_SCOPE_NAME","FocusScope","React26","loop","trapped","onMountAutoFocus","onMountAutoFocusProp","onUnmountAutoFocus","onUnmountAutoFocusProp","scopeProps","setContainer","lastFocusedElementRef","composedRefs","focusScope","handleFocusIn","contains","focus","select","handleFocusOut","relatedTarget","handleMutations","mutations","focusedElement","activeElement","mutation","removedNodes","mutationObserver","MutationObserver","observe","childList","subtree","disconnect","focusScopesStack","add","previouslyFocusedElement","hasFocusedCandidate","mountEvent","CustomEvent","dispatchEvent","defaultPrevented","focusFirst","removeLinks","getTabbableCandidates","setTimeout","unmountEvent","remove","handleKeyDown","isTabKey","key","altKey","ctrlKey","metaKey","currentTarget","getTabbableEdges","first","last","hasTabbableElementsInside","shiftKey","div","tabIndex","onKeyDown","candidates","candidate","findVisible","reverse","nodes","walker","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","isHiddenInput","tagName","FILTER_SKIP","FILTER_ACCEPT","nextNode","currentNode","elements","element","isHidden","upTo","getComputedStyle","visibility","parentElement","isSelectableInput","HTMLInputElement","preventScroll","createFocusScopesStack","stack","activeFocusScope","arrayRemove","unshift","array","item","updatedArray","index","splice","items","filter","ModalOverlay","React27","DialogPrimitive2","ModalContent","ModalRoot","ModalTitle","modalVariants","zIndex","Modal","modalOnly","closeClassName","fullScreen","focusScopeOptions","isLogin","isNotification","isHorizontal","showCancel","confirmLoading","cancelText","confirmText","onConfirm","drawerContent","onOpenAutoFocus","ModalHeader","repositionInputs","getBackgroundColor","dialogContent","ModalFooter","ModalBody","MagnifyingGlassIcon","searchBarVariants","SearchBar","inputClassName","searchValue","roundedFill","onSearchChange","onValueChange","React28","setValue","onChange","blur","ProgressPrimitive","Progress","indicatorClassName","minWidth","maxWidth","widthValue","toString","EnergyProgress","energy","dailyEnergy","floor","energy_progress_default","NavigationBar","showSearchBar","searchPlaceholder","EXP_LIMIT","MAX_DIGITS","NUMERALS","LN10","PI","DEFAULTS","precision","rounding","modulo","toExpNeg","toExpPos","minE","maxE","crypto","inexact","quadrant","external","decimalError","invalidArgument","precisionLimitExceeded","cryptoUnavailable","tag","mathfloor","mathpow","pow","isBinary","isHex","isOctal","isDecimal","BASE","LOG_BASE","MAX_SAFE_INTEGER","LN10_PRECISION","PI_PRECISION","P","toStringTag","absoluteValue","abs","x","constructor","s","finalise","ceil","clampedTo","k","Ctor","NaN","gt","cmp","comparedTo","y","j","xdL","ydL","xd","yd","ys","cosine","cos","pr","rm","sd","toLessThanHalfPi","neg","cubeRoot","cbrt","m","n","r","rep","t","t3","t3plusx","isFinite","isZero","digitsToString","toExponential","times","plus","divide","eq","charAt","decimalPlaces","dp","w","dividedBy","dividedToIntegerBy","divToInt","equals","greaterThan","greaterThanOrEqualTo","gte","hyperbolicCosine","cosh","len","one","tinyPow","taylorSeries","cosh2_x","d8","minus","hyperbolicSine","sinh","sqrt","sinh2_x","d5","d16","d20","hyperbolicTangent","tanh","inverseCosine","acos","isNeg","getPi","atan","inverseHyperbolicCosine","acosh","lte","ln","inverseHyperbolicSine","asinh","inverseHyperbolicTangent","atanh","wpr","xsd","inverseSine","asin","halfPi","inverseTangent","px","x2","isInteger","isInt","isNaN","isNegative","isPositive","isPos","lessThan","lt","lessThanOrEqualTo","logarithm","isBase10","denominator","inf","num","arg","guard","naturalLogarithm","getLn10","checkRoundingDigits","sub","xe","xLTy","pop","shift","getBase10Exponent","mod","q","naturalExponential","exp","negated","carry","z","getPrecision","round","sine","sin","squareRoot","tangent","tan","mul","rL","toBinary","toStringBinary","toDecimalPlaces","toDP","checkInt32","finiteToString","toFixed","toFraction","maxD","d0","d1","d2","n0","n1","toHexadecimal","toHex","toNearest","toNumber","toOctal","toPower","yn","intPow","toPrecision","toSignificantDigits","toSD","truncated","trunc","valueOf","toJSON","ws","indexOfLastWord","getZeroString","repeating","di","rd","convertBase","baseIn","baseOut","arr","arrL","strL","cos2x","multiplyInteger","temp","compare","a","b","aL","bL","subtract","logBase","more","prod","prodL","qd","rem","remL","rem0","xi","xL","yd0","yL","yz","sign","isTruncated","digits","roundUp","xdi","out","isExp","nonFiniteToString","zs","truncate","isOdd","maxOrMin","sum","c","c0","numerator","x1","parseDecimal","search","substring","charCodeAt","parseOther","divisor","isFloat","Decimal","sin2_x","isHyperbolic","u","pi","atan2","obj","v","useDefaults","defaults","ps","getRandomValues","randomBytes","clone","isDecimalInstance","prototype","ROUND_UP","ROUND_DOWN","ROUND_CEIL","ROUND_FLOOR","ROUND_HALF_UP","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_HALF_CEIL","ROUND_HALF_FLOOR","EUCLID","set","hypot","log10","log2","random","hasOwnProperty","arguments","Uint32Array","copy","NumberInput","controls","inputRef","step","hideControls","updateValue","operation","inputElement","decimalValue","decimalStep","newValue","Number","onBlur","handleIncrement","handleDecrement","RadioGroupPrimitive","React30","RadioGroupItem","ScrollAreaPrimitive","ScrollArea","React31","Viewport","ScrollBar","Corner","ScrollAreaScrollbar","ScrollAreaThumb","ArrowLeftIcon","FilterIcon","fillRule","clipRule","FilterIcon_default","SecondaryNavigationBar","backUrl","showClear","clearText","icons","actions","hasBackground","avatar","onClear","navbarRef","showBackground","setShowBackground","handleScroll","getBoundingClientRect","scrollY","currentClearText","logo","SelectPrimitive","ChevronUp","Select","React32","find","Array","isArray","SelectTrigger","SelectIcon","SelectValue","SelectContent","SelectItem","SelectGroup","Value","SelectScrollUpButton","ScrollUpButton","SelectScrollDownButton","ScrollDownButton","position","SelectLabel","backgroundImage","ItemText","SelectSeparator","SheetPrimitive","Sheet","SheetTrigger","SheetClose","SheetPortal","SheetOverlay","React33","sheetVariants","top","bottom","left","right","SheetContent","SheetHeader","SheetFooter","SheetTitle","SheetDescription","Skeleton","SliderPrimitive","Slider","React34","Track","Range","Thumb","SliderSingle","containerClassName","trackClassName","rangeClassName","thumbClassName","onValueCommit","settable","rootValue","spinnerVariants","speed","slow","fast","Spinner","SwitchPrimitives","switchSize","switchRootVariants","switchThumbVariants","Switch","React35","TabsPrimitive","tabListVariants","button","tabVariants","Tabs","React36","listClassName","isLink","Tab","TabsContent","tooltip","hasUnRead","onClickCallback","Textarea","React37","maxLength","maxLengthClassName","TogglePrimitive","toggleVariants","Toggle","React38","ToggleGroupPrimitive","ToggleGroupContext","React39","ToggleGroup","ToggleGroupItem","ToastPrimitives","ToastProvider","viewportPositionVariants","ToastViewport","React40","toastVariants","Toast","ToastAction","ToastClose","ToastTitle","ToastDescription","ExclamationCircleIcon","TOAST_LIMIT","TOAST_REMOVE_DELAY","genId","toastTimeouts","Map","addToRemoveQueue","toastId","has","timeout","delete","dispatch","reducer","toasts","toast","forEach","listeners","memoryState","update","dismiss","dismissText","view","viewUrl","useToast","React41","setState","Toaster","positionGroups","groups","allPositions","pos","toastPosition","renderToast","Object","entries","toastsForPosition","useRouter","Autoplay","Navigation","FreeMode","Scrollbar","Mousewheel","Grid","Swiper","SwiperComponent","SwiperSlide","index_module_default","swiperVariants","componentClassName","slideClassName","delay","slidesPerView","dataList","swiperType","from","autoplay","spaceBetween","centeredSlides","gridRows","isBanner","isFeatured","isGrid","router","swiperList","newList","autoPlayOptions","swiperRef","fgconfigs","slidesPerGroup","breakpoints","banner","featured","grid","swiperConfigs","initialSlide","navigation","freeMode","scrollbar","mousewheel","forceToAxis","rows","modules","setAnimate","handleSlideItemClick","gotoUrl","swiper","realIndex","hasParam","includes","fromParam","rect","screenWidth","slidePrev","slideNext","swiperBox","observer","observeParents","onInit","isLine","CustomNotification","tProps","customProps","isClosable","displayedContent","useNotification","addToast","custom","close","Message","_toast","Image2","Label3","RadioGroup4"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,+BAA+B;ACA/B,YAAYA,wBAAwB,4BAAA;AACpC,YAAYC,YAAW,QAAA;ADGvB,mBAAmB;AENnB,SAA0BC,IAAA,QAAY,OAAA;AACtC,SAASC,OAAA,QAAe,iBAAA;AAIjB,SAASC;IAAA,IAAA,IAAA,OAAA,UAAA,QAAA,AAAMC,SAAN,UAAA,OAAA,OAAA,GAAA,OAAA,MAAA;QAAMA,OAAN,QAAA,SAAA,CAAA,KAAM;;IACpB,OAAOF,QAAQD,KAAKG;AACtB;AFMA,0BAA0B;AGb1B,SAASC,GAAA,QAA8B,2BAAA;AACvC,YAAYL,WAAW,QAAA;AA2EnB,SAAAM,GAAA,QAAA,oBAAA;AAvEJ,IAAMC,eAAeF,IAAI,wBAAwB;IAC/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,EACX1oC,SAAS,EACTypC,KAAK,EACLE,UAAU,EACVS,YAAY,EACZI,gBAAgB,EAChBF,WAAW,EACXD,WAAW,EACXR,YAAY,EACZD,WAAW,EACXW,UAAU,EACVb,YAAY,EACZe,QAAQ,EACRE,MAAM,EACNK,YAAY,EACZrnC,UAAU,EACVC,QAAQ,EACRutC,MAAM,EACNlF,MAAM,EACNU,GAAG,EACHJ,IAAI,EACJK,WAAW,EACX/oC,IAAI,EACJmpC,QAAQ,EACRtpC,KAAK,EACLyqC,KAAK,EACLC,WAAW,EACXC,UAAU,EACVE,gBAAgB,EAChBT,aAAa,EACbQ,UAAU,EACVN,aAAa,EACbkC,OAAO,EACP5C,MAAM,EACNK,WAAW,EACXC,eAAe,EACfr6B,OAAO,EACPJ,eAAe,EACfvJ,cAAc,EACd9G,YAAY,EACZqR,kBAAkB,EAClBi7B,OAAO,EACPE,KAAK,EACLjC,cAAc,EACdngC,SAAS,EACTiS,YAAY,EACZrR,wBAAwB,EACxB0W,eAAe,EACfwwB,eAAe,EACfjF,QAAQ,EACRpjC,cAAc,GACd,CACF;;;;;;;;;;AAUA","sourcesContent":["'use client';\n\n// src/components/accordion.tsx\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport * as React4 from \"react\";\n\n// src/lib/utils.ts\nimport { clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\nfunction cn(...inputs) {\n return twMerge(clsx(inputs));\n}\n\n// src/components/icon.tsx\nimport { cva } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar iconVariants = cva(\"inline-flex shrink-0\", {\n variants: {\n /**\n *\n * 可用尺寸:\n * - 2xs: 12px\n * - xs: 14px\n * - sm: 16px\n * - md: 18px\n * - lg: 20px\n * - xl: 22px\n * - 2xl: 24px\n * - 3xl: 28px\n * - 4xl: 32px\n * - 5xl: 36px\n * - 6xl: 40px\n * - 7xl: 44px\n * - 8xl: 48px\n */\n size: {\n \"2xs\": \"w-3 h-3\",\n // 12\n xs: \"w-3.5 h-3.5\",\n // 14\n sm: \"w-4 h-4\",\n // 16\n md: \"w-[18px] h-[18px]\",\n // 18\n lg: \"w-5 h-5\",\n // 20\n xl: \"w-[22px] h-[22px]\",\n // 22\n \"2xl\": \"w-6 h-6\",\n // 24\n \"3xl\": \"w-7 h-7\",\n // 28\n \"4xl\": \"w-8 h-8\",\n // 32\n \"5xl\": \"w-9 h-9\",\n // 36\n \"6xl\": \"w-10 h-10\",\n // 40\n \"7xl\": \"w-11 h-11\",\n // 44\n \"8xl\": \"w-12 h-12\"\n // 48\n },\n color: {\n default: \"text-Colors-Foreground-Default\",\n subtle: \"text-Colors-Foreground-Subtle\",\n subtler: \"text-Colors-Foreground-Subtler\",\n subtlest: \"text-Colors-Foreground-Subtlest\",\n disabled: \"text-Colors-Foreground-Disabled\",\n bolder: \"text-Colors-Foreground-Bolder\",\n inverse: \"text-Colors-Foreground-Static-White\"\n },\n rotate: {\n \"45\": \"rotate-45\",\n \"90\": \"rotate-90\",\n \"-45\": \"-rotate-45\",\n \"-90\": \"-rotate-90\",\n \"180\": \"rotate-180\"\n }\n },\n defaultVariants: {\n size: \"sm\",\n color: \"default\"\n }\n});\nvar Icon = React.forwardRef((props, ref) => {\n const { children, component, size, color, rotate, className, ...passProps } = props;\n const Com = component || \"span\";\n return /* @__PURE__ */ jsx(\n Com,\n {\n ref,\n ...passProps,\n className: cn(iconVariants({ size, color, rotate }), className),\n children\n }\n );\n});\nIcon.displayName = \"Icon\";\n\n// src/components/separator.tsx\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\";\nimport * as React2 from \"react\";\nimport { jsx as jsx2 } from \"react/jsx-runtime\";\nvar Separator = React2.forwardRef(\n ({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx2(\n SeparatorPrimitive.Root,\n {\n ref,\n decorative,\n orientation,\n className: cn(\n \"shrink-0 border-Colors-Alpha-Black-8\",\n orientation === \"horizontal\" ? \"w-full border-b\" : \"h-full border-r\",\n className\n ),\n ...props\n }\n )\n);\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\n// src/components/typography.tsx\nimport { cva as cva2 } from \"class-variance-authority\";\nimport { sanitize } from \"isomorphic-dompurify\";\nimport * as React3 from \"react\";\nimport { jsx as jsx3 } from \"react/jsx-runtime\";\nvar colorMap = {\n default: \"text-Colors-Text-Default\",\n subtle: \"text-Colors-Text-Subtle\",\n subtler: \"text-Colors-Text-Subtler\",\n subtlest: \"text-Colors-Text-Subtlest\",\n disabled: \"text-Colors-Text-Disabled\",\n inverse: \"text-Colors-Text-Bolder\",\n static: \"text-Colors-Text-Static-White\",\n \"static-black\": \"text-Colors-Text-Static-White\",\n brand: \"text-Colors-Text-Brand-Default\",\n critical: \"text-Colors-Text-Critical-Default\",\n \"critical-bolder\": \"text-Colors-Text-Critical-Bolder\",\n warning: \"text-Colors-Text-Warning-Default\",\n \"warning-bolder\": \"text-Colors-Text-Warning-Bolder\",\n success: \"text-Colors-Text-Success-Default\",\n \"success-bolder\": \"text-Colors-Text-Success-Bolder\"\n};\nvar lineClampMap = {\n 1: \"line-clamp-1\",\n 2: \"line-clamp-2\",\n 3: \"line-clamp-3\",\n 4: \"line-clamp-4\",\n 5: \"line-clamp-5\",\n 6: \"line-clamp-6\"\n};\nvar displayVariants = cva2(\"font-semibold\", {\n variants: {\n size: {\n \"2xl\": \"text-7xl\",\n xl: \"text-5xl\",\n lg: \"text-3xl\",\n md: \"text-2xl\",\n sm: \"text-xl\",\n xs: \"text-lg\"\n },\n color: colorMap,\n lineClamp: lineClampMap\n },\n defaultVariants: {\n size: \"lg\",\n color: \"default\"\n }\n});\nvar headingVariants = cva2(\"font-medium\", {\n variants: {\n size: {\n h1: \"text-2xl\",\n h2: \"text-xl\",\n h3: \"text-lg\",\n h4: \"text-base\",\n h5: \"text-sm\"\n },\n color: colorMap,\n lineClamp: lineClampMap\n },\n defaultVariants: {\n size: \"h1\",\n color: \"default\"\n }\n});\nvar subHeadingVariants = cva2(\"text-Colors-Text-Default\", {\n variants: {\n size: {\n sm: \"text-xs\",\n lg: \"text-sm\"\n },\n color: colorMap,\n lineClamp: lineClampMap\n },\n defaultVariants: {\n size: \"lg\",\n color: \"default\"\n }\n});\nvar textVariants = cva2(\"\", {\n variants: {\n size: {\n xs: \"text-xs\",\n sm: \"text-sm\",\n lg: \"text-base\"\n },\n weight: {\n regular: \"font-normal\",\n medium: \"font-medium\",\n semibold: \"font-semibold\"\n },\n color: colorMap,\n lineClamp: lineClampMap\n },\n defaultVariants: {\n size: \"lg\",\n weight: \"regular\",\n color: \"default\"\n }\n});\nvar descriptionVariants = cva2(\"\", {\n variants: {\n size: {\n lg: \"text-xs\",\n sm: \"text-2xs\"\n },\n weight: {\n regular: \"font-normal\",\n medium: \"font-medium\"\n },\n color: colorMap,\n lineClamp: lineClampMap\n },\n defaultVariants: {\n size: \"lg\",\n weight: \"regular\",\n color: \"subtler\"\n }\n});\nvar HComponentMap = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n h6: \"h6\"\n};\nvar TextComponentMap = {\n p: \"p\",\n blockquote: \"blockquote\",\n span: \"span\",\n code: \"code\",\n bold: \"b\",\n italic: \"i\",\n strikethrough: \"s\",\n underline: \"u\"\n};\nvar renderBlock = ({\n underline = false,\n strikethrough = false,\n strong = false,\n italic = false\n}, defaultValue = \"p\") => {\n const underlineValue = underline && \"underline\";\n const strikethroughValue = strikethrough && \"strikethrough\";\n const strongValue = strong && \"bold\";\n const italicValue = italic && \"italic\";\n return TextComponentMap[underlineValue || strikethroughValue || strongValue || italicValue || defaultValue];\n};\nvar dangerouText = (text) => {\n return sanitize(`${text}`, {\n ADD_ATTR: [\"target\"],\n FORBID_TAGS: [\n \"style\",\n \"form\",\n \"input\",\n \"checkbox\",\n \"svg\",\n \"script\",\n \"iframe\",\n \"object\",\n \"embed\",\n \"applet\",\n \"meta\",\n \"link\",\n \"button\",\n \"textarea\",\n \"select\",\n \"option\",\n \"img\"\n ],\n FORBID_ATTR: [\"action\", \"style\", \"data-*\", \"aria-*\", \"srcset\", \"on*\"]\n });\n};\nvar Heading = React3.forwardRef((props, ref) => {\n const {\n className,\n size,\n color,\n lineClamp,\n children,\n dangerous,\n ...passProps\n } = props;\n const Comp = HComponentMap[size || \"h1\"];\n const text = dangerous && dangerouText(`${children}`);\n return /* @__PURE__ */ jsx3(\n Comp,\n {\n ref,\n className: cn(headingVariants({ size, color, lineClamp }), className),\n ...passProps,\n ...dangerous && { dangerouslySetInnerHTML: { __html: `${text}` } },\n children: !dangerous ? children : null\n }\n );\n});\nvar Display = React3.forwardRef((props, ref) => {\n const {\n className,\n size,\n color,\n lineClamp,\n underline,\n strikethrough,\n strong,\n italic,\n children,\n dangerous,\n ...passProps\n } = props;\n const Comp = renderBlock(\n {\n underline,\n strikethrough,\n strong,\n italic\n },\n \"span\"\n );\n const text = dangerous && dangerouText(`${children}`);\n return /* @__PURE__ */ jsx3(\n Comp,\n {\n ref,\n className: cn(displayVariants({ size, color, lineClamp }), className),\n ...passProps,\n ...dangerous && { dangerouslySetInnerHTML: { __html: `${text}` } },\n children: !dangerous ? children : null\n }\n );\n});\nvar Title = Heading;\nvar SubHeading = React3.forwardRef((props, ref) => {\n const { className, size, color, children, lineClamp, ...passProps } = props;\n return /* @__PURE__ */ jsx3(\n \"p\",\n {\n ref,\n className: cn(subHeadingVariants({ size, color, lineClamp }), className),\n ...passProps,\n children\n }\n );\n});\nvar SubTitle = SubHeading;\nvar Text = React3.forwardRef((props, ref) => {\n const {\n className,\n size,\n weight,\n color,\n lineClamp,\n underline,\n strikethrough,\n strong,\n italic,\n children,\n dangerous,\n ...passProps\n } = props;\n const Comp = renderBlock(\n {\n underline,\n strikethrough,\n strong,\n italic\n },\n \"span\"\n );\n const text = dangerous && dangerouText(`${children}`);\n return /* @__PURE__ */ jsx3(\n Comp,\n {\n ref,\n className: cn(\n textVariants({ size, weight, color, lineClamp }),\n className\n ),\n ...passProps,\n ...dangerous && { dangerouslySetInnerHTML: { __html: `${text}` } },\n children: !dangerous ? children : null\n }\n );\n});\nvar Paragraph = React3.forwardRef((props, ref) => {\n const {\n className,\n size,\n weight,\n color,\n lineClamp,\n underline,\n strikethrough,\n strong,\n italic,\n children,\n dangerous,\n ...passProps\n } = props;\n const Comp = renderBlock(\n {\n underline,\n strikethrough,\n strong,\n italic\n },\n \"p\"\n );\n const text = dangerous && dangerouText(`${children}`);\n return /* @__PURE__ */ jsx3(\n Comp,\n {\n ref,\n className: cn(\n textVariants({ size, weight, color, lineClamp }),\n className\n ),\n ...passProps,\n ...dangerous && { dangerouslySetInnerHTML: { __html: `${text}` } },\n children: !dangerous ? children : null\n }\n );\n});\nvar Description = React3.forwardRef((props, ref) => {\n const {\n className,\n size,\n weight,\n color,\n lineClamp,\n underline,\n strikethrough,\n strong,\n italic,\n children,\n dangerous,\n ...passProps\n } = props;\n const Comp = renderBlock(\n {\n underline,\n strikethrough,\n strong,\n italic\n },\n \"span\"\n );\n const text = dangerous && dangerouText(`${children}`);\n return /* @__PURE__ */ jsx3(\n Comp,\n {\n ref,\n className: cn(\n descriptionVariants({ size, weight, color, lineClamp }),\n className\n ),\n ...passProps,\n ...dangerous && { dangerouslySetInnerHTML: { __html: `${text}` } },\n children: !dangerous ? children : null\n }\n );\n});\n\n// src/components/icons/outline/DownIcon.tsx\nimport { jsx as jsx4 } from \"react/jsx-runtime\";\nfunction DownIcon({ className }) {\n return /* @__PURE__ */ jsx4(\n \"svg\",\n {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"12\",\n height: \"12\",\n viewBox: \"0 0 12 12\",\n fill: \"none\",\n className: cn(\"transition-all\", className),\n children: /* @__PURE__ */ jsx4(\"path\", { d: \"M6.75593 8.8908C6.35716 9.35126 5.64284 9.35126 5.24407 8.8908L1.3708 4.41832C0.80992 3.77068 1.26997 2.76367 2.12673 2.76367L9.87328 2.76367C10.73 2.76367 11.1901 3.77068 10.6292 4.41833L6.75593 8.8908Z\" })\n }\n );\n}\nvar DownIcon_default = DownIcon;\n\n// src/components/accordion.tsx\nimport { jsx as jsx5, jsxs } from \"react/jsx-runtime\";\nvar Accordion = AccordionPrimitive.Root;\nvar AccordionItem = React4.forwardRef((props, ref) => {\n const { className, triggerClassName, sticky, children, label, count: count2 } = props;\n return /* @__PURE__ */ jsxs(\n AccordionPrimitive.Item,\n {\n ref,\n className: cn(\"w-full\", className),\n ...props,\n children: [\n /* @__PURE__ */ jsx5(\n AccordionTrigger,\n {\n label,\n count: count2,\n className: triggerClassName,\n sticky\n }\n ),\n /* @__PURE__ */ jsx5(AccordionContent, { children })\n ]\n }\n );\n});\nAccordionItem.displayName = \"AccordionItem\";\nvar AccordionTrigger = React4.forwardRef((props, ref) => {\n const {\n className,\n headerClassName = \"\",\n count: count2,\n label,\n sticky,\n ...rest\n } = props;\n return /* @__PURE__ */ jsx5(\n AccordionPrimitive.Header,\n {\n className: cn(\"flex\", headerClassName, sticky && \"sticky top-0 z-10\"),\n children: /* @__PURE__ */ jsx5(\n AccordionPrimitive.Trigger,\n {\n ref,\n ...rest,\n className: cn(\n \"flex flex-1 items-center justify-between font-medium transition-all [&[data-state=closed]>div>div>div>svg]:-rotate-90\",\n // [&[data-state=open]>div>div>svg]:rotate-180\n className\n ),\n children: /* @__PURE__ */ jsxs(\"div\", { className: \"w-full flex flex-col justify-center\", children: [\n /* @__PURE__ */ jsx5(\"div\", { className: \"py-3\", children: /* @__PURE__ */ jsx5(Separator, {}) }),\n /* @__PURE__ */ jsxs(\"div\", { className: \"w-full flex justify-between items-center py-1.5\", children: [\n /* @__PURE__ */ jsxs(\"div\", { className: \"flex justify-center items-center space-x-1\", children: [\n /* @__PURE__ */ jsx5(\n Icon,\n {\n component: DownIcon_default,\n size: \"2xs\",\n className: \"fill-Colors-Foreground-Subtlest\"\n }\n ),\n /* @__PURE__ */ jsx5(Text, { size: \"lg\", weight: \"medium\", className: \"truncate text-left\", children: label })\n ] }),\n count2 ? /* @__PURE__ */ jsx5(Text, { size: \"sm\", color: \"subtlest\", className: \"flex-shrink-0\", children: count2 }) : null\n ] })\n ] })\n }\n )\n }\n );\n});\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\nvar AccordionContent = React4.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx5(\n AccordionPrimitive.Content,\n {\n ref,\n ...props,\n className: \"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\",\n children: /* @__PURE__ */ jsx5(\"div\", { className: cn(className), children })\n }\n));\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\n// src/components/alert.tsx\nimport { cva as cva3 } from \"class-variance-authority\";\nimport * as React5 from \"react\";\nimport { jsx as jsx6 } from \"react/jsx-runtime\";\nvar alertVariants = cva3(\n \"relative rounded-xl border flex justify-center flex-col md:flex-row md:justify-between items-center gap-3 py-2 px-3 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-Colors-Text-Default\",\n {\n variants: {\n variant: {\n default: \"bg-Colors-Background-Normal-Primary-Default text-Colors-Text-Default\",\n destructive: \"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive\",\n warning: \"bg-surface-accent-yellow-subtlest border-surface-accent-yellow-subtle text-Colors-Text-Default\",\n info: \"bg-surface-accent-blue-subtlest border-surface-accent-blue-subtle text-Colors-Text-Default\",\n error: \"bg-surface-accent-red-subtlest border-surface-accent-red-subtle text-Colors-Text-Default\"\n }\n },\n defaultVariants: {\n variant: \"default\"\n }\n }\n);\nvar Alert = React5.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx6(\n \"div\",\n {\n ref,\n role: \"alert\",\n className: cn(alertVariants({ variant }), className),\n ...props\n }\n));\nAlert.displayName = \"Alert\";\nvar AlertTitle = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(\n \"h5\",\n {\n ref,\n className: cn(\"mb-1 font-medium leading-none tracking-tight\", className),\n ...props\n }\n));\nAlertTitle.displayName = \"AlertTitle\";\nvar AlertDescription = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(\n \"div\",\n {\n ref,\n className: cn(\"text-base [&_p]:leading-relaxed\", className),\n ...props\n }\n));\nAlertDescription.displayName = \"AlertDescription\";\n\n// src/components/alert-dialog.tsx\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport * as React7 from \"react\";\n\n// src/components/button/button.tsx\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { Loader2 } from \"lucide-react\";\nimport * as React6 from \"react\";\n\n// src/common/utils/common-helper.ts\nvar CDN_URL = \"https://www.myshellstatic.com/\";\nfunction getAssetsUrl(url) {\n if (!isString(url) || !(url || \"\").trim()) {\n return url;\n }\n if (url.startsWith(\"http\")) {\n return url;\n }\n return `${CDN_URL}${url}`;\n}\nfunction clamp(value, min3, max2) {\n return Math.min(Math.max(value, min3), max2);\n}\nfunction isClient() {\n return typeof window !== \"undefined\";\n}\nfunction isIosApp() {\n return isClient() && typeof navigator !== \"undefined\" && /iPhone|iPad|iPod/i.test(navigator.userAgent) && !!window.webkit;\n}\nfunction isString(str) {\n return typeof str === \"string\" || str instanceof String;\n}\n\n// src/components/image.tsx\nimport { cva as cva4 } from \"class-variance-authority\";\nimport RCImage from \"rc-image\";\nimport { jsx as jsx7 } from \"react/jsx-runtime\";\nvar imageVariants = cva4(\"\", {\n variants: {\n rounded: {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n default: \"rounded\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n xl: \"rounded-xl\",\n \"2xl\": \"rounded-2xl\",\n \"3xl\": \"rounded-3xl\",\n full: \"rounded-full\"\n },\n object: {\n contain: \"object-contain\",\n cover: \"object-cover\",\n fill: \"object-fill\",\n none: \"object-none\"\n }\n },\n defaultVariants: {\n rounded: \"none\"\n }\n});\nfunction Image2({\n className,\n imgClassName,\n placeholder = true,\n width = \"100%\",\n height = \"100%\",\n src,\n rounded = \"none\",\n fallback = \"\",\n object = \"cover\",\n isBackgroud = false,\n preview = false,\n fetchPriority = \"auto\",\n loading = \"eager\",\n ...otherProps\n}) {\n return /* @__PURE__ */ jsx7(\n RCImage,\n {\n fetchPriority,\n placeholder,\n width,\n height,\n src,\n fallback: fallback || \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnY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EKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==\",\n preview,\n loading,\n rootClassName: cn(\n isBackgroud && \"absolute top-0 left-0 z-0 w-full h-full\",\n className\n ),\n className: cn(\n imageVariants({ rounded, object }),\n isBackgroud && \"object-cover\",\n imgClassName\n ),\n ...otherProps\n }\n );\n}\n\n// src/components/button/button.styles.ts\nimport { cva as cva5 } from \"class-variance-authority\";\nvar BASE_BUTTON = \"relative shrink-0 inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium transition-colors focus-visible:secondary-none focus-visible:shadow-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 disabled:pointer-events-none disabled:opacity-30 disabled:shadow-none [&>span>svg]:text-inherit [&>span>span>svg]:text-inherit\";\nvar SIZE_CLASSES = {\n lg: {\n base: \"h-11\",\n withPadding: \"h-11 min-w-11 px-6\",\n text: \"text-base\",\n iconSize: \"w-5 h-5\"\n },\n md: {\n base: \"h-9\",\n withPadding: \"h-9 min-w-9 px-4 text-sm\",\n text: \"text-sm\",\n iconSize: \"w-4.5 h-4.5\"\n },\n sm: {\n base: \"h-7\",\n withPadding: \"h-7 min-w-7 px-3 text-sm\",\n text: \"text-xs\",\n iconSize: \"w-4 h-4\"\n }\n};\nvar COLOR_THEMES = {\n default: {\n primary: \"bg-cc-Button-Primary-bg-default text-cc-Button-Primary-fg-default hover:bg-cc-Button-Primary-bg-hover active:bg-cc-Button-Primary-bg-active disabled:bg-cc-Button-Primary-bg-disabled\",\n secondary: \"border-cc-Button-Secondary-border-default text-cc-Button-Secondary-fg-default bg-cc-Button-Secondary-bg-default hover:bg-cc-Button-Secondary-bg-hover active:bg-cc-Button-Secondary-bg-active disabled:text-cc-Button-Secondary-fg-alt disabled:border-cc-Button-Secondary-border-disabled\",\n tertiary: \"border border-cc-Button-Tertiary-border-default text-cc-Button-Tertiary-fg-default bg-cc-Button-Tertiary-bg-default hover:bg-cc-Button-Tertiary-bg-hover hover:border-cc-Button-Tertiary-border-alt focus:shadow-button-tertiary-shadow active:bg-cc-Button-Tertiary-bg-active disabled:text-cc-Button-Tertiary-fg-alt \",\n link: \"rounded-none font-normal underline-offset-4 hover:underline active:underline text-cc-Link-Button-Primary-fg-default hover:text-cc-Link-Button-Primary-fg-hover active:text-cc-Link-Button-Primary-fg-active disabled:text-cc-Link-Button-Primary-fg-disabled\",\n plain: \"text-cc-Button-Plain-fg-default hover:bg-cc-Button-Plain-bg-hover focus:shadow-cc-Focus-Rings-Brand-default active:bg-cc-Button-Plain-bg-active disabled:text-cc-Button-Plain-fg-alt \"\n },\n brand: {\n primary: \"text-cc-Button-Brand-fg-default bg-cc-Button-Brand-bg-default hover:bg-cc-Button-Brand-bg-hover active:bg-cc-Button-Brand-bg-active disabled:bg-cc-Button-Brand-bg-disabled shadow-none hover:shadow-button-brand focus:shadow-cc-Focus-Rings-Brand-default\",\n plain: \"text-cc-Button-Plain-Brand-fg-default bg-cc-Button-Plain-Brand-bg-default hover:bg-cc-Button-Plain-Brand-bg-hover active:bg-cc-Button-Plain-Brand-bg-active disabled:text-cc-Button-Plain-Brand-fg-alt\"\n },\n error: {\n primary: \"text-cc-Button-Error-Primary-fg-default bg-cc-Button-Error-Primary-bg-default hover:bg-cc-Button-Error-Primary-bg-hover active:bg-cc-Button-Error-Primary-bg-active disabled:bg-cc-Button-Error-Primary-bg-disabled shadow-none\",\n secondary: \"border-cc-Button-Error-Secondary-border-default text-cc-Button-Error-Secondary-fg-default bg-cc-Button-Error-Secondary-bg-default hover:bg-cc-Button-Error-Secondary-bg-hover active:bg-cc-Button-Error-Secondary-bg-active disabled:text-cc-Button-Error-Secondary-fg-alt disabled:border-cc-Button-Error-Secondary-border-disabled\"\n },\n chat: {\n primary: \"shadow-none text-Colors-Text-Subtle bg-Colors-Background-Normal-Secondary-Default border border-Colors-Border-Default hover:bg-Colors-Background-Neutral-Primary-Hover active:bg-surface-accent-gray-subtler active:shadow-button-pressed disabled:bg-Colors-Background-Normal-Secondary-Default disabled:text-Colors-Text-Disabled disabled:opacity-100\"\n }\n};\nvar VARIANT_BASE = {\n primary: \"\",\n secondary: \"border shadow-none\",\n tertiary: \"\",\n static: \"text-cc-Button-Static-fg-default border-cc-Button-Static-border-default bg-cc-Button-Static-bg-default hover:bg-cc-Button-Static-bg-hover active:bg-cc-Button-Static-bg-active disabled:bg-cc-Button-Static-bg-disabled disabled:text-cc-Button-Static-fg-alt\",\n link: \"\",\n plain: \"\",\n opacity: \"text-Colors-Text-Static-White bg-Colors-Beta-White-30 border border-Colors-Beta-White-12 shadow-none hover:bg-Colors-Beta-White-40 focus:shadow-cc-Focus-Rings-Brand-default active:bg-Colors-Beta-White-50 disabled:bg-Colors-Beta-White-60 disabled:text-Colors-Beta-White-80\",\n solid: \"shadow-none text-Colors-Text-Subtle bg-cc-Button-Solid-bg-default border border-cc-Button-Solid-border-default hover:bg-cc-Button-Solid-bg-hover hover:border-cc-Button-Solid-border-alt active:bg-cc-Button-Solid-bg-active disabled:text-cc-Button-Solid-fg-alt\"\n};\nvar SPECIAL_LAYOUTS = {\n link: \"h-fit w-fit min-w-auto px-0.5 py-0.5\",\n plain: \"h-fit w-fit min-w-auto px-0.5 py-0.5\"\n};\nvar buttonVariants = cva5(BASE_BUTTON, {\n variants: {\n variant: VARIANT_BASE,\n color: {\n default: \"\",\n brand: \"\",\n error: \"\",\n gray: \"\",\n chat: \"\"\n },\n size: {\n lg: \"h-11\",\n md: \"h-9\",\n sm: \"h-7\"\n }\n },\n compoundVariants: [\n // 尺寸相关变体\n { variant: \"primary\", size: \"lg\", className: SIZE_CLASSES.lg.withPadding },\n { variant: \"primary\", size: \"md\", className: SIZE_CLASSES.md.withPadding },\n { variant: \"primary\", size: \"sm\", className: SIZE_CLASSES.sm.withPadding },\n {\n variant: \"secondary\",\n size: \"lg\",\n className: SIZE_CLASSES.lg.withPadding\n },\n {\n variant: \"secondary\",\n size: \"md\",\n className: SIZE_CLASSES.md.withPadding\n },\n {\n variant: \"secondary\",\n size: \"sm\",\n className: SIZE_CLASSES.sm.withPadding\n },\n { variant: \"tertiary\", size: \"lg\", className: SIZE_CLASSES.lg.withPadding },\n { variant: \"tertiary\", size: \"md\", className: SIZE_CLASSES.md.withPadding },\n { variant: \"tertiary\", size: \"sm\", className: SIZE_CLASSES.sm.withPadding },\n { variant: \"static\", size: \"lg\", className: SIZE_CLASSES.lg.withPadding },\n { variant: \"static\", size: \"md\", className: SIZE_CLASSES.md.withPadding },\n { variant: \"static\", size: \"sm\", className: SIZE_CLASSES.sm.withPadding },\n // 颜色主题变体\n {\n variant: \"primary\",\n color: \"default\",\n className: COLOR_THEMES.default.primary\n },\n {\n variant: \"primary\",\n color: \"brand\",\n className: COLOR_THEMES.brand.primary\n },\n {\n variant: \"primary\",\n color: \"error\",\n className: COLOR_THEMES.error.primary\n },\n { variant: \"primary\", color: \"chat\", className: COLOR_THEMES.chat.primary },\n {\n variant: \"tertiary\",\n color: \"default\",\n className: COLOR_THEMES.default.tertiary\n },\n {\n variant: \"secondary\",\n color: \"default\",\n className: COLOR_THEMES.default.secondary\n },\n {\n variant: \"secondary\",\n color: \"error\",\n className: COLOR_THEMES.error.secondary\n },\n // 特殊布局变体\n { variant: \"link\", className: SPECIAL_LAYOUTS.link },\n { variant: \"plain\", className: SPECIAL_LAYOUTS.plain },\n // Link变体的颜色\n { variant: \"link\", color: \"default\", className: COLOR_THEMES.default.link },\n // Plain变体的颜色\n {\n variant: \"plain\",\n color: \"default\",\n className: COLOR_THEMES.default.plain\n },\n { variant: \"plain\", color: \"brand\", className: COLOR_THEMES.brand.plain },\n // Link尺寸\n {\n variant: \"link\",\n size: \"lg\",\n className: \"h-fit w-fit px-0.5 py-0.5 text-base\"\n },\n {\n variant: \"link\",\n size: \"md\",\n className: \"h-fit w-fit px-0.5 py-0.5 text-sm\"\n },\n {\n variant: \"link\",\n size: \"sm\",\n className: \"h-fit w-fit px-0.5 py-0.5 text-xs\"\n },\n // Plain尺寸\n {\n variant: \"plain\",\n size: \"lg\",\n className: \"h-fit w-fit px-0.5 py-0.5 text-base\"\n },\n {\n variant: \"plain\",\n size: \"md\",\n className: \"h-fit w-fit px-0.5 py-0.5 text-sm\"\n },\n {\n variant: \"plain\",\n size: \"sm\",\n className: \"h-fit w-fit px-0.5 py-0.5 text-xs\"\n }\n ],\n defaultVariants: {\n variant: \"primary\",\n color: \"default\",\n size: \"lg\"\n }\n});\nvar iconVariants2 = cva5(\n \"relative shrink-0 text-inherit inline-flex items-center justify-center whitespace-nowrap transition-colors ring-offset-cc-Focus-Rings-Brand-default\",\n {\n variants: {\n variant: {\n primary: \"\",\n secondary: \"\",\n tertiary: \"\",\n link: \"font-normal\",\n plain: \"font-medium\",\n static: \"\",\n solid: \"\",\n opacity: \"\"\n },\n size: {\n lg: \"text-base w-5 h-5\",\n md: \"text-sm w-4.5 h-4.5\",\n sm: \"text-sm w-4 h-4\"\n }\n },\n compoundVariants: [\n {\n variant: \"plain\",\n size: \"lg\",\n className: \"text-base w-4.5 h-4.5\"\n },\n {\n variant: \"plain\",\n size: \"md\",\n className: \"text-sm w-4 h-4\"\n },\n {\n variant: \"plain\",\n size: \"sm\",\n className: \"text-sm\"\n }\n ],\n defaultVariants: {\n variant: \"primary\",\n size: \"lg\"\n }\n }\n);\n\n// src/components/button/button.tsx\nimport { Fragment, jsx as jsx8, jsxs as jsxs2 } from \"react/jsx-runtime\";\nvar Button = React6.forwardRef(\n ({\n className = \"\",\n iconClassName,\n variant = \"primary\",\n color = \"default\",\n icon,\n iconDirection = \"left\",\n size,\n asChild = false,\n loading = false,\n noStyle = false,\n iconOutBox = false,\n isBlock = false,\n disabled,\n children,\n autoFocus,\n asset,\n assetNumber = 0,\n ...props\n }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n const disable = disabled || loading;\n return /* @__PURE__ */ jsxs2(\n Comp,\n {\n className: noStyle ? className : cn(\n buttonVariants({ variant, color, size, className }),\n disable && \"!pointer-events-auto cursor-not-allowed\",\n isBlock && \"w-full\"\n ),\n ref,\n disabled: disable,\n autoFocus,\n ...props,\n children: [\n loading && /* @__PURE__ */ jsx8(\"span\", { className: \"absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center\", children: /* @__PURE__ */ jsx8(\n Loader2,\n {\n className: cn(\n iconVariants2({ variant, size }),\n \"animate-spin\",\n size === \"lg\" ? \"h-6 w-6\" : size === \"md\" ? \"h-5 w-5\" : \"h-4.5 w-4.5\"\n )\n }\n ) }),\n !asset && icon && iconOutBox && iconDirection === \"left\" && renderIcon(icon, \"left\", {\n loading,\n noStyle,\n iconClassName,\n variant,\n color,\n size\n }),\n /* @__PURE__ */ jsxs2(\n \"span\",\n {\n className: cn(\n \"inline-flex w-full items-center justify-center\",\n loading ? \"opacity-0\" : \"opacity-100\",\n variant === \"plain\" && \"font-medium\"\n ),\n children: [\n !asset && icon && !iconOutBox && iconDirection === \"left\" && renderIcon(icon, \"left\", {\n loading,\n noStyle,\n iconClassName,\n variant,\n color,\n size\n }),\n children,\n asset ? /* @__PURE__ */ jsxs2(Fragment, { children: [\n /* @__PURE__ */ jsx8(\n Separator,\n {\n orientation: \"vertical\",\n className: cn(\n \"mx-1.5 h-3\",\n variant === \"primary\" ? \"border-Colors-Alpha-White-20\" : \"border-Colors-Beta-Black-20\"\n )\n }\n ),\n /* @__PURE__ */ jsx8(\n Image2,\n {\n src: asset === \"energy\" ? getAssetsUrl(\n \"image/bot/tag/20231214/1719340128612116720.png\"\n ) : getAssetsUrl(\"image/web3/20250331/shell_coin_icon_v2.png\"),\n alt: asset,\n width: 16,\n height: 16,\n className: \"flex-shrink-0\"\n }\n ),\n /* @__PURE__ */ jsx8(Text, { size: \"xs\", className: cn(\"ml-0.5 text-inherit\"), children: assetNumber })\n ] }) : null,\n !asset && icon && !iconOutBox && iconDirection === \"right\" && renderIcon(icon, \"right\", {\n loading,\n noStyle,\n iconClassName,\n variant,\n color,\n size\n })\n ]\n }\n ),\n !asset && icon && iconOutBox && iconDirection === \"right\" && renderIcon(icon, \"right\", {\n loading,\n noStyle,\n iconClassName,\n variant,\n color,\n size\n })\n ]\n }\n );\n }\n);\nvar renderIcon = (icon, direction, {\n loading,\n noStyle,\n iconClassName,\n variant = \"primary\",\n color = \"brand\",\n size = \"lg\"\n}) => /* @__PURE__ */ jsx8(\n Icon,\n {\n component: icon,\n className: noStyle ? iconClassName : cn(\n iconVariants2({ variant, size }),\n variant === \"plain\" || variant === \"link\" ? direction === \"left\" ? \"mr-0.5\" : \"ml-0.5\" : direction === \"left\" ? \"mr-1.5\" : \"ml-1.5\",\n iconClassName,\n loading ? \"opacity-0\" : \"opacity-100\"\n )\n }\n);\nButton.displayName = \"Button\";\n\n// src/components/alert-dialog.tsx\nimport { jsx as jsx9, jsxs as jsxs3 } from \"react/jsx-runtime\";\nvar AlertDialog = AlertDialogPrimitive.Root;\nvar AlertDialogPortal = AlertDialogPrimitive.Portal;\nvar AlertDialogTrigger = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(\n AlertDialogPrimitive.Trigger,\n {\n ref,\n className: cn(\n \"ring-offset-cc-Focus-Rings-Brand-default focus-visible:outline-none focus-visible:shadow-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1\",\n className\n ),\n ...props\n }\n));\nAlertDialogTrigger.displayName = AlertDialogPrimitive.Trigger.displayName;\nvar AlertDialogOverlay = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(\n AlertDialogPrimitive.Overlay,\n {\n className: cn(\n \"fixed inset-0 z-50 bg-Colors-Background-Utilities-Overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n ),\n ...props,\n ref\n }\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\nvar AlertDialogContent = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs3(AlertDialogPortal, { children: [\n /* @__PURE__ */ jsx9(AlertDialogOverlay, {}),\n /* @__PURE__ */ jsx9(\n AlertDialogPrimitive.Content,\n {\n ref,\n className: cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full rounded-4xl max-w-lg translate-x-[-50%] translate-y-[-50%] bg-Colors-Background-Normal-Primary-Default shadow-modal-default duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] ring-offset-cc-Focus-Rings-Brand-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1\",\n className\n ),\n ...props\n }\n )\n] }));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\nfunction AlertDialogHeader({\n className,\n ...props\n}) {\n return /* @__PURE__ */ jsx9(\n \"div\",\n {\n className: cn(\"flex flex-col p-4 text-Colors-Text-Default\", className),\n ...props\n }\n );\n}\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\nfunction AlertDialogFooter({\n className,\n ...props\n}) {\n return /* @__PURE__ */ jsx9(\n \"div\",\n {\n className: cn(\"flex justify-end p-4 space-x-4\", className),\n ...props\n }\n );\n}\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\nvar AlertDialogTitle = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(\n AlertDialogPrimitive.Title,\n {\n ref,\n className: cn(\"text-xl font-normal\", className),\n ...props\n }\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\nvar AlertDialogDescription = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(\n AlertDialogPrimitive.Description,\n {\n ref,\n className: cn(\"text-sm text-Colors-Text-Subtle px-4\", className),\n ...props\n }\n));\nAlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;\nvar AlertDialogAction = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(\n AlertDialogPrimitive.Action,\n {\n ref,\n className: cn(buttonVariants(), className),\n ...props\n }\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\nvar AlertDialogCancel = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(\n AlertDialogPrimitive.Cancel,\n {\n ref,\n className: cn(buttonVariants({ variant: \"secondary\" }), className),\n ...props\n }\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\n// src/components/aspect-ratio.tsx\nimport * as AspectRatioPrimitive from \"@radix-ui/react-aspect-ratio\";\nvar AspectRatio = AspectRatioPrimitive.Root;\n\n// src/components/audio-player.tsx\nimport PlayIcon from \"@heroicons/react/20/solid/esm/PlayIcon\";\nimport { useAudio } from \"react-use\";\n\n// src/common/hooks/useAudioPlayer.tsx\nimport {\n forwardRef as forwardRef8,\n useCallback,\n useImperativeHandle,\n useLayoutEffect,\n useRef\n} from \"react\";\n\n// src/common/hooks/useDevice.ts\nimport isMobile from \"ismobilejs\";\nimport { useState as useState2, useEffect as useEffect2 } from \"react\";\n\n// src/common/hooks/useWindowWidth.ts\nimport { useEffect, useState } from \"react\";\nvar useWindowWidth = () => {\n const [windowWidth, setWindowWidth] = useState(0);\n useEffect(() => {\n const handleResize = () => {\n setWindowWidth(window.innerWidth);\n };\n window.addEventListener(\"resize\", handleResize);\n handleResize();\n return () => {\n window.removeEventListener(\"resize\", handleResize);\n };\n }, []);\n return windowWidth;\n};\n\n// src/common/hooks/useDevice.ts\nvar useDevice = () => {\n const [device, setDevice] = useState2(isMobile());\n const [isWeixin, setIsWeixin] = useState2(false);\n useEffect2(() => {\n const device2 = isMobile();\n setDevice(device2);\n setIsWeixin(\n navigator.userAgent.toLowerCase().indexOf(\"micromessenger\") !== -1\n );\n }, []);\n return {\n isMobile: device.phone || device.tablet,\n isIos: device.apple.phone || device.apple.tablet || device.apple.ipod,\n isWeixin\n };\n};\nvar useIsMobileByWindowWidth = () => {\n return useWindowWidth() <= 768;\n};\n\n// src/common/hooks/useAudioPlayer.tsx\nimport { jsx as jsx10 } from \"react/jsx-runtime\";\nvar audioAPI = null;\nvar getAudioAPI = () => {\n if (audioAPI) return audioAPI;\n const AudioContext = window.AudioContext || window.webkitAudioContext;\n const context = new AudioContext();\n const gainNode = context.createGain();\n gainNode.gain.value = 1;\n let currentSourceNode = null;\n window.addEventListener(\n \"touchstart\",\n () => {\n const buffer = context.createBuffer(1, 1, 22050);\n const source = context.createBufferSource();\n source.buffer = buffer;\n source.connect(context.destination);\n source.start(0);\n },\n { once: true }\n );\n audioAPI = {\n play(arrayBuffer, start) {\n context.decodeAudioData(arrayBuffer.slice(0), (audioBuffer) => {\n if (context.state === \"suspended\") {\n if (currentSourceNode) {\n currentSourceNode.stop();\n }\n context.resume();\n }\n if (gainNode.gain.value === 0) {\n gainNode.gain.value = 1;\n }\n const source = context.createBufferSource();\n source.buffer = audioBuffer;\n source.connect(context.destination);\n currentSourceNode = source;\n source.start(0, start);\n });\n },\n pause() {\n context.suspend();\n }\n };\n return audioAPI;\n};\nvar IosAudioPlayer = forwardRef8(\n (props, ref) => {\n const audioRef = useRef(null);\n const audioApi = getAudioAPI();\n const loadTask = useRef();\n useLayoutEffect(() => {\n return () => {\n audioApi.pause();\n if (audioRef.current) {\n audioRef.current.pause();\n }\n };\n }, []);\n const handlePlay = useCallback(async () => {\n if (!audioRef.current?.paused) return Promise.reject();\n if (props.src && loadTask.current) {\n const arrayBuffer = await loadTask.current;\n if (arrayBuffer) {\n return audioApi.play(arrayBuffer, audioRef.current.currentTime);\n }\n }\n return Promise.resolve();\n }, []);\n const handleLoad = useCallback(async () => {\n if (props.src) {\n try {\n loadTask.current = window.fetch(props.src).then((response) => response.arrayBuffer()).catch((error) => {\n console.error(error);\n });\n } catch (error) {\n console.error(error);\n }\n }\n }, []);\n useImperativeHandle(\n ref,\n () => {\n return {\n play: () => handlePlay().then(() => {\n console.log(\"audioCompPlay\");\n return audioRef.current.play();\n }).catch(() => {\n }),\n pause: () => {\n audioAPI?.pause();\n return audioRef.current.pause();\n },\n load: () => {\n handleLoad();\n return audioRef.current.load();\n },\n addEventListener: (type, listener, options) => {\n return audioRef.current.addEventListener(type, listener, options);\n },\n get currentTime() {\n return audioRef.current.currentTime;\n },\n set currentTime(value) {\n audioRef.current.currentTime = value;\n },\n get duration() {\n return audioRef.current.duration;\n },\n get paused() {\n return audioRef.current.paused;\n }\n };\n },\n [handlePlay, handleLoad]\n );\n return /* @__PURE__ */ jsx10(\"audio\", { ...props, muted: true, ref: audioRef });\n }\n);\nIosAudioPlayer.displayName = \"IosAudioPlayer\";\n\n// src/components/button/icon-button.tsx\nimport { Slot as Slot2 } from \"@radix-ui/react-slot\";\nimport { Loader2 as Loader22 } from \"lucide-react\";\nimport * as React10 from \"react\";\nimport { useMedia as useMedia2 } from \"react-use\";\n\n// src/components/tooltip.tsx\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport * as React9 from \"react\";\n\n// src/components/popover.tsx\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport * as React8 from \"react\";\nimport { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs4 } from \"react/jsx-runtime\";\nvar PopoverRoot = PopoverPrimitive.Root;\nvar PopoverTrigger = PopoverPrimitive.Trigger;\nvar PopoverAnchor = PopoverPrimitive.Anchor;\nvar PopoverContent = React8.forwardRef(\n ({\n className,\n align = \"center\",\n variant = \"default\",\n side = \"top\",\n sideOffset = 4,\n alignOffset = 0,\n arrowPadding = 0,\n showArrow = true,\n children,\n container,\n ...props\n }, ref) => /* @__PURE__ */ jsx11(PopoverPrimitive.Portal, { container, children: /* @__PURE__ */ jsxs4(\n PopoverPrimitive.Content,\n {\n ref,\n align,\n alignOffset,\n sideOffset,\n arrowPadding,\n side,\n forceMount: true,\n className: cn(\n \"relative z-[49] mx-4 w-fit max-w-72 rounded-lg border border-opaque p-3 text-left text-xs shadow-modal-default outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 [&[data-state=open]>span]:animate-none\",\n variant === \"default\" ? \"bg-alpha-100 text-Colors-Text-Default\" : variant === \"info\" ? \"bg-surface-accent-yellow-subtle text-Colors-Text-Warning-Bolder\" : \"bg-Colors-Utility-Lake-Blue-50 text-Colors-Text-Static-White\",\n className\n ),\n ...props,\n children: [\n children,\n showArrow && /* @__PURE__ */ jsx11(\n PopoverPrimitive.Arrow,\n {\n width: 16,\n height: 6,\n className: cn(\n \"visible\",\n variant === \"default\" ? \"fill-alpha-100\" : variant === \"info\" ? \"fill-surface-accent-yellow-subtle\" : \"fill-Colors-Utility-Lake-Blue-50\"\n )\n }\n )\n ]\n }\n ) })\n);\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\nvar Popover = ({\n disabled = false,\n open,\n title,\n content,\n anchor,\n children,\n className,\n triggerClassName,\n hasOpenState = false,\n isMTooltip = false,\n modal = false,\n openChangeCallback,\n ...props\n}) => {\n return /* @__PURE__ */ jsxs4(\n PopoverRoot,\n {\n open: disabled ? false : open,\n modal,\n onOpenChange: openChangeCallback,\n ...props,\n children: [\n anchor,\n content && /* @__PURE__ */ jsxs4(Fragment2, { children: [\n /* @__PURE__ */ jsx11(\n \"div\",\n {\n className: cn(\n hasOpenState && \"data-[state=open]:bg-surface-hovered\",\n triggerClassName\n ),\n onClick: (e) => {\n if (isMTooltip) {\n e.preventDefault();\n e.stopPropagation();\n }\n },\n children: /* @__PURE__ */ jsx11(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx11(\n \"div\",\n {\n className: cn(\n hasOpenState && \"data-[state=open]:bg-surface-hovered\",\n triggerClassName\n ),\n children\n }\n ) })\n }\n ),\n /* @__PURE__ */ jsxs4(\n PopoverContent,\n {\n ...props,\n className: cn(\"w-fit max-w-[324px]\", className),\n onCloseAutoFocus: (e) => e.preventDefault(),\n children: [\n title && /* @__PURE__ */ jsx11(\"p\", { className: \"mb-1\", children: /* @__PURE__ */ jsx11(Description, { size: \"lg\", weight: \"medium\", className: \"text-inherit\", children: title }) }),\n content\n ]\n }\n )\n ] }),\n !content && children\n ]\n }\n );\n};\n\n// src/components/tooltip.tsx\nimport { useMedia } from \"react-use\";\nimport { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs5 } from \"react/jsx-runtime\";\nvar TooltipProvider = TooltipPrimitive.Provider;\nvar TooltipTrigger = TooltipPrimitive.Trigger;\nvar TooltipArrow = TooltipPrimitive.Arrow;\nvar Tooltip = React9.forwardRef(\n ({\n open,\n defaultOpen,\n disabled = false,\n children,\n title,\n description,\n size = \"sm\",\n titleDangerous = false,\n descriptionDangerous = false,\n contentClassName,\n triggerClassName,\n ...props\n }, ref) => {\n const isDesktop = !useMedia(\"(max-width: 768px)\");\n const defaultTitleColor = props.variant === \"message\" ? \"static\" : props.variant === \"default\" ? \"warning-bolder\" : \"default\";\n const defaultDescColor = props.variant === \"message\" ? \"static\" : props.variant === \"info\" ? \"warning-bolder\" : \"default\";\n if (disabled) {\n return /* @__PURE__ */ jsx12(Fragment3, { children });\n }\n return /* @__PURE__ */ jsx12(Fragment3, { children: isDesktop ? /* @__PURE__ */ jsx12(TooltipProvider, { children: /* @__PURE__ */ jsxs5(\n TooltipPrimitive.Root,\n {\n open: disabled || !description && !title ? false : open,\n defaultOpen,\n children: [\n /* @__PURE__ */ jsx12(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx12(\"div\", { className: cn(\"cursor-pointer\", triggerClassName), children }) }),\n /* @__PURE__ */ jsxs5(TooltipContent, { ref, className: contentClassName, ...props, children: [\n title && /* @__PURE__ */ jsx12(\"p\", { className: \"mb-1\", children: /* @__PURE__ */ jsx12(\n Description,\n {\n size: \"lg\",\n weight: \"medium\",\n color: defaultTitleColor,\n dangerous: titleDangerous,\n className: cn(\n \"text-wrap text-inherit\",\n size === \"md\" && \"text-sm\"\n ),\n children: title\n }\n ) }),\n description && /* @__PURE__ */ jsx12(\n Description,\n {\n size: \"lg\",\n weight: title ? \"regular\" : \"medium\",\n color: title ? \"subtle\" : defaultDescColor,\n dangerous: descriptionDangerous,\n className: cn(\n \"text-wrap text-inherit\",\n size === \"md\" && \"text-sm\"\n ),\n children: description\n }\n )\n ] })\n ]\n }\n ) }) : /* @__PURE__ */ jsx12(\n Popover,\n {\n open,\n title,\n content: description,\n disabled,\n triggerClassName,\n className: cn(contentClassName, size === \"md\" && \"text-sm\"),\n isMTooltip: true,\n ...props,\n children\n }\n ) });\n }\n);\nTooltip.displayName = TooltipPrimitive.Root.displayName;\nvar TooltipContent = React9.forwardRef(\n ({\n className,\n variant = \"default\",\n align = \"center\",\n side = \"top\",\n sideOffset = 6,\n alignOffset = 0,\n showArrow = true,\n arrowClassName,\n ...props\n }, ref) => /* @__PURE__ */ jsxs5(\n TooltipPrimitive.Content,\n {\n ref,\n align,\n sideOffset,\n alignOffset,\n side,\n className: cn(\n \"relative z-[49] mx-4 w-fit max-w-72 rounded-lg px-3 py-2 text-left text-xs shadow-modal-bolder\",\n \"outline-none delay-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 [&[data-state=open]>span]:animate-none\",\n \"data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 [&[data-state=delayed-open]>span]:animate-none\",\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n variant === \"default\" ? \"bg-cc-Tooltip-bg-default text-cc-Tooltip-fg-default border border-cc-Tooltip-border-default\" : variant === \"info\" ? \"bg-surface-accent-yellow-subtle text-Colors-Text-Warning-Bolder\" : \"bg-Colors-Utility-Lake-Blue-50 text-cc-Tooltip-fg-default\",\n className\n ),\n ...props,\n children: [\n props.children,\n showArrow && /* @__PURE__ */ jsx12(\n TooltipArrow,\n {\n width: 12,\n height: 6,\n className: cn(\n variant === \"default\" ? \"fill-cc-Tooltip-bg-default stroke-cc-Tooltip-border-default -ml-[0.5px]\" : variant === \"info\" ? \"fill-surface-accent-yellow-subtle\" : \"fill-Colors-Utility-Lake-Blue-50\",\n arrowClassName\n )\n }\n )\n ]\n }\n )\n);\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\n// src/components/button/icon-button.styles.ts\nimport { cva as cva6 } from \"class-variance-authority\";\nvar iconButtonVariants = cva6(\n \"shrink-0 inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:shadow-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 disabled:pointer-events-none disabled:opacity-30 disabled:shadow-none\",\n {\n variants: {\n variant: {\n primary: \"\",\n secondary: \"border shadow-none\",\n tertiary: \"border shadow-none\",\n plain: \"\",\n opacity: \"text-Colors-Text-Static-White bg-Colors-Beta-White-30 border border-Colors-Beta-White-12 shadow-none hover:bg-Colors-Beta-White-40 focus:shadow-cc-Focus-Rings-Brand-default active:bg-Colors-Beta-White-50 disabled:bg-Colors-Beta-White-60 disabled:text-Colors-Beta-White-80\",\n solid: \"shadow-none text-Colors-Text-Subtle bg-cc-Button-Solid-bg-default border border-cc-Button-Solid-border-default hover:bg-cc-Button-Solid-bg-hover hover:border-cc-Button-Solid-border-alt active:bg-cc-Button-Solid-bg-active disabled:text-cc-Button-Solid-fg-alt\"\n },\n color: {\n default: \"\",\n brand: \"\",\n error: \"\",\n gray: \"\"\n },\n size: {\n xs: \"h-5 w-5 text-xs\",\n sm: \"h-7 w-7 text-sm\",\n md: \"h-9 w-9 text-sm\",\n lg: \"h-11 w-11\"\n }\n },\n compoundVariants: [\n {\n variant: \"primary\",\n color: \"brand\",\n className: \"text-cc-Icon-Button-Brand-fg-default bg-cc-Icon-Button-Brand-bg-default hover:bg-cc-Icon-Button-Brand-bg-hover active:bg-cc-Icon-Button-Brand-bg-active disabled:bg-cc-Icon-Button-Brand-bg-disabled disabled:text-cc-Icon-Button-Brand-fg-alt\"\n },\n {\n variant: \"primary\",\n color: \"error\",\n className: \"text-cc-Button-Error-Primary-fg-default bg-cc-Button-Error-Primary-bg-default hover:bg-cc-Button-Error-Primary-bg-hover active:bg-cc-Button-Error-Primary-bg-active disabled:bg-cc-Button-Error-Primary-bg-disabled\"\n },\n {\n variant: \"secondary\",\n color: \"default\",\n className: \"border-cc-Button-Secondary-border-default text-cc-Button-Secondary-fg-default bg-cc-Button-Secondary-bg-default hover:bg-cc-Button-Secondary-bg-hover active:bg-cc-Button-Secondary-bg-active disabled:text-cc-Button-Secondary-fg-alt disabled:border-cc-Button-Secondary-border-disabled\"\n },\n {\n variant: \"tertiary\",\n color: \"default\",\n className: \"border-cc-Button-Tertiary-border-default text-cc-Button-Tertiary-fg-default bg-cc-Button-Tertiary-bg-default hover:bg-cc-Button-Tertiary-bg-hover hover:border-cc-Button-Tertiary-border-alt focus:shadow-button-tertiary-shadow active:bg-cc-Button-Tertiary-bg-active disabled:text-cc-Button-Tertiary-fg-alt\"\n },\n {\n variant: \"secondary\",\n color: \"error\",\n className: \"border-cc-Button-Error-Secondary-border-default text-cc-Button-Error-Secondary-fg-default bg-cc-Button-Error-Secondary-bg-default hover:bg-cc-Button-Error-Secondary-bg-hover active:bg-cc-Button-Error-Secondary-bg-active disabled:text-cc-Button-Error-Secondary-fg-alt disabled:border-cc-Button-Error-Secondary-border-disabled\"\n },\n {\n variant: \"secondary\",\n color: \"gray\",\n className: \"text-Colors-Foreground-Subtle hover:bg-surface-hovered active:shadow-button-pressed\"\n },\n {\n variant: \"plain\",\n color: \"default\",\n className: \"text-cc-Button-Plain-fg-default hover:bg-cc-Button-Plain-bg-hover focus:shadow-cc-Focus-Rings-Brand-default active:bg-cc-Button-Plain-bg-active disabled:text-cc-Button-Plain-fg-alt\"\n },\n {\n variant: \"plain\",\n color: \"gray\",\n className: \"text-cc-Icon-Button-Plain-Gray-fg-default bg-cc-Button-Plain-Brand-bg-default hover:bg-cc-Button-Plain-Brand-bg-hover active:bg-cc-Button-Plain-Brand-bg-active disabled:text-cc-Button-Plain-Gray-fg-alt\"\n },\n {\n variant: \"plain\",\n color: \"error\",\n className: \"text-cc-Button-Error-Secondary-fg-default bg-cc-Button-Plain-bg-default hover:bg-cc-Button-Error-Secondary-bg-hover active:bg-cc-Button-Error-Secondary-bg-active disabled:text-cc-Button-Plain-fg-default\"\n }\n ],\n defaultVariants: {\n variant: \"primary\",\n color: \"default\",\n size: \"lg\"\n }\n }\n);\nvar iconSizeVariants = {\n xs: \"w-3 h-3\",\n sm: \"w-4.5 h-4.5\",\n md: \"w-5.5 h-5.5\",\n lg: \"w-6 h-6\"\n};\n\n// src/components/button/icon-button.tsx\nimport { jsx as jsx13 } from \"react/jsx-runtime\";\nvar IconButton = React10.forwardRef(\n ({\n iconClassName,\n className,\n variant,\n size = \"lg\",\n color,\n asChild = false,\n loading = false,\n children,\n icon: IconEle,\n disabled,\n hoverText,\n hoverSide,\n ...passProps\n }, ref) => {\n const isMobile2 = useMedia2(\"(max-width: 768px)\");\n const Comp = asChild ? Slot2 : \"button\";\n const iconCls = cn(iconSizeVariants[size], iconClassName);\n const disable = disabled || loading;\n return /* @__PURE__ */ jsx13(\n Tooltip,\n {\n sideOffset: 4,\n size: \"md\",\n description: hoverText,\n side: hoverSide,\n disabled: isMobile2,\n children: /* @__PURE__ */ jsx13(\n Comp,\n {\n className: cn(\n iconButtonVariants({ variant, size, color }),\n disable && \"cursor-not-allowed !pointer-events-auto\",\n className\n ),\n ref,\n disabled: disable,\n ...passProps,\n children: loading ? /* @__PURE__ */ jsx13(Loader22, { className: cn(\"animate-spin\", iconCls) }) : IconEle ? /* @__PURE__ */ jsx13(IconEle, { className: iconCls }) : React10.isValidElement(children) ? React10.cloneElement(children, {\n className: cn(iconCls, children.props.className)\n }) : null\n }\n )\n }\n );\n }\n);\n\n// src/components/icons/solid/audio-playing.tsx\nimport Lottie from \"lottie-web\";\nimport { useEffect as useEffect3, useRef as useRef2 } from \"react\";\nimport { jsx as jsx14 } from \"react/jsx-runtime\";\n\n// src/components/audio-player.tsx\nimport { jsx as jsx15, jsxs as jsxs6 } from \"react/jsx-runtime\";\n\n// node_modules/@radix-ui/react-primitive/dist/index.mjs\nimport * as React11 from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { Slot as Slot3 } from \"@radix-ui/react-slot\";\nimport { jsx as jsx16 } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Node = React11.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot3 : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx16(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\n\n// src/components/avatar.tsx\nimport { cva as cva7 } from \"class-variance-authority\";\nimport * as React12 from \"react\";\nimport { jsx as jsx17 } from \"react/jsx-runtime\";\nvar avatarVariants = cva7(\n \"relative flex shrink-0 overflow-hidden bg-Colors-Background-Neutral-Primary-Default\",\n {\n variants: {\n size: {\n xs: \"w-5 h-5 rounded\",\n // 20 4\n sm: \"w-6 h-6 rounded-md\",\n // 24 6\n md: \"w-8 h-8 rounded-lg\",\n // 32 8\n lg: \"w-9 h-9 rounded-lg\",\n // 36 8\n xl: \"w-12 h-12 rounded-xl\",\n // 48 10 no\n \"2xl\": \"w-14 h-14 rounded-xl\",\n // 56 12\n \"3xl\": \"w-16 h-16 rounded-xl\",\n // 64 12\n \"4xl\": \"w-18 h-18 rounded-2xl\",\n // 72 14 no\n \"5xl\": \"w-21 h-21 rounded-2xl\",\n // 84 16\n \"6xl\": \"w-24 h-24 rounded-3xl\",\n // 96 20\n \"7xl\": \"w-30 h-30 rounded-4xl\"\n // 120 24\n }\n },\n defaultVariants: {\n size: \"md\"\n }\n }\n);\nvar AvatarRoot = React12.forwardRef(({ className, size = \"md\", ...passProps }, ref) => /* @__PURE__ */ jsx17(\n Primitive.span,\n {\n ref,\n className: cn(avatarVariants({ size }), className),\n ...passProps\n }\n));\nAvatarRoot.displayName = \"Avatar\";\nvar AvatarImage = React12.forwardRef(({ className, onLoad, onError, ...props }, ref) => {\n const [loadingStatus, setLoadingStatus] = React12.useState(\"loading\");\n const handleLoad = (event) => {\n setLoadingStatus(\"loaded\");\n if (onLoad) {\n onLoad(event);\n }\n };\n const handleError = (event) => {\n setLoadingStatus(\"error\");\n if (onError) {\n onError(event);\n }\n };\n return loadingStatus !== \"error\" ? /* @__PURE__ */ jsx17(\n Primitive.img,\n {\n ref,\n className: cn(\"aspect-square h-full w-full object-cover\", className),\n onLoad: handleLoad,\n onError: handleError,\n ...props\n }\n ) : /* @__PURE__ */ jsx17(\n Primitive.span,\n {\n ref,\n className: cn(\n \"flex h-full w-full items-center justify-center bg-Colors-Background-Neutral-Primary-Default\",\n className\n ),\n ...props\n }\n );\n});\nAvatarImage.displayName = \"AvatarImage\";\nvar Avatar = React12.forwardRef(\n ({\n className,\n rootStyle,\n size,\n src,\n variant = \"bot\",\n border = true,\n ...passProps\n }, ref) => {\n const defaultSrc = variant === \"user\" ? \"https://www.myshellstatic.com/cdn-cgi/image/quality=40,format=webp/image/user/avatar/default/20240715/avatar.png\" : \"https://www.myshellstatic.com/cdn-cgi/image/quality=40,format=webp/image/bot/logo/20240106/default.png\";\n return /* @__PURE__ */ jsx17(\n AvatarRoot,\n {\n size,\n className: cn(\n border && \"border-Colors-Border-Default border-[0.3px]\",\n className\n ),\n style: rootStyle,\n children: /* @__PURE__ */ jsx17(AvatarImage, { ref, ...passProps, src: src || defaultSrc })\n }\n );\n }\n);\nAvatar.displayName = \"Avatar\";\n\n// src/components/badge.tsx\nimport { cva as cva8 } from \"class-variance-authority\";\nimport { jsx as jsx18 } from \"react/jsx-runtime\";\nvar badgeVariants = cva8(\n \"rounded-full flex items-center justify-center text-Colors-Text-Default\",\n {\n variants: {\n status: {\n default: \"w-2 h-2 bg-Colors-Foreground-Critical-Default\",\n unRead: \"min-w-2 min-h-4 bg-Colors-Foreground-Critical-Default px-1.5 text-Colors-Text-Static-White text-2xs font-medium\",\n cardUnRead: \"min-w-4 min-h-4 bg-Colors-Foreground-Critical-Default px-1.5 text-Colors-Text-Static-White text-2xs font-medium\",\n public: \"w-2.5 h-2.5 bg-Colors-Utit border-[2px] bg-Colors-Utility-Lake-Blue-50 border-Colors-Utility-Lake-Blue-10\",\n private: \"w-2.5 h-2.5 bg-Colors-Utility-Khaki-50 border-Colors-Utility-Khaki-10 border-[2px]\",\n hidden: \"w-2.5 h-2.5 bg-Colors-Utility-Gray-40 border-Colors-Utility-Gray-10 border-[2px]\",\n new: \"w-8.5 h-4 pb-0.5 flex juctify-center items-center bg-Colors-Foreground-Critical-Default px-1.5\"\n }\n },\n defaultVariants: {\n status: \"default\"\n }\n }\n);\nfunction Badge(props) {\n const { status, count: count2, className } = props;\n const unReadCount = count2 && count2 < 100 ? count2 : \"99+\";\n return /* @__PURE__ */ jsx18(\"div\", { className: cn(badgeVariants({ status }), className), children: status === \"new\" ? /* @__PURE__ */ jsx18(\"span\", { className: \"text-2xs font-medium text-Colors-Text-Static-White leading-[1.3]\", children: \"New\" }) : /* @__PURE__ */ jsx18(\"span\", { className: \"font-medium text-2xs leading-[1.3]\", children: unReadCount && (status === \"unRead\" || status === \"cardUnRead\") ? count2 : null }) });\n}\n\n// src/components/cascader.tsx\nimport clsx2 from \"clsx\";\nimport { Check as Check2, ChevronDown } from \"lucide-react\";\nimport { Fragment as Fragment4 } from \"react\";\nimport { useToggle } from \"react-use\";\n\n// src/components/dropdown-menu.tsx\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { Check, ChevronRight, Circle } from \"lucide-react\";\nimport * as React13 from \"react\";\nimport { jsx as jsx19, jsxs as jsxs7 } from \"react/jsx-runtime\";\nvar DropdownMenu = DropdownMenuPrimitive.Root;\nvar DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nvar DropdownMenuGroup = DropdownMenuPrimitive.Group;\nvar DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nvar DropdownMenuSub = DropdownMenuPrimitive.Sub;\nvar DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\nvar DropdownMenuSubTrigger = React13.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs7(\n DropdownMenuPrimitive.SubTrigger,\n {\n ref,\n className: cn(\n \"flex cursor-default select-none items-center rounded-lg px-3 py-2 outline-none focus:bg-Colors-Background-Neutral-Primary-Default data-[state=open]:bg-Colors-Background-Neutral-Primary-Default\",\n inset && \"pl-8\",\n className\n ),\n ...props,\n children: [\n children,\n /* @__PURE__ */ jsx19(ChevronRight, { className: \"ml-auto h-4 w-4\" })\n ]\n }\n));\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\nvar DropdownMenuSubContent = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(\n DropdownMenuPrimitive.SubContent,\n {\n ref,\n className: cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-xl border border-alpha bg-Colors-Background-Normal-Primary-Active p-2 text-Colors-Text-Default shadow-modal-default data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n ),\n ...props\n }\n));\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\nvar DropdownMenuContent = React13.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {\n return /* @__PURE__ */ jsx19(\n DropdownMenuPrimitive.Content,\n {\n ref,\n sideOffset,\n className: cn(\n \"z-[100] min-w-[8rem] overflow-hidden rounded-xl border border-opaque bg-Colors-Background-Normal-Primary-Default p-1 text-Colors-Text-Default shadow-modal-default data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n ),\n ...props\n }\n );\n});\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\nvar DropdownMenuItem = React13.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx19(\n DropdownMenuPrimitive.Item,\n {\n ref,\n className: cn(\n \"relative flex cursor-default select-none items-center rounded-lg px-2 py-1 outline-none transition-colors focus:bg-Colors-Background-Neutral-Primary-Default data-[disabled]:pointer-events-none data-[disabled]:opacity-30\",\n inset && \"pl-8\",\n className\n ),\n ...props\n }\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\nvar DropdownMenuCheckboxItem = React13.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs7(\n DropdownMenuPrimitive.CheckboxItem,\n {\n ref,\n className: cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-30\",\n className\n ),\n checked,\n ...props,\n children: [\n /* @__PURE__ */ jsx19(\"span\", { className: \"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\", children: /* @__PURE__ */ jsx19(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx19(Check, { className: \"h-4 w-4\" }) }) }),\n children\n ]\n }\n));\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\nvar DropdownMenuRadioItem = React13.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs7(\n DropdownMenuPrimitive.RadioItem,\n {\n ref,\n className: cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50\",\n className\n ),\n ...props,\n children: [\n /* @__PURE__ */ jsx19(\"span\", { className: \"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\", children: /* @__PURE__ */ jsx19(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx19(Circle, { className: \"h-2 w-2 fill-current\" }) }) }),\n children\n ]\n }\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\nvar DropdownMenuLabel = React13.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx19(\n DropdownMenuPrimitive.Label,\n {\n ref,\n className: cn(\"px-3 py-1 text-sm font-medium\", inset && \"pl-8\", className),\n ...props\n }\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\nvar DropdownMenuSeparator = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(\n DropdownMenuPrimitive.Separator,\n {\n ref,\n className: cn(\"my-1 h-px bg-[var(--border)]\", className),\n ...props\n }\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\nvar DropdownMenuShortcut = ({\n className,\n ...props\n}) => {\n return /* @__PURE__ */ jsx19(\n \"span\",\n {\n className: cn(\"ml-auto text-xs tracking-widest opacity-60\", className),\n ...props\n }\n );\n};\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\n// src/components/cascader.tsx\nimport { jsx as jsx20, jsxs as jsxs8 } from \"react/jsx-runtime\";\n\n// src/components/checkbox.tsx\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { cva as cva9 } from \"class-variance-authority\";\nimport * as React14 from \"react\";\nimport { jsx as jsx21, jsxs as jsxs9 } from \"react/jsx-runtime\";\nvar CheckIcon = ({ className }) => {\n return /* @__PURE__ */ jsx21(\n \"svg\",\n {\n className,\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"12\",\n height: \"12\",\n viewBox: \"0 0 12 12\",\n fill: \"none\",\n children: /* @__PURE__ */ jsx21(\n \"path\",\n {\n d: \"M2.25 6.375L5.25 9.375L9.75 2.625\",\n \"stroke-width\": \"1.5\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\"\n }\n )\n }\n );\n};\nvar CheckIconBrand = ({ className }) => {\n return /* @__PURE__ */ jsx21(\n \"svg\",\n {\n className,\n width: \"10\",\n height: \"10\",\n viewBox: \"0 0 10 10\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n children: /* @__PURE__ */ jsx21(\n \"path\",\n {\n d: \"M1.25 5.375L4.25 8.375L8.75 1.625\",\n \"stroke-width\": \"1.5\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\"\n }\n )\n }\n );\n};\nvar checkboxVariants = cva9(\n \"peer w-5 h-5 shrink-0 border-[1.5px] border-cc-Check-Box-border-default hover:border-cc-Check-Box-border-hover data-[state=checked]:border-cc-Check-Box-bg-default ring-offset-cc-Focus-Rings-Brand-default focus-visible:border-cc-Check-Box-border-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 disabled:border-pressed disabled:cursor-not-allowed disabled:opacity-30 data-[state=checked]:bg-cc-Check-Box-bg-default data-[state=checked]:text-cc-Check-Box-fg-default hover:data-[state=checked]:bg-cc-Check-Box-bg-hovered disabled:data-[state=checked]:text-cc-Check-Box-fg-alt disabled:data-[state=checked]:border-none rounded-sm overflow-hidden flex items-center justify-center text-current\",\n {\n variants: {\n variant: {\n checkbox: \"rounded-sm\",\n circle: \"rounded-full\",\n radio: \"rounded-full\",\n \"circle-static\": \"rounded-full bg-beta-black-10 border-beta-white-100 hover:border-beta-white-100\",\n \"circle-inverted\": \"rounded-full data-[state=checked]:border-surface-default focus-visible:border-surface-default data-[state=checked]:bg-surface-default hover:data-[state=checked]:bg-surface-hovered data-[state=checked]:text-icon-brand\"\n }\n },\n defaultVariants: {\n variant: \"checkbox\"\n }\n }\n);\nvar Checkbox = React14.forwardRef(\n ({\n className,\n variant,\n label,\n labelClassName,\n caption,\n captionClassName,\n ...props\n }, ref) => {\n const Component = label ? \"div\" : React14.Fragment;\n return /* @__PURE__ */ jsxs9(\n Component,\n {\n className: cn(\n \"flex items-center justify-center space-x-1.5 text-Colors-Text-Default\",\n caption && \"items-start\"\n ),\n children: [\n /* @__PURE__ */ jsx21(\n CheckboxPrimitive.Root,\n {\n ref,\n className: cn(checkboxVariants({ variant, className })),\n ...props,\n children: /* @__PURE__ */ jsx21(CheckboxPrimitive.Indicator, { children: variant === \"radio\" ? /* @__PURE__ */ jsx21(\"div\", { className: \"w-2 h-2 bg-cc-Check-Box-fg-default rounded-full\" }) : variant === \"circle-inverted\" ? /* @__PURE__ */ jsx21(CheckIconBrand, { className: \"w-3 h-3 stroke-cc-Check-Box-fg-default\" }) : /* @__PURE__ */ jsx21(CheckIcon, { className: \"w-3 h-3 stroke-cc-Check-Box-fg-default\" }) })\n }\n ),\n label && /* @__PURE__ */ jsxs9(\"p\", { className: cn(\"text-sm\", labelClassName), children: [\n label,\n caption && /* @__PURE__ */ jsx21(\n \"p\",\n {\n className: cn(\n \"text-sm text-Colors-Text-Subtler\",\n captionClassName\n ),\n children: caption\n }\n )\n ] })\n ]\n }\n );\n }\n);\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\n// src/components/command.tsx\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { Search } from \"lucide-react\";\nimport * as React16 from \"react\";\n\n// src/components/dialog.tsx\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\nimport * as React15 from \"react\";\nimport { jsx as jsx22, jsxs as jsxs10 } from \"react/jsx-runtime\";\nvar Dialog = DialogPrimitive.Root;\nvar DialogPortal = DialogPrimitive.Portal;\nvar DialogClose = DialogPrimitive.Close;\nvar DialogTrigger = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(\n DialogPrimitive.Trigger,\n {\n ref,\n className: cn(\n \"ring-offset-cc-Focus-Rings-Brand-default focus-visible:outline-none focus-visible:shadow-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1\",\n className\n ),\n ...props\n }\n));\nDialogTrigger.displayName = DialogPrimitive.Trigger.displayName;\nvar DialogOverlay = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(\n DialogPrimitive.Overlay,\n {\n ref,\n className: cn(\n \"fixed inset-0 z-50 bg-opacity-90 md:bg-opacity-75 bg-Colors-Background-Utilities-Overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n ),\n ...props\n }\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\nvar DialogContent = React15.forwardRef(\n ({\n className,\n children,\n hideClose = false,\n maskClosable = true,\n overlayClose = true,\n onClose,\n overlayClassName,\n iconClassName,\n ...props\n }, ref) => /* @__PURE__ */ jsxs10(DialogPortal, { children: [\n /* @__PURE__ */ jsx22(\n DialogOverlay,\n {\n onClick: () => {\n maskClosable && overlayClose && onClose && onClose();\n },\n className: overlayClassName\n }\n ),\n /* @__PURE__ */ jsxs10(\n DialogPrimitive.Content,\n {\n ref,\n className: cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-[90%] rounded-4xl max-w-lg translate-x-[-50%] translate-y-[-50%] bg-Colors-Background-Normal-Primary-Default shadow-modal-default duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] ring-offset-cc-Focus-Rings-Brand-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 focus-visible:outline-0\",\n className\n ),\n ...props,\n children: [\n children,\n !hideClose && /* @__PURE__ */ jsxs10(\n DialogPrimitive.Close,\n {\n className: cn(\n \"w-9 h-9 absolute right-5 top-3 flex justify-center items-center focus-visible:outline-0 rounded-full hover:bg-surface-hovered\",\n iconClassName\n ),\n onClick: () => {\n onClose && onClose();\n },\n children: [\n /* @__PURE__ */ jsx22(X, { className: \"w-6 h-6 text-Colors-Foreground-Subtle\" }),\n /* @__PURE__ */ jsx22(\"span\", { className: \"sr-only\", children: \"Close\" })\n ]\n }\n )\n ]\n }\n )\n ] })\n);\nDialogContent.displayName = DialogPrimitive.Content.displayName;\nfunction DialogHeader({\n className,\n ...props\n}) {\n return /* @__PURE__ */ jsx22(\"div\", { className: cn(\"flex flex-col p-4\", className), ...props });\n}\nDialogHeader.displayName = \"DialogHeader\";\nfunction DialogFooter({\n className,\n ...props\n}) {\n return /* @__PURE__ */ jsx22(\"div\", { className: cn(\"flex justify-end p-4\", className), ...props });\n}\nDialogFooter.displayName = \"DialogFooter\";\nvar DialogTitle = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(\n DialogPrimitive.Title,\n {\n ref,\n className: cn(\"text-xl font-normal\", className),\n ...props\n }\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\nvar DialogDescription = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(\n DialogPrimitive.Description,\n {\n ref,\n className: cn(\"text-sm text-Colors-Text-Subtle p-4\", className),\n ...props\n }\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\n// src/components/command.tsx\nimport { jsx as jsx23, jsxs as jsxs11 } from \"react/jsx-runtime\";\nvar Command = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(\n CommandPrimitive,\n {\n ref,\n className: cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-white text-slate-950 dark:bg-slate-950 dark:text-slate-50\",\n className\n ),\n ...props\n }\n));\nCommand.displayName = CommandPrimitive.displayName;\nvar CommandDialog = ({ children, ...props }) => {\n return /* @__PURE__ */ jsx23(Dialog, { ...props, children: /* @__PURE__ */ jsx23(DialogContent, { className: \"overflow-hidden p-0 shadow-lg\", children: /* @__PURE__ */ jsx23(Command, { className: \"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-slate-500 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5 dark:[&_[cmdk-group-heading]]:text-slate-400\", children }) }) });\n};\nvar CommandInput = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs11(\"div\", { className: \"flex items-center border-b px-3\", \"cmdk-input-wrapper\": \"\", children: [\n /* @__PURE__ */ jsx23(Search, { className: \"mr-2 h-4 w-4 shrink-0 opacity-50\" }),\n /* @__PURE__ */ jsx23(\n CommandPrimitive.Input,\n {\n ref,\n className: cn(\n \"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-slate-500 disabled:cursor-not-allowed disabled:opacity-50 dark:placeholder:text-slate-400\",\n className\n ),\n ...props\n }\n )\n] }));\nCommandInput.displayName = CommandPrimitive.Input.displayName;\nvar CommandList = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(\n CommandPrimitive.List,\n {\n ref,\n className: cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className),\n ...props\n }\n));\nCommandList.displayName = CommandPrimitive.List.displayName;\nvar CommandEmpty = React16.forwardRef((props, ref) => /* @__PURE__ */ jsx23(\n CommandPrimitive.Empty,\n {\n ref,\n className: \"py-6 text-center text-sm\",\n ...props\n }\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\nvar CommandGroup = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(\n CommandPrimitive.Group,\n {\n ref,\n className: cn(\n \"overflow-hidden p-1 text-slate-950 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-slate-500 dark:text-slate-50 dark:[&_[cmdk-group-heading]]:text-slate-400\",\n className\n ),\n ...props\n }\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\nvar CommandSeparator = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(\n CommandPrimitive.Separator,\n {\n ref,\n className: cn(\"-mx-1 h-px bg-slate-200 dark:bg-slate-800\", className),\n ...props\n }\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\nvar CommandItem = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(\n CommandPrimitive.Item,\n {\n ref,\n className: cn(\n \"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-slate-100 aria-selected:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:aria-selected:bg-slate-800 dark:aria-selected:text-slate-50\",\n className\n ),\n ...props\n }\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\nvar CommandShortcut = ({\n className,\n ...props\n}) => {\n return /* @__PURE__ */ jsx23(\n \"span\",\n {\n className: cn(\n \"ml-auto text-xs tracking-widest text-slate-500 dark:text-slate-400\",\n className\n ),\n ...props\n }\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n\n// src/components/context-menu.tsx\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport { Check as Check3, ChevronRight as ChevronRight2, Circle as Circle2 } from \"lucide-react\";\nimport * as React17 from \"react\";\nimport { jsx as jsx24, jsxs as jsxs12 } from \"react/jsx-runtime\";\nvar ContextMenu = ContextMenuPrimitive.Root;\nvar ContextMenuTrigger = ContextMenuPrimitive.Trigger;\nvar ContextMenuGroup = ContextMenuPrimitive.Group;\nvar ContextMenuPortal = ContextMenuPrimitive.Portal;\nvar ContextMenuSub = ContextMenuPrimitive.Sub;\nvar ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\nvar ContextMenuSubTrigger = React17.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs12(\n ContextMenuPrimitive.SubTrigger,\n {\n ref,\n className: cn(\n \"flex cursor-default select-none items-center rounded-lg py-1 px-2 text-sm outline-none hover:bg-surface-hovered data-[state=open]:bg-slate-100 data-[state=open]:text-slate-900 dark:focus:bg-slate-800 dark:focus:text-slate-50 dark:data-[state=open]:bg-slate-800 dark:data-[state=open]:text-slate-50\",\n inset && \"pl-8\",\n className\n ),\n ...props,\n children: [\n children,\n /* @__PURE__ */ jsx24(ChevronRight2, { className: \"ml-auto h-4 w-4\" })\n ]\n }\n));\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\nvar ContextMenuSubContent = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(\n ContextMenuPrimitive.SubContent,\n {\n ref,\n className: cn(\n \"flex flex-col gap-y-1 z-50 overflow-hidden rounded-xl border border-opaque bg-Colors-Background-Neutral-Primary-Default p-2 text-Colors-Text-Default shadow-modal-default\",\n className\n ),\n ...props\n }\n));\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\nvar ContextMenuContent = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx24(\n ContextMenuPrimitive.Content,\n {\n ref,\n className: cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-xl border-none bg-Colors-Background-Normal-Primary-Default p-1 text-Colors-Text-Default shadow-modal-default border border-opaque\",\n className\n ),\n ...props\n }\n) }));\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\nvar ContextMenuItem = React17.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx24(\n ContextMenuPrimitive.Item,\n {\n ref,\n className: cn(\n \"relative flex cursor-default select-none items-center rounded-lg py-1 px-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-30 focus:bg-Colors-Background-Neutral-Primary-Default\",\n inset && \"pl-8\",\n className\n ),\n ...props\n }\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\nvar ContextMenuCheckboxItem = React17.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs12(\n ContextMenuPrimitive.CheckboxItem,\n {\n ref,\n className: cn(\n \"relative flex cursor-default select-none items-center rounded-lg py-1 px-2 text-sm outline-none hover:bg-surface-hovered data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50\",\n className\n ),\n checked,\n ...props,\n children: [\n /* @__PURE__ */ jsx24(\"span\", { className: \"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\", children: /* @__PURE__ */ jsx24(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx24(Check3, { className: \"h-4 w-4\" }) }) }),\n children\n ]\n }\n));\nContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;\nvar ContextMenuRadioItem = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs12(\n ContextMenuPrimitive.RadioItem,\n {\n ref,\n className: cn(\n \"relative flex cursor-default select-none items-center rounded-lg py-1 px-2 text-sm outline-none hover:bg-surface-hovered data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n ),\n ...props,\n children: [\n /* @__PURE__ */ jsx24(\"span\", { className: \"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\", children: /* @__PURE__ */ jsx24(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx24(Circle2, { className: \"h-2 w-2 fill-current\" }) }) }),\n children\n ]\n }\n));\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\nvar ContextMenuLabel = React17.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx24(\n ContextMenuPrimitive.Label,\n {\n ref,\n className: cn(\n \"px-2 py-1.5 text-sm font-semibold text-Colors-Text-Default\",\n inset && \"pl-8\",\n className\n ),\n ...props\n }\n));\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\nvar ContextMenuSeparator = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(\n ContextMenuPrimitive.Separator,\n {\n ref,\n className: cn(\"my-1 h-px bg-[var(--border)]\", className),\n ...props\n }\n));\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\nvar ContextMenuShortcut = ({\n className,\n ...props\n}) => {\n return /* @__PURE__ */ jsx24(\n \"span\",\n {\n className: cn(\n \"ml-auto text-xs tracking-widest text-slate-500 dark:text-slate-400\",\n className\n ),\n ...props\n }\n );\n};\nContextMenuShortcut.displayName = \"ContextMenuShortcut\";\n\n// src/components/count-down.tsx\nimport dayjs from \"dayjs\";\nimport duration from \"dayjs/plugin/duration\";\nimport utc from \"dayjs/plugin/utc\";\nimport { useMemo, useEffect as useEffect4, useState as useState4 } from \"react\";\nimport { jsx as jsx25, jsxs as jsxs13 } from \"react/jsx-runtime\";\ndayjs.extend(duration);\ndayjs.extend(utc);\n\n// src/components/drawer.tsx\nimport * as React18 from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { jsx as jsx26, jsxs as jsxs14 } from \"react/jsx-runtime\";\nfunction Drawer({\n shouldScaleBackground = false,\n ...props\n}) {\n return /* @__PURE__ */ jsx26(\n DrawerPrimitive.Root,\n {\n shouldScaleBackground,\n ...props\n }\n );\n}\nDrawer.displayName = \"Drawer\";\nvar DrawerTrigger = DrawerPrimitive.Trigger;\nvar DrawerPortal = DrawerPrimitive.Portal;\nvar DrawerClose = DrawerPrimitive.Close;\nvar DrawerOverlay = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\n DrawerPrimitive.Overlay,\n {\n ref,\n className: cn(\"fixed inset-0 z-50 bg-alpha-mask-mobile\", className),\n ...props\n }\n));\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\nvar DrawerContent = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs14(DrawerPortal, { children: [\n /* @__PURE__ */ jsx26(DrawerOverlay, {}),\n /* @__PURE__ */ jsx26(\n DrawerPrimitive.Content,\n {\n ref,\n className: cn(\n \"fixed inset-x-0 bottom-0 z-50 flex h-auto max-h-[70%] flex-col rounded-t-2xl bg-Colors-Background-Normal-Primary-Default shadow-modal-default\",\n className\n ),\n ...props,\n children\n }\n )\n] }));\nDrawerContent.displayName = \"DrawerContent\";\nfunction DrawerHeader({\n className,\n ...props\n}) {\n return /* @__PURE__ */ jsx26(\"div\", { className: cn(\"p-4\", className), ...props });\n}\nDrawerHeader.displayName = \"DrawerHeader\";\nfunction DrawerFooter({\n className,\n ...props\n}) {\n return /* @__PURE__ */ jsx26(\"div\", { className: cn(\"p-4\", className), ...props });\n}\nDrawerFooter.displayName = \"DrawerFooter\";\nvar DrawerTitle = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\n DrawerPrimitive.Title,\n {\n ref,\n className: cn(\"text-xl font-normal text-Colors-Text-Default\", className),\n ...props\n }\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\nvar DrawerDescription = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\n DrawerPrimitive.Description,\n {\n ref,\n className: cn(\"text-sm text-Colors-Text-Subtle\", className),\n ...props\n }\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n// src/components/form.tsx\nimport { Slot as Slot4 } from \"@radix-ui/react-slot\";\nimport { cva as cva11 } from \"class-variance-authority\";\nimport * as React20 from \"react\";\nimport {\n Controller,\n FormProvider,\n useFormContext\n} from \"react-hook-form\";\n\n// src/components/label.tsx\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { cva as cva10 } from \"class-variance-authority\";\nimport * as React19 from \"react\";\nimport { jsx as jsx27 } from \"react/jsx-runtime\";\nvar labelVariants = cva10(\n \"text-sm font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-30\"\n);\nvar Label3 = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx27(\n LabelPrimitive.Root,\n {\n ref,\n className: cn(labelVariants(), className),\n ...props\n }\n));\nLabel3.displayName = LabelPrimitive.Root.displayName;\n\n// src/components/form.tsx\nimport { jsx as jsx28, jsxs as jsxs15 } from \"react/jsx-runtime\";\nvar Form = FormProvider;\nvar FormFieldContext = React20.createContext(\n {}\n);\nfunction FormField({ ...props }) {\n return /* @__PURE__ */ jsx28(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx28(Controller, { ...props }) });\n}\nvar useFormField = () => {\n const fieldContext = React20.useContext(FormFieldContext);\n const itemContext = React20.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n const fieldState = getFieldState(fieldContext.name, formState);\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n const { id } = itemContext;\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState\n };\n};\nvar FormItemContext = React20.createContext(\n {}\n);\nvar formLayoutVariants = cva11(\"\", {\n variants: {\n layout: {\n Vertical: \"space-y-1.5\",\n Horizontal: \"flex flex-row items-center space-x-3\"\n }\n },\n defaultVariants: {\n layout: \"Vertical\"\n }\n});\nvar FormItem = React20.forwardRef(\n ({ className, layout, ...props }, ref) => {\n const id = React20.useId();\n const cls = cn(className, formLayoutVariants({ layout }));\n return /* @__PURE__ */ jsx28(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx28(\"div\", { ref, className: cls, ...props }) });\n }\n);\nFormItem.displayName = \"FormItem\";\nvar FormLabel = React20.forwardRef(({ className, required, children, ...props }, ref) => {\n const { formItemId } = useFormField();\n return /* @__PURE__ */ jsxs15(Label3, { ref, className, htmlFor: formItemId, ...props, children: [\n required ? /* @__PURE__ */ jsx28(\"span\", { className: \"text-Colors-Text-Critical-Default mr-1\", children: \"*\" }) : null,\n children\n ] });\n});\nFormLabel.displayName = \"FormLabel\";\nvar FormControl = React20.forwardRef(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n return /* @__PURE__ */ jsx28(\n Slot4,\n {\n ref,\n id: formItemId,\n \"aria-describedby\": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,\n \"aria-invalid\": !!error,\n ...props\n }\n );\n});\nFormControl.displayName = \"FormControl\";\nvar FormDescription = React20.forwardRef(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n return /* @__PURE__ */ jsx28(\n \"p\",\n {\n ref,\n id: formDescriptionId,\n className: cn(\"text-sm text-Colors-Text-Subtler\", className),\n ...props\n }\n );\n});\nFormDescription.displayName = \"FormDescription\";\nvar FormMessage = React20.forwardRef(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message) : children;\n if (!body) {\n return null;\n }\n return /* @__PURE__ */ jsx28(\n \"p\",\n {\n ref,\n id: formMessageId,\n className: cn(\n \"text-sm font-medium text-Colors-Text-Critical-Default\",\n className\n ),\n ...props,\n children: body\n }\n );\n});\nFormMessage.displayName = \"FormMessage\";\n\n// src/components/group.tsx\nimport { jsx as jsx29 } from \"react/jsx-runtime\";\n\n// src/components/guide.tsx\nimport {\n driver\n} from \"driver.js\";\nimport { useEffect as useEffect5, useMemo as useMemo2, useRef as useRef3 } from \"react\";\nimport \"driver.js/dist/driver.css\";\nvar Guide = ({\n steps,\n showProgress = true,\n showOverlay = false,\n hasSkip = true,\n hasCloseBtn = true,\n hasPrevBtn = false,\n hasNextBtn = true,\n allowClose = false,\n skipText = \"Skip\",\n prevBtnText = \"Previous\",\n nextBtnText = \"Next\",\n doneBtnText = \"Done\",\n className,\n onComplete,\n onSkip\n}) => {\n const driverRef = useRef3(null);\n const buttons = useMemo2(() => {\n const buttons2 = [];\n if (hasPrevBtn) {\n buttons2.push(\"previous\");\n }\n if (hasNextBtn) {\n buttons2.push(\"next\");\n }\n if (hasCloseBtn) {\n buttons2.push(\"close\");\n }\n return buttons2;\n }, [hasNextBtn, hasPrevBtn, hasCloseBtn]);\n useEffect5(() => {\n driverRef.current = driver({\n overlayOpacity: showOverlay ? 0.8 : 0,\n animate: true,\n showButtons: buttons?.length > 0 ? buttons : [],\n showProgress,\n steps,\n prevBtnText,\n nextBtnText,\n doneBtnText,\n allowClose,\n progressText: \"{{current}}/{{total}}\",\n onDestroyed: onComplete,\n onPopoverRender: (popover, { config: config2, state }) => {\n const closeBtn = popover.closeButton;\n if (hasCloseBtn && closeBtn) {\n closeBtn.className = cn(\n \"driver-popover-close-btn !text-Colors-Text-Static-White !opacity-70 !w-4.5 !h-4.5 !right-3 !top-3\",\n closeBtn.className\n );\n closeBtn.style.display = \"block\";\n closeBtn.innerHTML = '<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><g clip-path=\"url(#clip0_21201_7803)\"><path d=\"M4.10225 4.10225C4.32192 3.88258 4.67808 3.88258 4.89775 4.10225L9 8.20451L13.1023 4.10225C13.3219 3.88258 13.6781 3.88258 13.8977 4.10225C14.1174 4.32192 14.1174 4.67808 13.8977 4.89775L9.7955 9L13.8977 13.1023C14.1174 13.3219 14.1174 13.6781 13.8977 13.8977C13.6781 14.1174 13.3219 14.1174 13.1023 13.8977L9 9.7955L4.89775 13.8977C4.67808 14.1174 4.32192 14.1174 4.10225 13.8977C3.88258 13.6781 3.88258 13.3219 4.10225 13.1023L8.20451 9L4.10225 4.89775C3.88258 4.67808 3.88258 4.32192 4.10225 4.10225Z\" fill=\"white\" fill-opacity=\"0.7\"/></g><defs><clipPath id=\"clip0_21201_7803\"><rect width=\"18\" height=\"18\" fill=\"white\"/></clipPath></defs></svg>';\n closeBtn.onclick = () => {\n driverRef.current.destroy();\n };\n }\n const content = popover.wrapper;\n if (content) {\n content.className = cn(\n \"!bg-Colors-Utility-Lake-Blue-50 !p-3 !shadow-modal-default\",\n content.className\n );\n const arrow = popover.arrow;\n if (arrow) {\n arrow.className = cn(\n \"border-t-Colors-Utility-Lake-Blue-50\",\n arrow.className\n );\n }\n const title = popover.title;\n const description = popover.description;\n const footer = popover.footer;\n const footerButtons = popover.footerButtons;\n if (title) {\n title.className = cn(\"mb-1\", title.className);\n title.innerHTML = `<p class=\"text-base font-medium text-Colors-Beta-White-100\">${title.innerHTML}</p>`;\n }\n if (description) {\n description.innerHTML = `<p class=\"text-sm !text-Colors-Beta-White-80\">${description.innerHTML}</p>`;\n }\n if (footer) {\n footer.className = cn(\"!mt-3 space-x-1.5\", footer.className);\n }\n if (footer && footerButtons && hasSkip) {\n footer.style.display = \"flex\";\n const skipBtn = document.createElement(\"button\");\n skipBtn.innerText = skipText;\n skipBtn.className = \"driver-popover-skip-btn driver-popover-close-btn !text-Colors-Beta-White-80\";\n skipBtn.addEventListener(\"click\", () => {\n driverRef.current.destroy();\n onSkip && onSkip();\n });\n footerButtons.className = cn(\n \"flex-1 flex justify-end items-center\",\n footerButtons.className\n );\n footerButtons.insertBefore(skipBtn, footerButtons.firstChild);\n }\n popover.previousButton.style.display = hasPrevBtn ? \"block\" : \"none\";\n popover.nextButton.style.display = hasNextBtn ? \"block\" : \"none\";\n popover.closeButton.style.display = hasCloseBtn ? \"block\" : \"none\";\n }\n const { progress } = popover;\n if (progress) {\n progress.className = cn(\n \"text-sm text-Colors-Beta-White-60 opacity-60\",\n progress.className\n );\n }\n }\n });\n driverRef.current.drive();\n return () => {\n if (driverRef.current) {\n driverRef.current.destroy();\n }\n };\n }, [\n steps,\n showProgress,\n hasSkip,\n hasPrevBtn,\n hasNextBtn,\n skipText,\n prevBtnText,\n nextBtnText,\n doneBtnText,\n className,\n onComplete,\n onSkip,\n showOverlay,\n hasCloseBtn,\n buttons\n ]);\n return null;\n};\n\n// src/components/input.tsx\nimport { cva as cva12 } from \"class-variance-authority\";\nimport * as React21 from \"react\";\nimport { jsx as jsx30 } from \"react/jsx-runtime\";\nvar Input = React21.forwardRef(\n ({\n className,\n type,\n autoComplete = \"off\",\n isFull = true,\n rounded = \"lg\",\n size = \"sm\",\n border = \"default\",\n outline = \"default\",\n background = \"default\",\n shadow = \"default\",\n ...props\n }, ref) => {\n const { readOnly } = props;\n const inputVariants = cva12(\"\", {\n variants: {\n rounded: {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n default: \"rounded\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n xl: \"rounded-xl\",\n \"2xl\": \"rounded-2xl\",\n \"3xl\": \"rounded-3xl\",\n full: \"rounded-full\"\n },\n size: {\n lg: \"h-14\",\n md: \"h-11\",\n sm: \"h-10\",\n xs: \"h-9\"\n },\n border: {\n none: \"border-none shadow-none\",\n default: \"border border-cc-Input-border-default \"\n },\n outline: {\n none: \"outline-none\",\n default: \"focus-visible:outline-none aria-[invalid=true]:focus-visible:ring-error focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-0\"\n },\n background: {\n none: \"bg-transparent\",\n default: \"bg-cc-Input-bg-default hover:bg-cc-Input-bg-hover disabled:bg-cc-Input-bg-disabled\"\n },\n shadow: {\n none: \"shadow-none\",\n default: \"\"\n }\n },\n defaultVariants: {\n rounded: \"lg\",\n size: \"sm\",\n border: \"default\",\n outline: \"default\",\n background: \"default\"\n }\n });\n return /* @__PURE__ */ jsx30(\n \"input\",\n {\n type,\n className: cn(\n \"flex space-x-2 p-3 text-base text-Colors-Text-Default placeholder:text-Colors-Text-Subtlest ring-offset-cc-Focus-Rings-Brand-default\",\n \"aria-[invalid=true]:border-Colors-Border-Critical aria-[invalid=true]:hover:bg-Colors-Background-Critical-Subtle\",\n \"file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:opacity-30\",\n inputVariants({ rounded, size, border, outline, background, shadow }),\n readOnly && \"focus-visible:ring-offset-0 focus-visible:ring-transparent\",\n isFull && \"w-full\",\n className\n ),\n autoComplete,\n ref,\n ...props\n }\n );\n }\n);\nInput.displayName = \"Input\";\n\n// src/components/link.tsx\nimport LinkComponent from \"next/link\";\nimport { useMemo as useMemo3 } from \"react\";\n\n// src/common/hooks/useNativeBridge.ts\nimport { useCallback as useCallback2 } from \"react\";\nfunction useNativeBridge() {\n const callNative = useCallback2((action, data) => {\n if (isIosApp() && window.webkit?.messageHandlers?.reactNative) {\n window.webkit.messageHandlers.reactNative.postMessage({\n action,\n data\n });\n }\n if (typeof window !== \"undefined\" && window.ReactNativeWebView) {\n window.ReactNativeWebView.postMessage(\n JSON.stringify({\n action,\n data\n })\n );\n }\n }, []);\n const getIosUrl = useCallback2((path) => {\n return path;\n }, []);\n const nativeGoBack = useCallback2(() => {\n callNative(\"goBack\");\n }, [callNative]);\n return {\n callNative,\n getIosUrl,\n nativeGoBack\n };\n}\n\n// src/components/link.tsx\nimport { useMedia as useMedia3 } from \"react-use\";\nimport { jsx as jsx31 } from \"react/jsx-runtime\";\nfunction Link({\n className,\n href,\n scroll = false,\n replace = false,\n prefetch = true,\n back = false,\n children,\n onClick,\n ...props\n}) {\n const path = typeof href === \"string\" ? href : `${href.pathname}`;\n const externalLink = /^(https?:\\/\\/)/.test(path);\n const { getIosUrl, nativeGoBack } = useNativeBridge();\n const isIos = isClient() && isIosApp();\n const isMobile2 = useMedia3(\"(max-width: 768px)\");\n const pathname = useMemo3(() => {\n if (externalLink) return path;\n let formatPath = path;\n const isMobPath = path.startsWith(\"/m/\");\n if (isMobile2) {\n formatPath = isMobPath ? path : `/m${path}`;\n } else {\n formatPath = isMobPath ? path.slice(2) : path;\n }\n return isIos ? getIosUrl(formatPath) || formatPath : formatPath;\n }, [path]);\n const Com = isIos ? \"a\" : LinkComponent;\n return /* @__PURE__ */ jsx31(\n Com,\n {\n href: pathname,\n scroll,\n replace,\n prefetch,\n onClick: (e) => {\n if (isIos && back) {\n e.stopPropagation();\n e.preventDefault();\n nativeGoBack();\n } else {\n onClick?.(e);\n }\n },\n className,\n rel: externalLink ? \"nofollow,noreferrer\" : \"dofollow\",\n target: externalLink ? \"_blank\" : void 0,\n ...props,\n children\n }\n );\n}\nvar link_default = Link;\n\n// src/components/masonry.tsx\nimport { indexOf, min } from \"lodash-es\";\nimport { Children, useEffect as useEffect6, useState as useState5 } from \"react\";\nimport { jsx as jsx32 } from \"react/jsx-runtime\";\nimport { createElement } from \"react\";\n\n// src/components/menubar.tsx\nimport * as React23 from \"react\";\nimport * as MenubarPrimitive from \"@radix-ui/react-menubar\";\nimport { Check as Check4, ChevronRight as ChevronRight3, Circle as Circle3 } from \"lucide-react\";\nimport { jsx as jsx33, jsxs as jsxs16 } from \"react/jsx-runtime\";\nvar MenubarMenu = MenubarPrimitive.Menu;\nvar MenubarGroup = MenubarPrimitive.Group;\nvar MenubarPortal = MenubarPrimitive.Portal;\nvar MenubarSub = MenubarPrimitive.Sub;\nvar MenubarRadioGroup = MenubarPrimitive.RadioGroup;\nvar Menubar = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(\n MenubarPrimitive.Root,\n {\n ref,\n className: cn(\n \"flex h-10 items-center space-x-1 rounded-md border border-slate-200 bg-white p-1 dark:border-slate-800 dark:bg-slate-950\",\n className\n ),\n ...props\n }\n));\nMenubar.displayName = MenubarPrimitive.Root.displayName;\nvar MenubarTrigger = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(\n MenubarPrimitive.Trigger,\n {\n ref,\n className: cn(\n \"flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-slate-100 focus:text-slate-900 data-[state=open]:bg-slate-100 data-[state=open]:text-slate-900 dark:focus:bg-slate-800 dark:focus:text-slate-50 dark:data-[state=open]:bg-slate-800 dark:data-[state=open]:text-slate-50\",\n className\n ),\n ...props\n }\n));\nMenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;\nvar MenubarSubTrigger = React23.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs16(\n MenubarPrimitive.SubTrigger,\n {\n ref,\n className: cn(\n \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-slate-100 focus:text-slate-900 data-[state=open]:bg-slate-100 data-[state=open]:text-slate-900 dark:focus:bg-slate-800 dark:focus:text-slate-50 dark:data-[state=open]:bg-slate-800 dark:data-[state=open]:text-slate-50\",\n inset && \"pl-8\",\n className\n ),\n ...props,\n children: [\n children,\n /* @__PURE__ */ jsx33(ChevronRight3, { className: \"ml-auto h-4 w-4\" })\n ]\n }\n));\nMenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;\nvar MenubarSubContent = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(\n MenubarPrimitive.SubContent,\n {\n ref,\n className: cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border border-slate-200 bg-white p-1 text-slate-950 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50\",\n className\n ),\n ...props\n }\n));\nMenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;\nvar MenubarContent = React23.forwardRef(\n ({ className, align = \"start\", alignOffset = -4, sideOffset = 8, ...props }, ref) => /* @__PURE__ */ jsx33(MenubarPrimitive.Portal, { children: /* @__PURE__ */ jsx33(\n MenubarPrimitive.Content,\n {\n ref,\n align,\n alignOffset,\n sideOffset,\n className: cn(\n \"z-50 min-w-[12rem] overflow-hidden rounded-md border border-slate-200 bg-white p-1 text-slate-950 shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50\",\n className\n ),\n ...props\n }\n ) })\n);\nMenubarContent.displayName = MenubarPrimitive.Content.displayName;\nvar MenubarItem = React23.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx33(\n MenubarPrimitive.Item,\n {\n ref,\n className: cn(\n \"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50\",\n inset && \"pl-8\",\n className\n ),\n ...props\n }\n));\nMenubarItem.displayName = MenubarPrimitive.Item.displayName;\nvar MenubarCheckboxItem = React23.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs16(\n MenubarPrimitive.CheckboxItem,\n {\n ref,\n className: cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50\",\n className\n ),\n checked,\n ...props,\n children: [\n /* @__PURE__ */ jsx33(\"span\", { className: \"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\", children: /* @__PURE__ */ jsx33(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx33(Check4, { className: \"h-4 w-4\" }) }) }),\n children\n ]\n }\n));\nMenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;\nvar MenubarRadioItem = React23.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs16(\n MenubarPrimitive.RadioItem,\n {\n ref,\n className: cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50\",\n className\n ),\n ...props,\n children: [\n /* @__PURE__ */ jsx33(\"span\", { className: \"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\", children: /* @__PURE__ */ jsx33(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx33(Circle3, { className: \"h-2 w-2 fill-current\" }) }) }),\n children\n ]\n }\n));\nMenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;\nvar MenubarLabel = React23.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx33(\n MenubarPrimitive.Label,\n {\n ref,\n className: cn(\n \"px-2 py-1.5 text-sm font-semibold\",\n inset && \"pl-8\",\n className\n ),\n ...props\n }\n));\nMenubarLabel.displayName = MenubarPrimitive.Label.displayName;\nvar MenubarSeparator = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(\n MenubarPrimitive.Separator,\n {\n ref,\n className: cn(\"-mx-1 my-1 h-px bg-slate-100 dark:bg-slate-800\", className),\n ...props\n }\n));\nMenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;\nvar MenubarShortcut = ({\n className,\n ...props\n}) => {\n return /* @__PURE__ */ jsx33(\n \"span\",\n {\n className: cn(\n \"ml-auto text-xs tracking-widest text-slate-500 dark:text-slate-400\",\n className\n ),\n ...props\n }\n );\n};\nMenubarShortcut.displayname = \"MenubarShortcut\";\n\n// src/components/modal.tsx\nimport CheckCircleIcon from \"@heroicons/react/24/outline/esm/CheckCircleIcon\";\nimport ExclamationTriangleIcon from \"@heroicons/react/24/outline/esm/ExclamationTriangleIcon\";\nimport InformationCircleIcon from \"@heroicons/react/24/outline/esm/InformationCircleIcon\";\nimport XCircleIcon from \"@heroicons/react/24/outline/esm/XCircleIcon\";\nimport XMarkIcon from \"@heroicons/react/24/outline/esm/XMarkIcon\";\nimport * as DialogPrimitive2 from \"@radix-ui/react-dialog\";\n\n// node_modules/@radix-ui/react-focus-scope/dist/index.mjs\nimport * as React26 from \"react\";\n\n// node_modules/@radix-ui/react-compose-refs/dist/index.mjs\nimport * as React24 from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React24.useCallback(composeRefs(...refs), refs);\n}\n\n// node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs\nimport * as React25 from \"react\";\nfunction useCallbackRef(callback) {\n const callbackRef = React25.useRef(callback);\n React25.useEffect(() => {\n callbackRef.current = callback;\n });\n return React25.useMemo(() => (...args) => callbackRef.current?.(...args), []);\n}\n\n// node_modules/@radix-ui/react-focus-scope/dist/index.mjs\nimport { jsx as jsx34 } from \"react/jsx-runtime\";\nvar AUTOFOCUS_ON_MOUNT = \"focusScope.autoFocusOnMount\";\nvar AUTOFOCUS_ON_UNMOUNT = \"focusScope.autoFocusOnUnmount\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar FOCUS_SCOPE_NAME = \"FocusScope\";\nvar FocusScope = React26.forwardRef((props, forwardedRef) => {\n const {\n loop = false,\n trapped = false,\n onMountAutoFocus: onMountAutoFocusProp,\n onUnmountAutoFocus: onUnmountAutoFocusProp,\n ...scopeProps\n } = props;\n const [container, setContainer] = React26.useState(null);\n const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);\n const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);\n const lastFocusedElementRef = React26.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));\n const focusScope = React26.useRef({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n }\n }).current;\n React26.useEffect(() => {\n if (trapped) {\n let handleFocusIn2 = function(event) {\n if (focusScope.paused || !container) return;\n const target = event.target;\n if (container.contains(target)) {\n lastFocusedElementRef.current = target;\n } else {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleFocusOut2 = function(event) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget;\n if (relatedTarget === null) return;\n if (!container.contains(relatedTarget)) {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleMutations2 = function(mutations) {\n const focusedElement = document.activeElement;\n if (focusedElement !== document.body) return;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) focus(container);\n }\n };\n var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;\n document.addEventListener(\"focusin\", handleFocusIn2);\n document.addEventListener(\"focusout\", handleFocusOut2);\n const mutationObserver = new MutationObserver(handleMutations2);\n if (container) mutationObserver.observe(container, { childList: true, subtree: true });\n return () => {\n document.removeEventListener(\"focusin\", handleFocusIn2);\n document.removeEventListener(\"focusout\", handleFocusOut2);\n mutationObserver.disconnect();\n };\n }\n }, [trapped, container, focusScope.paused]);\n React26.useEffect(() => {\n if (container) {\n focusScopesStack.add(focusScope);\n const previouslyFocusedElement = document.activeElement;\n const hasFocusedCandidate = container.contains(previouslyFocusedElement);\n if (!hasFocusedCandidate) {\n const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n container.dispatchEvent(mountEvent);\n if (!mountEvent.defaultPrevented) {\n focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });\n if (document.activeElement === previouslyFocusedElement) {\n focus(container);\n }\n }\n }\n return () => {\n container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n setTimeout(() => {\n const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n container.dispatchEvent(unmountEvent);\n if (!unmountEvent.defaultPrevented) {\n focus(previouslyFocusedElement ?? document.body, { select: true });\n }\n container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n focusScopesStack.remove(focusScope);\n }, 0);\n };\n }\n }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);\n const handleKeyDown = React26.useCallback(\n (event) => {\n if (!loop && !trapped) return;\n if (focusScope.paused) return;\n const isTabKey = event.key === \"Tab\" && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement;\n if (isTabKey && focusedElement) {\n const container2 = event.currentTarget;\n const [first, last] = getTabbableEdges(container2);\n const hasTabbableElementsInside = first && last;\n if (!hasTabbableElementsInside) {\n if (focusedElement === container2) event.preventDefault();\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n if (loop) focus(first, { select: true });\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n if (loop) focus(last, { select: true });\n }\n }\n }\n },\n [loop, trapped, focusScope.paused]\n );\n return /* @__PURE__ */ jsx34(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });\n});\nFocusScope.displayName = FOCUS_SCOPE_NAME;\nfunction focusFirst(candidates, { select = false } = {}) {\n const previouslyFocusedElement = document.activeElement;\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (document.activeElement !== previouslyFocusedElement) return;\n }\n}\nfunction getTabbableEdges(container) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last];\n}\nfunction getTabbableCandidates(container) {\n const nodes = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node) => {\n const isHiddenInput = node.tagName === \"INPUT\" && node.type === \"hidden\";\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }\n });\n while (walker.nextNode()) nodes.push(walker.currentNode);\n return nodes;\n}\nfunction findVisible(elements, container) {\n for (const element of elements) {\n if (!isHidden(element, { upTo: container })) return element;\n }\n}\nfunction isHidden(node, { upTo }) {\n if (getComputedStyle(node).visibility === \"hidden\") return true;\n while (node) {\n if (upTo !== void 0 && node === upTo) return false;\n if (getComputedStyle(node).display === \"none\") return true;\n node = node.parentElement;\n }\n return false;\n}\nfunction isSelectableInput(element) {\n return element instanceof HTMLInputElement && \"select\" in element;\n}\nfunction focus(element, { select = false } = {}) {\n if (element && element.focus) {\n const previouslyFocusedElement = document.activeElement;\n element.focus({ preventScroll: true });\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select)\n element.select();\n }\n}\nvar focusScopesStack = createFocusScopesStack();\nfunction createFocusScopesStack() {\n let stack = [];\n return {\n add(focusScope) {\n const activeFocusScope = stack[0];\n if (focusScope !== activeFocusScope) {\n activeFocusScope?.pause();\n }\n stack = arrayRemove(stack, focusScope);\n stack.unshift(focusScope);\n },\n remove(focusScope) {\n stack = arrayRemove(stack, focusScope);\n stack[0]?.resume();\n }\n };\n}\nfunction arrayRemove(array, item) {\n const updatedArray = [...array];\n const index = updatedArray.indexOf(item);\n if (index !== -1) {\n updatedArray.splice(index, 1);\n }\n return updatedArray;\n}\nfunction removeLinks(items) {\n return items.filter((item) => item.tagName !== \"A\");\n}\n\n// src/components/modal.tsx\nimport { cva as cva13 } from \"class-variance-authority\";\nimport * as React27 from \"react\";\nimport { Drawer as DrawerPrimitive2 } from \"vaul\";\nimport { useMedia as useMedia4 } from \"react-use\";\nimport { Fragment as Fragment6, jsx as jsx35, jsxs as jsxs17 } from \"react/jsx-runtime\";\nvar ModalOverlay = React27.forwardRef(({ className, onClick, ...props }, ref) => /* @__PURE__ */ jsx35(\n DialogPrimitive2.Overlay,\n {\n ref,\n className: cn(\n \"fixed inset-0 z-50 bg-Colors-Background-Utilities-Overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n ),\n onClick: (e) => {\n onClick && onClick(e);\n },\n ...props\n }\n));\nModalOverlay.displayName = DialogPrimitive2.Overlay.displayName;\nvar DrawerOverlay2 = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx35(\n DrawerPrimitive2.Overlay,\n {\n ref,\n className: cn(\n \"fixed inset-0 z-50 bg-Colors-Background-Utilities-Overlay\",\n className\n ),\n ...props\n }\n));\nDrawerOverlay2.displayName = DrawerPrimitive2.Overlay.displayName;\nvar ModalContent = React27.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx35(\n DialogPrimitive2.Content,\n {\n className: cn(\n \"absolute left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2 !touch-auto !select-text\",\n \"duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] focus:outline-none\",\n className\n ),\n ...props,\n children\n }\n));\nvar ModalRoot = ({ children, ...props }) => /* @__PURE__ */ jsx35(DialogPrimitive2.Dialog, { ...props, children: /* @__PURE__ */ jsx35(DialogPrimitive2.Portal, { children }) });\nvar ModalTitle = React27.forwardRef(({ className, ...props }, ref) => {\n const isMobile2 = useMedia4(\"(max-width: 768px)\");\n if (isMobile2) {\n return /* @__PURE__ */ jsx35(\n DrawerPrimitive2.Title,\n {\n ref,\n ...props,\n className: cn(\n \"text-xl text-Colors-Text-Default font-medium line-clamp-1\",\n className\n )\n }\n );\n }\n return /* @__PURE__ */ jsx35(\n DialogPrimitive2.Title,\n {\n ref,\n ...props,\n className: cn(\n \"text-xl text-Colors-Text-Default font-medium line-clamp-1\",\n className\n )\n }\n );\n});\nModalTitle.displayName = DialogPrimitive2.Title.displayName;\nvar modalVariants = cva13(\"\", {\n variants: {\n size: {\n lg: \"w-[750px] max-h-[640px]\",\n md: \"w-[620px] max-h-[640px]\",\n sm: \"w-[380px] max-h-[640px]\"\n },\n zIndex: {\n 9: \"z-[9]\",\n 99: \"z-[99]\",\n 999: \"z-[999]\",\n 9999: \"z-[9999]\"\n }\n },\n defaultVariants: {\n size: \"lg\",\n zIndex: 99\n }\n});\nvar Modal = ({\n title,\n description,\n size = \"lg\",\n zIndex = 99,\n hideClose = false,\n overlayClose = true,\n modalOnly = true,\n contentClassName,\n overlayClassName,\n iconClassName,\n closeClassName,\n fullScreen = false,\n focusScopeOptions,\n isLogin = false,\n isNotification = false,\n isHorizontal = false,\n state,\n showCancel = true,\n confirmLoading = false,\n cancelText,\n confirmText,\n children,\n autoFocus = false,\n onClose,\n onConfirm,\n ...props\n}) => {\n const isMobile2 = useMedia4(\"(max-width: 768px)\");\n if (isMobile2 && !modalOnly && !isNotification) {\n const drawerContent = /* @__PURE__ */ jsxs17(\n DrawerPrimitive2.Content,\n {\n className: cn(\n \"fixed inset-x-0 bottom-0 z-50 h-auto overflow-hidden no-scrollbar border-Colors-Border-Opaque bg-Colors-Background-Normal-Secondary-Alt shadow-modal-default focus:outline-none\",\n fullScreen ? \"rounded-t-none max-h-full\" : \"rounded-t-2xl max-h-[85vh]\",\n contentClassName\n ),\n onOpenAutoFocus: (e) => {\n !autoFocus && e.preventDefault();\n },\n children: [\n title ? /* @__PURE__ */ jsx35(ModalHeader, { children: /* @__PURE__ */ jsx35(ModalTitle, { children: title }) }) : /* @__PURE__ */ jsx35(ModalTitle, { className: \"hidden\" }),\n /* @__PURE__ */ jsx35(\n \"div\",\n {\n className: cn(\n isLogin ? \"overflow-y-scroll\" : \"overflow-y-auto\",\n fullScreen ? title ? \"max-h-[calc(100vh-60px)]\" : \"max-h-[100vh]\" : title ? \"max-h-[calc(85vh-60px)]\" : \"max-h-[85vh]\"\n ),\n children\n }\n ),\n !hideClose && /* @__PURE__ */ jsx35(DrawerPrimitive2.Close, { asChild: true, children: /* @__PURE__ */ jsxs17(\n \"div\",\n {\n className: cn(\"absolute right-4 top-3\", closeClassName),\n onClick: () => {\n onClose && onClose();\n },\n children: [\n /* @__PURE__ */ jsx35(\n IconButton,\n {\n icon: XMarkIcon,\n size: \"md\",\n variant: \"plain\",\n color: \"default\",\n className: iconClassName\n }\n ),\n /* @__PURE__ */ jsx35(\"span\", { className: \"sr-only\", children: \"Close\" })\n ]\n }\n ) })\n ]\n }\n );\n return /* @__PURE__ */ jsx35(\n DrawerPrimitive2.Root,\n {\n ...props,\n repositionInputs: false,\n onOpenChange: (open) => {\n if (!open) {\n onClose && onClose();\n }\n },\n children: /* @__PURE__ */ jsxs17(DrawerPrimitive2.Portal, { children: [\n /* @__PURE__ */ jsx35(\n DrawerOverlay2,\n {\n onClick: () => {\n overlayClose && onClose && onClose();\n },\n className: overlayClassName\n }\n ),\n focusScopeOptions ? /* @__PURE__ */ jsx35(FocusScope, { ...focusScopeOptions, children: drawerContent }) : drawerContent\n ] })\n }\n );\n }\n const renderIcon2 = (state2) => {\n switch (state2) {\n case \"info\":\n return /* @__PURE__ */ jsx35(InformationCircleIcon, { className: \"text-cc-Icon-Featured-icon-fg-Info w-6 h-6\" });\n case \"success\":\n return /* @__PURE__ */ jsx35(CheckCircleIcon, { className: \"text-cc-Icon-Featured-icon-fg-Success w-6 h-6\" });\n case \"warning\":\n return /* @__PURE__ */ jsx35(ExclamationTriangleIcon, { className: \"text-cc-Icon-Featured-icon-fg-Warning w-6 h-6\" });\n case \"error\":\n return /* @__PURE__ */ jsx35(XCircleIcon, { className: \"text-cc-Icon-Featured-icon-fg-Error w-6 h-6\" });\n }\n };\n const getBackgroundColor = (state2) => {\n switch (state2) {\n case \"info\":\n return \"bg-Colors-Background-Info-Default\";\n case \"success\":\n return \"bg-Colors-Background-Success-Default\";\n case \"warning\":\n return \"bg-Colors-Background-Warning-Default\";\n case \"error\":\n return \"bg-Colors-Background-Critical-Default\";\n }\n };\n const dialogContent = /* @__PURE__ */ jsxs17(\n ModalContent,\n {\n className: cn(\n \"rounded-2xl border-Colors-Border-Opaque bg-Colors-Background-Normal-Primary-Default shadow-modal-default overflow-hidden\",\n !isMobile2 ? modalVariants({ size, zIndex }) : isLogin ? \"w-[90%]\" : \"w-[80%]\",\n isNotification && \"w-[312px] md:w-[380px]\",\n contentClassName\n ),\n onOpenAutoFocus: (e) => {\n !autoFocus && e.preventDefault();\n },\n children: [\n isNotification ? /* @__PURE__ */ jsxs17(Fragment6, { children: [\n /* @__PURE__ */ jsx35(ModalHeader, { className: cn(isNotification && \"border-none !pb-3\"), children: state && /* @__PURE__ */ jsx35(\n \"div\",\n {\n className: cn(\n \"flex items-center justify-center w-10 h-10 rounded-full flex-shrink-0 flex-grow-0\",\n getBackgroundColor(state)\n ),\n children: renderIcon2(state)\n }\n ) }),\n /* @__PURE__ */ jsxs17(\"div\", { className: \"space-y-1.5\", children: [\n title ? /* @__PURE__ */ jsx35(\"div\", { className: \"px-5\", children: /* @__PURE__ */ jsx35(Display, { size: \"sm\", children: title }) }) : null,\n children || (description ? /* @__PURE__ */ jsx35(\"div\", { className: \"px-5\", children: /* @__PURE__ */ jsx35(Text, { size: \"sm\", weight: \"regular\", children: description }) }) : null)\n ] }),\n /* @__PURE__ */ jsxs17(\n ModalFooter,\n {\n className: cn(\n \"gap-x-5 min-h-[76px] p-5 border-none justify-center w-full\"\n ),\n children: [\n showCancel && /* @__PURE__ */ jsx35(Button, { variant: \"tertiary\", onClick: onClose, className: \"flex-1\", children: cancelText || \"Cancel\" }),\n /* @__PURE__ */ jsx35(\n Button,\n {\n variant: \"primary\",\n onClick: onConfirm,\n loading: confirmLoading,\n color: state === \"error\" ? \"error\" : \"default\",\n className: \"flex-1\",\n children: confirmText || \"Confirm\"\n }\n )\n ]\n }\n )\n ] }) : /* @__PURE__ */ jsxs17(Fragment6, { children: [\n title ? /* @__PURE__ */ jsx35(ModalHeader, { children: /* @__PURE__ */ jsx35(ModalTitle, { children: title }) }) : /* @__PURE__ */ jsx35(ModalTitle, { className: \"hidden\" }),\n children\n ] }),\n !hideClose && /* @__PURE__ */ jsx35(DialogPrimitive2.Close, { asChild: true, children: /* @__PURE__ */ jsxs17(\n \"div\",\n {\n onClick: () => {\n onClose && onClose();\n },\n className: cn(\n \"absolute right-4 top-4\",\n isNotification && \"top-5\",\n closeClassName\n ),\n children: [\n /* @__PURE__ */ jsx35(\n IconButton,\n {\n icon: XMarkIcon,\n size: \"md\",\n variant: \"plain\",\n color: \"default\",\n className: iconClassName\n }\n ),\n /* @__PURE__ */ jsx35(\"span\", { className: \"sr-only\", children: \"Close\" })\n ]\n }\n ) })\n ]\n }\n );\n return /* @__PURE__ */ jsxs17(ModalRoot, { ...props, children: [\n /* @__PURE__ */ jsx35(\n ModalOverlay,\n {\n onClick: () => {\n overlayClose && onClose && onClose();\n },\n className: overlayClassName\n }\n ),\n focusScopeOptions ? /* @__PURE__ */ jsx35(FocusScope, { ...focusScopeOptions, children: dialogContent }) : dialogContent\n ] });\n};\nfunction ModalHeader({\n className,\n children,\n ...props\n}) {\n return /* @__PURE__ */ jsx35(\n \"div\",\n {\n className: cn(\n \"border-b border-Colors-Border-Default flex flex-col py-4 md:py-5 px-4 justify-center\",\n className\n ),\n ...props,\n children\n }\n );\n}\nModalHeader.displayName = \"ModalHeader\";\nfunction ModalFooter({\n className,\n children,\n ...props\n}) {\n return /* @__PURE__ */ jsx35(\n \"div\",\n {\n className: cn(\n \"border-t border-Colors-Border-Default flex justify-end p-4\",\n className\n ),\n ...props,\n children\n }\n );\n}\nModalFooter.displayName = \"ModalFooter\";\nfunction ModalBody({\n className,\n children,\n ...props\n}) {\n return /* @__PURE__ */ jsx35(\"div\", { className: cn(\"py-3\", className), ...props, children });\n}\nModalBody.displayName = \"ModalBody\";\n\n// src/components/search-bar.tsx\nimport MagnifyingGlassIcon from \"@heroicons/react/24/outline/esm/MagnifyingGlassIcon\";\nimport XMarkIcon2 from \"@heroicons/react/24/outline/esm/XMarkIcon\";\nimport { cva as cva14 } from \"class-variance-authority\";\nimport * as React28 from \"react\";\nimport { useEffect as useEffect9 } from \"react\";\nimport { jsx as jsx36, jsxs as jsxs18 } from \"react/jsx-runtime\";\nvar searchBarVariants = cva14(\"rounded-md\", {\n variants: {\n size: {\n md: \"h-11\",\n sm: \"h-10\",\n xs: \"h-9\"\n }\n },\n defaultVariants: {\n size: \"sm\"\n }\n});\nfunction SearchBar({\n className,\n inputClassName,\n placeholder,\n type,\n size,\n readOnly,\n searchValue,\n roundedFill,\n onSearchChange,\n onValueChange,\n ...props\n}) {\n const [value, setValue] = React28.useState(\"\");\n useEffect9(() => {\n setValue(searchValue || \"\");\n }, [searchValue]);\n return /* @__PURE__ */ jsxs18(\n \"div\",\n {\n className: cn(\"relative w-full\", searchBarVariants({ size }), className),\n children: [\n /* @__PURE__ */ jsx36(\n Icon,\n {\n component: MagnifyingGlassIcon,\n size: \"lg\",\n className: \"absolute top-1/2 -translate-y-1/2 left-3 z-10 text-Colors-Foreground-Subtlest cursor-pointer\",\n onClick: () => {\n onSearchChange(value);\n }\n }\n ),\n /* @__PURE__ */ jsx36(\n Input,\n {\n type,\n placeholder,\n rounded: roundedFill ? \"full\" : \"md\",\n size,\n className: cn(\n \"relative w-full px-9 flex space-x-2 text-base shadow-none placeholder:text-Colors-Text-Subtlest\",\n {\n \"focus-visible:ring-transparent\": readOnly\n },\n \"border-cc-Search-Bar-border-default bg-cc-Search-Bar-bg-default hover:bg-cc-Search-Bar-bg-hover focus-visible:shadow-cc-Focus-Rings-Brand-default\",\n className\n ),\n value,\n onChange: (e) => {\n setValue(e.target.value);\n onValueChange?.(e.target.value);\n },\n onKeyDown: (e) => {\n if (e.key === \"Enter\" && !(e.shiftKey || e.altKey)) {\n e.target.blur();\n onSearchChange(value);\n }\n },\n ...props\n }\n ),\n value && /* @__PURE__ */ jsx36(\n IconButton,\n {\n className: \"absolute top-1/2 -translate-y-1/2 right-1.5 z-10 rounded-full text-Colors-Foreground-Subtle\",\n onClick: () => {\n onSearchChange(\"\");\n setValue(\"\");\n onValueChange?.(\"\");\n },\n size: \"sm\",\n variant: \"plain\",\n icon: XMarkIcon2\n }\n )\n ]\n }\n );\n}\nSearchBar.displayName = \"SearchBar\";\n\n// src/components/energy-progress.tsx\nimport Image3 from \"next/image\";\n\n// src/components/progress.tsx\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\";\nimport { jsx as jsx37, jsxs as jsxs19 } from \"react/jsx-runtime\";\nvar Progress = ({\n value,\n max: max2,\n className,\n indicatorClassName,\n label,\n height = 20,\n width = 75,\n minWidth = 60,\n maxWidth = 220\n}) => {\n const widthValue = `${clamp(\n width + (Math.max(max2, value).toString().length - 3) * 12,\n minWidth,\n maxWidth\n )}px`;\n return /* @__PURE__ */ jsxs19(\n ProgressPrimitive.Root,\n {\n value,\n max: Math.max(value, max2),\n className: cn(\"relative overflow-hidden\", className),\n style: { height: `${height}px`, width: widthValue },\n children: [\n /* @__PURE__ */ jsx37(\n ProgressPrimitive.Indicator,\n {\n className: cn(\"h-full transition-all\", indicatorClassName),\n style: { width: `${value / max2 * 100}%` }\n }\n ),\n label && /* @__PURE__ */ jsx37(\"div\", { className: \"absolute inset-0 flex items-center justify-center px-1\", children: label })\n ]\n }\n );\n};\n\n// src/components/energy-progress.tsx\nimport { jsx as jsx38, jsxs as jsxs20 } from \"react/jsx-runtime\";\nfunction EnergyProgress(props) {\n const { energy, dailyEnergy, hoverText, className } = props;\n return /* @__PURE__ */ jsxs20(\"div\", { className: cn(\"flex items-center relative\", className), children: [\n /* @__PURE__ */ jsx38(\"div\", { className: \"absolute left-[-20px] justify-center items-center w-6 h-6 border border-solid border-[#F3D42D] dark:border-[#A48F07] bg-white dark:bg-[#24210B] rounded-[6px] z-10\", children: /* @__PURE__ */ jsx38(\n Image3,\n {\n src: getAssetsUrl(\"image/bot/tag/20231214/1719340128612116720.png\"),\n alt: \"energy\",\n width: 22,\n height: 22\n }\n ) }),\n /* @__PURE__ */ jsx38(\n Tooltip,\n {\n description: hoverText ?? `Utilize battery to chat with bots or set up your own bot. Recharge \\u26A1\\uFE0F${Math.floor(\n dailyEnergy / 24\n )} per hour when battery is below ${dailyEnergy}`,\n side: \"bottom\",\n align: \"end\",\n sideOffset: 16,\n alignOffset: -16,\n showArrow: false,\n children: /* @__PURE__ */ jsx38(\n Progress,\n {\n value: energy,\n max: dailyEnergy,\n className: \"rounded-[6px] rounded-l-none border border-solid border-cc-Energy-border-default bg-cc-Energy-bg-alt flex items-center justify-start\",\n indicatorClassName: \"bg-cc-Energy-bg-on\",\n label: /* @__PURE__ */ jsx38(\"span\", { className: \"text-cc-Energy-fg-default font-medium text-xs ml-[2px]\", children: `${energy}/${dailyEnergy}` })\n }\n )\n }\n )\n ] });\n}\nvar energy_progress_default = EnergyProgress;\n\n// src/components/navigation-bar.tsx\nimport { Fragment as Fragment7, jsx as jsx39, jsxs as jsxs21 } from \"react/jsx-runtime\";\nfunction NavigationBar({\n showSearchBar = true,\n searchValue,\n searchPlaceholder,\n title,\n children,\n energy = 0,\n dailyEnergy,\n onSearchChange\n}) {\n return /* @__PURE__ */ jsxs21(\n \"div\",\n {\n className: cn(\n \"relative w-full flex flex-col justify-between items-center px-4 md:px-6\"\n ),\n children: [\n /* @__PURE__ */ jsxs21(\"div\", { className: \"w-full pt-5 md:pt-6 pb-1 md:pb-3 flex justify-between items-center\", children: [\n /* @__PURE__ */ jsx39(\"div\", { className: \"flex-1 text-start\", children: /* @__PURE__ */ jsx39(Display, { size: \"md\", children: title }) }),\n children ? /* @__PURE__ */ jsx39(\"div\", { className: \"w-fit\", children }) : /* @__PURE__ */ jsx39(Fragment7, { children: dailyEnergy ? /* @__PURE__ */ jsx39(\n energy_progress_default,\n {\n dailyEnergy,\n energy,\n className: \"flex relative items-center flex-shrink-0\"\n }\n ) : null })\n ] }),\n showSearchBar && /* @__PURE__ */ jsx39(\"div\", { className: \"w-full py-2 md:py-0\", children: /* @__PURE__ */ jsx39(\n SearchBar,\n {\n placeholder: searchPlaceholder,\n searchValue,\n onSearchChange: (value) => onSearchChange && onSearchChange(value)\n }\n ) })\n ]\n }\n );\n}\n\n// node_modules/decimal.js/decimal.mjs\nvar EXP_LIMIT = 9e15;\nvar MAX_DIGITS = 1e9;\nvar NUMERALS = \"0123456789abcdef\";\nvar LN10 = \"2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058\";\nvar PI = \"3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789\";\nvar DEFAULTS = {\n // These values must be integers within the stated ranges (inclusive).\n // Most of these values can be changed at run-time using the `Decimal.config` method.\n // The maximum number of significant digits of the result of a calculation or base conversion.\n // E.g. `Decimal.config({ precision: 20 });`\n precision: 20,\n // 1 to MAX_DIGITS\n // The rounding mode used when rounding to `precision`.\n //\n // ROUND_UP 0 Away from zero.\n // ROUND_DOWN 1 Towards zero.\n // ROUND_CEIL 2 Towards +Infinity.\n // ROUND_FLOOR 3 Towards -Infinity.\n // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.\n // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\n // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\n // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\n // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\n //\n // E.g.\n // `Decimal.rounding = 4;`\n // `Decimal.rounding = Decimal.ROUND_HALF_UP;`\n rounding: 4,\n // 0 to 8\n // The modulo mode used when calculating the modulus: a mod n.\n // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\n // The remainder (r) is calculated as: r = a - n * q.\n //\n // UP 0 The remainder is positive if the dividend is negative, else is negative.\n // DOWN 1 The remainder has the same sign as the dividend (JavaScript %).\n // FLOOR 3 The remainder has the same sign as the divisor (Python %).\n // HALF_EVEN 6 The IEEE 754 remainder function.\n // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive.\n //\n // Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian\n // division (9) are commonly used for the modulus operation. The other rounding modes can also\n // be used, but they may not give useful results.\n modulo: 1,\n // 0 to 9\n // The exponent value at and beneath which `toString` returns exponential notation.\n // JavaScript numbers: -7\n toExpNeg: -7,\n // 0 to -EXP_LIMIT\n // The exponent value at and above which `toString` returns exponential notation.\n // JavaScript numbers: 21\n toExpPos: 21,\n // 0 to EXP_LIMIT\n // The minimum exponent value, beneath which underflow to zero occurs.\n // JavaScript numbers: -324 (5e-324)\n minE: -EXP_LIMIT,\n // -1 to -EXP_LIMIT\n // The maximum exponent value, above which overflow to Infinity occurs.\n // JavaScript numbers: 308 (1.7976931348623157e+308)\n maxE: EXP_LIMIT,\n // 1 to EXP_LIMIT\n // Whether to use cryptographically-secure random number generation, if available.\n crypto: false\n // true/false\n};\nvar inexact;\nvar quadrant;\nvar external = true;\nvar decimalError = \"[DecimalError] \";\nvar invalidArgument = decimalError + \"Invalid argument: \";\nvar precisionLimitExceeded = decimalError + \"Precision limit exceeded\";\nvar cryptoUnavailable = decimalError + \"crypto unavailable\";\nvar tag = \"[object Decimal]\";\nvar mathfloor = Math.floor;\nvar mathpow = Math.pow;\nvar isBinary = /^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i;\nvar isHex = /^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i;\nvar isOctal = /^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i;\nvar isDecimal = /^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i;\nvar BASE = 1e7;\nvar LOG_BASE = 7;\nvar MAX_SAFE_INTEGER = 9007199254740991;\nvar LN10_PRECISION = LN10.length - 1;\nvar PI_PRECISION = PI.length - 1;\nvar P = { toStringTag: tag };\nP.absoluteValue = P.abs = function() {\n var x = new this.constructor(this);\n if (x.s < 0) x.s = 1;\n return finalise(x);\n};\nP.ceil = function() {\n return finalise(new this.constructor(this), this.e + 1, 2);\n};\nP.clampedTo = P.clamp = function(min3, max2) {\n var k, x = this, Ctor = x.constructor;\n min3 = new Ctor(min3);\n max2 = new Ctor(max2);\n if (!min3.s || !max2.s) return new Ctor(NaN);\n if (min3.gt(max2)) throw Error(invalidArgument + max2);\n k = x.cmp(min3);\n return k < 0 ? min3 : x.cmp(max2) > 0 ? max2 : new Ctor(x);\n};\nP.comparedTo = P.cmp = function(y) {\n var i, j, xdL, ydL, x = this, xd = x.d, yd = (y = new x.constructor(y)).d, xs = x.s, ys = y.s;\n if (!xd || !yd) {\n return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1;\n }\n if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0;\n if (xs !== ys) return xs;\n if (x.e !== y.e) return x.e > y.e ^ xs < 0 ? 1 : -1;\n xdL = xd.length;\n ydL = yd.length;\n for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {\n if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ xs < 0 ? 1 : -1;\n }\n return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1;\n};\nP.cosine = P.cos = function() {\n var pr, rm, x = this, Ctor = x.constructor;\n if (!x.d) return new Ctor(NaN);\n if (!x.d[0]) return new Ctor(1);\n pr = Ctor.precision;\n rm = Ctor.rounding;\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\n Ctor.rounding = 1;\n x = cosine(Ctor, toLessThanHalfPi(Ctor, x));\n Ctor.precision = pr;\n Ctor.rounding = rm;\n return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true);\n};\nP.cubeRoot = P.cbrt = function() {\n var e, m, n, r, rep, s, sd, t, t3, t3plusx, x = this, Ctor = x.constructor;\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\n external = false;\n s = x.s * mathpow(x.s * x, 1 / 3);\n if (!s || Math.abs(s) == 1 / 0) {\n n = digitsToString(x.d);\n e = x.e;\n if (s = (e - n.length + 1) % 3) n += s == 1 || s == -2 ? \"0\" : \"00\";\n s = mathpow(n, 1 / 3);\n e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2));\n if (s == 1 / 0) {\n n = \"5e\" + e;\n } else {\n n = s.toExponential();\n n = n.slice(0, n.indexOf(\"e\") + 1) + e;\n }\n r = new Ctor(n);\n r.s = x.s;\n } else {\n r = new Ctor(s.toString());\n }\n sd = (e = Ctor.precision) + 3;\n for (; ; ) {\n t = r;\n t3 = t.times(t).times(t);\n t3plusx = t3.plus(x);\n r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1);\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\n n = n.slice(sd - 3, sd + 1);\n if (n == \"9999\" || !rep && n == \"4999\") {\n if (!rep) {\n finalise(t, e + 1, 0);\n if (t.times(t).times(t).eq(x)) {\n r = t;\n break;\n }\n }\n sd += 4;\n rep = 1;\n } else {\n if (!+n || !+n.slice(1) && n.charAt(0) == \"5\") {\n finalise(r, e + 1, 1);\n m = !r.times(r).times(r).eq(x);\n }\n break;\n }\n }\n }\n external = true;\n return finalise(r, e, Ctor.rounding, m);\n};\nP.decimalPlaces = P.dp = function() {\n var w, d = this.d, n = NaN;\n if (d) {\n w = d.length - 1;\n n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE;\n w = d[w];\n if (w) for (; w % 10 == 0; w /= 10) n--;\n if (n < 0) n = 0;\n }\n return n;\n};\nP.dividedBy = P.div = function(y) {\n return divide(this, new this.constructor(y));\n};\nP.dividedToIntegerBy = P.divToInt = function(y) {\n var x = this, Ctor = x.constructor;\n return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding);\n};\nP.equals = P.eq = function(y) {\n return this.cmp(y) === 0;\n};\nP.floor = function() {\n return finalise(new this.constructor(this), this.e + 1, 3);\n};\nP.greaterThan = P.gt = function(y) {\n return this.cmp(y) > 0;\n};\nP.greaterThanOrEqualTo = P.gte = function(y) {\n var k = this.cmp(y);\n return k == 1 || k === 0;\n};\nP.hyperbolicCosine = P.cosh = function() {\n var k, n, pr, rm, len, x = this, Ctor = x.constructor, one = new Ctor(1);\n if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN);\n if (x.isZero()) return one;\n pr = Ctor.precision;\n rm = Ctor.rounding;\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\n Ctor.rounding = 1;\n len = x.d.length;\n if (len < 32) {\n k = Math.ceil(len / 3);\n n = (1 / tinyPow(4, k)).toString();\n } else {\n k = 16;\n n = \"2.3283064365386962890625e-10\";\n }\n x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true);\n var cosh2_x, i = k, d8 = new Ctor(8);\n for (; i--; ) {\n cosh2_x = x.times(x);\n x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8))));\n }\n return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true);\n};\nP.hyperbolicSine = P.sinh = function() {\n var k, pr, rm, len, x = this, Ctor = x.constructor;\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\n pr = Ctor.precision;\n rm = Ctor.rounding;\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\n Ctor.rounding = 1;\n len = x.d.length;\n if (len < 3) {\n x = taylorSeries(Ctor, 2, x, x, true);\n } else {\n k = 1.4 * Math.sqrt(len);\n k = k > 16 ? 16 : k | 0;\n x = x.times(1 / tinyPow(5, k));\n x = taylorSeries(Ctor, 2, x, x, true);\n var sinh2_x, d5 = new Ctor(5), d16 = new Ctor(16), d20 = new Ctor(20);\n for (; k--; ) {\n sinh2_x = x.times(x);\n x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20))));\n }\n }\n Ctor.precision = pr;\n Ctor.rounding = rm;\n return finalise(x, pr, rm, true);\n};\nP.hyperbolicTangent = P.tanh = function() {\n var pr, rm, x = this, Ctor = x.constructor;\n if (!x.isFinite()) return new Ctor(x.s);\n if (x.isZero()) return new Ctor(x);\n pr = Ctor.precision;\n rm = Ctor.rounding;\n Ctor.precision = pr + 7;\n Ctor.rounding = 1;\n return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm);\n};\nP.inverseCosine = P.acos = function() {\n var x = this, Ctor = x.constructor, k = x.abs().cmp(1), pr = Ctor.precision, rm = Ctor.rounding;\n if (k !== -1) {\n return k === 0 ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0) : new Ctor(NaN);\n }\n if (x.isZero()) return getPi(Ctor, pr + 4, rm).times(0.5);\n Ctor.precision = pr + 6;\n Ctor.rounding = 1;\n x = new Ctor(1).minus(x).div(x.plus(1)).sqrt().atan();\n Ctor.precision = pr;\n Ctor.rounding = rm;\n return x.times(2);\n};\nP.inverseHyperbolicCosine = P.acosh = function() {\n var pr, rm, x = this, Ctor = x.constructor;\n if (x.lte(1)) return new Ctor(x.eq(1) ? 0 : NaN);\n if (!x.isFinite()) return new Ctor(x);\n pr = Ctor.precision;\n rm = Ctor.rounding;\n Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4;\n Ctor.rounding = 1;\n external = false;\n x = x.times(x).minus(1).sqrt().plus(x);\n external = true;\n Ctor.precision = pr;\n Ctor.rounding = rm;\n return x.ln();\n};\nP.inverseHyperbolicSine = P.asinh = function() {\n var pr, rm, x = this, Ctor = x.constructor;\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\n pr = Ctor.precision;\n rm = Ctor.rounding;\n Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6;\n Ctor.rounding = 1;\n external = false;\n x = x.times(x).plus(1).sqrt().plus(x);\n external = true;\n Ctor.precision = pr;\n Ctor.rounding = rm;\n return x.ln();\n};\nP.inverseHyperbolicTangent = P.atanh = function() {\n var pr, rm, wpr, xsd, x = this, Ctor = x.constructor;\n if (!x.isFinite()) return new Ctor(NaN);\n if (x.e >= 0) return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN);\n pr = Ctor.precision;\n rm = Ctor.rounding;\n xsd = x.sd();\n if (Math.max(xsd, pr) < 2 * -x.e - 1) return finalise(new Ctor(x), pr, rm, true);\n Ctor.precision = wpr = xsd - x.e;\n x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1);\n Ctor.precision = pr + 4;\n Ctor.rounding = 1;\n x = x.ln();\n Ctor.precision = pr;\n Ctor.rounding = rm;\n return x.times(0.5);\n};\nP.inverseSine = P.asin = function() {\n var halfPi, k, pr, rm, x = this, Ctor = x.constructor;\n if (x.isZero()) return new Ctor(x);\n k = x.abs().cmp(1);\n pr = Ctor.precision;\n rm = Ctor.rounding;\n if (k !== -1) {\n if (k === 0) {\n halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\n halfPi.s = x.s;\n return halfPi;\n }\n return new Ctor(NaN);\n }\n Ctor.precision = pr + 6;\n Ctor.rounding = 1;\n x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan();\n Ctor.precision = pr;\n Ctor.rounding = rm;\n return x.times(2);\n};\nP.inverseTangent = P.atan = function() {\n var i, j, k, n, px, t, r, wpr, x2, x = this, Ctor = x.constructor, pr = Ctor.precision, rm = Ctor.rounding;\n if (!x.isFinite()) {\n if (!x.s) return new Ctor(NaN);\n if (pr + 4 <= PI_PRECISION) {\n r = getPi(Ctor, pr + 4, rm).times(0.5);\n r.s = x.s;\n return r;\n }\n } else if (x.isZero()) {\n return new Ctor(x);\n } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) {\n r = getPi(Ctor, pr + 4, rm).times(0.25);\n r.s = x.s;\n return r;\n }\n Ctor.precision = wpr = pr + 10;\n Ctor.rounding = 1;\n k = Math.min(28, wpr / LOG_BASE + 2 | 0);\n for (i = k; i; --i) x = x.div(x.times(x).plus(1).sqrt().plus(1));\n external = false;\n j = Math.ceil(wpr / LOG_BASE);\n n = 1;\n x2 = x.times(x);\n r = new Ctor(x);\n px = x;\n for (; i !== -1; ) {\n px = px.times(x2);\n t = r.minus(px.div(n += 2));\n px = px.times(x2);\n r = t.plus(px.div(n += 2));\n if (r.d[j] !== void 0) for (i = j; r.d[i] === t.d[i] && i--; ) ;\n }\n if (k) r = r.times(2 << k - 1);\n external = true;\n return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true);\n};\nP.isFinite = function() {\n return !!this.d;\n};\nP.isInteger = P.isInt = function() {\n return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2;\n};\nP.isNaN = function() {\n return !this.s;\n};\nP.isNegative = P.isNeg = function() {\n return this.s < 0;\n};\nP.isPositive = P.isPos = function() {\n return this.s > 0;\n};\nP.isZero = function() {\n return !!this.d && this.d[0] === 0;\n};\nP.lessThan = P.lt = function(y) {\n return this.cmp(y) < 0;\n};\nP.lessThanOrEqualTo = P.lte = function(y) {\n return this.cmp(y) < 1;\n};\nP.logarithm = P.log = function(base) {\n var isBase10, d, denominator, k, inf, num, sd, r, arg = this, Ctor = arg.constructor, pr = Ctor.precision, rm = Ctor.rounding, guard = 5;\n if (base == null) {\n base = new Ctor(10);\n isBase10 = true;\n } else {\n base = new Ctor(base);\n d = base.d;\n if (base.s < 0 || !d || !d[0] || base.eq(1)) return new Ctor(NaN);\n isBase10 = base.eq(10);\n }\n d = arg.d;\n if (arg.s < 0 || !d || !d[0] || arg.eq(1)) {\n return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0);\n }\n if (isBase10) {\n if (d.length > 1) {\n inf = true;\n } else {\n for (k = d[0]; k % 10 === 0; ) k /= 10;\n inf = k !== 1;\n }\n }\n external = false;\n sd = pr + guard;\n num = naturalLogarithm(arg, sd);\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\n r = divide(num, denominator, sd, 1);\n if (checkRoundingDigits(r.d, k = pr, rm)) {\n do {\n sd += 10;\n num = naturalLogarithm(arg, sd);\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\n r = divide(num, denominator, sd, 1);\n if (!inf) {\n if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) {\n r = finalise(r, pr + 1, 0);\n }\n break;\n }\n } while (checkRoundingDigits(r.d, k += 10, rm));\n }\n external = true;\n return finalise(r, pr, rm);\n};\nP.minus = P.sub = function(y) {\n var d, e, i, j, k, len, pr, rm, xd, xe, xLTy, yd, x = this, Ctor = x.constructor;\n y = new Ctor(y);\n if (!x.d || !y.d) {\n if (!x.s || !y.s) y = new Ctor(NaN);\n else if (x.d) y.s = -y.s;\n else y = new Ctor(y.d || x.s !== y.s ? x : NaN);\n return y;\n }\n if (x.s != y.s) {\n y.s = -y.s;\n return x.plus(y);\n }\n xd = x.d;\n yd = y.d;\n pr = Ctor.precision;\n rm = Ctor.rounding;\n if (!xd[0] || !yd[0]) {\n if (yd[0]) y.s = -y.s;\n else if (xd[0]) y = new Ctor(x);\n else return new Ctor(rm === 3 ? -0 : 0);\n return external ? finalise(y, pr, rm) : y;\n }\n e = mathfloor(y.e / LOG_BASE);\n xe = mathfloor(x.e / LOG_BASE);\n xd = xd.slice();\n k = xe - e;\n if (k) {\n xLTy = k < 0;\n if (xLTy) {\n d = xd;\n k = -k;\n len = yd.length;\n } else {\n d = yd;\n e = xe;\n len = xd.length;\n }\n i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;\n if (k > i) {\n k = i;\n d.length = 1;\n }\n d.reverse();\n for (i = k; i--; ) d.push(0);\n d.reverse();\n } else {\n i = xd.length;\n len = yd.length;\n xLTy = i < len;\n if (xLTy) len = i;\n for (i = 0; i < len; i++) {\n if (xd[i] != yd[i]) {\n xLTy = xd[i] < yd[i];\n break;\n }\n }\n k = 0;\n }\n if (xLTy) {\n d = xd;\n xd = yd;\n yd = d;\n y.s = -y.s;\n }\n len = xd.length;\n for (i = yd.length - len; i > 0; --i) xd[len++] = 0;\n for (i = yd.length; i > k; ) {\n if (xd[--i] < yd[i]) {\n for (j = i; j && xd[--j] === 0; ) xd[j] = BASE - 1;\n --xd[j];\n xd[i] += BASE;\n }\n xd[i] -= yd[i];\n }\n for (; xd[--len] === 0; ) xd.pop();\n for (; xd[0] === 0; xd.shift()) --e;\n if (!xd[0]) return new Ctor(rm === 3 ? -0 : 0);\n y.d = xd;\n y.e = getBase10Exponent(xd, e);\n return external ? finalise(y, pr, rm) : y;\n};\nP.modulo = P.mod = function(y) {\n var q, x = this, Ctor = x.constructor;\n y = new Ctor(y);\n if (!x.d || !y.s || y.d && !y.d[0]) return new Ctor(NaN);\n if (!y.d || x.d && !x.d[0]) {\n return finalise(new Ctor(x), Ctor.precision, Ctor.rounding);\n }\n external = false;\n if (Ctor.modulo == 9) {\n q = divide(x, y.abs(), 0, 3, 1);\n q.s *= y.s;\n } else {\n q = divide(x, y, 0, Ctor.modulo, 1);\n }\n q = q.times(y);\n external = true;\n return x.minus(q);\n};\nP.naturalExponential = P.exp = function() {\n return naturalExponential(this);\n};\nP.naturalLogarithm = P.ln = function() {\n return naturalLogarithm(this);\n};\nP.negated = P.neg = function() {\n var x = new this.constructor(this);\n x.s = -x.s;\n return finalise(x);\n};\nP.plus = P.add = function(y) {\n var carry, d, e, i, k, len, pr, rm, xd, yd, x = this, Ctor = x.constructor;\n y = new Ctor(y);\n if (!x.d || !y.d) {\n if (!x.s || !y.s) y = new Ctor(NaN);\n else if (!x.d) y = new Ctor(y.d || x.s === y.s ? x : NaN);\n return y;\n }\n if (x.s != y.s) {\n y.s = -y.s;\n return x.minus(y);\n }\n xd = x.d;\n yd = y.d;\n pr = Ctor.precision;\n rm = Ctor.rounding;\n if (!xd[0] || !yd[0]) {\n if (!yd[0]) y = new Ctor(x);\n return external ? finalise(y, pr, rm) : y;\n }\n k = mathfloor(x.e / LOG_BASE);\n e = mathfloor(y.e / LOG_BASE);\n xd = xd.slice();\n i = k - e;\n if (i) {\n if (i < 0) {\n d = xd;\n i = -i;\n len = yd.length;\n } else {\n d = yd;\n e = k;\n len = xd.length;\n }\n k = Math.ceil(pr / LOG_BASE);\n len = k > len ? k + 1 : len + 1;\n if (i > len) {\n i = len;\n d.length = 1;\n }\n d.reverse();\n for (; i--; ) d.push(0);\n d.reverse();\n }\n len = xd.length;\n i = yd.length;\n if (len - i < 0) {\n i = len;\n d = yd;\n yd = xd;\n xd = d;\n }\n for (carry = 0; i; ) {\n carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;\n xd[i] %= BASE;\n }\n if (carry) {\n xd.unshift(carry);\n ++e;\n }\n for (len = xd.length; xd[--len] == 0; ) xd.pop();\n y.d = xd;\n y.e = getBase10Exponent(xd, e);\n return external ? finalise(y, pr, rm) : y;\n};\nP.precision = P.sd = function(z) {\n var k, x = this;\n if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);\n if (x.d) {\n k = getPrecision(x.d);\n if (z && x.e + 1 > k) k = x.e + 1;\n } else {\n k = NaN;\n }\n return k;\n};\nP.round = function() {\n var x = this, Ctor = x.constructor;\n return finalise(new Ctor(x), x.e + 1, Ctor.rounding);\n};\nP.sine = P.sin = function() {\n var pr, rm, x = this, Ctor = x.constructor;\n if (!x.isFinite()) return new Ctor(NaN);\n if (x.isZero()) return new Ctor(x);\n pr = Ctor.precision;\n rm = Ctor.rounding;\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\n Ctor.rounding = 1;\n x = sine(Ctor, toLessThanHalfPi(Ctor, x));\n Ctor.precision = pr;\n Ctor.rounding = rm;\n return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true);\n};\nP.squareRoot = P.sqrt = function() {\n var m, n, sd, r, rep, t, x = this, d = x.d, e = x.e, s = x.s, Ctor = x.constructor;\n if (s !== 1 || !d || !d[0]) {\n return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0);\n }\n external = false;\n s = Math.sqrt(+x);\n if (s == 0 || s == 1 / 0) {\n n = digitsToString(d);\n if ((n.length + e) % 2 == 0) n += \"0\";\n s = Math.sqrt(n);\n e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);\n if (s == 1 / 0) {\n n = \"5e\" + e;\n } else {\n n = s.toExponential();\n n = n.slice(0, n.indexOf(\"e\") + 1) + e;\n }\n r = new Ctor(n);\n } else {\n r = new Ctor(s.toString());\n }\n sd = (e = Ctor.precision) + 3;\n for (; ; ) {\n t = r;\n r = t.plus(divide(x, t, sd + 2, 1)).times(0.5);\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\n n = n.slice(sd - 3, sd + 1);\n if (n == \"9999\" || !rep && n == \"4999\") {\n if (!rep) {\n finalise(t, e + 1, 0);\n if (t.times(t).eq(x)) {\n r = t;\n break;\n }\n }\n sd += 4;\n rep = 1;\n } else {\n if (!+n || !+n.slice(1) && n.charAt(0) == \"5\") {\n finalise(r, e + 1, 1);\n m = !r.times(r).eq(x);\n }\n break;\n }\n }\n }\n external = true;\n return finalise(r, e, Ctor.rounding, m);\n};\nP.tangent = P.tan = function() {\n var pr, rm, x = this, Ctor = x.constructor;\n if (!x.isFinite()) return new Ctor(NaN);\n if (x.isZero()) return new Ctor(x);\n pr = Ctor.precision;\n rm = Ctor.rounding;\n Ctor.precision = pr + 10;\n Ctor.rounding = 1;\n x = x.sin();\n x.s = 1;\n x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0);\n Ctor.precision = pr;\n Ctor.rounding = rm;\n return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true);\n};\nP.times = P.mul = function(y) {\n var carry, e, i, k, r, rL, t, xdL, ydL, x = this, Ctor = x.constructor, xd = x.d, yd = (y = new Ctor(y)).d;\n y.s *= x.s;\n if (!xd || !xd[0] || !yd || !yd[0]) {\n return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd ? NaN : !xd || !yd ? y.s / 0 : y.s * 0);\n }\n e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE);\n xdL = xd.length;\n ydL = yd.length;\n if (xdL < ydL) {\n r = xd;\n xd = yd;\n yd = r;\n rL = xdL;\n xdL = ydL;\n ydL = rL;\n }\n r = [];\n rL = xdL + ydL;\n for (i = rL; i--; ) r.push(0);\n for (i = ydL; --i >= 0; ) {\n carry = 0;\n for (k = xdL + i; k > i; ) {\n t = r[k] + yd[i] * xd[k - i - 1] + carry;\n r[k--] = t % BASE | 0;\n carry = t / BASE | 0;\n }\n r[k] = (r[k] + carry) % BASE | 0;\n }\n for (; !r[--rL]; ) r.pop();\n if (carry) ++e;\n else r.shift();\n y.d = r;\n y.e = getBase10Exponent(r, e);\n return external ? finalise(y, Ctor.precision, Ctor.rounding) : y;\n};\nP.toBinary = function(sd, rm) {\n return toStringBinary(this, 2, sd, rm);\n};\nP.toDecimalPlaces = P.toDP = function(dp, rm) {\n var x = this, Ctor = x.constructor;\n x = new Ctor(x);\n if (dp === void 0) return x;\n checkInt32(dp, 0, MAX_DIGITS);\n if (rm === void 0) rm = Ctor.rounding;\n else checkInt32(rm, 0, 8);\n return finalise(x, dp + x.e + 1, rm);\n};\nP.toExponential = function(dp, rm) {\n var str, x = this, Ctor = x.constructor;\n if (dp === void 0) {\n str = finiteToString(x, true);\n } else {\n checkInt32(dp, 0, MAX_DIGITS);\n if (rm === void 0) rm = Ctor.rounding;\n else checkInt32(rm, 0, 8);\n x = finalise(new Ctor(x), dp + 1, rm);\n str = finiteToString(x, true, dp + 1);\n }\n return x.isNeg() && !x.isZero() ? \"-\" + str : str;\n};\nP.toFixed = function(dp, rm) {\n var str, y, x = this, Ctor = x.constructor;\n if (dp === void 0) {\n str = finiteToString(x);\n } else {\n checkInt32(dp, 0, MAX_DIGITS);\n if (rm === void 0) rm = Ctor.rounding;\n else checkInt32(rm, 0, 8);\n y = finalise(new Ctor(x), dp + x.e + 1, rm);\n str = finiteToString(y, false, dp + y.e + 1);\n }\n return x.isNeg() && !x.isZero() ? \"-\" + str : str;\n};\nP.toFraction = function(maxD) {\n var d, d0, d1, d2, e, k, n, n0, n1, pr, q, r, x = this, xd = x.d, Ctor = x.constructor;\n if (!xd) return new Ctor(x);\n n1 = d0 = new Ctor(1);\n d1 = n0 = new Ctor(0);\n d = new Ctor(d1);\n e = d.e = getPrecision(xd) - x.e - 1;\n k = e % LOG_BASE;\n d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k);\n if (maxD == null) {\n maxD = e > 0 ? d : n1;\n } else {\n n = new Ctor(maxD);\n if (!n.isInt() || n.lt(n1)) throw Error(invalidArgument + n);\n maxD = n.gt(d) ? e > 0 ? d : n1 : n;\n }\n external = false;\n n = new Ctor(digitsToString(xd));\n pr = Ctor.precision;\n Ctor.precision = e = xd.length * LOG_BASE * 2;\n for (; ; ) {\n q = divide(n, d, 0, 1, 1);\n d2 = d0.plus(q.times(d1));\n if (d2.cmp(maxD) == 1) break;\n d0 = d1;\n d1 = d2;\n d2 = n1;\n n1 = n0.plus(q.times(d2));\n n0 = d2;\n d2 = d;\n d = n.minus(q.times(d2));\n n = d2;\n }\n d2 = divide(maxD.minus(d0), d1, 0, 1, 1);\n n0 = n0.plus(d2.times(n1));\n d0 = d0.plus(d2.times(d1));\n n0.s = n1.s = x.s;\n r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0];\n Ctor.precision = pr;\n external = true;\n return r;\n};\nP.toHexadecimal = P.toHex = function(sd, rm) {\n return toStringBinary(this, 16, sd, rm);\n};\nP.toNearest = function(y, rm) {\n var x = this, Ctor = x.constructor;\n x = new Ctor(x);\n if (y == null) {\n if (!x.d) return x;\n y = new Ctor(1);\n rm = Ctor.rounding;\n } else {\n y = new Ctor(y);\n if (rm === void 0) {\n rm = Ctor.rounding;\n } else {\n checkInt32(rm, 0, 8);\n }\n if (!x.d) return y.s ? x : y;\n if (!y.d) {\n if (y.s) y.s = x.s;\n return y;\n }\n }\n if (y.d[0]) {\n external = false;\n x = divide(x, y, 0, rm, 1).times(y);\n external = true;\n finalise(x);\n } else {\n y.s = x.s;\n x = y;\n }\n return x;\n};\nP.toNumber = function() {\n return +this;\n};\nP.toOctal = function(sd, rm) {\n return toStringBinary(this, 8, sd, rm);\n};\nP.toPower = P.pow = function(y) {\n var e, k, pr, r, rm, s, x = this, Ctor = x.constructor, yn = +(y = new Ctor(y));\n if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn));\n x = new Ctor(x);\n if (x.eq(1)) return x;\n pr = Ctor.precision;\n rm = Ctor.rounding;\n if (y.eq(1)) return finalise(x, pr, rm);\n e = mathfloor(y.e / LOG_BASE);\n if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {\n r = intPow(Ctor, x, k, pr);\n return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm);\n }\n s = x.s;\n if (s < 0) {\n if (e < y.d.length - 1) return new Ctor(NaN);\n if ((y.d[e] & 1) == 0) s = 1;\n if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) {\n x.s = s;\n return x;\n }\n }\n k = mathpow(+x, yn);\n e = k == 0 || !isFinite(k) ? mathfloor(yn * (Math.log(\"0.\" + digitsToString(x.d)) / Math.LN10 + x.e + 1)) : new Ctor(k + \"\").e;\n if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) return new Ctor(e > 0 ? s / 0 : 0);\n external = false;\n Ctor.rounding = x.s = 1;\n k = Math.min(12, (e + \"\").length);\n r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr);\n if (r.d) {\n r = finalise(r, pr + 5, 1);\n if (checkRoundingDigits(r.d, pr, rm)) {\n e = pr + 10;\n r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1);\n if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) {\n r = finalise(r, pr + 1, 0);\n }\n }\n }\n r.s = s;\n external = true;\n Ctor.rounding = rm;\n return finalise(r, pr, rm);\n};\nP.toPrecision = function(sd, rm) {\n var str, x = this, Ctor = x.constructor;\n if (sd === void 0) {\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\n } else {\n checkInt32(sd, 1, MAX_DIGITS);\n if (rm === void 0) rm = Ctor.rounding;\n else checkInt32(rm, 0, 8);\n x = finalise(new Ctor(x), sd, rm);\n str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd);\n }\n return x.isNeg() && !x.isZero() ? \"-\" + str : str;\n};\nP.toSignificantDigits = P.toSD = function(sd, rm) {\n var x = this, Ctor = x.constructor;\n if (sd === void 0) {\n sd = Ctor.precision;\n rm = Ctor.rounding;\n } else {\n checkInt32(sd, 1, MAX_DIGITS);\n if (rm === void 0) rm = Ctor.rounding;\n else checkInt32(rm, 0, 8);\n }\n return finalise(new Ctor(x), sd, rm);\n};\nP.toString = function() {\n var x = this, Ctor = x.constructor, str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\n return x.isNeg() && !x.isZero() ? \"-\" + str : str;\n};\nP.truncated = P.trunc = function() {\n return finalise(new this.constructor(this), this.e + 1, 1);\n};\nP.valueOf = P.toJSON = function() {\n var x = this, Ctor = x.constructor, str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\n return x.isNeg() ? \"-\" + str : str;\n};\nfunction digitsToString(d) {\n var i, k, ws, indexOfLastWord = d.length - 1, str = \"\", w = d[0];\n if (indexOfLastWord > 0) {\n str += w;\n for (i = 1; i < indexOfLastWord; i++) {\n ws = d[i] + \"\";\n k = LOG_BASE - ws.length;\n if (k) str += getZeroString(k);\n str += ws;\n }\n w = d[i];\n ws = w + \"\";\n k = LOG_BASE - ws.length;\n if (k) str += getZeroString(k);\n } else if (w === 0) {\n return \"0\";\n }\n for (; w % 10 === 0; ) w /= 10;\n return str + w;\n}\nfunction checkInt32(i, min3, max2) {\n if (i !== ~~i || i < min3 || i > max2) {\n throw Error(invalidArgument + i);\n }\n}\nfunction checkRoundingDigits(d, i, rm, repeating) {\n var di, k, r, rd;\n for (k = d[0]; k >= 10; k /= 10) --i;\n if (--i < 0) {\n i += LOG_BASE;\n di = 0;\n } else {\n di = Math.ceil((i + 1) / LOG_BASE);\n i %= LOG_BASE;\n }\n k = mathpow(10, LOG_BASE - i);\n rd = d[di] % k | 0;\n if (repeating == null) {\n if (i < 3) {\n if (i == 0) rd = rd / 100 | 0;\n else if (i == 1) rd = rd / 10 | 0;\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 5e4 || rd == 0;\n } else {\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) && (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 || (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\n }\n } else {\n if (i < 4) {\n if (i == 0) rd = rd / 1e3 | 0;\n else if (i == 1) rd = rd / 100 | 0;\n else if (i == 2) rd = rd / 10 | 0;\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\n } else {\n r = ((repeating || rm < 4) && rd + 1 == k || !repeating && rm > 3 && rd + 1 == k / 2) && (d[di + 1] / k / 1e3 | 0) == mathpow(10, i - 3) - 1;\n }\n }\n return r;\n}\nfunction convertBase(str, baseIn, baseOut) {\n var j, arr = [0], arrL, i = 0, strL = str.length;\n for (; i < strL; ) {\n for (arrL = arr.length; arrL--; ) arr[arrL] *= baseIn;\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\n for (j = 0; j < arr.length; j++) {\n if (arr[j] > baseOut - 1) {\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n return arr.reverse();\n}\nfunction cosine(Ctor, x) {\n var k, len, y;\n if (x.isZero()) return x;\n len = x.d.length;\n if (len < 32) {\n k = Math.ceil(len / 3);\n y = (1 / tinyPow(4, k)).toString();\n } else {\n k = 16;\n y = \"2.3283064365386962890625e-10\";\n }\n Ctor.precision += k;\n x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1));\n for (var i = k; i--; ) {\n var cos2x = x.times(x);\n x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1);\n }\n Ctor.precision -= k;\n return x;\n}\nvar divide = /* @__PURE__ */ function() {\n function multiplyInteger(x, k, base) {\n var temp, carry = 0, i = x.length;\n for (x = x.slice(); i--; ) {\n temp = x[i] * k + carry;\n x[i] = temp % base | 0;\n carry = temp / base | 0;\n }\n if (carry) x.unshift(carry);\n return x;\n }\n function compare(a, b, aL, bL) {\n var i, r;\n if (aL != bL) {\n r = aL > bL ? 1 : -1;\n } else {\n for (i = r = 0; i < aL; i++) {\n if (a[i] != b[i]) {\n r = a[i] > b[i] ? 1 : -1;\n break;\n }\n }\n }\n return r;\n }\n function subtract(a, b, aL, base) {\n var i = 0;\n for (; aL--; ) {\n a[aL] -= i;\n i = a[aL] < b[aL] ? 1 : 0;\n a[aL] = i * base + a[aL] - b[aL];\n }\n for (; !a[0] && a.length > 1; ) a.shift();\n }\n return function(x, y, pr, rm, dp, base) {\n var cmp, e, i, k, logBase, more, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0, yL, yz, Ctor = x.constructor, sign2 = x.s == y.s ? 1 : -1, xd = x.d, yd = y.d;\n if (!xd || !xd[0] || !yd || !yd[0]) {\n return new Ctor(\n // Return NaN if either NaN, or both Infinity or 0.\n !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN : (\n // Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.\n xd && xd[0] == 0 || !yd ? sign2 * 0 : sign2 / 0\n )\n );\n }\n if (base) {\n logBase = 1;\n e = x.e - y.e;\n } else {\n base = BASE;\n logBase = LOG_BASE;\n e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase);\n }\n yL = yd.length;\n xL = xd.length;\n q = new Ctor(sign2);\n qd = q.d = [];\n for (i = 0; yd[i] == (xd[i] || 0); i++) ;\n if (yd[i] > (xd[i] || 0)) e--;\n if (pr == null) {\n sd = pr = Ctor.precision;\n rm = Ctor.rounding;\n } else if (dp) {\n sd = pr + (x.e - y.e) + 1;\n } else {\n sd = pr;\n }\n if (sd < 0) {\n qd.push(1);\n more = true;\n } else {\n sd = sd / logBase + 2 | 0;\n i = 0;\n if (yL == 1) {\n k = 0;\n yd = yd[0];\n sd++;\n for (; (i < xL || k) && sd--; i++) {\n t = k * base + (xd[i] || 0);\n qd[i] = t / yd | 0;\n k = t % yd | 0;\n }\n more = k || i < xL;\n } else {\n k = base / (yd[0] + 1) | 0;\n if (k > 1) {\n yd = multiplyInteger(yd, k, base);\n xd = multiplyInteger(xd, k, base);\n yL = yd.length;\n xL = xd.length;\n }\n xi = yL;\n rem = xd.slice(0, yL);\n remL = rem.length;\n for (; remL < yL; ) rem[remL++] = 0;\n yz = yd.slice();\n yz.unshift(0);\n yd0 = yd[0];\n if (yd[1] >= base / 2) ++yd0;\n do {\n k = 0;\n cmp = compare(yd, rem, yL, remL);\n if (cmp < 0) {\n rem0 = rem[0];\n if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);\n k = rem0 / yd0 | 0;\n if (k > 1) {\n if (k >= base) k = base - 1;\n prod = multiplyInteger(yd, k, base);\n prodL = prod.length;\n remL = rem.length;\n cmp = compare(prod, rem, prodL, remL);\n if (cmp == 1) {\n k--;\n subtract(prod, yL < prodL ? yz : yd, prodL, base);\n }\n } else {\n if (k == 0) cmp = k = 1;\n prod = yd.slice();\n }\n prodL = prod.length;\n if (prodL < remL) prod.unshift(0);\n subtract(rem, prod, remL, base);\n if (cmp == -1) {\n remL = rem.length;\n cmp = compare(yd, rem, yL, remL);\n if (cmp < 1) {\n k++;\n subtract(rem, yL < remL ? yz : yd, remL, base);\n }\n }\n remL = rem.length;\n } else if (cmp === 0) {\n k++;\n rem = [0];\n }\n qd[i++] = k;\n if (cmp && rem[0]) {\n rem[remL++] = xd[xi] || 0;\n } else {\n rem = [xd[xi]];\n remL = 1;\n }\n } while ((xi++ < xL || rem[0] !== void 0) && sd--);\n more = rem[0] !== void 0;\n }\n if (!qd[0]) qd.shift();\n }\n if (logBase == 1) {\n q.e = e;\n inexact = more;\n } else {\n for (i = 1, k = qd[0]; k >= 10; k /= 10) i++;\n q.e = i + e * logBase - 1;\n finalise(q, dp ? pr + q.e + 1 : pr, rm, more);\n }\n return q;\n };\n}();\nfunction finalise(x, sd, rm, isTruncated) {\n var digits, i, j, k, rd, roundUp, w, xd, xdi, Ctor = x.constructor;\n out: if (sd != null) {\n xd = x.d;\n if (!xd) return x;\n for (digits = 1, k = xd[0]; k >= 10; k /= 10) digits++;\n i = sd - digits;\n if (i < 0) {\n i += LOG_BASE;\n j = sd;\n w = xd[xdi = 0];\n rd = w / mathpow(10, digits - j - 1) % 10 | 0;\n } else {\n xdi = Math.ceil((i + 1) / LOG_BASE);\n k = xd.length;\n if (xdi >= k) {\n if (isTruncated) {\n for (; k++ <= xdi; ) xd.push(0);\n w = rd = 0;\n digits = 1;\n i %= LOG_BASE;\n j = i - LOG_BASE + 1;\n } else {\n break out;\n }\n } else {\n w = k = xd[xdi];\n for (digits = 1; k >= 10; k /= 10) digits++;\n i %= LOG_BASE;\n j = i - LOG_BASE + digits;\n rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0;\n }\n }\n isTruncated = isTruncated || sd < 0 || xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1));\n roundUp = rm < 4 ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 && // Check whether the digit to the left of the rounding digit is odd.\n (i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10 & 1 || rm == (x.s < 0 ? 8 : 7));\n if (sd < 1 || !xd[0]) {\n xd.length = 0;\n if (roundUp) {\n sd -= x.e + 1;\n xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);\n x.e = -sd || 0;\n } else {\n xd[0] = x.e = 0;\n }\n return x;\n }\n if (i == 0) {\n xd.length = xdi;\n k = 1;\n xdi--;\n } else {\n xd.length = xdi + 1;\n k = mathpow(10, LOG_BASE - i);\n xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0;\n }\n if (roundUp) {\n for (; ; ) {\n if (xdi == 0) {\n for (i = 1, j = xd[0]; j >= 10; j /= 10) i++;\n j = xd[0] += k;\n for (k = 1; j >= 10; j /= 10) k++;\n if (i != k) {\n x.e++;\n if (xd[0] == BASE) xd[0] = 1;\n }\n break;\n } else {\n xd[xdi] += k;\n if (xd[xdi] != BASE) break;\n xd[xdi--] = 0;\n k = 1;\n }\n }\n }\n for (i = xd.length; xd[--i] === 0; ) xd.pop();\n }\n if (external) {\n if (x.e > Ctor.maxE) {\n x.d = null;\n x.e = NaN;\n } else if (x.e < Ctor.minE) {\n x.e = 0;\n x.d = [0];\n }\n }\n return x;\n}\nfunction finiteToString(x, isExp, sd) {\n if (!x.isFinite()) return nonFiniteToString(x);\n var k, e = x.e, str = digitsToString(x.d), len = str.length;\n if (isExp) {\n if (sd && (k = sd - len) > 0) {\n str = str.charAt(0) + \".\" + str.slice(1) + getZeroString(k);\n } else if (len > 1) {\n str = str.charAt(0) + \".\" + str.slice(1);\n }\n str = str + (x.e < 0 ? \"e\" : \"e+\") + x.e;\n } else if (e < 0) {\n str = \"0.\" + getZeroString(-e - 1) + str;\n if (sd && (k = sd - len) > 0) str += getZeroString(k);\n } else if (e >= len) {\n str += getZeroString(e + 1 - len);\n if (sd && (k = sd - e - 1) > 0) str = str + \".\" + getZeroString(k);\n } else {\n if ((k = e + 1) < len) str = str.slice(0, k) + \".\" + str.slice(k);\n if (sd && (k = sd - len) > 0) {\n if (e + 1 === len) str += \".\";\n str += getZeroString(k);\n }\n }\n return str;\n}\nfunction getBase10Exponent(digits, e) {\n var w = digits[0];\n for (e *= LOG_BASE; w >= 10; w /= 10) e++;\n return e;\n}\nfunction getLn10(Ctor, sd, pr) {\n if (sd > LN10_PRECISION) {\n external = true;\n if (pr) Ctor.precision = pr;\n throw Error(precisionLimitExceeded);\n }\n return finalise(new Ctor(LN10), sd, 1, true);\n}\nfunction getPi(Ctor, sd, rm) {\n if (sd > PI_PRECISION) throw Error(precisionLimitExceeded);\n return finalise(new Ctor(PI), sd, rm, true);\n}\nfunction getPrecision(digits) {\n var w = digits.length - 1, len = w * LOG_BASE + 1;\n w = digits[w];\n if (w) {\n for (; w % 10 == 0; w /= 10) len--;\n for (w = digits[0]; w >= 10; w /= 10) len++;\n }\n return len;\n}\nfunction getZeroString(k) {\n var zs = \"\";\n for (; k--; ) zs += \"0\";\n return zs;\n}\nfunction intPow(Ctor, x, n, pr) {\n var isTruncated, r = new Ctor(1), k = Math.ceil(pr / LOG_BASE + 4);\n external = false;\n for (; ; ) {\n if (n % 2) {\n r = r.times(x);\n if (truncate(r.d, k)) isTruncated = true;\n }\n n = mathfloor(n / 2);\n if (n === 0) {\n n = r.d.length - 1;\n if (isTruncated && r.d[n] === 0) ++r.d[n];\n break;\n }\n x = x.times(x);\n truncate(x.d, k);\n }\n external = true;\n return r;\n}\nfunction isOdd(n) {\n return n.d[n.d.length - 1] & 1;\n}\nfunction maxOrMin(Ctor, args, n) {\n var k, y, x = new Ctor(args[0]), i = 0;\n for (; ++i < args.length; ) {\n y = new Ctor(args[i]);\n if (!y.s) {\n x = y;\n break;\n }\n k = x.cmp(y);\n if (k === n || k === 0 && x.s === n) {\n x = y;\n }\n }\n return x;\n}\nfunction naturalExponential(x, sd) {\n var denominator, guard, j, pow2, sum2, t, wpr, rep = 0, i = 0, k = 0, Ctor = x.constructor, rm = Ctor.rounding, pr = Ctor.precision;\n if (!x.d || !x.d[0] || x.e > 17) {\n return new Ctor(x.d ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0 : x.s ? x.s < 0 ? 0 : x : 0 / 0);\n }\n if (sd == null) {\n external = false;\n wpr = pr;\n } else {\n wpr = sd;\n }\n t = new Ctor(0.03125);\n while (x.e > -2) {\n x = x.times(t);\n k += 5;\n }\n guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;\n wpr += guard;\n denominator = pow2 = sum2 = new Ctor(1);\n Ctor.precision = wpr;\n for (; ; ) {\n pow2 = finalise(pow2.times(x), wpr, 1);\n denominator = denominator.times(++i);\n t = sum2.plus(divide(pow2, denominator, wpr, 1));\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum2.d).slice(0, wpr)) {\n j = k;\n while (j--) sum2 = finalise(sum2.times(sum2), wpr, 1);\n if (sd == null) {\n if (rep < 3 && checkRoundingDigits(sum2.d, wpr - guard, rm, rep)) {\n Ctor.precision = wpr += 10;\n denominator = pow2 = t = new Ctor(1);\n i = 0;\n rep++;\n } else {\n return finalise(sum2, Ctor.precision = pr, rm, external = true);\n }\n } else {\n Ctor.precision = pr;\n return sum2;\n }\n }\n sum2 = t;\n }\n}\nfunction naturalLogarithm(y, sd) {\n var c, c0, denominator, e, numerator, rep, sum2, t, wpr, x1, x2, n = 1, guard = 10, x = y, xd = x.d, Ctor = x.constructor, rm = Ctor.rounding, pr = Ctor.precision;\n if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) {\n return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x);\n }\n if (sd == null) {\n external = false;\n wpr = pr;\n } else {\n wpr = sd;\n }\n Ctor.precision = wpr += guard;\n c = digitsToString(xd);\n c0 = c.charAt(0);\n if (Math.abs(e = x.e) < 15e14) {\n while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {\n x = x.times(y);\n c = digitsToString(x.d);\n c0 = c.charAt(0);\n n++;\n }\n e = x.e;\n if (c0 > 1) {\n x = new Ctor(\"0.\" + c);\n e++;\n } else {\n x = new Ctor(c0 + \".\" + c.slice(1));\n }\n } else {\n t = getLn10(Ctor, wpr + 2, pr).times(e + \"\");\n x = naturalLogarithm(new Ctor(c0 + \".\" + c.slice(1)), wpr - guard).plus(t);\n Ctor.precision = pr;\n return sd == null ? finalise(x, pr, rm, external = true) : x;\n }\n x1 = x;\n sum2 = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1);\n x2 = finalise(x.times(x), wpr, 1);\n denominator = 3;\n for (; ; ) {\n numerator = finalise(numerator.times(x2), wpr, 1);\n t = sum2.plus(divide(numerator, new Ctor(denominator), wpr, 1));\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum2.d).slice(0, wpr)) {\n sum2 = sum2.times(2);\n if (e !== 0) sum2 = sum2.plus(getLn10(Ctor, wpr + 2, pr).times(e + \"\"));\n sum2 = divide(sum2, new Ctor(n), wpr, 1);\n if (sd == null) {\n if (checkRoundingDigits(sum2.d, wpr - guard, rm, rep)) {\n Ctor.precision = wpr += guard;\n t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1);\n x2 = finalise(x.times(x), wpr, 1);\n denominator = rep = 1;\n } else {\n return finalise(sum2, Ctor.precision = pr, rm, external = true);\n }\n } else {\n Ctor.precision = pr;\n return sum2;\n }\n }\n sum2 = t;\n denominator += 2;\n }\n}\nfunction nonFiniteToString(x) {\n return String(x.s * x.s / 0);\n}\nfunction parseDecimal(x, str) {\n var e, i, len;\n if ((e = str.indexOf(\".\")) > -1) str = str.replace(\".\", \"\");\n if ((i = str.search(/e/i)) > 0) {\n if (e < 0) e = i;\n e += +str.slice(i + 1);\n str = str.substring(0, i);\n } else if (e < 0) {\n e = str.length;\n }\n for (i = 0; str.charCodeAt(i) === 48; i++) ;\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len) ;\n str = str.slice(i, len);\n if (str) {\n len -= i;\n x.e = e = e - i - 1;\n x.d = [];\n i = (e + 1) % LOG_BASE;\n if (e < 0) i += LOG_BASE;\n if (i < len) {\n if (i) x.d.push(+str.slice(0, i));\n for (len -= LOG_BASE; i < len; ) x.d.push(+str.slice(i, i += LOG_BASE));\n str = str.slice(i);\n i = LOG_BASE - str.length;\n } else {\n i -= len;\n }\n for (; i--; ) str += \"0\";\n x.d.push(+str);\n if (external) {\n if (x.e > x.constructor.maxE) {\n x.d = null;\n x.e = NaN;\n } else if (x.e < x.constructor.minE) {\n x.e = 0;\n x.d = [0];\n }\n }\n } else {\n x.e = 0;\n x.d = [0];\n }\n return x;\n}\nfunction parseOther(x, str) {\n var base, Ctor, divisor, i, isFloat, len, p, xd, xe;\n if (str.indexOf(\"_\") > -1) {\n str = str.replace(/(\\d)_(?=\\d)/g, \"$1\");\n if (isDecimal.test(str)) return parseDecimal(x, str);\n } else if (str === \"Infinity\" || str === \"NaN\") {\n if (!+str) x.s = NaN;\n x.e = NaN;\n x.d = null;\n return x;\n }\n if (isHex.test(str)) {\n base = 16;\n str = str.toLowerCase();\n } else if (isBinary.test(str)) {\n base = 2;\n } else if (isOctal.test(str)) {\n base = 8;\n } else {\n throw Error(invalidArgument + str);\n }\n i = str.search(/p/i);\n if (i > 0) {\n p = +str.slice(i + 1);\n str = str.substring(2, i);\n } else {\n str = str.slice(2);\n }\n i = str.indexOf(\".\");\n isFloat = i >= 0;\n Ctor = x.constructor;\n if (isFloat) {\n str = str.replace(\".\", \"\");\n len = str.length;\n i = len - i;\n divisor = intPow(Ctor, new Ctor(base), i, i * 2);\n }\n xd = convertBase(str, base, BASE);\n xe = xd.length - 1;\n for (i = xe; xd[i] === 0; --i) xd.pop();\n if (i < 0) return new Ctor(x.s * 0);\n x.e = getBase10Exponent(xd, xe);\n x.d = xd;\n external = false;\n if (isFloat) x = divide(x, divisor, len * 4);\n if (p) x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p));\n external = true;\n return x;\n}\nfunction sine(Ctor, x) {\n var k, len = x.d.length;\n if (len < 3) {\n return x.isZero() ? x : taylorSeries(Ctor, 2, x, x);\n }\n k = 1.4 * Math.sqrt(len);\n k = k > 16 ? 16 : k | 0;\n x = x.times(1 / tinyPow(5, k));\n x = taylorSeries(Ctor, 2, x, x);\n var sin2_x, d5 = new Ctor(5), d16 = new Ctor(16), d20 = new Ctor(20);\n for (; k--; ) {\n sin2_x = x.times(x);\n x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20))));\n }\n return x;\n}\nfunction taylorSeries(Ctor, n, x, y, isHyperbolic) {\n var j, t, u, x2, i = 1, pr = Ctor.precision, k = Math.ceil(pr / LOG_BASE);\n external = false;\n x2 = x.times(x);\n u = new Ctor(y);\n for (; ; ) {\n t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1);\n u = isHyperbolic ? y.plus(t) : y.minus(t);\n y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1);\n t = u.plus(y);\n if (t.d[k] !== void 0) {\n for (j = k; t.d[j] === u.d[j] && j--; ) ;\n if (j == -1) break;\n }\n j = u;\n u = y;\n y = t;\n t = j;\n i++;\n }\n external = true;\n t.d.length = k + 1;\n return t;\n}\nfunction tinyPow(b, e) {\n var n = b;\n while (--e) n *= b;\n return n;\n}\nfunction toLessThanHalfPi(Ctor, x) {\n var t, isNeg = x.s < 0, pi = getPi(Ctor, Ctor.precision, 1), halfPi = pi.times(0.5);\n x = x.abs();\n if (x.lte(halfPi)) {\n quadrant = isNeg ? 4 : 1;\n return x;\n }\n t = x.divToInt(pi);\n if (t.isZero()) {\n quadrant = isNeg ? 3 : 2;\n } else {\n x = x.minus(t.times(pi));\n if (x.lte(halfPi)) {\n quadrant = isOdd(t) ? isNeg ? 2 : 3 : isNeg ? 4 : 1;\n return x;\n }\n quadrant = isOdd(t) ? isNeg ? 1 : 4 : isNeg ? 3 : 2;\n }\n return x.minus(pi).abs();\n}\nfunction toStringBinary(x, baseOut, sd, rm) {\n var base, e, i, k, len, roundUp, str, xd, y, Ctor = x.constructor, isExp = sd !== void 0;\n if (isExp) {\n checkInt32(sd, 1, MAX_DIGITS);\n if (rm === void 0) rm = Ctor.rounding;\n else checkInt32(rm, 0, 8);\n } else {\n sd = Ctor.precision;\n rm = Ctor.rounding;\n }\n if (!x.isFinite()) {\n str = nonFiniteToString(x);\n } else {\n str = finiteToString(x);\n i = str.indexOf(\".\");\n if (isExp) {\n base = 2;\n if (baseOut == 16) {\n sd = sd * 4 - 3;\n } else if (baseOut == 8) {\n sd = sd * 3 - 2;\n }\n } else {\n base = baseOut;\n }\n if (i >= 0) {\n str = str.replace(\".\", \"\");\n y = new Ctor(1);\n y.e = str.length - i;\n y.d = convertBase(finiteToString(y), 10, base);\n y.e = y.d.length;\n }\n xd = convertBase(str, 10, base);\n e = len = xd.length;\n for (; xd[--len] == 0; ) xd.pop();\n if (!xd[0]) {\n str = isExp ? \"0p+0\" : \"0\";\n } else {\n if (i < 0) {\n e--;\n } else {\n x = new Ctor(x);\n x.d = xd;\n x.e = e;\n x = divide(x, y, sd, rm, 0, base);\n xd = x.d;\n e = x.e;\n roundUp = inexact;\n }\n i = xd[sd];\n k = base / 2;\n roundUp = roundUp || xd[sd + 1] !== void 0;\n roundUp = rm < 4 ? (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2)) : i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 || rm === (x.s < 0 ? 8 : 7));\n xd.length = sd;\n if (roundUp) {\n for (; ++xd[--sd] > base - 1; ) {\n xd[sd] = 0;\n if (!sd) {\n ++e;\n xd.unshift(1);\n }\n }\n }\n for (len = xd.length; !xd[len - 1]; --len) ;\n for (i = 0, str = \"\"; i < len; i++) str += NUMERALS.charAt(xd[i]);\n if (isExp) {\n if (len > 1) {\n if (baseOut == 16 || baseOut == 8) {\n i = baseOut == 16 ? 4 : 3;\n for (--len; len % i; len++) str += \"0\";\n xd = convertBase(str, base, baseOut);\n for (len = xd.length; !xd[len - 1]; --len) ;\n for (i = 1, str = \"1.\"; i < len; i++) str += NUMERALS.charAt(xd[i]);\n } else {\n str = str.charAt(0) + \".\" + str.slice(1);\n }\n }\n str = str + (e < 0 ? \"p\" : \"p+\") + e;\n } else if (e < 0) {\n for (; ++e; ) str = \"0\" + str;\n str = \"0.\" + str;\n } else {\n if (++e > len) for (e -= len; e--; ) str += \"0\";\n else if (e < len) str = str.slice(0, e) + \".\" + str.slice(e);\n }\n }\n str = (baseOut == 16 ? \"0x\" : baseOut == 2 ? \"0b\" : baseOut == 8 ? \"0o\" : \"\") + str;\n }\n return x.s < 0 ? \"-\" + str : str;\n}\nfunction truncate(arr, len) {\n if (arr.length > len) {\n arr.length = len;\n return true;\n }\n}\nfunction abs(x) {\n return new this(x).abs();\n}\nfunction acos(x) {\n return new this(x).acos();\n}\nfunction acosh(x) {\n return new this(x).acosh();\n}\nfunction add(x, y) {\n return new this(x).plus(y);\n}\nfunction asin(x) {\n return new this(x).asin();\n}\nfunction asinh(x) {\n return new this(x).asinh();\n}\nfunction atan(x) {\n return new this(x).atan();\n}\nfunction atanh(x) {\n return new this(x).atanh();\n}\nfunction atan2(y, x) {\n y = new this(y);\n x = new this(x);\n var r, pr = this.precision, rm = this.rounding, wpr = pr + 4;\n if (!y.s || !x.s) {\n r = new this(NaN);\n } else if (!y.d && !x.d) {\n r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75);\n r.s = y.s;\n } else if (!x.d || y.isZero()) {\n r = x.s < 0 ? getPi(this, pr, rm) : new this(0);\n r.s = y.s;\n } else if (!y.d || x.isZero()) {\n r = getPi(this, wpr, 1).times(0.5);\n r.s = y.s;\n } else if (x.s < 0) {\n this.precision = wpr;\n this.rounding = 1;\n r = this.atan(divide(y, x, wpr, 1));\n x = getPi(this, wpr, 1);\n this.precision = pr;\n this.rounding = rm;\n r = y.s < 0 ? r.minus(x) : r.plus(x);\n } else {\n r = this.atan(divide(y, x, wpr, 1));\n }\n return r;\n}\nfunction cbrt(x) {\n return new this(x).cbrt();\n}\nfunction ceil(x) {\n return finalise(x = new this(x), x.e + 1, 2);\n}\nfunction clamp2(x, min3, max2) {\n return new this(x).clamp(min3, max2);\n}\nfunction config(obj) {\n if (!obj || typeof obj !== \"object\") throw Error(decimalError + \"Object expected\");\n var i, p, v, useDefaults = obj.defaults === true, ps = [\n \"precision\",\n 1,\n MAX_DIGITS,\n \"rounding\",\n 0,\n 8,\n \"toExpNeg\",\n -EXP_LIMIT,\n 0,\n \"toExpPos\",\n 0,\n EXP_LIMIT,\n \"maxE\",\n 0,\n EXP_LIMIT,\n \"minE\",\n -EXP_LIMIT,\n 0,\n \"modulo\",\n 0,\n 9\n ];\n for (i = 0; i < ps.length; i += 3) {\n if (p = ps[i], useDefaults) this[p] = DEFAULTS[p];\n if ((v = obj[p]) !== void 0) {\n if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;\n else throw Error(invalidArgument + p + \": \" + v);\n }\n }\n if (p = \"crypto\", useDefaults) this[p] = DEFAULTS[p];\n if ((v = obj[p]) !== void 0) {\n if (v === true || v === false || v === 0 || v === 1) {\n if (v) {\n if (typeof crypto != \"undefined\" && crypto && (crypto.getRandomValues || crypto.randomBytes)) {\n this[p] = true;\n } else {\n throw Error(cryptoUnavailable);\n }\n } else {\n this[p] = false;\n }\n } else {\n throw Error(invalidArgument + p + \": \" + v);\n }\n }\n return this;\n}\nfunction cos(x) {\n return new this(x).cos();\n}\nfunction cosh(x) {\n return new this(x).cosh();\n}\nfunction clone(obj) {\n var i, p, ps;\n function Decimal2(v) {\n var e, i2, t, x = this;\n if (!(x instanceof Decimal2)) return new Decimal2(v);\n x.constructor = Decimal2;\n if (isDecimalInstance(v)) {\n x.s = v.s;\n if (external) {\n if (!v.d || v.e > Decimal2.maxE) {\n x.e = NaN;\n x.d = null;\n } else if (v.e < Decimal2.minE) {\n x.e = 0;\n x.d = [0];\n } else {\n x.e = v.e;\n x.d = v.d.slice();\n }\n } else {\n x.e = v.e;\n x.d = v.d ? v.d.slice() : v.d;\n }\n return;\n }\n t = typeof v;\n if (t === \"number\") {\n if (v === 0) {\n x.s = 1 / v < 0 ? -1 : 1;\n x.e = 0;\n x.d = [0];\n return;\n }\n if (v < 0) {\n v = -v;\n x.s = -1;\n } else {\n x.s = 1;\n }\n if (v === ~~v && v < 1e7) {\n for (e = 0, i2 = v; i2 >= 10; i2 /= 10) e++;\n if (external) {\n if (e > Decimal2.maxE) {\n x.e = NaN;\n x.d = null;\n } else if (e < Decimal2.minE) {\n x.e = 0;\n x.d = [0];\n } else {\n x.e = e;\n x.d = [v];\n }\n } else {\n x.e = e;\n x.d = [v];\n }\n return;\n }\n if (v * 0 !== 0) {\n if (!v) x.s = NaN;\n x.e = NaN;\n x.d = null;\n return;\n }\n return parseDecimal(x, v.toString());\n }\n if (t === \"string\") {\n if ((i2 = v.charCodeAt(0)) === 45) {\n v = v.slice(1);\n x.s = -1;\n } else {\n if (i2 === 43) v = v.slice(1);\n x.s = 1;\n }\n return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);\n }\n if (t === \"bigint\") {\n if (v < 0) {\n v = -v;\n x.s = -1;\n } else {\n x.s = 1;\n }\n return parseDecimal(x, v.toString());\n }\n throw Error(invalidArgument + v);\n }\n Decimal2.prototype = P;\n Decimal2.ROUND_UP = 0;\n Decimal2.ROUND_DOWN = 1;\n Decimal2.ROUND_CEIL = 2;\n Decimal2.ROUND_FLOOR = 3;\n Decimal2.ROUND_HALF_UP = 4;\n Decimal2.ROUND_HALF_DOWN = 5;\n Decimal2.ROUND_HALF_EVEN = 6;\n Decimal2.ROUND_HALF_CEIL = 7;\n Decimal2.ROUND_HALF_FLOOR = 8;\n Decimal2.EUCLID = 9;\n Decimal2.config = Decimal2.set = config;\n Decimal2.clone = clone;\n Decimal2.isDecimal = isDecimalInstance;\n Decimal2.abs = abs;\n Decimal2.acos = acos;\n Decimal2.acosh = acosh;\n Decimal2.add = add;\n Decimal2.asin = asin;\n Decimal2.asinh = asinh;\n Decimal2.atan = atan;\n Decimal2.atanh = atanh;\n Decimal2.atan2 = atan2;\n Decimal2.cbrt = cbrt;\n Decimal2.ceil = ceil;\n Decimal2.clamp = clamp2;\n Decimal2.cos = cos;\n Decimal2.cosh = cosh;\n Decimal2.div = div;\n Decimal2.exp = exp;\n Decimal2.floor = floor;\n Decimal2.hypot = hypot;\n Decimal2.ln = ln;\n Decimal2.log = log;\n Decimal2.log10 = log10;\n Decimal2.log2 = log2;\n Decimal2.max = max;\n Decimal2.min = min2;\n Decimal2.mod = mod;\n Decimal2.mul = mul;\n Decimal2.pow = pow;\n Decimal2.random = random;\n Decimal2.round = round;\n Decimal2.sign = sign;\n Decimal2.sin = sin;\n Decimal2.sinh = sinh;\n Decimal2.sqrt = sqrt;\n Decimal2.sub = sub;\n Decimal2.sum = sum;\n Decimal2.tan = tan;\n Decimal2.tanh = tanh;\n Decimal2.trunc = trunc;\n if (obj === void 0) obj = {};\n if (obj) {\n if (obj.defaults !== true) {\n ps = [\"precision\", \"rounding\", \"toExpNeg\", \"toExpPos\", \"maxE\", \"minE\", \"modulo\", \"crypto\"];\n for (i = 0; i < ps.length; ) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];\n }\n }\n Decimal2.config(obj);\n return Decimal2;\n}\nfunction div(x, y) {\n return new this(x).div(y);\n}\nfunction exp(x) {\n return new this(x).exp();\n}\nfunction floor(x) {\n return finalise(x = new this(x), x.e + 1, 3);\n}\nfunction hypot() {\n var i, n, t = new this(0);\n external = false;\n for (i = 0; i < arguments.length; ) {\n n = new this(arguments[i++]);\n if (!n.d) {\n if (n.s) {\n external = true;\n return new this(1 / 0);\n }\n t = n;\n } else if (t.d) {\n t = t.plus(n.times(n));\n }\n }\n external = true;\n return t.sqrt();\n}\nfunction isDecimalInstance(obj) {\n return obj instanceof Decimal || obj && obj.toStringTag === tag || false;\n}\nfunction ln(x) {\n return new this(x).ln();\n}\nfunction log(x, y) {\n return new this(x).log(y);\n}\nfunction log2(x) {\n return new this(x).log(2);\n}\nfunction log10(x) {\n return new this(x).log(10);\n}\nfunction max() {\n return maxOrMin(this, arguments, -1);\n}\nfunction min2() {\n return maxOrMin(this, arguments, 1);\n}\nfunction mod(x, y) {\n return new this(x).mod(y);\n}\nfunction mul(x, y) {\n return new this(x).mul(y);\n}\nfunction pow(x, y) {\n return new this(x).pow(y);\n}\nfunction random(sd) {\n var d, e, k, n, i = 0, r = new this(1), rd = [];\n if (sd === void 0) sd = this.precision;\n else checkInt32(sd, 1, MAX_DIGITS);\n k = Math.ceil(sd / LOG_BASE);\n if (!this.crypto) {\n for (; i < k; ) rd[i++] = Math.random() * 1e7 | 0;\n } else if (crypto.getRandomValues) {\n d = crypto.getRandomValues(new Uint32Array(k));\n for (; i < k; ) {\n n = d[i];\n if (n >= 429e7) {\n d[i] = crypto.getRandomValues(new Uint32Array(1))[0];\n } else {\n rd[i++] = n % 1e7;\n }\n }\n } else if (crypto.randomBytes) {\n d = crypto.randomBytes(k *= 4);\n for (; i < k; ) {\n n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 127) << 24);\n if (n >= 214e7) {\n crypto.randomBytes(4).copy(d, i);\n } else {\n rd.push(n % 1e7);\n i += 4;\n }\n }\n i = k / 4;\n } else {\n throw Error(cryptoUnavailable);\n }\n k = rd[--i];\n sd %= LOG_BASE;\n if (k && sd) {\n n = mathpow(10, LOG_BASE - sd);\n rd[i] = (k / n | 0) * n;\n }\n for (; rd[i] === 0; i--) rd.pop();\n if (i < 0) {\n e = 0;\n rd = [0];\n } else {\n e = -1;\n for (; rd[0] === 0; e -= LOG_BASE) rd.shift();\n for (k = 1, n = rd[0]; n >= 10; n /= 10) k++;\n if (k < LOG_BASE) e -= LOG_BASE - k;\n }\n r.e = e;\n r.d = rd;\n return r;\n}\nfunction round(x) {\n return finalise(x = new this(x), x.e + 1, this.rounding);\n}\nfunction sign(x) {\n x = new this(x);\n return x.d ? x.d[0] ? x.s : 0 * x.s : x.s || NaN;\n}\nfunction sin(x) {\n return new this(x).sin();\n}\nfunction sinh(x) {\n return new this(x).sinh();\n}\nfunction sqrt(x) {\n return new this(x).sqrt();\n}\nfunction sub(x, y) {\n return new this(x).sub(y);\n}\nfunction sum() {\n var i = 0, args = arguments, x = new this(args[i]);\n external = false;\n for (; x.s && ++i < args.length; ) x = x.plus(args[i]);\n external = true;\n return finalise(x, this.precision, this.rounding);\n}\nfunction tan(x) {\n return new this(x).tan();\n}\nfunction tanh(x) {\n return new this(x).tanh();\n}\nfunction trunc(x) {\n return finalise(x = new this(x), x.e + 1, 1);\n}\nP[Symbol.for(\"nodejs.util.inspect.custom\")] = P.toString;\nP[Symbol.toStringTag] = \"Decimal\";\nvar Decimal = P.constructor = clone(DEFAULTS);\nLN10 = new Decimal(LN10);\nPI = new Decimal(PI);\n\n// src/components/number-input.tsx\nimport React29 from \"react\";\nimport { jsx as jsx40, jsxs as jsxs22 } from \"react/jsx-runtime\";\nvar NumberInput = React29.forwardRef(\n ({ className, type, controls, ...props }, ref) => {\n const inputRef = React29.useRef(null);\n const { min: min3, max: max2, step = 1, onChange } = props;\n const hideControls = controls === false;\n const updateValue = (event, operation) => {\n event.stopPropagation();\n event.preventDefault();\n const inputElement = inputRef.current;\n const decimalValue = new Decimal(inputElement?.value || 0);\n const decimalStep = new Decimal(step);\n const newValue = (operation ? decimalValue[operation](decimalStep) : decimalValue).toNumber();\n if (min3 !== void 0 && newValue < Number(min3) || max2 !== void 0 && newValue > Number(max2)) {\n return;\n }\n if (inputElement) {\n if (operation) {\n inputElement.value = newValue.toString();\n }\n onChange?.({\n target: { value: Number(inputElement.value) }\n });\n }\n };\n const onBlur = (e) => {\n const newValue = e.target.value;\n const inputElement = inputRef.current;\n if (!inputElement) {\n return;\n }\n if (min3 !== void 0 && newValue < Number(min3)) {\n inputElement.value = String(min3);\n } else if (max2 !== void 0 && newValue > Number(max2)) {\n inputElement.value = String(max2);\n } else {\n inputElement.value = String(Number(inputElement.value));\n }\n onChange?.({\n target: { value: Number(inputElement.value) }\n });\n };\n const handleIncrement = (e) => updateValue(e, \"plus\" /* plus */);\n const handleDecrement = (e) => updateValue(e, \"minus\" /* minus */);\n return /* @__PURE__ */ jsxs22(\"div\", { className: cn(\"relative w-full\", className), children: [\n /* @__PURE__ */ jsx40(\n Input,\n {\n type: \"number\",\n ref: inputRef,\n ...props,\n value: props.value,\n onChange: updateValue,\n className: `${hideControls ? \"text-center\" : \"pr-10\"}`,\n onBlur\n }\n ),\n hideControls ? null : /* @__PURE__ */ jsxs22(\"div\", { className: \"absolute top-0 right-3 py-2.5 h-full flex flex-col items-center justify-center space-y-0.5\", children: [\n /* @__PURE__ */ jsx40(\n \"div\",\n {\n className: \"text-Colors-Text-Default bg-surface-accent-gray-subtler rounded-full w-[22px] h-[14px] cursor-pointer flex justify-center items-center\",\n onClick: handleIncrement,\n children: /* @__PURE__ */ jsx40(\n \"svg\",\n {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"20\",\n height: \"14\",\n viewBox: \"0 0 20 14\",\n fill: \"none\",\n children: /* @__PURE__ */ jsx40(\n \"path\",\n {\n d: \"M6.90169 9H13.0983C13.8493 9 14.27 8.24649 13.806 7.7324L10.7077 4.29945C10.3474 3.90018 9.65265 3.90018 9.29231 4.29945L6.19399 7.7324C5.73001 8.24649 6.15069 9 6.90169 9Z\",\n fill: \"#414345\"\n }\n )\n }\n )\n }\n ),\n /* @__PURE__ */ jsx40(\n \"div\",\n {\n className: \"text-Colors-Text-Default bg-surface-accent-gray-subtler rounded-full w-[22px] h-[14px] cursor-pointer flex justify-center items-center\",\n onClick: handleDecrement,\n children: /* @__PURE__ */ jsx40(\n \"svg\",\n {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"20\",\n height: \"14\",\n viewBox: \"0 0 20 14\",\n fill: \"none\",\n children: /* @__PURE__ */ jsx40(\n \"path\",\n {\n d: \"M13.0983 5L6.90169 5C6.15069 5 5.73001 5.75351 6.19399 6.2676L9.29231 9.70055C9.65265 10.0998 10.3474 10.0998 10.7077 9.70055L13.806 6.2676C14.27 5.75351 13.8493 5 13.0983 5Z\",\n fill: \"#414345\"\n }\n )\n }\n )\n }\n )\n ] })\n ] });\n }\n);\nNumberInput.displayName = \"NumberInput\";\n\n// src/components/page-content.tsx\nimport { jsx as jsx41 } from \"react/jsx-runtime\";\n\n// src/components/radio-group.tsx\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { Circle as Circle4 } from \"lucide-react\";\nimport * as React30 from \"react\";\nimport { jsx as jsx42 } from \"react/jsx-runtime\";\nvar RadioGroup4 = React30.forwardRef(({ className, ...props }, ref) => {\n return /* @__PURE__ */ jsx42(\n RadioGroupPrimitive.Root,\n {\n className: cn(\"grid gap-2\", className),\n ...props,\n ref\n }\n );\n});\nRadioGroup4.displayName = RadioGroupPrimitive.Root.displayName;\nvar RadioGroupItem = React30.forwardRef(({ className, ...props }, ref) => {\n return /* @__PURE__ */ jsx42(\n RadioGroupPrimitive.Item,\n {\n ref,\n className: cn(\n \"aspect-square h-5 w-5 rounded-full border-[1.5px] border-pressed text-transparent aria-checked:border-[6px] aria-checked:border-Colors-Utility-Lake-Blue-40 ring-offset-cc-Focus-Rings-Brand-default focus:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-30\",\n className\n ),\n ...props,\n children: /* @__PURE__ */ jsx42(RadioGroupPrimitive.Indicator, { className: \"flex items-center justify-center\", children: /* @__PURE__ */ jsx42(Circle4, { className: \"h-2 w-2 fill-current text-current\" }) })\n }\n );\n});\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\n// src/components/scroll-area.tsx\nimport * as ScrollAreaPrimitive from \"@radix-ui/react-scroll-area\";\nimport * as React31 from \"react\";\nimport { jsx as jsx43, jsxs as jsxs23 } from \"react/jsx-runtime\";\nvar ScrollArea = React31.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs23(\n ScrollAreaPrimitive.Root,\n {\n ref,\n className: cn(\"relative overflow-hidden\", className),\n type: \"always\",\n ...props,\n children: [\n /* @__PURE__ */ jsx43(ScrollAreaPrimitive.Viewport, { className: \"h-full w-full rounded-[inherit]\", children }),\n /* @__PURE__ */ jsx43(ScrollBar, {}),\n /* @__PURE__ */ jsx43(ScrollAreaPrimitive.Corner, {})\n ]\n }\n));\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;\nvar ScrollBar = React31.forwardRef(({ className, orientation = \"vertical\", ...props }, ref) => /* @__PURE__ */ jsx43(\n ScrollAreaPrimitive.ScrollAreaScrollbar,\n {\n ref,\n orientation,\n className: cn(\n \"flex touch-none select-none transition-colors\",\n orientation === \"vertical\" && \"h-full w-2 border-l border-l-transparent p-[1px]\",\n orientation === \"horizontal\" && \"h-2 flex-col border-t border-t-transparent p-[1px]\",\n className\n ),\n ...props,\n children: /* @__PURE__ */ jsx43(ScrollAreaPrimitive.ScrollAreaThumb, { className: \"relative flex-1 rounded-full bg-border-hovered hover:bg-border-pressed\" })\n }\n));\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;\n\n// src/components/secondary-navigation-bar.tsx\nimport { ArrowLeftIcon } from \"@heroicons/react/24/outline\";\nimport { useEffect as useEffect10, useRef as useRef6, useState as useState8 } from \"react\";\nimport { useMedia as useMedia5 } from \"react-use\";\n\n// src/components/icons/outline/FilterIcon.tsx\nimport { jsx as jsx44 } from \"react/jsx-runtime\";\nfunction FilterIcon({ className }) {\n return /* @__PURE__ */ jsx44(\n \"svg\",\n {\n className,\n width: \"22\",\n height: \"22\",\n viewBox: \"0 0 22 22\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n children: /* @__PURE__ */ jsx44(\n \"path\",\n {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M10.0278 2.84729C7.67712 2.84729 5.37221 3.04531 3.12895 3.42572C2.37055 3.55432 1.83336 4.2145 1.83336 4.96859V5.84598C1.83336 6.51468 2.099 7.15598 2.57185 7.62882L7.13715 12.1941C7.37358 12.4305 7.5064 12.7511 7.5064 13.0855V18.6055C7.5064 18.8239 7.61951 19.0268 7.80535 19.1417C7.99118 19.2565 8.22323 19.267 8.41863 19.1693L11.1553 17.8009C12.0095 17.3738 12.5491 16.5008 12.5491 15.5458V13.0855C12.5491 12.7511 12.6819 12.4305 12.9183 12.1941L17.4837 7.62882C17.9565 7.15598 18.2221 6.51468 18.2221 5.84598V4.96857C18.2221 4.21448 17.6849 3.5543 16.9265 3.4257C14.6833 3.0453 12.3784 2.84729 10.0278 2.84729ZM3.33973 4.66863C5.51363 4.29998 7.74805 4.10794 10.0278 4.10794C12.3075 4.10794 14.5419 4.29998 16.7158 4.66861C16.8531 4.69189 16.9615 4.8142 16.9615 4.96857V5.84598C16.9615 6.18033 16.8286 6.50098 16.5922 6.7374L12.0269 11.3026C11.5541 11.7755 11.2884 12.4168 11.2884 13.0855V15.5458C11.2884 16.0233 11.0186 16.4598 10.5915 16.6734L8.76707 17.5856V13.0855C8.76707 12.4168 8.50143 11.7755 8.02859 11.3026L3.46328 6.7374C3.22685 6.50098 3.09403 6.18033 3.09403 5.84598V4.96859C3.09403 4.81422 3.20244 4.69191 3.33973 4.66863ZM15.1424 12.0035C14.9222 11.7833 14.5651 11.7833 14.3448 12.0035C14.1246 12.2238 14.1246 12.5809 14.3448 12.8011L16.3756 14.8318L14.3448 16.8625C14.1246 17.0828 14.1246 17.4399 14.3448 17.6601C14.5651 17.8804 14.9222 17.8804 15.1424 17.6601L17.1732 15.6294L19.2039 17.6601C19.4242 17.8804 19.7813 17.8804 20.0015 17.6601C20.2218 17.4399 20.2218 17.0828 20.0015 16.8625L17.9708 14.8318L20.0015 12.8011C20.2218 12.5809 20.2218 12.2238 20.0015 12.0035C19.7813 11.7833 19.4242 11.7833 19.2039 12.0035L17.1732 14.0342L15.1424 12.0035Z\",\n fill: \"#3E5CFA\"\n }\n )\n }\n );\n}\nvar FilterIcon_default = FilterIcon;\n\n// src/components/secondary-navigation-bar.tsx\nimport { Fragment as Fragment8, jsx as jsx45, jsxs as jsxs24 } from \"react/jsx-runtime\";\nfunction SecondaryNavigationBar({\n showSearchBar = true,\n searchValue,\n searchPlaceholder,\n title,\n border,\n backUrl,\n showClear,\n clearText,\n icons,\n actions,\n children,\n hasBackground = true,\n avatar,\n onSearchChange,\n onClear\n}) {\n const isMobile2 = useMedia5(\"(max-width: 768px)\");\n const navbarRef = useRef6(null);\n const [showBackground, setShowBackground] = useState8(hasBackground);\n useEffect10(() => {\n if (hasBackground) {\n setShowBackground(true);\n return;\n }\n const handleScroll = () => {\n if (navbarRef.current) {\n const { height } = navbarRef.current.getBoundingClientRect();\n setShowBackground(window.scrollY > height);\n }\n };\n window.addEventListener(\"scroll\", handleScroll);\n return () => window.removeEventListener(\"scroll\", handleScroll);\n }, [hasBackground]);\n const currentClearText = clearText || \"Clear Filters\";\n return /* @__PURE__ */ jsx45(\n \"div\",\n {\n ref: navbarRef,\n className: cn(\n \"w-full flex flex-col md:flex-row justify-center items-center px-4 md:px-6\",\n !isMobile2 && border && \"border-b border-Colors-Border-Default\",\n showBackground && \"bg-Colors-Background-Normal-Primary-Default\"\n ),\n children: /* @__PURE__ */ jsxs24(\n \"div\",\n {\n className: cn(\n \"relative w-full flex justify-between items-center h-14 md:h-15\"\n ),\n children: [\n /* @__PURE__ */ jsxs24(\n \"div\",\n {\n className: cn(\"flex items-center\", avatar?.logo && \"min-w-[76px]\"),\n children: [\n backUrl && /* @__PURE__ */ jsxs24(\"div\", { className: \"flex justify-start items-center\", children: [\n /* @__PURE__ */ jsx45(Link, { href: backUrl, className: \"flex justify-center items-center\", children: /* @__PURE__ */ jsx45(\n IconButton,\n {\n variant: !hasBackground ? \"primary\" : \"plain\",\n color: !hasBackground ? \"gray\" : \"brand\",\n size: \"md\",\n icon: ArrowLeftIcon\n }\n ) }),\n !isMobile2 && title && /* @__PURE__ */ jsx45(Separator, { orientation: \"vertical\", className: \"h-5 ml-1.5 mr-3\" })\n ] }),\n title && (!showSearchBar || !isMobile2) && (!avatar?.logo || !isMobile2) && /* @__PURE__ */ jsx45(\"div\", { className: \"flex-1 flex-shrink-0 absolute w-full md:relative md:w-auto flex items-center justify-center md:justify-start\", children: /* @__PURE__ */ jsx45(\n Display,\n {\n size: isMobile2 ? \"xs\" : \"sm\",\n className: cn(\n \"max-w-[calc(100%-168px)] md:max-w-fit flex-1 flex-shrink-0 absolute w-full md:relative md:w-auto text-center md:text-left line-clamp-1\"\n ),\n children: title\n }\n ) })\n ]\n }\n ),\n avatar?.logo && !showSearchBar && /* @__PURE__ */ jsxs24(\"div\", { className: \"flex-shrink-0 flex relative px-3 justify-center items-center space-x-1.5\", children: [\n /* @__PURE__ */ jsx45(Avatar, { size: \"sm\", src: avatar.logo }),\n avatar.name && !isMobile2 && /* @__PURE__ */ jsx45(Text, { size: \"lg\", weight: \"medium\", children: avatar.name })\n ] }),\n /* @__PURE__ */ jsx45(\n \"div\",\n {\n className: cn(\n \"w-fit flex md:w-auto justify-end\",\n !avatar?.logo && \"flex-1\"\n ),\n children: children ? /* @__PURE__ */ jsx45(\"div\", { className: \"w-fit\", children }) : /* @__PURE__ */ jsx45(Fragment8, { children: icons || actions ? /* @__PURE__ */ jsxs24(\n \"div\",\n {\n className: cn(\n \"flex justify-end items-center\",\n icons && \"space-x-1 min-w-[76px]\",\n actions && \"space-x-3\"\n ),\n children: [\n icons && icons.map((icon, index) => /* @__PURE__ */ jsx45(\n IconButton,\n {\n variant: !hasBackground ? \"primary\" : \"plain\",\n color: !hasBackground ? \"gray\" : \"brand\",\n size: \"md\",\n icon: icon.icon,\n onClick: icon.onClick\n },\n index\n )),\n actions && actions.map((action, index) => /* @__PURE__ */ jsx45(Button, { size: \"md\", ...action, children: action.label }, index))\n ]\n }\n ) : /* @__PURE__ */ jsxs24(Fragment8, { children: [\n showClear && !isMobile2 && /* @__PURE__ */ jsxs24(\n Button,\n {\n \"aria-label\": currentClearText,\n size: \"md\",\n variant: \"primary\",\n color: \"default\",\n className: \"hidden md:flex relative text-sm blue-30 text-blue-30 font-medium ml-2 mr-3 px-4 justify-center items-center\",\n onClick: onClear,\n children: [\n /* @__PURE__ */ jsx45(\"div\", { className: \"relative mr-1.5\", children: /* @__PURE__ */ jsx45(FilterIcon_default, { className: \"w-5 h-5\" }) }),\n /* @__PURE__ */ jsx45(\"span\", { className: \"hidden md:block\", children: currentClearText })\n ]\n }\n ),\n showSearchBar && /* @__PURE__ */ jsx45(\"div\", { className: \"relative w-full md:w-60\", children: /* @__PURE__ */ jsx45(\n SearchBar,\n {\n color: \"gray\",\n size: \"xs\",\n searchValue,\n placeholder: searchPlaceholder || \"Search\",\n onSearchChange: (value) => {\n onSearchChange && onSearchChange(value);\n }\n }\n ) }),\n showClear && isMobile2 && /* @__PURE__ */ jsx45(\n IconButton,\n {\n className: \"flex-shrink-0 flex relative text-sm font-medium px-4 justify-center items-center ml-3\",\n \"aria-label\": currentClearText,\n size: \"md\",\n variant: \"primary\",\n color: \"default\",\n onClick: onClear,\n children: /* @__PURE__ */ jsx45(\"div\", { className: \"relative\", children: /* @__PURE__ */ jsx45(FilterIcon_default, {}) })\n }\n )\n ] }) })\n }\n )\n ]\n }\n )\n }\n );\n}\n\n// src/components/select.tsx\nimport { CheckIcon as CheckIcon2 } from \"@heroicons/react/24/outline\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { ChevronDown as ChevronDown2, ChevronUp } from \"lucide-react\";\nimport * as React32 from \"react\";\nimport { Fragment as Fragment9, jsx as jsx46, jsxs as jsxs25 } from \"react/jsx-runtime\";\nvar Select = React32.forwardRef(({ children, placeholder, options, triggerClassName, ...props }, ref) => {\n const icon = options?.find((item) => item.value === props.value)?.icon;\n return /* @__PURE__ */ jsx46(SelectPrimitive.Root, { ...props, children: Array.isArray(options) && options.length ? /* @__PURE__ */ jsxs25(Fragment9, { children: [\n /* @__PURE__ */ jsx46(SelectTrigger, { className: cn(triggerClassName), children: /* @__PURE__ */ jsxs25(\"div\", { className: \"flex items-center\", children: [\n /* @__PURE__ */ jsx46(SelectIcon, { icon }),\n /* @__PURE__ */ jsx46(SelectValue, { placeholder })\n ] }) }),\n /* @__PURE__ */ jsx46(SelectContent, { children: options.map((item, i) => /* @__PURE__ */ jsx46(SelectItem, { ...item, children: item.label }, `${item.value}_${i}`)) })\n ] }) : children });\n});\nvar SelectGroup = SelectPrimitive.Group;\nvar SelectValue = SelectPrimitive.Value;\nvar SelectTrigger = React32.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs25(\n SelectPrimitive.Trigger,\n {\n ref,\n className: cn(\n \"flex h-10 w-full items-center justify-between rounded-md border border-Colors-Border-Default bg-Colors-Background-Neutral-On-Surface-Default text-Colors-Text-Default text-sm p-3 ring-offset-cc-Focus-Rings-Brand-default focus:shadow-cc-Focus-Rings-Brand-default placeholder:text-Colors-Text-Subtlest focus:outline-none focus:ring-0 focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-30 [&>span]:line-clamp-1 [&>.select-chevron]:aria-expanded:rotate-180\",\n className\n ),\n ...props,\n children: [\n children,\n /* @__PURE__ */ jsx46(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx46(ChevronDown2, { className: \"select-chevron h-5 w-5 text-Colors-Foreground-Subtle duration-200\" }) })\n ]\n }\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\nvar SelectScrollUpButton = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx46(\n SelectPrimitive.ScrollUpButton,\n {\n ref,\n className: cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n ),\n ...props,\n children: /* @__PURE__ */ jsx46(ChevronUp, { className: \"h-4 w-4\" })\n }\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\nvar SelectScrollDownButton = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx46(\n SelectPrimitive.ScrollDownButton,\n {\n ref,\n className: cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n ),\n ...props,\n children: /* @__PURE__ */ jsx46(ChevronDown2, { className: \"h-4 w-4\" })\n }\n));\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;\nvar SelectContent = React32.forwardRef(({ className, children, position = \"popper\", ...props }, ref) => /* @__PURE__ */ jsx46(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx46(\n SelectPrimitive.Content,\n {\n ref,\n className: cn(\n \"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md\tborder border-opaque bg-Colors-Background-Normal-Primary-Default text-Colors-Text-Default shadow-cc-Shadows-Modal-default data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n position === \"popper\" && \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n ),\n position,\n ...props,\n children: /* @__PURE__ */ jsx46(\n SelectPrimitive.Viewport,\n {\n className: cn(\n \"p-1.5 space-y-1.5\",\n position === \"popper\" && \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\"\n ),\n children\n }\n )\n }\n) }));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\nvar SelectLabel = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx46(\n SelectPrimitive.Label,\n {\n ref,\n className: cn(\n \"py-1 px-3 text-sm font-medium text-Colors-Text-Subtler\",\n className\n ),\n ...props\n }\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\nfunction SelectIcon(props) {\n const { icon, critical } = props;\n if (!icon) {\n return null;\n }\n return /* @__PURE__ */ jsx46(SelectPrimitive.Icon, { children: typeof icon === \"string\" ? (\n // 如果是字符串URL,作为背景图片显示\n /* @__PURE__ */ jsx46(\n \"div\",\n {\n className: cn(\n \"aspect-[20/20] w-5 h-5 relative bg-cover bg-no-repeat rounded-md overflow-hidden mr-1.5\",\n critical && \"text-Colors-Text-Critical-Default\"\n ),\n style: { backgroundImage: `url('${icon}')` }\n }\n )\n ) : React32.isValidElement(icon) ? (\n // 如果是React元素,直接渲染\n /* @__PURE__ */ jsx46(\n \"div\",\n {\n className: cn(\n \"mr-1.5 w-5 h-5 text-Colors-Foreground-Default\",\n critical && \"text-Colors-Foreground-Critical-Default\"\n ),\n children: icon\n }\n )\n ) : (\n // 如果是组件类型,创建元素\n /* @__PURE__ */ jsx46(\n \"div\",\n {\n className: cn(\n \"mr-1.5 w-5 h-5 text-Colors-Foreground-Default\",\n critical && \"text-Colors-Foreground-Critical-Default\"\n ),\n children: React32.createElement(icon, {\n className: cn(\n \"w-5 h-5 text-Colors-Foreground-Default\",\n critical && \"text-Colors-Foreground-Critical-Default\"\n )\n })\n }\n )\n ) });\n}\nSelectIcon.displayName = SelectPrimitive.Icon.displayName;\nvar SelectItem = React32.forwardRef(({ className, children, icon, critical, ...props }, ref) => /* @__PURE__ */ jsxs25(\n SelectPrimitive.Item,\n {\n ref,\n className: cn(\n \"relative flex justify-between w-full text-sm cursor-pointer select-none items-center rounded-md py-1 px-1.5 outline-none\",\n \"bg-Colors-Background-Normal-Secondary-Alt hover:bg-Colors-Background-Normal-Primary-Hover focus:bg-Colors-Background-Neutral-Primary-Default data-[disabled]:opacity-30 data-[disabled]:cursor-not-allowed\",\n critical ? \"text-Colors-Text-Critical-Default\" : \"focus:text-Colors-Text-Default\",\n className\n ),\n ...props,\n children: [\n /* @__PURE__ */ jsxs25(\"span\", { className: \"flex items-center grow\", children: [\n /* @__PURE__ */ jsx46(SelectIcon, { icon, critical }),\n /* @__PURE__ */ jsx46(SelectPrimitive.ItemText, { children })\n ] }),\n /* @__PURE__ */ jsx46(\"span\", { className: \"flex h-4 w-4 items-center justify-center\", children: /* @__PURE__ */ jsx46(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx46(CheckIcon2, { className: \"h-4 w-4 text-Colors-Foreground-Subtle stroke-[2px]\" }) }) })\n ]\n }\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\nvar SelectSeparator = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx46(\n SelectPrimitive.Separator,\n {\n ref,\n className: cn(\"-mx-1 my-1 h-px bg-border-default\", className),\n ...props\n }\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\n// src/components/sheet.tsx\nimport * as SheetPrimitive from \"@radix-ui/react-dialog\";\nimport { cva as cva15 } from \"class-variance-authority\";\nimport { X as X2 } from \"lucide-react\";\nimport * as React33 from \"react\";\nimport { jsx as jsx47, jsxs as jsxs26 } from \"react/jsx-runtime\";\nvar Sheet = SheetPrimitive.Root;\nvar SheetTrigger = SheetPrimitive.Trigger;\nvar SheetClose = SheetPrimitive.Close;\nvar SheetPortal = SheetPrimitive.Portal;\nvar SheetOverlay = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(\n SheetPrimitive.Overlay,\n {\n className: cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n ),\n ...props,\n ref\n }\n));\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName;\nvar sheetVariants = cva15(\n \"fixed z-50 gap-4 bg-white p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 dark:bg-slate-950\",\n {\n variants: {\n side: {\n top: \"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top\",\n bottom: \"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom\",\n left: \"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm\",\n right: \"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm\"\n }\n },\n defaultVariants: {\n side: \"right\"\n }\n }\n);\nvar SheetContent = React33.forwardRef(({ side = \"right\", className, children, ...props }, ref) => /* @__PURE__ */ jsxs26(SheetPortal, { children: [\n /* @__PURE__ */ jsx47(SheetOverlay, {}),\n /* @__PURE__ */ jsxs26(\n SheetPrimitive.Content,\n {\n ref,\n className: cn(sheetVariants({ side }), className),\n ...props,\n children: [\n children,\n /* @__PURE__ */ jsxs26(SheetPrimitive.Close, { className: \"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-slate-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-slate-100 dark:ring-offset-slate-950 dark:focus:ring-slate-300 dark:data-[state=open]:bg-slate-800\", children: [\n /* @__PURE__ */ jsx47(X2, { className: \"h-4 w-4\" }),\n /* @__PURE__ */ jsx47(\"span\", { className: \"sr-only\", children: \"Close\" })\n ] })\n ]\n }\n )\n] }));\nSheetContent.displayName = SheetPrimitive.Content.displayName;\nvar SheetHeader = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsx47(\n \"div\",\n {\n className: cn(\n \"flex flex-col space-y-2 text-center sm:text-left\",\n className\n ),\n ...props\n }\n);\nSheetHeader.displayName = \"SheetHeader\";\nvar SheetFooter = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsx47(\n \"div\",\n {\n className: cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n ),\n ...props\n }\n);\nSheetFooter.displayName = \"SheetFooter\";\nvar SheetTitle = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(\n SheetPrimitive.Title,\n {\n ref,\n className: cn(\n \"text-lg font-semibold text-slate-950 dark:text-slate-50\",\n className\n ),\n ...props\n }\n));\nSheetTitle.displayName = SheetPrimitive.Title.displayName;\nvar SheetDescription = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47(\n SheetPrimitive.Description,\n {\n ref,\n className: cn(\"text-sm text-slate-500 dark:text-slate-400\", className),\n ...props\n }\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\n// src/components/skeleton.tsx\nimport { jsx as jsx48 } from \"react/jsx-runtime\";\nfunction Skeleton({\n className,\n animate = true,\n ...props\n}) {\n return /* @__PURE__ */ jsx48(\n \"div\",\n {\n className: cn(\n \"rounded-md bg-Colors-Background-Normal-Secondary-Default\",\n className,\n animate && \"animate-pulse\"\n ),\n ...props\n }\n );\n}\n\n// src/components/slider.tsx\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport * as React34 from \"react\";\nimport { jsx as jsx49, jsxs as jsxs27 } from \"react/jsx-runtime\";\nvar Slider = React34.forwardRef(({ className, size = \"lg\", ...props }, ref) => /* @__PURE__ */ jsx49(\"div\", { className: \"w-full p-3 flex justify-center items-center h-10 rounded-lg\tborder border-Colors-Border-Default bg-Colors-Background-Normal-Primary-Active shadow-background-default text-sm text-Colors-Text-Default ring-offset-cc-Focus-Rings-Brand-default hover:border-hovered hover:bg-surface-subtle aria-[invalid=true]:border-critical aria-[invalid=true]:hover:border-Colors-Border-Critical aria-[invalid=true]:hover:bg-surface-accent-red-subtlest aria-[invalid=true]:focus-visible:ring-error file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-Colors-Text-Subtler focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-30\", children: /* @__PURE__ */ jsxs27(\n SliderPrimitive.Root,\n {\n ref,\n className: cn(\n \"relative flex w-full touch-none select-none items-center\",\n className\n ),\n ...props,\n children: [\n /* @__PURE__ */ jsx49(\n SliderPrimitive.Track,\n {\n className: cn(\n \"relative w-full grow overflow-hidden rounded-full bg-Colors-Background-Neutral-Primary-Hover data-[disabled]:opacity-30\",\n size === \"sm\" ? \"h-0.5\" : \"h-1.5\"\n ),\n children: /* @__PURE__ */ jsx49(SliderPrimitive.Range, { className: \"absolute h-full bg-Colors-Background-Brand-Default data-[disabled]:opacity-30\" })\n }\n ),\n /* @__PURE__ */ jsx49(\n SliderPrimitive.Thumb,\n {\n className: cn(\n \"block rounded-full border-Colors-Utility-Lake-Blue-40 bg-Colors-Background-Normal-Primary-Default ring-offset-cc-Focus-Rings-Brand-default transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 data-[disabled]:pointer-events-none data-[disabled]:opacity-30\",\n size === \"sm\" ? \"w-2 h-2 border-[1.5px]\" : \"w-5 h-5 border-[3px]\"\n )\n }\n )\n ]\n }\n) }));\nSlider.displayName = SliderPrimitive.Root.displayName;\nvar SliderSingle = React34.forwardRef(\n ({\n className,\n containerClassName,\n trackClassName,\n rangeClassName,\n thumbClassName,\n size = \"lg\",\n value,\n defaultValue,\n onValueChange,\n onValueCommit,\n settable = true,\n ...props\n }, ref) => /* @__PURE__ */ jsxs27(\"div\", { className: \"flex w-full items-center space-x-1.5\", children: [\n /* @__PURE__ */ jsx49(\n \"div\",\n {\n className: cn(\n \"w-full p-3 flex justify-center items-center h-10 rounded-lg border border-Colors-Border-Default bg-Colors-Background-Normal-Primary-Active shadow-background-default text-sm text-Colors-Text-Default ring-offset-cc-Focus-Rings-Brand-default hover:border-hovered hover:bg-surface-subtle aria-[invalid=true]:border-critical aria-[invalid=true]:hover:border-Colors-Border-Critical aria-[invalid=true]:hover:bg-surface-accent-red-subtlest aria-[invalid=true]:focus-visible:ring-error file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-Colors-Text-Subtler focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-30\",\n containerClassName\n ),\n children: /* @__PURE__ */ jsxs27(\n SliderPrimitive.Root,\n {\n ref,\n className: cn(\n \"relative flex w-full touch-none select-none items-center\",\n className\n ),\n value: typeof value === \"number\" ? [value] : value,\n defaultValue: typeof defaultValue === \"number\" ? [defaultValue] : defaultValue,\n onValueChange: (rootValue) => onValueChange?.(rootValue?.[0]),\n onValueCommit: (rootValue) => onValueCommit?.(rootValue?.[0]),\n ...props,\n children: [\n /* @__PURE__ */ jsx49(\n SliderPrimitive.Track,\n {\n className: cn(\n \"relative w-full grow overflow-hidden rounded-full bg-Colors-Background-Neutral-Primary-Hover data-[disabled]:opacity-30\",\n size === \"sm\" ? \"h-0.5\" : \"h-1.5\",\n trackClassName\n ),\n children: /* @__PURE__ */ jsx49(\n SliderPrimitive.Range,\n {\n className: cn(\n \"absolute h-full bg-Colors-Background-Brand-Default data-[disabled]:opacity-30\",\n rangeClassName\n )\n }\n )\n }\n ),\n /* @__PURE__ */ jsx49(\n SliderPrimitive.Thumb,\n {\n className: cn(\n \"cursor-pointer block rounded-full border-Colors-Utility-Lake-Blue-40 bg-Colors-Background-Normal-Primary-Default ring-offset-cc-Focus-Rings-Brand-default transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 data-[disabled]:pointer-events-none data-[disabled]:opacity-30\",\n size === \"sm\" ? \"w-2 h-2 border-[1.5px]\" : \"w-5 h-5 border-[3px]\",\n thumbClassName\n )\n }\n )\n ]\n }\n )\n }\n ),\n settable && /* @__PURE__ */ jsx49(\"div\", { className: \"flex-shrink-0 w-14 h-9 flex justify-center items-center rounded-lg\", children: /* @__PURE__ */ jsx49(\n NumberInput,\n {\n value,\n min: props?.min,\n max: props?.max,\n step: props?.step,\n controls: false,\n defaultValue,\n onChange: (e) => onValueChange?.(Number(e.target.value))\n }\n ) })\n ] })\n);\nSliderSingle.displayName = \"SliderSingle\";\n\n// src/components/spinner.tsx\nimport { cva as cva16 } from \"class-variance-authority\";\nimport { Loader2 as Loader23 } from \"lucide-react\";\nimport { jsx as jsx50 } from \"react/jsx-runtime\";\nvar spinnerVariants = cva16(\"animate-spin\", {\n variants: {\n size: {\n \"2xs\": \"h-3.5 w-3.5\",\n xs: \"h-4 w-4\",\n sm: \"h-5 w-5\",\n md: \"h-6 w-6\",\n xl: \"h-7 w-7\",\n lg: \"h-9 w-9\"\n },\n speed: {\n slow: \"duration-2000\",\n default: \"duration-600\",\n fast: \"duration-500\"\n },\n color: {\n default: \"text-Colors-Text-Default\",\n brand: \"text-Colors-Text-Brand-Default\",\n static: \"text-Colors-Text-Static-White\",\n warning: \"text-Colors-Text-Warning-Default\",\n success: \"text-Colors-Text-Success-Default\"\n }\n },\n defaultVariants: {\n size: \"md\",\n speed: \"default\",\n color: \"default\"\n }\n});\nfunction Spinner(props) {\n const { size, speed, color, className } = props;\n return /* @__PURE__ */ jsx50(\n Loader23,\n {\n className: cn(spinnerVariants({ size, speed, color }), className)\n }\n );\n}\n\n// src/components/switch.tsx\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\";\nimport { cva as cva17 } from \"class-variance-authority\";\nimport * as React35 from \"react\";\nimport { jsx as jsx51, jsxs as jsxs28 } from \"react/jsx-runtime\";\nvar switchSize = {\n sm: \"w-7 h-4\",\n md: \"w-[34px] h-5\",\n lg: \"w-10 h-6\"\n};\nvar switchRootVariants = cva17(\n 'peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-2 data-[state=unchecked]:focus-visible:bg-cc-Switch-bg-default disabled:cursor-not-allowed disabled:opacity-30 data-[state=\"checked\"]:bg-cc-Switch-bg-on data-[state=\"unchecked\"]:bg-cc-Switch-bg-default',\n {\n variants: {\n size: switchSize\n },\n defaultVariants: {\n size: \"lg\"\n }\n }\n);\nvar switchThumbVariants = cva17(\n \"pointer-events-none block rounded-full bg-cc-Switch-fg-on ring-0 transition-transform data-[state=unchecked]:translate-x-0\",\n {\n variants: {\n size: {\n sm: \"w-3 h-3 data-[state=checked]:translate-x-3\",\n md: \"w-4 h-4 data-[state=checked]:translate-x-[14px]\",\n lg: \"w-5 h-5 data-[state=checked]:translate-x-4\"\n }\n },\n defaultVariants: {\n size: \"lg\"\n }\n }\n);\nvar Switch = React35.forwardRef(({ className, size, label, labelClassName, ...props }, ref) => {\n const Component = label ? \"div\" : React35.Fragment;\n return /* @__PURE__ */ jsxs28(Component, { className: \"flex items-center justify-center space-x-1.5 text-Colors-Text-Default\", children: [\n /* @__PURE__ */ jsx51(\n SwitchPrimitives.Root,\n {\n className: cn(switchRootVariants({ size }), className, \"\"),\n ...props,\n ref,\n children: /* @__PURE__ */ jsx51(SwitchPrimitives.Thumb, { className: cn(switchThumbVariants({ size })) })\n }\n ),\n label && /* @__PURE__ */ jsx51(\"span\", { className: cn(\"text-sm\", labelClassName), children: label })\n ] });\n});\nSwitch.displayName = SwitchPrimitives.Root.displayName;\n\n// src/components/tabs.tsx\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport { cva as cva18 } from \"class-variance-authority\";\nimport * as React36 from \"react\";\nimport { jsx as jsx52, jsxs as jsxs29 } from \"react/jsx-runtime\";\nvar tabListVariants = cva18(\n \"relative inline-flex items-center justify-center overflow-hidden\",\n {\n variants: {\n size: {\n sm: \"h-6\",\n md: \"h-9\",\n lg: \"h-12\"\n },\n variant: {\n button: \"w-full border border-Colors-Border-Default bg-Colors-Background-Neutral-Primary-Default p-0.5\",\n underline: \"border-b border-Colors-Border-Default space-x-6\",\n icon: \"border border-Colors-Border-Default bg-Colors-Background-Neutral-Primary-Default p-0.5\"\n },\n rounded: {\n default: \"\",\n full: \"rounded-full\"\n }\n },\n compoundVariants: [\n {\n variant: \"button\",\n size: \"lg\",\n className: \"min-w-[320px]\"\n },\n {\n variant: \"button\",\n size: \"md\",\n className: \"min-w-[218px]\"\n },\n {\n variant: \"button\",\n size: \"sm\",\n className: \"min-w-[180px]\"\n },\n {\n variant: \"underline\",\n size: \"lg\",\n className: \"h-8\"\n },\n {\n variant: \"underline\",\n size: \"md\",\n className: \"h-7\"\n },\n {\n variant: \"underline\",\n size: \"sm\",\n className: \"h-6\"\n },\n {\n rounded: \"default\",\n size: \"lg\",\n className: \"rounded-xl\"\n },\n {\n rounded: \"default\",\n size: \"md\",\n className: \"rounded-lg\"\n },\n {\n rounded: \"default\",\n size: \"sm\",\n className: \"rounded-md\"\n }\n ],\n defaultVariants: {\n size: \"lg\",\n variant: \"button\",\n rounded: \"default\"\n }\n }\n);\nvar tabVariants = cva18(\n \"relative inline-flex w-full h-full items-center justify-center overflow-hidden whitespace-nowrap font-medium text-Colors-Text-Subtler aria-[selected=true]:text-Colors-Text-Brand-Default aria-[selected=true]:bg-Colors-Background-Normal-Primary-Active aria-[selected=true]:shadow-background-default [&>div>span]:hover:text-Colors-Text-Brand-Default disabled:pointer-events-none disabled:text-Colors-Text-Disabled [&>div>span]:disabled:text-Colors-Text-Disabled data-[state=active]:text-Colors-Text-Brand-Default\",\n {\n variants: {\n size: {\n sm: \"text-xs\",\n md: \"text-sm\",\n lg: \"text-base\"\n },\n variant: {\n button: \"px-3 py-2.5 flex-1 rounded-full transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-Colors-Background-Normal-Primary-Active data-[state=active]:shadow-background-default \",\n underline: \"flex items-baseline pb-2 rounded-none data-[state=active]:border-b-2 data-[state=active]:border-b-brand\",\n icon: \"px-4\"\n },\n rounded: {\n default: \"\",\n full: \"rounded-full\"\n }\n },\n compoundVariants: [\n {\n rounded: \"default\",\n size: \"lg\",\n className: \"rounded-xl\"\n },\n {\n rounded: \"default\",\n size: \"md\",\n className: \"rounded-lg\"\n },\n {\n rounded: \"default\",\n size: \"sm\",\n className: \"rounded-md\"\n }\n ],\n defaultVariants: {\n size: \"lg\",\n variant: \"button\",\n rounded: \"default\"\n }\n }\n);\nvar Tabs = React36.forwardRef(\n ({\n className,\n listClassName,\n variant = \"button\",\n size,\n isLink = false,\n rounded = \"default\",\n items,\n ...props\n }, ref) => /* @__PURE__ */ jsxs29(TabsPrimitive.Root, { ref, className: cn(className), ...props, children: [\n /* @__PURE__ */ jsx52(\"div\", { className: \"w-full flex justify-center items-center\", children: /* @__PURE__ */ jsx52(\n TabsPrimitive.List,\n {\n ref,\n className: cn(\n \"\",\n tabListVariants({ variant, size, rounded }),\n listClassName\n ),\n ...props,\n children: items?.map((item) => {\n return /* @__PURE__ */ jsx52(\n Tab,\n {\n isLink,\n variant,\n size,\n rounded,\n ...item\n },\n item.value\n );\n })\n }\n ) }),\n !isLink && /* @__PURE__ */ jsx52(\"div\", { className: \"w-full\", children: items?.map((item) => {\n return /* @__PURE__ */ jsx52(TabsContent, { value: item.value, children: item.children });\n }) })\n ] })\n);\nTabs.displayName = TabsPrimitive.Root.displayName;\nvar Tab = React36.forwardRef(\n ({\n className,\n variant,\n size,\n isLink,\n link,\n count: count2,\n label,\n icon,\n tooltip,\n hasUnRead,\n rounded = \"default\",\n onClickCallback,\n ...props\n }, ref) => {\n return /* @__PURE__ */ jsx52(Tooltip, { triggerClassName: \"w-full h-full flex-1\", ...tooltip, children: /* @__PURE__ */ jsx52(\n TabsPrimitive.Trigger,\n {\n ref,\n className: cn(\n \"tabtrigger min-w-fit\",\n tabVariants({ variant, size, rounded }),\n className\n ),\n ...props,\n onClick: (e) => {\n e.stopPropagation();\n onClickCallback?.(props.value);\n },\n children: isLink && link ? /* @__PURE__ */ jsxs29(\n link_default,\n {\n prefetch: true,\n href: link,\n className: cn(\n \"relative h-full w-full flex justify-center items-center\"\n ),\n onClick: (e) => () => {\n e.preventDefault();\n },\n children: [\n label,\n hasUnRead && /* @__PURE__ */ jsx52(Badge, { className: \"-mt-2.5\" })\n ]\n }\n ) : /* @__PURE__ */ jsxs29(\"div\", { className: \"relative flex justify-center items-center\", children: [\n label && /* @__PURE__ */ jsx52(Text, { className: \"text-inherit\", children: label }),\n icon && /* @__PURE__ */ jsx52(Icon, { component: icon, size: \"md\", className: \"text-inherit\" }),\n count2 ? /* @__PURE__ */ jsx52(Text, { size: \"sm\", className: \"ml-1 text-Colors-Text-Subtlest\", children: count2 }) : null,\n hasUnRead && /* @__PURE__ */ jsx52(Badge, { className: \"-mt-2.5\" })\n ] })\n }\n ) });\n }\n);\nTab.displayName = TabsPrimitive.Trigger.displayName;\nvar TabsContent = React36.forwardRef(({ className, ...props }, ref) => {\n return /* @__PURE__ */ jsx52(\n TabsPrimitive.Content,\n {\n ref,\n className: cn(\n \"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0\",\n className\n ),\n ...props\n }\n );\n});\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\n// src/components/textarea.tsx\nimport * as React37 from \"react\";\nimport { jsx as jsx53, jsxs as jsxs30 } from \"react/jsx-runtime\";\nvar Textarea = React37.forwardRef(\n ({ className, maxLength, value, error, maxLengthClassName, ...props }, ref) => {\n return /* @__PURE__ */ jsxs30(\"div\", { children: [\n /* @__PURE__ */ jsxs30(\"div\", { className: \"relative\", children: [\n /* @__PURE__ */ jsx53(\n \"textarea\",\n {\n className: cn(\n \"w-full min-h-[123px] p-3 pb-10 rounded-lg border border-Colors-Border-Default bg-Colors-Background-Normal-Primary-Active \",\n \"text-sm text-Colors-Text-Default placeholder:text-Colors-Text-Subtlest ring-offset-cc-Focus-Rings-Brand-default\",\n \"hover:border-hovered bg-cc-Input-bg-default hover:bg-cc-Input-bg-hover disabled:bg-cc-Input-bg-disabled aria-[invalid=true]:border-Colors-Border-Critical aria-[invalid=true]:hover:bg-Colors-Background-Critical-Subtle\",\n \"aria-[invalid=true]:focus-visible:ring-error file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-Colors-Text-Subtler\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-30\",\n maxLength && (value?.toString()?.length || 0) > maxLength || error ? \"border-Colors-Border-Critical hover:bg-Colors-Background-Critical-Subtle focus-visible:ring-error\" : \"\",\n className\n ),\n ref,\n maxLength,\n value,\n ...props\n }\n ),\n maxLength ? /* @__PURE__ */ jsx53(\n \"div\",\n {\n className: cn(\n \"absolute text-right bottom-5 right-4 border-Colors-Border-Default\",\n maxLengthClassName\n ),\n children: /* @__PURE__ */ jsx53(Text, { size: \"sm\", color: \"subtlest\", children: `${value?.toString()?.length || 0}/${maxLength}` })\n }\n ) : null\n ] }),\n error && /* @__PURE__ */ jsx53(\"div\", { className: \"w-full\", children: /* @__PURE__ */ jsx53(\n Text,\n {\n className: \"text-wrap\",\n size: \"sm\",\n weight: \"regular\",\n color: \"critical\",\n children: error\n }\n ) })\n ] });\n }\n);\nTextarea.displayName = \"Textarea\";\n\n// src/components/toggle.tsx\nimport * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport { cva as cva19 } from \"class-variance-authority\";\nimport * as React38 from \"react\";\nimport { jsx as jsx54 } from \"react/jsx-runtime\";\nvar toggleVariants = cva19(\n \"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-white text-Colors-Text-Subtlest hover:bg-slate-100 hover:text-slate-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-Colors-Background-Normal-Primary-Active data-[state=on]:text-Colors-Text-Brand-Default [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2 dark:ring-offset-slate-950 dark:hover:bg-slate-800 dark:hover:text-Colors-Text-Brand-Default dark:focus-visible:ring-slate-300 dark:data-[state=on]:bg-Colors-Background-Normal-Primary-Active dark:data-[state=on]:text-Colors-Text-Brand-Default\",\n {\n variants: {\n variant: {\n default: \"bg-transparent\",\n outline: \"border border-slate-200 bg-transparent hover:bg-slate-100 hover:text-slate-900 dark:border-slate-800 dark:hover:bg-slate-800 dark:hover:text-slate-50\"\n },\n size: {\n default: \"h-10 px-3 min-w-10\",\n sm: \"h-9 px-2.5 min-w-9\",\n lg: \"h-11 px-5 min-w-11\",\n xs: \"h-5 min-w-8 text-xs px-3\"\n }\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\"\n }\n }\n);\nvar Toggle = React38.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx54(\n TogglePrimitive.Root,\n {\n ref,\n className: cn(toggleVariants({ variant, size, className })),\n ...props\n }\n));\nToggle.displayName = TogglePrimitive.Root.displayName;\n\n// src/components/toggle-group.tsx\nimport * as ToggleGroupPrimitive from \"@radix-ui/react-toggle-group\";\nimport * as React39 from \"react\";\nimport { jsx as jsx55 } from \"react/jsx-runtime\";\nvar ToggleGroupContext = React39.createContext({\n size: \"default\",\n variant: \"default\"\n});\nvar ToggleGroup = React39.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ jsx55(\n ToggleGroupPrimitive.Root,\n {\n ref,\n className: cn(\n \"flex items-center justify-center gap-1 p-0.5 rounded-md border border-Colors-Border-Default bg-Colors-Background-Neutral-Primary-Default\",\n className\n ),\n ...props,\n children: /* @__PURE__ */ jsx55(ToggleGroupContext.Provider, { value: { variant, size }, children })\n }\n));\nToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;\nvar ToggleGroupItem = React39.forwardRef(({ className, children, variant, size, ...props }, ref) => {\n const context = React39.useContext(ToggleGroupContext);\n return /* @__PURE__ */ jsx55(\n ToggleGroupPrimitive.Item,\n {\n ref,\n className: cn(\n toggleVariants({\n variant: context.variant || variant,\n size: context.size || size\n }),\n className\n ),\n ...props,\n children\n }\n );\n});\nToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;\n\n// src/components/toast/toast.tsx\nimport * as ToastPrimitives from \"@radix-ui/react-toast\";\nimport { cva as cva20 } from \"class-variance-authority\";\nimport * as React40 from \"react\";\nimport XMarkIcon3 from \"@heroicons/react/24/outline/esm/XMarkIcon\";\nimport { jsx as jsx56 } from \"react/jsx-runtime\";\nvar ToastProvider = ToastPrimitives.Provider;\nvar viewportPositionVariants = cva20(\n \"fixed z-[1000001] flex max-h-screen w-full p-0 gap-2\",\n {\n variants: {\n position: {\n \"top-left\": \"top-6 left-6 flex-col items-start\",\n \"top-center\": \"top-6 left-1/2 -translate-x-1/2 flex-col items-center\",\n \"top-right\": \"top-6 right-6 flex-col items-end\",\n \"bottom-left\": \"bottom-6 left-6 flex-col-reverse items-start\",\n \"bottom-center\": \"bottom-6 left-1/2 -translate-x-1/2 flex-col-reverse items-center\",\n \"bottom-right\": \"bottom-6 right-6 flex-col-reverse items-end\",\n \"left-center\": \"left-6 top-1/2 -translate-y-1/2 flex-row items-center\",\n \"right-center\": \"right-6 top-1/2 -translate-y-1/2 flex-row-reverse items-center\"\n }\n },\n defaultVariants: {\n position: \"top-right\"\n }\n }\n);\nvar ToastViewport = React40.forwardRef(({ className, position, ...props }, ref) => /* @__PURE__ */ jsx56(\n ToastPrimitives.Viewport,\n {\n ref,\n className: cn(viewportPositionVariants({ position }), className),\n ...props\n }\n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\nvar toastVariants = cva20(\n \"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border border-Colors-Border-Opaque p-6 pr-8 shadow-modal-default transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 max-w-md\",\n {\n variants: {\n variant: {\n info: \"bg-Colors-Background-Normal-Primary-Default p-4\",\n warning: \"bg-Colors-Background-Normal-Primary-Default p-4\",\n error: \"bg-Colors-Background-Normal-Primary-Default p-4\",\n success: \"bg-Colors-Background-Normal-Primary-Default p-4\"\n },\n position: {\n \"top-left\": \"data-[state=open]:slide-in-from-left-full data-[state=closed]:slide-out-to-left-full\",\n \"top-center\": \"data-[state=open]:slide-in-from-top-full data-[state=closed]:slide-out-to-top-full\",\n \"top-right\": \"data-[state=open]:slide-in-from-right-full data-[state=closed]:slide-out-to-right-full\",\n \"bottom-left\": \"data-[state=open]:slide-in-from-left-full data-[state=closed]:slide-out-to-left-full\",\n \"bottom-center\": \"data-[state=open]:slide-in-from-bottom-full data-[state=closed]:slide-out-to-bottom-full\",\n \"bottom-right\": \"data-[state=open]:slide-in-from-right-full data-[state=closed]:slide-out-to-right-full\",\n \"left-center\": \"data-[state=open]:slide-in-from-left-full data-[state=closed]:slide-out-to-left-full\",\n \"right-center\": \"data-[state=open]:slide-in-from-right-full data-[state=closed]:slide-out-to-right-full\"\n }\n },\n defaultVariants: {\n variant: \"info\",\n position: \"top-right\"\n }\n }\n);\nvar Toast = React40.forwardRef(({ className, variant, position, ...props }, ref) => {\n return /* @__PURE__ */ jsx56(\n ToastPrimitives.Root,\n {\n ref,\n className: cn(toastVariants({ variant, position }), className),\n \"data-position\": position,\n ...props\n }\n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\nvar ToastAction = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx56(\n ToastPrimitives.Action,\n {\n ref,\n className: cn(\n \"inline-flex h-8 shrink-0 items-center justify-center rounded-md border border-slate-200 bg-transparent px-3 text-sm font-medium ring-offset-white transition-colors hover:bg-slate-100 focus:outline-none focus:ring-2 focus:ring-slate-950 focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-slate-100/40 group-[.destructive]:hover:border-red-500/30 group-[.destructive]:hover:bg-red-500 group-[.destructive]:hover:text-slate-50 group-[.destructive]:focus:ring-red-500 dark:border-slate-800 dark:ring-offset-slate-950 dark:hover:bg-slate-800 dark:focus:ring-slate-300 dark:group-[.destructive]:border-slate-800/40 dark:group-[.destructive]:hover:border-red-900/30 dark:group-[.destructive]:hover:bg-red-900 dark:group-[.destructive]:hover:text-slate-50 dark:group-[.destructive]:focus:ring-red-900\",\n className\n ),\n ...props\n }\n));\nToastAction.displayName = ToastPrimitives.Action.displayName;\nvar ToastClose = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx56(\n ToastPrimitives.Close,\n {\n ref,\n className: cn(\n \"absolute right-4 top-4 rounded-md p-1 text-slate-950/50 transition-opacity hover:text-slate-950 outline-none focus:outline-none focus:ring-2 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600 dark:text-slate-50/50 dark:hover:text-slate-50\",\n className\n ),\n \"toast-close\": \"\",\n ...props,\n children: /* @__PURE__ */ jsx56(XMarkIcon3, { className: \"h-5 w-5\" })\n }\n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\nvar ToastTitle = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx56(\n ToastPrimitives.Title,\n {\n ref,\n className: cn(\"text-sm font-semibold\", className),\n ...props\n }\n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\nvar ToastDescription = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx56(\n ToastPrimitives.Description,\n {\n ref,\n className: cn(\"text-sm opacity-90\", className),\n ...props\n }\n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\n// src/components/toast/toaster.tsx\nimport CheckCircleIcon2 from \"@heroicons/react/24/outline/esm/CheckCircleIcon\";\nimport ExclamationCircleIcon from \"@heroicons/react/24/outline/esm/ExclamationCircleIcon\";\nimport InformationCircleIcon2 from \"@heroicons/react/24/outline/esm/InformationCircleIcon\";\nimport XCircleIcon2 from \"@heroicons/react/24/outline/esm/XCircleIcon\";\n\n// src/components/toast/use-toast.tsx\nimport * as React41 from \"react\";\nimport { jsx as jsx57, jsxs as jsxs31 } from \"react/jsx-runtime\";\nvar TOAST_LIMIT = 8;\nvar TOAST_REMOVE_DELAY = 1e3;\nvar count = 0;\nfunction genId() {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n}\nvar toastTimeouts = /* @__PURE__ */ new Map();\nvar addToRemoveQueue = (toastId) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: \"REMOVE_TOAST\",\n toastId\n });\n }, TOAST_REMOVE_DELAY);\n toastTimeouts.set(toastId, timeout);\n};\nvar reducer = (state, action) => {\n switch (action.type) {\n case \"ADD_TOAST\":\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT)\n };\n case \"UPDATE_TOAST\":\n return {\n ...state,\n toasts: state.toasts.map(\n (t) => t.id === action.toast.id ? { ...t, ...action.toast } : t\n )\n };\n case \"DISMISS_TOAST\": {\n const { toastId } = action;\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((toast4) => {\n addToRemoveQueue(toast4.id);\n });\n }\n return {\n ...state,\n toasts: state.toasts.map(\n (t) => t.id === toastId || toastId === void 0 ? {\n ...t,\n open: false\n } : t\n )\n };\n }\n case \"REMOVE_TOAST\":\n if (action.toastId === void 0) {\n return {\n ...state,\n toasts: []\n };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId)\n };\n }\n};\nvar listeners = [];\nvar memoryState = { toasts: [] };\nfunction dispatch(action) {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n}\nfunction toast({ actions, toastId, position, ...props }) {\n const id = toastId || genId();\n const update = (props2) => dispatch({\n type: \"UPDATE_TOAST\",\n toast: { ...props2, id }\n });\n const dismiss = () => dispatch({ type: \"DISMISS_TOAST\", toastId: id });\n dispatch({\n type: \"ADD_TOAST\",\n toast: {\n ...props,\n position,\n ...actions && {\n action: /* @__PURE__ */ jsxs31(\"div\", { className: \"flex justify-start items-center gap-2\", children: [\n actions?.dismissText && /* @__PURE__ */ jsx57(\n Text,\n {\n size: \"sm\",\n weight: \"medium\",\n color: \"brand\",\n className: \"cursor-pointer\",\n onClick: () => {\n dismiss();\n },\n children: actions?.dismissText\n }\n ),\n actions?.view && actions.viewUrl && /* @__PURE__ */ jsx57(\n link_default,\n {\n href: actions.viewUrl,\n target: \"_blank\",\n rel: \"noreferrer noopener\",\n children: /* @__PURE__ */ jsx57(\"div\", { className: \"flex items-center gap-1.5\", children: /* @__PURE__ */ jsx57(\n Text,\n {\n size: \"sm\",\n weight: \"medium\",\n color: \"default\",\n className: \"cursor-pointer\",\n children: actions.view\n }\n ) })\n }\n )\n ] })\n },\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n }\n }\n });\n return {\n id,\n dismiss,\n update\n };\n}\nfunction useToast() {\n const [state, setState] = React41.useState(memoryState);\n React41.useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, [state]);\n return {\n ...state,\n toast,\n dismiss: (toastId) => dispatch({ type: \"DISMISS_TOAST\", toastId })\n };\n}\n\n// src/components/toast/toaster.tsx\nimport React42 from \"react\";\nimport { jsx as jsx58, jsxs as jsxs32 } from \"react/jsx-runtime\";\nfunction Toaster({ position = \"top-right\" } = {}) {\n const { toasts } = useToast();\n const positionGroups = React42.useMemo(() => {\n const groups = {};\n const allPositions = [\n \"top-left\",\n \"top-center\",\n \"top-right\",\n \"bottom-left\",\n \"bottom-center\",\n \"bottom-right\",\n \"left-center\",\n \"right-center\"\n ];\n allPositions.forEach((pos) => {\n groups[pos] = [];\n });\n toasts.forEach((toast4) => {\n const toastPosition = toast4.position || position;\n if (groups[toastPosition]) {\n groups[toastPosition].push(toast4);\n } else {\n groups[position].push(toast4);\n }\n });\n return groups;\n }, [toasts, position]);\n const renderToast = (toast4) => {\n const {\n id,\n title,\n description,\n action,\n variant,\n position: toastPosition\n } = toast4;\n const renderIcon2 = (variant2) => {\n switch (variant2) {\n case \"info\":\n return /* @__PURE__ */ jsx58(InformationCircleIcon2, { className: \"h-6 w-6 text-cc-Icon-Featured-icon-fg-Info\" });\n case \"success\":\n return /* @__PURE__ */ jsx58(CheckCircleIcon2, { className: \"h-6 w-6 text-cc-Icon-Featured-icon-fg-Success\" });\n case \"warning\":\n return /* @__PURE__ */ jsx58(ExclamationCircleIcon, { className: \"h-6 w-6 text-cc-Icon-Featured-icon-fg-Warning\" });\n case \"error\":\n return /* @__PURE__ */ jsx58(XCircleIcon2, { className: \"h-6 w-6 text-cc-Icon-Featured-icon-fg-Error\" });\n }\n };\n const getBackgroundColor = (variant2) => {\n switch (variant2) {\n case \"info\":\n return \"bg-Colors-Background-Info-Default\";\n case \"success\":\n return \"bg-Colors-Background-Success-Default\";\n case \"warning\":\n return \"bg-Colors-Background-Warning-Default\";\n case \"error\":\n return \"bg-Colors-Background-Critical-Default\";\n }\n };\n return /* @__PURE__ */ jsxs32(Toast, { ...toast4, position: toastPosition, children: [\n /* @__PURE__ */ jsx58(\"div\", { className: \"flex flex-col gap-3\", children: /* @__PURE__ */ jsxs32(\"div\", { className: \"flex items-start gap-3\", children: [\n /* @__PURE__ */ jsx58(\n \"div\",\n {\n className: cn(\n \"flex h-10 w-10 flex-shrink-0 flex-grow-0 items-center justify-center rounded-full\",\n getBackgroundColor(variant)\n ),\n children: renderIcon2(variant)\n }\n ),\n /* @__PURE__ */ jsxs32(\"div\", { className: \"grid gap-1\", children: [\n title && /* @__PURE__ */ jsx58(ToastTitle, { className: \"text-base text-Colors-Text-Default\", children: title }),\n description && /* @__PURE__ */ jsx58(ToastDescription, { className: \"text-sm text-Colors-Text-Subtle\", children: description }),\n action\n ] })\n ] }) }),\n /* @__PURE__ */ jsx58(ToastClose, {})\n ] }, id);\n };\n return /* @__PURE__ */ jsx58(ToastProvider, { children: Object.entries(positionGroups).map(([pos, toastsForPosition]) => /* @__PURE__ */ jsxs32(React42.Fragment, { children: [\n toastsForPosition.map(renderToast),\n toastsForPosition.length > 0 && /* @__PURE__ */ jsx58(ToastViewport, { position: pos })\n ] }, pos)) });\n}\n\n// src/components/swiper/index.tsx\nimport { cva as cva21 } from \"class-variance-authority\";\nimport { useEffect as useEffect12, useMemo as useMemo5, useRef as useRef7, useState as useState10 } from \"react\";\nimport { useRouter } from \"next/navigation\";\nimport {\n Autoplay,\n Navigation,\n FreeMode,\n Scrollbar,\n Mousewheel,\n Grid\n} from \"swiper/modules\";\nimport { Swiper as SwiperComponent, SwiperSlide } from \"swiper/react\";\nimport \"swiper/css\";\nimport \"swiper/css/navigation\";\nimport \"swiper/css/free-mode\";\nimport \"swiper/css/grid\";\nimport \"swiper/css/pagination\";\n\n// src/components/swiper/index.module.scss\nvar index_module_default = `.swiperBox {\n @apply w-full h-fit;\n}\n.swiperBox :global(.swiper) :global(.swiper-button-prev) {\n @apply bg-contain bg-no-repeat;\n background-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0iIzQxNDM0NSIgY2xhc3M9InNpemUtNSI+CiAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTEuNzggNS4yMmEuNzUuNzUgMCAwIDEgMCAxLjA2TDguMDYgMTBsMy43MiAzLjcyYS43NS43NSAwIDEgMS0xLjA2IDEuMDZsLTQuMjUtNC4yNWEuNzUuNzUgMCAwIDEgMC0xLjA2bDQuMjUtNC4yNWEuNzUuNzUgMCAwIDEgMS4wNiAwWiIgY2xpcC1ydWxlPSJldmVub2RkIiAvPgo8L3N2Zz4K\");\n}\n.swiperBox :global(.swiper) :global(.swiper-button-next) {\n @apply bg-contain bg-no-repeat;\n background-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0iIzQxNDM0NSIgY2xhc3M9InNpemUtNSI+CiAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC4yMiA1LjIyYS43NS43NSAwIDAgMSAxLjA2IDBsNC4yNSA0LjI1YS43NS43NSAwIDAgMSAwIDEuMDZsLTQuMjUgNC4yNWEuNzUuNzUgMCAwIDEtMS4wNi0xLjA2TDExLjk0IDEwIDguMjIgNi4yOGEuNzUuNzUgMCAwIDEgMC0xLjA2WiIgY2xpcC1ydWxlPSJldmVub2RkIiAvPgo8L3N2Zz4KCg==\");\n}\n.swiperBox :global(.swiper) :global(.swiper-button-prev::after) {\n @apply text-icon content-none;\n}\n.swiperBox :global(.swiper) :global(.swiper-button-next::after) {\n @apply text-icon content-none;\n}\n.swiperBox :global(.swiper.banner-swiper) :global(.banner-swiper-slide.swiper-slide-prev) {\n @apply origin-right;\n}\n.swiperBox :global(.swiper.banner-swiper) :global(.banner-swiper-slide.swiper-slide-next) {\n @apply origin-left;\n}\n.swiperBox :global(.swiper.banner-swiper) :global(.swiper-slide-active) {\n @apply opacity-100;\n}\n.swiperBox :global(.swiper.banner-swiper) :global(.swiper-button-next) {\n @apply -right-4 md:right-0 3xl:right-[calc((100%-1200px)/2-16px)];\n}\n.swiperBox :global(.swiper.banner-swiper) :global(.swiper-button-prev) {\n @apply -left-4 md:left-0 3xl:left-[calc((100%-1200px)/2-16px)];\n}\n.swiperBox :global(.swiper.feature-swiper) :global(.swiper-button-next) {\n @apply right-0;\n}\n.swiperBox :global(.swiper.feature-swiper) :global(.swiper-button-prev) {\n @apply left-0;\n}\n.swiperBox :global(.swiper.feature-swiper) :global(.swiper-button-disabled) {\n @apply hidden;\n}\n.swiperBox :global(.swiper.patron-badge-swiper) :global(.swiper-button-next) {\n @apply right-0;\n}\n.swiperBox :global(.swiper.patron-badge-swiper) :global(.swiper-button-prev) {\n @apply left-0;\n}\n.swiperBox :global(.swiper.patron-badge-swiper) :global(.swiper-button-disabled) {\n @apply hidden;\n}\n.swiperBox :global(.swiper.grid-swiper) :global(.swiper-wrapper) {\n @apply w-[100vw] md:w-full flex-wrap flex-col m-0;\n}\n.swiperBox :global(.swiper) :global(.swiper-button-next) {\n @apply hidden md:flex justify-center items-center absolute top-[50%] w-8 h-8 font-semibold text-icon border border-Colors-Border-Default bg-Colors-Background-Normal-Primary-Default rounded-full cursor-pointer hover:bg-surface-hovered active:bg-Colors-Background-Normal-Primary-Active;\n}\n.swiperBox :global(.swiper) :global(.swiper-button-next)::after {\n @apply text-icon text-xs font-bold;\n}\n.swiperBox :global(.swiper) :global(.swiper-button-prev) {\n @apply hidden md:flex justify-center items-center absolute top-[50%] w-8 h-8 font-semibold text-icon border border-Colors-Border-Default bg-Colors-Background-Normal-Primary-Default rounded-full cursor-pointer hover:bg-surface-hovered active:bg-Colors-Background-Normal-Primary-Active;\n}\n.swiperBox :global(.swiper) :global(.swiper-button-prev)::after {\n @apply text-icon text-xs font-bold;\n}\n\n.animate :global(.swiper-slide) {\n transition: transform 500ms linear;\n}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VSb290IjoiL1VzZXJzL3hpYW9ndWFuZy9jb2RlL215c2hlbGwtcmVhY3QtbGliL3NyYy9jb21wb25lbnRzL3N3aXBlciIsInNvdX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TtcbiAgICAgICAgJjo6YWZ0ZXIge1xuICAgICAgICAgIEBhcHBseSB0ZXh0LWljb24gdGV4dC14cyBmb250LWJvbGQ7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICA6Z2xvYmFsKC5zd2lwZXItYnV0dG9uLXByZXYpe1xuICAgICAgQGFwcGx5IGhpZGRlbiBtZDpmbGV4IGp1c3RpZnktY2VudGVyIGl0ZW1zLWNlbnRlciBhYnNvbHV0ZSB0b3AtWzUwJV0gdy04IGgtOCBmb250LXNlbWlib2xkIHRleHQtaWNvbiBib3JkZXIgYm9yZGVyLUNvbG9ycy1Cb3JkZXItRGVmYXVsdCBiZy1Db2xvcnMtQmFja2dyb3VuZC1Ob3JtYWwtUHJpbWFyeS1EZWZhdWx0IHJvdW5kZWQtZnVsbCBjdXJzb3ItcG9pbnRlciBob3ZlcjpiZy1zdXJmYWNlLWhvdmVyZWQgYWN0aXZlOmJnLUNvbG9ycy1CYWNrZ3JvdW5kLU5vcm1hbC1QcmltYXJ5LUFjdGl2ZTtcbiAgICAgICAgJjo6YWZ0ZXIge1xuICAgICAgICAgIEBhcHBseSB0ZXh0LWljb24gdGV4dC14cyBmb250LWJvbGQ7XG4gICAgICB9XG4gICAgfVxuICB9XG59XG5cbi5hbmltYXRlIHtcbiAgOmdsb2JhbCguc3dpcGVyLXNsaWRlKSB7XG4gICAgdHJhbnNpdGlvbjogdHJhbnNmb3JtIDUwMG1zIGxpbmVhcjtcbiAgfVxufVxuIl19 */`;\n\n// src/components/swiper/index.tsx\nimport { jsx as jsx59 } from \"react/jsx-runtime\";\nvar swiperVariants = cva21(\"\", {\n variants: {\n rounded: {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n default: \"rounded\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n xl: \"rounded-xl\",\n \"2xl\": \"rounded-2xl\",\n \"3xl\": \"rounded-3xl\",\n full: \"rounded-full\"\n }\n },\n defaultVariants: {\n rounded: \"none\"\n }\n});\nfunction Swiper(props) {\n const {\n className,\n componentClassName,\n slideClassName,\n rounded = \"none\",\n delay = 4e3,\n loop = true,\n slidesPerView = 1,\n dataList = [],\n swiperType = \"default\",\n from = \"\",\n component,\n autoplay,\n spaceBetween = 12,\n centeredSlides = true,\n gridRows = 3,\n isMobile: isMobile2 = false\n } = props;\n const isBanner = swiperType === \"banner\";\n const isFeatured = swiperType === \"featured\";\n const isGrid = swiperType === \"grid\";\n const router = useRouter();\n const Com = component || \"div\";\n const swiperList = useMemo5(() => {\n const { length } = dataList;\n if (length < 2 || isGrid || isFeatured) {\n return dataList;\n }\n const newList = dataList.slice(0);\n const last = newList.pop();\n newList.unshift(last);\n return newList;\n }, [dataList]);\n const autoPlayOptions = {\n delay\n };\n const swiperRef = useRef7();\n const fgconfigs = {\n 0: {\n slidesPerView: 1.014,\n spaceBetween: 12\n },\n 590: {\n slidesPerView: 2.1,\n slidesPerGroup: 2\n },\n 768: {\n slidesPerView: 1\n },\n 1024: {\n slidesPerView: 2,\n slidesPerGroup: 2\n },\n 1280: {\n slidesPerView: 3,\n slidesPerGroup: 3\n },\n 1536: {\n slidesPerView: 4,\n slidesPerGroup: 4\n }\n };\n const breakpoints = {\n default: {},\n banner: {\n 769: {\n spaceBetween: 20\n }\n },\n featured: fgconfigs,\n grid: fgconfigs\n };\n const swiperConfigs = {\n spaceBetween: isFeatured ? 20 : isGrid ? 0 : spaceBetween,\n autoplay: swiperList?.length > 1 && (autoplay || isBanner) ? autoPlayOptions : false,\n loop: !isFeatured && !isGrid && swiperList?.length > 1 ? loop : false,\n slidesPerView: isBanner ? \"auto\" : slidesPerView,\n centeredSlides: isGrid || isFeatured ? false : centeredSlides,\n initialSlide: isBanner ? 1 : 0,\n navigation: !isGrid,\n freeMode: (isFeatured || isGrid) && !isMobile2,\n scrollbar: (isFeatured || isGrid) && !isMobile2,\n ...(isFeatured || isGrid) && !isMobile2 ? {\n mousewheel: {\n forceToAxis: true\n // 仅水平滚动\n }\n } : {},\n ...isGrid ? { grid: { rows: gridRows } } : {},\n modules: [Autoplay, Navigation, FreeMode, Scrollbar, Mousewheel, Grid]\n };\n const [animate, setAnimate] = useState10(false);\n useEffect12(() => {\n setTimeout(() => {\n setAnimate(true);\n }, 200);\n }, []);\n const handleSlideItemClick = (e, gotoUrl, index) => {\n const swiper = swiperRef.current;\n if (!swiper) {\n return;\n }\n if (swiper.realIndex === index) {\n const hasParam = gotoUrl.includes(\"?\") ? \"&\" : \"?\";\n const fromParam = from ? `from=${from}` : \"\";\n const url = `${gotoUrl}${hasParam}${fromParam}`;\n if (!(url.startsWith(\"https\") || url.startsWith(\"http\"))) {\n router.push(url);\n } else {\n window.open(url);\n }\n } else if (e.target) {\n const rect = e.target?.getBoundingClientRect();\n const screenWidth = window.innerWidth;\n if (rect.left < screenWidth / 2 && rect.right < screenWidth / 2) {\n swiper.slidePrev();\n } else if (rect.left > screenWidth / 2 && rect.right > screenWidth / 2) {\n swiper.slideNext();\n }\n }\n };\n return /* @__PURE__ */ jsx59(\"div\", { className: index_module_default.swiperBox, children: /* @__PURE__ */ jsx59(\n SwiperComponent,\n {\n observer: true,\n observeParents: true,\n ...swiperConfigs,\n breakpoints: breakpoints[swiperType],\n className: cn(\n \"w-[100vw] md:w-full h-auto flex-shrink-0\",\n isBanner && \"banner-swiper h-[220px] md:h-auto\",\n isFeatured && \"feature-swiper !pl-4 !pr-3 md:!px-4\",\n isGrid && \"grid-swiper h-full !ml-auto !mr-auto !pl-4 !pr-3 md:!px-0\",\n animate && index_module_default.animate,\n className\n ),\n onInit: (swiper) => {\n swiperRef.current = swiper;\n },\n children: swiperList.map((item, index) => /* @__PURE__ */ jsx59(\n SwiperSlide,\n {\n className: cn(\n isBanner && \"banner-swiper-slide !w-[90%] md:!w-[98%] h-[220px] md:h-auto max-w-[1200px] aspect-[4/1] rounded-2xl opacity-30\",\n isFeatured && \"rounded-2xl !w-[100%-32px] md:!w-[100%-72px]\",\n isGrid && \"grid-swiper-slide !w-[100%-32px] md:!w-[100%-72px] !h-[100%/3] flex justify-center items-center rounded-2xl\",\n \"text-clip\",\n slideClassName\n ),\n children: /* @__PURE__ */ jsx59(\n Com,\n {\n item,\n index,\n onClick: handleSlideItemClick,\n className: cn(\n swiperVariants({ rounded }),\n (isBanner || isFeatured) && \"rounded-2xl\",\n componentClassName\n ),\n isLine: gridRows && (index + 1) % gridRows !== 0\n }\n )\n },\n index\n ))\n }\n ) });\n}\n\n// src/components/custom-notification.tsx\nimport XMarkIcon4 from \"@heroicons/react/24/outline/esm/XMarkIcon\";\nimport CheckCircleIcon3 from \"@heroicons/react/24/solid/esm/CheckCircleIcon\";\nimport ExclamationCircleIcon2 from \"@heroicons/react/24/solid/esm/ExclamationCircleIcon\";\nimport InformationCircleIcon3 from \"@heroicons/react/24/solid/esm/InformationCircleIcon\";\nimport XCircleIcon3 from \"@heroicons/react/24/solid/esm/XCircleIcon\";\nimport { toast as toast2 } from \"react-hot-toast\";\nimport { Fragment as Fragment11, jsx as jsx60, jsxs as jsxs33 } from \"react/jsx-runtime\";\nfunction CustomNotification({\n tProps,\n customProps\n}) {\n const {\n type,\n title,\n content,\n isClosable = false,\n action,\n loading\n } = customProps;\n const { id } = tProps;\n const displayedContent = !isString(content) ? JSON.stringify(content) : content;\n return /* @__PURE__ */ jsx60(\"div\", { children: /* @__PURE__ */ jsx60(\n \"div\",\n {\n id,\n className: \"z-[10000000] min-h-10 w-fit max-w-[90vw] rounded-full border border-opaque bg-Colors-Background-Normal-Primary-Active px-3 py-2 shadow-modal-default md:max-w-[560px]\",\n children: /* @__PURE__ */ jsxs33(\"div\", { className: \"flex w-full items-center justify-center gap-2\", children: [\n loading && /* @__PURE__ */ jsx60(Spinner, {}),\n !loading && type && /* @__PURE__ */ jsxs33(\"div\", { className: \"flex flex-shrink-0 items-center\", children: [\n type === \"info\" && /* @__PURE__ */ jsx60(InformationCircleIcon3, { className: \"h-6 w-6 text-cc-Icon-Featured-icon-fg-Info\" }),\n type === \"success\" && /* @__PURE__ */ jsx60(CheckCircleIcon3, { className: \"h-6 w-6 text-cc-Icon-Featured-icon-fg-Success\" }),\n type === \"warning\" && /* @__PURE__ */ jsx60(ExclamationCircleIcon2, { className: \"h-6 w-6 text-cc-Icon-Featured-icon-fg-Warning\" }),\n type === \"error\" && /* @__PURE__ */ jsx60(XCircleIcon3, { className: \"h-6 w-6 text-cc-Icon-Featured-icon-fg-Error\" })\n ] }),\n /* @__PURE__ */ jsxs33(\"div\", { className: \"flex flex-grow flex-col space-y-1 overflow-hidden\", children: [\n title && /* @__PURE__ */ jsx60(Text, { size: \"sm\", weight: \"regular\", color: \"default\", children: title }),\n /* @__PURE__ */ jsx60(\"div\", { children: /* @__PURE__ */ jsx60(Text, { size: \"sm\", weight: \"regular\", color: \"default\", children: displayedContent }) })\n ] }),\n action && /* @__PURE__ */ jsxs33(Fragment11, { children: [\n /* @__PURE__ */ jsx60(Separator, { orientation: \"vertical\", className: \"h-3\" }),\n action\n ] }),\n isClosable && /* @__PURE__ */ jsx60(\n IconButton,\n {\n size: \"sm\",\n variant: \"plain\",\n icon: XMarkIcon4,\n onClick: () => toast2.dismiss(id),\n className: \"text-Colors-Foreground-Subtlest\"\n }\n )\n ] })\n }\n ) });\n}\n\n// src/common/hooks/useNotification.tsx\nimport { useCallback as useCallback5 } from \"react\";\nimport { toast as toast3 } from \"react-hot-toast\";\nimport { jsx as jsx61 } from \"react/jsx-runtime\";\nfunction useNotification() {\n const addToast = useCallback5(\n (config2, duration2) => {\n if (config2.id) {\n toast3.remove(config2.id);\n }\n toast3.custom(\n (t) => {\n return /* @__PURE__ */ jsx61(\n CustomNotification,\n {\n tProps: { ...t, duration: duration2 },\n customProps: config2\n }\n );\n },\n {\n id: config2.id,\n duration: duration2\n }\n );\n },\n []\n );\n const message = useCallback5(\n (config2, duration2) => addToast(\n {\n ...config2\n },\n duration2\n ),\n []\n );\n const success = useCallback5(\n (config2, duration2) => addToast(\n {\n ...config2,\n type: \"success\"\n },\n duration2\n ),\n []\n );\n const error = useCallback5(\n (config2, duration2) => addToast(\n {\n ...config2,\n type: \"error\"\n },\n duration2\n ),\n []\n );\n const warning = useCallback5(\n (config2, duration2) => addToast(\n {\n ...config2,\n type: \"warning\"\n },\n duration2\n ),\n []\n );\n const info = useCallback5(\n (config2, duration2) => addToast(\n {\n ...config2,\n type: \"info\"\n },\n duration2\n ),\n []\n );\n const close = useCallback5((id) => {\n toast3.dismiss(id);\n }, []);\n return { addToast, success, error, warning, info, close, message };\n}\nvar Message = class {\n static _toast(config2, duration2) {\n if (config2.id) {\n toast3.remove(config2.id);\n }\n const addToast = () => {\n toast3.custom(\n (t) => {\n return /* @__PURE__ */ jsx61(\n CustomNotification,\n {\n tProps: { ...t, duration: duration2 },\n customProps: config2\n }\n );\n },\n {\n id: config2.id,\n duration: duration2\n }\n );\n };\n addToast();\n }\n static success(config2, duration2) {\n return this._toast(\n {\n ...config2,\n type: \"success\"\n },\n duration2\n );\n }\n static error(config2, duration2) {\n return this._toast(\n {\n ...config2,\n type: \"error\"\n },\n duration2\n );\n }\n static info(config2, duration2) {\n return this._toast(\n {\n ...config2,\n type: \"info\"\n },\n duration2\n );\n }\n static warning(config2, duration2) {\n return this._toast(\n {\n ...config2,\n type: \"warning\"\n },\n duration2\n );\n }\n static close(id) {\n toast3.dismiss(id);\n }\n};\nexport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n Alert,\n AlertDescription,\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger,\n AlertTitle,\n AspectRatio,\n Avatar,\n AvatarImage,\n AvatarRoot,\n Button,\n Checkbox,\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n CommandShortcut,\n ContextMenu,\n ContextMenuCheckboxItem,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuItem,\n ContextMenuLabel,\n ContextMenuPortal,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuTrigger,\n Description,\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n Display,\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger,\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n Form,\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n Guide,\n Heading,\n Icon,\n IconButton,\n Image2 as Image,\n Input,\n Label3 as Label,\n Link,\n Menubar,\n MenubarCheckboxItem,\n MenubarContent,\n MenubarGroup,\n MenubarItem,\n MenubarLabel,\n MenubarMenu,\n MenubarPortal,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarSeparator,\n MenubarShortcut,\n MenubarSub,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarTrigger,\n Message,\n Modal,\n ModalBody,\n ModalContent,\n ModalFooter,\n ModalHeader,\n ModalOverlay,\n ModalRoot,\n ModalTitle,\n NavigationBar,\n NumberInput,\n Paragraph,\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverRoot,\n Progress,\n RadioGroup4 as RadioGroup,\n RadioGroupItem,\n ScrollArea,\n ScrollBar,\n SearchBar,\n SecondaryNavigationBar,\n Select,\n SelectContent,\n SelectGroup,\n SelectIcon,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n Separator,\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetOverlay,\n SheetPortal,\n SheetTitle,\n SheetTrigger,\n Skeleton,\n Slider,\n SliderSingle,\n SubHeading,\n SubTitle,\n Swiper,\n Switch,\n Tab,\n Tabs,\n TabsContent,\n Text,\n Textarea,\n Title,\n Toast,\n ToastAction,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n Toaster,\n Toggle,\n ToggleGroup,\n ToggleGroupItem,\n Tooltip,\n TooltipProvider,\n buttonVariants,\n dangerouText,\n iconButtonVariants,\n reducer,\n toast,\n toggleVariants,\n useDevice,\n useFormField,\n useIsMobileByWindowWidth,\n useNativeBridge,\n useNotification,\n useToast,\n useWindowWidth\n};\n/*! Bundled license information:\n\ndecimal.js/decimal.mjs:\n (*!\n * decimal.js v10.5.0\n * An arbitrary-precision Decimal type for JavaScript.\n * https://github.com/MikeMcl/decimal.js\n * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>\n * MIT Licence\n *)\n*/\n","'use client';\n\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Icon } from './icon';\nimport { Separator } from './separator';\nimport { Text } from './typography';\nimport DownIcon from './icons/outline/DownIcon';\n\nconst Accordion = AccordionPrimitive.Root;\n\nexport type AccordionItemProps = React.ComponentPropsWithoutRef<\n typeof AccordionPrimitive.Item\n> & {\n count?: number;\n label?: string;\n headerClassName?: string;\n triggerClassName?: string;\n sticky?: boolean;\n children: React.ReactNode;\n};\nconst AccordionItem = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Item>,\n AccordionItemProps\n>((props, ref) => {\n const { className, triggerClassName, sticky, children, label, count } = props;\n\n return (\n <AccordionPrimitive.Item\n ref={ref}\n className={cn('w-full', className)}\n {...props}\n >\n <AccordionTrigger\n label={label}\n count={count}\n className={triggerClassName as string}\n sticky={sticky}\n />\n <AccordionContent>{children}</AccordionContent>\n </AccordionPrimitive.Item>\n );\n});\n\nAccordionItem.displayName = 'AccordionItem';\n\ntype AccordionTriggerProps = React.ComponentPropsWithoutRef<\n typeof AccordionPrimitive.Trigger\n> & {\n count?: number;\n label?: string;\n sticky?: boolean;\n headerClassName?: string;\n};\nconst AccordionTrigger = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Trigger>,\n AccordionTriggerProps\n>((props, ref) => {\n const {\n className,\n headerClassName = '',\n count,\n label,\n sticky,\n ...rest\n } = props;\n\n return (\n <AccordionPrimitive.Header\n className={cn('flex', headerClassName, sticky && 'sticky top-0 z-10')}\n >\n <AccordionPrimitive.Trigger\n ref={ref}\n {...rest}\n className={cn(\n 'flex flex-1 items-center justify-between font-medium transition-all [&[data-state=closed]>div>div>div>svg]:-rotate-90', // [&[data-state=open]>div>div>svg]:rotate-180\n className\n )}\n >\n <div className=\"w-full flex flex-col justify-center\">\n <div className=\"py-3\">\n <Separator />\n </div>\n <div className=\"w-full flex justify-between items-center py-1.5\">\n <div className=\"flex justify-center items-center space-x-1\">\n <Icon\n component={DownIcon}\n size=\"2xs\"\n className=\"fill-Colors-Foreground-Subtlest\"\n />\n <Text size=\"lg\" weight=\"medium\" className=\"truncate text-left\">\n {label}\n </Text>\n </div>\n {count ? (\n <Text size=\"sm\" color=\"subtlest\" className=\"flex-shrink-0\">\n {count}\n </Text>\n ) : null}\n </div>\n </div>\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n );\n});\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\n\nconst AccordionContent = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n {...props}\n className=\"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\"\n >\n <div className={cn(className)}>{children}</div>\n </AccordionPrimitive.Content>\n));\n\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\nexport { Accordion, AccordionContent, AccordionItem, AccordionTrigger };\n","import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n// import { locales } from '@/lib/config';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport function getAlternatesMap(pathname: string, isMobile?: boolean) {\n // const langMap = {} as Record<string, string>;\n // locales.forEach(locale => {\n // langMap[locale] = `https://app.myshell.ai/${locale}/${pathname}`;\n // });\n const defaultUrl = `https://app.myshell.ai/${pathname}`;\n\n return {\n canonical: defaultUrl,\n media: {\n 'only screen and (max-width: 768px)': `https://app.myshell.ai/m/${pathname}`,\n },\n\n // languages: {\n // 'x-default': defaultUrl,\n // ...langMap\n // }\n };\n}\n\nexport function limitStringLength(str: string, limit: number) {\n if (str.length > limit) {\n return `${str.substring(0, limit)}...`;\n }\n\n return str;\n}\n\nexport function loadImage(src: string): Promise<HTMLImageElement> {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = reject;\n img.src = src;\n });\n}\n\nexport function loadImageDimensions(\n url: string\n): Promise<{ width: number; height: number }> {\n return new Promise<{ width: number; height: number }>((resolve, reject) => {\n const image = new Image();\n image.onload = () => {\n resolve({ width: image.width, height: image.height });\n URL.revokeObjectURL(url);\n };\n image.onerror = () => {\n reject(new Error('Failed to load image.'));\n URL.revokeObjectURL(url);\n };\n image.src = url;\n });\n}\n","import { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst iconVariants = cva('inline-flex shrink-0', {\n variants: {\n /**\n *\n * 可用尺寸:\n * - 2xs: 12px\n * - xs: 14px\n * - sm: 16px\n * - md: 18px\n * - lg: 20px\n * - xl: 22px\n * - 2xl: 24px\n * - 3xl: 28px\n * - 4xl: 32px\n * - 5xl: 36px\n * - 6xl: 40px\n * - 7xl: 44px\n * - 8xl: 48px\n */\n size: {\n '2xs': 'w-3 h-3', // 12\n xs: 'w-3.5 h-3.5', // 14\n sm: 'w-4 h-4', // 16\n md: 'w-[18px] h-[18px]', // 18\n lg: 'w-5 h-5', // 20\n xl: 'w-[22px] h-[22px]', // 22\n '2xl': 'w-6 h-6', // 24\n '3xl': 'w-7 h-7', // 28\n '4xl': 'w-8 h-8', // 32\n '5xl': 'w-9 h-9', // 36\n '6xl': 'w-10 h-10', // 40\n '7xl': 'w-11 h-11', // 44\n '8xl': 'w-12 h-12', // 48\n },\n color: {\n default: 'text-Colors-Foreground-Default',\n subtle: 'text-Colors-Foreground-Subtle',\n subtler: 'text-Colors-Foreground-Subtler',\n subtlest: 'text-Colors-Foreground-Subtlest',\n disabled: 'text-Colors-Foreground-Disabled',\n bolder: 'text-Colors-Foreground-Bolder',\n inverse: 'text-Colors-Foreground-Static-White',\n },\n rotate: {\n '45': 'rotate-45',\n '90': 'rotate-90',\n '-45': '-rotate-45',\n '-90': '-rotate-90',\n '180': 'rotate-180',\n },\n },\n defaultVariants: {\n size: 'sm',\n color: 'default',\n },\n});\n\nexport type IconProps = React.HTMLAttributes<HTMLSpanElement> &\n VariantProps<typeof iconVariants> & {\n /**\n * icon 组件 优先heroicons\n */\n component?: React.ElementType;\n };\n\nconst Icon = React.forwardRef<HTMLSpanElement, IconProps>((props, ref) => {\n const { children, component, size, color, rotate, className, ...passProps } =\n props;\n const Com = component || 'span';\n\n return (\n <Com\n ref={ref}\n {...passProps}\n className={cn(iconVariants({ size, color, rotate }), className)}\n >\n {children}\n </Com>\n );\n});\nIcon.displayName = 'Icon';\n\nexport type IconComponent = React.ForwardRefExoticComponent<IconProps>;\nexport { Icon };\n","'use client';\n\nimport * as SeparatorPrimitive from '@radix-ui/react-separator';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(\n (\n { className, orientation = 'horizontal', decorative = true, ...props },\n ref\n ) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n 'shrink-0 border-Colors-Alpha-Black-8',\n orientation === 'horizontal' ? 'w-full border-b' : 'h-full border-r',\n className\n )}\n {...props}\n />\n )\n);\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n","/* eslint-disable react/jsx-props-no-spreading */\n/* eslint-disable react/display-name */\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { sanitize } from 'isomorphic-dompurify';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\ntype DisplayProps = React.HTMLAttributes<HTMLElement> &\n VariantProps<typeof displayVariants>;\ntype HeadingProps = React.HTMLAttributes<HTMLElement> &\n VariantProps<typeof headingVariants>;\ntype SubHeadingProps = React.HTMLAttributes<HTMLElement> &\n VariantProps<typeof subHeadingVariants>;\ntype TextProps = React.HTMLAttributes<HTMLElement> &\n VariantProps<typeof textVariants>;\ntype DescriptionProps = React.HTMLAttributes<HTMLElement> &\n VariantProps<typeof descriptionVariants>;\n\nconst colorMap = {\n default: 'text-Colors-Text-Default',\n subtle: 'text-Colors-Text-Subtle',\n subtler: 'text-Colors-Text-Subtler',\n subtlest: 'text-Colors-Text-Subtlest',\n disabled: 'text-Colors-Text-Disabled',\n inverse: 'text-Colors-Text-Bolder',\n static: 'text-Colors-Text-Static-White',\n 'static-black': 'text-Colors-Text-Static-White',\n brand: 'text-Colors-Text-Brand-Default',\n critical: 'text-Colors-Text-Critical-Default',\n 'critical-bolder': 'text-Colors-Text-Critical-Bolder',\n warning: 'text-Colors-Text-Warning-Default',\n 'warning-bolder': 'text-Colors-Text-Warning-Bolder',\n success: 'text-Colors-Text-Success-Default',\n 'success-bolder': 'text-Colors-Text-Success-Bolder',\n};\nconst lineClampMap = {\n 1: 'line-clamp-1',\n 2: 'line-clamp-2',\n 3: 'line-clamp-3',\n 4: 'line-clamp-4',\n 5: 'line-clamp-5',\n 6: 'line-clamp-6',\n};\n\nconst displayVariants = cva('font-semibold', {\n variants: {\n size: {\n '2xl': 'text-7xl',\n xl: 'text-5xl',\n lg: 'text-3xl',\n md: 'text-2xl',\n sm: 'text-xl',\n xs: 'text-lg',\n },\n color: colorMap,\n lineClamp: lineClampMap,\n },\n defaultVariants: {\n size: 'lg',\n color: 'default',\n },\n});\n\nconst headingVariants = cva('font-medium', {\n variants: {\n size: {\n h1: 'text-2xl',\n h2: 'text-xl',\n h3: 'text-lg',\n h4: 'text-base',\n h5: 'text-sm',\n },\n color: colorMap,\n lineClamp: lineClampMap,\n },\n defaultVariants: {\n size: 'h1',\n color: 'default',\n },\n});\n\nconst subHeadingVariants = cva('text-Colors-Text-Default', {\n variants: {\n size: {\n sm: 'text-xs',\n lg: 'text-sm',\n },\n color: colorMap,\n lineClamp: lineClampMap,\n },\n defaultVariants: {\n size: 'lg',\n color: 'default',\n },\n});\n\nconst textVariants = cva('', {\n variants: {\n size: {\n xs: 'text-xs',\n sm: 'text-sm',\n lg: 'text-base',\n },\n weight: {\n regular: 'font-normal',\n medium: 'font-medium',\n semibold: 'font-semibold',\n },\n color: colorMap,\n lineClamp: lineClampMap,\n },\n defaultVariants: {\n size: 'lg',\n weight: 'regular',\n color: 'default',\n },\n});\n\nconst descriptionVariants = cva('', {\n variants: {\n size: {\n lg: 'text-xs',\n sm: 'text-2xs',\n },\n weight: {\n regular: 'font-normal',\n medium: 'font-medium',\n },\n color: colorMap,\n lineClamp: lineClampMap,\n },\n defaultVariants: {\n size: 'lg',\n weight: 'regular',\n color: 'subtler',\n },\n});\n\nconst HComponentMap = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n} as const;\n\nconst TextComponentMap = {\n p: 'p',\n blockquote: 'blockquote',\n span: 'span',\n code: 'code',\n bold: 'b',\n italic: 'i',\n strikethrough: 's',\n underline: 'u',\n} as const;\n\ntype BlockProps = {\n underline?: boolean;\n strikethrough?: boolean;\n strong?: boolean;\n italic?: boolean;\n dangerous?: boolean;\n};\nconst renderBlock = (\n {\n underline = false,\n strikethrough = false,\n strong = false,\n italic = false,\n }: BlockProps,\n defaultValue: 'p' | 'span' = 'p'\n) => {\n const underlineValue = underline && 'underline';\n const strikethroughValue = strikethrough && 'strikethrough';\n const strongValue = strong && 'bold';\n const italicValue = italic && 'italic';\n\n return TextComponentMap[\n underlineValue ||\n strikethroughValue ||\n strongValue ||\n italicValue ||\n defaultValue\n ];\n};\n\nexport const dangerouText = (text: string) => {\n return sanitize(`${text}`, {\n ADD_ATTR: ['target'],\n FORBID_TAGS: [\n 'style',\n 'form',\n 'input',\n 'checkbox',\n 'svg',\n 'script',\n 'iframe',\n 'object',\n 'embed',\n 'applet',\n 'meta',\n 'link',\n 'button',\n 'textarea',\n 'select',\n 'option',\n 'img',\n ],\n FORBID_ATTR: ['action', 'style', 'data-*', 'aria-*', 'srcset', 'on*'],\n });\n};\n\nexport const Heading = React.forwardRef<\n HTMLHeadingElement,\n HeadingProps & BlockProps\n>((props, ref) => {\n const {\n className,\n size,\n color,\n lineClamp,\n children,\n dangerous,\n ...passProps\n } = props;\n const Comp = HComponentMap[size || 'h1'];\n\n const text = dangerous && dangerouText(`${children}`);\n\n return (\n <Comp\n ref={ref}\n className={cn(headingVariants({ size, color, lineClamp }), className)}\n {...passProps}\n {...(dangerous && { dangerouslySetInnerHTML: { __html: `${text}` } })}\n >\n {!dangerous ? children : null}\n </Comp>\n );\n});\n\nexport const Display = React.forwardRef<\n HTMLElement & HTMLParagraphElement,\n DisplayProps & BlockProps\n>((props, ref) => {\n const {\n className,\n size,\n color,\n lineClamp,\n underline,\n strikethrough,\n strong,\n italic,\n children,\n dangerous,\n ...passProps\n } = props;\n const Comp = renderBlock(\n {\n underline,\n strikethrough,\n strong,\n italic,\n },\n 'span'\n );\n const text = dangerous && dangerouText(`${children}`);\n\n return (\n <Comp\n ref={ref}\n className={cn(displayVariants({ size, color, lineClamp }), className)}\n {...passProps}\n {...(dangerous && { dangerouslySetInnerHTML: { __html: `${text}` } })}\n >\n {!dangerous ? children : null}\n </Comp>\n );\n});\n\nexport const Title = Heading;\n\nexport const SubHeading = React.forwardRef<\n HTMLParagraphElement,\n SubHeadingProps\n>((props, ref) => {\n const { className, size, color, children, lineClamp, ...passProps } = props;\n\n return (\n <p\n ref={ref}\n className={cn(subHeadingVariants({ size, color, lineClamp }), className)}\n {...passProps}\n >\n {children}\n </p>\n );\n});\n\nexport const SubTitle = SubHeading;\n\nexport const Text = React.forwardRef<\n HTMLElement & HTMLParagraphElement,\n TextProps & BlockProps\n>((props, ref) => {\n const {\n className,\n size,\n weight,\n color,\n lineClamp,\n underline,\n strikethrough,\n strong,\n italic,\n children,\n dangerous,\n ...passProps\n } = props;\n const Comp = renderBlock(\n {\n underline,\n strikethrough,\n strong,\n italic,\n },\n 'span'\n );\n const text = dangerous && dangerouText(`${children}`);\n\n return (\n <Comp\n ref={ref}\n className={cn(\n textVariants({ size, weight, color, lineClamp }),\n className\n )}\n {...passProps}\n {...(dangerous && { dangerouslySetInnerHTML: { __html: `${text}` } })}\n >\n {!dangerous ? children : null}\n </Comp>\n );\n});\n\nexport const Paragraph = React.forwardRef<\n HTMLElement & HTMLParagraphElement,\n TextProps & BlockProps\n>((props, ref) => {\n const {\n className,\n size,\n weight,\n color,\n lineClamp,\n underline,\n strikethrough,\n strong,\n italic,\n children,\n dangerous,\n ...passProps\n } = props;\n const Comp = renderBlock(\n {\n underline,\n strikethrough,\n strong,\n italic,\n },\n 'p'\n );\n const text = dangerous && dangerouText(`${children}`);\n\n return (\n <Comp\n ref={ref}\n className={cn(\n textVariants({ size, weight, color, lineClamp }),\n className\n )}\n {...passProps}\n {...(dangerous && { dangerouslySetInnerHTML: { __html: `${text}` } })}\n >\n {!dangerous ? children : null}\n </Comp>\n );\n});\n\nexport const Description = React.forwardRef<\n HTMLParagraphElement,\n DescriptionProps & BlockProps\n>((props, ref) => {\n const {\n className,\n size,\n weight,\n color,\n lineClamp,\n underline,\n strikethrough,\n strong,\n italic,\n children,\n dangerous,\n ...passProps\n } = props;\n const Comp = renderBlock(\n {\n underline,\n strikethrough,\n strong,\n italic,\n },\n 'span'\n );\n const text = dangerous && dangerouText(`${children}`);\n\n return (\n <Comp\n ref={ref}\n className={cn(\n descriptionVariants({ size, weight, color, lineClamp }),\n className\n )}\n {...passProps}\n {...(dangerous && { dangerouslySetInnerHTML: { __html: `${text}` } })}\n >\n {!dangerous ? children : null}\n </Comp>\n );\n});\n","import { cn } from '@/lib/utils';\n\nfunction DownIcon({ className }: { className?: string }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n className={cn('transition-all', className)}\n >\n <path d=\"M6.75593 8.8908C6.35716 9.35126 5.64284 9.35126 5.24407 8.8908L1.3708 4.41832C0.80992 3.77068 1.26997 2.76367 2.12673 2.76367L9.87328 2.76367C10.73 2.76367 11.1901 3.77068 10.6292 4.41833L6.75593 8.8908Z\" />\n </svg>\n );\n}\n\nexport default DownIcon;\n","import { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst alertVariants = cva(\n 'relative rounded-xl border flex justify-center flex-col md:flex-row md:justify-between items-center gap-3 py-2 px-3 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-Colors-Text-Default',\n {\n variants: {\n variant: {\n default:\n 'bg-Colors-Background-Normal-Primary-Default text-Colors-Text-Default',\n destructive:\n 'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive',\n warning:\n 'bg-surface-accent-yellow-subtlest border-surface-accent-yellow-subtle text-Colors-Text-Default',\n info: 'bg-surface-accent-blue-subtlest border-surface-accent-blue-subtle text-Colors-Text-Default',\n error:\n 'bg-surface-accent-red-subtlest border-surface-accent-red-subtle text-Colors-Text-Default',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n);\n\nconst Alert = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>\n>(({ className, variant, ...props }, ref) => (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n));\nAlert.displayName = 'Alert';\n\nconst AlertTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h5\n ref={ref}\n className={cn('mb-1 font-medium leading-none tracking-tight', className)}\n {...props}\n />\n));\nAlertTitle.displayName = 'AlertTitle';\n\nconst AlertDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('text-base [&_p]:leading-relaxed', className)}\n {...props}\n />\n));\nAlertDescription.displayName = 'AlertDescription';\n\nexport { Alert, AlertDescription, AlertTitle };\n","'use client';\n\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\nimport * as React from 'react';\n\nimport { buttonVariants } from './button/button';\nimport { cn } from '@/lib/utils';\n\nconst AlertDialog = AlertDialogPrimitive.Root;\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\nconst AlertDialogTrigger = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Trigger\n ref={ref}\n className={cn(\n 'ring-offset-cc-Focus-Rings-Brand-default focus-visible:outline-none focus-visible:shadow-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1',\n className\n )}\n {...props}\n />\n));\nAlertDialogTrigger.displayName = AlertDialogPrimitive.Trigger.displayName;\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={cn(\n 'fixed inset-0 z-50 bg-Colors-Background-Utilities-Overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n className\n )}\n {...props}\n ref={ref}\n />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\nconst AlertDialogContent = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed left-[50%] top-[50%] z-50 grid w-full rounded-4xl max-w-lg translate-x-[-50%] translate-y-[-50%] bg-Colors-Background-Normal-Primary-Default shadow-modal-default duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] ring-offset-cc-Focus-Rings-Brand-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1',\n className\n )}\n {...props}\n />\n </AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nfunction AlertDialogHeader({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn('flex flex-col p-4 text-Colors-Text-Default', className)}\n {...props}\n />\n );\n}\nAlertDialogHeader.displayName = 'AlertDialogHeader';\n\nfunction AlertDialogFooter({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn('flex justify-end p-4 space-x-4', className)}\n {...props}\n />\n );\n}\nAlertDialogFooter.displayName = 'AlertDialogFooter';\n\nconst AlertDialogTitle = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn('text-xl font-normal', className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogDescription = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-Colors-Text-Subtle px-4', className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName =\n AlertDialogPrimitive.Description.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={cn(buttonVariants(), className)}\n {...props}\n />\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(buttonVariants({ variant: 'secondary' }), className)}\n {...props}\n />\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n};\n","/* eslint-disable react/require-default-props */\nimport { Slot } from '@radix-ui/react-slot';\nimport { type VariantProps } from 'class-variance-authority';\nimport { Loader2 } from 'lucide-react';\nimport * as React from 'react';\n\nimport { getAssetsUrl } from '../../common/utils/common-helper';\nimport { cn } from '@/lib/utils';\n\nimport { Icon } from '../icon';\nimport { Image } from '../image';\nimport { Separator } from '../separator';\nimport { Text } from '../typography';\nimport { buttonVariants, iconVariants } from './button.styles';\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n loading?: boolean;\n icon?: React.ElementType;\n iconDirection?: 'left' | 'right';\n color?: 'default' | 'brand' | 'error' | 'chat';\n noStyle?: boolean;\n iconClassName?: string;\n iconOutBox?: boolean;\n isBlock?: boolean;\n asset?: 'energy' | 'coin';\n assetNumber?: number;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className = '',\n iconClassName,\n variant = 'primary',\n color = 'default',\n icon,\n iconDirection = 'left',\n size,\n asChild = false,\n loading = false,\n noStyle = false,\n iconOutBox = false,\n isBlock = false,\n disabled,\n children,\n autoFocus,\n asset,\n assetNumber = 0,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : 'button';\n const disable = disabled || loading;\n\n return (\n <Comp\n className={\n noStyle\n ? className\n : cn(\n buttonVariants({ variant, color, size, className }),\n disable && '!pointer-events-auto cursor-not-allowed',\n isBlock && 'w-full'\n )\n }\n ref={ref}\n disabled={disable}\n autoFocus={autoFocus}\n {...props}\n >\n {loading && (\n <span className=\"absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center\">\n <Loader2\n className={cn(\n iconVariants({ variant, size }),\n 'animate-spin',\n size === 'lg'\n ? 'h-6 w-6'\n : size === 'md'\n ? 'h-5 w-5'\n : 'h-4.5 w-4.5'\n )}\n />\n </span>\n )}\n {!asset &&\n icon &&\n iconOutBox &&\n iconDirection === 'left' &&\n renderIcon(icon, 'left', {\n loading,\n noStyle,\n iconClassName,\n variant,\n color,\n size,\n })}\n <span\n className={cn(\n 'inline-flex w-full items-center justify-center',\n loading ? 'opacity-0' : 'opacity-100',\n variant === 'plain' && 'font-medium'\n )}\n >\n {!asset &&\n icon &&\n !iconOutBox &&\n iconDirection === 'left' &&\n renderIcon(icon, 'left', {\n loading,\n noStyle,\n iconClassName,\n variant,\n color,\n size,\n })}\n {children}\n {asset ? (\n <>\n <Separator\n orientation=\"vertical\"\n className={cn(\n 'mx-1.5 h-3',\n variant === 'primary'\n ? 'border-Colors-Alpha-White-20'\n : 'border-Colors-Beta-Black-20'\n )}\n />\n <Image\n src={\n asset === 'energy'\n ? getAssetsUrl(\n 'image/bot/tag/20231214/1719340128612116720.png'\n )\n : getAssetsUrl('image/web3/20250331/shell_coin_icon_v2.png')\n }\n alt={asset}\n width={16}\n height={16}\n className=\"flex-shrink-0\"\n />\n <Text size=\"xs\" className={cn('ml-0.5 text-inherit')}>\n {assetNumber}\n </Text>\n </>\n ) : null}\n {!asset &&\n icon &&\n !iconOutBox &&\n iconDirection === 'right' &&\n renderIcon(icon, 'right', {\n loading,\n noStyle,\n iconClassName,\n variant,\n color,\n size,\n })}\n </span>\n {!asset &&\n icon &&\n iconOutBox &&\n iconDirection === 'right' &&\n renderIcon(icon, 'right', {\n loading,\n noStyle,\n iconClassName,\n variant,\n color,\n size,\n })}\n </Comp>\n );\n }\n);\nconst renderIcon = (\n icon: React.ElementType,\n direction: 'left' | 'right',\n {\n loading,\n noStyle,\n iconClassName,\n variant = 'primary',\n color = 'brand',\n size = 'lg',\n }: ButtonProps\n) => (\n <Icon\n component={icon}\n className={\n noStyle\n ? iconClassName\n : cn(\n iconVariants({ variant, size }),\n variant === 'plain' || variant === 'link'\n ? direction === 'left'\n ? 'mr-0.5'\n : 'ml-0.5'\n : direction === 'left'\n ? 'mr-1.5'\n : 'ml-1.5',\n\n iconClassName,\n loading ? 'opacity-0' : 'opacity-100'\n )\n }\n />\n);\nButton.displayName = 'Button';\n\nexport { Button, buttonVariants };\n","export const CDN_URL = 'https://www.myshellstatic.com/';\n/**\n * 通用工具函数\n */\n\n/**\n * 获取资源URL\n */\n\nexport function getAssetsUrl(url: string | any) {\n if (!isString(url) || !(url || '').trim()) {\n return url;\n }\n if (url.startsWith('http')) {\n return url;\n }\n\n return `${CDN_URL}${url}`;\n}\n\n/**\n * 格式化时长\n */\nexport function durationFormatter(seconds: number): string {\n const minutes = Math.floor(seconds / 60);\n const remainingSeconds = Math.floor(seconds % 60);\n return `${minutes}:${remainingSeconds.toString().padStart(2, '0')}`;\n}\n\n/**\n * 获取百分比\n */\nexport function getPercent(value: number, total: number): number {\n if (total === 0) return 0;\n return (value / total) * 100;\n}\n\n/**\n * 限制数值在指定范围内\n */\nexport function clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\n/**\n * 检查是否为客户端环境\n */\nexport function isClient(): boolean {\n return typeof window !== 'undefined';\n}\n\n/**\n * 为Window添加webkit属性的类型定义\n */\ndeclare global {\n interface Window {\n webkit?: {\n messageHandlers?: {\n reactNative?: {\n postMessage: (message: any) => void;\n };\n };\n };\n }\n}\n\n/**\n * 检查是否为iOS应用环境\n */\nexport function isIosApp(): boolean {\n return (\n isClient() &&\n typeof navigator !== 'undefined' &&\n /iPhone|iPad|iPod/i.test(navigator.userAgent) &&\n !!window.webkit\n );\n}\n\nexport function isString(str: any): str is string {\n return typeof str === 'string' || str instanceof String;\n}\n","import { cva } from 'class-variance-authority';\nimport RCImage, { ImagePreviewType } from 'rc-image';\nimport { ReactElement, SyntheticEvent } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst imageVariants = cva('', {\n variants: {\n rounded: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n default: 'rounded',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n '3xl': 'rounded-3xl',\n full: 'rounded-full',\n },\n object: {\n contain: 'object-contain',\n cover: 'object-cover',\n fill: 'object-fill',\n none: 'object-none',\n },\n },\n defaultVariants: {\n rounded: 'none',\n },\n});\n\nexport interface ImageProps {\n /**\n * 图片地址\n */\n src: string;\n /**\n * 图像宽度\n * string | number\n */\n width?: string | number;\n /**\n * 图像高度\n * string | number\n */\n height?: string | number;\n /**\n * 加载占位,为 true 时使用默认占位\n */\n placeholder?: boolean | ReactElement;\n /**\n * 加载失败容错地址\n */\n fallback?: string;\n /**\n * 预览参数,为 false 时禁用\n */\n // preview?: boolean;\n /**\n * 圆角,默认为 none\n */\n rounded?:\n | 'none'\n | 'sm'\n | 'default'\n | 'md'\n | 'lg'\n | 'xl'\n | '2xl'\n | '3xl'\n | 'full';\n /**\n * 填充类型\n */\n object?: 'contain' | 'cover' | 'fill' | 'none';\n /**\n * 图像描述\n */\n alt?: string;\n /**\n * image样式覆盖\n */\n className?: string;\n /**\n * image样式覆盖\n */\n imgClassName?: string;\n /**\n * 是否是背景图\n */\n isBackgroud?: boolean;\n\n preview?: boolean | ImagePreviewType;\n /**\n * 加载优先级\n *\n * @default auto\n */\n fetchPriority?: 'auto' | 'high' | 'low' | 'low';\n\n loading?: 'eager' | 'lazy';\n\n style?: React.CSSProperties;\n /**\n * 加载错误回调\n */\n onError?: (event: SyntheticEvent<HTMLImageElement, Event>) => void;\n}\n\nexport function Image({\n className,\n imgClassName,\n placeholder = true,\n width = '100%',\n height = '100%',\n src,\n rounded = 'none',\n fallback = '',\n object = 'cover',\n isBackgroud = false,\n preview = false,\n fetchPriority = 'auto',\n loading = 'eager',\n ...otherProps\n}: ImageProps) {\n return (\n <RCImage\n fetchPriority={fetchPriority}\n placeholder={placeholder}\n width={width}\n height={height}\n src={src}\n fallback={\n fallback ||\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJ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TQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=='\n }\n preview={preview}\n loading={loading}\n rootClassName={cn(\n isBackgroud && 'absolute top-0 left-0 z-0 w-full h-full',\n className\n )}\n className={cn(\n imageVariants({ rounded, object }),\n isBackgroud && 'object-cover',\n imgClassName\n )}\n {...otherProps}\n />\n );\n}\n","import { cva } from 'class-variance-authority';\n\n// 基础样式常量\nconst BASE_BUTTON =\n 'relative shrink-0 inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium transition-colors focus-visible:secondary-none focus-visible:shadow-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 disabled:pointer-events-none disabled:opacity-30 disabled:shadow-none [&>span>svg]:text-inherit [&>span>span>svg]:text-inherit';\n\n// 尺寸相关常量\nconst SIZE_CLASSES = {\n lg: {\n base: 'h-11',\n withPadding: 'h-11 min-w-11 px-6',\n text: 'text-base',\n iconSize: 'w-5 h-5',\n },\n md: {\n base: 'h-9',\n withPadding: 'h-9 min-w-9 px-4 text-sm',\n text: 'text-sm',\n iconSize: 'w-4.5 h-4.5',\n },\n sm: {\n base: 'h-7',\n withPadding: 'h-7 min-w-7 px-3 text-sm',\n text: 'text-xs',\n iconSize: 'w-4 h-4',\n },\n};\n\n// 颜色主题\nconst COLOR_THEMES = {\n default: {\n primary:\n 'bg-cc-Button-Primary-bg-default text-cc-Button-Primary-fg-default hover:bg-cc-Button-Primary-bg-hover active:bg-cc-Button-Primary-bg-active disabled:bg-cc-Button-Primary-bg-disabled',\n secondary:\n 'border-cc-Button-Secondary-border-default text-cc-Button-Secondary-fg-default bg-cc-Button-Secondary-bg-default hover:bg-cc-Button-Secondary-bg-hover active:bg-cc-Button-Secondary-bg-active disabled:text-cc-Button-Secondary-fg-alt disabled:border-cc-Button-Secondary-border-disabled',\n tertiary:\n 'border border-cc-Button-Tertiary-border-default text-cc-Button-Tertiary-fg-default bg-cc-Button-Tertiary-bg-default hover:bg-cc-Button-Tertiary-bg-hover hover:border-cc-Button-Tertiary-border-alt focus:shadow-button-tertiary-shadow active:bg-cc-Button-Tertiary-bg-active disabled:text-cc-Button-Tertiary-fg-alt ',\n link: 'rounded-none font-normal underline-offset-4 hover:underline active:underline text-cc-Link-Button-Primary-fg-default hover:text-cc-Link-Button-Primary-fg-hover active:text-cc-Link-Button-Primary-fg-active disabled:text-cc-Link-Button-Primary-fg-disabled',\n plain:\n 'text-cc-Button-Plain-fg-default hover:bg-cc-Button-Plain-bg-hover focus:shadow-cc-Focus-Rings-Brand-default active:bg-cc-Button-Plain-bg-active disabled:text-cc-Button-Plain-fg-alt ',\n },\n brand: {\n primary:\n 'text-cc-Button-Brand-fg-default bg-cc-Button-Brand-bg-default hover:bg-cc-Button-Brand-bg-hover active:bg-cc-Button-Brand-bg-active disabled:bg-cc-Button-Brand-bg-disabled shadow-none hover:shadow-button-brand focus:shadow-cc-Focus-Rings-Brand-default',\n plain:\n 'text-cc-Button-Plain-Brand-fg-default bg-cc-Button-Plain-Brand-bg-default hover:bg-cc-Button-Plain-Brand-bg-hover active:bg-cc-Button-Plain-Brand-bg-active disabled:text-cc-Button-Plain-Brand-fg-alt',\n },\n error: {\n primary:\n 'text-cc-Button-Error-Primary-fg-default bg-cc-Button-Error-Primary-bg-default hover:bg-cc-Button-Error-Primary-bg-hover active:bg-cc-Button-Error-Primary-bg-active disabled:bg-cc-Button-Error-Primary-bg-disabled shadow-none',\n\n secondary:\n 'border-cc-Button-Error-Secondary-border-default text-cc-Button-Error-Secondary-fg-default bg-cc-Button-Error-Secondary-bg-default hover:bg-cc-Button-Error-Secondary-bg-hover active:bg-cc-Button-Error-Secondary-bg-active disabled:text-cc-Button-Error-Secondary-fg-alt disabled:border-cc-Button-Error-Secondary-border-disabled',\n },\n chat: {\n primary:\n 'shadow-none text-Colors-Text-Subtle bg-Colors-Background-Normal-Secondary-Default border border-Colors-Border-Default hover:bg-Colors-Background-Neutral-Primary-Hover active:bg-surface-accent-gray-subtler active:shadow-button-pressed disabled:bg-Colors-Background-Normal-Secondary-Default disabled:text-Colors-Text-Disabled disabled:opacity-100',\n },\n};\n\n// 变体基础样式\nconst VARIANT_BASE = {\n primary: '',\n secondary: 'border shadow-none',\n tertiary: '',\n static:\n 'text-cc-Button-Static-fg-default border-cc-Button-Static-border-default bg-cc-Button-Static-bg-default hover:bg-cc-Button-Static-bg-hover active:bg-cc-Button-Static-bg-active disabled:bg-cc-Button-Static-bg-disabled disabled:text-cc-Button-Static-fg-alt',\n link: '',\n plain: '',\n opacity:\n 'text-Colors-Text-Static-White bg-Colors-Beta-White-30 border border-Colors-Beta-White-12 shadow-none hover:bg-Colors-Beta-White-40 focus:shadow-cc-Focus-Rings-Brand-default active:bg-Colors-Beta-White-50 disabled:bg-Colors-Beta-White-60 disabled:text-Colors-Beta-White-80',\n solid:\n 'shadow-none text-Colors-Text-Subtle bg-cc-Button-Solid-bg-default border border-cc-Button-Solid-border-default hover:bg-cc-Button-Solid-bg-hover hover:border-cc-Button-Solid-border-alt active:bg-cc-Button-Solid-bg-active disabled:text-cc-Button-Solid-fg-alt',\n};\n\n// 特殊布局变体\nconst SPECIAL_LAYOUTS = {\n link: 'h-fit w-fit min-w-auto px-0.5 py-0.5',\n plain: 'h-fit w-fit min-w-auto px-0.5 py-0.5',\n};\n\n// 主按钮样式\nexport const buttonVariants = cva(BASE_BUTTON, {\n variants: {\n variant: VARIANT_BASE,\n color: {\n default: '',\n brand: '',\n error: '',\n gray: '',\n chat: '',\n },\n size: {\n lg: 'h-11',\n md: 'h-9',\n sm: 'h-7',\n },\n },\n compoundVariants: [\n // 尺寸相关变体\n { variant: 'primary', size: 'lg', className: SIZE_CLASSES.lg.withPadding },\n { variant: 'primary', size: 'md', className: SIZE_CLASSES.md.withPadding },\n { variant: 'primary', size: 'sm', className: SIZE_CLASSES.sm.withPadding },\n {\n variant: 'secondary',\n size: 'lg',\n className: SIZE_CLASSES.lg.withPadding,\n },\n {\n variant: 'secondary',\n size: 'md',\n className: SIZE_CLASSES.md.withPadding,\n },\n {\n variant: 'secondary',\n size: 'sm',\n className: SIZE_CLASSES.sm.withPadding,\n },\n { variant: 'tertiary', size: 'lg', className: SIZE_CLASSES.lg.withPadding },\n { variant: 'tertiary', size: 'md', className: SIZE_CLASSES.md.withPadding },\n { variant: 'tertiary', size: 'sm', className: SIZE_CLASSES.sm.withPadding },\n { variant: 'static', size: 'lg', className: SIZE_CLASSES.lg.withPadding },\n { variant: 'static', size: 'md', className: SIZE_CLASSES.md.withPadding },\n { variant: 'static', size: 'sm', className: SIZE_CLASSES.sm.withPadding },\n\n // 颜色主题变体\n {\n variant: 'primary',\n color: 'default',\n className: COLOR_THEMES.default.primary,\n },\n {\n variant: 'primary',\n color: 'brand',\n className: COLOR_THEMES.brand.primary,\n },\n {\n variant: 'primary',\n color: 'error',\n className: COLOR_THEMES.error.primary,\n },\n { variant: 'primary', color: 'chat', className: COLOR_THEMES.chat.primary },\n {\n variant: 'tertiary',\n color: 'default',\n className: COLOR_THEMES.default.tertiary,\n },\n {\n variant: 'secondary',\n color: 'default',\n className: COLOR_THEMES.default.secondary,\n },\n {\n variant: 'secondary',\n color: 'error',\n className: COLOR_THEMES.error.secondary,\n },\n\n // 特殊布局变体\n { variant: 'link', className: SPECIAL_LAYOUTS.link },\n { variant: 'plain', className: SPECIAL_LAYOUTS.plain },\n\n // Link变体的颜色\n { variant: 'link', color: 'default', className: COLOR_THEMES.default.link },\n\n // Plain变体的颜色\n {\n variant: 'plain',\n color: 'default',\n className: COLOR_THEMES.default.plain,\n },\n { variant: 'plain', color: 'brand', className: COLOR_THEMES.brand.plain },\n\n // Link尺寸\n {\n variant: 'link',\n size: 'lg',\n className: 'h-fit w-fit px-0.5 py-0.5 text-base',\n },\n {\n variant: 'link',\n size: 'md',\n className: 'h-fit w-fit px-0.5 py-0.5 text-sm',\n },\n {\n variant: 'link',\n size: 'sm',\n className: 'h-fit w-fit px-0.5 py-0.5 text-xs',\n },\n\n // Plain尺寸\n {\n variant: 'plain',\n size: 'lg',\n className: 'h-fit w-fit px-0.5 py-0.5 text-base',\n },\n {\n variant: 'plain',\n size: 'md',\n className: 'h-fit w-fit px-0.5 py-0.5 text-sm',\n },\n {\n variant: 'plain',\n size: 'sm',\n className: 'h-fit w-fit px-0.5 py-0.5 text-xs',\n },\n ],\n defaultVariants: {\n variant: 'primary',\n color: 'default',\n size: 'lg',\n },\n});\n\n// 图标样式\nexport const iconVariants = cva(\n 'relative shrink-0 text-inherit inline-flex items-center justify-center whitespace-nowrap transition-colors ring-offset-cc-Focus-Rings-Brand-default',\n {\n variants: {\n variant: {\n primary: '',\n secondary: '',\n tertiary: '',\n link: 'font-normal',\n plain: 'font-medium',\n static: '',\n solid: '',\n opacity: '',\n },\n size: {\n lg: 'text-base w-5 h-5',\n md: 'text-sm w-4.5 h-4.5',\n sm: 'text-sm w-4 h-4',\n },\n },\n compoundVariants: [\n {\n variant: 'plain',\n size: 'lg',\n className: 'text-base w-4.5 h-4.5',\n },\n {\n variant: 'plain',\n size: 'md',\n className: 'text-sm w-4 h-4',\n },\n {\n variant: 'plain',\n size: 'sm',\n className: 'text-sm',\n },\n ],\n defaultVariants: {\n variant: 'primary',\n size: 'lg',\n },\n }\n);\n","'use client';\n\nimport * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';\n\nconst AspectRatio = AspectRatioPrimitive.Root;\n\nexport { AspectRatio };\n","import PlayIcon from '@heroicons/react/20/solid/esm/PlayIcon';\nimport { useAudio } from 'react-use';\n\nimport useAudioPlayer from '@/common/hooks/useAudioPlayer';\nimport { IconButton } from './button/icon-button';\nimport AudioPlaying from './icons/solid/audio-playing';\nimport { durationFormatter, getPercent } from '@/common/utils/common-helper';\n\nexport interface IAudioProps {\n src: string;\n}\n\nexport default function AudioPlayer({ src }: IAudioProps) {\n const AudioComp = useAudioPlayer();\n\n const [audio, state, controls, ref] = useAudio(\n <AudioComp src={src} onEnded={() => controls.seek(0)} />\n );\n\n const { paused, time, playing } = state;\n const duration = state.duration || ref.current?.duration || 0;\n\n const onAudioToggle = () => {\n if (paused) {\n // 避免同时播放多个音频\n const audios = document.getElementsByTagName('audio');\n // eslint-disable-next-line no-plusplus\n for (let i = 0, len = audios.length; i < len; i++) {\n audios[i].pause();\n }\n\n controls.play();\n } else {\n controls.pause();\n }\n };\n\n return (\n <div className=\"flex flex-col space-y-1 w-full overflow-hidden\">\n <div\n className=\"bg-Colors-Background-Brand-Default h-px w-full items-start\"\n style={{ width: `${getPercent(time, duration) * 100}%` }}\n />\n <div className=\"flex items-center space-x-3\">\n <IconButton className=\"w-6 h-6\" onClick={onAudioToggle}>\n {paused ? <PlayIcon className=\"w-3 h-3 ml-0.5\" /> : <AudioPlaying />}\n </IconButton>\n <div className=\"flex flex-col grow overflow-hidden\">\n <div className=\"text-sm text-Colors-Text-Brand-Default truncate\">\n {durationFormatter(((playing || paused) && time) || duration)}\n </div>\n </div>\n </div>\n\n {audio}\n </div>\n );\n}\n","import {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n} from 'react';\n\nimport { useDevice } from './useDevice';\n\ndeclare global {\n interface Window {\n webkitAudioContext: typeof AudioContext;\n }\n}\n\ntype AudioAPI = {\n play(arrayBuffer: ArrayBuffer, start: number): void;\n pause(): void;\n};\n\nlet audioAPI: AudioAPI | null = null;\n\nconst getAudioAPI = (): AudioAPI => {\n if (audioAPI) return audioAPI;\n\n // make it crossbrowser, vendor prefix implement is supported from 6.14 (Released 2012-09-10)\n const AudioContext = window.AudioContext || window.webkitAudioContext;\n const context = new AudioContext();\n const gainNode = context.createGain();\n // set volume to 100%\n gainNode.gain.value = 1;\n\n let currentSourceNode: AudioBufferSourceNode | null = null;\n\n // unlock the audio context\n window.addEventListener(\n 'touchstart',\n () => {\n // target to play an empty audio\n const buffer = context.createBuffer(1, 1, 22050);\n const source = context.createBufferSource();\n source.buffer = buffer;\n source.connect(context.destination);\n source.start(0);\n },\n { once: true }\n );\n\n audioAPI = {\n play(arrayBuffer: ArrayBuffer, start: number) {\n // call slice to clone, avoid disposing the input array buffer\n context.decodeAudioData(arrayBuffer.slice(0), (audioBuffer) => {\n if (context.state === 'suspended') {\n if (currentSourceNode) {\n currentSourceNode.stop();\n }\n\n context.resume();\n }\n\n if (gainNode.gain.value === 0) {\n gainNode.gain.value = 1;\n }\n const source = context.createBufferSource();\n source.buffer = audioBuffer;\n source.connect(context.destination);\n currentSourceNode = source;\n\n source.start(0, start);\n });\n },\n pause() {\n // if (context.state === 'running') {\n // context.suspend();\n // }\n // 不能判定状态,否则在 iOS 端,若录制声音,然后再继续播放,会有两条音轨播放\n context.suspend();\n },\n };\n\n return audioAPI;\n};\n\nconst IosAudioPlayer = forwardRef(\n (\n props: React.DetailedHTMLProps<\n React.AudioHTMLAttributes<HTMLAudioElement>,\n HTMLAudioElement\n >,\n ref\n ) => {\n const audioRef = useRef<HTMLAudioElement>(null);\n const audioApi = getAudioAPI();\n const loadTask = useRef<Promise<ArrayBuffer | void>>();\n\n useLayoutEffect(() => {\n return () => {\n audioApi.pause();\n if (audioRef.current) {\n audioRef.current!.pause();\n }\n };\n }, []);\n\n const handlePlay = useCallback(async () => {\n if (!audioRef.current?.paused) return Promise.reject();\n\n if (props.src && loadTask.current) {\n const arrayBuffer = await loadTask.current;\n if (arrayBuffer) {\n return audioApi.play(arrayBuffer, audioRef.current!.currentTime);\n }\n }\n\n return Promise.resolve();\n }, []);\n\n const handleLoad = useCallback(async () => {\n if (props.src) {\n try {\n loadTask.current = window\n .fetch(props.src)\n .then((response) => response.arrayBuffer())\n .catch((error) => {\n console.error(error);\n });\n } catch (error) {\n console.error(error);\n }\n }\n }, []);\n\n // expose same ref interface as audio element, delegate to muted <audio /> besides real audio play implement\n useImperativeHandle(\n ref,\n () => {\n return {\n play: () =>\n handlePlay()\n .then(() => {\n console.log('audioCompPlay');\n\n return audioRef.current!.play();\n })\n .catch(() => {\n // playing\n }),\n pause: () => {\n audioAPI?.pause();\n\n return audioRef.current!.pause();\n },\n load: () => {\n // loading the audio array buffer\n handleLoad();\n\n return audioRef.current!.load();\n },\n addEventListener: (\n type: 'play' | 'pause',\n listener: (this: HTMLAudioElement, ev: Event) => any,\n options?: boolean | AddEventListenerOptions | undefined\n ) => {\n return audioRef.current!.addEventListener(type, listener, options);\n },\n get currentTime() {\n return audioRef.current!.currentTime;\n },\n set currentTime(value) {\n audioRef.current!.currentTime = value;\n },\n get duration() {\n return audioRef.current!.duration;\n },\n get paused() {\n return audioRef.current!.paused;\n },\n };\n },\n [handlePlay, handleLoad]\n );\n\n // iOS allows muted audio played without a user gesture, use this silent <audio /> to reflect the current audio status.\n // eslint-disable-next-line react/jsx-props-no-spreading\n return <audio {...props} muted ref={audioRef} />;\n }\n);\n\nIosAudioPlayer.displayName = 'IosAudioPlayer';\n\nconst useAudioPlayer = (): React.ComponentType | 'audio' => {\n const { isIos } = useDevice();\n\n return !isIos ? 'audio' : IosAudioPlayer;\n};\n\nexport default useAudioPlayer;\n","import isMobile from 'ismobilejs';\nimport { useState, useEffect } from 'react';\n\nimport { useWindowWidth } from './useWindowWidth';\n\nexport const useDevice = () => {\n const [device, setDevice] = useState(isMobile());\n const [isWeixin, setIsWeixin] = useState<boolean>(false);\n useEffect(() => {\n const device = isMobile();\n setDevice(device);\n setIsWeixin(\n navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1\n );\n }, []);\n\n return {\n isMobile: device.phone || device.tablet,\n isIos: device.apple.phone || device.apple.tablet || device.apple.ipod,\n isWeixin,\n };\n};\n\nexport const useIsMobileByWindowWidth = () => {\n return useWindowWidth() <= 768;\n};\n","import { useEffect, useState } from 'react';\n\nexport const useWindowWidth = () => {\n const [windowWidth, setWindowWidth] = useState(0);\n useEffect(() => {\n const handleResize = () => {\n setWindowWidth(window.innerWidth);\n };\n window.addEventListener('resize', handleResize);\n handleResize();\n\n // 在组件卸载时移除事件监听\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, []);\n\n return windowWidth;\n};\n","/* eslint-disable react/no-unstable-nested-components */\n/* eslint-disable react/display-name */\n\n'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport { type VariantProps } from 'class-variance-authority';\nimport { Loader2, LucideIcon } from 'lucide-react';\nimport * as React from 'react';\nimport { ClassNameValue } from 'tailwind-merge';\nimport { useMedia } from 'react-use';\n\nimport { Icon, type IconComponent } from '../icon';\nimport { cn } from '@/lib/utils';\nimport { Tooltip } from '../tooltip';\nimport {\n iconButtonVariants,\n iconSizeVariants,\n IconButtonSize,\n} from './icon-button.styles';\n\nexport type HeroIcon = React.ForwardRefExoticComponent<\n React.PropsWithoutRef<React.SVGProps<SVGSVGElement>> & {\n title?: string;\n titleId?: string;\n } & React.RefAttributes<SVGSVGElement>\n>;\n\nexport interface IconButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof iconButtonVariants> {\n asChild?: boolean;\n loading?: boolean;\n disabled?: boolean;\n color?: 'default' | 'brand' | 'error' | 'gray';\n icon?: HeroIcon | LucideIcon | IconComponent | React.ElementType;\n hoverText?: string;\n hoverSide?: 'top' | 'right' | 'bottom' | 'left';\n iconClassName?: ClassNameValue;\n size?: IconButtonSize;\n}\n\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n iconClassName,\n className,\n variant,\n size = 'lg',\n color,\n asChild = false,\n loading = false,\n children,\n icon: IconEle,\n disabled,\n hoverText,\n hoverSide,\n ...passProps\n },\n ref\n ) => {\n const isMobile = useMedia('(max-width: 768px)');\n const Comp = asChild ? Slot : 'button';\n const iconCls = cn(iconSizeVariants[size], iconClassName);\n const disable = disabled || loading;\n\n return (\n <Tooltip\n sideOffset={4}\n size=\"md\"\n description={hoverText}\n side={hoverSide}\n disabled={isMobile}\n >\n <Comp\n className={cn(\n iconButtonVariants({ variant, size, color }),\n disable && 'cursor-not-allowed !pointer-events-auto',\n className\n )}\n ref={ref}\n disabled={disable}\n {...passProps}\n >\n {loading ? (\n <Loader2 className={cn('animate-spin', iconCls)} />\n ) : IconEle ? (\n <IconEle className={iconCls} />\n ) : React.isValidElement(children) ? (\n React.cloneElement(children, {\n className: cn(iconCls, children.props.className),\n } as React.ButtonHTMLAttributes<HTMLButtonElement>)\n ) : null}\n </Comp>\n </Tooltip>\n );\n }\n);\n\nexport { IconButton, iconButtonVariants };\n","/* eslint-disable react/jsx-no-useless-fragment */\n\n'use client';\n\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Popover } from './popover';\nimport { Description } from './typography';\nimport { useMedia } from 'react-use';\n\nconst TooltipProvider = TooltipPrimitive.Provider;\n\nconst TooltipTrigger = TooltipPrimitive.Trigger;\nconst TooltipArrow = TooltipPrimitive.Arrow;\n\nconst Tooltip = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root> & {\n /**\n * 文案大小\n */\n size?: 'sm' | 'md';\n\n /**\n * 气泡是否打开\n */\n open?: boolean;\n /**\n * 气泡是否默认打开\n */\n defaultOpen?: boolean;\n /**\n * 气泡是否禁用\n */\n disabled?: boolean;\n /**\n * 气泡标题\n */\n title?: string;\n /**\n * 气泡标题是否危险\n */\n titleDangerous?: boolean;\n /**\n * 气泡描述\n */\n description?: string | React.ReactNode;\n /**\n * 气泡描述是否危险\n */\n descriptionDangerous?: boolean;\n /**\n * 气泡样式类型\n *\n *\n * @default 'default'\n */\n variant?: 'default' | 'info' | 'message';\n /**\n * 气泡方向\n *\n * @default 'top'\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * 气泡箭头位置\n *\n * @default 'center'\n */\n align?: 'start' | 'center' | 'end';\n /**\n * 内容偏移量\n *\n * @default 6\n */\n sideOffset?: number;\n /**\n * 箭头偏移量\n *\n * @default -2\n */\n alignOffset?: number;\n /**\n * 箭头样式\n */\n arrowClassName?: string;\n /**\n * 是否显示箭头\n *\n * @default true\n */\n showArrow?: boolean;\n /**\n * 内容样式\n */\n contentClassName?: string;\n /**\n * 触发器样式\n */\n triggerClassName?: string;\n }\n>(\n (\n {\n open,\n defaultOpen,\n disabled = false,\n children,\n title,\n description,\n size = 'sm',\n titleDangerous = false,\n descriptionDangerous = false,\n contentClassName,\n triggerClassName,\n ...props\n },\n ref\n ) => {\n const isDesktop = !useMedia('(max-width: 768px)');\n const defaultTitleColor =\n props.variant === 'message'\n ? 'static'\n : props.variant === 'default'\n ? 'warning-bolder'\n : 'default';\n const defaultDescColor =\n props.variant === 'message'\n ? 'static'\n : props.variant === 'info'\n ? 'warning-bolder'\n : 'default';\n\n if (disabled) {\n return <>{children}</>;\n }\n return (\n <>\n {isDesktop ? (\n <TooltipProvider>\n <TooltipPrimitive.Root\n open={disabled || (!description && !title) ? false : open}\n defaultOpen={defaultOpen}\n >\n <TooltipTrigger asChild>\n <div className={cn('cursor-pointer', triggerClassName)}>\n {children}\n </div>\n </TooltipTrigger>\n <TooltipContent ref={ref} className={contentClassName} {...props}>\n {title && (\n <p className=\"mb-1\">\n <Description\n size=\"lg\"\n weight=\"medium\"\n color={defaultTitleColor}\n dangerous={titleDangerous}\n className={cn(\n 'text-wrap text-inherit',\n size === 'md' && 'text-sm'\n )}\n >\n {title}\n </Description>\n </p>\n )}\n {description && (\n <Description\n size=\"lg\"\n weight={title ? 'regular' : 'medium'}\n color={title ? 'subtle' : defaultDescColor}\n dangerous={descriptionDangerous}\n className={cn(\n 'text-wrap text-inherit',\n size === 'md' && 'text-sm'\n )}\n >\n {description}\n </Description>\n )}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipProvider>\n ) : (\n <Popover\n open={open}\n title={title}\n content={description}\n disabled={disabled}\n triggerClassName={triggerClassName}\n className={cn(contentClassName, size === 'md' && 'text-sm')}\n isMTooltip\n {...props}\n >\n {children}\n </Popover>\n )}\n </>\n );\n }\n);\nTooltip.displayName = TooltipPrimitive.Root.displayName;\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n showArrow?: boolean;\n variant?: 'default' | 'info' | 'message';\n /**\n * 气泡方向\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * 气泡箭头位置\n *\n */\n align?: 'start' | 'center' | 'end';\n\n /**\n * 箭头样式\n */\n arrowClassName?: string;\n }\n>(\n (\n {\n className,\n variant = 'default',\n align = 'center',\n side = 'top',\n sideOffset = 6,\n alignOffset = 0,\n showArrow = true,\n arrowClassName,\n ...props\n },\n ref\n ) => (\n <TooltipPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n side={side}\n className={cn(\n 'relative z-[49] mx-4 w-fit max-w-72 rounded-lg px-3 py-2 text-left text-xs shadow-modal-bolder',\n 'outline-none delay-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 [&[data-state=open]>span]:animate-none',\n 'data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 [&[data-state=delayed-open]>span]:animate-none',\n 'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n variant === 'default'\n ? 'bg-cc-Tooltip-bg-default text-cc-Tooltip-fg-default border border-cc-Tooltip-border-default'\n : variant === 'info'\n ? 'bg-surface-accent-yellow-subtle text-Colors-Text-Warning-Bolder'\n : 'bg-Colors-Utility-Lake-Blue-50 text-cc-Tooltip-fg-default',\n className\n )}\n {...props}\n >\n {props.children}\n {showArrow && (\n <TooltipArrow\n width={12}\n height={6}\n className={cn(\n variant === 'default'\n ? 'fill-cc-Tooltip-bg-default stroke-cc-Tooltip-border-default -ml-[0.5px]'\n : variant === 'info'\n ? 'fill-surface-accent-yellow-subtle'\n : 'fill-Colors-Utility-Lake-Blue-50',\n arrowClassName\n )}\n />\n )}\n </TooltipPrimitive.Content>\n )\n);\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipProvider };\n","/* eslint-disable react/require-default-props */\n\n'use client';\n\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\nimport { Description } from './typography';\n\n// const Popover = ({\n// disabled = false,\n// open,\n// ...props\n// }: React.ComponentProps<typeof PopoverPrimitive.Root> & { disabled?: boolean }) => (\n// <PopoverPrimitive.Root open={disabled ? false : open} {...props} />\n// );\n\nconst PopoverRoot = PopoverPrimitive.Root;\nconst PopoverTrigger = PopoverPrimitive.Trigger;\nconst PopoverAnchor = PopoverPrimitive.Anchor;\nconst PopoverClose = PopoverPrimitive.Close;\n\nexport interface PopoverContentExs {\n /**\n * 是否展示箭头\n */\n showArrow?: boolean;\n /**\n * 消息类型\n */\n variant?: 'default' | 'info' | 'message';\n /**\n * 气泡方向\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * 气泡箭头位置\n */\n align?: 'start' | 'center' | 'end';\n modal?: boolean;\n container?: HTMLElement | null;\n}\n\n/**\n * PopoverContent\n */\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> &\n PopoverContentExs\n>(\n (\n {\n className,\n align = 'center',\n variant = 'default',\n side = 'top',\n sideOffset = 4,\n alignOffset = 0,\n arrowPadding = 0,\n showArrow = true,\n children,\n container,\n ...props\n },\n ref\n ) => (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n alignOffset={alignOffset}\n sideOffset={sideOffset}\n arrowPadding={arrowPadding}\n side={side}\n forceMount\n className={cn(\n 'relative z-[49] mx-4 w-fit max-w-72 rounded-lg border border-opaque p-3 text-left text-xs shadow-modal-default outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 [&[data-state=open]>span]:animate-none',\n variant === 'default'\n ? 'bg-alpha-100 text-Colors-Text-Default'\n : variant === 'info'\n ? 'bg-surface-accent-yellow-subtle text-Colors-Text-Warning-Bolder'\n : 'bg-Colors-Utility-Lake-Blue-50 text-Colors-Text-Static-White',\n className\n )}\n {...props}\n >\n {children}\n {showArrow && (\n <PopoverPrimitive.Arrow\n width={16}\n height={6}\n className={cn(\n 'visible',\n variant === 'default'\n ? 'fill-alpha-100'\n : variant === 'info'\n ? 'fill-surface-accent-yellow-subtle'\n : 'fill-Colors-Utility-Lake-Blue-50'\n )}\n />\n )}\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n )\n);\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nconst Popover = ({\n disabled = false,\n open,\n title,\n content,\n anchor,\n children,\n className,\n triggerClassName,\n hasOpenState = false,\n isMTooltip = false,\n modal = false,\n openChangeCallback,\n ...props\n}: Omit<React.ComponentProps<typeof PopoverPrimitive.Content>, 'content'> &\n PopoverContentExs & {\n open?: boolean;\n disabled?: boolean;\n triggerClassName?: string;\n title?: string;\n // pop内容 string或者node\n content?: string | React.ReactNode;\n anchor?: React.ReactNode;\n hasOpenState?: boolean;\n isMTooltip?: boolean;\n openChangeCallback?: (open: boolean) => void;\n }) => {\n return (\n <PopoverRoot\n open={disabled ? false : open}\n modal={modal}\n onOpenChange={openChangeCallback}\n {...props}\n >\n {anchor}\n {content && (\n <>\n <div\n className={cn(\n hasOpenState && 'data-[state=open]:bg-surface-hovered',\n triggerClassName\n )}\n onClick={(e) => {\n if (isMTooltip) {\n e.preventDefault();\n e.stopPropagation();\n }\n }}\n >\n <PopoverTrigger asChild>\n <div\n className={cn(\n hasOpenState && 'data-[state=open]:bg-surface-hovered',\n triggerClassName\n )}\n >\n {children}\n </div>\n </PopoverTrigger>\n </div>\n <PopoverContent\n {...props}\n className={cn('w-fit max-w-[324px]', className)}\n onCloseAutoFocus={(e) => e.preventDefault()}\n >\n {title && (\n <p className=\"mb-1\">\n <Description size=\"lg\" weight=\"medium\" className=\"text-inherit\">\n {title}\n </Description>\n </p>\n )}\n {content}\n </PopoverContent>\n </>\n )}\n {!content && children}\n </PopoverRoot>\n );\n};\n\nexport { Popover, PopoverAnchor, PopoverContent, PopoverRoot };\n","import { cva } from 'class-variance-authority';\n\nexport const iconButtonVariants = cva(\n 'shrink-0 inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:shadow-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 disabled:pointer-events-none disabled:opacity-30 disabled:shadow-none',\n {\n variants: {\n variant: {\n primary: '',\n secondary: 'border shadow-none',\n tertiary: 'border shadow-none',\n plain: '',\n opacity:\n 'text-Colors-Text-Static-White bg-Colors-Beta-White-30 border border-Colors-Beta-White-12 shadow-none hover:bg-Colors-Beta-White-40 focus:shadow-cc-Focus-Rings-Brand-default active:bg-Colors-Beta-White-50 disabled:bg-Colors-Beta-White-60 disabled:text-Colors-Beta-White-80',\n solid:\n 'shadow-none text-Colors-Text-Subtle bg-cc-Button-Solid-bg-default border border-cc-Button-Solid-border-default hover:bg-cc-Button-Solid-bg-hover hover:border-cc-Button-Solid-border-alt active:bg-cc-Button-Solid-bg-active disabled:text-cc-Button-Solid-fg-alt',\n },\n color: {\n default: '',\n brand: '',\n error: '',\n gray: '',\n },\n size: {\n xs: 'h-5 w-5 text-xs',\n sm: 'h-7 w-7 text-sm',\n md: 'h-9 w-9 text-sm',\n lg: 'h-11 w-11',\n },\n },\n compoundVariants: [\n {\n variant: 'primary',\n color: 'brand',\n className:\n 'text-cc-Icon-Button-Brand-fg-default bg-cc-Icon-Button-Brand-bg-default hover:bg-cc-Icon-Button-Brand-bg-hover active:bg-cc-Icon-Button-Brand-bg-active disabled:bg-cc-Icon-Button-Brand-bg-disabled disabled:text-cc-Icon-Button-Brand-fg-alt',\n },\n {\n variant: 'primary',\n color: 'error',\n className:\n 'text-cc-Button-Error-Primary-fg-default bg-cc-Button-Error-Primary-bg-default hover:bg-cc-Button-Error-Primary-bg-hover active:bg-cc-Button-Error-Primary-bg-active disabled:bg-cc-Button-Error-Primary-bg-disabled',\n },\n {\n variant: 'secondary',\n color: 'default',\n className:\n 'border-cc-Button-Secondary-border-default text-cc-Button-Secondary-fg-default bg-cc-Button-Secondary-bg-default hover:bg-cc-Button-Secondary-bg-hover active:bg-cc-Button-Secondary-bg-active disabled:text-cc-Button-Secondary-fg-alt disabled:border-cc-Button-Secondary-border-disabled',\n },\n {\n variant: 'tertiary',\n color: 'default',\n className:\n 'border-cc-Button-Tertiary-border-default text-cc-Button-Tertiary-fg-default bg-cc-Button-Tertiary-bg-default hover:bg-cc-Button-Tertiary-bg-hover hover:border-cc-Button-Tertiary-border-alt focus:shadow-button-tertiary-shadow active:bg-cc-Button-Tertiary-bg-active disabled:text-cc-Button-Tertiary-fg-alt',\n },\n {\n variant: 'secondary',\n color: 'error',\n className:\n 'border-cc-Button-Error-Secondary-border-default text-cc-Button-Error-Secondary-fg-default bg-cc-Button-Error-Secondary-bg-default hover:bg-cc-Button-Error-Secondary-bg-hover active:bg-cc-Button-Error-Secondary-bg-active disabled:text-cc-Button-Error-Secondary-fg-alt disabled:border-cc-Button-Error-Secondary-border-disabled',\n },\n {\n variant: 'secondary',\n color: 'gray',\n className:\n 'text-Colors-Foreground-Subtle hover:bg-surface-hovered active:shadow-button-pressed',\n },\n {\n variant: 'plain',\n color: 'default',\n className:\n 'text-cc-Button-Plain-fg-default hover:bg-cc-Button-Plain-bg-hover focus:shadow-cc-Focus-Rings-Brand-default active:bg-cc-Button-Plain-bg-active disabled:text-cc-Button-Plain-fg-alt',\n },\n {\n variant: 'plain',\n color: 'gray',\n className:\n 'text-cc-Icon-Button-Plain-Gray-fg-default bg-cc-Button-Plain-Brand-bg-default hover:bg-cc-Button-Plain-Brand-bg-hover active:bg-cc-Button-Plain-Brand-bg-active disabled:text-cc-Button-Plain-Gray-fg-alt',\n },\n {\n variant: 'plain',\n color: 'error',\n className:\n 'text-cc-Button-Error-Secondary-fg-default bg-cc-Button-Plain-bg-default hover:bg-cc-Button-Error-Secondary-bg-hover active:bg-cc-Button-Error-Secondary-bg-active disabled:text-cc-Button-Plain-fg-default',\n },\n ],\n defaultVariants: {\n variant: 'primary',\n color: 'default',\n size: 'lg',\n },\n }\n);\n\nexport type IconButtonSize = 'xs' | 'sm' | 'md' | 'lg';\n\nexport const iconSizeVariants: Record<IconButtonSize, string> = {\n xs: 'w-3 h-3',\n sm: 'w-4.5 h-4.5',\n md: 'w-5.5 h-5.5',\n lg: 'w-6 h-6',\n};\n","import Lottie from 'lottie-web';\nimport { useEffect, useRef } from 'react';\n\nexport interface Props {\n bright?: boolean;\n}\n\nexport default function AudioPlaying(props: Props) {\n const playingRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const lRef = playingRef.current;\n let animation: any;\n\n if (lRef) {\n // 在组件挂载后,执行Lottie动画初始化\n animation = Lottie.loadAnimation({\n container: playingRef.current,\n renderer: 'svg', // 根据需要选择渲染器:svg / canvas / html\n loop: true,\n autoplay: true,\n animationData: require('@/common/assets/audio-playing.json')\n });\n }\n\n // 在组件卸载时,销毁Lottie动画实例\n return () => animation.destroy();\n }, []);\n\n return <div ref={playingRef} className=\"size-3\" />;\n}\n","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { Slot } from '@radix-ui/react-slot';\n\nconst NODES = [\n 'a',\n 'button',\n 'div',\n 'form',\n 'h2',\n 'h3',\n 'img',\n 'input',\n 'label',\n 'li',\n 'nav',\n 'ol',\n 'p',\n 'span',\n 'svg',\n 'ul',\n] as const;\n\ntype Primitives = { [E in (typeof NODES)[number]]: PrimitiveForwardRefComponent<E> };\ntype PrimitivePropsWithRef<E extends React.ElementType> = React.ComponentPropsWithRef<E> & {\n asChild?: boolean;\n};\n\ninterface PrimitiveForwardRefComponent<E extends React.ElementType>\n extends React.ForwardRefExoticComponent<PrimitivePropsWithRef<E>> {}\n\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/\n\nconst Primitive = NODES.reduce((primitive, node) => {\n const Node = React.forwardRef((props: PrimitivePropsWithRef<typeof node>, forwardedRef: any) => {\n const { asChild, ...primitiveProps } = props;\n const Comp: any = asChild ? Slot : node;\n\n if (typeof window !== 'undefined') {\n (window as any)[Symbol.for('radix-ui')] = true;\n }\n\n return <Comp {...primitiveProps} ref={forwardedRef} />;\n });\n\n Node.displayName = `Primitive.${node}`;\n\n return { ...primitive, [node]: Node };\n}, {} as Primitives);\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click 👎\n * target.dispatchEvent(new Event(‘click’))\n *\n * dispatching a custom type within a non-discrete event 👎\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}\n *\n * dispatching a custom type within a `discrete` event 👍\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */\n\nfunction dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Primitive;\n\nexport {\n Primitive,\n //\n Root,\n //\n dispatchDiscreteCustomEvent,\n};\nexport type { PrimitivePropsWithRef };\n","'use client';\n\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\ntype ImageLoadingStatus = 'loading' | 'loaded' | 'error';\n\nconst avatarVariants = cva(\n 'relative flex shrink-0 overflow-hidden bg-Colors-Background-Neutral-Primary-Default',\n {\n variants: {\n size: {\n xs: 'w-5 h-5 rounded', // 20 4\n sm: 'w-6 h-6 rounded-md', // 24 6\n md: 'w-8 h-8 rounded-lg', // 32 8\n lg: 'w-9 h-9 rounded-lg', // 36 8\n xl: 'w-12 h-12 rounded-xl', // 48 10 no\n '2xl': 'w-14 h-14 rounded-xl', // 56 12\n '3xl': 'w-16 h-16 rounded-xl', // 64 12\n '4xl': 'w-18 h-18 rounded-2xl', // 72 14 no\n '5xl': 'w-21 h-21 rounded-2xl', // 84 16\n '6xl': 'w-24 h-24 rounded-3xl', // 96 20\n '7xl': 'w-30 h-30 rounded-4xl', // 120 24\n },\n },\n defaultVariants: {\n size: 'md',\n },\n }\n);\n\nconst AvatarRoot = React.forwardRef<\n React.ElementRef<typeof Primitive.span>,\n React.ComponentPropsWithoutRef<typeof Primitive.span> &\n VariantProps<typeof avatarVariants>\n>(({ className, size = 'md', ...passProps }, ref) => (\n <Primitive.span\n ref={ref}\n className={cn(avatarVariants({ size }), className)}\n {...passProps}\n />\n));\nAvatarRoot.displayName = 'Avatar';\n\nconst AvatarImage = React.forwardRef<\n React.ElementRef<typeof Primitive.img>,\n React.ComponentPropsWithoutRef<typeof Primitive.img>\n>(({ className, onLoad, onError, ...props }, ref) => {\n const [loadingStatus, setLoadingStatus] =\n React.useState<ImageLoadingStatus>('loading');\n const handleLoad = (event: React.SyntheticEvent<HTMLImageElement, Event>) => {\n setLoadingStatus('loaded');\n if (onLoad) {\n onLoad(event);\n }\n };\n const handleError = (\n event: React.SyntheticEvent<HTMLImageElement, Event>\n ) => {\n setLoadingStatus('error');\n if (onError) {\n onError(event);\n }\n };\n\n return loadingStatus !== 'error' ? (\n <Primitive.img\n ref={ref}\n className={cn('aspect-square h-full w-full object-cover', className)}\n onLoad={handleLoad}\n onError={handleError}\n {...props}\n />\n ) : (\n <Primitive.span\n ref={ref}\n className={cn(\n 'flex h-full w-full items-center justify-center bg-Colors-Background-Neutral-Primary-Default',\n className\n )}\n {...props}\n />\n );\n});\nAvatarImage.displayName = 'AvatarImage';\n\nconst Avatar = React.forwardRef<\n React.ElementRef<typeof Primitive.img>,\n React.ComponentPropsWithoutRef<typeof Primitive.img> &\n VariantProps<typeof avatarVariants> & {\n variant?: 'bot' | 'user' | 'widget';\n border?: boolean;\n rootStyle?: React.CSSProperties;\n }\n>(\n (\n {\n className,\n rootStyle,\n size,\n src,\n variant = 'bot',\n border = true,\n ...passProps\n },\n ref\n ) => {\n const defaultSrc =\n variant === 'user'\n ? 'https://www.myshellstatic.com/cdn-cgi/image/quality=40,format=webp/image/user/avatar/default/20240715/avatar.png'\n : 'https://www.myshellstatic.com/cdn-cgi/image/quality=40,format=webp/image/bot/logo/20240106/default.png';\n\n return (\n <AvatarRoot\n size={size}\n className={cn(\n border && 'border-Colors-Border-Default border-[0.3px]',\n className\n )}\n style={rootStyle}\n >\n <AvatarImage ref={ref} {...passProps} src={src || defaultSrc} />\n </AvatarRoot>\n );\n }\n);\n\nAvatar.displayName = 'Avatar';\n\nexport { Avatar, AvatarRoot, AvatarImage };\n","/* eslint-disable react/require-default-props */\n/* eslint-disable import/no-unused-modules */\n\nimport { VariantProps, cva } from 'class-variance-authority';\nimport { ClassNameValue } from 'tailwind-merge';\n\nimport { cn } from '@/lib/utils';\n\nconst badgeVariants = cva(\n 'rounded-full flex items-center justify-center text-Colors-Text-Default',\n {\n variants: {\n status: {\n default: 'w-2 h-2 bg-Colors-Foreground-Critical-Default',\n unRead:\n 'min-w-2 min-h-4 bg-Colors-Foreground-Critical-Default px-1.5 text-Colors-Text-Static-White text-2xs font-medium',\n cardUnRead:\n 'min-w-4 min-h-4 bg-Colors-Foreground-Critical-Default px-1.5 text-Colors-Text-Static-White text-2xs font-medium',\n public:\n 'w-2.5 h-2.5 bg-Colors-Utit border-[2px] bg-Colors-Utility-Lake-Blue-50 border-Colors-Utility-Lake-Blue-10',\n private:\n 'w-2.5 h-2.5 bg-Colors-Utility-Khaki-50 border-Colors-Utility-Khaki-10 border-[2px]',\n hidden:\n 'w-2.5 h-2.5 bg-Colors-Utility-Gray-40 border-Colors-Utility-Gray-10 border-[2px]',\n new: 'w-8.5 h-4 pb-0.5 flex juctify-center items-center bg-Colors-Foreground-Critical-Default px-1.5',\n },\n },\n defaultVariants: {\n status: 'default',\n },\n }\n);\ninterface BadgeProps extends VariantProps<typeof badgeVariants> {\n className?: ClassNameValue;\n status?:\n | 'default'\n | 'unRead'\n | 'cardUnRead'\n | 'public'\n | 'private'\n | 'hidden'\n | 'new';\n count?: number;\n}\n\nexport default function Badge(props: BadgeProps) {\n const { status, count, className } = props;\n const unReadCount = count && count < 100 ? count : '99+';\n\n return (\n <div className={cn(badgeVariants({ status }), className)}>\n {status === 'new' ? (\n <span className=\"text-2xs font-medium text-Colors-Text-Static-White leading-[1.3]\">\n New\n </span>\n ) : (\n <span className=\"font-medium text-2xs leading-[1.3]\">\n {unReadCount && (status === 'unRead' || status === 'cardUnRead')\n ? count\n : null}\n </span>\n )}\n </div>\n );\n}\n","// todo 展开时默认选中 value 对应的选项\n\nimport clsx from 'clsx';\nimport { Check, ChevronDown } from 'lucide-react';\nimport { Fragment } from 'react';\nimport { useToggle } from 'react-use';\nimport { ClassNameValue } from 'tailwind-merge';\n\nimport { cn } from '@/lib/utils';\n\nimport { Button } from './button/button';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from './dropdown-menu';\n\nexport interface CascaderOption {\n label: string;\n value: string;\n children?: CascaderOption[];\n}\n\ninterface CommonP {\n value?: string;\n onValueChange: (value: string) => void;\n className?: ClassNameValue;\n}\n\ninterface P extends CommonP {\n options: CascaderOption[];\n showParentLabel?: boolean;\n placeholder?: string;\n}\n\nexport default function Cascader(props: P) {\n const {\n options,\n className,\n value,\n onValueChange,\n showParentLabel,\n placeholder,\n } = props;\n const [open, setOpen] = useToggle(false);\n\n return (\n <DropdownMenu onOpenChange={setOpen}>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"secondary\"\n role=\"combobox\"\n className={cn(\n className,\n 'h-12 p-3 space-x-1.5 rounded-xl border-Colors-Border-Default bg-Colors-Background-Normal-Primary-Active shadow-background-default hover:bg-inherit justify-between [&>span]:line-clamp-1 [&>.dropdown-chevron]:aria-expanded:rotate-180'\n )}\n aria-expanded={open}\n >\n <span\n className={\n // placeholder 文本颜色调整\n clsx(!value && 'text-Colors-Text-Subtler')\n }\n >\n {value ? renderLabel(options, value, showParentLabel) : placeholder}\n </span>\n <ChevronDown className=\"dropdown-chevron h-5 w-5 text-Colors-Foreground-Subtle duration-200\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent className={cn(className)}>\n {options.map((option) => (\n <Fragment key={option.value}>\n {option.children && !!option.children.length ? (\n <NestDropdownMenuRender\n className={className}\n option={option}\n value={value}\n onValueChange={onValueChange}\n />\n ) : (\n <DropdownMenuItem\n className=\"py-1\"\n onChange={() => onValueChange(option.value)}\n >\n {option.label}\n </DropdownMenuItem>\n )}\n </Fragment>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\ninterface NestDropDownP extends CommonP {\n option: CascaderOption;\n}\n\nfunction NestDropdownMenuRender(props: NestDropDownP) {\n const { option, value, onValueChange, className } = props;\n\n return (\n <DropdownMenuSub>\n <DropdownMenuSubTrigger className=\"py-1\">\n {option.label}\n </DropdownMenuSubTrigger>\n <DropdownMenuPortal>\n <DropdownMenuSubContent className={cn(className)} sideOffset={10}>\n {option.children!.map((opt) => (\n <Fragment key={opt.value}>\n {opt.children && opt.children.length ? (\n <NestDropdownMenuRender\n className={className}\n option={opt}\n value={value}\n onValueChange={onValueChange}\n />\n ) : (\n <DropdownMenuItem\n className=\"py-1 justify-between\"\n onClick={() => onValueChange(opt.value)}\n >\n <span>{opt.label}</span>\n {value === opt.value && (\n <Check className=\"h-4 w-4 text-Colors-Text-Brand-Default\" />\n )}\n </DropdownMenuItem>\n )}\n </Fragment>\n ))}\n </DropdownMenuSubContent>\n </DropdownMenuPortal>\n </DropdownMenuSub>\n );\n}\n\nfunction renderLabel(\n options: CascaderOption[],\n value: string,\n showParentLabel = false,\n path = ''\n): string {\n for (const option of options) {\n // 如果当前路径不为空并且需要显示路径,则添加分隔符\n const currentPath = showParentLabel\n ? path\n ? `${path}/${option.label}`\n : option.label\n : option.label;\n\n // 检查当前项的值是否匹配\n if (option.value === value) {\n return currentPath;\n }\n\n // 如果当前项有子项,则递归搜索子项\n if (option.children) {\n const childPath = renderLabel(\n option.children,\n value,\n showParentLabel,\n currentPath\n );\n if (childPath) return childPath; // 如果在子项中找到匹配,则返回构建的路径\n }\n }\n\n // 如果没有找到匹配项,则返回空字符串\n return '';\n}\n","'use client';\n\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center rounded-lg px-3 py-2 outline-none focus:bg-Colors-Background-Neutral-Primary-Default data-[state=open]:bg-Colors-Background-Neutral-Primary-Default',\n inset && 'pl-8',\n className\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-xl border border-alpha bg-Colors-Background-Normal-Primary-Active p-2 text-Colors-Text-Default shadow-modal-default data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => {\n return (\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-[100] min-w-[8rem] overflow-hidden rounded-xl border border-opaque bg-Colors-Background-Normal-Primary-Default p-1 text-Colors-Text-Default shadow-modal-default data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className\n )}\n {...props}\n />\n );\n});\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-lg px-2 py-1 outline-none transition-colors focus:bg-Colors-Background-Neutral-Primary-Default data-[disabled]:pointer-events-none data-[disabled]:opacity-30',\n inset && 'pl-8',\n className\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-30',\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50',\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn('px-3 py-1 text-sm font-medium', inset && 'pl-8', className)}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('my-1 h-px bg-[var(--border)]', className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn('ml-auto text-xs tracking-widest opacity-60', className)}\n {...props}\n />\n );\n};\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n};\n","'use client';\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst CheckIcon = ({ className }: { className?: string }) => {\n return (\n <svg\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n >\n <path\n d=\"M2.25 6.375L5.25 9.375L9.75 2.625\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n );\n};\n\nconst CheckIconBrand = ({ className }: { className?: string }) => {\n return (\n <svg\n className={className}\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 10 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1.25 5.375L4.25 8.375L8.75 1.625\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n );\n};\n\nconst checkboxVariants = cva(\n 'peer w-5 h-5 shrink-0 border-[1.5px] border-cc-Check-Box-border-default hover:border-cc-Check-Box-border-hover data-[state=checked]:border-cc-Check-Box-bg-default ring-offset-cc-Focus-Rings-Brand-default focus-visible:border-cc-Check-Box-border-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 disabled:border-pressed disabled:cursor-not-allowed disabled:opacity-30 data-[state=checked]:bg-cc-Check-Box-bg-default data-[state=checked]:text-cc-Check-Box-fg-default hover:data-[state=checked]:bg-cc-Check-Box-bg-hovered disabled:data-[state=checked]:text-cc-Check-Box-fg-alt disabled:data-[state=checked]:border-none rounded-sm overflow-hidden flex items-center justify-center text-current',\n {\n variants: {\n variant: {\n checkbox: 'rounded-sm',\n circle: 'rounded-full',\n radio: 'rounded-full',\n 'circle-static':\n 'rounded-full bg-beta-black-10 border-beta-white-100 hover:border-beta-white-100',\n 'circle-inverted':\n 'rounded-full data-[state=checked]:border-surface-default focus-visible:border-surface-default data-[state=checked]:bg-surface-default hover:data-[state=checked]:bg-surface-hovered data-[state=checked]:text-icon-brand',\n },\n },\n defaultVariants: {\n variant: 'checkbox',\n },\n }\n);\n\nconst Checkbox = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> &\n VariantProps<typeof checkboxVariants> & {\n label?: string;\n caption?: string;\n labelClassName?: string;\n captionClassName?: string;\n }\n>(\n (\n {\n className,\n variant,\n label,\n labelClassName,\n caption,\n captionClassName,\n ...props\n },\n ref\n ) => {\n const Component = label ? 'div' : React.Fragment;\n return (\n <Component\n className={cn(\n 'flex items-center justify-center space-x-1.5 text-Colors-Text-Default',\n caption && 'items-start'\n )}\n >\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(checkboxVariants({ variant, className }))}\n {...props}\n >\n <CheckboxPrimitive.Indicator>\n {variant === 'radio' ? (\n <div className=\"w-2 h-2 bg-cc-Check-Box-fg-default rounded-full\" />\n ) : variant === 'circle-inverted' ? (\n <CheckIconBrand className=\"w-3 h-3 stroke-cc-Check-Box-fg-default\" />\n ) : (\n <CheckIcon className=\"w-3 h-3 stroke-cc-Check-Box-fg-default\" />\n )}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n {label && (\n <p className={cn('text-sm', labelClassName)}>\n {label}\n {caption && (\n <p\n className={cn(\n 'text-sm text-Colors-Text-Subtler',\n captionClassName\n )}\n >\n {caption}\n </p>\n )}\n </p>\n )}\n </Component>\n );\n }\n);\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox };\n","'use client';\n\nimport { type DialogProps } from '@radix-ui/react-dialog';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { Search } from 'lucide-react';\nimport * as React from 'react';\n\nimport { Dialog, DialogContent } from './dialog';\nimport { cn } from '@/lib/utils';\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n 'flex h-full w-full flex-col overflow-hidden rounded-md bg-white text-slate-950 dark:bg-slate-950 dark:text-slate-50',\n className\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\ntype CommandDialogProps = DialogProps;\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0 shadow-lg\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-slate-500 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5 dark:[&_[cmdk-group-heading]]:text-slate-400\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\nconst CommandInput = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-slate-500 disabled:cursor-not-allowed disabled:opacity-50 dark:placeholder:text-slate-400',\n className\n )}\n {...props}\n />\n </div>\n));\n\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn('max-h-[300px] overflow-y-auto overflow-x-hidden', className)}\n {...props}\n />\n));\n\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n));\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n 'overflow-hidden p-1 text-slate-950 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-slate-500 dark:text-slate-50 dark:[&_[cmdk-group-heading]]:text-slate-400',\n className\n )}\n {...props}\n />\n));\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 h-px bg-slate-200 dark:bg-slate-800', className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-slate-100 aria-selected:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:aria-selected:bg-slate-800 dark:aria-selected:text-slate-50',\n className\n )}\n {...props}\n />\n));\n\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n 'ml-auto text-xs tracking-widest text-slate-500 dark:text-slate-400',\n className\n )}\n {...props}\n />\n );\n};\nCommandShortcut.displayName = 'CommandShortcut';\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","'use client';\n\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { X } from 'lucide-react';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogTrigger = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Trigger\n ref={ref}\n className={cn(\n 'ring-offset-cc-Focus-Rings-Brand-default focus-visible:outline-none focus-visible:shadow-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1',\n className\n )}\n {...props}\n />\n));\nDialogTrigger.displayName = DialogPrimitive.Trigger.displayName;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 bg-opacity-90 md:bg-opacity-75 bg-Colors-Background-Utilities-Overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n className\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n maskClosable?: boolean;\n hideClose?: boolean;\n onClose?: () => void;\n overlayClose?: boolean;\n overlayClassName?: string;\n iconClassName?: string;\n }\n>(\n (\n {\n className,\n children,\n hideClose = false,\n maskClosable = true,\n overlayClose = true,\n onClose,\n overlayClassName,\n iconClassName,\n ...props\n },\n ref\n ) => (\n <DialogPortal>\n <DialogOverlay\n onClick={() => {\n maskClosable && overlayClose && onClose && onClose();\n }}\n className={overlayClassName}\n />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed left-[50%] top-[50%] z-50 grid w-[90%] rounded-4xl max-w-lg translate-x-[-50%] translate-y-[-50%] bg-Colors-Background-Normal-Primary-Default shadow-modal-default duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] ring-offset-cc-Focus-Rings-Brand-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 focus-visible:outline-0',\n className\n )}\n {...props}\n >\n {children}\n\n {!hideClose && (\n <DialogPrimitive.Close\n className={cn(\n 'w-9 h-9 absolute right-5 top-3 flex justify-center items-center focus-visible:outline-0 rounded-full hover:bg-surface-hovered',\n iconClassName\n )}\n onClick={() => {\n onClose && onClose();\n }}\n >\n <X className=\"w-6 h-6 text-Colors-Foreground-Subtle\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n )\n);\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nfunction DialogHeader({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn('flex flex-col p-4', className)} {...props} />;\n}\nDialogHeader.displayName = 'DialogHeader';\n\nfunction DialogFooter({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn('flex justify-end p-4', className)} {...props} />;\n}\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-xl font-normal', className)}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-Colors-Text-Subtle p-4', className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n","import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst ContextMenu = ContextMenuPrimitive.Root;\n\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\n\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\n\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\n\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\nconst ContextMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center rounded-lg py-1 px-2 text-sm outline-none hover:bg-surface-hovered data-[state=open]:bg-slate-100 data-[state=open]:text-slate-900 dark:focus:bg-slate-800 dark:focus:text-slate-50 dark:data-[state=open]:bg-slate-800 dark:data-[state=open]:text-slate-50',\n inset && 'pl-8',\n className\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </ContextMenuPrimitive.SubTrigger>\n));\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\nconst ContextMenuSubContent = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'flex flex-col gap-y-1 z-50 overflow-hidden rounded-xl border border-opaque bg-Colors-Background-Neutral-Primary-Default p-2 text-Colors-Text-Default shadow-modal-default',\n className\n )}\n {...props}\n />\n));\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\nconst ContextMenuContent = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-xl border-none bg-Colors-Background-Normal-Primary-Default p-1 text-Colors-Text-Default shadow-modal-default border border-opaque',\n className\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n));\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\nconst ContextMenuItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-lg py-1 px-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-30 focus:bg-Colors-Background-Neutral-Primary-Default',\n inset && 'pl-8',\n className\n )}\n {...props}\n />\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <ContextMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-lg py-1 px-2 text-sm outline-none hover:bg-surface-hovered data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50',\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n));\nContextMenuCheckboxItem.displayName =\n ContextMenuPrimitive.CheckboxItem.displayName;\n\nconst ContextMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <ContextMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-lg py-1 px-2 text-sm outline-none hover:bg-surface-hovered data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n));\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\nconst ContextMenuLabel = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold text-Colors-Text-Default',\n inset && 'pl-8',\n className\n )}\n {...props}\n />\n));\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\nconst ContextMenuSeparator = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator\n ref={ref}\n className={cn('my-1 h-px bg-[var(--border)]', className)}\n {...props}\n />\n));\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\nconst ContextMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n 'ml-auto text-xs tracking-widest text-slate-500 dark:text-slate-400',\n className\n )}\n {...props}\n />\n );\n};\nContextMenuShortcut.displayName = 'ContextMenuShortcut';\n\nexport {\n ContextMenu,\n ContextMenuCheckboxItem,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuItem,\n ContextMenuLabel,\n ContextMenuPortal,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuTrigger,\n};\n","import dayjs from 'dayjs';\nimport duration, { Duration } from 'dayjs/plugin/duration';\nimport utc from 'dayjs/plugin/utc';\nimport { useMemo, useEffect, useState } from 'react';\n\ndayjs.extend(duration);\ndayjs.extend(utc);\n\ninterface CountDownProps {\n endTime: string;\n callback?: () => void;\n}\n\nexport default function CountDown({ endTime, callback }: CountDownProps) {\n const end = dayjs(parseInt(endTime));\n const [duration, setDuration] = useState<Duration | null>(null);\n\n useEffect(() => {\n let timer: any = null;\n const countdown = () => {\n const now = dayjs();\n const diff = end.diff(now);\n\n if (diff > 0) {\n setDuration(dayjs.duration(diff));\n timer = setTimeout(countdown, 1000);\n } else {\n callback && callback();\n }\n };\n\n countdown();\n\n return () => {\n clearTimeout(timer);\n };\n }, []);\n\n const days = useMemo(() => {\n return duration ? duration.days().toString().padStart(2, '0') : null;\n }, [duration]);\n\n const hours = useMemo(() => {\n return duration ? duration.hours().toString().padStart(2, '0') : null;\n }, [duration]);\n\n const minutes = useMemo(() => {\n return duration ? duration.minutes().toString().padStart(2, '0') : null;\n }, [duration]);\n\n const seconds = useMemo(() => {\n return duration ? duration.seconds().toString().padStart(2, '0') : null;\n }, [duration]);\n\n return (\n <div className=\"flex items-center space-x-2 text-Colors-Text-Default\">\n <div className=\"px-[9px] py-1 rounded-xl min-w-[64px] h-[64px] border border-Colors-Border-Default\">\n <div className=\"h-full flex flex-col justify-center items-center\">\n <p className=\"font-semibold text-[20px]\">{days ?? '00'}</p>\n <p className=\"opacity-60 text-[12px]\">days</p>\n </div>\n </div>\n <div className=\"px-[9px] py-1 rounded-xl min-w-[64px] h-[64px] border border-Colors-Border-Default\">\n <div className=\"h-full flex flex-col justify-center items-center\">\n <p className=\"font-semibold text-[20px]\">{hours ?? '00'}</p>\n <p className=\"opacity-60 text-[12px]\">hrs</p>\n </div>\n </div>\n <div className=\"px-[9px] py-1 rounded-xl min-w-[64px] h-[64px] border border-Colors-Border-Default\">\n <div className=\"h-full flex flex-col justify-center items-center\">\n <p className=\"font-semibold text-[20px]\">{minutes ?? '00'}</p>\n <p className=\"opacity-60 text-[12px]\">mins</p>\n </div>\n </div>\n <div className=\"px-[9px] py-1 rounded-xl min-w-[64px] h-[64px] border border-Colors-Border-Default\">\n <div className=\"h-full flex flex-col justify-center items-center\">\n <p className=\"font-semibold text-[20px]\">{seconds ?? '00'}</p>\n <p className=\"opacity-60 text-[12px]\">secs</p>\n </div>\n </div>\n </div>\n );\n}\n","'use client';\n\nimport * as React from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\n\nimport { cn } from '@/lib/utils';\n\nfunction Drawer({\n shouldScaleBackground = false,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return (\n <DrawerPrimitive.Root\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n />\n );\n}\nDrawer.displayName = 'Drawer';\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\nconst DrawerPortal = DrawerPrimitive.Portal;\n\nconst DrawerClose = DrawerPrimitive.Close;\n\nconst DrawerOverlay = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay\n ref={ref}\n className={cn('fixed inset-0 z-50 bg-alpha-mask-mobile', className)}\n {...props}\n />\n));\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\n\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed inset-x-0 bottom-0 z-50 flex h-auto max-h-[70%] flex-col rounded-t-2xl bg-Colors-Background-Normal-Primary-Default shadow-modal-default',\n className\n )}\n {...props}\n >\n {/* <DrawerPrimitive.Close className=\"w-9 h-9 absolute right-4 top-4 flex justify-center items-center ring-offset-cc-Focus-Rings-Brand-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1\">\n <X className=\"w-[22px] h-[22px] text-icon\" />\n <span className=\"sr-only\">Close</span>\n </DrawerPrimitive.Close> */}\n {/* 类app拖动块在H5端不需要 */}\n {/* <div className=\"mx-auto mt-4 h-2 w-[100px] rounded-full bg-border-Colors-Border-Default\" /> */}\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n));\nDrawerContent.displayName = 'DrawerContent';\n\nfunction DrawerHeader({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn('p-4', className)} {...props} />;\n}\nDrawerHeader.displayName = 'DrawerHeader';\n\nfunction DrawerFooter({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn('p-4', className)} {...props} />;\n}\nDrawerFooter.displayName = 'DrawerFooter';\n\nconst DrawerTitle = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn('text-xl font-normal text-Colors-Text-Default', className)}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\nconst DrawerDescription = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n className={cn('text-sm text-Colors-Text-Subtle', className)}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n","import * as LabelPrimitive from '@radix-ui/react-label';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva } from 'class-variance-authority';\nimport * as React from 'react';\nimport {\n Controller,\n ControllerProps,\n FieldPath,\n FieldValues,\n FormProvider,\n useFormContext,\n} from 'react-hook-form';\n\nimport { Label } from './label';\nimport { cn } from '@/lib/utils';\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue\n);\n\nfunction FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({ ...props }: ControllerProps<TFieldValues, TName>) {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue\n);\n\ninterface IFormItemProps extends React.HTMLAttributes<HTMLDivElement> {\n layout?: 'Vertical' | 'Horizontal';\n}\n\nconst formLayoutVariants = cva('', {\n variants: {\n layout: {\n Vertical: 'space-y-1.5',\n Horizontal: 'flex flex-row items-center space-x-3',\n },\n },\n defaultVariants: {\n layout: 'Vertical',\n },\n});\n\nconst FormItem = React.forwardRef<HTMLDivElement, IFormItemProps>(\n ({ className, layout, ...props }, ref) => {\n const id = React.useId();\n\n const cls = cn(className, formLayoutVariants({ layout }));\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cls} {...props} />\n </FormItemContext.Provider>\n );\n }\n);\nFormItem.displayName = 'FormItem';\n\ninterface IFormLabelProps\n extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> {\n required?: boolean;\n}\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n IFormLabelProps\n>(({ className, required, children, ...props }, ref) => {\n const { formItemId } = useFormField();\n\n return (\n <Label ref={ref} className={className} htmlFor={formItemId} {...props}>\n {required ? (\n <span className=\"text-Colors-Text-Critical-Default mr-1\">*</span>\n ) : null}\n {children}\n </Label>\n );\n});\nFormLabel.displayName = 'FormLabel';\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } =\n useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={\n !error\n ? `${formDescriptionId}`\n : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={!!error}\n {...props}\n />\n );\n});\nFormControl.displayName = 'FormControl';\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn('text-sm text-Colors-Text-Subtler', className)}\n {...props}\n />\n );\n});\nFormDescription.displayName = 'FormDescription';\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\n 'text-sm font-medium text-Colors-Text-Critical-Default',\n className\n )}\n {...props}\n >\n {body}\n </p>\n );\n});\nFormMessage.displayName = 'FormMessage';\n\nexport {\n Form,\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n useFormField,\n};\n","'use client';\n\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst labelVariants = cva(\n 'text-sm font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-30'\n);\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className)}\n {...props}\n />\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n","import { ReactNode } from 'react';\n\ninterface P {\n children: ReactNode;\n}\n\nexport default function Group({ children }: P) {\n return <div className=\"flex space-x-2\">{children}</div>;\n}\n","'use client';\n\nimport {\n AllowedButtons,\n Config,\n DriveStep,\n PopoverDOM,\n State,\n driver,\n} from 'driver.js';\nimport * as React from 'react';\nimport { useEffect, useMemo, useRef } from 'react';\n\nimport { cn } from '@/lib/utils';\n\n// Import driver.js styles\nimport 'driver.js/dist/driver.css';\n\ninterface GuideProps {\n /*\n 引导步骤\n */\n steps: DriveStep[];\n /*\n 是否显示进度条\n @default true\n */\n showProgress?: boolean;\n /*\n 是否显示遮罩层\n @default true\n */\n showOverlay?: boolean;\n /*\n 是否显示关闭按钮\n @default true\n */\n hasCloseBtn?: boolean;\n /*\n 是否允许点击背景蒙层关闭\n @default true\n */\n allowClose?: boolean;\n /*\n 是否显示跳过按钮\n @default true\n */\n hasSkip?: boolean;\n /*\n 跳过按钮文本\n @default 'Skip'\n */\n skipText?: string;\n /*\n 是否显示下一步按钮\n @default true\n */\n hasNextBtn?: boolean;\n /*\n 是否显示上一步按钮\n @default false\n */\n hasPrevBtn?: boolean;\n /*\n 上一步按钮文本\n @default 'Previous'\n */\n prevBtnText?: string;\n /*\n 下一步按钮文本\n @default 'Next'\n */\n nextBtnText?: string;\n /*\n 完成按钮文本\n @default 'Done'\n */\n doneBtnText?: string;\n /*\n 自定义类名\n */\n className?: string;\n /*\n 完成的回调\n */\n onComplete?: () => void;\n /*\n 跳过的回调\n */\n onSkip?: () => void;\n}\n\nexport const Guide: React.FC<GuideProps> = ({\n steps,\n showProgress = true,\n showOverlay = false,\n hasSkip = true,\n hasCloseBtn = true,\n hasPrevBtn = false,\n hasNextBtn = true,\n allowClose = false,\n skipText = 'Skip',\n prevBtnText = 'Previous',\n nextBtnText = 'Next',\n doneBtnText = 'Done',\n className,\n onComplete,\n onSkip,\n}) => {\n const driverRef = useRef<any>(null);\n const buttons = useMemo(() => {\n const buttons = [] as AllowedButtons[];\n if (hasPrevBtn) {\n buttons.push('previous');\n }\n if (hasNextBtn) {\n buttons.push('next');\n }\n if (hasCloseBtn) {\n buttons.push('close');\n }\n\n return buttons;\n }, [hasNextBtn, hasPrevBtn, hasCloseBtn]);\n useEffect(() => {\n driverRef.current = driver({\n overlayOpacity: showOverlay ? 0.8 : 0,\n animate: true,\n showButtons: buttons?.length > 0 ? buttons : [],\n showProgress,\n steps,\n prevBtnText,\n nextBtnText,\n doneBtnText,\n allowClose,\n progressText: '{{current}}/{{total}}',\n onDestroyed: onComplete,\n onPopoverRender: (\n popover: PopoverDOM,\n { config, state }: { config: Config; state: State }\n ) => {\n const closeBtn = popover.closeButton as HTMLElement;\n\n if (hasCloseBtn && closeBtn) {\n closeBtn.className = cn(\n 'driver-popover-close-btn !text-Colors-Text-Static-White !opacity-70 !w-4.5 !h-4.5 !right-3 !top-3',\n closeBtn.className\n );\n closeBtn.style.display = 'block';\n closeBtn.innerHTML =\n '<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><g clip-path=\"url(#clip0_21201_7803)\"><path d=\"M4.10225 4.10225C4.32192 3.88258 4.67808 3.88258 4.89775 4.10225L9 8.20451L13.1023 4.10225C13.3219 3.88258 13.6781 3.88258 13.8977 4.10225C14.1174 4.32192 14.1174 4.67808 13.8977 4.89775L9.7955 9L13.8977 13.1023C14.1174 13.3219 14.1174 13.6781 13.8977 13.8977C13.6781 14.1174 13.3219 14.1174 13.1023 13.8977L9 9.7955L4.89775 13.8977C4.67808 14.1174 4.32192 14.1174 4.10225 13.8977C3.88258 13.6781 3.88258 13.3219 4.10225 13.1023L8.20451 9L4.10225 4.89775C3.88258 4.67808 3.88258 4.32192 4.10225 4.10225Z\" fill=\"white\" fill-opacity=\"0.7\"/></g><defs><clipPath id=\"clip0_21201_7803\"><rect width=\"18\" height=\"18\" fill=\"white\"/></clipPath></defs></svg>';\n closeBtn.onclick = () => {\n driverRef.current.destroy();\n };\n }\n const content = popover.wrapper as HTMLElement;\n if (content) {\n content.className = cn(\n '!bg-Colors-Utility-Lake-Blue-50 !p-3 !shadow-modal-default',\n content.className\n );\n const arrow = popover.arrow as HTMLElement;\n if (arrow) {\n arrow.className = cn(\n 'border-t-Colors-Utility-Lake-Blue-50',\n arrow.className\n );\n }\n const title = popover.title as HTMLElement;\n const description = popover.description as HTMLElement;\n const footer = popover.footer as HTMLElement;\n const footerButtons = popover.footerButtons as HTMLElement;\n\n if (title) {\n title.className = cn('mb-1', title.className);\n title.innerHTML = `<p class=\"text-base font-medium text-Colors-Beta-White-100\">${title.innerHTML}</p>`;\n }\n\n if (description) {\n description.innerHTML = `<p class=\"text-sm !text-Colors-Beta-White-80\">${description.innerHTML}</p>`;\n }\n if (footer) {\n footer.className = cn('!mt-3 space-x-1.5', footer.className);\n }\n\n if (footer && footerButtons && hasSkip) {\n footer.style.display = 'flex';\n const skipBtn = document.createElement('button');\n skipBtn.innerText = skipText;\n skipBtn.className =\n 'driver-popover-skip-btn driver-popover-close-btn !text-Colors-Beta-White-80';\n skipBtn.addEventListener('click', () => {\n driverRef.current.destroy();\n onSkip && onSkip();\n });\n footerButtons.className = cn(\n 'flex-1 flex justify-end items-center',\n footerButtons.className\n );\n footerButtons.insertBefore(skipBtn, footerButtons.firstChild);\n }\n popover.previousButton.style.display = hasPrevBtn ? 'block' : 'none';\n popover.nextButton.style.display = hasNextBtn ? 'block' : 'none';\n popover.closeButton.style.display = hasCloseBtn ? 'block' : 'none';\n }\n\n const { progress } = popover;\n if (progress) {\n progress.className = cn(\n 'text-sm text-Colors-Beta-White-60 opacity-60',\n progress.className\n );\n }\n },\n });\n\n driverRef.current.drive();\n\n return () => {\n if (driverRef.current) {\n driverRef.current.destroy();\n }\n };\n }, [\n steps,\n showProgress,\n hasSkip,\n hasPrevBtn,\n hasNextBtn,\n skipText,\n prevBtnText,\n nextBtnText,\n doneBtnText,\n className,\n onComplete,\n onSkip,\n showOverlay,\n hasCloseBtn,\n buttons,\n ]);\n\n return null;\n};\n","import { cva } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nexport type InputProps = Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'size'\n> & {\n rounded?:\n | 'default'\n | 'none'\n | 'sm'\n | 'md'\n | 'lg'\n | 'xl'\n | '2xl'\n | '3xl'\n | 'full'\n | null\n | undefined;\n size?: 'xs' | 'sm' | 'md' | 'lg' | null | undefined;\n isFull?: boolean;\n border?: 'none' | 'default' | null | undefined;\n shadow?: 'none' | 'default' | null | undefined;\n outline?: 'none' | 'default' | null | undefined;\n background?: 'none' | 'default' | null | undefined;\n};\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n (\n {\n className,\n type,\n autoComplete = 'off',\n isFull = true,\n rounded = 'lg',\n size = 'sm',\n border = 'default',\n outline = 'default',\n background = 'default',\n shadow = 'default',\n ...props\n },\n ref\n ) => {\n const { readOnly } = props;\n\n const inputVariants = cva('', {\n variants: {\n rounded: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n default: 'rounded',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n '3xl': 'rounded-3xl',\n full: 'rounded-full',\n },\n size: {\n lg: 'h-14',\n md: 'h-11',\n sm: 'h-10',\n xs: 'h-9',\n },\n border: {\n none: 'border-none shadow-none',\n default: 'border border-cc-Input-border-default ',\n },\n outline: {\n none: 'outline-none',\n default:\n 'focus-visible:outline-none aria-[invalid=true]:focus-visible:ring-error focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-0',\n },\n background: {\n none: 'bg-transparent',\n default:\n 'bg-cc-Input-bg-default hover:bg-cc-Input-bg-hover disabled:bg-cc-Input-bg-disabled',\n },\n shadow: {\n none: 'shadow-none',\n default: '',\n },\n },\n defaultVariants: {\n rounded: 'lg',\n size: 'sm',\n border: 'default',\n outline: 'default',\n background: 'default',\n },\n });\n\n return (\n <input\n type={type}\n className={cn(\n 'flex space-x-2 p-3 text-base text-Colors-Text-Default placeholder:text-Colors-Text-Subtlest ring-offset-cc-Focus-Rings-Brand-default',\n 'aria-[invalid=true]:border-Colors-Border-Critical aria-[invalid=true]:hover:bg-Colors-Background-Critical-Subtle',\n 'file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:opacity-30',\n inputVariants({ rounded, size, border, outline, background, shadow }),\n readOnly &&\n 'focus-visible:ring-offset-0 focus-visible:ring-transparent',\n isFull && 'w-full',\n className\n )}\n autoComplete={autoComplete}\n ref={ref}\n {...props}\n />\n );\n }\n);\nInput.displayName = 'Input';\n\nexport { Input };\n","import LinkComponent from 'next/link';\nimport { useMemo } from 'react';\n\nimport { useNativeBridge } from '@/common/hooks/useNativeBridge';\nimport { isClient, isIosApp } from '@/common/utils/common-helper';\n\nimport { UrlObject } from 'url';\nimport { useMedia } from 'react-use';\n\nexport interface LinkProps {\n /**\n * 跳转地址\n * '/about' \n * {\n * pathname: '/about',\n query: { name: 'test' },\n * }\n */\n href: string | UrlObject;\n /**\n * 图像宽度\n * string | number\n */\n scroll?: boolean;\n\n /**\n * 替换url\n */\n replace?: boolean;\n /**\n * true:进入视区预先获取herf数据\n * false:进入视区不获取,悬浮时获取\n */\n prefetch?: boolean;\n /**\n * Forces `Link` to send the `href` property to its child.\n *\n * @defaultValue `false`\n */\n passHref?: boolean;\n /**\n * 样式覆盖\n */\n className?: string;\n /**\n * 是否是返回link\n */\n back?: boolean;\n onClick?: (e: any) => void;\n children?: React.ReactNode;\n [key: string]: any;\n}\n\nexport function Link({\n className,\n href,\n scroll = false,\n replace = false,\n prefetch = true,\n back = false,\n children,\n onClick,\n ...props\n}: LinkProps) {\n const path = typeof href === 'string' ? href : `${href.pathname}`;\n // ref:外链添加nofollow,noreferrer,告诉搜索引擎不要抓取以免降低自身站点权重;内链添加dofollow标签,保证权重的传递\n const externalLink = /^(https?:\\/\\/)/.test(path);\n const { getIosUrl, nativeGoBack } = useNativeBridge();\n const isIos = isClient() && isIosApp();\n const isMobile = useMedia('(max-width: 768px)');\n\n // 通过url是否有platform参数判断是否是ios\n const pathname = useMemo(() => {\n // 站外链接直接返回\n if (externalLink) return path;\n // 白名单直接返回\n // if (\n // NotMatchWhitelist.some((whitelist: string) => path.startsWith(whitelist))\n // ) {\n // return path;\n // }\n\n let formatPath = path;\n // 统一做m&pc路由跳转优化\n const isMobPath = path.startsWith('/m/');\n if (isMobile) {\n formatPath = isMobPath ? path : `/m${path}`;\n } else {\n formatPath = isMobPath ? path.slice(2) : path;\n }\n\n return isIos ? getIosUrl(formatPath) || formatPath : formatPath;\n }, [path]);\n\n // 此处兼容ios跳转返回后失效问题\n const Com = isIos ? 'a' : LinkComponent;\n\n return (\n <Com\n href={pathname}\n scroll={scroll}\n replace={replace}\n prefetch={prefetch}\n onClick={(e) => {\n if (isIos && back) {\n e.stopPropagation();\n e.preventDefault();\n nativeGoBack();\n } else {\n onClick?.(e);\n }\n }}\n className={className}\n rel={externalLink ? 'nofollow,noreferrer' : 'dofollow'}\n target={externalLink ? '_blank' : undefined}\n {...props}\n >\n {children}\n </Com>\n );\n}\n\nexport default Link;\n","/**\n * 与原生应用交互的钩子\n */\n\nimport { useCallback } from 'react';\nimport { isIosApp } from '../utils/common-helper';\n\nexport function useNativeBridge() {\n const callNative = useCallback((action: string, data?: any) => {\n if (isIosApp() && window.webkit?.messageHandlers?.reactNative) {\n window.webkit.messageHandlers.reactNative.postMessage({\n action,\n data,\n });\n }\n\n // 安卓交互逻辑\n if (typeof window !== 'undefined' && (window as any).ReactNativeWebView) {\n (window as any).ReactNativeWebView.postMessage(\n JSON.stringify({\n action,\n data,\n })\n );\n }\n }, []);\n\n const getIosUrl = useCallback((path: string) => {\n // 简单实现,实际可能需要更复杂的逻辑\n return path;\n }, []);\n\n const nativeGoBack = useCallback(() => {\n callNative('goBack');\n }, [callNative]);\n\n return {\n callNative,\n getIosUrl,\n nativeGoBack,\n };\n}\n","'use client';\n\nimport { indexOf, min } from 'lodash-es';\nimport React, { Children, useEffect, useState } from 'react';\n\nimport { cn } from '@/lib/utils';\n\ninterface BreakpointColsObject {\n default: number;\n [key: number]: number;\n}\n\ninterface MasonryProps {\n breakpointCols?: number | BreakpointColsObject;\n className?: string;\n columnClassName?: string;\n children?: React.ReactNode;\n columnAttrs?: React.HTMLAttributes<HTMLDivElement>;\n heights?: number[];\n}\n\nconst Masonry: React.FC<MasonryProps> = ({\n breakpointCols = {\n default: 0,\n 3280: 5,\n 1919: 4,\n 1439: 3,\n 1199: 2,\n },\n className = '',\n columnClassName = '',\n children,\n columnAttrs = {},\n heights,\n}) => {\n const [columnCount, setColumnCount] = useState<number>(\n typeof breakpointCols === 'number' ? breakpointCols : breakpointCols.default\n );\n\n const reCalculateColumnCount = () => {\n const windowWidth = window?.innerWidth || Infinity;\n let newColumnCount = columnCount;\n\n if (typeof breakpointCols === 'object') {\n let matchedBreakpoint = Infinity;\n\n for (const breakpoint in breakpointCols) {\n const optBreakpoint = parseInt(breakpoint);\n const isCurrentBreakpoint =\n optBreakpoint > 0 && windowWidth <= optBreakpoint;\n\n if (isCurrentBreakpoint && optBreakpoint < matchedBreakpoint) {\n matchedBreakpoint = optBreakpoint;\n newColumnCount = breakpointCols[breakpoint];\n }\n }\n\n newColumnCount = Math.max(1, newColumnCount || 1);\n }\n\n if (columnCount !== newColumnCount) {\n setColumnCount(newColumnCount);\n }\n };\n\n useEffect(() => {\n const handleResize = () => {\n reCalculateColumnCount();\n };\n\n window.addEventListener('resize', handleResize);\n\n // Invoke immediately to set the initial column count\n handleResize();\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [breakpointCols, columnCount]);\n\n const itemsInColumns = () => {\n const columns = new Array<React.ReactNode[]>(columnCount);\n const totals = new Array<number>(columnCount).fill(0);\n const items = Children.toArray(children);\n\n if (heights) {\n for (let i = 0; i < items.length; i++) {\n const columnIndex = indexOf(totals, min(totals));\n\n if (!columns[columnIndex]) {\n columns[columnIndex] = [];\n }\n columns[columnIndex].push(items[i]);\n totals[columnIndex] += heights[i];\n }\n } else {\n for (let i = 0; i < items.length; i++) {\n const columnIndex = i % columnCount;\n if (!columns[columnIndex]) {\n columns[columnIndex] = [];\n }\n columns[columnIndex].push(items[i]);\n }\n }\n\n return columns;\n };\n\n const renderColumns = () => {\n const childrenInColumns = itemsInColumns();\n const columnWidth = `${100 / childrenInColumns.length}%`;\n\n return childrenInColumns.map((items, i) => (\n <div\n {...columnAttrs}\n style={{ ...columnAttrs.style, width: columnWidth }}\n className={cn(\n 'space-y-2 bg-clip-padding pl-2 md:space-y-5 md:pl-5',\n columnClassName\n )}\n key={i}\n >\n {items}\n </div>\n ));\n };\n\n return (\n <div\n {...columnAttrs}\n className={cn('mr-4 flex w-auto md:mr-6', className || 'my-masonry-grid')}\n >\n {columnCount > 0 && renderColumns()}\n </div>\n );\n};\n\nexport default Masonry;\n","import * as React from 'react';\nimport * as MenubarPrimitive from '@radix-ui/react-menubar';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nconst MenubarMenu = MenubarPrimitive.Menu;\n\nconst MenubarGroup = MenubarPrimitive.Group;\n\nconst MenubarPortal = MenubarPrimitive.Portal;\n\nconst MenubarSub = MenubarPrimitive.Sub;\n\nconst MenubarRadioGroup = MenubarPrimitive.RadioGroup;\n\nconst Menubar = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Root\n ref={ref}\n className={cn(\n 'flex h-10 items-center space-x-1 rounded-md border border-slate-200 bg-white p-1 dark:border-slate-800 dark:bg-slate-950',\n className\n )}\n {...props}\n />\n));\nMenubar.displayName = MenubarPrimitive.Root.displayName;\n\nconst MenubarTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Trigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-slate-100 focus:text-slate-900 data-[state=open]:bg-slate-100 data-[state=open]:text-slate-900 dark:focus:bg-slate-800 dark:focus:text-slate-50 dark:data-[state=open]:bg-slate-800 dark:data-[state=open]:text-slate-50',\n className\n )}\n {...props}\n />\n));\nMenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;\n\nconst MenubarSubTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <MenubarPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-slate-100 focus:text-slate-900 data-[state=open]:bg-slate-100 data-[state=open]:text-slate-900 dark:focus:bg-slate-800 dark:focus:text-slate-50 dark:data-[state=open]:bg-slate-800 dark:data-[state=open]:text-slate-50',\n inset && 'pl-8',\n className\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </MenubarPrimitive.SubTrigger>\n));\nMenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;\n\nconst MenubarSubContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border border-slate-200 bg-white p-1 text-slate-950 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50',\n className\n )}\n {...props}\n />\n));\nMenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;\n\nconst MenubarContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>\n>(\n (\n { className, align = 'start', alignOffset = -4, sideOffset = 8, ...props },\n ref\n ) => (\n <MenubarPrimitive.Portal>\n <MenubarPrimitive.Content\n ref={ref}\n align={align}\n alignOffset={alignOffset}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 min-w-[12rem] overflow-hidden rounded-md border border-slate-200 bg-white p-1 text-slate-950 shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50',\n className\n )}\n {...props}\n />\n </MenubarPrimitive.Portal>\n )\n);\nMenubarContent.displayName = MenubarPrimitive.Content.displayName;\n\nconst MenubarItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50',\n inset && 'pl-8',\n className\n )}\n {...props}\n />\n));\nMenubarItem.displayName = MenubarPrimitive.Item.displayName;\n\nconst MenubarCheckboxItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <MenubarPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50',\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.CheckboxItem>\n));\nMenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;\n\nconst MenubarRadioItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <MenubarPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50',\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.RadioItem>\n));\nMenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;\n\nconst MenubarLabel = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold',\n inset && 'pl-8',\n className\n )}\n {...props}\n />\n));\nMenubarLabel.displayName = MenubarPrimitive.Label.displayName;\n\nconst MenubarSeparator = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-slate-100 dark:bg-slate-800', className)}\n {...props}\n />\n));\nMenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;\n\nconst MenubarShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n 'ml-auto text-xs tracking-widest text-slate-500 dark:text-slate-400',\n className\n )}\n {...props}\n />\n );\n};\nMenubarShortcut.displayname = 'MenubarShortcut';\n\nexport {\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n MenubarContent,\n MenubarItem,\n MenubarSeparator,\n MenubarLabel,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarPortal,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarGroup,\n MenubarSub,\n MenubarShortcut,\n};\n","/* eslint-disable no-nested-ternary */\n\n'use client';\n\nimport CheckCircleIcon from '@heroicons/react/24/outline/esm/CheckCircleIcon';\nimport ExclamationTriangleIcon from '@heroicons/react/24/outline/esm/ExclamationTriangleIcon';\nimport InformationCircleIcon from '@heroicons/react/24/outline/esm/InformationCircleIcon';\nimport XCircleIcon from '@heroicons/react/24/outline/esm/XCircleIcon';\nimport XMarkIcon from '@heroicons/react/24/outline/esm/XMarkIcon';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { FocusScope, FocusScopeProps } from '@radix-ui/react-focus-scope';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\n\nimport { cn } from '@/lib/utils';\n\nimport { Button } from './button/button';\nimport { IconButton } from './button/icon-button';\nimport { Display, Text } from './typography';\nimport { useMedia } from 'react-use';\n\nconst ModalOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, onClick, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 bg-Colors-Background-Utilities-Overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n className\n )}\n onClick={(e) => {\n onClick && onClick(e);\n }}\n {...props}\n />\n));\nModalOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DrawerOverlay = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 bg-Colors-Background-Utilities-Overlay',\n className\n )}\n {...props}\n />\n));\n\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\n\nconst ModalContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPrimitive.Content\n className={cn(\n 'absolute left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2 !touch-auto !select-text',\n 'duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] focus:outline-none',\n className\n )}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n));\n\nconst ModalRoot: React.FC<\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Dialog>\n> = ({ children, ...props }) => (\n <DialogPrimitive.Dialog {...props}>\n <DialogPrimitive.Portal>{children}</DialogPrimitive.Portal>\n </DialogPrimitive.Dialog>\n);\n\nconst ModalTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => {\n const isMobile = useMedia('(max-width: 768px)');\n\n if (isMobile) {\n return (\n <DrawerPrimitive.Title\n ref={ref}\n {...props}\n className={cn(\n 'text-xl text-Colors-Text-Default font-medium line-clamp-1',\n className\n )}\n />\n );\n }\n\n return (\n <DialogPrimitive.Title\n ref={ref}\n {...props}\n className={cn(\n 'text-xl text-Colors-Text-Default font-medium line-clamp-1',\n className\n )}\n />\n );\n});\nModalTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst modalVariants = cva('', {\n variants: {\n size: {\n lg: 'w-[750px] max-h-[640px]',\n md: 'w-[620px] max-h-[640px]',\n sm: 'w-[380px] max-h-[640px]',\n },\n zIndex: {\n 9: 'z-[9]',\n 99: 'z-[99]',\n 999: 'z-[999]',\n 9999: 'z-[9999]',\n },\n },\n defaultVariants: {\n size: 'lg',\n zIndex: 99,\n },\n});\n\nexport type TModalState = 'info' | 'success' | 'warning' | 'error';\n\nconst Modal: React.FC<\n React.ComponentPropsWithoutRef<typeof ModalRoot> & {\n /**\n * 模态框标题文本\n */\n title?: string;\n /**\n * 模态框描述文本\n */\n description?: string;\n /**\n * 点击覆盖层是否关闭模态框\n */\n overlayClose?: boolean;\n /**\n * 是否隐藏关闭按钮\n */\n hideClose?: boolean;\n /**\n * 模态框是否仅作为模态框显示(而不是抽屉)\n */\n modalOnly?: boolean;\n /**\n * 覆盖层的额外类名\n */\n overlayClassName?: string;\n /**\n * 模态框内容的额外类名\n */\n contentClassName?: string;\n /**\n * 关闭按钮的额外类名\n */\n closeClassName?: string;\n /**\n * 图标的额外类名\n */\n iconClassName?: string;\n /**\n * 模态框是否以全屏显示\n */\n fullScreen?: boolean;\n /**\n * 焦点范围管理的选项\n */\n focusScopeOptions?: FocusScopeProps;\n /**\n * 登录模态框的特殊逻辑\n */\n isLogin?: boolean;\n /**\n * 表示模态框是否为通知\n */\n isNotification?: boolean;\n /**\n * 模态框的状态(信息、成功、警告、错误)\n */\n state?: TModalState;\n /**\n * isNotification 的情况下可能会需要\n */\n showCancel?: boolean;\n /**\n * 是否为水平布局\n */\n isHorizontal?: boolean;\n /**\n * 确认按钮的加载状态\n */\n confirmLoading?: boolean;\n /**\n * 取消按钮的文本\n */\n cancelText?: string;\n /**\n * 确认按钮的文本\n */\n confirmText?: string;\n /**\n * 是否自动聚焦\n * @default false\n */\n autoFocus?: string;\n /**\n * 关闭模态框时的回调函数\n */\n onClose?: () => void;\n /**\n * 确认操作时的回调函数\n */\n onConfirm?: () => void;\n } & VariantProps<typeof modalVariants>\n> = ({\n title,\n description,\n size = 'lg',\n zIndex = 99,\n hideClose = false,\n overlayClose = true,\n modalOnly = true,\n contentClassName,\n overlayClassName,\n iconClassName,\n closeClassName,\n fullScreen = false,\n focusScopeOptions,\n isLogin = false,\n isNotification = false,\n isHorizontal = false,\n state,\n showCancel = true,\n confirmLoading = false,\n cancelText,\n confirmText,\n children,\n autoFocus = false,\n onClose,\n onConfirm,\n ...props\n}) => {\n const isMobile = useMedia('(max-width: 768px)');\n\n if (isMobile && !modalOnly && !isNotification) {\n const drawerContent = (\n <DrawerPrimitive.Content\n className={cn(\n 'fixed inset-x-0 bottom-0 z-50 h-auto overflow-hidden no-scrollbar border-Colors-Border-Opaque bg-Colors-Background-Normal-Secondary-Alt shadow-modal-default focus:outline-none',\n fullScreen\n ? 'rounded-t-none max-h-full'\n : 'rounded-t-2xl max-h-[85vh]',\n contentClassName\n )}\n onOpenAutoFocus={(e) => {\n !autoFocus && e.preventDefault();\n }}\n >\n {title ? (\n <ModalHeader>\n <ModalTitle>{title}</ModalTitle>\n </ModalHeader>\n ) : (\n <ModalTitle className=\"hidden\"></ModalTitle>\n )}\n <div\n className={cn(\n isLogin ? 'overflow-y-scroll' : 'overflow-y-auto',\n fullScreen\n ? title\n ? 'max-h-[calc(100vh-60px)]'\n : 'max-h-[100vh]'\n : title\n ? 'max-h-[calc(85vh-60px)]'\n : 'max-h-[85vh]'\n )}\n >\n {children}\n </div>\n {!hideClose && (\n <DrawerPrimitive.Close asChild>\n <div\n className={cn('absolute right-4 top-3', closeClassName)}\n onClick={() => {\n onClose && onClose();\n }}\n >\n <IconButton\n icon={XMarkIcon}\n size=\"md\"\n variant=\"plain\"\n color=\"default\"\n className={iconClassName}\n />\n <span className=\"sr-only\">Close</span>\n </div>\n </DrawerPrimitive.Close>\n )}\n </DrawerPrimitive.Content>\n );\n\n return (\n <DrawerPrimitive.Root\n {...props}\n repositionInputs={false}\n onOpenChange={(open) => {\n if (!open) {\n onClose && onClose();\n }\n }}\n >\n <DrawerPrimitive.Portal>\n <DrawerOverlay\n onClick={() => {\n overlayClose && onClose && onClose();\n }}\n className={overlayClassName}\n />\n {focusScopeOptions ? (\n <FocusScope {...focusScopeOptions}>{drawerContent}</FocusScope>\n ) : (\n drawerContent\n )}\n </DrawerPrimitive.Portal>\n </DrawerPrimitive.Root>\n );\n }\n\n const renderIcon = (state: TModalState) => {\n switch (state) {\n case 'info':\n return (\n <InformationCircleIcon className=\"text-cc-Icon-Featured-icon-fg-Info w-6 h-6\" />\n );\n case 'success':\n return (\n <CheckCircleIcon className=\"text-cc-Icon-Featured-icon-fg-Success w-6 h-6\" />\n );\n case 'warning':\n return (\n <ExclamationTriangleIcon className=\"text-cc-Icon-Featured-icon-fg-Warning w-6 h-6\" />\n );\n case 'error':\n return (\n <XCircleIcon className=\"text-cc-Icon-Featured-icon-fg-Error w-6 h-6\" />\n );\n }\n };\n\n const getBackgroundColor = (state: TModalState) => {\n switch (state) {\n case 'info':\n return 'bg-Colors-Background-Info-Default';\n case 'success':\n return 'bg-Colors-Background-Success-Default';\n case 'warning':\n return 'bg-Colors-Background-Warning-Default';\n case 'error':\n return 'bg-Colors-Background-Critical-Default';\n }\n };\n\n const dialogContent = (\n <ModalContent\n className={cn(\n 'rounded-2xl border-Colors-Border-Opaque bg-Colors-Background-Normal-Primary-Default shadow-modal-default overflow-hidden',\n !isMobile\n ? modalVariants({ size, zIndex })\n : isLogin\n ? 'w-[90%]'\n : 'w-[80%]',\n isNotification && 'w-[312px] md:w-[380px]',\n contentClassName\n )}\n onOpenAutoFocus={(e) => {\n !autoFocus && e.preventDefault();\n }}\n >\n {isNotification ? (\n <>\n <ModalHeader className={cn(isNotification && 'border-none !pb-3')}>\n {state && (\n <div\n className={cn(\n 'flex items-center justify-center w-10 h-10 rounded-full flex-shrink-0 flex-grow-0',\n getBackgroundColor(state)\n )}\n >\n {renderIcon(state)}\n </div>\n )}\n </ModalHeader>\n <div className=\"space-y-1.5\">\n {title ? (\n <div className=\"px-5\">\n <Display size=\"sm\">{title}</Display>\n </div>\n ) : null}\n {children ||\n (description ? (\n <div className=\"px-5\">\n <Text size=\"sm\" weight=\"regular\">\n {description}\n </Text>\n </div>\n ) : null)}\n </div>\n\n <ModalFooter\n className={cn(\n 'gap-x-5 min-h-[76px] p-5 border-none justify-center w-full'\n )}\n >\n {showCancel && (\n <Button variant=\"tertiary\" onClick={onClose} className=\"flex-1\">\n {cancelText || 'Cancel'}\n </Button>\n )}\n\n <Button\n variant=\"primary\"\n onClick={onConfirm}\n loading={confirmLoading}\n color={state === 'error' ? 'error' : 'default'}\n className=\"flex-1\"\n >\n {confirmText || 'Confirm'}\n </Button>\n </ModalFooter>\n </>\n ) : (\n <>\n {title ? (\n <ModalHeader>\n <ModalTitle>{title}</ModalTitle>\n </ModalHeader>\n ) : (\n <ModalTitle className=\"hidden\"></ModalTitle>\n )}\n {children}\n </>\n )}\n\n {!hideClose && (\n <DialogPrimitive.Close asChild>\n <div\n onClick={() => {\n onClose && onClose();\n }}\n className={cn(\n 'absolute right-4 top-4',\n isNotification && 'top-5',\n closeClassName\n )}\n >\n <IconButton\n icon={XMarkIcon}\n size=\"md\"\n variant=\"plain\"\n color=\"default\"\n className={iconClassName}\n />\n <span className=\"sr-only\">Close</span>\n </div>\n </DialogPrimitive.Close>\n )}\n </ModalContent>\n );\n\n return (\n <ModalRoot {...props}>\n <ModalOverlay\n onClick={() => {\n overlayClose && onClose && onClose();\n }}\n className={overlayClassName}\n />\n {focusScopeOptions ? (\n <FocusScope {...focusScopeOptions}>{dialogContent}</FocusScope>\n ) : (\n dialogContent\n )}\n </ModalRoot>\n );\n};\n\nfunction ModalHeader({\n className,\n children,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn(\n 'border-b border-Colors-Border-Default flex flex-col py-4 md:py-5 px-4 justify-center',\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n}\nModalHeader.displayName = 'ModalHeader';\n\nfunction ModalFooter({\n className,\n children,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn(\n 'border-t border-Colors-Border-Default flex justify-end p-4',\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n}\n\nModalFooter.displayName = 'ModalFooter';\n\nfunction ModalBody({\n className,\n children,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div className={cn('py-3', className)} {...props}>\n {children}\n </div>\n );\n}\n\nModalBody.displayName = 'ModalBody';\n\nexport {\n Modal,\n ModalBody,\n ModalContent,\n ModalFooter,\n ModalHeader,\n ModalOverlay,\n ModalRoot,\n ModalTitle,\n};\n","import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\n\nconst AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';\nconst AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';\nconst EVENT_OPTIONS = { bubbles: false, cancelable: true };\n\ntype FocusableTarget = HTMLElement | { focus(): void };\n\n/* -------------------------------------------------------------------------------------------------\n * FocusScope\n * -----------------------------------------------------------------------------------------------*/\n\nconst FOCUS_SCOPE_NAME = 'FocusScope';\n\ntype FocusScopeElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface FocusScopeProps extends PrimitiveDivProps {\n /**\n * When `true`, tabbing from last item will focus first tabbable\n * and shift+tab from first item will focus last tababble.\n * @defaultValue false\n */\n loop?: boolean;\n\n /**\n * When `true`, focus cannot escape the focus scope via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapped?: boolean;\n\n /**\n * Event handler called when auto-focusing on mount.\n * Can be prevented.\n */\n onMountAutoFocus?: (event: Event) => void;\n\n /**\n * Event handler called when auto-focusing on unmount.\n * Can be prevented.\n */\n onUnmountAutoFocus?: (event: Event) => void;\n}\n\nconst FocusScope = React.forwardRef<FocusScopeElement, FocusScopeProps>((props, forwardedRef) => {\n const {\n loop = false,\n trapped = false,\n onMountAutoFocus: onMountAutoFocusProp,\n onUnmountAutoFocus: onUnmountAutoFocusProp,\n ...scopeProps\n } = props;\n const [container, setContainer] = React.useState<HTMLElement | null>(null);\n const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);\n const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);\n const lastFocusedElementRef = React.useRef<HTMLElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));\n\n const focusScope = React.useRef({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n },\n }).current;\n\n // Takes care of trapping focus if focus is moved outside programmatically for example\n React.useEffect(() => {\n if (trapped) {\n function handleFocusIn(event: FocusEvent) {\n if (focusScope.paused || !container) return;\n const target = event.target as HTMLElement | null;\n if (container.contains(target)) {\n lastFocusedElementRef.current = target;\n } else {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }\n\n function handleFocusOut(event: FocusEvent) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget as HTMLElement | null;\n\n // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:\n //\n // 1. When the user switches app/tabs/windows/the browser itself loses focus.\n // 2. In Google Chrome, when the focused element is removed from the DOM.\n //\n // We let the browser do its thing here because:\n //\n // 1. The browser already keeps a memory of what's focused for when the page gets refocused.\n // 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it\n // throws the CPU to 100%, so we avoid doing anything for this reason here too.\n if (relatedTarget === null) return;\n\n // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)\n // that is outside the container, we move focus to the last valid focused element inside.\n if (!container.contains(relatedTarget)) {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }\n\n // When the focused element gets removed from the DOM, browsers move focus\n // back to the document.body. In this case, we move focus to the container\n // to keep focus trapped correctly.\n function handleMutations(mutations: MutationRecord[]) {\n const focusedElement = document.activeElement as HTMLElement | null;\n if (focusedElement !== document.body) return;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) focus(container);\n }\n }\n\n document.addEventListener('focusin', handleFocusIn);\n document.addEventListener('focusout', handleFocusOut);\n const mutationObserver = new MutationObserver(handleMutations);\n if (container) mutationObserver.observe(container, { childList: true, subtree: true });\n\n return () => {\n document.removeEventListener('focusin', handleFocusIn);\n document.removeEventListener('focusout', handleFocusOut);\n mutationObserver.disconnect();\n };\n }\n }, [trapped, container, focusScope.paused]);\n\n React.useEffect(() => {\n if (container) {\n focusScopesStack.add(focusScope);\n const previouslyFocusedElement = document.activeElement as HTMLElement | null;\n const hasFocusedCandidate = container.contains(previouslyFocusedElement);\n\n if (!hasFocusedCandidate) {\n const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n container.dispatchEvent(mountEvent);\n if (!mountEvent.defaultPrevented) {\n focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });\n if (document.activeElement === previouslyFocusedElement) {\n focus(container);\n }\n }\n }\n\n return () => {\n container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n\n // We hit a react bug (fixed in v17) with focusing in unmount.\n // We need to delay the focus a little to get around it for now.\n // See: https://github.com/facebook/react/issues/17894\n setTimeout(() => {\n const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n container.dispatchEvent(unmountEvent);\n if (!unmountEvent.defaultPrevented) {\n focus(previouslyFocusedElement ?? document.body, { select: true });\n }\n // we need to remove the listener after we `dispatchEvent`\n container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n\n focusScopesStack.remove(focusScope);\n }, 0);\n };\n }\n }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);\n\n // Takes care of looping focus (when tabbing whilst at the edges)\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (!loop && !trapped) return;\n if (focusScope.paused) return;\n\n const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement as HTMLElement | null;\n\n if (isTabKey && focusedElement) {\n const container = event.currentTarget as HTMLElement;\n const [first, last] = getTabbableEdges(container);\n const hasTabbableElementsInside = first && last;\n\n // we can only wrap focus if we have tabbable edges\n if (!hasTabbableElementsInside) {\n if (focusedElement === container) event.preventDefault();\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n if (loop) focus(first, { select: true });\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n if (loop) focus(last, { select: true });\n }\n }\n }\n },\n [loop, trapped, focusScope.paused]\n );\n\n return (\n <Primitive.div tabIndex={-1} {...scopeProps} ref={composedRefs} onKeyDown={handleKeyDown} />\n );\n});\n\nFocusScope.displayName = FOCUS_SCOPE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Attempts focusing the first element in a list of candidates.\n * Stops when focus has actually moved.\n */\nfunction focusFirst(candidates: HTMLElement[], { select = false } = {}) {\n const previouslyFocusedElement = document.activeElement;\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (document.activeElement !== previouslyFocusedElement) return;\n }\n}\n\n/**\n * Returns the first and last tabbable elements inside a container.\n */\nfunction getTabbableEdges(container: HTMLElement) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last] as const;\n}\n\n/**\n * Returns a list of potential tabbable candidates.\n *\n * NOTE: This is only a close approximation. For example it doesn't take into account cases like when\n * elements are not visible. This cannot be worked out easily by just reading a property, but rather\n * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker\n * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1\n */\nfunction getTabbableCandidates(container: HTMLElement) {\n const nodes: HTMLElement[] = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: any) => {\n const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n // `.tabIndex` is not the same as the `tabindex` attribute. It works on the\n // runtime's understanding of tabbability, so this automatically accounts\n // for any kind of element that could be tabbed to.\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n },\n });\n while (walker.nextNode()) nodes.push(walker.currentNode as HTMLElement);\n // we do not take into account the order of nodes with positive `tabIndex` as it\n // hinders accessibility to have tab order different from visual order.\n return nodes;\n}\n\n/**\n * Returns the first visible element in a list.\n * NOTE: Only checks visibility up to the `container`.\n */\nfunction findVisible(elements: HTMLElement[], container: HTMLElement) {\n for (const element of elements) {\n // we stop checking if it's hidden at the `container` level (excluding)\n if (!isHidden(element, { upTo: container })) return element;\n }\n}\n\nfunction isHidden(node: HTMLElement, { upTo }: { upTo?: HTMLElement }) {\n if (getComputedStyle(node).visibility === 'hidden') return true;\n while (node) {\n // we stop at `upTo` (excluding it)\n if (upTo !== undefined && node === upTo) return false;\n if (getComputedStyle(node).display === 'none') return true;\n node = node.parentElement as HTMLElement;\n }\n return false;\n}\n\nfunction isSelectableInput(element: any): element is FocusableTarget & { select: () => void } {\n return element instanceof HTMLInputElement && 'select' in element;\n}\n\nfunction focus(element?: FocusableTarget | null, { select = false } = {}) {\n // only focus if that element is focusable\n if (element && element.focus) {\n const previouslyFocusedElement = document.activeElement;\n // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users\n element.focus({ preventScroll: true });\n // only select if its not the same element, it supports selection and we need to select\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select)\n element.select();\n }\n}\n\n/* -------------------------------------------------------------------------------------------------\n * FocusScope stack\n * -----------------------------------------------------------------------------------------------*/\n\ntype FocusScopeAPI = { paused: boolean; pause(): void; resume(): void };\nconst focusScopesStack = createFocusScopesStack();\n\nfunction createFocusScopesStack() {\n /** A stack of focus scopes, with the active one at the top */\n let stack: FocusScopeAPI[] = [];\n\n return {\n add(focusScope: FocusScopeAPI) {\n // pause the currently active focus scope (at the top of the stack)\n const activeFocusScope = stack[0];\n if (focusScope !== activeFocusScope) {\n activeFocusScope?.pause();\n }\n // remove in case it already exists (because we'll re-add it at the top of the stack)\n stack = arrayRemove(stack, focusScope);\n stack.unshift(focusScope);\n },\n\n remove(focusScope: FocusScopeAPI) {\n stack = arrayRemove(stack, focusScope);\n stack[0]?.resume();\n },\n };\n}\n\nfunction arrayRemove<T>(array: T[], item: T) {\n const updatedArray = [...array];\n const index = updatedArray.indexOf(item);\n if (index !== -1) {\n updatedArray.splice(index, 1);\n }\n return updatedArray;\n}\n\nfunction removeLinks(items: HTMLElement[]) {\n return items.filter((item) => item.tagName !== 'A');\n}\n\nconst Root = FocusScope;\n\nexport {\n FocusScope,\n //\n Root,\n};\nexport type { FocusScopeProps };\n","import * as React from 'react';\n\ntype PossibleRef<T> = React.Ref<T> | undefined;\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef<T>(ref: PossibleRef<T>, value: T) {\n if (typeof ref === 'function') {\n return ref(value);\n } else if (ref !== null && ref !== undefined) {\n ref.current = value;\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == 'function') {\n hasCleanup = true;\n }\n return cleanup;\n });\n\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == 'function') {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs);\n}\n\nexport { composeRefs, useComposedRefs };\n","import * as React from 'react';\n\n/**\n * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a\n * prop or avoid re-executing effects when passed as a dependency\n */\nfunction useCallbackRef<T extends (...args: any[]) => any>(callback: T | undefined): T {\n const callbackRef = React.useRef(callback);\n\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n\n // https://github.com/facebook/react/issues/19240\n return React.useMemo(() => ((...args) => callbackRef.current?.(...args)) as T, []);\n}\n\nexport { useCallbackRef };\n","import MagnifyingGlassIcon from '@heroicons/react/24/outline/esm/MagnifyingGlassIcon';\nimport XMarkIcon from '@heroicons/react/24/outline/esm/XMarkIcon';\nimport { cva } from 'class-variance-authority';\nimport * as React from 'react';\nimport { useEffect } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Icon } from './icon';\nimport { IconButton } from './button/icon-button';\nimport { Input } from './input';\n\nexport type SearchInputProps = React.InputHTMLAttributes<HTMLInputElement>;\nexport type SearchBarProps = {\n /**\n * searchBar样式覆盖\n */\n className?: string;\n /**\n * input样式覆盖\n */\n inputClassName?: string;\n /*\n * 外部传入的值\n */\n searchValue?: string;\n /**\n * 点击或键盘按下回车时触发回调函数\n */\n onSearchChange: (value: string) => void;\n /**\n * placeholder值\n */\n placeholder?: string;\n /**\n * 大小 sm(default) | md\n *\n * @default sm\n */\n size?: 'md' | 'sm' | 'xs';\n\n /**\n * 是否圆角\n */\n roundedFill?: boolean;\n /**\n * 值改变时触发回调函数\n */\n onValueChange?: (value: string) => void;\n} & Omit<SearchInputProps, 'size'>;\n\nconst searchBarVariants = cva('rounded-md', {\n variants: {\n size: {\n md: 'h-11',\n sm: 'h-10',\n xs: 'h-9',\n },\n },\n defaultVariants: {\n size: 'sm',\n },\n});\n\nfunction SearchBar({\n className,\n inputClassName,\n placeholder,\n type,\n size,\n readOnly,\n searchValue,\n roundedFill,\n onSearchChange,\n onValueChange,\n ...props\n}: SearchBarProps) {\n const [value, setValue] = React.useState('');\n useEffect(() => {\n setValue(searchValue || '');\n }, [searchValue]);\n\n return (\n <div\n className={cn('relative w-full', searchBarVariants({ size }), className)}\n >\n <Icon\n component={MagnifyingGlassIcon}\n size=\"lg\"\n className=\"absolute top-1/2 -translate-y-1/2 left-3 z-10 text-Colors-Foreground-Subtlest cursor-pointer\"\n onClick={() => {\n onSearchChange(value);\n }}\n />\n <Input\n type={type}\n placeholder={placeholder}\n rounded={roundedFill ? 'full' : 'md'}\n size={size}\n className={cn(\n 'relative w-full px-9 flex space-x-2 text-base shadow-none placeholder:text-Colors-Text-Subtlest',\n {\n 'focus-visible:ring-transparent': readOnly,\n },\n 'border-cc-Search-Bar-border-default bg-cc-Search-Bar-bg-default hover:bg-cc-Search-Bar-bg-hover focus-visible:shadow-cc-Focus-Rings-Brand-default',\n className\n )}\n value={value}\n onChange={(e) => {\n setValue(e.target.value);\n onValueChange?.(e.target.value);\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter' && !(e.shiftKey || e.altKey)) {\n (e.target as HTMLInputElement).blur();\n onSearchChange(value);\n }\n }}\n {...props}\n />\n {value && (\n <IconButton\n className=\"absolute top-1/2 -translate-y-1/2 right-1.5 z-10 rounded-full text-Colors-Foreground-Subtle\"\n onClick={() => {\n onSearchChange('');\n setValue('');\n onValueChange?.('');\n }}\n size=\"sm\"\n variant=\"plain\"\n icon={XMarkIcon}\n />\n )}\n </div>\n );\n}\n\nSearchBar.displayName = 'SearchBar';\n\nexport { SearchBar };\n","import Image from 'next/image';\n\nimport { getAssetsUrl } from '../common/utils/common-helper';\nimport { cn } from '@/lib/utils';\n\nimport { Progress } from './progress';\nimport { Tooltip } from './tooltip';\n\ntype EnergyProgressBarProps = {\n energy: number;\n dailyEnergy: number;\n hoverText?: string;\n className?: string;\n};\nfunction EnergyProgress(props: EnergyProgressBarProps) {\n const { energy, dailyEnergy, hoverText, className } = props;\n\n return (\n <div className={cn('flex items-center relative', className)}>\n <div className=\"absolute left-[-20px] justify-center items-center w-6 h-6 border border-solid border-[#F3D42D] dark:border-[#A48F07] bg-white dark:bg-[#24210B] rounded-[6px] z-10\">\n <Image\n src={getAssetsUrl('image/bot/tag/20231214/1719340128612116720.png')}\n alt=\"energy\"\n width={22}\n height={22}\n />\n </div>\n\n <Tooltip\n description={\n hoverText ??\n `Utilize battery to chat with bots or set up your own bot. Recharge ⚡️${Math.floor(\n dailyEnergy / 24\n )} per hour when battery is below ${dailyEnergy}`\n }\n side=\"bottom\"\n align=\"end\"\n sideOffset={16}\n alignOffset={-16}\n showArrow={false}\n >\n <Progress\n value={energy}\n max={dailyEnergy}\n className=\"rounded-[6px] rounded-l-none border border-solid border-cc-Energy-border-default bg-cc-Energy-bg-alt flex items-center justify-start\"\n indicatorClassName={'bg-cc-Energy-bg-on'}\n label={\n <span className=\"text-cc-Energy-fg-default font-medium text-xs ml-[2px]\">{`${energy}/${dailyEnergy}`}</span>\n }\n />\n </Tooltip>\n </div>\n );\n}\nexport default EnergyProgress;\n","import * as ProgressPrimitive from '@radix-ui/react-progress';\n\nimport { clamp } from '../common/utils/common-helper';\nimport { cn } from '@/lib/utils';\n\nexport type ProgressProps = {\n /**\n * 进度条的当前值\n */\n value: number;\n /**\n * 进度条的最大值\n */\n max: number;\n /**\n * 进度条的自定义类名\n */\n className?: string;\n /**\n * 进度条指示器的自定义类名\n */\n indicatorClassName?: string;\n /**\n * 进度条的标签内容\n */\n label?: React.ReactNode;\n /**\n * 进度条的高度\n */\n height?: number;\n /**\n * 进度条的宽度\n */\n width?: number;\n /**\n * 进度条最小宽度\n */\n minWidth?: number;\n /**\n * 进度条最大宽度\n */\n maxWidth?: number;\n};\n\nexport const Progress = ({\n value,\n max,\n className,\n indicatorClassName,\n label,\n height = 20,\n width = 75,\n minWidth = 60,\n maxWidth = 220,\n}: ProgressProps) => {\n const widthValue = `${clamp(\n width + (Math.max(max, value).toString().length - 3) * 12,\n minWidth,\n maxWidth\n )}px`;\n\n return (\n <ProgressPrimitive.Root\n value={value}\n max={Math.max(value, max)}\n className={cn('relative overflow-hidden', className)}\n style={{ height: `${height}px`, width: widthValue }}\n >\n <ProgressPrimitive.Indicator\n className={cn('h-full transition-all', indicatorClassName)}\n style={{ width: `${(value / max) * 100}%` }}\n />\n {label && (\n <div className=\"absolute inset-0 flex items-center justify-center px-1\">\n {label}\n </div>\n )}\n </ProgressPrimitive.Root>\n );\n};\n","/* eslint-disable react/jsx-no-useless-fragment */\n\nimport { cn } from '@/lib/utils';\nimport { SearchBar } from './search-bar';\nimport { Display } from './typography';\nimport EnergyProgress from './energy-progress';\n\ntype INavigationBar = {\n /**\n * 右侧自定义内容\n * ReactNode\n *\n */\n children?: React.ReactNode;\n /**\n * 导航栏title\n * string\n */\n title?: string;\n /**\n * 是否展示搜索框\n * boolean\n *\n * @default false\n */\n showSearchBar?: boolean;\n /**\n * 搜索框值\n * string\n */\n searchValue?: string;\n /**\n * 搜索框占位值\n * string\n */\n searchPlaceholder?: string;\n /**\n * 电量值\n * number\n */\n energy?: number;\n /**\n * 每日电量值\n * number\n */\n dailyEnergy?: number;\n onSearchChange?: (value: string) => void;\n};\n\nfunction NavigationBar({\n showSearchBar = true,\n searchValue,\n searchPlaceholder,\n title,\n children,\n energy = 0,\n dailyEnergy,\n onSearchChange,\n}: INavigationBar) {\n return (\n <div\n className={cn(\n 'relative w-full flex flex-col justify-between items-center px-4 md:px-6'\n )}\n >\n <div className=\"w-full pt-5 md:pt-6 pb-1 md:pb-3 flex justify-between items-center\">\n <div className=\"flex-1 text-start\">\n <Display size=\"md\">{title}</Display>\n </div>\n {children ? (\n <div className=\"w-fit\">{children}</div>\n ) : (\n <>\n {dailyEnergy ? (\n <EnergyProgress\n dailyEnergy={dailyEnergy}\n energy={energy}\n className=\"flex relative items-center flex-shrink-0\"\n />\n ) : null}\n </>\n )}\n </div>\n\n {showSearchBar && (\n <div className=\"w-full py-2 md:py-0\">\n <SearchBar\n placeholder={searchPlaceholder}\n searchValue={searchValue}\n onSearchChange={(value: string) =>\n onSearchChange && onSearchChange(value)\n }\n />\n </div>\n )}\n </div>\n );\n}\n\nexport { NavigationBar };\n","/*!\r\n * decimal.js v10.5.0\r\n * An arbitrary-precision Decimal type for JavaScript.\r\n * https://github.com/MikeMcl/decimal.js\r\n * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>\r\n * MIT Licence\r\n */\r\n\r\n\r\n// ----------------------------------- EDITABLE DEFAULTS ------------------------------------ //\r\n\r\n\r\n // The maximum exponent magnitude.\r\n // The limit on the value of `toExpNeg`, `toExpPos`, `minE` and `maxE`.\r\nvar EXP_LIMIT = 9e15, // 0 to 9e15\r\n\r\n // The limit on the value of `precision`, and on the value of the first argument to\r\n // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.\r\n MAX_DIGITS = 1e9, // 0 to 1e9\r\n\r\n // Base conversion alphabet.\r\n NUMERALS = '0123456789abcdef',\r\n\r\n // The natural logarithm of 10 (1025 digits).\r\n LN10 = '2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058',\r\n\r\n // Pi (1025 digits).\r\n PI = '3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789',\r\n\r\n\r\n // The initial configuration properties of the Decimal constructor.\r\n DEFAULTS = {\r\n\r\n // These values must be integers within the stated ranges (inclusive).\r\n // Most of these values can be changed at run-time using the `Decimal.config` method.\r\n\r\n // The maximum number of significant digits of the result of a calculation or base conversion.\r\n // E.g. `Decimal.config({ precision: 20 });`\r\n precision: 20, // 1 to MAX_DIGITS\r\n\r\n // The rounding mode used when rounding to `precision`.\r\n //\r\n // ROUND_UP 0 Away from zero.\r\n // ROUND_DOWN 1 Towards zero.\r\n // ROUND_CEIL 2 Towards +Infinity.\r\n // ROUND_FLOOR 3 Towards -Infinity.\r\n // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n //\r\n // E.g.\r\n // `Decimal.rounding = 4;`\r\n // `Decimal.rounding = Decimal.ROUND_HALF_UP;`\r\n rounding: 4, // 0 to 8\r\n\r\n // The modulo mode used when calculating the modulus: a mod n.\r\n // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\r\n // The remainder (r) is calculated as: r = a - n * q.\r\n //\r\n // UP 0 The remainder is positive if the dividend is negative, else is negative.\r\n // DOWN 1 The remainder has the same sign as the dividend (JavaScript %).\r\n // FLOOR 3 The remainder has the same sign as the divisor (Python %).\r\n // HALF_EVEN 6 The IEEE 754 remainder function.\r\n // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive.\r\n //\r\n // Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian\r\n // division (9) are commonly used for the modulus operation. The other rounding modes can also\r\n // be used, but they may not give useful results.\r\n modulo: 1, // 0 to 9\r\n\r\n // The exponent value at and beneath which `toString` returns exponential notation.\r\n // JavaScript numbers: -7\r\n toExpNeg: -7, // 0 to -EXP_LIMIT\r\n\r\n // The exponent value at and above which `toString` returns exponential notation.\r\n // JavaScript numbers: 21\r\n toExpPos: 21, // 0 to EXP_LIMIT\r\n\r\n // The minimum exponent value, beneath which underflow to zero occurs.\r\n // JavaScript numbers: -324 (5e-324)\r\n minE: -EXP_LIMIT, // -1 to -EXP_LIMIT\r\n\r\n // The maximum exponent value, above which overflow to Infinity occurs.\r\n // JavaScript numbers: 308 (1.7976931348623157e+308)\r\n maxE: EXP_LIMIT, // 1 to EXP_LIMIT\r\n\r\n // Whether to use cryptographically-secure random number generation, if available.\r\n crypto: false // true/false\r\n },\r\n\r\n\r\n// ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- //\r\n\r\n\r\n inexact, quadrant,\r\n external = true,\r\n\r\n decimalError = '[DecimalError] ',\r\n invalidArgument = decimalError + 'Invalid argument: ',\r\n precisionLimitExceeded = decimalError + 'Precision limit exceeded',\r\n cryptoUnavailable = decimalError + 'crypto unavailable',\r\n tag = '[object Decimal]',\r\n\r\n mathfloor = Math.floor,\r\n mathpow = Math.pow,\r\n\r\n isBinary = /^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,\r\n isHex = /^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,\r\n isOctal = /^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,\r\n isDecimal = /^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,\r\n\r\n BASE = 1e7,\r\n LOG_BASE = 7,\r\n MAX_SAFE_INTEGER = 9007199254740991,\r\n\r\n LN10_PRECISION = LN10.length - 1,\r\n PI_PRECISION = PI.length - 1,\r\n\r\n // Decimal.prototype object\r\n P = { toStringTag: tag };\r\n\r\n\r\n// Decimal prototype methods\r\n\r\n\r\n/*\r\n * absoluteValue abs\r\n * ceil\r\n * clampedTo clamp\r\n * comparedTo cmp\r\n * cosine cos\r\n * cubeRoot cbrt\r\n * decimalPlaces dp\r\n * dividedBy div\r\n * dividedToIntegerBy divToInt\r\n * equals eq\r\n * floor\r\n * greaterThan gt\r\n * greaterThanOrEqualTo gte\r\n * hyperbolicCosine cosh\r\n * hyperbolicSine sinh\r\n * hyperbolicTangent tanh\r\n * inverseCosine acos\r\n * inverseHyperbolicCosine acosh\r\n * inverseHyperbolicSine asinh\r\n * inverseHyperbolicTangent atanh\r\n * inverseSine asin\r\n * inverseTangent atan\r\n * isFinite\r\n * isInteger isInt\r\n * isNaN\r\n * isNegative isNeg\r\n * isPositive isPos\r\n * isZero\r\n * lessThan lt\r\n * lessThanOrEqualTo lte\r\n * logarithm log\r\n * [maximum] [max]\r\n * [minimum] [min]\r\n * minus sub\r\n * modulo mod\r\n * naturalExponential exp\r\n * naturalLogarithm ln\r\n * negated neg\r\n * plus add\r\n * precision sd\r\n * round\r\n * sine sin\r\n * squareRoot sqrt\r\n * tangent tan\r\n * times mul\r\n * toBinary\r\n * toDecimalPlaces toDP\r\n * toExponential\r\n * toFixed\r\n * toFraction\r\n * toHexadecimal toHex\r\n * toNearest\r\n * toNumber\r\n * toOctal\r\n * toPower pow\r\n * toPrecision\r\n * toSignificantDigits toSD\r\n * toString\r\n * truncated trunc\r\n * valueOf toJSON\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the absolute value of this Decimal.\r\n *\r\n */\r\nP.absoluteValue = P.abs = function () {\r\n var x = new this.constructor(this);\r\n if (x.s < 0) x.s = 1;\r\n return finalise(x);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n * direction of positive Infinity.\r\n *\r\n */\r\nP.ceil = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 2);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal clamped to the range\r\n * delineated by `min` and `max`.\r\n *\r\n * min {number|string|bigint|Decimal}\r\n * max {number|string|bigint|Decimal}\r\n *\r\n */\r\nP.clampedTo = P.clamp = function (min, max) {\r\n var k,\r\n x = this,\r\n Ctor = x.constructor;\r\n min = new Ctor(min);\r\n max = new Ctor(max);\r\n if (!min.s || !max.s) return new Ctor(NaN);\r\n if (min.gt(max)) throw Error(invalidArgument + max);\r\n k = x.cmp(min);\r\n return k < 0 ? min : x.cmp(max) > 0 ? max : new Ctor(x);\r\n};\r\n\r\n\r\n/*\r\n * Return\r\n * 1 if the value of this Decimal is greater than the value of `y`,\r\n * -1 if the value of this Decimal is less than the value of `y`,\r\n * 0 if they have the same value,\r\n * NaN if the value of either Decimal is NaN.\r\n *\r\n */\r\nP.comparedTo = P.cmp = function (y) {\r\n var i, j, xdL, ydL,\r\n x = this,\r\n xd = x.d,\r\n yd = (y = new x.constructor(y)).d,\r\n xs = x.s,\r\n ys = y.s;\r\n\r\n // Either NaN or ±Infinity?\r\n if (!xd || !yd) {\r\n return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1;\r\n }\r\n\r\n // Either zero?\r\n if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0;\r\n\r\n // Signs differ?\r\n if (xs !== ys) return xs;\r\n\r\n // Compare exponents.\r\n if (x.e !== y.e) return x.e > y.e ^ xs < 0 ? 1 : -1;\r\n\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Compare digit by digit.\r\n for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {\r\n if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ xs < 0 ? 1 : -1;\r\n }\r\n\r\n // Compare lengths.\r\n return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cosine of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * cos(0) = 1\r\n * cos(-0) = 1\r\n * cos(Infinity) = NaN\r\n * cos(-Infinity) = NaN\r\n * cos(NaN) = NaN\r\n *\r\n */\r\nP.cosine = P.cos = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.d) return new Ctor(NaN);\r\n\r\n // cos(0) = cos(-0) = 1\r\n if (!x.d[0]) return new Ctor(1);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n Ctor.rounding = 1;\r\n\r\n x = cosine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n *\r\n * Return a new Decimal whose value is the cube root of the value of this Decimal, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * cbrt(0) = 0\r\n * cbrt(-0) = -0\r\n * cbrt(1) = 1\r\n * cbrt(-1) = -1\r\n * cbrt(N) = N\r\n * cbrt(-I) = -I\r\n * cbrt(I) = I\r\n *\r\n * Math.cbrt(x) = (x < 0 ? -Math.pow(-x, 1/3) : Math.pow(x, 1/3))\r\n *\r\n */\r\nP.cubeRoot = P.cbrt = function () {\r\n var e, m, n, r, rep, s, sd, t, t3, t3plusx,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = x.s * mathpow(x.s * x, 1 / 3);\r\n\r\n // Math.cbrt underflow/overflow?\r\n // Pass x to Math.pow as integer, then adjust the exponent of the result.\r\n if (!s || Math.abs(s) == 1 / 0) {\r\n n = digitsToString(x.d);\r\n e = x.e;\r\n\r\n // Adjust n exponent so it is a multiple of 3 away from x exponent.\r\n if (s = (e - n.length + 1) % 3) n += (s == 1 || s == -2 ? '0' : '00');\r\n s = mathpow(n, 1 / 3);\r\n\r\n // Rarely, e may be one less than the result exponent value.\r\n e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2));\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n r.s = x.s;\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n sd = (e = Ctor.precision) + 3;\r\n\r\n // Halley's method.\r\n // TODO? Compare Newton's method.\r\n for (;;) {\r\n t = r;\r\n t3 = t.times(t).times(t);\r\n t3plusx = t3.plus(x);\r\n r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1);\r\n\r\n // TODO? Replace with for-loop and checkRoundingDigits.\r\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n n = n.slice(sd - 3, sd + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or 4999\r\n // , i.e. approaching a rounding boundary, continue the iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n if (!rep) {\r\n finalise(t, e + 1, 0);\r\n\r\n if (t.times(t).times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n sd += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n // If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n finalise(r, e + 1, 1);\r\n m = !r.times(r).times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, e, Ctor.rounding, m);\r\n};\r\n\r\n\r\n/*\r\n * Return the number of decimal places of the value of this Decimal.\r\n *\r\n */\r\nP.decimalPlaces = P.dp = function () {\r\n var w,\r\n d = this.d,\r\n n = NaN;\r\n\r\n if (d) {\r\n w = d.length - 1;\r\n n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n w = d[w];\r\n if (w) for (; w % 10 == 0; w /= 10) n--;\r\n if (n < 0) n = 0;\r\n }\r\n\r\n return n;\r\n};\r\n\r\n\r\n/*\r\n * n / 0 = I\r\n * n / N = N\r\n * n / I = 0\r\n * 0 / n = 0\r\n * 0 / 0 = N\r\n * 0 / N = N\r\n * 0 / I = 0\r\n * N / n = N\r\n * N / 0 = N\r\n * N / N = N\r\n * N / I = N\r\n * I / n = I\r\n * I / 0 = I\r\n * I / N = N\r\n * I / I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal divided by `y`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.dividedBy = P.div = function (y) {\r\n return divide(this, new this.constructor(y));\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the integer part of dividing the value of this Decimal\r\n * by the value of `y`, rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.dividedToIntegerBy = P.divToInt = function (y) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.\r\n *\r\n */\r\nP.equals = P.eq = function (y) {\r\n return this.cmp(y) === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n * direction of negative Infinity.\r\n *\r\n */\r\nP.floor = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 3);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is greater than the value of `y`, otherwise return\r\n * false.\r\n *\r\n */\r\nP.greaterThan = P.gt = function (y) {\r\n return this.cmp(y) > 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is greater than or equal to the value of `y`,\r\n * otherwise return false.\r\n *\r\n */\r\nP.greaterThanOrEqualTo = P.gte = function (y) {\r\n var k = this.cmp(y);\r\n return k == 1 || k === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic cosine of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [1, Infinity]\r\n *\r\n * cosh(x) = 1 + x^2/2! + x^4/4! + x^6/6! + ...\r\n *\r\n * cosh(0) = 1\r\n * cosh(-0) = 1\r\n * cosh(Infinity) = Infinity\r\n * cosh(-Infinity) = Infinity\r\n * cosh(NaN) = NaN\r\n *\r\n * x time taken (ms) result\r\n * 1000 9 9.8503555700852349694e+433\r\n * 10000 25 4.4034091128314607936e+4342\r\n * 100000 171 1.4033316802130615897e+43429\r\n * 1000000 3817 1.5166076984010437725e+434294\r\n * 10000000 abandoned after 2 minute wait\r\n *\r\n * TODO? Compare performance of cosh(x) = 0.5 * (exp(x) + exp(-x))\r\n *\r\n */\r\nP.hyperbolicCosine = P.cosh = function () {\r\n var k, n, pr, rm, len,\r\n x = this,\r\n Ctor = x.constructor,\r\n one = new Ctor(1);\r\n\r\n if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN);\r\n if (x.isZero()) return one;\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n len = x.d.length;\r\n\r\n // Argument reduction: cos(4x) = 1 - 8cos^2(x) + 8cos^4(x) + 1\r\n // i.e. cos(x) = 1 - cos^2(x/4)(8 - 8cos^2(x/4))\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n // TODO? Estimation reused from cosine() and may not be optimal here.\r\n if (len < 32) {\r\n k = Math.ceil(len / 3);\r\n n = (1 / tinyPow(4, k)).toString();\r\n } else {\r\n k = 16;\r\n n = '2.3283064365386962890625e-10';\r\n }\r\n\r\n x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true);\r\n\r\n // Reverse argument reduction\r\n var cosh2_x,\r\n i = k,\r\n d8 = new Ctor(8);\r\n for (; i--;) {\r\n cosh2_x = x.times(x);\r\n x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8))));\r\n }\r\n\r\n return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic sine of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * sinh(x) = x + x^3/3! + x^5/5! + x^7/7! + ...\r\n *\r\n * sinh(0) = 0\r\n * sinh(-0) = -0\r\n * sinh(Infinity) = Infinity\r\n * sinh(-Infinity) = -Infinity\r\n * sinh(NaN) = NaN\r\n *\r\n * x time taken (ms)\r\n * 10 2 ms\r\n * 100 5 ms\r\n * 1000 14 ms\r\n * 10000 82 ms\r\n * 100000 886 ms 1.4033316802130615897e+43429\r\n * 200000 2613 ms\r\n * 300000 5407 ms\r\n * 400000 8824 ms\r\n * 500000 13026 ms 8.7080643612718084129e+217146\r\n * 1000000 48543 ms\r\n *\r\n * TODO? Compare performance of sinh(x) = 0.5 * (exp(x) - exp(-x))\r\n *\r\n */\r\nP.hyperbolicSine = P.sinh = function () {\r\n var k, pr, rm, len,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n len = x.d.length;\r\n\r\n if (len < 3) {\r\n x = taylorSeries(Ctor, 2, x, x, true);\r\n } else {\r\n\r\n // Alternative argument reduction: sinh(3x) = sinh(x)(3 + 4sinh^2(x))\r\n // i.e. sinh(x) = sinh(x/3)(3 + 4sinh^2(x/3))\r\n // 3 multiplications and 1 addition\r\n\r\n // Argument reduction: sinh(5x) = sinh(x)(5 + sinh^2(x)(20 + 16sinh^2(x)))\r\n // i.e. sinh(x) = sinh(x/5)(5 + sinh^2(x/5)(20 + 16sinh^2(x/5)))\r\n // 4 multiplications and 2 additions\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n k = 1.4 * Math.sqrt(len);\r\n k = k > 16 ? 16 : k | 0;\r\n\r\n x = x.times(1 / tinyPow(5, k));\r\n x = taylorSeries(Ctor, 2, x, x, true);\r\n\r\n // Reverse argument reduction\r\n var sinh2_x,\r\n d5 = new Ctor(5),\r\n d16 = new Ctor(16),\r\n d20 = new Ctor(20);\r\n for (; k--;) {\r\n sinh2_x = x.times(x);\r\n x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20))));\r\n }\r\n }\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic tangent of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * tanh(x) = sinh(x) / cosh(x)\r\n *\r\n * tanh(0) = 0\r\n * tanh(-0) = -0\r\n * tanh(Infinity) = 1\r\n * tanh(-Infinity) = -1\r\n * tanh(NaN) = NaN\r\n *\r\n */\r\nP.hyperbolicTangent = P.tanh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(x.s);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 7;\r\n Ctor.rounding = 1;\r\n\r\n return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arccosine (inverse cosine) in radians of the value of\r\n * this Decimal.\r\n *\r\n * Domain: [-1, 1]\r\n * Range: [0, pi]\r\n *\r\n * acos(x) = pi/2 - asin(x)\r\n *\r\n * acos(0) = pi/2\r\n * acos(-0) = pi/2\r\n * acos(1) = 0\r\n * acos(-1) = pi\r\n * acos(1/2) = pi/3\r\n * acos(-1/2) = 2*pi/3\r\n * acos(|x| > 1) = NaN\r\n * acos(NaN) = NaN\r\n *\r\n */\r\nP.inverseCosine = P.acos = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n k = x.abs().cmp(1),\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding;\r\n\r\n if (k !== -1) {\r\n return k === 0\r\n // |x| is 1\r\n ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0)\r\n // |x| > 1 or x is NaN\r\n : new Ctor(NaN);\r\n }\r\n\r\n if (x.isZero()) return getPi(Ctor, pr + 4, rm).times(0.5);\r\n\r\n // TODO? Special case acos(0.5) = pi/3 and acos(-0.5) = 2*pi/3\r\n\r\n Ctor.precision = pr + 6;\r\n Ctor.rounding = 1;\r\n\r\n // See https://github.com/MikeMcl/decimal.js/pull/217\r\n x = new Ctor(1).minus(x).div(x.plus(1)).sqrt().atan();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(2);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic cosine in radians of the\r\n * value of this Decimal.\r\n *\r\n * Domain: [1, Infinity]\r\n * Range: [0, Infinity]\r\n *\r\n * acosh(x) = ln(x + sqrt(x^2 - 1))\r\n *\r\n * acosh(x < 1) = NaN\r\n * acosh(NaN) = NaN\r\n * acosh(Infinity) = Infinity\r\n * acosh(-Infinity) = NaN\r\n * acosh(0) = NaN\r\n * acosh(-0) = NaN\r\n * acosh(1) = 0\r\n * acosh(-1) = NaN\r\n *\r\n */\r\nP.inverseHyperbolicCosine = P.acosh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (x.lte(1)) return new Ctor(x.eq(1) ? 0 : NaN);\r\n if (!x.isFinite()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n external = false;\r\n\r\n x = x.times(x).minus(1).sqrt().plus(x);\r\n\r\n external = true;\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.ln();\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic sine in radians of the value\r\n * of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * asinh(x) = ln(x + sqrt(x^2 + 1))\r\n *\r\n * asinh(NaN) = NaN\r\n * asinh(Infinity) = Infinity\r\n * asinh(-Infinity) = -Infinity\r\n * asinh(0) = 0\r\n * asinh(-0) = -0\r\n *\r\n */\r\nP.inverseHyperbolicSine = P.asinh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6;\r\n Ctor.rounding = 1;\r\n external = false;\r\n\r\n x = x.times(x).plus(1).sqrt().plus(x);\r\n\r\n external = true;\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.ln();\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic tangent in radians of the\r\n * value of this Decimal.\r\n *\r\n * Domain: [-1, 1]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * atanh(x) = 0.5 * ln((1 + x) / (1 - x))\r\n *\r\n * atanh(|x| > 1) = NaN\r\n * atanh(NaN) = NaN\r\n * atanh(Infinity) = NaN\r\n * atanh(-Infinity) = NaN\r\n * atanh(0) = 0\r\n * atanh(-0) = -0\r\n * atanh(1) = Infinity\r\n * atanh(-1) = -Infinity\r\n *\r\n */\r\nP.inverseHyperbolicTangent = P.atanh = function () {\r\n var pr, rm, wpr, xsd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.e >= 0) return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n xsd = x.sd();\r\n\r\n if (Math.max(xsd, pr) < 2 * -x.e - 1) return finalise(new Ctor(x), pr, rm, true);\r\n\r\n Ctor.precision = wpr = xsd - x.e;\r\n\r\n x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1);\r\n\r\n Ctor.precision = pr + 4;\r\n Ctor.rounding = 1;\r\n\r\n x = x.ln();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(0.5);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arcsine (inverse sine) in radians of the value of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi/2, pi/2]\r\n *\r\n * asin(x) = 2*atan(x/(1 + sqrt(1 - x^2)))\r\n *\r\n * asin(0) = 0\r\n * asin(-0) = -0\r\n * asin(1/2) = pi/6\r\n * asin(-1/2) = -pi/6\r\n * asin(1) = pi/2\r\n * asin(-1) = -pi/2\r\n * asin(|x| > 1) = NaN\r\n * asin(NaN) = NaN\r\n *\r\n * TODO? Compare performance of Taylor series.\r\n *\r\n */\r\nP.inverseSine = P.asin = function () {\r\n var halfPi, k,\r\n pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n k = x.abs().cmp(1);\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n if (k !== -1) {\r\n\r\n // |x| is 1\r\n if (k === 0) {\r\n halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\r\n halfPi.s = x.s;\r\n return halfPi;\r\n }\r\n\r\n // |x| > 1 or x is NaN\r\n return new Ctor(NaN);\r\n }\r\n\r\n // TODO? Special case asin(1/2) = pi/6 and asin(-1/2) = -pi/6\r\n\r\n Ctor.precision = pr + 6;\r\n Ctor.rounding = 1;\r\n\r\n x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(2);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent (inverse tangent) in radians of the value\r\n * of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi/2, pi/2]\r\n *\r\n * atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n *\r\n * atan(0) = 0\r\n * atan(-0) = -0\r\n * atan(1) = pi/4\r\n * atan(-1) = -pi/4\r\n * atan(Infinity) = pi/2\r\n * atan(-Infinity) = -pi/2\r\n * atan(NaN) = NaN\r\n *\r\n */\r\nP.inverseTangent = P.atan = function () {\r\n var i, j, k, n, px, t, r, wpr, x2,\r\n x = this,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding;\r\n\r\n if (!x.isFinite()) {\r\n if (!x.s) return new Ctor(NaN);\r\n if (pr + 4 <= PI_PRECISION) {\r\n r = getPi(Ctor, pr + 4, rm).times(0.5);\r\n r.s = x.s;\r\n return r;\r\n }\r\n } else if (x.isZero()) {\r\n return new Ctor(x);\r\n } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) {\r\n r = getPi(Ctor, pr + 4, rm).times(0.25);\r\n r.s = x.s;\r\n return r;\r\n }\r\n\r\n Ctor.precision = wpr = pr + 10;\r\n Ctor.rounding = 1;\r\n\r\n // TODO? if (x >= 1 && pr <= PI_PRECISION) atan(x) = halfPi * x.s - atan(1 / x);\r\n\r\n // Argument reduction\r\n // Ensure |x| < 0.42\r\n // atan(x) = 2 * atan(x / (1 + sqrt(1 + x^2)))\r\n\r\n k = Math.min(28, wpr / LOG_BASE + 2 | 0);\r\n\r\n for (i = k; i; --i) x = x.div(x.times(x).plus(1).sqrt().plus(1));\r\n\r\n external = false;\r\n\r\n j = Math.ceil(wpr / LOG_BASE);\r\n n = 1;\r\n x2 = x.times(x);\r\n r = new Ctor(x);\r\n px = x;\r\n\r\n // atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n for (; i !== -1;) {\r\n px = px.times(x2);\r\n t = r.minus(px.div(n += 2));\r\n\r\n px = px.times(x2);\r\n r = t.plus(px.div(n += 2));\r\n\r\n if (r.d[j] !== void 0) for (i = j; r.d[i] === t.d[i] && i--;);\r\n }\r\n\r\n if (k) r = r.times(2 << (k - 1));\r\n\r\n external = true;\r\n\r\n return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is a finite number, otherwise return false.\r\n *\r\n */\r\nP.isFinite = function () {\r\n return !!this.d;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is an integer, otherwise return false.\r\n *\r\n */\r\nP.isInteger = P.isInt = function () {\r\n return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is NaN, otherwise return false.\r\n *\r\n */\r\nP.isNaN = function () {\r\n return !this.s;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is negative, otherwise return false.\r\n *\r\n */\r\nP.isNegative = P.isNeg = function () {\r\n return this.s < 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is positive, otherwise return false.\r\n *\r\n */\r\nP.isPositive = P.isPos = function () {\r\n return this.s > 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is 0 or -0, otherwise return false.\r\n *\r\n */\r\nP.isZero = function () {\r\n return !!this.d && this.d[0] === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is less than `y`, otherwise return false.\r\n *\r\n */\r\nP.lessThan = P.lt = function (y) {\r\n return this.cmp(y) < 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.\r\n *\r\n */\r\nP.lessThanOrEqualTo = P.lte = function (y) {\r\n return this.cmp(y) < 1;\r\n};\r\n\r\n\r\n/*\r\n * Return the logarithm of the value of this Decimal to the specified base, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * If no base is specified, return log[10](arg).\r\n *\r\n * log[base](arg) = ln(arg) / ln(base)\r\n *\r\n * The result will always be correctly rounded if the base of the log is 10, and 'almost always'\r\n * otherwise:\r\n *\r\n * Depending on the rounding mode, the result may be incorrectly rounded if the first fifteen\r\n * rounding digits are [49]99999999999999 or [50]00000000000000. In that case, the maximum error\r\n * between the result and the correctly rounded result will be one ulp (unit in the last place).\r\n *\r\n * log[-b](a) = NaN\r\n * log[0](a) = NaN\r\n * log[1](a) = NaN\r\n * log[NaN](a) = NaN\r\n * log[Infinity](a) = NaN\r\n * log[b](0) = -Infinity\r\n * log[b](-0) = -Infinity\r\n * log[b](-a) = NaN\r\n * log[b](1) = 0\r\n * log[b](Infinity) = Infinity\r\n * log[b](NaN) = NaN\r\n *\r\n * [base] {number|string|bigint|Decimal} The base of the logarithm.\r\n *\r\n */\r\nP.logarithm = P.log = function (base) {\r\n var isBase10, d, denominator, k, inf, num, sd, r,\r\n arg = this,\r\n Ctor = arg.constructor,\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding,\r\n guard = 5;\r\n\r\n // Default base is 10.\r\n if (base == null) {\r\n base = new Ctor(10);\r\n isBase10 = true;\r\n } else {\r\n base = new Ctor(base);\r\n d = base.d;\r\n\r\n // Return NaN if base is negative, or non-finite, or is 0 or 1.\r\n if (base.s < 0 || !d || !d[0] || base.eq(1)) return new Ctor(NaN);\r\n\r\n isBase10 = base.eq(10);\r\n }\r\n\r\n d = arg.d;\r\n\r\n // Is arg negative, non-finite, 0 or 1?\r\n if (arg.s < 0 || !d || !d[0] || arg.eq(1)) {\r\n return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0);\r\n }\r\n\r\n // The result will have a non-terminating decimal expansion if base is 10 and arg is not an\r\n // integer power of 10.\r\n if (isBase10) {\r\n if (d.length > 1) {\r\n inf = true;\r\n } else {\r\n for (k = d[0]; k % 10 === 0;) k /= 10;\r\n inf = k !== 1;\r\n }\r\n }\r\n\r\n external = false;\r\n sd = pr + guard;\r\n num = naturalLogarithm(arg, sd);\r\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n\r\n // The result will have 5 rounding digits.\r\n r = divide(num, denominator, sd, 1);\r\n\r\n // If at a rounding boundary, i.e. the result's rounding digits are [49]9999 or [50]0000,\r\n // calculate 10 further digits.\r\n //\r\n // If the result is known to have an infinite decimal expansion, repeat this until it is clear\r\n // that the result is above or below the boundary. Otherwise, if after calculating the 10\r\n // further digits, the last 14 are nines, round up and assume the result is exact.\r\n // Also assume the result is exact if the last 14 are zero.\r\n //\r\n // Example of a result that will be incorrectly rounded:\r\n // log[1048576](4503599627370502) = 2.60000000000000009610279511444746...\r\n // The above result correctly rounded using ROUND_CEIL to 1 decimal place should be 2.7, but it\r\n // will be given as 2.6 as there are 15 zeros immediately after the requested decimal place, so\r\n // the exact result would be assumed to be 2.6, which rounded using ROUND_CEIL to 1 decimal\r\n // place is still 2.6.\r\n if (checkRoundingDigits(r.d, k = pr, rm)) {\r\n\r\n do {\r\n sd += 10;\r\n num = naturalLogarithm(arg, sd);\r\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n r = divide(num, denominator, sd, 1);\r\n\r\n if (!inf) {\r\n\r\n // Check for 14 nines from the 2nd rounding digit, as the first may be 4.\r\n if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) {\r\n r = finalise(r, pr + 1, 0);\r\n }\r\n\r\n break;\r\n }\r\n } while (checkRoundingDigits(r.d, k += 10, rm));\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, pr, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the maximum of the arguments and the value of this Decimal.\r\n *\r\n * arguments {number|string|bigint|Decimal}\r\n *\r\nP.max = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, -1);\r\n};\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the minimum of the arguments and the value of this Decimal.\r\n *\r\n * arguments {number|string|bigint|Decimal}\r\n *\r\nP.min = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, 1);\r\n};\r\n */\r\n\r\n\r\n/*\r\n * n - 0 = n\r\n * n - N = N\r\n * n - I = -I\r\n * 0 - n = -n\r\n * 0 - 0 = 0\r\n * 0 - N = N\r\n * 0 - I = -I\r\n * N - n = N\r\n * N - 0 = N\r\n * N - N = N\r\n * N - I = N\r\n * I - n = I\r\n * I - 0 = I\r\n * I - N = N\r\n * I - I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal minus `y`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.minus = P.sub = function (y) {\r\n var d, e, i, j, k, len, pr, rm, xd, xe, xLTy, yd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // If either is not finite...\r\n if (!x.d || !y.d) {\r\n\r\n // Return NaN if either is NaN.\r\n if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n // Return y negated if x is finite and y is ±Infinity.\r\n else if (x.d) y.s = -y.s;\r\n\r\n // Return x if y is finite and x is ±Infinity.\r\n // Return x if both are ±Infinity with different signs.\r\n // Return NaN if both are ±Infinity with the same sign.\r\n else y = new Ctor(y.d || x.s !== y.s ? x : NaN);\r\n\r\n return y;\r\n }\r\n\r\n // If signs differ...\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.plus(y);\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n // If either is zero...\r\n if (!xd[0] || !yd[0]) {\r\n\r\n // Return y negated if x is zero and y is non-zero.\r\n if (yd[0]) y.s = -y.s;\r\n\r\n // Return x if y is zero and x is non-zero.\r\n else if (xd[0]) y = new Ctor(x);\r\n\r\n // Return zero if both are zero.\r\n // From IEEE 754 (2008) 6.3: 0 - 0 = -0 - -0 = -0 when rounding to -Infinity.\r\n else return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n }\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n // Calculate base 1e7 exponents.\r\n e = mathfloor(y.e / LOG_BASE);\r\n xe = mathfloor(x.e / LOG_BASE);\r\n\r\n xd = xd.slice();\r\n k = xe - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (k) {\r\n xLTy = k < 0;\r\n\r\n if (xLTy) {\r\n d = xd;\r\n k = -k;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = xe;\r\n len = xd.length;\r\n }\r\n\r\n // Numbers with massively different exponents would result in a very high number of\r\n // zeros needing to be prepended, but this can be avoided while still ensuring correct\r\n // rounding by limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`.\r\n i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;\r\n\r\n if (k > i) {\r\n k = i;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents.\r\n d.reverse();\r\n for (i = k; i--;) d.push(0);\r\n d.reverse();\r\n\r\n // Base 1e7 exponents equal.\r\n } else {\r\n\r\n // Check digits to determine which is the bigger number.\r\n\r\n i = xd.length;\r\n len = yd.length;\r\n xLTy = i < len;\r\n if (xLTy) len = i;\r\n\r\n for (i = 0; i < len; i++) {\r\n if (xd[i] != yd[i]) {\r\n xLTy = xd[i] < yd[i];\r\n break;\r\n }\r\n }\r\n\r\n k = 0;\r\n }\r\n\r\n if (xLTy) {\r\n d = xd;\r\n xd = yd;\r\n yd = d;\r\n y.s = -y.s;\r\n }\r\n\r\n len = xd.length;\r\n\r\n // Append zeros to `xd` if shorter.\r\n // Don't add zeros to `yd` if shorter as subtraction only needs to start at `yd` length.\r\n for (i = yd.length - len; i > 0; --i) xd[len++] = 0;\r\n\r\n // Subtract yd from xd.\r\n for (i = yd.length; i > k;) {\r\n\r\n if (xd[--i] < yd[i]) {\r\n for (j = i; j && xd[--j] === 0;) xd[j] = BASE - 1;\r\n --xd[j];\r\n xd[i] += BASE;\r\n }\r\n\r\n xd[i] -= yd[i];\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] === 0;) xd.pop();\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xd[0] === 0; xd.shift()) --e;\r\n\r\n // Zero?\r\n if (!xd[0]) return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n y.d = xd;\r\n y.e = getBase10Exponent(xd, e);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n};\r\n\r\n\r\n/*\r\n * n % 0 = N\r\n * n % N = N\r\n * n % I = n\r\n * 0 % n = 0\r\n * -0 % n = -0\r\n * 0 % 0 = N\r\n * 0 % N = N\r\n * 0 % I = 0\r\n * N % n = N\r\n * N % 0 = N\r\n * N % N = N\r\n * N % I = N\r\n * I % n = N\r\n * I % 0 = N\r\n * I % N = N\r\n * I % I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal modulo `y`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * The result depends on the modulo mode.\r\n *\r\n */\r\nP.modulo = P.mod = function (y) {\r\n var q,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // Return NaN if x is ±Infinity or NaN, or y is NaN or ±0.\r\n if (!x.d || !y.s || y.d && !y.d[0]) return new Ctor(NaN);\r\n\r\n // Return x if y is ±Infinity or x is ±0.\r\n if (!y.d || x.d && !x.d[0]) {\r\n return finalise(new Ctor(x), Ctor.precision, Ctor.rounding);\r\n }\r\n\r\n // Prevent rounding of intermediate calculations.\r\n external = false;\r\n\r\n if (Ctor.modulo == 9) {\r\n\r\n // Euclidian division: q = sign(y) * floor(x / abs(y))\r\n // result = x - q * y where 0 <= result < abs(y)\r\n q = divide(x, y.abs(), 0, 3, 1);\r\n q.s *= y.s;\r\n } else {\r\n q = divide(x, y, 0, Ctor.modulo, 1);\r\n }\r\n\r\n q = q.times(y);\r\n\r\n external = true;\r\n\r\n return x.minus(q);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of the value of this Decimal,\r\n * i.e. the base e raised to the power the value of this Decimal, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.naturalExponential = P.exp = function () {\r\n return naturalExponential(this);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of the value of this Decimal,\r\n * rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.naturalLogarithm = P.ln = function () {\r\n return naturalLogarithm(this);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by\r\n * -1.\r\n *\r\n */\r\nP.negated = P.neg = function () {\r\n var x = new this.constructor(this);\r\n x.s = -x.s;\r\n return finalise(x);\r\n};\r\n\r\n\r\n/*\r\n * n + 0 = n\r\n * n + N = N\r\n * n + I = I\r\n * 0 + n = n\r\n * 0 + 0 = 0\r\n * 0 + N = N\r\n * 0 + I = I\r\n * N + n = N\r\n * N + 0 = N\r\n * N + N = N\r\n * N + I = N\r\n * I + n = I\r\n * I + 0 = I\r\n * I + N = N\r\n * I + I = I\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal plus `y`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.plus = P.add = function (y) {\r\n var carry, d, e, i, k, len, pr, rm, xd, yd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // If either is not finite...\r\n if (!x.d || !y.d) {\r\n\r\n // Return NaN if either is NaN.\r\n if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n // Return x if y is finite and x is ±Infinity.\r\n // Return x if both are ±Infinity with the same sign.\r\n // Return NaN if both are ±Infinity with different signs.\r\n // Return y if x is finite and y is ±Infinity.\r\n else if (!x.d) y = new Ctor(y.d || x.s === y.s ? x : NaN);\r\n\r\n return y;\r\n }\r\n\r\n // If signs differ...\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.minus(y);\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n // If either is zero...\r\n if (!xd[0] || !yd[0]) {\r\n\r\n // Return x if y is zero.\r\n // Return y if y is non-zero.\r\n if (!yd[0]) y = new Ctor(x);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n }\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n // Calculate base 1e7 exponents.\r\n k = mathfloor(x.e / LOG_BASE);\r\n e = mathfloor(y.e / LOG_BASE);\r\n\r\n xd = xd.slice();\r\n i = k - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (i) {\r\n\r\n if (i < 0) {\r\n d = xd;\r\n i = -i;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = k;\r\n len = xd.length;\r\n }\r\n\r\n // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1.\r\n k = Math.ceil(pr / LOG_BASE);\r\n len = k > len ? k + 1 : len + 1;\r\n\r\n if (i > len) {\r\n i = len;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts.\r\n d.reverse();\r\n for (; i--;) d.push(0);\r\n d.reverse();\r\n }\r\n\r\n len = xd.length;\r\n i = yd.length;\r\n\r\n // If yd is longer than xd, swap xd and yd so xd points to the longer array.\r\n if (len - i < 0) {\r\n i = len;\r\n d = yd;\r\n yd = xd;\r\n xd = d;\r\n }\r\n\r\n // Only start adding at yd.length - 1 as the further digits of xd can be left as they are.\r\n for (carry = 0; i;) {\r\n carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;\r\n xd[i] %= BASE;\r\n }\r\n\r\n if (carry) {\r\n xd.unshift(carry);\r\n ++e;\r\n }\r\n\r\n // Remove trailing zeros.\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n for (len = xd.length; xd[--len] == 0;) xd.pop();\r\n\r\n y.d = xd;\r\n y.e = getBase10Exponent(xd, e);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n};\r\n\r\n\r\n/*\r\n * Return the number of significant digits of the value of this Decimal.\r\n *\r\n * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.\r\n *\r\n */\r\nP.precision = P.sd = function (z) {\r\n var k,\r\n x = this;\r\n\r\n if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);\r\n\r\n if (x.d) {\r\n k = getPrecision(x.d);\r\n if (z && x.e + 1 > k) k = x.e + 1;\r\n } else {\r\n k = NaN;\r\n }\r\n\r\n return k;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using\r\n * rounding mode `rounding`.\r\n *\r\n */\r\nP.round = function () {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n return finalise(new Ctor(x), x.e + 1, Ctor.rounding);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sine of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * sin(x) = x - x^3/3! + x^5/5! - ...\r\n *\r\n * sin(0) = 0\r\n * sin(-0) = -0\r\n * sin(Infinity) = NaN\r\n * sin(-Infinity) = NaN\r\n * sin(NaN) = NaN\r\n *\r\n */\r\nP.sine = P.sin = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n Ctor.rounding = 1;\r\n\r\n x = sine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of this Decimal, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * sqrt(-n) = N\r\n * sqrt(N) = N\r\n * sqrt(-I) = N\r\n * sqrt(I) = I\r\n * sqrt(0) = 0\r\n * sqrt(-0) = -0\r\n *\r\n */\r\nP.squareRoot = P.sqrt = function () {\r\n var m, n, sd, r, rep, t,\r\n x = this,\r\n d = x.d,\r\n e = x.e,\r\n s = x.s,\r\n Ctor = x.constructor;\r\n\r\n // Negative/NaN/Infinity/zero?\r\n if (s !== 1 || !d || !d[0]) {\r\n return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0);\r\n }\r\n\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+x);\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = digitsToString(d);\r\n\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(n);\r\n e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n sd = (e = Ctor.precision) + 3;\r\n\r\n // Newton-Raphson iteration.\r\n for (;;) {\r\n t = r;\r\n r = t.plus(divide(x, t, sd + 2, 1)).times(0.5);\r\n\r\n // TODO? Replace with for-loop and checkRoundingDigits.\r\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n n = n.slice(sd - 3, sd + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or\r\n // 4999, i.e. approaching a rounding boundary, continue the iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n if (!rep) {\r\n finalise(t, e + 1, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n sd += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n // If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n finalise(r, e + 1, 1);\r\n m = !r.times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, e, Ctor.rounding, m);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the tangent of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * tan(0) = 0\r\n * tan(-0) = -0\r\n * tan(Infinity) = NaN\r\n * tan(-Infinity) = NaN\r\n * tan(NaN) = NaN\r\n *\r\n */\r\nP.tangent = P.tan = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 10;\r\n Ctor.rounding = 1;\r\n\r\n x = x.sin();\r\n x.s = 1;\r\n x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0);\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * n * 0 = 0\r\n * n * N = N\r\n * n * I = I\r\n * 0 * n = 0\r\n * 0 * 0 = 0\r\n * 0 * N = N\r\n * 0 * I = N\r\n * N * n = N\r\n * N * 0 = N\r\n * N * N = N\r\n * N * I = N\r\n * I * n = I\r\n * I * 0 = N\r\n * I * N = N\r\n * I * I = I\r\n *\r\n * Return a new Decimal whose value is this Decimal times `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.times = P.mul = function (y) {\r\n var carry, e, i, k, r, rL, t, xdL, ydL,\r\n x = this,\r\n Ctor = x.constructor,\r\n xd = x.d,\r\n yd = (y = new Ctor(y)).d;\r\n\r\n y.s *= x.s;\r\n\r\n // If either is NaN, ±Infinity or ±0...\r\n if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd\r\n\r\n // Return NaN if either is NaN.\r\n // Return NaN if x is ±0 and y is ±Infinity, or y is ±0 and x is ±Infinity.\r\n ? NaN\r\n\r\n // Return ±Infinity if either is ±Infinity.\r\n // Return ±0 if either is ±0.\r\n : !xd || !yd ? y.s / 0 : y.s * 0);\r\n }\r\n\r\n e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE);\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Ensure xd points to the longer array.\r\n if (xdL < ydL) {\r\n r = xd;\r\n xd = yd;\r\n yd = r;\r\n rL = xdL;\r\n xdL = ydL;\r\n ydL = rL;\r\n }\r\n\r\n // Initialise the result array with zeros.\r\n r = [];\r\n rL = xdL + ydL;\r\n for (i = rL; i--;) r.push(0);\r\n\r\n // Multiply!\r\n for (i = ydL; --i >= 0;) {\r\n carry = 0;\r\n for (k = xdL + i; k > i;) {\r\n t = r[k] + yd[i] * xd[k - i - 1] + carry;\r\n r[k--] = t % BASE | 0;\r\n carry = t / BASE | 0;\r\n }\r\n\r\n r[k] = (r[k] + carry) % BASE | 0;\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; !r[--rL];) r.pop();\r\n\r\n if (carry) ++e;\r\n else r.shift();\r\n\r\n y.d = r;\r\n y.e = getBase10Exponent(r, e);\r\n\r\n return external ? finalise(y, Ctor.precision, Ctor.rounding) : y;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 2, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toBinary = function (sd, rm) {\r\n return toStringBinary(this, 2, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp`\r\n * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted.\r\n *\r\n * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toDecimalPlaces = P.toDP = function (dp, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n if (dp === void 0) return x;\r\n\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n return finalise(x, dp + x.e + 1, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in exponential notation rounded to\r\n * `dp` fixed decimal places using rounding mode `rounding`.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toExponential = function (dp, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = finiteToString(x, true);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = finalise(new Ctor(x), dp + 1, rm);\r\n str = finiteToString(x, true, dp + 1);\r\n }\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in normal (fixed-point) notation to\r\n * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is\r\n * omitted.\r\n *\r\n * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\r\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\r\n * (-0).toFixed(3) is '0.000'.\r\n * (-0.5).toFixed(0) is '-0'.\r\n *\r\n */\r\nP.toFixed = function (dp, rm) {\r\n var str, y,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = finiteToString(x);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n y = finalise(new Ctor(x), dp + x.e + 1, rm);\r\n str = finiteToString(y, false, dp + y.e + 1);\r\n }\r\n\r\n // To determine whether to add the minus sign look at the value before it was rounded,\r\n // i.e. look at `x` rather than `y`.\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return an array representing the value of this Decimal as a simple fraction with an integer\r\n * numerator and an integer denominator.\r\n *\r\n * The denominator will be a positive non-zero value less than or equal to the specified maximum\r\n * denominator. If a maximum denominator is not specified, the denominator will be the lowest\r\n * value necessary to represent the number exactly.\r\n *\r\n * [maxD] {number|string|bigint|Decimal} Maximum denominator. Integer >= 1 and < Infinity.\r\n *\r\n */\r\nP.toFraction = function (maxD) {\r\n var d, d0, d1, d2, e, k, n, n0, n1, pr, q, r,\r\n x = this,\r\n xd = x.d,\r\n Ctor = x.constructor;\r\n\r\n if (!xd) return new Ctor(x);\r\n\r\n n1 = d0 = new Ctor(1);\r\n d1 = n0 = new Ctor(0);\r\n\r\n d = new Ctor(d1);\r\n e = d.e = getPrecision(xd) - x.e - 1;\r\n k = e % LOG_BASE;\r\n d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k);\r\n\r\n if (maxD == null) {\r\n\r\n // d is 10**e, the minimum max-denominator needed.\r\n maxD = e > 0 ? d : n1;\r\n } else {\r\n n = new Ctor(maxD);\r\n if (!n.isInt() || n.lt(n1)) throw Error(invalidArgument + n);\r\n maxD = n.gt(d) ? (e > 0 ? d : n1) : n;\r\n }\r\n\r\n external = false;\r\n n = new Ctor(digitsToString(xd));\r\n pr = Ctor.precision;\r\n Ctor.precision = e = xd.length * LOG_BASE * 2;\r\n\r\n for (;;) {\r\n q = divide(n, d, 0, 1, 1);\r\n d2 = d0.plus(q.times(d1));\r\n if (d2.cmp(maxD) == 1) break;\r\n d0 = d1;\r\n d1 = d2;\r\n d2 = n1;\r\n n1 = n0.plus(q.times(d2));\r\n n0 = d2;\r\n d2 = d;\r\n d = n.minus(q.times(d2));\r\n n = d2;\r\n }\r\n\r\n d2 = divide(maxD.minus(d0), d1, 0, 1, 1);\r\n n0 = n0.plus(d2.times(n1));\r\n d0 = d0.plus(d2.times(d1));\r\n n0.s = n1.s = x.s;\r\n\r\n // Determine which fraction is closer to x, n0/d0 or n1/d1?\r\n r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1\r\n ? [n1, d1] : [n0, d0];\r\n\r\n Ctor.precision = pr;\r\n external = true;\r\n\r\n return r;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 16, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toHexadecimal = P.toHex = function (sd, rm) {\r\n return toStringBinary(this, 16, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Returns a new Decimal whose value is the nearest multiple of `y` in the direction of rounding\r\n * mode `rm`, or `Decimal.rounding` if `rm` is omitted, to the value of this Decimal.\r\n *\r\n * The return value will always have the same sign as this Decimal, unless either this Decimal\r\n * or `y` is NaN, in which case the return value will be also be NaN.\r\n *\r\n * The return value is not affected by the value of `precision`.\r\n *\r\n * y {number|string|bigint|Decimal} The magnitude to round to a multiple of.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * 'toNearest() rounding mode not an integer: {rm}'\r\n * 'toNearest() rounding mode out of range: {rm}'\r\n *\r\n */\r\nP.toNearest = function (y, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n\r\n if (y == null) {\r\n\r\n // If x is not finite, return x.\r\n if (!x.d) return x;\r\n\r\n y = new Ctor(1);\r\n rm = Ctor.rounding;\r\n } else {\r\n y = new Ctor(y);\r\n if (rm === void 0) {\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(rm, 0, 8);\r\n }\r\n\r\n // If x is not finite, return x if y is not NaN, else NaN.\r\n if (!x.d) return y.s ? x : y;\r\n\r\n // If y is not finite, return Infinity with the sign of x if y is Infinity, else NaN.\r\n if (!y.d) {\r\n if (y.s) y.s = x.s;\r\n return y;\r\n }\r\n }\r\n\r\n // If y is not zero, calculate the nearest multiple of y to x.\r\n if (y.d[0]) {\r\n external = false;\r\n x = divide(x, y, 0, rm, 1).times(y);\r\n external = true;\r\n finalise(x);\r\n\r\n // If y is zero, return zero with the sign of x.\r\n } else {\r\n y.s = x.s;\r\n x = y;\r\n }\r\n\r\n return x;\r\n};\r\n\r\n\r\n/*\r\n * Return the value of this Decimal converted to a number primitive.\r\n * Zero keeps its sign.\r\n *\r\n */\r\nP.toNumber = function () {\r\n return +this;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 8, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toOctal = function (sd, rm) {\r\n return toStringBinary(this, 8, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal raised to the power `y`, rounded\r\n * to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * ECMAScript compliant.\r\n *\r\n * pow(x, NaN) = NaN\r\n * pow(x, ±0) = 1\r\n\r\n * pow(NaN, non-zero) = NaN\r\n * pow(abs(x) > 1, +Infinity) = +Infinity\r\n * pow(abs(x) > 1, -Infinity) = +0\r\n * pow(abs(x) == 1, ±Infinity) = NaN\r\n * pow(abs(x) < 1, +Infinity) = +0\r\n * pow(abs(x) < 1, -Infinity) = +Infinity\r\n * pow(+Infinity, y > 0) = +Infinity\r\n * pow(+Infinity, y < 0) = +0\r\n * pow(-Infinity, odd integer > 0) = -Infinity\r\n * pow(-Infinity, even integer > 0) = +Infinity\r\n * pow(-Infinity, odd integer < 0) = -0\r\n * pow(-Infinity, even integer < 0) = +0\r\n * pow(+0, y > 0) = +0\r\n * pow(+0, y < 0) = +Infinity\r\n * pow(-0, odd integer > 0) = -0\r\n * pow(-0, even integer > 0) = +0\r\n * pow(-0, odd integer < 0) = -Infinity\r\n * pow(-0, even integer < 0) = +Infinity\r\n * pow(finite x < 0, finite non-integer) = NaN\r\n *\r\n * For non-integer or very large exponents pow(x, y) is calculated using\r\n *\r\n * x^y = exp(y*ln(x))\r\n *\r\n * Assuming the first 15 rounding digits are each equally likely to be any digit 0-9, the\r\n * probability of an incorrectly rounded result\r\n * P([49]9{14} | [50]0{14}) = 2 * 0.2 * 10^-14 = 4e-15 = 1/2.5e+14\r\n * i.e. 1 in 250,000,000,000,000\r\n *\r\n * If a result is incorrectly rounded the maximum error will be 1 ulp (unit in last place).\r\n *\r\n * y {number|string|bigint|Decimal} The power to which to raise this Decimal.\r\n *\r\n */\r\nP.toPower = P.pow = function (y) {\r\n var e, k, pr, r, rm, s,\r\n x = this,\r\n Ctor = x.constructor,\r\n yn = +(y = new Ctor(y));\r\n\r\n // Either ±Infinity, NaN or ±0?\r\n if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn));\r\n\r\n x = new Ctor(x);\r\n\r\n if (x.eq(1)) return x;\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n if (y.eq(1)) return finalise(x, pr, rm);\r\n\r\n // y exponent\r\n e = mathfloor(y.e / LOG_BASE);\r\n\r\n // If y is a small integer use the 'exponentiation by squaring' algorithm.\r\n if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {\r\n r = intPow(Ctor, x, k, pr);\r\n return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm);\r\n }\r\n\r\n s = x.s;\r\n\r\n // if x is negative\r\n if (s < 0) {\r\n\r\n // if y is not an integer\r\n if (e < y.d.length - 1) return new Ctor(NaN);\r\n\r\n // Result is positive if x is negative and the last digit of integer y is even.\r\n if ((y.d[e] & 1) == 0) s = 1;\r\n\r\n // if x.eq(-1)\r\n if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) {\r\n x.s = s;\r\n return x;\r\n }\r\n }\r\n\r\n // Estimate result exponent.\r\n // x^y = 10^e, where e = y * log10(x)\r\n // log10(x) = log10(x_significand) + x_exponent\r\n // log10(x_significand) = ln(x_significand) / ln(10)\r\n k = mathpow(+x, yn);\r\n e = k == 0 || !isFinite(k)\r\n ? mathfloor(yn * (Math.log('0.' + digitsToString(x.d)) / Math.LN10 + x.e + 1))\r\n : new Ctor(k + '').e;\r\n\r\n // Exponent estimate may be incorrect e.g. x: 0.999999999999999999, y: 2.29, e: 0, r.e: -1.\r\n\r\n // Overflow/underflow?\r\n if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) return new Ctor(e > 0 ? s / 0 : 0);\r\n\r\n external = false;\r\n Ctor.rounding = x.s = 1;\r\n\r\n // Estimate the extra guard digits needed to ensure five correct rounding digits from\r\n // naturalLogarithm(x). Example of failure without these extra digits (precision: 10):\r\n // new Decimal(2.32456).pow('2087987436534566.46411')\r\n // should be 1.162377823e+764914905173815, but is 1.162355823e+764914905173815\r\n k = Math.min(12, (e + '').length);\r\n\r\n // r = x^y = exp(y*ln(x))\r\n r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr);\r\n\r\n // r may be Infinity, e.g. (0.9999999999999999).pow(-1e+40)\r\n if (r.d) {\r\n\r\n // Truncate to the required precision plus five rounding digits.\r\n r = finalise(r, pr + 5, 1);\r\n\r\n // If the rounding digits are [49]9999 or [50]0000 increase the precision by 10 and recalculate\r\n // the result.\r\n if (checkRoundingDigits(r.d, pr, rm)) {\r\n e = pr + 10;\r\n\r\n // Truncate to the increased precision plus five rounding digits.\r\n r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1);\r\n\r\n // Check for 14 nines from the 2nd rounding digit (the first rounding digit may be 4 or 9).\r\n if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) {\r\n r = finalise(r, pr + 1, 0);\r\n }\r\n }\r\n }\r\n\r\n r.s = s;\r\n external = true;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(r, pr, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal rounded to `sd` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * Return exponential notation if `sd` is less than the number of digits necessary to represent\r\n * the integer part of the value in normal notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toPrecision = function (sd, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = finalise(new Ctor(x), sd, rm);\r\n str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd);\r\n }\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd`\r\n * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if\r\n * omitted.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * 'toSD() digits out of range: {sd}'\r\n * 'toSD() digits not an integer: {sd}'\r\n * 'toSD() rounding mode not an integer: {rm}'\r\n * 'toSD() rounding mode out of range: {rm}'\r\n *\r\n */\r\nP.toSignificantDigits = P.toSD = function (sd, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n }\r\n\r\n return finalise(new Ctor(x), sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal.\r\n *\r\n * Return exponential notation if this Decimal has a positive exponent equal to or greater than\r\n * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.\r\n *\r\n */\r\nP.toString = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal truncated to a whole number.\r\n *\r\n */\r\nP.truncated = P.trunc = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 1);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal.\r\n * Unlike `toString`, negative zero will include the minus sign.\r\n *\r\n */\r\nP.valueOf = P.toJSON = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n return x.isNeg() ? '-' + str : str;\r\n};\r\n\r\n\r\n// Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.\r\n\r\n\r\n/*\r\n * digitsToString P.cubeRoot, P.logarithm, P.squareRoot, P.toFraction, P.toPower,\r\n * finiteToString, naturalExponential, naturalLogarithm\r\n * checkInt32 P.toDecimalPlaces, P.toExponential, P.toFixed, P.toNearest,\r\n * P.toPrecision, P.toSignificantDigits, toStringBinary, random\r\n * checkRoundingDigits P.logarithm, P.toPower, naturalExponential, naturalLogarithm\r\n * convertBase toStringBinary, parseOther\r\n * cos P.cos\r\n * divide P.atanh, P.cubeRoot, P.dividedBy, P.dividedToIntegerBy,\r\n * P.logarithm, P.modulo, P.squareRoot, P.tan, P.tanh, P.toFraction,\r\n * P.toNearest, toStringBinary, naturalExponential, naturalLogarithm,\r\n * taylorSeries, atan2, parseOther\r\n * finalise P.absoluteValue, P.atan, P.atanh, P.ceil, P.cos, P.cosh,\r\n * P.cubeRoot, P.dividedToIntegerBy, P.floor, P.logarithm, P.minus,\r\n * P.modulo, P.negated, P.plus, P.round, P.sin, P.sinh, P.squareRoot,\r\n * P.tan, P.times, P.toDecimalPlaces, P.toExponential, P.toFixed,\r\n * P.toNearest, P.toPower, P.toPrecision, P.toSignificantDigits,\r\n * P.truncated, divide, getLn10, getPi, naturalExponential,\r\n * naturalLogarithm, ceil, floor, round, trunc\r\n * finiteToString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf,\r\n * toStringBinary\r\n * getBase10Exponent P.minus, P.plus, P.times, parseOther\r\n * getLn10 P.logarithm, naturalLogarithm\r\n * getPi P.acos, P.asin, P.atan, toLessThanHalfPi, atan2\r\n * getPrecision P.precision, P.toFraction\r\n * getZeroString digitsToString, finiteToString\r\n * intPow P.toPower, parseOther\r\n * isOdd toLessThanHalfPi\r\n * maxOrMin max, min\r\n * naturalExponential P.naturalExponential, P.toPower\r\n * naturalLogarithm P.acosh, P.asinh, P.atanh, P.logarithm, P.naturalLogarithm,\r\n * P.toPower, naturalExponential\r\n * nonFiniteToString finiteToString, toStringBinary\r\n * parseDecimal Decimal\r\n * parseOther Decimal\r\n * sin P.sin\r\n * taylorSeries P.cosh, P.sinh, cos, sin\r\n * toLessThanHalfPi P.cos, P.sin\r\n * toStringBinary P.toBinary, P.toHexadecimal, P.toOctal\r\n * truncate intPow\r\n *\r\n * Throws: P.logarithm, P.precision, P.toFraction, checkInt32, getLn10, getPi,\r\n * naturalLogarithm, config, parseOther, random, Decimal\r\n */\r\n\r\n\r\nfunction digitsToString(d) {\r\n var i, k, ws,\r\n indexOfLastWord = d.length - 1,\r\n str = '',\r\n w = d[0];\r\n\r\n if (indexOfLastWord > 0) {\r\n str += w;\r\n for (i = 1; i < indexOfLastWord; i++) {\r\n ws = d[i] + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n str += ws;\r\n }\r\n\r\n w = d[i];\r\n ws = w + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n } else if (w === 0) {\r\n return '0';\r\n }\r\n\r\n // Remove trailing zeros of last w.\r\n for (; w % 10 === 0;) w /= 10;\r\n\r\n return str + w;\r\n}\r\n\r\n\r\nfunction checkInt32(i, min, max) {\r\n if (i !== ~~i || i < min || i > max) {\r\n throw Error(invalidArgument + i);\r\n }\r\n}\r\n\r\n\r\n/*\r\n * Check 5 rounding digits if `repeating` is null, 4 otherwise.\r\n * `repeating == null` if caller is `log` or `pow`,\r\n * `repeating != null` if caller is `naturalLogarithm` or `naturalExponential`.\r\n */\r\nfunction checkRoundingDigits(d, i, rm, repeating) {\r\n var di, k, r, rd;\r\n\r\n // Get the length of the first word of the array d.\r\n for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n // Is the rounding digit in the first word of d?\r\n if (--i < 0) {\r\n i += LOG_BASE;\r\n di = 0;\r\n } else {\r\n di = Math.ceil((i + 1) / LOG_BASE);\r\n i %= LOG_BASE;\r\n }\r\n\r\n // i is the index (0 - 6) of the rounding digit.\r\n // E.g. if within the word 3487563 the first rounding digit is 5,\r\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\r\n k = mathpow(10, LOG_BASE - i);\r\n rd = d[di] % k | 0;\r\n\r\n if (repeating == null) {\r\n if (i < 3) {\r\n if (i == 0) rd = rd / 100 | 0;\r\n else if (i == 1) rd = rd / 10 | 0;\r\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\r\n } else {\r\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\r\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\r\n }\r\n } else {\r\n if (i < 4) {\r\n if (i == 0) rd = rd / 1000 | 0;\r\n else if (i == 1) rd = rd / 100 | 0;\r\n else if (i == 2) rd = rd / 10 | 0;\r\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\r\n } else {\r\n r = ((repeating || rm < 4) && rd + 1 == k ||\r\n (!repeating && rm > 3) && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\r\n }\r\n }\r\n\r\n return r;\r\n}\r\n\r\n\r\n// Convert string of `baseIn` to an array of numbers of `baseOut`.\r\n// Eg. convertBase('255', 10, 16) returns [15, 15].\r\n// Eg. convertBase('ff', 16, 10) returns [2, 5, 5].\r\nfunction convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n}\r\n\r\n\r\n/*\r\n * cos(x) = 1 - x^2/2! + x^4/4! - ...\r\n * |x| < pi/2\r\n *\r\n */\r\nfunction cosine(Ctor, x) {\r\n var k, len, y;\r\n\r\n if (x.isZero()) return x;\r\n\r\n // Argument reduction: cos(4x) = 8*(cos^4(x) - cos^2(x)) + 1\r\n // i.e. cos(x) = 8*(cos^4(x/4) - cos^2(x/4)) + 1\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n len = x.d.length;\r\n if (len < 32) {\r\n k = Math.ceil(len / 3);\r\n y = (1 / tinyPow(4, k)).toString();\r\n } else {\r\n k = 16;\r\n y = '2.3283064365386962890625e-10';\r\n }\r\n\r\n Ctor.precision += k;\r\n\r\n x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1));\r\n\r\n // Reverse argument reduction\r\n for (var i = k; i--;) {\r\n var cos2x = x.times(x);\r\n x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1);\r\n }\r\n\r\n Ctor.precision -= k;\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Perform division in the specified base.\r\n */\r\nvar divide = (function () {\r\n\r\n // Assumes non-zero x and k, and hence non-zero result.\r\n function multiplyInteger(x, k, base) {\r\n var temp,\r\n carry = 0,\r\n i = x.length;\r\n\r\n for (x = x.slice(); i--;) {\r\n temp = x[i] * k + carry;\r\n x[i] = temp % base | 0;\r\n carry = temp / base | 0;\r\n }\r\n\r\n if (carry) x.unshift(carry);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, r;\r\n\r\n if (aL != bL) {\r\n r = aL > bL ? 1 : -1;\r\n } else {\r\n for (i = r = 0; i < aL; i++) {\r\n if (a[i] != b[i]) {\r\n r = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return r;\r\n }\r\n\r\n function subtract(a, b, aL, base) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * base + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1;) a.shift();\r\n }\r\n\r\n return function (x, y, pr, rm, dp, base) {\r\n var cmp, e, i, k, logBase, more, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0,\r\n yL, yz,\r\n Ctor = x.constructor,\r\n sign = x.s == y.s ? 1 : -1,\r\n xd = x.d,\r\n yd = y.d;\r\n\r\n // Either NaN, Infinity or 0?\r\n if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n return new Ctor(// Return NaN if either NaN, or both Infinity or 0.\r\n !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN :\r\n\r\n // Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.\r\n xd && xd[0] == 0 || !yd ? sign * 0 : sign / 0);\r\n }\r\n\r\n if (base) {\r\n logBase = 1;\r\n e = x.e - y.e;\r\n } else {\r\n base = BASE;\r\n logBase = LOG_BASE;\r\n e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase);\r\n }\r\n\r\n yL = yd.length;\r\n xL = xd.length;\r\n q = new Ctor(sign);\r\n qd = q.d = [];\r\n\r\n // Result exponent may be one less than e.\r\n // The digit array of a Decimal from toStringBinary may have trailing zeros.\r\n for (i = 0; yd[i] == (xd[i] || 0); i++);\r\n\r\n if (yd[i] > (xd[i] || 0)) e--;\r\n\r\n if (pr == null) {\r\n sd = pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else if (dp) {\r\n sd = pr + (x.e - y.e) + 1;\r\n } else {\r\n sd = pr;\r\n }\r\n\r\n if (sd < 0) {\r\n qd.push(1);\r\n more = true;\r\n } else {\r\n\r\n // Convert precision in number of base 10 digits to base 1e7 digits.\r\n sd = sd / logBase + 2 | 0;\r\n i = 0;\r\n\r\n // divisor < 1e7\r\n if (yL == 1) {\r\n k = 0;\r\n yd = yd[0];\r\n sd++;\r\n\r\n // k is the carry.\r\n for (; (i < xL || k) && sd--; i++) {\r\n t = k * base + (xd[i] || 0);\r\n qd[i] = t / yd | 0;\r\n k = t % yd | 0;\r\n }\r\n\r\n more = k || i < xL;\r\n\r\n // divisor >= 1e7\r\n } else {\r\n\r\n // Normalise xd and yd so highest order digit of yd is >= base/2\r\n k = base / (yd[0] + 1) | 0;\r\n\r\n if (k > 1) {\r\n yd = multiplyInteger(yd, k, base);\r\n xd = multiplyInteger(xd, k, base);\r\n yL = yd.length;\r\n xL = xd.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xd.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL;) rem[remL++] = 0;\r\n\r\n yz = yd.slice();\r\n yz.unshift(0);\r\n yd0 = yd[0];\r\n\r\n if (yd[1] >= base / 2) ++yd0;\r\n\r\n do {\r\n k = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, k.\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);\r\n\r\n // k will be how many times the divisor goes into the current remainder.\r\n k = rem0 / yd0 | 0;\r\n\r\n // Algorithm:\r\n // 1. product = divisor * trial digit (k)\r\n // 2. if product > remainder: product -= divisor, k--\r\n // 3. remainder -= product\r\n // 4. if product was < remainder at 2:\r\n // 5. compare new remainder and divisor\r\n // 6. If remainder > divisor: remainder -= divisor, k++\r\n\r\n if (k > 1) {\r\n if (k >= base) k = base - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiplyInteger(yd, k, base);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n cmp = compare(prod, rem, prodL, remL);\r\n\r\n // product > remainder.\r\n if (cmp == 1) {\r\n k--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yd, prodL, base);\r\n }\r\n } else {\r\n\r\n // cmp is -1.\r\n // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1\r\n // to avoid it. If k is 1 there is a need to compare yd and rem again below.\r\n if (k == 0) cmp = k = 1;\r\n prod = yd.slice();\r\n }\r\n\r\n prodL = prod.length;\r\n if (prodL < remL) prod.unshift(0);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL, base);\r\n\r\n // If product was < previous remainder.\r\n if (cmp == -1) {\r\n remL = rem.length;\r\n\r\n // Compare divisor and new remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n if (cmp < 1) {\r\n k++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yd, remL, base);\r\n }\r\n }\r\n\r\n remL = rem.length;\r\n } else if (cmp === 0) {\r\n k++;\r\n rem = [0];\r\n } // if cmp === 1, k will be 0\r\n\r\n // Add the next digit, k, to the result array.\r\n qd[i++] = k;\r\n\r\n // Update the remainder.\r\n if (cmp && rem[0]) {\r\n rem[remL++] = xd[xi] || 0;\r\n } else {\r\n rem = [xd[xi]];\r\n remL = 1;\r\n }\r\n\r\n } while ((xi++ < xL || rem[0] !== void 0) && sd--);\r\n\r\n more = rem[0] !== void 0;\r\n }\r\n\r\n // Leading zero?\r\n if (!qd[0]) qd.shift();\r\n }\r\n\r\n // logBase is 1 when divide is being used for base conversion.\r\n if (logBase == 1) {\r\n q.e = e;\r\n inexact = more;\r\n } else {\r\n\r\n // To calculate q.e, first get the number of digits of qd[0].\r\n for (i = 1, k = qd[0]; k >= 10; k /= 10) i++;\r\n q.e = i + e * logBase - 1;\r\n\r\n finalise(q, dp ? pr + q.e + 1 : pr, rm, more);\r\n }\r\n\r\n return q;\r\n };\r\n})();\r\n\r\n\r\n/*\r\n * Round `x` to `sd` significant digits using rounding mode `rm`.\r\n * Check for over/under-flow.\r\n */\r\n function finalise(x, sd, rm, isTruncated) {\r\n var digits, i, j, k, rd, roundUp, w, xd, xdi,\r\n Ctor = x.constructor;\r\n\r\n // Don't round if sd is null or undefined.\r\n out: if (sd != null) {\r\n xd = x.d;\r\n\r\n // Infinity/NaN.\r\n if (!xd) return x;\r\n\r\n // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // w: the word of xd containing rd, a base 1e7 number.\r\n // xdi: the index of w within xd.\r\n // digits: the number of digits of w.\r\n // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if\r\n // they had leading zeros)\r\n // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).\r\n\r\n // Get the length of the first word of the digits array xd.\r\n for (digits = 1, k = xd[0]; k >= 10; k /= 10) digits++;\r\n i = sd - digits;\r\n\r\n // Is the rounding digit in the first word of xd?\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n w = xd[xdi = 0];\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = w / mathpow(10, digits - j - 1) % 10 | 0;\r\n } else {\r\n xdi = Math.ceil((i + 1) / LOG_BASE);\r\n k = xd.length;\r\n if (xdi >= k) {\r\n if (isTruncated) {\r\n\r\n // Needed by `naturalExponential`, `naturalLogarithm` and `squareRoot`.\r\n for (; k++ <= xdi;) xd.push(0);\r\n w = rd = 0;\r\n digits = 1;\r\n i %= LOG_BASE;\r\n j = i - LOG_BASE + 1;\r\n } else {\r\n break out;\r\n }\r\n } else {\r\n w = k = xd[xdi];\r\n\r\n // Get the number of digits of w.\r\n for (digits = 1; k >= 10; k /= 10) digits++;\r\n\r\n // Get the index of rd within w.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within w, adjusted for leading zeros.\r\n // The number of leading zeros of w is given by LOG_BASE - digits.\r\n j = i - LOG_BASE + digits;\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0;\r\n }\r\n }\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n isTruncated = isTruncated || sd < 0 ||\r\n xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1));\r\n\r\n // The expression `w % mathpow(10, digits - j - 1)` returns all the digits of w to the right\r\n // of the digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression\r\n // will give 714.\r\n\r\n roundUp = rm < 4\r\n ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n if (sd < 1 || !xd[0]) {\r\n xd.length = 0;\r\n if (roundUp) {\r\n\r\n // Convert sd to decimal places.\r\n sd -= x.e + 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);\r\n x.e = -sd || 0;\r\n } else {\r\n\r\n // Zero.\r\n xd[0] = x.e = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xd.length = xdi;\r\n k = 1;\r\n xdi--;\r\n } else {\r\n xd.length = xdi + 1;\r\n k = mathpow(10, LOG_BASE - i);\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of w.\r\n xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0;\r\n }\r\n\r\n if (roundUp) {\r\n for (;;) {\r\n\r\n // Is the digit to be rounded up in the first word of xd?\r\n if (xdi == 0) {\r\n\r\n // i will be the length of xd[0] before k is added.\r\n for (i = 1, j = xd[0]; j >= 10; j /= 10) i++;\r\n j = xd[0] += k;\r\n for (k = 1; j >= 10; j /= 10) k++;\r\n\r\n // if i != k the length has increased.\r\n if (i != k) {\r\n x.e++;\r\n if (xd[0] == BASE) xd[0] = 1;\r\n }\r\n\r\n break;\r\n } else {\r\n xd[xdi] += k;\r\n if (xd[xdi] != BASE) break;\r\n xd[xdi--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xd.length; xd[--i] === 0;) xd.pop();\r\n }\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > Ctor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < Ctor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // Ctor.underflow = true;\r\n } // else Ctor.underflow = false;\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\nfunction finiteToString(x, isExp, sd) {\r\n if (!x.isFinite()) return nonFiniteToString(x);\r\n var k,\r\n e = x.e,\r\n str = digitsToString(x.d),\r\n len = str.length;\r\n\r\n if (isExp) {\r\n if (sd && (k = sd - len) > 0) {\r\n str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k);\r\n } else if (len > 1) {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n\r\n str = str + (x.e < 0 ? 'e' : 'e+') + x.e;\r\n } else if (e < 0) {\r\n str = '0.' + getZeroString(-e - 1) + str;\r\n if (sd && (k = sd - len) > 0) str += getZeroString(k);\r\n } else if (e >= len) {\r\n str += getZeroString(e + 1 - len);\r\n if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k);\r\n } else {\r\n if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k);\r\n if (sd && (k = sd - len) > 0) {\r\n if (e + 1 === len) str += '.';\r\n str += getZeroString(k);\r\n }\r\n }\r\n\r\n return str;\r\n}\r\n\r\n\r\n// Calculate the base 10 exponent from the base 1e7 exponent.\r\nfunction getBase10Exponent(digits, e) {\r\n var w = digits[0];\r\n\r\n // Add the number of digits of the first word of the digits array.\r\n for ( e *= LOG_BASE; w >= 10; w /= 10) e++;\r\n return e;\r\n}\r\n\r\n\r\nfunction getLn10(Ctor, sd, pr) {\r\n if (sd > LN10_PRECISION) {\r\n\r\n // Reset global state in case the exception is caught.\r\n external = true;\r\n if (pr) Ctor.precision = pr;\r\n throw Error(precisionLimitExceeded);\r\n }\r\n return finalise(new Ctor(LN10), sd, 1, true);\r\n}\r\n\r\n\r\nfunction getPi(Ctor, sd, rm) {\r\n if (sd > PI_PRECISION) throw Error(precisionLimitExceeded);\r\n return finalise(new Ctor(PI), sd, rm, true);\r\n}\r\n\r\n\r\nfunction getPrecision(digits) {\r\n var w = digits.length - 1,\r\n len = w * LOG_BASE + 1;\r\n\r\n w = digits[w];\r\n\r\n // If non-zero...\r\n if (w) {\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n for (; w % 10 == 0; w /= 10) len--;\r\n\r\n // Add the number of digits of the first word.\r\n for (w = digits[0]; w >= 10; w /= 10) len++;\r\n }\r\n\r\n return len;\r\n}\r\n\r\n\r\nfunction getZeroString(k) {\r\n var zs = '';\r\n for (; k--;) zs += '0';\r\n return zs;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of Decimal `x` to the power `n`, where `n` is an\r\n * integer of type number.\r\n *\r\n * Implements 'exponentiation by squaring'. Called by `pow` and `parseOther`.\r\n *\r\n */\r\nfunction intPow(Ctor, x, n, pr) {\r\n var isTruncated,\r\n r = new Ctor(1),\r\n\r\n // Max n of 9007199254740991 takes 53 loop iterations.\r\n // Maximum digits array length; leaves [28, 34] guard digits.\r\n k = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n external = false;\r\n\r\n for (;;) {\r\n if (n % 2) {\r\n r = r.times(x);\r\n if (truncate(r.d, k)) isTruncated = true;\r\n }\r\n\r\n n = mathfloor(n / 2);\r\n if (n === 0) {\r\n\r\n // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.\r\n n = r.d.length - 1;\r\n if (isTruncated && r.d[n] === 0) ++r.d[n];\r\n break;\r\n }\r\n\r\n x = x.times(x);\r\n truncate(x.d, k);\r\n }\r\n\r\n external = true;\r\n\r\n return r;\r\n}\r\n\r\n\r\nfunction isOdd(n) {\r\n return n.d[n.d.length - 1] & 1;\r\n}\r\n\r\n\r\n/*\r\n * Handle `max` (`n` is -1) and `min` (`n` is 1).\r\n */\r\nfunction maxOrMin(Ctor, args, n) {\r\n var k, y,\r\n x = new Ctor(args[0]),\r\n i = 0;\r\n\r\n for (; ++i < args.length;) {\r\n y = new Ctor(args[i]);\r\n\r\n // NaN?\r\n if (!y.s) {\r\n x = y;\r\n break;\r\n }\r\n\r\n k = x.cmp(y);\r\n\r\n if (k === n || k === 0 && x.s === n) {\r\n x = y;\r\n }\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of `x` rounded to `sd` significant\r\n * digits.\r\n *\r\n * Taylor/Maclaurin series.\r\n *\r\n * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ...\r\n *\r\n * Argument reduction:\r\n * Repeat x = x / 32, k += 5, until |x| < 0.1\r\n * exp(x) = exp(x / 2^k)^(2^k)\r\n *\r\n * Previously, the argument was initially reduced by\r\n * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10)\r\n * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was\r\n * found to be slower than just dividing repeatedly by 32 as above.\r\n *\r\n * Max integer argument: exp('20723265836946413') = 6.3e+9000000000000000\r\n * Min integer argument: exp('-20723265836946411') = 1.2e-9000000000000000\r\n * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324)\r\n *\r\n * exp(Infinity) = Infinity\r\n * exp(-Infinity) = 0\r\n * exp(NaN) = NaN\r\n * exp(±0) = 1\r\n *\r\n * exp(x) is non-terminating for any finite, non-zero x.\r\n *\r\n * The result will always be correctly rounded.\r\n *\r\n */\r\nfunction naturalExponential(x, sd) {\r\n var denominator, guard, j, pow, sum, t, wpr,\r\n rep = 0,\r\n i = 0,\r\n k = 0,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // 0/NaN/Infinity?\r\n if (!x.d || !x.d[0] || x.e > 17) {\r\n\r\n return new Ctor(x.d\r\n ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0\r\n : x.s ? x.s < 0 ? 0 : x : 0 / 0);\r\n }\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n t = new Ctor(0.03125);\r\n\r\n // while abs(x) >= 0.1\r\n while (x.e > -2) {\r\n\r\n // x = x / 2^5\r\n x = x.times(t);\r\n k += 5;\r\n }\r\n\r\n // Use 2 * log10(2^k) + 5 (empirically derived) to estimate the increase in precision\r\n // necessary to ensure the first 4 rounding digits are correct.\r\n guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;\r\n wpr += guard;\r\n denominator = pow = sum = new Ctor(1);\r\n Ctor.precision = wpr;\r\n\r\n for (;;) {\r\n pow = finalise(pow.times(x), wpr, 1);\r\n denominator = denominator.times(++i);\r\n t = sum.plus(divide(pow, denominator, wpr, 1));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n j = k;\r\n while (j--) sum = finalise(sum.times(sum), wpr, 1);\r\n\r\n // Check to see if the first 4 rounding digits are [49]999.\r\n // If so, repeat the summation with a higher precision, otherwise\r\n // e.g. with precision: 18, rounding: 1\r\n // exp(18.404272462595034083567793919843761) = 98372560.1229999999 (should be 98372560.123)\r\n // `wpr - guard` is the index of first rounding digit.\r\n if (sd == null) {\r\n\r\n if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n Ctor.precision = wpr += 10;\r\n denominator = pow = t = new Ctor(1);\r\n i = 0;\r\n rep++;\r\n } else {\r\n return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n }\r\n } else {\r\n Ctor.precision = pr;\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n }\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of `x` rounded to `sd` significant\r\n * digits.\r\n *\r\n * ln(-n) = NaN\r\n * ln(0) = -Infinity\r\n * ln(-0) = -Infinity\r\n * ln(1) = 0\r\n * ln(Infinity) = Infinity\r\n * ln(-Infinity) = NaN\r\n * ln(NaN) = NaN\r\n *\r\n * ln(n) (n != 1) is non-terminating.\r\n *\r\n */\r\nfunction naturalLogarithm(y, sd) {\r\n var c, c0, denominator, e, numerator, rep, sum, t, wpr, x1, x2,\r\n n = 1,\r\n guard = 10,\r\n x = y,\r\n xd = x.d,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // Is x negative or Infinity, NaN, 0 or 1?\r\n if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) {\r\n return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x);\r\n }\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n Ctor.precision = wpr += guard;\r\n c = digitsToString(xd);\r\n c0 = c.charAt(0);\r\n\r\n if (Math.abs(e = x.e) < 1.5e15) {\r\n\r\n // Argument reduction.\r\n // The series converges faster the closer the argument is to 1, so using\r\n // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b\r\n // multiply the argument by itself until the leading digits of the significand are 7, 8, 9,\r\n // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can\r\n // later be divided by this number, then separate out the power of 10 using\r\n // ln(a*10^b) = ln(a) + b*ln(10).\r\n\r\n // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14).\r\n //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) {\r\n // max n is 6 (gives 0.7 - 1.3)\r\n while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {\r\n x = x.times(y);\r\n c = digitsToString(x.d);\r\n c0 = c.charAt(0);\r\n n++;\r\n }\r\n\r\n e = x.e;\r\n\r\n if (c0 > 1) {\r\n x = new Ctor('0.' + c);\r\n e++;\r\n } else {\r\n x = new Ctor(c0 + '.' + c.slice(1));\r\n }\r\n } else {\r\n\r\n // The argument reduction method above may result in overflow if the argument y is a massive\r\n // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this\r\n // function using ln(x*10^e) = ln(x) + e*ln(10).\r\n t = getLn10(Ctor, wpr + 2, pr).times(e + '');\r\n x = naturalLogarithm(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t);\r\n Ctor.precision = pr;\r\n\r\n return sd == null ? finalise(x, pr, rm, external = true) : x;\r\n }\r\n\r\n // x1 is x reduced to a value near 1.\r\n x1 = x;\r\n\r\n // Taylor series.\r\n // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...)\r\n // where x = (y - 1)/(y + 1) (|x| < 1)\r\n sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1);\r\n x2 = finalise(x.times(x), wpr, 1);\r\n denominator = 3;\r\n\r\n for (;;) {\r\n numerator = finalise(numerator.times(x2), wpr, 1);\r\n t = sum.plus(divide(numerator, new Ctor(denominator), wpr, 1));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n sum = sum.times(2);\r\n\r\n // Reverse the argument reduction. Check that e is not 0 because, besides preventing an\r\n // unnecessary calculation, -0 + 0 = +0 and to ensure correct rounding -0 needs to stay -0.\r\n if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ''));\r\n sum = divide(sum, new Ctor(n), wpr, 1);\r\n\r\n // Is rm > 3 and the first 4 rounding digits 4999, or rm < 4 (or the summation has\r\n // been repeated previously) and the first 4 rounding digits 9999?\r\n // If so, restart the summation with a higher precision, otherwise\r\n // e.g. with precision: 12, rounding: 1\r\n // ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463.\r\n // `wpr - guard` is the index of first rounding digit.\r\n if (sd == null) {\r\n if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n Ctor.precision = wpr += guard;\r\n t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1);\r\n x2 = finalise(x.times(x), wpr, 1);\r\n denominator = rep = 1;\r\n } else {\r\n return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n }\r\n } else {\r\n Ctor.precision = pr;\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n denominator += 2;\r\n }\r\n}\r\n\r\n\r\n// ±Infinity, NaN.\r\nfunction nonFiniteToString(x) {\r\n // Unsigned.\r\n return String(x.s * x.s / 0);\r\n}\r\n\r\n\r\n/*\r\n * Parse the value of a new Decimal `x` from string `str`.\r\n */\r\nfunction parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // TODO BigInt str: no need to check for decimal point, exponential form or leading zeros.\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Parse the value of a new Decimal `x` from a string `str`, which is not a decimal value.\r\n */\r\nfunction parseOther(x, str) {\r\n var base, Ctor, divisor, i, isFloat, len, p, xd, xe;\r\n\r\n if (str.indexOf('_') > -1) {\r\n str = str.replace(/(\\d)_(?=\\d)/g, '$1');\r\n if (isDecimal.test(str)) return parseDecimal(x, str);\r\n } else if (str === 'Infinity' || str === 'NaN') {\r\n if (!+str) x.s = NaN;\r\n x.e = NaN;\r\n x.d = null;\r\n return x;\r\n }\r\n\r\n if (isHex.test(str)) {\r\n base = 16;\r\n str = str.toLowerCase();\r\n } else if (isBinary.test(str)) {\r\n base = 2;\r\n } else if (isOctal.test(str)) {\r\n base = 8;\r\n } else {\r\n throw Error(invalidArgument + str);\r\n }\r\n\r\n // Is there a binary exponent part?\r\n i = str.search(/p/i);\r\n\r\n if (i > 0) {\r\n p = +str.slice(i + 1);\r\n str = str.substring(2, i);\r\n } else {\r\n str = str.slice(2);\r\n }\r\n\r\n // Convert `str` as an integer then divide the result by `base` raised to a power such that the\r\n // fraction part will be restored.\r\n i = str.indexOf('.');\r\n isFloat = i >= 0;\r\n Ctor = x.constructor;\r\n\r\n if (isFloat) {\r\n str = str.replace('.', '');\r\n len = str.length;\r\n i = len - i;\r\n\r\n // log[10](16) = 1.2041... , log[10](88) = 1.9444....\r\n divisor = intPow(Ctor, new Ctor(base), i, i * 2);\r\n }\r\n\r\n xd = convertBase(str, base, BASE);\r\n xe = xd.length - 1;\r\n\r\n // Remove trailing zeros.\r\n for (i = xe; xd[i] === 0; --i) xd.pop();\r\n if (i < 0) return new Ctor(x.s * 0);\r\n x.e = getBase10Exponent(xd, xe);\r\n x.d = xd;\r\n external = false;\r\n\r\n // At what precision to perform the division to ensure exact conversion?\r\n // maxDecimalIntegerPartDigitCount = ceil(log[10](b) * otherBaseIntegerPartDigitCount)\r\n // log[10](2) = 0.30103, log[10](8) = 0.90309, log[10](16) = 1.20412\r\n // E.g. ceil(1.2 * 3) = 4, so up to 4 decimal digits are needed to represent 3 hex int digits.\r\n // maxDecimalFractionPartDigitCount = {Hex:4|Oct:3|Bin:1} * otherBaseFractionPartDigitCount\r\n // Therefore using 4 * the number of digits of str will always be enough.\r\n if (isFloat) x = divide(x, divisor, len * 4);\r\n\r\n // Multiply by the binary exponent part if present.\r\n if (p) x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p));\r\n external = true;\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * sin(x) = x - x^3/3! + x^5/5! - ...\r\n * |x| < pi/2\r\n *\r\n */\r\nfunction sine(Ctor, x) {\r\n var k,\r\n len = x.d.length;\r\n\r\n if (len < 3) {\r\n return x.isZero() ? x : taylorSeries(Ctor, 2, x, x);\r\n }\r\n\r\n // Argument reduction: sin(5x) = 16*sin^5(x) - 20*sin^3(x) + 5*sin(x)\r\n // i.e. sin(x) = 16*sin^5(x/5) - 20*sin^3(x/5) + 5*sin(x/5)\r\n // and sin(x) = sin(x/5)(5 + sin^2(x/5)(16sin^2(x/5) - 20))\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n k = 1.4 * Math.sqrt(len);\r\n k = k > 16 ? 16 : k | 0;\r\n\r\n x = x.times(1 / tinyPow(5, k));\r\n x = taylorSeries(Ctor, 2, x, x);\r\n\r\n // Reverse argument reduction\r\n var sin2_x,\r\n d5 = new Ctor(5),\r\n d16 = new Ctor(16),\r\n d20 = new Ctor(20);\r\n for (; k--;) {\r\n sin2_x = x.times(x);\r\n x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20))));\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n// Calculate Taylor series for `cos`, `cosh`, `sin` and `sinh`.\r\nfunction taylorSeries(Ctor, n, x, y, isHyperbolic) {\r\n var j, t, u, x2,\r\n i = 1,\r\n pr = Ctor.precision,\r\n k = Math.ceil(pr / LOG_BASE);\r\n\r\n external = false;\r\n x2 = x.times(x);\r\n u = new Ctor(y);\r\n\r\n for (;;) {\r\n t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1);\r\n u = isHyperbolic ? y.plus(t) : y.minus(t);\r\n y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1);\r\n t = u.plus(y);\r\n\r\n if (t.d[k] !== void 0) {\r\n for (j = k; t.d[j] === u.d[j] && j--;);\r\n if (j == -1) break;\r\n }\r\n\r\n j = u;\r\n u = y;\r\n y = t;\r\n t = j;\r\n i++;\r\n }\r\n\r\n external = true;\r\n t.d.length = k + 1;\r\n\r\n return t;\r\n}\r\n\r\n\r\n// Exponent e must be positive and non-zero.\r\nfunction tinyPow(b, e) {\r\n var n = b;\r\n while (--e) n *= b;\r\n return n;\r\n}\r\n\r\n\r\n// Return the absolute value of `x` reduced to less than or equal to half pi.\r\nfunction toLessThanHalfPi(Ctor, x) {\r\n var t,\r\n isNeg = x.s < 0,\r\n pi = getPi(Ctor, Ctor.precision, 1),\r\n halfPi = pi.times(0.5);\r\n\r\n x = x.abs();\r\n\r\n if (x.lte(halfPi)) {\r\n quadrant = isNeg ? 4 : 1;\r\n return x;\r\n }\r\n\r\n t = x.divToInt(pi);\r\n\r\n if (t.isZero()) {\r\n quadrant = isNeg ? 3 : 2;\r\n } else {\r\n x = x.minus(t.times(pi));\r\n\r\n // 0 <= x < pi\r\n if (x.lte(halfPi)) {\r\n quadrant = isOdd(t) ? (isNeg ? 2 : 3) : (isNeg ? 4 : 1);\r\n return x;\r\n }\r\n\r\n quadrant = isOdd(t) ? (isNeg ? 1 : 4) : (isNeg ? 3 : 2);\r\n }\r\n\r\n return x.minus(pi).abs();\r\n}\r\n\r\n\r\n/*\r\n * Return the value of Decimal `x` as a string in base `baseOut`.\r\n *\r\n * If the optional `sd` argument is present include a binary exponent suffix.\r\n */\r\nfunction toStringBinary(x, baseOut, sd, rm) {\r\n var base, e, i, k, len, roundUp, str, xd, y,\r\n Ctor = x.constructor,\r\n isExp = sd !== void 0;\r\n\r\n if (isExp) {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n } else {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n }\r\n\r\n if (!x.isFinite()) {\r\n str = nonFiniteToString(x);\r\n } else {\r\n str = finiteToString(x);\r\n i = str.indexOf('.');\r\n\r\n // Use exponential notation according to `toExpPos` and `toExpNeg`? No, but if required:\r\n // maxBinaryExponent = floor((decimalExponent + 1) * log[2](10))\r\n // minBinaryExponent = floor(decimalExponent * log[2](10))\r\n // log[2](10) = 3.321928094887362347870319429489390175864\r\n\r\n if (isExp) {\r\n base = 2;\r\n if (baseOut == 16) {\r\n sd = sd * 4 - 3;\r\n } else if (baseOut == 8) {\r\n sd = sd * 3 - 2;\r\n }\r\n } else {\r\n base = baseOut;\r\n }\r\n\r\n // Convert the number as an integer then divide the result by its base raised to a power such\r\n // that the fraction part will be restored.\r\n\r\n // Non-integer.\r\n if (i >= 0) {\r\n str = str.replace('.', '');\r\n y = new Ctor(1);\r\n y.e = str.length - i;\r\n y.d = convertBase(finiteToString(y), 10, base);\r\n y.e = y.d.length;\r\n }\r\n\r\n xd = convertBase(str, 10, base);\r\n e = len = xd.length;\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] == 0;) xd.pop();\r\n\r\n if (!xd[0]) {\r\n str = isExp ? '0p+0' : '0';\r\n } else {\r\n if (i < 0) {\r\n e--;\r\n } else {\r\n x = new Ctor(x);\r\n x.d = xd;\r\n x.e = e;\r\n x = divide(x, y, sd, rm, 0, base);\r\n xd = x.d;\r\n e = x.e;\r\n roundUp = inexact;\r\n }\r\n\r\n // The rounding digit, i.e. the digit after the digit that may be rounded up.\r\n i = xd[sd];\r\n k = base / 2;\r\n roundUp = roundUp || xd[sd + 1] !== void 0;\r\n\r\n roundUp = rm < 4\r\n ? (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2))\r\n : i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 ||\r\n rm === (x.s < 0 ? 8 : 7));\r\n\r\n xd.length = sd;\r\n\r\n if (roundUp) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for (; ++xd[--sd] > base - 1;) {\r\n xd[sd] = 0;\r\n if (!sd) {\r\n ++e;\r\n xd.unshift(1);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for (i = 0, str = ''; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n\r\n // Add binary exponent suffix?\r\n if (isExp) {\r\n if (len > 1) {\r\n if (baseOut == 16 || baseOut == 8) {\r\n i = baseOut == 16 ? 4 : 3;\r\n for (--len; len % i; len++) str += '0';\r\n xd = convertBase(str, base, baseOut);\r\n for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n // xd[0] will always be be 1\r\n for (i = 1, str = '1.'; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n } else {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n }\r\n\r\n str = str + (e < 0 ? 'p' : 'p+') + e;\r\n } else if (e < 0) {\r\n for (; ++e;) str = '0' + str;\r\n str = '0.' + str;\r\n } else {\r\n if (++e > len) for (e -= len; e-- ;) str += '0';\r\n else if (e < len) str = str.slice(0, e) + '.' + str.slice(e);\r\n }\r\n }\r\n\r\n str = (baseOut == 16 ? '0x' : baseOut == 2 ? '0b' : baseOut == 8 ? '0o' : '') + str;\r\n }\r\n\r\n return x.s < 0 ? '-' + str : str;\r\n}\r\n\r\n\r\n// Does not strip trailing zeros.\r\nfunction truncate(arr, len) {\r\n if (arr.length > len) {\r\n arr.length = len;\r\n return true;\r\n }\r\n}\r\n\r\n\r\n// Decimal methods\r\n\r\n\r\n/*\r\n * abs\r\n * acos\r\n * acosh\r\n * add\r\n * asin\r\n * asinh\r\n * atan\r\n * atanh\r\n * atan2\r\n * cbrt\r\n * ceil\r\n * clamp\r\n * clone\r\n * config\r\n * cos\r\n * cosh\r\n * div\r\n * exp\r\n * floor\r\n * hypot\r\n * ln\r\n * log\r\n * log2\r\n * log10\r\n * max\r\n * min\r\n * mod\r\n * mul\r\n * pow\r\n * random\r\n * round\r\n * set\r\n * sign\r\n * sin\r\n * sinh\r\n * sqrt\r\n * sub\r\n * sum\r\n * tan\r\n * tanh\r\n * trunc\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the absolute value of `x`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction abs(x) {\r\n return new this(x).abs();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arccosine in radians of `x`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction acos(x) {\r\n return new this(x).acos();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic cosine of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} A value in radians.\r\n *\r\n */\r\nfunction acosh(x) {\r\n return new this(x).acosh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sum of `x` and `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n * y {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction add(x, y) {\r\n return new this(x).plus(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arcsine in radians of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction asin(x) {\r\n return new this(x).asin();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic sine of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} A value in radians.\r\n *\r\n */\r\nfunction asinh(x) {\r\n return new this(x).asinh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent in radians of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction atan(x) {\r\n return new this(x).atan();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic tangent of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} A value in radians.\r\n *\r\n */\r\nfunction atanh(x) {\r\n return new this(x).atanh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent in radians of `y/x` in the range -pi to pi\r\n * (inclusive), rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi, pi]\r\n *\r\n * y {number|string|bigint|Decimal} The y-coordinate.\r\n * x {number|string|bigint|Decimal} The x-coordinate.\r\n *\r\n * atan2(±0, -0) = ±pi\r\n * atan2(±0, +0) = ±0\r\n * atan2(±0, -x) = ±pi for x > 0\r\n * atan2(±0, x) = ±0 for x > 0\r\n * atan2(-y, ±0) = -pi/2 for y > 0\r\n * atan2(y, ±0) = pi/2 for y > 0\r\n * atan2(±y, -Infinity) = ±pi for finite y > 0\r\n * atan2(±y, +Infinity) = ±0 for finite y > 0\r\n * atan2(±Infinity, x) = ±pi/2 for finite x\r\n * atan2(±Infinity, -Infinity) = ±3*pi/4\r\n * atan2(±Infinity, +Infinity) = ±pi/4\r\n * atan2(NaN, x) = NaN\r\n * atan2(y, NaN) = NaN\r\n *\r\n */\r\nfunction atan2(y, x) {\r\n y = new this(y);\r\n x = new this(x);\r\n var r,\r\n pr = this.precision,\r\n rm = this.rounding,\r\n wpr = pr + 4;\r\n\r\n // Either NaN\r\n if (!y.s || !x.s) {\r\n r = new this(NaN);\r\n\r\n // Both ±Infinity\r\n } else if (!y.d && !x.d) {\r\n r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75);\r\n r.s = y.s;\r\n\r\n // x is ±Infinity or y is ±0\r\n } else if (!x.d || y.isZero()) {\r\n r = x.s < 0 ? getPi(this, pr, rm) : new this(0);\r\n r.s = y.s;\r\n\r\n // y is ±Infinity or x is ±0\r\n } else if (!y.d || x.isZero()) {\r\n r = getPi(this, wpr, 1).times(0.5);\r\n r.s = y.s;\r\n\r\n // Both non-zero and finite\r\n } else if (x.s < 0) {\r\n this.precision = wpr;\r\n this.rounding = 1;\r\n r = this.atan(divide(y, x, wpr, 1));\r\n x = getPi(this, wpr, 1);\r\n this.precision = pr;\r\n this.rounding = rm;\r\n r = y.s < 0 ? r.minus(x) : r.plus(x);\r\n } else {\r\n r = this.atan(divide(y, x, wpr, 1));\r\n }\r\n\r\n return r;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cube root of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction cbrt(x) {\r\n return new this(x).cbrt();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` rounded to an integer using `ROUND_CEIL`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction ceil(x) {\r\n return finalise(x = new this(x), x.e + 1, 2);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` clamped to the range delineated by `min` and `max`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n * min {number|string|bigint|Decimal}\r\n * max {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction clamp(x, min, max) {\r\n return new this(x).clamp(min, max);\r\n}\r\n\r\n\r\n/*\r\n * Configure global settings for a Decimal constructor.\r\n *\r\n * `obj` is an object with one or more of the following properties,\r\n *\r\n * precision {number}\r\n * rounding {number}\r\n * toExpNeg {number}\r\n * toExpPos {number}\r\n * maxE {number}\r\n * minE {number}\r\n * modulo {number}\r\n * crypto {boolean|number}\r\n * defaults {true}\r\n *\r\n * E.g. Decimal.config({ precision: 20, rounding: 4 })\r\n *\r\n */\r\nfunction config(obj) {\r\n if (!obj || typeof obj !== 'object') throw Error(decimalError + 'Object expected');\r\n var i, p, v,\r\n useDefaults = obj.defaults === true,\r\n ps = [\r\n 'precision', 1, MAX_DIGITS,\r\n 'rounding', 0, 8,\r\n 'toExpNeg', -EXP_LIMIT, 0,\r\n 'toExpPos', 0, EXP_LIMIT,\r\n 'maxE', 0, EXP_LIMIT,\r\n 'minE', -EXP_LIMIT, 0,\r\n 'modulo', 0, 9\r\n ];\r\n\r\n for (i = 0; i < ps.length; i += 3) {\r\n if (p = ps[i], useDefaults) this[p] = DEFAULTS[p];\r\n if ((v = obj[p]) !== void 0) {\r\n if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;\r\n else throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n if (p = 'crypto', useDefaults) this[p] = DEFAULTS[p];\r\n if ((v = obj[p]) !== void 0) {\r\n if (v === true || v === false || v === 0 || v === 1) {\r\n if (v) {\r\n if (typeof crypto != 'undefined' && crypto &&\r\n (crypto.getRandomValues || crypto.randomBytes)) {\r\n this[p] = true;\r\n } else {\r\n throw Error(cryptoUnavailable);\r\n }\r\n } else {\r\n this[p] = false;\r\n }\r\n } else {\r\n throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n return this;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cosine of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} A value in radians.\r\n *\r\n */\r\nfunction cos(x) {\r\n return new this(x).cos();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic cosine of `x`, rounded to precision\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} A value in radians.\r\n *\r\n */\r\nfunction cosh(x) {\r\n return new this(x).cosh();\r\n}\r\n\r\n\r\n/*\r\n * Create and return a Decimal constructor with the same configuration properties as this Decimal\r\n * constructor.\r\n *\r\n */\r\nfunction clone(obj) {\r\n var i, p, ps;\r\n\r\n /*\r\n * The Decimal constructor and exported function.\r\n * Return a new Decimal instance.\r\n *\r\n * v {number|string|bigint|Decimal} A numeric value.\r\n *\r\n */\r\n function Decimal(v) {\r\n var e, i, t,\r\n x = this;\r\n\r\n // Decimal called without new.\r\n if (!(x instanceof Decimal)) return new Decimal(v);\r\n\r\n // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor\r\n // which points to Object.\r\n x.constructor = Decimal;\r\n\r\n if (isDecimalInstance(v)) {\r\n x.s = v.s;\r\n\r\n if (external) {\r\n if (!v.d || v.e > Decimal.maxE) {\r\n\r\n // Infinity.\r\n x.e = NaN;\r\n x.d = null;\r\n } else if (v.e < Decimal.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n } else {\r\n x.e = v.e;\r\n x.d = v.d.slice();\r\n }\r\n } else {\r\n x.e = v.e;\r\n x.d = v.d ? v.d.slice() : v.d;\r\n }\r\n\r\n return;\r\n }\r\n\r\n t = typeof v;\r\n\r\n if (t === 'number') {\r\n if (v === 0) {\r\n x.s = 1 / v < 0 ? -1 : 1;\r\n x.e = 0;\r\n x.d = [0];\r\n return;\r\n }\r\n\r\n if (v < 0) {\r\n v = -v;\r\n x.s = -1;\r\n } else {\r\n x.s = 1;\r\n }\r\n\r\n // Fast path for small integers.\r\n if (v === ~~v && v < 1e7) {\r\n for (e = 0, i = v; i >= 10; i /= 10) e++;\r\n\r\n if (external) {\r\n if (e > Decimal.maxE) {\r\n x.e = NaN;\r\n x.d = null;\r\n } else if (e < Decimal.minE) {\r\n x.e = 0;\r\n x.d = [0];\r\n } else {\r\n x.e = e;\r\n x.d = [v];\r\n }\r\n } else {\r\n x.e = e;\r\n x.d = [v];\r\n }\r\n\r\n return;\r\n }\r\n\r\n // Infinity or NaN?\r\n if (v * 0 !== 0) {\r\n if (!v) x.s = NaN;\r\n x.e = NaN;\r\n x.d = null;\r\n return;\r\n }\r\n\r\n return parseDecimal(x, v.toString());\r\n }\r\n\r\n if (t === 'string') {\r\n if ((i = v.charCodeAt(0)) === 45) { // minus sign\r\n v = v.slice(1);\r\n x.s = -1;\r\n } else {\r\n if (i === 43) v = v.slice(1); // plus sign\r\n x.s = 1;\r\n }\r\n\r\n return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);\r\n }\r\n\r\n if (t === 'bigint') {\r\n if (v < 0) {\r\n v = -v;\r\n x.s = -1;\r\n } else {\r\n x.s = 1;\r\n }\r\n\r\n return parseDecimal(x, v.toString());\r\n }\r\n\r\n throw Error(invalidArgument + v);\r\n }\r\n\r\n Decimal.prototype = P;\r\n\r\n Decimal.ROUND_UP = 0;\r\n Decimal.ROUND_DOWN = 1;\r\n Decimal.ROUND_CEIL = 2;\r\n Decimal.ROUND_FLOOR = 3;\r\n Decimal.ROUND_HALF_UP = 4;\r\n Decimal.ROUND_HALF_DOWN = 5;\r\n Decimal.ROUND_HALF_EVEN = 6;\r\n Decimal.ROUND_HALF_CEIL = 7;\r\n Decimal.ROUND_HALF_FLOOR = 8;\r\n Decimal.EUCLID = 9;\r\n\r\n Decimal.config = Decimal.set = config;\r\n Decimal.clone = clone;\r\n Decimal.isDecimal = isDecimalInstance;\r\n\r\n Decimal.abs = abs;\r\n Decimal.acos = acos;\r\n Decimal.acosh = acosh; // ES6\r\n Decimal.add = add;\r\n Decimal.asin = asin;\r\n Decimal.asinh = asinh; // ES6\r\n Decimal.atan = atan;\r\n Decimal.atanh = atanh; // ES6\r\n Decimal.atan2 = atan2;\r\n Decimal.cbrt = cbrt; // ES6\r\n Decimal.ceil = ceil;\r\n Decimal.clamp = clamp;\r\n Decimal.cos = cos;\r\n Decimal.cosh = cosh; // ES6\r\n Decimal.div = div;\r\n Decimal.exp = exp;\r\n Decimal.floor = floor;\r\n Decimal.hypot = hypot; // ES6\r\n Decimal.ln = ln;\r\n Decimal.log = log;\r\n Decimal.log10 = log10; // ES6\r\n Decimal.log2 = log2; // ES6\r\n Decimal.max = max;\r\n Decimal.min = min;\r\n Decimal.mod = mod;\r\n Decimal.mul = mul;\r\n Decimal.pow = pow;\r\n Decimal.random = random;\r\n Decimal.round = round;\r\n Decimal.sign = sign; // ES6\r\n Decimal.sin = sin;\r\n Decimal.sinh = sinh; // ES6\r\n Decimal.sqrt = sqrt;\r\n Decimal.sub = sub;\r\n Decimal.sum = sum;\r\n Decimal.tan = tan;\r\n Decimal.tanh = tanh; // ES6\r\n Decimal.trunc = trunc; // ES6\r\n\r\n if (obj === void 0) obj = {};\r\n if (obj) {\r\n if (obj.defaults !== true) {\r\n ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'maxE', 'minE', 'modulo', 'crypto'];\r\n for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];\r\n }\r\n }\r\n\r\n Decimal.config(obj);\r\n\r\n return Decimal;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` divided by `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n * y {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction div(x, y) {\r\n return new this(x).div(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} The power to which to raise the base of the natural log.\r\n *\r\n */\r\nfunction exp(x) {\r\n return new this(x).exp();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` round to an integer using `ROUND_FLOOR`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction floor(x) {\r\n return finalise(x = new this(x), x.e + 1, 3);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of the sum of the squares of the arguments,\r\n * rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * hypot(a, b, ...) = sqrt(a^2 + b^2 + ...)\r\n *\r\n * arguments {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction hypot() {\r\n var i, n,\r\n t = new this(0);\r\n\r\n external = false;\r\n\r\n for (i = 0; i < arguments.length;) {\r\n n = new this(arguments[i++]);\r\n if (!n.d) {\r\n if (n.s) {\r\n external = true;\r\n return new this(1 / 0);\r\n }\r\n t = n;\r\n } else if (t.d) {\r\n t = t.plus(n.times(n));\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return t.sqrt();\r\n}\r\n\r\n\r\n/*\r\n * Return true if object is a Decimal instance (where Decimal is any Decimal constructor),\r\n * otherwise return false.\r\n *\r\n */\r\nfunction isDecimalInstance(obj) {\r\n return obj instanceof Decimal || obj && obj.toStringTag === tag || false;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction ln(x) {\r\n return new this(x).ln();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the log of `x` to the base `y`, or to base 10 if no base\r\n * is specified, rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * log[y](x)\r\n *\r\n * x {number|string|bigint|Decimal} The argument of the logarithm.\r\n * y {number|string|bigint|Decimal} The base of the logarithm.\r\n *\r\n */\r\nfunction log(x, y) {\r\n return new this(x).log(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the base 2 logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction log2(x) {\r\n return new this(x).log(2);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the base 10 logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction log10(x) {\r\n return new this(x).log(10);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the maximum of the arguments.\r\n *\r\n * arguments {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction max() {\r\n return maxOrMin(this, arguments, -1);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the minimum of the arguments.\r\n *\r\n * arguments {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction min() {\r\n return maxOrMin(this, arguments, 1);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` modulo `y`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n * y {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction mod(x, y) {\r\n return new this(x).mod(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` multiplied by `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n * y {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction mul(x, y) {\r\n return new this(x).mul(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` raised to the power `y`, rounded to precision\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} The base.\r\n * y {number|string|bigint|Decimal} The exponent.\r\n *\r\n */\r\nfunction pow(x, y) {\r\n return new this(x).pow(y);\r\n}\r\n\r\n\r\n/*\r\n * Returns a new Decimal with a random value equal to or greater than 0 and less than 1, and with\r\n * `sd`, or `Decimal.precision` if `sd` is omitted, significant digits (or less if trailing zeros\r\n * are produced).\r\n *\r\n * [sd] {number} Significant digits. Integer, 0 to MAX_DIGITS inclusive.\r\n *\r\n */\r\nfunction random(sd) {\r\n var d, e, k, n,\r\n i = 0,\r\n r = new this(1),\r\n rd = [];\r\n\r\n if (sd === void 0) sd = this.precision;\r\n else checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n k = Math.ceil(sd / LOG_BASE);\r\n\r\n if (!this.crypto) {\r\n for (; i < k;) rd[i++] = Math.random() * 1e7 | 0;\r\n\r\n // Browsers supporting crypto.getRandomValues.\r\n } else if (crypto.getRandomValues) {\r\n d = crypto.getRandomValues(new Uint32Array(k));\r\n\r\n for (; i < k;) {\r\n n = d[i];\r\n\r\n // 0 <= n < 4294967296\r\n // Probability n >= 4.29e9, is 4967296 / 4294967296 = 0.00116 (1 in 865).\r\n if (n >= 4.29e9) {\r\n d[i] = crypto.getRandomValues(new Uint32Array(1))[0];\r\n } else {\r\n\r\n // 0 <= n <= 4289999999\r\n // 0 <= (n % 1e7) <= 9999999\r\n rd[i++] = n % 1e7;\r\n }\r\n }\r\n\r\n // Node.js supporting crypto.randomBytes.\r\n } else if (crypto.randomBytes) {\r\n\r\n // buffer\r\n d = crypto.randomBytes(k *= 4);\r\n\r\n for (; i < k;) {\r\n\r\n // 0 <= n < 2147483648\r\n n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 0x7f) << 24);\r\n\r\n // Probability n >= 2.14e9, is 7483648 / 2147483648 = 0.0035 (1 in 286).\r\n if (n >= 2.14e9) {\r\n crypto.randomBytes(4).copy(d, i);\r\n } else {\r\n\r\n // 0 <= n <= 2139999999\r\n // 0 <= (n % 1e7) <= 9999999\r\n rd.push(n % 1e7);\r\n i += 4;\r\n }\r\n }\r\n\r\n i = k / 4;\r\n } else {\r\n throw Error(cryptoUnavailable);\r\n }\r\n\r\n k = rd[--i];\r\n sd %= LOG_BASE;\r\n\r\n // Convert trailing digits to zeros according to sd.\r\n if (k && sd) {\r\n n = mathpow(10, LOG_BASE - sd);\r\n rd[i] = (k / n | 0) * n;\r\n }\r\n\r\n // Remove trailing words which are zero.\r\n for (; rd[i] === 0; i--) rd.pop();\r\n\r\n // Zero?\r\n if (i < 0) {\r\n e = 0;\r\n rd = [0];\r\n } else {\r\n e = -1;\r\n\r\n // Remove leading words which are zero and adjust exponent accordingly.\r\n for (; rd[0] === 0; e -= LOG_BASE) rd.shift();\r\n\r\n // Count the digits of the first word of rd to determine leading zeros.\r\n for (k = 1, n = rd[0]; n >= 10; n /= 10) k++;\r\n\r\n // Adjust the exponent for leading zeros of the first word of rd.\r\n if (k < LOG_BASE) e -= LOG_BASE - k;\r\n }\r\n\r\n r.e = e;\r\n r.d = rd;\r\n\r\n return r;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` rounded to an integer using rounding mode `rounding`.\r\n *\r\n * To emulate `Math.round`, set rounding to 7 (ROUND_HALF_CEIL).\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction round(x) {\r\n return finalise(x = new this(x), x.e + 1, this.rounding);\r\n}\r\n\r\n\r\n/*\r\n * Return\r\n * 1 if x > 0,\r\n * -1 if x < 0,\r\n * 0 if x is 0,\r\n * -0 if x is -0,\r\n * NaN otherwise\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction sign(x) {\r\n x = new this(x);\r\n return x.d ? (x.d[0] ? x.s : 0 * x.s) : x.s || NaN;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sine of `x`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} A value in radians.\r\n *\r\n */\r\nfunction sin(x) {\r\n return new this(x).sin();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic sine of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} A value in radians.\r\n *\r\n */\r\nfunction sinh(x) {\r\n return new this(x).sinh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction sqrt(x) {\r\n return new this(x).sqrt();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` minus `y`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n * y {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction sub(x, y) {\r\n return new this(x).sub(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sum of the arguments, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * Only the result is rounded, not the intermediate calculations.\r\n *\r\n * arguments {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction sum() {\r\n var i = 0,\r\n args = arguments,\r\n x = new this(args[i]);\r\n\r\n external = false;\r\n for (; x.s && ++i < args.length;) x = x.plus(args[i]);\r\n external = true;\r\n\r\n return finalise(x, this.precision, this.rounding);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the tangent of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} A value in radians.\r\n *\r\n */\r\nfunction tan(x) {\r\n return new this(x).tan();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic tangent of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} A value in radians.\r\n *\r\n */\r\nfunction tanh(x) {\r\n return new this(x).tanh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` truncated to an integer.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction trunc(x) {\r\n return finalise(x = new this(x), x.e + 1, 1);\r\n}\r\n\r\n\r\nP[Symbol.for('nodejs.util.inspect.custom')] = P.toString;\r\nP[Symbol.toStringTag] = 'Decimal';\r\n\r\n// Create and configure initial Decimal constructor.\r\nexport var Decimal = P.constructor = clone(DEFAULTS);\r\n\r\n// Create the internal constants from their string values.\r\nLN10 = new Decimal(LN10);\r\nPI = new Decimal(PI);\r\n\r\nexport default Decimal;\r\n","import { Decimal } from 'decimal.js';\nimport React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Input } from './input';\n\nexport type INumberInputProps = Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'size'\n> & {\n rounded?:\n | 'default'\n | 'none'\n | 'sm'\n | 'md'\n | 'lg'\n | 'xl'\n | '2xl'\n | '3xl'\n | 'full'\n | null\n | undefined;\n size?: 'xs' | 'sm' | 'md' | 'lg' | null | undefined;\n isFull?: boolean;\n controls?: boolean;\n};\n\nenum Operation {\n minus = 'minus',\n plus = 'plus',\n}\n\nconst NumberInput = React.forwardRef<HTMLInputElement, INumberInputProps>(\n ({ className, type, controls, ...props }, ref) => {\n const inputRef = React.useRef<HTMLInputElement>(null);\n const { min, max, step = 1, onChange } = props;\n const hideControls = controls === false;\n const updateValue = (event: any, operation?: Operation) => {\n event.stopPropagation();\n event.preventDefault();\n const inputElement = inputRef.current;\n const decimalValue = new Decimal(inputElement?.value || 0);\n const decimalStep = new Decimal(step);\n const newValue = (\n operation ? decimalValue[operation](decimalStep) : decimalValue\n ).toNumber();\n\n // Validate against min and max values if defined\n if (\n (min !== undefined && newValue < Number(min)) ||\n (max !== undefined && newValue > Number(max))\n ) {\n return;\n }\n\n if (inputElement) {\n if (operation) {\n inputElement.value = newValue.toString();\n }\n onChange?.({\n target: { value: Number(inputElement.value) },\n } as unknown as React.ChangeEvent<HTMLInputElement>);\n }\n };\n\n const onBlur = (e: any) => {\n const newValue = e.target.value;\n const inputElement = inputRef.current;\n if (!inputElement) {\n return;\n }\n if (min !== undefined && newValue < Number(min)) {\n inputElement.value = String(min);\n } else if (max !== undefined && newValue > Number(max)) {\n inputElement.value = String(max);\n } else {\n inputElement.value = String(Number(inputElement.value));\n }\n onChange?.({\n target: { value: Number(inputElement.value) },\n } as unknown as React.ChangeEvent<HTMLInputElement>);\n };\n\n const handleIncrement = (e: any) => updateValue(e, Operation.plus);\n const handleDecrement = (e: any) => updateValue(e, Operation.minus);\n\n return (\n <div className={cn('relative w-full', className)}>\n <Input\n type=\"number\"\n ref={inputRef}\n {...props}\n value={props.value}\n onChange={updateValue}\n className={`${hideControls ? 'text-center' : 'pr-10'}`}\n onBlur={onBlur}\n />\n {hideControls ? null : (\n <div className=\"absolute top-0 right-3 py-2.5 h-full flex flex-col items-center justify-center space-y-0.5\">\n <div\n className=\"text-Colors-Text-Default bg-surface-accent-gray-subtler rounded-full w-[22px] h-[14px] cursor-pointer flex justify-center items-center\"\n onClick={handleIncrement}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"14\"\n viewBox=\"0 0 20 14\"\n fill=\"none\"\n >\n <path\n d=\"M6.90169 9H13.0983C13.8493 9 14.27 8.24649 13.806 7.7324L10.7077 4.29945C10.3474 3.90018 9.65265 3.90018 9.29231 4.29945L6.19399 7.7324C5.73001 8.24649 6.15069 9 6.90169 9Z\"\n fill=\"#414345\"\n />\n </svg>\n </div>\n <div\n className=\"text-Colors-Text-Default bg-surface-accent-gray-subtler rounded-full w-[22px] h-[14px] cursor-pointer flex justify-center items-center\"\n onClick={handleDecrement}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"14\"\n viewBox=\"0 0 20 14\"\n fill=\"none\"\n >\n <path\n d=\"M13.0983 5L6.90169 5C6.15069 5 5.73001 5.75351 6.19399 6.2676L9.29231 9.70055C9.65265 10.0998 10.3474 10.0998 10.7077 9.70055L13.806 6.2676C14.27 5.75351 13.8493 5 13.0983 5Z\"\n fill=\"#414345\"\n />\n </svg>\n </div>\n </div>\n )}\n </div>\n );\n }\n);\nNumberInput.displayName = 'NumberInput';\n\nexport { NumberInput };\n","'use client';\n\nimport { cn } from '@/lib/utils';\n\nfunction PageContent({ children }: { children: React.ReactNode }) {\n return (\n <section\n className={cn(\n 'page-content relative h-full flex-1 flex flex-col overflow-hidden bg-Colors-Background-Normal-Primary-Default text-Colors-Text-Default rounded-none md:rounded-2xl'\n )}\n >\n {children}\n </section>\n );\n}\nexport default PageContent;\n","'use client';\n\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport { Circle } from 'lucide-react';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst RadioGroup = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Root\n className={cn('grid gap-2', className)}\n {...props}\n ref={ref}\n />\n );\n});\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\nconst RadioGroupItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n 'aspect-square h-5 w-5 rounded-full border-[1.5px] border-pressed text-transparent aria-checked:border-[6px] aria-checked:border-Colors-Utility-Lake-Blue-40 ring-offset-cc-Focus-Rings-Brand-default focus:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-30',\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n <Circle className=\"h-2 w-2 fill-current text-current\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n );\n});\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\nexport { RadioGroup, RadioGroupItem };\n","'use client';\n\nimport * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst ScrollArea = React.forwardRef<\n React.ElementRef<typeof ScrollAreaPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn('relative overflow-hidden', className)}\n type=\"always\"\n {...props}\n >\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n));\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;\n\nconst ScrollBar = React.forwardRef<\n React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(({ className, orientation = 'vertical', ...props }, ref) => (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n 'flex touch-none select-none transition-colors',\n orientation === 'vertical' &&\n 'h-full w-2 border-l border-l-transparent p-[1px]',\n orientation === 'horizontal' &&\n 'h-2 flex-col border-t border-t-transparent p-[1px]',\n className\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"relative flex-1 rounded-full bg-border-hovered hover:bg-border-pressed\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n));\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;\n\nexport { ScrollArea, ScrollBar };\n","/* eslint-disable react/jsx-no-useless-fragment */\nimport { ArrowLeftIcon } from '@heroicons/react/24/outline';\nimport { LucideIcon } from 'lucide-react';\nimport { useEffect, useRef, useState } from 'react';\nimport { useMedia } from 'react-use';\n\nimport { HeroIcon } from '../common/constants/types/common';\nimport { cn } from '@/lib/utils';\n\nimport { Avatar } from './avatar';\nimport { Button } from './button/button';\nimport { Icon, IconComponent } from './icon';\nimport { IconButton } from './button/icon-button';\nimport { Link } from './link';\nimport { SearchBar } from './search-bar';\nimport { Separator } from './separator';\nimport { Display, Text } from './typography';\nimport FilterIcon from './icons/outline/FilterIcon';\n\ntype IIcons = {\n icon: HeroIcon | LucideIcon | IconComponent | React.ElementType;\n onClick?: () => void;\n};\ntype IActions = {\n label: string;\n onClick?: () => void;\n icon?: HeroIcon | LucideIcon | IconComponent | React.ElementType;\n variant?: 'primary' | 'secondary' | 'static' | 'link' | 'plain';\n color?: 'default' | 'brand' | 'error' | 'chat';\n};\ntype ISecondaryNavigationBar = {\n /**\n * 是否展示背景\n * boolean\n *\n * @default true\n */\n hasBackground?: boolean;\n /**\n * 右侧自定义内容\n * ReactNode\n *\n */\n children?: React.ReactNode;\n /**\n * 导航栏title\n * string\n */\n title?: string;\n /**\n * 是否展示搜索框\n * boolean\n *\n * @default false\n */\n showSearchBar?: boolean;\n /**\n * 搜索框值\n * string\n */\n searchValue?: string;\n /**\n * 搜索框占位值\n * string\n */\n searchPlaceholder?: string;\n /**\n * 是否显示底部border\n * boolean\n */\n border?: boolean;\n /**\n * 返回链接,有配置则显示返回icon\n * string\n */\n backUrl?: string;\n /**\n * 是否展示清除按钮\n * boolean\n *\n * @default false\n */\n showClear?: boolean;\n /**\n * 清除按钮文本\n * string\n */\n clearText?: string;\n /**\n * icon按钮配置\n * IIcons\n */\n icons?: IIcons[];\n /**\n * 操作按钮配置\n * IActions\n */\n actions?: IActions[];\n /**\n * 头像配置\n * {\n * logo: string;\n * name?: string;\n * }\n */\n avatar?: {\n logo: string;\n name?: string;\n };\n onSearchChange?: (value: string) => void;\n onClear?: () => void;\n};\n\nfunction SecondaryNavigationBar({\n showSearchBar = true,\n searchValue,\n searchPlaceholder,\n title,\n border,\n backUrl,\n showClear,\n clearText,\n icons,\n actions,\n children,\n hasBackground = true,\n avatar,\n onSearchChange,\n onClear,\n}: ISecondaryNavigationBar) {\n const isMobile = useMedia('(max-width: 768px)');\n const navbarRef = useRef<HTMLDivElement>(null);\n const [showBackground, setShowBackground] = useState(hasBackground);\n\n useEffect(() => {\n if (hasBackground) {\n setShowBackground(true);\n\n return;\n }\n\n const handleScroll = () => {\n if (navbarRef.current) {\n const { height } = navbarRef.current.getBoundingClientRect();\n setShowBackground(window.scrollY > height);\n }\n };\n\n window.addEventListener('scroll', handleScroll);\n\n return () => window.removeEventListener('scroll', handleScroll);\n }, [hasBackground]);\n const currentClearText = clearText || 'Clear Filters';\n\n return (\n <div\n ref={navbarRef}\n className={cn(\n 'w-full flex flex-col md:flex-row justify-center items-center px-4 md:px-6',\n !isMobile && border && 'border-b border-Colors-Border-Default',\n showBackground && 'bg-Colors-Background-Normal-Primary-Default'\n )}\n >\n <div\n className={cn(\n 'relative w-full flex justify-between items-center h-14 md:h-15'\n )}\n >\n <div\n className={cn('flex items-center', avatar?.logo && 'min-w-[76px]')}\n >\n {backUrl && (\n <div className=\"flex justify-start items-center\">\n <Link href={backUrl} className=\"flex justify-center items-center\">\n <IconButton\n variant={!hasBackground ? 'primary' : 'plain'}\n color={!hasBackground ? 'gray' : 'brand'}\n size=\"md\"\n icon={ArrowLeftIcon}\n />\n </Link>\n {!isMobile && title && (\n <Separator orientation=\"vertical\" className=\"h-5 ml-1.5 mr-3\" />\n )}\n </div>\n )}\n\n {title &&\n (!showSearchBar || !isMobile) &&\n (!avatar?.logo || !isMobile) && (\n <div className=\"flex-1 flex-shrink-0 absolute w-full md:relative md:w-auto flex items-center justify-center md:justify-start\">\n <Display\n size={isMobile ? 'xs' : 'sm'}\n className={cn(\n 'max-w-[calc(100%-168px)] md:max-w-fit flex-1 flex-shrink-0 absolute w-full md:relative md:w-auto text-center md:text-left line-clamp-1'\n )}\n >\n {title}\n </Display>\n </div>\n )}\n </div>\n\n {avatar?.logo && !showSearchBar && (\n <div className=\"flex-shrink-0 flex relative px-3 justify-center items-center space-x-1.5\">\n <Avatar size=\"sm\" src={avatar.logo} />\n {avatar.name && !isMobile && (\n <Text size=\"lg\" weight=\"medium\">\n {avatar.name}\n </Text>\n )}\n </div>\n )}\n\n <div\n className={cn(\n 'w-fit flex md:w-auto justify-end',\n !avatar?.logo && 'flex-1'\n )}\n >\n {children ? (\n <div className=\"w-fit\">{children}</div>\n ) : (\n <>\n {icons || actions ? (\n <div\n className={cn(\n 'flex justify-end items-center',\n icons && 'space-x-1 min-w-[76px]',\n actions && 'space-x-3'\n )}\n >\n {icons &&\n icons.map((icon, index) => (\n <IconButton\n key={index}\n variant={!hasBackground ? 'primary' : 'plain'}\n color={!hasBackground ? 'gray' : 'brand'}\n size=\"md\"\n icon={icon.icon}\n onClick={icon.onClick}\n />\n ))}\n {actions &&\n actions.map((action, index) => (\n <Button key={index} size=\"md\" {...action}>\n {action.label}\n </Button>\n ))}\n </div>\n ) : (\n <>\n {showClear && !isMobile && (\n <Button\n aria-label={currentClearText}\n size=\"md\"\n variant=\"primary\"\n color=\"default\"\n className=\"hidden md:flex relative text-sm blue-30 text-blue-30 font-medium ml-2 mr-3 px-4 justify-center items-center\"\n onClick={onClear}\n >\n <div className=\"relative mr-1.5\">\n <FilterIcon className=\"w-5 h-5\" />\n </div>\n <span className=\"hidden md:block\">\n {currentClearText}\n </span>\n </Button>\n )}\n {showSearchBar && (\n <div className=\"relative w-full md:w-60\">\n <SearchBar\n color=\"gray\"\n size=\"xs\"\n searchValue={searchValue}\n placeholder={searchPlaceholder || 'Search'}\n onSearchChange={(value) => {\n onSearchChange && onSearchChange(value);\n }}\n />\n </div>\n )}\n {showClear && isMobile && (\n <IconButton\n className=\"flex-shrink-0 flex relative text-sm font-medium px-4 justify-center items-center ml-3\"\n aria-label={currentClearText}\n size=\"md\"\n variant=\"primary\"\n color=\"default\"\n onClick={onClear}\n >\n <div className=\"relative\">\n <FilterIcon />\n </div>\n </IconButton>\n )}\n </>\n )}\n </>\n )}\n </div>\n </div>\n </div>\n );\n}\n\nexport { SecondaryNavigationBar };\n","function FilterIcon({ className }: { className?: string }) {\n return (\n <svg\n className={className}\n width=\"22\"\n height=\"22\"\n viewBox=\"0 0 22 22\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10.0278 2.84729C7.67712 2.84729 5.37221 3.04531 3.12895 3.42572C2.37055 3.55432 1.83336 4.2145 1.83336 4.96859V5.84598C1.83336 6.51468 2.099 7.15598 2.57185 7.62882L7.13715 12.1941C7.37358 12.4305 7.5064 12.7511 7.5064 13.0855V18.6055C7.5064 18.8239 7.61951 19.0268 7.80535 19.1417C7.99118 19.2565 8.22323 19.267 8.41863 19.1693L11.1553 17.8009C12.0095 17.3738 12.5491 16.5008 12.5491 15.5458V13.0855C12.5491 12.7511 12.6819 12.4305 12.9183 12.1941L17.4837 7.62882C17.9565 7.15598 18.2221 6.51468 18.2221 5.84598V4.96857C18.2221 4.21448 17.6849 3.5543 16.9265 3.4257C14.6833 3.0453 12.3784 2.84729 10.0278 2.84729ZM3.33973 4.66863C5.51363 4.29998 7.74805 4.10794 10.0278 4.10794C12.3075 4.10794 14.5419 4.29998 16.7158 4.66861C16.8531 4.69189 16.9615 4.8142 16.9615 4.96857V5.84598C16.9615 6.18033 16.8286 6.50098 16.5922 6.7374L12.0269 11.3026C11.5541 11.7755 11.2884 12.4168 11.2884 13.0855V15.5458C11.2884 16.0233 11.0186 16.4598 10.5915 16.6734L8.76707 17.5856V13.0855C8.76707 12.4168 8.50143 11.7755 8.02859 11.3026L3.46328 6.7374C3.22685 6.50098 3.09403 6.18033 3.09403 5.84598V4.96859C3.09403 4.81422 3.20244 4.69191 3.33973 4.66863ZM15.1424 12.0035C14.9222 11.7833 14.5651 11.7833 14.3448 12.0035C14.1246 12.2238 14.1246 12.5809 14.3448 12.8011L16.3756 14.8318L14.3448 16.8625C14.1246 17.0828 14.1246 17.4399 14.3448 17.6601C14.5651 17.8804 14.9222 17.8804 15.1424 17.6601L17.1732 15.6294L19.2039 17.6601C19.4242 17.8804 19.7813 17.8804 20.0015 17.6601C20.2218 17.4399 20.2218 17.0828 20.0015 16.8625L17.9708 14.8318L20.0015 12.8011C20.2218 12.5809 20.2218 12.2238 20.0015 12.0035C19.7813 11.7833 19.4242 11.7833 19.2039 12.0035L17.1732 14.0342L15.1424 12.0035Z\"\n fill=\"#3E5CFA\"\n />\n </svg>\n );\n}\n\nexport default FilterIcon;\n","/* eslint-disable @typescript-eslint/no-use-before-define */\n/* eslint-disable react/display-name */\n\n'use client';\n\nimport { CheckIcon } from '@heroicons/react/24/outline';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { ChevronDown, ChevronUp } from 'lucide-react';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nexport interface ISelectProps extends SelectPrimitive.SelectProps {\n options?: Array<{\n value: string;\n label: string;\n icon?: React.ReactNode | React.ElementType | string;\n disabled?: boolean;\n critical?: boolean;\n }>;\n placeholder?: React.ReactNode;\n triggerClassName?: string;\n}\n\nconst Select = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Root>,\n ISelectProps\n>(({ children, placeholder, options, triggerClassName, ...props }, ref) => {\n // 获取选中选项的图标\n const icon = options?.find((item) => item.value === props.value)?.icon;\n\n return (\n <SelectPrimitive.Root {...props}>\n {Array.isArray(options) && options.length ? (\n <>\n <SelectTrigger className={cn(triggerClassName)}>\n <div className=\"flex items-center\">\n <SelectIcon icon={icon} />\n <SelectValue placeholder={placeholder} />\n </div>\n </SelectTrigger>\n <SelectContent>\n {options.map((item, i) => (\n <SelectItem key={`${item.value}_${i}`} {...item}>\n {item.label}\n </SelectItem>\n ))}\n </SelectContent>\n </>\n ) : (\n children\n )}\n </SelectPrimitive.Root>\n );\n});\n\nconst SelectGroup = SelectPrimitive.Group;\n\nconst SelectValue = SelectPrimitive.Value;\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'flex h-10 w-full items-center justify-between rounded-md border border-Colors-Border-Default bg-Colors-Background-Neutral-On-Surface-Default text-Colors-Text-Default text-sm p-3 ring-offset-cc-Focus-Rings-Brand-default focus:shadow-cc-Focus-Rings-Brand-default placeholder:text-Colors-Text-Subtlest focus:outline-none focus:ring-0 focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-30 [&>span]:line-clamp-1 [&>.select-chevron]:aria-expanded:rotate-180',\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"select-chevron h-5 w-5 text-Colors-Foreground-Subtle duration-200\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className\n )}\n {...props}\n >\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className\n )}\n {...props}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n 'relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md\tborder border-opaque bg-Colors-Background-Normal-Primary-Default text-Colors-Text-Default shadow-cc-Shadows-Modal-default data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className\n )}\n position={position}\n {...props}\n >\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1.5 space-y-1.5',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]'\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\n 'py-1 px-3 text-sm font-medium text-Colors-Text-Subtler',\n className\n )}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\ninterface ISelectIconProps {\n icon?: React.ReactNode | React.ElementType | string;\n critical?: boolean;\n}\n\nfunction SelectIcon(props: ISelectIconProps) {\n const { icon, critical } = props;\n\n if (!icon) {\n return null;\n }\n\n return (\n <SelectPrimitive.Icon>\n {typeof icon === 'string' ? (\n // 如果是字符串URL,作为背景图片显示\n <div\n className={cn(\n 'aspect-[20/20] w-5 h-5 relative bg-cover bg-no-repeat rounded-md overflow-hidden mr-1.5',\n critical && 'text-Colors-Text-Critical-Default'\n )}\n style={{ backgroundImage: `url('${icon}')` }}\n />\n ) : React.isValidElement(icon) ? (\n // 如果是React元素,直接渲染\n <div\n className={cn(\n 'mr-1.5 w-5 h-5 text-Colors-Foreground-Default',\n critical && 'text-Colors-Foreground-Critical-Default'\n )}\n >\n {icon}\n </div>\n ) : (\n // 如果是组件类型,创建元素\n <div\n className={cn(\n 'mr-1.5 w-5 h-5 text-Colors-Foreground-Default',\n critical && 'text-Colors-Foreground-Critical-Default'\n )}\n >\n {React.createElement(icon as React.ElementType, {\n className: cn(\n 'w-5 h-5 text-Colors-Foreground-Default',\n critical && 'text-Colors-Foreground-Critical-Default'\n ),\n })}\n </div>\n )}\n </SelectPrimitive.Icon>\n );\n}\n\nSelectIcon.displayName = SelectPrimitive.Icon.displayName;\n\ninterface ISelectItemProps\n extends SelectPrimitive.SelectItemProps,\n ISelectIconProps {}\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n ISelectItemProps\n>(({ className, children, icon, critical, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex justify-between w-full text-sm cursor-pointer select-none items-center rounded-md py-1 px-1.5 outline-none',\n 'bg-Colors-Background-Normal-Secondary-Alt hover:bg-Colors-Background-Normal-Primary-Hover focus:bg-Colors-Background-Neutral-Primary-Default data-[disabled]:opacity-30 data-[disabled]:cursor-not-allowed',\n critical\n ? 'text-Colors-Text-Critical-Default'\n : 'focus:text-Colors-Text-Default',\n className\n )}\n {...props}\n >\n <span className=\"flex items-center grow\">\n <SelectIcon icon={icon} critical={critical} />\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </span>\n <span className=\"flex h-4 w-4 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4 text-Colors-Foreground-Subtle stroke-[2px]\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-border-default', className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport {\n Select,\n SelectGroup,\n SelectIcon,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n};\n","'use client';\n\nimport * as SheetPrimitive from '@radix-ui/react-dialog';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst Sheet = SheetPrimitive.Root;\n\nconst SheetTrigger = SheetPrimitive.Trigger;\n\nconst SheetClose = SheetPrimitive.Close;\n\nconst SheetPortal = SheetPrimitive.Portal;\n\nconst SheetOverlay = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(\n 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n className\n )}\n {...props}\n ref={ref}\n />\n));\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName;\n\nconst sheetVariants = cva(\n 'fixed z-50 gap-4 bg-white p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 dark:bg-slate-950',\n {\n variants: {\n side: {\n top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',\n bottom:\n 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',\n left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',\n right:\n 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',\n },\n },\n defaultVariants: {\n side: 'right',\n },\n }\n);\n\ninterface SheetContentProps\n extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,\n VariantProps<typeof sheetVariants> {}\n\nconst SheetContent = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Content>,\n SheetContentProps\n>(({ side = 'right', className, children, ...props }, ref) => (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content\n ref={ref}\n className={cn(sheetVariants({ side }), className)}\n {...props}\n >\n {children}\n <SheetPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-slate-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-slate-100 dark:ring-offset-slate-950 dark:focus:ring-slate-300 dark:data-[state=open]:bg-slate-800\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n </SheetPrimitive.Content>\n </SheetPortal>\n));\nSheetContent.displayName = SheetPrimitive.Content.displayName;\n\nconst SheetHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col space-y-2 text-center sm:text-left',\n className\n )}\n {...props}\n />\n);\nSheetHeader.displayName = 'SheetHeader';\n\nconst SheetFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',\n className\n )}\n {...props}\n />\n);\nSheetFooter.displayName = 'SheetFooter';\n\nconst SheetTitle = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Title\n ref={ref}\n className={cn(\n 'text-lg font-semibold text-slate-950 dark:text-slate-50',\n className\n )}\n {...props}\n />\n));\nSheetTitle.displayName = SheetPrimitive.Title.displayName;\n\nconst SheetDescription = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Description\n ref={ref}\n className={cn('text-sm text-slate-500 dark:text-slate-400', className)}\n {...props}\n />\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\nexport {\n Sheet,\n SheetPortal,\n SheetOverlay,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n","import { cn } from '@/lib/utils';\n\nfunction Skeleton({\n className,\n animate = true,\n ...props\n}: React.HTMLAttributes<HTMLDivElement> & { animate?: boolean }) {\n return (\n <div\n className={cn(\n 'rounded-md bg-Colors-Background-Normal-Secondary-Default',\n className,\n animate && 'animate-pulse'\n )}\n {...props}\n />\n );\n}\n\nexport { Skeleton };\n","'use client';\n\nimport * as SliderPrimitive from '@radix-ui/react-slider';\nimport * as React from 'react';\nimport { ClassNameValue } from 'tailwind-merge';\n\nimport { cn } from '@/lib/utils';\n\nimport { NumberInput } from './number-input';\n\ntype Size = 'sm' | 'lg';\nconst Slider = React.forwardRef<\n React.ElementRef<typeof SliderPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> & {\n size?: Size;\n }\n>(({ className, size = 'lg', ...props }, ref) => (\n <div className=\"w-full p-3 flex justify-center items-center h-10 rounded-lg\tborder border-Colors-Border-Default bg-Colors-Background-Normal-Primary-Active shadow-background-default text-sm text-Colors-Text-Default ring-offset-cc-Focus-Rings-Brand-default hover:border-hovered hover:bg-surface-subtle aria-[invalid=true]:border-critical aria-[invalid=true]:hover:border-Colors-Border-Critical aria-[invalid=true]:hover:bg-surface-accent-red-subtlest aria-[invalid=true]:focus-visible:ring-error file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-Colors-Text-Subtler focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-30\">\n <SliderPrimitive.Root\n ref={ref}\n className={cn(\n 'relative flex w-full touch-none select-none items-center',\n className\n )}\n {...props}\n >\n <SliderPrimitive.Track\n className={cn(\n 'relative w-full grow overflow-hidden rounded-full bg-Colors-Background-Neutral-Primary-Hover data-[disabled]:opacity-30',\n size === 'sm' ? 'h-0.5' : 'h-1.5'\n )}\n >\n <SliderPrimitive.Range className=\"absolute h-full bg-Colors-Background-Brand-Default data-[disabled]:opacity-30\" />\n </SliderPrimitive.Track>\n <SliderPrimitive.Thumb\n className={cn(\n 'block rounded-full border-Colors-Utility-Lake-Blue-40 bg-Colors-Background-Normal-Primary-Default ring-offset-cc-Focus-Rings-Brand-default transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 data-[disabled]:pointer-events-none data-[disabled]:opacity-30',\n size === 'sm' ? 'w-2 h-2 border-[1.5px]' : 'w-5 h-5 border-[3px]'\n )}\n />\n </SliderPrimitive.Root>\n </div>\n));\nSlider.displayName = SliderPrimitive.Root.displayName;\n\ninterface ISliderBaseProps\n extends React.RefAttributes<HTMLSpanElement>,\n Omit<\n SliderPrimitive.SliderProps,\n 'value' | 'defaultValue' | 'onValueChange' | 'onValueCommit'\n > {}\n\ninterface ISliderSingleProps extends ISliderBaseProps {\n size?: Size;\n value?: number;\n defaultValue?: number;\n onValueChange?: (value: number) => void;\n onValueCommit?: (value: number) => void;\n // 是否展示输入框设置器\n settable?: boolean;\n // 容器样式\n containerClassName?: ClassNameValue;\n // 轨道样式\n trackClassName?: ClassNameValue;\n // 已选范围样式\n rangeClassName?: ClassNameValue;\n // 滑块样式\n thumbClassName?: ClassNameValue;\n}\n\nconst SliderSingle = React.forwardRef<\n React.ElementRef<React.ForwardRefExoticComponent<ISliderSingleProps>>,\n React.ComponentPropsWithoutRef<\n React.ForwardRefExoticComponent<ISliderSingleProps>\n >\n>(\n (\n {\n className,\n containerClassName,\n trackClassName,\n rangeClassName,\n thumbClassName,\n size = 'lg',\n value,\n defaultValue,\n onValueChange,\n onValueCommit,\n settable = true,\n ...props\n },\n ref\n ) => (\n <div className=\"flex w-full items-center space-x-1.5\">\n <div\n className={cn(\n 'w-full p-3 flex justify-center items-center h-10 rounded-lg border border-Colors-Border-Default bg-Colors-Background-Normal-Primary-Active shadow-background-default text-sm text-Colors-Text-Default ring-offset-cc-Focus-Rings-Brand-default hover:border-hovered hover:bg-surface-subtle aria-[invalid=true]:border-critical aria-[invalid=true]:hover:border-Colors-Border-Critical aria-[invalid=true]:hover:bg-surface-accent-red-subtlest aria-[invalid=true]:focus-visible:ring-error file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-Colors-Text-Subtler focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-30',\n containerClassName\n )}\n >\n <SliderPrimitive.Root\n ref={ref}\n className={cn(\n 'relative flex w-full touch-none select-none items-center',\n className\n )}\n value={typeof value === 'number' ? [value] : value}\n defaultValue={\n typeof defaultValue === 'number' ? [defaultValue] : defaultValue\n }\n onValueChange={(rootValue: number[]) =>\n onValueChange?.(rootValue?.[0])\n }\n onValueCommit={(rootValue: number[]) =>\n onValueCommit?.(rootValue?.[0])\n }\n {...props}\n >\n <SliderPrimitive.Track\n className={cn(\n 'relative w-full grow overflow-hidden rounded-full bg-Colors-Background-Neutral-Primary-Hover data-[disabled]:opacity-30',\n size === 'sm' ? 'h-0.5' : 'h-1.5',\n trackClassName\n )}\n >\n <SliderPrimitive.Range\n className={cn(\n 'absolute h-full bg-Colors-Background-Brand-Default data-[disabled]:opacity-30',\n rangeClassName\n )}\n />\n </SliderPrimitive.Track>\n <SliderPrimitive.Thumb\n className={cn(\n 'cursor-pointer block rounded-full border-Colors-Utility-Lake-Blue-40 bg-Colors-Background-Normal-Primary-Default ring-offset-cc-Focus-Rings-Brand-default transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 data-[disabled]:pointer-events-none data-[disabled]:opacity-30',\n size === 'sm' ? 'w-2 h-2 border-[1.5px]' : 'w-5 h-5 border-[3px]',\n thumbClassName\n )}\n />\n </SliderPrimitive.Root>\n </div>\n {settable && (\n <div className=\"flex-shrink-0 w-14 h-9 flex justify-center items-center rounded-lg\">\n <NumberInput\n value={value}\n min={props?.min}\n max={props?.max}\n step={props?.step}\n controls={false}\n defaultValue={defaultValue}\n onChange={(e) => onValueChange?.(Number(e.target.value))}\n />\n </div>\n )}\n </div>\n )\n);\nSliderSingle.displayName = 'SliderSingle';\n\nexport { Slider, SliderSingle };\n","import { VariantProps, cva } from 'class-variance-authority';\nimport { Loader2 } from 'lucide-react';\nimport { ClassNameValue } from 'tailwind-merge';\n\nimport { cn } from '@/lib/utils';\n\nconst spinnerVariants = cva('animate-spin', {\n variants: {\n size: {\n '2xs': 'h-3.5 w-3.5',\n xs: 'h-4 w-4',\n sm: 'h-5 w-5',\n md: 'h-6 w-6',\n xl: 'h-7 w-7',\n lg: 'h-9 w-9',\n },\n speed: {\n slow: 'duration-2000',\n default: 'duration-600',\n fast: 'duration-500',\n },\n color: {\n default: 'text-Colors-Text-Default',\n brand: 'text-Colors-Text-Brand-Default',\n static: 'text-Colors-Text-Static-White',\n warning: 'text-Colors-Text-Warning-Default',\n success: 'text-Colors-Text-Success-Default',\n },\n },\n defaultVariants: {\n size: 'md',\n speed: 'default',\n color: 'default',\n },\n});\ninterface SpinnerProps extends VariantProps<typeof spinnerVariants> {\n className?: ClassNameValue;\n}\n\nexport default function Spinner(props: SpinnerProps) {\n const { size, speed, color, className } = props;\n\n return (\n <Loader2\n className={cn(spinnerVariants({ size, speed, color }), className)}\n />\n );\n}\n","'use client';\n\nimport * as SwitchPrimitives from '@radix-ui/react-switch';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst switchSize = {\n sm: 'w-7 h-4',\n md: 'w-[34px] h-5',\n lg: 'w-10 h-6',\n} as const;\n\nconst switchRootVariants = cva(\n 'peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-2 data-[state=unchecked]:focus-visible:bg-cc-Switch-bg-default disabled:cursor-not-allowed disabled:opacity-30 data-[state=\"checked\"]:bg-cc-Switch-bg-on data-[state=\"unchecked\"]:bg-cc-Switch-bg-default',\n {\n variants: {\n size: switchSize,\n },\n defaultVariants: {\n size: 'lg',\n },\n }\n);\n\nconst switchThumbVariants = cva(\n 'pointer-events-none block rounded-full bg-cc-Switch-fg-on ring-0 transition-transform data-[state=unchecked]:translate-x-0',\n {\n variants: {\n size: {\n sm: 'w-3 h-3 data-[state=checked]:translate-x-3',\n md: 'w-4 h-4 data-[state=checked]:translate-x-[14px]',\n lg: 'w-5 h-5 data-[state=checked]:translate-x-4',\n },\n },\n defaultVariants: {\n size: 'lg',\n },\n }\n);\n\nconst Switch = React.forwardRef<\n React.ElementRef<typeof SwitchPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> &\n VariantProps<typeof switchRootVariants> & {\n label?: string;\n labelClassName?: string;\n }\n>(({ className, size, label, labelClassName, ...props }, ref) => {\n const Component = label ? 'div' : React.Fragment;\n return (\n <Component className=\"flex items-center justify-center space-x-1.5 text-Colors-Text-Default\">\n <SwitchPrimitives.Root\n className={cn(switchRootVariants({ size }), className, '')}\n {...props}\n ref={ref}\n >\n <SwitchPrimitives.Thumb className={cn(switchThumbVariants({ size }))} />\n </SwitchPrimitives.Root>\n {label && <span className={cn('text-sm', labelClassName)}>{label}</span>}\n </Component>\n );\n});\nSwitch.displayName = SwitchPrimitives.Root.displayName;\n\nexport { Switch };\n","'use client';\n\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\nimport { cva } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport Badge from './badge';\nimport { Icon } from './icon';\nimport Link from './link';\nimport { Tooltip } from './tooltip';\nimport { Text } from './typography';\n\ntype TItems = {\n label?: string;\n value: string;\n count?: number | string;\n tooltip?: {\n description?: string;\n open?: boolean;\n variant?: 'default' | 'info' | 'message';\n };\n icon?: React.ElementType;\n disabled?: boolean;\n link?: string;\n hasUnRead?: boolean;\n children?: string | React.ReactNode;\n className?: string;\n onClickCallback?: (value: string) => void;\n};\n\nconst tabListVariants = cva(\n 'relative inline-flex items-center justify-center overflow-hidden',\n {\n variants: {\n size: {\n sm: 'h-6',\n md: 'h-9',\n lg: 'h-12',\n },\n variant: {\n button:\n 'w-full border border-Colors-Border-Default bg-Colors-Background-Neutral-Primary-Default p-0.5',\n underline: 'border-b border-Colors-Border-Default space-x-6',\n icon: 'border border-Colors-Border-Default bg-Colors-Background-Neutral-Primary-Default p-0.5',\n },\n rounded: {\n default: '',\n full: 'rounded-full',\n },\n },\n compoundVariants: [\n {\n variant: 'button',\n size: 'lg',\n className: 'min-w-[320px]',\n },\n {\n variant: 'button',\n size: 'md',\n className: 'min-w-[218px]',\n },\n {\n variant: 'button',\n size: 'sm',\n className: 'min-w-[180px]',\n },\n {\n variant: 'underline',\n size: 'lg',\n className: 'h-8',\n },\n {\n variant: 'underline',\n size: 'md',\n className: 'h-7',\n },\n {\n variant: 'underline',\n size: 'sm',\n className: 'h-6',\n },\n {\n rounded: 'default',\n size: 'lg',\n className: 'rounded-xl',\n },\n {\n rounded: 'default',\n size: 'md',\n className: 'rounded-lg',\n },\n {\n rounded: 'default',\n size: 'sm',\n className: 'rounded-md',\n },\n ],\n defaultVariants: {\n size: 'lg',\n variant: 'button',\n rounded: 'default',\n },\n }\n);\n\nconst tabVariants = cva(\n 'relative inline-flex w-full h-full items-center justify-center overflow-hidden whitespace-nowrap font-medium text-Colors-Text-Subtler aria-[selected=true]:text-Colors-Text-Brand-Default aria-[selected=true]:bg-Colors-Background-Normal-Primary-Active aria-[selected=true]:shadow-background-default [&>div>span]:hover:text-Colors-Text-Brand-Default disabled:pointer-events-none disabled:text-Colors-Text-Disabled [&>div>span]:disabled:text-Colors-Text-Disabled data-[state=active]:text-Colors-Text-Brand-Default',\n {\n variants: {\n size: {\n sm: 'text-xs',\n md: 'text-sm',\n lg: 'text-base',\n },\n variant: {\n button:\n 'px-3 py-2.5 flex-1 rounded-full transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-Colors-Background-Normal-Primary-Active data-[state=active]:shadow-background-default ',\n underline:\n 'flex items-baseline pb-2 rounded-none data-[state=active]:border-b-2 data-[state=active]:border-b-brand',\n icon: 'px-4',\n },\n rounded: {\n default: '',\n full: 'rounded-full',\n },\n },\n compoundVariants: [\n {\n rounded: 'default',\n size: 'lg',\n className: 'rounded-xl',\n },\n {\n rounded: 'default',\n size: 'md',\n className: 'rounded-lg',\n },\n {\n rounded: 'default',\n size: 'sm',\n className: 'rounded-md',\n },\n ],\n defaultVariants: {\n size: 'lg',\n variant: 'button',\n rounded: 'default',\n },\n }\n);\n\nconst Tabs = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> & {\n variant?: 'button' | 'underline' | 'icon';\n size?: 'sm' | 'md' | 'lg';\n rounded?: 'default' | 'full';\n /**\n * 是否为链接\n */\n isLink?: boolean;\n listClassName?: string;\n items?: TItems[];\n }\n>(\n (\n {\n className,\n listClassName,\n variant = 'button',\n size,\n isLink = false,\n rounded = 'default',\n items,\n ...props\n },\n ref\n ) => (\n <TabsPrimitive.Root ref={ref} className={cn(className)} {...props}>\n <div className=\"w-full flex justify-center items-center\">\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n '',\n tabListVariants({ variant, size, rounded }),\n listClassName\n )}\n {...props}\n >\n {items?.map((item) => {\n return (\n <Tab\n key={item.value}\n isLink={isLink}\n variant={variant}\n size={size}\n rounded={rounded}\n {...item}\n />\n );\n })}\n </TabsPrimitive.List>\n </div>\n {!isLink && (\n <div className=\"w-full\">\n {items?.map((item) => {\n return (\n <TabsContent value={item.value}>{item.children}</TabsContent>\n );\n })}\n </div>\n )}\n </TabsPrimitive.Root>\n )\n);\nTabs.displayName = TabsPrimitive.Root.displayName;\n\nconst Tab = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger> & {\n variant?: 'button' | 'underline' | 'icon';\n size?: 'sm' | 'md' | 'lg';\n rounded?: 'default' | 'full';\n isLink?: boolean;\n link?: string;\n count?: number | string;\n label?: string;\n icon?: React.ElementType;\n tooltip?: {\n description?: string;\n open?: boolean;\n variant?: 'default' | 'info' | 'message';\n };\n hasUnRead?: boolean;\n onClickCallback?: (value: string) => void;\n }\n>(\n (\n {\n className,\n variant,\n size,\n isLink,\n link,\n count,\n label,\n icon,\n tooltip,\n hasUnRead,\n rounded = 'default',\n onClickCallback,\n ...props\n },\n ref\n ) => {\n return (\n <Tooltip triggerClassName=\"w-full h-full flex-1\" {...tooltip}>\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'tabtrigger min-w-fit',\n tabVariants({ variant, size, rounded }),\n className\n )}\n {...props}\n onClick={(e) => {\n e.stopPropagation();\n onClickCallback?.(props.value);\n }}\n >\n {isLink && link ? (\n <Link\n prefetch\n href={link}\n className={cn(\n 'relative h-full w-full flex justify-center items-center'\n )}\n onClick={(e) => () => {\n e.preventDefault();\n }}\n >\n {label}\n {hasUnRead && <Badge className=\"-mt-2.5\" />}\n </Link>\n ) : (\n <div className=\"relative flex justify-center items-center\">\n {label && <Text className=\"text-inherit\">{label}</Text>}\n {icon && (\n <Icon component={icon} size=\"md\" className=\"text-inherit\" />\n )}\n {count ? (\n <Text size=\"sm\" className=\"ml-1 text-Colors-Text-Subtlest\">\n {count}\n </Text>\n ) : null}\n {hasUnRead && <Badge className=\"-mt-2.5\" />}\n </div>\n )}\n </TabsPrimitive.Trigger>\n </Tooltip>\n );\n }\n);\nTab.displayName = TabsPrimitive.Trigger.displayName;\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => {\n return (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n 'mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0',\n className\n )}\n {...props}\n />\n );\n});\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\nexport { Tabs, Tab, TabsContent };\n","import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Text } from './typography';\n\nexport type TextareaProps =\n React.TextareaHTMLAttributes<HTMLTextAreaElement> & {\n maxLengthClassName?: string;\n };\nconst Textarea = React.forwardRef<\n HTMLTextAreaElement,\n TextareaProps & { error?: string }\n>(\n (\n { className, maxLength, value, error, maxLengthClassName, ...props },\n ref\n ) => {\n return (\n <div>\n <div className=\"relative\">\n <textarea\n className={cn(\n 'w-full min-h-[123px] p-3 pb-10 rounded-lg border border-Colors-Border-Default bg-Colors-Background-Normal-Primary-Active ',\n 'text-sm text-Colors-Text-Default placeholder:text-Colors-Text-Subtlest ring-offset-cc-Focus-Rings-Brand-default',\n 'hover:border-hovered bg-cc-Input-bg-default hover:bg-cc-Input-bg-hover disabled:bg-cc-Input-bg-disabled aria-[invalid=true]:border-Colors-Border-Critical aria-[invalid=true]:hover:bg-Colors-Background-Critical-Subtle',\n 'aria-[invalid=true]:focus-visible:ring-error file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-Colors-Text-Subtler',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-30',\n (maxLength && (value?.toString()?.length || 0) > maxLength) ||\n error\n ? 'border-Colors-Border-Critical hover:bg-Colors-Background-Critical-Subtle focus-visible:ring-error'\n : '',\n className\n )}\n ref={ref}\n maxLength={maxLength}\n value={value}\n {...props}\n />\n {maxLength ? (\n <div\n className={cn(\n 'absolute text-right bottom-5 right-4 border-Colors-Border-Default',\n maxLengthClassName\n )}\n >\n <Text size=\"sm\" color=\"subtlest\">{`${\n value?.toString()?.length || 0\n }/${maxLength}`}</Text>\n </div>\n ) : null}\n </div>\n {error && (\n <div className=\"w-full\">\n <Text\n className=\"text-wrap\"\n size=\"sm\"\n weight=\"regular\"\n color=\"critical\"\n >\n {error}\n </Text>\n </div>\n )}\n </div>\n );\n }\n);\nTextarea.displayName = 'Textarea';\n\nexport { Textarea };\n","'use client';\n\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst toggleVariants = cva(\n 'inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-white text-Colors-Text-Subtlest hover:bg-slate-100 hover:text-slate-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-Colors-Background-Normal-Primary-Active data-[state=on]:text-Colors-Text-Brand-Default [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2 dark:ring-offset-slate-950 dark:hover:bg-slate-800 dark:hover:text-Colors-Text-Brand-Default dark:focus-visible:ring-slate-300 dark:data-[state=on]:bg-Colors-Background-Normal-Primary-Active dark:data-[state=on]:text-Colors-Text-Brand-Default',\n {\n variants: {\n variant: {\n default: 'bg-transparent',\n outline:\n 'border border-slate-200 bg-transparent hover:bg-slate-100 hover:text-slate-900 dark:border-slate-800 dark:hover:bg-slate-800 dark:hover:text-slate-50',\n },\n size: {\n default: 'h-10 px-3 min-w-10',\n sm: 'h-9 px-2.5 min-w-9',\n lg: 'h-11 px-5 min-w-11',\n xs: 'h-5 min-w-8 text-xs px-3',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n);\n\nconst Toggle = React.forwardRef<\n React.ElementRef<typeof TogglePrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &\n VariantProps<typeof toggleVariants>\n>(({ className, variant, size, ...props }, ref) => (\n <TogglePrimitive.Root\n ref={ref}\n className={cn(toggleVariants({ variant, size, className }))}\n {...props}\n />\n));\n\nToggle.displayName = TogglePrimitive.Root.displayName;\n\nexport { Toggle, toggleVariants };\n","'use client';\n\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { toggleVariants } from './toggle';\nimport { cn } from '@/lib/utils';\n\nconst ToggleGroupContext = React.createContext<\n VariantProps<typeof toggleVariants>\n>({\n size: 'default',\n variant: 'default',\n});\n\nconst ToggleGroup = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &\n VariantProps<typeof toggleVariants>\n>(({ className, variant, size, children, ...props }, ref) => (\n <ToggleGroupPrimitive.Root\n ref={ref}\n className={cn(\n 'flex items-center justify-center gap-1 p-0.5 rounded-md border border-Colors-Border-Default bg-Colors-Background-Neutral-Primary-Default',\n className\n )}\n {...props}\n >\n <ToggleGroupContext.Provider value={{ variant, size }}>\n {children}\n </ToggleGroupContext.Provider>\n </ToggleGroupPrimitive.Root>\n));\n\nToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;\n\nconst ToggleGroupItem = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &\n VariantProps<typeof toggleVariants>\n>(({ className, children, variant, size, ...props }, ref) => {\n const context = React.useContext(ToggleGroupContext);\n\n return (\n <ToggleGroupPrimitive.Item\n ref={ref}\n className={cn(\n toggleVariants({\n variant: context.variant || variant,\n size: context.size || size,\n }),\n className\n )}\n {...props}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n );\n});\n\nToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;\n\nexport { ToggleGroup, ToggleGroupItem };\n","'use client';\n\nimport * as ToastPrimitives from '@radix-ui/react-toast';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\nimport { cn } from '@/lib/utils';\nimport XMarkIcon from '@heroicons/react/24/outline/esm/XMarkIcon';\n\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst viewportPositionVariants = cva(\n 'fixed z-[1000001] flex max-h-screen w-full p-0 gap-2',\n {\n variants: {\n position: {\n 'top-left': 'top-6 left-6 flex-col items-start',\n 'top-center': 'top-6 left-1/2 -translate-x-1/2 flex-col items-center',\n 'top-right': 'top-6 right-6 flex-col items-end',\n 'bottom-left': 'bottom-6 left-6 flex-col-reverse items-start',\n 'bottom-center':\n 'bottom-6 left-1/2 -translate-x-1/2 flex-col-reverse items-center',\n 'bottom-right': 'bottom-6 right-6 flex-col-reverse items-end',\n 'left-center': 'left-6 top-1/2 -translate-y-1/2 flex-row items-center',\n 'right-center':\n 'right-6 top-1/2 -translate-y-1/2 flex-row-reverse items-center',\n },\n },\n defaultVariants: {\n position: 'top-right',\n },\n }\n);\n\ninterface ToastViewportProps\n extends React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport> {\n position?:\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right'\n | 'left-center'\n | 'right-center';\n}\n\nconst ToastViewport = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Viewport>,\n ToastViewportProps\n>(({ className, position, ...props }, ref) => (\n <ToastPrimitives.Viewport\n ref={ref}\n className={cn(viewportPositionVariants({ position }), className)}\n {...props}\n />\n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\n\nconst toastVariants = cva(\n 'group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border border-Colors-Border-Opaque p-6 pr-8 shadow-modal-default transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 max-w-md',\n {\n variants: {\n variant: {\n info: 'bg-Colors-Background-Normal-Primary-Default p-4',\n warning: 'bg-Colors-Background-Normal-Primary-Default p-4',\n error: 'bg-Colors-Background-Normal-Primary-Default p-4',\n success: 'bg-Colors-Background-Normal-Primary-Default p-4',\n },\n position: {\n 'top-left':\n 'data-[state=open]:slide-in-from-left-full data-[state=closed]:slide-out-to-left-full',\n 'top-center':\n 'data-[state=open]:slide-in-from-top-full data-[state=closed]:slide-out-to-top-full',\n 'top-right':\n 'data-[state=open]:slide-in-from-right-full data-[state=closed]:slide-out-to-right-full',\n 'bottom-left':\n 'data-[state=open]:slide-in-from-left-full data-[state=closed]:slide-out-to-left-full',\n 'bottom-center':\n 'data-[state=open]:slide-in-from-bottom-full data-[state=closed]:slide-out-to-bottom-full',\n 'bottom-right':\n 'data-[state=open]:slide-in-from-right-full data-[state=closed]:slide-out-to-right-full',\n 'left-center':\n 'data-[state=open]:slide-in-from-left-full data-[state=closed]:slide-out-to-left-full',\n 'right-center':\n 'data-[state=open]:slide-in-from-right-full data-[state=closed]:slide-out-to-right-full',\n },\n },\n defaultVariants: {\n variant: 'info',\n position: 'top-right',\n },\n }\n);\n\nconst Toast = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &\n VariantProps<typeof toastVariants>\n>(({ className, variant, position, ...props }, ref) => {\n return (\n <ToastPrimitives.Root\n ref={ref}\n className={cn(toastVariants({ variant, position }), className)}\n data-position={position}\n {...props}\n />\n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\n\nconst ToastAction = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Action>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Action\n ref={ref}\n className={cn(\n 'inline-flex h-8 shrink-0 items-center justify-center rounded-md border border-slate-200 bg-transparent px-3 text-sm font-medium ring-offset-white transition-colors hover:bg-slate-100 focus:outline-none focus:ring-2 focus:ring-slate-950 focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-slate-100/40 group-[.destructive]:hover:border-red-500/30 group-[.destructive]:hover:bg-red-500 group-[.destructive]:hover:text-slate-50 group-[.destructive]:focus:ring-red-500 dark:border-slate-800 dark:ring-offset-slate-950 dark:hover:bg-slate-800 dark:focus:ring-slate-300 dark:group-[.destructive]:border-slate-800/40 dark:group-[.destructive]:hover:border-red-900/30 dark:group-[.destructive]:hover:bg-red-900 dark:group-[.destructive]:hover:text-slate-50 dark:group-[.destructive]:focus:ring-red-900',\n className\n )}\n {...props}\n />\n));\nToastAction.displayName = ToastPrimitives.Action.displayName;\n\nconst ToastClose = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Close>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Close\n ref={ref}\n className={cn(\n 'absolute right-4 top-4 rounded-md p-1 text-slate-950/50 transition-opacity hover:text-slate-950 outline-none focus:outline-none focus:ring-2 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600 dark:text-slate-50/50 dark:hover:text-slate-50',\n className\n )}\n toast-close=\"\"\n {...props}\n >\n <XMarkIcon className=\"h-5 w-5\" />\n </ToastPrimitives.Close>\n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\n\nconst ToastTitle = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Title>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Title\n ref={ref}\n className={cn('text-sm font-semibold', className)}\n {...props}\n />\n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\n\nconst ToastDescription = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Description>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Description\n ref={ref}\n className={cn('text-sm opacity-90', className)}\n {...props}\n />\n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;\n\ntype ToastActionElement = React.ReactElement<typeof ToastAction>;\n\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction,\n};\n","'use client';\n\nimport CheckCircleIcon from '@heroicons/react/24/outline/esm/CheckCircleIcon';\nimport ExclamationCircleIcon from '@heroicons/react/24/outline/esm/ExclamationCircleIcon';\nimport InformationCircleIcon from '@heroicons/react/24/outline/esm/InformationCircleIcon';\nimport XCircleIcon from '@heroicons/react/24/outline/esm/XCircleIcon';\n\nimport {\n Toast,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n} from './toast';\nimport { useToast } from './use-toast';\nimport { cn } from '@/lib/utils';\nimport React from 'react';\n\ntype ToastVariant = 'info' | 'success' | 'warning' | 'error' | null | undefined;\n\nexport interface ToasterProps {\n position?:\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right'\n | 'left-center'\n | 'right-center';\n}\n\nexport function Toaster({ position = 'top-right' }: ToasterProps = {}) {\n const { toasts } = useToast();\n\n // 按位置分组\n const positionGroups = React.useMemo(() => {\n const groups: Record<string, typeof toasts> = {};\n\n const allPositions = [\n 'top-left',\n 'top-center',\n 'top-right',\n 'bottom-left',\n 'bottom-center',\n 'bottom-right',\n 'left-center',\n 'right-center',\n ];\n\n // 初始化所有位置组\n allPositions.forEach((pos) => {\n groups[pos] = [];\n });\n\n // 将每个Toast按其position分组,如果没有指定则使用默认位置\n toasts.forEach((toast) => {\n const toastPosition = toast.position || position;\n if (groups[toastPosition]) {\n groups[toastPosition].push(toast);\n } else {\n // 如果位置不在预定义列表中,则使用默认位置\n groups[position].push(toast);\n }\n });\n\n return groups;\n }, [toasts, position]);\n\n const renderToast = (toast: any) => {\n const {\n id,\n title,\n description,\n action,\n variant,\n position: toastPosition,\n } = toast;\n\n const renderIcon = (variant: ToastVariant) => {\n switch (variant) {\n case 'info':\n return (\n <InformationCircleIcon className=\"h-6 w-6 text-cc-Icon-Featured-icon-fg-Info\" />\n );\n case 'success':\n return (\n <CheckCircleIcon className=\"h-6 w-6 text-cc-Icon-Featured-icon-fg-Success\" />\n );\n case 'warning':\n return (\n <ExclamationCircleIcon className=\"h-6 w-6 text-cc-Icon-Featured-icon-fg-Warning\" />\n );\n case 'error':\n return (\n <XCircleIcon className=\"h-6 w-6 text-cc-Icon-Featured-icon-fg-Error\" />\n );\n }\n };\n\n const getBackgroundColor = (variant: ToastVariant) => {\n switch (variant) {\n case 'info':\n return 'bg-Colors-Background-Info-Default';\n case 'success':\n return 'bg-Colors-Background-Success-Default';\n case 'warning':\n return 'bg-Colors-Background-Warning-Default';\n case 'error':\n return 'bg-Colors-Background-Critical-Default';\n }\n };\n\n return (\n <Toast key={id} {...toast} position={toastPosition}>\n <div className=\"flex flex-col gap-3\">\n <div className=\"flex items-start gap-3\">\n <div\n className={cn(\n 'flex h-10 w-10 flex-shrink-0 flex-grow-0 items-center justify-center rounded-full',\n getBackgroundColor(variant)\n )}\n >\n {renderIcon(variant)}\n </div>\n <div className=\"grid gap-1\">\n {title && (\n <ToastTitle className=\"text-base text-Colors-Text-Default\">\n {title}\n </ToastTitle>\n )}\n {description && (\n <ToastDescription className=\"text-sm text-Colors-Text-Subtle\">\n {description}\n </ToastDescription>\n )}\n {action}\n </div>\n </div>\n </div>\n <ToastClose />\n </Toast>\n );\n };\n\n return (\n <ToastProvider>\n {/* 为每个位置渲染一个ToastViewport */}\n {Object.entries(positionGroups).map(([pos, toastsForPosition]) => (\n <React.Fragment key={pos}>\n {toastsForPosition.map(renderToast)}\n {toastsForPosition.length > 0 && (\n <ToastViewport position={pos as any} />\n )}\n </React.Fragment>\n ))}\n </ToastProvider>\n );\n}\n","'use client';\n\n// Inspired by react-hot-toast library\nimport * as React from 'react';\nimport { ToastActionElement, ToastProps } from './toast';\nimport { Text } from '../typography';\nimport Link from '../link';\nconst TOAST_LIMIT = 8;\nconst TOAST_REMOVE_DELAY = 1000;\n\ntype ToasterToast = ToastProps & {\n id: string;\n title?: React.ReactNode;\n description?: React.ReactNode;\n action?: ToastActionElement;\n};\n\nconst actionTypes = {\n ADD_TOAST: 'ADD_TOAST',\n UPDATE_TOAST: 'UPDATE_TOAST',\n DISMISS_TOAST: 'DISMISS_TOAST',\n REMOVE_TOAST: 'REMOVE_TOAST',\n} as const;\n\nlet count = 0;\n\nfunction genId() {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n\n return count.toString();\n}\n\ntype ActionType = typeof actionTypes;\n\ntype Action =\n | {\n type: ActionType['ADD_TOAST'];\n toast: ToasterToast;\n }\n | {\n type: ActionType['UPDATE_TOAST'];\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionType['DISMISS_TOAST'];\n toastId?: ToasterToast['id'];\n }\n | {\n type: ActionType['REMOVE_TOAST'];\n toastId?: ToasterToast['id'];\n };\n\ninterface State {\n toasts: ToasterToast[];\n}\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: 'REMOVE_TOAST',\n toastId,\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case 'ADD_TOAST':\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\n };\n\n case 'UPDATE_TOAST':\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === action.toast.id ? { ...t, ...action.toast } : t\n ),\n };\n\n case 'DISMISS_TOAST': {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t\n ),\n };\n }\n case 'REMOVE_TOAST':\n if (action.toastId === undefined) {\n return {\n ...state,\n toasts: [],\n };\n }\n\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n };\n }\n};\n\nconst listeners: Array<(state: State) => void> = [];\n\nlet memoryState: State = { toasts: [] };\n\nfunction dispatch(action: Action) {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n}\n\ntype Toast = Omit<ToasterToast, 'id'> & {\n actions?: {\n dismissText?: string;\n view?: string;\n viewUrl?: string;\n };\n toastId?: string;\n position?:\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right'\n | 'left-center'\n | 'right-center';\n};\n\nfunction toast({ actions, toastId, position, ...props }: Toast) {\n const id = toastId || genId();\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: 'UPDATE_TOAST',\n toast: { ...props, id },\n });\n const dismiss = () => dispatch({ type: 'DISMISS_TOAST', toastId: id });\n\n dispatch({\n type: 'ADD_TOAST',\n toast: {\n ...props,\n position,\n ...(actions && {\n action: (\n <div className=\"flex justify-start items-center gap-2\">\n {actions?.dismissText && (\n <Text\n size=\"sm\"\n weight=\"medium\"\n color=\"brand\"\n className=\"cursor-pointer\"\n onClick={() => {\n dismiss();\n }}\n >\n {actions?.dismissText}\n </Text>\n )}\n {actions?.view && actions.viewUrl && (\n <Link\n href={actions.viewUrl}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n >\n <div className=\"flex items-center gap-1.5\">\n <Text\n size=\"sm\"\n weight=\"medium\"\n color=\"default\"\n className=\"cursor-pointer\"\n >\n {actions.view}\n </Text>\n </div>\n </Link>\n )}\n </div>\n ),\n }),\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n },\n });\n\n return {\n id,\n dismiss,\n update,\n };\n}\n\nfunction useToast() {\n const [state, setState] = React.useState<State>(memoryState);\n\n React.useEffect(() => {\n listeners.push(setState);\n\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, [state]);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) => dispatch({ type: 'DISMISS_TOAST', toastId }),\n };\n}\n\nexport { toast, useToast };\n","/* eslint-disable import/order */\n\n'use client';\n\nimport { cva } from 'class-variance-authority';\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport type { Swiper as SwiperType } from 'swiper';\nimport { useRouter } from 'next/navigation';\nimport {\n Autoplay,\n Navigation,\n FreeMode,\n Scrollbar,\n Mousewheel,\n Grid,\n} from 'swiper/modules';\nimport { Swiper as SwiperComponent, SwiperSlide } from 'swiper/react';\nimport type { AutoplayOptions } from 'swiper/types';\n\n/* eslint-disable import/no-unassigned-import */\nimport 'swiper/css';\n// import 'swiper/swiper-bundle.css';\nimport 'swiper/css/navigation';\nimport 'swiper/css/free-mode';\nimport 'swiper/css/grid';\nimport 'swiper/css/pagination';\n// import 'swiper/css/scrollbar';\n\nimport { cn } from '@/lib/utils';\nimport styles from './index.module.scss';\n\nconst swiperVariants = cva('', {\n variants: {\n rounded: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n default: 'rounded',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n '3xl': 'rounded-3xl',\n full: 'rounded-full',\n },\n },\n defaultVariants: {\n rounded: 'none',\n },\n});\n\nexport interface SwiperProps {\n /**\n * 轮播间隔延迟毫秒\n */\n delay?: number;\n /**\n * 是否自动播放\n */\n autoplay?: boolean;\n /**\n * 是否循环\n */\n loop?: boolean;\n /**\n * 一屏显示slider数量,number|'auto'\n */\n slidesPerView?: number | 'auto';\n /**\n * 轮播数据\n */\n dataList: any;\n /**\n * 轮播类型 ,目前是特殊的'banner' | 'featured',其他自由配置\n */\n swiperType: 'default' | 'banner' | 'featured' | 'grid';\n /**\n * 行数,仅在swiperType为'grid'时生效\n */\n gridRows?: number;\n /**\n * 轮播子组件\n */\n component?: React.ElementType;\n /**\n * Swiperbox样式覆盖\n */\n className?: string;\n /**\n * Swiper item样式覆盖\n */\n componentClassName?: string;\n /**\n * Swiper Slide item样式覆盖\n */\n slideClassName?: string;\n // todo del\n rounded?:\n | 'none'\n | 'sm'\n | 'default'\n | 'md'\n | 'lg'\n | 'xl'\n | '2xl'\n | '3xl'\n | 'full';\n /**\n * 从哪里来,点击跳转时带在url上\n */\n from?: string;\n\n /**\n * 是否居中显示\n */\n centeredSlides?: boolean;\n\n // 间距\n spaceBetween?: number;\n /**\n * 是否是移动端\n */\n isMobile?: boolean;\n}\n\nexport function Swiper(props: SwiperProps) {\n const {\n className,\n componentClassName,\n slideClassName,\n rounded = 'none',\n delay = 4000,\n loop = true,\n slidesPerView = 1,\n dataList = [],\n swiperType = 'default',\n from = '',\n component,\n autoplay,\n spaceBetween = 12,\n centeredSlides = true,\n gridRows = 3,\n isMobile = false,\n } = props;\n const isBanner = swiperType === 'banner';\n const isFeatured = swiperType === 'featured';\n const isGrid = swiperType === 'grid';\n const router = useRouter();\n const Com = component || 'div';\n const swiperList = useMemo(() => {\n const { length } = dataList;\n if (length < 2 || isGrid || isFeatured) {\n return dataList;\n }\n\n // 抽出最后一个元素放在开头,确保UI逻辑正确\n const newList = dataList.slice(0);\n const last = newList.pop()!;\n newList.unshift(last);\n\n return newList;\n }, [dataList]);\n\n const autoPlayOptions: AutoplayOptions = {\n delay,\n };\n\n const swiperRef = useRef<SwiperType>();\n const fgconfigs = {\n 0: {\n slidesPerView: 1.014,\n spaceBetween: 12,\n },\n 590: {\n slidesPerView: 2.1,\n slidesPerGroup: 2,\n },\n 768: {\n slidesPerView: 1,\n },\n 1024: {\n slidesPerView: 2,\n slidesPerGroup: 2,\n },\n 1280: {\n slidesPerView: 3,\n slidesPerGroup: 3,\n },\n 1536: {\n slidesPerView: 4,\n slidesPerGroup: 4,\n },\n };\n const breakpoints = {\n default: {},\n banner: {\n 769: {\n spaceBetween: 20,\n },\n },\n featured: fgconfigs,\n grid: fgconfigs,\n };\n const swiperConfigs = {\n spaceBetween: isFeatured ? 20 : isGrid ? 0 : spaceBetween,\n autoplay:\n swiperList?.length > 1 && (autoplay || isBanner)\n ? autoPlayOptions\n : false,\n loop: !isFeatured && !isGrid && swiperList?.length > 1 ? loop : false,\n slidesPerView: isBanner ? 'auto' : slidesPerView,\n centeredSlides: isGrid || isFeatured ? false : centeredSlides,\n initialSlide: isBanner ? 1 : 0,\n navigation: !isGrid,\n freeMode: (isFeatured || isGrid) && !isMobile,\n scrollbar: (isFeatured || isGrid) && !isMobile,\n\n ...((isFeatured || isGrid) && !isMobile\n ? {\n mousewheel: {\n forceToAxis: true, // 仅水平滚动\n },\n }\n : {}),\n ...(isGrid ? { grid: { rows: gridRows } } : {}),\n modules: [Autoplay, Navigation, FreeMode, Scrollbar, Mousewheel, Grid],\n };\n\n const [animate, setAnimate] = useState(false);\n useEffect(() => {\n // delay transition animation.\n // because swiper.js add `.swiper-slide-prev`/`.swiper-slide-next` in a delay,\n // which will introduced an unexpected animated when first load.\n setTimeout(() => {\n setAnimate(true);\n }, 200);\n }, []);\n\n const handleSlideItemClick = (\n e: React.MouseEvent<HTMLDivElement>,\n gotoUrl: string,\n index: number\n ) => {\n const swiper = swiperRef.current;\n if (!swiper) {\n return;\n }\n if (swiper.realIndex === index) {\n const hasParam = gotoUrl.includes('?') ? '&' : '?';\n // goToHandle?.(`${gotoUrl}${hasParam}from=Explore_Banner`);\n const fromParam = from ? `from=${from}` : '';\n const url = `${gotoUrl}${hasParam}${fromParam}`;\n if (!(url.startsWith('https') || url.startsWith('http'))) {\n router.push(url);\n } else {\n window.open(url);\n }\n } else if (e.target) {\n const rect = (e.target as HTMLElement)?.getBoundingClientRect();\n const screenWidth = window.innerWidth;\n if (rect.left < screenWidth / 2 && rect.right < screenWidth / 2) {\n // 元素离左边屏幕更近\n swiper.slidePrev();\n } else if (rect.left > screenWidth / 2 && rect.right > screenWidth / 2) {\n // 元素离右边屏幕更近\n swiper.slideNext();\n }\n }\n };\n\n return (\n <div className={styles.swiperBox}>\n <SwiperComponent\n observer\n observeParents\n {...swiperConfigs}\n breakpoints={breakpoints[swiperType]}\n className={cn(\n 'w-[100vw] md:w-full h-auto flex-shrink-0',\n isBanner && 'banner-swiper h-[220px] md:h-auto',\n isFeatured && 'feature-swiper !pl-4 !pr-3 md:!px-4',\n isGrid && 'grid-swiper h-full !ml-auto !mr-auto !pl-4 !pr-3 md:!px-0',\n animate && styles.animate,\n className\n )}\n onInit={(swiper) => {\n swiperRef.current = swiper;\n }}\n >\n {swiperList.map((item: any, index: number) => (\n <SwiperSlide\n /* eslint-disable-next-line react/no-array-index-key */\n key={index}\n className={cn(\n isBanner &&\n 'banner-swiper-slide !w-[90%] md:!w-[98%] h-[220px] md:h-auto max-w-[1200px] aspect-[4/1] rounded-2xl opacity-30',\n isFeatured && 'rounded-2xl !w-[100%-32px] md:!w-[100%-72px]',\n isGrid &&\n 'grid-swiper-slide !w-[100%-32px] md:!w-[100%-72px] !h-[100%/3] flex justify-center items-center rounded-2xl',\n 'text-clip',\n slideClassName\n )}\n >\n <Com\n item={item}\n index={index}\n onClick={handleSlideItemClick}\n className={cn(\n swiperVariants({ rounded }),\n (isBanner || isFeatured) && 'rounded-2xl',\n componentClassName\n )}\n isLine={gridRows && (index + 1) % gridRows !== 0}\n />\n </SwiperSlide>\n ))}\n </SwiperComponent>\n </div>\n );\n}\n","export default `.swiperBox {\n @apply w-full h-fit;\n}\n.swiperBox :global(.swiper) :global(.swiper-button-prev) {\n @apply bg-contain bg-no-repeat;\n background-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0iIzQxNDM0NSIgY2xhc3M9InNpemUtNSI+CiAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTEuNzggNS4yMmEuNzUuNzUgMCAwIDEgMCAxLjA2TDguMDYgMTBsMy43MiAzLjcyYS43NS43NSAwIDEgMS0xLjA2IDEuMDZsLTQuMjUtNC4yNWEuNzUuNzUgMCAwIDEgMC0xLjA2bDQuMjUtNC4yNWEuNzUuNzUgMCAwIDEgMS4wNiAwWiIgY2xpcC1ydWxlPSJldmVub2RkIiAvPgo8L3N2Zz4K\");\n}\n.swiperBox :global(.swiper) :global(.swiper-button-next) {\n @apply bg-contain bg-no-repeat;\n background-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0iIzQxNDM0NSIgY2xhc3M9InNpemUtNSI+CiAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC4yMiA1LjIyYS43NS43NSAwIDAgMSAxLjA2IDBsNC4yNSA0LjI1YS43NS43NSAwIDAgMSAwIDEuMDZsLTQuMjUgNC4yNWEuNzUuNzUgMCAwIDEtMS4wNi0xLjA2TDExLjk0IDEwIDguMjIgNi4yOGEuNzUuNzUgMCAwIDEgMC0xLjA2WiIgY2xpcC1ydWxlPSJldmVub2RkIiAvPgo8L3N2Zz4KCg==\");\n}\n.swiperBox :global(.swiper) :global(.swiper-button-prev::after) {\n @apply text-icon content-none;\n}\n.swiperBox :global(.swiper) :global(.swiper-button-next::after) {\n @apply text-icon content-none;\n}\n.swiperBox :global(.swiper.banner-swiper) :global(.banner-swiper-slide.swiper-slide-prev) {\n @apply origin-right;\n}\n.swiperBox :global(.swiper.banner-swiper) :global(.banner-swiper-slide.swiper-slide-next) {\n @apply origin-left;\n}\n.swiperBox :global(.swiper.banner-swiper) :global(.swiper-slide-active) {\n @apply opacity-100;\n}\n.swiperBox :global(.swiper.banner-swiper) :global(.swiper-button-next) {\n @apply -right-4 md:right-0 3xl:right-[calc((100%-1200px)/2-16px)];\n}\n.swiperBox :global(.swiper.banner-swiper) :global(.swiper-button-prev) {\n @apply -left-4 md:left-0 3xl:left-[calc((100%-1200px)/2-16px)];\n}\n.swiperBox :global(.swiper.feature-swiper) :global(.swiper-button-next) {\n @apply right-0;\n}\n.swiperBox :global(.swiper.feature-swiper) :global(.swiper-button-prev) {\n @apply left-0;\n}\n.swiperBox :global(.swiper.feature-swiper) :global(.swiper-button-disabled) {\n @apply hidden;\n}\n.swiperBox :global(.swiper.patron-badge-swiper) :global(.swiper-button-next) {\n @apply right-0;\n}\n.swiperBox :global(.swiper.patron-badge-swiper) :global(.swiper-button-prev) {\n @apply left-0;\n}\n.swiperBox :global(.swiper.patron-badge-swiper) :global(.swiper-button-disabled) {\n @apply hidden;\n}\n.swiperBox :global(.swiper.grid-swiper) :global(.swiper-wrapper) {\n @apply w-[100vw] md:w-full flex-wrap flex-col m-0;\n}\n.swiperBox :global(.swiper) :global(.swiper-button-next) {\n @apply hidden md:flex justify-center items-center absolute top-[50%] w-8 h-8 font-semibold text-icon border border-Colors-Border-Default bg-Colors-Background-Normal-Primary-Default rounded-full cursor-pointer hover:bg-surface-hovered active:bg-Colors-Background-Normal-Primary-Active;\n}\n.swiperBox :global(.swiper) :global(.swiper-button-next)::after {\n @apply text-icon text-xs font-bold;\n}\n.swiperBox :global(.swiper) :global(.swiper-button-prev) {\n @apply hidden md:flex justify-center items-center absolute top-[50%] w-8 h-8 font-semibold text-icon border border-Colors-Border-Default bg-Colors-Background-Normal-Primary-Default rounded-full cursor-pointer hover:bg-surface-hovered active:bg-Colors-Background-Normal-Primary-Active;\n}\n.swiperBox :global(.swiper) :global(.swiper-button-prev)::after {\n @apply text-icon text-xs font-bold;\n}\n\n.animate :global(.swiper-slide) {\n transition: transform 500ms linear;\n}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VSb290IjoiL1VzZXJzL3hpYW9ndWFuZy9jb2RlL215c2hlbGwtcmVhY3QtbGliL3NyYy9jb21wb25lbnRzL3N3aXBlciIsInNvdXJjZXMiOlsiaW5kZXgubW9kdWxlLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRTs7QUFHRTtFQUNFO0VBQ0E7O0FBRUY7RUFDRTtFQUNBOztBQUVGO0VBQ0U7O0FBRUY7RUFDRTs7QUFJRjtFQUVFOztBQUVGO0VBRUU7O0FBRUY7RUFDRTs7QUFHRjtFQUNFOztBQUVGO0VBQ0U7O0FBSUY7RUFDRTs7QUFFRjtFQUNFOztBQUVGO0VBQ0U7O0FBSUY7RUFDRTs7QUFFRjtFQUNFOztBQUVGO0VBQ0U7O0FBSUY7RUFDRTs7QUFLRjtFQUNFOztBQUNFO0VBQ0U7O0FBR047RUFDRTs7QUFDRTtFQUNFOzs7QUFPUjtFQUNFIiwic291cmNlc0NvbnRlbnQiOlsiLnN3aXBlckJveHtcbiAgQGFwcGx5IHctZnVsbCBoLWZpdDtcbiAgXG4gIDpnbG9iYWwoLnN3a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Z3JvdW5kLU5vcm1hbC1QcmltYXJ5LUFjdGl2ZTtcbiAgICAgICAgJjo6YWZ0ZXIge1xuICAgICAgICAgIEBhcHBseSB0ZXh0LWljb24gdGV4dC14cyBmb250LWJvbGQ7XG4gICAgICB9XG4gICAgfVxuICB9XG59XG5cbi5hbmltYXRlIHtcbiAgOmdsb2JhbCguc3dpcGVyLXNsaWRlKSB7XG4gICAgdHJhbnNpdGlvbjogdHJhbnNmb3JtIDUwMG1zIGxpbmVhcjtcbiAgfVxufVxuIl19 */`;\n","'use client';\n\nimport XMarkIcon from '@heroicons/react/24/outline/esm/XMarkIcon';\nimport CheckCircleIcon from '@heroicons/react/24/solid/esm/CheckCircleIcon';\nimport ExclamationCircleIcon from '@heroicons/react/24/solid/esm/ExclamationCircleIcon';\nimport InformationCircleIcon from '@heroicons/react/24/solid/esm/InformationCircleIcon';\nimport XCircleIcon from '@heroicons/react/24/solid/esm/XCircleIcon';\nimport { toast, ToastOptions } from 'react-hot-toast';\n\nimport { IconButton } from './button/icon-button';\nimport { Separator } from './separator';\nimport { Text } from './typography';\nimport { isString } from '@/common/utils/common-helper';\nimport { CustomToasterProps } from '@/common/hooks/useNotification';\nimport Spinner from './spinner';\n\nexport default function CustomNotification({\n tProps,\n customProps,\n}: {\n tProps: ToastOptions;\n customProps: CustomToasterProps;\n}) {\n const {\n type,\n title,\n content,\n isClosable = false,\n action,\n loading,\n } = customProps;\n const { id } = tProps;\n\n const displayedContent = !isString(content)\n ? JSON.stringify(content)\n : content;\n\n return (\n <div>\n <div\n id={id}\n className=\"z-[10000000] min-h-10 w-fit max-w-[90vw] rounded-full border border-opaque bg-Colors-Background-Normal-Primary-Active px-3 py-2 shadow-modal-default md:max-w-[560px]\"\n >\n <div className=\"flex w-full items-center justify-center gap-2\">\n {loading && <Spinner />}\n {!loading && type && (\n <div className=\"flex flex-shrink-0 items-center\">\n {type === 'info' && (\n <InformationCircleIcon className=\"h-6 w-6 text-cc-Icon-Featured-icon-fg-Info\" />\n )}\n {type === 'success' && (\n <CheckCircleIcon className=\"h-6 w-6 text-cc-Icon-Featured-icon-fg-Success\" />\n )}\n {type === 'warning' && (\n <ExclamationCircleIcon className=\"h-6 w-6 text-cc-Icon-Featured-icon-fg-Warning\" />\n )}\n {type === 'error' && (\n <XCircleIcon className=\"h-6 w-6 text-cc-Icon-Featured-icon-fg-Error\" />\n )}\n </div>\n )}\n <div className=\"flex flex-grow flex-col space-y-1 overflow-hidden\">\n {title && (\n <Text size=\"sm\" weight=\"regular\" color=\"default\">\n {title}\n </Text>\n )}\n <div>\n <Text size=\"sm\" weight=\"regular\" color=\"default\">\n {displayedContent}\n </Text>\n </div>\n </div>\n\n {action && (\n <>\n <Separator orientation=\"vertical\" className=\"h-3\" />\n {action}\n </>\n )}\n\n {isClosable && (\n <IconButton\n size=\"sm\"\n variant=\"plain\"\n icon={XMarkIcon}\n onClick={() => toast.dismiss(id)}\n className=\"text-Colors-Foreground-Subtlest\"\n />\n )}\n </div>\n </div>\n </div>\n );\n}\n","import CustomNotification from '@/components/custom-notification';\nimport { useCallback } from 'react';\nimport { toast, ToastOptions } from 'react-hot-toast';\n\nexport type ToastType = 'success' | 'info' | 'warning' | 'error';\n\nexport interface CustomToasterProps {\n id?: string;\n type?: ToastType;\n title?: string;\n content: string;\n isClosable?: boolean;\n translateInToast?: boolean;\n reason?: string;\n action?: React.ReactNode;\n loading?: boolean;\n}\n\nexport function useNotification() {\n const addToast = useCallback(\n (config: CustomToasterProps, duration?: number) => {\n // 如果显式指定 id 的,则同时只能有一条显示\n if (config.id) {\n toast.remove(config.id);\n }\n toast.custom(\n (t: ToastOptions) => {\n return (\n <CustomNotification\n tProps={{ ...t, duration }}\n customProps={config}\n />\n );\n },\n {\n id: config.id,\n duration,\n }\n );\n },\n []\n );\n\n const message = useCallback(\n (config: CustomToasterProps, duration?: number) =>\n addToast(\n {\n ...config,\n },\n duration\n ),\n []\n );\n\n const success = useCallback(\n (config: CustomToasterProps, duration?: number) =>\n addToast(\n {\n ...config,\n type: 'success',\n },\n duration\n ),\n []\n );\n\n const error = useCallback(\n (config: CustomToasterProps, duration?: number) =>\n addToast(\n {\n ...config,\n type: 'error',\n },\n duration\n ),\n []\n );\n\n const warning = useCallback(\n (config: CustomToasterProps, duration?: number) =>\n addToast(\n {\n ...config,\n type: 'warning',\n },\n duration\n ),\n []\n );\n\n const info = useCallback(\n (config: CustomToasterProps, duration?: number) =>\n addToast(\n {\n ...config,\n type: 'info',\n },\n duration\n ),\n []\n );\n\n const close = useCallback((id: string) => {\n toast.dismiss(id);\n }, []);\n\n return { addToast, success, error, warning, info, close, message };\n}\n\nexport class Message {\n private static _toast(config: CustomToasterProps, duration?: number) {\n if (config.id) {\n toast.remove(config.id);\n }\n\n const addToast = () => {\n toast.custom(\n (t: ToastOptions) => {\n return (\n <CustomNotification\n tProps={{ ...t, duration }}\n customProps={config}\n />\n );\n },\n {\n id: config.id,\n duration,\n }\n );\n };\n\n addToast();\n }\n\n static success(config: CustomToasterProps, duration?: number) {\n return this._toast(\n {\n ...config,\n type: 'success',\n },\n duration\n );\n }\n\n static error(config: CustomToasterProps, duration?: number) {\n return this._toast(\n {\n ...config,\n type: 'error',\n },\n duration\n );\n }\n\n static info(config: CustomToasterProps, duration?: number) {\n return this._toast(\n {\n ...config,\n type: 'info',\n },\n duration\n );\n }\n\n static warning(config: CustomToasterProps, duration?: number) {\n return this._toast(\n {\n ...config,\n type: 'warning',\n },\n duration\n );\n }\n\n static close(id: string) {\n toast.dismiss(id);\n }\n}\n"]}