cardbuddy 0.15.0 → 0.16.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/dist/preview-editor/assets/index-BkbBxDTT.css +1 -0
- package/dist/preview-editor/assets/{index-CIIfMlwI.js → index-Bro07DTa.js} +91 -88
- package/dist/preview-editor/index.html +2 -2
- package/dist/vendored/card-editor/runtime/adapter.js +2 -2
- package/dist/vendored/mcp/client.mjs +1 -1
- package/dist/vendored/server/core/ai-chat.js +251 -80
- package/dist/vendored/server/core/cardValidate.js +16 -5
- package/dist/vendored/skills/card-skill-trainer/SKILL.md +61 -6
- package/dist/vendored/skills/card-skill-trainer/scripts/diagnose_case.mjs +14 -82
- package/dist/vendored/skills/card-skill-trainer/scripts/lib/diagnosis.mjs +207 -0
- package/dist/vendored/skills/card-skill-trainer/scripts/lib/layout-correction-sim.mjs +62 -0
- package/dist/vendored/skills/card-skill-trainer/scripts/lib/paradigm-router.mjs +76 -0
- package/dist/vendored/skills/card-skill-trainer/scripts/lib/pixel-worker-runner.mjs +31 -0
- package/dist/vendored/skills/card-skill-trainer/scripts/lib/pixel-worker.mjs +138 -0
- package/dist/vendored/skills/card-skill-trainer/scripts/lib/scoring.mjs +24 -20
- package/dist/vendored/skills/card-skill-trainer/scripts/lib/telemetry.mjs +46 -0
- package/dist/vendored/skills/card-skill-trainer/scripts/plan_next_round.mjs +4 -1
- package/dist/vendored/skills/card-skill-trainer/scripts/run_round.mjs +279 -90
- package/dist/vendored/skills/card-skill-trainer/scripts/score_round.mjs +74 -2
- package/dist/vendored/skills/card-skill-trainer/scripts/sink_rules.mjs +127 -0
- package/dist/vendored/skills/dsl-card-generator/SKILL.md +93 -27
- package/dist/vendored/skills/dsl-card-generator/references/dsl_structure.md +1 -15
- package/dist/vendored/skills/dsl-card-generator/references/expression_engine.md +11 -20
- package/dist/vendored/skills/dsl-card-generator/references/generation_pitfalls.md +169 -44
- package/dist/vendored/skills/dsl-card-generator/references/ir-format.md +87 -3
- package/dist/vendored/skills/dsl-card-generator/references/iteration_protocol.md +35 -6
- package/dist/vendored/skills/dsl-card-generator/references/quickref.md +28 -27
- package/dist/vendored/skills/dsl-card-generator/references/recipes.md +30 -8
- package/dist/vendored/skills/dsl-card-generator/references/rules.md +3 -2
- package/dist/vendored/skills/dsl-card-generator/references/scripts_reference.md +5 -2
- package/dist/vendored/skills/dsl-card-generator/references/slices_convention.md +2 -3
- package/dist/vendored/skills/dsl-card-generator/references/spec_to_schema_patterns.md +1 -4
- package/dist/vendored/skills/dsl-card-generator/scripts/add_component.mjs +5 -14
- package/dist/vendored/skills/dsl-card-generator/scripts/autofix_schema.py +88 -0
- package/dist/vendored/skills/dsl-card-generator/scripts/check_fidelity.mjs +143 -42
- package/dist/vendored/skills/dsl-card-generator/scripts/check_topology.py +0 -35
- package/dist/vendored/skills/dsl-card-generator/scripts/expand_ir.mjs +99 -53
- package/dist/vendored/skills/dsl-card-generator/scripts/gate.mjs +5 -2
- package/dist/vendored/skills/dsl-card-generator/scripts/iterate.mjs +388 -29
- package/dist/vendored/skills/dsl-card-generator/scripts/lib/component_contract.mjs +315 -0
- package/dist/vendored/skills/dsl-card-generator/scripts/lib/layout-tokens.mjs +1 -1
- package/dist/vendored/skills/dsl-card-generator/scripts/lib/paths.mjs +23 -0
- package/dist/vendored/skills/dsl-card-generator/scripts/lib/paths.py +0 -37
- package/dist/vendored/skills/dsl-card-generator/scripts/lib/python.mjs +99 -0
- package/dist/vendored/skills/dsl-card-generator/scripts/lib/rules/adaptive-width.mjs +105 -0
- package/dist/vendored/skills/dsl-card-generator/scripts/lib/rules/bindings.mjs +260 -0
- package/dist/vendored/skills/dsl-card-generator/scripts/lib/rules/expr.mjs +52 -0
- package/dist/vendored/skills/dsl-card-generator/scripts/lib/rules/image.mjs +96 -0
- package/dist/vendored/skills/dsl-card-generator/scripts/lib/rules/registry.mjs +166 -0
- package/dist/vendored/skills/dsl-card-generator/scripts/lib/rules/structure.mjs +127 -0
- package/dist/vendored/skills/dsl-card-generator/scripts/lib/rules/walk.mjs +61 -0
- package/dist/vendored/skills/dsl-card-generator/scripts/lib/scope_alias.mjs +125 -0
- package/dist/vendored/skills/dsl-card-generator/scripts/lib/v3_assemble.mjs +325 -41
- package/dist/vendored/skills/dsl-card-generator/scripts/lib/v3_extract.mjs +112 -6
- package/dist/vendored/skills/dsl-card-generator/scripts/lib/v3_shared.mjs +0 -6
- package/dist/vendored/skills/dsl-card-generator/scripts/lint_card.mjs +119 -78
- package/dist/vendored/skills/dsl-card-generator/scripts/preflight.mjs +48 -50
- package/dist/vendored/skills/dsl-card-generator/scripts/readiness.mjs +634 -0
- package/dist/vendored/skills/dsl-card-generator/scripts/register_card_template.mjs +5 -8
- package/dist/vendored/skills/dsl-card-generator/scripts/route_input.mjs +5 -10
- package/dist/vendored/skills/dsl-card-generator/scripts/spec_audit.mjs +122 -8
- package/dist/vendored/skills/dsl-card-generator/scripts/v3_regression.mjs +3 -1
- package/dist/vendored/skills/dsl-card-generator/scripts/validate_schema.py +23 -15
- package/dist/vendored/skills/shared/exit-codes.md +79 -0
- package/dist/vendored/skills/shared/spec-contract.md +118 -0
- package/dist/vendored/skills/sketch-spec-to-card/SKILL.md +26 -9
- package/dist/vendored/skills/sketch-spec-to-card/references/spec-schema.md +3 -3
- package/dist/vendored/skills/sketch-spec-to-card/scripts/build_prompt.py +0 -8
- package/dist/vendored/skills/sketch-spec-to-card/scripts/cluster_states.py +14 -25
- package/dist/vendored/skills/sketch-spec-to-card/scripts/parse_meaxure.py +91 -47
- package/dist/vendored/skills/sketch-spec-to-card/scripts/png_utils.py +0 -5
- package/dist/vendored/skills/sketch-spec-to-card/scripts/test_text_only_artboard.py +75 -15
- package/dist/vendored/skills/sketch-spec-to-card/scripts/vision.py +40 -34
- package/package.json +1 -1
- package/dist/preview-editor/assets/index-DQn0zQBP.css +0 -1
- package/dist/vendored/skills/card-skill-trainer/scripts/test_missing_slice.py +0 -122
- package/dist/vendored/skills/dsl-card-generator/scripts/analyze_component_usage.mjs +0 -153
|
@@ -104,105 +104,108 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
104
104
|
外层继承的描边属性,避免描边污染实心形状。 -->
|
|
105
105
|
<symbol id="icon-model" viewBox="0 0 1024 1024" fill="currentColor" stroke="none"><path d="M907.8 457.5c2-5.5 3.6-11.1 5.1-16.8 13.6-52.7 5.8-107.5-21.9-154.3-22.5-38-55.8-67-95.7-83.9-5.1-34.5-21.1-66.3-46.3-91.3-30.7-30.5-71.5-47.4-114.8-47.4h-0.5C585 64 541.8 86 512 120.1 482.2 86 439 64 390.3 63.8h-0.5c-43.3 0-84.1 16.8-114.8 47.4-25.2 25-41.2 56.8-46.3 91.3-91.1 38.7-143 139.5-117.6 238.2 1.5 5.7 3.2 11.2 5.1 16.8-65.9 73.2-70.7 185.8-6.7 264.6 10.6 13 22.6 24.6 35.9 34.5 0 44.8 14.6 88.2 42.4 124.2C221 923.9 269 951.5 323 958.4c8.8 1.1 17.6 1.7 26.3 1.7 65.5 0 125.1-32 162.8-82.4 37.6 50.4 97.3 82.4 162.8 82.4 8.6 0 17.4-0.6 26.3-1.7 102.5-13.2 177.6-101 177.6-201.8 13.3-9.9 25.3-21.5 35.8-34.5 63.9-78.8 59.2-191.4-6.8-264.6zM470.3 772.1c-8.6 66.8-70 113.8-136.9 105.5-32.4-4.2-61.1-20.7-81.1-46.6-8.7-11.3-14.8-23.9-19.1-37 11.4 2 22.8 3.3 34.4 3.3 22.5 0 40.7-18.2 40.7-40.7 0-22.5-18.2-40.7-40.7-40.7-21 0-41.7-5.5-60-15.8l-0.1-0.1c-13.4-7.5-25.1-17.4-34.7-29.4-42.4-52.2-34.5-129.2 17.6-171.8 0.1 0 0.1-0.1 0.2-0.1 5.6-4.6 11.6-8.6 17.9-12.1 19.7-10.9 26.7-35.8 15.8-55.4-7.5-13.4-21.4-20.3-35.7-20.3-8.4-48.2 12.7-95.6 51.8-122 2.7 6.5 4.7 13.4 8.3 19.5 7.5 13.1 21.2 20.4 35.3 20.4 6.9 0 13.9-1.7 20.3-5.4 19.5-11.2 26.2-36.1 15-55.6-6.5-11.4-10.3-24.3-10.8-37.4 0-0.5-0.3-1-0.4-1.5 0-0.8 0.3-1.7 0.3-2.5 0-21.8 8.6-42.2 24-57.5 15.4-15.3 35.8-23.7 57.4-23.7h0.3c44.9 0.1 81.4 36.8 81.2 81.7V388.2c-3.4 57.5-40.6 107-95 126.2-21.2 7.5-32.4 30.7-24.9 51.9s30.8 32.4 51.9 24.9c25.4-8.9 48-22.4 67.9-38.8v204.1c0.1 5.4-0.3 10.5-0.9 15.6z m381-101.4a124 124 0 0 1-34.7 29.4l-0.1 0.1c-18.3 10.3-39.1 15.7-60 15.7-22.5 0-40.7 18.2-40.7 40.7 0 22.5 18.2 40.7 40.7 40.7 11.6 0 23-1.3 34.4-3.3-14.2 43.4-52 77.3-100.2 83.6-66.1 8.4-128.2-38.7-136.8-105.5-0.7-5.2-1-10.3-1-15.5v-204c19.9 16.4 42.6 29.9 67.9 38.8 4.4 1.6 9 2.3 13.5 2.3 16.8 0 32.5-10.5 38.4-27.3 7.4-21.2-3.7-44.5-24.9-51.9-54.4-19.1-91.6-68.6-95-126.2V227.2v-0.1c-0.1-44.9 36.3-81.6 81.2-81.7h0.2c21.7 0 42.1 8.4 57.4 23.7 15.5 15.3 24 35.8 24 61.2V230.6c-0.5 13.1-4.2 26-10.8 37.4-11.2 19.5-4.5 44.4 15 55.6 6.4 3.7 13.4 5.4 20.3 5.4 14.1 0 27.8-7.3 35.4-20.4 3.5-6.2 5.6-13 8.3-19.6 14.9 10 27.8 23 37.2 38.9 15 25.3 19.7 54.4 14.6 83.2-14.3 0-28.3 7-35.8 20.3-10.9 19.6-3.9 44.5 15.8 55.4 6.3 3.5 12.3 7.6 17.9 12.1 0.1 0.1 0.1 0.1 0.2 0.1 52.1 42.5 60 119.5 17.6 171.7z"></path></symbol>
|
|
106
106
|
</svg>
|
|
107
|
-
`,u=()=>{let e=document.createElement(`div`);e.innerHTML=l;let t=e.getElementsByTagName(`svg`)[0];if(t){t.setAttribute(`aria-hidden`,`true`),t.style.position=`absolute`,t.style.width=`0`,t.style.height=`0`,t.style.overflow=`hidden`;let e=document.body.firstChild;e?document.body.insertBefore(t,e):document.body.appendChild(t)}};(()=>{let e=()=>{document.removeEventListener(`DOMContentLoaded`,e),u()};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,e):u()})();function d(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var f=Object.freeze({}),p=Object.freeze([]),m=()=>{},h=()=>!1,g=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),_=e=>e.startsWith(`onUpdate:`),v=Object.assign,y=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},b=Object.prototype.hasOwnProperty,x=(e,t)=>b.call(e,t),S=Array.isArray,C=e=>ie(e)===`[object Map]`,w=e=>ie(e)===`[object Set]`,ee=e=>ie(e)===`[object Date]`,T=e=>typeof e==`function`,E=e=>typeof e==`string`,te=e=>typeof e==`symbol`,D=e=>typeof e==`object`&&!!e,ne=e=>(D(e)||T(e))&&T(e.then)&&T(e.catch),re=Object.prototype.toString,ie=e=>re.call(e),ae=e=>ie(e).slice(8,-1),oe=e=>ie(e)===`[object Object]`,se=e=>E(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,ce=d(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),le=d(`bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo`),ue=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},de=/-\w/g,O=ue(e=>e.replace(de,e=>e.slice(1).toUpperCase())),fe=/\B([A-Z])/g,pe=ue(e=>e.replace(fe,`-$1`).toLowerCase()),me=ue(e=>e.charAt(0).toUpperCase()+e.slice(1)),he=ue(e=>e?`on${me(e)}`:``),ge=(e,t)=>!Object.is(e,t),_e=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ve=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ye=e=>{let t=parseFloat(e);return isNaN(t)?e:t},be=e=>{let t=E(e)?Number(e):NaN;return isNaN(t)?e:t},k,xe=()=>k||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function A(e){if(S(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=E(r)?Te(r):A(r);if(i)for(let e in i)t[e]=i[e]}return t}if(E(e)||D(e))return e}var Se=/;(?![^(]*\))/g,Ce=/:([^]+)/,we=/\/\*[^]*?\*\//g;function Te(e){let t={};return e.replace(we,``).split(Se).forEach(e=>{if(e){let n=e.split(Ce);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function j(e){let t=``;if(E(e))t=e;else if(S(e))for(let n=0;n<e.length;n++){let r=j(e[n]);r&&(t+=r+` `)}else if(D(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}var Ee=`html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot`,De=`svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view`,Oe=`annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics`,ke=d(Ee),Ae=d(De),je=d(Oe),Me=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,Ne=d(Me);Me+``;function Pe(e){return!!e||e===``}function Fe(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Ie(e[r],t[r]);return n}function Ie(e,t){if(e===t)return!0;let n=ee(e),r=ee(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=te(e),r=te(t),n||r)return e===t;if(n=S(e),r=S(t),n||r)return n&&r?Fe(e,t):!1;if(n=D(e),r=D(t),n||r){if(!n||!r||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!Ie(e[n],t[n]))return!1}}return String(e)===String(t)}function Le(e,t){return e.findIndex(e=>Ie(e,t))}var Re=e=>!!(e&&e.__v_isRef===!0),M=e=>E(e)?e:e==null?``:S(e)||D(e)&&(e.toString===re||!T(e.toString))?Re(e)?M(e.value):JSON.stringify(e,ze,2):String(e),ze=(e,t)=>Re(t)?ze(e,t.value):C(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Be(t,r)+` =>`]=n,e),{})}:w(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Be(e))}:te(t)?Be(t):D(t)&&!S(t)&&!oe(t)?String(t):t,Be=(e,t=``)=>te(e)?`Symbol(${e.description??t})`:e;function Ve(e,...t){console.warn(`[Vue warn] ${e}`,...t)}var He,Ue=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&He&&(He.active?(this.parent=He,this.index=(He.scopes||(He.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=He;try{return He=this,e()}finally{He=t}}this._warnOnRun&&Ve(`cannot run an inactive effect scope.`)}on(){++this._on===1&&(this.prevScope=He,He=this)}off(){if(this._on>0&&--this._on===0){if(He===this)He=this.prevScope;else{let e=He;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let e=this.scopes.slice();for(t=0,n=e.length;t<n;t++)e[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function We(){return He}var N,Ge=new WeakSet,Ke=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,He&&(He.active?He.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ge.has(this)&&(Ge.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Xe(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,lt(this),$e(this);let e=N,t=at;N=this,at=!0;try{return this.fn()}finally{N!==this&&Ve(`Active effect was not restored correctly - this is likely a Vue internal bug.`),et(this),N=e,at=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)rt(e);this.deps=this.depsTail=void 0,lt(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ge.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){tt(this)&&this.run()}get dirty(){return tt(this)}},qe=0,Je,Ye;function Xe(e,t=!1){if(e.flags|=8,t){e.next=Ye,Ye=e;return}e.next=Je,Je=e}function Ze(){qe++}function Qe(){if(--qe>0)return;if(Ye){let e=Ye;for(Ye=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Je;){let t=Je;for(Je=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function $e(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function et(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),rt(r),it(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function tt(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(nt(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function nt(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ut)||(e.globalVersion=ut,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!tt(e))))return;e.flags|=2;let t=e.dep,n=N,r=at;N=e,at=!0;try{$e(e);let n=e.fn(e._value);(t.version===0||ge(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{N=n,at=r,et(e),e.flags&=-3}}function rt(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subsHead===e&&(n.subsHead=i),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)rt(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function it(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var at=!0,ot=[];function st(){ot.push(at),at=!1}function ct(){let e=ot.pop();at=e===void 0||e}function lt(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=N;N=void 0;try{t()}finally{N=e}}}var ut=0,dt=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},ft=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,this.subsHead=void 0}track(e){if(!N||!at||N===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==N)t=this.activeLink=new dt(N,this),N.deps?(t.prevDep=N.depsTail,N.depsTail.nextDep=t,N.depsTail=t):N.deps=N.depsTail=t,pt(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=N.depsTail,t.nextDep=void 0,N.depsTail.nextDep=t,N.depsTail=t,N.deps===t&&(N.deps=e)}return N.onTrack&&N.onTrack(v({effect:N},e)),t}trigger(e){this.version++,ut++,this.notify(e)}notify(e){Ze();try{for(let t=this.subsHead;t;t=t.nextSub)t.sub.onTrigger&&!(t.sub.flags&8)&&t.sub.onTrigger(v({effect:t.sub},e));for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Qe()}}};function pt(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)pt(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}var mt=new WeakMap,ht=Symbol(`Object iterate`),gt=Symbol(`Map keys iterate`),_t=Symbol(`Array iterate`);function vt(e,t,n){if(at&&N){let r=mt.get(e);r||mt.set(e,r=new Map);let i=r.get(n);i||(r.set(n,i=new ft),i.map=r,i.key=n),i.track({target:e,type:t,key:n})}}function yt(e,t,n,r,i,a){let o=mt.get(e);if(!o){ut++;return}let s=o=>{o&&o.trigger({target:e,type:t,key:n,newValue:r,oldValue:i,oldTarget:a})};if(Ze(),t===`clear`)o.forEach(s);else{let i=S(e),a=i&&se(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===_t||!te(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(_t)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(ht)),C(e)&&s(o.get(gt)));break;case`delete`:i||(s(o.get(ht)),C(e)&&s(o.get(gt)));break;case`set`:C(e)&&s(o.get(ht))}}Qe()}function bt(e){let t=P(e);return t===e?t:(vt(t,`iterate`,_t),un(e)?t:t.map(pn))}function xt(e){return vt(e=P(e),`iterate`,_t),e}function St(e,t){return ln(e)?mn(cn(e)?pn(t):t):pn(t)}var Ct={__proto__:null,[Symbol.iterator](){return wt(this,Symbol.iterator,e=>St(this,e))},concat(...e){return bt(this).concat(...e.map(e=>S(e)?bt(e):e))},entries(){return wt(this,`entries`,e=>(e[1]=St(this,e[1]),e))},every(e,t){return Et(this,`every`,e,t,void 0,arguments)},filter(e,t){return Et(this,`filter`,e,t,e=>e.map(e=>St(this,e)),arguments)},find(e,t){return Et(this,`find`,e,t,e=>St(this,e),arguments)},findIndex(e,t){return Et(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return Et(this,`findLast`,e,t,e=>St(this,e),arguments)},findLastIndex(e,t){return Et(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return Et(this,`forEach`,e,t,void 0,arguments)},includes(...e){return Ot(this,`includes`,e)},indexOf(...e){return Ot(this,`indexOf`,e)},join(e){return bt(this).join(e)},lastIndexOf(...e){return Ot(this,`lastIndexOf`,e)},map(e,t){return Et(this,`map`,e,t,void 0,arguments)},pop(){return kt(this,`pop`)},push(...e){return kt(this,`push`,e)},reduce(e,...t){return Dt(this,`reduce`,e,t)},reduceRight(e,...t){return Dt(this,`reduceRight`,e,t)},shift(){return kt(this,`shift`)},some(e,t){return Et(this,`some`,e,t,void 0,arguments)},splice(...e){return kt(this,`splice`,e)},toReversed(){return bt(this).toReversed()},toSorted(e){return bt(this).toSorted(e)},toSpliced(...e){return bt(this).toSpliced(...e)},unshift(...e){return kt(this,`unshift`,e)},values(){return wt(this,`values`,e=>St(this,e))}};function wt(e,t,n){let r=xt(e),i=r[t]();return r!==e&&!un(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var Tt=Array.prototype;function Et(e,t,n,r,i,a){let o=xt(e),s=o!==e&&!un(e),c=o[t];if(c!==Tt[t]){let t=c.apply(e,a);return s?pn(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,St(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function Dt(e,t,n,r){let i=xt(e),a=i!==e&&!un(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=St(e,t)),n.call(this,t,St(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?St(e,c):c}function Ot(e,t,n){let r=P(e);vt(r,`iterate`,_t);let i=r[t](...n);return(i===-1||i===!1)&&dn(n[0])?(n[0]=P(n[0]),r[t](...n)):i}function kt(e,t,n=[]){st(),Ze();let r=P(e)[t].apply(e,n);return Qe(),ct(),r}var At=d(`__proto__,__v_isRef,__isVue`),jt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(te));function Mt(e){te(e)||(e=String(e));let t=P(this);return vt(t,`has`,e),t.hasOwnProperty(e)}var Nt=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?en:$t:i?Qt:Zt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=S(e);if(!r){let e;if(a&&(e=Ct[t]))return e;if(t===`hasOwnProperty`)return Mt}let o=Reflect.get(e,t,hn(e)?e:n);if((te(t)?jt.has(t):At(t))||(r||vt(e,`get`,t),i))return o;if(hn(o)){let e=a&&se(t)?o:o.value;return r&&D(e)?an(e):e}return D(o)?r?an(o):nn(o):o}},Pt=class extends Nt{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=S(e)&&se(t);if(!this._isShallow){let r=ln(i);if(!un(n)&&!ln(n)&&(i=P(i),n=P(n)),!a&&hn(i)&&!hn(n))return r?(Ve(`Set operation on key "${String(t)}" failed: target is readonly.`,e[t]),!0):(i.value=n,!0)}let o=a?Number(t)<e.length:x(e,t),s=Reflect.set(e,t,n,hn(e)?e:r);return e===P(r)&&s&&(o?ge(n,i)&&yt(e,`set`,t,n,i):yt(e,`add`,t,n)),s}deleteProperty(e,t){let n=x(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&yt(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!te(t)||!jt.has(t))&&vt(e,`has`,t),n}ownKeys(e){return vt(e,`iterate`,S(e)?`length`:ht),Reflect.ownKeys(e)}},Ft=class extends Nt{constructor(e=!1){super(!0,e)}set(e,t){return Ve(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return Ve(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},It=new Pt,Lt=new Ft,Rt=new Pt(!0),zt=new Ft(!0),Bt=e=>e,Vt=e=>Reflect.getPrototypeOf(e);function Ht(e,t,n){return function(...r){let i=this.__v_raw,a=P(i),o=C(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?Bt:t?mn:pn;return!t&&vt(a,`iterate`,c?gt:ht),v(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function Ut(e){return function(...t){{let n=t[0]?`on key "${t[0]}" `:``;Ve(`${me(e)} operation ${n}failed: target is readonly.`,P(this))}return e===`delete`?!1:e===`clear`?void 0:this}}function Wt(e,t){let n={get(n){let r=this.__v_raw,i=P(r),a=P(n);e||(ge(n,a)&&vt(i,`get`,n),vt(i,`get`,a));let{has:o}=Vt(i),s=t?Bt:e?mn:pn;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&vt(P(t),`iterate`,ht),t.size},has(t){let n=this.__v_raw,r=P(n),i=P(t);return e||(ge(t,i)&&vt(r,`has`,t),vt(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=P(a),s=t?Bt:e?mn:pn;return!e&&vt(o,`iterate`,ht),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return v(n,e?{add:Ut(`add`),set:Ut(`set`),delete:Ut(`delete`),clear:Ut(`clear`)}:{add(e){let n=P(this),r=Vt(n),i=P(e),a=!t&&!un(e)&&!ln(e)?i:e;return r.has.call(n,a)||ge(e,a)&&r.has.call(n,e)||ge(i,a)&&r.has.call(n,i)||(n.add(a),yt(n,`add`,a,a)),this},set(e,n){!t&&!un(n)&&!ln(n)&&(n=P(n));let r=P(this),{has:i,get:a}=Vt(r),o=i.call(r,e);o?Xt(r,i,e):(e=P(e),o=i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?ge(n,s)&&yt(r,`set`,e,n,s):yt(r,`add`,e,n),this},delete(e){let t=P(this),{has:n,get:r}=Vt(t),i=n.call(t,e);i?Xt(t,n,e):(e=P(e),i=n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&yt(t,`delete`,e,void 0,a),o},clear(){let e=P(this),t=e.size!==0,n=C(e)?new Map(e):new Set(e),r=e.clear();return t&&yt(e,`clear`,void 0,void 0,n),r}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=Ht(r,e,t)}),n}function Gt(e,t){let n=Wt(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(x(n,r)&&r in t?n:t,r,i)}var Kt={get:Gt(!1,!1)},qt={get:Gt(!1,!0)},Jt={get:Gt(!0,!1)},Yt={get:Gt(!0,!0)};function Xt(e,t,n){let r=P(n);if(r!==n&&t.call(e,r)){let t=ae(e);Ve(`Reactive ${t} contains both the raw and reactive versions of the same object${t===`Map`?` as keys`:``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var Zt=new WeakMap,Qt=new WeakMap,$t=new WeakMap,en=new WeakMap;function tn(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function nn(e){return ln(e)?e:sn(e,!1,It,Kt,Zt)}function rn(e){return sn(e,!1,Rt,qt,Qt)}function an(e){return sn(e,!0,Lt,Jt,$t)}function on(e){return sn(e,!0,zt,Yt,en)}function sn(e,t,n,r,i){if(!D(e))return Ve(`value cannot be made ${t?`readonly`:`reactive`}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=tn(ae(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function cn(e){return ln(e)?cn(e.__v_raw):!!(e&&e.__v_isReactive)}function ln(e){return!!(e&&e.__v_isReadonly)}function un(e){return!!(e&&e.__v_isShallow)}function dn(e){return e?!!e.__v_raw:!1}function P(e){let t=e&&e.__v_raw;return t?P(t):e}function fn(e){return!x(e,`__v_skip`)&&Object.isExtensible(e)&&ve(e,`__v_skip`,!0),e}var pn=e=>D(e)?nn(e):e,mn=e=>D(e)?an(e):e;function hn(e){return e?e.__v_isRef===!0:!1}function gn(e){return hn(e)?e.value:e}var _n={get:(e,t,n)=>t===`__v_raw`?e:gn(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return hn(i)&&!hn(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function vn(e){return cn(e)?e:new Proxy(e,_n)}var yn=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new ft(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ut-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&N!==this)return Xe(this,!0),!0}get value(){let e=this.dep.track({target:this,type:`get`,key:`value`});return nt(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter?this.setter(e):Ve(`Write operation failed: computed value is readonly`)}};function bn(e,t,n=!1){let r,i;T(e)?r=e:(r=e.get,i=e.set);let a=new yn(r,i,n);return t&&!n&&(a.onTrack=t.onTrack,a.onTrigger=t.onTrigger),a}var xn={},Sn=new WeakMap,Cn=void 0;function wn(e,t=!1,n=Cn){if(n){let t=Sn.get(n);t||Sn.set(n,t=[]),t.push(e)}else t||Ve(`onWatcherCleanup() was called when there was no active watcher to associate with.`)}function Tn(e,t,n=f){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:c}=n,l=e=>{(n.onWarn||Ve)(`Invalid watch source: `,e,`A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`)},u=e=>i?e:un(e)||i===!1||i===0?En(e,1):En(e),d,p,h,g,_=!1,v=!1;if(hn(e)?(p=()=>e.value,_=un(e)):cn(e)?(p=()=>u(e),_=!0):S(e)?(v=!0,_=e.some(e=>cn(e)||un(e)),p=()=>e.map(e=>{if(hn(e))return e.value;if(cn(e))return u(e);if(T(e))return c?c(e,2):e();l(e)})):T(e)?p=t?c?()=>c(e,2):e:()=>{if(h){st();try{h()}finally{ct()}}let t=Cn;Cn=d;try{return c?c(e,3,[g]):e(g)}finally{Cn=t}}:(p=m,l(e)),t&&i){let e=p,t=i===!0?1/0:i;p=()=>En(e(),t)}let b=We(),x=()=>{d.stop(),b&&b.active&&y(b.effects,d)};if(a&&t){let e=t;t=(...t)=>{let n=e(...t);return x(),n}}let C=v?Array(e.length).fill(xn):xn,w=e=>{if(!(!(d.flags&1)||!d.dirty&&!e))if(t){let n=d.run();if(e||i||_||(v?n.some((e,t)=>ge(e,C[t])):ge(n,C))){h&&h();let e=Cn;Cn=d;try{let e=[n,C===xn?void 0:v&&C[0]===xn?[]:C,g];C=n,c?c(t,3,e):t(...e)}finally{Cn=e}}}else d.run()};return s&&s(w),d=new Ke(p),d.scheduler=o?()=>o(w,!1):w,g=e=>wn(e,!1,d),h=d.onStop=()=>{let e=Sn.get(d);if(e){if(c)c(e,4);else for(let t of e)t();Sn.delete(d)}},d.onTrack=n.onTrack,d.onTrigger=n.onTrigger,t?r?w(!0):C=d.run():o?o(w.bind(null,!0),!0):d.run(),x.pause=d.pause.bind(d),x.resume=d.resume.bind(d),x.stop=x,x}function En(e,t=1/0,n){if(t<=0||!D(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,hn(e))En(e.value,t,n);else if(S(e))for(let r=0;r<e.length;r++)En(e[r],t,n);else if(w(e)||C(e))e.forEach(e=>{En(e,t,n)});else if(oe(e)){for(let r in e)En(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&En(e[r],t,n)}return e}var Dn=[];function On(e){Dn.push(e)}function kn(){Dn.pop()}var An=!1;function F(e,...t){if(An)return;An=!0,st();let n=Dn.length?Dn[Dn.length-1].component:null,r=n&&n.appContext.config.warnHandler,i=jn();if(r)Rn(r,n,11,[e+t.map(e=>e.toString?.call(e)??JSON.stringify(e)).join(``),n&&n.proxy,i.map(({vnode:e})=>`at <${Rs(n,e.type)}>`).join(`
|
|
107
|
+
`,u=()=>{let e=document.createElement(`div`);e.innerHTML=l;let t=e.getElementsByTagName(`svg`)[0];if(t){t.setAttribute(`aria-hidden`,`true`),t.style.position=`absolute`,t.style.width=`0`,t.style.height=`0`,t.style.overflow=`hidden`;let e=document.body.firstChild;e?document.body.insertBefore(t,e):document.body.appendChild(t)}};(()=>{let e=()=>{document.removeEventListener(`DOMContentLoaded`,e),u()};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,e):u()})();function d(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var f=Object.freeze({}),p=Object.freeze([]),m=()=>{},h=()=>!1,g=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),_=e=>e.startsWith(`onUpdate:`),v=Object.assign,y=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},b=Object.prototype.hasOwnProperty,x=(e,t)=>b.call(e,t),S=Array.isArray,C=e=>ie(e)===`[object Map]`,w=e=>ie(e)===`[object Set]`,ee=e=>ie(e)===`[object Date]`,T=e=>typeof e==`function`,E=e=>typeof e==`string`,te=e=>typeof e==`symbol`,D=e=>typeof e==`object`&&!!e,ne=e=>(D(e)||T(e))&&T(e.then)&&T(e.catch),re=Object.prototype.toString,ie=e=>re.call(e),ae=e=>ie(e).slice(8,-1),oe=e=>ie(e)===`[object Object]`,se=e=>E(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,ce=d(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),le=d(`bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo`),ue=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},de=/-\w/g,O=ue(e=>e.replace(de,e=>e.slice(1).toUpperCase())),fe=/\B([A-Z])/g,pe=ue(e=>e.replace(fe,`-$1`).toLowerCase()),me=ue(e=>e.charAt(0).toUpperCase()+e.slice(1)),he=ue(e=>e?`on${me(e)}`:``),ge=(e,t)=>!Object.is(e,t),_e=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ve=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ye=e=>{let t=parseFloat(e);return isNaN(t)?e:t},be=e=>{let t=E(e)?Number(e):NaN;return isNaN(t)?e:t},xe,Se=()=>xe||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function k(e){if(S(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=E(r)?Ee(r):k(r);if(i)for(let e in i)t[e]=i[e]}return t}if(E(e)||D(e))return e}var Ce=/;(?![^(]*\))/g,we=/:([^]+)/,Te=/\/\*[^]*?\*\//g;function Ee(e){let t={};return e.replace(Te,``).split(Ce).forEach(e=>{if(e){let n=e.split(we);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function A(e){let t=``;if(E(e))t=e;else if(S(e))for(let n=0;n<e.length;n++){let r=A(e[n]);r&&(t+=r+` `)}else if(D(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}var De=`html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot`,Oe=`svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view`,ke=`annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics`,Ae=d(De),je=d(Oe),Me=d(ke),Ne=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,Pe=d(Ne);Ne+``;function Fe(e){return!!e||e===``}function Ie(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Le(e[r],t[r]);return n}function Le(e,t){if(e===t)return!0;let n=ee(e),r=ee(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=te(e),r=te(t),n||r)return e===t;if(n=S(e),r=S(t),n||r)return n&&r?Ie(e,t):!1;if(n=D(e),r=D(t),n||r){if(!n||!r||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!Le(e[n],t[n]))return!1}}return String(e)===String(t)}function Re(e,t){return e.findIndex(e=>Le(e,t))}var ze=e=>!!(e&&e.__v_isRef===!0),j=e=>E(e)?e:e==null?``:S(e)||D(e)&&(e.toString===re||!T(e.toString))?ze(e)?j(e.value):JSON.stringify(e,Be,2):String(e),Be=(e,t)=>ze(t)?Be(e,t.value):C(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ve(t,r)+` =>`]=n,e),{})}:w(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ve(e))}:te(t)?Ve(t):D(t)&&!S(t)&&!oe(t)?String(t):t,Ve=(e,t=``)=>te(e)?`Symbol(${e.description??t})`:e;function He(e,...t){console.warn(`[Vue warn] ${e}`,...t)}var Ue,We=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&Ue&&(Ue.active?(this.parent=Ue,this.index=(Ue.scopes||(Ue.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=Ue;try{return Ue=this,e()}finally{Ue=t}}this._warnOnRun&&He(`cannot run an inactive effect scope.`)}on(){++this._on===1&&(this.prevScope=Ue,Ue=this)}off(){if(this._on>0&&--this._on===0){if(Ue===this)Ue=this.prevScope;else{let e=Ue;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let e=this.scopes.slice();for(t=0,n=e.length;t<n;t++)e[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function Ge(){return Ue}var M,Ke=new WeakSet,qe=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ue&&(Ue.active?Ue.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ke.has(this)&&(Ke.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Ze(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ut(this),et(this);let e=M,t=ot;M=this,ot=!0;try{return this.fn()}finally{M!==this&&He(`Active effect was not restored correctly - this is likely a Vue internal bug.`),tt(this),M=e,ot=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)it(e);this.deps=this.depsTail=void 0,ut(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ke.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){nt(this)&&this.run()}get dirty(){return nt(this)}},Je=0,Ye,Xe;function Ze(e,t=!1){if(e.flags|=8,t){e.next=Xe,Xe=e;return}e.next=Ye,Ye=e}function Qe(){Je++}function $e(){if(--Je>0)return;if(Xe){let e=Xe;for(Xe=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Ye;){let t=Ye;for(Ye=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function et(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function tt(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),it(r),at(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function nt(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(rt(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function rt(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===dt)||(e.globalVersion=dt,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!nt(e))))return;e.flags|=2;let t=e.dep,n=M,r=ot;M=e,ot=!0;try{et(e);let n=e.fn(e._value);(t.version===0||ge(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{M=n,ot=r,tt(e),e.flags&=-3}}function it(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subsHead===e&&(n.subsHead=i),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)it(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function at(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var ot=!0,st=[];function ct(){st.push(ot),ot=!1}function lt(){let e=st.pop();ot=e===void 0||e}function ut(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=M;M=void 0;try{t()}finally{M=e}}}var dt=0,ft=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},pt=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,this.subsHead=void 0}track(e){if(!M||!ot||M===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==M)t=this.activeLink=new ft(M,this),M.deps?(t.prevDep=M.depsTail,M.depsTail.nextDep=t,M.depsTail=t):M.deps=M.depsTail=t,mt(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=M.depsTail,t.nextDep=void 0,M.depsTail.nextDep=t,M.depsTail=t,M.deps===t&&(M.deps=e)}return M.onTrack&&M.onTrack(v({effect:M},e)),t}trigger(e){this.version++,dt++,this.notify(e)}notify(e){Qe();try{for(let t=this.subsHead;t;t=t.nextSub)t.sub.onTrigger&&!(t.sub.flags&8)&&t.sub.onTrigger(v({effect:t.sub},e));for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{$e()}}};function mt(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)mt(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}var ht=new WeakMap,gt=Symbol(`Object iterate`),_t=Symbol(`Map keys iterate`),vt=Symbol(`Array iterate`);function yt(e,t,n){if(ot&&M){let r=ht.get(e);r||ht.set(e,r=new Map);let i=r.get(n);i||(r.set(n,i=new pt),i.map=r,i.key=n),i.track({target:e,type:t,key:n})}}function bt(e,t,n,r,i,a){let o=ht.get(e);if(!o){dt++;return}let s=o=>{o&&o.trigger({target:e,type:t,key:n,newValue:r,oldValue:i,oldTarget:a})};if(Qe(),t===`clear`)o.forEach(s);else{let i=S(e),a=i&&se(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===vt||!te(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(vt)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(gt)),C(e)&&s(o.get(_t)));break;case`delete`:i||(s(o.get(gt)),C(e)&&s(o.get(_t)));break;case`set`:C(e)&&s(o.get(gt))}}$e()}function xt(e){let t=N(e);return t===e?t:(yt(t,`iterate`,vt),dn(e)?t:t.map(mn))}function St(e){return yt(e=N(e),`iterate`,vt),e}function Ct(e,t){return un(e)?hn(ln(e)?mn(t):t):mn(t)}var wt={__proto__:null,[Symbol.iterator](){return Tt(this,Symbol.iterator,e=>Ct(this,e))},concat(...e){return xt(this).concat(...e.map(e=>S(e)?xt(e):e))},entries(){return Tt(this,`entries`,e=>(e[1]=Ct(this,e[1]),e))},every(e,t){return Dt(this,`every`,e,t,void 0,arguments)},filter(e,t){return Dt(this,`filter`,e,t,e=>e.map(e=>Ct(this,e)),arguments)},find(e,t){return Dt(this,`find`,e,t,e=>Ct(this,e),arguments)},findIndex(e,t){return Dt(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return Dt(this,`findLast`,e,t,e=>Ct(this,e),arguments)},findLastIndex(e,t){return Dt(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return Dt(this,`forEach`,e,t,void 0,arguments)},includes(...e){return kt(this,`includes`,e)},indexOf(...e){return kt(this,`indexOf`,e)},join(e){return xt(this).join(e)},lastIndexOf(...e){return kt(this,`lastIndexOf`,e)},map(e,t){return Dt(this,`map`,e,t,void 0,arguments)},pop(){return At(this,`pop`)},push(...e){return At(this,`push`,e)},reduce(e,...t){return Ot(this,`reduce`,e,t)},reduceRight(e,...t){return Ot(this,`reduceRight`,e,t)},shift(){return At(this,`shift`)},some(e,t){return Dt(this,`some`,e,t,void 0,arguments)},splice(...e){return At(this,`splice`,e)},toReversed(){return xt(this).toReversed()},toSorted(e){return xt(this).toSorted(e)},toSpliced(...e){return xt(this).toSpliced(...e)},unshift(...e){return At(this,`unshift`,e)},values(){return Tt(this,`values`,e=>Ct(this,e))}};function Tt(e,t,n){let r=St(e),i=r[t]();return r!==e&&!dn(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var Et=Array.prototype;function Dt(e,t,n,r,i,a){let o=St(e),s=o!==e&&!dn(e),c=o[t];if(c!==Et[t]){let t=c.apply(e,a);return s?mn(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,Ct(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function Ot(e,t,n,r){let i=St(e),a=i!==e&&!dn(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=Ct(e,t)),n.call(this,t,Ct(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?Ct(e,c):c}function kt(e,t,n){let r=N(e);yt(r,`iterate`,vt);let i=r[t](...n);return(i===-1||i===!1)&&fn(n[0])?(n[0]=N(n[0]),r[t](...n)):i}function At(e,t,n=[]){ct(),Qe();let r=N(e)[t].apply(e,n);return $e(),lt(),r}var jt=d(`__proto__,__v_isRef,__isVue`),Mt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(te));function Nt(e){te(e)||(e=String(e));let t=N(this);return yt(t,`has`,e),t.hasOwnProperty(e)}var Pt=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?tn:en:i?$t:Qt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=S(e);if(!r){let e;if(a&&(e=wt[t]))return e;if(t===`hasOwnProperty`)return Nt}let o=Reflect.get(e,t,gn(e)?e:n);if((te(t)?Mt.has(t):jt(t))||(r||yt(e,`get`,t),i))return o;if(gn(o)){let e=a&&se(t)?o:o.value;return r&&D(e)?on(e):e}return D(o)?r?on(o):rn(o):o}},Ft=class extends Pt{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=S(e)&&se(t);if(!this._isShallow){let r=un(i);if(!dn(n)&&!un(n)&&(i=N(i),n=N(n)),!a&&gn(i)&&!gn(n))return r?(He(`Set operation on key "${String(t)}" failed: target is readonly.`,e[t]),!0):(i.value=n,!0)}let o=a?Number(t)<e.length:x(e,t),s=Reflect.set(e,t,n,gn(e)?e:r);return e===N(r)&&s&&(o?ge(n,i)&&bt(e,`set`,t,n,i):bt(e,`add`,t,n)),s}deleteProperty(e,t){let n=x(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&bt(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!te(t)||!Mt.has(t))&&yt(e,`has`,t),n}ownKeys(e){return yt(e,`iterate`,S(e)?`length`:gt),Reflect.ownKeys(e)}},It=class extends Pt{constructor(e=!1){super(!0,e)}set(e,t){return He(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return He(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},Lt=new Ft,Rt=new It,zt=new Ft(!0),Bt=new It(!0),Vt=e=>e,Ht=e=>Reflect.getPrototypeOf(e);function Ut(e,t,n){return function(...r){let i=this.__v_raw,a=N(i),o=C(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?Vt:t?hn:mn;return!t&&yt(a,`iterate`,c?_t:gt),v(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function Wt(e){return function(...t){{let n=t[0]?`on key "${t[0]}" `:``;He(`${me(e)} operation ${n}failed: target is readonly.`,N(this))}return e===`delete`?!1:e===`clear`?void 0:this}}function Gt(e,t){let n={get(n){let r=this.__v_raw,i=N(r),a=N(n);e||(ge(n,a)&&yt(i,`get`,n),yt(i,`get`,a));let{has:o}=Ht(i),s=t?Vt:e?hn:mn;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&yt(N(t),`iterate`,gt),t.size},has(t){let n=this.__v_raw,r=N(n),i=N(t);return e||(ge(t,i)&&yt(r,`has`,t),yt(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=N(a),s=t?Vt:e?hn:mn;return!e&&yt(o,`iterate`,gt),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return v(n,e?{add:Wt(`add`),set:Wt(`set`),delete:Wt(`delete`),clear:Wt(`clear`)}:{add(e){let n=N(this),r=Ht(n),i=N(e),a=!t&&!dn(e)&&!un(e)?i:e;return r.has.call(n,a)||ge(e,a)&&r.has.call(n,e)||ge(i,a)&&r.has.call(n,i)||(n.add(a),bt(n,`add`,a,a)),this},set(e,n){!t&&!dn(n)&&!un(n)&&(n=N(n));let r=N(this),{has:i,get:a}=Ht(r),o=i.call(r,e);o?Zt(r,i,e):(e=N(e),o=i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?ge(n,s)&&bt(r,`set`,e,n,s):bt(r,`add`,e,n),this},delete(e){let t=N(this),{has:n,get:r}=Ht(t),i=n.call(t,e);i?Zt(t,n,e):(e=N(e),i=n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&bt(t,`delete`,e,void 0,a),o},clear(){let e=N(this),t=e.size!==0,n=C(e)?new Map(e):new Set(e),r=e.clear();return t&&bt(e,`clear`,void 0,void 0,n),r}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=Ut(r,e,t)}),n}function Kt(e,t){let n=Gt(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(x(n,r)&&r in t?n:t,r,i)}var qt={get:Kt(!1,!1)},Jt={get:Kt(!1,!0)},Yt={get:Kt(!0,!1)},Xt={get:Kt(!0,!0)};function Zt(e,t,n){let r=N(n);if(r!==n&&t.call(e,r)){let t=ae(e);He(`Reactive ${t} contains both the raw and reactive versions of the same object${t===`Map`?` as keys`:``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var Qt=new WeakMap,$t=new WeakMap,en=new WeakMap,tn=new WeakMap;function nn(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function rn(e){return un(e)?e:cn(e,!1,Lt,qt,Qt)}function an(e){return cn(e,!1,zt,Jt,$t)}function on(e){return cn(e,!0,Rt,Yt,en)}function sn(e){return cn(e,!0,Bt,Xt,tn)}function cn(e,t,n,r,i){if(!D(e))return He(`value cannot be made ${t?`readonly`:`reactive`}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=nn(ae(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function ln(e){return un(e)?ln(e.__v_raw):!!(e&&e.__v_isReactive)}function un(e){return!!(e&&e.__v_isReadonly)}function dn(e){return!!(e&&e.__v_isShallow)}function fn(e){return e?!!e.__v_raw:!1}function N(e){let t=e&&e.__v_raw;return t?N(t):e}function pn(e){return!x(e,`__v_skip`)&&Object.isExtensible(e)&&ve(e,`__v_skip`,!0),e}var mn=e=>D(e)?rn(e):e,hn=e=>D(e)?on(e):e;function gn(e){return e?e.__v_isRef===!0:!1}function _n(e){return gn(e)?e.value:e}var vn={get:(e,t,n)=>t===`__v_raw`?e:_n(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return gn(i)&&!gn(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function yn(e){return ln(e)?e:new Proxy(e,vn)}var bn=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new pt(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=dt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&M!==this)return Ze(this,!0),!0}get value(){let e=this.dep.track({target:this,type:`get`,key:`value`});return rt(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter?this.setter(e):He(`Write operation failed: computed value is readonly`)}};function xn(e,t,n=!1){let r,i;T(e)?r=e:(r=e.get,i=e.set);let a=new bn(r,i,n);return t&&!n&&(a.onTrack=t.onTrack,a.onTrigger=t.onTrigger),a}var Sn={},Cn=new WeakMap,wn=void 0;function Tn(e,t=!1,n=wn){if(n){let t=Cn.get(n);t||Cn.set(n,t=[]),t.push(e)}else t||He(`onWatcherCleanup() was called when there was no active watcher to associate with.`)}function En(e,t,n=f){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:c}=n,l=e=>{(n.onWarn||He)(`Invalid watch source: `,e,`A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`)},u=e=>i?e:dn(e)||i===!1||i===0?Dn(e,1):Dn(e),d,p,h,g,_=!1,v=!1;if(gn(e)?(p=()=>e.value,_=dn(e)):ln(e)?(p=()=>u(e),_=!0):S(e)?(v=!0,_=e.some(e=>ln(e)||dn(e)),p=()=>e.map(e=>{if(gn(e))return e.value;if(ln(e))return u(e);if(T(e))return c?c(e,2):e();l(e)})):T(e)?p=t?c?()=>c(e,2):e:()=>{if(h){ct();try{h()}finally{lt()}}let t=wn;wn=d;try{return c?c(e,3,[g]):e(g)}finally{wn=t}}:(p=m,l(e)),t&&i){let e=p,t=i===!0?1/0:i;p=()=>Dn(e(),t)}let b=Ge(),x=()=>{d.stop(),b&&b.active&&y(b.effects,d)};if(a&&t){let e=t;t=(...t)=>{let n=e(...t);return x(),n}}let C=v?Array(e.length).fill(Sn):Sn,w=e=>{if(!(!(d.flags&1)||!d.dirty&&!e))if(t){let n=d.run();if(e||i||_||(v?n.some((e,t)=>ge(e,C[t])):ge(n,C))){h&&h();let e=wn;wn=d;try{let e=[n,C===Sn?void 0:v&&C[0]===Sn?[]:C,g];C=n,c?c(t,3,e):t(...e)}finally{wn=e}}}else d.run()};return s&&s(w),d=new qe(p),d.scheduler=o?()=>o(w,!1):w,g=e=>Tn(e,!1,d),h=d.onStop=()=>{let e=Cn.get(d);if(e){if(c)c(e,4);else for(let t of e)t();Cn.delete(d)}},d.onTrack=n.onTrack,d.onTrigger=n.onTrigger,t?r?w(!0):C=d.run():o?o(w.bind(null,!0),!0):d.run(),x.pause=d.pause.bind(d),x.resume=d.resume.bind(d),x.stop=x,x}function Dn(e,t=1/0,n){if(t<=0||!D(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,gn(e))Dn(e.value,t,n);else if(S(e))for(let r=0;r<e.length;r++)Dn(e[r],t,n);else if(w(e)||C(e))e.forEach(e=>{Dn(e,t,n)});else if(oe(e)){for(let r in e)Dn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Dn(e[r],t,n)}return e}var On=[];function kn(e){On.push(e)}function An(){On.pop()}var jn=!1;function P(e,...t){if(jn)return;jn=!0,ct();let n=On.length?On[On.length-1].component:null,r=n&&n.appContext.config.warnHandler,i=Mn();if(r)zn(r,n,11,[e+t.map(e=>e.toString?.call(e)??JSON.stringify(e)).join(``),n&&n.proxy,i.map(({vnode:e})=>`at <${zs(n,e.type)}>`).join(`
|
|
108
108
|
`),i]);else{let n=[`[Vue warn]: ${e}`,...t];i.length&&n.push(`
|
|
109
|
-
`,...
|
|
110
|
-
`],...Nn(e))}),t}function Nn({vnode:e,recurseCount:t}){let n=t>0?`... (${t} recursive calls)`:``,r=e.component?e.component.parent==null:!1,i=` at <${Rs(e.component,e.type,r)}`,a=`>`+n;return e.props?[i,...Pn(e.props),a]:[i+a]}function Pn(e){let t=[],n=Object.keys(e);return n.slice(0,3).forEach(n=>{t.push(...Fn(n,e[n]))}),n.length>3&&t.push(` ...`),t}function Fn(e,t,n){return E(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t==`number`||typeof t==`boolean`||t==null?n?t:[`${e}=${t}`]:hn(t)?(t=Fn(e,P(t.value),!0),n?t:[`${e}=Ref<`,t,`>`]):T(t)?[`${e}=fn${t.name?`<${t.name}>`:``}`]:(t=P(t),n?t:[`${e}=`,t])}function In(e,t){e!==void 0&&(typeof e==`number`?isNaN(e)&&F(`${t} is NaN - the duration expression might be incorrect.`):F(`${t} is not a valid number - got ${JSON.stringify(e)}.`))}var Ln={sp:`serverPrefetch hook`,bc:`beforeCreate hook`,c:`created hook`,bm:`beforeMount hook`,m:`mounted hook`,bu:`beforeUpdate hook`,u:`updated`,bum:`beforeUnmount hook`,um:`unmounted hook`,a:`activated hook`,da:`deactivated hook`,ec:`errorCaptured hook`,rtc:`renderTracked hook`,rtg:`renderTriggered hook`,0:`setup function`,1:`render function`,2:`watcher getter`,3:`watcher callback`,4:`watcher cleanup function`,5:`native event handler`,6:`component event handler`,7:`vnode hook`,8:`directive hook`,9:`transition hook`,10:`app errorHandler`,11:`app warnHandler`,12:`ref function`,13:`async component loader`,14:`scheduler flush`,15:`component update`,16:`app unmount cleanup function`};function Rn(e,t,n,r){try{return r?e(...r):e()}catch(e){Bn(e,t,n)}}function zn(e,t,n,r){if(T(e)){let i=Rn(e,t,n,r);return i&&ne(i)&&i.catch(e=>{Bn(e,t,n)}),i}if(S(e)){let i=[];for(let a=0;a<e.length;a++)i.push(zn(e[a],t,n,r));return i}F(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function Bn(e,t,n,r=!0){let i=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||f;if(t){let r=t.parent,i=t.proxy,o=Ln[n];for(;r;){let t=r.ec;if(t){for(let n=0;n<t.length;n++)if(t[n](e,i,o)===!1)return}r=r.parent}if(a){st(),Rn(a,null,10,[e,i,o]),ct();return}}Vn(e,n,i,r,o)}function Vn(e,t,n,r=!0,i=!1){{let i=Ln[t];if(n&&On(n),F(`Unhandled error${i?` during execution of ${i}`:``}`),n&&kn(),r)throw e;console.error(e)}}var Hn=[],Un=-1,Wn=[],Gn=null,Kn=0,qn=Promise.resolve(),Jn=null,Yn=100;function Xn(e){let t=Jn||qn;return e?t.then(this?e.bind(this):e):t}function Zn(e){let t=Un+1,n=Hn.length;for(;t<n;){let r=t+n>>>1,i=Hn[r],a=rr(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function Qn(e){if(!(e.flags&1)){let t=rr(e),n=Hn[Hn.length-1];!n||!(e.flags&2)&&t>=rr(n)?Hn.push(e):Hn.splice(Zn(t),0,e),e.flags|=1,$n()}}function $n(){Jn||=qn.then(ir)}function er(e){S(e)?Wn.push(...e):Gn&&e.id===-1?Gn.splice(Kn+1,0,e):e.flags&1||(Wn.push(e),e.flags|=1),$n()}function tr(e,t,n=Un+1){for(t||=new Map;n<Hn.length;n++){let r=Hn[n];if(r&&r.flags&2){if(e&&r.id!==e.uid||ar(t,r))continue;Hn.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function nr(e){if(Wn.length){let t=[...new Set(Wn)].sort((e,t)=>rr(e)-rr(t));if(Wn.length=0,Gn){Gn.push(...t);return}for(Gn=t,e||=new Map,Kn=0;Kn<Gn.length;Kn++){let t=Gn[Kn];ar(e,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}Gn=null,Kn=0}}var rr=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ir(e){e||=new Map;let t=t=>ar(e,t);try{for(Un=0;Un<Hn.length;Un++){let e=Hn[Un];if(e&&!(e.flags&8)){if(t(e))continue;e.flags&4&&(e.flags&=-2),Rn(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2)}}}finally{for(;Un<Hn.length;Un++){let e=Hn[Un];e&&(e.flags&=-2)}Un=-1,Hn.length=0,nr(e),Jn=null,(Hn.length||Wn.length)&&ir(e)}}function ar(e,t){let n=e.get(t)||0;if(n>Yn){let e=t.i,n=e&&Ls(e.type);return Bn(`Maximum recursive updates exceeded${n?` in component <${n}>`:``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}var or=!1,sr=e=>{try{return or}finally{or=e}},cr=new Map;xe().__VUE_HMR_RUNTIME__={createRecord:_r(fr),rerender:_r(mr),reload:_r(hr)};var lr=new Map;function ur(e){let t=e.type.__hmrId,n=lr.get(t);n||=(fr(t,e.type),lr.get(t)),n.instances.add(e)}function dr(e){lr.get(e.type.__hmrId).instances.delete(e)}function fr(e,t){return!lr.has(e)&&(lr.set(e,{initialDef:pr(t),instances:new Set}),!0)}function pr(e){return zs(e)?e.__vccOpts:e}function mr(e,t){let n=lr.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(e=>{t&&(e.render=t,pr(e.type).render=t),e.renderCache=[],or=!0,e.job.flags&8||e.update(),or=!1}))}function hr(e,t){let n=lr.get(e);if(!n)return;t=pr(t),gr(n.initialDef,t);let r=[...n.instances];for(let e=0;e<r.length;e++){let i=r[e],a=pr(i.type),o=cr.get(a);o||(a!==n.initialDef&&gr(a,t),cr.set(a,o=new Set)),o.add(i),i.appContext.propsCache.delete(i.type),i.appContext.emitsCache.delete(i.type),i.appContext.optionsCache.delete(i.type),i.ceReload?(o.add(i),i.ceReload(t.styles),o.delete(i)):i.parent?Qn(()=>{i.job.flags&8||(or=!0,i.parent.update(),or=!1,o.delete(i))}):i.appContext.reload?i.appContext.reload():typeof window<`u`?window.location.reload():console.warn(`[HMR] Root or manually mounted instance modified. Full reload required.`),i.root.ce&&i!==i.root&&i.root.ce._removeChildStyle(a)}er(()=>{cr.clear()})}function gr(e,t){v(e,t);for(let n in e)n!==`__file`&&!(n in t)&&delete e[n]}function _r(e){return(t,n)=>{try{return e(t,n)}catch(e){console.error(e),console.warn(`[HMR] Something went wrong during Vue component hot-reload. Full reload required.`)}}}var vr,yr=[],br=!1;function xr(e,...t){vr?vr.emit(e,...t):br||yr.push({event:e,args:t})}function Sr(e,t){vr=e,vr?(vr.enabled=!0,yr.forEach(({event:e,args:t})=>vr.emit(e,...t)),yr=[]):typeof window<`u`&&window.HTMLElement&&!(window.navigator?.userAgent)?.includes(`jsdom`)?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(e=>{Sr(e,t)}),setTimeout(()=>{vr||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,br=!0,yr=[])},3e3)):(br=!0,yr=[])}function Cr(e,t){xr(`app:init`,e,t,{Fragment:z,Text:Bo,Comment:Vo,Static:Ho})}function wr(e){xr(`app:unmount`,e)}var Tr=kr(`component:added`),Er=kr(`component:updated`),Dr=kr(`component:removed`),Or=e=>{vr&&typeof vr.cleanupBuffer==`function`&&!vr.cleanupBuffer(e)&&Dr(e)};function kr(e){return t=>{xr(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}var Ar=Mr(`perf:start`),jr=Mr(`perf:end`);function Mr(e){return(t,n,r)=>{xr(e,t.appContext.app,t.uid,t,n,r)}}function Nr(e,t,n){xr(`component:emit`,e.appContext.app,e,t,n)}var Pr=null,Fr=null;function Ir(e){let t=Pr;return Pr=e,Fr=e&&e.type.__scopeId||null,t}function Lr(e,t=Pr,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&qo(-1);let i=Ir(t),a=Uo.length,o;try{o=e(...n)}finally{for(let e=Uo.length;e>a;e--)Go();Ir(i),r._d&&qo(1)}return Er(t),o};return r._n=!0,r._c=!0,r._d=!0,r}function Rr(e){le(e)&&F(`Do not use built-in directive ids as custom directive id: `+e)}function I(e,t){if(Pr===null)return F(`withDirectives can only be used inside render functions.`),e;let n=Ps(Pr),r=e.dirs||=[];for(let e=0;e<t.length;e++){let[i,a,o,s=f]=t[e];i&&(T(i)&&(i={mounted:i,updated:i}),i.deep&&En(a),r.push({dir:i,instance:n,value:a,oldValue:void 0,arg:o,modifiers:s}))}return e}function zr(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(st(),zn(c,n,8,[e.el,s,e,t]),ct())}}function Br(e,t){if((!ms||ms.isMounted)&&F(`provide() can only be used inside setup().`),ms){let n=ms.provides,r=ms.parent&&ms.parent.provides;r===n&&(n=ms.provides=Object.create(r)),n[e]=t}}function Vr(e,t,n=!1){let r=hs();if(r||Oa){let i=Oa?Oa._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&T(t)?t.call(r&&r.proxy):t;F(`injection "${String(e)}" not found.`)}else F(`inject() can only be used inside setup() or functional components.`)}var Hr=Symbol.for(`v-scx`),Ur=()=>{{let e=Vr(Hr);return e||F(`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`),e}};function Wr(e,t,n){return T(t)||F("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),Gr(e,t,n)}function Gr(e,t,n=f){let{immediate:r,deep:i,flush:a,once:o}=n;t||(r!==void 0&&F(`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`),i!==void 0&&F(`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`),o!==void 0&&F(`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`));let s=v({},n);s.onWarn=F;let c=t&&r||!t&&a!==`post`,l;if(Cs){if(a===`sync`){let e=Ur();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=m,e.resume=m,e.pause=m,e}}let u=ms;s.call=(e,t,n)=>zn(e,u,t,n);let d=!1;a===`post`?s.scheduler=e=>{Do(e,u&&u.suspense)}:a!==`sync`&&(d=!0,s.scheduler=(e,t)=>{t?e():Qn(e)}),s.augmentJob=e=>{t&&(e.flags|=4),d&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let p=Tn(e,t,s);return Cs&&(l?l.push(p):c&&p()),p}function Kr(e,t,n){let r=this.proxy,i=E(e)?e.includes(`.`)?qr(r,e):()=>r[e]:e.bind(r,r),a;T(t)?a=t:(a=t.handler,n=t);let o=vs(this),s=Gr(i,a.bind(r),n);return o(),s}function qr(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var Jr=new WeakMap,Yr=Symbol(`_vte`),Xr=e=>e.__isTeleport,Zr=e=>e&&(e.disabled||e.disabled===``),Qr=e=>e&&(e.defer||e.defer===``),$r=e=>typeof SVGElement<`u`&&e instanceof SVGElement,ei=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,ti=(e,t)=>{let n=e&&e.to;if(E(n))if(t){let r=t(n);return!r&&!Zr(e)&&F(`Failed to locate Teleport target with selector "${n}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`),r}else return F(`Current renderer does not support string target for Teleports. (missing querySelector renderer option)`),null;return!n&&!Zr(e)&&F(`Invalid Teleport target: ${n}`),n},ni={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g,parentNode:_}}=l,v=Zr(t.props),{dynamicChildren:y}=t;or&&(c=!1,y=null);let b=(e,t,n)=>{e.shapeFlag&16&&u(e.children,t,n,i,a,o,s,c)},x=(e=t)=>{let n=Zr(e.props),r=e.target=ti(e.props,m),a=si(r,e,h,p);r?(o!==`svg`&&$r(r)?o=`svg`:o!==`mathml`&&ei(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),oi(e,!1))):n||F(`Invalid Teleport target on mount:`,r,`(${typeof r})`)},S=e=>{let t=()=>{if(Jr.get(e)===t){if(Jr.delete(e),Zr(e.props)){let t=_(e.el)||n;b(e,t,e.anchor),oi(e,!0)}x(e)}};Jr.set(e,t),Do(t,a)};if(e==null){let e=t.el=g(`teleport start`),i=t.anchor=g(`teleport end`);if(p(e,n,r),p(i,n,r),Qr(t.props)||a&&a.pendingBranch){S(t);return}v&&(b(t,n,i),oi(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=Jr.get(e);if(u){u.flags|=8,Jr.delete(e),S(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=Zr(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||$r(p)?o=`svg`:(o===`mathml`||ei(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),No(e,t,!1)):c||d(e,t,_,b,i,a,o,s,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ri(t,n,r,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=ti(t.props,m);e?(t.target=e,ri(t,e,null,l,0)):F(`Invalid Teleport target on update:`,p,`(${typeof p})`)}else g&&ri(t,p,h,l,1);oi(t,v)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e,p=Zr(f),m=a||!p,h=Jr.get(e);if(h&&(h.flags|=8,Jr.delete(e)),d&&(i(l),i(u)),a&&i(c),!h&&(p||d)&&o&16)for(let e=0;e<s.length;e++){let i=s[e];r(i,t,n,m,!!i.dynamicChildren)}},move:ri,hydrate:ii};function ri(e,t,n,{o:{insert:r},m:i},a=2){a===0&&r(e.targetAnchor,t,n);let{el:o,anchor:s,shapeFlag:c,children:l,props:u}=e,d=a===2;if(d&&r(o,t,n),!Jr.has(e)&&(!d||Zr(u))&&c&16)for(let e=0;e<l.length;e++)i(l[e],t,n,2);d&&r(s,t,n)}function ii(e,t,n,r,i,a,{o:{nextSibling:o,parentNode:s,querySelector:c,insert:l,createText:u}},d){function f(e,n){let r=n;for(;r;){if(r&&r.nodeType===8){if(r.data===`teleport start anchor`)t.targetStart=r;else if(r.data===`teleport anchor`){t.targetAnchor=r,e._lpa=t.targetAnchor&&o(t.targetAnchor);break}}r=o(r)}}function p(e,t){t.anchor=d(o(e),t,s(e),n,r,i,a)}let m=t.target=ti(t.props,c),h=Zr(t.props);if(m){let c=m._lpa||m.firstChild;t.shapeFlag&16&&(h?(p(e,t),f(m,c),t.targetAnchor||si(m,t,u,l,s(e)===m?e:null)):(t.anchor=o(e),f(m,c),t.targetAnchor||si(m,t,u,l),d(c&&o(c),t,m,n,r,i,a))),oi(t,h)}else h&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=o(e));return t.anchor&&o(t.anchor)}var ai=ni;function oi(e,t){let n=e.ctx;if(n&&n.ut){let r,i;for(t?(r=e.el,i=e.anchor):(r=e.targetStart,i=e.targetAnchor);r&&r!==i;)r.nodeType===1&&r.setAttribute(`data-v-owner`,n.uid),r=r.nextSibling;n.ut()}}function si(e,t,n,r,i=null){let a=t.targetStart=n(``),o=t.targetAnchor=n(``);return a[Yr]=o,e&&(r(a,e,i),r(o,e,i)),o}var ci=Symbol(`_leaveCb`),li=Symbol(`_enterCb`);function ui(){let e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ri(()=>{e.isMounted=!0}),Vi(()=>{e.isUnmounting=!0}),e}var di=[Function,Array],fi={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:di,onEnter:di,onAfterEnter:di,onEnterCancelled:di,onBeforeLeave:di,onLeave:di,onAfterLeave:di,onLeaveCancelled:di,onBeforeAppear:di,onAppear:di,onAfterAppear:di,onAppearCancelled:di},pi=e=>{let t=e.subTree;return t.component?pi(t.component):t},mi={name:`BaseTransition`,props:fi,setup(e,{slots:t}){let n=hs(),r=ui();return()=>{let i=t.default&&Si(t.default(),!0),a=i&&i.length?hi(i):n.subTree?K():void 0;if(!a)return;let o=P(e),{mode:s}=o;if(s&&s!==`in-out`&&s!==`out-in`&&s!=="default"&&F(`invalid <transition> mode: ${s}`),r.isLeaving)return yi(a);let c=bi(a);if(!c)return yi(a);let l=vi(c,o,r,n,e=>l=e);c.type!==Vo&&xi(c,l);let u=n.subTree&&bi(n.subTree);if(u&&u.type!==Vo&&!Xo(u,c)&&pi(n).type!==Vo){let e=vi(u,o,r,n);if(xi(u,e),s===`out-in`&&c.type!==Vo)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},yi(a);s===`in-out`&&c.type!==Vo?e.delayLeave=(e,t,n)=>{let i=_i(r,u);i[String(u.key)]=u,e[ci]=()=>{t(),e[ci]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{n(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}};function hi(e){let t=e[0];if(e.length>1){let n=!1;for(let r of e)if(r.type!==Vo){if(n){F(`<transition> can only be used on a single element or component. Use <transition-group> for lists.`);break}t=r,n=!0}}return t}var gi=mi;function _i(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function vi(e,t,n,r,i){let{appear:a,mode:o,persisted:s=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:m,onLeaveCancelled:h,onBeforeAppear:g,onAppear:_,onAfterAppear:v,onAppearCancelled:y}=t,b=String(e.key),x=_i(n,e),C=(e,t)=>{e&&zn(e,r,9,t)},w=(e,t)=>{let n=t[1];C(e,t),S(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},ee={mode:o,persisted:s,beforeEnter(t){let r=c;if(!n.isMounted)if(a)r=g||c;else return;t[ci]&&t[ci](!0);let i=x[b];i&&Xo(e,i)&&i.el[ci]&&i.el[ci](),C(r,[t])},enter(t){if(!or&&x[b]===e)return;let r=l,i=u,o=d;if(!n.isMounted)if(a)r=_||l,i=v||u,o=y||d;else return;let s=!1;t[li]=e=>{s||(s=!0,C(e?o:i,[t]),ee.delayedLeave&&ee.delayedLeave(),t[li]=void 0)};let c=t[li].bind(null,!1);r?w(r,[t,c]):c()},leave(t,r){let i=String(e.key);if(t[li]&&t[li](!0),n.isUnmounting)return r();C(f,[t]);let a=!1;t[ci]=n=>{a||(a=!0,r(),C(n?h:m,[t]),t[ci]=void 0,x[i]===e&&delete x[i])};let o=t[ci].bind(null,!1);x[i]=e,p?w(p,[t,o]):o()},clone(e){let a=vi(e,t,n,r,i);return i&&i(a),a}};return ee}function yi(e){if(Ai(e))return e=rs(e),e.children=null,e}function bi(e){if(!Ai(e))return Xr(e.type)&&e.children?hi(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&T(n.default))return n.default()}}function xi(e,t){e.shapeFlag&6&&e.component?(e.transition=t,xi(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Si(e,t=!1,n){let r=[],i=0;for(let a=0;a<e.length;a++){let o=e[a],s=n==null?o.key:String(n)+String(o.key==null?a:o.key);o.type===z?(o.patchFlag&128&&i++,r=r.concat(Si(o.children,t,s))):(t||o.type!==Vo)&&r.push(s==null?o:rs(o,{key:s}))}if(i>1)for(let e=0;e<r.length;e++)r[e].patchFlag=-2;return r}function Ci(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}var wi=new WeakSet;function Ti(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var Ei=new WeakMap;function Di(e,t,n,r,i=!1){if(S(e)){e.forEach((e,a)=>Di(e,t&&(S(t)?t[a]:t),n,r,i));return}if(ki(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Di(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?Ps(r.component):r.el,o=i?null:a,{i:s,r:c}=e;if(!s){F(`Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`);return}let l=t&&t.r,u=s.refs===f?s.refs={}:s.refs,d=s.setupState,p=P(d),m=d===f?h:e=>(x(p,e)&&!hn(p[e])&&F(`Template ref "${e}" used on a non-ref value. It will not work in the production build.`),wi.has(p[e])||Ti(u,e)?!1:x(p,e)),g=(e,t)=>!(wi.has(e)||t&&Ti(u,t));if(l!=null&&l!==c){if(Oi(t),E(l))u[l]=null,m(l)&&(d[l]=null);else if(hn(l)){let e=t;g(l,e.k)&&(l.value=null),e.k&&(u[e.k]=null)}}if(T(c))Rn(c,s,12,[o,u]);else{let t=E(c),r=hn(c);if(t||r){let s=()=>{if(e.f){let n=t?m(c)?d[c]:u[c]:g(c)||!e.k?c.value:u[e.k];if(i)S(n)&&y(n,a);else if(S(n))n.includes(a)||n.push(a);else if(t)u[c]=[a],m(c)&&(d[c]=u[c]);else{let t=[a];g(c,e.k)&&(c.value=t),e.k&&(u[e.k]=t)}}else t?(u[c]=o,m(c)&&(d[c]=o)):r?(g(c,e.k)&&(c.value=o),e.k&&(u[e.k]=o)):F(`Invalid template ref type:`,c,`(${typeof c})`)};if(o){let t=()=>{s(),Ei.delete(e)};t.id=-1,Ei.set(e,t),Do(t,n)}else Oi(e),s()}else F(`Invalid template ref type:`,c,`(${typeof c})`)}}function Oi(e){let t=Ei.get(e);t&&(t.flags|=8,Ei.delete(e))}xe().requestIdleCallback,xe().cancelIdleCallback;var ki=e=>!!e.type.__asyncLoader,Ai=e=>e.type.__isKeepAlive;function ji(e,t){Ni(e,`a`,t)}function Mi(e,t){Ni(e,`da`,t)}function Ni(e,t,n=ms){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Fi(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Ai(e.parent.vnode)&&Pi(r,t,n,e),e=e.parent}}function Pi(e,t,n,r){let i=Fi(t,e,r,!0);Hi(()=>{y(r[t],i)},n)}function Fi(e,t,n=ms,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{st();let i=vs(n),a=zn(t,n,e,r);return i(),ct(),a};return r?i.unshift(a):i.push(a),a}F(`${he(Ln[e].replace(/ hook$/,``))} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}var Ii=e=>(t,n=ms)=>{(!Cs||e===`sp`)&&Fi(e,(...e)=>t(...e),n)},Li=Ii(`bm`),Ri=Ii(`m`),zi=Ii(`bu`),Bi=Ii(`u`),Vi=Ii(`bum`),Hi=Ii(`um`),Ui=Ii(`sp`),Wi=Ii(`rtg`),Gi=Ii(`rtc`);function Ki(e,t=ms){Fi(`ec`,e,t)}var qi=`components`;function L(e,t){return Xi(qi,e,!0,t)||e}var Ji=Symbol.for(`v-ndc`);function Yi(e){return E(e)?Xi(qi,e,!1)||e:e||Ji}function Xi(e,t,n=!0,r=!1){let i=Pr||ms;if(i){let a=i.type;if(e===qi){let e=Ls(a,!1);if(e&&(e===t||e===O(t)||e===me(O(t))))return a}let o=Zi(i[e]||a[e],t)||Zi(i.appContext[e],t);if(!o&&r)return a;if(n&&!o){let n=e===qi?`
|
|
111
|
-
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`:``;F(`Failed to resolve ${e.slice(0,-1)}: ${t}${n}`)}return o}F(`resolve${me(e.slice(0,-1))} can only be used in render() or setup().`)}function Zi(e,t){return e&&(e[t]||e[O(t)]||e[me(O(t))])}function R(e,t,n,r){let i,a=n&&n[r],o=S(e);if(o||E(e)){let n=o&&cn(e),r=!1,s=!1;n&&(r=!un(e),s=ln(e),e=xt(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?mn(pn(e[n])):pn(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`)if(!Number.isInteger(e)||e<0)F(`The v-for range expects a positive integer value but got ${e}.`),i=[];else{i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}else if(D(e))if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}else i=[];return n&&(n[r]=i),i}function Qi(e,t,n={},r,i,a){if(Pr.ce||Pr.parent&&ki(Pr.parent)&&Pr.parent.ce){let e=a!=null&&n.key==null?v({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),B(),H(z,null,[W(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o.length>1&&(F(`SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`),o=()=>[]),o&&o._c&&(o._d=!1);let s=Uo.length;B();let c;try{let i=o&&$i(o(n)),s=n.key||a||i&&i.key;c=H(z,{key:(s&&!te(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=Uo.length;e>s;e--)Go();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function $i(e){return e.some(e=>!Yo(e)||!(e.type===Vo||e.type===z&&!$i(e.children)))?e:null}var ea=e=>e?Ss(e)?Ps(e):ea(e.parent):null,ta=v(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>on(e.props),$attrs:e=>on(e.attrs),$slots:e=>on(e.slots),$refs:e=>on(e.refs),$parent:e=>ea(e.parent),$root:e=>ea(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ha(e),$forceUpdate:e=>e.f||=()=>{Qn(e.update)},$nextTick:e=>e.n||=Xn.bind(e.proxy),$watch:e=>Kr.bind(e)}),na=e=>e===`_`||e===`$`,ra=(e,t)=>e!==f&&!e.__isScriptSetup&&x(e,t),ia={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:c}=e;if(t===`__isVue`)return!0;if(t[0]!==`$`){let e=o[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(ra(r,t))return o[t]=1,r[t];else if(i!==f&&x(i,t))return o[t]=2,i[t];else if(x(a,t))return o[t]=3,a[t];else if(n!==f&&x(n,t))return o[t]=4,n[t];else ua&&(o[t]=0)}let l=ta[t],u,d;if(l)return t===`$attrs`?(vt(e.attrs,`get`,``),Fa()):t===`$slots`&&vt(e,`get`,t),l(e);if((u=s.__cssModules)&&(u=u[t]))return u;if(n!==f&&x(n,t))return o[t]=4,n[t];if(d=c.config.globalProperties,x(d,t))return d[t];Pr&&(!E(t)||t.indexOf(`__v`)!==0)&&(i!==f&&na(t[0])&&x(i,t)?F(`Property ${JSON.stringify(t)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):e===Pr&&F(`Property ${JSON.stringify(t)} was accessed during render but is not defined on instance.`))},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return ra(i,t)?(i[t]=n,!0):i.__isScriptSetup&&x(i,t)?(F(`Cannot mutate <script setup> binding "${t}" from Options API.`),!1):r!==f&&x(r,t)?(r[t]=n,!0):x(e.props,t)?(F(`Attempting to mutate prop "${t}". Props are readonly.`),!1):t[0]===`$`&&t.slice(1)in e?(F(`Attempting to mutate public property "${t}". Properties starting with $ are reserved and readonly.`),!1):(t in e.appContext.config.globalProperties?Object.defineProperty(a,t,{enumerable:!0,configurable:!0,value:n}):a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:o}},s){let c;return!!(n[s]||e!==f&&s[0]!==`$`&&x(e,s)||ra(t,s)||x(a,s)||x(r,s)||x(ta,s)||x(i.config.globalProperties,s)||(c=o.__cssModules)&&c[s])},defineProperty(e,t,n){return n.get==null?x(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};ia.ownKeys=e=>(F(`Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`),Reflect.ownKeys(e));function aa(e){let t={};return Object.defineProperty(t,"_",{configurable:!0,enumerable:!1,get:()=>e}),Object.keys(ta).forEach(n=>{Object.defineProperty(t,n,{configurable:!0,enumerable:!1,get:()=>ta[n](e),set:m})}),t}function oa(e){let{ctx:t,propsOptions:[n]}=e;n&&Object.keys(n).forEach(n=>{Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>e.props[n],set:m})})}function sa(e){let{ctx:t,setupState:n}=e;Object.keys(P(n)).forEach(e=>{if(!n.__isScriptSetup){if(na(e[0])){F(`setup() return property ${JSON.stringify(e)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);return}Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:()=>n[e],set:m})}})}function ca(e){return S(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function la(){let e=Object.create(null);return(t,n)=>{e[n]?F(`${t} property "${n}" is already defined in ${e[n]}.`):e[n]=t}}var ua=!0;function da(e){let t=ha(e),n=e.proxy,r=e.ctx;ua=!1,t.beforeCreate&&pa(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:o,watch:s,provide:c,inject:l,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:h,activated:g,deactivated:_,beforeDestroy:v,beforeUnmount:y,destroyed:b,unmounted:x,render:C,renderTracked:w,renderTriggered:ee,errorCaptured:E,serverPrefetch:te,expose:re,inheritAttrs:ie,components:ae,directives:oe,filters:se}=t,ce=la();{let[t]=e.propsOptions;if(t)for(let e in t)ce(`Props`,e)}if(l&&fa(l,r,ce),o)for(let e in o){let t=o[e];T(t)?(Object.defineProperty(r,e,{value:t.bind(n),configurable:!0,enumerable:!0,writable:!0}),ce(`Methods`,e)):F(`Method "${e}" has type "${typeof t}" in the component definition. Did you reference the function correctly?`)}if(i){T(i)||F(`The data option must be a function. Plain object usage is no longer supported.`);let t=i.call(n,n);if(ne(t)&&F(`data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`),!D(t))F(`data() should return an object.`);else{e.data=nn(t);for(let e in t)ce(`Data`,e),na(e[0])||Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:()=>t[e],set:m})}}if(ua=!0,a)for(let e in a){let t=a[e],i=T(t)?t.bind(n,n):T(t.get)?t.get.bind(n,n):m;i===m&&F(`Computed property "${e}" has no getter.`);let o=Bs({get:i,set:!T(t)&&T(t.set)?t.set.bind(n):()=>{F(`Write operation failed: computed property "${e}" is readonly.`)}});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>o.value,set:e=>o.value=e}),ce(`Computed`,e)}if(s)for(let e in s)ma(s[e],r,n,e);if(c){let e=T(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{Br(t,e[t])})}u&&pa(u,e,`c`);function le(e,t){S(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(le(Li,d),le(Ri,f),le(zi,p),le(Bi,h),le(ji,g),le(Mi,_),le(Ki,E),le(Gi,w),le(Wi,ee),le(Vi,y),le(Hi,x),le(Ui,te),S(re))if(re.length){let t=e.exposed||={};re.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={};C&&e.render===m&&(e.render=C),ie!=null&&(e.inheritAttrs=ie),ae&&(e.components=ae),oe&&(e.directives=oe),te&&Ci(e)}function fa(e,t,n=m){S(e)&&(e=ba(e));for(let r in e){let i=e[r],a;a=D(i)?`default`in i?Vr(i.from||r,i.default,!0):Vr(i.from||r):Vr(i),hn(a)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e}):t[r]=a,n(`Inject`,r)}}function pa(e,t,n){zn(S(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function ma(e,t,n,r){let i=r.includes(`.`)?qr(n,r):()=>n[r];if(E(e)){let n=t[e];T(n)?Wr(i,n):F(`Invalid watch handler specified by key "${e}"`,n)}else if(T(e))Wr(i,e.bind(n));else if(D(e))if(S(e))e.forEach(e=>ma(e,t,n,r));else{let r=T(e.handler)?e.handler.bind(n):t[e.handler];T(r)?Wr(i,r,e):F(`Invalid watch handler specified by key "${e.handler}"`,r)}else F(`Invalid watch option: "${r}"`,e)}function ha(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>ga(c,e,o,!0)),ga(c,t,o)),D(t)&&a.set(t,c),c}function ga(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&ga(e,a,n,!0),i&&i.forEach(t=>ga(e,t,n,!0));for(let i in t)if(r&&i===`expose`)F(`"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`);else{let r=_a[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var _a={data:va,props:Ca,emits:Ca,methods:Sa,computed:Sa,beforeCreate:xa,created:xa,beforeMount:xa,mounted:xa,beforeUpdate:xa,updated:xa,beforeDestroy:xa,beforeUnmount:xa,destroyed:xa,unmounted:xa,activated:xa,deactivated:xa,errorCaptured:xa,serverPrefetch:xa,components:Sa,directives:Sa,watch:wa,provide:va,inject:ya};function va(e,t){return t?e?function(){return v(T(e)?e.call(this,this):e,T(t)?t.call(this,this):t)}:t:e}function ya(e,t){return Sa(ba(e),ba(t))}function ba(e){if(S(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function xa(e,t){return e?[...new Set([].concat(e,t))]:t}function Sa(e,t){return e?v(Object.create(null),e,t):t}function Ca(e,t){return e?S(e)&&S(t)?[...new Set([...e,...t])]:v(Object.create(null),ca(e),ca(t??{})):t}function wa(e,t){if(!e)return t;if(!t)return e;let n=v(Object.create(null),e);for(let r in t)n[r]=xa(e[r],t[r]);return n}function Ta(){return{app:null,config:{isNativeTag:h,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var Ea=0;function Da(e,t){return function(n,r=null){T(n)||(n=v({},n)),r!=null&&!D(r)&&(F(`root props passed to app.mount() must be an object.`),r=null);let i=Ta(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:Ea++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:Us,get config(){return i.config},set config(e){F(`app.config cannot be replaced. Modify individual options instead.`)},use(e,...t){return a.has(e)?F(`Plugin has already been applied to target app.`):e&&T(e.install)?(a.add(e),e.install(c,...t)):T(e)?(a.add(e),e(c,...t)):F(`A plugin must either be a function or an object with an "install" function.`),c},mixin(e){return i.mixins.includes(e)?F(`Mixin has already been applied to target app`+(e.name?`: ${e.name}`:``)):i.mixins.push(e),c},component(e,t){return xs(e,i.config),t?(i.components[e]&&F(`Component "${e}" has already been registered in target app.`),i.components[e]=t,c):i.components[e]},directive(e,t){return Rr(e),t?(i.directives[e]&&F(`Directive "${e}" has already been registered in target app.`),i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(s)F("App has already been mounted.\nIf you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. `const createMyApp = () => createApp(App)`");else{a.__vue_app__&&F("There is already an app instance mounted on the host container.\n If you want to mount another app on the same host container, you need to unmount the previous app by calling `app.unmount()` first.");let u=c._ceVNode||W(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),i.reload=()=>{let t=rs(u);t.el=null,e(t,a,l)},o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,c._instance=u.component,Cr(c,Us),Ps(u.component)}},onUnmount(e){typeof e!=`function`&&F(`Expected function as first argument to app.onUnmount(), but got ${typeof e}`),o.push(e)},unmount(){s?(zn(o,c._instance,16),e(null,c._container),c._instance=null,wr(c),delete c._container.__vue_app__):F(`Cannot unmount an app that is not mounted.`)},provide(e,t){return e in i.provides&&(x(i.provides,e)?F(`App already provides property with key "${String(e)}". It will be overwritten with the new value.`):F(`App already provides property with key "${String(e)}" inherited from its parent element. It will be overwritten with the new value.`)),i.provides[e]=t,c},runWithContext(e){let t=Oa;Oa=c;try{return e()}finally{Oa=t}}};return c}}var Oa=null,ka=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${O(t)}Modifiers`]||e[`${pe(t)}Modifiers`];function Aa(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||f;{let{emitsOptions:r,propsOptions:[i]}=e;if(r)if(!(t in r))(!i||!(he(O(t))in i))&&F(`Component emitted event "${t}" but it is neither declared in the emits option nor as an "${he(O(t))}" prop.`);else{let e=r[t];T(e)&&(e(...n)||F(`Invalid event arguments: event validation failed for event "${t}".`))}}let i=n,a=t.startsWith(`update:`),o=a&&ka(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>E(e)?e.trim():e)),o.number&&(i=n.map(ye))),Nr(e,t,i);{let n=t.toLowerCase();n!==t&&r[he(n)]&&F(`Event "${n}" is emitted in component ${Rs(e,e.type)} but the handler is registered for "${t}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${pe(t)}" instead of "${t}".`)}let s,c=r[s=he(t)]||r[s=he(O(t))];!c&&a&&(c=r[s=he(pe(t))]),c&&zn(c,e,6,i);let l=r[s+`Once`];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,zn(l,e,6,i)}}var ja=new WeakMap;function Ma(e,t,n=!1){let r=n?ja:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!T(e)){let r=e=>{let n=Ma(e,t,!0);n&&(s=!0,v(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(D(e)&&r.set(e,null),null):(S(a)?a.forEach(e=>o[e]=null):v(o,a),D(e)&&r.set(e,o),o)}function Na(e,t){return!e||!g(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),x(e,t[0].toLowerCase()+t.slice(1))||x(e,pe(t))||x(e,t))}var Pa=!1;function Fa(){Pa=!0}function Ia(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:p,ctx:m,inheritAttrs:h}=e,v=Ir(e),y,b;Pa=!1;try{if(n.shapeFlag&4){let e=i||r,t=p.__isScriptSetup?new Proxy(e,{get(e,t,n){return F(`Property '${String(t)}' was accessed via 'this'. Avoid using 'this' in templates.`),Reflect.get(e,t,n)}}):e;y=os(l.call(t,e,u,on(d),p,f,m)),b=s}else{let e=t;s===d&&Fa(),y=os(e.length>1?e(on(d),{get attrs(){return Fa(),on(s)},slots:o,emit:c}):e(on(d),null)),b=t.props?s:za(s)}}catch(t){Uo.length=0,Bn(t,e,1),y=W(Vo)}let x=y,S;if(y.patchFlag>0&&y.patchFlag&2048&&([x,S]=La(y)),b&&h!==!1){let e=Object.keys(b),{shapeFlag:t}=x;if(e.length){if(t&7)a&&e.some(_)&&(b=Ba(b,a)),x=rs(x,b,!1,!0);else if(!Pa&&x.type!==Vo){let e=Object.keys(s),t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=e[r];g(i)?_(i)||t.push(i[2].toLowerCase()+i.slice(3)):n.push(i)}n.length&&F(`Extraneous non-props attributes (${n.join(`, `)}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`),t.length&&F(`Extraneous non-emits event listeners (${t.join(`, `)}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)}}}return n.dirs&&(Va(x)||F(`Runtime directive used on component with non-element root node. The directives will not function as intended.`),x=rs(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(n.dirs):n.dirs),n.transition&&(Va(x)||F(`Component inside <Transition> renders non-element root node that cannot be animated.`),xi(x,n.transition)),S?S(x):y=x,Ir(v),y}var La=e=>{let t=e.children,n=e.dynamicChildren,r=Ra(t,!1);if(!r)return[e,void 0];if(r.patchFlag>0&&r.patchFlag&2048)return La(r);let i=t.indexOf(r),a=n?n.indexOf(r):-1;return[os(r),r=>{t[i]=r,n&&(a>-1?n[a]=r:r.patchFlag>0&&(e.dynamicChildren=[...n,r]))}]};function Ra(e,t=!0){let n;for(let r=0;r<e.length;r++){let i=e[r];if(Yo(i)){if(i.type!==Vo||i.children===`v-if`){if(n)return;if(n=i,t&&n.patchFlag>0&&n.patchFlag&2048)return Ra(n.children)}}else return}return n}var za=e=>{let t;for(let n in e)(n===`class`||n===`style`||g(n))&&((t||={})[n]=e[n]);return t},Ba=(e,t)=>{let n={};for(let r in e)(!_(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n},Va=e=>e.shapeFlag&7||e.type===Vo;function Ha(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if((i||s)&&or||t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Ua(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(Wa(o,r,n)&&!Na(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||Ua(r,o,l):!!o;return!1}function Ua(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(Wa(t,e,a)&&!Na(n,a))return!0}return!1}function Wa(e,t,n){let r=e[n],i=t[n];return n===`style`&&D(r)&&D(i)?!Ie(r,i):r!==i}function Ga({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var Ka={},qa=()=>Object.create(Ka),Ja=e=>Object.getPrototypeOf(e)===Ka;function Ya(e,t,n,r=!1){let i={},a=qa();e.propsDefaults=Object.create(null),Qa(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);io(t||{},i,e),e.props=n?r?i:rn(i):e.type.props?i:a,e.attrs=a}function Xa(e){for(;e;){if(e.type.__hmrId)return!0;e=e.parent}}function Za(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=P(i),[c]=e.propsOptions,l=!1;if(!Xa(e)&&(r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(Na(e.emitsOptions,o))continue;let u=t[o];if(c)if(x(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=O(o);i[t]=$a(c,s,t,u,e,!1)}else u!==a[o]&&(a[o]=u,l=!0)}}}else{Qa(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!x(t,a)&&((r=pe(a))===a||!x(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=$a(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!x(t,e))&&(delete a[e],l=!0)}l&&yt(e.attrs,`set`,``),io(t||{},i,e)}function Qa(e,t,n,r){let[i,a]=e.propsOptions,o=!1,s;if(t)for(let c in t){if(ce(c))continue;let l=t[c],u;i&&x(i,u=O(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:Na(e.emitsOptions,c)||(!(c in r)||l!==r[c])&&(r[c]=l,o=!0)}if(a){let t=P(n),r=s||f;for(let o=0;o<a.length;o++){let s=a[o];n[s]=$a(i,t,s,r[s],e,!x(r,s))}}return o}function $a(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=x(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&T(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=vs(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===pe(n))&&(r=!0))}return r}var eo=new WeakMap;function to(e,t,n=!1){let r=n?eo:t.propsCache,i=r.get(e);if(i)return i;let a=e.props,o={},s=[],c=!1;if(!T(e)){let r=e=>{c=!0;let[n,r]=to(e,t,!0);v(o,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!a&&!c)return D(e)&&r.set(e,p),p;if(S(a))for(let e=0;e<a.length;e++){E(a[e])||F(`props must be strings when using array syntax.`,a[e]);let t=O(a[e]);no(t)&&(o[t]=f)}else if(a){D(a)||F(`invalid props options`,a);for(let e in a){let t=O(e);if(no(t)){let n=a[e],r=o[t]=S(n)||T(n)?{type:n}:v({},n),i=r.type,c=!1,l=!0;if(S(i))for(let e=0;e<i.length;++e){let t=i[e],n=T(t)&&t.name;if(n===`Boolean`){c=!0;break}n===`String`&&(l=!1)}else c=T(i)&&i.name===`Boolean`;r[0]=c,r[1]=l,(c||x(r,`default`))&&s.push(t)}}}let l=[o,s];return D(e)&&r.set(e,l),l}function no(e){return e[0]!==`$`&&!ce(e)||(F(`Invalid prop name: "${e}" is a reserved property.`),!1)}function ro(e){return e===null?`null`:typeof e==`function`?e.name||``:typeof e==`object`&&e.constructor&&e.constructor.name||``}function io(e,t,n){let r=P(t),i=n.propsOptions[0],a=Object.keys(e).map(e=>O(e));for(let e in i){let t=i[e];t!=null&&ao(e,r[e],t,on(r),!a.includes(e))}}function ao(e,t,n,r,i){let{type:a,required:o,validator:s,skipCheck:c}=n;if(o&&i){F(`Missing required prop: "`+e+`"`);return}if(!(t==null&&!o)){if(a!=null&&a!==!0&&!c){let n=!1,r=S(a)?a:[a],i=[];for(let e=0;e<r.length&&!n;e++){let{valid:a,expectedType:o}=so(t,r[e]);i.push(o||``),n=a}if(!n){F(co(e,t,i));return}}s&&!s(t,r)&&F(`Invalid prop: custom validator check failed for prop "`+e+`".`)}}var oo=d(`String,Number,Boolean,Function,Symbol,BigInt`);function so(e,t){let n,r=ro(t);if(r===`null`)n=e===null;else if(oo(r)){let i=typeof e;n=i===r.toLowerCase(),!n&&i===`object`&&(n=e instanceof t)}else n=r===`Object`?D(e):r===`Array`?S(e):e instanceof t;return{valid:n,expectedType:r}}function co(e,t,n){if(n.length===0)return`Prop type [] for prop "${e}" won't match anything. Did you mean to use type Array instead?`;let r=`Invalid prop: type check failed for prop "${e}". Expected ${n.map(me).join(` | `)}`,i=n[0],a=ae(t),o=lo(t,i),s=lo(t,a);return n.length===1&&uo(i)&&fo(i,a)&&(r+=` with value ${o}`),r+=`, got ${a} `,uo(a)&&(r+=`with value ${s}.`),r}function lo(e,t){return te(e)?e.toString():t===`String`?`"${e}"`:t===`Number`?`${Number(e)}`:`${e}`}function uo(e){return[`string`,`number`,`boolean`].some(t=>e.toLowerCase()===t)}function fo(...e){return e.every(e=>{let t=e.toLowerCase();return t!==`boolean`&&t!==`symbol`})}var po=e=>e===`_`||e===`_ctx`||e===`$stable`,mo=e=>S(e)?e.map(os):[os(e)],ho=(e,t,n)=>{if(t._n)return t;let r=Lr((...r)=>(ms&&!(n===null&&Pr)&&!(n&&n.root!==ms.root)&&F(`Slot "${e}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`),mo(t(...r))),n);return r._c=!1,r},go=(e,t,n)=>{let r=e._ctx;for(let n in e){if(po(n))continue;let i=e[n];if(T(i))t[n]=ho(n,i,r);else if(i!=null){F(`Non-function value encountered for slot "${n}". Prefer function slots for better performance.`);let e=mo(i);t[n]=()=>e}}},_o=(e,t)=>{Ai(e.vnode)||F(`Non-function value encountered for default slot. Prefer function slots for better performance.`);let n=mo(t);e.slots.default=()=>n},vo=(e,t,n)=>{for(let r in t)(n||!po(r))&&(e[r]=t[r])},yo=(e,t,n)=>{let r=e.slots=qa();if(e.vnode.shapeFlag&32){let e=t._;e?(vo(r,t,n),n&&ve(r,`_`,e,!0)):go(t,r)}else t&&_o(e,t)},bo=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=f;if(r.shapeFlag&32){let r=t._;r?or?(vo(i,t,n),yt(e,`set`,`$slots`)):n&&r===1?a=!1:vo(i,t,n):(a=!t.$stable,go(t,i)),o=t}else t&&(_o(e,t),o={default:1});if(a)for(let e in i)!po(e)&&o[e]==null&&delete i[e]},xo,So;function Co(e,t){e.appContext.config.performance&&To()&&So.mark(`vue-${t}-${e.uid}`),Ar(e,t,To()?So.now():Date.now())}function wo(e,t){if(e.appContext.config.performance&&To()){let n=`vue-${t}-${e.uid}`,r=n+`:end`,i=`<${Rs(e,e.type)}> ${t}`;So.mark(r),So.measure(i,n,r),So.clearMeasures(i),So.clearMarks(n),So.clearMarks(r)}jr(e,t,To()?So.now():Date.now())}function To(){return xo===void 0&&(typeof window<`u`&&window.performance?(xo=!0,So=window.performance):xo=!1),xo}function Eo(){let e=[];if(e.length){let t=e.length>1;console.warn(`Feature flag${t?`s`:``} ${e.join(`, `)} ${t?`are`:`is`} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.
|
|
109
|
+
`,...Nn(i)),console.warn(...n)}lt(),jn=!1}function Mn(){let e=On[On.length-1];if(!e)return[];let t=[];for(;e;){let n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});let r=e.component&&e.component.parent;e=r&&r.vnode}return t}function Nn(e){let t=[];return e.forEach((e,n)=>{t.push(...n===0?[]:[`
|
|
110
|
+
`],...Pn(e))}),t}function Pn({vnode:e,recurseCount:t}){let n=t>0?`... (${t} recursive calls)`:``,r=e.component?e.component.parent==null:!1,i=` at <${zs(e.component,e.type,r)}`,a=`>`+n;return e.props?[i,...Fn(e.props),a]:[i+a]}function Fn(e){let t=[],n=Object.keys(e);return n.slice(0,3).forEach(n=>{t.push(...In(n,e[n]))}),n.length>3&&t.push(` ...`),t}function In(e,t,n){return E(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t==`number`||typeof t==`boolean`||t==null?n?t:[`${e}=${t}`]:gn(t)?(t=In(e,N(t.value),!0),n?t:[`${e}=Ref<`,t,`>`]):T(t)?[`${e}=fn${t.name?`<${t.name}>`:``}`]:(t=N(t),n?t:[`${e}=`,t])}function Ln(e,t){e!==void 0&&(typeof e==`number`?isNaN(e)&&P(`${t} is NaN - the duration expression might be incorrect.`):P(`${t} is not a valid number - got ${JSON.stringify(e)}.`))}var Rn={sp:`serverPrefetch hook`,bc:`beforeCreate hook`,c:`created hook`,bm:`beforeMount hook`,m:`mounted hook`,bu:`beforeUpdate hook`,u:`updated`,bum:`beforeUnmount hook`,um:`unmounted hook`,a:`activated hook`,da:`deactivated hook`,ec:`errorCaptured hook`,rtc:`renderTracked hook`,rtg:`renderTriggered hook`,0:`setup function`,1:`render function`,2:`watcher getter`,3:`watcher callback`,4:`watcher cleanup function`,5:`native event handler`,6:`component event handler`,7:`vnode hook`,8:`directive hook`,9:`transition hook`,10:`app errorHandler`,11:`app warnHandler`,12:`ref function`,13:`async component loader`,14:`scheduler flush`,15:`component update`,16:`app unmount cleanup function`};function zn(e,t,n,r){try{return r?e(...r):e()}catch(e){Vn(e,t,n)}}function Bn(e,t,n,r){if(T(e)){let i=zn(e,t,n,r);return i&&ne(i)&&i.catch(e=>{Vn(e,t,n)}),i}if(S(e)){let i=[];for(let a=0;a<e.length;a++)i.push(Bn(e[a],t,n,r));return i}P(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function Vn(e,t,n,r=!0){let i=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||f;if(t){let r=t.parent,i=t.proxy,o=Rn[n];for(;r;){let t=r.ec;if(t){for(let n=0;n<t.length;n++)if(t[n](e,i,o)===!1)return}r=r.parent}if(a){ct(),zn(a,null,10,[e,i,o]),lt();return}}Hn(e,n,i,r,o)}function Hn(e,t,n,r=!0,i=!1){{let i=Rn[t];if(n&&kn(n),P(`Unhandled error${i?` during execution of ${i}`:``}`),n&&An(),r)throw e;console.error(e)}}var Un=[],Wn=-1,Gn=[],Kn=null,qn=0,Jn=Promise.resolve(),Yn=null,Xn=100;function Zn(e){let t=Yn||Jn;return e?t.then(this?e.bind(this):e):t}function Qn(e){let t=Wn+1,n=Un.length;for(;t<n;){let r=t+n>>>1,i=Un[r],a=ir(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function $n(e){if(!(e.flags&1)){let t=ir(e),n=Un[Un.length-1];!n||!(e.flags&2)&&t>=ir(n)?Un.push(e):Un.splice(Qn(t),0,e),e.flags|=1,er()}}function er(){Yn||=Jn.then(ar)}function tr(e){S(e)?Gn.push(...e):Kn&&e.id===-1?Kn.splice(qn+1,0,e):e.flags&1||(Gn.push(e),e.flags|=1),er()}function nr(e,t,n=Wn+1){for(t||=new Map;n<Un.length;n++){let r=Un[n];if(r&&r.flags&2){if(e&&r.id!==e.uid||or(t,r))continue;Un.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function rr(e){if(Gn.length){let t=[...new Set(Gn)].sort((e,t)=>ir(e)-ir(t));if(Gn.length=0,Kn){Kn.push(...t);return}for(Kn=t,e||=new Map,qn=0;qn<Kn.length;qn++){let t=Kn[qn];or(e,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}Kn=null,qn=0}}var ir=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ar(e){e||=new Map;let t=t=>or(e,t);try{for(Wn=0;Wn<Un.length;Wn++){let e=Un[Wn];if(e&&!(e.flags&8)){if(t(e))continue;e.flags&4&&(e.flags&=-2),zn(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2)}}}finally{for(;Wn<Un.length;Wn++){let e=Un[Wn];e&&(e.flags&=-2)}Wn=-1,Un.length=0,rr(e),Yn=null,(Un.length||Gn.length)&&ar(e)}}function or(e,t){let n=e.get(t)||0;if(n>Xn){let e=t.i,n=e&&Rs(e.type);return Vn(`Maximum recursive updates exceeded${n?` in component <${n}>`:``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}var sr=!1,cr=e=>{try{return sr}finally{sr=e}},lr=new Map;Se().__VUE_HMR_RUNTIME__={createRecord:vr(pr),rerender:vr(hr),reload:vr(gr)};var ur=new Map;function dr(e){let t=e.type.__hmrId,n=ur.get(t);n||=(pr(t,e.type),ur.get(t)),n.instances.add(e)}function fr(e){ur.get(e.type.__hmrId).instances.delete(e)}function pr(e,t){return!ur.has(e)&&(ur.set(e,{initialDef:mr(t),instances:new Set}),!0)}function mr(e){return Bs(e)?e.__vccOpts:e}function hr(e,t){let n=ur.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(e=>{t&&(e.render=t,mr(e.type).render=t),e.renderCache=[],sr=!0,e.job.flags&8||e.update(),sr=!1}))}function gr(e,t){let n=ur.get(e);if(!n)return;t=mr(t),_r(n.initialDef,t);let r=[...n.instances];for(let e=0;e<r.length;e++){let i=r[e],a=mr(i.type),o=lr.get(a);o||(a!==n.initialDef&&_r(a,t),lr.set(a,o=new Set)),o.add(i),i.appContext.propsCache.delete(i.type),i.appContext.emitsCache.delete(i.type),i.appContext.optionsCache.delete(i.type),i.ceReload?(o.add(i),i.ceReload(t.styles),o.delete(i)):i.parent?$n(()=>{i.job.flags&8||(sr=!0,i.parent.update(),sr=!1,o.delete(i))}):i.appContext.reload?i.appContext.reload():typeof window<`u`?window.location.reload():console.warn(`[HMR] Root or manually mounted instance modified. Full reload required.`),i.root.ce&&i!==i.root&&i.root.ce._removeChildStyle(a)}tr(()=>{lr.clear()})}function _r(e,t){v(e,t);for(let n in e)n!==`__file`&&!(n in t)&&delete e[n]}function vr(e){return(t,n)=>{try{return e(t,n)}catch(e){console.error(e),console.warn(`[HMR] Something went wrong during Vue component hot-reload. Full reload required.`)}}}var yr,br=[],xr=!1;function Sr(e,...t){yr?yr.emit(e,...t):xr||br.push({event:e,args:t})}function Cr(e,t){yr=e,yr?(yr.enabled=!0,br.forEach(({event:e,args:t})=>yr.emit(e,...t)),br=[]):typeof window<`u`&&window.HTMLElement&&!(window.navigator?.userAgent)?.includes(`jsdom`)?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(e=>{Cr(e,t)}),setTimeout(()=>{yr||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,xr=!0,br=[])},3e3)):(xr=!0,br=[])}function wr(e,t){Sr(`app:init`,e,t,{Fragment:R,Text:Vo,Comment:Ho,Static:Uo})}function Tr(e){Sr(`app:unmount`,e)}var Er=Ar(`component:added`),Dr=Ar(`component:updated`),Or=Ar(`component:removed`),kr=e=>{yr&&typeof yr.cleanupBuffer==`function`&&!yr.cleanupBuffer(e)&&Or(e)};function Ar(e){return t=>{Sr(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}var jr=Nr(`perf:start`),Mr=Nr(`perf:end`);function Nr(e){return(t,n,r)=>{Sr(e,t.appContext.app,t.uid,t,n,r)}}function Pr(e,t,n){Sr(`component:emit`,e.appContext.app,e,t,n)}var Fr=null,Ir=null;function Lr(e){let t=Fr;return Fr=e,Ir=e&&e.type.__scopeId||null,t}function Rr(e,t=Fr,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&Jo(-1);let i=Lr(t),a=Wo.length,o;try{o=e(...n)}finally{for(let e=Wo.length;e>a;e--)Ko();Lr(i),r._d&&Jo(1)}return Dr(t),o};return r._n=!0,r._c=!0,r._d=!0,r}function zr(e){le(e)&&P(`Do not use built-in directive ids as custom directive id: `+e)}function F(e,t){if(Fr===null)return P(`withDirectives can only be used inside render functions.`),e;let n=Fs(Fr),r=e.dirs||=[];for(let e=0;e<t.length;e++){let[i,a,o,s=f]=t[e];i&&(T(i)&&(i={mounted:i,updated:i}),i.deep&&Dn(a),r.push({dir:i,instance:n,value:a,oldValue:void 0,arg:o,modifiers:s}))}return e}function Br(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(ct(),Bn(c,n,8,[e.el,s,e,t]),lt())}}function Vr(e,t){if((!hs||hs.isMounted)&&P(`provide() can only be used inside setup().`),hs){let n=hs.provides,r=hs.parent&&hs.parent.provides;r===n&&(n=hs.provides=Object.create(r)),n[e]=t}}function Hr(e,t,n=!1){let r=gs();if(r||ka){let i=ka?ka._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&T(t)?t.call(r&&r.proxy):t;P(`injection "${String(e)}" not found.`)}else P(`inject() can only be used inside setup() or functional components.`)}var Ur=Symbol.for(`v-scx`),Wr=()=>{{let e=Hr(Ur);return e||P(`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`),e}};function Gr(e,t,n){return T(t)||P("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),Kr(e,t,n)}function Kr(e,t,n=f){let{immediate:r,deep:i,flush:a,once:o}=n;t||(r!==void 0&&P(`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`),i!==void 0&&P(`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`),o!==void 0&&P(`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`));let s=v({},n);s.onWarn=P;let c=t&&r||!t&&a!==`post`,l;if(ws){if(a===`sync`){let e=Wr();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=m,e.resume=m,e.pause=m,e}}let u=hs;s.call=(e,t,n)=>Bn(e,u,t,n);let d=!1;a===`post`?s.scheduler=e=>{Oo(e,u&&u.suspense)}:a!==`sync`&&(d=!0,s.scheduler=(e,t)=>{t?e():$n(e)}),s.augmentJob=e=>{t&&(e.flags|=4),d&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let p=En(e,t,s);return ws&&(l?l.push(p):c&&p()),p}function qr(e,t,n){let r=this.proxy,i=E(e)?e.includes(`.`)?Jr(r,e):()=>r[e]:e.bind(r,r),a;T(t)?a=t:(a=t.handler,n=t);let o=ys(this),s=Kr(i,a.bind(r),n);return o(),s}function Jr(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var Yr=new WeakMap,Xr=Symbol(`_vte`),Zr=e=>e.__isTeleport,Qr=e=>e&&(e.disabled||e.disabled===``),$r=e=>e&&(e.defer||e.defer===``),ei=e=>typeof SVGElement<`u`&&e instanceof SVGElement,ti=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,ni=(e,t)=>{let n=e&&e.to;if(E(n))if(t){let r=t(n);return!r&&!Qr(e)&&P(`Failed to locate Teleport target with selector "${n}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`),r}else return P(`Current renderer does not support string target for Teleports. (missing querySelector renderer option)`),null;return!n&&!Qr(e)&&P(`Invalid Teleport target: ${n}`),n},ri={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g,parentNode:_}}=l,v=Qr(t.props),{dynamicChildren:y}=t;sr&&(c=!1,y=null);let b=(e,t,n)=>{e.shapeFlag&16&&u(e.children,t,n,i,a,o,s,c)},x=(e=t)=>{let n=Qr(e.props),r=e.target=ni(e.props,m),a=ci(r,e,h,p);r?(o!==`svg`&&ei(r)?o=`svg`:o!==`mathml`&&ti(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),si(e,!1))):n||P(`Invalid Teleport target on mount:`,r,`(${typeof r})`)},S=e=>{let t=()=>{if(Yr.get(e)===t){if(Yr.delete(e),Qr(e.props)){let t=_(e.el)||n;b(e,t,e.anchor),si(e,!0)}x(e)}};Yr.set(e,t),Oo(t,a)};if(e==null){let e=t.el=g(`teleport start`),i=t.anchor=g(`teleport end`);if(p(e,n,r),p(i,n,r),$r(t.props)||a&&a.pendingBranch){S(t);return}v&&(b(t,n,i),si(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=Yr.get(e);if(u){u.flags|=8,Yr.delete(e),S(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=Qr(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||ei(p)?o=`svg`:(o===`mathml`||ti(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),Po(e,t,!1)):c||d(e,t,_,b,i,a,o,s,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ii(t,n,r,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=ni(t.props,m);e?(t.target=e,ii(t,e,null,l,0)):P(`Invalid Teleport target on update:`,p,`(${typeof p})`)}else g&&ii(t,p,h,l,1);si(t,v)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e,p=Qr(f),m=a||!p,h=Yr.get(e);if(h&&(h.flags|=8,Yr.delete(e)),d&&(i(l),i(u)),a&&i(c),!h&&(p||d)&&o&16)for(let e=0;e<s.length;e++){let i=s[e];r(i,t,n,m,!!i.dynamicChildren)}},move:ii,hydrate:ai};function ii(e,t,n,{o:{insert:r},m:i},a=2){a===0&&r(e.targetAnchor,t,n);let{el:o,anchor:s,shapeFlag:c,children:l,props:u}=e,d=a===2;if(d&&r(o,t,n),!Yr.has(e)&&(!d||Qr(u))&&c&16)for(let e=0;e<l.length;e++)i(l[e],t,n,2);d&&r(s,t,n)}function ai(e,t,n,r,i,a,{o:{nextSibling:o,parentNode:s,querySelector:c,insert:l,createText:u}},d){function f(e,n){let r=n;for(;r;){if(r&&r.nodeType===8){if(r.data===`teleport start anchor`)t.targetStart=r;else if(r.data===`teleport anchor`){t.targetAnchor=r,e._lpa=t.targetAnchor&&o(t.targetAnchor);break}}r=o(r)}}function p(e,t){t.anchor=d(o(e),t,s(e),n,r,i,a)}let m=t.target=ni(t.props,c),h=Qr(t.props);if(m){let c=m._lpa||m.firstChild;t.shapeFlag&16&&(h?(p(e,t),f(m,c),t.targetAnchor||ci(m,t,u,l,s(e)===m?e:null)):(t.anchor=o(e),f(m,c),t.targetAnchor||ci(m,t,u,l),d(c&&o(c),t,m,n,r,i,a))),si(t,h)}else h&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=o(e));return t.anchor&&o(t.anchor)}var oi=ri;function si(e,t){let n=e.ctx;if(n&&n.ut){let r,i;for(t?(r=e.el,i=e.anchor):(r=e.targetStart,i=e.targetAnchor);r&&r!==i;)r.nodeType===1&&r.setAttribute(`data-v-owner`,n.uid),r=r.nextSibling;n.ut()}}function ci(e,t,n,r,i=null){let a=t.targetStart=n(``),o=t.targetAnchor=n(``);return a[Xr]=o,e&&(r(a,e,i),r(o,e,i)),o}var li=Symbol(`_leaveCb`),ui=Symbol(`_enterCb`);function di(){let e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return zi(()=>{e.isMounted=!0}),Hi(()=>{e.isUnmounting=!0}),e}var fi=[Function,Array],pi={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:fi,onEnter:fi,onAfterEnter:fi,onEnterCancelled:fi,onBeforeLeave:fi,onLeave:fi,onAfterLeave:fi,onLeaveCancelled:fi,onBeforeAppear:fi,onAppear:fi,onAfterAppear:fi,onAppearCancelled:fi},mi=e=>{let t=e.subTree;return t.component?mi(t.component):t},hi={name:`BaseTransition`,props:pi,setup(e,{slots:t}){let n=gs(),r=di();return()=>{let i=t.default&&Ci(t.default(),!0),a=i&&i.length?gi(i):n.subTree?G():void 0;if(!a)return;let o=N(e),{mode:s}=o;if(s&&s!==`in-out`&&s!==`out-in`&&s!=="default"&&P(`invalid <transition> mode: ${s}`),r.isLeaving)return bi(a);let c=xi(a);if(!c)return bi(a);let l=yi(c,o,r,n,e=>l=e);c.type!==Ho&&Si(c,l);let u=n.subTree&&xi(n.subTree);if(u&&u.type!==Ho&&!Zo(u,c)&&mi(n).type!==Ho){let e=yi(u,o,r,n);if(Si(u,e),s===`out-in`&&c.type!==Ho)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},bi(a);s===`in-out`&&c.type!==Ho?e.delayLeave=(e,t,n)=>{let i=vi(r,u);i[String(u.key)]=u,e[li]=()=>{t(),e[li]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{n(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}};function gi(e){let t=e[0];if(e.length>1){let n=!1;for(let r of e)if(r.type!==Ho){if(n){P(`<transition> can only be used on a single element or component. Use <transition-group> for lists.`);break}t=r,n=!0}}return t}var _i=hi;function vi(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function yi(e,t,n,r,i){let{appear:a,mode:o,persisted:s=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:m,onLeaveCancelled:h,onBeforeAppear:g,onAppear:_,onAfterAppear:v,onAppearCancelled:y}=t,b=String(e.key),x=vi(n,e),C=(e,t)=>{e&&Bn(e,r,9,t)},w=(e,t)=>{let n=t[1];C(e,t),S(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},ee={mode:o,persisted:s,beforeEnter(t){let r=c;if(!n.isMounted)if(a)r=g||c;else return;t[li]&&t[li](!0);let i=x[b];i&&Zo(e,i)&&i.el[li]&&i.el[li](),C(r,[t])},enter(t){if(!sr&&x[b]===e)return;let r=l,i=u,o=d;if(!n.isMounted)if(a)r=_||l,i=v||u,o=y||d;else return;let s=!1;t[ui]=e=>{s||(s=!0,C(e?o:i,[t]),ee.delayedLeave&&ee.delayedLeave(),t[ui]=void 0)};let c=t[ui].bind(null,!1);r?w(r,[t,c]):c()},leave(t,r){let i=String(e.key);if(t[ui]&&t[ui](!0),n.isUnmounting)return r();C(f,[t]);let a=!1;t[li]=n=>{a||(a=!0,r(),C(n?h:m,[t]),t[li]=void 0,x[i]===e&&delete x[i])};let o=t[li].bind(null,!1);x[i]=e,p?w(p,[t,o]):o()},clone(e){let a=yi(e,t,n,r,i);return i&&i(a),a}};return ee}function bi(e){if(ji(e))return e=is(e),e.children=null,e}function xi(e){if(!ji(e))return Zr(e.type)&&e.children?gi(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&T(n.default))return n.default()}}function Si(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Si(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Ci(e,t=!1,n){let r=[],i=0;for(let a=0;a<e.length;a++){let o=e[a],s=n==null?o.key:String(n)+String(o.key==null?a:o.key);o.type===R?(o.patchFlag&128&&i++,r=r.concat(Ci(o.children,t,s))):(t||o.type!==Ho)&&r.push(s==null?o:is(o,{key:s}))}if(i>1)for(let e=0;e<r.length;e++)r[e].patchFlag=-2;return r}function wi(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}var Ti=new WeakSet;function Ei(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var Di=new WeakMap;function Oi(e,t,n,r,i=!1){if(S(e)){e.forEach((e,a)=>Oi(e,t&&(S(t)?t[a]:t),n,r,i));return}if(Ai(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Oi(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?Fs(r.component):r.el,o=i?null:a,{i:s,r:c}=e;if(!s){P(`Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`);return}let l=t&&t.r,u=s.refs===f?s.refs={}:s.refs,d=s.setupState,p=N(d),m=d===f?h:e=>(x(p,e)&&!gn(p[e])&&P(`Template ref "${e}" used on a non-ref value. It will not work in the production build.`),Ti.has(p[e])||Ei(u,e)?!1:x(p,e)),g=(e,t)=>!(Ti.has(e)||t&&Ei(u,t));if(l!=null&&l!==c){if(ki(t),E(l))u[l]=null,m(l)&&(d[l]=null);else if(gn(l)){let e=t;g(l,e.k)&&(l.value=null),e.k&&(u[e.k]=null)}}if(T(c))zn(c,s,12,[o,u]);else{let t=E(c),r=gn(c);if(t||r){let s=()=>{if(e.f){let n=t?m(c)?d[c]:u[c]:g(c)||!e.k?c.value:u[e.k];if(i)S(n)&&y(n,a);else if(S(n))n.includes(a)||n.push(a);else if(t)u[c]=[a],m(c)&&(d[c]=u[c]);else{let t=[a];g(c,e.k)&&(c.value=t),e.k&&(u[e.k]=t)}}else t?(u[c]=o,m(c)&&(d[c]=o)):r?(g(c,e.k)&&(c.value=o),e.k&&(u[e.k]=o)):P(`Invalid template ref type:`,c,`(${typeof c})`)};if(o){let t=()=>{s(),Di.delete(e)};t.id=-1,Di.set(e,t),Oo(t,n)}else ki(e),s()}else P(`Invalid template ref type:`,c,`(${typeof c})`)}}function ki(e){let t=Di.get(e);t&&(t.flags|=8,Di.delete(e))}Se().requestIdleCallback,Se().cancelIdleCallback;var Ai=e=>!!e.type.__asyncLoader,ji=e=>e.type.__isKeepAlive;function Mi(e,t){Pi(e,`a`,t)}function Ni(e,t){Pi(e,`da`,t)}function Pi(e,t,n=hs){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Ii(t,r,n),n){let e=n.parent;for(;e&&e.parent;)ji(e.parent.vnode)&&Fi(r,t,n,e),e=e.parent}}function Fi(e,t,n,r){let i=Ii(t,e,r,!0);Ui(()=>{y(r[t],i)},n)}function Ii(e,t,n=hs,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{ct();let i=ys(n),a=Bn(t,n,e,r);return i(),lt(),a};return r?i.unshift(a):i.push(a),a}P(`${he(Rn[e].replace(/ hook$/,``))} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}var Li=e=>(t,n=hs)=>{(!ws||e===`sp`)&&Ii(e,(...e)=>t(...e),n)},Ri=Li(`bm`),zi=Li(`m`),Bi=Li(`bu`),Vi=Li(`u`),Hi=Li(`bum`),Ui=Li(`um`),Wi=Li(`sp`),Gi=Li(`rtg`),Ki=Li(`rtc`);function qi(e,t=hs){Ii(`ec`,e,t)}var Ji=`components`;function I(e,t){return Zi(Ji,e,!0,t)||e}var Yi=Symbol.for(`v-ndc`);function Xi(e){return E(e)?Zi(Ji,e,!1)||e:e||Yi}function Zi(e,t,n=!0,r=!1){let i=Fr||hs;if(i){let a=i.type;if(e===Ji){let e=Rs(a,!1);if(e&&(e===t||e===O(t)||e===me(O(t))))return a}let o=Qi(i[e]||a[e],t)||Qi(i.appContext[e],t);if(!o&&r)return a;if(n&&!o){let n=e===Ji?`
|
|
111
|
+
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`:``;P(`Failed to resolve ${e.slice(0,-1)}: ${t}${n}`)}return o}P(`resolve${me(e.slice(0,-1))} can only be used in render() or setup().`)}function Qi(e,t){return e&&(e[t]||e[O(t)]||e[me(O(t))])}function L(e,t,n,r){let i,a=n&&n[r],o=S(e);if(o||E(e)){let n=o&&ln(e),r=!1,s=!1;n&&(r=!dn(e),s=un(e),e=St(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?hn(mn(e[n])):mn(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`)if(!Number.isInteger(e)||e<0)P(`The v-for range expects a positive integer value but got ${e}.`),i=[];else{i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}else if(D(e))if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}else i=[];return n&&(n[r]=i),i}function $i(e,t,n={},r,i,a){if(Fr.ce||Fr.parent&&Ai(Fr.parent)&&Fr.parent.ce){let e=a!=null&&n.key==null?v({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),z(),V(R,null,[U(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o.length>1&&(P(`SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`),o=()=>[]),o&&o._c&&(o._d=!1);let s=Wo.length;z();let c;try{let i=o&&ea(o(n)),s=n.key||a||i&&i.key;c=V(R,{key:(s&&!te(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=Wo.length;e>s;e--)Ko();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function ea(e){return e.some(e=>!Xo(e)||!(e.type===Ho||e.type===R&&!ea(e.children)))?e:null}var ta=e=>e?Cs(e)?Fs(e):ta(e.parent):null,na=v(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>sn(e.props),$attrs:e=>sn(e.attrs),$slots:e=>sn(e.slots),$refs:e=>sn(e.refs),$parent:e=>ta(e.parent),$root:e=>ta(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ga(e),$forceUpdate:e=>e.f||=()=>{$n(e.update)},$nextTick:e=>e.n||=Zn.bind(e.proxy),$watch:e=>qr.bind(e)}),ra=e=>e===`_`||e===`$`,ia=(e,t)=>e!==f&&!e.__isScriptSetup&&x(e,t),aa={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:c}=e;if(t===`__isVue`)return!0;if(t[0]!==`$`){let e=o[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(ia(r,t))return o[t]=1,r[t];else if(i!==f&&x(i,t))return o[t]=2,i[t];else if(x(a,t))return o[t]=3,a[t];else if(n!==f&&x(n,t))return o[t]=4,n[t];else da&&(o[t]=0)}let l=na[t],u,d;if(l)return t===`$attrs`?(yt(e.attrs,`get`,``),Ia()):t===`$slots`&&yt(e,`get`,t),l(e);if((u=s.__cssModules)&&(u=u[t]))return u;if(n!==f&&x(n,t))return o[t]=4,n[t];if(d=c.config.globalProperties,x(d,t))return d[t];Fr&&(!E(t)||t.indexOf(`__v`)!==0)&&(i!==f&&ra(t[0])&&x(i,t)?P(`Property ${JSON.stringify(t)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):e===Fr&&P(`Property ${JSON.stringify(t)} was accessed during render but is not defined on instance.`))},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return ia(i,t)?(i[t]=n,!0):i.__isScriptSetup&&x(i,t)?(P(`Cannot mutate <script setup> binding "${t}" from Options API.`),!1):r!==f&&x(r,t)?(r[t]=n,!0):x(e.props,t)?(P(`Attempting to mutate prop "${t}". Props are readonly.`),!1):t[0]===`$`&&t.slice(1)in e?(P(`Attempting to mutate public property "${t}". Properties starting with $ are reserved and readonly.`),!1):(t in e.appContext.config.globalProperties?Object.defineProperty(a,t,{enumerable:!0,configurable:!0,value:n}):a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:o}},s){let c;return!!(n[s]||e!==f&&s[0]!==`$`&&x(e,s)||ia(t,s)||x(a,s)||x(r,s)||x(na,s)||x(i.config.globalProperties,s)||(c=o.__cssModules)&&c[s])},defineProperty(e,t,n){return n.get==null?x(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};aa.ownKeys=e=>(P(`Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`),Reflect.ownKeys(e));function oa(e){let t={};return Object.defineProperty(t,"_",{configurable:!0,enumerable:!1,get:()=>e}),Object.keys(na).forEach(n=>{Object.defineProperty(t,n,{configurable:!0,enumerable:!1,get:()=>na[n](e),set:m})}),t}function sa(e){let{ctx:t,propsOptions:[n]}=e;n&&Object.keys(n).forEach(n=>{Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>e.props[n],set:m})})}function ca(e){let{ctx:t,setupState:n}=e;Object.keys(N(n)).forEach(e=>{if(!n.__isScriptSetup){if(ra(e[0])){P(`setup() return property ${JSON.stringify(e)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);return}Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:()=>n[e],set:m})}})}function la(e){return S(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function ua(){let e=Object.create(null);return(t,n)=>{e[n]?P(`${t} property "${n}" is already defined in ${e[n]}.`):e[n]=t}}var da=!0;function fa(e){let t=ga(e),n=e.proxy,r=e.ctx;da=!1,t.beforeCreate&&ma(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:o,watch:s,provide:c,inject:l,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:h,activated:g,deactivated:_,beforeDestroy:v,beforeUnmount:y,destroyed:b,unmounted:x,render:C,renderTracked:w,renderTriggered:ee,errorCaptured:E,serverPrefetch:te,expose:re,inheritAttrs:ie,components:ae,directives:oe,filters:se}=t,ce=ua();{let[t]=e.propsOptions;if(t)for(let e in t)ce(`Props`,e)}if(l&&pa(l,r,ce),o)for(let e in o){let t=o[e];T(t)?(Object.defineProperty(r,e,{value:t.bind(n),configurable:!0,enumerable:!0,writable:!0}),ce(`Methods`,e)):P(`Method "${e}" has type "${typeof t}" in the component definition. Did you reference the function correctly?`)}if(i){T(i)||P(`The data option must be a function. Plain object usage is no longer supported.`);let t=i.call(n,n);if(ne(t)&&P(`data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`),!D(t))P(`data() should return an object.`);else{e.data=rn(t);for(let e in t)ce(`Data`,e),ra(e[0])||Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:()=>t[e],set:m})}}if(da=!0,a)for(let e in a){let t=a[e],i=T(t)?t.bind(n,n):T(t.get)?t.get.bind(n,n):m;i===m&&P(`Computed property "${e}" has no getter.`);let o=Vs({get:i,set:!T(t)&&T(t.set)?t.set.bind(n):()=>{P(`Write operation failed: computed property "${e}" is readonly.`)}});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>o.value,set:e=>o.value=e}),ce(`Computed`,e)}if(s)for(let e in s)ha(s[e],r,n,e);if(c){let e=T(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{Vr(t,e[t])})}u&&ma(u,e,`c`);function le(e,t){S(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(le(Ri,d),le(zi,f),le(Bi,p),le(Vi,h),le(Mi,g),le(Ni,_),le(qi,E),le(Ki,w),le(Gi,ee),le(Hi,y),le(Ui,x),le(Wi,te),S(re))if(re.length){let t=e.exposed||={};re.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={};C&&e.render===m&&(e.render=C),ie!=null&&(e.inheritAttrs=ie),ae&&(e.components=ae),oe&&(e.directives=oe),te&&wi(e)}function pa(e,t,n=m){S(e)&&(e=xa(e));for(let r in e){let i=e[r],a;a=D(i)?`default`in i?Hr(i.from||r,i.default,!0):Hr(i.from||r):Hr(i),gn(a)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e}):t[r]=a,n(`Inject`,r)}}function ma(e,t,n){Bn(S(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function ha(e,t,n,r){let i=r.includes(`.`)?Jr(n,r):()=>n[r];if(E(e)){let n=t[e];T(n)?Gr(i,n):P(`Invalid watch handler specified by key "${e}"`,n)}else if(T(e))Gr(i,e.bind(n));else if(D(e))if(S(e))e.forEach(e=>ha(e,t,n,r));else{let r=T(e.handler)?e.handler.bind(n):t[e.handler];T(r)?Gr(i,r,e):P(`Invalid watch handler specified by key "${e.handler}"`,r)}else P(`Invalid watch option: "${r}"`,e)}function ga(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>_a(c,e,o,!0)),_a(c,t,o)),D(t)&&a.set(t,c),c}function _a(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&_a(e,a,n,!0),i&&i.forEach(t=>_a(e,t,n,!0));for(let i in t)if(r&&i===`expose`)P(`"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`);else{let r=va[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var va={data:ya,props:wa,emits:wa,methods:Ca,computed:Ca,beforeCreate:Sa,created:Sa,beforeMount:Sa,mounted:Sa,beforeUpdate:Sa,updated:Sa,beforeDestroy:Sa,beforeUnmount:Sa,destroyed:Sa,unmounted:Sa,activated:Sa,deactivated:Sa,errorCaptured:Sa,serverPrefetch:Sa,components:Ca,directives:Ca,watch:Ta,provide:ya,inject:ba};function ya(e,t){return t?e?function(){return v(T(e)?e.call(this,this):e,T(t)?t.call(this,this):t)}:t:e}function ba(e,t){return Ca(xa(e),xa(t))}function xa(e){if(S(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Sa(e,t){return e?[...new Set([].concat(e,t))]:t}function Ca(e,t){return e?v(Object.create(null),e,t):t}function wa(e,t){return e?S(e)&&S(t)?[...new Set([...e,...t])]:v(Object.create(null),la(e),la(t??{})):t}function Ta(e,t){if(!e)return t;if(!t)return e;let n=v(Object.create(null),e);for(let r in t)n[r]=Sa(e[r],t[r]);return n}function Ea(){return{app:null,config:{isNativeTag:h,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var Da=0;function Oa(e,t){return function(n,r=null){T(n)||(n=v({},n)),r!=null&&!D(r)&&(P(`root props passed to app.mount() must be an object.`),r=null);let i=Ea(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:Da++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:Ws,get config(){return i.config},set config(e){P(`app.config cannot be replaced. Modify individual options instead.`)},use(e,...t){return a.has(e)?P(`Plugin has already been applied to target app.`):e&&T(e.install)?(a.add(e),e.install(c,...t)):T(e)?(a.add(e),e(c,...t)):P(`A plugin must either be a function or an object with an "install" function.`),c},mixin(e){return i.mixins.includes(e)?P(`Mixin has already been applied to target app`+(e.name?`: ${e.name}`:``)):i.mixins.push(e),c},component(e,t){return Ss(e,i.config),t?(i.components[e]&&P(`Component "${e}" has already been registered in target app.`),i.components[e]=t,c):i.components[e]},directive(e,t){return zr(e),t?(i.directives[e]&&P(`Directive "${e}" has already been registered in target app.`),i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(s)P("App has already been mounted.\nIf you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. `const createMyApp = () => createApp(App)`");else{a.__vue_app__&&P("There is already an app instance mounted on the host container.\n If you want to mount another app on the same host container, you need to unmount the previous app by calling `app.unmount()` first.");let u=c._ceVNode||U(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),i.reload=()=>{let t=is(u);t.el=null,e(t,a,l)},o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,c._instance=u.component,wr(c,Ws),Fs(u.component)}},onUnmount(e){typeof e!=`function`&&P(`Expected function as first argument to app.onUnmount(), but got ${typeof e}`),o.push(e)},unmount(){s?(Bn(o,c._instance,16),e(null,c._container),c._instance=null,Tr(c),delete c._container.__vue_app__):P(`Cannot unmount an app that is not mounted.`)},provide(e,t){return e in i.provides&&(x(i.provides,e)?P(`App already provides property with key "${String(e)}". It will be overwritten with the new value.`):P(`App already provides property with key "${String(e)}" inherited from its parent element. It will be overwritten with the new value.`)),i.provides[e]=t,c},runWithContext(e){let t=ka;ka=c;try{return e()}finally{ka=t}}};return c}}var ka=null,Aa=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${O(t)}Modifiers`]||e[`${pe(t)}Modifiers`];function ja(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||f;{let{emitsOptions:r,propsOptions:[i]}=e;if(r)if(!(t in r))(!i||!(he(O(t))in i))&&P(`Component emitted event "${t}" but it is neither declared in the emits option nor as an "${he(O(t))}" prop.`);else{let e=r[t];T(e)&&(e(...n)||P(`Invalid event arguments: event validation failed for event "${t}".`))}}let i=n,a=t.startsWith(`update:`),o=a&&Aa(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>E(e)?e.trim():e)),o.number&&(i=n.map(ye))),Pr(e,t,i);{let n=t.toLowerCase();n!==t&&r[he(n)]&&P(`Event "${n}" is emitted in component ${zs(e,e.type)} but the handler is registered for "${t}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${pe(t)}" instead of "${t}".`)}let s,c=r[s=he(t)]||r[s=he(O(t))];!c&&a&&(c=r[s=he(pe(t))]),c&&Bn(c,e,6,i);let l=r[s+`Once`];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,Bn(l,e,6,i)}}var Ma=new WeakMap;function Na(e,t,n=!1){let r=n?Ma:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!T(e)){let r=e=>{let n=Na(e,t,!0);n&&(s=!0,v(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(D(e)&&r.set(e,null),null):(S(a)?a.forEach(e=>o[e]=null):v(o,a),D(e)&&r.set(e,o),o)}function Pa(e,t){return!e||!g(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),x(e,t[0].toLowerCase()+t.slice(1))||x(e,pe(t))||x(e,t))}var Fa=!1;function Ia(){Fa=!0}function La(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:p,ctx:m,inheritAttrs:h}=e,v=Lr(e),y,b;Fa=!1;try{if(n.shapeFlag&4){let e=i||r,t=p.__isScriptSetup?new Proxy(e,{get(e,t,n){return P(`Property '${String(t)}' was accessed via 'this'. Avoid using 'this' in templates.`),Reflect.get(e,t,n)}}):e;y=ss(l.call(t,e,u,sn(d),p,f,m)),b=s}else{let e=t;s===d&&Ia(),y=ss(e.length>1?e(sn(d),{get attrs(){return Ia(),sn(s)},slots:o,emit:c}):e(sn(d),null)),b=t.props?s:Ba(s)}}catch(t){Wo.length=0,Vn(t,e,1),y=U(Ho)}let x=y,S;if(y.patchFlag>0&&y.patchFlag&2048&&([x,S]=Ra(y)),b&&h!==!1){let e=Object.keys(b),{shapeFlag:t}=x;if(e.length){if(t&7)a&&e.some(_)&&(b=Va(b,a)),x=is(x,b,!1,!0);else if(!Fa&&x.type!==Ho){let e=Object.keys(s),t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=e[r];g(i)?_(i)||t.push(i[2].toLowerCase()+i.slice(3)):n.push(i)}n.length&&P(`Extraneous non-props attributes (${n.join(`, `)}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`),t.length&&P(`Extraneous non-emits event listeners (${t.join(`, `)}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)}}}return n.dirs&&(Ha(x)||P(`Runtime directive used on component with non-element root node. The directives will not function as intended.`),x=is(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(n.dirs):n.dirs),n.transition&&(Ha(x)||P(`Component inside <Transition> renders non-element root node that cannot be animated.`),Si(x,n.transition)),S?S(x):y=x,Lr(v),y}var Ra=e=>{let t=e.children,n=e.dynamicChildren,r=za(t,!1);if(!r)return[e,void 0];if(r.patchFlag>0&&r.patchFlag&2048)return Ra(r);let i=t.indexOf(r),a=n?n.indexOf(r):-1;return[ss(r),r=>{t[i]=r,n&&(a>-1?n[a]=r:r.patchFlag>0&&(e.dynamicChildren=[...n,r]))}]};function za(e,t=!0){let n;for(let r=0;r<e.length;r++){let i=e[r];if(Xo(i)){if(i.type!==Ho||i.children===`v-if`){if(n)return;if(n=i,t&&n.patchFlag>0&&n.patchFlag&2048)return za(n.children)}}else return}return n}var Ba=e=>{let t;for(let n in e)(n===`class`||n===`style`||g(n))&&((t||={})[n]=e[n]);return t},Va=(e,t)=>{let n={};for(let r in e)(!_(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n},Ha=e=>e.shapeFlag&7||e.type===Ho;function Ua(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if((i||s)&&sr||t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Wa(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(Ga(o,r,n)&&!Pa(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||Wa(r,o,l):!!o;return!1}function Wa(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(Ga(t,e,a)&&!Pa(n,a))return!0}return!1}function Ga(e,t,n){let r=e[n],i=t[n];return n===`style`&&D(r)&&D(i)?!Le(r,i):r!==i}function Ka({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var qa={},Ja=()=>Object.create(qa),Ya=e=>Object.getPrototypeOf(e)===qa;function Xa(e,t,n,r=!1){let i={},a=Ja();e.propsDefaults=Object.create(null),$a(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);ao(t||{},i,e),e.props=n?r?i:an(i):e.type.props?i:a,e.attrs=a}function Za(e){for(;e;){if(e.type.__hmrId)return!0;e=e.parent}}function Qa(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=N(i),[c]=e.propsOptions,l=!1;if(!Za(e)&&(r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(Pa(e.emitsOptions,o))continue;let u=t[o];if(c)if(x(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=O(o);i[t]=eo(c,s,t,u,e,!1)}else u!==a[o]&&(a[o]=u,l=!0)}}}else{$a(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!x(t,a)&&((r=pe(a))===a||!x(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=eo(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!x(t,e))&&(delete a[e],l=!0)}l&&bt(e.attrs,`set`,``),ao(t||{},i,e)}function $a(e,t,n,r){let[i,a]=e.propsOptions,o=!1,s;if(t)for(let c in t){if(ce(c))continue;let l=t[c],u;i&&x(i,u=O(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:Pa(e.emitsOptions,c)||(!(c in r)||l!==r[c])&&(r[c]=l,o=!0)}if(a){let t=N(n),r=s||f;for(let o=0;o<a.length;o++){let s=a[o];n[s]=eo(i,t,s,r[s],e,!x(r,s))}}return o}function eo(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=x(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&T(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=ys(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===pe(n))&&(r=!0))}return r}var to=new WeakMap;function no(e,t,n=!1){let r=n?to:t.propsCache,i=r.get(e);if(i)return i;let a=e.props,o={},s=[],c=!1;if(!T(e)){let r=e=>{c=!0;let[n,r]=no(e,t,!0);v(o,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!a&&!c)return D(e)&&r.set(e,p),p;if(S(a))for(let e=0;e<a.length;e++){E(a[e])||P(`props must be strings when using array syntax.`,a[e]);let t=O(a[e]);ro(t)&&(o[t]=f)}else if(a){D(a)||P(`invalid props options`,a);for(let e in a){let t=O(e);if(ro(t)){let n=a[e],r=o[t]=S(n)||T(n)?{type:n}:v({},n),i=r.type,c=!1,l=!0;if(S(i))for(let e=0;e<i.length;++e){let t=i[e],n=T(t)&&t.name;if(n===`Boolean`){c=!0;break}n===`String`&&(l=!1)}else c=T(i)&&i.name===`Boolean`;r[0]=c,r[1]=l,(c||x(r,`default`))&&s.push(t)}}}let l=[o,s];return D(e)&&r.set(e,l),l}function ro(e){return e[0]!==`$`&&!ce(e)||(P(`Invalid prop name: "${e}" is a reserved property.`),!1)}function io(e){return e===null?`null`:typeof e==`function`?e.name||``:typeof e==`object`&&e.constructor&&e.constructor.name||``}function ao(e,t,n){let r=N(t),i=n.propsOptions[0],a=Object.keys(e).map(e=>O(e));for(let e in i){let t=i[e];t!=null&&oo(e,r[e],t,sn(r),!a.includes(e))}}function oo(e,t,n,r,i){let{type:a,required:o,validator:s,skipCheck:c}=n;if(o&&i){P(`Missing required prop: "`+e+`"`);return}if(!(t==null&&!o)){if(a!=null&&a!==!0&&!c){let n=!1,r=S(a)?a:[a],i=[];for(let e=0;e<r.length&&!n;e++){let{valid:a,expectedType:o}=co(t,r[e]);i.push(o||``),n=a}if(!n){P(lo(e,t,i));return}}s&&!s(t,r)&&P(`Invalid prop: custom validator check failed for prop "`+e+`".`)}}var so=d(`String,Number,Boolean,Function,Symbol,BigInt`);function co(e,t){let n,r=io(t);if(r===`null`)n=e===null;else if(so(r)){let i=typeof e;n=i===r.toLowerCase(),!n&&i===`object`&&(n=e instanceof t)}else n=r===`Object`?D(e):r===`Array`?S(e):e instanceof t;return{valid:n,expectedType:r}}function lo(e,t,n){if(n.length===0)return`Prop type [] for prop "${e}" won't match anything. Did you mean to use type Array instead?`;let r=`Invalid prop: type check failed for prop "${e}". Expected ${n.map(me).join(` | `)}`,i=n[0],a=ae(t),o=uo(t,i),s=uo(t,a);return n.length===1&&fo(i)&&po(i,a)&&(r+=` with value ${o}`),r+=`, got ${a} `,fo(a)&&(r+=`with value ${s}.`),r}function uo(e,t){return te(e)?e.toString():t===`String`?`"${e}"`:t===`Number`?`${Number(e)}`:`${e}`}function fo(e){return[`string`,`number`,`boolean`].some(t=>e.toLowerCase()===t)}function po(...e){return e.every(e=>{let t=e.toLowerCase();return t!==`boolean`&&t!==`symbol`})}var mo=e=>e===`_`||e===`_ctx`||e===`$stable`,ho=e=>S(e)?e.map(ss):[ss(e)],go=(e,t,n)=>{if(t._n)return t;let r=Rr((...r)=>(hs&&!(n===null&&Fr)&&!(n&&n.root!==hs.root)&&P(`Slot "${e}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`),ho(t(...r))),n);return r._c=!1,r},_o=(e,t,n)=>{let r=e._ctx;for(let n in e){if(mo(n))continue;let i=e[n];if(T(i))t[n]=go(n,i,r);else if(i!=null){P(`Non-function value encountered for slot "${n}". Prefer function slots for better performance.`);let e=ho(i);t[n]=()=>e}}},vo=(e,t)=>{ji(e.vnode)||P(`Non-function value encountered for default slot. Prefer function slots for better performance.`);let n=ho(t);e.slots.default=()=>n},yo=(e,t,n)=>{for(let r in t)(n||!mo(r))&&(e[r]=t[r])},bo=(e,t,n)=>{let r=e.slots=Ja();if(e.vnode.shapeFlag&32){let e=t._;e?(yo(r,t,n),n&&ve(r,`_`,e,!0)):_o(t,r)}else t&&vo(e,t)},xo=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=f;if(r.shapeFlag&32){let r=t._;r?sr?(yo(i,t,n),bt(e,`set`,`$slots`)):n&&r===1?a=!1:yo(i,t,n):(a=!t.$stable,_o(t,i)),o=t}else t&&(vo(e,t),o={default:1});if(a)for(let e in i)!mo(e)&&o[e]==null&&delete i[e]},So,Co;function wo(e,t){e.appContext.config.performance&&Eo()&&Co.mark(`vue-${t}-${e.uid}`),jr(e,t,Eo()?Co.now():Date.now())}function To(e,t){if(e.appContext.config.performance&&Eo()){let n=`vue-${t}-${e.uid}`,r=n+`:end`,i=`<${zs(e,e.type)}> ${t}`;Co.mark(r),Co.measure(i,n,r),Co.clearMeasures(i),Co.clearMarks(n),Co.clearMarks(r)}Mr(e,t,Eo()?Co.now():Date.now())}function Eo(){return So===void 0&&(typeof window<`u`&&window.performance?(So=!0,Co=window.performance):So=!1),So}function Do(){let e=[];if(e.length){let t=e.length>1;console.warn(`Feature flag${t?`s`:``} ${e.join(`, `)} ${t?`are`:`is`} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.
|
|
112
112
|
|
|
113
|
-
For more details, see https://link.vuejs.org/feature-flags.`)}}var Do=zo;function Oo(e){return ko(e)}function ko(e,t){Eo();let n=xe();n.__VUE__=!0,Sr(n.__VUE_DEVTOOLS_GLOBAL_HOOK__,n);let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:c,setText:l,setElementText:u,parentNode:d,nextSibling:h,setScopeId:g=m,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!or&&!!t.dynamicChildren)=>{if(e===t)return;e&&!Xo(e,t)&&(r=k(e),me(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case Bo:y(e,t,n,r);break;case Vo:b(e,t,n,r);break;case Ho:e==null?x(t,n,r,o):S(e,t,n,o);break;case z:ie(e,t,n,r,i,a,o,s,c);break;default:d&1?ee(e,t,n,r,i,a,o,s,c):d&6?ae(e,t,n,r,i,a,o,s,c):d&64||d&128?l.process(e,t,n,r,i,a,o,s,c,Ce):F(`Invalid VNode type:`,l,`(${typeof l})`)}u!=null&&i?Di(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Di(e.ref,null,a,e,!0)},y=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},b=(e,t,n,i)=>{e==null?r(t.el=c(t.children||``),n,i):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=(e,t,n,r)=>{if(t.children!==e.children){let i=h(e.anchor);w(e),[t.el,t.anchor]=_(t.children,n,i,r)}else t.el=e.el,t.anchor=e.anchor},C=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=h(e),r(e,n,i),e=a;r(t,n,i)},w=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),i(e),e=n;i(t)},ee=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)T(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),D(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},T=(e,t,n,i,s,c,l,d)=>{let f,p,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(f=e.el=o(e.type,c,m&&m.is,m),h&8?u(f,e.children):h&16&&te(e.children,f,null,i,s,Ao(e,c),l,d),_&&zr(e,null,i,`created`),E(f,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!ce(e)&&a(f,e,null,m[e],c,i);`value`in m&&a(f,`value`,null,m.value,c),(p=m.onVnodeBeforeMount)&&us(p,i,e)}ve(f,`__vnode`,e,!0),ve(f,`__vueParentComponent`,i,!0),_&&zr(e,null,i,`beforeMount`);let v=Mo(s,g);if(v&&g.beforeEnter(f),r(f,t,n),(p=m&&m.onVnodeMounted)||v||_){let t=or;Do(()=>{let n;n=sr(t);try{p&&us(p,i,e),v&&g.enter(f),_&&zr(e,null,i,`mounted`)}finally{sr(n)}},s)}},E=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(n.patchFlag>0&&n.patchFlag&2048&&(n=Ra(n.children)||n),t===n||Ro(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;E(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},te=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?ss(e[l]):os(e[l]);v(null,c,t,n,r,i,a,o,s)}},D=(e,t,n,r,i,o,s)=>{let c=t.el=e.el;c.__vnode=t;let{patchFlag:l,dynamicChildren:d,dirs:p}=t;l|=e.patchFlag&16;let m=e.props||f,h=t.props||f,g;if(n&&jo(n,!1),(g=h.onVnodeBeforeUpdate)&&us(g,n,t,e),p&&zr(t,e,n,`beforeUpdate`),n&&jo(n,!0),(or||d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length))&&(l=0,s=!1,d=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&u(c,``),d?(ne(e.dynamicChildren,d,c,n,r,Ao(t,i),o),No(e,t)):s||de(e,t,c,null,n,r,Ao(t,i),o,!1),l>0){if(l&16)re(c,m,h,n,i);else if(l&2&&m.class!==h.class&&a(c,`class`,null,h.class,i),l&4&&a(c,`style`,m.style,h.style,i),l&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=m[r],s=h[r];(s!==o||r===`value`)&&a(c,r,o,s,i,n)}}l&1&&e.children!==t.children&&u(c,t.children)}else!s&&d==null&&re(c,m,h,n,i);((g=h.onVnodeUpdated)||p)&&Do(()=>{g&&us(g,n,t,e),p&&zr(t,e,n,`updated`)},r)},ne=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s],u=c.el&&(c.type===z||!Xo(c,l)||c.shapeFlag&198)?d(c.el):n;v(c,l,u,null,r,i,a,o,!0)}},re=(e,t,n,r,i)=>{if(t!==n){if(t!==f)for(let o in t)!ce(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(ce(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},ie=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;(or||p&2048)&&(p=0,u=!1,m=null),h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),te(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(ne(e.dynamicChildren,m,n,a,o,c,l),No(e,t)):de(e,t,n,f,a,o,c,l,u)},ae=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):oe(t,n,r,i,a,o,c):se(e,t,c)},oe=(e,t,n,r,i,a,o)=>{let s=e.component=ps(e,r,i);if(s.type.__hmrId&&ur(s),On(e),Co(s,`mount`),Ai(e)&&(s.ctx.renderer=Ce),Co(s,`init`),ws(s,!1,o),wo(s,`init`),or&&(e.el=null),s.asyncDep){if(i&&i.registerDep(s,le,o),!e.el){let r=s.subTree=W(Vo);b(null,r,t,n),e.placeholder=r.el}}else le(s,e,t,n,i,a,o);kn(),wo(s,`mount`)},se=(e,t,n)=>{let r=t.component=e.component;if(Ha(e,t,n))if(r.asyncDep&&!r.asyncResolved){On(t),ue(r,t,n),kn();return}else r.next=t,r.update();else t.el=e.el,r.vnode=t},le=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=Fo(e);if(n){t&&(t.el=c.el,ue(e,t,o)),n.asyncDep.then(()=>{Do(()=>{e.isUnmounted||l()},i)});return}}let u=t,f;On(t||e.vnode),jo(e,!1),t?(t.el=c.el,ue(e,t,o)):t=c,n&&_e(n),(f=t.props&&t.props.onVnodeBeforeUpdate)&&us(f,s,t,c),jo(e,!0),Co(e,`render`);let p=Ia(e);wo(e,`render`);let m=e.subTree;e.subTree=p,Co(e,`patch`),v(m,p,d(m.el),k(m),e,i,a),wo(e,`patch`),t.el=p.el,u===null&&Ga(e,p.el),r&&Do(r,i),(f=t.props&&t.props.onVnodeUpdated)&&Do(()=>us(f,s,t,c),i),Er(e),kn()}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=ki(t);if(jo(e,!1),l&&_e(l),!m&&(o=c&&c.onVnodeBeforeMount)&&us(o,d,t),jo(e,!0),s&&Te){let t=()=>{Co(e,`render`),e.subTree=Ia(e),wo(e,`render`),Co(e,`hydrate`),Te(s,e.subTree,e,i,null),wo(e,`hydrate`)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0),Co(e,`render`);let o=e.subTree=Ia(e);wo(e,`render`),Co(e,`patch`),v(null,o,n,r,e,i,a),wo(e,`patch`),t.el=o.el}if(u&&Do(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;Do(()=>us(o,d,e),i)}(t.shapeFlag&256||d&&ki(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&Do(e.a,i),e.isMounted=!0,Tr(e),t=n=r=null}};e.scope.on();let c=e.effect=new Ke(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>Qn(u),jo(e,!0),c.onTrack=e.rtc?t=>_e(e.rtc,t):void 0,c.onTrigger=e.rtg?t=>_e(e.rtg,t):void 0,l()},ue=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,Za(e,t.props,r,n),bo(e,t.children,n),st(),tr(e),ct()},de=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,d=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(p&128){fe(l,f,n,r,i,a,o,s,c);return}if(p&256){O(l,f,n,r,i,a,o,s,c);return}}m&8?(d&16&&be(l,i,a),f!==l&&u(n,f)):d&16?m&16?fe(l,f,n,r,i,a,o,s,c):be(l,i,a,!0):(d&8&&u(n,``),m&16&&te(f,n,r,i,a,o,s,c))},O=(e,t,n,r,i,a,o,s,c)=>{e||=p,t||=p;let l=e.length,u=t.length,d=Math.min(l,u),f;for(f=0;f<d;f++){let r=t[f]=c?ss(t[f]):os(t[f]);v(e[f],r,n,null,i,a,o,s,c)}l>u?be(e,i,a,!0,!1,d):te(t,n,r,i,a,o,s,c,d)},fe=(e,t,n,r,i,a,o,s,c)=>{let l=0,u=t.length,d=e.length-1,f=u-1;for(;l<=d&&l<=f;){let r=e[l],u=t[l]=c?ss(t[l]):os(t[l]);if(Xo(r,u))v(r,u,n,null,i,a,o,s,c);else break;l++}for(;l<=d&&l<=f;){let r=e[d],l=t[f]=c?ss(t[f]):os(t[f]);if(Xo(r,l))v(r,l,n,null,i,a,o,s,c);else break;d--,f--}if(l>d){if(l<=f){let e=f+1,d=e<u?t[e].el:r;for(;l<=f;)v(null,t[l]=c?ss(t[l]):os(t[l]),n,d,i,a,o,s,c),l++}}else if(l>f)for(;l<=d;)me(e[l],i,a,!0),l++;else{let m=l,h=l,g=new Map;for(l=h;l<=f;l++){let e=t[l]=c?ss(t[l]):os(t[l]);e.key!=null&&(g.has(e.key)&&F(`Duplicate keys found during update:`,JSON.stringify(e.key),`Make sure keys are unique.`),g.set(e.key,l))}let _,y=0,b=f-h+1,x=!1,S=0,C=Array(b);for(l=0;l<b;l++)C[l]=0;for(l=m;l<=d;l++){let r=e[l];if(y>=b){me(r,i,a,!0);continue}let u;if(r.key!=null)u=g.get(r.key);else for(_=h;_<=f;_++)if(C[_-h]===0&&Xo(r,t[_])){u=_;break}u===void 0?me(r,i,a,!0):(C[u-h]=l+1,u>=S?S=u:x=!0,v(r,t[u],n,null,i,a,o,s,c),y++)}let w=x?Po(C):p;for(_=w.length-1,l=b-1;l>=0;l--){let e=h+l,d=t[e],f=t[e+1],p=e+1<u?f.el||Lo(f):r;C[l]===0?v(null,d,n,p,i,a,o,s,c):x&&(_<0||l!==w[_]?pe(d,n,p,2):_--)}}},pe=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){pe(e.component.subTree,t,n,a);return}if(d&128){e.suspense.move(t,n,a);return}if(d&64){c.move(e,t,n,Ce);return}if(c===z){r(s,t,n);for(let e=0;e<u.length;e++)pe(u[e],t,n,a);r(e.anchor,t,n);return}if(c===Ho){C(e,t,n);return}if(a!==2&&d&1&&l)if(a===0)l.persisted&&!s[ci]?r(s,t,n):(l.beforeEnter(s),r(s,t,n),Do(()=>l.enter(s),o));else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{let e=s._isLeaving||!!s[ci];s._isLeaving&&s[ci](!0),l.persisted&&!e?u():a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}else r(s,t,n)},me=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(st(),Di(s,null,n,e,!0),ct()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!ki(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&us(_,t,e),u&6)ye(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&zr(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,Ce,r):l&&!l.hasOnce&&(a!==z||d>0&&d&64)?be(l,t,n,!1,!0):(a===z&&d&384||!i&&u&16)&&be(c,t,n),r&&he(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&Do(()=>{_&&us(_,t,e),h&&zr(e,null,t,`unmounted`),v&&(e.el=null)},n)},he=e=>{let{type:t,el:n,anchor:r,transition:a}=e;if(t===z){e.patchFlag>0&&e.patchFlag&2048&&a&&!a.persisted?e.children.forEach(e=>{e.type===Vo?i(e.el):he(e)}):ge(n,r);return}if(t===Ho){w(e);return}let o=()=>{i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(e.shapeFlag&1&&a&&!a.persisted){let{leave:t,delayLeave:r}=a,i=()=>t(n,o);r?r(e.el,o,i):i()}else o()},ge=(e,t)=>{let n;for(;e!==t;)n=h(e),i(e),e=n;i(t)},ye=(e,t,n)=>{e.type.__hmrId&&dr(e);let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;Io(c),Io(l),r&&_e(r),i.stop(),a&&(a.flags|=8,me(o,e,t,n)),s&&Do(s,t),Do(()=>{e.isUnmounted=!0},t),Or(e)},be=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)me(e[o],t,n,r,i)},k=e=>{if(e.shapeFlag&6)return k(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[Yr];return n?h(n):t},A=!1,Se=(e,t,n)=>{let r;e==null?t._vnode&&(me(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,A||=(A=!0,tr(r),nr(),!1)},Ce={p:v,um:me,m:pe,r:he,mt:oe,mc:te,pc:de,pbc:ne,n:k,o:e},we,Te;return t&&([we,Te]=t(Ce)),{render:Se,hydrate:we,createApp:Da(Se,we)}}function Ao({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function jo({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Mo(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function No(e,t,n=!1){let r=e.children,i=t.children;if(S(r)&&S(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=ss(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&No(t,a)),a.type===Bo&&(a.patchFlag===-1&&(a=i[e]=ss(a)),a.el=t.el),a.type===Vo&&!a.el&&(a.el=t.el),a.el&&(a.el.__vnode=a)}}function Po(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function Fo(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Fo(t)}function Io(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Lo(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?Lo(t.subTree):null}var Ro=e=>e.__isSuspense;function zo(e,t){t&&t.pendingBranch?S(e)?t.effects.push(...e):t.effects.push(e):er(e)}var z=Symbol.for(`v-fgt`),Bo=Symbol.for(`v-txt`),Vo=Symbol.for(`v-cmt`),Ho=Symbol.for(`v-stc`),Uo=[],Wo=null;function B(e=!1){Uo.push(Wo=e?null:[])}function Go(){Uo.pop(),Wo=Uo[Uo.length-1]||null}var Ko=1;function qo(e,t=!1){Ko+=e,e<0&&Wo&&t&&(Wo.hasOnce=!0)}function Jo(e){return e.dynamicChildren=Ko>0?Wo||p:null,Go(),Ko>0&&Wo&&Wo.push(e),e}function V(e,t,n,r,i,a){return Jo(U(e,t,n,r,i,a,!0))}function H(e,t,n,r,i){return Jo(W(e,t,n,r,i,!0))}function Yo(e){return e?e.__v_isVNode===!0:!1}function Xo(e,t){if(t.shapeFlag&6&&e.component){let n=cr.get(t.type);if(n&&n.has(e.component))return e.shapeFlag&=-257,t.shapeFlag&=-513,!1}return e.type===t.type&&e.key===t.key}var Zo,Qo=(...e)=>ts(...Zo?Zo(e,Pr):e),$o=({key:e})=>e??null,es=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:E(e)||hn(e)||T(e)?{i:Pr,r:e,k:t,f:!!n}:e);function U(e,t=null,n=null,r=0,i=null,a=e===z?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&$o(t),ref:t&&es(t),scopeId:Fr,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Pr};return s?(cs(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=E(n)?8:16),c.key!==c.key&&F(`VNode created with invalid key (NaN). VNode type:`,c.type),Ko>0&&!o&&Wo&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&Wo.push(c),c}var W=Qo;function ts(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===Ji)&&(e||F(`Invalid vnode type when creating vnode: ${e}.`),e=Vo),Yo(e)){let r=rs(e,t,!0);return n&&cs(r,n),Ko>0&&!a&&Wo&&(r.shapeFlag&6?Wo[Wo.indexOf(e)]=r:Wo.push(r)),r.patchFlag=-2,r}if(zs(e)&&(e=e.__vccOpts),t){t=ns(t);let{class:e,style:n}=t;e&&!E(e)&&(t.class=j(e)),D(n)&&(dn(n)&&!S(n)&&(n=v({},n)),t.style=A(n))}let o=E(e)?1:Ro(e)?128:Xr(e)?64:D(e)?4:T(e)?2:0;return o&4&&dn(e)&&(e=P(e),F("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
114
|
-
Component that was made reactive: `,e)),U(e,t,n,r,i,o,a,!0)}function ns(e){return e?dn(e)||Ja(e)?v({},e):e:null}function rs(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?ls(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&$o(l),ref:t&&t.ref?n&&a?S(a)?a.concat(es(t)):[a,es(t)]:es(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o===-1&&S(s)?s.map(is):s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==z?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&rs(e.ssContent),ssFallback:e.ssFallback&&rs(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&xi(u,c.clone(u)),u}function is(e){let t=rs(e);return S(e.children)&&(t.children=e.children.map(is)),t}function G(e=` `,t=0){return W(Bo,null,e,t)}function as(e,t){let n=W(Ho,null,e);return n.staticCount=t,n}function K(e=``,t=!1){return t?(B(),H(Vo,null,e)):W(Vo,null,e)}function os(e){return e==null||typeof e==`boolean`?W(Vo):S(e)?W(z,null,e.slice()):Yo(e)?ss(e):W(Bo,null,String(e))}function ss(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:rs(e)}function cs(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(S(t))n=16;else if(typeof t==`object`)if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),cs(e,n()),n._c&&(n._d=!0));return}else{n=32;let r=t._;!r&&!Ja(t)?t._ctx=Pr:r===3&&Pr&&(Pr.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(T(t)){if(r&65){cs(e,{default:t});return}t={default:t,_ctx:Pr},n=32}else t=String(t),r&64?(n=16,t=[G(t)]):n=8;e.children=t,e.shapeFlag|=n}function ls(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=j([t.class,r.class]));else if(e===`style`)t.style=A([t.style,r.style]);else if(g(e)){let n=t[e],i=r[e];i&&n!==i&&!(S(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!_(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function us(e,t,n,r=null){zn(e,t,7,[n,r])}var ds=Ta(),fs=0;function ps(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||ds,a={uid:fs++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ue(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:to(r,i),emitsOptions:Ma(r,i),emit:null,emitted:null,propsDefaults:f,inheritAttrs:r.inheritAttrs,ctx:f,data:f,props:f,attrs:f,slots:f,refs:f,setupState:f,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx=aa(a),a.root=t?t.root:a,a.emit=Aa.bind(null,a),e.ce&&e.ce(a),a}var ms=null,hs=()=>ms||Pr,gs,_s;{let e=xe(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};gs=t(`__VUE_INSTANCE_SETTERS__`,e=>ms=e),_s=t(`__VUE_SSR_SETTERS__`,e=>Cs=e)}var vs=e=>{let t=ms;return gs(e),e.scope.on(),()=>{e.scope.off(),gs(t)}},ys=()=>{ms&&ms.scope.off(),gs(null)},bs=d(`slot,component`);function xs(e,{isNativeTag:t}){(bs(e)||t(e))&&F(`Do not use built-in or reserved HTML elements as component id: `+e)}function Ss(e){return e.vnode.shapeFlag&4}var Cs=!1;function ws(e,t=!1,n=!1){t&&_s(t);let{props:r,children:i}=e.vnode,a=Ss(e);Ya(e,r,a,t),yo(e,i,n||t);let o=a?Ts(e,t):void 0;return t&&_s(!1),o}function Ts(e,t){let n=e.type;if(n.name&&xs(n.name,e.appContext.config),n.components){let t=Object.keys(n.components);for(let n=0;n<t.length;n++)xs(t[n],e.appContext.config)}if(n.directives){let e=Object.keys(n.directives);for(let t=0;t<e.length;t++)Rr(e[t])}n.compilerOptions&&ks()&&F(`"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`),e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ia),oa(e);let{setup:r}=n;if(r){st();let i=e.setupContext=r.length>1?Ns(e):null,a=vs(e),o=Rn(r,e,0,[on(e.props),i]),s=ne(o);if(ct(),a(),(s||e.sp)&&!ki(e)&&Ci(e),s){if(o.then(ys,ys),t)return o.then(n=>{Es(e,n,t)}).catch(t=>{Bn(t,e,0)});e.asyncDep=o,e.suspense||F(`Component <${Rs(e,n)}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`)}else Es(e,o,t)}else As(e,t)}function Es(e,t,n){T(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:D(t)?(Yo(t)&&F(`setup() should not return VNodes directly - return a render function instead.`),e.devtoolsRawSetupState=t,e.setupState=vn(t),sa(e)):t!==void 0&&F(`setup() should return an object. Received: ${t===null?`null`:typeof t}`),As(e,n)}var Ds,Os,ks=()=>!Ds;function As(e,t,n){let r=e.type;if(!e.render){if(!t&&Ds&&!r.render){let t=r.template||ha(e).template;if(t){Co(e,`compile`);let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r;r.render=Ds(t,v(v({isCustomElement:n,delimiters:a},i),o)),wo(e,`compile`)}}e.render=r.render||m,Os&&Os(e)}{let t=vs(e);st();try{da(e)}finally{ct(),t()}}!r.render&&e.render===m&&!t&&(!Ds&&r.template?F(`Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`):F(`Component is missing template or render function: `,r))}var js={get(e,t){return Fa(),vt(e,`get`,``),e[t]},set(){return F(`setupContext.attrs is readonly.`),!1},deleteProperty(){return F(`setupContext.attrs is readonly.`),!1}};function Ms(e){return new Proxy(e.slots,{get(t,n){return vt(e,`get`,`$slots`),t[n]}})}function Ns(e){let t=t=>{if(e.exposed&&F(`expose() should be called only once per setup().`),t!=null){let e=typeof t;e===`object`&&(S(t)?e=`array`:hn(t)&&(e=`ref`)),e!==`object`&&F(`expose() should be passed a plain object, received ${e}.`)}e.exposed=t||{}};{let n,r;return Object.freeze({get attrs(){return n||=new Proxy(e.attrs,js)},get slots(){return r||=Ms(e)},get emit(){return(t,...n)=>e.emit(t,...n)},expose:t})}}function Ps(e){return e.exposed?e.exposeProxy||=new Proxy(vn(fn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ta)return ta[n](e)},has(e,t){return t in e||t in ta}}):e.proxy}var Fs=/(?:^|[-_])\w/g,Is=e=>e.replace(Fs,e=>e.toUpperCase()).replace(/[-_]/g,``);function Ls(e,t=!0){return T(e)?e.displayName||e.name:e.name||t&&e.__name}function Rs(e,t,n=!1){let r=Ls(t);if(!r&&t.__file){let e=t.__file.match(/([^/\\]+)\.\w+$/);e&&(r=e[1])}if(!r&&e){let n=e=>{for(let n in e)if(e[n]===t)return n};r=n(e.components)||e.parent&&n(e.parent.type.components)||n(e.appContext.components)}return r?Is(r):n?`App`:`Anonymous`}function zs(e){return T(e)&&`__vccOpts`in e}var Bs=(e,t)=>{let n=bn(e,t,Cs);{let e=hs();e&&e.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function Vs(e,t,n){try{qo(-1);let r=arguments.length;return r===2?D(t)&&!S(t)?Yo(t)?W(e,null,[t]):W(e,t):W(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Yo(n)&&(n=[n]),W(e,t,n))}finally{qo(1)}}function Hs(){if(typeof window>`u`)return;let e={style:`color:#3ba776`},t={style:`color:#1677ff`},n={style:`color:#f5222d`},r={style:`color:#eb2f96`},i={__vue_custom_formatter:!0,header(t){if(!D(t))return null;if(t.__isVue)return[`div`,e,`VueInstance`];if(hn(t)){st();let n=t.value;return ct(),[`div`,{},[`span`,e,u(t)],`<`,s(n),`>`]}return cn(t)?[`div`,{},[`span`,e,un(t)?`ShallowReactive`:`Reactive`],`<`,s(t),`>${ln(t)?` (readonly)`:``}`]:ln(t)?[`div`,{},[`span`,e,un(t)?`ShallowReadonly`:`Readonly`],`<`,s(t),`>`]:null},hasBody(e){return e&&e.__isVue},body(e){if(e&&e.__isVue)return[`div`,{},...a(e.$)]}};function a(e){let t=[];e.type.props&&e.props&&t.push(o(`props`,P(e.props))),e.setupState!==f&&t.push(o(`setup`,e.setupState)),e.data!==f&&t.push(o(`data`,P(e.data)));let n=c(e,`computed`);n&&t.push(o(`computed`,n));let i=c(e,`inject`);return i&&t.push(o(`injected`,i)),t.push([`div`,{},[`span`,{style:r.style+`;opacity:0.66`},`$ (internal): `],[`object`,{object:e}]]),t}function o(e,t){return t=v({},t),Object.keys(t).length?[`div`,{style:`line-height:1.25em;margin-bottom:0.6em`},[`div`,{style:`color:#476582`},e],[`div`,{style:`padding-left:1.25em`},...Object.keys(t).map(e=>[`div`,{},[`span`,r,e+`: `],s(t[e],!1)])]]:[`span`,{}]}function s(e,i=!0){return typeof e==`number`?[`span`,t,e]:typeof e==`string`?[`span`,n,JSON.stringify(e)]:typeof e==`boolean`?[`span`,r,e]:D(e)?[`object`,{object:i?P(e):e}]:[`span`,n,String(e)]}function c(e,t){let n=e.type;if(T(n))return;let r={};for(let i in e.ctx)l(n,i,t)&&(r[i]=e.ctx[i]);return r}function l(e,t,n){let r=e[n];if(S(r)&&r.includes(t)||D(r)&&t in r||e.extends&&l(e.extends,t,n)||e.mixins&&e.mixins.some(e=>l(e,t,n)))return!0}function u(e){return un(e)?`ShallowRef`:e.effect?`ComputedRef`:`Ref`}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}var Us=`3.5.40`,Ws=F,Gs=void 0,Ks=typeof window<`u`&&window.trustedTypes;if(Ks)try{Gs=Ks.createPolicy(`vue`,{createHTML:e=>e})}catch(e){Ws(`Error creating trusted types policy: ${e}`)}var qs=Gs?e=>Gs.createHTML(e):e=>e,Js=`http://www.w3.org/2000/svg`,Ys=`http://www.w3.org/1998/Math/MathML`,Xs=typeof document<`u`?document:null,Zs=Xs&&Xs.createElement(`template`),Qs={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?Xs.createElementNS(Js,e):t===`mathml`?Xs.createElementNS(Ys,e):n?Xs.createElement(e,{is:n}):Xs.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>Xs.createTextNode(e),createComment:e=>Xs.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Xs.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{Zs.innerHTML=qs(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Zs.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},$s=`transition`,ec=`animation`,tc=Symbol(`_vtc`),nc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},rc=v({},fi,nc),ic=(e=>(e.displayName=`Transition`,e.props=rc,e))((e,{slots:t})=>Vs(gi,sc(e),t)),ac=(e,t=[])=>{S(e)?e.forEach(e=>e(...t)):e&&e(...t)},oc=e=>e?S(e)?e.some(e=>e.length>1):e.length>1:!1;function sc(e){let t={};for(let n in e)n in nc||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:u=s,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,m=cc(i),h=m&&m[0],g=m&&m[1],{onBeforeEnter:_,onEnter:y,onEnterCancelled:b,onLeave:x,onLeaveCancelled:S,onBeforeAppear:C=_,onAppear:w=y,onAppearCancelled:ee=b}=t,T=(e,t,n,r)=>{e._enterCancelled=r,dc(e,t?u:s),dc(e,t?l:o),n&&n()},E=(e,t)=>{e._isLeaving=!1,dc(e,d),dc(e,p),dc(e,f),t&&t()},te=e=>(t,n)=>{let i=e?w:y,o=()=>T(t,e,n);ac(i,[t,o]),fc(()=>{dc(t,e?c:a),uc(t,e?u:s),oc(i)||mc(t,r,h,o)})};return v(t,{onBeforeEnter(e){ac(_,[e]),uc(e,a),uc(e,o)},onBeforeAppear(e){ac(C,[e]),uc(e,c),uc(e,l)},onEnter:te(!1),onAppear:te(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>E(e,t);uc(e,d),e._enterCancelled?(uc(e,f),vc(e)):(vc(e),uc(e,f)),fc(()=>{e._isLeaving&&(dc(e,d),uc(e,p),oc(x)||mc(e,r,g,n))}),ac(x,[e,n])},onEnterCancelled(e){T(e,!1,void 0,!0),ac(b,[e])},onAppearCancelled(e){T(e,!0,void 0,!0),ac(ee,[e])},onLeaveCancelled(e){E(e),ac(S,[e])}})}function cc(e){if(e==null)return null;if(D(e))return[lc(e.enter),lc(e.leave)];{let t=lc(e);return[t,t]}}function lc(e){let t=be(e);return In(t,`<transition> explicit duration`),t}function uc(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[tc]||(e[tc]=new Set)).add(t)}function dc(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[tc];n&&(n.delete(t),n.size||(e[tc]=void 0))}function fc(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var pc=0;function mc(e,t,n,r){let i=e._endId=++pc,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=hc(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function hc(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${$s}Delay`),a=r(`${$s}Duration`),o=gc(i,a),s=r(`${ec}Delay`),c=r(`${ec}Duration`),l=gc(s,c),u=null,d=0,f=0;t===$s?o>0&&(u=$s,d=o,f=a.length):t===ec?l>0&&(u=ec,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?$s:ec:null,f=u?u===$s?a.length:c.length:0);let p=u===$s&&/\b(?:transform|all)(?:,|$)/.test(r(`${$s}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function gc(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>_c(t)+_c(e[n])))}function _c(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function vc(e){return(e?e.ownerDocument:document).body.offsetHeight}function yc(e,t,n){let r=e[tc];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var bc=Symbol(`_vod`),xc=Symbol(`_vsh`),Sc={name:`show`,beforeMount(e,{value:t},{transition:n}){e[bc]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):Cc(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Cc(e,!0),r.enter(e)):r.leave(e,()=>{Cc(e,!1)}):Cc(e,t))},beforeUnmount(e,{value:t}){Cc(e,t)}};function Cc(e,t){e.style.display=t?e[bc]:`none`,e[xc]=!t}var wc=Symbol(`CSS_VAR_TEXT`),Tc=/(?:^|;)\s*display\s*:/;function Ec(e,t,n){let r=e.style,i=E(n),a=!1;if(n&&!i){if(t)if(E(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??kc(r,t,``)}else for(let e in t)n[e]??kc(r,e,``);for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?kc(r,i,``):Nc(e,i,!E(t)&&t?t[i]:void 0,o)||kc(r,i,o)}}else if(i){if(t!==n){let e=r[wc];e&&(n+=`;`+e),r.cssText=n,a=Tc.test(n)}}else t&&e.removeAttribute(`style`);bc in e&&(e[bc]=a?r.display:``,e[xc]&&(r.display=`none`))}var Dc=/[^\\];\s*$/,Oc=/\s*!important$/;function kc(e,t,n){if(S(n))n.forEach(n=>kc(e,t,n));else if(n??=``,Dc.test(n)&&Ws(`Unexpected semicolon at the end of '${t}' style value: '${n}'`),t.startsWith(`--`))e.setProperty(t,n);else{let r=Mc(e,t);Oc.test(n)?e.setProperty(pe(r),n.replace(Oc,``),`important`):e[r]=n}}var Ac=[`Webkit`,`Moz`,`ms`],jc={};function Mc(e,t){let n=jc[t];if(n)return n;let r=O(t);if(r!==`filter`&&r in e)return jc[t]=r;r=me(r);for(let n=0;n<Ac.length;n++){let i=Ac[n]+r;if(i in e)return jc[t]=i}return t}function Nc(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&E(r)&&n===r}var Pc=`http://www.w3.org/1999/xlink`;function Fc(e,t,n,r,i,a=Ne(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(Pc,t.slice(6,t.length)):e.setAttributeNS(Pc,t,n):n==null||a&&!Pe(n)?e.removeAttribute(t):e.setAttribute(t,a?``:te(n)?String(n):n)}function Ic(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?qs(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=Pe(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch(e){o||Ws(`Failed setting prop "${t}" on <${a.toLowerCase()}>: value ${n} is invalid.`,e)}o&&e.removeAttribute(i||t)}function Lc(e,t,n,r){e.addEventListener(t,n,r)}function Rc(e,t,n,r){e.removeEventListener(t,n,r)}var zc=Symbol(`_vei`);function Bc(e,t,n,r,i=null){let a=e[zc]||(e[zc]={}),o=a[t];if(r&&o)o.value=Jc(r,t);else{let[n,s]=Uc(t);r?Lc(e,n,a[t]=qc(Jc(r,t),i),s):o&&(Rc(e,n,o,s),a[t]=void 0)}}var Vc=/(Once|Passive|Capture)$/,Hc=/^on:?(?:Once|Passive|Capture)$/;function Uc(e){let t,n;for(;(n=e.match(Vc))&&!Hc.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):pe(e.slice(2)),t]}var Wc=0,Gc=Promise.resolve(),Kc=()=>Wc||=(Gc.then(()=>Wc=0),Date.now());function qc(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(S(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&zn(e,t,5,a)}}else zn(r,t,5,[e])};return n.value=e,n.attached=Kc(),n}function Jc(e,t){return T(e)||S(e)?e:(Ws(`Wrong type passed as event handler to ${t} - did you forget @ or : in front of your prop?
|
|
115
|
-
Expected function or array of functions, received type ${typeof e}.`),m)}var Yc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Xc=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?yc(e,r,o):t===`style`?Ec(e,n,r):g(t)?_(t)||Bc(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):Zc(e,t,r,o))?(Ic(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&Fc(e,t,r,o,a,t!==`value`)):e._isVueCE&&(Qc(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!E(r)))?Ic(e,O(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Fc(e,t,r,o))};function Zc(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Yc(t)&&T(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return Yc(t)&&E(n)?!1:t in e}function Qc(e,t){let n=e._def.props;if(!n)return!1;let r=O(t);return Array.isArray(n)?n.some(e=>O(e)===r):Object.keys(n).some(e=>O(e)===r)}var $c=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return S(t)?e=>_e(t,e):t};function el(e){e.target.composing=!0}function tl(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var nl=Symbol(`_assign`);function rl(e,t,n){return t&&(e=e.trim()),n&&(e=ye(e)),e}var il={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[nl]=$c(i);let a=r||i.props&&i.props.type===`number`;Lc(e,t?`change`:`input`,t=>{t.target.composing||e[nl](rl(e.value,n,a))}),(n||a)&&Lc(e,`change`,()=>{e.value=rl(e.value,n,a)}),t||(Lc(e,`compositionstart`,el),Lc(e,`compositionend`,tl),Lc(e,`change`,tl))},mounted(e,{value:t}){e.value=t??``},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[nl]=$c(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ye(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},al={deep:!0,created(e,t,n){e[nl]=$c(n),Lc(e,`change`,()=>{let t=e._modelValue,n=ul(e),r=e.checked,i=e[nl];if(S(t)){let e=Le(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(w(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(dl(e,r))})},mounted:ol,beforeUpdate(e,t,n){e[nl]=$c(n),ol(e,t,n)}};function ol(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(S(t))i=Le(t,r.props.value)>-1;else if(w(t))i=t.has(r.props.value);else{if(t===n)return;i=Ie(t,dl(e,!0))}e.checked!==i&&(e.checked=i)}var sl={created(e,{value:t},n){e.checked=Ie(t,n.props.value),e[nl]=$c(n),Lc(e,`change`,()=>{e[nl](ul(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[nl]=$c(r),t!==n&&(e.checked=Ie(t,r.props.value))}},cl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,Lc(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ye(ul(e)):ul(e));e[nl](e.multiple?w(e._modelValue)?new Set(t):t:t[0]),e._assigning=!0,Xn(()=>{e._assigning=!1})}),e[nl]=$c(r)},mounted(e,{value:t}){ll(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[nl]=$c(n)},updated(e,{value:t}){e._assigning||ll(e,t)}};function ll(e,t){let n=e.multiple,r=S(t);if(n&&!r&&!w(t)){Ws(`<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(t).slice(8,-1)}.`);return}for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=ul(a);if(n)if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Le(t,o)>-1}else a.selected=t.has(o);else if(Ie(ul(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}function ul(e){return`_value`in e?e._value:e.value}function dl(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var fl={created(e,t,n){ml(e,t,n,null,`created`)},mounted(e,t,n){ml(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){ml(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){ml(e,t,n,r,`updated`)}};function pl(e,t){switch(e){case`SELECT`:return cl;case`TEXTAREA`:return il;default:switch(t){case`checkbox`:return al;case`radio`:return sl;default:return il}}}function ml(e,t,n,r,i){let a=pl(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}var hl=[`ctrl`,`shift`,`alt`,`meta`],gl={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>hl.some(n=>e[`${n}Key`]&&!t.includes(n))},q=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=gl[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},_l={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},vl=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=pe(n.key);if(t.some(e=>e===r||_l[e]===r))return e(n)}))},yl=v({patchProp:Xc},Qs),bl;function xl(){return bl||=Oo(yl)}var Sl=((...e)=>{let t=xl().createApp(...e);wl(t),Tl(t);let{mount:n}=t;return t.mount=e=>{let r=El(e);if(!r)return;let i=t._component;!T(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Cl(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function Cl(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function wl(e){Object.defineProperty(e.config,"isNativeTag",{value:e=>ke(e)||Ae(e)||je(e),writable:!1})}function Tl(e){if(ks()){let t=e.config.isCustomElement;Object.defineProperty(e.config,"isCustomElement",{get(){return t},set(){Ws("The `isCustomElement` config option is deprecated. Use `compilerOptions.isCustomElement` instead.")}});let n=e.config.compilerOptions,r='The `compilerOptions` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, `compilerOptions` must be passed to `@vue/compiler-dom` in the build setup instead.\n- For vue-loader: pass it via vue-loader\'s `compilerOptions` loader option.\n- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\n- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc';Object.defineProperty(e.config,"compilerOptions",{get(){return Ws(r),n},set(){Ws(r)}})}}function El(e){if(E(e)){let t=document.querySelector(e);return t||Ws(`Failed to mount app: mount target selector "${e}" returned null.`),t}return window.ShadowRoot&&e instanceof window.ShadowRoot&&e.mode===`closed`&&Ws('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),e}function Dl(){Hs()}Dl();var Ol=`cardbuddy:dev-service`,kl=typeof window<`u`&&(window.__CARD_DEV_PREVIEW_BASE__||window.__CARD_DEV_OFFLINE_BASE__)||``,Al={enabled:!1,baseUrl:`http://127.0.0.1:8787`,token:``},jl=new Set([`localhost`,`127.0.0.1`,`[::1]`,`::1`]);function Ml(){if(typeof window>`u`||!window.location)return!1;let{protocol:e,hostname:t}=window.location;return e!==`http:`&&e!==`https:`?!1:!jl.has(t)}function Nl(){try{let e=localStorage.getItem(Ol);if(e)return{...Al,...JSON.parse(e)}}catch{}return kl?{...Al,enabled:!0,baseUrl:kl,token:``}:{...Al}}function Pl(e){try{localStorage.setItem(Ol,JSON.stringify(e))}catch{}}function Fl(){if(kl)return kl.replace(/\/+$/,``);let e=Nl();return e.enabled&&e.baseUrl?e.baseUrl.replace(/\/+$/,``):Ml()?``:Al.baseUrl}function Il(){let e=Nl();return e.enabled&&e.token||``}async function J(e,t={}){let n=(Fl()||``)+e,r={...t.headers||{}},i=Il();return i&&(r[`x-dev-token`]=i),fetch(n,{...t,headers:r})}var Ll=new Map;function Rl(e){let t=Ll.get(e);if(!t){let n=Il(),r=new EventSource(e+`/__events`+(n?`?token=`+encodeURIComponent(n):``));t={es:r,states:new Set,refs:0},Ll.set(e,t),r.onopen=()=>{for(let e of t.states)e(`open`)},r.onerror=()=>{let e=r.readyState===2?`closed`:`connecting`;for(let n of t.states)n(e)}}return t.refs++,t}function zl(e,t){if(t.refs=Math.max(0,t.refs-1),t.refs===0&&Ll.get(e)===t){Ll.delete(e);try{t.es.close()}catch{}}}function Bl(e,{hmrEvents:t=[]}={}){return function(t,n){let r=Fl(),i=e=>{typeof n==`function`&&n(e)};if(r!==null){let n=Rl(r),a=e=>{try{t(e.data?JSON.parse(e.data):{})}catch{t({})}};for(let t of e)n.es.addEventListener(t,a);return n.states.add(i),i(n.es.readyState===1?`open`:n.es.readyState===2?`closed`:`connecting`),()=>{for(let t of e)n.es.removeEventListener(t,a);n.states.delete(i),zl(r,n)}}return()=>{}}}var Vl=Bl([`cards-changed`],{hmrEvents:[`cards-changed`]}),Hl=Bl([`code-bridge-changed`,`code-bridge-closed`]),Ul=Bl([`service-log`]);async function Wl({limit:e=300,since:t=0}={}){let n=new URLSearchParams({limit:String(e)});t&&n.set(`since`,String(t));let r=await J(`/__logs?`+n.toString());if(!r.ok)throw Error(`HTTP `+r.status);return r.json()}async function Gl(e,t=``){let n=await J(`/__code-bridge`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({code:e,label:t})});if(!n.ok)throw Error(`code-bridge open failed: ${n.status}`);return n.json()}async function Kl(e){let t=await J(`/__code-bridge/${e}`);if(!t.ok)throw Error(`code-bridge fetch failed: ${t.status}`);return t.json()}async function ql(e){return(await J(`/__code-bridge/${e}/heartbeat`,{method:`POST`})).ok}async function Jl(e){return(await J(`/__code-bridge/${e}`,{method:`DELETE`})).ok}var Yl={"@staticfile/":`/fastdfs/`,"@filestore/":`/minio/`,"@minio/":`/minio/`,"@floorstatic/":`/floorstatic/`,"@flamestore/":`/`},Xl=`https://uat-pkg.finmall.com`,Zl=Xl.replace(/^https?:/,``),Ql=[...new Set([Xl,Xl.replace(/^https:/,`http:`),Zl])];function $l(e){if(typeof e!=`string`||!e)return e;for(let t of Ql)if(e.startsWith(t))return e.slice(t.length)||`/`;return e}var eu=class{constructor(e={}){this.options={availableWidth:0,applyUnit:`px`,applyUnitRatio:1,fontRatio:1,styleWidth:375,apiBase:void 0,...e}}getSystemInfo(){let e=this.options;return{screenWidth:typeof window<`u`?window.innerWidth:e.styleWidth,availableWidth:e.availableWidth,applyUnit:e.applyUnit,applyUnitRatio:e.applyUnitRatio,fontRatio:e.fontRatio}}getDesignInfo(){return{styleWidth:this.options.styleWidth}}doReplaceUrl(e){if(typeof e!=`string`||/^https?:\/\//i.test(e))return e;let t=e;try{for(let e of Object.keys(Yl))t=t.replace(new RegExp(e,`g`),Yl[e])}catch{}let n=$l(t),r=this.options.apiBase===void 0?Fl():this.options.apiBase;return r&&typeof n==`string`&&n.startsWith(`/`)?r+n:n}doSize(e,t){if(!e&&e!==0)return``;if(e===`auto`||String(e).indexOf(`%`)>-1)return e;let n=this.getSystemInfo()||{},r=this.getDesignInfo()||{},i=String(e).replace(/[^0-9\-.]/g,``),a=1;if(n.availableWidth){t===`font`&&(a=Number(n.fontRatio||1));let e=parseFloat(n.availableWidth)/parseFloat(r.styleWidth);return parseFloat(i)*e*a+n.applyUnit}return i+n.applyUnit}doColor(e=``){let t=String(e);if(/^#[a-fA-F0-9]{8}$/.test(t)){let[e,n,r,i]=t.substring(1).match(/[a-fA-F0-9]{2}/g);return`rgba(${parseInt(n,16)}, ${parseInt(r,16)}, ${parseInt(i,16)}, ${parseInt(e,16)/100})`}return t}doRemoveUnit(e=``){return String(e).replace(/[^0-9.]/g,``)}doApplyUnit(e){return e+(this.getSystemInfo()||{}).applyUnit}doI18n(e){return e}async doRpc(){return{}}};function tu(e){if(Array.isArray(e))return e.map(tu);if(e&&typeof e==`object`){let t={};for(let n of Object.keys(e))t[n]=tu(e[n]);return t}return e}function nu(e){return tu(e||{})}function ru(e){if(e===null)return`null`;if(e===void 0)return`undefined`;let t=typeof e;if(t===`string`)return e;if(t===`number`||t===`boolean`||t===`bigint`)return String(e);if(t===`function`)return`[Function `+(e.name||`anonymous`)+`]`;try{return JSON.stringify(e)}catch{return String(e)}}var iu=[`customAction`,`listener`,`syncRemote`,`saveCard`,`refresh`];function au(e,t){let n=nn(e||{}),r=nn(nu(e)),i=nn({value:0}),a=nn({value:0}),o=!1,s=nn({value:0}),c=nn({value:0}),l=[],u={adapter:t,get rootScope(){return n},get state(){return r},setRootScope(e){let t=e||{};for(let e of Object.keys(n))delete n[e];Object.assign(n,t);let i=nu(t);for(let e of Object.keys(r))delete r[e];Object.assign(r,i),this.markDirty()},reseedState(){let e=nu(n);for(let e of Object.keys(r))delete r[e];Object.assign(r,e),this.markDirty()},get revision(){return i.value},get errorRev(){return a.value},get apiRev(){return s.value},get logRev(){return c.value},errors:[],eventErrors:[],eventLogs:[],apiCalls:[],listeners:{},markDirty(){i.value++},clearErrors(){this.errors.length=0,this.eventErrors.length=0,this.eventLogs.length=0,c.value++,this.scheduleErrorBump()},clearBindingErrors(){this.errors.length=0,this.scheduleErrorBump()},clearApiCalls(){this.apiCalls.length=0,s.value++},pushLog(e,t){let n=t||[],r=n.map(e=>ru(e)).join(` `);this.eventLogs.push({level:e,text:r,args:n,t:Date.now()}),this.eventLogs.length>500&&this.eventLogs.shift(),c.value++},clearEventLogs(){this.eventLogs.length=0,c.value++},pushError(e,t){let n=iu.includes(e)?this.eventErrors:this.errors;n.push({kind:e,msg:t,t:Date.now()}),n.length>500&&n.shift(),this.scheduleErrorBump()},scheduleErrorBump(){o||(o=!0,Xn(()=>{o=!1,a.value++}))},getBindingBuffer(){return l},startBindingPass(){l=[]},commitBindingPass(){let e=new Set,t=[];for(let n of l)e.has(n.msg)||(e.add(n.msg),t.push(n));this.errors.length=0;for(let e of t)this.errors.push(e);this.scheduleErrorBump()},pushApiCall(e,t){this.apiCalls.push({api:e,payload:t,t:Date.now()}),this.apiCalls.length>500&&this.apiCalls.shift(),s.value++},addEventListener(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},postMessage(e,t){let n=this.listeners[e]||[],r={data:t,type:e};n.forEach(t=>{try{t(r)}catch(t){this.pushError(`listener`,`${e}: ${t&&t.message}`)}}),this.pushApiCall(`postMessage:`+e,t)}};return Wr(()=>n,()=>u.reseedState(),{deep:!0}),u}var ou=0,su=e=>`${e}_${(++ou).toString(36)}`,cu={const:`0`,var:`1`,image:`2`},lu={Delete:`1`,Append:`2`},uu=e=>e===void 0?e:JSON.parse(JSON.stringify(e)),du=class e{constructor(t=[],n={}){this.id=su(`propgroup`),this.properties=(t||[]).map(e=>new Y(e)),e.setPropertyValue(this.properties,n)}static setPropertyValue(e=[],t={}){t&&e.forEach(e=>{e.itemVisible&&e.itemKey&&t[e.itemKey]!==void 0&&e.itemValueFrom===`0`&&(e.itemValue=t[e.itemKey])})}onRestore(e={},t,n,r){Y.restoreProperty(e.properties||[],this.properties,t,n,r)}onPreview(e){return this.properties.reduce((t,n)=>{let r=n.onPreview(e);return r&&Object.assign(t,r),t},{})}onExport(e){return{properties:this.properties.reduce((t,n)=>{if(!e||e.itemId===n.itemId){let r=n.onExport(e&&e.child);r&&t.push(r)}return t},[])}}},Y=class e{constructor(e={}){this.id=su(`prop`);let t=uu(e)||{};this.itemId=t.itemId,this.itemName=t.itemName,this.itemType=t.itemType,this.itemKey=t.itemKey,this.itemOption=t.itemOption||{},this.itemParam=t.itemParam||{},this.itemDefaultValue=t.itemDefaultValue===void 0?null:t.itemDefaultValue,this.itemDesc=t.itemDesc,this.itemCondition=t.itemCondition,this.itemWatch=t.itemWatch||{},this.itemTypeRange=t.itemTypeRange||`const,var`,this.itemDirection=t.itemDirection,this.itemVisible=!0,this.itemUpdated=!1,this.itemValueFrom=cu[String(this.itemTypeRange).split(/,/)[0]],this._itemValueFrom=this.itemValueFrom;let n=uu(this.itemDefaultValue);this.itemChildren=new du(t.itemChildren||[],n),this.itemTemplate=t.itemTemplate||t.itemList||[],this.itemList=[],!this.itemChildren.properties.length&&Object.keys(this.itemTemplate).length&&this.initItemList(n),this.initItemValue(n),this._valuesByFrom={0:void 0,1:void 0,2:void 0},this._valuesByFrom[this.itemValueFrom]=this.itemValue}initItemValue(e,t=!1){this.itemValue=this.itemValueFrom===`1`||this.itemValueFrom===`2`?t?e:``:this.itemChildren.properties.length?{}:Object.keys(this.itemTemplate).length?[]:e}initItemList(e){let t=e||[];Array.isArray(t)&&t.forEach(e=>this.addItems(e))}addItems(e,t){let n=this.itemOption?.templateField||``;if(this.itemChildren.properties.length)return;let r=e?e[n]:``,i=new du(n?this.itemTemplate[r]||[]:this.itemTemplate||[],e||{});return t&&t(i),this.itemList.push(i),i}removeAt(e){this.itemChildren.properties.length||e>=0&&e<this.itemList.length&&this.itemList.splice(e,1)}moveItem(e,t){if(this.itemChildren.properties.length||e<0||e>=this.itemList.length||(t=Math.max(0,Math.min(this.itemList.length-1,t)),e===t))return;let[n]=this.itemList.splice(e,1);this.itemList.splice(t,0,n)}onRestore(e={},t,n={},r=[]){if(!Object.keys(e).length)return;let i=[].concat(r);i.push(this.itemId),e.itemValueFrom!==void 0&&(this.itemValueFrom=e.itemValueFrom),this.initItemValue(e.itemValue,!0),this._valuesByFrom={0:void 0,1:void 0,2:void 0},this._valuesByFrom[this.itemValueFrom]=this.itemValue,this.itemChildren.onRestore(e.itemChildren||{},t,n,i),this.itemList=[];let a=Array.isArray(e.itemValue)?e.itemValue:[];a.length||!e.itemList?a.forEach(e=>this.addItems(e||{})):Array.isArray(e.itemList)&&e.itemList.forEach(e=>{let r=this.addItems({});r&&r.onRestore(e,t,n,i)})}onPreview(e){let t={},n=e?e.paths:[],r=!!(n&&n.length),i=r?e.vars:{},a=[].concat(n||[]);return this.itemVisible&&this.itemKey&&(this.itemValueFrom===`0`?this.itemChildren.properties.length>0?(a.push(this.itemKey),t[this.itemKey]=this.itemChildren.onPreview({paths:a,vars:i})):this.itemList.length>0?(a.push(this.itemKey),t[this.itemKey]=this.itemList.map((e,t)=>{let n=[].concat(a);return n.push(t),e.onPreview({paths:n,vars:i})})):t[this.itemKey]=this.itemValue:this.itemValueFrom===`1`?(t[this.itemKey]=this.itemDefaultValue,this.itemValue&&(a.push(this.itemKey),i[a.join(`.`)]=this.itemValue)):this.itemValueFrom===`2`&&(t[this.itemKey]=this.itemValue)),r||(t.__vars__=i),t}onExport(e){if(!this.itemVisible||this.itemKey===void 0||this.itemKey===null)return;let t=this.itemChildren.onExport(e),n=this.itemList.map(t=>t.onExport(e)),r={};return this.itemValueFrom===`1`&&(r.itemDefaultValue=this.itemDefaultValue),t&&t.properties.length?r.itemChildren=t:n.length&&(r.itemList=n),{itemId:this.itemId,itemKey:this.itemKey,itemValueFrom:this.itemValueFrom,itemValue:this.itemValue,...r}}static mergePreview(e={},t={}){let n=e.__vars__,r=t.__vars__;return r?Object.assign(e,t,{__vars__:Object.assign({},n,r)}):Object.assign(e,r)}static restoreProperty(e=[],t=[],n,r={},i){if(r||={},!e.length||!t.length)return;let a={},o=(e||[]).reduce((e,t)=>{let n=t.itemId||t.itemKey;return n&&(e[n]=t,a[n]=t),e},{});for(let e=0;e<t.length;e++){let s=t[e],c=o[s.itemId]||o[s.itemKey];c?(delete a[s.itemId],delete a[s.itemKey],s.onRestore(c,n,{},i),s.itemUpdated=!0,r.restore&&r.restore(s)):n===lu.Delete&&(t.splice(e--,1),r.delete&&r.delete(s))}if(n===lu.Append)for(let e in a)r.append&&r.append(a[e],t,[].concat(i||[]))}static updatePropertyVisible(t=[]){let n=t||[],r=e._conditionData(n);n.forEach(t=>{t.itemVisible=!/\./.test(t.itemCondition)||e._conditionResult(t.itemCondition,r),e.updatePropertyVisible(t.itemChildren.properties),t.itemList.forEach(t=>e.updatePropertyVisible(t.properties))})}static _conditionData(e){return e.reduce((e,t)=>{let n=`${t.itemCondition||``}`;return n&&n.split(`.`).length%2==1&&(e[n]=t.itemValue),e},{})}static _conditionResult(e=``,t={}){let n=!0,r=e.split(`.`);for(let e=0;e<r.length-1;e+=2){let i=r.slice(0,e+1).join(`.`),a=r[e+1],o=!1;/^!/.test(a)&&(o=!0,a=a.substring(1));let s=a.split(`|`);n=!1;for(let e=0;e<s.length;e++)if(t[i]==s[e]){n=!0;break}if(o&&(n=!n),!n)break}return n}},fu={_source:`uat-pkg.finmall.com /ubomp-h5-sub/inner_card/js/6.5c0327ab.js module 931(组件分组清单)`,_note:`metaInfo 精简版:className / name / group / style.state / style.visible / style.meta / properties / slots / events。skeleton(SVG 缩略图) 已剔除。style.state 是组件的默认样式初始值,Style.onRestore 会先用它建组,再用 schema 的 style.properties 合并覆盖。`,groups:[`布局组件`,`基础组件`],components:JSON.parse('{"Row":{"className":"Row","name":"行","group":"布局组件","styleState":{"rect":{"width":"100%"},"flex":{"gap":"4","alignItems":"center"}},"styleVisible":{"rect":true,"background":true,"flex":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{"flex":{"justifyContent":{"itemName":"水平对齐"},"alignItems":{"itemName":"垂直对齐"}}},"properties":[],"slots":[{"slotKey":"default","slotName":"容器组件插槽","slotWidth":"100%","slotHeight":"100%","slotSwitch":"1"}],"events":[{"eventName":"点击事件","eventKey":"click"}]},"Column":{"className":"Column","name":"列","group":"布局组件","styleState":{"rect":{"width":"100%"},"flex":{"gap":"4","flexDirection":"column","justifyContent":"center"}},"styleVisible":{"rect":true,"background":true,"flex":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[],"slots":[{"slotKey":"default","slotName":"容器组件插槽","slotWidth":"100%","slotHeight":"100%","slotSwitch":"1"}],"events":[{"eventName":"点击事件","eventKey":"click"}]},"MultiColumn":{"className":"MultiColumn","name":"多列布局","group":"布局组件","styleState":{"rect":{"width":"100%"},"flex":{"gap":"12"}},"styleVisible":{"rect":true,"background":true,"flex":{"gap":true,"flexShrink":true},"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[],"slots":[{"slotKey":"default","slotName":"容器组件插槽","slotWidth":"100%","slotHeight":"100%","slotSwitch":"1"}],"events":[{"eventName":"点击事件","eventKey":"click"}]},"ListLayout":{"className":"ListLayout","name":"列表布局","group":"布局组件","styleState":{"rect":{"width":"100%","height":"auto"}},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"background":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"数据源","itemKey":"value","itemTypeRange":"var","itemOption":{},"itemDefaultValue":[{},{},{},{}]},{"itemId":"006","itemName":"方向","itemKey":"direction","itemTypeRange":"const","itemType":"TabSelect","itemOption":{"iParamList":[{"key":"vertical","value":"纵向"},{"key":"horizontal","value":"横向"}]},"itemDefaultValue":"vertical"},{"itemId":"003","itemName":"元素间距","itemKey":"row-spacing","itemTypeRange":"const","itemType":"InputNumber","itemOption":{},"itemDefaultValue":12},{"itemId":"005","itemName":"内边距","itemKey":"edge-insets","itemTypeRange":"const","itemType":"PaddingStyle","itemOption":{},"itemDefaultValue":"{2,2,2,2}"}],"slots":[{"slotKey":"default","slotName":"容器组件插槽","slotScope":true,"slotWidth":"100%","slotHeight":"100%","slotSwitch":"1"}],"events":[{"eventName":"点击事件","eventKey":"click"}]},"GridLayout":{"className":"GridLayout","name":"网格布局","group":"布局组件","styleState":{"rect":{"width":"100%","height":"auto"}},"styleVisible":{"rect":true,"background":true,"flex":{"flexShrink":true},"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"数据源","itemKey":"value","itemTypeRange":"var","itemOption":{},"itemDefaultValue":[{},{},{},{}]},{"itemId":"002","itemName":"列数目","itemKey":"column","itemTypeRange":"const","itemType":"InputNumber","itemOption":{},"itemDefaultValue":2},{"itemId":"003","itemName":"行间距","itemKey":"row-spacing","itemTypeRange":"const","itemType":"InputNumber","itemOption":{},"itemDefaultValue":12},{"itemId":"004","itemName":"列间距","itemKey":"item-spacing","itemTypeRange":"const","itemType":"InputNumber","itemOption":{},"itemDefaultValue":4},{"itemId":"005","itemName":"内边距","itemKey":"edge-insets","itemTypeRange":"const","itemType":"PaddingStyle","itemOption":{},"itemDefaultValue":"{2,2,2,2}"}],"slots":[{"slotKey":"default","slotName":"容器组件插槽","slotScope":true,"slotWidth":"100%","slotHeight":"100%","slotSwitch":"1"}],"events":[{"eventName":"点击事件","eventKey":"click"}]},"AbsoluteLayout":{"className":"AbsoluteLayout","name":"绝对布局","group":"布局组件","styleState":{"rect":{"width":"100%","height":"100"}},"styleVisible":{"flex":{"flexShrink":true},"rect":true,"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"对齐方式","itemKey":"align","itemTypeRange":"const","itemType":"PositionStyle","itemOption":{},"itemDefaultValue":""}],"slots":[{"slotKey":"default","slotName":"容器组件插槽","slotWidth":"100%","slotHeight":"100%","slotSwitch":"1"}],"events":[]},"Text":{"className":"Text","name":"文本","group":"基础组件","styleState":{},"styleVisible":{"font":true,"rect":true,"flex":{"flexShrink":true},"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{"rect":{"width":{"itemOption":{"iTypeList":[{"key":"percent","value":"%"},{"key":"number","value":"px"}]}}}},"properties":[{"itemId":"001","itemName":"内容","itemKey":"value","itemType":"Textarea","itemDefaultValue":"这是一个文本"},{"itemId":"002","itemName":"常用样式","itemTypeRange":"const","itemType":"CustomSelect","itemOption":{"list":[{"type":"div","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","marginRight":"8px","cursor":"pointer"},"list":[{"type":"span","innerText":"黑色","style":{"fontSize":"14px","color":"#333333"}}],"sync":{"style.font.color":"#333333","style.font.fontWeight":"400","style.font.fontSize":"14","style.background.backgroundType":"00","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"","style.padding.paddingType":""}},{"type":"div","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","marginRight":"8px","cursor":"pointer"},"list":[{"type":"span","innerText":"灰色","style":{"fontSize":"14px","color":"#555555"}}],"sync":{"style.font.color":"#555555","style.font.fontWeight":"400","style.font.fontSize":"14","style.background.backgroundType":"00","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"","style.padding.paddingType":""}},{"type":"div","innerText":"淡灰色","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","marginRight":"8px","cursor":"pointer"},"list":[{"type":"span","innerText":"淡灰色","style":{"fontSize":"14px","color":"#999999"}}],"sync":{"style.font.color":"#999999","style.font.fontWeight":"400","style.font.fontSize":"14","style.background.backgroundType":"00","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"","style.padding.paddingType":""}},{"type":"div","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","marginRight":"8px","cursor":"pointer"},"list":[{"type":"span","innerText":"热门","style":{"fontSize":"10px","backgroundColor":"#ff0000","borderRadius":"4px","padding":"1px 5px","color":"#ffffff"}}],"sync":{"style.font.color":"#ffffff","style.font.fontWeight":"400","style.font.fontSize":"10","style.background.backgroundType":"01","style.background.backgroundColor":"#ff0000","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"4","style.padding.paddingType":"1","style.padding.paddingLeft":"5","style.padding.paddingTop":"1","style.padding.paddingRight":"5","style.padding.paddingBottom":"1"}},{"type":"div","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","marginRight":"8px","cursor":"pointer"},"list":[{"type":"span","innerText":"热销","style":{"fontSize":"10px","backgroundColor":"#ff0000","borderRadius":"100px","padding":"1px 5px","color":"#ffffff"}}],"sync":{"style.font.color":"#ffffff","style.font.fontWeight":"400","style.font.fontSize":"10","style.background.backgroundType":"01","style.background.backgroundColor":"#ff0000","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"100","style.padding.paddingType":"1","style.padding.paddingLeft":"5","style.padding.paddingTop":"1","style.padding.paddingRight":"5","style.padding.paddingBottom":"1"}},{"type":"div","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","marginRight":"8px","cursor":"pointer"},"list":[{"type":"span","innerText":"理财","style":{"fontSize":"12px","backgroundColor":"#F1F4FE","borderRadius":"4px","padding":"2px 8px","color":"#90969E"}}],"sync":{"style.font.color":"#90969E","style.font.fontWeight":"400","style.font.fontSize":"12","style.background.backgroundType":"01","style.background.backgroundColor":"#F1F4FE","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"4","style.padding.paddingType":"1","style.padding.paddingLeft":"8","style.padding.paddingTop":"2","style.padding.paddingRight":"8","style.padding.paddingBottom":"2"}},{"type":"div","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","marginRight":"8px","cursor":"pointer"},"list":[{"type":"span","innerText":"存款","style":{"fontSize":"14px","border":"1px solid #8A8A8A","borderRadius":"4px","padding":"1px 4px","color":"#545356"}}],"sync":{"style.font.color":"#545356","style.font.fontWeight":"400","style.font.fontSize":"14","style.background.backgroundType":"00","style.border.isBorder":"1","style.border.borderWidth":"1","style.border.borderColor":"#8A8A8A","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"4","style.padding.paddingType":"1","style.padding.paddingLeft":"4","style.padding.paddingTop":"1","style.padding.paddingRight":"4","style.padding.paddingBottom":"1"}},{"type":"div","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","marginRight":"8px","cursor":"pointer"},"list":[{"type":"span","innerText":"240","style":{"fontSize":"22px","color":"#ff0000","fontWeight":"600"}}],"sync":{"style.font.color":"#ff0000","style.font.fontWeight":"600","style.font.fontSize":"22","style.background.backgroundType":"00","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"","style.padding.paddingType":""}}]}}],"slots":[],"events":[{"eventName":"点击事件","eventKey":"click"}]},"Button":{"className":"Button","name":"按钮","group":"基础组件","styleState":{"font":{"color":"#ffffff","fontSize":"16"},"background":{"backgroundType":"01","backgroundColor":"#0079f2"},"borderRadius":{"borderRadiusType":"0","borderRadius":"100"},"rect":{"width":"120","height":"40"}},"styleVisible":{"font":{"color":true,"fontSize":true,"fontWeight":true},"rect":true,"flex":{"flexShrink":true},"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"按钮文字","itemKey":"value","itemType":"Input","itemDefaultValue":"确定"},{"itemId":"002","itemName":"常用样式","itemTypeRange":"const","itemType":"CustomSelect","itemOption":{"list":[{"type":"div","innerText":"确定","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","borderRadius":"20px","fontSize":"12px","marginRight":"8px","cursor":"pointer","color":"#fff","backgroundColor":"#0079f2"},"sync":{"style.font.color":"#ffffff","style.font.fontSize":"16","style.background.backgroundType":"01","style.background.backgroundColor":"#0079f2","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"100"}},{"type":"div","innerText":"确定","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","borderRadius":"20px","fontSize":"12px","marginRight":"8px","cursor":"pointer","color":"#fff","backgroundColor":"#f3464a"},"sync":{"style.font.color":"#ffffff","style.font.fontSize":"16","style.background.backgroundType":"01","style.background.backgroundColor":"#f3464a","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"100"}},{"type":"div","innerText":"确定","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","borderRadius":"20px","fontSize":"12px","marginRight":"8px","cursor":"pointer","color":"#0079f2","backgroundColor":"#ffffff","border":"1px solid #0079f2"},"sync":{"style.font.color":"#0079f2","style.font.fontSize":"16","style.background.backgroundType":"01","style.background.backgroundColor":"#ffffff","style.border.isBorder":"1","style.border.borderWidth":"1","style.border.borderStyle":"solid","style.border.borderColor":"#0079f2","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"100"}},{"type":"div","innerText":"确定","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","borderRadius":"20px","fontSize":"12px","marginRight":"8px","cursor":"pointer","color":"#555","backgroundColor":"#f0ead2"},"sync":{"style.font.color":"#555555","style.font.fontSize":"16","style.background.backgroundType":"01","style.background.backgroundColor":"#f0ead2","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"100"}},{"type":"div","innerText":"确定","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","borderRadius":"20px","fontSize":"12px","marginRight":"8px","cursor":"pointer","color":"#f3474b","backgroundColor":"#fff0f1"},"sync":{"style.font.color":"#f3474b","style.font.fontSize":"16","style.background.backgroundType":"01","style.background.backgroundColor":"#fff0f1","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"100"}},{"type":"div","innerText":"确定","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","borderRadius":"20px","fontSize":"12px","marginRight":"8px","cursor":"pointer","color":"#9a9a9a","backgroundColor":"#e6e6e6"},"sync":{"style.font.color":"#9a9a9a","style.font.fontSize":"16","style.background.backgroundType":"01","style.background.backgroundColor":"#e6e6e6","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"100"}},{"type":"div","innerText":"确定","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","fontSize":"15px","marginRight":"8px","cursor":"pointer","color":"#0079F2"},"sync":{"style.font.color":"#0079F2","style.font.fontSize":"15","style.background.backgroundType":"00","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"","style.rect.width":"100%","style.rect.height":"40"}}]}},{"itemId":"003","itemName":"禁用按钮","itemKey":"disabled","itemTypeRange":"const,var","itemType":"BooleanForm","itemOption":{"activeText":"启用","inactiveText":"禁用"},"itemDefaultValue":false}],"slots":[],"events":[{"eventName":"点击事件","eventKey":"click"}]},"Image":{"className":"Image","name":"图片","group":"基础组件","styleState":{"rect":{"width":"72","height":"72"}},"styleVisible":{"image":true,"flex":{"flexShrink":true},"rect":true,"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{"rect":{"width":{"itemOption":{"iTypeList":[{"key":"percent","value":"%"},{"key":"number","value":"px"}]}}}},"properties":[{"itemId":"001","itemName":"图片地址","itemKey":"value","itemTypeRange":"image,var","itemDefaultValue":""}],"slots":[],"events":[{"eventName":"点击事件","eventKey":"click"}]},"Icon":{"className":"Icon","name":"图标","group":"基础组件","styleState":{"rect":{"width":"32","height":"32"}},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{"rect":{"width":{"itemOption":{"iTypeList":[{"key":"number","value":"px"},{"key":"percent","value":"%"}]}},"height":{"itemOption":{"iTypeList":[{"key":"number","value":"px"}]}}}},"properties":[{"itemId":"001","itemName":"图标","itemKey":"icon","itemTypeRange":"const,var","itemType":"IconSelect","itemOption":{"type":"svg","width":"16","height":"16","image":"/ubomp-h5-sub/inner_card/svg/svg-symbols.9f0f35b.svg","iIconList":[{"key":"sousuo","value":"sousuo","name":"sousuo"},{"key":"gengduo","value":"gengduo","name":"gengduo"},{"key":"saoyisao","value":"saoyisao","name":"saoyisao"},{"key":"shanchu","value":"shanchu","name":"shanchu"},{"key":"shaixuan","value":"shaixuan","name":"shaixuan"},{"key":"shezhi","value":"shezhi","name":"shezhi"},{"key":"shengyin","value":"shengyin","name":"shengyin"},{"key":"shengyinguanbi","value":"shengyinguanbi","name":"shengyinguanbi"},{"key":"aixin","value":"aixin","name":"aixin"},{"key":"aixin_1","value":"aixin_1","name":"aixin_1"},{"key":"shoucang","value":"shoucang","name":"shoucang"},{"key":"shoucang_1","value":"shoucang_1","name":"shoucang_1"},{"key":"dianzan","value":"dianzan","name":"dianzan"},{"key":"dianzan_1","value":"dianzan_1","name":"dianzan_1"},{"key":"yanjing","value":"yanjing","name":"yanjing"},{"key":"yanjing_1","value":"yanjing_1","name":"yanjing_1"},{"key":"yanjing_hide","value":"yanjing_hide","name":"yanjing_hide"},{"key":"zengjia","value":"zengjia","name":"zengjia"},{"key":"zengjia_1","value":"zengjia_1","name":"zengjia_1"},{"key":"xiangji","value":"xiangji","name":"xiangji"},{"key":"xiangji_1","value":"xiangji_1","name":"xiangji_1"},{"key":"chenggong","value":"chenggong","name":"chenggong"},{"key":"chenggong_1","value":"chenggong_1","name":"chenggong_1"},{"key":"shibai","value":"shibai","name":"shibai"},{"key":"shibai_1","value":"shibai_1","name":"shibai_1"},{"key":"shijian","value":"shijian","name":"shijian"},{"key":"shijian_1","value":"shijian_1","name":"shijian_1"},{"key":"dianhua","value":"dianhua","name":"dianhua"},{"key":"dianhua_1","value":"dianhua_1","name":"dianhua_1"},{"key":"angle_left","value":"angle_left","name":"angle_left"},{"key":"angle_right","value":"angle_right","name":"angle_right"},{"key":"angle_up","value":"angle_up","name":"angle_up"},{"key":"angle_down","value":"angle_down","name":"angle_down"},{"key":"arrow_left","value":"arrow_left","name":"arrow_left"},{"key":"arrow_right","value":"arrow_right","name":"arrow_right"},{"key":"long_arrow_up","value":"long_arrow_up","name":"long_arrow_up"},{"key":"long_arrow_down","value":"long_arrow_down","name":"long_arrow_down"},{"key":"caret_left","value":"caret_left","name":"caret_left"},{"key":"caret_right","value":"caret_right","name":"caret_right"},{"key":"sort_up","value":"sort_up","name":"sort_up"},{"key":"sort_down","value":"sort_down","name":"sort_down"},{"key":"ditu","value":"ditu","name":"ditu"},{"key":"fuzhi","value":"fuzhi","name":"fuzhi"},{"key":"check","value":"check","name":"check"},{"key":"times","value":"times","name":"times"},{"key":"weixuanzhong","value":"weixuanzhong","name":"weixuanzhong"},{"key":"switch","value":"switch","name":"switch"},{"key":"tanhao","value":"tanhao","name":"tanhao"},{"key":"tanhao_1","value":"tanhao_1","name":"tanhao_1"},{"key":"jianshao","value":"jianshao","name":"jianshao"},{"key":"jianshao_1","value":"jianshao_1","name":"jianshao_1"},{"key":"pinglun","value":"pinglun","name":"pinglun"},{"key":"pinglun_1","value":"pinglun_1","name":"pinglun_1"},{"key":"shandian","value":"shandian","name":"shandian"},{"key":"shandian_1","value":"shandian_1","name":"shandian_1"},{"key":"shequ","value":"shequ","name":"shequ"},{"key":"shequ_1","value":"shequ_1","name":"shequ_1"},{"key":"shouji","value":"shouji","name":"shouji"},{"key":"shouji_1","value":"shouji_1","name":"shouji_1"},{"key":"shouye","value":"shouye","name":"shouye"},{"key":"shouye_1","value":"shouye_1","name":"shouye_1"},{"key":"shuju","value":"shuju","name":"shuju"},{"key":"shuju_1","value":"shuju_1","name":"shuju_1"},{"key":"wode","value":"wode","name":"wode"},{"key":"wode_1","value":"wode_1","name":"wode_1"},{"key":"yingchengka","value":"yingchengka","name":"yingchengka"},{"key":"yingchengka_1","value":"yingchengka_1","name":"yingchengka_1"},{"key":"yinhangka","value":"yinhangka","name":"yinhangka"},{"key":"yinhangyouhui","value":"yinhangyouhui","name":"yinhangyouhui"},{"key":"youhuiquan","value":"youhuiquan","name":"youhuiquan"},{"key":"youhuiquan_1","value":"youhuiquan_1","name":"youhuiquan_1"},{"key":"tuipiao","value":"tuipiao","name":"tuipiao"},{"key":"yulebao","value":"yulebao","name":"yulebao"},{"key":"anquan","value":"anquan","name":"anquan"},{"key":"bangzhu","value":"bangzhu","name":"bangzhu"},{"key":"bianji","value":"bianji","name":"bianji"},{"key":"bofangjilu","value":"bofangjilu","name":"bofangjilu"},{"key":"buganxingqu","value":"buganxingqu","name":"buganxingqu"},{"key":"chuangzuo","value":"chuangzuo","name":"chuangzuo"},{"key":"diantong_guan","value":"diantong_guan","name":"diantong_guan"},{"key":"dianying","value":"dianying","name":"dianying"},{"key":"dianyingpiao","value":"dianyingpiao","name":"dianyingpiao"},{"key":"dingdan","value":"dingdan","name":"dingdan"},{"key":"dingwei","value":"dingwei","name":"dingwei"},{"key":"faxian","value":"faxian","name":"faxian"},{"key":"fenxiang","value":"fenxiang","name":"fenxiang"},{"key":"gonggao","value":"gonggao","name":"gonggao"},{"key":"huati","value":"huati","name":"huati"},{"key":"huiyuan","value":"huiyuan","name":"huiyuan"},{"key":"lihe","value":"lihe","name":"lihe"},{"key":"mima","value":"mima","name":"mima"},{"key":"nan","value":"nan","name":"nan"},{"key":"nv","value":"nv","name":"nv"},{"key":"paihangbang","value":"paihangbang","name":"paihangbang"},{"key":"pengyouquan","value":"pengyouquan","name":"pengyouquan"},{"key":"remen","value":"remen","name":"remen"},{"key":"rili","value":"rili","name":"rili"},{"key":"search_minus","value":"search_minus","name":"search_minus"},{"key":"search_plus","value":"search_plus","name":"search_plus"},{"key":"shangchuan","value":"shangchuan","name":"shangchuan"},{"key":"shuaxin","value":"shuaxin","name":"shuaxin"},{"key":"taolunqu","value":"taolunqu","name":"taolunqu"},{"key":"tishi","value":"tishi","name":"tishi"},{"key":"tupian","value":"tupian","name":"tupian"},{"key":"weixin","value":"weixin","name":"weixin"},{"key":"wenda","value":"wenda","name":"wenda"},{"key":"wenjuan","value":"wenjuan","name":"wenjuan"},{"key":"wifi","value":"wifi","name":"wifi"},{"key":"wodeguanzhu","value":"wodeguanzhu","name":"wodeguanzhu"},{"key":"xiangkan","value":"xiangkan","name":"xiangkan"},{"key":"xiaoxi","value":"xiaoxi","name":"xiaoxi"},{"key":"xiaoxizhongxin","value":"xiaoxizhongxin","name":"xiaoxizhongxin"},{"key":"xiazai","value":"xiazai","name":"xiazai"},{"key":"yixiangkan","value":"yixiangkan","name":"yixiangkan"},{"key":"zhibo","value":"zhibo","name":"zhibo"},{"key":"zhiwen","value":"zhiwen","name":"zhiwen"}]},"itemDefaultValue":"angle_right"},{"itemId":"002","itemName":"图标颜色","itemKey":"color","itemTypeRange":"const,var","itemType":"Color","itemDefaultValue":"#a5afbc"},{"itemId":"003","itemName":"自定义图标","itemKey":"content","itemTypeRange":"const,var","itemType":"Textarea","itemOption":{"placeholder":"请输入svg文件内容","autosize":{"minRows":1,"maxRows":4}},"itemDefaultValue":""}],"slots":[],"events":[{"eventName":"点击事件","eventKey":"click"}]},"MultiText":{"className":"MultiText","name":"多文本","group":"基础组件","styleState":{},"styleVisible":{"font":{"lineHeight":true,"textAlign":true},"rect":true,"flex":{"justifyContent":true,"alignItems":true,"flexShrink":true},"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"文本列表","itemKey":"textList","itemTypeRange":"const","itemType":"List","itemOption":{"type":"editor","iFieldList":[{"key":"value","value":"内容"},{"key":"color","value":"颜色"},{"key":"fontSize","value":"大小"}],"btnText":"添加文本"},"itemDefaultValue":[{"value":"这是一个文本"}],"itemList":[{"itemId":"001","itemName":"文本内容","itemKey":"value","itemTypeRange":"const,var","itemType":"Input","itemDefaultValue":"这是一个文本"},{"itemId":"002","itemName":"字体颜色","itemKey":"color","itemTypeRange":"const","itemType":"Color","itemDefaultValue":"#000000"},{"itemId":"003","itemName":"字体大小","itemKey":"fontSize","itemTypeRange":"const","itemType":"InputNumber","itemOption":{"mode-mini":{"style":{"width":"50px"}}},"itemDefaultValue":"14"},{"itemId":"004","itemName":"字体权重","itemKey":"fontWeight","itemTypeRange":"const","itemType":"TabSelect","itemOption":{"size":"mini","iParamList":[{"key":"400","value":"常规"},{"key":"500","value":"中等"},{"key":"600","value":"加粗"}]},"itemDefaultValue":"400"},{"itemId":"005","itemName":"字体样式","itemKey":"fontStyle","itemTypeRange":"const","itemType":"FontStyle","itemOption":{},"itemDefaultValue":"normal"},{"itemId":"006","itemName":"字体样式","itemKey":"textDecoration","itemTypeRange":"const","itemType":"TextDecorationStyle","itemOption":{},"itemDefaultValue":"none"},{"itemId":"007","itemName":"字体背景色","itemKey":"backgroundColor","itemTypeRange":"const","itemType":"Color","itemOption":{},"itemDefaultValue":""},{"itemId":"008","itemName":"事件标识码","itemKey":"tag","itemTypeRange":"const","itemType":"Input","itemOption":{"placeholder":"用于点击事件中区分不同文本"},"itemDefaultValue":""}]}],"slots":[],"events":[{"eventName":"点击事件","eventKey":"click"}]},"Canvas":{"className":"Canvas","name":"画布","group":"基础组件","styleState":{"rect":{"width":"100%"}},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[],"slots":[],"events":[{"eventName":"初始化渲染","eventKey":"onMeasured","includes":["customAction"]}]},"Input":{"className":"Input","name":"输入框","group":"基础组件","styleState":{"rect":{"width":"100%","height":"35"},"background":{"backgroundType":"01","backgroundColor":"#FFFFFF"}},"styleVisible":{"font":{"textAlign":true,"fontSize":true,"fontWeight":true,"color":true},"flex":{"flexShrink":true},"rect":true,"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"绑定变量","itemKey":"value","itemTypeRange":"var","itemDefaultValue":""},{"itemId":"002","itemName":"占位符","itemKey":"placeholder","itemTypeRange":"const,var","itemType":"Input","itemDefaultValue":"请输入"},{"itemId":"003","itemName":"类型","itemKey":"inputType","itemTypeRange":"const,var","itemType":"Select","itemOption":{"iParamList":[{"key":"text","value":"普通文本"},{"key":"number","value":"数字"},{"key":"email","value":"邮箱"},{"key":"password","value":"密码"},{"key":"phone","value":"手机号"}]},"itemDefaultValue":"text"},{"itemId":"004","itemName":"最大长度","itemKey":"maxLength","itemTypeRange":"const,var","itemType":"InputNumber","itemOption":{"type":"+integer"},"itemDefaultValue":""}],"slots":[],"events":[]},"CheckGroup":{"className":"CheckGroup","name":"复选框","group":"基础组件","styleState":{},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"绑定变量","itemKey":"value","itemTypeRange":"var","itemDefaultValue":""},{"itemId":"002","itemName":"选项列表","itemKey":"dataList","itemTypeRange":"const,var","itemType":"List","itemOption":{"type":"text","showHeader":false,"iFieldList":[{"value":"选项名称","key":"desc"}],"replace":{"101":"${index}","102":"选项${index}"}},"itemList":[{"itemId":"101","itemName":"选项键","itemKey":"key","itemTypeRange":"const","itemType":"Input","itemDefaultValue":"1"},{"itemId":"102","itemName":"选项值","itemKey":"desc","itemTypeRange":"const","itemType":"Input","itemDefaultValue":"选项"}],"itemDefaultValue":[{"key":"1","desc":"选项1"},{"key":"2","desc":"选项2"}]},{"itemId":"003","itemName":"选中颜色","itemKey":"selectColor","itemTypeRange":"const","itemType":"Color","itemDefaultValue":"#0082ff"},{"itemId":"004","itemName":"未选中颜色","itemKey":"unSelectColor","itemTypeRange":"const","itemType":"Color","itemDefaultValue":"#333333"},{"itemId":"005","itemName":"样式类型","itemKey":"buttonStyle","itemTypeRange":"const","itemType":"Select","itemOption":{"iParamList":[{"key":"Circle","value":"圆形"},{"key":"Square","value":"实心正方形"},{"key":"SquareEmpty","value":"空心正方形"},{"key":"Text","value":"纯文本"}]},"itemDefaultValue":"Circle"},{"itemId":"006","itemName":"选中数量限制","itemKey":"maxSelectCount","itemTypeRange":"const","itemType":"Select","itemOption":{"iParamList":[{"key":"0","value":"不限制"},{"key":"1","value":"1个"},{"key":"2","value":"2个"},{"key":"3","value":"3个"}]},"itemDefaultValue":"0"},{"itemId":"007","itemName":"排列方向","itemKey":"direction","itemTypeRange":"const","itemType":"Select","itemOption":{"iParamList":[{"key":"horizontal","value":"水平"},{"key":"vertical","value":"垂直"}]},"itemDefaultValue":"horizontal"},{"itemId":"008","itemName":"选项内边距","itemKey":"itemPadding","itemTypeRange":"const","itemType":"PaddingStyle","itemOption":{"normal":true,"seperator":" ","brackets":[]},"itemDefaultValue":"4 10 4 10"},{"itemId":"009","itemName":"选项间距","itemKey":"itemSpacing","itemTypeRange":"const","itemType":"InputNumber","itemDefaultValue":"4"},{"itemId":"010","itemName":"文字图标间距","itemKey":"textSpacing","itemTypeRange":"const","itemType":"InputNumber","itemDefaultValue":"3"},{"itemId":"011","itemName":"字体大小","itemKey":"fontSize","itemTypeRange":"const","itemType":"InputNumber","itemDefaultValue":"13"},{"itemId":"012","itemName":"icon大小","itemKey":"iconSize","itemTypeRange":"const","itemType":"InputNumber","itemDefaultValue":"14"}],"slots":[],"events":[{"eventKey":"selectChange","eventName":"选项发生改变"}]},"RadioButton":{"className":"RadioButton","name":"单选框","group":"基础组件","styleState":{},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"绑定变量","itemKey":"value","itemTypeRange":"var","itemDefaultValue":""},{"itemId":"002","itemName":"选中颜色","itemKey":"selectColor","itemTypeRange":"const","itemType":"Color","itemDefaultValue":"#0082ff"},{"itemId":"003","itemName":"未选中颜色","itemKey":"unSelectColor","itemTypeRange":"const","itemType":"Color","itemDefaultValue":"#333333"},{"itemId":"004","itemName":"样式类型","itemKey":"buttonStyle","itemTypeRange":"const","itemType":"Select","itemOption":{"iParamList":[{"key":"Circle","value":"圆形"},{"key":"CircleEmpty","value":"空心圆形"}]},"itemDefaultValue":"Circle"},{"itemId":"005","itemName":"文字图标间距","itemKey":"textSpacing","itemTypeRange":"const","itemType":"InputNumber","itemDefaultValue":"3"},{"itemId":"006","itemName":"字体大小","itemKey":"fontSize","itemTypeRange":"const","itemType":"InputNumber","itemDefaultValue":"14"},{"itemId":"007","itemName":"icon大小","itemKey":"iconSize","itemTypeRange":"const","itemType":"InputNumber","itemDefaultValue":"14"},{"itemId":"008","itemName":"显示文字","itemKey":"showText","itemTypeRange":"const","itemType":"Switcher","itemDefaultValue":"1","itemCondition":"showText"},{"itemId":"009","itemName":"文字内容","itemKey":"text","itemTypeRange":"const,var","itemType":"Input","itemDefaultValue":"选项","itemCondition":"showText.1"}],"slots":[],"events":[{"eventKey":"selectChange","eventName":"选项发生改变"}]},"ProgressSlider":{"className":"ProgressSlider","name":"滑块","group":"基础组件","styleState":{"rect":{"width":"100%"},"other":{"overflow":"visible"}},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"other":true,"margin":true,"transform":true},"styleMeta":{"other":{"overflow":{"itemOption":{"iParamList":[{"key":"visible","value":"可见"}]}}}},"properties":[{"itemId":"001","itemName":"绑定变量","itemKey":"value","itemTypeRange":"var","itemDefaultValue":""},{"itemId":"002","itemName":"最小值","itemTypeRange":"const,var","itemKey":"minProgress","itemType":"InputNumber","itemDefaultValue":"0"},{"itemId":"003","itemName":"最大值","itemTypeRange":"const,var","itemKey":"maxProgress","itemType":"InputNumber","itemDefaultValue":"100"},{"itemId":"004","itemName":"步长","itemTypeRange":"const,var","itemKey":"step","itemType":"InputNumber","itemDefaultValue":"1"},{"itemId":"005","itemName":"背景色","itemTypeRange":"const,var","itemKey":"backgroundColor","itemType":"Color","itemDefaultValue":"#e6e6e6"},{"itemId":"006","itemName":"前景色","itemTypeRange":"const,var","itemKey":"foregroundColor","itemType":"Color","itemDefaultValue":"#0a59f5"},{"itemId":"007","itemName":"高度","itemTypeRange":"const,var","itemKey":"processHeight","itemType":"InputNumber","itemDefaultValue":"5"},{"itemId":"008","itemName":"滑块样式","itemTypeRange":"const,var","itemKey":"blockStyle","itemType":"Select","itemOption":{"iParamList":[{"key":"circle","value":"纯色圆"},{"key":"image","value":"图片"}]},"itemDefaultValue":"circle","itemCondition":"blockStyle"},{"itemId":"009","itemName":"滑块颜色","itemTypeRange":"const,var","itemKey":"blockColor","itemType":"Color","itemDefaultValue":"#ffffff","itemCondition":"blockStyle.circle"},{"itemId":"010","itemName":"滑块背景图","itemTypeRange":"image,var","itemKey":"blockImage","itemDefaultValue":"","itemCondition":"blockStyle.image"},{"itemId":"011","itemName":"滑块宽","itemTypeRange":"const,var","itemKey":"blockWidth","itemType":"InputNumber","itemDefaultValue":"15"},{"itemId":"012","itemName":"滑块高","itemTypeRange":"const,var","itemKey":"blockHeight","itemType":"InputNumber","itemDefaultValue":"15"}],"slots":[],"events":[{"eventName":"值改变事件","eventKey":"change"}]},"Video":{"className":"Video","name":"视频","group":"基础组件","styleState":{},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"视频地址","itemKey":"url","itemTypeRange":"image,var","itemDefaultValue":""},{"itemId":"002","itemName":"视频封面","itemKey":"previewUrl","itemTypeRange":"image,var","itemDefaultValue":""}],"slots":[],"events":[]},"Map":{"className":"Map","name":"地图","group":"基础组件","styleState":{"rect":{"width":"100%","height":"100"}},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"borderRadius":true,"border":true,"shadow":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"中心经度Lat","itemKey":"centerLat","itemType":"InputNumber","itemDefaultValue":""},{"itemId":"002","itemName":"中心纬度Lng","itemKey":"centerLng","itemType":"InputNumber","itemDefaultValue":""},{"itemId":"003","itemName":"缩放比","itemKey":"zoom","itemType":"InputNumber","itemOption":{"type":"+integer"},"itemDefaultValue":""},{"itemId":"004","itemName":"标记点经度Lat","itemKey":"markerLat","itemType":"InputNumber","itemDefaultValue":""},{"itemId":"005","itemName":"标记点纬度Lng","itemKey":"markerLng","itemType":"InputNumber","itemDefaultValue":""},{"itemId":"006","itemName":"标记点名称","itemKey":"markerName","itemTypeRange":"const,var","itemType":"Input","itemOption":{"placeholder":"请输入标记点名称"},"itemDefaultValue":""}],"slots":[],"events":[]},"Divider":{"className":"Divider","name":"分割线","group":"基础组件","styleState":{"rect":{"width":"100%","height":"1"},"background":{"backgroundType":"01","backgroundColor":"#f1f1f1"}},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"background":true,"margin":true},"styleMeta":{},"properties":[],"slots":[],"events":[]},"ViewContainer":{"className":"ViewContainer","name":"自定义","group":"基础组件","styleState":{"rect":{"width":"100%","height":"auto"}},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"background":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"padding":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"自定义类","itemKey":"customClass","itemTypeRange":"const","itemType":"Input","itemDefaultValue":""},{"itemId":"002","itemName":"自定义属性","itemKey":"customProps","itemTypeRange":"var","itemDefaultValue":{}},{"itemId":"003","itemName":"占位图","itemKey":"customRemarkImg","itemTypeRange":"image","itemDefaultValue":{}}],"slots":[],"events":[{"eventName":"动作事件","eventKey":"action"}]}}')},pu={properties:[{itemId:`1100`,itemName:`字体`,itemKey:`font`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`字体颜色`,itemKey:`color`,itemTypeRange:`const,var`,itemType:`Color`,itemDefaultValue:``},{itemId:`002`,itemName:`字体大小`,itemKey:`fontSize`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{type:`+integer`,iParamList:[{key:`12`,value:`12px`},{key:`14`,value:`14px`},{key:`16`,value:`16px`},{key:`18`,value:`18px`},{key:`20`,value:`20px`},{key:`22`,value:`22px`},{key:`24`,value:`24px`}]},itemDefaultValue:`14`},{itemId:`007`,itemName:`行高`,itemKey:`lineHeight`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``},{itemId:`003`,itemName:`对齐`,itemKey:`textAlign`,itemTypeRange:`const,var`,itemType:`TabSelect`,itemOption:{iParamList:[{key:`left`,value:`左`},{key:`center`,value:`中`},{key:`right`,value:`右`}]},itemDefaultValue:`left`},{itemId:`004`,itemName:`字体权重`,itemKey:`fontWeight`,itemTypeRange:`const,var`,itemType:`TabSelect`,itemOption:{iParamList:[{key:`400`,value:`常规`},{key:`500`,value:`中等`},{key:`600`,value:`加粗`}]},itemDefaultValue:`400`},{itemId:`008`,itemName:`字体样式`,itemKey:`fontStyle`,itemTypeRange:`const`,itemType:`FontStyle`,itemOption:{},itemDefaultValue:`normal`},{itemId:`009`,itemName:`字体修饰`,itemKey:`textDecoration`,itemTypeRange:`const`,itemType:`TextDecorationStyle`,itemOption:{},itemDefaultValue:`none`},{itemId:`005`,itemName:`最大行数`,itemKey:`isMaxLine`,itemTypeRange:`const`,itemType:`Switcher`,itemOption:{},itemDefaultValue:`0`,itemCondition:`isMaxLine`},{itemId:`006`,itemName:`最大行数`,itemKey:`maxLine`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:`1`,itemCondition:`isMaxLine.1`}]},{itemId:`1200`,itemName:`图片`,itemKey:`image`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`裁剪模式`,itemKey:`cropMode`,itemTypeRange:`const`,itemType:`TabSelect`,itemOption:{iParamList:[{key:`00`,value:`铺满缩放`},{key:`01`,value:`填充缩放`}]},itemDefaultValue:`00`}]},{itemId:`1300`,itemName:`定位`,itemKey:`position`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`左偏移`,itemKey:`left`,itemTypeRange:`const`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``},{itemId:`002`,itemName:`上偏移`,itemKey:`top`,itemTypeRange:`const`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``},{itemId:`003`,itemName:`右偏移`,itemKey:`right`,itemTypeRange:`const`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``},{itemId:`004`,itemName:`下偏移`,itemKey:`bottom`,itemTypeRange:`const`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``}]},{itemId:`100`,itemName:`布局`,itemKey:`flex`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`006`,itemName:`排列方向`,itemKey:`flexDirection`,itemTypeRange:`const`,itemType:`TabSelect`,itemOption:{iParamList:[{key:`row`,value:`横向`},{key:`column`,value:`竖向`}]},itemDefaultValue:`row`},{itemId:`001`,itemName:`水平对齐`,itemKey:`justifyContent`,itemTypeRange:`const`,itemType:`JustifyContentStyle`,itemOption:{rowName:`水平对齐`,columnName:`垂直对齐`},itemDefaultValue:`flex-start`,itemWatch:{flexDirection:`flexDirection`}},{itemId:`002`,itemName:`垂直对齐`,itemKey:`alignItems`,itemTypeRange:`const`,itemType:`AlignItemsStyle`,itemOption:{rowName:`垂直对齐`,columnName:`水平对齐`},itemDefaultValue:`stretch`,itemWatch:{flexDirection:`flexDirection`}},{itemId:`003`,itemName:`元素间距`,itemKey:`gap`,itemTypeRange:`const`,itemType:`Select`,itemOption:{iParamList:[{key:`0`,value:`0px`},{key:`4`,value:`4px`},{key:`8`,value:`8px`},{key:`12`,value:`12px`},{key:`16`,value:`16px`},{key:`20`,value:`20px`},{key:`24`,value:`24px`},{key:`28`,value:`28px`}]},itemDefaultValue:``},{itemId:`005`,itemName:`空间不足时压缩节点`,itemKey:`flexShrink`,itemTypeRange:`const`,itemType:`Switcher`,itemOption:{},itemDefaultValue:`1`}]},{itemId:`200`,itemName:`矩形`,itemKey:`rect`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`003`,itemName:`宽度`,itemKey:`width`,itemTypeRange:`const,var`,itemType:`NumberStyle`,itemOption:{},itemDefaultValue:``},{itemId:`004`,itemName:`高度`,itemKey:`height`,itemTypeRange:`const,var`,itemType:`NumberStyle`,itemOption:{iTypeList:[{key:`number`,value:`px`},{key:`auto`,value:`@`}]},itemDefaultValue:`auto`}]},{itemId:`300`,itemName:`背景`,itemKey:`background`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`背景`,itemKey:`backgroundType`,itemTypeRange:`const`,itemType:`TabSelect`,itemOption:{iParamList:[{key:`00`,value:`透明`},{key:`01`,value:`颜色`},{key:`02`,value:`图片`},{key:`03`,value:`渐变色`}]},itemDefaultValue:`00`,itemCondition:`backgroundType`},{itemId:`002`,itemName:`背景颜色`,itemKey:`backgroundColor`,itemTypeRange:`const,var`,itemType:`Color`,itemDefaultValue:``,itemCondition:`backgroundType.01`},{itemId:`003`,itemName:`背景图片`,itemKey:`backgroundImage`,itemTypeRange:`image,var`,itemOption:{},itemDefaultValue:``,itemCondition:`backgroundType.02`},{itemId:`004`,itemName:`背景图位置`,itemKey:`backgroundPosition`,itemTypeRange:`const,var`,itemType:`BackgroundPositionStyle`,itemOption:{},itemDefaultValue:`50% 50%`,itemCondition:`backgroundType.02`},{itemId:`005`,itemName:`背景图大小`,itemKey:`backgroundSize`,itemTypeRange:`const,var`,itemType:`BackgroundSizeStyle`,itemOption:{},itemDefaultValue:`cover`,itemCondition:`backgroundType.02`},{itemId:`006`,itemName:`背景图重复`,itemKey:`backgroundRepeat`,itemTypeRange:`const,var`,itemType:`Select`,itemOption:{iParamList:[{key:`no-repeat`,value:`不重复`},{key:`repeat`,value:`重复图片`},{key:`repeat-x`,value:`水平重复`},{key:`repeat-y`,value:`垂直重复`}]},itemDefaultValue:`no-repeat`,itemCondition:`backgroundType.02`},{itemId:`007`,itemName:`背景渐变`,itemKey:`backgroundGradient`,itemTypeRange:`const,var`,itemType:`GradientStyle`,itemOption:{},itemDefaultValue:``,itemCondition:`backgroundType.03`}]},{itemId:`400`,itemName:`内边距`,itemKey:`padding`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`内边距`,itemKey:`paddingType`,itemTypeRange:`const`,itemType:`TabSelect`,itemOption:{iParamList:[{key:``,value:`无`},{key:`0`,value:`全边`},{key:`1`,value:`自定义`}]},itemDefaultValue:``,itemCondition:`paddingType`},{itemId:`002`,itemName:`内边距`,itemKey:`padding`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{iParamList:[{key:`0`,value:`0px`},{key:`2`,value:`2px`},{key:`4`,value:`4px`},{key:`8`,value:`8px`},{key:`12`,value:`12px`},{key:`16`,value:`16px`},{key:`20`,value:`20px`},{key:`24`,value:`24px`},{key:`28`,value:`28px`}]},itemDefaultValue:``,itemCondition:`paddingType.0`},{itemId:`003`,itemName:`内左边距`,itemKey:`paddingLeft`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`paddingType.1`},{itemId:`004`,itemName:`内上边距`,itemKey:`paddingTop`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`paddingType.1`},{itemId:`005`,itemName:`内右边距`,itemKey:`paddingRight`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`paddingType.1`},{itemId:`006`,itemName:`内下边距`,itemKey:`paddingBottom`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`paddingType.1`}]},{itemId:`500`,itemName:`外边距`,itemKey:`margin`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`外边距`,itemKey:`marginType`,itemTypeRange:`const`,itemType:`TabSelect`,itemOption:{iParamList:[{key:``,value:`无`},{key:`0`,value:`全边`},{key:`1`,value:`自定义`}]},itemDefaultValue:``,itemCondition:`marginType`},{itemId:`002`,itemName:`外边距`,itemKey:`margin`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{iParamList:[{key:`0`,value:`0px`},{key:`2`,value:`2px`},{key:`4`,value:`4px`},{key:`8`,value:`8px`},{key:`12`,value:`12px`},{key:`16`,value:`16px`},{key:`20`,value:`20px`},{key:`24`,value:`24px`},{key:`28`,value:`28px`}]},itemDefaultValue:``,itemCondition:`marginType.0`},{itemId:`003`,itemName:`外左边距`,itemKey:`marginLeft`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`marginType.1`},{itemId:`004`,itemName:`外上边距`,itemKey:`marginTop`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`marginType.1`},{itemId:`005`,itemName:`外右边距`,itemKey:`marginRight`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`marginType.1`},{itemId:`006`,itemName:`外下边距`,itemKey:`marginBottom`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`marginType.1`}]},{itemId:`600`,itemName:`圆角`,itemKey:`borderRadius`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`圆角`,itemKey:`borderRadiusType`,itemTypeRange:`const`,itemType:`TabSelect`,itemOption:{iParamList:[{key:``,value:`无`},{key:`0`,value:`全角`},{key:`1`,value:`自定义`}]},itemDefaultValue:``,itemCondition:`borderRadiusType`},{itemId:`002`,itemName:`圆角`,itemKey:`borderRadius`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{type:`+integer`,iParamList:[{key:`0`,value:`0px`},{key:`4`,value:`4px`},{key:`6`,value:`6px`},{key:`8`,value:`8px`},{key:`10`,value:`10px`},{key:`12`,value:`12px`},{key:`16`,value:`16px`}]},itemDefaultValue:``,itemCondition:`borderRadiusType.0`},{itemId:`003`,itemName:`圆角上左`,itemKey:`borderTopLeftRadius`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`borderRadiusType.1`},{itemId:`004`,itemName:`圆角上右`,itemKey:`borderTopRightRadius`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`borderRadiusType.1`},{itemId:`005`,itemName:`圆角下右`,itemKey:`borderBottomRightRadius`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`borderRadiusType.1`},{itemId:`006`,itemName:`圆角下左`,itemKey:`borderBottomLeftRadius`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`borderRadiusType.1`}]},{itemId:`700`,itemName:`边框`,itemKey:`border`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`边框`,itemKey:`isBorder`,itemTypeRange:`const`,itemType:`Switcher`,itemOption:{},itemDefaultValue:`0`,itemCondition:`isBorder`},{itemId:`002`,itemName:`边框宽度`,itemKey:`borderWidth`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:`1`,itemCondition:`isBorder.1`},{itemId:`003`,itemName:`边框样式`,itemKey:`borderStyle`,itemTypeRange:`const,var`,itemType:`Select`,itemOption:{iParamList:[{key:`solid`,value:`solid`},{key:`dashed`,value:`dashed`},{key:`dotted`,value:`dotted`}]},itemDefaultValue:`solid`,itemCondition:`isBorder.1`},{itemId:`004`,itemName:`边框颜色`,itemKey:`borderColor`,itemTypeRange:`const,var`,itemType:`Color`,itemOption:{},itemDefaultValue:`#e7e7ee`,itemCondition:`isBorder.1`}]},{itemId:`800`,itemName:`阴影`,itemKey:`shadow`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`阴影`,itemKey:`isShadow`,itemTypeRange:`const`,itemType:`Switcher`,itemDefaultValue:`0`,itemCondition:`isShadow`},{itemId:`002`,itemName:`阴影颜色`,itemKey:`shadowColor`,itemTypeRange:`const`,itemType:`Color`,itemDefaultValue:`#e7e7ee`,itemCondition:`isShadow.1`},{itemId:`003`,itemName:`x偏移`,itemKey:`shadowX`,itemTypeRange:`const`,itemType:`InputNumber`,itemDefaultValue:`0`,itemCondition:`isShadow.1`},{itemId:`004`,itemName:`y偏移`,itemKey:`shadowY`,itemTypeRange:`const`,itemType:`InputNumber`,itemDefaultValue:`0`,itemCondition:`isShadow.1`},{itemId:`005`,itemName:`阴影模糊`,itemKey:`shadowBlur`,itemTypeRange:`const`,itemType:`InputNumber`,itemDefaultValue:``,itemCondition:`isShadow.1`},{itemId:`006`,itemName:`阴影拓展`,itemKey:`shadowSpread`,itemType:`InputNumber`,itemTypeRange:`const`,itemDefaultValue:``,itemCondition:`isShadow.1`}]},{itemId:`900`,itemName:`转换`,itemKey:`transform`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`旋转`,itemKey:`rotate`,itemTypeRange:`const`,itemType:`InputNumber`,itemOption:{symbol:`deg`,type:`integer`},itemDefaultValue:``}]},{itemId:`1000`,itemName:`高级`,itemKey:`other`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`002`,itemName:`溢出`,itemKey:`overflow`,itemTypeRange:`const`,itemType:`Select`,itemOption:{iParamList:[{key:`hidden`,value:`隐藏`},{key:`visible`,value:`可见`}]},itemDefaultValue:`hidden`},{itemId:`001`,itemName:`不透明度`,itemKey:`opacity`,itemTypeRange:`const`,itemType:`InputNumber`,itemOption:{symbol:`%`,type:`+integer`},itemDefaultValue:``}]}]},mu={_source:`c9.6a9947d5.js module (directives meta)`,properties:[{itemId:`001`,itemName:`显示条件`,itemDesc:``,itemTypeRange:`const`,itemType:`Group`,itemKey:`v-show`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`显隐设置`,itemType:`Select`,itemKey:`showType`,itemOption:{iParamList:[{key:`00`,value:`始终显示`},{key:`01`,value:`满足条件显示`},{key:`02`,value:`满足条件隐藏`}]},itemDefaultValue:`00`,itemCondition:`showType`},{itemId:`002`,itemName:`具体条件`,itemType:`IfForm`,itemKey:`condition`,itemOption:{},itemDefaultValue:{},itemCondition:`showType.01|02`}]}]},hu=e=>e===void 0?e:JSON.parse(JSON.stringify(e)),gu=0,_u=e=>`${e}_${(++gu).toString(36)}`,vu=fu.components||{},yu=pu.properties||[],bu={};(function e(t,n=[],r=[]){t.forEach(t=>{let i=n.concat(t.itemId),a=r.concat(t.itemKey);bu[i.join(`|`)]=t,bu[a.join(`.`)]=t,t.itemChildren&&e(t.itemChildren,i,a)})})(yu);var xu=mu.properties||[],Su=class{constructor(e={}){this.id=_u(`style`),this.state=Object.assign({},e.state||{}),this.visible=e.visible||{},this.meta=e.meta||{},this.properties=[],this.parseStateProperties(this.state,this.properties)}parseStateProperties(e,t=[]){let n=hu(e)||{};for(let e in n){let r=bu[e];if(!r)continue;let i=new Y(r);t.push(i);let a=Object.keys(n[e]||{}),o=i.itemChildren?.properties||[],s=this.visible&&this.visible.flex;e===`flex`&&s&&typeof s==`object`&&s.flexShrink&&a.push(`flexShrink`);for(let e=0;e<o.length;e++)a.includes(o[e].itemKey)||o.splice(e--,1);du.setPropertyValue(o,n[e]),i.itemValueFrom=`0`,i.itemUpdated=!0}}onRestore(e={}){this.properties.length=0,this.parseStateProperties(this.state,this.properties);let t=this.properties.reduce((e,t)=>(e[t.itemId]=t,e),{}),n={append(e,t,n=[]){let r=[].concat(n);r.push(e.itemId);let i=bu[r.join(`|`)],a=new Y(i||{});t.push(a),a.onRestore(hu(e),lu.Delete)}};(e.properties||[]).forEach(e=>{let r=bu[e.itemId];if(!r){let n=new Y(e);this.properties.push(n),t[e.itemId]=n,n.onRestore(e,lu.Delete);return}let i=t[e.itemId];if(i)i.onRestore(e,lu.Append,n);else{let n=new Y(r);this.properties.push(n),t[e.itemId]=n,n.onRestore(e,lu.Delete)}}),Y.updatePropertyVisible(this.properties)}onPreview(){let e=this.properties.reduce((e,t)=>{let n=t.onPreview();return n&&Y.mergePreview(e,n),e},{});return{id:this.id,properties:e}}onExport(){return{properties:this.properties.reduce((e,t)=>{let n=t.onExport();return n&&e.push(n),e},[])}}applyChange(e,t){let n=e.onExport(t);if(!n)return;let r=e.itemId,i=this.properties.filter(e=>e.itemId===r)[0];if(!i){i=new Y(bu[r]||{}),this.properties.push(i),i.onRestore(hu(n),lu.Delete);return}let a=[r];for(let e=t;e;e=e.child)a.push(e.itemId);i.onRestore(hu(n),lu.Append,{append(e,t){let n=bu[a.join(`|`)],r=new Y(n||{});t.push(r),r.onRestore(hu(e),lu.Delete)}})}},Cu=class{constructor(e={}){this.id=_u(`slot`),this.slotKey=e.slotKey,this.slotName=e.slotName,this.slotDesc=e.slotDesc||``,this.slotScope=e.slotScope===!0||e.slotScope===`true`,this.slotWidth=e.slotWidth||``,this.slotHeight=e.slotHeight||``,this.slotSwitch=e.slotSwitch===void 0?`1`:e.slotSwitch,this.components=[]}onRestore(e={}){e.slotSwitch!==void 0&&(this.slotSwitch=e.slotSwitch),this.components=(e.components||[]).map(e=>Du(e))}onPreview(){return{id:this.id,slotKey:this.slotKey,slotScope:this.slotScope,slotDesc:this.slotDesc,slotSwitch:this.slotSwitch,slotWidth:this.slotWidth,slotHeight:this.slotHeight,components:this.components.reduce((e,t)=>{let n=t.onPreview();return n&&e.push(n),e},[])}}onExport(){return{slotKey:this.slotKey,slotScope:this.slotScope,slotSwitch:this.slotSwitch,components:(this.components||[]).map(e=>e&&typeof e.onExport==`function`?e.onExport():e)}}};function wu(e=[],t=[],n={}){let r={},i=t.length>0;return(e||[]).forEach(e=>{if(!e||!e.itemKey)return;let i=t.concat(e.itemKey);e.itemValueFrom===`1`?(r[e.itemKey]=e.itemDefaultValue,e.itemValue&&(n[i.join(`.`)]=e.itemValue)):e.itemValueFrom===`2`?r[e.itemKey]=e.itemValue:e.itemChildren&&e.itemChildren.properties?r[e.itemKey]=wu(e.itemChildren.properties,i,n):e.itemList?r[e.itemKey]=e.itemList.map((e,t)=>wu(e&&e.properties||[],i.concat(String(t)),n)):r[e.itemKey]=e.itemValue}),i||(r.__vars__=n),r}function Tu(e={},t=[]){let n=e.event||{},r=(t||[]).filter(e=>e.eventKey===n.eventKey)[0]||{},i=e.action||{};return{event:{eventName:r.eventName,eventKey:r.eventKey},action:{actionType:i.actionType,properties:wu(i.properties||[])},schemaIndex:-1}}var Eu=class{constructor(e={}){let t=e.className,n=vu[t]||{};this.id=e.id||_u(`comp`),this.componentId=e.componentId||_u(String(t).toLowerCase()),this.name=e.name||n.name||t,this.className=t,this.version=e.version||n.version,this.visible=!0,this.metaMissing=!vu[t],this.style=new Su({state:n.styleState,visible:n.styleVisible}),this.directives=xu.map(e=>new Y(e)),this.properties=(n.properties||[]).map(e=>new Y(e)),this.events=n.events||[],this.eventactions=[],this.slots=(n.slots||[]).map(e=>new Cu(e)),this._schemaNode=e,this.onRestore(e)}onRestore(e={}){this.style.onRestore(e.style||{}),Y.restoreProperty(e.directives||[],this.directives),Y.updatePropertyVisible(this.directives),Y.restoreProperty(e.properties||[],this.properties),Y.updatePropertyVisible(this.properties),this.eventactions=(e.eventactions||[]).map((e,t)=>{let n=Tu(e,this.events);return n.schemaIndex=t,n});let t=(e.slots||[]).reduce((e,t)=>(e[t.slotKey]=t,e),{});this.slots.forEach(e=>{t[e.slotKey]&&e.onRestore(t[e.slotKey])}),this.metaMissing&&!this.slots.length&&(e.slots||[]).length&&(e.slots||[]).forEach(e=>{let t=new Cu({slotKey:e.slotKey,slotScope:e.slotScope});t.onRestore(e),this.slots.push(t)})}onPreview(){let e=this.directives.reduce((e,t)=>{let n=t.onPreview();return n&&Y.mergePreview(e,n),e},{}),t=this.properties.reduce((e,t)=>{let n=t.onPreview();return n&&Y.mergePreview(e,n),e},{}),n={id:this.id,componentId:this.componentId,name:this.name,className:this.className,version:this.version,directives:e,style:this.style.onPreview(),properties:t,eventactions:this.eventactions,slots:this.slots.map(e=>e.onPreview()),visible:this.visible,metaMissing:this.metaMissing||void 0,_schemaNode:this._schemaNode};return Lu(n,{className:this.className,properties:this.properties,style:this.style.properties,directives:this.directives,events:this.events}),n}};function Du(e){return new Eu(e)}var Ou=class{constructor(e={}){this.id=_u(`view`),this.width=e.width||`375`,this.className=e.className||`Root`,this.style=new Su({state:{}}),this.properties=[],this.eventactions=[],this.components=[],this._schemaNode=e,this.onRestore(e)}onRestore(e={}){this.style.onRestore(e.style||{}),Y.restoreProperty(e.properties||[],this.properties),Y.updatePropertyVisible(this.properties),this.eventactions=(e.eventactions||[]).map((e,t)=>{let n=Tu(e,[]);return n.schemaIndex=t,n}),this.components=(e.components||[]).map(e=>Du(e))}onPreview(){let e=this.properties.reduce((e,t)=>{let n=t.onPreview();return n&&Y.mergePreview(e,n),e},{}),t={id:this.id,componentId:this.id,width:this.width,className:this.className,style:this.style.onPreview(),properties:e,eventactions:this.eventactions,components:this.components.map(e=>e.onPreview()),_schemaNode:this._schemaNode};return Lu(t,{className:this.className,properties:this.properties,style:this.style.properties,directives:[],events:[]}),t}};function ku(e){if(!e)return;let t=e=>(e||[]).reduce((e,t)=>(e[t.key]=t.defaultValue,e),{});return{dictionaryList:t(e.dictionaryList),inputParams:t(e.inputParams),mocks:e.mocks||{}}}function Au(e){return _u(String(e||`comp`).toLowerCase())}function ju(e){let t=vu[e];return!!(t&&t.slots&&t.slots.length)}function Mu(e){let t=vu[e];return t&&t.slots&&t.slots.length?t.slots[0].slotKey:`default`}function Nu(e){if(!vu[e])throw Error(`未知组件类型:`+e);let t=new Eu({className:e,componentId:Au(e)}),n=e=>(e||[]).map(e=>e.onExport()).filter(e=>e!==void 0);return{componentId:t.componentId,className:t.className,directives:n(t.directives),style:t.style.onExport(),properties:n(t.properties),eventactions:[],slots:t.slots.map(e=>e.onExport())}}function Pu(e={}){let t=new Ou(e.view||e),n=ku(e.dictionary);return{id:e.id,version:e.version,pageId:e.pageId,name:e.name,desc:e.desc,platform:e.platform,...n?{dictionary:n}:{},view:t.onPreview()}}function Fu(e={}){let t={};return e.iParamList&&(t.iParamList=e.iParamList),e.iTypeList&&(t.iTypeList=e.iTypeList),e.codeKey&&(t.codeKey=e.codeKey),e.language&&(t.language=e.language),e.max!==void 0&&(t.max=e.max),e.min!==void 0&&(t.min=e.min),e.step!==void 0&&(t.step=e.step),t}function Iu(e){if(!e||!e.itemKey)return null;let t={itemId:e.itemId,itemKey:e.itemKey,itemName:e.itemName,itemType:e.itemType,itemValue:e.itemValue,itemValueFrom:e.itemValueFrom,itemTypeRange:e.itemTypeRange,itemVisible:e.itemVisible,itemRequired:!!e.itemRequired,itemDesc:e.itemDesc,options:Fu(e.itemOption)};return e.itemChildren&&e.itemChildren.properties&&e.itemChildren.properties.length&&(t.children=e.itemChildren.properties.map(Iu).filter(Boolean)),e.itemList&&e.itemList.length&&(t.itemList=e.itemList.map(e=>(e.properties||[]).map(Iu).filter(Boolean))),t}function Lu(e,t){Object.defineProperty(e,"_model",{value:t,enumerable:!1,configurable:!0,writable:!1})}function Ru(e){let t=[];if(e.components&&t.push(...e.components),e.slots)for(let n of e.slots)n.components&&t.push(...n.components);return t}function zu(e){if(!e)return null;let t=e._model||{},n={id:e.id,componentId:e.componentId,className:e.className,name:e.name,properties:(t.properties||[]).map(Iu).filter(Boolean),style:(t.style||[]).map(Iu).filter(Boolean),directives:(t.directives||[]).map(Iu).filter(Boolean),eventactions:e.eventactions||[]},r=Ru(e);return r.length&&(n.components=r.map(zu).filter(Boolean)),n}function Bu(e={}){let t=zu(Pu(e).view);return t&&(t.id=e.id,t.version=e.version),t}var Vu=nn({node:null,sourceCardId:null});function Hu(){return Vu.node}function Uu(){return Vu.sourceCardId}function Wu(e,t=null){if(!e){Vu.node=null,Vu.sourceCardId=null;return}Vu.node=JSON.parse(JSON.stringify(e,(e,t)=>e===`_schemaNode`?void 0:t)),Vu.sourceCardId=t||null}function Gu(e,t=new Set){if(!e||typeof e!=`object`)return[...t];if(typeof e.className==`string`&&e.className&&t.add(e.className),Array.isArray(e.slots)){for(let n of e.slots)if(n&&Array.isArray(n.components))for(let e of n.components)Gu(e,t)}return[...t]}function Ku(e){if(!(!e||typeof e!=`object`)&&(e.componentId!=null&&e.className!=null&&(e.componentId=Au(e.className)),Array.isArray(e.slots))){for(let t of e.slots)if(t&&Array.isArray(t.components))for(let e of t.components)Ku(e)}}var qu=class{constructor(e,t){this.vm=e,this.styleProps=t||{}}get adapter(){return this.vm&&this.vm.adapter?this.vm.adapter:this.vm}parse(){let e=this.styleProps,t={};return this.parseRect(e.rect||{},t),this.parseFlex(e.flex||{},t),this.parseBackground(e.background||{},t),this.parsePadding(e.padding||{},t),this.parseMargin(e.margin||{},t),this.parseBorderRadius(e.borderRadius||{},t),this.parseBorder(e.border||{},t),this.parseShadow(e.shadow||{},t),this.parseTransform(e.transform||{},t),this.parseOther(e.other||{},t),t.boxSizing=`border-box`,t}parseFont(e={},t={}){return e.color&&(t.color=this.adapter.doColor(e.color)),e.fontSize&&(t.fontSize=this.adapter.doSize(e.fontSize,`font`)),e.lineHeight&&(t.lineHeight=this.adapter.doSize(e.lineHeight)),e.textAlign&&(t.textAlign=e.textAlign),e.fontWeight&&(t.fontWeight=e.fontWeight),e.fontStyle&&(t.fontStyle=e.fontStyle),e.textDecoration&&(t.textDecoration=e.textDecoration),e.isMaxLine==`1`&&(t.lineClamp=e.maxLine||`1`,t[`-webkit-line-clamp`]=e.maxLine||`1`),t}parseImage(e={},t={}){return e.cropMode==`01`?(t.backgroundSize=`contain`,t.aspectRatio=`1/1`):(t.backgroundSize=`cover`,t.aspectRatio=`16/9`),t}parseRect(e,t){t.width=this.adapter.doSize(e.width),t.height=this.adapter.doSize(e.height),t.maxWidth=this.adapter.doSize(e.maxWidth),t.maxHeight=this.adapter.doSize(e.maxHeight),t.minWidth=this.adapter.doSize(e.minWidth),t.minHeight=this.adapter.doSize(e.minHeight)}parseFlex(e,t){e.flexDirection&&(t.flexDirection=e.flexDirection),e.justifyContent&&(t.justifyContent=e.justifyContent),e.alignItems&&(t.alignItems=e.alignItems),e.flexWrap&&(t.flexWrap=e.flexWrap),e.flexShrink&&(t.flexShrink=e.flexShrink),e.gap&&(t.gap=this.adapter.doSize(e.gap))}parseBackground(e,t){if(e.backgroundType==`01`&&e.backgroundColor)t.backgroundColor=this.adapter.doColor(e.backgroundColor);else if(e.backgroundType==`02`&&e.backgroundImage){if(t.backgroundImage=`url("${this.adapter.doReplaceUrl(this.adapter.doI18n(e.backgroundImage))}")`,e.backgroundPosition){let n=e.backgroundPosition.split(/[ ]+/);t.backgroundPosition=`${this.adapter.doSize(n[0]||``)} ${this.adapter.doSize(n[1]||``)}`}else t.backgroundPosition=`50% 50%`;if(e.backgroundSize){let n=e.backgroundSize.split(/[ ]+/);t.backgroundSize=n.length>=2?`${this.adapter.doSize(n[0]||``)} ${this.adapter.doSize(n[1]||``)}`:e.backgroundSize}else t.backgroundSize=`cover`;t.backgroundRepeat=e.backgroundRepeat||`no-repeat`}else e.backgroundType==`03`&&e.backgroundGradient&&(t.backgroundImage=e.backgroundGradient)}parsePadding(e,t){e.paddingType==`0`?t.padding=this.adapter.doSize(e.padding):e.paddingType==`1`&&(t.paddingLeft=this.adapter.doSize(e.paddingLeft),t.paddingTop=this.adapter.doSize(e.paddingTop),t.paddingRight=this.adapter.doSize(e.paddingRight),t.paddingBottom=this.adapter.doSize(e.paddingBottom))}parseMargin(e,t){e.marginType==`0`?t.margin=this.adapter.doSize(e.margin):e.marginType==`1`&&(t.marginLeft=this.adapter.doSize(e.marginLeft),t.marginTop=this.adapter.doSize(e.marginTop),t.marginRight=this.adapter.doSize(e.marginRight),t.marginBottom=this.adapter.doSize(e.marginBottom))}parseBorderRadius(e,t){e.borderRadiusType==`0`?t.borderRadius=this.adapter.doSize(e.borderRadius):e.borderRadiusType==`1`&&(t.borderTopLeftRadius=this.adapter.doSize(e.borderTopLeftRadius),t.borderTopRightRadius=this.adapter.doSize(e.borderTopRightRadius),t.borderBottomRightRadius=this.adapter.doSize(e.borderBottomRightRadius),t.borderBottomLeftRadius=this.adapter.doSize(e.borderBottomLeftRadius))}parseBorder(e,t){e.isBorder==`1`&&(t.borderWidth=this.adapter.doSize(e.borderWidth||`1`),t.borderStyle=e.borderStyle||`solid`,t.borderColor=this.adapter.doColor(e.borderColor||`#e7e7ee`))}parseShadow(e,t){if(e.isShadow==`1`){let n=[];n.push(this.adapter.doSize(e.shadowX||`0`)),n.push(this.adapter.doSize(e.shadowY||`0`)),e.shadowBlur&&n.push(this.adapter.doSize(e.shadowBlur)),e.shadowSpread&&n.push(this.adapter.doSize(e.shadowSpread)),n.push(this.adapter.doColor(e.shadowColor||`#e7e7ee`)),t.boxShadow=n.join(` `)}}parseTransform(e,t){let n=[];e.rotate&&n.push(`rotate(${e.rotate}deg)`),n.length&&(t.transform=n.join(` `))}parseOther(e,t){t.overflow=e.overflow?e.overflow:`hidden`,e.opacity&&(t.opacity=`${Number(e.opacity)/100}`)}},Ju={inject:[`adapter`],methods:{doI18n(e){return this.adapter.doI18n(e)}}},X=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},Yu={name:`CeRoot`,emits:[`onReady`],mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})}},computed:{styleObj(){let e=new qu(this,this.styleProps).parse();return Object.assign({fontSize:this.adapter.doSize(14,`font`)},e)}},mounted(){this.$emit(`onReady`,{})}};function Xu(e,t,n,r,i,a){return B(),V(`div`,{ref:`root`,class:`ce_root`,style:A(a.styleObj)},[Qi(e.$slots,`default`)],4)}var Zu=X(Yu,[[`render`,Xu],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Root.vue`]]),Qu={name:`CeRow`,emits:[`click`],mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})}},computed:{styleObj(){return new qu(this,this.styleProps).parse()}}};function $u(e,t,n,r,i,a){return B(),V(`div`,{ref:`row`,class:`ce_row`,style:A(a.styleObj),onClick:t[0]||=t=>e.$emit(`click`,t)},[Qi(e.$slots,`default`)],4)}var ed=X(Qu,[[`render`,$u],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Row.vue`]]),td={name:`CeColumn`,emits:[`click`],mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})}},computed:{styleObj(){return new qu(this,this.styleProps).parse()}}};function nd(e,t,n,r,i,a){return B(),V(`div`,{ref:`column`,class:`ce_column`,style:A(a.styleObj),onClick:t[0]||=t=>e.$emit(`click`,t)},[Qi(e.$slots,`default`)],4)}var rd=X(td,[[`render`,nd],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Column.vue`]]),id={name:`CeText`,emits:[`click`],mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})},value:{type:[String,Number],default:``}},computed:{styleObj(){let e=new qu(this,this.styleProps),t=e.parse();return e.parseFont(this.styleProps.font||{},t),t}}};function ad(e,t,n,r,i,a){return B(),V(`span`,{class:`ce_text`,style:A(a.styleObj),onClick:t[0]||=t=>e.$emit(`click`,t)},M(e.doI18n(n.value)),5)}var od=X(id,[[`render`,ad],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Text.vue`]]),sd={name:`CeButton`,emits:[`click`],mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})},value:{type:[String,Number],default:``},disabled:{type:[Boolean,String,Number],default:!1}},computed:{styleObj(){let e=new qu(this,this.styleProps),t=e.parse();return e.parseFont(this.styleProps.font||{},t),t}}};function cd(e,t,n,r,i,a){return B(),V(`button`,{class:j([`ce_button`,{ce_button_disabled:n.disabled}]),style:A(a.styleObj),onClick:t[0]||=t=>!n.disabled&&e.$emit(`click`,t)},M(e.doI18n(n.value)),7)}var ld=X(sd,[[`render`,cd],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Button.vue`]]),ud={name:`CeDivider`,mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})}},computed:{styleObj(){return new qu(this,this.styleProps).parse()}}};function dd(e,t,n,r,i,a){return B(),V(`div`,{class:`ce_divider`,style:A(a.styleObj)},null,4)}var fd=X(ud,[[`render`,dd],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Divider.vue`]]),pd=`/assets/svg-symbols-B2exBrAr.svg`,md=`/assets/default-image-wzZYQ86K.png`,hd=pd,gd=md,_d={name:`SvgSymbols`,props:{icon:{type:String,default:``},color:{type:String,default:``}},data(){return{symbols:hd}},computed:{href(){return`${this.symbols}#${this.icon}`}}},vd=[`fill`],yd=[`xlink:href`,`fill`];function bd(e,t,n,r,i,a){return B(),V(`svg`,{class:`ce_svgsymbols`,fill:n.color},[U(`use`,{"xlink:href":a.href,fill:n.color},null,8,yd)],8,vd)}var xd=X(_d,[[`render`,bd],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/SvgSymbols.vue`]]),Sd={name:`SvgCode`,props:{content:{type:String,default:``},color:{type:String,default:``}},computed:{svgStyle(){return{fill:this.color}}}},Cd=[`innerHTML`];function wd(e,t,n,r,i,a){return B(),V(`span`,{class:`ce_svgcode`,style:A(a.svgStyle),innerHTML:n.content},null,12,Cd)}var Td={name:`CeIcon`,emits:[`click`],mixins:[Ju],components:{SvgSymbols:xd,SvgCode:X(Sd,[[`render`,wd],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/SvgCode.vue`]])},props:{styleProps:{type:Object,default:()=>({})},icon:{type:String,default:``},color:{type:String,default:``},content:{type:String,default:``}},computed:{styleObj(){return new qu(this,this.styleProps).parse()}}};function Ed(e,t,n,r,i,a){let o=L(`svg-code`),s=L(`svg-symbols`);return B(),V(`span`,{class:`ce_icon`,style:A(a.styleObj),onClick:t[0]||=t=>e.$emit(`click`,t)},[n.content&&n.content.trim()?(B(),H(o,{key:0,color:n.color,content:n.content},null,8,[`color`,`content`])):(B(),H(s,{key:1,color:n.color,icon:n.icon},null,8,[`color`,`icon`]))],4)}var Dd=X(Td,[[`render`,Ed],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Icon.vue`]]),Od={name:`CeImage`,emits:[`click`],mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})},value:{type:[String,Number],default:``}},computed:{styleObj(){return new qu(this,this.styleProps).parse()},fillStyleObj(){let e={};return new qu(this,this.styleProps).parseImage(this.styleProps.image||{},e),e.backgroundImage=`url(${this.adapter.doReplaceUrl(this.doI18n(this.value||gd))})`,e}}};function kd(e,t,n,r,i,a){return B(),V(`div`,{class:`ce_image`,style:A(a.styleObj),onClick:t[0]||=t=>e.$emit(`click`,t)},[U(`div`,{class:`ce_image_fill`,style:A(a.fillStyleObj)},null,4)],4)}var Ad=X(Od,[[`render`,kd],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Image.vue`]]),jd={name:`CeMultiText`,emits:[`click`],mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})},textList:{type:Array,default:()=>[]}},computed:{styleObj(){let e=new qu(this,this.styleProps),t=e.parse();return e.parseFont(this.styleProps.font||{},t),t}},methods:{doClick(e,t,n){e.__do__||(e.__do__=!0,this.$emit(`click`,{data:{index:n,tag:t?t.tag:``,text:t?t.value:``}}))},parseFont(e){let t={};return new qu(this,{}).parseFont(e||{},t),e&&e.backgroundColor&&(t.backgroundColor=this.adapter.doColor(e.backgroundColor)),t}}},Md={class:`ce_multitext_item`},Nd=[`onClick`];function Pd(e,t,n,r,i,a){return B(),V(`span`,{class:`ce_multitext`,style:A(a.styleObj),onClick:t[0]||=e=>a.doClick(e)},[U(`span`,Md,[(B(!0),V(z,null,R(n.textList,(t,n)=>(B(),V(`span`,{key:n,style:A(a.parseFont(t)),onClick:e=>a.doClick(e,t,n)},M(e.doI18n(t.value)),13,Nd))),128))])],4)}var Fd=X(jd,[[`render`,Pd],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/MultiText.vue`]]),Id={name:`CeListLayout`,emits:[`click`],mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})},value:{type:Array,default:()=>[]},direction:{type:String,default:`vertical`},rowSpacing:{type:[String,Number],default:``},edgeInsets:{type:String,default:``}},computed:{itemStyleObj(){let e=this.direction===`horizontal`;return{marginLeft:e?this.adapter.doSize(this.rowSpacing):0,marginTop:e?0:this.adapter.doSize(this.rowSpacing)}},conClasses(){return{ce_listlayout_horizontal:this.direction===`horizontal`}},conStyleObj(){let e={};if(this.edgeInsets){let t=this.parsePadding(this.edgeInsets);e.paddingLeft=this.adapter.doSize(t[1]),e.paddingTop=this.adapter.doSize(t[0]),e.paddingRight=this.adapter.doSize(t[3]),e.paddingBottom=this.adapter.doSize(t[2])}return e},rootStyle(){return new qu(this,this.styleProps).parse()}},methods:{parsePadding(e){return String(e).replace(/[{}]/g,``).split(`,`)}}};function Ld(e,t,n,r,i,a){return B(),V(`div`,{class:`ce_listlayout`,style:A(a.rootStyle),onClick:t[0]||=t=>e.$emit(`click`,t)},[U(`div`,{class:j([`ce_listlayout_con`,a.conClasses]),style:A(a.conStyleObj)},[(B(!0),V(z,null,R(n.value||[],(t,n)=>(B(),V(`div`,{key:n,class:`ce_listlayout_item`,style:A(n===0?{}:a.itemStyleObj)},[Qi(e.$slots,`default`,{item:t,index:n})],4))),128))],6)],4)}var Rd=X(Id,[[`render`,Ld],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ListLayout.vue`]]),zd={name:`CeGridLayout`,emits:[`click`],mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})},value:{type:Array,default:()=>[]},column:{type:[Number,String],default:2},rowSpacing:{type:[String,Number],default:``},itemSpacing:{type:[String,Number],default:``},edgeInsets:{type:String,default:``}},computed:{styleObj(){let e=new qu(this,this.styleProps).parse();if(this.rowSpacing&&(e.rowGap=this.adapter.doSize(this.rowSpacing)),this.edgeInsets){let t=this.parsePadding(this.edgeInsets);e.paddingLeft=this.adapter.doSize(t[1]),e.paddingTop=this.adapter.doSize(t[0]),e.paddingRight=this.adapter.doSize(t[3]),e.paddingBottom=this.adapter.doSize(t[2])}return e}},methods:{getItemStyle(e){let t=Number(this.column),n=100/t+`%`,r=0,i=0;return t>1&&(this.itemSpacing&&(i=this.adapter.doSize(this.itemSpacing),r=this.adapter.doSize((t-1)*Number(this.itemSpacing)/t)),n=`calc(${n} - ${r})`,e%t===t-1&&(i=0)),{width:n,marginRight:i}},parsePadding(e){return String(e).replace(/[{}]/g,``).split(`,`)}}};function Bd(e,t,n,r,i,a){return B(),V(`div`,{class:`ce_gridlayout`,style:A(a.styleObj),onClick:t[0]||=t=>e.$emit(`click`,t)},[(B(!0),V(z,null,R(n.value||[],(t,n)=>(B(),V(`div`,{key:n,class:`ce_gridlayout_item`,style:A(a.getItemStyle(n))},[Qi(e.$slots,`default`,{item:t,index:n})],4))),128))],4)}var Vd=X(zd,[[`render`,Bd],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/GridLayout.vue`]]);function Hd(e){return t=>({get:()=>t[e],set:n=>{t[e]=n}})}function Ud(e){return t=>({get:()=>t[e].bind(t)})}function Wd(e,t=[]){return(n,r)=>({get:()=>(...i)=>(t.forEach(e=>{i[e]=Number(i[e])*r}),n[e](...i))})}var Gd={textAlign:Hd(`textAlign`),textBaseline:Hd(`textBaseline`),fillStyle:Hd(`fillStyle`),strokeStyle:Hd(`strokeStyle`),lineCap:Hd(`lineCap`),imageSmoothingEnabled:Hd(`imageSmoothingEnabled`),imageSmoothingQuality:Hd(`imageSmoothingQuality`),lineWidth:(e,t)=>({get:()=>e.lineWidth,set:n=>{e.lineWidth=n*t}}),font:(e,t,n)=>({get:()=>e.font,set:r=>{e.font=String(r).replace(/([0-9.]+)px/,(e,r)=>Number(r)*t*Number(n||1)+`px`)}}),fillText:(e,t,n,r)=>({get:()=>(...n)=>(n[0]=n[0]?r.adapter.doI18n(n[0]):n[0],[1,2].forEach(e=>{n[e]=Number(n[e])*t}),e.fillText(...n))}),fillRect:Wd(`fillRect`,[0,1,2,3]),moveTo:Wd(`moveTo`,[0,1]),lineTo:Wd(`lineTo`,[0,1]),arc:Wd(`arc`,[0,1,2]),clearRect:Wd(`clearRect`,[0,1,2,3]),createLinearGradient:Wd(`createLinearGradient`,[0,1,2,3]),createRadialGradient:Wd(`createRadialGradient`,[0,1,2,3,4,5]),beginPath:Ud(`beginPath`),closePath:Ud(`closePath`),fill:Ud(`fill`),stroke:Ud(`stroke`),measureText:(e,t)=>({get:()=>(...n)=>{let r=e.font;e.font=r.replace(/([0-9.]+)px/,(e,n)=>Number(n)/t+`px`);let i=e.measureText(...n);return e.font=r,i}}),setLineDash:e=>({get:()=>e.setLineDash.bind(e),set:t=>e.setLineDash(t)})};function Kd(e,t){function n(n,r){Object.keys(Gd).forEach(i=>{Object.defineProperty(this,i,Gd[i](e,n,r,t))})}return n.prototype=e,n}function qd(e,t){return function(n,r,i){this.width=n.width/r,this.height=n.height/r,this.style=e.style,this.getContext=function(...n){return new(Kd(e.getContext(...n),t))(r,i)}}}var Jd={name:`CeCanvas`,emits:[`onMeasured`],mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})}},computed:{styleObj(){return new qu(this,this.styleProps).parse()}},created(){this.resizeEvt=typeof window<`u`&&`orientationchange`in window?`orientationchange`:`resize`},mounted(){this.$nextTick(()=>this.doPaint()),typeof window<`u`&&window.addEventListener(this.resizeEvt,this.doRepaint,!1)},unmounted(){typeof window<`u`&&window.removeEventListener(this.resizeEvt,this.doRepaint,!1)},methods:{doPaint(){let e=this.$refs.canvas;if(!e)return;let t=e.getBoundingClientRect(),{availableWidth:n,applyUnitRatio:r,fontRatio:i=1}=this.adapter.getSystemInfo(),a=n*r/this.adapter.getDesignInfo().styleWidth||1,o=e.getContext(`2d`),s=(typeof window<`u`?window.devicePixelRatio:1)||1;e.width=t.width*s,e.height=t.height*s,o.scale(s,s);let c=new(qd(e,this))(t,a,i);this.$emit(`onMeasured`,{canvas:c,width:c.width,height:c.height})},doRepaint(){let e=this.$refs.canvas;e&&(e.getContext(`2d`).clearRect(0,0,e.width,e.height),this.doPaint())}}};function Yd(e,t,n,r,i,a){return B(),V(`canvas`,{ref:`canvas`,class:`ce_canvas`,style:A(a.styleObj)},null,4)}var Xd=X(Jd,[[`render`,Yd],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Canvas.vue`]]),Zd={name:`CeInput`,emits:[`input`,`change`],mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})},value:{type:[String,Number],default:``},placeholder:{type:[String,Number],default:``},inputType:{type:String,default:``},maxLength:{type:[String,Number],default:``}},data(){return{typeMap:{text:`text`,number:`text`,email:`text`,password:`password`,phone:`text`},regexpMap:{number:/^-?([0-9]*|(0|[1-9][0-9]*)\.[0-9]{0,})?$/i,email:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,phone:/^[0-9]{11}$/},inputValue:``,oldValue:``}},created(){this.inputValue=this.value,this.oldValue=this.inputValue},computed:{type(){return this.typeMap[this.inputType]},styleObj(){let e=new qu(this,this.styleProps),t=e.parse();return e.parseFont(this.styleProps.font||{},t),Object.assign({padding:`${this.adapter.doSize(4)} ${this.adapter.doSize(8)}`},t)}},watch:{value(){this.inputValue=this.value,this.oldValue=this.inputValue}},methods:{doInput(e){let t=this.regexpMap[this.inputType];!t||t.test(e)?(this.$emit(`input`,e),this.inputValue=e):this.inputValue=this.oldValue}}},Qd=[`type`,`placeholder`,`maxlength`,`value`];function $d(e,t,n,r,i,a){return B(),V(`input`,{class:`ce_input`,style:A(a.styleObj),type:a.type,placeholder:e.doI18n(n.placeholder),maxlength:n.maxLength,value:i.inputValue,onInput:t[0]||=t=>e.$emit(`input`,t.target.value),onChange:t[1]||=t=>e.$emit(`change`)},null,44,Qd)}var ef=X(Zd,[[`render`,$d],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Input.vue`]]),tf={name:`CeViewContainer`,emits:[`action`],mixins:[Ju],inject:[`adapter`,`customComponents`],props:{styleProps:{type:Object,default:()=>({})},customClass:{type:String,default:``},customProps:{type:Object,default:()=>({})},customRemarkImg:{type:String,default:``}},computed:{componentClass(){let e=this.customComponents;return e?this.customClass?e[this.customClass]||e.Placeholder||``:e.Placeholder||``:``},componentProps(){return this.customProps||{}},componentIcon(){return this.customRemarkImg||``},styleObj(){return new qu(this,this.styleProps).parse()}}};function nf(e,t,n,r,i,a){return B(),V(`div`,{class:`ce_viewcontainer`,style:A(a.styleObj)},[a.componentClass?(B(),H(Yi(a.componentClass),{key:0,icon:a.componentIcon,props:a.componentProps,"custom-class":n.customClass,onAction:t[0]||=t=>e.$emit(`action`,t)},null,40,[`icon`,`props`,`custom-class`])):K(`v-if`,!0)],4)}var rf=X(tf,[[`render`,nf],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ViewContainer.vue`]]),af={TopLeft:{justifyContent:`flex-start`,alignItems:`flex-start`},TopCenter:{justifyContent:`flex-start`,alignItems:`center`},TopRight:{justifyContent:`flex-start`,alignItems:`flex-end`},CenterLeft:{justifyContent:`center`,alignItems:`flex-start`},Center:{justifyContent:`center`,alignItems:`center`},CenterRight:{justifyContent:`center`,alignItems:`flex-end`},BottomLeft:{justifyContent:`flex-end`,alignItems:`flex-start`},BottomCenter:{justifyContent:`flex-end`,alignItems:`center`},BottomRight:{justifyContent:`flex-end`,alignItems:`flex-end`}},of={name:`CeAbsoluteLayout`,mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})},align:{type:String,default:``}},computed:{styleObj(){let e=new qu(this,this.styleProps).parse();return Object.assign(e,af[this.align]||{})}}};function sf(e,t,n,r,i,a){return B(),V(`div`,{class:`ce_absolutelayout`,style:A(a.styleObj)},[Qi(e.$slots,`default`)],4)}var cf=X(of,[[`render`,sf],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/AbsoluteLayout.vue`]]),lf={CheckGroupCircle:[`M512 65.983389c-245.919634 0-446.016611 200.095256-446.016611 446.016611 0 245.952318 200.064292 446.016611 446.016611 446.016611S958.016611 757.952318 958.016611 512C958.016611 266.080366 757.952318 65.983389 512 65.983389zM512 894.016611c-210.655557 0-382.016611-171.392017-382.016611-382.016611 0-210.655557 171.359333-382.016611 382.016611-382.016611 210.624593 0 382.016611 171.359333 382.016611 382.016611C894.016611 722.624593 722.624593 894.016611 512 894.016611z`,`M512 352.00086c-88.223841 0-160.00086 71.775299-160.00086 159.99914s71.775299 160.00086 160.00086 160.00086 160.00086-71.775299 160.00086-160.00086S600.223841 352.00086 512 352.00086z`],CheckGroupSquareEmpty:[`M833.008 928h-640c-52.944 0-96-43.072-96-96V192c0-52.928 43.056-96 96-96h640c52.912 0 96 43.072 96 96v640c0 52.928-43.072 96-96 96z m-640-768c-17.648 0-32 14.368-32 32v640c0 17.664 14.352 32 32 32h640a32 32 0 0 0 32-32V192c0-17.632-14.352-32-32-32h-640z`],CheckGroupSquareEmptyCheck:[`M727.984 393.184a31.968 31.968 0 0 0-45.248 0.256L449.44 629.248l-103.28-106.112a32 32 0 1 0-45.888 44.608l126.032 129.504c0.048 0.096 0.192 0.096 0.256 0.192 0.064 0.064 0.096 0.192 0.16 0.256 2.016 1.984 4.512 3.2 6.88 4.544 1.248 0.672 2.24 1.792 3.52 2.304a31.728 31.728 0 0 0 24.064 0.064c1.232-0.512 2.208-1.536 3.392-2.176 2.4-1.344 4.896-2.528 6.944-4.544 0.064-0.064 0.096-0.192 0.192-0.256 0.064-0.096 0.16-0.128 0.256-0.192l256.224-259.008a32 32 0 0 0-0.224-45.248zM832.992 928h-640c-52.928 0-96-43.072-96-96V192c0-52.928 43.072-96 96-96h640c52.928 0 96 43.072 96 96v640c0 52.928-43.056 96-96 96z m-640-768c-17.632 0-32 14.368-32 32v640c0 17.664 14.368 32 32 32h640a32 32 0 0 0 32-32V192c0-17.632-14.336-32-32-32h-640z`],CheckGroupSquare:[`M186 123c-33.137 0-60 26.863-60 60v655c0 33.137 26.863 60 60 60h655c33.137 0 60-26.863 60-60V183c0-33.137-26.863-60-60-60H186z m0-60h655c66.274 0 120 53.726 120 120v655c0 66.274-53.726 120-120 120H186c-66.274 0-120-53.726-120-120V183c0-66.274 53.726-120 120-120z`],CheckGroupSquareCheck:[`M840.6 97H185.4C137.1 97 98 136.1 98 184.4v655.3c0 48.3 39.1 87.4 87.4 87.4h655.3c48.3 0 87.4-39.1 87.4-87.4V184.4C928 136.1 888.9 97 840.6 97zM791 380.7L466.7 705.1c-17.1 17.1-44.7 17.1-61.8 0L235 535.2c-17.1-17.1-17.1-44.7 0-61.8 17.1-17.1 44.7-17.1 61.8 0l139 139L729.2 319c17.1-17.1 44.7-17.1 61.8 0 17.1 17 17.1 44.7 0 61.7z`]},uf={RadioButtonCircle:[`M512 65.983389c-245.919634 0-446.016611 200.095256-446.016611 446.016611 0 245.952318 200.064292 446.016611 446.016611 446.016611S958.016611 757.952318 958.016611 512C958.016611 266.080366 757.952318 65.983389 512 65.983389zM512 894.016611c-210.655557 0-382.016611-171.392017-382.016611-382.016611 0-210.655557 171.359333-382.016611 382.016611-382.016611 210.624593 0 382.016611 171.359333 382.016611 382.016611C894.016611 722.624593 722.624593 894.016611 512 894.016611z`,`M512 352.00086c-88.223841 0-160.00086 71.775299-160.00086 159.99914s71.775299 160.00086 160.00086 160.00086 160.00086-71.775299 160.00086-160.00086S600.223841 352.00086 512 352.00086z`],RadioButtonCircleEmpty:[`M512 938.666667C276.362667 938.666667 85.333333 747.637333 85.333333 512S276.362667 85.333333 512 85.333333s426.666667 191.029333 426.666667 426.666667-191.029333 426.666667-426.666667 426.666667z m0-64c200.298667 0 362.666667-162.368 362.666667-362.666667S712.298667 149.333333 512 149.333333 149.333333 311.701333 149.333333 512s162.368 362.666667 362.666667 362.666667z`],RadioButtonCircleEmptyCheck:[`M512 85.333333c235.637333 0 426.666667 191.029333 426.666667 426.666667S747.637333 938.666667 512 938.666667 85.333333 747.637333 85.333333 512 276.362667 85.333333 512 85.333333z m182.613333 297.354667a32 32 0 0 0-45.258666 0.032L458.922667 573.44l-84.341334-83.989333a32 32 0 0 0-45.162666 45.344l106.986666 106.549333a32 32 0 0 0 45.226667-0.064l213.013333-213.333333a32 32 0 0 0-0.032-45.258667z`]},df={name:`CeCheckGroup`,mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})},value:{type:[Array,String,Number],default:()=>[]},dataList:{type:Array,default:()=>[]},selectColor:{type:String,default:`#0082ff`},unSelectColor:{type:String,default:`#333333`},buttonStyle:{type:String,default:`Circle`},maxSelectCount:{type:[String,Number],default:`0`},direction:{type:String,default:`horizontal`},itemPadding:{type:[String,Number],default:`4 10 4 10`},itemSpacing:{type:[String,Number],default:`4`},textSpacing:{type:[String,Number],default:`3`},fontSize:{type:[String,Number],default:`13`},iconSize:{type:[String,Number],default:`14`}},emits:[`change`,`selectChange`],computed:{rootStyle(){return{overflow:`hidden`,boxSizing:`border-box`}},checkedSet(){let e=this.value;return Array.isArray(e)?new Set(e.map(String)):e===``||e==null?new Set:new Set([String(e)])},limit(){let e=Number(this.maxSelectCount);return Number.isFinite(e)&&e>0?e:1/0}},methods:{isChecked(e){return this.checkedSet.has(String(e.key))},checkPaths(e){let t=this.isChecked(e);switch(this.buttonStyle){case`SquareEmpty`:return lf[t?`CheckGroupSquareEmptyCheck`:`CheckGroupSquareEmpty`];case`Square`:return lf[t?`CheckGroupSquareCheck`:`CheckGroupSquare`];case`Text`:return[];default:return lf.CheckGroupCircle}},itemStyle(e){let t=String(this.itemPadding).split(/\s+/),n=Number(this.itemSpacing)||0,r=e===this.dataList.length-1?0:n,i=e===this.dataList.length-1?0:n,a=(e,t)=>this.adapter.doSize(e[t]===void 0?e[0]||0:e[t]),o=t.length>=4?`${a(t,0)} ${a(t,1)} ${a(t,2)} ${a(t,3)}`:this.adapter.doSize(this.itemPadding);return this.direction===`vertical`?{padding:o,marginBottom:i}:{padding:o,marginRight:r}},toggle(e){let t=String(e.key),n=new Set(this.checkedSet);n.has(t)?n.delete(t):(n.size>=this.limit&&n.clear(),n.add(t));let r=[...n];this.$emit(`change`,r),this.$emit(`selectChange`,{value:r,item:e})}}},ff=[`onClick`],pf={class:`ce_svgcheckstyle`,viewBox:`0 0 1024 1024`},mf=[`d`,`fill`],hf=[`title`];function gf(e,t,n,r,i,a){return B(),V(`div`,{class:`ce_check_group`,style:A(a.rootStyle)},[U(`div`,{class:`ce_check_list`,style:A({flexDirection:n.direction===`vertical`?`column`:`row`})},[(B(!0),V(z,null,R(n.dataList,(e,t)=>(B(),V(`div`,{key:e.key,class:`ce_check_item`,style:A(a.itemStyle(t)),onClick:t=>a.toggle(e)},[n.buttonStyle===`Text`?K(`v-if`,!0):(B(),V(`div`,{key:0,class:`ce_check_icon`,style:A({width:n.iconSize+`px`,height:n.iconSize+`px`,marginRight:n.textSpacing+`px`})},[(B(),V(`svg`,pf,[(B(!0),V(z,null,R(a.checkPaths(e),(t,r)=>(B(),V(`path`,{key:r,d:t,fill:a.isChecked(e)?n.selectColor:n.unSelectColor},null,8,mf))),128))]))],4)),U(`span`,{class:`ce_check_text`,title:e.desc,style:A({color:a.isChecked(e)?n.selectColor:n.unSelectColor,fontSize:n.fontSize+`px`})},M(e.desc),13,hf)],12,ff))),128))],4)],4)}var _f=X(df,[[`render`,gf],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/CheckGroup.vue`]]),vf={name:`CeRadioButton`,mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})},value:{type:[String,Number],default:``},selectColor:{type:String,default:`#0082ff`},unSelectColor:{type:String,default:`#333333`},buttonStyle:{type:String,default:`Circle`},textSpacing:{type:[String,Number],default:`3`},fontSize:{type:[String,Number],default:`14`},iconSize:{type:[String,Number],default:`14`},showText:{type:[String,Number],default:`1`},text:{type:[String,Number],default:``}},emits:[`change`,`selectChange`],computed:{rootStyle(){return{overflow:`hidden`,boxSizing:`border-box`}},selected(){let e=this.value;return e!==``&&e!=null&&e!==!1&&e!==`0`},color(){return this.selected?this.selectColor:this.unSelectColor},radioPaths(){return this.selected&&this.buttonStyle===`CircleEmpty`?uf.RadioButtonCircleEmptyCheck:this.buttonStyle===`CircleEmpty`?uf.RadioButtonCircleEmpty:uf.RadioButtonCircle}},methods:{toggle(){let e=this.selected?``:this.value||`1`;this.$emit(`change`,e),this.$emit(`selectChange`,!!e)}}},yf=[`d`];function bf(e,t,n,r,i,a){return B(),V(`span`,{class:`ce_radio_button`,style:A(a.rootStyle)},[U(`div`,{class:`ce_radio_item`,onClick:t[0]||=(...e)=>a.toggle&&a.toggle(...e)},[n.buttonStyle===`Text`?K(`v-if`,!0):(B(),V(`span`,{key:0,class:`ce_radio_icon`,style:A({width:n.iconSize+`px`,height:n.iconSize+`px`,marginRight:n.textSpacing+`px`})},[(B(),V(`svg`,{class:`ce_svgradiostyle`,viewBox:`0 0 1024 1024`,style:A({fill:a.color,stroke:a.color})},[(B(!0),V(z,null,R(a.radioPaths,(e,t)=>(B(),V(`path`,{key:t,d:e},null,8,yf))),128))],4))],4)),n.showText===`1`||n.showText===1?(B(),V(`span`,{key:1,style:A({color:a.color,fontSize:n.fontSize+`px`})},M(e.doI18n(n.text)),5)):K(`v-if`,!0)])],4)}var xf=X(vf,[[`render`,bf],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/RadioButton.vue`]]),Sf={name:`CeProgressSlider`,mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})},value:{type:[String,Number],default:0},minProgress:{type:[String,Number],default:0},maxProgress:{type:[String,Number],default:100},step:{type:[String,Number],default:1},backgroundColor:{type:String,default:`#e6e6e6`},foregroundColor:{type:String,default:`#0a59f5`},processHeight:{type:[String,Number],default:5},blockStyle:{type:String,default:`circle`},blockColor:{type:String,default:`#ffffff`},blockImage:{type:String,default:``},blockWidth:{type:[String,Number],default:15},blockHeight:{type:[String,Number],default:15}},emits:[`change`,`selectChange`],data(){return{dragging:!1}},computed:{rootStyle(){let e=(Number(this.processHeight)||5)+16,t=Number(this.blockHeight)||15;return{height:`auto`,minHeight:this.adapter.doSize(Math.max(e,t)),boxSizing:`border-box`}},min(){let e=Number(this.minProgress);return Number.isFinite(e)?e:0},max(){let e=Number(this.maxProgress);return Number.isFinite(e)?e:100},stepVal(){let e=Number(this.step);return e>0?e:1},numValue(){let e=Number(this.value);return Number.isFinite(e)?e:this.min},percent(){let e=this.max-this.min||1,t=(this.numValue-this.min)/e*100;return Math.max(0,Math.min(100,t))},conLeft(){let e=Number(this.blockWidth)||15;return`calc(${e/2}px + (100% - ${e}px) * ${this.percent} / 100)`},rectStyle(){let e=Number(this.processHeight)||5;return{backgroundColor:this.adapter.doColor(this.backgroundColor),height:this.adapter.doSize(e),borderRadius:this.adapter.doSize(e),marginTop:this.adapter.doSize(8),marginBottom:this.adapter.doSize(8)}},barStyle(){let e=Number(this.processHeight)||5,t=Number(this.blockWidth)||15;return{backgroundColor:this.adapter.doColor(this.foregroundColor),left:this.adapter.doSize(t/2),width:`calc((100% - ${t}px) * ${this.percent} / 100)`,borderTopLeftRadius:this.adapter.doSize(e),borderBottomLeftRadius:this.adapter.doSize(e)}},blockStyleObj(){let e=Number(this.blockWidth)||15,t=Number(this.blockHeight)||15,n={width:this.adapter.doSize(e),height:this.adapter.doSize(t),boxShadow:`rgba(0,0,0,0.3) 0 0 3px 0`};return this.blockStyle===`image`&&this.blockImage?(n.backgroundImage=`url(${this.adapter.doReplaceUrl(this.doI18n(this.blockImage))})`,n.borderRadius=`0`):this.blockStyle===`circle`?(n.backgroundColor=this.adapter.doColor(this.blockColor),n.borderRadius=this.adapter.doSize(Math.min(e,t)/2)):(n.backgroundColor=this.adapter.doColor(this.blockColor),n.borderRadius=this.adapter.doSize(2)),n}},methods:{clampStep(e){let t=Math.max(this.min,Math.min(this.max,e)),n=Math.round((t-this.min)/this.stepVal)*this.stepVal+this.min;return Math.max(this.min,Math.min(this.max,n))},valueFromEvent(e){let t=this.$refs.rect;if(!t)return this.numValue;let n=t.getBoundingClientRect(),r=(e.clientX-n.left)/n.width;return this.clampStep(this.min+r*(this.max-this.min))},onDown(e){this.dragging=!0,this.setValue(this.valueFromEvent(e)),window.addEventListener(`pointermove`,this.onMove),window.addEventListener(`pointerup`,this.onUp)},onMove(e){this.dragging&&this.setValue(this.valueFromEvent(e))},onUp(){this.dragging=!1,window.removeEventListener(`pointermove`,this.onMove),window.removeEventListener(`pointerup`,this.onUp)},setValue(e){this.$emit(`change`,e),this.$emit(`selectChange`,e)}},beforeUnmount(){this.onUp()}};function Cf(e,t,n,r,i,a){return B(),V(`div`,{class:`ce_slider`,style:A(a.rootStyle)},[U(`div`,{ref:`rect`,class:`ce_slider_rect`,style:A(a.rectStyle),onPointerdown:t[0]||=(...e)=>a.onDown&&a.onDown(...e)},[U(`div`,{class:`ce_slider_bar`,style:A(a.barStyle)},null,4),U(`div`,{class:`ce_slider_con`,style:A({left:a.conLeft})},[U(`div`,{class:j([`ce_slider_block`,{ce_dragging:i.dragging}]),style:A(a.blockStyleObj)},null,6)],4)],36)],4)}var wf=X(Sf,[[`render`,Cf],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ProgressSlider.vue`]]),Tf={name:`CeVideo`,mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})},url:{type:String,default:``},previewUrl:{type:String,default:``}},emits:[`click`],data(){return{showPoster:!0}},computed:{rootStyle(){let e=new qu(this,this.styleProps).parse();return Object.assign(e,{overflow:`hidden`,boxSizing:`border-box`})},src(){return this.adapter.doReplaceUrl(this.doI18n(this.url||``))},poster(){return this.adapter.doReplaceUrl(this.doI18n(this.previewUrl||``))}},methods:{play(){this.showPoster=!1;let e=this.$refs.video;if(e)try{e.play()}catch{}this.$emit(`click`)}}},Ef=[`src`,`poster`];function Df(e,t,n,r,i,a){return B(),V(`div`,{class:`ce_video`,style:A(a.rootStyle)},[U(`video`,{ref:`video`,class:`ce_video_elem ce_npc`,src:a.src,poster:a.poster,controls:``,playsinline:``,"webkit-playsinline":``},null,8,Ef),a.poster&&i.showPoster?(B(),V(`div`,{key:0,class:`ce_video_poster ce_npc`,style:A({backgroundImage:`url(${a.poster})`,backgroundSize:`cover`,backgroundPosition:`center`}),onClick:t[0]||=(...e)=>a.play&&a.play(...e)},null,4)):K(`v-if`,!0)],4)}var Of=X(Tf,[[`render`,Df],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Video.vue`]]),kf={name:`CeMap`,mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})},centerLat:{type:[String,Number],default:``},centerLng:{type:[String,Number],default:``},zoom:{type:[String,Number],default:``},markerLat:{type:[String,Number],default:``},markerLng:{type:[String,Number],default:``},markerName:{type:String,default:``}},emits:[`click`],computed:{rootStyle(){let e=new qu(this,this.styleProps).parse();return e.overflow=`hidden`,e}}},Af={class:`ce_map_view`},jf={class:`ce_map_center`},Mf={key:0,class:`ce_map_markname`};function Nf(e,t,n,r,i,a){return B(),V(`div`,{class:`ce_map`,style:A(a.rootStyle)},[U(`div`,Af,[t[1]||=as(`<svg class="ce_map_grid" viewBox="0 0 100 100" preserveAspectRatio="none" data-v-512dee75><defs data-v-512dee75><pattern id="ceMapGrid" width="10" height="10" patternUnits="userSpaceOnUse" data-v-512dee75><path d="M10 0 L0 0 0 10" fill="none" stroke="#dfe3ea" stroke-width="0.4" data-v-512dee75></path></pattern></defs><rect width="100" height="100" fill="#eef1f6" data-v-512dee75></rect><rect width="100" height="100" fill="url(#ceMapGrid)" data-v-512dee75></rect><!-- 模拟几条道路 --><path d="M0 60 Q40 50 100 65" fill="none" stroke="#cdd4df" stroke-width="2.2" data-v-512dee75></path><path d="M30 0 L45 100" fill="none" stroke="#cdd4df" stroke-width="2.2" data-v-512dee75></path></svg>`,1),U(`div`,jf,[t[0]||=U(`div`,{class:`ce_map_pin`},[U(`svg`,{viewBox:`0 0 24 24`,width:`26`,height:`26`},[U(`path`,{d:`M12 2C7.6 2 4 5.6 4 10c0 5.4 7.1 11.6 7.4 11.9.6.6 1.6.6 2.2 0C13.9 21.6 21 15.4 21 10c0-4.4-3.6-8-9-8z`,fill:`#ff4d4f`}),U(`circle`,{cx:`12`,cy:`10`,r:`3`,fill:`#fff`})])],-1),n.markerName?(B(),V(`div`,Mf,M(e.doI18n(n.markerName)),1)):K(`v-if`,!0)])]),t[2]||=U(`div`,{class:`ce_map_placeholder`},null,-1)],4)}var Pf=X(kf,[[`render`,Nf],[`__scopeId`,`data-v-512dee75`],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Map.vue`]]),Ff={name:`CeMultiColumn`,emits:[`click`],mixins:[Ju],props:{styleProps:{type:Object,default:()=>({})},column:{type:[Number,String],default:2}},computed:{styleObj(){let e=new qu(this,this.styleProps).parse(),t=parseInt(this.column,10);return t&&t>1&&(e.display=`grid`,e.gridTemplateColumns=`repeat(${t}, 1fr)`),e}}};function If(e,t,n,r,i,a){return B(),V(`div`,{ref:`mc`,class:`ce_multicolumn`,style:A(a.styleObj),onClick:t[0]||=t=>e.$emit(`click`,t)},[Qi(e.$slots,`default`,{},void 0,!0)],4)}var Lf={Root:Zu,Row:ed,Column:rd,Text:od,Button:ld,Divider:fd,Icon:Dd,Image:Ad,MultiText:Fd,ListLayout:Rd,GridLayout:Vd,Canvas:Xd,Input:ef,ViewContainer:rf,AbsoluteLayout:cf,CheckGroup:_f,RadioButton:xf,ProgressSlider:wf,Video:Of,Map:Pf,MultiColumn:X(Ff,[[`render`,If],[`__scopeId`,`data-v-1881a1f4`],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/MultiColumn.vue`]])},Rf=new Set([`ListLayout`,`GridLayout`]);function zf(e){return Lf[e]||null}function Bf(e){let t={},n=e||{};for(let e in n)e===`$$`?t[e]=n[e]:t[`$`+e]=n[e];return t}function Vf(e,t){let n=Bf(t),r=new Proxy(n,{has(e,t){return typeof t==`string`&&(t[0]===`$`||t===`$$`)||t in e},get(e,t){if(t in e||typeof t!=`string`||t[0]!==`$`&&t!==`$$`)return e[t]}});return Function(`vars`,`\n\t\twith(vars){\n\t\t\treturn (${e})\n\t\t}\n\t`)(r)}function Hf(e,t,n){let r=String(t).split(`.`),i=r.pop(),a=e;for(let e=0;e<r.length;e++)a=a[r[e]];a[i]=n}function Uf(e={},t={},n){let r=JSON.parse(JSON.stringify(e||{})),i=e&&e.__vars__;if(i)for(let e in i)try{Hf(r,e,Vf(i[e],t))}catch(t){n&&n.push({kind:`bind`,msg:`${e} <- ${i[e]}: ${t&&t.message}`,path:e,expr:i[e]})}return delete r.__vars__,r}function Wf(e,t,n){return Object.assign({},e,typeof t==`object`&&t||{},{$$:t,_index:n})}function Gf(e,t){return new Proxy({},{get(n,r){return r in t?t[r]:e[r]},has(n,r){return r in t||r in e},ownKeys(){let n=new Set;for(let e of Object.keys(t))n.add(e);for(let t of Object.keys(e))n.add(t);return[...n]},getOwnPropertyDescriptor(n,r){if(r in t)return{enumerable:!0,configurable:!0,value:t[r]};if(r in e)return{enumerable:!0,configurable:!0,value:e[r]}}})}var Kf={name:`CustomPlaceholder`,props:{icon:{type:String,default:``},props:{type:Object,default:()=>({})},customClass:{type:String,default:``},title:{type:String,default:``}},computed:{tagText(){return this.title||`自定义组件`},label(){if(this.customClass)return this.customClass;let e=Object.keys(this.props||{});return e.length?e.join(`, `):`未指定 customClass`}}},qf={class:`ce_custom_placeholder`},Jf={class:`ce_custom_placeholder_tag`},Yf={class:`ce_custom_placeholder_name`};function Xf(e,t,n,r,i,a){return B(),V(`div`,qf,[U(`span`,Jf,M(a.tagText),1),U(`span`,Yf,M(a.label),1),Qi(e.$slots,`default`)])}var Zf=X(Kf,[[`render`,Xf],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/CustomPlaceholder.vue`]]),Qf=nn({el:null,id:null,visible:!1,top:0,left:0,width:0,height:0});function $f(e,t){Qf.id!==t&&(Qf.el=e,Qf.id=t,Qf.visible=!0)}function ep(e){Qf.id===e&&(Qf.el=null,Qf.id=null,Qf.visible=!1)}var tp=new Set([``,`onReady`,`onLoad`,`onCreate`]);function np(e){return tp.has(e||``)}function rp(e){let t=String(e).replace(/-(\w)/g,(e,t)=>t.toUpperCase());return`on`+t.charAt(0).toUpperCase()+t.slice(1)}function ip(e){return typeof window<`u`&&window.CSS&&CSS.escape?CSS.escape(String(e)):String(e).replace(/["\\\]]/g,`\\$&`)}var ap=X({name:`RenderTree`,inject:[`adapter`,`cardRuntime`],props:{node:{type:Object,required:!0},scope:{type:Object,default:()=>({})},selectedNodeId:{type:String,default:``}},methods:{getChildNodes(e){let t=e.slots||[];return t.length&&t[0].components&&t[0].components.length?t[0].components:e.components||[]},actionCode(e){let t=e.action&&e.action.properties&&e.action.properties.function||{};return t.code||t.compiled||``},isVisible(e,t){let n=this.cardRuntime,r=e.directives&&e.directives[`v-show`];if(!r)return!0;let i=r.showType||`00`;if(i===`00`)return!0;let a=(r.condition||{}).expression;if(!a)return i===`01`;try{let e=Vf(a,t);return i===`01`?!!e:!e}catch(t){return n.pushError(`vshow`,`${e.className}: [${a}] -> ${t.message}`),i===`01`}},buildHandlers(e,t){this.cardRuntime;let n={};return(e.eventactions||[]).forEach(r=>{let i=(r.event||{}).eventKey||``;if(np(i))return;let a=r.action||{},o=a.actionType;if(o===`customAction`){let a=this.actionCode(r);n[i]=n=>this.runCustomAction(a,t,n,e)}else n[i]=n=>this.runSystemAction(o,a.properties,t,n,e)}),n},runCustomAction(e,t,n,r){let i=this.cardRuntime,a={state:new Proxy(t,{set(e,t,n){return i.state[t]=n,!0}}),data:i.state,setData(e){e&&typeof e==`object`&&Object.assign(i.state,e),i.markDirty()},setRootData(e){e&&typeof e==`object`&&Object.assign(i.rootScope,e),i.markDirty()},addEventListener(e,t){i.addEventListener(e,t)},postMessage(e,t){i.postMessage(e,t)}},o={log:(...e)=>{console.log(...e),i.pushLog(`log`,e)},info:(...e)=>{console.info(...e),i.pushLog(`info`,e)},warn:(...e)=>{console.warn(...e),i.pushLog(`warn`,e)},error:(...e)=>{console.error(...e),i.pushLog(`error`,e)},debug:(...e)=>{console.debug(...e),i.pushLog(`debug`,e)}};try{Function(`event`,`console`,e||``).apply(a,[n,o])}catch(e){let t=r&&r.id?`${r.className}(${r.id})`:r.className;i.pushError(`customAction`,`${t}: ${e.message}`),console.error(`[customAction error]`,t,e)}},runSystemAction(e,t,n,r,i){let a=this.cardRuntime,o=typeof window<`u`?window.ynet:null;!o&&typeof window<`u`&&(o=window.ynet={callJSAPI(e,t,n){if(a.pushApiCall(e,t),typeof n==`function`)try{n({})}catch{}}});let s=t||{};e===`closeAlertCard`?o.callJSAPI(`closeAlertCard`,s,s&&s.callback):e===`sendAiChatMessage`?o.callJSAPI(`sendAiChatMessage`,{message:s&&s.message||``},void 0):o.callJSAPI(e,s,void 0),a.pushApiCall(e,s)},runLoadActions(){let e=this.cardRuntime,t=this.node;t.__loadRan||(t.__loadRan=!0,(t.eventactions||[]).forEach(n=>{if(!np((n.event||{}).eventKey||``)||(n.action||{}).actionType!==`customAction`)return;let r=this.actionCode(n);r&&this.runCustomAction(r,Gf(e.state,this.scope),void 0,t)}))},renderNode(e){if(e.visible===!1)return null;let t=this.cardRuntime,n=Gf(t.state,this.scope);if(!this.isVisible(e,n))return null;let r=zf(e.className);if(!r){let t=this.getChildNodes(e).map(e=>this.renderSub(e,n));return Vs(Zf,{customClass:e.className,title:`未知组件`},()=>t)}let i=Uf(e.properties||{},n,t.getBindingBuffer()),a=Uf(e.style&&e.style.properties||{},n,t.getBindingBuffer()),o=Object.assign({},i,{styleProps:a});o[`data-cid`]=e.componentId||e.id,o[`data-class`]=e.className,o[`data-id`]=e.id;let s=this.buildHandlers(e,n);for(let e in s)o[rp(e)]=s[e];if(e.className===`Input`&&!o.onInput){let n=(e.properties&&e.properties.__vars__||{}).value,r=/^\s*\$([A-Za-z_$][\w$]*)\s*$/.exec(String(n||``));if(r){let e=r[1];o.onInput=n=>{t.state[e]=n}}}if((e.className===`RadioButton`||e.className===`CheckGroup`)&&!o.onChange){let n=(e.properties&&e.properties.__vars__||{}).value,r=/^\s*\$([A-Za-z_$][\w$]*)\s*$/.exec(String(n||``));if(r){let e=r[1];o.onChange=n=>{t.state[e]=n,t.markDirty()}}}if(e.className===`ProgressSlider`){let n=(e.properties&&e.properties.__vars__||{}).value,r=/^\s*\$([A-Za-z_$][\w$]*)\s*$/.exec(String(n||``));if(r){let e=r[1],n=n=>{t.state[e]=n,t.markDirty()},i=o.onChange,a=o.onSelectChange;o.onChange=e=>{try{i&&i(e)}finally{n(e)}},o.onSelectChange=e=>{try{a&&a(e)}finally{n(e)}}}}let c=this.getChildNodes(e);return Rf.has(e.className)?Vs(r,o,{default:e=>{let t=Wf(n,e.item,e.index);return c.map(e=>this.renderSub(e,t))}}):Vs(r,o,()=>c.map(e=>this.renderSub(e,n)))},renderSub(e,t){return Vs(ap,{node:e,scope:t,selectedNodeId:this.selectedNodeId})},updateHighlight(){let e=this.$el;if(!e||e.nodeType!==1)return;let t=this.node.id;if(this.selectedNodeId&&t===this.selectedNodeId){let n=typeof document<`u`?document.querySelector(`.phone__screen`):null;$f((n?n.querySelector(`[data-id="`+ip(String(t))+`"]`):null)||e,t)}else ep(t)}},render(){return this.cardRuntime.revision,this.node.className===`Root`&&this.cardRuntime.startBindingPass(),this.renderNode(this.node)},created(){this.runLoadActions()},mounted(){this.runLoadActions(),this.$nextTick(()=>this.updateHighlight()),this.node.className===`Root`&&this.cardRuntime.commitBindingPass()},updated(){this.node.className===`Root`&&this.cardRuntime.commitBindingPass()},watch:{selectedNodeId(){this.updateHighlight()}}},[[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/RenderTree.vue`]]);async function op(e){try{if(navigator.clipboard&&navigator.clipboard.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}var sp=nn({visible:!1,message:``,type:`ok`}),cp=null;function Z(e,t=`ok`,n=2400){sp.message=e,sp.type=t,sp.visible=!0,cp&&clearTimeout(cp),cp=setTimeout(()=>{sp.visible=!1,cp=null},n)}var lp={name:`ConfirmDialog`,props:{visible:{type:Boolean,default:!1},title:{type:String,default:``},message:{type:String,default:``},confirmText:{type:String,default:`继续`},cancelText:{type:String,default:`取消`},closeOnMask:{type:Boolean,default:!0},severity:{type:String,default:`primary`,validator:e=>[`primary`,`warn`,`danger`].includes(e)}},emits:[`confirm`,`cancel`],computed:{confirmBtnClass(){return this.severity===`danger`?`confirm-modal__btn--danger`:this.severity===`warn`?`confirm-modal__btn--warn`:`confirm-modal__btn--primary`}}},up=[`aria-label`],dp={key:0,class:`confirm-modal__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},fp={key:1,class:`confirm-modal__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},pp={key:2,class:`confirm-modal__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},mp={class:`confirm-modal__desc`},hp={class:`confirm-modal__actions`};function gp(e,t,n,r,i,a){return B(),H(ic,{name:`modal`},{default:Lr(()=>[n.visible?(B(),V(`div`,{key:0,class:`confirm-mask`,onClick:t[2]||=q(t=>n.closeOnMask&&e.$emit(`cancel`),[`self`])},[U(`div`,{class:`confirm-modal modal-card`,role:`alertdialog`,"aria-modal":`true`,"aria-label":n.title},[U(`div`,{class:j([`confirm-modal__title`,{"is-danger":n.severity===`danger`,"is-warn":n.severity===`warn`}])},[n.severity===`danger`?(B(),V(`svg`,dp,[...t[3]||=[U(`use`,{href:`#icon-no-entry`},null,-1)]])):n.severity===`warn`?(B(),V(`svg`,fp,[...t[4]||=[U(`use`,{href:`#icon-alert-triangle`},null,-1)]])):(B(),V(`svg`,pp,[...t[5]||=[U(`use`,{href:`#icon-gear`},null,-1)]])),G(` `+M(n.title),1)],2),U(`div`,mp,M(n.message),1),U(`div`,hp,[U(`button`,{class:`confirm-modal__btn confirm-modal__btn--ghost`,type:`button`,onClick:t[0]||=t=>e.$emit(`cancel`)},M(n.cancelText),1),U(`button`,{class:j([`confirm-modal__btn`,a.confirmBtnClass]),type:`button`,onClick:t[1]||=t=>e.$emit(`confirm`)},M(n.confirmText),3)])],8,up)])):K(`v-if`,!0)]),_:1})}var _p=X(lp,[[`render`,gp],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ConfirmDialog.vue`]]),vp=nn({openAll:null,selectedPath:null});function yp(e,t,n){let r=e;for(let e=0;e<t.length-1;e++)r=r[t[e]];r[t[t.length-1]]=n}function bp(e,t){let n=e;for(let e=0;e<t.length-1;e++)n=n[t[e]];delete n[t[t.length-1]]}function xp(e,t,n,r){if(!r||r===n)return!1;let i=e;for(let e=0;e<t.length;e++)i=i[t[e]];if(r in i)return!1;let a=i[n];return delete i[n],i[r]=a,!0}function Sp(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}var Cp={name:`JsonTree`,components:{ConfirmDialog:_p},props:{data:{type:[Object,Array],default:()=>({})},depth:{type:Number,default:0},rt:{type:Object,default:null},path:{type:Array,default:()=>[]},editable:{type:Boolean,default:!1},schema:{type:Object,default:null}},data(){return{localOpen:{},editingKey:null,editingValue:null,editingComplex:null,jsonEditText:``,ctxMenu:{visible:!1,x:0,y:0,item:null},delConfirm:{show:!1,message:``,item:null}}},computed:{isRoot(){return this.depth===0},entries(){let e=this.data;return Array.isArray(e)?e.map((e,t)=>this.makeEntry(String(t),e,!0,t)):e&&typeof e==`object`?Object.keys(e).map(t=>this.makeEntry(t,e[t],!1,t)):[]}},watch:{data(){this.initOpen(),this.isRoot&&(vp.selectedPath=null)}},created(){this.isRoot&&(vp.openAll=null),this.initOpen()},methods:{makeEntry(e,t,n,r){let i=Array.isArray(t),a=i?t.length:Object.keys(t||{}).length;return{key:String(r),keyLabel:e,value:t,isArrayBranch:n,isArray:i,count:a,type:this.valueType(t),path:[...this.path,r]}},valueType(e){return e===null?`null`:Array.isArray(e)?`array`:typeof e},isComplex(e){return typeof e==`object`&&!!e},initOpen(){let e={};this.entries.forEach(t=>{e[t.key]=this.depth<2}),this.localOpen=e},isOpen(e){return vp.openAll===null?!!this.localOpen[e]:vp.openAll},toggle(e){let t=!this.isOpen(e);this.localOpen[e]=t,vp.openAll=null},isSelected(e){let t=vp.selectedPath;return!t||t.length!==e.path.length?!1:t.every((t,n)=>String(t)===String(e.path[n]))},selectNode(e){vp.selectedPath=this.isSelected(e)?null:e.path.slice()},onBranchClick(e){this.toggle(e.key),vp.selectedPath=e.path.slice()},setOpen(e){vp.openAll=e},previewText(e){if(Array.isArray(e))return` … `+e.length+` 项`;let t=Object.keys(e);return` … `+t.slice(0,3).join(`, `)+(t.length>3?`, …`:``)+` `},formatPrimitive(e,t){return e===null?`null`:t===`string`?JSON.stringify(e):String(e)},formatForEdit(e,t){return e===null?`null`:t===`string`?e:String(e)},startEditKey(e){this.cancelEdit(),this.editingKey=e.key,this.$nextTick(()=>{let e=this.$refs.keyInput;if(e){let t=Array.isArray(e)?e[0]:e;t.focus(),t.select()}})},confirmEditKey(e,t){let n=t.target.value.trim();if(!n||n===e.keyLabel){this.cancelEdit();return}if(this.rt&&this.rt.rootScope){let t=e.path.slice(0,-1),r=e.path[e.path.length-1];if(!xp(this.rt.rootScope,t,r,n)){this.cancelEdit();return}this.rt.markDirty()}this.editingKey=null},startEditValue(e){this.cancelEdit(),this.editingValue=e.key,this.$nextTick(()=>{let e=this.$refs.valInput;if(e){let t=Array.isArray(e)?e[0]:e;t.focus(),t.select()}})},confirmEditValue(e,t){let n=t.target.value,r=n;if(e.type===`number`){let e=Number(n);isNaN(e)||(r=e)}else if(e.type===`boolean`)n===`true`?r=!0:n===`false`&&(r=!1);else if(e.type===`null`)r=n===`null`?null:n;else if(e.type===`string`)r=n;else try{r=JSON.parse(n)}catch{}this.rt&&this.rt.rootScope&&(yp(this.rt.rootScope,e.path,r),this.rt.markDirty()),this.editingValue=null},startEditComplex(e){this.cancelEdit(),this.editingComplex=e.key,this.jsonEditText=JSON.stringify(e.value,null,2),this.$nextTick(()=>{let e=this.$refs.jsonInput;if(e){let t=Array.isArray(e)?e[0]:e;t.focus(),t.select()}})},confirmEditComplex(e){try{let t=JSON.parse(this.jsonEditText);this.rt&&this.rt.rootScope&&(yp(this.rt.rootScope,e.path,t),this.rt.markDirty()),this.cancelEdit()}catch(e){alert(`JSON 解析失败: `+e.message)}},cancelEdit(){this.editingKey=null,this.editingValue=null,this.editingComplex=null,this.jsonEditText=``},deleteNode(e){this.rt&&this.rt.rootScope&&(bp(this.rt.rootScope,e.path),this.rt.markDirty())},addChild(){if(!this.rt||!this.rt.rootScope)return;let e=this.rt.rootScope,t=vp.selectedPath;if(t&&t.length){let n=Sp(this.rt.rootScope,t);typeof n==`object`&&n&&(e=n)}if(Array.isArray(e))e.push(``),this.rt.markDirty();else if(e&&typeof e==`object`){let t=`newKey`,n=1;for(;t in e;)t=`newKey`+(n>1?n:``),n++;e[t]=``,this.rt.markDirty()}},showContextMenu(e,t){this.ctxMenu.visible=!0,this.ctxMenu.x=t.clientX,this.ctxMenu.y=t.clientY,this.ctxMenu.item=e},hideContextMenu(){this.ctxMenu.visible=!1,this.ctxMenu.item=null},ctxCopyPath(){let e=this.ctxMenu.item;if(this.hideContextMenu(),!e)return;let t=this.formatKeyPath(e.path);op(t).then(e=>{e?Z(`已复制路径:${t}`,`ok`):Z(`复制失败,请手动复制`,`err`)})},formatKeyPath(e){let t=``;for(let n of e)typeof n==`number`||/^\d+$/.test(String(n))?t+=`[${n}]`:t+=t?`.${n}`:`${n}`;return t},ctxDelete(){let e=this.ctxMenu.item;if(this.hideContextMenu(),e){if(this.isNodeReferenced(e.path)){let t=e.path.join(`.`);this.delConfirm.message=`节点 “${t}” 在 schema 中被引用,删除后可能导致渲染异常。\n\n确定要删除吗?`,this.delConfirm.item=e,this.delConfirm.show=!0;return}this.deleteNode(e)}},onDelConfirm(){let e=this.delConfirm.item;this.delConfirm.show=!1,this.delConfirm.item=null,e&&this.deleteNode(e)},onDelCancel(){this.delConfirm.show=!1,this.delConfirm.item=null},isNodeReferenced(e){if(!this.schema)return!1;let t=JSON.stringify(this.schema);for(let n=0;n<e.length;n++){let r=e.slice(0,n+1).join(`.`),i=e[n];if(t.includes(`$`+i)||t.includes(`$`+r)||t.includes(`state.`+i)||t.includes(`state.`+r)||RegExp(`\\b`+this.escapeRegex(i)+`\\b`).test(t))return!0}return!1},escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}}},wp={class:`jt`},Tp={key:0,class:`jt__toolbar`},Ep=[`onClick`,`onContextmenu`],Dp=[`onDblclick`],Op=[`value`,`onKeydown`,`onBlur`],kp=[`onDblclick`],Ap=[`onDblclick`],jp=[`value`,`onKeydown`],Mp={class:`jt__json-actions`},Np=[`onClick`],Pp={key:2,class:`jt__row jt__row--close`},Fp={class:`jt__bracket`},Ip={class:`jt__count`},Lp=[`onClick`,`onContextmenu`],Rp=[`onDblclick`],zp=[`value`,`onKeydown`,`onBlur`],Bp={key:1,class:`jt__key`},Vp={key:2,class:`jt__colon`},Hp=[`onDblclick`],Up=[`value`,`onKeydown`,`onBlur`],Wp=[`onClick`];function Gp(e,t,n,r,i,a){let o=L(`JsonTree`,!0),s=L(`ConfirmDialog`);return B(),V(`div`,wp,[K(` 仅根节点、且可编辑时显示批量控制条(运行态面板为只读,不需要工具栏) `),a.isRoot&&n.editable?(B(),V(`div`,Tp,[U(`button`,{class:`jt__tool`,type:`button`,onClick:t[0]||=e=>a.setOpen(!0)},`全部展开`),U(`button`,{class:`jt__tool`,type:`button`,onClick:t[1]||=e=>a.setOpen(!1)},`全部折叠`),U(`button`,{class:`jt__tool jt__tool--add`,type:`button`,onClick:t[2]||=(...e)=>a.addChild&&a.addChild(...e),title:`添加子节点`},`+ 添加`)])):K(`v-if`,!0),U(`ul`,{class:j([`jt__list`,{"jt__list--root":a.isRoot}])},[(B(!0),V(z,null,R(a.entries,(e,r)=>(B(),V(`li`,{key:r,class:`jt__node`},[K(` 复合类型(对象 / 数组):可折叠 `),a.isComplex(e.value)?(B(),V(z,{key:0},[U(`div`,{class:j([`jt__row jt__row--branch`,{"jt__row--selected":a.isSelected(e)}]),onClick:t=>a.onBranchClick(e),onContextmenu:q(t=>a.showContextMenu(e,t),[`prevent`])},[U(`span`,{class:j([`jt__caret`,{"jt__caret--open":a.isOpen(e.key)}])},`▶`,2),e.isArrayBranch?K(`v-if`,!0):(B(),V(`span`,{key:0,class:`jt__key jt__editable`,onDblclick:q(t=>a.startEditKey(e),[`stop`])},[i.editingKey===e.key?(B(),V(`input`,{key:0,ref_for:!0,ref:`keyInput`,class:`jt__edit`,value:e.keyLabel,onKeydown:[vl(t=>a.confirmEditKey(e,t),[`enter`]),t[3]||=vl((...e)=>a.cancelEdit&&a.cancelEdit(...e),[`escape`])],onBlur:t=>a.confirmEditKey(e,t)},null,40,Op)):(B(),V(z,{key:1},[G(M(e.keyLabel),1)],64))],40,Dp)),U(`span`,{class:`jt__bracket jt__editable`,onDblclick:q(t=>n.editable&&a.startEditComplex(e),[`stop`])},M(e.isArrayBranch?`[`:`{`),41,kp),a.isOpen(e.key)?K(`v-if`,!0):(B(),V(`span`,{key:1,class:`jt__preview jt__editable`,onDblclick:q(t=>n.editable&&a.startEditComplex(e),[`stop`])},M(a.previewText(e.value)),41,Ap))],42,Ep),K(` 复合类型整体编辑弹层 `),i.editingComplex===e.key?(B(),V(`div`,{key:0,class:`jt__json-edit`,onClick:t[7]||=q(()=>{},[`stop`])},[U(`textarea`,{ref_for:!0,ref:`jsonInput`,class:`jt__json-textarea`,value:i.jsonEditText,onInput:t[4]||=e=>i.jsonEditText=e.target.value,onKeydown:[t[5]||=vl((...e)=>a.cancelEdit&&a.cancelEdit(...e),[`escape`]),vl(q(t=>a.confirmEditComplex(e),[`ctrl`]),[`enter`]),vl(q(t=>a.confirmEditComplex(e),[`meta`]),[`enter`])]},null,40,jp),U(`div`,Mp,[U(`button`,{type:`button`,class:`jt__json-btn`,onClick:t=>a.confirmEditComplex(e)},`确定`,8,Np),U(`button`,{type:`button`,class:`jt__json-btn jt__json-btn--cancel`,onClick:t[6]||=(...e)=>a.cancelEdit&&a.cancelEdit(...e)},`取消`),t[15]||=U(`span`,{class:`jt__json-hint`},`Ctrl+Enter 确认 · Esc 取消`,-1)])])):K(`v-if`,!0),a.isOpen(e.key)?(B(),H(o,{key:1,class:`jt__child`,data:e.value,depth:n.depth+1,rt:n.rt,path:e.path,editable:n.editable},null,8,[`data`,`depth`,`rt`,`path`,`editable`])):K(`v-if`,!0),a.isOpen(e.key)?(B(),V(`div`,Pp,[U(`span`,Fp,M(e.isArrayBranch?`]`:`}`),1),U(`span`,Ip,M(e.count)+` `+M(e.isArrayBranch?`项`:`键`),1)])):K(`v-if`,!0)],64)):(B(),V(z,{key:1},[K(` 基础类型:叶子 `),U(`div`,{class:j([`jt__row jt__row--leaf`,{"jt__row--selected":a.isSelected(e)}]),onClick:t=>a.selectNode(e),onContextmenu:q(t=>a.showContextMenu(e,t),[`prevent`])},[t[16]||=U(`span`,{class:`jt__caret jt__caret--leaf`},null,-1),e.keyLabel!==null&&n.editable?(B(),V(`span`,{key:0,class:`jt__key jt__editable`,onDblclick:q(t=>a.startEditKey(e),[`stop`])},[i.editingKey===e.key?(B(),V(`input`,{key:0,ref_for:!0,ref:`keyInput`,class:`jt__edit`,value:e.keyLabel,onKeydown:[vl(t=>a.confirmEditKey(e,t),[`enter`]),t[8]||=vl((...e)=>a.cancelEdit&&a.cancelEdit(...e),[`escape`])],onBlur:t=>a.confirmEditKey(e,t)},null,40,zp)):(B(),V(z,{key:1},[G(M(e.keyLabel),1)],64))],40,Rp)):K(`v-if`,!0),e.keyLabel!==null&&!n.editable?(B(),V(`span`,Bp,M(e.keyLabel),1)):K(`v-if`,!0),e.keyLabel===null?K(`v-if`,!0):(B(),V(`span`,Vp,`:`)),U(`span`,{class:j([`jt__val`,[`jt__val--`+e.type,{jt__editable:n.editable}]]),onDblclick:q(t=>n.editable&&a.startEditValue(e),[`stop`])},[i.editingValue===e.key?(B(),V(`input`,{key:0,ref_for:!0,ref:`valInput`,class:`jt__edit`,value:a.formatForEdit(e.value,e.type),onKeydown:[vl(t=>a.confirmEditValue(e,t),[`enter`]),t[9]||=vl((...e)=>a.cancelEdit&&a.cancelEdit(...e),[`escape`])],onBlur:t=>a.confirmEditValue(e,t)},null,40,Up)):(B(),V(z,{key:1},[G(M(a.formatPrimitive(e.value,e.type)),1)],64))],42,Hp),n.editable?(B(),V(`button`,{key:3,class:`jt__del`,type:`button`,onClick:q(t=>a.deleteNode(e),[`stop`]),title:`删除节点`},`×`,8,Wp)):K(`v-if`,!0)],42,Lp)],2112))]))),128))],2),K(` 右键菜单(fixed 定位,全局可见) `),i.ctxMenu.visible?(B(),V(`div`,{key:1,class:`jt__ctxmenu`,style:A({left:i.ctxMenu.x+`px`,top:i.ctxMenu.y+`px`}),onClick:t[12]||=q(()=>{},[`stop`])},[U(`button`,{class:`jt__ctxmenu-item`,type:`button`,onClick:t[10]||=(...e)=>a.ctxCopyPath&&a.ctxCopyPath(...e)},`复制路径`),K(` 删除节点仅在可编辑(绑定数据 tab)时提供;只读树(如运行态面板)只保留复制路径 `),n.editable?(B(),V(`button`,{key:0,class:`jt__ctxmenu-item jt__ctxmenu-item--del`,type:`button`,onClick:t[11]||=(...e)=>a.ctxDelete&&a.ctxDelete(...e)},`删除节点`)):K(`v-if`,!0)],4)):K(`v-if`,!0),i.ctxMenu.visible?(B(),V(`div`,{key:2,class:`jt__ctxmenu-mask`,onClick:t[13]||=(...e)=>a.hideContextMenu&&a.hideContextMenu(...e),onContextmenu:t[14]||=q((...e)=>a.hideContextMenu&&a.hideContextMenu(...e),[`prevent`])},null,32)):K(`v-if`,!0),K(` 删除被引用节点的二次确认:警告级(橙黄+警告三角),分级见 design/深浅主题配色规范手册.md §3.4 `),W(s,{visible:i.delConfirm.show,title:`删除被引用节点`,message:i.delConfirm.message,"confirm-text":`删除`,severity:`warn`,onConfirm:a.onDelConfirm,onCancel:a.onDelCancel},null,8,[`visible`,`message`,`onConfirm`,`onCancel`])])}var Kp=X(Cp,[[`render`,Gp],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/JsonTree.vue`]]);function qp(){return Vs(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[Vs(`circle`,{cx:`12`,cy:`12`,r:`3`}),Vs(`path`,{d:`M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z`})])}function Jp(){let e=(e,t)=>Vs(`circle`,{cx:e,cy:t,r:`1.4`});return Vs(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`currentColor`},[e(3,2.5),e(9,2.5),e(3,6),e(9,6),e(3,9.5),e(9,9.5)])}var Yp={name:`TreeNode`,props:{comp:{type:Object,required:!0},openState:{type:Object,required:!0},compNames:{type:Object,required:!0},selectedNodeId:{type:String,default:``},draggingId:{type:String,default:``},dropTarget:{type:Object,default:()=>({compId:null,type:null})},query:{type:String,default:``}},methods:{hasChildren(e){return(e.slots||[]).some(e=>(e.components||[]).length>0)},nodeMatches(e,t){if(!t)return!1;let n=(this.compNames[e.className]||e.className).toLowerCase(),r=String(e.componentId==null?``:e.componentId).toLowerCase(),i=String(e.className||``).toLowerCase();return n.indexOf(t)!==-1||r.indexOf(t)!==-1||i.indexOf(t)!==-1},subtreeMatches(e,t){if(!t||this.nodeMatches(e,t))return!0;if(!e.slots)return!1;for(let n of e.slots)if(n.components){for(let e of n.components)if(this.subtreeMatches(e,t))return!0}return!1},isContainer(e){let t=vu[e];return!!(t&&t.slots&&t.slots.length)},onRowClick(e,t){e.stopPropagation(),this.$emit(`select-node`,t.id)},onRowDblclick(e,t){e.stopPropagation(),e.preventDefault(),this.$emit(`inspect`,t)},onRowHover(e){this.$emit(`hover-node`,{componentId:e&&e.componentId,id:e&&e.id})},onRowLeave(e){this.$emit(`hover-node`,{componentId:e&&e.componentId,id:e&&e.id,leave:!0})},onDragStart(e,t){e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t.componentId)),this.$emit(`drag-start`,t.componentId)},onDragEnd(){this.$emit(`drag-end`)},onDragOver(e,t){if(!this.draggingId||this.draggingId===t.componentId){this.clearDrop();return}e.preventDefault();let n=e.currentTarget.getBoundingClientRect(),r=e.clientY-n.top,i=n.height,a=this.isContainer(t.className),o;o=a?r<i*.25?`before`:r>i*.75?`after`:`inside`:r<i/2?`before`:`after`,this.isDescendantOf(this.draggingId,t)&&(o=`blocked`),e.dataTransfer.dropEffect=o===`blocked`?`none`:`move`,o===`inside`&&this.openState[t.id]===!1&&!this._expandTimer&&(this._expandTimer=setTimeout(()=>{this.$emit(`toggle`,t.id),this._expandTimer=null},450)),this.$emit(`drag-over`,{compId:t.componentId,type:o})},onDragLeave(e){e.relatedTarget&&e.currentTarget.contains(e.relatedTarget)||this.clearDrop()},onDrop(e,t){e.preventDefault(),this._expandTimer&&=(clearTimeout(this._expandTimer),null);let n=e.dataTransfer&&e.dataTransfer.getData(`text/plain`);if(this.clearDrop(),!n||n===t.componentId)return;let r=e.currentTarget.getBoundingClientRect(),i=e.clientY-r.top,a=r.height,o=this.isContainer(t.className),s;s=o?i<a*.25?`before`:i>a*.75?`after`:`inside`:i<a/2?`before`:`after`,!this.isDescendantOf(n,t)&&this.$emit(`move-node`,{sourceCompId:n,targetCompId:t.componentId,position:s})},isDescendantOf(e,t){if(!t)return!1;let n=[];if(t.components&&n.push(...t.components),t.slots)for(let e of t.slots)e.components&&n.push(...e.components);for(let t of n)if(t.componentId===e||this.isDescendantOf(e,t))return!0;return!1},dropClass(e){let t=this.dropTarget;return!t||t.compId!==e?``:t.type===`blocked`?`st__row--drop-blocked`:t.type===`before`?`st__row--drop-before`:t.type===`after`?`st__row--drop-after`:t.type===`inside`?`st__row--drop-inside`:``},clearDrop(){this._expandTimer&&=(clearTimeout(this._expandTimer),null),this.$emit(`drag-over`,{compId:null,type:null})}},render(){let e=this.comp;if(this.query&&!this.subtreeMatches(e,this.query))return null;let t=this.hasChildren(e),n=!!this.query||this.openState[e.id]!==!1,r=this.compNames[e.className]||e.className,i=!!(this.query&&this.nodeMatches(e,this.query)),a=[],o=[];t?o.push(Vs(`span`,{class:[`st__caret`,{"st__caret--open":n}],onClick:t=>{t.stopPropagation(),this.$emit(`toggle`,e.id)}},`▸`)):o.push(Vs(`span`,{class:`st__caret st__caret--leaf`})),o.push(Vs(`span`,{class:[`st__label`,{"st__label--hl":i}]},r)),o.push(Vs(`span`,{class:`st__id`},`【`+e.componentId+`】`));{let t=!!(e.eventactions&&e.eventactions.length);o.push(Vs(`span`,{class:[`st__badge`,t?`st__badge--clickable`:`st__badge--muted`],onClick:t=>{t.stopPropagation(),this.$emit(`edit-event`,e)}},`事件`))}if(o.push(Vs(`button`,{class:`st__gear`,type:`button`,title:`编辑节点属性`,onClick:t=>{t.stopPropagation(),this.$emit(`inspect`,e)}},[qp()])),o.unshift(Vs(`span`,{class:`st__handle`,title:`拖拽以调整位置或嵌套关系`},[Jp()])),a.push(Vs(`div`,{class:[`st__row`,{"st__row--selected":this.selectedNodeId===e.id,"st__row--dragging":this.draggingId===e.componentId},this.dropClass(e.componentId)],title:`单击选中节点;双击打开节点设置;拖拽调整位置/嵌套`,draggable:`true`,"data-comp-id":e.componentId,"data-is-container":this.isContainer(e.className)?`true`:`false`,onClick:t=>this.onRowClick(t,e),onDblclick:t=>this.onRowDblclick(t,e),onDragstart:t=>this.onDragStart(t,e),onDragend:e=>this.onDragEnd(e),onDragover:t=>this.onDragOver(t,e),onDragleave:e=>this.onDragLeave(e),onDrop:t=>this.onDrop(t,e),onMouseenter:()=>this.onRowHover(e),onMouseleave:()=>this.onRowLeave(e),onContextmenu:t=>{t.preventDefault(),t.stopPropagation(),this.$emit(`context-menu`,e,t)}},o)),t){let t=[];for(let n of e.slots||[])for(let e of n.components||[])this.query&&!this.subtreeMatches(e,this.query)||t.push(Vs(Yp,{key:e.id,comp:e,openState:this.openState,compNames:this.compNames,selectedNodeId:this.selectedNodeId,draggingId:this.draggingId,dropTarget:this.dropTarget,query:this.query,onToggle:e=>this.$emit(`toggle`,e),onSelectNode:e=>this.$emit(`select-node`,e),onEditEvent:e=>this.$emit(`edit-event`,e),onInspect:e=>this.$emit(`inspect`,e),onDragStart:e=>this.$emit(`drag-start`,e),onDragEnd:()=>this.$emit(`drag-end`),onDragOver:e=>this.$emit(`drag-over`,e),onMoveNode:e=>this.$emit(`move-node`,e),onHoverNode:e=>this.$emit(`hover-node`,e),onContextMenu:(e,t)=>this.$emit(`context-menu`,e,t)}));t.length&&a.push(Vs(`ul`,{class:`st__children`,style:n?``:`display: none;`},t))}return Vs(`li`,{class:`st__node`},a)}},Xp={name:`StructureTree`,components:{TreeNode:Yp},props:{preview:{type:Object,default:null},schema:{type:Object,default:null},cardCode:{type:String,default:``},selectedNodeId:{type:String,default:``},moveCollapseToken:{type:Number,default:0},canPaste:{type:Boolean,default:!1}},data(){return{openState:{},draggingId:``,dropTarget:{compId:null,type:null},query:``,locateEnabled:!1,contextMenu:{visible:!1,x:0,y:0,nodeId:``,node:null},helpOpen:!1,shortcuts:[{keys:[`⌘/Ctrl`,`C`],desc:`复制选中节点`},{keys:[`⌘/Ctrl`,`V`],desc:`粘贴节点`},{keys:[`⌘/Ctrl`,`D`],desc:`创建节点副本`},{keys:[`⌘/Ctrl`,`Z`],desc:`撤销`},{keys:[`⌘/Ctrl`,`⇧`,`Z`],desc:`重做`},{keys:[`Delete`],desc:`删除选中节点`},{keys:[`Esc`],desc:`取消选中`},{keys:[`⌘/Ctrl`,`点击`],desc:`点击画布元素,在本树中定位该节点`}]}},computed:{rootOpen(){return!!this.query||this.openState._root!==!1},view(){return this.preview&&this.preview.view},rootLabel(){return this.view&&(this.preview.name||this.view.className)||`卡片`},viewComponents(){return this.view&&this.view.components||[]},viewNode(){return this.view},viewEventCount(){return this.view&&this.view.eventactions&&this.view.eventactions.length},ctxTargetIsContainer(){return this.isContainerNode(this.contextMenu.node)},ctxTargetIsRoot(){return this.contextMenu.node===this.viewNode},compNames(){let e={};for(let t in vu)e[t]=vu[t].name||t;return e.Root=`根`,e}},watch:{selectedNodeId:{immediate:!0,handler(e){this.ensureVisible(e)}},preview:{handler(e){if(!e||!e.view){this.openState={};return}let t=new Set,n=e=>{if(!e)return;t.add(e.id);let r=[];if(e.components&&r.push(...e.components),e.slots)for(let t of e.slots)t.components&&r.push(...t.components);for(let e of r)n(e)};n(e.view);let r={};for(let e of Object.keys(this.openState))(e===`_root`||t.has(e))&&(r[e]=this.openState[e]);this.openState=r},immediate:!0},moveCollapseToken:{handler(){this.collapseOthersAndReveal(this.selectedNodeId)}}},methods:{toggle(e){let t=this.openState[e];this.openState[e]=t===!1},onRootClick(e){e.stopPropagation(),this.onSelect(`_root`)},onRowHover(e){this.locateEnabled&&this.$emit(`hover-node`,{componentId:e&&e.componentId,id:e&&e.id})},onRowLeave(e){this.locateEnabled&&this.$emit(`hover-node`,{componentId:e&&e.componentId,id:e&&e.id,leave:!0})},toggleLocate(){this.locateEnabled=!this.locateEnabled,this.locateEnabled||this.$emit(`hover-node`,null)},onChildHover(e){this.locateEnabled&&this.$emit(`hover-node`,e)},onRootDblclick(e){e.stopPropagation(),e.preventDefault(),this.onInspect(this.viewNode)},onSelect(e){this.$emit(`select-node`,this.selectedNodeId===e?``:e)},onNodeContextMenu(e,t){this.openContextMenu(e,t)},openContextMenu(e,t){let n=e===this.viewNode?`_root`:e.id;this.$emit(`select-node`,n),this.contextMenu={visible:!0,x:t.clientX,y:t.clientY,nodeId:n,node:e},this.$nextTick(()=>this.clampContextMenu())},clampContextMenu(){let e=this.$refs.ctxMenu;if(!e)return;let t=e.getBoundingClientRect(),n=this.contextMenu.x,r=this.contextMenu.y;n+t.width>window.innerWidth&&(n=Math.max(4,window.innerWidth-t.width-4)),r+t.height>window.innerHeight&&(r=Math.max(4,window.innerHeight-t.height-4)),this.contextMenu.x=n,this.contextMenu.y=r},closeContextMenu(){this.contextMenu.visible&&(this.contextMenu={visible:!1,x:0,y:0,nodeId:``,node:null})},onCtxCopy(){this.$emit(`copy-selected`),this.closeContextMenu()},onCtxPaste(){this.$emit(`paste`),this.closeContextMenu()},onCtxDuplicate(){this.$emit(`duplicate`),this.closeContextMenu()},onCtxDelete(){this.$emit(`delete-selected`),this.closeContextMenu()},onCtxAdd(e){let t=this.contextMenu.node;this.closeContextMenu(),this.$emit(`add-node`,{node:t||null,mode:e})},onCtxInspect(){this.$emit(`inspect`,this.contextMenu.node),this.closeContextMenu()},onCtxEditEvent(){this.$emit(`edit-event`,this.contextMenu.node),this.closeContextMenu()},async onCtxCopyId(){let e=this.contextMenu.node,t=e&&(e.componentId==null?e.id:e.componentId);if(t==null||t===``){Z(`该节点没有可复制的 ID`,`err`),this.closeContextMenu();return}await op(String(t))?Z(`已复制节点ID:${t}`,`ok`):Z(`复制失败,请手动复制`,`err`),this.closeContextMenu()},async onCtxCopyCardId(){let e=this.cardCode;if(e==null||e===``){Z(`该卡片没有可复制的 code`,`err`),this.closeContextMenu();return}await op(String(e))?Z(`已复制卡片code:${e}`,`ok`):Z(`复制失败,请手动复制`,`err`),this.closeContextMenu()},onCtxRenameCard(){this.$emit(`rename-card`),this.closeContextMenu()},isContainerNode(e){if(!e)return!1;if(e.className===`Root`)return!0;let t=vu[e.className];return!!(t&&t.slots&&t.slots.length)},onDocClick(e){this.contextMenu.visible&&this.$refs.ctxMenu&&!this.$refs.ctxMenu.contains(e.target)&&this.closeContextMenu()},onDocKeydown(e){e.key===`Escape`&&this.closeContextMenu()},expandAll(){this.openState={}},collapseAll(){let e={_root:!1},t=n=>{for(let r of n){(r.slots||[]).some(e=>(e.components||[]).length>0)&&(e[r.id]=!1);for(let e of r.slots||[])t(e.components||[])}};t(this.viewComponents),this.openState=e},onEditEvent(e){this.$emit(`edit-event`,e)},onRootDragOver(e){if(!this.draggingId){this.dropTarget={compId:null,type:null};return}e.preventDefault(),e.dataTransfer.dropEffect=`move`,(this.dropTarget.compId!==`__root__`||this.dropTarget.type!==`inside`)&&(this.dropTarget={compId:`__root__`,type:`inside`})},onRootDragLeave(e){e.relatedTarget&&e.currentTarget.contains(e.relatedTarget)||(this.dropTarget={compId:null,type:null})},onRootDrop(e){e.preventDefault();let t=e.dataTransfer&&e.dataTransfer.getData(`text/plain`);this.dropTarget={compId:null,type:null},t&&this.$emit(`move-node`,{sourceCompId:t,targetCompId:`__root__`,position:`inside`})},dropClass(e){let t=this.dropTarget;return!t||t.compId!==e?``:t.type===`blocked`?`st__row--drop-blocked`:t.type===`before`?`st__row--drop-before`:t.type===`after`?`st__row--drop-after`:t.type===`inside`?`st__row--drop-inside`:``},clearDrag(){this.draggingId=``,this.dropTarget={compId:null,type:null}},onAddFromToolbar(){let e=this.selectedNodeId,t=null;e&&e!==`_root`&&(t=this.findViewNodeById(this.view,e)),this.$emit(`add-node`,{node:t,mode:`auto`})},findViewNodeById(e,t){if(!e)return null;if(e.id===t)return e;let n=[];if(e.components&&n.push(...e.components),e.slots)for(let t of e.slots)t.components&&n.push(...t.components);for(let e of n){let n=this.findViewNodeById(e,t);if(n)return n}return null},onInspect(e){this.$emit(`inspect`,e)},ensureVisible(e){if(!e)return;let t=this.collectAncestorIds(e);if(t.length){let e=Object.assign({},this.openState);for(let n of t)e[n]=!0;this.openState=e}this.$nextTick(()=>{let e=this.$el&&this.$el.querySelector?this.$el.querySelector(`.st__row--selected`):null;e&&e.scrollIntoView&&e.scrollIntoView({block:`nearest`})})},collectAncestorIds(e){let t=[],n=!1,r=(i,a)=>{for(let o of i){if(o.id===e)return n=!0,a!==void 0&&t.unshift(a),!0;let i=[];if(o.components&&i.push(...o.components),o.slots)for(let e of o.slots)e.components&&i.push(...e.components);if(r(i,o.id))return t.unshift(a),!0}return!1};return r(this.viewComponents,`_root`),n?t:[]},collapseOthersAndReveal(e){if(this.collapseAll(),e&&e!==`_root`){let t=this.collectAncestorIds(e);if(t.length){let e=Object.assign({},this.openState);for(let n of t)e[n]=!0;this.openState=e}}else e===`_root`&&(this.openState=Object.assign({},this.openState,{_root:!0}));this.$nextTick(()=>{let e=this.$el&&this.$el.querySelector?this.$el.querySelector(`.st__row--selected`):null;e&&e.scrollIntoView&&e.scrollIntoView({block:`nearest`})})}},mounted(){this._onDocClick=e=>this.onDocClick(e),this._onDocKeydown=e=>this.onDocKeydown(e),document.addEventListener(`click`,this._onDocClick,!0),document.addEventListener(`keydown`,this._onDocKeydown,!0)},beforeDestroy(){document.removeEventListener(`click`,this._onDocClick,!0),document.removeEventListener(`keydown`,this._onDocKeydown,!0)}},Zp={class:`st`},Qp={class:`st__toolbar st__toolbar--top`},$p=[`title`,`aria-pressed`],em={class:`st__node st__node--root`},tm={class:`st__label`},nm={class:`st__children`},rm=[`disabled`],im=[`disabled`],am=[`disabled`],om={key:2,class:`st__ctx-sep`},sm=[`disabled`],cm={class:`st__help-wrap`},lm=[`aria-expanded`],um={class:`st__help-pop-head`},dm={class:`st__help-pop-body st__keys`},fm={class:`st__keys-combo`},pm={class:`st__kbd`},mm={key:0,class:`st__kbd-plus`},hm={class:`st__keys-desc`};function gm(e,t,n,r,i,a){let o=L(`tree-node`);return B(),V(`div`,Zp,[K(`
|
|
113
|
+
For more details, see https://link.vuejs.org/feature-flags.`)}}var Oo=Bo;function ko(e){return Ao(e)}function Ao(e,t){Do();let n=Se();n.__VUE__=!0,Cr(n.__VUE_DEVTOOLS_GLOBAL_HOOK__,n);let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:c,setText:l,setElementText:u,parentNode:d,nextSibling:h,setScopeId:g=m,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!sr&&!!t.dynamicChildren)=>{if(e===t)return;e&&!Zo(e,t)&&(r=xe(e),me(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case Vo:y(e,t,n,r);break;case Ho:b(e,t,n,r);break;case Uo:e==null?x(t,n,r,o):S(e,t,n,o);break;case R:ie(e,t,n,r,i,a,o,s,c);break;default:d&1?ee(e,t,n,r,i,a,o,s,c):d&6?ae(e,t,n,r,i,a,o,s,c):d&64||d&128?l.process(e,t,n,r,i,a,o,s,c,we):P(`Invalid VNode type:`,l,`(${typeof l})`)}u!=null&&i?Oi(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Oi(e.ref,null,a,e,!0)},y=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},b=(e,t,n,i)=>{e==null?r(t.el=c(t.children||``),n,i):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=(e,t,n,r)=>{if(t.children!==e.children){let i=h(e.anchor);w(e),[t.el,t.anchor]=_(t.children,n,i,r)}else t.el=e.el,t.anchor=e.anchor},C=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=h(e),r(e,n,i),e=a;r(t,n,i)},w=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),i(e),e=n;i(t)},ee=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)T(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),D(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},T=(e,t,n,i,s,c,l,d)=>{let f,p,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(f=e.el=o(e.type,c,m&&m.is,m),h&8?u(f,e.children):h&16&&te(e.children,f,null,i,s,jo(e,c),l,d),_&&Br(e,null,i,`created`),E(f,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!ce(e)&&a(f,e,null,m[e],c,i);`value`in m&&a(f,`value`,null,m.value,c),(p=m.onVnodeBeforeMount)&&ds(p,i,e)}ve(f,`__vnode`,e,!0),ve(f,`__vueParentComponent`,i,!0),_&&Br(e,null,i,`beforeMount`);let v=No(s,g);if(v&&g.beforeEnter(f),r(f,t,n),(p=m&&m.onVnodeMounted)||v||_){let t=sr;Oo(()=>{let n;n=cr(t);try{p&&ds(p,i,e),v&&g.enter(f),_&&Br(e,null,i,`mounted`)}finally{cr(n)}},s)}},E=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(n.patchFlag>0&&n.patchFlag&2048&&(n=za(n.children)||n),t===n||zo(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;E(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},te=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?cs(e[l]):ss(e[l]);v(null,c,t,n,r,i,a,o,s)}},D=(e,t,n,r,i,o,s)=>{let c=t.el=e.el;c.__vnode=t;let{patchFlag:l,dynamicChildren:d,dirs:p}=t;l|=e.patchFlag&16;let m=e.props||f,h=t.props||f,g;if(n&&Mo(n,!1),(g=h.onVnodeBeforeUpdate)&&ds(g,n,t,e),p&&Br(t,e,n,`beforeUpdate`),n&&Mo(n,!0),(sr||d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length))&&(l=0,s=!1,d=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&u(c,``),d?(ne(e.dynamicChildren,d,c,n,r,jo(t,i),o),Po(e,t)):s||de(e,t,c,null,n,r,jo(t,i),o,!1),l>0){if(l&16)re(c,m,h,n,i);else if(l&2&&m.class!==h.class&&a(c,`class`,null,h.class,i),l&4&&a(c,`style`,m.style,h.style,i),l&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=m[r],s=h[r];(s!==o||r===`value`)&&a(c,r,o,s,i,n)}}l&1&&e.children!==t.children&&u(c,t.children)}else!s&&d==null&&re(c,m,h,n,i);((g=h.onVnodeUpdated)||p)&&Oo(()=>{g&&ds(g,n,t,e),p&&Br(t,e,n,`updated`)},r)},ne=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s],u=c.el&&(c.type===R||!Zo(c,l)||c.shapeFlag&198)?d(c.el):n;v(c,l,u,null,r,i,a,o,!0)}},re=(e,t,n,r,i)=>{if(t!==n){if(t!==f)for(let o in t)!ce(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(ce(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},ie=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;(sr||p&2048)&&(p=0,u=!1,m=null),h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),te(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(ne(e.dynamicChildren,m,n,a,o,c,l),Po(e,t)):de(e,t,n,f,a,o,c,l,u)},ae=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):oe(t,n,r,i,a,o,c):se(e,t,c)},oe=(e,t,n,r,i,a,o)=>{let s=e.component=ms(e,r,i);if(s.type.__hmrId&&dr(s),kn(e),wo(s,`mount`),ji(e)&&(s.ctx.renderer=we),wo(s,`init`),Ts(s,!1,o),To(s,`init`),sr&&(e.el=null),s.asyncDep){if(i&&i.registerDep(s,le,o),!e.el){let r=s.subTree=U(Ho);b(null,r,t,n),e.placeholder=r.el}}else le(s,e,t,n,i,a,o);An(),To(s,`mount`)},se=(e,t,n)=>{let r=t.component=e.component;if(Ua(e,t,n))if(r.asyncDep&&!r.asyncResolved){kn(t),ue(r,t,n),An();return}else r.next=t,r.update();else t.el=e.el,r.vnode=t},le=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=Io(e);if(n){t&&(t.el=c.el,ue(e,t,o)),n.asyncDep.then(()=>{Oo(()=>{e.isUnmounted||l()},i)});return}}let u=t,f;kn(t||e.vnode),Mo(e,!1),t?(t.el=c.el,ue(e,t,o)):t=c,n&&_e(n),(f=t.props&&t.props.onVnodeBeforeUpdate)&&ds(f,s,t,c),Mo(e,!0),wo(e,`render`);let p=La(e);To(e,`render`);let m=e.subTree;e.subTree=p,wo(e,`patch`),v(m,p,d(m.el),xe(m),e,i,a),To(e,`patch`),t.el=p.el,u===null&&Ka(e,p.el),r&&Oo(r,i),(f=t.props&&t.props.onVnodeUpdated)&&Oo(()=>ds(f,s,t,c),i),Dr(e),An()}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Ai(t);if(Mo(e,!1),l&&_e(l),!m&&(o=c&&c.onVnodeBeforeMount)&&ds(o,d,t),Mo(e,!0),s&&Ee){let t=()=>{wo(e,`render`),e.subTree=La(e),To(e,`render`),wo(e,`hydrate`),Ee(s,e.subTree,e,i,null),To(e,`hydrate`)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0),wo(e,`render`);let o=e.subTree=La(e);To(e,`render`),wo(e,`patch`),v(null,o,n,r,e,i,a),To(e,`patch`),t.el=o.el}if(u&&Oo(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;Oo(()=>ds(o,d,e),i)}(t.shapeFlag&256||d&&Ai(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&Oo(e.a,i),e.isMounted=!0,Er(e),t=n=r=null}};e.scope.on();let c=e.effect=new qe(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>$n(u),Mo(e,!0),c.onTrack=e.rtc?t=>_e(e.rtc,t):void 0,c.onTrigger=e.rtg?t=>_e(e.rtg,t):void 0,l()},ue=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,Qa(e,t.props,r,n),xo(e,t.children,n),ct(),nr(e),lt()},de=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,d=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(p&128){fe(l,f,n,r,i,a,o,s,c);return}if(p&256){O(l,f,n,r,i,a,o,s,c);return}}m&8?(d&16&&be(l,i,a),f!==l&&u(n,f)):d&16?m&16?fe(l,f,n,r,i,a,o,s,c):be(l,i,a,!0):(d&8&&u(n,``),m&16&&te(f,n,r,i,a,o,s,c))},O=(e,t,n,r,i,a,o,s,c)=>{e||=p,t||=p;let l=e.length,u=t.length,d=Math.min(l,u),f;for(f=0;f<d;f++){let r=t[f]=c?cs(t[f]):ss(t[f]);v(e[f],r,n,null,i,a,o,s,c)}l>u?be(e,i,a,!0,!1,d):te(t,n,r,i,a,o,s,c,d)},fe=(e,t,n,r,i,a,o,s,c)=>{let l=0,u=t.length,d=e.length-1,f=u-1;for(;l<=d&&l<=f;){let r=e[l],u=t[l]=c?cs(t[l]):ss(t[l]);if(Zo(r,u))v(r,u,n,null,i,a,o,s,c);else break;l++}for(;l<=d&&l<=f;){let r=e[d],l=t[f]=c?cs(t[f]):ss(t[f]);if(Zo(r,l))v(r,l,n,null,i,a,o,s,c);else break;d--,f--}if(l>d){if(l<=f){let e=f+1,d=e<u?t[e].el:r;for(;l<=f;)v(null,t[l]=c?cs(t[l]):ss(t[l]),n,d,i,a,o,s,c),l++}}else if(l>f)for(;l<=d;)me(e[l],i,a,!0),l++;else{let m=l,h=l,g=new Map;for(l=h;l<=f;l++){let e=t[l]=c?cs(t[l]):ss(t[l]);e.key!=null&&(g.has(e.key)&&P(`Duplicate keys found during update:`,JSON.stringify(e.key),`Make sure keys are unique.`),g.set(e.key,l))}let _,y=0,b=f-h+1,x=!1,S=0,C=Array(b);for(l=0;l<b;l++)C[l]=0;for(l=m;l<=d;l++){let r=e[l];if(y>=b){me(r,i,a,!0);continue}let u;if(r.key!=null)u=g.get(r.key);else for(_=h;_<=f;_++)if(C[_-h]===0&&Zo(r,t[_])){u=_;break}u===void 0?me(r,i,a,!0):(C[u-h]=l+1,u>=S?S=u:x=!0,v(r,t[u],n,null,i,a,o,s,c),y++)}let w=x?Fo(C):p;for(_=w.length-1,l=b-1;l>=0;l--){let e=h+l,d=t[e],f=t[e+1],p=e+1<u?f.el||Ro(f):r;C[l]===0?v(null,d,n,p,i,a,o,s,c):x&&(_<0||l!==w[_]?pe(d,n,p,2):_--)}}},pe=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){pe(e.component.subTree,t,n,a);return}if(d&128){e.suspense.move(t,n,a);return}if(d&64){c.move(e,t,n,we);return}if(c===R){r(s,t,n);for(let e=0;e<u.length;e++)pe(u[e],t,n,a);r(e.anchor,t,n);return}if(c===Uo){C(e,t,n);return}if(a!==2&&d&1&&l)if(a===0)l.persisted&&!s[li]?r(s,t,n):(l.beforeEnter(s),r(s,t,n),Oo(()=>l.enter(s),o));else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{let e=s._isLeaving||!!s[li];s._isLeaving&&s[li](!0),l.persisted&&!e?u():a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}else r(s,t,n)},me=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(ct(),Oi(s,null,n,e,!0),lt()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Ai(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&ds(_,t,e),u&6)ye(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&Br(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,we,r):l&&!l.hasOnce&&(a!==R||d>0&&d&64)?be(l,t,n,!1,!0):(a===R&&d&384||!i&&u&16)&&be(c,t,n),r&&he(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&Oo(()=>{_&&ds(_,t,e),h&&Br(e,null,t,`unmounted`),v&&(e.el=null)},n)},he=e=>{let{type:t,el:n,anchor:r,transition:a}=e;if(t===R){e.patchFlag>0&&e.patchFlag&2048&&a&&!a.persisted?e.children.forEach(e=>{e.type===Ho?i(e.el):he(e)}):ge(n,r);return}if(t===Uo){w(e);return}let o=()=>{i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(e.shapeFlag&1&&a&&!a.persisted){let{leave:t,delayLeave:r}=a,i=()=>t(n,o);r?r(e.el,o,i):i()}else o()},ge=(e,t)=>{let n;for(;e!==t;)n=h(e),i(e),e=n;i(t)},ye=(e,t,n)=>{e.type.__hmrId&&fr(e);let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;Lo(c),Lo(l),r&&_e(r),i.stop(),a&&(a.flags|=8,me(o,e,t,n)),s&&Oo(s,t),Oo(()=>{e.isUnmounted=!0},t),kr(e)},be=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)me(e[o],t,n,r,i)},xe=e=>{if(e.shapeFlag&6)return xe(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[Xr];return n?h(n):t},k=!1,Ce=(e,t,n)=>{let r;e==null?t._vnode&&(me(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,k||=(k=!0,nr(r),rr(),!1)},we={p:v,um:me,m:pe,r:he,mt:oe,mc:te,pc:de,pbc:ne,n:xe,o:e},Te,Ee;return t&&([Te,Ee]=t(we)),{render:Ce,hydrate:Te,createApp:Oa(Ce,Te)}}function jo({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function Mo({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function No(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Po(e,t,n=!1){let r=e.children,i=t.children;if(S(r)&&S(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=cs(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&Po(t,a)),a.type===Vo&&(a.patchFlag===-1&&(a=i[e]=cs(a)),a.el=t.el),a.type===Ho&&!a.el&&(a.el=t.el),a.el&&(a.el.__vnode=a)}}function Fo(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function Io(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Io(t)}function Lo(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Ro(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?Ro(t.subTree):null}var zo=e=>e.__isSuspense;function Bo(e,t){t&&t.pendingBranch?S(e)?t.effects.push(...e):t.effects.push(e):tr(e)}var R=Symbol.for(`v-fgt`),Vo=Symbol.for(`v-txt`),Ho=Symbol.for(`v-cmt`),Uo=Symbol.for(`v-stc`),Wo=[],Go=null;function z(e=!1){Wo.push(Go=e?null:[])}function Ko(){Wo.pop(),Go=Wo[Wo.length-1]||null}var qo=1;function Jo(e,t=!1){qo+=e,e<0&&Go&&t&&(Go.hasOnce=!0)}function Yo(e){return e.dynamicChildren=qo>0?Go||p:null,Ko(),qo>0&&Go&&Go.push(e),e}function B(e,t,n,r,i,a){return Yo(H(e,t,n,r,i,a,!0))}function V(e,t,n,r,i){return Yo(U(e,t,n,r,i,!0))}function Xo(e){return e?e.__v_isVNode===!0:!1}function Zo(e,t){if(t.shapeFlag&6&&e.component){let n=lr.get(t.type);if(n&&n.has(e.component))return e.shapeFlag&=-257,t.shapeFlag&=-513,!1}return e.type===t.type&&e.key===t.key}var Qo,$o=(...e)=>ns(...Qo?Qo(e,Fr):e),es=({key:e})=>e??null,ts=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:E(e)||gn(e)||T(e)?{i:Fr,r:e,k:t,f:!!n}:e);function H(e,t=null,n=null,r=0,i=null,a=e===R?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&es(t),ref:t&&ts(t),scopeId:Ir,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Fr};return s?(ls(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=E(n)?8:16),c.key!==c.key&&P(`VNode created with invalid key (NaN). VNode type:`,c.type),qo>0&&!o&&Go&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&Go.push(c),c}var U=$o;function ns(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===Yi)&&(e||P(`Invalid vnode type when creating vnode: ${e}.`),e=Ho),Xo(e)){let r=is(e,t,!0);return n&&ls(r,n),qo>0&&!a&&Go&&(r.shapeFlag&6?Go[Go.indexOf(e)]=r:Go.push(r)),r.patchFlag=-2,r}if(Bs(e)&&(e=e.__vccOpts),t){t=rs(t);let{class:e,style:n}=t;e&&!E(e)&&(t.class=A(e)),D(n)&&(fn(n)&&!S(n)&&(n=v({},n)),t.style=k(n))}let o=E(e)?1:zo(e)?128:Zr(e)?64:D(e)?4:T(e)?2:0;return o&4&&fn(e)&&(e=N(e),P("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
114
|
+
Component that was made reactive: `,e)),H(e,t,n,r,i,o,a,!0)}function rs(e){return e?fn(e)||Ya(e)?v({},e):e:null}function is(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?us(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&es(l),ref:t&&t.ref?n&&a?S(a)?a.concat(ts(t)):[a,ts(t)]:ts(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o===-1&&S(s)?s.map(as):s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==R?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&is(e.ssContent),ssFallback:e.ssFallback&&is(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&Si(u,c.clone(u)),u}function as(e){let t=is(e);return S(e.children)&&(t.children=e.children.map(as)),t}function W(e=` `,t=0){return U(Vo,null,e,t)}function os(e,t){let n=U(Uo,null,e);return n.staticCount=t,n}function G(e=``,t=!1){return t?(z(),V(Ho,null,e)):U(Ho,null,e)}function ss(e){return e==null||typeof e==`boolean`?U(Ho):S(e)?U(R,null,e.slice()):Xo(e)?cs(e):U(Vo,null,String(e))}function cs(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:is(e)}function ls(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(S(t))n=16;else if(typeof t==`object`)if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),ls(e,n()),n._c&&(n._d=!0));return}else{n=32;let r=t._;!r&&!Ya(t)?t._ctx=Fr:r===3&&Fr&&(Fr.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(T(t)){if(r&65){ls(e,{default:t});return}t={default:t,_ctx:Fr},n=32}else t=String(t),r&64?(n=16,t=[W(t)]):n=8;e.children=t,e.shapeFlag|=n}function us(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=A([t.class,r.class]));else if(e===`style`)t.style=k([t.style,r.style]);else if(g(e)){let n=t[e],i=r[e];i&&n!==i&&!(S(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!_(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function ds(e,t,n,r=null){Bn(e,t,7,[n,r])}var fs=Ea(),ps=0;function ms(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||fs,a={uid:ps++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new We(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:no(r,i),emitsOptions:Na(r,i),emit:null,emitted:null,propsDefaults:f,inheritAttrs:r.inheritAttrs,ctx:f,data:f,props:f,attrs:f,slots:f,refs:f,setupState:f,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx=oa(a),a.root=t?t.root:a,a.emit=ja.bind(null,a),e.ce&&e.ce(a),a}var hs=null,gs=()=>hs||Fr,_s,vs;{let e=Se(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};_s=t(`__VUE_INSTANCE_SETTERS__`,e=>hs=e),vs=t(`__VUE_SSR_SETTERS__`,e=>ws=e)}var ys=e=>{let t=hs;return _s(e),e.scope.on(),()=>{e.scope.off(),_s(t)}},bs=()=>{hs&&hs.scope.off(),_s(null)},xs=d(`slot,component`);function Ss(e,{isNativeTag:t}){(xs(e)||t(e))&&P(`Do not use built-in or reserved HTML elements as component id: `+e)}function Cs(e){return e.vnode.shapeFlag&4}var ws=!1;function Ts(e,t=!1,n=!1){t&&vs(t);let{props:r,children:i}=e.vnode,a=Cs(e);Xa(e,r,a,t),bo(e,i,n||t);let o=a?Es(e,t):void 0;return t&&vs(!1),o}function Es(e,t){let n=e.type;if(n.name&&Ss(n.name,e.appContext.config),n.components){let t=Object.keys(n.components);for(let n=0;n<t.length;n++)Ss(t[n],e.appContext.config)}if(n.directives){let e=Object.keys(n.directives);for(let t=0;t<e.length;t++)zr(e[t])}n.compilerOptions&&As()&&P(`"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`),e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,aa),sa(e);let{setup:r}=n;if(r){ct();let i=e.setupContext=r.length>1?Ps(e):null,a=ys(e),o=zn(r,e,0,[sn(e.props),i]),s=ne(o);if(lt(),a(),(s||e.sp)&&!Ai(e)&&wi(e),s){if(o.then(bs,bs),t)return o.then(n=>{Ds(e,n,t)}).catch(t=>{Vn(t,e,0)});e.asyncDep=o,e.suspense||P(`Component <${zs(e,n)}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`)}else Ds(e,o,t)}else js(e,t)}function Ds(e,t,n){T(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:D(t)?(Xo(t)&&P(`setup() should not return VNodes directly - return a render function instead.`),e.devtoolsRawSetupState=t,e.setupState=yn(t),ca(e)):t!==void 0&&P(`setup() should return an object. Received: ${t===null?`null`:typeof t}`),js(e,n)}var Os,ks,As=()=>!Os;function js(e,t,n){let r=e.type;if(!e.render){if(!t&&Os&&!r.render){let t=r.template||ga(e).template;if(t){wo(e,`compile`);let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r;r.render=Os(t,v(v({isCustomElement:n,delimiters:a},i),o)),To(e,`compile`)}}e.render=r.render||m,ks&&ks(e)}{let t=ys(e);ct();try{fa(e)}finally{lt(),t()}}!r.render&&e.render===m&&!t&&(!Os&&r.template?P(`Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`):P(`Component is missing template or render function: `,r))}var Ms={get(e,t){return Ia(),yt(e,`get`,``),e[t]},set(){return P(`setupContext.attrs is readonly.`),!1},deleteProperty(){return P(`setupContext.attrs is readonly.`),!1}};function Ns(e){return new Proxy(e.slots,{get(t,n){return yt(e,`get`,`$slots`),t[n]}})}function Ps(e){let t=t=>{if(e.exposed&&P(`expose() should be called only once per setup().`),t!=null){let e=typeof t;e===`object`&&(S(t)?e=`array`:gn(t)&&(e=`ref`)),e!==`object`&&P(`expose() should be passed a plain object, received ${e}.`)}e.exposed=t||{}};{let n,r;return Object.freeze({get attrs(){return n||=new Proxy(e.attrs,Ms)},get slots(){return r||=Ns(e)},get emit(){return(t,...n)=>e.emit(t,...n)},expose:t})}}function Fs(e){return e.exposed?e.exposeProxy||=new Proxy(yn(pn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in na)return na[n](e)},has(e,t){return t in e||t in na}}):e.proxy}var Is=/(?:^|[-_])\w/g,Ls=e=>e.replace(Is,e=>e.toUpperCase()).replace(/[-_]/g,``);function Rs(e,t=!0){return T(e)?e.displayName||e.name:e.name||t&&e.__name}function zs(e,t,n=!1){let r=Rs(t);if(!r&&t.__file){let e=t.__file.match(/([^/\\]+)\.\w+$/);e&&(r=e[1])}if(!r&&e){let n=e=>{for(let n in e)if(e[n]===t)return n};r=n(e.components)||e.parent&&n(e.parent.type.components)||n(e.appContext.components)}return r?Ls(r):n?`App`:`Anonymous`}function Bs(e){return T(e)&&`__vccOpts`in e}var Vs=(e,t)=>{let n=xn(e,t,ws);{let e=gs();e&&e.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function Hs(e,t,n){try{Jo(-1);let r=arguments.length;return r===2?D(t)&&!S(t)?Xo(t)?U(e,null,[t]):U(e,t):U(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Xo(n)&&(n=[n]),U(e,t,n))}finally{Jo(1)}}function Us(){if(typeof window>`u`)return;let e={style:`color:#3ba776`},t={style:`color:#1677ff`},n={style:`color:#f5222d`},r={style:`color:#eb2f96`},i={__vue_custom_formatter:!0,header(t){if(!D(t))return null;if(t.__isVue)return[`div`,e,`VueInstance`];if(gn(t)){ct();let n=t.value;return lt(),[`div`,{},[`span`,e,u(t)],`<`,s(n),`>`]}return ln(t)?[`div`,{},[`span`,e,dn(t)?`ShallowReactive`:`Reactive`],`<`,s(t),`>${un(t)?` (readonly)`:``}`]:un(t)?[`div`,{},[`span`,e,dn(t)?`ShallowReadonly`:`Readonly`],`<`,s(t),`>`]:null},hasBody(e){return e&&e.__isVue},body(e){if(e&&e.__isVue)return[`div`,{},...a(e.$)]}};function a(e){let t=[];e.type.props&&e.props&&t.push(o(`props`,N(e.props))),e.setupState!==f&&t.push(o(`setup`,e.setupState)),e.data!==f&&t.push(o(`data`,N(e.data)));let n=c(e,`computed`);n&&t.push(o(`computed`,n));let i=c(e,`inject`);return i&&t.push(o(`injected`,i)),t.push([`div`,{},[`span`,{style:r.style+`;opacity:0.66`},`$ (internal): `],[`object`,{object:e}]]),t}function o(e,t){return t=v({},t),Object.keys(t).length?[`div`,{style:`line-height:1.25em;margin-bottom:0.6em`},[`div`,{style:`color:#476582`},e],[`div`,{style:`padding-left:1.25em`},...Object.keys(t).map(e=>[`div`,{},[`span`,r,e+`: `],s(t[e],!1)])]]:[`span`,{}]}function s(e,i=!0){return typeof e==`number`?[`span`,t,e]:typeof e==`string`?[`span`,n,JSON.stringify(e)]:typeof e==`boolean`?[`span`,r,e]:D(e)?[`object`,{object:i?N(e):e}]:[`span`,n,String(e)]}function c(e,t){let n=e.type;if(T(n))return;let r={};for(let i in e.ctx)l(n,i,t)&&(r[i]=e.ctx[i]);return r}function l(e,t,n){let r=e[n];if(S(r)&&r.includes(t)||D(r)&&t in r||e.extends&&l(e.extends,t,n)||e.mixins&&e.mixins.some(e=>l(e,t,n)))return!0}function u(e){return dn(e)?`ShallowRef`:e.effect?`ComputedRef`:`Ref`}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}var Ws=`3.5.40`,Gs=P,Ks=void 0,qs=typeof window<`u`&&window.trustedTypes;if(qs)try{Ks=qs.createPolicy(`vue`,{createHTML:e=>e})}catch(e){Gs(`Error creating trusted types policy: ${e}`)}var Js=Ks?e=>Ks.createHTML(e):e=>e,Ys=`http://www.w3.org/2000/svg`,Xs=`http://www.w3.org/1998/Math/MathML`,Zs=typeof document<`u`?document:null,Qs=Zs&&Zs.createElement(`template`),$s={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?Zs.createElementNS(Ys,e):t===`mathml`?Zs.createElementNS(Xs,e):n?Zs.createElement(e,{is:n}):Zs.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>Zs.createTextNode(e),createComment:e=>Zs.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Zs.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{Qs.innerHTML=Js(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Qs.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ec=`transition`,tc=`animation`,nc=Symbol(`_vtc`),rc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},ic=v({},pi,rc),ac=(e=>(e.displayName=`Transition`,e.props=ic,e))((e,{slots:t})=>Hs(_i,cc(e),t)),oc=(e,t=[])=>{S(e)?e.forEach(e=>e(...t)):e&&e(...t)},sc=e=>e?S(e)?e.some(e=>e.length>1):e.length>1:!1;function cc(e){let t={};for(let n in e)n in rc||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:u=s,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,m=lc(i),h=m&&m[0],g=m&&m[1],{onBeforeEnter:_,onEnter:y,onEnterCancelled:b,onLeave:x,onLeaveCancelled:S,onBeforeAppear:C=_,onAppear:w=y,onAppearCancelled:ee=b}=t,T=(e,t,n,r)=>{e._enterCancelled=r,fc(e,t?u:s),fc(e,t?l:o),n&&n()},E=(e,t)=>{e._isLeaving=!1,fc(e,d),fc(e,p),fc(e,f),t&&t()},te=e=>(t,n)=>{let i=e?w:y,o=()=>T(t,e,n);oc(i,[t,o]),pc(()=>{fc(t,e?c:a),dc(t,e?u:s),sc(i)||hc(t,r,h,o)})};return v(t,{onBeforeEnter(e){oc(_,[e]),dc(e,a),dc(e,o)},onBeforeAppear(e){oc(C,[e]),dc(e,c),dc(e,l)},onEnter:te(!1),onAppear:te(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>E(e,t);dc(e,d),e._enterCancelled?(dc(e,f),yc(e)):(yc(e),dc(e,f)),pc(()=>{e._isLeaving&&(fc(e,d),dc(e,p),sc(x)||hc(e,r,g,n))}),oc(x,[e,n])},onEnterCancelled(e){T(e,!1,void 0,!0),oc(b,[e])},onAppearCancelled(e){T(e,!0,void 0,!0),oc(ee,[e])},onLeaveCancelled(e){E(e),oc(S,[e])}})}function lc(e){if(e==null)return null;if(D(e))return[uc(e.enter),uc(e.leave)];{let t=uc(e);return[t,t]}}function uc(e){let t=be(e);return Ln(t,`<transition> explicit duration`),t}function dc(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[nc]||(e[nc]=new Set)).add(t)}function fc(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[nc];n&&(n.delete(t),n.size||(e[nc]=void 0))}function pc(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var mc=0;function hc(e,t,n,r){let i=e._endId=++mc,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=gc(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function gc(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${ec}Delay`),a=r(`${ec}Duration`),o=_c(i,a),s=r(`${tc}Delay`),c=r(`${tc}Duration`),l=_c(s,c),u=null,d=0,f=0;t===ec?o>0&&(u=ec,d=o,f=a.length):t===tc?l>0&&(u=tc,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?ec:tc:null,f=u?u===ec?a.length:c.length:0);let p=u===ec&&/\b(?:transform|all)(?:,|$)/.test(r(`${ec}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function _c(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>vc(t)+vc(e[n])))}function vc(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function yc(e){return(e?e.ownerDocument:document).body.offsetHeight}function bc(e,t,n){let r=e[nc];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var xc=Symbol(`_vod`),Sc=Symbol(`_vsh`),Cc={name:`show`,beforeMount(e,{value:t},{transition:n}){e[xc]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):wc(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),wc(e,!0),r.enter(e)):r.leave(e,()=>{wc(e,!1)}):wc(e,t))},beforeUnmount(e,{value:t}){wc(e,t)}};function wc(e,t){e.style.display=t?e[xc]:`none`,e[Sc]=!t}var Tc=Symbol(`CSS_VAR_TEXT`),Ec=/(?:^|;)\s*display\s*:/;function Dc(e,t,n){let r=e.style,i=E(n),a=!1;if(n&&!i){if(t)if(E(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Ac(r,t,``)}else for(let e in t)n[e]??Ac(r,e,``);for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Ac(r,i,``):Pc(e,i,!E(t)&&t?t[i]:void 0,o)||Ac(r,i,o)}}else if(i){if(t!==n){let e=r[Tc];e&&(n+=`;`+e),r.cssText=n,a=Ec.test(n)}}else t&&e.removeAttribute(`style`);xc in e&&(e[xc]=a?r.display:``,e[Sc]&&(r.display=`none`))}var Oc=/[^\\];\s*$/,kc=/\s*!important$/;function Ac(e,t,n){if(S(n))n.forEach(n=>Ac(e,t,n));else if(n??=``,Oc.test(n)&&Gs(`Unexpected semicolon at the end of '${t}' style value: '${n}'`),t.startsWith(`--`))e.setProperty(t,n);else{let r=Nc(e,t);kc.test(n)?e.setProperty(pe(r),n.replace(kc,``),`important`):e[r]=n}}var jc=[`Webkit`,`Moz`,`ms`],Mc={};function Nc(e,t){let n=Mc[t];if(n)return n;let r=O(t);if(r!==`filter`&&r in e)return Mc[t]=r;r=me(r);for(let n=0;n<jc.length;n++){let i=jc[n]+r;if(i in e)return Mc[t]=i}return t}function Pc(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&E(r)&&n===r}var Fc=`http://www.w3.org/1999/xlink`;function Ic(e,t,n,r,i,a=Pe(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(Fc,t.slice(6,t.length)):e.setAttributeNS(Fc,t,n):n==null||a&&!Fe(n)?e.removeAttribute(t):e.setAttribute(t,a?``:te(n)?String(n):n)}function Lc(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?Js(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=Fe(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch(e){o||Gs(`Failed setting prop "${t}" on <${a.toLowerCase()}>: value ${n} is invalid.`,e)}o&&e.removeAttribute(i||t)}function Rc(e,t,n,r){e.addEventListener(t,n,r)}function zc(e,t,n,r){e.removeEventListener(t,n,r)}var Bc=Symbol(`_vei`);function Vc(e,t,n,r,i=null){let a=e[Bc]||(e[Bc]={}),o=a[t];if(r&&o)o.value=Yc(r,t);else{let[n,s]=Wc(t);r?Rc(e,n,a[t]=Jc(Yc(r,t),i),s):o&&(zc(e,n,o,s),a[t]=void 0)}}var Hc=/(Once|Passive|Capture)$/,Uc=/^on:?(?:Once|Passive|Capture)$/;function Wc(e){let t,n;for(;(n=e.match(Hc))&&!Uc.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):pe(e.slice(2)),t]}var Gc=0,Kc=Promise.resolve(),qc=()=>Gc||=(Kc.then(()=>Gc=0),Date.now());function Jc(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(S(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&Bn(e,t,5,a)}}else Bn(r,t,5,[e])};return n.value=e,n.attached=qc(),n}function Yc(e,t){return T(e)||S(e)?e:(Gs(`Wrong type passed as event handler to ${t} - did you forget @ or : in front of your prop?
|
|
115
|
+
Expected function or array of functions, received type ${typeof e}.`),m)}var Xc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Zc=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?bc(e,r,o):t===`style`?Dc(e,n,r):g(t)?_(t)||Vc(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):Qc(e,t,r,o))?(Lc(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&Ic(e,t,r,o,a,t!==`value`)):e._isVueCE&&($c(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!E(r)))?Lc(e,O(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Ic(e,t,r,o))};function Qc(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Xc(t)&&T(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return Xc(t)&&E(n)?!1:t in e}function $c(e,t){let n=e._def.props;if(!n)return!1;let r=O(t);return Array.isArray(n)?n.some(e=>O(e)===r):Object.keys(n).some(e=>O(e)===r)}var el=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return S(t)?e=>_e(t,e):t};function tl(e){e.target.composing=!0}function nl(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var rl=Symbol(`_assign`);function il(e,t,n){return t&&(e=e.trim()),n&&(e=ye(e)),e}var al={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[rl]=el(i);let a=r||i.props&&i.props.type===`number`;Rc(e,t?`change`:`input`,t=>{t.target.composing||e[rl](il(e.value,n,a))}),(n||a)&&Rc(e,`change`,()=>{e.value=il(e.value,n,a)}),t||(Rc(e,`compositionstart`,tl),Rc(e,`compositionend`,nl),Rc(e,`change`,nl))},mounted(e,{value:t}){e.value=t??``},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[rl]=el(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ye(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},ol={deep:!0,created(e,t,n){e[rl]=el(n),Rc(e,`change`,()=>{let t=e._modelValue,n=dl(e),r=e.checked,i=e[rl];if(S(t)){let e=Re(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(w(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(fl(e,r))})},mounted:sl,beforeUpdate(e,t,n){e[rl]=el(n),sl(e,t,n)}};function sl(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(S(t))i=Re(t,r.props.value)>-1;else if(w(t))i=t.has(r.props.value);else{if(t===n)return;i=Le(t,fl(e,!0))}e.checked!==i&&(e.checked=i)}var cl={created(e,{value:t},n){e.checked=Le(t,n.props.value),e[rl]=el(n),Rc(e,`change`,()=>{e[rl](dl(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[rl]=el(r),t!==n&&(e.checked=Le(t,r.props.value))}},ll={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,Rc(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ye(dl(e)):dl(e));e[rl](e.multiple?w(e._modelValue)?new Set(t):t:t[0]),e._assigning=!0,Zn(()=>{e._assigning=!1})}),e[rl]=el(r)},mounted(e,{value:t}){ul(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[rl]=el(n)},updated(e,{value:t}){e._assigning||ul(e,t)}};function ul(e,t){let n=e.multiple,r=S(t);if(n&&!r&&!w(t)){Gs(`<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(t).slice(8,-1)}.`);return}for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=dl(a);if(n)if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Re(t,o)>-1}else a.selected=t.has(o);else if(Le(dl(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}function dl(e){return`_value`in e?e._value:e.value}function fl(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var pl={created(e,t,n){hl(e,t,n,null,`created`)},mounted(e,t,n){hl(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){hl(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){hl(e,t,n,r,`updated`)}};function ml(e,t){switch(e){case`SELECT`:return ll;case`TEXTAREA`:return al;default:switch(t){case`checkbox`:return ol;case`radio`:return cl;default:return al}}}function hl(e,t,n,r,i){let a=ml(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}var gl=[`ctrl`,`shift`,`alt`,`meta`],_l={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>gl.some(n=>e[`${n}Key`]&&!t.includes(n))},K=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=_l[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},vl={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},yl=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=pe(n.key);if(t.some(e=>e===r||vl[e]===r))return e(n)}))},bl=v({patchProp:Zc},$s),xl;function Sl(){return xl||=ko(bl)}var Cl=((...e)=>{let t=Sl().createApp(...e);Tl(t),El(t);let{mount:n}=t;return t.mount=e=>{let r=Dl(e);if(!r)return;let i=t._component;!T(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,wl(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function wl(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function Tl(e){Object.defineProperty(e.config,"isNativeTag",{value:e=>Ae(e)||je(e)||Me(e),writable:!1})}function El(e){if(As()){let t=e.config.isCustomElement;Object.defineProperty(e.config,"isCustomElement",{get(){return t},set(){Gs("The `isCustomElement` config option is deprecated. Use `compilerOptions.isCustomElement` instead.")}});let n=e.config.compilerOptions,r='The `compilerOptions` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, `compilerOptions` must be passed to `@vue/compiler-dom` in the build setup instead.\n- For vue-loader: pass it via vue-loader\'s `compilerOptions` loader option.\n- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\n- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc';Object.defineProperty(e.config,"compilerOptions",{get(){return Gs(r),n},set(){Gs(r)}})}}function Dl(e){if(E(e)){let t=document.querySelector(e);return t||Gs(`Failed to mount app: mount target selector "${e}" returned null.`),t}return window.ShadowRoot&&e instanceof window.ShadowRoot&&e.mode===`closed`&&Gs('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),e}function Ol(){Us()}Ol();var kl=`cardbuddy:dev-service`,Al=typeof window<`u`&&(window.__CARD_DEV_PREVIEW_BASE__||window.__CARD_DEV_OFFLINE_BASE__)||``,jl={enabled:!1,baseUrl:`http://127.0.0.1:8787`,token:``},Ml=new Set([`localhost`,`127.0.0.1`,`[::1]`,`::1`]);function Nl(){if(typeof window>`u`||!window.location)return!1;let{protocol:e,hostname:t}=window.location;return e!==`http:`&&e!==`https:`?!1:!Ml.has(t)}function Pl(){try{let e=localStorage.getItem(kl);if(e)return{...jl,...JSON.parse(e)}}catch{}return Al?{...jl,enabled:!0,baseUrl:Al,token:``}:{...jl}}function Fl(e){try{localStorage.setItem(kl,JSON.stringify(e))}catch{}}function Il(){if(Al)return Al.replace(/\/+$/,``);let e=Pl();return e.enabled&&e.baseUrl?e.baseUrl.replace(/\/+$/,``):Nl()?``:jl.baseUrl}function Ll(){let e=Pl();return e.enabled&&e.token||``}async function q(e,t={}){let n=(Il()||``)+e,r={...t.headers||{}},i=Ll();return i&&(r[`x-dev-token`]=i),fetch(n,{...t,headers:r})}var Rl=new Map;function zl(e){let t=Rl.get(e);if(!t){let n=Ll(),r=new EventSource(e+`/__events`+(n?`?token=`+encodeURIComponent(n):``));t={es:r,states:new Set,refs:0},Rl.set(e,t),r.onopen=()=>{for(let e of t.states)e(`open`)},r.onerror=()=>{let e=r.readyState===2?`closed`:`connecting`;for(let n of t.states)n(e)}}return t.refs++,t}function Bl(e,t){if(t.refs=Math.max(0,t.refs-1),t.refs===0&&Rl.get(e)===t){Rl.delete(e);try{t.es.close()}catch{}}}function Vl(e,{hmrEvents:t=[]}={}){return function(t,n){let r=Il(),i=e=>{typeof n==`function`&&n(e)};if(r!==null){let n=zl(r),a=e=>{try{t(e.data?JSON.parse(e.data):{})}catch{t({})}};for(let t of e)n.es.addEventListener(t,a);return n.states.add(i),i(n.es.readyState===1?`open`:n.es.readyState===2?`closed`:`connecting`),()=>{for(let t of e)n.es.removeEventListener(t,a);n.states.delete(i),Bl(r,n)}}return()=>{}}}var Hl=Vl([`cards-changed`],{hmrEvents:[`cards-changed`]}),Ul=Vl([`code-bridge-changed`,`code-bridge-closed`]),Wl=Vl([`service-log`]);async function Gl({limit:e=300,since:t=0}={}){let n=new URLSearchParams({limit:String(e)});t&&n.set(`since`,String(t));let r=await q(`/__logs?`+n.toString());if(!r.ok)throw Error(`HTTP `+r.status);return r.json()}async function Kl(e,t=``){let n=await q(`/__code-bridge`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({code:e,label:t})});if(!n.ok)throw Error(`code-bridge open failed: ${n.status}`);return n.json()}async function ql(e){let t=await q(`/__code-bridge/${e}`);if(!t.ok)throw Error(`code-bridge fetch failed: ${t.status}`);return t.json()}async function Jl(e){return(await q(`/__code-bridge/${e}/heartbeat`,{method:`POST`})).ok}async function Yl(e){return(await q(`/__code-bridge/${e}`,{method:`DELETE`})).ok}var Xl={"@staticfile/":`/fastdfs/`,"@filestore/":`/minio/`,"@minio/":`/minio/`,"@floorstatic/":`/floorstatic/`,"@flamestore/":`/`},Zl=`https://uat-pkg.finmall.com`,Ql=Zl.replace(/^https?:/,``),$l=[...new Set([Zl,Zl.replace(/^https:/,`http:`),Ql])];function eu(e){if(typeof e!=`string`||!e)return e;for(let t of $l)if(e.startsWith(t))return e.slice(t.length)||`/`;return e}var tu=class{constructor(e={}){this.options={availableWidth:0,applyUnit:`px`,applyUnitRatio:1,fontRatio:1,styleWidth:375,apiBase:void 0,...e}}getSystemInfo(){let e=this.options;return{screenWidth:typeof window<`u`?window.innerWidth:e.styleWidth,availableWidth:e.availableWidth,applyUnit:e.applyUnit,applyUnitRatio:e.applyUnitRatio,fontRatio:e.fontRatio}}getDesignInfo(){return{styleWidth:this.options.styleWidth}}doReplaceUrl(e){if(typeof e!=`string`||/^https?:\/\//i.test(e))return e;let t=e;try{for(let e of Object.keys(Xl))t=t.replace(new RegExp(e,`g`),Xl[e])}catch{}let n=eu(t),r=this.options.apiBase===void 0?Il():this.options.apiBase;return r&&typeof n==`string`&&n.startsWith(`/`)?r+n:n}doSize(e,t){if(!e&&e!==0)return``;if(e===`auto`||String(e).indexOf(`%`)>-1)return e;let n=this.getSystemInfo()||{},r=this.getDesignInfo()||{},i=String(e).replace(/[^0-9\-.]/g,``),a=1;if(n.availableWidth){t===`font`&&(a=Number(n.fontRatio||1));let e=parseFloat(n.availableWidth)/parseFloat(r.styleWidth);return parseFloat(i)*e*a+n.applyUnit}return i+n.applyUnit}doColor(e=``){let t=String(e);if(/^#[a-fA-F0-9]{8}$/.test(t)){let[e,n,r,i]=t.substring(1).match(/[a-fA-F0-9]{2}/g);return`rgba(${parseInt(n,16)}, ${parseInt(r,16)}, ${parseInt(i,16)}, ${parseInt(e,16)/100})`}return t}doRemoveUnit(e=``){return String(e).replace(/[^0-9.]/g,``)}doApplyUnit(e){return e+(this.getSystemInfo()||{}).applyUnit}doI18n(e){return e}async doRpc(){return{}}};function nu(e){if(Array.isArray(e))return e.map(nu);if(e&&typeof e==`object`){let t={};for(let n of Object.keys(e))t[n]=nu(e[n]);return t}return e}function ru(e){return nu(e||{})}function iu(e){if(e===null)return`null`;if(e===void 0)return`undefined`;let t=typeof e;if(t===`string`)return e;if(t===`number`||t===`boolean`||t===`bigint`)return String(e);if(t===`function`)return`[Function `+(e.name||`anonymous`)+`]`;try{return JSON.stringify(e)}catch{return String(e)}}var au=[`customAction`,`listener`,`syncRemote`,`saveCard`,`refresh`];function ou(e,t){let n=rn(e||{}),r=rn(ru(e)),i=rn({value:0}),a=rn({value:0}),o=!1,s=rn({value:0}),c=rn({value:0}),l=[],u={adapter:t,get rootScope(){return n},get state(){return r},setRootScope(e){let t=e||{};for(let e of Object.keys(n))delete n[e];Object.assign(n,t);let i=ru(t);for(let e of Object.keys(r))delete r[e];Object.assign(r,i),this.markDirty()},reseedState(){let e=ru(n);for(let e of Object.keys(r))delete r[e];Object.assign(r,e),this.markDirty()},get revision(){return i.value},get errorRev(){return a.value},get apiRev(){return s.value},get logRev(){return c.value},errors:[],eventErrors:[],eventLogs:[],apiCalls:[],listeners:{},markDirty(){i.value++},clearErrors(){this.errors.length=0,this.eventErrors.length=0,this.eventLogs.length=0,c.value++,this.scheduleErrorBump()},clearBindingErrors(){this.errors.length=0,this.scheduleErrorBump()},clearApiCalls(){this.apiCalls.length=0,s.value++},pushLog(e,t){let n=t||[],r=n.map(e=>iu(e)).join(` `);this.eventLogs.push({level:e,text:r,args:n,t:Date.now()}),this.eventLogs.length>500&&this.eventLogs.shift(),c.value++},clearEventLogs(){this.eventLogs.length=0,c.value++},pushError(e,t){let n=au.includes(e)?this.eventErrors:this.errors;n.push({kind:e,msg:t,t:Date.now()}),n.length>500&&n.shift(),this.scheduleErrorBump()},scheduleErrorBump(){o||(o=!0,Zn(()=>{o=!1,a.value++}))},getBindingBuffer(){return l},startBindingPass(){l=[]},commitBindingPass(){let e=new Set,t=[];for(let n of l)e.has(n.msg)||(e.add(n.msg),t.push(n));this.errors.length=0;for(let e of t)this.errors.push(e);this.scheduleErrorBump()},pushApiCall(e,t){this.apiCalls.push({api:e,payload:t,t:Date.now()}),this.apiCalls.length>500&&this.apiCalls.shift(),s.value++},addEventListener(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},postMessage(e,t){let n=this.listeners[e]||[],r={data:t,type:e};n.forEach(t=>{try{t(r)}catch(t){this.pushError(`listener`,`${e}: ${t&&t.message}`)}}),this.pushApiCall(`postMessage:`+e,t)}};return Gr(()=>n,()=>u.reseedState(),{deep:!0}),u}var su=0,cu=e=>`${e}_${(++su).toString(36)}`,lu={const:`0`,var:`1`,image:`2`},uu={Delete:`1`,Append:`2`},du=e=>e===void 0?e:JSON.parse(JSON.stringify(e)),fu=class e{constructor(t=[],n={}){this.id=cu(`propgroup`),this.properties=(t||[]).map(e=>new J(e)),e.setPropertyValue(this.properties,n)}static setPropertyValue(e=[],t={}){t&&e.forEach(e=>{e.itemVisible&&e.itemKey&&t[e.itemKey]!==void 0&&e.itemValueFrom===`0`&&(e.itemValue=t[e.itemKey])})}onRestore(e={},t,n,r){J.restoreProperty(e.properties||[],this.properties,t,n,r)}onPreview(e){return this.properties.reduce((t,n)=>{let r=n.onPreview(e);return r&&Object.assign(t,r),t},{})}onExport(e){return{properties:this.properties.reduce((t,n)=>{if(!e||e.itemId===n.itemId){let r=n.onExport(e&&e.child);r&&t.push(r)}return t},[])}}},J=class e{constructor(e={}){this.id=cu(`prop`);let t=du(e)||{};this.itemId=t.itemId,this.itemName=t.itemName,this.itemType=t.itemType,this.itemKey=t.itemKey,this.itemOption=t.itemOption||{},this.itemParam=t.itemParam||{},this.itemDefaultValue=t.itemDefaultValue===void 0?null:t.itemDefaultValue,this.itemDesc=t.itemDesc,this.itemCondition=t.itemCondition,this.itemWatch=t.itemWatch||{},this.itemTypeRange=t.itemTypeRange||`const,var`,this.itemDirection=t.itemDirection,this.itemVisible=!0,this.itemUpdated=!1,this.itemValueFrom=lu[String(this.itemTypeRange).split(/,/)[0]],this._itemValueFrom=this.itemValueFrom;let n=du(this.itemDefaultValue);this.itemChildren=new fu(t.itemChildren||[],n),this.itemTemplate=t.itemTemplate||t.itemList||[],this.itemList=[],!this.itemChildren.properties.length&&Object.keys(this.itemTemplate).length&&this.initItemList(n),this.initItemValue(n),this._valuesByFrom={0:void 0,1:void 0,2:void 0},this._valuesByFrom[this.itemValueFrom]=this.itemValue}initItemValue(e,t=!1){this.itemValue=this.itemValueFrom===`1`||this.itemValueFrom===`2`?t?e:``:this.itemChildren.properties.length?{}:Object.keys(this.itemTemplate).length?[]:e}initItemList(e){let t=e||[];Array.isArray(t)&&t.forEach(e=>this.addItems(e))}addItems(e,t){let n=this.itemOption?.templateField||``;if(this.itemChildren.properties.length)return;let r=e?e[n]:``,i=new fu(n?this.itemTemplate[r]||[]:this.itemTemplate||[],e||{});return t&&t(i),this.itemList.push(i),i}removeAt(e){this.itemChildren.properties.length||e>=0&&e<this.itemList.length&&this.itemList.splice(e,1)}moveItem(e,t){if(this.itemChildren.properties.length||e<0||e>=this.itemList.length||(t=Math.max(0,Math.min(this.itemList.length-1,t)),e===t))return;let[n]=this.itemList.splice(e,1);this.itemList.splice(t,0,n)}onRestore(e={},t,n={},r=[]){if(!Object.keys(e).length)return;let i=[].concat(r);i.push(this.itemId),e.itemValueFrom!==void 0&&(this.itemValueFrom=e.itemValueFrom),this.initItemValue(e.itemValue,!0),this._valuesByFrom={0:void 0,1:void 0,2:void 0},this._valuesByFrom[this.itemValueFrom]=this.itemValue,this.itemChildren.onRestore(e.itemChildren||{},t,n,i),this.itemList=[];let a=Array.isArray(e.itemValue)?e.itemValue:[];a.length||!e.itemList?a.forEach(e=>this.addItems(e||{})):Array.isArray(e.itemList)&&e.itemList.forEach(e=>{let r=this.addItems({});r&&r.onRestore(e,t,n,i)})}onPreview(e){let t={},n=e?e.paths:[],r=!!(n&&n.length),i=r?e.vars:{},a=[].concat(n||[]);return this.itemVisible&&this.itemKey&&(this.itemValueFrom===`0`?this.itemChildren.properties.length>0?(a.push(this.itemKey),t[this.itemKey]=this.itemChildren.onPreview({paths:a,vars:i})):this.itemList.length>0?(a.push(this.itemKey),t[this.itemKey]=this.itemList.map((e,t)=>{let n=[].concat(a);return n.push(t),e.onPreview({paths:n,vars:i})})):t[this.itemKey]=this.itemValue:this.itemValueFrom===`1`?(t[this.itemKey]=this.itemDefaultValue,this.itemValue&&(a.push(this.itemKey),i[a.join(`.`)]=this.itemValue)):this.itemValueFrom===`2`&&(t[this.itemKey]=this.itemValue)),r||(t.__vars__=i),t}onExport(e){if(!this.itemVisible||this.itemKey===void 0||this.itemKey===null)return;let t=this.itemChildren.onExport(e),n=this.itemList.map(t=>t.onExport(e)),r={};return this.itemValueFrom===`1`&&(r.itemDefaultValue=this.itemDefaultValue),t&&t.properties.length?r.itemChildren=t:n.length&&(r.itemList=n),{itemId:this.itemId,itemKey:this.itemKey,itemValueFrom:this.itemValueFrom,itemValue:this.itemValue,...r}}static mergePreview(e={},t={}){let n=e.__vars__,r=t.__vars__;return r?Object.assign(e,t,{__vars__:Object.assign({},n,r)}):Object.assign(e,r)}static restoreProperty(e=[],t=[],n,r={},i){if(r||={},!e.length||!t.length)return;let a={},o=(e||[]).reduce((e,t)=>{let n=t.itemId||t.itemKey;return n&&(e[n]=t,a[n]=t),e},{});for(let e=0;e<t.length;e++){let s=t[e],c=o[s.itemId]||o[s.itemKey];c?(delete a[s.itemId],delete a[s.itemKey],s.onRestore(c,n,{},i),s.itemUpdated=!0,r.restore&&r.restore(s)):n===uu.Delete&&(t.splice(e--,1),r.delete&&r.delete(s))}if(n===uu.Append)for(let e in a)r.append&&r.append(a[e],t,[].concat(i||[]))}static updatePropertyVisible(t=[]){let n=t||[],r=e._conditionData(n);n.forEach(t=>{t.itemVisible=!/\./.test(t.itemCondition)||e._conditionResult(t.itemCondition,r),e.updatePropertyVisible(t.itemChildren.properties),t.itemList.forEach(t=>e.updatePropertyVisible(t.properties))})}static _conditionData(e){return e.reduce((e,t)=>{let n=`${t.itemCondition||``}`;return n&&n.split(`.`).length%2==1&&(e[n]=t.itemValue),e},{})}static _conditionResult(e=``,t={}){let n=!0,r=e.split(`.`);for(let e=0;e<r.length-1;e+=2){let i=r.slice(0,e+1).join(`.`),a=r[e+1],o=!1;/^!/.test(a)&&(o=!0,a=a.substring(1));let s=a.split(`|`);n=!1;for(let e=0;e<s.length;e++)if(t[i]==s[e]){n=!0;break}if(o&&(n=!n),!n)break}return n}},pu={_source:`uat-pkg.finmall.com /ubomp-h5-sub/inner_card/js/6.5c0327ab.js module 931(组件分组清单)`,_note:`metaInfo 精简版:className / name / group / style.state / style.visible / style.meta / properties / slots / events。skeleton(SVG 缩略图) 已剔除。style.state 是组件的默认样式初始值,Style.onRestore 会先用它建组,再用 schema 的 style.properties 合并覆盖。`,groups:[`布局组件`,`基础组件`],components:JSON.parse('{"Row":{"className":"Row","name":"行","group":"布局组件","styleState":{"rect":{"width":"100%"},"flex":{"gap":"4","alignItems":"center"}},"styleVisible":{"rect":true,"background":true,"flex":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{"flex":{"justifyContent":{"itemName":"水平对齐"},"alignItems":{"itemName":"垂直对齐"}}},"properties":[],"slots":[{"slotKey":"default","slotName":"容器组件插槽","slotWidth":"100%","slotHeight":"100%","slotSwitch":"1"}],"events":[{"eventName":"点击事件","eventKey":"click"}]},"Column":{"className":"Column","name":"列","group":"布局组件","styleState":{"rect":{"width":"100%"},"flex":{"gap":"4","flexDirection":"column","justifyContent":"center"}},"styleVisible":{"rect":true,"background":true,"flex":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[],"slots":[{"slotKey":"default","slotName":"容器组件插槽","slotWidth":"100%","slotHeight":"100%","slotSwitch":"1"}],"events":[{"eventName":"点击事件","eventKey":"click"}]},"MultiColumn":{"className":"MultiColumn","name":"多列布局","group":"布局组件","styleState":{"rect":{"width":"100%"},"flex":{"gap":"12"}},"styleVisible":{"rect":true,"background":true,"flex":{"gap":true,"flexShrink":true},"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[],"slots":[{"slotKey":"default","slotName":"容器组件插槽","slotWidth":"100%","slotHeight":"100%","slotSwitch":"1"}],"events":[{"eventName":"点击事件","eventKey":"click"}]},"ListLayout":{"className":"ListLayout","name":"列表布局","group":"布局组件","styleState":{"rect":{"width":"100%","height":"auto"}},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"background":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"数据源","itemKey":"value","itemTypeRange":"var","itemOption":{},"itemDefaultValue":[{},{},{},{}]},{"itemId":"006","itemName":"方向","itemKey":"direction","itemTypeRange":"const","itemType":"TabSelect","itemOption":{"iParamList":[{"key":"vertical","value":"纵向"},{"key":"horizontal","value":"横向"}]},"itemDefaultValue":"vertical"},{"itemId":"003","itemName":"元素间距","itemKey":"row-spacing","itemTypeRange":"const","itemType":"InputNumber","itemOption":{},"itemDefaultValue":12},{"itemId":"005","itemName":"内边距","itemKey":"edge-insets","itemTypeRange":"const","itemType":"PaddingStyle","itemOption":{},"itemDefaultValue":"{2,2,2,2}"}],"slots":[{"slotKey":"default","slotName":"容器组件插槽","slotScope":true,"slotWidth":"100%","slotHeight":"100%","slotSwitch":"1"}],"events":[{"eventName":"点击事件","eventKey":"click"}]},"GridLayout":{"className":"GridLayout","name":"网格布局","group":"布局组件","styleState":{"rect":{"width":"100%","height":"auto"}},"styleVisible":{"rect":true,"background":true,"flex":{"flexShrink":true},"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"数据源","itemKey":"value","itemTypeRange":"var","itemOption":{},"itemDefaultValue":[{},{},{},{}]},{"itemId":"002","itemName":"列数目","itemKey":"column","itemTypeRange":"const","itemType":"InputNumber","itemOption":{},"itemDefaultValue":2},{"itemId":"003","itemName":"行间距","itemKey":"row-spacing","itemTypeRange":"const","itemType":"InputNumber","itemOption":{},"itemDefaultValue":12},{"itemId":"004","itemName":"列间距","itemKey":"item-spacing","itemTypeRange":"const","itemType":"InputNumber","itemOption":{},"itemDefaultValue":4},{"itemId":"005","itemName":"内边距","itemKey":"edge-insets","itemTypeRange":"const","itemType":"PaddingStyle","itemOption":{},"itemDefaultValue":"{2,2,2,2}"}],"slots":[{"slotKey":"default","slotName":"容器组件插槽","slotScope":true,"slotWidth":"100%","slotHeight":"100%","slotSwitch":"1"}],"events":[{"eventName":"点击事件","eventKey":"click"}]},"AbsoluteLayout":{"className":"AbsoluteLayout","name":"绝对布局","group":"布局组件","styleState":{"rect":{"width":"100%","height":"100"}},"styleVisible":{"flex":{"flexShrink":true},"rect":true,"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"对齐方式","itemKey":"align","itemTypeRange":"const","itemType":"PositionStyle","itemOption":{},"itemDefaultValue":""}],"slots":[{"slotKey":"default","slotName":"容器组件插槽","slotWidth":"100%","slotHeight":"100%","slotSwitch":"1"}],"events":[]},"Text":{"className":"Text","name":"文本","group":"基础组件","styleState":{},"styleVisible":{"font":true,"rect":true,"flex":{"flexShrink":true},"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{"rect":{"width":{"itemOption":{"iTypeList":[{"key":"percent","value":"%"},{"key":"number","value":"px"}]}}}},"properties":[{"itemId":"001","itemName":"内容","itemKey":"value","itemType":"Textarea","itemDefaultValue":"这是一个文本"},{"itemId":"002","itemName":"常用样式","itemTypeRange":"const","itemType":"CustomSelect","itemOption":{"list":[{"type":"div","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","marginRight":"8px","cursor":"pointer"},"list":[{"type":"span","innerText":"黑色","style":{"fontSize":"14px","color":"#333333"}}],"sync":{"style.font.color":"#333333","style.font.fontWeight":"400","style.font.fontSize":"14","style.background.backgroundType":"00","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"","style.padding.paddingType":""}},{"type":"div","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","marginRight":"8px","cursor":"pointer"},"list":[{"type":"span","innerText":"灰色","style":{"fontSize":"14px","color":"#555555"}}],"sync":{"style.font.color":"#555555","style.font.fontWeight":"400","style.font.fontSize":"14","style.background.backgroundType":"00","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"","style.padding.paddingType":""}},{"type":"div","innerText":"淡灰色","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","marginRight":"8px","cursor":"pointer"},"list":[{"type":"span","innerText":"淡灰色","style":{"fontSize":"14px","color":"#999999"}}],"sync":{"style.font.color":"#999999","style.font.fontWeight":"400","style.font.fontSize":"14","style.background.backgroundType":"00","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"","style.padding.paddingType":""}},{"type":"div","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","marginRight":"8px","cursor":"pointer"},"list":[{"type":"span","innerText":"热门","style":{"fontSize":"10px","backgroundColor":"#ff0000","borderRadius":"4px","padding":"1px 5px","color":"#ffffff"}}],"sync":{"style.font.color":"#ffffff","style.font.fontWeight":"400","style.font.fontSize":"10","style.background.backgroundType":"01","style.background.backgroundColor":"#ff0000","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"4","style.padding.paddingType":"1","style.padding.paddingLeft":"5","style.padding.paddingTop":"1","style.padding.paddingRight":"5","style.padding.paddingBottom":"1"}},{"type":"div","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","marginRight":"8px","cursor":"pointer"},"list":[{"type":"span","innerText":"热销","style":{"fontSize":"10px","backgroundColor":"#ff0000","borderRadius":"100px","padding":"1px 5px","color":"#ffffff"}}],"sync":{"style.font.color":"#ffffff","style.font.fontWeight":"400","style.font.fontSize":"10","style.background.backgroundType":"01","style.background.backgroundColor":"#ff0000","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"100","style.padding.paddingType":"1","style.padding.paddingLeft":"5","style.padding.paddingTop":"1","style.padding.paddingRight":"5","style.padding.paddingBottom":"1"}},{"type":"div","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","marginRight":"8px","cursor":"pointer"},"list":[{"type":"span","innerText":"理财","style":{"fontSize":"12px","backgroundColor":"#F1F4FE","borderRadius":"4px","padding":"2px 8px","color":"#90969E"}}],"sync":{"style.font.color":"#90969E","style.font.fontWeight":"400","style.font.fontSize":"12","style.background.backgroundType":"01","style.background.backgroundColor":"#F1F4FE","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"4","style.padding.paddingType":"1","style.padding.paddingLeft":"8","style.padding.paddingTop":"2","style.padding.paddingRight":"8","style.padding.paddingBottom":"2"}},{"type":"div","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","marginRight":"8px","cursor":"pointer"},"list":[{"type":"span","innerText":"存款","style":{"fontSize":"14px","border":"1px solid #8A8A8A","borderRadius":"4px","padding":"1px 4px","color":"#545356"}}],"sync":{"style.font.color":"#545356","style.font.fontWeight":"400","style.font.fontSize":"14","style.background.backgroundType":"00","style.border.isBorder":"1","style.border.borderWidth":"1","style.border.borderColor":"#8A8A8A","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"4","style.padding.paddingType":"1","style.padding.paddingLeft":"4","style.padding.paddingTop":"1","style.padding.paddingRight":"4","style.padding.paddingBottom":"1"}},{"type":"div","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","marginRight":"8px","cursor":"pointer"},"list":[{"type":"span","innerText":"240","style":{"fontSize":"22px","color":"#ff0000","fontWeight":"600"}}],"sync":{"style.font.color":"#ff0000","style.font.fontWeight":"600","style.font.fontSize":"22","style.background.backgroundType":"00","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"","style.padding.paddingType":""}}]}}],"slots":[],"events":[{"eventName":"点击事件","eventKey":"click"}]},"Button":{"className":"Button","name":"按钮","group":"基础组件","styleState":{"font":{"color":"#ffffff","fontSize":"16"},"background":{"backgroundType":"01","backgroundColor":"#0079f2"},"borderRadius":{"borderRadiusType":"0","borderRadius":"100"},"rect":{"width":"120","height":"40"}},"styleVisible":{"font":{"color":true,"fontSize":true,"fontWeight":true},"rect":true,"flex":{"flexShrink":true},"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"按钮文字","itemKey":"value","itemType":"Input","itemDefaultValue":"确定"},{"itemId":"002","itemName":"常用样式","itemTypeRange":"const","itemType":"CustomSelect","itemOption":{"list":[{"type":"div","innerText":"确定","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","borderRadius":"20px","fontSize":"12px","marginRight":"8px","cursor":"pointer","color":"#fff","backgroundColor":"#0079f2"},"sync":{"style.font.color":"#ffffff","style.font.fontSize":"16","style.background.backgroundType":"01","style.background.backgroundColor":"#0079f2","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"100"}},{"type":"div","innerText":"确定","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","borderRadius":"20px","fontSize":"12px","marginRight":"8px","cursor":"pointer","color":"#fff","backgroundColor":"#f3464a"},"sync":{"style.font.color":"#ffffff","style.font.fontSize":"16","style.background.backgroundType":"01","style.background.backgroundColor":"#f3464a","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"100"}},{"type":"div","innerText":"确定","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","borderRadius":"20px","fontSize":"12px","marginRight":"8px","cursor":"pointer","color":"#0079f2","backgroundColor":"#ffffff","border":"1px solid #0079f2"},"sync":{"style.font.color":"#0079f2","style.font.fontSize":"16","style.background.backgroundType":"01","style.background.backgroundColor":"#ffffff","style.border.isBorder":"1","style.border.borderWidth":"1","style.border.borderStyle":"solid","style.border.borderColor":"#0079f2","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"100"}},{"type":"div","innerText":"确定","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","borderRadius":"20px","fontSize":"12px","marginRight":"8px","cursor":"pointer","color":"#555","backgroundColor":"#f0ead2"},"sync":{"style.font.color":"#555555","style.font.fontSize":"16","style.background.backgroundType":"01","style.background.backgroundColor":"#f0ead2","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"100"}},{"type":"div","innerText":"确定","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","borderRadius":"20px","fontSize":"12px","marginRight":"8px","cursor":"pointer","color":"#f3474b","backgroundColor":"#fff0f1"},"sync":{"style.font.color":"#f3474b","style.font.fontSize":"16","style.background.backgroundType":"01","style.background.backgroundColor":"#fff0f1","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"100"}},{"type":"div","innerText":"确定","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","borderRadius":"20px","fontSize":"12px","marginRight":"8px","cursor":"pointer","color":"#9a9a9a","backgroundColor":"#e6e6e6"},"sync":{"style.font.color":"#9a9a9a","style.font.fontSize":"16","style.background.backgroundType":"01","style.background.backgroundColor":"#e6e6e6","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"0","style.borderRadius.borderRadius":"100"}},{"type":"div","innerText":"确定","style":{"width":"59px","height":"24px","lineHeight":"24px","textAlign":"center","fontSize":"15px","marginRight":"8px","cursor":"pointer","color":"#0079F2"},"sync":{"style.font.color":"#0079F2","style.font.fontSize":"15","style.background.backgroundType":"00","style.border.isBorder":"0","style.borderRadius.borderRadiusType":"","style.rect.width":"100%","style.rect.height":"40"}}]}},{"itemId":"003","itemName":"禁用按钮","itemKey":"disabled","itemTypeRange":"const,var","itemType":"BooleanForm","itemOption":{"activeText":"启用","inactiveText":"禁用"},"itemDefaultValue":false}],"slots":[],"events":[{"eventName":"点击事件","eventKey":"click"}]},"Image":{"className":"Image","name":"图片","group":"基础组件","styleState":{"rect":{"width":"72","height":"72"}},"styleVisible":{"image":true,"flex":{"flexShrink":true},"rect":true,"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{"rect":{"width":{"itemOption":{"iTypeList":[{"key":"percent","value":"%"},{"key":"number","value":"px"}]}}}},"properties":[{"itemId":"001","itemName":"图片地址","itemKey":"value","itemTypeRange":"image,var","itemDefaultValue":""}],"slots":[],"events":[{"eventName":"点击事件","eventKey":"click"}]},"Icon":{"className":"Icon","name":"图标","group":"基础组件","styleState":{"rect":{"width":"32","height":"32"}},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{"rect":{"width":{"itemOption":{"iTypeList":[{"key":"number","value":"px"},{"key":"percent","value":"%"}]}},"height":{"itemOption":{"iTypeList":[{"key":"number","value":"px"}]}}}},"properties":[{"itemId":"001","itemName":"图标","itemKey":"icon","itemTypeRange":"const,var","itemType":"IconSelect","itemOption":{"type":"svg","width":"16","height":"16","image":"/ubomp-h5-sub/inner_card/svg/svg-symbols.9f0f35b.svg","iIconList":[{"key":"sousuo","value":"sousuo","name":"sousuo"},{"key":"gengduo","value":"gengduo","name":"gengduo"},{"key":"saoyisao","value":"saoyisao","name":"saoyisao"},{"key":"shanchu","value":"shanchu","name":"shanchu"},{"key":"shaixuan","value":"shaixuan","name":"shaixuan"},{"key":"shezhi","value":"shezhi","name":"shezhi"},{"key":"shengyin","value":"shengyin","name":"shengyin"},{"key":"shengyinguanbi","value":"shengyinguanbi","name":"shengyinguanbi"},{"key":"aixin","value":"aixin","name":"aixin"},{"key":"aixin_1","value":"aixin_1","name":"aixin_1"},{"key":"shoucang","value":"shoucang","name":"shoucang"},{"key":"shoucang_1","value":"shoucang_1","name":"shoucang_1"},{"key":"dianzan","value":"dianzan","name":"dianzan"},{"key":"dianzan_1","value":"dianzan_1","name":"dianzan_1"},{"key":"yanjing","value":"yanjing","name":"yanjing"},{"key":"yanjing_1","value":"yanjing_1","name":"yanjing_1"},{"key":"yanjing_hide","value":"yanjing_hide","name":"yanjing_hide"},{"key":"zengjia","value":"zengjia","name":"zengjia"},{"key":"zengjia_1","value":"zengjia_1","name":"zengjia_1"},{"key":"xiangji","value":"xiangji","name":"xiangji"},{"key":"xiangji_1","value":"xiangji_1","name":"xiangji_1"},{"key":"chenggong","value":"chenggong","name":"chenggong"},{"key":"chenggong_1","value":"chenggong_1","name":"chenggong_1"},{"key":"shibai","value":"shibai","name":"shibai"},{"key":"shibai_1","value":"shibai_1","name":"shibai_1"},{"key":"shijian","value":"shijian","name":"shijian"},{"key":"shijian_1","value":"shijian_1","name":"shijian_1"},{"key":"dianhua","value":"dianhua","name":"dianhua"},{"key":"dianhua_1","value":"dianhua_1","name":"dianhua_1"},{"key":"angle_left","value":"angle_left","name":"angle_left"},{"key":"angle_right","value":"angle_right","name":"angle_right"},{"key":"angle_up","value":"angle_up","name":"angle_up"},{"key":"angle_down","value":"angle_down","name":"angle_down"},{"key":"arrow_left","value":"arrow_left","name":"arrow_left"},{"key":"arrow_right","value":"arrow_right","name":"arrow_right"},{"key":"long_arrow_up","value":"long_arrow_up","name":"long_arrow_up"},{"key":"long_arrow_down","value":"long_arrow_down","name":"long_arrow_down"},{"key":"caret_left","value":"caret_left","name":"caret_left"},{"key":"caret_right","value":"caret_right","name":"caret_right"},{"key":"sort_up","value":"sort_up","name":"sort_up"},{"key":"sort_down","value":"sort_down","name":"sort_down"},{"key":"ditu","value":"ditu","name":"ditu"},{"key":"fuzhi","value":"fuzhi","name":"fuzhi"},{"key":"check","value":"check","name":"check"},{"key":"times","value":"times","name":"times"},{"key":"weixuanzhong","value":"weixuanzhong","name":"weixuanzhong"},{"key":"switch","value":"switch","name":"switch"},{"key":"tanhao","value":"tanhao","name":"tanhao"},{"key":"tanhao_1","value":"tanhao_1","name":"tanhao_1"},{"key":"jianshao","value":"jianshao","name":"jianshao"},{"key":"jianshao_1","value":"jianshao_1","name":"jianshao_1"},{"key":"pinglun","value":"pinglun","name":"pinglun"},{"key":"pinglun_1","value":"pinglun_1","name":"pinglun_1"},{"key":"shandian","value":"shandian","name":"shandian"},{"key":"shandian_1","value":"shandian_1","name":"shandian_1"},{"key":"shequ","value":"shequ","name":"shequ"},{"key":"shequ_1","value":"shequ_1","name":"shequ_1"},{"key":"shouji","value":"shouji","name":"shouji"},{"key":"shouji_1","value":"shouji_1","name":"shouji_1"},{"key":"shouye","value":"shouye","name":"shouye"},{"key":"shouye_1","value":"shouye_1","name":"shouye_1"},{"key":"shuju","value":"shuju","name":"shuju"},{"key":"shuju_1","value":"shuju_1","name":"shuju_1"},{"key":"wode","value":"wode","name":"wode"},{"key":"wode_1","value":"wode_1","name":"wode_1"},{"key":"yingchengka","value":"yingchengka","name":"yingchengka"},{"key":"yingchengka_1","value":"yingchengka_1","name":"yingchengka_1"},{"key":"yinhangka","value":"yinhangka","name":"yinhangka"},{"key":"yinhangyouhui","value":"yinhangyouhui","name":"yinhangyouhui"},{"key":"youhuiquan","value":"youhuiquan","name":"youhuiquan"},{"key":"youhuiquan_1","value":"youhuiquan_1","name":"youhuiquan_1"},{"key":"tuipiao","value":"tuipiao","name":"tuipiao"},{"key":"yulebao","value":"yulebao","name":"yulebao"},{"key":"anquan","value":"anquan","name":"anquan"},{"key":"bangzhu","value":"bangzhu","name":"bangzhu"},{"key":"bianji","value":"bianji","name":"bianji"},{"key":"bofangjilu","value":"bofangjilu","name":"bofangjilu"},{"key":"buganxingqu","value":"buganxingqu","name":"buganxingqu"},{"key":"chuangzuo","value":"chuangzuo","name":"chuangzuo"},{"key":"diantong_guan","value":"diantong_guan","name":"diantong_guan"},{"key":"dianying","value":"dianying","name":"dianying"},{"key":"dianyingpiao","value":"dianyingpiao","name":"dianyingpiao"},{"key":"dingdan","value":"dingdan","name":"dingdan"},{"key":"dingwei","value":"dingwei","name":"dingwei"},{"key":"faxian","value":"faxian","name":"faxian"},{"key":"fenxiang","value":"fenxiang","name":"fenxiang"},{"key":"gonggao","value":"gonggao","name":"gonggao"},{"key":"huati","value":"huati","name":"huati"},{"key":"huiyuan","value":"huiyuan","name":"huiyuan"},{"key":"lihe","value":"lihe","name":"lihe"},{"key":"mima","value":"mima","name":"mima"},{"key":"nan","value":"nan","name":"nan"},{"key":"nv","value":"nv","name":"nv"},{"key":"paihangbang","value":"paihangbang","name":"paihangbang"},{"key":"pengyouquan","value":"pengyouquan","name":"pengyouquan"},{"key":"remen","value":"remen","name":"remen"},{"key":"rili","value":"rili","name":"rili"},{"key":"search_minus","value":"search_minus","name":"search_minus"},{"key":"search_plus","value":"search_plus","name":"search_plus"},{"key":"shangchuan","value":"shangchuan","name":"shangchuan"},{"key":"shuaxin","value":"shuaxin","name":"shuaxin"},{"key":"taolunqu","value":"taolunqu","name":"taolunqu"},{"key":"tishi","value":"tishi","name":"tishi"},{"key":"tupian","value":"tupian","name":"tupian"},{"key":"weixin","value":"weixin","name":"weixin"},{"key":"wenda","value":"wenda","name":"wenda"},{"key":"wenjuan","value":"wenjuan","name":"wenjuan"},{"key":"wifi","value":"wifi","name":"wifi"},{"key":"wodeguanzhu","value":"wodeguanzhu","name":"wodeguanzhu"},{"key":"xiangkan","value":"xiangkan","name":"xiangkan"},{"key":"xiaoxi","value":"xiaoxi","name":"xiaoxi"},{"key":"xiaoxizhongxin","value":"xiaoxizhongxin","name":"xiaoxizhongxin"},{"key":"xiazai","value":"xiazai","name":"xiazai"},{"key":"yixiangkan","value":"yixiangkan","name":"yixiangkan"},{"key":"zhibo","value":"zhibo","name":"zhibo"},{"key":"zhiwen","value":"zhiwen","name":"zhiwen"}]},"itemDefaultValue":"angle_right"},{"itemId":"002","itemName":"图标颜色","itemKey":"color","itemTypeRange":"const,var","itemType":"Color","itemDefaultValue":"#a5afbc"},{"itemId":"003","itemName":"自定义图标","itemKey":"content","itemTypeRange":"const,var","itemType":"Textarea","itemOption":{"placeholder":"请输入svg文件内容","autosize":{"minRows":1,"maxRows":4}},"itemDefaultValue":""}],"slots":[],"events":[{"eventName":"点击事件","eventKey":"click"}]},"MultiText":{"className":"MultiText","name":"多文本","group":"基础组件","styleState":{},"styleVisible":{"font":{"lineHeight":true,"textAlign":true},"rect":true,"flex":{"justifyContent":true,"alignItems":true,"flexShrink":true},"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"文本列表","itemKey":"textList","itemTypeRange":"const","itemType":"List","itemOption":{"type":"editor","iFieldList":[{"key":"value","value":"内容"},{"key":"color","value":"颜色"},{"key":"fontSize","value":"大小"}],"btnText":"添加文本"},"itemDefaultValue":[{"value":"这是一个文本"}],"itemList":[{"itemId":"001","itemName":"文本内容","itemKey":"value","itemTypeRange":"const,var","itemType":"Input","itemDefaultValue":"这是一个文本"},{"itemId":"002","itemName":"字体颜色","itemKey":"color","itemTypeRange":"const","itemType":"Color","itemDefaultValue":"#000000"},{"itemId":"003","itemName":"字体大小","itemKey":"fontSize","itemTypeRange":"const","itemType":"InputNumber","itemOption":{"mode-mini":{"style":{"width":"50px"}}},"itemDefaultValue":"14"},{"itemId":"004","itemName":"字体权重","itemKey":"fontWeight","itemTypeRange":"const","itemType":"TabSelect","itemOption":{"size":"mini","iParamList":[{"key":"400","value":"常规"},{"key":"500","value":"中等"},{"key":"600","value":"加粗"}]},"itemDefaultValue":"400"},{"itemId":"005","itemName":"字体样式","itemKey":"fontStyle","itemTypeRange":"const","itemType":"FontStyle","itemOption":{},"itemDefaultValue":"normal"},{"itemId":"006","itemName":"字体样式","itemKey":"textDecoration","itemTypeRange":"const","itemType":"TextDecorationStyle","itemOption":{},"itemDefaultValue":"none"},{"itemId":"007","itemName":"字体背景色","itemKey":"backgroundColor","itemTypeRange":"const","itemType":"Color","itemOption":{},"itemDefaultValue":""},{"itemId":"008","itemName":"事件标识码","itemKey":"tag","itemTypeRange":"const","itemType":"Input","itemOption":{"placeholder":"用于点击事件中区分不同文本"},"itemDefaultValue":""}]}],"slots":[],"events":[{"eventName":"点击事件","eventKey":"click"}]},"Canvas":{"className":"Canvas","name":"画布","group":"基础组件","styleState":{"rect":{"width":"100%"}},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[],"slots":[],"events":[{"eventName":"初始化渲染","eventKey":"onMeasured","includes":["customAction"]}]},"Input":{"className":"Input","name":"输入框","group":"基础组件","styleState":{"rect":{"width":"100%","height":"35"},"background":{"backgroundType":"01","backgroundColor":"#FFFFFF"}},"styleVisible":{"font":{"textAlign":true,"fontSize":true,"fontWeight":true,"color":true},"flex":{"flexShrink":true},"rect":true,"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"绑定变量","itemKey":"value","itemTypeRange":"var","itemDefaultValue":""},{"itemId":"002","itemName":"占位符","itemKey":"placeholder","itemTypeRange":"const,var","itemType":"Input","itemDefaultValue":"请输入"},{"itemId":"003","itemName":"类型","itemKey":"inputType","itemTypeRange":"const,var","itemType":"Select","itemOption":{"iParamList":[{"key":"text","value":"普通文本"},{"key":"number","value":"数字"},{"key":"email","value":"邮箱"},{"key":"password","value":"密码"},{"key":"phone","value":"手机号"}]},"itemDefaultValue":"text"},{"itemId":"004","itemName":"最大长度","itemKey":"maxLength","itemTypeRange":"const,var","itemType":"InputNumber","itemOption":{"type":"+integer"},"itemDefaultValue":""}],"slots":[],"events":[]},"CheckGroup":{"className":"CheckGroup","name":"复选框","group":"基础组件","styleState":{},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"绑定变量","itemKey":"value","itemTypeRange":"var","itemDefaultValue":""},{"itemId":"002","itemName":"选项列表","itemKey":"dataList","itemTypeRange":"const,var","itemType":"List","itemOption":{"type":"text","showHeader":false,"iFieldList":[{"value":"选项名称","key":"desc"}],"replace":{"101":"${index}","102":"选项${index}"}},"itemList":[{"itemId":"101","itemName":"选项键","itemKey":"key","itemTypeRange":"const","itemType":"Input","itemDefaultValue":"1"},{"itemId":"102","itemName":"选项值","itemKey":"desc","itemTypeRange":"const","itemType":"Input","itemDefaultValue":"选项"}],"itemDefaultValue":[{"key":"1","desc":"选项1"},{"key":"2","desc":"选项2"}]},{"itemId":"003","itemName":"选中颜色","itemKey":"selectColor","itemTypeRange":"const","itemType":"Color","itemDefaultValue":"#0082ff"},{"itemId":"004","itemName":"未选中颜色","itemKey":"unSelectColor","itemTypeRange":"const","itemType":"Color","itemDefaultValue":"#333333"},{"itemId":"005","itemName":"样式类型","itemKey":"buttonStyle","itemTypeRange":"const","itemType":"Select","itemOption":{"iParamList":[{"key":"Circle","value":"圆形"},{"key":"Square","value":"实心正方形"},{"key":"SquareEmpty","value":"空心正方形"},{"key":"Text","value":"纯文本"}]},"itemDefaultValue":"Circle"},{"itemId":"006","itemName":"选中数量限制","itemKey":"maxSelectCount","itemTypeRange":"const","itemType":"Select","itemOption":{"iParamList":[{"key":"0","value":"不限制"},{"key":"1","value":"1个"},{"key":"2","value":"2个"},{"key":"3","value":"3个"}]},"itemDefaultValue":"0"},{"itemId":"007","itemName":"排列方向","itemKey":"direction","itemTypeRange":"const","itemType":"Select","itemOption":{"iParamList":[{"key":"horizontal","value":"水平"},{"key":"vertical","value":"垂直"}]},"itemDefaultValue":"horizontal"},{"itemId":"008","itemName":"选项内边距","itemKey":"itemPadding","itemTypeRange":"const","itemType":"PaddingStyle","itemOption":{"normal":true,"seperator":" ","brackets":[]},"itemDefaultValue":"4 10 4 10"},{"itemId":"009","itemName":"选项间距","itemKey":"itemSpacing","itemTypeRange":"const","itemType":"InputNumber","itemDefaultValue":"4"},{"itemId":"010","itemName":"文字图标间距","itemKey":"textSpacing","itemTypeRange":"const","itemType":"InputNumber","itemDefaultValue":"3"},{"itemId":"011","itemName":"字体大小","itemKey":"fontSize","itemTypeRange":"const","itemType":"InputNumber","itemDefaultValue":"13"},{"itemId":"012","itemName":"icon大小","itemKey":"iconSize","itemTypeRange":"const","itemType":"InputNumber","itemDefaultValue":"14"}],"slots":[],"events":[{"eventKey":"selectChange","eventName":"选项发生改变"}]},"RadioButton":{"className":"RadioButton","name":"单选框","group":"基础组件","styleState":{},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"绑定变量","itemKey":"value","itemTypeRange":"var","itemDefaultValue":""},{"itemId":"002","itemName":"选中颜色","itemKey":"selectColor","itemTypeRange":"const","itemType":"Color","itemDefaultValue":"#0082ff"},{"itemId":"003","itemName":"未选中颜色","itemKey":"unSelectColor","itemTypeRange":"const","itemType":"Color","itemDefaultValue":"#333333"},{"itemId":"004","itemName":"样式类型","itemKey":"buttonStyle","itemTypeRange":"const","itemType":"Select","itemOption":{"iParamList":[{"key":"Circle","value":"圆形"},{"key":"CircleEmpty","value":"空心圆形"}]},"itemDefaultValue":"Circle"},{"itemId":"005","itemName":"文字图标间距","itemKey":"textSpacing","itemTypeRange":"const","itemType":"InputNumber","itemDefaultValue":"3"},{"itemId":"006","itemName":"字体大小","itemKey":"fontSize","itemTypeRange":"const","itemType":"InputNumber","itemDefaultValue":"14"},{"itemId":"007","itemName":"icon大小","itemKey":"iconSize","itemTypeRange":"const","itemType":"InputNumber","itemDefaultValue":"14"},{"itemId":"008","itemName":"显示文字","itemKey":"showText","itemTypeRange":"const","itemType":"Switcher","itemDefaultValue":"1","itemCondition":"showText"},{"itemId":"009","itemName":"文字内容","itemKey":"text","itemTypeRange":"const,var","itemType":"Input","itemDefaultValue":"选项","itemCondition":"showText.1"}],"slots":[],"events":[{"eventKey":"selectChange","eventName":"选项发生改变"}]},"ProgressSlider":{"className":"ProgressSlider","name":"滑块","group":"基础组件","styleState":{"rect":{"width":"100%"},"other":{"overflow":"visible"}},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"other":true,"margin":true,"transform":true},"styleMeta":{"other":{"overflow":{"itemOption":{"iParamList":[{"key":"visible","value":"可见"}]}}}},"properties":[{"itemId":"001","itemName":"绑定变量","itemKey":"value","itemTypeRange":"var","itemDefaultValue":""},{"itemId":"002","itemName":"最小值","itemTypeRange":"const,var","itemKey":"minProgress","itemType":"InputNumber","itemDefaultValue":"0"},{"itemId":"003","itemName":"最大值","itemTypeRange":"const,var","itemKey":"maxProgress","itemType":"InputNumber","itemDefaultValue":"100"},{"itemId":"004","itemName":"步长","itemTypeRange":"const,var","itemKey":"step","itemType":"InputNumber","itemDefaultValue":"1"},{"itemId":"005","itemName":"背景色","itemTypeRange":"const,var","itemKey":"backgroundColor","itemType":"Color","itemDefaultValue":"#e6e6e6"},{"itemId":"006","itemName":"前景色","itemTypeRange":"const,var","itemKey":"foregroundColor","itemType":"Color","itemDefaultValue":"#0a59f5"},{"itemId":"007","itemName":"高度","itemTypeRange":"const,var","itemKey":"processHeight","itemType":"InputNumber","itemDefaultValue":"5"},{"itemId":"008","itemName":"滑块样式","itemTypeRange":"const,var","itemKey":"blockStyle","itemType":"Select","itemOption":{"iParamList":[{"key":"circle","value":"纯色圆"},{"key":"image","value":"图片"}]},"itemDefaultValue":"circle","itemCondition":"blockStyle"},{"itemId":"009","itemName":"滑块颜色","itemTypeRange":"const,var","itemKey":"blockColor","itemType":"Color","itemDefaultValue":"#ffffff","itemCondition":"blockStyle.circle"},{"itemId":"010","itemName":"滑块背景图","itemTypeRange":"image,var","itemKey":"blockImage","itemDefaultValue":"","itemCondition":"blockStyle.image"},{"itemId":"011","itemName":"滑块宽","itemTypeRange":"const,var","itemKey":"blockWidth","itemType":"InputNumber","itemDefaultValue":"15"},{"itemId":"012","itemName":"滑块高","itemTypeRange":"const,var","itemKey":"blockHeight","itemType":"InputNumber","itemDefaultValue":"15"}],"slots":[],"events":[{"eventName":"值改变事件","eventKey":"change"}]},"Video":{"className":"Video","name":"视频","group":"基础组件","styleState":{},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"background":true,"padding":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"视频地址","itemKey":"url","itemTypeRange":"image,var","itemDefaultValue":""},{"itemId":"002","itemName":"视频封面","itemKey":"previewUrl","itemTypeRange":"image,var","itemDefaultValue":""}],"slots":[],"events":[]},"Map":{"className":"Map","name":"地图","group":"基础组件","styleState":{"rect":{"width":"100%","height":"100"}},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"borderRadius":true,"border":true,"shadow":true,"margin":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"中心经度Lat","itemKey":"centerLat","itemType":"InputNumber","itemDefaultValue":""},{"itemId":"002","itemName":"中心纬度Lng","itemKey":"centerLng","itemType":"InputNumber","itemDefaultValue":""},{"itemId":"003","itemName":"缩放比","itemKey":"zoom","itemType":"InputNumber","itemOption":{"type":"+integer"},"itemDefaultValue":""},{"itemId":"004","itemName":"标记点经度Lat","itemKey":"markerLat","itemType":"InputNumber","itemDefaultValue":""},{"itemId":"005","itemName":"标记点纬度Lng","itemKey":"markerLng","itemType":"InputNumber","itemDefaultValue":""},{"itemId":"006","itemName":"标记点名称","itemKey":"markerName","itemTypeRange":"const,var","itemType":"Input","itemOption":{"placeholder":"请输入标记点名称"},"itemDefaultValue":""}],"slots":[],"events":[]},"Divider":{"className":"Divider","name":"分割线","group":"基础组件","styleState":{"rect":{"width":"100%","height":"1"},"background":{"backgroundType":"01","backgroundColor":"#f1f1f1"}},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"background":true,"margin":true},"styleMeta":{},"properties":[],"slots":[],"events":[]},"ViewContainer":{"className":"ViewContainer","name":"自定义","group":"基础组件","styleState":{"rect":{"width":"100%","height":"auto"}},"styleVisible":{"rect":true,"flex":{"flexShrink":true},"background":true,"borderRadius":true,"border":true,"shadow":true,"other":true,"margin":true,"padding":true,"transform":true},"styleMeta":{},"properties":[{"itemId":"001","itemName":"自定义类","itemKey":"customClass","itemTypeRange":"const","itemType":"Input","itemDefaultValue":""},{"itemId":"002","itemName":"自定义属性","itemKey":"customProps","itemTypeRange":"var","itemDefaultValue":{}},{"itemId":"003","itemName":"占位图","itemKey":"customRemarkImg","itemTypeRange":"image","itemDefaultValue":{}}],"slots":[],"events":[{"eventName":"动作事件","eventKey":"action"}]}}')},mu={properties:[{itemId:`1100`,itemName:`字体`,itemKey:`font`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`字体颜色`,itemKey:`color`,itemTypeRange:`const,var`,itemType:`Color`,itemDefaultValue:``},{itemId:`002`,itemName:`字体大小`,itemKey:`fontSize`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{type:`+integer`,iParamList:[{key:`12`,value:`12px`},{key:`14`,value:`14px`},{key:`16`,value:`16px`},{key:`18`,value:`18px`},{key:`20`,value:`20px`},{key:`22`,value:`22px`},{key:`24`,value:`24px`}]},itemDefaultValue:`14`},{itemId:`007`,itemName:`行高`,itemKey:`lineHeight`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``},{itemId:`003`,itemName:`对齐`,itemKey:`textAlign`,itemTypeRange:`const,var`,itemType:`TabSelect`,itemOption:{iParamList:[{key:`left`,value:`左`},{key:`center`,value:`中`},{key:`right`,value:`右`}]},itemDefaultValue:`left`},{itemId:`004`,itemName:`字体权重`,itemKey:`fontWeight`,itemTypeRange:`const,var`,itemType:`TabSelect`,itemOption:{iParamList:[{key:`400`,value:`常规`},{key:`500`,value:`中等`},{key:`600`,value:`加粗`}]},itemDefaultValue:`400`},{itemId:`008`,itemName:`字体样式`,itemKey:`fontStyle`,itemTypeRange:`const`,itemType:`FontStyle`,itemOption:{},itemDefaultValue:`normal`},{itemId:`009`,itemName:`字体修饰`,itemKey:`textDecoration`,itemTypeRange:`const`,itemType:`TextDecorationStyle`,itemOption:{},itemDefaultValue:`none`},{itemId:`005`,itemName:`最大行数`,itemKey:`isMaxLine`,itemTypeRange:`const`,itemType:`Switcher`,itemOption:{},itemDefaultValue:`0`,itemCondition:`isMaxLine`},{itemId:`006`,itemName:`最大行数`,itemKey:`maxLine`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:`1`,itemCondition:`isMaxLine.1`}]},{itemId:`1200`,itemName:`图片`,itemKey:`image`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`裁剪模式`,itemKey:`cropMode`,itemTypeRange:`const`,itemType:`TabSelect`,itemOption:{iParamList:[{key:`00`,value:`铺满缩放`},{key:`01`,value:`填充缩放`}]},itemDefaultValue:`00`}]},{itemId:`1300`,itemName:`定位`,itemKey:`position`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`左偏移`,itemKey:`left`,itemTypeRange:`const`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``},{itemId:`002`,itemName:`上偏移`,itemKey:`top`,itemTypeRange:`const`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``},{itemId:`003`,itemName:`右偏移`,itemKey:`right`,itemTypeRange:`const`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``},{itemId:`004`,itemName:`下偏移`,itemKey:`bottom`,itemTypeRange:`const`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``}]},{itemId:`100`,itemName:`布局`,itemKey:`flex`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`006`,itemName:`排列方向`,itemKey:`flexDirection`,itemTypeRange:`const`,itemType:`TabSelect`,itemOption:{iParamList:[{key:`row`,value:`横向`},{key:`column`,value:`竖向`}]},itemDefaultValue:`row`},{itemId:`001`,itemName:`水平对齐`,itemKey:`justifyContent`,itemTypeRange:`const`,itemType:`JustifyContentStyle`,itemOption:{rowName:`水平对齐`,columnName:`垂直对齐`},itemDefaultValue:`flex-start`,itemWatch:{flexDirection:`flexDirection`}},{itemId:`002`,itemName:`垂直对齐`,itemKey:`alignItems`,itemTypeRange:`const`,itemType:`AlignItemsStyle`,itemOption:{rowName:`垂直对齐`,columnName:`水平对齐`},itemDefaultValue:`stretch`,itemWatch:{flexDirection:`flexDirection`}},{itemId:`003`,itemName:`元素间距`,itemKey:`gap`,itemTypeRange:`const`,itemType:`Select`,itemOption:{iParamList:[{key:`0`,value:`0px`},{key:`4`,value:`4px`},{key:`8`,value:`8px`},{key:`12`,value:`12px`},{key:`16`,value:`16px`},{key:`20`,value:`20px`},{key:`24`,value:`24px`},{key:`28`,value:`28px`}]},itemDefaultValue:``},{itemId:`005`,itemName:`空间不足时压缩节点`,itemKey:`flexShrink`,itemTypeRange:`const`,itemType:`Switcher`,itemOption:{},itemDefaultValue:`1`}]},{itemId:`200`,itemName:`矩形`,itemKey:`rect`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`003`,itemName:`宽度`,itemKey:`width`,itemTypeRange:`const,var`,itemType:`NumberStyle`,itemOption:{},itemDefaultValue:``},{itemId:`004`,itemName:`高度`,itemKey:`height`,itemTypeRange:`const,var`,itemType:`NumberStyle`,itemOption:{iTypeList:[{key:`number`,value:`px`},{key:`auto`,value:`@`}]},itemDefaultValue:`auto`}]},{itemId:`300`,itemName:`背景`,itemKey:`background`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`背景`,itemKey:`backgroundType`,itemTypeRange:`const`,itemType:`TabSelect`,itemOption:{iParamList:[{key:`00`,value:`透明`},{key:`01`,value:`颜色`},{key:`02`,value:`图片`},{key:`03`,value:`渐变色`}]},itemDefaultValue:`00`,itemCondition:`backgroundType`},{itemId:`002`,itemName:`背景颜色`,itemKey:`backgroundColor`,itemTypeRange:`const,var`,itemType:`Color`,itemDefaultValue:``,itemCondition:`backgroundType.01`},{itemId:`003`,itemName:`背景图片`,itemKey:`backgroundImage`,itemTypeRange:`image,var`,itemOption:{},itemDefaultValue:``,itemCondition:`backgroundType.02`},{itemId:`004`,itemName:`背景图位置`,itemKey:`backgroundPosition`,itemTypeRange:`const,var`,itemType:`BackgroundPositionStyle`,itemOption:{},itemDefaultValue:`50% 50%`,itemCondition:`backgroundType.02`},{itemId:`005`,itemName:`背景图大小`,itemKey:`backgroundSize`,itemTypeRange:`const,var`,itemType:`BackgroundSizeStyle`,itemOption:{},itemDefaultValue:`cover`,itemCondition:`backgroundType.02`},{itemId:`006`,itemName:`背景图重复`,itemKey:`backgroundRepeat`,itemTypeRange:`const,var`,itemType:`Select`,itemOption:{iParamList:[{key:`no-repeat`,value:`不重复`},{key:`repeat`,value:`重复图片`},{key:`repeat-x`,value:`水平重复`},{key:`repeat-y`,value:`垂直重复`}]},itemDefaultValue:`no-repeat`,itemCondition:`backgroundType.02`},{itemId:`007`,itemName:`背景渐变`,itemKey:`backgroundGradient`,itemTypeRange:`const,var`,itemType:`GradientStyle`,itemOption:{},itemDefaultValue:``,itemCondition:`backgroundType.03`}]},{itemId:`400`,itemName:`内边距`,itemKey:`padding`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`内边距`,itemKey:`paddingType`,itemTypeRange:`const`,itemType:`TabSelect`,itemOption:{iParamList:[{key:``,value:`无`},{key:`0`,value:`全边`},{key:`1`,value:`自定义`}]},itemDefaultValue:``,itemCondition:`paddingType`},{itemId:`002`,itemName:`内边距`,itemKey:`padding`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{iParamList:[{key:`0`,value:`0px`},{key:`2`,value:`2px`},{key:`4`,value:`4px`},{key:`8`,value:`8px`},{key:`12`,value:`12px`},{key:`16`,value:`16px`},{key:`20`,value:`20px`},{key:`24`,value:`24px`},{key:`28`,value:`28px`}]},itemDefaultValue:``,itemCondition:`paddingType.0`},{itemId:`003`,itemName:`内左边距`,itemKey:`paddingLeft`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`paddingType.1`},{itemId:`004`,itemName:`内上边距`,itemKey:`paddingTop`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`paddingType.1`},{itemId:`005`,itemName:`内右边距`,itemKey:`paddingRight`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`paddingType.1`},{itemId:`006`,itemName:`内下边距`,itemKey:`paddingBottom`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`paddingType.1`}]},{itemId:`500`,itemName:`外边距`,itemKey:`margin`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`外边距`,itemKey:`marginType`,itemTypeRange:`const`,itemType:`TabSelect`,itemOption:{iParamList:[{key:``,value:`无`},{key:`0`,value:`全边`},{key:`1`,value:`自定义`}]},itemDefaultValue:``,itemCondition:`marginType`},{itemId:`002`,itemName:`外边距`,itemKey:`margin`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{iParamList:[{key:`0`,value:`0px`},{key:`2`,value:`2px`},{key:`4`,value:`4px`},{key:`8`,value:`8px`},{key:`12`,value:`12px`},{key:`16`,value:`16px`},{key:`20`,value:`20px`},{key:`24`,value:`24px`},{key:`28`,value:`28px`}]},itemDefaultValue:``,itemCondition:`marginType.0`},{itemId:`003`,itemName:`外左边距`,itemKey:`marginLeft`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`marginType.1`},{itemId:`004`,itemName:`外上边距`,itemKey:`marginTop`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`marginType.1`},{itemId:`005`,itemName:`外右边距`,itemKey:`marginRight`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`marginType.1`},{itemId:`006`,itemName:`外下边距`,itemKey:`marginBottom`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`marginType.1`}]},{itemId:`600`,itemName:`圆角`,itemKey:`borderRadius`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`圆角`,itemKey:`borderRadiusType`,itemTypeRange:`const`,itemType:`TabSelect`,itemOption:{iParamList:[{key:``,value:`无`},{key:`0`,value:`全角`},{key:`1`,value:`自定义`}]},itemDefaultValue:``,itemCondition:`borderRadiusType`},{itemId:`002`,itemName:`圆角`,itemKey:`borderRadius`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{type:`+integer`,iParamList:[{key:`0`,value:`0px`},{key:`4`,value:`4px`},{key:`6`,value:`6px`},{key:`8`,value:`8px`},{key:`10`,value:`10px`},{key:`12`,value:`12px`},{key:`16`,value:`16px`}]},itemDefaultValue:``,itemCondition:`borderRadiusType.0`},{itemId:`003`,itemName:`圆角上左`,itemKey:`borderTopLeftRadius`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`borderRadiusType.1`},{itemId:`004`,itemName:`圆角上右`,itemKey:`borderTopRightRadius`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`borderRadiusType.1`},{itemId:`005`,itemName:`圆角下右`,itemKey:`borderBottomRightRadius`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`borderRadiusType.1`},{itemId:`006`,itemName:`圆角下左`,itemKey:`borderBottomLeftRadius`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:``,itemCondition:`borderRadiusType.1`}]},{itemId:`700`,itemName:`边框`,itemKey:`border`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`边框`,itemKey:`isBorder`,itemTypeRange:`const`,itemType:`Switcher`,itemOption:{},itemDefaultValue:`0`,itemCondition:`isBorder`},{itemId:`002`,itemName:`边框宽度`,itemKey:`borderWidth`,itemTypeRange:`const,var`,itemType:`InputNumber`,itemOption:{},itemDefaultValue:`1`,itemCondition:`isBorder.1`},{itemId:`003`,itemName:`边框样式`,itemKey:`borderStyle`,itemTypeRange:`const,var`,itemType:`Select`,itemOption:{iParamList:[{key:`solid`,value:`solid`},{key:`dashed`,value:`dashed`},{key:`dotted`,value:`dotted`}]},itemDefaultValue:`solid`,itemCondition:`isBorder.1`},{itemId:`004`,itemName:`边框颜色`,itemKey:`borderColor`,itemTypeRange:`const,var`,itemType:`Color`,itemOption:{},itemDefaultValue:`#e7e7ee`,itemCondition:`isBorder.1`}]},{itemId:`800`,itemName:`阴影`,itemKey:`shadow`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`阴影`,itemKey:`isShadow`,itemTypeRange:`const`,itemType:`Switcher`,itemDefaultValue:`0`,itemCondition:`isShadow`},{itemId:`002`,itemName:`阴影颜色`,itemKey:`shadowColor`,itemTypeRange:`const`,itemType:`Color`,itemDefaultValue:`#e7e7ee`,itemCondition:`isShadow.1`},{itemId:`003`,itemName:`x偏移`,itemKey:`shadowX`,itemTypeRange:`const`,itemType:`InputNumber`,itemDefaultValue:`0`,itemCondition:`isShadow.1`},{itemId:`004`,itemName:`y偏移`,itemKey:`shadowY`,itemTypeRange:`const`,itemType:`InputNumber`,itemDefaultValue:`0`,itemCondition:`isShadow.1`},{itemId:`005`,itemName:`阴影模糊`,itemKey:`shadowBlur`,itemTypeRange:`const`,itemType:`InputNumber`,itemDefaultValue:``,itemCondition:`isShadow.1`},{itemId:`006`,itemName:`阴影拓展`,itemKey:`shadowSpread`,itemType:`InputNumber`,itemTypeRange:`const`,itemDefaultValue:``,itemCondition:`isShadow.1`}]},{itemId:`900`,itemName:`转换`,itemKey:`transform`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`旋转`,itemKey:`rotate`,itemTypeRange:`const`,itemType:`InputNumber`,itemOption:{symbol:`deg`,type:`integer`},itemDefaultValue:``}]},{itemId:`1000`,itemName:`高级`,itemKey:`other`,itemTypeRange:`const`,itemType:`group`,itemOption:{mode:`free`},itemChildren:[{itemId:`002`,itemName:`溢出`,itemKey:`overflow`,itemTypeRange:`const`,itemType:`Select`,itemOption:{iParamList:[{key:`hidden`,value:`隐藏`},{key:`visible`,value:`可见`}]},itemDefaultValue:`hidden`},{itemId:`001`,itemName:`不透明度`,itemKey:`opacity`,itemTypeRange:`const`,itemType:`InputNumber`,itemOption:{symbol:`%`,type:`+integer`},itemDefaultValue:``}]}]},hu={_source:`c9.6a9947d5.js module (directives meta)`,properties:[{itemId:`001`,itemName:`显示条件`,itemDesc:``,itemTypeRange:`const`,itemType:`Group`,itemKey:`v-show`,itemOption:{mode:`free`},itemChildren:[{itemId:`001`,itemName:`显隐设置`,itemType:`Select`,itemKey:`showType`,itemOption:{iParamList:[{key:`00`,value:`始终显示`},{key:`01`,value:`满足条件显示`},{key:`02`,value:`满足条件隐藏`}]},itemDefaultValue:`00`,itemCondition:`showType`},{itemId:`002`,itemName:`具体条件`,itemType:`IfForm`,itemKey:`condition`,itemOption:{},itemDefaultValue:{},itemCondition:`showType.01|02`}]}]},gu=e=>e===void 0?e:JSON.parse(JSON.stringify(e)),_u=0,vu=e=>`${e}_${(++_u).toString(36)}`,yu=pu.components||{},bu=mu.properties||[],xu={};(function e(t,n=[],r=[]){t.forEach(t=>{let i=n.concat(t.itemId),a=r.concat(t.itemKey);xu[i.join(`|`)]=t,xu[a.join(`.`)]=t,t.itemChildren&&e(t.itemChildren,i,a)})})(bu);var Su=hu.properties||[],Cu=class{constructor(e={}){this.id=vu(`style`),this.state=Object.assign({},e.state||{}),this.visible=e.visible||{},this.meta=e.meta||{},this.properties=[],this.parseStateProperties(this.state,this.properties)}parseStateProperties(e,t=[]){let n=gu(e)||{};for(let e in n){let r=xu[e];if(!r)continue;let i=new J(r);t.push(i);let a=Object.keys(n[e]||{}),o=i.itemChildren?.properties||[],s=this.visible&&this.visible.flex;e===`flex`&&s&&typeof s==`object`&&s.flexShrink&&a.push(`flexShrink`);for(let e=0;e<o.length;e++)a.includes(o[e].itemKey)||o.splice(e--,1);fu.setPropertyValue(o,n[e]),i.itemValueFrom=`0`,i.itemUpdated=!0}}onRestore(e={}){this.properties.length=0,this.parseStateProperties(this.state,this.properties);let t=this.properties.reduce((e,t)=>(e[t.itemId]=t,e),{}),n={append(e,t,n=[]){let r=[].concat(n);r.push(e.itemId);let i=xu[r.join(`|`)],a=new J(i||{});t.push(a),a.onRestore(gu(e),uu.Delete)}};(e.properties||[]).forEach(e=>{let r=xu[e.itemId];if(!r){let n=new J(e);this.properties.push(n),t[e.itemId]=n,n.onRestore(e,uu.Delete);return}let i=t[e.itemId];if(i)i.onRestore(e,uu.Append,n);else{let n=new J(r);this.properties.push(n),t[e.itemId]=n,n.onRestore(e,uu.Delete)}}),J.updatePropertyVisible(this.properties)}onPreview(){let e=this.properties.reduce((e,t)=>{let n=t.onPreview();return n&&J.mergePreview(e,n),e},{});return{id:this.id,properties:e}}onExport(){return{properties:this.properties.reduce((e,t)=>{let n=t.onExport();return n&&e.push(n),e},[])}}applyChange(e,t){let n=e.onExport(t);if(!n)return;let r=e.itemId,i=this.properties.filter(e=>e.itemId===r)[0];if(!i){i=new J(xu[r]||{}),this.properties.push(i),i.onRestore(gu(n),uu.Delete);return}let a=[r];for(let e=t;e;e=e.child)a.push(e.itemId);i.onRestore(gu(n),uu.Append,{append(e,t){let n=xu[a.join(`|`)],r=new J(n||{});t.push(r),r.onRestore(gu(e),uu.Delete)}})}},wu=class{constructor(e={}){this.id=vu(`slot`),this.slotKey=e.slotKey,this.slotName=e.slotName,this.slotDesc=e.slotDesc||``,this.slotScope=e.slotScope===!0||e.slotScope===`true`,this.slotWidth=e.slotWidth||``,this.slotHeight=e.slotHeight||``,this.slotSwitch=e.slotSwitch===void 0?`1`:e.slotSwitch,this.components=[]}onRestore(e={}){e.slotSwitch!==void 0&&(this.slotSwitch=e.slotSwitch),this.components=(e.components||[]).map(e=>Ou(e))}onPreview(){return{id:this.id,slotKey:this.slotKey,slotScope:this.slotScope,slotDesc:this.slotDesc,slotSwitch:this.slotSwitch,slotWidth:this.slotWidth,slotHeight:this.slotHeight,components:this.components.reduce((e,t)=>{let n=t.onPreview();return n&&e.push(n),e},[])}}onExport(){return{slotKey:this.slotKey,slotScope:this.slotScope,slotSwitch:this.slotSwitch,components:(this.components||[]).map(e=>e&&typeof e.onExport==`function`?e.onExport():e)}}};function Tu(e=[],t=[],n={}){let r={},i=t.length>0;return(e||[]).forEach(e=>{if(!e||!e.itemKey)return;let i=t.concat(e.itemKey);e.itemValueFrom===`1`?(r[e.itemKey]=e.itemDefaultValue,e.itemValue&&(n[i.join(`.`)]=e.itemValue)):e.itemValueFrom===`2`?r[e.itemKey]=e.itemValue:e.itemChildren&&e.itemChildren.properties?r[e.itemKey]=Tu(e.itemChildren.properties,i,n):e.itemList?r[e.itemKey]=e.itemList.map((e,t)=>Tu(e&&e.properties||[],i.concat(String(t)),n)):r[e.itemKey]=e.itemValue}),i||(r.__vars__=n),r}function Eu(e={},t=[]){let n=e.event||{},r=(t||[]).filter(e=>e.eventKey===n.eventKey)[0]||{},i=e.action||{};return{event:{eventName:r.eventName,eventKey:r.eventKey},action:{actionType:i.actionType,properties:Tu(i.properties||[])},schemaIndex:-1}}var Du=class{constructor(e={}){let t=e.className,n=yu[t]||{};this.id=e.id||vu(`comp`),this.componentId=e.componentId||vu(String(t).toLowerCase()),this.name=e.name||n.name||t,this.className=t,this.version=e.version||n.version,this.visible=!0,this.metaMissing=!yu[t],this.style=new Cu({state:n.styleState,visible:n.styleVisible}),this.directives=Su.map(e=>new J(e)),this.properties=(n.properties||[]).map(e=>new J(e)),this.events=n.events||[],this.eventactions=[],this.slots=(n.slots||[]).map(e=>new wu(e)),this._schemaNode=e,this.onRestore(e)}onRestore(e={}){this.style.onRestore(e.style||{}),J.restoreProperty(e.directives||[],this.directives),J.updatePropertyVisible(this.directives),J.restoreProperty(e.properties||[],this.properties),J.updatePropertyVisible(this.properties),this.eventactions=(e.eventactions||[]).map((e,t)=>{let n=Eu(e,this.events);return n.schemaIndex=t,n});let t=(e.slots||[]).reduce((e,t)=>(e[t.slotKey]=t,e),{});this.slots.forEach(e=>{t[e.slotKey]&&e.onRestore(t[e.slotKey])}),this.metaMissing&&!this.slots.length&&(e.slots||[]).length&&(e.slots||[]).forEach(e=>{let t=new wu({slotKey:e.slotKey,slotScope:e.slotScope});t.onRestore(e),this.slots.push(t)})}onPreview(){let e=this.directives.reduce((e,t)=>{let n=t.onPreview();return n&&J.mergePreview(e,n),e},{}),t=this.properties.reduce((e,t)=>{let n=t.onPreview();return n&&J.mergePreview(e,n),e},{}),n={id:this.id,componentId:this.componentId,name:this.name,className:this.className,version:this.version,directives:e,style:this.style.onPreview(),properties:t,eventactions:this.eventactions,slots:this.slots.map(e=>e.onPreview()),visible:this.visible,metaMissing:this.metaMissing||void 0,_schemaNode:this._schemaNode};return Ru(n,{className:this.className,properties:this.properties,style:this.style.properties,directives:this.directives,events:this.events}),n}};function Ou(e){return new Du(e)}var ku=class{constructor(e={}){this.id=vu(`view`),this.width=e.width||`375`,this.className=e.className||`Root`,this.style=new Cu({state:{}}),this.properties=[],this.eventactions=[],this.components=[],this._schemaNode=e,this.onRestore(e)}onRestore(e={}){this.style.onRestore(e.style||{}),J.restoreProperty(e.properties||[],this.properties),J.updatePropertyVisible(this.properties),this.eventactions=(e.eventactions||[]).map((e,t)=>{let n=Eu(e,[]);return n.schemaIndex=t,n}),this.components=(e.components||[]).map(e=>Ou(e))}onPreview(){let e=this.properties.reduce((e,t)=>{let n=t.onPreview();return n&&J.mergePreview(e,n),e},{}),t={id:this.id,componentId:this.id,width:this.width,className:this.className,style:this.style.onPreview(),properties:e,eventactions:this.eventactions,components:this.components.map(e=>e.onPreview()),_schemaNode:this._schemaNode};return Ru(t,{className:this.className,properties:this.properties,style:this.style.properties,directives:[],events:[]}),t}};function Au(e){if(!e)return;let t=e=>(e||[]).reduce((e,t)=>(e[t.key]=t.defaultValue,e),{});return{dictionaryList:t(e.dictionaryList),inputParams:t(e.inputParams),mocks:e.mocks||{}}}function ju(e){return vu(String(e||`comp`).toLowerCase())}function Mu(e){let t=yu[e];return!!(t&&t.slots&&t.slots.length)}function Nu(e){let t=yu[e];return t&&t.slots&&t.slots.length?t.slots[0].slotKey:`default`}function Pu(e){if(!yu[e])throw Error(`未知组件类型:`+e);let t=new Du({className:e,componentId:ju(e)}),n=e=>(e||[]).map(e=>e.onExport()).filter(e=>e!==void 0);return{componentId:t.componentId,className:t.className,directives:n(t.directives),style:t.style.onExport(),properties:n(t.properties),eventactions:[],slots:t.slots.map(e=>e.onExport())}}function Fu(e={}){let t=new ku(e.view||e),n=Au(e.dictionary);return{id:e.id,version:e.version,pageId:e.pageId,name:e.name,desc:e.desc,platform:e.platform,...n?{dictionary:n}:{},view:t.onPreview()}}function Iu(e={}){let t={};return e.iParamList&&(t.iParamList=e.iParamList),e.iTypeList&&(t.iTypeList=e.iTypeList),e.codeKey&&(t.codeKey=e.codeKey),e.language&&(t.language=e.language),e.max!==void 0&&(t.max=e.max),e.min!==void 0&&(t.min=e.min),e.step!==void 0&&(t.step=e.step),t}function Lu(e){if(!e||!e.itemKey)return null;let t={itemId:e.itemId,itemKey:e.itemKey,itemName:e.itemName,itemType:e.itemType,itemValue:e.itemValue,itemValueFrom:e.itemValueFrom,itemTypeRange:e.itemTypeRange,itemVisible:e.itemVisible,itemRequired:!!e.itemRequired,itemDesc:e.itemDesc,options:Iu(e.itemOption)};return e.itemChildren&&e.itemChildren.properties&&e.itemChildren.properties.length&&(t.children=e.itemChildren.properties.map(Lu).filter(Boolean)),e.itemList&&e.itemList.length&&(t.itemList=e.itemList.map(e=>(e.properties||[]).map(Lu).filter(Boolean))),t}function Ru(e,t){Object.defineProperty(e,"_model",{value:t,enumerable:!1,configurable:!0,writable:!1})}function zu(e){let t=[];if(e.components&&t.push(...e.components),e.slots)for(let n of e.slots)n.components&&t.push(...n.components);return t}function Bu(e){if(!e)return null;let t=e._model||{},n={id:e.id,componentId:e.componentId,className:e.className,name:e.name,properties:(t.properties||[]).map(Lu).filter(Boolean),style:(t.style||[]).map(Lu).filter(Boolean),directives:(t.directives||[]).map(Lu).filter(Boolean),eventactions:e.eventactions||[]},r=zu(e);return r.length&&(n.components=r.map(Bu).filter(Boolean)),n}function Vu(e={}){let t=Bu(Fu(e).view);return t&&(t.id=e.id,t.version=e.version),t}var Hu=rn({node:null,sourceCardId:null});function Uu(){return Hu.node}function Wu(){return Hu.sourceCardId}function Gu(e,t=null){if(!e){Hu.node=null,Hu.sourceCardId=null;return}Hu.node=JSON.parse(JSON.stringify(e,(e,t)=>e===`_schemaNode`?void 0:t)),Hu.sourceCardId=t||null}function Ku(e,t=new Set){if(!e||typeof e!=`object`)return[...t];if(typeof e.className==`string`&&e.className&&t.add(e.className),Array.isArray(e.slots)){for(let n of e.slots)if(n&&Array.isArray(n.components))for(let e of n.components)Ku(e,t)}return[...t]}function qu(e){if(!(!e||typeof e!=`object`)&&(e.componentId!=null&&e.className!=null&&(e.componentId=ju(e.className)),Array.isArray(e.slots))){for(let t of e.slots)if(t&&Array.isArray(t.components))for(let e of t.components)qu(e)}}var Ju=class{constructor(e,t){this.vm=e,this.styleProps=t||{}}get adapter(){return this.vm&&this.vm.adapter?this.vm.adapter:this.vm}parse(){let e=this.styleProps,t={};return this.parseRect(e.rect||{},t),this.parseFlex(e.flex||{},t),this.parseBackground(e.background||{},t),this.parsePadding(e.padding||{},t),this.parseMargin(e.margin||{},t),this.parseBorderRadius(e.borderRadius||{},t),this.parseBorder(e.border||{},t),this.parseShadow(e.shadow||{},t),this.parseTransform(e.transform||{},t),this.parseOther(e.other||{},t),t.boxSizing=`border-box`,t}parseFont(e={},t={}){return e.color&&(t.color=this.adapter.doColor(e.color)),e.fontSize&&(t.fontSize=this.adapter.doSize(e.fontSize,`font`)),e.lineHeight&&(t.lineHeight=this.adapter.doSize(e.lineHeight)),e.textAlign&&(t.textAlign=e.textAlign),e.fontWeight&&(t.fontWeight=e.fontWeight),e.fontStyle&&(t.fontStyle=e.fontStyle),e.textDecoration&&(t.textDecoration=e.textDecoration),e.isMaxLine==`1`&&(t.lineClamp=e.maxLine||`1`,t[`-webkit-line-clamp`]=e.maxLine||`1`),t}parseImage(e={},t={}){return e.cropMode==`01`?(t.backgroundSize=`contain`,t.aspectRatio=`1/1`):(t.backgroundSize=`cover`,t.aspectRatio=`16/9`),t}parseRect(e,t){t.width=this.adapter.doSize(e.width),t.height=this.adapter.doSize(e.height),t.maxWidth=this.adapter.doSize(e.maxWidth),t.maxHeight=this.adapter.doSize(e.maxHeight),t.minWidth=this.adapter.doSize(e.minWidth),t.minHeight=this.adapter.doSize(e.minHeight)}parseFlex(e,t){e.flexDirection&&(t.flexDirection=e.flexDirection),e.justifyContent&&(t.justifyContent=e.justifyContent),e.alignItems&&(t.alignItems=e.alignItems),e.flexWrap&&(t.flexWrap=e.flexWrap),e.flexShrink&&(t.flexShrink=e.flexShrink),e.gap&&(t.gap=this.adapter.doSize(e.gap))}parseBackground(e,t){if(e.backgroundType==`01`&&e.backgroundColor)t.backgroundColor=this.adapter.doColor(e.backgroundColor);else if(e.backgroundType==`02`&&e.backgroundImage){if(t.backgroundImage=`url("${this.adapter.doReplaceUrl(this.adapter.doI18n(e.backgroundImage))}")`,e.backgroundPosition){let n=e.backgroundPosition.split(/[ ]+/);t.backgroundPosition=`${this.adapter.doSize(n[0]||``)} ${this.adapter.doSize(n[1]||``)}`}else t.backgroundPosition=`50% 50%`;if(e.backgroundSize){let n=e.backgroundSize.split(/[ ]+/);t.backgroundSize=n.length>=2?`${this.adapter.doSize(n[0]||``)} ${this.adapter.doSize(n[1]||``)}`:e.backgroundSize}else t.backgroundSize=`cover`;t.backgroundRepeat=e.backgroundRepeat||`no-repeat`}else e.backgroundType==`03`&&e.backgroundGradient&&(t.backgroundImage=e.backgroundGradient)}parsePadding(e,t){e.paddingType==`0`?t.padding=this.adapter.doSize(e.padding):e.paddingType==`1`&&(t.paddingLeft=this.adapter.doSize(e.paddingLeft),t.paddingTop=this.adapter.doSize(e.paddingTop),t.paddingRight=this.adapter.doSize(e.paddingRight),t.paddingBottom=this.adapter.doSize(e.paddingBottom))}parseMargin(e,t){e.marginType==`0`?t.margin=this.adapter.doSize(e.margin):e.marginType==`1`&&(t.marginLeft=this.adapter.doSize(e.marginLeft),t.marginTop=this.adapter.doSize(e.marginTop),t.marginRight=this.adapter.doSize(e.marginRight),t.marginBottom=this.adapter.doSize(e.marginBottom))}parseBorderRadius(e,t){e.borderRadiusType==`0`?t.borderRadius=this.adapter.doSize(e.borderRadius):e.borderRadiusType==`1`&&(t.borderTopLeftRadius=this.adapter.doSize(e.borderTopLeftRadius),t.borderTopRightRadius=this.adapter.doSize(e.borderTopRightRadius),t.borderBottomRightRadius=this.adapter.doSize(e.borderBottomRightRadius),t.borderBottomLeftRadius=this.adapter.doSize(e.borderBottomLeftRadius))}parseBorder(e,t){e.isBorder==`1`&&(t.borderWidth=this.adapter.doSize(e.borderWidth||`1`),t.borderStyle=e.borderStyle||`solid`,t.borderColor=this.adapter.doColor(e.borderColor||`#e7e7ee`))}parseShadow(e,t){if(e.isShadow==`1`){let n=[];n.push(this.adapter.doSize(e.shadowX||`0`)),n.push(this.adapter.doSize(e.shadowY||`0`)),e.shadowBlur&&n.push(this.adapter.doSize(e.shadowBlur)),e.shadowSpread&&n.push(this.adapter.doSize(e.shadowSpread)),n.push(this.adapter.doColor(e.shadowColor||`#e7e7ee`)),t.boxShadow=n.join(` `)}}parseTransform(e,t){let n=[];e.rotate&&n.push(`rotate(${e.rotate}deg)`),n.length&&(t.transform=n.join(` `))}parseOther(e,t){t.overflow=e.overflow?e.overflow:`hidden`,e.opacity&&(t.opacity=`${Number(e.opacity)/100}`)}},Yu={inject:[`adapter`],methods:{doI18n(e){return this.adapter.doI18n(e)}}},Y=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},Xu={name:`CeRoot`,emits:[`onReady`],mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})}},computed:{styleObj(){let e=new Ju(this,this.styleProps).parse();return Object.assign({fontSize:this.adapter.doSize(14,`font`)},e)}},mounted(){this.$emit(`onReady`,{})}};function Zu(e,t,n,r,i,a){return z(),B(`div`,{ref:`root`,class:`ce_root`,style:k(a.styleObj)},[$i(e.$slots,`default`)],4)}var Qu=Y(Xu,[[`render`,Zu],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Root.vue`]]),$u={name:`CeRow`,emits:[`click`],mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})}},computed:{styleObj(){return new Ju(this,this.styleProps).parse()}}};function ed(e,t,n,r,i,a){return z(),B(`div`,{ref:`row`,class:`ce_row`,style:k(a.styleObj),onClick:t[0]||=t=>e.$emit(`click`,t)},[$i(e.$slots,`default`)],4)}var td=Y($u,[[`render`,ed],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Row.vue`]]),nd={name:`CeColumn`,emits:[`click`],mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})}},computed:{styleObj(){return new Ju(this,this.styleProps).parse()}}};function rd(e,t,n,r,i,a){return z(),B(`div`,{ref:`column`,class:`ce_column`,style:k(a.styleObj),onClick:t[0]||=t=>e.$emit(`click`,t)},[$i(e.$slots,`default`)],4)}var id=Y(nd,[[`render`,rd],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Column.vue`]]),ad={name:`CeText`,emits:[`click`],mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})},value:{type:[String,Number],default:``}},computed:{styleObj(){let e=new Ju(this,this.styleProps),t=e.parse();return e.parseFont(this.styleProps.font||{},t),t}}};function od(e,t,n,r,i,a){return z(),B(`span`,{class:`ce_text`,style:k(a.styleObj),onClick:t[0]||=t=>e.$emit(`click`,t)},j(e.doI18n(n.value)),5)}var sd=Y(ad,[[`render`,od],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Text.vue`]]),cd={name:`CeButton`,emits:[`click`],mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})},value:{type:[String,Number],default:``},disabled:{type:[Boolean,String,Number],default:!1}},computed:{styleObj(){let e=new Ju(this,this.styleProps),t=e.parse();return e.parseFont(this.styleProps.font||{},t),t}}};function ld(e,t,n,r,i,a){return z(),B(`button`,{class:A([`ce_button`,{ce_button_disabled:n.disabled}]),style:k(a.styleObj),onClick:t[0]||=t=>!n.disabled&&e.$emit(`click`,t)},j(e.doI18n(n.value)),7)}var ud=Y(cd,[[`render`,ld],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Button.vue`]]),dd={name:`CeDivider`,mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})}},computed:{styleObj(){return new Ju(this,this.styleProps).parse()}}};function fd(e,t,n,r,i,a){return z(),B(`div`,{class:`ce_divider`,style:k(a.styleObj)},null,4)}var pd=Y(dd,[[`render`,fd],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Divider.vue`]]),md=`/assets/svg-symbols-B2exBrAr.svg`,hd=`/assets/default-image-wzZYQ86K.png`,gd=md,_d=hd,vd={name:`SvgSymbols`,props:{icon:{type:String,default:``},color:{type:String,default:``}},data(){return{symbols:gd}},computed:{href(){return`${this.symbols}#${this.icon}`}}},yd=[`fill`],bd=[`xlink:href`,`fill`];function xd(e,t,n,r,i,a){return z(),B(`svg`,{class:`ce_svgsymbols`,fill:n.color},[H(`use`,{"xlink:href":a.href,fill:n.color},null,8,bd)],8,yd)}var Sd=Y(vd,[[`render`,xd],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/SvgSymbols.vue`]]),Cd={name:`SvgCode`,props:{content:{type:String,default:``},color:{type:String,default:``}},computed:{svgStyle(){return{fill:this.color}}}},wd=[`innerHTML`];function Td(e,t,n,r,i,a){return z(),B(`span`,{class:`ce_svgcode`,style:k(a.svgStyle),innerHTML:n.content},null,12,wd)}var Ed={name:`CeIcon`,emits:[`click`],mixins:[Yu],components:{SvgSymbols:Sd,SvgCode:Y(Cd,[[`render`,Td],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/SvgCode.vue`]])},props:{styleProps:{type:Object,default:()=>({})},icon:{type:String,default:``},color:{type:String,default:``},content:{type:String,default:``}},computed:{styleObj(){return new Ju(this,this.styleProps).parse()}}};function Dd(e,t,n,r,i,a){let o=I(`svg-code`),s=I(`svg-symbols`);return z(),B(`span`,{class:`ce_icon`,style:k(a.styleObj),onClick:t[0]||=t=>e.$emit(`click`,t)},[n.content&&n.content.trim()?(z(),V(o,{key:0,color:n.color,content:n.content},null,8,[`color`,`content`])):(z(),V(s,{key:1,color:n.color,icon:n.icon},null,8,[`color`,`icon`]))],4)}var Od=Y(Ed,[[`render`,Dd],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Icon.vue`]]),kd={name:`CeImage`,emits:[`click`],mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})},value:{type:[String,Number],default:``}},computed:{styleObj(){return new Ju(this,this.styleProps).parse()},fillStyleObj(){let e={};return new Ju(this,this.styleProps).parseImage(this.styleProps.image||{},e),e.backgroundImage=`url(${this.adapter.doReplaceUrl(this.doI18n(this.value||_d))})`,e}}};function Ad(e,t,n,r,i,a){return z(),B(`div`,{class:`ce_image`,style:k(a.styleObj),onClick:t[0]||=t=>e.$emit(`click`,t)},[H(`div`,{class:`ce_image_fill`,style:k(a.fillStyleObj)},null,4)],4)}var jd=Y(kd,[[`render`,Ad],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Image.vue`]]),Md={name:`CeMultiText`,emits:[`click`],mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})},textList:{type:Array,default:()=>[]}},computed:{styleObj(){let e=new Ju(this,this.styleProps),t=e.parse();return e.parseFont(this.styleProps.font||{},t),t}},methods:{doClick(e,t,n){e.__do__||(e.__do__=!0,this.$emit(`click`,{data:{index:n,tag:t?t.tag:``,text:t?t.value:``}}))},parseFont(e){let t={};return new Ju(this,{}).parseFont(e||{},t),e&&e.backgroundColor&&(t.backgroundColor=this.adapter.doColor(e.backgroundColor)),t}}},Nd={class:`ce_multitext_item`},Pd=[`onClick`];function Fd(e,t,n,r,i,a){return z(),B(`span`,{class:`ce_multitext`,style:k(a.styleObj),onClick:t[0]||=e=>a.doClick(e)},[H(`span`,Nd,[(z(!0),B(R,null,L(n.textList,(t,n)=>(z(),B(`span`,{key:n,style:k(a.parseFont(t)),onClick:e=>a.doClick(e,t,n)},j(e.doI18n(t.value)),13,Pd))),128))])],4)}var Id=Y(Md,[[`render`,Fd],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/MultiText.vue`]]),Ld={name:`CeListLayout`,emits:[`click`],mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})},value:{type:Array,default:()=>[]},direction:{type:String,default:`vertical`},rowSpacing:{type:[String,Number],default:``},edgeInsets:{type:String,default:``}},computed:{itemStyleObj(){let e=this.direction===`horizontal`;return{marginLeft:e?this.adapter.doSize(this.rowSpacing):0,marginTop:e?0:this.adapter.doSize(this.rowSpacing)}},conClasses(){return{ce_listlayout_horizontal:this.direction===`horizontal`}},conStyleObj(){let e={};if(this.edgeInsets){let t=this.parsePadding(this.edgeInsets);e.paddingLeft=this.adapter.doSize(t[1]),e.paddingTop=this.adapter.doSize(t[0]),e.paddingRight=this.adapter.doSize(t[3]),e.paddingBottom=this.adapter.doSize(t[2])}return e},rootStyle(){return new Ju(this,this.styleProps).parse()}},methods:{parsePadding(e){return String(e).replace(/[{}]/g,``).split(`,`)}}};function Rd(e,t,n,r,i,a){return z(),B(`div`,{class:`ce_listlayout`,style:k(a.rootStyle),onClick:t[0]||=t=>e.$emit(`click`,t)},[H(`div`,{class:A([`ce_listlayout_con`,a.conClasses]),style:k(a.conStyleObj)},[(z(!0),B(R,null,L(n.value||[],(t,n)=>(z(),B(`div`,{key:n,class:`ce_listlayout_item`,style:k(n===0?{}:a.itemStyleObj)},[$i(e.$slots,`default`,{item:t,index:n})],4))),128))],6)],4)}var zd=Y(Ld,[[`render`,Rd],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ListLayout.vue`]]),Bd={name:`CeGridLayout`,emits:[`click`],mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})},value:{type:Array,default:()=>[]},column:{type:[Number,String],default:2},rowSpacing:{type:[String,Number],default:``},itemSpacing:{type:[String,Number],default:``},edgeInsets:{type:String,default:``}},computed:{styleObj(){let e=new Ju(this,this.styleProps).parse();if(this.rowSpacing&&(e.rowGap=this.adapter.doSize(this.rowSpacing)),this.edgeInsets){let t=this.parsePadding(this.edgeInsets);e.paddingLeft=this.adapter.doSize(t[1]),e.paddingTop=this.adapter.doSize(t[0]),e.paddingRight=this.adapter.doSize(t[3]),e.paddingBottom=this.adapter.doSize(t[2])}return e}},methods:{getItemStyle(e){let t=Number(this.column),n=100/t+`%`,r=0,i=0;return t>1&&(this.itemSpacing&&(i=this.adapter.doSize(this.itemSpacing),r=this.adapter.doSize((t-1)*Number(this.itemSpacing)/t)),n=`calc(${n} - ${r})`,e%t===t-1&&(i=0)),{width:n,marginRight:i}},parsePadding(e){return String(e).replace(/[{}]/g,``).split(`,`)}}};function Vd(e,t,n,r,i,a){return z(),B(`div`,{class:`ce_gridlayout`,style:k(a.styleObj),onClick:t[0]||=t=>e.$emit(`click`,t)},[(z(!0),B(R,null,L(n.value||[],(t,n)=>(z(),B(`div`,{key:n,class:`ce_gridlayout_item`,style:k(a.getItemStyle(n))},[$i(e.$slots,`default`,{item:t,index:n})],4))),128))],4)}var Hd=Y(Bd,[[`render`,Vd],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/GridLayout.vue`]]);function Ud(e){return t=>({get:()=>t[e],set:n=>{t[e]=n}})}function Wd(e){return t=>({get:()=>t[e].bind(t)})}function Gd(e,t=[]){return(n,r)=>({get:()=>(...i)=>(t.forEach(e=>{i[e]=Number(i[e])*r}),n[e](...i))})}var Kd={textAlign:Ud(`textAlign`),textBaseline:Ud(`textBaseline`),fillStyle:Ud(`fillStyle`),strokeStyle:Ud(`strokeStyle`),lineCap:Ud(`lineCap`),imageSmoothingEnabled:Ud(`imageSmoothingEnabled`),imageSmoothingQuality:Ud(`imageSmoothingQuality`),lineWidth:(e,t)=>({get:()=>e.lineWidth,set:n=>{e.lineWidth=n*t}}),font:(e,t,n)=>({get:()=>e.font,set:r=>{e.font=String(r).replace(/([0-9.]+)px/,(e,r)=>Number(r)*t*Number(n||1)+`px`)}}),fillText:(e,t,n,r)=>({get:()=>(...n)=>(n[0]=n[0]?r.adapter.doI18n(n[0]):n[0],[1,2].forEach(e=>{n[e]=Number(n[e])*t}),e.fillText(...n))}),fillRect:Gd(`fillRect`,[0,1,2,3]),moveTo:Gd(`moveTo`,[0,1]),lineTo:Gd(`lineTo`,[0,1]),arc:Gd(`arc`,[0,1,2]),clearRect:Gd(`clearRect`,[0,1,2,3]),createLinearGradient:Gd(`createLinearGradient`,[0,1,2,3]),createRadialGradient:Gd(`createRadialGradient`,[0,1,2,3,4,5]),beginPath:Wd(`beginPath`),closePath:Wd(`closePath`),fill:Wd(`fill`),stroke:Wd(`stroke`),measureText:(e,t)=>({get:()=>(...n)=>{let r=e.font;e.font=r.replace(/([0-9.]+)px/,(e,n)=>Number(n)/t+`px`);let i=e.measureText(...n);return e.font=r,i}}),setLineDash:e=>({get:()=>e.setLineDash.bind(e),set:t=>e.setLineDash(t)})};function qd(e,t){function n(n,r){Object.keys(Kd).forEach(i=>{Object.defineProperty(this,i,Kd[i](e,n,r,t))})}return n.prototype=e,n}function Jd(e,t){return function(n,r,i){this.width=n.width/r,this.height=n.height/r,this.style=e.style,this.getContext=function(...n){return new(qd(e.getContext(...n),t))(r,i)}}}var Yd={name:`CeCanvas`,emits:[`onMeasured`],mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})}},computed:{styleObj(){return new Ju(this,this.styleProps).parse()}},created(){this.resizeEvt=typeof window<`u`&&`orientationchange`in window?`orientationchange`:`resize`},mounted(){this.$nextTick(()=>this.doPaint()),typeof window<`u`&&window.addEventListener(this.resizeEvt,this.doRepaint,!1)},unmounted(){typeof window<`u`&&window.removeEventListener(this.resizeEvt,this.doRepaint,!1)},methods:{doPaint(){let e=this.$refs.canvas;if(!e)return;let t=e.getBoundingClientRect(),{availableWidth:n,applyUnitRatio:r,fontRatio:i=1}=this.adapter.getSystemInfo(),a=n*r/this.adapter.getDesignInfo().styleWidth||1,o=e.getContext(`2d`),s=(typeof window<`u`?window.devicePixelRatio:1)||1;e.width=t.width*s,e.height=t.height*s,o.scale(s,s);let c=new(Jd(e,this))(t,a,i);this.$emit(`onMeasured`,{canvas:c,width:c.width,height:c.height})},doRepaint(){let e=this.$refs.canvas;e&&(e.getContext(`2d`).clearRect(0,0,e.width,e.height),this.doPaint())}}};function Xd(e,t,n,r,i,a){return z(),B(`canvas`,{ref:`canvas`,class:`ce_canvas`,style:k(a.styleObj)},null,4)}var Zd=Y(Yd,[[`render`,Xd],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Canvas.vue`]]),Qd={name:`CeInput`,emits:[`input`,`change`],mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})},value:{type:[String,Number],default:``},placeholder:{type:[String,Number],default:``},inputType:{type:String,default:``},maxLength:{type:[String,Number],default:``}},data(){return{typeMap:{text:`text`,number:`text`,email:`text`,password:`password`,phone:`text`},regexpMap:{number:/^-?([0-9]*|(0|[1-9][0-9]*)\.[0-9]{0,})?$/i,email:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,phone:/^[0-9]{11}$/},inputValue:``,oldValue:``}},created(){this.inputValue=this.value,this.oldValue=this.inputValue},computed:{type(){return this.typeMap[this.inputType]},styleObj(){let e=new Ju(this,this.styleProps),t=e.parse();return e.parseFont(this.styleProps.font||{},t),Object.assign({padding:`${this.adapter.doSize(4)} ${this.adapter.doSize(8)}`},t)}},watch:{value(){this.inputValue=this.value,this.oldValue=this.inputValue}},methods:{doInput(e){let t=this.regexpMap[this.inputType];!t||t.test(e)?(this.$emit(`input`,e),this.inputValue=e):this.inputValue=this.oldValue}}},$d=[`type`,`placeholder`,`maxlength`,`value`];function ef(e,t,n,r,i,a){return z(),B(`input`,{class:`ce_input`,style:k(a.styleObj),type:a.type,placeholder:e.doI18n(n.placeholder),maxlength:n.maxLength,value:i.inputValue,onInput:t[0]||=t=>e.$emit(`input`,t.target.value),onChange:t[1]||=t=>e.$emit(`change`)},null,44,$d)}var tf=Y(Qd,[[`render`,ef],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Input.vue`]]),nf={name:`CeViewContainer`,emits:[`action`],mixins:[Yu],inject:[`adapter`,`customComponents`],props:{styleProps:{type:Object,default:()=>({})},customClass:{type:String,default:``},customProps:{type:Object,default:()=>({})},customRemarkImg:{type:String,default:``}},computed:{componentClass(){let e=this.customComponents;return e?this.customClass?e[this.customClass]||e.Placeholder||``:e.Placeholder||``:``},componentProps(){return this.customProps||{}},componentIcon(){return this.customRemarkImg||``},styleObj(){return new Ju(this,this.styleProps).parse()}}};function rf(e,t,n,r,i,a){return z(),B(`div`,{class:`ce_viewcontainer`,style:k(a.styleObj)},[a.componentClass?(z(),V(Xi(a.componentClass),{key:0,icon:a.componentIcon,props:a.componentProps,"custom-class":n.customClass,onAction:t[0]||=t=>e.$emit(`action`,t)},null,40,[`icon`,`props`,`custom-class`])):G(`v-if`,!0)],4)}var af=Y(nf,[[`render`,rf],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ViewContainer.vue`]]),of={TopLeft:{justifyContent:`flex-start`,alignItems:`flex-start`},TopCenter:{justifyContent:`flex-start`,alignItems:`center`},TopRight:{justifyContent:`flex-start`,alignItems:`flex-end`},CenterLeft:{justifyContent:`center`,alignItems:`flex-start`},Center:{justifyContent:`center`,alignItems:`center`},CenterRight:{justifyContent:`center`,alignItems:`flex-end`},BottomLeft:{justifyContent:`flex-end`,alignItems:`flex-start`},BottomCenter:{justifyContent:`flex-end`,alignItems:`center`},BottomRight:{justifyContent:`flex-end`,alignItems:`flex-end`}},sf={name:`CeAbsoluteLayout`,mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})},align:{type:String,default:``}},computed:{styleObj(){let e=new Ju(this,this.styleProps).parse();return Object.assign(e,of[this.align]||{})}}};function cf(e,t,n,r,i,a){return z(),B(`div`,{class:`ce_absolutelayout`,style:k(a.styleObj)},[$i(e.$slots,`default`)],4)}var lf=Y(sf,[[`render`,cf],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/AbsoluteLayout.vue`]]),uf={CheckGroupCircle:[`M512 65.983389c-245.919634 0-446.016611 200.095256-446.016611 446.016611 0 245.952318 200.064292 446.016611 446.016611 446.016611S958.016611 757.952318 958.016611 512C958.016611 266.080366 757.952318 65.983389 512 65.983389zM512 894.016611c-210.655557 0-382.016611-171.392017-382.016611-382.016611 0-210.655557 171.359333-382.016611 382.016611-382.016611 210.624593 0 382.016611 171.359333 382.016611 382.016611C894.016611 722.624593 722.624593 894.016611 512 894.016611z`,`M512 352.00086c-88.223841 0-160.00086 71.775299-160.00086 159.99914s71.775299 160.00086 160.00086 160.00086 160.00086-71.775299 160.00086-160.00086S600.223841 352.00086 512 352.00086z`],CheckGroupSquareEmpty:[`M833.008 928h-640c-52.944 0-96-43.072-96-96V192c0-52.928 43.056-96 96-96h640c52.912 0 96 43.072 96 96v640c0 52.928-43.072 96-96 96z m-640-768c-17.648 0-32 14.368-32 32v640c0 17.664 14.352 32 32 32h640a32 32 0 0 0 32-32V192c0-17.632-14.352-32-32-32h-640z`],CheckGroupSquareEmptyCheck:[`M727.984 393.184a31.968 31.968 0 0 0-45.248 0.256L449.44 629.248l-103.28-106.112a32 32 0 1 0-45.888 44.608l126.032 129.504c0.048 0.096 0.192 0.096 0.256 0.192 0.064 0.064 0.096 0.192 0.16 0.256 2.016 1.984 4.512 3.2 6.88 4.544 1.248 0.672 2.24 1.792 3.52 2.304a31.728 31.728 0 0 0 24.064 0.064c1.232-0.512 2.208-1.536 3.392-2.176 2.4-1.344 4.896-2.528 6.944-4.544 0.064-0.064 0.096-0.192 0.192-0.256 0.064-0.096 0.16-0.128 0.256-0.192l256.224-259.008a32 32 0 0 0-0.224-45.248zM832.992 928h-640c-52.928 0-96-43.072-96-96V192c0-52.928 43.072-96 96-96h640c52.928 0 96 43.072 96 96v640c0 52.928-43.056 96-96 96z m-640-768c-17.632 0-32 14.368-32 32v640c0 17.664 14.368 32 32 32h640a32 32 0 0 0 32-32V192c0-17.632-14.336-32-32-32h-640z`],CheckGroupSquare:[`M186 123c-33.137 0-60 26.863-60 60v655c0 33.137 26.863 60 60 60h655c33.137 0 60-26.863 60-60V183c0-33.137-26.863-60-60-60H186z m0-60h655c66.274 0 120 53.726 120 120v655c0 66.274-53.726 120-120 120H186c-66.274 0-120-53.726-120-120V183c0-66.274 53.726-120 120-120z`],CheckGroupSquareCheck:[`M840.6 97H185.4C137.1 97 98 136.1 98 184.4v655.3c0 48.3 39.1 87.4 87.4 87.4h655.3c48.3 0 87.4-39.1 87.4-87.4V184.4C928 136.1 888.9 97 840.6 97zM791 380.7L466.7 705.1c-17.1 17.1-44.7 17.1-61.8 0L235 535.2c-17.1-17.1-17.1-44.7 0-61.8 17.1-17.1 44.7-17.1 61.8 0l139 139L729.2 319c17.1-17.1 44.7-17.1 61.8 0 17.1 17 17.1 44.7 0 61.7z`]},df={RadioButtonCircle:[`M512 65.983389c-245.919634 0-446.016611 200.095256-446.016611 446.016611 0 245.952318 200.064292 446.016611 446.016611 446.016611S958.016611 757.952318 958.016611 512C958.016611 266.080366 757.952318 65.983389 512 65.983389zM512 894.016611c-210.655557 0-382.016611-171.392017-382.016611-382.016611 0-210.655557 171.359333-382.016611 382.016611-382.016611 210.624593 0 382.016611 171.359333 382.016611 382.016611C894.016611 722.624593 722.624593 894.016611 512 894.016611z`,`M512 352.00086c-88.223841 0-160.00086 71.775299-160.00086 159.99914s71.775299 160.00086 160.00086 160.00086 160.00086-71.775299 160.00086-160.00086S600.223841 352.00086 512 352.00086z`],RadioButtonCircleEmpty:[`M512 938.666667C276.362667 938.666667 85.333333 747.637333 85.333333 512S276.362667 85.333333 512 85.333333s426.666667 191.029333 426.666667 426.666667-191.029333 426.666667-426.666667 426.666667z m0-64c200.298667 0 362.666667-162.368 362.666667-362.666667S712.298667 149.333333 512 149.333333 149.333333 311.701333 149.333333 512s162.368 362.666667 362.666667 362.666667z`],RadioButtonCircleEmptyCheck:[`M512 85.333333c235.637333 0 426.666667 191.029333 426.666667 426.666667S747.637333 938.666667 512 938.666667 85.333333 747.637333 85.333333 512 276.362667 85.333333 512 85.333333z m182.613333 297.354667a32 32 0 0 0-45.258666 0.032L458.922667 573.44l-84.341334-83.989333a32 32 0 0 0-45.162666 45.344l106.986666 106.549333a32 32 0 0 0 45.226667-0.064l213.013333-213.333333a32 32 0 0 0-0.032-45.258667z`]},ff={name:`CeCheckGroup`,mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})},value:{type:[Array,String,Number],default:()=>[]},dataList:{type:Array,default:()=>[]},selectColor:{type:String,default:`#0082ff`},unSelectColor:{type:String,default:`#333333`},buttonStyle:{type:String,default:`Circle`},maxSelectCount:{type:[String,Number],default:`0`},direction:{type:String,default:`horizontal`},itemPadding:{type:[String,Number],default:`4 10 4 10`},itemSpacing:{type:[String,Number],default:`4`},textSpacing:{type:[String,Number],default:`3`},fontSize:{type:[String,Number],default:`13`},iconSize:{type:[String,Number],default:`14`}},emits:[`change`,`selectChange`],computed:{rootStyle(){return{overflow:`hidden`,boxSizing:`border-box`}},checkedSet(){let e=this.value;return Array.isArray(e)?new Set(e.map(String)):e===``||e==null?new Set:new Set([String(e)])},limit(){let e=Number(this.maxSelectCount);return Number.isFinite(e)&&e>0?e:1/0}},methods:{isChecked(e){return this.checkedSet.has(String(e.key))},checkPaths(e){let t=this.isChecked(e);switch(this.buttonStyle){case`SquareEmpty`:return uf[t?`CheckGroupSquareEmptyCheck`:`CheckGroupSquareEmpty`];case`Square`:return uf[t?`CheckGroupSquareCheck`:`CheckGroupSquare`];case`Text`:return[];default:return uf.CheckGroupCircle}},itemStyle(e){let t=String(this.itemPadding).split(/\s+/),n=Number(this.itemSpacing)||0,r=e===this.dataList.length-1?0:n,i=e===this.dataList.length-1?0:n,a=(e,t)=>this.adapter.doSize(e[t]===void 0?e[0]||0:e[t]),o=t.length>=4?`${a(t,0)} ${a(t,1)} ${a(t,2)} ${a(t,3)}`:this.adapter.doSize(this.itemPadding);return this.direction===`vertical`?{padding:o,marginBottom:i}:{padding:o,marginRight:r}},toggle(e){let t=String(e.key),n=new Set(this.checkedSet);n.has(t)?n.delete(t):(n.size>=this.limit&&n.clear(),n.add(t));let r=[...n];this.$emit(`change`,r),this.$emit(`selectChange`,{value:r,item:e})}}},pf=[`onClick`],mf={class:`ce_svgcheckstyle`,viewBox:`0 0 1024 1024`},hf=[`d`,`fill`],gf=[`title`];function _f(e,t,n,r,i,a){return z(),B(`div`,{class:`ce_check_group`,style:k(a.rootStyle)},[H(`div`,{class:`ce_check_list`,style:k({flexDirection:n.direction===`vertical`?`column`:`row`})},[(z(!0),B(R,null,L(n.dataList,(e,t)=>(z(),B(`div`,{key:e.key,class:`ce_check_item`,style:k(a.itemStyle(t)),onClick:t=>a.toggle(e)},[n.buttonStyle===`Text`?G(`v-if`,!0):(z(),B(`div`,{key:0,class:`ce_check_icon`,style:k({width:n.iconSize+`px`,height:n.iconSize+`px`,marginRight:n.textSpacing+`px`})},[(z(),B(`svg`,mf,[(z(!0),B(R,null,L(a.checkPaths(e),(t,r)=>(z(),B(`path`,{key:r,d:t,fill:a.isChecked(e)?n.selectColor:n.unSelectColor},null,8,hf))),128))]))],4)),H(`span`,{class:`ce_check_text`,title:e.desc,style:k({color:a.isChecked(e)?n.selectColor:n.unSelectColor,fontSize:n.fontSize+`px`})},j(e.desc),13,gf)],12,pf))),128))],4)],4)}var vf=Y(ff,[[`render`,_f],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/CheckGroup.vue`]]),yf={name:`CeRadioButton`,mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})},value:{type:[String,Number],default:``},selectColor:{type:String,default:`#0082ff`},unSelectColor:{type:String,default:`#333333`},buttonStyle:{type:String,default:`Circle`},textSpacing:{type:[String,Number],default:`3`},fontSize:{type:[String,Number],default:`14`},iconSize:{type:[String,Number],default:`14`},showText:{type:[String,Number],default:`1`},text:{type:[String,Number],default:``}},emits:[`change`,`selectChange`],computed:{rootStyle(){return{overflow:`hidden`,boxSizing:`border-box`}},selected(){let e=this.value;return e!==``&&e!=null&&e!==!1&&e!==`0`},color(){return this.selected?this.selectColor:this.unSelectColor},radioPaths(){return this.selected&&this.buttonStyle===`CircleEmpty`?df.RadioButtonCircleEmptyCheck:this.buttonStyle===`CircleEmpty`?df.RadioButtonCircleEmpty:df.RadioButtonCircle}},methods:{toggle(){let e=this.selected?``:this.value||`1`;this.$emit(`change`,e),this.$emit(`selectChange`,!!e)}}},bf=[`d`];function xf(e,t,n,r,i,a){return z(),B(`span`,{class:`ce_radio_button`,style:k(a.rootStyle)},[H(`div`,{class:`ce_radio_item`,onClick:t[0]||=(...e)=>a.toggle&&a.toggle(...e)},[n.buttonStyle===`Text`?G(`v-if`,!0):(z(),B(`span`,{key:0,class:`ce_radio_icon`,style:k({width:n.iconSize+`px`,height:n.iconSize+`px`,marginRight:n.textSpacing+`px`})},[(z(),B(`svg`,{class:`ce_svgradiostyle`,viewBox:`0 0 1024 1024`,style:k({fill:a.color,stroke:a.color})},[(z(!0),B(R,null,L(a.radioPaths,(e,t)=>(z(),B(`path`,{key:t,d:e},null,8,bf))),128))],4))],4)),n.showText===`1`||n.showText===1?(z(),B(`span`,{key:1,style:k({color:a.color,fontSize:n.fontSize+`px`})},j(e.doI18n(n.text)),5)):G(`v-if`,!0)])],4)}var Sf=Y(yf,[[`render`,xf],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/RadioButton.vue`]]),Cf={name:`CeProgressSlider`,mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})},value:{type:[String,Number],default:0},minProgress:{type:[String,Number],default:0},maxProgress:{type:[String,Number],default:100},step:{type:[String,Number],default:1},backgroundColor:{type:String,default:`#e6e6e6`},foregroundColor:{type:String,default:`#0a59f5`},processHeight:{type:[String,Number],default:5},blockStyle:{type:String,default:`circle`},blockColor:{type:String,default:`#ffffff`},blockImage:{type:String,default:``},blockWidth:{type:[String,Number],default:15},blockHeight:{type:[String,Number],default:15}},emits:[`change`,`selectChange`],data(){return{dragging:!1}},computed:{rootStyle(){let e=(Number(this.processHeight)||5)+16,t=Number(this.blockHeight)||15;return{height:`auto`,minHeight:this.adapter.doSize(Math.max(e,t)),boxSizing:`border-box`}},min(){let e=Number(this.minProgress);return Number.isFinite(e)?e:0},max(){let e=Number(this.maxProgress);return Number.isFinite(e)?e:100},stepVal(){let e=Number(this.step);return e>0?e:1},numValue(){let e=Number(this.value);return Number.isFinite(e)?e:this.min},percent(){let e=this.max-this.min||1,t=(this.numValue-this.min)/e*100;return Math.max(0,Math.min(100,t))},conLeft(){let e=Number(this.blockWidth)||15;return`calc(${e/2}px + (100% - ${e}px) * ${this.percent} / 100)`},rectStyle(){let e=Number(this.processHeight)||5;return{backgroundColor:this.adapter.doColor(this.backgroundColor),height:this.adapter.doSize(e),borderRadius:this.adapter.doSize(e),marginTop:this.adapter.doSize(8),marginBottom:this.adapter.doSize(8)}},barStyle(){let e=Number(this.processHeight)||5,t=Number(this.blockWidth)||15;return{backgroundColor:this.adapter.doColor(this.foregroundColor),left:this.adapter.doSize(t/2),width:`calc((100% - ${t}px) * ${this.percent} / 100)`,borderTopLeftRadius:this.adapter.doSize(e),borderBottomLeftRadius:this.adapter.doSize(e)}},blockStyleObj(){let e=Number(this.blockWidth)||15,t=Number(this.blockHeight)||15,n={width:this.adapter.doSize(e),height:this.adapter.doSize(t),boxShadow:`rgba(0,0,0,0.3) 0 0 3px 0`};return this.blockStyle===`image`&&this.blockImage?(n.backgroundImage=`url(${this.adapter.doReplaceUrl(this.doI18n(this.blockImage))})`,n.borderRadius=`0`):this.blockStyle===`circle`?(n.backgroundColor=this.adapter.doColor(this.blockColor),n.borderRadius=this.adapter.doSize(Math.min(e,t)/2)):(n.backgroundColor=this.adapter.doColor(this.blockColor),n.borderRadius=this.adapter.doSize(2)),n}},methods:{clampStep(e){let t=Math.max(this.min,Math.min(this.max,e)),n=Math.round((t-this.min)/this.stepVal)*this.stepVal+this.min;return Math.max(this.min,Math.min(this.max,n))},valueFromEvent(e){let t=this.$refs.rect;if(!t)return this.numValue;let n=t.getBoundingClientRect(),r=(e.clientX-n.left)/n.width;return this.clampStep(this.min+r*(this.max-this.min))},onDown(e){this.dragging=!0,this.setValue(this.valueFromEvent(e)),window.addEventListener(`pointermove`,this.onMove),window.addEventListener(`pointerup`,this.onUp)},onMove(e){this.dragging&&this.setValue(this.valueFromEvent(e))},onUp(){this.dragging=!1,window.removeEventListener(`pointermove`,this.onMove),window.removeEventListener(`pointerup`,this.onUp)},setValue(e){this.$emit(`change`,e),this.$emit(`selectChange`,e)}},beforeUnmount(){this.onUp()}};function wf(e,t,n,r,i,a){return z(),B(`div`,{class:`ce_slider`,style:k(a.rootStyle)},[H(`div`,{ref:`rect`,class:`ce_slider_rect`,style:k(a.rectStyle),onPointerdown:t[0]||=(...e)=>a.onDown&&a.onDown(...e)},[H(`div`,{class:`ce_slider_bar`,style:k(a.barStyle)},null,4),H(`div`,{class:`ce_slider_con`,style:k({left:a.conLeft})},[H(`div`,{class:A([`ce_slider_block`,{ce_dragging:i.dragging}]),style:k(a.blockStyleObj)},null,6)],4)],36)],4)}var Tf=Y(Cf,[[`render`,wf],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ProgressSlider.vue`]]),Ef={name:`CeVideo`,mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})},url:{type:String,default:``},previewUrl:{type:String,default:``}},emits:[`click`],data(){return{showPoster:!0}},computed:{rootStyle(){let e=new Ju(this,this.styleProps).parse();return Object.assign(e,{overflow:`hidden`,boxSizing:`border-box`})},src(){return this.adapter.doReplaceUrl(this.doI18n(this.url||``))},poster(){return this.adapter.doReplaceUrl(this.doI18n(this.previewUrl||``))}},methods:{play(){this.showPoster=!1;let e=this.$refs.video;if(e)try{e.play()}catch{}this.$emit(`click`)}}},Df=[`src`,`poster`];function Of(e,t,n,r,i,a){return z(),B(`div`,{class:`ce_video`,style:k(a.rootStyle)},[H(`video`,{ref:`video`,class:`ce_video_elem ce_npc`,src:a.src,poster:a.poster,controls:``,playsinline:``,"webkit-playsinline":``},null,8,Df),a.poster&&i.showPoster?(z(),B(`div`,{key:0,class:`ce_video_poster ce_npc`,style:k({backgroundImage:`url(${a.poster})`,backgroundSize:`cover`,backgroundPosition:`center`}),onClick:t[0]||=(...e)=>a.play&&a.play(...e)},null,4)):G(`v-if`,!0)],4)}var kf=Y(Ef,[[`render`,Of],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Video.vue`]]),Af={name:`CeMap`,mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})},centerLat:{type:[String,Number],default:``},centerLng:{type:[String,Number],default:``},zoom:{type:[String,Number],default:``},markerLat:{type:[String,Number],default:``},markerLng:{type:[String,Number],default:``},markerName:{type:String,default:``}},emits:[`click`],computed:{rootStyle(){let e=new Ju(this,this.styleProps).parse();return e.overflow=`hidden`,e}}},jf={class:`ce_map_view`},Mf={class:`ce_map_center`},Nf={key:0,class:`ce_map_markname`};function Pf(e,t,n,r,i,a){return z(),B(`div`,{class:`ce_map`,style:k(a.rootStyle)},[H(`div`,jf,[t[1]||=os(`<svg class="ce_map_grid" viewBox="0 0 100 100" preserveAspectRatio="none" data-v-512dee75><defs data-v-512dee75><pattern id="ceMapGrid" width="10" height="10" patternUnits="userSpaceOnUse" data-v-512dee75><path d="M10 0 L0 0 0 10" fill="none" stroke="#dfe3ea" stroke-width="0.4" data-v-512dee75></path></pattern></defs><rect width="100" height="100" fill="#eef1f6" data-v-512dee75></rect><rect width="100" height="100" fill="url(#ceMapGrid)" data-v-512dee75></rect><!-- 模拟几条道路 --><path d="M0 60 Q40 50 100 65" fill="none" stroke="#cdd4df" stroke-width="2.2" data-v-512dee75></path><path d="M30 0 L45 100" fill="none" stroke="#cdd4df" stroke-width="2.2" data-v-512dee75></path></svg>`,1),H(`div`,Mf,[t[0]||=H(`div`,{class:`ce_map_pin`},[H(`svg`,{viewBox:`0 0 24 24`,width:`26`,height:`26`},[H(`path`,{d:`M12 2C7.6 2 4 5.6 4 10c0 5.4 7.1 11.6 7.4 11.9.6.6 1.6.6 2.2 0C13.9 21.6 21 15.4 21 10c0-4.4-3.6-8-9-8z`,fill:`#ff4d4f`}),H(`circle`,{cx:`12`,cy:`10`,r:`3`,fill:`#fff`})])],-1),n.markerName?(z(),B(`div`,Nf,j(e.doI18n(n.markerName)),1)):G(`v-if`,!0)])]),t[2]||=H(`div`,{class:`ce_map_placeholder`},null,-1)],4)}var Ff=Y(Af,[[`render`,Pf],[`__scopeId`,`data-v-512dee75`],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Map.vue`]]),If={name:`CeMultiColumn`,emits:[`click`],mixins:[Yu],props:{styleProps:{type:Object,default:()=>({})},column:{type:[Number,String],default:2}},computed:{styleObj(){let e=new Ju(this,this.styleProps).parse(),t=parseInt(this.column,10);return t&&t>1&&(e.display=`grid`,e.gridTemplateColumns=`repeat(${t}, 1fr)`),e}}};function Lf(e,t,n,r,i,a){return z(),B(`div`,{ref:`mc`,class:`ce_multicolumn`,style:k(a.styleObj),onClick:t[0]||=t=>e.$emit(`click`,t)},[$i(e.$slots,`default`,{},void 0,!0)],4)}var Rf={Root:Qu,Row:td,Column:id,Text:sd,Button:ud,Divider:pd,Icon:Od,Image:jd,MultiText:Id,ListLayout:zd,GridLayout:Hd,Canvas:Zd,Input:tf,ViewContainer:af,AbsoluteLayout:lf,CheckGroup:vf,RadioButton:Sf,ProgressSlider:Tf,Video:kf,Map:Ff,MultiColumn:Y(If,[[`render`,Lf],[`__scopeId`,`data-v-1881a1f4`],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/MultiColumn.vue`]])},zf=new Set([`ListLayout`,`GridLayout`]);function Bf(e){return Rf[e]||null}function Vf(e){let t={},n=e||{};for(let e in n)e===`$$`?t[e]=n[e]:t[`$`+e]=n[e];return t}function Hf(e,t){let n=Vf(t),r=new Proxy(n,{has(e,t){return typeof t==`string`&&(t[0]===`$`||t===`$$`)||t in e},get(e,t){if(t in e||typeof t!=`string`||t[0]!==`$`&&t!==`$$`)return e[t]}});return Function(`vars`,`\n\t\twith(vars){\n\t\t\treturn (${e})\n\t\t}\n\t`)(r)}function Uf(e,t,n){let r=String(t).split(`.`),i=r.pop(),a=e;for(let e=0;e<r.length;e++)a=a[r[e]];a[i]=n}function Wf(e={},t={},n){let r=JSON.parse(JSON.stringify(e||{})),i=e&&e.__vars__;if(i)for(let e in i)try{Uf(r,e,Hf(i[e],t))}catch(t){n&&n.push({kind:`bind`,msg:`${e} <- ${i[e]}: ${t&&t.message}`,path:e,expr:i[e]})}return delete r.__vars__,r}function Gf(e,t,n){return Object.assign({},e,typeof t==`object`&&t||{},{$$:t,_index:n})}function Kf(e,t){return new Proxy({},{get(n,r){return r in t?t[r]:e[r]},has(n,r){return r in t||r in e},ownKeys(){let n=new Set;for(let e of Object.keys(t))n.add(e);for(let t of Object.keys(e))n.add(t);return[...n]},getOwnPropertyDescriptor(n,r){if(r in t)return{enumerable:!0,configurable:!0,value:t[r]};if(r in e)return{enumerable:!0,configurable:!0,value:e[r]}}})}var qf={name:`CustomPlaceholder`,props:{icon:{type:String,default:``},props:{type:Object,default:()=>({})},customClass:{type:String,default:``},title:{type:String,default:``}},computed:{tagText(){return this.title||`自定义组件`},label(){if(this.customClass)return this.customClass;let e=Object.keys(this.props||{});return e.length?e.join(`, `):`未指定 customClass`}}},Jf={class:`ce_custom_placeholder`},Yf={class:`ce_custom_placeholder_tag`},Xf={class:`ce_custom_placeholder_name`};function Zf(e,t,n,r,i,a){return z(),B(`div`,Jf,[H(`span`,Yf,j(a.tagText),1),H(`span`,Xf,j(a.label),1),$i(e.$slots,`default`)])}var Qf=Y(qf,[[`render`,Zf],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/CustomPlaceholder.vue`]]),$f=rn({el:null,id:null,visible:!1,top:0,left:0,width:0,height:0});function ep(e,t){$f.id!==t&&($f.el=e,$f.id=t,$f.visible=!0)}function tp(e){$f.id===e&&($f.el=null,$f.id=null,$f.visible=!1)}var np=new Set([``,`onReady`,`onLoad`,`onCreate`]);function rp(e){return np.has(e||``)}function ip(e){let t=String(e).replace(/-(\w)/g,(e,t)=>t.toUpperCase());return`on`+t.charAt(0).toUpperCase()+t.slice(1)}function ap(e){return typeof window<`u`&&window.CSS&&CSS.escape?CSS.escape(String(e)):String(e).replace(/["\\\]]/g,`\\$&`)}var op=Y({name:`RenderTree`,inject:[`adapter`,`cardRuntime`],props:{node:{type:Object,required:!0},scope:{type:Object,default:()=>({})},selectedNodeId:{type:String,default:``}},methods:{getChildNodes(e){let t=e.slots||[];return t.length&&t[0].components&&t[0].components.length?t[0].components:e.components||[]},actionCode(e){let t=e.action&&e.action.properties&&e.action.properties.function||{};return t.code||t.compiled||``},isVisible(e,t){let n=this.cardRuntime,r=e.directives&&e.directives[`v-show`];if(!r)return!0;let i=r.showType||`00`;if(i===`00`)return!0;let a=(r.condition||{}).expression;if(!a)return i===`01`;try{let e=Hf(a,t);return i===`01`?!!e:!e}catch(t){return n.pushError(`vshow`,`${e.className}: [${a}] -> ${t.message}`),i===`01`}},buildHandlers(e,t){this.cardRuntime;let n={};return(e.eventactions||[]).forEach(r=>{let i=(r.event||{}).eventKey||``;if(rp(i))return;let a=r.action||{},o=a.actionType;if(o===`customAction`){let a=this.actionCode(r);n[i]=n=>this.runCustomAction(a,t,n,e)}else n[i]=n=>this.runSystemAction(o,a.properties,t,n,e)}),n},runCustomAction(e,t,n,r){let i=this.cardRuntime,a={state:new Proxy(t,{set(e,t,n){return i.state[t]=n,!0}}),data:i.state,setData(e){e&&typeof e==`object`&&Object.assign(i.state,e),i.markDirty()},setRootData(e){e&&typeof e==`object`&&Object.assign(i.rootScope,e),i.markDirty()},addEventListener(e,t){i.addEventListener(e,t)},postMessage(e,t){i.postMessage(e,t)}},o={log:(...e)=>{console.log(...e),i.pushLog(`log`,e)},info:(...e)=>{console.info(...e),i.pushLog(`info`,e)},warn:(...e)=>{console.warn(...e),i.pushLog(`warn`,e)},error:(...e)=>{console.error(...e),i.pushLog(`error`,e)},debug:(...e)=>{console.debug(...e),i.pushLog(`debug`,e)}};try{Function(`event`,`console`,e||``).apply(a,[n,o])}catch(e){let t=r&&r.id?`${r.className}(${r.id})`:r.className;i.pushError(`customAction`,`${t}: ${e.message}`),console.error(`[customAction error]`,t,e)}},runSystemAction(e,t,n,r,i){let a=this.cardRuntime,o=typeof window<`u`?window.ynet:null;!o&&typeof window<`u`&&(o=window.ynet={callJSAPI(e,t,n){if(a.pushApiCall(e,t),typeof n==`function`)try{n({})}catch{}}});let s=t||{};e===`closeAlertCard`?o.callJSAPI(`closeAlertCard`,s,s&&s.callback):e===`sendAiChatMessage`?o.callJSAPI(`sendAiChatMessage`,{message:s&&s.message||``},void 0):o.callJSAPI(e,s,void 0),a.pushApiCall(e,s)},runLoadActions(){let e=this.cardRuntime,t=this.node;t.__loadRan||(t.__loadRan=!0,(t.eventactions||[]).forEach(n=>{if(!rp((n.event||{}).eventKey||``)||(n.action||{}).actionType!==`customAction`)return;let r=this.actionCode(n);r&&this.runCustomAction(r,Kf(e.state,this.scope),void 0,t)}))},renderNode(e){if(e.visible===!1)return null;let t=this.cardRuntime,n=Kf(t.state,this.scope);if(!this.isVisible(e,n))return null;let r=Bf(e.className);if(!r){let t=this.getChildNodes(e).map(e=>this.renderSub(e,n));return Hs(Qf,{customClass:e.className,title:`未知组件`},()=>t)}let i=Wf(e.properties||{},n,t.getBindingBuffer()),a=Wf(e.style&&e.style.properties||{},n,t.getBindingBuffer()),o=Object.assign({},i,{styleProps:a});o[`data-cid`]=e.componentId||e.id,o[`data-class`]=e.className,o[`data-id`]=e.id;let s=this.buildHandlers(e,n);for(let e in s)o[ip(e)]=s[e];if(e.className===`Input`&&!o.onInput){let n=(e.properties&&e.properties.__vars__||{}).value,r=/^\s*\$([A-Za-z_$][\w$]*)\s*$/.exec(String(n||``));if(r){let e=r[1];o.onInput=n=>{t.state[e]=n}}}if((e.className===`RadioButton`||e.className===`CheckGroup`)&&!o.onChange){let n=(e.properties&&e.properties.__vars__||{}).value,r=/^\s*\$([A-Za-z_$][\w$]*)\s*$/.exec(String(n||``));if(r){let e=r[1];o.onChange=n=>{t.state[e]=n,t.markDirty()}}}if(e.className===`ProgressSlider`){let n=(e.properties&&e.properties.__vars__||{}).value,r=/^\s*\$([A-Za-z_$][\w$]*)\s*$/.exec(String(n||``));if(r){let e=r[1],n=n=>{t.state[e]=n,t.markDirty()},i=o.onChange,a=o.onSelectChange;o.onChange=e=>{try{i&&i(e)}finally{n(e)}},o.onSelectChange=e=>{try{a&&a(e)}finally{n(e)}}}}let c=this.getChildNodes(e);return zf.has(e.className)?Hs(r,o,{default:e=>{let t=Gf(n,e.item,e.index);return c.map(e=>this.renderSub(e,t))}}):Hs(r,o,()=>c.map(e=>this.renderSub(e,n)))},renderSub(e,t){return Hs(op,{node:e,scope:t,selectedNodeId:this.selectedNodeId})},updateHighlight(){let e=this.$el;if(!e||e.nodeType!==1)return;let t=this.node.id;if(this.selectedNodeId&&t===this.selectedNodeId){let n=typeof document<`u`?document.querySelector(`.phone__screen`):null;ep((n?n.querySelector(`[data-id="`+ap(String(t))+`"]`):null)||e,t)}else tp(t)}},render(){return this.cardRuntime.revision,this.node.className===`Root`&&this.cardRuntime.startBindingPass(),this.renderNode(this.node)},created(){this.runLoadActions()},mounted(){this.runLoadActions(),this.$nextTick(()=>this.updateHighlight()),this.node.className===`Root`&&this.cardRuntime.commitBindingPass()},updated(){this.node.className===`Root`&&this.cardRuntime.commitBindingPass()},watch:{selectedNodeId(){this.updateHighlight()}}},[[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/RenderTree.vue`]]);async function sp(e){try{if(navigator.clipboard&&navigator.clipboard.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}var cp=rn({visible:!1,message:``,type:`ok`}),lp=null;function X(e,t=`ok`,n=2400){cp.message=e,cp.type=t,cp.visible=!0,lp&&clearTimeout(lp),lp=setTimeout(()=>{cp.visible=!1,lp=null},n)}var up={name:`ConfirmDialog`,props:{visible:{type:Boolean,default:!1},title:{type:String,default:``},message:{type:String,default:``},confirmText:{type:String,default:`继续`},cancelText:{type:String,default:`取消`},closeOnMask:{type:Boolean,default:!0},severity:{type:String,default:`primary`,validator:e=>[`primary`,`warn`,`danger`].includes(e)}},emits:[`confirm`,`cancel`],computed:{confirmBtnClass(){return this.severity===`danger`?`confirm-modal__btn--danger`:this.severity===`warn`?`confirm-modal__btn--warn`:`confirm-modal__btn--primary`}}},dp=[`aria-label`],fp={key:0,class:`confirm-modal__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},pp={key:1,class:`confirm-modal__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},mp={key:2,class:`confirm-modal__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},hp={class:`confirm-modal__desc`},gp={class:`confirm-modal__actions`};function _p(e,t,n,r,i,a){return z(),V(ac,{name:`modal`},{default:Rr(()=>[n.visible?(z(),B(`div`,{key:0,class:`confirm-mask`,onClick:t[2]||=K(t=>n.closeOnMask&&e.$emit(`cancel`),[`self`])},[H(`div`,{class:`confirm-modal modal-card`,role:`alertdialog`,"aria-modal":`true`,"aria-label":n.title},[H(`div`,{class:A([`confirm-modal__title`,{"is-danger":n.severity===`danger`,"is-warn":n.severity===`warn`}])},[n.severity===`danger`?(z(),B(`svg`,fp,[...t[3]||=[H(`use`,{href:`#icon-no-entry`},null,-1)]])):n.severity===`warn`?(z(),B(`svg`,pp,[...t[4]||=[H(`use`,{href:`#icon-alert-triangle`},null,-1)]])):(z(),B(`svg`,mp,[...t[5]||=[H(`use`,{href:`#icon-gear`},null,-1)]])),W(` `+j(n.title),1)],2),H(`div`,hp,j(n.message),1),H(`div`,gp,[H(`button`,{class:`confirm-modal__btn confirm-modal__btn--ghost`,type:`button`,onClick:t[0]||=t=>e.$emit(`cancel`)},j(n.cancelText),1),H(`button`,{class:A([`confirm-modal__btn`,a.confirmBtnClass]),type:`button`,onClick:t[1]||=t=>e.$emit(`confirm`)},j(n.confirmText),3)])],8,dp)])):G(`v-if`,!0)]),_:1})}var vp=Y(up,[[`render`,_p],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ConfirmDialog.vue`]]),yp=rn({openAll:null,selectedPath:null});function bp(e,t,n){let r=e;for(let e=0;e<t.length-1;e++)r=r[t[e]];r[t[t.length-1]]=n}function xp(e,t){let n=e;for(let e=0;e<t.length-1;e++)n=n[t[e]];delete n[t[t.length-1]]}function Sp(e,t,n,r){if(!r||r===n)return!1;let i=e;for(let e=0;e<t.length;e++)i=i[t[e]];if(r in i)return!1;let a=i[n];return delete i[n],i[r]=a,!0}function Cp(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}var wp={name:`JsonTree`,components:{ConfirmDialog:vp},props:{data:{type:[Object,Array],default:()=>({})},depth:{type:Number,default:0},rt:{type:Object,default:null},path:{type:Array,default:()=>[]},editable:{type:Boolean,default:!1},schema:{type:Object,default:null}},data(){return{localOpen:{},editingKey:null,editingValue:null,editingComplex:null,jsonEditText:``,ctxMenu:{visible:!1,x:0,y:0,item:null},delConfirm:{show:!1,message:``,item:null}}},computed:{isRoot(){return this.depth===0},entries(){let e=this.data;return Array.isArray(e)?e.map((e,t)=>this.makeEntry(String(t),e,!0,t)):e&&typeof e==`object`?Object.keys(e).map(t=>this.makeEntry(t,e[t],!1,t)):[]}},watch:{data(){this.initOpen(),this.isRoot&&(yp.selectedPath=null)}},created(){this.isRoot&&(yp.openAll=null),this.initOpen()},methods:{makeEntry(e,t,n,r){let i=Array.isArray(t),a=i?t.length:Object.keys(t||{}).length;return{key:String(r),keyLabel:e,value:t,isArrayBranch:n,isArray:i,count:a,type:this.valueType(t),path:[...this.path,r]}},valueType(e){return e===null?`null`:Array.isArray(e)?`array`:typeof e},isComplex(e){return typeof e==`object`&&!!e},initOpen(){let e={};this.entries.forEach(t=>{e[t.key]=this.depth<2}),this.localOpen=e},isOpen(e){return yp.openAll===null?!!this.localOpen[e]:yp.openAll},toggle(e){let t=!this.isOpen(e);this.localOpen[e]=t,yp.openAll=null},isSelected(e){let t=yp.selectedPath;return!t||t.length!==e.path.length?!1:t.every((t,n)=>String(t)===String(e.path[n]))},selectNode(e){yp.selectedPath=this.isSelected(e)?null:e.path.slice()},onBranchClick(e){this.toggle(e.key),yp.selectedPath=e.path.slice()},setOpen(e){yp.openAll=e},previewText(e){if(Array.isArray(e))return` … `+e.length+` 项`;let t=Object.keys(e);return` … `+t.slice(0,3).join(`, `)+(t.length>3?`, …`:``)+` `},formatPrimitive(e,t){return e===null?`null`:t===`string`?JSON.stringify(e):String(e)},formatForEdit(e,t){return e===null?`null`:t===`string`?e:String(e)},startEditKey(e){this.cancelEdit(),this.editingKey=e.key,this.$nextTick(()=>{let e=this.$refs.keyInput;if(e){let t=Array.isArray(e)?e[0]:e;t.focus(),t.select()}})},confirmEditKey(e,t){let n=t.target.value.trim();if(!n||n===e.keyLabel){this.cancelEdit();return}if(this.rt&&this.rt.rootScope){let t=e.path.slice(0,-1),r=e.path[e.path.length-1];if(!Sp(this.rt.rootScope,t,r,n)){this.cancelEdit();return}this.rt.markDirty()}this.editingKey=null},startEditValue(e){this.cancelEdit(),this.editingValue=e.key,this.$nextTick(()=>{let e=this.$refs.valInput;if(e){let t=Array.isArray(e)?e[0]:e;t.focus(),t.select()}})},confirmEditValue(e,t){let n=t.target.value,r=n;if(e.type===`number`){let e=Number(n);isNaN(e)||(r=e)}else if(e.type===`boolean`)n===`true`?r=!0:n===`false`&&(r=!1);else if(e.type===`null`)r=n===`null`?null:n;else if(e.type===`string`)r=n;else try{r=JSON.parse(n)}catch{}this.rt&&this.rt.rootScope&&(bp(this.rt.rootScope,e.path,r),this.rt.markDirty()),this.editingValue=null},startEditComplex(e){this.cancelEdit(),this.editingComplex=e.key,this.jsonEditText=JSON.stringify(e.value,null,2),this.$nextTick(()=>{let e=this.$refs.jsonInput;if(e){let t=Array.isArray(e)?e[0]:e;t.focus(),t.select()}})},confirmEditComplex(e){try{let t=JSON.parse(this.jsonEditText);this.rt&&this.rt.rootScope&&(bp(this.rt.rootScope,e.path,t),this.rt.markDirty()),this.cancelEdit()}catch(e){alert(`JSON 解析失败: `+e.message)}},cancelEdit(){this.editingKey=null,this.editingValue=null,this.editingComplex=null,this.jsonEditText=``},deleteNode(e){this.rt&&this.rt.rootScope&&(xp(this.rt.rootScope,e.path),this.rt.markDirty())},addChild(){if(!this.rt||!this.rt.rootScope)return;let e=this.rt.rootScope,t=yp.selectedPath;if(t&&t.length){let n=Cp(this.rt.rootScope,t);typeof n==`object`&&n&&(e=n)}if(Array.isArray(e))e.push(``),this.rt.markDirty();else if(e&&typeof e==`object`){let t=`newKey`,n=1;for(;t in e;)t=`newKey`+(n>1?n:``),n++;e[t]=``,this.rt.markDirty()}},showContextMenu(e,t){this.ctxMenu.visible=!0,this.ctxMenu.x=t.clientX,this.ctxMenu.y=t.clientY,this.ctxMenu.item=e},hideContextMenu(){this.ctxMenu.visible=!1,this.ctxMenu.item=null},ctxCopyPath(){let e=this.ctxMenu.item;if(this.hideContextMenu(),!e)return;let t=this.formatKeyPath(e.path);sp(t).then(e=>{e?X(`已复制路径:${t}`,`ok`):X(`复制失败,请手动复制`,`err`)})},formatKeyPath(e){let t=``;for(let n of e)typeof n==`number`||/^\d+$/.test(String(n))?t+=`[${n}]`:t+=t?`.${n}`:`${n}`;return t},ctxDelete(){let e=this.ctxMenu.item;if(this.hideContextMenu(),e){if(this.isNodeReferenced(e.path)){let t=e.path.join(`.`);this.delConfirm.message=`节点 “${t}” 在 schema 中被引用,删除后可能导致渲染异常。\n\n确定要删除吗?`,this.delConfirm.item=e,this.delConfirm.show=!0;return}this.deleteNode(e)}},onDelConfirm(){let e=this.delConfirm.item;this.delConfirm.show=!1,this.delConfirm.item=null,e&&this.deleteNode(e)},onDelCancel(){this.delConfirm.show=!1,this.delConfirm.item=null},isNodeReferenced(e){if(!this.schema)return!1;let t=JSON.stringify(this.schema);for(let n=0;n<e.length;n++){let r=e.slice(0,n+1).join(`.`),i=e[n];if(t.includes(`$`+i)||t.includes(`$`+r)||t.includes(`state.`+i)||t.includes(`state.`+r)||RegExp(`\\b`+this.escapeRegex(i)+`\\b`).test(t))return!0}return!1},escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}}},Tp={class:`jt`},Ep={key:0,class:`jt__toolbar`},Dp=[`onClick`,`onContextmenu`],Op=[`onDblclick`],kp=[`value`,`onKeydown`,`onBlur`],Ap=[`onDblclick`],jp=[`onDblclick`],Mp=[`value`,`onKeydown`],Np={class:`jt__json-actions`},Pp=[`onClick`],Fp={key:2,class:`jt__row jt__row--close`},Ip={class:`jt__bracket`},Lp={class:`jt__count`},Rp=[`onClick`,`onContextmenu`],zp=[`onDblclick`],Bp=[`value`,`onKeydown`,`onBlur`],Vp={key:1,class:`jt__key`},Hp={key:2,class:`jt__colon`},Up=[`onDblclick`],Wp=[`value`,`onKeydown`,`onBlur`],Gp=[`onClick`];function Kp(e,t,n,r,i,a){let o=I(`JsonTree`,!0),s=I(`ConfirmDialog`);return z(),B(`div`,Tp,[G(` 仅根节点、且可编辑时显示批量控制条(运行态面板为只读,不需要工具栏) `),a.isRoot&&n.editable?(z(),B(`div`,Ep,[H(`button`,{class:`jt__tool`,type:`button`,onClick:t[0]||=e=>a.setOpen(!0)},`全部展开`),H(`button`,{class:`jt__tool`,type:`button`,onClick:t[1]||=e=>a.setOpen(!1)},`全部折叠`),H(`button`,{class:`jt__tool jt__tool--add`,type:`button`,onClick:t[2]||=(...e)=>a.addChild&&a.addChild(...e),title:`添加子节点`},`+ 添加`)])):G(`v-if`,!0),H(`ul`,{class:A([`jt__list`,{"jt__list--root":a.isRoot}])},[(z(!0),B(R,null,L(a.entries,(e,r)=>(z(),B(`li`,{key:r,class:`jt__node`},[G(` 复合类型(对象 / 数组):可折叠 `),a.isComplex(e.value)?(z(),B(R,{key:0},[H(`div`,{class:A([`jt__row jt__row--branch`,{"jt__row--selected":a.isSelected(e)}]),onClick:t=>a.onBranchClick(e),onContextmenu:K(t=>a.showContextMenu(e,t),[`prevent`])},[H(`span`,{class:A([`jt__caret`,{"jt__caret--open":a.isOpen(e.key)}])},`▶`,2),e.isArrayBranch?G(`v-if`,!0):(z(),B(`span`,{key:0,class:`jt__key jt__editable`,onDblclick:K(t=>a.startEditKey(e),[`stop`])},[i.editingKey===e.key?(z(),B(`input`,{key:0,ref_for:!0,ref:`keyInput`,class:`jt__edit`,value:e.keyLabel,onKeydown:[yl(t=>a.confirmEditKey(e,t),[`enter`]),t[3]||=yl((...e)=>a.cancelEdit&&a.cancelEdit(...e),[`escape`])],onBlur:t=>a.confirmEditKey(e,t)},null,40,kp)):(z(),B(R,{key:1},[W(j(e.keyLabel),1)],64))],40,Op)),H(`span`,{class:`jt__bracket jt__editable`,onDblclick:K(t=>n.editable&&a.startEditComplex(e),[`stop`])},j(e.isArrayBranch?`[`:`{`),41,Ap),a.isOpen(e.key)?G(`v-if`,!0):(z(),B(`span`,{key:1,class:`jt__preview jt__editable`,onDblclick:K(t=>n.editable&&a.startEditComplex(e),[`stop`])},j(a.previewText(e.value)),41,jp))],42,Dp),G(` 复合类型整体编辑弹层 `),i.editingComplex===e.key?(z(),B(`div`,{key:0,class:`jt__json-edit`,onClick:t[7]||=K(()=>{},[`stop`])},[H(`textarea`,{ref_for:!0,ref:`jsonInput`,class:`jt__json-textarea`,value:i.jsonEditText,onInput:t[4]||=e=>i.jsonEditText=e.target.value,onKeydown:[t[5]||=yl((...e)=>a.cancelEdit&&a.cancelEdit(...e),[`escape`]),yl(K(t=>a.confirmEditComplex(e),[`ctrl`]),[`enter`]),yl(K(t=>a.confirmEditComplex(e),[`meta`]),[`enter`])]},null,40,Mp),H(`div`,Np,[H(`button`,{type:`button`,class:`jt__json-btn`,onClick:t=>a.confirmEditComplex(e)},`确定`,8,Pp),H(`button`,{type:`button`,class:`jt__json-btn jt__json-btn--cancel`,onClick:t[6]||=(...e)=>a.cancelEdit&&a.cancelEdit(...e)},`取消`),t[15]||=H(`span`,{class:`jt__json-hint`},`Ctrl+Enter 确认 · Esc 取消`,-1)])])):G(`v-if`,!0),a.isOpen(e.key)?(z(),V(o,{key:1,class:`jt__child`,data:e.value,depth:n.depth+1,rt:n.rt,path:e.path,editable:n.editable},null,8,[`data`,`depth`,`rt`,`path`,`editable`])):G(`v-if`,!0),a.isOpen(e.key)?(z(),B(`div`,Fp,[H(`span`,Ip,j(e.isArrayBranch?`]`:`}`),1),H(`span`,Lp,j(e.count)+` `+j(e.isArrayBranch?`项`:`键`),1)])):G(`v-if`,!0)],64)):(z(),B(R,{key:1},[G(` 基础类型:叶子 `),H(`div`,{class:A([`jt__row jt__row--leaf`,{"jt__row--selected":a.isSelected(e)}]),onClick:t=>a.selectNode(e),onContextmenu:K(t=>a.showContextMenu(e,t),[`prevent`])},[t[16]||=H(`span`,{class:`jt__caret jt__caret--leaf`},null,-1),e.keyLabel!==null&&n.editable?(z(),B(`span`,{key:0,class:`jt__key jt__editable`,onDblclick:K(t=>a.startEditKey(e),[`stop`])},[i.editingKey===e.key?(z(),B(`input`,{key:0,ref_for:!0,ref:`keyInput`,class:`jt__edit`,value:e.keyLabel,onKeydown:[yl(t=>a.confirmEditKey(e,t),[`enter`]),t[8]||=yl((...e)=>a.cancelEdit&&a.cancelEdit(...e),[`escape`])],onBlur:t=>a.confirmEditKey(e,t)},null,40,Bp)):(z(),B(R,{key:1},[W(j(e.keyLabel),1)],64))],40,zp)):G(`v-if`,!0),e.keyLabel!==null&&!n.editable?(z(),B(`span`,Vp,j(e.keyLabel),1)):G(`v-if`,!0),e.keyLabel===null?G(`v-if`,!0):(z(),B(`span`,Hp,`:`)),H(`span`,{class:A([`jt__val`,[`jt__val--`+e.type,{jt__editable:n.editable}]]),onDblclick:K(t=>n.editable&&a.startEditValue(e),[`stop`])},[i.editingValue===e.key?(z(),B(`input`,{key:0,ref_for:!0,ref:`valInput`,class:`jt__edit`,value:a.formatForEdit(e.value,e.type),onKeydown:[yl(t=>a.confirmEditValue(e,t),[`enter`]),t[9]||=yl((...e)=>a.cancelEdit&&a.cancelEdit(...e),[`escape`])],onBlur:t=>a.confirmEditValue(e,t)},null,40,Wp)):(z(),B(R,{key:1},[W(j(a.formatPrimitive(e.value,e.type)),1)],64))],42,Up),n.editable?(z(),B(`button`,{key:3,class:`jt__del`,type:`button`,onClick:K(t=>a.deleteNode(e),[`stop`]),title:`删除节点`},`×`,8,Gp)):G(`v-if`,!0)],42,Rp)],2112))]))),128))],2),G(` 右键菜单(fixed 定位,全局可见) `),i.ctxMenu.visible?(z(),B(`div`,{key:1,class:`jt__ctxmenu`,style:k({left:i.ctxMenu.x+`px`,top:i.ctxMenu.y+`px`}),onClick:t[12]||=K(()=>{},[`stop`])},[H(`button`,{class:`jt__ctxmenu-item`,type:`button`,onClick:t[10]||=(...e)=>a.ctxCopyPath&&a.ctxCopyPath(...e)},`复制路径`),G(` 删除节点仅在可编辑(绑定数据 tab)时提供;只读树(如运行态面板)只保留复制路径 `),n.editable?(z(),B(`button`,{key:0,class:`jt__ctxmenu-item jt__ctxmenu-item--del`,type:`button`,onClick:t[11]||=(...e)=>a.ctxDelete&&a.ctxDelete(...e)},`删除节点`)):G(`v-if`,!0)],4)):G(`v-if`,!0),i.ctxMenu.visible?(z(),B(`div`,{key:2,class:`jt__ctxmenu-mask`,onClick:t[13]||=(...e)=>a.hideContextMenu&&a.hideContextMenu(...e),onContextmenu:t[14]||=K((...e)=>a.hideContextMenu&&a.hideContextMenu(...e),[`prevent`])},null,32)):G(`v-if`,!0),G(` 删除被引用节点的二次确认:警告级(橙黄+警告三角),分级见 design/深浅主题配色规范手册.md §3.4 `),U(s,{visible:i.delConfirm.show,title:`删除被引用节点`,message:i.delConfirm.message,"confirm-text":`删除`,severity:`warn`,onConfirm:a.onDelConfirm,onCancel:a.onDelCancel},null,8,[`visible`,`message`,`onConfirm`,`onCancel`])])}var qp=Y(wp,[[`render`,Kp],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/JsonTree.vue`]]),Jp=300;function Yp(e){return typeof e==`object`&&!!e}function Xp(e){if(Array.isArray(e))return e.length?`[ … ${e.length} 项 ]`:`[]`;let t=Object.keys(e).length;return t?`{ … ${t} 键 }`:`{}`}function Zp(e){let t=Yp(e);return{val:e,complex:t,type:t?Array.isArray(e)?`array`:`object`:e===null?`null`:typeof e,preview:t?Xp(e):null}}function Qp(e){try{return JSON.stringify(e)}catch{return String(e)}}function $p(e,t,n,r,i,a,o,s,c){return{key:e,isIndex:t,path:n,id:n.join(`\0`),depth:r,kind:i,left:a,right:o,isBranch:s,children:c||null,dirtyCount:0}}function em(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>new Uint16Array(r+1));for(let a=n-1;a>=0;a--)for(let n=r-1;n>=0;n--)i[a][n]=e[a]===t[n]?i[a+1][n+1]+1:Math.max(i[a+1][n],i[a][n+1]);let a=[],o=0,s=0;for(;o<n&&s<r;)e[o]===t[s]?(a.push([`pair`,o,s]),o++,s++):i[o+1][s]>=i[o][s+1]?(a.push([`del`,o]),o++):(a.push([`ins`,s]),s++);for(;o<n;)a.push([`del`,o++]);for(;s<r;)a.push([`ins`,s++]);return a}function tm(e,t){let n=e.length,r=t.length;if(n>Jp||r>Jp){let e=[],t=Math.min(n,r);for(let n=0;n<t;n++)e.push([`pair`,n,n]);for(let r=t;r<n;r++)e.push([`del`,r]);for(let n=t;n<r;n++)e.push([`ins`,n]);return e}return em(e.map(Qp),t.map(Qp))}function nm(e,t){let n=[],r=new Map(t.map((e,t)=>[e,t])),i=new Set(e),a=0;for(let o of e)if(r.has(o)){let e=r.get(o);for(;a<e;)i.has(t[a])||n.push([`right-only`,t[a]]),a++;n.push([`pair`,o]),a=e+1}else n.push([`left-only`,o]);for(;a<t.length;)i.has(t[a])||n.push([`right-only`,t[a]]),a++;return n}function rm(e,t,n,r,i,a,o){let s=a===`left`?Zp(i):null,c=a===`right`?Zp(i):null;if(!Yp(i)){o[r]++;let i=$p(e,typeof e==`number`,t,n,r,s,c,!1,null);return i.dirtyCount=1,i}let l=Array.isArray(i)?i.map((e,i)=>rm(i,[...t,i],n+1,r,e,a,o)):Object.keys(i).map(e=>rm(e,[...t,e],n+1,r,i[e],a,o)),u=$p(e,typeof e==`number`,t,n,r,s,c,!0,l);return u.dirtyCount=l.reduce((e,t)=>e+t.dirtyCount,0),u}function im(e,t,n,r,i,a,o,s){if(r&&a){let r=Yp(i),a=Yp(o);if(r&&a&&Array.isArray(i)===Array.isArray(o)){let r=am(i,o,t,n,s),a=$p(e,typeof e==`number`,t,n,`branch`,Zp(i),Zp(o),!0,r);return a.dirtyCount=r.reduce((e,t)=>e+t.dirtyCount,0),a}let c=!r&&!a&&Object.is(i,o);c||s.changed++;let l=$p(e,typeof e==`number`,t,n,c?`same`:`changed`,Zp(i),Zp(o),!1,null);return l.dirtyCount=+!c,l}return r?rm(e,t,n,`added`,i,`left`,s):rm(e,t,n,`removed`,o,`right`,s)}function am(e,t,n,r,i){return Array.isArray(e)?tm(e,t).map(a=>a[0]===`pair`?im(a[1],[...n,a[1]],r+1,!0,e[a[1]],!0,t[a[2]],i):a[0]===`del`?im(a[1],[...n,a[1]],r+1,!0,e[a[1]],!1,void 0,i):im(a[2],[...n,a[2]],r+1,!1,void 0,!0,t[a[2]],i)):nm(Object.keys(e),Object.keys(t)).map(a=>{let o=a[1];return a[0]===`pair`?im(o,[...n,o],r+1,!0,e[o],!0,t[o],i):a[0]===`left-only`?im(o,[...n,o],r+1,!0,e[o],!1,void 0,i):im(o,[...n,o],r+1,!1,void 0,!0,t[o],i)})}function om(e,t){let n={changed:0,added:0,removed:0};return{tree:im(``,[],0,!0,e??{},!0,t??{},n),stats:n,total:n.changed+n.added+n.removed}}var sm={name:`StateDiffPanel`,props:{rt:{type:Object,required:!0},cardId:{type:String,default:``}},data(){return{overrides:{}}},computed:{diff(){return om(this.rt.state,this.rt.rootScope)},rows(){let e=[],t=n=>{for(let r of n)e.push(r),r.isBranch&&r.children&&this.isOpen(r)&&t(r.children)},n=this.diff.tree;return n.children&&t(n.children),e}},watch:{cardId(){this.overrides={}}},methods:{isOpen(e){return e.id in this.overrides?this.overrides[e.id]:!e.isBranch||e.kind===`added`||e.kind===`removed`?!1:e.dirtyCount>0},toggle(e){this.overrides={...this.overrides,[e.id]:!this.isOpen(e)}},cellIndent(e){return 12+e.depth*14+`px`},fmt(e){return e.val===null?`null`:e.val===void 0?`undefined`:e.type===`string`?JSON.stringify(e.val):String(e.val)},badgeClass(e){return e.kind===`added`?`sdp__badge--add`:e.kind===`removed`?`sdp__badge--del`:`sdp__badge--mod`},badgeText(e){return e.kind===`added`?`新增`:e.kind===`removed`?`已移除`:e.dirtyCount+` 处变化`},rowTitle(e){if(!e.isBranch){if(e.kind===`changed`){let t=[];return e.left&&t.push(`当前 `+this.fmt(e.left)),e.right&&t.push(`基线 `+this.fmt(e.right)),t.join(` · `)}return``}let t=e.isIndex?`[${e.key}]`:e.key;return e.kind===`added`?`${t}:运行期新增(基线中无此字段)`:e.kind===`removed`?`${t}:基线中被移除(当前运行态无此字段)`:e.dirtyCount?`${t}:子树含 ${e.dirtyCount} 处与基线不同,点击${this.isOpen(e)?`折叠`:`展开`}`:`${t}:与基线一致,点击${this.isOpen(e)?`折叠`:`展开`}`}}},cm={class:`sdp`},lm={class:`sdp__cols`},um={class:`sdp__colhead sdp__colhead--base`},dm=[`title`],fm={class:`sdp__body`},pm={key:0,class:`empty-state`},mm=[`title`,`onClick`],hm={key:1,class:`sdp__colon`},gm={key:3,class:`sdp__preview`},_m={key:1,class:`sdp__empty`},vm={key:1,class:`sdp__colon`},ym={key:3,class:`sdp__preview`},bm={key:1,class:`sdp__empty`};function xm(e,t,n,r,i,a){return z(),B(`div`,cm,[H(`div`,lm,[t[1]||=H(`div`,{class:`sdp__colhead`},[W(`当前 · 运行态 `),H(`code`,null,`state`)],-1),H(`div`,um,[t[0]||=H(`span`,null,[W(`基线 · 绑定数据 `),H(`code`,null,`rootScope`)],-1),H(`span`,{class:A([`sdp__count`,{"is-zero":!a.diff.total}]),title:a.diff.total?`相对绑定数据基线:修改 ${a.diff.stats.changed} · 新增 ${a.diff.stats.added} · 删除 ${a.diff.stats.removed}`:`运行态与绑定数据基线一致`},j(a.diff.total?a.diff.total+` 处差异`:`一致`),11,dm)])]),H(`div`,fm,[G(` 完全一致空态(total=0 才显示):与调试面板其它 tab 同款 empty-state 语言 `),a.diff.total?(z(!0),B(R,{key:1},L(a.rows,e=>(z(),B(`div`,{key:e.id,class:A([`sdp__row`,[`sdp__row--`+e.kind,{"sdp__row--branch":e.isBranch}]]),title:a.rowTitle(e),onClick:t=>e.isBranch&&a.toggle(e)},[G(` 左格:当前值(removed 行空占位) `),H(`div`,{class:`sdp__cell`,style:k({paddingLeft:a.cellIndent(e)})},[e.left?(z(),B(R,{key:0},[e.isBranch?(z(),B(`span`,{key:0,class:A([`sdp__caret`,{"sdp__caret--open":a.isOpen(e)}])},`▶`,2)):G(`v-if`,!0),H(`span`,{class:A([`sdp__key`,{sdp__idx:e.isIndex}])},j(e.isIndex?`[`+e.key+`]`:e.key),3),!e.isBranch||!a.isOpen(e)?(z(),B(`span`,hm,`:`)):G(`v-if`,!0),e.isBranch?a.isOpen(e)?G(`v-if`,!0):(z(),B(`span`,gm,j(e.left.preview),1)):(z(),B(`span`,{key:2,class:A([`sdp__val`,`sdp__val--`+e.left.type])},j(a.fmt(e.left)),3)),G(` 概览徽标:仅新增 / 删除子树或确有变化的折叠分支显示,一致分支不给「0 处变化」噪音 `),e.isBranch&&!a.isOpen(e)&&(e.kind===`added`||e.kind===`removed`||e.dirtyCount>0)?(z(),B(`span`,{key:4,class:A([`sdp__badge`,a.badgeClass(e)])},j(a.badgeText(e)),3)):G(`v-if`,!0)],64)):(z(),B(`span`,_m,`—`))],4),G(` 右格:基线值(added 行空占位) `),H(`div`,{class:`sdp__cell sdp__cell--r`,style:k({paddingLeft:a.cellIndent(e)})},[e.right?(z(),B(R,{key:0},[e.isBranch?(z(),B(`span`,{key:0,class:A([`sdp__caret sdp__caret--ghost`,{"sdp__caret--open":a.isOpen(e)}])},`▶`,2)):G(`v-if`,!0),H(`span`,{class:A([`sdp__key`,{sdp__idx:e.isIndex}])},j(e.isIndex?`[`+e.key+`]`:e.key),3),!e.isBranch||!a.isOpen(e)?(z(),B(`span`,vm,`:`)):G(`v-if`,!0),e.isBranch?a.isOpen(e)?G(`v-if`,!0):(z(),B(`span`,ym,j(e.right.preview),1)):(z(),B(`span`,{key:2,class:A([`sdp__val`,`sdp__val--`+e.right.type])},j(a.fmt(e.right)),3))],64)):(z(),B(`span`,bm,`—`))],4)],10,mm))),128)):(z(),B(`div`,pm,[...t[2]||=[os(`<span class="empty-state__badge" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-check"></use></svg></span><p class="sdp__clean">运行态与绑定数据基线一致</p><p class="empty-state__hint">交互改变 state 后,差异将在此按行对比显示</p>`,3)]]))])])}var Sm=Y(sm,[[`render`,xm],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/StateDiffPanel.vue`]]);function Cm(){return Hs(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[Hs(`circle`,{cx:`12`,cy:`12`,r:`3`}),Hs(`path`,{d:`M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z`})])}function wm(){let e=(e,t)=>Hs(`circle`,{cx:e,cy:t,r:`1.4`});return Hs(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`currentColor`},[e(3,2.5),e(9,2.5),e(3,6),e(9,6),e(3,9.5),e(9,9.5)])}var Tm={name:`TreeNode`,props:{comp:{type:Object,required:!0},openState:{type:Object,required:!0},compNames:{type:Object,required:!0},selectedNodeId:{type:String,default:``},draggingId:{type:String,default:``},dropTarget:{type:Object,default:()=>({compId:null,type:null})},query:{type:String,default:``}},methods:{hasChildren(e){return(e.slots||[]).some(e=>(e.components||[]).length>0)},nodeMatches(e,t){if(!t)return!1;let n=(this.compNames[e.className]||e.className).toLowerCase(),r=String(e.componentId==null?``:e.componentId).toLowerCase(),i=String(e.className||``).toLowerCase();return n.indexOf(t)!==-1||r.indexOf(t)!==-1||i.indexOf(t)!==-1},subtreeMatches(e,t){if(!t||this.nodeMatches(e,t))return!0;if(!e.slots)return!1;for(let n of e.slots)if(n.components){for(let e of n.components)if(this.subtreeMatches(e,t))return!0}return!1},isContainer(e){let t=yu[e];return!!(t&&t.slots&&t.slots.length)},onRowClick(e,t){e.stopPropagation(),this.$emit(`select-node`,t.id)},onRowDblclick(e,t){e.stopPropagation(),e.preventDefault(),this.$emit(`inspect`,t)},onRowHover(e){this.$emit(`hover-node`,{componentId:e&&e.componentId,id:e&&e.id})},onRowLeave(e){this.$emit(`hover-node`,{componentId:e&&e.componentId,id:e&&e.id,leave:!0})},onDragStart(e,t){e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t.componentId)),this.$emit(`drag-start`,t.componentId)},onDragEnd(){this.$emit(`drag-end`)},onDragOver(e,t){if(!this.draggingId||this.draggingId===t.componentId){this.clearDrop();return}e.preventDefault();let n=e.currentTarget.getBoundingClientRect(),r=e.clientY-n.top,i=n.height,a=this.isContainer(t.className),o;o=a?r<i*.25?`before`:r>i*.75?`after`:`inside`:r<i/2?`before`:`after`,this.isDescendantOf(this.draggingId,t)&&(o=`blocked`),e.dataTransfer.dropEffect=o===`blocked`?`none`:`move`,o===`inside`&&this.openState[t.id]===!1&&!this._expandTimer&&(this._expandTimer=setTimeout(()=>{this.$emit(`toggle`,t.id),this._expandTimer=null},450)),this.$emit(`drag-over`,{compId:t.componentId,type:o})},onDragLeave(e){e.relatedTarget&&e.currentTarget.contains(e.relatedTarget)||this.clearDrop()},onDrop(e,t){e.preventDefault(),this._expandTimer&&=(clearTimeout(this._expandTimer),null);let n=e.dataTransfer&&e.dataTransfer.getData(`text/plain`);if(this.clearDrop(),!n||n===t.componentId)return;let r=e.currentTarget.getBoundingClientRect(),i=e.clientY-r.top,a=r.height,o=this.isContainer(t.className),s;s=o?i<a*.25?`before`:i>a*.75?`after`:`inside`:i<a/2?`before`:`after`,!this.isDescendantOf(n,t)&&this.$emit(`move-node`,{sourceCompId:n,targetCompId:t.componentId,position:s})},isDescendantOf(e,t){if(!t)return!1;let n=[];if(t.components&&n.push(...t.components),t.slots)for(let e of t.slots)e.components&&n.push(...e.components);for(let t of n)if(t.componentId===e||this.isDescendantOf(e,t))return!0;return!1},dropClass(e){let t=this.dropTarget;return!t||t.compId!==e?``:t.type===`blocked`?`st__row--drop-blocked`:t.type===`before`?`st__row--drop-before`:t.type===`after`?`st__row--drop-after`:t.type===`inside`?`st__row--drop-inside`:``},clearDrop(){this._expandTimer&&=(clearTimeout(this._expandTimer),null),this.$emit(`drag-over`,{compId:null,type:null})}},render(){let e=this.comp;if(this.query&&!this.subtreeMatches(e,this.query))return null;let t=this.hasChildren(e),n=!!this.query||this.openState[e.id]!==!1,r=this.compNames[e.className]||e.className,i=!!(this.query&&this.nodeMatches(e,this.query)),a=[],o=[];t?o.push(Hs(`span`,{class:[`st__caret`,{"st__caret--open":n}],onClick:t=>{t.stopPropagation(),this.$emit(`toggle`,e.id)}},`▸`)):o.push(Hs(`span`,{class:`st__caret st__caret--leaf`})),o.push(Hs(`span`,{class:[`st__label`,{"st__label--hl":i}]},r)),o.push(Hs(`span`,{class:`st__id`},`【`+e.componentId+`】`));{let t=!!(e.eventactions&&e.eventactions.length);o.push(Hs(`span`,{class:[`st__badge`,t?`st__badge--clickable`:`st__badge--muted`],onClick:t=>{t.stopPropagation(),this.$emit(`edit-event`,e)}},`事件`))}if(o.push(Hs(`button`,{class:`st__gear`,type:`button`,title:`编辑节点属性`,onClick:t=>{t.stopPropagation(),this.$emit(`inspect`,e)}},[Cm()])),o.unshift(Hs(`span`,{class:`st__handle`,title:`拖拽以调整位置或嵌套关系`},[wm()])),a.push(Hs(`div`,{class:[`st__row`,{"st__row--selected":this.selectedNodeId===e.id,"st__row--dragging":this.draggingId===e.componentId},this.dropClass(e.componentId)],title:`单击选中节点;双击打开节点设置;拖拽调整位置/嵌套`,draggable:`true`,"data-comp-id":e.componentId,"data-is-container":this.isContainer(e.className)?`true`:`false`,onClick:t=>this.onRowClick(t,e),onDblclick:t=>this.onRowDblclick(t,e),onDragstart:t=>this.onDragStart(t,e),onDragend:e=>this.onDragEnd(e),onDragover:t=>this.onDragOver(t,e),onDragleave:e=>this.onDragLeave(e),onDrop:t=>this.onDrop(t,e),onMouseenter:()=>this.onRowHover(e),onMouseleave:()=>this.onRowLeave(e),onContextmenu:t=>{t.preventDefault(),t.stopPropagation(),this.$emit(`context-menu`,e,t)}},o)),t){let t=[];for(let n of e.slots||[])for(let e of n.components||[])this.query&&!this.subtreeMatches(e,this.query)||t.push(Hs(Tm,{key:e.id,comp:e,openState:this.openState,compNames:this.compNames,selectedNodeId:this.selectedNodeId,draggingId:this.draggingId,dropTarget:this.dropTarget,query:this.query,onToggle:e=>this.$emit(`toggle`,e),onSelectNode:e=>this.$emit(`select-node`,e),onEditEvent:e=>this.$emit(`edit-event`,e),onInspect:e=>this.$emit(`inspect`,e),onDragStart:e=>this.$emit(`drag-start`,e),onDragEnd:()=>this.$emit(`drag-end`),onDragOver:e=>this.$emit(`drag-over`,e),onMoveNode:e=>this.$emit(`move-node`,e),onHoverNode:e=>this.$emit(`hover-node`,e),onContextMenu:(e,t)=>this.$emit(`context-menu`,e,t)}));t.length&&a.push(Hs(`ul`,{class:`st__children`,style:n?``:`display: none;`},t))}return Hs(`li`,{class:`st__node`},a)}},Em={name:`StructureTree`,components:{TreeNode:Tm},props:{preview:{type:Object,default:null},schema:{type:Object,default:null},cardCode:{type:String,default:``},selectedNodeId:{type:String,default:``},moveCollapseToken:{type:Number,default:0},canPaste:{type:Boolean,default:!1}},data(){return{openState:{},draggingId:``,dropTarget:{compId:null,type:null},query:``,locateEnabled:!1,contextMenu:{visible:!1,x:0,y:0,nodeId:``,node:null},helpOpen:!1,shortcuts:[{keys:[`⌘/Ctrl`,`C`],desc:`复制选中节点`},{keys:[`⌘/Ctrl`,`V`],desc:`粘贴节点`},{keys:[`⌘/Ctrl`,`D`],desc:`创建节点副本`},{keys:[`⌘/Ctrl`,`Z`],desc:`撤销`},{keys:[`⌘/Ctrl`,`⇧`,`Z`],desc:`重做`},{keys:[`Delete`],desc:`删除选中节点`},{keys:[`Esc`],desc:`取消选中`},{keys:[`⌘/Ctrl`,`点击`],desc:`点击画布元素,在本树中定位该节点`}]}},computed:{rootOpen(){return!!this.query||this.openState._root!==!1},view(){return this.preview&&this.preview.view},rootLabel(){return this.view&&(this.preview.name||this.view.className)||`卡片`},viewComponents(){return this.view&&this.view.components||[]},viewNode(){return this.view},viewEventCount(){return this.view&&this.view.eventactions&&this.view.eventactions.length},ctxTargetIsContainer(){return this.isContainerNode(this.contextMenu.node)},ctxTargetIsRoot(){return this.contextMenu.node===this.viewNode},compNames(){let e={};for(let t in yu)e[t]=yu[t].name||t;return e.Root=`根`,e}},watch:{selectedNodeId:{immediate:!0,handler(e){this.ensureVisible(e)}},preview:{handler(e){if(!e||!e.view){this.openState={};return}let t=new Set,n=e=>{if(!e)return;t.add(e.id);let r=[];if(e.components&&r.push(...e.components),e.slots)for(let t of e.slots)t.components&&r.push(...t.components);for(let e of r)n(e)};n(e.view);let r={};for(let e of Object.keys(this.openState))(e===`_root`||t.has(e))&&(r[e]=this.openState[e]);this.openState=r},immediate:!0},moveCollapseToken:{handler(){this.collapseOthersAndReveal(this.selectedNodeId)}}},methods:{toggle(e){let t=this.openState[e];this.openState[e]=t===!1},onRootClick(e){e.stopPropagation(),this.onSelect(`_root`)},onRowHover(e){this.locateEnabled&&this.$emit(`hover-node`,{componentId:e&&e.componentId,id:e&&e.id})},onRowLeave(e){this.locateEnabled&&this.$emit(`hover-node`,{componentId:e&&e.componentId,id:e&&e.id,leave:!0})},toggleLocate(){this.locateEnabled=!this.locateEnabled,this.locateEnabled||this.$emit(`hover-node`,null)},onChildHover(e){this.locateEnabled&&this.$emit(`hover-node`,e)},onRootDblclick(e){e.stopPropagation(),e.preventDefault(),this.onInspect(this.viewNode)},onSelect(e){this.$emit(`select-node`,this.selectedNodeId===e?``:e)},onNodeContextMenu(e,t){this.openContextMenu(e,t)},openContextMenu(e,t){let n=e===this.viewNode?`_root`:e.id;this.$emit(`select-node`,n),this.contextMenu={visible:!0,x:t.clientX,y:t.clientY,nodeId:n,node:e},this.$nextTick(()=>this.clampContextMenu())},clampContextMenu(){let e=this.$refs.ctxMenu;if(!e)return;let t=e.getBoundingClientRect(),n=this.contextMenu.x,r=this.contextMenu.y;n+t.width>window.innerWidth&&(n=Math.max(4,window.innerWidth-t.width-4)),r+t.height>window.innerHeight&&(r=Math.max(4,window.innerHeight-t.height-4)),this.contextMenu.x=n,this.contextMenu.y=r},closeContextMenu(){this.contextMenu.visible&&(this.contextMenu={visible:!1,x:0,y:0,nodeId:``,node:null})},onCtxCopy(){this.$emit(`copy-selected`),this.closeContextMenu()},onCtxPaste(){this.$emit(`paste`),this.closeContextMenu()},onCtxDuplicate(){this.$emit(`duplicate`),this.closeContextMenu()},onCtxDelete(){this.$emit(`delete-selected`),this.closeContextMenu()},onCtxAdd(e){let t=this.contextMenu.node;this.closeContextMenu(),this.$emit(`add-node`,{node:t||null,mode:e})},onCtxInspect(){this.$emit(`inspect`,this.contextMenu.node),this.closeContextMenu()},onCtxEditEvent(){this.$emit(`edit-event`,this.contextMenu.node),this.closeContextMenu()},async onCtxCopyId(){let e=this.contextMenu.node,t=e&&(e.componentId==null?e.id:e.componentId);if(t==null||t===``){X(`该节点没有可复制的 ID`,`err`),this.closeContextMenu();return}await sp(String(t))?X(`已复制节点ID:${t}`,`ok`):X(`复制失败,请手动复制`,`err`),this.closeContextMenu()},async onCtxCopyCardId(){let e=this.cardCode;if(e==null||e===``){X(`该卡片没有可复制的 code`,`err`),this.closeContextMenu();return}await sp(String(e))?X(`已复制卡片code:${e}`,`ok`):X(`复制失败,请手动复制`,`err`),this.closeContextMenu()},onCtxRenameCard(){this.$emit(`rename-card`),this.closeContextMenu()},isContainerNode(e){if(!e)return!1;if(e.className===`Root`)return!0;let t=yu[e.className];return!!(t&&t.slots&&t.slots.length)},onDocClick(e){this.contextMenu.visible&&this.$refs.ctxMenu&&!this.$refs.ctxMenu.contains(e.target)&&this.closeContextMenu()},onDocKeydown(e){e.key===`Escape`&&this.closeContextMenu()},expandAll(){this.openState={}},collapseAll(){let e={_root:!1},t=n=>{for(let r of n){(r.slots||[]).some(e=>(e.components||[]).length>0)&&(e[r.id]=!1);for(let e of r.slots||[])t(e.components||[])}};t(this.viewComponents),this.openState=e},onEditEvent(e){this.$emit(`edit-event`,e)},onRootDragOver(e){if(!this.draggingId){this.dropTarget={compId:null,type:null};return}e.preventDefault(),e.dataTransfer.dropEffect=`move`,(this.dropTarget.compId!==`__root__`||this.dropTarget.type!==`inside`)&&(this.dropTarget={compId:`__root__`,type:`inside`})},onRootDragLeave(e){e.relatedTarget&&e.currentTarget.contains(e.relatedTarget)||(this.dropTarget={compId:null,type:null})},onRootDrop(e){e.preventDefault();let t=e.dataTransfer&&e.dataTransfer.getData(`text/plain`);this.dropTarget={compId:null,type:null},t&&this.$emit(`move-node`,{sourceCompId:t,targetCompId:`__root__`,position:`inside`})},dropClass(e){let t=this.dropTarget;return!t||t.compId!==e?``:t.type===`blocked`?`st__row--drop-blocked`:t.type===`before`?`st__row--drop-before`:t.type===`after`?`st__row--drop-after`:t.type===`inside`?`st__row--drop-inside`:``},clearDrag(){this.draggingId=``,this.dropTarget={compId:null,type:null}},onAddFromToolbar(){let e=this.selectedNodeId,t=null;e&&e!==`_root`&&(t=this.findViewNodeById(this.view,e)),this.$emit(`add-node`,{node:t,mode:`auto`})},findViewNodeById(e,t){if(!e)return null;if(e.id===t)return e;let n=[];if(e.components&&n.push(...e.components),e.slots)for(let t of e.slots)t.components&&n.push(...t.components);for(let e of n){let n=this.findViewNodeById(e,t);if(n)return n}return null},onInspect(e){this.$emit(`inspect`,e)},ensureVisible(e){if(!e)return;let t=this.collectAncestorIds(e);if(t.length){let e=Object.assign({},this.openState);for(let n of t)e[n]=!0;this.openState=e}this.$nextTick(()=>{let e=this.$el&&this.$el.querySelector?this.$el.querySelector(`.st__row--selected`):null;e&&e.scrollIntoView&&e.scrollIntoView({block:`nearest`})})},collectAncestorIds(e){let t=[],n=!1,r=(i,a)=>{for(let o of i){if(o.id===e)return n=!0,a!==void 0&&t.unshift(a),!0;let i=[];if(o.components&&i.push(...o.components),o.slots)for(let e of o.slots)e.components&&i.push(...e.components);if(r(i,o.id))return t.unshift(a),!0}return!1};return r(this.viewComponents,`_root`),n?t:[]},collapseOthersAndReveal(e){if(this.collapseAll(),e&&e!==`_root`){let t=this.collectAncestorIds(e);if(t.length){let e=Object.assign({},this.openState);for(let n of t)e[n]=!0;this.openState=e}}else e===`_root`&&(this.openState=Object.assign({},this.openState,{_root:!0}));this.$nextTick(()=>{let e=this.$el&&this.$el.querySelector?this.$el.querySelector(`.st__row--selected`):null;e&&e.scrollIntoView&&e.scrollIntoView({block:`nearest`})})}},mounted(){this._onDocClick=e=>this.onDocClick(e),this._onDocKeydown=e=>this.onDocKeydown(e),document.addEventListener(`click`,this._onDocClick,!0),document.addEventListener(`keydown`,this._onDocKeydown,!0)},beforeDestroy(){document.removeEventListener(`click`,this._onDocClick,!0),document.removeEventListener(`keydown`,this._onDocKeydown,!0)}},Dm={class:`st`},Om={class:`st__toolbar st__toolbar--top`},km=[`title`,`aria-pressed`],Am={class:`st__node st__node--root`},jm={class:`st__label`},Mm={class:`st__children`},Nm=[`disabled`],Pm=[`disabled`],Fm=[`disabled`],Im={key:2,class:`st__ctx-sep`},Lm=[`disabled`],Rm={class:`st__help-wrap`},zm=[`aria-expanded`],Bm={class:`st__help-pop-head`},Vm={class:`st__help-pop-body st__keys`},Hm={class:`st__keys-combo`},Um={class:`st__kbd`},Wm={key:0,class:`st__kbd-plus`},Gm={class:`st__keys-desc`};function Km(e,t,n,r,i,a){let o=I(`tree-node`);return z(),B(`div`,Dm,[G(`
|
|
116
116
|
顶部工具条:与变量 mock 视图 JsonTree 的 .jt__toolbar 同款
|
|
117
117
|
(sticky 顶部 + .jt__tool 按钮风格),保持两个 tab 操作入口一致。
|
|
118
|
-
`),
|
|
118
|
+
`),H(`div`,Om,[H(`button`,{class:`jt__tool`,type:`button`,onClick:t[0]||=(...e)=>a.expandAll&&a.expandAll(...e)},`全部展开`),H(`button`,{class:`jt__tool`,type:`button`,onClick:t[1]||=(...e)=>a.collapseAll&&a.collapseAll(...e)},`全部折叠`),G(`
|
|
119
119
|
定位开关:图标按钮(无文字),点击切换激活态。激活时节点 hover 才上抛
|
|
120
120
|
hover-node 触发画布参考线;未激活则过滤所有 hover 事件,不触发参考线。
|
|
121
|
-
`),
|
|
121
|
+
`),H(`button`,{class:A([`jt__tool st__locate`,{"st__locate--active":i.locateEnabled}]),type:`button`,title:i.locateEnabled?`定位:开(hover 节点显示画布参考线)`:`定位:关(hover 节点不显示参考线)`,"aria-pressed":i.locateEnabled,onClick:t[2]||=(...e)=>a.toggleLocate&&a.toggleLocate(...e)},[...t[37]||=[H(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[H(`use`,{href:`#icon-locate`})],-1)]],10,km),G(`
|
|
122
122
|
搜索框置于「展开/折叠」与「+ 添加」之间:flex:1 在中间撑开,
|
|
123
123
|
把展开/折叠推到左侧、+ 添加推到右侧,整体单行排列。
|
|
124
|
-
`),
|
|
124
|
+
`),F(H(`input`,{class:`st__search`,type:`text`,"onUpdate:modelValue":t[3]||=e=>i.query=e,placeholder:`搜索组件…`,title:`按组件名 / 类型 / 实例ID 过滤结构树`},null,512),[[al,i.query]]),G(`
|
|
125
125
|
顶部「+ 添加」按钮:与变量 mock 视图(JsonTree)工具栏右侧的「+ 添加」同款,
|
|
126
126
|
位于面板右上角。插入锚点由「当前选中节点」决定(未选中→根;容器→末尾子节点;
|
|
127
127
|
非容器→其后兄弟),与线上编辑器「卡片-组件」面板行为一致。
|
|
128
|
-
`),
|
|
128
|
+
`),H(`button`,{class:`jt__tool jt__tool--add`,type:`button`,title:`添加组件:未选中节点→根下;容器→末尾子节点;非容器→其后兄弟`,onClick:t[4]||=(...e)=>a.onAddFromToolbar&&a.onAddFromToolbar(...e)},`+ 添加组件`)]),H(`ul`,{class:`st__list`,onContextmenu:t[19]||=K((...e)=>a.closeContextMenu&&a.closeContextMenu(...e),[`prevent`])},[G(` 根节点 `),H(`li`,Am,[H(`div`,{class:A([`st__row`,[{"st__row--selected":n.selectedNodeId===`_root`},a.dropClass(`__root__`)]]),title:`单击选中节点;双击打开节点设置;可作为放置目标把节点放入顶层`,"data-comp-id":`__root__`,"data-is-container":`true`,onClick:t[8]||=e=>a.onRootClick(e),onDblclick:t[9]||=(...e)=>a.onRootDblclick&&a.onRootDblclick(...e),onDragover:t[10]||=(...e)=>a.onRootDragOver&&a.onRootDragOver(...e),onDragleave:t[11]||=(...e)=>a.onRootDragLeave&&a.onRootDragLeave(...e),onDrop:t[12]||=(...e)=>a.onRootDrop&&a.onRootDrop(...e),onMouseenter:t[13]||=e=>a.onRowHover(a.viewNode),onMouseleave:t[14]||=e=>a.onRowLeave(a.viewNode),onContextmenu:t[15]||=K(e=>a.openContextMenu(a.viewNode,e),[`prevent`,`stop`])},[H(`span`,{class:A([`st__caret`,{"st__caret--open":i.openState._root!==!1}]),onClick:t[5]||=K(e=>a.toggle(`_root`),[`stop`])},`▸`,2),H(`span`,jm,j(a.rootLabel),1),H(`span`,{class:A([`st__badge`,a.viewEventCount?`st__badge--clickable`:`st__badge--muted`]),onClick:t[6]||=K(e=>a.onEditEvent(a.viewNode),[`stop`])},`事件`,2),H(`button`,{class:`st__gear`,type:`button`,title:`编辑节点属性`,onClick:t[7]||=K(e=>a.onInspect(a.viewNode),[`stop`])},[...t[38]||=[H(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[H(`use`,{href:`#icon-gear`})],-1)]])],34),F(H(`ul`,Mm,[(z(!0),B(R,null,L(a.viewComponents,r=>(z(),V(o,{key:r.id,comp:r,"open-state":i.openState,"comp-names":a.compNames,"selected-node-id":n.selectedNodeId,"dragging-id":i.draggingId,"drop-target":i.dropTarget,query:i.query,onToggle:a.toggle,onSelectNode:a.onSelect,onEditEvent:a.onEditEvent,onInspect:a.onInspect,onDragStart:t[16]||=e=>i.draggingId=e,onDragEnd:a.clearDrag,onDragOver:t[17]||=e=>i.dropTarget=e,onMoveNode:t[18]||=t=>e.$emit(`move-node`,t),onContextMenu:a.onNodeContextMenu,onHoverNode:a.onChildHover},null,8,[`comp`,`open-state`,`comp-names`,`selected-node-id`,`dragging-id`,`drop-target`,`query`,`onToggle`,`onSelectNode`,`onEditEvent`,`onInspect`,`onDragEnd`,`onContextMenu`,`onHoverNode`]))),128))],512),[[Cc,a.rootOpen]])])],32),G(`
|
|
129
129
|
右键上下文菜单:复制 / 粘贴 / 副本 / 添加节点 / 删除。
|
|
130
130
|
「添加节点」仅对容器节点(含卡片根)显示:点击后即打开组件选择面板,
|
|
131
131
|
选定类型即在容器默认插槽末尾追加一个子节点(与顶部「+ 添加」同款插入逻辑)。
|
|
132
132
|
粘贴需先选中节点;副本/删除对根节点禁用。
|
|
133
|
-
`),i.contextMenu.visible?(
|
|
133
|
+
`),i.contextMenu.visible?(z(),B(`div`,{key:0,ref:`ctxMenu`,class:`st__ctx`,style:k({left:i.contextMenu.x+`px`,top:i.contextMenu.y+`px`}),onClick:t[32]||=K(()=>{},[`stop`]),onContextmenu:t[33]||=K(()=>{},[`prevent`])},[H(`button`,{class:`st__ctx-item`,type:`button`,disabled:!n.selectedNodeId||n.selectedNodeId===`_root`,onClick:t[20]||=(...e)=>a.onCtxCopy&&a.onCtxCopy(...e)},`复制`,8,Nm),H(`button`,{class:`st__ctx-item`,type:`button`,disabled:!n.canPaste||!n.selectedNodeId,onClick:t[21]||=(...e)=>a.onCtxPaste&&a.onCtxPaste(...e)},`粘贴`,8,Pm),H(`button`,{class:`st__ctx-item`,type:`button`,disabled:!n.selectedNodeId||n.selectedNodeId===`_root`,onClick:t[22]||=(...e)=>a.onCtxDuplicate&&a.onCtxDuplicate(...e)},`副本`,8,Fm),t[39]||=H(`div`,{class:`st__ctx-sep`},null,-1),G(`
|
|
134
134
|
添加节点拆分为三类(与用户诉求一致):
|
|
135
135
|
- 添加子节点:仅容器节点(含卡片根)显示,在容器内默认插槽末尾追加子节点;
|
|
136
136
|
- 上面插入节点 / 下面插入节点:仅非根节点显示,在节点的相邻兄弟位置插入。
|
|
137
137
|
根节点只显示「添加子节点」。
|
|
138
138
|
锚点(右键节点)与模式(child/before/after)随 add-node 事件上抛,由 App 决定插入位置。
|
|
139
|
-
`),a.ctxTargetIsContainer?(
|
|
140
|
-
弹出 NodeInspector / EventEditor(含根节点卡片级设置) `),
|
|
139
|
+
`),a.ctxTargetIsContainer?(z(),B(`button`,{key:0,class:`st__ctx-item`,type:`button`,onClick:t[23]||=e=>a.onCtxAdd(`child`)},`添加子节点`)):G(`v-if`,!0),a.ctxTargetIsRoot?G(`v-if`,!0):(z(),B(R,{key:1},[H(`button`,{class:`st__ctx-item`,type:`button`,onClick:t[24]||=e=>a.onCtxAdd(`before`)},`前面插入节点`),H(`button`,{class:`st__ctx-item`,type:`button`,onClick:t[25]||=e=>a.onCtxAdd(`after`)},`后面插入节点`)],64)),a.ctxTargetIsContainer||!a.ctxTargetIsRoot?(z(),B(`div`,Im)):G(`v-if`,!0),G(` 属性设置 / 事件设置:复用齿轮按钮 / 事件徽标的 inspect / edit-event 链路,
|
|
140
|
+
弹出 NodeInspector / EventEditor(含根节点卡片级设置) `),H(`button`,{class:`st__ctx-item`,type:`button`,onClick:t[26]||=(...e)=>a.onCtxInspect&&a.onCtxInspect(...e)},`属性设置`),H(`button`,{class:`st__ctx-item`,type:`button`,onClick:t[27]||=(...e)=>a.onCtxEditEvent&&a.onCtxEditEvent(...e)},`事件设置`),G(` 卡片根节点:复制卡片 code(= 当前卡片英文名 / src/cards 文件夹名),替代「复制节点ID」避免重复 `),a.ctxTargetIsRoot?(z(),B(`button`,{key:3,class:`st__ctx-item`,type:`button`,onClick:t[28]||=(...e)=>a.onCtxCopyCardId&&a.onCtxCopyCardId(...e)},`复制卡片code`)):G(`v-if`,!0),G(` 卡片根节点:卡片重命名(改卡片 ID / 描述),由 App 复用「新增空白卡片」表单弹窗处理 `),a.ctxTargetIsRoot?(z(),B(`button`,{key:4,class:`st__ctx-item`,type:`button`,onClick:t[29]||=(...e)=>a.onCtxRenameCard&&a.onCtxRenameCard(...e)},`卡片重命名`)):G(`v-if`,!0),G(` 普通组件节点:复制实例ID(componentId,即行内【xxx】) `),a.ctxTargetIsRoot?G(`v-if`,!0):(z(),B(`button`,{key:5,class:`st__ctx-item`,type:`button`,onClick:t[30]||=(...e)=>a.onCtxCopyId&&a.onCtxCopyId(...e)},`复制节点ID`)),t[40]||=H(`div`,{class:`st__ctx-sep`},null,-1),H(`button`,{class:`st__ctx-item st__ctx-item--danger`,type:`button`,disabled:!n.selectedNodeId||n.selectedNodeId===`_root`,onClick:t[31]||=(...e)=>a.onCtxDelete&&a.onCtxDelete(...e)},`删除`,8,Lm)],36)):G(`v-if`,!0),G(`
|
|
141
141
|
帮助悬浮按钮:固定在面板左下角(不占用固定布局区域),点击弹出使用说明气泡;
|
|
142
142
|
气泡内 ✕ 关闭,再次点击按钮亦关闭。说明文本即原固定展示在面板顶部的 st__tip 内容。
|
|
143
143
|
实现:零高度的 sticky 容器吸附在滚动视口底部(滚动在外层 .debug__body),
|
|
144
144
|
按钮与气泡以绝对定位挂靠其上,内容长短均保持悬浮于面板左下角。
|
|
145
|
-
`),U(`div`,cm,[U(`button`,{class:j([`st__help`,{"st__help--open":i.helpOpen}]),type:`button`,title:`使用说明`,"aria-expanded":i.helpOpen,onClick:t[34]||=q(e=>i.helpOpen=!i.helpOpen,[`stop`])},[...t[41]||=[U(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`circle`,{cx:`12`,cy:`12`,r:`9.2`}),U(`path`,{d:`M9.4 9.2a2.6 2.6 0 0 1 5.1.7c0 1.7-2.5 2.2-2.5 3.7`}),U(`line`,{x1:`12`,y1:`17`,x2:`12`,y2:`17.01`})],-1)]],10,lm),W(ic,{name:`pop`},{default:Lr(()=>[i.helpOpen?(B(),V(`div`,{key:0,class:`st__help-pop`,onClick:t[36]||=q(()=>{},[`stop`])},[U(`div`,um,[t[42]||=U(`span`,{class:`st__help-pop-title`},`快捷键`,-1),U(`button`,{class:`st__help-pop-close`,type:`button`,title:`关闭`,onClick:t[35]||=e=>i.helpOpen=!1},`✕`)]),K(` 快捷键清单:左列按键示意(kbd 芯片),右列一句话说明;与 App onKeydown 保持一致 `),U(`ul`,dm,[(B(!0),V(z,null,R(i.shortcuts,e=>(B(),V(`li`,{key:e.desc,class:`st__keys-row`},[U(`span`,fm,[(B(!0),V(z,null,R(e.keys,(t,n)=>(B(),V(z,{key:t},[U(`kbd`,pm,M(t),1),n<e.keys.length-1?(B(),V(`span`,mm,`+`)):K(`v-if`,!0)],64))),128))]),U(`span`,hm,M(e.desc),1)]))),128))])])):K(`v-if`,!0)]),_:1})])])}var _m=X(Xp,[[`render`,gm],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/StructureTree.vue`]]),vm=e=>e===void 0?e:JSON.parse(JSON.stringify(e)),ym={className:`Root`,name:`根节点`,styleState:{},styleVisible:{rect:!0,flex:!0,background:!0,padding:!0,margin:!0,borderRadius:!0,border:!0,shadow:!0,transform:!0,other:!0},styleMeta:{},properties:[],slots:[],events:[{eventName:`初始化完成`,eventKey:`onReady`}]};function bm(e){return e===`Root`?ym:vu[e]||null}function xm(e={},t={},n={}){let r=[];return yu.forEach(i=>{let a=e[i.itemKey];if(!a)return;let o=new Y(i),s=o.itemChildren&&o.itemChildren.properties||[];if(a&&typeof a==`object`)for(let e=0;e<s.length;e++)a[s[e].itemKey]||s.splice(e--,1);if(!s.length)return;let c=t[i.itemKey]||{};s.forEach(e=>{let t=c[e.itemKey];t&&(t.itemName&&(e.itemName=t.itemName),t.itemOption&&(e.itemOption=Object.assign({},e.itemOption,t.itemOption)))}),n[i.itemKey]&&du.setPropertyValue(s,n[i.itemKey]),o.itemValueFrom=`0`,r.push(o)}),r}var Sm=class{constructor(e={}){this.schemaNode=e,this.className=e.className||`Root`,this.isRoot=this.className===`Root`;let t=bm(this.className);this.metaMissing=!t,this.meta=t||{properties:[],events:[],styleVisible:{},styleState:{},styleMeta:{}},this.name=this.meta.name||this.className,this.events=this.meta.events||[],this.properties=(this.meta.properties||[]).map(e=>new Y(e)),Y.restoreProperty(e.properties||[],this.properties),Y.updatePropertyVisible(this.properties),this.extraProperties=this._orphans(e.properties,this.properties),this.hasDirectives=!this.isRoot,this.directives=this.hasDirectives?xu.map(e=>new Y(e)):[],this.hasDirectives?(Y.restoreProperty(e.directives||[],this.directives),Y.updatePropertyVisible(this.directives),this.extraDirectives=this._orphans(e.directives,this.directives)):this.extraDirectives=[],this.style=new Su({state:this.meta.styleState,visible:this.meta.styleVisible,meta:this.meta.styleMeta}),this.style.onRestore(e.style||{}),this.styleForm=xm(this.meta.styleVisible||{},this.meta.styleMeta||{},this.meta.styleState||{}),Y.restoreProperty(this.style.onExport().properties,this.styleForm),Y.updatePropertyVisible(this.styleForm)}refreshVisible(){Y.updatePropertyVisible(this.properties),this.hasDirectives&&Y.updatePropertyVisible(this.directives),Y.updatePropertyVisible(this.styleForm)}applyStyleChange(e,t=[]){let n=null;for(let e=t.length-1;e>=0;e--)n={itemId:t[e].itemId,child:n};Y.updatePropertyVisible(this.styleForm),this.style.applyChange(e,n)}exportProperties(){return this.properties.reduce((e,t)=>{let n=t.onExport();return n&&e.push(n),e},[]).concat(this.extraProperties.map(e=>vm(e)))}exportDirectives(){return this.directives.reduce((e,t)=>{let n=t.onExport();return n&&e.push(n),e},[]).concat(this.extraDirectives.map(e=>vm(e)))}_orphans(e,t){let n=new Set;return(t||[]).forEach(e=>{e.itemId&&n.add(e.itemId),e.itemKey&&n.add(e.itemKey)}),(e||[]).filter(e=>e&&e.itemId&&!n.has(e.itemId)&&!(e.itemKey&&n.has(e.itemKey))).map(e=>vm(e))}exportStyle(){return this.style.onExport()}applyToSchema(){let e=this.schemaNode;e.properties=this.exportProperties(),e.style=this.exportStyle(),this.hasDirectives&&(e.directives=this.exportDirectives())}toSchemaFragment(){let e={properties:this.exportProperties(),style:this.exportStyle()};return this.hasDirectives&&(e.directives=this.exportDirectives()),vm(e)}},Cm={name:`NodeInspector`,props:{comp:{type:Object,required:!0},compNames:{type:Object,default:()=>({})},rt:{type:Object,required:!0}},emits:[`apply`,`commit`,`close`],data(){return{model:null,secOpen:{basic:!0,props:!0,style:!0,directive:!0},_t:null,_snapshot:null,_dirty:!1,_written:!1}},computed:{schemaNode(){return this.comp&&this.comp._schemaNode||null},compName(){let e=this.schemaNode&&this.schemaNode.className;return e?this.compNames&&this.compNames[e]||e:`节点`},styleWatches(){let e={},t=n=>{(n||[]).forEach(n=>{n.itemKey!=null&&(e[n.itemKey]=n.itemValue),n.itemChildren&&n.itemChildren.properties&&t(n.itemChildren.properties)})};return this.model&&t(this.model.styleForm),e}},watch:{comp:{immediate:!0,handler(){this.buildModel()}}},methods:{buildModel(){let e=this.schemaNode;this.model=e?nn(new Sm(e)):null,this._snapshot=e?this.snapshotNode(e):null,this._dirty=!1,this._written=!1},snapshotNode(e){let t=t=>Object.prototype.hasOwnProperty.call(e,t),n=e=>e===void 0?void 0:JSON.parse(JSON.stringify(e));return{hasProperties:t(`properties`),properties:n(e.properties),hasStyle:t(`style`),style:n(e.style),hasDirectives:t(`directives`),directives:n(e.directives),hasComponentId:t(`componentId`),componentId:n(e.componentId),hasName:t(`name`),name:n(e.name)}},restoreSnapshot(){let e=this.schemaNode;if(!e||!this._snapshot)return;let t=this._snapshot,n=(t,n,r)=>{t?e[n]=JSON.parse(JSON.stringify(r)):delete e[n]};n(t.hasProperties,`properties`,t.properties),n(t.hasStyle,`style`,t.style),n(t.hasDirectives,`directives`,t.directives),n(t.hasComponentId,`componentId`,t.componentId),n(t.hasName,`name`,t.name)},toggleSec(e){this.secOpen[e]=!this.secOpen[e],this.secOpen=Object.assign({},this.secOpen)},hasField(e){return this.schemaNode&&Object.prototype.hasOwnProperty.call(this.schemaNode,e)},onMetaInput(e,t){this.schemaNode&&(this.schemaNode[e]=t,this._dirty=!0,this.scheduleApply())},onPropChange(){this.model.refreshVisible(),this._dirty=!0,this.scheduleApply()},onStyleChange(e){!e||!e.length||(this.model.applyStyleChange(e[0],e.slice(1)),this.model.refreshVisible(),this._dirty=!0,this.scheduleApply())},onStyleSync(e){if(e){for(let t in e){let n=String(t).split(`.`);if(n.length<3||n[0]!==`style`)continue;let r=n[1],i=n[2],a=this.model.styleForm.find(e=>e.itemKey===r);if(!a)continue;let o=a.itemChildren.properties.find(e=>e.itemKey===i);o&&(o.itemValue=e[t],this.model.applyStyleChange(a,[o]))}this.model.refreshVisible(),this.scheduleApply()}},scheduleApply(){this._t&&clearTimeout(this._t),this._t=setTimeout(()=>{this.applyAll(),this.$emit(`apply`)},250)},applyAll(){this.model&&this.model.applyToSchema()},onApplyWrite(){this._t&&=(clearTimeout(this._t),null),this.applyAll(),this._written=!0,this.$emit(`apply`),this.$emit(`commit`),this.$emit(`close`)},discardAndClose(){this._t&&=(clearTimeout(this._t),null),this._dirty&&!this._written&&(this.restoreSnapshot(),this.$emit(`apply`)),this.$emit(`close`)},onClose(){this.discardAndClose()},onCancel(){this.discardAndClose()}}},wm={class:`ni-overlay`},Tm={class:`ni-panel modal-card`},Em={class:`ni-head`},Dm={class:`ni-title`},Om={class:`ni-cls`},km={key:0,class:`ni-body`},Am={key:1,class:`ni-body`},jm={class:`ni-scroll`},Mm={class:`ni-sec`},Nm={class:`ni-sec-body`},Pm={class:`ni-field-row`},Fm={class:`ni-static`},Im={key:0,class:`ni-field-row`},Lm=[`value`],Rm={key:1,class:`ni-field-row`},zm=[`value`],Bm={class:`ni-sec`},Vm={class:`ni-sec-body`},Hm={class:`ni-sec`},Um={class:`ni-sec-body`},Wm={key:0,class:`ni-sec`},Gm={class:`ni-sec-body`},Km={key:0,class:`ni-empty`},qm={class:`ni-foot`},Jm={class:`ni-foot-btns`};function Ym(e,t,n,r,i,a){let o=L(`prop-tree`);return B(),V(`div`,wm,[U(`div`,Tm,[U(`div`,Em,[U(`span`,Dm,[G(` 节点属性 · `+M(a.compName)+` `,1),U(`em`,Om,M(a.schemaNode&&a.schemaNode.className),1)]),U(`button`,{class:`ni-close`,type:`button`,onClick:t[0]||=(...e)=>a.onClose&&a.onClose(...e)})]),i.model?(B(),V(`div`,Am,[K(` ============ 属性 ============ `),U(`div`,jm,[K(` 基本信息 `),U(`section`,Mm,[U(`div`,{class:`ni-sec-head`,onClick:t[1]||=e=>a.toggleSec(`basic`)},[U(`span`,{class:j([`ni-caret`,{"is-open":i.secOpen.basic}])},`▸`,2),t[10]||=G(`基本信息 `,-1)]),I(U(`div`,Nm,[U(`div`,Pm,[t[11]||=U(`label`,{class:`ni-field-label`},`组件类型`,-1),U(`span`,Fm,M(a.compName),1)]),a.hasField(`componentId`)?(B(),V(`div`,Im,[t[12]||=U(`label`,{class:`ni-field-label`},`实例 ID`,-1),U(`input`,{class:`ni-input`,value:a.schemaNode.componentId,onInput:t[2]||=e=>a.onMetaInput(`componentId`,e.target.value)},null,40,Lm)])):K(`v-if`,!0),a.hasField(`name`)?(B(),V(`div`,Rm,[t[13]||=U(`label`,{class:`ni-field-label`},`节点名`,-1),U(`input`,{class:`ni-input`,value:a.schemaNode.name,onInput:t[3]||=e=>a.onMetaInput(`name`,e.target.value)},null,40,zm)])):K(`v-if`,!0)],512),[[Sc,i.secOpen.basic]])]),K(` 组件属性 `),I(U(`section`,Bm,[U(`div`,{class:`ni-sec-head`,onClick:t[4]||=e=>a.toggleSec(`props`)},[U(`span`,{class:j([`ni-caret`,{"is-open":i.secOpen.props}])},`▸`,2),t[14]||=G(` 组件属性 `,-1)]),I(U(`div`,Vm,[W(o,{properties:i.model.properties,mode:`property`,plain:!0,onLeafChange:a.onPropChange,onLeafSync:a.onStyleSync},null,8,[`properties`,`onLeafChange`,`onLeafSync`])],512),[[Sc,i.secOpen.props]])],512),[[Sc,i.model.properties.length]]),K(` 样式 `),U(`section`,Hm,[U(`div`,{class:`ni-sec-head`,onClick:t[5]||=e=>a.toggleSec(`style`)},[U(`span`,{class:j([`ni-caret`,{"is-open":i.secOpen.style}])},`▸`,2),t[15]||=G(` 样式 `,-1)]),I(U(`div`,Um,[W(o,{properties:i.model.styleForm,mode:`style`,watches:a.styleWatches,plain:!0,onLeafChange:a.onStyleChange,onLeafSync:a.onStyleSync},null,8,[`properties`,`watches`,`onLeafChange`,`onLeafSync`])],512),[[Sc,i.secOpen.style]])]),K(` 指令 `),i.model.hasDirectives?(B(),V(`section`,Wm,[U(`div`,{class:`ni-sec-head`,onClick:t[6]||=e=>a.toggleSec(`directive`)},[U(`span`,{class:j([`ni-caret`,{"is-open":i.secOpen.directive}])},`▸`,2),t[16]||=G(` 指令 `,-1)]),I(U(`div`,Gm,[i.model.directives.length?(B(),H(o,{key:1,properties:i.model.directives,mode:`directive`,"b-exchange":!1,plain:!0,onLeafChange:a.onPropChange,onLeafSync:a.onStyleSync},null,8,[`properties`,`onLeafChange`,`onLeafSync`])):(B(),V(`p`,Km,`无指令`))],512),[[Sc,i.secOpen.directive]])])):K(`v-if`,!0)])])):(B(),V(`div`,km,[...t[9]||=[U(`p`,{class:`ni-empty`},`无法定位该节点的原始 schema(_schemaNode 缺失)`,-1)]])),U(`div`,qm,[t[17]||=U(`span`,{class:`ni-tip`},`编辑即时预览(不记历史);「取消」丢弃改动并还原,「应用」写入历史并关闭,落盘由顶栏「保存到本地」负责`,-1),U(`div`,Jm,[U(`button`,{class:`ni-btn ni-btn--ghost`,type:`button`,onClick:t[7]||=(...e)=>a.onCancel&&a.onCancel(...e)},`取消`),U(`button`,{class:`ni-btn`,type:`button`,onClick:t[8]||=(...e)=>a.onApplyWrite&&a.onApplyWrite(...e)},`应用`)])])])])}var Xm=X(Cm,[[`render`,Ym],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/NodeInspector.vue`]]),Zm={_source:`docs/动态卡片方案详细说明.md(JSAPI 章节)+ src/cards/*/schema.json 实测形态`,_note:`事件动作元数据。properties 采用与 component-meta / style-meta 完全一致的 Property meta 形态,可直接喂给 Property / PropTree / PropControl,无需任何专用渲染分支。itemRequired 的项在导出时总是写回 schema(对齐线上:customAction 永远带 function 项);非必填项只有在 schema 原本就有、或用户改过值时才写回,避免把默认值污染进 DSL 产品数据。`,lifecycleEvents:[{eventKey:`onReady`,eventName:`初始化完成`,eventDesc:`卡片渲染就绪时执行一次`}],actions:[{actionType:`customAction`,actionName:`自定义动作`,actionDesc:`执行一段 JavaScript。this 为卡片上下文:state / data / setData / setRootData / postMessage / addEventListener`,properties:[{itemId:`001`,itemKey:`function`,itemName:`脚本`,itemType:`Code`,itemTypeRange:`const`,itemRequired:!0,itemDefaultValue:{},itemOption:{language:`javascript`,codeKey:`code`},itemDesc:`事件回调函数体,形参为 event`}]},{actionType:`startRouter`,actionName:`路由跳转`,actionDesc:`ynet.callJSAPI('startRouter', { targetUrl, urlType, isLoginNeeded, extra })`,properties:[{itemId:`001`,itemKey:`targetUrl`,itemName:`跳转地址`,itemType:`Input`,itemTypeRange:`const,var`,itemRequired:!0,itemDefaultValue:``,itemDesc:`目标页面地址`},{itemId:`002`,itemKey:`urlType`,itemName:`地址类型`,itemType:`Select`,itemTypeRange:`const`,itemRequired:!0,itemDefaultValue:`3`,itemOption:{iParamList:[{key:`2`,value:`离线包`},{key:`3`,value:`在线页面`},{key:`4`,value:`原生页面`}]}},{itemId:`003`,itemKey:`isLoginNeeded`,itemName:`是否需要登录`,itemType:`Select`,itemTypeRange:`const`,itemRequired:!0,itemDefaultValue:`1`,itemOption:{iParamList:[{key:`1`,value:`需要登录`},{key:`0`,value:`不需要登录`}]}},{itemId:`004`,itemKey:`extra`,itemName:`备用参数`,itemType:`Textarea`,itemTypeRange:`const,var`,itemDefaultValue:``,itemDesc:`JSON 文本,透传给原生`}]},{actionType:`sendAiChatMessage`,actionName:`发送智能体消息`,actionDesc:`ynet.callJSAPI('sendAiChatMessage', { message })`,properties:[{itemId:`001`,itemKey:`message`,itemName:`消息内容`,itemType:`Input`,itemTypeRange:`const,var`,itemRequired:!0,itemDefaultValue:``,itemDesc:`发送给智能体的文本`}]},{actionType:`closeAlertCard`,actionName:`关闭弹窗卡片`,actionDesc:`ynet.callJSAPI('closeAlertCard', { cardCode, index, data });三项均可不填,默认关闭最上层弹窗`,properties:[{itemId:`001`,itemKey:`cardCode`,itemName:`卡片编码`,itemType:`Input`,itemTypeRange:`const,var`,itemDefaultValue:``,itemDesc:`按 cardCode 从堆栈自上而下关闭一个;不填则关最上层`},{itemId:`002`,itemKey:`index`,itemName:`关闭层数`,itemType:`InputNumber`,itemTypeRange:`const`,itemDefaultValue:``,itemOption:{max:0,min:-10,step:1},itemDesc:`-1 关一层,-2 关两层,以此类推;优先级高于卡片编码`},{itemId:`003`,itemKey:`data`,itemName:`回传数据`,itemType:`Textarea`,itemTypeRange:`const,var`,itemDefaultValue:``,itemDesc:`JSON 文本,作为 alertCard 的回调参数`}]}]},Qm=0,$m=e=>`${e}_${(++Qm).toString(36)}`,eh=e=>e===void 0?e:JSON.parse(JSON.stringify(e)),th=Zm.lifecycleEvents||[],nh=Zm.actions||[],rh=nh.reduce((e,t)=>(e[t.actionType]=t,e),{});function ih(e,t){let n=new Set;return(t||[]).forEach(e=>{e.itemId&&n.add(e.itemId),e.itemKey&&n.add(e.itemKey)}),(e||[]).filter(e=>e&&e.itemId&&!n.has(e.itemId)&&!(e.itemKey&&n.has(e.itemKey))).map(e=>eh(e))}function ah(e,t){let n={};return Object.keys(e||{}).forEach(r=>{t.indexOf(r)<0&&(n[r]=eh(e[r]))}),n}var oh=class{constructor(e={}){let t=e.event||{},n=e.action||{};this.uid=$m(`ea`),this.eventKey=t.eventKey||``,this.eventName=t.eventName||``,this.actionType=n.actionType||``,this._extraEvent=ah(t,[`eventKey`,`eventName`]),this._extraAction=ah(n,[`actionType`,`properties`]),this.properties=[],this.extraProperties=[],this.buildProps(n.properties||[])}buildProps(e=[]){let t=(rh[this.actionType]||{}).properties||[];this.properties=t.map(e=>{let t=new Y(e);return t.itemRequired=!!e.itemRequired,t}),Y.restoreProperty(e,this.properties),Y.updatePropertyVisible(this.properties),this.extraProperties=ih(e,this.properties),this.formKey=$m(`form`)}isPristine(e){let t=e.itemValue;if(t===``||t==null)return!0;try{return JSON.stringify(t)===JSON.stringify(e.itemDefaultValue)}catch{return t===e.itemDefaultValue}}get summary(){if(this.actionType===`customAction`){let e=this.properties.find(e=>e.itemKey===`function`),t=e&&e.itemValue&&typeof e.itemValue==`object`&&e.itemValue.code||``;if(!t)return`空脚本`;let n=String(t).split(`
|
|
146
|
-
`).find(e=>e.trim())||``;return n.trim().slice(0,46)+(n.trim().length>46?`…`:``)}let e=this.properties.filter(e=>!this.isPristine(e));return e.length?e.map(e=>`${e.itemName}=${String(e.itemValue).slice(0,20)}`).join(`,`):`未配置参数`}exportProps(){let e=[];return this.properties.forEach(t=>{if(!(t.itemRequired||t.itemUpdated||!this.isPristine(t)))return;let n=t.onExport();n&&e.push(n)}),e.concat(this.extraProperties.map(e=>eh(e)))}},sh=class{constructor(e={}){this.schemaNode=e,this.className=e.className||`Root`;let t=bm(this.className)||{};this.metaEvents=(t.events||[]).map(e=>eh(e)),this.hadKey=Object.prototype.hasOwnProperty.call(e,`eventactions`),this.rows=(e.eventactions||[]).map(e=>new oh(e))}get count(){return this.rows.length}get eventOptions(){let e=new Set,t=[];return(this.className===`Root`?this.metaEvents.concat(th):this.metaEvents).forEach(n=>{!n||!n.eventKey||e.has(n.eventKey)||(e.add(n.eventKey),t.push(n))}),t}eventOptionsFor(e){let t=this.eventOptions;return e.eventKey&&!t.some(t=>t.eventKey===e.eventKey)?t.concat([{eventKey:e.eventKey,eventName:e.eventName||e.eventKey,_unknown:!0}]):t}actionOptionsFor(e){let t=this.eventOptions.find(t=>t.eventKey===e.eventKey),n=t&&t.includes,r=n&&n.length?nh.filter(e=>n.indexOf(e.actionType)>=0):nh;return e.actionType&&!r.some(t=>t.actionType===e.actionType)?r.concat([{actionType:e.actionType,actionName:e.actionType,_unknown:!0}]):r}eventNameOf(e){let t=this.eventOptions.find(t=>t.eventKey===e);return t?t.eventName:``}get eventactionMap(){let e={};return this.rows.forEach(t=>{t.eventKey&&(e[t.eventKey]=t)}),e}rowForEvent(e){return this.eventactionMap[e]||null}toggleEvent(e){let t=e&&e.eventKey;if(!t)return;let n=this.rowForEvent(t);if(n)this.removeRow(n);else{let n=this.actionOptionsForEvent(t,``),r=n.length?n[0].actionType:`customAction`,i=new oh({event:{eventKey:t,eventName:e.eventName||this.eventNameOf(t)},action:{actionType:r,properties:[]}});this.rows.push(i)}}actionOptionsForEvent(e,t){let n=this.eventOptions.find(t=>t.eventKey===e),r=n&&n.includes,i=r&&r.length?nh.filter(e=>r.indexOf(e.actionType)>=0):nh;return t&&!i.some(e=>e.actionType===t)?i.concat([{actionType:t,actionName:t,_unknown:!0}]):i}setEventKey(e,t){e.eventKey=t||``,e.eventName=this.eventNameOf(e.eventKey)||e.eventName;let n=this.actionOptionsFor(e);e.actionType&&!n.some(t=>t.actionType===e.actionType)&&n.length&&this.setActionType(e,n[0].actionType)}setActionType(e,t){if(t===e.actionType)return;let n={};e.properties.forEach(e=>{e.itemKey&&(n[e.itemKey]={itemValue:eh(e.itemValue),itemValueFrom:e.itemValueFrom})}),e.actionType=t||``,e.buildProps([]),e.properties.forEach(e=>{let t=n[e.itemKey];!t||t.itemValue===``||t.itemValue==null||(e.itemValue=t.itemValue,e.itemValueFrom=t.itemValueFrom,e.itemUpdated=!0)}),Y.updatePropertyVisible(e.properties)}addRow(){let e=this.eventOptions[0],t=new oh({event:e?{eventKey:e.eventKey,eventName:e.eventName}:{},action:{actionType:`customAction`,properties:[]}});return this.rows.push(t),t}removeRow(e){let t=this.rows.indexOf(e);t>=0&&this.rows.splice(t,1)}moveRow(e,t){if(e<0||e>=this.rows.length)return;let n=Math.max(0,Math.min(this.rows.length-1,t));if(n===e)return;let[r]=this.rows.splice(e,1);this.rows.splice(n,0,r)}refreshVisible(){this.rows.forEach(e=>Y.updatePropertyVisible(e.properties))}export(){return this.rows.map(e=>{let t=e.eventKey?Object.assign({},e._extraEvent,{eventName:this.eventNameOf(e.eventKey)||e.eventName||void 0,eventKey:e.eventKey}):Object.assign({},e._extraEvent);return t.eventName===void 0&&delete t.eventName,{event:t,action:Object.assign({},e._extraAction,{actionType:e.actionType,properties:e.exportProps()})}})}applyToSchema(){!this.hadKey&&!this.rows.length||(this.schemaNode.eventactions=this.export(),this.hadKey=!0)}},ch={name:`EventEditor`,props:{comp:{type:Object,required:!0},compNames:{type:Object,default:()=>({})},rt:{type:Object,required:!0}},emits:[`apply`,`commit`,`close`],data(){return{eventModel:null,activeKey:``,helpOpen:!1,_t:null,_snapshot:null,_dirty:!1,_written:!1}},computed:{schemaNode(){return this.comp&&this.comp._schemaNode||null},compName(){let e=this.schemaNode&&this.schemaNode.className;return e?this.compNames&&this.compNames[e]||e:`节点`},activeRow(){return!this.eventModel||!this.activeKey?null:this.eventModel.rowForEvent(this.activeKey)||null},helpText(){return(this.activeRow?this.actionDesc(this.activeRow.actionType):``)||`先在上方开启事件,再选择动作类型并填写参数;编辑即时预览,「应用」写入历史。`}},watch:{comp:{immediate:!0,handler(){this.buildModel()}}},methods:{buildModel(){let e=this.schemaNode;this.eventModel=e?nn(new sh(e)):null,this.activeKey=``,this.helpOpen=!1,this._snapshot=e?this.snapshotEventActions(e):null,this._dirty=!1,this._written=!1,this.autoSelect()},snapshotEventActions(e){let t=Object.prototype.hasOwnProperty.call(e,`eventactions`);return{hadKey:t,eventactions:t?JSON.parse(JSON.stringify(e.eventactions||[])):[]}},restoreSnapshot(){let e=this.schemaNode;!e||!this._snapshot||(this._snapshot.hadKey?e.eventactions=JSON.parse(JSON.stringify(this._snapshot.eventactions||[])):delete e.eventactions)},autoSelect(){if(!this.eventModel){this.activeKey=``;return}let e=this.eventModel.eventOptions.find(e=>this.eventModel.rowForEvent(e.eventKey));this.activeKey=e?e.eventKey:``},isOn(e){return!!(this.eventModel&&this.eventModel.rowForEvent(e.eventKey))},onSelectEvent(e){this.activeKey=e.eventKey},onToggleEvent(e){let t=this.isOn(e);this.eventModel.toggleEvent(e),this._dirty=!0,t?this.activeKey===e.eventKey&&(this.activeKey=``):this.activeKey=e.eventKey,this.scheduleApply()},actionOptions(e){return(this.eventModel.actionOptionsForEvent(e.eventKey,e.actionType)||[]).map(e=>({key:e.actionType,value:e.actionName+(e._unknown?` · meta 未定义`:``)}))},actionDesc(e){return rh[e]&&rh[e].actionDesc||``},onActionType(e,t){this.eventModel.setActionType(e,t),this._dirty=!0,this.scheduleApply()},onEventLeaf(){this.eventModel.refreshVisible(),this._dirty=!0,this.scheduleApply()},scheduleApply(){this._t&&clearTimeout(this._t),this._t=setTimeout(()=>{this.applyAll(),this.$emit(`apply`)},250)},applyAll(){this.eventModel&&this.eventModel.applyToSchema()},onApplyWrite(){this._t&&=(clearTimeout(this._t),null),this.applyAll(),this._written=!0,this.$emit(`apply`),this.$emit(`commit`),this.$emit(`close`)},onCancel(){this.onClose()},onClose(){this._t&&=(clearTimeout(this._t),null),this._dirty&&!this._written&&(this.restoreSnapshot(),this.$emit(`apply`)),this.$emit(`close`)}}},lh={class:`ee-overlay`},uh={class:`ee-panel`},dh={class:`ee-head`},fh={class:`ee-title`},ph={class:`ee-cls`},mh={class:`ee-body`},hh={class:`ee-side`},gh={key:0,class:`ee-empty`},_h={key:1,class:`ee-evt-list`},vh=[`onClick`],yh=[`title`],bh=[`aria-checked`,`onClick`],xh=[`title`],Sh={class:`ee-help__text`},Ch={class:`ee-detail`},wh={class:`ee-detail-head`},Th={class:`ee-field-row`},Eh={class:`ee-detail-body`},Dh={key:1,class:`ee-empty`},Oh={key:2,class:`ee-evt-orphan`},kh={key:1,class:`ee-empty ee-detail-empty`},Ah={class:`ee-foot`},jh={class:`ee-foot-btns`};function Mh(e,t,n,r,i,a){let o=L(`Dropdown`),s=L(`prop-tree`);return B(),V(`div`,lh,[U(`div`,uh,[U(`div`,dh,[U(`span`,fh,[G(` 事件配置 · `+M(a.compName)+` `,1),U(`em`,ph,M(a.schemaNode&&a.schemaNode.className),1)]),U(`button`,{class:`ee-close`,type:`button`,onClick:t[0]||=(...e)=>a.onClose&&a.onClose(...e)})]),U(`div`,mh,[U(`aside`,hh,[!i.eventModel||!i.eventModel.eventOptions.length?(B(),V(`p`,gh,`该节点无可用事件`)):(B(),V(`div`,_h,[(B(!0),V(z,null,R(i.eventModel.eventOptions,e=>(B(),V(`div`,{key:e.eventKey,class:j([`ee-evt`,{"is-on":a.isOn(e),"is-sel":i.activeKey===e.eventKey}]),onClick:t=>a.onSelectEvent(e)},[U(`span`,{class:`ee-evt-name`,title:e.eventDesc||e.eventName||e.eventKey},M(e.eventName||e.eventKey),9,yh),U(`button`,{class:j([`ee-switch`,{"is-on":a.isOn(e)}]),type:`button`,role:`switch`,"aria-checked":a.isOn(e),onClick:q(t=>a.onToggleEvent(e),[`stop`])},[...t[7]||=[U(`span`,{class:`ee-switch__dot`},null,-1)]],10,bh)],10,vh))),128))])),K(` 帮助图标:与事件项左右靠边、垂直居中;点击弹出当前动作的使用说明 `),U(`button`,{class:`ee-help`,type:`button`,title:i.helpOpen?`关闭使用说明`:`使用说明`,onClick:t[1]||=q(e=>i.helpOpen=!i.helpOpen,[`stop`])},[...t[8]||=[U(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`circle`,{cx:`12`,cy:`12`,r:`10`}),U(`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}),U(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})],-1)]],8,xh),i.helpOpen?(B(),V(`div`,{key:2,class:`ee-help__mask`,onClick:t[2]||=e=>i.helpOpen=!1})):K(`v-if`,!0),W(ic,{name:`pop`},{default:Lr(()=>[i.helpOpen?(B(),V(`div`,{key:0,class:`ee-help__pop`,onClick:t[3]||=q(()=>{},[`stop`])},[U(`p`,Sh,M(a.helpText),1)])):K(`v-if`,!0)]),_:1})]),U(`section`,Ch,[a.activeRow?(B(),V(z,{key:0},[U(`div`,wh,[U(`div`,Th,[t[9]||=U(`label`,{class:`ee-field-label`},`动作类型`,-1),W(o,{value:a.activeRow.actionType,options:a.actionOptions(a.activeRow),size:`sm`,block:``,onChange:t[4]||=e=>a.onActionType(a.activeRow,e)},null,8,[`value`,`options`])])]),U(`div`,Eh,[a.activeRow.properties.length?(B(),H(s,{key:a.activeRow.formKey,properties:a.activeRow.properties,mode:`event`,plain:!0,onLeafChange:a.onEventLeaf},null,8,[`properties`,`onLeafChange`])):(B(),V(`p`,Dh,`该动作无可配置参数`)),a.activeRow.extraProperties.length?(B(),V(`p`,Oh,` 另有 `+M(a.activeRow.extraProperties.length)+` 项 meta 未定义的参数,已原样保留 `,1)):K(`v-if`,!0)])],64)):(B(),V(`p`,kh,`请在左侧开启并选择一个事件`))])]),U(`div`,Ah,[t[10]||=U(`span`,{class:`ee-tip`},`编辑即时预览(不记历史);「应用」写入历史并关闭,落盘由顶栏「保存到本地」负责`,-1),U(`div`,jh,[U(`button`,{class:`ee-btn ee-btn--ghost`,type:`button`,onClick:t[5]||=(...e)=>a.onCancel&&a.onCancel(...e)},`取消`),U(`button`,{class:`ee-btn`,type:`button`,onClick:t[6]||=(...e)=>a.onApplyWrite&&a.onApplyWrite(...e)},`应用`)])])])])}var Nh=X(ch,[[`render`,Mh],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/EventEditor.vue`]]),Ph={name:`ApiPayloadTree`,props:{value:{default:()=>({})},depth:{type:Number,default:0},path:{type:Array,default:()=>[]},openState:{type:Object,default:null},rootKeyLabel:{type:[String,Number,null],default:null},maxDepth:{type:Number,default:100},rootCollapsed:{type:Boolean,default:!1}},data(){return{localOpenState:this.openState||nn({}),rootOpen:!1}},computed:{isRoot(){return this.depth===0},isArrayRoot(){return Array.isArray(this.value)},rootCount(){return this.isArrayRoot?this.value.length:Object.keys(this.value||{}).length},state(){return this.openState||this.localOpenState},entries(){let e=this.value;return Array.isArray(e)?e.map((e,t)=>this.makeEntry(String(t),e,!0,t)):e&&typeof e==`object`?Object.keys(e).map(t=>this.makeEntry(t,e[t],!1,t)):[]}},methods:{typeOf(e){return e===null?`null`:Array.isArray(e)?`array`:typeof e},isComplex(e){return typeof e==`object`&&!!e},makeEntry(e,t,n,r){let i=Array.isArray(t);return{keyLabel:e,value:t,isArray:i,count:i?t.length:t&&typeof t==`object`?Object.keys(t).length:0,type:this.typeOf(t),path:[...this.path,r]}},pathKey(e){return e.path.join(`/`)},isOpen(e){let t=this.state[this.pathKey(e)];return t!==void 0&&t},canExpand(e){return this.isComplex(e.value)&&this.depth<this.maxDepth},toggle(e){let t=this.pathKey(e);this.state[t]=!this.isOpen(e)},preview(e){if(Array.isArray(e))return` … `+e.length+` 项`;let t=Object.keys(e);return` … `+t.slice(0,3).join(`, `)+(t.length>3?`, …`:``)+` `},format(e){return e===null?`null`:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e)}}},Fh={key:0,class:`apt__leaf apt__leaf--root`},Ih={key:0,class:`jt__key`},Lh={key:1,class:`jt__colon`},Rh={class:`jt__bracket`},zh={key:0,class:`jt__preview`},Bh={key:1,class:`jt__count`},Vh={key:2,class:`jt__bracket`},Hh=[`onClick`],Uh={key:0,class:`jt__key`},Wh={class:`jt__bracket`},Gh={class:`jt__preview`},Kh={class:`jt__bracket`},qh={class:`apt__leaf`},Jh={key:0,class:`jt__key`},Yh={key:1,class:`jt__colon`},Xh={class:`apt__leaf`},Zh={key:0,class:`jt__key`},Qh={key:1,class:`jt__colon`},$h={key:3,class:`apt__children`},eg={class:`apt__close`},tg={class:`jt__bracket`},ng={class:`jt__count`},rg={key:1,class:`apt__close`},ig={class:`jt__bracket`},ag={class:`jt__count`};function og(e,t,n,r,i,a){let o=L(`ApiPayloadTree`,!0);return B(),V(`div`,{class:j([`apt`,{"apt--root":a.isRoot}])},[K(` 根级别:非复合值(如 payload 就是字符串)直接作为单个叶子展示 `),a.isComplex(n.value)?(B(),V(z,{key:1},[K(` 日志场景(rootCollapsed):根对象/数组先收成一行摘要、点击展开(Chrome 控制台风格),
|
|
147
|
-
避免每个实参默认逐键占行稀释日志密度;接口调用面板不传该 prop,行为不变 `),n.rootCollapsed&&a.isRoot?(B(),V(`div`,{key:0,class:`apt__branch apt__branch--root`,onClick:t[0]||=e=>i.rootOpen=!i.rootOpen},[U(`span`,{class:j([`apt__caret`,{"apt__caret--open":i.rootOpen}])},`▶`,2),U(`span`,Rh,M(a.isArrayRoot?`[`:`{`),1),i.rootOpen?(B(),V(`span`,Bh,M(a.rootCount)+` `+M(a.isArrayRoot?`项`:`键`),1)):(B(),V(`span`,zh,M(a.preview(n.value)),1)),i.rootOpen?K(`v-if`,!0):(B(),V(`span`,Vh,M(a.isArrayRoot?`]`:`}`),1))])):K(`v-if`,!0),I(U(`div`,{class:j([`apt__list`,{"apt__list--nested":n.rootCollapsed&&a.isRoot&&i.rootOpen}])},[(B(!0),V(z,null,R(a.entries,(e,r)=>(B(),V(`div`,{key:r,class:`apt__node`},[K(` 复合类型且未超最大深度:可折叠分支 `),a.canExpand(e)?(B(),V(`div`,{key:0,class:`apt__branch`,onClick:t=>a.toggle(e)},[U(`span`,{class:j([`apt__caret`,{"apt__caret--open":a.isOpen(e)}])},`▶`,2),e.keyLabel===null?K(`v-if`,!0):(B(),V(`span`,Uh,M(e.keyLabel),1)),U(`span`,Wh,M(e.isArray?`[`:`{`),1),a.isOpen(e)?K(`v-if`,!0):(B(),V(z,{key:1},[U(`span`,Gh,M(a.preview(e.value)),1),U(`span`,Kh,M(e.isArray?`]`:`}`),1)],64))],8,Hh)):a.isComplex(e.value)?(B(),V(z,{key:1},[K(` 复合类型但已达最大深度:不再可展开,仅作摘要叶子 `),U(`div`,qh,[t[2]||=U(`span`,{class:`apt__caret apt__caret--leaf`},`▶`,-1),e.keyLabel===null?K(`v-if`,!0):(B(),V(`span`,Jh,M(e.keyLabel),1)),e.keyLabel===null?K(`v-if`,!0):(B(),V(`span`,Yh,`:`)),U(`span`,{class:j([`jt__val`,`jt__val--`+(e.isArray?`array`:`object`)])},M(e.count)+` `+M(e.isArray?`项`:`键`)+`(已折叠)`,3)])],2112)):(B(),V(z,{key:2},[K(` 基础类型:叶子 `),U(`div`,Xh,[t[3]||=U(`span`,{class:`apt__caret apt__caret--leaf`},`▶`,-1),e.keyLabel===null?K(`v-if`,!0):(B(),V(`span`,Zh,M(e.keyLabel),1)),e.keyLabel===null?K(`v-if`,!0):(B(),V(`span`,Qh,`:`)),U(`span`,{class:j([`jt__val`,`jt__val--`+e.type])},M(a.format(e.value)),3)])],2112)),K(` 展开后的子层级 `),a.isComplex(e.value)&&a.isOpen(e)?(B(),V(`div`,$h,[W(o,{value:e.value,depth:n.depth+1,path:e.path,"open-state":a.state,"max-depth":n.maxDepth},null,8,[`value`,`depth`,`path`,`open-state`,`max-depth`]),U(`div`,eg,[U(`span`,tg,M(e.isArray?`]`:`}`),1),U(`span`,ng,M(e.count)+` `+M(e.isArray?`项`:`键`),1)])])):K(`v-if`,!0)]))),128))],2),[[Sc,!(n.rootCollapsed&&a.isRoot)||i.rootOpen]]),n.rootCollapsed&&a.isRoot&&i.rootOpen?(B(),V(`div`,rg,[U(`span`,ig,M(a.isArrayRoot?`]`:`}`),1),U(`span`,ag,M(a.rootCount)+` `+M(a.isArrayRoot?`项`:`键`),1)])):K(`v-if`,!0)],64)):(B(),V(`div`,Fh,[t[1]||=U(`span`,{class:`apt__caret apt__caret--leaf`},`▶`,-1),n.rootKeyLabel===null?K(`v-if`,!0):(B(),V(`span`,Ih,M(n.rootKeyLabel),1)),n.rootKeyLabel===null?K(`v-if`,!0):(B(),V(`span`,Lh,`:`)),U(`span`,{class:j([`jt__val`,`jt__val--`+a.typeOf(n.value)])},M(a.format(n.value)),3)]))],2)}var sg=X(Ph,[[`render`,og],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ApiPayloadTree.vue`]]),cg={name:`LogValue`,components:{ApiPayloadTree:sg},props:{value:{default:null}},computed:{complex(){return this.value!==null&&typeof this.value==`object`},typeClass(){if(this.value===null||this.value===void 0)return`null`;if(Array.isArray(this.value))return`array`;let e=typeof this.value;return e===`string`||e===`number`||e===`boolean`?e:`null`},display(){let e=this.value;if(e===void 0)return`undefined`;if(e===null)return`null`;if(typeof e==`string`)return e;if(typeof e==`function`)return`[Function `+(e.name||`anonymous`)+`]`;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e);try{return JSON.stringify(e)}catch{return String(e)}}}},lg={class:`log__json`};function ug(e,t,n,r,i,a){let o=L(`ApiPayloadTree`);return a.complex?(B(),V(z,{key:1},[K(` 日志里的对象/数组参数:根节点默认一行摘要、点击展开,保证日志行密度 `),U(`div`,lg,[W(o,{value:n.value,"max-depth":14,"root-collapsed":``},null,8,[`value`])])],2112)):(B(),V(`span`,{key:0,class:j([`log__val`,`jt__val--`+a.typeClass])},M(a.display),3))}var dg=X(cg,[[`render`,ug],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/LogValue.vue`]]),fg={name:`Dropdown`,emits:[`input`,`change`],props:{value:{type:[String,Number,null],default:``},options:{type:Array,default:()=>[]},placeholder:{type:String,default:`请选择`},size:{type:String,default:`sm`},block:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placement:{type:String,default:`bottom-start`},width:{type:[String,Number],default:null},borderless:{type:Boolean,default:!1},label:{type:String,default:null},clearable:{type:Boolean,default:!1}},data(){return{open:!1,dropUp:!1}},computed:{hasTriggerSlot(){return!!this.$slots.trigger},current(){return this.options.find(e=>e.key===this.value)||null},hasValue(){return this.value!==``&&this.value!==null&&this.value!==void 0},displayText(){return this.label==null?this.current?this.current.value||String(this.current.key):this.placeholder||`请选择`:this.label},chevSize(){return this.size===`xs`?11:this.size===`md`||this.size===`lg`?13:12},checkSize(){return this.size===`xs`?11:12},rootStyle(){return this.width==null?null:{width:typeof this.width==`number`?this.width+`px`:this.width}}},watch:{open(e){e?document.addEventListener(`click`,this.onDocClick,!0):document.removeEventListener(`click`,this.onDocClick,!0)}},beforeUnmount(){document.removeEventListener(`click`,this.onDocClick,!0)},methods:{toggle(){this.disabled||(this.open?this.open=!1:this.openMenu())},openMenu(){let e=this.$refs.root;if(e){let t=Math.min(this.options.length*31+12,290);this.dropUp=this.shouldDropUp(e,t)}this.open=!0,this.$nextTick(()=>{let e=this.$refs.pop,t=this.$refs.root;if(!e||!t)return;let n=this.shouldDropUp(t,e.offsetHeight);n!==this.dropUp&&(this.dropUp=n)})},shouldDropUp(e,t){let n=e.getBoundingClientRect(),r=this.getClipRect(e),i=r.bottom-n.bottom,a=n.top-r.top;return i<t&&a>=t},getClipRect(e){let t=e.parentElement;for(;t&&t!==document.body;){let e=getComputedStyle(t).overflowY;if(e===`auto`||e===`scroll`||e===`hidden`)return t.getBoundingClientRect();t=t.parentElement}return document.documentElement.getBoundingClientRect()},close(){this.open=!1,this.dropUp=!1},clear(){this.disabled||(this.close(),this.$emit(`input`,``),this.$emit(`change`,``))},onDocClick(e){this.$refs.root&&!this.$refs.root.contains(e.target)&&this.close()},onHover(){},onItemClick(e){e.disabled||this.choose(e.key)},choose(e){this.close(),e===this.value||this.$emit(`input`,e),this.$emit(`change`,e)}}},pg=[`disabled`],mg=[`title`],hg=[`width`,`height`],gg={class:`dd__list`},_g=[`onMousemove`,`onClick`],vg={class:`dd__item-text`},yg=[`width`,`height`],bg={key:0,class:`dd__empty`};function xg(e,t,n,r,i,a){return B(),V(`div`,{ref:`root`,class:j([`dd`,[`dd--`+n.size,{"dd--open":i.open,"dd--block":n.block,"dd--disabled":n.disabled,"dd--borderless":n.borderless,"dd--dropup":i.dropUp}]]),style:A(a.rootStyle)},[a.hasTriggerSlot?(B(),V(`div`,{key:1,class:`dd__trigger dd__trigger--slot`,onClick:t[2]||=(...e)=>a.toggle&&a.toggle(...e)},[Qi(e.$slots,`trigger`,{open:i.open,toggle:a.toggle})])):(B(),V(`button`,{key:0,type:`button`,class:j([`dd__trigger`,{"dd__trigger--active":i.open}]),disabled:n.disabled,onClick:t[1]||=(...e)=>a.toggle&&a.toggle(...e)},[K(` current 插槽:自定义触发器内的已选值呈现(如「彩色类型标签 + 中文名」),缺省仍为纯文本 `),U(`span`,{class:`dd__label`,title:a.displayText},[Qi(e.$slots,`current`,{opt:a.current,text:a.displayText},()=>[G(M(a.displayText),1)])],8,mg),n.clearable&&a.hasValue?(B(),V(`span`,{key:0,class:`dd__clear`,role:`button`,tabindex:`-1`,title:`清空`,onClick:t[0]||=q((...e)=>a.clear&&a.clear(...e),[`stop`])},`✕`)):K(`v-if`,!0),(B(),V(`svg`,{class:`dd__chev`,viewBox:`0 0 16 16`,width:a.chevSize,height:a.chevSize,"aria-hidden":`true`},[...t[3]||=[U(`use`,{href:`#icon-chevron`},null,-1)]],8,hg))],10,pg)),W(ic,{name:`dd-fade`},{default:Lr(()=>[i.open?(B(),V(`div`,{key:0,ref:`pop`,class:j([`dd__pop`,[`dd__pop--`+n.placement]])},[Qi(e.$slots,`default`,{close:a.close,choose:a.choose},()=>[U(`ul`,gg,[(B(!0),V(z,null,R(n.options,r=>(B(),V(`li`,{key:r.key,class:j([`dd__item`,{"dd__item--selected":r.key===n.value,"dd__item--disabled":r.disabled}]),onMousemove:e=>a.onHover(r),onClick:e=>a.onItemClick(r)},[K(` option 插槽:自定义单个选项的内容,缺省为 opt.value 纯文本 `),U(`span`,vg,[Qi(e.$slots,`option`,{opt:r},()=>[G(M(r.value),1)])]),r.key===n.value?(B(),V(`svg`,{key:0,class:`dd__check`,viewBox:`0 0 16 16`,width:a.checkSize,height:a.checkSize,"aria-hidden":`true`},[...t[4]||=[U(`use`,{href:`#icon-check`},null,-1)]],8,yg)):K(`v-if`,!0)],42,_g))),128)),n.options.length?K(`v-if`,!0):(B(),V(`li`,bg,M(n.placeholder||`无选项`),1))])])],2)):K(`v-if`,!0)]),_:3})],6)}var Sg=X(fg,[[`render`,xg],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Dropdown.vue`]]),Cg=/^-?(?:\d+(?:\.\d*)?|\.\d*)?$/,wg={name:`NumberStepper`,props:{value:{type:[String,Number],default:``},step:{type:Number,default:1},min:{type:Number,default:-1/0},max:{type:Number,default:1/0},placeholder:{type:String,default:`请输入数字`},disabled:{type:Boolean,default:!1}},emits:[`input`,`change`],data(){return{text:``}},computed:{stepSize(){return Number.isFinite(this.step)&&this.step>0?this.step:1},num(){let e=parseFloat(this.text);return Number.isFinite(e)?e:null}},watch:{value:{immediate:!0,handler(e){let t=e==null?``:String(e);t!==this.text&&(this.text=t)}}},methods:{canStep(e){let t=this.num===null?0:this.num;return e>0?t<this.max:t>this.min},tidy(e){return Number(e.toPrecision(12))},clamp(e){return Math.min(this.max,Math.max(this.min,e))},onInput(e){if(!Cg.test(e)){this.$refs.field.value=this.text;return}this.text=e,this.$emit(`input`,e)},bump(e){if(this.disabled)return;let t=this.num===null?0:this.num;this.text=String(this.clamp(this.tidy(t+e*this.stepSize))),this.$emit(`input`,this.text),this.$emit(`change`)}}},Tg={class:`st-number st-number--step`},Eg=[`disabled`],Dg=[`value`,`placeholder`,`disabled`],Og=[`disabled`];function kg(e,t,n,r,i,a){return B(),V(`div`,Tg,[U(`button`,{type:`button`,class:`st-number__step`,title:`减少`,"aria-label":`减少`,disabled:n.disabled||!a.canStep(-1),onClick:t[0]||=e=>a.bump(-1)},[...t[6]||=[U(`svg`,{viewBox:`0 0 16 16`,width:`12`,height:`12`,"aria-hidden":`true`},[U(`line`,{x1:`3.5`,y1:`8`,x2:`12.5`,y2:`8`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.6`,"stroke-linecap":`round`})],-1)]],8,Eg),U(`input`,{ref:`field`,class:`st-number__field`,type:`text`,inputmode:`decimal`,value:i.text,placeholder:n.placeholder,disabled:n.disabled,onInput:t[1]||=e=>a.onInput(e.target.value),onChange:t[2]||=t=>e.$emit(`change`),onKeydown:[t[3]||=vl(q(e=>a.bump(1),[`prevent`]),[`up`]),t[4]||=vl(q(e=>a.bump(-1),[`prevent`]),[`down`])]},null,40,Dg),U(`button`,{type:`button`,class:`st-number__step st-number__step--inc`,title:`增加`,"aria-label":`增加`,disabled:n.disabled||!a.canStep(1),onClick:t[5]||=e=>a.bump(1)},[...t[7]||=[U(`svg`,{viewBox:`0 0 16 16`,width:`12`,height:`12`,"aria-hidden":`true`},[U(`path`,{d:`M8 3.5v9M3.5 8h9`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.6`,"stroke-linecap":`round`})],-1)]],8,Og)])}var Ag=X(wg,[[`render`,kg],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/NumberStepper.vue`]]),jg={value:{default:``},options:{type:Object,default:()=>({})},watches:{type:Object,default:()=>({})},itemInfo:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1}},Mg=[`input`,`change`],Ng=[{key:`flex-start`,name:`起始对齐`,bars:[2.6,6.2]},{key:`center`,name:`居中`,bars:[4.6,8.2]},{key:`flex-end`,name:`末端对齐`,bars:[6.6,10.2]},{key:`space-between`,name:`两端对齐`,bars:[2.6,10.2]},{key:`space-around`,name:`等距间隔`,bars:[3.6,9.2]}],Pg=[{key:`flex-start`,name:`起始对齐`,a:[3.6,6.4],b:[3.6,4.4]},{key:`center`,name:`居中`,a:[4.8,6.4],b:[5.8,4.4]},{key:`flex-end`,name:`末端对齐`,a:[6,6.4],b:[8,4.4]},{key:`baseline`,name:`基线对齐`,a:[4,5.6],b:[6,3.6],baseline:9.6},{key:`stretch`,name:`拉伸`,a:[3.6,9.4],b:[3.6,9.4]}],Fg=[{key:`normal`,value:`正体`,title:`font-style: normal`,icon:{text:`A`}},{key:`italic`,value:`斜体`,title:`font-style: italic`,icon:{text:`A`,italic:!0}}],Ig=[{key:`none`,value:`无`,title:`text-decoration: none`,icon:{text:`A`}},{key:`underline`,value:`下划线`,title:`text-decoration: underline`,icon:{text:`A`,lines:[[3.5,14,12.5,14]]}},{key:`line-through`,value:`删除线`,title:`text-decoration: line-through`,icon:{text:`A`,lines:[[3,8.6,13,8.6]]}}],Lg={name:`SetSegment`,props:{...jg,kind:{type:String,default:`TabSelect`}},emits:Mg,computed:{current(){return this.value===void 0||this.value===null?``:this.value},flexDirection(){return this.options.flexDirection||this.watches.flexDirection||`row`},rotate(){return(this.kind===`JustifyContentStyle`||this.kind===`AlignItemsStyle`)&&this.flexDirection===`column`},items(){return this.kind===`JustifyContentStyle`?Ng.map(e=>({key:e.key,value:e.name,title:`justify-content: ${e.key}`,icon:{frame:!0,rects:e.bars.map(e=>[e,4.8,3.2,6.4])}})):this.kind===`AlignItemsStyle`?Pg.map(e=>({key:e.key,value:e.name,title:`align-items: ${e.key}`,icon:{frame:!0,rects:[[4.2,e.a[0],3.2,e.a[1]],[8.6,e.b[0],3.2,e.b[1]]],lines:e.baseline?[[1.6,e.baseline,14.4,e.baseline]]:void 0}})):this.kind===`FontStyle`?Fg:this.kind===`TextDecorationStyle`?Ig:this.options.iParamList||[]}},methods:{pick(e){this.disabled||(this.$emit(`input`,e.key),this.$emit(`change`))}}},Rg={class:`st-seg`},zg=[`title`,`onClick`],Bg={key:0,x:`1`,y:`2.6`,width:`14`,height:`10.8`,rx:`1.4`,fill:`none`,stroke:`currentColor`,"stroke-width":`1`,opacity:`0.35`},Vg=[`x`,`y`,`width`,`height`],Hg=[`x1`,`y1`,`x2`,`y2`],Ug=[`font-style`],Wg={key:1};function Gg(e,t,n,r,i,a){return B(),V(`div`,Rg,[(B(!0),V(z,null,R(a.items,(e,t)=>(B(),V(`div`,{key:e.key+`_`+t,class:j([`st-seg__item`,{"st-seg__item--on":String(e.key)===String(a.current)}]),title:e.title||e.value,onClick:t=>a.pick(e)},[e.icon?(B(),V(`svg`,{key:0,class:`st-seg__icon`,viewBox:`0 0 16 16`,style:A(a.rotate?`transform:rotate(90deg)`:``)},[K(` 容器外框 `),e.icon.frame?(B(),V(`rect`,Bg)):K(`v-if`,!0),K(` 内容条 `),(B(!0),V(z,null,R(e.icon.rects||[],(e,t)=>(B(),V(`rect`,{key:`r`+t,x:e[0],y:e[1],width:e[2],height:e[3],rx:`0.6`,fill:`currentColor`,stroke:`none`},null,8,Vg))),128)),K(` 辅助线(基线 / 下划线 / 删除线) `),(B(!0),V(z,null,R(e.icon.lines||[],(e,t)=>(B(),V(`line`,{key:`l`+t,x1:e[0],y1:e[1],x2:e[2],y2:e[3],stroke:`currentColor`,"stroke-width":`1.1`},null,8,Hg))),128)),K(` 字形(FontStyle / TextDecorationStyle) `),e.icon.text?(B(),V(`text`,{key:1,x:`8`,y:`12`,"text-anchor":`middle`,"font-size":`11`,"font-weight":`600`,fill:`currentColor`,stroke:`none`,"font-style":e.icon.italic?`italic`:`normal`},M(e.icon.text),9,Ug)):K(`v-if`,!0)],4)):(B(),V(`span`,Wg,M(e.value),1))],10,zg))),128))])}var Kg=X(Lg,[[`render`,Gg],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetSegment.vue`]]),qg=window;function Jg(e,t,n={}){let r={tab:` `,indentOn:/[({\[]$/,moveToNewLine:/^[)}\]]/,spellcheck:!1,catchTab:!0,preserveIdent:!0,addClosing:!0,history:!0,window:qg,autoclose:{open:`([{'"`,close:`)]}'"`},...n},i=r.window,a=i.document,o=[],s=[],c=-1,l=!1,u=()=>void 0,d;e.setAttribute(`contenteditable`,`plaintext-only`),e.setAttribute(`spellcheck`,r.spellcheck?`true`:`false`),e.style.outline=`none`,e.style.overflowWrap=`break-word`,e.style.overflowY=`auto`,e.style.whiteSpace=`pre-wrap`;let f=(e,n)=>{t(e,n)},p=i.navigator.userAgent.match(/Firefox\/([0-9]+)\./),m=p?parseInt(p[1]):0,h=!1;(e.contentEditable!==`plaintext-only`||m>=136)&&(h=!0),h&&e.setAttribute(`contenteditable`,`true`);let g=fe(()=>{let t=x();f(e,t),S(t)},30),_=!1,v=e=>!ce(e)&&!le(e)&&e.key!==`Meta`&&e.key!==`Control`&&e.key!==`Alt`&&!e.key.startsWith(`Arrow`),y=fe(e=>{v(e)&&(re(),_=!1)},300),b=(t,n)=>{o.push([t,n]),e.addEventListener(t,n)};b(`keydown`,e=>{e.defaultPrevented||(d=me(),r.preserveIdent?T(e):E(e),r.catchTab&&D(e),r.addClosing&&te(e),r.history&&(ne(e),v(e)&&!_&&(re(),_=!0)),h&&!ue(e)&&S(x()))}),b(`keyup`,e=>{e.defaultPrevented||e.isComposing||(d!==me()&&g(),y(e),u(me()))}),b(`focus`,e=>{l=!0}),b(`blur`,e=>{l=!1}),b(`paste`,e=>{re(),ie(e),re(),u(me())}),b(`cut`,e=>{re(),ae(e),re(),u(me())});function x(){let t=ge(),n={start:0,end:0,dir:void 0},{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=t;if(!r||!o)throw`error1`;if(r===e&&o===e)return n.start=i>0&&e.textContent?e.textContent.length:0,n.end=s>0&&e.textContent?e.textContent.length:0,n.dir=s>=i?`->`:`<-`,n;if(r.nodeType===Node.ELEMENT_NODE){let e=a.createTextNode(``);r.insertBefore(e,r.childNodes[i]),r=e,i=0}if(o.nodeType===Node.ELEMENT_NODE){let e=a.createTextNode(``);o.insertBefore(e,o.childNodes[s]),o=e,s=0}return oe(e,e=>{if(e===r&&e===o)return n.start+=i,n.end+=s,n.dir=i<=s?`->`:`<-`,`stop`;if(e===r)if(n.start+=i,!n.dir)n.dir=`->`;else return`stop`;else if(e===o)if(n.end+=s,!n.dir)n.dir=`<-`;else return`stop`;e.nodeType===Node.TEXT_NODE&&(n.dir!=`->`&&(n.start+=e.nodeValue.length),n.dir!=`<-`&&(n.end+=e.nodeValue.length))}),e.normalize(),n}function S(t){let n=ge(),r,i=0,o,s=0;if(t.dir||=`->`,t.start<0&&(t.start=0),t.end<0&&(t.end=0),t.dir==`<-`){let{start:e,end:n}=t;t.start=n,t.end=e}let c=0;oe(e,e=>{if(e.nodeType!==Node.TEXT_NODE)return;let n=(e.nodeValue||``).length;if(c+n>t.start&&(r||(r=e,i=t.start-c),c+n>t.end))return o=e,s=t.end-c,`stop`;c+=n}),r||(r=e,i=e.childNodes.length),o||(o=e,s=e.childNodes.length),t.dir==`<-`&&([r,i,o,s]=[o,s,r,i]);{let e=C(r);if(e){let t=a.createTextNode(``);e.parentNode?.insertBefore(t,e),r=t,i=0}let t=C(o);if(t){let e=a.createTextNode(``);t.parentNode?.insertBefore(e,t),o=e,s=0}}n.setBaseAndExtent(r,i,o,s),e.normalize()}function C(t){for(;t&&t!==e;){if(t.nodeType===Node.ELEMENT_NODE){let e=t;if(e.getAttribute(`contenteditable`)==`false`)return e}t=t.parentNode}}function w(){let t=ge().getRangeAt(0),n=a.createRange();return n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset),n.toString()}function ee(){let t=ge().getRangeAt(0),n=a.createRange();return n.selectNodeContents(e),n.setStart(t.endContainer,t.endOffset),n.toString()}function T(e){if(e.key===`Enter`){let t=w(),n=ee(),[i]=pe(t),a=i;if(r.indentOn.test(t)&&(a+=r.tab),a.length>0?(he(e),e.stopPropagation(),O(`
|
|
145
|
+
`),H(`div`,Rm,[H(`button`,{class:A([`st__help`,{"st__help--open":i.helpOpen}]),type:`button`,title:`使用说明`,"aria-expanded":i.helpOpen,onClick:t[34]||=K(e=>i.helpOpen=!i.helpOpen,[`stop`])},[...t[41]||=[H(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`circle`,{cx:`12`,cy:`12`,r:`9.2`}),H(`path`,{d:`M9.4 9.2a2.6 2.6 0 0 1 5.1.7c0 1.7-2.5 2.2-2.5 3.7`}),H(`line`,{x1:`12`,y1:`17`,x2:`12`,y2:`17.01`})],-1)]],10,zm),U(ac,{name:`pop`},{default:Rr(()=>[i.helpOpen?(z(),B(`div`,{key:0,class:`st__help-pop`,onClick:t[36]||=K(()=>{},[`stop`])},[H(`div`,Bm,[t[42]||=H(`span`,{class:`st__help-pop-title`},`快捷键`,-1),H(`button`,{class:`st__help-pop-close`,type:`button`,title:`关闭`,onClick:t[35]||=e=>i.helpOpen=!1},`✕`)]),G(` 快捷键清单:左列按键示意(kbd 芯片),右列一句话说明;与 App onKeydown 保持一致 `),H(`ul`,Vm,[(z(!0),B(R,null,L(i.shortcuts,e=>(z(),B(`li`,{key:e.desc,class:`st__keys-row`},[H(`span`,Hm,[(z(!0),B(R,null,L(e.keys,(t,n)=>(z(),B(R,{key:t},[H(`kbd`,Um,j(t),1),n<e.keys.length-1?(z(),B(`span`,Wm,`+`)):G(`v-if`,!0)],64))),128))]),H(`span`,Gm,j(e.desc),1)]))),128))])])):G(`v-if`,!0)]),_:1})])])}var qm=Y(Em,[[`render`,Km],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/StructureTree.vue`]]),Jm=e=>e===void 0?e:JSON.parse(JSON.stringify(e)),Ym={className:`Root`,name:`根节点`,styleState:{},styleVisible:{rect:!0,flex:!0,background:!0,padding:!0,margin:!0,borderRadius:!0,border:!0,shadow:!0,transform:!0,other:!0},styleMeta:{},properties:[],slots:[],events:[{eventName:`初始化完成`,eventKey:`onReady`}]};function Xm(e){return e===`Root`?Ym:yu[e]||null}function Zm(e={},t={},n={}){let r=[];return bu.forEach(i=>{let a=e[i.itemKey];if(!a)return;let o=new J(i),s=o.itemChildren&&o.itemChildren.properties||[];if(a&&typeof a==`object`)for(let e=0;e<s.length;e++)a[s[e].itemKey]||s.splice(e--,1);if(!s.length)return;let c=t[i.itemKey]||{};s.forEach(e=>{let t=c[e.itemKey];t&&(t.itemName&&(e.itemName=t.itemName),t.itemOption&&(e.itemOption=Object.assign({},e.itemOption,t.itemOption)))}),n[i.itemKey]&&fu.setPropertyValue(s,n[i.itemKey]),o.itemValueFrom=`0`,r.push(o)}),r}var Qm=class{constructor(e={}){this.schemaNode=e,this.className=e.className||`Root`,this.isRoot=this.className===`Root`;let t=Xm(this.className);this.metaMissing=!t,this.meta=t||{properties:[],events:[],styleVisible:{},styleState:{},styleMeta:{}},this.name=this.meta.name||this.className,this.events=this.meta.events||[],this.properties=(this.meta.properties||[]).map(e=>new J(e)),J.restoreProperty(e.properties||[],this.properties),J.updatePropertyVisible(this.properties),this.extraProperties=this._orphans(e.properties,this.properties),this.hasDirectives=!this.isRoot,this.directives=this.hasDirectives?Su.map(e=>new J(e)):[],this.hasDirectives?(J.restoreProperty(e.directives||[],this.directives),J.updatePropertyVisible(this.directives),this.extraDirectives=this._orphans(e.directives,this.directives)):this.extraDirectives=[],this.style=new Cu({state:this.meta.styleState,visible:this.meta.styleVisible,meta:this.meta.styleMeta}),this.style.onRestore(e.style||{}),this.styleForm=Zm(this.meta.styleVisible||{},this.meta.styleMeta||{},this.meta.styleState||{}),J.restoreProperty(this.style.onExport().properties,this.styleForm),J.updatePropertyVisible(this.styleForm)}refreshVisible(){J.updatePropertyVisible(this.properties),this.hasDirectives&&J.updatePropertyVisible(this.directives),J.updatePropertyVisible(this.styleForm)}applyStyleChange(e,t=[]){let n=null;for(let e=t.length-1;e>=0;e--)n={itemId:t[e].itemId,child:n};J.updatePropertyVisible(this.styleForm),this.style.applyChange(e,n)}exportProperties(){return this.properties.reduce((e,t)=>{let n=t.onExport();return n&&e.push(n),e},[]).concat(this.extraProperties.map(e=>Jm(e)))}exportDirectives(){return this.directives.reduce((e,t)=>{let n=t.onExport();return n&&e.push(n),e},[]).concat(this.extraDirectives.map(e=>Jm(e)))}_orphans(e,t){let n=new Set;return(t||[]).forEach(e=>{e.itemId&&n.add(e.itemId),e.itemKey&&n.add(e.itemKey)}),(e||[]).filter(e=>e&&e.itemId&&!n.has(e.itemId)&&!(e.itemKey&&n.has(e.itemKey))).map(e=>Jm(e))}exportStyle(){return this.style.onExport()}applyToSchema(){let e=this.schemaNode;e.properties=this.exportProperties(),e.style=this.exportStyle(),this.hasDirectives&&(e.directives=this.exportDirectives())}toSchemaFragment(){let e={properties:this.exportProperties(),style:this.exportStyle()};return this.hasDirectives&&(e.directives=this.exportDirectives()),Jm(e)}},$m={name:`NodeInspector`,props:{comp:{type:Object,required:!0},compNames:{type:Object,default:()=>({})},rt:{type:Object,required:!0}},emits:[`apply`,`commit`,`close`],data(){return{model:null,secOpen:{basic:!0,props:!0,style:!0,directive:!0},_t:null,_snapshot:null,_dirty:!1,_written:!1}},computed:{schemaNode(){return this.comp&&this.comp._schemaNode||null},compName(){let e=this.schemaNode&&this.schemaNode.className;return e?this.compNames&&this.compNames[e]||e:`节点`},styleWatches(){let e={},t=n=>{(n||[]).forEach(n=>{n.itemKey!=null&&(e[n.itemKey]=n.itemValue),n.itemChildren&&n.itemChildren.properties&&t(n.itemChildren.properties)})};return this.model&&t(this.model.styleForm),e}},watch:{comp:{immediate:!0,handler(){this.buildModel()}}},methods:{buildModel(){let e=this.schemaNode;this.model=e?rn(new Qm(e)):null,this._snapshot=e?this.snapshotNode(e):null,this._dirty=!1,this._written=!1},snapshotNode(e){let t=t=>Object.prototype.hasOwnProperty.call(e,t),n=e=>e===void 0?void 0:JSON.parse(JSON.stringify(e));return{hasProperties:t(`properties`),properties:n(e.properties),hasStyle:t(`style`),style:n(e.style),hasDirectives:t(`directives`),directives:n(e.directives),hasComponentId:t(`componentId`),componentId:n(e.componentId),hasName:t(`name`),name:n(e.name)}},restoreSnapshot(){let e=this.schemaNode;if(!e||!this._snapshot)return;let t=this._snapshot,n=(t,n,r)=>{t?e[n]=JSON.parse(JSON.stringify(r)):delete e[n]};n(t.hasProperties,`properties`,t.properties),n(t.hasStyle,`style`,t.style),n(t.hasDirectives,`directives`,t.directives),n(t.hasComponentId,`componentId`,t.componentId),n(t.hasName,`name`,t.name)},toggleSec(e){this.secOpen[e]=!this.secOpen[e],this.secOpen=Object.assign({},this.secOpen)},hasField(e){return this.schemaNode&&Object.prototype.hasOwnProperty.call(this.schemaNode,e)},onMetaInput(e,t){this.schemaNode&&(this.schemaNode[e]=t,this._dirty=!0,this.scheduleApply())},onPropChange(){this.model.refreshVisible(),this._dirty=!0,this.scheduleApply()},onStyleChange(e){!e||!e.length||(this.model.applyStyleChange(e[0],e.slice(1)),this.model.refreshVisible(),this._dirty=!0,this.scheduleApply())},onStyleSync(e){if(e){for(let t in e){let n=String(t).split(`.`);if(n.length<3||n[0]!==`style`)continue;let r=n[1],i=n[2],a=this.model.styleForm.find(e=>e.itemKey===r);if(!a)continue;let o=a.itemChildren.properties.find(e=>e.itemKey===i);o&&(o.itemValue=e[t],this.model.applyStyleChange(a,[o]))}this.model.refreshVisible(),this.scheduleApply()}},scheduleApply(){this._t&&clearTimeout(this._t),this._t=setTimeout(()=>{this.applyAll(),this.$emit(`apply`)},250)},applyAll(){this.model&&this.model.applyToSchema()},onApplyWrite(){this._t&&=(clearTimeout(this._t),null),this.applyAll(),this._written=!0,this.$emit(`apply`),this.$emit(`commit`),this.$emit(`close`)},discardAndClose(){this._t&&=(clearTimeout(this._t),null),this._dirty&&!this._written&&(this.restoreSnapshot(),this.$emit(`apply`)),this.$emit(`close`)},onClose(){this.discardAndClose()},onCancel(){this.discardAndClose()}}},eh={class:`ni-overlay`},th={class:`ni-panel modal-card`},nh={class:`ni-head`},rh={class:`ni-title`},ih={class:`ni-cls`},ah={key:0,class:`ni-body`},oh={key:1,class:`ni-body`},sh={class:`ni-scroll`},ch={class:`ni-sec`},lh={class:`ni-sec-body`},uh={class:`ni-field-row`},dh={class:`ni-static`},fh={key:0,class:`ni-field-row`},ph=[`value`],mh={key:1,class:`ni-field-row`},hh=[`value`],gh={class:`ni-sec`},_h={class:`ni-sec-body`},vh={class:`ni-sec`},yh={class:`ni-sec-body`},bh={key:0,class:`ni-sec`},xh={class:`ni-sec-body`},Sh={key:0,class:`ni-empty`},Ch={class:`ni-foot`},wh={class:`ni-foot-btns`};function Th(e,t,n,r,i,a){let o=I(`prop-tree`);return z(),B(`div`,eh,[H(`div`,th,[H(`div`,nh,[H(`span`,rh,[W(` 节点属性 · `+j(a.compName)+` `,1),H(`em`,ih,j(a.schemaNode&&a.schemaNode.className),1)]),H(`button`,{class:`ni-close`,type:`button`,onClick:t[0]||=(...e)=>a.onClose&&a.onClose(...e)})]),i.model?(z(),B(`div`,oh,[G(` ============ 属性 ============ `),H(`div`,sh,[G(` 基本信息 `),H(`section`,ch,[H(`div`,{class:`ni-sec-head`,onClick:t[1]||=e=>a.toggleSec(`basic`)},[H(`span`,{class:A([`ni-caret`,{"is-open":i.secOpen.basic}])},`▸`,2),t[10]||=W(`基本信息 `,-1)]),F(H(`div`,lh,[H(`div`,uh,[t[11]||=H(`label`,{class:`ni-field-label`},`组件类型`,-1),H(`span`,dh,j(a.compName),1)]),a.hasField(`componentId`)?(z(),B(`div`,fh,[t[12]||=H(`label`,{class:`ni-field-label`},`实例 ID`,-1),H(`input`,{class:`ni-input`,value:a.schemaNode.componentId,onInput:t[2]||=e=>a.onMetaInput(`componentId`,e.target.value)},null,40,ph)])):G(`v-if`,!0),a.hasField(`name`)?(z(),B(`div`,mh,[t[13]||=H(`label`,{class:`ni-field-label`},`节点名`,-1),H(`input`,{class:`ni-input`,value:a.schemaNode.name,onInput:t[3]||=e=>a.onMetaInput(`name`,e.target.value)},null,40,hh)])):G(`v-if`,!0)],512),[[Cc,i.secOpen.basic]])]),G(` 组件属性 `),F(H(`section`,gh,[H(`div`,{class:`ni-sec-head`,onClick:t[4]||=e=>a.toggleSec(`props`)},[H(`span`,{class:A([`ni-caret`,{"is-open":i.secOpen.props}])},`▸`,2),t[14]||=W(` 组件属性 `,-1)]),F(H(`div`,_h,[U(o,{properties:i.model.properties,mode:`property`,plain:!0,onLeafChange:a.onPropChange,onLeafSync:a.onStyleSync},null,8,[`properties`,`onLeafChange`,`onLeafSync`])],512),[[Cc,i.secOpen.props]])],512),[[Cc,i.model.properties.length]]),G(` 样式 `),H(`section`,vh,[H(`div`,{class:`ni-sec-head`,onClick:t[5]||=e=>a.toggleSec(`style`)},[H(`span`,{class:A([`ni-caret`,{"is-open":i.secOpen.style}])},`▸`,2),t[15]||=W(` 样式 `,-1)]),F(H(`div`,yh,[U(o,{properties:i.model.styleForm,mode:`style`,watches:a.styleWatches,plain:!0,onLeafChange:a.onStyleChange,onLeafSync:a.onStyleSync},null,8,[`properties`,`watches`,`onLeafChange`,`onLeafSync`])],512),[[Cc,i.secOpen.style]])]),G(` 指令 `),i.model.hasDirectives?(z(),B(`section`,bh,[H(`div`,{class:`ni-sec-head`,onClick:t[6]||=e=>a.toggleSec(`directive`)},[H(`span`,{class:A([`ni-caret`,{"is-open":i.secOpen.directive}])},`▸`,2),t[16]||=W(` 指令 `,-1)]),F(H(`div`,xh,[i.model.directives.length?(z(),V(o,{key:1,properties:i.model.directives,mode:`directive`,"b-exchange":!1,plain:!0,onLeafChange:a.onPropChange,onLeafSync:a.onStyleSync},null,8,[`properties`,`onLeafChange`,`onLeafSync`])):(z(),B(`p`,Sh,`无指令`))],512),[[Cc,i.secOpen.directive]])])):G(`v-if`,!0)])])):(z(),B(`div`,ah,[...t[9]||=[H(`p`,{class:`ni-empty`},`无法定位该节点的原始 schema(_schemaNode 缺失)`,-1)]])),H(`div`,Ch,[t[17]||=H(`span`,{class:`ni-tip`},`编辑即时预览(不记历史);「取消」丢弃改动并还原,「应用」写入历史并关闭,落盘由顶栏「保存到本地」负责`,-1),H(`div`,wh,[H(`button`,{class:`ni-btn ni-btn--ghost`,type:`button`,onClick:t[7]||=(...e)=>a.onCancel&&a.onCancel(...e)},`取消`),H(`button`,{class:`ni-btn`,type:`button`,onClick:t[8]||=(...e)=>a.onApplyWrite&&a.onApplyWrite(...e)},`应用`)])])])])}var Eh=Y($m,[[`render`,Th],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/NodeInspector.vue`]]),Dh={_source:`docs/动态卡片方案详细说明.md(JSAPI 章节)+ src/cards/*/schema.json 实测形态`,_note:`事件动作元数据。properties 采用与 component-meta / style-meta 完全一致的 Property meta 形态,可直接喂给 Property / PropTree / PropControl,无需任何专用渲染分支。itemRequired 的项在导出时总是写回 schema(对齐线上:customAction 永远带 function 项);非必填项只有在 schema 原本就有、或用户改过值时才写回,避免把默认值污染进 DSL 产品数据。`,lifecycleEvents:[{eventKey:`onReady`,eventName:`初始化完成`,eventDesc:`卡片渲染就绪时执行一次`}],actions:[{actionType:`customAction`,actionName:`自定义动作`,actionDesc:`执行一段 JavaScript。this 为卡片上下文:state / data / setData / setRootData / postMessage / addEventListener`,properties:[{itemId:`001`,itemKey:`function`,itemName:`脚本`,itemType:`Code`,itemTypeRange:`const`,itemRequired:!0,itemDefaultValue:{},itemOption:{language:`javascript`,codeKey:`code`},itemDesc:`事件回调函数体,形参为 event`}]},{actionType:`startRouter`,actionName:`路由跳转`,actionDesc:`ynet.callJSAPI('startRouter', { targetUrl, urlType, isLoginNeeded, extra })`,properties:[{itemId:`001`,itemKey:`targetUrl`,itemName:`跳转地址`,itemType:`Input`,itemTypeRange:`const,var`,itemRequired:!0,itemDefaultValue:``,itemDesc:`目标页面地址`},{itemId:`002`,itemKey:`urlType`,itemName:`地址类型`,itemType:`Select`,itemTypeRange:`const`,itemRequired:!0,itemDefaultValue:`3`,itemOption:{iParamList:[{key:`2`,value:`离线包`},{key:`3`,value:`在线页面`},{key:`4`,value:`原生页面`}]}},{itemId:`003`,itemKey:`isLoginNeeded`,itemName:`是否需要登录`,itemType:`Select`,itemTypeRange:`const`,itemRequired:!0,itemDefaultValue:`1`,itemOption:{iParamList:[{key:`1`,value:`需要登录`},{key:`0`,value:`不需要登录`}]}},{itemId:`004`,itemKey:`extra`,itemName:`备用参数`,itemType:`Textarea`,itemTypeRange:`const,var`,itemDefaultValue:``,itemDesc:`JSON 文本,透传给原生`}]},{actionType:`sendAiChatMessage`,actionName:`发送智能体消息`,actionDesc:`ynet.callJSAPI('sendAiChatMessage', { message })`,properties:[{itemId:`001`,itemKey:`message`,itemName:`消息内容`,itemType:`Input`,itemTypeRange:`const,var`,itemRequired:!0,itemDefaultValue:``,itemDesc:`发送给智能体的文本`}]},{actionType:`closeAlertCard`,actionName:`关闭弹窗卡片`,actionDesc:`ynet.callJSAPI('closeAlertCard', { cardCode, index, data });三项均可不填,默认关闭最上层弹窗`,properties:[{itemId:`001`,itemKey:`cardCode`,itemName:`卡片编码`,itemType:`Input`,itemTypeRange:`const,var`,itemDefaultValue:``,itemDesc:`按 cardCode 从堆栈自上而下关闭一个;不填则关最上层`},{itemId:`002`,itemKey:`index`,itemName:`关闭层数`,itemType:`InputNumber`,itemTypeRange:`const`,itemDefaultValue:``,itemOption:{max:0,min:-10,step:1},itemDesc:`-1 关一层,-2 关两层,以此类推;优先级高于卡片编码`},{itemId:`003`,itemKey:`data`,itemName:`回传数据`,itemType:`Textarea`,itemTypeRange:`const,var`,itemDefaultValue:``,itemDesc:`JSON 文本,作为 alertCard 的回调参数`}]}]},Oh=0,kh=e=>`${e}_${(++Oh).toString(36)}`,Ah=e=>e===void 0?e:JSON.parse(JSON.stringify(e)),jh=Dh.lifecycleEvents||[],Mh=Dh.actions||[],Nh=Mh.reduce((e,t)=>(e[t.actionType]=t,e),{});function Ph(e,t){let n=new Set;return(t||[]).forEach(e=>{e.itemId&&n.add(e.itemId),e.itemKey&&n.add(e.itemKey)}),(e||[]).filter(e=>e&&e.itemId&&!n.has(e.itemId)&&!(e.itemKey&&n.has(e.itemKey))).map(e=>Ah(e))}function Fh(e,t){let n={};return Object.keys(e||{}).forEach(r=>{t.indexOf(r)<0&&(n[r]=Ah(e[r]))}),n}var Ih=class{constructor(e={}){let t=e.event||{},n=e.action||{};this.uid=kh(`ea`),this.eventKey=t.eventKey||``,this.eventName=t.eventName||``,this.actionType=n.actionType||``,this._extraEvent=Fh(t,[`eventKey`,`eventName`]),this._extraAction=Fh(n,[`actionType`,`properties`]),this.properties=[],this.extraProperties=[],this.buildProps(n.properties||[])}buildProps(e=[]){let t=(Nh[this.actionType]||{}).properties||[];this.properties=t.map(e=>{let t=new J(e);return t.itemRequired=!!e.itemRequired,t}),J.restoreProperty(e,this.properties),J.updatePropertyVisible(this.properties),this.extraProperties=Ph(e,this.properties),this.formKey=kh(`form`)}isPristine(e){let t=e.itemValue;if(t===``||t==null)return!0;try{return JSON.stringify(t)===JSON.stringify(e.itemDefaultValue)}catch{return t===e.itemDefaultValue}}get summary(){if(this.actionType===`customAction`){let e=this.properties.find(e=>e.itemKey===`function`),t=e&&e.itemValue&&typeof e.itemValue==`object`&&e.itemValue.code||``;if(!t)return`空脚本`;let n=String(t).split(`
|
|
146
|
+
`).find(e=>e.trim())||``;return n.trim().slice(0,46)+(n.trim().length>46?`…`:``)}let e=this.properties.filter(e=>!this.isPristine(e));return e.length?e.map(e=>`${e.itemName}=${String(e.itemValue).slice(0,20)}`).join(`,`):`未配置参数`}exportProps(){let e=[];return this.properties.forEach(t=>{if(!(t.itemRequired||t.itemUpdated||!this.isPristine(t)))return;let n=t.onExport();n&&e.push(n)}),e.concat(this.extraProperties.map(e=>Ah(e)))}},Lh=class{constructor(e={}){this.schemaNode=e,this.className=e.className||`Root`;let t=Xm(this.className)||{};this.metaEvents=(t.events||[]).map(e=>Ah(e)),this.hadKey=Object.prototype.hasOwnProperty.call(e,`eventactions`),this.rows=(e.eventactions||[]).map(e=>new Ih(e))}get count(){return this.rows.length}get eventOptions(){let e=new Set,t=[];return(this.className===`Root`?this.metaEvents.concat(jh):this.metaEvents).forEach(n=>{!n||!n.eventKey||e.has(n.eventKey)||(e.add(n.eventKey),t.push(n))}),t}eventOptionsFor(e){let t=this.eventOptions;return e.eventKey&&!t.some(t=>t.eventKey===e.eventKey)?t.concat([{eventKey:e.eventKey,eventName:e.eventName||e.eventKey,_unknown:!0}]):t}actionOptionsFor(e){let t=this.eventOptions.find(t=>t.eventKey===e.eventKey),n=t&&t.includes,r=n&&n.length?Mh.filter(e=>n.indexOf(e.actionType)>=0):Mh;return e.actionType&&!r.some(t=>t.actionType===e.actionType)?r.concat([{actionType:e.actionType,actionName:e.actionType,_unknown:!0}]):r}eventNameOf(e){let t=this.eventOptions.find(t=>t.eventKey===e);return t?t.eventName:``}get eventactionMap(){let e={};return this.rows.forEach(t=>{t.eventKey&&(e[t.eventKey]=t)}),e}rowForEvent(e){return this.eventactionMap[e]||null}toggleEvent(e){let t=e&&e.eventKey;if(!t)return;let n=this.rowForEvent(t);if(n)this.removeRow(n);else{let n=this.actionOptionsForEvent(t,``),r=n.length?n[0].actionType:`customAction`,i=new Ih({event:{eventKey:t,eventName:e.eventName||this.eventNameOf(t)},action:{actionType:r,properties:[]}});this.rows.push(i)}}actionOptionsForEvent(e,t){let n=this.eventOptions.find(t=>t.eventKey===e),r=n&&n.includes,i=r&&r.length?Mh.filter(e=>r.indexOf(e.actionType)>=0):Mh;return t&&!i.some(e=>e.actionType===t)?i.concat([{actionType:t,actionName:t,_unknown:!0}]):i}setEventKey(e,t){e.eventKey=t||``,e.eventName=this.eventNameOf(e.eventKey)||e.eventName;let n=this.actionOptionsFor(e);e.actionType&&!n.some(t=>t.actionType===e.actionType)&&n.length&&this.setActionType(e,n[0].actionType)}setActionType(e,t){if(t===e.actionType)return;let n={};e.properties.forEach(e=>{e.itemKey&&(n[e.itemKey]={itemValue:Ah(e.itemValue),itemValueFrom:e.itemValueFrom})}),e.actionType=t||``,e.buildProps([]),e.properties.forEach(e=>{let t=n[e.itemKey];!t||t.itemValue===``||t.itemValue==null||(e.itemValue=t.itemValue,e.itemValueFrom=t.itemValueFrom,e.itemUpdated=!0)}),J.updatePropertyVisible(e.properties)}addRow(){let e=this.eventOptions[0],t=new Ih({event:e?{eventKey:e.eventKey,eventName:e.eventName}:{},action:{actionType:`customAction`,properties:[]}});return this.rows.push(t),t}removeRow(e){let t=this.rows.indexOf(e);t>=0&&this.rows.splice(t,1)}moveRow(e,t){if(e<0||e>=this.rows.length)return;let n=Math.max(0,Math.min(this.rows.length-1,t));if(n===e)return;let[r]=this.rows.splice(e,1);this.rows.splice(n,0,r)}refreshVisible(){this.rows.forEach(e=>J.updatePropertyVisible(e.properties))}export(){return this.rows.map(e=>{let t=e.eventKey?Object.assign({},e._extraEvent,{eventName:this.eventNameOf(e.eventKey)||e.eventName||void 0,eventKey:e.eventKey}):Object.assign({},e._extraEvent);return t.eventName===void 0&&delete t.eventName,{event:t,action:Object.assign({},e._extraAction,{actionType:e.actionType,properties:e.exportProps()})}})}applyToSchema(){!this.hadKey&&!this.rows.length||(this.schemaNode.eventactions=this.export(),this.hadKey=!0)}},Rh={name:`EventEditor`,props:{comp:{type:Object,required:!0},compNames:{type:Object,default:()=>({})},rt:{type:Object,required:!0}},emits:[`apply`,`commit`,`close`],data(){return{eventModel:null,activeKey:``,helpOpen:!1,_t:null,_snapshot:null,_dirty:!1,_written:!1}},computed:{schemaNode(){return this.comp&&this.comp._schemaNode||null},compName(){let e=this.schemaNode&&this.schemaNode.className;return e?this.compNames&&this.compNames[e]||e:`节点`},activeRow(){return!this.eventModel||!this.activeKey?null:this.eventModel.rowForEvent(this.activeKey)||null},helpText(){return(this.activeRow?this.actionDesc(this.activeRow.actionType):``)||`先在上方开启事件,再选择动作类型并填写参数;编辑即时预览,「应用」写入历史。`}},watch:{comp:{immediate:!0,handler(){this.buildModel()}}},methods:{buildModel(){let e=this.schemaNode;this.eventModel=e?rn(new Lh(e)):null,this.activeKey=``,this.helpOpen=!1,this._snapshot=e?this.snapshotEventActions(e):null,this._dirty=!1,this._written=!1,this.autoSelect()},snapshotEventActions(e){let t=Object.prototype.hasOwnProperty.call(e,`eventactions`);return{hadKey:t,eventactions:t?JSON.parse(JSON.stringify(e.eventactions||[])):[]}},restoreSnapshot(){let e=this.schemaNode;!e||!this._snapshot||(this._snapshot.hadKey?e.eventactions=JSON.parse(JSON.stringify(this._snapshot.eventactions||[])):delete e.eventactions)},autoSelect(){if(!this.eventModel){this.activeKey=``;return}let e=this.eventModel.eventOptions.find(e=>this.eventModel.rowForEvent(e.eventKey));this.activeKey=e?e.eventKey:``},isOn(e){return!!(this.eventModel&&this.eventModel.rowForEvent(e.eventKey))},onSelectEvent(e){this.activeKey=e.eventKey},onToggleEvent(e){let t=this.isOn(e);this.eventModel.toggleEvent(e),this._dirty=!0,t?this.activeKey===e.eventKey&&(this.activeKey=``):this.activeKey=e.eventKey,this.scheduleApply()},actionOptions(e){return(this.eventModel.actionOptionsForEvent(e.eventKey,e.actionType)||[]).map(e=>({key:e.actionType,value:e.actionName+(e._unknown?` · meta 未定义`:``)}))},actionDesc(e){return Nh[e]&&Nh[e].actionDesc||``},onActionType(e,t){this.eventModel.setActionType(e,t),this._dirty=!0,this.scheduleApply()},onEventLeaf(){this.eventModel.refreshVisible(),this._dirty=!0,this.scheduleApply()},scheduleApply(){this._t&&clearTimeout(this._t),this._t=setTimeout(()=>{this.applyAll(),this.$emit(`apply`)},250)},applyAll(){this.eventModel&&this.eventModel.applyToSchema()},onApplyWrite(){this._t&&=(clearTimeout(this._t),null),this.applyAll(),this._written=!0,this.$emit(`apply`),this.$emit(`commit`),this.$emit(`close`)},onCancel(){this.onClose()},onClose(){this._t&&=(clearTimeout(this._t),null),this._dirty&&!this._written&&(this.restoreSnapshot(),this.$emit(`apply`)),this.$emit(`close`)}}},zh={class:`ee-overlay`},Bh={class:`ee-panel`},Vh={class:`ee-head`},Hh={class:`ee-title`},Uh={class:`ee-cls`},Wh={class:`ee-body`},Gh={class:`ee-side`},Kh={key:0,class:`ee-empty`},qh={key:1,class:`ee-evt-list`},Jh=[`onClick`],Yh=[`title`],Xh=[`aria-checked`,`onClick`],Zh=[`title`],Qh={class:`ee-help__text`},$h={class:`ee-detail`},eg={class:`ee-detail-head`},tg={class:`ee-field-row`},ng={class:`ee-detail-body`},rg={key:1,class:`ee-empty`},ig={key:2,class:`ee-evt-orphan`},ag={key:1,class:`ee-empty ee-detail-empty`},og={class:`ee-foot`},sg={class:`ee-foot-btns`};function cg(e,t,n,r,i,a){let o=I(`Dropdown`),s=I(`prop-tree`);return z(),B(`div`,zh,[H(`div`,Bh,[H(`div`,Vh,[H(`span`,Hh,[W(` 事件配置 · `+j(a.compName)+` `,1),H(`em`,Uh,j(a.schemaNode&&a.schemaNode.className),1)]),H(`button`,{class:`ee-close`,type:`button`,onClick:t[0]||=(...e)=>a.onClose&&a.onClose(...e)})]),H(`div`,Wh,[H(`aside`,Gh,[!i.eventModel||!i.eventModel.eventOptions.length?(z(),B(`p`,Kh,`该节点无可用事件`)):(z(),B(`div`,qh,[(z(!0),B(R,null,L(i.eventModel.eventOptions,e=>(z(),B(`div`,{key:e.eventKey,class:A([`ee-evt`,{"is-on":a.isOn(e),"is-sel":i.activeKey===e.eventKey}]),onClick:t=>a.onSelectEvent(e)},[H(`span`,{class:`ee-evt-name`,title:e.eventDesc||e.eventName||e.eventKey},j(e.eventName||e.eventKey),9,Yh),H(`button`,{class:A([`ee-switch`,{"is-on":a.isOn(e)}]),type:`button`,role:`switch`,"aria-checked":a.isOn(e),onClick:K(t=>a.onToggleEvent(e),[`stop`])},[...t[7]||=[H(`span`,{class:`ee-switch__dot`},null,-1)]],10,Xh)],10,Jh))),128))])),G(` 帮助图标:与事件项左右靠边、垂直居中;点击弹出当前动作的使用说明 `),H(`button`,{class:`ee-help`,type:`button`,title:i.helpOpen?`关闭使用说明`:`使用说明`,onClick:t[1]||=K(e=>i.helpOpen=!i.helpOpen,[`stop`])},[...t[8]||=[H(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`circle`,{cx:`12`,cy:`12`,r:`10`}),H(`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}),H(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})],-1)]],8,Zh),i.helpOpen?(z(),B(`div`,{key:2,class:`ee-help__mask`,onClick:t[2]||=e=>i.helpOpen=!1})):G(`v-if`,!0),U(ac,{name:`pop`},{default:Rr(()=>[i.helpOpen?(z(),B(`div`,{key:0,class:`ee-help__pop`,onClick:t[3]||=K(()=>{},[`stop`])},[H(`p`,Qh,j(a.helpText),1)])):G(`v-if`,!0)]),_:1})]),H(`section`,$h,[a.activeRow?(z(),B(R,{key:0},[H(`div`,eg,[H(`div`,tg,[t[9]||=H(`label`,{class:`ee-field-label`},`动作类型`,-1),U(o,{value:a.activeRow.actionType,options:a.actionOptions(a.activeRow),size:`sm`,block:``,onChange:t[4]||=e=>a.onActionType(a.activeRow,e)},null,8,[`value`,`options`])])]),H(`div`,ng,[a.activeRow.properties.length?(z(),V(s,{key:a.activeRow.formKey,properties:a.activeRow.properties,mode:`event`,plain:!0,onLeafChange:a.onEventLeaf},null,8,[`properties`,`onLeafChange`])):(z(),B(`p`,rg,`该动作无可配置参数`)),a.activeRow.extraProperties.length?(z(),B(`p`,ig,` 另有 `+j(a.activeRow.extraProperties.length)+` 项 meta 未定义的参数,已原样保留 `,1)):G(`v-if`,!0)])],64)):(z(),B(`p`,ag,`请在左侧开启并选择一个事件`))])]),H(`div`,og,[t[10]||=H(`span`,{class:`ee-tip`},`编辑即时预览(不记历史);「应用」写入历史并关闭,落盘由顶栏「保存到本地」负责`,-1),H(`div`,sg,[H(`button`,{class:`ee-btn ee-btn--ghost`,type:`button`,onClick:t[5]||=(...e)=>a.onCancel&&a.onCancel(...e)},`取消`),H(`button`,{class:`ee-btn`,type:`button`,onClick:t[6]||=(...e)=>a.onApplyWrite&&a.onApplyWrite(...e)},`应用`)])])])])}var lg=Y(Rh,[[`render`,cg],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/EventEditor.vue`]]),ug={name:`ApiPayloadTree`,props:{value:{default:()=>({})},depth:{type:Number,default:0},path:{type:Array,default:()=>[]},openState:{type:Object,default:null},rootKeyLabel:{type:[String,Number,null],default:null},maxDepth:{type:Number,default:100},rootCollapsed:{type:Boolean,default:!1}},data(){return{localOpenState:this.openState||rn({}),rootOpen:!1}},computed:{isRoot(){return this.depth===0},isArrayRoot(){return Array.isArray(this.value)},rootCount(){return this.isArrayRoot?this.value.length:Object.keys(this.value||{}).length},state(){return this.openState||this.localOpenState},entries(){let e=this.value;return Array.isArray(e)?e.map((e,t)=>this.makeEntry(String(t),e,!0,t)):e&&typeof e==`object`?Object.keys(e).map(t=>this.makeEntry(t,e[t],!1,t)):[]}},methods:{typeOf(e){return e===null?`null`:Array.isArray(e)?`array`:typeof e},isComplex(e){return typeof e==`object`&&!!e},makeEntry(e,t,n,r){let i=Array.isArray(t);return{keyLabel:e,value:t,isArray:i,count:i?t.length:t&&typeof t==`object`?Object.keys(t).length:0,type:this.typeOf(t),path:[...this.path,r]}},pathKey(e){return e.path.join(`/`)},isOpen(e){let t=this.state[this.pathKey(e)];return t!==void 0&&t},canExpand(e){return this.isComplex(e.value)&&this.depth<this.maxDepth},toggle(e){let t=this.pathKey(e);this.state[t]=!this.isOpen(e)},preview(e){if(Array.isArray(e))return` … `+e.length+` 项`;let t=Object.keys(e);return` … `+t.slice(0,3).join(`, `)+(t.length>3?`, …`:``)+` `},format(e){return e===null?`null`:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e)}}},dg={key:0,class:`apt__leaf apt__leaf--root`},fg={key:0,class:`jt__key`},pg={key:1,class:`jt__colon`},mg={class:`jt__bracket`},hg={key:0,class:`jt__preview`},gg={key:1,class:`jt__count`},_g={key:2,class:`jt__bracket`},vg=[`onClick`],yg={key:0,class:`jt__key`},bg={class:`jt__bracket`},xg={class:`jt__preview`},Sg={class:`jt__bracket`},Cg={class:`apt__leaf`},wg={key:0,class:`jt__key`},Tg={key:1,class:`jt__colon`},Eg={class:`apt__leaf`},Dg={key:0,class:`jt__key`},Og={key:1,class:`jt__colon`},kg={key:3,class:`apt__children`},Ag={class:`apt__close`},jg={class:`jt__bracket`},Mg={class:`jt__count`},Ng={key:1,class:`apt__close`},Pg={class:`jt__bracket`},Fg={class:`jt__count`};function Ig(e,t,n,r,i,a){let o=I(`ApiPayloadTree`,!0);return z(),B(`div`,{class:A([`apt`,{"apt--root":a.isRoot}])},[G(` 根级别:非复合值(如 payload 就是字符串)直接作为单个叶子展示 `),a.isComplex(n.value)?(z(),B(R,{key:1},[G(` 日志场景(rootCollapsed):根对象/数组先收成一行摘要、点击展开(Chrome 控制台风格),
|
|
147
|
+
避免每个实参默认逐键占行稀释日志密度;接口调用面板不传该 prop,行为不变 `),n.rootCollapsed&&a.isRoot?(z(),B(`div`,{key:0,class:`apt__branch apt__branch--root`,onClick:t[0]||=e=>i.rootOpen=!i.rootOpen},[H(`span`,{class:A([`apt__caret`,{"apt__caret--open":i.rootOpen}])},`▶`,2),H(`span`,mg,j(a.isArrayRoot?`[`:`{`),1),i.rootOpen?(z(),B(`span`,gg,j(a.rootCount)+` `+j(a.isArrayRoot?`项`:`键`),1)):(z(),B(`span`,hg,j(a.preview(n.value)),1)),i.rootOpen?G(`v-if`,!0):(z(),B(`span`,_g,j(a.isArrayRoot?`]`:`}`),1))])):G(`v-if`,!0),F(H(`div`,{class:A([`apt__list`,{"apt__list--nested":n.rootCollapsed&&a.isRoot&&i.rootOpen}])},[(z(!0),B(R,null,L(a.entries,(e,r)=>(z(),B(`div`,{key:r,class:`apt__node`},[G(` 复合类型且未超最大深度:可折叠分支 `),a.canExpand(e)?(z(),B(`div`,{key:0,class:`apt__branch`,onClick:t=>a.toggle(e)},[H(`span`,{class:A([`apt__caret`,{"apt__caret--open":a.isOpen(e)}])},`▶`,2),e.keyLabel===null?G(`v-if`,!0):(z(),B(`span`,yg,j(e.keyLabel),1)),H(`span`,bg,j(e.isArray?`[`:`{`),1),a.isOpen(e)?G(`v-if`,!0):(z(),B(R,{key:1},[H(`span`,xg,j(a.preview(e.value)),1),H(`span`,Sg,j(e.isArray?`]`:`}`),1)],64))],8,vg)):a.isComplex(e.value)?(z(),B(R,{key:1},[G(` 复合类型但已达最大深度:不再可展开,仅作摘要叶子 `),H(`div`,Cg,[t[2]||=H(`span`,{class:`apt__caret apt__caret--leaf`},`▶`,-1),e.keyLabel===null?G(`v-if`,!0):(z(),B(`span`,wg,j(e.keyLabel),1)),e.keyLabel===null?G(`v-if`,!0):(z(),B(`span`,Tg,`:`)),H(`span`,{class:A([`jt__val`,`jt__val--`+(e.isArray?`array`:`object`)])},j(e.count)+` `+j(e.isArray?`项`:`键`)+`(已折叠)`,3)])],2112)):(z(),B(R,{key:2},[G(` 基础类型:叶子 `),H(`div`,Eg,[t[3]||=H(`span`,{class:`apt__caret apt__caret--leaf`},`▶`,-1),e.keyLabel===null?G(`v-if`,!0):(z(),B(`span`,Dg,j(e.keyLabel),1)),e.keyLabel===null?G(`v-if`,!0):(z(),B(`span`,Og,`:`)),H(`span`,{class:A([`jt__val`,`jt__val--`+e.type])},j(a.format(e.value)),3)])],2112)),G(` 展开后的子层级 `),a.isComplex(e.value)&&a.isOpen(e)?(z(),B(`div`,kg,[U(o,{value:e.value,depth:n.depth+1,path:e.path,"open-state":a.state,"max-depth":n.maxDepth},null,8,[`value`,`depth`,`path`,`open-state`,`max-depth`]),H(`div`,Ag,[H(`span`,jg,j(e.isArray?`]`:`}`),1),H(`span`,Mg,j(e.count)+` `+j(e.isArray?`项`:`键`),1)])])):G(`v-if`,!0)]))),128))],2),[[Cc,!(n.rootCollapsed&&a.isRoot)||i.rootOpen]]),n.rootCollapsed&&a.isRoot&&i.rootOpen?(z(),B(`div`,Ng,[H(`span`,Pg,j(a.isArrayRoot?`]`:`}`),1),H(`span`,Fg,j(a.rootCount)+` `+j(a.isArrayRoot?`项`:`键`),1)])):G(`v-if`,!0)],64)):(z(),B(`div`,dg,[t[1]||=H(`span`,{class:`apt__caret apt__caret--leaf`},`▶`,-1),n.rootKeyLabel===null?G(`v-if`,!0):(z(),B(`span`,fg,j(n.rootKeyLabel),1)),n.rootKeyLabel===null?G(`v-if`,!0):(z(),B(`span`,pg,`:`)),H(`span`,{class:A([`jt__val`,`jt__val--`+a.typeOf(n.value)])},j(a.format(n.value)),3)]))],2)}var Lg=Y(ug,[[`render`,Ig],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ApiPayloadTree.vue`]]),Rg={name:`LogValue`,components:{ApiPayloadTree:Lg},props:{value:{default:null}},computed:{complex(){return this.value!==null&&typeof this.value==`object`},typeClass(){if(this.value===null||this.value===void 0)return`null`;if(Array.isArray(this.value))return`array`;let e=typeof this.value;return e===`string`||e===`number`||e===`boolean`?e:`null`},display(){let e=this.value;if(e===void 0)return`undefined`;if(e===null)return`null`;if(typeof e==`string`)return e;if(typeof e==`function`)return`[Function `+(e.name||`anonymous`)+`]`;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e);try{return JSON.stringify(e)}catch{return String(e)}}}},zg={class:`log__json`};function Bg(e,t,n,r,i,a){let o=I(`ApiPayloadTree`);return a.complex?(z(),B(R,{key:1},[G(` 日志里的对象/数组参数:根节点默认一行摘要、点击展开,保证日志行密度 `),H(`div`,zg,[U(o,{value:n.value,"max-depth":14,"root-collapsed":``},null,8,[`value`])])],2112)):(z(),B(`span`,{key:0,class:A([`log__val`,`jt__val--`+a.typeClass])},j(a.display),3))}var Vg=Y(Rg,[[`render`,Bg],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/LogValue.vue`]]),Hg={name:`Dropdown`,emits:[`input`,`change`],props:{value:{type:[String,Number,null],default:``},options:{type:Array,default:()=>[]},placeholder:{type:String,default:`请选择`},size:{type:String,default:`sm`},block:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placement:{type:String,default:`bottom-start`},width:{type:[String,Number],default:null},borderless:{type:Boolean,default:!1},label:{type:String,default:null},clearable:{type:Boolean,default:!1}},data(){return{open:!1,dropUp:!1}},computed:{hasTriggerSlot(){return!!this.$slots.trigger},current(){return this.options.find(e=>e.key===this.value)||null},hasValue(){return this.value!==``&&this.value!==null&&this.value!==void 0},displayText(){return this.label==null?this.current?this.current.value||String(this.current.key):this.placeholder||`请选择`:this.label},chevSize(){return this.size===`xs`?11:this.size===`md`||this.size===`lg`?13:12},checkSize(){return this.size===`xs`?11:12},rootStyle(){return this.width==null?null:{width:typeof this.width==`number`?this.width+`px`:this.width}}},watch:{open(e){e?document.addEventListener(`click`,this.onDocClick,!0):document.removeEventListener(`click`,this.onDocClick,!0)}},beforeUnmount(){document.removeEventListener(`click`,this.onDocClick,!0)},methods:{toggle(){this.disabled||(this.open?this.open=!1:this.openMenu())},openMenu(){let e=this.$refs.root;if(e){let t=Math.min(this.options.length*31+12,290);this.dropUp=this.shouldDropUp(e,t)}this.open=!0,this.$nextTick(()=>{let e=this.$refs.pop,t=this.$refs.root;if(!e||!t)return;let n=this.shouldDropUp(t,e.offsetHeight);n!==this.dropUp&&(this.dropUp=n)})},shouldDropUp(e,t){let n=e.getBoundingClientRect(),r=this.getClipRect(e),i=r.bottom-n.bottom,a=n.top-r.top;return i<t&&a>=t},getClipRect(e){let t=e.parentElement;for(;t&&t!==document.body;){let e=getComputedStyle(t).overflowY;if(e===`auto`||e===`scroll`||e===`hidden`)return t.getBoundingClientRect();t=t.parentElement}return document.documentElement.getBoundingClientRect()},close(){this.open=!1,this.dropUp=!1},clear(){this.disabled||(this.close(),this.$emit(`input`,``),this.$emit(`change`,``))},onDocClick(e){this.$refs.root&&!this.$refs.root.contains(e.target)&&this.close()},onHover(){},onItemClick(e){e.disabled||this.choose(e.key)},choose(e){this.close(),e===this.value||this.$emit(`input`,e),this.$emit(`change`,e)}}},Ug=[`disabled`],Wg=[`title`],Gg=[`width`,`height`],Kg={class:`dd__list`},qg=[`onMousemove`,`onClick`],Jg={class:`dd__item-text`},Yg=[`width`,`height`],Xg={key:0,class:`dd__empty`};function Zg(e,t,n,r,i,a){return z(),B(`div`,{ref:`root`,class:A([`dd`,[`dd--`+n.size,{"dd--open":i.open,"dd--block":n.block,"dd--disabled":n.disabled,"dd--borderless":n.borderless,"dd--dropup":i.dropUp}]]),style:k(a.rootStyle)},[a.hasTriggerSlot?(z(),B(`div`,{key:1,class:`dd__trigger dd__trigger--slot`,onClick:t[2]||=(...e)=>a.toggle&&a.toggle(...e)},[$i(e.$slots,`trigger`,{open:i.open,toggle:a.toggle})])):(z(),B(`button`,{key:0,type:`button`,class:A([`dd__trigger`,{"dd__trigger--active":i.open}]),disabled:n.disabled,onClick:t[1]||=(...e)=>a.toggle&&a.toggle(...e)},[G(` current 插槽:自定义触发器内的已选值呈现(如「彩色类型标签 + 中文名」),缺省仍为纯文本 `),H(`span`,{class:`dd__label`,title:a.displayText},[$i(e.$slots,`current`,{opt:a.current,text:a.displayText},()=>[W(j(a.displayText),1)])],8,Wg),n.clearable&&a.hasValue?(z(),B(`span`,{key:0,class:`dd__clear`,role:`button`,tabindex:`-1`,title:`清空`,onClick:t[0]||=K((...e)=>a.clear&&a.clear(...e),[`stop`])},`✕`)):G(`v-if`,!0),(z(),B(`svg`,{class:`dd__chev`,viewBox:`0 0 16 16`,width:a.chevSize,height:a.chevSize,"aria-hidden":`true`},[...t[3]||=[H(`use`,{href:`#icon-chevron`},null,-1)]],8,Gg))],10,Ug)),U(ac,{name:`dd-fade`},{default:Rr(()=>[i.open?(z(),B(`div`,{key:0,ref:`pop`,class:A([`dd__pop`,[`dd__pop--`+n.placement]])},[$i(e.$slots,`default`,{close:a.close,choose:a.choose},()=>[H(`ul`,Kg,[(z(!0),B(R,null,L(n.options,r=>(z(),B(`li`,{key:r.key,class:A([`dd__item`,{"dd__item--selected":r.key===n.value,"dd__item--disabled":r.disabled}]),onMousemove:e=>a.onHover(r),onClick:e=>a.onItemClick(r)},[G(` option 插槽:自定义单个选项的内容,缺省为 opt.value 纯文本 `),H(`span`,Jg,[$i(e.$slots,`option`,{opt:r},()=>[W(j(r.value),1)])]),r.key===n.value?(z(),B(`svg`,{key:0,class:`dd__check`,viewBox:`0 0 16 16`,width:a.checkSize,height:a.checkSize,"aria-hidden":`true`},[...t[4]||=[H(`use`,{href:`#icon-check`},null,-1)]],8,Yg)):G(`v-if`,!0)],42,qg))),128)),n.options.length?G(`v-if`,!0):(z(),B(`li`,Xg,j(n.placeholder||`无选项`),1))])])],2)):G(`v-if`,!0)]),_:3})],6)}var Qg=Y(Hg,[[`render`,Zg],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Dropdown.vue`]]),$g=/^-?(?:\d+(?:\.\d*)?|\.\d*)?$/,e_={name:`NumberStepper`,props:{value:{type:[String,Number],default:``},step:{type:Number,default:1},min:{type:Number,default:-1/0},max:{type:Number,default:1/0},placeholder:{type:String,default:`请输入数字`},disabled:{type:Boolean,default:!1}},emits:[`input`,`change`],data(){return{text:``}},computed:{stepSize(){return Number.isFinite(this.step)&&this.step>0?this.step:1},num(){let e=parseFloat(this.text);return Number.isFinite(e)?e:null}},watch:{value:{immediate:!0,handler(e){let t=e==null?``:String(e);t!==this.text&&(this.text=t)}}},methods:{canStep(e){let t=this.num===null?0:this.num;return e>0?t<this.max:t>this.min},tidy(e){return Number(e.toPrecision(12))},clamp(e){return Math.min(this.max,Math.max(this.min,e))},onInput(e){if(!$g.test(e)){this.$refs.field.value=this.text;return}this.text=e,this.$emit(`input`,e)},bump(e){if(this.disabled)return;let t=this.num===null?0:this.num;this.text=String(this.clamp(this.tidy(t+e*this.stepSize))),this.$emit(`input`,this.text),this.$emit(`change`)}}},t_={class:`st-number st-number--step`},n_=[`disabled`],r_=[`value`,`placeholder`,`disabled`],i_=[`disabled`];function a_(e,t,n,r,i,a){return z(),B(`div`,t_,[H(`button`,{type:`button`,class:`st-number__step`,title:`减少`,"aria-label":`减少`,disabled:n.disabled||!a.canStep(-1),onClick:t[0]||=e=>a.bump(-1)},[...t[6]||=[H(`svg`,{viewBox:`0 0 16 16`,width:`12`,height:`12`,"aria-hidden":`true`},[H(`line`,{x1:`3.5`,y1:`8`,x2:`12.5`,y2:`8`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.6`,"stroke-linecap":`round`})],-1)]],8,n_),H(`input`,{ref:`field`,class:`st-number__field`,type:`text`,inputmode:`decimal`,value:i.text,placeholder:n.placeholder,disabled:n.disabled,onInput:t[1]||=e=>a.onInput(e.target.value),onChange:t[2]||=t=>e.$emit(`change`),onKeydown:[t[3]||=yl(K(e=>a.bump(1),[`prevent`]),[`up`]),t[4]||=yl(K(e=>a.bump(-1),[`prevent`]),[`down`])]},null,40,r_),H(`button`,{type:`button`,class:`st-number__step st-number__step--inc`,title:`增加`,"aria-label":`增加`,disabled:n.disabled||!a.canStep(1),onClick:t[5]||=e=>a.bump(1)},[...t[7]||=[H(`svg`,{viewBox:`0 0 16 16`,width:`12`,height:`12`,"aria-hidden":`true`},[H(`path`,{d:`M8 3.5v9M3.5 8h9`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.6`,"stroke-linecap":`round`})],-1)]],8,i_)])}var o_=Y(e_,[[`render`,a_],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/NumberStepper.vue`]]),s_={value:{default:``},options:{type:Object,default:()=>({})},watches:{type:Object,default:()=>({})},itemInfo:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1}},c_=[`input`,`change`],l_=[{key:`flex-start`,name:`起始对齐`,bars:[2.6,6.2]},{key:`center`,name:`居中`,bars:[4.6,8.2]},{key:`flex-end`,name:`末端对齐`,bars:[6.6,10.2]},{key:`space-between`,name:`两端对齐`,bars:[2.6,10.2]},{key:`space-around`,name:`等距间隔`,bars:[3.6,9.2]}],u_=[{key:`flex-start`,name:`起始对齐`,a:[3.6,6.4],b:[3.6,4.4]},{key:`center`,name:`居中`,a:[4.8,6.4],b:[5.8,4.4]},{key:`flex-end`,name:`末端对齐`,a:[6,6.4],b:[8,4.4]},{key:`baseline`,name:`基线对齐`,a:[4,5.6],b:[6,3.6],baseline:9.6},{key:`stretch`,name:`拉伸`,a:[3.6,9.4],b:[3.6,9.4]}],d_=[{key:`normal`,value:`正体`,title:`font-style: normal`,icon:{text:`A`}},{key:`italic`,value:`斜体`,title:`font-style: italic`,icon:{text:`A`,italic:!0}}],f_=[{key:`none`,value:`无`,title:`text-decoration: none`,icon:{text:`A`}},{key:`underline`,value:`下划线`,title:`text-decoration: underline`,icon:{text:`A`,lines:[[3.5,14,12.5,14]]}},{key:`line-through`,value:`删除线`,title:`text-decoration: line-through`,icon:{text:`A`,lines:[[3,8.6,13,8.6]]}}],p_={name:`SetSegment`,props:{...s_,kind:{type:String,default:`TabSelect`}},emits:c_,computed:{current(){return this.value===void 0||this.value===null?``:this.value},flexDirection(){return this.options.flexDirection||this.watches.flexDirection||`row`},rotate(){return(this.kind===`JustifyContentStyle`||this.kind===`AlignItemsStyle`)&&this.flexDirection===`column`},items(){return this.kind===`JustifyContentStyle`?l_.map(e=>({key:e.key,value:e.name,title:`justify-content: ${e.key}`,icon:{frame:!0,rects:e.bars.map(e=>[e,4.8,3.2,6.4])}})):this.kind===`AlignItemsStyle`?u_.map(e=>({key:e.key,value:e.name,title:`align-items: ${e.key}`,icon:{frame:!0,rects:[[4.2,e.a[0],3.2,e.a[1]],[8.6,e.b[0],3.2,e.b[1]]],lines:e.baseline?[[1.6,e.baseline,14.4,e.baseline]]:void 0}})):this.kind===`FontStyle`?d_:this.kind===`TextDecorationStyle`?f_:this.options.iParamList||[]}},methods:{pick(e){this.disabled||(this.$emit(`input`,e.key),this.$emit(`change`))}}},m_={class:`st-seg`},h_=[`title`,`onClick`],g_={key:0,x:`1`,y:`2.6`,width:`14`,height:`10.8`,rx:`1.4`,fill:`none`,stroke:`currentColor`,"stroke-width":`1`,opacity:`0.35`},__=[`x`,`y`,`width`,`height`],v_=[`x1`,`y1`,`x2`,`y2`],y_=[`font-style`],b_={key:1};function x_(e,t,n,r,i,a){return z(),B(`div`,m_,[(z(!0),B(R,null,L(a.items,(e,t)=>(z(),B(`div`,{key:e.key+`_`+t,class:A([`st-seg__item`,{"st-seg__item--on":String(e.key)===String(a.current)}]),title:e.title||e.value,onClick:t=>a.pick(e)},[e.icon?(z(),B(`svg`,{key:0,class:`st-seg__icon`,viewBox:`0 0 16 16`,style:k(a.rotate?`transform:rotate(90deg)`:``)},[G(` 容器外框 `),e.icon.frame?(z(),B(`rect`,g_)):G(`v-if`,!0),G(` 内容条 `),(z(!0),B(R,null,L(e.icon.rects||[],(e,t)=>(z(),B(`rect`,{key:`r`+t,x:e[0],y:e[1],width:e[2],height:e[3],rx:`0.6`,fill:`currentColor`,stroke:`none`},null,8,__))),128)),G(` 辅助线(基线 / 下划线 / 删除线) `),(z(!0),B(R,null,L(e.icon.lines||[],(e,t)=>(z(),B(`line`,{key:`l`+t,x1:e[0],y1:e[1],x2:e[2],y2:e[3],stroke:`currentColor`,"stroke-width":`1.1`},null,8,v_))),128)),G(` 字形(FontStyle / TextDecorationStyle) `),e.icon.text?(z(),B(`text`,{key:1,x:`8`,y:`12`,"text-anchor":`middle`,"font-size":`11`,"font-weight":`600`,fill:`currentColor`,stroke:`none`,"font-style":e.icon.italic?`italic`:`normal`},j(e.icon.text),9,y_)):G(`v-if`,!0)],4)):(z(),B(`span`,b_,j(e.value),1))],10,h_))),128))])}var S_=Y(p_,[[`render`,x_],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetSegment.vue`]]),C_=window;function w_(e,t,n={}){let r={tab:` `,indentOn:/[({\[]$/,moveToNewLine:/^[)}\]]/,spellcheck:!1,catchTab:!0,preserveIdent:!0,addClosing:!0,history:!0,window:C_,autoclose:{open:`([{'"`,close:`)]}'"`},...n},i=r.window,a=i.document,o=[],s=[],c=-1,l=!1,u=()=>void 0,d;e.setAttribute(`contenteditable`,`plaintext-only`),e.setAttribute(`spellcheck`,r.spellcheck?`true`:`false`),e.style.outline=`none`,e.style.overflowWrap=`break-word`,e.style.overflowY=`auto`,e.style.whiteSpace=`pre-wrap`;let f=(e,n)=>{t(e,n)},p=i.navigator.userAgent.match(/Firefox\/([0-9]+)\./),m=p?parseInt(p[1]):0,h=!1;(e.contentEditable!==`plaintext-only`||m>=136)&&(h=!0),h&&e.setAttribute(`contenteditable`,`true`);let g=fe(()=>{let t=x();f(e,t),S(t)},30),_=!1,v=e=>!ce(e)&&!le(e)&&e.key!==`Meta`&&e.key!==`Control`&&e.key!==`Alt`&&!e.key.startsWith(`Arrow`),y=fe(e=>{v(e)&&(re(),_=!1)},300),b=(t,n)=>{o.push([t,n]),e.addEventListener(t,n)};b(`keydown`,e=>{e.defaultPrevented||(d=me(),r.preserveIdent?T(e):E(e),r.catchTab&&D(e),r.addClosing&&te(e),r.history&&(ne(e),v(e)&&!_&&(re(),_=!0)),h&&!ue(e)&&S(x()))}),b(`keyup`,e=>{e.defaultPrevented||e.isComposing||(d!==me()&&g(),y(e),u(me()))}),b(`focus`,e=>{l=!0}),b(`blur`,e=>{l=!1}),b(`paste`,e=>{re(),ie(e),re(),u(me())}),b(`cut`,e=>{re(),ae(e),re(),u(me())});function x(){let t=ge(),n={start:0,end:0,dir:void 0},{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=t;if(!r||!o)throw`error1`;if(r===e&&o===e)return n.start=i>0&&e.textContent?e.textContent.length:0,n.end=s>0&&e.textContent?e.textContent.length:0,n.dir=s>=i?`->`:`<-`,n;if(r.nodeType===Node.ELEMENT_NODE){let e=a.createTextNode(``);r.insertBefore(e,r.childNodes[i]),r=e,i=0}if(o.nodeType===Node.ELEMENT_NODE){let e=a.createTextNode(``);o.insertBefore(e,o.childNodes[s]),o=e,s=0}return oe(e,e=>{if(e===r&&e===o)return n.start+=i,n.end+=s,n.dir=i<=s?`->`:`<-`,`stop`;if(e===r)if(n.start+=i,!n.dir)n.dir=`->`;else return`stop`;else if(e===o)if(n.end+=s,!n.dir)n.dir=`<-`;else return`stop`;e.nodeType===Node.TEXT_NODE&&(n.dir!=`->`&&(n.start+=e.nodeValue.length),n.dir!=`<-`&&(n.end+=e.nodeValue.length))}),e.normalize(),n}function S(t){let n=ge(),r,i=0,o,s=0;if(t.dir||=`->`,t.start<0&&(t.start=0),t.end<0&&(t.end=0),t.dir==`<-`){let{start:e,end:n}=t;t.start=n,t.end=e}let c=0;oe(e,e=>{if(e.nodeType!==Node.TEXT_NODE)return;let n=(e.nodeValue||``).length;if(c+n>t.start&&(r||(r=e,i=t.start-c),c+n>t.end))return o=e,s=t.end-c,`stop`;c+=n}),r||(r=e,i=e.childNodes.length),o||(o=e,s=e.childNodes.length),t.dir==`<-`&&([r,i,o,s]=[o,s,r,i]);{let e=C(r);if(e){let t=a.createTextNode(``);e.parentNode?.insertBefore(t,e),r=t,i=0}let t=C(o);if(t){let e=a.createTextNode(``);t.parentNode?.insertBefore(e,t),o=e,s=0}}n.setBaseAndExtent(r,i,o,s),e.normalize()}function C(t){for(;t&&t!==e;){if(t.nodeType===Node.ELEMENT_NODE){let e=t;if(e.getAttribute(`contenteditable`)==`false`)return e}t=t.parentNode}}function w(){let t=ge().getRangeAt(0),n=a.createRange();return n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset),n.toString()}function ee(){let t=ge().getRangeAt(0),n=a.createRange();return n.selectNodeContents(e),n.setStart(t.endContainer,t.endOffset),n.toString()}function T(e){if(e.key===`Enter`){let t=w(),n=ee(),[i]=pe(t),a=i;if(r.indentOn.test(t)&&(a+=r.tab),a.length>0?(he(e),e.stopPropagation(),O(`
|
|
148
148
|
`+a)):E(e),a!==i&&r.moveToNewLine.test(n)){let e=x();O(`
|
|
149
149
|
`+i),S(e)}}}function E(e){if(h&&e.key===`Enter`)if(he(e),e.stopPropagation(),ee()==``){O(`
|
|
150
150
|
`);let e=x();e.start=--e.end,S(e)}else O(`
|
|
151
151
|
`)}function te(e){let t=r.autoclose.open,n=r.autoclose.close;if(t.includes(e.key)){he(e);let r=x(),i=r.start==r.end?``:ge().toString();O(e.key+i+(n[t.indexOf(e.key)]??``)),r.start++,r.end++,S(r)}}function D(e){if(e.key===`Tab`)if(he(e),e.shiftKey){let[e,t]=pe(w());if(e.length>0){let n=x(),i=Math.min(r.tab.length,e.length);S({start:t,end:t+i}),a.execCommand(`delete`),n.start-=i,n.end-=i,S(n)}}else O(r.tab)}function ne(t){if(ce(t)){he(t),c--;let n=s[c];n&&(e.innerHTML=n.html,S(n.pos)),c<0&&(c=0)}if(le(t)){he(t),c++;let n=s[c];n&&(e.innerHTML=n.html,S(n.pos)),c>=s.length&&c--}}function re(){if(!l)return;let t=e.innerHTML,n=x(),r=s[c];r&&r.html===t&&r.pos.start===n.start&&r.pos.end===n.end||(c++,s[c]={html:t,pos:n},s.splice(c+1),c>300&&(c=300,s.splice(0,1)))}function ie(t){if(t.defaultPrevented)return;he(t);let n=(t.originalEvent??t).clipboardData.getData(`text/plain`).replace(/\r\n?/g,`
|
|
152
152
|
`),r=x();O(n),f(e),S({start:Math.min(r.start,r.end)+n.length,end:Math.min(r.start,r.end)+n.length,dir:`<-`})}function ae(t){let n=x(),r=ge();(t.originalEvent??t).clipboardData.setData(`text/plain`,r.toString()),a.execCommand(`delete`),f(e),S({start:Math.min(n.start,n.end),end:Math.min(n.start,n.end),dir:`<-`}),he(t)}function oe(e,t){let n=[];e.firstChild&&n.push(e.firstChild);let r=n.pop();for(;r&&t(r)!==`stop`;)r.nextSibling&&n.push(r.nextSibling),r.firstChild&&n.push(r.firstChild),r=n.pop()}function se(e){return e.metaKey||e.ctrlKey}function ce(e){return se(e)&&!e.shiftKey&&de(e)===`Z`}function le(e){return se(e)&&e.shiftKey&&de(e)===`Z`}function ue(e){return se(e)&&de(e)===`C`}function de(e){let t=e.key||e.keyCode||e.which;if(t)return(typeof t==`string`?t:String.fromCharCode(t)).toUpperCase()}function O(e){e=e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`),a.execCommand(`insertHTML`,!1,e)}function fe(e,t){let n=0;return(...r)=>{clearTimeout(n),n=i.setTimeout(()=>e(...r),t)}}function pe(e){let t=e.length-1;for(;t>=0&&e[t]!==`
|
|
153
|
-
`;)t--;t++;let n=t;for(;n<e.length&&/[ \t]/.test(e[n]);)n++;return[e.substring(t,n)||``,t,n]}function me(){return e.textContent||``}function he(e){e.preventDefault()}function ge(){return e.getRootNode().getSelection()}return{updateOptions(e){Object.assign(r,e)},updateCode(t,n=!0){e.textContent=t,f(e),n&&u(t)},onUpdate(e){u=e},toString:me,save:x,restore:S,recordHistory:re,destroy(){for(let[t,n]of o)e.removeEventListener(t,n)}}}var Yg=c(o(((e,t)=>{var n=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,`&`).replace(/</g,`<`).replace(/\u00a0/g,` `)},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){n||={};var r,a;switch(i.util.type(t)){case`Object`:if(a=i.util.objId(t),n[a])return n[a];for(var o in r={},n[a]=r,t)t.hasOwnProperty(o)&&(r[o]=e(t[o],n));return r;case`Array`:return a=i.util.objId(t),n[a]?n[a]:(r=[],n[a]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return`none`},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,`gi`),``),e.classList.add(`language-`+n)},currentScript:function(){if(typeof document>`u`)return null;if(document.currentScript&&document.currentScript.tagName===`SCRIPT`)return document.currentScript;try{throw Error()}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName(`script`);for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r=`no-`+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=i.util.clone(i.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r||=i.languages;var a=r[e],o={};for(var s in a)if(a.hasOwnProperty(s)){if(s==t)for(var c in n)n.hasOwnProperty(c)&&(o[c]=n[c]);n.hasOwnProperty(s)||(o[s]=a[s])}var l=r[e];return r[e]=o,i.languages.DFS(i.languages,function(t,n){n===l&&t!=e&&(this[t]=o)}),o},DFS:function e(t,n,r,a){a||={};var o=i.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var c=t[s],l=i.util.type(c);l===`Object`&&!a[o(c)]?(a[o(c)]=!0,e(c,n,null,a)):l===`Array`&&!a[o(c)]&&(a[o(c)]=!0,e(c,n,s,a))}}},plugins:{},highlightAll:function(e,t){i.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:`code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code`};i.hooks.run(`before-highlightall`,r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),i.hooks.run(`before-all-elements-highlight`,r);for(var a=0,o;o=r.elements[a++];)i.highlightElement(o,t===!0,r.callback)},highlightElement:function(t,n,r){var a=i.util.getLanguage(t),o=i.languages[a];i.util.setLanguage(t,a);var s=t.parentElement;s&&s.nodeName.toLowerCase()===`pre`&&i.util.setLanguage(s,a);var c={element:t,language:a,grammar:o,code:t.textContent};function l(e){c.highlightedCode=e,i.hooks.run(`before-insert`,c),c.element.innerHTML=c.highlightedCode,i.hooks.run(`after-highlight`,c),i.hooks.run(`complete`,c),r&&r.call(c.element)}if(i.hooks.run(`before-sanity-check`,c),s=c.element.parentElement,s&&s.nodeName.toLowerCase()===`pre`&&!s.hasAttribute(`tabindex`)&&s.setAttribute(`tabindex`,`0`),!c.code){i.hooks.run(`complete`,c),r&&r.call(c.element);return}if(i.hooks.run(`before-highlight`,c),!c.grammar){l(i.util.encode(c.code));return}if(n&&e.Worker){var u=new Worker(i.filename);u.onmessage=function(e){l(e.data)},u.postMessage(JSON.stringify({language:c.language,code:c.code,immediateClose:!0}))}else l(i.highlight(c.code,c.grammar,c.language))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(i.hooks.run(`before-tokenize`,r),!r.grammar)throw Error(`The language "`+r.language+`" has no grammar.`);return r.tokens=i.tokenize(r.code,r.grammar),i.hooks.run(`after-tokenize`,r),a.stringify(i.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new c;return l(i,i.head,e),s(e,i,t,i.head,0),d(i)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(!(!n||!n.length))for(var r=0,a;a=n[r++];)a(t)}},Token:a};e.Prism=i;function a(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}a.stringify=function e(t,n){if(typeof t==`string`)return t;if(Array.isArray(t)){var r=``;return t.forEach(function(t){r+=e(t,n)}),r}var a={type:t.type,content:e(t.content,n),tag:`span`,classes:[`token`,t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(a.classes,o):a.classes.push(o)),i.hooks.run(`wrap`,a);var s=``;for(var c in a.attributes)s+=` `+c+`="`+(a.attributes[c]||``).replace(/"/g,`"`)+`"`;return`<`+a.tag+` class="`+a.classes.join(` `)+`"`+s+`>`+a.content+`</`+a.tag+`>`};function o(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function s(e,t,n,r,c,d){for(var f in n)if(!(!n.hasOwnProperty(f)||!n[f])){var p=n[f];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==f+`,`+m)return;var h=p[m],g=h.inside,_=!!h.lookbehind,v=!!h.greedy,y=h.alias;if(v&&!h.pattern.global){var b=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,b+`g`)}for(var x=h.pattern||h,S=r.next,C=c;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var w=S.value;if(t.length>e.length)return;if(!(w instanceof a)){var ee=1,T;if(v){if(T=o(x,C,e,_),!T||T.index>=e.length)break;var E=T.index,te=T.index+T[0].length,D=C;for(D+=S.value.length;E>=D;)S=S.next,D+=S.value.length;if(D-=S.value.length,C=D,S.value instanceof a)continue;for(var ne=S;ne!==t.tail&&(D<te||typeof ne.value==`string`);ne=ne.next)ee++,D+=ne.value.length;ee--,w=e.slice(C,D),T.index-=C}else if(T=o(x,0,w,_),!T)continue;var E=T.index,re=T[0],ie=w.slice(0,E),ae=w.slice(E+re.length),oe=C+w.length;d&&oe>d.reach&&(d.reach=oe);var se=S.prev;ie&&(se=l(t,se,ie),C+=ie.length),u(t,se,ee);var ce=new a(f,g?i.tokenize(re,g):re,y,re);if(S=l(t,se,ce),ae&&l(t,S,ae),ee>1){var le={cause:f+`,`+m,reach:oe};s(e,t,n,S.prev,C,le),d&&le.reach>d.reach&&(d.reach=le.reach)}}}}}}function c(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function u(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function d(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}if(!e.document)return e.addEventListener&&(i.disableWorkerMessageHandler||e.addEventListener(`message`,function(t){var n=JSON.parse(t.data),r=n.language,a=n.code,o=n.immediateClose;e.postMessage(i.highlight(a,i.languages[r],r)),o&&e.close()},!1)),i;var f=i.util.currentScript();f&&(i.filename=f.src,f.hasAttribute(`data-manual`)&&(i.manual=!0));function p(){i.manual||i.highlightAll()}if(!i.manual){var m=document.readyState;m===`loading`||m===`interactive`&&f&&f.defer?document.addEventListener(`DOMContentLoaded`,p):window.requestAnimationFrame?window.requestAnimationFrame(p):window.setTimeout(p,16)}return i}(typeof window<`u`?window:typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope?self:{});t!==void 0&&t.exports&&(t.exports=n),typeof global<`u`&&(global.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside[`attr-value`].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside[`internal-subset`].inside=n.languages.markup,n.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&/,`&`))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i[`language-`+t]={pattern:/[\s\S]+/,inside:n.languages[t]};var a={};a[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:i},n.languages.insertBefore(`markup`,`cdata`,a)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(e,t){n.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:n.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend(`markup`,{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend(`clike`,{"class-name":[n.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),n.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),n.languages.markup&&(n.languages.markup.tag.addInlined(`script`,`javascript`),n.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),n.languages.js=n.languages.javascript,(function(){if(n===void 0||typeof document>`u`)return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e=`Loading…`,t=function(e,t){return`✖ Error `+e+` while fetching file: `+t},r=`✖ Error: File does not exist or is empty`,i={js:`javascript`,py:`python`,rb:`ruby`,ps1:`powershell`,psm1:`powershell`,sh:`bash`,bat:`batch`,h:`c`,tex:`latex`},a=`data-src-status`,o=`loading`,s=`loaded`,c=`failed`,l=`pre[data-src]:not([`+a+`="`+s+`"]):not([`+a+`="`+o+`"])`;function u(e,n,i){var a=new XMLHttpRequest;a.open(`GET`,e,!0),a.onreadystatechange=function(){a.readyState==4&&(a.status<400&&a.responseText?n(a.responseText):a.status>=400?i(t(a.status,a.statusText)):i(r))},a.send(null)}function d(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||``);if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}n.hooks.add(`before-highlightall`,function(e){e.selector+=`, `+l}),n.hooks.add(`before-sanity-check`,function(t){var r=t.element;if(r.matches(l)){t.code=``,r.setAttribute(a,o);var f=r.appendChild(document.createElement(`CODE`));f.textContent=e;var p=r.getAttribute(`data-src`),m=t.language;if(m===`none`){var h=(/\.(\w+)$/.exec(p)||[,`none`])[1];m=i[h]||h}n.util.setLanguage(f,m),n.util.setLanguage(r,m);var g=n.plugins.autoloader;g&&g.loadLanguages(m),u(p,function(e){r.setAttribute(a,s);var t=d(r.getAttribute(`data-range`));if(t){var i=e.split(/\r\n?|\n/g),o=t[0],c=t[1]==null?i.length:t[1];o<0&&(o+=i.length),o=Math.max(0,Math.min(o-1,i.length)),c<0&&(c+=i.length),c=Math.max(0,Math.min(c,i.length)),e=i.slice(o,c).join(`
|
|
154
|
-
`),r.hasAttribute(`data-start`)||r.setAttribute(`data-start`,String(o+1))}f.textContent=e,n.highlightElement(f)},function(e){r.setAttribute(a,c),f.textContent=e})}}),n.plugins.fileHighlight={highlight:function(e){for(var t=(e||document).querySelectorAll(l),r=0,i;i=t[r++];)n.highlightElement(i)}};var f=!1;n.fileHighlight=function(){f||=(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()}))());Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`}},Prism.languages.webmanifest=Prism.languages.json;function
|
|
155
|
-
`;)r+=1;continue}if(e===`/`&&t[r+1]===`*`){let e=t.indexOf(`*/`,r+2);r=e===-1?i:e+2;continue}if(e===`;`||e===`,`){o(),r+=1;continue}if(/[A-Za-z_$]/.test(e)){let e=r;for(;e<i&&/[A-Za-z0-9_$]/.test(t[e]);)e+=1;let a=t.slice(r,e);t[s(e)]===`:`?n+=`"`+a+`"`:n+=a===`undefined`||a===`NaN`||a===`Infinity`?`null`:a,r=e;continue}if(e===`-`&&t.startsWith(`Infinity`,r+1)){n+=`null`,r+=9;continue}if(/[0-9]/.test(e)||e===`-`&&/[0-9]/.test(t[r+1]||``)){let e=r;for(;e<i&&/[0-9eE+\-.]/.test(t[e]);)e+=1;let a=t.slice(r,e);t[s(e)]===`:`?n+=`"`+a+`"`:n+=a,r=e;continue}if(e===`}`||e===`]`){let e=a();for(;e>=0&&n[e]===`,`;)n=n.slice(0,e)+n.slice(e+1),e=a()}n+=e,r+=1}try{return{value:JSON.parse(n.trim()||`{}`)}}catch(e){return{error:e.message}}}function __(e){let t=/^\d{2}:\d{2}:\d{2}\.\d{3}\s+(INFO|OK\s|WARN|ERR)\b/.exec(e);if(t){let e=t[1].trim();return e===`ERR`?`error`:e===`WARN`?`warn`:e===`OK`?`ok`:`info`}return`info`}function v_(e){let t=String(e&&e.text!=null?e.text:``),n=n_(t);return{seq:Number(e&&e.seq)||0,t:Number(e&&e.t)||0,level:__(n),plain:n,html:p_(t)}}function y_(e,t){if(e===t)return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!y_(e[r],t[r]))return!1;return!0}function b_(e){return e===void 0?void 0:JSON.parse(JSON.stringify(e))}var x_={name:`DebugPanel`,components:{JsonTree:Kp,StructureTree:_m,NodeInspector:Xm,EventEditor:Nh,LogValue:dg,Dropdown:Sg,ConfirmDialog:_p,NumberStepper:Ag,SetSegment:Kg},props:{rt:{type:Object,required:!0},preview:{type:Object,default:null},schema:{type:Object,default:null},cardId:{type:String,default:``},reloadToken:{type:Number,default:0},cardCount:{type:Number,default:0},selectedNodeId:{type:String,default:``},moveCollapseToken:{type:Number,default:0},activeTab:{type:String,default:`vars`},devSvcClass:{type:String,default:`app__btn--warn`},devSvcTitle:{type:String,default:``},devSvcLabel:{type:String,default:``},devSvcConn:{type:String,default:``},chromeOff:{type:Boolean,default:!1}},data(){return{copied:!1,copyTimer:null,copiedVar:null,varCopyTimer:null,errorPanel:``,eventTab:`log`,svcLogs:[],svcLogSeq:0,svcLogFloor:0,svcLogLive:!1,svcLogFollow:!0,svcLogDropped:0,svcLogLoading:!1,svcLogErr:``,svcCopied:!1,statePanelOpen:!1,panelH:this.loadPanelH(),panelDragging:!1,edgeArmed:!1,_edgeTimer:null,inspectingComp:null,inspectKey:0,editingEventComp:null,eventEditorKey:0,rawText:``,rawError:``,varsMode:`list`,varDlg:null,varDlgError:``,delVarTarget:null,varTypeOptions:[{key:`string`,value:`字符串`},{key:`number`,value:`数字`},{key:`boolean`,value:`布尔`},{key:`array`,value:`数组`},{key:`object`,value:`对象`}],varBoolOptions:[{key:`true`,value:`true`},{key:`false`,value:`false`}],importMeta:null,tabs:[{key:`vars`,label:`变量`},{key:`structure`,label:`组件结构`},{key:`meta`,label:`卡片来源`}]}},computed:{mocks(){return Zg(this.schema)||{}},inputParams(){let e=this.schema&&this.schema.dictionary;return e&&Array.isArray(e.inputParams)?e.inputParams:[]},delVarRefs(){let e=this.delVarTarget==null?null:this.inputParams[this.delVarTarget];return this.scanVarRefs(e&&e.key)},delVarSeverity(){let e=this.delVarRefs;return e.binding+e.event+e.other>0?`danger`:`warn`},delVarConfirmText(){return this.delVarSeverity===`danger`?`仍要删除`:`删除`},delVarMessage(){let e=this.delVarTarget==null?null:this.inputParams[this.delVarTarget];if(!e)return``;let t=e.name&&e.name!==e.key?`(`+e.name+`)`:``,n=this.delVarRefs,r=n.binding+n.event+n.other;if(r>0){let i=[];return n.binding&&i.push(`绑定表达式 ${n.binding} 处`),n.event&&i.push(`事件脚本 ${n.event} 处`),n.other&&i.push(`其它文本 ${n.other} 处`),`变量「${e.key}」${t}仍被${i.join(`、`)}引用(共 ${r} 处)。删除后这些引用将取不到值,画布可能出现空白或执行报错,请先迁移再删除。`}return`变量「${e.key}」${t}当前未被任何绑定表达式或事件脚本引用。删除后变量定义与 mock 值一并移除,不可恢复。`},svcEmptyText(){return this.devSvcConn===`unconfigured`?`未配置本地开发服务`:this.devSvcConn===`open`?`暂无服务日志`:`本地服务未连接`},svcEmptyHint(){return this.svcLogErr?`取历史失败:`+this.svcLogErr+`(本地服务需升级到支持 /__logs 的 cardbuddy 版本)`:this.devSvcConn===`unconfigured`?`在顶栏「连接」中配置本地开发服务地址后,这里会实时镜像该服务终端的彩色输出`:this.devSvcConn===`open`?`cardbuddy 终端的输出(含配色)会实时镜像到这里;试试同步、保存、校验或截图`:`连接恢复后自动继续;服务端保留最近 800 行历史,重连不丢`},scopeText(){this.rt.revision;try{return JSON.stringify(this.rt.rootScope,null,2)}catch{return`(无法序列化)`}},bindingErrors(){return this.rt.errorRev,this.rt.errors.slice()},eventErrors(){return this.rt.errorRev,this.rt.eventErrors.slice()},logs(){return this.rt.logRev,this.rt.eventLogs.slice()},eventCount(){return this.eventErrors.length+this.logs.length},eventStatusClass(){return this.eventErrors.length?`is-error`:this.logs.length?`is-log`:`is-ok`},eventStatusTitle(){return this.eventErrors.length?`查看事件(含错误)`:this.logs.length?`查看事件(含日志)`:`无事件记录`},panelErrors(){return this.errorPanel===`event`?this.eventErrors:this.bindingErrors},compNames(){let e={};for(let t in vu)e[t]=vu[t].name||t;return e.Root=`根`,e},canPaste(){return!!Vu.node},stateDirty(){return this.rt.revision,!y_(this.rt.state,this.rt.rootScope)}},watch:{errorPanel(e){e===`svclog`?this.startSvcLog():this.stopSvcLog()},cardId:{immediate:!0,handler(){this.rawError=``,this.destroyJar(),this.varsMode=`list`,this.varDlg=null,this.varDlgError=``,this.delVarTarget=null,this.inspectingComp=null,this.editingEventComp=null,this.importMeta=null,this.maybeFetchMeta()}},reloadToken(){this.maybeFetchMeta()},activeTab(e){e===`meta`&&this.fetchImportMeta(),e!==`vars`&&(this.varsMode=`list`,this.rawError=``,this.destroyJar(),this.varDlg=null)},varDlg(e){if(!e){this.destroyDlgJar();return}this.varDlgError=``,this.isComplexType(e.form.type)&&this.$nextTick(()=>this.initDlgJar())},"varDlg.form.type"(e,t){!this.varDlg||e===t||(this.varDlg.form.defaultValue=this.normalizeDefaultText(e,this.varDlg.form.defaultValue),this.isComplexType(e)?this.$nextTick(()=>this.initDlgJar()):this.destroyDlgJar())},varsMode(e){e===`mock`?(this.seedRawFromMocks(),this.$nextTick(()=>this.initJar())):(this.rawError=``,this.destroyJar())},schema(){this.inspectingComp=null,this.editingEventComp=null,this.varsMode===`mock`&&this.seedRawFromMocks()}},mounted(){let e=this.panelH;this.$refs.statePanel&&(this.$refs.statePanel.style.height=e+`px`),this.$refs.errPanel&&(this.$refs.errPanel.style.height=e+`px`)},beforeUnmount(){this.destroyJar(),this.destroyDlgJar(),this.cancelResize(),this.stopSvcLog()},methods:{toggleStatePanel(){this.statePanelOpen=!this.statePanelOpen,this.statePanelOpen&&(this.errorPanel=``)},toggleErrorPanel(e){this.errorPanel=this.errorPanel===e?``:e,this.errorPanel&&(this.statePanelOpen=!1,e===`event`&&(this.eventTab=this.eventErrors.length?`err`:`log`))},armEdge(){clearTimeout(this._edgeTimer),this._edgeTimer=setTimeout(()=>{this.edgeArmed=!0},300)},disarmEdge(){clearTimeout(this._edgeTimer),this._edgeTimer=null,!this.panelDragging&&(this.edgeArmed=!1)},startResize(e){if(e.target.closest(`button`)||!this.edgeArmed)return;this.panelDragging=!0;let t=e.clientY,n=this.panelH,r=Math.max(120,Math.round(window.innerHeight*.6)),i=e=>{this.panelH=e,this.$refs.statePanel&&(this.$refs.statePanel.style.height=e+`px`),this.$refs.errPanel&&(this.$refs.errPanel.style.height=e+`px`)},a=e=>{let a=t-e.clientY;i(Math.min(r,Math.max(120,n+a)))},o=()=>{document.body.style.cursor=``,document.body.style.userSelect=``,document.removeEventListener(`mousemove`,a),document.removeEventListener(`mouseup`,o),this._resizeMove=this._resizeUp=null,this.panelDragging=!1,this.savePanelH()};this._resizeMove=a,this._resizeUp=o,document.body.style.cursor=`row-resize`,document.body.style.userSelect=`none`,document.addEventListener(`mousemove`,a),document.addEventListener(`mouseup`,o)},cancelResize(){this._resizeMove&&document.removeEventListener(`mousemove`,this._resizeMove),this._resizeUp&&document.removeEventListener(`mouseup`,this._resizeUp),this._resizeMove=this._resizeUp=null,this.panelDragging=!1,document.body.style.cursor=``,document.body.style.userSelect=``},loadPanelH(){try{let e=localStorage.getItem(`cardbuddy:debug-panel-height`);if(e!=null){let t=parseInt(e,10);if(!Number.isNaN(t)){let e=Math.max(120,Math.round(window.innerHeight*.6));return Math.min(e,Math.max(120,t))}}}catch{}return 240},savePanelH(){try{localStorage.setItem(`cardbuddy:debug-panel-height`,String(Math.round(this.panelH)))}catch{}},initJar(){let e=this.$refs.rawEditor;if(!e)return;this.destroyJar();let t=e=>{e.innerHTML=Yg.default.highlight(e.textContent,Yg.default.languages.json,`json`)};this._jar=Jg(e,t,{tab:` `,indentOn:/[({[]$/,addClosing:!0,history:!0}),this._jar.updateCode(this.rawText||``),this._jar.onUpdate(e=>{this.rawText=e,this.rawError&&=``}),window.__rawEditor=this._jar,this.$nextTick(()=>e.focus())},destroyJar(){this._jar&&this._jar.destroy&&this._jar.destroy(),this._jar=null,typeof window<`u`&&window.__rawEditor&&(window.__rawEditor=null)},initDlgJar(){let e=this.$refs.dlgCode;if(!e)return;this.destroyDlgJar();let t=e=>{e.innerHTML=Yg.default.highlight(e.textContent,Yg.default.languages.json,`json`)};this._dlgJar=Jg(e,t,{tab:` `,indentOn:/[({[]$/,addClosing:!0,history:!0}),this._dlgJar.updateCode(this.varDlg?this.varDlg.form.defaultValue:``),this._dlgJar.onUpdate(e=>{this.varDlg&&(this.varDlg.form.defaultValue=e),this.varDlgError&&=``}),window.__dlgEditor=this._dlgJar},destroyDlgJar(){this._dlgJar&&this._dlgJar.destroy&&this._dlgJar.destroy(),this._dlgJar=null,typeof window<`u`&&window.__dlgEditor&&(window.__dlgEditor=null)},complexSeed(e,t){let n=e===`array`?`[]`:`{}`,r=String(t??``).trim();if(!r)return n;try{let t=JSON.parse(r);return(e===`array`?Array.isArray(t):t&&typeof t==`object`)?JSON.stringify(t,null,2):n}catch{return n}},normalizeDefaultText(e,t){if(this.isComplexType(e))return this.complexSeed(e,t);let n=String(t??``).trim();return e===`number`?n!==``&&Number.isFinite(Number(n))?String(Number(n)):``:e===`boolean`?/^(true|1)$/i.test(n)?`true`:`false`:String(t??``)},saveRaw(){let e=g_(this.rawText);if(e.error){this.rawError=`JSON 格式错误:`+e.error;return}if(e.value===null||typeof e.value!=`object`||Array.isArray(e.value)){this.rawError=`变量 mock 必须是 JSON 对象({ ... })`;return}let t=this.schema;if(!t){this.rawError=`当前未载入卡片`;return}(!t.dictionary||typeof t.dictionary!=`object`)&&(t.dictionary={dictionaryList:[],inputParams:[]}),t.dictionary.mocks=e.value,this.rt.setRootScope(Xg(t,{includeMocks:!0}));let n=JSON.stringify(e.value,null,2);this.rawText=n,this._jar&&this._jar.updateCode(n),this.$nextTick(()=>this.onCommit()),this.rawError=``},async copyScope(){await op(this.rawText||``)&&(this.copied=!0,this.copyTimer&&clearTimeout(this.copyTimer),this.copyTimer=setTimeout(()=>{this.copied=!1},1500))},onEditEvent(e){this.editingEventComp=e,this.eventEditorKey++},onApply(){this.$emit(`schema-changed`)},onCommit(){this.$emit(`schema-commit`)},hasMock(e){return Qg(this.mocks,e.key)},async copyVarName(e,t){let n=e&&e.key?String(e.key):``;n&&await op(n)&&(this.copiedVar=t,this.varCopyTimer&&clearTimeout(this.varCopyTimer),this.varCopyTimer=setTimeout(()=>{this.copiedVar===t&&(this.copiedVar=null)},1500))},isComplexType(e){return e===`array`||e===`object`},scalarPlaceholder(e){return e===`number`?`数字,如 0 / 99.5`:`字符串原样保存`},onVarTypeChange(e){this.varDlg&&(this.varDlg.form.type=e)},openVarDlg(e){let t=e==null?null:this.inputParams[e],n=t&&t.type||`string`,r=t?t.defaultValue:void 0,i=``;r!=null&&(i=typeof r==`object`?JSON.stringify(r,null,2):String(r)),i=this.normalizeDefaultText(n,i),this.varDlgError=``,this.varDlg={index:e,form:{key:t&&t.key||``,name:t&&t.name||``,type:n,defaultValue:i,desc:t&&t.desc||``}}},parseDefault(e,t){let n=String(t??``).trim();if(this.isComplexType(e)){if(!n)return{value:e===`array`?[]:{}};let t=g_(n);if(t.error)return{error:`默认值不是合法 JSON:`+t.error};let r=t.value;return e===`array`&&!Array.isArray(r)?{error:`默认值需为 JSON 数组`}:e===`object`&&(typeof r!=`object`||!r||Array.isArray(r))?{error:`默认值需为 JSON 对象`}:{value:r}}if(e===`number`){if(!n)return{value:0};let e=Number(n);return Number.isFinite(e)?{value:e}:{error:`默认值不是合法数字`}}return e===`boolean`?n?n===`true`||n===`1`?{value:!0}:n===`false`||n===`0`?{value:!1}:{error:`布尔默认值仅接受 true / false`}:{value:!1}:{value:String(t??``)}},confirmVarDlg(){let e=this.varDlg;if(!e)return;let t=e.form,n=String(t.key||``).trim(),r=String(t.name||``).trim();if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(n)){this.varDlgError=`变量名需为字母 / 下划线开头的英文标识(绑定以 $key 引用)`;return}if(this.inputParams.some((t,r)=>t.key===n&&r!==e.index)){this.varDlgError=`已存在同名变量 `+n;return}if(!r){this.varDlgError=`中文名不能为空`;return}let i=this.parseDefault(t.type,t.defaultValue);if(i.error){this.varDlgError=i.error;return}if(this.isComplexType(t.type)){let e=JSON.stringify(i.value,null,2);t.defaultValue=e,this._dlgJar&&this._dlgJar.updateCode(e)}let a=this.schema;if(!a){this.varDlgError=`当前未载入卡片`;return}(!a.dictionary||typeof a.dictionary!=`object`)&&(a.dictionary={dictionaryList:[],inputParams:[]}),Array.isArray(a.dictionary.inputParams)||(a.dictionary.inputParams=[]);let o=a.dictionary.inputParams,s=this.rt.rootScope,c=Zg(a)||{},l=b_(i.value);if(e.index==null)o.push({key:n,name:r,type:t.type,defaultValue:b_(l),desc:String(t.desc||``),rule:{type:``,options:{}},children:[]}),Qg(c,n)||(s[n]=l);else{let i=o[e.index];if(!i)return;let a=i.key;i.key=n,i.name=r,i.type=t.type,i.desc=String(t.desc||``),i.defaultValue=b_(l),a!==n&&(Object.prototype.hasOwnProperty.call(c,a)&&(c[n]=c[a],delete c[a]),s&&Object.prototype.hasOwnProperty.call(s,a)&&delete s[a]),Qg(c,n)||(s[n]=l)}this.varDlg=null,this.onCommit()},askDeleteVar(e){this.delVarTarget=e},scanVarRefs(e){let t={binding:0,event:0,other:0},n=this.schema;if(!e||!n||typeof n!=`object`)return t;let r=String(e).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i=RegExp(`\\$`+r+`(?![A-Za-z0-9_$])`),a=RegExp(`state\\s*(?:\\.\\s*`+r+`(?![A-Za-z0-9_$])|\\[\\s*['"]`+r+`['"]\\s*\\])`),o=e=>i.test(e)||a.test(e),s=e=>{if(e!=null){if(Array.isArray(e)){for(let t of e)s(t);return}if(typeof e==`object`){for(let[n,r]of Object.entries(e))if(n!==`dictionary`&&n!==`compiled`)if(typeof r==`string`){if(!o(r))continue;n===`itemValue`?t.binding+=1:n===`code`?t.event+=1:t.other+=1}else s(r)}}};return s(n),t},confirmDeleteVar(){let e=this.delVarTarget==null?null:this.inputParams[this.delVarTarget];if(this.delVarTarget=null,!e||!this.schema||!this.schema.dictionary)return;let t=this.schema.dictionary.inputParams||[],n=t.indexOf(e);n>=0&&t.splice(n,1);let r=Zg(this.schema)||{};Object.prototype.hasOwnProperty.call(r,e.key)&&delete r[e.key];let i=this.rt.rootScope;i&&Object.prototype.hasOwnProperty.call(i,e.key)&&delete i[e.key],this.onCommit()},leaveMock(){this.varsMode=`list`},seedRawFromMocks(){this.rawError=``;try{this.rawText=JSON.stringify(this.mocks,null,2)}catch(e){this.rawText=``,this.rawError=`无法序列化当前数据:`+(e&&e.message);return}this._jar&&this._jar.updateCode(this.rawText)},onInspect(e){this.inspectingComp=e,this.inspectKey++},onSelectNode(e){this.$emit(`select-node`,e)},onAddNode(e){this.$emit(`add-node`,e)},onMoveNode(e){this.$emit(`move-node`,e)},onHoverNode(e){this.$emit(`hover-node`,e)},clearEventLogs(){this.rt.clearEventLogs()},async startSvcLog(){this.svcLogFollow=!0,await this.pullSvcLogHistory(0),!this._svcUnsub&&(this._svcUnsub=Ul(e=>this.appendSvcLogs(e&&e.lines),e=>{this.svcLogLive=e===`open`,e===`open`&&this.svcLogSeq&&this.pullSvcLogHistory(this.svcLogSeq)}))},stopSvcLog(){this._svcUnsub&&=(this._svcUnsub(),null),this.svcLogLive=!1},async pullSvcLogHistory(e){if(this.svcLogLoading)return;this.svcLogLoading=!0;let t=Math.max(Number(e)||0,this.svcLogFloor);try{let e=await Wl({limit:h_,since:t});if(this.svcLogErr=``,e&&e.enabled===!1)this.svcLogErr=`服务端已关闭日志流(CARDBUDDY_STREAM_LOGS=0)`;else{this.svcLogDropped=e&&e.dropped||0,e&&e.seq&&(this.svcLogSeq=Math.max(this.svcLogSeq,e.seq));let n=(e&&e.lines||[]).map(v_);t?this.appendSvcLogs(n):this.svcLogs=n,this.scrollSvcToBottom(!0)}}catch(e){this.svcLogErr=e&&e.message||String(e)}finally{this.svcLogLoading=!1}},appendSvcLogs(e){let t=Array.isArray(e)?e:[];if(!t.length)return;let n=[];for(let e of t){let t=e&&e.html!=null?e:v_(e),r=Number(t.seq)||0;r&&r<=this.svcLogSeq||(r&&(this.svcLogSeq=r),n.push(t))}if(!n.length)return;let r=this.svcLogs.concat(n);this.svcLogs=r.length>h_?r.slice(r.length-h_):r,this.svcLogFollow&&this.scrollSvcToBottom()},clearSvcLogs(){this.svcLogFloor=this.svcLogSeq,this.svcLogs=[],this.svcLogDropped=0},async copySvcLogs(){await op(this.svcLogs.map(e=>e.plain).join(`
|
|
156
|
-
`))&&(this.svcCopied=!0,this._svcCopiedTimer&&clearTimeout(this._svcCopiedTimer),this._svcCopiedTimer=setTimeout(()=>{this.svcCopied=!1},1200))},toggleSvcFollow(){this.svcLogFollow=!this.svcLogFollow,this.svcLogFollow&&this.scrollSvcToBottom(!0)},scrollSvcToBottom(e){!e&&!this.svcLogFollow||this.$nextTick(()=>{let e=this.$refs.errBody;e&&(e.scrollTop=e.scrollHeight)})},onErrBodyScroll(){if(this.errorPanel!==`svclog`)return;let e=this.$refs.errBody;e&&(this.svcLogFollow=e.scrollHeight-e.scrollTop-e.clientHeight<24)},fmtTime(e){if(!e)return`--:--:--`;let t=new Date(e),n=e=>String(e).padStart(2,`0`);return n(t.getHours())+`:`+n(t.getMinutes())+`:`+n(t.getSeconds())},maybeFetchMeta(){this.activeTab===`meta`&&this.fetchImportMeta()},async fetchImportMeta(){let e=this.cardId;if(!e){this.importMeta=null;return}try{let t=await J(`/__import-meta/${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();this.importMeta=e.meta||null}else this.importMeta=null}catch{this.importMeta=null}},formatTime(e){if(!e)return`-`;try{return new Date(e).toLocaleString(`zh-CN`,{hour12:!1})}catch{return e}}}},S_={class:`debug`},C_={class:`debug__tabs`},w_=[`onClick`],T_={class:`debug__body`},E_={key:0,class:`vars`},D_={key:0,class:`empty-state`},O_={key:1,class:`vars__list`},k_=[`onDblclick`],A_={class:`vars__key`},j_={key:0,class:`vars__mock`,title:`已配置 mock(dictionary.mocks,设计期覆盖默认值)`},M_=[`title`],N_=[`disabled`,`title`,`onClick`],P_={key:0,class:`debug__copy-ok`},F_={key:1,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},I_=[`onClick`],L_=[`onClick`],R_={class:`vars__fabs`},z_={class:`debug__scope-wrap debug__scope-wrap--raw`},B_={class:`vars__mockhead`},V_={class:`debug__scope-raw`},H_={key:0,class:`raw-err-bar`,role:`alert`},U_={class:`raw-err-bar__msg`},W_={ref:`rawEditor`,class:`debug__raw-editor`,spellcheck:`false`},G_={class:`debug__scope-foot`},K_={key:0,class:`debug__copied`},q_={key:2,class:`debug__meta`},J_={key:0,class:`empty-state`},Y_={key:1,class:`debug__meta-list`},X_={class:`debug__meta-row`},Z_={class:`debug__meta-muted`},Q_={class:`debug__meta-row`},$_={class:`debug__meta-row`},ev={class:`debug__meta-row`},tv={key:0,class:`debug__meta-row`},nv={class:`debug__meta-row`},rv={class:`debug__meta-row`},iv={class:`debug__meta-row`},av={class:`debug__meta-row`},ov={key:0,class:`debug__tag debug__tag--warn`,title:`本地已编辑,偏离导入镜像`},sv={key:1,class:`debug__tag debug__tag--ok`},cv={key:1,class:`debug__meta-row`},lv={key:0,class:`debug__tag debug__tag--ok`},uv={key:1,class:`debug__tag debug__tag--err`},dv={class:`debug__meta-muted`},fv={key:2,class:`debug__meta-err`},pv={class:`statepanel`,ref:`statePanel`},mv={class:`statepanel__head`},hv={class:`statepanel__tree`},gv={class:`statusbar`},_v=[`title`],vv=[`title`],yv={class:`statusbar__icon`},bv=[`title`],xv={class:`statusbar__icon`},Sv=[`title`],Cv={class:`statusbar__item statusbar__item--right`},wv={class:`statusbar__item statusbar__item--right`},Tv={class:`errpanel`,ref:`errPanel`},Ev={class:`errpanel__head`},Dv={class:`errpanel__title`},Ov={key:0,class:`svclog__meta`},kv={key:0},Av={key:1,class:`errpanel__tabs`},jv={class:`errpanel__tab-count`},Mv={class:`errpanel__actions`},Nv=[`disabled`],Pv=[`disabled`,`title`],Fv=[`title`],Iv=[`disabled`],Lv={key:0,class:`empty-state`},Rv={class:`debug__empty`},zv={class:`empty-state__hint`},Bv={key:1,class:`svclog`},Vv=[`innerHTML`],Hv={key:0,class:`empty-state`},Uv={key:1,class:`debug__list debug__list--log`},Wv={class:`log__time`},Gv={class:`log__content`},Kv={key:1,class:`log__empty`},qv={key:0,class:`empty-state`},Jv={key:1,class:`debug__list`},Yv={class:`err__time`},Xv={class:`debug__kind`},Zv={class:`err__msg`},Qv={key:0,class:`empty-state`},$v={key:1,class:`debug__list`},ey={class:`err__time`},ty={class:`debug__kind`},ny={class:`err__msg`},ry=[`aria-label`],iy={class:`ni-head`},ay={class:`ni-title`},oy={class:`ni-cls`},sy={class:`ni-body`},cy={class:`ni-scroll`},ly={class:`ni-field-row`},uy={class:`ni-field-row`},dy={class:`ni-field-row`},fy={key:0,class:`vars-type-pick`},py={class:`vars-type-pick__name`},my={class:`vars-type-pick`},hy={class:`vars-type-pick__name`},gy={class:`ni-field-row ni-field-row--top`},_y={key:0,ref:`dlgCode`,class:`vars-dlg__code`,spellcheck:`false`},vy=[`placeholder`],yy={class:`ni-field-row ni-field-row--top`},by={key:0,class:`vars-dlg__err`},xy={class:`ni-foot`},Sy={class:`ni-foot-btns`};function Cy(e,t,n,r,i,a){let o=L(`StructureTree`),s=L(`NodeInspector`),c=L(`EventEditor`),l=L(`JsonTree`),u=L(`LogValue`),d=L(`Dropdown`),f=L(`NumberStepper`),p=L(`SetSegment`),m=L(`ConfirmDialog`);return B(),V(`aside`,S_,[U(`div`,C_,[(B(!0),V(z,null,R(i.tabs,t=>(B(),V(`button`,{key:t.key,class:j([`debug__tab`,{"debug__tab--active":n.activeTab===t.key}]),onClick:n=>e.$emit(`update:activeTab`,t.key)},M(t.label),11,w_))),128))]),U(`div`,T_,[n.activeTab===`vars`?(B(),V(z,{key:0},[K(` 变量列表视图:管理 schema.dictionary.inputParams(变量属性的增 / 删 / 改) `),i.varsMode===`list`?(B(),V(`div`,E_,[K(` 空态占位:与卡片来源 / API 调用面板同款语言 `),a.inputParams.length?(B(),V(`ul`,O_,[(B(!0),V(z,null,R(a.inputParams,(e,n)=>(B(),V(`li`,{key:e.key||n,class:`vars__row`,onDblclick:e=>a.openVarDlg(n)},[U(`span`,A_,M(e.key),1),U(`span`,{class:j([`vars__type`,`vars__type--`+(e.type||`string`)])},M(e.type||`string`),3),a.hasMock(e)?(B(),V(`span`,j_,`m`)):K(`v-if`,!0),U(`span`,{class:`vars__name`,title:[e.name,e.desc].filter(Boolean).join(` · `)},M(e.name||e.desc||``),9,M_),K(` 操作区双击不冒泡到行:连点复制/删除/编辑钮时不误开编辑弹窗 `),U(`span`,{class:`vars__ops`,onDblclick:t[0]||=q(()=>{},[`stop`])},[K(` 复制变量名:复制当前变量 key(绑定以 $key 引用),无变量名时禁用 `),U(`button`,{class:`vars__op`,type:`button`,disabled:!e.key,title:i.copiedVar===n?`已复制 ✓`:e.key?`复制变量名`:`暂无变量名`,onClick:t=>a.copyVarName(e,n)},[i.copiedVar===n?(B(),V(`span`,P_,`✓`)):(B(),V(`svg`,F_,[...t[47]||=[U(`use`,{href:`#icon-copy-sm`},null,-1)]]))],8,N_),U(`button`,{class:`vars__op`,type:`button`,title:`编辑变量`,onClick:e=>a.openVarDlg(n)},[...t[48]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-gear`})],-1)]],8,I_),U(`button`,{class:`vars__op vars__op--del`,type:`button`,title:`删除变量`,onClick:e=>a.askDeleteVar(n)},[...t[49]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-trash`})],-1)]],8,L_)],32)],40,k_))),128))])):(B(),V(`div`,D_,[...t[46]||=[as(`<span class="empty-state__badge" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-settings"></use></svg></span><p class="debug__empty">暂无变量</p><p class="empty-state__hint">变量与 schema.dictionary.inputParams 一一对应:绑定表达式以 $key 引用,mock 值供设计期预览</p>`,3)]])),K(` 右下角悬浮操作组:与 mock 视图悬浮条同语言,不占固定行高 `),U(`div`,R_,[U(`button`,{class:`debug__copy`,type:`button`,title:`新增变量(写入 dictionary.inputParams)`,onClick:t[1]||=e=>a.openVarDlg(null)},`+ 添加变量`),a.inputParams.length?(B(),V(`button`,{key:0,class:`debug__copy`,type:`button`,title:`以 Raw JSON 编辑全部变量的设计期 mock 数据`,onClick:t[2]||=e=>i.varsMode=`mock`},`配置变量 mock`)):K(`v-if`,!0)])])):(B(),V(z,{key:1},[K(` mock 二级视图:仅 Raw JSON(CodeJar + Prism 高亮);右下角操作按钮只在此出现 `),U(`div`,z_,[U(`div`,B_,[U(`button`,{class:`vars__back`,type:`button`,title:`返回变量列表`,onClick:t[3]||=(...e)=>a.leaveMock&&a.leaveMock(...e)},[...t[50]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`polyline`,{points:`15 18 9 12 15 6`})],-1),G(` 变量 `,-1)]]),t[51]||=U(`span`,{class:`vars__mocktitle`},`变量 mock · 设计期覆盖(dictionary.mocks · Raw JSON)`,-1),t[52]||=U(`span`,{class:`vars__mockhint`},`仅设计期生效 · 未列出的键回退默认值`,-1)]),U(`div`,V_,[K(` 报错提示条:与顶部提示条同语言(语义色软底 + 图标 + 关闭),钉在编辑器顶部不挤占编辑区 `),i.rawError?(B(),V(`div`,H_,[t[53]||=U(`svg`,{class:`raw-err-bar__icn`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-alert-triangle`})],-1),U(`span`,U_,M(i.rawError),1),U(`button`,{class:`raw-err-bar__close`,type:`button`,title:`关闭`,onClick:t[4]||=e=>i.rawError=``},`✕`)])):K(`v-if`,!0),U(`div`,W_,null,512)]),U(`div`,G_,[K(` 右下角悬浮组内的返回:与头部 chip 同一 leaveMock 语义,手不离编辑区即可退出二级视图 `),U(`button`,{class:`debug__copy`,type:`button`,title:`返回变量列表`,onClick:t[5]||=(...e)=>a.leaveMock&&a.leaveMock(...e)},[...t[54]||=[U(`svg`,{class:`debug__copy-icn`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`polyline`,{points:`15 18 9 12 15 6`})],-1),G(`返回 `,-1)]]),t[58]||=U(`span`,{class:`debug__sep`},null,-1),i.copied?(B(),V(`span`,K_,`已复制 ✓`)):K(`v-if`,!0),U(`button`,{class:`debug__copy`,type:`button`,onClick:t[6]||=(...e)=>a.copyScope&&a.copyScope(...e)},[...t[55]||=[U(`svg`,{class:`debug__copy-icn`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-copy-sm`})],-1),G(`复制 `,-1)]]),t[59]||=U(`span`,{class:`debug__sep`},null,-1),U(`button`,{class:`debug__copy debug__copy--primary`,type:`button`,onClick:t[7]||=(...e)=>a.saveRaw&&a.saveRaw(...e)},[...t[56]||=[U(`svg`,{class:`debug__copy-icn`,viewBox:`0 0 16 16`,"aria-hidden":`true`},[U(`use`,{href:`#icon-check`})],-1),G(`应用 `,-1)]]),U(`button`,{class:`debug__copy debug__copy--warn`,type:`button`,onClick:t[8]||=t=>e.$emit(`reset-import`),title:`丢弃内存编辑,从磁盘重新载入(导入优先于编辑)`},[...t[57]||=[U(`svg`,{class:`debug__copy-icn`,viewBox:`0 0 16 16`,"aria-hidden":`true`},[U(`use`,{href:`#icon-reset`})],-1),G(`重置 `,-1)]])])])],2112))],64)):n.activeTab===`structure`?(B(),H(o,{key:1,preview:n.preview,schema:n.schema,"card-code":n.cardId,"selected-node-id":n.selectedNodeId,"move-collapse-token":n.moveCollapseToken,"can-paste":a.canPaste,onEditEvent:a.onEditEvent,onInspect:a.onInspect,onSelectNode:a.onSelectNode,onAddNode:a.onAddNode,onMoveNode:a.onMoveNode,onHoverNode:a.onHoverNode,onCopySelected:t[9]||=t=>e.$emit(`copy-selected`),onPaste:t[10]||=t=>e.$emit(`paste`),onDuplicate:t[11]||=t=>e.$emit(`duplicate`),onDeleteSelected:t[12]||=t=>e.$emit(`delete-selected`),onRenameCard:t[13]||=t=>e.$emit(`rename-card`)},null,8,[`preview`,`schema`,`card-code`,`selected-node-id`,`move-collapse-token`,`can-paste`,`onEditEvent`,`onInspect`,`onSelectNode`,`onAddNode`,`onMoveNode`,`onHoverNode`])):n.activeTab===`meta`?(B(),V(`div`,q_,[K(` 空状态占位:与 API 调用面板同款(虚线徽章 + 线性图标 + 文案 + 弱提示) `),i.importMeta?(B(),V(`dl`,Y_,[U(`div`,X_,[t[62]||=U(`dt`,null,`导入接口`,-1),U(`dd`,null,[U(`code`,null,M(i.importMeta.interface),1),t[61]||=G(),U(`span`,Z_,`(`+M(i.importMeta.source)+`)`,1)])]),U(`div`,Q_,[t[63]||=U(`dt`,null,`远端基址`,-1),U(`dd`,null,[U(`code`,null,M(i.importMeta.baseUrl),1)])]),U(`div`,$_,[t[64]||=U(`dt`,null,`cardId`,-1),U(`dd`,null,[U(`code`,null,M(i.importMeta.cardId),1)])]),U(`div`,ev,[t[65]||=U(`dt`,null,`cardCode`,-1),U(`dd`,null,[U(`code`,null,M(i.importMeta.cardCode),1)])]),i.importMeta.cardName?(B(),V(`div`,tv,[t[66]||=U(`dt`,null,`卡片标题`,-1),U(`dd`,null,M(i.importMeta.cardName),1)])):K(`v-if`,!0),U(`div`,nv,[t[68]||=U(`dt`,null,`应用 / 空间`,-1),U(`dd`,null,[U(`code`,null,M(i.importMeta.appId),1),t[67]||=G(` / `,-1),U(`code`,null,M(i.importMeta.workspaceId),1)])]),U(`div`,rv,[t[69]||=U(`dt`,null,`同步时间`,-1),U(`dd`,null,M(a.formatTime(i.importMeta.syncedAt)),1)]),U(`div`,iv,[t[70]||=U(`dt`,null,`落库位置`,-1),U(`dd`,null,[U(`code`,null,`src/cards/`+M(i.importMeta.cardCode)+`/`,1)])]),U(`div`,av,[t[71]||=U(`dt`,null,`本地状态`,-1),U(`dd`,null,[i.importMeta.dirty?(B(),V(`span`,ov,`已编辑(偏离导入镜像)`)):(B(),V(`span`,sv,`与导入镜像一致`))])]),i.importMeta.lastExport?(B(),V(`div`,cv,[t[72]||=U(`dt`,null,`最近导出`,-1),U(`dd`,null,[i.importMeta.lastExport.ok?(B(),V(`span`,lv,`读回校验通过 ✓`)):(B(),V(`span`,uv,`读回校验未通过 ✗`)),U(`span`,dv,`(`+M(a.formatTime(i.importMeta.lastExport.at))+`)`,1),i.importMeta.lastExport.readBackError?(B(),V(`span`,fv,` · `+M(i.importMeta.lastExport.readBackError),1)):K(`v-if`,!0)])])):K(`v-if`,!0)])):(B(),V(`div`,J_,[...t[60]||=[as(`<span class="empty-state__badge" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-cloud"></use></svg></span><p class="debug__empty">暂无卡片来源</p><p class="empty-state__hint">该卡尚未经「同步远程」导入,无导入来源元数据;本地新建卡 / 未同步卡均如此</p>`,3)]])),t[73]||=U(`p`,{class:`debug__meta-hint`},`导入优先于编辑:在「变量」tab →「配置变量 mock」里点「重置」,可丢弃内存编辑、从磁盘重新载入最新导入。`,-1)])):K(`v-if`,!0)]),K(`
|
|
153
|
+
`;)t--;t++;let n=t;for(;n<e.length&&/[ \t]/.test(e[n]);)n++;return[e.substring(t,n)||``,t,n]}function me(){return e.textContent||``}function he(e){e.preventDefault()}function ge(){return e.getRootNode().getSelection()}return{updateOptions(e){Object.assign(r,e)},updateCode(t,n=!0){e.textContent=t,f(e),n&&u(t)},onUpdate(e){u=e},toString:me,save:x,restore:S,recordHistory:re,destroy(){for(let[t,n]of o)e.removeEventListener(t,n)}}}var T_=c(o(((e,t)=>{var n=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,`&`).replace(/</g,`<`).replace(/\u00a0/g,` `)},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){n||={};var r,a;switch(i.util.type(t)){case`Object`:if(a=i.util.objId(t),n[a])return n[a];for(var o in r={},n[a]=r,t)t.hasOwnProperty(o)&&(r[o]=e(t[o],n));return r;case`Array`:return a=i.util.objId(t),n[a]?n[a]:(r=[],n[a]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return`none`},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,`gi`),``),e.classList.add(`language-`+n)},currentScript:function(){if(typeof document>`u`)return null;if(document.currentScript&&document.currentScript.tagName===`SCRIPT`)return document.currentScript;try{throw Error()}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName(`script`);for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r=`no-`+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=i.util.clone(i.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r||=i.languages;var a=r[e],o={};for(var s in a)if(a.hasOwnProperty(s)){if(s==t)for(var c in n)n.hasOwnProperty(c)&&(o[c]=n[c]);n.hasOwnProperty(s)||(o[s]=a[s])}var l=r[e];return r[e]=o,i.languages.DFS(i.languages,function(t,n){n===l&&t!=e&&(this[t]=o)}),o},DFS:function e(t,n,r,a){a||={};var o=i.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var c=t[s],l=i.util.type(c);l===`Object`&&!a[o(c)]?(a[o(c)]=!0,e(c,n,null,a)):l===`Array`&&!a[o(c)]&&(a[o(c)]=!0,e(c,n,s,a))}}},plugins:{},highlightAll:function(e,t){i.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:`code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code`};i.hooks.run(`before-highlightall`,r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),i.hooks.run(`before-all-elements-highlight`,r);for(var a=0,o;o=r.elements[a++];)i.highlightElement(o,t===!0,r.callback)},highlightElement:function(t,n,r){var a=i.util.getLanguage(t),o=i.languages[a];i.util.setLanguage(t,a);var s=t.parentElement;s&&s.nodeName.toLowerCase()===`pre`&&i.util.setLanguage(s,a);var c={element:t,language:a,grammar:o,code:t.textContent};function l(e){c.highlightedCode=e,i.hooks.run(`before-insert`,c),c.element.innerHTML=c.highlightedCode,i.hooks.run(`after-highlight`,c),i.hooks.run(`complete`,c),r&&r.call(c.element)}if(i.hooks.run(`before-sanity-check`,c),s=c.element.parentElement,s&&s.nodeName.toLowerCase()===`pre`&&!s.hasAttribute(`tabindex`)&&s.setAttribute(`tabindex`,`0`),!c.code){i.hooks.run(`complete`,c),r&&r.call(c.element);return}if(i.hooks.run(`before-highlight`,c),!c.grammar){l(i.util.encode(c.code));return}if(n&&e.Worker){var u=new Worker(i.filename);u.onmessage=function(e){l(e.data)},u.postMessage(JSON.stringify({language:c.language,code:c.code,immediateClose:!0}))}else l(i.highlight(c.code,c.grammar,c.language))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(i.hooks.run(`before-tokenize`,r),!r.grammar)throw Error(`The language "`+r.language+`" has no grammar.`);return r.tokens=i.tokenize(r.code,r.grammar),i.hooks.run(`after-tokenize`,r),a.stringify(i.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new c;return l(i,i.head,e),s(e,i,t,i.head,0),d(i)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(!(!n||!n.length))for(var r=0,a;a=n[r++];)a(t)}},Token:a};e.Prism=i;function a(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}a.stringify=function e(t,n){if(typeof t==`string`)return t;if(Array.isArray(t)){var r=``;return t.forEach(function(t){r+=e(t,n)}),r}var a={type:t.type,content:e(t.content,n),tag:`span`,classes:[`token`,t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(a.classes,o):a.classes.push(o)),i.hooks.run(`wrap`,a);var s=``;for(var c in a.attributes)s+=` `+c+`="`+(a.attributes[c]||``).replace(/"/g,`"`)+`"`;return`<`+a.tag+` class="`+a.classes.join(` `)+`"`+s+`>`+a.content+`</`+a.tag+`>`};function o(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function s(e,t,n,r,c,d){for(var f in n)if(!(!n.hasOwnProperty(f)||!n[f])){var p=n[f];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==f+`,`+m)return;var h=p[m],g=h.inside,_=!!h.lookbehind,v=!!h.greedy,y=h.alias;if(v&&!h.pattern.global){var b=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,b+`g`)}for(var x=h.pattern||h,S=r.next,C=c;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var w=S.value;if(t.length>e.length)return;if(!(w instanceof a)){var ee=1,T;if(v){if(T=o(x,C,e,_),!T||T.index>=e.length)break;var E=T.index,te=T.index+T[0].length,D=C;for(D+=S.value.length;E>=D;)S=S.next,D+=S.value.length;if(D-=S.value.length,C=D,S.value instanceof a)continue;for(var ne=S;ne!==t.tail&&(D<te||typeof ne.value==`string`);ne=ne.next)ee++,D+=ne.value.length;ee--,w=e.slice(C,D),T.index-=C}else if(T=o(x,0,w,_),!T)continue;var E=T.index,re=T[0],ie=w.slice(0,E),ae=w.slice(E+re.length),oe=C+w.length;d&&oe>d.reach&&(d.reach=oe);var se=S.prev;ie&&(se=l(t,se,ie),C+=ie.length),u(t,se,ee);var ce=new a(f,g?i.tokenize(re,g):re,y,re);if(S=l(t,se,ce),ae&&l(t,S,ae),ee>1){var le={cause:f+`,`+m,reach:oe};s(e,t,n,S.prev,C,le),d&&le.reach>d.reach&&(d.reach=le.reach)}}}}}}function c(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function u(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function d(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}if(!e.document)return e.addEventListener&&(i.disableWorkerMessageHandler||e.addEventListener(`message`,function(t){var n=JSON.parse(t.data),r=n.language,a=n.code,o=n.immediateClose;e.postMessage(i.highlight(a,i.languages[r],r)),o&&e.close()},!1)),i;var f=i.util.currentScript();f&&(i.filename=f.src,f.hasAttribute(`data-manual`)&&(i.manual=!0));function p(){i.manual||i.highlightAll()}if(!i.manual){var m=document.readyState;m===`loading`||m===`interactive`&&f&&f.defer?document.addEventListener(`DOMContentLoaded`,p):window.requestAnimationFrame?window.requestAnimationFrame(p):window.setTimeout(p,16)}return i}(typeof window<`u`?window:typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope?self:{});t!==void 0&&t.exports&&(t.exports=n),typeof global<`u`&&(global.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside[`attr-value`].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside[`internal-subset`].inside=n.languages.markup,n.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&/,`&`))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i[`language-`+t]={pattern:/[\s\S]+/,inside:n.languages[t]};var a={};a[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:i},n.languages.insertBefore(`markup`,`cdata`,a)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(e,t){n.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:n.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend(`markup`,{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend(`clike`,{"class-name":[n.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),n.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),n.languages.markup&&(n.languages.markup.tag.addInlined(`script`,`javascript`),n.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),n.languages.js=n.languages.javascript,(function(){if(n===void 0||typeof document>`u`)return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e=`Loading…`,t=function(e,t){return`✖ Error `+e+` while fetching file: `+t},r=`✖ Error: File does not exist or is empty`,i={js:`javascript`,py:`python`,rb:`ruby`,ps1:`powershell`,psm1:`powershell`,sh:`bash`,bat:`batch`,h:`c`,tex:`latex`},a=`data-src-status`,o=`loading`,s=`loaded`,c=`failed`,l=`pre[data-src]:not([`+a+`="`+s+`"]):not([`+a+`="`+o+`"])`;function u(e,n,i){var a=new XMLHttpRequest;a.open(`GET`,e,!0),a.onreadystatechange=function(){a.readyState==4&&(a.status<400&&a.responseText?n(a.responseText):a.status>=400?i(t(a.status,a.statusText)):i(r))},a.send(null)}function d(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||``);if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}n.hooks.add(`before-highlightall`,function(e){e.selector+=`, `+l}),n.hooks.add(`before-sanity-check`,function(t){var r=t.element;if(r.matches(l)){t.code=``,r.setAttribute(a,o);var f=r.appendChild(document.createElement(`CODE`));f.textContent=e;var p=r.getAttribute(`data-src`),m=t.language;if(m===`none`){var h=(/\.(\w+)$/.exec(p)||[,`none`])[1];m=i[h]||h}n.util.setLanguage(f,m),n.util.setLanguage(r,m);var g=n.plugins.autoloader;g&&g.loadLanguages(m),u(p,function(e){r.setAttribute(a,s);var t=d(r.getAttribute(`data-range`));if(t){var i=e.split(/\r\n?|\n/g),o=t[0],c=t[1]==null?i.length:t[1];o<0&&(o+=i.length),o=Math.max(0,Math.min(o-1,i.length)),c<0&&(c+=i.length),c=Math.max(0,Math.min(c,i.length)),e=i.slice(o,c).join(`
|
|
154
|
+
`),r.hasAttribute(`data-start`)||r.setAttribute(`data-start`,String(o+1))}f.textContent=e,n.highlightElement(f)},function(e){r.setAttribute(a,c),f.textContent=e})}}),n.plugins.fileHighlight={highlight:function(e){for(var t=(e||document).querySelectorAll(l),r=0,i;i=t[r++];)n.highlightElement(i)}};var f=!1;n.fileHighlight=function(){f||=(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()}))());Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`}},Prism.languages.webmanifest=Prism.languages.json;function E_(e,t={}){if(!e||typeof e!=`object`)return{};let n=t.includeMocks?D_(e):null,r={};for(let t of e.dictionary?.inputParams||[]){let e=k_(t),i=t.defaultValue,a=i&&typeof i==`object`&&!Array.isArray(i)&&Object.keys(i).length===0,o=e!==void 0&&(i===void 0||i===``||a)?e:i;n&&O_(n,t.key)&&(o=n[t.key]),r[t.key]=A_(o)}return r}function D_(e){let t=e&&e.dictionary&&e.dictionary.mocks;return t&&typeof t==`object`&&!Array.isArray(t)?t:null}function O_(e,t){if(!e||!Object.prototype.hasOwnProperty.call(e,t))return!1;let n=e[t];return n==null||n===``?!1:Array.isArray(n)?n.length>0:typeof n!=`object`||Object.keys(n).length>0}function k_(e){if(!e.desc||typeof e.desc!=`string`)return;let t=e.desc.trim();if(t.startsWith(`{`))try{let n=JSON.parse(t);return Object.prototype.hasOwnProperty.call(n,e.key)?n[e.key]:void 0}catch{return}}function A_(e){return e==null?e:JSON.parse(JSON.stringify(e))}var j_=/\x1b\[[0-9;:?]*[ -/]*[@-~]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[@-Z\\-_]/g;function M_(e){return String(e??``).replace(j_,``)}var N_=[[0,0,0],[170,0,0],[0,170,0],[170,85,0],[0,0,170],[170,0,170],[0,170,170],[170,170,170]],P_=[[85,85,85],[255,85,85],[85,255,85],[255,255,85],[85,85,255],[255,85,255],[85,255,255],[255,255,255]];function F_(e){let t=Math.round(Number(e));return Number.isFinite(t)?t<0?0:t>255?255:t:0}function I_(e){let t=F_(e);if(t<8)return N_[t];if(t<16)return P_[t-8];if(t<232){let e=t-16,n=e=>e?e*40+55:0;return[n(Math.floor(e/36)),n(Math.floor(e%36/6)),n(e%6)]}let n=8+(t-232)*10;return[n,n,n]}function L_(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function R_(e){return`rgb(${e[0]},${e[1]},${e[2]})`}function z_(){return{fg:null,bg:null,bold:!1,dim:!1,italic:!1,underline:!1}}function B_(e){return!e.fg&&!e.bg&&!e.bold&&!e.dim&&!e.italic&&!e.underline}function V_(e){let t=[],n=e.fg;return n&&n.basic!=null&&(n={rgb:e.bold?P_[n.basic]:N_[n.basic]}),n&&t.push(`color:${R_(n.rgb)}`),e.bg&&t.push(`background-color:${R_(e.bg.rgb)}`),e.bold&&t.push(`font-weight:600`),e.dim&&t.push(`opacity:.72`),e.italic&&t.push(`font-style:italic`),e.underline&&t.push(`text-decoration:underline`),t.join(`;`)}function H_(e,t){let n=String(t||``),r=(n===``?`0`:n).split(/[;:]/).map(e=>e===``?0:Number(e));for(let t=0;t<r.length;t++){let n=r[t];if(Number.isFinite(n)){if(n===0)Object.assign(e,z_());else if(n===1)e.bold=!0;else if(n===2)e.dim=!0;else if(n===3)e.italic=!0;else if(n===4)e.underline=!0;else if(n===22)e.bold=!1,e.dim=!1;else if(n===23)e.italic=!1;else if(n===24)e.underline=!1;else if(n===39)e.fg=null;else if(n===49)e.bg=null;else if(n>=30&&n<=37)e.fg={basic:n-30};else if(n>=90&&n<=97)e.fg={rgb:P_[n-90]};else if(n>=40&&n<=47)e.bg={basic:n-40};else if(n>=100&&n<=107)e.bg={rgb:P_[n-100]};else if(n===38||n===48){let i=r[t+1],a=null,o=0;i===5?(a=I_(r[t+2]),o=2):i===2&&(a=[F_(r[t+2]),F_(r[t+3]),F_(r[t+4])],o=4),a&&(n===38?e.fg={rgb:a}:e.bg={rgb:a},t+=o)}}}}function U_(e){let t=String(e??``);if(!t)return``;if(t.indexOf(`\x1B`)<0)return L_(t);let n=z_(),r=``,i=0,a;for(j_.lastIndex=0;(a=j_.exec(t))!==null;){a.index>i&&(r+=W_(t.slice(i,a.index),n)),i=a.index+a[0].length;let e=a[0];e[1]===`[`&&/[m]$/.test(e)&&H_(n,e.slice(2,-1))}return i<t.length&&(r+=W_(t.slice(i),n)),r}function W_(e,t){if(!e)return``;let n=L_(e);if(B_(t))return n;let r=V_(t);return r?`<span style="${r}">${n}</span>`:n}var G_=800;function K_(e){let t=String(e??``).replace(/^\uFEFF/,``),n=``,r=0,i=t.length,a=()=>{let e=n.length-1;for(;e>=0&&/\s/.test(n[e]);)--e;return e},o=()=>{let e=a();e>=0&&n[e]!==`,`&&n[e]!==`[`&&n[e]!==`{`&&(n+=`,`)},s=e=>{let n=e;for(;n<i&&/\s/.test(t[n]);)n+=1;return n};for(;r<i;){let e=t[r];if(e===`"`){let e=r+1;for(;e<i;){if(t[e]===`\\`){e+=2;continue}if(t[e]===`"`){e+=1;break}e+=1}n+=t.slice(r,e),r=e;continue}if(e===`'`){let e=r+1,a=``;for(;e<i;){let n=t[e];if(n===`\\`&&e+1<i){let r=t[e+1];if(r===`'`){a+=`'`,e+=2;continue}if(r===`"`){a+=`\\"`,e+=2;continue}a+=n+r,e+=2;continue}if(n===`'`){e+=1;break}if(n===`"`){a+=`\\"`,e+=1;continue}a+=n,e+=1}n+=`"`+a+`"`,r=e;continue}if(e===`/`&&t[r+1]===`/`){for(;r<i&&t[r]!==`
|
|
155
|
+
`;)r+=1;continue}if(e===`/`&&t[r+1]===`*`){let e=t.indexOf(`*/`,r+2);r=e===-1?i:e+2;continue}if(e===`;`||e===`,`){o(),r+=1;continue}if(/[A-Za-z_$]/.test(e)){let e=r;for(;e<i&&/[A-Za-z0-9_$]/.test(t[e]);)e+=1;let a=t.slice(r,e);t[s(e)]===`:`?n+=`"`+a+`"`:n+=a===`undefined`||a===`NaN`||a===`Infinity`?`null`:a,r=e;continue}if(e===`-`&&t.startsWith(`Infinity`,r+1)){n+=`null`,r+=9;continue}if(/[0-9]/.test(e)||e===`-`&&/[0-9]/.test(t[r+1]||``)){let e=r;for(;e<i&&/[0-9eE+\-.]/.test(t[e]);)e+=1;let a=t.slice(r,e);t[s(e)]===`:`?n+=`"`+a+`"`:n+=a,r=e;continue}if(e===`}`||e===`]`){let e=a();for(;e>=0&&n[e]===`,`;)n=n.slice(0,e)+n.slice(e+1),e=a()}n+=e,r+=1}try{return{value:JSON.parse(n.trim()||`{}`)}}catch(e){return{error:e.message}}}function q_(e){let t=/^\d{2}:\d{2}:\d{2}\.\d{3}\s+(INFO|OK\s|WARN|ERR)\b/.exec(e);if(t){let e=t[1].trim();return e===`ERR`?`error`:e===`WARN`?`warn`:e===`OK`?`ok`:`info`}return`info`}function J_(e){let t=String(e&&e.text!=null?e.text:``),n=M_(t);return{seq:Number(e&&e.seq)||0,t:Number(e&&e.t)||0,level:q_(n),plain:n,html:U_(t)}}function Y_(e,t){if(e===t)return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Y_(e[r],t[r]))return!1;return!0}function X_(e){return e===void 0?void 0:JSON.parse(JSON.stringify(e))}var Z_={name:`DebugPanel`,components:{JsonTree:qp,StateDiffPanel:Sm,StructureTree:qm,NodeInspector:Eh,EventEditor:lg,LogValue:Vg,Dropdown:Qg,ConfirmDialog:vp,NumberStepper:o_,SetSegment:S_},props:{rt:{type:Object,required:!0},preview:{type:Object,default:null},schema:{type:Object,default:null},cardId:{type:String,default:``},reloadToken:{type:Number,default:0},cardCount:{type:Number,default:0},selectedNodeId:{type:String,default:``},moveCollapseToken:{type:Number,default:0},activeTab:{type:String,default:`vars`},devSvcClass:{type:String,default:`app__btn--warn`},devSvcTitle:{type:String,default:``},devSvcLabel:{type:String,default:``},devSvcConn:{type:String,default:``},chromeOff:{type:Boolean,default:!1}},data(){return{copied:!1,copyTimer:null,copiedVar:null,varCopyTimer:null,errorPanel:``,eventTab:`log`,svcLogs:[],svcLogSeq:0,svcLogFloor:0,svcLogLive:!1,svcLogFollow:!0,svcLogDropped:0,svcLogLoading:!1,svcLogErr:``,svcCopied:!1,statePanelOpen:!1,panelH:this.loadPanelH(),panelDragging:!1,edgeArmed:!1,_edgeTimer:null,inspectingComp:null,inspectKey:0,editingEventComp:null,eventEditorKey:0,rawText:``,rawError:``,varsMode:`list`,varDlg:null,varDlgError:``,delVarTarget:null,varTypeOptions:[{key:`string`,value:`字符串`},{key:`number`,value:`数字`},{key:`boolean`,value:`布尔`},{key:`array`,value:`数组`},{key:`object`,value:`对象`}],varBoolOptions:[{key:`true`,value:`true`},{key:`false`,value:`false`}],importMeta:null,tabs:[{key:`vars`,label:`变量`},{key:`structure`,label:`组件结构`},{key:`meta`,label:`卡片来源`}]}},computed:{mocks(){return D_(this.schema)||{}},inputParams(){let e=this.schema&&this.schema.dictionary;return e&&Array.isArray(e.inputParams)?e.inputParams:[]},delVarRefs(){let e=this.delVarTarget==null?null:this.inputParams[this.delVarTarget];return this.scanVarRefs(e&&e.key)},delVarSeverity(){let e=this.delVarRefs;return e.binding+e.event+e.other>0?`danger`:`warn`},delVarConfirmText(){return this.delVarSeverity===`danger`?`仍要删除`:`删除`},delVarMessage(){let e=this.delVarTarget==null?null:this.inputParams[this.delVarTarget];if(!e)return``;let t=e.name&&e.name!==e.key?`(`+e.name+`)`:``,n=this.delVarRefs,r=n.binding+n.event+n.other;if(r>0){let i=[];return n.binding&&i.push(`绑定表达式 ${n.binding} 处`),n.event&&i.push(`事件脚本 ${n.event} 处`),n.other&&i.push(`其它文本 ${n.other} 处`),`变量「${e.key}」${t}仍被${i.join(`、`)}引用(共 ${r} 处)。删除后这些引用将取不到值,画布可能出现空白或执行报错,请先迁移再删除。`}return`变量「${e.key}」${t}当前未被任何绑定表达式或事件脚本引用。删除后变量定义与 mock 值一并移除,不可恢复。`},svcEmptyText(){return this.devSvcConn===`unconfigured`?`未配置本地开发服务`:this.devSvcConn===`open`?`暂无服务日志`:`本地服务未连接`},svcEmptyHint(){return this.svcLogErr?`取历史失败:`+this.svcLogErr+`(本地服务需升级到支持 /__logs 的 cardbuddy 版本)`:this.devSvcConn===`unconfigured`?`在顶栏「连接」中配置本地开发服务地址后,这里会实时镜像该服务终端的彩色输出`:this.devSvcConn===`open`?`cardbuddy 终端的输出(含配色)会实时镜像到这里;试试同步、保存、校验或截图`:`连接恢复后自动继续;服务端保留最近 800 行历史,重连不丢`},scopeText(){this.rt.revision;try{return JSON.stringify(this.rt.rootScope,null,2)}catch{return`(无法序列化)`}},bindingErrors(){return this.rt.errorRev,this.rt.errors.slice()},eventErrors(){return this.rt.errorRev,this.rt.eventErrors.slice()},logs(){return this.rt.logRev,this.rt.eventLogs.slice()},eventCount(){return this.eventErrors.length+this.logs.length},eventStatusClass(){return this.eventErrors.length?`is-error`:this.logs.length?`is-log`:`is-ok`},eventStatusTitle(){return this.eventErrors.length?`查看事件(含错误)`:this.logs.length?`查看事件(含日志)`:`无事件记录`},panelErrors(){return this.errorPanel===`event`?this.eventErrors:this.bindingErrors},compNames(){let e={};for(let t in yu)e[t]=yu[t].name||t;return e.Root=`根`,e},canPaste(){return!!Hu.node},stateDirty(){return this.rt.revision,!Y_(this.rt.state,this.rt.rootScope)}},watch:{errorPanel(e){e===`svclog`?this.startSvcLog():this.stopSvcLog()},cardId:{immediate:!0,handler(){this.rawError=``,this.destroyJar(),this.varsMode=`list`,this.varDlg=null,this.varDlgError=``,this.delVarTarget=null,this.inspectingComp=null,this.editingEventComp=null,this.importMeta=null,this.maybeFetchMeta()}},reloadToken(){this.maybeFetchMeta()},activeTab(e){e===`meta`&&this.fetchImportMeta(),e!==`vars`&&(this.varsMode=`list`,this.rawError=``,this.destroyJar(),this.varDlg=null)},varDlg(e){if(!e){this.destroyDlgJar();return}this.varDlgError=``,this.isComplexType(e.form.type)&&this.$nextTick(()=>this.initDlgJar())},"varDlg.form.type"(e,t){!this.varDlg||e===t||(this.varDlg.form.defaultValue=this.normalizeDefaultText(e,this.varDlg.form.defaultValue),this.isComplexType(e)?this.$nextTick(()=>this.initDlgJar()):this.destroyDlgJar())},varsMode(e){e===`mock`?(this.seedRawFromMocks(),this.$nextTick(()=>this.initJar())):(this.rawError=``,this.destroyJar())},schema(){this.inspectingComp=null,this.editingEventComp=null,this.varsMode===`mock`&&this.seedRawFromMocks()}},mounted(){let e=this.panelH;this.$refs.statePanel&&(this.$refs.statePanel.style.height=e+`px`),this.$refs.errPanel&&(this.$refs.errPanel.style.height=e+`px`)},beforeUnmount(){this.destroyJar(),this.destroyDlgJar(),this.cancelResize(),this.stopSvcLog()},methods:{toggleStatePanel(){this.statePanelOpen=!this.statePanelOpen,this.statePanelOpen&&(this.errorPanel=``)},toggleErrorPanel(e){this.errorPanel=this.errorPanel===e?``:e,this.errorPanel&&(this.statePanelOpen=!1,e===`event`&&(this.eventTab=this.eventErrors.length?`err`:`log`))},armEdge(){clearTimeout(this._edgeTimer),this._edgeTimer=setTimeout(()=>{this.edgeArmed=!0},300)},disarmEdge(){clearTimeout(this._edgeTimer),this._edgeTimer=null,!this.panelDragging&&(this.edgeArmed=!1)},startResize(e){if(e.target.closest(`button`)||!this.edgeArmed)return;this.panelDragging=!0;let t=e.clientY,n=this.panelH,r=Math.max(120,Math.round(window.innerHeight*.6)),i=e=>{this.panelH=e,this.$refs.statePanel&&(this.$refs.statePanel.style.height=e+`px`),this.$refs.errPanel&&(this.$refs.errPanel.style.height=e+`px`)},a=e=>{let a=t-e.clientY;i(Math.min(r,Math.max(120,n+a)))},o=()=>{document.body.style.cursor=``,document.body.style.userSelect=``,document.removeEventListener(`mousemove`,a),document.removeEventListener(`mouseup`,o),this._resizeMove=this._resizeUp=null,this.panelDragging=!1,this.savePanelH()};this._resizeMove=a,this._resizeUp=o,document.body.style.cursor=`row-resize`,document.body.style.userSelect=`none`,document.addEventListener(`mousemove`,a),document.addEventListener(`mouseup`,o)},cancelResize(){this._resizeMove&&document.removeEventListener(`mousemove`,this._resizeMove),this._resizeUp&&document.removeEventListener(`mouseup`,this._resizeUp),this._resizeMove=this._resizeUp=null,this.panelDragging=!1,document.body.style.cursor=``,document.body.style.userSelect=``},loadPanelH(){try{let e=localStorage.getItem(`cardbuddy:debug-panel-height`);if(e!=null){let t=parseInt(e,10);if(!Number.isNaN(t)){let e=Math.max(120,Math.round(window.innerHeight*.6));return Math.min(e,Math.max(120,t))}}}catch{}return 240},savePanelH(){try{localStorage.setItem(`cardbuddy:debug-panel-height`,String(Math.round(this.panelH)))}catch{}},initJar(){let e=this.$refs.rawEditor;if(!e)return;this.destroyJar();let t=e=>{e.innerHTML=T_.default.highlight(e.textContent,T_.default.languages.json,`json`)};this._jar=w_(e,t,{tab:` `,indentOn:/[({[]$/,addClosing:!0,history:!0}),this._jar.updateCode(this.rawText||``),this._jar.onUpdate(e=>{this.rawText=e,this.rawError&&=``}),window.__rawEditor=this._jar,this.$nextTick(()=>e.focus())},destroyJar(){this._jar&&this._jar.destroy&&this._jar.destroy(),this._jar=null,typeof window<`u`&&window.__rawEditor&&(window.__rawEditor=null)},initDlgJar(){let e=this.$refs.dlgCode;if(!e)return;this.destroyDlgJar();let t=e=>{e.innerHTML=T_.default.highlight(e.textContent,T_.default.languages.json,`json`)};this._dlgJar=w_(e,t,{tab:` `,indentOn:/[({[]$/,addClosing:!0,history:!0}),this._dlgJar.updateCode(this.varDlg?this.varDlg.form.defaultValue:``),this._dlgJar.onUpdate(e=>{this.varDlg&&(this.varDlg.form.defaultValue=e),this.varDlgError&&=``}),window.__dlgEditor=this._dlgJar},destroyDlgJar(){this._dlgJar&&this._dlgJar.destroy&&this._dlgJar.destroy(),this._dlgJar=null,typeof window<`u`&&window.__dlgEditor&&(window.__dlgEditor=null)},complexSeed(e,t){let n=e===`array`?`[]`:`{}`,r=String(t??``).trim();if(!r)return n;try{let t=JSON.parse(r);return(e===`array`?Array.isArray(t):t&&typeof t==`object`)?JSON.stringify(t,null,2):n}catch{return n}},normalizeDefaultText(e,t){if(this.isComplexType(e))return this.complexSeed(e,t);let n=String(t??``).trim();return e===`number`?n!==``&&Number.isFinite(Number(n))?String(Number(n)):``:e===`boolean`?/^(true|1)$/i.test(n)?`true`:`false`:String(t??``)},saveRaw(){let e=K_(this.rawText);if(e.error){this.rawError=`JSON 格式错误:`+e.error;return}if(e.value===null||typeof e.value!=`object`||Array.isArray(e.value)){this.rawError=`变量 mock 必须是 JSON 对象({ ... })`;return}let t=this.schema;if(!t){this.rawError=`当前未载入卡片`;return}(!t.dictionary||typeof t.dictionary!=`object`)&&(t.dictionary={dictionaryList:[],inputParams:[]}),t.dictionary.mocks=e.value,this.rt.setRootScope(E_(t,{includeMocks:!0}));let n=JSON.stringify(e.value,null,2);this.rawText=n,this._jar&&this._jar.updateCode(n),this.$nextTick(()=>this.onCommit()),this.rawError=``},async copyScope(){await sp(this.rawText||``)&&(this.copied=!0,this.copyTimer&&clearTimeout(this.copyTimer),this.copyTimer=setTimeout(()=>{this.copied=!1},1500))},onEditEvent(e){this.editingEventComp=e,this.eventEditorKey++},onApply(){this.$emit(`schema-changed`)},onCommit(){this.$emit(`schema-commit`)},hasMock(e){return O_(this.mocks,e.key)},async copyVarName(e,t){let n=e&&e.key?String(e.key):``;n&&await sp(n)&&(this.copiedVar=t,this.varCopyTimer&&clearTimeout(this.varCopyTimer),this.varCopyTimer=setTimeout(()=>{this.copiedVar===t&&(this.copiedVar=null)},1500))},isComplexType(e){return e===`array`||e===`object`},scalarPlaceholder(e){return e===`number`?`数字,如 0 / 99.5`:`字符串原样保存`},onVarTypeChange(e){this.varDlg&&(this.varDlg.form.type=e)},openVarDlg(e){let t=e==null?null:this.inputParams[e],n=t&&t.type||`string`,r=t?t.defaultValue:void 0,i=``;r!=null&&(i=typeof r==`object`?JSON.stringify(r,null,2):String(r)),i=this.normalizeDefaultText(n,i),this.varDlgError=``,this.varDlg={index:e,form:{key:t&&t.key||``,name:t&&t.name||``,type:n,defaultValue:i,desc:t&&t.desc||``}}},parseDefault(e,t){let n=String(t??``).trim();if(this.isComplexType(e)){if(!n)return{value:e===`array`?[]:{}};let t=K_(n);if(t.error)return{error:`默认值不是合法 JSON:`+t.error};let r=t.value;return e===`array`&&!Array.isArray(r)?{error:`默认值需为 JSON 数组`}:e===`object`&&(typeof r!=`object`||!r||Array.isArray(r))?{error:`默认值需为 JSON 对象`}:{value:r}}if(e===`number`){if(!n)return{value:0};let e=Number(n);return Number.isFinite(e)?{value:e}:{error:`默认值不是合法数字`}}return e===`boolean`?n?n===`true`||n===`1`?{value:!0}:n===`false`||n===`0`?{value:!1}:{error:`布尔默认值仅接受 true / false`}:{value:!1}:{value:String(t??``)}},confirmVarDlg(){let e=this.varDlg;if(!e)return;let t=e.form,n=String(t.key||``).trim(),r=String(t.name||``).trim();if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(n)){this.varDlgError=`变量名需为字母 / 下划线开头的英文标识(绑定以 $key 引用)`;return}if(this.inputParams.some((t,r)=>t.key===n&&r!==e.index)){this.varDlgError=`已存在同名变量 `+n;return}if(!r){this.varDlgError=`中文名不能为空`;return}let i=this.parseDefault(t.type,t.defaultValue);if(i.error){this.varDlgError=i.error;return}if(this.isComplexType(t.type)){let e=JSON.stringify(i.value,null,2);t.defaultValue=e,this._dlgJar&&this._dlgJar.updateCode(e)}let a=this.schema;if(!a){this.varDlgError=`当前未载入卡片`;return}(!a.dictionary||typeof a.dictionary!=`object`)&&(a.dictionary={dictionaryList:[],inputParams:[]}),Array.isArray(a.dictionary.inputParams)||(a.dictionary.inputParams=[]);let o=a.dictionary.inputParams,s=this.rt.rootScope,c=D_(a)||{},l=X_(i.value);if(e.index==null)o.push({key:n,name:r,type:t.type,defaultValue:X_(l),desc:String(t.desc||``),rule:{type:``,options:{}},children:[]}),O_(c,n)||(s[n]=l);else{let i=o[e.index];if(!i)return;let a=i.key;i.key=n,i.name=r,i.type=t.type,i.desc=String(t.desc||``),i.defaultValue=X_(l),a!==n&&(Object.prototype.hasOwnProperty.call(c,a)&&(c[n]=c[a],delete c[a]),s&&Object.prototype.hasOwnProperty.call(s,a)&&delete s[a]),O_(c,n)||(s[n]=l)}this.varDlg=null,this.onCommit()},askDeleteVar(e){this.delVarTarget=e},scanVarRefs(e){let t={binding:0,event:0,other:0},n=this.schema;if(!e||!n||typeof n!=`object`)return t;let r=String(e).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i=RegExp(`\\$`+r+`(?![A-Za-z0-9_$])`),a=RegExp(`state\\s*(?:\\.\\s*`+r+`(?![A-Za-z0-9_$])|\\[\\s*['"]`+r+`['"]\\s*\\])`),o=e=>i.test(e)||a.test(e),s=e=>{if(e!=null){if(Array.isArray(e)){for(let t of e)s(t);return}if(typeof e==`object`){for(let[n,r]of Object.entries(e))if(n!==`dictionary`&&n!==`compiled`)if(typeof r==`string`){if(!o(r))continue;n===`itemValue`?t.binding+=1:n===`code`?t.event+=1:t.other+=1}else s(r)}}};return s(n),t},confirmDeleteVar(){let e=this.delVarTarget==null?null:this.inputParams[this.delVarTarget];if(this.delVarTarget=null,!e||!this.schema||!this.schema.dictionary)return;let t=this.schema.dictionary.inputParams||[],n=t.indexOf(e);n>=0&&t.splice(n,1);let r=D_(this.schema)||{};Object.prototype.hasOwnProperty.call(r,e.key)&&delete r[e.key];let i=this.rt.rootScope;i&&Object.prototype.hasOwnProperty.call(i,e.key)&&delete i[e.key],this.onCommit()},leaveMock(){this.varsMode=`list`},seedRawFromMocks(){this.rawError=``;try{this.rawText=JSON.stringify(this.mocks,null,2)}catch(e){this.rawText=``,this.rawError=`无法序列化当前数据:`+(e&&e.message);return}this._jar&&this._jar.updateCode(this.rawText)},onInspect(e){this.inspectingComp=e,this.inspectKey++},onSelectNode(e){this.$emit(`select-node`,e)},onAddNode(e){this.$emit(`add-node`,e)},onMoveNode(e){this.$emit(`move-node`,e)},onHoverNode(e){this.$emit(`hover-node`,e)},clearEventLogs(){this.rt.clearEventLogs()},async startSvcLog(){this.svcLogFollow=!0,await this.pullSvcLogHistory(0),!this._svcUnsub&&(this._svcUnsub=Wl(e=>this.appendSvcLogs(e&&e.lines),e=>{this.svcLogLive=e===`open`,e===`open`&&this.svcLogSeq&&this.pullSvcLogHistory(this.svcLogSeq)}))},stopSvcLog(){this._svcUnsub&&=(this._svcUnsub(),null),this.svcLogLive=!1},async pullSvcLogHistory(e){if(this.svcLogLoading)return;this.svcLogLoading=!0;let t=Math.max(Number(e)||0,this.svcLogFloor);try{let e=await Gl({limit:G_,since:t});if(this.svcLogErr=``,e&&e.enabled===!1)this.svcLogErr=`服务端已关闭日志流(CARDBUDDY_STREAM_LOGS=0)`;else{this.svcLogDropped=e&&e.dropped||0,e&&e.seq&&(this.svcLogSeq=Math.max(this.svcLogSeq,e.seq));let n=(e&&e.lines||[]).map(J_);t?this.appendSvcLogs(n):this.svcLogs=n,this.scrollSvcToBottom(!0)}}catch(e){this.svcLogErr=e&&e.message||String(e)}finally{this.svcLogLoading=!1}},appendSvcLogs(e){let t=Array.isArray(e)?e:[];if(!t.length)return;let n=[];for(let e of t){let t=e&&e.html!=null?e:J_(e),r=Number(t.seq)||0;r&&r<=this.svcLogSeq||(r&&(this.svcLogSeq=r),n.push(t))}if(!n.length)return;let r=this.svcLogs.concat(n);this.svcLogs=r.length>G_?r.slice(r.length-G_):r,this.svcLogFollow&&this.scrollSvcToBottom()},clearSvcLogs(){this.svcLogFloor=this.svcLogSeq,this.svcLogs=[],this.svcLogDropped=0},async copySvcLogs(){await sp(this.svcLogs.map(e=>e.plain).join(`
|
|
156
|
+
`))&&(this.svcCopied=!0,this._svcCopiedTimer&&clearTimeout(this._svcCopiedTimer),this._svcCopiedTimer=setTimeout(()=>{this.svcCopied=!1},1200))},toggleSvcFollow(){this.svcLogFollow=!this.svcLogFollow,this.svcLogFollow&&this.scrollSvcToBottom(!0)},scrollSvcToBottom(e){!e&&!this.svcLogFollow||this.$nextTick(()=>{let e=this.$refs.errBody;e&&(e.scrollTop=e.scrollHeight)})},onErrBodyScroll(){if(this.errorPanel!==`svclog`)return;let e=this.$refs.errBody;e&&(this.svcLogFollow=e.scrollHeight-e.scrollTop-e.clientHeight<24)},fmtTime(e){if(!e)return`--:--:--`;let t=new Date(e),n=e=>String(e).padStart(2,`0`);return n(t.getHours())+`:`+n(t.getMinutes())+`:`+n(t.getSeconds())},maybeFetchMeta(){this.activeTab===`meta`&&this.fetchImportMeta()},async fetchImportMeta(){let e=this.cardId;if(!e){this.importMeta=null;return}try{let t=await q(`/__import-meta/${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();this.importMeta=e.meta||null}else this.importMeta=null}catch{this.importMeta=null}},formatTime(e){if(!e)return`-`;try{return new Date(e).toLocaleString(`zh-CN`,{hour12:!1})}catch{return e}}}},Q_={class:`debug`},$_={class:`debug__tabs`},ev=[`onClick`],tv={class:`debug__body`},nv={key:0,class:`vars`},rv={key:0,class:`empty-state`},iv={key:1,class:`vars__list`},av=[`onDblclick`],ov={class:`vars__key`},sv={key:0,class:`vars__mock`,title:`已配置 mock(dictionary.mocks,设计期覆盖默认值)`},cv=[`title`],lv=[`disabled`,`title`,`onClick`],uv={key:0,class:`debug__copy-ok`},dv={key:1,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},fv=[`onClick`],pv=[`onClick`],mv={class:`vars__fabs`},hv={class:`debug__scope-wrap debug__scope-wrap--raw`},gv={class:`vars__mockhead`},_v={class:`debug__scope-raw`},vv={key:0,class:`raw-err-bar`,role:`alert`},yv={class:`raw-err-bar__msg`},bv={ref:`rawEditor`,class:`debug__raw-editor`,spellcheck:`false`},xv={class:`debug__scope-foot`},Sv={key:0,class:`debug__copied`},Cv={key:2,class:`debug__meta`},wv={key:0,class:`empty-state`},Tv={key:1,class:`debug__meta-list`},Ev={class:`debug__meta-row`},Dv={class:`debug__meta-muted`},Ov={class:`debug__meta-row`},kv={class:`debug__meta-row`},Av={class:`debug__meta-row`},jv={key:0,class:`debug__meta-row`},Mv={class:`debug__meta-row`},Nv={class:`debug__meta-row`},Pv={class:`debug__meta-row`},Fv={class:`debug__meta-row`},Iv={key:0,class:`debug__tag debug__tag--warn`,title:`本地已编辑,偏离导入镜像`},Lv={key:1,class:`debug__tag debug__tag--ok`},Rv={key:1,class:`debug__meta-row`},zv={key:0,class:`debug__tag debug__tag--ok`},Bv={key:1,class:`debug__tag debug__tag--err`},Vv={class:`debug__meta-muted`},Hv={key:2,class:`debug__meta-err`},Uv={class:`statepanel`,ref:`statePanel`},Wv={class:`statepanel__head`},Gv={class:`statepanel__tree`},Kv={class:`statusbar`},qv=[`title`],Jv=[`title`],Yv={class:`statusbar__icon`},Xv=[`title`],Zv={class:`statusbar__icon`},Qv=[`title`],$v={class:`statusbar__item statusbar__item--right`},ey={class:`statusbar__item statusbar__item--right`},ty={class:`errpanel`,ref:`errPanel`},ny={class:`errpanel__head`},ry={class:`errpanel__title`},iy={key:0,class:`svclog__meta`},ay={key:0},oy={key:1,class:`errpanel__tabs`},sy={class:`errpanel__tab-count`},cy={class:`errpanel__actions`},ly=[`disabled`],uy=[`disabled`,`title`],dy=[`title`],fy=[`disabled`],py={key:0,class:`empty-state`},my={class:`debug__empty`},hy={class:`empty-state__hint`},gy={key:1,class:`svclog`},_y=[`innerHTML`],vy={key:0,class:`empty-state`},yy={key:1,class:`debug__list debug__list--log`},by={class:`log__time`},xy={class:`log__content`},Sy={key:1,class:`log__empty`},Cy={key:0,class:`empty-state`},wy={key:1,class:`debug__list`},Ty={class:`err__time`},Ey={class:`debug__kind`},Dy={class:`err__msg`},Oy={key:0,class:`empty-state`},ky={key:1,class:`debug__list`},Ay={class:`err__time`},jy={class:`debug__kind`},My={class:`err__msg`},Ny=[`aria-label`],Py={class:`ni-head`},Fy={class:`ni-title`},Iy={class:`ni-cls`},Ly={class:`ni-body`},Ry={class:`ni-scroll`},zy={class:`ni-field-row`},By={class:`ni-field-row`},Vy={class:`ni-field-row`},Hy={key:0,class:`vars-type-pick`},Uy={class:`vars-type-pick__name`},Wy={class:`vars-type-pick`},Gy={class:`vars-type-pick__name`},Ky={class:`ni-field-row ni-field-row--top`},qy={key:0,ref:`dlgCode`,class:`vars-dlg__code`,spellcheck:`false`},Jy=[`placeholder`],Yy={class:`ni-field-row ni-field-row--top`},Xy={key:0,class:`vars-dlg__err`},Zy={class:`ni-foot`},Qy={class:`ni-foot-btns`};function $y(e,t,n,r,i,a){let o=I(`StructureTree`),s=I(`NodeInspector`),c=I(`EventEditor`),l=I(`StateDiffPanel`),u=I(`LogValue`),d=I(`Dropdown`),f=I(`NumberStepper`),p=I(`SetSegment`),m=I(`ConfirmDialog`);return z(),B(`aside`,Q_,[H(`div`,$_,[(z(!0),B(R,null,L(i.tabs,t=>(z(),B(`button`,{key:t.key,class:A([`debug__tab`,{"debug__tab--active":n.activeTab===t.key}]),onClick:n=>e.$emit(`update:activeTab`,t.key)},j(t.label),11,ev))),128))]),H(`div`,tv,[n.activeTab===`vars`?(z(),B(R,{key:0},[G(` 变量列表视图:管理 schema.dictionary.inputParams(变量属性的增 / 删 / 改) `),i.varsMode===`list`?(z(),B(`div`,nv,[G(` 空态占位:与卡片来源 / API 调用面板同款语言 `),a.inputParams.length?(z(),B(`ul`,iv,[(z(!0),B(R,null,L(a.inputParams,(e,n)=>(z(),B(`li`,{key:e.key||n,class:`vars__row`,onDblclick:e=>a.openVarDlg(n)},[H(`span`,ov,j(e.key),1),H(`span`,{class:A([`vars__type`,`vars__type--`+(e.type||`string`)])},j(e.type||`string`),3),a.hasMock(e)?(z(),B(`span`,sv,`m`)):G(`v-if`,!0),H(`span`,{class:`vars__name`,title:[e.name,e.desc].filter(Boolean).join(` · `)},j(e.name||e.desc||``),9,cv),G(` 操作区双击不冒泡到行:连点复制/删除/编辑钮时不误开编辑弹窗 `),H(`span`,{class:`vars__ops`,onDblclick:t[0]||=K(()=>{},[`stop`])},[G(` 复制变量名:复制当前变量 key(绑定以 $key 引用),无变量名时禁用 `),H(`button`,{class:`vars__op`,type:`button`,disabled:!e.key,title:i.copiedVar===n?`已复制 ✓`:e.key?`复制变量名`:`暂无变量名`,onClick:t=>a.copyVarName(e,n)},[i.copiedVar===n?(z(),B(`span`,uv,`✓`)):(z(),B(`svg`,dv,[...t[47]||=[H(`use`,{href:`#icon-copy-sm`},null,-1)]]))],8,lv),H(`button`,{class:`vars__op`,type:`button`,title:`编辑变量`,onClick:e=>a.openVarDlg(n)},[...t[48]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-gear`})],-1)]],8,fv),H(`button`,{class:`vars__op vars__op--del`,type:`button`,title:`删除变量`,onClick:e=>a.askDeleteVar(n)},[...t[49]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-trash`})],-1)]],8,pv)],32)],40,av))),128))])):(z(),B(`div`,rv,[...t[46]||=[os(`<span class="empty-state__badge" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-settings"></use></svg></span><p class="debug__empty">暂无变量</p><p class="empty-state__hint">变量与 schema.dictionary.inputParams 一一对应:绑定表达式以 $key 引用,mock 值供设计期预览</p>`,3)]])),G(` 右下角悬浮操作组:与 mock 视图悬浮条同语言,不占固定行高 `),H(`div`,mv,[H(`button`,{class:`debug__copy`,type:`button`,title:`新增变量(写入 dictionary.inputParams)`,onClick:t[1]||=e=>a.openVarDlg(null)},`+ 添加变量`),a.inputParams.length?(z(),B(`button`,{key:0,class:`debug__copy`,type:`button`,title:`以 Raw JSON 编辑全部变量的设计期 mock 数据`,onClick:t[2]||=e=>i.varsMode=`mock`},`配置变量 mock`)):G(`v-if`,!0)])])):(z(),B(R,{key:1},[G(` mock 二级视图:仅 Raw JSON(CodeJar + Prism 高亮);右下角操作按钮只在此出现 `),H(`div`,hv,[H(`div`,gv,[H(`button`,{class:`vars__back`,type:`button`,title:`返回变量列表`,onClick:t[3]||=(...e)=>a.leaveMock&&a.leaveMock(...e)},[...t[50]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`polyline`,{points:`15 18 9 12 15 6`})],-1),W(` 变量 `,-1)]]),t[51]||=H(`span`,{class:`vars__mocktitle`},`变量 mock · 设计期覆盖(dictionary.mocks · Raw JSON)`,-1),t[52]||=H(`span`,{class:`vars__mockhint`},`仅设计期生效 · 未列出的键回退默认值`,-1)]),H(`div`,_v,[G(` 报错提示条:与顶部提示条同语言(语义色软底 + 图标 + 关闭),钉在编辑器顶部不挤占编辑区 `),i.rawError?(z(),B(`div`,vv,[t[53]||=H(`svg`,{class:`raw-err-bar__icn`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-alert-triangle`})],-1),H(`span`,yv,j(i.rawError),1),H(`button`,{class:`raw-err-bar__close`,type:`button`,title:`关闭`,onClick:t[4]||=e=>i.rawError=``},`✕`)])):G(`v-if`,!0),H(`div`,bv,null,512)]),H(`div`,xv,[G(` 右下角悬浮组内的返回:与头部 chip 同一 leaveMock 语义,手不离编辑区即可退出二级视图 `),H(`button`,{class:`debug__copy`,type:`button`,title:`返回变量列表`,onClick:t[5]||=(...e)=>a.leaveMock&&a.leaveMock(...e)},[...t[54]||=[H(`svg`,{class:`debug__copy-icn`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`polyline`,{points:`15 18 9 12 15 6`})],-1),W(`返回 `,-1)]]),t[58]||=H(`span`,{class:`debug__sep`},null,-1),i.copied?(z(),B(`span`,Sv,`已复制 ✓`)):G(`v-if`,!0),H(`button`,{class:`debug__copy`,type:`button`,onClick:t[6]||=(...e)=>a.copyScope&&a.copyScope(...e)},[...t[55]||=[H(`svg`,{class:`debug__copy-icn`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-copy-sm`})],-1),W(`复制 `,-1)]]),t[59]||=H(`span`,{class:`debug__sep`},null,-1),H(`button`,{class:`debug__copy debug__copy--primary`,type:`button`,onClick:t[7]||=(...e)=>a.saveRaw&&a.saveRaw(...e)},[...t[56]||=[H(`svg`,{class:`debug__copy-icn`,viewBox:`0 0 16 16`,"aria-hidden":`true`},[H(`use`,{href:`#icon-check`})],-1),W(`应用 `,-1)]]),H(`button`,{class:`debug__copy debug__copy--warn`,type:`button`,onClick:t[8]||=t=>e.$emit(`reset-import`),title:`丢弃内存编辑,从磁盘重新载入(导入优先于编辑)`},[...t[57]||=[H(`svg`,{class:`debug__copy-icn`,viewBox:`0 0 16 16`,"aria-hidden":`true`},[H(`use`,{href:`#icon-reset`})],-1),W(`重置 `,-1)]])])])],2112))],64)):n.activeTab===`structure`?(z(),V(o,{key:1,preview:n.preview,schema:n.schema,"card-code":n.cardId,"selected-node-id":n.selectedNodeId,"move-collapse-token":n.moveCollapseToken,"can-paste":a.canPaste,onEditEvent:a.onEditEvent,onInspect:a.onInspect,onSelectNode:a.onSelectNode,onAddNode:a.onAddNode,onMoveNode:a.onMoveNode,onHoverNode:a.onHoverNode,onCopySelected:t[9]||=t=>e.$emit(`copy-selected`),onPaste:t[10]||=t=>e.$emit(`paste`),onDuplicate:t[11]||=t=>e.$emit(`duplicate`),onDeleteSelected:t[12]||=t=>e.$emit(`delete-selected`),onRenameCard:t[13]||=t=>e.$emit(`rename-card`)},null,8,[`preview`,`schema`,`card-code`,`selected-node-id`,`move-collapse-token`,`can-paste`,`onEditEvent`,`onInspect`,`onSelectNode`,`onAddNode`,`onMoveNode`,`onHoverNode`])):n.activeTab===`meta`?(z(),B(`div`,Cv,[G(` 空状态占位:与 API 调用面板同款(虚线徽章 + 线性图标 + 文案 + 弱提示) `),i.importMeta?(z(),B(`dl`,Tv,[H(`div`,Ev,[t[62]||=H(`dt`,null,`导入接口`,-1),H(`dd`,null,[H(`code`,null,j(i.importMeta.interface),1),t[61]||=W(),H(`span`,Dv,`(`+j(i.importMeta.source)+`)`,1)])]),H(`div`,Ov,[t[63]||=H(`dt`,null,`远端基址`,-1),H(`dd`,null,[H(`code`,null,j(i.importMeta.baseUrl),1)])]),H(`div`,kv,[t[64]||=H(`dt`,null,`cardId`,-1),H(`dd`,null,[H(`code`,null,j(i.importMeta.cardId),1)])]),H(`div`,Av,[t[65]||=H(`dt`,null,`cardCode`,-1),H(`dd`,null,[H(`code`,null,j(i.importMeta.cardCode),1)])]),i.importMeta.cardName?(z(),B(`div`,jv,[t[66]||=H(`dt`,null,`卡片标题`,-1),H(`dd`,null,j(i.importMeta.cardName),1)])):G(`v-if`,!0),H(`div`,Mv,[t[68]||=H(`dt`,null,`应用 / 空间`,-1),H(`dd`,null,[H(`code`,null,j(i.importMeta.appId),1),t[67]||=W(` / `,-1),H(`code`,null,j(i.importMeta.workspaceId),1)])]),H(`div`,Nv,[t[69]||=H(`dt`,null,`同步时间`,-1),H(`dd`,null,j(a.formatTime(i.importMeta.syncedAt)),1)]),H(`div`,Pv,[t[70]||=H(`dt`,null,`落库位置`,-1),H(`dd`,null,[H(`code`,null,`src/cards/`+j(i.importMeta.cardCode)+`/`,1)])]),H(`div`,Fv,[t[71]||=H(`dt`,null,`本地状态`,-1),H(`dd`,null,[i.importMeta.dirty?(z(),B(`span`,Iv,`已编辑(偏离导入镜像)`)):(z(),B(`span`,Lv,`与导入镜像一致`))])]),i.importMeta.lastExport?(z(),B(`div`,Rv,[t[72]||=H(`dt`,null,`最近导出`,-1),H(`dd`,null,[i.importMeta.lastExport.ok?(z(),B(`span`,zv,`读回校验通过 ✓`)):(z(),B(`span`,Bv,`读回校验未通过 ✗`)),H(`span`,Vv,`(`+j(a.formatTime(i.importMeta.lastExport.at))+`)`,1),i.importMeta.lastExport.readBackError?(z(),B(`span`,Hv,` · `+j(i.importMeta.lastExport.readBackError),1)):G(`v-if`,!0)])])):G(`v-if`,!0)])):(z(),B(`div`,wv,[...t[60]||=[os(`<span class="empty-state__badge" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-cloud"></use></svg></span><p class="debug__empty">暂无卡片来源</p><p class="empty-state__hint">该卡尚未经「同步远程」导入,无导入来源元数据;本地新建卡 / 未同步卡均如此</p>`,3)]])),t[73]||=H(`p`,{class:`debug__meta-hint`},`导入优先于编辑:在「变量」tab →「配置变量 mock」里点「重置」,可丢弃内存编辑、从磁盘重新载入最新导入。`,-1)])):G(`v-if`,!0)]),G(`
|
|
157
157
|
节点属性面板:组件结构 tab 双击节点弹出(可编辑写回)。
|
|
158
158
|
事件编辑已并入本面板的「事件」页签(meta 驱动),不再有独立弹层。
|
|
159
|
-
`),
|
|
159
|
+
`),U(ac,{name:`modal`},{default:Rr(()=>[i.inspectingComp?(z(),V(s,{key:i.inspectKey,comp:i.inspectingComp,"comp-names":a.compNames,rt:n.rt,onApply:a.onApply,onCommit:a.onCommit,onClose:t[14]||=e=>i.inspectingComp=null},null,8,[`comp`,`comp-names`,`rt`,`onApply`,`onCommit`])):G(`v-if`,!0)]),_:1}),G(`
|
|
160
160
|
事件编辑弹框:点击结构树「事件」徽标时单独弹出,与属性面板解耦。
|
|
161
161
|
只编辑 eventactions,不涉及属性/样式。
|
|
162
|
-
`),
|
|
162
|
+
`),U(ac,{name:`ee-drawer`},{default:Rr(()=>[i.editingEventComp?(z(),V(c,{key:`evt-`+i.eventEditorKey,comp:i.editingEventComp,"comp-names":a.compNames,rt:n.rt,onApply:a.onApply,onCommit:a.onCommit,onClose:t[15]||=e=>i.editingEventComp=null},null,8,[`comp`,`comp-names`,`rt`,`onApply`,`onCommit`])):G(`v-if`,!0)]),_:1}),G(`
|
|
163
163
|
运行态面板:默认收起;点击底部状态栏「运行态」指示器弹出。面板高度由头部
|
|
164
164
|
拖拽调整(startResize,无专门拖拽节点,与预览区宽度调节同一套 mousedown 机制),
|
|
165
165
|
并持久化到 localStorage。展示 rt.state 实时 JSON(运行期交互态,只读),不污染绑定数据、
|
|
166
166
|
不触发保存高亮、调试变更永不落盘。
|
|
167
|
-
`),
|
|
167
|
+
`),G(`
|
|
168
168
|
底部弹出面板(运行态 / 事件 / 变量绑定):Teleport 到 App 的 #app-workside-panels,
|
|
169
169
|
宽度贯穿中右两栏、紧贴右缘(与共同底栏同一容器机制,贴近 VSCode 底部面板)。
|
|
170
170
|
defer:目标与 Teleport 同属本应用组件树,挂载时目标尚未插入 document,须等整个
|
|
171
171
|
应用挂载完成后再解析(Vue 3.5+)。chrome-off 截图模式下禁用 Teleport,回落本面板内。
|
|
172
|
-
`),(
|
|
172
|
+
`),(z(),V(oi,{defer:``,to:`#app-workside-panels`,disabled:n.chromeOff},[F(H(`section`,Uv,[G(` 顶缘拖拽条:与竖向分隔条同规格(命中 6px / 高亮 5px),仅分割边缘触发 `),H(`div`,{class:A([`panelhead__edge`,{"is-dragging":i.panelDragging,"is-armed":i.edgeArmed}]),title:`拖拽调整面板高度`,onMouseenter:t[16]||=(...e)=>a.armEdge&&a.armEdge(...e),onMouseleave:t[17]||=(...e)=>a.disarmEdge&&a.disarmEdge(...e),onMousedown:t[18]||=K((...e)=>a.startResize&&a.startResize(...e),[`prevent`])},null,34),H(`div`,Wv,[t[75]||=H(`span`,{class:`statepanel__title`},[W(`运行态 `),H(`code`,null,`rt.state`)],-1),H(`button`,{class:`statepanel__close`,type:`button`,title:`收起`,onClick:t[19]||=e=>i.statePanelOpen=!1},[...t[74]||=[H(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[H(`line`,{x1:`5`,y1:`5`,x2:`19`,y2:`19`}),H(`line`,{x1:`19`,y1:`5`,x2:`5`,y2:`19`})],-1)]])]),H(`div`,Gv,[G(`
|
|
173
|
+
运行态 diff 双栏对比:左 = 当前 rt.state,右 = 基线 rt.rootScope(绑定数据),
|
|
174
|
+
git diff 式行对齐 + 增/改/删三态高亮(StateDiffPanel,行模型见 runtime/state-diff.js)。
|
|
175
|
+
`),U(l,{rt:n.rt,"card-id":n.cardId},null,8,[`rt`,`card-id`])])],512),[[Cc,i.statePanelOpen]])],8,[`disabled`])),G(`
|
|
173
176
|
底部状态栏:Teleport 到 App 的 #app-workside-bar,作为「调试面板 + 接口调用面板」
|
|
174
177
|
中右两栏共同的底栏(贴近 VSCode 布局)。defer:目标与 Teleport 同属本应用组件树,
|
|
175
178
|
挂载时目标尚未插入 document,须等整个应用挂载完成后再解析(Vue 3.5+)。
|
|
176
179
|
chrome-off 截图模式下禁用 Teleport,回落到本面板内渲染(随面板一起隐藏)。
|
|
177
180
|
左侧三枚指示器(运行态 / 变量绑定 / 事件)点击弹出或收起对应底部面板;右侧展示当前卡片与卡片总数。
|
|
178
|
-
`),(
|
|
181
|
+
`),(z(),V(oi,{defer:``,to:`#app-workside-bar`,disabled:n.chromeOff},[H(`section`,Kv,[H(`button`,{class:A([`statusbar__item statusbar__item--prob`,{"is-open":i.statePanelOpen}]),type:`button`,onClick:t[20]||=(...e)=>a.toggleStatePanel&&a.toggleStatePanel(...e),title:i.statePanelOpen?`收起运行态面板`:`展开运行态面板(可拖拽调整高度)`},[H(`span`,{class:A([`statusbar__icon`,{"is-dirty":a.stateDirty}])},`◉`,2),t[76]||=H(`span`,null,`运行态`,-1)],10,qv),H(`button`,{class:A([`statusbar__item statusbar__item--prob`,{"is-error":a.bindingErrors.length,"is-ok":!a.bindingErrors.length}]),type:`button`,onClick:t[21]||=e=>a.toggleErrorPanel(`binding`),title:a.bindingErrors.length?`查看绑定错误`:`无绑定错误`},[H(`span`,Yv,j(a.bindingErrors.length?`⚠`:`✓`),1),H(`span`,null,j(a.bindingErrors.length?a.bindingErrors.length+` 个绑定错误`:`无绑定错误`),1)],10,Jv),H(`button`,{class:A([`statusbar__item statusbar__item--prob`,a.eventStatusClass]),type:`button`,onClick:t[22]||=e=>a.toggleErrorPanel(`event`),title:a.eventStatusTitle},[H(`span`,Zv,j(a.eventCount?a.eventErrors.length?`⚠`:`☰`:`✓`),1),H(`span`,null,j(a.eventCount?a.eventCount+` 条事件记录`:`无事件记录`),1)],10,Xv),G(` 本地开发服务连接状态:连接图标 + 状态文案,颜色与右上角「连接」按钮实时同步(复用 devSvcClass / devSvcTitle / devSvcLabel)。
|
|
179
182
|
可点击:弹出 / 收起底部「服务日志」面板(实时镜像所连 cardbuddy 终端输出)。
|
|
180
|
-
仅重连 / 断开 / 未配置等_warn、danger 态着语义色,连接成功用状态栏默认色;不设选中态,仅 hover 提示可点。 `),
|
|
183
|
+
仅重连 / 断开 / 未配置等_warn、danger 态着语义色,连接成功用状态栏默认色;不设选中态,仅 hover 提示可点。 `),H(`button`,{class:A([`statusbar__item statusbar__conn`,n.devSvcClass]),type:`button`,title:n.devSvcTitle+`(点击查看服务日志)`,onClick:t[23]||=e=>a.toggleErrorPanel(`svclog`)},[t[77]||=H(`svg`,{class:`statusbar__conn-icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-link`})],-1),H(`span`,null,j(n.devSvcLabel),1)],10,Qv),t[78]||=H(`span`,{class:`statusbar__spacer`},null,-1),H(`span`,$v,j(n.cardId),1),H(`span`,ey,j(n.cardCount)+` 张卡片`,1)])],8,[`disabled`])),(z(),V(oi,{defer:``,to:`#app-workside-panels`,disabled:n.chromeOff},[F(H(`section`,ty,[G(` 顶缘拖拽条:与竖向分隔条同规格(命中 6px / 高亮 5px),仅分割边缘触发 `),H(`div`,{class:A([`panelhead__edge`,{"is-dragging":i.panelDragging,"is-armed":i.edgeArmed}]),title:`拖拽调整面板高度`,onMouseenter:t[24]||=(...e)=>a.armEdge&&a.armEdge(...e),onMouseleave:t[25]||=(...e)=>a.disarmEdge&&a.disarmEdge(...e),onMousedown:t[26]||=K((...e)=>a.startResize&&a.startResize(...e),[`prevent`])},null,34),H(`div`,ny,[H(`span`,ry,j(i.errorPanel===`svclog`?`服务日志`:i.errorPanel===`event`?`事件记录`:`绑定错误记录`),1),G(` 服务日志:标题后给一枚读数(行数 + 实时态),与事件面板 tab 同一位置语言 `),i.errorPanel===`svclog`?(z(),B(`span`,iy,[W(j(i.svcLogs.length)+` 行`,1),i.svcLogDropped?(z(),B(`span`,ay,` · 已滚动淘汰 `+j(i.svcLogDropped),1)):G(`v-if`,!0),H(`i`,{class:A([`svclog__dot`,i.svcLogLive?`is-live`:`is-off`])},null,2),W(j(i.svcLogLive?`实时`:`未连接`),1)])):G(`v-if`,!0),G(` 事件面板:日志 / 错误 tab 并入头部单行(一次只看一类);变量绑定面板无 tab `),i.errorPanel===`event`?(z(),B(`div`,oy,[H(`button`,{type:`button`,class:A([`errpanel__tab`,{"errpanel__tab--active":i.eventTab===`log`}]),onClick:t[27]||=e=>i.eventTab=`log`},[t[79]||=W(` 日志`,-1),H(`span`,sy,j(a.logs.length),1)],2),H(`button`,{type:`button`,class:A([`errpanel__tab`,{"errpanel__tab--active":i.eventTab===`err`}]),onClick:t[28]||=e=>i.eventTab=`err`},[t[80]||=W(` 错误`,-1),H(`span`,{class:A([`errpanel__tab-count`,{"is-hit":a.eventErrors.length}])},j(a.eventErrors.length),3)],2)])):G(`v-if`,!0),H(`span`,cy,[i.errorPanel===`event`&&i.eventTab===`log`?(z(),B(`button`,{key:0,class:`errpanel__iconbtn errpanel__clear`,type:`button`,disabled:!a.logs.length,title:`清空日志(不影响错误)`,onClick:t[29]||=(...e)=>a.clearEventLogs&&a.clearEventLogs(...e)},[G(` 垃圾桶图标:清空日志 `),t[81]||=H(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[H(`use`,{href:`#icon-trash`})],-1)],8,ly)):G(`v-if`,!0),i.errorPanel===`svclog`?(z(),B(`button`,{key:1,class:A([`errpanel__iconbtn`,{"is-done":i.svcCopied}]),type:`button`,disabled:!i.svcLogs.length,title:i.svcCopied?`已复制`:`复制全部日志(纯文本,去 ANSI)`,onClick:t[30]||=(...e)=>a.copySvcLogs&&a.copySvcLogs(...e)},[...t[82]||=[H(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[H(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`}),H(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})],-1)]],10,uy)):G(`v-if`,!0),i.errorPanel===`svclog`?(z(),B(`button`,{key:2,class:A([`errpanel__iconbtn svclog__follow`,{"is-on":i.svcLogFollow}]),type:`button`,title:i.svcLogFollow?`跟随最新输出(点击暂停)`:`已暂停跟随(点击回到最新)`,onClick:t[31]||=(...e)=>a.toggleSvcFollow&&a.toggleSvcFollow(...e)},[G(` 下箭头图标:跟随最新输出 `),t[83]||=H(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[H(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),H(`polyline`,{points:`19 12 12 19 5 12`})],-1)],10,dy)):G(`v-if`,!0),i.errorPanel===`svclog`?(z(),B(`button`,{key:3,class:`errpanel__iconbtn errpanel__clear`,type:`button`,disabled:!i.svcLogs.length,title:`清空面板(不影响服务端缓冲)`,onClick:t[32]||=(...e)=>a.clearSvcLogs&&a.clearSvcLogs(...e)},[...t[84]||=[H(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[H(`use`,{href:`#icon-trash`})],-1)]],8,fy)):G(`v-if`,!0),H(`button`,{class:`errpanel__iconbtn errpanel__close`,type:`button`,title:`关闭`,onClick:t[33]||=e=>i.errorPanel=``},[...t[85]||=[H(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[H(`line`,{x1:`5`,y1:`5`,x2:`19`,y2:`19`}),H(`line`,{x1:`19`,y1:`5`,x2:`5`,y2:`19`})],-1)]])])]),H(`div`,{class:A([`errpanel__body`,{"errpanel__body--term":i.errorPanel===`svclog`&&i.svcLogs.length}]),ref:`errBody`,onScrollPassive:t[34]||=(...e)=>a.onErrBodyScroll&&a.onErrBodyScroll(...e)},[G(` 服务日志面板:本地服务(cardbuddy)终端输出的实时镜像。
|
|
181
184
|
服务端按行镜像 stdout/stderr 并保留原始 ANSI,这里经 card-editor/ansi.js 还原配色,
|
|
182
|
-
因此面板固定深色终端底(chalk 调色板取自深色令牌,浅底不可读)。 `),i.errorPanel===`svclog`?(
|
|
185
|
+
因此面板固定深色终端底(chalk 调色板取自深色令牌,浅底不可读)。 `),i.errorPanel===`svclog`?(z(),B(R,{key:0},[i.svcLogs.length?(z(),B(`div`,gy,[(z(!0),B(R,null,L(i.svcLogs,e=>(z(),B(`div`,{key:e.seq||e.t,class:A([`svclog__line`,`svclog__line--`+e.level])},[H(`span`,{class:`svclog__text`,innerHTML:e.html},null,8,_y)],2))),128))])):(z(),B(`div`,py,[t[86]||=H(`span`,{class:`empty-state__badge`,"aria-hidden":`true`},[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[H(`polyline`,{points:`4 17 10 11 4 5`}),H(`line`,{x1:`12`,y1:`19`,x2:`20`,y2:`19`})])],-1),H(`p`,my,j(a.svcEmptyText),1),H(`p`,hy,j(a.svcEmptyHint),1)]))],64)):i.errorPanel===`event`?(z(),B(R,{key:1},[G(` 事件面板:按当前 tab 只渲染日志或错误一类 `),i.eventTab===`log`?(z(),B(R,{key:0},[G(` 空状态占位:与 API 调用面板同款(虚线徽章 + 线性图标 + 文案 + 弱提示) `),a.logs.length?(z(),B(`ul`,yy,[(z(!0),B(R,null,L(a.logs,(e,t)=>(z(),B(`li`,{key:`l`+t,class:A([`log__item`,`log--`+e.level])},[H(`span`,by,j(a.fmtTime(e.t)),1),H(`span`,{class:A([`log__tag`,`log__tag--`+e.level])},j(e.level),3),H(`div`,xy,[e.args&&e.args.length?(z(!0),B(R,{key:0},L(e.args,(e,t)=>(z(),V(u,{key:t,value:e},null,8,[`value`]))),128)):(z(),B(`span`,Sy,`—`))])],2))),128))])):(z(),B(`div`,vy,[...t[87]||=[H(`span`,{class:`empty-state__badge`,"aria-hidden":`true`},[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[H(`line`,{x1:`21`,y1:`6`,x2:`3`,y2:`6`}),H(`line`,{x1:`21`,y1:`12`,x2:`3`,y2:`12`}),H(`line`,{x1:`21`,y1:`18`,x2:`3`,y2:`18`})])],-1),H(`p`,{class:`debug__empty`},`暂无日志`,-1),H(`p`,{class:`empty-state__hint`},`卡片事件内 console.* 主动打印的日志会实时显示在这里`,-1)]]))],64)):(z(),B(R,{key:1},[a.eventErrors.length?(z(),B(`ul`,wy,[(z(!0),B(R,null,L(a.eventErrors,(e,t)=>(z(),B(`li`,{key:`e`+t,class:`debug__item debug__item--err`},[H(`span`,Ty,j(a.fmtTime(e.t)),1),H(`span`,Ey,j(e.kind),1),H(`span`,Dy,j(e.msg),1)]))),128))])):(z(),B(`div`,Cy,[...t[88]||=[H(`span`,{class:`empty-state__badge`,"aria-hidden":`true`},[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[H(`path`,{d:`M22 11.08V12a10 10 0 1 1-5.93-9.14`}),H(`polyline`,{points:`22 4 12 14.01 9 11.01`})])],-1),H(`p`,{class:`debug__empty`},`无事件错误`,-1),H(`p`,{class:`empty-state__hint`},`事件动作(customAction / 监听器)执行报错时会记录在这里`,-1)]]))],64))],64)):(z(),B(R,{key:2},[G(` 变量绑定面板:仅错误列表 `),a.panelErrors.length?(z(),B(`ul`,ky,[(z(!0),B(R,null,L(a.panelErrors,(e,t)=>(z(),B(`li`,{key:t,class:`debug__item debug__item--err`},[H(`span`,Ay,j(a.fmtTime(e.t)),1),H(`span`,jy,j(e.kind),1),H(`span`,My,j(e.msg),1)]))),128))])):(z(),B(`div`,Oy,[...t[89]||=[H(`span`,{class:`empty-state__badge`,"aria-hidden":`true`},[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[H(`path`,{d:`M22 11.08V12a10 10 0 1 1-5.93-9.14`}),H(`polyline`,{points:`22 4 12 14.01 9 11.01`})])],-1),H(`p`,{class:`debug__empty`},`无绑定错误`,-1),H(`p`,{class:`empty-state__hint`},`绑定 / 表达式(bind、vshow、render、refresh)求值失败时会记录在这里`,-1)]]))],64))],34)],512),[[Cc,i.errorPanel]])],8,[`disabled`])),G(` 变量添加 / 编辑弹窗:与节点属性面板同构(ni-overlay / ni-panel / ni-head / ni-foot),
|
|
183
186
|
宽度 · 字号 · 控件高度 · 发丝线分隔全部沿用 node-inspector 的视觉语言;
|
|
184
187
|
默认值按类型分控件:数组 / 对象走 CodeJar 代码编辑区(高亮 + 缩进 + 大段粘贴,确定时自动格式化)、
|
|
185
|
-
字符串走多行文本域、数字走带 −/+ 的 NumberStepper、布尔走 SetSegment 分段单选。 `),
|
|
186
|
-
.vars__type / .vars__type--<type>(同一套 --type-* 语义色),两处视觉完全一致 `),
|
|
188
|
+
字符串走多行文本域、数字走带 −/+ 的 NumberStepper、布尔走 SetSegment 分段单选。 `),U(ac,{name:`modal`},{default:Rr(()=>[i.varDlg?(z(),B(`div`,{key:0,class:`ni-overlay`,onClick:t[44]||=K(e=>i.varDlg=null,[`self`])},[H(`div`,{class:`ni-panel modal-card vars-dlg`,role:`alertdialog`,"aria-modal":`true`,"aria-label":i.varDlg.index==null?`添加变量`:`编辑变量`},[H(`div`,Py,[H(`span`,Fy,[W(j(i.varDlg.index==null?`添加变量`:`编辑变量`),1),H(`em`,Iy,j(i.varDlg.form.key||`未命名`),1)]),H(`button`,{class:`ni-close`,type:`button`,title:`关闭`,onClick:t[35]||=e=>i.varDlg=null})]),H(`div`,Ly,[H(`div`,Ry,[H(`div`,zy,[t[90]||=H(`label`,{class:`ni-field-label`},[H(`i`,null,`*`),W(`变量名`)],-1),F(H(`input`,{class:`ni-input`,type:`text`,"onUpdate:modelValue":t[36]||=e=>i.varDlg.form.key=e,placeholder:`英文标识,绑定以 $key 引用`},null,512),[[al,i.varDlg.form.key]])]),H(`div`,By,[t[91]||=H(`label`,{class:`ni-field-label`},[H(`i`,null,`*`),W(`中文名`)],-1),F(H(`input`,{class:`ni-input`,type:`text`,"onUpdate:modelValue":t[37]||=e=>i.varDlg.form.name=e,placeholder:`中文名`},null,512),[[al,i.varDlg.form.name]])]),H(`div`,Vy,[t[92]||=H(`label`,{class:`ni-field-label`},[H(`i`,null,`*`),W(`类型`)],-1),G(` 类型下拉:触发器与选项都走「中文名 + 彩色类型标签」,标签直接复用变量列表的
|
|
189
|
+
.vars__type / .vars__type--<type>(同一套 --type-* 语义色),两处视觉完全一致 `),U(d,{class:`vars-dlg__ctrl`,block:``,size:`sm`,value:i.varDlg.form.type,options:i.varTypeOptions,onChange:a.onVarTypeChange},{current:Rr(({opt:e,text:t})=>[e?(z(),B(`span`,Hy,[H(`span`,Uy,j(e.value),1),H(`span`,{class:A([`vars__type`,`vars__type--`+e.key])},j(e.key),3)])):(z(),B(R,{key:1},[W(j(t),1)],64))]),option:Rr(({opt:e})=>[H(`span`,Wy,[H(`span`,Gy,j(e.value),1),H(`span`,{class:A([`vars__type`,`vars__type--`+e.key])},j(e.key),3)])]),_:1},8,[`value`,`options`,`onChange`])]),G(` 默认值按类型分四种控件:数组 / 对象 = CodeJar 代码编辑区、字符串 = 多行文本域、
|
|
187
190
|
数字 = 带 −/+ 的 NumberStepper、布尔 = 复用 SetSegment 的 true / false 分段单选。四者统一以文本承载
|
|
188
|
-
(varDlg.form.defaultValue),确定时仍由 parseDefault 按类型解析。 `),U(`div`,gy,[t[93]||=U(`label`,{class:`ni-field-label`},`默认值`,-1),a.isComplexType(i.varDlg.form.type)?(B(),V(`div`,_y,null,512)):i.varDlg.form.type===`string`?I((B(),V(`textarea`,{key:1,class:`ni-input vars-dlg__str`,"onUpdate:modelValue":t[38]||=e=>i.varDlg.form.defaultValue=e,placeholder:a.scalarPlaceholder(`string`)},null,8,vy)),[[il,i.varDlg.form.defaultValue]]):i.varDlg.form.type===`number`?(B(),H(f,{key:2,class:`vars-dlg__ctrl`,value:i.varDlg.form.defaultValue,placeholder:a.scalarPlaceholder(`number`),onInput:t[39]||=e=>i.varDlg.form.defaultValue=e},null,8,[`value`,`placeholder`])):(B(),H(p,{key:3,class:`vars-dlg__ctrl`,value:i.varDlg.form.defaultValue,options:{iParamList:i.varBoolOptions},onInput:t[40]||=e=>i.varDlg.form.defaultValue=e},null,8,[`value`,`options`]))]),U(`div`,yy,[t[94]||=U(`label`,{class:`ni-field-label`},`描述`,-1),I(U(`textarea`,{class:`ni-input vars-dlg__desc`,"onUpdate:modelValue":t[41]||=e=>i.varDlg.form.desc=e,placeholder:`可选`},null,512),[[il,i.varDlg.form.desc]])]),i.varDlgError?(B(),V(`p`,by,M(i.varDlgError),1)):K(`v-if`,!0)])]),U(`div`,xy,[t[95]||=U(`span`,{class:`ni-tip`},`默认值入 defaultValue;设计期覆盖见「配置变量 mock」`,-1),U(`div`,Sy,[U(`button`,{class:`ni-btn ni-btn--ghost`,type:`button`,onClick:t[42]||=e=>i.varDlg=null},`取消`),U(`button`,{class:`ni-btn`,type:`button`,onClick:t[43]||=(...e)=>a.confirmVarDlg&&a.confirmVarDlg(...e)},`确定`)])])],8,ry)])):K(`v-if`,!0)]),_:1}),W(m,{visible:i.delVarTarget!=null,title:`删除变量`,message:a.delVarMessage,severity:a.delVarSeverity,"confirm-text":a.delVarConfirmText,onConfirm:a.confirmDeleteVar,onCancel:t[45]||=e=>i.delVarTarget=null},null,8,[`visible`,`message`,`severity`,`confirm-text`,`onConfirm`])])}var wy=X(x_,[[`render`,Cy],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/DebugPanel.vue`]]),Ty={name:`ApiCallPanel`,components:{ApiPayloadTree:sg},props:{rt:{type:Object,required:!0}},emits:[`close`],data(){return{copiedIndex:null,apiCopyTimer:null}},computed:{apiCalls(){return this.rt.apiRev,this.rt.apiCalls.slice()}},methods:{clearApiLog(){this.rt.clearApiCalls()},async copyApiPayload(e,t){let n=``;try{n=JSON.stringify(e.payload,null,2)}catch{n=String(e.payload)}await op(n)&&(this.copiedIndex=t,this.apiCopyTimer&&clearTimeout(this.apiCopyTimer),this.apiCopyTimer=setTimeout(()=>{this.copiedIndex===t&&(this.copiedIndex=null)},1500))}}},Ey={class:`apipanel`},Dy={class:`apipanel__head`},Oy={class:`apipanel__title`},ky={key:0,class:`debug__count`},Ay=[`disabled`],jy={class:`apipanel__body`},My={key:0,class:`empty-state`},Ny={class:`debug__list`},Py={class:`debug__api-row`},Fy={class:`debug__kind`},Iy=[`title`,`onClick`],Ly={key:0,width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Ry={key:1,class:`debug__copy-ok`};function zy(e,t,n,r,i,a){let o=L(`ApiPayloadTree`);return B(),V(`aside`,Ey,[U(`div`,Dy,[U(`span`,Oy,[t[2]||=G(` API调用 `,-1),a.apiCalls.length?(B(),V(`span`,ky,M(a.apiCalls.length),1)):K(`v-if`,!0)]),t[5]||=U(`span`,{class:`apipanel__spacer`},null,-1),U(`button`,{class:`apipanel__btn`,type:`button`,disabled:!a.apiCalls.length,title:`清空日志`,onClick:t[0]||=(...e)=>a.clearApiLog&&a.clearApiLog(...e)},[...t[3]||=[U(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[U(`use`,{href:`#icon-trash`})],-1)]],8,Ay),U(`button`,{class:`apipanel__btn`,type:`button`,title:`收起接口调用面板`,onClick:t[1]||=t=>e.$emit(`close`)},[...t[4]||=[U(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[U(`line`,{x1:`5`,y1:`5`,x2:`19`,y2:`19`}),U(`line`,{x1:`19`,y1:`5`,x2:`5`,y2:`19`})],-1)]])]),U(`div`,jy,[K(` 空状态占位:虚线圆形徽章 + 插头图标(与全局 24 网格线性图标同语言)+ 文案 + 弱提示 `),a.apiCalls.length?K(`v-if`,!0):(B(),V(`div`,My,[...t[6]||=[as(`<span class="empty-state__badge" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 7V3"></path><path d="M15 7V3"></path><path d="M6 7h12v4a6 6 0 0 1-12 0V7z"></path><path d="M12 17v4"></path></svg></span><p class="debug__empty">暂无API调用</p><p class="empty-state__hint">卡片事件触发 ynet.callJSAPI / postMessage 后,调用流水会实时显示在这里</p>`,3)]])),U(`ul`,Ny,[(B(!0),V(z,null,R(a.apiCalls,(e,n)=>(B(),V(`li`,{key:n,class:`debug__item debug__item--api`},[U(`div`,Py,[U(`span`,Fy,M(e.api),1),U(`button`,{class:`debug__copy-ic`,type:`button`,title:i.copiedIndex===n?`已复制 ✓`:`复制数据(不含方法名)`,onClick:t=>a.copyApiPayload(e,n)},[i.copiedIndex===n?(B(),V(`span`,Ry,`✓`)):(B(),V(`svg`,Ly,[...t[7]||=[U(`use`,{href:`#icon-copy-sm`},null,-1)]]))],8,Iy)]),K(` 返回数据:结构化折叠树(Chrome 控制台风格) `),W(o,{value:e.payload},null,8,[`value`])]))),128))])])])}var By=X(Ty,[[`render`,zy],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ApiCallPanel.vue`]]),Vy={name:`CardSelect`,emits:[`input`,`change`],props:{value:{type:String,default:``},options:{type:Array,default:()=>[]}},data(){return{open:!1,query:``,highlighted:0,sortByTime:this.loadSortByTime()}},created(){this.saveSortByTime()},computed:{current(){return this.options.find(e=>e.id===this.value)||{id:this.value,name:this.value}},filtered(){let e=this.query.trim().toLowerCase(),t=this.options;return e&&(t=this.options.filter(t=>t.id.toLowerCase().includes(e)||String(t.name||``).toLowerCase().includes(e))),this.sortByTime?t.slice().sort((e,t)=>(t.mtime||0)-(e.mtime||0)):t.slice().sort((e,t)=>String(e.name||``).localeCompare(String(t.name||``)))}},watch:{open(e){e?(this.query=``,this.highlighted=Math.max(0,this.filtered.findIndex(e=>e.id===this.value)),this.$nextTick(()=>{this.$refs.search&&this.$refs.search.focus(),this.scrollToActive()}),document.addEventListener(`click`,this.onDocClick,!0)):document.removeEventListener(`click`,this.onDocClick,!0)},sortByTime(e){this.saveSortByTime()}},beforeUnmount(){document.removeEventListener(`click`,this.onDocClick,!0)},methods:{toggle(){this.open=!this.open},toggleSort(){this.sortByTime=!this.sortByTime,this.highlighted=Math.max(0,this.filtered.findIndex(e=>e.id===this.value))},loadSortByTime(){try{return localStorage.getItem(`cardbuddy:cardselect-sort-by-time`)===`1`}catch{return!1}},saveSortByTime(){try{localStorage.setItem(`cardbuddy:cardselect-sort-by-time`,this.sortByTime?`1`:`0`)}catch{}},close(){this.open=!1},onDocClick(e){this.$refs.root&&!this.$refs.root.contains(e.target)&&this.close()},move(e){if(!this.filtered.length)return;let t=this.filtered.length;this.highlighted=(this.highlighted+e+t)%t,this.$nextTick(this.scrollToActive)},scrollToActive(){let e=this.$refs.list;if(!e)return;let t=e.children[this.highlighted];t&&t.scrollIntoView&&t.scrollIntoView({block:`nearest`})},choose(e){e&&(this.close(),e.id!==this.value&&(this.$emit(`input`,e.id),this.$emit(`change`,e.id)))}}},Hy={class:`csel__current`},Uy={class:`csel__id`},Wy={class:`csel__name`},Gy={key:0,class:`csel__pop`},Ky={class:`csel__search`},qy={ref:`list`,class:`csel__list`},Jy=[`onMousemove`,`onClick`],Yy=[`title`],Xy={class:`csel__item-id`},Zy={class:`csel__item-name`},Qy={key:0,class:`csel__check`,viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`},$y={key:0,class:`csel__empty`},eb={class:`csel__foot`},tb=[`title`,`aria-pressed`],nb={class:`csel__count`};function rb(e,t,n,r,i,a){return B(),V(`div`,{ref:`root`,class:j([`csel`,{"csel--open":i.open}])},[U(`button`,{type:`button`,class:j([`csel__trigger`,{"csel__trigger--active":i.open}]),onClick:t[0]||=(...e)=>a.toggle&&a.toggle(...e)},[U(`span`,Hy,[U(`span`,Uy,M(a.current.id),1),U(`span`,Wy,M(a.current.name),1)]),t[7]||=U(`svg`,{class:`csel__chev`,viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`},[U(`use`,{href:`#icon-chevron`})],-1)],2),W(ic,{name:`csel-fade`},{default:Lr(()=>[i.open?(B(),V(`div`,Gy,[U(`div`,Ky,[t[8]||=U(`svg`,{class:`csel__search-icon`,viewBox:`0 0 16 16`,width:`13`,height:`13`,"aria-hidden":`true`},[U(`use`,{href:`#icon-search`})],-1),I(U(`input`,{ref:`search`,"onUpdate:modelValue":t[1]||=e=>i.query=e,class:`csel__input`,type:`text`,placeholder:`搜索卡片 ID / 名称…`,onKeydown:[t[2]||=vl(q(e=>a.move(1),[`prevent`]),[`down`]),t[3]||=vl(q(e=>a.move(-1),[`prevent`]),[`up`]),t[4]||=vl(q(e=>a.choose(a.filtered[i.highlighted]),[`prevent`]),[`enter`]),t[5]||=vl(q((...e)=>a.close&&a.close(...e),[`prevent`]),[`esc`])]},null,544),[[il,i.query]])]),U(`ul`,qy,[(B(!0),V(z,null,R(a.filtered,(e,r)=>(B(),V(`li`,{key:e.id,class:j([`csel__item`,{"csel__item--active":r===i.highlighted,"csel__item--selected":e.id===n.value}]),onMousemove:e=>i.highlighted=r,onClick:t=>a.choose(e)},[U(`span`,{class:j([`csel__dot`,{"csel__dot--imported":e.imported}]),title:e.imported?`导入卡片(含 .import-meta.json 来源信息)`:`本地卡片(无导入来源信息)`,"aria-hidden":`true`},null,10,Yy),U(`span`,Xy,M(e.id),1),U(`span`,Zy,M(e.name),1),e.id===n.value?(B(),V(`svg`,Qy,[...t[9]||=[U(`use`,{href:`#icon-check`},null,-1)]])):K(`v-if`,!0)],42,Jy))),128)),a.filtered.length?K(`v-if`,!0):(B(),V(`li`,$y,`无匹配卡片`))],512),U(`div`,eb,[U(`button`,{class:j([`csel__sort`,{"csel__sort--active":i.sortByTime}]),type:`button`,title:i.sortByTime?`已按修改时间排序(新→旧),点击取消`:`按修改时间排序(新→旧)`,"aria-pressed":i.sortByTime,onClick:t[6]||=(...e)=>a.toggleSort&&a.toggleSort(...e)},`按修改时间排序`,10,tb),U(`span`,nb,M(a.filtered.length)+` / `+M(n.options.length)+` 张卡片`,1)])])):K(`v-if`,!0)]),_:1})],2)}var ib=X(Vy,[[`render`,rb],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/CardSelect.vue`]]),ab=X({name:`AlertCardInstance`,components:{RenderTree:ap},props:{entry:{type:Object,required:!0},mainRt:{type:Object,default:null}},data(){let e=new eu,t=au(this.entry.scope,e),n=this.mainRt;if(n&&n.pushError&&n.pushApiCall){let e=t.pushError.bind(t);t.pushError=(t,r)=>{e(t,r),n.pushError(t,r)};let r=t.pushApiCall.bind(t);t.pushApiCall=(e,t)=>{r(e,t),n.pushApiCall(e,t)}}return{adapter:e,cardRuntime:t}},provide(){return{adapter:this.adapter,cardRuntime:this.cardRuntime,customComponents:{}}},render(){return Vs(ap,{node:this.entry.preview.view,scope:this.cardRuntime.rootScope,key:this.entry.id})}},[[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/AlertCardInstance.vue`]]),ob=nn({stack:[]}),sb=0;async function cb(e,t){let n=e||{},r=n.cardCode,i=null;try{let e=await J(`/__card/${encodeURIComponent(r)}`);if(e.ok){let t=await e.json();t&&t.schema&&(i=t)}}catch{}if(!i||!i.schema){typeof t==`function`&&t({success:!1,error:`card_not_found`,errorMessage:`未找到卡片 `+r});return}let a=ob.stack;a.length&&a.splice(0,a.length).forEach(e=>{if(typeof e.callback==`function`)try{e.callback({success:!0,data:{event:`hidden`}})}catch{}});let o=i.data&&typeof i.data==`object`?i.data:{},s=nn(Object.assign({},o,n.data||{})),c=Pu(i.schema),l=`alert-`+ ++sb;a.push({id:l,cardCode:r,preview:c,scope:s,gravity:n.gravity||`bottom`,width:typeof n.width==`number`?n.width:void 0,height:typeof n.height==`number`?n.height:void 0,offsetX:typeof n.offsetX==`number`?n.offsetX:0,offsetY:typeof n.offsetY==`number`?n.offsetY:0,clickOutsideCanHide:n.clickOutsideCanHide!==!1,callback:t})}function lb(e,t){let n=e||{},r=ob.stack,i=null;if(typeof n.index==`number`){let e=Math.abs(n.index);r.length>=e&&(i=r[r.length-e])}else if(n.cardCode){for(let e=r.length-1;e>=0;e--)if(r[e].cardCode===n.cardCode){i=r[e];break}}else i=r[r.length-1];if(!i){typeof t==`function`&&t({success:!1,error:`no_alert`,errorMessage:`没有可关闭的弹窗`});return}let a=r.indexOf(i);r.splice(a,1),typeof i.callback==`function`&&(n.data?i.callback({success:!0,data:Object.assign({event:`hidden`},n.data)}):i.callback({success:!0,data:{}})),typeof t==`function`&&t({success:!0})}function ub(){let e=ob.stack;e.length&&e.splice(0,e.length)}var db={name:`AlertCardLayer`,components:{AlertCardInstance:ab},props:{mainRt:{type:Object,default:null}},computed:{top(){let e=ob.stack;return e.length?e[e.length-1]:null}},methods:{onMaskClick(e){e.clickOutsideCanHide&&lb({cardCode:e.cardCode})},panelStyle(e){let t={};e.width&&(t.width=e.width+`px`),e.height&&(t.height=e.height+`px`);let n=[];return e.offsetX&&n.push(`translateX(`+e.offsetX+`px)`),e.offsetY&&n.push(`translateY(`+e.offsetY+`px)`),n.length&&(t.transform=n.join(` `)),t}}},fb={key:0,class:`alert-layer`};function pb(e,t,n,r,i,a){let o=L(`AlertCardInstance`);return a.top?(B(),V(`div`,fb,[U(`div`,{class:j([`alert-mask`,`alert-mask--`+a.top.gravity]),onClick:t[0]||=q(e=>a.onMaskClick(a.top),[`self`])},[U(`div`,{class:`alert-panel`,style:A(a.panelStyle(a.top))},[W(o,{entry:a.top,"main-rt":n.mainRt},null,8,[`entry`,`main-rt`])],4)],2)])):K(`v-if`,!0)}var mb=X(db,[[`render`,pb],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/AlertCardLayer.vue`]]),hb=nn({dialog:null,toast:null,picker:null,datePicker:null}),gb=[],_b=0,vb=null,yb=[],bb=0,xb=[],Sb=0,Cb=2200;function wb(e,t){if(typeof e==`function`)try{e(t)}catch{}}function Tb(){hb.dialog=gb.length?gb.shift():null}function Eb(e,t){let n=e||{};gb.push({id:++_b,title:n.title||``,message:n.message==null?``:String(n.message),okButton:n.okButton||`确定`,cancelButton:n.cancelButton||``,clickBgToHide:n.clickBgToHide===!0,cancelGrayStyle:n.cancelGrayStyle===!0,callback:t}),hb.dialog||Tb()}function Db(e){let t=hb.dialog;t&&(hb.dialog=null,wb(t.callback,{success:!0,data:{ok:!!e.ok,dismissByClickBg:!!e.dismissByClickBg}}),Tb())}function Ob(e,t){let n=e||{},r=n.showIcon==null?``:String(n.showIcon),i=r===`1`?`ok`:r===`0`?`err`:``;vb&&=(clearTimeout(vb),null),hb.toast={message:n.message==null?``:String(n.message),icon:i},vb=setTimeout(()=>{hb.toast=null,vb=null},Cb),wb(t,{success:!0,data:{}})}function kb(e,t){let n=e||{},r=Array.isArray(n.currentValue)?n.currentValue:[];r.length&&Array.isArray(r[0])&&(r=r[0]),yb.push({id:++bb,title:n.title||``,mode:n.mode===`multi`?`multi`:`single`,dataSource:Array.isArray(n.dataSource)?n.dataSource:[],currentValue:r.map(e=>String(e)),callback:t}),hb.picker||Ab()}function Ab(){hb.picker=yb.length?yb.shift():null}function jb(e,t){let n=hb.picker;if(n){if(hb.picker=null,e){let e={success:!0,error:`0`,data:{result:t},result:t};wb(n.callback,e)}else wb(n.callback,{success:!0,data:{}});Ab()}}function Mb(e,t){let n=e||{},r=[`year_month_day`,`year_month`,`month_day`].includes(n.type)?n.type:`year_month_day`;xb.push({id:++Sb,title:n.title||``,type:r,startDate:n.startDate||`1970-1-1`,endDate:n.endDate||`2100-12-31`,selectDate:n.selectDate||``,callback:t}),hb.datePicker||Nb()}function Nb(){hb.datePicker=xb.length?xb.shift():null}function Pb(e,t){let n=hb.datePicker;if(n){if(hb.datePicker=null,e){let e={success:!0,error:`0`,currentDate:t.value,data:{year:t.year,month:t.month,day:t.day,value:t.value}};wb(n.callback,e)}else wb(n.callback,{success:!0,data:{}});Nb()}}var Fb={alertCard:(e,t)=>cb(e,t),closeAlertCard:(e,t)=>lb(e,t),alertDialog:Eb,showToast:Ob,showPicker:kb,showDatePicker:Mb};function Ib(e){typeof window>`u`||(window.ynet={callJSAPI(t,n,r){e&&e.pushApiCall&&e.pushApiCall(t,n);let i=Fb[t];if(i){i(n,r);return}wb(r,{success:!0,data:{}})}})}function Lb(){gb.length=0,hb.dialog=null,hb.toast=null,vb&&=(clearTimeout(vb),null),yb.length=0,hb.picker=null,xb.length=0,hb.datePicker=null}var Rb={name:`DeviceOverlay`,computed:{dialog(){return hb.dialog},toast(){return hb.toast}},methods:{onOk(){Db({ok:!0,dismissByClickBg:!1})},onCancel(){Db({ok:!1,dismissByClickBg:!1})},onMaskClick(){this.dialog&&this.dialog.clickBgToHide&&Db({ok:!1,dismissByClickBg:!0})}}},zb={class:`device-ui`},Bb={class:`dlg`},Vb={key:0,class:`dlg__title`},Hb={key:1,class:`dlg__msg`},Ub={class:`dlg__btns`},Wb={class:`dtoast__icon-svg`,viewBox:`0 0 24 24`,"aria-hidden":`true`},Gb={key:0,d:`M5 13l4 4L19 7`},Kb={key:1,d:`M6 6l12 12M18 6L6 18`},qb={class:`dtoast__msg`};function Jb(e,t,n,r,i,a){return B(),V(`div`,zb,[K(` alertDialog:原生风格居中确认对话框 `),W(ic,{name:`dlg-fade`},{default:Lr(()=>[a.dialog?(B(),V(`div`,{key:0,class:`dlg-mask`,onClick:t[2]||=q((...e)=>a.onMaskClick&&a.onMaskClick(...e),[`self`])},[U(`div`,Bb,[a.dialog.title?(B(),V(`div`,Vb,M(a.dialog.title),1)):K(`v-if`,!0),a.dialog.message?(B(),V(`div`,Hb,M(a.dialog.message),1)):K(`v-if`,!0),U(`div`,Ub,[a.dialog.cancelButton?(B(),V(`button`,{key:0,type:`button`,class:j([`dlg__btn dlg__btn--cancel`,{"dlg__btn--gray":a.dialog.cancelGrayStyle}]),onClick:t[0]||=(...e)=>a.onCancel&&a.onCancel(...e)},M(a.dialog.cancelButton),3)):K(`v-if`,!0),U(`button`,{type:`button`,class:`dlg__btn dlg__btn--ok`,onClick:t[1]||=(...e)=>a.onOk&&a.onOk(...e)},M(a.dialog.okButton),1)])])])):K(`v-if`,!0)]),_:1}),K(` showToast:居中弱提示(对齐 Vant Toast 视觉语言) `),W(ic,{name:`toast-fade`},{default:Lr(()=>[a.toast?(B(),V(`div`,{key:0,class:j([`dtoast`,{"dtoast--icon":a.toast.icon}])},[a.toast.icon?(B(),V(`span`,{key:0,class:j([`dtoast__icon`,`dtoast__icon--`+a.toast.icon])},[(B(),V(`svg`,Wb,[a.toast.icon===`ok`?(B(),V(`path`,Gb)):(B(),V(`path`,Kb))]))],2)):K(`v-if`,!0),U(`span`,qb,M(a.toast.message),1)],2)):K(`v-if`,!0)]),_:1})])}var Yb=X(Rb,[[`render`,Jb],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/DeviceOverlay.vue`]]),Xb={name:`PickerOverlay`,data(){return{sel:[]}},computed:{picker(){return hb.picker},columns(){if(!this.picker)return[];let e=this.picker.dataSource||[];if(this.picker.mode===`multi`){let t=e.map(e=>({key:String(e.key),text:e.text})),n=this.sel[0]||0,r=(e[n]&&e[n].children||[]).map(e=>({key:String(e.key),text:e.text}));return[{items:t,level:0},{items:r,level:1}]}return[{items:e.map(e=>({key:String(e.key),text:e.text})),level:0}]}},watch:{picker:{immediate:!0,handler(e){if(!e){this.sel=[];return}let t=e.dataSource||[],n=e.currentValue||[];if(e.mode===`multi`){let e=t.findIndex(e=>String(e.key)===String(n[0])),r=e>=0?e:0,i=t[r]&&t[r].children||[],a=i.findIndex(e=>String(e.key)===String(n[1]));this.sel=[r,a>=0?a:i.length?0:-1]}else{let e=t.findIndex(e=>String(e.key)===String(n[0]));this.sel=[e>=0?e:0]}}}},methods:{select(e,t){let n=this.sel.slice();if(n[e]=t,e===0&&this.picker.mode===`multi`){let e=this.picker.dataSource||[];n[1]=(e[t]&&e[t].children||[]).length?0:-1}this.sel=n},buildResult(){let e=this.picker;if(!e)return[];let t=e.dataSource||[],n=e=>({key:String(e.key),text:e.text,value:e.text});if(e.mode===`multi`){let e=t[this.sel[0]]||t[0],r=e&&e.children||[],i=r[this.sel[1]]||r[0],a=[];return e&&a.push(n(e)),i&&a.push(n(i)),a}let r=t[this.sel[0]]||t[0];return r?[n(r)]:[]},onConfirm(){jb(!0,this.buildResult())},onCancel(){jb(!1)}}},Zb={class:`device-ui`},Qb={class:`pk-sheet`},$b={class:`pk-bar`},ex={key:0,class:`pk-bar__title`},tx={class:`pk-col__list`},nx=[`onClick`];function rx(e,t,n,r,i,a){return B(),V(`div`,Zb,[W(ic,{name:`picker-fade`},{default:Lr(()=>[a.picker?(B(),V(`div`,{key:0,class:`pk-mask`,onClick:t[2]||=q((...e)=>a.onCancel&&a.onCancel(...e),[`self`])},[U(`div`,Qb,[U(`div`,$b,[U(`button`,{type:`button`,class:`pk-bar__btn pk-bar__btn--cancel`,onClick:t[0]||=(...e)=>a.onCancel&&a.onCancel(...e)},`取消`),a.picker.title?(B(),V(`div`,ex,M(a.picker.title),1)):K(`v-if`,!0),U(`button`,{type:`button`,class:`pk-bar__btn pk-bar__btn--ok`,onClick:t[1]||=(...e)=>a.onConfirm&&a.onConfirm(...e)},`确定`)]),U(`div`,{class:j([`pk-cols`,`pk-cols--`+a.columns.length])},[(B(!0),V(z,null,R(a.columns,(e,n)=>(B(),V(`div`,{key:n,class:`pk-col`},[t[3]||=U(`div`,{class:`pk-col__band`},null,-1),U(`div`,tx,[(B(!0),V(z,null,R(e.items,(e,t)=>(B(),V(`div`,{key:e.key,class:j([`pk-item`,{"pk-item--on":i.sel[n]===t}]),onClick:e=>a.select(n,t)},M(e.text),11,nx))),128))])]))),128))],2)])])):K(`v-if`,!0)]),_:1})])}var ix=X(Xb,[[`render`,rx],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/PickerOverlay.vue`]]),ax=40;function ox(e){return String(e).padStart(2,`0`)}function sx(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function cx(e,t){return[31,e%4==0&&e%100!=0||e%400==0?29:28,31,30,31,30,31,31,30,31,30,31][(t-1+12)%12]}function lx(e){if(!e)return null;let t=String(e).split(`-`).map(e=>parseInt(e,10));return t.some(e=>Number.isNaN(e))?null:t.length===3?{y:t[0],m:t[1],d:t[2]}:t.length===2?{m:t[0],d:t[1]}:null}var ux={name:`DatePickerOverlay`,data(){return{sel:[],dragging:!1,drag:null,suppressClick:!1,scrollTimers:[]}},computed:{datePicker(){return hb.datePicker},yearRange(){let e=this.datePicker,t=lx(e&&e.startDate)||{y:1970},n=lx(e&&e.endDate)||{y:2100};return{minY:t.y||1970,maxY:n.y||2100}},columns(){let e=this.datePicker;if(!e)return[];let{minY:t}=this.yearRange;if(e.type===`month_day`)return[{key:`month`,items:sx(1,12).map(e=>({text:ox(e)}))},{key:`day`,items:sx(1,31).map(e=>({text:ox(e)}))}];if(e.type===`year_month`)return[{key:`year`,items:sx(t,this.yearRange.maxY).map(e=>({text:String(e)}))},{key:`month`,items:sx(1,12).map(e=>({text:ox(e)}))}];let n=cx(t+(this.sel[0]||0),(this.sel[1]||0)+1);return[{key:`year`,items:sx(t,this.yearRange.maxY).map(e=>({text:String(e)}))},{key:`month`,items:sx(1,12).map(e=>({text:ox(e)}))},{key:`day`,items:sx(1,n).map(e=>({text:ox(e)}))}]}},watch:{datePicker:{immediate:!0,handler(e){if(!e){this.sel=[],this.scrollTimers=[];return}let t=lx(e.selectDate)||this.todayConstrained(e),{minY:n}=this.yearRange;if(e.type===`month_day`)this.sel=[t.m-1,t.d-1];else if(e.type===`year_month`)this.sel=[t.y-n,t.m-1];else{let e=cx(t.y,t.m);this.sel=[t.y-n,t.m-1,Math.min(t.d,e)-1]}this.$nextTick(()=>this.syncScrollTops())}},sel:{deep:!0,handler(){let e=this.datePicker;if(!e)return;let t=this.sel.slice();if(e.type===`year_month_day`){let e=cx(this.yearRange.minY+(t[0]||0),(t[1]||0)+1);if(t[2]>e-1){t[2]=e-1,this.sel=t;return}}this.$nextTick(()=>this.syncScrollTops())}}},methods:{getList(e){let t=this.$refs.cols;return t&&t.querySelectorAll(`.pk-col__list`)[e]||null},scrollForIndex(e){return(e||0)*ax},syncScrollTops(){this.columns.forEach((e,t)=>{let n=this.getList(t);n&&(n.scrollTop=this.scrollForIndex(this.sel[t]||0))})},pointerY(e){return e.touches&&e.touches.length?e.touches[0].clientY:e.clientY},onDragStart(e,t){this.suppressClick=!1;let n=this.getList(e);this.drag={ci:e,startY:this.pointerY(t),startScrollTop:n?n.scrollTop:0,moved:!1},this.dragging=!0,clearTimeout(this.scrollTimers[e]),window.addEventListener(`mousemove`,this.onDragMove),window.addEventListener(`mouseup`,this.onDragEnd),window.addEventListener(`touchmove`,this.onDragMove,{passive:!1}),window.addEventListener(`touchend`,this.onDragEnd)},onDragMove(e){if(!this.drag)return;e.cancelable&&e.preventDefault();let t=this.pointerY(e)-this.drag.startY;Math.abs(t)>3&&(this.drag.moved=!0);let n=this.getList(this.drag.ci);n&&(n.scrollTop=this.drag.startScrollTop-t)},onDragEnd(){if(!this.drag)return;let e=this.drag.ci,t=this.getList(e),n=this.drag.moved;if(this.drag=null,this.dragging=!1,window.removeEventListener(`mousemove`,this.onDragMove),window.removeEventListener(`mouseup`,this.onDragEnd),window.removeEventListener(`touchmove`,this.onDragMove),window.removeEventListener(`touchend`,this.onDragEnd),t){let n=this.columns[e].items.length-1,r=Math.round(t.scrollTop/ax);if(r=Math.max(0,Math.min(n,r)),t.scrollTop=this.scrollForIndex(r),this.sel[e]!==r){let t=this.sel.slice();t[e]=r,this.sel=t}}n&&(this.suppressClick=!0,this.$nextTick(()=>{this.suppressClick=!1}))},onWheel(e,t){clearTimeout(this.scrollTimers[e]),this.scrollTimers[e]=setTimeout(()=>this.snapToNearest(e),120)},onScroll(e,t){this.dragging||(clearTimeout(this.scrollTimers[e]),this.scrollTimers[e]=setTimeout(()=>this.snapToNearest(e),120))},snapToNearest(e){let t=this.getList(e);if(!t)return;let n=this.columns[e]&&this.columns[e].items.length-1||0,r=Math.round(t.scrollTop/ax);if(r=Math.max(0,Math.min(n,r)),t.scrollTop=this.scrollForIndex(r),this.sel[e]!==r){let t=this.sel.slice();t[e]=r,this.sel=t}},onItemClick(e,t){if(this.suppressClick)return;let n=this.getList(e);n&&(n.scrollTop=this.scrollForIndex(t));let r=this.sel.slice();r[e]=t,this.sel=r},todayConstrained(e){let t=new Date,{minY:n,maxY:r}=this.yearRange,i=t.getFullYear();i=Math.max(n,Math.min(r,i));let a=t.getMonth()+1,o=cx(i,a),s=Math.min(t.getDate(),o);return{y:i,m:a,d:s}},buildResult(){let e=this.datePicker;if(!e)return null;let{minY:t}=this.yearRange,n=``,r=0,i=0;e.type===`month_day`?(r=(this.sel[0]||0)+1,i=(this.sel[1]||0)+1):e.type===`year_month`?(n=t+(this.sel[0]||0),r=(this.sel[1]||0)+1):(n=t+(this.sel[0]||0),r=(this.sel[1]||0)+1,i=(this.sel[2]||0)+1);let a=ox(r),o=ox(i),s;return s=e.type===`year_month_day`?`${n}-${a}-${o}`:e.type===`year_month`?`${n}-${a}`:`${a}-${o}`,{year:e.type===`month_day`?``:String(n),month:a,day:e.type===`year_month`?``:o,value:s}},onConfirm(){Pb(!0,this.buildResult())},onCancel(){Pb(!1)}},beforeUnmount(){window.removeEventListener(`mousemove`,this.onDragMove),window.removeEventListener(`mouseup`,this.onDragEnd),window.removeEventListener(`touchmove`,this.onDragMove),window.removeEventListener(`touchend`,this.onDragEnd),this.scrollTimers.forEach(e=>clearTimeout(e))}},dx={class:`device-ui`},fx={class:`pk-sheet`},px={class:`pk-bar`},mx={key:0,class:`pk-bar__title`},hx=[`onMousedown`,`onTouchstart`,`onWheel`],gx=[`onScroll`],_x=[`onClick`];function vx(e,t,n,r,i,a){return B(),V(`div`,dx,[W(ic,{name:`picker-fade`},{default:Lr(()=>[a.datePicker?(B(),V(`div`,{key:0,class:`pk-mask`,onClick:t[2]||=q((...e)=>a.onCancel&&a.onCancel(...e),[`self`])},[U(`div`,fx,[U(`div`,px,[U(`button`,{type:`button`,class:`pk-bar__btn pk-bar__btn--cancel`,onClick:t[0]||=(...e)=>a.onCancel&&a.onCancel(...e)},`取消`),a.datePicker.title?(B(),V(`div`,mx,M(a.datePicker.title),1)):K(`v-if`,!0),U(`button`,{type:`button`,class:`pk-bar__btn pk-bar__btn--ok`,onClick:t[1]||=(...e)=>a.onConfirm&&a.onConfirm(...e)},`确定`)]),U(`div`,{ref:`cols`,class:j([`pk-cols pk-cols--wheel`,[`pk-cols--`+a.columns.length,{"is-dragging":i.dragging}]])},[(B(!0),V(z,null,R(a.columns,(e,n)=>(B(),V(`div`,{key:e.key,class:`pk-col`,onMousedown:q(e=>a.onDragStart(n,e),[`prevent`]),onTouchstart:q(e=>a.onDragStart(n,e),[`prevent`]),onWheel:e=>a.onWheel(n,e)},[t[3]||=U(`div`,{class:`pk-col__band`},null,-1),U(`div`,{class:`pk-col__list`,onScroll:e=>a.onScroll(n,e)},[(B(!0),V(z,null,R(e.items,(t,r)=>(B(),V(`div`,{key:e.key+`-`+t.text,class:j([`pk-item`,{"pk-item--on":i.sel[n]===r}]),onClick:e=>a.onItemClick(n,r)},M(t.text),11,_x))),128))],40,gx)],40,hx))),128))],2)])])):K(`v-if`,!0)]),_:1})])}var yx=X(ux,[[`render`,vx],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/DatePickerOverlay.vue`]]),bx={name:`SelectionOverlay`,props:{store:{type:Object,default:()=>Qf},boxClass:{type:String,default:`ce-sel-overlay`}},data(){return{boxStyle:{top:`0px`,left:`0px`,width:`0px`,height:`0px`},_ro:null,_onScroll:null,_onResize:null,_raf:0}},watch:{"store.el"(){this.bindTarget(),this.schedule()}},mounted(){this._onScroll=()=>this.schedule(),this._onResize=()=>this.schedule(),document.addEventListener(`scroll`,this._onScroll,{passive:!0,capture:!0}),window.addEventListener(`resize`,this._onResize),this.bindTarget(),this.schedule()},beforeUnmount(){document.removeEventListener(`scroll`,this._onScroll,{capture:!0}),window.removeEventListener(`resize`,this._onResize),this._ro&&=(this._ro.disconnect(),null),this._raf&&cancelAnimationFrame(this._raf)},methods:{bindTarget(){this._ro&&=(this._ro.disconnect(),null);let e=this.store.el;!e||typeof ResizeObserver>`u`||(this._ro=new ResizeObserver(()=>this.schedule()),this._ro.observe(e))},schedule(){this._raf||=requestAnimationFrame(()=>{this._raf=0,this.recompute()})},recompute(){let e=this.store.el;if(!e||!this.store.visible)return;let t=e.closest(`.phone__screen`);if(!t){this.store.visible=!1;return}let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=r.top-n.top+t.scrollTop,a=r.left-n.left+t.scrollLeft;this.boxStyle={top:i+`px`,left:a+`px`,width:r.width+`px`,height:r.height+`px`}}}},xx={width:`100%`,height:`100%`,style:{display:`block`},xmlns:`http://www.w3.org/2000/svg`};function Sx(e,t,n,r,i,a){return I((B(),V(`div`,{class:j(n.boxClass),style:A(i.boxStyle)},[(B(),V(`svg`,xx,[...t[0]||=[U(`rect`,{id:`controls_bounding_rect`,x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`transparent`,style:{stroke:`var(--accent)`},"stroke-width":`1`,"stroke-dasharray":`4`},null,-1)]]))],6)),[[Sc,n.store.visible]])}var Cx=X(bx,[[`render`,Sx],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/SelectionOverlay.vue`]]),wx=nn({el:null,visible:!1,nodeId:null});function Tx(e,t){wx.el=e,wx.nodeId=t,wx.visible=!0}function Ex(e){wx.el&&(e==null||wx.nodeId===e)&&(wx.el=null,wx.nodeId=null,wx.visible=!1)}var Dx={name:`HoverGuides`,setup(){return{hoverGuide:wx}},data(){return{box:{left:0,top:0,right:0,bottom:0},containerStyle:{width:`0px`,height:`0px`},_ro:null,_onScroll:null,_onResize:null,_raf:0,_stopWatch:null}},created(){this._stopWatch=Wr(()=>wx.el,()=>{this.bindTarget(),this.schedule()})},mounted(){this._onScroll=()=>this.schedule(),this._onResize=()=>this.schedule(),document.addEventListener(`scroll`,this._onScroll,{passive:!0,capture:!0}),window.addEventListener(`resize`,this._onResize),this.bindTarget(),this.schedule()},beforeUnmount(){document.removeEventListener(`scroll`,this._onScroll,{capture:!0}),window.removeEventListener(`resize`,this._onResize),this._stopWatch&&=(this._stopWatch(),null),this._ro&&=(this._ro.disconnect(),null),this._raf&&cancelAnimationFrame(this._raf)},methods:{bindTarget(){this._ro&&=(this._ro.disconnect(),null);let e=wx.el;!e||typeof ResizeObserver>`u`||(this._ro=new ResizeObserver(()=>this.schedule()),this._ro.observe(e))},schedule(){this._raf||=requestAnimationFrame(()=>{this._raf=0,this.recompute()})},recompute(){let e=wx.el;if(!e||!wx.visible)return;let t=e.closest(`.phone__screen`);if(!t){wx.visible=!1;return}let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=r.left-n.left+t.scrollLeft,a=r.top-n.top+t.scrollTop,o=r.width,s=r.height;this.box={left:i,top:a,right:i+o,bottom:a+s},this.containerStyle={width:t.clientWidth+`px`,height:t.scrollHeight+`px`}}}};function Ox(e,t,n,r,i,a){return I((B(),V(`div`,{class:`ce-guides`,style:A(i.containerStyle)},[K(` 左 / 右竖线:贯穿画布全高 `),U(`div`,{class:`ce-guide ce-guide--v`,style:A({left:i.box.left+`px`})},null,4),U(`div`,{class:`ce-guide ce-guide--v`,style:A({left:i.box.right+`px`})},null,4),K(` 上 / 下横线:贯穿画布全宽 `),U(`div`,{class:`ce-guide ce-guide--h`,style:A({top:i.box.top+`px`})},null,4),U(`div`,{class:`ce-guide ce-guide--h`,style:A({top:i.box.bottom+`px`})},null,4)],4)),[[Sc,r.hoverGuide.visible]])}var kx=X(Dx,[[`render`,Ox],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/HoverGuides.vue`]]),Ax=o(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),jx=o((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),Mx=o((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),Nx=o(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),Px=o(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),Fx=o((e=>{var t=jx().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),Ix=o((e=>{var t=jx().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),Lx=o((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),Rx=o((e=>{var t=Mx(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),zx=o((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),Bx=o((e=>{var t=zx();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),Vx=o(((e,t)=>{var n=Bx();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),Hx=o((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),Ux=o((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
|
|
189
|
-
]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^[0-9]+$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),
|
|
190
|
-
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),
|
|
191
|
-
Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}}))
|
|
191
|
+
(varDlg.form.defaultValue),确定时仍由 parseDefault 按类型解析。 `),H(`div`,Ky,[t[93]||=H(`label`,{class:`ni-field-label`},`默认值`,-1),a.isComplexType(i.varDlg.form.type)?(z(),B(`div`,qy,null,512)):i.varDlg.form.type===`string`?F((z(),B(`textarea`,{key:1,class:`ni-input vars-dlg__str`,"onUpdate:modelValue":t[38]||=e=>i.varDlg.form.defaultValue=e,placeholder:a.scalarPlaceholder(`string`)},null,8,Jy)),[[al,i.varDlg.form.defaultValue]]):i.varDlg.form.type===`number`?(z(),V(f,{key:2,class:`vars-dlg__ctrl`,value:i.varDlg.form.defaultValue,placeholder:a.scalarPlaceholder(`number`),onInput:t[39]||=e=>i.varDlg.form.defaultValue=e},null,8,[`value`,`placeholder`])):(z(),V(p,{key:3,class:`vars-dlg__ctrl`,value:i.varDlg.form.defaultValue,options:{iParamList:i.varBoolOptions},onInput:t[40]||=e=>i.varDlg.form.defaultValue=e},null,8,[`value`,`options`]))]),H(`div`,Yy,[t[94]||=H(`label`,{class:`ni-field-label`},`描述`,-1),F(H(`textarea`,{class:`ni-input vars-dlg__desc`,"onUpdate:modelValue":t[41]||=e=>i.varDlg.form.desc=e,placeholder:`可选`},null,512),[[al,i.varDlg.form.desc]])]),i.varDlgError?(z(),B(`p`,Xy,j(i.varDlgError),1)):G(`v-if`,!0)])]),H(`div`,Zy,[t[95]||=H(`span`,{class:`ni-tip`},`默认值入 defaultValue;设计期覆盖见「配置变量 mock」`,-1),H(`div`,Qy,[H(`button`,{class:`ni-btn ni-btn--ghost`,type:`button`,onClick:t[42]||=e=>i.varDlg=null},`取消`),H(`button`,{class:`ni-btn`,type:`button`,onClick:t[43]||=(...e)=>a.confirmVarDlg&&a.confirmVarDlg(...e)},`确定`)])])],8,Ny)])):G(`v-if`,!0)]),_:1}),U(m,{visible:i.delVarTarget!=null,title:`删除变量`,message:a.delVarMessage,severity:a.delVarSeverity,"confirm-text":a.delVarConfirmText,onConfirm:a.confirmDeleteVar,onCancel:t[45]||=e=>i.delVarTarget=null},null,8,[`visible`,`message`,`severity`,`confirm-text`,`onConfirm`])])}var eb=Y(Z_,[[`render`,$y],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/DebugPanel.vue`]]),tb={name:`ApiCallPanel`,components:{ApiPayloadTree:Lg},props:{rt:{type:Object,required:!0}},emits:[`close`],data(){return{copiedIndex:null,apiCopyTimer:null}},computed:{apiCalls(){return this.rt.apiRev,this.rt.apiCalls.slice()}},methods:{clearApiLog(){this.rt.clearApiCalls()},async copyApiPayload(e,t){let n=``;try{n=JSON.stringify(e.payload,null,2)}catch{n=String(e.payload)}await sp(n)&&(this.copiedIndex=t,this.apiCopyTimer&&clearTimeout(this.apiCopyTimer),this.apiCopyTimer=setTimeout(()=>{this.copiedIndex===t&&(this.copiedIndex=null)},1500))}}},nb={class:`apipanel`},rb={class:`apipanel__head`},ib={class:`apipanel__title`},ab={key:0,class:`debug__count`},ob=[`disabled`],sb={class:`apipanel__body`},cb={key:0,class:`empty-state`},lb={class:`debug__list`},ub={class:`debug__api-row`},db={class:`debug__kind`},fb=[`title`,`onClick`],pb={key:0,width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},mb={key:1,class:`debug__copy-ok`};function hb(e,t,n,r,i,a){let o=I(`ApiPayloadTree`);return z(),B(`aside`,nb,[H(`div`,rb,[H(`span`,ib,[t[2]||=W(` API调用 `,-1),a.apiCalls.length?(z(),B(`span`,ab,j(a.apiCalls.length),1)):G(`v-if`,!0)]),t[5]||=H(`span`,{class:`apipanel__spacer`},null,-1),H(`button`,{class:`apipanel__btn`,type:`button`,disabled:!a.apiCalls.length,title:`清空日志`,onClick:t[0]||=(...e)=>a.clearApiLog&&a.clearApiLog(...e)},[...t[3]||=[H(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[H(`use`,{href:`#icon-trash`})],-1)]],8,ob),H(`button`,{class:`apipanel__btn`,type:`button`,title:`收起接口调用面板`,onClick:t[1]||=t=>e.$emit(`close`)},[...t[4]||=[H(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[H(`line`,{x1:`5`,y1:`5`,x2:`19`,y2:`19`}),H(`line`,{x1:`19`,y1:`5`,x2:`5`,y2:`19`})],-1)]])]),H(`div`,sb,[G(` 空状态占位:虚线圆形徽章 + 插头图标(与全局 24 网格线性图标同语言)+ 文案 + 弱提示 `),a.apiCalls.length?G(`v-if`,!0):(z(),B(`div`,cb,[...t[6]||=[os(`<span class="empty-state__badge" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 7V3"></path><path d="M15 7V3"></path><path d="M6 7h12v4a6 6 0 0 1-12 0V7z"></path><path d="M12 17v4"></path></svg></span><p class="debug__empty">暂无API调用</p><p class="empty-state__hint">卡片事件触发 ynet.callJSAPI / postMessage 后,调用流水会实时显示在这里</p>`,3)]])),H(`ul`,lb,[(z(!0),B(R,null,L(a.apiCalls,(e,n)=>(z(),B(`li`,{key:n,class:`debug__item debug__item--api`},[H(`div`,ub,[H(`span`,db,j(e.api),1),H(`button`,{class:`debug__copy-ic`,type:`button`,title:i.copiedIndex===n?`已复制 ✓`:`复制数据(不含方法名)`,onClick:t=>a.copyApiPayload(e,n)},[i.copiedIndex===n?(z(),B(`span`,mb,`✓`)):(z(),B(`svg`,pb,[...t[7]||=[H(`use`,{href:`#icon-copy-sm`},null,-1)]]))],8,fb)]),G(` 返回数据:结构化折叠树(Chrome 控制台风格) `),U(o,{value:e.payload},null,8,[`value`])]))),128))])])])}var gb=Y(tb,[[`render`,hb],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ApiCallPanel.vue`]]),_b={name:`CardSelect`,emits:[`input`,`change`],props:{value:{type:String,default:``},options:{type:Array,default:()=>[]}},data(){return{open:!1,query:``,highlighted:0,sortByTime:this.loadSortByTime()}},created(){this.saveSortByTime()},computed:{current(){return this.options.find(e=>e.id===this.value)||{id:this.value,name:this.value}},filtered(){let e=this.query.trim().toLowerCase(),t=this.options;return e&&(t=this.options.filter(t=>t.id.toLowerCase().includes(e)||String(t.name||``).toLowerCase().includes(e))),this.sortByTime?t.slice().sort((e,t)=>(t.mtime||0)-(e.mtime||0)):t.slice().sort((e,t)=>String(e.name||``).localeCompare(String(t.name||``)))}},watch:{open(e){e?(this.query=``,this.highlighted=Math.max(0,this.filtered.findIndex(e=>e.id===this.value)),this.$nextTick(()=>{this.$refs.search&&this.$refs.search.focus(),this.scrollToActive()}),document.addEventListener(`click`,this.onDocClick,!0)):document.removeEventListener(`click`,this.onDocClick,!0)},sortByTime(e){this.saveSortByTime()}},beforeUnmount(){document.removeEventListener(`click`,this.onDocClick,!0)},methods:{toggle(){this.open=!this.open},toggleSort(){this.sortByTime=!this.sortByTime,this.highlighted=Math.max(0,this.filtered.findIndex(e=>e.id===this.value))},loadSortByTime(){try{return localStorage.getItem(`cardbuddy:cardselect-sort-by-time`)===`1`}catch{return!1}},saveSortByTime(){try{localStorage.setItem(`cardbuddy:cardselect-sort-by-time`,this.sortByTime?`1`:`0`)}catch{}},close(){this.open=!1},onDocClick(e){this.$refs.root&&!this.$refs.root.contains(e.target)&&this.close()},move(e){if(!this.filtered.length)return;let t=this.filtered.length;this.highlighted=(this.highlighted+e+t)%t,this.$nextTick(this.scrollToActive)},scrollToActive(){let e=this.$refs.list;if(!e)return;let t=e.children[this.highlighted];t&&t.scrollIntoView&&t.scrollIntoView({block:`nearest`})},choose(e){e&&(this.close(),e.id!==this.value&&(this.$emit(`input`,e.id),this.$emit(`change`,e.id)))}}},vb={class:`csel__current`},yb={class:`csel__id`},bb={class:`csel__name`},xb={key:0,class:`csel__pop`},Sb={class:`csel__search`},Cb={ref:`list`,class:`csel__list`},wb=[`onMousemove`,`onClick`],Tb=[`title`],Eb={class:`csel__item-id`},Db={class:`csel__item-name`},Ob={key:0,class:`csel__check`,viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`},kb={key:0,class:`csel__empty`},Ab={class:`csel__foot`},jb=[`title`,`aria-pressed`],Mb={class:`csel__count`};function Nb(e,t,n,r,i,a){return z(),B(`div`,{ref:`root`,class:A([`csel`,{"csel--open":i.open}])},[H(`button`,{type:`button`,class:A([`csel__trigger`,{"csel__trigger--active":i.open}]),onClick:t[0]||=(...e)=>a.toggle&&a.toggle(...e)},[H(`span`,vb,[H(`span`,yb,j(a.current.id),1),H(`span`,bb,j(a.current.name),1)]),t[7]||=H(`svg`,{class:`csel__chev`,viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`},[H(`use`,{href:`#icon-chevron`})],-1)],2),U(ac,{name:`csel-fade`},{default:Rr(()=>[i.open?(z(),B(`div`,xb,[H(`div`,Sb,[t[8]||=H(`svg`,{class:`csel__search-icon`,viewBox:`0 0 16 16`,width:`13`,height:`13`,"aria-hidden":`true`},[H(`use`,{href:`#icon-search`})],-1),F(H(`input`,{ref:`search`,"onUpdate:modelValue":t[1]||=e=>i.query=e,class:`csel__input`,type:`text`,placeholder:`搜索卡片 ID / 名称…`,onKeydown:[t[2]||=yl(K(e=>a.move(1),[`prevent`]),[`down`]),t[3]||=yl(K(e=>a.move(-1),[`prevent`]),[`up`]),t[4]||=yl(K(e=>a.choose(a.filtered[i.highlighted]),[`prevent`]),[`enter`]),t[5]||=yl(K((...e)=>a.close&&a.close(...e),[`prevent`]),[`esc`])]},null,544),[[al,i.query]])]),H(`ul`,Cb,[(z(!0),B(R,null,L(a.filtered,(e,r)=>(z(),B(`li`,{key:e.id,class:A([`csel__item`,{"csel__item--active":r===i.highlighted,"csel__item--selected":e.id===n.value}]),onMousemove:e=>i.highlighted=r,onClick:t=>a.choose(e)},[H(`span`,{class:A([`csel__dot`,{"csel__dot--imported":e.imported}]),title:e.imported?`导入卡片(含 .import-meta.json 来源信息)`:`本地卡片(无导入来源信息)`,"aria-hidden":`true`},null,10,Tb),H(`span`,Eb,j(e.id),1),H(`span`,Db,j(e.name),1),e.id===n.value?(z(),B(`svg`,Ob,[...t[9]||=[H(`use`,{href:`#icon-check`},null,-1)]])):G(`v-if`,!0)],42,wb))),128)),a.filtered.length?G(`v-if`,!0):(z(),B(`li`,kb,`无匹配卡片`))],512),H(`div`,Ab,[H(`button`,{class:A([`csel__sort`,{"csel__sort--active":i.sortByTime}]),type:`button`,title:i.sortByTime?`已按修改时间排序(新→旧),点击取消`:`按修改时间排序(新→旧)`,"aria-pressed":i.sortByTime,onClick:t[6]||=(...e)=>a.toggleSort&&a.toggleSort(...e)},`按修改时间排序`,10,jb),H(`span`,Mb,j(a.filtered.length)+` / `+j(n.options.length)+` 张卡片`,1)])])):G(`v-if`,!0)]),_:1})],2)}var Pb=Y(_b,[[`render`,Nb],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/CardSelect.vue`]]),Fb=Y({name:`AlertCardInstance`,components:{RenderTree:op},props:{entry:{type:Object,required:!0},mainRt:{type:Object,default:null}},data(){let e=new tu,t=ou(this.entry.scope,e),n=this.mainRt;if(n&&n.pushError&&n.pushApiCall){let e=t.pushError.bind(t);t.pushError=(t,r)=>{e(t,r),n.pushError(t,r)};let r=t.pushApiCall.bind(t);t.pushApiCall=(e,t)=>{r(e,t),n.pushApiCall(e,t)}}return{adapter:e,cardRuntime:t}},provide(){return{adapter:this.adapter,cardRuntime:this.cardRuntime,customComponents:{}}},render(){return Hs(op,{node:this.entry.preview.view,scope:this.cardRuntime.rootScope,key:this.entry.id})}},[[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/AlertCardInstance.vue`]]),Ib=rn({stack:[]}),Lb=0;async function Rb(e,t){let n=e||{},r=n.cardCode,i=null;try{let e=await q(`/__card/${encodeURIComponent(r)}`);if(e.ok){let t=await e.json();t&&t.schema&&(i=t)}}catch{}if(!i||!i.schema){typeof t==`function`&&t({success:!1,error:`card_not_found`,errorMessage:`未找到卡片 `+r});return}let a=Ib.stack;a.length&&a.splice(0,a.length).forEach(e=>{if(typeof e.callback==`function`)try{e.callback({success:!0,data:{event:`hidden`}})}catch{}});let o=i.data&&typeof i.data==`object`?i.data:{},s=rn(Object.assign({},o,n.data||{})),c=Fu(i.schema),l=`alert-`+ ++Lb;a.push({id:l,cardCode:r,preview:c,scope:s,gravity:n.gravity||`bottom`,width:typeof n.width==`number`?n.width:void 0,height:typeof n.height==`number`?n.height:void 0,offsetX:typeof n.offsetX==`number`?n.offsetX:0,offsetY:typeof n.offsetY==`number`?n.offsetY:0,clickOutsideCanHide:n.clickOutsideCanHide!==!1,callback:t})}function zb(e,t){let n=e||{},r=Ib.stack,i=null;if(typeof n.index==`number`){let e=Math.abs(n.index);r.length>=e&&(i=r[r.length-e])}else if(n.cardCode){for(let e=r.length-1;e>=0;e--)if(r[e].cardCode===n.cardCode){i=r[e];break}}else i=r[r.length-1];if(!i){typeof t==`function`&&t({success:!1,error:`no_alert`,errorMessage:`没有可关闭的弹窗`});return}let a=r.indexOf(i);r.splice(a,1),typeof i.callback==`function`&&(n.data?i.callback({success:!0,data:Object.assign({event:`hidden`},n.data)}):i.callback({success:!0,data:{}})),typeof t==`function`&&t({success:!0})}function Bb(){let e=Ib.stack;e.length&&e.splice(0,e.length)}var Vb={name:`AlertCardLayer`,components:{AlertCardInstance:Fb},props:{mainRt:{type:Object,default:null}},computed:{top(){let e=Ib.stack;return e.length?e[e.length-1]:null}},methods:{onMaskClick(e){e.clickOutsideCanHide&&zb({cardCode:e.cardCode})},panelStyle(e){let t={};e.width&&(t.width=e.width+`px`),e.height&&(t.height=e.height+`px`);let n=[];return e.offsetX&&n.push(`translateX(`+e.offsetX+`px)`),e.offsetY&&n.push(`translateY(`+e.offsetY+`px)`),n.length&&(t.transform=n.join(` `)),t}}},Hb={key:0,class:`alert-layer`};function Ub(e,t,n,r,i,a){let o=I(`AlertCardInstance`);return a.top?(z(),B(`div`,Hb,[H(`div`,{class:A([`alert-mask`,`alert-mask--`+a.top.gravity]),onClick:t[0]||=K(e=>a.onMaskClick(a.top),[`self`])},[H(`div`,{class:`alert-panel`,style:k(a.panelStyle(a.top))},[U(o,{entry:a.top,"main-rt":n.mainRt},null,8,[`entry`,`main-rt`])],4)],2)])):G(`v-if`,!0)}var Wb=Y(Vb,[[`render`,Ub],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/AlertCardLayer.vue`]]),Gb=rn({dialog:null,toast:null,picker:null,datePicker:null}),Kb=[],qb=0,Jb=null,Yb=[],Xb=0,Zb=[],Qb=0,$b=2200;function ex(e,t){if(typeof e==`function`)try{e(t)}catch{}}function tx(){Gb.dialog=Kb.length?Kb.shift():null}function nx(e,t){let n=e||{};Kb.push({id:++qb,title:n.title||``,message:n.message==null?``:String(n.message),okButton:n.okButton||`确定`,cancelButton:n.cancelButton||``,clickBgToHide:n.clickBgToHide===!0,cancelGrayStyle:n.cancelGrayStyle===!0,callback:t}),Gb.dialog||tx()}function rx(e){let t=Gb.dialog;t&&(Gb.dialog=null,ex(t.callback,{success:!0,data:{ok:!!e.ok,dismissByClickBg:!!e.dismissByClickBg}}),tx())}function ix(e,t){let n=e||{},r=n.showIcon==null?``:String(n.showIcon),i=r===`1`?`ok`:r===`0`?`err`:``;Jb&&=(clearTimeout(Jb),null),Gb.toast={message:n.message==null?``:String(n.message),icon:i},Jb=setTimeout(()=>{Gb.toast=null,Jb=null},$b),ex(t,{success:!0,data:{}})}function ax(e,t){let n=e||{},r=Array.isArray(n.currentValue)?n.currentValue:[];r.length&&Array.isArray(r[0])&&(r=r[0]),Yb.push({id:++Xb,title:n.title||``,mode:n.mode===`multi`?`multi`:`single`,dataSource:Array.isArray(n.dataSource)?n.dataSource:[],currentValue:r.map(e=>String(e)),callback:t}),Gb.picker||ox()}function ox(){Gb.picker=Yb.length?Yb.shift():null}function sx(e,t){let n=Gb.picker;if(n){if(Gb.picker=null,e){let e={success:!0,error:`0`,data:{result:t},result:t};ex(n.callback,e)}else ex(n.callback,{success:!0,data:{}});ox()}}function cx(e,t){let n=e||{},r=[`year_month_day`,`year_month`,`month_day`].includes(n.type)?n.type:`year_month_day`;Zb.push({id:++Qb,title:n.title||``,type:r,startDate:n.startDate||`1970-1-1`,endDate:n.endDate||`2100-12-31`,selectDate:n.selectDate||``,callback:t}),Gb.datePicker||lx()}function lx(){Gb.datePicker=Zb.length?Zb.shift():null}function ux(e,t){let n=Gb.datePicker;if(n){if(Gb.datePicker=null,e){let e={success:!0,error:`0`,currentDate:t.value,data:{year:t.year,month:t.month,day:t.day,value:t.value}};ex(n.callback,e)}else ex(n.callback,{success:!0,data:{}});lx()}}var dx={alertCard:(e,t)=>Rb(e,t),closeAlertCard:(e,t)=>zb(e,t),alertDialog:nx,showToast:ix,showPicker:ax,showDatePicker:cx};function fx(e){typeof window>`u`||(window.ynet={callJSAPI(t,n,r){e&&e.pushApiCall&&e.pushApiCall(t,n);let i=dx[t];if(i){i(n,r);return}ex(r,{success:!0,data:{}})}})}function px(){Kb.length=0,Gb.dialog=null,Gb.toast=null,Jb&&=(clearTimeout(Jb),null),Yb.length=0,Gb.picker=null,Zb.length=0,Gb.datePicker=null}var mx={name:`DeviceOverlay`,computed:{dialog(){return Gb.dialog},toast(){return Gb.toast}},methods:{onOk(){rx({ok:!0,dismissByClickBg:!1})},onCancel(){rx({ok:!1,dismissByClickBg:!1})},onMaskClick(){this.dialog&&this.dialog.clickBgToHide&&rx({ok:!1,dismissByClickBg:!0})}}},hx={class:`device-ui`},gx={class:`dlg`},_x={key:0,class:`dlg__title`},vx={key:1,class:`dlg__msg`},yx={class:`dlg__btns`},bx={class:`dtoast__icon-svg`,viewBox:`0 0 24 24`,"aria-hidden":`true`},xx={key:0,d:`M5 13l4 4L19 7`},Sx={key:1,d:`M6 6l12 12M18 6L6 18`},Cx={class:`dtoast__msg`};function wx(e,t,n,r,i,a){return z(),B(`div`,hx,[G(` alertDialog:原生风格居中确认对话框 `),U(ac,{name:`dlg-fade`},{default:Rr(()=>[a.dialog?(z(),B(`div`,{key:0,class:`dlg-mask`,onClick:t[2]||=K((...e)=>a.onMaskClick&&a.onMaskClick(...e),[`self`])},[H(`div`,gx,[a.dialog.title?(z(),B(`div`,_x,j(a.dialog.title),1)):G(`v-if`,!0),a.dialog.message?(z(),B(`div`,vx,j(a.dialog.message),1)):G(`v-if`,!0),H(`div`,yx,[a.dialog.cancelButton?(z(),B(`button`,{key:0,type:`button`,class:A([`dlg__btn dlg__btn--cancel`,{"dlg__btn--gray":a.dialog.cancelGrayStyle}]),onClick:t[0]||=(...e)=>a.onCancel&&a.onCancel(...e)},j(a.dialog.cancelButton),3)):G(`v-if`,!0),H(`button`,{type:`button`,class:`dlg__btn dlg__btn--ok`,onClick:t[1]||=(...e)=>a.onOk&&a.onOk(...e)},j(a.dialog.okButton),1)])])])):G(`v-if`,!0)]),_:1}),G(` showToast:居中弱提示(对齐 Vant Toast 视觉语言) `),U(ac,{name:`toast-fade`},{default:Rr(()=>[a.toast?(z(),B(`div`,{key:0,class:A([`dtoast`,{"dtoast--icon":a.toast.icon}])},[a.toast.icon?(z(),B(`span`,{key:0,class:A([`dtoast__icon`,`dtoast__icon--`+a.toast.icon])},[(z(),B(`svg`,bx,[a.toast.icon===`ok`?(z(),B(`path`,xx)):(z(),B(`path`,Sx))]))],2)):G(`v-if`,!0),H(`span`,Cx,j(a.toast.message),1)],2)):G(`v-if`,!0)]),_:1})])}var Tx=Y(mx,[[`render`,wx],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/DeviceOverlay.vue`]]),Ex={name:`PickerOverlay`,data(){return{sel:[]}},computed:{picker(){return Gb.picker},columns(){if(!this.picker)return[];let e=this.picker.dataSource||[];if(this.picker.mode===`multi`){let t=e.map(e=>({key:String(e.key),text:e.text})),n=this.sel[0]||0,r=(e[n]&&e[n].children||[]).map(e=>({key:String(e.key),text:e.text}));return[{items:t,level:0},{items:r,level:1}]}return[{items:e.map(e=>({key:String(e.key),text:e.text})),level:0}]}},watch:{picker:{immediate:!0,handler(e){if(!e){this.sel=[];return}let t=e.dataSource||[],n=e.currentValue||[];if(e.mode===`multi`){let e=t.findIndex(e=>String(e.key)===String(n[0])),r=e>=0?e:0,i=t[r]&&t[r].children||[],a=i.findIndex(e=>String(e.key)===String(n[1]));this.sel=[r,a>=0?a:i.length?0:-1]}else{let e=t.findIndex(e=>String(e.key)===String(n[0]));this.sel=[e>=0?e:0]}}}},methods:{select(e,t){let n=this.sel.slice();if(n[e]=t,e===0&&this.picker.mode===`multi`){let e=this.picker.dataSource||[];n[1]=(e[t]&&e[t].children||[]).length?0:-1}this.sel=n},buildResult(){let e=this.picker;if(!e)return[];let t=e.dataSource||[],n=e=>({key:String(e.key),text:e.text,value:e.text});if(e.mode===`multi`){let e=t[this.sel[0]]||t[0],r=e&&e.children||[],i=r[this.sel[1]]||r[0],a=[];return e&&a.push(n(e)),i&&a.push(n(i)),a}let r=t[this.sel[0]]||t[0];return r?[n(r)]:[]},onConfirm(){sx(!0,this.buildResult())},onCancel(){sx(!1)}}},Dx={class:`device-ui`},Ox={class:`pk-sheet`},kx={class:`pk-bar`},Ax={key:0,class:`pk-bar__title`},jx={class:`pk-col__list`},Mx=[`onClick`];function Nx(e,t,n,r,i,a){return z(),B(`div`,Dx,[U(ac,{name:`picker-fade`},{default:Rr(()=>[a.picker?(z(),B(`div`,{key:0,class:`pk-mask`,onClick:t[2]||=K((...e)=>a.onCancel&&a.onCancel(...e),[`self`])},[H(`div`,Ox,[H(`div`,kx,[H(`button`,{type:`button`,class:`pk-bar__btn pk-bar__btn--cancel`,onClick:t[0]||=(...e)=>a.onCancel&&a.onCancel(...e)},`取消`),a.picker.title?(z(),B(`div`,Ax,j(a.picker.title),1)):G(`v-if`,!0),H(`button`,{type:`button`,class:`pk-bar__btn pk-bar__btn--ok`,onClick:t[1]||=(...e)=>a.onConfirm&&a.onConfirm(...e)},`确定`)]),H(`div`,{class:A([`pk-cols`,`pk-cols--`+a.columns.length])},[(z(!0),B(R,null,L(a.columns,(e,n)=>(z(),B(`div`,{key:n,class:`pk-col`},[t[3]||=H(`div`,{class:`pk-col__band`},null,-1),H(`div`,jx,[(z(!0),B(R,null,L(e.items,(e,t)=>(z(),B(`div`,{key:e.key,class:A([`pk-item`,{"pk-item--on":i.sel[n]===t}]),onClick:e=>a.select(n,t)},j(e.text),11,Mx))),128))])]))),128))],2)])])):G(`v-if`,!0)]),_:1})])}var Px=Y(Ex,[[`render`,Nx],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/PickerOverlay.vue`]]),Fx=40;function Ix(e){return String(e).padStart(2,`0`)}function Lx(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Rx(e,t){return[31,e%4==0&&e%100!=0||e%400==0?29:28,31,30,31,30,31,31,30,31,30,31][(t-1+12)%12]}function zx(e){if(!e)return null;let t=String(e).split(`-`).map(e=>parseInt(e,10));return t.some(e=>Number.isNaN(e))?null:t.length===3?{y:t[0],m:t[1],d:t[2]}:t.length===2?{m:t[0],d:t[1]}:null}var Bx={name:`DatePickerOverlay`,data(){return{sel:[],dragging:!1,drag:null,suppressClick:!1,scrollTimers:[]}},computed:{datePicker(){return Gb.datePicker},yearRange(){let e=this.datePicker,t=zx(e&&e.startDate)||{y:1970},n=zx(e&&e.endDate)||{y:2100};return{minY:t.y||1970,maxY:n.y||2100}},columns(){let e=this.datePicker;if(!e)return[];let{minY:t}=this.yearRange;if(e.type===`month_day`)return[{key:`month`,items:Lx(1,12).map(e=>({text:Ix(e)}))},{key:`day`,items:Lx(1,31).map(e=>({text:Ix(e)}))}];if(e.type===`year_month`)return[{key:`year`,items:Lx(t,this.yearRange.maxY).map(e=>({text:String(e)}))},{key:`month`,items:Lx(1,12).map(e=>({text:Ix(e)}))}];let n=Rx(t+(this.sel[0]||0),(this.sel[1]||0)+1);return[{key:`year`,items:Lx(t,this.yearRange.maxY).map(e=>({text:String(e)}))},{key:`month`,items:Lx(1,12).map(e=>({text:Ix(e)}))},{key:`day`,items:Lx(1,n).map(e=>({text:Ix(e)}))}]}},watch:{datePicker:{immediate:!0,handler(e){if(!e){this.sel=[],this.scrollTimers=[];return}let t=zx(e.selectDate)||this.todayConstrained(e),{minY:n}=this.yearRange;if(e.type===`month_day`)this.sel=[t.m-1,t.d-1];else if(e.type===`year_month`)this.sel=[t.y-n,t.m-1];else{let e=Rx(t.y,t.m);this.sel=[t.y-n,t.m-1,Math.min(t.d,e)-1]}this.$nextTick(()=>this.syncScrollTops())}},sel:{deep:!0,handler(){let e=this.datePicker;if(!e)return;let t=this.sel.slice();if(e.type===`year_month_day`){let e=Rx(this.yearRange.minY+(t[0]||0),(t[1]||0)+1);if(t[2]>e-1){t[2]=e-1,this.sel=t;return}}this.$nextTick(()=>this.syncScrollTops())}}},methods:{getList(e){let t=this.$refs.cols;return t&&t.querySelectorAll(`.pk-col__list`)[e]||null},scrollForIndex(e){return(e||0)*Fx},syncScrollTops(){this.columns.forEach((e,t)=>{let n=this.getList(t);n&&(n.scrollTop=this.scrollForIndex(this.sel[t]||0))})},pointerY(e){return e.touches&&e.touches.length?e.touches[0].clientY:e.clientY},onDragStart(e,t){this.suppressClick=!1;let n=this.getList(e);this.drag={ci:e,startY:this.pointerY(t),startScrollTop:n?n.scrollTop:0,moved:!1},this.dragging=!0,clearTimeout(this.scrollTimers[e]),window.addEventListener(`mousemove`,this.onDragMove),window.addEventListener(`mouseup`,this.onDragEnd),window.addEventListener(`touchmove`,this.onDragMove,{passive:!1}),window.addEventListener(`touchend`,this.onDragEnd)},onDragMove(e){if(!this.drag)return;e.cancelable&&e.preventDefault();let t=this.pointerY(e)-this.drag.startY;Math.abs(t)>3&&(this.drag.moved=!0);let n=this.getList(this.drag.ci);n&&(n.scrollTop=this.drag.startScrollTop-t)},onDragEnd(){if(!this.drag)return;let e=this.drag.ci,t=this.getList(e),n=this.drag.moved;if(this.drag=null,this.dragging=!1,window.removeEventListener(`mousemove`,this.onDragMove),window.removeEventListener(`mouseup`,this.onDragEnd),window.removeEventListener(`touchmove`,this.onDragMove),window.removeEventListener(`touchend`,this.onDragEnd),t){let n=this.columns[e].items.length-1,r=Math.round(t.scrollTop/Fx);if(r=Math.max(0,Math.min(n,r)),t.scrollTop=this.scrollForIndex(r),this.sel[e]!==r){let t=this.sel.slice();t[e]=r,this.sel=t}}n&&(this.suppressClick=!0,this.$nextTick(()=>{this.suppressClick=!1}))},onWheel(e,t){clearTimeout(this.scrollTimers[e]),this.scrollTimers[e]=setTimeout(()=>this.snapToNearest(e),120)},onScroll(e,t){this.dragging||(clearTimeout(this.scrollTimers[e]),this.scrollTimers[e]=setTimeout(()=>this.snapToNearest(e),120))},snapToNearest(e){let t=this.getList(e);if(!t)return;let n=this.columns[e]&&this.columns[e].items.length-1||0,r=Math.round(t.scrollTop/Fx);if(r=Math.max(0,Math.min(n,r)),t.scrollTop=this.scrollForIndex(r),this.sel[e]!==r){let t=this.sel.slice();t[e]=r,this.sel=t}},onItemClick(e,t){if(this.suppressClick)return;let n=this.getList(e);n&&(n.scrollTop=this.scrollForIndex(t));let r=this.sel.slice();r[e]=t,this.sel=r},todayConstrained(e){let t=new Date,{minY:n,maxY:r}=this.yearRange,i=t.getFullYear();i=Math.max(n,Math.min(r,i));let a=t.getMonth()+1,o=Rx(i,a),s=Math.min(t.getDate(),o);return{y:i,m:a,d:s}},buildResult(){let e=this.datePicker;if(!e)return null;let{minY:t}=this.yearRange,n=``,r=0,i=0;e.type===`month_day`?(r=(this.sel[0]||0)+1,i=(this.sel[1]||0)+1):e.type===`year_month`?(n=t+(this.sel[0]||0),r=(this.sel[1]||0)+1):(n=t+(this.sel[0]||0),r=(this.sel[1]||0)+1,i=(this.sel[2]||0)+1);let a=Ix(r),o=Ix(i),s;return s=e.type===`year_month_day`?`${n}-${a}-${o}`:e.type===`year_month`?`${n}-${a}`:`${a}-${o}`,{year:e.type===`month_day`?``:String(n),month:a,day:e.type===`year_month`?``:o,value:s}},onConfirm(){ux(!0,this.buildResult())},onCancel(){ux(!1)}},beforeUnmount(){window.removeEventListener(`mousemove`,this.onDragMove),window.removeEventListener(`mouseup`,this.onDragEnd),window.removeEventListener(`touchmove`,this.onDragMove),window.removeEventListener(`touchend`,this.onDragEnd),this.scrollTimers.forEach(e=>clearTimeout(e))}},Vx={class:`device-ui`},Hx={class:`pk-sheet`},Ux={class:`pk-bar`},Wx={key:0,class:`pk-bar__title`},Gx=[`onMousedown`,`onTouchstart`,`onWheel`],Kx=[`onScroll`],qx=[`onClick`];function Jx(e,t,n,r,i,a){return z(),B(`div`,Vx,[U(ac,{name:`picker-fade`},{default:Rr(()=>[a.datePicker?(z(),B(`div`,{key:0,class:`pk-mask`,onClick:t[2]||=K((...e)=>a.onCancel&&a.onCancel(...e),[`self`])},[H(`div`,Hx,[H(`div`,Ux,[H(`button`,{type:`button`,class:`pk-bar__btn pk-bar__btn--cancel`,onClick:t[0]||=(...e)=>a.onCancel&&a.onCancel(...e)},`取消`),a.datePicker.title?(z(),B(`div`,Wx,j(a.datePicker.title),1)):G(`v-if`,!0),H(`button`,{type:`button`,class:`pk-bar__btn pk-bar__btn--ok`,onClick:t[1]||=(...e)=>a.onConfirm&&a.onConfirm(...e)},`确定`)]),H(`div`,{ref:`cols`,class:A([`pk-cols pk-cols--wheel`,[`pk-cols--`+a.columns.length,{"is-dragging":i.dragging}]])},[(z(!0),B(R,null,L(a.columns,(e,n)=>(z(),B(`div`,{key:e.key,class:`pk-col`,onMousedown:K(e=>a.onDragStart(n,e),[`prevent`]),onTouchstart:K(e=>a.onDragStart(n,e),[`prevent`]),onWheel:e=>a.onWheel(n,e)},[t[3]||=H(`div`,{class:`pk-col__band`},null,-1),H(`div`,{class:`pk-col__list`,onScroll:e=>a.onScroll(n,e)},[(z(!0),B(R,null,L(e.items,(t,r)=>(z(),B(`div`,{key:e.key+`-`+t.text,class:A([`pk-item`,{"pk-item--on":i.sel[n]===r}]),onClick:e=>a.onItemClick(n,r)},j(t.text),11,qx))),128))],40,Kx)],40,Gx))),128))],2)])])):G(`v-if`,!0)]),_:1})])}var Yx=Y(Bx,[[`render`,Jx],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/DatePickerOverlay.vue`]]),Xx={name:`SelectionOverlay`,props:{store:{type:Object,default:()=>$f},boxClass:{type:String,default:`ce-sel-overlay`}},data(){return{boxStyle:{top:`0px`,left:`0px`,width:`0px`,height:`0px`},_ro:null,_onScroll:null,_onResize:null,_raf:0}},watch:{"store.el"(){this.bindTarget(),this.schedule()}},mounted(){this._onScroll=()=>this.schedule(),this._onResize=()=>this.schedule(),document.addEventListener(`scroll`,this._onScroll,{passive:!0,capture:!0}),window.addEventListener(`resize`,this._onResize),this.bindTarget(),this.schedule()},beforeUnmount(){document.removeEventListener(`scroll`,this._onScroll,{capture:!0}),window.removeEventListener(`resize`,this._onResize),this._ro&&=(this._ro.disconnect(),null),this._raf&&cancelAnimationFrame(this._raf)},methods:{bindTarget(){this._ro&&=(this._ro.disconnect(),null);let e=this.store.el;!e||typeof ResizeObserver>`u`||(this._ro=new ResizeObserver(()=>this.schedule()),this._ro.observe(e))},schedule(){this._raf||=requestAnimationFrame(()=>{this._raf=0,this.recompute()})},recompute(){let e=this.store.el;if(!e||!this.store.visible)return;let t=e.closest(`.phone__screen`);if(!t){this.store.visible=!1;return}let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=r.top-n.top+t.scrollTop,a=r.left-n.left+t.scrollLeft;this.boxStyle={top:i+`px`,left:a+`px`,width:r.width+`px`,height:r.height+`px`}}}},Zx={width:`100%`,height:`100%`,style:{display:`block`},xmlns:`http://www.w3.org/2000/svg`};function Qx(e,t,n,r,i,a){return F((z(),B(`div`,{class:A(n.boxClass),style:k(i.boxStyle)},[(z(),B(`svg`,Zx,[...t[0]||=[H(`rect`,{id:`controls_bounding_rect`,x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`transparent`,style:{stroke:`var(--accent)`},"stroke-width":`1`,"stroke-dasharray":`4`},null,-1)]]))],6)),[[Cc,n.store.visible]])}var $x=Y(Xx,[[`render`,Qx],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/SelectionOverlay.vue`]]),eS=rn({el:null,visible:!1,nodeId:null});function tS(e,t){eS.el=e,eS.nodeId=t,eS.visible=!0}function nS(e){eS.el&&(e==null||eS.nodeId===e)&&(eS.el=null,eS.nodeId=null,eS.visible=!1)}var rS={name:`HoverGuides`,setup(){return{hoverGuide:eS}},data(){return{box:{left:0,top:0,right:0,bottom:0},containerStyle:{width:`0px`,height:`0px`},_ro:null,_onScroll:null,_onResize:null,_raf:0,_stopWatch:null}},created(){this._stopWatch=Gr(()=>eS.el,()=>{this.bindTarget(),this.schedule()})},mounted(){this._onScroll=()=>this.schedule(),this._onResize=()=>this.schedule(),document.addEventListener(`scroll`,this._onScroll,{passive:!0,capture:!0}),window.addEventListener(`resize`,this._onResize),this.bindTarget(),this.schedule()},beforeUnmount(){document.removeEventListener(`scroll`,this._onScroll,{capture:!0}),window.removeEventListener(`resize`,this._onResize),this._stopWatch&&=(this._stopWatch(),null),this._ro&&=(this._ro.disconnect(),null),this._raf&&cancelAnimationFrame(this._raf)},methods:{bindTarget(){this._ro&&=(this._ro.disconnect(),null);let e=eS.el;!e||typeof ResizeObserver>`u`||(this._ro=new ResizeObserver(()=>this.schedule()),this._ro.observe(e))},schedule(){this._raf||=requestAnimationFrame(()=>{this._raf=0,this.recompute()})},recompute(){let e=eS.el;if(!e||!eS.visible)return;let t=e.closest(`.phone__screen`);if(!t){eS.visible=!1;return}let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=r.left-n.left+t.scrollLeft,a=r.top-n.top+t.scrollTop,o=r.width,s=r.height;this.box={left:i,top:a,right:i+o,bottom:a+s},this.containerStyle={width:t.clientWidth+`px`,height:t.scrollHeight+`px`}}}};function iS(e,t,n,r,i,a){return F((z(),B(`div`,{class:`ce-guides`,style:k(i.containerStyle)},[G(` 左 / 右竖线:贯穿画布全高 `),H(`div`,{class:`ce-guide ce-guide--v`,style:k({left:i.box.left+`px`})},null,4),H(`div`,{class:`ce-guide ce-guide--v`,style:k({left:i.box.right+`px`})},null,4),G(` 上 / 下横线:贯穿画布全宽 `),H(`div`,{class:`ce-guide ce-guide--h`,style:k({top:i.box.top+`px`})},null,4),H(`div`,{class:`ce-guide ce-guide--h`,style:k({top:i.box.bottom+`px`})},null,4)],4)),[[Cc,r.hoverGuide.visible]])}var aS=Y(rS,[[`render`,iS],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/HoverGuides.vue`]]),oS=o(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),sS=o((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),cS=o((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),lS=o(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),uS=o(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),dS=o((e=>{var t=sS().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),fS=o((e=>{var t=sS().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),pS=o((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),mS=o((e=>{var t=cS(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),hS=o((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),gS=o((e=>{var t=hS();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),_S=o(((e,t)=>{var n=gS();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),vS=o((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),yS=o((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
|
|
192
|
+
]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^[0-9]+$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),bS=o((e=>{var t=vS(),n=yS();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),xS=o((e=>{var t=sS(),n=mS(),r=cS(),i=bS(),a=vS(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),SS=o((e=>{var t=sS(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),CS=o(((e,t)=>{var n=bS();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),wS=o(((e,t)=>{var n=bS(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),TS=o(((e,t)=>{var n=bS();function r(e){this.mode=n.BYTE,this.data=typeof e==`string`?new TextEncoder().encode(e):new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),ES=o(((e,t)=>{var n=bS(),r=sS();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
|
|
193
|
+
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),DS=o(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),OS=o((e=>{var t=bS(),n=CS(),r=wS(),i=TS(),a=ES(),o=yS(),s=sS(),c=DS();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
|
|
194
|
+
Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),kS=o((e=>{var t=sS(),n=cS(),r=lS(),i=uS(),a=dS(),o=fS(),s=pS(),c=mS(),l=_S(),u=xS(),d=SS(),f=bS(),p=OS();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function _(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function v(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function y(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function b(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return x(a,e,n)}function x(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),_=Array(o),v=0,y=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=y.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let b=new Uint8Array(i),x=0,S,C;for(S=0;S<v;S++)for(C=0;C<o;C++)S<g[C].length&&(b[x++]=g[C][S]);for(S=0;S<p;S++)for(C=0;C<o;C++)b[x++]=_[C][S];return b}function S(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
|
|
192
195
|
The chosen QR Code version cannot contain this amount of data.
|
|
193
196
|
Minimum version required to store current data is: `+c+`.
|
|
194
|
-
`);let l=b(n,r,o),d=new i(t.getSymbolSize(n));return m(d,n),h(d),g(d,n),v(d,r,0),n>=7&&_(d,n),y(d,l),isNaN(a)&&(a=s.getBestMask(d,v.bind(null,d,r))),s.applyMask(a,d),v(d,r,a),{modules:d,version:n,errorCorrectionLevel:r,maskPattern:a,segments:o}}e.create=function(e,r){if(e===void 0||e===``)throw Error(`No input text`);let i=n.M,a,o;return r!==void 0&&(i=n.from(r.errorCorrectionLevel,n.M),a=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),S(e,a,i,o)}})),
|
|
195
|
-
`;return typeof a==`function`&&a(null,p),p}})),rS=c(o((e=>{var t=Ax(),n=$x(),r=tS(),i=nS();function a(e,r,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l=typeof s[c-1]==`function`;if(!l&&!t())throw Error(`Callback required as last argument`);if(l){if(c<2)throw Error(`Too few arguments provided`);c===2?(o=i,i=r,r=a=void 0):c===3&&(r.getContext&&o===void 0?(o=a,a=void 0):(o=a,a=i,i=r,r=void 0))}else{if(c<1)throw Error(`Too few arguments provided`);return c===1?(i=r,r=a=void 0):c===2&&!r.getContext&&(a=i,i=r,r=void 0),new Promise(function(t,o){try{t(e(n.create(i,a),r,a))}catch(e){o(e)}})}try{let t=n.create(i,a);o(null,e(t,r,a))}catch(e){o(e)}}e.create=n.create,e.toCanvas=a.bind(null,r.render),e.toDataURL=a.bind(null,r.renderToDataURL),e.toString=a.bind(null,function(e,t,n){return i.render(e,n)})}))()),iS={name:`RemotePreview`,props:{visible:{type:Boolean,default:!1},pageId:{type:[String,Number],default:``},schema:{type:Object,default:null},cardCode:{type:String,default:``}},data(){return{qrDataUrl:``,url:``,loading:!1,publishing:!1,copied:!1,copyTimer:null,warn:``,code:``}},watch:{visible(e){e&&this.open()},pageId(){this.visible&&this.open()}},beforeUnmount(){this.copyTimer&&clearTimeout(this.copyTimer)},methods:{buildSocket(e){return`${`https://uat-pkg.finmall.com`.replace(/^https?:/,`wss:`)}/pmb-web/websocket/card/${e}`},fullUrl(e,t){let n=this.buildSocket(e);return`app://previewCard?cardId=${encodeURIComponent(e)}&cardCode=${encodeURIComponent(t||``)}&cardVersion=00000000&socket=${encodeURIComponent(n)}`},async makeQr(e){return rS.toDataURL(e,{width:220,margin:1,errorCorrectionLevel:`H`,color:{dark:`#10131a`,light:`#ffffff`}})},async open(){this.qrDataUrl=``,this.url=``,this.loading=!0,this.publishing=!1,this.copied=!1,this.warn=``,this.code=this.cardCode||``;let e=String(this.pageId||``).trim();if(!e){this.warn=`当前卡片缺少 pageId(远端卡片 id),无法生成预览二维码`,this.loading=!1;return}this.url=`app://previewCard?cardId=${encodeURIComponent(e)}`;try{this.qrDataUrl=await this.makeQr(this.url)}catch(e){this.warn=`二维码生成失败:`+(e&&e.message)}this.publishing=!0;try{let t=await J(`/__preview`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({schema:this.schema||{pageId:e}})}),n=await t.json().catch(()=>({}));if(!t.ok)throw Error(n.message||`preview failed`);n.cardCode!==void 0&&(this.code=n.cardCode),this.url=this.fullUrl(e,this.code),this.qrDataUrl=await this.makeQr(this.url)}catch(e){this.warn=`远端发布失败:`+(e&&e.message)}finally{this.publishing=!1,this.loading=!1}},async copyUrl(){if(this.url)try{if(navigator.clipboard&&navigator.clipboard.writeText)await navigator.clipboard.writeText(this.url);else{let e=document.createElement(`textarea`);e.value=this.url,e.style.position=`fixed`,e.style.opacity=`0`,document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e)}this.copied=!0,this.copyTimer&&clearTimeout(this.copyTimer),this.copyTimer=setTimeout(()=>{this.copied=!1},1500)}catch(e){this.warn=`复制失败:`+(e&&e.message)}}}},aS={class:`rp-card modal-card`,role:`dialog`,"aria-label":`远端预览二维码`},oS={class:`rp-head`},sS={class:`rp-body`},cS={class:`rp-qr-wrap`},lS=[`src`],uS={key:1,class:`rp-qr rp-qr--loading`},dS={key:2,class:`rp-qr-loading`},fS={class:`rp-url`},pS={class:`rp-url-text`},mS=[`disabled`],hS={key:0,class:`rp-warn`};function gS(e,t,n,r,i,a){return B(),H(ic,{name:`modal`},{default:Lr(()=>[n.visible?(B(),V(`div`,{key:0,class:`rp-mask`,onClick:t[2]||=q(t=>e.$emit(`close`),[`self`])},[U(`div`,aS,[U(`div`,oS,[t[3]||=U(`span`,{class:`rp-title`},`远端预览(真机扫码)`,-1),U(`button`,{class:`rp-x`,type:`button`,onClick:t[0]||=t=>e.$emit(`close`),"aria-label":`关闭`},`×`)]),U(`div`,sS,[U(`div`,cS,[i.qrDataUrl?(B(),V(`img`,{key:0,src:i.qrDataUrl,class:j([`rp-qr`,{"rp-qr--blurred":i.publishing}]),alt:`preview qr`},null,10,lS)):(B(),V(`div`,uS,M(i.loading?`准备中…`:`—`),1)),i.publishing?(B(),V(`div`,dS,[...t[4]||=[U(`span`,{class:`rp-spinner`},null,-1),U(`span`,{class:`rp-loading-text`},`正在发布预览…`,-1)]])):K(`v-if`,!0)]),t[5]||=U(`p`,{class:`rp-tip`},`手机(FinMall App)扫一扫,真机查看当前卡片预览`,-1),U(`div`,fS,[U(`code`,pS,M(i.url||`—`),1),U(`button`,{class:`rp-copy`,type:`button`,disabled:!i.url,onClick:t[1]||=(...e)=>a.copyUrl&&a.copyUrl(...e)},M(i.copied?`已复制 ✓`:`复制链接`),9,mS)]),i.warn?(B(),V(`p`,hS,M(i.warn),1)):K(`v-if`,!0)])])])):K(`v-if`,!0)]),_:1})}var _S=X(iS,[[`render`,gS],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/RemotePreview.vue`]]),vS={name:`AppToast`,computed:{toast(){return sp}}},yS={class:`apptoast__icon`},bS={class:`apptoast__icon-svg`,viewBox:`0 0 24 24`,"aria-hidden":`true`},xS={key:0,d:`M5 13l4 4L19 7`},SS={key:1,d:`M6 6l12 12M18 6L6 18`},CS={class:`apptoast__msg`};function wS(e,t,n,r,i,a){return B(),H(ic,{name:`apptoast-fade`},{default:Lr(()=>[a.toast.visible?(B(),V(`div`,{key:0,class:j([`apptoast`,`apptoast--`+a.toast.type]),role:`status`,"aria-live":`polite`},[U(`span`,yS,[(B(),V(`svg`,bS,[a.toast.type===`ok`?(B(),V(`path`,xS)):(B(),V(`path`,SS))]))]),U(`span`,CS,M(a.toast.message),1)],2)):K(`v-if`,!0)]),_:1})}var TS=X(vS,[[`render`,wS],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/AppToast.vue`]]),ES=nn({open:!1,index:0,items:[]});function DS(e,t=0){let n=Array.isArray(e)?e.filter(e=>e&&e.src):[];n.length&&(ES.items=n,ES.index=Math.max(0,Math.min(n.length-1,t|0)),ES.open=!0)}function OS(e){if(!ES.open)return;let t=ES.index+e;t<0||t>=ES.items.length||(ES.index=t)}function kS(){ES.open=!1}var AS=1.25,jS=.05,MS=16,NS={name:`ImageLightbox`,data(){return{STEP:AS,scale:1,tx:0,ty:0,natW:0,natH:0,loaded:!1,failed:!1,dragging:!1,fitScale:1,_pan:null,_prevFocus:null}},computed:{box(){return ES},current(){return this.box.items[this.box.index]||{src:``,alt:``,title:``}},displayName(){return(this.current.alt||this.current.title||``).split(/[\\/]/).pop()||`图片`},zoomLabel(){return`${Math.round(this.scale*100)}%`},atFit(){return Math.abs(this.scale-this.fitScale)<.001&&this.tx===0&&this.ty===0},imgStyle(){let e={transform:`translate(${this.tx}px, ${this.ty}px) scale(${this.scale})`};return this.natW&&this.natH&&(e.width=`${this.natW}px`,e.height=`${this.natH}px`),e}},watch:{"box.open"(e){e?(this._prevFocus=document.activeElement,this.resetView(),this.$nextTick(()=>this.$refs.rootEl?.focus())):this._prevFocus&&this._prevFocus.focus&&(this._prevFocus.focus(),this._prevFocus=null)},"box.index"(){this.resetView()}},mounted(){window.addEventListener(`resize`,this.onResize)},beforeUnmount(){window.removeEventListener(`resize`,this.onResize),this.stopPan()},methods:{resetView(){this.scale=1,this.fitScale=1,this.tx=0,this.ty=0,this.natW=0,this.natH=0,this.loaded=!1,this.failed=!1},onLoaded(e){let t=e.target;this.natW=t.naturalWidth||0,this.natH=t.naturalHeight||0,this.loaded=!0,this.fit()},fit(){let e=this.$refs.stageEl;if(!e||!this.natW||!this.natH)return;let t=Math.max(80,e.clientWidth-96),n=Math.max(80,e.clientHeight-96);this.fitScale=Math.min(t/this.natW,n/this.natH),this.scale=this.fitScale,this.tx=0,this.ty=0},toggleFit(){this.atFit?(this.scale=1,this.tx=0,this.ty=0):this.fit()},clampScale(e){return Math.max(jS,Math.min(MS,e))},zoomAt(e,t,n){let r=this.$refs.stageEl;if(!r)return;let i=this.clampScale(n),a=r.getBoundingClientRect(),o=e-a.left-a.width/2,s=t-a.top-a.height/2,c=i/this.scale;this.tx=o-(o-this.tx)*c,this.ty=s-(s-this.ty)*c,this.scale=i},zoomBy(e){let t=this.$refs.stageEl;if(!t)return;let n=t.getBoundingClientRect();this.zoomAt(n.left+n.width/2,n.top+n.height/2,this.scale*e)},onWheel(e){e.preventDefault();let t=Math.exp(-e.deltaY*(e.ctrlKey?.01:.0022));this.zoomAt(e.clientX,e.clientY,this.scale*t)},onPanStart(e){e.button!==0||this.failed||(e.preventDefault(),this.dragging=!0,this._pan={x:e.clientX,y:e.clientY,tx:this.tx,ty:this.ty,id:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),window.addEventListener(`pointermove`,this.onPanMove),window.addEventListener(`pointerup`,this.onPanEnd))},onPanMove(e){this._pan&&(this.tx=this._pan.tx+(e.clientX-this._pan.x),this.ty=this._pan.ty+(e.clientY-this._pan.y))},onPanEnd(){this.stopPan()},stopPan(){this.dragging=!1,this._pan=null,window.removeEventListener(`pointermove`,this.onPanMove),window.removeEventListener(`pointerup`,this.onPanEnd)},onResize(){this.box.open&&this.atFit&&this.fit()},onKey(e){let t=e.key;if(t===`Escape`){e.preventDefault(),this.close();return}if(t===`ArrowLeft`){e.preventDefault(),this.step(-1);return}if(t===`ArrowRight`){e.preventDefault(),this.step(1);return}if(t===`+`||t===`=`){e.preventDefault(),this.zoomBy(AS);return}if(t===`-`||t===`_`){e.preventDefault(),this.zoomBy(1/AS);return}if(t===`0`){e.preventDefault(),this.fit();return}t===`1`&&(e.preventDefault(),this.scale=1,this.tx=0,this.ty=0)},step(e){OS(e)},close(){kS()},openRaw(){this.current.src&&window.open(this.current.src,`_blank`,`noopener`)},async copyPath(){let e=await op(this.current.title||this.current.src);Z(e?`已复制图片路径`:`复制失败`,e?`ok`:`err`)}}},PS=[`title`],FS={class:`imgbox__name`},IS={key:0,class:`imgbox__count`},LS={key:1,class:`imgbox__dims`},RS={class:`imgbox__acts`},zS=[`title`],BS={key:0,class:`imgbox__fail`},VS=[`title`],HS=[`src`,`alt`],US={key:2,class:`imgbox__spin`,"aria-hidden":`true`};function WS(e,t,n,r,i,a){return B(),H(ai,{to:`body`},[W(ic,{name:`imgbox-fade`},{default:Lr(()=>[a.box.open?(B(),V(`div`,{key:0,ref:`rootEl`,class:`imgbox`,role:`dialog`,"aria-modal":`true`,"aria-label":`图片预览`,tabindex:`-1`,onKeydown:t[16]||=(...e)=>a.onKey&&a.onKey(...e),onClick:t[17]||=q((...e)=>a.close&&a.close(...e),[`self`])},[K(` 顶栏:左=图名与序号 / 右=工具 `),U(`header`,{class:`imgbox__bar`,onClick:t[7]||=q(()=>{},[`stop`])},[U(`span`,{class:`imgbox__meta`,title:a.current.title||a.current.alt},[U(`span`,FS,M(a.displayName),1),a.box.items.length>1?(B(),V(`span`,IS,M(a.box.index+1)+` / `+M(a.box.items.length),1)):K(`v-if`,!0),i.natW?(B(),V(`span`,LS,M(i.natW)+`×`+M(i.natH),1)):K(`v-if`,!0)],8,PS),U(`span`,RS,[U(`button`,{type:`button`,class:`imgbox__btn`,title:`缩小(-)`,onClick:t[0]||=e=>a.zoomBy(1/i.STEP)},[...t[18]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-zoom-out`})],-1)]]),U(`button`,{type:`button`,class:`imgbox__zoom`,title:a.atFit?`当前为适应窗口,点击恢复 1:1`:`点击恢复适应窗口`,onClick:t[1]||=(...e)=>a.toggleFit&&a.toggleFit(...e)},M(a.zoomLabel),9,zS),U(`button`,{type:`button`,class:`imgbox__btn`,title:`放大(+)`,onClick:t[2]||=e=>a.zoomBy(i.STEP)},[...t[19]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-zoom-in`})],-1)]]),t[24]||=U(`span`,{class:`imgbox__sep`},null,-1),U(`button`,{type:`button`,class:j([`imgbox__btn`,{"is-on":a.atFit}]),title:`适应窗口(0)`,onClick:t[3]||=(...e)=>a.fit&&a.fit(...e)},[...t[20]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-maximize`})],-1)]],2),U(`button`,{type:`button`,class:`imgbox__btn`,title:`复制图片路径`,onClick:t[4]||=(...e)=>a.copyPath&&a.copyPath(...e)},[...t[21]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-copy-sm`})],-1)]]),U(`button`,{type:`button`,class:`imgbox__btn`,title:`在新标签打开原图`,onClick:t[5]||=(...e)=>a.openRaw&&a.openRaw(...e)},[...t[22]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-external`})],-1)]]),t[25]||=U(`span`,{class:`imgbox__sep`},null,-1),U(`button`,{type:`button`,class:`imgbox__btn`,title:`关闭(Esc)`,onClick:t[6]||=(...e)=>a.close&&a.close(...e)},[...t[23]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-x`})],-1)]])])]),K(` 画布:图片居中,transform 承担缩放与平移 `),U(`div`,{ref:`stageEl`,class:`imgbox__stage`,onWheel:t[10]||=(...e)=>a.onWheel&&a.onWheel(...e),onPointerdown:t[11]||=(...e)=>a.onPanStart&&a.onPanStart(...e),onDblclick:t[12]||=(...e)=>a.toggleFit&&a.toggleFit(...e)},[i.failed?(B(),V(`div`,BS,[t[26]||=U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-alert-triangle`})],-1),t[27]||=U(`span`,null,`图片加载失败`,-1),U(`code`,{title:a.current.src},M(a.displayName),9,VS)])):(B(),V(`img`,{key:a.current.src,class:j([`imgbox__img`,{"is-dragging":i.dragging,"is-loading":!i.loaded}]),src:a.current.src,alt:a.current.alt||`预览图`,draggable:`false`,style:A(a.imgStyle),onLoad:t[8]||=(...e)=>a.onLoaded&&a.onLoaded(...e),onError:t[9]||=e=>i.failed=!0},null,46,HS)),!i.loaded&&!i.failed?(B(),V(`div`,US,[...t[28]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[U(`use`,{href:`#icon-loading`})],-1)]])):K(`v-if`,!0)],544),K(` 多张时的左右翻页 `),a.box.index>0?(B(),V(`button`,{key:0,type:`button`,class:`imgbox__nav imgbox__nav--prev`,title:`上一张(←)`,onClick:t[13]||=q(e=>a.step(-1),[`stop`])},[...t[29]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-chevron-right`})],-1)]])):K(`v-if`,!0),a.box.index<a.box.items.length-1?(B(),V(`button`,{key:1,type:`button`,class:`imgbox__nav imgbox__nav--next`,title:`下一张(→)`,onClick:t[14]||=q(e=>a.step(1),[`stop`])},[...t[30]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-chevron-right`})],-1)]])):K(`v-if`,!0),U(`footer`,{class:`imgbox__hint`,onClick:t[15]||=q(()=>{},[`stop`])},`滚轮缩放 · 拖拽平移 · 双击切换 1:1 · ←/→ 翻页 · Esc 关闭`)],544)):K(`v-if`,!0)]),_:1})])}var GS=X(NS,[[`render`,WS],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ImageLightbox.vue`]]),KS={name:`CardGallery`,components:{ConfirmDialog:_p},props:{visible:{type:Boolean,default:!1},cards:{type:Array,default:()=>[]},selectedId:{type:String,default:``}},emits:[`select`,`close`,`delete`],data(){return{query:``,sortByTime:this.loadSortByTime(),visibleIds:new Set,failed:new Set,observer:null,base:``,pendingDelete:null,placeholderUrl:gd}},created(){this.saveSortByTime()},computed:{filtered(){let e=this.query.trim().toLowerCase(),t=this.cards;return e&&(t=t.filter(t=>t.id.toLowerCase().includes(e)||String(t.name||``).toLowerCase().includes(e))),this.sortByTime?t.slice().sort((e,t)=>(t.mtime||0)-(e.mtime||0)):t.slice().sort((e,t)=>String(e.name||``).localeCompare(String(t.name||``)))}},watch:{visible(e){e?(this.query=``,this.failed=new Set,this.$nextTick(()=>{this.setupObserver(),this.focusSearch()}),window.addEventListener(`keydown`,this.onKey)):(this.teardownObserver(),window.removeEventListener(`keydown`,this.onKey))},query(){this.visible&&this.$nextTick(this.setupObserver)},sortByTime(e){this.saveSortByTime()}},beforeUnmount(){this.teardownObserver(),window.removeEventListener(`keydown`,this.onKey)},methods:{askDelete(e){this.pendingDelete=e},confirmDelete(){let e=this.pendingDelete;this.pendingDelete=null,e&&(this.visibleIds.delete(e.id),this.failed.delete(e.id),this.$emit(`delete`,e.id))},thumbUrl(e){return(this.base||Fl()||``)+`/__card-image/`+encodeURIComponent(e)},setupObserver(){this.base=Fl()||``;let e=this.$refs.grid;e&&(this.teardownObserver(),this.observer=new IntersectionObserver(e=>{for(let t of e){if(!t.isIntersecting)continue;let e=t.target.getAttribute(`data-id`);if(e&&!this.visibleIds.has(e)){let t=new Set(this.visibleIds);t.add(e),this.visibleIds=t}this.observer.unobserve(t.target)}},{root:e,rootMargin:`200px`}),e.querySelectorAll(`.cg-tile`).forEach(e=>this.observer.observe(e)))},teardownObserver(){this.observer&&=(this.observer.disconnect(),null)},onImgError(e){let t=new Set(this.failed);t.add(e),this.failed=t},loadSortByTime(){try{return localStorage.getItem(`cardbuddy:cardgallery-sort-by-time`)===`1`}catch{return!1}},saveSortByTime(){try{localStorage.setItem(`cardbuddy:cardgallery-sort-by-time`,this.sortByTime?`1`:`0`)}catch{}},toggleSort(){this.sortByTime=!this.sortByTime},onKey(e){e.key===`Escape`&&this.close()},focusSearch(){this.$refs.search&&this.$refs.search.focus()},choose(e){e&&(this.$emit(`select`,e.id),this.close())},close(){this.$emit(`close`)}}},qS={class:`cg-modal modal-card`,role:`dialog`,"aria-modal":`true`,"aria-label":`卡片网格预览`},JS={class:`cg-modal__head`},YS={class:`cg-modal__title`},XS={class:`cg-modal__count`},ZS={class:`cg-modal__search`},QS=[`title`,`aria-pressed`],$S={ref:`grid`,class:`cg-grid`},eC=[`data-id`,`onClick`],tC={class:`cg-tile__thumb`},nC={key:0,class:`cg-tile__tag`,title:`导入卡片(含 .import-meta.json 来源信息)`},rC=[`src`,`alt`,`onError`],iC={key:2,class:`cg-tile__skeleton`},aC=[`src`,`alt`],oC={class:`cg-tile__meta`},sC=[`title`],cC=[`title`],lC=[`title`,`aria-label`,`onClick`,`onKeydown`],uC={key:0,class:`cg-empty`};function dC(e,t,n,r,i,a){let o=L(`ConfirmDialog`);return B(),H(ic,{name:`modal`},{default:Lr(()=>[n.visible?(B(),V(`div`,{key:0,class:`cg-mask`,onClick:t[4]||=q((...e)=>a.close&&a.close(...e),[`self`])},[U(`div`,qS,[U(`header`,JS,[U(`div`,YS,[t[5]||=U(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-grid`})],-1),t[6]||=U(`span`,null,`卡片网格预览`,-1),U(`span`,XS,M(n.cards.length)+` 张本地卡片`,1)]),U(`div`,ZS,[t[7]||=U(`svg`,{class:`cg-modal__search-icon`,viewBox:`0 0 16 16`,width:`13`,height:`13`,"aria-hidden":`true`},[U(`use`,{href:`#icon-search`})],-1),I(U(`input`,{ref:`search`,"onUpdate:modelValue":t[0]||=e=>i.query=e,class:`cg-modal__input`,type:`text`,placeholder:`搜索卡片 ID / 名称…`},null,512),[[il,i.query]])]),U(`button`,{class:j([`cg-modal__sort`,{"cg-modal__sort--active":i.sortByTime}]),type:`button`,title:i.sortByTime?`已按修改时间排序(新→旧),点击取消`:`按修改时间排序(新→旧)`,"aria-pressed":i.sortByTime,onClick:t[1]||=(...e)=>a.toggleSort&&a.toggleSort(...e)},`按修改时间排序`,10,QS),U(`button`,{class:`cg-modal__close`,type:`button`,title:`关闭`,onClick:t[2]||=(...e)=>a.close&&a.close(...e),"aria-label":`关闭`},[...t[8]||=[U(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`}),U(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`})],-1)]])]),U(`div`,$S,[(B(!0),V(z,null,R(a.filtered,e=>(B(),V(`button`,{key:e.id,"data-id":e.id,type:`button`,class:j([`cg-tile`,{"cg-tile--active":e.id===n.selectedId,"cg-tile--failed":i.failed.has(e.id)}]),onClick:t=>a.choose(e)},[U(`div`,tC,[K(` 导入标记:仅含 .import-meta.json 侧车的卡(经远端同步导入)显示,悬浮于缩略图右上角 `),e.imported?(B(),V(`span`,nC,`导入`)):K(`v-if`,!0),i.visibleIds.has(e.id)&&!i.failed.has(e.id)?(B(),V(`img`,{key:1,class:`cg-tile__img`,src:a.thumbUrl(e.id),alt:e.name,loading:`lazy`,onError:t=>a.onImgError(e.id)},null,40,rC)):i.visibleIds.has(e.id)?(B(),V(z,{key:3},[K(` 无封面(空白新卡无位图、且空白卡跳过无头截图直接 404):
|
|
196
|
-
回退工程统一占位图(与 Image 组件兜底图同源),浅色底与缩略图区调性一致 `),
|
|
197
|
+
`);let l=b(n,r,o),d=new i(t.getSymbolSize(n));return m(d,n),h(d),g(d,n),v(d,r,0),n>=7&&_(d,n),y(d,l),isNaN(a)&&(a=s.getBestMask(d,v.bind(null,d,r))),s.applyMask(a,d),v(d,r,a),{modules:d,version:n,errorCorrectionLevel:r,maskPattern:a,segments:o}}e.create=function(e,r){if(e===void 0||e===``)throw Error(`No input text`);let i=n.M,a,o;return r!==void 0&&(i=n.from(r.errorCorrectionLevel,n.M),a=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),S(e,a,i,o)}})),AS=o((e=>{function t(e){if(typeof e==`number`&&(e=e.toString()),typeof e!=`string`)throw Error(`Color should be defined as hex string`);let t=e.slice().replace(`#`,``).split(``);if(t.length<3||t.length===5||t.length>8)throw Error(`Invalid hex color: `+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),t.length===6&&t.push(`F`,`F`);let n=parseInt(t.join(``),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:`#`+t.slice(0,6).join(``)}}e.getOptions=function(e){e||={},e.color||(e.color={});let n=e.margin===void 0||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:t(e.color.dark||`#000000ff`),light:t(e.color.light||`#ffffffff`)},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},e.getImageWidth=function(t,n){let r=e.getScale(t,n);return Math.floor((t+n.margin*2)*r)},e.qrToImageData=function(t,n,r){let i=n.modules.size,a=n.modules.data,o=e.getScale(i,r),s=Math.floor((i+r.margin*2)*o),c=r.margin*o,l=[r.color.light,r.color.dark];for(let e=0;e<s;e++)for(let n=0;n<s;n++){let u=(e*s+n)*4,d=r.color.light;if(e>=c&&n>=c&&e<s-c&&n<s-c){let t=Math.floor((e-c)/o),r=Math.floor((n-c)/o);d=l[+!!a[t*i+r]]}t[u++]=d.r,t[u++]=d.g,t[u++]=d.b,t[u]=d.a}}})),jS=o((e=>{var t=AS();function n(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||={},t.height=n,t.width=n,t.style.height=n+`px`,t.style.width=n+`px`}function r(){try{return document.createElement(`canvas`)}catch{throw Error(`You need to specify a canvas element`)}}e.render=function(e,i,a){let o=a,s=i;o===void 0&&(!i||!i.getContext)&&(o=i,i=void 0),i||(s=r()),o=t.getOptions(o);let c=t.getImageWidth(e.modules.size,o),l=s.getContext(`2d`),u=l.createImageData(c,c);return t.qrToImageData(u.data,e,o),n(l,s,c),l.putImageData(u,0,0),s},e.renderToDataURL=function(t,n,r){let i=r;i===void 0&&(!n||!n.getContext)&&(i=n,n=void 0),i||={};let a=e.render(t,n,i),o=i.type||`image/png`,s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}})),MS=o((e=>{var t=AS();function n(e,t){let n=e.a/255,r=t+`="`+e.hex+`"`;return n<1?r+` `+t+`-opacity="`+n.toFixed(2).slice(1)+`"`:r}function r(e,t,n){let r=e+t;return n!==void 0&&(r+=` `+n),r}function i(e,t,n){let i=``,a=0,o=!1,s=0;for(let c=0;c<e.length;c++){let l=Math.floor(c%t),u=Math.floor(c/t);!l&&!o&&(o=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(i+=o?r(`M`,l+n,.5+u+n):r(`m`,a,0),a=0,o=!1),l+1<t&&e[c+1]||(i+=r(`h`,s),s=0)):a++}return i}e.render=function(e,r,a){let o=t.getOptions(r),s=e.modules.size,c=e.modules.data,l=s+o.margin*2,u=o.color.light.a?`<path `+n(o.color.light,`fill`)+` d="M0 0h`+l+`v`+l+`H0z"/>`:``,d=`<path `+n(o.color.dark,`stroke`)+` d="`+i(c,s,o.margin)+`"/>`,f=`viewBox="0 0 `+l+` `+l+`"`,p=`<svg xmlns="http://www.w3.org/2000/svg" `+(o.width?`width="`+o.width+`" height="`+o.width+`" `:``)+f+` shape-rendering="crispEdges">`+u+d+`</svg>
|
|
198
|
+
`;return typeof a==`function`&&a(null,p),p}})),NS=c(o((e=>{var t=oS(),n=kS(),r=jS(),i=MS();function a(e,r,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l=typeof s[c-1]==`function`;if(!l&&!t())throw Error(`Callback required as last argument`);if(l){if(c<2)throw Error(`Too few arguments provided`);c===2?(o=i,i=r,r=a=void 0):c===3&&(r.getContext&&o===void 0?(o=a,a=void 0):(o=a,a=i,i=r,r=void 0))}else{if(c<1)throw Error(`Too few arguments provided`);return c===1?(i=r,r=a=void 0):c===2&&!r.getContext&&(a=i,i=r,r=void 0),new Promise(function(t,o){try{t(e(n.create(i,a),r,a))}catch(e){o(e)}})}try{let t=n.create(i,a);o(null,e(t,r,a))}catch(e){o(e)}}e.create=n.create,e.toCanvas=a.bind(null,r.render),e.toDataURL=a.bind(null,r.renderToDataURL),e.toString=a.bind(null,function(e,t,n){return i.render(e,n)})}))()),PS={name:`RemotePreview`,props:{visible:{type:Boolean,default:!1},pageId:{type:[String,Number],default:``},schema:{type:Object,default:null},cardCode:{type:String,default:``}},data(){return{qrDataUrl:``,url:``,loading:!1,publishing:!1,copied:!1,copyTimer:null,warn:``,code:``}},watch:{visible(e){e&&this.open()},pageId(){this.visible&&this.open()}},beforeUnmount(){this.copyTimer&&clearTimeout(this.copyTimer)},methods:{buildSocket(e){return`${`https://uat-pkg.finmall.com`.replace(/^https?:/,`wss:`)}/pmb-web/websocket/card/${e}`},fullUrl(e,t){let n=this.buildSocket(e);return`app://previewCard?cardId=${encodeURIComponent(e)}&cardCode=${encodeURIComponent(t||``)}&cardVersion=00000000&socket=${encodeURIComponent(n)}`},async makeQr(e){return NS.toDataURL(e,{width:220,margin:1,errorCorrectionLevel:`H`,color:{dark:`#10131a`,light:`#ffffff`}})},async open(){this.qrDataUrl=``,this.url=``,this.loading=!0,this.publishing=!1,this.copied=!1,this.warn=``,this.code=this.cardCode||``;let e=String(this.pageId||``).trim();if(!e){this.warn=`当前卡片缺少 pageId(远端卡片 id),无法生成预览二维码`,this.loading=!1;return}this.url=`app://previewCard?cardId=${encodeURIComponent(e)}`;try{this.qrDataUrl=await this.makeQr(this.url)}catch(e){this.warn=`二维码生成失败:`+(e&&e.message)}this.publishing=!0;try{let t=await q(`/__preview`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({schema:this.schema||{pageId:e}})}),n=await t.json().catch(()=>({}));if(!t.ok)throw Error(n.message||`preview failed`);n.cardCode!==void 0&&(this.code=n.cardCode),this.url=this.fullUrl(e,this.code),this.qrDataUrl=await this.makeQr(this.url)}catch(e){this.warn=`远端发布失败:`+(e&&e.message)}finally{this.publishing=!1,this.loading=!1}},async copyUrl(){if(this.url)try{if(navigator.clipboard&&navigator.clipboard.writeText)await navigator.clipboard.writeText(this.url);else{let e=document.createElement(`textarea`);e.value=this.url,e.style.position=`fixed`,e.style.opacity=`0`,document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e)}this.copied=!0,this.copyTimer&&clearTimeout(this.copyTimer),this.copyTimer=setTimeout(()=>{this.copied=!1},1500)}catch(e){this.warn=`复制失败:`+(e&&e.message)}}}},FS={class:`rp-card modal-card`,role:`dialog`,"aria-label":`远端预览二维码`},IS={class:`rp-head`},LS={class:`rp-body`},RS={class:`rp-qr-wrap`},zS=[`src`],BS={key:1,class:`rp-qr rp-qr--loading`},VS={key:2,class:`rp-qr-loading`},HS={class:`rp-url`},US={class:`rp-url-text`},WS=[`disabled`],GS={key:0,class:`rp-warn`};function KS(e,t,n,r,i,a){return z(),V(ac,{name:`modal`},{default:Rr(()=>[n.visible?(z(),B(`div`,{key:0,class:`rp-mask`,onClick:t[2]||=K(t=>e.$emit(`close`),[`self`])},[H(`div`,FS,[H(`div`,IS,[t[3]||=H(`span`,{class:`rp-title`},`远端预览(真机扫码)`,-1),H(`button`,{class:`rp-x`,type:`button`,onClick:t[0]||=t=>e.$emit(`close`),"aria-label":`关闭`},`×`)]),H(`div`,LS,[H(`div`,RS,[i.qrDataUrl?(z(),B(`img`,{key:0,src:i.qrDataUrl,class:A([`rp-qr`,{"rp-qr--blurred":i.publishing}]),alt:`preview qr`},null,10,zS)):(z(),B(`div`,BS,j(i.loading?`准备中…`:`—`),1)),i.publishing?(z(),B(`div`,VS,[...t[4]||=[H(`span`,{class:`rp-spinner`},null,-1),H(`span`,{class:`rp-loading-text`},`正在发布预览…`,-1)]])):G(`v-if`,!0)]),t[5]||=H(`p`,{class:`rp-tip`},`手机(FinMall App)扫一扫,真机查看当前卡片预览`,-1),H(`div`,HS,[H(`code`,US,j(i.url||`—`),1),H(`button`,{class:`rp-copy`,type:`button`,disabled:!i.url,onClick:t[1]||=(...e)=>a.copyUrl&&a.copyUrl(...e)},j(i.copied?`已复制 ✓`:`复制链接`),9,WS)]),i.warn?(z(),B(`p`,GS,j(i.warn),1)):G(`v-if`,!0)])])])):G(`v-if`,!0)]),_:1})}var qS=Y(PS,[[`render`,KS],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/RemotePreview.vue`]]),JS={name:`AppToast`,computed:{toast(){return cp}}},YS={class:`apptoast__icon`},XS={class:`apptoast__icon-svg`,viewBox:`0 0 24 24`,"aria-hidden":`true`},ZS={key:0,d:`M5 13l4 4L19 7`},QS={key:1,d:`M6 6l12 12M18 6L6 18`},$S={class:`apptoast__msg`};function eC(e,t,n,r,i,a){return z(),V(ac,{name:`apptoast-fade`},{default:Rr(()=>[a.toast.visible?(z(),B(`div`,{key:0,class:A([`apptoast`,`apptoast--`+a.toast.type]),role:`status`,"aria-live":`polite`},[H(`span`,YS,[(z(),B(`svg`,XS,[a.toast.type===`ok`?(z(),B(`path`,ZS)):(z(),B(`path`,QS))]))]),H(`span`,$S,j(a.toast.message),1)],2)):G(`v-if`,!0)]),_:1})}var tC=Y(JS,[[`render`,eC],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/AppToast.vue`]]),nC=rn({open:!1,index:0,items:[]});function rC(e,t=0){let n=Array.isArray(e)?e.filter(e=>e&&e.src):[];n.length&&(nC.items=n,nC.index=Math.max(0,Math.min(n.length-1,t|0)),nC.open=!0)}function iC(e){if(!nC.open)return;let t=nC.index+e;t<0||t>=nC.items.length||(nC.index=t)}function aC(){nC.open=!1}var oC=1.25,sC=.05,cC=16,lC={name:`ImageLightbox`,data(){return{STEP:oC,scale:1,tx:0,ty:0,natW:0,natH:0,loaded:!1,failed:!1,dragging:!1,fitScale:1,_pan:null,_prevFocus:null}},computed:{box(){return nC},current(){return this.box.items[this.box.index]||{src:``,alt:``,title:``}},displayName(){return(this.current.alt||this.current.title||``).split(/[\\/]/).pop()||`图片`},zoomLabel(){return`${Math.round(this.scale*100)}%`},atFit(){return Math.abs(this.scale-this.fitScale)<.001&&this.tx===0&&this.ty===0},imgStyle(){let e={transform:`translate(${this.tx}px, ${this.ty}px) scale(${this.scale})`};return this.natW&&this.natH&&(e.width=`${this.natW}px`,e.height=`${this.natH}px`),e}},watch:{"box.open"(e){e?(this._prevFocus=document.activeElement,this.resetView(),this.$nextTick(()=>this.$refs.rootEl?.focus())):this._prevFocus&&this._prevFocus.focus&&(this._prevFocus.focus(),this._prevFocus=null)},"box.index"(){this.resetView()}},mounted(){window.addEventListener(`resize`,this.onResize)},beforeUnmount(){window.removeEventListener(`resize`,this.onResize),this.stopPan()},methods:{resetView(){this.scale=1,this.fitScale=1,this.tx=0,this.ty=0,this.natW=0,this.natH=0,this.loaded=!1,this.failed=!1},onLoaded(e){let t=e.target;this.natW=t.naturalWidth||0,this.natH=t.naturalHeight||0,this.loaded=!0,this.fit()},fit(){let e=this.$refs.stageEl;if(!e||!this.natW||!this.natH)return;let t=Math.max(80,e.clientWidth-96),n=Math.max(80,e.clientHeight-96);this.fitScale=Math.min(t/this.natW,n/this.natH),this.scale=this.fitScale,this.tx=0,this.ty=0},toggleFit(){this.atFit?(this.scale=1,this.tx=0,this.ty=0):this.fit()},clampScale(e){return Math.max(sC,Math.min(cC,e))},zoomAt(e,t,n){let r=this.$refs.stageEl;if(!r)return;let i=this.clampScale(n),a=r.getBoundingClientRect(),o=e-a.left-a.width/2,s=t-a.top-a.height/2,c=i/this.scale;this.tx=o-(o-this.tx)*c,this.ty=s-(s-this.ty)*c,this.scale=i},zoomBy(e){let t=this.$refs.stageEl;if(!t)return;let n=t.getBoundingClientRect();this.zoomAt(n.left+n.width/2,n.top+n.height/2,this.scale*e)},onWheel(e){e.preventDefault();let t=Math.exp(-e.deltaY*(e.ctrlKey?.01:.0022));this.zoomAt(e.clientX,e.clientY,this.scale*t)},onPanStart(e){e.button!==0||this.failed||(e.preventDefault(),this.dragging=!0,this._pan={x:e.clientX,y:e.clientY,tx:this.tx,ty:this.ty,id:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),window.addEventListener(`pointermove`,this.onPanMove),window.addEventListener(`pointerup`,this.onPanEnd))},onPanMove(e){this._pan&&(this.tx=this._pan.tx+(e.clientX-this._pan.x),this.ty=this._pan.ty+(e.clientY-this._pan.y))},onPanEnd(){this.stopPan()},stopPan(){this.dragging=!1,this._pan=null,window.removeEventListener(`pointermove`,this.onPanMove),window.removeEventListener(`pointerup`,this.onPanEnd)},onResize(){this.box.open&&this.atFit&&this.fit()},onKey(e){let t=e.key;if(t===`Escape`){e.preventDefault(),this.close();return}if(t===`ArrowLeft`){e.preventDefault(),this.step(-1);return}if(t===`ArrowRight`){e.preventDefault(),this.step(1);return}if(t===`+`||t===`=`){e.preventDefault(),this.zoomBy(oC);return}if(t===`-`||t===`_`){e.preventDefault(),this.zoomBy(1/oC);return}if(t===`0`){e.preventDefault(),this.fit();return}t===`1`&&(e.preventDefault(),this.scale=1,this.tx=0,this.ty=0)},step(e){iC(e)},close(){aC()},openRaw(){this.current.src&&window.open(this.current.src,`_blank`,`noopener`)},async copyPath(){let e=await sp(this.current.title||this.current.src);X(e?`已复制图片路径`:`复制失败`,e?`ok`:`err`)}}},uC=[`title`],dC={class:`imgbox__name`},fC={key:0,class:`imgbox__count`},pC={key:1,class:`imgbox__dims`},mC={class:`imgbox__acts`},hC=[`title`],gC={key:0,class:`imgbox__fail`},_C=[`title`],vC=[`src`,`alt`],yC={key:2,class:`imgbox__spin`,"aria-hidden":`true`};function bC(e,t,n,r,i,a){return z(),V(oi,{to:`body`},[U(ac,{name:`imgbox-fade`},{default:Rr(()=>[a.box.open?(z(),B(`div`,{key:0,ref:`rootEl`,class:`imgbox`,role:`dialog`,"aria-modal":`true`,"aria-label":`图片预览`,tabindex:`-1`,onKeydown:t[16]||=(...e)=>a.onKey&&a.onKey(...e),onClick:t[17]||=K((...e)=>a.close&&a.close(...e),[`self`])},[G(` 顶栏:左=图名与序号 / 右=工具 `),H(`header`,{class:`imgbox__bar`,onClick:t[7]||=K(()=>{},[`stop`])},[H(`span`,{class:`imgbox__meta`,title:a.current.title||a.current.alt},[H(`span`,dC,j(a.displayName),1),a.box.items.length>1?(z(),B(`span`,fC,j(a.box.index+1)+` / `+j(a.box.items.length),1)):G(`v-if`,!0),i.natW?(z(),B(`span`,pC,j(i.natW)+`×`+j(i.natH),1)):G(`v-if`,!0)],8,uC),H(`span`,mC,[H(`button`,{type:`button`,class:`imgbox__btn`,title:`缩小(-)`,onClick:t[0]||=e=>a.zoomBy(1/i.STEP)},[...t[18]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-zoom-out`})],-1)]]),H(`button`,{type:`button`,class:`imgbox__zoom`,title:a.atFit?`当前为适应窗口,点击恢复 1:1`:`点击恢复适应窗口`,onClick:t[1]||=(...e)=>a.toggleFit&&a.toggleFit(...e)},j(a.zoomLabel),9,hC),H(`button`,{type:`button`,class:`imgbox__btn`,title:`放大(+)`,onClick:t[2]||=e=>a.zoomBy(i.STEP)},[...t[19]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-zoom-in`})],-1)]]),t[24]||=H(`span`,{class:`imgbox__sep`},null,-1),H(`button`,{type:`button`,class:A([`imgbox__btn`,{"is-on":a.atFit}]),title:`适应窗口(0)`,onClick:t[3]||=(...e)=>a.fit&&a.fit(...e)},[...t[20]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-maximize`})],-1)]],2),H(`button`,{type:`button`,class:`imgbox__btn`,title:`复制图片路径`,onClick:t[4]||=(...e)=>a.copyPath&&a.copyPath(...e)},[...t[21]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-copy-sm`})],-1)]]),H(`button`,{type:`button`,class:`imgbox__btn`,title:`在新标签打开原图`,onClick:t[5]||=(...e)=>a.openRaw&&a.openRaw(...e)},[...t[22]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-external`})],-1)]]),t[25]||=H(`span`,{class:`imgbox__sep`},null,-1),H(`button`,{type:`button`,class:`imgbox__btn`,title:`关闭(Esc)`,onClick:t[6]||=(...e)=>a.close&&a.close(...e)},[...t[23]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-x`})],-1)]])])]),G(` 画布:图片居中,transform 承担缩放与平移 `),H(`div`,{ref:`stageEl`,class:`imgbox__stage`,onWheel:t[10]||=(...e)=>a.onWheel&&a.onWheel(...e),onPointerdown:t[11]||=(...e)=>a.onPanStart&&a.onPanStart(...e),onDblclick:t[12]||=(...e)=>a.toggleFit&&a.toggleFit(...e)},[i.failed?(z(),B(`div`,gC,[t[26]||=H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-alert-triangle`})],-1),t[27]||=H(`span`,null,`图片加载失败`,-1),H(`code`,{title:a.current.src},j(a.displayName),9,_C)])):(z(),B(`img`,{key:a.current.src,class:A([`imgbox__img`,{"is-dragging":i.dragging,"is-loading":!i.loaded}]),src:a.current.src,alt:a.current.alt||`预览图`,draggable:`false`,style:k(a.imgStyle),onLoad:t[8]||=(...e)=>a.onLoaded&&a.onLoaded(...e),onError:t[9]||=e=>i.failed=!0},null,46,vC)),!i.loaded&&!i.failed?(z(),B(`div`,yC,[...t[28]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[H(`use`,{href:`#icon-loading`})],-1)]])):G(`v-if`,!0)],544),G(` 多张时的左右翻页 `),a.box.index>0?(z(),B(`button`,{key:0,type:`button`,class:`imgbox__nav imgbox__nav--prev`,title:`上一张(←)`,onClick:t[13]||=K(e=>a.step(-1),[`stop`])},[...t[29]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-chevron-right`})],-1)]])):G(`v-if`,!0),a.box.index<a.box.items.length-1?(z(),B(`button`,{key:1,type:`button`,class:`imgbox__nav imgbox__nav--next`,title:`下一张(→)`,onClick:t[14]||=K(e=>a.step(1),[`stop`])},[...t[30]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-chevron-right`})],-1)]])):G(`v-if`,!0),H(`footer`,{class:`imgbox__hint`,onClick:t[15]||=K(()=>{},[`stop`])},`滚轮缩放 · 拖拽平移 · 双击切换 1:1 · ←/→ 翻页 · Esc 关闭`)],544)):G(`v-if`,!0)]),_:1})])}var xC=Y(lC,[[`render`,bC],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ImageLightbox.vue`]]),SC={name:`CardGallery`,components:{ConfirmDialog:vp},props:{visible:{type:Boolean,default:!1},cards:{type:Array,default:()=>[]},selectedId:{type:String,default:``}},emits:[`select`,`close`,`delete`],data(){return{query:``,sortByTime:this.loadSortByTime(),visibleIds:new Set,failed:new Set,observer:null,base:``,pendingDelete:null,placeholderUrl:_d}},created(){this.saveSortByTime()},computed:{filtered(){let e=this.query.trim().toLowerCase(),t=this.cards;return e&&(t=t.filter(t=>t.id.toLowerCase().includes(e)||String(t.name||``).toLowerCase().includes(e))),this.sortByTime?t.slice().sort((e,t)=>(t.mtime||0)-(e.mtime||0)):t.slice().sort((e,t)=>String(e.name||``).localeCompare(String(t.name||``)))}},watch:{visible(e){e?(this.query=``,this.failed=new Set,this.$nextTick(()=>{this.setupObserver(),this.focusSearch()}),window.addEventListener(`keydown`,this.onKey)):(this.teardownObserver(),window.removeEventListener(`keydown`,this.onKey))},query(){this.visible&&this.$nextTick(this.setupObserver)},sortByTime(e){this.saveSortByTime()}},beforeUnmount(){this.teardownObserver(),window.removeEventListener(`keydown`,this.onKey)},methods:{askDelete(e){this.pendingDelete=e},confirmDelete(){let e=this.pendingDelete;this.pendingDelete=null,e&&(this.visibleIds.delete(e.id),this.failed.delete(e.id),this.$emit(`delete`,e.id))},thumbUrl(e){return(this.base||Il()||``)+`/__card-image/`+encodeURIComponent(e)},setupObserver(){this.base=Il()||``;let e=this.$refs.grid;e&&(this.teardownObserver(),this.observer=new IntersectionObserver(e=>{for(let t of e){if(!t.isIntersecting)continue;let e=t.target.getAttribute(`data-id`);if(e&&!this.visibleIds.has(e)){let t=new Set(this.visibleIds);t.add(e),this.visibleIds=t}this.observer.unobserve(t.target)}},{root:e,rootMargin:`200px`}),e.querySelectorAll(`.cg-tile`).forEach(e=>this.observer.observe(e)))},teardownObserver(){this.observer&&=(this.observer.disconnect(),null)},onImgError(e){let t=new Set(this.failed);t.add(e),this.failed=t},loadSortByTime(){try{return localStorage.getItem(`cardbuddy:cardgallery-sort-by-time`)===`1`}catch{return!1}},saveSortByTime(){try{localStorage.setItem(`cardbuddy:cardgallery-sort-by-time`,this.sortByTime?`1`:`0`)}catch{}},toggleSort(){this.sortByTime=!this.sortByTime},onKey(e){e.key===`Escape`&&this.close()},focusSearch(){this.$refs.search&&this.$refs.search.focus()},choose(e){e&&(this.$emit(`select`,e.id),this.close())},close(){this.$emit(`close`)}}},CC={class:`cg-modal modal-card`,role:`dialog`,"aria-modal":`true`,"aria-label":`卡片网格预览`},wC={class:`cg-modal__head`},TC={class:`cg-modal__title`},EC={class:`cg-modal__count`},DC={class:`cg-modal__search`},OC=[`title`,`aria-pressed`],kC={ref:`grid`,class:`cg-grid`},AC=[`data-id`,`onClick`],jC={class:`cg-tile__thumb`},MC={key:0,class:`cg-tile__tag`,title:`导入卡片(含 .import-meta.json 来源信息)`},NC=[`src`,`alt`,`onError`],PC={key:2,class:`cg-tile__skeleton`},FC=[`src`,`alt`],IC={class:`cg-tile__meta`},LC=[`title`],RC=[`title`],zC=[`title`,`aria-label`,`onClick`,`onKeydown`],BC={key:0,class:`cg-empty`};function VC(e,t,n,r,i,a){let o=I(`ConfirmDialog`);return z(),V(ac,{name:`modal`},{default:Rr(()=>[n.visible?(z(),B(`div`,{key:0,class:`cg-mask`,onClick:t[4]||=K((...e)=>a.close&&a.close(...e),[`self`])},[H(`div`,CC,[H(`header`,wC,[H(`div`,TC,[t[5]||=H(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-grid`})],-1),t[6]||=H(`span`,null,`卡片网格预览`,-1),H(`span`,EC,j(n.cards.length)+` 张本地卡片`,1)]),H(`div`,DC,[t[7]||=H(`svg`,{class:`cg-modal__search-icon`,viewBox:`0 0 16 16`,width:`13`,height:`13`,"aria-hidden":`true`},[H(`use`,{href:`#icon-search`})],-1),F(H(`input`,{ref:`search`,"onUpdate:modelValue":t[0]||=e=>i.query=e,class:`cg-modal__input`,type:`text`,placeholder:`搜索卡片 ID / 名称…`},null,512),[[al,i.query]])]),H(`button`,{class:A([`cg-modal__sort`,{"cg-modal__sort--active":i.sortByTime}]),type:`button`,title:i.sortByTime?`已按修改时间排序(新→旧),点击取消`:`按修改时间排序(新→旧)`,"aria-pressed":i.sortByTime,onClick:t[1]||=(...e)=>a.toggleSort&&a.toggleSort(...e)},`按修改时间排序`,10,OC),H(`button`,{class:`cg-modal__close`,type:`button`,title:`关闭`,onClick:t[2]||=(...e)=>a.close&&a.close(...e),"aria-label":`关闭`},[...t[8]||=[H(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`}),H(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`})],-1)]])]),H(`div`,kC,[(z(!0),B(R,null,L(a.filtered,e=>(z(),B(`button`,{key:e.id,"data-id":e.id,type:`button`,class:A([`cg-tile`,{"cg-tile--active":e.id===n.selectedId,"cg-tile--failed":i.failed.has(e.id)}]),onClick:t=>a.choose(e)},[H(`div`,jC,[G(` 导入标记:仅含 .import-meta.json 侧车的卡(经远端同步导入)显示,悬浮于缩略图右上角 `),e.imported?(z(),B(`span`,MC,`导入`)):G(`v-if`,!0),i.visibleIds.has(e.id)&&!i.failed.has(e.id)?(z(),B(`img`,{key:1,class:`cg-tile__img`,src:a.thumbUrl(e.id),alt:e.name,loading:`lazy`,onError:t=>a.onImgError(e.id)},null,40,NC)):i.visibleIds.has(e.id)?(z(),B(R,{key:3},[G(` 无封面(空白新卡无位图、且空白卡跳过无头截图直接 404):
|
|
199
|
+
回退工程统一占位图(与 Image 组件兜底图同源),浅色底与缩略图区调性一致 `),H(`img`,{class:`cg-tile__img cg-tile__img--placeholder`,src:i.placeholderUrl,alt:`暂无封面:${e.name}`},null,8,FC)],2112)):(z(),B(`div`,PC,`预览加载中…`))]),H(`div`,IC,[H(`span`,{class:`cg-tile__name`,title:e.name},j(e.name),9,LC),H(`span`,{class:`cg-tile__id`,title:e.id},j(e.id),9,RC)]),G(` 删除钮:仅图标不带文字,悬浮于格子右下角。格子本身是 button,
|
|
197
200
|
这里用 span + role=button 避免 button 套 button 的非法结构;
|
|
198
|
-
click.stop 阻止冒泡到格子的「选中载入」。 `),U(`span`,{class:`cg-tile__del`,role:`button`,tabindex:`0`,title:`删除本地卡片 ${e.id}`,"aria-label":`删除本地卡片 ${e.id}`,onClick:q(t=>a.askDelete(e),[`stop`]),onKeydown:[vl(q(t=>a.askDelete(e),[`stop`,`prevent`]),[`enter`]),vl(q(t=>a.askDelete(e),[`stop`,`prevent`]),[`space`])]},[...t[9]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-trash`})],-1)]],40,lC)],10,eC))),128)),a.filtered.length?K(`v-if`,!0):(B(),V(`p`,uC,`无匹配卡片`))],512)]),K(` 删除确认:警告级(橙黄 + 三角图标);删除本地目录不可逆,文案明示影响范围 `),W(o,{visible:i.pendingDelete!=null,title:`删除卡片`,message:i.pendingDelete?`将删除本地卡片目录 src/cards/${i.pendingDelete.id}/(schema / 切图 / 预览图一并删除),不可恢复。确定删除「${i.pendingDelete.name}」吗?`:``,"confirm-text":`删除`,severity:`warn`,onConfirm:a.confirmDelete,onCancel:t[3]||=e=>i.pendingDelete=null},null,8,[`visible`,`message`,`onConfirm`])])):K(`v-if`,!0)]),_:1})}var fC=X(KS,[[`render`,dC],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/CardGallery.vue`]]),pC=/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/,mC={name:`NewCardDialog`,props:{visible:{type:Boolean,default:!1},mode:{type:String,default:`create`},cardId:{type:String,default:``},cardDesc:{type:String,default:``},existingIds:{type:Array,default:()=>[]}},emits:[`close`,`created`,`renamed`],data(){return{id:``,desc:``,error:``,busy:!1}},computed:{isRename(){return this.mode===`rename`},title(){return this.isRename?`卡片重命名`:`新增空白卡片`},submitLabel(){return this.isRename?`保存`:`创建`},busyLabel(){return this.isRename?`保存中…`:`创建中…`},tip(){return this.isRename?`保存后重命名卡片目录并重载卡片`:`创建后写入 src/cards/<id>/ 空骨架,并切换到新卡`},dupId(){let e=this.id.trim();return!e||this.isRename&&e===this.cardId?``:this.existingIds.find(t=>t===e)||``}},watch:{visible(e){e&&this.resetFields()},mode(){this.visible&&this.resetFields()}},methods:{resetFields(){this.error=``,this.busy=!1,this.isRename?(this.id=this.cardId||``,this.desc=this.cardDesc||``):(this.id=``,this.desc=``)},validate(){let e=this.id.trim(),t=this.desc.trim();return e?pC.test(e)?this.dupId?`卡片 ID 已存在:本地已有「${this.dupId}」,换一个 ID`:t.length>200?`卡片描述过长(≤200 字)`:``:`卡片 ID 只能以字母/数字开头,含字母/数字/_/-(≤64 字符)`:`卡片 ID 必填`},async submit(){if(this.busy)return;let e=this.validate();if(e){this.error=e;return}this.busy=!0,this.error=``;let t=this.id.trim(),n=this.desc.trim();try{if(this.isRename){let e=await J(`/__card/${encodeURIComponent(this.cardId)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:t,desc:n})}),r=await e.json().catch(()=>null);if(!e.ok)throw Error(r&&(r.message||r.error)||`HTTP ${e.status}`);this.$emit(`renamed`,{oldId:this.cardId,id:r&&r.id||t})}else{let e=await J(`/__cards`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:t,desc:n})}),r=await e.json().catch(()=>null);if(!e.ok)throw Error(r&&(r.message||r.error)||`HTTP ${e.status}`);this.$emit(`created`,t)}}catch(e){this.error=`${this.isRename?`保存`:`创建`}失败:${e.message}`}finally{this.busy=!1}}}},hC=[`aria-label`],gC={class:`ni-head`},_C={class:`ni-title`},vC={class:`ni-body`},yC={class:`ni-scroll`},bC={class:`ni-field-row`},xC=[`placeholder`,`aria-invalid`,`disabled`],SC={class:`ni-field-row`},CC=[`disabled`],wC={key:0,class:`newcard-dlg__err`,role:`alert`},TC={key:1,class:`newcard-dlg__err`,role:`alert`},EC={class:`ni-foot`},DC={class:`ni-tip`},OC={class:`ni-foot-btns`},kC=[`disabled`],AC=[`disabled`];function jC(e,t,n,r,i,a){return B(),H(ic,{name:`modal`},{default:Lr(()=>[n.visible?(B(),V(`div`,{key:0,class:`ni-overlay`,onClick:t[7]||=q(t=>e.$emit(`close`),[`self`])},[U(`div`,{class:`ni-panel modal-card newcard-dlg`,role:`alertdialog`,"aria-modal":`true`,"aria-label":a.title},[U(`div`,gC,[U(`span`,_C,M(a.title),1),U(`button`,{class:`ni-close`,type:`button`,title:`关闭`,onClick:t[0]||=t=>e.$emit(`close`)})]),U(`div`,vC,[U(`div`,yC,[U(`div`,bC,[t[8]||=U(`label`,{class:`ni-field-label`},[U(`i`,null,`*`),G(`卡片 ID`)],-1),I(U(`input`,{class:j([`ni-input`,{"newcard-dlg__input--dup":!!a.dupId}]),type:`text`,"onUpdate:modelValue":t[1]||=e=>i.id=e,placeholder:a.isRename?`英文标识,改名即重命名卡片目录(字母/数字/_/-)`:`英文标识,如 myNewCard(字母/数字/_/-)`,"aria-invalid":a.dupId?`true`:null,disabled:i.busy,onKeydown:t[2]||=vl((...e)=>a.submit&&a.submit(...e),[`enter`])},null,42,xC),[[il,i.id]])]),U(`div`,SC,[t[9]||=U(`label`,{class:`ni-field-label`},`卡片描述`,-1),I(U(`input`,{class:`ni-input`,type:`text`,"onUpdate:modelValue":t[3]||=e=>i.desc=e,placeholder:`选填,卡片用途简述;留空则用卡片 ID 作显示名`,disabled:i.busy,onKeydown:t[4]||=vl((...e)=>a.submit&&a.submit(...e),[`enter`])},null,40,CC),[[il,i.desc]])]),a.dupId?(B(),V(`p`,wC,`卡片 ID 已存在:本地已有「`+M(a.dupId)+`」,换一个 ID`,1)):i.error?(B(),V(`p`,TC,M(i.error),1)):K(`v-if`,!0)])]),U(`div`,EC,[U(`span`,DC,M(a.tip),1),U(`div`,OC,[U(`button`,{class:`ni-btn ni-btn--ghost`,type:`button`,disabled:i.busy,onClick:t[5]||=t=>e.$emit(`close`)},`取消`,8,kC),U(`button`,{class:`ni-btn`,type:`button`,disabled:i.busy||!!a.dupId,onClick:t[6]||=(...e)=>a.submit&&a.submit(...e)},M(i.busy?a.busyLabel:a.submitLabel),9,AC)])])],8,hC)])):K(`v-if`,!0)]),_:1})}var MC=X(mC,[[`render`,jC],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/NewCardDialog.vue`]]),NC=[`Row`,`Column`,`MultiColumn`,`ListLayout`,`GridLayout`,`AbsoluteLayout`,`ViewContainer`,`Text`,`Button`,`Image`,`Icon`,`MultiText`,`Canvas`,`Input`,`CheckGroup`,`RadioButton`,`ProgressSlider`,`Video`,`Map`,`Divider`];function PC(){let e=fu.groups&&fu.groups.length?fu.groups:[`布局组件`,`基础组件`],t={},n=fu.components||{};for(let e in n){let r=n[e],i=r.group||`基础组件`;t[i]||(t[i]=[]);let a=r.name||e;t[i].push({className:e,name:a,glyph:e})}return e.filter(e=>t[e]&&t[e].length).map(e=>({key:e,items:t[e]}))}var FC={name:`ComponentPalette`,emits:[`pick`,`close`],data(){return{groups:PC(),query:``}},computed:{filteredGroups(){let e=(this.query||``).trim().toLowerCase();return e?this.groups.map(t=>({key:t.key,items:t.items.filter(t=>{let n=(t.name||``).toLowerCase(),r=(t.className||``).toLowerCase();return n.indexOf(e)!==-1||r.indexOf(e)!==-1})})).filter(e=>e.items.length):this.groups}},methods:{iconSvg(e){return NC.indexOf(e)===-1?`<span class="cp__avatar-text">`+String(e).slice(0,1)+`</span>`:`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="18" height="18"><use href="#icon-glyph-`+e+`"></use></svg>`}}},IC={class:`cp modal-card`,role:`dialog`,"aria-label":`选择组件类型`},LC={class:`cp__head`},RC={class:`cp__body`},zC={class:`cp__group-title`},BC={class:`cp__grid`},VC=[`title`,`onClick`],HC=[`data-g`,`innerHTML`],UC={class:`cp__item-name`},WC={class:`cp__item-class`},GC={key:0,class:`cp__empty`};function KC(e,t,n,r,i,a){return B(),V(`div`,{class:`cp__mask`,onClick:t[2]||=q(t=>e.$emit(`close`),[`self`])},[U(`div`,IC,[U(`div`,LC,[t[3]||=U(`span`,{class:`cp__title`},`添加组件`,-1),t[4]||=U(`span`,{class:`cp__hint`},`选择要插入的组件类型`,-1),U(`button`,{class:`cp__close`,type:`button`,title:`关闭`,onClick:t[0]||=t=>e.$emit(`close`)},`✕`)]),U(`div`,RC,[I(U(`input`,{class:`cp__search`,type:`text`,"onUpdate:modelValue":t[1]||=e=>i.query=e,placeholder:`搜索组件…`,title:`按组件名 / 类型过滤`},null,512),[[il,i.query]]),(B(!0),V(z,null,R(a.filteredGroups,t=>(B(),V(`section`,{key:t.key,class:`cp__group`},[U(`h4`,zC,M(t.key),1),U(`div`,BC,[(B(!0),V(z,null,R(t.items,n=>(B(),V(`button`,{key:n.className,class:`cp__item`,type:`button`,title:n.className,onClick:t=>e.$emit(`pick`,n.className)},[U(`span`,{class:`cp__avatar`,"data-g":t.key===`布局组件`?`layout`:`basic`,innerHTML:a.iconSvg(n.glyph)},null,8,HC),U(`span`,UC,M(n.name),1),U(`span`,WC,M(n.className),1)],8,VC))),128))])]))),128)),i.query&&!a.filteredGroups.length?(B(),V(`p`,GC,`无匹配组件`)):K(`v-if`,!0)])])])}var qC=X(FC,[[`render`,KC],[`__scopeId`,`data-v-88e70dcf`],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ComponentPalette.vue`]]),JC={name:`Switch`,props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:[`update:modelValue`],methods:{onClick(){this.disabled||this.$emit(`update:modelValue`,!this.modelValue)}}},YC=[`aria-checked`,`disabled`];function XC(e,t,n,r,i,a){return B(),V(`button`,{type:`button`,class:j([`switch`,{"switch--on":n.modelValue,"switch--disabled":n.disabled}]),role:`switch`,"aria-checked":String(n.modelValue),disabled:n.disabled,onClick:t[0]||=(...e)=>a.onClick&&a.onClick(...e)},[...t[1]||=[U(`span`,{class:`switch__track`},[U(`span`,{class:`switch__thumb`})],-1)]],10,YC)}var ZC=X(JC,[[`render`,XC],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Switch.vue`]]);function QC(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var $C=QC();function ew(e){$C=e}var tw={exec:()=>null};function nw(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Q(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(iw.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var rw=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),iw={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:nw(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:nw(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:nw(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:nw(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:nw(e=>RegExp(`^ {0,${e}}(?:</?(?:${yw})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:nw(e=>RegExp(`^ {0,${e}}>`))},aw=/^(?:[ \t]*(?:\n|$))+/,ow=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,sw=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,cw=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,lw=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,uw=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,dw=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,fw=Q(dw).replace(/bull/g,uw).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),pw=Q(dw).replace(/bull/g,uw).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),mw=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,hw=/^[^\n]+/,gw=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,_w=Q(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,gw).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),vw=Q(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,uw).getRegex(),yw=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,bw=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,xw=Q(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,bw).replace(`tag`,yw).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Sw=e=>Q(mw).replace(`hr`,cw).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,yw).getRegex(),Cw=Sw(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ww=Sw(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Tw={blockquote:Q(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,ww).getRegex(),code:ow,def:_w,fences:sw,heading:lw,hr:cw,html:xw,lheading:fw,list:vw,newline:aw,paragraph:Cw,table:tw,text:hw},Ew=Q(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,cw).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,yw).getRegex(),Dw={...Tw,lheading:pw,table:Ew,paragraph:Q(mw).replace(`hr`,cw).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Ew).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,yw).getRegex()},Ow={...Tw,html:Q(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,bw).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:tw,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Q(mw).replace(`hr`,cw).replace(`heading`,` *#{1,6} *[^
|
|
199
|
-
]`).replace(`lheading`,
|
|
200
|
-
`),n=t.length-1;for(;n>=0&&
|
|
201
|
-
`)}function
|
|
201
|
+
click.stop 阻止冒泡到格子的「选中载入」。 `),H(`span`,{class:`cg-tile__del`,role:`button`,tabindex:`0`,title:`删除本地卡片 ${e.id}`,"aria-label":`删除本地卡片 ${e.id}`,onClick:K(t=>a.askDelete(e),[`stop`]),onKeydown:[yl(K(t=>a.askDelete(e),[`stop`,`prevent`]),[`enter`]),yl(K(t=>a.askDelete(e),[`stop`,`prevent`]),[`space`])]},[...t[9]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-trash`})],-1)]],40,zC)],10,AC))),128)),a.filtered.length?G(`v-if`,!0):(z(),B(`p`,BC,`无匹配卡片`))],512)]),G(` 删除确认:警告级(橙黄 + 三角图标);删除本地目录不可逆,文案明示影响范围 `),U(o,{visible:i.pendingDelete!=null,title:`删除卡片`,message:i.pendingDelete?`将删除本地卡片目录 src/cards/${i.pendingDelete.id}/(schema / 切图 / 预览图一并删除),不可恢复。确定删除「${i.pendingDelete.name}」吗?`:``,"confirm-text":`删除`,severity:`warn`,onConfirm:a.confirmDelete,onCancel:t[3]||=e=>i.pendingDelete=null},null,8,[`visible`,`message`,`onConfirm`])])):G(`v-if`,!0)]),_:1})}var HC=Y(SC,[[`render`,VC],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/CardGallery.vue`]]),UC=/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/,WC={name:`NewCardDialog`,props:{visible:{type:Boolean,default:!1},mode:{type:String,default:`create`},cardId:{type:String,default:``},cardDesc:{type:String,default:``},existingIds:{type:Array,default:()=>[]}},emits:[`close`,`created`,`renamed`],data(){return{id:``,desc:``,error:``,busy:!1}},computed:{isRename(){return this.mode===`rename`},title(){return this.isRename?`卡片重命名`:`新增空白卡片`},submitLabel(){return this.isRename?`保存`:`创建`},busyLabel(){return this.isRename?`保存中…`:`创建中…`},tip(){return this.isRename?`保存后重命名卡片目录并重载卡片`:`创建后写入 src/cards/<id>/ 空骨架,并切换到新卡`},dupId(){let e=this.id.trim();return!e||this.isRename&&e===this.cardId?``:this.existingIds.find(t=>t===e)||``}},watch:{visible(e){e&&this.resetFields()},mode(){this.visible&&this.resetFields()}},methods:{resetFields(){this.error=``,this.busy=!1,this.isRename?(this.id=this.cardId||``,this.desc=this.cardDesc||``):(this.id=``,this.desc=``)},validate(){let e=this.id.trim(),t=this.desc.trim();return e?UC.test(e)?this.dupId?`卡片 ID 已存在:本地已有「${this.dupId}」,换一个 ID`:t.length>200?`卡片描述过长(≤200 字)`:``:`卡片 ID 只能以字母/数字开头,含字母/数字/_/-(≤64 字符)`:`卡片 ID 必填`},async submit(){if(this.busy)return;let e=this.validate();if(e){this.error=e;return}this.busy=!0,this.error=``;let t=this.id.trim(),n=this.desc.trim();try{if(this.isRename){let e=await q(`/__card/${encodeURIComponent(this.cardId)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:t,desc:n})}),r=await e.json().catch(()=>null);if(!e.ok)throw Error(r&&(r.message||r.error)||`HTTP ${e.status}`);this.$emit(`renamed`,{oldId:this.cardId,id:r&&r.id||t})}else{let e=await q(`/__cards`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:t,desc:n})}),r=await e.json().catch(()=>null);if(!e.ok)throw Error(r&&(r.message||r.error)||`HTTP ${e.status}`);this.$emit(`created`,t)}}catch(e){this.error=`${this.isRename?`保存`:`创建`}失败:${e.message}`}finally{this.busy=!1}}}},GC=[`aria-label`],KC={class:`ni-head`},qC={class:`ni-title`},JC={class:`ni-body`},YC={class:`ni-scroll`},XC={class:`ni-field-row`},ZC=[`placeholder`,`aria-invalid`,`disabled`],QC={class:`ni-field-row`},$C=[`disabled`],ew={key:0,class:`newcard-dlg__err`,role:`alert`},tw={key:1,class:`newcard-dlg__err`,role:`alert`},nw={class:`ni-foot`},rw={class:`ni-tip`},iw={class:`ni-foot-btns`},aw=[`disabled`],ow=[`disabled`];function sw(e,t,n,r,i,a){return z(),V(ac,{name:`modal`},{default:Rr(()=>[n.visible?(z(),B(`div`,{key:0,class:`ni-overlay`,onClick:t[7]||=K(t=>e.$emit(`close`),[`self`])},[H(`div`,{class:`ni-panel modal-card newcard-dlg`,role:`alertdialog`,"aria-modal":`true`,"aria-label":a.title},[H(`div`,KC,[H(`span`,qC,j(a.title),1),H(`button`,{class:`ni-close`,type:`button`,title:`关闭`,onClick:t[0]||=t=>e.$emit(`close`)})]),H(`div`,JC,[H(`div`,YC,[H(`div`,XC,[t[8]||=H(`label`,{class:`ni-field-label`},[H(`i`,null,`*`),W(`卡片 ID`)],-1),F(H(`input`,{class:A([`ni-input`,{"newcard-dlg__input--dup":!!a.dupId}]),type:`text`,"onUpdate:modelValue":t[1]||=e=>i.id=e,placeholder:a.isRename?`英文标识,改名即重命名卡片目录(字母/数字/_/-)`:`英文标识,如 myNewCard(字母/数字/_/-)`,"aria-invalid":a.dupId?`true`:null,disabled:i.busy,onKeydown:t[2]||=yl((...e)=>a.submit&&a.submit(...e),[`enter`])},null,42,ZC),[[al,i.id]])]),H(`div`,QC,[t[9]||=H(`label`,{class:`ni-field-label`},`卡片描述`,-1),F(H(`input`,{class:`ni-input`,type:`text`,"onUpdate:modelValue":t[3]||=e=>i.desc=e,placeholder:`选填,卡片用途简述;留空则用卡片 ID 作显示名`,disabled:i.busy,onKeydown:t[4]||=yl((...e)=>a.submit&&a.submit(...e),[`enter`])},null,40,$C),[[al,i.desc]])]),a.dupId?(z(),B(`p`,ew,`卡片 ID 已存在:本地已有「`+j(a.dupId)+`」,换一个 ID`,1)):i.error?(z(),B(`p`,tw,j(i.error),1)):G(`v-if`,!0)])]),H(`div`,nw,[H(`span`,rw,j(a.tip),1),H(`div`,iw,[H(`button`,{class:`ni-btn ni-btn--ghost`,type:`button`,disabled:i.busy,onClick:t[5]||=t=>e.$emit(`close`)},`取消`,8,aw),H(`button`,{class:`ni-btn`,type:`button`,disabled:i.busy||!!a.dupId,onClick:t[6]||=(...e)=>a.submit&&a.submit(...e)},j(i.busy?a.busyLabel:a.submitLabel),9,ow)])])],8,GC)])):G(`v-if`,!0)]),_:1})}var cw=Y(WC,[[`render`,sw],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/NewCardDialog.vue`]]),lw=[`Row`,`Column`,`MultiColumn`,`ListLayout`,`GridLayout`,`AbsoluteLayout`,`ViewContainer`,`Text`,`Button`,`Image`,`Icon`,`MultiText`,`Canvas`,`Input`,`CheckGroup`,`RadioButton`,`ProgressSlider`,`Video`,`Map`,`Divider`];function uw(){let e=pu.groups&&pu.groups.length?pu.groups:[`布局组件`,`基础组件`],t={},n=pu.components||{};for(let e in n){let r=n[e],i=r.group||`基础组件`;t[i]||(t[i]=[]);let a=r.name||e;t[i].push({className:e,name:a,glyph:e})}return e.filter(e=>t[e]&&t[e].length).map(e=>({key:e,items:t[e]}))}var dw={name:`ComponentPalette`,emits:[`pick`,`close`],data(){return{groups:uw(),query:``}},computed:{filteredGroups(){let e=(this.query||``).trim().toLowerCase();return e?this.groups.map(t=>({key:t.key,items:t.items.filter(t=>{let n=(t.name||``).toLowerCase(),r=(t.className||``).toLowerCase();return n.indexOf(e)!==-1||r.indexOf(e)!==-1})})).filter(e=>e.items.length):this.groups}},methods:{iconSvg(e){return lw.indexOf(e)===-1?`<span class="cp__avatar-text">`+String(e).slice(0,1)+`</span>`:`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="18" height="18"><use href="#icon-glyph-`+e+`"></use></svg>`}}},fw={class:`cp modal-card`,role:`dialog`,"aria-label":`选择组件类型`},pw={class:`cp__head`},mw={class:`cp__body`},hw={class:`cp__group-title`},gw={class:`cp__grid`},_w=[`title`,`onClick`],vw=[`data-g`,`innerHTML`],yw={class:`cp__item-name`},bw={class:`cp__item-class`},xw={key:0,class:`cp__empty`};function Sw(e,t,n,r,i,a){return z(),B(`div`,{class:`cp__mask`,onClick:t[2]||=K(t=>e.$emit(`close`),[`self`])},[H(`div`,fw,[H(`div`,pw,[t[3]||=H(`span`,{class:`cp__title`},`添加组件`,-1),t[4]||=H(`span`,{class:`cp__hint`},`选择要插入的组件类型`,-1),H(`button`,{class:`cp__close`,type:`button`,title:`关闭`,onClick:t[0]||=t=>e.$emit(`close`)},`✕`)]),H(`div`,mw,[F(H(`input`,{class:`cp__search`,type:`text`,"onUpdate:modelValue":t[1]||=e=>i.query=e,placeholder:`搜索组件…`,title:`按组件名 / 类型过滤`},null,512),[[al,i.query]]),(z(!0),B(R,null,L(a.filteredGroups,t=>(z(),B(`section`,{key:t.key,class:`cp__group`},[H(`h4`,hw,j(t.key),1),H(`div`,gw,[(z(!0),B(R,null,L(t.items,n=>(z(),B(`button`,{key:n.className,class:`cp__item`,type:`button`,title:n.className,onClick:t=>e.$emit(`pick`,n.className)},[H(`span`,{class:`cp__avatar`,"data-g":t.key===`布局组件`?`layout`:`basic`,innerHTML:a.iconSvg(n.glyph)},null,8,vw),H(`span`,yw,j(n.name),1),H(`span`,bw,j(n.className),1)],8,_w))),128))])]))),128)),i.query&&!a.filteredGroups.length?(z(),B(`p`,xw,`无匹配组件`)):G(`v-if`,!0)])])])}var Cw=Y(dw,[[`render`,Sw],[`__scopeId`,`data-v-88e70dcf`],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ComponentPalette.vue`]]),ww={name:`Switch`,props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:[`update:modelValue`],methods:{onClick(){this.disabled||this.$emit(`update:modelValue`,!this.modelValue)}}},Tw=[`aria-checked`,`disabled`];function Ew(e,t,n,r,i,a){return z(),B(`button`,{type:`button`,class:A([`switch`,{"switch--on":n.modelValue,"switch--disabled":n.disabled}]),role:`switch`,"aria-checked":String(n.modelValue),disabled:n.disabled,onClick:t[0]||=(...e)=>a.onClick&&a.onClick(...e)},[...t[1]||=[H(`span`,{class:`switch__track`},[H(`span`,{class:`switch__thumb`})],-1)]],10,Tw)}var Dw=Y(ww,[[`render`,Ew],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/Switch.vue`]]);function Ow(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var kw=Ow();function Aw(e){kw=e}var jw={exec:()=>null};function Mw(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Z(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Pw.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Nw=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),Pw={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Mw(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Mw(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Mw(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Mw(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Mw(e=>RegExp(`^ {0,${e}}(?:</?(?:${Yw})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:Mw(e=>RegExp(`^ {0,${e}}>`))},Fw=/^(?:[ \t]*(?:\n|$))+/,Iw=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Lw=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Rw=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,zw=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Bw=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Vw=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Hw=Z(Vw).replace(/bull/g,Bw).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Uw=Z(Vw).replace(/bull/g,Bw).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ww=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Gw=/^[^\n]+/,Kw=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,qw=Z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Kw).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Jw=Z(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Bw).getRegex(),Yw=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Xw=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Zw=Z(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Xw).replace(`tag`,Yw).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Qw=e=>Z(Ww).replace(`hr`,Rw).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Yw).getRegex(),$w=Qw(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),eT=Qw(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),tT={blockquote:Z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,eT).getRegex(),code:Iw,def:qw,fences:Lw,heading:zw,hr:Rw,html:Zw,lheading:Hw,list:Jw,newline:Fw,paragraph:$w,table:jw,text:Gw},nT=Z(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Rw).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Yw).getRegex(),rT={...tT,lheading:Uw,table:nT,paragraph:Z(Ww).replace(`hr`,Rw).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,nT).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Yw).getRegex()},iT={...tT,html:Z(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Xw).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:jw,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Z(Ww).replace(`hr`,Rw).replace(`heading`,` *#{1,6} *[^
|
|
202
|
+
]`).replace(`lheading`,Hw).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},aT=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,oT=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,sT=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,cT=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,lT=/[\p{P}\p{S}]/u,uT=/[\s\p{P}\p{S}]/u,dT=/[^\s\p{P}\p{S}]/u,fT=Z(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,uT).getRegex(),pT=/[\p{Pi}\p{Ps}"']/u,mT=/(?!~)[\p{P}\p{S}]/u,hT=/(?!~)[\s\p{P}\p{S}]/u,gT=/(?:[^\s\p{P}\p{S}]|~)/u,_T=Z(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Nw?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),vT=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,yT=Z(vT,`u`).replace(/punct/g,lT).getRegex(),bT=Z(vT,`u`).replace(/punct/g,mT).getRegex(),xT=Z(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,pT).replace(/punct/g,lT).getRegex(),ST=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,CT=Z(ST,`gu`).replace(/notPunctSpace/g,dT).replace(/punctSpace/g,uT).replace(/punct/g,lT).getRegex(),wT=Z(ST,`gu`).replace(/notPunctSpace/g,gT).replace(/punctSpace/g,hT).replace(/punct/g,mT).getRegex(),TT=Z(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,dT).replace(/punctSpace/g,uT).replace(/punct/g,lT).getRegex(),ET=Z(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,dT).replace(/punctSpace/g,uT).replace(/punct/g,lT).getRegex(),DT=Z(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,dT).replace(/punctSpace/g,uT).replace(/punct/g,lT).getRegex(),OT=Z(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,lT).getRegex(),kT=Z(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,dT).replace(/punctSpace/g,uT).replace(/punct/g,lT).getRegex(),AT=Z(/\\(punct)/,`gu`).replace(/punct/g,lT).getRegex(),jT=Z(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),MT=Z(Xw).replace(`(?:-->|$)`,`-->`).getRegex(),NT=Z(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,MT).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),PT=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,FT=Z(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,PT).getRegex(),IT=Z(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,FT).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),LT=Z(/^!?\[(label)\]\[(ref)\]/).replace(`label`,FT).replace(`ref`,Kw).getRegex(),RT=Z(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Kw).getRegex(),zT=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,BT=Z(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,PT).getRegex(),VT=Z(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Z(/^!?\[(label)\]\[(ref)\]/).replace(`label`,BT).replace(`ref`,zT).getRegex()).replace(`nolink`,Z(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,zT).getRegex()).getRegex(),HT=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,UT={_backpedal:jw,anyPunctuation:AT,autolink:jT,blockSkip:_T,br:sT,code:oT,del:jw,delLDelim:jw,delRDelim:jw,emStrongLDelim:yT,emStrongRDelimAst:CT,emStrongRDelimUnd:ET,escape:aT,link:IT,nolink:RT,punctuation:fT,reflink:LT,reflinkSearch:VT,tag:NT,text:cT,url:jw},WT={...UT,emStrongLDelim:xT,emStrongRDelimAst:TT,emStrongRDelimUnd:DT,link:Z(/^!?\[(label)\]\((.*?)\)/).replace(`label`,FT).getRegex(),reflink:Z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,FT).getRegex()},GT={...UT,emStrongRDelimAst:wT,emStrongLDelim:bT,delLDelim:OT,delRDelim:kT,url:Z(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,HT).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Z(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,HT).getRegex()},KT={...GT,br:Z(sT).replace(`{2,}`,`*`).getRegex(),text:Z(GT.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},qT={normal:tT,gfm:rT,pedantic:iT},JT={normal:UT,gfm:GT,breaks:KT,pedantic:WT},YT={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},XT=e=>YT[e];function ZT(e,t){if(t){if(Pw.escapeTest.test(e))return e.replace(Pw.escapeReplace,XT)}else if(Pw.escapeTestNoEncode.test(e))return e.replace(Pw.escapeReplaceNoEncode,XT);return e}function QT(e){try{e=encodeURI(e).replace(Pw.percentDecode,`%`)}catch{return null}return e}function $T(e,t){let n=e.replace(Pw.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Pw.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(Pw.slashPipe,`|`);return n}function eE(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function tE(e){let t=e.split(`
|
|
203
|
+
`),n=t.length-1;for(;n>=0&&Pw.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
204
|
+
`)}function nE(e){return e.toLowerCase().toUpperCase().toLowerCase()}function rE(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function iE(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function aE(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function oE(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
202
205
|
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
|
|
203
|
-
`)}function
|
|
204
|
-
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:
|
|
205
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=
|
|
206
|
+
`)}function sE(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var cE=class{options;rules;lexer;constructor(e){this.options=e||kw}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:tE(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=oE(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=eE(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:eE(t[0],`
|
|
207
|
+
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:eE(t[0],`
|
|
208
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=eE(t[0],`
|
|
206
209
|
`).split(`
|
|
207
210
|
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
208
211
|
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
@@ -214,20 +217,20 @@ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
214
217
|
${a}`,r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
215
218
|
`+e.join(`
|
|
216
219
|
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
217
|
-
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=
|
|
220
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=iE(t[2].split(`
|
|
218
221
|
`,1)[0],t[1].length),l=e.split(`
|
|
219
222
|
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
220
223
|
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
221
224
|
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
222
225
|
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
223
226
|
`+l}u=!l.trim(),r+=p+`
|
|
224
|
-
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=
|
|
225
|
-
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n
|
|
226
|
-
`):[],a={type:`table`,raw:
|
|
227
|
-
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(
|
|
227
|
+
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=tE(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=nE(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:eE(t[0],`
|
|
228
|
+
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=$T(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
229
|
+
`):[],a={type:`table`,raw:eE(t[0],`
|
|
230
|
+
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push($T(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:eE(t[0],`
|
|
228
231
|
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
229
|
-
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&
|
|
230
|
-
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(
|
|
232
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&sE(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=eE(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=rE(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),aE(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&sE(e,n[1],r,this.rules))return;let i=t[nE((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return aE(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},lE=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||kw,this.options.tokenizer=this.options.tokenizer||new cE,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:Pw,block:qT.normal,inline:JT.normal};this.options.pedantic?(t.block=qT.pedantic,t.inline=JT.pedantic):this.options.gfm&&(t.block=qT.gfm,t.inline=this.options.breaks?JT.breaks:JT.gfm),this.tokenizer.rules=t}static get rules(){return{block:qT,inline:JT}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Pw.carriageReturn,`
|
|
233
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Pw.tabCharGlobal,` `).replace(Pw.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
|
|
231
234
|
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
232
235
|
`)?``:`
|
|
233
236
|
`)+i.raw,n.text+=`
|
|
@@ -240,9 +243,9 @@ ${a}`,r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){
|
|
|
240
243
|
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
241
244
|
`)?``:`
|
|
242
245
|
`)+i.raw,n.text+=`
|
|
243
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(!(e.charAt(0)===`!`||!Object.hasOwn(this.tokens.links,
|
|
244
|
-
`:``;return r?`<pre><code class="language-`+
|
|
245
|
-
`:`<pre><code>`+(n?i:
|
|
246
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(!(e.charAt(0)===`!`||!Object.hasOwn(this.tokens.links,nE(e.slice(n+1,-1))))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,nE(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},uE=class{options;parser;constructor(e){this.options=e||kw}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Pw.notSpaceStart)?.[0],i=e?e.replace(Pw.endingNewline,``)+`
|
|
247
|
+
`:``;return r?`<pre><code class="language-`+ZT(r)+`">`+(n?i:ZT(i,!0))+`</code></pre>
|
|
248
|
+
`:`<pre><code>`+(n?i:ZT(i,!0))+`</code></pre>
|
|
246
249
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
247
250
|
${this.parser.parse(e)}</blockquote>
|
|
248
251
|
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
@@ -258,53 +261,53 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
258
261
|
`}tablerow({text:e}){return`<tr>
|
|
259
262
|
${e}</tr>
|
|
260
263
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
261
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${
|
|
262
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+
|
|
263
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GT(e,t){return HT(e)||UT(e,t)||KT(e,t)||WT()}function KT(e,t){if(e){if(typeof e==`string`)return VT(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?VT(e,t):void 0}}var qT=Object.entries,JT=Object.setPrototypeOf,YT=Object.isFrozen,XT=Object.getPrototypeOf,ZT=Object.getOwnPropertyDescriptor,QT=Object.freeze,$T=Object.seal,eE=Object.create,tE=typeof Reflect<`u`&&Reflect,nE=tE.apply,rE=tE.construct;QT||=function(e){return e},$T||=function(e){return e},nE||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},rE||=function(e){return new e(...[...arguments].slice(1))};var iE=wE(Array.prototype.forEach),aE=wE(Array.prototype.lastIndexOf),oE=wE(Array.prototype.pop),sE=wE(Array.prototype.push),cE=wE(Array.prototype.splice),lE=Array.isArray,uE=wE(String.prototype.toLowerCase),dE=wE(String.prototype.toString),fE=wE(String.prototype.match),pE=wE(String.prototype.replace),mE=wE(String.prototype.indexOf),hE=wE(String.prototype.trim),gE=wE(Number.prototype.toString),_E=wE(Boolean.prototype.toString),vE=typeof BigInt>`u`?null:wE(BigInt.prototype.toString),yE=typeof Symbol>`u`?null:wE(Symbol.prototype.toString),bE=wE(Object.prototype.hasOwnProperty),xE=wE(Object.prototype.toString),SE=wE(RegExp.prototype.test),CE=TE(TypeError);function wE(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return nE(e,t,n)}}function TE(e){return function(){return rE(e,[...arguments])}}function $(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:uE;if(JT&&JT(e,null),!lE(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(YT(t)||(t[r]=e),i=e)}e[i]=!0}return e}function EE(e){for(let t=0;t<e.length;t++)bE(e,t)||(e[t]=null);return e}function DE(e){let t=eE(null);for(let r of qT(e)){var n=GT(r,2);let i=n[0],a=n[1];bE(e,i)&&(t[i]=lE(a)?EE(a):a&&typeof a==`object`&&a.constructor===Object?DE(a):a)}return t}function OE(e){switch(typeof e){case`string`:return e;case`number`:return gE(e);case`boolean`:return _E(e);case`bigint`:return vE?vE(e):`0`;case`symbol`:return yE?yE(e):`Symbol()`;case`undefined`:return xE(e);case`function`:case`object`:{if(e===null)return xE(e);let t=e,n=kE(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:xE(e)}return xE(e)}default:return xE(e)}}function kE(e,t){for(;e!==null;){let n=ZT(e,t);if(n){if(n.get)return wE(n.get);if(typeof n.value==`function`)return wE(n.value)}e=XT(e)}function n(){return null}return n}function AE(e){try{return SE(e,``),!0}catch{return!1}}var jE=QT(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),ME=QT(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),NE=QT([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),PE=QT([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),FE=QT(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),IE=QT([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),LE=QT([`#text`]),RE=QT(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),zE=QT(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),BE=QT(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),VE=QT([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),HE=$T(/{{[\w\W]*|^[\w\W]*}}/g),UE=$T(/<%[\w\W]*|^[\w\W]*%>/g),WE=$T(/\${[\w\W]*/g),GE=$T(/^data-[\-\w.\u00B7-\uFFFF]+$/),KE=$T(/^aria-[\-\w]+$/),qE=$T(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),JE=$T(/^(?:\w+script|data):/i),YE=$T(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),XE=$T(/^html$/i),ZE=$T(/^[a-z][.\w]*(-[.\w]+)+$/i),QE=$T(/<[/\w!]/g),$E=$T(/<[/\w]/g),eD=$T(/<\/no(script|embed|frames)/i),tD=$T(/\/>/i),nD={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},rD=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],iD=QT($({},rD)),aD=function(){let e={};return iE(rD,t=>{e[t]=$T(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),QT(e)}(),oD=function(){return typeof window>`u`?null:window},sD=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},cD=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},lD=function(e,t,n,r){return bE(e,t)&&lE(e[t])?$(r.base?DE(r.base):{},e[t],r.transform):n},uD=function(e,t,n){let r=bE(e,t)?e[t]:void 0;return r&&typeof r==`object`?DE(r):n()};function dD(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:oD(),t=e=>dD(e);if(t.version=`3.4.15`,t.removed=[],!e||!e.document||e.document.nodeType!==nD.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=kE(d,`cloneNode`),p=kE(d,`remove`),m=kE(d,`removeAttributeNode`),h=kE(d,`nextSibling`),g=kE(d,`childNodes`),_=kE(d,`parentNode`),v=kE(d,`shadowRoot`),y=kE(d,`attributes`),b=o&&o.prototype?kE(o.prototype,`nodeType`):null,x=o&&o.prototype?kE(o.prototype,`nodeName`):null,S=o&&o.prototype?kE(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let ee,T=``,E,te=!1,D=0,ne=function(){if(D>0)throw CE(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},re=function(e){ne(),D++;try{return ee.createHTML(e)}finally{D--}},ie=function(e){ne(),D++;try{return ee.createScriptURL(e)}finally{D--}},ae=function(){return te||=(E=sD(u,i),!0),E},oe=n,se=oe.implementation,ce=oe.createNodeIterator,le=oe.createDocumentFragment,ue=oe.getElementsByTagName,de=r.importNode,O=cD();t.isSupported=typeof qT==`function`&&typeof _==`function`&&se&&se.createHTMLDocument!==void 0;let fe=HE,pe=UE,me=WE,he=GE,ge=KE,_e=JE,ve=YE,ye=ZE,be=qE,k=null,xe=$({},[...jE,...ME,...NE,...FE,...LE]),A=null,Se=$({},[...RE,...zE,...BE,...VE]),Ce=Object.seal(eE(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),we=null,Te=null,j=Object.seal(eE(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ee=!0,De=!0,Oe=!1,ke=!0,Ae=!1,je=!0,Me=!1,Ne=!1,Pe=null,Fe=null,Ie=!1,Le=!1,Re=!1,M=!1,ze=!0,Be=!1,Ve=`user-content-`,He=!0,Ue=!1,We={},N=null,Ge=$({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ke=null,qe=$({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Je=null,Ye=$({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Xe=`http://www.w3.org/1998/Math/MathML`,Ze=`http://www.w3.org/2000/svg`,Qe=`http://www.w3.org/1999/xhtml`,$e=Qe,et=!1,tt=null,nt=$({},[Xe,Ze,Qe],dE),rt=QT([`mi`,`mo`,`mn`,`ms`,`mtext`]),it=$({},rt),at=QT([`annotation-xml`]),ot=$({},at),st=$({},[`title`,`style`,`font`,`a`,`script`]),ct=null,lt=[`application/xhtml+xml`,`text/html`],ut=null,dt=null,ft=n.createElement(`form`),pt=function(e){return e instanceof RegExp||e instanceof Function},mt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(dt&&dt===e)return;(!e||typeof e!=`object`)&&(e={}),e=DE(e),ct=lt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,ut=ct===`application/xhtml+xml`?dE:uE,k=lD(e,`ALLOWED_TAGS`,xe,{transform:ut}),A=lD(e,`ALLOWED_ATTR`,Se,{transform:ut}),tt=lD(e,`ALLOWED_NAMESPACES`,nt,{transform:dE}),Je=lD(e,`ADD_URI_SAFE_ATTR`,Ye,{transform:ut,base:Ye}),Ke=lD(e,`ADD_DATA_URI_TAGS`,qe,{transform:ut,base:qe}),N=lD(e,`FORBID_CONTENTS`,Ge,{transform:ut}),we=lD(e,`FORBID_TAGS`,DE({}),{transform:ut}),Te=lD(e,`FORBID_ATTR`,DE({}),{transform:ut}),We=bE(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?DE(e.USE_PROFILES):e.USE_PROFILES:!1,Ee=e.ALLOW_ARIA_ATTR!==!1,De=e.ALLOW_DATA_ATTR!==!1,Oe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ae=e.SAFE_FOR_TEMPLATES||!1,je=e.SAFE_FOR_XML!==!1,Me=e.WHOLE_DOCUMENT||!1,Le=e.RETURN_DOM||!1,Re=e.RETURN_DOM_FRAGMENT||!1,M=e.RETURN_TRUSTED_TYPE||!1,Ie=e.FORCE_BODY||!1,ze=e.SANITIZE_DOM!==!1,Be=e.SANITIZE_NAMED_PROPS||!1,He=e.KEEP_CONTENT!==!1,Ue=e.IN_PLACE||!1,be=AE(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:qE,$e=typeof e.NAMESPACE==`string`?e.NAMESPACE:Qe,it=uD(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>$({},rt)),ot=uD(e,`HTML_INTEGRATION_POINTS`,()=>$({},at));let t=uD(e,`CUSTOM_ELEMENT_HANDLING`,()=>eE(null));if(Ce=eE(null),bE(t,`tagNameCheck`)&&pt(t.tagNameCheck)&&(Ce.tagNameCheck=t.tagNameCheck),bE(t,`attributeNameCheck`)&&pt(t.attributeNameCheck)&&(Ce.attributeNameCheck=t.attributeNameCheck),bE(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Ce.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),$T(Ce),Ae&&(De=!1),Re&&(Le=!0),We&&(k=$({},LE),A=eE(null),We.html===!0&&($(k,jE),$(A,RE)),We.svg===!0&&($(k,ME),$(A,zE),$(A,VE)),We.svgFilters===!0&&($(k,NE),$(A,zE),$(A,VE)),We.mathMl===!0&&($(k,FE),$(A,BE),$(A,VE))),j.tagCheck=null,j.attributeCheck=null,bE(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?j.tagCheck=e.ADD_TAGS:lE(e.ADD_TAGS)&&(k===xe&&(k=DE(k)),$(k,e.ADD_TAGS,ut))),bE(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?j.attributeCheck=e.ADD_ATTR:lE(e.ADD_ATTR)&&(A===Se&&(A=DE(A)),$(A,e.ADD_ATTR,ut))),bE(e,`ADD_FORBID_CONTENTS`)&&lE(e.ADD_FORBID_CONTENTS)&&(N===Ge&&(N=DE(N)),$(N,e.ADD_FORBID_CONTENTS,ut)),He&&(k[`#text`]=!0),Me&&$(k,[`html`,`head`,`body`]),k.table&&($(k,[`tbody`]),delete we.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw CE(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw CE(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=ee;ee=e.TRUSTED_TYPES_POLICY;try{T=re(``)}catch(e){throw ee=t,e}}else e.TRUSTED_TYPES_POLICY===null?(ee=void 0,T=``):(ee===void 0&&(ee=ae()),ee&&typeof T==`string`&&(T=re(``)));QT&&QT(e),dt=e},ht=$({},[...ME,...NE,...PE]),gt=$({},[...FE,...IE]),_t=function(e,t,n){return t.namespaceURI===Qe?e===`svg`:t.namespaceURI===Xe?e===`svg`&&(n===`annotation-xml`||it[n]):!!ht[e]},vt=function(e,t,n){return t.namespaceURI===Qe?e===`math`:t.namespaceURI===Ze?e===`math`&&ot[n]:!!gt[e]},yt=function(e,t,n){return t.namespaceURI===Ze&&!ot[n]||t.namespaceURI===Xe&&!it[n]?!1:!gt[e]&&(st[e]||!ht[e])},bt=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:$e,tagName:`template`});let n=uE(e.tagName),r=uE(t.tagName);return tt[e.namespaceURI]?e.namespaceURI===Ze?_t(n,t,r):e.namespaceURI===Xe?vt(n,t,r):e.namespaceURI===Qe?yt(n,t,r):!!(ct===`application/xhtml+xml`&&tt[e.namespaceURI]):!1},xt=function(e){sE(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw CE(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},St=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},Ct=function(e){Et(e);let t=g(e);if(t){let e=[];iE(t,t=>{sE(e,t)}),iE(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&St(e,r,i)}},wt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}sE(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`)if(Le||Re)try{xt(n)}catch{}else try{n.setAttribute(e,``)}catch{}},Tt=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||A[ut(i)]||St(e,r,i)}},Et=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===nD.element&&Tt(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},Dt=function(e,t){return je?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Ot=function(e){if(!je)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===nD.processingInstruction||n===nD.comment&&SE($E,e.data)){try{p(e)}catch{}continue}if(n===nD.element){let t=e,n=ut(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Dt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},kt=function(e){let t=null,r=null;if(Ie)e=`<remove></remove>`+e;else{let t=fE(e,/^[\r\n\t ]+/);r=t&&t[0]}ct===`application/xhtml+xml`&&$e===Qe&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=ee?re(e):e;if($e===Qe)try{t=new l().parseFromString(i,ct)}catch{}if(!t||!t.documentElement){t=se.createDocument($e,`template`,null);try{t.documentElement.innerHTML=et?T:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),$e===Qe?ue.call(t,Me?`html`:`body`)[0]:Me?t.documentElement:a},At=function(e){let t=S?S(e):e.ownerDocument;return ce.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},jt=function(e){return e=pE(e,fe,` `),e=pE(e,pe,` `),e=pE(e,me,` `),e},Mt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=ce.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=jt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&iE(i,e=>{Pt(e.content)&&Mt(e.content)})},Nt=function(e){let t=x?x(e):null;return typeof t!=`string`||ut(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Pt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===nD.documentFragment}catch{return!1}},Ft=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function It(e,n,r){e.length!==0&&iE(e,e=>{e.call(t,n,r,dt)})}let Lt=function(e,t){return!!(je&&e.hasChildNodes()&&!Ft(e.firstElementChild)&&SE(QE,e.textContent)&&SE(QE,e.innerHTML)||je&&e.namespaceURI===Qe&&iD[t]&&(Ft(e.firstElementChild)||typeof e.textContent==`string`&&SE(aD[t],e.textContent))||e.nodeType===nD.processingInstruction||je&&e.nodeType===nD.comment&&SE($E,e.data))},Rt=function(e,t){return e instanceof RegExp?SE(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},zt=function(e,t,n){if(!we[t]&&Gt(t)&&Rt(Ce.tagNameCheck,t))return!1;if(He&&!N[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return xt(e),!0},Bt=function(e,t,n,r){return e.length===0?t:t===n||t===r?DE(t):t},Vt=function(e,t){return e===t||_(e)!==null?!1:(Ue&&Et(e),!0)},Ht=function(e,n){if(It(O.beforeSanitizeElements,e,null),Vt(e,n))return!0;if(Nt(e))return xt(e),!0;let r=ut(w(e));if(k=Bt(O.uponSanitizeElement,k,xe,Pe),It(O.uponSanitizeElement,e,{tagName:r,allowedTags:k}),Vt(e,n))return!0;if(Lt(e,r))return xt(e),!0;if(we[r]||!(j.tagCheck instanceof Function&&j.tagCheck(r))&&!k[r]){let t=zt(e,r,n);return t===!1&&It(O.afterSanitizeElements,e,null),t}if(C(e)===nD.element&&!bt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&SE(eD,e.innerHTML))return xt(e),!0;if(Ae&&e.nodeType===nD.text){let n=jt(e.textContent);e.textContent!==n&&(sE(t.removed,{element:e.cloneNode()}),e.textContent=n)}return It(O.afterSanitizeElements,e,null),!1},Ut=function(e,t,r){if(Te[t]||Dt(t,e)||ze&&(t===`id`||t===`name`)&&(r in n||r in ft))return!1;let i=A[t]||j.attributeCheck instanceof Function&&j.attributeCheck(t,e);return De&&SE(he,t)||Ee&&SE(ge,t)?!0:i?Je[t]||SE(be,pE(r,ve,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&mE(r,`data:`)===0&&Ke[e]||Oe&&!SE(_e,pE(r,ve,``))?!0:!r:Gt(e)&&Rt(Ce.tagNameCheck,e)&&Rt(Ce.attributeNameCheck,t,e)||t===`is`&&Ce.allowCustomizedBuiltInElements&&Rt(Ce.tagNameCheck,r)},Wt=$({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Gt=function(e){return!Wt[uE(e)]&&SE(ye,e)},Kt=function(e,t,n,r){if(ee&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return re(r);case`TrustedScriptURL`:return ie(r)}return r},qt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Nt(e)||(xt(e),!1)}catch{return wt(t,e),!1}},Jt=function(e){It(O.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||Nt(e))return;A=Bt(O.uponSanitizeAttribute,A,Se,Fe);let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:A,forceKeepAttr:void 0},i=n.length,a=ut(e.nodeName);for(;i--;){let o=n[i],s=o.name,c=o.namespaceURI,l=o.value,u=ut(s),d=l,f=s===`value`?d:hE(d),p=!1;if(r.attrName=u,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,It(O.uponSanitizeAttribute,e,r),f=r.attrValue,Be&&(u===`id`||u===`name`)&&mE(f,Ve)!==0&&(wt(s,e,o),f=Ve+f,p=!0),je&&SE(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){wt(s,e,o);continue}if(u===`attributename`&&fE(f,`href`)){wt(s,e,o);continue}if(!r.forceKeepAttr){if(!r.keepAttr){wt(s,e,o);continue}if(!ke&&SE(tD,f)){wt(s,e,o);continue}if(Ae&&(f=jt(f)),!Ut(a,u,f)){wt(s,e,o);continue}f=Kt(a,u,c,f),f!==d&&qt(e,s,c,f)&&p&&oE(t.removed)}}It(O.afterSanitizeAttributes,e,null)},Yt=function(e){let t=null,n=At(e);for(It(O.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(It(O.uponSanitizeShadowNode,t,null),Ht(t,e),Jt(t),Pt(t.content)&&Yt(t.content),C(t)===nD.element){let e=v(t);Pt(e)&&(Xt(e),Yt(e))}It(O.afterSanitizeShadowDOM,e,null)},Xt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Yt(e.shadow);continue}let n=e.node,r=C(n)===nD.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&ut(e)===`template`){let e=n.content;Pt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Pt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(et=!e,et&&(e=`<!-->`),typeof e!=`string`&&!Ft(e)&&(e=OE(e),typeof e!=`string`))throw CE(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ne?(k=Pe,A=Fe):mt(n),(O.uponSanitizeElement.length>0||O.uponSanitizeAttribute.length>0)&&(k=DE(k)),O.uponSanitizeAttribute.length>0&&(A=DE(A)),t.removed=[];let c=Ue&&typeof e!=`string`&&Ft(e);if(c){Ot(e);let t=w(e);if(typeof t==`string`){let n=ut(t);if(!k[n]||we[n])throw Ct(e),CE(`root node is forbidden and cannot be sanitized in-place`)}if(Nt(e))throw Ct(e),CE(`root node is clobbered and cannot be sanitized in-place`);try{Xt(e)}catch(t){throw Ct(e),t}}else if(Ft(e))i=kt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===nD.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Xt(i);else{if(!Le&&!Ae&&!Me&&e.indexOf(`<`)===-1)return ee&&M?re(e):e;if(i=kt(e),!i)return Le?null:M?T:``}i&&Ie&&xt(i.firstChild);let l=c?e:i;try{let e=At(l);for(;o=e.nextNode();)Ht(o,l),Jt(o),Pt(o.content)&&Yt(o.content)}catch(n){throw c&&(Ct(e),iE(t.removed,e=>{e.element&&Et(e.element)})),n}if(c)return iE(t.removed,e=>{e.element&&Et(e.element)}),Ae&&Mt(e),e;if(Le){if(Ae&&Mt(i),Re)for(s=le.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(A.shadowroot||A.shadowrootmode)&&(s=de.call(r,s,!0)),s}let u=Me?i.outerHTML:i.innerHTML;return Me&&k[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&SE(XE,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
264
|
-
`+u),
|
|
265
|
-
`).map(e=>{if(
|
|
266
|
-
`)}(function(e){var t=`\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b`,n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:`punctuation`,inside:null},r={bash:n,environment:{pattern:RegExp(`\\$`+t),alias:`constant`},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp(`(\\{)`+t),lookbehind:!0,alias:`constant`}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:`important`},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:`function`},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:`function`}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:`variable`,lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp(`(^|[\\s;|&]|[<>]\\()`+t),lookbehind:!0,alias:`constant`}},alias:`variable`,lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:`variable`,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp(`\\$?`+t),alias:`constant`},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:`class-name`},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:`important`},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:`important`}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=[`comment`,`function-name`,`for-or-select`,`assign-left`,`parameter`,`string`,`environment`,`function`,`keyword`,`builtin`,`boolean`,`file-descriptor`,`operator`,`punctuation`,`number`],a=r.variable[1].inside,o=0;o<i.length;o++)a[i[o]]=e.languages.bash[i[o]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash})(Prism),(function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript})(Prism),(function(e){var t=e.util.clone(e.languages.javascript),n=`(?:\\s|\\/\\/.*(?!.)|\\/\\*(?:[^*]|\\*(?!\\/))\\*\\/)`,r=`(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})`,i=`(?:\\{<S>*\\.{3}(?:[^{}]|<BRACES>)*\\})`;function a(e,t){return e=e.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(e,t)}i=a(i).source,e.languages.jsx=e.languages.extend(`markup`,t),e.languages.jsx.tag.pattern=a(`<\\/?(?:[\\w.:-]+(?:<S>+(?:[\\w.:$-]+(?:=(?:"(?:\\\\[\\s\\S]|[^\\\\"])*"|'(?:\\\\[\\s\\S]|[^\\\\'])*'|[^\\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\\/?)?>`),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside[`attr-value`].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside[`class-name`]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore(`inside`,`attr-name`,{spread:{pattern:a(`<SPREAD>`),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore(`inside`,`special-attr`,{script:{pattern:a(`=<BRACES>`),alias:`language-javascript`,inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:`punctuation`},rest:e.languages.jsx}}},e.languages.jsx.tag);var o=function(e){return e?typeof e==`string`?e:typeof e.content==`string`?e.content:e.content.map(o).join(``):``},s=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r],a=!1;if(typeof i!=`string`&&(i.type===`tag`&&i.content[0]&&i.content[0].type===`tag`?i.content[0].content[0].content===`</`?n.length>0&&n[n.length-1].tagName===o(i.content[0].content[1])&&n.pop():i.content[i.content.length-1].content===`/>`||n.push({tagName:o(i.content[0].content[1]),openedBraces:0}):n.length>0&&i.type===`punctuation`&&i.content===`{`?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&i.type===`punctuation`&&i.content===`}`?n[n.length-1].openedBraces--:a=!0),(a||typeof i==`string`)&&n.length>0&&n[n.length-1].openedBraces===0){var c=o(i);r<t.length-1&&(typeof t[r+1]==`string`||t[r+1].type===`plain-text`)&&(c+=o(t[r+1]),t.splice(r+1,1)),r>0&&(typeof t[r-1]==`string`||t[r-1].type===`plain-text`)&&(c=o(t[r-1])+c,t.splice(r-1,1),r--),t[r]=new e.Token(`plain-text`,c,null,c)}i.content&&typeof i.content!=`string`&&s(i.content)}};e.hooks.add(`after-tokenize`,function(e){(e.language===`jsx`||e.language===`tsx`)&&s(e.tokens)})})(Prism),zT.setOptions({gfm:!0,breaks:!0}),fD.addHook(`afterSanitizeAttributes`,e=>{e.tagName===`A`&&e.getAttribute(`href`)&&(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`)),e.tagName===`IMG`&&(e.setAttribute(`loading`,`lazy`),e.setAttribute(`decoding`,`async`))});var VD={js:`javascript`,mjs:`javascript`,cjs:`javascript`,node:`javascript`,ts:`typescript`,sh:`bash`,shell:`bash`,zsh:`bash`,console:`bash`,html:`markup`,vue:`markup`,xml:`markup`,svg:`markup`,jsonc:`json`,json5:`json`,py:`python`,yml:`yaml`};function HD(e){let t=String(e||``).trim().toLowerCase();if(!t)return``;let n=VD[t]||t;return Yg.default.languages[n]?n:``}function UD(e){let t=String(e??``);if(!t.trim())return``;let n=``;try{n=zT.parse(t)}catch{n=`<p>${t.replace(/[&<>]/g,e=>({"&":`&`,"<":`<`,">":`>`})[e])}</p>`}return fD.sanitize(n,{ADD_ATTR:[`target`,`rel`]})}function WD(e){if(!(!e||!e.querySelectorAll))for(let t of e.querySelectorAll(`pre`)){let e=t.querySelector(`code`);if(!e)continue;let n=HD((e.className.match(/language-([\w+-]+)/)||[])[1]||``);if(n&&e.className.indexOf(`language-`)<0&&(e.className=`language-${n}`),n&&!e.dataset.mdHighlighted){try{Yg.default.highlightElement(e)}catch{}e.dataset.mdHighlighted=`1`}if(t.dataset.mdCode)continue;t.dataset.mdCode=`1`;let r=document.createElement(`div`);r.className=`md-code`;let i=document.createElement(`div`);i.className=`md-code__bar`;let a=document.createElement(`span`);a.className=`md-code__lang`,a.textContent=n||`text`;let o=document.createElement(`button`);o.type=`button`,o.className=`md-code__copy`,o.textContent=`复制`,o.addEventListener(`click`,async()=>{await op(e.textContent||``)?(o.textContent=`已复制`,o.classList.add(`is-ok`)):o.textContent=`复制失败`,setTimeout(()=>{o.textContent=`复制`,o.classList.remove(`is-ok`)},1600)}),i.append(a,o),t.parentNode?.insertBefore(r,t),r.append(i,t)}}function GD(e){if(!(!e||!e.querySelectorAll))for(let t of e.querySelectorAll(`pre code[data-md-highlighted]`))delete t.dataset.mdHighlighted}function KD(e){return e?e.nodeType===3?!e.textContent.trim():e.nodeType===1&&e.tagName===`BR`:!1}function qD(e){if(e.length>1)return`${e.length} 张图像`;let t=e[0],n=(t.getAttribute(`alt`)||``).trim();if(n)return n;let r=(t.getAttribute(`title`)||``).trim();return(r?(r.split(/[\\/]/).pop()||``).trim():``)||ND(t.getAttribute(`src`))||`1 张图像`}function JD(e){let t=document.createElement(`div`);t.className=`md-imggroup`,t.dataset.mdImggroup=`1`;let n=document.createElement(`button`);n.type=`button`,n.className=`md-imggroup__head`,n.setAttribute(`aria-expanded`,`false`),n.innerHTML=`<svg class="md-imggroup__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><use href="#icon-images" /></svg><span class="md-imggroup__label"></span><svg class="md-imggroup__chev" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><use href="#icon-chevron-right" /></svg>`,n.querySelector(`.md-imggroup__label`).textContent=qD(e);let r=document.createElement(`div`);return r.className=`md-imggroup__body`,r.hidden=!0,n.addEventListener(`click`,()=>{let e=r.hidden;r.hidden=!e,t.classList.toggle(`is-open`,e),n.setAttribute(`aria-expanded`,e?`true`:`false`)}),t.append(n,r),{group:t,body:r}}function YD(e){if(e.dataset.mdImgFallback)return;e.dataset.mdImgFallback=`1`;let t=()=>{if(!e.isConnected||!(e.complete&&e.naturalWidth===0))return;let t=e.getAttribute(`src`)||``;if(/\.svgz?(?:[?#]|$)/i.test(t)||/^data:image\/svg/i.test(t))return;let n=ND(t)||(e.getAttribute(`alt`)||``).trim()||`未知图片`,r=document.createElement(`span`);r.className=`md-imgfail`,r.textContent=`图片加载失败:${n}`,r.title=t,e.replaceWith(r);let i=r.closest(`.md-imggroup__body`);if(i&&!i.querySelector(`img`)){let e=r.closest(`[data-md-imggroup]`);if(e){let t=e.querySelector(`.md-imggroup__head`);t&&t.remove(),e.classList.add(`is-open`)}}};e.addEventListener(`error`,t,{once:!0}),t()}function XD(e){if(!e||!e.querySelectorAll)return;let t=[...e.querySelectorAll(`img`)];for(let e of t)YD(e);for(let e of t){if(e.closest(`[data-md-imggroup]`))continue;let t=[e],n=e.nextSibling;for(;n;){if(KD(n)){n=n.nextSibling;continue}if(n.tagName===`IMG`&&!n.closest(`[data-md-imggroup]`)){t.push(n),n=n.nextSibling;continue}break}let{group:r,body:i}=JD(t);e.parentNode.insertBefore(r,e);for(let e of t)i.append(e)}}var ZD={name:`MarkdownBody`,props:{source:{type:String,default:``},streaming:{type:Boolean,default:!1}},data(){return{html:``,_raf:0}},watch:{source:{immediate:!0,handler(){this.scheduleRender()}},streaming(e){e||this.renderNow()}},beforeUnmount(){this._raf&&cancelAnimationFrame(this._raf),this._raf=0},methods:{scheduleRender(){if(!this.streaming){this.renderNow();return}this._raf||=requestAnimationFrame(()=>{this._raf=0,this.renderNow()})},renderNow(){this._raf&&=(cancelAnimationFrame(this._raf),0),this.html=UD(this.source),this.$nextTick(()=>{let e=this.$refs.bodyEl;e&&(GD(e),WD(e),XD(e))})}}},QD=[`innerHTML`];function $D(e,t,n,r,i,a){return B(),V(z,null,[K(` 模型输出经 marked 解析 + DOMPurify 消毒后注入;代码块由 enhanceCodeBlocks 补高亮与复制按钮 `),U(`div`,{ref:`bodyEl`,class:`md-body`,innerHTML:i.html},null,8,QD)],2112)}var eO=X(ZD,[[`render`,$D],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/MarkdownBody.vue`]]),tO={card_list:`列出卡片`,card_read:`读取卡片`,card_write:`写入卡片`,card_validate:`校验卡片`,card_render_status:`渲染状态`,card_node_models:`组件模型`,card_screenshot:`截图预览`,card_sync:`同步远端卡片`,card_save:`推送到远端`,card_slice_upload:`上传切图`,card_import_meta:`来源侧车`,card_route_input:`输入路由`,card_scaffold:`生成骨架`,card_add_component:`添加组件`,card_history:`编辑历史`,card_rollback:`回滚版本`,skill_read:`读技能文档`,skill_exec:`跑技能脚本`,card_grep:`定位卡片字段`,card_patch:`最小改写卡片`,fs_read:`读文件`,fs_list:`列目录`,fs_write:`写草稿文件`,fs_copy:`复制文件`,shell_exec:`本地命令`};function nO(e){return tO[e]||e||`工具`}function rO(e){let t=e&&e.args||{};return`${typeof t.script==`string`?t.script:``} ${Array.isArray(t.args)?t.args.join(` `):typeof t.command==`string`?t.command:``} ${typeof t.name==`string`?t.name:``}`.toLowerCase()}var iO=[{order:6,id:`S6`,label:`收尾门禁`,hit:(e,t)=>/check_fidelity/.test(t)||/iterate/.test(t)&&/--gate/.test(t)},{order:5,id:`S5`,label:`像素自循环`,hit:(e,t)=>/iterate|diff_bands/.test(t)||e===`card_screenshot`},{order:4,id:`S4`,label:`组件填充`,hit:e=>e===`card_add_component`||e===`card_patch`||e===`card_write`},{order:3,id:`S3`,label:`骨架落盘`,hit:(e,t)=>e===`card_scaffold`||/expand_ir/.test(t)||e===`fs_write`&&/\.ir\.json/.test(t)},{order:2,id:`S2`,label:`设计稿审计`,hit:(e,t)=>/spec_tree|sketch_spec|design_sample|audit_|slice_/.test(t)},{order:1,id:`S1`,label:`输入路由`,hit:e=>e===`card_route_input`}];function aO(e){let t=Math.max(0,Math.round(Number(e||0)/1e3));if(t<60)return`${t} 秒`;let n=Math.floor(t/60);return n<60?`${n} 分 ${t%60} 秒`:`${Math.floor(n/60)} 小时 ${n%60} 分`}function oO(e){let t=Number(e||0);if(!t)return``;let n=new Date(t),r=e=>String(e).padStart(2,`0`);return`${r(n.getHours())}:${r(n.getMinutes())}:${r(n.getSeconds())}`}function sO(e){let t=Number(e||0);return t>0?`+${aO(t)}`:``}function cO(e,t=0){let n=Number(e&&e.startedAt)||0;if(!n)return 0;let r=Number(e&&e.ms)||0;if(r>0)return n+r;let i=Number(t)||0;return i>n?i:0}function lO(e){let t=e&&e.toolName||``,n=rO(e);for(let e of iO)if(e.hit(t,n))return e;return null}var uO=new Set([`card_write`,`card_patch`,`card_scaffold`,`card_add_component`,`fs_write`,`fs_copy`,`card_save`,`card_sync`,`card_slice_upload`]),dO=new Set([`card_read`,`card_list`,`card_node_models`,`card_grep`,`card_history`,`card_validate`,`card_render_status`,`fs_read`,`fs_list`,`skill_read`]);function fO(e){let t=e&&e.toolName||``;return e&&e.error||uO.has(t)||t===`skill_exec`||t===`shell_exec`||t===`card_screenshot`?!0:!dO.has(t)}function pO(e){if(e==null||e===``)return null;if(typeof e==`object`)return e;let t=String(e);try{return JSON.parse(t)}catch{}let n=t.indexOf(`{`),r=t.lastIndexOf(`}`);if(n>=0&&r>n)try{return JSON.parse(t.slice(n,r+1))}catch{return null}return null}function mO(e){let t=rO(e);if(!/--gate|check_fidelity/.test(t))return null;let n=pO(e&&e.result),r=n&&typeof n==`object`?n.gate:null;if(r&&typeof r.passed==`boolean`)return{passed:r.passed,verdict:String(r.verdict||``)};let i=String(e&&e.result||``);if(!/"passed"\s*:/.test(i))return null;let a=/"passed"\s*:\s*(true|false)/.exec(i),o=/"verdict"\s*:\s*"((?:[^"\\]|\\.)*)"/.exec(i);return a?{passed:a[1]===`true`,verdict:o?o[1].replace(/\\n/g,` `):``}:null}var hO=/\s#([^\s#]+)\s*$/;function gO(e){let t=String(e??``),n=hO.exec(t);return n?{text:t.slice(0,n.index).trim(),cid:n[1]}:{text:t,cid:``}}var _O=12;function vO(e){let t=e&&e.toolName||``,n=pO(e&&e.result);if(!n||typeof n!=`object`)return null;let r=t===`card_validate`?n:n.verify&&n.verify.validate;if(!r||typeof r!=`object`||!Array.isArray(r.errors))return null;let i=Array.isArray(r.warnings)?r.warnings:[],a=[...r.errors.map(e=>({level:`error`,...gO(e)})),...i.map(e=>({level:`warn`,...gO(e)}))].slice(0,_O);return{ok:r.ok!==!1&&r.errors.length===0,errors:r.errors.length,warnings:i.length,issues:a}}function yO(e){let t=Array.isArray(e)?e:[],n=0,r=0,i=0,a=0,o=null,s=null;for(let e of t){e.error&&a++,uO.has(e.toolName)&&(e.error?r++:n++),e.toolName===`card_screenshot`&&!e.error&&i++;let t=vO(e);t&&(o=t);let c=mO(e);c&&(s=c)}return{total:t.length,writes:n,writeFails:r,shots:i,failed:a,validate:o,gate:s}}var bO={length:`单次输出上限截断:调高「单次输出上限」,或要求 AI 走紧凑 IR 路线(fs_write 写 IR → expand_ir 展开)`,stall:`上游长时间静默:多为网关 / 网络抖动。上下文与已落盘产物都在,重试本轮即可接着做`,empty:`网关连续返回空响应:重试本轮,或检查网关额度 / 换个时间段`,context:`上下文超出网关窗口:后端已自动压缩重试仍失败,建议新开一轮或清理对话记录`,network:`连不上网关:检查网络与 Base URL 后重试本轮`,"rate-limit":`网关限流或额度不足:稍后重试,或换一个 API Key`,auth:`API Key 无效或权限不足:到设置里更新 Key 再重试`,"wrap-failed":`熔断收尾的进度汇总也没拿到:上下文已保留,回复「继续」接着做`,aborted:`本轮已中止:已执行的写入都保留,可从中断处继续`,unknown:`未归类的失败:复制错误原文排查,或换个说法重试本轮`};function xO(e){return{hint:bO[e]||``,action:e===`length`||e===`auth`?`settings`:e===`wrap-failed`||e===`aborted`?`continue`:`retry`}}var SO=/^\s*(\d+)\.\s+(.+?)\s+\((\d+x\d+|\?)\)\s*(.*)$/,CO=/--pick\s+([\d.,~]+)/;function wO(e){if(typeof e!=`string`||!e.includes(`--pick`))return[];let t=[];for(let n of e.split(`
|
|
267
|
-
`)){let e=n.match(
|
|
264
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${ZT(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?ZT(n,!0):this.parser.parseInline(r),o=QT(e);if(o===null)return a;e=ZT(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+ZT(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=QT(e);if(i===null)return ZT(n);e=i;let a=`<img src="${ZT(e)}" alt="${ZT(n)}"`;return t&&(a+=` title="${ZT(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:ZT(e.text)}},dE=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},fE=class e{options;renderer;textRenderer;constructor(e){this.options=e||kw,this.options.renderer=this.options.renderer||new uE,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new dE}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},pE=class{options;block;constructor(e){this.options=e||kw}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?lE.lex:lE.lexInline}provideParser(e=this.block){return e?fE.parse:fE.parseInline}},mE=new class{defaults=Ow();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=fE;Renderer=uE;TextRenderer=dE;Lexer=lE;Tokenizer=cE;Hooks=pE;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new uE(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new cE(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new pE;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=pE.passThroughHooks.has(n)?e=>{if(this.defaults.async&&pE.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return lE.lex(e,t??this.defaults)}parser(e,t){return fE.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?lE.lex:lE.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?fE.parse:fE.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?lE.lex:lE.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?fE.parse:fE.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
265
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+ZT(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Q(e,t){return mE.parse(e,t)}Q.options=Q.setOptions=function(e){return mE.setOptions(e),Q.defaults=mE.defaults,Aw(Q.defaults),Q},Q.getDefaults=Ow,Q.defaults=kw;function hE(...e){return mE.use(...e),Q.defaults=mE.defaults,Aw(Q.defaults),Q}Q.use=hE,Q.walkTokens=function(e,t){return mE.walkTokens(e,t)},Q.parseInline=mE.parseInline,Q.Parser=fE,Q.parser=fE.parse,Q.Renderer=uE,Q.TextRenderer=dE,Q.Lexer=lE,Q.lexer=lE.lex,Q.Tokenizer=cE,Q.Hooks=pE,Q.parse=Q,Q.options,Q.setOptions,Q.walkTokens,Q.parseInline,fE.parse,lE.lex;function gE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _E(e){if(Array.isArray(e))return e}function vE(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function yE(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
266
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bE(e,t){return _E(e)||vE(e,t)||xE(e,t)||yE()}function xE(e,t){if(e){if(typeof e==`string`)return gE(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gE(e,t):void 0}}var SE=Object.entries,CE=Object.setPrototypeOf,wE=Object.isFrozen,TE=Object.getPrototypeOf,EE=Object.getOwnPropertyDescriptor,DE=Object.freeze,OE=Object.seal,kE=Object.create,AE=typeof Reflect<`u`&&Reflect,jE=AE.apply,ME=AE.construct;DE||=function(e){return e},OE||=function(e){return e},jE||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},ME||=function(e){return new e(...[...arguments].slice(1))};var NE=$E(Array.prototype.forEach),PE=$E(Array.prototype.lastIndexOf),FE=$E(Array.prototype.pop),IE=$E(Array.prototype.push),LE=$E(Array.prototype.splice),RE=Array.isArray,zE=$E(String.prototype.toLowerCase),BE=$E(String.prototype.toString),VE=$E(String.prototype.match),HE=$E(String.prototype.replace),UE=$E(String.prototype.indexOf),WE=$E(String.prototype.trim),GE=$E(Number.prototype.toString),KE=$E(Boolean.prototype.toString),qE=typeof BigInt>`u`?null:$E(BigInt.prototype.toString),JE=typeof Symbol>`u`?null:$E(Symbol.prototype.toString),YE=$E(Object.prototype.hasOwnProperty),XE=$E(Object.prototype.toString),ZE=$E(RegExp.prototype.test),QE=eD(TypeError);function $E(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return jE(e,t,n)}}function eD(e){return function(){return ME(e,[...arguments])}}function $(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zE;if(CE&&CE(e,null),!RE(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(wE(t)||(t[r]=e),i=e)}e[i]=!0}return e}function tD(e){for(let t=0;t<e.length;t++)YE(e,t)||(e[t]=null);return e}function nD(e){let t=kE(null);for(let r of SE(e)){var n=bE(r,2);let i=n[0],a=n[1];YE(e,i)&&(t[i]=RE(a)?tD(a):a&&typeof a==`object`&&a.constructor===Object?nD(a):a)}return t}function rD(e){switch(typeof e){case`string`:return e;case`number`:return GE(e);case`boolean`:return KE(e);case`bigint`:return qE?qE(e):`0`;case`symbol`:return JE?JE(e):`Symbol()`;case`undefined`:return XE(e);case`function`:case`object`:{if(e===null)return XE(e);let t=e,n=iD(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:XE(e)}return XE(e)}default:return XE(e)}}function iD(e,t){for(;e!==null;){let n=EE(e,t);if(n){if(n.get)return $E(n.get);if(typeof n.value==`function`)return $E(n.value)}e=TE(e)}function n(){return null}return n}function aD(e){try{return ZE(e,``),!0}catch{return!1}}var oD=DE(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),sD=DE(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),cD=DE([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),lD=DE([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),uD=DE(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),dD=DE([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),fD=DE([`#text`]),pD=DE(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),mD=DE(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),hD=DE(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),gD=DE([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),_D=OE(/{{[\w\W]*|^[\w\W]*}}/g),vD=OE(/<%[\w\W]*|^[\w\W]*%>/g),yD=OE(/\${[\w\W]*/g),bD=OE(/^data-[\-\w.\u00B7-\uFFFF]+$/),xD=OE(/^aria-[\-\w]+$/),SD=OE(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),CD=OE(/^(?:\w+script|data):/i),wD=OE(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),TD=OE(/^html$/i),ED=OE(/^[a-z][.\w]*(-[.\w]+)+$/i),DD=OE(/<[/\w!]/g),OD=OE(/<[/\w]/g),kD=OE(/<\/no(script|embed|frames)/i),AD=OE(/\/>/i),jD={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},MD=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],ND=DE($({},MD)),PD=function(){let e={};return NE(MD,t=>{e[t]=OE(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),DE(e)}(),FD=function(){return typeof window>`u`?null:window},ID=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},LD=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},RD=function(e,t,n,r){return YE(e,t)&&RE(e[t])?$(r.base?nD(r.base):{},e[t],r.transform):n},zD=function(e,t,n){let r=YE(e,t)?e[t]:void 0;return r&&typeof r==`object`?nD(r):n()};function BD(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:FD(),t=e=>BD(e);if(t.version=`3.4.15`,t.removed=[],!e||!e.document||e.document.nodeType!==jD.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=iD(d,`cloneNode`),p=iD(d,`remove`),m=iD(d,`removeAttributeNode`),h=iD(d,`nextSibling`),g=iD(d,`childNodes`),_=iD(d,`parentNode`),v=iD(d,`shadowRoot`),y=iD(d,`attributes`),b=o&&o.prototype?iD(o.prototype,`nodeType`):null,x=o&&o.prototype?iD(o.prototype,`nodeName`):null,S=o&&o.prototype?iD(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let ee,T=``,E,te=!1,D=0,ne=function(){if(D>0)throw QE(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},re=function(e){ne(),D++;try{return ee.createHTML(e)}finally{D--}},ie=function(e){ne(),D++;try{return ee.createScriptURL(e)}finally{D--}},ae=function(){return te||=(E=ID(u,i),!0),E},oe=n,se=oe.implementation,ce=oe.createNodeIterator,le=oe.createDocumentFragment,ue=oe.getElementsByTagName,de=r.importNode,O=LD();t.isSupported=typeof SE==`function`&&typeof _==`function`&&se&&se.createHTMLDocument!==void 0;let fe=_D,pe=vD,me=yD,he=bD,ge=xD,_e=CD,ve=wD,ye=ED,be=SD,xe=null,Se=$({},[...oD,...sD,...cD,...uD,...fD]),k=null,Ce=$({},[...pD,...mD,...hD,...gD]),we=Object.seal(kE(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Te=null,Ee=null,A=Object.seal(kE(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),De=!0,Oe=!0,ke=!1,Ae=!0,je=!1,Me=!0,Ne=!1,Pe=!1,Fe=null,Ie=null,Le=!1,Re=!1,ze=!1,j=!1,Be=!0,Ve=!1,He=`user-content-`,Ue=!0,We=!1,Ge={},M=null,Ke=$({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),qe=null,Je=$({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ye=null,Xe=$({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ze=`http://www.w3.org/1998/Math/MathML`,Qe=`http://www.w3.org/2000/svg`,$e=`http://www.w3.org/1999/xhtml`,et=$e,tt=!1,nt=null,rt=$({},[Ze,Qe,$e],BE),it=DE([`mi`,`mo`,`mn`,`ms`,`mtext`]),at=$({},it),ot=DE([`annotation-xml`]),st=$({},ot),ct=$({},[`title`,`style`,`font`,`a`,`script`]),lt=null,ut=[`application/xhtml+xml`,`text/html`],dt=null,ft=null,pt=n.createElement(`form`),mt=function(e){return e instanceof RegExp||e instanceof Function},ht=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ft&&ft===e)return;(!e||typeof e!=`object`)&&(e={}),e=nD(e),lt=ut.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,dt=lt===`application/xhtml+xml`?BE:zE,xe=RD(e,`ALLOWED_TAGS`,Se,{transform:dt}),k=RD(e,`ALLOWED_ATTR`,Ce,{transform:dt}),nt=RD(e,`ALLOWED_NAMESPACES`,rt,{transform:BE}),Ye=RD(e,`ADD_URI_SAFE_ATTR`,Xe,{transform:dt,base:Xe}),qe=RD(e,`ADD_DATA_URI_TAGS`,Je,{transform:dt,base:Je}),M=RD(e,`FORBID_CONTENTS`,Ke,{transform:dt}),Te=RD(e,`FORBID_TAGS`,nD({}),{transform:dt}),Ee=RD(e,`FORBID_ATTR`,nD({}),{transform:dt}),Ge=YE(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?nD(e.USE_PROFILES):e.USE_PROFILES:!1,De=e.ALLOW_ARIA_ATTR!==!1,Oe=e.ALLOW_DATA_ATTR!==!1,ke=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ae=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,je=e.SAFE_FOR_TEMPLATES||!1,Me=e.SAFE_FOR_XML!==!1,Ne=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,ze=e.RETURN_DOM_FRAGMENT||!1,j=e.RETURN_TRUSTED_TYPE||!1,Le=e.FORCE_BODY||!1,Be=e.SANITIZE_DOM!==!1,Ve=e.SANITIZE_NAMED_PROPS||!1,Ue=e.KEEP_CONTENT!==!1,We=e.IN_PLACE||!1,be=aD(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:SD,et=typeof e.NAMESPACE==`string`?e.NAMESPACE:$e,at=zD(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>$({},it)),st=zD(e,`HTML_INTEGRATION_POINTS`,()=>$({},ot));let t=zD(e,`CUSTOM_ELEMENT_HANDLING`,()=>kE(null));if(we=kE(null),YE(t,`tagNameCheck`)&&mt(t.tagNameCheck)&&(we.tagNameCheck=t.tagNameCheck),YE(t,`attributeNameCheck`)&&mt(t.attributeNameCheck)&&(we.attributeNameCheck=t.attributeNameCheck),YE(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(we.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),OE(we),je&&(Oe=!1),ze&&(Re=!0),Ge&&(xe=$({},fD),k=kE(null),Ge.html===!0&&($(xe,oD),$(k,pD)),Ge.svg===!0&&($(xe,sD),$(k,mD),$(k,gD)),Ge.svgFilters===!0&&($(xe,cD),$(k,mD),$(k,gD)),Ge.mathMl===!0&&($(xe,uD),$(k,hD),$(k,gD))),A.tagCheck=null,A.attributeCheck=null,YE(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?A.tagCheck=e.ADD_TAGS:RE(e.ADD_TAGS)&&(xe===Se&&(xe=nD(xe)),$(xe,e.ADD_TAGS,dt))),YE(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?A.attributeCheck=e.ADD_ATTR:RE(e.ADD_ATTR)&&(k===Ce&&(k=nD(k)),$(k,e.ADD_ATTR,dt))),YE(e,`ADD_FORBID_CONTENTS`)&&RE(e.ADD_FORBID_CONTENTS)&&(M===Ke&&(M=nD(M)),$(M,e.ADD_FORBID_CONTENTS,dt)),Ue&&(xe[`#text`]=!0),Ne&&$(xe,[`html`,`head`,`body`]),xe.table&&($(xe,[`tbody`]),delete Te.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw QE(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw QE(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=ee;ee=e.TRUSTED_TYPES_POLICY;try{T=re(``)}catch(e){throw ee=t,e}}else e.TRUSTED_TYPES_POLICY===null?(ee=void 0,T=``):(ee===void 0&&(ee=ae()),ee&&typeof T==`string`&&(T=re(``)));DE&&DE(e),ft=e},gt=$({},[...sD,...cD,...lD]),_t=$({},[...uD,...dD]),vt=function(e,t,n){return t.namespaceURI===$e?e===`svg`:t.namespaceURI===Ze?e===`svg`&&(n===`annotation-xml`||at[n]):!!gt[e]},yt=function(e,t,n){return t.namespaceURI===$e?e===`math`:t.namespaceURI===Qe?e===`math`&&st[n]:!!_t[e]},bt=function(e,t,n){return t.namespaceURI===Qe&&!st[n]||t.namespaceURI===Ze&&!at[n]?!1:!_t[e]&&(ct[e]||!gt[e])},xt=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:et,tagName:`template`});let n=zE(e.tagName),r=zE(t.tagName);return nt[e.namespaceURI]?e.namespaceURI===Qe?vt(n,t,r):e.namespaceURI===Ze?yt(n,t,r):e.namespaceURI===$e?bt(n,t,r):!!(lt===`application/xhtml+xml`&&nt[e.namespaceURI]):!1},St=function(e){IE(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw QE(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},Ct=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},wt=function(e){Dt(e);let t=g(e);if(t){let e=[];NE(t,t=>{IE(e,t)}),NE(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&Ct(e,r,i)}},Tt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}IE(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`)if(Re||ze)try{St(n)}catch{}else try{n.setAttribute(e,``)}catch{}},Et=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||k[dt(i)]||Ct(e,r,i)}},Dt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===jD.element&&Et(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},Ot=function(e,t){return Me?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},kt=function(e){if(!Me)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===jD.processingInstruction||n===jD.comment&&ZE(OD,e.data)){try{p(e)}catch{}continue}if(n===jD.element){let t=e,n=dt(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Ot(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},At=function(e){let t=null,r=null;if(Le)e=`<remove></remove>`+e;else{let t=VE(e,/^[\r\n\t ]+/);r=t&&t[0]}lt===`application/xhtml+xml`&&et===$e&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=ee?re(e):e;if(et===$e)try{t=new l().parseFromString(i,lt)}catch{}if(!t||!t.documentElement){t=se.createDocument(et,`template`,null);try{t.documentElement.innerHTML=tt?T:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),et===$e?ue.call(t,Ne?`html`:`body`)[0]:Ne?t.documentElement:a},jt=function(e){let t=S?S(e):e.ownerDocument;return ce.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Mt=function(e){return e=HE(e,fe,` `),e=HE(e,pe,` `),e=HE(e,me,` `),e},Nt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=ce.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Mt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&NE(i,e=>{Ft(e.content)&&Nt(e.content)})},Pt=function(e){let t=x?x(e):null;return typeof t!=`string`||dt(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Ft=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===jD.documentFragment}catch{return!1}},It=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Lt(e,n,r){e.length!==0&&NE(e,e=>{e.call(t,n,r,ft)})}let Rt=function(e,t){return!!(Me&&e.hasChildNodes()&&!It(e.firstElementChild)&&ZE(DD,e.textContent)&&ZE(DD,e.innerHTML)||Me&&e.namespaceURI===$e&&ND[t]&&(It(e.firstElementChild)||typeof e.textContent==`string`&&ZE(PD[t],e.textContent))||e.nodeType===jD.processingInstruction||Me&&e.nodeType===jD.comment&&ZE(OD,e.data))},zt=function(e,t){return e instanceof RegExp?ZE(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Bt=function(e,t,n){if(!Te[t]&&Kt(t)&&zt(we.tagNameCheck,t))return!1;if(Ue&&!M[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return St(e),!0},Vt=function(e,t,n,r){return e.length===0?t:t===n||t===r?nD(t):t},Ht=function(e,t){return e===t||_(e)!==null?!1:(We&&Dt(e),!0)},Ut=function(e,n){if(Lt(O.beforeSanitizeElements,e,null),Ht(e,n))return!0;if(Pt(e))return St(e),!0;let r=dt(w(e));if(xe=Vt(O.uponSanitizeElement,xe,Se,Fe),Lt(O.uponSanitizeElement,e,{tagName:r,allowedTags:xe}),Ht(e,n))return!0;if(Rt(e,r))return St(e),!0;if(Te[r]||!(A.tagCheck instanceof Function&&A.tagCheck(r))&&!xe[r]){let t=Bt(e,r,n);return t===!1&&Lt(O.afterSanitizeElements,e,null),t}if(C(e)===jD.element&&!xt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&ZE(kD,e.innerHTML))return St(e),!0;if(je&&e.nodeType===jD.text){let n=Mt(e.textContent);e.textContent!==n&&(IE(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Lt(O.afterSanitizeElements,e,null),!1},Wt=function(e,t,r){if(Ee[t]||Ot(t,e)||Be&&(t===`id`||t===`name`)&&(r in n||r in pt))return!1;let i=k[t]||A.attributeCheck instanceof Function&&A.attributeCheck(t,e);return Oe&&ZE(he,t)||De&&ZE(ge,t)?!0:i?Ye[t]||ZE(be,HE(r,ve,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&UE(r,`data:`)===0&&qe[e]||ke&&!ZE(_e,HE(r,ve,``))?!0:!r:Kt(e)&&zt(we.tagNameCheck,e)&&zt(we.attributeNameCheck,t,e)||t===`is`&&we.allowCustomizedBuiltInElements&&zt(we.tagNameCheck,r)},Gt=$({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Kt=function(e){return!Gt[zE(e)]&&ZE(ye,e)},qt=function(e,t,n,r){if(ee&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return re(r);case`TrustedScriptURL`:return ie(r)}return r},Jt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Pt(e)||(St(e),!1)}catch{return Tt(t,e),!1}},Yt=function(e){Lt(O.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||Pt(e))return;k=Vt(O.uponSanitizeAttribute,k,Ce,Ie);let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:k,forceKeepAttr:void 0},i=n.length,a=dt(e.nodeName);for(;i--;){let o=n[i],s=o.name,c=o.namespaceURI,l=o.value,u=dt(s),d=l,f=s===`value`?d:WE(d),p=!1;if(r.attrName=u,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,Lt(O.uponSanitizeAttribute,e,r),f=r.attrValue,Ve&&(u===`id`||u===`name`)&&UE(f,He)!==0&&(Tt(s,e,o),f=He+f,p=!0),Me&&ZE(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){Tt(s,e,o);continue}if(u===`attributename`&&VE(f,`href`)){Tt(s,e,o);continue}if(!r.forceKeepAttr){if(!r.keepAttr){Tt(s,e,o);continue}if(!Ae&&ZE(AD,f)){Tt(s,e,o);continue}if(je&&(f=Mt(f)),!Wt(a,u,f)){Tt(s,e,o);continue}f=qt(a,u,c,f),f!==d&&Jt(e,s,c,f)&&p&&FE(t.removed)}}Lt(O.afterSanitizeAttributes,e,null)},Xt=function(e){let t=null,n=jt(e);for(Lt(O.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Lt(O.uponSanitizeShadowNode,t,null),Ut(t,e),Yt(t),Ft(t.content)&&Xt(t.content),C(t)===jD.element){let e=v(t);Ft(e)&&(Zt(e),Xt(e))}Lt(O.afterSanitizeShadowDOM,e,null)},Zt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Xt(e.shadow);continue}let n=e.node,r=C(n)===jD.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&dt(e)===`template`){let e=n.content;Ft(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Ft(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(tt=!e,tt&&(e=`<!-->`),typeof e!=`string`&&!It(e)&&(e=rD(e),typeof e!=`string`))throw QE(`dirty is not a string, aborting`);if(!t.isSupported)return e;Pe?(xe=Fe,k=Ie):ht(n),(O.uponSanitizeElement.length>0||O.uponSanitizeAttribute.length>0)&&(xe=nD(xe)),O.uponSanitizeAttribute.length>0&&(k=nD(k)),t.removed=[];let c=We&&typeof e!=`string`&&It(e);if(c){kt(e);let t=w(e);if(typeof t==`string`){let n=dt(t);if(!xe[n]||Te[n])throw wt(e),QE(`root node is forbidden and cannot be sanitized in-place`)}if(Pt(e))throw wt(e),QE(`root node is clobbered and cannot be sanitized in-place`);try{Zt(e)}catch(t){throw wt(e),t}}else if(It(e))i=At(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===jD.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Zt(i);else{if(!Re&&!je&&!Ne&&e.indexOf(`<`)===-1)return ee&&j?re(e):e;if(i=At(e),!i)return Re?null:j?T:``}i&&Le&&St(i.firstChild);let l=c?e:i;try{let e=jt(l);for(;o=e.nextNode();)Ut(o,l),Yt(o),Ft(o.content)&&Xt(o.content)}catch(n){throw c&&(wt(e),NE(t.removed,e=>{e.element&&Dt(e.element)})),n}if(c)return NE(t.removed,e=>{e.element&&Dt(e.element)}),je&&Nt(e),e;if(Re){if(je&&Nt(i),ze)for(s=le.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(k.shadowroot||k.shadowrootmode)&&(s=de.call(r,s,!0)),s}let u=Ne?i.outerHTML:i.innerHTML;return Ne&&xe[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&ZE(TD,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
267
|
+
`+u),je&&(u=Mt(u)),ee&&j?re(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ht(e),Pe=!0,Fe=xe,Ie=k},t.clearConfig=function(){ft=null,Pe=!1,Fe=null,Ie=null,ee=E,T=``},t.isValidAttribute=function(e,t,n){ft||ht({});let r=dt(e),i=dt(t);return Wt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&YE(O,e)&&IE(O[e],t)},t.removeHook=function(e,t){if(YE(O,e)){if(t!==void 0){let n=PE(O[e],t);return n===-1?void 0:LE(O[e],n,1)[0]}return FE(O[e])}},t.removeHooks=function(e){YE(O,e)&&(O[e]=[])},t.removeAllHooks=function(){O=LD()},t}var VD=BD(),HD=`png|jpe?g|gif|webp|bmp|svg|avif|ico|tiff?`,UD=`(?:file:\\/\\/(?:(?:localhost)?\\/(?=[^\\s])|[A-Za-z]:[\\\\/]|[^\\/\\s:]+\\/)|\\/(?!\\/)(?!\\s)|[A-Za-z]:[\\\\/](?!\\s)|\\\\\\\\[^\\\\/\\s]+[\\\\/](?!\\s))`,WD=`(?:(?:图|图片|预览图|预览|截图|设计稿|整图|效果图|封面|原图|缩略图|路径|image|img|preview|screenshot|pic|photo|file|path)\\s*[::]\\s*)?`,GD=RegExp(`^(\\s*(?:[-*+]\\s+|\\d+[.)]\\s+)?)(?:(?:图|图片|预览图|预览|截图|设计稿|整图|效果图|封面|原图|缩略图|路径|image|img|preview|screenshot|pic|photo|file|path)\\s*[::]\\s*)?(${UD}.+?\\.(?:${HD}))\\s*$`,`i`),KD=RegExp(`(^|[\\s(「『【>])(${UD}[^\`"'<>()\\[\\]{}\\s()「」『』【】,。;、!?:…·]+?\\.(?:${HD}))(?=\$|[\\s))」』】.,;:!?,。;、!?])`,`gi`),qD=/^\s*(?:```|~~~)/,JD=RegExp(`\\.(?:${HD})`,`i`);function YD(e){return GD.test(e)||iO.test(e)||e.match(cO)!=null||e.match(lO)!=null}function XD(e){let t=[];for(let n=0;n<e.length;){if(!qD.test(e[n])){t.push(e[n]),n++;continue}let r=n+1;for(;r<e.length&&!qD.test(e[r]);)r++;let i=e.slice(n+1,r);if(i.filter(YD).length>=2){t.push(...i),n=r<e.length?r+1:e.length;continue}t.push(e[n]),n++}return t}var ZD=/^\/(?:slices|assets|icons|favicon|__)(?:[/.]|$)/i,QD=e=>ZD.test(String(e)),$D=e=>/[*{}]/.test(String(e)),eO=e=>QD(e)||$D(e),tO=/^(?:…|\.{3,})[\\/]/,nO=`(?:…|\\.{3,})[\\\\/][^\\s\`"'<>()「」『』【】,。;、!?:…]+?\\.(?:${HD})`,rO=RegExp(`(^|[\\s(「『【>→::])(\`?)(${nO})(\`?)`,`gi`),iO=RegExp(`^(\\s*(?:[-*+]\\s+|\\d+[.)]\\s+)?)${WD}(${nO})\\s*$`,`i`);function aO(e,t){let n=String(e).replace(tO,``).replace(/\\/g,`/`);if($D(n))return null;let r=`/${n.replace(/^\/+/,``)}`;return QD(r)?`} "${fO(e)}")`:vO(e,t)}var oO=/!\[([^\]]*)\]\(\s*(data:[^)]*)\)/gi;function sO(e){let t=String(e??``);return!t||!/!\[[^\]]*\]\(\s*data:/i.test(t)?t:t.replace(oO,(e,t,n)=>{let r=/^data:([^;,]*)((?:;[^,]*)*),([\s\S]*)$/i.exec(n),i=String(t||``).trim()||`未命名`;return r?String(r[3]||``).trim()?e:`\`⚠ 图片缺失:${i}(data URI 载荷为空)\``:`\`⚠ 图片缺失:${i}(data URI 结构异常)\``})}var cO=RegExp(`(!\\[[^\\]]*\\]\\()\\s*(${UD}(?:[^\\s?#()]|\\([^\\s()]*\\))+?\\.(?:${HD}))(?=\\s*(?:"[^"]*"|'[^']*')?\\s*\\))`,`gi`),lO=RegExp(`(!\\[[^\\]]*\\]\\()\\s*([^\\s()/?#\\\\](?:[^\\s?#()]|\\([^\\s()]*\\))*?\\.(?:${HD}))(?=\\s*(?:"[^"]*"|'[^']*')?\\s*\\))`,`gi`);function uO(e){return dO(e).replace(/[[\]!]/g,``).trim().slice(0,120)||`预览图`}function dO(e){let t=String(e??``).trim();if(!t||/^(?:data|blob):/i.test(t))return``;let n=t;try{let e=new URL(t,`http://localhost/`);n=e.searchParams.get(`path`)||e.pathname||t,n=decodeURIComponent(n)}catch{try{n=decodeURIComponent(n)}catch{}}return(n.split(/[\\/]/).pop()||``).trim()}function fO(e){return String(e).replace(/"/g,`'`)}function pO(e){return String(e).replace(/\(/g,`%28`).replace(/\)/g,`%29`).replace(/ /g,`%20`)}function mO(e){let t=String(e);if(!t.includes(`%`))return t;try{return decodeURIComponent(t)}catch{return t}}function hO(e){let t=String(e);if(!/^file:\/\//i.test(t))return t;let n=t.replace(/^file:\/\//i,``),r=/^(?:localhost)?(\/.*)$/i.exec(n);if(r){let e=r[1];return/^\/[A-Za-z]:[\\/]/.test(e)?e.slice(1):e}if(/^[A-Za-z]:[\\/]/.test(n))return n;let i=/^([^\/\s:]+)\/(.*)$/.exec(n);return i?`\\\\${i[1]}\\${i[2].replace(/\//g,`\\`)}`:t}function gO(e,t){let n=hO(mO(e));if(eO(n))return null;let r=``;try{r=t(n)}catch{return null}return r?pO(r):null}function _O(e,t){let n=mO(e).replace(/\\/g,`/`);if(/^[A-Za-z][A-Za-z0-9+.-]*:/.test(n)||n.startsWith(`.`)||n.split(`/`).includes(`..`))return null;let r=``;try{r=t(n)}catch{return null}return r?pO(r):null}function vO(e,t){let n=hO(e);if(eO(n))return null;let r=``;try{r=t(n)}catch{return null}if(!r)return null;let i=pO(r);return`}")`}function yO(e,t){let n=sO(e);if(!n||typeof t!=`function`||!JD.test(n))return n;let r=!1;return XD(n.split(`
|
|
268
|
+
`)).map(e=>{if(qD.test(e))return r=!r,e;if(r||!JD.test(e))return e;let n=e.match(GD);if(n){let r=vO(n[2],t);return r===null?e:n[1]+r}let i=e.match(iO);if(i){let n=aO(i[2],t);return n===null?e:i[1]+n}return e.replace(cO,(e,n,r)=>n+(gO(r,t)??r)).replace(lO,(e,n,r)=>n+(_O(r,t)??r)).replace(KD,(e,n,r)=>n+(vO(r,t)??r)).replace(rO,(e,n,r,i)=>{let a=aO(i,t);return a===null?e:n+a})}).join(`
|
|
269
|
+
`)}(function(e){var t=`\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b`,n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:`punctuation`,inside:null},r={bash:n,environment:{pattern:RegExp(`\\$`+t),alias:`constant`},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp(`(\\{)`+t),lookbehind:!0,alias:`constant`}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:`important`},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:`function`},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:`function`}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:`variable`,lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp(`(^|[\\s;|&]|[<>]\\()`+t),lookbehind:!0,alias:`constant`}},alias:`variable`,lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:`variable`,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp(`\\$?`+t),alias:`constant`},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:`class-name`},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:`important`},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:`important`}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=[`comment`,`function-name`,`for-or-select`,`assign-left`,`parameter`,`string`,`environment`,`function`,`keyword`,`builtin`,`boolean`,`file-descriptor`,`operator`,`punctuation`,`number`],a=r.variable[1].inside,o=0;o<i.length;o++)a[i[o]]=e.languages.bash[i[o]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash})(Prism),(function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript})(Prism),(function(e){var t=e.util.clone(e.languages.javascript),n=`(?:\\s|\\/\\/.*(?!.)|\\/\\*(?:[^*]|\\*(?!\\/))\\*\\/)`,r=`(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})`,i=`(?:\\{<S>*\\.{3}(?:[^{}]|<BRACES>)*\\})`;function a(e,t){return e=e.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(e,t)}i=a(i).source,e.languages.jsx=e.languages.extend(`markup`,t),e.languages.jsx.tag.pattern=a(`<\\/?(?:[\\w.:-]+(?:<S>+(?:[\\w.:$-]+(?:=(?:"(?:\\\\[\\s\\S]|[^\\\\"])*"|'(?:\\\\[\\s\\S]|[^\\\\'])*'|[^\\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\\/?)?>`),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside[`attr-value`].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside[`class-name`]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore(`inside`,`attr-name`,{spread:{pattern:a(`<SPREAD>`),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore(`inside`,`special-attr`,{script:{pattern:a(`=<BRACES>`),alias:`language-javascript`,inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:`punctuation`},rest:e.languages.jsx}}},e.languages.jsx.tag);var o=function(e){return e?typeof e==`string`?e:typeof e.content==`string`?e.content:e.content.map(o).join(``):``},s=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r],a=!1;if(typeof i!=`string`&&(i.type===`tag`&&i.content[0]&&i.content[0].type===`tag`?i.content[0].content[0].content===`</`?n.length>0&&n[n.length-1].tagName===o(i.content[0].content[1])&&n.pop():i.content[i.content.length-1].content===`/>`||n.push({tagName:o(i.content[0].content[1]),openedBraces:0}):n.length>0&&i.type===`punctuation`&&i.content===`{`?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&i.type===`punctuation`&&i.content===`}`?n[n.length-1].openedBraces--:a=!0),(a||typeof i==`string`)&&n.length>0&&n[n.length-1].openedBraces===0){var c=o(i);r<t.length-1&&(typeof t[r+1]==`string`||t[r+1].type===`plain-text`)&&(c+=o(t[r+1]),t.splice(r+1,1)),r>0&&(typeof t[r-1]==`string`||t[r-1].type===`plain-text`)&&(c=o(t[r-1])+c,t.splice(r-1,1),r--),t[r]=new e.Token(`plain-text`,c,null,c)}i.content&&typeof i.content!=`string`&&s(i.content)}};e.hooks.add(`after-tokenize`,function(e){(e.language===`jsx`||e.language===`tsx`)&&s(e.tokens)})})(Prism),Q.setOptions({gfm:!0,breaks:!0}),VD.addHook(`afterSanitizeAttributes`,e=>{e.tagName===`A`&&e.getAttribute(`href`)&&(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`)),e.tagName===`IMG`&&(e.setAttribute(`loading`,`lazy`),e.setAttribute(`decoding`,`async`))});var bO={js:`javascript`,mjs:`javascript`,cjs:`javascript`,node:`javascript`,ts:`typescript`,sh:`bash`,shell:`bash`,zsh:`bash`,console:`bash`,html:`markup`,vue:`markup`,xml:`markup`,svg:`markup`,jsonc:`json`,json5:`json`,py:`python`,yml:`yaml`};function xO(e){let t=String(e||``).trim().toLowerCase();if(!t)return``;let n=bO[t]||t;return T_.default.languages[n]?n:``}function SO(e){let t=String(e??``);if(!t.trim())return``;let n=``;try{n=Q.parse(t)}catch{n=`<p>${t.replace(/[&<>]/g,e=>({"&":`&`,"<":`<`,">":`>`})[e])}</p>`}return VD.sanitize(n,{ADD_ATTR:[`target`,`rel`]})}function CO(e){if(!(!e||!e.querySelectorAll))for(let t of e.querySelectorAll(`pre`)){let e=t.querySelector(`code`);if(!e)continue;let n=xO((e.className.match(/language-([\w+-]+)/)||[])[1]||``);if(n&&e.className.indexOf(`language-`)<0&&(e.className=`language-${n}`),n&&!e.dataset.mdHighlighted){try{T_.default.highlightElement(e)}catch{}e.dataset.mdHighlighted=`1`}if(t.dataset.mdCode)continue;t.dataset.mdCode=`1`;let r=document.createElement(`div`);r.className=`md-code`;let i=document.createElement(`div`);i.className=`md-code__bar`;let a=document.createElement(`span`);a.className=`md-code__lang`,a.textContent=n||`text`;let o=document.createElement(`button`);o.type=`button`,o.className=`md-code__copy`,o.textContent=`复制`,o.addEventListener(`click`,async()=>{await sp(e.textContent||``)?(o.textContent=`已复制`,o.classList.add(`is-ok`)):o.textContent=`复制失败`,setTimeout(()=>{o.textContent=`复制`,o.classList.remove(`is-ok`)},1600)}),i.append(a,o),t.parentNode?.insertBefore(r,t),r.append(i,t)}}function wO(e){if(!(!e||!e.querySelectorAll))for(let t of e.querySelectorAll(`pre code[data-md-highlighted]`))delete t.dataset.mdHighlighted}function TO(e){return e?e.nodeType===3?!e.textContent.trim():e.nodeType===1&&e.tagName===`BR`:!1}function EO(e){if(e.length>1)return`${e.length} 张图像`;let t=e[0],n=(t.getAttribute(`alt`)||``).trim();if(n)return n;let r=(t.getAttribute(`title`)||``).trim();return(r?(r.split(/[\\/]/).pop()||``).trim():``)||dO(t.getAttribute(`src`))||`1 张图像`}function DO(e){let t=document.createElement(`div`);t.className=`md-imggroup`,t.dataset.mdImggroup=`1`;let n=document.createElement(`button`);n.type=`button`,n.className=`md-imggroup__head`,n.setAttribute(`aria-expanded`,`false`),n.innerHTML=`<svg class="md-imggroup__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><use href="#icon-images" /></svg><span class="md-imggroup__label"></span><svg class="md-imggroup__chev" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><use href="#icon-chevron-right" /></svg>`,n.querySelector(`.md-imggroup__label`).textContent=EO(e);let r=document.createElement(`div`);return r.className=`md-imggroup__body`,r.hidden=!0,n.addEventListener(`click`,()=>{let e=r.hidden;r.hidden=!e,t.classList.toggle(`is-open`,e),n.setAttribute(`aria-expanded`,e?`true`:`false`)}),t.append(n,r),{group:t,body:r}}function OO(e){if(e.dataset.mdImgFallback)return;e.dataset.mdImgFallback=`1`;let t=()=>{if(!e.isConnected||!(e.complete&&e.naturalWidth===0))return;let t=e.getAttribute(`src`)||``;if(/\.svgz?(?:[?#]|$)/i.test(t)||/^data:image\/svg/i.test(t))return;let n=dO(t)||(e.getAttribute(`alt`)||``).trim()||`未知图片`,r=document.createElement(`span`);r.className=`md-imgfail`,r.textContent=`图片加载失败:${n}`,r.title=t,e.replaceWith(r);let i=r.closest(`.md-imggroup__body`);if(i&&!i.querySelector(`img`)){let e=r.closest(`[data-md-imggroup]`);if(e){let t=e.querySelector(`.md-imggroup__head`);t&&t.remove(),e.classList.add(`is-open`)}}};e.addEventListener(`error`,t,{once:!0}),t()}function kO(e){if(!e||!e.querySelectorAll)return;let t=[...e.querySelectorAll(`img`)];for(let e of t)OO(e);for(let e of t){if(e.closest(`[data-md-imggroup]`))continue;let t=[e],n=e.nextSibling;for(;n;){if(TO(n)){n=n.nextSibling;continue}if(n.tagName===`IMG`&&!n.closest(`[data-md-imggroup]`)){t.push(n),n=n.nextSibling;continue}break}let{group:r,body:i}=DO(t);e.parentNode.insertBefore(r,e);for(let e of t)i.append(e)}}var AO={name:`MarkdownBody`,props:{source:{type:String,default:``},streaming:{type:Boolean,default:!1}},data(){return{html:``,_raf:0}},watch:{source:{immediate:!0,handler(){this.scheduleRender()}},streaming(e){e||this.renderNow()}},beforeUnmount(){this._raf&&cancelAnimationFrame(this._raf),this._raf=0},methods:{scheduleRender(){if(!this.streaming){this.renderNow();return}this._raf||=requestAnimationFrame(()=>{this._raf=0,this.renderNow()})},renderNow(){this._raf&&=(cancelAnimationFrame(this._raf),0),this.html=SO(this.source),this.$nextTick(()=>{let e=this.$refs.bodyEl;e&&(wO(e),CO(e),kO(e))})}}},jO=[`innerHTML`];function MO(e,t,n,r,i,a){return z(),B(R,null,[G(` 模型输出经 marked 解析 + DOMPurify 消毒后注入;代码块由 enhanceCodeBlocks 补高亮与复制按钮 `),H(`div`,{ref:`bodyEl`,class:`md-body`,innerHTML:i.html},null,8,jO)],2112)}var NO=Y(AO,[[`render`,MO],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/MarkdownBody.vue`]]),PO={card_list:`列出卡片`,card_read:`读取卡片`,card_write:`写入卡片`,card_validate:`校验卡片`,card_render_status:`渲染状态`,card_node_models:`组件模型`,card_screenshot:`截图预览`,card_sync:`同步远端卡片`,card_save:`推送到远端`,card_slice_upload:`上传切图`,card_import_meta:`来源侧车`,card_route_input:`输入路由`,card_scaffold:`生成骨架`,card_add_component:`添加组件`,card_history:`编辑历史`,card_rollback:`回滚版本`,skill_read:`读技能文档`,skill_exec:`跑技能脚本`,card_grep:`定位卡片字段`,card_patch:`最小改写卡片`,fs_read:`读文件`,fs_list:`列目录`,fs_write:`写草稿文件`,fs_copy:`复制文件`,shell_exec:`本地命令`};function FO(e){return PO[e]||e||`工具`}function IO(e){let t=e&&e.args||{};return`${typeof t.script==`string`?t.script:``} ${Array.isArray(t.args)?t.args.join(` `):typeof t.command==`string`?t.command:``} ${typeof t.name==`string`?t.name:``}`.toLowerCase()}var LO=[{order:6,id:`S6`,label:`收尾门禁`,hit:(e,t)=>/check_fidelity/.test(t)||/iterate/.test(t)&&/--gate/.test(t)},{order:5,id:`S5`,label:`像素自循环`,hit:(e,t)=>/iterate|diff_bands/.test(t)||e===`card_screenshot`},{order:4,id:`S4`,label:`组件填充`,hit:e=>e===`card_add_component`||e===`card_patch`||e===`card_write`},{order:3,id:`S3`,label:`骨架落盘`,hit:(e,t)=>e===`card_scaffold`||/expand_ir/.test(t)||e===`fs_write`&&/\.ir\.json/.test(t)},{order:2,id:`S2`,label:`设计稿审计`,hit:(e,t)=>/spec_tree|sketch_spec|design_sample|audit_|slice_/.test(t)},{order:1,id:`S1`,label:`输入路由`,hit:e=>e===`card_route_input`}];function RO(e){let t=Math.max(0,Math.round(Number(e||0)/1e3));if(t<60)return`${t} 秒`;let n=Math.floor(t/60);return n<60?`${n} 分 ${t%60} 秒`:`${Math.floor(n/60)} 小时 ${n%60} 分`}function zO(e){let t=Number(e||0);if(!t)return``;let n=new Date(t),r=e=>String(e).padStart(2,`0`);return`${r(n.getHours())}:${r(n.getMinutes())}:${r(n.getSeconds())}`}function BO(e){let t=Number(e||0);return t>0?`+${RO(t)}`:``}function VO(e,t=0){let n=Number(e&&e.startedAt)||0;if(!n)return 0;let r=Number(e&&e.ms)||0;if(r>0)return n+r;let i=Number(t)||0;return i>n?i:0}function HO(e){let t=e&&e.toolName||``,n=IO(e);for(let e of LO)if(e.hit(t,n))return e;return null}var UO=new Set([`card_write`,`card_patch`,`card_scaffold`,`card_add_component`,`fs_write`,`fs_copy`,`card_save`,`card_sync`,`card_slice_upload`]),WO=new Set([`card_read`,`card_list`,`card_node_models`,`card_grep`,`card_history`,`card_validate`,`card_render_status`,`fs_read`,`fs_list`,`skill_read`]);function GO(e){let t=e&&e.toolName||``;return e&&e.error||UO.has(t)||t===`skill_exec`||t===`shell_exec`||t===`card_screenshot`?!0:!WO.has(t)}function KO(e){if(e==null||e===``)return null;if(typeof e==`object`)return e;let t=String(e);try{return JSON.parse(t)}catch{}let n=t.indexOf(`{`),r=t.lastIndexOf(`}`);if(n>=0&&r>n)try{return JSON.parse(t.slice(n,r+1))}catch{return null}return null}function qO(e){let t=IO(e);if(!/--gate|check_fidelity/.test(t))return null;let n=KO(e&&e.result),r=n&&typeof n==`object`?n.gate:null;if(r&&typeof r.passed==`boolean`)return{passed:r.passed,verdict:String(r.verdict||``)};let i=String(e&&e.result||``);if(!/"passed"\s*:/.test(i))return null;let a=/"passed"\s*:\s*(true|false)/.exec(i),o=/"verdict"\s*:\s*"((?:[^"\\]|\\.)*)"/.exec(i);return a?{passed:a[1]===`true`,verdict:o?o[1].replace(/\\n/g,` `):``}:null}var JO=/\s#([^\s#]+)\s*$/;function YO(e){let t=String(e??``),n=JO.exec(t);return n?{text:t.slice(0,n.index).trim(),cid:n[1]}:{text:t,cid:``}}var XO=12;function ZO(e){let t=e&&e.toolName||``,n=KO(e&&e.result);if(!n||typeof n!=`object`)return null;let r=t===`card_validate`?n:n.verify&&n.verify.validate;if(!r||typeof r!=`object`||!Array.isArray(r.errors))return null;let i=Array.isArray(r.warnings)?r.warnings:[],a=[...r.errors.map(e=>({level:`error`,...YO(e)})),...i.map(e=>({level:`warn`,...YO(e)}))].slice(0,XO);return{ok:r.ok!==!1&&r.errors.length===0,errors:r.errors.length,warnings:i.length,issues:a}}function QO(e){let t=Array.isArray(e)?e:[],n=0,r=0,i=0,a=0,o=null,s=null;for(let e of t){e.error&&a++,UO.has(e.toolName)&&(e.error?r++:n++),e.toolName===`card_screenshot`&&!e.error&&i++;let t=ZO(e);t&&(o=t);let c=qO(e);c&&(s=c)}return{total:t.length,writes:n,writeFails:r,shots:i,failed:a,validate:o,gate:s}}var $O={length:`单次输出上限截断:调高「单次输出上限」,或要求 AI 走紧凑 IR 路线(fs_write 写 IR → expand_ir 展开)`,stall:`上游长时间静默:多为网关 / 网络抖动。上下文与已落盘产物都在,重试本轮即可接着做`,empty:`网关连续返回空响应:重试本轮,或检查网关额度 / 换个时间段`,context:`上下文超出网关窗口:后端已自动压缩重试仍失败,建议新开一轮或清理对话记录`,network:`连不上网关:检查网络与 Base URL 后重试本轮`,"rate-limit":`网关限流或额度不足:稍后重试,或换一个 API Key`,auth:`API Key 无效或权限不足:到设置里更新 Key 再重试`,"wrap-failed":`熔断收尾的进度汇总也没拿到:上下文已保留,回复「继续」接着做`,aborted:`本轮已中止:已执行的写入都保留,可从中断处继续`,unknown:`未归类的失败:复制错误原文排查,或换个说法重试本轮`};function ek(e){return{hint:$O[e]||``,action:e===`length`||e===`auth`?`settings`:e===`wrap-failed`||e===`aborted`?`continue`:`retry`}}var tk=/^\s*(\d+)\.\s+(.+?)\s+\((\d+x\d+|\?)\)\s*(.*)$/,nk=/--pick\s+([\d.,~]+)/;function rk(e){if(typeof e!=`string`||!e.includes(`--pick`))return[];let t=[];for(let n of e.split(`
|
|
270
|
+
`)){let e=n.match(tk);if(!e)continue;let r=(e[4].match(nk)||[])[1];r&&t.push({no:Number(e[1]),name:e[2].trim(),size:e[3],pick:r})}return t}var ik=/^(\d+)\.(\d+)~(\d+)\.(\d+)$/,ak=/^\d+\.\d+$/;function ok(e){let t=[];for(let n of e||[]){if(!n||!n.pick)continue;let e=String(n.pick),r=e.match(ik),i=r?Number(r[2]):0,a=r?Number(r[4]):0;if(r&&r[1]===r[3]&&a>i){for(let e=i;e<=a;e+=1)t.push({...n,pick:`${r[1]}.${e}`,token:`${r[1]}.${e}`,kind:`card`});t.push({...n,token:`全 ${a-i+1} 张`,kind:`all`});continue}t.push({...n,token:e,kind:ak.test(e)?`card`:`board`})}return t}function sk(e){let t=Array.isArray(e)?e:[];for(let e=t.length-1;e>=0;--e){let n=t[e]&&t[e].toolCalls;if(Array.isArray(n)){for(let e=n.length-1;e>=0;--e)if(n[e]&&rk(n[e].result).length)return n[e]}}return null}function ck(e,t=``){if(!e||!e.pick)return``;let n=e.name?`「${e.name}」`:``,r=e.kind===`card`||ak.test(String(e.pick))?`(只建这一张卡,同画板的其它卡不要一起建)`:``,i=t?`落点卡 = 当前卡 ${t}(覆盖它,不是新建;要另建新卡我会直说)。`:``;return`建卡:画板 ${e.no}${n}。${i}参数已选好,照抄重跑:parse_meaxure.py --build --pick ${e.pick}${r}`}var lk={name:`ChatToolRow`,components:{MarkdownBody:NO},props:{tc:{type:Object,required:!0},turnTs:{type:Number,default:0},nowTs:{type:Number,default:0},pickOwner:{type:Object,default:null}},emits:[`approval`,`pick-board`],data(){return{opened:null}},computed:{state(){return this.tc.error?`error`:this.tc.result!==void 0&&this.tc.result!==null?`done`:this.tc.pending?`pending`:`running`},open(){return this.opened===null?!!this.tc.error||this.boardPicks.length>0:this.opened},boardPicks(){return this.pickOwner&&this.tc!==this.pickOwner?[]:ok(rk(this.tc.result))},msText(){let e=this.tc.ms;return e?e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`:``},stampText(){return zO(this.tc.startedAt)},cumText(){let e=VO(this.tc,this.nowTs);return e&&this.turnTs?BO(e-this.turnTs):``},clockText(){return[this.stampText,this.cumText].filter(Boolean).join(` · `)},clockTitle(){let e=[];return this.stampText&&e.push(`开始于 ${this.stampText}`),this.cumText&&e.push(`距本轮开始 ${this.cumText.slice(1)}`),this.msText&&e.push(`本步耗时 ${this.msText}`),e.join(` · `)},approvalCommand(){if(this.tc.command)return String(this.tc.command);let e=this.tc.args||{};return typeof e.command==`string`&&e.command?e.command:this.tc.toolName===`skill_exec`?[e.script,Array.isArray(e.args)?e.args.join(` `):``].filter(Boolean).join(` `):JSON.stringify(e)},argSummary(){if(this.tc.toolName===`skill_exec`&&this.tc.args?.script){let e=[String(this.tc.args.script).replace(/^skills\//,``),(Array.isArray(this.tc.args.args)?this.tc.args.args:[]).map(e=>String(e).replace(/^\/[^\s]{20,}$/,e=>`…/${e.slice(-14)}`)).join(` `)].filter(Boolean).join(` `);return e.length>96?`${e.slice(0,96)}…`:e}let e=this.tc.args||{},t=[];for(let[n,r]of Object.entries(e)){if(r==null||r===``)continue;let e=typeof r==`object`?JSON.stringify(r):String(r);if(t.push(`${n}=${e.length>28?`${e.slice(0,28)}…`:e}`),t.join(` `).length>56)break}let n=t.join(` `);return n.length>72?`${n.slice(0,72)}…`:n},argsSource(){let e=this.tc.args||{};if(!Object.keys(e).length)return``;if(this.tc.toolName===`skill_exec`&&typeof e.script==`string`){if(!this.tc.error)return``;let t=Array.isArray(e.args)?e.args.join(` `):``;return`\`\`\`\n${[e.script,t].filter(Boolean).join(` `)}\n\`\`\``}if(this.tc.toolName===`shell_exec`&&typeof e.command==`string`)return this.tc.error?`\`\`\`\n${e.command}\n\`\`\``:``;let t=``;try{t=JSON.stringify(e,null,2)}catch{t=String(e)}return`\`\`\`json\n${t}\n\`\`\``},resultSource(){let e=this.tc.result;if(e==null||e===``||this.boardPicks.length&&!this.tc.error)return``;let t=typeof e==`string`?e:JSON.stringify(e);try{t=JSON.stringify(JSON.parse(t),null,2)}catch{}t.length>4e3&&(t=`${t.slice(0,4e3)}\n…(已截断)`);let n=`\`\`\`json\n${t}\n\`\`\``;return this.tc.truncated?`${n}\n\n> 结果过长,面板只显示前 4000 字;喂给模型的上下文另有额度,不受此限。`:n}},methods:{toolLabel:FO,toggle(){this.opened=!this.open}}},uk=[`aria-expanded`],dk={key:0,class:`aitool__spin`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},fk={key:1,class:`aitool__status`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},pk={key:2,class:`aitool__status`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},mk={class:`aitool__name`},hk={class:`aitool__args`},gk=[`title`],_k=[`title`],vk={key:0,class:`aitool__approve`},yk=[`title`],bk={class:`aitool__approve-hint`},xk={class:`aitool__approve-hint`},Sk=[`title`],Ck={class:`aitool__body`},wk={key:0,class:`aitool__picks`},Tk=[`title`,`aria-label`,`onClick`],Ek={class:`aitool__pick-no`},Dk={class:`aitool__pick-arg`},Ok=[`src`],kk={key:3,class:`aitool__error`};function Ak(e,t,n,r,i,a){let o=I(`MarkdownBody`);return z(),B(R,null,[G(` 单次工具调用:一行摘要,可展开看参数 / 结果 / 截图。
|
|
268
271
|
抽成独立组件的原因:ChatMessage 要把「连续同名调用」折叠成分组行,
|
|
269
|
-
分组展开后的成员行与平铺行走的是同一份标记,复制两遍必然漂移 `),
|
|
270
|
-
长任务里「卡在哪一步、卡了多久」全靠这三个数互相对齐 `),a.clockText?(
|
|
271
|
-
错一位建错画板的。点一下 = 把清单行尾那串原样的 --pick 直接发给模型,中间零翻译 `),a.boardPicks.length?(
|
|
272
|
-
`);i=n.pop()||``;for(let e of n){let n=e.trim();if(!n.startsWith(`data:`))continue;let r=n.slice(5).trim();if(!r)continue;let i;try{i=JSON.parse(r)}catch{continue}if(t(i)===!0)return!0}return!1};try{for(;;){let{done:e,value:t}=await n.read();if(e||a(r.decode(t,{stream:!0})))break}a(r.decode())}finally{try{n.releaseLock?.()}catch{}}}async function
|
|
273
|
-
`).map(e=>e.trim()).filter(Boolean),t=e[e.length-1]||``;return t.length>72?`${t.slice(0,72)}…`:t}},watch:{streaming:{immediate:!0,handler(e){e?this.startTick():this.stopTick()}},thinking(e){e||this.stopTick()}},beforeUnmount(){this.stopTick()},updated(){let e=this.$refs.thinkPre;e&&this.thinkOpen&&this.thinking&&(e.scrollTop=e.scrollHeight)},methods:{startTick(){this.stopTick(),this.elapsed=0,this._tick=setInterval(()=>{this.elapsed+=250},250)},stopTick(){this._tick&&clearInterval(this._tick),this._tick=0},fmtStamp:
|
|
274
|
-
行标记抽到 ChatToolRow:分组内成员与平铺行走同一份模板,两处不会漂移 `),(
|
|
275
|
-
「上下文折叠过几次 / 自动续跑过几次 / 网关重试过没有」这些线索全靠这里留存 `),a.events.length?(
|
|
276
|
-
把「最后一次工具调用之前」那段折成一行——收尾结论照常展开,记录不再是一堵墙 `),a.narrationText?(
|
|
277
|
-
所以重开面板、刷新之后这条摘要依然在,而不是只在当轮可见 `),a.showSummary?(
|
|
278
|
-
组件结构里选中那个节点——不用再照着一句 "at depth 1[0]" 自己去树里翻 `),a.validateIssues.length?(
|
|
279
|
-
此前只有熔断收尾(budget)分支有按钮,手滑终止后用户只能自己打字 `),n.msg.status===`aborted`?(B(),V(`div`,MA,[t[29]||=U(`span`,{class:`aimsg__aborted-text`},`已终止生成`,-1),a.turnClock.endStamp?(B(),V(`span`,NA,M(a.turnClock.endStamp)+` 终止 · 已用 `+M(a.turnClock.total),1)):K(`v-if`,!0),n.canRegenerate&&!n.streaming?(B(),V(`button`,{key:1,type:`button`,class:`aimsg__budget-go`,onClick:t[11]||=t=>e.$emit(`continue`)},`从中断处继续`)):K(`v-if`,!0)])):n.msg.budget?.message?(B(),V(`div`,{key:9,class:`aimsg__budget`,title:a.budgetHint},[t[30]||=U(`svg`,{class:`aimsg__budget-icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-alert-triangle`})],-1),U(`span`,FA,[U(`strong`,null,M(a.budgetLabel),1),G(`:`+M(n.msg.budget.message)+`(上下文已保留)`,1)]),n.canRegenerate&&!n.streaming?(B(),V(`button`,{key:0,type:`button`,class:`aimsg__budget-go`,onClick:t[12]||=t=>e.$emit(`continue`)},`继续这轮`)):K(`v-if`,!0)],8,PA)):K(`v-if`,!0),K(` 悬停操作:复制 / 重新生成(仅最后一条助手消息可重发) `),n.msg.content||n.msg.error?(B(),V(`footer`,IA,[U(`button`,{type:`button`,class:`aimsg__act`,title:i.copied?`已复制`:`复制回答`,onClick:t[13]||=(...e)=>a.copyText&&a.copyText(...e)},[(B(),V(`svg`,RA,[U(`use`,{href:i.copied?`#icon-check`:`#icon-copy-sm`},null,8,zA)])),U(`span`,null,M(i.copied?`已复制`:`复制`),1)],8,LA),n.canRegenerate&&!n.streaming?(B(),V(`button`,{key:0,type:`button`,class:`aimsg__act`,title:`丢弃这次回答并重新生成`,onClick:t[14]||=t=>e.$emit(`regenerate`,n.msg)},[...t[31]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-reset`})],-1),U(`span`,null,`重新生成`,-1)]])):K(`v-if`,!0)])):K(`v-if`,!0)],64))],2)}var VA=X(Ok,[[`render`,BA],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ChatMessage.vue`]]),HA=106,UA=.5,WA=`cardbuddy:ai-composer-height`,GA={name:`ChatComposer`,props:{busy:{type:Boolean,default:!1},model:{type:String,default:``},attachments:{type:Array,default:()=>[]},placeholder:{type:String,default:`描述你要改的卡片,Enter 发送 / Shift+Enter 换行`},context:{type:Object,default:null}},emits:[`send`,`stop`,`pick`,`add-path`,`remove-attachment`,`drop-files`,`paste-image`,`escape`],data(){return{text:``,attachOpen:!1,pathInputOpen:!1,pathText:``,dragOver:!1,heightPx:0,resizing:!1,compArmed:!1,_compTimer:null,_outside:null,_onWinResize:null}},computed:{canSend(){return!!(this.text.trim()||this.attachments.some(e=>!e.pending&&e.exists!==!1))},compStyle(){return this.heightPx>0?{height:`${this.heightPx}px`}:null},ctx(){let e=this.context;if(!e)return null;let t=Number(e.window)>0?Number(e.window):Number(e.total)>0?Number(e.total):0,n=Math.max(0,Number(e.used)||0);if(!(t>0))return null;let r=Math.min(1,n/t),i=2*Math.PI*8;return{pct:r,arc:(i*r).toFixed(2),circ:i.toFixed(2),pctLabel:`${Math.round(r*100)}%`,level:r>=.85?`danger`:r>=.6?`warn`:`ok`,used:n,total:t}},ctxTitle(){let e=this.ctx;if(!e)return``;let t=e=>e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e)),n=Number(this.context?.window)>0?` · 网关窗口 ${t(Number(this.context.window))}`:``;return`上下文占用 ${t(e.used)} / ${t(e.total)} token(${e.pctLabel})${n};接近上限时后端会自动折叠早期工具结果`}},mounted(){this._outside=e=>{let t=this.$refs.attachEl;t&&!t.contains(e.target)&&(this.attachOpen=!1)},document.addEventListener(`mousedown`,this._outside),this.loadHeight(),this._onWinResize=()=>this.clampHeight(),window.addEventListener(`resize`,this._onWinResize),this.autoGrow()},beforeUnmount(){this._outside&&document.removeEventListener(`mousedown`,this._outside),this._onWinResize&&window.removeEventListener(`resize`,this._onWinResize)},methods:{focus(){this.$nextTick(()=>this.$refs.taEl?.focus())},setText(e){this.text=e,this.focus(),this.autoGrow()},fileUrl(e){return $O(e)},chipSub(e){if(e.exists===!1)return`不可读`;if(e.isDir)return`${e.entryCount??e.entries?.length??0} 项`;let t=Number(e.size||0);return t?t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(0)} KB`:`${(t/1024/1024).toFixed(1)} MB`:``},autoGrow(){let e=this.$refs.taEl;if(e){if(this.heightPx>0){e.style.height=``;return}e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,168)}px`}},heightLimits(){let e=this.$el?.closest(`.aichat`)?.clientHeight||window.innerHeight;return{min:HA,max:Math.max(HA,Math.floor(e*UA))}},clampHeight(){if(!this.heightPx)return;let{min:e,max:t}=this.heightLimits();this.heightPx=Math.max(e,Math.min(t,this.heightPx))},loadHeight(){try{let e=localStorage.getItem(WA),t=e==null?0:parseInt(e,10);!Number.isNaN(t)&&t>=HA&&(this.heightPx=t)}catch{}this.clampHeight()},saveHeight(){try{this.heightPx?localStorage.setItem(WA,String(Math.round(this.heightPx))):localStorage.removeItem(WA)}catch{}},armComp(){clearTimeout(this._compTimer),this._compTimer=setTimeout(()=>{this.compArmed=!0},300)},disarmComp(){clearTimeout(this._compTimer),this._compTimer=null,!this.resizing&&(this.compArmed=!1)},startResize(e){let t=e&&e.currentTarget;if(!t||!this.compArmed)return;this.resizing=!0,document.body.style.cursor=`row-resize`,document.body.style.userSelect=`none`;let n=e.pointerId;try{t.setPointerCapture(n)}catch{}let r=this.$el.getBoundingClientRect().bottom,i=e=>{let{min:t,max:n}=this.heightLimits();this.heightPx=Math.max(t,Math.min(n,Math.round(r-e.clientY)))},a=()=>{t.removeEventListener(`pointermove`,i),t.removeEventListener(`pointerup`,a),t.removeEventListener(`pointercancel`,a),window.removeEventListener(`blur`,a);try{t.hasPointerCapture?.(n)&&t.releasePointerCapture(n)}catch{}this.resizing=!1,document.body.style.cursor=``,document.body.style.userSelect=``,this.saveHeight()};t.addEventListener(`pointermove`,i),t.addEventListener(`pointerup`,a),t.addEventListener(`pointercancel`,a),window.addEventListener(`blur`,a)},resetHeight(){this.heightPx=0,this.saveHeight(),this.$nextTick(this.autoGrow)},onKeydown(e){if(e.key===`Escape`){e.preventDefault(),this.$emit(`escape`);return}e.key===`Enter`&&(e.isComposing||e.keyCode===229||e.shiftKey||(e.preventDefault(),this.busy||this.submit()))},submit(){if(this.busy||!this.canSend)return;let e={text:this.text.trim(),attachments:this.attachments.filter(e=>!e.pending&&e.exists!==!1)};this.text=``,this.attachOpen=!1,this.$nextTick(this.autoGrow),this.$emit(`send`,e)},toggleAttach(){this.attachOpen=!this.attachOpen},pick(e){this.attachOpen=!1,this.$emit(`pick`,e)},openPathInput(){this.attachOpen=!1,this.pathInputOpen=!0,this.pathText=``,this.$nextTick(()=>this.$refs.pathEl?.focus())},closePathInput(){this.pathInputOpen=!1,this.pathText=``},confirmPath(){let e=this.pathText.trim();e&&(this.$emit(`add-path`,e),this.closePathInput())},onDragEnter(){this.dragOver=!0},onDragOver(){this.dragOver=!0},onDragLeave(){this.dragOver=!1},onDrop(e){this.dragOver=!1;let t=e.dataTransfer;t&&this.$emit(`drop-files`,t)},async onPaste(e){let t=e.clipboardData?.items;if(t){for(let n of t)if(n.type&&n.type.indexOf(`image/`)===0){let t=n.getAsFile();if(!t)continue;e.preventDefault();let r=await new Promise(e=>{let n=new FileReader;n.onload=()=>e(String(n.result||``)),n.onerror=()=>e(``),n.readAsDataURL(t)});r&&this.$emit(`paste-image`,r);return}}}}},KA={key:0,class:`aicomp__files`},qA=[`title`],JA=[`src`,`alt`],YA={key:1,class:`aichip__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},XA=[`href`],ZA={class:`aichip__name`},QA={key:2,class:`aichip__sub`},$A=[`onClick`],ej={key:1,class:`aicomp__path`},tj=[`disabled`],nj=[`placeholder`],rj={class:`aicomp__bar`},ij={class:`aicomp__tools`},aj={class:`aicomp__attach`,ref:`attachEl`},oj={key:0,class:`aicomp__menu`,role:`menu`},sj={class:`aicomp__right`},cj=[`title`],lj={class:`aicomp__ctx-ring`,viewBox:`0 0 20 20`,"aria-hidden":`true`},uj=[`stroke-dasharray`],dj={class:`aicomp__ctx-pct`},fj=[`title`],pj=[`disabled`,`title`];function mj(e,t,n,r,i,a){return B(),V(`div`,{class:j([`aicomp`,{"is-busy":n.busy,"is-drag":i.dragOver,"is-manual":i.heightPx>0,"is-resizing":i.resizing}]),style:A(a.compStyle)},[K(` 上缘拖拽把手:调输入区高度(106px ~ 面板高度 50%,双击恢复自适应),与面板宽度把手同一套交互 `),U(`div`,{class:j([`aicomp__grip`,{"is-dragging":i.resizing,"is-armed":i.compArmed}]),title:`拖拽调整输入区高度(双击恢复自适应)`,onMouseenter:t[0]||=(...e)=>a.armComp&&a.armComp(...e),onMouseleave:t[1]||=(...e)=>a.disarmComp&&a.disarmComp(...e),onPointerdown:t[2]||=q((...e)=>a.startResize&&a.startResize(...e),[`prevent`]),onDblclick:t[3]||=q((...e)=>a.resetHeight&&a.resetHeight(...e),[`prevent`])},null,34),K(` 已挂载的本地文件:只预览 + 传路径,不上传 `),n.attachments.length?(B(),V(`div`,KA,[(B(!0),V(z,null,R(n.attachments,n=>(B(),V(`div`,{key:n.id||n.path,class:j([`aichip`,{"aichip--dir":n.isDir,"aichip--pending":n.pending,"aichip--missing":n.exists===!1}]),title:n.path},[n.isImage&&!n.pending?(B(),V(`img`,{key:0,class:`aichip__thumb`,src:a.fileUrl(n.path),alt:n.name,loading:`lazy`},null,8,JA)):(B(),V(`svg`,YA,[U(`use`,{href:n.pending?`#icon-loading`:n.isDir?`#icon-folder-plus`:n.isImage?`#icon-image`:`#icon-file-text`},null,8,XA)])),U(`span`,ZA,M(n.pending?`解析路径中…`:n.name),1),n.pending?K(`v-if`,!0):(B(),V(`span`,QA,M(a.chipSub(n)),1)),U(`button`,{type:`button`,class:`aichip__rm`,title:`移除`,onClick:t=>e.$emit(`remove-attachment`,n.id||n.path)},[...t[24]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-x`})],-1)]],8,$A)],10,qA))),128))])):K(`v-if`,!0),K(` 粘贴绝对路径(非 macOS / 拖拽反查失败时的兜底入口) `),i.pathInputOpen?(B(),V(`div`,ej,[I(U(`input`,{ref:`pathEl`,"onUpdate:modelValue":t[4]||=e=>i.pathText=e,class:`aicomp__path-input`,type:`text`,placeholder:`粘贴本地图片或文件夹的绝对路径,回车确认`,spellcheck:`false`,onKeydown:[t[5]||=vl(q((...e)=>a.confirmPath&&a.confirmPath(...e),[`prevent`]),[`enter`]),t[6]||=vl(q((...e)=>a.closePathInput&&a.closePathInput(...e),[`stop`,`prevent`]),[`esc`])]},null,544),[[il,i.pathText]]),U(`button`,{type:`button`,class:`aicomp__path-ok`,disabled:!i.pathText.trim(),onClick:t[7]||=(...e)=>a.confirmPath&&a.confirmPath(...e)},`添加`,8,tj),U(`button`,{type:`button`,class:`aicomp__path-no`,onClick:t[8]||=(...e)=>a.closePathInput&&a.closePathInput(...e)},`取消`)])):K(`v-if`,!0),U(`div`,{class:`aicomp__box`,onDragenter:t[20]||=q((...e)=>a.onDragEnter&&a.onDragEnter(...e),[`prevent`]),onDragover:t[21]||=q((...e)=>a.onDragOver&&a.onDragOver(...e),[`prevent`]),onDragleave:t[22]||=q((...e)=>a.onDragLeave&&a.onDragLeave(...e),[`prevent`]),onDrop:t[23]||=q((...e)=>a.onDrop&&a.onDrop(...e),[`prevent`])},[I(U(`textarea`,{ref:`taEl`,"onUpdate:modelValue":t[9]||=e=>i.text=e,class:`aicomp__ta`,placeholder:n.placeholder,rows:`1`,onInput:t[10]||=(...e)=>a.autoGrow&&a.autoGrow(...e),onKeydown:t[11]||=(...e)=>a.onKeydown&&a.onKeydown(...e),onPaste:t[12]||=(...e)=>a.onPaste&&a.onPaste(...e)},null,40,nj),[[il,i.text]]),U(`div`,rj,[U(`div`,ij,[U(`div`,aj,[U(`button`,{type:`button`,class:j([`aicomp__iconbtn`,{"is-open":i.attachOpen}]),title:`挂载本地图片 / 文件 / 文件夹`,onClick:t[13]||=(...e)=>a.toggleAttach&&a.toggleAttach(...e)},[...t[25]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-paperclip`})],-1)]],2),i.attachOpen?(B(),V(`div`,oj,[U(`button`,{type:`button`,role:`menuitem`,onClick:t[14]||=e=>a.pick(`image`)},[...t[26]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-image`})],-1),G(` 本地图片… `,-1)]]),U(`button`,{type:`button`,role:`menuitem`,onClick:t[15]||=e=>a.pick(`file`)},[...t[27]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-file-text`})],-1),G(` 本地文件… `,-1)]]),U(`button`,{type:`button`,role:`menuitem`,onClick:t[16]||=e=>a.pick(`folder`)},[...t[28]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-folder-plus`})],-1),G(` 本地文件夹… `,-1)]]),t[30]||=U(`div`,{class:`aicomp__menu-sep`},null,-1),U(`button`,{type:`button`,role:`menuitem`,onClick:t[17]||=(...e)=>a.openPathInput&&a.openPathInput(...e)},[...t[29]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-link`})],-1),G(` 粘贴路径… `,-1)]])])):K(`v-if`,!0)],512),t[31]||=U(`span`,{class:`aicomp__hint`},`拖拽文件 / 文件夹到此,或直接 ⌘V 粘贴截图`,-1)]),U(`div`,sj,[a.ctx?(B(),V(`span`,{key:0,class:j([`aicomp__ctx`,`is-${a.ctx.level}`]),title:a.ctxTitle},[(B(),V(`svg`,lj,[t[32]||=U(`circle`,{class:`aicomp__ctx-track`,cx:`10`,cy:`10`,r:`8`},null,-1),U(`circle`,{class:`aicomp__ctx-arc`,cx:`10`,cy:`10`,r:`8`,"stroke-dasharray":`${a.ctx.arc} ${a.ctx.circ}`,transform:`rotate(-90 10 10)`},null,8,uj)])),U(`span`,dj,M(a.ctx.pctLabel),1)],10,cj)):K(`v-if`,!0),n.model?(B(),V(`span`,{key:1,class:`aicomp__model`,title:`当前模型:${n.model}`},M(n.model),9,fj)):K(`v-if`,!0),n.busy?(B(),V(`button`,{key:2,type:`button`,class:`aicomp__send aicomp__send--stop`,title:`终止生成(Esc)`,onClick:t[18]||=t=>e.$emit(`stop`)},[...t[33]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"aria-hidden":`true`},[U(`use`,{href:`#icon-stop`})],-1)]])):(B(),V(`button`,{key:3,type:`button`,class:`aicomp__send`,disabled:!a.canSend,title:a.canSend?`发送(Enter)`:`输入内容后发送`,onClick:t[19]||=(...e)=>a.submit&&a.submit(...e)},[...t[34]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-send`})],-1)]],8,pj))])])],32)],6)}var hj=X(GA,[[`render`,mj],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ChatComposer.vue`]]),gj={name:`AiSettings`,components:{NumberStepper:Ag,Switch:ZC},props:{config:{type:Object,default:()=>({baseUrl:``,model:``,hasKey:!1,apiKeyMasked:``})},modelId:{type:String,default:null},initialModel:{type:Object,default:null}},emits:[`close`,`saved`],data(){let e=this.modelId&&this.initialModel||{};return{form:{name:e.name||``,baseUrl:e.baseUrl||``,model:e.model||``,apiKey:``,thinking:e.thinking!==!1,vision:e.vision===!0,maxTokens:e.maxTokensAuto?0:Number(e.maxTokens)>0?Number(e.maxTokens):0},reveal:!1,saving:!1,testing:!1,probing:!1,ping:null,help:null,keyLoaded:!1,submitted:!1,touched:{}}},computed:{title(){return this.modelId?`编辑模型`:`添加模型`},errors(){let e={},t=this.form.baseUrl.trim(),n=this.form.model.trim();return t?/^https?:\/\/[^\s]+$/i.test(t)||(e.baseUrl=`Base URL 需以 http:// 或 https:// 开头`):e.baseUrl=`请填写 Base URL`,n||(e.model=`请填写模型名`),!this.keyLoaded&&!this.form.apiKey.trim()&&(e.apiKey=`请填写 API Key`),e},isValid(){return Object.keys(this.errors).length===0},knownCapLimit(){return(Number(this.config.maxTokensCap)>0?Number(this.config.maxTokensCap):0)||(Number(this.config.maxTokensWindow)>0?Number(this.config.maxTokensWindow):0)},maxTokensOver(){return this.knownCapLimit>0&&this.form.maxTokens>this.knownCapLimit},maxTokensPlaceholder(){let e=Number(this.config.maxTokens)>0?Number(this.config.maxTokens):0;return e>0?`留空 = 自动(当前按 ${e})`:`留空 = 自动`},keyPlaceholder(){return this.keyLoaded?this.form.apiKey?``:`已保存的密钥为空,请填写新密钥`:this.config.hasKey?`已保存(${this.config.apiKeyMasked||`••••`}),回显失败:留空沿用、填写覆盖`:`sk-…`}},created(){this.loadKey()},mounted(){document.addEventListener(`click`,this.onDocClick,!0),document.addEventListener(`keydown`,this.onKeydown)},beforeUnmount(){document.removeEventListener(`click`,this.onDocClick,!0),document.removeEventListener(`keydown`,this.onKeydown)},methods:{toggleHelp(e){this.help=this.help===e?null:e},showError(e){return!!this.errors[e]&&(this.submitted||this.touched[e])},markTouched(e){this.$set(this.touched,e,!0)},onDocClick(e){if(!this.help)return;let t=e.target;t instanceof Element&&t.closest(`.aiset__pop, .aiset__help`)||(this.help=null)},onKeydown(e){e.key===`Escape`&&this.help&&(e.stopPropagation(),this.help=null)},onMaxTokens(e){let t=Number(String(e).trim());this.form.maxTokens=Number.isFinite(t)&&t>=0?Math.round(t):0},async probe(){let e=[];if(this.form.baseUrl.trim()||e.push(`Base URL`),this.form.apiKey.trim()||e.push(`API Key`),this.form.model.trim()||e.push(`模型名`),e.length){this.ping={ok:!1,text:`探测前请先填写:${e.join(` / `)}`};return}this.probing=!0,this.ping=null;try{let e=await uk({baseUrl:this.form.baseUrl,apiKey:this.form.apiKey,model:this.form.model}),t=Number(e.window)>0?Number(e.window):0,n=Number(e.cap)>0?Number(e.cap):0;if(n>0){this.form.maxTokens=n;let r=e.source===`models-meta`?`模型元数据`:e.source===`probe`?`二分试探`:e.source===`halved`?`减半回写`:e.source||`探测`,i=[`接受单次输出上限 ${n}`];t>0&&i.push(`上下文窗口 ${t}`),this.ping={ok:!0,text:`网关${i.join(`、`)}(来源:${r})→ 已填入 ${n};留空则走自动(取 min(上限, ${Number(e.ceiling)>0?e.ceiling:32768}) = ${Number(e.autoMax)>0?e.autoMax:n})`}}else{let n=[];t>0&&n.push(`上下文窗口 ${t}`),e.source===`fallback`?n.push(`网关未接受任何档位(可能是地址 / 密钥 / 模型名有误,或该网关不暴露上限)`):n.push(`未探到网关接受的单次输出上限`),this.ping={ok:!1,text:`${n.join(`;`)}。建议留空走自动:后端按默认值开跑,被网关拒绝时自动减半并记下真实上限`}}}catch(e){this.ping={ok:!1,text:`探测失败:${e.message||e}`}}finally{this.probing=!1}},async loadKey(){if(this.modelId)try{let e=await ak(this.modelId,!0),t=typeof e.apiKey==`string`?e.apiKey:``;t&&(this.form.apiKey=t,this.keyLoaded=!0),typeof e.name==`string`&&(this.form.name=e.name),typeof e.baseUrl==`string`&&(this.form.baseUrl=e.baseUrl),typeof e.model==`string`&&(this.form.model=e.model),this.form.maxTokens=e.maxTokensAuto||!(Number(e.maxTokens)>0)?0:Number(e.maxTokens),e.thinking!==void 0&&(this.form.thinking=e.thinking!==!1),e.vision!==void 0&&(this.form.vision=e.vision===!0)}catch{}},payload(){let e={name:this.form.name.trim(),baseUrl:this.form.baseUrl.trim(),model:this.form.model.trim(),thinking:!!this.form.thinking,vision:!!this.form.vision,maxTokens:Number(this.form.maxTokens)>0?Number(this.form.maxTokens):0};return(this.keyLoaded||this.form.apiKey.trim())&&(e.apiKey=this.form.apiKey.trim()),e},async test(){if(!this.isValid){this.submitted=!0,this.help=null,this.ping={ok:!1,text:`请先补全必填项(Base URL / 模型名 / API Key)再测试连接`};return}this.testing=!0,this.ping=null;try{let e=await dk(this.payload());this.ping=e.ok?{ok:!0,text:`连接正常 · ${e.model||this.form.model} · ${e.latencyMs}ms`}:{ok:!1,text:`连接失败${e.status?`(HTTP ${e.status})`:``}:${e.message||`未知错误`}`}}catch(e){this.ping={ok:!1,text:`测试失败:${e.message||e}`}}finally{this.testing=!1}},async save(){if(this.submitted=!0,!this.isValid){this.help=null;let e={baseUrl:`aiset-baseurl`,model:`aiset-model`,apiKey:`aiset-key`},t=Object.keys(this.errors)[0],n=t?this.$el.querySelector(`#${e[t]}`):null;n&&typeof n.focus==`function`&&n.focus(),this.ping={ok:!1,text:`请先补全必填项(Base URL / 模型名 / API Key)`};return}this.saving=!0;try{let e=this.modelId?await sk(this.modelId,this.payload()):await ok(this.payload());this.$emit(`saved`,e)}catch(e){this.ping={ok:!1,text:`保存失败:${e.message||e}`}}finally{this.saving=!1}}}},_j={class:`aiset__mask`},vj={class:`aiset`,role:`dialog`,"aria-modal":`true`,"aria-label":`AI 模型设置`},yj={class:`aiset__head`},bj={class:`aiset__title`},xj={class:`aiset__body`},Sj={class:`aiset__field`},Cj={class:`aiset__field`},wj={class:`aiset__labelrow`},Tj=[`aria-expanded`],Ej=[`aria-invalid`],Dj={key:0,class:`aiset__errline`},Oj={key:1,class:`aiset__pop`},kj={class:`aiset__field`},Aj={class:`aiset__labelrow`},jj=[`aria-expanded`],Mj=[`aria-invalid`],Nj={key:0,class:`aiset__errline`},Pj={key:1,class:`aiset__pop`},Fj={class:`aiset__field`},Ij={class:`aiset__labelrow`},Lj=[`aria-expanded`],Rj={class:`aiset__keywrap`},zj=[`type`,`placeholder`,`aria-invalid`],Bj=[`title`,`aria-pressed`],Vj={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},Hj=[`href`],Uj={key:0,class:`aiset__errline`},Wj={key:1,class:`aiset__pop`},Gj={class:`aiset__field`},Kj={class:`aiset__labelrow`},qj=[`aria-expanded`],Jj={class:`aiset__stepperrow`},Yj=[`disabled`],Xj={key:0,class:`aiset__warnline`},Zj={key:1,class:`aiset__pop`},Qj={class:`aiset__field`},$j={class:`aiset__labelrow`},eM=[`aria-expanded`],tM={key:0,class:`aiset__pop`},nM={class:`aiset__field`},rM={class:`aiset__labelrow`},iM=[`aria-expanded`],aM={key:0,class:`aiset__pop`},oM={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},sM=[`href`],cM={class:`aiset__foot`},lM=[`disabled`],uM={class:`aiset__btn-icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},dM=[`href`],fM=[`disabled`],pM=[`disabled`];function mM(e,t,n,r,i,a){let o=L(`NumberStepper`),s=L(`Switch`);return B(),V(`div`,_j,[U(`section`,vj,[U(`header`,yj,[t[22]||=U(`svg`,{class:`aiset__head-icon is-solid-icon`,viewBox:`0 0 1024 1024`,"aria-hidden":`true`},[U(`use`,{href:`#icon-model`})],-1),U(`span`,bj,M(a.title),1),U(`button`,{type:`button`,class:`aiset__x`,title:`关闭`,onClick:t[0]||=t=>e.$emit(`close`)},[...t[21]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-x`})],-1)]])]),K(` 字段说明一律收进「?」浮层:面板只留标签 + 控件,需要时点开看详情 `),U(`div`,xj,[U(`div`,Sj,[t[23]||=U(`div`,{class:`aiset__labelrow`},[U(`label`,{class:`aiset__label`,for:`aiset-name`},`名称`)],-1),I(U(`input`,{id:`aiset-name`,"onUpdate:modelValue":t[1]||=e=>i.form.name=e,class:`aiset__input`,type:`text`,placeholder:`模型显示名(如 GPT-4o / 我的 GLM)`,spellcheck:`false`,autocomplete:`off`},null,512),[[il,i.form.name]])]),U(`div`,Cj,[U(`div`,wj,[t[25]||=U(`label`,{class:`aiset__label`,for:`aiset-baseurl`},[G(`Base URL`),U(`i`,{class:`aiset__req`,"aria-hidden":`true`},`*`)],-1),U(`button`,{type:`button`,class:j([`aiset__help`,{"is-on":i.help===`baseUrl`}]),"aria-expanded":i.help===`baseUrl`,title:`查看说明`,onClick:t[2]||=q(e=>a.toggleHelp(`baseUrl`),[`stop`])},[...t[24]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-help`})],-1)]],10,Tj)]),I(U(`input`,{id:`aiset-baseurl`,"onUpdate:modelValue":t[3]||=e=>i.form.baseUrl=e,class:j([`aiset__input`,{"is-invalid":a.showError(`baseUrl`)}]),type:`text`,placeholder:`https://api.example.com/v1`,spellcheck:`false`,autocomplete:`off`,"aria-invalid":a.showError(`baseUrl`)?`true`:`false`,onBlur:t[4]||=e=>a.markTouched(`baseUrl`)},null,42,Ej),[[il,i.form.baseUrl]]),a.showError(`baseUrl`)?(B(),V(`p`,Dj,M(a.errors.baseUrl),1)):K(`v-if`,!0),i.help===`baseUrl`?(B(),V(`p`,Oj,[...t[26]||=[G(`OpenAI 兼容网关的基址,`,-1),U(`strong`,null,`不含`,-1),G(),U(`code`,null,`/chat/completions`,-1),G(` 后缀(后端会自己拼)。例:`,-1),U(`code`,null,`https://api.openai.com/v1`,-1),G(`。`,-1)]])):K(`v-if`,!0)]),U(`div`,kj,[U(`div`,Aj,[t[28]||=U(`label`,{class:`aiset__label`,for:`aiset-model`},[G(`模型名`),U(`i`,{class:`aiset__req`,"aria-hidden":`true`},`*`)],-1),U(`button`,{type:`button`,class:j([`aiset__help`,{"is-on":i.help===`model`}]),"aria-expanded":i.help===`model`,title:`查看说明`,onClick:t[5]||=q(e=>a.toggleHelp(`model`),[`stop`])},[...t[27]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-help`})],-1)]],10,jj)]),I(U(`input`,{id:`aiset-model`,"onUpdate:modelValue":t[6]||=e=>i.form.model=e,class:j([`aiset__input`,{"is-invalid":a.showError(`model`)}]),type:`text`,placeholder:`gpt-4o / GLM-4.6 / deepseek-chat`,spellcheck:`false`,autocomplete:`off`,"aria-invalid":a.showError(`model`)?`true`:`false`,onBlur:t[7]||=e=>a.markTouched(`model`)},null,42,Mj),[[il,i.form.model]]),a.showError(`model`)?(B(),V(`p`,Nj,M(a.errors.model),1)):K(`v-if`,!0),i.help===`model`?(B(),V(`p`,Pj,`必须与网关侧的模型标识完全一致。建卡这类多步工具调用建议用支持 function calling 的模型。`)):K(`v-if`,!0)]),U(`div`,Fj,[U(`div`,Ij,[t[30]||=U(`label`,{class:`aiset__label`,for:`aiset-key`},[G(`API Key`),U(`i`,{class:`aiset__req`,"aria-hidden":`true`},`*`)],-1),U(`button`,{type:`button`,class:j([`aiset__help`,{"is-on":i.help===`apiKey`}]),"aria-expanded":i.help===`apiKey`,title:`查看说明`,onClick:t[8]||=q(e=>a.toggleHelp(`apiKey`),[`stop`])},[...t[29]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-help`})],-1)]],10,Lj)]),U(`div`,Rj,[I(U(`input`,{id:`aiset-key`,"onUpdate:modelValue":t[9]||=e=>i.form.apiKey=e,class:j([`aiset__input aiset__input--key`,{"is-invalid":a.showError(`apiKey`)}]),type:i.reveal?`text`:`password`,placeholder:a.keyPlaceholder,spellcheck:`false`,autocomplete:`off`,"aria-invalid":a.showError(`apiKey`)?`true`:`false`,onBlur:t[10]||=e=>a.markTouched(`apiKey`)},null,42,zj),[[fl,i.form.apiKey]]),U(`button`,{type:`button`,class:`aiset__eye`,title:i.reveal?`掩码显示密钥`:`明文显示密钥`,"aria-pressed":i.reveal,onClick:t[11]||=e=>i.reveal=!i.reveal},[(B(),V(`svg`,Vj,[U(`use`,{href:i.reveal?`#icon-eye-off`:`#icon-eye`},null,8,Hj)]))],8,Bj)]),a.showError(`apiKey`)?(B(),V(`p`,Uj,M(a.errors.apiKey),1)):K(`v-if`,!0),i.help===`apiKey`?(B(),V(`p`,Wj,[...t[31]||=[G(` 密钥保存在项目根 `,-1),U(`code`,null,`.env.cb.local`,-1),G(`(个人覆盖层,已被 .gitignore 忽略,不会进版本库)。 打开面板自动回填已保存的密钥(默认掩码),点输入框尾部小眼睛切换明文;`,-1),U(`strong`,null,`清空后保存即删除`,-1),G(`已保存的密钥。 `,-1)]])):K(`v-if`,!0)]),U(`div`,Gj,[U(`div`,Kj,[t[33]||=U(`label`,{class:`aiset__label`},`单次输出上限`,-1),t[34]||=U(`span`,{class:`aiset__unit`},`max_tokens`,-1),U(`button`,{type:`button`,class:j([`aiset__help`,{"is-on":i.help===`maxTokens`}]),"aria-expanded":i.help===`maxTokens`,title:`查看说明`,onClick:t[12]||=q(e=>a.toggleHelp(`maxTokens`),[`stop`])},[...t[32]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-help`})],-1)]],10,qj)]),U(`div`,Jj,[W(o,{id:`aiset-maxtok`,class:`aiset__stepper`,value:i.form.maxTokens>0?String(i.form.maxTokens):``,step:1024,min:0,max:262144,placeholder:a.maxTokensPlaceholder,onInput:a.onMaxTokens},null,8,[`value`,`placeholder`,`onInput`]),U(`button`,{type:`button`,class:`aiset__btn`,disabled:i.probing||i.saving||i.testing,onClick:t[13]||=(...e)=>a.probe&&a.probe(...e)},M(i.probing?`探测中…`:`探测`),9,Yj)]),a.maxTokensOver?(B(),V(`p`,Xj,` 超过网关已知上限 `+M(a.knownCapLimit)+`:对话时会主动夹取到该值,建议留空走自动 `,1)):K(`v-if`,!0),i.help===`maxTokens`?(B(),V(`p`,Zj,[t[35]||=U(`strong`,null,`普通用户不用管这一项:留空 = 自动`,-1),t[36]||=G(`。后端自己协商:先读网关 `,-1),t[37]||=U(`code`,null,`/v1/models`,-1),t[38]||=G(` 的上下文窗口(免费、毫秒级,最多等 2 秒,超时先用默认 24576 开跑), 拿到后取 `,-1),t[39]||=U(`code`,null,`min(窗口, 32768)`,-1),t[40]||=G(` 当作单次输出上限(输出预算 ≠ 上下文窗口,建卡一轮 32k 足够)。 读不到元数据也不会偷偷发试探请求;想知道窗口多大就点「探测」做一次二分试探(会产生一次真实补全,约十几秒)。 手填值超过网关接受上限时,对话开跑前会主动夹取并说明;真被 400 拒绝才会自动减半重试, 减半成功的值记为「接受上限」(**不是窗口**:窗口与输出上限是两回事,有网关窗口 262144 但 max_tokens 硬上限 131072)。 只有某轮明确报「被单次输出上限截断」才需要手填更大值。注意:推理模型的思考过程也算进这个上限。 `,-1),t[41]||=U(`br`,null,null,-1),t[42]||=U(`strong`,null,[G(`注意:`),U(`code`,null,`32768`),G(` 是自动模式的「封顶假设值」,不是网关能力上限。`)],-1),t[43]||=G(` 真实上限只能实测得到,请以「接受的单次输出上限」为准(如 qwen-max 实测仅 8192)。 `,-1),t[44]||=U(`br`,null,null,-1),t[45]||=G(`当前自动生效值:`,-1),U(`strong`,null,M(n.config.maxTokens>0?n.config.maxTokens:24576),1),G(`; 网关上下文窗口:`+M(n.config.maxTokensWindow>0?n.config.maxTokensWindow:`未拿到(网关可能不提供元数据)`)+`; 接受的单次输出上限:`+M(n.config.maxTokensCap>0?n.config.maxTokensCap:`未知(点「探测」,或撞过一次 400 后自动回写)`)+`。 `,1)])):K(`v-if`,!0)]),U(`div`,Qj,[K(` 仅「勾选框 + 标题」包进 label:点说明 / 问号不应误触开关 `),U(`div`,$j,[t[47]||=U(`span`,{class:`aiset__label`},`深度思考`,-1),U(`button`,{type:`button`,class:j([`aiset__help`,{"is-on":i.help===`thinking`}]),"aria-expanded":i.help===`thinking`,title:`查看说明`,onClick:t[14]||=q(e=>a.toggleHelp(`thinking`),[`stop`])},[...t[46]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-help`})],-1)]],10,eM),W(s,{modelValue:i.form.thinking,"onUpdate:modelValue":t[15]||=e=>i.form.thinking=e,class:`aiset__switch`},null,8,[`modelValue`])]),i.help===`thinking`?(B(),V(`p`,tM,[...t[48]||=[G(` 开启:模型先长篇推理再动手,规划更稳但慢很多、更费 token。关闭:直接出结果,实测同一网关快数倍。 关闭依赖网关支持 `,-1),U(`code`,null,`chat_template_kwargs.enable_thinking`,-1),G(`(vLLM / SGLang 系);网关不认时后端会自动回退成带思考并在对话里提示一次。 另外,`,-1),U(`strong`,null,`某一轮思考超时`,-1),G(`时后端会自动只在那一轮关闭深度思考并重试,逼出结果。 `,-1)]])):K(`v-if`,!0)]),U(`div`,nM,[U(`div`,rM,[t[50]||=U(`span`,{class:`aiset__label`},`多模态视觉`,-1),U(`button`,{type:`button`,class:j([`aiset__help`,{"is-on":i.help===`vision`}]),"aria-expanded":i.help===`vision`,title:`查看说明`,onClick:t[16]||=q(e=>a.toggleHelp(`vision`),[`stop`])},[...t[49]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-help`})],-1)]],10,iM),W(s,{modelValue:i.form.vision,"onUpdate:modelValue":t[17]||=e=>i.form.vision=e,class:`aiset__switch`},null,8,[`modelValue`])]),i.help===`vision`?(B(),V(`p`,aM,[...t[51]||=[G(` 开启后首轮对话会`,-1),U(`strong`,null,`自动探测`,-1),G(`网关是否真支持图像(比较带图 / 不带图的 prompt_tokens):支持则把渲染截图、设计稿 vs 渲染并排对比图、你挂载的图片注入上下文,AI 可直接读图找差异; 不支持会自动降级为数值闭环(pixelDiff.match)并在对话里提示一次。注入前降采样到长边 ≤ 1024px / ≤ 900KB,每轮最多 2 张;对话记录落盘不含图像。 `,-1)]])):K(`v-if`,!0)]),i.ping?(B(),V(`div`,{key:0,class:j([`aiset__ping`,i.ping.ok?`is-ok`:`is-bad`])},[(B(),V(`svg`,oM,[U(`use`,{href:i.ping.ok?`#icon-check`:`#icon-alert-triangle`},null,8,sM)])),U(`span`,null,M(i.ping.text),1)],2)):K(`v-if`,!0)]),U(`footer`,cM,[U(`button`,{type:`button`,class:`aiset__btn`,disabled:i.testing||i.saving,onClick:t[18]||=(...e)=>a.test&&a.test(...e)},[(B(),V(`svg`,uM,[U(`use`,{href:i.testing?`#icon-loading`:`#icon-activity`},null,8,dM)])),U(`span`,null,M(i.testing?`测试中…`:`测试连接`),1)],8,lM),t[52]||=U(`span`,{class:`aiset__foot-gap`},null,-1),U(`button`,{type:`button`,class:`aiset__btn`,disabled:i.saving,onClick:t[19]||=t=>e.$emit(`close`)},`取消`,8,fM),U(`button`,{type:`button`,class:`aiset__btn aiset__btn--primary`,disabled:i.saving||i.testing,onClick:t[20]||=(...e)=>a.save&&a.save(...e)},M(i.saving?`保存中…`:`保存`),9,pM)])])])}var hM=X(gj,[[`render`,mM],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/AiSettings.vue`]]),gM={name:`ModelList`,props:{models:{type:Array,default:()=>[]},activeId:{type:String,default:null},turnRunning:{type:Boolean,default:!1}},emits:[`add`,`edit`,`delete`,`activate`,`close`,`open-common`,`import-ccswitch`],methods:{locked(e){return!!(this.turnRunning&&e&&e.id===this.activeId)},hostOf(e){let t=String(e||``).trim();if(!t)return`未填地址`;try{return new URL(t).host}catch{return t.replace(/^https?:\/\//,``).replace(/\/+$/,``)||t}}}},_M={class:`aiset__mask`},vM={class:`aiset modellist`,role:`dialog`,"aria-modal":`true`,"aria-label":`模型选择`},yM={class:`aiset__head`},bM={class:`aiset__body ml__body`},xM={class:`ml__toolbar`},SM={key:0,class:`ml__lock`,role:`status`},CM={key:1,class:`empty-state`},wM={class:`ml__list`},TM=[`aria-disabled`,`onClick`],EM={key:0,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`,"stroke-linecap":`round`,"stroke-linejoin":`round`},DM={class:`ml__info`},OM={class:`ml__name`},kM={class:`ml__meta`},AM={class:`ml__model`},jM={class:`ml__host`},MM={key:0,class:`ml__key`,title:`已配置密钥`},NM={key:1,class:`ml__key ml__key--off`,title:`未配置密钥`},PM={key:2,class:`ml__key ml__key--lock`,title:`对话进行中,正在使用的模型已锁定`},FM={class:`ml__actions`},IM=[`disabled`,`title`,`onClick`],LM=[`disabled`,`title`,`onClick`],RM={class:`ml__foot`},zM={class:`ml__hint`};function BM(e,t,n,r,i,a){return B(),V(`div`,_M,[U(`section`,vM,[U(`header`,yM,[t[5]||=U(`svg`,{class:`aiset__head-icon is-solid-icon`,viewBox:`0 0 1024 1024`,"aria-hidden":`true`},[U(`use`,{href:`#icon-model`})],-1),t[6]||=U(`span`,{class:`aiset__title`},`模型`,-1),U(`button`,{type:`button`,class:`aiset__x`,title:`关闭`,onClick:t[0]||=t=>e.$emit(`close`)},[...t[4]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-x`})],-1)]])]),U(`div`,bM,[K(` 操作工具条:添加模型 / 从 cc-switch 导入,靠右对齐 `),U(`div`,xM,[U(`button`,{type:`button`,class:`ml__import`,title:`从 cc-switch 导入`,onClick:t[1]||=t=>e.$emit(`import-ccswitch`)},[...t[7]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-download`})],-1),U(`span`,null,`导入`,-1)]]),U(`button`,{type:`button`,class:`ml__add`,title:`添加模型`,onClick:t[2]||=t=>e.$emit(`add`)},[...t[8]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-plus`})],-1),U(`span`,null,`添加模型`,-1)]])]),K(` 对话进行中:正在使用的模型被锁,说明原因与解除方式,避免用户反复点却没反应 `),n.turnRunning?(B(),V(`div`,SM,[...t[9]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-alert-triangle`})],-1),U(`span`,null,`有对话正在进行:正在使用的模型已锁定,本轮结束后可切换或修改。其他模型仍可编辑。`,-1)]])):K(`v-if`,!0),K(` 空状态:与其他面板占位(图标 + 文字)同一语言 `),n.models.length?(B(),V(z,{key:2},[K(` 模型列表:参考 cc-switch 的 provider 列表——每条可编辑 / 删除,当前生效项高亮 `),U(`ul`,wM,[(B(!0),V(z,null,R(n.models,r=>(B(),V(`li`,{key:r.id,class:j([`ml__item`,{"is-active":r.id===n.activeId,"is-locked":a.locked(r)}]),"aria-disabled":a.locked(r)?`true`:`false`,onClick:t=>e.$emit(`activate`,r)},[U(`span`,{class:j([`ml__check`,{"is-on":r.id===n.activeId}]),"aria-hidden":`true`},[r.id===n.activeId?(B(),V(`svg`,EM,[...t[11]||=[U(`use`,{href:`#icon-check`},null,-1)]])):K(`v-if`,!0)],2),U(`span`,DM,[U(`span`,OM,M(r.name||r.model||`未命名模型`),1),U(`span`,kM,[U(`span`,AM,M(r.model||`未填模型名`),1),t[12]||=U(`span`,{class:`ml__dot`},`·`,-1),U(`span`,jM,M(a.hostOf(r.baseUrl)),1),r.hasKey?(B(),V(`span`,MM,`已配密钥`)):(B(),V(`span`,NM,`无密钥`)),a.locked(r)?(B(),V(`span`,PM,`运行中 · 锁定`)):K(`v-if`,!0)])]),U(`span`,FM,[U(`button`,{type:`button`,class:`ml__btn`,disabled:a.locked(r),title:a.locked(r)?`对话进行中,正在使用的模型不可编辑`:`编辑`,onClick:q(t=>e.$emit(`edit`,r),[`stop`])},[...t[13]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-edit`})],-1)]],8,IM),U(`button`,{type:`button`,class:`ml__btn ml__btn--danger`,disabled:a.locked(r),title:a.locked(r)?`对话进行中,正在使用的模型不可删除`:`删除`,onClick:q(t=>e.$emit(`delete`,r),[`stop`])},[...t[14]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-trash`})],-1)]],8,LM)])],10,TM))),128))])],2112)):(B(),V(`div`,CM,[...t[10]||=[as(`<span class="empty-state__badge" aria-hidden="true"><svg class="is-solid-icon" viewBox="0 0 1024 1024"><use href="#icon-model"></use></svg></span><p class="debug__empty">还没有模型</p><p class="empty-state__hint">点上方「添加模型」配置第一个 AI 模型(Base URL / API Key / 模型名),或「导入」从 cc-switch 拉取已有的 Codex 供应商。配置保存在项目根 .env.cb.local,不进版本库。</p>`,3)]]))]),U(`footer`,RM,[U(`span`,zM,M(n.turnRunning?`对话进行中:正在使用的模型已锁定,无法切换`:`点击任意模型即可切换为当前生效模型`),1),U(`button`,{type:`button`,class:`ml__common`,title:`通用设置(执行策略 / 环境参数,所有模型共享)`,onClick:t[3]||=t=>e.$emit(`open-common`)},[...t[15]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-settings`})],-1),U(`span`,null,`通用设置`,-1)]])])])])}var VM=X(gM,[[`render`,BM],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ModelList.vue`]]),HM=6e4,UM={name:`AiCommonSettings`,components:{NumberStepper:Ag,Switch:ZC},emits:[`close`,`saved`],data(){return{form:{allowShell:!0,autoApprove:`all`,maxSteps:0,turnTimeoutMin:60,stallTimeoutMin:120,stallRetries:-1,reasoningTimeoutMin:600,autoContinueMax:-1},saving:!1,ping:null,help:null,adv:!1,approveOptions:[{value:`none`,label:`逐次确认`},{value:`skill`,label:`免技能`},{value:`all`,label:`全免确认`}]}},created(){this.loadConfig()},mounted(){document.addEventListener(`click`,this.onDocClick,!0),document.addEventListener(`keydown`,this.onKeydown)},beforeUnmount(){document.removeEventListener(`click`,this.onDocClick,!0),document.removeEventListener(`keydown`,this.onKeydown)},methods:{toggleHelp(e){this.help=this.help===e?null:e},onDocClick(e){if(!this.help)return;let t=e.target;t instanceof Element&&t.closest(`.aiset__pop, .aiset__help`)||(this.help=null)},onKeydown(e){e.key===`Escape`&&this.help&&(e.stopPropagation(),this.help=null)},onInt(e,t){let n=String(t).trim();if(!n){this.form[e]=e===`stallRetries`||e===`autoContinueMax`?-1:0;return}let r=Number(n);this.form[e]=Number.isFinite(r)?Math.round(r):0},async loadConfig(){try{let e=await tk();e.shellEnabled!==void 0&&(this.form.allowShell=e.shellEnabled!==!1),e.autoApprove&&(this.form.autoApprove=e.autoApprove),Number(e.maxSteps)>0&&(this.form.maxSteps=Number(e.maxSteps)),Number(e.turnTimeoutMs)>0&&(this.form.turnTimeoutMin=Math.round(Number(e.turnTimeoutMs)/HM)),Number(e.stallTimeoutMs)>0&&(this.form.stallTimeoutMin=Math.round(Number(e.stallTimeoutMs)/HM)),e.stallRetries!==void 0&&e.stallRetries>=0&&(this.form.stallRetries=Number(e.stallRetries)),Number(e.reasoningTimeoutMs)>0&&(this.form.reasoningTimeoutMin=Math.round(Number(e.reasoningTimeoutMs)/HM)),e.autoContinueMax!==void 0&&e.autoContinueMax>=0&&(this.form.autoContinueMax=Number(e.autoContinueMax))}catch{}},async save(){this.saving=!0,this.ping=null;try{let e=await nk({allowShell:!!this.form.allowShell,autoApprove:this.form.autoApprove,maxSteps:Number(this.form.maxSteps)>0?Number(this.form.maxSteps):0,turnTimeoutMs:Number(this.form.turnTimeoutMin)>0?Number(this.form.turnTimeoutMin)*HM:0,stallTimeoutMs:Number(this.form.stallTimeoutMin)>0?Number(this.form.stallTimeoutMin)*HM:0,stallRetries:Number(this.form.stallRetries)>=0?Number(this.form.stallRetries):-1,reasoningTimeoutMs:Number(this.form.reasoningTimeoutMin)>0?Number(this.form.reasoningTimeoutMin)*HM:0,autoContinueMax:Number(this.form.autoContinueMax)>=0?Number(this.form.autoContinueMax):-1});this.$emit(`saved`,e)}catch(e){this.ping={ok:!1,text:`保存失败:${e.message||e}`}}finally{this.saving=!1}}}},WM={class:`aiset__mask`},GM={class:`aiset`,role:`dialog`,"aria-modal":`true`,"aria-label":`AI 通用设置`},KM={class:`aiset__head`},qM={class:`aiset__body`},JM={class:`aiset__field`},YM={class:`aiset__labelrow`},XM=[`aria-expanded`],ZM={key:0,class:`aiset__pop`},QM={class:`aiset__field`},$M={class:`aiset__labelrow`},eN=[`aria-expanded`],tN={class:`aiset__seg`},nN=[`onClick`],rN={key:0,class:`aiset__pop`},iN={class:`aiset__adv`},aN=[`aria-expanded`],oN={class:`aiset__adv-hint`},sN={key:0,class:`aiset__adv-body`},cN={class:`aiset__field`},lN={class:`aiset__labelrow`},uN=[`aria-expanded`],dN={class:`aiset__stepperrow`},fN={key:0,class:`aiset__pop`},pN={class:`aiset__field`},mN={class:`aiset__labelrow`},hN=[`aria-expanded`],gN={class:`aiset__stepperrow`},_N={key:0,class:`aiset__pop`},vN={class:`aiset__field`},yN={class:`aiset__labelrow`},bN=[`aria-expanded`],xN={class:`aiset__stepperrow`},SN={key:0,class:`aiset__pop`},CN={class:`aiset__field`},wN={class:`aiset__labelrow`},TN=[`aria-expanded`],EN={class:`aiset__stepperrow`},DN={key:0,class:`aiset__pop`},ON={class:`aiset__field`},kN={class:`aiset__labelrow`},AN=[`aria-expanded`],jN={class:`aiset__stepperrow`},MN={key:0,class:`aiset__pop`},NN={class:`aiset__field`},PN={class:`aiset__labelrow`},FN=[`aria-expanded`],IN={class:`aiset__stepperrow`},LN={key:0,class:`aiset__pop`},RN={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},zN=[`href`],BN={class:`aiset__foot`},VN=[`disabled`],HN=[`disabled`];function UN(e,t,n,r,i,a){let o=L(`Switch`),s=L(`NumberStepper`);return B(),V(`div`,WM,[U(`section`,GM,[U(`header`,KM,[t[20]||=U(`svg`,{class:`aiset__head-icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-settings`})],-1),t[21]||=U(`span`,{class:`aiset__title`},`通用设置`,-1),U(`button`,{type:`button`,class:`aiset__x`,title:`关闭`,onClick:t[0]||=t=>e.$emit(`close`)},[...t[19]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-x`})],-1)]])]),U(`div`,qM,[t[51]||=U(`p`,{class:`aiset__note`},[G(`以下为`),U(`strong`,null,`所有模型共享`),G(`的执行策略 / 环境参数,与具体模型无关,故不放在每个模型条目里。`)],-1),U(`div`,JM,[U(`div`,YM,[t[23]||=U(`span`,{class:`aiset__label`},`本地命令执行`,-1),U(`button`,{type:`button`,class:j([`aiset__help`,{"is-on":i.help===`allowShell`}]),"aria-expanded":i.help===`allowShell`,title:`查看说明`,onClick:t[1]||=q(e=>a.toggleHelp(`allowShell`),[`stop`])},[...t[22]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-help`})],-1)]],10,XM),W(o,{modelValue:i.form.allowShell,"onUpdate:modelValue":t[2]||=e=>i.form.allowShell=e,class:`aiset__switch`},null,8,[`modelValue`])]),i.help===`allowShell`?(B(),V(`p`,ZM,[...t[24]||=[G(` 是否注册 `,-1),U(`code`,null,`shell_exec`,-1),G(` 本地命令执行。默认开(工具只监听 127.0.0.1,命令过白名单 + 全量审计)。 关掉后 AI 不能跑本地命令,但仍可执行技能脚本(由 `,-1),U(`code`,null,`autoApprove`,-1),G(` 控制是否逐次确认)。 `,-1)]])):K(`v-if`,!0)]),U(`div`,QM,[U(`div`,$M,[t[26]||=U(`span`,{class:`aiset__label`},`免确认执行策略`,-1),U(`button`,{type:`button`,class:j([`aiset__help`,{"is-on":i.help===`autoApprove`}]),"aria-expanded":i.help===`autoApprove`,title:`查看说明`,onClick:t[3]||=q(e=>a.toggleHelp(`autoApprove`),[`stop`])},[...t[25]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-help`})],-1)]],10,eN)]),U(`div`,tN,[(B(!0),V(z,null,R(i.approveOptions,e=>(B(),V(`button`,{key:e.value,type:`button`,class:j([`aiset__seg-btn`,{"is-on":i.form.autoApprove===e.value}]),onClick:t=>i.form.autoApprove=e.value},M(e.label),11,nN))),128))]),i.help===`autoApprove`?(B(),V(`p`,rN,[...t[27]||=[U(`code`,null,`none`,-1),G(`=逐次弹审批;`,-1),U(`code`,null,`skill`,-1),G(`=只免技能脚本;`,-1),U(`code`,null,`all`,-1),G(`=技能脚本 + 本地命令都免确认(默认)。 建卡管线连跑十几次脚本 / 命令,`,-1),U(`code`,null,`all`,-1),G(` 避免每次等用户点「允许」。 `,-1)]])):K(`v-if`,!0)]),K(` 保活 / 预算阈值:实测调优出来的值,改只会变坏,故默认收起。
|
|
280
|
-
全部有代码默认值,留空即走默认;折叠区保留可写入口,真要调时不用去翻 .env `),U(`div`,iN,[U(`button`,{type:`button`,class:`aiset__adv-head`,"aria-expanded":i.adv,onClick:t[4]||=e=>i.adv=!i.adv},[(B(),V(`svg`,{class:j([`aiset__adv-caret`,{"is-open":i.adv}]),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[...t[28]||=[U(`use`,{href:`#icon-chevron-right`},null,-1)]],2)),t[29]||=U(`span`,{class:`aiset__adv-title`},`高级:保活与预算阈值`,-1),U(`span`,oN,M(i.adv?``:`默认值经实测调优,不建议修改`),1)],8,aN),i.adv?(B(),V(`div`,sN,[t[50]||=U(`p`,{class:`aiset__adv-note`},[G(` 这几项是长程任务的`),U(`strong`,null,`熔断与保活阈值`),G(`,数值由实测调优得出(如纯思考预算从 90s 放宽到 600s,因 240s 会误伤正常轮次)。 留空即走默认,`),U(`strong`,null,`没有明确理由不建议改动`),G(`。 `)],-1),U(`div`,cN,[U(`div`,lN,[t[31]||=U(`span`,{class:`aiset__label`},`单轮步数上限`,-1),t[32]||=U(`span`,{class:`aiset__unit`},`0 / 留空 = 不限`,-1),U(`button`,{type:`button`,class:j([`aiset__help`,{"is-on":i.help===`maxSteps`}]),"aria-expanded":i.help===`maxSteps`,title:`查看说明`,onClick:t[5]||=q(e=>a.toggleHelp(`maxSteps`),[`stop`])},[...t[30]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-help`})],-1)]],10,uN)]),U(`div`,dN,[W(s,{id:`common-maxsteps`,class:`aiset__stepper`,value:i.form.maxSteps>0?String(i.form.maxSteps):``,step:8,min:0,max:1e3,placeholder:`留空 = 不限(推荐)`,onInput:t[6]||=e=>a.onInt(`maxSteps`,e)},null,8,[`value`])]),i.help===`maxSteps`?(B(),V(`p`,fN,[...t[33]||=[U(`strong`,null,`普通用户不用管:留空 = 不限`,-1),G(`。失控由三道精准熔断兜住(同参打转跳过 / 单轮墙钟到点收尾 / 每 24 步提醒)。 只有想硬性控成本时才填(>0 即恢复旧硬顶行为)。 `,-1)]])):K(`v-if`,!0)]),U(`div`,pN,[U(`div`,mN,[t[35]||=U(`span`,{class:`aiset__label`},`单轮墙钟上限`,-1),t[36]||=U(`span`,{class:`aiset__unit`},`分钟`,-1),U(`button`,{type:`button`,class:j([`aiset__help`,{"is-on":i.help===`turnTimeout`}]),"aria-expanded":i.help===`turnTimeout`,title:`查看说明`,onClick:t[7]||=q(e=>a.toggleHelp(`turnTimeout`),[`stop`])},[...t[34]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-help`})],-1)]],10,hN)]),U(`div`,gN,[W(s,{id:`common-turn`,class:`aiset__stepper`,value:i.form.turnTimeoutMin>0?String(i.form.turnTimeoutMin):``,step:5,min:0,max:240,placeholder:`留空 = 60`,onInput:t[8]||=e=>a.onInt(`turnTimeoutMin`,e)},null,8,[`value`])]),i.help===`turnTimeout`?(B(),V(`p`,_N,` 单轮允许跑的最长时间(分钟)。到点收尾汇报、上下文不丢,回复「继续」接着做。默认 60 分钟,不限步数后的唯一兜底闸门。 `)):K(`v-if`,!0)]),U(`div`,vN,[U(`div`,yN,[t[38]||=U(`span`,{class:`aiset__label`},`网关静默阈值`,-1),t[39]||=U(`span`,{class:`aiset__unit`},`分钟`,-1),U(`button`,{type:`button`,class:j([`aiset__help`,{"is-on":i.help===`stall`}]),"aria-expanded":i.help===`stall`,title:`查看说明`,onClick:t[9]||=q(e=>a.toggleHelp(`stall`),[`stop`])},[...t[37]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-help`})],-1)]],10,bN)]),U(`div`,xN,[W(s,{id:`common-stall`,class:`aiset__stepper`,value:i.form.stallTimeoutMin>0?String(i.form.stallTimeoutMin):``,step:1,min:0,max:120,placeholder:`留空 = 2`,onInput:t[10]||=e=>a.onInt(`stallTimeoutMin`,e)},null,8,[`value`])]),i.help===`stall`?(B(),V(`p`,SN,` 上游多少分钟不回任何字节算「网关静默」;静默自动重试本步而非整轮报废。默认 2 分钟(120 秒)。 `)):K(`v-if`,!0)]),U(`div`,CN,[U(`div`,wN,[t[41]||=U(`span`,{class:`aiset__label`},`静默重试次数`,-1),t[42]||=U(`span`,{class:`aiset__unit`},`-1 = 默认`,-1),U(`button`,{type:`button`,class:j([`aiset__help`,{"is-on":i.help===`stallRetries`}]),"aria-expanded":i.help===`stallRetries`,title:`查看说明`,onClick:t[11]||=q(e=>a.toggleHelp(`stallRetries`),[`stop`])},[...t[40]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-help`})],-1)]],10,TN)]),U(`div`,EN,[W(s,{id:`common-stallretries`,class:`aiset__stepper`,value:i.form.stallRetries>=0?String(i.form.stallRetries):``,step:1,min:-1,max:20,placeholder:`留空 / -1 = 3`,onInput:t[12]||=e=>a.onInt(`stallRetries`,e)},null,8,[`value`])]),i.help===`stallRetries`?(B(),V(`p`,DN,` 网关静默后的自动重试次数。0 = 回到「一次静默即报错」的旧行为;留空 / -1 = 用默认 3 次。 `)):K(`v-if`,!0)]),U(`div`,ON,[U(`div`,kN,[t[44]||=U(`span`,{class:`aiset__label`},`纯思考预算`,-1),t[45]||=U(`span`,{class:`aiset__unit`},`分钟`,-1),U(`button`,{type:`button`,class:j([`aiset__help`,{"is-on":i.help===`reasoning`}]),"aria-expanded":i.help===`reasoning`,title:`查看说明`,onClick:t[13]||=q(e=>a.toggleHelp(`reasoning`),[`stop`])},[...t[43]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-help`})],-1)]],10,AN)]),U(`div`,jN,[W(s,{id:`common-reasoning`,class:`aiset__stepper`,value:i.form.reasoningTimeoutMin>0?String(i.form.reasoningTimeoutMin):``,step:1,min:0,max:300,placeholder:`留空 = 10`,onInput:t[14]||=e=>a.onInt(`reasoningTimeoutMin`,e)},null,8,[`value`])]),i.help===`reasoning`?(B(),V(`p`,MN,` 单轮「纯思考」(不调工具)的预算(分钟)。到点催促 + 关深度思考重试;催 3 次仍无产出则停该熔断,改墙钟兜底。默认 10 分钟(600 秒)。 `)):K(`v-if`,!0)]),U(`div`,NN,[U(`div`,PN,[t[47]||=U(`span`,{class:`aiset__label`},`自动续跑上限`,-1),t[48]||=U(`span`,{class:`aiset__unit`},`-1 = 默认`,-1),U(`button`,{type:`button`,class:j([`aiset__help`,{"is-on":i.help===`autoContinue`}]),"aria-expanded":i.help===`autoContinue`,title:`查看说明`,onClick:t[15]||=q(e=>a.toggleHelp(`autoContinue`),[`stop`])},[...t[46]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-help`})],-1)]],10,FN)]),U(`div`,IN,[W(s,{id:`common-autocont`,class:`aiset__stepper`,value:i.form.autoContinueMax>=0?String(i.form.autoContinueMax):``,step:1,min:-1,max:200,placeholder:`留空 / -1 = 12`,onInput:t[16]||=e=>a.onInt(`autoContinueMax`,e)},null,8,[`value`])]),i.help===`autoContinue`?(B(),V(`p`,LN,[...t[49]||=[G(` 模型没给收尾标记(`,-1),U(`code`,null,`[任务完成]`,-1),G(` / `,-1),U(`code`,null,`[需用户确认]`,-1),G(`)就停手时的自动续跑次数上限。0 = 关闭(等你手打「继续」);留空 / -1 = 用默认 12。 `,-1)]])):K(`v-if`,!0)])])):K(`v-if`,!0)]),i.ping?(B(),V(`div`,{key:0,class:j([`aiset__ping`,i.ping.ok?`is-ok`:`is-bad`])},[(B(),V(`svg`,RN,[U(`use`,{href:i.ping.ok?`#icon-check`:`#icon-alert-triangle`},null,8,zN)])),U(`span`,null,M(i.ping.text),1)],2)):K(`v-if`,!0)]),U(`footer`,BN,[t[52]||=U(`span`,{class:`aiset__foot-gap`},null,-1),U(`button`,{type:`button`,class:`aiset__btn`,disabled:i.saving,onClick:t[17]||=t=>e.$emit(`close`)},`取消`,8,VN),U(`button`,{type:`button`,class:`aiset__btn aiset__btn--primary`,disabled:i.saving,onClick:t[18]||=(...e)=>a.save&&a.save(...e)},M(i.saving?`保存中…`:`保存`),9,HN)])])])}var WN=X(UM,[[`render`,UN],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/AiCommonSettings.vue`]]),GN=2e3;function KN(e){try{let t=JSON.stringify(e);return t==null?0:t.length}catch{return 1/0}}function qN(e,t){let n=typeof e==`string`?e:e==null?``:JSON.stringify(e);return n.length<=t?e:`${n.slice(0,t)}\n…(历史归档已裁剪,完整内容以卡片与落盘产物为准)`}function JN(e,t){if(!e||typeof e!=`object`)return e;let n={};for(let[r,i]of Object.entries(e))n[r]=typeof i==`string`||typeof i==`object`&&i?qN(i,t):i;return n}function YN(e,t=!1){let n=Array.isArray(e)?e:[],r=t?400:GN;return n.map(e=>{if(!e||!Array.isArray(e.toolCalls)||!e.toolCalls.length)return e;let n=!1,i=e.toolCalls.map(e=>{if(!e||typeof e!=`object`)return e;let i=JN(e.args,r),a=t?e.result==null||e.result===``?e.result:`[历史归档已裁剪]`:qN(e.result,r);return(JSON.stringify(i)!==JSON.stringify(e.args)||String(a)!==String(e.result))&&(n=!0),{...e,args:i,result:a}});return n?{...e,toolCalls:i,trimmedArchive:!0}:e})}var XN=12e3,ZN={pick:{id:`pick`,label:`选一张已有的卡`,hint:`从顶栏下拉里挑`,icon:`#icon-search`,weight:`read`,text:`列出仓库里现有的卡片,按用途分组,帮我挑一张适合修改的。`},scaffold:{id:`scaffold`,label:`新建一张卡`,hint:`从空白骨架开始`,icon:`#icon-folder-plus`,weight:`write`,text:`帮我新建一张卡片:先用 card_scaffold 生成骨架,再按我的需求补齐结构与示例内容,最后自检。`},spec:{id:`spec`,label:`按设计稿标注建卡`,hint:`先拖入 MeaXure 目录`,icon:`#icon-image-upload`,weight:`write`,attach:!0,text:`我会挂载一份 Sketch MeaXure 标注导出目录,请按标注生成卡片 schema 并自检。`},fromimage:{id:`fromimage`,label:`从参考图建卡`,hint:`拖一张设计图进来`,icon:`#icon-image`,weight:`write`,attach:!0,text:`我会拖入一张参考设计图(本机路径),请按图生成卡片 schema 并截图自检还原度。`},learn:{id:`learn`,label:`看已有卡学写法`,hint:`只读,不改卡`,icon:`#icon-search`,weight:`read`,text:`列出仓库里结构最完整的几张卡片,读 1-2 张的关键片段,说明本仓库的建卡约定与常用范式。`},component:{id:`component`,label:`加一个常用组件`,hint:`列表 / 按钮 / 金额卡`,icon:`#icon-plus`,weight:`write`,text:`帮我给这张卡加一个常用组件(列表 / 按钮组 / 金额统计卡),按仓库范式写并自检。`},explain:{id:`explain`,label:`解释结构与数据来源`,hint:`只读,不改卡`,icon:`#icon-search`,weight:`read`,text:`读取当前卡片 schema,用中文解释它的结构、关键绑定与数据来源,指出可能的问题。`},bind:{id:`bind`,label:`把写死文案抽成变量`,hint:`绑定 data.json`,icon:`#icon-link`,weight:`write`,text:`把当前卡片里写死的动态值(金额 / 日期 / 名称等)抽成变量并绑定 data.json,保持展示文案与设计稿一致。`},fix:{id:`fix`,label:`校验并修复`,hint:`会改动卡片`,icon:`#icon-wrench`,weight:`write`,text:`对当前卡片执行校验,列出全部错误并按规则修复,修完再校验一次确认清零。`},shot:{id:`shot`,label:`截图自检还原度`,hint:`多尺寸预览比对`,icon:`#icon-images`,weight:`read`,text:`给当前卡片截图,检查布局、字号、间距与配色是否协调,指出需要调整的地方。`},interact:{id:`interact`,label:`加按钮点击行为`,hint:`customAction / 发消息`,icon:`#icon-send`,weight:`write`,text:`给当前卡片里的主按钮加点击行为(customAction 或发送一条消息),参照现有卡片的写法。`},diagnose:{id:`diagnose`,label:`定位并修复刚才的报错`,hint:`接上一轮`,icon:`#icon-alert-triangle`,weight:`write`,text:`上一轮失败了,请读取错误信息与上下文,定位原因并修复,修完再校验一次。`},resume:{id:`resume`,label:`从中断处继续`,hint:`不重做已完成部分`,icon:`#icon-redo`,weight:`write`,text:`上一轮被中断了,请按上下文里的中断标记从中断处继续,不要从零重做。`},rollback:{id:`rollback`,label:`回滚上一轮改动`,hint:`恢复到改动前`,icon:`#icon-undo`,weight:`write`,text:`把上一轮对卡片做的改动回滚到改动前,并说明回滚了什么。`}},QN={nocare:[`pick`,`scaffold`,`spec`,`learn`,`component`],empty:[`spec`,`fromimage`,`scaffold`,`component`,`learn`],card:[`explain`,`bind`,`fix`,`shot`,`interact`],error:[`diagnose`,`resume`,`rollback`,`explain`,`fix`]},$N={nocare:{title:`选择或新建一张卡`,desc:`先从顶栏选一张卡,或让 AI 新建一张;也可以把设计稿标注目录、参考图拖进来,只传本机路径不上传。`},empty:{title:`把这张空卡搭起来`,desc:`描述想要的效果,或拖入设计稿标注目录 / 参考图,AI 会按标注生成卡片并截图自检。`},error:{title:`接着上一轮往下做`,desc:`上一轮失败或被中断了:可以接着修、从中断处继续,或回滚到改动前。`},card:{title:`让 AI 直接改这张卡`,desc:`描述需求即可,AI 会调用卡片工具读改校验并截图自检;也可以把设计稿标注目录、参考图拖进来,只传本机路径不上传。`}};function eP(e){let t=Array.isArray(e)?e:[];for(let e=t.length-1;e>=0;--e){let n=t[e];if(n&&n.role===`assistant`)return n.status||`done`}return``}function tP({cardId:e,cardEmpty:t,messages:n}={}){if(!e)return`nocare`;if(t)return`empty`;let r=eP(n);return r===`error`||r===`aborted`?`error`:`card`}function nP(e){return(QN[e]||QN.card).map(e=>ZN[e]).filter(Boolean)}function rP(e,t,n=4){let r=Array.isArray(e)?e:[];if(r.length<=n)return r.slice();let i=r.length,a=((Number(t)||0)%i+i)%i;return[...r.slice(a),...r.slice(0,a)].slice(0,n)}function iP(e,t=4){return(Array.isArray(e)?e:[]).slice(0,t)}var aP=`cardbuddy:ai-panel-width`,oP=2e4,sP=`cardbuddy:ai-compact-steps`,cP=380,lP=.5,uP=.33,dP=0;function fP(e=`m`){return dP+=1,`${e}${Date.now().toString(36)}-${dP}`}var pP=`有对话正在进行,无法修改正在使用的模型:请先等这一轮结束,或在输入区点「停止」`,mP={name:`ChatPanel`,components:{ChatMessage:VA,ChatComposer:hj,AiSettings:hM,ModelList:VM,AiCommonSettings:WN,ConfirmDialog:_p},props:{visible:{type:Boolean,default:!1},cardId:{type:String,default:``},cardName:{type:String,default:``},cardEmpty:{type:Boolean,default:!1}},emits:[`close`,`busy`,`turn-progress`,`turn-finished`,`rollback-turn`,`locate-node`],data(){return{messages:[],draftAttachments:[],busy:!1,loadingHistory:!1,modelListOpen:!1,models:[],activeId:null,turnRunning:!1,modelEditOpen:!1,editModelId:null,editInitialModel:null,confirmDeleteModel:null,ccSwitchOpen:!1,ccSwitchProviders:[],ccSwitchLoading:!1,ccSwitchReason:``,ccSwitchSelected:{},commonOpen:!1,confirmClear:!1,notice:null,config:{baseUrl:``,model:``,hasKey:!1,apiKeyMasked:``},widthPx:0,winW:typeof window<`u`?window.innerWidth:1280,resizing:!1,gripArmed:!1,_gripTimer:null,pinned:!0,contextUsage:null,compactSteps:!1,archiveTrimmed:!1,suggestOffset:0,suggestStats:{},confirmStop:!1,turnStep:0,turnStage:null,turnToolLabel:``,turnStartedAt:0,lastByteAt:0,turnId:``,lastSeq:0,_resumeProbe:!1,nowTs:0,_abort:null,_saveTimer:0,_loadedCard:``,_cardRenamedTo:``,_saving:!1,_liveTicker:0,_turnPersistTimer:0}},computed:{pickOwnerRow(){return OO(this.messages)},suggestBatchKey(){return tP({cardId:this.cardId,cardEmpty:this.cardEmpty,messages:this.messages})},suggestBatch(){return nP(this.suggestBatchKey)},suggestions(){return rP(this.suggestBatch,this.suggestOffset)},canShuffle(){return this.suggestBatch.length>4},quickChips(){return iP(this.suggestBatch)},emptyTitle(){return($N[this.suggestBatchKey]||$N.card).title},emptyDesc(){return($N[this.suggestBatchKey]||$N.card).desc},ccSwitchCheckedCount(){let e=this.ccSwitchSelected||{};return Object.keys(e).filter(t=>e[t]).length},ccSwitchDupCount(){return(this.ccSwitchProviders||[]).filter(e=>e.duplicate).length},configReady(){return!!(this.config.baseUrl&&this.config.model&&this.config.hasKey)},panelWidth(){let e=this.winW||1280,t=Math.max(cP,Math.floor(e*lP)),n=Math.round(e*uP),r=this.widthPx||n;return Math.max(cP,Math.min(t,r))},panelStyle(){return{width:`${this.panelWidth}px`}},stallLimitMs(){let e=Number(this.config.stallTimeoutMs)>0?Number(this.config.stallTimeoutMs):12e4;return Math.round(e*1.5)},idleMs(){return this.lastByteAt?Math.max(0,(this.nowTs||Date.now())-this.lastByteAt):0},stalled(){return!!(this.busy&&this.idleMs>this.stallLimitMs)},liveText(){if(!this.busy)return``;let e=[];return this.turnStartedAt&&e.push(`${oO(this.turnStartedAt)} 开始`),this.turnStep>0&&e.push(`第 ${this.turnStep} 步`),e.push(`已用 ${this.fmtClock(this.nowTs-this.turnStartedAt)}`),this.turnStage?e.push(`${this.turnStage.id} ${this.turnStage.label}`):this.turnToolLabel&&e.push(this.turnToolLabel),this.stalled?`${Math.round(this.idleMs/1e3)} 秒没收到任何数据,连接可能已中断(${e.join(` · `)})`:(e.push(`最近数据 ${Math.round(this.idleMs/1e3)} 秒前`),e.join(` · `))}},watch:{suggestBatchKey(){this.suggestOffset=0},visible(e){e?(this.refreshConfig(),this.ensureHistory().then(()=>this.checkResumableTurn()),this.$nextTick(()=>{this.scrollToBottom(!0),this.$refs.composerEl?.focus()})):this.busy&&this.flushHistory()},cardId(e,t){if(this._cardRenamedTo&&this._cardRenamedTo===e){this._cardRenamedTo=``,this._dirtyFor===t&&(this._dirtyFor=e),this._loadedCard===t?(this._loadedCard=e,this._dirtyFor===e&&this.flushHistory(e)):(this._loadedCard=``,this.ensureHistory());return}this._saveTimer&&=(clearTimeout(this._saveTimer),0);let n=this._dirtyFor===t?this.serialize():null;this._dirtyFor=null,this.draftAttachments=[],this.messages=[],n&&t&&this.flushHistory(t,n),this.ensureHistory()}},mounted(){this.loadWidth(),this.loadCompact(),window.addEventListener(`resize`,this.onWinResize),window.addEventListener(`pagehide`,this.onPagehide),this.refreshConfig(),this.ensureHistory()},beforeUnmount(){window.removeEventListener(`resize`,this.onWinResize),window.removeEventListener(`pagehide`,this.onPagehide),this.stopTurnTimers(),this.stopTickers(),this.flushHistory(),this._abort&&this._abort.abort()},methods:{onWinResize(){this.winW=window.innerWidth},onImageClick(e){let t=e.target&&e.target.closest?e.target.closest(`img`):null;if(!t||t.dataset.noZoom===`1`)return;let n=Array.from(this.$el.querySelectorAll(`img`)).filter(e=>e.dataset.noZoom!==`1`),r=n.indexOf(t);r<0||DS(n.map(e=>({src:e.currentSrc||e.src,alt:e.alt||``,title:e.getAttribute(`title`)||e.closest(`[title]`)?.getAttribute(`title`)||``})),r)},loadWidth(){try{let e=localStorage.getItem(aP);if(e!=null){let t=parseInt(e,10);!Number.isNaN(t)&&t>=cP&&(this.widthPx=t)}}catch{}},saveWidth(){try{this.widthPx?localStorage.setItem(aP,String(Math.round(this.panelWidth))):localStorage.removeItem(aP)}catch{}},armGrip(){clearTimeout(this._gripTimer),this._gripTimer=setTimeout(()=>{this.gripArmed=!0},300)},disarmGrip(){clearTimeout(this._gripTimer),this._gripTimer=null,!this.resizing&&(this.gripArmed=!1)},startResize(e){let t=e&&e.currentTarget;if(!t||!this.gripArmed)return;this.resizing=!0,document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`;let n=e.pointerId;try{t.setPointerCapture(n)}catch{}let r=e=>{let t=Math.max(cP,Math.floor(window.innerWidth*lP));this.widthPx=Math.max(cP,Math.min(t,Math.round(window.innerWidth-e.clientX)))},i=()=>{t.removeEventListener(`pointermove`,r),t.removeEventListener(`pointerup`,i),t.removeEventListener(`pointercancel`,i),window.removeEventListener(`blur`,i);try{t.hasPointerCapture?.(n)&&t.releasePointerCapture(n)}catch{}this.resizing=!1,document.body.style.cursor=``,document.body.style.userSelect=``,this.saveWidth()};t.addEventListener(`pointermove`,r),t.addEventListener(`pointerup`,i),t.addEventListener(`pointercancel`,i),window.addEventListener(`blur`,i)},resetWidth(){this.widthPx=0,this.saveWidth()},async refreshConfig(){try{let e=await tk();this.config={...e,hasKey:!!(e.hasKey||e.apiKey)},e.turnRunning!==void 0&&(this.turnRunning=e.turnRunning===!0)}catch{this.config={baseUrl:``,model:``,hasKey:!1,apiKeyMasked:``}}},async loadModels(){try{let e=await rk();this.models=Array.isArray(e.models)?e.models:[],this.activeId=e.activeId||null,this.turnRunning=e.turnRunning===!0}catch{this.models=[],this.activeId=null}},openModelList(){this.modelListOpen=!0,this.loadModels(),this.refreshConfig()},closeModelList(){this.modelListOpen=!1},onModelAdd(){this.modelListOpen=!1,this.editModelId=null,this.editInitialModel=null,this.modelEditOpen=!0},onModelEdit(e){if(this.turnRunning&&e&&e.id===this.activeId)return this.notify(`warn`,pP);this.modelListOpen=!1,this.editModelId=e&&e.id?e.id:null,this.editInitialModel=e||null,this.modelEditOpen=!0},onModelEditClose(){this.modelEditOpen=!1,this.modelListOpen=!0},async onModelSaved(){this.modelEditOpen=!1,this.modelListOpen=!0,await this.loadModels(),await this.refreshConfig()},async onModelActivate(e){if(!(!e||!e.id)){if(this.turnRunning&&e.id!==this.activeId)return this.notify(`warn`,pP);try{await lk(e.id)}catch(e){this.notify(`warn`,`切换模型失败:${e.message||e}`)}await this.loadModels(),await this.refreshConfig()}},onModelDelete(e){if(!(!e||!e.id)){if(this.turnRunning&&e.id===this.activeId)return this.notify(`warn`,pP);this.confirmDeleteModel=e}},async doDeleteModel(){let e=this.confirmDeleteModel;if(this.confirmDeleteModel=null,!(!e||!e.id)){try{await ck(e.id)}catch(e){this.notify(`warn`,`删除失败:${e.message||e}`);return}await this.loadModels(),await this.refreshConfig(),this.notify(`ok`,`已删除模型「${e.name||e.model||e.id}」`)}},get deleteModelMessage(){let e=this.confirmDeleteModel;return`确定删除模型「${e?e.name||e.model||e.id:``}」吗?此操作不可撤销,配置将从 .env.cb.local 移除${e&&e.id===this.activeId?`。该模型当前为生效模型,删除后会自动回落到剩余模型中的第一条(若已无模型则需重新添加)。`:`。`}`},async onImportCcSwitch(){this.ccSwitchOpen=!0,this.ccSwitchLoading=!0,this.ccSwitchProviders=[],this.ccSwitchReason=``,this.ccSwitchSelected={};try{let e=await ik(),t=Array.isArray(e.providers)?e.providers:[],n=this.models.map(e=>e.model).filter(Boolean);t.forEach(e=>{e.duplicate=n.includes(e.model)}),this.ccSwitchProviders=t,t.length||(this.ccSwitchReason=e.reason||`cc-switch 中没有可导入的 Codex 类供应商`)}catch(e){this.ccSwitchReason=`读取 cc-switch 失败:${e&&e.message||e}`}finally{this.ccSwitchLoading=!1}},toggleCcSwitchItem(e){if(!e||e.duplicate)return;let t={...this.ccSwitchSelected};t[e.id]?delete t[e.id]:t[e.id]=!0,this.ccSwitchSelected=t},async confirmImportCcSwitch(){let e=this.ccSwitchProviders.filter(e=>this.ccSwitchSelected[e.id]&&!e.duplicate);if(!e.length)return;let t=0,n=0;for(let r of e)try{await ok({name:r.name||r.model,baseUrl:r.baseUrl,apiKey:r.apiKey||``,model:r.model,maxTokens:0,thinking:!1,vision:!1}),t++}catch(e){n++,console.error(`[cc-switch 导入失败]`,r.name,e)}this.ccSwitchOpen=!1,await this.loadModels(),await this.refreshConfig(),n?this.notify(`warn`,`导入完成:成功 ${t} 个、失败 ${n} 个`):this.notify(`ok`,`已从 cc-switch 导入 ${t} 个模型`)},openCommon(){this.modelListOpen=!1,this.commonOpen=!0},async onCommonSaved(){this.commonOpen=!1,await this.refreshConfig(),this.notify(`ok`,`通用设置已保存`)},async ensureHistory(){let e=this.cardId;if(!(!e||this._loadedCard===e)){this._loadedCard=e,this.loadingHistory=!0;try{let t=await vk(e);if(this.cardId!==e)return;let n=this.busy?this.turnId:``,r=(t.messages||[]).map(e=>this.revive(e)).filter(e=>!(n&&e.role===`assistant`&&e.turnId===n));this.archiveTrimmed=r.some(e=>e.trimmedArchive===!0);let i=new Set(r.map(e=>e.id)),a=this.messages.filter(e=>!i.has(e.id));this.messages=[...r,...a],this.contextUsage=null,this._dirtyFor=null,this.checkResumableTurn(),this.$nextTick(()=>this.scrollToBottom(!0))}catch{this.cardId===e&&(this.messages=[]),this._dirtyFor=null}finally{this.cardId===e&&(this.loadingHistory=!1)}}},serialize(){return this.messages.map(e=>{let t={id:e.id,role:e.role,content:e.content||``,ts:e.ts};return e.role===`assistant`?(t.reasoning=e.reasoning||``,t.reasoningMs=e.reasoningMs||0,t.error=e.error||``,e.errorCode&&(t.errorCode=e.errorCode),e.events?.length&&(t.events=e.events.map(e=>({ts:e.ts||0,level:e.level||`warn`,code:e.code||``,message:e.message||``}))),t.elapsedMs=e.elapsedMs||0,t.status=e.status===`streaming`?`aborted`:e.status||`done`,e.turnId&&(t.turnId=e.turnId),e.serverAuthored&&(t.serverAuthored=!0),e.budget?.message&&(t.budget={reason:e.budget.reason||``,message:e.budget.message}),e.usage&&(t.usage=e.usage),e.toolCalls?.length&&(t.toolCalls=e.toolCalls.map(e=>({toolCallId:e.toolCallId,toolName:e.toolName,args:e.args||{},result:e.result,error:e.error||``,ms:e.ms||0,startedAt:e.startedAt||0,command:e.command||``,approvalNote:e.approvalNote||``,autoApproved:!!e.autoApproved})))):e.attachments?.length&&(t.attachments=e.attachments.map(e=>({path:e.path,name:e.name,isDir:!!e.isDir,isImage:!!e.isImage,size:e.size||0,entryCount:e.entryCount||0,exists:e.exists!==!1}))),t})},revive(e){return{id:e.id||fP(),role:e.role===`user`?`user`:`assistant`,content:e.content||``,narrationChars:Math.max(0,Number(e.narrationChars)||0),reasoning:e.reasoning||``,reasoningMs:e.reasoningMs||0,elapsedMs:Number(e.elapsedMs)||0,toolCalls:Array.isArray(e.toolCalls)?e.toolCalls.map(t=>(e.status===`aborted`||e.status===`streaming`)&&t&&!t.error&&t.result==null?{...t,error:`已终止:该调用未拿到结果(轮次被中断)`}:t):[],attachments:Array.isArray(e.attachments)?e.attachments:[],events:Array.isArray(e.events)?e.events:[],error:e.error||``,errorCode:e.errorCode||``,trimmedArchive:e.trimmedArchive===!0,status:e.status||`done`,turnId:e.turnId||``,serverAuthored:e.serverAuthored===!0,budget:e.budget?.message?{reason:e.budget.reason||``,message:e.budget.message}:void 0,ts:e.ts||0}},persist(){this.cardId&&(this._dirtyFor=this.cardId,this._saveTimer&&clearTimeout(this._saveTimer),this._saveTimer=setTimeout(()=>this.flushHistory(),500))},fitArchive(e){if(KN(e)<=4e6)return e;let t=YN(e,!1);return KN(t)>4e6&&(t=YN(t,!0)),this.archiveTrimmed=!0,t},async flushHistory(e=this.cardId,t=null){if(this._saveTimer&&=(clearTimeout(this._saveTimer),0),e){if(this._saving){this._saveTimer=setTimeout(()=>this.flushHistory(e,t),800);return}this._saving=!0;try{await yk(e,this.fitArchive(t||this.serialize())),this._dirtyFor===e&&(this._dirtyFor=null)}catch(e){this.notify(`warn`,`对话记录保存失败:${e.message||e}`)}finally{this._saving=!1}}},migrateCard(e,t){!e||!t||e===t||this.cardId===e&&(this._saveTimer&&=(clearTimeout(this._saveTimer),0),this._cardRenamedTo=t,this._dirtyFor===e&&(this._dirtyFor=t))},discardCard(e){e&&(this._saveTimer&&=(clearTimeout(this._saveTimer),0),this._dirtyFor===e&&(this._dirtyFor=null),(this._loadedCard===e||this.cardId===e)&&(this.busy&&this._abort&&this._abort.abort(),this.messages=[],this.draftAttachments=[],this.contextUsage=null,this._loadedCard=``))},askClear(){this.messages.length&&(this.confirmClear=!0)},async doClear(){this.confirmClear=!1;let e=this.cardId;this.messages=[],this.contextUsage=null,this._loadedCard=e,this._dirtyFor=null,this._saveTimer&&=(clearTimeout(this._saveTimer),0);try{await bk(e),this.notify(`ok`,`已清空本卡片的对话记录`)}catch(e){this.notify(`warn`,`清空失败:${e.message||e}`)}},async onPick(e){try{let t=await fk(e);if(t.cancelled)return;for(let e of t.items||[])this.pushAttachment(e);t.items?.length||this.notify(`warn`,`未选到可用文件`)}catch(e){this.notify(`warn`,e.message||`无法调起系统选择器,可改用拖拽或粘贴路径`)}},async onAddPath(e){try{let t=await pk(e);this.pushAttachment(t)}catch(t){this.notify(`warn`,`路径不可用:${e}(${t.message||t})`)}},async onPasteImage(e){try{let t=await gk(e);this.pushAttachment(t,`粘贴的截图已存到本机 .cache/ai-attachments/`)}catch(e){this.notify(`warn`,`截图保存失败:${e.message||e}`)}},async onDropFiles(e){let t=Array.from(e.items||[]).map(e=>e.webkitGetAsEntry?e.webkitGetAsEntry():null).filter(Boolean),n=Array.from(e.files||[]),r=[];if(t.length)for(let e of t)r.push(this.resolveEntry(e));else for(let e of n)r.push(this.resolveFile(e));if(!r.length){this.notify(`warn`,`没有识别到可挂载的文件`);return}let i=(await Promise.all(r)).filter(e=>e!==`cancelled`&&!e).length;i&&this.notify(`warn`,`${i} 项未能定位本机路径,可改用「粘贴路径」添加`)},async resolveEntry(e){if(e.isDirectory){let t=await this.firstFileInDir(e);return this.resolveByName(e.name,e.fullPath||e.name,t?.size??-1,t?.name||``)}let t=await this.entryToFile(e);return t?this.resolveFile(t):this.resolveByName(e.name,e.fullPath||e.name,-1)},async resolveFile(e){return this.resolveByName(e.name,e.webkitRelativePath||e.name,e.size)},async resolveByName(e,t,n,r=``){let i={id:fP(`att`),path:``,name:e,isDir:!1,isImage:!1,pending:!0};this.draftAttachments=[...this.draftAttachments,i];try{let a=await hk(mk({name:e,relPath:t,size:n,child:r}),oP,`locate`);return i.removed?`cancelled`:(this.pushAttachment(a),a)}catch{return i.removed?`cancelled`:null}finally{this.draftAttachments=this.draftAttachments.filter(e=>e.id!==i.id)}},entryToFile(e){return new Promise(t=>{try{e.file(e=>t(e),()=>t(null))}catch{t(null)}})},firstFileInDir(e){return new Promise(t=>{try{e.createReader().readEntries(async e=>{for(let n of e||[])if(!n.isDirectory){let e=await this.entryToFile(n);if(e)return t(e)}t(null)},()=>t(null))}catch{t(null)}})},pushAttachment(e,t){e?.path&&(this.draftAttachments.some(t=>t.path===e.path)||(this.draftAttachments=[...this.draftAttachments,{...e,note:t}],t&&this.notify(`ok`,t)))},removeAttachment(e){if(!e)return;let t=this.draftAttachments.find(t=>(t.id||t.path)===e);t&&t.pending&&(t.removed=!0),this.draftAttachments=this.draftAttachments.filter(t=>(t.id||t.path)!==e)},cancelPendingLocates(){for(let e of this.draftAttachments)e.pending&&(e.removed=!0)},useSuggestion(e){this.$refs.composerEl?.setText(e.text),this.trackSuggest(e)},shuffleSuggestions(){let e=this.suggestBatch.length;e&&(this.suggestOffset=(this.suggestOffset+4)%e)},trackSuggest(e){if(!(!e||!e.id)){this.suggestStats[e.id]=(this.suggestStats[e.id]||0)+1;try{window.dispatchEvent(new CustomEvent(`cardbuddy:suggest`,{detail:{id:e.id,label:e.label,weight:e.weight,batch:this.suggestBatchKey}}))}catch{}}},async onSend({text:e,attachments:t}){if(this.busy||!await this.ensureConfig())return;this.notice=null;let n={id:fP(`u`),role:`user`,content:e,attachments:t.map(e=>({...e})),ts:Date.now()};this.messages.push(n),this.cancelPendingLocates(),this.draftAttachments=[],this.pinned=!0,await this.runTurn({retractMsgId:n.id,draft:{text:e,attachments:n.attachments}})},async ensureConfig(){return await this.refreshConfig(),this.configReady?!0:(this.modelListOpen=!0,this.loadModels(),this.notify(`warn`,`请先在模型库中添加并配置模型(Base URL / API Key / 模型名)`),!1)},onPickBoard(e){if(this.busy)return;let t=kO(e,this.cardId);t&&this.onSend({text:t,attachments:[]})},onContinue(){this.busy||this.onSend({text:`继续`,attachments:[]})},async regenerate(e){if(this.busy)return;let t=this.messages.findIndex(t=>t.id===e.id);t>0&&(this.messages=this.messages.slice(0,t)),await this.runTurn()},async runTurn(e={}){this.messages.push({id:fP(`a`),role:`assistant`,content:``,narrationChars:0,reasoning:``,reasoningMs:0,toolCalls:[],events:[],error:``,status:`streaming`,ts:Date.now()});let t=this.messages[this.messages.length-1],n=t.id;this.busy=!0,this.pinned=!0,this.startTurn();let r=new AbortController;this._abort=r;let i=!1,a=Date.now(),o=()=>{t.reasoning&&!t.reasoningMs&&(t.reasoningMs=Date.now()-a)};try{await Sk({messages:this.toWire(this.messages.filter(e=>e.id!==n)),cardContext:this.cardId?{id:this.cardId}:void 0,attachments:this.lastAttachments(),signal:r.signal,onEvent:e=>this.onEvent(e,t,o)}),t.status===`streaming`&&(t.status=`done`)}catch(a){let s=r.signal.aborted||/abort/i.test(String(a?.message||a));o(),a?.code===`turn-in-flight`?(i=!0,this.messages=this.messages.filter(t=>t.id!==n&&t.id!==e.retractMsgId),e.draft&&(this.draftAttachments=(e.draft.attachments||[]).map(e=>({...e})),this.$refs.composerEl?.setText(e.draft.text||``)),this.notify(`warn`,String(a?.message||`这张卡片已有一个回合在跑:请先终止或等它结束,再发新消息`)),this.$nextTick(()=>this.checkResumableTurn())):s?t.status=`aborted`:await this.reattachAfterDrop(t,o)?this.pushEvent(t,{level:`info`,code:`stream-resumed`,message:`已接回本回合,继续跟随进度`}):(t.error=String(a?.message||a),t.errorCode=String(a?.code||``),t.status=`error`)}finally{o(),this.endTurn(t,{rejected:i})}},endTurn(e,{rejected:t=!1}={}){e.status===`streaming`&&(e.status=`done`),t||(e.elapsedMs=Math.max(0,Date.now()-this.turnStartedAt)),this.busy=!1,this._abort=null,this.stopTurnTimers(),this.persist(),this.$emit(`busy`,!1),t||this.$emit(`turn-finished`,{status:e.status,error:e.error||``,steps:this.turnStep,ms:Date.now()-this.turnStartedAt,startedAt:this.turnStartedAt,finishedAt:Date.now(),turnId:this.turnId||e.turnId||``}),this.$nextTick(()=>this.scrollToBottom())},async checkResumableTurn(){let e=this.cardId;if(!(!e||this.busy||this._resumeProbe)){this._resumeProbe=!0;try{let t;try{t=await Ck(e)}catch{return}let n=t&&t.active;if(!n||!n.turnId||this.cardId!==e||this.busy)return;await this.attachToTurn({cardId:e,turnId:String(n.turnId),startedAt:Number(n.startedAt)||0,afterSeq:0,note:n.detached?`接回一个仍在服务端运行的回合(上次连接已中断,进度与已落盘产物都在)`:`接回本回合的实时进度`})}finally{this._resumeProbe=!1}}},async attachToTurn({cardId:e,turnId:t,startedAt:n=0,afterSeq:r=0,note:i=``}){let a=this.messages.find(e=>e.role===`assistant`&&e.turnId===t);a||=(this.messages.push({id:fP(`a`),role:`assistant`,content:``,narrationChars:0,reasoning:``,reasoningMs:0,toolCalls:[],events:[],error:``,status:`streaming`,ts:n||Date.now(),turnId:t}),this.messages[this.messages.length-1]),a.content=``,a.reasoning=``,a.reasoningMs=0,a.toolCalls=[],a.events=[],a.error=``,a.errorCode=``,a.budget=void 0,a.status=`streaming`,a.turnId=t,this.busy=!0,this.pinned=!0,this.startTurn(),this.turnId=t,this.lastSeq=Number(r)||0,n&&(this.turnStartedAt=n,a.ts=n);let o=new AbortController;this._abort=o;let s=n||Date.now(),c=()=>{a.reasoning&&!a.reasoningMs&&(a.reasoningMs=Date.now()-s)};i&&this.notify(`warn`,i);try{this.lastSeq=await Tk({cardId:e,turnId:t,afterSeq:this.lastSeq,signal:o.signal,onEvent:e=>this.onEvent(e,a,c)})}catch(e){o.signal.aborted||/abort/i.test(String(e?.message||e))||(a.error=String(e?.message||e),a.errorCode=String(e?.code||``),a.status=`error`)}finally{c(),this.endTurn(a)}},async reattachAfterDrop(e,t){let n=this.cardId,r=this.turnId||e.turnId,i=this._abort;if(!n||!r||!i||i.signal.aborted)return!1;try{return this.pushEvent(e,{level:`warn`,code:`stream-dropped`,message:`连接中断:正在按断点续订本回合(服务端仍在跑,已执行的写入不受影响)`}),this.lastSeq=await Tk({cardId:n,turnId:r,afterSeq:this.lastSeq,signal:i.signal,onEvent:n=>this.onEvent(n,e,t)}),!0}catch{return!1}},onEvent(e,t,n){this.lastByteAt=Date.now();let r=Number(e.seq)||0;switch(r>this.lastSeq&&(this.lastSeq=r),e.type){case`turn-start`:e.turnId&&(this.turnId=String(e.turnId),t.turnId=String(e.turnId)),Number(e.startedAt)&&(this.turnStartedAt=Number(e.startedAt),t.ts=Number(e.startedAt));break;case`client-detached`:this.pushEvent(t,{level:`info`,code:`client-detached`,message:`连接曾中断,回合在服务端继续跑(事件已全部落日志)`});break;case`turn-end`:(e.status===`aborted`||e.status===`error`)&&(t.status=e.status),e.usage&&this.applyUsage(t,e.usage);break;case`usage`:this.applyUsage(t,e);break;case`reasoning-delta`:t.reasoning+=e.text||``;break;case`text-delta`:n(),t.content+=e.text||``;break;case`tool-call-start`:n(),t.content&&(t.narrationChars=t.content.length),this.findToolRow(t,e)||t.toolCalls.push({toolCallId:e.toolCallId||fP(`tc`),toolName:e.toolName,args:{},pending:!0,result:void 0,error:``,startedAt:Date.now(),ms:0});break;case`tool-call`:{n(),t.content&&(t.narrationChars=t.content.length);let r=this.findToolRow(t,e);r?(e.toolCallId&&(r.toolCallId=e.toolCallId),e.toolName&&(r.toolName=e.toolName),r.args=e.args||{},r.pending=!1):t.toolCalls.push({toolCallId:e.toolCallId||fP(`tc`),toolName:e.toolName,args:e.args||{},result:void 0,error:``,startedAt:Date.now(),ms:0});break}case`tool-result`:{let n=t.toolCalls.find(t=>t.toolCallId===e.toolCallId||!e.toolCallId&&t.toolName===e.toolName&&t.result===void 0);n&&(n.result=e.result??``,n.truncated=!!e.truncated,e.error&&(n.error=String(e.error)),e.image&&(n.image=e.image),n.ms=Date.now()-(n.startedAt||Date.now())),this.persist();break}case`approval-request`:{let n=this.findToolRow(t,e)||t.toolCalls[t.toolCalls.length-1];n&&n.toolName===e.toolName&&n.result===void 0?(n.approvalId=e.approvalId,e.command&&(n.command=e.command),n.needsApproval=!0):t.toolCalls.push({toolCallId:e.toolCallId||fP(`tc`),toolName:e.toolName,args:e.args||{},command:e.command||``,approvalId:e.approvalId,needsApproval:!0,result:void 0,error:``,startedAt:Date.now(),ms:0});break}case`approval-decided`:{let n=(t.toolCalls||[]).find(t=>t.approvalId===e.approvalId);n&&(n.needsApproval=!1,n.approvalNote=e.ok?e.scope===`turn`?`已允许,本回合后续同类执行不再询问…`:`已允许,执行中…`:e.reason||`已拒绝执行`);break}case`approval-auto`:{let n=this.findToolRow(t,e)||[...t.toolCalls||[]].reverse().find(t=>t.toolName===e.toolName&&t.result===void 0);n&&(e.command&&(n.command=e.command),n.autoApproved=!0,n.approvalNote=`按设置免确认执行`);break}case`notice`:{let n=e.level===`info`||e.level===`error`?e.level:`warn`;this.pushEvent(t,{level:n,code:e.code||``,message:e.message||``}),n!==`info`&&this.notify(n===`error`?`danger`:`warn`,e.message||``);break}case`round-retry`:{let n=Number(e.dropReasoning)||0,r=Number(e.dropText)||0,i=Number(e.dropTools)||0;n>0&&(t.reasoning=t.reasoning.slice(0,Math.max(0,t.reasoning.length-n))),r>0&&(t.content=t.content.slice(0,Math.max(0,t.content.length-r))),i>0&&t.toolCalls.splice(Math.max(0,t.toolCalls.length-i),i),t.reasoning||(t.reasoningMs=0),this.pushEvent(t,{level:`warn`,code:`retry-${e.reason||`unknown`}`,message:e.message||``}),this.notify(`warn`,e.message||``);break}case`context-usage`:this.contextUsage={used:Number(e.used)||0,total:Number(e.total)||0,window:Number(e.window)||0};break;case`turn-ended`:t.budget={reason:String(e.reason||``),message:String(e.message||``)};break;case`error`:t.error=t.error?`${t.error}\n${e.message}`:String(e.message||``),e.code&&(t.errorCode=String(e.code)),t.status=`error`;break;case`aborted`:t.status=`aborted`}let i=t.toolCalls||[];this.turnStep=i.length;let a=i[i.length-1];if(a){this.turnToolLabel=`正在${nO(a.toolName)}…`;let e=lO(a);e&&(!this.turnStage||e.order>this.turnStage.order)&&(this.turnStage=e)}this.$nextTick(()=>this.scrollToBottom())},async onApproval({tc:e,ok:t,scope:n=`once`}){if(e?.approvalId){e.needsApproval=!1,e.approvalNote=t?n===`turn`?`已允许,本回合后续同类执行不再询问…`:`已允许,执行中…`:`已拒绝执行`;try{await _k({approvalId:e.approvalId,ok:t,scope:n})}catch(e){this.notify(`warn`,`审批提交失败:${e.message}`)}}},findToolRow(e,t){let n=e.toolCalls||[];if(t.toolCallId){let e=n.find(e=>e.toolCallId===t.toolCallId);if(e)return e}return n.find(e=>e.pending&&e.toolName===t.toolName)||null},stop(){this.confirmStop=!1;let e=this._abort,t=this.cardId,n=this.turnId||``;t&&n&&wk(t).catch(e=>{e?.code!==`no-turn`&&this.notify(`warn`,`终止请求未送达:${e.message}`)}),e&&(e.abort(),this.notify(`ok`,`已终止本次生成`))},doStop(){this.stop()},onEscape(){if(this.confirmStop){this.confirmStop=!1;return}if(this.confirmDeleteModel){this.confirmDeleteModel=null;return}if(this.commonOpen){this.commonOpen=!1;return}if(this.modelListOpen||this.modelEditOpen){this.modelListOpen=!1,this.modelEditOpen=!1;return}if(this.busy){this.confirmStop=!0;return}this.$emit(`close`)},lastAttachments(){for(let e=this.messages.length-1;e>=0;e--){let t=this.messages[e];if(t.role===`user`)return(t.attachments||[]).map(e=>({path:e.path,name:e.name,isDir:e.isDir,isImage:e.isImage}))}return[]},toWire(e){return e.map(e=>{if(e.role===`user`){let t=e.attachments||[],n=e.content||``;if(t.length){let e=t.map(e=>`- ${e.isDir?`文件夹`:e.isImage?`图片`:`文件`}:${e.path}`);n=`${n}${n?`
|
|
272
|
+
分组展开后的成员行与平铺行走的是同一份标记,复制两遍必然漂移 `),H(`div`,{class:A([`aitool`,[`aitool--${a.state}`,{"is-open":a.open}]])},[H(`button`,{type:`button`,class:`aitool__head`,"aria-expanded":a.open?`true`:`false`,onClick:t[0]||=(...e)=>a.toggle&&a.toggle(...e)},[t[7]||=H(`svg`,{class:`aitool__chev`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-chevron-right`})],-1),a.state===`running`||a.state===`pending`?(z(),B(`svg`,dk,[...t[4]||=[H(`use`,{href:`#icon-loading`},null,-1)]])):a.state===`error`?(z(),B(`svg`,fk,[...t[5]||=[H(`use`,{href:`#icon-alert-triangle`},null,-1)]])):(z(),B(`svg`,pk,[...t[6]||=[H(`use`,{href:`#icon-check`},null,-1)]])),H(`span`,mk,j(a.toolLabel(n.tc.toolName)),1),H(`code`,hk,j(n.tc.pending?`参数生成中…`:a.argSummary),1),G(` 时间三件套:这一步什么时候开始(墙钟)· 距回合起点多久(累计)· 自身耗时。
|
|
273
|
+
长任务里「卡在哪一步、卡了多久」全靠这三个数互相对齐 `),a.clockText?(z(),B(`span`,{key:3,class:`aitool__clock`,title:a.clockTitle},j(a.clockText),9,gk)):G(`v-if`,!0),a.msText?(z(),B(`span`,{key:4,class:`aitool__ms`,title:`本步耗时 ${a.msText}`},j(a.msText),9,_k)):G(`v-if`,!0)],8,uk),G(` 高危执行逐次确认:命令原文 + 允许一次 / 本回合不再询问 / 拒绝(Codex 审批的同款交互) `),n.tc.needsApproval?(z(),B(`div`,vk,[t[8]||=H(`svg`,{class:`aitool__approve-icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-alert-triangle`})],-1),H(`code`,{class:`aitool__approve-cmd`,title:a.approvalCommand},j(a.approvalCommand),9,yk),H(`span`,bk,j(n.tc.toolName===`skill_exec`?`技能脚本,需要你确认`:`本地命令,需要你确认`),1),H(`button`,{type:`button`,class:`aitool__approve-btn`,onClick:t[1]||=K(t=>e.$emit(`approval`,{tc:n.tc,ok:!0,scope:`once`}),[`stop`])},`允许一次`),H(`button`,{type:`button`,class:`aitool__approve-btn aitool__approve-btn--ghost`,onClick:t[2]||=K(t=>e.$emit(`approval`,{tc:n.tc,ok:!0,scope:`turn`}),[`stop`])},`本回合不再询问`),H(`button`,{type:`button`,class:`aitool__approve-btn aitool__approve-btn--deny`,onClick:t[3]||=K(t=>e.$emit(`approval`,{tc:n.tc,ok:!1}),[`stop`])},`拒绝`)])):n.tc.approvalNote?(z(),B(R,{key:1},[G(` 免确认策略命中:没有审批条,但照样把「跑了什么命令」摆出来,免确认不等于无痕迹 `),H(`div`,{class:A([`aitool__approve-note`,{"is-auto":n.tc.autoApproved}])},[H(`span`,xk,j(n.tc.approvalNote),1),n.tc.autoApproved&&n.tc.command?(z(),B(`code`,{key:0,class:`aitool__approve-cmd`,title:n.tc.command},j(n.tc.command),9,Sk)):G(`v-if`,!0)],2)],2112)):G(`v-if`,!0),F(H(`div`,Ck,[G(` 画板清单点选:清单里是 1 起的板号、--indices 是 0 起,让用户/模型去换算,实测就是这么
|
|
274
|
+
错一位建错画板的。点一下 = 把清单行尾那串原样的 --pick 直接发给模型,中间零翻译 `),a.boardPicks.length?(z(),B(`div`,wk,[t[9]||=H(`div`,{class:`aitool__picks-hint`},`点一下直接建卡 = 照抄清单行尾的 --pick,不用换算序号;一板多卡已按张拆开:`,-1),(z(!0),B(R,null,L(a.boardPicks,t=>(z(),B(`button`,{key:t.pick,type:`button`,class:`aitool__pick`,title:`${t.name}(${t.size})→ parse_meaxure.py --pick ${t.pick}`,"aria-label":`建卡:画板 ${t.no} ${t.name}(${t.size})--pick ${t.pick}`,onClick:n=>e.$emit(`pick-board`,t)},[H(`span`,Ek,`第 `+j(t.no)+` 板`,1),H(`code`,Dk,j(t.token),1)],8,Tk))),128))])):G(`v-if`,!0),a.argsSource?(z(),V(o,{key:1,source:a.argsSource},null,8,[`source`])):G(`v-if`,!0),n.tc.image?(z(),B(`img`,{key:2,class:`aitool__shot`,src:`data:${n.tc.image.mime||`image/png`};base64,${n.tc.image.base64}`,alt:`卡片截图`},null,8,Ok)):G(`v-if`,!0),n.tc.error?(z(),B(`div`,kk,j(n.tc.error),1)):a.resultSource?(z(),V(o,{key:4,source:a.resultSource},null,8,[`source`])):G(`v-if`,!0)],512),[[Cc,a.open]])],2)],2112)}var jk=Y(lk,[[`render`,Ak],[`__scopeId`,`data-v-c80ddf1d`],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ChatToolRow.vue`]]);function Mk(e){return`${Il()||``}/__ai/fs/raw?path=${encodeURIComponent(e)}`}async function Nk(e){let t=await e.json().catch(()=>({}));if(!e.ok){let n=``;try{n=new URL(e.url).pathname}catch{}let r=(e.status===404||e.status===405)&&n.startsWith(`/__ai/`)?`本地开发服务仍在运行改造前的旧代码(缺少该接口),请重启 npm run dev(cardbuddy)后重试`:t.message||t.error||`HTTP ${e.status}`,i=Error(r);throw i.code=t.error,i.payload=t,i}return t}async function Pk(e=!1){return Nk(await q(`/__ai/config${e?`?reveal=1`:``}`))}async function Fk(e){return Nk(await q(`/__ai/config`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}))}async function Ik(){return Nk(await q(`/__ai/models`))}async function Lk(){return Nk(await q(`/__ai/cc-switch-providers`))}async function Rk(e,t=!1){return Nk(await q(`/__ai/models/${encodeURIComponent(e)}${t?`?reveal=1`:``}`))}async function zk(e){return Nk(await q(`/__ai/models`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}))}async function Bk(e,t){return Nk(await q(`/__ai/models/${encodeURIComponent(e)}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}))}async function Vk(e){return Nk(await q(`/__ai/models/${encodeURIComponent(e)}`,{method:`DELETE`}))}async function Hk(e){return Nk(await q(`/__ai/models/${encodeURIComponent(e)}/activate`,{method:`POST`}))}async function Uk(e={}){let{baseUrl:t=``,apiKey:n=``,model:r=``}=e||{};return Nk(await q(`/__ai/probe-maxtokens`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({baseUrl:t,apiKey:n,model:r})}))}async function Wk(e){return Nk(await q(`/__ai/ping`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}))}async function Gk(e=`image`){return Nk(await q(`/__ai/fs/pick`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e,multiple:!0})}))}async function Kk(e){return Nk(await q(`/__ai/fs/stat?path=${encodeURIComponent(e)}`))}async function qk({name:e,relPath:t,size:n,child:r=``}){return Nk(await q(`/__ai/fs/locate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,relPath:t,size:n,child:r})}))}function Jk(e,t,n=`request`){return new Promise((r,i)=>{let a=setTimeout(()=>{let e=Error(`${n}-timeout`);e.code=`timeout`,i(e)},t);e.then(e=>{clearTimeout(a),r(e)},e=>{clearTimeout(a),i(e)})})}async function Yk(e){return Nk(await q(`/__ai/fs/stash`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({dataUrl:e})}))}async function Xk({approvalId:e,ok:t,scope:n=`once`}){return Nk(await q(`/__ai/approve`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({approvalId:e,ok:t,scope:n})}))}async function Zk(e){return e?Nk(await q(`/__ai/history?cardId=${encodeURIComponent(e)}`)):{cardId:``,messages:[],updatedAt:0}}async function Qk(e,t,n={}){return e?Nk(await q(`/__ai/history`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cardId:e,messages:t}),keepalive:n.keepalive===!0})):{ok:!1,error:`missing-card-id`}}async function $k(e){return e?Nk(await q(`/__ai/history?cardId=${encodeURIComponent(e)}`,{method:`DELETE`})):{ok:!1,error:`missing-card-id`}}async function eA(e,t){let n=e.body.getReader(),r=new TextDecoder,i=``,a=e=>{i+=e;let n=i.split(`
|
|
275
|
+
`);i=n.pop()||``;for(let e of n){let n=e.trim();if(!n.startsWith(`data:`))continue;let r=n.slice(5).trim();if(!r)continue;let i;try{i=JSON.parse(r)}catch{continue}if(t(i)===!0)return!0}return!1};try{for(;;){let{done:e,value:t}=await n.read();if(e||a(r.decode(t,{stream:!0})))break}a(r.decode())}finally{try{n.releaseLock?.()}catch{}}}async function tA({messages:e,cardContext:t,attachments:n=[],config:r={},signal:i,onEvent:a}){let o=await q(`/__ai/chat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({messages:e,cardContext:t,attachments:n,config:r}),signal:i});if(!o.ok||!o.body){let e=await o.json().catch(()=>({})),t=Error(e.message||e.error||`HTTP ${o.status}`);throw t.code=e.error||`http-${o.status}`,t.status=o.status,t.payload=e,t}await eA(o,e=>(a(e),e.type===`done`))}async function nA(e){return e?Nk(await q(`/__ai/turns?cardId=${encodeURIComponent(e)}`)):{cardId:``,active:null,recent:[]}}async function rA(e){return e?Nk(await q(`/__ai/stop`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cardId:e})})):{ok:!1,error:`missing-card-id`}}async function iA({cardId:e,afterSeq:t=0,turnId:n=``,signal:r,onEvent:i}){if(!e){let e=Error(`缺少 cardId,无法续订回合`);throw e.code=`missing-card-id`,e}let a=new URLSearchParams({cardId:e,afterSeq:String(Number(t)||0)});n&&a.set(`turnId`,String(n));let o=await q(`/__ai/turn?${a}`,{signal:r});if(!o.ok||!o.body){let e=await o.json().catch(()=>({})),t=Error(e.message||e.error||`HTTP ${o.status}`);throw t.code=e.error||`http-${o.status}`,t.status=o.status,t}let s=Number(t)||0;return await eA(o,e=>{let t=Number(e.seq)||0;return t>s&&(s=t),i(e),!1}),s}function aA(e,t,n=300){let r=String(e??``),i=Math.max(0,Math.min(Number(t)||0,r.length));return i<Math.max(0,Number(n)||0)?{head:``,tail:r,folded:!1}:{head:r.slice(0,i),tail:r.slice(i),folded:!0}}var oA=3,sA={name:`ChatMessage`,components:{MarkdownBody:NO,ChatToolRow:jk},props:{msg:{type:Object,required:!0},streaming:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},canRollback:{type:Boolean,default:!1},nowTs:{type:Number,default:0},canRegenerate:{type:Boolean,default:!1},pickOwner:{type:Object,default:null}},emits:[`regenerate`,`approval`,`continue`,`rollback`,`open-settings`,`show-all-steps`,`locate-node`,`pick-board`],data(){return{thinkOpen:!1,narrOpen:!1,eventsOpen:null,copied:!1,elapsed:0,openGroups:Object.create(null),errorCopied:!1,_tick:0}},computed:{budgetLabel(){return{loop:`死循环熔断`,timeout:`墙钟熔断`,steps:`步数硬顶`}[this.msg.budget?.reason]||`本轮收尾`},budgetHint(){return{loop:`连续多轮同工具同参数 = 拿不到新信息。回复「继续」前最好补一句新思路(换证据链 / 指定要改的字段),否则大概率原地再转一次。`,timeout:`本轮跑到墙钟上限(AI_TURN_TIMEOUT_MS 可调)。回复「继续」会带着完整上下文从中断处接着做。`,steps:`你在设置里配了「单轮步数上限」。留空即不限步数,失控由死循环 / 墙钟熔断兜住。`}[this.msg.budget?.reason]||`上下文已保留,回复「继续」可接着做。`},attachments(){return Array.isArray(this.msg.attachments)?this.msg.attachments:[]},toolCalls(){return Array.isArray(this.msg.toolCalls)?this.msg.toolCalls:[]},msgTs(){return Number(this.msg.ts)||0},turnClock(){let e=this.msgTs,t=Number(this.msg.elapsedMs)||0,n=e&&t>0?e+t:0;if(!n)for(let e of this.toolCalls)n=Math.max(n,VO(e,this.nowTs));return{stamp:zO(e),endStamp:n>e?zO(n):``,total:n>e?RO(n-e):``}},toolGroups(){let e=[],t=[],n=()=>{if(t.length>=oA)e.push({kind:`group`,key:`g-${t[0].toolCallId||e.length}`,toolName:t[0].toolName,rows:t.slice(),ms:t.reduce((e,t)=>e+(Number(t.ms)||0),0),failed:t.filter(e=>e.error).length,clock:this.groupClock(t)});else for(let n of t)e.push({kind:`row`,key:n.toolCallId||`r-${e.length}`,tc:n});t=[]};for(let e of this.toolCalls)if(!(this.compact&&!GO(e))){if(t.length&&t[0].toolName===e.toolName){t.push(e);continue}n(),t=[e]}return n(),e},hiddenSteps(){return this.compact?this.toolCalls.filter(e=>!GO(e)).length:0},summary(){return QO(this.toolCalls)},showSummary(){if(this.streaming)return!1;let e=this.summary;return!!(e.writes||e.writeFails||e.gate||e.validate||e.failed||this.cacheBadge)},cacheBadge(){let e=this.msg.usage;if(!e||!Number(e.promptTokens))return null;let t=Number(e.promptTokens)||0,n=Number(e.cachedTokens)||0,r=Number(e.steps)||0,i=e=>e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e);if(!e.reported)return{label:`缓存未提供`,ok:!1,title:`本回合累计输入 ${i(t)} token(${r} 步):该网关未回缓存命中字段,无法统计命中率`};let a=Number(e.hitRate)||0;return{label:`缓存命中 ${a}%`,ok:a>=50,title:`本回合累计输入 ${i(t)} token(${r} 步,命中 ${i(n)} / 未命中 ${i(t-n)}):命中量按网关的 64 token 块对齐,未命中部分多为本轮新增的工具结果与收尾提示`}},validateIssues(){let e=this.summary.validate;return e&&Array.isArray(e.issues)?e.issues:[]},validateMore(){let e=this.summary.validate;return e?Math.max(0,(e.errors||0)+(e.warnings||0)-this.validateIssues.length):0},advice(){return this.msg.error?ek(this.msg.errorCode||``):{hint:``,action:``}},errorHint(){return this.advice.hint},errorAction(){return this.advice.action},events(){return Array.isArray(this.msg.events)?this.msg.events:[]},hasErrorEvent(){return this.events.some(e=>e.level===`error`)},eventsExpanded(){return this.eventsOpen===null?this.hasErrorEvent:this.eventsOpen},eventsLabel(){let e=this.events.filter(e=>e.level!==`info`).length;return e?`过程事件 ${this.events.length} 条(${e} 条需留意)`:`过程事件 ${this.events.length} 条`},bodyText(){return yO(this.bodySplit.tail.replace(/\n*\[\s*(?:任务完成|需用户确认)\s*\]\s*$/,``).trimEnd(),Mk)},bodySplit(){return aA(this.msg.content,this.msg.narrationChars)},narrationText(){return this.bodySplit.head?yO(this.bodySplit.head,Mk):``},narrationSize(){return this.bodySplit.head.length.toLocaleString(`zh-CN`)},thinking(){return!!(this.streaming&&!this.msg.content&&!this.toolCalls.length)},streamingText(){return!!(this.streaming&&this.msg.content)},waiting(){return!!(this.streaming&&!this.msg.reasoning&&!this.msg.content&&!this.toolCalls.length&&!this.msg.error)},thinkLabel(){return this.thinking?`思考中… ${this.fmtClock(this.elapsedMs)}`:`已思考 ${this.fmtClock(this.msg.reasoningMs||this.elapsedMs)}`},elapsedMs(){return this.thinking?this.elapsed:this.msg.reasoningMs||this.elapsed},peek(){let e=String(this.msg.reasoning||``).split(`
|
|
276
|
+
`).map(e=>e.trim()).filter(Boolean),t=e[e.length-1]||``;return t.length>72?`${t.slice(0,72)}…`:t}},watch:{streaming:{immediate:!0,handler(e){e?this.startTick():this.stopTick()}},thinking(e){e||this.stopTick()}},beforeUnmount(){this.stopTick()},updated(){let e=this.$refs.thinkPre;e&&this.thinkOpen&&this.thinking&&(e.scrollTop=e.scrollHeight)},methods:{startTick(){this.stopTick(),this.elapsed=0,this._tick=setInterval(()=>{this.elapsed+=250},250)},stopTick(){this._tick&&clearInterval(this._tick),this._tick=0},fmtStamp:zO,fmtClock:RO,evOff(e){let t=Number(e&&e.ts)||0;return t>this.msgTs?BO(t-this.msgTs):``},groupClock(e){let t=VO(e[e.length-1],this.nowTs),n=t>this.msgTs?BO(t-this.msgTs):``;return[zO(e[0]&&e[0].startedAt),n].filter(Boolean).join(` · `)},fileUrl(e){return Mk(e)},attSub(e){return e.exists===!1?`路径不可读`:e.isDir?`${e.entryCount??e.entries?.length??0} 项`:this.formatSize(e.size)},formatSize(e){let t=Number(e||0);return t?t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(1)} MB`:`0 B`},toolLabel:FO,msText(e){let t=Number(e)||0;return t?t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`:``},groupOpen(e){let t=this.openGroups[e.key];if(t!==void 0)return t;if(e.failed)return!0;let n=e.rows[e.rows.length-1];return!!(n&&n.result===void 0&&!n.error)},toggleGroup(e){this.openGroups={...this.openGroups,[e.key]:!this.groupOpen(e)}},onApproval(e){this.$emit(`approval`,e)},async copyError(){await sp(`${this.msg.errorCode?`[${this.msg.errorCode}] `:``}${String(this.msg.error||``)}`)&&(this.errorCopied=!0,setTimeout(()=>{this.errorCopied=!1},1600))},async copyText(){await sp(String(this.msg.content||``))&&(this.copied=!0,setTimeout(()=>{this.copied=!1},1600))}}},cA={key:0,class:`aimsg__files`},lA=[`title`],uA=[`src`,`alt`],dA={key:1,class:`aifile__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},fA=[`href`],pA={class:`aifile__meta`},mA={class:`aifile__name`},hA={class:`aifile__sub`},gA={key:1,class:`aimsg__bubble`},_A=[`aria-expanded`],vA={key:0,class:`aithink__spin`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},yA={key:1,class:`aithink__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},bA={class:`aithink__label`},xA={key:2,class:`aithink__peek`},SA={class:`aithink__body`},CA={key:1,class:`aiwait`},wA=[`aria-expanded`,`onClick`],TA={class:`aitool__status`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},EA=[`href`],DA={class:`aitool__name`},OA={class:`aitool__count`},kA={class:`aitool__args`},AA=[`title`],jA=[`title`],MA={class:`aitool__groupbody`},NA=[`aria-expanded`],PA={class:`aiev__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},FA=[`href`],IA={class:`aiev__label`},LA={class:`aiev__body`},RA={class:`aiev__time`},zA={key:0,class:`aiev__off`,title:`距本轮开始的累计耗时`},BA={class:`aiev__msg`},VA=[`aria-expanded`,`title`],HA={class:`ainarr__label`},UA={class:`ainarr__hint`},WA={class:`ainarr__body`},GA={key:6,class:`aisum`},KA={class:`aisum__head`},qA=[`title`],JA={class:`aisum__chips`},YA={key:0,class:`aisum__chip aisum__chip--ok`},XA={key:1,class:`aisum__chip aisum__chip--danger`},ZA={key:2,class:`aisum__chip`},QA={key:4,class:`aisum__chip aisum__chip--warn`},$A=[`title`],ej={key:1,class:`aisum__issues`},tj={class:`aisum__issue-list`},nj={class:`aisum__issue-text`},rj=[`title`,`onClick`],ij={key:0,class:`aisum__issues-more`},aj={key:7,class:`aimsg__error`},oj={class:`aimsg__error-main`},sj={class:`aimsg__error-text`},cj={key:0,class:`aimsg__error-hint`},lj={key:1,class:`aimsg__error-time`},uj={key:2,class:`aimsg__error-acts`},dj={key:8,class:`aimsg__aborted`},fj={key:0,class:`aimsg__aborted-time`},pj=[`title`],mj={class:`aimsg__budget-text`},hj={key:10,class:`aimsg__acts`},gj=[`title`],_j={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},vj=[`href`];function yj(e,t,n,r,i,a){let o=I(`ChatToolRow`),s=I(`MarkdownBody`);return z(),B(`article`,{class:A([`aimsg`,[`aimsg--${n.msg.role}`,{"aimsg--live":n.streaming}]])},[G(` ===== 用户消息:附件芯片 + 文本气泡 ===== `),n.msg.role===`user`?(z(),B(R,{key:0},[a.attachments.length?(z(),B(`div`,cA,[(z(!0),B(R,null,L(a.attachments,e=>(z(),B(`div`,{key:e.path,class:A([`aifile`,{"aifile--dir":e.isDir,"aifile--missing":e.exists===!1}]),title:e.path},[e.isImage?(z(),B(`img`,{key:0,class:`aifile__thumb`,src:a.fileUrl(e.path),alt:e.name,loading:`lazy`},null,8,uA)):(z(),B(`svg`,dA,[H(`use`,{href:e.isDir?`#icon-folder-plus`:`#icon-file-text`},null,8,fA)])),H(`span`,pA,[H(`span`,mA,j(e.name),1),H(`span`,hA,j(a.attSub(e)),1)])],10,lA))),128))])):G(`v-if`,!0),n.msg.content?(z(),B(`div`,gA,j(n.msg.content),1)):G(`v-if`,!0)],64)):(z(),B(R,{key:1},[G(` ===== 助手消息:思考 → 工具 → 正文(与 Codex 同序) ===== `),G(` 思考过程:默认折叠成一行,进行中给「计时 + 最新一行」预览,结束收成「已思考 N 秒」 `),n.msg.reasoning?(z(),B(`div`,{key:0,class:A([`aithink`,{"is-open":i.thinkOpen,"is-live":a.thinking}])},[H(`button`,{type:`button`,class:`aithink__head`,"aria-expanded":i.thinkOpen?`true`:`false`,onClick:t[0]||=e=>i.thinkOpen=!i.thinkOpen},[t[17]||=H(`svg`,{class:`aithink__chev`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-chevron-right`})],-1),a.thinking?(z(),B(`svg`,vA,[...t[15]||=[H(`use`,{href:`#icon-loading`},null,-1)]])):(z(),B(`svg`,yA,[...t[16]||=[H(`use`,{href:`#icon-sparkles`},null,-1)]])),H(`span`,bA,j(a.thinkLabel),1),a.thinking&&!i.thinkOpen?(z(),B(`span`,xA,j(a.peek),1)):G(`v-if`,!0)],8,_A),F(H(`div`,SA,[H(`pre`,{ref:`thinkPre`},j(n.msg.reasoning),513)],512),[[Cc,i.thinkOpen]])],2)):G(`v-if`,!0),G(` 首个 token 之前的等待态 `),a.waiting?(z(),B(`div`,CA,[...t[18]||=[H(`span`,{class:`aiwait__dot`},null,-1),H(`span`,{class:`aiwait__dot`},null,-1),H(`span`,{class:`aiwait__dot`},null,-1),H(`span`,{class:`aiwait__text`},`正在思考`,-1)]])):G(`v-if`,!0),G(` 工具调用:平铺单次调用;连续同名 ≥3 次折叠成分组行(长任务里几十次 card_read 不该刷屏)。
|
|
277
|
+
行标记抽到 ChatToolRow:分组内成员与平铺行走同一份模板,两处不会漂移 `),(z(!0),B(R,null,L(a.toolGroups,r=>(z(),B(R,{key:r.key},[r.kind===`row`?(z(),V(o,{key:0,tc:r.tc,"turn-ts":a.msgTs,"now-ts":n.nowTs,"pick-owner":n.pickOwner,onApproval:a.onApproval,onPickBoard:t[1]||=t=>e.$emit(`pick-board`,t)},null,8,[`tc`,`turn-ts`,`now-ts`,`pick-owner`,`onApproval`])):(z(),B(`div`,{key:1,class:A([`aitool aitool--group`,[r.failed?`aitool--error`:`aitool--done`,{"is-open":a.groupOpen(r)}]])},[H(`button`,{type:`button`,class:`aitool__head`,"aria-expanded":a.groupOpen(r)?`true`:`false`,onClick:e=>a.toggleGroup(r)},[t[19]||=H(`svg`,{class:`aitool__chev`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-chevron-right`})],-1),(z(),B(`svg`,TA,[H(`use`,{href:r.failed?`#icon-alert-triangle`:`#icon-check`},null,8,EA)])),H(`span`,DA,j(a.toolLabel(r.toolName)),1),H(`span`,OA,`×`+j(r.rows.length),1),H(`code`,kA,j(r.failed?`${r.failed} 次失败,点开看原因`:`连续 ${r.rows.length} 次,点开逐条查看`),1),G(` 分组行同样给「首次调用时刻 · 累计到最后一次」:折叠不等于把时间线也折掉 `),r.clock?(z(),B(`span`,{key:0,class:`aitool__clock`,title:`首次调用 ${r.clock.split(` · `)[0]} · 距本轮开始的累计耗时(算到最后一次)`},j(r.clock),9,AA)):G(`v-if`,!0),r.ms?(z(),B(`span`,{key:1,class:`aitool__ms`,title:`${r.rows.length} 次调用合计耗时`},j(a.msText(r.ms)),9,jA)):G(`v-if`,!0)],8,wA),F(H(`div`,MA,[(z(!0),B(R,null,L(r.rows,r=>(z(),V(o,{key:r.toolCallId,tc:r,"turn-ts":a.msgTs,"now-ts":n.nowTs,"pick-owner":n.pickOwner,onApproval:a.onApproval,onPickBoard:t[2]||=t=>e.$emit(`pick-board`,t)},null,8,[`tc`,`turn-ts`,`now-ts`,`pick-owner`,`onApproval`]))),128))],512),[[Cc,a.groupOpen(r)]])],2))],64))),128)),G(` 紧凑视图折叠掉的读取类调用:留一行出口,一键回到全量视图(不必去面板头部找开关) `),a.hiddenSteps?(z(),B(`button`,{key:2,type:`button`,class:`aitool__hidden`,onClick:t[3]||=t=>e.$emit(`show-all-steps`)},[t[20]||=H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-eye`})],-1),H(`span`,null,`紧凑视图已折叠 `+j(a.hiddenSteps)+` 次读取类调用,点这里显示全部步骤`,1)])):G(`v-if`,!0),G(` 过程事件时间线:后端 notice / round-retry 的持久落点。横幅只留最近一条且 6 秒即逝,
|
|
278
|
+
「上下文折叠过几次 / 自动续跑过几次 / 网关重试过没有」这些线索全靠这里留存 `),a.events.length?(z(),B(`div`,{key:3,class:A([`aiev`,{"is-open":a.eventsExpanded}])},[H(`button`,{type:`button`,class:`aiev__head`,"aria-expanded":a.eventsExpanded?`true`:`false`,onClick:t[4]||=e=>i.eventsOpen=!a.eventsExpanded},[t[21]||=H(`svg`,{class:`aiev__chev`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-chevron-right`})],-1),(z(),B(`svg`,PA,[H(`use`,{href:a.hasErrorEvent?`#icon-alert-triangle`:`#icon-activity`},null,8,FA)])),H(`span`,IA,j(a.eventsLabel),1)],8,NA),F(H(`ol`,LA,[(z(!0),B(R,null,L(a.events,(e,t)=>(z(),B(`li`,{key:t,class:A([`aiev__row`,`aiev__row--${e.level}`])},[H(`span`,RA,j(a.fmtStamp(e.ts)),1),a.evOff(e)?(z(),B(`span`,zA,j(a.evOff(e)),1)):G(`v-if`,!0),H(`span`,BA,j(e.message),1)],2))),128))],512),[[Cc,a.eventsExpanded]])],2)):G(`v-if`,!0),G(` 过程性正文:模型把推理过程当正文写出来时(实测单回合 46.7 万字),
|
|
279
|
+
把「最后一次工具调用之前」那段折成一行——收尾结论照常展开,记录不再是一堵墙 `),a.narrationText?(z(),B(`div`,{key:4,class:A([`ainarr`,{"is-open":i.narrOpen}])},[H(`button`,{type:`button`,class:`ainarr__head`,"aria-expanded":i.narrOpen?`true`:`false`,title:i.narrOpen?`收起过程说明`:`展开过程说明(模型在本轮工具调用前的推理正文)`,onClick:t[5]||=e=>i.narrOpen=!i.narrOpen},[t[22]||=H(`svg`,{class:`ainarr__chev`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-chevron-right`})],-1),t[23]||=H(`svg`,{class:`ainarr__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-activity`})],-1),H(`span`,HA,`过程说明 `+j(a.narrationSize)+` 字`,1),H(`span`,UA,j(i.narrOpen?`收起`:`展开`),1)],8,VA),F(H(`div`,WA,[U(s,{source:a.narrationText},null,8,[`source`])],512),[[Cc,i.narrOpen]])],2)):G(`v-if`,!0),G(` 正文:Markdown(流式重渲染 + 代码块高亮 / 复制) `),a.bodyText?(z(),V(s,{key:5,class:A([`aimsg__md`,{"is-streaming":a.streamingText}]),source:a.bodyText,streaming:a.streamingText},null,8,[`class`,`source`,`streaming`])):G(`v-if`,!0),G(` 本次改动摘要:写入次数 / 校验错误 / 门禁结论都从工具行就地算——落盘记录里同样算得出来,
|
|
280
|
+
所以重开面板、刷新之后这条摘要依然在,而不是只在当轮可见 `),a.showSummary?(z(),B(`div`,GA,[H(`span`,KA,[t[25]||=H(`svg`,{class:`aisum__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-activity`})],-1),t[26]||=H(`span`,{class:`aisum__title`},`本次改动`,-1),G(` 本轮的时间坐标:几点开始、一共跑了多久。摘要条是回合的收尾锚点,这两个数在这里最有用 `),a.turnClock.stamp?(z(),B(`span`,{key:0,class:`aisum__clock`,title:`本轮 ${a.turnClock.stamp} 开始${a.turnClock.endStamp?`,${a.turnClock.endStamp} 收尾`:``}`},[W(j(a.turnClock.stamp)+` 开始`,1),a.turnClock.total?(z(),B(R,{key:0},[W(` · 累计 `+j(a.turnClock.total),1)],64)):G(`v-if`,!0)],8,qA)):G(`v-if`,!0),H(`span`,JA,[a.summary.writes?(z(),B(`span`,YA,`写入 `+j(a.summary.writes)+` 次`,1)):G(`v-if`,!0),a.summary.writeFails?(z(),B(`span`,XA,`写入失败 `+j(a.summary.writeFails)+` 次`,1)):G(`v-if`,!0),a.summary.shots?(z(),B(`span`,ZA,`截图自检 `+j(a.summary.shots)+` 次`,1)):G(`v-if`,!0),a.summary.validate?(z(),B(`span`,{key:3,class:A([`aisum__chip`,a.summary.validate.ok?`aisum__chip--ok`:`aisum__chip--danger`])},`校验 `+j(a.summary.validate.errors)+` 错 / `+j(a.summary.validate.warnings)+` 警`,3)):G(`v-if`,!0),a.summary.failed?(z(),B(`span`,QA,j(a.summary.failed)+` 次调用报错`,1)):G(`v-if`,!0),a.cacheBadge?(z(),B(`span`,{key:5,class:A([`aisum__chip`,a.cacheBadge.ok?`aisum__chip--ok`:``]),title:a.cacheBadge.title},j(a.cacheBadge.label),11,$A)):G(`v-if`,!0)]),n.canRollback&&a.summary.writes?(z(),B(`button`,{key:1,type:`button`,class:`aisum__rollback`,title:`取本轮第一次写入前的历史快照,回到 AI 动手之前的版本;回滚本身可再撤销,确认后仍需点「保存到本地」才落盘`,onClick:t[6]||=t=>e.$emit(`rollback`,n.msg)},[...t[24]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-undo`})],-1),H(`span`,null,`回滚到本轮之前`,-1)]])):G(`v-if`,!0)]),G(` 门禁结论原样透出:这是唯一的机器判定,不能被模型自述的「已通过」覆盖 `),a.summary.gate?(z(),B(`p`,{key:0,class:A([`aisum__verdict`,a.summary.gate.passed?`is-pass`:`is-fail`])},[H(`strong`,null,`收尾门禁`+j(a.summary.gate.passed?`通过`:`未通过`),1),a.summary.gate.verdict?(z(),B(R,{key:0},[W(`:`+j(a.summary.gate.verdict),1)],64)):G(`v-if`,!0)],2)):G(`v-if`,!0),G(` 校验问题可点定位(P2-14):校验器在每条消息末尾挂了 #componentId,点「定位」就在画布与
|
|
281
|
+
组件结构里选中那个节点——不用再照着一句 "at depth 1[0]" 自己去树里翻 `),a.validateIssues.length?(z(),B(`div`,ej,[t[27]||=H(`p`,{class:`aisum__issues-head`},[W(`校验问题`),H(`span`,{class:`aisum__issues-hint`},`点「定位」跳到该节点`)],-1),H(`ul`,tj,[(z(!0),B(R,null,L(a.validateIssues,(t,n)=>(z(),B(`li`,{key:n,class:A([`aisum__issue`,t.level===`error`?`is-error`:`is-warn`])},[H(`span`,nj,j(t.text),1),t.cid?(z(),B(`button`,{key:0,type:`button`,class:`aisum__issue-go`,title:`在画布与组件结构中定位 `+t.cid,onClick:n=>e.$emit(`locate-node`,t.cid)},`定位`,8,rj)):G(`v-if`,!0)],2))),128))]),a.validateMore?(z(),B(`p`,ij,`另有 `+j(a.validateMore)+` 条:展开对应工具行看全部原文`,1)):G(`v-if`,!0)])):G(`v-if`,!0)])):G(`v-if`,!0),n.msg.error?(z(),B(`div`,aj,[t[28]||=H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-alert-triangle`})],-1),H(`span`,oj,[H(`span`,sj,j(n.msg.error),1),G(` 错误分级:后端给 code,这里给「怎么办」与对应的定向动作,不再只丢一句原文让人自己猜 `),a.errorHint?(z(),B(`span`,cj,j(a.errorHint),1)):G(`v-if`,!0),G(` 失败也要有时刻与累计:报网关工单 / 对后端日志时,「几点失败、跑了多久」是第一句要交代的话 `),a.turnClock.endStamp?(z(),B(`span`,lj,j(a.turnClock.endStamp)+` 失败 · 本轮已用 `+j(a.turnClock.total),1)):G(`v-if`,!0),n.streaming?G(`v-if`,!0):(z(),B(`span`,uj,[a.errorAction===`settings`?(z(),B(`button`,{key:0,type:`button`,class:`aimsg__budget-go`,onClick:t[7]||=t=>e.$emit(`open-settings`)},`打开设置`)):G(`v-if`,!0),n.canRegenerate?(z(),B(`button`,{key:1,type:`button`,class:`aimsg__budget-go`,onClick:t[8]||=t=>e.$emit(`regenerate`,n.msg)},`重试本轮`)):G(`v-if`,!0),n.canRegenerate?(z(),B(`button`,{key:2,type:`button`,class:`aimsg__budget-go aimsg__budget-go--ghost`,onClick:t[9]||=t=>e.$emit(`continue`)},`从中断处继续`)):G(`v-if`,!0),H(`button`,{type:`button`,class:`aimsg__budget-go aimsg__budget-go--ghost`,onClick:t[10]||=(...e)=>a.copyError&&a.copyError(...e)},j(i.errorCopied?`已复制`:`复制错误`),1)]))])])):G(`v-if`,!0),G(` 手动终止同样给续跑入口:已落盘产物与上下文都还在,点一下就能接着做。
|
|
282
|
+
此前只有熔断收尾(budget)分支有按钮,手滑终止后用户只能自己打字 `),n.msg.status===`aborted`?(z(),B(`div`,dj,[t[29]||=H(`span`,{class:`aimsg__aborted-text`},`已终止生成`,-1),a.turnClock.endStamp?(z(),B(`span`,fj,j(a.turnClock.endStamp)+` 终止 · 已用 `+j(a.turnClock.total),1)):G(`v-if`,!0),n.canRegenerate&&!n.streaming?(z(),B(`button`,{key:1,type:`button`,class:`aimsg__budget-go`,onClick:t[11]||=t=>e.$emit(`continue`)},`从中断处继续`)):G(`v-if`,!0)])):n.msg.budget?.message?(z(),B(`div`,{key:9,class:`aimsg__budget`,title:a.budgetHint},[t[30]||=H(`svg`,{class:`aimsg__budget-icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-alert-triangle`})],-1),H(`span`,mj,[H(`strong`,null,j(a.budgetLabel),1),W(`:`+j(n.msg.budget.message)+`(上下文已保留)`,1)]),n.canRegenerate&&!n.streaming?(z(),B(`button`,{key:0,type:`button`,class:`aimsg__budget-go`,onClick:t[12]||=t=>e.$emit(`continue`)},`继续这轮`)):G(`v-if`,!0)],8,pj)):G(`v-if`,!0),G(` 悬停操作:复制 / 重新生成(仅最后一条助手消息可重发) `),n.msg.content||n.msg.error?(z(),B(`footer`,hj,[H(`button`,{type:`button`,class:`aimsg__act`,title:i.copied?`已复制`:`复制回答`,onClick:t[13]||=(...e)=>a.copyText&&a.copyText(...e)},[(z(),B(`svg`,_j,[H(`use`,{href:i.copied?`#icon-check`:`#icon-copy-sm`},null,8,vj)])),H(`span`,null,j(i.copied?`已复制`:`复制`),1)],8,gj),n.canRegenerate&&!n.streaming?(z(),B(`button`,{key:0,type:`button`,class:`aimsg__act`,title:`丢弃这次回答并重新生成`,onClick:t[14]||=t=>e.$emit(`regenerate`,n.msg)},[...t[31]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-reset`})],-1),H(`span`,null,`重新生成`,-1)]])):G(`v-if`,!0)])):G(`v-if`,!0)],64))],2)}var bj=Y(sA,[[`render`,yj],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ChatMessage.vue`]]),xj=106,Sj=.5,Cj=`cardbuddy:ai-composer-height`,wj={name:`ChatComposer`,props:{busy:{type:Boolean,default:!1},model:{type:String,default:``},attachments:{type:Array,default:()=>[]},placeholder:{type:String,default:`描述你要改的卡片,Enter 发送 / Shift+Enter 换行`},context:{type:Object,default:null}},emits:[`send`,`stop`,`pick`,`add-path`,`remove-attachment`,`drop-files`,`paste-image`,`escape`],data(){return{text:``,attachOpen:!1,pathInputOpen:!1,pathText:``,dragOver:!1,heightPx:0,resizing:!1,compArmed:!1,_compTimer:null,_outside:null,_onWinResize:null}},computed:{canSend(){return!!(this.text.trim()||this.attachments.some(e=>!e.pending&&e.exists!==!1))},compStyle(){return this.heightPx>0?{height:`${this.heightPx}px`}:null},ctx(){let e=this.context;if(!e)return null;let t=Number(e.window)>0?Number(e.window):Number(e.total)>0?Number(e.total):0,n=Math.max(0,Number(e.used)||0);if(!(t>0))return null;let r=Math.min(1,n/t),i=2*Math.PI*8;return{pct:r,arc:(i*r).toFixed(2),circ:i.toFixed(2),pctLabel:`${Math.round(r*100)}%`,level:r>=.85?`danger`:r>=.6?`warn`:`ok`,used:n,total:t}},ctxTitle(){let e=this.ctx;if(!e)return``;let t=e=>e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e)),n=Number(this.context?.window)>0?` · 网关窗口 ${t(Number(this.context.window))}`:``;return`上下文占用 ${t(e.used)} / ${t(e.total)} token(${e.pctLabel})${n};接近上限时后端会自动折叠早期工具结果`}},mounted(){this._outside=e=>{let t=this.$refs.attachEl;t&&!t.contains(e.target)&&(this.attachOpen=!1)},document.addEventListener(`mousedown`,this._outside),this.loadHeight(),this._onWinResize=()=>this.clampHeight(),window.addEventListener(`resize`,this._onWinResize),this.autoGrow()},beforeUnmount(){this._outside&&document.removeEventListener(`mousedown`,this._outside),this._onWinResize&&window.removeEventListener(`resize`,this._onWinResize)},methods:{focus(){this.$nextTick(()=>this.$refs.taEl?.focus())},setText(e){this.text=e,this.focus(),this.autoGrow()},fileUrl(e){return Mk(e)},chipSub(e){if(e.exists===!1)return`不可读`;if(e.isDir)return`${e.entryCount??e.entries?.length??0} 项`;let t=Number(e.size||0);return t?t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(0)} KB`:`${(t/1024/1024).toFixed(1)} MB`:``},autoGrow(){let e=this.$refs.taEl;if(e){if(this.heightPx>0){e.style.height=``;return}e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,168)}px`}},heightLimits(){let e=this.$el?.closest(`.aichat`)?.clientHeight||window.innerHeight;return{min:xj,max:Math.max(xj,Math.floor(e*Sj))}},clampHeight(){if(!this.heightPx)return;let{min:e,max:t}=this.heightLimits();this.heightPx=Math.max(e,Math.min(t,this.heightPx))},loadHeight(){try{let e=localStorage.getItem(Cj),t=e==null?0:parseInt(e,10);!Number.isNaN(t)&&t>=xj&&(this.heightPx=t)}catch{}this.clampHeight()},saveHeight(){try{this.heightPx?localStorage.setItem(Cj,String(Math.round(this.heightPx))):localStorage.removeItem(Cj)}catch{}},armComp(){clearTimeout(this._compTimer),this._compTimer=setTimeout(()=>{this.compArmed=!0},300)},disarmComp(){clearTimeout(this._compTimer),this._compTimer=null,!this.resizing&&(this.compArmed=!1)},startResize(e){let t=e&&e.currentTarget;if(!t||!this.compArmed)return;this.resizing=!0,document.body.style.cursor=`row-resize`,document.body.style.userSelect=`none`;let n=e.pointerId;try{t.setPointerCapture(n)}catch{}let r=this.$el.getBoundingClientRect().bottom,i=e=>{let{min:t,max:n}=this.heightLimits();this.heightPx=Math.max(t,Math.min(n,Math.round(r-e.clientY)))},a=()=>{t.removeEventListener(`pointermove`,i),t.removeEventListener(`pointerup`,a),t.removeEventListener(`pointercancel`,a),window.removeEventListener(`blur`,a);try{t.hasPointerCapture?.(n)&&t.releasePointerCapture(n)}catch{}this.resizing=!1,document.body.style.cursor=``,document.body.style.userSelect=``,this.saveHeight()};t.addEventListener(`pointermove`,i),t.addEventListener(`pointerup`,a),t.addEventListener(`pointercancel`,a),window.addEventListener(`blur`,a)},resetHeight(){this.heightPx=0,this.saveHeight(),this.$nextTick(this.autoGrow)},onKeydown(e){if(e.key===`Escape`){e.preventDefault(),this.$emit(`escape`);return}e.key===`Enter`&&(e.isComposing||e.keyCode===229||e.shiftKey||(e.preventDefault(),this.busy||this.submit()))},submit(){if(this.busy||!this.canSend)return;let e={text:this.text.trim(),attachments:this.attachments.filter(e=>!e.pending&&e.exists!==!1)};this.text=``,this.attachOpen=!1,this.$nextTick(this.autoGrow),this.$emit(`send`,e)},toggleAttach(){this.attachOpen=!this.attachOpen},pick(e){this.attachOpen=!1,this.$emit(`pick`,e)},openPathInput(){this.attachOpen=!1,this.pathInputOpen=!0,this.pathText=``,this.$nextTick(()=>this.$refs.pathEl?.focus())},closePathInput(){this.pathInputOpen=!1,this.pathText=``},confirmPath(){let e=this.pathText.trim();e&&(this.$emit(`add-path`,e),this.closePathInput())},onDragEnter(){this.dragOver=!0},onDragOver(){this.dragOver=!0},onDragLeave(){this.dragOver=!1},onDrop(e){this.dragOver=!1;let t=e.dataTransfer;t&&this.$emit(`drop-files`,t)},async onPaste(e){let t=e.clipboardData?.items;if(t){for(let n of t)if(n.type&&n.type.indexOf(`image/`)===0){let t=n.getAsFile();if(!t)continue;e.preventDefault();let r=await new Promise(e=>{let n=new FileReader;n.onload=()=>e(String(n.result||``)),n.onerror=()=>e(``),n.readAsDataURL(t)});r&&this.$emit(`paste-image`,r);return}}}}},Tj={key:0,class:`aicomp__files`},Ej=[`title`],Dj=[`src`,`alt`],Oj={key:1,class:`aichip__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},kj=[`href`],Aj={class:`aichip__name`},jj={key:2,class:`aichip__sub`},Mj=[`onClick`],Nj={key:1,class:`aicomp__path`},Pj=[`disabled`],Fj=[`placeholder`],Ij={class:`aicomp__bar`},Lj={class:`aicomp__tools`},Rj={class:`aicomp__attach`,ref:`attachEl`},zj={key:0,class:`aicomp__menu`,role:`menu`},Bj={class:`aicomp__right`},Vj=[`title`],Hj={class:`aicomp__ctx-ring`,viewBox:`0 0 20 20`,"aria-hidden":`true`},Uj=[`stroke-dasharray`],Wj={class:`aicomp__ctx-pct`},Gj=[`title`],Kj=[`disabled`,`title`];function qj(e,t,n,r,i,a){return z(),B(`div`,{class:A([`aicomp`,{"is-busy":n.busy,"is-drag":i.dragOver,"is-manual":i.heightPx>0,"is-resizing":i.resizing}]),style:k(a.compStyle)},[G(` 上缘拖拽把手:调输入区高度(106px ~ 面板高度 50%,双击恢复自适应),与面板宽度把手同一套交互 `),H(`div`,{class:A([`aicomp__grip`,{"is-dragging":i.resizing,"is-armed":i.compArmed}]),title:`拖拽调整输入区高度(双击恢复自适应)`,onMouseenter:t[0]||=(...e)=>a.armComp&&a.armComp(...e),onMouseleave:t[1]||=(...e)=>a.disarmComp&&a.disarmComp(...e),onPointerdown:t[2]||=K((...e)=>a.startResize&&a.startResize(...e),[`prevent`]),onDblclick:t[3]||=K((...e)=>a.resetHeight&&a.resetHeight(...e),[`prevent`])},null,34),G(` 已挂载的本地文件:只预览 + 传路径,不上传 `),n.attachments.length?(z(),B(`div`,Tj,[(z(!0),B(R,null,L(n.attachments,n=>(z(),B(`div`,{key:n.id||n.path,class:A([`aichip`,{"aichip--dir":n.isDir,"aichip--pending":n.pending,"aichip--missing":n.exists===!1}]),title:n.path},[n.isImage&&!n.pending?(z(),B(`img`,{key:0,class:`aichip__thumb`,src:a.fileUrl(n.path),alt:n.name,loading:`lazy`},null,8,Dj)):(z(),B(`svg`,Oj,[H(`use`,{href:n.pending?`#icon-loading`:n.isDir?`#icon-folder-plus`:n.isImage?`#icon-image`:`#icon-file-text`},null,8,kj)])),H(`span`,Aj,j(n.pending?`解析路径中…`:n.name),1),n.pending?G(`v-if`,!0):(z(),B(`span`,jj,j(a.chipSub(n)),1)),H(`button`,{type:`button`,class:`aichip__rm`,title:`移除`,onClick:t=>e.$emit(`remove-attachment`,n.id||n.path)},[...t[24]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-x`})],-1)]],8,Mj)],10,Ej))),128))])):G(`v-if`,!0),G(` 粘贴绝对路径(非 macOS / 拖拽反查失败时的兜底入口) `),i.pathInputOpen?(z(),B(`div`,Nj,[F(H(`input`,{ref:`pathEl`,"onUpdate:modelValue":t[4]||=e=>i.pathText=e,class:`aicomp__path-input`,type:`text`,placeholder:`粘贴本地图片或文件夹的绝对路径,回车确认`,spellcheck:`false`,onKeydown:[t[5]||=yl(K((...e)=>a.confirmPath&&a.confirmPath(...e),[`prevent`]),[`enter`]),t[6]||=yl(K((...e)=>a.closePathInput&&a.closePathInput(...e),[`stop`,`prevent`]),[`esc`])]},null,544),[[al,i.pathText]]),H(`button`,{type:`button`,class:`aicomp__path-ok`,disabled:!i.pathText.trim(),onClick:t[7]||=(...e)=>a.confirmPath&&a.confirmPath(...e)},`添加`,8,Pj),H(`button`,{type:`button`,class:`aicomp__path-no`,onClick:t[8]||=(...e)=>a.closePathInput&&a.closePathInput(...e)},`取消`)])):G(`v-if`,!0),H(`div`,{class:`aicomp__box`,onDragenter:t[20]||=K((...e)=>a.onDragEnter&&a.onDragEnter(...e),[`prevent`]),onDragover:t[21]||=K((...e)=>a.onDragOver&&a.onDragOver(...e),[`prevent`]),onDragleave:t[22]||=K((...e)=>a.onDragLeave&&a.onDragLeave(...e),[`prevent`]),onDrop:t[23]||=K((...e)=>a.onDrop&&a.onDrop(...e),[`prevent`])},[F(H(`textarea`,{ref:`taEl`,"onUpdate:modelValue":t[9]||=e=>i.text=e,class:`aicomp__ta`,placeholder:n.placeholder,rows:`1`,onInput:t[10]||=(...e)=>a.autoGrow&&a.autoGrow(...e),onKeydown:t[11]||=(...e)=>a.onKeydown&&a.onKeydown(...e),onPaste:t[12]||=(...e)=>a.onPaste&&a.onPaste(...e)},null,40,Fj),[[al,i.text]]),H(`div`,Ij,[H(`div`,Lj,[H(`div`,Rj,[H(`button`,{type:`button`,class:A([`aicomp__iconbtn`,{"is-open":i.attachOpen}]),title:`挂载本地图片 / 文件 / 文件夹`,onClick:t[13]||=(...e)=>a.toggleAttach&&a.toggleAttach(...e)},[...t[25]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-paperclip`})],-1)]],2),i.attachOpen?(z(),B(`div`,zj,[H(`button`,{type:`button`,role:`menuitem`,onClick:t[14]||=e=>a.pick(`image`)},[...t[26]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-image`})],-1),W(` 本地图片… `,-1)]]),H(`button`,{type:`button`,role:`menuitem`,onClick:t[15]||=e=>a.pick(`file`)},[...t[27]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-file-text`})],-1),W(` 本地文件… `,-1)]]),H(`button`,{type:`button`,role:`menuitem`,onClick:t[16]||=e=>a.pick(`folder`)},[...t[28]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-folder-plus`})],-1),W(` 本地文件夹… `,-1)]]),t[30]||=H(`div`,{class:`aicomp__menu-sep`},null,-1),H(`button`,{type:`button`,role:`menuitem`,onClick:t[17]||=(...e)=>a.openPathInput&&a.openPathInput(...e)},[...t[29]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-link`})],-1),W(` 粘贴路径… `,-1)]])])):G(`v-if`,!0)],512),t[31]||=H(`span`,{class:`aicomp__hint`},`拖拽文件 / 文件夹到此,或直接 ⌘V 粘贴截图`,-1)]),H(`div`,Bj,[a.ctx?(z(),B(`span`,{key:0,class:A([`aicomp__ctx`,`is-${a.ctx.level}`]),title:a.ctxTitle},[(z(),B(`svg`,Hj,[t[32]||=H(`circle`,{class:`aicomp__ctx-track`,cx:`10`,cy:`10`,r:`8`},null,-1),H(`circle`,{class:`aicomp__ctx-arc`,cx:`10`,cy:`10`,r:`8`,"stroke-dasharray":`${a.ctx.arc} ${a.ctx.circ}`,transform:`rotate(-90 10 10)`},null,8,Uj)])),H(`span`,Wj,j(a.ctx.pctLabel),1)],10,Vj)):G(`v-if`,!0),n.model?(z(),B(`span`,{key:1,class:`aicomp__model`,title:`当前模型:${n.model}`},j(n.model),9,Gj)):G(`v-if`,!0),n.busy?(z(),B(`button`,{key:2,type:`button`,class:`aicomp__send aicomp__send--stop`,title:`终止生成(Esc)`,onClick:t[18]||=t=>e.$emit(`stop`)},[...t[33]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"aria-hidden":`true`},[H(`use`,{href:`#icon-stop`})],-1)]])):(z(),B(`button`,{key:3,type:`button`,class:`aicomp__send`,disabled:!a.canSend,title:a.canSend?`发送(Enter)`:`输入内容后发送`,onClick:t[19]||=(...e)=>a.submit&&a.submit(...e)},[...t[34]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-send`})],-1)]],8,Kj))])])],32)],6)}var Jj=Y(wj,[[`render`,qj],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ChatComposer.vue`]]),Yj={name:`AiSettings`,components:{NumberStepper:o_,Switch:Dw},props:{config:{type:Object,default:()=>({baseUrl:``,model:``,hasKey:!1,apiKeyMasked:``})},modelId:{type:String,default:null},initialModel:{type:Object,default:null}},emits:[`close`,`saved`],data(){let e=this.modelId&&this.initialModel||{};return{form:{name:e.name||``,baseUrl:e.baseUrl||``,model:e.model||``,apiKey:``,thinking:e.thinking!==!1,vision:e.vision===!0,maxTokens:e.maxTokensAuto?0:Number(e.maxTokens)>0?Number(e.maxTokens):0},reveal:!1,saving:!1,testing:!1,probing:!1,ping:null,help:null,keyLoaded:!1,submitted:!1,touched:{}}},computed:{title(){return this.modelId?`编辑模型`:`添加模型`},errors(){let e={},t=this.form.baseUrl.trim(),n=this.form.model.trim();return t?/^https?:\/\/[^\s]+$/i.test(t)||(e.baseUrl=`Base URL 需以 http:// 或 https:// 开头`):e.baseUrl=`请填写 Base URL`,n||(e.model=`请填写模型名`),!this.keyLoaded&&!this.form.apiKey.trim()&&(e.apiKey=`请填写 API Key`),e},isValid(){return Object.keys(this.errors).length===0},knownCapLimit(){return(Number(this.config.maxTokensCap)>0?Number(this.config.maxTokensCap):0)||(Number(this.config.maxTokensWindow)>0?Number(this.config.maxTokensWindow):0)},maxTokensOver(){return this.knownCapLimit>0&&this.form.maxTokens>this.knownCapLimit},maxTokensPlaceholder(){let e=Number(this.config.maxTokens)>0?Number(this.config.maxTokens):0;return e>0?`留空 = 自动(当前按 ${e})`:`留空 = 自动`},keyPlaceholder(){return this.keyLoaded?this.form.apiKey?``:`已保存的密钥为空,请填写新密钥`:this.config.hasKey?`已保存(${this.config.apiKeyMasked||`••••`}),回显失败:留空沿用、填写覆盖`:`sk-…`}},created(){this.loadKey()},mounted(){document.addEventListener(`click`,this.onDocClick,!0),document.addEventListener(`keydown`,this.onKeydown)},beforeUnmount(){document.removeEventListener(`click`,this.onDocClick,!0),document.removeEventListener(`keydown`,this.onKeydown)},methods:{toggleHelp(e){this.help=this.help===e?null:e},showError(e){return!!this.errors[e]&&(this.submitted||this.touched[e])},markTouched(e){this.$set(this.touched,e,!0)},onDocClick(e){if(!this.help)return;let t=e.target;t instanceof Element&&t.closest(`.aiset__pop, .aiset__help`)||(this.help=null)},onKeydown(e){e.key===`Escape`&&this.help&&(e.stopPropagation(),this.help=null)},onMaxTokens(e){let t=Number(String(e).trim());this.form.maxTokens=Number.isFinite(t)&&t>=0?Math.round(t):0},async probe(){let e=[];if(this.form.baseUrl.trim()||e.push(`Base URL`),this.form.apiKey.trim()||e.push(`API Key`),this.form.model.trim()||e.push(`模型名`),e.length){this.ping={ok:!1,text:`探测前请先填写:${e.join(` / `)}`};return}this.probing=!0,this.ping=null;try{let e=await Uk({baseUrl:this.form.baseUrl,apiKey:this.form.apiKey,model:this.form.model}),t=Number(e.window)>0?Number(e.window):0,n=Number(e.cap)>0?Number(e.cap):0;if(n>0){this.form.maxTokens=n;let r=e.source===`models-meta`?`模型元数据`:e.source===`probe`?`二分试探`:e.source===`halved`?`减半回写`:e.source||`探测`,i=[`接受单次输出上限 ${n}`];t>0&&i.push(`上下文窗口 ${t}`),this.ping={ok:!0,text:`网关${i.join(`、`)}(来源:${r})→ 已填入 ${n};留空则走自动(取 min(上限, ${Number(e.ceiling)>0?e.ceiling:32768}) = ${Number(e.autoMax)>0?e.autoMax:n})`}}else{let n=[];t>0&&n.push(`上下文窗口 ${t}`),e.source===`fallback`?n.push(`网关未接受任何档位(可能是地址 / 密钥 / 模型名有误,或该网关不暴露上限)`):n.push(`未探到网关接受的单次输出上限`),this.ping={ok:!1,text:`${n.join(`;`)}。建议留空走自动:后端按默认值开跑,被网关拒绝时自动减半并记下真实上限`}}}catch(e){this.ping={ok:!1,text:`探测失败:${e.message||e}`}}finally{this.probing=!1}},async loadKey(){if(this.modelId)try{let e=await Rk(this.modelId,!0),t=typeof e.apiKey==`string`?e.apiKey:``;t&&(this.form.apiKey=t,this.keyLoaded=!0),typeof e.name==`string`&&(this.form.name=e.name),typeof e.baseUrl==`string`&&(this.form.baseUrl=e.baseUrl),typeof e.model==`string`&&(this.form.model=e.model),this.form.maxTokens=e.maxTokensAuto||!(Number(e.maxTokens)>0)?0:Number(e.maxTokens),e.thinking!==void 0&&(this.form.thinking=e.thinking!==!1),e.vision!==void 0&&(this.form.vision=e.vision===!0)}catch{}},payload(){let e={name:this.form.name.trim(),baseUrl:this.form.baseUrl.trim(),model:this.form.model.trim(),thinking:!!this.form.thinking,vision:!!this.form.vision,maxTokens:Number(this.form.maxTokens)>0?Number(this.form.maxTokens):0};return(this.keyLoaded||this.form.apiKey.trim())&&(e.apiKey=this.form.apiKey.trim()),e},async test(){if(!this.isValid){this.submitted=!0,this.help=null,this.ping={ok:!1,text:`请先补全必填项(Base URL / 模型名 / API Key)再测试连接`};return}this.testing=!0,this.ping=null;try{let e=await Wk(this.payload());this.ping=e.ok?{ok:!0,text:`连接正常 · ${e.model||this.form.model} · ${e.latencyMs}ms`}:{ok:!1,text:`连接失败${e.status?`(HTTP ${e.status})`:``}:${e.message||`未知错误`}`}}catch(e){this.ping={ok:!1,text:`测试失败:${e.message||e}`}}finally{this.testing=!1}},async save(){if(this.submitted=!0,!this.isValid){this.help=null;let e={baseUrl:`aiset-baseurl`,model:`aiset-model`,apiKey:`aiset-key`},t=Object.keys(this.errors)[0],n=t?this.$el.querySelector(`#${e[t]}`):null;n&&typeof n.focus==`function`&&n.focus(),this.ping={ok:!1,text:`请先补全必填项(Base URL / 模型名 / API Key)`};return}this.saving=!0;try{let e=this.modelId?await Bk(this.modelId,this.payload()):await zk(this.payload());this.$emit(`saved`,e)}catch(e){this.ping={ok:!1,text:`保存失败:${e.message||e}`}}finally{this.saving=!1}}}},Xj={class:`aiset__mask`},Zj={class:`aiset`,role:`dialog`,"aria-modal":`true`,"aria-label":`AI 模型设置`},Qj={class:`aiset__head`},$j={class:`aiset__title`},eM={class:`aiset__body`},tM={class:`aiset__field`},nM={class:`aiset__field`},rM={class:`aiset__labelrow`},iM=[`aria-expanded`],aM=[`aria-invalid`],oM={key:0,class:`aiset__errline`},sM={key:1,class:`aiset__pop`},cM={class:`aiset__field`},lM={class:`aiset__labelrow`},uM=[`aria-expanded`],dM=[`aria-invalid`],fM={key:0,class:`aiset__errline`},pM={key:1,class:`aiset__pop`},mM={class:`aiset__field`},hM={class:`aiset__labelrow`},gM=[`aria-expanded`],_M={class:`aiset__keywrap`},vM=[`type`,`placeholder`,`aria-invalid`],yM=[`title`,`aria-pressed`],bM={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},xM=[`href`],SM={key:0,class:`aiset__errline`},CM={key:1,class:`aiset__pop`},wM={class:`aiset__field`},TM={class:`aiset__labelrow`},EM=[`aria-expanded`],DM={class:`aiset__stepperrow`},OM=[`disabled`],kM={key:0,class:`aiset__warnline`},AM={key:1,class:`aiset__pop`},jM={class:`aiset__field`},MM={class:`aiset__labelrow`},NM=[`aria-expanded`],PM={key:0,class:`aiset__pop`},FM={class:`aiset__field`},IM={class:`aiset__labelrow`},LM=[`aria-expanded`],RM={key:0,class:`aiset__pop`},zM={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},BM=[`href`],VM={class:`aiset__foot`},HM=[`disabled`],UM={class:`aiset__btn-icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},WM=[`href`],GM=[`disabled`],KM=[`disabled`];function qM(e,t,n,r,i,a){let o=I(`NumberStepper`),s=I(`Switch`);return z(),B(`div`,Xj,[H(`section`,Zj,[H(`header`,Qj,[t[22]||=H(`svg`,{class:`aiset__head-icon is-solid-icon`,viewBox:`0 0 1024 1024`,"aria-hidden":`true`},[H(`use`,{href:`#icon-model`})],-1),H(`span`,$j,j(a.title),1),H(`button`,{type:`button`,class:`aiset__x`,title:`关闭`,onClick:t[0]||=t=>e.$emit(`close`)},[...t[21]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-x`})],-1)]])]),G(` 字段说明一律收进「?」浮层:面板只留标签 + 控件,需要时点开看详情 `),H(`div`,eM,[H(`div`,tM,[t[23]||=H(`div`,{class:`aiset__labelrow`},[H(`label`,{class:`aiset__label`,for:`aiset-name`},`名称`)],-1),F(H(`input`,{id:`aiset-name`,"onUpdate:modelValue":t[1]||=e=>i.form.name=e,class:`aiset__input`,type:`text`,placeholder:`模型显示名(如 GPT-4o / 我的 GLM)`,spellcheck:`false`,autocomplete:`off`},null,512),[[al,i.form.name]])]),H(`div`,nM,[H(`div`,rM,[t[25]||=H(`label`,{class:`aiset__label`,for:`aiset-baseurl`},[W(`Base URL`),H(`i`,{class:`aiset__req`,"aria-hidden":`true`},`*`)],-1),H(`button`,{type:`button`,class:A([`aiset__help`,{"is-on":i.help===`baseUrl`}]),"aria-expanded":i.help===`baseUrl`,title:`查看说明`,onClick:t[2]||=K(e=>a.toggleHelp(`baseUrl`),[`stop`])},[...t[24]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-help`})],-1)]],10,iM)]),F(H(`input`,{id:`aiset-baseurl`,"onUpdate:modelValue":t[3]||=e=>i.form.baseUrl=e,class:A([`aiset__input`,{"is-invalid":a.showError(`baseUrl`)}]),type:`text`,placeholder:`https://api.example.com/v1`,spellcheck:`false`,autocomplete:`off`,"aria-invalid":a.showError(`baseUrl`)?`true`:`false`,onBlur:t[4]||=e=>a.markTouched(`baseUrl`)},null,42,aM),[[al,i.form.baseUrl]]),a.showError(`baseUrl`)?(z(),B(`p`,oM,j(a.errors.baseUrl),1)):G(`v-if`,!0),i.help===`baseUrl`?(z(),B(`p`,sM,[...t[26]||=[W(`OpenAI 兼容网关的基址,`,-1),H(`strong`,null,`不含`,-1),W(),H(`code`,null,`/chat/completions`,-1),W(` 后缀(后端会自己拼)。例:`,-1),H(`code`,null,`https://api.openai.com/v1`,-1),W(`。`,-1)]])):G(`v-if`,!0)]),H(`div`,cM,[H(`div`,lM,[t[28]||=H(`label`,{class:`aiset__label`,for:`aiset-model`},[W(`模型名`),H(`i`,{class:`aiset__req`,"aria-hidden":`true`},`*`)],-1),H(`button`,{type:`button`,class:A([`aiset__help`,{"is-on":i.help===`model`}]),"aria-expanded":i.help===`model`,title:`查看说明`,onClick:t[5]||=K(e=>a.toggleHelp(`model`),[`stop`])},[...t[27]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-help`})],-1)]],10,uM)]),F(H(`input`,{id:`aiset-model`,"onUpdate:modelValue":t[6]||=e=>i.form.model=e,class:A([`aiset__input`,{"is-invalid":a.showError(`model`)}]),type:`text`,placeholder:`gpt-4o / GLM-4.6 / deepseek-chat`,spellcheck:`false`,autocomplete:`off`,"aria-invalid":a.showError(`model`)?`true`:`false`,onBlur:t[7]||=e=>a.markTouched(`model`)},null,42,dM),[[al,i.form.model]]),a.showError(`model`)?(z(),B(`p`,fM,j(a.errors.model),1)):G(`v-if`,!0),i.help===`model`?(z(),B(`p`,pM,`必须与网关侧的模型标识完全一致。建卡这类多步工具调用建议用支持 function calling 的模型。`)):G(`v-if`,!0)]),H(`div`,mM,[H(`div`,hM,[t[30]||=H(`label`,{class:`aiset__label`,for:`aiset-key`},[W(`API Key`),H(`i`,{class:`aiset__req`,"aria-hidden":`true`},`*`)],-1),H(`button`,{type:`button`,class:A([`aiset__help`,{"is-on":i.help===`apiKey`}]),"aria-expanded":i.help===`apiKey`,title:`查看说明`,onClick:t[8]||=K(e=>a.toggleHelp(`apiKey`),[`stop`])},[...t[29]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-help`})],-1)]],10,gM)]),H(`div`,_M,[F(H(`input`,{id:`aiset-key`,"onUpdate:modelValue":t[9]||=e=>i.form.apiKey=e,class:A([`aiset__input aiset__input--key`,{"is-invalid":a.showError(`apiKey`)}]),type:i.reveal?`text`:`password`,placeholder:a.keyPlaceholder,spellcheck:`false`,autocomplete:`off`,"aria-invalid":a.showError(`apiKey`)?`true`:`false`,onBlur:t[10]||=e=>a.markTouched(`apiKey`)},null,42,vM),[[pl,i.form.apiKey]]),H(`button`,{type:`button`,class:`aiset__eye`,title:i.reveal?`掩码显示密钥`:`明文显示密钥`,"aria-pressed":i.reveal,onClick:t[11]||=e=>i.reveal=!i.reveal},[(z(),B(`svg`,bM,[H(`use`,{href:i.reveal?`#icon-eye-off`:`#icon-eye`},null,8,xM)]))],8,yM)]),a.showError(`apiKey`)?(z(),B(`p`,SM,j(a.errors.apiKey),1)):G(`v-if`,!0),i.help===`apiKey`?(z(),B(`p`,CM,[...t[31]||=[W(` 密钥保存在项目根 `,-1),H(`code`,null,`.env.cb.local`,-1),W(`(个人覆盖层,已被 .gitignore 忽略,不会进版本库)。 打开面板自动回填已保存的密钥(默认掩码),点输入框尾部小眼睛切换明文;`,-1),H(`strong`,null,`清空后保存即删除`,-1),W(`已保存的密钥。 `,-1)]])):G(`v-if`,!0)]),H(`div`,wM,[H(`div`,TM,[t[33]||=H(`label`,{class:`aiset__label`},`单次输出上限`,-1),t[34]||=H(`span`,{class:`aiset__unit`},`max_tokens`,-1),H(`button`,{type:`button`,class:A([`aiset__help`,{"is-on":i.help===`maxTokens`}]),"aria-expanded":i.help===`maxTokens`,title:`查看说明`,onClick:t[12]||=K(e=>a.toggleHelp(`maxTokens`),[`stop`])},[...t[32]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-help`})],-1)]],10,EM)]),H(`div`,DM,[U(o,{id:`aiset-maxtok`,class:`aiset__stepper`,value:i.form.maxTokens>0?String(i.form.maxTokens):``,step:1024,min:0,max:262144,placeholder:a.maxTokensPlaceholder,onInput:a.onMaxTokens},null,8,[`value`,`placeholder`,`onInput`]),H(`button`,{type:`button`,class:`aiset__btn`,disabled:i.probing||i.saving||i.testing,onClick:t[13]||=(...e)=>a.probe&&a.probe(...e)},j(i.probing?`探测中…`:`探测`),9,OM)]),a.maxTokensOver?(z(),B(`p`,kM,` 超过网关已知上限 `+j(a.knownCapLimit)+`:对话时会主动夹取到该值,建议留空走自动 `,1)):G(`v-if`,!0),i.help===`maxTokens`?(z(),B(`p`,AM,[t[35]||=H(`strong`,null,`普通用户不用管这一项:留空 = 自动`,-1),t[36]||=W(`。后端自己协商:先读网关 `,-1),t[37]||=H(`code`,null,`/v1/models`,-1),t[38]||=W(` 的上下文窗口(免费、毫秒级,最多等 2 秒,超时先用默认 24576 开跑), 拿到后取 `,-1),t[39]||=H(`code`,null,`min(窗口, 32768)`,-1),t[40]||=W(` 当作单次输出上限(输出预算 ≠ 上下文窗口,建卡一轮 32k 足够)。 读不到元数据也不会偷偷发试探请求;想知道窗口多大就点「探测」做一次二分试探(会产生一次真实补全,约十几秒)。 手填值超过网关接受上限时,对话开跑前会主动夹取并说明;真被 400 拒绝才会自动减半重试, 减半成功的值记为「接受上限」(**不是窗口**:窗口与输出上限是两回事,有网关窗口 262144 但 max_tokens 硬上限 131072)。 只有某轮明确报「被单次输出上限截断」才需要手填更大值。注意:推理模型的思考过程也算进这个上限。 `,-1),t[41]||=H(`br`,null,null,-1),t[42]||=H(`strong`,null,[W(`注意:`),H(`code`,null,`32768`),W(` 是自动模式的「封顶假设值」,不是网关能力上限。`)],-1),t[43]||=W(` 真实上限只能实测得到,请以「接受的单次输出上限」为准(如 qwen-max 实测仅 8192)。 `,-1),t[44]||=H(`br`,null,null,-1),t[45]||=W(`当前自动生效值:`,-1),H(`strong`,null,j(n.config.maxTokens>0?n.config.maxTokens:24576),1),W(`; 网关上下文窗口:`+j(n.config.maxTokensWindow>0?n.config.maxTokensWindow:`未拿到(网关可能不提供元数据)`)+`; 接受的单次输出上限:`+j(n.config.maxTokensCap>0?n.config.maxTokensCap:`未知(点「探测」,或撞过一次 400 后自动回写)`)+`。 `,1)])):G(`v-if`,!0)]),H(`div`,jM,[G(` 仅「勾选框 + 标题」包进 label:点说明 / 问号不应误触开关 `),H(`div`,MM,[t[47]||=H(`span`,{class:`aiset__label`},`深度思考`,-1),H(`button`,{type:`button`,class:A([`aiset__help`,{"is-on":i.help===`thinking`}]),"aria-expanded":i.help===`thinking`,title:`查看说明`,onClick:t[14]||=K(e=>a.toggleHelp(`thinking`),[`stop`])},[...t[46]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-help`})],-1)]],10,NM),U(s,{modelValue:i.form.thinking,"onUpdate:modelValue":t[15]||=e=>i.form.thinking=e,class:`aiset__switch`},null,8,[`modelValue`])]),i.help===`thinking`?(z(),B(`p`,PM,[...t[48]||=[W(` 开启:模型先长篇推理再动手,规划更稳但慢很多、更费 token。关闭:直接出结果,实测同一网关快数倍。 关闭依赖网关支持 `,-1),H(`code`,null,`chat_template_kwargs.enable_thinking`,-1),W(`(vLLM / SGLang 系);网关不认时后端会自动回退成带思考并在对话里提示一次。 另外,`,-1),H(`strong`,null,`某一轮思考超时`,-1),W(`时后端会自动只在那一轮关闭深度思考并重试,逼出结果。 `,-1)]])):G(`v-if`,!0)]),H(`div`,FM,[H(`div`,IM,[t[50]||=H(`span`,{class:`aiset__label`},`多模态视觉`,-1),H(`button`,{type:`button`,class:A([`aiset__help`,{"is-on":i.help===`vision`}]),"aria-expanded":i.help===`vision`,title:`查看说明`,onClick:t[16]||=K(e=>a.toggleHelp(`vision`),[`stop`])},[...t[49]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-help`})],-1)]],10,LM),U(s,{modelValue:i.form.vision,"onUpdate:modelValue":t[17]||=e=>i.form.vision=e,class:`aiset__switch`},null,8,[`modelValue`])]),i.help===`vision`?(z(),B(`p`,RM,[...t[51]||=[W(` 开启后首轮对话会`,-1),H(`strong`,null,`自动探测`,-1),W(`网关是否真支持图像(比较带图 / 不带图的 prompt_tokens):支持则把渲染截图、设计稿 vs 渲染并排对比图、你挂载的图片注入上下文,AI 可直接读图找差异; 不支持会自动降级为数值闭环(pixelDiff.match)并在对话里提示一次。注入前降采样到长边 ≤ 1024px / ≤ 900KB,每轮最多 2 张;对话记录落盘不含图像。 `,-1)]])):G(`v-if`,!0)]),i.ping?(z(),B(`div`,{key:0,class:A([`aiset__ping`,i.ping.ok?`is-ok`:`is-bad`])},[(z(),B(`svg`,zM,[H(`use`,{href:i.ping.ok?`#icon-check`:`#icon-alert-triangle`},null,8,BM)])),H(`span`,null,j(i.ping.text),1)],2)):G(`v-if`,!0)]),H(`footer`,VM,[H(`button`,{type:`button`,class:`aiset__btn`,disabled:i.testing||i.saving,onClick:t[18]||=(...e)=>a.test&&a.test(...e)},[(z(),B(`svg`,UM,[H(`use`,{href:i.testing?`#icon-loading`:`#icon-activity`},null,8,WM)])),H(`span`,null,j(i.testing?`测试中…`:`测试连接`),1)],8,HM),t[52]||=H(`span`,{class:`aiset__foot-gap`},null,-1),H(`button`,{type:`button`,class:`aiset__btn`,disabled:i.saving,onClick:t[19]||=t=>e.$emit(`close`)},`取消`,8,GM),H(`button`,{type:`button`,class:`aiset__btn aiset__btn--primary`,disabled:i.saving||i.testing,onClick:t[20]||=(...e)=>a.save&&a.save(...e)},j(i.saving?`保存中…`:`保存`),9,KM)])])])}var JM=Y(Yj,[[`render`,qM],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/AiSettings.vue`]]),YM={name:`ModelList`,props:{models:{type:Array,default:()=>[]},activeId:{type:String,default:null},turnRunning:{type:Boolean,default:!1}},emits:[`add`,`edit`,`delete`,`activate`,`close`,`open-common`,`import-ccswitch`],methods:{locked(e){return!!(this.turnRunning&&e&&e.id===this.activeId)},hostOf(e){let t=String(e||``).trim();if(!t)return`未填地址`;try{return new URL(t).host}catch{return t.replace(/^https?:\/\//,``).replace(/\/+$/,``)||t}}}},XM={class:`aiset__mask`},ZM={class:`aiset modellist`,role:`dialog`,"aria-modal":`true`,"aria-label":`模型选择`},QM={class:`aiset__head`},$M={class:`aiset__body ml__body`},eN={class:`ml__toolbar`},tN={key:0,class:`ml__lock`,role:`status`},nN={key:1,class:`empty-state`},rN={class:`ml__list`},iN=[`aria-disabled`,`onClick`],aN={key:0,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`,"stroke-linecap":`round`,"stroke-linejoin":`round`},oN={class:`ml__info`},sN={class:`ml__name`},cN={class:`ml__meta`},lN={class:`ml__model`},uN={class:`ml__host`},dN={key:0,class:`ml__key`,title:`已配置密钥`},fN={key:1,class:`ml__key ml__key--off`,title:`未配置密钥`},pN={key:2,class:`ml__key ml__key--lock`,title:`对话进行中,正在使用的模型已锁定`},mN={class:`ml__actions`},hN=[`disabled`,`title`,`onClick`],gN=[`disabled`,`title`,`onClick`],_N={class:`ml__foot`},vN={class:`ml__hint`};function yN(e,t,n,r,i,a){return z(),B(`div`,XM,[H(`section`,ZM,[H(`header`,QM,[t[5]||=H(`svg`,{class:`aiset__head-icon is-solid-icon`,viewBox:`0 0 1024 1024`,"aria-hidden":`true`},[H(`use`,{href:`#icon-model`})],-1),t[6]||=H(`span`,{class:`aiset__title`},`模型`,-1),H(`button`,{type:`button`,class:`aiset__x`,title:`关闭`,onClick:t[0]||=t=>e.$emit(`close`)},[...t[4]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-x`})],-1)]])]),H(`div`,$M,[G(` 操作工具条:添加模型 / 从 cc-switch 导入,靠右对齐 `),H(`div`,eN,[H(`button`,{type:`button`,class:`ml__import`,title:`从 cc-switch 导入`,onClick:t[1]||=t=>e.$emit(`import-ccswitch`)},[...t[7]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-download`})],-1),H(`span`,null,`导入`,-1)]]),H(`button`,{type:`button`,class:`ml__add`,title:`添加模型`,onClick:t[2]||=t=>e.$emit(`add`)},[...t[8]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-plus`})],-1),H(`span`,null,`添加模型`,-1)]])]),G(` 对话进行中:正在使用的模型被锁,说明原因与解除方式,避免用户反复点却没反应 `),n.turnRunning?(z(),B(`div`,tN,[...t[9]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-alert-triangle`})],-1),H(`span`,null,`有对话正在进行:正在使用的模型已锁定,本轮结束后可切换或修改。其他模型仍可编辑。`,-1)]])):G(`v-if`,!0),G(` 空状态:与其他面板占位(图标 + 文字)同一语言 `),n.models.length?(z(),B(R,{key:2},[G(` 模型列表:参考 cc-switch 的 provider 列表——每条可编辑 / 删除,当前生效项高亮 `),H(`ul`,rN,[(z(!0),B(R,null,L(n.models,r=>(z(),B(`li`,{key:r.id,class:A([`ml__item`,{"is-active":r.id===n.activeId,"is-locked":a.locked(r)}]),"aria-disabled":a.locked(r)?`true`:`false`,onClick:t=>e.$emit(`activate`,r)},[H(`span`,{class:A([`ml__check`,{"is-on":r.id===n.activeId}]),"aria-hidden":`true`},[r.id===n.activeId?(z(),B(`svg`,aN,[...t[11]||=[H(`use`,{href:`#icon-check`},null,-1)]])):G(`v-if`,!0)],2),H(`span`,oN,[H(`span`,sN,j(r.name||r.model||`未命名模型`),1),H(`span`,cN,[H(`span`,lN,j(r.model||`未填模型名`),1),t[12]||=H(`span`,{class:`ml__dot`},`·`,-1),H(`span`,uN,j(a.hostOf(r.baseUrl)),1),r.hasKey?(z(),B(`span`,dN,`已配密钥`)):(z(),B(`span`,fN,`无密钥`)),a.locked(r)?(z(),B(`span`,pN,`运行中 · 锁定`)):G(`v-if`,!0)])]),H(`span`,mN,[H(`button`,{type:`button`,class:`ml__btn`,disabled:a.locked(r),title:a.locked(r)?`对话进行中,正在使用的模型不可编辑`:`编辑`,onClick:K(t=>e.$emit(`edit`,r),[`stop`])},[...t[13]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-edit`})],-1)]],8,hN),H(`button`,{type:`button`,class:`ml__btn ml__btn--danger`,disabled:a.locked(r),title:a.locked(r)?`对话进行中,正在使用的模型不可删除`:`删除`,onClick:K(t=>e.$emit(`delete`,r),[`stop`])},[...t[14]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-trash`})],-1)]],8,gN)])],10,iN))),128))])],2112)):(z(),B(`div`,nN,[...t[10]||=[os(`<span class="empty-state__badge" aria-hidden="true"><svg class="is-solid-icon" viewBox="0 0 1024 1024"><use href="#icon-model"></use></svg></span><p class="debug__empty">还没有模型</p><p class="empty-state__hint">点上方「添加模型」配置第一个 AI 模型(Base URL / API Key / 模型名),或「导入」从 cc-switch 拉取已有的 Codex 供应商。配置保存在项目根 .env.cb.local,不进版本库。</p>`,3)]]))]),H(`footer`,_N,[H(`span`,vN,j(n.turnRunning?`对话进行中:正在使用的模型已锁定,无法切换`:`点击任意模型即可切换为当前生效模型`),1),H(`button`,{type:`button`,class:`ml__common`,title:`通用设置(执行策略 / 环境参数,所有模型共享)`,onClick:t[3]||=t=>e.$emit(`open-common`)},[...t[15]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-settings`})],-1),H(`span`,null,`通用设置`,-1)]])])])])}var bN=Y(YM,[[`render`,yN],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ModelList.vue`]]),xN=6e4,SN={name:`AiCommonSettings`,components:{NumberStepper:o_,Switch:Dw},emits:[`close`,`saved`],data(){return{form:{allowShell:!0,autoApprove:`all`,maxSteps:0,turnTimeoutMin:60,stallTimeoutMin:120,stallRetries:-1,reasoningTimeoutMin:600,autoContinueMax:-1},saving:!1,ping:null,help:null,adv:!1,approveOptions:[{value:`none`,label:`逐次确认`},{value:`skill`,label:`免技能`},{value:`all`,label:`全免确认`}]}},created(){this.loadConfig()},mounted(){document.addEventListener(`click`,this.onDocClick,!0),document.addEventListener(`keydown`,this.onKeydown)},beforeUnmount(){document.removeEventListener(`click`,this.onDocClick,!0),document.removeEventListener(`keydown`,this.onKeydown)},methods:{toggleHelp(e){this.help=this.help===e?null:e},onDocClick(e){if(!this.help)return;let t=e.target;t instanceof Element&&t.closest(`.aiset__pop, .aiset__help`)||(this.help=null)},onKeydown(e){e.key===`Escape`&&this.help&&(e.stopPropagation(),this.help=null)},onInt(e,t){let n=String(t).trim();if(!n){this.form[e]=e===`stallRetries`||e===`autoContinueMax`?-1:0;return}let r=Number(n);this.form[e]=Number.isFinite(r)?Math.round(r):0},async loadConfig(){try{let e=await Pk();e.shellEnabled!==void 0&&(this.form.allowShell=e.shellEnabled!==!1),e.autoApprove&&(this.form.autoApprove=e.autoApprove),Number(e.maxSteps)>0&&(this.form.maxSteps=Number(e.maxSteps)),Number(e.turnTimeoutMs)>0&&(this.form.turnTimeoutMin=Math.round(Number(e.turnTimeoutMs)/xN)),Number(e.stallTimeoutMs)>0&&(this.form.stallTimeoutMin=Math.round(Number(e.stallTimeoutMs)/xN)),e.stallRetries!==void 0&&e.stallRetries>=0&&(this.form.stallRetries=Number(e.stallRetries)),Number(e.reasoningTimeoutMs)>0&&(this.form.reasoningTimeoutMin=Math.round(Number(e.reasoningTimeoutMs)/xN)),e.autoContinueMax!==void 0&&e.autoContinueMax>=0&&(this.form.autoContinueMax=Number(e.autoContinueMax))}catch{}},async save(){this.saving=!0,this.ping=null;try{let e=await Fk({allowShell:!!this.form.allowShell,autoApprove:this.form.autoApprove,maxSteps:Number(this.form.maxSteps)>0?Number(this.form.maxSteps):0,turnTimeoutMs:Number(this.form.turnTimeoutMin)>0?Number(this.form.turnTimeoutMin)*xN:0,stallTimeoutMs:Number(this.form.stallTimeoutMin)>0?Number(this.form.stallTimeoutMin)*xN:0,stallRetries:Number(this.form.stallRetries)>=0?Number(this.form.stallRetries):-1,reasoningTimeoutMs:Number(this.form.reasoningTimeoutMin)>0?Number(this.form.reasoningTimeoutMin)*xN:0,autoContinueMax:Number(this.form.autoContinueMax)>=0?Number(this.form.autoContinueMax):-1});this.$emit(`saved`,e)}catch(e){this.ping={ok:!1,text:`保存失败:${e.message||e}`}}finally{this.saving=!1}}}},CN={class:`aiset__mask`},wN={class:`aiset`,role:`dialog`,"aria-modal":`true`,"aria-label":`AI 通用设置`},TN={class:`aiset__head`},EN={class:`aiset__body`},DN={class:`aiset__field`},ON={class:`aiset__labelrow`},kN=[`aria-expanded`],AN={key:0,class:`aiset__pop`},jN={class:`aiset__field`},MN={class:`aiset__labelrow`},NN=[`aria-expanded`],PN={class:`aiset__seg`},FN=[`onClick`],IN={key:0,class:`aiset__pop`},LN={class:`aiset__adv`},RN=[`aria-expanded`],zN={class:`aiset__adv-hint`},BN={key:0,class:`aiset__adv-body`},VN={class:`aiset__field`},HN={class:`aiset__labelrow`},UN=[`aria-expanded`],WN={class:`aiset__stepperrow`},GN={key:0,class:`aiset__pop`},KN={class:`aiset__field`},qN={class:`aiset__labelrow`},JN=[`aria-expanded`],YN={class:`aiset__stepperrow`},XN={key:0,class:`aiset__pop`},ZN={class:`aiset__field`},QN={class:`aiset__labelrow`},$N=[`aria-expanded`],eP={class:`aiset__stepperrow`},tP={key:0,class:`aiset__pop`},nP={class:`aiset__field`},rP={class:`aiset__labelrow`},iP=[`aria-expanded`],aP={class:`aiset__stepperrow`},oP={key:0,class:`aiset__pop`},sP={class:`aiset__field`},cP={class:`aiset__labelrow`},lP=[`aria-expanded`],uP={class:`aiset__stepperrow`},dP={key:0,class:`aiset__pop`},fP={class:`aiset__field`},pP={class:`aiset__labelrow`},mP=[`aria-expanded`],hP={class:`aiset__stepperrow`},gP={key:0,class:`aiset__pop`},_P={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},vP=[`href`],yP={class:`aiset__foot`},bP=[`disabled`],xP=[`disabled`];function SP(e,t,n,r,i,a){let o=I(`Switch`),s=I(`NumberStepper`);return z(),B(`div`,CN,[H(`section`,wN,[H(`header`,TN,[t[20]||=H(`svg`,{class:`aiset__head-icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-settings`})],-1),t[21]||=H(`span`,{class:`aiset__title`},`通用设置`,-1),H(`button`,{type:`button`,class:`aiset__x`,title:`关闭`,onClick:t[0]||=t=>e.$emit(`close`)},[...t[19]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-x`})],-1)]])]),H(`div`,EN,[t[51]||=H(`p`,{class:`aiset__note`},[W(`以下为`),H(`strong`,null,`所有模型共享`),W(`的执行策略 / 环境参数,与具体模型无关,故不放在每个模型条目里。`)],-1),H(`div`,DN,[H(`div`,ON,[t[23]||=H(`span`,{class:`aiset__label`},`本地命令执行`,-1),H(`button`,{type:`button`,class:A([`aiset__help`,{"is-on":i.help===`allowShell`}]),"aria-expanded":i.help===`allowShell`,title:`查看说明`,onClick:t[1]||=K(e=>a.toggleHelp(`allowShell`),[`stop`])},[...t[22]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-help`})],-1)]],10,kN),U(o,{modelValue:i.form.allowShell,"onUpdate:modelValue":t[2]||=e=>i.form.allowShell=e,class:`aiset__switch`},null,8,[`modelValue`])]),i.help===`allowShell`?(z(),B(`p`,AN,[...t[24]||=[W(` 是否注册 `,-1),H(`code`,null,`shell_exec`,-1),W(` 本地命令执行。默认开(工具只监听 127.0.0.1,命令过白名单 + 全量审计)。 关掉后 AI 不能跑本地命令,但仍可执行技能脚本(由 `,-1),H(`code`,null,`autoApprove`,-1),W(` 控制是否逐次确认)。 `,-1)]])):G(`v-if`,!0)]),H(`div`,jN,[H(`div`,MN,[t[26]||=H(`span`,{class:`aiset__label`},`免确认执行策略`,-1),H(`button`,{type:`button`,class:A([`aiset__help`,{"is-on":i.help===`autoApprove`}]),"aria-expanded":i.help===`autoApprove`,title:`查看说明`,onClick:t[3]||=K(e=>a.toggleHelp(`autoApprove`),[`stop`])},[...t[25]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-help`})],-1)]],10,NN)]),H(`div`,PN,[(z(!0),B(R,null,L(i.approveOptions,e=>(z(),B(`button`,{key:e.value,type:`button`,class:A([`aiset__seg-btn`,{"is-on":i.form.autoApprove===e.value}]),onClick:t=>i.form.autoApprove=e.value},j(e.label),11,FN))),128))]),i.help===`autoApprove`?(z(),B(`p`,IN,[...t[27]||=[H(`code`,null,`none`,-1),W(`=逐次弹审批;`,-1),H(`code`,null,`skill`,-1),W(`=只免技能脚本;`,-1),H(`code`,null,`all`,-1),W(`=技能脚本 + 本地命令都免确认(默认)。 建卡管线连跑十几次脚本 / 命令,`,-1),H(`code`,null,`all`,-1),W(` 避免每次等用户点「允许」。 `,-1)]])):G(`v-if`,!0)]),G(` 保活 / 预算阈值:实测调优出来的值,改只会变坏,故默认收起。
|
|
283
|
+
全部有代码默认值,留空即走默认;折叠区保留可写入口,真要调时不用去翻 .env `),H(`div`,LN,[H(`button`,{type:`button`,class:`aiset__adv-head`,"aria-expanded":i.adv,onClick:t[4]||=e=>i.adv=!i.adv},[(z(),B(`svg`,{class:A([`aiset__adv-caret`,{"is-open":i.adv}]),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[...t[28]||=[H(`use`,{href:`#icon-chevron-right`},null,-1)]],2)),t[29]||=H(`span`,{class:`aiset__adv-title`},`高级:保活与预算阈值`,-1),H(`span`,zN,j(i.adv?``:`默认值经实测调优,不建议修改`),1)],8,RN),i.adv?(z(),B(`div`,BN,[t[50]||=H(`p`,{class:`aiset__adv-note`},[W(` 这几项是长程任务的`),H(`strong`,null,`熔断与保活阈值`),W(`,数值由实测调优得出(如纯思考预算从 90s 放宽到 600s,因 240s 会误伤正常轮次)。 留空即走默认,`),H(`strong`,null,`没有明确理由不建议改动`),W(`。 `)],-1),H(`div`,VN,[H(`div`,HN,[t[31]||=H(`span`,{class:`aiset__label`},`单轮步数上限`,-1),t[32]||=H(`span`,{class:`aiset__unit`},`0 / 留空 = 不限`,-1),H(`button`,{type:`button`,class:A([`aiset__help`,{"is-on":i.help===`maxSteps`}]),"aria-expanded":i.help===`maxSteps`,title:`查看说明`,onClick:t[5]||=K(e=>a.toggleHelp(`maxSteps`),[`stop`])},[...t[30]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-help`})],-1)]],10,UN)]),H(`div`,WN,[U(s,{id:`common-maxsteps`,class:`aiset__stepper`,value:i.form.maxSteps>0?String(i.form.maxSteps):``,step:8,min:0,max:1e3,placeholder:`留空 = 不限(推荐)`,onInput:t[6]||=e=>a.onInt(`maxSteps`,e)},null,8,[`value`])]),i.help===`maxSteps`?(z(),B(`p`,GN,[...t[33]||=[H(`strong`,null,`普通用户不用管:留空 = 不限`,-1),W(`。失控由三道精准熔断兜住(同参打转跳过 / 单轮墙钟到点收尾 / 每 24 步提醒)。 只有想硬性控成本时才填(>0 即恢复旧硬顶行为)。 `,-1)]])):G(`v-if`,!0)]),H(`div`,KN,[H(`div`,qN,[t[35]||=H(`span`,{class:`aiset__label`},`单轮墙钟上限`,-1),t[36]||=H(`span`,{class:`aiset__unit`},`分钟`,-1),H(`button`,{type:`button`,class:A([`aiset__help`,{"is-on":i.help===`turnTimeout`}]),"aria-expanded":i.help===`turnTimeout`,title:`查看说明`,onClick:t[7]||=K(e=>a.toggleHelp(`turnTimeout`),[`stop`])},[...t[34]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-help`})],-1)]],10,JN)]),H(`div`,YN,[U(s,{id:`common-turn`,class:`aiset__stepper`,value:i.form.turnTimeoutMin>0?String(i.form.turnTimeoutMin):``,step:5,min:0,max:240,placeholder:`留空 = 60`,onInput:t[8]||=e=>a.onInt(`turnTimeoutMin`,e)},null,8,[`value`])]),i.help===`turnTimeout`?(z(),B(`p`,XN,` 单轮允许跑的最长时间(分钟)。到点收尾汇报、上下文不丢,回复「继续」接着做。默认 60 分钟,不限步数后的唯一兜底闸门。 `)):G(`v-if`,!0)]),H(`div`,ZN,[H(`div`,QN,[t[38]||=H(`span`,{class:`aiset__label`},`网关静默阈值`,-1),t[39]||=H(`span`,{class:`aiset__unit`},`分钟`,-1),H(`button`,{type:`button`,class:A([`aiset__help`,{"is-on":i.help===`stall`}]),"aria-expanded":i.help===`stall`,title:`查看说明`,onClick:t[9]||=K(e=>a.toggleHelp(`stall`),[`stop`])},[...t[37]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-help`})],-1)]],10,$N)]),H(`div`,eP,[U(s,{id:`common-stall`,class:`aiset__stepper`,value:i.form.stallTimeoutMin>0?String(i.form.stallTimeoutMin):``,step:1,min:0,max:120,placeholder:`留空 = 2`,onInput:t[10]||=e=>a.onInt(`stallTimeoutMin`,e)},null,8,[`value`])]),i.help===`stall`?(z(),B(`p`,tP,` 上游多少分钟不回任何字节算「网关静默」;静默自动重试本步而非整轮报废。默认 2 分钟(120 秒)。 `)):G(`v-if`,!0)]),H(`div`,nP,[H(`div`,rP,[t[41]||=H(`span`,{class:`aiset__label`},`静默重试次数`,-1),t[42]||=H(`span`,{class:`aiset__unit`},`-1 = 默认`,-1),H(`button`,{type:`button`,class:A([`aiset__help`,{"is-on":i.help===`stallRetries`}]),"aria-expanded":i.help===`stallRetries`,title:`查看说明`,onClick:t[11]||=K(e=>a.toggleHelp(`stallRetries`),[`stop`])},[...t[40]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-help`})],-1)]],10,iP)]),H(`div`,aP,[U(s,{id:`common-stallretries`,class:`aiset__stepper`,value:i.form.stallRetries>=0?String(i.form.stallRetries):``,step:1,min:-1,max:20,placeholder:`留空 / -1 = 3`,onInput:t[12]||=e=>a.onInt(`stallRetries`,e)},null,8,[`value`])]),i.help===`stallRetries`?(z(),B(`p`,oP,` 网关静默后的自动重试次数。0 = 回到「一次静默即报错」的旧行为;留空 / -1 = 用默认 3 次。 `)):G(`v-if`,!0)]),H(`div`,sP,[H(`div`,cP,[t[44]||=H(`span`,{class:`aiset__label`},`纯思考预算`,-1),t[45]||=H(`span`,{class:`aiset__unit`},`分钟`,-1),H(`button`,{type:`button`,class:A([`aiset__help`,{"is-on":i.help===`reasoning`}]),"aria-expanded":i.help===`reasoning`,title:`查看说明`,onClick:t[13]||=K(e=>a.toggleHelp(`reasoning`),[`stop`])},[...t[43]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-help`})],-1)]],10,lP)]),H(`div`,uP,[U(s,{id:`common-reasoning`,class:`aiset__stepper`,value:i.form.reasoningTimeoutMin>0?String(i.form.reasoningTimeoutMin):``,step:1,min:0,max:300,placeholder:`留空 = 10`,onInput:t[14]||=e=>a.onInt(`reasoningTimeoutMin`,e)},null,8,[`value`])]),i.help===`reasoning`?(z(),B(`p`,dP,` 单轮「纯思考」(不调工具)的预算(分钟)。到点催促 + 关深度思考重试;催 3 次仍无产出则停该熔断,改墙钟兜底。默认 10 分钟(600 秒)。 `)):G(`v-if`,!0)]),H(`div`,fP,[H(`div`,pP,[t[47]||=H(`span`,{class:`aiset__label`},`自动续跑上限`,-1),t[48]||=H(`span`,{class:`aiset__unit`},`-1 = 默认`,-1),H(`button`,{type:`button`,class:A([`aiset__help`,{"is-on":i.help===`autoContinue`}]),"aria-expanded":i.help===`autoContinue`,title:`查看说明`,onClick:t[15]||=K(e=>a.toggleHelp(`autoContinue`),[`stop`])},[...t[46]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-help`})],-1)]],10,mP)]),H(`div`,hP,[U(s,{id:`common-autocont`,class:`aiset__stepper`,value:i.form.autoContinueMax>=0?String(i.form.autoContinueMax):``,step:1,min:-1,max:200,placeholder:`留空 / -1 = 12`,onInput:t[16]||=e=>a.onInt(`autoContinueMax`,e)},null,8,[`value`])]),i.help===`autoContinue`?(z(),B(`p`,gP,[...t[49]||=[W(` 模型没给收尾标记(`,-1),H(`code`,null,`[任务完成]`,-1),W(` / `,-1),H(`code`,null,`[需用户确认]`,-1),W(`)就停手时的自动续跑次数上限。0 = 关闭(等你手打「继续」);留空 / -1 = 用默认 12。 `,-1)]])):G(`v-if`,!0)])])):G(`v-if`,!0)]),i.ping?(z(),B(`div`,{key:0,class:A([`aiset__ping`,i.ping.ok?`is-ok`:`is-bad`])},[(z(),B(`svg`,_P,[H(`use`,{href:i.ping.ok?`#icon-check`:`#icon-alert-triangle`},null,8,vP)])),H(`span`,null,j(i.ping.text),1)],2)):G(`v-if`,!0)]),H(`footer`,yP,[t[52]||=H(`span`,{class:`aiset__foot-gap`},null,-1),H(`button`,{type:`button`,class:`aiset__btn`,disabled:i.saving,onClick:t[17]||=t=>e.$emit(`close`)},`取消`,8,bP),H(`button`,{type:`button`,class:`aiset__btn aiset__btn--primary`,disabled:i.saving,onClick:t[18]||=(...e)=>a.save&&a.save(...e)},j(i.saving?`保存中…`:`保存`),9,xP)])])])}var CP=Y(SN,[[`render`,SP],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/AiCommonSettings.vue`]]),wP=2e3;function TP(e){try{let t=JSON.stringify(e);return t==null?0:t.length}catch{return 1/0}}function EP(e,t){let n=typeof e==`string`?e:e==null?``:JSON.stringify(e);return n.length<=t?e:`${n.slice(0,t)}\n…(历史归档已裁剪,完整内容以卡片与落盘产物为准)`}function DP(e,t){if(!e||typeof e!=`object`)return e;let n={};for(let[r,i]of Object.entries(e))n[r]=typeof i==`string`||typeof i==`object`&&i?EP(i,t):i;return n}function OP(e,t=!1){let n=Array.isArray(e)?e:[],r=t?400:wP;return n.map(e=>{if(!e||!Array.isArray(e.toolCalls)||!e.toolCalls.length)return e;let n=!1,i=e.toolCalls.map(e=>{if(!e||typeof e!=`object`)return e;let i=DP(e.args,r),a=t?e.result==null||e.result===``?e.result:`[历史归档已裁剪]`:EP(e.result,r);return(JSON.stringify(i)!==JSON.stringify(e.args)||String(a)!==String(e.result))&&(n=!0),{...e,args:i,result:a}});return n?{...e,toolCalls:i,trimmedArchive:!0}:e})}var kP=12e3,AP={pick:{id:`pick`,label:`选一张已有的卡`,hint:`从顶栏下拉里挑`,icon:`#icon-search`,weight:`read`,text:`列出仓库里现有的卡片,按用途分组,帮我挑一张适合修改的。`},scaffold:{id:`scaffold`,label:`新建一张卡`,hint:`从空白骨架开始`,icon:`#icon-folder-plus`,weight:`write`,text:`帮我新建一张卡片:先用 card_scaffold 生成骨架,再按我的需求补齐结构与示例内容,最后自检。`},spec:{id:`spec`,label:`按设计稿标注建卡`,hint:`先拖入 MeaXure 目录`,icon:`#icon-image-upload`,weight:`write`,attach:!0,text:`我会挂载一份 Sketch MeaXure 标注导出目录,请按标注生成卡片 schema 并自检。`},fromimage:{id:`fromimage`,label:`从参考图建卡`,hint:`拖一张设计图进来`,icon:`#icon-image`,weight:`write`,attach:!0,text:`我会拖入一张参考设计图(本机路径),请按图生成卡片 schema 并截图自检还原度。`},learn:{id:`learn`,label:`看已有卡学写法`,hint:`只读,不改卡`,icon:`#icon-search`,weight:`read`,text:`列出仓库里结构最完整的几张卡片,读 1-2 张的关键片段,说明本仓库的建卡约定与常用范式。`},component:{id:`component`,label:`加一个常用组件`,hint:`列表 / 按钮 / 金额卡`,icon:`#icon-plus`,weight:`write`,text:`帮我给这张卡加一个常用组件(列表 / 按钮组 / 金额统计卡),按仓库范式写并自检。`},explain:{id:`explain`,label:`解释结构与数据来源`,hint:`只读,不改卡`,icon:`#icon-search`,weight:`read`,text:`读取当前卡片 schema,用中文解释它的结构、关键绑定与数据来源,指出可能的问题。`},bind:{id:`bind`,label:`把写死文案抽成变量`,hint:`绑定 data.json`,icon:`#icon-link`,weight:`write`,text:`把当前卡片里写死的动态值(金额 / 日期 / 名称等)抽成变量并绑定 data.json,保持展示文案与设计稿一致。`},fix:{id:`fix`,label:`校验并修复`,hint:`会改动卡片`,icon:`#icon-wrench`,weight:`write`,text:`对当前卡片执行校验,列出全部错误并按规则修复,修完再校验一次确认清零。`},shot:{id:`shot`,label:`截图自检还原度`,hint:`多尺寸预览比对`,icon:`#icon-images`,weight:`read`,text:`给当前卡片截图,检查布局、字号、间距与配色是否协调,指出需要调整的地方。`},interact:{id:`interact`,label:`加按钮点击行为`,hint:`customAction / 发消息`,icon:`#icon-send`,weight:`write`,text:`给当前卡片里的主按钮加点击行为(customAction 或发送一条消息),参照现有卡片的写法。`},diagnose:{id:`diagnose`,label:`定位并修复刚才的报错`,hint:`接上一轮`,icon:`#icon-alert-triangle`,weight:`write`,text:`上一轮失败了,请读取错误信息与上下文,定位原因并修复,修完再校验一次。`},resume:{id:`resume`,label:`从中断处继续`,hint:`不重做已完成部分`,icon:`#icon-redo`,weight:`write`,text:`上一轮被中断了,请按上下文里的中断标记从中断处继续,不要从零重做。`},rollback:{id:`rollback`,label:`回滚上一轮改动`,hint:`恢复到改动前`,icon:`#icon-undo`,weight:`write`,text:`把上一轮对卡片做的改动回滚到改动前,并说明回滚了什么。`}},jP={nocare:[`pick`,`scaffold`,`spec`,`learn`,`component`],empty:[`spec`,`fromimage`,`scaffold`,`component`,`learn`],card:[`explain`,`bind`,`fix`,`shot`,`interact`],error:[`diagnose`,`resume`,`rollback`,`explain`,`fix`]},MP={nocare:{title:`选择或新建一张卡`,desc:`先从顶栏选一张卡,或让 AI 新建一张;也可以把设计稿标注目录、参考图拖进来,只传本机路径不上传。`},empty:{title:`把这张空卡搭起来`,desc:`描述想要的效果,或拖入设计稿标注目录 / 参考图,AI 会按标注生成卡片并截图自检。`},error:{title:`接着上一轮往下做`,desc:`上一轮失败或被中断了:可以接着修、从中断处继续,或回滚到改动前。`},card:{title:`让 AI 直接改这张卡`,desc:`描述需求即可,AI 会调用卡片工具读改校验并截图自检;也可以把设计稿标注目录、参考图拖进来,只传本机路径不上传。`}};function NP(e){let t=Array.isArray(e)?e:[];for(let e=t.length-1;e>=0;--e){let n=t[e];if(n&&n.role===`assistant`)return n.status||`done`}return``}function PP({cardId:e,cardEmpty:t,messages:n}={}){if(!e)return`nocare`;if(t)return`empty`;let r=NP(n);return r===`error`||r===`aborted`?`error`:`card`}function FP(e){return(jP[e]||jP.card).map(e=>AP[e]).filter(Boolean)}function IP(e,t,n=4){let r=Array.isArray(e)?e:[];if(r.length<=n)return r.slice();let i=r.length,a=((Number(t)||0)%i+i)%i;return[...r.slice(a),...r.slice(0,a)].slice(0,n)}function LP(e,t=4){return(Array.isArray(e)?e:[]).slice(0,t)}var RP=`cardbuddy:ai-panel-width`,zP=2e4,BP=`cardbuddy:ai-compact-steps`,VP=380,HP=.5,UP=.33,WP=0;function GP(e=`m`){return WP+=1,`${e}${Date.now().toString(36)}-${WP}`}var KP=`有对话正在进行,无法修改正在使用的模型:请先等这一轮结束,或在输入区点「停止」`,qP={name:`ChatPanel`,components:{ChatMessage:bj,ChatComposer:Jj,AiSettings:JM,ModelList:bN,AiCommonSettings:CP,ConfirmDialog:vp},props:{visible:{type:Boolean,default:!1},cardId:{type:String,default:``},cardName:{type:String,default:``},cardEmpty:{type:Boolean,default:!1}},emits:[`close`,`busy`,`turn-progress`,`turn-finished`,`rollback-turn`,`locate-node`],data(){return{messages:[],draftAttachments:[],busy:!1,loadingHistory:!1,modelListOpen:!1,models:[],activeId:null,turnRunning:!1,modelEditOpen:!1,editModelId:null,editInitialModel:null,confirmDeleteModel:null,ccSwitchOpen:!1,ccSwitchProviders:[],ccSwitchLoading:!1,ccSwitchReason:``,ccSwitchSelected:{},commonOpen:!1,confirmClear:!1,notice:null,config:{baseUrl:``,model:``,hasKey:!1,apiKeyMasked:``},widthPx:0,winW:typeof window<`u`?window.innerWidth:1280,resizing:!1,gripArmed:!1,_gripTimer:null,pinned:!0,contextUsage:null,compactSteps:!1,archiveTrimmed:!1,suggestOffset:0,suggestStats:{},confirmStop:!1,turnStep:0,turnStage:null,turnToolLabel:``,turnStartedAt:0,lastByteAt:0,turnId:``,lastSeq:0,_resumeProbe:!1,nowTs:0,_abort:null,_saveTimer:0,_loadedCard:``,_cardRenamedTo:``,_saving:!1,_liveTicker:0,_turnPersistTimer:0}},computed:{pickOwnerRow(){return sk(this.messages)},suggestBatchKey(){return PP({cardId:this.cardId,cardEmpty:this.cardEmpty,messages:this.messages})},suggestBatch(){return FP(this.suggestBatchKey)},suggestions(){return IP(this.suggestBatch,this.suggestOffset)},canShuffle(){return this.suggestBatch.length>4},quickChips(){return LP(this.suggestBatch)},emptyTitle(){return(MP[this.suggestBatchKey]||MP.card).title},emptyDesc(){return(MP[this.suggestBatchKey]||MP.card).desc},ccSwitchCheckedCount(){let e=this.ccSwitchSelected||{};return Object.keys(e).filter(t=>e[t]).length},ccSwitchDupCount(){return(this.ccSwitchProviders||[]).filter(e=>e.duplicate).length},configReady(){return!!(this.config.baseUrl&&this.config.model&&this.config.hasKey)},panelWidth(){let e=this.winW||1280,t=Math.max(VP,Math.floor(e*HP)),n=Math.round(e*UP),r=this.widthPx||n;return Math.max(VP,Math.min(t,r))},panelStyle(){return{width:`${this.panelWidth}px`}},stallLimitMs(){let e=Number(this.config.stallTimeoutMs)>0?Number(this.config.stallTimeoutMs):12e4;return Math.round(e*1.5)},idleMs(){return this.lastByteAt?Math.max(0,(this.nowTs||Date.now())-this.lastByteAt):0},stalled(){return!!(this.busy&&this.idleMs>this.stallLimitMs)},liveText(){if(!this.busy)return``;let e=[];return this.turnStartedAt&&e.push(`${zO(this.turnStartedAt)} 开始`),this.turnStep>0&&e.push(`第 ${this.turnStep} 步`),e.push(`已用 ${this.fmtClock(this.nowTs-this.turnStartedAt)}`),this.turnStage?e.push(`${this.turnStage.id} ${this.turnStage.label}`):this.turnToolLabel&&e.push(this.turnToolLabel),this.stalled?`${Math.round(this.idleMs/1e3)} 秒没收到任何数据,连接可能已中断(${e.join(` · `)})`:(e.push(`最近数据 ${Math.round(this.idleMs/1e3)} 秒前`),e.join(` · `))}},watch:{suggestBatchKey(){this.suggestOffset=0},visible(e){e?(this.refreshConfig(),this.ensureHistory().then(()=>this.checkResumableTurn()),this.$nextTick(()=>{this.scrollToBottom(!0),this.$refs.composerEl?.focus()})):this.busy&&this.flushHistory()},cardId(e,t){if(this._cardRenamedTo&&this._cardRenamedTo===e){this._cardRenamedTo=``,this._dirtyFor===t&&(this._dirtyFor=e),this._loadedCard===t?(this._loadedCard=e,this._dirtyFor===e&&this.flushHistory(e)):(this._loadedCard=``,this.ensureHistory());return}this._saveTimer&&=(clearTimeout(this._saveTimer),0);let n=this._dirtyFor===t?this.serialize():null;this._dirtyFor=null,this.draftAttachments=[],this.messages=[],n&&t&&this.flushHistory(t,n),this.ensureHistory()}},mounted(){this.loadWidth(),this.loadCompact(),window.addEventListener(`resize`,this.onWinResize),window.addEventListener(`pagehide`,this.onPagehide),this.refreshConfig(),this.ensureHistory()},beforeUnmount(){window.removeEventListener(`resize`,this.onWinResize),window.removeEventListener(`pagehide`,this.onPagehide),this.stopTurnTimers(),this.stopTickers(),this.flushHistory(),this._abort&&this._abort.abort()},methods:{onWinResize(){this.winW=window.innerWidth},onImageClick(e){let t=e.target&&e.target.closest?e.target.closest(`img`):null;if(!t||t.dataset.noZoom===`1`)return;let n=Array.from(this.$el.querySelectorAll(`img`)).filter(e=>e.dataset.noZoom!==`1`),r=n.indexOf(t);r<0||rC(n.map(e=>({src:e.currentSrc||e.src,alt:e.alt||``,title:e.getAttribute(`title`)||e.closest(`[title]`)?.getAttribute(`title`)||``})),r)},loadWidth(){try{let e=localStorage.getItem(RP);if(e!=null){let t=parseInt(e,10);!Number.isNaN(t)&&t>=VP&&(this.widthPx=t)}}catch{}},saveWidth(){try{this.widthPx?localStorage.setItem(RP,String(Math.round(this.panelWidth))):localStorage.removeItem(RP)}catch{}},armGrip(){clearTimeout(this._gripTimer),this._gripTimer=setTimeout(()=>{this.gripArmed=!0},300)},disarmGrip(){clearTimeout(this._gripTimer),this._gripTimer=null,!this.resizing&&(this.gripArmed=!1)},startResize(e){let t=e&&e.currentTarget;if(!t||!this.gripArmed)return;this.resizing=!0,document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`;let n=e.pointerId;try{t.setPointerCapture(n)}catch{}let r=e=>{let t=Math.max(VP,Math.floor(window.innerWidth*HP));this.widthPx=Math.max(VP,Math.min(t,Math.round(window.innerWidth-e.clientX)))},i=()=>{t.removeEventListener(`pointermove`,r),t.removeEventListener(`pointerup`,i),t.removeEventListener(`pointercancel`,i),window.removeEventListener(`blur`,i);try{t.hasPointerCapture?.(n)&&t.releasePointerCapture(n)}catch{}this.resizing=!1,document.body.style.cursor=``,document.body.style.userSelect=``,this.saveWidth()};t.addEventListener(`pointermove`,r),t.addEventListener(`pointerup`,i),t.addEventListener(`pointercancel`,i),window.addEventListener(`blur`,i)},resetWidth(){this.widthPx=0,this.saveWidth()},async refreshConfig(){try{let e=await Pk();this.config={...e,hasKey:!!(e.hasKey||e.apiKey)},e.turnRunning!==void 0&&(this.turnRunning=e.turnRunning===!0)}catch{this.config={baseUrl:``,model:``,hasKey:!1,apiKeyMasked:``}}},async loadModels(){try{let e=await Ik();this.models=Array.isArray(e.models)?e.models:[],this.activeId=e.activeId||null,this.turnRunning=e.turnRunning===!0}catch{this.models=[],this.activeId=null}},openModelList(){this.modelListOpen=!0,this.loadModels(),this.refreshConfig()},closeModelList(){this.modelListOpen=!1},onModelAdd(){this.modelListOpen=!1,this.editModelId=null,this.editInitialModel=null,this.modelEditOpen=!0},onModelEdit(e){if(this.turnRunning&&e&&e.id===this.activeId)return this.notify(`warn`,KP);this.modelListOpen=!1,this.editModelId=e&&e.id?e.id:null,this.editInitialModel=e||null,this.modelEditOpen=!0},onModelEditClose(){this.modelEditOpen=!1,this.modelListOpen=!0},async onModelSaved(){this.modelEditOpen=!1,this.modelListOpen=!0,await this.loadModels(),await this.refreshConfig()},async onModelActivate(e){if(!(!e||!e.id)){if(this.turnRunning&&e.id!==this.activeId)return this.notify(`warn`,KP);try{await Hk(e.id)}catch(e){this.notify(`warn`,`切换模型失败:${e.message||e}`)}await this.loadModels(),await this.refreshConfig()}},onModelDelete(e){if(!(!e||!e.id)){if(this.turnRunning&&e.id===this.activeId)return this.notify(`warn`,KP);this.confirmDeleteModel=e}},async doDeleteModel(){let e=this.confirmDeleteModel;if(this.confirmDeleteModel=null,!(!e||!e.id)){try{await Vk(e.id)}catch(e){this.notify(`warn`,`删除失败:${e.message||e}`);return}await this.loadModels(),await this.refreshConfig(),this.notify(`ok`,`已删除模型「${e.name||e.model||e.id}」`)}},get deleteModelMessage(){let e=this.confirmDeleteModel;return`确定删除模型「${e?e.name||e.model||e.id:``}」吗?此操作不可撤销,配置将从 .env.cb.local 移除${e&&e.id===this.activeId?`。该模型当前为生效模型,删除后会自动回落到剩余模型中的第一条(若已无模型则需重新添加)。`:`。`}`},async onImportCcSwitch(){this.ccSwitchOpen=!0,this.ccSwitchLoading=!0,this.ccSwitchProviders=[],this.ccSwitchReason=``,this.ccSwitchSelected={};try{let e=await Lk(),t=Array.isArray(e.providers)?e.providers:[],n=this.models.map(e=>e.model).filter(Boolean);t.forEach(e=>{e.duplicate=n.includes(e.model)}),this.ccSwitchProviders=t,t.length||(this.ccSwitchReason=e.reason||`cc-switch 中没有可导入的 Codex 类供应商`)}catch(e){this.ccSwitchReason=`读取 cc-switch 失败:${e&&e.message||e}`}finally{this.ccSwitchLoading=!1}},toggleCcSwitchItem(e){if(!e||e.duplicate)return;let t={...this.ccSwitchSelected};t[e.id]?delete t[e.id]:t[e.id]=!0,this.ccSwitchSelected=t},async confirmImportCcSwitch(){let e=this.ccSwitchProviders.filter(e=>this.ccSwitchSelected[e.id]&&!e.duplicate);if(!e.length)return;let t=0,n=0;for(let r of e)try{await zk({name:r.name||r.model,baseUrl:r.baseUrl,apiKey:r.apiKey||``,model:r.model,maxTokens:0,thinking:!1,vision:!1}),t++}catch(e){n++,console.error(`[cc-switch 导入失败]`,r.name,e)}this.ccSwitchOpen=!1,await this.loadModels(),await this.refreshConfig(),n?this.notify(`warn`,`导入完成:成功 ${t} 个、失败 ${n} 个`):this.notify(`ok`,`已从 cc-switch 导入 ${t} 个模型`)},openCommon(){this.modelListOpen=!1,this.commonOpen=!0},async onCommonSaved(){this.commonOpen=!1,await this.refreshConfig(),this.notify(`ok`,`通用设置已保存`)},async ensureHistory(){let e=this.cardId;if(!(!e||this._loadedCard===e)){this._loadedCard=e,this.loadingHistory=!0;try{let t=await Zk(e);if(this.cardId!==e)return;let n=this.busy?this.turnId:``,r=(t.messages||[]).map(e=>this.revive(e)).filter(e=>!(n&&e.role===`assistant`&&e.turnId===n));this.archiveTrimmed=r.some(e=>e.trimmedArchive===!0);let i=new Set(r.map(e=>e.id)),a=this.messages.filter(e=>!i.has(e.id));this.messages=[...r,...a],this.contextUsage=null,this._dirtyFor=null,this.checkResumableTurn(),this.$nextTick(()=>this.scrollToBottom(!0))}catch{this.cardId===e&&(this.messages=[]),this._dirtyFor=null}finally{this.cardId===e&&(this.loadingHistory=!1)}}},serialize(){return this.messages.map(e=>{let t={id:e.id,role:e.role,content:e.content||``,ts:e.ts};return e.role===`assistant`?(t.reasoning=e.reasoning||``,t.reasoningMs=e.reasoningMs||0,t.error=e.error||``,e.errorCode&&(t.errorCode=e.errorCode),e.events?.length&&(t.events=e.events.map(e=>({ts:e.ts||0,level:e.level||`warn`,code:e.code||``,message:e.message||``}))),t.elapsedMs=e.elapsedMs||0,t.status=e.status===`streaming`?`aborted`:e.status||`done`,e.turnId&&(t.turnId=e.turnId),e.serverAuthored&&(t.serverAuthored=!0),e.budget?.message&&(t.budget={reason:e.budget.reason||``,message:e.budget.message}),e.usage&&(t.usage=e.usage),e.toolCalls?.length&&(t.toolCalls=e.toolCalls.map(e=>({toolCallId:e.toolCallId,toolName:e.toolName,args:e.args||{},result:e.result,error:e.error||``,ms:e.ms||0,startedAt:e.startedAt||0,command:e.command||``,approvalNote:e.approvalNote||``,autoApproved:!!e.autoApproved})))):e.attachments?.length&&(t.attachments=e.attachments.map(e=>({path:e.path,name:e.name,isDir:!!e.isDir,isImage:!!e.isImage,size:e.size||0,entryCount:e.entryCount||0,exists:e.exists!==!1}))),t})},revive(e){return{id:e.id||GP(),role:e.role===`user`?`user`:`assistant`,content:e.content||``,narrationChars:Math.max(0,Number(e.narrationChars)||0),reasoning:e.reasoning||``,reasoningMs:e.reasoningMs||0,elapsedMs:Number(e.elapsedMs)||0,toolCalls:Array.isArray(e.toolCalls)?e.toolCalls.map(t=>(e.status===`aborted`||e.status===`streaming`)&&t&&!t.error&&t.result==null?{...t,error:`已终止:该调用未拿到结果(轮次被中断)`}:t):[],attachments:Array.isArray(e.attachments)?e.attachments:[],events:Array.isArray(e.events)?e.events:[],error:e.error||``,errorCode:e.errorCode||``,trimmedArchive:e.trimmedArchive===!0,status:e.status||`done`,turnId:e.turnId||``,serverAuthored:e.serverAuthored===!0,budget:e.budget?.message?{reason:e.budget.reason||``,message:e.budget.message}:void 0,ts:e.ts||0}},persist(){this.cardId&&(this._dirtyFor=this.cardId,this._saveTimer&&clearTimeout(this._saveTimer),this._saveTimer=setTimeout(()=>this.flushHistory(),500))},fitArchive(e){if(TP(e)<=4e6)return e;let t=OP(e,!1);return TP(t)>4e6&&(t=OP(t,!0)),this.archiveTrimmed=!0,t},async flushHistory(e=this.cardId,t=null){if(this._saveTimer&&=(clearTimeout(this._saveTimer),0),e){if(this._saving){this._saveTimer=setTimeout(()=>this.flushHistory(e,t),800);return}this._saving=!0;try{await Qk(e,this.fitArchive(t||this.serialize())),this._dirtyFor===e&&(this._dirtyFor=null)}catch(e){this.notify(`warn`,`对话记录保存失败:${e.message||e}`)}finally{this._saving=!1}}},migrateCard(e,t){!e||!t||e===t||this.cardId===e&&(this._saveTimer&&=(clearTimeout(this._saveTimer),0),this._cardRenamedTo=t,this._dirtyFor===e&&(this._dirtyFor=t))},discardCard(e){e&&(this._saveTimer&&=(clearTimeout(this._saveTimer),0),this._dirtyFor===e&&(this._dirtyFor=null),(this._loadedCard===e||this.cardId===e)&&(this.busy&&this._abort&&this._abort.abort(),this.messages=[],this.draftAttachments=[],this.contextUsage=null,this._loadedCard=``))},askClear(){this.messages.length&&(this.confirmClear=!0)},async doClear(){this.confirmClear=!1;let e=this.cardId;this.messages=[],this.contextUsage=null,this._loadedCard=e,this._dirtyFor=null,this._saveTimer&&=(clearTimeout(this._saveTimer),0);try{await $k(e),this.notify(`ok`,`已清空本卡片的对话记录`)}catch(e){this.notify(`warn`,`清空失败:${e.message||e}`)}},async onPick(e){try{let t=await Gk(e);if(t.cancelled)return;for(let e of t.items||[])this.pushAttachment(e);t.items?.length||this.notify(`warn`,`未选到可用文件`)}catch(e){this.notify(`warn`,e.message||`无法调起系统选择器,可改用拖拽或粘贴路径`)}},async onAddPath(e){try{let t=await Kk(e);this.pushAttachment(t)}catch(t){this.notify(`warn`,`路径不可用:${e}(${t.message||t})`)}},async onPasteImage(e){try{let t=await Yk(e);this.pushAttachment(t,`粘贴的截图已存到本机 .cache/ai-attachments/`)}catch(e){this.notify(`warn`,`截图保存失败:${e.message||e}`)}},async onDropFiles(e){let t=Array.from(e.items||[]).map(e=>e.webkitGetAsEntry?e.webkitGetAsEntry():null).filter(Boolean),n=Array.from(e.files||[]),r=[];if(t.length)for(let e of t)r.push(this.resolveEntry(e));else for(let e of n)r.push(this.resolveFile(e));if(!r.length){this.notify(`warn`,`没有识别到可挂载的文件`);return}let i=(await Promise.all(r)).filter(e=>e!==`cancelled`&&!e).length;i&&this.notify(`warn`,`${i} 项未能定位本机路径,可改用「粘贴路径」添加`)},async resolveEntry(e){if(e.isDirectory){let t=await this.firstFileInDir(e);return this.resolveByName(e.name,e.fullPath||e.name,t?.size??-1,t?.name||``)}let t=await this.entryToFile(e);return t?this.resolveFile(t):this.resolveByName(e.name,e.fullPath||e.name,-1)},async resolveFile(e){return this.resolveByName(e.name,e.webkitRelativePath||e.name,e.size)},async resolveByName(e,t,n,r=``){let i={id:GP(`att`),path:``,name:e,isDir:!1,isImage:!1,pending:!0};this.draftAttachments=[...this.draftAttachments,i];try{let a=await Jk(qk({name:e,relPath:t,size:n,child:r}),zP,`locate`);return i.removed?`cancelled`:(this.pushAttachment(a),a)}catch{return i.removed?`cancelled`:null}finally{this.draftAttachments=this.draftAttachments.filter(e=>e.id!==i.id)}},entryToFile(e){return new Promise(t=>{try{e.file(e=>t(e),()=>t(null))}catch{t(null)}})},firstFileInDir(e){return new Promise(t=>{try{e.createReader().readEntries(async e=>{for(let n of e||[])if(!n.isDirectory){let e=await this.entryToFile(n);if(e)return t(e)}t(null)},()=>t(null))}catch{t(null)}})},pushAttachment(e,t){e?.path&&(this.draftAttachments.some(t=>t.path===e.path)||(this.draftAttachments=[...this.draftAttachments,{...e,note:t}],t&&this.notify(`ok`,t)))},removeAttachment(e){if(!e)return;let t=this.draftAttachments.find(t=>(t.id||t.path)===e);t&&t.pending&&(t.removed=!0),this.draftAttachments=this.draftAttachments.filter(t=>(t.id||t.path)!==e)},cancelPendingLocates(){for(let e of this.draftAttachments)e.pending&&(e.removed=!0)},useSuggestion(e){this.$refs.composerEl?.setText(e.text),this.trackSuggest(e)},shuffleSuggestions(){let e=this.suggestBatch.length;e&&(this.suggestOffset=(this.suggestOffset+4)%e)},trackSuggest(e){if(!(!e||!e.id)){this.suggestStats[e.id]=(this.suggestStats[e.id]||0)+1;try{window.dispatchEvent(new CustomEvent(`cardbuddy:suggest`,{detail:{id:e.id,label:e.label,weight:e.weight,batch:this.suggestBatchKey}}))}catch{}}},async onSend({text:e,attachments:t}){if(this.busy||!await this.ensureConfig())return;this.notice=null;let n={id:GP(`u`),role:`user`,content:e,attachments:t.map(e=>({...e})),ts:Date.now()};this.messages.push(n),this.cancelPendingLocates(),this.draftAttachments=[],this.pinned=!0,await this.runTurn({retractMsgId:n.id,draft:{text:e,attachments:n.attachments}})},async ensureConfig(){return await this.refreshConfig(),this.configReady?!0:(this.modelListOpen=!0,this.loadModels(),this.notify(`warn`,`请先在模型库中添加并配置模型(Base URL / API Key / 模型名)`),!1)},onPickBoard(e){if(this.busy)return;let t=ck(e,this.cardId);t&&this.onSend({text:t,attachments:[]})},onContinue(){this.busy||this.onSend({text:`继续`,attachments:[]})},async regenerate(e){if(this.busy)return;let t=this.messages.findIndex(t=>t.id===e.id);t>0&&(this.messages=this.messages.slice(0,t)),await this.runTurn()},async runTurn(e={}){this.messages.push({id:GP(`a`),role:`assistant`,content:``,narrationChars:0,reasoning:``,reasoningMs:0,toolCalls:[],events:[],error:``,status:`streaming`,ts:Date.now()});let t=this.messages[this.messages.length-1],n=t.id;this.busy=!0,this.pinned=!0,this.startTurn();let r=new AbortController;this._abort=r;let i=!1,a=Date.now(),o=()=>{t.reasoning&&!t.reasoningMs&&(t.reasoningMs=Date.now()-a)};try{await tA({messages:this.toWire(this.messages.filter(e=>e.id!==n)),cardContext:this.cardId?{id:this.cardId}:void 0,attachments:this.lastAttachments(),signal:r.signal,onEvent:e=>this.onEvent(e,t,o)}),t.status===`streaming`&&(t.status=`done`)}catch(a){let s=r.signal.aborted||/abort/i.test(String(a?.message||a));o(),a?.code===`turn-in-flight`?(i=!0,this.messages=this.messages.filter(t=>t.id!==n&&t.id!==e.retractMsgId),e.draft&&(this.draftAttachments=(e.draft.attachments||[]).map(e=>({...e})),this.$refs.composerEl?.setText(e.draft.text||``)),this.notify(`warn`,String(a?.message||`这张卡片已有一个回合在跑:请先终止或等它结束,再发新消息`)),this.$nextTick(()=>this.checkResumableTurn())):s?t.status=`aborted`:await this.reattachAfterDrop(t,o)?this.pushEvent(t,{level:`info`,code:`stream-resumed`,message:`已接回本回合,继续跟随进度`}):(t.error=String(a?.message||a),t.errorCode=String(a?.code||``),t.status=`error`)}finally{o(),this.endTurn(t,{rejected:i})}},endTurn(e,{rejected:t=!1}={}){e.status===`streaming`&&(e.status=`done`),t||(e.elapsedMs=Math.max(0,Date.now()-this.turnStartedAt)),this.busy=!1,this._abort=null,this.stopTurnTimers(),this.persist(),this.$emit(`busy`,!1),t||this.$emit(`turn-finished`,{status:e.status,error:e.error||``,steps:this.turnStep,ms:Date.now()-this.turnStartedAt,startedAt:this.turnStartedAt,finishedAt:Date.now(),turnId:this.turnId||e.turnId||``}),this.$nextTick(()=>this.scrollToBottom())},async checkResumableTurn(){let e=this.cardId;if(!(!e||this.busy||this._resumeProbe)){this._resumeProbe=!0;try{let t;try{t=await nA(e)}catch{return}let n=t&&t.active;if(!n||!n.turnId||this.cardId!==e||this.busy)return;await this.attachToTurn({cardId:e,turnId:String(n.turnId),startedAt:Number(n.startedAt)||0,afterSeq:0,note:n.detached?`接回一个仍在服务端运行的回合(上次连接已中断,进度与已落盘产物都在)`:`接回本回合的实时进度`})}finally{this._resumeProbe=!1}}},async attachToTurn({cardId:e,turnId:t,startedAt:n=0,afterSeq:r=0,note:i=``}){let a=this.messages.find(e=>e.role===`assistant`&&e.turnId===t);a||=(this.messages.push({id:GP(`a`),role:`assistant`,content:``,narrationChars:0,reasoning:``,reasoningMs:0,toolCalls:[],events:[],error:``,status:`streaming`,ts:n||Date.now(),turnId:t}),this.messages[this.messages.length-1]),a.content=``,a.reasoning=``,a.reasoningMs=0,a.toolCalls=[],a.events=[],a.error=``,a.errorCode=``,a.budget=void 0,a.status=`streaming`,a.turnId=t,this.busy=!0,this.pinned=!0,this.startTurn(),this.turnId=t,this.lastSeq=Number(r)||0,n&&(this.turnStartedAt=n,a.ts=n);let o=new AbortController;this._abort=o;let s=n||Date.now(),c=()=>{a.reasoning&&!a.reasoningMs&&(a.reasoningMs=Date.now()-s)};i&&this.notify(`warn`,i);try{this.lastSeq=await iA({cardId:e,turnId:t,afterSeq:this.lastSeq,signal:o.signal,onEvent:e=>this.onEvent(e,a,c)})}catch(e){o.signal.aborted||/abort/i.test(String(e?.message||e))||(a.error=String(e?.message||e),a.errorCode=String(e?.code||``),a.status=`error`)}finally{c(),this.endTurn(a)}},async reattachAfterDrop(e,t){let n=this.cardId,r=this.turnId||e.turnId,i=this._abort;if(!n||!r||!i||i.signal.aborted)return!1;try{return this.pushEvent(e,{level:`warn`,code:`stream-dropped`,message:`连接中断:正在按断点续订本回合(服务端仍在跑,已执行的写入不受影响)`}),this.lastSeq=await iA({cardId:n,turnId:r,afterSeq:this.lastSeq,signal:i.signal,onEvent:n=>this.onEvent(n,e,t)}),!0}catch{return!1}},onEvent(e,t,n){this.lastByteAt=Date.now();let r=Number(e.seq)||0;switch(r>this.lastSeq&&(this.lastSeq=r),e.type){case`turn-start`:e.turnId&&(this.turnId=String(e.turnId),t.turnId=String(e.turnId)),Number(e.startedAt)&&(this.turnStartedAt=Number(e.startedAt),t.ts=Number(e.startedAt));break;case`client-detached`:this.pushEvent(t,{level:`info`,code:`client-detached`,message:`连接曾中断,回合在服务端继续跑(事件已全部落日志)`});break;case`turn-end`:(e.status===`aborted`||e.status===`error`)&&(t.status=e.status),e.usage&&this.applyUsage(t,e.usage);break;case`usage`:this.applyUsage(t,e);break;case`reasoning-delta`:t.reasoning+=e.text||``;break;case`text-delta`:n(),t.content+=e.text||``;break;case`tool-call-start`:n(),t.content&&(t.narrationChars=t.content.length),this.findToolRow(t,e)||t.toolCalls.push({toolCallId:e.toolCallId||GP(`tc`),toolName:e.toolName,args:{},pending:!0,result:void 0,error:``,startedAt:Date.now(),ms:0});break;case`tool-call`:{n(),t.content&&(t.narrationChars=t.content.length);let r=this.findToolRow(t,e);r?(e.toolCallId&&(r.toolCallId=e.toolCallId),e.toolName&&(r.toolName=e.toolName),r.args=e.args||{},r.pending=!1):t.toolCalls.push({toolCallId:e.toolCallId||GP(`tc`),toolName:e.toolName,args:e.args||{},result:void 0,error:``,startedAt:Date.now(),ms:0});break}case`tool-result`:{let n=t.toolCalls.find(t=>t.toolCallId===e.toolCallId||!e.toolCallId&&t.toolName===e.toolName&&t.result===void 0);n&&(n.result=e.result??``,n.truncated=!!e.truncated,e.error&&(n.error=String(e.error)),e.image&&(n.image=e.image),n.ms=Date.now()-(n.startedAt||Date.now())),this.persist();break}case`approval-request`:{let n=this.findToolRow(t,e)||t.toolCalls[t.toolCalls.length-1];n&&n.toolName===e.toolName&&n.result===void 0?(n.approvalId=e.approvalId,e.command&&(n.command=e.command),n.needsApproval=!0):t.toolCalls.push({toolCallId:e.toolCallId||GP(`tc`),toolName:e.toolName,args:e.args||{},command:e.command||``,approvalId:e.approvalId,needsApproval:!0,result:void 0,error:``,startedAt:Date.now(),ms:0});break}case`approval-decided`:{let n=(t.toolCalls||[]).find(t=>t.approvalId===e.approvalId);n&&(n.needsApproval=!1,n.approvalNote=e.ok?e.scope===`turn`?`已允许,本回合后续同类执行不再询问…`:`已允许,执行中…`:e.reason||`已拒绝执行`);break}case`approval-auto`:{let n=this.findToolRow(t,e)||[...t.toolCalls||[]].reverse().find(t=>t.toolName===e.toolName&&t.result===void 0);n&&(e.command&&(n.command=e.command),n.autoApproved=!0,n.approvalNote=`按设置免确认执行`);break}case`notice`:{let n=e.level===`info`||e.level===`error`?e.level:`warn`;this.pushEvent(t,{level:n,code:e.code||``,message:e.message||``}),n!==`info`&&this.notify(n===`error`?`danger`:`warn`,e.message||``);break}case`round-retry`:{let n=Number(e.dropReasoning)||0,r=Number(e.dropText)||0,i=Number(e.dropTools)||0;n>0&&(t.reasoning=t.reasoning.slice(0,Math.max(0,t.reasoning.length-n))),r>0&&(t.content=t.content.slice(0,Math.max(0,t.content.length-r))),i>0&&t.toolCalls.splice(Math.max(0,t.toolCalls.length-i),i),t.reasoning||(t.reasoningMs=0),this.pushEvent(t,{level:`warn`,code:`retry-${e.reason||`unknown`}`,message:e.message||``}),this.notify(`warn`,e.message||``);break}case`context-usage`:this.contextUsage={used:Number(e.used)||0,total:Number(e.total)||0,window:Number(e.window)||0};break;case`turn-ended`:t.budget={reason:String(e.reason||``),message:String(e.message||``)};break;case`error`:t.error=t.error?`${t.error}\n${e.message}`:String(e.message||``),e.code&&(t.errorCode=String(e.code)),t.status=`error`;break;case`aborted`:t.status=`aborted`}let i=t.toolCalls||[];this.turnStep=i.length;let a=i[i.length-1];if(a){this.turnToolLabel=`正在${FO(a.toolName)}…`;let e=HO(a);e&&(!this.turnStage||e.order>this.turnStage.order)&&(this.turnStage=e)}this.$nextTick(()=>this.scrollToBottom())},async onApproval({tc:e,ok:t,scope:n=`once`}){if(e?.approvalId){e.needsApproval=!1,e.approvalNote=t?n===`turn`?`已允许,本回合后续同类执行不再询问…`:`已允许,执行中…`:`已拒绝执行`;try{await Xk({approvalId:e.approvalId,ok:t,scope:n})}catch(e){this.notify(`warn`,`审批提交失败:${e.message}`)}}},findToolRow(e,t){let n=e.toolCalls||[];if(t.toolCallId){let e=n.find(e=>e.toolCallId===t.toolCallId);if(e)return e}return n.find(e=>e.pending&&e.toolName===t.toolName)||null},stop(){this.confirmStop=!1;let e=this._abort,t=this.cardId,n=this.turnId||``;t&&n&&rA(t).catch(e=>{e?.code!==`no-turn`&&this.notify(`warn`,`终止请求未送达:${e.message}`)}),e&&(e.abort(),this.notify(`ok`,`已终止本次生成`))},doStop(){this.stop()},onEscape(){if(this.confirmStop){this.confirmStop=!1;return}if(this.confirmDeleteModel){this.confirmDeleteModel=null;return}if(this.commonOpen){this.commonOpen=!1;return}if(this.modelListOpen||this.modelEditOpen){this.modelListOpen=!1,this.modelEditOpen=!1;return}if(this.busy){this.confirmStop=!0;return}this.$emit(`close`)},lastAttachments(){for(let e=this.messages.length-1;e>=0;e--){let t=this.messages[e];if(t.role===`user`)return(t.attachments||[]).map(e=>({path:e.path,name:e.name,isDir:e.isDir,isImage:e.isImage}))}return[]},toWire(e){return e.map(e=>{if(e.role===`user`){let t=e.attachments||[],n=e.content||``;if(t.length){let e=t.map(e=>`- ${e.isDir?`文件夹`:e.isImage?`图片`:`文件`}:${e.path}`);n=`${n}${n?`
|
|
281
284
|
|
|
282
285
|
`:``}[已挂载本地文件(仅本机路径,未上传;需要内容请用工具读取)]\n${e.join(`
|
|
283
|
-
`)}`}return{role:`user`,content:n}}let t=(e.toolCalls||[]).filter(e=>e.result!==void 0||e.error).map(e=>({toolCallId:e.toolCallId,toolName:e.toolName,args:e.args||{},result:typeof e.result==`string`?e.result.slice(0,
|
|
284
|
-
输入区拖高 / 反馈条出现都不会把它盖住或悬空 `),
|
|
285
|
-
长任务里「还活着吗」全靠这一行——旧版只有一句「生成中…」,网关静默与真在跑无从区分 `),i.busy?(B(),V(`div`,{key:0,class:j([`aichat__live`,{"is-stalled":a.stalled}]),role:`status`,"aria-live":`polite`},[t[35]||=U(`span`,{class:`aichat__live-dot`},null,-1),U(`span`,RP,M(a.liveText),1),a.stalled?(B(),V(`button`,{key:0,type:`button`,class:`aichat__live-act`,title:`连接可能已中断,终止本轮(已落盘的产物会保留)`,onClick:t[11]||=(...e)=>a.stop&&a.stop(...e)},` 终止 `)):K(`v-if`,!0)],2)):K(`v-if`,!0)],64)):(B(),V(`div`,DP,[t[34]||=U(`span`,{class:`aichat__empty-logo`},[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-sparkles`})])],-1),U(`p`,OP,M(a.emptyTitle),1),U(`p`,kP,M(a.emptyDesc),1),U(`div`,AP,[(B(!0),V(z,null,R(a.suggestions,e=>(B(),V(`button`,{key:e.id,type:`button`,class:j([`aichat__suggest`,`is-${e.weight}`]),title:e.text,"data-suggest-id":e.id,onClick:t=>a.useSuggestion(e)},[(B(),V(`svg`,MP,[U(`use`,{href:e.icon},null,8,NP)])),U(`span`,PP,[U(`span`,FP,M(e.label),1),U(`span`,IP,M(e.hint),1)]),e.weight===`write`?(B(),V(`span`,LP,`改卡`)):K(`v-if`,!0)],10,jP))),128)),a.canShuffle?(B(),V(`button`,{key:0,type:`button`,class:`aichat__suggest-shuffle`,onClick:t[9]||=(...e)=>a.shuffleSuggestions&&a.shuffleSuggestions(...e)},[...t[33]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-refresh`})],-1),U(`span`,null,`换一批`,-1)]])):K(`v-if`,!0)])]))],544),K(` 回到底部:脱离底部吸附时出现 `),I(U(`button`,{type:`button`,class:`aichat__jump`,title:`回到底部`,onClick:t[13]||=e=>a.scrollToBottom(!0)},[...t[36]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-arrow-down`})],-1)]],512),[[Sc,!i.pinned&&i.messages.length]])]),K(` 常驻「常用」指令:有对话后空态建议区不再出现,这里保留一排轻量入口,随上下文同源 `),a.quickChips.length&&i.messages.length&&!i.busy?(B(),V(`div`,zP,[(B(!0),V(z,null,R(a.quickChips,e=>(B(),V(`button`,{key:e.id,type:`button`,class:j([`aichat__chip`,`is-${e.weight}`]),title:e.text,"data-suggest-id":e.id,onClick:t=>a.useSuggestion(e)},[(B(),V(`svg`,VP,[U(`use`,{href:e.icon},null,8,HP)])),U(`span`,null,M(e.label),1)],10,BP))),128))])):K(`v-if`,!0),K(` 操作反馈(附件解析失败 / 历史保存失败等) `),i.notice?(B(),V(`div`,{key:2,class:j([`aichat__notice`,`aichat__notice--${i.notice.type}`])},[U(`span`,null,M(i.notice.text),1),U(`button`,{type:`button`,class:`aichat__notice-x`,title:`关闭`,onClick:t[14]||=e=>i.notice=null},[...t[37]||=[U(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-x`})],-1)]])],2)):K(`v-if`,!0),W(s,{ref:`composerEl`,busy:i.busy,model:i.config.model,attachments:i.draftAttachments,placeholder:a.configReady?`描述你要改的卡片,Enter 发送 / Shift+Enter 换行`:`请先在设置中配置模型…`,context:i.contextUsage,onSend:a.onSend,onStop:a.stop,onPick:a.onPick,onAddPath:a.onAddPath,onRemoveAttachment:a.removeAttachment,onDropFiles:a.onDropFiles,onPasteImage:a.onPasteImage,onEscape:a.onEscape},null,8,[`busy`,`model`,`attachments`,`placeholder`,`context`,`onSend`,`onStop`,`onPick`,`onAddPath`,`onRemoveAttachment`,`onDropFiles`,`onPasteImage`,`onEscape`]),K(` 一级面板:模型库。从齿轮 / 横幅 / 消息内「去设置」进入 `),i.modelListOpen?(B(),H(c,{key:3,models:i.models,"active-id":i.activeId,"turn-running":i.turnRunning,onClose:a.closeModelList,onAdd:a.onModelAdd,onEdit:a.onModelEdit,onDelete:a.onModelDelete,onActivate:a.onModelActivate,onImportCcswitch:a.onImportCcSwitch,onOpenCommon:a.openCommon},null,8,[`models`,`active-id`,`turn-running`,`onClose`,`onAdd`,`onEdit`,`onDelete`,`onActivate`,`onImportCcswitch`,`onOpenCommon`])):K(`v-if`,!0),K(` 新增 / 编辑模型:复用 AiSettings(modelId 区分,initialModel 预填) `),i.modelEditOpen?(B(),H(l,{key:4,config:i.config,"model-id":i.editModelId,"initial-model":i.editInitialModel,onClose:a.onModelEditClose,onSaved:a.onModelSaved},null,8,[`config`,`model-id`,`initial-model`,`onClose`,`onSaved`])):K(`v-if`,!0),K(` 删除模型确认:二次确认后才真正落盘删除 `),W(u,{visible:!!i.confirmDeleteModel,"close-on-mask":!1,title:`删除模型`,message:a.deleteModelMessage,"confirm-text":`删除`,severity:`danger`,onConfirm:a.doDeleteModel,onCancel:t[15]||=e=>i.confirmDeleteModel=null},null,8,[`visible`,`message`,`onConfirm`]),K(` cc-switch 导入弹窗:列出 cc-switch 的 Codex 类供应商,勾选后批量导入模型库(按 model 去重) `),W(ic,{name:`modal`},{default:Lr(()=>[i.ccSwitchOpen?(B(),V(`div`,{key:0,class:`ni-overlay`,onClick:t[19]||=q(e=>i.ccSwitchOpen=!1,[`self`])},[U(`div`,UP,[U(`div`,WP,[t[38]||=U(`span`,{class:`ni-title`},`从 cc-switch 导入`,-1),U(`button`,{class:`ni-close`,type:`button`,title:`关闭`,onClick:t[16]||=e=>i.ccSwitchOpen=!1})]),U(`div`,GP,[U(`div`,KP,[K(` 加载中 `),i.ccSwitchLoading?(B(),V(`p`,qP,`正在读取 cc-switch 供应商…`)):i.ccSwitchReason?(B(),V(z,{key:1},[K(` 无可导入项 `),U(`p`,JP,M(i.ccSwitchReason),1)],2112)):(B(),V(z,{key:2},[K(` 供应商列表 `),U(`ul`,YP,[(B(!0),V(z,null,R(i.ccSwitchProviders,e=>(B(),V(`li`,{key:e.id,class:j([`ccsw-dlg__item`,{"is-active":i.ccSwitchSelected[e.id],"is-dup":e.duplicate}]),onClick:t=>a.toggleCcSwitchItem(e)},[U(`span`,{class:j([`ccsw-dlg__check`,{"is-on":i.ccSwitchSelected[e.id]}])},[i.ccSwitchSelected[e.id]?(B(),V(`svg`,ZP,[...t[39]||=[U(`use`,{href:`#icon-check`},null,-1)]])):K(`v-if`,!0)],2),U(`span`,QP,[U(`span`,$P,[G(M(e.name||e.model)+` `,1),e.isCurrent?(B(),V(`span`,eF,`当前`)):K(`v-if`,!0),e.duplicate?(B(),V(`span`,tF,`已存在`)):K(`v-if`,!0)]),U(`span`,nF,[U(`span`,rF,M(e.model),1),t[40]||=U(`span`,{class:`ccsw-dlg__dot`},`·`,-1),U(`span`,iF,M(e.baseUrl),1)])])],10,XP))),128))])],2112))])]),U(`div`,aF,[U(`span`,oF,M(a.ccSwitchDupCount>0?`已有 ${a.ccSwitchDupCount} 个重复模型被自动跳过`:`勾选要导入的供应商,批量加入模型库`),1),U(`div`,sF,[U(`button`,{class:`ni-btn ni-btn--ghost`,type:`button`,onClick:t[17]||=e=>i.ccSwitchOpen=!1},`取消`),U(`button`,{class:`ni-btn`,type:`button`,disabled:i.ccSwitchLoading||!i.ccSwitchProviders.length||a.ccSwitchCheckedCount===0,onClick:t[18]||=(...e)=>a.confirmImportCcSwitch&&a.confirmImportCcSwitch(...e)},M(a.ccSwitchCheckedCount>0?`导入选中 ${a.ccSwitchCheckedCount} 项`:`导入`),9,cF)])])])])):K(`v-if`,!0)]),_:1}),K(` 通用设置:所有模型共享的执行策略 / 环境参数 `),i.commonOpen?(B(),H(d,{key:5,onClose:t[20]||=e=>i.commonOpen=!1,onSaved:a.onCommonSaved},null,8,[`onSaved`])):K(`v-if`,!0),W(u,{visible:i.confirmClear,"close-on-mask":!1,title:`清空对话记录`,message:`将删除卡片「${n.cardName||n.cardId||`当前卡片`}」的全部对话记录,此操作不可撤销。`,"confirm-text":`清空`,severity:`danger`,onConfirm:a.doClear,onCancel:t[21]||=e=>i.confirmClear=!1},null,8,[`visible`,`message`,`onConfirm`]),K(` 终止确认:生成中按 Esc 会走到这里。几十分钟的建卡被一次误按抹掉代价太大,故加一道确认 `),W(u,{visible:i.confirmStop,"close-on-mask":!1,title:`终止本次生成`,message:`已执行的写入与落盘产物都会保留,上下文也留在对话里,之后回复「继续」可从中断处接着做。确定现在终止?`,"confirm-text":`终止生成`,severity:`danger`,onConfirm:a.doStop,onCancel:t[22]||=e=>i.confirmStop=!1},null,8,[`visible`,`onConfirm`])],38)}var uF=X(mP,[[`render`,lF],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ChatPanel.vue`]]),dF=`/assets/site-icon-CFMif8z4.png`,fF={includeMocks:!0},pF=2500,mF=new eu,hF=au({},mF);typeof window<`u`&&(window.__rt=hF);var gF=188,_F=320,vF=200,yF=160,bF={name:`App`,components:{RenderTree:ap,DebugPanel:wy,ApiCallPanel:By,CardSelect:ib,AlertCardLayer:mb,DeviceOverlay:Yb,PickerOverlay:ix,DatePickerOverlay:yx,SelectionOverlay:Cx,HoverGuides:kx,RemotePreview:_S,AppToast:TS,ImageLightbox:GS,ConfirmDialog:_p,CardGallery:fC,NewCardDialog:MC,ComponentPalette:qC,Switch:ZC,ChatPanel:uF},provide(){return{adapter:mF,cardRuntime:hF,customComponents:{}}},data(){return{adapter:mF,rt:hF,logoUrl:dF,appVersion:`0.44.2`,cardList:[],cardCount:0,galleryOpen:!1,cardDialog:{visible:!1,mode:`create`,cardId:``,cardDesc:``},selectedId:``,externalReloadNote:``,externalReloadTimer:null,selfSaveId:``,selfSaveAt:0,preview:null,chromeOff:!1,theme:`dark`,cardReady:!1,reloadToken:0,moveCollapseToken:0,refreshing:!1,loadingCard:!1,currentSchema:null,currentCard:null,cardImportMeta:null,localSchema:null,localData:null,selectedNodeId:``,activeTab:`vars`,apiPanelOpen:!0,addNodePanelOpen:!1,addNodeTarget:null,validateBadge:{state:`idle`,errors:0,warnings:0,renderOk:null,ts:0},validateTimer:null,copiedSchema:!1,copyTimer:null,savedCard:!1,savingCard:!1,saveTimer:null,savingRemote:!1,savedRemote:!1,verifiedRemote:null,saveRemoteTimer:null,syncingRemote:!1,syncedRemote:!1,remotePreviewOpen:!1,syncTarget:null,syncTimer:null,uploadingSlices:!1,loginModal:!1,loginName:``,loginPassword:``,loginSubmitting:!1,loginError:``,confirm:{show:!1,title:``,message:``,confirmText:`继续`,cancelText:`取消`,severity:`primary`,onConfirm:null},past:[],future:[],baseline:null,_commitTimer:null,viewportHeight:700,canvasBg:`gray`,refreshing:!1,bgOptions:[{key:`checker`,label:`棋盘`},{key:`white`,label:`白色`},{key:`gray`,label:`浅灰`},{key:`black`,label:`黑色`}],_previewWidthPx:372,_apiPanelWidthPx:360,presetSizes:[{key:375,value:`375`},{key:430,value:`430`},{key:188,value:`188`}],stageWidth:typeof window<`u`?window.innerWidth:1280,colsWidth:0,stageHeight:typeof window<`u`?window.innerHeight-52:748,dragging:!1,apiDragging:!1,armedLeft:!1,armedApi:!1,_armTimerLeft:null,_armTimerApi:null,_stageObserver:null,devServiceOpen:!1,aiChatOpen:(()=>{try{return sessionStorage.getItem(`cardbuddy:ai-chat-open`)===`1`}catch{return!1}})(),chatBusy:!1,chatProgress:null,devServiceForm:Nl(),apiBaseResolved:Fl(),devSvcLive:`unknown`,devSvcDown:!1,_unsubCardsChanged:null}},computed:{fabTitle(){if(this.aiChatOpen)return`AI 开发助手(已打开)`;if(!this.chatBusy)return`AI 开发助手`;let e=this.chatProgress,t=e&&e.startedAt?`${oO(e.startedAt)} 开始 · `:``;return`AI 开发助手正在生成(${e?`${t}第 ${e.steps} 步 · 已用 ${aO(e.ms)}${e.stage?` · ${e.stage}`:``}${e.stalled?` · 疑似断流`:``}`:``}),点击展开查看`},currentBg(){return this.bgOptions.find(e=>e.key===this.canvasBg)||this.bgOptions[0]},cardIds(){return this.cardList.map(e=>e&&e.id).filter(Boolean)},canUndo(){return this.past.length>0},canRedo(){return this.future.length>0},devSvcBlockReason(){let e=this.devServiceForm||{};return String(e.baseUrl||``).trim()?e.enabled?null:`disabled`:`empty`},canPaste(){return!!Hu()},hasCardSource(){return!!(this.cardImportMeta&&this.cardImportMeta.source)},historyDirty(){return!this.localSchema||!this.currentSchema?!1:!this.structuralEqual(this.currentSchema,this.localSchema)||!this.dataEqual(this.rt&&this.rt.rootScope,this.localData)},devSvcConn(){return this.apiBaseResolved===null?`unconfigured`:this.devSvcLive===`open`?`open`:this.devSvcDown?`closed`:`connecting`},devSvcTitle(){if(this.apiBaseResolved===null)return this.devSvcBlockReason===`disabled`?`已填地址但未开启用本地服务`:`未配置本地开发服务(部署态必填)`;let e=this.apiBaseResolved===``?`同源开发服务`:`本地开发服务`;return this.devSvcLive===`open`?e+`已连接`:this.devSvcDown?e+`已断开(连接失败或服务已停止,重连中…)`:e+`连接中 / 重连中…`},devSvcClass(){return this.apiBaseResolved===null?`app__btn--warn`:this.devSvcLive===`open`?`app__btn--connected`:this.devSvcDown?`app__btn--disconnected`:`app__btn--reconnecting`},devSvcLabel(){return this.apiBaseResolved===null?`未配置本地服务`:this.devSvcLive===`open`?`本地服务已连接`:this.devSvcDown?`本地服务已断开`:`本地服务连接中…`},badgeText(){return{idle:`待校验`,pending:`校验中…`,ok:`校验通过`,error:`校验未通过`,nopython:`未配置校验`,fail:`校验服务异常`}[this.validateBadge.state]||`待校验`},badgeTitle(){let e=this.validateBadge;if(e.state===`ok`)return`结构合法 + 渲染不抛错(不保证画得对,视觉正确性见截图)`;if(e.state===`error`){let t=[];return e.errors&&t.push(`契约错误 ${e.errors} 个`),e.renderOk===!1&&t.push(`渲染抛出异常`),`校验未通过:`+(t.join(`;`)||`详见 /__validate 与 /__render-status`)}return e.state===`nopython`?`未找到 python3/python,无法跑契约校验(请安装 Python 或设置 DSL_PYTHON)`:e.state===`fail`?`校验服务异常(dev server 未启动或端点不可用)`:``},previewWidth(){if(this.chromeOff)return this.stageWidth;let{min:e,max:t}=this.previewBounds,n=this._previewWidthPx||gF;return Math.max(e,Math.min(t,n))},viewportWidth(){return this.stageWidth,typeof window<`u`?window.innerWidth:1280},debugSoftWidth(){return Math.max(vF,Math.floor(this.viewportWidth/3))},previewBounds(){let e=this.stageWidth||0,t=Math.floor(e/2),n=e-_F-this.debugSoftWidth;return{min:gF,max:Math.max(gF,Math.min(t,n))}},debugMinWidth(){let e=this.colsWidth||Math.max(0,(this.stageWidth||0)-this.previewWidth);return Math.max(vF,Math.min(this.debugSoftWidth,Math.floor(e)-_F))},apiPanelBounds(){let e=this.colsWidth||Math.max(0,(this.stageWidth||0)-this.previewWidth),t=Math.max(yF,Math.floor(e)-this.debugMinWidth);return{min:Math.min(_F,t),max:t}},canvasW(){return Math.round(this.previewWidth||375)},selectedCardName(){let e=this.cardList.find(e=>e.id===this.selectedId);return e&&e.name||this.selectedId||``},cardEmpty(){let e=this.currentSchema;if(!e||!e.view)return!0;let t=e.view.components;return!Array.isArray(t)||t.length===0},apiPanelWidth(){let{min:e,max:t}=this.apiPanelBounds,n=this._apiPanelWidthPx||360;return Math.max(e,Math.min(t,n))},frameStyle(){return{}}},watch:{activeTab(e){e!==`structure`&&(this.selectedNodeId=``,Ex())},aiChatOpen(e){try{sessionStorage.setItem(`cardbuddy:ai-chat-open`,e?`1`:`0`)}catch{}},theme(e){document.documentElement.dataset.theme=e},apiPanelOpen(e){try{localStorage.setItem(`cardbuddy:api-panel-open`,e?`1`:`0`)}catch{}}},beforeUnmount(){this.viewportObserver&&this.viewportObserver.disconnect(),this._stageObserver&&this._stageObserver.disconnect(),this.saveTimer&&clearTimeout(this.saveTimer),this.syncTimer&&clearTimeout(this.syncTimer),this.saveRemoteTimer&&clearTimeout(this.saveRemoteTimer),window.removeEventListener(`keydown`,this.onKeydown)},mounted(){this.viewportObserver=new ResizeObserver(e=>{for(let t of e)this.viewportHeight=Math.round(t.contentRect.height)}),this.$refs.phoneViewport&&this.viewportObserver.observe(this.$refs.phoneViewport),this.loadPreviewWidth(),this.loadApiPanelWidth(),this._stageObserver=new ResizeObserver(e=>{for(let t of e){if(t.target===this.$refs.colsEl){this.colsWidth=Math.round(t.contentRect.width);continue}this.stageWidth=Math.round(t.contentRect.width),this.stageHeight=Math.round(t.contentRect.height)}}),this.$refs.stageEl&&this._stageObserver.observe(this.$refs.stageEl),this.$refs.colsEl&&this._stageObserver.observe(this.$refs.colsEl),window.addEventListener(`keydown`,this.onKeydown)},async created(){Ib(hF);let e=new URLSearchParams(location.search).get(`chrome`);this.chromeOff=e===`off`||e===``;try{let e=localStorage.getItem(`cardbuddy:theme`);(e===`light`||e===`dark`)&&(this.theme=e)}catch{}document.documentElement.dataset.theme=this.theme;try{localStorage.getItem(`cardbuddy:api-panel-open`)===`0`&&(this.apiPanelOpen=!1)}catch{}await this.fetchCardList();let t=new URLSearchParams(location.search).get(`card`),n=null;try{let e=localStorage.getItem(`cardbuddy:selected-card`);e&&this.cardList.some(t=>t.id===e)&&(n=e)}catch{}let r=t&&this.cardList.some(e=>e.id===t)?t:n||this.cardList[0]&&this.cardList[0].id;r&&(this.selectedId=r,await this.loadCard(this.selectedId)),this.$watch(()=>this.rt.rootScope,()=>{this.syncDataToSchema()},{deep:!0}),this.setupCardsChanged()},methods:{setupCardsChanged(){if(this._unsubCardsChanged){try{this._unsubCardsChanged()}catch{}this._unsubCardsChanged=null}this.devSvcLive=`connecting`,this._unsubCardsChanged=Vl(e=>this.onCardsChanged(e),e=>this.onDevServiceState(e))},onDevServiceState(e){let t=this.devSvcLive===`connecting`;this.devSvcLive=e,e===`open`?this.devSvcDown=!1:e===`closed`&&(this.devSvcDown=!0),e===`connecting`?!t&&!this._svcWatchdog&&(this._svcWatchdog=setTimeout(()=>{this.devSvcLive===`connecting`&&(this.devSvcLive=`closed`,this.devSvcDown=!0),this._svcWatchdog=null},8e3)):this._svcWatchdog&&=(clearTimeout(this._svcWatchdog),null)},saveDevService(){Pl(this.devServiceForm),this.apiBaseResolved=Fl(),this.setupCardsChanged(),this.devServiceOpen=!1,Z(`本地开发服务配置已保存`,`ok`),this.fetchCardList()},beginColumnDrag(e,t,n){let r=e&&e.currentTarget;if(!r)return;let i=e.pointerId;try{r.setPointerCapture(i)}catch{}let a=()=>{r.removeEventListener(`pointermove`,t),r.removeEventListener(`pointerup`,a),r.removeEventListener(`pointercancel`,a),window.removeEventListener(`blur`,a);try{r.hasPointerCapture?.(i)&&r.releasePointerCapture(i)}catch{}document.body.style.cursor=``,document.body.style.userSelect=``,n()};document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,r.addEventListener(`pointermove`,t),r.addEventListener(`pointerup`,a),r.addEventListener(`pointercancel`,a),window.addEventListener(`blur`,a)},armSplitter(e){let t=e===`api`?`_armTimerApi`:`_armTimerLeft`;clearTimeout(this[t]),this[t]=setTimeout(()=>{e===`api`?this.armedApi=!0:this.armedLeft=!0},600)},disarmSplitter(e){let t=e===`api`?`_armTimerApi`:`_armTimerLeft`;if(clearTimeout(this[t]),this[t]=null,e===`api`){if(this.apiDragging)return;this.armedApi=!1}else{if(this.dragging)return;this.armedLeft=!1}},startDrag(e){if(this.chromeOff||!this.armedLeft)return;let t=this.$refs.stageEl;if(!t)return;let n=t.getBoundingClientRect().left;this.dragging=!0,this.beginColumnDrag(e,e=>{let{min:t,max:r}=this.previewBounds;this._previewWidthPx=Math.max(t,Math.min(r,Math.round(e.clientX-n)))},()=>{this.dragging=!1,this.savePreviewWidth()})},startApiDrag(e){if(this.chromeOff||!this.apiPanelOpen||!this.armedApi)return;let t=this.$refs.colsEl;if(!t)return;let n=t.getBoundingClientRect().right;this.apiDragging=!0,this.beginColumnDrag(e,e=>{let{min:t,max:r}=this.apiPanelBounds;this._apiPanelWidthPx=Math.max(t,Math.min(r,Math.round(n-e.clientX)))},()=>{this.apiDragging=!1,this.saveApiPanelWidth()})},loadPreviewWidth(){try{let e=localStorage.getItem(`cardbuddy:preview-width`);if(e!=null){let t=parseInt(e,10);!Number.isNaN(t)&&t>=188&&(this._previewWidthPx=t)}}catch{}},savePreviewWidth(){try{localStorage.setItem(`cardbuddy:preview-width`,String(Math.round(this._previewWidthPx)))}catch{}},setPresetWidth(e){if(this.chromeOff)return;let{min:t,max:n}=this.previewBounds;this._previewWidthPx=Math.max(t,Math.min(n,e)),this.savePreviewWidth()},loadApiPanelWidth(){try{let e=localStorage.getItem(`cardbuddy:api-panel-width`);if(e!=null){let t=parseInt(e,10);!Number.isNaN(t)&&t>=320&&(this._apiPanelWidthPx=t)}}catch{}},saveApiPanelWidth(){try{localStorage.setItem(`cardbuddy:api-panel-width`,String(Math.round(this.apiPanelWidth)))}catch{}},chooseBg(e){this.canvasBg=e},onSelect(e){if(e!==this.selectedId){if(this.chatBusy){Z(`AI 正在生成「${this.selectedId}」:先点 ■ 停止,或等本轮结束后再切卡`,`err`,3600);return}this.loadingCard=!0,this.selectedId=e,this.loadCard(e,{clearAll:!0})}},selectCard(e){this.selectedId=e;try{localStorage.setItem(`cardbuddy:selected-card`,e)}catch{}},openGallery(){this.cardList.length&&(this.galleryOpen=!0)},openNewCard(){this.cardDialog.mode=`create`,this.cardDialog.cardId=``,this.cardDialog.cardDesc=``,this.cardDialog.visible=!0,this.fetchCardList()},openRenameCard(){this.selectedId&&(this.cardDialog.mode=`rename`,this.cardDialog.cardId=this.selectedId,this.cardDialog.cardDesc=this.currentSchema&&this.currentSchema.desc||``,this.cardDialog.visible=!0,this.fetchCardList())},async onCardRenamed({oldId:e,id:t}){if(this.cardDialog.visible=!1,Z(t===e?`已更新卡片描述`:`已重命名卡片 ${e} → ${t}`,`ok`),t!==e)return this.applyCardRename(e,t);await this.fetchCardList(),await this.loadCard(t)},async applyCardRename(e,t){if(!e||!t||e===t)return;let n=`${e}->${t}`;if(this._renameAppliedKey===n)return;this._renameAppliedKey=n,setTimeout(()=>{this._renameAppliedKey===n&&(this._renameAppliedKey=``)},1e3);let r=this.selectedId===e;if(this.$refs.chatPanel?.migrateCard(e,t),r&&this.selectCard(t),this.selfSaveId=t,this.selfSaveAt=Date.now(),await this.fetchCardList(),r){if(this.historyDirty&&!this.confirm.show){this.requestConfirm({title:`卡片已重命名`,message:`卡片「${e}」已重命名为「${t}」,而编辑器内还有未保存的改动。\n重新载入会放弃这些未保存改动并显示磁盘版本;保留改动则继续用当前编辑器内容(后续保存会写到新目录 ${t})。`,confirmText:`重新载入`,cancelText:`保留我的改动`,onConfirm:()=>this.loadCard(t)});return}await this.loadCard(t)}},closeGallery(){this.galleryOpen=!1},async openCardFolder(){if(this.selectedId)try{let e=await J(`/__open-folder`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:this.selectedId})}),t=(e.headers.get(`content-type`)||``).includes(`application/json`)?await e.json().catch(()=>({})):{};!e.ok||!t.ok?Z(t.error||`打开文件夹失败`,`err`):Z(`已打开卡片文件夹`,`ok`)}catch{Z(`无法连接本地开发服务,请确认已启动`,`err`)}},async refreshCard(){if(!(!this.selectedId||this.refreshing)){this.refreshing=!0;try{await this.loadCard(this.selectedId)}finally{this.refreshing=!1}}},toggleTheme(){this.theme=this.theme===`light`?`dark`:`light`;try{localStorage.setItem(`cardbuddy:theme`,this.theme)}catch{}},toggleApiPanel(){this.apiPanelOpen=!this.apiPanelOpen},async refreshValidateBadge(){let e=this.selectedId;if(!(!e||!this.preview)&&(this.validateTimer&&clearTimeout(this.validateTimer),this.validateBadge={...this.validateBadge,state:`pending`},await new Promise(e=>{this.validateTimer=setTimeout(e,120)}),this.selectedId===e))try{let[t,n]=await Promise.all([J(`/__validate/${encodeURIComponent(e)}`),J(`/__render-status/${encodeURIComponent(e)}`)]);if(!t.ok){this.validateBadge={...this.validateBadge,state:t.status===503?`nopython`:`fail`};return}let r=await t.json().catch(()=>null),i=n.ok?await n.json().catch(()=>null):null;if(!r){this.validateBadge={...this.validateBadge,state:`fail`};return}let a=!!r.ok,o=!i||!!i.renderOk,s=a&&o?`ok`:`error`,c=this.validateBadge.state!==s;this.validateBadge={state:s,errors:(r.errors||[]).length,warnings:(r.warnings||[]).length,renderOk:o,ts:Date.now()},c&&(s===`ok`||s===`error`)&&this.celebrateValidate(s)}catch{this.validateBadge={...this.validateBadge,state:`fail`}}},celebrateValidate(e=`ok`){let t=this.$refs.validateBadgeEl;if(!t||window.matchMedia&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;t.classList.remove(`is-celebrating`),t.offsetWidth,t.classList.add(`is-celebrating`),setTimeout(()=>t.classList.remove(`is-celebrating`),600);let n=t.getBoundingClientRect(),r={ok:`--ok`,error:`--danger`,pending:`--warn`,fail:`--text-faint`,nopython:`--text-faint`}[e]||`--ok`,i={ok:`#52c41a`,error:`#F5222D`,pending:`#FAAD14`,fail:`#8c8c8c`,nopython:`#8c8c8c`}[e]||`#52c41a`,a=getComputedStyle(t).getPropertyValue(r).trim()||i,o=document.createElement(`div`);o.className=`app__confetti`,o.style.left=n.left+n.width/2+`px`,o.style.top=n.top+n.height/2+`px`;let s=[`polygon(50% 0%, 0% 100%, 100% 100%)`,`polygon(62% 0%, 100% 40%, 45% 100%, 0% 52%)`,`polygon(0% 0%, 100% 18%, 82% 100%, 12% 70%)`,`polygon(22% 0%, 100% 8%, 88% 100%, 0% 76%)`,`polygon(0% 32%, 100% 0%, 76% 100%, 18% 86%)`,`polygon(8% 0%, 100% 22%, 70% 100%, 0% 64%)`,`polygon(0% 12%, 100% 0%, 100% 78%, 30% 100%, 12% 55%)`],c=n.width/2,l=n.height/2;for(let e=0;e<22;e++){let e=document.createElement(`span`);e.className=`app__confetti-bit`;let t=Math.random()*4|0,n,r;t===0?(n=(Math.random()*2-1)*c,r=-l):t===1?(n=c,r=(Math.random()*2-1)*l):t===2?(n=(Math.random()*2-1)*c,r=l):(n=-c,r=(Math.random()*2-1)*l);let i=Math.hypot(n,r)||1,u=Math.atan2(r/i,n/i)+(Math.random()-.5)*.5,d=16+Math.random()*26;e.style.setProperty(`--sx`,n.toFixed(1)+`px`),e.style.setProperty(`--sy`,r.toFixed(1)+`px`),e.style.setProperty(`--tx`,(Math.cos(u)*d).toFixed(1)+`px`),e.style.setProperty(`--ty`,(Math.sin(u)*d).toFixed(1)+`px`),e.style.setProperty(`--rot`,(Math.random()*720-360).toFixed(0)+`deg`),e.style.setProperty(`--clip`,s[Math.random()*s.length|0]),e.style.setProperty(`--c`,a),e.style.setProperty(`--o`,(.68+Math.random()*.27).toFixed(2));let f=Math.random(),p,m;f<.35?(p=1.5+Math.random()*2,m=10+Math.random()*10):f<.75?(p=4+Math.random()*5,m=p*(.6+Math.random()*.8)):(p=2+Math.random()*2.5,m=p),e.style.width=p.toFixed(0)+`px`,e.style.height=m.toFixed(0)+`px`,o.appendChild(e)}document.body.appendChild(o),setTimeout(()=>o.remove(),800)},async loadCard(e,t={}){if(e){this.loadingCard=!0;try{let n=await J(`/__card/${encodeURIComponent(e)}`);if(!n.ok){this.rt.pushError(`loadCard`,`HTTP `+n.status);return}let r=await n.json();if(!r.schema){this.rt.pushError(`loadCard`,`schema 读取失败`);return}this.selectCard(e),t.clearAll?this.rt.clearErrors():this.rt.clearBindingErrors(),this.rt.clearApiCalls(),t.keepScope||this.rt.setRootScope(Xg(r.schema,fF)),this.currentCard={schema:r.schema},this.currentSchema=r.schema,this.cardImportMeta=null,this.fetchImportMeta(e),this.localSchema=this.cloneSchema(r.schema),this.localData=this.cloneData(Xg(r.schema,fF)),this.preview=Pu(r.schema),typeof window<`u`&&(window.__cardModel=Bu(r.schema)),this.cardReady=!1,this.$nextTick(()=>{this.cardReady=!0}),this.syncDataToSchema(),this.selectedNodeId=``,this.baseline={schema:this.cloneSchema(this.currentSchema)},this.reloadToken+=1,ub(),Lb(),this.refreshValidateBadge(),await this.loadHistory(e)}finally{this.loadingCard=!1}}},cloneSchema(e){return e?JSON.parse(JSON.stringify(e,(e,t)=>e===`_schemaNode`?void 0:t)):null},normalizeForCompare(e){let t=this.cloneSchema(e);if(t&&t.dictionary&&Array.isArray(t.dictionary.inputParams))for(let e of t.dictionary.inputParams)e&&typeof e==`object`&&(e.defaultValue=void 0);return t},structuralEqual(e,t){return!e||!t?e===t:JSON.stringify(this.normalizeForCompare(e))===JSON.stringify(this.normalizeForCompare(t))},cloneData(e){return e==null?e:JSON.parse(JSON.stringify(e,(e,t)=>e===`_schemaNode`?void 0:t))},dataEqual(e,t){return JSON.stringify(e)===JSON.stringify(t)},applySchemaSnapshot(e){if(!this.selectedId||!e)return;let t=e.schema||e,n=e.data==null?Xg(t,fF):e.data;this.currentSchema=this.cloneSchema(t),this.rt.setRootScope(this.cloneData(n)),this.preview=Pu(this.currentSchema),typeof window<`u`&&(window.__cardModel=Bu(this.currentSchema)),this.syncDataToSchema(),this.selectedNodeId=``,this.reloadToken+=1,this.refreshValidateBadge()},commitHistory(){if(!this.currentSchema||!this.baseline)return;let e=this.structuralEqual(this.currentSchema,this.baseline.schema),t=this.dataEqual(this.rt.rootScope,Xg(this.baseline.schema,fF));if(e&&t)return;let n={schema:this.baseline.schema};this.past.push(n),this.past.length>30&&this.past.shift(),this.future=[],this.baseline={schema:this.cloneSchema(this.currentSchema)},this.persistSnapshot(n)},scheduleCommit(){this._commitTimer&&clearTimeout(this._commitTimer),this._commitTimer=setTimeout(()=>{this._commitTimer=null,this.commitHistory()},500)},persistSnapshot(e){let t=this.selectedId;if(!t)return;let n=e.schema||e;J(`/__history/${encodeURIComponent(t)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({schema:n},(e,t)=>e===`_schemaNode`?void 0:t,2)}).catch(e=>console.warn(`[历史快照落盘失败]`,e))},async loadHistory(e){this.past=[],this.future=[];try{let t=await J(`/__history/${encodeURIComponent(e)}`);if(!t.ok)return;let n=await t.json().catch(()=>null),r=n&&n.snapshots||[];this.past=r.slice(-30).map(e=>({schema:e.schema,data:e.data==null?Xg(e.schema,fF):e.data}))}catch(e){console.warn(`[加载编辑历史失败]`,e)}},undo(){if(!this.canUndo)return;let e=this.past.pop();this.future.push(this.baseline),this.future.length>30&&this.future.shift(),this.baseline=e,this.applySchemaSnapshot(e)},redo(){if(!this.canRedo)return;let e=this.future.pop();this.past.push(this.baseline),this.past.length>30&&this.past.shift(),this.baseline=e,this.applySchemaSnapshot(e)},async applyHistoryToLocal(){this.loadingCard||!this.historyDirty||!this.preview||!this.selectedId||await this.saveCard()&&Z(`已将该版本保存到本地`,`ok`)},onSchemaChanged(){!this.selectedId||!this.currentSchema||(this.reloadToken+=1,this.preview=Pu(this.currentSchema),typeof window<`u`&&(window.__cardModel=Bu(this.currentSchema)),this.syncDataToSchema(),this.selectedNodeId=``)},onSchemaCommit(){!this.selectedId||!this.currentSchema||(this.reloadToken+=1,this.preview=Pu(this.currentSchema),typeof window<`u`&&(window.__cardModel=Bu(this.currentSchema)),this.syncDataToSchema(),this.selectedNodeId=``,this.commitHistory())},syncDataToSchema(){let e=this.currentSchema;if(!e||!e.dictionary||!Array.isArray(e.dictionary.inputParams))return;let t=this.rt&&this.rt.rootScope;if(!t||typeof t!=`object`)return;let n=e.dictionary.inputParams,r=Zg(e);for(let e of Object.keys(t)){let i=n.find(t=>t&&(t.key===e||t.name===e));if(!i)continue;let a=JSON.parse(JSON.stringify(t[e],(e,t)=>e===`_schemaNode`?void 0:t));r&&Object.prototype.hasOwnProperty.call(r,e)?r[e]=a:i.defaultValue=a}},onSelectNode(e){this.selectedNodeId=e||``},findPreviewNodeById(e,t){if(!e||t==null)return null;let n=String(t),r=e=>{if(!e)return null;if(String(e.id)===n)return e;let t=[];if(e.components&&t.push(...e.components),e.slots)for(let n of e.slots)n.components&&t.push(...n.components);for(let e of t){let t=r(e);if(t)return t}return null};return r(e)},copySelectedNode(){let e=this.selectedNodeId;if(!e||e===`_root`||!this.currentSchema||!this.preview)return;let t=this.findPreviewNodeById(this.preview.view,e);if(!t)return;let n=this.findSchemaNodeByComponentId(this.currentSchema.view,t.componentId);n&&(Wu(n.node,this.selectedId),Z(`已复制节点(含子节点)`,`ok`))},pasteNode(){let e=Hu();if(!e||!this.currentSchema)return;let t=Gu(e),n=[...new Set(t.filter(e=>!vu[e]))];if(n.length){Z(`粘贴失败:含未知组件类型 `+n.join(`、`),`err`);return}let r=JSON.parse(JSON.stringify(e,(e,t)=>e===`_schemaNode`?void 0:t));Ku(r);let i=this.selectedNodeId&&this.selectedNodeId!==`_root`?this.findPreviewNodeById(this.preview.view,this.selectedNodeId):null,a=`root`;i&&(a=ju(i.className)?`into`:`after`),this.insertClone(r,i,a);let o=Uu();o&&o!==this.selectedId?Z(`已从卡片「${o}」跨卡片粘贴到「${this.selectedId}」`,`ok`):Z(`已粘贴节点(含子节点)`,`ok`)},duplicateNode(){let e=this.selectedNodeId;if(!e||e===`_root`||!this.currentSchema||!this.preview)return;let t=this.findPreviewNodeById(this.preview.view,e);if(!t)return;let n=this.findSchemaNodeByComponentId(this.currentSchema.view,t.componentId);if(!n)return;let r=JSON.parse(JSON.stringify(n.node,(e,t)=>e===`_schemaNode`?void 0:t));Ku(r),n.parentArr.splice(n.index+1,0,r),this.afterStructuralEdit(r.componentId)},insertClone(e,t,n){let r=this.currentSchema;if(n===`root`)r.view.components||(r.view.components=[]),r.view.components.push(e);else if(n===`into`){let n=t&&t._schemaNode;if(!n){r.view.components||(r.view.components=[]),r.view.components.push(e),this.afterStructuralEdit(e.componentId);return}let i=Mu(t.className),a=(n.slots||[]).find(e=>e.slotKey===i);a||(n.slots||=[],a={slotKey:i,slotScope:!1,slotSwitch:`1`,components:[]},n.slots.push(a)),a.components||(a.components=[]),a.components.push(e)}else{let n=this.findSchemaNodeByComponentId(r.view,t.componentId);n?n.parentArr.splice(n.index+1,0,e):(r.view.components||(r.view.components=[]),r.view.components.push(e))}this.afterStructuralEdit(e.componentId)},afterStructuralEdit(e){let t=this.currentSchema;this.reloadToken+=1,this.preview=Pu(t),typeof window<`u`&&(window.__cardModel=Bu(t)),this.syncDataToSchema(),this.selectedNodeId=e&&this.findViewIdByComponentId(this.preview.view,e)||``,this.scheduleCommit()},deleteSelectedNode(){let e=this.selectedNodeId;if(!e||e===`_root`||!this.currentSchema||!this.preview)return;let t=this.findPreviewNodeById(this.preview.view,e);if(!t)return;let n=this.findSchemaNodeByComponentId(this.currentSchema.view,t.componentId);n&&(n.parentArr.splice(n.index,1),this.reloadToken+=1,this.preview=Pu(this.currentSchema),typeof window<`u`&&(window.__cardModel=Bu(this.currentSchema)),this.syncDataToSchema(),this.selectedNodeId=``,Ex(),this.scheduleCommit())},hasTextSelection(){if(typeof window>`u`||!window.getSelection)return!1;let e=window.getSelection();return!!e&&!e.isCollapsed&&e.toString().trim()!==``},hasNodeSelection(){return!!this.selectedNodeId&&this.selectedNodeId!==`_root`},isEditableTarget(e){let t=e.target;if(!t)return!1;let n=t.tagName;return!!(n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t.isContentEditable)},onKeydown(e){if(this.chromeOff||!this.preview)return;let t=this.isEditableTarget(e),n=e.ctrlKey||e.metaKey,r=e.key;if(n&&(r===`c`||r===`C`)){if(t||this.hasTextSelection()||!this.hasNodeSelection())return;this.copySelectedNode(),e.preventDefault();return}if(n&&(r===`v`||r===`V`)){if(t||this.hasTextSelection()||!this.hasNodeSelection()||!Hu())return;this.pasteNode(),e.preventDefault();return}if(n&&(r===`d`||r===`D`)){if(t||this.hasTextSelection()||!this.hasNodeSelection())return;this.duplicateNode(),e.preventDefault();return}if(n&&(r===`z`||r===`Z`)){if(t)return;e.preventDefault(),e.shiftKey?this.redo():this.undo();return}if(n&&(r===`y`||r===`Y`)){if(t)return;e.preventDefault(),this.redo();return}if(r===`Delete`||r===`Backspace`){if(t||!this.selectedNodeId||this.selectedNodeId===`_root`)return;e.preventDefault(),this.deleteSelectedNode();return}if(r===`Escape`){this.selectedNodeId&&(this.selectedNodeId=``,e.preventDefault());return}},onHoverNode(e){if(!e){Ex();return}if(e.leave){Ex(e.id);return}let t=typeof document<`u`?document.querySelector(`.phone__screen`):null;if(!t){Ex(e.id);return}let n=e=>window.CSS&&CSS.escape?CSS.escape(String(e)):String(e).replace(/["\\\]]/g,`\\$&`),r=null;e.componentId!=null&&(r=t.querySelector(`[data-cid="`+n(e.componentId)+`"]`)),!r&&e.id!=null&&(r=t.querySelector(`[data-cid="`+n(e.id)+`"]`)),r?Tx(r,e.id):Ex(e.id)},onCanvasClick(e){if(!e.ctrlKey&&!e.metaKey||this.chromeOff)return;let t=e.target&&e.target.closest?e.target.closest(`[data-cid]`):null;if(!t)return;let n=t.getAttribute(`data-cid`);if(!n)return;let r=this.findPreviewNodeByCid(n);r&&(this.activeTab=`structure`,this.selectedNodeId=r.id)},onAiLocateNode(e){let t=e?this.findPreviewNodeByCid(e):null;if(!t){Z(`没找到组件 ${e||``}:卡片可能已被改动,重新校验一次即可`,`err`);return}this.activeTab=`structure`,this.selectedNodeId=t.id},findPreviewNodeByCid(e){let t=this.preview&&this.preview.view;if(!t)return null;let n=String(e),r=e=>{if(!e)return null;if(String(e.componentId==null?e.id:e.componentId)===n)return e;let t=[];if(e.components&&t.push(...e.components),e.slots)for(let n of e.slots)n.components&&t.push(...n.components);for(let e of t){let t=r(e);if(t)return t}return null};return r(t)},onAddNode(e){this.currentSchema&&(this.addNodeTarget=e||null,this.addNodePanelOpen=!0)},cancelAddNode(){this.addNodePanelOpen=!1,this.addNodeTarget=null},findSchemaLocation(e,t){let n=e=>{for(let r=0;r<e.length;r++){let i=e[r];if(i===t)return{containerArr:e,index:r};let a=i.slots||[];for(let e of a){let t=n(e.components||[]);if(t)return t}}return null};return n(e&&e.components||[])},findViewIdByComponentId(e,t){if(!e)return null;if(e.componentId===t)return e.id;let n=[];if(e.components&&n.push(...e.components),e.slots)for(let t of e.slots)t.components&&n.push(...t.components);for(let e of n){let n=this.findViewIdByComponentId(e,t);if(n)return n}return null},findSchemaNodeByComponentId(e,t){let n=(e,r)=>{for(let i=0;i<e.length;i++){let a=e[i];if(a.componentId===t)return{node:a,parentArr:e,index:i,owner:r};let o=a.slots||[];for(let e of o){let t=n(e.components||[],a);if(t)return t}}return null};return n(e&&e.components||[],`root`)},isDescendantCompId(e,t){if(!t||!t.componentId)return!1;if(t.componentId===e)return!0;let n=[];if(t.components&&n.push(...t.components),t.slots)for(let e of t.slots)e.components&&n.push(...e.components);for(let t of n)if(this.isDescendantCompId(e,t))return!0;return!1},moveNode(e,t,n){let r=this.currentSchema;if(!r||!r.view||e===t)return!1;let i=this.findSchemaNodeByComponentId(r.view,e);if(!i)return!1;let a=i.node;if(this.isDescendantCompId(t,a))return!1;let o,s;if(t===`__root__`)r.view.components||(r.view.components=[]),o=r.view.components,s=o.length;else{let e=this.findSchemaNodeByComponentId(r.view,t);if(!e)return!1;let i=e.node;if(n===`inside`){if(!ju(i.className))return!1;let e=Mu(i.className),t=(i.slots||[]).find(t=>t.slotKey===e);t||(i.slots||=[],t={slotKey:e,slotScope:!1,slotSwitch:`1`,components:[]},i.slots.push(t)),t.components||(t.components=[]),o=t.components,s=o.length}else o=e.parentArr,s=n===`before`?e.index:e.index+1}let c=o===i.parentArr&&i.index<s;return i.parentArr.splice(i.index,1),c&&--s,o.splice(s,0,a),a},onMoveNode({sourceCompId:e,targetCompId:t,position:n}){if(!this.currentSchema||!this.moveNode(e,t,n))return;this.reloadToken+=1,this.preview=Pu(this.currentSchema),typeof window<`u`&&(window.__cardModel=Bu(this.currentSchema)),this.syncDataToSchema();let r=this.findViewIdByComponentId(this.preview.view,e);this.selectedNodeId=r||``,r&&(this.moveCollapseToken+=1)},onPickComponent(e){let t=this.addNodeTarget||{},n=t.node||null,r=t.mode||`auto`,i=this.currentSchema;if(!i){this.cancelAddNode();return}let a;try{a=Nu(e)}catch(e){console.error(`[创建组件节点失败]`,e),this.rt.pushError(`addNode`,String(e&&e.message)),this.cancelAddNode();return}let o=!n||n.className===`Root`;if((r===`before`||r===`after`)&&!o){let e=n._schemaNode,t=e?this.findSchemaLocation(i.view,e):null;if(!t)i.view.components||(i.view.components=[]),i.view.components.push(a);else{let e=r===`before`?t.index:t.index+1;t.containerArr.splice(e,0,a)}}else if(o)i.view.components||(i.view.components=[]),i.view.components.push(a);else{let e=n._schemaNode;if(!e){this.cancelAddNode();return}if(ju(n.className)){let t=Mu(n.className),r=(e.slots||[]).find(e=>e.slotKey===t);r||(e.slots||=[],r={slotKey:t,slotScope:!1,slotSwitch:`1`,components:[]},e.slots.push(r)),r.components||(r.components=[]),r.components.push(a)}else{let t=this.findSchemaLocation(i.view,e);t?t.containerArr.splice(t.index+1,0,a):(i.view.components||(i.view.components=[]),i.view.components.push(a))}}this.cancelAddNode(),this.reloadToken+=1,this.preview=Pu(i),typeof window<`u`&&(window.__cardModel=Bu(i)),this.syncDataToSchema();let s=this.findViewIdByComponentId(this.preview.view,a.componentId);this.selectedNodeId=s||``,this.scheduleCommit()},async copySchema(){if(!this.currentSchema)return;this.syncDataToSchema();let e=``;try{let t={...this.currentSchema};this.rt&&this.rt.rootScope&&(t.data=this.rt.rootScope),e=JSON.stringify(t,(e,t)=>{if(e!==`_schemaNode`)return t},2)}catch{e=`(无法序列化)`}await this.doCopy(e)&&(this.copiedSchema=!0,this.copyTimer&&clearTimeout(this.copyTimer),this.copyTimer=setTimeout(()=>{this.copiedSchema=!1},1500))},async doCopy(e){try{if(navigator.clipboard&&navigator.clipboard.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}},async runSync(e){if(!this.syncingRemote&&!(e&&!this.selectedId)){this.syncingRemote=!0,this.syncedRemote=!1,this.syncTarget=e?`selected`:`full`;try{let t=await J(`/__sync`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?{cardCode:e}:{})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.message||e.error||`HTTP `+t.status)}let n=await t.json();if(n.needCredentials){this.openLoginModal();return}if(!n.success){let e=(n.failed||[]).map(e=>`${e.id}: ${e.error}`).join(`; `);throw Error(e||`同步失败`)}this.syncedRemote=!0,this.syncTimer&&clearTimeout(this.syncTimer),this.syncTimer=setTimeout(()=>{this.syncedRemote=!1,this.syncTarget=null},1800),await this.onRefresh(),Z(this.syncTarget===`selected`?`已同步当前卡片到本地`:`全量同步完成`,`ok`)}catch(e){console.error(`[同步远程数据失败]`,e),Z(`同步失败:`+(e&&e.message),`err`)}finally{this.syncingRemote=!1}}},syncRemote(){return this.runSync()},syncSelected(){return this.runSync(this.selectedId)},openLoginModal(){this.loginModal=!0,this.loginName=``,this.loginPassword=``,this.loginError=``},closeLoginModal(){this.loginSubmitting||(this.loginModal=!1,this.loginPassword=``,this.loginError=``)},async submitLogin(){if(this.loginSubmitting)return;let e=this.loginName.trim(),t=this.loginPassword;if(!e||!t){this.loginError=`账号与密码均不能为空`;return}this.loginSubmitting=!0,this.loginError=``;try{let n=await J(`/__login-credentials`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({loginName:e,loginPassword:t})}),r=await n.json().catch(()=>({}));if(!n.ok||!r.ok)throw Error(r.message||r.error||`HTTP `+n.status);this.loginModal=!1,this.loginPassword=``,Z(`凭据已保存,正在重试同步…`,`ok`),await this.runSync(this.syncTarget===`selected`?this.selectedId:void 0)}catch(e){this.loginError=`保存失败:`+(e&&e.message)}finally{this.loginSubmitting=!1}},chooseSync(e){if(e===`full`){if(this.syncingRemote)return;this.requestConfirm({title:`全量同步`,message:`即将从远端 FinMall 拉取完整卡片列表,并逐张覆盖本地同名卡片。本地独有卡片会保留,但被覆盖卡片的未保存改动将丢失,且无法撤销。是否继续?`,confirmText:`继续同步`,severity:`warn`,onConfirm:()=>this.syncRemote()});return}!this.preview||!this.selectedId||this.syncingRemote||this.requestConfirm({title:`当前同步`,message:`即将从远端 FinMall 拉取当前卡片「${this.selectedId}」的最新版本并覆盖本地。本地未保存的改动将丢失,且无法撤销。是否继续?`,confirmText:`继续同步`,onConfirm:()=>this.syncSelected()})},chooseRsave(e){if(e===`save`){if(!this.preview||!this.selectedId||this.savingRemote||!this.hasCardSource)return;this.requestConfirm({title:`版本推送`,message:`即将把本地卡片「${this.selectedId}」的当前版本推送并覆盖到远端 FinMall。线上版本会被立即更新,且该操作不可撤销。是否继续?`,confirmText:`继续推送`,severity:`warn`,onConfirm:()=>this.saveToRemote()});return}if(e===`slices`){if(!this.preview||!this.selectedId||this.uploadingSlices)return;this.requestConfirm({title:`切图上传`,message:`即将把当前卡片「${this.selectedId}」引用的本地切图(src/slices/)上传到 FinMall 图片库,并把卡片里的 /slices/ 引用替换为线上地址(@filestore/…)。本地切图文件保留不动;内容未变的切图会直接复用已有线上地址,不重复上传。`+(this.historyDirty?`
|
|
286
|
+
`)}`}return{role:`user`,content:n}}let t=(e.toolCalls||[]).filter(e=>e.result!==void 0||e.error).map(e=>({toolCallId:e.toolCallId,toolName:e.toolName,args:e.args||{},result:typeof e.result==`string`?e.result.slice(0,kP):e.result,error:e.error||``})),n=e.content||``;return e.status===`aborted`&&(n=n?`${n}\n\n[本轮生成被用户手动中止,以上为已完成部分;未完成的步骤没有执行,请从中断处继续。]`:`[上一轮被用户手动中止于思考/工具阶段,没有产出可用内容;请重新规划并继续完成用户的目标。]`),{role:`assistant`,content:n,toolCalls:t}})},onScroll(){let e=this.$refs.listEl;e&&(this.pinned=e.scrollHeight-e.scrollTop-e.clientHeight<48)},scrollToBottom(e=!1){let t=this.$refs.listEl;t&&(!e&&!this.pinned||(t.scrollTop=t.scrollHeight))},stopTickers(){this._saveTimer&&clearTimeout(this._saveTimer),this._saveTimer=0},startTurn(){let e=Date.now();this.turnId=``,this.lastSeq=0,this.turnStep=0,this.turnStage=null,this.turnToolLabel=``,this.turnStartedAt=e,this.lastByteAt=e,this.nowTs=e,this.stopTurnTimers(),this._liveTicker=setInterval(()=>{this.nowTs=Date.now(),this.$emit(`turn-progress`,{steps:this.turnStep,startedAt:this.turnStartedAt,ms:this.nowTs-this.turnStartedAt,stage:this.turnStage?`${this.turnStage.id} ${this.turnStage.label}`:this.turnToolLabel,stalled:this.stalled})},1e3),this._turnPersistTimer=setInterval(()=>this.persist(),8e3),this.persist(),this.$emit(`busy`,!0)},stopTurnTimers(){this._liveTicker&&clearInterval(this._liveTicker),this._liveTicker=0,this._turnPersistTimer&&clearInterval(this._turnPersistTimer),this._turnPersistTimer=0},onPagehide(){let e=this.cardId;if(!e||!this.messages.length)return;let t=this.fitArchive(this.serialize());this._dirtyFor=null,this._saveTimer&&=(clearTimeout(this._saveTimer),0),Qk(e,t,{keepalive:!0}).catch(()=>{})},fmtClock:RO,pushEvent(e,t){let n=String(t&&t.message||``);!n||!e||(Array.isArray(e.events)||(e.events=[]),e.events.push({ts:Date.now(),level:t.level||`warn`,code:t.code||``,message:n}))},applyUsage(e,t){if(!e||!t)return;let n=e=>Number.isFinite(Number(e))?Number(e):0;e.usage={steps:n(t.steps),promptTokens:n(t.promptTokens),completionTokens:n(t.completionTokens),cachedTokens:n(t.cachedTokens),cacheMissTokens:n(t.cacheMissTokens),hitRate:n(t.hitRate),reported:t.reported!==!1}},loadCompact(){try{this.compactSteps=localStorage.getItem(BP)===`1`}catch{}},setCompact(e){let t=!!e;if(this.compactSteps!==t){this.compactSteps=t;try{t?localStorage.setItem(BP,`1`):localStorage.removeItem(BP)}catch{}this.$nextTick(()=>this.scrollToBottom())}},toggleCompact(){this.setCompact(!this.compactSteps)},onLocateNode(e){e&&this.$emit(`locate-node`,String(e))},onRollbackTurn(e){if(this.busy)return;let t=this.cardId;!t||!e||this.$emit(`rollback-turn`,{cardId:t,ts:Number(e.ts)||0,msgId:e.id})},notify(e,t){this.notice={type:e,text:t},this._noticeTimer&&clearTimeout(this._noticeTimer),this._noticeTimer=setTimeout(()=>{this.notice=null},6e3)}}},JP={class:`aichat__head`},YP={class:`aichat__titles`},XP={class:`aichat__sub`},ZP={class:`aichat__acts`},QP=[`title`,`aria-pressed`],$P={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},eF=[`href`],tF=[`disabled`],nF={key:0,class:`aichat__banner`},rF={class:`aichat__scroll`},iF={key:0,class:`aichat__archnote`,title:`长对话记录超出落盘体积上限时,较早的工具参数与结果会被裁剪归档;正文、思考与过程事件都完整保留`},aF={key:1,class:`aichat__loading`},oF={key:2,class:`aichat__empty`},sF={class:`aichat__empty-title`},cF={class:`aichat__empty-desc`},lF={class:`aichat__suggests`},uF=[`title`,`data-suggest-id`,`onClick`],dF={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},fF=[`href`],pF={class:`aichat__suggest-text`},mF={class:`aichat__suggest-label`},hF={class:`aichat__suggest-hint`},gF={key:0,class:`aichat__suggest-badge`,title:`该操作会改动卡片`},_F={class:`aichat__live-text`},vF={key:1,class:`aichat__quick`},yF=[`title`,`data-suggest-id`,`onClick`],bF={viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},xF=[`href`],SF={class:`ni-panel modal-card ccsw-dlg`,role:`dialog`,"aria-modal":`true`,"aria-label":`从 cc-switch 导入模型`},CF={class:`ni-head`},wF={class:`ni-body`},TF={class:`ni-scroll`},EF={key:0,class:`ccsw-dlg__msg`},DF={class:`ccsw-dlg__msg ccsw-dlg__msg--err`},OF={class:`ccsw-dlg__list`},kF=[`onClick`],AF={key:0,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`,"stroke-linecap":`round`,"stroke-linejoin":`round`},jF={class:`ccsw-dlg__info`},MF={class:`ccsw-dlg__name`},NF={key:0,class:`ccsw-dlg__badge ccsw-dlg__badge--cur`,title:`cc-switch 中当前生效`},PF={key:1,class:`ccsw-dlg__badge ccsw-dlg__badge--dup`,title:`模型库中已存在同名模型`},FF={class:`ccsw-dlg__meta`},IF={class:`ccsw-dlg__model`},LF={class:`ccsw-dlg__host`},RF={class:`ni-foot`},zF={class:`ni-tip`},BF={class:`ni-foot-btns`},VF=[`disabled`];function HF(e,t,n,r,i,a){let o=I(`ChatMessage`),s=I(`ChatComposer`),c=I(`ModelList`),l=I(`AiSettings`),u=I(`ConfirmDialog`),d=I(`AiCommonSettings`);return z(),B(`aside`,{class:A([`aichat`,{"is-open":n.visible}]),style:k(a.panelStyle),role:`complementary`,"aria-label":`AI 开发助手`,onKeydown:t[23]||=yl((...e)=>a.onEscape&&a.onEscape(...e),[`esc`]),onClick:t[24]||=(...e)=>a.onImageClick&&a.onImageClick(...e)},[G(` 左缘拖拽把手:调宽(双击恢复默认 33%) `),H(`div`,{class:A([`aichat__grip`,{"is-dragging":i.resizing,"is-armed":i.gripArmed}]),title:`拖拽调整宽度(双击恢复默认)`,onMouseenter:t[0]||=(...e)=>a.armGrip&&a.armGrip(...e),onMouseleave:t[1]||=(...e)=>a.disarmGrip&&a.disarmGrip(...e),onPointerdown:t[2]||=K((...e)=>a.startResize&&a.startResize(...e),[`prevent`]),onDblclick:t[3]||=K((...e)=>a.resetWidth&&a.resetWidth(...e),[`prevent`])},null,34),G(` 头部:标题 + 当前卡片 / 模型 + 清空 / 设置 / 关闭 `),H(`header`,JP,[t[29]||=H(`span`,{class:`aichat__logo`},[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-sparkles`})])],-1),H(`span`,YP,[t[25]||=H(`span`,{class:`aichat__title`},`AI 开发助手`,-1),H(`span`,XP,[n.cardId?(z(),B(R,{key:0},[W(j(n.cardName||n.cardId),1)],64)):(z(),B(R,{key:1},[W(`未选择卡片`)],64)),i.config.model?(z(),B(R,{key:2},[W(` · `+j(i.config.model),1)],64)):G(`v-if`,!0)])]),H(`span`,ZP,[G(` 紧凑视图(面板级):长任务里读取类调用能刷几十行,把写入与门禁挤到折叠线以下 `),H(`button`,{type:`button`,class:A([`aichat__iconbtn`,{"is-on":i.compactSteps}]),title:i.compactSteps?`紧凑视图已开启:已折叠读取类调用,点击显示全部步骤`:`只看关键步骤:折叠读取类调用(写入 / 跑脚本 / 报错始终显示)`,"aria-pressed":i.compactSteps?`true`:`false`,onClick:t[4]||=(...e)=>a.toggleCompact&&a.toggleCompact(...e)},[(z(),B(`svg`,$P,[H(`use`,{href:i.compactSteps?`#icon-eye-off`:`#icon-eye`},null,8,eF)]))],10,QP),H(`button`,{type:`button`,class:`aichat__iconbtn`,title:`清空本卡片对话记录`,disabled:!i.messages.length||i.busy,onClick:t[5]||=(...e)=>a.askClear&&a.askClear(...e)},[...t[26]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-trash`})],-1)]],8,tF),H(`button`,{type:`button`,class:`aichat__iconbtn`,title:`模型库`,onClick:t[6]||=(...e)=>a.openModelList&&a.openModelList(...e)},[...t[27]||=[H(`svg`,{class:`is-solid-icon`,viewBox:`0 0 1024 1024`,"aria-hidden":`true`},[H(`use`,{href:`#icon-model`})],-1)]]),H(`button`,{type:`button`,class:`aichat__iconbtn`,title:`关闭(Esc)`,onClick:t[7]||=t=>e.$emit(`close`)},[...t[28]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-x`})],-1)]])])]),G(` 未配置模型:常驻提示条,一键打开设置 `),a.configReady?G(`v-if`,!0):(z(),B(`div`,nF,[t[30]||=H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-alert-triangle`})],-1),t[31]||=H(`span`,null,`尚未配置模型,无法对话。`,-1),H(`button`,{type:`button`,class:`aichat__banner-btn`,onClick:t[8]||=(...e)=>a.openModelList&&a.openModelList(...e)},`去设置`)])),G(` 消息区:滚动容器与悬浮「回到底部」共处一个定位上下文,按钮只贴消息区底缘,
|
|
287
|
+
输入区拖高 / 反馈条出现都不会把它盖住或悬空 `),H(`div`,rF,[H(`div`,{ref:`listEl`,class:`aichat__list`,onScroll:t[12]||=(...e)=>a.onScroll&&a.onScroll(...e)},[G(` 体积治理痕迹:较早的工具结果被裁剪过就说清楚,别让人以为记录丢了 `),i.archiveTrimmed?(z(),B(`div`,iF,[...t[32]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-activity`})],-1),H(`span`,null,`较早的工具参数 / 结果已裁剪归档(对话正文与过程事件完整保留)`,-1)]])):G(`v-if`,!0),i.loadingHistory?(z(),B(`div`,aF,`正在加载对话记录…`)):i.messages.length?(z(),B(R,{key:3},[G(` compact = 面板级「只看关键步骤」;can-rollback 只对当前卡片、非流式中开放(切了卡再回滚会写错对象) `),(z(!0),B(R,null,L(i.messages,(e,r)=>(z(),V(o,{key:e.id,msg:e,streaming:i.busy&&r===i.messages.length-1,"can-regenerate":e.role===`assistant`&&r===i.messages.length-1,compact:i.compactSteps,"can-rollback":e.role===`assistant`&&!i.busy&&!!n.cardId,"now-ts":i.busy&&r===i.messages.length-1?i.nowTs:0,"pick-owner":a.pickOwnerRow,onRegenerate:a.regenerate,onApproval:a.onApproval,onContinue:a.onContinue,onRollback:a.onRollbackTurn,onOpenSettings:a.openModelList,onShowAllSteps:t[10]||=e=>a.setCompact(!1),onLocateNode:a.onLocateNode,onPickBoard:a.onPickBoard},null,8,[`msg`,`streaming`,`can-regenerate`,`compact`,`can-rollback`,`now-ts`,`pick-owner`,`onRegenerate`,`onApproval`,`onContinue`,`onRollback`,`onOpenSettings`,`onLocateNode`,`onPickBoard`]))),128)),G(` 面板级进度:步数 / 已用时长 / 建卡阶段 / 最近收到数据多久前。
|
|
288
|
+
长任务里「还活着吗」全靠这一行——旧版只有一句「生成中…」,网关静默与真在跑无从区分 `),i.busy?(z(),B(`div`,{key:0,class:A([`aichat__live`,{"is-stalled":a.stalled}]),role:`status`,"aria-live":`polite`},[t[35]||=H(`span`,{class:`aichat__live-dot`},null,-1),H(`span`,_F,j(a.liveText),1),a.stalled?(z(),B(`button`,{key:0,type:`button`,class:`aichat__live-act`,title:`连接可能已中断,终止本轮(已落盘的产物会保留)`,onClick:t[11]||=(...e)=>a.stop&&a.stop(...e)},` 终止 `)):G(`v-if`,!0)],2)):G(`v-if`,!0)],64)):(z(),B(`div`,oF,[t[34]||=H(`span`,{class:`aichat__empty-logo`},[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-sparkles`})])],-1),H(`p`,sF,j(a.emptyTitle),1),H(`p`,cF,j(a.emptyDesc),1),H(`div`,lF,[(z(!0),B(R,null,L(a.suggestions,e=>(z(),B(`button`,{key:e.id,type:`button`,class:A([`aichat__suggest`,`is-${e.weight}`]),title:e.text,"data-suggest-id":e.id,onClick:t=>a.useSuggestion(e)},[(z(),B(`svg`,dF,[H(`use`,{href:e.icon},null,8,fF)])),H(`span`,pF,[H(`span`,mF,j(e.label),1),H(`span`,hF,j(e.hint),1)]),e.weight===`write`?(z(),B(`span`,gF,`改卡`)):G(`v-if`,!0)],10,uF))),128)),a.canShuffle?(z(),B(`button`,{key:0,type:`button`,class:`aichat__suggest-shuffle`,onClick:t[9]||=(...e)=>a.shuffleSuggestions&&a.shuffleSuggestions(...e)},[...t[33]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-refresh`})],-1),H(`span`,null,`换一批`,-1)]])):G(`v-if`,!0)])]))],544),G(` 回到底部:脱离底部吸附时出现 `),F(H(`button`,{type:`button`,class:`aichat__jump`,title:`回到底部`,onClick:t[13]||=e=>a.scrollToBottom(!0)},[...t[36]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-arrow-down`})],-1)]],512),[[Cc,!i.pinned&&i.messages.length]])]),G(` 常驻「常用」指令:有对话后空态建议区不再出现,这里保留一排轻量入口,随上下文同源 `),a.quickChips.length&&i.messages.length&&!i.busy?(z(),B(`div`,vF,[(z(!0),B(R,null,L(a.quickChips,e=>(z(),B(`button`,{key:e.id,type:`button`,class:A([`aichat__chip`,`is-${e.weight}`]),title:e.text,"data-suggest-id":e.id,onClick:t=>a.useSuggestion(e)},[(z(),B(`svg`,bF,[H(`use`,{href:e.icon},null,8,xF)])),H(`span`,null,j(e.label),1)],10,yF))),128))])):G(`v-if`,!0),G(` 操作反馈(附件解析失败 / 历史保存失败等) `),i.notice?(z(),B(`div`,{key:2,class:A([`aichat__notice`,`aichat__notice--${i.notice.type}`])},[H(`span`,null,j(i.notice.text),1),H(`button`,{type:`button`,class:`aichat__notice-x`,title:`关闭`,onClick:t[14]||=e=>i.notice=null},[...t[37]||=[H(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-x`})],-1)]])],2)):G(`v-if`,!0),U(s,{ref:`composerEl`,busy:i.busy,model:i.config.model,attachments:i.draftAttachments,placeholder:a.configReady?`描述你要改的卡片,Enter 发送 / Shift+Enter 换行`:`请先在设置中配置模型…`,context:i.contextUsage,onSend:a.onSend,onStop:a.stop,onPick:a.onPick,onAddPath:a.onAddPath,onRemoveAttachment:a.removeAttachment,onDropFiles:a.onDropFiles,onPasteImage:a.onPasteImage,onEscape:a.onEscape},null,8,[`busy`,`model`,`attachments`,`placeholder`,`context`,`onSend`,`onStop`,`onPick`,`onAddPath`,`onRemoveAttachment`,`onDropFiles`,`onPasteImage`,`onEscape`]),G(` 一级面板:模型库。从齿轮 / 横幅 / 消息内「去设置」进入 `),i.modelListOpen?(z(),V(c,{key:3,models:i.models,"active-id":i.activeId,"turn-running":i.turnRunning,onClose:a.closeModelList,onAdd:a.onModelAdd,onEdit:a.onModelEdit,onDelete:a.onModelDelete,onActivate:a.onModelActivate,onImportCcswitch:a.onImportCcSwitch,onOpenCommon:a.openCommon},null,8,[`models`,`active-id`,`turn-running`,`onClose`,`onAdd`,`onEdit`,`onDelete`,`onActivate`,`onImportCcswitch`,`onOpenCommon`])):G(`v-if`,!0),G(` 新增 / 编辑模型:复用 AiSettings(modelId 区分,initialModel 预填) `),i.modelEditOpen?(z(),V(l,{key:4,config:i.config,"model-id":i.editModelId,"initial-model":i.editInitialModel,onClose:a.onModelEditClose,onSaved:a.onModelSaved},null,8,[`config`,`model-id`,`initial-model`,`onClose`,`onSaved`])):G(`v-if`,!0),G(` 删除模型确认:二次确认后才真正落盘删除 `),U(u,{visible:!!i.confirmDeleteModel,"close-on-mask":!1,title:`删除模型`,message:a.deleteModelMessage,"confirm-text":`删除`,severity:`danger`,onConfirm:a.doDeleteModel,onCancel:t[15]||=e=>i.confirmDeleteModel=null},null,8,[`visible`,`message`,`onConfirm`]),G(` cc-switch 导入弹窗:列出 cc-switch 的 Codex 类供应商,勾选后批量导入模型库(按 model 去重) `),U(ac,{name:`modal`},{default:Rr(()=>[i.ccSwitchOpen?(z(),B(`div`,{key:0,class:`ni-overlay`,onClick:t[19]||=K(e=>i.ccSwitchOpen=!1,[`self`])},[H(`div`,SF,[H(`div`,CF,[t[38]||=H(`span`,{class:`ni-title`},`从 cc-switch 导入`,-1),H(`button`,{class:`ni-close`,type:`button`,title:`关闭`,onClick:t[16]||=e=>i.ccSwitchOpen=!1})]),H(`div`,wF,[H(`div`,TF,[G(` 加载中 `),i.ccSwitchLoading?(z(),B(`p`,EF,`正在读取 cc-switch 供应商…`)):i.ccSwitchReason?(z(),B(R,{key:1},[G(` 无可导入项 `),H(`p`,DF,j(i.ccSwitchReason),1)],2112)):(z(),B(R,{key:2},[G(` 供应商列表 `),H(`ul`,OF,[(z(!0),B(R,null,L(i.ccSwitchProviders,e=>(z(),B(`li`,{key:e.id,class:A([`ccsw-dlg__item`,{"is-active":i.ccSwitchSelected[e.id],"is-dup":e.duplicate}]),onClick:t=>a.toggleCcSwitchItem(e)},[H(`span`,{class:A([`ccsw-dlg__check`,{"is-on":i.ccSwitchSelected[e.id]}])},[i.ccSwitchSelected[e.id]?(z(),B(`svg`,AF,[...t[39]||=[H(`use`,{href:`#icon-check`},null,-1)]])):G(`v-if`,!0)],2),H(`span`,jF,[H(`span`,MF,[W(j(e.name||e.model)+` `,1),e.isCurrent?(z(),B(`span`,NF,`当前`)):G(`v-if`,!0),e.duplicate?(z(),B(`span`,PF,`已存在`)):G(`v-if`,!0)]),H(`span`,FF,[H(`span`,IF,j(e.model),1),t[40]||=H(`span`,{class:`ccsw-dlg__dot`},`·`,-1),H(`span`,LF,j(e.baseUrl),1)])])],10,kF))),128))])],2112))])]),H(`div`,RF,[H(`span`,zF,j(a.ccSwitchDupCount>0?`已有 ${a.ccSwitchDupCount} 个重复模型被自动跳过`:`勾选要导入的供应商,批量加入模型库`),1),H(`div`,BF,[H(`button`,{class:`ni-btn ni-btn--ghost`,type:`button`,onClick:t[17]||=e=>i.ccSwitchOpen=!1},`取消`),H(`button`,{class:`ni-btn`,type:`button`,disabled:i.ccSwitchLoading||!i.ccSwitchProviders.length||a.ccSwitchCheckedCount===0,onClick:t[18]||=(...e)=>a.confirmImportCcSwitch&&a.confirmImportCcSwitch(...e)},j(a.ccSwitchCheckedCount>0?`导入选中 ${a.ccSwitchCheckedCount} 项`:`导入`),9,VF)])])])])):G(`v-if`,!0)]),_:1}),G(` 通用设置:所有模型共享的执行策略 / 环境参数 `),i.commonOpen?(z(),V(d,{key:5,onClose:t[20]||=e=>i.commonOpen=!1,onSaved:a.onCommonSaved},null,8,[`onSaved`])):G(`v-if`,!0),U(u,{visible:i.confirmClear,"close-on-mask":!1,title:`清空对话记录`,message:`将删除卡片「${n.cardName||n.cardId||`当前卡片`}」的全部对话记录,此操作不可撤销。`,"confirm-text":`清空`,severity:`danger`,onConfirm:a.doClear,onCancel:t[21]||=e=>i.confirmClear=!1},null,8,[`visible`,`message`,`onConfirm`]),G(` 终止确认:生成中按 Esc 会走到这里。几十分钟的建卡被一次误按抹掉代价太大,故加一道确认 `),U(u,{visible:i.confirmStop,"close-on-mask":!1,title:`终止本次生成`,message:`已执行的写入与落盘产物都会保留,上下文也留在对话里,之后回复「继续」可从中断处接着做。确定现在终止?`,"confirm-text":`终止生成`,severity:`danger`,onConfirm:a.doStop,onCancel:t[22]||=e=>i.confirmStop=!1},null,8,[`visible`,`onConfirm`])],38)}var UF=Y(qP,[[`render`,HF],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/ChatPanel.vue`]]),WF=`/assets/site-icon-CFMif8z4.png`,GF={includeMocks:!0},KF=2500,qF=new tu,JF=ou({},qF);typeof window<`u`&&(window.__rt=JF);var YF=188,XF=320,ZF=200,QF=160,$F={name:`App`,components:{RenderTree:op,DebugPanel:eb,ApiCallPanel:gb,CardSelect:Pb,AlertCardLayer:Wb,DeviceOverlay:Tx,PickerOverlay:Px,DatePickerOverlay:Yx,SelectionOverlay:$x,HoverGuides:aS,RemotePreview:qS,AppToast:tC,ImageLightbox:xC,ConfirmDialog:vp,CardGallery:HC,NewCardDialog:cw,ComponentPalette:Cw,Switch:Dw,ChatPanel:UF},provide(){return{adapter:qF,cardRuntime:JF,customComponents:{}}},data(){return{adapter:qF,rt:JF,logoUrl:WF,appVersion:`0.53.4`,cardList:[],cardCount:0,galleryOpen:!1,cardDialog:{visible:!1,mode:`create`,cardId:``,cardDesc:``},selectedId:``,externalReloadNote:``,externalReloadTimer:null,selfSaveId:``,selfSaveAt:0,preview:null,chromeOff:!1,theme:`dark`,cardReady:!1,reloadToken:0,moveCollapseToken:0,refreshing:!1,loadingCard:!1,currentSchema:null,currentCard:null,cardImportMeta:null,localSchema:null,localData:null,selectedNodeId:``,activeTab:`vars`,apiPanelOpen:!0,addNodePanelOpen:!1,addNodeTarget:null,validateBadge:{state:`idle`,errors:0,warnings:0,renderOk:null,ts:0},validateTimer:null,copiedSchema:!1,copyTimer:null,savedCard:!1,savingCard:!1,saveTimer:null,savingRemote:!1,savedRemote:!1,verifiedRemote:null,saveRemoteTimer:null,syncingRemote:!1,syncedRemote:!1,remotePreviewOpen:!1,syncTarget:null,syncTimer:null,uploadingSlices:!1,loginModal:!1,loginName:``,loginPassword:``,loginSubmitting:!1,loginError:``,confirm:{show:!1,title:``,message:``,confirmText:`继续`,cancelText:`取消`,severity:`primary`,onConfirm:null},past:[],future:[],baseline:null,_commitTimer:null,viewportHeight:700,canvasBg:`gray`,refreshing:!1,bgOptions:[{key:`checker`,label:`棋盘`},{key:`white`,label:`白色`},{key:`gray`,label:`浅灰`},{key:`black`,label:`黑色`}],_previewWidthPx:372,_apiPanelWidthPx:360,presetSizes:[{key:375,value:`375`},{key:430,value:`430`},{key:188,value:`188`}],stageWidth:typeof window<`u`?window.innerWidth:1280,colsWidth:0,stageHeight:typeof window<`u`?window.innerHeight-52:748,dragging:!1,apiDragging:!1,armedLeft:!1,armedApi:!1,_armTimerLeft:null,_armTimerApi:null,_stageObserver:null,devServiceOpen:!1,aiChatOpen:(()=>{try{return sessionStorage.getItem(`cardbuddy:ai-chat-open`)===`1`}catch{return!1}})(),chatBusy:!1,chatProgress:null,devServiceForm:Pl(),apiBaseResolved:Il(),devSvcLive:`unknown`,devSvcDown:!1,_unsubCardsChanged:null}},computed:{fabTitle(){if(this.aiChatOpen)return`AI 开发助手(已打开)`;if(!this.chatBusy)return`AI 开发助手`;let e=this.chatProgress,t=e&&e.startedAt?`${zO(e.startedAt)} 开始 · `:``;return`AI 开发助手正在生成(${e?`${t}第 ${e.steps} 步 · 已用 ${RO(e.ms)}${e.stage?` · ${e.stage}`:``}${e.stalled?` · 疑似断流`:``}`:``}),点击展开查看`},currentBg(){return this.bgOptions.find(e=>e.key===this.canvasBg)||this.bgOptions[0]},cardIds(){return this.cardList.map(e=>e&&e.id).filter(Boolean)},canUndo(){return this.past.length>0},canRedo(){return this.future.length>0},devSvcBlockReason(){let e=this.devServiceForm||{};return String(e.baseUrl||``).trim()?e.enabled?null:`disabled`:`empty`},canPaste(){return!!Uu()},hasCardSource(){return!!(this.cardImportMeta&&this.cardImportMeta.source)},historyDirty(){return!this.localSchema||!this.currentSchema?!1:!this.structuralEqual(this.currentSchema,this.localSchema)||!this.dataEqual(this.rt&&this.rt.rootScope,this.localData)},devSvcConn(){return this.apiBaseResolved===null?`unconfigured`:this.devSvcLive===`open`?`open`:this.devSvcDown?`closed`:`connecting`},devSvcTitle(){if(this.apiBaseResolved===null)return this.devSvcBlockReason===`disabled`?`已填地址但未开启用本地服务`:`未配置本地开发服务(部署态必填)`;let e=this.apiBaseResolved===``?`同源开发服务`:`本地开发服务`;return this.devSvcLive===`open`?e+`已连接`:this.devSvcDown?e+`已断开(连接失败或服务已停止,重连中…)`:e+`连接中 / 重连中…`},devSvcClass(){return this.apiBaseResolved===null?`app__btn--warn`:this.devSvcLive===`open`?`app__btn--connected`:this.devSvcDown?`app__btn--disconnected`:`app__btn--reconnecting`},devSvcLabel(){return this.apiBaseResolved===null?`未配置本地服务`:this.devSvcLive===`open`?`本地服务已连接`:this.devSvcDown?`本地服务已断开`:`本地服务连接中…`},badgeText(){return{idle:`待校验`,pending:`校验中…`,ok:`校验通过`,error:`校验未通过`,nopython:`未配置校验`,fail:`校验服务异常`}[this.validateBadge.state]||`待校验`},badgeTitle(){let e=this.validateBadge;if(e.state===`ok`)return`结构合法 + 渲染不抛错(不保证画得对,视觉正确性见截图)`;if(e.state===`error`){let t=[];return e.errors&&t.push(`契约错误 ${e.errors} 个`),e.renderOk===!1&&t.push(`渲染抛出异常`),`校验未通过:`+(t.join(`;`)||`详见 /__validate 与 /__render-status`)}return e.state===`nopython`?`未找到 python3/python,无法跑契约校验(请安装 Python 或设置 DSL_PYTHON)`:e.state===`fail`?`校验服务异常(dev server 未启动或端点不可用)`:``},previewWidth(){if(this.chromeOff)return this.stageWidth;let{min:e,max:t}=this.previewBounds,n=this._previewWidthPx||YF;return Math.max(e,Math.min(t,n))},viewportWidth(){return this.stageWidth,typeof window<`u`?window.innerWidth:1280},debugSoftWidth(){return Math.max(ZF,Math.floor(this.viewportWidth/3))},previewBounds(){let e=this.stageWidth||0,t=Math.floor(e/2),n=e-XF-this.debugSoftWidth;return{min:YF,max:Math.max(YF,Math.min(t,n))}},debugMinWidth(){let e=this.colsWidth||Math.max(0,(this.stageWidth||0)-this.previewWidth);return Math.max(ZF,Math.min(this.debugSoftWidth,Math.floor(e)-XF))},apiPanelBounds(){let e=this.colsWidth||Math.max(0,(this.stageWidth||0)-this.previewWidth),t=Math.max(QF,Math.floor(e)-this.debugMinWidth);return{min:Math.min(XF,t),max:t}},canvasW(){return Math.round(this.previewWidth||375)},selectedCardName(){let e=this.cardList.find(e=>e.id===this.selectedId);return e&&e.name||this.selectedId||``},cardEmpty(){let e=this.currentSchema;if(!e||!e.view)return!0;let t=e.view.components;return!Array.isArray(t)||t.length===0},apiPanelWidth(){let{min:e,max:t}=this.apiPanelBounds,n=this._apiPanelWidthPx||360;return Math.max(e,Math.min(t,n))},frameStyle(){return{}}},watch:{activeTab(e){e!==`structure`&&(this.selectedNodeId=``,nS())},aiChatOpen(e){try{sessionStorage.setItem(`cardbuddy:ai-chat-open`,e?`1`:`0`)}catch{}},theme(e){document.documentElement.dataset.theme=e},apiPanelOpen(e){try{localStorage.setItem(`cardbuddy:api-panel-open`,e?`1`:`0`)}catch{}}},beforeUnmount(){this.viewportObserver&&this.viewportObserver.disconnect(),this._stageObserver&&this._stageObserver.disconnect(),this.saveTimer&&clearTimeout(this.saveTimer),this.syncTimer&&clearTimeout(this.syncTimer),this.saveRemoteTimer&&clearTimeout(this.saveRemoteTimer),window.removeEventListener(`keydown`,this.onKeydown)},mounted(){this.viewportObserver=new ResizeObserver(e=>{for(let t of e)this.viewportHeight=Math.round(t.contentRect.height)}),this.$refs.phoneViewport&&this.viewportObserver.observe(this.$refs.phoneViewport),this.loadPreviewWidth(),this.loadApiPanelWidth(),this._stageObserver=new ResizeObserver(e=>{for(let t of e){if(t.target===this.$refs.colsEl){this.colsWidth=Math.round(t.contentRect.width);continue}this.stageWidth=Math.round(t.contentRect.width),this.stageHeight=Math.round(t.contentRect.height)}}),this.$refs.stageEl&&this._stageObserver.observe(this.$refs.stageEl),this.$refs.colsEl&&this._stageObserver.observe(this.$refs.colsEl),window.addEventListener(`keydown`,this.onKeydown)},async created(){fx(JF);let e=new URLSearchParams(location.search).get(`chrome`);this.chromeOff=e===`off`||e===``;try{let e=localStorage.getItem(`cardbuddy:theme`);(e===`light`||e===`dark`)&&(this.theme=e)}catch{}document.documentElement.dataset.theme=this.theme;try{localStorage.getItem(`cardbuddy:api-panel-open`)===`0`&&(this.apiPanelOpen=!1)}catch{}await this.fetchCardList();let t=new URLSearchParams(location.search).get(`card`),n=null;try{let e=localStorage.getItem(`cardbuddy:selected-card`);e&&this.cardList.some(t=>t.id===e)&&(n=e)}catch{}let r=t&&this.cardList.some(e=>e.id===t)?t:n||this.cardList[0]&&this.cardList[0].id;r&&(this.selectedId=r,await this.loadCard(this.selectedId)),this.$watch(()=>this.rt.rootScope,()=>{this.syncDataToSchema()},{deep:!0}),this.setupCardsChanged()},methods:{setupCardsChanged(){if(this._unsubCardsChanged){try{this._unsubCardsChanged()}catch{}this._unsubCardsChanged=null}this.devSvcLive=`connecting`,this._unsubCardsChanged=Hl(e=>this.onCardsChanged(e),e=>this.onDevServiceState(e))},onDevServiceState(e){let t=this.devSvcLive===`connecting`;this.devSvcLive=e,e===`open`?this.devSvcDown=!1:e===`closed`&&(this.devSvcDown=!0),e===`connecting`?!t&&!this._svcWatchdog&&(this._svcWatchdog=setTimeout(()=>{this.devSvcLive===`connecting`&&(this.devSvcLive=`closed`,this.devSvcDown=!0),this._svcWatchdog=null},8e3)):this._svcWatchdog&&=(clearTimeout(this._svcWatchdog),null)},saveDevService(){Fl(this.devServiceForm),this.apiBaseResolved=Il(),this.setupCardsChanged(),this.devServiceOpen=!1,X(`本地开发服务配置已保存`,`ok`),this.fetchCardList()},beginColumnDrag(e,t,n){let r=e&&e.currentTarget;if(!r)return;let i=e.pointerId;try{r.setPointerCapture(i)}catch{}let a=()=>{r.removeEventListener(`pointermove`,t),r.removeEventListener(`pointerup`,a),r.removeEventListener(`pointercancel`,a),window.removeEventListener(`blur`,a);try{r.hasPointerCapture?.(i)&&r.releasePointerCapture(i)}catch{}document.body.style.cursor=``,document.body.style.userSelect=``,n()};document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,r.addEventListener(`pointermove`,t),r.addEventListener(`pointerup`,a),r.addEventListener(`pointercancel`,a),window.addEventListener(`blur`,a)},armSplitter(e){let t=e===`api`?`_armTimerApi`:`_armTimerLeft`;clearTimeout(this[t]),this[t]=setTimeout(()=>{e===`api`?this.armedApi=!0:this.armedLeft=!0},600)},disarmSplitter(e){let t=e===`api`?`_armTimerApi`:`_armTimerLeft`;if(clearTimeout(this[t]),this[t]=null,e===`api`){if(this.apiDragging)return;this.armedApi=!1}else{if(this.dragging)return;this.armedLeft=!1}},startDrag(e){if(this.chromeOff||!this.armedLeft)return;let t=this.$refs.stageEl;if(!t)return;let n=t.getBoundingClientRect().left;this.dragging=!0,this.beginColumnDrag(e,e=>{let{min:t,max:r}=this.previewBounds;this._previewWidthPx=Math.max(t,Math.min(r,Math.round(e.clientX-n)))},()=>{this.dragging=!1,this.savePreviewWidth()})},startApiDrag(e){if(this.chromeOff||!this.apiPanelOpen||!this.armedApi)return;let t=this.$refs.colsEl;if(!t)return;let n=t.getBoundingClientRect().right;this.apiDragging=!0,this.beginColumnDrag(e,e=>{let{min:t,max:r}=this.apiPanelBounds;this._apiPanelWidthPx=Math.max(t,Math.min(r,Math.round(n-e.clientX)))},()=>{this.apiDragging=!1,this.saveApiPanelWidth()})},loadPreviewWidth(){try{let e=localStorage.getItem(`cardbuddy:preview-width`);if(e!=null){let t=parseInt(e,10);!Number.isNaN(t)&&t>=188&&(this._previewWidthPx=t)}}catch{}},savePreviewWidth(){try{localStorage.setItem(`cardbuddy:preview-width`,String(Math.round(this._previewWidthPx)))}catch{}},setPresetWidth(e){if(this.chromeOff)return;let{min:t,max:n}=this.previewBounds;this._previewWidthPx=Math.max(t,Math.min(n,e)),this.savePreviewWidth()},loadApiPanelWidth(){try{let e=localStorage.getItem(`cardbuddy:api-panel-width`);if(e!=null){let t=parseInt(e,10);!Number.isNaN(t)&&t>=320&&(this._apiPanelWidthPx=t)}}catch{}},saveApiPanelWidth(){try{localStorage.setItem(`cardbuddy:api-panel-width`,String(Math.round(this.apiPanelWidth)))}catch{}},chooseBg(e){this.canvasBg=e},onSelect(e){if(e!==this.selectedId){if(this.chatBusy){X(`AI 正在生成「${this.selectedId}」:先点 ■ 停止,或等本轮结束后再切卡`,`err`,3600);return}this.loadingCard=!0,this.selectedId=e,this.loadCard(e,{clearAll:!0})}},selectCard(e){this.selectedId=e;try{localStorage.setItem(`cardbuddy:selected-card`,e)}catch{}},openGallery(){this.cardList.length&&(this.galleryOpen=!0)},openNewCard(){this.cardDialog.mode=`create`,this.cardDialog.cardId=``,this.cardDialog.cardDesc=``,this.cardDialog.visible=!0,this.fetchCardList()},openRenameCard(){this.selectedId&&(this.cardDialog.mode=`rename`,this.cardDialog.cardId=this.selectedId,this.cardDialog.cardDesc=this.currentSchema&&this.currentSchema.desc||``,this.cardDialog.visible=!0,this.fetchCardList())},async onCardRenamed({oldId:e,id:t}){if(this.cardDialog.visible=!1,X(t===e?`已更新卡片描述`:`已重命名卡片 ${e} → ${t}`,`ok`),t!==e)return this.applyCardRename(e,t);await this.fetchCardList(),await this.loadCard(t)},async applyCardRename(e,t){if(!e||!t||e===t)return;let n=`${e}->${t}`;if(this._renameAppliedKey===n)return;this._renameAppliedKey=n,setTimeout(()=>{this._renameAppliedKey===n&&(this._renameAppliedKey=``)},1e3);let r=this.selectedId===e;if(this.$refs.chatPanel?.migrateCard(e,t),r&&this.selectCard(t),this.selfSaveId=t,this.selfSaveAt=Date.now(),await this.fetchCardList(),r){if(this.historyDirty&&!this.confirm.show){this.requestConfirm({title:`卡片已重命名`,message:`卡片「${e}」已重命名为「${t}」,而编辑器内还有未保存的改动。\n重新载入会放弃这些未保存改动并显示磁盘版本;保留改动则继续用当前编辑器内容(后续保存会写到新目录 ${t})。`,confirmText:`重新载入`,cancelText:`保留我的改动`,onConfirm:()=>this.loadCard(t)});return}await this.loadCard(t)}},closeGallery(){this.galleryOpen=!1},async openCardFolder(){if(this.selectedId)try{let e=await q(`/__open-folder`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:this.selectedId})}),t=(e.headers.get(`content-type`)||``).includes(`application/json`)?await e.json().catch(()=>({})):{};!e.ok||!t.ok?X(t.error||`打开文件夹失败`,`err`):X(`已打开卡片文件夹`,`ok`)}catch{X(`无法连接本地开发服务,请确认已启动`,`err`)}},async refreshCard(){if(!(!this.selectedId||this.refreshing)){this.refreshing=!0;try{await this.loadCard(this.selectedId)}finally{this.refreshing=!1}}},toggleTheme(){this.theme=this.theme===`light`?`dark`:`light`;try{localStorage.setItem(`cardbuddy:theme`,this.theme)}catch{}},toggleApiPanel(){this.apiPanelOpen=!this.apiPanelOpen},async refreshValidateBadge(){let e=this.selectedId;if(!(!e||!this.preview)&&(this.validateTimer&&clearTimeout(this.validateTimer),this.validateBadge={...this.validateBadge,state:`pending`},await new Promise(e=>{this.validateTimer=setTimeout(e,120)}),this.selectedId===e))try{let[t,n]=await Promise.all([q(`/__validate/${encodeURIComponent(e)}`),q(`/__render-status/${encodeURIComponent(e)}`)]);if(!t.ok){this.validateBadge={...this.validateBadge,state:t.status===503?`nopython`:`fail`};return}let r=await t.json().catch(()=>null),i=n.ok?await n.json().catch(()=>null):null;if(!r){this.validateBadge={...this.validateBadge,state:`fail`};return}let a=!!r.ok,o=!i||!!i.renderOk,s=a&&o?`ok`:`error`,c=this.validateBadge.state!==s;this.validateBadge={state:s,errors:(r.errors||[]).length,warnings:(r.warnings||[]).length,renderOk:o,ts:Date.now()},c&&(s===`ok`||s===`error`)&&this.celebrateValidate(s)}catch{this.validateBadge={...this.validateBadge,state:`fail`}}},celebrateValidate(e=`ok`){let t=this.$refs.validateBadgeEl;if(!t||window.matchMedia&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;t.classList.remove(`is-celebrating`),t.offsetWidth,t.classList.add(`is-celebrating`),setTimeout(()=>t.classList.remove(`is-celebrating`),600);let n=t.getBoundingClientRect(),r={ok:`--ok`,error:`--danger`,pending:`--warn`,fail:`--text-faint`,nopython:`--text-faint`}[e]||`--ok`,i={ok:`#52c41a`,error:`#F5222D`,pending:`#FAAD14`,fail:`#8c8c8c`,nopython:`#8c8c8c`}[e]||`#52c41a`,a=getComputedStyle(t).getPropertyValue(r).trim()||i,o=document.createElement(`div`);o.className=`app__confetti`,o.style.left=n.left+n.width/2+`px`,o.style.top=n.top+n.height/2+`px`;let s=[`polygon(50% 0%, 0% 100%, 100% 100%)`,`polygon(62% 0%, 100% 40%, 45% 100%, 0% 52%)`,`polygon(0% 0%, 100% 18%, 82% 100%, 12% 70%)`,`polygon(22% 0%, 100% 8%, 88% 100%, 0% 76%)`,`polygon(0% 32%, 100% 0%, 76% 100%, 18% 86%)`,`polygon(8% 0%, 100% 22%, 70% 100%, 0% 64%)`,`polygon(0% 12%, 100% 0%, 100% 78%, 30% 100%, 12% 55%)`],c=n.width/2,l=n.height/2;for(let e=0;e<22;e++){let e=document.createElement(`span`);e.className=`app__confetti-bit`;let t=Math.random()*4|0,n,r;t===0?(n=(Math.random()*2-1)*c,r=-l):t===1?(n=c,r=(Math.random()*2-1)*l):t===2?(n=(Math.random()*2-1)*c,r=l):(n=-c,r=(Math.random()*2-1)*l);let i=Math.hypot(n,r)||1,u=Math.atan2(r/i,n/i)+(Math.random()-.5)*.5,d=16+Math.random()*26;e.style.setProperty(`--sx`,n.toFixed(1)+`px`),e.style.setProperty(`--sy`,r.toFixed(1)+`px`),e.style.setProperty(`--tx`,(Math.cos(u)*d).toFixed(1)+`px`),e.style.setProperty(`--ty`,(Math.sin(u)*d).toFixed(1)+`px`),e.style.setProperty(`--rot`,(Math.random()*720-360).toFixed(0)+`deg`),e.style.setProperty(`--clip`,s[Math.random()*s.length|0]),e.style.setProperty(`--c`,a),e.style.setProperty(`--o`,(.68+Math.random()*.27).toFixed(2));let f=Math.random(),p,m;f<.35?(p=1.5+Math.random()*2,m=10+Math.random()*10):f<.75?(p=4+Math.random()*5,m=p*(.6+Math.random()*.8)):(p=2+Math.random()*2.5,m=p),e.style.width=p.toFixed(0)+`px`,e.style.height=m.toFixed(0)+`px`,o.appendChild(e)}document.body.appendChild(o),setTimeout(()=>o.remove(),800)},async loadCard(e,t={}){if(e){this.loadingCard=!0;try{let n=await q(`/__card/${encodeURIComponent(e)}`);if(!n.ok){this.rt.pushError(`loadCard`,`HTTP `+n.status);return}let r=await n.json();if(!r.schema){this.rt.pushError(`loadCard`,`schema 读取失败`);return}this.selectCard(e),t.clearAll?this.rt.clearErrors():this.rt.clearBindingErrors(),this.rt.clearApiCalls(),t.keepScope||this.rt.setRootScope(E_(r.schema,GF)),this.currentCard={schema:r.schema},this.currentSchema=r.schema,this.cardImportMeta=null,this.fetchImportMeta(e),this.localSchema=this.cloneSchema(r.schema),this.localData=this.cloneData(E_(r.schema,GF)),this.preview=Fu(r.schema),typeof window<`u`&&(window.__cardModel=Vu(r.schema)),this.cardReady=!1,this.$nextTick(()=>{this.cardReady=!0}),this.syncDataToSchema(),this.selectedNodeId=``,this.baseline={schema:this.cloneSchema(this.currentSchema)},this.reloadToken+=1,Bb(),px(),this.refreshValidateBadge(),await this.loadHistory(e)}finally{this.loadingCard=!1}}},cloneSchema(e){return e?JSON.parse(JSON.stringify(e,(e,t)=>e===`_schemaNode`?void 0:t)):null},normalizeForCompare(e){let t=this.cloneSchema(e);if(t&&t.dictionary&&Array.isArray(t.dictionary.inputParams))for(let e of t.dictionary.inputParams)e&&typeof e==`object`&&(e.defaultValue=void 0);return t},structuralEqual(e,t){return!e||!t?e===t:JSON.stringify(this.normalizeForCompare(e))===JSON.stringify(this.normalizeForCompare(t))},cloneData(e){return e==null?e:JSON.parse(JSON.stringify(e,(e,t)=>e===`_schemaNode`?void 0:t))},dataEqual(e,t){return JSON.stringify(e)===JSON.stringify(t)},applySchemaSnapshot(e){if(!this.selectedId||!e)return;let t=e.schema||e,n=e.data==null?E_(t,GF):e.data;this.currentSchema=this.cloneSchema(t),this.rt.setRootScope(this.cloneData(n)),this.preview=Fu(this.currentSchema),typeof window<`u`&&(window.__cardModel=Vu(this.currentSchema)),this.syncDataToSchema(),this.selectedNodeId=``,this.reloadToken+=1,this.refreshValidateBadge()},commitHistory(){if(!this.currentSchema||!this.baseline)return;let e=this.structuralEqual(this.currentSchema,this.baseline.schema),t=this.dataEqual(this.rt.rootScope,E_(this.baseline.schema,GF));if(e&&t)return;let n={schema:this.baseline.schema};this.past.push(n),this.past.length>30&&this.past.shift(),this.future=[],this.baseline={schema:this.cloneSchema(this.currentSchema)},this.persistSnapshot(n)},scheduleCommit(){this._commitTimer&&clearTimeout(this._commitTimer),this._commitTimer=setTimeout(()=>{this._commitTimer=null,this.commitHistory()},500)},persistSnapshot(e){let t=this.selectedId;if(!t)return;let n=e.schema||e;q(`/__history/${encodeURIComponent(t)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({schema:n},(e,t)=>e===`_schemaNode`?void 0:t,2)}).catch(e=>console.warn(`[历史快照落盘失败]`,e))},async loadHistory(e){this.past=[],this.future=[];try{let t=await q(`/__history/${encodeURIComponent(e)}`);if(!t.ok)return;let n=await t.json().catch(()=>null),r=n&&n.snapshots||[];this.past=r.slice(-30).map(e=>({schema:e.schema,data:e.data==null?E_(e.schema,GF):e.data}))}catch(e){console.warn(`[加载编辑历史失败]`,e)}},undo(){if(!this.canUndo)return;let e=this.past.pop();this.future.push(this.baseline),this.future.length>30&&this.future.shift(),this.baseline=e,this.applySchemaSnapshot(e)},redo(){if(!this.canRedo)return;let e=this.future.pop();this.past.push(this.baseline),this.past.length>30&&this.past.shift(),this.baseline=e,this.applySchemaSnapshot(e)},async applyHistoryToLocal(){this.loadingCard||!this.historyDirty||!this.preview||!this.selectedId||await this.saveCard()&&X(`已将该版本保存到本地`,`ok`)},onSchemaChanged(){!this.selectedId||!this.currentSchema||(this.reloadToken+=1,this.preview=Fu(this.currentSchema),typeof window<`u`&&(window.__cardModel=Vu(this.currentSchema)),this.syncDataToSchema(),this.selectedNodeId=``)},onSchemaCommit(){!this.selectedId||!this.currentSchema||(this.reloadToken+=1,this.preview=Fu(this.currentSchema),typeof window<`u`&&(window.__cardModel=Vu(this.currentSchema)),this.syncDataToSchema(),this.selectedNodeId=``,this.commitHistory())},syncDataToSchema(){let e=this.currentSchema;if(!e||!e.dictionary||!Array.isArray(e.dictionary.inputParams))return;let t=this.rt&&this.rt.rootScope;if(!t||typeof t!=`object`)return;let n=e.dictionary.inputParams,r=D_(e);for(let e of Object.keys(t)){let i=n.find(t=>t&&(t.key===e||t.name===e));if(!i)continue;let a=JSON.parse(JSON.stringify(t[e],(e,t)=>e===`_schemaNode`?void 0:t));r&&Object.prototype.hasOwnProperty.call(r,e)?r[e]=a:i.defaultValue=a}},onSelectNode(e){this.selectedNodeId=e||``},findPreviewNodeById(e,t){if(!e||t==null)return null;let n=String(t),r=e=>{if(!e)return null;if(String(e.id)===n)return e;let t=[];if(e.components&&t.push(...e.components),e.slots)for(let n of e.slots)n.components&&t.push(...n.components);for(let e of t){let t=r(e);if(t)return t}return null};return r(e)},copySelectedNode(){let e=this.selectedNodeId;if(!e||e===`_root`||!this.currentSchema||!this.preview)return;let t=this.findPreviewNodeById(this.preview.view,e);if(!t)return;let n=this.findSchemaNodeByComponentId(this.currentSchema.view,t.componentId);n&&(Gu(n.node,this.selectedId),X(`已复制节点(含子节点)`,`ok`))},pasteNode(){let e=Uu();if(!e||!this.currentSchema)return;let t=Ku(e),n=[...new Set(t.filter(e=>!yu[e]))];if(n.length){X(`粘贴失败:含未知组件类型 `+n.join(`、`),`err`);return}let r=JSON.parse(JSON.stringify(e,(e,t)=>e===`_schemaNode`?void 0:t));qu(r);let i=this.selectedNodeId&&this.selectedNodeId!==`_root`?this.findPreviewNodeById(this.preview.view,this.selectedNodeId):null,a=`root`;i&&(a=Mu(i.className)?`into`:`after`),this.insertClone(r,i,a);let o=Wu();o&&o!==this.selectedId?X(`已从卡片「${o}」跨卡片粘贴到「${this.selectedId}」`,`ok`):X(`已粘贴节点(含子节点)`,`ok`)},duplicateNode(){let e=this.selectedNodeId;if(!e||e===`_root`||!this.currentSchema||!this.preview)return;let t=this.findPreviewNodeById(this.preview.view,e);if(!t)return;let n=this.findSchemaNodeByComponentId(this.currentSchema.view,t.componentId);if(!n)return;let r=JSON.parse(JSON.stringify(n.node,(e,t)=>e===`_schemaNode`?void 0:t));qu(r),n.parentArr.splice(n.index+1,0,r),this.afterStructuralEdit(r.componentId)},insertClone(e,t,n){let r=this.currentSchema;if(n===`root`)r.view.components||(r.view.components=[]),r.view.components.push(e);else if(n===`into`){let n=t&&t._schemaNode;if(!n){r.view.components||(r.view.components=[]),r.view.components.push(e),this.afterStructuralEdit(e.componentId);return}let i=Nu(t.className),a=(n.slots||[]).find(e=>e.slotKey===i);a||(n.slots||=[],a={slotKey:i,slotScope:!1,slotSwitch:`1`,components:[]},n.slots.push(a)),a.components||(a.components=[]),a.components.push(e)}else{let n=this.findSchemaNodeByComponentId(r.view,t.componentId);n?n.parentArr.splice(n.index+1,0,e):(r.view.components||(r.view.components=[]),r.view.components.push(e))}this.afterStructuralEdit(e.componentId)},afterStructuralEdit(e){let t=this.currentSchema;this.reloadToken+=1,this.preview=Fu(t),typeof window<`u`&&(window.__cardModel=Vu(t)),this.syncDataToSchema(),this.selectedNodeId=e&&this.findViewIdByComponentId(this.preview.view,e)||``,this.scheduleCommit()},deleteSelectedNode(){let e=this.selectedNodeId;if(!e||e===`_root`||!this.currentSchema||!this.preview)return;let t=this.findPreviewNodeById(this.preview.view,e);if(!t)return;let n=this.findSchemaNodeByComponentId(this.currentSchema.view,t.componentId);n&&(n.parentArr.splice(n.index,1),this.reloadToken+=1,this.preview=Fu(this.currentSchema),typeof window<`u`&&(window.__cardModel=Vu(this.currentSchema)),this.syncDataToSchema(),this.selectedNodeId=``,nS(),this.scheduleCommit())},hasTextSelection(){if(typeof window>`u`||!window.getSelection)return!1;let e=window.getSelection();return!!e&&!e.isCollapsed&&e.toString().trim()!==``},hasNodeSelection(){return!!this.selectedNodeId&&this.selectedNodeId!==`_root`},isEditableTarget(e){let t=e.target;if(!t)return!1;let n=t.tagName;return!!(n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t.isContentEditable)},onKeydown(e){if(this.chromeOff||!this.preview)return;let t=this.isEditableTarget(e),n=e.ctrlKey||e.metaKey,r=e.key;if(n&&(r===`c`||r===`C`)){if(t||this.hasTextSelection()||!this.hasNodeSelection())return;this.copySelectedNode(),e.preventDefault();return}if(n&&(r===`v`||r===`V`)){if(t||this.hasTextSelection()||!this.hasNodeSelection()||!Uu())return;this.pasteNode(),e.preventDefault();return}if(n&&(r===`d`||r===`D`)){if(t||this.hasTextSelection()||!this.hasNodeSelection())return;this.duplicateNode(),e.preventDefault();return}if(n&&(r===`z`||r===`Z`)){if(t)return;e.preventDefault(),e.shiftKey?this.redo():this.undo();return}if(n&&(r===`y`||r===`Y`)){if(t)return;e.preventDefault(),this.redo();return}if(r===`Delete`||r===`Backspace`){if(t||!this.selectedNodeId||this.selectedNodeId===`_root`)return;e.preventDefault(),this.deleteSelectedNode();return}if(r===`Escape`){this.selectedNodeId&&(this.selectedNodeId=``,e.preventDefault());return}},onHoverNode(e){if(!e){nS();return}if(e.leave){nS(e.id);return}let t=typeof document<`u`?document.querySelector(`.phone__screen`):null;if(!t){nS(e.id);return}let n=e=>window.CSS&&CSS.escape?CSS.escape(String(e)):String(e).replace(/["\\\]]/g,`\\$&`),r=null;e.componentId!=null&&(r=t.querySelector(`[data-cid="`+n(e.componentId)+`"]`)),!r&&e.id!=null&&(r=t.querySelector(`[data-cid="`+n(e.id)+`"]`)),r?tS(r,e.id):nS(e.id)},onCanvasClick(e){if(!e.ctrlKey&&!e.metaKey||this.chromeOff)return;let t=e.target&&e.target.closest?e.target.closest(`[data-cid]`):null;if(!t)return;let n=t.getAttribute(`data-cid`);if(!n)return;let r=this.findPreviewNodeByCid(n);r&&(this.activeTab=`structure`,this.selectedNodeId=r.id)},onAiLocateNode(e){let t=e?this.findPreviewNodeByCid(e):null;if(!t){X(`没找到组件 ${e||``}:卡片可能已被改动,重新校验一次即可`,`err`);return}this.activeTab=`structure`,this.selectedNodeId=t.id},findPreviewNodeByCid(e){let t=this.preview&&this.preview.view;if(!t)return null;let n=String(e),r=e=>{if(!e)return null;if(String(e.componentId==null?e.id:e.componentId)===n)return e;let t=[];if(e.components&&t.push(...e.components),e.slots)for(let n of e.slots)n.components&&t.push(...n.components);for(let e of t){let t=r(e);if(t)return t}return null};return r(t)},onAddNode(e){this.currentSchema&&(this.addNodeTarget=e||null,this.addNodePanelOpen=!0)},cancelAddNode(){this.addNodePanelOpen=!1,this.addNodeTarget=null},findSchemaLocation(e,t){let n=e=>{for(let r=0;r<e.length;r++){let i=e[r];if(i===t)return{containerArr:e,index:r};let a=i.slots||[];for(let e of a){let t=n(e.components||[]);if(t)return t}}return null};return n(e&&e.components||[])},findViewIdByComponentId(e,t){if(!e)return null;if(e.componentId===t)return e.id;let n=[];if(e.components&&n.push(...e.components),e.slots)for(let t of e.slots)t.components&&n.push(...t.components);for(let e of n){let n=this.findViewIdByComponentId(e,t);if(n)return n}return null},findSchemaNodeByComponentId(e,t){let n=(e,r)=>{for(let i=0;i<e.length;i++){let a=e[i];if(a.componentId===t)return{node:a,parentArr:e,index:i,owner:r};let o=a.slots||[];for(let e of o){let t=n(e.components||[],a);if(t)return t}}return null};return n(e&&e.components||[],`root`)},isDescendantCompId(e,t){if(!t||!t.componentId)return!1;if(t.componentId===e)return!0;let n=[];if(t.components&&n.push(...t.components),t.slots)for(let e of t.slots)e.components&&n.push(...e.components);for(let t of n)if(this.isDescendantCompId(e,t))return!0;return!1},moveNode(e,t,n){let r=this.currentSchema;if(!r||!r.view||e===t)return!1;let i=this.findSchemaNodeByComponentId(r.view,e);if(!i)return!1;let a=i.node;if(this.isDescendantCompId(t,a))return!1;let o,s;if(t===`__root__`)r.view.components||(r.view.components=[]),o=r.view.components,s=o.length;else{let e=this.findSchemaNodeByComponentId(r.view,t);if(!e)return!1;let i=e.node;if(n===`inside`){if(!Mu(i.className))return!1;let e=Nu(i.className),t=(i.slots||[]).find(t=>t.slotKey===e);t||(i.slots||=[],t={slotKey:e,slotScope:!1,slotSwitch:`1`,components:[]},i.slots.push(t)),t.components||(t.components=[]),o=t.components,s=o.length}else o=e.parentArr,s=n===`before`?e.index:e.index+1}let c=o===i.parentArr&&i.index<s;return i.parentArr.splice(i.index,1),c&&--s,o.splice(s,0,a),a},onMoveNode({sourceCompId:e,targetCompId:t,position:n}){if(!this.currentSchema||!this.moveNode(e,t,n))return;this.reloadToken+=1,this.preview=Fu(this.currentSchema),typeof window<`u`&&(window.__cardModel=Vu(this.currentSchema)),this.syncDataToSchema();let r=this.findViewIdByComponentId(this.preview.view,e);this.selectedNodeId=r||``,r&&(this.moveCollapseToken+=1)},onPickComponent(e){let t=this.addNodeTarget||{},n=t.node||null,r=t.mode||`auto`,i=this.currentSchema;if(!i){this.cancelAddNode();return}let a;try{a=Pu(e)}catch(e){console.error(`[创建组件节点失败]`,e),this.rt.pushError(`addNode`,String(e&&e.message)),this.cancelAddNode();return}let o=!n||n.className===`Root`;if((r===`before`||r===`after`)&&!o){let e=n._schemaNode,t=e?this.findSchemaLocation(i.view,e):null;if(!t)i.view.components||(i.view.components=[]),i.view.components.push(a);else{let e=r===`before`?t.index:t.index+1;t.containerArr.splice(e,0,a)}}else if(o)i.view.components||(i.view.components=[]),i.view.components.push(a);else{let e=n._schemaNode;if(!e){this.cancelAddNode();return}if(Mu(n.className)){let t=Nu(n.className),r=(e.slots||[]).find(e=>e.slotKey===t);r||(e.slots||=[],r={slotKey:t,slotScope:!1,slotSwitch:`1`,components:[]},e.slots.push(r)),r.components||(r.components=[]),r.components.push(a)}else{let t=this.findSchemaLocation(i.view,e);t?t.containerArr.splice(t.index+1,0,a):(i.view.components||(i.view.components=[]),i.view.components.push(a))}}this.cancelAddNode(),this.reloadToken+=1,this.preview=Fu(i),typeof window<`u`&&(window.__cardModel=Vu(i)),this.syncDataToSchema();let s=this.findViewIdByComponentId(this.preview.view,a.componentId);this.selectedNodeId=s||``,this.scheduleCommit()},async copySchema(){if(!this.currentSchema)return;this.syncDataToSchema();let e=``;try{let t={...this.currentSchema};this.rt&&this.rt.rootScope&&(t.data=this.rt.rootScope),e=JSON.stringify(t,(e,t)=>{if(e!==`_schemaNode`)return t},2)}catch{e=`(无法序列化)`}await this.doCopy(e)&&(this.copiedSchema=!0,this.copyTimer&&clearTimeout(this.copyTimer),this.copyTimer=setTimeout(()=>{this.copiedSchema=!1},1500))},async doCopy(e){try{if(navigator.clipboard&&navigator.clipboard.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}},async runSync(e){if(!this.syncingRemote&&!(e&&!this.selectedId)){this.syncingRemote=!0,this.syncedRemote=!1,this.syncTarget=e?`selected`:`full`;try{let t=await q(`/__sync`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?{cardCode:e}:{})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.message||e.error||`HTTP `+t.status)}let n=await t.json();if(n.needCredentials){this.openLoginModal();return}if(!n.success){let e=(n.failed||[]).map(e=>`${e.id}: ${e.error}`).join(`; `);throw Error(e||`同步失败`)}this.syncedRemote=!0,this.syncTimer&&clearTimeout(this.syncTimer),this.syncTimer=setTimeout(()=>{this.syncedRemote=!1,this.syncTarget=null},1800),await this.onRefresh(),X(this.syncTarget===`selected`?`已同步当前卡片到本地`:`全量同步完成`,`ok`)}catch(e){console.error(`[同步远程数据失败]`,e),X(`同步失败:`+(e&&e.message),`err`)}finally{this.syncingRemote=!1}}},syncRemote(){return this.runSync()},syncSelected(){return this.runSync(this.selectedId)},openLoginModal(){this.loginModal=!0,this.loginName=``,this.loginPassword=``,this.loginError=``},closeLoginModal(){this.loginSubmitting||(this.loginModal=!1,this.loginPassword=``,this.loginError=``)},async submitLogin(){if(this.loginSubmitting)return;let e=this.loginName.trim(),t=this.loginPassword;if(!e||!t){this.loginError=`账号与密码均不能为空`;return}this.loginSubmitting=!0,this.loginError=``;try{let n=await q(`/__login-credentials`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({loginName:e,loginPassword:t})}),r=await n.json().catch(()=>({}));if(!n.ok||!r.ok)throw Error(r.message||r.error||`HTTP `+n.status);this.loginModal=!1,this.loginPassword=``,X(`凭据已保存,正在重试同步…`,`ok`),await this.runSync(this.syncTarget===`selected`?this.selectedId:void 0)}catch(e){this.loginError=`保存失败:`+(e&&e.message)}finally{this.loginSubmitting=!1}},chooseSync(e){if(e===`full`){if(this.syncingRemote)return;this.requestConfirm({title:`全量同步`,message:`即将从远端 FinMall 拉取完整卡片列表,并逐张覆盖本地同名卡片。本地独有卡片会保留,但被覆盖卡片的未保存改动将丢失,且无法撤销。是否继续?`,confirmText:`继续同步`,severity:`warn`,onConfirm:()=>this.syncRemote()});return}!this.preview||!this.selectedId||this.syncingRemote||this.requestConfirm({title:`当前同步`,message:`即将从远端 FinMall 拉取当前卡片「${this.selectedId}」的最新版本并覆盖本地。本地未保存的改动将丢失,且无法撤销。是否继续?`,confirmText:`继续同步`,onConfirm:()=>this.syncSelected()})},chooseRsave(e){if(e===`save`){if(!this.preview||!this.selectedId||this.savingRemote||!this.hasCardSource)return;this.requestConfirm({title:`版本推送`,message:`即将把本地卡片「${this.selectedId}」的当前版本推送并覆盖到远端 FinMall。线上版本会被立即更新,且该操作不可撤销。是否继续?`,confirmText:`继续推送`,severity:`warn`,onConfirm:()=>this.saveToRemote()});return}if(e===`slices`){if(!this.preview||!this.selectedId||this.uploadingSlices)return;this.requestConfirm({title:`切图上传`,message:`即将把当前卡片「${this.selectedId}」引用的本地切图(src/slices/)上传到 FinMall 图片库,并把卡片里的 /slices/ 引用替换为线上地址(@filestore/…)。本地切图文件保留不动;内容未变的切图会直接复用已有线上地址,不重复上传。`+(this.historyDirty?`
|
|
286
289
|
当前卡片有未保存的改动,会先保存到本地再执行,避免被随后的重载丢弃。`:``)+`
|
|
287
|
-
是否继续?`,confirmText:`继续上传`,onConfirm:()=>this.uploadCardSlices()});return}!this.preview||!this.selectedId||!this.hasCardSource||(this.remotePreviewOpen=!0)},requestConfirm({title:e,message:t,confirmText:n,cancelText:r,severity:i,onConfirm:a}){this.confirm={show:!0,title:e,message:t,confirmText:n||`继续`,cancelText:r||`取消`,severity:[`primary`,`warn`,`danger`].includes(i)?i:`primary`,onConfirm:a}},onConfirmDialog(){let e=this.confirm.onConfirm;this.confirm.show=!1,this.confirm.onConfirm=null,typeof e==`function`&&e()},onCancelDialog(){this.confirm.show=!1,this.confirm.onConfirm=null},async saveCard(){if(!this.preview||!this.selectedId)return;this.savingCard=!0;let e=this.selectedId;this.selfSaveId=e,this.selfSaveAt=Date.now();try{try{let e=await this.fetchDiskCard(this.selectedId);if(e&&e.schema){let t=e.schema,n=this.currentSchema;n&&(t.pageId&&(n.pageId=t.pageId),t.name&&(n.name=t.name),t.desc!==void 0&&(n.desc=t.desc))}}catch{}this.syncDataToSchema();let e={schema:this.currentSchema},t=JSON.stringify(e,(e,t)=>e===`_schemaNode`?void 0:t,2),n=await J(`/__card/${encodeURIComponent(this.selectedId)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:t});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.message||`HTTP `+n.status)}return this.currentCard={schema:e.schema},this.localSchema=this.cloneSchema(this.currentSchema),this.localData=this.cloneData(Xg(this.currentSchema,fF)),this.savedCard=!0,this.refreshValidateBadge(),this.saveTimer&&clearTimeout(this.saveTimer),this.saveTimer=setTimeout(()=>{this.savedCard=!1},1800),!0}catch(e){return console.error(`[本地保存失败]`,e),this.rt.pushError(`saveCard`,String(e&&e.message)),this.selfSaveId=``,this.selfSaveAt=0,!1}finally{this.savingCard=!1}},async fetchDiskCard(e){let t=await J(`/__card/${encodeURIComponent(e)}`);if(!t.ok)throw Error(`HTTP `+t.status);return t.json()},async fetchImportMeta(e){if(!e){this.cardImportMeta=null;return}try{let t=await J(`/__import-meta/${encodeURIComponent(e)}`);if(!t.ok){this.cardImportMeta=null;return}let n=await t.json().catch(()=>({}));this.cardImportMeta=n&&n.meta||null}catch{this.cardImportMeta=null}},async saveToRemote(){if(!(!this.preview||!this.selectedId||this.savingRemote)){this.savingRemote=!0,this.savedRemote=!1,this.verifiedRemote=null;try{try{let e=await this.fetchDiskCard(this.selectedId);e&&e.schema&&e.schema.pageId&&this.currentSchema&&(this.currentSchema.pageId=e.schema.pageId)}catch{}this.syncDataToSchema(),this.selfSaveId=this.selectedId,this.selfSaveAt=Date.now();let e=await J(`/__save`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({code:this.selectedId,schema:this.currentSchema},(e,t)=>e===`_schemaNode`?void 0:t,2)});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.message||t.error||`HTTP `+e.status)}let t=await e.json();if(!t.ok)throw Error(t.error||`远端保存失败`);if(this.verifiedRemote=t.verified?!!t.verified.ok:null,this.savedRemote=!0,this.verifiedRemote===!1){let e=t.verified||{};e.diff&&e.diff.length?``+e.diff.join(`;`):e.readBackError,console.warn(`[保存校验不符]`,e),Z(`已保存至远端,但读回校验未通过`,`err`)}else Z(`已保存至远端`,`ok`);this.saveRemoteTimer&&clearTimeout(this.saveRemoteTimer),this.saveRemoteTimer=setTimeout(()=>{this.savedRemote=!1,this.verifiedRemote=null},2500)}catch(e){console.error(`[保存至远端失败]`,e),Z(`保存至远端失败:`+(e&&e.message),`err`),this.selfSaveId=``,this.selfSaveAt=0}finally{this.savingRemote=!1}}},async uploadCardSlices(){if(!this.preview||!this.selectedId||this.uploadingSlices)return;let e=this.selectedId;this.uploadingSlices=!0;try{if(this.historyDirty&&!await this.saveCard())throw Error(`本地保存失败,已中止切图上传`);this.selfSaveId=e,this.selfSaveAt=Date.now();let t=await J(`/__slice-upload`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cardId:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.message||e.error||`HTTP `+t.status)}let n=await t.json();if(n.needCredentials){this.openLoginModal();return}if(this.selfSaveAt=Date.now(),!n.success){let e=(n.failed||[]).map(e=>`${e.name}: ${e.error}`).join(`; `);throw Error(e||`切图上传失败`)}await this.onRefresh();let r=(n.rewritten||[]).reduce((e,t)=>e+t.count,0);n.referenced?Z(`切图上传完成:新上传 ${n.uploaded.length} 张、复用 ${n.skipped.length} 张,替换引用 ${r} 处`,`ok`):Z(`当前卡片没有引用本地切图,无需上传`,`ok`),n.dangling&&n.dangling.length&&Z(`有 ${n.dangling.length} 处引用的切图在 src/slices 下不存在:${n.dangling.join(`、`)}`,`err`)}catch(e){console.error(`[切图上传失败]`,e),Z(`切图上传失败:`+(e&&e.message),`err`),this.selfSaveId=``,this.selfSaveAt=0}finally{this.uploadingSlices=!1}},async syncCardMeta(e){let t=await this.fetchCardMeta(e);if(!t)return;let n=this.cardList.findIndex(t=>t.id===e);n>=0?this.cardList.splice(n,1,t):this.cardList.push(t),this.cardCount=this.cardList.length},async fetchCardMeta(e){try{let t=await J(`/__card/`+encodeURIComponent(e)+`/meta`);return t.ok?await t.json():null}catch(e){return console.error(`[读取卡片列表项失败]`,e),null}},async fetchCardList(){try{let e=await J(`/__cards`);if(!e.ok)return;let t=await e.json(),n=t&&t.cards||[];this.cardList=n,this.cardCount=n.length}catch(e){console.error(`[加载卡片列表失败]`,e)}},async onGalleryDelete(e){try{let t=await J(`/__card/${encodeURIComponent(e)}`,{method:`DELETE`}),n=await t.json().catch(()=>null);if(!t.ok)throw Error(n&&(n.message||n.error)||`HTTP ${t.status}`);if(Z(`已删除本地卡片 ${e}`,`ok`),this.$refs.chatPanel?.discardCard(e),await this.fetchCardList(),this.selectedId===e){let e=this.cardList[0];e?await this.loadCard(e.id):(this.selectedId=``,this.currentSchema=null,this.preview=null)}}catch(e){Z(`删除卡片失败:${e.message}`,`err`)}},async onNewCardCreated(e){if(this.cardDialog.visible=!1,Z(`已创建空白卡片 ${e}`,`ok`),await this.fetchCardList(),this.chatBusy){Z(`AI 正在生成「${this.selectedId}」:新卡 ${e} 已建好,本轮结束后再切过去`,`err`,3600);return}await this.loadCard(e)},async onRefresh(){let e=this.selectedId;if(!(!e||this.refreshing)){this.refreshing=!0;try{await this.loadCard(e),await this.syncCardMeta(e);let t=this.cardList.find(t=>t.id===e);t&&this.currentSchema&&this.currentSchema.name&&(t.name=this.currentSchema.name)}catch(e){console.error(`[刷新卡片失败]`,e),this.rt.pushError(`refresh`,String(e&&e.message))}finally{this.refreshing=!1}}},onChatTurnFinished(e){if(this.chatProgress=null,this.aiChatOpen)return;let t=e&&e.steps||0,n=aO(e&&e.ms||0),r=oO(e&&e.finishedAt||Date.now());if(e&&e.status===`error`){Z(`AI 助手本轮报错(${r} · ${t} 步 / ${n}),展开面板查看原因`,`err`);return}if(e&&e.status===`aborted`){Z(`AI 助手本轮已终止(${r} · ${t} 步):展开面板可「从中断处继续」`,`ok`);return}Z(`AI 助手已完成本轮(${r} · ${t} 步 / ${n})`,`ok`)},async onChatRollbackTurn(e){let t=e&&e.cardId||this.selectedId;if(!t||this.loadingCard)return;if(t!==this.selectedId){Z(`请先切换到那张卡片再回滚`,`err`);return}let n=[];try{let e=await J(`/__history/${encodeURIComponent(t)}`);if(!e.ok)throw Error(`HTTP ${e.status}`);let r=await e.json().catch(()=>null);n=r&&r.snapshots||[]}catch(e){Z(`读取历史快照失败:${e.message||e}`,`err`);return}let r=Number(e&&e.ts)||0,i=r?n.filter(e=>Number(e.ts)>=r-2e3):[],a=i.length?i[0]:n[n.length-1];if(!a||!a.schema){Z(`没找到本轮之前的历史快照(可能已被 30 张上限裁掉,或本轮没写入过卡片)`,`err`);return}let o=new Date(Number(a.ts)||Date.now()).toLocaleString(`zh-CN`,{hour12:!1});this.requestConfirm({title:`回滚到 AI 动手之前`,message:`将把卡片「${this.selectedCardName||t}」恢复到 ${o} 的版本,本轮及其后的 ${i.length||1} 张快照都会被撤销。回滚只改当前编辑态,可用 Ctrl+Z 撤回;确认无误后仍需点顶栏「保存到本地」才写盘。`,confirmText:`回滚`,severity:`warn`,onConfirm:()=>this.applyTurnRollback(a)})},applyTurnRollback(e){!this.currentSchema||!e||(this.past.push({schema:this.cloneSchema(this.currentSchema)}),this.past.length>30&&this.past.shift(),this.future=[],this.baseline={schema:this.cloneSchema(e.schema)},this.applySchemaSnapshot({schema:e.schema,data:e.data}),Z(`已回滚到本轮之前的版本(未落盘,可撤销;确认后点「保存到本地」)`,`ok`))},onCardsChanged(e){let t=e&&e.file||``,n=e&&e.type||`change`;if(n===`rename`&&e.oldId&&e.id&&e.oldId!==e.id)return this.applyCardRename(e.oldId,e.id);if(/\.history[\\/]/.test(t)||/data\.json$/i.test(t))return;let r=t.match(/src[\\/]cards[\\/]([^\\/]+)[\\/]/),i=r?r[1]:null;this._ccIds||=new Set,this._ccTypes||={},i&&(this._ccIds.add(i),this._ccTypes[i]=n),!this._ccTimer&&(this._ccTimer=setTimeout(async()=>{this._ccTimer=null;let e=this._ccIds,t=this._ccTypes;if(this._ccIds=new Set,this._ccTypes={},!e.size)return;let n=Array.from(e),r=n[n.length-1];if(e.size===1&&r&&r===this.selectedId){if(this.selfSaveId===r&&Date.now()-this.selfSaveAt<pF){this.selfSaveId=``,this.selfSaveAt=0;return}if(this.historyDirty)this.promptExternalReload(r);else{let e=this.currentSchema&&this.currentSchema.name||r;this.showExternalReloadNote(this.chatBusy?`AI 助手已写入卡片「${e}」,预览已自动刷新`:`卡片「${e}」已在编辑器外被修改,已自动重新载入预览`),this.loadCard(this.selectedId)}return}if(e.size>1){await this.fetchCardList();return}if((t[r]||`change`)===`unlink`){let e=this.cardList.findIndex(e=>e.id===r);e>=0&&(this.cardList.splice(e,1),this.cardCount=this.cardList.length);return}let i=await this.fetchCardMeta(r);if(!i){await this.fetchCardList();return}let a=this.cardList.findIndex(e=>e.id===r);a>=0?this.cardList.splice(a,1,i):this.cardList.push(i),this.cardCount=this.cardList.length},120))},promptExternalReload(e){if(this.confirm.show)return;let t=this.currentSchema&&this.currentSchema.name||e;this.requestConfirm({title:`卡片已在编辑器外被修改`,message:`卡片「${t}」的 schema / data 在编辑器外发生了变更(例如 IDE 或其他工具覆盖了文件)。\n当前编辑器存在未保存的改动,是否放弃本地未保存改动并重新载入磁盘版本?`,confirmText:`重新载入`,cancelText:`保留我的改动`,onConfirm:()=>this.loadCard(e)})},showExternalReloadNote(e){this.externalReloadNote=e,this.externalReloadTimer&&clearTimeout(this.externalReloadTimer),this.externalReloadTimer=setTimeout(()=>{this.externalReloadNote=``,this.externalReloadTimer=null},3500)}}},xF={class:`app__bar`},SF={class:`app__logo`},CF=[`src`],wF={class:`app__logo-version`},TF={class:`csel-combo`},EF=[`disabled`],DF=[`disabled`],OF=[`title`],kF={class:`app__badge-text`},AF={class:`app__bar-actions`},jF={class:`app__op-group`,role:`group`,"aria-label":`编辑历史与本地操作`},MF=[`disabled`],NF=[`disabled`],PF=[`disabled`,`title`],FF=[`disabled`],IF=[`disabled`],LF={key:0,class:`app__icon app__icon--spin`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},RF={key:1,class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},zF={key:2,class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},BF={key:3,class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},VF={class:`app__remote-pop dd__menu`,role:`menu`},HF=[`title`,`onClick`],UF=[`title`,`onClick`],WF=[`onClick`],GF=[`onClick`],KF=[`title`,`onClick`],qF=[`title`,`aria-pressed`],JF=[`aria-checked`,`title`],YF={class:`theme-toggle__track`},XF={class:`theme-toggle__thumb`},ZF={key:0,class:`theme-toggle__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},QF={key:1,class:`theme-toggle__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},$F={class:`app__dev-svc`},eI=[`title`],tI={class:`app__dev-svc-head`},nI={class:`app__dev-svc-body`},rI={class:`app__dev-svc-row`},iI={class:`app__dev-svc-row app__dev-svc-row--col`},aI={class:`app__dev-svc-row app__dev-svc-row--col`},oI={key:0,class:`app__dev-svc-hint`},sI={class:`app__dev-svc-actions`},cI={style:{display:`none`}},lI=[`title`,`aria-expanded`],uI={key:0,class:`app__nosvc-banner`},dI={key:1,class:`app__nosvc-banner app__nosvc-banner--disconnected`},fI={key:2,class:`app__nosvc-banner app__extreload-banner`},pI={class:`app__stage`,ref:`stageEl`},mI={class:`phone__scaler`},hI=[`title`],gI={class:`canvas-bar__txt`},_I={class:`canvas-bar__chip`,title:`画布宽度预设(高度随列高自适应)`},vI={class:`canvas-bar__txt`},yI={class:`canvas-bar__size`,title:`画布实际尺寸(宽 × 高,高度随窗口自适应)`},bI=[`disabled`],xI=[`data-card-ready`],SI={class:`workside`},CI={class:`workside__cols`,ref:`colsEl`},wI={class:`login-modal modal-card`,role:`dialog`,"aria-modal":`true`},TI={class:`login-modal__row`},EI=[`disabled`],DI={class:`login-modal__row`},OI=[`disabled`],kI={key:0,class:`login-modal__error`},AI={class:`login-modal__actions`},jI=[`disabled`],MI=[`disabled`];function NI(e,t,n,r,i,a){let o=L(`CardSelect`),s=L(`Dropdown`),c=L(`Switch`),l=L(`ChatPanel`),u=L(`RenderTree`),d=L(`SelectionOverlay`),f=L(`HoverGuides`),p=L(`AlertCardLayer`),m=L(`DeviceOverlay`),h=L(`PickerOverlay`),g=L(`DatePickerOverlay`),_=L(`DebugPanel`),v=L(`ApiCallPanel`),y=L(`RemotePreview`),b=L(`ComponentPalette`),x=L(`ConfirmDialog`),S=L(`CardGallery`),C=L(`NewCardDialog`),w=L(`AppToast`),ee=L(`ImageLightbox`);return B(),V(`div`,{class:j([`app`,{"app--chrome-off":i.chromeOff}]),style:A({"--preview-width":a.previewWidth+`px`,"--api-panel-width":a.apiPanelWidth+`px`,"--debug-min":a.debugMinWidth+`px`})},[I(U(`header`,xF,[U(`strong`,SF,[U(`img`,{class:`app__logo-icon`,src:i.logoUrl,alt:``},null,8,CF),t[41]||=G(` CardBuddy `,-1),U(`span`,wF,`v`+M(i.appVersion),1)]),U(`div`,TF,[W(o,{class:`csel--combo`,value:i.selectedId,options:i.cardList,onChange:a.onSelect},null,8,[`value`,`options`,`onChange`]),U(`button`,{class:`csel-combo__btn`,type:`button`,disabled:!i.selectedId,onClick:t[0]||=(...e)=>a.openCardFolder&&a.openCardFolder(...e),title:`在文件管理器中打开当前卡片所在文件夹`},[...t[42]||=[U(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`path`,{d:`M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z`}),U(`path`,{d:`M3 9h18`})],-1)]],8,EF)]),K(` 卡片网格预览:图标按钮,打开本地全部卡片的缩略图墙,点击任一张载入工作台 `),U(`button`,{class:`app__btn app__btn--icon`,type:`button`,disabled:!i.cardList.length,onClick:t[1]||=(...e)=>a.openGallery&&a.openGallery(...e),title:`卡片网格预览`},[...t[43]||=[U(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-grid`})],-1)]],8,DF),K(` 新增空白卡片:紧邻网格预览的图标按钮;弹窗收 ID(必填、本地重名前置拦截)+ 描述(选填),创建成功切换到新卡 `),U(`button`,{class:`app__btn app__btn--icon`,type:`button`,onClick:t[2]||=(...e)=>a.openNewCard&&a.openNewCard(...e),title:`新增空白卡片`},[...t[44]||=[U(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-folder-plus`})],-1)]]),I(U(`div`,{ref:`validateBadgeEl`,class:j([`app__badge`,`app__badge--`+i.validateBadge.state]),title:a.badgeTitle},[t[45]||=U(`span`,{class:`app__badge-dot`},null,-1),U(`span`,kF,M(a.badgeText),1)],10,OF),[[Sc,!i.chromeOff]]),U(`div`,AF,[U(`div`,jF,[K(` 撤销 / 重做:图标 + 文案;无可回退/重做版本时置灰 `),U(`button`,{class:`app__btn app__btn--hist`,type:`button`,disabled:!i.preview||!a.canUndo,onClick:t[3]||=(...e)=>a.undo&&a.undo(...e),title:`后退一步(撤销)`},[...t[46]||=[U(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-undo`})],-1),U(`span`,null,`撤销`,-1)]],8,MF),U(`button`,{class:`app__btn app__btn--hist`,type:`button`,disabled:!i.preview||!a.canRedo,onClick:t[4]||=(...e)=>a.redo&&a.redo(...e),title:`前进一步(重做)`},[...t[47]||=[U(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[U(`use`,{href:`#icon-redo`})],-1),U(`span`,null,`重做`,-1)]],8,NF),K(` 保存到本地:当前显示版本(撤销/重做导航到的历史版本,或编辑后未本地保存的版本)
|
|
290
|
+
是否继续?`,confirmText:`继续上传`,onConfirm:()=>this.uploadCardSlices()});return}!this.preview||!this.selectedId||!this.hasCardSource||(this.remotePreviewOpen=!0)},requestConfirm({title:e,message:t,confirmText:n,cancelText:r,severity:i,onConfirm:a}){this.confirm={show:!0,title:e,message:t,confirmText:n||`继续`,cancelText:r||`取消`,severity:[`primary`,`warn`,`danger`].includes(i)?i:`primary`,onConfirm:a}},onConfirmDialog(){let e=this.confirm.onConfirm;this.confirm.show=!1,this.confirm.onConfirm=null,typeof e==`function`&&e()},onCancelDialog(){this.confirm.show=!1,this.confirm.onConfirm=null},async saveCard(){if(!this.preview||!this.selectedId)return;this.savingCard=!0;let e=this.selectedId;this.selfSaveId=e,this.selfSaveAt=Date.now();try{try{let e=await this.fetchDiskCard(this.selectedId);if(e&&e.schema){let t=e.schema,n=this.currentSchema;n&&(t.pageId&&(n.pageId=t.pageId),t.name&&(n.name=t.name),t.desc!==void 0&&(n.desc=t.desc))}}catch{}this.syncDataToSchema();let e={schema:this.currentSchema},t=JSON.stringify(e,(e,t)=>e===`_schemaNode`?void 0:t,2),n=await q(`/__card/${encodeURIComponent(this.selectedId)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:t});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.message||`HTTP `+n.status)}return this.currentCard={schema:e.schema},this.localSchema=this.cloneSchema(this.currentSchema),this.localData=this.cloneData(E_(this.currentSchema,GF)),this.savedCard=!0,this.refreshValidateBadge(),this.saveTimer&&clearTimeout(this.saveTimer),this.saveTimer=setTimeout(()=>{this.savedCard=!1},1800),!0}catch(e){return console.error(`[本地保存失败]`,e),this.rt.pushError(`saveCard`,String(e&&e.message)),this.selfSaveId=``,this.selfSaveAt=0,!1}finally{this.savingCard=!1}},async fetchDiskCard(e){let t=await q(`/__card/${encodeURIComponent(e)}`);if(!t.ok)throw Error(`HTTP `+t.status);return t.json()},async fetchImportMeta(e){if(!e){this.cardImportMeta=null;return}try{let t=await q(`/__import-meta/${encodeURIComponent(e)}`);if(!t.ok){this.cardImportMeta=null;return}let n=await t.json().catch(()=>({}));this.cardImportMeta=n&&n.meta||null}catch{this.cardImportMeta=null}},async saveToRemote(){if(!(!this.preview||!this.selectedId||this.savingRemote)){this.savingRemote=!0,this.savedRemote=!1,this.verifiedRemote=null;try{try{let e=await this.fetchDiskCard(this.selectedId);e&&e.schema&&e.schema.pageId&&this.currentSchema&&(this.currentSchema.pageId=e.schema.pageId)}catch{}this.syncDataToSchema(),this.selfSaveId=this.selectedId,this.selfSaveAt=Date.now();let e=await q(`/__save`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({code:this.selectedId,schema:this.currentSchema},(e,t)=>e===`_schemaNode`?void 0:t,2)});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.message||t.error||`HTTP `+e.status)}let t=await e.json();if(!t.ok)throw Error(t.error||`远端保存失败`);if(this.verifiedRemote=t.verified?!!t.verified.ok:null,this.savedRemote=!0,this.verifiedRemote===!1){let e=t.verified||{};e.diff&&e.diff.length?``+e.diff.join(`;`):e.readBackError,console.warn(`[保存校验不符]`,e),X(`已保存至远端,但读回校验未通过`,`err`)}else X(`已保存至远端`,`ok`);this.saveRemoteTimer&&clearTimeout(this.saveRemoteTimer),this.saveRemoteTimer=setTimeout(()=>{this.savedRemote=!1,this.verifiedRemote=null},2500)}catch(e){console.error(`[保存至远端失败]`,e),X(`保存至远端失败:`+(e&&e.message),`err`),this.selfSaveId=``,this.selfSaveAt=0}finally{this.savingRemote=!1}}},async uploadCardSlices(){if(!this.preview||!this.selectedId||this.uploadingSlices)return;let e=this.selectedId;this.uploadingSlices=!0;try{if(this.historyDirty&&!await this.saveCard())throw Error(`本地保存失败,已中止切图上传`);this.selfSaveId=e,this.selfSaveAt=Date.now();let t=await q(`/__slice-upload`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cardId:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.message||e.error||`HTTP `+t.status)}let n=await t.json();if(n.needCredentials){this.openLoginModal();return}if(this.selfSaveAt=Date.now(),!n.success){let e=(n.failed||[]).map(e=>`${e.name}: ${e.error}`).join(`; `);throw Error(e||`切图上传失败`)}await this.onRefresh();let r=(n.rewritten||[]).reduce((e,t)=>e+t.count,0);n.referenced?X(`切图上传完成:新上传 ${n.uploaded.length} 张、复用 ${n.skipped.length} 张,替换引用 ${r} 处`,`ok`):X(`当前卡片没有引用本地切图,无需上传`,`ok`),n.dangling&&n.dangling.length&&X(`有 ${n.dangling.length} 处引用的切图在 src/slices 下不存在:${n.dangling.join(`、`)}`,`err`)}catch(e){console.error(`[切图上传失败]`,e),X(`切图上传失败:`+(e&&e.message),`err`),this.selfSaveId=``,this.selfSaveAt=0}finally{this.uploadingSlices=!1}},async syncCardMeta(e){let t=await this.fetchCardMeta(e);if(!t)return;let n=this.cardList.findIndex(t=>t.id===e);n>=0?this.cardList.splice(n,1,t):this.cardList.push(t),this.cardCount=this.cardList.length},async fetchCardMeta(e){try{let t=await q(`/__card/`+encodeURIComponent(e)+`/meta`);return t.ok?await t.json():null}catch(e){return console.error(`[读取卡片列表项失败]`,e),null}},async fetchCardList(){try{let e=await q(`/__cards`);if(!e.ok)return;let t=await e.json(),n=t&&t.cards||[];this.cardList=n,this.cardCount=n.length}catch(e){console.error(`[加载卡片列表失败]`,e)}},async onGalleryDelete(e){try{let t=await q(`/__card/${encodeURIComponent(e)}`,{method:`DELETE`}),n=await t.json().catch(()=>null);if(!t.ok)throw Error(n&&(n.message||n.error)||`HTTP ${t.status}`);if(X(`已删除本地卡片 ${e}`,`ok`),this.$refs.chatPanel?.discardCard(e),await this.fetchCardList(),this.selectedId===e){let e=this.cardList[0];e?await this.loadCard(e.id):(this.selectedId=``,this.currentSchema=null,this.preview=null)}}catch(e){X(`删除卡片失败:${e.message}`,`err`)}},async onNewCardCreated(e){if(this.cardDialog.visible=!1,X(`已创建空白卡片 ${e}`,`ok`),await this.fetchCardList(),this.chatBusy){X(`AI 正在生成「${this.selectedId}」:新卡 ${e} 已建好,本轮结束后再切过去`,`err`,3600);return}await this.loadCard(e)},async onRefresh(){let e=this.selectedId;if(!(!e||this.refreshing)){this.refreshing=!0;try{await this.loadCard(e),await this.syncCardMeta(e);let t=this.cardList.find(t=>t.id===e);t&&this.currentSchema&&this.currentSchema.name&&(t.name=this.currentSchema.name)}catch(e){console.error(`[刷新卡片失败]`,e),this.rt.pushError(`refresh`,String(e&&e.message))}finally{this.refreshing=!1}}},onChatTurnFinished(e){if(this.chatProgress=null,this.aiChatOpen)return;let t=e&&e.steps||0,n=RO(e&&e.ms||0),r=zO(e&&e.finishedAt||Date.now());if(e&&e.status===`error`){X(`AI 助手本轮报错(${r} · ${t} 步 / ${n}),展开面板查看原因`,`err`);return}if(e&&e.status===`aborted`){X(`AI 助手本轮已终止(${r} · ${t} 步):展开面板可「从中断处继续」`,`ok`);return}X(`AI 助手已完成本轮(${r} · ${t} 步 / ${n})`,`ok`)},async onChatRollbackTurn(e){let t=e&&e.cardId||this.selectedId;if(!t||this.loadingCard)return;if(t!==this.selectedId){X(`请先切换到那张卡片再回滚`,`err`);return}let n=[];try{let e=await q(`/__history/${encodeURIComponent(t)}`);if(!e.ok)throw Error(`HTTP ${e.status}`);let r=await e.json().catch(()=>null);n=r&&r.snapshots||[]}catch(e){X(`读取历史快照失败:${e.message||e}`,`err`);return}let r=Number(e&&e.ts)||0,i=r?n.filter(e=>Number(e.ts)>=r-2e3):[],a=i.length?i[0]:n[n.length-1];if(!a||!a.schema){X(`没找到本轮之前的历史快照(可能已被 30 张上限裁掉,或本轮没写入过卡片)`,`err`);return}let o=new Date(Number(a.ts)||Date.now()).toLocaleString(`zh-CN`,{hour12:!1});this.requestConfirm({title:`回滚到 AI 动手之前`,message:`将把卡片「${this.selectedCardName||t}」恢复到 ${o} 的版本,本轮及其后的 ${i.length||1} 张快照都会被撤销。回滚只改当前编辑态,可用 Ctrl+Z 撤回;确认无误后仍需点顶栏「保存到本地」才写盘。`,confirmText:`回滚`,severity:`warn`,onConfirm:()=>this.applyTurnRollback(a)})},applyTurnRollback(e){!this.currentSchema||!e||(this.past.push({schema:this.cloneSchema(this.currentSchema)}),this.past.length>30&&this.past.shift(),this.future=[],this.baseline={schema:this.cloneSchema(e.schema)},this.applySchemaSnapshot({schema:e.schema,data:e.data}),X(`已回滚到本轮之前的版本(未落盘,可撤销;确认后点「保存到本地」)`,`ok`))},onCardsChanged(e){let t=e&&e.file||``,n=e&&e.type||`change`;if(n===`rename`&&e.oldId&&e.id&&e.oldId!==e.id)return this.applyCardRename(e.oldId,e.id);if(/\.history[\\/]/.test(t)||/data\.json$/i.test(t))return;let r=t.match(/src[\\/]cards[\\/]([^\\/]+)[\\/]/),i=r?r[1]:null;this._ccIds||=new Set,this._ccTypes||={},i&&(this._ccIds.add(i),this._ccTypes[i]=n),!this._ccTimer&&(this._ccTimer=setTimeout(async()=>{this._ccTimer=null;let e=this._ccIds,t=this._ccTypes;if(this._ccIds=new Set,this._ccTypes={},!e.size)return;let n=Array.from(e),r=n[n.length-1];if(e.size===1&&r&&r===this.selectedId){if(this.selfSaveId===r&&Date.now()-this.selfSaveAt<KF){this.selfSaveId=``,this.selfSaveAt=0;return}if(this.historyDirty)this.promptExternalReload(r);else{let e=this.currentSchema&&this.currentSchema.name||r;this.showExternalReloadNote(this.chatBusy?`AI 助手已写入卡片「${e}」,预览已自动刷新`:`卡片「${e}」已在编辑器外被修改,已自动重新载入预览`),this.loadCard(this.selectedId)}return}if(e.size>1){await this.fetchCardList();return}if((t[r]||`change`)===`unlink`){let e=this.cardList.findIndex(e=>e.id===r);e>=0&&(this.cardList.splice(e,1),this.cardCount=this.cardList.length);return}let i=await this.fetchCardMeta(r);if(!i){await this.fetchCardList();return}let a=this.cardList.findIndex(e=>e.id===r);a>=0?this.cardList.splice(a,1,i):this.cardList.push(i),this.cardCount=this.cardList.length},120))},promptExternalReload(e){if(this.confirm.show)return;let t=this.currentSchema&&this.currentSchema.name||e;this.requestConfirm({title:`卡片已在编辑器外被修改`,message:`卡片「${t}」的 schema / data 在编辑器外发生了变更(例如 IDE 或其他工具覆盖了文件)。\n当前编辑器存在未保存的改动,是否放弃本地未保存改动并重新载入磁盘版本?`,confirmText:`重新载入`,cancelText:`保留我的改动`,onConfirm:()=>this.loadCard(e)})},showExternalReloadNote(e){this.externalReloadNote=e,this.externalReloadTimer&&clearTimeout(this.externalReloadTimer),this.externalReloadTimer=setTimeout(()=>{this.externalReloadNote=``,this.externalReloadTimer=null},3500)}}},eI={class:`app__bar`},tI={class:`app__logo`},nI=[`src`],rI={class:`app__logo-version`},iI={class:`csel-combo`},aI=[`disabled`],oI=[`disabled`],sI=[`title`],cI={class:`app__badge-text`},lI={class:`app__bar-actions`},uI={class:`app__op-group`,role:`group`,"aria-label":`编辑历史与本地操作`},dI=[`disabled`],fI=[`disabled`],pI=[`disabled`,`title`],mI=[`disabled`],hI=[`disabled`],gI={key:0,class:`app__icon app__icon--spin`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},_I={key:1,class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},vI={key:2,class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},yI={key:3,class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},bI={class:`app__remote-pop dd__menu`,role:`menu`},xI=[`title`,`onClick`],SI=[`title`,`onClick`],CI=[`onClick`],wI=[`onClick`],TI=[`title`,`onClick`],EI=[`title`,`aria-pressed`],DI=[`aria-checked`,`title`],OI={class:`theme-toggle__track`},kI={class:`theme-toggle__thumb`},AI={key:0,class:`theme-toggle__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},jI={key:1,class:`theme-toggle__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},MI={class:`app__dev-svc`},NI=[`title`],PI={class:`app__dev-svc-head`},FI={class:`app__dev-svc-body`},II={class:`app__dev-svc-row`},LI={class:`app__dev-svc-row app__dev-svc-row--col`},RI={class:`app__dev-svc-row app__dev-svc-row--col`},zI={key:0,class:`app__dev-svc-hint`},BI={class:`app__dev-svc-actions`},VI={style:{display:`none`}},HI=[`title`,`aria-expanded`],UI={key:0,class:`app__nosvc-banner`},WI={key:1,class:`app__nosvc-banner app__nosvc-banner--disconnected`},GI={key:2,class:`app__nosvc-banner app__extreload-banner`},KI={class:`app__stage`,ref:`stageEl`},qI={class:`phone__scaler`},JI=[`title`],YI={class:`canvas-bar__txt`},XI={class:`canvas-bar__chip`,title:`画布宽度预设(高度随列高自适应)`},ZI={class:`canvas-bar__txt`},QI={class:`canvas-bar__size`,title:`画布实际尺寸(宽 × 高,高度随窗口自适应)`},$I=[`disabled`],eL=[`data-card-ready`],tL={class:`workside`},nL={class:`workside__cols`,ref:`colsEl`},rL={class:`login-modal modal-card`,role:`dialog`,"aria-modal":`true`},iL={class:`login-modal__row`},aL=[`disabled`],oL={class:`login-modal__row`},sL=[`disabled`],cL={key:0,class:`login-modal__error`},lL={class:`login-modal__actions`},uL=[`disabled`],dL=[`disabled`];function fL(e,t,n,r,i,a){let o=I(`CardSelect`),s=I(`Dropdown`),c=I(`Switch`),l=I(`ChatPanel`),u=I(`RenderTree`),d=I(`SelectionOverlay`),f=I(`HoverGuides`),p=I(`AlertCardLayer`),m=I(`DeviceOverlay`),h=I(`PickerOverlay`),g=I(`DatePickerOverlay`),_=I(`DebugPanel`),v=I(`ApiCallPanel`),y=I(`RemotePreview`),b=I(`ComponentPalette`),x=I(`ConfirmDialog`),S=I(`CardGallery`),C=I(`NewCardDialog`),w=I(`AppToast`),ee=I(`ImageLightbox`);return z(),B(`div`,{class:A([`app`,{"app--chrome-off":i.chromeOff}]),style:k({"--preview-width":a.previewWidth+`px`,"--api-panel-width":a.apiPanelWidth+`px`,"--debug-min":a.debugMinWidth+`px`})},[F(H(`header`,eI,[H(`strong`,tI,[H(`img`,{class:`app__logo-icon`,src:i.logoUrl,alt:``},null,8,nI),t[41]||=W(` CardBuddy `,-1),H(`span`,rI,`v`+j(i.appVersion),1)]),H(`div`,iI,[U(o,{class:`csel--combo`,value:i.selectedId,options:i.cardList,onChange:a.onSelect},null,8,[`value`,`options`,`onChange`]),H(`button`,{class:`csel-combo__btn`,type:`button`,disabled:!i.selectedId,onClick:t[0]||=(...e)=>a.openCardFolder&&a.openCardFolder(...e),title:`在文件管理器中打开当前卡片所在文件夹`},[...t[42]||=[H(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`path`,{d:`M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z`}),H(`path`,{d:`M3 9h18`})],-1)]],8,aI)]),G(` 卡片网格预览:图标按钮,打开本地全部卡片的缩略图墙,点击任一张载入工作台 `),H(`button`,{class:`app__btn app__btn--icon`,type:`button`,disabled:!i.cardList.length,onClick:t[1]||=(...e)=>a.openGallery&&a.openGallery(...e),title:`卡片网格预览`},[...t[43]||=[H(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-grid`})],-1)]],8,oI),G(` 新增空白卡片:紧邻网格预览的图标按钮;弹窗收 ID(必填、本地重名前置拦截)+ 描述(选填),创建成功切换到新卡 `),H(`button`,{class:`app__btn app__btn--icon`,type:`button`,onClick:t[2]||=(...e)=>a.openNewCard&&a.openNewCard(...e),title:`新增空白卡片`},[...t[44]||=[H(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-folder-plus`})],-1)]]),F(H(`div`,{ref:`validateBadgeEl`,class:A([`app__badge`,`app__badge--`+i.validateBadge.state]),title:a.badgeTitle},[t[45]||=H(`span`,{class:`app__badge-dot`},null,-1),H(`span`,cI,j(a.badgeText),1)],10,sI),[[Cc,!i.chromeOff]]),H(`div`,lI,[H(`div`,uI,[G(` 撤销 / 重做:图标 + 文案;无可回退/重做版本时置灰 `),H(`button`,{class:`app__btn app__btn--hist`,type:`button`,disabled:!i.preview||!a.canUndo,onClick:t[3]||=(...e)=>a.undo&&a.undo(...e),title:`后退一步(撤销)`},[...t[46]||=[H(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-undo`})],-1),H(`span`,null,`撤销`,-1)]],8,dI),H(`button`,{class:`app__btn app__btn--hist`,type:`button`,disabled:!i.preview||!a.canRedo,onClick:t[4]||=(...e)=>a.redo&&a.redo(...e),title:`前进一步(重做)`},[...t[47]||=[H(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-redo`})],-1),H(`span`,null,`重做`,-1)]],8,fI),G(` 保存到本地:当前显示版本(撤销/重做导航到的历史版本,或编辑后未本地保存的版本)
|
|
288
291
|
与本地磁盘版本不一致时高亮可用;一致时置灰。点击把当前版本真正写回磁盘,
|
|
289
|
-
使下一次重新打开加载的是这个「真实版本」,而非任意历史记录。 `),
|
|
292
|
+
使下一次重新打开加载的是这个「真实版本」,而非任意历史记录。 `),H(`button`,{class:A([`app__btn app__btn--history-save`,{"is-dirty":a.historyDirty}]),type:`button`,disabled:!i.preview||!a.historyDirty||i.savingCard||i.loadingCard,onClick:t[5]||=(...e)=>a.applyHistoryToLocal&&a.applyHistoryToLocal(...e),title:a.historyDirty?`当前版本与本地不一致,点击将该版本保存到本地`:`当前版本已与本地一致`},[...t[48]||=[H(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-save`})],-1),H(`span`,null,`保存`,-1)]],10,pI),H(`button`,{class:`app__btn app__btn--op`,disabled:!i.preview,onClick:t[6]||=(...e)=>a.copySchema&&a.copySchema(...e),title:`复制 schema(含变量 mock 编辑后的数据)`},[t[49]||=H(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-copy`})],-1),H(`span`,null,j(i.copiedSchema?`已复制 ✓`:`复制`),1)],8,mI)]),G(` 远端:合并「远端保存 / 远端预览 / 切图上传 / 全量同步 / 选中卡片同步」为一个分组,组名「远端」,云图标 `),U(s,{class:`app__remote-menu`,size:`md`,placement:`bottom-end`,disabled:i.savingRemote||i.syncingRemote||i.uploadingSlices,title:i.savingRemote?`正在保存至远端…`:i.syncingRemote?`同步中…`:i.uploadingSlices?`正在上传切图…`:`远端操作:保存到 FinMall / 真机预览 / 切图上传 / 全量或选中卡片同步`,"data-testid":`remote-group`},{trigger:Rr(({open:e})=>[H(`button`,{type:`button`,class:A([`app__btn app__btn--remote`,{"app__btn--warn":i.savedRemote&&i.verifiedRemote===!1,"app__remote-trigger--active":e,"is-processing":i.savingRemote||i.syncingRemote||i.uploadingSlices}]),disabled:i.savingRemote||i.syncingRemote||i.uploadingSlices},[i.savingRemote||i.syncingRemote||i.uploadingSlices?(z(),B(`svg`,gI,[...t[50]||=[H(`use`,{href:`#icon-loading`},null,-1)]])):i.savedRemote&&i.verifiedRemote!==!1?(z(),B(`svg`,_I,[...t[51]||=[H(`use`,{href:`#icon-cloud-check`},null,-1)]])):i.savedRemote&&i.verifiedRemote===!1?(z(),B(`svg`,vI,[...t[52]||=[H(`use`,{href:`#icon-cloud-alert`},null,-1)]])):(z(),B(`svg`,yI,[...t[53]||=[H(`use`,{href:`#icon-cloud`},null,-1)]])),t[55]||=H(`span`,null,`远端`,-1),(z(),B(`svg`,{class:A([`app__icon app__icon--chev`,{"app__icon--chev--open":e}]),viewBox:`0 0 16 16`,width:`12`,height:`12`,"aria-hidden":`true`},[...t[54]||=[H(`use`,{href:`#icon-chevron`},null,-1)]],2))],10,hI)]),default:Rr(({close:e})=>[H(`ul`,bI,[H(`li`,{class:A([`app__remote-item app__remote-item--save`,{"is-disabled":!i.preview||!i.selectedId||i.savingRemote||!a.hasCardSource}]),title:a.hasCardSource?`版本推送:把本地卡片版本覆盖到远端 FinMall`:`该卡未经「同步远程」导入,无远端来源信息,无法推送版本`,"data-testid":`save-remote`,role:`menuitem`,onClick:t=>{a.chooseRsave(`save`),e()}},[...t[56]||=[H(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-upload-cloud`})],-1),H(`span`,null,`版本推送`,-1)]],10,xI),H(`li`,{class:A([`app__remote-item`,{"is-disabled":!i.preview||!i.selectedId||!a.hasCardSource}]),title:a.hasCardSource?`在线预览:生成真机预览二维码(FinMall App 扫码)`:`该卡未经「同步远程」导入,无远端来源信息,无法生成真机预览二维码`,"data-testid":`remote-preview`,role:`menuitem`,onClick:t=>{a.chooseRsave(`preview`),e()}},[...t[57]||=[H(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-grid`})],-1),H(`span`,null,`在线预览`,-1)]],10,SI),H(`li`,{class:A([`app__remote-item app__remote-item--sync`,{"is-disabled":!i.preview||!i.selectedId||i.syncingRemote}]),"data-testid":`sync-selected`,role:`menuitem`,onClick:t=>{a.chooseSync(`selected`),e()}},[...t[58]||=[H(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-sync-box`})],-1),H(`span`,null,`当前同步`,-1)]],10,CI),H(`li`,{class:A([`app__remote-item app__remote-item--sync`,{"is-disabled":i.syncingRemote}]),"data-testid":`sync-full`,role:`menuitem`,onClick:t=>{a.chooseSync(`full`),e()}},[...t[59]||=[H(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-refresh`})],-1),H(`span`,null,`全量同步`,-1)]],10,wI),G(` 切图上传:仅点击时执行,把「当前卡片引用到的」src/slices 切图上传到 FinMall 图片库
|
|
290
293
|
(CC0000.do),并把该卡 schema/data 里的 /slices/ 引用改写为返回的 @filestore/ 线上地址。
|
|
291
294
|
没有任何自动上传路径;共享切图若已上传过(sha256 命中 src/slices/manifest.json)直接复用地址。
|
|
292
|
-
不要求 hasCardSource:本地自建卡同样需要先把切图传上去,才能推版本 / 出真机预览。 `),
|
|
295
|
+
不要求 hasCardSource:本地自建卡同样需要先把切图传上去,才能推版本 / 出真机预览。 `),H(`li`,{class:A([`app__remote-item app__remote-item--upload`,{"is-disabled":!i.preview||!i.selectedId||i.uploadingSlices}]),title:i.uploadingSlices?`正在上传切图…`:`切图上传:把当前卡片引用的本地切图(src/slices)上传到 FinMall 图片库,并把卡片里的 /slices/ 引用替换为线上地址(@filestore/…);本地切图文件保留`,"data-testid":`slice-upload`,role:`menuitem`,onClick:t=>{a.chooseRsave(`slices`),e()}},[...t[60]||=[H(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-image-upload`})],-1),H(`span`,null,`切图上传`,-1)]],10,TI)])]),_:1},8,[`disabled`,`title`]),G(` 接口调用面板开关:右侧常驻面板的展开/收起,状态持久化 `),H(`button`,{class:A([`app__btn app__btn--icon`,{"app__btn--active":i.apiPanelOpen}]),type:`button`,title:i.apiPanelOpen?`收起接口调用面板`:`打开接口调用面板`,"aria-pressed":i.apiPanelOpen,onClick:t[7]||=(...e)=>a.toggleApiPanel&&a.toggleApiPanel(...e)},[...t[61]||=[H(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`rect`,{x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),H(`line`,{x1:`15`,y1:`4`,x2:`15`,y2:`20`})],-1)]],10,EI),G(` 主题切换:深色(当前)/ 浅色,复用同名 CSS 变量整体换肤,状态持久化 `),H(`button`,{class:`theme-toggle`,type:`button`,role:`switch`,"aria-checked":i.theme===`light`,title:i.theme===`light`?`切换到深色主题`:`切换到浅色主题`,onClick:t[8]||=(...e)=>a.toggleTheme&&a.toggleTheme(...e)},[H(`span`,OI,[H(`span`,kI,[i.theme===`light`?(z(),B(`svg`,AI,[...t[62]||=[os(`<circle cx="12" cy="12" r="4.2"></circle><line x1="12" y1="2.5" x2="12" y2="5"></line><line x1="12" y1="19" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="5" y2="12"></line><line x1="19" y1="12" x2="21.5" y2="12"></line><line x1="4.9" y1="4.9" x2="6.8" y2="6.8"></line><line x1="17.2" y1="17.2" x2="19.1" y2="19.1"></line><line x1="4.9" y1="19.1" x2="6.8" y2="17.2"></line><line x1="17.2" y1="6.8" x2="19.1" y2="4.9"></line>`,9)]])):(z(),B(`svg`,jI,[...t[63]||=[H(`path`,{d:`M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z`},null,-1)]]))])])],8,DI),G(` 本地开发服务设置入口 `),H(`div`,MI,[H(`button`,{class:A([`app__btn app__btn--icon`,a.devSvcClass]),type:`button`,title:a.devSvcTitle,onClick:t[9]||=e=>i.devServiceOpen=!i.devServiceOpen},[...t[64]||=[H(`svg`,{class:`app__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-link`})],-1)]],10,NI),G(` 点遮罩关闭:与事件帮助气泡等轻量浮层同一交互 `),i.devServiceOpen?(z(),B(`div`,{key:0,class:`app__dev-svc-mask`,onClick:t[10]||=e=>i.devServiceOpen=!1})):G(`v-if`,!0),U(ac,{name:`pop`},{default:Rr(()=>[i.devServiceOpen?(z(),B(`div`,{key:0,class:`app__dev-svc-panel`,onClick:t[17]||=K(()=>{},[`stop`])},[H(`div`,PI,[t[65]||=H(`span`,{class:`app__dev-svc-title`},`本地开发服务`,-1),H(`button`,{class:`app__dev-svc-close`,type:`button`,title:`关闭`,onClick:t[11]||=e=>i.devServiceOpen=!1})]),H(`div`,FI,[H(`label`,II,[t[66]||=H(`span`,null,`启用`,-1),U(c,{modelValue:i.devServiceForm.enabled,"onUpdate:modelValue":t[12]||=e=>i.devServiceForm.enabled=e},null,8,[`modelValue`])]),H(`label`,LI,[t[67]||=H(`span`,null,`服务地址`,-1),F(H(`input`,{type:`text`,"onUpdate:modelValue":t[13]||=e=>i.devServiceForm.baseUrl=e,placeholder:`http://127.0.0.1:8787`},null,512),[[al,i.devServiceForm.baseUrl]])]),H(`label`,RI,[t[68]||=H(`span`,null,`访问令牌(可选)`,-1),F(H(`input`,{type:`text`,"onUpdate:modelValue":t[14]||=e=>i.devServiceForm.token=e,placeholder:`留空则不校验`},null,512),[[al,i.devServiceForm.token]])]),i.apiBaseResolved===null?(z(),B(`p`,zI,[a.devSvcBlockReason===`disabled`?(z(),B(R,{key:0},[W(`已填写服务地址,但「启用」开关未打开。请开启「启用」开关并点击保存,本地开发服务才会生效。`)],64)):(z(),B(R,{key:1},[W(`请填写本机 cardbuddy 服务地址(默认 http://127.0.0.1:8787),打开「启用」开关并保存后,编辑功能才会生效。`)],64))])):G(`v-if`,!0),H(`div`,BI,[H(`button`,{class:`ni-btn ni-btn--ghost`,type:`button`,onClick:t[15]||=e=>i.devServiceOpen=!1},`关闭`),H(`button`,{class:`ni-btn`,type:`button`,onClick:t[16]||=(...e)=>a.saveDevService&&a.saveDevService(...e)},`保存`)])])])):G(`v-if`,!0)]),_:1})])]),H(`span`,VI,j(i.rt.revision),1)],512),[[Cc,!i.chromeOff]]),G(` AI 开发助手悬浮入口:右下角圆形按钮(尺寸 / 配色走规范 Token,图标取自 sprite) `),H(`button`,{class:A([`ai-fab`,{"ai-fab--active":i.aiChatOpen,"ai-fab--busy":i.chatBusy}]),type:`button`,title:a.fabTitle,"aria-expanded":i.aiChatOpen?`true`:`false`,"data-testid":`ai-fab`,onClick:t[18]||=e=>i.aiChatOpen=!i.aiChatOpen},[...t[69]||=[H(`svg`,{class:`ai-fab__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`use`,{href:`#icon-sparkles`})],-1)]],10,HI),G(` AI 开发助手对话面板:右侧抽屉,宽度可拖(320px ~ 视口 50%,默认 33%),对话记录按卡片落盘 `),U(l,{ref:`chatPanel`,visible:i.aiChatOpen,"card-id":i.selectedId,"card-name":a.selectedCardName,"card-empty":a.cardEmpty,onClose:t[19]||=e=>i.aiChatOpen=!1,onBusy:t[20]||=e=>i.chatBusy=e,onTurnProgress:t[21]||=e=>i.chatProgress=e,onTurnFinished:a.onChatTurnFinished,onRollbackTurn:a.onChatRollbackTurn,onLocateNode:a.onAiLocateNode},null,8,[`visible`,`card-id`,`card-name`,`card-empty`,`onTurnFinished`,`onRollbackTurn`,`onLocateNode`]),G(` 部署态但未配置本地开发服务:顶部提示条(chrome=off 截图模式不显示) `),i.apiBaseResolved===null&&!i.chromeOff?(z(),B(`div`,UI,[a.devSvcBlockReason===`disabled`?(z(),B(R,{key:0},[W(` ⚠ 本地开发服务未生效:已填写地址,但未打开「启用」开关。请点击右上角 「连接」图标打开「本地开发服务」设置,开启「启用」开关并保存后,编辑功能才会生效。 `)],64)):(z(),B(R,{key:1},[W(` ⚠ 未配置本地开发服务:当前为部署态,编辑功能不可用。请点击右上角 「连接」图标打开「本地开发服务」设置,填写本机 cardbuddy 地址、打开「启用」开关并保存后,才能编辑卡片。 `)],64))])):G(`v-if`,!0),G(` 已配置本地服务但实时连接已断开:顶部提示条(chrome=off 截图模式不显示) `),i.apiBaseResolved!==null&&i.devSvcDown&&!i.chromeOff?(z(),B(`div`,WI,` ⚠ 本地开发服务已断开:连接失败或服务已停止,编辑 / 同步功能暂不可用。请确认本地 cardbuddy 是否运行,或点击右上角「连接」图标重新保存配置。 `)):G(`v-if`,!0),G(` 外部改了当前卡、无未保存改动 → 自动重载后的非阻塞轻提示(chrome=off 截图模式不显示) `),i.externalReloadNote&&!i.chromeOff?(z(),B(`div`,GI,` ↻ `+j(i.externalReloadNote),1)):G(`v-if`,!0),H(`main`,KI,[H(`div`,{class:A([`phone`,{"phone--dragging":i.dragging}]),style:k({width:a.previewWidth+`px`})},[G(` 缩放外框:占满整列(宽高由 CSS flex 填满);画布不做 transform 缩放,直接按实际尺寸布局 `),H(`div`,{class:`phone__frame`,style:k(a.frameStyle)},[G(` 画布层:直接按实际列宽/列高布局(width/height 100%),不再使用 transform 缩放 `),H(`div`,qI,[G(` 画布工具条:原 device-bar(顶 28px)+ preview-statusbar(底 28px)合并为一条 32px,
|
|
293
296
|
竖向空间还给手机视口。左组=改变画布(背景 / 宽度预设),右组=画布现状与动作(尺寸读数 / 刷新);
|
|
294
|
-
预览列窄于 300px 时收起读数与文案只留图标(188 预设下仍单行可用)。 `),
|
|
297
|
+
预览列窄于 300px 时收起读数与文案只留图标(188 预设下仍单行可用)。 `),F(H(`div`,{class:A([`canvas-bar`,{"canvas-bar--tight":a.previewWidth<300}])},[G(` 画布背景:触发器带当前底色小样,不展开下拉也可见当前模式 `),U(s,{borderless:``,size:`xs`,placement:`bottom-start`,value:i.canvasBg,options:i.bgOptions.map(e=>({key:e.key,value:e.label+`背景`})),onChange:a.chooseBg},{trigger:Rr(()=>[H(`span`,{class:`canvas-bar__chip`,title:`画布背景:`+a.currentBg.label},[H(`i`,{class:A([`canvas-bar__swatch`,`canvas-bar__swatch--`+i.canvasBg])},null,2),H(`span`,YI,j(a.currentBg.label)+`背景`,1),t[70]||=H(`svg`,{class:`canvas-bar__chev`,viewBox:`0 0 16 16`,"aria-hidden":`true`},[H(`use`,{href:`#icon-chevron`})],-1)],8,JI)]),_:1},8,[`value`,`options`,`onChange`]),G(` 宽度预设:触发器直接显示当前宽度,省去独立的「宽度」标签 `),U(s,{borderless:``,size:`xs`,placement:`bottom-start`,value:a.canvasW,options:i.presetSizes,onChange:a.setPresetWidth},{trigger:Rr(()=>[H(`span`,XI,[t[71]||=H(`svg`,{class:`canvas-bar__icn`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`polyline`,{points:`8 7 4 12 8 17`}),H(`polyline`,{points:`16 7 20 12 16 17`}),H(`line`,{x1:`4`,y1:`12`,x2:`20`,y2:`12`})],-1),H(`span`,ZI,j(a.canvasW)+` px`,1),t[72]||=H(`svg`,{class:`canvas-bar__chev`,viewBox:`0 0 16 16`,"aria-hidden":`true`},[H(`use`,{href:`#icon-chevron`})],-1)])]),_:1},8,[`value`,`options`,`onChange`]),t[74]||=H(`span`,{class:`canvas-bar__spacer`},null,-1),H(`span`,QI,j(a.canvasW)+` × `+j(i.viewportHeight),1),H(`button`,{class:A([`canvas-bar__iconbtn`,{"is-loading":i.refreshing}]),type:`button`,disabled:!i.selectedId||i.refreshing,title:`刷新卡片,重新加载`,onClick:t[22]||=(...e)=>a.refreshCard&&a.refreshCard(...e)},[...t[73]||=[H(`svg`,{class:`canvas-bar__icn`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[H(`path`,{d:`M21 12a9 9 0 1 1-2.64-6.36`}),H(`path`,{d:`M21 3v6h-6`})],-1)]],10,$I)],2),[[Cc,!i.chromeOff]]),G(`
|
|
295
298
|
固定视口:弹层(alertCard / alertDialog / toast)相对此容器 absolute inset:0 定位,
|
|
296
299
|
不随内层 phone__screen 的卡片内容滚动,保证遮罩始终精确覆盖可视区域。
|
|
297
|
-
`),
|
|
300
|
+
`),H(`div`,{ref:`phoneViewport`,class:`phone-viewport`,onClick:t[23]||=(...e)=>a.onCanvasClick&&a.onCanvasClick(...e)},[H(`div`,{class:A([`phone__screen`,`phone__screen--bg-`+(i.chromeOff?`white`:i.canvasBg)]),style:k(i.chromeOff&&i.preview?{width:(i.preview.view.width||375)+`px`}:null),"data-card-ready":i.cardReady?`1`:null},[G(`
|
|
298
301
|
:key 绑定 selectedId + reloadToken —— 切换卡片、远端同步后重载、重置导入
|
|
299
302
|
等场景时强制 RenderTree 重新挂载,从而保证新卡片/新数据的「初始化动作」
|
|
300
303
|
(onReady 等生命周期事件,如 assetOverview 计算 ratio)一定在 created 阶段
|
|
301
304
|
执行,不会出现重载后 init 不跑、依赖字段为 undefined 而渲染成 NaN% 的问题。
|
|
302
|
-
`),i.preview?(
|
|
303
|
-
故定位在 .app__stage 通到底部,全程可拖;右分隔条才收进两栏容器内。 `),
|
|
305
|
+
`),i.preview?(z(),V(u,{key:i.selectedId+`:`+i.reloadToken,node:i.preview.view,scope:i.rt.state,"selected-node-id":i.selectedNodeId},null,8,[`node`,`scope`,`selected-node-id`])):G(`v-if`,!0),G(` 节点选中遮罩覆盖层:作为滚动容器子节点,随内容滚动并精确贴合选中元素 `),U(d),G(` 结构树 hover 参考线:贯穿画布的荧光绿辅助线(左/右竖线、上/下横线),仅 hover 时显示 `),U(f)],14,eL),G(` 弹窗卡片图层:alertCard / closeAlertCard 的展现层(在预览区域内弹出) `),U(p,{"main-rt":i.rt},null,8,[`main-rt`]),G(` 设备级模拟 UI:alertDialog 对话框 / showToast 弱提示 / showPicker 选择器 / showDatePicker 日期选择器 `),U(m),U(h),U(g)],512)])],4)],6),G(` 左分隔条:预览列 | 工作区 接缝。底面板 / 状态栏的左缘即此缝(随预览宽度联动),
|
|
306
|
+
故定位在 .app__stage 通到底部,全程可拖;右分隔条才收进两栏容器内。 `),F(H(`div`,{class:A([`splitter`,{"is-dragging":i.dragging,"is-armed":i.armedLeft}]),onMouseenter:t[24]||=e=>a.armSplitter(`left`),onMouseleave:t[25]||=e=>a.disarmSplitter(`left`),onPointerdown:t[26]||=K((...e)=>a.startDrag&&a.startDrag(...e),[`prevent`]),title:`拖拽调整预览区域宽度`},null,34),[[Cc,!i.chromeOff]]),G(` 中右工作区:上为「调试面板 + 接口调用面板」两栏,下为贯穿两栏的共同状态栏。
|
|
304
307
|
状态栏与底部弹出面板(运行态 / 事件 / 变量绑定)均由 DebugPanel 内 Teleport 注入
|
|
305
308
|
#app-workside-bar / #app-workside-panels,宽度贯穿中右两栏;Teleport 目标须在 DOM 中
|
|
306
|
-
先于面板挂载,故两个空容器写在前面,以 flex order 视觉置底。 `),
|
|
307
|
-
约束:中栏最小宽度 ≥ 屏宽 1/3,右栏最小宽度 ≥ 320px(见 startApiDrag) `),
|
|
308
|
-
展开/收起由顶栏按钮与面板内 ✕ 控制,初始状态持久化 `),i.apiPanelOpen?(B(),H(v,{key:0,rt:i.rt,onClose:t[31]||=e=>i.apiPanelOpen=!1},null,8,[`rt`])):K(`v-if`,!0)],512)],512),[[Sc,!i.chromeOff]])],512),K(` 远端预览二维码弹层:点击顶栏「远端预览」按钮打开,手机(FinMall App)扫码真机查看 `),W(y,{visible:i.remotePreviewOpen,"page-id":i.currentSchema?i.currentSchema.pageId:``,schema:i.currentSchema,onClose:t[32]||=e=>i.remotePreviewOpen=!1},null,8,[`visible`,`page-id`,`schema`]),K(` 登录凭据弹窗:远程同步检测到缺凭据时弹出,填写账号密码(MD5 后)写入 .local/credentials.json `),W(ic,{name:`modal`},{default:Lr(()=>[i.loginModal?(B(),V(`div`,{key:0,class:`login-mask`,onClick:t[39]||=q((...e)=>a.closeLoginModal&&a.closeLoginModal(...e),[`self`])},[U(`div`,wI,[t[79]||=U(`div`,{class:`login-modal__title`},`FinMall 登录凭据`,-1),t[80]||=U(`div`,{class:`login-modal__desc`},` 本地登录凭据缺失,请填写账号与密码。密码仅做 MD5 后保存,不落明文。 `,-1),U(`label`,TI,[t[77]||=U(`span`,{class:`login-modal__label`},`账号`,-1),I(U(`input`,{class:`login-modal__input`,type:`text`,"onUpdate:modelValue":t[33]||=e=>i.loginName=e,placeholder:`FinMall 登录账号`,disabled:i.loginSubmitting,onKeyup:t[34]||=vl((...e)=>a.submitLogin&&a.submitLogin(...e),[`enter`])},null,40,EI),[[il,i.loginName]])]),U(`label`,DI,[t[78]||=U(`span`,{class:`login-modal__label`},`密码`,-1),I(U(`input`,{class:`login-modal__input`,type:`password`,"onUpdate:modelValue":t[35]||=e=>i.loginPassword=e,placeholder:`FinMall 登录密码`,disabled:i.loginSubmitting,onKeyup:t[36]||=vl((...e)=>a.submitLogin&&a.submitLogin(...e),[`enter`])},null,40,OI),[[il,i.loginPassword]])]),i.loginError?(B(),V(`div`,kI,M(i.loginError),1)):K(`v-if`,!0),U(`div`,AI,[U(`button`,{class:`login-modal__btn login-modal__btn--ghost`,type:`button`,disabled:i.loginSubmitting,onClick:t[37]||=(...e)=>a.closeLoginModal&&a.closeLoginModal(...e)},` 取消 `,8,jI),U(`button`,{class:`login-modal__btn login-modal__btn--primary`,type:`button`,disabled:i.loginSubmitting,onClick:t[38]||=(...e)=>a.submitLogin&&a.submitLogin(...e)},M(i.loginSubmitting?`保存中…`:`保存并同步`),9,MI)])])])):K(`v-if`,!0)]),_:1}),K(` 组件选择面板:点击结构树每行的「+」后弹出,选择类型即插入对应节点 `),W(ic,{name:`modal`},{default:Lr(()=>[i.addNodePanelOpen?(B(),H(b,{key:0,onPick:a.onPickComponent,onClose:a.cancelAddNode},null,8,[`onPick`,`onClose`])):K(`v-if`,!0)]),_:1}),K(` 二次确认弹窗:版本推送 / 当前同步 / 全量同步 等写/覆盖类操作前弹出,确认后才执行 `),W(x,{visible:i.confirm.show,title:i.confirm.title,message:i.confirm.message,"confirm-text":i.confirm.confirmText,"cancel-text":i.confirm.cancelText,severity:i.confirm.severity,onConfirm:a.onConfirmDialog,onCancel:a.onCancelDialog},null,8,[`visible`,`title`,`message`,`confirm-text`,`cancel-text`,`severity`,`onConfirm`,`onCancel`]),K(` 卡片网格预览弹窗:点击顶栏「网格预览」图标按钮打开,选择卡片即载入工作台 `),W(S,{visible:i.galleryOpen,cards:i.cardList,"selected-id":i.selectedId,onSelect:a.onSelect,onClose:a.closeGallery,onDelete:a.onGalleryDelete},null,8,[`visible`,`cards`,`selected-id`,`onSelect`,`onClose`,`onDelete`]),K(` 卡片表单弹窗(新增空白卡片 / 卡片重命名 共用一个弹窗):成功后关弹窗 + 刷列表 + 加载目标卡;existing-ids 供 ID 重名前置判定 `),W(C,{visible:i.cardDialog.visible,mode:i.cardDialog.mode,"card-id":i.cardDialog.cardId,"card-desc":i.cardDialog.cardDesc,"existing-ids":a.cardIds,onClose:t[40]||=e=>i.cardDialog.visible=!1,onCreated:a.onNewCardCreated,onRenamed:a.onCardRenamed},null,8,[`visible`,`mode`,`card-id`,`card-desc`,`existing-ids`,`onCreated`,`onRenamed`]),K(` App 级弱提示:顶栏异步操作(远端保存 / 同步)完成反馈,浮于 App 外壳顶部居中 `),W(w),K(` 对话图片大图查看器:AI 面板里点预览图后全屏缩放查看,Teleport 到 body `),W(ee)],6)}var PI=X(bF,[[`render`,NI],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/App.vue`]]),FI={name:`SetText`,props:{...jg,multiline:{type:Boolean,default:!1}},emits:Mg,computed:{text(){return this.value===void 0||this.value===null?``:String(this.value)},rows(){let e=this.options.autosize;return e&&typeof e==`object`&&e.minRows?e.minRows:4}},methods:{onInput(e){this.$emit(`input`,e)}}},II=[`rows`,`placeholder`,`disabled`,`value`],LI=[`placeholder`,`disabled`,`value`];function RI(e,t,n,r,i,a){return n.multiline?(B(),V(`textarea`,{key:0,class:`st-textarea`,rows:a.rows,placeholder:e.options.placeholder||``,disabled:e.disabled,value:a.text,onInput:t[0]||=e=>a.onInput(e.target.value),onChange:t[1]||=t=>e.$emit(`change`)},null,40,II)):(B(),V(`input`,{key:1,class:`ni-input`,type:`text`,placeholder:e.options.placeholder||``,disabled:e.disabled,value:a.text,onInput:t[2]||=e=>a.onInput(e.target.value),onChange:t[3]||=t=>e.$emit(`change`)},null,40,LI))}var zI=X(FI,[[`render`,RI],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetText.vue`]]),BI={integer:/^-?(0|[1-9][0-9]*)?$/,"+integer":/^(0|[1-9][0-9]*)?$/,"-integer":/^(0|-[1-9]?[0-9]*)?$/,float:/^-?([0-9]*|(0|[1-9][0-9]*)\.[0-9]*)?$/,"+float":/^([0-9]*|(0|[1-9][0-9]*)\.[0-9]*)?$/,"-float":/^(0|-[0-9]*|-(0|[1-9][0-9]*)\.[0-9]*)?$/},VI={name:`SetNumber`,props:jg,emits:Mg,data(){return{inputValue:``,sugOpen:!1}},computed:{suggestions(){return this.options.iParamList||[]},pattern(){return BI[this.options.type]||BI.integer}},watch:{value:{immediate:!0,handler(e){this.inputValue=e==null?``:String(e)}}},methods:{onInput(e){if(!this.pattern.test(e)){this.$refs.field.value=this.inputValue;return}this.inputValue=e,this.$emit(`input`,e)},step(e){let t=parseFloat(this.inputValue),n=String((Number.isNaN(t)?0:t)+e);this.pattern.test(n)&&(this.inputValue=n,this.$emit(`input`,n),this.emitChange())},pick(e){this.sugOpen=!1,this.inputValue=String(e.key),this.$emit(`input`,this.inputValue),this.emitChange()},closeSug(){setTimeout(()=>this.sugOpen=!1,0)},emitChange(){this.$emit(`change`)}}},HI={class:`st-number-wrap`},UI={class:`st-number`},WI=[`placeholder`,`disabled`,`value`],GI={key:0,class:`st-number__symbol st-number__symbol--btn`},KI={key:1,class:`st-number__symbol`},qI={key:0,class:`st-pop st-pop--sug`},JI=[`onMousedown`];function YI(e,t,n,r,i,a){return B(),V(`div`,HI,[U(`div`,UI,[U(`input`,{ref:`field`,class:`st-number__field`,type:`text`,placeholder:e.options.placeholder||`请输入`,disabled:e.disabled,value:i.inputValue,onInput:t[0]||=e=>a.onInput(e.target.value),onChange:t[1]||=e=>a.emitChange(),onKeydown:[t[2]||=vl(q(e=>a.step(1),[`prevent`]),[`up`]),t[3]||=vl(q(e=>a.step(-1),[`prevent`]),[`down`])],onBlur:t[4]||=e=>a.closeSug()},null,40,WI),e.$slots.symbol?(B(),V(`span`,GI,[Qi(e.$slots,`symbol`)])):e.options.symbol&&e.options.symbol!==!0?(B(),V(`span`,KI,M(e.options.symbol),1)):K(`v-if`,!0),a.suggestions.length?(B(),V(`span`,{key:2,class:`st-number__caret`,title:`预设值`,onMousedown:t[5]||=q(e=>i.sugOpen=!i.sugOpen,[`prevent`])},`▾`,32)):K(`v-if`,!0)]),K(` 预设值浮层:移出 .st-number,避免被 overflow:hidden 裁切 `),i.sugOpen&&a.suggestions.length?(B(),V(`div`,qI,[(B(!0),V(z,null,R(a.suggestions,e=>(B(),V(`div`,{key:e.key,class:j([`st-pop__item`,{"st-pop__item--on":String(e.key)===String(i.inputValue)}]),onMousedown:q(t=>a.pick(e),[`prevent`])},M(e.value),43,JI))),128))])):K(`v-if`,!0)])}var XI=X(VI,[[`render`,YI],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetNumber.vue`]]),ZI={name:`SetSelect`,props:jg,emits:Mg,computed:{list(){return this.options.iParamList||this.options.iTypeList||[]},placeholder(){return this.options.placeholder||`请选择`},optionList(){return this.list.map(e=>({key:String(e.key),value:e.value}))},current(){return this.value===void 0||this.value===null?``:String(this.value)}},methods:{onChange(e){this.$emit(`input`,e),this.$emit(`change`)}}};function QI(e,t,n,r,i,a){let o=L(`Dropdown`);return B(),H(o,{value:a.current,options:a.optionList,placeholder:a.placeholder,clearable:``,size:`sm`,block:``,disabled:e.disabled,onInput:a.onChange},null,8,[`value`,`options`,`placeholder`,`disabled`,`onInput`])}var $I=X(ZI,[[`render`,QI],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetSelect.vue`]]),eL={name:`SetSwitch`,props:{...jg,boolean:{type:Boolean,default:!1}},emits:Mg,computed:{activeValue(){return this.options.activeValue===void 0?this.boolean?!0:`1`:this.options.activeValue},inactiveValue(){return this.options.inactiveValue===void 0?!this.boolean&&`0`:this.options.inactiveValue},on(){return this.value===this.activeValue},activeText(){return this.options.activeText||`开`},inactiveText(){return this.options.inactiveText||`关`}},methods:{toggle(){this.disabled||(this.$emit(`input`,this.on?this.inactiveValue:this.activeValue),this.$emit(`change`))}}},tL={class:`st-switch__text`};function nL(e,t,n,r,i,a){return B(),V(`div`,{class:j([`st-switch`,{"st-switch--on":a.on}]),onClick:t[0]||=(...e)=>a.toggle&&a.toggle(...e)},[t[1]||=U(`span`,{class:`st-switch__track`},[U(`span`,{class:`st-switch__knob`})],-1),U(`span`,tL,M(a.on?a.activeText:a.inactiveText),1)],2)}var rL=X(eL,[[`render`,nL],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetSwitch.vue`]]);function iL(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>`u`)){var r=document.head||document.getElementsByTagName(`head`)[0],i=document.createElement(`style`);i.type=`text/css`,n===`top`&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var aL=function(e,t){let{componentPrefix:n=``}=t||{};e.component(`${n}${this.name}`,this)},oL={},sL={name:`Checkboard`,props:{size:{type:[Number,String],default:8},white:{type:String,default:`#fff`},grey:{type:String,default:`#e6e6e6`}},computed:{bgStyle(){return{"background-image":`url(${lL(this.white,this.grey,this.size)})`}}}};function cL(e,t,n){if(typeof document>`u`)return null;let r=document.createElement(`canvas`);r.width=r.height=n*2;let i=r.getContext(`2d`);return i?(i.fillStyle=e,i.fillRect(0,0,r.width,r.height),i.fillStyle=t,i.fillRect(0,0,n,n),i.translate(n,n),i.fillRect(0,0,n,n),r.toDataURL()):null}function lL(e,t,n){let r=`${e},${t},${n}`;if(oL[r])return oL[r];let i=cL(e,t,n);return oL[r]=i,i}function uL(e,t,n,r,i,a){return B(),V(`div`,{class:`vc-checkerboard`,style:A(a.bgStyle)},null,4)}iL(`.vc-checkerboard{background-size:contain;bottom:0;left:0;position:absolute;right:0;top:0}`),sL.render=uL,sL.__file=`src/components/checkboard/checkboard.vue`,sL.install=aL;var dL={name:`Alpha`,components:{Checkboard:sL},props:{value:Object,onChange:Function},computed:{colors(){return this.value},gradientColor(){let{rgba:e}=this.colors,t=[e.r,e.g,e.b].join(`,`);return`linear-gradient(to right, rgba(${t}, 0) 0%, rgba(${t}, 1) 100%)`}},methods:{handleChange(e,t){!t&&e.preventDefault();let{container:n}=this.$refs;if(!n)return;let r=n.clientWidth,i=n.getBoundingClientRect().left+window.pageXOffset,a=(e.pageX||(e.touches?e.touches[0].pageX:0))-i,o;o=a<0?0:a>r?1:Math.round(a*100/r)/100,this.colors.a!==o&&this.$emit(`change`,{h:this.colors.hsl.h,s:this.colors.hsl.s,l:this.colors.hsl.l,a:o,source:`rgba`})},handleMouseDown(e){this.handleChange(e,!0),window.addEventListener(`mousemove`,this.handleChange),window.addEventListener(`mouseup`,this.handleMouseUp)},handleMouseUp(){this.unbindEventListeners()},unbindEventListeners(){window.removeEventListener(`mousemove`,this.handleChange),window.removeEventListener(`mouseup`,this.handleMouseUp)}}},fL={class:`vc-alpha`},pL={class:`vc-alpha-checkboard-wrap`},mL=[U(`div`,{class:`vc-alpha-picker`},null,-1)];function hL(e,t,n,r,i,a){let o=L(`Checkboard`);return B(),V(`div`,fL,[U(`div`,pL,[W(o)]),U(`div`,{class:`vc-alpha-gradient`,style:A({background:a.gradientColor})},null,4),U(`div`,{ref:`container`,class:`vc-alpha-container`,onMousedown:t[0]||=(...e)=>a.handleMouseDown&&a.handleMouseDown(...e),onTouchmove:t[1]||=(...e)=>a.handleChange&&a.handleChange(...e),onTouchstart:t[2]||=(...e)=>a.handleChange&&a.handleChange(...e)},[U(`div`,{class:`vc-alpha-pointer`,style:A({left:`${a.colors.a*100}%`})},mL,4)],544)])}iL(`.vc-alpha,.vc-alpha-checkboard-wrap{bottom:0;left:0;position:absolute;right:0;top:0}.vc-alpha-checkboard-wrap{overflow:hidden}.vc-alpha-gradient{bottom:0;left:0;position:absolute;right:0;top:0}.vc-alpha-container{cursor:pointer;height:100%;margin:0 3px;position:relative;z-index:2}.vc-alpha-pointer{position:absolute;z-index:2}.vc-alpha-picker{background:#fff;border-radius:1px;box-shadow:0 0 2px rgba(0,0,0,.6);cursor:pointer;height:8px;margin-top:1px;transform:translateX(-2px);width:4px}`),dL.render=hL,dL.__file=`src/components/alpha/alpha.vue`,dL.install=aL;function gL(e,t){vL(e)&&(e=`100%`);var n=yL(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(e=t===360?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t)),e)}function _L(e){return Math.min(1,Math.max(0,e))}function vL(e){return typeof e==`string`&&e.indexOf(`.`)!==-1&&parseFloat(e)===1}function yL(e){return typeof e==`string`&&e.indexOf(`%`)!==-1}function bL(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function xL(e){return e<=1?`${Number(e)*100}%`:e}function SL(e){return e.length===1?`0`+e:String(e)}function CL(e,t,n){return{r:gL(e,255)*255,g:gL(t,255)*255,b:gL(n,255)*255}}function wL(e,t,n){e=gL(e,255),t=gL(t,255),n=gL(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a=0,o=0,s=(r+i)/2;if(r===i)o=0,a=0;else{var c=r-i;switch(o=s>.5?c/(2-r-i):c/(r+i),r){case e:a=(t-n)/c+(t<n?6:0);break;case t:a=(n-e)/c+2;break;case n:a=(e-t)/c+4}a/=6}return{h:a,s:o,l:s}}function TL(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function EL(e,t,n){var r,i,a;if(e=gL(e,360),t=gL(t,100),n=gL(n,100),t===0)i=n,a=n,r=n;else{var o=n<.5?n*(1+t):n+t-n*t,s=2*n-o;r=TL(s,o,e+1/3),i=TL(s,o,e),a=TL(s,o,e-1/3)}return{r:r*255,g:i*255,b:a*255}}function DL(e,t,n){e=gL(e,255),t=gL(t,255),n=gL(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a=0,o=r,s=r-i,c=r===0?0:s/r;if(r===i)a=0;else{switch(r){case e:a=(t-n)/s+(t<n?6:0);break;case t:a=(n-e)/s+2;break;case n:a=(e-t)/s+4}a/=6}return{h:a,s:c,v:o}}function OL(e,t,n){e=gL(e,360)*6,t=gL(t,100),n=gL(n,100);var r=Math.floor(e),i=e-r,a=n*(1-t),o=n*(1-i*t),s=n*(1-(1-i)*t),c=r%6,l=[n,o,a,a,s,n][c],u=[s,n,n,o,a,a][c],d=[a,a,s,n,n,o][c];return{r:l*255,g:u*255,b:d*255}}function kL(e,t,n,r){var i=[SL(Math.round(e).toString(16)),SL(Math.round(t).toString(16)),SL(Math.round(n).toString(16))];return r&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join(``)}function AL(e,t,n,r,i){var a=[SL(Math.round(e).toString(16)),SL(Math.round(t).toString(16)),SL(Math.round(n).toString(16)),SL(jL(r))];return i&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))&&a[3].startsWith(a[3].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join(``)}function jL(e){return Math.round(parseFloat(e)*255).toString(16)}function ML(e){return NL(e)/255}function NL(e){return parseInt(e,16)}function PL(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var FL={aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,goldenrod:`#daa520`,gold:`#ffd700`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,lavenderblush:`#fff0f5`,lavender:`#e6e6fa`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,steelblue:`#4682b4`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,tomato:`#ff6347`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`};function IL(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,a=null,o=!1,s=!1;return typeof e==`string`&&(e=VL(e)),typeof e==`object`&&(HL(e.r)&&HL(e.g)&&HL(e.b)?(t=CL(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)===`%`?`prgb`:`rgb`):HL(e.h)&&HL(e.s)&&HL(e.v)?(r=xL(e.s),i=xL(e.v),t=OL(e.h,r,i),o=!0,s=`hsv`):HL(e.h)&&HL(e.s)&&HL(e.l)&&(r=xL(e.s),a=xL(e.l),t=EL(e.h,r,a),o=!0,s=`hsl`),Object.prototype.hasOwnProperty.call(e,`a`)&&(n=e.a)),n=bL(n),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var LL=`(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)`,RL=`[\\s|\\(]+(${LL})[,|\\s]+(${LL})[,|\\s]+(${LL})\\s*\\)?`,zL=`[\\s|\\(]+(${LL})[,|\\s]+(${LL})[,|\\s]+(${LL})[,|\\s]+(${LL})\\s*\\)?`,BL={CSS_UNIT:new RegExp(LL),rgb:RegExp(`rgb`+RL),rgba:RegExp(`rgba`+zL),hsl:RegExp(`hsl`+RL),hsla:RegExp(`hsla`+zL),hsv:RegExp(`hsv`+RL),hsva:RegExp(`hsva`+zL),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function VL(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(FL[e])e=FL[e],t=!0;else if(e===`transparent`)return{r:0,g:0,b:0,a:0,format:`name`};var n=BL.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=BL.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=BL.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=BL.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=BL.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=BL.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=BL.hex8.exec(e),n?{r:NL(n[1]),g:NL(n[2]),b:NL(n[3]),a:ML(n[4]),format:t?`name`:`hex8`}:(n=BL.hex6.exec(e),n?{r:NL(n[1]),g:NL(n[2]),b:NL(n[3]),format:t?`name`:`hex`}:(n=BL.hex4.exec(e),n?{r:NL(n[1]+n[1]),g:NL(n[2]+n[2]),b:NL(n[3]+n[3]),a:ML(n[4]+n[4]),format:t?`name`:`hex8`}:(n=BL.hex3.exec(e),n?{r:NL(n[1]+n[1]),g:NL(n[2]+n[2]),b:NL(n[3]+n[3]),format:t?`name`:`hex`}:!1)))))))))}function HL(e){return!!BL.CSS_UNIT.exec(String(e))}var UL=function(){function e(t,n){if(t===void 0&&(t=``),n===void 0&&(n={}),t instanceof e)return t;typeof t==`number`&&(t=PL(t)),this.originalInput=t;var r=IL(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),t,n,r,i=e.r/255,a=e.g/255,o=e.b/255;return t=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,n=a<=.03928?a/12.92:((a+.055)/1.055)**2.4,r=o<=.03928?o/12.92:((o+.055)/1.055)**2.4,.2126*t+.7152*n+.0722*r},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=bL(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){return this.toHsl().s===0},e.prototype.toHsv=function(){var e=DL(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=DL(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?`hsv(${t}, ${n}%, ${r}%)`:`hsva(${t}, ${n}%, ${r}%, ${this.roundA})`},e.prototype.toHsl=function(){var e=wL(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=wL(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?`hsl(${t}, ${n}%, ${r}%)`:`hsla(${t}, ${n}%, ${r}%, ${this.roundA})`},e.prototype.toHex=function(e){return e===void 0&&(e=!1),kL(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return e===void 0&&(e=!1),`#`+this.toHex(e)},e.prototype.toHex8=function(e){return e===void 0&&(e=!1),AL(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return e===void 0&&(e=!1),`#`+this.toHex8(e)},e.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?`rgb(${e}, ${t}, ${n})`:`rgba(${e}, ${t}, ${n}, ${this.roundA})`},e.prototype.toPercentageRgb=function(){var e=function(e){return`${Math.round(gL(e,255)*100)}%`};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(gL(e,255)*100)};return this.a===1?`rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)`:`rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`},e.prototype.toName=function(){if(this.a===0)return`transparent`;if(this.a<1)return!1;for(var e=`#`+kL(this.r,this.g,this.b,!1),t=0,n=Object.entries(FL);t<n.length;t++){var r=n[t],i=r[0];if(e===r[1])return i}return!1},e.prototype.toString=function(e){var t=!!e;e??=this.format;var n=!1,r=this.a<1&&this.a>=0;return!t&&r&&(e.startsWith(`hex`)||e===`name`)?e===`name`&&this.a===0?this.toName():this.toRgbString():(e===`rgb`&&(n=this.toRgbString()),e===`prgb`&&(n=this.toPercentageRgbString()),(e===`hex`||e===`hex6`)&&(n=this.toHexString()),e===`hex3`&&(n=this.toHexString(!0)),e===`hex4`&&(n=this.toHex8String(!0)),e===`hex8`&&(n=this.toHex8String()),e===`name`&&(n=this.toName()),e===`hsl`&&(n=this.toHslString()),e===`hsv`&&(n=this.toHsvString()),n||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=_L(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=_L(n.l),new e(n)},e.prototype.tint=function(e){return e===void 0&&(e=10),this.mix(`white`,e)},e.prototype.shade=function(e){return e===void 0&&(e=10),this.mix(`black`,e)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=_L(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=_L(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),a=n/100;return new e({r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a})},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,a=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,a.push(new e(r));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/t;t--;)o.push(new e({h:r,s:i,v:a})),a=(a+s)%1;return o},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb(),i=n.a+r.a*(1-n.a);return new e({r:(n.r*n.a+r.r*r.a*(1-n.a))/i,g:(n.g*n.a+r.g*r.a*(1-n.a))/i,b:(n.b*n.a+r.b*r.a*(1-n.a))/i,a:i})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],a=360/t,o=1;o<t;o++)i.push(new e({h:(r+o*a)%360,s:n.s,l:n.l}));return i},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();function WL(...e){return new UL(...e)}function GL(e,t){let n=e&&e.a,r;r=e&&e.hsl?WL(e.hsl):e&&e.hex&&e.hex.length>0?WL(e.hex):e&&e.hsv?WL(e.hsv):e&&e.rgba?WL(e.rgba):e&&e.rgb?WL(e.rgb):WL(e),r&&(r._a===void 0||r._a===null)&&r.setAlpha(n||r.getAlpha());let i=r.toHsl(),a=r.toHsv();return i.s===0&&(a.h=i.h=e.h||e.hsl&&e.hsl.h||t||0),a.v<.0164&&(a.h=e.h||e.hsv&&e.hsv.h||0,a.s=e.s||e.hsv&&e.hsv.s||0),i.l<.01&&(i.h=e.h||e.hsl&&e.hsl.h||0,i.s=e.s||e.hsl&&e.hsl.s||0),{hsl:i,hex:r.toHexString().toUpperCase(),hex8:r.toHex8String().toUpperCase(),rgba:r.toRgb(),hsv:a,oldHue:e.h||t||i.h,source:e.source,a:r.getAlpha()}}var KL={model:{prop:`modelValue`,event:`update:modelValue`},props:[`modelValue`],data(){return{val:GL(this.modelValue)}},computed:{colors:{get(){return this.val},set(e){this.val=e,this.$emit(`update:modelValue`,e)}}},watch:{modelValue(e){this.val=GL(e)}},methods:{colorChange(e,t){this.oldHue=this.colors.hsl.h,this.colors=GL(e,t||this.oldHue)},isValidHex(e){return WL(e).isValid},simpleCheckForValidColor(e){let t=[`r`,`g`,`b`,`a`,`h`,`s`,`l`,`v`],n=0,r=0;for(let i=0;i<t.length;i++){let a=t[i];e[a]&&(n++,isNaN(e[a])||r++)}if(n===r)return e},paletteUpperCase(e){return e.map(e=>e.toUpperCase())},isTransparent(e){return WL(e).getAlpha()===0}}},qL={name:`EditableInput`,props:{label:String,labelText:String,desc:String,value:[String,Number],max:Number,min:Number,arrowOffset:{type:Number,default:1}},computed:{val:{get(){return this.value},set(e){if(this.max!==void 0&&+e>this.max)this.$refs.input.value=this.max;else return e}},labelId(){return`input__label__${this.label}__${Math.random().toString().slice(2,5)}`},labelSpanText(){return this.labelText||this.label}},methods:{update(e){this.handleChange(e.target.value)},handleChange(e){let t={};t[this.label]=e,(t.hex===void 0&&t[`#`]===void 0||e.length>5)&&this.$emit(`change`,t)},handleKeyDown(e){let{val:t}=this,n=Number(t);if(n){let r=this.arrowOffset||1;e.keyCode===38&&(t=n+r,this.handleChange(t),e.preventDefault()),e.keyCode===40&&(t=n-r,this.handleChange(t),e.preventDefault())}}}},JL={class:`vc-editable-input`},YL=[`aria-labelledby`],XL=[`id`,`for`],ZL={class:`vc-input__desc`};function QL(e,t,n,r,i,a){return B(),V(`div`,JL,[I(U(`input`,{ref:`input`,"onUpdate:modelValue":t[0]||=e=>a.val=e,"aria-labelledby":a.labelId,class:`vc-input__input`,onKeydown:t[1]||=(...e)=>a.handleKeyDown&&a.handleKeyDown(...e),onInput:t[2]||=(...e)=>a.update&&a.update(...e)},null,40,YL),[[il,a.val]]),U(`span`,{id:a.labelId,for:n.label,class:`vc-input__label`},M(a.labelSpanText),9,XL),U(`span`,ZL,M(n.desc),1)])}iL(`.vc-editable-input{position:relative}.vc-input__input{border:0;outline:none;padding:0}.vc-input__label{text-transform:capitalize}`),qL.render=QL,qL.__file=`src/components/editable-input/editable-input.vue`,qL.install=aL;function $L(e,t,n){return t<n?e<t?t:e>n?n:e:e<n?n:e>t?t:e}var eR={name:`Saturation`,props:{value:Object},computed:{colors(){return this.value},bgColor(){return`hsl(${this.colors.hsv.h}, 100%, 50%)`},pointerTop(){return`${-(this.colors.hsv.v*100)+1+100}%`},pointerLeft(){return`${this.colors.hsv.s*100}%`}},methods:{handleChange(e,t){!t&&e.preventDefault();let{container:n}=this.$refs;if(!n)return;let r=n.clientWidth,i=n.clientHeight,a=n.getBoundingClientRect().left+window.pageXOffset,o=n.getBoundingClientRect().top+window.pageYOffset,s=e.pageX||(e.touches?e.touches[0].pageX:0),c=e.pageY||(e.touches?e.touches[0].pageY:0),l=$L(s-a,0,r),u=$L(c-o,0,i),d=l/r,f=$L(-(u/i)+1,0,1);this.onChange({h:this.colors.hsv.h,s:d,v:f,a:this.colors.hsv.a,source:`hsva`})},onChange(e){this.$emit(`change`,e)},handleMouseDown(e){window.addEventListener(`mousemove`,this.handleChange),window.addEventListener(`mouseup`,this.handleChange),window.addEventListener(`mouseup`,this.handleMouseUp)},handleMouseUp(e){this.unbindEventListeners()},unbindEventListeners(){window.removeEventListener(`mousemove`,this.handleChange),window.removeEventListener(`mouseup`,this.handleChange),window.removeEventListener(`mouseup`,this.handleMouseUp)}}},tR=U(`div`,{class:`vc-saturation--white`},null,-1),nR=U(`div`,{class:`vc-saturation--black`},null,-1),rR=[U(`div`,{class:`vc-saturation-circle`},null,-1)];function iR(e,t,n,r,i,a){return B(),V(`div`,{ref:`container`,class:`vc-saturation`,style:A({background:a.bgColor}),onMousedown:t[0]||=(...e)=>a.handleMouseDown&&a.handleMouseDown(...e),onTouchmove:t[1]||=(...e)=>a.handleChange&&a.handleChange(...e),onTouchstart:t[2]||=(...e)=>a.handleChange&&a.handleChange(...e)},[tR,nR,U(`div`,{class:`vc-saturation-pointer`,style:A({top:a.pointerTop,left:a.pointerLeft})},rR,4)],36)}iL(`.vc-saturation,.vc-saturation--black,.vc-saturation--white{bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0}.vc-saturation--white{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.vc-saturation--black{background:linear-gradient(0deg,#000,transparent)}.vc-saturation-pointer{cursor:pointer;position:absolute}.vc-saturation-circle{border-radius:50%;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);cursor:head;height:4px;transform:translate(-2px,-2px);width:4px}`),eR.render=iR,eR.__file=`src/components/saturation/saturation.vue`,eR.install=aL;var aR={name:`Hue`,props:{value:Object,direction:{type:String,default:`horizontal`}},data(){return{oldHue:0,pullDirection:``}},computed:{colors(){return this.value},directionClass(){return{"vc-hue--horizontal":this.direction===`horizontal`,"vc-hue--vertical":this.direction===`vertical`}},pointerTop(){return this.direction===`vertical`?this.colors.hsl.h===0&&this.pullDirection===`right`?0:`${-(this.colors.hsl.h*100/360)+100}%`:0},pointerLeft(){return this.direction===`vertical`?0:this.colors.hsl.h===0&&this.pullDirection===`right`?`100%`:`${this.colors.hsl.h*100/360}%`}},watch:{value:{handler(e,t){let{h:n}=e.hsl;n!==0&&n-this.oldHue>0&&(this.pullDirection=`right`),n!==0&&n-this.oldHue<0&&(this.pullDirection=`left`),this.oldHue=n},deep:!0,immediate:!0}},methods:{handleChange(e,t){!t&&e.preventDefault();let{container:n}=this.$refs;if(!n)return;let r=n.clientWidth,i=n.clientHeight,a=n.getBoundingClientRect().left+window.pageXOffset,o=n.getBoundingClientRect().top+window.pageYOffset,s=e.pageX||(e.touches?e.touches[0].pageX:0),c=e.pageY||(e.touches?e.touches[0].pageY:0),l=s-a,u=c-o,d,f;this.direction===`vertical`?(u<0?d=360:u>i?d=0:(f=-(u*100/i)+100,d=360*f/100),this.colors.hsl.h!==d&&this.$emit(`change`,{h:d,s:this.colors.hsl.s,l:this.colors.hsl.l,a:this.colors.hsl.a,source:`hsl`})):(l<0?d=0:l>r?d=360:(f=l*100/r,d=360*f/100),this.colors.hsl.h!==d&&this.$emit(`change`,{h:d,s:this.colors.hsl.s,l:this.colors.hsl.l,a:this.colors.hsl.a,source:`hsl`}))},handleMouseDown(e){this.handleChange(e,!0),window.addEventListener(`mousemove`,this.handleChange),window.addEventListener(`mouseup`,this.handleChange),window.addEventListener(`mouseup`,this.handleMouseUp)},handleMouseUp(e){this.unbindEventListeners()},unbindEventListeners(){window.removeEventListener(`mousemove`,this.handleChange),window.removeEventListener(`mouseup`,this.handleChange),window.removeEventListener(`mouseup`,this.handleMouseUp)}}},oR=[`aria-valuenow`],sR=[U(`div`,{class:`vc-hue-picker`},null,-1)];function cR(e,t,n,r,i,a){return B(),V(`div`,{class:j([`vc-hue`,[a.directionClass]])},[U(`div`,{ref:`container`,class:`vc-hue-container`,role:`slider`,"aria-valuenow":a.colors.hsl.h,"aria-valuemin":`0`,"aria-valuemax":`360`,onMousedown:t[0]||=(...e)=>a.handleMouseDown&&a.handleMouseDown(...e),onTouchmove:t[1]||=(...e)=>a.handleChange&&a.handleChange(...e),onTouchstart:t[2]||=(...e)=>a.handleChange&&a.handleChange(...e)},[U(`div`,{class:`vc-hue-pointer`,style:A({top:a.pointerTop,left:a.pointerLeft}),role:`presentation`},sR,4)],40,oR)],2)}iL(`.vc-hue{border-radius:2px;bottom:0;left:0;position:absolute;right:0;top:0}.vc-hue--horizontal{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.vc-hue--vertical{background:linear-gradient(0deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.vc-hue-container{cursor:pointer;height:100%;margin:0 2px;position:relative}.vc-hue-pointer{position:absolute;z-index:2}.vc-hue-picker{background:#fff;border-radius:1px;box-shadow:0 0 2px rgba(0,0,0,.6);cursor:pointer;height:8px;margin-top:1px;transform:translateX(-2px);width:4px}`),aR.render=cR,aR.__file=`src/components/hue/hue.vue`,aR.install=aL;var lR=[`#D0021B`,`#F5A623`,`#F8E71C`,`#8B572A`,`#7ED321`,`#417505`,`#BD10E0`,`#9013FE`,`#4A90E2`,`#50E3C2`,`#B8E986`,`#000000`,`#4A4A4A`,`#9B9B9B`,`#FFFFFF`,`rgba(0,0,0,0)`],uR={name:`Sketch`,components:{Saturation:eR,Hue:aR,Alpha:dL,EdIn:qL,Checkboard:sL},mixins:[KL],props:{presetColors:{type:Array,default(){return lR}},disableAlpha:{type:Boolean,default:!1},disableFields:{type:Boolean,default:!1}},computed:{hex(){let e;return e=this.colors.a<1?this.colors.hex8:this.colors.hex,e.replace(`#`,``)},activeColor(){let{rgba:e}=this.colors;return`rgba(${[e.r,e.g,e.b,e.a].join(`,`)})`}},methods:{handlePreset(e){this.colorChange(e)},childChange(e){this.colorChange(e)},inputChange(e){e&&(e.hex?this.isValidHex(e.hex)&&this.colorChange({hex:e.hex,source:`hex`}):(e.r||e.g||e.b||e.a)&&this.colorChange({r:e.r||this.colors.rgba.r,g:e.g||this.colors.rgba.g,b:e.b||this.colors.rgba.b,a:e.a||this.colors.rgba.a,source:`rgba`}))}}},dR={class:`vc-sketch-saturation-wrap`},fR={class:`vc-sketch-controls`},pR={class:`vc-sketch-sliders`},mR={class:`vc-sketch-hue-wrap`},hR={key:0,class:`vc-sketch-alpha-wrap`},gR={class:`vc-sketch-color-wrap`},_R=[`aria-label`],vR={key:0,class:`vc-sketch-field`},yR={class:`vc-sketch-field--double`},bR={class:`vc-sketch-field--single`},xR={class:`vc-sketch-field--single`},SR={class:`vc-sketch-field--single`},CR={key:0,class:`vc-sketch-field--single`},wR={class:`vc-sketch-presets`,role:`group`,"aria-label":`A color preset, pick one to set as current color`},TR=[`aria-label`,`onClick`],ER=[`aria-label`,`onClick`];function DR(e,t,n,r,i,a){let o=L(`Saturation`),s=L(`Hue`),c=L(`Alpha`),l=L(`Checkboard`),u=L(`EdIn`);return B(),V(`div`,{role:`application`,"aria-label":`Sketch color picker`,class:j([`vc-sketch`,[n.disableAlpha?`vc-sketch__disable-alpha`:``]])},[U(`div`,dR,[W(o,{value:e.colors,onChange:a.childChange},null,8,[`value`,`onChange`])]),U(`div`,fR,[U(`div`,pR,[U(`div`,mR,[W(s,{value:e.colors,onChange:a.childChange},null,8,[`value`,`onChange`])]),n.disableAlpha?K(`v-if`,!0):(B(),V(`div`,hR,[W(c,{value:e.colors,onChange:a.childChange},null,8,[`value`,`onChange`])]))]),U(`div`,gR,[U(`div`,{"aria-label":`Current color is ${a.activeColor}`,class:`vc-sketch-active-color`,style:A({background:a.activeColor})},null,12,_R),W(l)])]),n.disableFields?K(`v-if`,!0):(B(),V(`div`,vR,[K(` rgba `),U(`div`,yR,[W(u,{label:`hex`,value:a.hex,onChange:a.inputChange},null,8,[`value`,`onChange`])]),U(`div`,bR,[W(u,{label:`r`,value:e.colors.rgba.r,onChange:a.inputChange},null,8,[`value`,`onChange`])]),U(`div`,xR,[W(u,{label:`g`,value:e.colors.rgba.g,onChange:a.inputChange},null,8,[`value`,`onChange`])]),U(`div`,SR,[W(u,{label:`b`,value:e.colors.rgba.b,onChange:a.inputChange},null,8,[`value`,`onChange`])]),n.disableAlpha?K(`v-if`,!0):(B(),V(`div`,CR,[W(u,{label:`a`,value:e.colors.a,"arrow-offset":.01,max:1,onChange:a.inputChange},null,8,[`value`,`arrow-offset`,`onChange`])]))])),U(`div`,wR,[(B(!0),V(z,null,R(n.presetColors,t=>(B(),V(z,null,[e.isTransparent(t)?(B(),V(`div`,{key:t,"aria-label":`Color:${t}`,class:`vc-sketch-presets-color`,onClick:e=>a.handlePreset(t)},[W(l)],8,ER)):(B(),V(`div`,{key:`!${t}`,class:`vc-sketch-presets-color`,"aria-label":`Color:${t}`,style:A({background:t}),onClick:e=>a.handlePreset(t)},null,12,TR))],64))),256))])],2)}iL(`.vc-sketch{background:#fff;border-radius:4px;box-shadow:0 0 0 1px rgba(0,0,0,.15),0 8px 16px rgba(0,0,0,.15);box-sizing:initial;padding:10px 10px 0;position:relative;width:200px}.vc-sketch-saturation-wrap{overflow:hidden;padding-bottom:75%;position:relative;width:100%}.vc-sketch-controls{display:flex}.vc-sketch-sliders{flex:1;padding:4px 0}.vc-sketch-sliders .vc-alpha-gradient,.vc-sketch-sliders .vc-hue{border-radius:2px}.vc-sketch-alpha-wrap,.vc-sketch-hue-wrap{height:10px;position:relative}.vc-sketch-alpha-wrap{margin-top:4px;overflow:hidden}.vc-sketch-color-wrap{border-radius:3px;height:24px;margin-left:4px;margin-top:4px;position:relative;width:24px}.vc-sketch-active-color{border-radius:2px;bottom:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15),inset 0 0 4px rgba(0,0,0,.25);left:0;position:absolute;right:0;top:0;z-index:2}.vc-sketch-color-wrap .vc-checkerboard{background-size:auto}.vc-sketch-field{display:flex;padding-top:4px}.vc-sketch-field .vc-input__input{border:none;box-shadow:inset 0 0 0 1px #ccc;font-size:10px;padding:4px 0 3px 10%;width:90%}.vc-sketch-field .vc-input__label{color:#222;display:block;font-size:11px;padding-bottom:4px;padding-top:3px;text-align:center;text-transform:capitalize}.vc-sketch-field--single{flex:1;padding-left:6px}.vc-sketch-field--double{flex:2}.vc-sketch-presets{border-top:1px solid #eee;margin-left:-10px;margin-right:-10px;padding-left:10px;padding-top:10px}.vc-sketch-presets-color{cursor:pointer;display:inline-block;height:16px;margin:0 10px 10px 0;overflow:hidden;position:relative;vertical-align:top;width:16px}.vc-sketch-presets-color,.vc-sketch-presets-color .vc-checkerboard{border-radius:3px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}.vc-sketch__disable-alpha .vc-sketch-color-wrap{height:10px}`),uR.render=DR,uR.__file=`src/components/sketch/sketch.vue`,uR.install=aL;function OR(e){let t=String(e||``).trim();if(!t)return null;let n=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);if(n)return{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16),a:1};if(n=t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i),n){let e=e=>parseInt(e+e,16);return{r:e(n[1]),g:e(n[2]),b:e(n[3]),a:1}}if(n=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i),n)return{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16),a:parseInt(n[4],16)/255};if(n=t.match(/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)(?:\s*,\s*([\d.]+))?\s*\)$/i),n){let e=n[4]===void 0?1:parseFloat(n[4]);return{r:Math.round(parseFloat(n[1])),g:Math.round(parseFloat(n[2])),b:Math.round(parseFloat(n[3])),a:e}}return null}function kR(e){if(!e)return`#000000`;let t=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,`0`);return`#`+t(e.r)+t(e.g)+t(e.b)}function AR(e){return e?e.a>=1?kR(e):`rgba(${Math.round(e.r)}, ${Math.round(e.g)}, ${Math.round(e.b)}, ${+e.a.toFixed(2)})`:``}var jR={name:`SetColor`,components:{Sketch:uR},props:jg,emits:Mg,data(){return{_rgb:null,popOpen:!1,popW:240,popStyle:{position:`fixed`,left:`0px`,top:`0px`}}},computed:{text(){return this.value===void 0||this.value===null?``:String(this.value)},parsed(){return OR(this.text)||{r:0,g:0,b:0,a:1}},pickerValue(){return this.text||`#000000`},alpha(){return this.parsed.a},displayColor(){return AR(this.parsed)}},watch:{text(){this._rgb=OR(this.text)}},beforeUnmount(){this.removeDocListener()},methods:{onTextInput(e){this._rgb=OR(e),this.$emit(`input`,e)},onAlphaChange(e){let t=Math.max(0,Math.min(1,parseInt(e,10)/100)),n={...this._rgb||this.parsed,a:t};this._rgb=n,this.$emit(`input`,AR(n)),this.$emit(`change`)},onPicker(e){let t=e&&e.rgba,n,r,i,a;if(Array.isArray(t))[n,r,i,a]=t;else if(t)n=t.r,r=t.g,i=t.b,a=t.a;else{let t=OR(e.hex)||{r:0,g:0,b:0,a:1};n=t.r,r=t.g,i=t.b,a=t.a}a??=1;let o=e.hex||kR({r:n,g:r,b:i,a:1});this._rgb={r:n,g:r,b:i,a},this.$emit(`input`,a>=1?o:`rgba(${Math.round(n)}, ${Math.round(r)}, ${Math.round(i)}, ${+a.toFixed(2)})`),this.$emit(`change`)},clear(){this.disabled||(this._rgb=null,this.closePop(),this.$emit(`input`,``),this.$emit(`change`))},togglePop(){this.disabled||(this.popOpen?this.closePop():this.openPop())},openPop(){let e=this.$refs.swatch;if(!e)return;let t=e.getBoundingClientRect(),n=this.$refs.top&&this.$refs.top.getBoundingClientRect()||t,r=Math.max(220,Math.min(Math.round(n.width),400)),i=window.innerWidth,a=window.innerHeight,o=n.left,s=t.bottom+6;o+r>i-8&&(o=Math.max(8,i-r-8)),s+320>a-8&&(s=Math.max(8,t.top-320-6)),this.popW=r,this.popStyle={position:`fixed`,left:o+`px`,top:s+`px`,width:r+`px`,zIndex:4e3},this.popOpen=!0,this.$nextTick(()=>{document.addEventListener(`mousedown`,this.onDocClick,!0)})},closePop(){this.popOpen&&(this.popOpen=!1,this.removeDocListener())},removeDocListener(){document.removeEventListener(`mousedown`,this.onDocClick,!0)},onDocClick(e){let t=this.$refs.pop,n=this.$refs.swatch;t&&t.contains(e.target)||n&&n.contains(e.target)||this.closePop()}}},MR={class:`st-color`},NR={class:`st-color__top`,ref:`top`},PR=[`title`,`disabled`],FR=[`disabled`,`value`],IR=[`disabled`],LR={key:0,class:`st-color__alpha-row`},RR=[`disabled`,`value`],zR={class:`st-color__alpha-val`};function BR(e,t,n,r,i,a){let o=L(`Sketch`);return B(),V(`div`,MR,[K(` 色块预览 + 文本输入 + 重置(顶行) `),U(`div`,NR,[U(`button`,{ref:`swatch`,class:`st-color__swatch`,type:`button`,title:a.text||`未设置`,disabled:e.disabled,onClick:t[0]||=(...e)=>a.togglePop&&a.togglePop(...e)},[t[7]||=U(`span`,{class:`st-color__checker`},null,-1),U(`span`,{class:`st-color__fill`,style:A({background:a.displayColor||`transparent`})},null,4)],8,PR),U(`input`,{class:`ni-input st-color__text`,type:`text`,placeholder:`如 #333333 / rgba(0,0,0,.5)`,disabled:e.disabled,value:a.text,onInput:t[1]||=e=>a.onTextInput(e.target.value),onChange:t[2]||=t=>e.$emit(`change`)},null,40,FR),U(`button`,{class:`st-color__clear`,type:`button`,title:`重置(清空颜色)`,disabled:e.disabled,onClick:t[3]||=(...e)=>a.clear&&a.clear(...e)},[...t[8]||=[U(`svg`,{viewBox:`0 0 16 16`,class:`st-ic`,"aria-hidden":`true`},[U(`use`,{href:`#icon-reset`})],-1)]],8,IR)],512),K(` 透明度滑块(仅当颜色值非空时显示),作为快捷调节 `),a.text?(B(),V(`div`,LR,[t[9]||=U(`span`,{class:`st-color__alpha-label`},`透明度`,-1),U(`input`,{class:`st-color__alpha-slider`,type:`range`,min:`0`,max:`100`,disabled:e.disabled,value:Math.round(a.alpha*100),onInput:t[4]||=e=>a.onAlphaChange(e.target.value),onChange:t[5]||=t=>e.$emit(`change`)},null,40,RR),U(`span`,zR,M(Math.round(a.alpha*100))+`%`,1)])):K(`v-if`,!0),K(` 第三方颜色选择器弹层(挂载到 body,避免被滚动容器裁切) `),(B(),H(ai,{to:`body`},[i.popOpen?(B(),V(`div`,{key:0,ref:`pop`,class:`st-color__pop`,style:A(i.popStyle),onMousedown:t[6]||=q(()=>{},[`stop`])},[W(o,{"model-value":a.pickerValue,"disable-alpha":!1,"onUpdate:modelValue":a.onPicker},null,8,[`model-value`,`onUpdate:modelValue`])],36)):K(`v-if`,!0)]))])}var VR=X(jR,[[`render`,BR],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetColor.vue`]]),HR={name:`SetIconSelect`,components:{SvgSymbols:xd},props:jg,emits:Mg,data(){return{open:!1}},computed:{list(){return this.options.iIconList||[]}},methods:{pick(e){this.disabled||(this.open=!1,this.$emit(`input`,e.key),this.$emit(`change`))}}},UR={class:`st-iconsel-wrap`},WR={class:`st-iconsel`},GR={class:`st-iconsel__preview`},KR={key:1,style:{"font-size":`11px`,color:`var(--text-faint)`}},qR=[`disabled`,`value`],JR={key:0,class:`st-iconsel__grid`},YR=[`title`,`onClick`],XR={key:0,class:`st-list__empty`};function ZR(e,t,n,r,i,a){let o=L(`SvgSymbols`);return B(),V(`div`,UR,[U(`div`,WR,[U(`span`,GR,[e.value?(B(),H(o,{key:0,icon:String(e.value),color:`currentColor`},null,8,[`icon`])):(B(),V(`span`,KR,`无`))]),U(`input`,{class:`ni-input`,type:`text`,placeholder:`图标 key`,disabled:e.disabled,value:e.value||``,onInput:t[0]||=t=>e.$emit(`input`,t.target.value),onChange:t[1]||=t=>e.$emit(`change`)},null,40,qR),U(`button`,{class:`st-minibtn`,type:`button`,onClick:t[2]||=e=>i.open=!i.open},M(i.open?`收起`:`选择`),1)]),i.open?(B(),V(`div`,JR,[(B(!0),V(z,null,R(a.list,t=>(B(),V(`span`,{key:t.key,class:j([`st-iconsel__cell`,{"st-iconsel__cell--on":t.key===e.value}]),title:t.name||t.value||t.key,onClick:e=>a.pick(t)},[W(o,{icon:t.key,color:`currentColor`},null,8,[`icon`])],10,YR))),128)),a.list.length?K(`v-if`,!0):(B(),V(`p`,XR,`该组件未提供图标列表`))])):K(`v-if`,!0)])}var QR=X(HR,[[`render`,ZR],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetIconSelect.vue`]]);Prism.languages.javascript=Prism.languages.extend(`clike`,{"class-name":[Prism.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),Prism.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined(`script`,`javascript`),Prism.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),Prism.languages.js=Prism.languages.javascript,Yg.default.languages.javascript&&!Yg.default.languages.javascript[`binding-var`]&&Yg.default.languages.insertBefore(`javascript`,`keyword`,{"binding-var":/\$[A-Za-z_$][\w$]*/});var $R={name:`SetExpr`,props:{...jg,placeholder:{type:String,default:``}},emits:Mg,data(){return{code:``}},computed:{lines(){return this.code?this.code.split(`
|
|
309
|
-
`).length:0},chars(){return this.code.length}},watch:{value(e){this.syncFromValue(e)}},mounted(){this.code=this.readValue(this.value),this.$nextTick(()=>this.initJar())},beforeUnmount(){this._t&&clearTimeout(this._t),this._jar&&this._jar.destroy&&this._jar.destroy()},methods:{readValue(e){return e==null?``:typeof e==`string`?e:String(e)},syncFromValue(e){let t=this.readValue(e);if(t===this.code)return;let n=this.$refs.editor;n&&document.activeElement===n||(this.code=t,this._jar&&this._jar.updateCode(t))},initJar(){let e=this.$refs.editor;if(!e)return;let t=e=>{e.innerHTML=Yg.default.highlight(e.textContent,Yg.default.languages.javascript,`javascript`)};this._jar=Jg(e,t,{tab:` `,indentOn:/[({[]$/,addClosing:!0,history:!0}),this._jar.updateCode(this.code),this._jar.onUpdate(e=>this.onCode(e))},onCode(e){this.disabled||(this.code=e,this.$emit(`input`,e),this._t&&clearTimeout(this._t),this._t=setTimeout(()=>this.$emit(`change`),400))}}},ez={key:0,class:`st-expr__ph`},tz={class:`st-expr__foot`},nz={class:`st-expr__hint`};function rz(e,t,n,r,i,a){return B(),V(`div`,{class:j([`st-expr`,{"st-expr--disabled":e.disabled}])},[U(`div`,{ref:`editor`,class:j([`st-expr__editor`,{"is-disabled":e.disabled}])},null,2),n.placeholder&&!i.code?(B(),V(`span`,ez,M(n.placeholder),1)):K(`v-if`,!0),U(`div`,tz,[U(`span`,nz,M(a.lines)+` 行 · `+M(a.chars)+` 字符`,1)])],2)}var iz=X($R,[[`render`,rz],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetExpr.vue`]]),az={name:`SetIfForm`,components:{SetExpr:iz},props:jg,emits:Mg,computed:{obj(){return this.value&&typeof this.value==`object`?this.value:{}},expression(){return this.obj.expression||``},name(){return this.obj.name||``}},methods:{setExpression(e){let t=!this.name||this.name===this.expression;this.$emit(`input`,{name:t?e:this.name,expression:e})},setName(e){this.$emit(`input`,{name:e,expression:this.expression})}}},oz={class:`st-ifform`},sz=[`disabled`,`value`];function cz(e,t,n,r,i,a){let o=L(`SetExpr`);return B(),V(`div`,oz,[W(o,{value:a.expression,disabled:e.disabled,placeholder:`表达式,如 $singleMode 或 $data.count > 0`,onInput:a.setExpression,onChange:t[0]||=t=>e.$emit(`change`)},null,8,[`value`,`disabled`,`onInput`]),U(`input`,{class:`ni-input`,type:`text`,placeholder:`显示名(留空跟随表达式)`,disabled:e.disabled,value:a.name,onInput:t[1]||=e=>a.setName(e.target.value),onChange:t[2]||=t=>e.$emit(`change`)},null,40,sz)])}var lz=X(az,[[`render`,cz],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetIfForm.vue`]]),uz=[{key:`number`,value:`px`},{key:`percent`,value:`%`},{key:`auto`,value:`@`}],dz={name:`SetNumberStyle`,components:{SetNumber:XI},props:jg,emits:Mg,data(){return{unit:`number`,numValue:``,menuOpen:!1}},computed:{unitList(){return this.options.iTypeList||uz},unitLabel(){let e=this.unitList.filter(e=>e.key===this.unit)[0];return e?e.value:`px`},isAuto(){return this.unit===`auto`},numberOptions(){return{...this.options,type:this.unit===`percent`?`integer`:`float`,placeholder:this.options.placeholder||``,symbol:!0}}},watch:{value:{immediate:!0,handler(){this.parse()}}},methods:{parse(){let e=this.value;/%$/.test(String(e))?(this.unit=`percent`,this.numValue=String(e).replace(/%/g,``)):e===`auto`?(this.unit=`auto`,this.numValue=`auto`):(this.unit=`number`,this.numValue=e===0?`0`:e==null?``:String(e))},onNum(e){this.numValue=e,this.emit()},pickUnit(e){this.menuOpen=!1,this.unit=e,this.numValue=e===`percent`?`100`:e===`auto`?`auto`:``,this.emit(),this.$emit(`change`)},emit(){this.unit===`percent`&&this.numValue?this.$emit(`input`,this.numValue+`%`):this.$emit(`input`,this.numValue)}}},fz={class:`st-numberstyle`},pz={key:1,class:`st-pop st-pop--unit`},mz=[`onMousedown`];function hz(e,t,n,r,i,a){let o=L(`SetNumber`);return B(),V(`div`,fz,[W(o,{value:i.numValue,options:a.numberOptions,disabled:e.disabled||a.isAuto,onInput:a.onNum,onChange:t[1]||=t=>e.$emit(`change`)},{symbol:Lr(()=>[U(`span`,{class:`st-unit`,onMousedown:t[0]||=q(e=>i.menuOpen=!i.menuOpen,[`prevent`])},M(a.unitLabel),33)]),_:1},8,[`value`,`options`,`disabled`,`onInput`]),K(` 单位切换浮层:移到 .st-number 之外,避免被 overflow:hidden 裁切 `),i.menuOpen?(B(),V(`div`,{key:0,class:`st-pop-mask`,onMousedown:t[2]||=q(e=>i.menuOpen=!1,[`prevent`])},null,32)):K(`v-if`,!0),i.menuOpen?(B(),V(`div`,pz,[(B(!0),V(z,null,R(a.unitList,e=>(B(),V(`div`,{key:e.key,class:j([`st-pop__item`,{"st-pop__item--on":e.key===i.unit}]),onMousedown:q(t=>a.pickUnit(e.key),[`prevent`])},M(e.value),43,mz))),128))])):K(`v-if`,!0)])}var gz=X(dz,[[`render`,hz],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetNumberStyle.vue`]]),_z={name:`SetPadding`,components:{SetNumber:XI},props:jg,emits:Mg,data(){return{form:{top:``,right:``,bottom:``,left:``}}},computed:{brackets(){return this.options.brackets||[`{`,`}`]},seperator(){return this.options.seperator||`,`}},watch:{value:{immediate:!0,handler(){this.parse()}}},methods:{parse(){let e=String(this.value||``);this.brackets.length&&(e=e.replace(RegExp(`[${this.brackets.join(``)}]`,`g`),``));let t=e.split(this.seperator);this.form=this.options.normal?{top:t[0]||``,right:t[1]||``,bottom:t[2]||``,left:t[3]||``}:{top:t[0]||``,left:t[1]||``,bottom:t[2]||``,right:t[3]||``}},opt(e){return{type:`integer`,symbol:e,placeholder:`0`}},set(e,t){this.form[e]=t,this.emitValue()},emitValue(){let e=this.form,t=(this.options.normal?[e.top,e.right,e.bottom,e.left]:[e.top,e.left,e.bottom,e.right]).map(e=>e===``||e===void 0?`0`:e).join(this.seperator),[n,r]=this.brackets.length?this.brackets:[``,``];this.$emit(`input`,`${n||``}${t}${r||``}`)},emitOut(){this.$emit(`change`)}}},vz={class:`st-pad`};function yz(e,t,n,r,i,a){let o=L(`SetNumber`);return B(),V(`div`,vz,[W(o,{value:i.form.top,options:a.opt(`上`),disabled:e.disabled,onInput:t[0]||=e=>a.set(`top`,e),onChange:a.emitOut},null,8,[`value`,`options`,`disabled`,`onChange`]),W(o,{value:i.form.right,options:a.opt(`右`),disabled:e.disabled,onInput:t[1]||=e=>a.set(`right`,e),onChange:a.emitOut},null,8,[`value`,`options`,`disabled`,`onChange`]),W(o,{value:i.form.bottom,options:a.opt(`下`),disabled:e.disabled,onInput:t[2]||=e=>a.set(`bottom`,e),onChange:a.emitOut},null,8,[`value`,`options`,`disabled`,`onChange`]),W(o,{value:i.form.left,options:a.opt(`左`),disabled:e.disabled,onInput:t[3]||=e=>a.set(`left`,e),onChange:a.emitOut},null,8,[`value`,`options`,`disabled`,`onChange`])])}var bz=X(_z,[[`render`,yz],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetPadding.vue`]]),xz=[{key:`TopLeft`,value:`上左`},{key:`TopCenter`,value:`上中`},{key:`TopRight`,value:`上右`},{key:`CenterLeft`,value:`中左`},{key:`Center`,value:`中间`},{key:`CenterRight`,value:`中右`},{key:`BottomLeft`,value:`下左`},{key:`BottomCenter`,value:`下中`},{key:`BottomRight`,value:`下右`}],Sz=[{key:`0% 0%`,value:`左上对齐`},{key:`50% 0%`,value:`中上对齐`},{key:`100% 0%`,value:`右上对齐`},{key:`0% 50%`,value:`左中对齐`},{key:`50% 50%`,value:`居中对齐`},{key:`100% 50%`,value:`右中对齐`},{key:`0% 100%`,value:`左下对齐`},{key:`50% 100%`,value:`中下对齐`},{key:`100% 100%`,value:`右下对齐`}],Cz={name:`SetGrid9`,props:{...jg,kind:{type:String,default:`PositionStyle`}},emits:Mg,computed:{cells(){return this.kind===`BackgroundPositionStyle`?Sz:xz}},methods:{pick(e){this.disabled||(this.$emit(`input`,e.key),this.$emit(`change`))}}},wz={class:`st-grid9`},Tz=[`title`,`onClick`];function Ez(e,t,n,r,i,a){return B(),V(`div`,wz,[(B(!0),V(z,null,R(a.cells,n=>(B(),V(`div`,{key:n.key,class:j([`st-grid9__cell`,{"st-grid9__cell--on":String(n.key)===String(e.value)}]),title:n.value,onClick:e=>a.pick(n)},[...t[0]||=[U(`span`,{class:`st-grid9__dot`},null,-1)]],10,Tz))),128))])}var Dz=X(Cz,[[`render`,Ez],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetGrid9.vue`]]),Oz=[{key:`number`,value:`px`},{key:`percent`,value:`%`}],kz={name:`SetBgPosition`,components:{SetGrid9:Dz,SetNumberStyle:gz},props:jg,emits:Mg,data(){return{x:``,y:``}},watch:{value:{immediate:!0,handler(){this.parse()}}},methods:{parse(){let e=String(this.value||``).split(/\s+/);this.x=e[0]||``,this.y=e[1]||``},numOptions(e){return{placeholder:e,iTypeList:Oz}},pickGrid(e){this.$emit(`input`,e)},setX(e){this.x=e,this.emitValue()},setY(e){this.y=e,this.emitValue()},emitValue(){this.$emit(`input`,`${this.x||`0`} ${this.y||`0`}`)},emitOut(){this.$emit(`change`)}}},Az={class:`st-bgpos`},jz={class:`st-bgpos__xy`};function Mz(e,t,n,r,i,a){let o=L(`SetGrid9`),s=L(`SetNumberStyle`);return B(),V(`div`,Az,[W(o,{kind:`BackgroundPositionStyle`,value:e.value,disabled:e.disabled,onInput:a.pickGrid,onChange:t[0]||=t=>e.$emit(`change`)},null,8,[`value`,`disabled`,`onInput`]),U(`div`,jz,[W(s,{value:i.x,options:a.numOptions(`X`),disabled:e.disabled,onInput:a.setX,onChange:a.emitOut},null,8,[`value`,`options`,`disabled`,`onInput`,`onChange`]),W(s,{value:i.y,options:a.numOptions(`Y`),disabled:e.disabled,onInput:a.setY,onChange:a.emitOut},null,8,[`value`,`options`,`disabled`,`onInput`,`onChange`])])])}var Nz=X(kz,[[`render`,Mz],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetBgPosition.vue`]]),Pz=[{key:`cover`,desc:`cover:保持纵横比,缩放到完全覆盖背景定位区域的最小尺寸`},{key:`contain`,desc:`contain:保持纵横比,缩放到能放进背景定位区域的最大尺寸`}],Fz={name:`SetBgSize`,components:{SetNumberStyle:gz,Dropdown:Sg},computed:{bgOptions(){return[{key:``,value:`自定义`}].concat(this.TYPES.map(e=>({key:e.key,value:e.key})))}},props:jg,emits:Mg,data(){return{TYPES:Pz,preset:``,x:``,y:``}},watch:{value:{immediate:!0,handler(){this.parse()}}},methods:{parse(){let e=String(this.value||``),t=Pz.map(e=>e.key);this.preset=t.includes(e)?e:``;let n=e.split(/\s+/);n.length>=2?(this.x=n[0]||``,this.y=n[1]||``):(this.x=``,this.y=``)},pickPreset(e){this.preset=e,e||(this.x=`auto`,this.y=`auto`),this.emitValue(),this.$emit(`change`)},setX(e){this.x=e,this.emitValue()},setY(e){this.y=e,this.emitValue()},emitValue(){let e=this.preset?this.preset:`${this.x||`auto`} ${this.y||`auto`}`;this.$emit(`input`,e)},emitOut(){this.$emit(`change`)}}},Iz={class:`st-bgsize`},Lz={key:0,class:`st-bgsize__xy`};function Rz(e,t,n,r,i,a){let o=L(`Dropdown`),s=L(`SetNumberStyle`);return B(),V(`div`,Iz,[W(o,{value:i.preset,options:a.bgOptions,size:`sm`,block:``,disabled:e.disabled,onInput:t[0]||=e=>a.pickPreset(e)},null,8,[`value`,`options`,`disabled`]),i.preset?K(`v-if`,!0):(B(),V(`div`,Lz,[W(s,{value:i.x,options:{placeholder:`宽`},disabled:e.disabled,onInput:a.setX,onChange:a.emitOut},null,8,[`value`,`disabled`,`onInput`,`onChange`]),W(s,{value:i.y,options:{placeholder:`高`},disabled:e.disabled,onInput:a.setY,onChange:a.emitOut},null,8,[`value`,`disabled`,`onInput`,`onChange`])]))])}var zz=X(Fz,[[`render`,Rz],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetBgSize.vue`]]),Bz=[{key:`to bottom`,desc:`从上到下`},{key:`to top`,desc:`从下到上`},{key:`to left`,desc:`从右到左`},{key:`to right`,desc:`从左到右`},{key:`to bottom right`,desc:`从左上到右下`},{key:`to bottom left`,desc:`从右上到左下`},{key:`to top left`,desc:`从右下到左上`},{key:`to top right`,desc:`从左下到右上`}];function Vz(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?n++:a===`)`?n--:a===`,`&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t.filter(e=>e!==``)}var Hz={name:`SetGradient`,components:{SetColor:VR,Dropdown:Sg},props:jg,emits:Mg,data(){return{DIRECTIONS:Bz,direction:`to bottom`,stops:[]}},computed:{preview(){if(!this.stops.length)return`transparent`;let e=this.stops.map(e=>e.color).filter(Boolean);return e.length<2?e[0]||`transparent`:`linear-gradient(${this.direction}, ${e.join(`, `)})`}},watch:{value:{immediate:!0,handler(){this.parse()}}},methods:{parse(){let e=String(this.value||``).trim().match(/linear-gradient\((.+)\)$/);if(!e){this.direction=this.options.defaultDirection||Bz[0].key,this.stops=[];return}let t=Vz(e[1]);this.direction=(t[0]||``).toLowerCase()||Bz[0].key,this.stops=t.slice(1).map(e=>({color:e}))},setDirection(e){this.direction=e,this.emitValue(),this.$emit(`change`)},setStop(e,t){this.stops[e].color=t,this.emitValue()},addStop(){this.disabled||(this.stops.push({color:`#ffffff`}),this.emitValue(),this.$emit(`change`))},removeStop(e){this.disabled||(this.stops.splice(e,1),this.emitValue(),this.$emit(`change`))},emitValue(){let e=this.stops.map(e=>e.color).filter(e=>e!==``&&e!==void 0);this.$emit(`input`,e.length?`linear-gradient(${this.direction}, ${e.join(`, `)})`:``)},emitOut(){this.$emit(`change`)}}},Uz={class:`st-gradient`},Wz=[`onClick`],Gz=[`disabled`];function Kz(e,t,n,r,i,a){let o=L(`Dropdown`),s=L(`SetColor`);return B(),V(`div`,Uz,[U(`div`,{class:`st-gradient__preview`,style:A({background:a.preview})},null,4),W(o,{value:i.direction,options:i.DIRECTIONS.map(e=>({key:e.key,value:e.desc})),size:`sm`,block:``,disabled:e.disabled,onInput:t[0]||=e=>a.setDirection(e)},null,8,[`value`,`options`,`disabled`]),(B(!0),V(z,null,R(i.stops,(t,n)=>(B(),V(`div`,{key:`stop`+n,class:`st-gradient__stop`},[W(s,{value:t.color,disabled:e.disabled,onInput:e=>a.setStop(n,e),onChange:a.emitOut},null,8,[`value`,`disabled`,`onInput`,`onChange`]),U(`button`,{class:`st-gradient__del`,type:`button`,title:`删除该渐变色`,onClick:e=>a.removeStop(n)},`✕`,8,Wz)]))),128)),U(`button`,{class:`st-minibtn`,type:`button`,disabled:e.disabled,onClick:t[1]||=(...e)=>a.addStop&&a.addStop(...e)},`+ 新增渐变色`,8,Gz)])}var qz=X(Hz,[[`render`,Kz],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetGradient.vue`]]),Jz=new Set([`width`,`height`,`lineHeight`,`marginRight`,`cursor`,`textAlign`]),Yz={name:`SetCustomSelect`,props:jg,emits:[...Mg,`sync`],computed:{list(){return this.options.list||[]}},methods:{normalizeStyle(e){if(!e||typeof e!=`object`)return{};let t={};for(let n in e)Jz.has(n)||(t[n]=e[n]);return t},apply(e){if(this.disabled)return;let t=e.sync||{};Object.keys(t).length&&this.$emit(`sync`,t)}}},Xz={class:`st-customsel`},Zz=[`title`,`onClick`],Qz={key:0},$z={key:0,class:`st-list__empty`};function eB(e,t,n,r,i,a){return B(),V(`div`,Xz,[(B(!0),V(z,null,R(a.list,(e,t)=>(B(),V(`div`,{key:t,class:`st-customsel__item`,style:A(a.normalizeStyle(e.style)),title:`应用:`+Object.keys(e.sync||{}).join(`、`),onClick:t=>a.apply(e)},[(B(!0),V(z,null,R(e.list||[],(e,t)=>(B(),V(`span`,{key:t,style:A(a.normalizeStyle(e.style))},M(e.innerText),5))),128)),(e.list||[]).length?K(`v-if`,!0):(B(),V(`span`,Qz,M(e.innerText||`样式`+(t+1)),1))],12,Zz))),128)),a.list.length?K(`v-if`,!0):(B(),V(`p`,$z,`未配置常用样式`))])}var tB=X(Yz,[[`render`,eB],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetCustomSelect.vue`]]),nB={name:`SetList`,props:jg,emits:Mg,computed:{list(){let e=this.itemInfo;return e&&e.itemList||[]},addText(){return this.options&&this.options.btnText||`添加项`}},methods:{displayName(e){let t=e.itemName||e.itemKey||``;return{fontStyle:`字体风格`,textDecoration:`文字装饰`}[e.itemKey]||t},add(){if(this.disabled)return;let e=this.itemInfo,t=this.list[0],n;n=t?new du(t.properties.map(e=>({itemId:e.itemId,itemKey:e.itemKey,itemName:e.itemName,itemType:e.itemType,itemOption:e.itemOption,itemParam:e.itemParam,itemDefaultValue:e.itemDefaultValue,itemDesc:e.itemDesc,itemTypeRange:e.itemTypeRange,itemValueFrom:`0`,itemValue:``})),{}):new du((this.options&&this.options.iFieldList||[]).map(e=>({itemId:e.key,itemKey:e.key,itemName:e.value||e.key,itemType:`Input`,itemValueFrom:`0`,itemValue:``})),{}),e.itemList.push(n),this.$emit(`change`)},remove(e){this.disabled||(this.itemInfo.removeAt(e),this.$emit(`change`))},move(e,t){this.disabled||(this.itemInfo.moveItem(e,e+t),this.$emit(`change`))}}},rB={class:`st-list`},iB={class:`st-list__head`},aB={class:`st-list__idx`},oB=[`disabled`,`onClick`],sB=[`disabled`,`onClick`],cB=[`disabled`,`onClick`],lB={class:`st-list__body`},uB=[`title`],dB={class:`st-list__control`},fB={key:0,class:`st-list__empty`},pB={key:0,class:`st-list__empty`},mB=[`disabled`];function hB(e,t,n,r,i,a){let o=L(`prop-control`);return B(),V(`div`,rB,[(B(!0),V(z,null,R(a.list,(n,r)=>(B(),V(`div`,{key:n.id,class:`st-list__item`},[U(`div`,iB,[U(`span`,aB,`#`+M(r+1),1),t[4]||=U(`span`,{class:`st-list__head-spacer`},null,-1),U(`button`,{class:`st-list__op`,type:`button`,title:`上移`,disabled:e.disabled||r===0,onClick:e=>a.move(r,-1)},`↑`,8,oB),U(`button`,{class:`st-list__op`,type:`button`,title:`下移`,disabled:e.disabled||r===a.list.length-1,onClick:e=>a.move(r,1)},`↓`,8,sB),U(`button`,{class:`st-list__op st-list__op--del`,type:`button`,title:`删除`,disabled:e.disabled,onClick:e=>a.remove(r)},[...t[3]||=[U(`svg`,{viewBox:`0 0 16 16`,class:`st-ic`,"aria-hidden":`true`},[U(`use`,{href:`#icon-delete`})],-1)]],8,cB)]),U(`div`,lB,[(B(!0),V(z,null,R(n.properties,n=>I((B(),V(`div`,{key:n.itemId,class:`st-list__row`},[U(`label`,{class:`st-list__label`,title:n.itemDesc||a.displayName(n)},M(a.displayName(n)),9,uB),U(`div`,dB,[W(o,{property:n,disabled:e.disabled,onChange:t[0]||=t=>e.$emit(`change`),onSync:t[1]||=t=>e.$emit(`sync`,t)},null,8,[`property`,`disabled`])])])),[[Sc,n.itemVisible]])),128)),n.properties.length?K(`v-if`,!0):(B(),V(`p`,fB,`该项无字段`))])]))),128)),a.list.length?K(`v-if`,!0):(B(),V(`p`,pB,`暂无项`)),U(`button`,{class:`st-minibtn st-list__add`,type:`button`,disabled:e.disabled,onClick:t[2]||=(...e)=>a.add&&a.add(...e)},M(a.addText),9,mB)])}var gB=X(nB,[[`render`,hB],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetList.vue`]]),_B={name:`SetImage`,props:jg,emits:Mg,methods:{clear(){this.disabled||(this.$emit(`input`,``),this.$emit(`change`))}}},vB={class:`st-image`},yB={class:`st-image__row`},bB=[`disabled`,`value`],xB=[`disabled`];function SB(e,t,n,r,i,a){return B(),V(`div`,vB,[U(`div`,yB,[U(`input`,{class:`ni-input`,type:`text`,disabled:e.disabled,value:e.value||``,placeholder:`图片路径,如 @filestore/...png 或 https://...`,onInput:t[0]||=t=>e.$emit(`input`,t.target.value),onChange:t[1]||=t=>e.$emit(`change`)},null,40,bB),e.value?(B(),V(`button`,{key:0,class:`st-image__clear`,type:`button`,title:`清空`,disabled:e.disabled,onClick:t[2]||=(...e)=>a.clear&&a.clear(...e)},[...t[3]||=[U(`svg`,{viewBox:`0 0 16 16`,class:`st-ic`,"aria-hidden":`true`},[U(`use`,{href:`#icon-reset`})],-1)]],8,xB)):K(`v-if`,!0)])])}var CB=X(_B,[[`render`,SB],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetImage.vue`]]),wB={name:`SetCode`,props:jg,emits:Mg,data(){return{code:``,bridge:null}},computed:{codeKey(){return this.options.codeKey||`code`},lines(){return this.code?this.code.split(`
|
|
310
|
-
`).length:0},chars(){return this.code.length}},mounted(){this.code=this.readCode(),this.$nextTick(()=>this.initJar())},beforeUnmount(){this._t&&clearTimeout(this._t),this.teardownBridge(!0),this._jar&&this._jar.destroy&&this._jar.destroy()},methods:{readCode(){let e=this.value;return e==null?``:typeof e==`string`?e:String(typeof e==`object`?e[this.codeKey]||``:e)},initJar(){let e=this.$refs.editor;if(!e)return;let t=e=>{e.innerHTML=Yg.default.highlight(e.textContent,Yg.default.languages.javascript,`javascript`)};this._jar=Jg(e,t,{tab:` `,indentOn:/[({[]$/,addClosing:!0,history:!0}),this._jar.updateCode(this.code),this._jar.onUpdate(e=>this.onCode(e))},onCode(e){if(this.disabled||this.bridge)return;this.code=e;let t=this.value&&typeof this.value==`object`?Object.assign({},this.value):{};t[this.codeKey]=e,this.$emit(`input`,t),this._t&&clearTimeout(this._t),this._t=setTimeout(()=>this.$emit(`change`),400)},toggleBridge(){this.bridge?this.teardownBridge(!0):this.setupBridge()},async setupBridge(){if(this.disabled||this.bridge)return;let e=this.itemInfo&&this.itemInfo.itemKey?String(this.itemInfo.itemKey):``;try{let t=await Gl(this.code,e);this.bridge={id:t.id,file:t.file}}catch(e){console.error(`[VSCode 桥接建立失败]`,e);return}this.setEditorEditable(!1),this._hb=setInterval(()=>{this.bridge&&ql(this.bridge.id).catch(()=>{})},5e3),this._bridgeUnsub=Hl(e=>{if(!(!this.bridge||!e||e.id!==this.bridge.id)){if(e.reason)return this.teardownBridge(!1);this.pullBridgeCode()}})},async pullBridgeCode(){if(!this.bridge)return;let e;try{e=await Kl(this.bridge.id)}catch{return}let t=String(e.code==null?``:e.code);t!==this.code&&this.applyExternalCode(t)},applyExternalCode(e){this.code=e,this._jar&&this._jar.updateCode(e,!1);let t=this.value&&typeof this.value==`object`?Object.assign({},this.value):{};t[this.codeKey]=e,this.$emit(`input`,t),this._t&&clearTimeout(this._t),this._t=setTimeout(()=>this.$emit(`change`),400)},teardownBridge(e){let t=this.bridge;this.bridge=null,this._hb&&=(clearInterval(this._hb),null),this._bridgeUnsub&&=(this._bridgeUnsub(),null),this.setEditorEditable(!0),t&&e&&Jl(t.id).catch(()=>{})},setEditorEditable(e){let t=this.$refs.editor;t&&t.setAttribute(`contenteditable`,e?`true`:`false`)}}},TB={class:`st-code`},EB={class:`st-code__foot`},DB={class:`st-code__hint`},OB={class:`st-code__foot-actions`},kB=[`title`],AB=[`title`,`disabled`],jB={key:0,class:`st-code__vscode-label`};function MB(e,t,n,r,i,a){return B(),V(`div`,TB,[U(`div`,{ref:`editor`,class:j([`st-code__editor`,{"is-disabled":e.disabled,"is-bridged":!!i.bridge}])},null,2),K(` 右上角语言标签:弱化的只读标识,不参与交互 `),t[2]||=U(`span`,{class:`st-code__lang`,"aria-hidden":`true`},`JS`,-1),U(`div`,EB,[U(`span`,DB,M(a.lines)+` 行 · `+M(a.chars)+` 字符`,1),K(` VSCode 代码桥:生成临时 js 用外部编辑器编辑,保存实时回写;断开即删临时文件 `),U(`span`,OB,[i.bridge?(B(),V(`span`,{key:0,class:`st-code__bridge-tag`,title:i.bridge.file},`VSCode 同步中`,8,kB)):K(`v-if`,!0),U(`button`,{type:`button`,class:j([`st-code__vscode`,{"is-on":!!i.bridge}]),title:i.bridge?`断开 VSCode 桥接并删除临时文件`:`在 VSCode 中编辑:保存实时同步回编辑区,断开后清除临时文件`,disabled:e.disabled,onClick:t[0]||=(...e)=>a.toggleBridge&&a.toggleBridge(...e)},[K(` 图标左侧小字:未桥接时是动作说明;桥接后由状态徽标接替,避免两段文字挤一行 `),i.bridge?K(`v-if`,!0):(B(),V(`span`,jB,`在编辑器中打开`)),t[1]||=U(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,"aria-hidden":`true`},[U(`path`,{fill:`currentColor`,d:`M23.15 2.587 18.21.21a1.494 1.494 0 0 0-1.705.29l-9.46 8.63-4.12-3.128a.999.999 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12 .326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a.999.999 0 0 0 1.276.057l4.12-3.128 9.46 8.63a1.492 1.492 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 20.06V3.939a1.5 1.5 0 0 0-.85-1.352zm-5.146 14.861L10.826 12l7.178-5.448v10.896z`})],-1)],10,AB)])])])}var NB=X(wB,[[`render`,MB],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetCode.vue`]]),PB={0:`常量`,1:`变量`,2:`图片`},FB={const:`0`,var:`1`,image:`2`};function IB(e){switch(e){case`InputNumber`:return{comp:XI};case`Color`:return{comp:VR};case`Select`:return{comp:$I};case`TabSelect`:return{comp:Kg,kind:`TabSelect`};case`Input`:return{comp:zI};case`Textarea`:return{comp:zI,multiline:!0};case`Switcher`:return{comp:rL};case`BooleanForm`:return{comp:rL,boolean:!0};case`PaddingStyle`:return{comp:bz};case`NumberStyle`:return{comp:gz};case`PositionStyle`:return{comp:Dz,kind:`PositionStyle`};case`BackgroundPositionStyle`:return{comp:Nz};case`BackgroundSizeStyle`:return{comp:zz};case`GradientStyle`:return{comp:qz};case`FontStyle`:return{comp:Kg,kind:`FontStyle`};case`TextDecorationStyle`:return{comp:Kg,kind:`TextDecorationStyle`};case`JustifyContentStyle`:return{comp:Kg,kind:`JustifyContentStyle`};case`AlignItemsStyle`:return{comp:Kg,kind:`AlignItemsStyle`};case`IconSelect`:return{comp:QR};case`CustomSelect`:return{comp:tB};case`List`:return{comp:gB};case`IfForm`:return{comp:lz};case`Code`:return{comp:NB};default:return{comp:zI}}}var LB={name:`PropControl`,components:{SetText:zI,SetNumber:XI,SetSelect:$I,SetSegment:Kg,SetSwitch:rL,SetColor:VR,SetIconSelect:QR,SetIfForm:lz,SetNumberStyle:gz,SetPadding:bz,SetGrid9:Dz,SetBgPosition:Nz,SetBgSize:zz,SetGradient:qz,SetCustomSelect:tB,SetList:gB,SetImage:CB,SetCode:NB,SetExpr:iz},props:{property:{type:Object,required:!0},watches:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},bExchange:{type:Boolean,default:!0}},emits:[`change`,`sync`],computed:{itemType(){return this.property&&this.property.itemType||``},sources(){let e=this.property&&this.property.itemTypeRange||`const`,t=String(e).split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>({key:FB[e],label:PB[FB[e]]})).filter(e=>e.key),n=String(this.property.itemValueFrom);return/^[012]$/.test(n)&&!t.some(e=>e.key===n)&&(t=t.concat([{key:n,label:PB[n]||`来源`+n}])),t},setterComp(){return IB(this.itemType)}},methods:{onInput(e){this.property.itemValue=e,this.$emit(`change`)},onChange(){this.$emit(`change`)},onSync(e){this.$emit(`sync`,e)},setSource(e){if(this.disabled)return;let t=this.property,n=String(e);t.itemValueFrom!==n&&(t._valuesByFrom||={0:void 0,1:void 0,2:void 0},t._valuesByFrom[t.itemValueFrom]=t.itemValue,t.itemValueFrom=n,t._valuesByFrom[n]===void 0?n===`0`?(t.itemValue=t.itemDefaultValue??this.defaultFor(),t._valuesByFrom[n]=t.itemValue):(t.itemValue=``,t._valuesByFrom[n]=``):t.itemValue=t._valuesByFrom[n],this.$emit(`change`))},defaultFor(){switch(this.itemType){case`Color`:return`#000000`;case`InputNumber`:return 0;case`Switcher`:return`0`;case`BooleanForm`:return!1;case`TabSelect`:case`Select`:{let e=this.property.itemOption||{},t=e.iParamList||e.iTypeList||[];return t.length?t[0].key:``}default:return``}}}},RB={key:0,class:`pc-srcs`},zB=[`disabled`,`onClick`],BB={class:`pc-body`};function VB(e,t,n,r,i,a){let o=L(`SetImage`),s=L(`SetExpr`);return B(),V(`div`,{class:j([`pc`,{"pc--readonly":n.disabled}])},[K(` 值来源切换(仅当 meta 声明了多于一种来源 且 允许切换时显示) `),a.sources.length>1&&n.bExchange?(B(),V(`div`,RB,[(B(!0),V(z,null,R(a.sources,e=>(B(),V(`button`,{key:e.key,type:`button`,class:j([`pc-src`,{"is-active":n.property.itemValueFrom===e.key}]),disabled:n.disabled,onClick:t=>a.setSource(e.key)},M(e.label),11,zB))),128))])):K(`v-if`,!0),U(`div`,BB,[K(` 图片素材来源 `),n.property.itemValueFrom===`2`?(B(),H(o,{key:0,value:n.property.itemValue,options:n.property.itemOption,"item-info":n.property,disabled:n.disabled,onInput:a.onInput,onChange:a.onChange},null,8,[`value`,`options`,`item-info`,`disabled`,`onInput`,`onChange`])):n.property.itemValueFrom===`1`?(B(),V(z,{key:1},[K(` 变量 / 表达式来源:带语法高亮、可拖拽调高度 `),W(s,{value:n.property.itemValue,disabled:n.disabled,"item-info":n.property,onInput:a.onInput,onChange:a.onChange},null,8,[`value`,`disabled`,`item-info`,`onInput`,`onChange`])],2112)):(B(),V(z,{key:2},[K(` 常量来源:按 itemType 分派 `),(B(),H(Yi(a.setterComp.comp),{value:n.property.itemValue,options:n.property.itemOption,watches:n.watches,"item-info":n.property,disabled:n.disabled,kind:a.setterComp.kind,multiline:a.setterComp.multiline,boolean:a.setterComp.boolean,onInput:a.onInput,onChange:a.onChange,onSync:a.onSync},null,40,[`value`,`options`,`watches`,`item-info`,`disabled`,`kind`,`multiline`,`boolean`,`onInput`,`onChange`,`onSync`]))],2112))])],2)}var HB=X(LB,[[`render`,VB],[`__scopeId`,`data-v-910daa70`],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/PropControl.vue`]]),UB={name:`PropTree`,props:{properties:{type:Array,default:()=>[]},mode:{type:String,default:`property`},depth:{type:Number,default:1},chain:{type:Array,default:()=>[]},watches:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},bExchange:{type:Boolean,default:!0},plain:{type:Boolean,default:!1}},emits:[`leaf-change`,`leaf-sync`],data(){return{openMap:{}}},methods:{isGroup(e){if(!e)return!1;if(e.itemType===`group`)return!0;let t=e.itemChildren&&e.itemChildren.properties;return!!(t&&t.length)},childCount(e){let t=e.itemChildren&&e.itemChildren.properties;return t?t.length:0},isBlock(e){return e&&e.itemType===`Code`},groupVisible(e){if(e.itemVisible===!1)return!1;let t=e.itemChildren&&e.itemChildren.properties;return!t||!t.length||t.some(e=>e.itemVisible===!1?!1:!this.isGroup(e)||this.groupVisible(e))},isOpen(e){return this.openMap[e.itemId]!==!1},toggle(e){this.openMap[e.itemId]=this.openMap[e.itemId]===!1,this.openMap=Object.assign({},this.openMap)},onLeaf(e){this.$emit(`leaf-change`,this.chain.concat(e))},onSync(e){this.$emit(`leaf-sync`,e)}}},WB={key:0,class:`ptree__group`},GB=[`onClick`],KB={class:`ptree__group-name`},qB={class:`ptree__group-body`},JB=[`title`],YB={class:`ptree__control`};function XB(e,t,n,r,i,a){let o=L(`prop-tree`,!0),s=L(`prop-control`);return B(),V(`div`,{class:j([`ptree`,{"ptree--plain":n.plain}])},[(B(!0),V(z,null,R(n.properties,r=>(B(),V(z,{key:r.itemId},[K(` 分组(自身可见 且 存在可见后代才渲染,避免空分组) `),a.isGroup(r)&&a.groupVisible(r)?(B(),V(`div`,WB,[U(`div`,{class:`ptree__group-head`,type:`button`,onClick:e=>a.toggle(r)},[U(`span`,{class:j([`ptree__caret`,{"is-open":a.isOpen(r)}])},`▸`,2),U(`span`,KB,M(r.itemName||r.itemKey),1)],8,GB),I(U(`div`,qB,[r.itemChildren&&r.itemChildren.properties.length?(B(),H(o,{key:0,properties:r.itemChildren.properties,mode:n.mode,depth:n.depth+1,chain:n.chain.concat(r),watches:n.watches,disabled:n.disabled,"b-exchange":n.bExchange,plain:n.plain,onLeafChange:t[0]||=t=>e.$emit(`leaf-change`,t),onLeafSync:t[1]||=t=>e.$emit(`leaf-sync`,t)},null,8,[`properties`,`mode`,`depth`,`chain`,`watches`,`disabled`,`b-exchange`,`plain`])):K(`v-if`,!0)],512),[[Sc,a.isOpen(r)]])])):r.itemVisible===!1?K(`v-if`,!0):(B(),V(z,{key:1},[K(` 叶子(itemCondition 判定为不可见时不渲染,与线上编辑器一致) `),U(`div`,{class:j([`ptree__row`,{"ptree__row--disabled":n.disabled,"ptree__row--block":a.isBlock(r)}])},[U(`label`,{class:`ptree__label`,title:r.itemDesc||r.itemName||r.itemKey},M(r.itemName||r.itemKey||r.itemType||`字段`),9,JB),U(`div`,YB,[W(s,{property:r,watches:n.watches,disabled:n.disabled,"b-exchange":n.bExchange,onChange:e=>a.onLeaf(r),onSync:a.onSync},null,8,[`property`,`watches`,`disabled`,`b-exchange`,`onChange`,`onSync`])])],2)],2112))],64))),128))],2)}var ZB=X(UB,[[`render`,XB],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/PropTree.vue`]]),QB=Sl(PI);QB.component(`prop-control`,HB),QB.component(`prop-tree`,ZB),QB.component(`Dropdown`,Sg),QB.config.errorHandler=(e,t,n)=>{console.error(`[render error]`,n,e),window.__cardDebug&&window.__cardDebug.pushError(`render`,`${n}: ${e.message}`)},QB.mount(`#app`);
|
|
309
|
+
先于面板挂载,故两个空容器写在前面,以 flex order 视觉置底。 `),F(H(`div`,tL,[t[75]||=H(`div`,{id:`app-workside-bar`,class:`workside__bar`},null,-1),t[76]||=H(`div`,{id:`app-workside-panels`,class:`workside__panels`},null,-1),H(`div`,nL,[G(` 拖拽分隔条:置于两栏容器内(定位上下文),只贯穿列区高度,不穿过底部弹出面板与状态栏 `),G(` 中右分隔条:调试面板 | 接口调用面板 接缝,拖动调整右栏宽度。
|
|
310
|
+
约束:中栏最小宽度 ≥ 屏宽 1/3,右栏最小宽度 ≥ 320px(见 startApiDrag) `),F(H(`div`,{class:A([`splitter splitter--api`,{"is-dragging":i.apiDragging,"is-armed":i.armedApi}]),onMouseenter:t[27]||=e=>a.armSplitter(`api`),onMouseleave:t[28]||=e=>a.disarmSplitter(`api`),onPointerdown:t[29]||=K((...e)=>a.startApiDrag&&a.startApiDrag(...e),[`prevent`]),title:`拖拽调整接口调用面板宽度`},null,34),[[Cc,!i.chromeOff&&i.apiPanelOpen]]),U(_,{"chrome-off":i.chromeOff,rt:i.rt,preview:i.preview,schema:i.currentSchema,"card-id":i.selectedId,"reload-token":i.reloadToken,"card-count":i.cardCount,"selected-node-id":i.selectedNodeId,"move-collapse-token":i.moveCollapseToken,"active-tab":i.activeTab,onSchemaChanged:a.onSchemaChanged,onSchemaCommit:a.onSchemaCommit,onSelectNode:a.onSelectNode,"onUpdate:activeTab":t[30]||=e=>i.activeTab=e,onAddNode:a.onAddNode,onMoveNode:a.onMoveNode,onHoverNode:a.onHoverNode,onCopySelected:a.copySelectedNode,onPaste:a.pasteNode,onDuplicate:a.duplicateNode,onDeleteSelected:a.deleteSelectedNode,onRenameCard:a.openRenameCard,onResetImport:a.onRefresh,"dev-svc-class":a.devSvcClass,"dev-svc-title":a.devSvcTitle,"dev-svc-label":a.devSvcLabel,"dev-svc-conn":a.devSvcConn},null,8,`chrome-off.rt.preview.schema.card-id.reload-token.card-count.selected-node-id.move-collapse-token.active-tab.onSchemaChanged.onSchemaCommit.onSelectNode.onAddNode.onMoveNode.onHoverNode.onCopySelected.onPaste.onDuplicate.onDeleteSelected.onRenameCard.onResetImport.dev-svc-class.dev-svc-title.dev-svc-label.dev-svc-conn`.split(`.`)),G(` 右侧常驻「接口调用」面板:与预览列 / 调试面板呈左中右布局,
|
|
311
|
+
展开/收起由顶栏按钮与面板内 ✕ 控制,初始状态持久化 `),i.apiPanelOpen?(z(),V(v,{key:0,rt:i.rt,onClose:t[31]||=e=>i.apiPanelOpen=!1},null,8,[`rt`])):G(`v-if`,!0)],512)],512),[[Cc,!i.chromeOff]])],512),G(` 远端预览二维码弹层:点击顶栏「远端预览」按钮打开,手机(FinMall App)扫码真机查看 `),U(y,{visible:i.remotePreviewOpen,"page-id":i.currentSchema?i.currentSchema.pageId:``,schema:i.currentSchema,onClose:t[32]||=e=>i.remotePreviewOpen=!1},null,8,[`visible`,`page-id`,`schema`]),G(` 登录凭据弹窗:远程同步检测到缺凭据时弹出,填写账号密码(MD5 后)写入 .local/credentials.json `),U(ac,{name:`modal`},{default:Rr(()=>[i.loginModal?(z(),B(`div`,{key:0,class:`login-mask`,onClick:t[39]||=K((...e)=>a.closeLoginModal&&a.closeLoginModal(...e),[`self`])},[H(`div`,rL,[t[79]||=H(`div`,{class:`login-modal__title`},`FinMall 登录凭据`,-1),t[80]||=H(`div`,{class:`login-modal__desc`},` 本地登录凭据缺失,请填写账号与密码。密码仅做 MD5 后保存,不落明文。 `,-1),H(`label`,iL,[t[77]||=H(`span`,{class:`login-modal__label`},`账号`,-1),F(H(`input`,{class:`login-modal__input`,type:`text`,"onUpdate:modelValue":t[33]||=e=>i.loginName=e,placeholder:`FinMall 登录账号`,disabled:i.loginSubmitting,onKeyup:t[34]||=yl((...e)=>a.submitLogin&&a.submitLogin(...e),[`enter`])},null,40,aL),[[al,i.loginName]])]),H(`label`,oL,[t[78]||=H(`span`,{class:`login-modal__label`},`密码`,-1),F(H(`input`,{class:`login-modal__input`,type:`password`,"onUpdate:modelValue":t[35]||=e=>i.loginPassword=e,placeholder:`FinMall 登录密码`,disabled:i.loginSubmitting,onKeyup:t[36]||=yl((...e)=>a.submitLogin&&a.submitLogin(...e),[`enter`])},null,40,sL),[[al,i.loginPassword]])]),i.loginError?(z(),B(`div`,cL,j(i.loginError),1)):G(`v-if`,!0),H(`div`,lL,[H(`button`,{class:`login-modal__btn login-modal__btn--ghost`,type:`button`,disabled:i.loginSubmitting,onClick:t[37]||=(...e)=>a.closeLoginModal&&a.closeLoginModal(...e)},` 取消 `,8,uL),H(`button`,{class:`login-modal__btn login-modal__btn--primary`,type:`button`,disabled:i.loginSubmitting,onClick:t[38]||=(...e)=>a.submitLogin&&a.submitLogin(...e)},j(i.loginSubmitting?`保存中…`:`保存并同步`),9,dL)])])])):G(`v-if`,!0)]),_:1}),G(` 组件选择面板:点击结构树每行的「+」后弹出,选择类型即插入对应节点 `),U(ac,{name:`modal`},{default:Rr(()=>[i.addNodePanelOpen?(z(),V(b,{key:0,onPick:a.onPickComponent,onClose:a.cancelAddNode},null,8,[`onPick`,`onClose`])):G(`v-if`,!0)]),_:1}),G(` 二次确认弹窗:版本推送 / 当前同步 / 全量同步 等写/覆盖类操作前弹出,确认后才执行 `),U(x,{visible:i.confirm.show,title:i.confirm.title,message:i.confirm.message,"confirm-text":i.confirm.confirmText,"cancel-text":i.confirm.cancelText,severity:i.confirm.severity,onConfirm:a.onConfirmDialog,onCancel:a.onCancelDialog},null,8,[`visible`,`title`,`message`,`confirm-text`,`cancel-text`,`severity`,`onConfirm`,`onCancel`]),G(` 卡片网格预览弹窗:点击顶栏「网格预览」图标按钮打开,选择卡片即载入工作台 `),U(S,{visible:i.galleryOpen,cards:i.cardList,"selected-id":i.selectedId,onSelect:a.onSelect,onClose:a.closeGallery,onDelete:a.onGalleryDelete},null,8,[`visible`,`cards`,`selected-id`,`onSelect`,`onClose`,`onDelete`]),G(` 卡片表单弹窗(新增空白卡片 / 卡片重命名 共用一个弹窗):成功后关弹窗 + 刷列表 + 加载目标卡;existing-ids 供 ID 重名前置判定 `),U(C,{visible:i.cardDialog.visible,mode:i.cardDialog.mode,"card-id":i.cardDialog.cardId,"card-desc":i.cardDialog.cardDesc,"existing-ids":a.cardIds,onClose:t[40]||=e=>i.cardDialog.visible=!1,onCreated:a.onNewCardCreated,onRenamed:a.onCardRenamed},null,8,[`visible`,`mode`,`card-id`,`card-desc`,`existing-ids`,`onCreated`,`onRenamed`]),G(` App 级弱提示:顶栏异步操作(远端保存 / 同步)完成反馈,浮于 App 外壳顶部居中 `),U(w),G(` 对话图片大图查看器:AI 面板里点预览图后全屏缩放查看,Teleport 到 body `),U(ee)],6)}var pL=Y($F,[[`render`,fL],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/App.vue`]]),mL={name:`SetText`,props:{...s_,multiline:{type:Boolean,default:!1}},emits:c_,computed:{text(){return this.value===void 0||this.value===null?``:String(this.value)},rows(){let e=this.options.autosize;return e&&typeof e==`object`&&e.minRows?e.minRows:4}},methods:{onInput(e){this.$emit(`input`,e)}}},hL=[`rows`,`placeholder`,`disabled`,`value`],gL=[`placeholder`,`disabled`,`value`];function _L(e,t,n,r,i,a){return n.multiline?(z(),B(`textarea`,{key:0,class:`st-textarea`,rows:a.rows,placeholder:e.options.placeholder||``,disabled:e.disabled,value:a.text,onInput:t[0]||=e=>a.onInput(e.target.value),onChange:t[1]||=t=>e.$emit(`change`)},null,40,hL)):(z(),B(`input`,{key:1,class:`ni-input`,type:`text`,placeholder:e.options.placeholder||``,disabled:e.disabled,value:a.text,onInput:t[2]||=e=>a.onInput(e.target.value),onChange:t[3]||=t=>e.$emit(`change`)},null,40,gL))}var vL=Y(mL,[[`render`,_L],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetText.vue`]]),yL={integer:/^-?(0|[1-9][0-9]*)?$/,"+integer":/^(0|[1-9][0-9]*)?$/,"-integer":/^(0|-[1-9]?[0-9]*)?$/,float:/^-?([0-9]*|(0|[1-9][0-9]*)\.[0-9]*)?$/,"+float":/^([0-9]*|(0|[1-9][0-9]*)\.[0-9]*)?$/,"-float":/^(0|-[0-9]*|-(0|[1-9][0-9]*)\.[0-9]*)?$/},bL={name:`SetNumber`,props:s_,emits:c_,data(){return{inputValue:``,sugOpen:!1}},computed:{suggestions(){return this.options.iParamList||[]},pattern(){return yL[this.options.type]||yL.integer}},watch:{value:{immediate:!0,handler(e){this.inputValue=e==null?``:String(e)}}},methods:{onInput(e){if(!this.pattern.test(e)){this.$refs.field.value=this.inputValue;return}this.inputValue=e,this.$emit(`input`,e)},step(e){let t=parseFloat(this.inputValue),n=String((Number.isNaN(t)?0:t)+e);this.pattern.test(n)&&(this.inputValue=n,this.$emit(`input`,n),this.emitChange())},pick(e){this.sugOpen=!1,this.inputValue=String(e.key),this.$emit(`input`,this.inputValue),this.emitChange()},closeSug(){setTimeout(()=>this.sugOpen=!1,0)},emitChange(){this.$emit(`change`)}}},xL={class:`st-number-wrap`},SL={class:`st-number`},CL=[`placeholder`,`disabled`,`value`],wL={key:0,class:`st-number__symbol st-number__symbol--btn`},TL={key:1,class:`st-number__symbol`},EL={key:0,class:`st-pop st-pop--sug`},DL=[`onMousedown`];function OL(e,t,n,r,i,a){return z(),B(`div`,xL,[H(`div`,SL,[H(`input`,{ref:`field`,class:`st-number__field`,type:`text`,placeholder:e.options.placeholder||`请输入`,disabled:e.disabled,value:i.inputValue,onInput:t[0]||=e=>a.onInput(e.target.value),onChange:t[1]||=e=>a.emitChange(),onKeydown:[t[2]||=yl(K(e=>a.step(1),[`prevent`]),[`up`]),t[3]||=yl(K(e=>a.step(-1),[`prevent`]),[`down`])],onBlur:t[4]||=e=>a.closeSug()},null,40,CL),e.$slots.symbol?(z(),B(`span`,wL,[$i(e.$slots,`symbol`)])):e.options.symbol&&e.options.symbol!==!0?(z(),B(`span`,TL,j(e.options.symbol),1)):G(`v-if`,!0),a.suggestions.length?(z(),B(`span`,{key:2,class:`st-number__caret`,title:`预设值`,onMousedown:t[5]||=K(e=>i.sugOpen=!i.sugOpen,[`prevent`])},`▾`,32)):G(`v-if`,!0)]),G(` 预设值浮层:移出 .st-number,避免被 overflow:hidden 裁切 `),i.sugOpen&&a.suggestions.length?(z(),B(`div`,EL,[(z(!0),B(R,null,L(a.suggestions,e=>(z(),B(`div`,{key:e.key,class:A([`st-pop__item`,{"st-pop__item--on":String(e.key)===String(i.inputValue)}]),onMousedown:K(t=>a.pick(e),[`prevent`])},j(e.value),43,DL))),128))])):G(`v-if`,!0)])}var kL=Y(bL,[[`render`,OL],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetNumber.vue`]]),AL={name:`SetSelect`,props:s_,emits:c_,computed:{list(){return this.options.iParamList||this.options.iTypeList||[]},placeholder(){return this.options.placeholder||`请选择`},optionList(){return this.list.map(e=>({key:String(e.key),value:e.value}))},current(){return this.value===void 0||this.value===null?``:String(this.value)}},methods:{onChange(e){this.$emit(`input`,e),this.$emit(`change`)}}};function jL(e,t,n,r,i,a){let o=I(`Dropdown`);return z(),V(o,{value:a.current,options:a.optionList,placeholder:a.placeholder,clearable:``,size:`sm`,block:``,disabled:e.disabled,onInput:a.onChange},null,8,[`value`,`options`,`placeholder`,`disabled`,`onInput`])}var ML=Y(AL,[[`render`,jL],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetSelect.vue`]]),NL={name:`SetSwitch`,props:{...s_,boolean:{type:Boolean,default:!1}},emits:c_,computed:{activeValue(){return this.options.activeValue===void 0?this.boolean?!0:`1`:this.options.activeValue},inactiveValue(){return this.options.inactiveValue===void 0?!this.boolean&&`0`:this.options.inactiveValue},on(){return this.value===this.activeValue},activeText(){return this.options.activeText||`开`},inactiveText(){return this.options.inactiveText||`关`}},methods:{toggle(){this.disabled||(this.$emit(`input`,this.on?this.inactiveValue:this.activeValue),this.$emit(`change`))}}},PL={class:`st-switch__text`};function FL(e,t,n,r,i,a){return z(),B(`div`,{class:A([`st-switch`,{"st-switch--on":a.on}]),onClick:t[0]||=(...e)=>a.toggle&&a.toggle(...e)},[t[1]||=H(`span`,{class:`st-switch__track`},[H(`span`,{class:`st-switch__knob`})],-1),H(`span`,PL,j(a.on?a.activeText:a.inactiveText),1)],2)}var IL=Y(NL,[[`render`,FL],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetSwitch.vue`]]);function LL(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>`u`)){var r=document.head||document.getElementsByTagName(`head`)[0],i=document.createElement(`style`);i.type=`text/css`,n===`top`&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var RL=function(e,t){let{componentPrefix:n=``}=t||{};e.component(`${n}${this.name}`,this)},zL={},BL={name:`Checkboard`,props:{size:{type:[Number,String],default:8},white:{type:String,default:`#fff`},grey:{type:String,default:`#e6e6e6`}},computed:{bgStyle(){return{"background-image":`url(${HL(this.white,this.grey,this.size)})`}}}};function VL(e,t,n){if(typeof document>`u`)return null;let r=document.createElement(`canvas`);r.width=r.height=n*2;let i=r.getContext(`2d`);return i?(i.fillStyle=e,i.fillRect(0,0,r.width,r.height),i.fillStyle=t,i.fillRect(0,0,n,n),i.translate(n,n),i.fillRect(0,0,n,n),r.toDataURL()):null}function HL(e,t,n){let r=`${e},${t},${n}`;if(zL[r])return zL[r];let i=VL(e,t,n);return zL[r]=i,i}function UL(e,t,n,r,i,a){return z(),B(`div`,{class:`vc-checkerboard`,style:k(a.bgStyle)},null,4)}LL(`.vc-checkerboard{background-size:contain;bottom:0;left:0;position:absolute;right:0;top:0}`),BL.render=UL,BL.__file=`src/components/checkboard/checkboard.vue`,BL.install=RL;var WL={name:`Alpha`,components:{Checkboard:BL},props:{value:Object,onChange:Function},computed:{colors(){return this.value},gradientColor(){let{rgba:e}=this.colors,t=[e.r,e.g,e.b].join(`,`);return`linear-gradient(to right, rgba(${t}, 0) 0%, rgba(${t}, 1) 100%)`}},methods:{handleChange(e,t){!t&&e.preventDefault();let{container:n}=this.$refs;if(!n)return;let r=n.clientWidth,i=n.getBoundingClientRect().left+window.pageXOffset,a=(e.pageX||(e.touches?e.touches[0].pageX:0))-i,o;o=a<0?0:a>r?1:Math.round(a*100/r)/100,this.colors.a!==o&&this.$emit(`change`,{h:this.colors.hsl.h,s:this.colors.hsl.s,l:this.colors.hsl.l,a:o,source:`rgba`})},handleMouseDown(e){this.handleChange(e,!0),window.addEventListener(`mousemove`,this.handleChange),window.addEventListener(`mouseup`,this.handleMouseUp)},handleMouseUp(){this.unbindEventListeners()},unbindEventListeners(){window.removeEventListener(`mousemove`,this.handleChange),window.removeEventListener(`mouseup`,this.handleMouseUp)}}},GL={class:`vc-alpha`},KL={class:`vc-alpha-checkboard-wrap`},qL=[H(`div`,{class:`vc-alpha-picker`},null,-1)];function JL(e,t,n,r,i,a){let o=I(`Checkboard`);return z(),B(`div`,GL,[H(`div`,KL,[U(o)]),H(`div`,{class:`vc-alpha-gradient`,style:k({background:a.gradientColor})},null,4),H(`div`,{ref:`container`,class:`vc-alpha-container`,onMousedown:t[0]||=(...e)=>a.handleMouseDown&&a.handleMouseDown(...e),onTouchmove:t[1]||=(...e)=>a.handleChange&&a.handleChange(...e),onTouchstart:t[2]||=(...e)=>a.handleChange&&a.handleChange(...e)},[H(`div`,{class:`vc-alpha-pointer`,style:k({left:`${a.colors.a*100}%`})},qL,4)],544)])}LL(`.vc-alpha,.vc-alpha-checkboard-wrap{bottom:0;left:0;position:absolute;right:0;top:0}.vc-alpha-checkboard-wrap{overflow:hidden}.vc-alpha-gradient{bottom:0;left:0;position:absolute;right:0;top:0}.vc-alpha-container{cursor:pointer;height:100%;margin:0 3px;position:relative;z-index:2}.vc-alpha-pointer{position:absolute;z-index:2}.vc-alpha-picker{background:#fff;border-radius:1px;box-shadow:0 0 2px rgba(0,0,0,.6);cursor:pointer;height:8px;margin-top:1px;transform:translateX(-2px);width:4px}`),WL.render=JL,WL.__file=`src/components/alpha/alpha.vue`,WL.install=RL;function YL(e,t){ZL(e)&&(e=`100%`);var n=QL(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(e=t===360?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t)),e)}function XL(e){return Math.min(1,Math.max(0,e))}function ZL(e){return typeof e==`string`&&e.indexOf(`.`)!==-1&&parseFloat(e)===1}function QL(e){return typeof e==`string`&&e.indexOf(`%`)!==-1}function $L(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function eR(e){return e<=1?`${Number(e)*100}%`:e}function tR(e){return e.length===1?`0`+e:String(e)}function nR(e,t,n){return{r:YL(e,255)*255,g:YL(t,255)*255,b:YL(n,255)*255}}function rR(e,t,n){e=YL(e,255),t=YL(t,255),n=YL(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a=0,o=0,s=(r+i)/2;if(r===i)o=0,a=0;else{var c=r-i;switch(o=s>.5?c/(2-r-i):c/(r+i),r){case e:a=(t-n)/c+(t<n?6:0);break;case t:a=(n-e)/c+2;break;case n:a=(e-t)/c+4}a/=6}return{h:a,s:o,l:s}}function iR(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function aR(e,t,n){var r,i,a;if(e=YL(e,360),t=YL(t,100),n=YL(n,100),t===0)i=n,a=n,r=n;else{var o=n<.5?n*(1+t):n+t-n*t,s=2*n-o;r=iR(s,o,e+1/3),i=iR(s,o,e),a=iR(s,o,e-1/3)}return{r:r*255,g:i*255,b:a*255}}function oR(e,t,n){e=YL(e,255),t=YL(t,255),n=YL(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a=0,o=r,s=r-i,c=r===0?0:s/r;if(r===i)a=0;else{switch(r){case e:a=(t-n)/s+(t<n?6:0);break;case t:a=(n-e)/s+2;break;case n:a=(e-t)/s+4}a/=6}return{h:a,s:c,v:o}}function sR(e,t,n){e=YL(e,360)*6,t=YL(t,100),n=YL(n,100);var r=Math.floor(e),i=e-r,a=n*(1-t),o=n*(1-i*t),s=n*(1-(1-i)*t),c=r%6,l=[n,o,a,a,s,n][c],u=[s,n,n,o,a,a][c],d=[a,a,s,n,n,o][c];return{r:l*255,g:u*255,b:d*255}}function cR(e,t,n,r){var i=[tR(Math.round(e).toString(16)),tR(Math.round(t).toString(16)),tR(Math.round(n).toString(16))];return r&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join(``)}function lR(e,t,n,r,i){var a=[tR(Math.round(e).toString(16)),tR(Math.round(t).toString(16)),tR(Math.round(n).toString(16)),tR(uR(r))];return i&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))&&a[3].startsWith(a[3].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join(``)}function uR(e){return Math.round(parseFloat(e)*255).toString(16)}function dR(e){return fR(e)/255}function fR(e){return parseInt(e,16)}function pR(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var mR={aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,goldenrod:`#daa520`,gold:`#ffd700`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,lavenderblush:`#fff0f5`,lavender:`#e6e6fa`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,steelblue:`#4682b4`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,tomato:`#ff6347`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`};function hR(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,a=null,o=!1,s=!1;return typeof e==`string`&&(e=bR(e)),typeof e==`object`&&(xR(e.r)&&xR(e.g)&&xR(e.b)?(t=nR(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)===`%`?`prgb`:`rgb`):xR(e.h)&&xR(e.s)&&xR(e.v)?(r=eR(e.s),i=eR(e.v),t=sR(e.h,r,i),o=!0,s=`hsv`):xR(e.h)&&xR(e.s)&&xR(e.l)&&(r=eR(e.s),a=eR(e.l),t=aR(e.h,r,a),o=!0,s=`hsl`),Object.prototype.hasOwnProperty.call(e,`a`)&&(n=e.a)),n=$L(n),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var gR=`(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)`,_R=`[\\s|\\(]+(${gR})[,|\\s]+(${gR})[,|\\s]+(${gR})\\s*\\)?`,vR=`[\\s|\\(]+(${gR})[,|\\s]+(${gR})[,|\\s]+(${gR})[,|\\s]+(${gR})\\s*\\)?`,yR={CSS_UNIT:new RegExp(gR),rgb:RegExp(`rgb`+_R),rgba:RegExp(`rgba`+vR),hsl:RegExp(`hsl`+_R),hsla:RegExp(`hsla`+vR),hsv:RegExp(`hsv`+_R),hsva:RegExp(`hsva`+vR),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function bR(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(mR[e])e=mR[e],t=!0;else if(e===`transparent`)return{r:0,g:0,b:0,a:0,format:`name`};var n=yR.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=yR.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=yR.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=yR.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=yR.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=yR.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=yR.hex8.exec(e),n?{r:fR(n[1]),g:fR(n[2]),b:fR(n[3]),a:dR(n[4]),format:t?`name`:`hex8`}:(n=yR.hex6.exec(e),n?{r:fR(n[1]),g:fR(n[2]),b:fR(n[3]),format:t?`name`:`hex`}:(n=yR.hex4.exec(e),n?{r:fR(n[1]+n[1]),g:fR(n[2]+n[2]),b:fR(n[3]+n[3]),a:dR(n[4]+n[4]),format:t?`name`:`hex8`}:(n=yR.hex3.exec(e),n?{r:fR(n[1]+n[1]),g:fR(n[2]+n[2]),b:fR(n[3]+n[3]),format:t?`name`:`hex`}:!1)))))))))}function xR(e){return!!yR.CSS_UNIT.exec(String(e))}var SR=function(){function e(t,n){if(t===void 0&&(t=``),n===void 0&&(n={}),t instanceof e)return t;typeof t==`number`&&(t=pR(t)),this.originalInput=t;var r=hR(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),t,n,r,i=e.r/255,a=e.g/255,o=e.b/255;return t=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,n=a<=.03928?a/12.92:((a+.055)/1.055)**2.4,r=o<=.03928?o/12.92:((o+.055)/1.055)**2.4,.2126*t+.7152*n+.0722*r},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=$L(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){return this.toHsl().s===0},e.prototype.toHsv=function(){var e=oR(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=oR(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?`hsv(${t}, ${n}%, ${r}%)`:`hsva(${t}, ${n}%, ${r}%, ${this.roundA})`},e.prototype.toHsl=function(){var e=rR(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=rR(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?`hsl(${t}, ${n}%, ${r}%)`:`hsla(${t}, ${n}%, ${r}%, ${this.roundA})`},e.prototype.toHex=function(e){return e===void 0&&(e=!1),cR(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return e===void 0&&(e=!1),`#`+this.toHex(e)},e.prototype.toHex8=function(e){return e===void 0&&(e=!1),lR(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return e===void 0&&(e=!1),`#`+this.toHex8(e)},e.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?`rgb(${e}, ${t}, ${n})`:`rgba(${e}, ${t}, ${n}, ${this.roundA})`},e.prototype.toPercentageRgb=function(){var e=function(e){return`${Math.round(YL(e,255)*100)}%`};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(YL(e,255)*100)};return this.a===1?`rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)`:`rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`},e.prototype.toName=function(){if(this.a===0)return`transparent`;if(this.a<1)return!1;for(var e=`#`+cR(this.r,this.g,this.b,!1),t=0,n=Object.entries(mR);t<n.length;t++){var r=n[t],i=r[0];if(e===r[1])return i}return!1},e.prototype.toString=function(e){var t=!!e;e??=this.format;var n=!1,r=this.a<1&&this.a>=0;return!t&&r&&(e.startsWith(`hex`)||e===`name`)?e===`name`&&this.a===0?this.toName():this.toRgbString():(e===`rgb`&&(n=this.toRgbString()),e===`prgb`&&(n=this.toPercentageRgbString()),(e===`hex`||e===`hex6`)&&(n=this.toHexString()),e===`hex3`&&(n=this.toHexString(!0)),e===`hex4`&&(n=this.toHex8String(!0)),e===`hex8`&&(n=this.toHex8String()),e===`name`&&(n=this.toName()),e===`hsl`&&(n=this.toHslString()),e===`hsv`&&(n=this.toHsvString()),n||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=XL(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=XL(n.l),new e(n)},e.prototype.tint=function(e){return e===void 0&&(e=10),this.mix(`white`,e)},e.prototype.shade=function(e){return e===void 0&&(e=10),this.mix(`black`,e)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=XL(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=XL(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),a=n/100;return new e({r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a})},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,a=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,a.push(new e(r));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/t;t--;)o.push(new e({h:r,s:i,v:a})),a=(a+s)%1;return o},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb(),i=n.a+r.a*(1-n.a);return new e({r:(n.r*n.a+r.r*r.a*(1-n.a))/i,g:(n.g*n.a+r.g*r.a*(1-n.a))/i,b:(n.b*n.a+r.b*r.a*(1-n.a))/i,a:i})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],a=360/t,o=1;o<t;o++)i.push(new e({h:(r+o*a)%360,s:n.s,l:n.l}));return i},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();function CR(...e){return new SR(...e)}function wR(e,t){let n=e&&e.a,r;r=e&&e.hsl?CR(e.hsl):e&&e.hex&&e.hex.length>0?CR(e.hex):e&&e.hsv?CR(e.hsv):e&&e.rgba?CR(e.rgba):e&&e.rgb?CR(e.rgb):CR(e),r&&(r._a===void 0||r._a===null)&&r.setAlpha(n||r.getAlpha());let i=r.toHsl(),a=r.toHsv();return i.s===0&&(a.h=i.h=e.h||e.hsl&&e.hsl.h||t||0),a.v<.0164&&(a.h=e.h||e.hsv&&e.hsv.h||0,a.s=e.s||e.hsv&&e.hsv.s||0),i.l<.01&&(i.h=e.h||e.hsl&&e.hsl.h||0,i.s=e.s||e.hsl&&e.hsl.s||0),{hsl:i,hex:r.toHexString().toUpperCase(),hex8:r.toHex8String().toUpperCase(),rgba:r.toRgb(),hsv:a,oldHue:e.h||t||i.h,source:e.source,a:r.getAlpha()}}var TR={model:{prop:`modelValue`,event:`update:modelValue`},props:[`modelValue`],data(){return{val:wR(this.modelValue)}},computed:{colors:{get(){return this.val},set(e){this.val=e,this.$emit(`update:modelValue`,e)}}},watch:{modelValue(e){this.val=wR(e)}},methods:{colorChange(e,t){this.oldHue=this.colors.hsl.h,this.colors=wR(e,t||this.oldHue)},isValidHex(e){return CR(e).isValid},simpleCheckForValidColor(e){let t=[`r`,`g`,`b`,`a`,`h`,`s`,`l`,`v`],n=0,r=0;for(let i=0;i<t.length;i++){let a=t[i];e[a]&&(n++,isNaN(e[a])||r++)}if(n===r)return e},paletteUpperCase(e){return e.map(e=>e.toUpperCase())},isTransparent(e){return CR(e).getAlpha()===0}}},ER={name:`EditableInput`,props:{label:String,labelText:String,desc:String,value:[String,Number],max:Number,min:Number,arrowOffset:{type:Number,default:1}},computed:{val:{get(){return this.value},set(e){if(this.max!==void 0&&+e>this.max)this.$refs.input.value=this.max;else return e}},labelId(){return`input__label__${this.label}__${Math.random().toString().slice(2,5)}`},labelSpanText(){return this.labelText||this.label}},methods:{update(e){this.handleChange(e.target.value)},handleChange(e){let t={};t[this.label]=e,(t.hex===void 0&&t[`#`]===void 0||e.length>5)&&this.$emit(`change`,t)},handleKeyDown(e){let{val:t}=this,n=Number(t);if(n){let r=this.arrowOffset||1;e.keyCode===38&&(t=n+r,this.handleChange(t),e.preventDefault()),e.keyCode===40&&(t=n-r,this.handleChange(t),e.preventDefault())}}}},DR={class:`vc-editable-input`},OR=[`aria-labelledby`],kR=[`id`,`for`],AR={class:`vc-input__desc`};function jR(e,t,n,r,i,a){return z(),B(`div`,DR,[F(H(`input`,{ref:`input`,"onUpdate:modelValue":t[0]||=e=>a.val=e,"aria-labelledby":a.labelId,class:`vc-input__input`,onKeydown:t[1]||=(...e)=>a.handleKeyDown&&a.handleKeyDown(...e),onInput:t[2]||=(...e)=>a.update&&a.update(...e)},null,40,OR),[[al,a.val]]),H(`span`,{id:a.labelId,for:n.label,class:`vc-input__label`},j(a.labelSpanText),9,kR),H(`span`,AR,j(n.desc),1)])}LL(`.vc-editable-input{position:relative}.vc-input__input{border:0;outline:none;padding:0}.vc-input__label{text-transform:capitalize}`),ER.render=jR,ER.__file=`src/components/editable-input/editable-input.vue`,ER.install=RL;function MR(e,t,n){return t<n?e<t?t:e>n?n:e:e<n?n:e>t?t:e}var NR={name:`Saturation`,props:{value:Object},computed:{colors(){return this.value},bgColor(){return`hsl(${this.colors.hsv.h}, 100%, 50%)`},pointerTop(){return`${-(this.colors.hsv.v*100)+1+100}%`},pointerLeft(){return`${this.colors.hsv.s*100}%`}},methods:{handleChange(e,t){!t&&e.preventDefault();let{container:n}=this.$refs;if(!n)return;let r=n.clientWidth,i=n.clientHeight,a=n.getBoundingClientRect().left+window.pageXOffset,o=n.getBoundingClientRect().top+window.pageYOffset,s=e.pageX||(e.touches?e.touches[0].pageX:0),c=e.pageY||(e.touches?e.touches[0].pageY:0),l=MR(s-a,0,r),u=MR(c-o,0,i),d=l/r,f=MR(-(u/i)+1,0,1);this.onChange({h:this.colors.hsv.h,s:d,v:f,a:this.colors.hsv.a,source:`hsva`})},onChange(e){this.$emit(`change`,e)},handleMouseDown(e){window.addEventListener(`mousemove`,this.handleChange),window.addEventListener(`mouseup`,this.handleChange),window.addEventListener(`mouseup`,this.handleMouseUp)},handleMouseUp(e){this.unbindEventListeners()},unbindEventListeners(){window.removeEventListener(`mousemove`,this.handleChange),window.removeEventListener(`mouseup`,this.handleChange),window.removeEventListener(`mouseup`,this.handleMouseUp)}}},PR=H(`div`,{class:`vc-saturation--white`},null,-1),FR=H(`div`,{class:`vc-saturation--black`},null,-1),IR=[H(`div`,{class:`vc-saturation-circle`},null,-1)];function LR(e,t,n,r,i,a){return z(),B(`div`,{ref:`container`,class:`vc-saturation`,style:k({background:a.bgColor}),onMousedown:t[0]||=(...e)=>a.handleMouseDown&&a.handleMouseDown(...e),onTouchmove:t[1]||=(...e)=>a.handleChange&&a.handleChange(...e),onTouchstart:t[2]||=(...e)=>a.handleChange&&a.handleChange(...e)},[PR,FR,H(`div`,{class:`vc-saturation-pointer`,style:k({top:a.pointerTop,left:a.pointerLeft})},IR,4)],36)}LL(`.vc-saturation,.vc-saturation--black,.vc-saturation--white{bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0}.vc-saturation--white{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.vc-saturation--black{background:linear-gradient(0deg,#000,transparent)}.vc-saturation-pointer{cursor:pointer;position:absolute}.vc-saturation-circle{border-radius:50%;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);cursor:head;height:4px;transform:translate(-2px,-2px);width:4px}`),NR.render=LR,NR.__file=`src/components/saturation/saturation.vue`,NR.install=RL;var RR={name:`Hue`,props:{value:Object,direction:{type:String,default:`horizontal`}},data(){return{oldHue:0,pullDirection:``}},computed:{colors(){return this.value},directionClass(){return{"vc-hue--horizontal":this.direction===`horizontal`,"vc-hue--vertical":this.direction===`vertical`}},pointerTop(){return this.direction===`vertical`?this.colors.hsl.h===0&&this.pullDirection===`right`?0:`${-(this.colors.hsl.h*100/360)+100}%`:0},pointerLeft(){return this.direction===`vertical`?0:this.colors.hsl.h===0&&this.pullDirection===`right`?`100%`:`${this.colors.hsl.h*100/360}%`}},watch:{value:{handler(e,t){let{h:n}=e.hsl;n!==0&&n-this.oldHue>0&&(this.pullDirection=`right`),n!==0&&n-this.oldHue<0&&(this.pullDirection=`left`),this.oldHue=n},deep:!0,immediate:!0}},methods:{handleChange(e,t){!t&&e.preventDefault();let{container:n}=this.$refs;if(!n)return;let r=n.clientWidth,i=n.clientHeight,a=n.getBoundingClientRect().left+window.pageXOffset,o=n.getBoundingClientRect().top+window.pageYOffset,s=e.pageX||(e.touches?e.touches[0].pageX:0),c=e.pageY||(e.touches?e.touches[0].pageY:0),l=s-a,u=c-o,d,f;this.direction===`vertical`?(u<0?d=360:u>i?d=0:(f=-(u*100/i)+100,d=360*f/100),this.colors.hsl.h!==d&&this.$emit(`change`,{h:d,s:this.colors.hsl.s,l:this.colors.hsl.l,a:this.colors.hsl.a,source:`hsl`})):(l<0?d=0:l>r?d=360:(f=l*100/r,d=360*f/100),this.colors.hsl.h!==d&&this.$emit(`change`,{h:d,s:this.colors.hsl.s,l:this.colors.hsl.l,a:this.colors.hsl.a,source:`hsl`}))},handleMouseDown(e){this.handleChange(e,!0),window.addEventListener(`mousemove`,this.handleChange),window.addEventListener(`mouseup`,this.handleChange),window.addEventListener(`mouseup`,this.handleMouseUp)},handleMouseUp(e){this.unbindEventListeners()},unbindEventListeners(){window.removeEventListener(`mousemove`,this.handleChange),window.removeEventListener(`mouseup`,this.handleChange),window.removeEventListener(`mouseup`,this.handleMouseUp)}}},zR=[`aria-valuenow`],BR=[H(`div`,{class:`vc-hue-picker`},null,-1)];function VR(e,t,n,r,i,a){return z(),B(`div`,{class:A([`vc-hue`,[a.directionClass]])},[H(`div`,{ref:`container`,class:`vc-hue-container`,role:`slider`,"aria-valuenow":a.colors.hsl.h,"aria-valuemin":`0`,"aria-valuemax":`360`,onMousedown:t[0]||=(...e)=>a.handleMouseDown&&a.handleMouseDown(...e),onTouchmove:t[1]||=(...e)=>a.handleChange&&a.handleChange(...e),onTouchstart:t[2]||=(...e)=>a.handleChange&&a.handleChange(...e)},[H(`div`,{class:`vc-hue-pointer`,style:k({top:a.pointerTop,left:a.pointerLeft}),role:`presentation`},BR,4)],40,zR)],2)}LL(`.vc-hue{border-radius:2px;bottom:0;left:0;position:absolute;right:0;top:0}.vc-hue--horizontal{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.vc-hue--vertical{background:linear-gradient(0deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.vc-hue-container{cursor:pointer;height:100%;margin:0 2px;position:relative}.vc-hue-pointer{position:absolute;z-index:2}.vc-hue-picker{background:#fff;border-radius:1px;box-shadow:0 0 2px rgba(0,0,0,.6);cursor:pointer;height:8px;margin-top:1px;transform:translateX(-2px);width:4px}`),RR.render=VR,RR.__file=`src/components/hue/hue.vue`,RR.install=RL;var HR=[`#D0021B`,`#F5A623`,`#F8E71C`,`#8B572A`,`#7ED321`,`#417505`,`#BD10E0`,`#9013FE`,`#4A90E2`,`#50E3C2`,`#B8E986`,`#000000`,`#4A4A4A`,`#9B9B9B`,`#FFFFFF`,`rgba(0,0,0,0)`],UR={name:`Sketch`,components:{Saturation:NR,Hue:RR,Alpha:WL,EdIn:ER,Checkboard:BL},mixins:[TR],props:{presetColors:{type:Array,default(){return HR}},disableAlpha:{type:Boolean,default:!1},disableFields:{type:Boolean,default:!1}},computed:{hex(){let e;return e=this.colors.a<1?this.colors.hex8:this.colors.hex,e.replace(`#`,``)},activeColor(){let{rgba:e}=this.colors;return`rgba(${[e.r,e.g,e.b,e.a].join(`,`)})`}},methods:{handlePreset(e){this.colorChange(e)},childChange(e){this.colorChange(e)},inputChange(e){e&&(e.hex?this.isValidHex(e.hex)&&this.colorChange({hex:e.hex,source:`hex`}):(e.r||e.g||e.b||e.a)&&this.colorChange({r:e.r||this.colors.rgba.r,g:e.g||this.colors.rgba.g,b:e.b||this.colors.rgba.b,a:e.a||this.colors.rgba.a,source:`rgba`}))}}},WR={class:`vc-sketch-saturation-wrap`},GR={class:`vc-sketch-controls`},KR={class:`vc-sketch-sliders`},qR={class:`vc-sketch-hue-wrap`},JR={key:0,class:`vc-sketch-alpha-wrap`},YR={class:`vc-sketch-color-wrap`},XR=[`aria-label`],ZR={key:0,class:`vc-sketch-field`},QR={class:`vc-sketch-field--double`},$R={class:`vc-sketch-field--single`},ez={class:`vc-sketch-field--single`},tz={class:`vc-sketch-field--single`},nz={key:0,class:`vc-sketch-field--single`},rz={class:`vc-sketch-presets`,role:`group`,"aria-label":`A color preset, pick one to set as current color`},iz=[`aria-label`,`onClick`],az=[`aria-label`,`onClick`];function oz(e,t,n,r,i,a){let o=I(`Saturation`),s=I(`Hue`),c=I(`Alpha`),l=I(`Checkboard`),u=I(`EdIn`);return z(),B(`div`,{role:`application`,"aria-label":`Sketch color picker`,class:A([`vc-sketch`,[n.disableAlpha?`vc-sketch__disable-alpha`:``]])},[H(`div`,WR,[U(o,{value:e.colors,onChange:a.childChange},null,8,[`value`,`onChange`])]),H(`div`,GR,[H(`div`,KR,[H(`div`,qR,[U(s,{value:e.colors,onChange:a.childChange},null,8,[`value`,`onChange`])]),n.disableAlpha?G(`v-if`,!0):(z(),B(`div`,JR,[U(c,{value:e.colors,onChange:a.childChange},null,8,[`value`,`onChange`])]))]),H(`div`,YR,[H(`div`,{"aria-label":`Current color is ${a.activeColor}`,class:`vc-sketch-active-color`,style:k({background:a.activeColor})},null,12,XR),U(l)])]),n.disableFields?G(`v-if`,!0):(z(),B(`div`,ZR,[G(` rgba `),H(`div`,QR,[U(u,{label:`hex`,value:a.hex,onChange:a.inputChange},null,8,[`value`,`onChange`])]),H(`div`,$R,[U(u,{label:`r`,value:e.colors.rgba.r,onChange:a.inputChange},null,8,[`value`,`onChange`])]),H(`div`,ez,[U(u,{label:`g`,value:e.colors.rgba.g,onChange:a.inputChange},null,8,[`value`,`onChange`])]),H(`div`,tz,[U(u,{label:`b`,value:e.colors.rgba.b,onChange:a.inputChange},null,8,[`value`,`onChange`])]),n.disableAlpha?G(`v-if`,!0):(z(),B(`div`,nz,[U(u,{label:`a`,value:e.colors.a,"arrow-offset":.01,max:1,onChange:a.inputChange},null,8,[`value`,`arrow-offset`,`onChange`])]))])),H(`div`,rz,[(z(!0),B(R,null,L(n.presetColors,t=>(z(),B(R,null,[e.isTransparent(t)?(z(),B(`div`,{key:t,"aria-label":`Color:${t}`,class:`vc-sketch-presets-color`,onClick:e=>a.handlePreset(t)},[U(l)],8,az)):(z(),B(`div`,{key:`!${t}`,class:`vc-sketch-presets-color`,"aria-label":`Color:${t}`,style:k({background:t}),onClick:e=>a.handlePreset(t)},null,12,iz))],64))),256))])],2)}LL(`.vc-sketch{background:#fff;border-radius:4px;box-shadow:0 0 0 1px rgba(0,0,0,.15),0 8px 16px rgba(0,0,0,.15);box-sizing:initial;padding:10px 10px 0;position:relative;width:200px}.vc-sketch-saturation-wrap{overflow:hidden;padding-bottom:75%;position:relative;width:100%}.vc-sketch-controls{display:flex}.vc-sketch-sliders{flex:1;padding:4px 0}.vc-sketch-sliders .vc-alpha-gradient,.vc-sketch-sliders .vc-hue{border-radius:2px}.vc-sketch-alpha-wrap,.vc-sketch-hue-wrap{height:10px;position:relative}.vc-sketch-alpha-wrap{margin-top:4px;overflow:hidden}.vc-sketch-color-wrap{border-radius:3px;height:24px;margin-left:4px;margin-top:4px;position:relative;width:24px}.vc-sketch-active-color{border-radius:2px;bottom:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15),inset 0 0 4px rgba(0,0,0,.25);left:0;position:absolute;right:0;top:0;z-index:2}.vc-sketch-color-wrap .vc-checkerboard{background-size:auto}.vc-sketch-field{display:flex;padding-top:4px}.vc-sketch-field .vc-input__input{border:none;box-shadow:inset 0 0 0 1px #ccc;font-size:10px;padding:4px 0 3px 10%;width:90%}.vc-sketch-field .vc-input__label{color:#222;display:block;font-size:11px;padding-bottom:4px;padding-top:3px;text-align:center;text-transform:capitalize}.vc-sketch-field--single{flex:1;padding-left:6px}.vc-sketch-field--double{flex:2}.vc-sketch-presets{border-top:1px solid #eee;margin-left:-10px;margin-right:-10px;padding-left:10px;padding-top:10px}.vc-sketch-presets-color{cursor:pointer;display:inline-block;height:16px;margin:0 10px 10px 0;overflow:hidden;position:relative;vertical-align:top;width:16px}.vc-sketch-presets-color,.vc-sketch-presets-color .vc-checkerboard{border-radius:3px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}.vc-sketch__disable-alpha .vc-sketch-color-wrap{height:10px}`),UR.render=oz,UR.__file=`src/components/sketch/sketch.vue`,UR.install=RL;function sz(e){let t=String(e||``).trim();if(!t)return null;let n=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);if(n)return{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16),a:1};if(n=t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i),n){let e=e=>parseInt(e+e,16);return{r:e(n[1]),g:e(n[2]),b:e(n[3]),a:1}}if(n=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i),n)return{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16),a:parseInt(n[4],16)/255};if(n=t.match(/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)(?:\s*,\s*([\d.]+))?\s*\)$/i),n){let e=n[4]===void 0?1:parseFloat(n[4]);return{r:Math.round(parseFloat(n[1])),g:Math.round(parseFloat(n[2])),b:Math.round(parseFloat(n[3])),a:e}}return null}function cz(e){if(!e)return`#000000`;let t=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,`0`);return`#`+t(e.r)+t(e.g)+t(e.b)}function lz(e){return e?e.a>=1?cz(e):`rgba(${Math.round(e.r)}, ${Math.round(e.g)}, ${Math.round(e.b)}, ${+e.a.toFixed(2)})`:``}var uz={name:`SetColor`,components:{Sketch:UR},props:s_,emits:c_,data(){return{_rgb:null,popOpen:!1,popW:240,popStyle:{position:`fixed`,left:`0px`,top:`0px`}}},computed:{text(){return this.value===void 0||this.value===null?``:String(this.value)},parsed(){return sz(this.text)||{r:0,g:0,b:0,a:1}},pickerValue(){return this.text||`#000000`},alpha(){return this.parsed.a},displayColor(){return lz(this.parsed)}},watch:{text(){this._rgb=sz(this.text)}},beforeUnmount(){this.removeDocListener()},methods:{onTextInput(e){this._rgb=sz(e),this.$emit(`input`,e)},onAlphaChange(e){let t=Math.max(0,Math.min(1,parseInt(e,10)/100)),n={...this._rgb||this.parsed,a:t};this._rgb=n,this.$emit(`input`,lz(n)),this.$emit(`change`)},onPicker(e){let t=e&&e.rgba,n,r,i,a;if(Array.isArray(t))[n,r,i,a]=t;else if(t)n=t.r,r=t.g,i=t.b,a=t.a;else{let t=sz(e.hex)||{r:0,g:0,b:0,a:1};n=t.r,r=t.g,i=t.b,a=t.a}a??=1;let o=e.hex||cz({r:n,g:r,b:i,a:1});this._rgb={r:n,g:r,b:i,a},this.$emit(`input`,a>=1?o:`rgba(${Math.round(n)}, ${Math.round(r)}, ${Math.round(i)}, ${+a.toFixed(2)})`),this.$emit(`change`)},clear(){this.disabled||(this._rgb=null,this.closePop(),this.$emit(`input`,``),this.$emit(`change`))},togglePop(){this.disabled||(this.popOpen?this.closePop():this.openPop())},openPop(){let e=this.$refs.swatch;if(!e)return;let t=e.getBoundingClientRect(),n=this.$refs.top&&this.$refs.top.getBoundingClientRect()||t,r=Math.max(220,Math.min(Math.round(n.width),400)),i=window.innerWidth,a=window.innerHeight,o=n.left,s=t.bottom+6;o+r>i-8&&(o=Math.max(8,i-r-8)),s+320>a-8&&(s=Math.max(8,t.top-320-6)),this.popW=r,this.popStyle={position:`fixed`,left:o+`px`,top:s+`px`,width:r+`px`,zIndex:4e3},this.popOpen=!0,this.$nextTick(()=>{document.addEventListener(`mousedown`,this.onDocClick,!0)})},closePop(){this.popOpen&&(this.popOpen=!1,this.removeDocListener())},removeDocListener(){document.removeEventListener(`mousedown`,this.onDocClick,!0)},onDocClick(e){let t=this.$refs.pop,n=this.$refs.swatch;t&&t.contains(e.target)||n&&n.contains(e.target)||this.closePop()}}},dz={class:`st-color`},fz={class:`st-color__top`,ref:`top`},pz=[`title`,`disabled`],mz=[`disabled`,`value`],hz=[`disabled`],gz={key:0,class:`st-color__alpha-row`},_z=[`disabled`,`value`],vz={class:`st-color__alpha-val`};function yz(e,t,n,r,i,a){let o=I(`Sketch`);return z(),B(`div`,dz,[G(` 色块预览 + 文本输入 + 重置(顶行) `),H(`div`,fz,[H(`button`,{ref:`swatch`,class:`st-color__swatch`,type:`button`,title:a.text||`未设置`,disabled:e.disabled,onClick:t[0]||=(...e)=>a.togglePop&&a.togglePop(...e)},[t[7]||=H(`span`,{class:`st-color__checker`},null,-1),H(`span`,{class:`st-color__fill`,style:k({background:a.displayColor||`transparent`})},null,4)],8,pz),H(`input`,{class:`ni-input st-color__text`,type:`text`,placeholder:`如 #333333 / rgba(0,0,0,.5)`,disabled:e.disabled,value:a.text,onInput:t[1]||=e=>a.onTextInput(e.target.value),onChange:t[2]||=t=>e.$emit(`change`)},null,40,mz),H(`button`,{class:`st-color__clear`,type:`button`,title:`重置(清空颜色)`,disabled:e.disabled,onClick:t[3]||=(...e)=>a.clear&&a.clear(...e)},[...t[8]||=[H(`svg`,{viewBox:`0 0 16 16`,class:`st-ic`,"aria-hidden":`true`},[H(`use`,{href:`#icon-reset`})],-1)]],8,hz)],512),G(` 透明度滑块(仅当颜色值非空时显示),作为快捷调节 `),a.text?(z(),B(`div`,gz,[t[9]||=H(`span`,{class:`st-color__alpha-label`},`透明度`,-1),H(`input`,{class:`st-color__alpha-slider`,type:`range`,min:`0`,max:`100`,disabled:e.disabled,value:Math.round(a.alpha*100),onInput:t[4]||=e=>a.onAlphaChange(e.target.value),onChange:t[5]||=t=>e.$emit(`change`)},null,40,_z),H(`span`,vz,j(Math.round(a.alpha*100))+`%`,1)])):G(`v-if`,!0),G(` 第三方颜色选择器弹层(挂载到 body,避免被滚动容器裁切) `),(z(),V(oi,{to:`body`},[i.popOpen?(z(),B(`div`,{key:0,ref:`pop`,class:`st-color__pop`,style:k(i.popStyle),onMousedown:t[6]||=K(()=>{},[`stop`])},[U(o,{"model-value":a.pickerValue,"disable-alpha":!1,"onUpdate:modelValue":a.onPicker},null,8,[`model-value`,`onUpdate:modelValue`])],36)):G(`v-if`,!0)]))])}var bz=Y(uz,[[`render`,yz],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetColor.vue`]]),xz={name:`SetIconSelect`,components:{SvgSymbols:Sd},props:s_,emits:c_,data(){return{open:!1}},computed:{list(){return this.options.iIconList||[]}},methods:{pick(e){this.disabled||(this.open=!1,this.$emit(`input`,e.key),this.$emit(`change`))}}},Sz={class:`st-iconsel-wrap`},Cz={class:`st-iconsel`},wz={class:`st-iconsel__preview`},Tz={key:1,style:{"font-size":`11px`,color:`var(--text-faint)`}},Ez=[`disabled`,`value`],Dz={key:0,class:`st-iconsel__grid`},Oz=[`title`,`onClick`],kz={key:0,class:`st-list__empty`};function Az(e,t,n,r,i,a){let o=I(`SvgSymbols`);return z(),B(`div`,Sz,[H(`div`,Cz,[H(`span`,wz,[e.value?(z(),V(o,{key:0,icon:String(e.value),color:`currentColor`},null,8,[`icon`])):(z(),B(`span`,Tz,`无`))]),H(`input`,{class:`ni-input`,type:`text`,placeholder:`图标 key`,disabled:e.disabled,value:e.value||``,onInput:t[0]||=t=>e.$emit(`input`,t.target.value),onChange:t[1]||=t=>e.$emit(`change`)},null,40,Ez),H(`button`,{class:`st-minibtn`,type:`button`,onClick:t[2]||=e=>i.open=!i.open},j(i.open?`收起`:`选择`),1)]),i.open?(z(),B(`div`,Dz,[(z(!0),B(R,null,L(a.list,t=>(z(),B(`span`,{key:t.key,class:A([`st-iconsel__cell`,{"st-iconsel__cell--on":t.key===e.value}]),title:t.name||t.value||t.key,onClick:e=>a.pick(t)},[U(o,{icon:t.key,color:`currentColor`},null,8,[`icon`])],10,Oz))),128)),a.list.length?G(`v-if`,!0):(z(),B(`p`,kz,`该组件未提供图标列表`))])):G(`v-if`,!0)])}var jz=Y(xz,[[`render`,Az],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetIconSelect.vue`]]);Prism.languages.javascript=Prism.languages.extend(`clike`,{"class-name":[Prism.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),Prism.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined(`script`,`javascript`),Prism.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),Prism.languages.js=Prism.languages.javascript,T_.default.languages.javascript&&!T_.default.languages.javascript[`binding-var`]&&T_.default.languages.insertBefore(`javascript`,`keyword`,{"binding-var":/\$[A-Za-z_$][\w$]*/});var Mz={name:`SetExpr`,props:{...s_,placeholder:{type:String,default:``}},emits:c_,data(){return{code:``}},computed:{lines(){return this.code?this.code.split(`
|
|
312
|
+
`).length:0},chars(){return this.code.length}},watch:{value(e){this.syncFromValue(e)}},mounted(){this.code=this.readValue(this.value),this.$nextTick(()=>this.initJar())},beforeUnmount(){this._t&&clearTimeout(this._t),this._jar&&this._jar.destroy&&this._jar.destroy()},methods:{readValue(e){return e==null?``:typeof e==`string`?e:String(e)},syncFromValue(e){let t=this.readValue(e);if(t===this.code)return;let n=this.$refs.editor;n&&document.activeElement===n||(this.code=t,this._jar&&this._jar.updateCode(t))},initJar(){let e=this.$refs.editor;if(!e)return;let t=e=>{e.innerHTML=T_.default.highlight(e.textContent,T_.default.languages.javascript,`javascript`)};this._jar=w_(e,t,{tab:` `,indentOn:/[({[]$/,addClosing:!0,history:!0}),this._jar.updateCode(this.code),this._jar.onUpdate(e=>this.onCode(e))},onCode(e){this.disabled||(this.code=e,this.$emit(`input`,e),this._t&&clearTimeout(this._t),this._t=setTimeout(()=>this.$emit(`change`),400))}}},Nz={key:0,class:`st-expr__ph`},Pz={class:`st-expr__foot`},Fz={class:`st-expr__hint`};function Iz(e,t,n,r,i,a){return z(),B(`div`,{class:A([`st-expr`,{"st-expr--disabled":e.disabled}])},[H(`div`,{ref:`editor`,class:A([`st-expr__editor`,{"is-disabled":e.disabled}])},null,2),n.placeholder&&!i.code?(z(),B(`span`,Nz,j(n.placeholder),1)):G(`v-if`,!0),H(`div`,Pz,[H(`span`,Fz,j(a.lines)+` 行 · `+j(a.chars)+` 字符`,1)])],2)}var Lz=Y(Mz,[[`render`,Iz],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetExpr.vue`]]),Rz={name:`SetIfForm`,components:{SetExpr:Lz},props:s_,emits:c_,computed:{obj(){return this.value&&typeof this.value==`object`?this.value:{}},expression(){return this.obj.expression||``},name(){return this.obj.name||``}},methods:{setExpression(e){let t=!this.name||this.name===this.expression;this.$emit(`input`,{name:t?e:this.name,expression:e})},setName(e){this.$emit(`input`,{name:e,expression:this.expression})}}},zz={class:`st-ifform`},Bz=[`disabled`,`value`];function Vz(e,t,n,r,i,a){let o=I(`SetExpr`);return z(),B(`div`,zz,[U(o,{value:a.expression,disabled:e.disabled,placeholder:`表达式,如 $singleMode 或 $data.count > 0`,onInput:a.setExpression,onChange:t[0]||=t=>e.$emit(`change`)},null,8,[`value`,`disabled`,`onInput`]),H(`input`,{class:`ni-input`,type:`text`,placeholder:`显示名(留空跟随表达式)`,disabled:e.disabled,value:a.name,onInput:t[1]||=e=>a.setName(e.target.value),onChange:t[2]||=t=>e.$emit(`change`)},null,40,Bz)])}var Hz=Y(Rz,[[`render`,Vz],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetIfForm.vue`]]),Uz=[{key:`number`,value:`px`},{key:`percent`,value:`%`},{key:`auto`,value:`@`}],Wz={name:`SetNumberStyle`,components:{SetNumber:kL},props:s_,emits:c_,data(){return{unit:`number`,numValue:``,menuOpen:!1}},computed:{unitList(){return this.options.iTypeList||Uz},unitLabel(){let e=this.unitList.filter(e=>e.key===this.unit)[0];return e?e.value:`px`},isAuto(){return this.unit===`auto`},numberOptions(){return{...this.options,type:this.unit===`percent`?`integer`:`float`,placeholder:this.options.placeholder||``,symbol:!0}}},watch:{value:{immediate:!0,handler(){this.parse()}}},methods:{parse(){let e=this.value;/%$/.test(String(e))?(this.unit=`percent`,this.numValue=String(e).replace(/%/g,``)):e===`auto`?(this.unit=`auto`,this.numValue=`auto`):(this.unit=`number`,this.numValue=e===0?`0`:e==null?``:String(e))},onNum(e){this.numValue=e,this.emit()},pickUnit(e){this.menuOpen=!1,this.unit=e,this.numValue=e===`percent`?`100`:e===`auto`?`auto`:``,this.emit(),this.$emit(`change`)},emit(){this.unit===`percent`&&this.numValue?this.$emit(`input`,this.numValue+`%`):this.$emit(`input`,this.numValue)}}},Gz={class:`st-numberstyle`},Kz={key:1,class:`st-pop st-pop--unit`},qz=[`onMousedown`];function Jz(e,t,n,r,i,a){let o=I(`SetNumber`);return z(),B(`div`,Gz,[U(o,{value:i.numValue,options:a.numberOptions,disabled:e.disabled||a.isAuto,onInput:a.onNum,onChange:t[1]||=t=>e.$emit(`change`)},{symbol:Rr(()=>[H(`span`,{class:`st-unit`,onMousedown:t[0]||=K(e=>i.menuOpen=!i.menuOpen,[`prevent`])},j(a.unitLabel),33)]),_:1},8,[`value`,`options`,`disabled`,`onInput`]),G(` 单位切换浮层:移到 .st-number 之外,避免被 overflow:hidden 裁切 `),i.menuOpen?(z(),B(`div`,{key:0,class:`st-pop-mask`,onMousedown:t[2]||=K(e=>i.menuOpen=!1,[`prevent`])},null,32)):G(`v-if`,!0),i.menuOpen?(z(),B(`div`,Kz,[(z(!0),B(R,null,L(a.unitList,e=>(z(),B(`div`,{key:e.key,class:A([`st-pop__item`,{"st-pop__item--on":e.key===i.unit}]),onMousedown:K(t=>a.pickUnit(e.key),[`prevent`])},j(e.value),43,qz))),128))])):G(`v-if`,!0)])}var Yz=Y(Wz,[[`render`,Jz],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetNumberStyle.vue`]]),Xz={name:`SetPadding`,components:{SetNumber:kL},props:s_,emits:c_,data(){return{form:{top:``,right:``,bottom:``,left:``}}},computed:{brackets(){return this.options.brackets||[`{`,`}`]},seperator(){return this.options.seperator||`,`}},watch:{value:{immediate:!0,handler(){this.parse()}}},methods:{parse(){let e=String(this.value||``);this.brackets.length&&(e=e.replace(RegExp(`[${this.brackets.join(``)}]`,`g`),``));let t=e.split(this.seperator);this.form=this.options.normal?{top:t[0]||``,right:t[1]||``,bottom:t[2]||``,left:t[3]||``}:{top:t[0]||``,left:t[1]||``,bottom:t[2]||``,right:t[3]||``}},opt(e){return{type:`integer`,symbol:e,placeholder:`0`}},set(e,t){this.form[e]=t,this.emitValue()},emitValue(){let e=this.form,t=(this.options.normal?[e.top,e.right,e.bottom,e.left]:[e.top,e.left,e.bottom,e.right]).map(e=>e===``||e===void 0?`0`:e).join(this.seperator),[n,r]=this.brackets.length?this.brackets:[``,``];this.$emit(`input`,`${n||``}${t}${r||``}`)},emitOut(){this.$emit(`change`)}}},Zz={class:`st-pad`};function Qz(e,t,n,r,i,a){let o=I(`SetNumber`);return z(),B(`div`,Zz,[U(o,{value:i.form.top,options:a.opt(`上`),disabled:e.disabled,onInput:t[0]||=e=>a.set(`top`,e),onChange:a.emitOut},null,8,[`value`,`options`,`disabled`,`onChange`]),U(o,{value:i.form.right,options:a.opt(`右`),disabled:e.disabled,onInput:t[1]||=e=>a.set(`right`,e),onChange:a.emitOut},null,8,[`value`,`options`,`disabled`,`onChange`]),U(o,{value:i.form.bottom,options:a.opt(`下`),disabled:e.disabled,onInput:t[2]||=e=>a.set(`bottom`,e),onChange:a.emitOut},null,8,[`value`,`options`,`disabled`,`onChange`]),U(o,{value:i.form.left,options:a.opt(`左`),disabled:e.disabled,onInput:t[3]||=e=>a.set(`left`,e),onChange:a.emitOut},null,8,[`value`,`options`,`disabled`,`onChange`])])}var $z=Y(Xz,[[`render`,Qz],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetPadding.vue`]]),eB=[{key:`TopLeft`,value:`上左`},{key:`TopCenter`,value:`上中`},{key:`TopRight`,value:`上右`},{key:`CenterLeft`,value:`中左`},{key:`Center`,value:`中间`},{key:`CenterRight`,value:`中右`},{key:`BottomLeft`,value:`下左`},{key:`BottomCenter`,value:`下中`},{key:`BottomRight`,value:`下右`}],tB=[{key:`0% 0%`,value:`左上对齐`},{key:`50% 0%`,value:`中上对齐`},{key:`100% 0%`,value:`右上对齐`},{key:`0% 50%`,value:`左中对齐`},{key:`50% 50%`,value:`居中对齐`},{key:`100% 50%`,value:`右中对齐`},{key:`0% 100%`,value:`左下对齐`},{key:`50% 100%`,value:`中下对齐`},{key:`100% 100%`,value:`右下对齐`}],nB={name:`SetGrid9`,props:{...s_,kind:{type:String,default:`PositionStyle`}},emits:c_,computed:{cells(){return this.kind===`BackgroundPositionStyle`?tB:eB}},methods:{pick(e){this.disabled||(this.$emit(`input`,e.key),this.$emit(`change`))}}},rB={class:`st-grid9`},iB=[`title`,`onClick`];function aB(e,t,n,r,i,a){return z(),B(`div`,rB,[(z(!0),B(R,null,L(a.cells,n=>(z(),B(`div`,{key:n.key,class:A([`st-grid9__cell`,{"st-grid9__cell--on":String(n.key)===String(e.value)}]),title:n.value,onClick:e=>a.pick(n)},[...t[0]||=[H(`span`,{class:`st-grid9__dot`},null,-1)]],10,iB))),128))])}var oB=Y(nB,[[`render`,aB],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetGrid9.vue`]]),sB=[{key:`number`,value:`px`},{key:`percent`,value:`%`}],cB={name:`SetBgPosition`,components:{SetGrid9:oB,SetNumberStyle:Yz},props:s_,emits:c_,data(){return{x:``,y:``}},watch:{value:{immediate:!0,handler(){this.parse()}}},methods:{parse(){let e=String(this.value||``).split(/\s+/);this.x=e[0]||``,this.y=e[1]||``},numOptions(e){return{placeholder:e,iTypeList:sB}},pickGrid(e){this.$emit(`input`,e)},setX(e){this.x=e,this.emitValue()},setY(e){this.y=e,this.emitValue()},emitValue(){this.$emit(`input`,`${this.x||`0`} ${this.y||`0`}`)},emitOut(){this.$emit(`change`)}}},lB={class:`st-bgpos`},uB={class:`st-bgpos__xy`};function dB(e,t,n,r,i,a){let o=I(`SetGrid9`),s=I(`SetNumberStyle`);return z(),B(`div`,lB,[U(o,{kind:`BackgroundPositionStyle`,value:e.value,disabled:e.disabled,onInput:a.pickGrid,onChange:t[0]||=t=>e.$emit(`change`)},null,8,[`value`,`disabled`,`onInput`]),H(`div`,uB,[U(s,{value:i.x,options:a.numOptions(`X`),disabled:e.disabled,onInput:a.setX,onChange:a.emitOut},null,8,[`value`,`options`,`disabled`,`onInput`,`onChange`]),U(s,{value:i.y,options:a.numOptions(`Y`),disabled:e.disabled,onInput:a.setY,onChange:a.emitOut},null,8,[`value`,`options`,`disabled`,`onInput`,`onChange`])])])}var fB=Y(cB,[[`render`,dB],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetBgPosition.vue`]]),pB=[{key:`cover`,desc:`cover:保持纵横比,缩放到完全覆盖背景定位区域的最小尺寸`},{key:`contain`,desc:`contain:保持纵横比,缩放到能放进背景定位区域的最大尺寸`}],mB={name:`SetBgSize`,components:{SetNumberStyle:Yz,Dropdown:Qg},computed:{bgOptions(){return[{key:``,value:`自定义`}].concat(this.TYPES.map(e=>({key:e.key,value:e.key})))}},props:s_,emits:c_,data(){return{TYPES:pB,preset:``,x:``,y:``}},watch:{value:{immediate:!0,handler(){this.parse()}}},methods:{parse(){let e=String(this.value||``),t=pB.map(e=>e.key);this.preset=t.includes(e)?e:``;let n=e.split(/\s+/);n.length>=2?(this.x=n[0]||``,this.y=n[1]||``):(this.x=``,this.y=``)},pickPreset(e){this.preset=e,e||(this.x=`auto`,this.y=`auto`),this.emitValue(),this.$emit(`change`)},setX(e){this.x=e,this.emitValue()},setY(e){this.y=e,this.emitValue()},emitValue(){let e=this.preset?this.preset:`${this.x||`auto`} ${this.y||`auto`}`;this.$emit(`input`,e)},emitOut(){this.$emit(`change`)}}},hB={class:`st-bgsize`},gB={key:0,class:`st-bgsize__xy`};function _B(e,t,n,r,i,a){let o=I(`Dropdown`),s=I(`SetNumberStyle`);return z(),B(`div`,hB,[U(o,{value:i.preset,options:a.bgOptions,size:`sm`,block:``,disabled:e.disabled,onInput:t[0]||=e=>a.pickPreset(e)},null,8,[`value`,`options`,`disabled`]),i.preset?G(`v-if`,!0):(z(),B(`div`,gB,[U(s,{value:i.x,options:{placeholder:`宽`},disabled:e.disabled,onInput:a.setX,onChange:a.emitOut},null,8,[`value`,`disabled`,`onInput`,`onChange`]),U(s,{value:i.y,options:{placeholder:`高`},disabled:e.disabled,onInput:a.setY,onChange:a.emitOut},null,8,[`value`,`disabled`,`onInput`,`onChange`])]))])}var vB=Y(mB,[[`render`,_B],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetBgSize.vue`]]),yB=[{key:`to bottom`,desc:`从上到下`},{key:`to top`,desc:`从下到上`},{key:`to left`,desc:`从右到左`},{key:`to right`,desc:`从左到右`},{key:`to bottom right`,desc:`从左上到右下`},{key:`to bottom left`,desc:`从右上到左下`},{key:`to top left`,desc:`从右下到左上`},{key:`to top right`,desc:`从左下到右上`}];function bB(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?n++:a===`)`?n--:a===`,`&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t.filter(e=>e!==``)}var xB={name:`SetGradient`,components:{SetColor:bz,Dropdown:Qg},props:s_,emits:c_,data(){return{DIRECTIONS:yB,direction:`to bottom`,stops:[]}},computed:{preview(){if(!this.stops.length)return`transparent`;let e=this.stops.map(e=>e.color).filter(Boolean);return e.length<2?e[0]||`transparent`:`linear-gradient(${this.direction}, ${e.join(`, `)})`}},watch:{value:{immediate:!0,handler(){this.parse()}}},methods:{parse(){let e=String(this.value||``).trim().match(/linear-gradient\((.+)\)$/);if(!e){this.direction=this.options.defaultDirection||yB[0].key,this.stops=[];return}let t=bB(e[1]);this.direction=(t[0]||``).toLowerCase()||yB[0].key,this.stops=t.slice(1).map(e=>({color:e}))},setDirection(e){this.direction=e,this.emitValue(),this.$emit(`change`)},setStop(e,t){this.stops[e].color=t,this.emitValue()},addStop(){this.disabled||(this.stops.push({color:`#ffffff`}),this.emitValue(),this.$emit(`change`))},removeStop(e){this.disabled||(this.stops.splice(e,1),this.emitValue(),this.$emit(`change`))},emitValue(){let e=this.stops.map(e=>e.color).filter(e=>e!==``&&e!==void 0);this.$emit(`input`,e.length?`linear-gradient(${this.direction}, ${e.join(`, `)})`:``)},emitOut(){this.$emit(`change`)}}},SB={class:`st-gradient`},CB=[`onClick`],wB=[`disabled`];function TB(e,t,n,r,i,a){let o=I(`Dropdown`),s=I(`SetColor`);return z(),B(`div`,SB,[H(`div`,{class:`st-gradient__preview`,style:k({background:a.preview})},null,4),U(o,{value:i.direction,options:i.DIRECTIONS.map(e=>({key:e.key,value:e.desc})),size:`sm`,block:``,disabled:e.disabled,onInput:t[0]||=e=>a.setDirection(e)},null,8,[`value`,`options`,`disabled`]),(z(!0),B(R,null,L(i.stops,(t,n)=>(z(),B(`div`,{key:`stop`+n,class:`st-gradient__stop`},[U(s,{value:t.color,disabled:e.disabled,onInput:e=>a.setStop(n,e),onChange:a.emitOut},null,8,[`value`,`disabled`,`onInput`,`onChange`]),H(`button`,{class:`st-gradient__del`,type:`button`,title:`删除该渐变色`,onClick:e=>a.removeStop(n)},`✕`,8,CB)]))),128)),H(`button`,{class:`st-minibtn`,type:`button`,disabled:e.disabled,onClick:t[1]||=(...e)=>a.addStop&&a.addStop(...e)},`+ 新增渐变色`,8,wB)])}var EB=Y(xB,[[`render`,TB],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetGradient.vue`]]),DB=new Set([`width`,`height`,`lineHeight`,`marginRight`,`cursor`,`textAlign`]),OB={name:`SetCustomSelect`,props:s_,emits:[...c_,`sync`],computed:{list(){return this.options.list||[]}},methods:{normalizeStyle(e){if(!e||typeof e!=`object`)return{};let t={};for(let n in e)DB.has(n)||(t[n]=e[n]);return t},apply(e){if(this.disabled)return;let t=e.sync||{};Object.keys(t).length&&this.$emit(`sync`,t)}}},kB={class:`st-customsel`},AB=[`title`,`onClick`],jB={key:0},MB={key:0,class:`st-list__empty`};function NB(e,t,n,r,i,a){return z(),B(`div`,kB,[(z(!0),B(R,null,L(a.list,(e,t)=>(z(),B(`div`,{key:t,class:`st-customsel__item`,style:k(a.normalizeStyle(e.style)),title:`应用:`+Object.keys(e.sync||{}).join(`、`),onClick:t=>a.apply(e)},[(z(!0),B(R,null,L(e.list||[],(e,t)=>(z(),B(`span`,{key:t,style:k(a.normalizeStyle(e.style))},j(e.innerText),5))),128)),(e.list||[]).length?G(`v-if`,!0):(z(),B(`span`,jB,j(e.innerText||`样式`+(t+1)),1))],12,AB))),128)),a.list.length?G(`v-if`,!0):(z(),B(`p`,MB,`未配置常用样式`))])}var PB=Y(OB,[[`render`,NB],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetCustomSelect.vue`]]),FB={name:`SetList`,props:s_,emits:c_,computed:{list(){let e=this.itemInfo;return e&&e.itemList||[]},addText(){return this.options&&this.options.btnText||`添加项`}},methods:{displayName(e){let t=e.itemName||e.itemKey||``;return{fontStyle:`字体风格`,textDecoration:`文字装饰`}[e.itemKey]||t},add(){if(this.disabled)return;let e=this.itemInfo,t=this.list[0],n;n=t?new fu(t.properties.map(e=>({itemId:e.itemId,itemKey:e.itemKey,itemName:e.itemName,itemType:e.itemType,itemOption:e.itemOption,itemParam:e.itemParam,itemDefaultValue:e.itemDefaultValue,itemDesc:e.itemDesc,itemTypeRange:e.itemTypeRange,itemValueFrom:`0`,itemValue:``})),{}):new fu((this.options&&this.options.iFieldList||[]).map(e=>({itemId:e.key,itemKey:e.key,itemName:e.value||e.key,itemType:`Input`,itemValueFrom:`0`,itemValue:``})),{}),e.itemList.push(n),this.$emit(`change`)},remove(e){this.disabled||(this.itemInfo.removeAt(e),this.$emit(`change`))},move(e,t){this.disabled||(this.itemInfo.moveItem(e,e+t),this.$emit(`change`))}}},IB={class:`st-list`},LB={class:`st-list__head`},RB={class:`st-list__idx`},zB=[`disabled`,`onClick`],BB=[`disabled`,`onClick`],VB=[`disabled`,`onClick`],HB={class:`st-list__body`},UB=[`title`],WB={class:`st-list__control`},GB={key:0,class:`st-list__empty`},KB={key:0,class:`st-list__empty`},qB=[`disabled`];function JB(e,t,n,r,i,a){let o=I(`prop-control`);return z(),B(`div`,IB,[(z(!0),B(R,null,L(a.list,(n,r)=>(z(),B(`div`,{key:n.id,class:`st-list__item`},[H(`div`,LB,[H(`span`,RB,`#`+j(r+1),1),t[4]||=H(`span`,{class:`st-list__head-spacer`},null,-1),H(`button`,{class:`st-list__op`,type:`button`,title:`上移`,disabled:e.disabled||r===0,onClick:e=>a.move(r,-1)},`↑`,8,zB),H(`button`,{class:`st-list__op`,type:`button`,title:`下移`,disabled:e.disabled||r===a.list.length-1,onClick:e=>a.move(r,1)},`↓`,8,BB),H(`button`,{class:`st-list__op st-list__op--del`,type:`button`,title:`删除`,disabled:e.disabled,onClick:e=>a.remove(r)},[...t[3]||=[H(`svg`,{viewBox:`0 0 16 16`,class:`st-ic`,"aria-hidden":`true`},[H(`use`,{href:`#icon-delete`})],-1)]],8,VB)]),H(`div`,HB,[(z(!0),B(R,null,L(n.properties,n=>F((z(),B(`div`,{key:n.itemId,class:`st-list__row`},[H(`label`,{class:`st-list__label`,title:n.itemDesc||a.displayName(n)},j(a.displayName(n)),9,UB),H(`div`,WB,[U(o,{property:n,disabled:e.disabled,onChange:t[0]||=t=>e.$emit(`change`),onSync:t[1]||=t=>e.$emit(`sync`,t)},null,8,[`property`,`disabled`])])])),[[Cc,n.itemVisible]])),128)),n.properties.length?G(`v-if`,!0):(z(),B(`p`,GB,`该项无字段`))])]))),128)),a.list.length?G(`v-if`,!0):(z(),B(`p`,KB,`暂无项`)),H(`button`,{class:`st-minibtn st-list__add`,type:`button`,disabled:e.disabled,onClick:t[2]||=(...e)=>a.add&&a.add(...e)},j(a.addText),9,qB)])}var YB=Y(FB,[[`render`,JB],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetList.vue`]]),XB={name:`SetImage`,props:s_,emits:c_,methods:{clear(){this.disabled||(this.$emit(`input`,``),this.$emit(`change`))}}},ZB={class:`st-image`},QB={class:`st-image__row`},$B=[`disabled`,`value`],eV=[`disabled`];function tV(e,t,n,r,i,a){return z(),B(`div`,ZB,[H(`div`,QB,[H(`input`,{class:`ni-input`,type:`text`,disabled:e.disabled,value:e.value||``,placeholder:`图片路径,如 @filestore/...png 或 https://...`,onInput:t[0]||=t=>e.$emit(`input`,t.target.value),onChange:t[1]||=t=>e.$emit(`change`)},null,40,$B),e.value?(z(),B(`button`,{key:0,class:`st-image__clear`,type:`button`,title:`清空`,disabled:e.disabled,onClick:t[2]||=(...e)=>a.clear&&a.clear(...e)},[...t[3]||=[H(`svg`,{viewBox:`0 0 16 16`,class:`st-ic`,"aria-hidden":`true`},[H(`use`,{href:`#icon-reset`})],-1)]],8,eV)):G(`v-if`,!0)])])}var nV=Y(XB,[[`render`,tV],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetImage.vue`]]),rV={name:`SetCode`,props:s_,emits:c_,data(){return{code:``,bridge:null}},computed:{codeKey(){return this.options.codeKey||`code`},lines(){return this.code?this.code.split(`
|
|
313
|
+
`).length:0},chars(){return this.code.length}},mounted(){this.code=this.readCode(),this.$nextTick(()=>this.initJar())},beforeUnmount(){this._t&&clearTimeout(this._t),this.teardownBridge(!0),this._jar&&this._jar.destroy&&this._jar.destroy()},methods:{readCode(){let e=this.value;return e==null?``:typeof e==`string`?e:String(typeof e==`object`?e[this.codeKey]||``:e)},initJar(){let e=this.$refs.editor;if(!e)return;let t=e=>{e.innerHTML=T_.default.highlight(e.textContent,T_.default.languages.javascript,`javascript`)};this._jar=w_(e,t,{tab:` `,indentOn:/[({[]$/,addClosing:!0,history:!0}),this._jar.updateCode(this.code),this._jar.onUpdate(e=>this.onCode(e))},onCode(e){if(this.disabled||this.bridge)return;this.code=e;let t=this.value&&typeof this.value==`object`?Object.assign({},this.value):{};t[this.codeKey]=e,this.$emit(`input`,t),this._t&&clearTimeout(this._t),this._t=setTimeout(()=>this.$emit(`change`),400)},toggleBridge(){this.bridge?this.teardownBridge(!0):this.setupBridge()},async setupBridge(){if(this.disabled||this.bridge)return;let e=this.itemInfo&&this.itemInfo.itemKey?String(this.itemInfo.itemKey):``;try{let t=await Kl(this.code,e);this.bridge={id:t.id,file:t.file}}catch(e){console.error(`[VSCode 桥接建立失败]`,e);return}this.setEditorEditable(!1),this._hb=setInterval(()=>{this.bridge&&Jl(this.bridge.id).catch(()=>{})},5e3),this._bridgeUnsub=Ul(e=>{if(!(!this.bridge||!e||e.id!==this.bridge.id)){if(e.reason)return this.teardownBridge(!1);this.pullBridgeCode()}})},async pullBridgeCode(){if(!this.bridge)return;let e;try{e=await ql(this.bridge.id)}catch{return}let t=String(e.code==null?``:e.code);t!==this.code&&this.applyExternalCode(t)},applyExternalCode(e){this.code=e,this._jar&&this._jar.updateCode(e,!1);let t=this.value&&typeof this.value==`object`?Object.assign({},this.value):{};t[this.codeKey]=e,this.$emit(`input`,t),this._t&&clearTimeout(this._t),this._t=setTimeout(()=>this.$emit(`change`),400)},teardownBridge(e){let t=this.bridge;this.bridge=null,this._hb&&=(clearInterval(this._hb),null),this._bridgeUnsub&&=(this._bridgeUnsub(),null),this.setEditorEditable(!0),t&&e&&Yl(t.id).catch(()=>{})},setEditorEditable(e){let t=this.$refs.editor;t&&t.setAttribute(`contenteditable`,e?`true`:`false`)}}},iV={class:`st-code`},aV={class:`st-code__foot`},oV={class:`st-code__hint`},sV={class:`st-code__foot-actions`},cV=[`title`],lV=[`title`,`disabled`],uV={key:0,class:`st-code__vscode-label`};function dV(e,t,n,r,i,a){return z(),B(`div`,iV,[H(`div`,{ref:`editor`,class:A([`st-code__editor`,{"is-disabled":e.disabled,"is-bridged":!!i.bridge}])},null,2),G(` 右上角语言标签:弱化的只读标识,不参与交互 `),t[2]||=H(`span`,{class:`st-code__lang`,"aria-hidden":`true`},`JS`,-1),H(`div`,aV,[H(`span`,oV,j(a.lines)+` 行 · `+j(a.chars)+` 字符`,1),G(` VSCode 代码桥:生成临时 js 用外部编辑器编辑,保存实时回写;断开即删临时文件 `),H(`span`,sV,[i.bridge?(z(),B(`span`,{key:0,class:`st-code__bridge-tag`,title:i.bridge.file},`VSCode 同步中`,8,cV)):G(`v-if`,!0),H(`button`,{type:`button`,class:A([`st-code__vscode`,{"is-on":!!i.bridge}]),title:i.bridge?`断开 VSCode 桥接并删除临时文件`:`在 VSCode 中编辑:保存实时同步回编辑区,断开后清除临时文件`,disabled:e.disabled,onClick:t[0]||=(...e)=>a.toggleBridge&&a.toggleBridge(...e)},[G(` 图标左侧小字:未桥接时是动作说明;桥接后由状态徽标接替,避免两段文字挤一行 `),i.bridge?G(`v-if`,!0):(z(),B(`span`,uV,`在编辑器中打开`)),t[1]||=H(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,"aria-hidden":`true`},[H(`path`,{fill:`currentColor`,d:`M23.15 2.587 18.21.21a1.494 1.494 0 0 0-1.705.29l-9.46 8.63-4.12-3.128a.999.999 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12 .326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a.999.999 0 0 0 1.276.057l4.12-3.128 9.46 8.63a1.492 1.492 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 20.06V3.939a1.5 1.5 0 0 0-.85-1.352zm-5.146 14.861L10.826 12l7.178-5.448v10.896z`})],-1)],10,lV)])])])}var fV=Y(rV,[[`render`,dV],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/setters/SetCode.vue`]]),pV={0:`常量`,1:`变量`,2:`图片`},mV={const:`0`,var:`1`,image:`2`};function hV(e){switch(e){case`InputNumber`:return{comp:kL};case`Color`:return{comp:bz};case`Select`:return{comp:ML};case`TabSelect`:return{comp:S_,kind:`TabSelect`};case`Input`:return{comp:vL};case`Textarea`:return{comp:vL,multiline:!0};case`Switcher`:return{comp:IL};case`BooleanForm`:return{comp:IL,boolean:!0};case`PaddingStyle`:return{comp:$z};case`NumberStyle`:return{comp:Yz};case`PositionStyle`:return{comp:oB,kind:`PositionStyle`};case`BackgroundPositionStyle`:return{comp:fB};case`BackgroundSizeStyle`:return{comp:vB};case`GradientStyle`:return{comp:EB};case`FontStyle`:return{comp:S_,kind:`FontStyle`};case`TextDecorationStyle`:return{comp:S_,kind:`TextDecorationStyle`};case`JustifyContentStyle`:return{comp:S_,kind:`JustifyContentStyle`};case`AlignItemsStyle`:return{comp:S_,kind:`AlignItemsStyle`};case`IconSelect`:return{comp:jz};case`CustomSelect`:return{comp:PB};case`List`:return{comp:YB};case`IfForm`:return{comp:Hz};case`Code`:return{comp:fV};default:return{comp:vL}}}var gV={name:`PropControl`,components:{SetText:vL,SetNumber:kL,SetSelect:ML,SetSegment:S_,SetSwitch:IL,SetColor:bz,SetIconSelect:jz,SetIfForm:Hz,SetNumberStyle:Yz,SetPadding:$z,SetGrid9:oB,SetBgPosition:fB,SetBgSize:vB,SetGradient:EB,SetCustomSelect:PB,SetList:YB,SetImage:nV,SetCode:fV,SetExpr:Lz},props:{property:{type:Object,required:!0},watches:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},bExchange:{type:Boolean,default:!0}},emits:[`change`,`sync`],computed:{itemType(){return this.property&&this.property.itemType||``},sources(){let e=this.property&&this.property.itemTypeRange||`const`,t=String(e).split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>({key:mV[e],label:pV[mV[e]]})).filter(e=>e.key),n=String(this.property.itemValueFrom);return/^[012]$/.test(n)&&!t.some(e=>e.key===n)&&(t=t.concat([{key:n,label:pV[n]||`来源`+n}])),t},setterComp(){return hV(this.itemType)}},methods:{onInput(e){this.property.itemValue=e,this.$emit(`change`)},onChange(){this.$emit(`change`)},onSync(e){this.$emit(`sync`,e)},setSource(e){if(this.disabled)return;let t=this.property,n=String(e);t.itemValueFrom!==n&&(t._valuesByFrom||={0:void 0,1:void 0,2:void 0},t._valuesByFrom[t.itemValueFrom]=t.itemValue,t.itemValueFrom=n,t._valuesByFrom[n]===void 0?n===`0`?(t.itemValue=t.itemDefaultValue??this.defaultFor(),t._valuesByFrom[n]=t.itemValue):(t.itemValue=``,t._valuesByFrom[n]=``):t.itemValue=t._valuesByFrom[n],this.$emit(`change`))},defaultFor(){switch(this.itemType){case`Color`:return`#000000`;case`InputNumber`:return 0;case`Switcher`:return`0`;case`BooleanForm`:return!1;case`TabSelect`:case`Select`:{let e=this.property.itemOption||{},t=e.iParamList||e.iTypeList||[];return t.length?t[0].key:``}default:return``}}}},_V={key:0,class:`pc-srcs`},vV=[`disabled`,`onClick`],yV={class:`pc-body`};function bV(e,t,n,r,i,a){let o=I(`SetImage`),s=I(`SetExpr`);return z(),B(`div`,{class:A([`pc`,{"pc--readonly":n.disabled}])},[G(` 值来源切换(仅当 meta 声明了多于一种来源 且 允许切换时显示) `),a.sources.length>1&&n.bExchange?(z(),B(`div`,_V,[(z(!0),B(R,null,L(a.sources,e=>(z(),B(`button`,{key:e.key,type:`button`,class:A([`pc-src`,{"is-active":n.property.itemValueFrom===e.key}]),disabled:n.disabled,onClick:t=>a.setSource(e.key)},j(e.label),11,vV))),128))])):G(`v-if`,!0),H(`div`,yV,[G(` 图片素材来源 `),n.property.itemValueFrom===`2`?(z(),V(o,{key:0,value:n.property.itemValue,options:n.property.itemOption,"item-info":n.property,disabled:n.disabled,onInput:a.onInput,onChange:a.onChange},null,8,[`value`,`options`,`item-info`,`disabled`,`onInput`,`onChange`])):n.property.itemValueFrom===`1`?(z(),B(R,{key:1},[G(` 变量 / 表达式来源:带语法高亮、可拖拽调高度 `),U(s,{value:n.property.itemValue,disabled:n.disabled,"item-info":n.property,onInput:a.onInput,onChange:a.onChange},null,8,[`value`,`disabled`,`item-info`,`onInput`,`onChange`])],2112)):(z(),B(R,{key:2},[G(` 常量来源:按 itemType 分派 `),(z(),V(Xi(a.setterComp.comp),{value:n.property.itemValue,options:n.property.itemOption,watches:n.watches,"item-info":n.property,disabled:n.disabled,kind:a.setterComp.kind,multiline:a.setterComp.multiline,boolean:a.setterComp.boolean,onInput:a.onInput,onChange:a.onChange,onSync:a.onSync},null,40,[`value`,`options`,`watches`,`item-info`,`disabled`,`kind`,`multiline`,`boolean`,`onInput`,`onChange`,`onSync`]))],2112))])],2)}var xV=Y(gV,[[`render`,bV],[`__scopeId`,`data-v-910daa70`],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/PropControl.vue`]]),SV={name:`PropTree`,props:{properties:{type:Array,default:()=>[]},mode:{type:String,default:`property`},depth:{type:Number,default:1},chain:{type:Array,default:()=>[]},watches:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},bExchange:{type:Boolean,default:!0},plain:{type:Boolean,default:!1}},emits:[`leaf-change`,`leaf-sync`],data(){return{openMap:{}}},methods:{isGroup(e){if(!e)return!1;if(e.itemType===`group`)return!0;let t=e.itemChildren&&e.itemChildren.properties;return!!(t&&t.length)},childCount(e){let t=e.itemChildren&&e.itemChildren.properties;return t?t.length:0},isBlock(e){return e&&e.itemType===`Code`},groupVisible(e){if(e.itemVisible===!1)return!1;let t=e.itemChildren&&e.itemChildren.properties;return!t||!t.length||t.some(e=>e.itemVisible===!1?!1:!this.isGroup(e)||this.groupVisible(e))},isOpen(e){return this.openMap[e.itemId]!==!1},toggle(e){this.openMap[e.itemId]=this.openMap[e.itemId]===!1,this.openMap=Object.assign({},this.openMap)},onLeaf(e){this.$emit(`leaf-change`,this.chain.concat(e))},onSync(e){this.$emit(`leaf-sync`,e)}}},CV={key:0,class:`ptree__group`},wV=[`onClick`],TV={class:`ptree__group-name`},EV={class:`ptree__group-body`},DV=[`title`],OV={class:`ptree__control`};function kV(e,t,n,r,i,a){let o=I(`prop-tree`,!0),s=I(`prop-control`);return z(),B(`div`,{class:A([`ptree`,{"ptree--plain":n.plain}])},[(z(!0),B(R,null,L(n.properties,r=>(z(),B(R,{key:r.itemId},[G(` 分组(自身可见 且 存在可见后代才渲染,避免空分组) `),a.isGroup(r)&&a.groupVisible(r)?(z(),B(`div`,CV,[H(`div`,{class:`ptree__group-head`,type:`button`,onClick:e=>a.toggle(r)},[H(`span`,{class:A([`ptree__caret`,{"is-open":a.isOpen(r)}])},`▸`,2),H(`span`,TV,j(r.itemName||r.itemKey),1)],8,wV),F(H(`div`,EV,[r.itemChildren&&r.itemChildren.properties.length?(z(),V(o,{key:0,properties:r.itemChildren.properties,mode:n.mode,depth:n.depth+1,chain:n.chain.concat(r),watches:n.watches,disabled:n.disabled,"b-exchange":n.bExchange,plain:n.plain,onLeafChange:t[0]||=t=>e.$emit(`leaf-change`,t),onLeafSync:t[1]||=t=>e.$emit(`leaf-sync`,t)},null,8,[`properties`,`mode`,`depth`,`chain`,`watches`,`disabled`,`b-exchange`,`plain`])):G(`v-if`,!0)],512),[[Cc,a.isOpen(r)]])])):r.itemVisible===!1?G(`v-if`,!0):(z(),B(R,{key:1},[G(` 叶子(itemCondition 判定为不可见时不渲染,与线上编辑器一致) `),H(`div`,{class:A([`ptree__row`,{"ptree__row--disabled":n.disabled,"ptree__row--block":a.isBlock(r)}])},[H(`label`,{class:`ptree__label`,title:r.itemDesc||r.itemName||r.itemKey},j(r.itemName||r.itemKey||r.itemType||`字段`),9,DV),H(`div`,OV,[U(s,{property:r,watches:n.watches,disabled:n.disabled,"b-exchange":n.bExchange,onChange:e=>a.onLeaf(r),onSync:a.onSync},null,8,[`property`,`watches`,`disabled`,`b-exchange`,`onChange`,`onSync`])])],2)],2112))],64))),128))],2)}var AV=Y(SV,[[`render`,kV],[`__file`,`/Users/owlaford/Workspace/dsl-card/card-editor/components/PropTree.vue`]]),jV=Cl(pL);jV.component(`prop-control`,xV),jV.component(`prop-tree`,AV),jV.component(`Dropdown`,Qg),jV.config.errorHandler=(e,t,n)=>{console.error(`[render error]`,n,e),window.__cardDebug&&window.__cardDebug.pushError(`render`,`${n}: ${e.message}`)},jV.mount(`#app`);
|