@hy-bricks/core 0.4.0 → 0.4.2

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/CHANGELOG.md ADDED
@@ -0,0 +1,143 @@
1
+ # @hy-bricks/core
2
+
3
+ ## [0.4.2] - 2026-05-28 · devtools 强化(配套升级)
4
+
5
+ 跟 `@hy-bricks/devtools` 0.4.2 同步。core 本次新增 SDK 内部 hook 给 devtools 消费,
6
+ 业务侧 0 改动获益。**零 BREAKING**,从 0.4.x 任意版本直接升 0.4.2 安全。
7
+
8
+ ### ✨ 新特性(business 侧可见的部分)
9
+
10
+ - 组件 `mounted` 钩子内的同步耗时现在可被 devtools 渲染 Tab 统计(`mountMs`)
11
+ - 组件 setup / mounted / render 异常现在能在 devtools 浮窗看到(ErrorBoundary 内部 emit;
12
+ 降级卡 + 重试按钮行为完全不变,**吞错语义保留**)
13
+ - `__HYPERCARD__.canvases.{callComponent / emitToCanvas / broadcast}` 等跨实例 API
14
+ 的调用现在可被 devtools Events Tab 实时观察(默认 off,devtools 启动时打开总闸)
15
+
16
+ ### 内部新增(devtools 消费)
17
+
18
+ `@hy-bricks/core` 新导出几组 API,**业务侧不应直接调**(给 devtools / 第三方诊断工具用):
19
+
20
+ - `subscribeCanvasInventory` — canvas 维度生命周期事件
21
+ - `patchInstanceTimings` / `getInstanceTimings` / `InstanceTimings` — 实例 timing buffer
22
+ - `runtimeErrorEmitter` — 运行时错误流
23
+ - `enableDiagnosticsEvents` / `disableDiagnosticsEvents` / `interactionEmitter` —
24
+ 交互事件流总闸(ref-count)
25
+
26
+ 详见 [根 CHANGELOG.md](../../CHANGELOG.md) §0.4.2。
27
+
28
+ ### 业务侧升级
29
+
30
+ ```bash
31
+ pnpm up @hy-bricks/core@0.4.2
32
+ ```
33
+
34
+ 零代码改动。
35
+
36
+ ---
37
+
38
+ ## [0.4.1] - 2026-05-27
39
+
40
+ 文档补完 — 0.4.0 的发版说明现在 npm 包页面可见。代码无变更。
41
+ 从 0.4.0 升上来可跳过。
42
+
43
+ ---
44
+
45
+ ## [0.4.0] - 2026-05-27 · 组件 mounted 里立即可订阅
46
+
47
+ ### ✨ 新特性
48
+
49
+ 组件作者可在 `mounted` 里**直接调** `__HYPERCARD__.runtime.on(this.hcInstanceId, ...)` 立即生效,不再需要 nextTick / microtask 等一拍。
50
+
51
+ 每个组件实例可读 3 个 SDK 注入 prop:
52
+
53
+ | Prop | 含义 |
54
+ |---|---|
55
+ | `this.hcInstanceId` | 实例 ID |
56
+ | `this.hcCanvasId` | 所属画布 ID |
57
+ | `this.hcComponentId` | 组件源 ID |
58
+
59
+ ```js
60
+ // 组件源码 component.js
61
+ export default {
62
+ mounted() {
63
+ console.log('我是谁', this.hcInstanceId, this.hcCanvasId)
64
+
65
+ // ✅ 立即订阅,不再要等
66
+ __HYPERCARD__.runtime.on(this.hcInstanceId, 'click', (payload) => {
67
+ // ...
68
+ })
69
+
70
+ // ✅ 立即拿到 handle
71
+ const handle = __HYPERCARD__.canvases
72
+ .get(this.hcCanvasId)
73
+ ?.getInstance(this.hcInstanceId)
74
+ },
75
+ }
76
+ ```
77
+
78
+ ### ⚠ BREAKING — host 升级前 audit
79
+
80
+ `onInstanceLifecycle('instance:ready')` / `handle.on('instance:ready')` 回调被调时,**子组件 DOM 还没渲染**,`vm.$el` 是 `null`。
81
+
82
+ **修法**(回调内访问 DOM 的话):
83
+
84
+ ```js
85
+ // ❌ 不能直接访问 $el
86
+ onInstanceLifecycle('instance:ready', ({ instance }) => {
87
+ instance.$el.querySelector(...) // null,报错
88
+ })
89
+
90
+ // ✅ 等下一帧 DOM 渲染完
91
+ onInstanceLifecycle('instance:ready', ({ instance }) => {
92
+ nextTick(() => {
93
+ instance.$el.querySelector(...)
94
+ })
95
+ })
96
+ ```
97
+
98
+ ### 升级 checklist
99
+
100
+ ```bash
101
+ grep -rn "instance:ready\|onInstanceLifecycle\|getInstanceReady" src/
102
+ ```
103
+
104
+ 每处看回调内是否访问 `vm.$el` / DOM。
105
+ - 没访问 → `npm install @hy-bricks/{core,canvas,editor,devtools}@^0.4.0` 透明升
106
+ - 访问了 → 改 `nextTick`
107
+
108
+ ### 命名保留
109
+
110
+ 组件作者**不要**用这 3 个名字声明你自己的 prop(同名会被 SDK 注入覆盖):
111
+ `hcInstanceId` / `hcCanvasId` / `hcComponentId`。
112
+
113
+ 之前的保留 prop `hcCustomValues` 不变。
114
+
115
+ ---
116
+
117
+ ## 0.3.0
118
+
119
+ ### Minor Changes
120
+
121
+ - 0.3.0 渲染核心 · mount-ready 信号 + cache 精确读 API
122
+
123
+ **主题**:`RenderScheduler` 渐进 mount 下,SDK 第一次给出"组件挂好"信号(per-canvas 隔离的 event + Promise + cache 精确读 API)。host 替掉 `setTimeout(300)` / `mountConcurrency:50` / `replayFromCache` 全表遍历兜底。
124
+
125
+ **新 API**:
126
+ - `@hy-bricks/core`:`onInstanceLifecycle("instance:ready" | "instance:unmounted", cb)` — 模块级 lifecycle emitter,跨 canvas 共享,payload `{ canvasId, instanceId }`
127
+ - `@hy-bricks/canvas · CanvasHandle`:
128
+ - `handle.on("instance:ready" | "instance:unmounted", cb)` — per-canvas 自动过滤,payload 只透 `instanceId`
129
+ - `handle.getInstanceReady(instanceId): Promise<void>` — 已挂立即 resolved / 未挂等 emit / `handle.dispose()` 时 reject `HandleDisposedError`
130
+ - `handle.getInstanceRuntime(instanceId)` — 返**运行时 vm handle**(`ComponentInstanceHandle`),给 host 调 `setDataInput / call / emit` 用;跟 `getInstance(id)` 返 PageInstance snapshot 区分
131
+ - `handle.getCachedBySourceId(sourceId, params?)` — cache 精确读快照,plain object(不返 reactive)
132
+ - `HandleDisposedError` 具名 error class(host 可 `instanceof` 判)
133
+ - `handle.dispose()` 终态 guard:dispose 后所有入口 no-op / reject / null,防 listener 泄漏 + pending 永挂
134
+ - `@hy-bricks/canvas · HyperCardPageRendererExpose.data.getCachedBySourceId(sourceId, params?)` 同款
135
+
136
+ **边界**(摸底备忘 §1):SDK 只补"信号 + 暴露 API",**不**替 host 自动 push / replay / 重拉 — 数据治理仍归 host。D5.4 §R6 "cache 保留 + 不自动 replay,host 手动 invalidate" 合约**不变**。
137
+
138
+ **host 升级(不强制)**:
139
+ - 0.2.0 → 0.3.0 **不破坏现有代码**;不用 ready 信号当 0.3.0 没加
140
+ - 用了就简化:`handle.on("instance:ready", id => { const c = handle.getCachedBySourceId(src); if (c?.status === "success") handle.getInstanceRuntime(id)?.setDataInput?.(key, c.value) })`
141
+ - workaround(`replayFromCache` / `mountConcurrency:50` / 首屏 reload)**可保留**,SDK 不强制删
142
+
143
+ 详见 `docs/v1/frontend-sdk/20260523-1648-claude-渲染核心-挂载就绪信号-实施稿-rev1.md`。
package/README.md CHANGED
@@ -6,6 +6,10 @@
6
6
  [![license](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)
7
7
  [![vue](https://img.shields.io/badge/vue-%5E3.5-42b883)](https://vuejs.org/)
8
8
 
9
+ > ⚠️ **0.4.0 BREAKING** ── `onInstanceLifecycle('instance:ready')` 回调被调时,子组件 DOM 还没渲染。回调内访问 `vm.$el` 会拿 `null`,需改 `nextTick(() => vm.$el...)`。详 [CHANGELOG](./CHANGELOG.md)。
10
+ >
11
+ > ✨ **0.4.0 新特性** ── 组件作者可在 `mounted` 里直接调 `__HYPERCARD__.runtime.on(this.hcInstanceId, ...)` 立即订阅。新增 3 个实例 prop:`hcInstanceId` / `hcCanvasId` / `hcComponentId`。
12
+
9
13
  ---
10
14
 
11
15
  ## 30 秒 Hello World
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("./parseSourceEntry-UTE53-N3.cjs"),s=function(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const s in e)if("default"!==s){const r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:()=>e[s]})}return t.default=e,Object.freeze(t)}(e);function r(e){return{all:e=e||new Map,on:function(t,s){var r=e.get(t);r?r.push(s):e.set(t,[s])},off:function(t,s){var r=e.get(t);r&&(s?r.splice(r.indexOf(s)>>>0,1):e.set(t,[]))},emit:function(t,s){var r=e.get(t);r&&r.slice().map(function(e){e(s)}),(r=e.get("*"))&&r.slice().map(function(e){e(t,s)})}}}const n="__default__",o="__hcCanvasId",i=e.ref(0),a=r();function l(e,t){a.emit(e,t)}const c=new Set,u=new Map;function h(e,t,s,n){var o;const a=function(e,t){return`${e}\0${t}`}(e,t);if(c.has(a)){const s=`[hc-registry] re-entrant registerInCanvas("${e}", "${t}") detected — a lifecycle listener tried to register the same id while the outer register is in flight. Nested register blocked to prevent state divergence; defer your register via microtask / setTimeout if you need to re-mount on lifecycle events.`;throw console.warn(s),new Error(s)}c.add(a);try{const a=function(e){let t=u.get(e);return t||(t=new Map,u.set(e,t)),t}(e);a.has(t)&&(console.warn(`[hc-registry] instance ${t} already registered in canvas "${e}", overwriting`),null==(o=a.get(t))||o.__dispose(),a.delete(t),l("instance:unmounted",{canvasId:e,instanceId:t}));const c=function(e,t,s){const n=r();return{instanceId:e,componentId:t,vm:s,call(t,...r){const n=s[t];if("function"!=typeof n)throw new Error(`[hc-registry] method "${t}" not found on instance ${e}`);return n.apply(s,r)},on:(e,t)=>(n.on(e,t),()=>n.off(e,t)),emit(e,t){n.emit(e,t)},setProp(e,t){s[e]=t},setDataInput(t,r){const n=s.custom;if(!n||!(t in n))return void console.warn(`[hc-registry] setDataInput("${t}"): vm.custom["${t}"] not declared on instance ${e}; binding 改了一个未声明的 dataInput key,组件不会响应`);const o=n[t];o&&"object"==typeof o?!0===o.dataInput?o.value=r:console.warn(`[hc-registry] setDataInput("${t}"): vm.custom["${t}"] is not declared with dataInput:true on instance ${e}; 请在组件源码 custom.${t} 上加 \`dataInput: true\` 才能被 binding 灌入`):console.warn(`[hc-registry] setDataInput("${t}"): vm.custom["${t}"] not a {value:...} slot`)},__dispose(){n.all.clear()}}}(t,s,n);return a.set(t,c),i.value++,l("instance:ready",{canvasId:e,instanceId:t}),c}finally{c.delete(a)}}function p(e){const t=u.get(e);if(!t)return;const s=[];for(const[e,r]of t)r.__dispose(),s.push(e);t.clear(),u.delete(e),i.value++;for(const t of s)l("instance:unmounted",{canvasId:e,instanceId:t})}function f(){return[...u.keys()]}function d(e,t=n){const s=u.get(t);if(!s)return;const r=s.get(e);r&&(r.__dispose(),s.delete(e),i.value++,l("instance:unmounted",{canvasId:t,instanceId:e}))}function m(e,t){var s;if(void 0!==t)return(null==(s=u.get(t))?void 0:s.get(e))??null;let r=null;const n=[];for(const[t,s]of u){const o=s.get(e);o&&(r||(r=o),n.push(t))}return n.length>1&&console.warn(`[hc-registry] getInstance("${e}") matched ${n.length} canvases [${n.join(", ")}]; returning first. Prefer __HYPERCARD__.canvases.callComponent(canvasId, instanceId, ...) for explicit scope.`),r}function g(e){const t=null==e?void 0:e.componentId,s=t?e=>e.componentId===t:()=>!0;if(void 0!==(null==e?void 0:e.canvasId)){const t=u.get(e.canvasId);return t?[...t.values()].filter(s):[]}const r=[];for(const e of u.values())for(const t of e.values())s(t)&&r.push(t);return r}const y={getInstance:m,listInstances:g,call(e,t,...s){const r=m(e);if(r)return r.call(t,...s);console.debug(`[hc-runtime] call: instance "${e}" not found`)},on(e,t,s){const r=m(e);if(r)return r.on(t,s);console.debug(`[hc-runtime] on: instance "${e}" not found`)},emit(e,t,s){const r=m(e);r?r.emit(t,s):console.debug(`[hc-runtime] emit: instance "${e}" not found`)}},w={pickerUrl:e=>`/a/${e}`};function v(e){return{canvasId:e,listInstances:t=>g({canvasId:e,componentId:null==t?void 0:t.componentId}),getInstance:t=>m(t,e),call(t,s,...r){const n=m(t,e);if(n)try{return n.call(s,...r)}catch(r){return void console.warn(`[hc-canvases] call error: canvas="${e}" instance="${t}" method="${s}":`,r)}else console.warn(`[hc-canvases] call: instance "${t}" not found in canvas "${e}"`)},emit(t,s,r){const n=m(t,e);if(n)try{n.emit(s,r)}catch(r){console.warn(`[hc-canvases] emit error: canvas="${e}" instance="${t}" event="${s}":`,r)}else console.warn(`[hc-canvases] emit: instance "${t}" not found in canvas "${e}"`)},broadcastInCanvas(t,s){const r=g({canvasId:e});for(const n of r)try{n.emit(t,s)}catch(s){console.warn(`[hc-canvases] broadcastInCanvas: canvas="${e}" instance="${n.instanceId}" event="${t}" emit failed:`,s)}},dispose(){p(e)}}}function b(){return{list:()=>f().map(e=>v(e)),get:e=>f().includes(e)?v(e):null,getAll(){const e={};for(const t of f())e[t]=v(t);return e},callComponent(e,t,s,...r){const n=m(t,e);if(n)try{return n.call(s,...r)}catch(r){return void console.warn(`[hc-canvases] callComponent error: canvas="${e}" instance="${t}" method="${s}":`,r)}else console.warn(`[hc-canvases] callComponent: canvas="${e}" instance="${t}" not found`)},emitToCanvas(e,t,s,r){const n=m(t,e);if(n)try{n.emit(s,r)}catch(r){console.warn(`[hc-canvases] emitToCanvas error: canvas="${e}" instance="${t}" event="${s}":`,r)}else console.warn(`[hc-canvases] emitToCanvas: canvas="${e}" instance="${t}" not found`)},broadcast(e,t){for(const s of f())try{const r=g({canvasId:s});for(const n of r)try{n.emit(e,t)}catch(t){console.warn(`[hc-canvases] broadcast: canvas="${s}" instance="${n.instanceId}" event="${e}" emit failed:`,t)}}catch(t){console.warn(`[hc-canvases] broadcast: canvas="${s}" event="${e}" failed:`,t)}}}}const x=new Set(["vue","Vue","window","global","globalThis","console","document","process","$","libs","runtime","assets","version"]);function C(e){return Array.isArray(e)&&e.length>=1?C(e[0]):"object"==typeof e&&null!==e&&"function"==typeof e.install}function S(e){return Array.isArray(e)&&e.length>=1?[e[0],e.slice(1)]:[e,[]]}function k(e){return C(e)?Array.isArray(e)?"✓ Vue plugin (with options) → 已 app.use":"✓ Vue plugin → 已 app.use":"function"==typeof e?"· function":Array.isArray(e)?"· array":"object"==typeof e&&null!==e?"· object":"· "+typeof e}const O="__HYPERCARD__",I=new Set(["init","onClick","onMouseover","onMouseout","onResize","onDestroy"]),E=new Map;function A(e,t){for(E.has(e)&&E.delete(e),E.set(e,t);E.size>100;){const e=E.keys().next().value;if(void 0===e)break;E.delete(e)}}function P(e){let t=5381;for(let s=0;s<e.length;s++)t=(t<<5)+t+e.charCodeAt(s)|0;return(t>>>0).toString(36)}function R(e){if(!Array.isArray(e))return[];const t=[];for(const s of e){if(!s||"object"!=typeof s)continue;const e=s;if("string"!=typeof e.name)continue;const r={name:e.name};"boolean"==typeof e.multiple&&(r.multiple=e.multiple),Array.isArray(e.accepts)&&(r.accepts=e.accepts.filter(e=>"string"==typeof e)),"number"==typeof e.maxChildren&&(r.maxChildren=e.maxChildren),"string"==typeof e.label&&(r.label=e.label),t.push(r)}return t}async function $(e){const r=P(e.html)+"_"+P(e.js),n=E.get(r);if(n)return A(r,n),n;const o=(async()=>function(e,t){if(!e||"object"!=typeof e)throw new Error("[hc-compile] component.js must `export default` an object");const r=e,n=r.name,o=r.method??{},i=r.attribute??{},a=r.custom??{},l=r.style??{},c=r.slots,u=r.data,p=r.methods??{},f=r.computed,m=r.watch,g=r.created,y=r.mounted,w=r.beforeUnmount,v=r.props,b=new Set(["name","method","attribute","custom","style","option","data","methods","computed","watch","created","mounted","beforeUnmount","props","slots"]),x={};for(const e of Object.keys(r))b.has(e)||(x[e]=r[e]);const C={};for(const[e,t]of Object.entries(o))I.has(e)||"function"!=typeof t||(C[e]=t);const S=Object.keys(C),k={...C,...p},O=(t??"").trim()||"<div></div>";return{options:{render:s.compile(O),props:{...v?Array.isArray(v)?Object.fromEntries(v.map(e=>[e,null])):"object"==typeof v?v:{}:{},hcCustomValues:{type:Object,default:()=>({})},hcInstanceId:{type:String,default:""},hcCanvasId:{type:String,default:""},hcComponentId:{type:String,default:""}},data(){const e="function"==typeof u?u.call(this):u??{},t=this.hcCustomValues??{},s={};for(const[e,r]of Object.entries(a)){let n;try{n=JSON.parse(JSON.stringify(r??{}))}catch{n={...r??{}}}e in t&&n&&"object"==typeof n&&(n.value=t[e]),s[e]=n}return{custom:s,...e}},methods:k,computed:f,watch:(()=>{const e=m&&"object"==typeof m?{...m}:{};return e.hcCustomValues={handler(e){if(e&&this.custom)for(const[t,s]of Object.entries(e)){const e=this.custom[t];e&&"object"==typeof e&&(e.value=s)}},deep:!0},e})(),created(){this.hcInstanceId&&this.hcCanvasId&&h(this.hcCanvasId,this.hcInstanceId,this.hcComponentId,this),"function"==typeof g&&g.call(this)},mounted(){const e=[],t=this.$el;if(t&&t instanceof HTMLElement){Object.assign(t.style,l);for(const[e,s]of Object.entries(i))"string"==typeof s&&s&&t.setAttribute(e,s);for(const s of I){if("init"===s)continue;const r=o[s];if("function"==typeof r){const n=s.replace(/^on/,"").toLowerCase(),o=e=>{r.call(this,{event:e,data:e})};t.addEventListener(n,o),e.push(()=>t.removeEventListener(n,o))}}}this.__hcCleanup=e;const s=o.init;"function"==typeof s&&s.call(this),"function"==typeof y&&y.call(this)},beforeUnmount(){var e;this.hcInstanceId&&this.hcCanvasId&&d(this.hcInstanceId,this.hcCanvasId),null==(e=this.__hcCleanup)||e.forEach(e=>{try{e()}catch{}}),this.__hcCleanup=void 0,"function"==typeof w&&w.call(this)},...x},meta:{name:n,attribute:i,style:l,customDecl:a,methodNames:S,slotsDecl:R(c)}}}(function(e){let s;try{const r=t.parse(e,{ecmaVersion:"latest",sourceType:"module",allowAwaitOutsideFunction:!0}).body.find(e=>"ExportDefaultDeclaration"===e.type);if(!r)throw new Error("[hc-compile] component.js must `export default` an object");s=e.slice(0,r.start)+"module.exports = "+e.slice(r.declaration.start)}catch(e){throw e instanceof Error?e:new Error(String(e))}const r=new Function("module","exports",`"use strict";\n${s}\n;return module.exports;`),n={exports:{}};try{return r(n,n.exports)}catch(e){throw e instanceof Error?e:new Error(String(e))}}(e.js),e.html))();return A(r,o),o.catch(()=>E.delete(r)),o}var _,j={exports:{}};const B=function(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var s=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),s}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var M,D,U,z,L,N;function F(){if(D)return M;D=1;let e=function(){if(_)return j.exports;_=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return j.exports=t(),j.exports.createColors=t,j.exports}(),t=B;class s extends Error{constructor(e,t,r,n,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,s)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(s){if(!this.source)return"";let r=this.source;null==s&&(s=e.isColorSupported);let n=e=>e,o=e=>e,i=e=>e;if(s){let{bold:s,gray:r,red:a}=e.createColors(!0);o=e=>s(a(e)),n=e=>r(e),t&&(i=e=>t(e))}let a=r.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let s=l+1+t,r=" "+(" "+s).slice(-u)+" | ";if(s===this.line){if(e.length>160){let t=20,s=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(s,a),c=n(r.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return o(">")+n(r)+i(l)+"\n "+c+o("^")}let t=n(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return o(">")+n(r)+i(e)+"\n "+t+o("^")}return" "+n(r)+i(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return M=s,s.default=s,M}function V(){if(z)return U;z=1;const e=/(<)(\/?style\b)/gi,t=/(<)(!--)/g;function s(s){return"string"!=typeof s?s:s.includes("<")?s.replace(e,"\\3c $2").replace(t,"\\3c $2"):s}const r={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class n{constructor(e){this.builder=e}atrule(e,t){let r=e.raws,n="@"+e.name,o=e.params?this.rawValue(e,"params"):"";if(void 0!==r.afterName?n+=r.afterName:o&&(n+=" "),e.nodes)this.block(e,n+o);else{let i=(r.between||"")+(t?";":"");this.builder(s(n+o+i),e)}}beforeAfter(e,t){let s;s="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,n=0;for(;r&&"root"!==r.type;)n+=1,r=r.parent;if(s.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<n;e++)s+=t}return s}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(s(t+n)+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(s(r)),this.builder("}",e,"end")}body(e){let t=e.nodes,r=t.length-1;for(;r>0&&"comment"===t[r].type;)r-=1;let n=this.raw(e,"semicolon"),o="document"===e.type;for(let e=0;e<t.length;e++){let i=t[e],a=this.raw(i,"before");a&&this.builder(o?a:s(a)),this.stringify(i,r!==e||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder(s("/*"+t+e.text+r+"*/"),e)}decl(e,t){let r=e.raws,n=this.raw(e,"between","colon"),o=e.prop+n+this.rawValue(e,"value");e.important&&(o+=r.important||" !important"),t&&(o+=";"),this.builder(s(o),e)}document(e){this.body(e)}raw(e,t,s){let n;if(s||(s=t),t&&(n=e.raws[t],void 0!==n))return n;let o=e.parent;if("before"===s){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}if(!o)return r[s];let i=e.root(),a=i.rawCache||(i.rawCache={});if(void 0!==a[s])return a[s];if("before"===s||"after"===s)return this.beforeAfter(e,s);{let r="raw"+((l=s)[0].toUpperCase()+l.slice(1));this[r]?n=this[r](i,e):i.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var l;return void 0===n&&(n=r[s]),a[s]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let s;return e.walkComments(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(e,t){let s;return e.walkDecls(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(s=>{if(s.nodes&&(s.parent!==e||e.first!==s)&&void 0!==s.raws.before)return t=s.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(s=>{let r=s.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==s.raws.before){let e=s.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let s=e[t],r=e.raws[t];return r&&r.value===s?r.raw:s}root(e){if(this.body(e),e.raws.after){let t=e.raws.after,r=e.parent&&"document"===e.parent.type;this.builder(r?t:s(t))}}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(s(e.raws.ownSemicolon),e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}return U=n,n.default=n,U}function T(){if(N)return L;N=1;let e=V();function t(t,s){new e(s).stringify(t)}return L=t,t.default=t,L}var W,H,J,Y,G,q,K,Z,Q,X,ee,te,se,re,ne,oe,ie,ae,le,ce,ue,he,pe,fe,de,me,ge,ye,we,ve,be,xe,Ce,Se,ke,Oe,Ie,Ee,Ae,Pe,Re,$e,_e,je,Be,Me,De,Ue,ze,Le={};function Ne(){return W||(W=1,Le.isClean=Symbol("isClean"),Le.my=Symbol("my")),Le}function Fe(){if(J)return H;J=1;let e=F(),t=V(),s=T(),{isClean:r,my:n}=Ne();function o(e,t){let s=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let n=e[r],i=typeof n;"parent"===r&&"object"===i?t&&(s[r]=t):"source"===r?s[r]=n:Array.isArray(n)?s[r]=n.map(e=>o(e,s)):("object"===i&&null!==n&&(n=o(n)),s[r]=n)}return s}function i(e,t){if(t&&void 0!==t.offset)return t.offset;let s=1,r=1,n=0;for(let o=0;o<e.length;o++){if(r===t.line&&s===t.column){n=o;break}"\n"===e[o]?(s=1,r+=1):s+=1}return n}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[r]=!1,this[n]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let s of e[t])"function"==typeof s.clone?this.append(s.clone()):this.append(s)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=o(this);for(let s in e)t[s]=e[s];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(t,s={}){if(this.source){let{end:e,start:r}=this.rangeBy(s);return this.source.input.error(t,{column:r.column,line:r.line},{column:e.column,line:e.line},s)}return new e(t)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markClean(){this[r]=!0}markDirty(){if(this[r]){this[r]=!1;let e=this;for(;e=e.parent;)e[r]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let s="document"in this.source.input?this.source.input.document:this.source.input.css,r=s.slice(i(s,this.source.start),i(s,this.source.end)).indexOf(e.word);-1!==r&&(t=this.positionInside(r))}return t}positionInside(e){let t=this.source.start.column,s=this.source.start.line,r="document"in this.source.input?this.source.input.document:this.source.input.css,n=i(r,this.source.start),o=n+e;for(let e=n;e<o;e++)"\n"===r[e]?(t=1,s+=1):t+=1;return{column:t,line:s,offset:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,s={column:this.source.start.column,line:this.source.start.line,offset:i(t,this.source.start)},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:i(t,this.source.end)+1}:{column:s.column+1,line:s.line,offset:s.offset+1};if(e.word){let n=t.slice(i(t,this.source.start),i(t,this.source.end)).indexOf(e.word);-1!==n&&(s=this.positionInside(n),r=this.positionInside(n+e.word.length))}else e.start?s={column:e.start.column,line:e.start.line,offset:i(t,e.start)}:e.index&&(s=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line,offset:i(t,e.end)}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<s.line||r.line===s.line&&r.column<=s.column)&&(r={column:s.column+1,line:s.line,offset:s.offset+1}),{end:r,start:s}}raw(e,s){return(new t).raw(this,e,s)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,s=!1;for(let r of e)r===this?s=!0:s?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);s||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let s={},r=null==t;t=t||new Map;let n=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))s[e]=r.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof r&&r.toJSON)s[e]=r.toJSON(null,t);else if("source"===e){if(null==r)continue;let o=t.get(r.input);null==o&&(o=n,t.set(r.input,n),n++),s[e]={end:r.end,inputId:o,start:r.start}}else s[e]=r}return r&&(s.inputs=[...t.keys()].map(e=>e.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=s){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,s={}){let r={node:this};for(let e in s)r[e]=s[e];return e.warn(t,r)}}return H=a,a.default=a,H}function Ve(){if(G)return Y;G=1;let e=Fe();class t extends e{constructor(e){super(e),this.type="comment"}}return Y=t,t.default=t,Y}function Te(){if(K)return q;K=1;let e=Fe();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return q=t,t.default=t,q}function We(){if(Q)return Z;Q=1;let e,t,s,r,n=Ve(),o=Te(),i=Fe(),{isClean:a,my:l}=Ne();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends i{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,s,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],s=e(this.proxyOf.nodes[t],t),!1!==s);)this.indexes[r]+=1;return delete this.indexes[r],s}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...s)=>e[t](...s.map(e=>"function"==typeof e?(t,s)=>e(t.toProxy(),s):e)):"every"===t||"some"===t?s=>e[t]((e,...t)=>s(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let s,r=this.index(e),n=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of n)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)s=this.indexes[e],r<s&&(this.indexes[e]=s+n.length);return this.markDirty(),this}insertBefore(e,t){let s,r=this.index(e),n=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],n).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)s=this.indexes[e],r<=s&&(this.indexes[e]=s+o.length);return this.markDirty(),this}normalize(s,i){if("string"==typeof s)s=c(t(s).nodes);else if(void 0===s)s=[];else if(Array.isArray(s)){s=s.slice(0);for(let e of s)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===s.type&&"document"!==this.type){s=s.nodes.slice(0);for(let e of s)e.parent&&e.parent.removeChild(e,"ignore")}else if(s.type)s=[s];else if(s.prop){if(void 0===s.value)throw new Error("Value field is missed in node creation");"string"!=typeof s.value&&(s.value=String(s.value)),s=[new o(s)]}else if(s.selector||s.selectors)s=[new r(s)];else if(s.name)s=[new e(s)];else{if(!s.text)throw new Error("Unknown node type in node creation");s=[new n(s)]}return s.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&i&&void 0!==i.raws.before&&(e.raws.before=i.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let s in this.indexes)t=this.indexes[s],t>=e&&(this.indexes[s]=t-1);return this.markDirty(),this}replaceValues(e,t,s){return s||(s=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,s))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,s)=>{let r;try{r=e(t,s)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("atrule"===s.type&&e.test(s.name))return t(s,r)}):this.walk((s,r)=>{if("atrule"===s.type&&s.name===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("atrule"===e.type)return t(e,s)}))}walkComments(e){return this.walk((t,s)=>{if("comment"===t.type)return e(t,s)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("decl"===s.type&&e.test(s.prop))return t(s,r)}):this.walk((s,r)=>{if("decl"===s.type&&s.prop===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("decl"===e.type)return t(e,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("rule"===s.type&&e.test(s.selector))return t(s,r)}):this.walk((s,r)=>{if("rule"===s.type&&s.selector===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("rule"===e.type)return t(e,s)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{r=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{s=e},Z=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,r.prototype):"decl"===t.type?Object.setPrototypeOf(t,o.prototype):"comment"===t.type?Object.setPrototypeOf(t,n.prototype):"root"===t.type&&Object.setPrototypeOf(t,s.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},Z}function He(){if(ee)return X;ee=1;let e=We();class t extends e{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return X=t,t.default=t,e.registerAtRule(t),X}function Je(){if(se)return te;se=1;let e,t,s=We();class r extends s{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(s={}){return new e(new t,this,s).stringify()}}return r.registerLazyResult=t=>{e=t},r.registerProcessor=e=>{t=e},te=r,r.default=r,te}function Ye(){if(ie)return oe;ie=1;let{existsSync:e,readFileSync:t}=B,{dirname:s,join:r}=B,{SourceMapConsumer:n,SourceMapGenerator:o}=B;class i{constructor(e,t){if(!1===t.map)return;t.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new n(this.json||this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let s=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(s)return r=e.substr(s[0].length),Buffer?Buffer.from(r,"base64").toString():window.atob(r);var r;let n=e.slice(22);throw n=n.slice(0,n.indexOf(",")),new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let s=e.lastIndexOf(t.pop()),r=e.indexOf("*/",s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(s,r)))}loadFile(r,n,o){if(o||this.unsafeMap||/\.map$/i.test(r))return this.root=s(r),e(r)?(this.mapFile=r,t(r,"utf-8").toString().trim()):void 0}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof n)return o.fromSourceMap(t).toString();if(t instanceof o)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let s=t(e);if(s){let t=this.loadFile(s,e,!0);if(!t)throw new Error("Unable to load previous source map: "+s.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;e&&(t=r(s(e),t));let n=this.loadFile(t,e,!1);if(n)try{this.json=JSON.parse(n.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return n}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return oe=i,i.default=i,oe}function Ge(){if(le)return ae;le=1;let{nanoid:e}=ne?re:(ne=1,re={nanoid:(e=21)=>{let t="",s=0|e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(s=t)=>{let r="",n=0|s;for(;n--;)r+=e[Math.random()*e.length|0];return r}}),{isAbsolute:t,resolve:s}=B,{SourceMapConsumer:r,SourceMapGenerator:n}=B,{fileURLToPath:o,pathToFileURL:i}=B,a=F(),l=Ye(),c=B,u=Symbol("lineToIndexCache"),h=Boolean(r&&n),p=Boolean(s&&t);function f(e){if(e[u])return e[u];let t=e.css.split("\n"),s=new Array(t.length),r=0;for(let e=0,n=t.length;e<n;e++)s[e]=r,r+=t[e].length+1;return e[u]=s,s}class d{get from(){return this.file||this.id}constructor(r,n={}){if(null==r||"object"==typeof r&&!r.toString)throw new Error(`PostCSS received ${r} instead of CSS string`);if(this.css=r.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,n.document&&(this.document=n.document.toString()),n.from&&(!p||/^\w+:\/\//.test(n.from)||t(n.from)?this.file=n.from:this.file=s(n.from)),p&&h){let e=new l(this.css,n);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,s,r={}){let n,o,l,c,u;if(t&&"object"==typeof t){let e=t,r=s;if("number"==typeof e.offset){c=e.offset;let r=this.fromOffset(c);t=r.line,s=r.col}else t=e.line,s=e.column,c=this.fromLineAndColumn(t,s);if("number"==typeof r.offset){l=r.offset;let e=this.fromOffset(l);o=e.line,n=e.col}else o=r.line,n=r.column,l=this.fromLineAndColumn(r.line,r.column)}else if(s)c=this.fromLineAndColumn(t,s);else{c=t;let e=this.fromOffset(c);t=e.line,s=e.col}let h=this.origin(t,s,o,n);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,r.plugin):new a(e,void 0===o?t:{column:s,line:t},void 0===o?s:{column:n,line:o},this.css,this.file,r.plugin),u.input={column:s,endColumn:n,endLine:o,endOffset:l,line:t,offset:c,source:this.css},this.file&&(i&&(u.input.url=i(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return f(this)[e-1]+t-1}fromOffset(e){let t=f(this),s=0;if(e>=t[t.length-1])s=t.length-1;else{let r,n=t.length-2;for(;s<n;)if(r=s+(n-s>>1),e<t[r])n=r-1;else{if(!(e>=t[r+1])){s=r;break}s=r+1}}return{col:e-t[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:s(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,s,r,n){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:s,line:e});if(!u.source)return!1;"number"==typeof r&&(a=c.originalPositionFor({column:n,line:r})),l=t(u.source)?i(u.source):new URL(u.source,this.map.consumer().sourceRoot||i(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!o)throw new Error("file: protocol is not available in this PostCSS build");h.file=o(l)}let p=c.sourceContentFor(u.source);return p&&(h.source=p),h}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}}return ae=d,d.default=d,c&&c.registerInput&&c.registerInput(d),ae}function qe(){if(ue)return ce;ue=1;let e,t,s=We();class r extends s{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,s){let r=super.normalize(e);if(t)if("prepend"===s)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before;return r}removeChild(e,t){let s=this.index(e);return!t&&0===s&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(e)}toResult(s={}){return new e(new t,this,s).stringify()}}return r.registerLazyResult=t=>{e=t},r.registerProcessor=e=>{t=e},ce=r,r.default=r,s.registerRoot(r),ce}function Ke(){if(pe)return he;pe=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,s){let r=[],n="",o=!1,i=0,a=!1,l="",c=!1;for(let s of e)c?c=!1:"\\"===s?c=!0:a?s===l&&(a=!1):'"'===s||"'"===s?(a=!0,l=s):"("===s?i+=1:")"===s?i>0&&(i-=1):0===i&&t.includes(s)&&(o=!0),o?(""!==n&&r.push(n.trim()),n="",o=!1):n+=s;return(s||""!==n)&&r.push(n.trim()),r}};return he=e,e.default=e,he}function Ze(){if(de)return fe;de=1;let e=We(),t=Ke();class s extends e{get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,s=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(s)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return fe=s,s.default=s,e.registerRule(s),fe}function Qe(){if(we)return ye;we=1;let{dirname:e,relative:t,resolve:s,sep:r}=B,{SourceMapConsumer:n,SourceMapGenerator:o}=B,{pathToFileURL:i}=B,a=Ge(),l=Boolean(n&&o),c=Boolean(e&&s&&t&&r);return ye=class{constructor(e,t,s,r){this.stringify=e,this.mapOpts=s.map||{},this.root=t,this.opts=s,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let s,r=this.toUrl(this.path(t.file)),o=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(s=new n(t.text),s.sourcesContent&&(s.sourcesContent=null)):s=t.consumer(),this.map.applySourceMap(s,r,this.toUrl(this.path(o)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else if(this.css){let e;for(;-1!==(e=this.css.lastIndexOf("/*#"));){let t=this.css.indexOf("*/",e+3);if(-1===t)break;for(;e>0&&"\n"===this.css[e-1];)e--;this.css=this.css.slice(0,e)+this.css.slice(t+2)}}}generate(){if(this.clearAnnotation(),c&&l&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=o.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new o({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new o({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,s=1,r=1,n="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=s,i.generated.column=r-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,this.map.addMapping(i))),t=o.match(/\n/g),t?(s+=t.length,e=o.lastIndexOf("\n"),r=o.length-e):r+=o.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=s,i.generated.column=r-2,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=s,i.generated.column=r-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(r){if(this.mapOpts.absolute)return r;if(60===r.charCodeAt(0))return r;if(/^\w+:\/\//.test(r))return r;let n=this.memoizedPaths.get(r);if(n)return n;let o=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=e(s(o,this.mapOpts.annotation)));let i=t(o,r);return this.memoizedPaths.set(r,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new a(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let s=t.source.input.from;if(s&&!e[s]){e[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(i){let t=i(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===r&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}}}function Xe(){if(ke)return Se;ke=1;let e=We(),t=Ge(),s=function(){if(Ce)return xe;Ce=1;let e=He(),t=Ve(),s=Te(),r=qe(),n=Ze(),o=function(){if(be)return ve;be=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),s="\\".charCodeAt(0),r="/".charCodeAt(0),n="\n".charCodeAt(0),o=" ".charCodeAt(0),i="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),p=")".charCodeAt(0),f="{".charCodeAt(0),d="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),y=":".charCodeAt(0),w="@".charCodeAt(0),v=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,x=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return ve=function(S,k={}){let O,I,E,A,P,R,$,_,j,B,M=S.css.valueOf(),D=k.ignoreErrors,U=M.length,z=0,L=[],N=[],F=-1;function V(e){throw S.error("Unclosed "+e,z)}return{back:function(e){N.push(e)},endOfFile:function(){return 0===N.length&&z>=U},nextToken:function(S){if(N.length)return N.pop();if(z>=U)return;let k=!!S&&S.ignoreUnclosed;switch(O=M.charCodeAt(z),O){case n:case o:case a:case l:case i:A=z;do{A+=1,O=M.charCodeAt(A)}while(O===o||O===n||O===a||O===l||O===i);R=["space",M.slice(z,A)],z=A-1;break;case c:case u:case f:case d:case y:case m:case p:{let e=String.fromCharCode(O);R=[e,e,z];break}case h:if(B=L.length?L.pop()[1]:"",j=M.charCodeAt(z+1),"url"===B&&j!==e&&j!==t&&j!==o&&j!==n&&j!==a&&j!==i&&j!==l){A=z;do{if($=!1,A=M.indexOf(")",A+1),-1===A){if(D||k){A=z;break}V("bracket")}for(_=A;M.charCodeAt(_-1)===s;)_-=1,$=!$}while($);R=["brackets",M.slice(z,A+1),z,A],z=A}else z<=F?R=["(","(",z]:(A=M.indexOf(")",z+1),I=M.slice(z,A+1),-1===A||x.test(I)?(F=-1===A?U:A,R=["(","(",z]):(R=["brackets",I,z,A],z=A));break;case e:case t:P=O===e?"'":'"',A=z;do{if($=!1,A=M.indexOf(P,A+1),-1===A){if(D||k){A=z+1;break}V("string")}for(_=A;M.charCodeAt(_-1)===s;)_-=1,$=!$}while($);R=["string",M.slice(z,A+1),z,A],z=A;break;case w:v.lastIndex=z+1,v.test(M),A=0===v.lastIndex?M.length-1:v.lastIndex-2,R=["at-word",M.slice(z,A+1),z,A],z=A;break;case s:for(A=z,E=!0;M.charCodeAt(A+1)===s;)A+=1,E=!E;if(O=M.charCodeAt(A+1),E&&O!==r&&O!==o&&O!==n&&O!==a&&O!==l&&O!==i&&(A+=1,C.test(M.charAt(A)))){for(;C.test(M.charAt(A+1));)A+=1;M.charCodeAt(A+1)===o&&(A+=1)}R=["word",M.slice(z,A+1),z,A],z=A;break;default:O===r&&M.charCodeAt(z+1)===g?(A=M.indexOf("*/",z+2)+1,0===A&&(D||k?A=M.length:V("comment")),R=["comment",M.slice(z,A+1),z,A],z=A):(b.lastIndex=z+1,b.test(M),A=0===b.lastIndex?M.length-1:b.lastIndex-2,R=["word",M.slice(z,A+1),z,A],L.push(R),z=A)}return z++,R},position:function(){return z}}}}();const i={empty:!0,space:!0};return xe=class{constructor(e){this.input=e,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let s,r,n,o=new e;o.name=t[1].slice(1),""===o.name&&this.unnamedAtrule(o,t),this.init(o,t[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(s=(t=this.tokenizer.nextToken())[0],"("===s||"["===s?c.push("("===s?")":"]"):"{"===s&&c.length>0?c.push("}"):s===c[c.length-1]&&c.pop(),0===c.length){if(";"===s){o.source.end=this.getPosition(t[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===s){a=!0;break}if("}"===s){if(l.length>0){for(n=l.length-1,r=l[n];r&&"space"===r[0];)r=l[--n];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),i&&(t=l[l.length-1],o.source.end=this.getPosition(t[3]||t[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let s,r=0;for(let n=t-1;n>=0&&(s=e[n],"space"===s[0]||(r+=1,2!==r));n--);throw this.input.error("Missed semicolon","word"===s[0]?s[3]+1:s[2])}colon(e){let t,s,r,n=0;for(let[o,i]of e.entries()){if(s=i,r=s[0],"("===r&&(n+=1),")"===r&&(n-=1),0===n&&":"===r){if(t){if("word"===t[0]&&"progid"===t[1])continue;return o}this.doubleColon(s)}t=s}return!1}comment(e){let s=new t;this.init(s,e[2]),s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++;let r=e[1].slice(2,-2);if(r.trim()){let e=r.match(/^(\s*)([^]*\S)(\s*)$/);s.text=e[2],s.raws.left=e[1],s.raws.right=e[3]}else s.text="",s.raws.left=r,s.raws.right=""}createTokenizer(){this.tokenizer=o(this.input)}decl(e,t){let r=new s;this.init(r,e[0][2]);let n,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let s=e[t],r=s[3]||s[2];if(r)return r}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i,a=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let s=this.stringFrom(e,t);s=this.spacesFromEnd(e)+s," !important"!==s&&(r.raws.important=s);break}if("important"===n[1].toLowerCase()){let s=e.slice(0),n="";for(let e=t;e>0;e--){let t=s[e][0];if(n.trim().startsWith("!")&&"space"!==t)break;n=s.pop()[1]+n}n.trim().startsWith("!")&&(r.important=!0,r.raws.important=n,e=s)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(r,"value",a.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new n;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,s=null,r=!1,n=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(s=l[0],a.push(l),"("===s||"["===s)n||(n=l),o.push("("===s?")":"]");else if(i&&r&&"{"===s)n||(n=l),o.push("}");else if(0===o.length){if(";"===s){if(r)return void this.decl(a,i);break}if("{"===s)return void this.rule(a);if("}"===s){this.tokenizer.back(a.pop()),t=!0;break}":"===s&&(r=!0)}else s===o[o.length-1]&&(o.pop(),0===o.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&r){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,s,r){let n,o,a,l,c=s.length,u="",h=!0;for(let e=0;e<c;e+=1)n=s[e],o=n[0],"space"!==o||e!==c-1||r?"comment"===o?(l=s[e-1]?s[e-1][0]:"empty",a=s[e+1]?s[e+1][0]:"empty",i[l]||i[a]||","===u.slice(-1)?h=!1:u+=n[1]):u+=n[1]:h=!1;if(!h){let r=s.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:u}}e[t]=u}rule(e){e.pop();let t=new n;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)s=e.pop()[1]+s;return s}spacesAndCommentsFromStart(e){let t,s="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)s+=e.shift()[1];return s}spacesFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)s=e.pop()[1]+s;return s}stringFrom(e,t){let s="";for(let r=t;r<e.length;r++)s+=e[r][1];return e.splice(t,e.length-t),s}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}}();function r(e,r){let n=new t(e,r),o=new s(n);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&r&&r.from&&(/\.scss$/i.test(r.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(r.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(r.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return Se=r,r.default=r,e.registerParse(r),Se}function et(){if(Ie)return Oe;Ie=1;class e{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return Oe=e,e.default=e,Oe}function tt(){if(Ae)return Ee;Ae=1;let e=et();class t{get content(){return this.css}constructor(e,t,s){this.processor=e,this.messages=[],this.root=t,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(t,s={}){s.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(s.plugin=this.lastPlugin.postcssPlugin);let r=new e(t,s);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}}return Ee=t,t.default=t,Ee}function st(){if(Re)return Pe;Re=1;let e={};return Pe=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function rt(){if(_e)return $e;_e=1;let e=We(),t=Je(),s=Qe(),r=Xe(),n=tt(),o=qe(),i=T(),{isClean:a,my:l}=Ne(),c=st();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},p={Once:!0,postcssPlugin:!0,prepare:!0};function f(e){return"object"==typeof e&&"function"==typeof e.then}function d(e){let t=!1,s=u[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[s,s+"-"+t,0,s+"Exit",s+"Exit-"+t]:t?[s,s+"-"+t,s+"Exit",s+"Exit-"+t]:e.append?[s,0,s+"Exit"]:[s,s+"Exit"]}function m(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:d(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let y={};class w{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(t,s,o){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof s||null===s||"root"!==s.type&&"document"!==s.type)if(s instanceof w||s instanceof n)i=g(s.root),s.map&&(void 0===o.map&&(o.map={}),o.map.inline||(o.map.inline=!1),o.map.prev=s.map);else{let t=r;o.syntax&&(t=o.syntax.parse),o.parser&&(t=o.parser),t.parse&&(t=t.parse);try{i=t(s,o)}catch(e){this.processed=!0,this.error=e}i&&!i[l]&&e.rebuild(i)}else i=g(s);this.result=new n(t,i,o),this.helpers={...y,postcss:y,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let s=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(s.postcssVersion&&"production"!==process.env.NODE_ENV){let e=s.postcssPlugin,t=s.postcssVersion,r=this.result.processor.version,n=t.split("."),o=r.split(".");(n[0]!==o[0]||parseInt(n[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+r+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=s.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,s)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,s])};for(let t of this.plugins)if("object"==typeof t)for(let s in t){if(!h[s]&&/^[A-Z]/.test(s))throw new Error(`Unknown event ${s} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p[s])if("object"==typeof t[s])for(let r in t[s])e(t,"*"===r?s:s+"-"+r.toLowerCase(),t[s][r]);else"function"==typeof t[s]&&e(t,s,t[s])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],s=this.runOnRoot(t);if(f(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(f(e))try{await e}catch(e){let s=t[t.length-1].node;throw this.handleError(e,s)}}}if(this.listeners.OnceExit)for(let[t,s]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>s(e,this.helpers));await Promise.all(t)}else await s(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return f(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=i;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=this.result.root.source;if(void 0===e.map&&!(r&&r.input&&r.input.map)){let e="";return t(this.result.root,t=>{e+=t}),this.result.css=e,this.result}let n=new s(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(f(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[s,r]of e){let e;this.result.lastPlugin=s;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(f(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:s,visitors:r}=t;if("root"!==s.type&&"document"!==s.type&&!s.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,n]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return n(s.toProxy(),this.helpers)}catch(e){throw this.handleError(e,s)}}if(0!==t.iterator){let r,n=t.iterator;for(;r=s.nodes[s.indexes[n]];)if(s.indexes[n]+=1,!r[a])return r[a]=!0,void e.push(m(r));t.iterator=0,delete s.indexes[n]}let n=t.events;for(;t.eventIndex<n.length;){let e=n[t.eventIndex];if(t.eventIndex+=1,0===e)return void(s.nodes&&s.nodes.length&&(s[a]=!0,t.iterator=s.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=d(e);for(let s of t)if(0===s)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[s];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return w.registerPostcss=e=>{y=e},$e=w,w.default=w,o.registerLazyResult(w),t.registerLazyResult(w),$e}const nt=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(function(){if(ze)return Ue;ze=1;let e=He(),t=Ve(),s=We(),r=F(),n=Te(),o=Je(),i=function(){if(ge)return me;ge=1;let e=He(),t=Ve(),s=Te(),r=Ge(),n=Ye(),o=qe(),i=Ze();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:r.prototype};t.map&&(t.map={...t.map,__proto__:n.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new s(h);if("rule"===h.type)return new i(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return me=a,a.default=a,me}(),a=Ge(),l=rt(),c=Ke(),u=Fe(),h=Xe(),p=function(){if(De)return Me;De=1;let e=Je(),t=rt(),s=function(){if(Be)return je;Be=1;let e=Qe(),t=Xe(),s=tt(),r=T(),n=st();class o{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,s=t;try{e=s(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,n,o){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=o,this._map=void 0;let i=r;this.result=new s(this._processor,void 0,this._opts),this.result.css=n;let a=this;Object.defineProperty(this.result,"root",{get:()=>a.root});let l=new e(i,void 0,this._opts,n);if(l.isMap()){let[e,t]=l.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||n("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}}return je=o,o.default=o,je}(),r=qe();class n{constructor(e=[]){this.version="8.5.14",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let s of e)if(!0===s.postcss?s=s():s.postcss&&(s=s.postcss),"object"==typeof s&&Array.isArray(s.plugins))t=t.concat(s.plugins);else if("object"==typeof s&&s.postcssPlugin)t.push(s);else if("function"==typeof s)t.push(s);else{if("object"!=typeof s||!s.parse&&!s.stringify)throw new Error(s+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,r={}){return this.plugins.length||r.parser||r.stringifier||r.syntax?new t(this,e,r):new s(this,e,r)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Me=n,n.default=n,r.registerProcessor(n),e.registerProcessor(n),Me}(),f=tt(),d=qe(),m=Ze(),g=T(),y=et();function w(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new p(e)}return w.plugin=function(e,t){let s,r=!1;function n(...s){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let n=t(...s);return n.postcssPlugin=e,n.postcssVersion=(new p).version,n}return Object.defineProperty(n,"postcss",{get:()=>(s||(s=n()),s)}),n.process=function(e,t,s){return w([n(s)]).process(e,t)},n},w.stringify=g,w.parse=h,w.fromJSON=i,w.list=c,w.comment=e=>new t(e),w.atRule=t=>new e(t),w.decl=e=>new n(e),w.rule=e=>new m(e),w.root=e=>new d(e),w.document=e=>new o(e),w.CssSyntaxError=r,w.Declaration=n,w.Container=s,w.Processor=p,w.Document=o,w.Comment=t,w.Warning=y,w.AtRule=e,w.Result=f,w.Input=a,w.Rule=m,w.Root=d,w.Node=u,l.registerPostcss(w),Ue=w,w.default=w,Ue}());nt.stringify,nt.fromJSON,nt.plugin,nt.parse,nt.list,nt.document,nt.comment,nt.atRule,nt.rule,nt.decl,nt.root,nt.CssSyntaxError,nt.Declaration,nt.Container,nt.Processor,nt.Document,nt.Comment,nt.Warning,nt.AtRule,nt.Result,nt.Input,nt.Rule,nt.Root,nt.Node;const ot=new Set(["body","html",":root","*"]);function it(e,t){return e&&e.trim()?nt([(s=`[data-vbi-type="${t}"]`,{postcssPlugin:"hc-scope",AtRule(e){if("import"===e.name)return console.warn("[hc-css-scope] @import 已被拒绝(防外部资源加载):",e.params),void e.remove();"font-face"===e.name&&console.warn("[hc-css-scope] @font-face 全局生效,font-family 命名注意冲突")},Rule(e){(function(e){let t=e.parent;for(;t&&"object"==typeof t;){const e=t;if("atrule"===e.type&&/keyframes$/i.test(e.name??""))return!0;t=e.parent}return!1})(e)||(e.selectors=e.selectors.map(e=>function(e,t){const s=e.trim();if(!s)return s;if(ot.has(s))return t;for(const e of ot){const r=s.charAt(e.length);if(s.startsWith(e)&&(" "===r||">"===r||"+"===r||"~"===r||","===r))return t+s.slice(e.length)}return`${t} ${s}`}(e,s)))}})]).process(e,{from:void 0}).css:"";var s}const at=new Map;function lt(e){let t=5381;for(let s=0;s<e.length;s++)t=(t<<5)+t+e.charCodeAt(s)|0;return(t>>>0).toString(36)}function ct(e){const t=e.replace(/[^a-zA-Z0-9_-]/g,"_");return t===e?`hc-style-${t}`:`hc-style-${t}-${lt(e).slice(0,6)}`}function ut(e,t){var s;const r=t??"",n=ct(e),o=at.get(e);if(!r.trim())return null==(s=document.getElementById(n))||s.remove(),void(o&&at.set(e,{...o,cssHash:""}));const i=lt(r);if(o&&o.cssHash===i)return;let a;try{a=it(r,e)}catch(t){return void console.warn("[hc-css-scope]",e,"PostCSS process failed:",t)}!function(e,t){const s=ct(e);let r=document.getElementById(s);r||(r=document.createElement("style"),r.id=s,r.setAttribute("data-hc-scope",e),document.head.appendChild(r)),r.textContent=t}(e,a),o?at.set(e,{...o,cssHash:i}):at.set(e,{cssHash:i,refCount:0})}function ht(e,t){ut(e,t);const s=at.get(e);s?at.set(e,{...s,refCount:s.refCount+1}):at.set(e,{cssHash:"",refCount:1})}function pt(e){var t;const s=at.get(e);if(!s)return;const r=s.refCount-1;r<=0?(null==(t=document.getElementById(ct(e)))||t.remove(),at.delete(e)):at.set(e,{...s,refCount:r})}const ft={key:1,class:"rounded-md border-2 border-rose-300 bg-rose-50 p-4 text-sm text-rose-900 space-y-2 min-h-[140px] overflow-auto"},dt={class:"font-semibold flex items-center gap-1.5"},mt={class:"font-mono text-xs text-rose-800 break-all"},gt={key:0,class:"text-[10px] font-mono bg-rose-100/60 p-2 rounded overflow-auto max-h-60 text-rose-800"},yt=e.defineComponent({__name:"ErrorBoundary",props:{label:{}},setup(t){const s=t,r=e.ref(null),n=e.ref(0),o=e.ref(!1);function i(){r.value=null,o.value=!1,n.value++}return e.onErrorCaptured(e=>(console.error(`[hc-eb${s.label?" "+s.label:""}]`,e),r.value=e,!1)),(s,a)=>(e.openBlock(),e.createElementBlock("div",{key:n.value,class:"hc-eb-root",style:{width:"100%",height:"100%"}},[r.value?(e.openBlock(),e.createElementBlock("div",ft,[e.createElementVNode("div",dt,[a[1]||(a[1]=e.createElementVNode("span",null,"⚠️",-1)),e.createElementVNode("span",null,"组件渲染失败"+e.toDisplayString(t.label?` — ${t.label}`:""),1)]),e.createElementVNode("div",mt,e.toDisplayString(r.value.message),1),e.createElementVNode("button",{class:"text-xs text-rose-700 hover:text-rose-900 underline",onClick:a[0]||(a[0]=e=>o.value=!o.value)},e.toDisplayString(o.value?"隐藏":"展开")+"堆栈 ",1),o.value?(e.openBlock(),e.createElementBlock("pre",gt,e.toDisplayString(r.value.stack),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"text-xs px-3 py-1 rounded bg-rose-600 hover:bg-rose-700 text-white transition-colors",onClick:i}," 重试 ")])):e.renderSlot(s.$slots,"default",{key:0})]))}}),wt=["data-vbi-id","data-vbi-type","data-vbi-canvas"],vt={key:0,class:"rounded-md border-2 border-amber-300 bg-amber-50 p-4 text-sm text-amber-900 space-y-2 min-h-[140px] overflow-auto"},bt={class:"text-[11px] font-mono break-all whitespace-pre-wrap"},xt={key:1,class:"grid place-items-center min-h-[140px] text-xs text-zinc-400"},Ct=e.defineComponent({__name:"RuntimeBox",props:{instanceId:{},componentId:{},scopeId:{},canvasId:{},htmlSource:{},jsSource:{},cssSource:{default:""},customValues:{default:()=>({})},position:{},size:{},zIndex:{}},setup(t){const s=t,r=e.computed(()=>s.scopeId??s.componentId),i=e.inject(o,null),a=e.computed(()=>s.canvasId??i??n),l=e.shallowRef(null),c=e.ref(null),u=e.ref(!1),h=e.ref(0);e.watch(()=>[s.htmlSource,s.jsSource],()=>{!async function(){u.value=!0,c.value=null;try{const e=await $({html:s.htmlSource,js:s.jsSource});l.value=e,h.value++}catch(e){c.value=e instanceof Error?e:new Error(String(e)),l.value=null}finally{u.value=!1}}()},{immediate:!0});let p=!1;e.watch(()=>[s.cssSource,r.value],([e,t],s)=>{const r=(null==s?void 0:s[1])??null;r&&r!==t?(pt(r),ht(t,e),p=!0):p?ut(t,e):(ht(t,e),p=!0)},{immediate:!0});const f=e.computed(()=>{const e={width:"100%",height:"100%"};return s.position&&(e.position="absolute",e.left=`${s.position.x}px`,e.top=`${s.position.y}px`),void 0!==s.zIndex&&(e.zIndex=String(s.zIndex)),e});return e.onBeforeUnmount(()=>{p&&(pt(r.value),p=!1)}),(s,n)=>(e.openBlock(),e.createElementBlock("div",{class:"_vbi_box","data-vbi-id":t.instanceId,"data-vbi-type":r.value,"data-vbi-canvas":a.value,style:e.normalizeStyle(f.value)},[c.value?(e.openBlock(),e.createElementBlock("div",vt,[n[0]||(n[0]=e.createElementVNode("div",{class:"font-semibold"},"⚠️ 编译失败",-1)),e.createElementVNode("pre",bt,e.toDisplayString(c.value.message),1)])):u.value&&!l.value?(e.openBlock(),e.createElementBlock("div",xt," 编译中… ")):l.value?(e.openBlock(),e.createBlock(yt,{key:h.value,label:t.instanceId},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value.options),{"hc-custom-values":t.customValues,"hc-instance-id":t.instanceId,"hc-canvas-id":a.value,"hc-component-id":t.componentId},null,8,["hc-custom-values","hc-instance-id","hc-canvas-id","hc-component-id"]))]),_:1},8,["label"])):e.createCommentVNode("",!0)],12,wt))}});exports.parseComponentSource=t.parseComponentSource,exports.DEFAULT_CANVAS_ID=n,exports.ErrorBoundary=yt,exports.HC_CANVAS_ID_KEY=o,exports.HC_INJECT_KEY=O,exports.RuntimeBox=Ct,exports.VERSION="0.0.0-stage2b",exports.__resetLifecycleEmitter=function(){a.all.clear()},exports.__resetRegistry=function(){const e=[];for(const[t,s]of u)for(const[r,n]of s)n.__dispose(),e.push({canvasId:t,instanceId:r});u.clear(),i.value++;for(const t of e)l("instance:unmounted",t)},exports.assets=w,exports.attachScope=ht,exports.clearCompileCache=function(){E.clear()},exports.compileComponent=$,exports.createCanvasesRegistry=b,exports.createHyperCard=function(e={}){const t=e.strict??!1,s=e.libs??{},r=e.version??"v1";return{install(e){const n=Object.entries(s),o=n.filter(([,e])=>C(e)),i=n.filter(([e])=>x.has(e)),a=[`[hypercard] 已注册 ${n.length} 个 libs:`];for(const[e,t]of n)a.push(` ${e.padEnd(16)} ${k(t)}`);console.info(a.join("\n"));const l=[];o.length>1&&l.push(`检测到 ${o.length} 个 Vue plugin(${o.map(([e])=>e).join(", ")}),请确认全局组件命名不冲突`);for(const[e]of i)l.push(`lib 名 "${e}" 是保留词,建议改名`);if(l.length>0){const e=l.map(e=>` - ${e}`).join("\n");if(t)throw new Error(`[hypercard] strict mode 阻止启动:\n${e}`);console.warn(`[hypercard] 警告:\n${e}`)}for(const[s,r]of o){const[n,o]=S(r);try{e.use(n,...o)}catch(e){if(console.error(`[hypercard] app.use("${s}") 失败:`,e),t)throw e}}const c={};for(const[e,t]of n){const[s]=S(t);c[e]=s}const u={libs:c,runtime:y,assets:w,version:r,canvases:b()};e.provide(O,u),e.config.globalProperties.$hc=u,"undefined"!=typeof window&&(window.__HYPERCARD__=u)}}},exports.debugScopedCssRefs=function(){return[...at.entries()].map(([e,t])=>({scopeId:e,componentId:e,refCount:t.refCount,cssHash:t.cssHash}))},exports.detachScope=pt,exports.disposeCanvas=p,exports.getCompileCacheSize=function(){return E.size},exports.getInstance=m,exports.getScopedCssCount=function(){return at.size},exports.injectScopedCss=ut,exports.isVuePlugin=C,exports.listCanvasIds=f,exports.listInstances=g,exports.onInstanceLifecycle=function(e,t){const s=e=>{try{t(e)}catch(e){console.error("[hc-registry] instance lifecycle listener threw",e)}};return a.on(e,s),()=>a.off(e,s)},exports.register=function(e,t,s){return h(n,e,t,s)},exports.registerInCanvas=h,exports.registryVersion=i,exports.removeScopedCss=function(e){var t;null==(t=document.getElementById(ct(e)))||t.remove(),at.delete(e)},exports.runtime=y,exports.scopeCss=it,exports.unregister=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("./parseSourceEntry-UTE53-N3.cjs"),s=function(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const s in e)if("default"!==s){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}return t.default=e,Object.freeze(t)}(e);function n(e){return{all:e=e||new Map,on:function(t,s){var n=e.get(t);n?n.push(s):e.set(t,[s])},off:function(t,s){var n=e.get(t);n&&(s?n.splice(n.indexOf(s)>>>0,1):e.set(t,[]))},emit:function(t,s){var n=e.get(t);n&&n.slice().map(function(e){e(s)}),(n=e.get("*"))&&n.slice().map(function(e){e(t,s)})}}}const r=new Map;function o(e,t){return`${e}::${t}`}function i(e,t,s){const n=k(t,e);if(n)return void Object.assign(function(e){const t=e;return t._timings||(t._timings={}),t._timings}(n),s);const i=o(e,t),a=r.get(i)??{};r.set(i,{...a,...s})}function a(e,t){const s=o(e,t),n=r.get(s);return n?(r.delete(s),n):null}function l(e,t){r.delete(o(e,t))}let c=0;function u(){return c>0}const h=n(),p="__default__",f="__hcCanvasId",d=e.ref(0),m=n();function g(e,t){m.emit(e,t)}const y=new Set,w=new Map,v=n();function b(e,t,s,r){var o;const i=function(e,t){return`${e}\0${t}`}(e,t);if(y.has(i)){const s=`[hc-registry] re-entrant registerInCanvas("${e}", "${t}") detected — a lifecycle listener tried to register the same id while the outer register is in flight. Nested register blocked to prevent state divergence; defer your register via microtask / setTimeout if you need to re-mount on lifecycle events.`;throw console.warn(s),new Error(s)}y.add(i);try{const i=!w.has(e),l=function(e){let t=w.get(e);return t||(t=new Map,w.set(e,t)),t}(e);l.has(t)&&(console.warn(`[hc-registry] instance ${t} already registered in canvas "${e}", overwriting`),null==(o=l.get(t))||o.__dispose(),l.delete(t),g("instance:unmounted",{canvasId:e,instanceId:t}));const c=function(e,t,s,r){const o=n();function i(n,r,o){if(u())try{h.emit("interaction",{canvasId:e,instanceId:t,componentId:s,kind:n,key:r,args:o,timestamp:performance.now()})}catch(e){console.warn(`[hc-registry] interactionEmitter.emit threw on ${n}("${r}"); diagnostic stream broken for this event`,e)}}return{instanceId:t,componentId:s,vm:r,call(e,...s){i("call",e,s);const n=r[e];if("function"!=typeof n)throw new Error(`[hc-registry] method "${e}" not found on instance ${t}`);return n.apply(r,s)},on:(e,t)=>(o.on(e,t),()=>o.off(e,t)),emit(e,t){i("emit",e,[t]),o.emit(e,t)},setProp(e,t){i("setProp",e,[t]),r[e]=t},setDataInput(e,s){i("setDataInput",e,[s]);const n=r.custom;if(!n||!(e in n))return void console.warn(`[hc-registry] setDataInput("${e}"): vm.custom["${e}"] not declared on instance ${t}; binding 改了一个未声明的 dataInput key,组件不会响应`);const o=n[e];o&&"object"==typeof o?!0===o.dataInput?o.value=s:console.warn(`[hc-registry] setDataInput("${e}"): vm.custom["${e}"] is not declared with dataInput:true on instance ${t}; 请在组件源码 custom.${e} 上加 \`dataInput: true\` 才能被 binding 灌入`):console.warn(`[hc-registry] setDataInput("${e}"): vm.custom["${e}"] not a {value:...} slot`)},__dispose(){o.all.clear()}}}(e,t,s,r);l.set(t,c);const p=a(e,t);return p&&(c._timings={...p}),d.value++,i&&v.emit("canvas:added",{canvasId:e}),g("instance:ready",{canvasId:e,instanceId:t}),c}finally{y.delete(i)}}function x(e){const t=w.get(e);if(!t)return;const s=[];for(const[n,r]of t)r.__dispose(),s.push(n),l(e,n);t.clear(),w.delete(e),d.value++;for(const t of s)g("instance:unmounted",{canvasId:e,instanceId:t});v.emit("canvas:removed",{canvasId:e})}function C(){return[...w.keys()]}function S(e,t=p){const s=w.get(t);if(!s)return;const n=s.get(e);n&&(n.__dispose(),s.delete(e),l(t,e),d.value++,g("instance:unmounted",{canvasId:t,instanceId:e}))}function k(e,t){var s;if(void 0!==t)return(null==(s=w.get(t))?void 0:s.get(e))??null;let n=null;const r=[];for(const[t,s]of w){const o=s.get(e);o&&(n||(n=o),r.push(t))}return r.length>1&&console.warn(`[hc-registry] getInstance("${e}") matched ${r.length} canvases [${r.join(", ")}]; returning first. Prefer __HYPERCARD__.canvases.callComponent(canvasId, instanceId, ...) for explicit scope.`),n}function I(e){const t=null==e?void 0:e.componentId,s=t?e=>e.componentId===t:()=>!0;if(void 0!==(null==e?void 0:e.canvasId)){const t=w.get(e.canvasId);return t?[...t.values()].filter(s):[]}const n=[];for(const e of w.values())for(const t of e.values())s(t)&&n.push(t);return n}const O={getInstance:k,listInstances:I,call(e,t,...s){const n=k(e);if(n)return n.call(t,...s);console.debug(`[hc-runtime] call: instance "${e}" not found`)},on(e,t,s){const n=k(e);if(n)return n.on(t,s);console.debug(`[hc-runtime] on: instance "${e}" not found`)},emit(e,t,s){const n=k(e);n?n.emit(t,s):console.debug(`[hc-runtime] emit: instance "${e}" not found`)}},E={pickerUrl:e=>`/a/${e}`};function A(e){return{canvasId:e,listInstances:t=>I({canvasId:e,componentId:null==t?void 0:t.componentId}),getInstance:t=>k(t,e),call(t,s,...n){const r=k(t,e);if(r)try{return r.call(s,...n)}catch(n){return void console.warn(`[hc-canvases] call error: canvas="${e}" instance="${t}" method="${s}":`,n)}else console.warn(`[hc-canvases] call: instance "${t}" not found in canvas "${e}"`)},emit(t,s,n){const r=k(t,e);if(r)try{r.emit(s,n)}catch(n){console.warn(`[hc-canvases] emit error: canvas="${e}" instance="${t}" event="${s}":`,n)}else console.warn(`[hc-canvases] emit: instance "${t}" not found in canvas "${e}"`)},broadcastInCanvas(t,s){const n=I({canvasId:e});for(const r of n)try{r.emit(t,s)}catch(s){console.warn(`[hc-canvases] broadcastInCanvas: canvas="${e}" instance="${r.instanceId}" event="${t}" emit failed:`,s)}},dispose(){x(e)}}}function P(){return{list:()=>C().map(e=>A(e)),get:e=>C().includes(e)?A(e):null,getAll(){const e={};for(const t of C())e[t]=A(t);return e},callComponent(e,t,s,...n){const r=k(t,e);if(r)try{return r.call(s,...n)}catch(n){return void console.warn(`[hc-canvases] callComponent error: canvas="${e}" instance="${t}" method="${s}":`,n)}else console.warn(`[hc-canvases] callComponent: canvas="${e}" instance="${t}" not found`)},emitToCanvas(e,t,s,n){const r=k(t,e);if(r)try{r.emit(s,n)}catch(n){console.warn(`[hc-canvases] emitToCanvas error: canvas="${e}" instance="${t}" event="${s}":`,n)}else console.warn(`[hc-canvases] emitToCanvas: canvas="${e}" instance="${t}" not found`)},broadcast(e,t){for(const s of C())try{const n=I({canvasId:s});for(const r of n)try{r.emit(e,t)}catch(t){console.warn(`[hc-canvases] broadcast: canvas="${s}" instance="${r.instanceId}" event="${e}" emit failed:`,t)}}catch(t){console.warn(`[hc-canvases] broadcast: canvas="${s}" event="${e}" failed:`,t)}}}}const $=new Set(["vue","Vue","window","global","globalThis","console","document","process","$","libs","runtime","assets","version"]);function _(e){return Array.isArray(e)&&e.length>=1?_(e[0]):"object"==typeof e&&null!==e&&"function"==typeof e.install}function R(e){return Array.isArray(e)&&e.length>=1?[e[0],e.slice(1)]:[e,[]]}function j(e){return _(e)?Array.isArray(e)?"✓ Vue plugin (with options) → 已 app.use":"✓ Vue plugin → 已 app.use":"function"==typeof e?"· function":Array.isArray(e)?"· array":"object"==typeof e&&null!==e?"· object":"· "+typeof e}const M="__HYPERCARD__",B=new Set(["init","onClick","onMouseover","onMouseout","onResize","onDestroy"]),D=new Map;function U(e,t){for(D.has(e)&&D.delete(e),D.set(e,t);D.size>100;){const e=D.keys().next().value;if(void 0===e)break;D.delete(e)}}function z(e){let t=5381;for(let s=0;s<e.length;s++)t=(t<<5)+t+e.charCodeAt(s)|0;return(t>>>0).toString(36)}function L(e){if(!Array.isArray(e))return[];const t=[];for(const s of e){if(!s||"object"!=typeof s)continue;const e=s;if("string"!=typeof e.name)continue;const n={name:e.name};"boolean"==typeof e.multiple&&(n.multiple=e.multiple),Array.isArray(e.accepts)&&(n.accepts=e.accepts.filter(e=>"string"==typeof e)),"number"==typeof e.maxChildren&&(n.maxChildren=e.maxChildren),"string"==typeof e.label&&(n.label=e.label),t.push(n)}return t}async function F(e){const n=z(e.html)+"_"+z(e.js),r=D.get(n);if(r)return U(n,r),r;const o=(async()=>function(e,t){if(!e||"object"!=typeof e)throw new Error("[hc-compile] component.js must `export default` an object");const n=e,r=n.name,o=n.method??{},a=n.attribute??{},l=n.custom??{},c=n.style??{},u=n.slots,h=n.data,p=n.methods??{},f=n.computed,d=n.watch,m=n.created,g=n.mounted,y=n.beforeUnmount,w=n.props,v=new Set(["name","method","attribute","custom","style","option","data","methods","computed","watch","created","mounted","beforeUnmount","props","slots"]),x={};for(const e of Object.keys(n))v.has(e)||(x[e]=n[e]);const C={};for(const[e,t]of Object.entries(o))B.has(e)||"function"!=typeof t||(C[e]=t);const k=Object.keys(C),I={...C,...p},O=(t??"").trim()||"<div></div>";return{options:{render:s.compile(O),props:{...w?Array.isArray(w)?Object.fromEntries(w.map(e=>[e,null])):"object"==typeof w?w:{}:{},hcCustomValues:{type:Object,default:()=>({})},hcInstanceId:{type:String,default:""},hcCanvasId:{type:String,default:""},hcComponentId:{type:String,default:""}},data(){const e="function"==typeof h?h.call(this):h??{},t=this.hcCustomValues??{},s={};for(const[e,n]of Object.entries(l)){let r;try{r=JSON.parse(JSON.stringify(n??{}))}catch{r={...n??{}}}e in t&&r&&"object"==typeof r&&(r.value=t[e]),s[e]=r}return{custom:s,...e}},methods:I,computed:f,watch:(()=>{const e=d&&"object"==typeof d?{...d}:{};return e.hcCustomValues={handler(e){if(e&&this.custom)for(const[t,s]of Object.entries(e)){const e=this.custom[t];e&&"object"==typeof e&&(e.value=s)}},deep:!0},e})(),created(){this.hcInstanceId&&this.hcCanvasId&&b(this.hcCanvasId,this.hcInstanceId,this.hcComponentId,this),"function"==typeof m&&m.call(this)},mounted(){try{const e=[],t=this.$el;if(t&&t instanceof HTMLElement){Object.assign(t.style,c);for(const[e,s]of Object.entries(a))"string"==typeof s&&s&&t.setAttribute(e,s);for(const s of B){if("init"===s)continue;const n=o[s];if("function"==typeof n){const r=s.replace(/^on/,"").toLowerCase(),o=e=>{n.call(this,{event:e,data:e})};t.addEventListener(r,o),e.push(()=>t.removeEventListener(r,o))}}}this.__hcCleanup=e;const s=o.init;"function"==typeof s&&s.call(this),"function"==typeof g&&g.call(this)}finally{const e=this.hcInstanceId,t=this.hcCanvasId;"string"==typeof e&&e.length>0&&"string"==typeof t&&t.length>0&&i(t,e,{mountEndedAt:performance.now()})}},beforeUnmount(){var e;this.hcInstanceId&&this.hcCanvasId&&S(this.hcInstanceId,this.hcCanvasId),null==(e=this.__hcCleanup)||e.forEach(e=>{try{e()}catch{}}),this.__hcCleanup=void 0,"function"==typeof y&&y.call(this)},...x},meta:{name:r,attribute:a,style:c,customDecl:l,methodNames:k,slotsDecl:L(u)}}}(function(e){let s;try{const n=t.parse(e,{ecmaVersion:"latest",sourceType:"module",allowAwaitOutsideFunction:!0}).body.find(e=>"ExportDefaultDeclaration"===e.type);if(!n)throw new Error("[hc-compile] component.js must `export default` an object");s=e.slice(0,n.start)+"module.exports = "+e.slice(n.declaration.start)}catch(e){throw e instanceof Error?e:new Error(String(e))}const n=new Function("module","exports",`"use strict";\n${s}\n;return module.exports;`),r={exports:{}};try{return n(r,r.exports)}catch(e){throw e instanceof Error?e:new Error(String(e))}}(e.js),e.html))();return U(n,o),o.catch(()=>D.delete(n)),o}var N,V={exports:{}};const T=function(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var s=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),s}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var W,H,J,Y,G,q;function K(){if(H)return W;H=1;let e=function(){if(N)return V.exports;N=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return V.exports=t(),V.exports.createColors=t,V.exports}(),t=T;class s extends Error{constructor(e,t,n,r,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),r&&(this.source=r),i&&(this.plugin=i),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,s)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(s){if(!this.source)return"";let n=this.source;null==s&&(s=e.isColorSupported);let r=e=>e,o=e=>e,i=e=>e;if(s){let{bold:s,gray:n,red:a}=e.createColors(!0);o=e=>s(a(e)),r=e=>n(e),t&&(i=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let s=l+1+t,n=" "+(" "+s).slice(-u)+" | ";if(s===this.line){if(e.length>160){let t=20,s=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(s,a),c=r(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return o(">")+r(n)+i(l)+"\n "+c+o("^")}let t=r(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return o(">")+r(n)+i(e)+"\n "+t+o("^")}return" "+r(n)+i(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return W=s,s.default=s,W}function Z(){if(Y)return J;Y=1;const e=/(<)(\/?style\b)/gi,t=/(<)(!--)/g;function s(s){return"string"!=typeof s?s:s.includes("<")?s.replace(e,"\\3c $2").replace(t,"\\3c $2"):s}const n={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class r{constructor(e){this.builder=e}atrule(e,t){let n=e.raws,r="@"+e.name,o=e.params?this.rawValue(e,"params"):"";if(void 0!==n.afterName?r+=n.afterName:o&&(r+=" "),e.nodes)this.block(e,r+o);else{let i=(n.between||"")+(t?";":"");this.builder(s(r+o+i),e)}}beforeAfter(e,t){let s;s="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,r=0;for(;n&&"root"!==n.type;)r+=1,n=n.parent;if(s.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<r;e++)s+=t}return s}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(s(t+r)+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(s(n)),this.builder("}",e,"end")}body(e){let t=e.nodes,n=t.length-1;for(;n>0&&"comment"===t[n].type;)n-=1;let r=this.raw(e,"semicolon"),o="document"===e.type;for(let e=0;e<t.length;e++){let i=t[e],a=this.raw(i,"before");a&&this.builder(o?a:s(a)),this.stringify(i,n!==e||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder(s("/*"+t+e.text+n+"*/"),e)}decl(e,t){let n=e.raws,r=this.raw(e,"between","colon"),o=e.prop+r+this.rawValue(e,"value");e.important&&(o+=n.important||" !important"),t&&(o+=";"),this.builder(s(o),e)}document(e){this.body(e)}raw(e,t,s){let r;if(s||(s=t),t&&(r=e.raws[t],void 0!==r))return r;let o=e.parent;if("before"===s){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}if(!o)return n[s];let i=e.root(),a=i.rawCache||(i.rawCache={});if(void 0!==a[s])return a[s];if("before"===s||"after"===s)return this.beforeAfter(e,s);{let n="raw"+((l=s)[0].toUpperCase()+l.slice(1));this[n]?r=this[n](i,e):i.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var l;return void 0===r&&(r=n[s]),a[s]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let s;return e.walkComments(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(e,t){let s;return e.walkDecls(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(s=>{if(s.nodes&&(s.parent!==e||e.first!==s)&&void 0!==s.raws.before)return t=s.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(s=>{let n=s.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==s.raws.before){let e=s.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let s=e[t],n=e.raws[t];return n&&n.value===s?n.raw:s}root(e){if(this.body(e),e.raws.after){let t=e.raws.after,n=e.parent&&"document"===e.parent.type;this.builder(n?t:s(t))}}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(s(e.raws.ownSemicolon),e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}return J=r,r.default=r,J}function Q(){if(q)return G;q=1;let e=Z();function t(t,s){new e(s).stringify(t)}return G=t,t.default=t,G}var X,ee,te,se,ne,re,oe,ie,ae,le,ce,ue,he,pe,fe,de,me,ge,ye,we,ve,be,xe,Ce,Se,ke,Ie,Oe,Ee,Ae,Pe,$e,_e,Re,je,Me,Be,De,Ue,ze,Le,Fe,Ne,Ve,Te,We,He,Je,Ye,Ge={};function qe(){return X||(X=1,Ge.isClean=Symbol("isClean"),Ge.my=Symbol("my")),Ge}function Ke(){if(te)return ee;te=1;let e=K(),t=Z(),s=Q(),{isClean:n,my:r}=qe();function o(e,t){let s=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let r=e[n],i=typeof r;"parent"===n&&"object"===i?t&&(s[n]=t):"source"===n?s[n]=r:Array.isArray(r)?s[n]=r.map(e=>o(e,s)):("object"===i&&null!==r&&(r=o(r)),s[n]=r)}return s}function i(e,t){if(t&&void 0!==t.offset)return t.offset;let s=1,n=1,r=0;for(let o=0;o<e.length;o++){if(n===t.line&&s===t.column){r=o;break}"\n"===e[o]?(s=1,n+=1):s+=1}return r}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[r]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let s of e[t])"function"==typeof s.clone?this.append(s.clone()):this.append(s)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=o(this);for(let s in e)t[s]=e[s];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(t,s={}){if(this.source){let{end:e,start:n}=this.rangeBy(s);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},s)}return new e(t)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let s="document"in this.source.input?this.source.input.document:this.source.input.css,n=s.slice(i(s,this.source.start),i(s,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,s=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,r=i(n,this.source.start),o=r+e;for(let e=r;e<o;e++)"\n"===n[e]?(t=1,s+=1):t+=1;return{column:t,line:s,offset:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,s={column:this.source.start.column,line:this.source.start.line,offset:i(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:i(t,this.source.end)+1}:{column:s.column+1,line:s.line,offset:s.offset+1};if(e.word){let r=t.slice(i(t,this.source.start),i(t,this.source.end)).indexOf(e.word);-1!==r&&(s=this.positionInside(r),n=this.positionInside(r+e.word.length))}else e.start?s={column:e.start.column,line:e.start.line,offset:i(t,e.start)}:e.index&&(s=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:i(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<s.line||n.line===s.line&&n.column<=s.column)&&(n={column:s.column+1,line:s.line,offset:s.offset+1}),{end:n,start:s}}raw(e,s){return(new t).raw(this,e,s)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,s=!1;for(let n of e)n===this?s=!0:s?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);s||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let s={},n=null==t;t=t||new Map;let r=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))s[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)s[e]=n.toJSON(null,t);else if("source"===e){if(null==n)continue;let o=t.get(n.input);null==o&&(o=r,t.set(n.input,r),r++),s[e]={end:n.end,inputId:o,start:n.start}}else s[e]=n}return n&&(s.inputs=[...t.keys()].map(e=>e.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=s){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,s={}){let n={node:this};for(let e in s)n[e]=s[e];return e.warn(t,n)}}return ee=a,a.default=a,ee}function Ze(){if(ne)return se;ne=1;let e=Ke();class t extends e{constructor(e){super(e),this.type="comment"}}return se=t,t.default=t,se}function Qe(){if(oe)return re;oe=1;let e=Ke();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return re=t,t.default=t,re}function Xe(){if(ae)return ie;ae=1;let e,t,s,n,r=Ze(),o=Qe(),i=Ke(),{isClean:a,my:l}=qe();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends i{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,s,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],s=e(this.proxyOf.nodes[t],t),!1!==s);)this.indexes[n]+=1;return delete this.indexes[n],s}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...s)=>e[t](...s.map(e=>"function"==typeof e?(t,s)=>e(t.toProxy(),s):e)):"every"===t||"some"===t?s=>e[t]((e,...t)=>s(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let s,n=this.index(e),r=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of r)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)s=this.indexes[e],n<s&&(this.indexes[e]=s+r.length);return this.markDirty(),this}insertBefore(e,t){let s,n=this.index(e),r=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],r).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)s=this.indexes[e],n<=s&&(this.indexes[e]=s+o.length);return this.markDirty(),this}normalize(s,i){if("string"==typeof s)s=c(t(s).nodes);else if(void 0===s)s=[];else if(Array.isArray(s)){s=s.slice(0);for(let e of s)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===s.type&&"document"!==this.type){s=s.nodes.slice(0);for(let e of s)e.parent&&e.parent.removeChild(e,"ignore")}else if(s.type)s=[s];else if(s.prop){if(void 0===s.value)throw new Error("Value field is missed in node creation");"string"!=typeof s.value&&(s.value=String(s.value)),s=[new o(s)]}else if(s.selector||s.selectors)s=[new n(s)];else if(s.name)s=[new e(s)];else{if(!s.text)throw new Error("Unknown node type in node creation");s=[new r(s)]}return s.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&i&&void 0!==i.raws.before&&(e.raws.before=i.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let s in this.indexes)t=this.indexes[s],t>=e&&(this.indexes[s]=t-1);return this.markDirty(),this}replaceValues(e,t,s){return s||(s=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,s))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,s)=>{let n;try{n=e(t,s)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((s,n)=>{if("atrule"===s.type&&e.test(s.name))return t(s,n)}):this.walk((s,n)=>{if("atrule"===s.type&&s.name===e)return t(s,n)}):(t=e,this.walk((e,s)=>{if("atrule"===e.type)return t(e,s)}))}walkComments(e){return this.walk((t,s)=>{if("comment"===t.type)return e(t,s)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((s,n)=>{if("decl"===s.type&&e.test(s.prop))return t(s,n)}):this.walk((s,n)=>{if("decl"===s.type&&s.prop===e)return t(s,n)}):(t=e,this.walk((e,s)=>{if("decl"===e.type)return t(e,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((s,n)=>{if("rule"===s.type&&e.test(s.selector))return t(s,n)}):this.walk((s,n)=>{if("rule"===s.type&&s.selector===e)return t(s,n)}):(t=e,this.walk((e,s)=>{if("rule"===e.type)return t(e,s)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{s=e},ie=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,o.prototype):"comment"===t.type?Object.setPrototypeOf(t,r.prototype):"root"===t.type&&Object.setPrototypeOf(t,s.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},ie}function et(){if(ce)return le;ce=1;let e=Xe();class t extends e{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return le=t,t.default=t,e.registerAtRule(t),le}function tt(){if(he)return ue;he=1;let e,t,s=Xe();class n extends s{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(s={}){return new e(new t,this,s).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},ue=n,n.default=n,ue}function st(){if(me)return de;me=1;let{existsSync:e,readFileSync:t}=T,{dirname:s,join:n}=T,{SourceMapConsumer:r,SourceMapGenerator:o}=T;class i{constructor(e,t){if(!1===t.map)return;t.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=s(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new r(this.json||this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let s=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(s)return n=e.substr(s[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let r=e.slice(22);throw r=r.slice(0,r.indexOf(",")),new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let s=e.lastIndexOf(t.pop()),n=e.indexOf("*/",s);s>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(s,n)))}loadFile(n,r,o){if(o||this.unsafeMap||/\.map$/i.test(n))return this.root=s(n),e(n)?(this.mapFile=n,t(n,"utf-8").toString().trim()):void 0}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof r)return o.fromSourceMap(t).toString();if(t instanceof o)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let s=t(e);if(s){let t=this.loadFile(s,e,!0);if(!t)throw new Error("Unable to load previous source map: "+s.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;e&&(t=n(s(e),t));let r=this.loadFile(t,e,!1);if(r)try{this.json=JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return r}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return de=i,i.default=i,de}function nt(){if(ye)return ge;ye=1;let{nanoid:e}=fe?pe:(fe=1,pe={nanoid:(e=21)=>{let t="",s=0|e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(s=t)=>{let n="",r=0|s;for(;r--;)n+=e[Math.random()*e.length|0];return n}}),{isAbsolute:t,resolve:s}=T,{SourceMapConsumer:n,SourceMapGenerator:r}=T,{fileURLToPath:o,pathToFileURL:i}=T,a=K(),l=st(),c=T,u=Symbol("lineToIndexCache"),h=Boolean(n&&r),p=Boolean(s&&t);function f(e){if(e[u])return e[u];let t=e.css.split("\n"),s=new Array(t.length),n=0;for(let e=0,r=t.length;e<r;e++)s[e]=n,n+=t[e].length+1;return e[u]=s,s}class d{get from(){return this.file||this.id}constructor(n,r={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,r.document&&(this.document=r.document.toString()),r.from&&(!p||/^\w+:\/\//.test(r.from)||t(r.from)?this.file=r.from:this.file=s(r.from)),p&&h){let e=new l(this.css,r);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,s,n={}){let r,o,l,c,u;if(t&&"object"==typeof t){let e=t,n=s;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,s=n.col}else t=e.line,s=e.column,c=this.fromLineAndColumn(t,s);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);o=e.line,r=e.col}else o=n.line,r=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(s)c=this.fromLineAndColumn(t,s);else{c=t;let e=this.fromOffset(c);t=e.line,s=e.col}let h=this.origin(t,s,o,r);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===o?t:{column:s,line:t},void 0===o?s:{column:r,line:o},this.css,this.file,n.plugin),u.input={column:s,endColumn:r,endLine:o,endOffset:l,line:t,offset:c,source:this.css},this.file&&(i&&(u.input.url=i(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return f(this)[e-1]+t-1}fromOffset(e){let t=f(this),s=0;if(e>=t[t.length-1])s=t.length-1;else{let n,r=t.length-2;for(;s<r;)if(n=s+(r-s>>1),e<t[n])r=n-1;else{if(!(e>=t[n+1])){s=n;break}s=n+1}}return{col:e-t[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:s(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,s,n,r){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:s,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:r,line:n})),l=t(u.source)?i(u.source):new URL(u.source,this.map.consumer().sourceRoot||i(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!o)throw new Error("file: protocol is not available in this PostCSS build");h.file=o(l)}let p=c.sourceContentFor(u.source);return p&&(h.source=p),h}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}}return ge=d,d.default=d,c&&c.registerInput&&c.registerInput(d),ge}function rt(){if(ve)return we;ve=1;let e,t,s=Xe();class n extends s{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,s){let n=super.normalize(e);if(t)if("prepend"===s)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let s=this.index(e);return!t&&0===s&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(e)}toResult(s={}){return new e(new t,this,s).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},we=n,n.default=n,s.registerRoot(n),we}function ot(){if(xe)return be;xe=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,s){let n=[],r="",o=!1,i=0,a=!1,l="",c=!1;for(let s of e)c?c=!1:"\\"===s?c=!0:a?s===l&&(a=!1):'"'===s||"'"===s?(a=!0,l=s):"("===s?i+=1:")"===s?i>0&&(i-=1):0===i&&t.includes(s)&&(o=!0),o?(""!==r&&n.push(r.trim()),r="",o=!1):r+=s;return(s||""!==r)&&n.push(r.trim()),n}};return be=e,e.default=e,be}function it(){if(Se)return Ce;Se=1;let e=Xe(),t=ot();class s extends e{get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,s=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(s)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return Ce=s,s.default=s,e.registerRule(s),Ce}function at(){if(Ee)return Oe;Ee=1;let{dirname:e,relative:t,resolve:s,sep:n}=T,{SourceMapConsumer:r,SourceMapGenerator:o}=T,{pathToFileURL:i}=T,a=nt(),l=Boolean(r&&o),c=Boolean(e&&s&&t&&n);return Oe=class{constructor(e,t,s,n){this.stringify=e,this.mapOpts=s.map||{},this.root=t,this.opts=s,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let s,n=this.toUrl(this.path(t.file)),o=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(s=new r(t.text),s.sourcesContent&&(s.sourcesContent=null)):s=t.consumer(),this.map.applySourceMap(s,n,this.toUrl(this.path(o)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else if(this.css){let e;for(;-1!==(e=this.css.lastIndexOf("/*#"));){let t=this.css.indexOf("*/",e+3);if(-1===t)break;for(;e>0&&"\n"===this.css[e-1];)e--;this.css=this.css.slice(0,e)+this.css.slice(t+2)}}}generate(){if(this.clearAnnotation(),c&&l&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=o.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new o({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new o({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,s=1,n=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=s,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),t=o.match(/\n/g),t?(s+=t.length,e=o.lastIndexOf("\n"),n=o.length-e):n+=o.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=s,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=s,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let r=this.memoizedPaths.get(n);if(r)return r;let o=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=e(s(o,this.mapOpts.annotation)));let i=t(o,n);return this.memoizedPaths.set(n,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new a(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let s=t.source.input.from;if(s&&!e[s]){e[s]=!0;let n=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(i){let t=i(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===n&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}}}function lt(){if(je)return Re;je=1;let e=Xe(),t=nt(),s=function(){if(_e)return $e;_e=1;let e=et(),t=Ze(),s=Qe(),n=rt(),r=it(),o=function(){if(Pe)return Ae;Pe=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),s="\\".charCodeAt(0),n="/".charCodeAt(0),r="\n".charCodeAt(0),o=" ".charCodeAt(0),i="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),p=")".charCodeAt(0),f="{".charCodeAt(0),d="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),y=":".charCodeAt(0),w="@".charCodeAt(0),v=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,x=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Ae=function(S,k={}){let I,O,E,A,P,$,_,R,j,M,B=S.css.valueOf(),D=k.ignoreErrors,U=B.length,z=0,L=[],F=[],N=-1;function V(e){throw S.error("Unclosed "+e,z)}return{back:function(e){F.push(e)},endOfFile:function(){return 0===F.length&&z>=U},nextToken:function(S){if(F.length)return F.pop();if(z>=U)return;let k=!!S&&S.ignoreUnclosed;switch(I=B.charCodeAt(z),I){case r:case o:case a:case l:case i:A=z;do{A+=1,I=B.charCodeAt(A)}while(I===o||I===r||I===a||I===l||I===i);$=["space",B.slice(z,A)],z=A-1;break;case c:case u:case f:case d:case y:case m:case p:{let e=String.fromCharCode(I);$=[e,e,z];break}case h:if(M=L.length?L.pop()[1]:"",j=B.charCodeAt(z+1),"url"===M&&j!==e&&j!==t&&j!==o&&j!==r&&j!==a&&j!==i&&j!==l){A=z;do{if(_=!1,A=B.indexOf(")",A+1),-1===A){if(D||k){A=z;break}V("bracket")}for(R=A;B.charCodeAt(R-1)===s;)R-=1,_=!_}while(_);$=["brackets",B.slice(z,A+1),z,A],z=A}else z<=N?$=["(","(",z]:(A=B.indexOf(")",z+1),O=B.slice(z,A+1),-1===A||x.test(O)?(N=-1===A?U:A,$=["(","(",z]):($=["brackets",O,z,A],z=A));break;case e:case t:P=I===e?"'":'"',A=z;do{if(_=!1,A=B.indexOf(P,A+1),-1===A){if(D||k){A=z+1;break}V("string")}for(R=A;B.charCodeAt(R-1)===s;)R-=1,_=!_}while(_);$=["string",B.slice(z,A+1),z,A],z=A;break;case w:v.lastIndex=z+1,v.test(B),A=0===v.lastIndex?B.length-1:v.lastIndex-2,$=["at-word",B.slice(z,A+1),z,A],z=A;break;case s:for(A=z,E=!0;B.charCodeAt(A+1)===s;)A+=1,E=!E;if(I=B.charCodeAt(A+1),E&&I!==n&&I!==o&&I!==r&&I!==a&&I!==l&&I!==i&&(A+=1,C.test(B.charAt(A)))){for(;C.test(B.charAt(A+1));)A+=1;B.charCodeAt(A+1)===o&&(A+=1)}$=["word",B.slice(z,A+1),z,A],z=A;break;default:I===n&&B.charCodeAt(z+1)===g?(A=B.indexOf("*/",z+2)+1,0===A&&(D||k?A=B.length:V("comment")),$=["comment",B.slice(z,A+1),z,A],z=A):(b.lastIndex=z+1,b.test(B),A=0===b.lastIndex?B.length-1:b.lastIndex-2,$=["word",B.slice(z,A+1),z,A],L.push($),z=A)}return z++,$},position:function(){return z}}}}();const i={empty:!0,space:!0};return $e=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let s,n,r,o=new e;o.name=t[1].slice(1),""===o.name&&this.unnamedAtrule(o,t),this.init(o,t[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(s=(t=this.tokenizer.nextToken())[0],"("===s||"["===s?c.push("("===s?")":"]"):"{"===s&&c.length>0?c.push("}"):s===c[c.length-1]&&c.pop(),0===c.length){if(";"===s){o.source.end=this.getPosition(t[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===s){a=!0;break}if("}"===s){if(l.length>0){for(r=l.length-1,n=l[r];n&&"space"===n[0];)n=l[--r];n&&(o.source.end=this.getPosition(n[3]||n[2]),o.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),i&&(t=l[l.length-1],o.source.end=this.getPosition(t[3]||t[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let s,n=0;for(let r=t-1;r>=0&&(s=e[r],"space"===s[0]||(n+=1,2!==n));r--);throw this.input.error("Missed semicolon","word"===s[0]?s[3]+1:s[2])}colon(e){let t,s,n,r=0;for(let[o,i]of e.entries()){if(s=i,n=s[0],"("===n&&(r+=1),")"===n&&(r-=1),0===r&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return o}this.doubleColon(s)}t=s}return!1}comment(e){let s=new t;this.init(s,e[2]),s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++;let n=e[1].slice(2,-2);if(n.trim()){let e=n.match(/^(\s*)([^]*\S)(\s*)$/);s.text=e[2],s.raws.left=e[1],s.raws.right=e[3]}else s.text="",s.raws.left=n,s.raws.right=""}createTokenizer(){this.tokenizer=o(this.input)}decl(e,t){let n=new s;this.init(n,e[0][2]);let r,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let s=e[t],n=s[3]||s[2];if(n)return n}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,a=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let s=this.stringFrom(e,t);s=this.spacesFromEnd(e)+s," !important"!==s&&(n.raws.important=s);break}if("important"===r[1].toLowerCase()){let s=e.slice(0),r="";for(let e=t;e>0;e--){let t=s[e][0];if(r.trim().startsWith("!")&&"space"!==t)break;r=s.pop()[1]+r}r.trim().startsWith("!")&&(n.important=!0,n.raws.important=r,e=s)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new r;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,s=null,n=!1,r=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(s=l[0],a.push(l),"("===s||"["===s)r||(r=l),o.push("("===s?")":"]");else if(i&&n&&"{"===s)r||(r=l),o.push("}");else if(0===o.length){if(";"===s){if(n)return void this.decl(a,i);break}if("{"===s)return void this.rule(a);if("}"===s){this.tokenizer.back(a.pop()),t=!0;break}":"===s&&(n=!0)}else s===o[o.length-1]&&(o.pop(),0===o.length&&(r=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(r),t&&n){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,s,n){let r,o,a,l,c=s.length,u="",h=!0;for(let e=0;e<c;e+=1)r=s[e],o=r[0],"space"!==o||e!==c-1||n?"comment"===o?(l=s[e-1]?s[e-1][0]:"empty",a=s[e+1]?s[e+1][0]:"empty",i[l]||i[a]||","===u.slice(-1)?h=!1:u+=r[1]):u+=r[1]:h=!1;if(!h){let n=s.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new r;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)s=e.pop()[1]+s;return s}spacesAndCommentsFromStart(e){let t,s="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)s+=e.shift()[1];return s}spacesFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)s=e.pop()[1]+s;return s}stringFrom(e,t){let s="";for(let n=t;n<e.length;n++)s+=e[n][1];return e.splice(t,e.length-t),s}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}}();function n(e,n){let r=new t(e,n),o=new s(r);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return Re=n,n.default=n,e.registerParse(n),Re}function ct(){if(Be)return Me;Be=1;class e{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return Me=e,e.default=e,Me}function ut(){if(Ue)return De;Ue=1;let e=ct();class t{get content(){return this.css}constructor(e,t,s){this.processor=e,this.messages=[],this.root=t,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(t,s={}){s.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(s.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,s);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}}return De=t,t.default=t,De}function ht(){if(Le)return ze;Le=1;let e={};return ze=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function pt(){if(Ne)return Fe;Ne=1;let e=Xe(),t=tt(),s=at(),n=lt(),r=ut(),o=rt(),i=Q(),{isClean:a,my:l}=qe(),c=ht();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},p={Once:!0,postcssPlugin:!0,prepare:!0};function f(e){return"object"==typeof e&&"function"==typeof e.then}function d(e){let t=!1,s=u[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[s,s+"-"+t,0,s+"Exit",s+"Exit-"+t]:t?[s,s+"-"+t,s+"Exit",s+"Exit-"+t]:e.append?[s,0,s+"Exit"]:[s,s+"Exit"]}function m(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:d(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let y={};class w{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(t,s,o){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof s||null===s||"root"!==s.type&&"document"!==s.type)if(s instanceof w||s instanceof r)i=g(s.root),s.map&&(void 0===o.map&&(o.map={}),o.map.inline||(o.map.inline=!1),o.map.prev=s.map);else{let t=n;o.syntax&&(t=o.syntax.parse),o.parser&&(t=o.parser),t.parse&&(t=t.parse);try{i=t(s,o)}catch(e){this.processed=!0,this.error=e}i&&!i[l]&&e.rebuild(i)}else i=g(s);this.result=new r(t,i,o),this.helpers={...y,postcss:y,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let s=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(s.postcssVersion&&"production"!==process.env.NODE_ENV){let e=s.postcssPlugin,t=s.postcssVersion,n=this.result.processor.version,r=t.split("."),o=n.split(".");(r[0]!==o[0]||parseInt(r[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=s.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,s)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,s])};for(let t of this.plugins)if("object"==typeof t)for(let s in t){if(!h[s]&&/^[A-Z]/.test(s))throw new Error(`Unknown event ${s} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p[s])if("object"==typeof t[s])for(let n in t[s])e(t,"*"===n?s:s+"-"+n.toLowerCase(),t[s][n]);else"function"==typeof t[s]&&e(t,s,t[s])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],s=this.runOnRoot(t);if(f(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(f(e))try{await e}catch(e){let s=t[t.length-1].node;throw this.handleError(e,s)}}}if(this.listeners.OnceExit)for(let[t,s]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>s(e,this.helpers));await Promise.all(t)}else await s(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return f(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=i;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=this.result.root.source;if(void 0===e.map&&!(n&&n.input&&n.input.map)){let e="";return t(this.result.root,t=>{e+=t}),this.result.css=e,this.result}let r=new s(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(f(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[s,n]of e){let e;this.result.lastPlugin=s;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(f(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:s,visitors:n}=t;if("root"!==s.type&&"document"!==s.type&&!s.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,r]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return r(s.toProxy(),this.helpers)}catch(e){throw this.handleError(e,s)}}if(0!==t.iterator){let n,r=t.iterator;for(;n=s.nodes[s.indexes[r]];)if(s.indexes[r]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete s.indexes[r]}let r=t.events;for(;t.eventIndex<r.length;){let e=r[t.eventIndex];if(t.eventIndex+=1,0===e)return void(s.nodes&&s.nodes.length&&(s[a]=!0,t.iterator=s.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=d(e);for(let s of t)if(0===s)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[s];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return w.registerPostcss=e=>{y=e},Fe=w,w.default=w,o.registerLazyResult(w),t.registerLazyResult(w),Fe}const ft=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(function(){if(Ye)return Je;Ye=1;let e=et(),t=Ze(),s=Xe(),n=K(),r=Qe(),o=tt(),i=function(){if(Ie)return ke;Ie=1;let e=et(),t=Ze(),s=Qe(),n=nt(),r=st(),o=rt(),i=it();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:r.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new s(h);if("rule"===h.type)return new i(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return ke=a,a.default=a,ke}(),a=nt(),l=pt(),c=ot(),u=Ke(),h=lt(),p=function(){if(He)return We;He=1;let e=tt(),t=pt(),s=function(){if(Te)return Ve;Te=1;let e=at(),t=lt(),s=ut(),n=Q(),r=ht();class o{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,s=t;try{e=s(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,r,o){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=o,this._map=void 0;let i=n;this.result=new s(this._processor,void 0,this._opts),this.result.css=r;let a=this;Object.defineProperty(this.result,"root",{get:()=>a.root});let l=new e(i,void 0,this._opts,r);if(l.isMap()){let[e,t]=l.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}}return Ve=o,o.default=o,Ve}(),n=rt();class r{constructor(e=[]){this.version="8.5.14",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let s of e)if(!0===s.postcss?s=s():s.postcss&&(s=s.postcss),"object"==typeof s&&Array.isArray(s.plugins))t=t.concat(s.plugins);else if("object"==typeof s&&s.postcssPlugin)t.push(s);else if("function"==typeof s)t.push(s);else{if("object"!=typeof s||!s.parse&&!s.stringify)throw new Error(s+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new s(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return We=r,r.default=r,n.registerProcessor(r),e.registerProcessor(r),We}(),f=ut(),d=rt(),m=it(),g=Q(),y=ct();function w(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new p(e)}return w.plugin=function(e,t){let s,n=!1;function r(...s){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let r=t(...s);return r.postcssPlugin=e,r.postcssVersion=(new p).version,r}return Object.defineProperty(r,"postcss",{get:()=>(s||(s=r()),s)}),r.process=function(e,t,s){return w([r(s)]).process(e,t)},r},w.stringify=g,w.parse=h,w.fromJSON=i,w.list=c,w.comment=e=>new t(e),w.atRule=t=>new e(t),w.decl=e=>new r(e),w.rule=e=>new m(e),w.root=e=>new d(e),w.document=e=>new o(e),w.CssSyntaxError=n,w.Declaration=r,w.Container=s,w.Processor=p,w.Document=o,w.Comment=t,w.Warning=y,w.AtRule=e,w.Result=f,w.Input=a,w.Rule=m,w.Root=d,w.Node=u,l.registerPostcss(w),Je=w,w.default=w,Je}());ft.stringify,ft.fromJSON,ft.plugin,ft.parse,ft.list,ft.document,ft.comment,ft.atRule,ft.rule,ft.decl,ft.root,ft.CssSyntaxError,ft.Declaration,ft.Container,ft.Processor,ft.Document,ft.Comment,ft.Warning,ft.AtRule,ft.Result,ft.Input,ft.Rule,ft.Root,ft.Node;const dt=new Set(["body","html",":root","*"]);function mt(e,t){return e&&e.trim()?ft([(s=`[data-vbi-type="${t}"]`,{postcssPlugin:"hc-scope",AtRule(e){if("import"===e.name)return console.warn("[hc-css-scope] @import 已被拒绝(防外部资源加载):",e.params),void e.remove();"font-face"===e.name&&console.warn("[hc-css-scope] @font-face 全局生效,font-family 命名注意冲突")},Rule(e){(function(e){let t=e.parent;for(;t&&"object"==typeof t;){const e=t;if("atrule"===e.type&&/keyframes$/i.test(e.name??""))return!0;t=e.parent}return!1})(e)||(e.selectors=e.selectors.map(e=>function(e,t){const s=e.trim();if(!s)return s;if(dt.has(s))return t;for(const e of dt){const n=s.charAt(e.length);if(s.startsWith(e)&&(" "===n||">"===n||"+"===n||"~"===n||","===n))return t+s.slice(e.length)}return`${t} ${s}`}(e,s)))}})]).process(e,{from:void 0}).css:"";var s}const gt=new Map;function yt(e){let t=5381;for(let s=0;s<e.length;s++)t=(t<<5)+t+e.charCodeAt(s)|0;return(t>>>0).toString(36)}function wt(e){const t=e.replace(/[^a-zA-Z0-9_-]/g,"_");return t===e?`hc-style-${t}`:`hc-style-${t}-${yt(e).slice(0,6)}`}function vt(e,t){var s;const n=t??"",r=wt(e),o=gt.get(e);if(!n.trim())return null==(s=document.getElementById(r))||s.remove(),void(o&&gt.set(e,{...o,cssHash:""}));const i=yt(n);if(o&&o.cssHash===i)return;let a;try{a=mt(n,e)}catch(t){return void console.warn("[hc-css-scope]",e,"PostCSS process failed:",t)}!function(e,t){const s=wt(e);let n=document.getElementById(s);n||(n=document.createElement("style"),n.id=s,n.setAttribute("data-hc-scope",e),document.head.appendChild(n)),n.textContent=t}(e,a),o?gt.set(e,{...o,cssHash:i}):gt.set(e,{cssHash:i,refCount:0})}function bt(e,t){vt(e,t);const s=gt.get(e);s?gt.set(e,{...s,refCount:s.refCount+1}):gt.set(e,{cssHash:"",refCount:1})}function xt(e){var t;const s=gt.get(e);if(!s)return;const n=s.refCount-1;n<=0?(null==(t=document.getElementById(wt(e)))||t.remove(),gt.delete(e)):gt.set(e,{...s,refCount:n})}const Ct=n(),St={key:1,class:"rounded-md border-2 border-rose-300 bg-rose-50 p-4 text-sm text-rose-900 space-y-2 min-h-[140px] overflow-auto"},kt={class:"font-semibold flex items-center gap-1.5"},It={class:"font-mono text-xs text-rose-800 break-all"},Ot={key:0,class:"text-[10px] font-mono bg-rose-100/60 p-2 rounded overflow-auto max-h-60 text-rose-800"},Et=e.defineComponent({__name:"ErrorBoundary",props:{label:{},instanceId:{},canvasId:{},componentId:{}},setup(t){const s=t,n=e.ref(null),r=e.ref(0),o=e.ref(!1);function i(){n.value=null,o.value=!1,r.value++}return e.onErrorCaptured(e=>{console.error(`[hc-eb${s.label?" "+s.label:""}]`,e),n.value=e;try{Ct.emit("error",{canvasId:s.canvasId,instanceId:s.instanceId,componentId:s.componentId,label:s.label,error:e,timestamp:"undefined"!=typeof performance&&"function"==typeof performance.now?performance.now():Date.now()})}catch{}return!1}),(s,a)=>(e.openBlock(),e.createElementBlock("div",{key:r.value,class:"hc-eb-root",style:{width:"100%",height:"100%"}},[n.value?(e.openBlock(),e.createElementBlock("div",St,[e.createElementVNode("div",kt,[a[1]||(a[1]=e.createElementVNode("span",null,"⚠️",-1)),e.createElementVNode("span",null,"组件渲染失败"+e.toDisplayString(t.label?` — ${t.label}`:""),1)]),e.createElementVNode("div",It,e.toDisplayString(n.value.message),1),e.createElementVNode("button",{class:"text-xs text-rose-700 hover:text-rose-900 underline",onClick:a[0]||(a[0]=e=>o.value=!o.value)},e.toDisplayString(o.value?"隐藏":"展开")+"堆栈 ",1),o.value?(e.openBlock(),e.createElementBlock("pre",Ot,e.toDisplayString(n.value.stack),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"text-xs px-3 py-1 rounded bg-rose-600 hover:bg-rose-700 text-white transition-colors",onClick:i}," 重试 ")])):e.renderSlot(s.$slots,"default",{key:0})]))}}),At=["data-vbi-id","data-vbi-type","data-vbi-canvas"],Pt={key:0,class:"rounded-md border-2 border-amber-300 bg-amber-50 p-4 text-sm text-amber-900 space-y-2 min-h-[140px] overflow-auto"},$t={class:"text-[11px] font-mono break-all whitespace-pre-wrap"},_t={key:1,class:"grid place-items-center min-h-[140px] text-xs text-zinc-400"},Rt=e.defineComponent({__name:"RuntimeBox",props:{instanceId:{},componentId:{},scopeId:{},canvasId:{},htmlSource:{},jsSource:{},cssSource:{default:""},customValues:{default:()=>({})},position:{},size:{},zIndex:{}},setup(t){const s=t,n=e.computed(()=>s.scopeId??s.componentId),r=e.inject(f,null),o=e.computed(()=>s.canvasId??r??p),a=e.shallowRef(null),l=e.ref(null),c=e.ref(!1),u=e.ref(0);e.watch(()=>[s.htmlSource,s.jsSource],()=>{!async function(){c.value=!0,l.value=null;const e=o.value,t=s.instanceId;i(e,t,{compileStartedAt:performance.now()});try{const n=await F({html:s.htmlSource,js:s.jsSource}),r=performance.now();i(e,t,{compileEndedAt:r,mountStartedAt:r}),a.value=n,u.value++}catch(s){l.value=s instanceof Error?s:new Error(String(s)),a.value=null,i(e,t,{compileEndedAt:performance.now()})}finally{c.value=!1}}()},{immediate:!0});let h=!1;e.watch(()=>[s.cssSource,n.value],([e,t],s)=>{const n=(null==s?void 0:s[1])??null;n&&n!==t?(xt(n),bt(t,e),h=!0):h?vt(t,e):(bt(t,e),h=!0)},{immediate:!0});const d=e.computed(()=>{const e={width:"100%",height:"100%"};return s.position&&(e.position="absolute",e.left=`${s.position.x}px`,e.top=`${s.position.y}px`),void 0!==s.zIndex&&(e.zIndex=String(s.zIndex)),e});return e.onBeforeUnmount(()=>{h&&(xt(n.value),h=!1)}),(s,r)=>(e.openBlock(),e.createElementBlock("div",{class:"_vbi_box","data-vbi-id":t.instanceId,"data-vbi-type":n.value,"data-vbi-canvas":o.value,style:e.normalizeStyle(d.value)},[l.value?(e.openBlock(),e.createElementBlock("div",Pt,[r[0]||(r[0]=e.createElementVNode("div",{class:"font-semibold"},"⚠️ 编译失败",-1)),e.createElementVNode("pre",$t,e.toDisplayString(l.value.message),1)])):c.value&&!a.value?(e.openBlock(),e.createElementBlock("div",_t," 编译中… ")):a.value?(e.openBlock(),e.createBlock(Et,{key:u.value,label:t.instanceId,"instance-id":t.instanceId,"canvas-id":o.value,"component-id":t.componentId},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value.options),{"hc-custom-values":t.customValues,"hc-instance-id":t.instanceId,"hc-canvas-id":o.value,"hc-component-id":t.componentId},null,8,["hc-custom-values","hc-instance-id","hc-canvas-id","hc-component-id"]))]),_:1},8,["label","instance-id","canvas-id","component-id"])):e.createCommentVNode("",!0)],12,At))}});exports.parseComponentSource=t.parseComponentSource,exports.DEFAULT_CANVAS_ID=p,exports.ErrorBoundary=Et,exports.HC_CANVAS_ID_KEY=f,exports.HC_INJECT_KEY=M,exports.RuntimeBox=Rt,exports.VERSION="0.0.0-stage2b",exports.__resetDiagnosticsEventsFlag=function(){c=0},exports.__resetLifecycleEmitter=function(){m.all.clear()},exports.__resetRegistry=function(){const e=[],t=[];for(const[s,n]of w){t.push(s);for(const[t,r]of n)r.__dispose(),e.push({canvasId:s,instanceId:t}),l(s,t)}w.clear(),d.value++;for(const t of e)g("instance:unmounted",t);for(const e of t)v.emit("canvas:removed",{canvasId:e})},exports.assets=E,exports.attachScope=bt,exports.clearCompileCache=function(){D.clear()},exports.clearInstanceTimings=l,exports.compileComponent=F,exports.consumePendingTimings=a,exports.createCanvasesRegistry=P,exports.createHyperCard=function(e={}){const t=e.strict??!1,s=e.libs??{},n=e.version??"v1";return{install(e){const r=Object.entries(s),o=r.filter(([,e])=>_(e)),i=r.filter(([e])=>$.has(e)),a=[`[hypercard] 已注册 ${r.length} 个 libs:`];for(const[e,t]of r)a.push(` ${e.padEnd(16)} ${j(t)}`);console.info(a.join("\n"));const l=[];o.length>1&&l.push(`检测到 ${o.length} 个 Vue plugin(${o.map(([e])=>e).join(", ")}),请确认全局组件命名不冲突`);for(const[e]of i)l.push(`lib 名 "${e}" 是保留词,建议改名`);if(l.length>0){const e=l.map(e=>` - ${e}`).join("\n");if(t)throw new Error(`[hypercard] strict mode 阻止启动:\n${e}`);console.warn(`[hypercard] 警告:\n${e}`)}for(const[s,n]of o){const[r,o]=R(n);try{e.use(r,...o)}catch(e){if(console.error(`[hypercard] app.use("${s}") 失败:`,e),t)throw e}}const c={};for(const[e,t]of r){const[s]=R(t);c[e]=s}const u={libs:c,runtime:O,assets:E,version:n,canvases:P()};e.provide(M,u),e.config.globalProperties.$hc=u,"undefined"!=typeof window&&(window.__HYPERCARD__=u)}}},exports.debugScopedCssRefs=function(){return[...gt.entries()].map(([e,t])=>({scopeId:e,componentId:e,refCount:t.refCount,cssHash:t.cssHash}))},exports.detachScope=xt,exports.disableDiagnosticsEvents=function(){c>0?c--:console.warn("[hc-diagnostics] disableDiagnosticsEvents called more times than enableDiagnosticsEvents — ignored")},exports.disposeCanvas=x,exports.enableDiagnosticsEvents=function(){c++},exports.getCompileCacheSize=function(){return D.size},exports.getInstance=k,exports.getInstanceTimings=function(e,t){const s=k(t,e);return s?function(e){return e._timings}(s)??null:r.get(o(e,t))??null},exports.getScopedCssCount=function(){return gt.size},exports.injectScopedCss=vt,exports.interactionEmitter=h,exports.isDiagnosticsEventsEnabled=u,exports.isVuePlugin=_,exports.listCanvasIds=C,exports.listInstances=I,exports.onInstanceLifecycle=function(e,t){const s=e=>{try{t(e)}catch(e){console.error("[hc-registry] instance lifecycle listener threw",e)}};return m.on(e,s),()=>m.off(e,s)},exports.patchInstanceTimings=i,exports.register=function(e,t,s){return b(p,e,t,s)},exports.registerInCanvas=b,exports.registryVersion=d,exports.removeScopedCss=function(e){var t;null==(t=document.getElementById(wt(e)))||t.remove(),gt.delete(e)},exports.runtime=O,exports.runtimeErrorEmitter=Ct,exports.scopeCss=mt,exports.subscribeCanvasInventory=function(e,t){return v.on(e,t),()=>v.off(e,t)},exports.unregister=S;
package/dist/index.d.ts CHANGED
@@ -3,10 +3,13 @@ import { ComponentOptionsMixin } from 'vue';
3
3
  import { ComponentProvideOptions } from 'vue';
4
4
  import { ComponentPublicInstance } from 'vue';
5
5
  import { DefineComponent } from 'vue';
6
+ import { Emitter } from 'mitt';
6
7
  import { Plugin as Plugin_2 } from 'vue';
7
8
  import { PublicProps } from 'vue';
8
9
  import { Ref } from 'vue';
9
10
 
11
+ export declare function __resetDiagnosticsEventsFlag(): void;
12
+
10
13
  export declare function __resetLifecycleEmitter(): void;
11
14
 
12
15
  export declare function __resetRegistry(): void;
@@ -35,6 +38,9 @@ declare type __VLS_Props = {
35
38
 
36
39
  declare type __VLS_Props_2 = {
37
40
  label?: string;
41
+ instanceId?: string;
42
+ canvasId?: string;
43
+ componentId?: string;
38
44
  };
39
45
 
40
46
  declare function __VLS_template(): {
@@ -69,6 +75,15 @@ export declare interface CanvasesRegistryAPI {
69
75
  broadcast(event: string, payload?: unknown): void;
70
76
  }
71
77
 
78
+ declare type CanvasInventoryEventMap = {
79
+ 'canvas:added': {
80
+ canvasId: string;
81
+ };
82
+ 'canvas:removed': {
83
+ canvasId: string;
84
+ };
85
+ };
86
+
72
87
  export declare interface CanvasRuntimeHandle {
73
88
  readonly canvasId: string;
74
89
  listInstances(filter?: {
@@ -83,6 +98,8 @@ export declare interface CanvasRuntimeHandle {
83
98
 
84
99
  export declare function clearCompileCache(): void;
85
100
 
101
+ export declare function clearInstanceTimings(canvasId: string, instanceId: string): void;
102
+
86
103
  export declare function compileComponent(source: ComponentSource): Promise<CompiledComponent>;
87
104
 
88
105
  export declare interface CompiledComponent {
@@ -121,6 +138,8 @@ export declare interface ComponentSource {
121
138
  js: string;
122
139
  }
123
140
 
141
+ export declare function consumePendingTimings(canvasId: string, instanceId: string): InstanceTimings | null;
142
+
124
143
  export declare function createCanvasesRegistry(): CanvasesRegistryAPI;
125
144
 
126
145
  export declare function createHyperCard(config?: HyperCardConfig): Plugin_2;
@@ -150,18 +169,32 @@ export declare const DEFAULT_CANVAS_ID = "__default__";
150
169
 
151
170
  export declare function detachScope(scopeId: string): void;
152
171
 
172
+ export declare function disableDiagnosticsEvents(): void;
173
+
153
174
  export declare function disposeCanvas(canvasId: string): void;
154
175
 
155
176
  export declare interface EmitDecl {
156
177
  event: string;
157
178
  }
158
179
 
180
+ export declare function enableDiagnosticsEvents(): void;
181
+
159
182
  export declare const ErrorBoundary: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
160
183
 
184
+ declare type EventMap = {
185
+ error: RuntimeErrorEvent;
186
+ };
187
+
188
+ declare type Events = {
189
+ interaction: InteractionEvent;
190
+ };
191
+
161
192
  export declare function getCompileCacheSize(): number;
162
193
 
163
194
  export declare function getInstance(instanceId: string, canvasId?: string): ComponentInstanceHandle | null;
164
195
 
196
+ export declare function getInstanceTimings(canvasId: string, instanceId: string): InstanceTimings | null;
197
+
165
198
  export declare function getScopedCssCount(): number;
166
199
 
167
200
  export declare const HC_CANVAS_ID_KEY = "__hcCanvasId";
@@ -194,6 +227,29 @@ export declare interface InstanceLifecyclePayload {
194
227
  instanceId: string;
195
228
  }
196
229
 
230
+ export declare interface InstanceTimings {
231
+ compileStartedAt?: number;
232
+ compileEndedAt?: number;
233
+ mountStartedAt?: number;
234
+ mountEndedAt?: number;
235
+ }
236
+
237
+ export declare const interactionEmitter: Emitter<Events>;
238
+
239
+ export declare interface InteractionEvent {
240
+ canvasId: string;
241
+ instanceId: string;
242
+ componentId: string;
243
+ kind: InteractionKind;
244
+ key: string;
245
+ args: unknown[];
246
+ timestamp: number;
247
+ }
248
+
249
+ export declare type InteractionKind = 'call' | 'emit' | 'setProp' | 'setDataInput';
250
+
251
+ export declare function isDiagnosticsEventsEnabled(): boolean;
252
+
197
253
  export declare function isVuePlugin(v: unknown): boolean;
198
254
 
199
255
  declare type LibConfigValue<T> = T | readonly [T, ...unknown[]];
@@ -242,6 +298,8 @@ export declare interface ParsedSource {
242
298
  kind: ComponentKindRaw;
243
299
  }
244
300
 
301
+ export declare function patchInstanceTimings(canvasId: string, instanceId: string, patch: InstanceTimings): void;
302
+
245
303
  export declare interface PropDecl {
246
304
  key: string;
247
305
  value?: unknown;
@@ -275,6 +333,17 @@ cssSource: string;
275
333
  customValues: Record<string, unknown>;
276
334
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
277
335
 
336
+ export declare const runtimeErrorEmitter: Emitter<EventMap>;
337
+
338
+ export declare interface RuntimeErrorEvent {
339
+ canvasId?: string;
340
+ instanceId?: string;
341
+ componentId?: string;
342
+ label?: string;
343
+ error: Error;
344
+ timestamp: number;
345
+ }
346
+
278
347
  export declare function scopeCss(rawCss: string, scopeId: string): string;
279
348
 
280
349
  export declare interface SlotDeclMeta {
@@ -293,6 +362,8 @@ export declare interface SlotDeclRaw {
293
362
  label?: string;
294
363
  }
295
364
 
365
+ export declare function subscribeCanvasInventory<K extends keyof CanvasInventoryEventMap>(event: K, handler: (payload: CanvasInventoryEventMap[K]) => void): () => void;
366
+
296
367
  export declare function unregister(instanceId: string, canvasId?: string): void;
297
368
 
298
369
  export declare const VERSION = "0.0.0-stage2b";
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import*as e from"vue";import{ref as t,defineComponent as s,onErrorCaptured as r,openBlock as n,createElementBlock as o,renderSlot as i,createElementVNode as a,toDisplayString as l,createCommentVNode as c,computed as u,inject as h,shallowRef as p,watch as f,onBeforeUnmount as d,normalizeStyle as m,createBlock as g,withCtx as y,resolveDynamicComponent as w}from"vue";import{p as v}from"./parseSourceEntry-BNu0kje7.js";import{a as b}from"./parseSourceEntry-BNu0kje7.js";function x(e){return{all:e=e||new Map,on:function(t,s){var r=e.get(t);r?r.push(s):e.set(t,[s])},off:function(t,s){var r=e.get(t);r&&(s?r.splice(r.indexOf(s)>>>0,1):e.set(t,[]))},emit:function(t,s){var r=e.get(t);r&&r.slice().map(function(e){e(s)}),(r=e.get("*"))&&r.slice().map(function(e){e(t,s)})}}}const C="__default__",S="__hcCanvasId",k=t(0),O=x();function I(e,t){const s=e=>{try{t(e)}catch(e){console.error("[hc-registry] instance lifecycle listener threw",e)}};return O.on(e,s),()=>O.off(e,s)}function A(e,t){O.emit(e,t)}const E=new Set,P=new Map;function $(e,t,s,r){var n;const o=function(e,t){return`${e}\0${t}`}(e,t);if(E.has(o)){const s=`[hc-registry] re-entrant registerInCanvas("${e}", "${t}") detected — a lifecycle listener tried to register the same id while the outer register is in flight. Nested register blocked to prevent state divergence; defer your register via microtask / setTimeout if you need to re-mount on lifecycle events.`;throw console.warn(s),new Error(s)}E.add(o);try{const o=function(e){let t=P.get(e);return t||(t=new Map,P.set(e,t)),t}(e);o.has(t)&&(console.warn(`[hc-registry] instance ${t} already registered in canvas "${e}", overwriting`),null==(n=o.get(t))||n.__dispose(),o.delete(t),A("instance:unmounted",{canvasId:e,instanceId:t}));const i=function(e,t,s){const r=x();return{instanceId:e,componentId:t,vm:s,call(t,...r){const n=s[t];if("function"!=typeof n)throw new Error(`[hc-registry] method "${t}" not found on instance ${e}`);return n.apply(s,r)},on:(e,t)=>(r.on(e,t),()=>r.off(e,t)),emit(e,t){r.emit(e,t)},setProp(e,t){s[e]=t},setDataInput(t,r){const n=s.custom;if(!n||!(t in n))return void console.warn(`[hc-registry] setDataInput("${t}"): vm.custom["${t}"] not declared on instance ${e}; binding 改了一个未声明的 dataInput key,组件不会响应`);const o=n[t];o&&"object"==typeof o?!0===o.dataInput?o.value=r:console.warn(`[hc-registry] setDataInput("${t}"): vm.custom["${t}"] is not declared with dataInput:true on instance ${e}; 请在组件源码 custom.${t} 上加 \`dataInput: true\` 才能被 binding 灌入`):console.warn(`[hc-registry] setDataInput("${t}"): vm.custom["${t}"] not a {value:...} slot`)},__dispose(){r.all.clear()}}}(t,s,r);return o.set(t,i),k.value++,A("instance:ready",{canvasId:e,instanceId:t}),i}finally{E.delete(o)}}function R(e){const t=P.get(e);if(!t)return;const s=[];for(const[e,r]of t)r.__dispose(),s.push(e);t.clear(),P.delete(e),k.value++;for(const t of s)A("instance:unmounted",{canvasId:e,instanceId:t})}function j(){return[...P.keys()]}function _(e,t,s){return $(C,e,t,s)}function M(e,t=C){const s=P.get(t);if(!s)return;const r=s.get(e);r&&(r.__dispose(),s.delete(e),k.value++,A("instance:unmounted",{canvasId:t,instanceId:e}))}function B(e,t){var s;if(void 0!==t)return(null==(s=P.get(t))?void 0:s.get(e))??null;let r=null;const n=[];for(const[t,s]of P){const o=s.get(e);o&&(r||(r=o),n.push(t))}return n.length>1&&console.warn(`[hc-registry] getInstance("${e}") matched ${n.length} canvases [${n.join(", ")}]; returning first. Prefer __HYPERCARD__.canvases.callComponent(canvasId, instanceId, ...) for explicit scope.`),r}function U(e){const t=null==e?void 0:e.componentId,s=t?e=>e.componentId===t:()=>!0;if(void 0!==(null==e?void 0:e.canvasId)){const t=P.get(e.canvasId);return t?[...t.values()].filter(s):[]}const r=[];for(const e of P.values())for(const t of e.values())s(t)&&r.push(t);return r}function z(){const e=[];for(const[t,s]of P)for(const[r,n]of s)n.__dispose(),e.push({canvasId:t,instanceId:r});P.clear(),k.value++;for(const t of e)A("instance:unmounted",t)}function D(){O.all.clear()}const L={getInstance:B,listInstances:U,call(e,t,...s){const r=B(e);if(r)return r.call(t,...s);console.debug(`[hc-runtime] call: instance "${e}" not found`)},on(e,t,s){const r=B(e);if(r)return r.on(t,s);console.debug(`[hc-runtime] on: instance "${e}" not found`)},emit(e,t,s){const r=B(e);r?r.emit(t,s):console.debug(`[hc-runtime] emit: instance "${e}" not found`)}},F={pickerUrl:e=>`/a/${e}`};function N(e){return{canvasId:e,listInstances:t=>U({canvasId:e,componentId:null==t?void 0:t.componentId}),getInstance:t=>B(t,e),call(t,s,...r){const n=B(t,e);if(n)try{return n.call(s,...r)}catch(r){return void console.warn(`[hc-canvases] call error: canvas="${e}" instance="${t}" method="${s}":`,r)}else console.warn(`[hc-canvases] call: instance "${t}" not found in canvas "${e}"`)},emit(t,s,r){const n=B(t,e);if(n)try{n.emit(s,r)}catch(r){console.warn(`[hc-canvases] emit error: canvas="${e}" instance="${t}" event="${s}":`,r)}else console.warn(`[hc-canvases] emit: instance "${t}" not found in canvas "${e}"`)},broadcastInCanvas(t,s){const r=U({canvasId:e});for(const n of r)try{n.emit(t,s)}catch(s){console.warn(`[hc-canvases] broadcastInCanvas: canvas="${e}" instance="${n.instanceId}" event="${t}" emit failed:`,s)}},dispose(){R(e)}}}function T(){return{list:()=>j().map(e=>N(e)),get:e=>j().includes(e)?N(e):null,getAll(){const e={};for(const t of j())e[t]=N(t);return e},callComponent(e,t,s,...r){const n=B(t,e);if(n)try{return n.call(s,...r)}catch(r){return void console.warn(`[hc-canvases] callComponent error: canvas="${e}" instance="${t}" method="${s}":`,r)}else console.warn(`[hc-canvases] callComponent: canvas="${e}" instance="${t}" not found`)},emitToCanvas(e,t,s,r){const n=B(t,e);if(n)try{n.emit(s,r)}catch(r){console.warn(`[hc-canvases] emitToCanvas error: canvas="${e}" instance="${t}" event="${s}":`,r)}else console.warn(`[hc-canvases] emitToCanvas: canvas="${e}" instance="${t}" not found`)},broadcast(e,t){for(const s of j())try{const r=U({canvasId:s});for(const n of r)try{n.emit(e,t)}catch(t){console.warn(`[hc-canvases] broadcast: canvas="${s}" instance="${n.instanceId}" event="${e}" emit failed:`,t)}}catch(t){console.warn(`[hc-canvases] broadcast: canvas="${s}" event="${e}" failed:`,t)}}}}const V=new Set(["vue","Vue","window","global","globalThis","console","document","process","$","libs","runtime","assets","version"]);function W(e={}){const t=e.strict??!1,s=e.libs??{},r=e.version??"v1";return{install(e){const n=Object.entries(s),o=n.filter(([,e])=>J(e)),i=n.filter(([e])=>V.has(e)),a=[`[hypercard] 已注册 ${n.length} 个 libs:`];for(const[e,t]of n)a.push(` ${e.padEnd(16)} ${Y(t)}`);console.info(a.join("\n"));const l=[];o.length>1&&l.push(`检测到 ${o.length} 个 Vue plugin(${o.map(([e])=>e).join(", ")}),请确认全局组件命名不冲突`);for(const[e]of i)l.push(`lib 名 "${e}" 是保留词,建议改名`);if(l.length>0){const e=l.map(e=>` - ${e}`).join("\n");if(t)throw new Error(`[hypercard] strict mode 阻止启动:\n${e}`);console.warn(`[hypercard] 警告:\n${e}`)}for(const[s,r]of o){const[n,o]=H(r);try{e.use(n,...o)}catch(e){if(console.error(`[hypercard] app.use("${s}") 失败:`,e),t)throw e}}const c={};for(const[e,t]of n){const[s]=H(t);c[e]=s}const u={libs:c,runtime:L,assets:F,version:r,canvases:T()};e.provide(G,u),e.config.globalProperties.$hc=u,"undefined"!=typeof window&&(window.__HYPERCARD__=u)}}}function J(e){return Array.isArray(e)&&e.length>=1?J(e[0]):"object"==typeof e&&null!==e&&"function"==typeof e.install}function H(e){return Array.isArray(e)&&e.length>=1?[e[0],e.slice(1)]:[e,[]]}function Y(e){return J(e)?Array.isArray(e)?"✓ Vue plugin (with options) → 已 app.use":"✓ Vue plugin → 已 app.use":"function"==typeof e?"· function":Array.isArray(e)?"· array":"object"==typeof e&&null!==e?"· object":"· "+typeof e}const G="__HYPERCARD__",Z=new Set(["init","onClick","onMouseover","onMouseout","onResize","onDestroy"]),q=new Map;function K(e,t){for(q.has(e)&&q.delete(e),q.set(e,t);q.size>100;){const e=q.keys().next().value;if(void 0===e)break;q.delete(e)}}function Q(e){let t=5381;for(let s=0;s<e.length;s++)t=(t<<5)+t+e.charCodeAt(s)|0;return(t>>>0).toString(36)}function X(e){if(!Array.isArray(e))return[];const t=[];for(const s of e){if(!s||"object"!=typeof s)continue;const e=s;if("string"!=typeof e.name)continue;const r={name:e.name};"boolean"==typeof e.multiple&&(r.multiple=e.multiple),Array.isArray(e.accepts)&&(r.accepts=e.accepts.filter(e=>"string"==typeof e)),"number"==typeof e.maxChildren&&(r.maxChildren=e.maxChildren),"string"==typeof e.label&&(r.label=e.label),t.push(r)}return t}async function ee(t){const s=Q(t.html)+"_"+Q(t.js),r=q.get(s);if(r)return K(s,r),r;const n=(async()=>function(t,s){if(!t||"object"!=typeof t)throw new Error("[hc-compile] component.js must `export default` an object");const r=t,n=r.name,o=r.method??{},i=r.attribute??{},a=r.custom??{},l=r.style??{},c=r.slots,u=r.data,h=r.methods??{},p=r.computed,f=r.watch,d=r.created,m=r.mounted,g=r.beforeUnmount,y=r.props,w=new Set(["name","method","attribute","custom","style","option","data","methods","computed","watch","created","mounted","beforeUnmount","props","slots"]),v={};for(const e of Object.keys(r))w.has(e)||(v[e]=r[e]);const b={};for(const[e,t]of Object.entries(o))Z.has(e)||"function"!=typeof t||(b[e]=t);const x=Object.keys(b),C={...b,...h},S=(s??"").trim()||"<div></div>";return{options:{render:e.compile(S),props:{...y?Array.isArray(y)?Object.fromEntries(y.map(e=>[e,null])):"object"==typeof y?y:{}:{},hcCustomValues:{type:Object,default:()=>({})},hcInstanceId:{type:String,default:""},hcCanvasId:{type:String,default:""},hcComponentId:{type:String,default:""}},data(){const e="function"==typeof u?u.call(this):u??{},t=this.hcCustomValues??{},s={};for(const[e,r]of Object.entries(a)){let n;try{n=JSON.parse(JSON.stringify(r??{}))}catch{n={...r??{}}}e in t&&n&&"object"==typeof n&&(n.value=t[e]),s[e]=n}return{custom:s,...e}},methods:C,computed:p,watch:(()=>{const e=f&&"object"==typeof f?{...f}:{};return e.hcCustomValues={handler(e){if(e&&this.custom)for(const[t,s]of Object.entries(e)){const e=this.custom[t];e&&"object"==typeof e&&(e.value=s)}},deep:!0},e})(),created(){this.hcInstanceId&&this.hcCanvasId&&$(this.hcCanvasId,this.hcInstanceId,this.hcComponentId,this),"function"==typeof d&&d.call(this)},mounted(){const e=[],t=this.$el;if(t&&t instanceof HTMLElement){Object.assign(t.style,l);for(const[e,s]of Object.entries(i))"string"==typeof s&&s&&t.setAttribute(e,s);for(const s of Z){if("init"===s)continue;const r=o[s];if("function"==typeof r){const n=s.replace(/^on/,"").toLowerCase(),o=e=>{r.call(this,{event:e,data:e})};t.addEventListener(n,o),e.push(()=>t.removeEventListener(n,o))}}}this.__hcCleanup=e;const s=o.init;"function"==typeof s&&s.call(this),"function"==typeof m&&m.call(this)},beforeUnmount(){var e;this.hcInstanceId&&this.hcCanvasId&&M(this.hcInstanceId,this.hcCanvasId),null==(e=this.__hcCleanup)||e.forEach(e=>{try{e()}catch{}}),this.__hcCleanup=void 0,"function"==typeof g&&g.call(this)},...v},meta:{name:n,attribute:i,style:l,customDecl:a,methodNames:x,slotsDecl:X(c)}}}(function(e){let t;try{const s=v(e,{ecmaVersion:"latest",sourceType:"module",allowAwaitOutsideFunction:!0}).body.find(e=>"ExportDefaultDeclaration"===e.type);if(!s)throw new Error("[hc-compile] component.js must `export default` an object");t=e.slice(0,s.start)+"module.exports = "+e.slice(s.declaration.start)}catch(e){throw e instanceof Error?e:new Error(String(e))}const s=new Function("module","exports",`"use strict";\n${t}\n;return module.exports;`),r={exports:{}};try{return s(r,r.exports)}catch(e){throw e instanceof Error?e:new Error(String(e))}}(t.js),t.html))();return K(s,n),n.catch(()=>q.delete(s)),n}function te(){q.clear()}function se(){return q.size}function re(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ne(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var s=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),s}var oe,ie={exports:{}};function ae(){if(oe)return ie.exports;oe=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return ie.exports=t(),ie.exports.createColors=t,ie.exports}const le=ne(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var ce,ue,he,pe,fe,de;function me(){if(ue)return ce;ue=1;let e=ae(),t=le;class s extends Error{constructor(e,t,r,n,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,s)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(s){if(!this.source)return"";let r=this.source;null==s&&(s=e.isColorSupported);let n=e=>e,o=e=>e,i=e=>e;if(s){let{bold:s,gray:r,red:a}=e.createColors(!0);o=e=>s(a(e)),n=e=>r(e),t&&(i=e=>t(e))}let a=r.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let s=l+1+t,r=" "+(" "+s).slice(-u)+" | ";if(s===this.line){if(e.length>160){let t=20,s=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(s,a),c=n(r.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return o(">")+n(r)+i(l)+"\n "+c+o("^")}let t=n(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return o(">")+n(r)+i(e)+"\n "+t+o("^")}return" "+n(r)+i(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return ce=s,s.default=s,ce}function ge(){if(pe)return he;pe=1;const e=/(<)(\/?style\b)/gi,t=/(<)(!--)/g;function s(s){return"string"!=typeof s?s:s.includes("<")?s.replace(e,"\\3c $2").replace(t,"\\3c $2"):s}const r={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class n{constructor(e){this.builder=e}atrule(e,t){let r=e.raws,n="@"+e.name,o=e.params?this.rawValue(e,"params"):"";if(void 0!==r.afterName?n+=r.afterName:o&&(n+=" "),e.nodes)this.block(e,n+o);else{let i=(r.between||"")+(t?";":"");this.builder(s(n+o+i),e)}}beforeAfter(e,t){let s;s="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,n=0;for(;r&&"root"!==r.type;)n+=1,r=r.parent;if(s.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<n;e++)s+=t}return s}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(s(t+n)+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(s(r)),this.builder("}",e,"end")}body(e){let t=e.nodes,r=t.length-1;for(;r>0&&"comment"===t[r].type;)r-=1;let n=this.raw(e,"semicolon"),o="document"===e.type;for(let e=0;e<t.length;e++){let i=t[e],a=this.raw(i,"before");a&&this.builder(o?a:s(a)),this.stringify(i,r!==e||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder(s("/*"+t+e.text+r+"*/"),e)}decl(e,t){let r=e.raws,n=this.raw(e,"between","colon"),o=e.prop+n+this.rawValue(e,"value");e.important&&(o+=r.important||" !important"),t&&(o+=";"),this.builder(s(o),e)}document(e){this.body(e)}raw(e,t,s){let n;if(s||(s=t),t&&(n=e.raws[t],void 0!==n))return n;let o=e.parent;if("before"===s){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}if(!o)return r[s];let i=e.root(),a=i.rawCache||(i.rawCache={});if(void 0!==a[s])return a[s];if("before"===s||"after"===s)return this.beforeAfter(e,s);{let r="raw"+((l=s)[0].toUpperCase()+l.slice(1));this[r]?n=this[r](i,e):i.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var l;return void 0===n&&(n=r[s]),a[s]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let s;return e.walkComments(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(e,t){let s;return e.walkDecls(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(s=>{if(s.nodes&&(s.parent!==e||e.first!==s)&&void 0!==s.raws.before)return t=s.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(s=>{let r=s.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==s.raws.before){let e=s.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let s=e[t],r=e.raws[t];return r&&r.value===s?r.raw:s}root(e){if(this.body(e),e.raws.after){let t=e.raws.after,r=e.parent&&"document"===e.parent.type;this.builder(r?t:s(t))}}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(s(e.raws.ownSemicolon),e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}return he=n,n.default=n,he}function ye(){if(de)return fe;de=1;let e=ge();function t(t,s){new e(s).stringify(t)}return fe=t,t.default=t,fe}var we,ve,be,xe,Ce,Se,ke,Oe,Ie,Ae,Ee,Pe,$e,Re,je,_e,Me,Be,Ue,ze,De,Le,Fe,Ne,Te,Ve,We,Je,He,Ye,Ge,Ze,qe,Ke,Qe,Xe,et,tt,st,rt,nt,ot,it,at,lt,ct,ut,ht,pt,ft={};function dt(){return we||(we=1,ft.isClean=Symbol("isClean"),ft.my=Symbol("my")),ft}function mt(){if(be)return ve;be=1;let e=me(),t=ge(),s=ye(),{isClean:r,my:n}=dt();function o(e,t){let s=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let n=e[r],i=typeof n;"parent"===r&&"object"===i?t&&(s[r]=t):"source"===r?s[r]=n:Array.isArray(n)?s[r]=n.map(e=>o(e,s)):("object"===i&&null!==n&&(n=o(n)),s[r]=n)}return s}function i(e,t){if(t&&void 0!==t.offset)return t.offset;let s=1,r=1,n=0;for(let o=0;o<e.length;o++){if(r===t.line&&s===t.column){n=o;break}"\n"===e[o]?(s=1,r+=1):s+=1}return n}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[r]=!1,this[n]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let s of e[t])"function"==typeof s.clone?this.append(s.clone()):this.append(s)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=o(this);for(let s in e)t[s]=e[s];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(t,s={}){if(this.source){let{end:e,start:r}=this.rangeBy(s);return this.source.input.error(t,{column:r.column,line:r.line},{column:e.column,line:e.line},s)}return new e(t)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markClean(){this[r]=!0}markDirty(){if(this[r]){this[r]=!1;let e=this;for(;e=e.parent;)e[r]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let s="document"in this.source.input?this.source.input.document:this.source.input.css,r=s.slice(i(s,this.source.start),i(s,this.source.end)).indexOf(e.word);-1!==r&&(t=this.positionInside(r))}return t}positionInside(e){let t=this.source.start.column,s=this.source.start.line,r="document"in this.source.input?this.source.input.document:this.source.input.css,n=i(r,this.source.start),o=n+e;for(let e=n;e<o;e++)"\n"===r[e]?(t=1,s+=1):t+=1;return{column:t,line:s,offset:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,s={column:this.source.start.column,line:this.source.start.line,offset:i(t,this.source.start)},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:i(t,this.source.end)+1}:{column:s.column+1,line:s.line,offset:s.offset+1};if(e.word){let n=t.slice(i(t,this.source.start),i(t,this.source.end)).indexOf(e.word);-1!==n&&(s=this.positionInside(n),r=this.positionInside(n+e.word.length))}else e.start?s={column:e.start.column,line:e.start.line,offset:i(t,e.start)}:e.index&&(s=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line,offset:i(t,e.end)}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<s.line||r.line===s.line&&r.column<=s.column)&&(r={column:s.column+1,line:s.line,offset:s.offset+1}),{end:r,start:s}}raw(e,s){return(new t).raw(this,e,s)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,s=!1;for(let r of e)r===this?s=!0:s?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);s||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let s={},r=null==t;t=t||new Map;let n=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))s[e]=r.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof r&&r.toJSON)s[e]=r.toJSON(null,t);else if("source"===e){if(null==r)continue;let o=t.get(r.input);null==o&&(o=n,t.set(r.input,n),n++),s[e]={end:r.end,inputId:o,start:r.start}}else s[e]=r}return r&&(s.inputs=[...t.keys()].map(e=>e.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=s){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,s={}){let r={node:this};for(let e in s)r[e]=s[e];return e.warn(t,r)}}return ve=a,a.default=a,ve}function gt(){if(Ce)return xe;Ce=1;let e=mt();class t extends e{constructor(e){super(e),this.type="comment"}}return xe=t,t.default=t,xe}function yt(){if(ke)return Se;ke=1;let e=mt();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return Se=t,t.default=t,Se}function wt(){if(Ie)return Oe;Ie=1;let e,t,s,r,n=gt(),o=yt(),i=mt(),{isClean:a,my:l}=dt();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends i{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,s,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],s=e(this.proxyOf.nodes[t],t),!1!==s);)this.indexes[r]+=1;return delete this.indexes[r],s}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...s)=>e[t](...s.map(e=>"function"==typeof e?(t,s)=>e(t.toProxy(),s):e)):"every"===t||"some"===t?s=>e[t]((e,...t)=>s(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let s,r=this.index(e),n=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of n)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)s=this.indexes[e],r<s&&(this.indexes[e]=s+n.length);return this.markDirty(),this}insertBefore(e,t){let s,r=this.index(e),n=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],n).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)s=this.indexes[e],r<=s&&(this.indexes[e]=s+o.length);return this.markDirty(),this}normalize(s,i){if("string"==typeof s)s=c(t(s).nodes);else if(void 0===s)s=[];else if(Array.isArray(s)){s=s.slice(0);for(let e of s)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===s.type&&"document"!==this.type){s=s.nodes.slice(0);for(let e of s)e.parent&&e.parent.removeChild(e,"ignore")}else if(s.type)s=[s];else if(s.prop){if(void 0===s.value)throw new Error("Value field is missed in node creation");"string"!=typeof s.value&&(s.value=String(s.value)),s=[new o(s)]}else if(s.selector||s.selectors)s=[new r(s)];else if(s.name)s=[new e(s)];else{if(!s.text)throw new Error("Unknown node type in node creation");s=[new n(s)]}return s.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&i&&void 0!==i.raws.before&&(e.raws.before=i.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let s in this.indexes)t=this.indexes[s],t>=e&&(this.indexes[s]=t-1);return this.markDirty(),this}replaceValues(e,t,s){return s||(s=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,s))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,s)=>{let r;try{r=e(t,s)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("atrule"===s.type&&e.test(s.name))return t(s,r)}):this.walk((s,r)=>{if("atrule"===s.type&&s.name===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("atrule"===e.type)return t(e,s)}))}walkComments(e){return this.walk((t,s)=>{if("comment"===t.type)return e(t,s)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("decl"===s.type&&e.test(s.prop))return t(s,r)}):this.walk((s,r)=>{if("decl"===s.type&&s.prop===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("decl"===e.type)return t(e,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("rule"===s.type&&e.test(s.selector))return t(s,r)}):this.walk((s,r)=>{if("rule"===s.type&&s.selector===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("rule"===e.type)return t(e,s)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{r=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{s=e},Oe=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,r.prototype):"decl"===t.type?Object.setPrototypeOf(t,o.prototype):"comment"===t.type?Object.setPrototypeOf(t,n.prototype):"root"===t.type&&Object.setPrototypeOf(t,s.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},Oe}function vt(){if(Ee)return Ae;Ee=1;let e=wt();class t extends e{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return Ae=t,t.default=t,e.registerAtRule(t),Ae}function bt(){if($e)return Pe;$e=1;let e,t,s=wt();class r extends s{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(s={}){return new e(new t,this,s).stringify()}}return r.registerLazyResult=t=>{e=t},r.registerProcessor=e=>{t=e},Pe=r,r.default=r,Pe}function xt(){return je?Re:(je=1,Re={nanoid:(e=21)=>{let t="",s=0|e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(s=t)=>{let r="",n=0|s;for(;n--;)r+=e[Math.random()*e.length|0];return r}})}function Ct(){if(Me)return _e;Me=1;let{existsSync:e,readFileSync:t}=le,{dirname:s,join:r}=le,{SourceMapConsumer:n,SourceMapGenerator:o}=le;class i{constructor(e,t){if(!1===t.map)return;t.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new n(this.json||this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let s=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(s)return r=e.substr(s[0].length),Buffer?Buffer.from(r,"base64").toString():window.atob(r);var r;let n=e.slice(22);throw n=n.slice(0,n.indexOf(",")),new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let s=e.lastIndexOf(t.pop()),r=e.indexOf("*/",s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(s,r)))}loadFile(r,n,o){if(o||this.unsafeMap||/\.map$/i.test(r))return this.root=s(r),e(r)?(this.mapFile=r,t(r,"utf-8").toString().trim()):void 0}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof n)return o.fromSourceMap(t).toString();if(t instanceof o)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let s=t(e);if(s){let t=this.loadFile(s,e,!0);if(!t)throw new Error("Unable to load previous source map: "+s.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;e&&(t=r(s(e),t));let n=this.loadFile(t,e,!1);if(n)try{this.json=JSON.parse(n.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return n}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return _e=i,i.default=i,_e}function St(){if(Ue)return Be;Ue=1;let{nanoid:e}=xt(),{isAbsolute:t,resolve:s}=le,{SourceMapConsumer:r,SourceMapGenerator:n}=le,{fileURLToPath:o,pathToFileURL:i}=le,a=me(),l=Ct(),c=le,u=Symbol("lineToIndexCache"),h=Boolean(r&&n),p=Boolean(s&&t);function f(e){if(e[u])return e[u];let t=e.css.split("\n"),s=new Array(t.length),r=0;for(let e=0,n=t.length;e<n;e++)s[e]=r,r+=t[e].length+1;return e[u]=s,s}class d{get from(){return this.file||this.id}constructor(r,n={}){if(null==r||"object"==typeof r&&!r.toString)throw new Error(`PostCSS received ${r} instead of CSS string`);if(this.css=r.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,n.document&&(this.document=n.document.toString()),n.from&&(!p||/^\w+:\/\//.test(n.from)||t(n.from)?this.file=n.from:this.file=s(n.from)),p&&h){let e=new l(this.css,n);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,s,r={}){let n,o,l,c,u;if(t&&"object"==typeof t){let e=t,r=s;if("number"==typeof e.offset){c=e.offset;let r=this.fromOffset(c);t=r.line,s=r.col}else t=e.line,s=e.column,c=this.fromLineAndColumn(t,s);if("number"==typeof r.offset){l=r.offset;let e=this.fromOffset(l);o=e.line,n=e.col}else o=r.line,n=r.column,l=this.fromLineAndColumn(r.line,r.column)}else if(s)c=this.fromLineAndColumn(t,s);else{c=t;let e=this.fromOffset(c);t=e.line,s=e.col}let h=this.origin(t,s,o,n);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,r.plugin):new a(e,void 0===o?t:{column:s,line:t},void 0===o?s:{column:n,line:o},this.css,this.file,r.plugin),u.input={column:s,endColumn:n,endLine:o,endOffset:l,line:t,offset:c,source:this.css},this.file&&(i&&(u.input.url=i(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return f(this)[e-1]+t-1}fromOffset(e){let t=f(this),s=0;if(e>=t[t.length-1])s=t.length-1;else{let r,n=t.length-2;for(;s<n;)if(r=s+(n-s>>1),e<t[r])n=r-1;else{if(!(e>=t[r+1])){s=r;break}s=r+1}}return{col:e-t[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:s(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,s,r,n){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:s,line:e});if(!u.source)return!1;"number"==typeof r&&(a=c.originalPositionFor({column:n,line:r})),l=t(u.source)?i(u.source):new URL(u.source,this.map.consumer().sourceRoot||i(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!o)throw new Error("file: protocol is not available in this PostCSS build");h.file=o(l)}let p=c.sourceContentFor(u.source);return p&&(h.source=p),h}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}}return Be=d,d.default=d,c&&c.registerInput&&c.registerInput(d),Be}function kt(){if(De)return ze;De=1;let e,t,s=wt();class r extends s{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,s){let r=super.normalize(e);if(t)if("prepend"===s)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before;return r}removeChild(e,t){let s=this.index(e);return!t&&0===s&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(e)}toResult(s={}){return new e(new t,this,s).stringify()}}return r.registerLazyResult=t=>{e=t},r.registerProcessor=e=>{t=e},ze=r,r.default=r,s.registerRoot(r),ze}function Ot(){if(Fe)return Le;Fe=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,s){let r=[],n="",o=!1,i=0,a=!1,l="",c=!1;for(let s of e)c?c=!1:"\\"===s?c=!0:a?s===l&&(a=!1):'"'===s||"'"===s?(a=!0,l=s):"("===s?i+=1:")"===s?i>0&&(i-=1):0===i&&t.includes(s)&&(o=!0),o?(""!==n&&r.push(n.trim()),n="",o=!1):n+=s;return(s||""!==n)&&r.push(n.trim()),r}};return Le=e,e.default=e,Le}function It(){if(Te)return Ne;Te=1;let e=wt(),t=Ot();class s extends e{get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,s=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(s)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return Ne=s,s.default=s,e.registerRule(s),Ne}function At(){if(He)return Je;He=1;let{dirname:e,relative:t,resolve:s,sep:r}=le,{SourceMapConsumer:n,SourceMapGenerator:o}=le,{pathToFileURL:i}=le,a=St(),l=Boolean(n&&o),c=Boolean(e&&s&&t&&r);return Je=class{constructor(e,t,s,r){this.stringify=e,this.mapOpts=s.map||{},this.root=t,this.opts=s,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let s,r=this.toUrl(this.path(t.file)),o=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(s=new n(t.text),s.sourcesContent&&(s.sourcesContent=null)):s=t.consumer(),this.map.applySourceMap(s,r,this.toUrl(this.path(o)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else if(this.css){let e;for(;-1!==(e=this.css.lastIndexOf("/*#"));){let t=this.css.indexOf("*/",e+3);if(-1===t)break;for(;e>0&&"\n"===this.css[e-1];)e--;this.css=this.css.slice(0,e)+this.css.slice(t+2)}}}generate(){if(this.clearAnnotation(),c&&l&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=o.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new o({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new o({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,s=1,r=1,n="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=s,i.generated.column=r-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,this.map.addMapping(i))),t=o.match(/\n/g),t?(s+=t.length,e=o.lastIndexOf("\n"),r=o.length-e):r+=o.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=s,i.generated.column=r-2,this.map.addMapping(i)):(i.source=n,i.original.line=1,i.original.column=0,i.generated.line=s,i.generated.column=r-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(r){if(this.mapOpts.absolute)return r;if(60===r.charCodeAt(0))return r;if(/^\w+:\/\//.test(r))return r;let n=this.memoizedPaths.get(r);if(n)return n;let o=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=e(s(o,this.mapOpts.annotation)));let i=t(o,r);return this.memoizedPaths.set(r,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new a(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let s=t.source.input.from;if(s&&!e[s]){e[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(i){let t=i(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===r&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}}}function Et(){if(Qe)return Ke;Qe=1;let e=wt(),t=St(),s=function(){if(qe)return Ze;qe=1;let e=vt(),t=gt(),s=yt(),r=kt(),n=It(),o=function(){if(Ge)return Ye;Ge=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),s="\\".charCodeAt(0),r="/".charCodeAt(0),n="\n".charCodeAt(0),o=" ".charCodeAt(0),i="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),p=")".charCodeAt(0),f="{".charCodeAt(0),d="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),y=":".charCodeAt(0),w="@".charCodeAt(0),v=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,x=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Ye=function(S,k={}){let O,I,A,E,P,$,R,j,_,M,B=S.css.valueOf(),U=k.ignoreErrors,z=B.length,D=0,L=[],F=[],N=-1;function T(e){throw S.error("Unclosed "+e,D)}return{back:function(e){F.push(e)},endOfFile:function(){return 0===F.length&&D>=z},nextToken:function(S){if(F.length)return F.pop();if(D>=z)return;let k=!!S&&S.ignoreUnclosed;switch(O=B.charCodeAt(D),O){case n:case o:case a:case l:case i:E=D;do{E+=1,O=B.charCodeAt(E)}while(O===o||O===n||O===a||O===l||O===i);$=["space",B.slice(D,E)],D=E-1;break;case c:case u:case f:case d:case y:case m:case p:{let e=String.fromCharCode(O);$=[e,e,D];break}case h:if(M=L.length?L.pop()[1]:"",_=B.charCodeAt(D+1),"url"===M&&_!==e&&_!==t&&_!==o&&_!==n&&_!==a&&_!==i&&_!==l){E=D;do{if(R=!1,E=B.indexOf(")",E+1),-1===E){if(U||k){E=D;break}T("bracket")}for(j=E;B.charCodeAt(j-1)===s;)j-=1,R=!R}while(R);$=["brackets",B.slice(D,E+1),D,E],D=E}else D<=N?$=["(","(",D]:(E=B.indexOf(")",D+1),I=B.slice(D,E+1),-1===E||x.test(I)?(N=-1===E?z:E,$=["(","(",D]):($=["brackets",I,D,E],D=E));break;case e:case t:P=O===e?"'":'"',E=D;do{if(R=!1,E=B.indexOf(P,E+1),-1===E){if(U||k){E=D+1;break}T("string")}for(j=E;B.charCodeAt(j-1)===s;)j-=1,R=!R}while(R);$=["string",B.slice(D,E+1),D,E],D=E;break;case w:v.lastIndex=D+1,v.test(B),E=0===v.lastIndex?B.length-1:v.lastIndex-2,$=["at-word",B.slice(D,E+1),D,E],D=E;break;case s:for(E=D,A=!0;B.charCodeAt(E+1)===s;)E+=1,A=!A;if(O=B.charCodeAt(E+1),A&&O!==r&&O!==o&&O!==n&&O!==a&&O!==l&&O!==i&&(E+=1,C.test(B.charAt(E)))){for(;C.test(B.charAt(E+1));)E+=1;B.charCodeAt(E+1)===o&&(E+=1)}$=["word",B.slice(D,E+1),D,E],D=E;break;default:O===r&&B.charCodeAt(D+1)===g?(E=B.indexOf("*/",D+2)+1,0===E&&(U||k?E=B.length:T("comment")),$=["comment",B.slice(D,E+1),D,E],D=E):(b.lastIndex=D+1,b.test(B),E=0===b.lastIndex?B.length-1:b.lastIndex-2,$=["word",B.slice(D,E+1),D,E],L.push($),D=E)}return D++,$},position:function(){return D}}}}();const i={empty:!0,space:!0};return Ze=class{constructor(e){this.input=e,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let s,r,n,o=new e;o.name=t[1].slice(1),""===o.name&&this.unnamedAtrule(o,t),this.init(o,t[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(s=(t=this.tokenizer.nextToken())[0],"("===s||"["===s?c.push("("===s?")":"]"):"{"===s&&c.length>0?c.push("}"):s===c[c.length-1]&&c.pop(),0===c.length){if(";"===s){o.source.end=this.getPosition(t[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===s){a=!0;break}if("}"===s){if(l.length>0){for(n=l.length-1,r=l[n];r&&"space"===r[0];)r=l[--n];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),i&&(t=l[l.length-1],o.source.end=this.getPosition(t[3]||t[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let s,r=0;for(let n=t-1;n>=0&&(s=e[n],"space"===s[0]||(r+=1,2!==r));n--);throw this.input.error("Missed semicolon","word"===s[0]?s[3]+1:s[2])}colon(e){let t,s,r,n=0;for(let[o,i]of e.entries()){if(s=i,r=s[0],"("===r&&(n+=1),")"===r&&(n-=1),0===n&&":"===r){if(t){if("word"===t[0]&&"progid"===t[1])continue;return o}this.doubleColon(s)}t=s}return!1}comment(e){let s=new t;this.init(s,e[2]),s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++;let r=e[1].slice(2,-2);if(r.trim()){let e=r.match(/^(\s*)([^]*\S)(\s*)$/);s.text=e[2],s.raws.left=e[1],s.raws.right=e[3]}else s.text="",s.raws.left=r,s.raws.right=""}createTokenizer(){this.tokenizer=o(this.input)}decl(e,t){let r=new s;this.init(r,e[0][2]);let n,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let s=e[t],r=s[3]||s[2];if(r)return r}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i,a=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let s=this.stringFrom(e,t);s=this.spacesFromEnd(e)+s," !important"!==s&&(r.raws.important=s);break}if("important"===n[1].toLowerCase()){let s=e.slice(0),n="";for(let e=t;e>0;e--){let t=s[e][0];if(n.trim().startsWith("!")&&"space"!==t)break;n=s.pop()[1]+n}n.trim().startsWith("!")&&(r.important=!0,r.raws.important=n,e=s)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(r,"value",a.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new n;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,s=null,r=!1,n=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(s=l[0],a.push(l),"("===s||"["===s)n||(n=l),o.push("("===s?")":"]");else if(i&&r&&"{"===s)n||(n=l),o.push("}");else if(0===o.length){if(";"===s){if(r)return void this.decl(a,i);break}if("{"===s)return void this.rule(a);if("}"===s){this.tokenizer.back(a.pop()),t=!0;break}":"===s&&(r=!0)}else s===o[o.length-1]&&(o.pop(),0===o.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&r){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,s,r){let n,o,a,l,c=s.length,u="",h=!0;for(let e=0;e<c;e+=1)n=s[e],o=n[0],"space"!==o||e!==c-1||r?"comment"===o?(l=s[e-1]?s[e-1][0]:"empty",a=s[e+1]?s[e+1][0]:"empty",i[l]||i[a]||","===u.slice(-1)?h=!1:u+=n[1]):u+=n[1]:h=!1;if(!h){let r=s.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:u}}e[t]=u}rule(e){e.pop();let t=new n;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)s=e.pop()[1]+s;return s}spacesAndCommentsFromStart(e){let t,s="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)s+=e.shift()[1];return s}spacesFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)s=e.pop()[1]+s;return s}stringFrom(e,t){let s="";for(let r=t;r<e.length;r++)s+=e[r][1];return e.splice(t,e.length-t),s}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}}();function r(e,r){let n=new t(e,r),o=new s(n);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&r&&r.from&&(/\.scss$/i.test(r.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(r.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(r.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return Ke=r,r.default=r,e.registerParse(r),Ke}function Pt(){if(et)return Xe;et=1;class e{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return Xe=e,e.default=e,Xe}function $t(){if(st)return tt;st=1;let e=Pt();class t{get content(){return this.css}constructor(e,t,s){this.processor=e,this.messages=[],this.root=t,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(t,s={}){s.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(s.plugin=this.lastPlugin.postcssPlugin);let r=new e(t,s);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}}return tt=t,t.default=t,tt}function Rt(){if(nt)return rt;nt=1;let e={};return rt=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function jt(){if(it)return ot;it=1;let e=wt(),t=bt(),s=At(),r=Et(),n=$t(),o=kt(),i=ye(),{isClean:a,my:l}=dt(),c=Rt();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},p={Once:!0,postcssPlugin:!0,prepare:!0};function f(e){return"object"==typeof e&&"function"==typeof e.then}function d(e){let t=!1,s=u[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[s,s+"-"+t,0,s+"Exit",s+"Exit-"+t]:t?[s,s+"-"+t,s+"Exit",s+"Exit-"+t]:e.append?[s,0,s+"Exit"]:[s,s+"Exit"]}function m(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:d(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let y={};class w{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(t,s,o){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof s||null===s||"root"!==s.type&&"document"!==s.type)if(s instanceof w||s instanceof n)i=g(s.root),s.map&&(void 0===o.map&&(o.map={}),o.map.inline||(o.map.inline=!1),o.map.prev=s.map);else{let t=r;o.syntax&&(t=o.syntax.parse),o.parser&&(t=o.parser),t.parse&&(t=t.parse);try{i=t(s,o)}catch(e){this.processed=!0,this.error=e}i&&!i[l]&&e.rebuild(i)}else i=g(s);this.result=new n(t,i,o),this.helpers={...y,postcss:y,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let s=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(s.postcssVersion&&"production"!==process.env.NODE_ENV){let e=s.postcssPlugin,t=s.postcssVersion,r=this.result.processor.version,n=t.split("."),o=r.split(".");(n[0]!==o[0]||parseInt(n[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+r+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=s.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,s)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,s])};for(let t of this.plugins)if("object"==typeof t)for(let s in t){if(!h[s]&&/^[A-Z]/.test(s))throw new Error(`Unknown event ${s} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p[s])if("object"==typeof t[s])for(let r in t[s])e(t,"*"===r?s:s+"-"+r.toLowerCase(),t[s][r]);else"function"==typeof t[s]&&e(t,s,t[s])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],s=this.runOnRoot(t);if(f(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(f(e))try{await e}catch(e){let s=t[t.length-1].node;throw this.handleError(e,s)}}}if(this.listeners.OnceExit)for(let[t,s]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>s(e,this.helpers));await Promise.all(t)}else await s(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return f(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=i;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=this.result.root.source;if(void 0===e.map&&!(r&&r.input&&r.input.map)){let e="";return t(this.result.root,t=>{e+=t}),this.result.css=e,this.result}let n=new s(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(f(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[s,r]of e){let e;this.result.lastPlugin=s;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(f(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:s,visitors:r}=t;if("root"!==s.type&&"document"!==s.type&&!s.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,n]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return n(s.toProxy(),this.helpers)}catch(e){throw this.handleError(e,s)}}if(0!==t.iterator){let r,n=t.iterator;for(;r=s.nodes[s.indexes[n]];)if(s.indexes[n]+=1,!r[a])return r[a]=!0,void e.push(m(r));t.iterator=0,delete s.indexes[n]}let n=t.events;for(;t.eventIndex<n.length;){let e=n[t.eventIndex];if(t.eventIndex+=1,0===e)return void(s.nodes&&s.nodes.length&&(s[a]=!0,t.iterator=s.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=d(e);for(let s of t)if(0===s)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[s];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return w.registerPostcss=e=>{y=e},ot=w,w.default=w,o.registerLazyResult(w),t.registerLazyResult(w),ot}const _t=re(function(){if(pt)return ht;pt=1;let e=vt(),t=gt(),s=wt(),r=me(),n=yt(),o=bt(),i=function(){if(We)return Ve;We=1;let e=vt(),t=gt(),s=yt(),r=St(),n=Ct(),o=kt(),i=It();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:r.prototype};t.map&&(t.map={...t.map,__proto__:n.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new s(h);if("rule"===h.type)return new i(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return Ve=a,a.default=a,Ve}(),a=St(),l=jt(),c=Ot(),u=mt(),h=Et(),p=function(){if(ut)return ct;ut=1;let e=bt(),t=jt(),s=function(){if(lt)return at;lt=1;let e=At(),t=Et(),s=$t(),r=ye(),n=Rt();class o{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,s=t;try{e=s(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,n,o){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=o,this._map=void 0;let i=r;this.result=new s(this._processor,void 0,this._opts),this.result.css=n;let a=this;Object.defineProperty(this.result,"root",{get:()=>a.root});let l=new e(i,void 0,this._opts,n);if(l.isMap()){let[e,t]=l.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||n("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}}return at=o,o.default=o,at}(),r=kt();class n{constructor(e=[]){this.version="8.5.14",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let s of e)if(!0===s.postcss?s=s():s.postcss&&(s=s.postcss),"object"==typeof s&&Array.isArray(s.plugins))t=t.concat(s.plugins);else if("object"==typeof s&&s.postcssPlugin)t.push(s);else if("function"==typeof s)t.push(s);else{if("object"!=typeof s||!s.parse&&!s.stringify)throw new Error(s+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,r={}){return this.plugins.length||r.parser||r.stringifier||r.syntax?new t(this,e,r):new s(this,e,r)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return ct=n,n.default=n,r.registerProcessor(n),e.registerProcessor(n),ct}(),f=$t(),d=kt(),m=It(),g=ye(),y=Pt();function w(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new p(e)}return w.plugin=function(e,t){let s,r=!1;function n(...s){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let n=t(...s);return n.postcssPlugin=e,n.postcssVersion=(new p).version,n}return Object.defineProperty(n,"postcss",{get:()=>(s||(s=n()),s)}),n.process=function(e,t,s){return w([n(s)]).process(e,t)},n},w.stringify=g,w.parse=h,w.fromJSON=i,w.list=c,w.comment=e=>new t(e),w.atRule=t=>new e(t),w.decl=e=>new n(e),w.rule=e=>new m(e),w.root=e=>new d(e),w.document=e=>new o(e),w.CssSyntaxError=r,w.Declaration=n,w.Container=s,w.Processor=p,w.Document=o,w.Comment=t,w.Warning=y,w.AtRule=e,w.Result=f,w.Input=a,w.Rule=m,w.Root=d,w.Node=u,l.registerPostcss(w),ht=w,w.default=w,ht}());_t.stringify,_t.fromJSON,_t.plugin,_t.parse,_t.list,_t.document,_t.comment,_t.atRule,_t.rule,_t.decl,_t.root,_t.CssSyntaxError,_t.Declaration,_t.Container,_t.Processor,_t.Document,_t.Comment,_t.Warning,_t.AtRule,_t.Result,_t.Input,_t.Rule,_t.Root,_t.Node;const Mt=new Set(["body","html",":root","*"]);function Bt(e,t){return e&&e.trim()?_t([(s=`[data-vbi-type="${t}"]`,{postcssPlugin:"hc-scope",AtRule(e){if("import"===e.name)return console.warn("[hc-css-scope] @import 已被拒绝(防外部资源加载):",e.params),void e.remove();"font-face"===e.name&&console.warn("[hc-css-scope] @font-face 全局生效,font-family 命名注意冲突")},Rule(e){(function(e){let t=e.parent;for(;t&&"object"==typeof t;){const e=t;if("atrule"===e.type&&/keyframes$/i.test(e.name??""))return!0;t=e.parent}return!1})(e)||(e.selectors=e.selectors.map(e=>function(e,t){const s=e.trim();if(!s)return s;if(Mt.has(s))return t;for(const e of Mt){const r=s.charAt(e.length);if(s.startsWith(e)&&(" "===r||">"===r||"+"===r||"~"===r||","===r))return t+s.slice(e.length)}return`${t} ${s}`}(e,s)))}})]).process(e,{from:void 0}).css:"";var s}const Ut=new Map;function zt(e){let t=5381;for(let s=0;s<e.length;s++)t=(t<<5)+t+e.charCodeAt(s)|0;return(t>>>0).toString(36)}function Dt(e){const t=e.replace(/[^a-zA-Z0-9_-]/g,"_");return t===e?`hc-style-${t}`:`hc-style-${t}-${zt(e).slice(0,6)}`}function Lt(e,t){var s;const r=t??"",n=Dt(e),o=Ut.get(e);if(!r.trim())return null==(s=document.getElementById(n))||s.remove(),void(o&&Ut.set(e,{...o,cssHash:""}));const i=zt(r);if(o&&o.cssHash===i)return;let a;try{a=Bt(r,e)}catch(t){return void console.warn("[hc-css-scope]",e,"PostCSS process failed:",t)}!function(e,t){const s=Dt(e);let r=document.getElementById(s);r||(r=document.createElement("style"),r.id=s,r.setAttribute("data-hc-scope",e),document.head.appendChild(r)),r.textContent=t}(e,a),o?Ut.set(e,{...o,cssHash:i}):Ut.set(e,{cssHash:i,refCount:0})}function Ft(e,t){Lt(e,t);const s=Ut.get(e);s?Ut.set(e,{...s,refCount:s.refCount+1}):Ut.set(e,{cssHash:"",refCount:1})}function Nt(e){var t;const s=Ut.get(e);if(!s)return;const r=s.refCount-1;r<=0?(null==(t=document.getElementById(Dt(e)))||t.remove(),Ut.delete(e)):Ut.set(e,{...s,refCount:r})}function Tt(e){var t;null==(t=document.getElementById(Dt(e)))||t.remove(),Ut.delete(e)}function Vt(){return Ut.size}function Wt(){return[...Ut.entries()].map(([e,t])=>({scopeId:e,componentId:e,refCount:t.refCount,cssHash:t.cssHash}))}const Jt={key:1,class:"rounded-md border-2 border-rose-300 bg-rose-50 p-4 text-sm text-rose-900 space-y-2 min-h-[140px] overflow-auto"},Ht={class:"font-semibold flex items-center gap-1.5"},Yt={class:"font-mono text-xs text-rose-800 break-all"},Gt={key:0,class:"text-[10px] font-mono bg-rose-100/60 p-2 rounded overflow-auto max-h-60 text-rose-800"},Zt=s({__name:"ErrorBoundary",props:{label:{}},setup(e){const s=e,u=t(null),h=t(0),p=t(!1);function f(){u.value=null,p.value=!1,h.value++}return r(e=>(console.error(`[hc-eb${s.label?" "+s.label:""}]`,e),u.value=e,!1)),(t,s)=>(n(),o("div",{key:h.value,class:"hc-eb-root",style:{width:"100%",height:"100%"}},[u.value?(n(),o("div",Jt,[a("div",Ht,[s[1]||(s[1]=a("span",null,"⚠️",-1)),a("span",null,"组件渲染失败"+l(e.label?` — ${e.label}`:""),1)]),a("div",Yt,l(u.value.message),1),a("button",{class:"text-xs text-rose-700 hover:text-rose-900 underline",onClick:s[0]||(s[0]=e=>p.value=!p.value)},l(p.value?"隐藏":"展开")+"堆栈 ",1),p.value?(n(),o("pre",Gt,l(u.value.stack),1)):c("",!0),a("button",{class:"text-xs px-3 py-1 rounded bg-rose-600 hover:bg-rose-700 text-white transition-colors",onClick:f}," 重试 ")])):i(t.$slots,"default",{key:0})]))}}),qt=["data-vbi-id","data-vbi-type","data-vbi-canvas"],Kt={key:0,class:"rounded-md border-2 border-amber-300 bg-amber-50 p-4 text-sm text-amber-900 space-y-2 min-h-[140px] overflow-auto"},Qt={class:"text-[11px] font-mono break-all whitespace-pre-wrap"},Xt={key:1,class:"grid place-items-center min-h-[140px] text-xs text-zinc-400"},es=s({__name:"RuntimeBox",props:{instanceId:{},componentId:{},scopeId:{},canvasId:{},htmlSource:{},jsSource:{},cssSource:{default:""},customValues:{default:()=>({})},position:{},size:{},zIndex:{}},setup(e){const s=e,r=u(()=>s.scopeId??s.componentId),i=h(S,null),v=u(()=>s.canvasId??i??C),b=p(null),x=t(null),k=t(!1),O=t(0);f(()=>[s.htmlSource,s.jsSource],()=>{!async function(){k.value=!0,x.value=null;try{const e=await ee({html:s.htmlSource,js:s.jsSource});b.value=e,O.value++}catch(e){x.value=e instanceof Error?e:new Error(String(e)),b.value=null}finally{k.value=!1}}()},{immediate:!0});let I=!1;f(()=>[s.cssSource,r.value],([e,t],s)=>{const r=(null==s?void 0:s[1])??null;r&&r!==t?(Nt(r),Ft(t,e),I=!0):I?Lt(t,e):(Ft(t,e),I=!0)},{immediate:!0});const A=u(()=>{const e={width:"100%",height:"100%"};return s.position&&(e.position="absolute",e.left=`${s.position.x}px`,e.top=`${s.position.y}px`),void 0!==s.zIndex&&(e.zIndex=String(s.zIndex)),e});return d(()=>{I&&(Nt(r.value),I=!1)}),(t,s)=>(n(),o("div",{class:"_vbi_box","data-vbi-id":e.instanceId,"data-vbi-type":r.value,"data-vbi-canvas":v.value,style:m(A.value)},[x.value?(n(),o("div",Kt,[s[0]||(s[0]=a("div",{class:"font-semibold"},"⚠️ 编译失败",-1)),a("pre",Qt,l(x.value.message),1)])):k.value&&!b.value?(n(),o("div",Xt," 编译中… ")):b.value?(n(),g(Zt,{key:O.value,label:e.instanceId},{default:y(()=>[(n(),g(w(b.value.options),{"hc-custom-values":e.customValues,"hc-instance-id":e.instanceId,"hc-canvas-id":v.value,"hc-component-id":e.componentId},null,8,["hc-custom-values","hc-instance-id","hc-canvas-id","hc-component-id"]))]),_:1},8,["label"])):c("",!0)],12,qt))}}),ts="0.0.0-stage2b";export{C as DEFAULT_CANVAS_ID,Zt as ErrorBoundary,S as HC_CANVAS_ID_KEY,G as HC_INJECT_KEY,es as RuntimeBox,ts as VERSION,D as __resetLifecycleEmitter,z as __resetRegistry,F as assets,Ft as attachScope,te as clearCompileCache,ee as compileComponent,T as createCanvasesRegistry,W as createHyperCard,Wt as debugScopedCssRefs,Nt as detachScope,R as disposeCanvas,se as getCompileCacheSize,B as getInstance,Vt as getScopedCssCount,Lt as injectScopedCss,J as isVuePlugin,j as listCanvasIds,U as listInstances,I as onInstanceLifecycle,b as parseComponentSource,_ as register,$ as registerInCanvas,k as registryVersion,Tt as removeScopedCss,L as runtime,Bt as scopeCss,M as unregister};
1
+ import*as e from"vue";import{ref as t,defineComponent as s,onErrorCaptured as n,openBlock as r,createElementBlock as o,renderSlot as i,createElementVNode as a,toDisplayString as l,createCommentVNode as c,computed as u,inject as h,shallowRef as p,watch as f,onBeforeUnmount as d,normalizeStyle as m,createBlock as g,withCtx as y,resolveDynamicComponent as w}from"vue";import{p as v}from"./parseSourceEntry-BNu0kje7.js";import{a as b}from"./parseSourceEntry-BNu0kje7.js";function x(e){return{all:e=e||new Map,on:function(t,s){var n=e.get(t);n?n.push(s):e.set(t,[s])},off:function(t,s){var n=e.get(t);n&&(s?n.splice(n.indexOf(s)>>>0,1):e.set(t,[]))},emit:function(t,s){var n=e.get(t);n&&n.slice().map(function(e){e(s)}),(n=e.get("*"))&&n.slice().map(function(e){e(t,s)})}}}const C=new Map;function S(e,t){return`${e}::${t}`}function k(e,t,s){const n=Z(t,e);if(n)return void Object.assign(function(e){const t=e;return t._timings||(t._timings={}),t._timings}(n),s);const r=S(e,t),o=C.get(r)??{};C.set(r,{...o,...s})}function I(e,t){const s=S(e,t),n=C.get(s);return n?(C.delete(s),n):null}function O(e,t){const s=Z(t,e);return s?function(e){return e._timings}(s)??null:C.get(S(e,t))??null}function A(e,t){C.delete(S(e,t))}let E=0;function P(){E++}function $(){E>0?E--:console.warn("[hc-diagnostics] disableDiagnosticsEvents called more times than enableDiagnosticsEvents — ignored")}function R(){return E>0}function _(){E=0}const j=x(),M="__default__",B="__hcCanvasId",U=t(0),D=x();function z(e,t){const s=e=>{try{t(e)}catch(e){console.error("[hc-registry] instance lifecycle listener threw",e)}};return D.on(e,s),()=>D.off(e,s)}function L(e,t){D.emit(e,t)}const F=new Set,N=new Map,T=x();function V(e,t){return T.on(e,t),()=>T.off(e,t)}function W(e,t,s,n){var r;const o=function(e,t){return`${e}\0${t}`}(e,t);if(F.has(o)){const s=`[hc-registry] re-entrant registerInCanvas("${e}", "${t}") detected — a lifecycle listener tried to register the same id while the outer register is in flight. Nested register blocked to prevent state divergence; defer your register via microtask / setTimeout if you need to re-mount on lifecycle events.`;throw console.warn(s),new Error(s)}F.add(o);try{const o=!N.has(e),i=function(e){let t=N.get(e);return t||(t=new Map,N.set(e,t)),t}(e);i.has(t)&&(console.warn(`[hc-registry] instance ${t} already registered in canvas "${e}", overwriting`),null==(r=i.get(t))||r.__dispose(),i.delete(t),L("instance:unmounted",{canvasId:e,instanceId:t}));const a=function(e,t,s,n){const r=x();function o(n,r,o){if(R())try{j.emit("interaction",{canvasId:e,instanceId:t,componentId:s,kind:n,key:r,args:o,timestamp:performance.now()})}catch(e){console.warn(`[hc-registry] interactionEmitter.emit threw on ${n}("${r}"); diagnostic stream broken for this event`,e)}}return{instanceId:t,componentId:s,vm:n,call(e,...s){o("call",e,s);const r=n[e];if("function"!=typeof r)throw new Error(`[hc-registry] method "${e}" not found on instance ${t}`);return r.apply(n,s)},on:(e,t)=>(r.on(e,t),()=>r.off(e,t)),emit(e,t){o("emit",e,[t]),r.emit(e,t)},setProp(e,t){o("setProp",e,[t]),n[e]=t},setDataInput(e,s){o("setDataInput",e,[s]);const r=n.custom;if(!r||!(e in r))return void console.warn(`[hc-registry] setDataInput("${e}"): vm.custom["${e}"] not declared on instance ${t}; binding 改了一个未声明的 dataInput key,组件不会响应`);const i=r[e];i&&"object"==typeof i?!0===i.dataInput?i.value=s:console.warn(`[hc-registry] setDataInput("${e}"): vm.custom["${e}"] is not declared with dataInput:true on instance ${t}; 请在组件源码 custom.${e} 上加 \`dataInput: true\` 才能被 binding 灌入`):console.warn(`[hc-registry] setDataInput("${e}"): vm.custom["${e}"] not a {value:...} slot`)},__dispose(){r.all.clear()}}}(e,t,s,n);i.set(t,a);const l=I(e,t);return l&&(a._timings={...l}),U.value++,o&&T.emit("canvas:added",{canvasId:e}),L("instance:ready",{canvasId:e,instanceId:t}),a}finally{F.delete(o)}}function J(e){const t=N.get(e);if(!t)return;const s=[];for(const[n,r]of t)r.__dispose(),s.push(n),A(e,n);t.clear(),N.delete(e),U.value++;for(const t of s)L("instance:unmounted",{canvasId:e,instanceId:t});T.emit("canvas:removed",{canvasId:e})}function H(){return[...N.keys()]}function Y(e,t,s){return W(M,e,t,s)}function G(e,t=M){const s=N.get(t);if(!s)return;const n=s.get(e);n&&(n.__dispose(),s.delete(e),A(t,e),U.value++,L("instance:unmounted",{canvasId:t,instanceId:e}))}function Z(e,t){var s;if(void 0!==t)return(null==(s=N.get(t))?void 0:s.get(e))??null;let n=null;const r=[];for(const[t,s]of N){const o=s.get(e);o&&(n||(n=o),r.push(t))}return r.length>1&&console.warn(`[hc-registry] getInstance("${e}") matched ${r.length} canvases [${r.join(", ")}]; returning first. Prefer __HYPERCARD__.canvases.callComponent(canvasId, instanceId, ...) for explicit scope.`),n}function q(e){const t=null==e?void 0:e.componentId,s=t?e=>e.componentId===t:()=>!0;if(void 0!==(null==e?void 0:e.canvasId)){const t=N.get(e.canvasId);return t?[...t.values()].filter(s):[]}const n=[];for(const e of N.values())for(const t of e.values())s(t)&&n.push(t);return n}function K(){const e=[],t=[];for(const[s,n]of N){t.push(s);for(const[t,r]of n)r.__dispose(),e.push({canvasId:s,instanceId:t}),A(s,t)}N.clear(),U.value++;for(const t of e)L("instance:unmounted",t);for(const e of t)T.emit("canvas:removed",{canvasId:e})}function Q(){D.all.clear()}const X={getInstance:Z,listInstances:q,call(e,t,...s){const n=Z(e);if(n)return n.call(t,...s);console.debug(`[hc-runtime] call: instance "${e}" not found`)},on(e,t,s){const n=Z(e);if(n)return n.on(t,s);console.debug(`[hc-runtime] on: instance "${e}" not found`)},emit(e,t,s){const n=Z(e);n?n.emit(t,s):console.debug(`[hc-runtime] emit: instance "${e}" not found`)}},ee={pickerUrl:e=>`/a/${e}`};function te(e){return{canvasId:e,listInstances:t=>q({canvasId:e,componentId:null==t?void 0:t.componentId}),getInstance:t=>Z(t,e),call(t,s,...n){const r=Z(t,e);if(r)try{return r.call(s,...n)}catch(n){return void console.warn(`[hc-canvases] call error: canvas="${e}" instance="${t}" method="${s}":`,n)}else console.warn(`[hc-canvases] call: instance "${t}" not found in canvas "${e}"`)},emit(t,s,n){const r=Z(t,e);if(r)try{r.emit(s,n)}catch(n){console.warn(`[hc-canvases] emit error: canvas="${e}" instance="${t}" event="${s}":`,n)}else console.warn(`[hc-canvases] emit: instance "${t}" not found in canvas "${e}"`)},broadcastInCanvas(t,s){const n=q({canvasId:e});for(const r of n)try{r.emit(t,s)}catch(s){console.warn(`[hc-canvases] broadcastInCanvas: canvas="${e}" instance="${r.instanceId}" event="${t}" emit failed:`,s)}},dispose(){J(e)}}}function se(){return{list:()=>H().map(e=>te(e)),get:e=>H().includes(e)?te(e):null,getAll(){const e={};for(const t of H())e[t]=te(t);return e},callComponent(e,t,s,...n){const r=Z(t,e);if(r)try{return r.call(s,...n)}catch(n){return void console.warn(`[hc-canvases] callComponent error: canvas="${e}" instance="${t}" method="${s}":`,n)}else console.warn(`[hc-canvases] callComponent: canvas="${e}" instance="${t}" not found`)},emitToCanvas(e,t,s,n){const r=Z(t,e);if(r)try{r.emit(s,n)}catch(n){console.warn(`[hc-canvases] emitToCanvas error: canvas="${e}" instance="${t}" event="${s}":`,n)}else console.warn(`[hc-canvases] emitToCanvas: canvas="${e}" instance="${t}" not found`)},broadcast(e,t){for(const s of H())try{const n=q({canvasId:s});for(const r of n)try{r.emit(e,t)}catch(t){console.warn(`[hc-canvases] broadcast: canvas="${s}" instance="${r.instanceId}" event="${e}" emit failed:`,t)}}catch(t){console.warn(`[hc-canvases] broadcast: canvas="${s}" event="${e}" failed:`,t)}}}}const ne=new Set(["vue","Vue","window","global","globalThis","console","document","process","$","libs","runtime","assets","version"]);function re(e={}){const t=e.strict??!1,s=e.libs??{},n=e.version??"v1";return{install(e){const r=Object.entries(s),o=r.filter(([,e])=>oe(e)),i=r.filter(([e])=>ne.has(e)),a=[`[hypercard] 已注册 ${r.length} 个 libs:`];for(const[e,t]of r)a.push(` ${e.padEnd(16)} ${ae(t)}`);console.info(a.join("\n"));const l=[];o.length>1&&l.push(`检测到 ${o.length} 个 Vue plugin(${o.map(([e])=>e).join(", ")}),请确认全局组件命名不冲突`);for(const[e]of i)l.push(`lib 名 "${e}" 是保留词,建议改名`);if(l.length>0){const e=l.map(e=>` - ${e}`).join("\n");if(t)throw new Error(`[hypercard] strict mode 阻止启动:\n${e}`);console.warn(`[hypercard] 警告:\n${e}`)}for(const[s,n]of o){const[r,o]=ie(n);try{e.use(r,...o)}catch(e){if(console.error(`[hypercard] app.use("${s}") 失败:`,e),t)throw e}}const c={};for(const[e,t]of r){const[s]=ie(t);c[e]=s}const u={libs:c,runtime:X,assets:ee,version:n,canvases:se()};e.provide(le,u),e.config.globalProperties.$hc=u,"undefined"!=typeof window&&(window.__HYPERCARD__=u)}}}function oe(e){return Array.isArray(e)&&e.length>=1?oe(e[0]):"object"==typeof e&&null!==e&&"function"==typeof e.install}function ie(e){return Array.isArray(e)&&e.length>=1?[e[0],e.slice(1)]:[e,[]]}function ae(e){return oe(e)?Array.isArray(e)?"✓ Vue plugin (with options) → 已 app.use":"✓ Vue plugin → 已 app.use":"function"==typeof e?"· function":Array.isArray(e)?"· array":"object"==typeof e&&null!==e?"· object":"· "+typeof e}const le="__HYPERCARD__",ce=new Set(["init","onClick","onMouseover","onMouseout","onResize","onDestroy"]),ue=new Map;function he(e,t){for(ue.has(e)&&ue.delete(e),ue.set(e,t);ue.size>100;){const e=ue.keys().next().value;if(void 0===e)break;ue.delete(e)}}function pe(e){let t=5381;for(let s=0;s<e.length;s++)t=(t<<5)+t+e.charCodeAt(s)|0;return(t>>>0).toString(36)}function fe(e){if(!Array.isArray(e))return[];const t=[];for(const s of e){if(!s||"object"!=typeof s)continue;const e=s;if("string"!=typeof e.name)continue;const n={name:e.name};"boolean"==typeof e.multiple&&(n.multiple=e.multiple),Array.isArray(e.accepts)&&(n.accepts=e.accepts.filter(e=>"string"==typeof e)),"number"==typeof e.maxChildren&&(n.maxChildren=e.maxChildren),"string"==typeof e.label&&(n.label=e.label),t.push(n)}return t}async function de(t){const s=pe(t.html)+"_"+pe(t.js),n=ue.get(s);if(n)return he(s,n),n;const r=(async()=>function(t,s){if(!t||"object"!=typeof t)throw new Error("[hc-compile] component.js must `export default` an object");const n=t,r=n.name,o=n.method??{},i=n.attribute??{},a=n.custom??{},l=n.style??{},c=n.slots,u=n.data,h=n.methods??{},p=n.computed,f=n.watch,d=n.created,m=n.mounted,g=n.beforeUnmount,y=n.props,w=new Set(["name","method","attribute","custom","style","option","data","methods","computed","watch","created","mounted","beforeUnmount","props","slots"]),v={};for(const e of Object.keys(n))w.has(e)||(v[e]=n[e]);const b={};for(const[e,t]of Object.entries(o))ce.has(e)||"function"!=typeof t||(b[e]=t);const x=Object.keys(b),C={...b,...h},S=(s??"").trim()||"<div></div>";return{options:{render:e.compile(S),props:{...y?Array.isArray(y)?Object.fromEntries(y.map(e=>[e,null])):"object"==typeof y?y:{}:{},hcCustomValues:{type:Object,default:()=>({})},hcInstanceId:{type:String,default:""},hcCanvasId:{type:String,default:""},hcComponentId:{type:String,default:""}},data(){const e="function"==typeof u?u.call(this):u??{},t=this.hcCustomValues??{},s={};for(const[e,n]of Object.entries(a)){let r;try{r=JSON.parse(JSON.stringify(n??{}))}catch{r={...n??{}}}e in t&&r&&"object"==typeof r&&(r.value=t[e]),s[e]=r}return{custom:s,...e}},methods:C,computed:p,watch:(()=>{const e=f&&"object"==typeof f?{...f}:{};return e.hcCustomValues={handler(e){if(e&&this.custom)for(const[t,s]of Object.entries(e)){const e=this.custom[t];e&&"object"==typeof e&&(e.value=s)}},deep:!0},e})(),created(){this.hcInstanceId&&this.hcCanvasId&&W(this.hcCanvasId,this.hcInstanceId,this.hcComponentId,this),"function"==typeof d&&d.call(this)},mounted(){try{const e=[],t=this.$el;if(t&&t instanceof HTMLElement){Object.assign(t.style,l);for(const[e,s]of Object.entries(i))"string"==typeof s&&s&&t.setAttribute(e,s);for(const s of ce){if("init"===s)continue;const n=o[s];if("function"==typeof n){const r=s.replace(/^on/,"").toLowerCase(),o=e=>{n.call(this,{event:e,data:e})};t.addEventListener(r,o),e.push(()=>t.removeEventListener(r,o))}}}this.__hcCleanup=e;const s=o.init;"function"==typeof s&&s.call(this),"function"==typeof m&&m.call(this)}finally{const e=this.hcInstanceId,t=this.hcCanvasId;"string"==typeof e&&e.length>0&&"string"==typeof t&&t.length>0&&k(t,e,{mountEndedAt:performance.now()})}},beforeUnmount(){var e;this.hcInstanceId&&this.hcCanvasId&&G(this.hcInstanceId,this.hcCanvasId),null==(e=this.__hcCleanup)||e.forEach(e=>{try{e()}catch{}}),this.__hcCleanup=void 0,"function"==typeof g&&g.call(this)},...v},meta:{name:r,attribute:i,style:l,customDecl:a,methodNames:x,slotsDecl:fe(c)}}}(function(e){let t;try{const s=v(e,{ecmaVersion:"latest",sourceType:"module",allowAwaitOutsideFunction:!0}).body.find(e=>"ExportDefaultDeclaration"===e.type);if(!s)throw new Error("[hc-compile] component.js must `export default` an object");t=e.slice(0,s.start)+"module.exports = "+e.slice(s.declaration.start)}catch(e){throw e instanceof Error?e:new Error(String(e))}const s=new Function("module","exports",`"use strict";\n${t}\n;return module.exports;`),n={exports:{}};try{return s(n,n.exports)}catch(e){throw e instanceof Error?e:new Error(String(e))}}(t.js),t.html))();return he(s,r),r.catch(()=>ue.delete(s)),r}function me(){ue.clear()}function ge(){return ue.size}function ye(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function we(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var s=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),s}var ve,be={exports:{}};function xe(){if(ve)return be.exports;ve=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return be.exports=t(),be.exports.createColors=t,be.exports}const Ce=we(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Se,ke,Ie,Oe,Ae,Ee;function Pe(){if(ke)return Se;ke=1;let e=xe(),t=Ce;class s extends Error{constructor(e,t,n,r,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),r&&(this.source=r),i&&(this.plugin=i),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,s)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(s){if(!this.source)return"";let n=this.source;null==s&&(s=e.isColorSupported);let r=e=>e,o=e=>e,i=e=>e;if(s){let{bold:s,gray:n,red:a}=e.createColors(!0);o=e=>s(a(e)),r=e=>n(e),t&&(i=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let s=l+1+t,n=" "+(" "+s).slice(-u)+" | ";if(s===this.line){if(e.length>160){let t=20,s=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(s,a),c=r(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return o(">")+r(n)+i(l)+"\n "+c+o("^")}let t=r(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return o(">")+r(n)+i(e)+"\n "+t+o("^")}return" "+r(n)+i(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Se=s,s.default=s,Se}function $e(){if(Oe)return Ie;Oe=1;const e=/(<)(\/?style\b)/gi,t=/(<)(!--)/g;function s(s){return"string"!=typeof s?s:s.includes("<")?s.replace(e,"\\3c $2").replace(t,"\\3c $2"):s}const n={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class r{constructor(e){this.builder=e}atrule(e,t){let n=e.raws,r="@"+e.name,o=e.params?this.rawValue(e,"params"):"";if(void 0!==n.afterName?r+=n.afterName:o&&(r+=" "),e.nodes)this.block(e,r+o);else{let i=(n.between||"")+(t?";":"");this.builder(s(r+o+i),e)}}beforeAfter(e,t){let s;s="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,r=0;for(;n&&"root"!==n.type;)r+=1,n=n.parent;if(s.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<r;e++)s+=t}return s}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(s(t+r)+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(s(n)),this.builder("}",e,"end")}body(e){let t=e.nodes,n=t.length-1;for(;n>0&&"comment"===t[n].type;)n-=1;let r=this.raw(e,"semicolon"),o="document"===e.type;for(let e=0;e<t.length;e++){let i=t[e],a=this.raw(i,"before");a&&this.builder(o?a:s(a)),this.stringify(i,n!==e||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder(s("/*"+t+e.text+n+"*/"),e)}decl(e,t){let n=e.raws,r=this.raw(e,"between","colon"),o=e.prop+r+this.rawValue(e,"value");e.important&&(o+=n.important||" !important"),t&&(o+=";"),this.builder(s(o),e)}document(e){this.body(e)}raw(e,t,s){let r;if(s||(s=t),t&&(r=e.raws[t],void 0!==r))return r;let o=e.parent;if("before"===s){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}if(!o)return n[s];let i=e.root(),a=i.rawCache||(i.rawCache={});if(void 0!==a[s])return a[s];if("before"===s||"after"===s)return this.beforeAfter(e,s);{let n="raw"+((l=s)[0].toUpperCase()+l.slice(1));this[n]?r=this[n](i,e):i.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var l;return void 0===r&&(r=n[s]),a[s]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let s;return e.walkComments(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(e,t){let s;return e.walkDecls(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(s=>{if(s.nodes&&(s.parent!==e||e.first!==s)&&void 0!==s.raws.before)return t=s.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(s=>{let n=s.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==s.raws.before){let e=s.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let s=e[t],n=e.raws[t];return n&&n.value===s?n.raw:s}root(e){if(this.body(e),e.raws.after){let t=e.raws.after,n=e.parent&&"document"===e.parent.type;this.builder(n?t:s(t))}}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(s(e.raws.ownSemicolon),e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}return Ie=r,r.default=r,Ie}function Re(){if(Ee)return Ae;Ee=1;let e=$e();function t(t,s){new e(s).stringify(t)}return Ae=t,t.default=t,Ae}var _e,je,Me,Be,Ue,De,ze,Le,Fe,Ne,Te,Ve,We,Je,He,Ye,Ge,Ze,qe,Ke,Qe,Xe,et,tt,st,nt,rt,ot,it,at,lt,ct,ut,ht,pt,ft,dt,mt,gt,yt,wt,vt,bt,xt,Ct,St,kt,It,Ot,At={};function Et(){return _e||(_e=1,At.isClean=Symbol("isClean"),At.my=Symbol("my")),At}function Pt(){if(Me)return je;Me=1;let e=Pe(),t=$e(),s=Re(),{isClean:n,my:r}=Et();function o(e,t){let s=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let r=e[n],i=typeof r;"parent"===n&&"object"===i?t&&(s[n]=t):"source"===n?s[n]=r:Array.isArray(r)?s[n]=r.map(e=>o(e,s)):("object"===i&&null!==r&&(r=o(r)),s[n]=r)}return s}function i(e,t){if(t&&void 0!==t.offset)return t.offset;let s=1,n=1,r=0;for(let o=0;o<e.length;o++){if(n===t.line&&s===t.column){r=o;break}"\n"===e[o]?(s=1,n+=1):s+=1}return r}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[r]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let s of e[t])"function"==typeof s.clone?this.append(s.clone()):this.append(s)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=o(this);for(let s in e)t[s]=e[s];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(t,s={}){if(this.source){let{end:e,start:n}=this.rangeBy(s);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},s)}return new e(t)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let s="document"in this.source.input?this.source.input.document:this.source.input.css,n=s.slice(i(s,this.source.start),i(s,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,s=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,r=i(n,this.source.start),o=r+e;for(let e=r;e<o;e++)"\n"===n[e]?(t=1,s+=1):t+=1;return{column:t,line:s,offset:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,s={column:this.source.start.column,line:this.source.start.line,offset:i(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:i(t,this.source.end)+1}:{column:s.column+1,line:s.line,offset:s.offset+1};if(e.word){let r=t.slice(i(t,this.source.start),i(t,this.source.end)).indexOf(e.word);-1!==r&&(s=this.positionInside(r),n=this.positionInside(r+e.word.length))}else e.start?s={column:e.start.column,line:e.start.line,offset:i(t,e.start)}:e.index&&(s=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:i(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<s.line||n.line===s.line&&n.column<=s.column)&&(n={column:s.column+1,line:s.line,offset:s.offset+1}),{end:n,start:s}}raw(e,s){return(new t).raw(this,e,s)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,s=!1;for(let n of e)n===this?s=!0:s?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);s||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let s={},n=null==t;t=t||new Map;let r=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))s[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)s[e]=n.toJSON(null,t);else if("source"===e){if(null==n)continue;let o=t.get(n.input);null==o&&(o=r,t.set(n.input,r),r++),s[e]={end:n.end,inputId:o,start:n.start}}else s[e]=n}return n&&(s.inputs=[...t.keys()].map(e=>e.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=s){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,s={}){let n={node:this};for(let e in s)n[e]=s[e];return e.warn(t,n)}}return je=a,a.default=a,je}function $t(){if(Ue)return Be;Ue=1;let e=Pt();class t extends e{constructor(e){super(e),this.type="comment"}}return Be=t,t.default=t,Be}function Rt(){if(ze)return De;ze=1;let e=Pt();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return De=t,t.default=t,De}function _t(){if(Fe)return Le;Fe=1;let e,t,s,n,r=$t(),o=Rt(),i=Pt(),{isClean:a,my:l}=Et();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends i{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,s,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],s=e(this.proxyOf.nodes[t],t),!1!==s);)this.indexes[n]+=1;return delete this.indexes[n],s}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...s)=>e[t](...s.map(e=>"function"==typeof e?(t,s)=>e(t.toProxy(),s):e)):"every"===t||"some"===t?s=>e[t]((e,...t)=>s(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let s,n=this.index(e),r=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of r)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)s=this.indexes[e],n<s&&(this.indexes[e]=s+r.length);return this.markDirty(),this}insertBefore(e,t){let s,n=this.index(e),r=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],r).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)s=this.indexes[e],n<=s&&(this.indexes[e]=s+o.length);return this.markDirty(),this}normalize(s,i){if("string"==typeof s)s=c(t(s).nodes);else if(void 0===s)s=[];else if(Array.isArray(s)){s=s.slice(0);for(let e of s)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===s.type&&"document"!==this.type){s=s.nodes.slice(0);for(let e of s)e.parent&&e.parent.removeChild(e,"ignore")}else if(s.type)s=[s];else if(s.prop){if(void 0===s.value)throw new Error("Value field is missed in node creation");"string"!=typeof s.value&&(s.value=String(s.value)),s=[new o(s)]}else if(s.selector||s.selectors)s=[new n(s)];else if(s.name)s=[new e(s)];else{if(!s.text)throw new Error("Unknown node type in node creation");s=[new r(s)]}return s.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&i&&void 0!==i.raws.before&&(e.raws.before=i.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let s in this.indexes)t=this.indexes[s],t>=e&&(this.indexes[s]=t-1);return this.markDirty(),this}replaceValues(e,t,s){return s||(s=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,s))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,s)=>{let n;try{n=e(t,s)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((s,n)=>{if("atrule"===s.type&&e.test(s.name))return t(s,n)}):this.walk((s,n)=>{if("atrule"===s.type&&s.name===e)return t(s,n)}):(t=e,this.walk((e,s)=>{if("atrule"===e.type)return t(e,s)}))}walkComments(e){return this.walk((t,s)=>{if("comment"===t.type)return e(t,s)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((s,n)=>{if("decl"===s.type&&e.test(s.prop))return t(s,n)}):this.walk((s,n)=>{if("decl"===s.type&&s.prop===e)return t(s,n)}):(t=e,this.walk((e,s)=>{if("decl"===e.type)return t(e,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((s,n)=>{if("rule"===s.type&&e.test(s.selector))return t(s,n)}):this.walk((s,n)=>{if("rule"===s.type&&s.selector===e)return t(s,n)}):(t=e,this.walk((e,s)=>{if("rule"===e.type)return t(e,s)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{s=e},Le=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,o.prototype):"comment"===t.type?Object.setPrototypeOf(t,r.prototype):"root"===t.type&&Object.setPrototypeOf(t,s.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},Le}function jt(){if(Te)return Ne;Te=1;let e=_t();class t extends e{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return Ne=t,t.default=t,e.registerAtRule(t),Ne}function Mt(){if(We)return Ve;We=1;let e,t,s=_t();class n extends s{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(s={}){return new e(new t,this,s).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Ve=n,n.default=n,Ve}function Bt(){return He?Je:(He=1,Je={nanoid:(e=21)=>{let t="",s=0|e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(s=t)=>{let n="",r=0|s;for(;r--;)n+=e[Math.random()*e.length|0];return n}})}function Ut(){if(Ge)return Ye;Ge=1;let{existsSync:e,readFileSync:t}=Ce,{dirname:s,join:n}=Ce,{SourceMapConsumer:r,SourceMapGenerator:o}=Ce;class i{constructor(e,t){if(!1===t.map)return;t.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=s(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new r(this.json||this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let s=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(s)return n=e.substr(s[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let r=e.slice(22);throw r=r.slice(0,r.indexOf(",")),new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let s=e.lastIndexOf(t.pop()),n=e.indexOf("*/",s);s>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(s,n)))}loadFile(n,r,o){if(o||this.unsafeMap||/\.map$/i.test(n))return this.root=s(n),e(n)?(this.mapFile=n,t(n,"utf-8").toString().trim()):void 0}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof r)return o.fromSourceMap(t).toString();if(t instanceof o)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let s=t(e);if(s){let t=this.loadFile(s,e,!0);if(!t)throw new Error("Unable to load previous source map: "+s.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;e&&(t=n(s(e),t));let r=this.loadFile(t,e,!1);if(r)try{this.json=JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return r}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Ye=i,i.default=i,Ye}function Dt(){if(qe)return Ze;qe=1;let{nanoid:e}=Bt(),{isAbsolute:t,resolve:s}=Ce,{SourceMapConsumer:n,SourceMapGenerator:r}=Ce,{fileURLToPath:o,pathToFileURL:i}=Ce,a=Pe(),l=Ut(),c=Ce,u=Symbol("lineToIndexCache"),h=Boolean(n&&r),p=Boolean(s&&t);function f(e){if(e[u])return e[u];let t=e.css.split("\n"),s=new Array(t.length),n=0;for(let e=0,r=t.length;e<r;e++)s[e]=n,n+=t[e].length+1;return e[u]=s,s}class d{get from(){return this.file||this.id}constructor(n,r={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,r.document&&(this.document=r.document.toString()),r.from&&(!p||/^\w+:\/\//.test(r.from)||t(r.from)?this.file=r.from:this.file=s(r.from)),p&&h){let e=new l(this.css,r);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,s,n={}){let r,o,l,c,u;if(t&&"object"==typeof t){let e=t,n=s;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,s=n.col}else t=e.line,s=e.column,c=this.fromLineAndColumn(t,s);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);o=e.line,r=e.col}else o=n.line,r=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(s)c=this.fromLineAndColumn(t,s);else{c=t;let e=this.fromOffset(c);t=e.line,s=e.col}let h=this.origin(t,s,o,r);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===o?t:{column:s,line:t},void 0===o?s:{column:r,line:o},this.css,this.file,n.plugin),u.input={column:s,endColumn:r,endLine:o,endOffset:l,line:t,offset:c,source:this.css},this.file&&(i&&(u.input.url=i(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return f(this)[e-1]+t-1}fromOffset(e){let t=f(this),s=0;if(e>=t[t.length-1])s=t.length-1;else{let n,r=t.length-2;for(;s<r;)if(n=s+(r-s>>1),e<t[n])r=n-1;else{if(!(e>=t[n+1])){s=n;break}s=n+1}}return{col:e-t[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:s(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,s,n,r){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:s,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:r,line:n})),l=t(u.source)?i(u.source):new URL(u.source,this.map.consumer().sourceRoot||i(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!o)throw new Error("file: protocol is not available in this PostCSS build");h.file=o(l)}let p=c.sourceContentFor(u.source);return p&&(h.source=p),h}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}}return Ze=d,d.default=d,c&&c.registerInput&&c.registerInput(d),Ze}function zt(){if(Qe)return Ke;Qe=1;let e,t,s=_t();class n extends s{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,s){let n=super.normalize(e);if(t)if("prepend"===s)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let s=this.index(e);return!t&&0===s&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(e)}toResult(s={}){return new e(new t,this,s).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Ke=n,n.default=n,s.registerRoot(n),Ke}function Lt(){if(et)return Xe;et=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,s){let n=[],r="",o=!1,i=0,a=!1,l="",c=!1;for(let s of e)c?c=!1:"\\"===s?c=!0:a?s===l&&(a=!1):'"'===s||"'"===s?(a=!0,l=s):"("===s?i+=1:")"===s?i>0&&(i-=1):0===i&&t.includes(s)&&(o=!0),o?(""!==r&&n.push(r.trim()),r="",o=!1):r+=s;return(s||""!==r)&&n.push(r.trim()),n}};return Xe=e,e.default=e,Xe}function Ft(){if(st)return tt;st=1;let e=_t(),t=Lt();class s extends e{get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,s=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(s)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return tt=s,s.default=s,e.registerRule(s),tt}function Nt(){if(it)return ot;it=1;let{dirname:e,relative:t,resolve:s,sep:n}=Ce,{SourceMapConsumer:r,SourceMapGenerator:o}=Ce,{pathToFileURL:i}=Ce,a=Dt(),l=Boolean(r&&o),c=Boolean(e&&s&&t&&n);return ot=class{constructor(e,t,s,n){this.stringify=e,this.mapOpts=s.map||{},this.root=t,this.opts=s,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let s,n=this.toUrl(this.path(t.file)),o=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(s=new r(t.text),s.sourcesContent&&(s.sourcesContent=null)):s=t.consumer(),this.map.applySourceMap(s,n,this.toUrl(this.path(o)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else if(this.css){let e;for(;-1!==(e=this.css.lastIndexOf("/*#"));){let t=this.css.indexOf("*/",e+3);if(-1===t)break;for(;e>0&&"\n"===this.css[e-1];)e--;this.css=this.css.slice(0,e)+this.css.slice(t+2)}}}generate(){if(this.clearAnnotation(),c&&l&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=o.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new o({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new o({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,s=1,n=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=s,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),t=o.match(/\n/g),t?(s+=t.length,e=o.lastIndexOf("\n"),n=o.length-e):n+=o.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=s,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=s,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let r=this.memoizedPaths.get(n);if(r)return r;let o=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=e(s(o,this.mapOpts.annotation)));let i=t(o,n);return this.memoizedPaths.set(n,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new a(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let s=t.source.input.from;if(s&&!e[s]){e[s]=!0;let n=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(i){let t=i(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===n&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}}}function Tt(){if(pt)return ht;pt=1;let e=_t(),t=Dt(),s=function(){if(ut)return ct;ut=1;let e=jt(),t=$t(),s=Rt(),n=zt(),r=Ft(),o=function(){if(lt)return at;lt=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),s="\\".charCodeAt(0),n="/".charCodeAt(0),r="\n".charCodeAt(0),o=" ".charCodeAt(0),i="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),p=")".charCodeAt(0),f="{".charCodeAt(0),d="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),y=":".charCodeAt(0),w="@".charCodeAt(0),v=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,x=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return at=function(S,k={}){let I,O,A,E,P,$,R,_,j,M,B=S.css.valueOf(),U=k.ignoreErrors,D=B.length,z=0,L=[],F=[],N=-1;function T(e){throw S.error("Unclosed "+e,z)}return{back:function(e){F.push(e)},endOfFile:function(){return 0===F.length&&z>=D},nextToken:function(S){if(F.length)return F.pop();if(z>=D)return;let k=!!S&&S.ignoreUnclosed;switch(I=B.charCodeAt(z),I){case r:case o:case a:case l:case i:E=z;do{E+=1,I=B.charCodeAt(E)}while(I===o||I===r||I===a||I===l||I===i);$=["space",B.slice(z,E)],z=E-1;break;case c:case u:case f:case d:case y:case m:case p:{let e=String.fromCharCode(I);$=[e,e,z];break}case h:if(M=L.length?L.pop()[1]:"",j=B.charCodeAt(z+1),"url"===M&&j!==e&&j!==t&&j!==o&&j!==r&&j!==a&&j!==i&&j!==l){E=z;do{if(R=!1,E=B.indexOf(")",E+1),-1===E){if(U||k){E=z;break}T("bracket")}for(_=E;B.charCodeAt(_-1)===s;)_-=1,R=!R}while(R);$=["brackets",B.slice(z,E+1),z,E],z=E}else z<=N?$=["(","(",z]:(E=B.indexOf(")",z+1),O=B.slice(z,E+1),-1===E||x.test(O)?(N=-1===E?D:E,$=["(","(",z]):($=["brackets",O,z,E],z=E));break;case e:case t:P=I===e?"'":'"',E=z;do{if(R=!1,E=B.indexOf(P,E+1),-1===E){if(U||k){E=z+1;break}T("string")}for(_=E;B.charCodeAt(_-1)===s;)_-=1,R=!R}while(R);$=["string",B.slice(z,E+1),z,E],z=E;break;case w:v.lastIndex=z+1,v.test(B),E=0===v.lastIndex?B.length-1:v.lastIndex-2,$=["at-word",B.slice(z,E+1),z,E],z=E;break;case s:for(E=z,A=!0;B.charCodeAt(E+1)===s;)E+=1,A=!A;if(I=B.charCodeAt(E+1),A&&I!==n&&I!==o&&I!==r&&I!==a&&I!==l&&I!==i&&(E+=1,C.test(B.charAt(E)))){for(;C.test(B.charAt(E+1));)E+=1;B.charCodeAt(E+1)===o&&(E+=1)}$=["word",B.slice(z,E+1),z,E],z=E;break;default:I===n&&B.charCodeAt(z+1)===g?(E=B.indexOf("*/",z+2)+1,0===E&&(U||k?E=B.length:T("comment")),$=["comment",B.slice(z,E+1),z,E],z=E):(b.lastIndex=z+1,b.test(B),E=0===b.lastIndex?B.length-1:b.lastIndex-2,$=["word",B.slice(z,E+1),z,E],L.push($),z=E)}return z++,$},position:function(){return z}}}}();const i={empty:!0,space:!0};return ct=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let s,n,r,o=new e;o.name=t[1].slice(1),""===o.name&&this.unnamedAtrule(o,t),this.init(o,t[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(s=(t=this.tokenizer.nextToken())[0],"("===s||"["===s?c.push("("===s?")":"]"):"{"===s&&c.length>0?c.push("}"):s===c[c.length-1]&&c.pop(),0===c.length){if(";"===s){o.source.end=this.getPosition(t[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===s){a=!0;break}if("}"===s){if(l.length>0){for(r=l.length-1,n=l[r];n&&"space"===n[0];)n=l[--r];n&&(o.source.end=this.getPosition(n[3]||n[2]),o.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),i&&(t=l[l.length-1],o.source.end=this.getPosition(t[3]||t[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let s,n=0;for(let r=t-1;r>=0&&(s=e[r],"space"===s[0]||(n+=1,2!==n));r--);throw this.input.error("Missed semicolon","word"===s[0]?s[3]+1:s[2])}colon(e){let t,s,n,r=0;for(let[o,i]of e.entries()){if(s=i,n=s[0],"("===n&&(r+=1),")"===n&&(r-=1),0===r&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return o}this.doubleColon(s)}t=s}return!1}comment(e){let s=new t;this.init(s,e[2]),s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++;let n=e[1].slice(2,-2);if(n.trim()){let e=n.match(/^(\s*)([^]*\S)(\s*)$/);s.text=e[2],s.raws.left=e[1],s.raws.right=e[3]}else s.text="",s.raws.left=n,s.raws.right=""}createTokenizer(){this.tokenizer=o(this.input)}decl(e,t){let n=new s;this.init(n,e[0][2]);let r,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let s=e[t],n=s[3]||s[2];if(n)return n}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,a=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let s=this.stringFrom(e,t);s=this.spacesFromEnd(e)+s," !important"!==s&&(n.raws.important=s);break}if("important"===r[1].toLowerCase()){let s=e.slice(0),r="";for(let e=t;e>0;e--){let t=s[e][0];if(r.trim().startsWith("!")&&"space"!==t)break;r=s.pop()[1]+r}r.trim().startsWith("!")&&(n.important=!0,n.raws.important=r,e=s)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new r;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,s=null,n=!1,r=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(s=l[0],a.push(l),"("===s||"["===s)r||(r=l),o.push("("===s?")":"]");else if(i&&n&&"{"===s)r||(r=l),o.push("}");else if(0===o.length){if(";"===s){if(n)return void this.decl(a,i);break}if("{"===s)return void this.rule(a);if("}"===s){this.tokenizer.back(a.pop()),t=!0;break}":"===s&&(n=!0)}else s===o[o.length-1]&&(o.pop(),0===o.length&&(r=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(r),t&&n){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,s,n){let r,o,a,l,c=s.length,u="",h=!0;for(let e=0;e<c;e+=1)r=s[e],o=r[0],"space"!==o||e!==c-1||n?"comment"===o?(l=s[e-1]?s[e-1][0]:"empty",a=s[e+1]?s[e+1][0]:"empty",i[l]||i[a]||","===u.slice(-1)?h=!1:u+=r[1]):u+=r[1]:h=!1;if(!h){let n=s.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new r;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)s=e.pop()[1]+s;return s}spacesAndCommentsFromStart(e){let t,s="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)s+=e.shift()[1];return s}spacesFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)s=e.pop()[1]+s;return s}stringFrom(e,t){let s="";for(let n=t;n<e.length;n++)s+=e[n][1];return e.splice(t,e.length-t),s}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}}();function n(e,n){let r=new t(e,n),o=new s(r);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return ht=n,n.default=n,e.registerParse(n),ht}function Vt(){if(dt)return ft;dt=1;class e{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return ft=e,e.default=e,ft}function Wt(){if(gt)return mt;gt=1;let e=Vt();class t{get content(){return this.css}constructor(e,t,s){this.processor=e,this.messages=[],this.root=t,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(t,s={}){s.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(s.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,s);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}}return mt=t,t.default=t,mt}function Jt(){if(wt)return yt;wt=1;let e={};return yt=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Ht(){if(bt)return vt;bt=1;let e=_t(),t=Mt(),s=Nt(),n=Tt(),r=Wt(),o=zt(),i=Re(),{isClean:a,my:l}=Et(),c=Jt();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},p={Once:!0,postcssPlugin:!0,prepare:!0};function f(e){return"object"==typeof e&&"function"==typeof e.then}function d(e){let t=!1,s=u[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[s,s+"-"+t,0,s+"Exit",s+"Exit-"+t]:t?[s,s+"-"+t,s+"Exit",s+"Exit-"+t]:e.append?[s,0,s+"Exit"]:[s,s+"Exit"]}function m(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:d(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let y={};class w{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(t,s,o){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof s||null===s||"root"!==s.type&&"document"!==s.type)if(s instanceof w||s instanceof r)i=g(s.root),s.map&&(void 0===o.map&&(o.map={}),o.map.inline||(o.map.inline=!1),o.map.prev=s.map);else{let t=n;o.syntax&&(t=o.syntax.parse),o.parser&&(t=o.parser),t.parse&&(t=t.parse);try{i=t(s,o)}catch(e){this.processed=!0,this.error=e}i&&!i[l]&&e.rebuild(i)}else i=g(s);this.result=new r(t,i,o),this.helpers={...y,postcss:y,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let s=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(s.postcssVersion&&"production"!==process.env.NODE_ENV){let e=s.postcssPlugin,t=s.postcssVersion,n=this.result.processor.version,r=t.split("."),o=n.split(".");(r[0]!==o[0]||parseInt(r[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=s.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,s)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,s])};for(let t of this.plugins)if("object"==typeof t)for(let s in t){if(!h[s]&&/^[A-Z]/.test(s))throw new Error(`Unknown event ${s} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p[s])if("object"==typeof t[s])for(let n in t[s])e(t,"*"===n?s:s+"-"+n.toLowerCase(),t[s][n]);else"function"==typeof t[s]&&e(t,s,t[s])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],s=this.runOnRoot(t);if(f(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(f(e))try{await e}catch(e){let s=t[t.length-1].node;throw this.handleError(e,s)}}}if(this.listeners.OnceExit)for(let[t,s]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>s(e,this.helpers));await Promise.all(t)}else await s(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return f(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=i;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=this.result.root.source;if(void 0===e.map&&!(n&&n.input&&n.input.map)){let e="";return t(this.result.root,t=>{e+=t}),this.result.css=e,this.result}let r=new s(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(f(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[s,n]of e){let e;this.result.lastPlugin=s;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(f(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:s,visitors:n}=t;if("root"!==s.type&&"document"!==s.type&&!s.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,r]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return r(s.toProxy(),this.helpers)}catch(e){throw this.handleError(e,s)}}if(0!==t.iterator){let n,r=t.iterator;for(;n=s.nodes[s.indexes[r]];)if(s.indexes[r]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete s.indexes[r]}let r=t.events;for(;t.eventIndex<r.length;){let e=r[t.eventIndex];if(t.eventIndex+=1,0===e)return void(s.nodes&&s.nodes.length&&(s[a]=!0,t.iterator=s.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=d(e);for(let s of t)if(0===s)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[s];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return w.registerPostcss=e=>{y=e},vt=w,w.default=w,o.registerLazyResult(w),t.registerLazyResult(w),vt}const Yt=ye(function(){if(Ot)return It;Ot=1;let e=jt(),t=$t(),s=_t(),n=Pe(),r=Rt(),o=Mt(),i=function(){if(rt)return nt;rt=1;let e=jt(),t=$t(),s=Rt(),n=Dt(),r=Ut(),o=zt(),i=Ft();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:r.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new s(h);if("rule"===h.type)return new i(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return nt=a,a.default=a,nt}(),a=Dt(),l=Ht(),c=Lt(),u=Pt(),h=Tt(),p=function(){if(kt)return St;kt=1;let e=Mt(),t=Ht(),s=function(){if(Ct)return xt;Ct=1;let e=Nt(),t=Tt(),s=Wt(),n=Re(),r=Jt();class o{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,s=t;try{e=s(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,r,o){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=o,this._map=void 0;let i=n;this.result=new s(this._processor,void 0,this._opts),this.result.css=r;let a=this;Object.defineProperty(this.result,"root",{get:()=>a.root});let l=new e(i,void 0,this._opts,r);if(l.isMap()){let[e,t]=l.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}}return xt=o,o.default=o,xt}(),n=zt();class r{constructor(e=[]){this.version="8.5.14",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let s of e)if(!0===s.postcss?s=s():s.postcss&&(s=s.postcss),"object"==typeof s&&Array.isArray(s.plugins))t=t.concat(s.plugins);else if("object"==typeof s&&s.postcssPlugin)t.push(s);else if("function"==typeof s)t.push(s);else{if("object"!=typeof s||!s.parse&&!s.stringify)throw new Error(s+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new s(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return St=r,r.default=r,n.registerProcessor(r),e.registerProcessor(r),St}(),f=Wt(),d=zt(),m=Ft(),g=Re(),y=Vt();function w(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new p(e)}return w.plugin=function(e,t){let s,n=!1;function r(...s){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let r=t(...s);return r.postcssPlugin=e,r.postcssVersion=(new p).version,r}return Object.defineProperty(r,"postcss",{get:()=>(s||(s=r()),s)}),r.process=function(e,t,s){return w([r(s)]).process(e,t)},r},w.stringify=g,w.parse=h,w.fromJSON=i,w.list=c,w.comment=e=>new t(e),w.atRule=t=>new e(t),w.decl=e=>new r(e),w.rule=e=>new m(e),w.root=e=>new d(e),w.document=e=>new o(e),w.CssSyntaxError=n,w.Declaration=r,w.Container=s,w.Processor=p,w.Document=o,w.Comment=t,w.Warning=y,w.AtRule=e,w.Result=f,w.Input=a,w.Rule=m,w.Root=d,w.Node=u,l.registerPostcss(w),It=w,w.default=w,It}());Yt.stringify,Yt.fromJSON,Yt.plugin,Yt.parse,Yt.list,Yt.document,Yt.comment,Yt.atRule,Yt.rule,Yt.decl,Yt.root,Yt.CssSyntaxError,Yt.Declaration,Yt.Container,Yt.Processor,Yt.Document,Yt.Comment,Yt.Warning,Yt.AtRule,Yt.Result,Yt.Input,Yt.Rule,Yt.Root,Yt.Node;const Gt=new Set(["body","html",":root","*"]);function Zt(e,t){return e&&e.trim()?Yt([(s=`[data-vbi-type="${t}"]`,{postcssPlugin:"hc-scope",AtRule(e){if("import"===e.name)return console.warn("[hc-css-scope] @import 已被拒绝(防外部资源加载):",e.params),void e.remove();"font-face"===e.name&&console.warn("[hc-css-scope] @font-face 全局生效,font-family 命名注意冲突")},Rule(e){(function(e){let t=e.parent;for(;t&&"object"==typeof t;){const e=t;if("atrule"===e.type&&/keyframes$/i.test(e.name??""))return!0;t=e.parent}return!1})(e)||(e.selectors=e.selectors.map(e=>function(e,t){const s=e.trim();if(!s)return s;if(Gt.has(s))return t;for(const e of Gt){const n=s.charAt(e.length);if(s.startsWith(e)&&(" "===n||">"===n||"+"===n||"~"===n||","===n))return t+s.slice(e.length)}return`${t} ${s}`}(e,s)))}})]).process(e,{from:void 0}).css:"";var s}const qt=new Map;function Kt(e){let t=5381;for(let s=0;s<e.length;s++)t=(t<<5)+t+e.charCodeAt(s)|0;return(t>>>0).toString(36)}function Qt(e){const t=e.replace(/[^a-zA-Z0-9_-]/g,"_");return t===e?`hc-style-${t}`:`hc-style-${t}-${Kt(e).slice(0,6)}`}function Xt(e,t){var s;const n=t??"",r=Qt(e),o=qt.get(e);if(!n.trim())return null==(s=document.getElementById(r))||s.remove(),void(o&&qt.set(e,{...o,cssHash:""}));const i=Kt(n);if(o&&o.cssHash===i)return;let a;try{a=Zt(n,e)}catch(t){return void console.warn("[hc-css-scope]",e,"PostCSS process failed:",t)}!function(e,t){const s=Qt(e);let n=document.getElementById(s);n||(n=document.createElement("style"),n.id=s,n.setAttribute("data-hc-scope",e),document.head.appendChild(n)),n.textContent=t}(e,a),o?qt.set(e,{...o,cssHash:i}):qt.set(e,{cssHash:i,refCount:0})}function es(e,t){Xt(e,t);const s=qt.get(e);s?qt.set(e,{...s,refCount:s.refCount+1}):qt.set(e,{cssHash:"",refCount:1})}function ts(e){var t;const s=qt.get(e);if(!s)return;const n=s.refCount-1;n<=0?(null==(t=document.getElementById(Qt(e)))||t.remove(),qt.delete(e)):qt.set(e,{...s,refCount:n})}function ss(e){var t;null==(t=document.getElementById(Qt(e)))||t.remove(),qt.delete(e)}function ns(){return qt.size}function rs(){return[...qt.entries()].map(([e,t])=>({scopeId:e,componentId:e,refCount:t.refCount,cssHash:t.cssHash}))}const os=x(),is={key:1,class:"rounded-md border-2 border-rose-300 bg-rose-50 p-4 text-sm text-rose-900 space-y-2 min-h-[140px] overflow-auto"},as={class:"font-semibold flex items-center gap-1.5"},ls={class:"font-mono text-xs text-rose-800 break-all"},cs={key:0,class:"text-[10px] font-mono bg-rose-100/60 p-2 rounded overflow-auto max-h-60 text-rose-800"},us=s({__name:"ErrorBoundary",props:{label:{},instanceId:{},canvasId:{},componentId:{}},setup(e){const s=e,u=t(null),h=t(0),p=t(!1);function f(){u.value=null,p.value=!1,h.value++}return n(e=>{console.error(`[hc-eb${s.label?" "+s.label:""}]`,e),u.value=e;try{os.emit("error",{canvasId:s.canvasId,instanceId:s.instanceId,componentId:s.componentId,label:s.label,error:e,timestamp:"undefined"!=typeof performance&&"function"==typeof performance.now?performance.now():Date.now()})}catch{}return!1}),(t,s)=>(r(),o("div",{key:h.value,class:"hc-eb-root",style:{width:"100%",height:"100%"}},[u.value?(r(),o("div",is,[a("div",as,[s[1]||(s[1]=a("span",null,"⚠️",-1)),a("span",null,"组件渲染失败"+l(e.label?` — ${e.label}`:""),1)]),a("div",ls,l(u.value.message),1),a("button",{class:"text-xs text-rose-700 hover:text-rose-900 underline",onClick:s[0]||(s[0]=e=>p.value=!p.value)},l(p.value?"隐藏":"展开")+"堆栈 ",1),p.value?(r(),o("pre",cs,l(u.value.stack),1)):c("",!0),a("button",{class:"text-xs px-3 py-1 rounded bg-rose-600 hover:bg-rose-700 text-white transition-colors",onClick:f}," 重试 ")])):i(t.$slots,"default",{key:0})]))}}),hs=["data-vbi-id","data-vbi-type","data-vbi-canvas"],ps={key:0,class:"rounded-md border-2 border-amber-300 bg-amber-50 p-4 text-sm text-amber-900 space-y-2 min-h-[140px] overflow-auto"},fs={class:"text-[11px] font-mono break-all whitespace-pre-wrap"},ds={key:1,class:"grid place-items-center min-h-[140px] text-xs text-zinc-400"},ms=s({__name:"RuntimeBox",props:{instanceId:{},componentId:{},scopeId:{},canvasId:{},htmlSource:{},jsSource:{},cssSource:{default:""},customValues:{default:()=>({})},position:{},size:{},zIndex:{}},setup(e){const s=e,n=u(()=>s.scopeId??s.componentId),i=h(B,null),v=u(()=>s.canvasId??i??M),b=p(null),x=t(null),C=t(!1),S=t(0);f(()=>[s.htmlSource,s.jsSource],()=>{!async function(){C.value=!0,x.value=null;const e=v.value,t=s.instanceId;k(e,t,{compileStartedAt:performance.now()});try{const n=await de({html:s.htmlSource,js:s.jsSource}),r=performance.now();k(e,t,{compileEndedAt:r,mountStartedAt:r}),b.value=n,S.value++}catch(s){x.value=s instanceof Error?s:new Error(String(s)),b.value=null,k(e,t,{compileEndedAt:performance.now()})}finally{C.value=!1}}()},{immediate:!0});let I=!1;f(()=>[s.cssSource,n.value],([e,t],s)=>{const n=(null==s?void 0:s[1])??null;n&&n!==t?(ts(n),es(t,e),I=!0):I?Xt(t,e):(es(t,e),I=!0)},{immediate:!0});const O=u(()=>{const e={width:"100%",height:"100%"};return s.position&&(e.position="absolute",e.left=`${s.position.x}px`,e.top=`${s.position.y}px`),void 0!==s.zIndex&&(e.zIndex=String(s.zIndex)),e});return d(()=>{I&&(ts(n.value),I=!1)}),(t,s)=>(r(),o("div",{class:"_vbi_box","data-vbi-id":e.instanceId,"data-vbi-type":n.value,"data-vbi-canvas":v.value,style:m(O.value)},[x.value?(r(),o("div",ps,[s[0]||(s[0]=a("div",{class:"font-semibold"},"⚠️ 编译失败",-1)),a("pre",fs,l(x.value.message),1)])):C.value&&!b.value?(r(),o("div",ds," 编译中… ")):b.value?(r(),g(us,{key:S.value,label:e.instanceId,"instance-id":e.instanceId,"canvas-id":v.value,"component-id":e.componentId},{default:y(()=>[(r(),g(w(b.value.options),{"hc-custom-values":e.customValues,"hc-instance-id":e.instanceId,"hc-canvas-id":v.value,"hc-component-id":e.componentId},null,8,["hc-custom-values","hc-instance-id","hc-canvas-id","hc-component-id"]))]),_:1},8,["label","instance-id","canvas-id","component-id"])):c("",!0)],12,hs))}}),gs="0.0.0-stage2b";export{M as DEFAULT_CANVAS_ID,us as ErrorBoundary,B as HC_CANVAS_ID_KEY,le as HC_INJECT_KEY,ms as RuntimeBox,gs as VERSION,_ as __resetDiagnosticsEventsFlag,Q as __resetLifecycleEmitter,K as __resetRegistry,ee as assets,es as attachScope,me as clearCompileCache,A as clearInstanceTimings,de as compileComponent,I as consumePendingTimings,se as createCanvasesRegistry,re as createHyperCard,rs as debugScopedCssRefs,ts as detachScope,$ as disableDiagnosticsEvents,J as disposeCanvas,P as enableDiagnosticsEvents,ge as getCompileCacheSize,Z as getInstance,O as getInstanceTimings,ns as getScopedCssCount,Xt as injectScopedCss,j as interactionEmitter,R as isDiagnosticsEventsEnabled,oe as isVuePlugin,H as listCanvasIds,q as listInstances,z as onInstanceLifecycle,b as parseComponentSource,k as patchInstanceTimings,Y as register,W as registerInCanvas,U as registryVersion,ss as removeScopedCss,X as runtime,os as runtimeErrorEmitter,Zt as scopeCss,V as subscribeCanvasInventory,G as unregister};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hy-bricks/core",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "HyperCard 运行时核心 — 编译用户源码 / CSS scope / 实例注册表 / 跨实例 SDK / JS 静态解析",
5
5
  "keywords": [
6
6
  "hypercard",
@@ -30,7 +30,8 @@
30
30
  "files": [
31
31
  "dist",
32
32
  "README.md",
33
- "LICENSE"
33
+ "LICENSE",
34
+ "CHANGELOG.md"
34
35
  ],
35
36
  "publishConfig": {
36
37
  "access": "public"