@hy-bricks/core 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -1
- package/README.md +0 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -20
- package/dist/index.mjs +1 -1
- package/dist/parse-source.cjs +1 -1
- package/dist/parse-source.mjs +1 -1
- package/dist/{parseSourceEntry-UTE53-N3.cjs → parseSourceEntry-DVGEKTC6.cjs} +1 -1
- package/dist/{parseSourceEntry-BNu0kje7.js → parseSourceEntry-IGf6vyI7.js} +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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};
|
|
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-IGf6vyI7.js";import{a as b}from"./parseSourceEntry-IGf6vyI7.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=Y(t,e);if(n)return void Object.assign(function(e){return e._timings||(e._timings={}),e._timings}(n),s);const r=S(e,t),o=C.get(r)??{};C.set(r,{...o,...s})}function I(e,t){const s=Y(t,e);return s?function(e){return e._timings}(s)??null:C.get(S(e,t))??null}function O(e,t){C.delete(S(e,t))}let A=0;function E(){A++}function P(){A>0?A--:console.warn("[hc-diagnostics] disableDiagnosticsEvents called more times than enableDiagnosticsEvents — ignored")}function $(){return A>0}const R=x(),j="__default__",_="__hcCanvasId",M=t(0),B=x();function U(e,t){const s=e=>{try{t(e)}catch(e){console.error("[hc-registry] instance lifecycle listener threw",e)}};return B.on(e,s),()=>B.off(e,s)}function D(e,t){B.emit(e,t)}const z=new Set,L=new Map,F=x();function N(e,t){return F.on(e,t),()=>F.off(e,t)}function T(e,t,s,n){var r;const o=function(e,t){return`${e}\0${t}`}(e,t);if(z.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)}z.add(o);try{const o=!L.has(e),i=function(e){let t=L.get(e);return t||(t=new Map,L.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),D("instance:unmounted",{canvasId:e,instanceId:t}));const a=function(e,t,s,n){const r=x();function o(n,r,o){if($())try{R.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=function(e,t){const s=S(e,t),n=C.get(s);return n?(C.delete(s),n):null}(e,t);return l&&(a._timings={...l}),M.value++,o&&F.emit("canvas:added",{canvasId:e}),D("instance:ready",{canvasId:e,instanceId:t}),a}finally{z.delete(o)}}function V(e){const t=L.get(e);if(!t)return;const s=[];for(const[n,r]of t)r.__dispose(),s.push(n),O(e,n);t.clear(),L.delete(e),M.value++;for(const t of s)D("instance:unmounted",{canvasId:e,instanceId:t});F.emit("canvas:removed",{canvasId:e})}function W(){return[...L.keys()]}function J(e,t,s){return T(j,e,t,s)}function H(e,t=j){const s=L.get(t);if(!s)return;const n=s.get(e);n&&(n.__dispose(),s.delete(e),O(t,e),M.value++,D("instance:unmounted",{canvasId:t,instanceId:e}))}function Y(e,t){var s;if(void 0!==t)return(null==(s=L.get(t))?void 0:s.get(e))??null;let n=null;const r=[];for(const[t,s]of L){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 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=L.get(e.canvasId);return t?[...t.values()].filter(s):[]}const n=[];for(const e of L.values())for(const t of e.values())s(t)&&n.push(t);return n}const Z={getInstance:Y,listInstances:G,call(e,t,...s){const n=Y(e);if(n)return n.call(t,...s);console.debug(`[hc-runtime] call: instance "${e}" not found`)},on(e,t,s){const n=Y(e);if(n)return n.on(t,s);console.debug(`[hc-runtime] on: instance "${e}" not found`)},emit(e,t,s){const n=Y(e);n?n.emit(t,s):console.debug(`[hc-runtime] emit: instance "${e}" not found`)}},q={pickerUrl:e=>`/a/${e}`};function K(e){return{canvasId:e,listInstances:t=>G({canvasId:e,componentId:null==t?void 0:t.componentId}),getInstance:t=>Y(t,e),call(t,s,...n){const r=Y(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=Y(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=G({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(){V(e)}}}function Q(){return{list:()=>W().map(e=>K(e)),get:e=>W().includes(e)?K(e):null,getAll(){const e={};for(const t of W())e[t]=K(t);return e},callComponent(e,t,s,...n){const r=Y(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=Y(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 W())try{const n=G({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 X=new Set(["vue","Vue","window","global","globalThis","console","document","process","$","libs","runtime","assets","version"]);function ee(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])=>te(e)),i=r.filter(([e])=>X.has(e)),a=[`[hypercard] 已注册 ${r.length} 个 libs:`];for(const[e,t]of r)a.push(` ${e.padEnd(16)} ${ne(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]=se(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]=se(t);c[e]=s}const u={libs:c,runtime:Z,assets:q,version:n,canvases:Q()};e.provide(re,u),e.config.globalProperties.$hc=u,"undefined"!=typeof window&&(window.__HYPERCARD__=u)}}}function te(e){return Array.isArray(e)&&e.length>=1?te(e[0]):"object"==typeof e&&null!==e&&"function"==typeof e.install}function se(e){return Array.isArray(e)&&e.length>=1?[e[0],e.slice(1)]:[e,[]]}function ne(e){return te(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 re="__HYPERCARD__",oe=new Set(["init","onClick","onMouseover","onMouseout","onResize","onDestroy"]),ie=new Map;function ae(e,t){for(ie.has(e)&&ie.delete(e),ie.set(e,t);ie.size>100;){const e=ie.keys().next().value;if(void 0===e)break;ie.delete(e)}}function le(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 ce(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 ue(t){const s=le(t.html)+"_"+le(t.js),n=ie.get(s);if(n)return ae(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))oe.has(e)||"function"!=typeof t||(b[e]=t);const x=Object.keys(b),C={...b,...h},S=(s??"").trim()||"<div></div>",I=e.compile(S);if("function"!=typeof I)throw new Error('[hc-compile] 当前 Vue 是 runtime-only 构建,无法运行时编译组件模板(组件会渲染为空)。宿主需在打包器里把 "vue" 别名到 "vue/dist/vue.esm-bundler.js",例如 vite.config: resolve.alias: [{ find: /^vue$/, replacement: \'vue/dist/vue.esm-bundler.js\' }]。');return{options:{render:I,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&&T(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 oe){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;if(this.hcInstanceId&&this.hcCanvasId){const e=Y(this.hcInstanceId,this.hcCanvasId);e&&e.vm===this&&H(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:ce(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 ae(s,r),r.catch(()=>{ie.get(s)===r&&ie.delete(s)}),r}function he(){ie.clear()}function pe(){return ie.size}function fe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function de(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 me,ge={exports:{}};function ye(){if(me)return ge.exports;me=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 ge.exports=t(),ge.exports.createColors=t,ge.exports}const we=de(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var ve,be,xe,Ce,Se,ke;function Ie(){if(be)return ve;be=1;let e=ye(),t=we;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 ve=s,s.default=s,ve}function Oe(){if(Ce)return xe;Ce=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 xe=r,r.default=r,xe}function Ae(){if(ke)return Se;ke=1;let e=Oe();function t(t,s){new e(s).stringify(t)}return Se=t,t.default=t,Se}var Ee,Pe,$e,Re,je,_e,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={};function kt(){return Ee||(Ee=1,St.isClean=Symbol("isClean"),St.my=Symbol("my")),St}function It(){if($e)return Pe;$e=1;let e=Ie(),t=Oe(),s=Ae(),{isClean:n,my:r}=kt();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 Pe=a,a.default=a,Pe}function Ot(){if(je)return Re;je=1;let e=It();class t extends e{constructor(e){super(e),this.type="comment"}}return Re=t,t.default=t,Re}function At(){if(Me)return _e;Me=1;let e=It();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 _e=t,t.default=t,_e}function Et(){if(Ue)return Be;Ue=1;let e,t,s,n,r=Ot(),o=At(),i=It(),{isClean:a,my:l}=kt();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},Be=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)})},Be}function Pt(){if(ze)return De;ze=1;let e=Et();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 De=t,t.default=t,e.registerAtRule(t),De}function $t(){if(Fe)return Le;Fe=1;let e,t,s=Et();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},Le=n,n.default=n,Le}function Rt(){return Te?Ne:(Te=1,Ne={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 jt(){if(We)return Ve;We=1;let{existsSync:e,readFileSync:t}=we,{dirname:s,join:n}=we,{SourceMapConsumer:r,SourceMapGenerator:o}=we;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 Ve=i,i.default=i,Ve}function _t(){if(He)return Je;He=1;let{nanoid:e}=Rt(),{isAbsolute:t,resolve:s}=we,{SourceMapConsumer:n,SourceMapGenerator:r}=we,{fileURLToPath:o,pathToFileURL:i}=we,a=Ie(),l=jt(),c=we,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 Je=d,d.default=d,c&&c.registerInput&&c.registerInput(d),Je}function Mt(){if(Ge)return Ye;Ge=1;let e,t,s=Et();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},Ye=n,n.default=n,s.registerRoot(n),Ye}function Bt(){if(qe)return Ze;qe=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 Ze=e,e.default=e,Ze}function Ut(){if(Qe)return Ke;Qe=1;let e=Et(),t=Bt();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 Ke=s,s.default=s,e.registerRule(s),Ke}function Dt(){if(st)return tt;st=1;let{dirname:e,relative:t,resolve:s,sep:n}=we,{SourceMapConsumer:r,SourceMapGenerator:o}=we,{pathToFileURL:i}=we,a=_t(),l=Boolean(r&&o),c=Boolean(e&&s&&t&&n);return tt=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 zt(){if(lt)return at;lt=1;let e=Et(),t=_t(),s=function(){if(it)return ot;it=1;let e=Pt(),t=Ot(),s=At(),n=Mt(),r=Ut(),o=function(){if(rt)return nt;rt=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 nt=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]:"",_=B.charCodeAt(z+1),"url"===M&&_!==e&&_!==t&&_!==o&&_!==r&&_!==a&&_!==i&&_!==l){E=z;do{if(R=!1,E=B.indexOf(")",E+1),-1===E){if(U||k){E=z;break}T("bracket")}for(j=E;B.charCodeAt(j-1)===s;)j-=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(j=E;B.charCodeAt(j-1)===s;)j-=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 ot=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 at=n,n.default=n,e.registerParse(n),at}function Lt(){if(ut)return ct;ut=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 ct=e,e.default=e,ct}function Ft(){if(pt)return ht;pt=1;let e=Lt();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 ht=t,t.default=t,ht}function Nt(){if(dt)return ft;dt=1;let e={};return ft=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Tt(){if(gt)return mt;gt=1;let e=Et(),t=$t(),s=Dt(),n=zt(),r=Ft(),o=Mt(),i=Ae(),{isClean:a,my:l}=kt(),c=Nt();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},mt=w,w.default=w,o.registerLazyResult(w),t.registerLazyResult(w),mt}const Vt=fe(function(){if(Ct)return xt;Ct=1;let e=Pt(),t=Ot(),s=Et(),n=Ie(),r=At(),o=$t(),i=function(){if(et)return Xe;et=1;let e=Pt(),t=Ot(),s=At(),n=_t(),r=jt(),o=Mt(),i=Ut();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 Xe=a,a.default=a,Xe}(),a=_t(),l=Tt(),c=Bt(),u=It(),h=zt(),p=function(){if(bt)return vt;bt=1;let e=$t(),t=Tt(),s=function(){if(wt)return yt;wt=1;let e=Dt(),t=zt(),s=Ft(),n=Ae(),r=Nt();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 yt=o,o.default=o,yt}(),n=Mt();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 vt=r,r.default=r,n.registerProcessor(r),e.registerProcessor(r),vt}(),f=Ft(),d=Mt(),m=Ut(),g=Ae(),y=Lt();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),xt=w,w.default=w,xt}());Vt.stringify,Vt.fromJSON,Vt.plugin,Vt.parse,Vt.list,Vt.document,Vt.comment,Vt.atRule,Vt.rule,Vt.decl,Vt.root,Vt.CssSyntaxError,Vt.Declaration,Vt.Container,Vt.Processor,Vt.Document,Vt.Comment,Vt.Warning,Vt.AtRule,Vt.Result,Vt.Input,Vt.Rule,Vt.Root,Vt.Node;const Wt=new Set(["body","html",":root","*"]);function Jt(e,t){return e&&e.trim()?Vt([(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(Wt.has(s))return t;for(const e of Wt){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 Ht=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 Gt(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 Zt(e,t){var s;const n=t??"",r=Gt(e),o=Ht.get(e);if(!n.trim())return null==(s=document.getElementById(r))||s.remove(),void(o&&Ht.set(e,{...o,cssHash:""}));const i=Yt(n);if(o&&o.cssHash===i)return;let a;try{a=Jt(n,e)}catch(t){return void console.warn("[hc-css-scope]",e,"PostCSS process failed:",t)}!function(e,t){const s=Gt(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?Ht.set(e,{...o,cssHash:i}):Ht.set(e,{cssHash:i,refCount:0})}function qt(e,t){Zt(e,t);const s=Ht.get(e);s?Ht.set(e,{...s,refCount:s.refCount+1}):Ht.set(e,{cssHash:"",refCount:1})}function Kt(e){var t;const s=Ht.get(e);if(!s)return;const n=s.refCount-1;n<=0?(null==(t=document.getElementById(Gt(e)))||t.remove(),Ht.delete(e)):Ht.set(e,{...s,refCount:n})}function Qt(e){var t;null==(t=document.getElementById(Gt(e)))||t.remove(),Ht.delete(e)}function Xt(){return Ht.size}const es=x(),ts={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"},ss={class:"font-semibold flex items-center gap-1.5"},ns={class:"font-mono text-xs text-rose-800 break-all"},rs={key:0,class:"text-[10px] font-mono bg-rose-100/60 p-2 rounded overflow-auto max-h-60 text-rose-800"},os=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{es.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",ts,[a("div",ss,[s[1]||(s[1]=a("span",null,"⚠️",-1)),a("span",null,"组件渲染失败"+l(e.label?` — ${e.label}`:""),1)]),a("div",ns,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",rs,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})]))}}),is=["data-vbi-id","data-vbi-type","data-vbi-canvas"],as={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"},ls={class:"text-[11px] font-mono break-all whitespace-pre-wrap"},cs={key:1,class:"grid place-items-center min-h-[140px] text-xs text-zinc-400"},us=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(_,null),v=u(()=>s.canvasId??i??j),b=p(null),x=t(null),C=t(!1),S=t(0),I=t(null);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 ue({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}),f(()=>[s.instanceId,v.value],(e,t)=>{const[s,n]=t,r=Y(s,n);r&&r.vm===I.value&&H(s,n),S.value++});let A=!1;f(()=>[s.cssSource,n.value],([e,t],s)=>{const n=(null==s?void 0:s[1])??null;n&&n!==t?(Kt(n),qt(t,e),A=!0):A?Zt(t,e):(qt(t,e),A=!0)},{immediate:!0});const E=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(()=>{A&&(Kt(n.value),A=!1),O(v.value,s.instanceId)}),(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(E.value)},[x.value?(r(),o("div",as,[s[0]||(s[0]=a("div",{class:"font-semibold"},"⚠️ 编译失败",-1)),a("pre",ls,l(x.value.message),1)])):C.value&&!b.value?(r(),o("div",cs," 编译中… ")):b.value?(r(),g(os,{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),{ref_key:"innerVmRef",ref:I,"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,is))}}),hs="0.0.0-stage2b";export{j as DEFAULT_CANVAS_ID,os as ErrorBoundary,_ as HC_CANVAS_ID_KEY,re as HC_INJECT_KEY,us as RuntimeBox,hs as VERSION,q as assets,qt as attachScope,he as clearCompileCache,ue as compileComponent,Q as createCanvasesRegistry,ee as createHyperCard,Kt as detachScope,P as disableDiagnosticsEvents,V as disposeCanvas,E as enableDiagnosticsEvents,pe as getCompileCacheSize,Y as getInstance,I as getInstanceTimings,Xt as getScopedCssCount,Zt as injectScopedCss,R as interactionEmitter,$ as isDiagnosticsEventsEnabled,te as isVuePlugin,W as listCanvasIds,G as listInstances,U as onInstanceLifecycle,b as parseComponentSource,J as register,T as registerInCanvas,M as registryVersion,Qt as removeScopedCss,Z as runtime,es as runtimeErrorEmitter,Jt as scopeCss,N as subscribeCanvasInventory,H as unregister};
|
package/dist/parse-source.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./parseSourceEntry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./parseSourceEntry-DVGEKTC6.cjs");exports.parseComponentSource=e.parseComponentSource;
|
package/dist/parse-source.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./parseSourceEntry-
|
|
1
|
+
import{a as r}from"./parseSourceEntry-IGf6vyI7.js";export{r as parseComponentSource};
|