velloo 0.6.0 → 0.8.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.
- package/README.md +121 -225
- package/THIRD-PARTY-NOTICES.md +3 -3
- package/canvas/assets/index-CcPwhD7W.js +31 -0
- package/canvas/assets/index-CkVteRZ9.css +2 -0
- package/canvas/assets/lucide-all-Cezxn40A.js +1 -0
- package/canvas/index.html +2 -2
- package/{chunk-rjjc9vam.js → chunk-07fxzrx2.js} +2 -2
- package/{chunk-ff0jfn0v.js → chunk-32cq4wpr.js} +1 -1
- package/{chunk-nx09zqgs.js → chunk-3612470d.js} +1 -1
- package/{chunk-hf4adxe0.js → chunk-45wv1fs5.js} +8 -8
- package/chunk-4g4c9h7k.js +2 -0
- package/{chunk-8vgpffn7.js → chunk-6w42sr61.js} +1 -1
- package/{chunk-esb7n55g.js → chunk-8n07n0cr.js} +3 -3
- package/{chunk-96qhpth5.js → chunk-8qf0ne1p.js} +1 -1
- package/{chunk-56z5xd5b.js → chunk-8ztgcajz.js} +1 -1
- package/chunk-9g45c5md.js +815 -0
- package/{chunk-w2naqxqt.js → chunk-aefn23tr.js} +1 -1
- package/{chunk-jsvkqae2.js → chunk-asqpx5v7.js} +1 -1
- package/chunk-b4hny6hw.js +3 -0
- package/chunk-bntsn3wj.js +2 -0
- package/{chunk-bc7pkjcn.js → chunk-c4164x55.js} +1 -1
- package/{chunk-mfch0b0t.js → chunk-cg0sjdqt.js} +1 -1
- package/{chunk-3trkmgfr.js → chunk-cq2q36d1.js} +1 -1
- package/chunk-d19ttv1a.js +4 -0
- package/{chunk-8grzf8q1.js → chunk-djwvt6jx.js} +1 -1
- package/chunk-dqqpbmxt.js +22 -0
- package/{chunk-1td6z6ey.js → chunk-dy7qwj3t.js} +1 -1
- package/{chunk-dar6wbf2.js → chunk-ejpccmcj.js} +1 -1
- package/{chunk-pxaxgkaq.js → chunk-emty5315.js} +1 -1
- package/chunk-esg0x95a.js +5 -0
- package/{chunk-k423dkjz.js → chunk-ez720ked.js} +1 -1
- package/{chunk-h85hv05d.js → chunk-ffm2jpxp.js} +1 -1
- package/{chunk-6813v926.js → chunk-g3k8k6fq.js} +3 -3
- package/{chunk-63y5gdzw.js → chunk-h3ser37q.js} +1 -1
- package/{chunk-74yxy75r.js → chunk-hsk91jms.js} +1 -1
- package/chunk-jxgwdz2r.js +5 -0
- package/chunk-kvq7pcph.js +2 -0
- package/chunk-m0v3d581.js +2 -0
- package/chunk-majd3gx9.js +3 -0
- package/{chunk-t2x3mztc.js → chunk-mqtnj8ws.js} +1 -1
- package/{chunk-xtwx2p9g.js → chunk-mqx96m2g.js} +1 -1
- package/{chunk-c4spp880.js → chunk-nrxqr4v5.js} +1 -1
- package/{chunk-g185gx8a.js → chunk-nx0ex7qw.js} +1 -1
- package/{chunk-qwccndcd.js → chunk-q7wwqn03.js} +1 -1
- package/chunk-qgbat4fv.js +6 -0
- package/{chunk-08mjtg1e.js → chunk-qqagacne.js} +1 -1
- package/{chunk-69qb8p8s.js → chunk-qx83fdv2.js} +1 -1
- package/{chunk-ff2vt7cz.js → chunk-r5y1sh4f.js} +1 -1
- package/{chunk-2ba6edh8.js → chunk-rg86bhtb.js} +2 -2
- package/{chunk-x02z2ccm.js → chunk-rhfzy9c0.js} +1 -1
- package/{chunk-t6qr2ay9.js → chunk-rrrn1mkq.js} +1 -1
- package/{chunk-56vfy0db.js → chunk-s1cwck4c.js} +1 -1
- package/{chunk-tac2wvc7.js → chunk-sjxp2bx3.js} +1 -1
- package/chunk-skk6yvnw.js +3 -0
- package/{chunk-52m26hh4.js → chunk-t08391mh.js} +1 -1
- package/{chunk-2q561dec.js → chunk-t61vyqpd.js} +1 -1
- package/{chunk-ta84ehgg.js → chunk-v6ks5v53.js} +1 -1
- package/{chunk-hjc5eg5c.js → chunk-w30zfv3m.js} +1 -1
- package/{chunk-tbd6wn3q.js → chunk-x84qrz4q.js} +1 -1
- package/{chunk-chtv0yj6.js → chunk-xg49s85z.js} +147 -30
- package/{chunk-8cj4swpr.js → chunk-xxw67jpk.js} +3 -3
- package/{chunk-eqjtq673.js → chunk-yjwtdm71.js} +1 -1
- package/{chunk-8vam2893.js → chunk-z6r6wxm6.js} +1 -1
- package/{chunk-hsfpbjpc.js → chunk-zgwvkgsz.js} +1 -1
- package/cli.js +1 -1
- package/launcher.cjs +3 -1
- package/package.json +1 -1
- package/pkgs/helpers/src/box.tsx +12 -6
- package/pkgs/helpers/src/descriptors.ts +6 -0
- package/pkgs/helpers/src/icon.tsx +5 -3
- package/pkgs/helpers/src/index.ts +2 -2
- package/pkgs/helpers/src/text.tsx +29 -5
- package/pkgs/provider-antd/src/index.ts +1 -0
- package/pkgs/provider-antd/src/manifest.ts +1 -0
- package/pkgs/provider-chakra/src/manifest.ts +1 -0
- package/pkgs/provider-html/src/index.ts +1 -0
- package/pkgs/provider-mui/src/index.ts +10 -0
- package/pkgs/provider-mui/src/manifest.ts +1 -0
- package/pkgs/provider-none/src/components-inline.tsx +20 -14
- package/pkgs/provider-none/src/components.tsx +2 -4
- package/pkgs/provider-none/src/index.ts +1 -0
- package/pkgs/schema/src/board.ts +13 -1
- package/pkgs/schema/src/config.ts +38 -1
- package/pkgs/schema/src/flow.ts +230 -0
- package/pkgs/schema/src/frame.ts +7 -0
- package/pkgs/schema/src/index.ts +24 -0
- package/pkgs/schema/src/node-identity.ts +54 -1
- package/pkgs/schema/src/node.ts +114 -26
- package/pkgs/schema/src/snippet-resolve.ts +18 -12
- package/pkgs/schema/src/svg-sanitize.ts +3 -0
- package/pkgs/schema/src/theme.ts +56 -0
- package/pkgs/schema/src/typeset.ts +21 -4
- package/pkgs/shadcn-snapshot/dist/manifest.json +6 -0
- package/plugins/claude/velloo/agents/velloo-designer.md +7 -4
- package/plugins/claude/velloo/commands/setup.md +13 -0
- package/plugins/gemini/GEMINI.md +9 -5
- package/plugins/gemini/commands/velloo/setup.toml +11 -0
- package/skills/velloo-design/SKILL.md +11 -6
- package/skills/velloo-setup/SKILL.md +179 -36
- package/canvas/assets/index-CnyI3aig.js +0 -29
- package/canvas/assets/index-GNLd0pCG.css +0 -2
- package/canvas/assets/lucide-all-CH8LmVh0.js +0 -1
- package/chunk-1gkeepkm.js +0 -2
- package/chunk-2web93qz.js +0 -2
- package/chunk-ab8fga32.js +0 -22
- package/chunk-azeqkms7.js +0 -6
- package/chunk-e2btp1wd.js +0 -3
- package/chunk-ey65err5.js +0 -5
- package/chunk-rk238m15.js +0 -4
- package/chunk-wfhv9jg4.js +0 -2
- package/chunk-wnj432fw.js +0 -3
- package/chunk-yfvc8d2g.js +0 -716
- package/chunk-z73q4dq9.js +0 -2
- package/chunk-ztsckexy.js +0 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{sanitizeCssTokenValue,resolveColors,TYPESET_DEFAULT,DEFAULT_TYPESET_NAME,typesetScale}from"./chunk-
|
|
2
|
+
import{sanitizeCssTokenValue,resolveColors,TYPESET_DEFAULT,DEFAULT_TYPESET_NAME,typesetScale}from"./chunk-xxw67jpk.js";import{helpersRegistry,parse_default,formatRgb}from"./chunk-9g45c5md.js";import{STYLE_PROP,catalogFromManifest,identifierRef,require_react_development,require_react_dom}from"./chunk-xg49s85z.js";import{__toESM,__commonJS}from"./chunk-2smsg2ct.js";import{ANTD_VERSION}from"./chunk-0t68szgr.js";import{_objectWithoutPropertiesLoose,_extends,_assertThisInitialized,_setPrototypeOf}from"./chunk-h6gchare.js";import{resolveProviderSrcDir}from"./chunk-v6c3h9ft.js";var require_classnames=__commonJS(function(exports,module){/*!
|
|
3
3
|
Copyright (c) 2018 Jed Watson.
|
|
4
4
|
Licensed under the MIT License (MIT), see
|
|
5
5
|
http://jedwatson.github.io/classnames
|
|
6
|
-
*/(function(){var hasOwn={}.hasOwnProperty;function classNames(){var classes="";for(var i=0;i<arguments.length;i++){var arg=arguments[i];if(arg)classes=appendClass(classes,parseValue(arg))}return classes}function parseValue(arg){if(typeof arg==="string"||typeof arg==="number")return arg;if(typeof arg!=="object")return"";if(Array.isArray(arg))return classNames.apply(null,arg);if(arg.toString!==Object.prototype.toString&&!arg.toString.toString().includes("[native code]"))return arg.toString();var classes="";for(var key in arg)if(hasOwn.call(arg,key)&&arg[key])classes=appendClass(classes,key);return classes}function appendClass(value,newClass){if(!newClass)return value;if(value)return value+" "+newClass;return value+newClass}if(typeof module<"u"&&module.exports)classNames.default=classNames,module.exports=classNames;else if(typeof define==="function"&&typeof define.amd==="object"&&define.amd)define("classnames",[],function(){return classNames});else window.classNames=classNames})()});var require_react_is_development=__commonJS(function(exports){(function(){var REACT_ELEMENT_TYPE=Symbol.for("react.element"),REACT_PORTAL_TYPE=Symbol.for("react.portal"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment"),REACT_STRICT_MODE_TYPE=Symbol.for("react.strict_mode"),REACT_PROFILER_TYPE=Symbol.for("react.profiler"),REACT_PROVIDER_TYPE=Symbol.for("react.provider"),REACT_CONTEXT_TYPE=Symbol.for("react.context"),REACT_SERVER_CONTEXT_TYPE=Symbol.for("react.server_context"),REACT_FORWARD_REF_TYPE=Symbol.for("react.forward_ref"),REACT_SUSPENSE_TYPE=Symbol.for("react.suspense"),REACT_SUSPENSE_LIST_TYPE=Symbol.for("react.suspense_list"),REACT_MEMO_TYPE=Symbol.for("react.memo"),REACT_LAZY_TYPE=Symbol.for("react.lazy"),REACT_OFFSCREEN_TYPE=Symbol.for("react.offscreen"),enableScopeAPI=!1,enableCacheElement=!1,enableTransitionTracing=!1,enableLegacyHidden=!1,enableDebugTracing=!1,REACT_MODULE_REFERENCE;REACT_MODULE_REFERENCE=Symbol.for("react.module.reference");function isValidElementType(type){if(typeof type==="string"||typeof type==="function")return!0;if(type===REACT_FRAGMENT_TYPE||type===REACT_PROFILER_TYPE||enableDebugTracing||type===REACT_STRICT_MODE_TYPE||type===REACT_SUSPENSE_TYPE||type===REACT_SUSPENSE_LIST_TYPE||enableLegacyHidden||type===REACT_OFFSCREEN_TYPE||enableScopeAPI||enableCacheElement||enableTransitionTracing)return!0;if(typeof type==="object"&&type!==null){if(type.$$typeof===REACT_LAZY_TYPE||type.$$typeof===REACT_MEMO_TYPE||type.$$typeof===REACT_PROVIDER_TYPE||type.$$typeof===REACT_CONTEXT_TYPE||type.$$typeof===REACT_FORWARD_REF_TYPE||type.$$typeof===REACT_MODULE_REFERENCE||type.getModuleId!==void 0)return!0}return!1}function typeOf(object){if(typeof object==="object"&&object!==null){var $$typeof=object.$$typeof;switch($$typeof){case REACT_ELEMENT_TYPE:var type=object.type;switch(type){case REACT_FRAGMENT_TYPE:case REACT_PROFILER_TYPE:case REACT_STRICT_MODE_TYPE:case REACT_SUSPENSE_TYPE:case REACT_SUSPENSE_LIST_TYPE:return type;default:var $$typeofType=type&&type.$$typeof;switch($$typeofType){case REACT_SERVER_CONTEXT_TYPE:case REACT_CONTEXT_TYPE:case REACT_FORWARD_REF_TYPE:case REACT_LAZY_TYPE:case REACT_MEMO_TYPE:case REACT_PROVIDER_TYPE:return $$typeofType;default:return $$typeof}}case REACT_PORTAL_TYPE:return $$typeof}}return}var ContextConsumer=REACT_CONTEXT_TYPE,ContextProvider=REACT_PROVIDER_TYPE,Element2=REACT_ELEMENT_TYPE,ForwardRef=REACT_FORWARD_REF_TYPE,Fragment=REACT_FRAGMENT_TYPE,Lazy=REACT_LAZY_TYPE,Memo=REACT_MEMO_TYPE,Portal=REACT_PORTAL_TYPE,Profiler=REACT_PROFILER_TYPE,StrictMode=REACT_STRICT_MODE_TYPE,Suspense=REACT_SUSPENSE_TYPE,SuspenseList=REACT_SUSPENSE_LIST_TYPE,hasWarnedAboutDeprecatedIsAsyncMode=!1,hasWarnedAboutDeprecatedIsConcurrentMode=!1;function isAsyncMode(object){if(!hasWarnedAboutDeprecatedIsAsyncMode)hasWarnedAboutDeprecatedIsAsyncMode=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.");return!1}function isConcurrentMode(object){if(!hasWarnedAboutDeprecatedIsConcurrentMode)hasWarnedAboutDeprecatedIsConcurrentMode=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.");return!1}function isContextConsumer(object){return typeOf(object)===REACT_CONTEXT_TYPE}function isContextProvider(object){return typeOf(object)===REACT_PROVIDER_TYPE}function isElement(object){return typeof object==="object"&&object!==null&&object.$$typeof===REACT_ELEMENT_TYPE}function isForwardRef(object){return typeOf(object)===REACT_FORWARD_REF_TYPE}function isFragment(object){return typeOf(object)===REACT_FRAGMENT_TYPE}function isLazy(object){return typeOf(object)===REACT_LAZY_TYPE}function isMemo(object){return typeOf(object)===REACT_MEMO_TYPE}function isPortal(object){return typeOf(object)===REACT_PORTAL_TYPE}function isProfiler(object){return typeOf(object)===REACT_PROFILER_TYPE}function isStrictMode(object){return typeOf(object)===REACT_STRICT_MODE_TYPE}function isSuspense(object){return typeOf(object)===REACT_SUSPENSE_TYPE}function isSuspenseList(object){return typeOf(object)===REACT_SUSPENSE_LIST_TYPE}exports.ContextConsumer=ContextConsumer,exports.ContextProvider=ContextProvider,exports.Element=Element2,exports.ForwardRef=ForwardRef,exports.Fragment=Fragment,exports.Lazy=Lazy,exports.Memo=Memo,exports.Portal=Portal,exports.Profiler=Profiler,exports.StrictMode=StrictMode,exports.Suspense=Suspense,exports.SuspenseList=SuspenseList,exports.isAsyncMode=isAsyncMode,exports.isConcurrentMode=isConcurrentMode,exports.isContextConsumer=isContextConsumer,exports.isContextProvider=isContextProvider,exports.isElement=isElement,exports.isForwardRef=isForwardRef,exports.isFragment=isFragment,exports.isLazy=isLazy,exports.isMemo=isMemo,exports.isPortal=isPortal,exports.isProfiler=isProfiler,exports.isStrictMode=isStrictMode,exports.isSuspense=isSuspense,exports.isSuspenseList=isSuspenseList,exports.isValidElementType=isValidElementType,exports.typeOf=typeOf})()});var require_toggle_selection=__commonJS(function(exports,module){module.exports=function(){var selection=document.getSelection();if(!selection.rangeCount)return function(){};var active=document.activeElement,ranges=[];for(var i=0;i<selection.rangeCount;i++)ranges.push(selection.getRangeAt(i));switch(active.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":active.blur();break;default:active=null;break}return selection.removeAllRanges(),function(){if(selection.type==="Caret"&&selection.removeAllRanges(),!selection.rangeCount)ranges.forEach(function(range){selection.addRange(range)});active&&active.focus()}}});var require_copy_to_clipboard=__commonJS(function(exports,module){var deselectCurrent=require_toggle_selection(),clipboardToIE11Formatting={"text/plain":"Text","text/html":"Url",default:"Text"},defaultMessage="Copy to clipboard: #{key}, Enter";function format(message){var copyKey=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return message.replace(/#{\s*key\s*}/g,copyKey)}function copy(text,options){var debug,message,reselectPrevious,range,selection,mark,success=!1;if(!options)options={};debug=options.debug||!1;try{reselectPrevious=deselectCurrent(),range=document.createRange(),selection=document.getSelection(),mark=document.createElement("span"),mark.textContent=text,mark.ariaHidden="true",mark.style.all="unset",mark.style.position="fixed",mark.style.top=0,mark.style.clip="rect(0, 0, 0, 0)",mark.style.whiteSpace="pre",mark.style.webkitUserSelect="text",mark.style.MozUserSelect="text",mark.style.msUserSelect="text",mark.style.userSelect="text",mark.addEventListener("copy",function(e){if(e.stopPropagation(),options.format)if(e.preventDefault(),typeof e.clipboardData>"u"){debug&&console.warn("unable to use e.clipboardData"),debug&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var format=clipboardToIE11Formatting[options.format]||clipboardToIE11Formatting.default;window.clipboardData.setData(format,text)}else e.clipboardData.clearData(),e.clipboardData.setData(options.format,text);if(options.onCopy)e.preventDefault(),options.onCopy(e.clipboardData)}),document.body.appendChild(mark),range.selectNodeContents(mark),selection.addRange(range);var successful=document.execCommand("copy");if(!successful)throw Error("copy command was unsuccessful");success=!0}catch(err){debug&&console.error("unable to copy using execCommand: ",err),debug&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(options.format||"text",text),options.onCopy&&options.onCopy(window.clipboardData),success=!0}catch(err){debug&&console.error("unable to copy using clipboardData: ",err),debug&&console.error("falling back to prompt"),message=format("message"in options?options.message:defaultMessage),window.prompt(message,text)}}finally{if(selection)if(typeof selection.removeRange=="function")selection.removeRange(range);else selection.removeAllRanges();if(mark)document.body.removeChild(mark);reselectPrevious()}return success}module.exports=copy});import{dirname,join}from"path";import{fileURLToPath}from"url";var ANTD_INTRO=["**This folder targets Ant Design v5.** Components are real antd: `Flex`/`Space`/`Row`+`Col` for layout, `Card`, `TypographyTitle`/`TypographyText`/`TypographyParagraph` (ALL text \u2014 antd's `Typography.Title/Text/Paragraph`, which compose under flat ids because a `$ref` can't carry a dot, and emit as the dotted exports), `Button`, `Input`/`Select`/`Checkbox`/`Radio`/`Switch`/`Segmented`/`Slider`/`Rate`, `Tag`/`Badge`/`Avatar`/`Alert`/`Statistic`/`Progress`/`Skeleton`/`Empty`, `Table`/`List`+`ListItem`/`Tabs`/`Steps`/`Breadcrumb`/`Pagination`/`Menu` (data components take `items`/`columns` arrays \u2014 no render functions), and the overlay surface `Modal`/`Drawer`/`Popover`/`Tooltip`/`Dropdown` (rendered open + inline in design mode). Call `list_components` for the full set and per-component `example` props.","",'**Style through the inline `style` object.** `update_props { style: { display: "flex", alignItems: "center", gap: "16px", padding: "24px" } }` \u2014 a plain React style object (merges shallowly; an inner `null` drops a key, `style: null` clears). The theme runs in antd\'s `cssVar` mode, so antd tokens are CSS variables: inside any antd component subtree you can reference `var(--ant-color-primary)`, `var(--ant-color-text-secondary)`, `var(--ant-color-bg-container)`, `var(--ant-border-radius)` etc. to stay themable; plain CSS values always work. Prefer component props (`type`, `size`, `gap`) over style overrides where they exist. A plain `<div>`/`<span>` composes as `Box` and emits as the bare element.',"","`emit_code` emits idiomatic antd JSX with `style={{\u2026}}`, already written against the real exports \u2014 `<Typography.Title>`, `<List.Item.Meta>` \u2014 and `packagesToImport` names the package they come from. `emit_theme` emits a ConfigProvider `ThemeConfig` module (default `antd-theme.ts`) \u2014 wire it with `<ConfigProvider theme={theme}>`. Tailwind utility diagnostics do not apply here.",""];var style={name:"style",type:"CSSProperties | undefined",optional:!0,control:"string"},children={name:"children",type:"ReactNode",optional:!0,control:"string"},enumProp=(name,values,defaultValue)=>({name,type:values.map((v)=>typeof v==="string"?`"${v}"`:`${v}`).join(" | "),optional:!0,control:"enum",enumValues:values,defaultValue}),str=(name,optional=!0)=>({name,type:"string",optional,control:"string"}),num=(name)=>({name,type:"number",optional:!0,control:"number"}),bool=(name)=>({name,type:"boolean",optional:!0,control:"boolean"}),node=(name)=>({name,type:"ReactNode",optional:!0,control:"string"}),json=(name,type)=>({name,type,optional:!0,control:"string"}),color=(name)=>({name,type:"string",optional:!0,control:"color"}),css=(name)=>json(name,"CSSProperties"),styles=(parts)=>json("styles",`{ ${parts.split(" ").map((part)=>`${part}?: CSSProperties`).join("; ")} }`),SIZES=["small","middle","large"],STATUS=["error","warning"],VARIANTS=["outlined","borderless","filled","underlined"],PLACEMENTS=["top","left","right","bottom","topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"],TEXT_DECORATIONS=[bool("code"),bool("mark"),bool("keyboard"),bool("italic"),bool("underline"),bool("delete"),bool("disabled"),json("ellipsis","boolean | { rows?: number; expandable?: boolean }"),json("copyable","boolean | { text?: string }")];function ui(id,props,notes,example){return{id,category:"ui",source:"antd",props:[...props,style],designModeNotes:notes,example}}function sub(nativeExport,props,notes,example){return{...ui(nativeExport.replaceAll(".",""),props,notes,example),nativeExport}}var className={name:"className",type:"string | undefined",optional:!0,control:"string"};function helper(id,props,notes,example){return{id,category:"ui",source:"velloo",props:[...props,className],designModeNotes:notes,example}}var ANTD_MANIFEST=[ui("Flex",[children,bool("vertical"),json("gap",'"small" | "middle" | "large" | number'),str("align"),str("justify"),json("wrap",'boolean | "wrap" | "nowrap" | "wrap-reverse"'),json("flex","string | number"),str("component")],"The flex layout primitive \u2014 use it for every row/column wrapper.",{vertical:!1,gap:"middle",align:"center"}),ui("Space",[children,enumProp("direction",["horizontal","vertical"],"horizontal"),json("size",'"small" | "middle" | "large" | number | [number, number]'),enumProp("align",["start","end","center","baseline"]),bool("wrap"),node("split"),styles("item")],"Inline spacing between adjacent items (buttons, tags).",{size:"middle"}),ui("Row",[children,json("gutter","number | [number, number] | Partial<Record<Breakpoint, number>>"),enumProp("align",["top","middle","bottom","stretch"]),enumProp("justify",["start","end","center","space-around","space-between","space-evenly"]),bool("wrap")],"Grid row; pair with Col spans (24-column grid).",{gutter:16}),ui("Col",[children,num("span"),num("offset"),num("order"),num("push"),num("pull"),json("flex","string | number"),...["xs","sm","md","lg","xl","xxl"].map((bp)=>json(bp,"number | { span?: number; offset?: number; order?: number }"))],"Grid column inside a Row; span is out of 24.",{span:12}),ui("Card",[children,node("title"),node("extra"),enumProp("size",["default","small"],"default"),enumProp("variant",["outlined","borderless"],"outlined"),bool("bordered"),bool("hoverable"),bool("loading"),node("cover"),json("actions","ReactNode[]"),enumProp("type",["inner"]),styles("header body extra title actions cover")],"Card surface with an optional title bar.",{title:"Team"}),ui("Alert",[node("message"),node("description"),enumProp("type",["success","info","warning","error"],"info"),bool("showIcon"),node("icon"),node("action"),bool("banner"),bool("closable")],"Inline alert banner. `message` is the headline; `description` the body.",{type:"info",message:"Workspace synced",showIcon:!0}),ui("Tag",[children,str("color"),bool("bordered"),node("icon"),bool("closable")],'Label chip. `color` takes a preset ("success", "processing", "error", "warning") or any CSS color.',{color:"success",children:"Active"}),ui("Badge",[children,json("count","number | ReactNode"),bool("dot"),num("overflowCount"),bool("showZero"),color("color"),enumProp("status",["success","processing","default","error","warning"]),node("text"),enumProp("size",["default","small"],"default"),json("offset","[number, number]")],"Count/dot indicator wrapping its child (an Avatar, an icon).",{count:5}),ui("Avatar",[children,str("src"),str("alt"),json("size",'"large" | "small" | "default" | number'),enumProp("shape",["circle","square"],"circle"),node("icon"),num("gap")],"Avatar \u2014 `src` image or text children.",{children:"AB"}),ui("Divider",[children,enumProp("type",["horizontal","vertical"],"horizontal"),enumProp("orientation",["left","right","center","start","end"],"center"),json("orientationMargin","string | number"),bool("dashed"),enumProp("variant",["solid","dashed","dotted"],"solid"),bool("plain")]),ui("Skeleton",[bool("active"),json("avatar","boolean | { shape?: 'circle' | 'square'; size?: number }"),json("paragraph","boolean | { rows?: number; width?: number | string | (number | string)[] }"),bool("round"),bool("loading"),children],"Loading placeholder blocks.",{active:!0}),ui("Empty",[node("description"),node("image"),children],"Empty-state illustration + caption.",{description:"No data yet"}),ui("Statistic",[node("title"),json("value","string | number"),node("prefix"),node("suffix"),css("valueStyle"),num("precision"),str("groupSeparator"),str("decimalSeparator"),bool("loading")],"A KPI number with a label.",{title:"Active users",value:112893}),ui("Progress",[num("percent"),enumProp("type",["line","circle","dashboard"],"line"),enumProp("status",["normal","active","success","exception"]),json("strokeColor","string | string[] | { from: string; to: string; direction?: string }"),color("trailColor"),bool("showInfo"),json("size",'"small" | "default" | number | [number | string, number]'),num("strokeWidth"),enumProp("strokeLinecap",["round","butt","square"],"round"),num("steps"),json("success","{ percent?: number; strokeColor?: string }"),num("gapDegree"),json("percentPosition",'{ align?: "start" | "center" | "end"; type?: "inner" | "outer" }')],void 0,{percent:62}),sub("Typography.Title",[children,enumProp("level",[1,2,3,4,5],"1"),enumProp("type",["secondary","success","warning","danger"]),...TEXT_DECORATIONS],"A heading \u2014 antd's Typography.Title. Pick `level` for the scale (1 largest).",{level:2,children:"Team analytics"}),sub("Typography.Text",[children,enumProp("type",["secondary","success","warning","danger"]),bool("strong"),...TEXT_DECORATIONS],"Inline text \u2014 antd's Typography.Text. `type` picks the semantic tone.",{type:"secondary",children:"Updated 2 hours ago"}),sub("Typography.Paragraph",[children,enumProp("type",["secondary","success","warning","danger"]),bool("strong"),...TEXT_DECORATIONS],"Block paragraph \u2014 antd's Typography.Paragraph.",{children:"Body copy for a section."}),ui("Button",[children,enumProp("type",["primary","default","dashed","text","link"],"default"),bool("danger"),enumProp("size",SIZES,"middle"),bool("block"),node("icon"),enumProp("iconPosition",["start","end"],"start"),enumProp("shape",["default","circle","round"],"default"),enumProp("color",["default","primary","danger"]),enumProp("variant",["outlined","dashed","solid","filled","text","link"]),bool("ghost"),bool("loading"),bool("disabled"),str("href"),enumProp("htmlType",["button","submit","reset"],"button"),styles("icon")],"Action button.",{type:"primary",children:"Submit"}),ui("Input",[str("placeholder"),str("value"),enumProp("size",SIZES,"middle"),str("type"),node("prefix"),node("suffix"),node("addonBefore"),node("addonAfter"),bool("allowClear"),bool("disabled"),bool("readOnly"),num("maxLength"),bool("showCount"),enumProp("status",STATUS),enumProp("variant",VARIANTS,"outlined")],void 0,{placeholder:"Email address"}),ui("Select",[str("placeholder"),json("value","string | number | (string | number)[]"),json("options","{ value: string; label: string }[]"),enumProp("size",SIZES,"middle"),enumProp("mode",["multiple","tags"]),bool("allowClear"),bool("disabled"),bool("loading"),bool("showSearch"),node("prefix"),node("suffixIcon"),json("maxTagCount",'number | "responsive"'),enumProp("status",STATUS),enumProp("variant",VARIANTS,"outlined")],"Closed select field in design mode (the dropdown is a portal).",{placeholder:"Pick a role",options:[{value:"admin",label:"Admin"},{value:"viewer",label:"Viewer"}]}),ui("Checkbox",[children,bool("checked"),bool("indeterminate"),bool("disabled")],void 0,{checked:!0,children:"Remember me"}),ui("Radio",[children,bool("checked"),bool("disabled"),json("value","string | number")],void 0,{checked:!0,children:"Monthly"}),ui("Switch",[bool("checked"),enumProp("size",["default","small"],"default"),bool("disabled"),bool("loading"),node("checkedChildren"),node("unCheckedChildren")],void 0,{checked:!0}),ui("Segmented",[json("options","(string | number | { label: ReactNode; value: string | number })[]"),json("value","string | number"),enumProp("size",SIZES,"middle"),bool("block"),bool("disabled"),bool("vertical"),enumProp("shape",["default","round"],"default")],"Segmented control.",{options:["Daily","Weekly","Monthly"],value:"Weekly"}),ui("Slider",[json("value","number | [number, number]"),num("min"),num("max"),num("step"),bool("range"),json("marks","Record<number, ReactNode>"),bool("dots"),bool("included"),bool("reverse"),bool("vertical"),bool("disabled"),styles("track tracks rail handle")],void 0,{value:30}),ui("Rate",[num("value"),num("count"),bool("allowHalf"),bool("disabled"),node("character")],"Star rating.",{value:4}),ui("Table",[json("columns","{ title: string; dataIndex: string; key: string }[]"),json("dataSource","Record<string, ReactNode>[] (each row needs a `key`)"),enumProp("size",["large","middle","small"],"large"),json("pagination","false | object"),bool("bordered"),bool("loading"),bool("showHeader"),str("rowKey"),json("scroll","{ x?: number | string; y?: number | string }"),bool("sticky"),enumProp("tableLayout",["auto","fixed"]),json("rowSelection",'{ type?: "checkbox" | "radio"; selectedRowKeys?: (string | number)[] }'),node("caption")],"Data table \u2014 drive it with `columns` + `dataSource` (no render functions in design JSON).",{columns:[{title:"Name",dataIndex:"name",key:"name"},{title:"Role",dataIndex:"role",key:"role"}],dataSource:[{key:"1",name:"Ada Lovelace",role:"Admin"},{key:"2",name:"Grace Hopper",role:"Member"}],pagination:!1}),ui("List",[children,enumProp("size",["default","small","large"],"default"),bool("bordered"),node("header"),node("footer"),bool("split"),enumProp("itemLayout",["horizontal","vertical"],"horizontal"),bool("loading"),json("grid","{ gutter?: number; column?: number }")],"Compose with ListItem children (skip `dataSource`/`renderItem` \u2014 functions don't fit design JSON).",{bordered:!0}),sub("List.Item",[children,node("extra"),json("actions","ReactNode[]")],"One row inside a List \u2014 antd's List.Item."),sub("List.Item.Meta",[node("title"),node("description"),node("avatar")],"Title/description/avatar layout inside a ListItem \u2014 antd's List.Item.Meta.",{title:"Deploy finished",description:"2 minutes ago"}),ui("Tabs",[json("items","{ key: string; label: string; children?: ReactNode }[]"),str("activeKey"),enumProp("type",["line","card","editable-card"],"line"),enumProp("size",SIZES,"middle"),bool("centered"),enumProp("tabPosition",["top","right","bottom","left"],"top"),node("tabBarExtraContent"),num("tabBarGutter"),css("tabBarStyle")],"Tab bar + active pane, driven by `items`.",{items:[{key:"1",label:"Overview",children:"Overview content"},{key:"2",label:"Settings",children:"Settings content"}]}),ui("Steps",[num("current"),json("items","{ title: string; description?: string }[]"),enumProp("direction",["horizontal","vertical"],"horizontal"),enumProp("size",["default","small"],"default"),enumProp("status",["wait","process","finish","error"],"process"),enumProp("type",["default","navigation","inline"],"default"),enumProp("labelPlacement",["horizontal","vertical"],"horizontal"),bool("progressDot"),num("percent"),num("initial")],void 0,{current:1,items:[{title:"Build"},{title:"Review"},{title:"Ship"}]}),ui("Breadcrumb",[json("items","{ title: ReactNode }[]"),node("separator")],void 0,{items:[{title:"Home"},{title:"Reports"}]}),ui("Pagination",[num("current"),num("total"),num("pageSize"),bool("simple"),enumProp("size",["default","small"],"default"),enumProp("align",["start","center","end"],"start"),bool("showSizeChanger"),bool("showQuickJumper"),bool("showLessItems"),bool("hideOnSinglePage"),bool("disabled")],void 0,{current:1,total:50}),ui("Menu",[json("items","{ key: string; label: ReactNode; icon?: ReactNode }[]"),enumProp("mode",["vertical","horizontal","inline"],"vertical"),json("selectedKeys","string[]"),json("openKeys","string[]"),enumProp("theme",["light","dark"],"light"),bool("inlineCollapsed"),num("inlineIndent"),bool("selectable"),bool("multiple")],"Navigation menu driven by `items` (antd v5 dropped JSX children menus).",{mode:"inline",items:[{key:"home",label:"Home"},{key:"reports",label:"Reports"}],selectedKeys:["home"]}),ui("Modal",[children,node("title"),json("width","number | string"),node("footer"),bool("open"),bool("centered"),bool("closable"),node("okText"),node("cancelText"),enumProp("okType",["primary","default","dashed","text","link"],"primary"),bool("confirmLoading"),bool("loading"),json("okButtonProps","ButtonProps"),json("cancelButtonProps","ButtonProps"),styles("header body footer content mask")],"Modal dialog surface \u2014 renders open + inline in design mode. Put the body in children; `footer` renders as a right-aligned action row.",{title:"Delete item?"}),ui("Drawer",[children,node("title"),node("extra"),node("footer"),bool("open"),enumProp("placement",["top","right","bottom","left"],"right"),enumProp("size",["default","large"],"default"),json("width","number | string"),json("height","number | string"),bool("closable"),bool("loading"),styles("header body footer content wrapper mask")],"A side panel \u2014 renders inline as a fixed-width column in design mode.",{title:"Filters"}),ui("Popover",[children,node("title"),node("content"),enumProp("placement",PLACEMENTS,"top"),bool("open"),json("arrow","boolean | { pointAtCenter?: boolean }"),color("color"),styles("root body")],"A popover \u2014 the trigger child renders inline with the surface pinned open below it.",{title:"Details",content:"Popover body"}),ui("Tooltip",[children,node("title"),enumProp("placement",PLACEMENTS,"top"),bool("open"),json("arrow","boolean | { pointAtCenter?: boolean }"),color("color"),styles("root body")],"The trigger child renders inline; `title` shows beside it as a dark pill in design mode.",{title:"Copy to clipboard"}),ui("Dropdown",[children,json("menu","{ items: { key: string; label: ReactNode }[] }"),enumProp("placement",["bottomLeft","bottom","bottomRight","topLeft","top","topRight"],"bottomLeft"),bool("open"),json("arrow","boolean | { pointAtCenter?: boolean }"),json("trigger",'("click" | "hover" | "contextMenu")[]'),bool("disabled")],"The trigger child renders inline with the menu surface pinned open below it.",{menu:{items:[{key:"edit",label:"Edit"},{key:"delete",label:"Delete"}]}}),{id:"Box",category:"ui",source:"velloo",plainElement:!0,props:[children,{name:"as",type:"string",optional:!0,control:"string"},style],designModeNotes:'A plain HTML element \u2014 a div unless `as` names another lowercase tag ("span", "section", "ul"). Compose writes `<div>`/`<span>` as Box for you. Emits as the bare element with its `style`. Reach for antd\'s `Flex`/`Space` for layout and `Typography*` for text first.'},helper("Icon",[{name:"name",type:"string",optional:!1,control:"icon"},{name:"size",type:"number",optional:!0,control:"number"}],"A lucide icon \u2014 antd's icon set isn't bundled. Set the pixel `size` prop (not Tailwind). `name` is a lucide id (PascalCase or kebab). Emits a `lucide-react` import.",{name:"ArrowRight",size:20}),helper("Image",[{name:"src",type:"string",optional:!1,control:"string"},{name:"alt",type:"string",optional:!1,control:"string"}],"An image. Use velloo assets (`/assets/\u2026`) or a URL."),helper("Placeholder",[{name:"label",type:"string",optional:!0,control:"string"}],"A labeled placeholder box for imagery you haven't authored yet (avatars, hero shots)."),helper("SVG",[{name:"content",type:"string",optional:!1,control:"string"},{name:"viewBox",type:"string",optional:!1,control:"string"}],"Raw inline SVG markup."),helper("Layer",[children],"An absolutely-positioned overlay layer for stacked composition."),helper("Gradient",[{name:"from",type:"string",optional:!0,control:"color"}],"A gradient fill block."),helper("Prose",[children,{name:"preset",type:"string",optional:!0,control:"string"},{name:"as",type:"string",optional:!0,control:"string"}],"A long-form content region. Everything inside \u2014 Typography, headings, lists, quotes, code, tables \u2014 picks up the theme typeset's proportions and vertical rhythm automatically. `preset` selects a named typeset (see set_typeset). Reach for this for articles, docs, and marketing copy instead of setting sizes block by block.",{as:"article"})];var React7=__toESM(require_react_development());function _typeof(o){return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var REACT_ELEMENT_TYPE_18=Symbol.for("react.element"),REACT_ELEMENT_TYPE_19=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function isFragment(object){return object&&_typeof(object)==="object"&&(object.$$typeof===REACT_ELEMENT_TYPE_18||object.$$typeof===REACT_ELEMENT_TYPE_19)&&object.type===REACT_FRAGMENT_TYPE}var import_react=__toESM(require_react_development());function toArray(children){var option=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ret=[];return import_react.default.Children.forEach(children,function(child){if((child===void 0||child===null)&&!option.keepEmpty)return;if(Array.isArray(child))ret=ret.concat(toArray(child));else if(isFragment(child)&&child.props)ret=ret.concat(toArray(child.props.children,option));else ret.push(child)}),ret}var warned={},preWarningFns=[],preMessage=function(fn){preWarningFns.push(fn)};function warning(valid,message){if(!valid&&console!==void 0){var finalMessage=preWarningFns.reduce(function(msg,preMessageFn){return preMessageFn(msg!==null&&msg!==void 0?msg:"","warning")},message);if(finalMessage)console.error("Warning: ".concat(finalMessage))}}function note(valid,message){if(!valid&&console!==void 0){var finalMessage=preWarningFns.reduce(function(msg,preMessageFn){return preMessageFn(msg!==null&&msg!==void 0?msg:"","note")},message);if(finalMessage)console.warn("Note: ".concat(finalMessage))}}function resetWarned(){warned={}}function call(method,valid,message){if(!valid&&!warned[message])method(!1,message),warned[message]=!0}function warningOnce(valid,message){call(warning,valid,message)}function noteOnce(valid,message){call(note,valid,message)}warningOnce.preMessage=preMessage;warningOnce.resetWarned=resetWarned;warningOnce.noteOnce=noteOnce;var warning_default=warningOnce;function toPrimitive(t,r){if(_typeof(t)!="object"||!t)return t;var e=t[Symbol.toPrimitive];if(e!==void 0){var i=e.call(t,r||"default");if(_typeof(i)!="object")return i;throw TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function toPropertyKey(t){var i=toPrimitive(t,"string");return _typeof(i)=="symbol"?i:i+""}function _defineProperty(e,r,t){return(r=toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread2(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}var import_react2=__toESM(require_react_development()),import_react_dom=__toESM(require_react_dom());function isDOM(node){return node instanceof HTMLElement||node instanceof SVGElement}function getDOM(node){if(node&&_typeof(node)==="object"&&isDOM(node.nativeElement))return node.nativeElement;if(isDOM(node))return node;return null}function findDOMNode(node){var domNode=getDOM(node);if(domNode)return domNode;if(node instanceof import_react2.default.Component){var _ReactDOM$findDOMNode;return(_ReactDOM$findDOMNode=import_react_dom.default.findDOMNode)===null||_ReactDOM$findDOMNode===void 0?void 0:_ReactDOM$findDOMNode.call(import_react_dom.default,node)}return null}var import_react3=__toESM(require_react_development()),import_react_is=__toESM(require_react_is_development());var React3=__toESM(require_react_development());function useMemo(getValue,condition,shouldUpdate){var cacheRef=React3.useRef({});if(!("value"in cacheRef.current)||shouldUpdate(cacheRef.current.condition,condition))cacheRef.current.value=getValue(),cacheRef.current.condition=condition;return cacheRef.current.value}var ReactMajorVersion=Number(import_react3.version.split(".")[0]),fillRef=function(ref,node){if(typeof ref==="function")ref(node);else if(_typeof(ref)==="object"&&ref&&"current"in ref)ref.current=node},composeRef=function(){for(var _len=arguments.length,refs=Array(_len),_key=0;_key<_len;_key++)refs[_key]=arguments[_key];var refList=refs.filter(Boolean);if(refList.length<=1)return refList[0];return function(node){refs.forEach(function(ref){fillRef(ref,node)})}},useComposeRef=function(){for(var _len2=arguments.length,refs=Array(_len2),_key2=0;_key2<_len2;_key2++)refs[_key2]=arguments[_key2];return useMemo(function(){return composeRef.apply(void 0,refs)},refs,function(prev,next){return prev.length!==next.length||prev.every(function(ref,i){return ref!==next[i]})})},supportRef=function(nodeOrComponent){var _type$prototype,_nodeOrComponent$prot;if(!nodeOrComponent)return!1;if(isReactElement(nodeOrComponent)&&ReactMajorVersion>=19)return!0;var type=import_react_is.isMemo(nodeOrComponent)?nodeOrComponent.type.type:nodeOrComponent.type;if(typeof type==="function"&&!((_type$prototype=type.prototype)!==null&&_type$prototype!==void 0&&_type$prototype.render)&&type.$$typeof!==import_react_is.ForwardRef)return!1;if(typeof nodeOrComponent==="function"&&!((_nodeOrComponent$prot=nodeOrComponent.prototype)!==null&&_nodeOrComponent$prot!==void 0&&_nodeOrComponent$prot.render)&&nodeOrComponent.$$typeof!==import_react_is.ForwardRef)return!1;return!0};function isReactElement(node){return import_react3.isValidElement(node)&&!isFragment(node)}var supportNodeRef=function(node){return isReactElement(node)&&supportRef(node)},getNodeRef=function(node){if(node&&isReactElement(node)){var ele=node;return ele.props.propertyIsEnumerable("ref")?ele.props.ref:ele.ref}return null};var React6=__toESM(require_react_development());var React4=__toESM(require_react_development()),CollectionContext=React4.createContext(null);function Collection(_ref){var{children,onBatchResize}=_ref,resizeIdRef=React4.useRef(0),resizeInfosRef=React4.useRef([]),onCollectionResize=React4.useContext(CollectionContext),onResize=React4.useCallback(function(size,element,data){resizeIdRef.current+=1;var currentId=resizeIdRef.current;resizeInfosRef.current.push({size,element,data}),Promise.resolve().then(function(){if(currentId===resizeIdRef.current)onBatchResize===null||onBatchResize===void 0||onBatchResize(resizeInfosRef.current),resizeInfosRef.current=[]}),onCollectionResize===null||onCollectionResize===void 0||onCollectionResize(size,element,data)},[onBatchResize,onCollectionResize]);return React4.createElement(CollectionContext.Provider,{value:onResize},children)}var MapShim=function(){if(typeof Map<"u")return Map;function getIndex(arr,key){var result=-1;return arr.some(function(entry,index){if(entry[0]===key)return result=index,!0;return!1}),result}return function(){function class_1(){this.__entries__=[]}return Object.defineProperty(class_1.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),class_1.prototype.get=function(key){var index=getIndex(this.__entries__,key),entry=this.__entries__[index];return entry&&entry[1]},class_1.prototype.set=function(key,value){var index=getIndex(this.__entries__,key);if(~index)this.__entries__[index][1]=value;else this.__entries__.push([key,value])},class_1.prototype.delete=function(key){var entries=this.__entries__,index=getIndex(entries,key);if(~index)entries.splice(index,1)},class_1.prototype.has=function(key){return!!~getIndex(this.__entries__,key)},class_1.prototype.clear=function(){this.__entries__.splice(0)},class_1.prototype.forEach=function(callback,ctx){if(ctx===void 0)ctx=null;for(var _i=0,_a=this.__entries__;_i<_a.length;_i++){var entry=_a[_i];callback.call(ctx,entry[1],entry[0])}},class_1}()}(),isBrowser=typeof window<"u"&&typeof document<"u"&&window.document===document,global$1=function(){if(typeof global<"u"&&global.Math===Math)return global;if(typeof self<"u"&&self.Math===Math)return self;if(typeof window<"u"&&window.Math===Math)return window;return Function("return this")()}(),requestAnimationFrame$1=function(){if(typeof requestAnimationFrame==="function")return requestAnimationFrame.bind(global$1);return function(callback){return setTimeout(function(){return callback(Date.now())},16.666666666666668)}}(),trailingTimeout=2;function throttle(callback,delay){var leadingCall=!1,trailingCall=!1,lastCallTime=0;function resolvePending(){if(leadingCall)leadingCall=!1,callback();if(trailingCall)proxy()}function timeoutCallback(){requestAnimationFrame$1(resolvePending)}function proxy(){var timeStamp=Date.now();if(leadingCall){if(timeStamp-lastCallTime<trailingTimeout)return;trailingCall=!0}else leadingCall=!0,trailingCall=!1,setTimeout(timeoutCallback,delay);lastCallTime=timeStamp}return proxy}var REFRESH_DELAY=20,transitionKeys=["top","right","bottom","left","width","height","size","weight"],mutationObserverSupported=typeof MutationObserver<"u",ResizeObserverController=function(){function ResizeObserverController(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=throttle(this.refresh.bind(this),REFRESH_DELAY)}return ResizeObserverController.prototype.addObserver=function(observer){if(!~this.observers_.indexOf(observer))this.observers_.push(observer);if(!this.connected_)this.connect_()},ResizeObserverController.prototype.removeObserver=function(observer){var observers=this.observers_,index=observers.indexOf(observer);if(~index)observers.splice(index,1);if(!observers.length&&this.connected_)this.disconnect_()},ResizeObserverController.prototype.refresh=function(){var changesDetected=this.updateObservers_();if(changesDetected)this.refresh()},ResizeObserverController.prototype.updateObservers_=function(){var activeObservers=this.observers_.filter(function(observer){return observer.gatherActive(),observer.hasActive()});return activeObservers.forEach(function(observer){return observer.broadcastActive()}),activeObservers.length>0},ResizeObserverController.prototype.connect_=function(){if(!isBrowser||this.connected_)return;if(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mutationObserverSupported)this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0});else document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0;this.connected_=!0},ResizeObserverController.prototype.disconnect_=function(){if(!isBrowser||!this.connected_)return;if(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_)this.mutationsObserver_.disconnect();if(this.mutationEventsAdded_)document.removeEventListener("DOMSubtreeModified",this.refresh);this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1},ResizeObserverController.prototype.onTransitionEnd_=function(_a){var _b=_a.propertyName,propertyName=_b===void 0?"":_b,isReflowProperty=transitionKeys.some(function(key){return!!~propertyName.indexOf(key)});if(isReflowProperty)this.refresh()},ResizeObserverController.getInstance=function(){if(!this.instance_)this.instance_=new ResizeObserverController;return this.instance_},ResizeObserverController.instance_=null,ResizeObserverController}(),defineConfigurable=function(target,props){for(var _i=0,_a=Object.keys(props);_i<_a.length;_i++){var key=_a[_i];Object.defineProperty(target,key,{value:props[key],enumerable:!1,writable:!1,configurable:!0})}return target},getWindowOf=function(target){var ownerGlobal=target&&target.ownerDocument&&target.ownerDocument.defaultView;return ownerGlobal||global$1},emptyRect=createRectInit(0,0,0,0);function toFloat(value){return parseFloat(value)||0}function getBordersSize(styles){var positions=[];for(var _i=1;_i<arguments.length;_i++)positions[_i-1]=arguments[_i];return positions.reduce(function(size,position){var value=styles["border-"+position+"-width"];return size+toFloat(value)},0)}function getPaddings(styles){var positions=["top","right","bottom","left"],paddings={};for(var _i=0,positions_1=positions;_i<positions_1.length;_i++){var position=positions_1[_i],value=styles["padding-"+position];paddings[position]=toFloat(value)}return paddings}function getSVGContentRect(target){var bbox=target.getBBox();return createRectInit(0,0,bbox.width,bbox.height)}function getHTMLElementContentRect(target){var{clientWidth,clientHeight}=target;if(!clientWidth&&!clientHeight)return emptyRect;var styles=getWindowOf(target).getComputedStyle(target),paddings=getPaddings(styles),horizPad=paddings.left+paddings.right,vertPad=paddings.top+paddings.bottom,width=toFloat(styles.width),height=toFloat(styles.height);if(styles.boxSizing==="border-box"){if(Math.round(width+horizPad)!==clientWidth)width-=getBordersSize(styles,"left","right")+horizPad;if(Math.round(height+vertPad)!==clientHeight)height-=getBordersSize(styles,"top","bottom")+vertPad}if(!isDocumentElement(target)){var vertScrollbar=Math.round(width+horizPad)-clientWidth,horizScrollbar=Math.round(height+vertPad)-clientHeight;if(Math.abs(vertScrollbar)!==1)width-=vertScrollbar;if(Math.abs(horizScrollbar)!==1)height-=horizScrollbar}return createRectInit(paddings.left,paddings.top,width,height)}var isSVGGraphicsElement=function(){if(typeof SVGGraphicsElement<"u")return function(target){return target instanceof getWindowOf(target).SVGGraphicsElement};return function(target){return target instanceof getWindowOf(target).SVGElement&&typeof target.getBBox==="function"}}();function isDocumentElement(target){return target===getWindowOf(target).document.documentElement}function getContentRect(target){if(!isBrowser)return emptyRect;if(isSVGGraphicsElement(target))return getSVGContentRect(target);return getHTMLElementContentRect(target)}function createReadOnlyRect(_a){var{x,y,width,height}=_a,Constr=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,rect=Object.create(Constr.prototype);return defineConfigurable(rect,{x,y,width,height,top:y,right:x+width,bottom:height+y,left:x}),rect}function createRectInit(x,y,width,height){return{x,y,width,height}}var ResizeObservation=function(){function ResizeObservation(target){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=createRectInit(0,0,0,0),this.target=target}return ResizeObservation.prototype.isActive=function(){var rect=getContentRect(this.target);return this.contentRect_=rect,rect.width!==this.broadcastWidth||rect.height!==this.broadcastHeight},ResizeObservation.prototype.broadcastRect=function(){var rect=this.contentRect_;return this.broadcastWidth=rect.width,this.broadcastHeight=rect.height,rect},ResizeObservation}(),ResizeObserverEntry=function(){function ResizeObserverEntry(target,rectInit){var contentRect=createReadOnlyRect(rectInit);defineConfigurable(this,{target,contentRect})}return ResizeObserverEntry}(),ResizeObserverSPI=function(){function ResizeObserverSPI(callback,controller,callbackCtx){if(this.activeObservations_=[],this.observations_=new MapShim,typeof callback!=="function")throw TypeError("The callback provided as parameter 1 is not a function.");this.callback_=callback,this.controller_=controller,this.callbackCtx_=callbackCtx}return ResizeObserverSPI.prototype.observe=function(target){if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");if(typeof Element>"u"||!(Element instanceof Object))return;if(!(target instanceof getWindowOf(target).Element))throw TypeError('parameter 1 is not of type "Element".');var observations=this.observations_;if(observations.has(target))return;observations.set(target,new ResizeObservation(target)),this.controller_.addObserver(this),this.controller_.refresh()},ResizeObserverSPI.prototype.unobserve=function(target){if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");if(typeof Element>"u"||!(Element instanceof Object))return;if(!(target instanceof getWindowOf(target).Element))throw TypeError('parameter 1 is not of type "Element".');var observations=this.observations_;if(!observations.has(target))return;if(observations.delete(target),!observations.size)this.controller_.removeObserver(this)},ResizeObserverSPI.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},ResizeObserverSPI.prototype.gatherActive=function(){var _this=this;this.clearActive(),this.observations_.forEach(function(observation){if(observation.isActive())_this.activeObservations_.push(observation)})},ResizeObserverSPI.prototype.broadcastActive=function(){if(!this.hasActive())return;var ctx=this.callbackCtx_,entries=this.activeObservations_.map(function(observation){return new ResizeObserverEntry(observation.target,observation.broadcastRect())});this.callback_.call(ctx,entries,ctx),this.clearActive()},ResizeObserverSPI.prototype.clearActive=function(){this.activeObservations_.splice(0)},ResizeObserverSPI.prototype.hasActive=function(){return this.activeObservations_.length>0},ResizeObserverSPI}(),observers=typeof WeakMap<"u"?new WeakMap:new MapShim,ResizeObserver2=function(){function ResizeObserver2(callback){if(!(this instanceof ResizeObserver2))throw TypeError("Cannot call a class as a function.");if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");var controller=ResizeObserverController.getInstance(),observer=new ResizeObserverSPI(callback,controller,this);observers.set(this,observer)}return ResizeObserver2}();["observe","unobserve","disconnect"].forEach(function(method){ResizeObserver2.prototype[method]=function(){var _a;return(_a=observers.get(this))[method].apply(_a,arguments)}});var index=function(){if(typeof global$1.ResizeObserver<"u")return global$1.ResizeObserver;return ResizeObserver2}(),ResizeObserver_es_default=index;var elementListeners=new Map;function onResize(entities){entities.forEach(function(entity){var _elementListeners$get,target=entity.target;(_elementListeners$get=elementListeners.get(target))===null||_elementListeners$get===void 0||_elementListeners$get.forEach(function(listener){return listener(target)})})}var resizeObserver=new ResizeObserver_es_default(onResize);function observe(element,callback){if(!elementListeners.has(element))elementListeners.set(element,new Set),resizeObserver.observe(element);elementListeners.get(element).add(callback)}function unobserve(element,callback){if(elementListeners.has(element)){if(elementListeners.get(element).delete(callback),!elementListeners.get(element).size)resizeObserver.unobserve(element),elementListeners.delete(element)}}function _classCallCheck(a,n){if(!(a instanceof n))throw TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _inherits(t,e){if(typeof e!="function"&&e!==null)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function(){return!!t})()}function _possibleConstructorReturn(t,e){if(e&&(_typeof(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _createSuper(t){var r=_isNativeReflectConstruct();return function(){var e,o=_getPrototypeOf(t);if(r){var s=_getPrototypeOf(this).constructor;e=Reflect.construct(o,arguments,s)}else e=o.apply(this,arguments);return _possibleConstructorReturn(this,e)}}var React5=__toESM(require_react_development()),DomWrapper=function(_React$Component){_inherits(DomWrapper,_React$Component);var _super=_createSuper(DomWrapper);function DomWrapper(){return _classCallCheck(this,DomWrapper),_super.apply(this,arguments)}return _createClass(DomWrapper,[{key:"render",value:function(){return this.props.children}}]),DomWrapper}(React5.Component);function SingleObserver(props,ref){var{children,disabled}=props,elementRef=React6.useRef(null),wrapperRef=React6.useRef(null),onCollectionResize=React6.useContext(CollectionContext),isRenderProps=typeof children==="function",mergedChildren=isRenderProps?children(elementRef):children,sizeRef=React6.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),canRef=!isRenderProps&&React6.isValidElement(mergedChildren)&&supportRef(mergedChildren),originRef=canRef?getNodeRef(mergedChildren):null,mergedRef=useComposeRef(originRef,elementRef),getDom=function(){var _elementRef$current;return findDOMNode(elementRef.current)||(elementRef.current&&_typeof(elementRef.current)==="object"?findDOMNode((_elementRef$current=elementRef.current)===null||_elementRef$current===void 0?void 0:_elementRef$current.nativeElement):null)||findDOMNode(wrapperRef.current)};React6.useImperativeHandle(ref,function(){return getDom()});var propsRef=React6.useRef(props);propsRef.current=props;var onInternalResize=React6.useCallback(function(target){var _propsRef$current=propsRef.current,{onResize,data}=_propsRef$current,_target$getBoundingCl=target.getBoundingClientRect(),{width,height}=_target$getBoundingCl,{offsetWidth,offsetHeight}=target,fixedWidth=Math.floor(width),fixedHeight=Math.floor(height);if(sizeRef.current.width!==fixedWidth||sizeRef.current.height!==fixedHeight||sizeRef.current.offsetWidth!==offsetWidth||sizeRef.current.offsetHeight!==offsetHeight){var size={width:fixedWidth,height:fixedHeight,offsetWidth,offsetHeight};sizeRef.current=size;var mergedOffsetWidth=offsetWidth===Math.round(width)?width:offsetWidth,mergedOffsetHeight=offsetHeight===Math.round(height)?height:offsetHeight,sizeInfo=_objectSpread2(_objectSpread2({},size),{},{offsetWidth:mergedOffsetWidth,offsetHeight:mergedOffsetHeight});if(onCollectionResize===null||onCollectionResize===void 0||onCollectionResize(sizeInfo,target,data),onResize)Promise.resolve().then(function(){onResize(sizeInfo,target)})}},[]);return React6.useEffect(function(){var currentElement=getDom();if(currentElement&&!disabled)observe(currentElement,onInternalResize);return function(){return unobserve(currentElement,onInternalResize)}},[elementRef.current,disabled]),React6.createElement(DomWrapper,{ref:wrapperRef},canRef?React6.cloneElement(mergedChildren,{ref:mergedRef}):mergedChildren)}var RefSingleObserver=React6.forwardRef(SingleObserver);RefSingleObserver.displayName="SingleObserver";var SingleObserver_default=RefSingleObserver;var INTERNAL_PREFIX_KEY="rc-observer-key";function ResizeObserver3(props,ref){var children=props.children,childNodes=typeof children==="function"?[children]:toArray(children);if(childNodes.length>1)warning(!1,"Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead.");else if(childNodes.length===0)warning(!1,"`children` of ResizeObserver is empty. Nothing is in observe.");return childNodes.map(function(child,index){var key=(child===null||child===void 0?void 0:child.key)||"".concat(INTERNAL_PREFIX_KEY,"-").concat(index);return React7.createElement(SingleObserver_default,_extends({},props,{key,ref:index===0?ref:void 0}),child)})}var RefResizeObserver=React7.forwardRef(ResizeObserver3);RefResizeObserver.displayName="ResizeObserver";RefResizeObserver.Collection=Collection;var es_default=RefResizeObserver;function _arrayLikeToArray(r,a){(a==null||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _iterableToArray(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function _unsupportedIterableToArray(r,a){if(r){if(typeof r=="string")return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _nonIterableSpread(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
6
|
+
*/(function(){var hasOwn={}.hasOwnProperty;function classNames(){var classes="";for(var i=0;i<arguments.length;i++){var arg=arguments[i];if(arg)classes=appendClass(classes,parseValue(arg))}return classes}function parseValue(arg){if(typeof arg==="string"||typeof arg==="number")return arg;if(typeof arg!=="object")return"";if(Array.isArray(arg))return classNames.apply(null,arg);if(arg.toString!==Object.prototype.toString&&!arg.toString.toString().includes("[native code]"))return arg.toString();var classes="";for(var key in arg)if(hasOwn.call(arg,key)&&arg[key])classes=appendClass(classes,key);return classes}function appendClass(value,newClass){if(!newClass)return value;if(value)return value+" "+newClass;return value+newClass}if(typeof module<"u"&&module.exports)classNames.default=classNames,module.exports=classNames;else if(typeof define==="function"&&typeof define.amd==="object"&&define.amd)define("classnames",[],function(){return classNames});else window.classNames=classNames})()});var require_react_is_development=__commonJS(function(exports){(function(){var REACT_ELEMENT_TYPE=Symbol.for("react.element"),REACT_PORTAL_TYPE=Symbol.for("react.portal"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment"),REACT_STRICT_MODE_TYPE=Symbol.for("react.strict_mode"),REACT_PROFILER_TYPE=Symbol.for("react.profiler"),REACT_PROVIDER_TYPE=Symbol.for("react.provider"),REACT_CONTEXT_TYPE=Symbol.for("react.context"),REACT_SERVER_CONTEXT_TYPE=Symbol.for("react.server_context"),REACT_FORWARD_REF_TYPE=Symbol.for("react.forward_ref"),REACT_SUSPENSE_TYPE=Symbol.for("react.suspense"),REACT_SUSPENSE_LIST_TYPE=Symbol.for("react.suspense_list"),REACT_MEMO_TYPE=Symbol.for("react.memo"),REACT_LAZY_TYPE=Symbol.for("react.lazy"),REACT_OFFSCREEN_TYPE=Symbol.for("react.offscreen"),enableScopeAPI=!1,enableCacheElement=!1,enableTransitionTracing=!1,enableLegacyHidden=!1,enableDebugTracing=!1,REACT_MODULE_REFERENCE;REACT_MODULE_REFERENCE=Symbol.for("react.module.reference");function isValidElementType(type){if(typeof type==="string"||typeof type==="function")return!0;if(type===REACT_FRAGMENT_TYPE||type===REACT_PROFILER_TYPE||enableDebugTracing||type===REACT_STRICT_MODE_TYPE||type===REACT_SUSPENSE_TYPE||type===REACT_SUSPENSE_LIST_TYPE||enableLegacyHidden||type===REACT_OFFSCREEN_TYPE||enableScopeAPI||enableCacheElement||enableTransitionTracing)return!0;if(typeof type==="object"&&type!==null){if(type.$$typeof===REACT_LAZY_TYPE||type.$$typeof===REACT_MEMO_TYPE||type.$$typeof===REACT_PROVIDER_TYPE||type.$$typeof===REACT_CONTEXT_TYPE||type.$$typeof===REACT_FORWARD_REF_TYPE||type.$$typeof===REACT_MODULE_REFERENCE||type.getModuleId!==void 0)return!0}return!1}function typeOf(object){if(typeof object==="object"&&object!==null){var $$typeof=object.$$typeof;switch($$typeof){case REACT_ELEMENT_TYPE:var type=object.type;switch(type){case REACT_FRAGMENT_TYPE:case REACT_PROFILER_TYPE:case REACT_STRICT_MODE_TYPE:case REACT_SUSPENSE_TYPE:case REACT_SUSPENSE_LIST_TYPE:return type;default:var $$typeofType=type&&type.$$typeof;switch($$typeofType){case REACT_SERVER_CONTEXT_TYPE:case REACT_CONTEXT_TYPE:case REACT_FORWARD_REF_TYPE:case REACT_LAZY_TYPE:case REACT_MEMO_TYPE:case REACT_PROVIDER_TYPE:return $$typeofType;default:return $$typeof}}case REACT_PORTAL_TYPE:return $$typeof}}return}var ContextConsumer=REACT_CONTEXT_TYPE,ContextProvider=REACT_PROVIDER_TYPE,Element2=REACT_ELEMENT_TYPE,ForwardRef=REACT_FORWARD_REF_TYPE,Fragment=REACT_FRAGMENT_TYPE,Lazy=REACT_LAZY_TYPE,Memo=REACT_MEMO_TYPE,Portal=REACT_PORTAL_TYPE,Profiler=REACT_PROFILER_TYPE,StrictMode=REACT_STRICT_MODE_TYPE,Suspense=REACT_SUSPENSE_TYPE,SuspenseList=REACT_SUSPENSE_LIST_TYPE,hasWarnedAboutDeprecatedIsAsyncMode=!1,hasWarnedAboutDeprecatedIsConcurrentMode=!1;function isAsyncMode(object){if(!hasWarnedAboutDeprecatedIsAsyncMode)hasWarnedAboutDeprecatedIsAsyncMode=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.");return!1}function isConcurrentMode(object){if(!hasWarnedAboutDeprecatedIsConcurrentMode)hasWarnedAboutDeprecatedIsConcurrentMode=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.");return!1}function isContextConsumer(object){return typeOf(object)===REACT_CONTEXT_TYPE}function isContextProvider(object){return typeOf(object)===REACT_PROVIDER_TYPE}function isElement(object){return typeof object==="object"&&object!==null&&object.$$typeof===REACT_ELEMENT_TYPE}function isForwardRef(object){return typeOf(object)===REACT_FORWARD_REF_TYPE}function isFragment(object){return typeOf(object)===REACT_FRAGMENT_TYPE}function isLazy(object){return typeOf(object)===REACT_LAZY_TYPE}function isMemo(object){return typeOf(object)===REACT_MEMO_TYPE}function isPortal(object){return typeOf(object)===REACT_PORTAL_TYPE}function isProfiler(object){return typeOf(object)===REACT_PROFILER_TYPE}function isStrictMode(object){return typeOf(object)===REACT_STRICT_MODE_TYPE}function isSuspense(object){return typeOf(object)===REACT_SUSPENSE_TYPE}function isSuspenseList(object){return typeOf(object)===REACT_SUSPENSE_LIST_TYPE}exports.ContextConsumer=ContextConsumer,exports.ContextProvider=ContextProvider,exports.Element=Element2,exports.ForwardRef=ForwardRef,exports.Fragment=Fragment,exports.Lazy=Lazy,exports.Memo=Memo,exports.Portal=Portal,exports.Profiler=Profiler,exports.StrictMode=StrictMode,exports.Suspense=Suspense,exports.SuspenseList=SuspenseList,exports.isAsyncMode=isAsyncMode,exports.isConcurrentMode=isConcurrentMode,exports.isContextConsumer=isContextConsumer,exports.isContextProvider=isContextProvider,exports.isElement=isElement,exports.isForwardRef=isForwardRef,exports.isFragment=isFragment,exports.isLazy=isLazy,exports.isMemo=isMemo,exports.isPortal=isPortal,exports.isProfiler=isProfiler,exports.isStrictMode=isStrictMode,exports.isSuspense=isSuspense,exports.isSuspenseList=isSuspenseList,exports.isValidElementType=isValidElementType,exports.typeOf=typeOf})()});var require_toggle_selection=__commonJS(function(exports,module){module.exports=function(){var selection=document.getSelection();if(!selection.rangeCount)return function(){};var active=document.activeElement,ranges=[];for(var i=0;i<selection.rangeCount;i++)ranges.push(selection.getRangeAt(i));switch(active.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":active.blur();break;default:active=null;break}return selection.removeAllRanges(),function(){if(selection.type==="Caret"&&selection.removeAllRanges(),!selection.rangeCount)ranges.forEach(function(range){selection.addRange(range)});active&&active.focus()}}});var require_copy_to_clipboard=__commonJS(function(exports,module){var deselectCurrent=require_toggle_selection(),clipboardToIE11Formatting={"text/plain":"Text","text/html":"Url",default:"Text"},defaultMessage="Copy to clipboard: #{key}, Enter";function format(message){var copyKey=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return message.replace(/#{\s*key\s*}/g,copyKey)}function copy(text,options){var debug,message,reselectPrevious,range,selection,mark,success=!1;if(!options)options={};debug=options.debug||!1;try{reselectPrevious=deselectCurrent(),range=document.createRange(),selection=document.getSelection(),mark=document.createElement("span"),mark.textContent=text,mark.ariaHidden="true",mark.style.all="unset",mark.style.position="fixed",mark.style.top=0,mark.style.clip="rect(0, 0, 0, 0)",mark.style.whiteSpace="pre",mark.style.webkitUserSelect="text",mark.style.MozUserSelect="text",mark.style.msUserSelect="text",mark.style.userSelect="text",mark.addEventListener("copy",function(e){if(e.stopPropagation(),options.format)if(e.preventDefault(),typeof e.clipboardData>"u"){debug&&console.warn("unable to use e.clipboardData"),debug&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var format=clipboardToIE11Formatting[options.format]||clipboardToIE11Formatting.default;window.clipboardData.setData(format,text)}else e.clipboardData.clearData(),e.clipboardData.setData(options.format,text);if(options.onCopy)e.preventDefault(),options.onCopy(e.clipboardData)}),document.body.appendChild(mark),range.selectNodeContents(mark),selection.addRange(range);var successful=document.execCommand("copy");if(!successful)throw Error("copy command was unsuccessful");success=!0}catch(err){debug&&console.error("unable to copy using execCommand: ",err),debug&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(options.format||"text",text),options.onCopy&&options.onCopy(window.clipboardData),success=!0}catch(err){debug&&console.error("unable to copy using clipboardData: ",err),debug&&console.error("falling back to prompt"),message=format("message"in options?options.message:defaultMessage),window.prompt(message,text)}}finally{if(selection)if(typeof selection.removeRange=="function")selection.removeRange(range);else selection.removeAllRanges();if(mark)document.body.removeChild(mark);reselectPrevious()}return success}module.exports=copy});import{dirname,join}from"path";import{fileURLToPath}from"url";var ANTD_INTRO=["**This folder targets Ant Design v5.** Components are real antd: `Flex`/`Space`/`Row`+`Col` for layout, `Card`, `TypographyTitle`/`TypographyText`/`TypographyParagraph` (ALL text \u2014 antd's `Typography.Title/Text/Paragraph`, which compose under flat ids because a `$ref` can't carry a dot, and emit as the dotted exports), `Button`, `Input`/`Select`/`Checkbox`/`Radio`/`Switch`/`Segmented`/`Slider`/`Rate`, `Tag`/`Badge`/`Avatar`/`Alert`/`Statistic`/`Progress`/`Skeleton`/`Empty`, `Table`/`List`+`ListItem`/`Tabs`/`Steps`/`Breadcrumb`/`Pagination`/`Menu` (data components take `items`/`columns` arrays \u2014 no render functions), and the overlay surface `Modal`/`Drawer`/`Popover`/`Tooltip`/`Dropdown` (rendered open + inline in design mode). Call `list_components` for the full set and per-component `example` props.","",'**Style through the inline `style` object.** `update_props { style: { display: "flex", alignItems: "center", gap: "16px", padding: "24px" } }` \u2014 a plain React style object (merges shallowly; an inner `null` drops a key, `style: null` clears). The theme runs in antd\'s `cssVar` mode, so antd tokens are CSS variables: inside any antd component subtree you can reference `var(--ant-color-primary)`, `var(--ant-color-text-secondary)`, `var(--ant-color-bg-container)`, `var(--ant-border-radius)` etc. to stay themable; plain CSS values always work. Prefer component props (`type`, `size`, `gap`) over style overrides where they exist. A plain `<div>`/`<span>` composes as `Box` and emits as the bare element.',"","`emit_code` emits idiomatic antd JSX with `style={{\u2026}}`, already written against the real exports \u2014 `<Typography.Title>`, `<List.Item.Meta>` \u2014 and `packagesToImport` names the package they come from. `emit_theme` emits a ConfigProvider `ThemeConfig` module (default `antd-theme.ts`) \u2014 wire it with `<ConfigProvider theme={theme}>`. Tailwind utility diagnostics do not apply here.",""];var style={name:"style",type:"CSSProperties | undefined",optional:!0,control:"string"},children={name:"children",type:"ReactNode",optional:!0,control:"string"},enumProp=(name,values,defaultValue)=>({name,type:values.map((v)=>typeof v==="string"?`"${v}"`:`${v}`).join(" | "),optional:!0,control:"enum",enumValues:values,defaultValue}),str=(name,optional=!0)=>({name,type:"string",optional,control:"string"}),num=(name)=>({name,type:"number",optional:!0,control:"number"}),bool=(name)=>({name,type:"boolean",optional:!0,control:"boolean"}),node=(name)=>({name,type:"ReactNode",optional:!0,control:"string"}),json=(name,type)=>({name,type,optional:!0,control:"string"}),color=(name)=>({name,type:"string",optional:!0,control:"color"}),css=(name)=>json(name,"CSSProperties"),styles=(parts)=>json("styles",`{ ${parts.split(" ").map((part)=>`${part}?: CSSProperties`).join("; ")} }`),SIZES=["small","middle","large"],STATUS=["error","warning"],VARIANTS=["outlined","borderless","filled","underlined"],PLACEMENTS=["top","left","right","bottom","topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"],TEXT_DECORATIONS=[bool("code"),bool("mark"),bool("keyboard"),bool("italic"),bool("underline"),bool("delete"),bool("disabled"),json("ellipsis","boolean | { rows?: number; expandable?: boolean }"),json("copyable","boolean | { text?: string }")];function ui(id,props,notes,example){return{id,category:"ui",source:"antd",props:[...props,style],designModeNotes:notes,example}}function sub(nativeExport,props,notes,example){return{...ui(nativeExport.replaceAll(".",""),props,notes,example),nativeExport}}var className={name:"className",type:"string | undefined",optional:!0,control:"string"};function helper(id,props,notes,example){return{id,category:"ui",source:"velloo",props:[...props,className],designModeNotes:notes,example}}var ANTD_MANIFEST=[ui("Flex",[children,bool("vertical"),json("gap",'"small" | "middle" | "large" | number'),str("align"),str("justify"),json("wrap",'boolean | "wrap" | "nowrap" | "wrap-reverse"'),json("flex","string | number"),str("component")],"The flex layout primitive \u2014 use it for every row/column wrapper.",{vertical:!1,gap:"middle",align:"center"}),ui("Space",[children,enumProp("direction",["horizontal","vertical"],"horizontal"),json("size",'"small" | "middle" | "large" | number | [number, number]'),enumProp("align",["start","end","center","baseline"]),bool("wrap"),node("split"),styles("item")],"Inline spacing between adjacent items (buttons, tags).",{size:"middle"}),ui("Row",[children,json("gutter","number | [number, number] | Partial<Record<Breakpoint, number>>"),enumProp("align",["top","middle","bottom","stretch"]),enumProp("justify",["start","end","center","space-around","space-between","space-evenly"]),bool("wrap")],"Grid row; pair with Col spans (24-column grid).",{gutter:16}),ui("Col",[children,num("span"),num("offset"),num("order"),num("push"),num("pull"),json("flex","string | number"),...["xs","sm","md","lg","xl","xxl"].map((bp)=>json(bp,"number | { span?: number; offset?: number; order?: number }"))],"Grid column inside a Row; span is out of 24.",{span:12}),ui("Card",[children,node("title"),node("extra"),enumProp("size",["default","small"],"default"),enumProp("variant",["outlined","borderless"],"outlined"),bool("bordered"),bool("hoverable"),bool("loading"),node("cover"),json("actions","ReactNode[]"),enumProp("type",["inner"]),styles("header body extra title actions cover")],"Card surface with an optional title bar.",{title:"Team"}),ui("Alert",[node("message"),node("description"),enumProp("type",["success","info","warning","error"],"info"),bool("showIcon"),node("icon"),node("action"),bool("banner"),bool("closable")],"Inline alert banner. `message` is the headline; `description` the body.",{type:"info",message:"Workspace synced",showIcon:!0}),ui("Tag",[children,str("color"),bool("bordered"),node("icon"),bool("closable")],'Label chip. `color` takes a preset ("success", "processing", "error", "warning") or any CSS color.',{color:"success",children:"Active"}),ui("Badge",[children,json("count","number | ReactNode"),bool("dot"),num("overflowCount"),bool("showZero"),color("color"),enumProp("status",["success","processing","default","error","warning"]),node("text"),enumProp("size",["default","small"],"default"),json("offset","[number, number]")],"Count/dot indicator wrapping its child (an Avatar, an icon).",{count:5}),ui("Avatar",[children,str("src"),str("alt"),json("size",'"large" | "small" | "default" | number'),enumProp("shape",["circle","square"],"circle"),node("icon"),num("gap")],"Avatar \u2014 `src` image or text children.",{children:"AB"}),ui("Divider",[children,enumProp("type",["horizontal","vertical"],"horizontal"),enumProp("orientation",["left","right","center","start","end"],"center"),json("orientationMargin","string | number"),bool("dashed"),enumProp("variant",["solid","dashed","dotted"],"solid"),bool("plain")]),ui("Skeleton",[bool("active"),json("avatar","boolean | { shape?: 'circle' | 'square'; size?: number }"),json("paragraph","boolean | { rows?: number; width?: number | string | (number | string)[] }"),bool("round"),bool("loading"),children],"Loading placeholder blocks.",{active:!0}),ui("Empty",[node("description"),node("image"),children],"Empty-state illustration + caption.",{description:"No data yet"}),ui("Statistic",[node("title"),json("value","string | number"),node("prefix"),node("suffix"),css("valueStyle"),num("precision"),str("groupSeparator"),str("decimalSeparator"),bool("loading")],"A KPI number with a label.",{title:"Active users",value:112893}),ui("Progress",[num("percent"),enumProp("type",["line","circle","dashboard"],"line"),enumProp("status",["normal","active","success","exception"]),json("strokeColor","string | string[] | { from: string; to: string; direction?: string }"),color("trailColor"),bool("showInfo"),json("size",'"small" | "default" | number | [number | string, number]'),num("strokeWidth"),enumProp("strokeLinecap",["round","butt","square"],"round"),num("steps"),json("success","{ percent?: number; strokeColor?: string }"),num("gapDegree"),json("percentPosition",'{ align?: "start" | "center" | "end"; type?: "inner" | "outer" }')],void 0,{percent:62}),sub("Typography.Title",[children,enumProp("level",[1,2,3,4,5],"1"),enumProp("type",["secondary","success","warning","danger"]),...TEXT_DECORATIONS],"A heading \u2014 antd's Typography.Title. Pick `level` for the scale (1 largest).",{level:2,children:"Team analytics"}),sub("Typography.Text",[children,enumProp("type",["secondary","success","warning","danger"]),bool("strong"),...TEXT_DECORATIONS],"Inline text \u2014 antd's Typography.Text. `type` picks the semantic tone.",{type:"secondary",children:"Updated 2 hours ago"}),sub("Typography.Paragraph",[children,enumProp("type",["secondary","success","warning","danger"]),bool("strong"),...TEXT_DECORATIONS],"Block paragraph \u2014 antd's Typography.Paragraph.",{children:"Body copy for a section."}),ui("Button",[children,enumProp("type",["primary","default","dashed","text","link"],"default"),bool("danger"),enumProp("size",SIZES,"middle"),bool("block"),node("icon"),enumProp("iconPosition",["start","end"],"start"),enumProp("shape",["default","circle","round"],"default"),enumProp("color",["default","primary","danger"]),enumProp("variant",["outlined","dashed","solid","filled","text","link"]),bool("ghost"),bool("loading"),bool("disabled"),str("href"),enumProp("htmlType",["button","submit","reset"],"button"),styles("icon")],"Action button.",{type:"primary",children:"Submit"}),ui("Input",[str("placeholder"),str("value"),enumProp("size",SIZES,"middle"),str("type"),node("prefix"),node("suffix"),node("addonBefore"),node("addonAfter"),bool("allowClear"),bool("disabled"),bool("readOnly"),num("maxLength"),bool("showCount"),enumProp("status",STATUS),enumProp("variant",VARIANTS,"outlined")],void 0,{placeholder:"Email address"}),ui("Select",[str("placeholder"),json("value","string | number | (string | number)[]"),json("options","{ value: string; label: string }[]"),enumProp("size",SIZES,"middle"),enumProp("mode",["multiple","tags"]),bool("allowClear"),bool("disabled"),bool("loading"),bool("showSearch"),node("prefix"),node("suffixIcon"),json("maxTagCount",'number | "responsive"'),enumProp("status",STATUS),enumProp("variant",VARIANTS,"outlined")],"Closed select field in design mode (the dropdown is a portal).",{placeholder:"Pick a role",options:[{value:"admin",label:"Admin"},{value:"viewer",label:"Viewer"}]}),ui("Checkbox",[children,bool("checked"),bool("indeterminate"),bool("disabled")],void 0,{checked:!0,children:"Remember me"}),ui("Radio",[children,bool("checked"),bool("disabled"),json("value","string | number")],void 0,{checked:!0,children:"Monthly"}),ui("Switch",[bool("checked"),enumProp("size",["default","small"],"default"),bool("disabled"),bool("loading"),node("checkedChildren"),node("unCheckedChildren")],void 0,{checked:!0}),ui("Segmented",[json("options","(string | number | { label: ReactNode; value: string | number })[]"),json("value","string | number"),enumProp("size",SIZES,"middle"),bool("block"),bool("disabled"),bool("vertical"),enumProp("shape",["default","round"],"default")],"Segmented control.",{options:["Daily","Weekly","Monthly"],value:"Weekly"}),ui("Slider",[json("value","number | [number, number]"),num("min"),num("max"),num("step"),bool("range"),json("marks","Record<number, ReactNode>"),bool("dots"),bool("included"),bool("reverse"),bool("vertical"),bool("disabled"),styles("track tracks rail handle")],void 0,{value:30}),ui("Rate",[num("value"),num("count"),bool("allowHalf"),bool("disabled"),node("character")],"Star rating.",{value:4}),ui("Table",[json("columns","{ title: string; dataIndex: string; key: string }[]"),json("dataSource","Record<string, ReactNode>[] (each row needs a `key`)"),enumProp("size",["large","middle","small"],"large"),json("pagination","false | object"),bool("bordered"),bool("loading"),bool("showHeader"),str("rowKey"),json("scroll","{ x?: number | string; y?: number | string }"),bool("sticky"),enumProp("tableLayout",["auto","fixed"]),json("rowSelection",'{ type?: "checkbox" | "radio"; selectedRowKeys?: (string | number)[] }'),node("caption")],"Data table \u2014 drive it with `columns` + `dataSource` (no render functions in design JSON).",{columns:[{title:"Name",dataIndex:"name",key:"name"},{title:"Role",dataIndex:"role",key:"role"}],dataSource:[{key:"1",name:"Ada Lovelace",role:"Admin"},{key:"2",name:"Grace Hopper",role:"Member"}],pagination:!1}),ui("List",[children,enumProp("size",["default","small","large"],"default"),bool("bordered"),node("header"),node("footer"),bool("split"),enumProp("itemLayout",["horizontal","vertical"],"horizontal"),bool("loading"),json("grid","{ gutter?: number; column?: number }")],"Compose with ListItem children (skip `dataSource`/`renderItem` \u2014 functions don't fit design JSON).",{bordered:!0}),sub("List.Item",[children,node("extra"),json("actions","ReactNode[]")],"One row inside a List \u2014 antd's List.Item."),sub("List.Item.Meta",[node("title"),node("description"),node("avatar")],"Title/description/avatar layout inside a ListItem \u2014 antd's List.Item.Meta.",{title:"Deploy finished",description:"2 minutes ago"}),ui("Tabs",[json("items","{ key: string; label: string; children?: ReactNode }[]"),str("activeKey"),enumProp("type",["line","card","editable-card"],"line"),enumProp("size",SIZES,"middle"),bool("centered"),enumProp("tabPosition",["top","right","bottom","left"],"top"),node("tabBarExtraContent"),num("tabBarGutter"),css("tabBarStyle")],"Tab bar + active pane, driven by `items`.",{items:[{key:"1",label:"Overview",children:"Overview content"},{key:"2",label:"Settings",children:"Settings content"}]}),ui("Steps",[num("current"),json("items","{ title: string; description?: string }[]"),enumProp("direction",["horizontal","vertical"],"horizontal"),enumProp("size",["default","small"],"default"),enumProp("status",["wait","process","finish","error"],"process"),enumProp("type",["default","navigation","inline"],"default"),enumProp("labelPlacement",["horizontal","vertical"],"horizontal"),bool("progressDot"),num("percent"),num("initial")],void 0,{current:1,items:[{title:"Build"},{title:"Review"},{title:"Ship"}]}),ui("Breadcrumb",[json("items","{ title: ReactNode }[]"),node("separator")],void 0,{items:[{title:"Home"},{title:"Reports"}]}),ui("Pagination",[num("current"),num("total"),num("pageSize"),bool("simple"),enumProp("size",["default","small"],"default"),enumProp("align",["start","center","end"],"start"),bool("showSizeChanger"),bool("showQuickJumper"),bool("showLessItems"),bool("hideOnSinglePage"),bool("disabled")],void 0,{current:1,total:50}),ui("Menu",[json("items","{ key: string; label: ReactNode; icon?: ReactNode }[]"),enumProp("mode",["vertical","horizontal","inline"],"vertical"),json("selectedKeys","string[]"),json("openKeys","string[]"),enumProp("theme",["light","dark"],"light"),bool("inlineCollapsed"),num("inlineIndent"),bool("selectable"),bool("multiple")],"Navigation menu driven by `items` (antd v5 dropped JSX children menus).",{mode:"inline",items:[{key:"home",label:"Home"},{key:"reports",label:"Reports"}],selectedKeys:["home"]}),ui("Modal",[children,node("title"),json("width","number | string"),node("footer"),bool("open"),bool("centered"),bool("closable"),node("okText"),node("cancelText"),enumProp("okType",["primary","default","dashed","text","link"],"primary"),bool("confirmLoading"),bool("loading"),json("okButtonProps","ButtonProps"),json("cancelButtonProps","ButtonProps"),styles("header body footer content mask")],"Modal dialog surface \u2014 renders open + inline in design mode. Put the body in children; `footer` renders as a right-aligned action row.",{title:"Delete item?"}),ui("Drawer",[children,node("title"),node("extra"),node("footer"),bool("open"),enumProp("placement",["top","right","bottom","left"],"right"),enumProp("size",["default","large"],"default"),json("width","number | string"),json("height","number | string"),bool("closable"),bool("loading"),styles("header body footer content wrapper mask")],"A side panel \u2014 renders inline as a fixed-width column in design mode.",{title:"Filters"}),ui("Popover",[children,node("title"),node("content"),enumProp("placement",PLACEMENTS,"top"),bool("open"),json("arrow","boolean | { pointAtCenter?: boolean }"),color("color"),styles("root body")],"A popover \u2014 the trigger child renders inline with the surface pinned open below it.",{title:"Details",content:"Popover body"}),ui("Tooltip",[children,node("title"),enumProp("placement",PLACEMENTS,"top"),bool("open"),json("arrow","boolean | { pointAtCenter?: boolean }"),color("color"),styles("root body")],"The trigger child renders inline; `title` shows beside it as a dark pill in design mode.",{title:"Copy to clipboard"}),ui("Dropdown",[children,json("menu","{ items: { key: string; label: ReactNode }[] }"),enumProp("placement",["bottomLeft","bottom","bottomRight","topLeft","top","topRight"],"bottomLeft"),bool("open"),json("arrow","boolean | { pointAtCenter?: boolean }"),json("trigger",'("click" | "hover" | "contextMenu")[]'),bool("disabled")],"The trigger child renders inline with the menu surface pinned open below it.",{menu:{items:[{key:"edit",label:"Edit"},{key:"delete",label:"Delete"}]}}),{id:"Box",category:"ui",source:"velloo",plainElement:!0,props:[children,{name:"as",type:"string",optional:!0,control:"string"},style],designModeNotes:'A plain HTML element \u2014 a div unless `as` names another lowercase tag ("span", "section", "ul"). Compose writes `<div>`/`<span>` as Box for you. Emits as the bare element with its `style`. Reach for antd\'s `Flex`/`Space` for layout and `Typography*` for text first.'},helper("Icon",[{name:"name",type:"string",optional:!1,control:"icon"},{name:"size",type:"number",optional:!0,control:"number"}],"A lucide icon \u2014 antd's icon set isn't bundled. Set the pixel `size` prop (not Tailwind). `name` is a lucide id (PascalCase or kebab). Emits a `lucide-react` import.",{name:"ArrowRight",size:20}),helper("Image",[{name:"src",type:"string",optional:!1,control:"string"},{name:"alt",type:"string",optional:!1,control:"string"}],"An image. Use velloo assets (`/assets/\u2026`) or a URL."),helper("Placeholder",[{name:"label",type:"string",optional:!0,control:"string"}],"A labeled placeholder box for imagery you haven't authored yet (avatars, hero shots)."),helper("SVG",[{name:"content",type:"string",optional:!1,control:"string"},{name:"viewBox",type:"string",optional:!1,control:"string"},{name:"preserveAspectRatio",type:"string",optional:!0,control:"string"}],"Raw inline SVG markup."),helper("Layer",[children],"An absolutely-positioned overlay layer for stacked composition."),helper("Gradient",[{name:"from",type:"string",optional:!0,control:"color"}],"A gradient fill block."),helper("Prose",[children,{name:"preset",type:"string",optional:!0,control:"string"},{name:"as",type:"string",optional:!0,control:"string"}],"A long-form content region. Everything inside \u2014 Typography, headings, lists, quotes, code, tables \u2014 picks up the theme typeset's proportions and vertical rhythm automatically. `preset` selects a named typeset (see set_typeset). Reach for this for articles, docs, and marketing copy instead of setting sizes block by block.",{as:"article"})];var React7=__toESM(require_react_development());function _typeof(o){return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var REACT_ELEMENT_TYPE_18=Symbol.for("react.element"),REACT_ELEMENT_TYPE_19=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function isFragment(object){return object&&_typeof(object)==="object"&&(object.$$typeof===REACT_ELEMENT_TYPE_18||object.$$typeof===REACT_ELEMENT_TYPE_19)&&object.type===REACT_FRAGMENT_TYPE}var import_react=__toESM(require_react_development());function toArray(children){var option=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ret=[];return import_react.default.Children.forEach(children,function(child){if((child===void 0||child===null)&&!option.keepEmpty)return;if(Array.isArray(child))ret=ret.concat(toArray(child));else if(isFragment(child)&&child.props)ret=ret.concat(toArray(child.props.children,option));else ret.push(child)}),ret}var warned={},preWarningFns=[],preMessage=function(fn){preWarningFns.push(fn)};function warning(valid,message){if(!valid&&console!==void 0){var finalMessage=preWarningFns.reduce(function(msg,preMessageFn){return preMessageFn(msg!==null&&msg!==void 0?msg:"","warning")},message);if(finalMessage)console.error("Warning: ".concat(finalMessage))}}function note(valid,message){if(!valid&&console!==void 0){var finalMessage=preWarningFns.reduce(function(msg,preMessageFn){return preMessageFn(msg!==null&&msg!==void 0?msg:"","note")},message);if(finalMessage)console.warn("Note: ".concat(finalMessage))}}function resetWarned(){warned={}}function call(method,valid,message){if(!valid&&!warned[message])method(!1,message),warned[message]=!0}function warningOnce(valid,message){call(warning,valid,message)}function noteOnce(valid,message){call(note,valid,message)}warningOnce.preMessage=preMessage;warningOnce.resetWarned=resetWarned;warningOnce.noteOnce=noteOnce;var warning_default=warningOnce;function toPrimitive(t,r){if(_typeof(t)!="object"||!t)return t;var e=t[Symbol.toPrimitive];if(e!==void 0){var i=e.call(t,r||"default");if(_typeof(i)!="object")return i;throw TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function toPropertyKey(t){var i=toPrimitive(t,"string");return _typeof(i)=="symbol"?i:i+""}function _defineProperty(e,r,t){return(r=toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread2(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}var import_react2=__toESM(require_react_development()),import_react_dom=__toESM(require_react_dom());function isDOM(node){return node instanceof HTMLElement||node instanceof SVGElement}function getDOM(node){if(node&&_typeof(node)==="object"&&isDOM(node.nativeElement))return node.nativeElement;if(isDOM(node))return node;return null}function findDOMNode(node){var domNode=getDOM(node);if(domNode)return domNode;if(node instanceof import_react2.default.Component){var _ReactDOM$findDOMNode;return(_ReactDOM$findDOMNode=import_react_dom.default.findDOMNode)===null||_ReactDOM$findDOMNode===void 0?void 0:_ReactDOM$findDOMNode.call(import_react_dom.default,node)}return null}var import_react3=__toESM(require_react_development()),import_react_is=__toESM(require_react_is_development());var React3=__toESM(require_react_development());function useMemo(getValue,condition,shouldUpdate){var cacheRef=React3.useRef({});if(!("value"in cacheRef.current)||shouldUpdate(cacheRef.current.condition,condition))cacheRef.current.value=getValue(),cacheRef.current.condition=condition;return cacheRef.current.value}var ReactMajorVersion=Number(import_react3.version.split(".")[0]),fillRef=function(ref,node){if(typeof ref==="function")ref(node);else if(_typeof(ref)==="object"&&ref&&"current"in ref)ref.current=node},composeRef=function(){for(var _len=arguments.length,refs=Array(_len),_key=0;_key<_len;_key++)refs[_key]=arguments[_key];var refList=refs.filter(Boolean);if(refList.length<=1)return refList[0];return function(node){refs.forEach(function(ref){fillRef(ref,node)})}},useComposeRef=function(){for(var _len2=arguments.length,refs=Array(_len2),_key2=0;_key2<_len2;_key2++)refs[_key2]=arguments[_key2];return useMemo(function(){return composeRef.apply(void 0,refs)},refs,function(prev,next){return prev.length!==next.length||prev.every(function(ref,i){return ref!==next[i]})})},supportRef=function(nodeOrComponent){var _type$prototype,_nodeOrComponent$prot;if(!nodeOrComponent)return!1;if(isReactElement(nodeOrComponent)&&ReactMajorVersion>=19)return!0;var type=import_react_is.isMemo(nodeOrComponent)?nodeOrComponent.type.type:nodeOrComponent.type;if(typeof type==="function"&&!((_type$prototype=type.prototype)!==null&&_type$prototype!==void 0&&_type$prototype.render)&&type.$$typeof!==import_react_is.ForwardRef)return!1;if(typeof nodeOrComponent==="function"&&!((_nodeOrComponent$prot=nodeOrComponent.prototype)!==null&&_nodeOrComponent$prot!==void 0&&_nodeOrComponent$prot.render)&&nodeOrComponent.$$typeof!==import_react_is.ForwardRef)return!1;return!0};function isReactElement(node){return import_react3.isValidElement(node)&&!isFragment(node)}var supportNodeRef=function(node){return isReactElement(node)&&supportRef(node)},getNodeRef=function(node){if(node&&isReactElement(node)){var ele=node;return ele.props.propertyIsEnumerable("ref")?ele.props.ref:ele.ref}return null};var React6=__toESM(require_react_development());var React4=__toESM(require_react_development()),CollectionContext=React4.createContext(null);function Collection(_ref){var{children,onBatchResize}=_ref,resizeIdRef=React4.useRef(0),resizeInfosRef=React4.useRef([]),onCollectionResize=React4.useContext(CollectionContext),onResize=React4.useCallback(function(size,element,data){resizeIdRef.current+=1;var currentId=resizeIdRef.current;resizeInfosRef.current.push({size,element,data}),Promise.resolve().then(function(){if(currentId===resizeIdRef.current)onBatchResize===null||onBatchResize===void 0||onBatchResize(resizeInfosRef.current),resizeInfosRef.current=[]}),onCollectionResize===null||onCollectionResize===void 0||onCollectionResize(size,element,data)},[onBatchResize,onCollectionResize]);return React4.createElement(CollectionContext.Provider,{value:onResize},children)}var MapShim=function(){if(typeof Map<"u")return Map;function getIndex(arr,key){var result=-1;return arr.some(function(entry,index){if(entry[0]===key)return result=index,!0;return!1}),result}return function(){function class_1(){this.__entries__=[]}return Object.defineProperty(class_1.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),class_1.prototype.get=function(key){var index=getIndex(this.__entries__,key),entry=this.__entries__[index];return entry&&entry[1]},class_1.prototype.set=function(key,value){var index=getIndex(this.__entries__,key);if(~index)this.__entries__[index][1]=value;else this.__entries__.push([key,value])},class_1.prototype.delete=function(key){var entries=this.__entries__,index=getIndex(entries,key);if(~index)entries.splice(index,1)},class_1.prototype.has=function(key){return!!~getIndex(this.__entries__,key)},class_1.prototype.clear=function(){this.__entries__.splice(0)},class_1.prototype.forEach=function(callback,ctx){if(ctx===void 0)ctx=null;for(var _i=0,_a=this.__entries__;_i<_a.length;_i++){var entry=_a[_i];callback.call(ctx,entry[1],entry[0])}},class_1}()}(),isBrowser=typeof window<"u"&&typeof document<"u"&&window.document===document,global$1=function(){if(typeof global<"u"&&global.Math===Math)return global;if(typeof self<"u"&&self.Math===Math)return self;if(typeof window<"u"&&window.Math===Math)return window;return Function("return this")()}(),requestAnimationFrame$1=function(){if(typeof requestAnimationFrame==="function")return requestAnimationFrame.bind(global$1);return function(callback){return setTimeout(function(){return callback(Date.now())},16.666666666666668)}}(),trailingTimeout=2;function throttle(callback,delay){var leadingCall=!1,trailingCall=!1,lastCallTime=0;function resolvePending(){if(leadingCall)leadingCall=!1,callback();if(trailingCall)proxy()}function timeoutCallback(){requestAnimationFrame$1(resolvePending)}function proxy(){var timeStamp=Date.now();if(leadingCall){if(timeStamp-lastCallTime<trailingTimeout)return;trailingCall=!0}else leadingCall=!0,trailingCall=!1,setTimeout(timeoutCallback,delay);lastCallTime=timeStamp}return proxy}var REFRESH_DELAY=20,transitionKeys=["top","right","bottom","left","width","height","size","weight"],mutationObserverSupported=typeof MutationObserver<"u",ResizeObserverController=function(){function ResizeObserverController(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=throttle(this.refresh.bind(this),REFRESH_DELAY)}return ResizeObserverController.prototype.addObserver=function(observer){if(!~this.observers_.indexOf(observer))this.observers_.push(observer);if(!this.connected_)this.connect_()},ResizeObserverController.prototype.removeObserver=function(observer){var observers=this.observers_,index=observers.indexOf(observer);if(~index)observers.splice(index,1);if(!observers.length&&this.connected_)this.disconnect_()},ResizeObserverController.prototype.refresh=function(){var changesDetected=this.updateObservers_();if(changesDetected)this.refresh()},ResizeObserverController.prototype.updateObservers_=function(){var activeObservers=this.observers_.filter(function(observer){return observer.gatherActive(),observer.hasActive()});return activeObservers.forEach(function(observer){return observer.broadcastActive()}),activeObservers.length>0},ResizeObserverController.prototype.connect_=function(){if(!isBrowser||this.connected_)return;if(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mutationObserverSupported)this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0});else document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0;this.connected_=!0},ResizeObserverController.prototype.disconnect_=function(){if(!isBrowser||!this.connected_)return;if(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_)this.mutationsObserver_.disconnect();if(this.mutationEventsAdded_)document.removeEventListener("DOMSubtreeModified",this.refresh);this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1},ResizeObserverController.prototype.onTransitionEnd_=function(_a){var _b=_a.propertyName,propertyName=_b===void 0?"":_b,isReflowProperty=transitionKeys.some(function(key){return!!~propertyName.indexOf(key)});if(isReflowProperty)this.refresh()},ResizeObserverController.getInstance=function(){if(!this.instance_)this.instance_=new ResizeObserverController;return this.instance_},ResizeObserverController.instance_=null,ResizeObserverController}(),defineConfigurable=function(target,props){for(var _i=0,_a=Object.keys(props);_i<_a.length;_i++){var key=_a[_i];Object.defineProperty(target,key,{value:props[key],enumerable:!1,writable:!1,configurable:!0})}return target},getWindowOf=function(target){var ownerGlobal=target&&target.ownerDocument&&target.ownerDocument.defaultView;return ownerGlobal||global$1},emptyRect=createRectInit(0,0,0,0);function toFloat(value){return parseFloat(value)||0}function getBordersSize(styles){var positions=[];for(var _i=1;_i<arguments.length;_i++)positions[_i-1]=arguments[_i];return positions.reduce(function(size,position){var value=styles["border-"+position+"-width"];return size+toFloat(value)},0)}function getPaddings(styles){var positions=["top","right","bottom","left"],paddings={};for(var _i=0,positions_1=positions;_i<positions_1.length;_i++){var position=positions_1[_i],value=styles["padding-"+position];paddings[position]=toFloat(value)}return paddings}function getSVGContentRect(target){var bbox=target.getBBox();return createRectInit(0,0,bbox.width,bbox.height)}function getHTMLElementContentRect(target){var{clientWidth,clientHeight}=target;if(!clientWidth&&!clientHeight)return emptyRect;var styles=getWindowOf(target).getComputedStyle(target),paddings=getPaddings(styles),horizPad=paddings.left+paddings.right,vertPad=paddings.top+paddings.bottom,width=toFloat(styles.width),height=toFloat(styles.height);if(styles.boxSizing==="border-box"){if(Math.round(width+horizPad)!==clientWidth)width-=getBordersSize(styles,"left","right")+horizPad;if(Math.round(height+vertPad)!==clientHeight)height-=getBordersSize(styles,"top","bottom")+vertPad}if(!isDocumentElement(target)){var vertScrollbar=Math.round(width+horizPad)-clientWidth,horizScrollbar=Math.round(height+vertPad)-clientHeight;if(Math.abs(vertScrollbar)!==1)width-=vertScrollbar;if(Math.abs(horizScrollbar)!==1)height-=horizScrollbar}return createRectInit(paddings.left,paddings.top,width,height)}var isSVGGraphicsElement=function(){if(typeof SVGGraphicsElement<"u")return function(target){return target instanceof getWindowOf(target).SVGGraphicsElement};return function(target){return target instanceof getWindowOf(target).SVGElement&&typeof target.getBBox==="function"}}();function isDocumentElement(target){return target===getWindowOf(target).document.documentElement}function getContentRect(target){if(!isBrowser)return emptyRect;if(isSVGGraphicsElement(target))return getSVGContentRect(target);return getHTMLElementContentRect(target)}function createReadOnlyRect(_a){var{x,y,width,height}=_a,Constr=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,rect=Object.create(Constr.prototype);return defineConfigurable(rect,{x,y,width,height,top:y,right:x+width,bottom:height+y,left:x}),rect}function createRectInit(x,y,width,height){return{x,y,width,height}}var ResizeObservation=function(){function ResizeObservation(target){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=createRectInit(0,0,0,0),this.target=target}return ResizeObservation.prototype.isActive=function(){var rect=getContentRect(this.target);return this.contentRect_=rect,rect.width!==this.broadcastWidth||rect.height!==this.broadcastHeight},ResizeObservation.prototype.broadcastRect=function(){var rect=this.contentRect_;return this.broadcastWidth=rect.width,this.broadcastHeight=rect.height,rect},ResizeObservation}(),ResizeObserverEntry=function(){function ResizeObserverEntry(target,rectInit){var contentRect=createReadOnlyRect(rectInit);defineConfigurable(this,{target,contentRect})}return ResizeObserverEntry}(),ResizeObserverSPI=function(){function ResizeObserverSPI(callback,controller,callbackCtx){if(this.activeObservations_=[],this.observations_=new MapShim,typeof callback!=="function")throw TypeError("The callback provided as parameter 1 is not a function.");this.callback_=callback,this.controller_=controller,this.callbackCtx_=callbackCtx}return ResizeObserverSPI.prototype.observe=function(target){if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");if(typeof Element>"u"||!(Element instanceof Object))return;if(!(target instanceof getWindowOf(target).Element))throw TypeError('parameter 1 is not of type "Element".');var observations=this.observations_;if(observations.has(target))return;observations.set(target,new ResizeObservation(target)),this.controller_.addObserver(this),this.controller_.refresh()},ResizeObserverSPI.prototype.unobserve=function(target){if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");if(typeof Element>"u"||!(Element instanceof Object))return;if(!(target instanceof getWindowOf(target).Element))throw TypeError('parameter 1 is not of type "Element".');var observations=this.observations_;if(!observations.has(target))return;if(observations.delete(target),!observations.size)this.controller_.removeObserver(this)},ResizeObserverSPI.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},ResizeObserverSPI.prototype.gatherActive=function(){var _this=this;this.clearActive(),this.observations_.forEach(function(observation){if(observation.isActive())_this.activeObservations_.push(observation)})},ResizeObserverSPI.prototype.broadcastActive=function(){if(!this.hasActive())return;var ctx=this.callbackCtx_,entries=this.activeObservations_.map(function(observation){return new ResizeObserverEntry(observation.target,observation.broadcastRect())});this.callback_.call(ctx,entries,ctx),this.clearActive()},ResizeObserverSPI.prototype.clearActive=function(){this.activeObservations_.splice(0)},ResizeObserverSPI.prototype.hasActive=function(){return this.activeObservations_.length>0},ResizeObserverSPI}(),observers=typeof WeakMap<"u"?new WeakMap:new MapShim,ResizeObserver2=function(){function ResizeObserver2(callback){if(!(this instanceof ResizeObserver2))throw TypeError("Cannot call a class as a function.");if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");var controller=ResizeObserverController.getInstance(),observer=new ResizeObserverSPI(callback,controller,this);observers.set(this,observer)}return ResizeObserver2}();["observe","unobserve","disconnect"].forEach(function(method){ResizeObserver2.prototype[method]=function(){var _a;return(_a=observers.get(this))[method].apply(_a,arguments)}});var index=function(){if(typeof global$1.ResizeObserver<"u")return global$1.ResizeObserver;return ResizeObserver2}(),ResizeObserver_es_default=index;var elementListeners=new Map;function onResize(entities){entities.forEach(function(entity){var _elementListeners$get,target=entity.target;(_elementListeners$get=elementListeners.get(target))===null||_elementListeners$get===void 0||_elementListeners$get.forEach(function(listener){return listener(target)})})}var resizeObserver=new ResizeObserver_es_default(onResize);function observe(element,callback){if(!elementListeners.has(element))elementListeners.set(element,new Set),resizeObserver.observe(element);elementListeners.get(element).add(callback)}function unobserve(element,callback){if(elementListeners.has(element)){if(elementListeners.get(element).delete(callback),!elementListeners.get(element).size)resizeObserver.unobserve(element),elementListeners.delete(element)}}function _classCallCheck(a,n){if(!(a instanceof n))throw TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _inherits(t,e){if(typeof e!="function"&&e!==null)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function(){return!!t})()}function _possibleConstructorReturn(t,e){if(e&&(_typeof(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _createSuper(t){var r=_isNativeReflectConstruct();return function(){var e,o=_getPrototypeOf(t);if(r){var s=_getPrototypeOf(this).constructor;e=Reflect.construct(o,arguments,s)}else e=o.apply(this,arguments);return _possibleConstructorReturn(this,e)}}var React5=__toESM(require_react_development()),DomWrapper=function(_React$Component){_inherits(DomWrapper,_React$Component);var _super=_createSuper(DomWrapper);function DomWrapper(){return _classCallCheck(this,DomWrapper),_super.apply(this,arguments)}return _createClass(DomWrapper,[{key:"render",value:function(){return this.props.children}}]),DomWrapper}(React5.Component);function SingleObserver(props,ref){var{children,disabled}=props,elementRef=React6.useRef(null),wrapperRef=React6.useRef(null),onCollectionResize=React6.useContext(CollectionContext),isRenderProps=typeof children==="function",mergedChildren=isRenderProps?children(elementRef):children,sizeRef=React6.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),canRef=!isRenderProps&&React6.isValidElement(mergedChildren)&&supportRef(mergedChildren),originRef=canRef?getNodeRef(mergedChildren):null,mergedRef=useComposeRef(originRef,elementRef),getDom=function(){var _elementRef$current;return findDOMNode(elementRef.current)||(elementRef.current&&_typeof(elementRef.current)==="object"?findDOMNode((_elementRef$current=elementRef.current)===null||_elementRef$current===void 0?void 0:_elementRef$current.nativeElement):null)||findDOMNode(wrapperRef.current)};React6.useImperativeHandle(ref,function(){return getDom()});var propsRef=React6.useRef(props);propsRef.current=props;var onInternalResize=React6.useCallback(function(target){var _propsRef$current=propsRef.current,{onResize,data}=_propsRef$current,_target$getBoundingCl=target.getBoundingClientRect(),{width,height}=_target$getBoundingCl,{offsetWidth,offsetHeight}=target,fixedWidth=Math.floor(width),fixedHeight=Math.floor(height);if(sizeRef.current.width!==fixedWidth||sizeRef.current.height!==fixedHeight||sizeRef.current.offsetWidth!==offsetWidth||sizeRef.current.offsetHeight!==offsetHeight){var size={width:fixedWidth,height:fixedHeight,offsetWidth,offsetHeight};sizeRef.current=size;var mergedOffsetWidth=offsetWidth===Math.round(width)?width:offsetWidth,mergedOffsetHeight=offsetHeight===Math.round(height)?height:offsetHeight,sizeInfo=_objectSpread2(_objectSpread2({},size),{},{offsetWidth:mergedOffsetWidth,offsetHeight:mergedOffsetHeight});if(onCollectionResize===null||onCollectionResize===void 0||onCollectionResize(sizeInfo,target,data),onResize)Promise.resolve().then(function(){onResize(sizeInfo,target)})}},[]);return React6.useEffect(function(){var currentElement=getDom();if(currentElement&&!disabled)observe(currentElement,onInternalResize);return function(){return unobserve(currentElement,onInternalResize)}},[elementRef.current,disabled]),React6.createElement(DomWrapper,{ref:wrapperRef},canRef?React6.cloneElement(mergedChildren,{ref:mergedRef}):mergedChildren)}var RefSingleObserver=React6.forwardRef(SingleObserver);RefSingleObserver.displayName="SingleObserver";var SingleObserver_default=RefSingleObserver;var INTERNAL_PREFIX_KEY="rc-observer-key";function ResizeObserver3(props,ref){var children=props.children,childNodes=typeof children==="function"?[children]:toArray(children);if(childNodes.length>1)warning(!1,"Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead.");else if(childNodes.length===0)warning(!1,"`children` of ResizeObserver is empty. Nothing is in observe.");return childNodes.map(function(child,index){var key=(child===null||child===void 0?void 0:child.key)||"".concat(INTERNAL_PREFIX_KEY,"-").concat(index);return React7.createElement(SingleObserver_default,_extends({},props,{key,ref:index===0?ref:void 0}),child)})}var RefResizeObserver=React7.forwardRef(ResizeObserver3);RefResizeObserver.displayName="ResizeObserver";RefResizeObserver.Collection=Collection;var es_default=RefResizeObserver;function _arrayLikeToArray(r,a){(a==null||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _iterableToArray(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function _unsupportedIterableToArray(r,a){if(r){if(typeof r=="string")return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _nonIterableSpread(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
7
7
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}var raf=function(callback){return+setTimeout(callback,16)},caf=function(num){return clearTimeout(num)};if(typeof window<"u"&&"requestAnimationFrame"in window)raf=function(callback){return window.requestAnimationFrame(callback)},caf=function(handle){return window.cancelAnimationFrame(handle)};var rafUUID=0,rafIds=new Map;function cleanup(id){rafIds.delete(id)}var wrapperRaf=function(callback){var times=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;rafUUID+=1;var id=rafUUID;function callRef(leftTimes){if(leftTimes===0)cleanup(id),callback();else{var realId=raf(function(){callRef(leftTimes-1)});rafIds.set(id,realId)}}return callRef(times),id};wrapperRaf.cancel=function(id){var realId=rafIds.get(id);return cleanup(id),caf(realId)};wrapperRaf.ids=function(){return rafIds};var raf_default=wrapperRaf;var React38=__toESM(require_react_development());function _arrayWithHoles(r){if(Array.isArray(r))return r}function _iterableToArrayLimit(r,l){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,l===0){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&t.return!=null&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _nonIterableRest(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
8
8
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function murmur2(str){var h=0,k,i=0,len=str.length;for(;len>=4;++i,len-=4)k=str.charCodeAt(i)&255|(str.charCodeAt(++i)&255)<<8|(str.charCodeAt(++i)&255)<<16|(str.charCodeAt(++i)&255)<<24,k=(k&65535)*1540483477+((k>>>16)*59797<<16),k^=k>>>24,h=(k&65535)*1540483477+((k>>>16)*59797<<16)^(h&65535)*1540483477+((h>>>16)*59797<<16);switch(len){case 3:h^=(str.charCodeAt(i+2)&255)<<16;case 2:h^=(str.charCodeAt(i+1)&255)<<8;case 1:h^=str.charCodeAt(i)&255,h=(h&65535)*1540483477+((h>>>16)*59797<<16)}return h^=h>>>13,h=(h&65535)*1540483477+((h>>>16)*59797<<16),((h^h>>>15)>>>0).toString(36)}var hash_esm_default=murmur2;function canUseDom(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function contains(root,n){if(!root)return!1;if(root.contains)return root.contains(n);var node=n;while(node){if(node===root)return!0;node=node.parentNode}return!1}var APPEND_ORDER="data-rc-order",APPEND_PRIORITY="data-rc-priority",MARK_KEY="rc-util-key",containerCache=new Map;function getMark(){var _ref=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},mark=_ref.mark;if(mark)return mark.startsWith("data-")?mark:"data-".concat(mark);return MARK_KEY}function getContainer(option){if(option.attachTo)return option.attachTo;var head=document.querySelector("head");return head||document.body}function getOrder(prepend){if(prepend==="queue")return"prependQueue";return prepend?"prepend":"append"}function findStyles(container){return Array.from((containerCache.get(container)||container).children).filter(function(node){return node.tagName==="STYLE"})}function injectCSS(css){var option=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!canUseDom())return null;var{csp,prepend,priority:_option$priority}=option,priority=_option$priority===void 0?0:_option$priority,mergedOrder=getOrder(prepend),isPrependQueue=mergedOrder==="prependQueue",styleNode=document.createElement("style");if(styleNode.setAttribute(APPEND_ORDER,mergedOrder),isPrependQueue&&priority)styleNode.setAttribute(APPEND_PRIORITY,"".concat(priority));if(csp!==null&&csp!==void 0&&csp.nonce)styleNode.nonce=csp===null||csp===void 0?void 0:csp.nonce;styleNode.innerHTML=css;var container=getContainer(option),firstChild=container.firstChild;if(prepend){if(isPrependQueue){var existStyle=(option.styles||findStyles(container)).filter(function(node){if(!["prepend","prependQueue"].includes(node.getAttribute(APPEND_ORDER)))return!1;var nodePriority=Number(node.getAttribute(APPEND_PRIORITY)||0);return priority>=nodePriority});if(existStyle.length)return container.insertBefore(styleNode,existStyle[existStyle.length-1].nextSibling),styleNode}container.insertBefore(styleNode,firstChild)}else container.appendChild(styleNode);return styleNode}function findExistNode(key){var option=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},container=getContainer(option);return(option.styles||findStyles(container)).find(function(node){return node.getAttribute(getMark(option))===key})}function removeCSS(key){var option=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},existNode=findExistNode(key,option);if(existNode){var container=getContainer(option);container.removeChild(existNode)}}function syncRealContainer(container,option){var cachedRealContainer=containerCache.get(container);if(!cachedRealContainer||!contains(document,cachedRealContainer)){var placeholderStyle=injectCSS("",option),parentNode=placeholderStyle.parentNode;containerCache.set(container,parentNode),container.removeChild(placeholderStyle)}}function updateCSS(css,key){var originOption=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},container=getContainer(originOption),styles=findStyles(container),option=_objectSpread2(_objectSpread2({},originOption),{},{styles});syncRealContainer(container,option);var existNode=findExistNode(key,option);if(existNode){var _option$csp,_option$csp2;if((_option$csp=option.csp)!==null&&_option$csp!==void 0&&_option$csp.nonce&&existNode.nonce!==((_option$csp2=option.csp)===null||_option$csp2===void 0?void 0:_option$csp2.nonce)){var _option$csp3;existNode.nonce=(_option$csp3=option.csp)===null||_option$csp3===void 0?void 0:_option$csp3.nonce}if(existNode.innerHTML!==css)existNode.innerHTML=css;return existNode}var newNode=injectCSS(css,option);return newNode.setAttribute(getMark(option),key),newNode}var import_react4=__toESM(require_react_development());function _objectWithoutProperties(e,t){if(e==null)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],t.indexOf(o)===-1&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}function isEqual(obj1,obj2){var shallow=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,refSet=new Set;function deepEqual(a,b){var level=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,circular=refSet.has(a);if(warning_default(!circular,"Warning: There may be circular references"),circular)return!1;if(a===b)return!0;if(shallow&&level>1)return!1;refSet.add(a);var newLevel=level+1;if(Array.isArray(a)){if(!Array.isArray(b)||a.length!==b.length)return!1;for(var i=0;i<a.length;i++)if(!deepEqual(a[i],b[i],newLevel))return!1;return!0}if(a&&b&&_typeof(a)==="object"&&_typeof(b)==="object"){var keys=Object.keys(a);if(keys.length!==Object.keys(b).length)return!1;return keys.every(function(key){return deepEqual(a[key],b[key],newLevel)})}return!1}return deepEqual(obj1,obj2)}var isEqual_default=isEqual;var React8=__toESM(require_react_development());var SPLIT="%";function pathKey(keys){return keys.join(SPLIT)}var Entity=function(){function Entity(instanceId){_classCallCheck(this,Entity),_defineProperty(this,"instanceId",void 0),_defineProperty(this,"cache",new Map),_defineProperty(this,"extracted",new Set),this.instanceId=instanceId}return _createClass(Entity,[{key:"get",value:function(keys){return this.opGet(pathKey(keys))}},{key:"opGet",value:function(keyPathStr){return this.cache.get(keyPathStr)||null}},{key:"update",value:function(keys,valueFn){return this.opUpdate(pathKey(keys),valueFn)}},{key:"opUpdate",value:function(keyPathStr,valueFn){var prevValue=this.cache.get(keyPathStr),nextValue=valueFn(prevValue);if(nextValue===null)this.cache.delete(keyPathStr);else this.cache.set(keyPathStr,nextValue)}}]),Entity}(),Cache_default=Entity;var _excluded=["children"],ATTR_TOKEN="data-token-hash",ATTR_MARK="data-css-hash",ATTR_CACHE_PATH="data-cache-path",CSS_IN_JS_INSTANCE="__cssinjs_instance__";function createCache(){var cssinjsInstanceId=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){var styles=document.body.querySelectorAll("style[".concat(ATTR_MARK,"]"))||[],firstChild=document.head.firstChild;Array.from(styles).forEach(function(style){if(style[CSS_IN_JS_INSTANCE]=style[CSS_IN_JS_INSTANCE]||cssinjsInstanceId,style[CSS_IN_JS_INSTANCE]===cssinjsInstanceId)document.head.insertBefore(style,firstChild)});var styleHash={};Array.from(document.querySelectorAll("style[".concat(ATTR_MARK,"]"))).forEach(function(style){var hash=style.getAttribute(ATTR_MARK);if(styleHash[hash]){if(style[CSS_IN_JS_INSTANCE]===cssinjsInstanceId){var _style$parentNode;(_style$parentNode=style.parentNode)===null||_style$parentNode===void 0||_style$parentNode.removeChild(style)}}else styleHash[hash]=!0})}return new Cache_default(cssinjsInstanceId)}var StyleContext=React8.createContext({hashPriority:"low",cache:createCache(),defaultCache:!0}),StyleProvider=function(props){var children=props.children,restProps=_objectWithoutProperties(props,_excluded),parentContext=React8.useContext(StyleContext),context=useMemo(function(){var mergedContext=_objectSpread2({},parentContext);Object.keys(restProps).forEach(function(key){var value=restProps[key];if(restProps[key]!==void 0)mergedContext[key]=value});var cache=restProps.cache;return mergedContext.cache=mergedContext.cache||createCache(),mergedContext.defaultCache=!cache&&parentContext.defaultCache,mergedContext},[parentContext,restProps],function(prev,next){return!isEqual_default(prev[0],next[0],!0)||!isEqual_default(prev[1],next[1],!0)});return React8.createElement(StyleContext.Provider,{value:context},children)},StyleContext_default=StyleContext;var CALC_UNIT="CALC_UNIT",regexp=new RegExp(CALC_UNIT,"g");function sameDerivativeOption(left,right){if(left.length!==right.length)return!1;for(var i=0;i<left.length;i++)if(left[i]!==right[i])return!1;return!0}var ThemeCache=function(){function ThemeCache(){_classCallCheck(this,ThemeCache),_defineProperty(this,"cache",void 0),_defineProperty(this,"keys",void 0),_defineProperty(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return _createClass(ThemeCache,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(derivativeOption){var _cache2,_cache3,updateCallTimes=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,cache={map:this.cache};if(derivativeOption.forEach(function(derivative){if(!cache)cache=void 0;else{var _cache;cache=(_cache=cache)===null||_cache===void 0||(_cache=_cache.map)===null||_cache===void 0?void 0:_cache.get(derivative)}}),(_cache2=cache)!==null&&_cache2!==void 0&&_cache2.value&&updateCallTimes)cache.value[1]=this.cacheCallTimes++;return(_cache3=cache)===null||_cache3===void 0?void 0:_cache3.value}},{key:"get",value:function(derivativeOption){var _this$internalGet;return(_this$internalGet=this.internalGet(derivativeOption,!0))===null||_this$internalGet===void 0?void 0:_this$internalGet[0]}},{key:"has",value:function(derivativeOption){return!!this.internalGet(derivativeOption)}},{key:"set",value:function(derivativeOption,value){var _this=this;if(!this.has(derivativeOption)){if(this.size()+1>ThemeCache.MAX_CACHE_SIZE+ThemeCache.MAX_CACHE_OFFSET){var _this$keys$reduce=this.keys.reduce(function(result,key){var _result=_slicedToArray(result,2),callTimes=_result[1];if(_this.internalGet(key)[1]<callTimes)return[key,_this.internalGet(key)[1]];return result},[this.keys[0],this.cacheCallTimes]),_this$keys$reduce2=_slicedToArray(_this$keys$reduce,1),targetKey=_this$keys$reduce2[0];this.delete(targetKey)}this.keys.push(derivativeOption)}var cache=this.cache;derivativeOption.forEach(function(derivative,index){if(index===derivativeOption.length-1)cache.set(derivative,{value:[value,_this.cacheCallTimes++]});else{var cacheValue=cache.get(derivative);if(!cacheValue)cache.set(derivative,{map:new Map});else if(!cacheValue.map)cacheValue.map=new Map;cache=cache.get(derivative).map}})}},{key:"deleteByPath",value:function(currentCache,derivatives){var cache=currentCache.get(derivatives[0]);if(derivatives.length===1){var _cache$value;if(!cache.map)currentCache.delete(derivatives[0]);else currentCache.set(derivatives[0],{map:cache.map});return(_cache$value=cache.value)===null||_cache$value===void 0?void 0:_cache$value[0]}var result=this.deleteByPath(cache.map,derivatives.slice(1));if((!cache.map||cache.map.size===0)&&!cache.value)currentCache.delete(derivatives[0]);return result}},{key:"delete",value:function(derivativeOption){if(this.has(derivativeOption))return this.keys=this.keys.filter(function(item){return!sameDerivativeOption(item,derivativeOption)}),this.deleteByPath(this.cache,derivativeOption);return}}]),ThemeCache}();_defineProperty(ThemeCache,"MAX_CACHE_SIZE",20);_defineProperty(ThemeCache,"MAX_CACHE_OFFSET",5);var uuid=0,Theme=function(){function Theme(derivatives){if(_classCallCheck(this,Theme),_defineProperty(this,"derivatives",void 0),_defineProperty(this,"id",void 0),this.derivatives=Array.isArray(derivatives)?derivatives:[derivatives],this.id=uuid,derivatives.length===0)warning(derivatives.length>0,"[Ant Design CSS-in-JS] Theme should have at least one derivative function.");uuid+=1}return _createClass(Theme,[{key:"getDerivativeToken",value:function(token){return this.derivatives.reduce(function(result,derivative){return derivative(token,result)},void 0)}}]),Theme}();var cacheThemes=new ThemeCache;function createTheme(derivatives){var derivativeArr=Array.isArray(derivatives)?derivatives:[derivatives];if(!cacheThemes.has(derivativeArr))cacheThemes.set(derivativeArr,new Theme(derivativeArr));return cacheThemes.get(derivativeArr)}var resultCache=new WeakMap,RESULT_VALUE={};function memoResult(callback,deps){var current=resultCache;for(var i=0;i<deps.length;i+=1){var dep=deps[i];if(!current.has(dep))current.set(dep,new WeakMap);current=current.get(dep)}if(!current.has(RESULT_VALUE))current.set(RESULT_VALUE,callback());return current.get(RESULT_VALUE)}var flattenTokenCache=new WeakMap;function flattenToken(token){var str=flattenTokenCache.get(token)||"";if(!str)Object.keys(token).forEach(function(key){var value=token[key];if(str+=key,value instanceof Theme)str+=value.id;else if(value&&_typeof(value)==="object")str+=flattenToken(value);else str+=value}),str=hash_esm_default(str),flattenTokenCache.set(token,str);return str}function token2key(token,salt){return hash_esm_default("".concat(salt,"_").concat(flattenToken(token)))}var randomSelectorKey="random-".concat(Date.now(),"-").concat(Math.random()).replace(/\./g,"");var isClientSide=canUseDom();function unit(num){if(typeof num==="number")return"".concat(num,"px");return num}function toStyleStr(style,tokenKey,styleId){var customizeAttrs=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},plain=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(plain)return style;var attrs=_objectSpread2(_objectSpread2({},customizeAttrs),{},_defineProperty(_defineProperty({},ATTR_TOKEN,tokenKey),ATTR_MARK,styleId)),attrStr=Object.keys(attrs).map(function(attr){var val=attrs[attr];return val?"".concat(attr,'="').concat(val,'"'):null}).filter(function(v){return v}).join(" ");return"<style ".concat(attrStr,">").concat(style,"</style>")}var token2CSSVar=function(token){var prefix=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return"--".concat(prefix?"".concat(prefix,"-"):"").concat(token).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},serializeCSSVar=function(cssVars,hashId,options){if(!Object.keys(cssVars).length)return"";return".".concat(hashId).concat(options!==null&&options!==void 0&&options.scope?".".concat(options.scope):"","{").concat(Object.entries(cssVars).map(function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1];return"".concat(key,":").concat(value,";")}).join(""),"}")},transformToken=function(token,themeKey,config){var cssVars={},result={};return Object.entries(token).forEach(function(_ref3){var _config$preserve,_config$ignore,_ref4=_slicedToArray(_ref3,2),key=_ref4[0],value=_ref4[1];if(config!==null&&config!==void 0&&(_config$preserve=config.preserve)!==null&&_config$preserve!==void 0&&_config$preserve[key])result[key]=value;else if((typeof value==="string"||typeof value==="number")&&!(config!==null&&config!==void 0&&(_config$ignore=config.ignore)!==null&&_config$ignore!==void 0&&_config$ignore[key])){var _config$unitless,cssVar=token2CSSVar(key,config===null||config===void 0?void 0:config.prefix);cssVars[cssVar]=typeof value==="number"&&!(config!==null&&config!==void 0&&(_config$unitless=config.unitless)!==null&&_config$unitless!==void 0&&_config$unitless[key])?"".concat(value,"px"):String(value),result[key]="var(".concat(cssVar,")")}}),[result,serializeCSSVar(cssVars,themeKey,{scope:config===null||config===void 0?void 0:config.scope})]};var React12=__toESM(require_react_development());var React9=__toESM(require_react_development());var useInternalLayoutEffect=canUseDom()?React9.useLayoutEffect:React9.useEffect,useLayoutEffect2=function(callback,deps){var firstMountRef=React9.useRef(!0);useInternalLayoutEffect(function(){return callback(firstMountRef.current)},deps),useInternalLayoutEffect(function(){return firstMountRef.current=!1,function(){firstMountRef.current=!0}},[])},useLayoutUpdateEffect=function(callback,deps){useLayoutEffect2(function(firstMount){if(!firstMount)return callback()},deps)},useLayoutEffect_default=useLayoutEffect2;var React10=__toESM(require_react_development()),fullClone=_objectSpread2({},React10),useInsertionEffect=fullClone.useInsertionEffect,useInsertionEffectPolyfill=function(renderEffect,effect,deps){React10.useMemo(renderEffect,deps),useLayoutEffect_default(function(){return effect(!0)},deps)},useCompatibleInsertionEffect=useInsertionEffect?function(renderEffect,effect,deps){return useInsertionEffect(function(){return renderEffect(),effect()},deps)}:useInsertionEffectPolyfill,useCompatibleInsertionEffect_default=useCompatibleInsertionEffect;var React11=__toESM(require_react_development()),fullClone2=_objectSpread2({},React11),useInsertionEffect2=fullClone2.useInsertionEffect,useCleanupRegister=function(deps){var effectCleanups=[],cleanupFlag=!1;function register(fn){if(cleanupFlag){warning(!1,"[Ant Design CSS-in-JS] You are registering a cleanup function after unmount, which will not have any effect.");return}effectCleanups.push(fn)}return React11.useEffect(function(){return cleanupFlag=!1,function(){if(cleanupFlag=!0,effectCleanups.length)effectCleanups.forEach(function(fn){return fn()})}},deps),register},useRun=function(){return function(fn){fn()}},useEffectCleanupRegister=typeof useInsertionEffect2<"u"?useCleanupRegister:useRun,useEffectCleanupRegister_default=useEffectCleanupRegister;var webpackHMR=!1;function useDevHMR(){return webpackHMR}var useHMR_default=useDevHMR;if(typeof module_useHMR<"u"&&module_useHMR&&module_useHMR.hot&&typeof window<"u"){if(win=typeof globalThis<"u"?globalThis:typeof window<"u"?window:null,win&&typeof win.webpackHotUpdate==="function")originWebpackHotUpdate=win.webpackHotUpdate,win.webpackHotUpdate=function(){return webpackHMR=!0,setTimeout(function(){webpackHMR=!1},0),originWebpackHotUpdate.apply(void 0,arguments)}}var win,originWebpackHotUpdate;function useGlobalCache(prefix,keyPath,cacheFn,onCacheRemove,onCacheEffect){var _React$useContext=React12.useContext(StyleContext_default),globalCache=_React$useContext.cache,fullPath=[prefix].concat(_toConsumableArray(keyPath)),fullPathStr=pathKey(fullPath),register=useEffectCleanupRegister_default([fullPathStr]),HMRUpdate=useHMR_default(),buildCache=function(updater){globalCache.opUpdate(fullPathStr,function(prevCache){var _ref=prevCache||[void 0,void 0],_ref2=_slicedToArray(_ref,2),_ref2$=_ref2[0],times=_ref2$===void 0?0:_ref2$,cache=_ref2[1],tmpCache=cache;if(cache&&HMRUpdate)onCacheRemove===null||onCacheRemove===void 0||onCacheRemove(tmpCache,HMRUpdate),tmpCache=null;var mergedCache=tmpCache||cacheFn(),data=[times,mergedCache];return updater?updater(data):data})};React12.useMemo(function(){buildCache()},[fullPathStr]);var cacheEntity=globalCache.opGet(fullPathStr);if(!cacheEntity)buildCache(),cacheEntity=globalCache.opGet(fullPathStr);var cacheContent=cacheEntity[1];return useCompatibleInsertionEffect_default(function(){onCacheEffect===null||onCacheEffect===void 0||onCacheEffect(cacheContent)},function(polyfill){return buildCache(function(_ref3){var _ref4=_slicedToArray(_ref3,2),times=_ref4[0],cache=_ref4[1];if(polyfill&×===0)onCacheEffect===null||onCacheEffect===void 0||onCacheEffect(cacheContent);return[times+1,cache]}),function(){globalCache.opUpdate(fullPathStr,function(prevCache){var _ref5=prevCache||[],_ref6=_slicedToArray(_ref5,2),_ref6$=_ref6[0],times=_ref6$===void 0?0:_ref6$,cache=_ref6[1],nextCount=times-1;if(nextCount===0)return register(function(){if(polyfill||!globalCache.opGet(fullPathStr))onCacheRemove===null||onCacheRemove===void 0||onCacheRemove(cache,!1)}),null;return[times-1,cache]})}},[fullPathStr]),cacheContent}var EMPTY_OVERRIDE={},hashPrefix="css-dev-only-do-not-override",tokenKeys=new Map;function recordCleanToken(tokenKey){tokenKeys.set(tokenKey,(tokenKeys.get(tokenKey)||0)+1)}function removeStyleTags(key,instanceId){if(typeof document<"u"){var styles=document.querySelectorAll("style[".concat(ATTR_TOKEN,'="').concat(key,'"]'));styles.forEach(function(style){if(style[CSS_IN_JS_INSTANCE]===instanceId){var _style$parentNode;(_style$parentNode=style.parentNode)===null||_style$parentNode===void 0||_style$parentNode.removeChild(style)}})}}var TOKEN_THRESHOLD=0;function cleanTokenStyle(tokenKey,instanceId){tokenKeys.set(tokenKey,(tokenKeys.get(tokenKey)||0)-1);var cleanableKeyList=new Set;if(tokenKeys.forEach(function(value,key){if(value<=0)cleanableKeyList.add(key)}),tokenKeys.size-cleanableKeyList.size>TOKEN_THRESHOLD)cleanableKeyList.forEach(function(key){removeStyleTags(key,instanceId),tokenKeys.delete(key)})}var getComputedToken=function(originToken,overrideToken,theme,format){var derivativeToken=theme.getDerivativeToken(originToken),mergedDerivativeToken=_objectSpread2(_objectSpread2({},derivativeToken),overrideToken);if(format)mergedDerivativeToken=format(mergedDerivativeToken);return mergedDerivativeToken},TOKEN_PREFIX="token";function useCacheToken(theme,tokens){var option=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},_useContext=import_react4.useContext(StyleContext_default),instanceId=_useContext.cache.instanceId,container=_useContext.container,_option$salt=option.salt,salt=_option$salt===void 0?"":_option$salt,_option$override=option.override,override=_option$override===void 0?EMPTY_OVERRIDE:_option$override,{formatToken,getComputedToken:compute,cssVar}=option,mergedToken=memoResult(function(){return Object.assign.apply(Object,[{}].concat(_toConsumableArray(tokens)))},tokens),tokenStr=flattenToken(mergedToken),overrideTokenStr=flattenToken(override),cssVarStr=cssVar?flattenToken(cssVar):"",cachedToken=useGlobalCache(TOKEN_PREFIX,[salt,theme.id,tokenStr,overrideTokenStr,cssVarStr],function(){var _cssVar$key,mergedDerivativeToken=compute?compute(mergedToken,override,theme):getComputedToken(mergedToken,override,theme,formatToken),actualToken=_objectSpread2({},mergedDerivativeToken),cssVarsStr="";if(cssVar){var _transformToken=transformToken(mergedDerivativeToken,cssVar.key,{prefix:cssVar.prefix,ignore:cssVar.ignore,unitless:cssVar.unitless,preserve:cssVar.preserve}),_transformToken2=_slicedToArray(_transformToken,2);mergedDerivativeToken=_transformToken2[0],cssVarsStr=_transformToken2[1]}var tokenKey=token2key(mergedDerivativeToken,salt);mergedDerivativeToken._tokenKey=tokenKey,actualToken._tokenKey=token2key(actualToken,salt);var themeKey=(_cssVar$key=cssVar===null||cssVar===void 0?void 0:cssVar.key)!==null&&_cssVar$key!==void 0?_cssVar$key:tokenKey;mergedDerivativeToken._themeKey=themeKey,recordCleanToken(themeKey);var hashId="".concat(hashPrefix,"-").concat(hash_esm_default(tokenKey));return mergedDerivativeToken._hashId=hashId,[mergedDerivativeToken,hashId,actualToken,cssVarsStr,(cssVar===null||cssVar===void 0?void 0:cssVar.key)||""]},function(cache){cleanTokenStyle(cache[0]._themeKey,instanceId)},function(_ref){var _ref2=_slicedToArray(_ref,4),token=_ref2[0],cssVarsStr=_ref2[3];if(cssVar&&cssVarsStr){var style=updateCSS(cssVarsStr,hash_esm_default("css-variables-".concat(token._themeKey)),{mark:ATTR_MARK,prepend:"queue",attachTo:container,priority:-999});style[CSS_IN_JS_INSTANCE]=instanceId,style.setAttribute(ATTR_TOKEN,token._themeKey)}});return cachedToken}var extract=function(cache,effectStyles,options){var _cache=_slicedToArray(cache,5),realToken=_cache[2],styleStr=_cache[3],cssVarKey=_cache[4],_ref3=options||{},plain=_ref3.plain;if(!styleStr)return null;var styleId=realToken._tokenKey,order=-999,sharedAttrs={"data-rc-order":"prependQueue","data-rc-priority":"".concat(order)},styleText=toStyleStr(styleStr,cssVarKey,styleId,sharedAttrs,plain);return[order,styleId,styleText]};var import_react5=__toESM(require_react_development());var React13=__toESM(require_react_development());var unitlessKeys={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},unitless_esm_default=unitlessKeys;var COMMENT="comm",RULESET="rule",DECLARATION="decl";var IMPORT="@import";var NAMESPACE="@namespace",KEYFRAMES="@keyframes";var LAYER="@layer";var abs=Math.abs,from=String.fromCharCode;function trim(value){return value.trim()}function replace(value,pattern,replacement){return value.replace(pattern,replacement)}function charat(value,index){return value.charCodeAt(index)|0}function substr(value,begin,end){return value.slice(begin,end)}function strlen(value){return value.length}function sizeof(value){return value.length}function append(value,array){return array.push(value),value}var line=1,column=1,length=0,position=0,character=0,characters="";function node2(value,root,parent,type,props,children,length,siblings){return{value,root,parent,type,props,children,line,column,length,return:"",siblings}}function char(){return character}function prev(){if(character=position>0?charat(characters,--position):0,column--,character===10)column=1,line--;return character}function next(){if(character=position<length?charat(characters,position++):0,column++,character===10)column=1,line++;return character}function peek(){return charat(characters,position)}function caret(){return position}function slice(begin,end){return substr(characters,begin,end)}function token(type){switch(type){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function alloc(value){return line=column=1,length=strlen(characters=value),position=0,[]}function dealloc(value){return characters="",value}function delimit(type){return trim(slice(position-1,delimiter(type===91?type+2:type===40?type+1:type)))}function whitespace(type){while(character=peek())if(character<33)next();else break;return token(type)>2||token(character)>3?"":" "}function escaping(index,count){while(--count&&next())if(character<48||character>102||character>57&&character<65||character>70&&character<97)break;return slice(index,caret()+(count<6&&peek()==32&&next()==32))}function delimiter(type){while(next())switch(character){case type:return position;case 34:case 39:if(type!==34&&type!==39)delimiter(character);break;case 40:if(type===41)delimiter(type);break;case 92:next();break}return position}function commenter(type,index){while(next())if(type+character===57)break;else if(type+character===84&&peek()===47)break;return"/*"+slice(index,position-1)+"*"+from(type===47?type:next())}function identifier(index){while(!token(peek()))next();return slice(index,position)}function compile(value){return dealloc(parse("",null,null,null,[""],value=alloc(value),0,[0],value))}function parse(value,root,parent,rule,rules,rulesets,pseudo,points,declarations){var index=0,offset=0,length=pseudo,atrule=0,property=0,previous=0,variable=1,scanning=1,ampersand=1,parens=0,character=0,type="",props=rules,children=rulesets,reference=rule,characters=type;while(scanning)switch(previous=character,character=next()){case 40:if(previous!=108&&charat(characters,length-1)==58)parens++,characters+="(";else characters+=delimit(character);break;case 41:parens--,characters+=")";break;case 34:case 39:case 91:characters+=delimit(character);break;case 9:case 10:case 13:case 32:if(parens>0){characters+=from(character);break}characters+=whitespace(previous);break;case 92:characters+=escaping(caret()-1,7);continue;case 47:switch(peek()){case 42:case 47:if(append(comment(commenter(next(),caret()),root,parent,declarations),declarations),(token(previous||1)==5||token(peek()||1)==5)&&strlen(characters)&&substr(characters,-1,void 0)!==" ")characters+=" ";break;default:characters+="/"}break;case 123*variable:points[index++]=strlen(characters)*ampersand;case 125*variable:case 59:case 0:if(parens>0&&character){characters+=from(character);break}switch(character){case 0:case 125:scanning=0;case 59+offset:if(ampersand==-1)characters=replace(characters,/\f/g,"");if(property>0&&(strlen(characters)-length||variable===0))append(property>32?declaration(characters+";",rule,parent,length-1,declarations):declaration(replace(characters," ","")+";",rule,parent,length-2,declarations),declarations);break;case 59:characters+=";";default:if(append(reference=ruleset(characters,root,parent,index,offset,rules,points,type,props=[],children=[],length,rulesets),rulesets),character===123)if(offset===0)parse(characters,root,reference,reference,props,rulesets,length,points,children);else{switch(atrule){case 99:if(charat(characters,3)===110)break;case 108:if(charat(characters,2)===97)break;default:offset=0;case 100:case 109:case 115:}if(offset)parse(value,reference,reference,rule&&append(ruleset(value,reference,reference,0,0,rules,points,type,rules,props=[],length,children),children),rules,children,length,points,rule?props:children);else parse(characters,reference,reference,reference,[""],children,0,points,children)}}index=offset=property=0,variable=ampersand=1,type=characters="",length=pseudo;break;case 58:length=1+strlen(characters),property=previous;default:if(variable<1){if(character==123)--variable;else if(character==125&&variable++==0&&prev()==125)continue}switch(characters+=from(character),character*variable){case 38:ampersand=offset>0?1:(characters+="\f",-1);break;case 44:if(parens>0)break;points[index++]=(strlen(characters)-1)*ampersand,ampersand=1;break;case 64:if(peek()===45)characters+=delimit(next());atrule=peek(),offset=length=strlen(type=characters+=identifier(caret())),character++;break;case 45:if(previous===45&&strlen(characters)==2)variable=0}}return rulesets}function ruleset(value,root,parent,index,offset,rules,points,type,props,children,length,siblings){var post=offset-1,rule=offset===0?rules:[""],size=sizeof(rule);for(var i=0,j=0,k=0;i<index;++i)for(var x=0,y=substr(value,post+1,post=abs(j=points[i])),z=value;x<size;++x)if(z=trim(j>0?rule[x]+" "+y:replace(y,/&\f/g,rule[x])))props[k++]=z;return node2(value,root,parent,offset===0?RULESET:type,props,children,length,siblings)}function comment(value,root,parent,siblings){return node2(value,root,parent,COMMENT,from(char()),substr(value,2,-2),0,siblings)}function declaration(value,root,parent,length,siblings){return node2(value,root,parent,DECLARATION,substr(value,0,length),substr(value,length+1,-1),length,siblings)}function serialize(children,callback){var output="";for(var i=0;i<children.length;i++)output+=callback(children[i],i,children,callback)||"";return output}function stringify(element,index,children,callback){switch(element.type){case LAYER:if(element.children.length)break;case IMPORT:case NAMESPACE:case DECLARATION:return element.return=element.return||element.value;case COMMENT:return"";case KEYFRAMES:return element.return=element.value+"{"+serialize(element.children,callback)+"}";case RULESET:if(!strlen(element.value=element.props.join(",")))return""}return strlen(children=serialize(element.children,callback))?element.return=element.value+"{"+children+"}":""}function lintWarning(message,info){var{path,parentSelectors}=info;warning_default(!1,"[Ant Design CSS-in-JS] ".concat(path?"Error in ".concat(path,": "):"").concat(message).concat(parentSelectors.length?" Selector: ".concat(parentSelectors.join(" | ")):""))}var linter=function(key,value,info){if(key==="content"){var contentValuePattern=/(attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/,contentValues=["normal","none","initial","inherit","unset"];if(typeof value!=="string"||contentValues.indexOf(value)===-1&&!contentValuePattern.test(value)&&(value.charAt(0)!==value.charAt(value.length-1)||value.charAt(0)!=='"'&&value.charAt(0)!=="'"))lintWarning("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"".concat(value,"\"'`."),info)}},contentQuotesLinter_default=linter;var linter2=function(key,value,info){if(key==="animation"){if(info.hashId&&value!=="none")lintWarning("You seem to be using hashed animation '".concat(value,"', in which case 'animationName' with Keyframe as value is recommended."),info)}},hashedAnimationLinter_default=linter2;var ATTR_CACHE_MAP="data-ant-cssinjs-cache-path",CSS_FILE_STYLE="_FILE_STYLE__";function serialize2(cachePathMap){return Object.keys(cachePathMap).map(function(path){var hash=cachePathMap[path];return"".concat(path,":").concat(hash)}).join(";")}var cachePathMap,fromCSSFile=!0;function prepare(){if(!cachePathMap){if(cachePathMap={},canUseDom()){var div=document.createElement("div");div.className=ATTR_CACHE_MAP,div.style.position="fixed",div.style.visibility="hidden",div.style.top="-9999px",document.body.appendChild(div);var content=getComputedStyle(div).content||"";content=content.replace(/^"/,"").replace(/"$/,""),content.split(";").forEach(function(item){var _item$split=item.split(":"),_item$split2=_slicedToArray(_item$split,2),path=_item$split2[0],hash=_item$split2[1];cachePathMap[path]=hash});var inlineMapStyle=document.querySelector("style[".concat(ATTR_CACHE_MAP,"]"));if(inlineMapStyle){var _inlineMapStyle$paren;fromCSSFile=!1,(_inlineMapStyle$paren=inlineMapStyle.parentNode)===null||_inlineMapStyle$paren===void 0||_inlineMapStyle$paren.removeChild(inlineMapStyle)}document.body.removeChild(div)}}}function existPath(path){return prepare(),!!cachePathMap[path]}function getStyleAndHash(path){var hash=cachePathMap[path],styleStr=null;if(hash&&canUseDom())if(fromCSSFile)styleStr=CSS_FILE_STYLE;else{var _style=document.querySelector("style[".concat(ATTR_MARK,'="').concat(cachePathMap[path],'"]'));if(_style)styleStr=_style.innerHTML;else delete cachePathMap[path]}return[styleStr,hash]}var SKIP_CHECK="_skip_check_",MULTI_VALUE="_multi_value_";function normalizeStyle(styleStr){var serialized=serialize(compile(styleStr),stringify);return serialized.replace(/\{%%%\:[^;];}/g,";")}function isCompoundCSSProperty(value){return _typeof(value)==="object"&&value&&((SKIP_CHECK in value)||(MULTI_VALUE in value))}function injectSelectorHash(key,hashId,hashPriority){if(!hashId)return key;var hashClassName=".".concat(hashId),hashSelector=hashPriority==="low"?":where(".concat(hashClassName,")"):hashClassName,keys=key.split(",").map(function(k){var _firstPath$match,fullPath=k.trim().split(/\s+/),firstPath=fullPath[0]||"",htmlElement=((_firstPath$match=firstPath.match(/^\w+/))===null||_firstPath$match===void 0?void 0:_firstPath$match[0])||"";return firstPath="".concat(htmlElement).concat(hashSelector).concat(firstPath.slice(htmlElement.length)),[firstPath].concat(_toConsumableArray(fullPath.slice(1))).join(" ")});return keys.join(",")}var parseStyle=function parseStyle(interpolation){var config=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_ref=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},{root,injectHash,parentSelectors}=_ref,{hashId,layer,path,hashPriority,transformers:_config$transformers}=config,transformers=_config$transformers===void 0?[]:_config$transformers,_config$linters=config.linters,linters=_config$linters===void 0?[]:_config$linters,styleStr="",effectStyle={};function parseKeyframes(keyframes){var animationName=keyframes.getName(hashId);if(!effectStyle[animationName]){var _parseStyle=parseStyle(keyframes.style,config,{root:!1,parentSelectors}),_parseStyle2=_slicedToArray(_parseStyle,1),_parsedStr=_parseStyle2[0];effectStyle[animationName]="@keyframes ".concat(keyframes.getName(hashId)).concat(_parsedStr)}}function flattenList(list){var fullList=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return list.forEach(function(item){if(Array.isArray(item))flattenList(item,fullList);else if(item)fullList.push(item)}),fullList}var flattenStyleList=flattenList(Array.isArray(interpolation)?interpolation:[interpolation]);if(flattenStyleList.forEach(function(originStyle){var style=typeof originStyle==="string"&&!root?{}:originStyle;if(typeof style==="string")styleStr+="".concat(style,`
|
|
9
9
|
`);else if(style._keyframe)parseKeyframes(style);else{var mergedStyle=transformers.reduce(function(prev,trans){var _trans$visit;return(trans===null||trans===void 0||(_trans$visit=trans.visit)===null||_trans$visit===void 0?void 0:_trans$visit.call(trans,prev))||prev},style);Object.keys(mergedStyle).forEach(function(key){var value=mergedStyle[key];if(_typeof(value)==="object"&&value&&(key!=="animationName"||!value._keyframe)&&!isCompoundCSSProperty(value)){var subInjectHash=!1,mergedKey=key.trim(),nextRoot=!1;if((root||injectHash)&&hashId)if(mergedKey.startsWith("@"))subInjectHash=!0;else if(mergedKey==="&")mergedKey=injectSelectorHash("",hashId,hashPriority);else mergedKey=injectSelectorHash(key,hashId,hashPriority);else if(root&&!hashId&&(mergedKey==="&"||mergedKey===""))mergedKey="",nextRoot=!0;var _parseStyle3=parseStyle(value,config,{root:nextRoot,injectHash:subInjectHash,parentSelectors:[].concat(_toConsumableArray(parentSelectors),[mergedKey])}),_parseStyle4=_slicedToArray(_parseStyle3,2),_parsedStr2=_parseStyle4[0],childEffectStyle=_parseStyle4[1];effectStyle=_objectSpread2(_objectSpread2({},effectStyle),childEffectStyle),styleStr+="".concat(mergedKey).concat(_parsedStr2)}else{let appendStyle=function(cssKey,cssValue){if(_typeof(value)!=="object"||!(value!==null&&value!==void 0&&value[SKIP_CHECK]))[contentQuotesLinter_default,hashedAnimationLinter_default].concat(_toConsumableArray(linters)).forEach(function(linter){return linter(cssKey,cssValue,{path,hashId,parentSelectors})});var styleName=cssKey.replace(/[A-Z]/g,function(match){return"-".concat(match.toLowerCase())}),formatValue=cssValue;if(!unitless_esm_default[cssKey]&&typeof formatValue==="number"&&formatValue!==0)formatValue="".concat(formatValue,"px");if(cssKey==="animationName"&&cssValue!==null&&cssValue!==void 0&&cssValue._keyframe)parseKeyframes(cssValue),formatValue=cssValue.getName(hashId);styleStr+="".concat(styleName,":").concat(formatValue,";")};var _value,actualValue=(_value=value===null||value===void 0?void 0:value.value)!==null&&_value!==void 0?_value:value;if(_typeof(value)==="object"&&value!==null&&value!==void 0&&value[MULTI_VALUE]&&Array.isArray(actualValue))actualValue.forEach(function(item){appendStyle(key,item)});else appendStyle(key,actualValue)}})}}),!root)styleStr="{".concat(styleStr,"}");else if(layer){if(styleStr)styleStr="@layer ".concat(layer.name," {").concat(styleStr,"}");if(layer.dependencies)effectStyle["@layer ".concat(layer.name)]=layer.dependencies.map(function(deps){return"@layer ".concat(deps,", ").concat(layer.name,";")}).join(`
|
|
@@ -693,4 +693,4 @@ mark {
|
|
|
693
693
|
}
|
|
694
694
|
`;var import_react126=__toESM(require_react_development(),1);function antdColor(css){let s=sanitizeCssTokenValue(css);if(/^(#|rgb|hsl)/i.test(s))return s;return formatRgb(parse_default(s))??s}function base(slot,fallback){if(typeof slot==="string")return antdColor(slot);if(slot&&typeof slot==="object"&&typeof slot.DEFAULT==="string")return antdColor(slot.DEFAULT);return antdColor(fallback)}function radiusPx(theme){let md=theme.radius?.md;if(typeof md==="number")return md;if(typeof md==="string"){let n=Number.parseFloat(md);return Number.isFinite(n)?md.includes("rem")?n*16:n:8}return 8}function antdTokens(theme,dark){let c=resolveColors(theme,dark);return{colorPrimary:base(c.primary,"#4f46e5"),colorBgBase:antdColor(c.background),colorTextBase:antdColor(c.foreground),colorError:base(c.destructive,"#dc2626"),borderRadius:radiusPx(theme),...antdTypography(theme),...c.card?{colorBgContainer:base(c.card,c.background)}:{}}}function antdTypography(theme){let typography=theme.typography,typeset=typography.typesets?.[DEFAULT_TYPESET_NAME],scale=typesetScale(typeset,{...typography.fontFamily?{fontFamily:typography.fontFamily}:{}}),ownLeading=typeset?.leading!==void 0&&typeset.leading!==TYPESET_DEFAULT.leading;return{fontFamily:sanitizeCssTokenValue(scale.body.fontFamily??typography.fontFamily?.sans??"system-ui, -apple-system, sans-serif"),fontSize:scale.body.fontSize,fontSizeSM:scale.caption.fontSize,fontSizeLG:scale.lead.fontSize,fontSizeHeading1:scale.h1.fontSize,fontSizeHeading2:scale.h2.fontSize,fontSizeHeading3:scale.h3.fontSize,fontSizeHeading4:scale.h4.fontSize,fontSizeHeading5:scale.h5.fontSize,...ownLeading?{lineHeight:scale.body.lineHeight,lineHeightHeading1:scale.h1.lineHeight,lineHeightHeading2:scale.h2.lineHeight,lineHeightHeading3:scale.h3.lineHeight,lineHeightHeading4:scale.h4.lineHeight,lineHeightHeading5:scale.h5.lineHeight}:{}}}function antdThemeConfig(theme,dark=!1){return{cssVar:!0,algorithm:dark?theme_default3.darkAlgorithm:theme_default3.defaultAlgorithm,token:antdTokens(theme,dark)}}function antdDocumentCss(theme,dark=!1){let token=theme_default3.getDesignToken(antdThemeConfig(theme,dark));return"html,body{"+[`background-color:${token.colorBgBase}`,`color:${token.colorTextBase}`,`font-family:${token.fontFamily}`,`font-size:${token.fontSize}px`,`line-height:${token.lineHeight}`].join(";")+"}"}function antdThemeOptions(theme,dark=!1){return{cssVar:!0,algorithm:identifierRef(dark?"antdTheme.darkAlgorithm":"antdTheme.defaultAlgorithm"),token:antdTokens(theme,dark)}}function makeRenderPass(theme,dark=!1){let cache=createCache(),config=antdThemeConfig(theme,dark);return{wrap:(element)=>import_react126.createElement(StyleProvider,{cache},import_react126.createElement(config_provider_default,{theme:config},element)),css:()=>`${reset_default}
|
|
695
695
|
${antdDocumentCss(theme,dark)}
|
|
696
|
-
${stripStyleTags(extractStyle(cache,{plain:!0}))}`}}function stripStyleTags(css){let current=css;for(;;){let next=current.replace(/<\/?style[^>]*>/gi,"");if(next===current)return next;current=next}}var here=dirname(fileURLToPath(import.meta.url)),srcDir=resolveProviderSrcDir(here,"provider-antd",process.env.VELLOO_ANTD_SRC);function createProvider(){return{id:"antd",version:ANTD_VERSION,label:"Ant Design v5",componentsDir:srcDir,styleEntryPath:join(srcDir,"tailwind-entry.css"),registry,loadManifest:async()=>ANTD_MANIFEST,catalog:async()=>catalogFromManifest(ANTD_MANIFEST.filter((c)=>c.source==="antd"),{importPath:"antd"}),styleChannel:STYLE_PROP,styleChannels:["style"],mcpIntro:()=>[...ANTD_INTRO],renderPass:(theme,dark)=>makeRenderPass(theme,dark??!1),codegenModule:"antd",themeToNative:(theme,dark)=>antdThemeOptions(theme,dark),themeModule:{importLines:['import { theme as antdTheme } from "antd";'],factory:null,defaultPath:"antd-theme.ts"},ownedModules:{packages:["antd"]}}}export{createProvider};
|
|
696
|
+
${stripStyleTags(extractStyle(cache,{plain:!0}))}`}}function stripStyleTags(css){let current=css;for(;;){let next=current.replace(/<\/?style[^>]*>/gi,"");if(next===current)return next;current=next}}var here=dirname(fileURLToPath(import.meta.url)),srcDir=resolveProviderSrcDir(here,"provider-antd",process.env.VELLOO_ANTD_SRC);function createProvider(){return{id:"antd",version:ANTD_VERSION,label:"Ant Design v5",componentsDir:srcDir,styleEntryPath:join(srcDir,"tailwind-entry.css"),registry,loadManifest:async()=>ANTD_MANIFEST,catalog:async()=>catalogFromManifest(ANTD_MANIFEST.filter((c)=>c.source==="antd"),{importPath:"antd"}),styleChannel:STYLE_PROP,styleChannels:["style"],themeRoles:["background","foreground","primary","destructive","card"],mcpIntro:()=>[...ANTD_INTRO],renderPass:(theme,dark)=>makeRenderPass(theme,dark??!1),codegenModule:"antd",themeToNative:(theme,dark)=>antdThemeOptions(theme,dark),themeModule:{importLines:['import { theme as antdTheme } from "antd";'],factory:null,defaultPath:"antd-theme.ts"},ownedModules:{packages:["antd"]}}}export{createProvider};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-80fjfyha.js";import{string,number,boolean,unknown,array,object}from"./chunk-
|
|
2
|
+
import"./chunk-80fjfyha.js";import{string,number,boolean,unknown,array,object}from"./chunk-xxw67jpk.js";import"./chunk-9g45c5md.js";import"./chunk-xg49s85z.js";import"./chunk-bntsn3wj.js";import{fail}from"./chunk-s23gtejf.js";import{openUrl}from"./chunk-hggap8fq.js";import{DESIGN_ARG_DESCRIPTION,resolveDesign}from"./chunk-6w42sr61.js";import{defineCommand}from"./chunk-2smsg2ct.js";import{writeFileSync}from"fs";import{basename,join as join3,resolve as resolve2}from"path";import{readFileSync}from"fs";import{join,resolve,sep}from"path";var AssetRefSchema=object({file:string(),mimeType:string(),bytes:number()}),TapeRecordSchema=object({seq:number().optional(),ts:string().optional(),tool:string().optional(),durationMs:number().optional(),ok:boolean().optional(),params:unknown().optional(),text:string().optional(),images:array(AssetRefSchema).optional(),isError:boolean().optional(),error:object({name:string().optional(),message:string().optional(),stack:string().optional()}).optional(),sessionId:string().optional()}),TapeMetaSchema=object({tapeId:string().optional(),startedAt:string().optional(),folder:string().optional(),pid:number().optional()}),PendingCallSchema=object({seq:number().optional(),ts:string().optional(),tool:string().optional(),params:unknown().optional(),sessionId:string().optional()});function loadTape(dir){let meta={};try{let parsed=TapeMetaSchema.safeParse(JSON.parse(readFileSync(join(dir,"meta.json"),"utf8")));if(parsed.success)meta=parsed.data}catch{}let records=[],raw="";try{raw=readFileSync(join(dir,"tape.jsonl"),"utf8")}catch{}for(let line of raw.split(`
|
|
3
3
|
`)){let t=line.trim();if(!t)continue;try{let parsed=TapeRecordSchema.safeParse(JSON.parse(t));if(parsed.success)records.push(parsed.data)}catch{}}let pending=[];try{let raw=JSON.parse(readFileSync(join(dir,"pending.json"),"utf8"));if(Array.isArray(raw))pending=raw.flatMap((entry)=>{let parsed=PendingCallSchema.safeParse(entry);return parsed.success?[parsed.data]:[]})}catch{}let done=new Set(records.map((r)=>r.seq));return pending=pending.filter((p)=>!done.has(p.seq)),{dir,meta,records,pending}}var ESC={"&":"&","<":"<",">":">",'"':""","'":"'"};function esc(s){return s.replace(/[&<>"']/g,(c)=>ESC[c]??c)}function isBad(r){return r.ok===!1||r.isError===!0||Boolean(r.error)}function prettyJsonText(text){try{return JSON.stringify(JSON.parse(text),null,2)}catch{return text}}function fmtDuration(ms){if(ms===void 0)return"";return ms>=1000?`${(ms/1000).toFixed(2)}s`:`${ms}ms`}function fmtBytes(n){if(n>=1048576)return`${(n/1048576).toFixed(1)}MB`;if(n>=1024)return`${(n/1024).toFixed(0)}KB`;return`${n}B`}function timeOnly(iso){if(!iso)return"";let m=/T(\d{2}:\d{2}:\d{2})/.exec(iso);return m?m[1]:iso}function tapeStats(tape){let totalMs=tape.records.reduce((s,r)=>s+(r.durationMs??0),0);return{calls:tape.records.length,errors:tape.records.filter(isBad).length,totalLabel:fmtDuration(totalMs)}}function safeMimeType(mime){return/^[a-z0-9.+-]+\/[a-z0-9.+-]+$/i.test(mime)?mime:"application/octet-stream"}function inlineImage(dir,asset){let dataUri="";try{let abs=resolve(dir,asset.file);if(abs!==resolve(dir)&&!abs.startsWith(resolve(dir)+sep))return`<div class="missing">out-of-tree asset: ${esc(asset.file)}</div>`;let buf=readFileSync(abs);dataUri=`data:${safeMimeType(asset.mimeType)};base64,${buf.toString("base64")}`}catch{return`<div class="missing">missing asset: ${esc(asset.file)}</div>`}return`<img class="shot" loading="lazy" src="${dataUri}" alt="${esc(asset.file)}"/>`}function renderResult(dir,rec){if(rec.error){let head=esc([rec.error.name,rec.error.message].filter(Boolean).join(": ")||"error"),stack=rec.error.stack?`<pre class="stack">${esc(rec.error.stack)}</pre>`:"";return`<div class="err-box"><div class="err-head">${head}</div>${stack}</div>`}let parts=[];if(rec.text)parts.push(`<pre class="json">${esc(prettyJsonText(rec.text))}</pre>`);if(rec.images?.length){let imgs=rec.images.map((a)=>`<figure>${inlineImage(dir,a)}<figcaption>${esc(a.file.replace(/^assets\//,""))} \xB7 ${fmtBytes(a.bytes)}</figcaption></figure>`).join("");parts.push(`<div class="shots">${imgs}</div>`)}if(rec.isError)parts.unshift('<div class="flag">isError: true</div>');return parts.join("")||'<div class="muted">no output</div>'}function renderRow(dir,rec){let bad=isBad(rec),tool=esc(rec.tool??"?"),seq=rec.seq??"",params=esc(JSON.stringify(rec.params??null,null,2)),search=esc(`${rec.tool??""} ${rec.text??""} ${JSON.stringify(rec.params??"")}`.toLowerCase().slice(0,4000)),nShots=rec.images?.length?` \xB7 ${rec.images.length}\uD83D\uDCF7`:"";return`<details class="call${bad?" bad":""}" data-seq="${rec.seq??""}" data-error="${bad?1:0}" data-search="${search}">
|
|
4
4
|
<summary>
|
|
5
5
|
<span class="dot"></span>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{loadDesignFolder,liveExtensions,LiveBundler,hostAssetRequest,resolveProviders,findHostTailwindConfig,TailwindJit,createCaptureMount,extraThemeBlock}from"./chunk-
|
|
2
|
+
import{loadDesignFolder,liveExtensions,LiveBundler,hostAssetRequest,resolveProviders,findHostTailwindConfig,TailwindJit,createCaptureMount,extraThemeBlock}from"./chunk-9g45c5md.js";import{join,sep}from"path";var LIVE_BUNDLE_PATH="/live/bundle.js";async function withAssetServer(folder,liveCode,fn,routes={}){let{bundle,host}=routes,assetsRoot=join(folder,"assets"),server=Bun.serve({port:0,hostname:"127.0.0.1",async fetch(req){let url=new URL(req.url),stored=host?.(req);if(stored)return stored;let mounted=bundle?await bundle(url):null;if(mounted!==null)return new Response(mounted,{headers:{"Content-Type":"text/javascript","Access-Control-Allow-Origin":"*"}});if(liveCode!==null&&url.pathname===LIVE_BUNDLE_PATH)return new Response(liveCode,{headers:{"Content-Type":"text/javascript"}});if(url.pathname.startsWith("/assets/")){let fsPath=join(folder,decodeURIComponent(url.pathname));if(fsPath.startsWith(assetsRoot+sep)){let file=Bun.file(fsPath);if(await file.exists())return new Response(file)}}let hostAsset=host&&hostAssetRequest(req),fromHost=hostAsset?host(hostAsset):null;if(fromHost)return fromHost;return new Response("not found",{status:404})}});try{return await fn(`http://127.0.0.1:${server.port}/`)}finally{server.stop(!0)}}import{join as join2}from"path";function createOneShotLiveBundler(root,config){if(Object.keys(liveExtensions(config.extensions)).length===0)return null;return new LiveBundler(root,()=>config,()=>liveExtensions(config.extensions),!0,!0)}async function buildLiveModule(bundler){let bundle=await bundler.build();return{code:bundle.code.length>0?bundle.code:null,warnings:bundle.errors.map((error)=>`live-island: ${error.message}`)}}async function loadPipeline(folderPath){let design=await loadDesignFolder(folderPath),config=design.config,{providers,defaultProvider}=await resolveProviders(config,folderPath),capture=createCaptureMount(design,providers,defaultProvider),liveBundler=createOneShotLiveBundler(folderPath,config),jit=new TailwindJit(Object.values(providers),join2(folderPath,"screens"),void 0,()=>extraThemeBlock(design),()=>[...liveBundler?.hostSourceDirs()??[],...capture.sourceDirs()],()=>findHostTailwindConfig(folderPath,config.hostApp),config.styling?.framework),snapshotCss=await jit.build(),live;return{folderPath,design,config,providers,defaultProvider,jit,snapshotCss,capture,liveModule(){return live??=liveBundler?buildLiveModule(liveBundler):Promise.resolve({code:null,warnings:[]}),live}}}
|
|
3
3
|
export{LIVE_BUNDLE_PATH,withAssetServer,createOneShotLiveBundler,buildLiveModule,loadPipeline};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ok,err,PROTECTED_SHARES_UNAVAILABLE,PublishDestinationsResponseSchema,LinkResponseSchema,LinkAccessResponseSchema,VersionUploadResponseSchema,PublishedDesignsResponseSchema,TeamsResponseSchema,unreachable,protocolViolation,uploadRaceLost,readFailure,cloudFailure,httpFailureFrom,boardLimitFrom,describeBoardLimit,describeCloudError,cloudJson,cloudFetch}from"./chunk-bntsn3wj.js";import{prettifyError,string,number,boolean,array,object,strictObject,record,_enum,literal,AnnotationSchema,CanvasNoteSchema,BoardSchema,ExtensionSchema,ViewportPresetSchema,LibrarySchema,StylingSchema,ScreenSchema,SnippetSchema,sanitizeSvgMarkup,ThemeSchema,ViewportSchema}from"./chunk-xxw67jpk.js";import{buildBoardComposite,MAX_CONCURRENT_RENDERS,renderScreen,captureMountedDocument,captureScreenshot}from"./chunk-xg49s85z.js";import{writeJsonAtomic,managedDesignId,localDesignOf,recordedDesignName,orderedBoards,activeBoards,registryForScreen,renderPassForScreen,hostStylesheetsForScreen,hostFilesFetch,storedHostSource,shipHostFiles,createCaptureMount}from"./chunk-9g45c5md.js";import{LIVE_BUNDLE_PATH,withAssetServer,createOneShotLiveBundler,buildLiveModule}from"./chunk-hsk91jms.js";import{checkCloudHealth}from"./chunk-w30zfv3m.js";var VERSION_UPLOAD_TIMEOUT_MS=60000,VERSION_UPLOAD_RETRIES=1;async function listPublishDestinations(opts){let query=new URLSearchParams({folderId:opts.folderId});if(opts.teamId)query.set("teamId",opts.teamId);return cloudFetch(`${opts.baseUrl}/v1/publish-destinations?${query}`,PublishDestinationsResponseSchema,{operation:"listing publish destinations",token:opts.token})}async function uploadLinkBundle(opts){let{baseUrl,token,form}=opts,authorized={authorization:`Bearer ${token}`},createRes=await fetch(`${baseUrl}/v1/links`,{method:"POST",headers:authorized,body:JSON.stringify(opts.link)}).catch((error)=>error);if(!(createRes instanceof Response))return err(unreachable(createRes,{url:baseUrl}));if(createRes.status!==200&&createRes.status!==201)return err(await httpFailureFrom("link creation",createRes));let created=createRes.status===201,createdLink=await cloudJson(createRes,LinkResponseSchema,"link creation");if(!createdLink.ok)return createdLink;let link=createdLink.value;if(opts.link.publishMode==="new"&&!created)return err(protocolViolation("the cloud reused a link even though a new publish destination was requested"));if(opts.link.publishMode==="update"&&created)return await fetch(`${baseUrl}/v1/links/${link.slug}`,{method:"DELETE",headers:authorized}).catch(()=>{}),err(protocolViolation("the cloud created a link even though an existing destination was selected"));if(!created){let accessRes=await fetch(`${baseUrl}/v1/links/${link.slug}/access`,{method:"PUT",headers:{...authorized,"content-type":"application/json"},body:JSON.stringify({visibility:opts.link.visibility,password:opts.link.password??null,passwordExpiresAt:opts.link.password?opts.link.passwordExpiresAt??null:null,expectedVersionId:opts.link.expectedVersionId??null,...opts.link.audience?.length?{audience:opts.link.audience}:{},...opts.link.publicComments!==void 0?{publicComments:opts.link.publicComments}:{}})});if(!accessRes.ok)return err(await httpFailureFrom("privacy update",accessRes));let access=await cloudJson(accessRes,LinkAccessResponseSchema,"privacy update");if(!access.ok)return access;link={...link,...access.value}}if(form.append("publishMode",opts.link.publishMode),opts.link.expectedVersionId)form.append("expectedVersionId",opts.link.expectedVersionId);let attempt=await uploadVersionWithRetry({url:`${baseUrl}/v1/links/${link.slug}/versions`,headers:authorized,form,timeoutMs:opts.uploadTimeoutMs??VERSION_UPLOAD_TIMEOUT_MS,retries:opts.uploadRetries??VERSION_UPLOAD_RETRIES});if(!attempt.ok)return attempt;let upload=attempt.value,uploadRes=upload.response;if(uploadRes.status!==201){let{detail,code}=await readFailure(uploadRes);if(upload.transientFailures>0&&uploadRes.status===409&&/slot changed|already has a version/i.test(detail))return err(uploadRaceLost());if(created)await fetch(`${baseUrl}/v1/links/${link.slug}`,{method:"DELETE",headers:authorized}).catch(()=>{});return err(cloudFailure("upload",uploadRes.status,detail,code))}let parsed=await cloudJson(uploadRes,VersionUploadResponseSchema,"upload");if(!parsed.ok)return parsed;let uploaded=parsed.value;return ok({link:{slug:link.slug,visibility:link.visibility??opts.link.visibility,passwordProtected:link.passwordProtected??opts.link.password!=null,...link.audience!==void 0?{audience:link.audience}:{},...link.publicComments!==void 0?{publicComments:link.publicComments}:{}},created,files:uploaded.files,bytes:uploaded.bytes,shareUrl:uploaded.url.startsWith("http")?uploaded.url:`${baseUrl}${uploaded.url}`,...uploaded.tier!==void 0?{tier:uploaded.tier}:{},...uploaded.history!==void 0?{history:uploaded.history}:{}})}async function uploadVersionWithRetry(opts){let attempts=Math.max(1,Math.floor(opts.retries)+1),transientFailures=0,lastNetworkError="unknown network error",lastTimedOut=!1;for(let attempt=1;attempt<=attempts;attempt+=1){let controller=new AbortController,timedOut=!1,timer=setTimeout(()=>{timedOut=!0,controller.abort()},Math.max(1,opts.timeoutMs));try{let response=await fetch(opts.url,{method:"POST",headers:opts.headers,body:opts.form,signal:controller.signal});if(response.status<500||attempt===attempts)return ok({response,transientFailures});transientFailures+=1,await response.body?.cancel().catch(()=>{})}catch(error){if(transientFailures+=1,lastTimedOut=timedOut,lastNetworkError=error instanceof Error?error.message:String(error),attempt===attempts){let retried=attempts>1?` after ${attempts} attempts`:"";return err(timedOut?unreachable(`timed out after ${formatDuration(opts.timeoutMs)}${retried}`,{url:opts.url,timedOut:!0}):unreachable(`version upload${retried}: ${lastNetworkError}`,{url:opts.url}))}}finally{clearTimeout(timer)}}return err(lastTimedOut?unreachable(`timed out after ${formatDuration(opts.timeoutMs)}`,{url:opts.url,timedOut:!0}):unreachable(`version upload: ${lastNetworkError}`,{url:opts.url}))}function formatDuration(ms){return ms>=1000?`${Math.round(ms/1000)}s`:`${Math.max(1,Math.round(ms))}ms`}var cloudUnhealthy=(detail)=>({kind:"CloudUnhealthy",detail}),noScreens=(root)=>({kind:"NoScreens",root}),noBoardScreens=(unplaced)=>({kind:"NoBoardScreens",unplaced}),bundleInvalid=(detail)=>({kind:"BundleInvalid",detail}),teamNotFound=(requested)=>({kind:"TeamNotFound",requested}),teamAmbiguous=(requested)=>({kind:"TeamAmbiguous",requested}),teamNotPublishable=(requested,reviewer)=>({kind:"TeamNotPublishable",requested,reviewer}),noPublishableTeam=(reviewer)=>({kind:"NoPublishableTeam",reviewer}),teamChoiceRequired=(names)=>({kind:"TeamChoiceRequired",names}),REVIEWERS_CANNOT_PUBLISH="reviewers can view and comment on boards, but not publish them \u2014 to publish, ask an owner or admin to make you a member",FREE_PLAN_OWNER_ONLY="on the Free plan only the organization owner publishes \u2014 ask the owner to renew, or leave the organization to publish on your own";function unplacedHint(unplaced){if(unplaced.length===0)return"";let shown=unplaced.slice(0,5).join(", "),more=unplaced.length>5?`, and ${unplaced.length-5} more`:"",[subject,it]=unplaced.length===1?["1 screen is","it"]:[`${unplaced.length} screens are`,"each"];return` ${subject} on no board (${shown}${more}): add a frame for ${it} on the canvas, or with add_frame.`}function describePublishError(error){switch(error.kind){case"CloudUnhealthy":return error.detail;case"NoScreens":return`no screens found in ${error.root} \u2014 is this a velloo design folder?`;case"NoBoardScreens":return`the selected boards have no screens.${unplacedHint(error.unplaced)}`;case"BundleInvalid":return`velloo built an invalid design bundle and did not upload it: ${error.detail}. This is a bug \u2014 please report it.`;case"TeamNotFound":return`no team named or identified by '${error.requested}'`;case"TeamAmbiguous":return`more than one team is named '${error.requested}'; pass its UUID`;case"TeamNotPublishable":return error.reviewer?REVIEWERS_CANNOT_PUBLISH:`you can't publish to '${error.requested}' \u2014 you can only publish to teams you're on`;case"NoPublishableTeam":return error.reviewer?REVIEWERS_CANNOT_PUBLISH:FREE_PLAN_OWNER_ONLY;case"TeamChoiceRequired":return`you can publish to more than one team \u2014 choose one (${error.names.join(", ")}) with --team`;case"HttpFailure":{if(error.status===403&&/protected shares/i.test(error.detail))return`${PROTECTED_SHARES_UNAVAILABLE}. Publish publicly, or upgrade your plan from your cloud's billing page`;let limit=boardLimitFrom(error);if(limit)return`${describeBoardLimit(limit)}. Run \`velloo publish list\` to see them, or upgrade your plan from your cloud's billing page`;return describeCloudError(error)}default:return describeCloudError(error)}}import{execFileSync}from"child_process";import{existsSync}from"fs";import{readFile}from"fs/promises";import{join}from"path";var DESIGN_BUNDLE_FORMAT=2,BundleScreenshotsSchema=object({cover:string().optional(),screens:record(string(),string()).optional(),boards:record(string(),string()).optional()}),DesignBundleMetaSchema=object({formatVersion:number().int().positive().optional(),title:string().optional(),screens:array(object({id:string(),name:string().optional()})).optional(),boards:array(object({id:string()})).optional(),screenshots:BundleScreenshotsSchema.optional()});var DesignBundleSchema=strictObject({formatVersion:literal(DESIGN_BUNDLE_FORMAT),title:string(),viewport:ViewportSchema,defaultLibrary:string(),libraries:record(string(),LibrarySchema),extensions:record(string(),ExtensionSchema),styling:StylingSchema.optional(),viewportPresets:array(ViewportPresetSchema),theme:ThemeSchema,themes:record(string(),ThemeSchema),customCss:string(),snippets:array(SnippetSchema),screens:array(ScreenSchema),boards:array(BoardSchema),annotations:record(string(),array(AnnotationSchema)),notes:record(string(),array(CanvasNoteSchema)),live:boolean(),snapshotCssPath:string(),bundlePath:string().optional(),hostStylesheets:array(string().regex(/^(?:assets\/host\/[A-Za-z0-9._@~+-][A-Za-z0-9._@~+/-]*\.css|https:\/\/\S+)$/)).optional(),appStylesheets:record(string(),string().regex(/^app-[a-z0-9]+\.css$/)).optional(),frozenScreens:record(string(),record(string(),string().regex(/^frozen\/[a-z0-9]+\.json$/))).optional(),screenshots:object({cover:string(),screens:record(string(),string()),boards:record(string(),string())}).optional()}),FrozenScreenSchema=strictObject({head:array(strictObject({tag:_enum(["style","link"]),attributes:record(string(),string()),css:string().optional(),file:string().regex(/^(?:snapshot|app-[a-z0-9]+|frozen\/[a-z0-9]+)\.css$/).optional()})),body:string(),htmlAttributes:record(string(),string()),bodyAttributes:record(string(),string())});function frozenVariantKey(themeName,scheme){return`${themeName}/${scheme}`}import{homedir}from"os";import{delimiter,dirname,resolve}from"path";function designGitEnv(folder){let ceilings=[homedir()];if(managedDesignId(folder)||localDesignOf(folder))ceilings.push(dirname(resolve(folder)));let inherited=process.env.GIT_CEILING_DIRECTORIES;if(inherited)ceilings.push(inherited);return{...process.env,GIT_CEILING_DIRECTORIES:ceilings.join(delimiter)}}var MAX_SCREENSHOT_BYTES=4194304,MAX_SCREENSHOT_COUNT=120,DOWNSCALE_WIDTH=1280;function isBrowserMissing(err){return err instanceof Error&&err.name==="BrowserMissingError"}async function captureBundleScreenshots(opts){let{screens,boards,viewport,renderHtml,capture,warn,progress}=opts,selectedScreens=opts.screenIds?screens.filter((screen)=>opts.screenIds?.has(screen.id)):screens,selectedBoards=opts.boardIds?boards.filter((board)=>opts.boardIds?.has(board.id)):boards,manifest={cover:"",screens:{},boards:{}},total=selectedScreens.length+selectedBoards.filter((board)=>board.frames.length>0).length,done=0,advance=()=>{done+=1,progress?.(done,total)},shoot=async(html,vp,fullPage,screen)=>{let of=screen?{screen}:{},png=await capture({html,viewport:vp,fullPage,deviceScaleFactor:1,...of});if(png.byteLength>MAX_SCREENSHOT_BYTES&&DOWNSCALE_WIDTH<vp.w)png=await capture({html,viewport:vp,fullPage,deviceScaleFactor:DOWNSCALE_WIDTH/vp.w,...of});return png.byteLength<=MAX_SCREENSHOT_BYTES?png:null},jobs=[];for(let screen of selectedScreens)jobs.push({run:async()=>{try{let png=await shoot(await renderHtml(screen),viewport,!0,screen);if(!png)return warn(`screenshot of screen "${screen.id}" exceeds 4MB even downscaled \u2014 skipped`),null;return{kind:"screen",id:screen.id,path:`screenshots/${screen.id}.png`,bytes:png}}catch(err){if(isBrowserMissing(err))throw err;return warn(`screenshot of screen "${screen.id}" failed \u2014 skipped (${message(err)})`),null}finally{advance()}}});let screenById=new Map(screens.map((screen)=>[screen.id,screen]));for(let board of selectedBoards){if(board.frames.length===0)continue;jobs.push({run:async()=>{try{let framed=(await Promise.all(board.frames.map(async(frame)=>{let screen=screenById.get(frame.screen);return screen?{frame,html:await renderHtml(screen,board.theme,frame.scheme??"light")}:null}))).filter((entry)=>entry!==null);if(framed.length===0)return null;let composite=buildBoardComposite(framed),png=await shoot(composite.html,composite.viewport,!1);if(!png)return warn(`screenshot of board "${board.id}" exceeds 4MB even downscaled \u2014 skipped`),null;return{kind:"board",id:board.id,path:`screenshots/${board.id}.png`,bytes:png}}catch(err){if(isBrowserMissing(err))throw err;return warn(`screenshot of board "${board.id}" failed \u2014 skipped (${message(err)})`),null}finally{advance()}}})}let shotLimit=MAX_SCREENSHOT_COUNT-1,results=Array.from({length:jobs.length},()=>null),nextJob=0,completedShots=0,reservedShots=0,browserMissing=!1,worker=async()=>{while(!browserMissing&&nextJob<jobs.length&&completedShots+reservedShots<shotLimit){let index=nextJob++;reservedShots+=1;try{let shot=await jobs[index]?.run();if(shot)results[index]=shot,completedShots+=1}catch(err){if(isBrowserMissing(err))browserMissing=!0;else throw err}finally{reservedShots-=1}}},concurrency=Math.max(1,Math.min(MAX_CONCURRENT_RENDERS,Math.floor(opts.concurrency??MAX_CONCURRENT_RENDERS)));if(await Promise.all(Array.from({length:Math.min(concurrency,jobs.length)},worker)),browserMissing)return warn("no headless browser available \u2014 publishing without screenshots"),null;if(nextJob<jobs.length)warn(`screenshot limit (${MAX_SCREENSHOT_COUNT}) reached \u2014 remaining shots skipped`);let files=[];for(let shot of results){if(!shot)continue;if(files.push({path:shot.path,bytes:shot.bytes}),shot.kind==="screen")manifest.screens[shot.id]=shot.path;else manifest.boards[shot.id]=shot.path}let coverSource=selectedBoards.map((b)=>manifest.boards[b.id]).find((p)=>p!==void 0)??selectedScreens.map((s)=>manifest.screens[s.id]).find((p)=>p!==void 0);if(!coverSource)return null;let source=files.find((f)=>f.path===coverSource);if(!source)return null;return manifest.cover="screenshots/cover.png",files.push({path:manifest.cover,bytes:source.bytes}),{manifest,files}}function message(err){let msg=err instanceof Error?err.message:String(err);return msg.split(`
|
|
3
|
+
`)[0]??msg}var normalizedBoardIds=(boardIds)=>[...new Set(boardIds)].sort();function publishSlotMismatches(slot,current){let mismatches=[];if(!slot.context.contextKnown)mismatches.push("older publish has no board-selection context");if(!(current.candidateTeamIds?slot.teamId!==null&¤t.candidateTeamIds.includes(slot.teamId):slot.teamId===current.teamId))mismatches.push("team differs");if(JSON.stringify(normalizedBoardIds(slot.context.boardIds))!==JSON.stringify(normalizedBoardIds(current.boardIds)))mismatches.push("board selection differs");if(slot.context.repo!==current.repo)mismatches.push("repository differs");else if(current.repo!==null){if(!slot.context.branch||!current.branch)mismatches.push("branch is unavailable");else if(slot.context.branch!==current.branch)mismatches.push("branch differs")}return mismatches}function recommendedPublishSlot(slots,current){return exactPublishSlots(slots,current)[0]??null}function exactPublishSlots(slots,current){return slots.filter((slot)=>publishSlotMismatches(slot,current).length===0).sort((left,right)=>publishedAt(right.lastPublishedAt)-publishedAt(left.lastPublishedAt))}var publishedAt=(value)=>{let parsed=value?Date.parse(value):Number.NaN;return Number.isFinite(parsed)?parsed:Number.NEGATIVE_INFINITY},PUBLISH_VIEWPORT={w:1440,h:900};function defaultPublishTitle(folderRoot){return`${recordedDesignName(folderRoot)??folderRoot.split("/").filter(Boolean).pop()} designs`}async function ensureFolderId(folder,existing,report){if(existing)return existing;let path=join(folder,".design","config.json"),raw=JSON.parse(await readFile(path,"utf8")),folderId=crypto.randomUUID();return await writeJsonAtomic(path,{...raw,folderId}),report({kind:"note",message:"assigned this folder a cloud id (.design/config.json folderId) \u2014 commit it so every clone finds the folder's share links."}),folderId}function reportProvenance(git,report){if(git.repo){report({kind:"info",message:git.branch?`source: ${git.repo} on ${git.branch}`:`source: ${git.repo} (detached HEAD \u2014 no branch recorded)`});return}report({kind:"info",message:git.branch?`source: branch ${git.branch} \u2014 no git remote, publishing without a repository`:"source: not a git repository \u2014 publishing without repository or branch"})}function gitProbe(folder){return{encoding:"utf8",stdio:["ignore","pipe","ignore"],env:designGitEnv(folder)}}function gitCommitSha(folder){try{let probe=gitProbe(folder);if(execFileSync("git",["-C",folder,"status","--porcelain"],probe).trim().length>0)return null;return execFileSync("git",["-C",folder,"rev-parse","HEAD"],probe).trim()}catch{return null}}function normalizeRemote(url){let rest=url.trim().replace(/\.git\/?$/,"");if(/^[./~]/.test(rest)||/^[a-z]:[\\/]/i.test(rest)||rest.startsWith("file://"))return null;let scp=/^(?:[\w.-]+@)?([\w.-]+):(?!\/\/)(.+)$/.exec(rest);if(scp?.[1]&&scp[2])return`${scp[1]}/${scp[2].replace(/^\/+/,"")}`;try{let parsed=new URL(rest.includes("://")?rest:`https://${rest}`);if(!parsed.hostname||!parsed.pathname||parsed.pathname==="/")return null;return`${parsed.hostname}${parsed.pathname.replace(/\/+$/,"")}`}catch{return null}}function gitContext(folder){let probe=gitProbe(folder),run=(args)=>{try{return execFileSync("git",["-C",folder,...args],probe).trim()||null}catch{return null}},branchRaw=run(["rev-parse","--abbrev-ref","HEAD"]),remote=run(["remote","get-url","origin"]);return{repo:remote?normalizeRemote(remote):null,branch:branchRaw==="HEAD"?null:branchRaw}}function publishableTeams(teams){return teams.filter((team)=>team.canPublish!==!1)}function resolvePublishTeam(teams,requested){if(teams.length===0)return requested?err(teamNotFound(requested)):ok({kind:"personal"});let reviewer=teams.some((team)=>team.role==="reviewer"),publishable=publishableTeams(teams);if(requested){let named=(candidates)=>candidates.filter((team)=>team.id===requested||team.name.toLowerCase()===requested.toLowerCase()),exact=named(publishable);if(exact.length>1)return err(teamAmbiguous(requested));let[team]=exact;if(team)return ok({kind:"team",team});return err(named(teams).length>0?teamNotPublishable(requested,reviewer):publishable.length===0?noPublishableTeam(reviewer):teamNotFound(requested))}let[only,...rest]=publishable;if(!only)return err(noPublishableTeam(reviewer));return rest.length===0?ok({kind:"team",team:only}):ok({kind:"choose",teams:publishable})}async function listTeams(baseUrl,token){let body=await cloudFetch(`${baseUrl}/v1/teams/mine`,TeamsResponseSchema,{operation:"listing teams",token});return body.ok?ok(body.value.teams):body}function selectBoards(design,boardIds){if(!boardIds||boardIds.length===0)return activeBoards(design).map(([,board])=>board);let wanted=new Set(boardIds);return orderedBoards(design).map(([,board])=>board).filter((board)=>wanted.has(board.id))}var SNAPSHOT_CSS_PATH="snapshot.css",SHARED_CSS_MIN_LENGTH=2048;function frozenVariantsOf(screen,design,boards){let themes=new Map,see=(themeName,pinnedDark)=>{let theme=(themeName?design.themes.get(themeName):void 0)??design.theme,seen=themes.get(theme.name);themes.set(theme.name,{themeName:seen?seen.themeName:themeName,theme,dark:Boolean(seen?.dark)||pinnedDark||Boolean(theme.colorsDark)})};see(void 0,!1);for(let board of boards)for(let frame of board.frames)if(frame.screen===screen.id)see(board.theme,frame.scheme==="dark");return[...themes.values()].flatMap(({themeName,theme,dark})=>(dark?["light","dark"]:["light"]).map((scheme)=>({key:`${screen.id}\x00${theme.name}\x00${scheme}`,screen,themeName,theme,scheme})))}async function publishDesign(cloud,pipeline,request,report=()=>{}){let{folder:design}=pipeline,{root,config}=design;report({kind:"step",step:"check",message:"checking the cloud"});let health=await checkCloudHealth(cloud.baseUrl);if(health.status==="unreachable")return err(unreachable(health.reason,{url:cloud.baseUrl}));if(health.status==="unhealthy")return err(cloudUnhealthy(health.detail));if(design.screens.size===0)return err(noScreens(root));report({kind:"step",step:"select",message:"collecting boards"});let boards=selectBoards(design,request.boardIds),screenIds=Boolean(request.boardIds&&request.boardIds.length>0)?new Set(boards.flatMap((b)=>b.frames.map((f)=>f.screen))):null,screens=screenIds?[...design.screens.values()].filter((s)=>screenIds.has(s.id)):[...design.screens.values()];if(screens.length===0){let placed=new Set([...design.boards.values()].flatMap((board)=>board.frames.map((frame)=>frame.screen)));return err(noBoardScreens([...design.screens.keys()].filter((id)=>!placed.has(id))))}let viewport=request.viewport??PUBLISH_VIEWPORT,title=request.title?.trim()||defaultPublishTitle(root),form=new FormData,bundleFiles=0,bundleBytes=0,addFile=(path,data,type)=>{if(typeof data==="string"?data.length===0:data.byteLength===0)return report({kind:"warn",message:`skipped empty file: ${path}`}),!1;return form.append("file",new File([data],path,type?{type}:void 0)),bundleFiles+=1,bundleBytes+=typeof data==="string"?new TextEncoder().encode(data).byteLength:data.byteLength,!0},bundler=pipeline.liveBundler??createOneShotLiveBundler(root,config);report({kind:"step",step:"styles",message:"compiling styles"});let snapshotCss=await pipeline.snapshotCss(),live=!1,liveCode=null;if(bundler){report({kind:"step",step:"bundle",message:"bundling live components"});let bundle=await buildLiveModule(bundler);for(let message of bundle.warnings)report({kind:"warn",message});if(bundle.code!==null&&addFile("bundle.js",bundle.code,"text/javascript"))liveCode=bundle.code,live=!0}report({kind:"step",step:"capture",message:"capturing previews"});let mount=createCaptureMount(pipeline.folder,pipeline.providers,pipeline.defaultProvider),appCss=new Map,appStylesheets={},assetBearing=[],shipped=new Set,sharedCss=new Map;if(snapshotCss)sharedCss.set(snapshotCss,SNAPSHOT_CSS_PATH);let addOnce=(path,data,type)=>{if(shipped.has(path))return;shipped.add(path),addFile(path,data,type)};for(let screen of screens){let css=await mount.appCss(screen).catch(()=>"");if(css.trim()==="")continue;appCss.set(screen.id,css);let path=`app-${Bun.hash(css).toString(36)}.css`;addOnce(path,css,"text/css"),appStylesheets[screen.id]=path,sharedCss.set(css,path),assetBearing.push(css)}let frozenFiles=new Map,frozenAt=new Map,freezeAttempted=new Set,notFrozen=new Set,browserMissing=!1,nameOf=(screen)=>screen.name||screen.id,shareStyle=(style)=>{let{tag,attributes,css}=style;if(css===void 0)return{tag,attributes};if(css.length<SHARED_CSS_MIN_LENGTH)return{tag,attributes,css};let file=sharedCss.get(css);if(!file)file=`frozen/${Bun.hash(css).toString(36)}.css`,frozenFiles.set(file,css),sharedCss.set(css,file);return{tag,attributes,file}},keepFrozen=(variant,page)=>{if(freezeAttempted.add(variant.key),!page?.mounted){notFrozen.add(nameOf(variant.screen));return}let frozen={head:page.head.map(shareStyle),body:page.body,htmlAttributes:page.htmlAttributes,bodyAttributes:page.bodyAttributes},json=JSON.stringify(frozen),path=`frozen/${Bun.hash(json).toString(36)}.json`;frozenFiles.set(path,json);let variants=frozenAt.get(variant.screen.id)??new Map;variants.set(frozenVariantKey(variant.theme.name,variant.scheme),path),frozenAt.set(variant.screen.id,variants)},shots=await withAssetServer(root,liveCode,async(baseHref)=>{let htmlCache=new Map,renderHtml=async(screen,themeName,scheme="light")=>{let theme=(themeName?design.themes.get(themeName):void 0)??design.theme,key=`${screen.id}\x00${theme.name}\x00${scheme}`,cached=htmlCache.get(key);if(cached)return cached;let canvasBundle=await mount.forScreen(screen,theme,scheme==="dark"),rendering=renderScreen(screen,theme,{viewport,snapshotCss,registry:registryForScreen(screen,pipeline.providers,pipeline.defaultProvider,config.extensions??{},config.styling?.framework),renderPass:renderPassForScreen(screen,pipeline.providers,pipeline.defaultProvider,theme),snippets:design.snippets,customCss:design.customCss,appCss:appCss.get(screen.id),dark:scheme==="dark",baseHref,includeRuntime:!1,...live?{liveBundleUrl:LIVE_BUNDLE_PATH}:{},...canvasBundle?{canvasBundle}:{},hostStylesheets:hostStylesheetsForScreen(screen,pipeline.providers,pipeline.defaultProvider,config.hostApp)}).then(({html})=>html);return htmlCache.set(key,rendering),rendering},variants=[];for(let screen of screens){if(await mount.forScreen(screen,design.theme,!1)===void 0)continue;variants.push(...frozenVariantsOf(screen,design,boards))}let previewed=(screen)=>request.screenshotSelection?.screenIds.has(screen.id)??!0,withPreview=new Map;for(let variant of variants)if(variant.themeName===void 0&&variant.scheme==="light"&&previewed(variant.screen))withPreview.set(variant.screen.id,variant);let freeze=async(variant)=>{try{keepFrozen(variant,await captureMountedDocument({html:await renderHtml(variant.screen,variant.themeName,variant.scheme),viewport}))}catch(error){if(error instanceof Error&&error.name==="BrowserMissingError")browserMissing=!0;freezeAttempted.add(variant.key),notFrozen.add(nameOf(variant.screen))}},ownLoads=Promise.all(variants.filter((variant)=>withPreview.get(variant.screen.id)!==variant).map(freeze)),shots=await captureBundleScreenshots({screens,boards,...request.screenshotSelection?{screenIds:request.screenshotSelection.screenIds,boardIds:request.screenshotSelection.boardIds}:{},viewport,renderHtml,capture:async(req)=>{let variant=req.screen?withPreview.get(req.screen.id):void 0,toFreeze=variant!==void 0&&!freezeAttempted.has(variant.key),shot=await captureScreenshot({html:req.html,viewport:req.viewport,fullPage:req.fullPage,deviceScaleFactor:req.deviceScaleFactor,...toFreeze?{freeze:!0}:{}});if(toFreeze)keepFrozen(variant,shot.frozen);return shot.png},warn:(message)=>report({kind:"warn",message}),progress:(done,total)=>report({kind:"capture",done,total})});return await ownLoads,await Promise.all(variants.filter((variant)=>!freezeAttempted.has(variant.key)).map(freeze)),shots},{bundle:mount.serve,host:hostFilesFetch(()=>root)});for(let path of[...frozenFiles.keys()].sort()){let text=frozenFiles.get(path)??"";addFile(path,text,path.endsWith(".css")?"text/css":"application/json"),assetBearing.push(text)}let frozenScreens={};for(let screen of screens){let at=frozenAt.get(screen.id);if(at)frozenScreens[screen.id]=Object.fromEntries([...at].sort(([a],[b])=>a<b?-1:1))}for(let f of shots?.files??[])addFile(f.path,f.bytes,"image/png");if(notFrozen.size>0)report({kind:"warn",message:`the share will not match the canvas for ${[...notFrozen].sort().join(", ")}: the canvas draws ${notFrozen.size===1?"it":"them"} with the app's own components, which could not be mounted here, so a viewer sees velloo's stand-ins instead. ${browserMissing?"Run `velloo browser install` and publish again.":"component_status says what stopped them mounting."}`});let host=Object.values(pipeline.providers).some((provider)=>provider.hostStylesheets)?await shipHostFiles({source:storedHostSource(root),stylesheets:config.hostApp?.stylesheets??[],screens,snippets:[...design.snippets.values()],warn:(message)=>report({kind:"warn",message}),designAsset:(path)=>existsSync(join(root,path))}):{screens,snippets:[...design.snippets.values()],files:[],stylesheets:[]};for(let f of host.files)addFile(f.path,f.bytes,f.type);let annotations=Object.fromEntries([...design.annotations].filter(([screenId,list])=>list.length>0&&screens.some((s)=>s.id===screenId))),notes=Object.fromEntries([...design.notes].filter(([boardId,list])=>list.length>0&&boards.some((b)=>b.id===boardId))),designDoc={formatVersion:DESIGN_BUNDLE_FORMAT,title,viewport,defaultLibrary:config.defaultLibrary,libraries:config.libraries,extensions:config.extensions??{},...config.styling?{styling:config.styling}:{},viewportPresets:config.viewportPresets??[],theme:design.theme,themes:Object.fromEntries(design.themes),customCss:design.customCss,snippets:host.snippets,screens:host.screens,boards,annotations,notes,live,snapshotCssPath:SNAPSHOT_CSS_PATH,...live?{bundlePath:"bundle.js"}:{},...host.stylesheets.length>0?{hostStylesheets:host.stylesheets}:{},...Object.keys(appStylesheets).length>0?{appStylesheets}:{},...Object.keys(frozenScreens).length>0?{frozenScreens}:{},...shots?{screenshots:shots.manifest}:{}},validated=DesignBundleSchema.safeParse(designDoc);if(!validated.success)return err(bundleInvalid(prettifyError(validated.error)));addFile("design.json",JSON.stringify(designDoc),"application/json"),addFile(SNAPSHOT_CSS_PATH,snapshotCss||`/* this folder uses no CSS framework */
|
|
4
|
+
`,"text/css");let assetRefs=new Set,assetRe=/\/assets\/[A-Za-z0-9._@\-/]+/g;for(let source of[...host.screens,...host.snippets])for(let m of JSON.stringify(source).matchAll(assetRe))assetRefs.add(m[0]);for(let text of[design.customCss,...assetBearing])for(let m of text.matchAll(assetRe))assetRefs.add(m[0]);for(let ref of assetRefs){if(ref.startsWith("/assets/host/"))continue;let rel=ref.replace(/^\//,"");try{let bytes=await readFile(join(root,rel));addFile(rel,/\.svg$/i.test(rel)?Buffer.from(sanitizeSvgMarkup(bytes.toString("utf8")),"utf8"):bytes)}catch{report({kind:"warn",message:`asset not found: ${rel}`})}}let commitSha=gitCommitSha(root);if(commitSha)form.append("commitSha",commitSha);let git=request.provenance??gitContext(root);if(reportProvenance(git,report),git.repo)form.append("gitRepo",git.repo);if(git.branch)form.append("gitBranch",git.branch);let folderId=await ensureFolderId(root,config.folderId,report);report({kind:"step",step:"upload",message:`uploading ${bundleFiles} file${bundleFiles===1?"":"s"} (${formatBytes(bundleBytes)})`});let uploaded=await uploadLinkBundle({baseUrl:cloud.baseUrl,token:cloud.token,link:{...request.destination.slug?{slug:request.destination.slug}:{},folderId,publishMode:request.destination.mode,...request.destination.mode==="update"?{expectedVersionId:request.destination.expectedVersionId}:{},title,visibility:request.visibility,...request.teamId?{teamId:request.teamId}:{},...request.audience?.length?{audience:request.audience}:{},...request.publicComments!==void 0?{publicComments:request.publicComments}:{},...request.password?{password:request.password}:{},...request.passwordExpiresAt?{passwordExpiresAt:request.passwordExpiresAt}:{}},form});if(!uploaded.ok)return uploaded;let upload=uploaded.value;return ok({shareUrl:upload.shareUrl,slug:upload.link.slug,visibility:upload.link.visibility,passwordProtected:upload.link.passwordProtected,...upload.link.audience!==void 0?{audience:upload.link.audience}:{},...upload.link.publicComments!==void 0?{publicComments:upload.link.publicComments}:{},files:upload.files,bytes:upload.bytes,screenshots:shots?.files.length??0,boards:boards.length,screens:screens.length,commitSha,created:upload.created,...upload.tier!==void 0?{tier:upload.tier}:{},...upload.history!==void 0?{history:upload.history}:{}})}function formatBytes(bytes){if(bytes>=1048576)return`${(bytes/1048576).toFixed(1)} MB`;if(bytes>=1024)return`${Math.round(bytes/1024)} KB`;return`${bytes} B`}function publishedDesignSubtitle(design){let published=design.lastPublishedAt?`Published ${design.lastPublishedAt}`:"Publish time unavailable",who=design.ownerEmail?.trim()||design.ownerName?.trim(),publisher=who?`by ${who}`:"publisher unavailable",repo=design.git?.repo?.trim(),branch=design.git?.branch?.trim(),source=repo?`repo ${repo}${branch?` (${branch})`:""}`:"repository unavailable";return`${published} \xB7 ${publisher} \xB7 ${source}`}async function listPublishedDesigns(opts){let body=await cloudFetch(`${opts.baseUrl}/v1/links`,PublishedDesignsResponseSchema,{operation:"listing published designs",token:opts.token});if(!body.ok)return body;return ok((body.value.links??[]).filter((link)=>link.published).map((link)=>({...link,url:link.url.startsWith("http")?link.url:`${opts.baseUrl}${link.url}`})))}async function unpublishDesign(opts){let res=await fetch(`${opts.baseUrl}/v1/links/${encodeURIComponent(opts.slug)}`,{method:"DELETE",headers:{authorization:`Bearer ${opts.token}`}}).catch((error)=>error);if(!(res instanceof Response))return err(unreachable(res,{url:opts.baseUrl}));if(!res.ok)return err(await httpFailureFrom("unpublishing the design",res));return ok(void 0)}
|
|
5
|
+
export{publishedDesignSubtitle,listPublishedDesigns,unpublishDesign,listPublishDestinations,designGitEnv,teamChoiceRequired,describePublishError,recommendedPublishSlot,exactPublishSlots,PUBLISH_VIEWPORT,gitContext,publishableTeams,resolvePublishTeam,listTeams,publishDesign};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{upgrade_default,migrateFolder2}from"./chunk-mqx96m2g.js";import"./chunk-07fxzrx2.js";import"./chunk-pjtg3wnm.js";import"./chunk-ez720ked.js";import"./chunk-qgbat4fv.js";import"./chunk-6w42sr61.js";import"./chunk-80fjfyha.js";import"./chunk-9g45c5md.js";import"./chunk-xg49s85z.js";import"./chunk-w30zfv3m.js";import"./chunk-bntsn3wj.js";import"./chunk-d19ttv1a.js";import"./chunk-rrrn1mkq.js";import"./chunk-s23gtejf.js";import"./chunk-xxw67jpk.js";export{upgrade_default as default,migrateFolder2 as migrateFolder};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{isCancel,select}from"./chunk-80fjfyha.js";import{chromiumExecutable,closePooledBrowser}from"./chunk-xg49s85z.js";import"./chunk-xxw67jpk.js";import{writeText,findFrame,exportFilename,exportFramePng,exportBoardPng,exportFramePdf,exportBoardPdf,exportScreenHtml,exportScreenPng,exportScreenPdf,exportFrameHtml,exportBoardHtml,hostFilesFetch,screensForExportTarget}from"./chunk-9g45c5md.js";import"./chunk-bntsn3wj.js";import{fail}from"./chunk-s23gtejf.js";import{captureWithBrowserSetup}from"./chunk-dy7qwj3t.js";import{confirmRenderFailures}from"./chunk-qqagacne.js";import{LIVE_BUNDLE_PATH,withAssetServer,loadPipeline}from"./chunk-hsk91jms.js";import{DESIGN_ARG_DESCRIPTION,resolveDesign}from"./chunk-6w42sr61.js";import{defineCommand}from"./chunk-2smsg2ct.js";import{extname,isAbsolute,resolve}from"path";var export_default=defineCommand({meta:{name:"export",description:"Export a screen, frame, or board as PNG, PDF, or standalone HTML (format = --to extension)"},args:{target:{type:"positional",required:!1,description:"Screen, frame, or board id. Omit to pick interactively."},design:{type:"string",description:DESIGN_ARG_DESCRIPTION},to:{type:"string",description:"Output path; extension picks the format (.png | .pdf | .html). Default: ./<target>.png"},mode:{type:"string",description:"light (default) | dark | compare (side-by-side light|dark; PNG, non-board only)"},scale:{type:"string",description:"PNG raster density (0.25\u20133; default 1; 2 = retina)"},theme:{type:"string",description:"Named theme to render with (default: the board's pin, else the folder default)"},w:{type:"string",description:"Viewport width for screen targets (default: first preset)"},h:{type:"string",description:"Viewport height for screen targets (default: first preset)"},yes:{type:"boolean",description:"Export even when a component fails to render (required without an interactive terminal)"}},async run({args}){let folder=await resolveDesign(args.design,"export",{designFlag:"--design"}),pipeline=await loadPipeline(folder),design=pipeline.design,mode=args.mode??"light";if(!["light","dark","compare"].includes(mode))fail("export",`--mode must be light, dark, or compare \u2014 got '${args.mode}'`);let scale=args.scale?Number(args.scale):1;if(!Number.isFinite(scale)||scale<0.25||scale>3)fail("export",`--scale must be between 0.25 and 3 \u2014 got '${args.scale}'`);let targetId=args.target;if(!targetId){let options=[...[...design.boards.values()].map((b)=>({value:b.id,label:b.name,hint:`board \xB7 ${b.frames.length} frame${b.frames.length===1?"":"s"}`})),...[...design.screens.values()].map((s)=>({value:s.id,label:s.name||s.id,hint:"screen"}))];if(options.length===0)fail("export",`nothing to export in ${folder}.`);if(!process.stdin.isTTY)fail("export",`pass a target: ${options.map((o)=>o.value).join(", ")} (boards and screens; frame ids work too)`);let chosen=await select({message:"Export what?",options});if(isCancel(chosen))fail("export","cancelled.");targetId=chosen}let screen=design.screens.get(targetId),framed=screen?null:findFrame(design,targetId),board=screen||framed?null:design.boards.get(targetId),kind=screen?"screen":framed?"frame":board?"board":null;if(!kind)fail("export",`no screen, frame, or board with id "${targetId}" in ${folder}. Boards: ${[...design.boards.keys()].join(", ")||"(none)"}; screens: ${[...design.screens.keys()].join(", ")||"(none)"}.`);let name=screen?.name||framed?.frame.label||(framed?design.screens.get(framed.frame.screen)?.name:void 0)||board?.name||targetId,outPath=args.to?isAbsolute(args.to)?args.to:resolve(args.to):resolve(exportFilename(name,"png")),ext=extname(outPath).toLowerCase().slice(1);if(ext!=="png"&&ext!=="pdf"&&ext!=="html")fail("export",`unsupported output extension ".${ext}" \u2014 use .png, .pdf, or .html.`);let format=ext;if(mode==="compare"&&(format!=="png"||kind==="board"))fail("export",'mode "compare" is PNG-only and not available for boards.');let preset=design.config.viewportPresets[0]??{name:"default",w:1440,h:900},viewport={w:args.w?Number(args.w):preset.w,h:args.h?Number(args.h):preset.h};await confirmRenderFailures("export",{folder:design,providers:pipeline.providers,defaultProvider:pipeline.defaultProvider},screensForExportTarget(design,kind,targetId),args.yes===!0);let opts={mode,scale,...args.theme?{theme:args.theme}:{}},assetOrigin,live=format==="html"?null:await pipeline.liveModule(),notes=[],p={folder:design,providers:pipeline.providers,defaultProvider:pipeline.defaultProvider,snapshotCss:async()=>pipeline.snapshotCss,assetOrigin:()=>assetOrigin,canvasBundleFor:pipeline.capture.forScreen,appCss:pipeline.capture.appCss,mountProblems:pipeline.capture.problems,warn:(message)=>{if(!notes.includes(message))notes.push(message)},liveBundleUrl:()=>live?.code?LIVE_BUNDLE_PATH:void 0},produce=async()=>{if(kind==="screen"&&screen){if(format==="html"){let out=await exportScreenHtml(p,screen,{dark:mode==="dark",...args.theme?{theme:args.theme}:{},viewport});return{bytes:out.html,warnings:out.warnings}}if(format==="pdf")return{bytes:await exportScreenPdf(p,screen,{...opts,viewport}),warnings:[]};return{bytes:await exportScreenPng(p,screen,{...opts,viewport}),warnings:[]}}if(kind==="frame"&&framed){if(format==="html"){let out=await exportFrameHtml(p,framed.board,framed.frame,opts);return{bytes:out.html,warnings:out.warnings}}return{bytes:format==="pdf"?await exportFramePdf(p,framed.board,framed.frame,opts):await exportFramePng(p,framed.board,framed.frame,opts),warnings:[]}}if(!board)fail("export","internal: target resolution failed");if(format==="html"){let out=await exportBoardHtml(p,board,opts);return{bytes:out.html,warnings:out.warnings}}return{bytes:format==="pdf"?await exportBoardPdf(p,board,opts):await exportBoardPng(p,board,opts),warnings:[]}},result;try{if(format==="html"&&await chromiumExecutable()===null)result=await produce();else if(format==="html")await withAssetServer(folder,null,async(baseHref)=>{assetOrigin=baseHref,result=await produce()},{bundle:pipeline.capture.serve,host:hostFilesFetch(()=>folder)});else await withAssetServer(folder,live?.code??null,async(baseHref)=>{assetOrigin=baseHref,await captureWithBrowserSetup("export",async()=>{result=await produce()})},{bundle:pipeline.capture.serve,host:hostFilesFetch(()=>folder)})}finally{await closePooledBrowser()}if(!result)fail("export","capture produced no output");if(typeof result.bytes==="string")await writeText(outPath,result.bytes);else await Bun.write(outPath,result.bytes);console.log(`velloo export: wrote ${outPath} (${kind}=${targetId}, mode=${mode})`);for(let warning of[...live?.warnings??[],...notes,...result.warnings])console.log(` note: ${warning}`)}});export{export_default as default};
|