@zyui/components 0.0.120 → 0.0.121

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/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var qge=Object.defineProperty;var Yge=(o,s,i)=>s in o?qge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i;var zc=(o,s,i)=>Yge(o,typeof s!="symbol"?s+"":s,i);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("vue"),On=require("element-plus"),Kge="0.0.120";var Xge=Object.defineProperty,Jge=(o,s,i)=>s in o?Xge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i,Bee=(o,s,i)=>Jge(o,typeof s!="symbol"?s+"":s,i);function Pce(o,s){return function(){return o.apply(s,arguments)}}const{toString:Qge}=Object.prototype,{getPrototypeOf:Zne}=Object,eU=(o=>s=>{const i=Qge.call(s);return o[i]||(o[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Rh=o=>(o=o.toLowerCase(),s=>eU(s)===o),tU=o=>s=>typeof s===o,{isArray:w4}=Array,sB=tU("undefined");function ehe(o){return o!==null&&!sB(o)&&o.constructor!==null&&!sB(o.constructor)&&wp(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const Fce=Rh("ArrayBuffer");function the(o){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(o):s=o&&o.buffer&&Fce(o.buffer),s}const nhe=tU("string"),wp=tU("function"),Lce=tU("number"),nU=o=>o!==null&&typeof o=="object",ohe=o=>o===!0||o===!1,KH=o=>{if(eU(o)!=="object")return!1;const s=Zne(o);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)},she=Rh("Date"),rhe=Rh("File"),ahe=Rh("Blob"),ihe=Rh("FileList"),lhe=o=>nU(o)&&wp(o.pipe),che=o=>{let s;return o&&(typeof FormData=="function"&&o instanceof FormData||wp(o.append)&&((s=eU(o))==="formdata"||s==="object"&&wp(o.toString)&&o.toString()==="[object FormData]"))},uhe=Rh("URLSearchParams"),[dhe,fhe,mhe,phe]=["ReadableStream","Request","Response","Headers"].map(Rh),ghe=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function yB(o,s,{allOwnKeys:i=!1}={}){if(o===null||typeof o>"u")return;let u,m;if(typeof o!="object"&&(o=[o]),w4(o))for(u=0,m=o.length;u<m;u++)s.call(null,o[u],u,o);else{const h=i?Object.getOwnPropertyNames(o):Object.keys(o),b=h.length;let C;for(u=0;u<b;u++)C=h[u],s.call(null,o[C],C,o)}}function Vce(o,s){s=s.toLowerCase();const i=Object.keys(o);let u=i.length,m;for(;u-- >0;)if(m=i[u],s===m.toLowerCase())return m;return null}const gE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Hce=o=>!sB(o)&&o!==gE;function Zte(){const{caseless:o}=Hce(this)&&this||{},s={},i=(u,m)=>{const h=o&&Vce(s,m)||m;KH(s[h])&&KH(u)?s[h]=Zte(s[h],u):KH(u)?s[h]=Zte({},u):w4(u)?s[h]=u.slice():s[h]=u};for(let u=0,m=arguments.length;u<m;u++)arguments[u]&&yB(arguments[u],i);return s}const hhe=(o,s,i,{allOwnKeys:u}={})=>(yB(s,(m,h)=>{i&&wp(m)?o[h]=Pce(m,i):o[h]=m},{allOwnKeys:u}),o),vhe=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),bhe=(o,s,i,u)=>{o.prototype=Object.create(s.prototype,u),o.prototype.constructor=o,Object.defineProperty(o,"super",{value:s.prototype}),i&&Object.assign(o.prototype,i)},yhe=(o,s,i,u)=>{let m,h,b;const C={};if(s=s||{},o==null)return s;do{for(m=Object.getOwnPropertyNames(o),h=m.length;h-- >0;)b=m[h],(!u||u(b,o,s))&&!C[b]&&(s[b]=o[b],C[b]=!0);o=i!==!1&&Zne(o)}while(o&&(!i||i(o,s))&&o!==Object.prototype);return s},whe=(o,s,i)=>{o=String(o),(i===void 0||i>o.length)&&(i=o.length),i-=s.length;const u=o.indexOf(s,i);return u!==-1&&u===i},Che=o=>{if(!o)return null;if(w4(o))return o;let s=o.length;if(!Lce(s))return null;const i=new Array(s);for(;s-- >0;)i[s]=o[s];return i},She=(o=>s=>o&&s instanceof o)(typeof Uint8Array<"u"&&Zne(Uint8Array)),xhe=(o,s)=>{const i=(o&&o[Symbol.iterator]).call(o);let u;for(;(u=i.next())&&!u.done;){const m=u.value;s.call(o,m[0],m[1])}},Ehe=(o,s)=>{let i;const u=[];for(;(i=o.exec(s))!==null;)u.push(i);return u},_he=Rh("HTMLFormElement"),khe=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,i,u){return i.toUpperCase()+u}),Ure=(({hasOwnProperty:o})=>(s,i)=>o.call(s,i))(Object.prototype),The=Rh("RegExp"),zce=(o,s)=>{const i=Object.getOwnPropertyDescriptors(o),u={};yB(i,(m,h)=>{let b;(b=s(m,h,o))!==!1&&(u[h]=b||m)}),Object.defineProperties(o,u)},Ahe=o=>{zce(o,(s,i)=>{if(wp(o)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const u=o[i];if(wp(u)){if(s.enumerable=!1,"writable"in s){s.writable=!1;return}s.set||(s.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},Nhe=(o,s)=>{const i={},u=m=>{m.forEach(h=>{i[h]=!0})};return w4(o)?u(o):u(String(o).split(s)),i},Ohe=()=>{},$he=(o,s)=>o!=null&&Number.isFinite(o=+o)?o:s,Ree="abcdefghijklmnopqrstuvwxyz",jre="0123456789",Uce={DIGIT:jre,ALPHA:Ree,ALPHA_DIGIT:Ree+Ree.toUpperCase()+jre},Dhe=(o=16,s=Uce.ALPHA_DIGIT)=>{let i="";const{length:u}=s;for(;o--;)i+=s[Math.random()*u|0];return i};function Mhe(o){return!!(o&&wp(o.append)&&o[Symbol.toStringTag]==="FormData"&&o[Symbol.iterator])}const Bhe=o=>{const s=new Array(10),i=(u,m)=>{if(nU(u)){if(s.indexOf(u)>=0)return;if(!("toJSON"in u)){s[m]=u;const h=w4(u)?[]:{};return yB(u,(b,C)=>{const S=i(b,m+1);!sB(S)&&(h[C]=S)}),s[m]=void 0,h}}return u};return i(o,0)},Rhe=Rh("AsyncFunction"),Ihe=o=>o&&(nU(o)||wp(o))&&wp(o.then)&&wp(o.catch),jce=((o,s)=>o?setImmediate:s?((i,u)=>(gE.addEventListener("message",({source:m,data:h})=>{m===gE&&h===i&&u.length&&u.shift()()},!1),m=>{u.push(m),gE.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",wp(gE.postMessage)),Phe=typeof queueMicrotask<"u"?queueMicrotask.bind(gE):typeof process<"u"&&process.nextTick||jce,Ln={isArray:w4,isArrayBuffer:Fce,isBuffer:ehe,isFormData:che,isArrayBufferView:the,isString:nhe,isNumber:Lce,isBoolean:ohe,isObject:nU,isPlainObject:KH,isReadableStream:dhe,isRequest:fhe,isResponse:mhe,isHeaders:phe,isUndefined:sB,isDate:she,isFile:rhe,isBlob:ahe,isRegExp:The,isFunction:wp,isStream:lhe,isURLSearchParams:uhe,isTypedArray:She,isFileList:ihe,forEach:yB,merge:Zte,extend:hhe,trim:ghe,stripBOM:vhe,inherits:bhe,toFlatObject:yhe,kindOf:eU,kindOfTest:Rh,endsWith:whe,toArray:Che,forEachEntry:xhe,matchAll:Ehe,isHTMLForm:_he,hasOwnProperty:Ure,hasOwnProp:Ure,reduceDescriptors:zce,freezeMethods:Ahe,toObjectSet:Nhe,toCamelCase:khe,noop:Ohe,toFiniteNumber:$he,findKey:Vce,global:gE,isContextDefined:Hce,ALPHABET:Uce,generateString:Dhe,isSpecCompliantForm:Mhe,toJSONObject:Bhe,isAsyncFn:Rhe,isThenable:Ihe,setImmediate:jce,asap:Phe};function kr(o,s,i,u,m){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=o,this.name="AxiosError",s&&(this.code=s),i&&(this.config=i),u&&(this.request=u),m&&(this.response=m,this.status=m.status?m.status:null)}Ln.inherits(kr,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ln.toJSONObject(this.config),code:this.code,status:this.status}}});const Wce=kr.prototype,Zce={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(o=>{Zce[o]={value:o}});Object.defineProperties(kr,Zce);Object.defineProperty(Wce,"isAxiosError",{value:!0});kr.from=(o,s,i,u,m,h)=>{const b=Object.create(Wce);return Ln.toFlatObject(o,b,function(C){return C!==Error.prototype},C=>C!=="isAxiosError"),kr.call(b,o.message,s,i,u,m),b.cause=o,b.name=o.name,h&&Object.assign(b,h),b};const Fhe=null;function Gte(o){return Ln.isPlainObject(o)||Ln.isArray(o)}function Gce(o){return Ln.endsWith(o,"[]")?o.slice(0,-2):o}function Wre(o,s,i){return o?o.concat(s).map(function(u,m){return u=Gce(u),!i&&m?"["+u+"]":u}).join(i?".":""):s}function Lhe(o){return Ln.isArray(o)&&!o.some(Gte)}const Vhe=Ln.toFlatObject(Ln,{},null,function(o){return/^is[A-Z]/.test(o)});function oU(o,s,i){if(!Ln.isObject(o))throw new TypeError("target must be an object");s=s||new FormData,i=Ln.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(I,W){return!Ln.isUndefined(W[I])});const u=i.metaTokens,m=i.visitor||_,h=i.dots,b=i.indexes,C=(i.Blob||typeof Blob<"u"&&Blob)&&Ln.isSpecCompliantForm(s);if(!Ln.isFunction(m))throw new TypeError("visitor must be a function");function S(I){if(I===null)return"";if(Ln.isDate(I))return I.toISOString();if(!C&&Ln.isBlob(I))throw new kr("Blob is not supported. Use a Buffer instead.");return Ln.isArrayBuffer(I)||Ln.isTypedArray(I)?C&&typeof Blob=="function"?new Blob([I]):Buffer.from(I):I}function _(I,W,G){let Q=I;if(I&&!G&&typeof I=="object"){if(Ln.endsWith(W,"{}"))W=u?W:W.slice(0,-2),I=JSON.stringify(I);else if(Ln.isArray(I)&&Lhe(I)||(Ln.isFileList(I)||Ln.endsWith(W,"[]"))&&(Q=Ln.toArray(I)))return W=Gce(W),Q.forEach(function(q,Z){!(Ln.isUndefined(q)||q===null)&&s.append(b===!0?Wre([W],Z,h):b===null?W:W+"[]",S(q))}),!1}return Gte(I)?!0:(s.append(Wre(G,W,h),S(I)),!1)}const N=[],O=Object.assign(Vhe,{defaultVisitor:_,convertValue:S,isVisitable:Gte});function R(I,W){if(!Ln.isUndefined(I)){if(N.indexOf(I)!==-1)throw Error("Circular reference detected in "+W.join("."));N.push(I),Ln.forEach(I,function(G,Q){(!(Ln.isUndefined(G)||G===null)&&m.call(s,G,Ln.isString(Q)?Q.trim():Q,W,O))===!0&&R(G,W?W.concat(Q):[Q])}),N.pop()}}if(!Ln.isObject(o))throw new TypeError("data must be an object");return R(o),s}function Zre(o){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(i){return s[i]})}function Gne(o,s){this._pairs=[],o&&oU(o,this,s)}const qce=Gne.prototype;qce.append=function(o,s){this._pairs.push([o,s])};qce.toString=function(o){const s=o?function(i){return o.call(this,i,Zre)}:Zre;return this._pairs.map(function(i){return s(i[0])+"="+s(i[1])},"").join("&")};function Hhe(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Yce(o,s,i){if(!s)return o;const u=i&&i.encode||Hhe;Ln.isFunction(i)&&(i={serialize:i});const m=i&&i.serialize;let h;if(m?h=m(s,i):h=Ln.isURLSearchParams(s)?s.toString():new Gne(s,i).toString(u),h){const b=o.indexOf("#");b!==-1&&(o=o.slice(0,b)),o+=(o.indexOf("?")===-1?"?":"&")+h}return o}let Gre=class{constructor(){this.handlers=[]}use(s,i,u){return this.handlers.push({fulfilled:s,rejected:i,synchronous:u?u.synchronous:!1,runWhen:u?u.runWhen:null}),this.handlers.length-1}eject(s){this.handlers[s]&&(this.handlers[s]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(s){Ln.forEach(this.handlers,function(i){i!==null&&s(i)})}};const Kce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zhe=typeof URLSearchParams<"u"?URLSearchParams:Gne,Uhe=typeof FormData<"u"?FormData:null,jhe=typeof Blob<"u"?Blob:null,Whe={isBrowser:!0,classes:{URLSearchParams:zhe,FormData:Uhe,Blob:jhe},protocols:["http","https","file","blob","url","data"]},qne=typeof window<"u"&&typeof document<"u",qte=typeof navigator=="object"&&navigator||void 0,Zhe=qne&&(!qte||["ReactNative","NativeScript","NS"].indexOf(qte.product)<0),Ghe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",qhe=qne&&window.location.href||"http://localhost",Yhe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:qne,hasStandardBrowserEnv:Zhe,hasStandardBrowserWebWorkerEnv:Ghe,navigator:qte,origin:qhe},Symbol.toStringTag,{value:"Module"})),Kd={...Yhe,...Whe};function Khe(o,s){return oU(o,new Kd.classes.URLSearchParams,Object.assign({visitor:function(i,u,m,h){return Kd.isNode&&Ln.isBuffer(i)?(this.append(u,i.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)}},s))}function Xhe(o){return Ln.matchAll(/\w+|\[(\w*)]/g,o).map(s=>s[0]==="[]"?"":s[1]||s[0])}function Jhe(o){const s={},i=Object.keys(o);let u;const m=i.length;let h;for(u=0;u<m;u++)h=i[u],s[h]=o[h];return s}function Xce(o){function s(i,u,m,h){let b=i[h++];if(b==="__proto__")return!0;const C=Number.isFinite(+b),S=h>=i.length;return b=!b&&Ln.isArray(m)?m.length:b,S?(Ln.hasOwnProp(m,b)?m[b]=[m[b],u]:m[b]=u,!C):((!m[b]||!Ln.isObject(m[b]))&&(m[b]=[]),s(i,u,m[b],h)&&Ln.isArray(m[b])&&(m[b]=Jhe(m[b])),!C)}if(Ln.isFormData(o)&&Ln.isFunction(o.entries)){const i={};return Ln.forEachEntry(o,(u,m)=>{s(Xhe(u),m,i,0)}),i}return null}function Qhe(o,s,i){if(Ln.isString(o))try{return(s||JSON.parse)(o),Ln.trim(o)}catch(u){if(u.name!=="SyntaxError")throw u}return(0,JSON.stringify)(o)}const wB={transitional:Kce,adapter:["xhr","http","fetch"],transformRequest:[function(o,s){const i=s.getContentType()||"",u=i.indexOf("application/json")>-1,m=Ln.isObject(o);if(m&&Ln.isHTMLForm(o)&&(o=new FormData(o)),Ln.isFormData(o))return u?JSON.stringify(Xce(o)):o;if(Ln.isArrayBuffer(o)||Ln.isBuffer(o)||Ln.isStream(o)||Ln.isFile(o)||Ln.isBlob(o)||Ln.isReadableStream(o))return o;if(Ln.isArrayBufferView(o))return o.buffer;if(Ln.isURLSearchParams(o))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),o.toString();let h;if(m){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Khe(o,this.formSerializer).toString();if((h=Ln.isFileList(o))||i.indexOf("multipart/form-data")>-1){const b=this.env&&this.env.FormData;return oU(h?{"files[]":o}:o,b&&new b,this.formSerializer)}}return m||u?(s.setContentType("application/json",!1),Qhe(o)):o}],transformResponse:[function(o){const s=this.transitional||wB.transitional,i=s&&s.forcedJSONParsing,u=this.responseType==="json";if(Ln.isResponse(o)||Ln.isReadableStream(o))return o;if(o&&Ln.isString(o)&&(i&&!this.responseType||u)){const m=!(s&&s.silentJSONParsing)&&u;try{return JSON.parse(o)}catch(h){if(m)throw h.name==="SyntaxError"?kr.from(h,kr.ERR_BAD_RESPONSE,this,null,this.response):h}}return o}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Kd.classes.FormData,Blob:Kd.classes.Blob},validateStatus:function(o){return o>=200&&o<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ln.forEach(["delete","get","head","post","put","patch"],o=>{wB.headers[o]={}});const e1e=Ln.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),t1e=o=>{const s={};let i,u,m;return o&&o.split(`
1
+ "use strict";var qge=Object.defineProperty;var Yge=(o,s,i)=>s in o?qge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i;var zc=(o,s,i)=>Yge(o,typeof s!="symbol"?s+"":s,i);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("vue"),On=require("element-plus"),Kge="0.0.121";var Xge=Object.defineProperty,Jge=(o,s,i)=>s in o?Xge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i,Bee=(o,s,i)=>Jge(o,typeof s!="symbol"?s+"":s,i);function Pce(o,s){return function(){return o.apply(s,arguments)}}const{toString:Qge}=Object.prototype,{getPrototypeOf:Zne}=Object,eU=(o=>s=>{const i=Qge.call(s);return o[i]||(o[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Rh=o=>(o=o.toLowerCase(),s=>eU(s)===o),tU=o=>s=>typeof s===o,{isArray:w4}=Array,sB=tU("undefined");function ehe(o){return o!==null&&!sB(o)&&o.constructor!==null&&!sB(o.constructor)&&wp(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const Fce=Rh("ArrayBuffer");function the(o){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(o):s=o&&o.buffer&&Fce(o.buffer),s}const nhe=tU("string"),wp=tU("function"),Lce=tU("number"),nU=o=>o!==null&&typeof o=="object",ohe=o=>o===!0||o===!1,KH=o=>{if(eU(o)!=="object")return!1;const s=Zne(o);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)},she=Rh("Date"),rhe=Rh("File"),ahe=Rh("Blob"),ihe=Rh("FileList"),lhe=o=>nU(o)&&wp(o.pipe),che=o=>{let s;return o&&(typeof FormData=="function"&&o instanceof FormData||wp(o.append)&&((s=eU(o))==="formdata"||s==="object"&&wp(o.toString)&&o.toString()==="[object FormData]"))},uhe=Rh("URLSearchParams"),[dhe,fhe,mhe,phe]=["ReadableStream","Request","Response","Headers"].map(Rh),ghe=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function yB(o,s,{allOwnKeys:i=!1}={}){if(o===null||typeof o>"u")return;let u,m;if(typeof o!="object"&&(o=[o]),w4(o))for(u=0,m=o.length;u<m;u++)s.call(null,o[u],u,o);else{const h=i?Object.getOwnPropertyNames(o):Object.keys(o),b=h.length;let C;for(u=0;u<b;u++)C=h[u],s.call(null,o[C],C,o)}}function Vce(o,s){s=s.toLowerCase();const i=Object.keys(o);let u=i.length,m;for(;u-- >0;)if(m=i[u],s===m.toLowerCase())return m;return null}const gE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Hce=o=>!sB(o)&&o!==gE;function Zte(){const{caseless:o}=Hce(this)&&this||{},s={},i=(u,m)=>{const h=o&&Vce(s,m)||m;KH(s[h])&&KH(u)?s[h]=Zte(s[h],u):KH(u)?s[h]=Zte({},u):w4(u)?s[h]=u.slice():s[h]=u};for(let u=0,m=arguments.length;u<m;u++)arguments[u]&&yB(arguments[u],i);return s}const hhe=(o,s,i,{allOwnKeys:u}={})=>(yB(s,(m,h)=>{i&&wp(m)?o[h]=Pce(m,i):o[h]=m},{allOwnKeys:u}),o),vhe=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),bhe=(o,s,i,u)=>{o.prototype=Object.create(s.prototype,u),o.prototype.constructor=o,Object.defineProperty(o,"super",{value:s.prototype}),i&&Object.assign(o.prototype,i)},yhe=(o,s,i,u)=>{let m,h,b;const C={};if(s=s||{},o==null)return s;do{for(m=Object.getOwnPropertyNames(o),h=m.length;h-- >0;)b=m[h],(!u||u(b,o,s))&&!C[b]&&(s[b]=o[b],C[b]=!0);o=i!==!1&&Zne(o)}while(o&&(!i||i(o,s))&&o!==Object.prototype);return s},whe=(o,s,i)=>{o=String(o),(i===void 0||i>o.length)&&(i=o.length),i-=s.length;const u=o.indexOf(s,i);return u!==-1&&u===i},Che=o=>{if(!o)return null;if(w4(o))return o;let s=o.length;if(!Lce(s))return null;const i=new Array(s);for(;s-- >0;)i[s]=o[s];return i},She=(o=>s=>o&&s instanceof o)(typeof Uint8Array<"u"&&Zne(Uint8Array)),xhe=(o,s)=>{const i=(o&&o[Symbol.iterator]).call(o);let u;for(;(u=i.next())&&!u.done;){const m=u.value;s.call(o,m[0],m[1])}},Ehe=(o,s)=>{let i;const u=[];for(;(i=o.exec(s))!==null;)u.push(i);return u},_he=Rh("HTMLFormElement"),khe=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,i,u){return i.toUpperCase()+u}),Ure=(({hasOwnProperty:o})=>(s,i)=>o.call(s,i))(Object.prototype),The=Rh("RegExp"),zce=(o,s)=>{const i=Object.getOwnPropertyDescriptors(o),u={};yB(i,(m,h)=>{let b;(b=s(m,h,o))!==!1&&(u[h]=b||m)}),Object.defineProperties(o,u)},Ahe=o=>{zce(o,(s,i)=>{if(wp(o)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const u=o[i];if(wp(u)){if(s.enumerable=!1,"writable"in s){s.writable=!1;return}s.set||(s.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},Nhe=(o,s)=>{const i={},u=m=>{m.forEach(h=>{i[h]=!0})};return w4(o)?u(o):u(String(o).split(s)),i},Ohe=()=>{},$he=(o,s)=>o!=null&&Number.isFinite(o=+o)?o:s,Ree="abcdefghijklmnopqrstuvwxyz",jre="0123456789",Uce={DIGIT:jre,ALPHA:Ree,ALPHA_DIGIT:Ree+Ree.toUpperCase()+jre},Dhe=(o=16,s=Uce.ALPHA_DIGIT)=>{let i="";const{length:u}=s;for(;o--;)i+=s[Math.random()*u|0];return i};function Mhe(o){return!!(o&&wp(o.append)&&o[Symbol.toStringTag]==="FormData"&&o[Symbol.iterator])}const Bhe=o=>{const s=new Array(10),i=(u,m)=>{if(nU(u)){if(s.indexOf(u)>=0)return;if(!("toJSON"in u)){s[m]=u;const h=w4(u)?[]:{};return yB(u,(b,C)=>{const S=i(b,m+1);!sB(S)&&(h[C]=S)}),s[m]=void 0,h}}return u};return i(o,0)},Rhe=Rh("AsyncFunction"),Ihe=o=>o&&(nU(o)||wp(o))&&wp(o.then)&&wp(o.catch),jce=((o,s)=>o?setImmediate:s?((i,u)=>(gE.addEventListener("message",({source:m,data:h})=>{m===gE&&h===i&&u.length&&u.shift()()},!1),m=>{u.push(m),gE.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",wp(gE.postMessage)),Phe=typeof queueMicrotask<"u"?queueMicrotask.bind(gE):typeof process<"u"&&process.nextTick||jce,Ln={isArray:w4,isArrayBuffer:Fce,isBuffer:ehe,isFormData:che,isArrayBufferView:the,isString:nhe,isNumber:Lce,isBoolean:ohe,isObject:nU,isPlainObject:KH,isReadableStream:dhe,isRequest:fhe,isResponse:mhe,isHeaders:phe,isUndefined:sB,isDate:she,isFile:rhe,isBlob:ahe,isRegExp:The,isFunction:wp,isStream:lhe,isURLSearchParams:uhe,isTypedArray:She,isFileList:ihe,forEach:yB,merge:Zte,extend:hhe,trim:ghe,stripBOM:vhe,inherits:bhe,toFlatObject:yhe,kindOf:eU,kindOfTest:Rh,endsWith:whe,toArray:Che,forEachEntry:xhe,matchAll:Ehe,isHTMLForm:_he,hasOwnProperty:Ure,hasOwnProp:Ure,reduceDescriptors:zce,freezeMethods:Ahe,toObjectSet:Nhe,toCamelCase:khe,noop:Ohe,toFiniteNumber:$he,findKey:Vce,global:gE,isContextDefined:Hce,ALPHABET:Uce,generateString:Dhe,isSpecCompliantForm:Mhe,toJSONObject:Bhe,isAsyncFn:Rhe,isThenable:Ihe,setImmediate:jce,asap:Phe};function kr(o,s,i,u,m){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=o,this.name="AxiosError",s&&(this.code=s),i&&(this.config=i),u&&(this.request=u),m&&(this.response=m,this.status=m.status?m.status:null)}Ln.inherits(kr,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ln.toJSONObject(this.config),code:this.code,status:this.status}}});const Wce=kr.prototype,Zce={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(o=>{Zce[o]={value:o}});Object.defineProperties(kr,Zce);Object.defineProperty(Wce,"isAxiosError",{value:!0});kr.from=(o,s,i,u,m,h)=>{const b=Object.create(Wce);return Ln.toFlatObject(o,b,function(C){return C!==Error.prototype},C=>C!=="isAxiosError"),kr.call(b,o.message,s,i,u,m),b.cause=o,b.name=o.name,h&&Object.assign(b,h),b};const Fhe=null;function Gte(o){return Ln.isPlainObject(o)||Ln.isArray(o)}function Gce(o){return Ln.endsWith(o,"[]")?o.slice(0,-2):o}function Wre(o,s,i){return o?o.concat(s).map(function(u,m){return u=Gce(u),!i&&m?"["+u+"]":u}).join(i?".":""):s}function Lhe(o){return Ln.isArray(o)&&!o.some(Gte)}const Vhe=Ln.toFlatObject(Ln,{},null,function(o){return/^is[A-Z]/.test(o)});function oU(o,s,i){if(!Ln.isObject(o))throw new TypeError("target must be an object");s=s||new FormData,i=Ln.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(I,W){return!Ln.isUndefined(W[I])});const u=i.metaTokens,m=i.visitor||_,h=i.dots,b=i.indexes,C=(i.Blob||typeof Blob<"u"&&Blob)&&Ln.isSpecCompliantForm(s);if(!Ln.isFunction(m))throw new TypeError("visitor must be a function");function S(I){if(I===null)return"";if(Ln.isDate(I))return I.toISOString();if(!C&&Ln.isBlob(I))throw new kr("Blob is not supported. Use a Buffer instead.");return Ln.isArrayBuffer(I)||Ln.isTypedArray(I)?C&&typeof Blob=="function"?new Blob([I]):Buffer.from(I):I}function _(I,W,G){let Q=I;if(I&&!G&&typeof I=="object"){if(Ln.endsWith(W,"{}"))W=u?W:W.slice(0,-2),I=JSON.stringify(I);else if(Ln.isArray(I)&&Lhe(I)||(Ln.isFileList(I)||Ln.endsWith(W,"[]"))&&(Q=Ln.toArray(I)))return W=Gce(W),Q.forEach(function(q,Z){!(Ln.isUndefined(q)||q===null)&&s.append(b===!0?Wre([W],Z,h):b===null?W:W+"[]",S(q))}),!1}return Gte(I)?!0:(s.append(Wre(G,W,h),S(I)),!1)}const N=[],O=Object.assign(Vhe,{defaultVisitor:_,convertValue:S,isVisitable:Gte});function R(I,W){if(!Ln.isUndefined(I)){if(N.indexOf(I)!==-1)throw Error("Circular reference detected in "+W.join("."));N.push(I),Ln.forEach(I,function(G,Q){(!(Ln.isUndefined(G)||G===null)&&m.call(s,G,Ln.isString(Q)?Q.trim():Q,W,O))===!0&&R(G,W?W.concat(Q):[Q])}),N.pop()}}if(!Ln.isObject(o))throw new TypeError("data must be an object");return R(o),s}function Zre(o){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(i){return s[i]})}function Gne(o,s){this._pairs=[],o&&oU(o,this,s)}const qce=Gne.prototype;qce.append=function(o,s){this._pairs.push([o,s])};qce.toString=function(o){const s=o?function(i){return o.call(this,i,Zre)}:Zre;return this._pairs.map(function(i){return s(i[0])+"="+s(i[1])},"").join("&")};function Hhe(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Yce(o,s,i){if(!s)return o;const u=i&&i.encode||Hhe;Ln.isFunction(i)&&(i={serialize:i});const m=i&&i.serialize;let h;if(m?h=m(s,i):h=Ln.isURLSearchParams(s)?s.toString():new Gne(s,i).toString(u),h){const b=o.indexOf("#");b!==-1&&(o=o.slice(0,b)),o+=(o.indexOf("?")===-1?"?":"&")+h}return o}let Gre=class{constructor(){this.handlers=[]}use(s,i,u){return this.handlers.push({fulfilled:s,rejected:i,synchronous:u?u.synchronous:!1,runWhen:u?u.runWhen:null}),this.handlers.length-1}eject(s){this.handlers[s]&&(this.handlers[s]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(s){Ln.forEach(this.handlers,function(i){i!==null&&s(i)})}};const Kce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zhe=typeof URLSearchParams<"u"?URLSearchParams:Gne,Uhe=typeof FormData<"u"?FormData:null,jhe=typeof Blob<"u"?Blob:null,Whe={isBrowser:!0,classes:{URLSearchParams:zhe,FormData:Uhe,Blob:jhe},protocols:["http","https","file","blob","url","data"]},qne=typeof window<"u"&&typeof document<"u",qte=typeof navigator=="object"&&navigator||void 0,Zhe=qne&&(!qte||["ReactNative","NativeScript","NS"].indexOf(qte.product)<0),Ghe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",qhe=qne&&window.location.href||"http://localhost",Yhe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:qne,hasStandardBrowserEnv:Zhe,hasStandardBrowserWebWorkerEnv:Ghe,navigator:qte,origin:qhe},Symbol.toStringTag,{value:"Module"})),Kd={...Yhe,...Whe};function Khe(o,s){return oU(o,new Kd.classes.URLSearchParams,Object.assign({visitor:function(i,u,m,h){return Kd.isNode&&Ln.isBuffer(i)?(this.append(u,i.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)}},s))}function Xhe(o){return Ln.matchAll(/\w+|\[(\w*)]/g,o).map(s=>s[0]==="[]"?"":s[1]||s[0])}function Jhe(o){const s={},i=Object.keys(o);let u;const m=i.length;let h;for(u=0;u<m;u++)h=i[u],s[h]=o[h];return s}function Xce(o){function s(i,u,m,h){let b=i[h++];if(b==="__proto__")return!0;const C=Number.isFinite(+b),S=h>=i.length;return b=!b&&Ln.isArray(m)?m.length:b,S?(Ln.hasOwnProp(m,b)?m[b]=[m[b],u]:m[b]=u,!C):((!m[b]||!Ln.isObject(m[b]))&&(m[b]=[]),s(i,u,m[b],h)&&Ln.isArray(m[b])&&(m[b]=Jhe(m[b])),!C)}if(Ln.isFormData(o)&&Ln.isFunction(o.entries)){const i={};return Ln.forEachEntry(o,(u,m)=>{s(Xhe(u),m,i,0)}),i}return null}function Qhe(o,s,i){if(Ln.isString(o))try{return(s||JSON.parse)(o),Ln.trim(o)}catch(u){if(u.name!=="SyntaxError")throw u}return(0,JSON.stringify)(o)}const wB={transitional:Kce,adapter:["xhr","http","fetch"],transformRequest:[function(o,s){const i=s.getContentType()||"",u=i.indexOf("application/json")>-1,m=Ln.isObject(o);if(m&&Ln.isHTMLForm(o)&&(o=new FormData(o)),Ln.isFormData(o))return u?JSON.stringify(Xce(o)):o;if(Ln.isArrayBuffer(o)||Ln.isBuffer(o)||Ln.isStream(o)||Ln.isFile(o)||Ln.isBlob(o)||Ln.isReadableStream(o))return o;if(Ln.isArrayBufferView(o))return o.buffer;if(Ln.isURLSearchParams(o))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),o.toString();let h;if(m){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Khe(o,this.formSerializer).toString();if((h=Ln.isFileList(o))||i.indexOf("multipart/form-data")>-1){const b=this.env&&this.env.FormData;return oU(h?{"files[]":o}:o,b&&new b,this.formSerializer)}}return m||u?(s.setContentType("application/json",!1),Qhe(o)):o}],transformResponse:[function(o){const s=this.transitional||wB.transitional,i=s&&s.forcedJSONParsing,u=this.responseType==="json";if(Ln.isResponse(o)||Ln.isReadableStream(o))return o;if(o&&Ln.isString(o)&&(i&&!this.responseType||u)){const m=!(s&&s.silentJSONParsing)&&u;try{return JSON.parse(o)}catch(h){if(m)throw h.name==="SyntaxError"?kr.from(h,kr.ERR_BAD_RESPONSE,this,null,this.response):h}}return o}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Kd.classes.FormData,Blob:Kd.classes.Blob},validateStatus:function(o){return o>=200&&o<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ln.forEach(["delete","get","head","post","put","patch"],o=>{wB.headers[o]={}});const e1e=Ln.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),t1e=o=>{const s={};let i,u,m;return o&&o.split(`
2
2
  `).forEach(function(h){m=h.indexOf(":"),i=h.substring(0,m).trim().toLowerCase(),u=h.substring(m+1).trim(),!(!i||s[i]&&e1e[i])&&(i==="set-cookie"?s[i]?s[i].push(u):s[i]=[u]:s[i]=s[i]?s[i]+", "+u:u)}),s},qre=Symbol("internals");function D6(o){return o&&String(o).trim().toLowerCase()}function XH(o){return o===!1||o==null?o:Ln.isArray(o)?o.map(XH):String(o)}function n1e(o){const s=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let u;for(;u=i.exec(o);)s[u[1]]=u[2];return s}const o1e=o=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim());function Iee(o,s,i,u,m){if(Ln.isFunction(u))return u.call(this,s,i);if(m&&(s=i),!!Ln.isString(s)){if(Ln.isString(u))return s.indexOf(u)!==-1;if(Ln.isRegExp(u))return u.test(s)}}function s1e(o){return o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(s,i,u)=>i.toUpperCase()+u)}function r1e(o,s){const i=Ln.toCamelCase(" "+s);["get","set","has"].forEach(u=>{Object.defineProperty(o,u+i,{value:function(m,h,b){return this[u].call(this,s,m,h,b)},configurable:!0})})}let xm=class{constructor(s){s&&this.set(s)}set(s,i,u){const m=this;function h(C,S,_){const N=D6(S);if(!N)throw new Error("header name must be a non-empty string");const O=Ln.findKey(m,N);(!O||m[O]===void 0||_===!0||_===void 0&&m[O]!==!1)&&(m[O||S]=XH(C))}const b=(C,S)=>Ln.forEach(C,(_,N)=>h(_,N,S));if(Ln.isPlainObject(s)||s instanceof this.constructor)b(s,i);else if(Ln.isString(s)&&(s=s.trim())&&!o1e(s))b(t1e(s),i);else if(Ln.isHeaders(s))for(const[C,S]of s.entries())h(S,C,u);else s!=null&&h(i,s,u);return this}get(s,i){if(s=D6(s),s){const u=Ln.findKey(this,s);if(u){const m=this[u];if(!i)return m;if(i===!0)return n1e(m);if(Ln.isFunction(i))return i.call(this,m,u);if(Ln.isRegExp(i))return i.exec(m);throw new TypeError("parser must be boolean|regexp|function")}}}has(s,i){if(s=D6(s),s){const u=Ln.findKey(this,s);return!!(u&&this[u]!==void 0&&(!i||Iee(this,this[u],u,i)))}return!1}delete(s,i){const u=this;let m=!1;function h(b){if(b=D6(b),b){const C=Ln.findKey(u,b);C&&(!i||Iee(u,u[C],C,i))&&(delete u[C],m=!0)}}return Ln.isArray(s)?s.forEach(h):h(s),m}clear(s){const i=Object.keys(this);let u=i.length,m=!1;for(;u--;){const h=i[u];(!s||Iee(this,this[h],h,s,!0))&&(delete this[h],m=!0)}return m}normalize(s){const i=this,u={};return Ln.forEach(this,(m,h)=>{const b=Ln.findKey(u,h);if(b){i[b]=XH(m),delete i[h];return}const C=s?s1e(h):String(h).trim();C!==h&&delete i[h],i[C]=XH(m),u[C]=!0}),this}concat(...s){return this.constructor.concat(this,...s)}toJSON(s){const i=Object.create(null);return Ln.forEach(this,(u,m)=>{u!=null&&u!==!1&&(i[m]=s&&Ln.isArray(u)?u.join(", "):u)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([s,i])=>s+": "+i).join(`
3
3
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(s){return s instanceof this?s:new this(s)}static concat(s,...i){const u=new this(s);return i.forEach(m=>u.set(m)),u}static accessor(s){const i=(this[qre]=this[qre]={accessors:{}}).accessors,u=this.prototype;function m(h){const b=D6(h);i[b]||(r1e(u,h),i[b]=!0)}return Ln.isArray(s)?s.forEach(m):m(s),this}};xm.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ln.reduceDescriptors(xm.prototype,({value:o},s)=>{let i=s[0].toUpperCase()+s.slice(1);return{get:()=>o,set(u){this[i]=u}}});Ln.freezeMethods(xm);function Pee(o,s){const i=this||wB,u=s||i,m=xm.from(u.headers);let h=u.data;return Ln.forEach(o,function(b){h=b.call(i,h,m.normalize(),s?s.status:void 0)}),m.normalize(),h}function Jce(o){return!!(o&&o.__CANCEL__)}function C4(o,s,i){kr.call(this,o??"canceled",kr.ERR_CANCELED,s,i),this.name="CanceledError"}Ln.inherits(C4,kr,{__CANCEL__:!0});function Qce(o,s,i){const u=i.config.validateStatus;!i.status||!u||u(i.status)?o(i):s(new kr("Request failed with status code "+i.status,[kr.ERR_BAD_REQUEST,kr.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function a1e(o){const s=/^([-+\w]{1,25})(:?\/\/|:)/.exec(o);return s&&s[1]||""}function i1e(o,s){o=o||10;const i=new Array(o),u=new Array(o);let m=0,h=0,b;return s=s!==void 0?s:1e3,function(C){const S=Date.now(),_=u[h];b||(b=S),i[m]=C,u[m]=S;let N=h,O=0;for(;N!==m;)O+=i[N++],N=N%o;if(m=(m+1)%o,m===h&&(h=(h+1)%o),S-b<s)return;const R=_&&S-_;return R?Math.round(O*1e3/R):void 0}}function l1e(o,s){let i=0,u=1e3/s,m,h;const b=(C,S=Date.now())=>{i=S,m=null,h&&(clearTimeout(h),h=null),o.apply(null,C)};return[(...C)=>{const S=Date.now(),_=S-i;_>=u?b(C,S):(m=C,h||(h=setTimeout(()=>{h=null,b(m)},u-_)))},()=>m&&b(m)]}const gz=(o,s,i=3)=>{let u=0;const m=i1e(50,250);return l1e(h=>{const b=h.loaded,C=h.lengthComputable?h.total:void 0,S=b-u,_=m(S),N=b<=C;u=b;const O={loaded:b,total:C,progress:C?b/C:void 0,bytes:S,rate:_||void 0,estimated:_&&C&&N?(C-b)/_:void 0,event:h,lengthComputable:C!=null,[s?"download":"upload"]:!0};o(O)},i)},Yre=(o,s)=>{const i=o!=null;return[u=>s[0]({lengthComputable:i,total:o,loaded:u}),s[1]]},Kre=o=>(...s)=>Ln.asap(()=>o(...s)),c1e=Kd.hasStandardBrowserEnv?((o,s)=>i=>(i=new URL(i,Kd.origin),o.protocol===i.protocol&&o.host===i.host&&(s||o.port===i.port)))(new URL(Kd.origin),Kd.navigator&&/(msie|trident)/i.test(Kd.navigator.userAgent)):()=>!0,u1e=Kd.hasStandardBrowserEnv?{write(o,s,i,u,m,h){const b=[o+"="+encodeURIComponent(s)];Ln.isNumber(i)&&b.push("expires="+new Date(i).toGMTString()),Ln.isString(u)&&b.push("path="+u),Ln.isString(m)&&b.push("domain="+m),h===!0&&b.push("secure"),document.cookie=b.join("; ")},read(o){const s=document.cookie.match(new RegExp("(^|;\\s*)("+o+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove(o){this.write(o,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function d1e(o){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o)}function f1e(o,s){return s?o.replace(/\/?\/$/,"")+"/"+s.replace(/^\/+/,""):o}function eue(o,s){return o&&!d1e(s)?f1e(o,s):s}const Xre=o=>o instanceof xm?{...o}:o;function TE(o,s){s=s||{};const i={};function u(_,N,O,R){return Ln.isPlainObject(_)&&Ln.isPlainObject(N)?Ln.merge.call({caseless:R},_,N):Ln.isPlainObject(N)?Ln.merge({},N):Ln.isArray(N)?N.slice():N}function m(_,N,O,R){if(Ln.isUndefined(N)){if(!Ln.isUndefined(_))return u(void 0,_,O,R)}else return u(_,N,O,R)}function h(_,N){if(!Ln.isUndefined(N))return u(void 0,N)}function b(_,N){if(Ln.isUndefined(N)){if(!Ln.isUndefined(_))return u(void 0,_)}else return u(void 0,N)}function C(_,N,O){if(O in s)return u(_,N);if(O in o)return u(void 0,_)}const S={url:h,method:h,data:h,baseURL:b,transformRequest:b,transformResponse:b,paramsSerializer:b,timeout:b,timeoutMessage:b,withCredentials:b,withXSRFToken:b,adapter:b,responseType:b,xsrfCookieName:b,xsrfHeaderName:b,onUploadProgress:b,onDownloadProgress:b,decompress:b,maxContentLength:b,maxBodyLength:b,beforeRedirect:b,transport:b,httpAgent:b,httpsAgent:b,cancelToken:b,socketPath:b,responseEncoding:b,validateStatus:C,headers:(_,N,O)=>m(Xre(_),Xre(N),O,!0)};return Ln.forEach(Object.keys(Object.assign({},o,s)),function(_){const N=S[_]||m,O=N(o[_],s[_],_);Ln.isUndefined(O)&&N!==C||(i[_]=O)}),i}const tue=o=>{const s=TE({},o);let{data:i,withXSRFToken:u,xsrfHeaderName:m,xsrfCookieName:h,headers:b,auth:C}=s;s.headers=b=xm.from(b),s.url=Yce(eue(s.baseURL,s.url),o.params,o.paramsSerializer),C&&b.set("Authorization","Basic "+btoa((C.username||"")+":"+(C.password?unescape(encodeURIComponent(C.password)):"")));let S;if(Ln.isFormData(i)){if(Kd.hasStandardBrowserEnv||Kd.hasStandardBrowserWebWorkerEnv)b.setContentType(void 0);else if((S=b.getContentType())!==!1){const[_,...N]=S?S.split(";").map(O=>O.trim()).filter(Boolean):[];b.setContentType([_||"multipart/form-data",...N].join("; "))}}if(Kd.hasStandardBrowserEnv&&(u&&Ln.isFunction(u)&&(u=u(s)),u||u!==!1&&c1e(s.url))){const _=m&&h&&u1e.read(h);_&&b.set(m,_)}return s},m1e=typeof XMLHttpRequest<"u",p1e=m1e&&function(o){return new Promise(function(s,i){const u=tue(o);let m=u.data;const h=xm.from(u.headers).normalize();let{responseType:b,onUploadProgress:C,onDownloadProgress:S}=u,_,N,O,R,I;function W(){R&&R(),I&&I(),u.cancelToken&&u.cancelToken.unsubscribe(_),u.signal&&u.signal.removeEventListener("abort",_)}let G=new XMLHttpRequest;G.open(u.method.toUpperCase(),u.url,!0),G.timeout=u.timeout;function Q(){if(!G)return;const Z=xm.from("getAllResponseHeaders"in G&&G.getAllResponseHeaders()),L={data:!b||b==="text"||b==="json"?G.responseText:G.response,status:G.status,statusText:G.statusText,headers:Z,config:o,request:G};Qce(function(fe){s(fe),W()},function(fe){i(fe),W()},L),G=null}"onloadend"in G?G.onloadend=Q:G.onreadystatechange=function(){!G||G.readyState!==4||G.status===0&&!(G.responseURL&&G.responseURL.indexOf("file:")===0)||setTimeout(Q)},G.onabort=function(){G&&(i(new kr("Request aborted",kr.ECONNABORTED,o,G)),G=null)},G.onerror=function(){i(new kr("Network Error",kr.ERR_NETWORK,o,G)),G=null},G.ontimeout=function(){let Z=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded";const L=u.transitional||Kce;u.timeoutErrorMessage&&(Z=u.timeoutErrorMessage),i(new kr(Z,L.clarifyTimeoutError?kr.ETIMEDOUT:kr.ECONNABORTED,o,G)),G=null},m===void 0&&h.setContentType(null),"setRequestHeader"in G&&Ln.forEach(h.toJSON(),function(Z,L){G.setRequestHeader(L,Z)}),Ln.isUndefined(u.withCredentials)||(G.withCredentials=!!u.withCredentials),b&&b!=="json"&&(G.responseType=u.responseType),S&&([O,I]=gz(S,!0),G.addEventListener("progress",O)),C&&G.upload&&([N,R]=gz(C),G.upload.addEventListener("progress",N),G.upload.addEventListener("loadend",R)),(u.cancelToken||u.signal)&&(_=Z=>{G&&(i(!Z||Z.type?new C4(null,o,G):Z),G.abort(),G=null)},u.cancelToken&&u.cancelToken.subscribe(_),u.signal&&(u.signal.aborted?_():u.signal.addEventListener("abort",_)));const q=a1e(u.url);if(q&&Kd.protocols.indexOf(q)===-1){i(new kr("Unsupported protocol "+q+":",kr.ERR_BAD_REQUEST,o));return}G.send(m||null)})},g1e=(o,s)=>{const{length:i}=o=o?o.filter(Boolean):[];if(s||i){let u=new AbortController,m;const h=function(_){if(!m){m=!0,C();const N=_ instanceof Error?_:this.reason;u.abort(N instanceof kr?N:new C4(N instanceof Error?N.message:N))}};let b=s&&setTimeout(()=>{b=null,h(new kr(`timeout ${s} of ms exceeded`,kr.ETIMEDOUT))},s);const C=()=>{o&&(b&&clearTimeout(b),b=null,o.forEach(_=>{_.unsubscribe?_.unsubscribe(h):_.removeEventListener("abort",h)}),o=null)};o.forEach(_=>_.addEventListener("abort",h));const{signal:S}=u;return S.unsubscribe=()=>Ln.asap(C),S}},h1e=function*(o,s){let i=o.byteLength;if(i<s){yield o;return}let u=0,m;for(;u<i;)m=u+s,yield o.slice(u,m),u=m},v1e=async function*(o,s){for await(const i of b1e(o))yield*h1e(i,s)},b1e=async function*(o){if(o[Symbol.asyncIterator]){yield*o;return}const s=o.getReader();try{for(;;){const{done:i,value:u}=await s.read();if(i)break;yield u}}finally{await s.cancel()}},Jre=(o,s,i,u)=>{const m=v1e(o,s);let h=0,b,C=S=>{b||(b=!0,u&&u(S))};return new ReadableStream({async pull(S){try{const{done:_,value:N}=await m.next();if(_){C(),S.close();return}let O=N.byteLength;if(i){let R=h+=O;i(R)}S.enqueue(new Uint8Array(N))}catch(_){throw C(_),_}},cancel(S){return C(S),m.return()}},{highWaterMark:2})},sU=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",nue=sU&&typeof ReadableStream=="function",y1e=sU&&(typeof TextEncoder=="function"?(o=>s=>o.encode(s))(new TextEncoder):async o=>new Uint8Array(await new Response(o).arrayBuffer())),oue=(o,...s)=>{try{return!!o(...s)}catch{return!1}},w1e=nue&&oue(()=>{let o=!1;const s=new Request(Kd.origin,{body:new ReadableStream,method:"POST",get duplex(){return o=!0,"half"}}).headers.has("Content-Type");return o&&!s}),Qre=64*1024,Yte=nue&&oue(()=>Ln.isReadableStream(new Response("").body)),hz={stream:Yte&&(o=>o.body)};sU&&(o=>{["text","arrayBuffer","blob","formData","stream"].forEach(s=>{!hz[s]&&(hz[s]=Ln.isFunction(o[s])?i=>i[s]():(i,u)=>{throw new kr(`Response type '${s}' is not supported`,kr.ERR_NOT_SUPPORT,u)})})})(new Response);const C1e=async o=>{if(o==null)return 0;if(Ln.isBlob(o))return o.size;if(Ln.isSpecCompliantForm(o))return(await new Request(Kd.origin,{method:"POST",body:o}).arrayBuffer()).byteLength;if(Ln.isArrayBufferView(o)||Ln.isArrayBuffer(o))return o.byteLength;if(Ln.isURLSearchParams(o)&&(o=o+""),Ln.isString(o))return(await y1e(o)).byteLength},S1e=async(o,s)=>Ln.toFiniteNumber(o.getContentLength())??C1e(s),x1e=sU&&(async o=>{let{url:s,method:i,data:u,signal:m,cancelToken:h,timeout:b,onDownloadProgress:C,onUploadProgress:S,responseType:_,headers:N,withCredentials:O="same-origin",fetchOptions:R}=tue(o);_=_?(_+"").toLowerCase():"text";let I=g1e([m,h&&h.toAbortSignal()],b),W;const G=I&&I.unsubscribe&&(()=>{I.unsubscribe()});let Q;try{if(S&&w1e&&i!=="get"&&i!=="head"&&(Q=await S1e(N,u))!==0){let Ve=new Request(s,{method:"POST",body:u,duplex:"half"}),Ce;if(Ln.isFormData(u)&&(Ce=Ve.headers.get("content-type"))&&N.setContentType(Ce),Ve.body){const[Y,Re]=Yre(Q,gz(Kre(S)));u=Jre(Ve.body,Qre,Y,Re)}}Ln.isString(O)||(O=O?"include":"omit");const q="credentials"in Request.prototype;W=new Request(s,{...R,signal:I,method:i.toUpperCase(),headers:N.normalize().toJSON(),body:u,duplex:"half",credentials:q?O:void 0});let Z=await fetch(W);const L=Yte&&(_==="stream"||_==="response");if(Yte&&(C||L&&G)){const Ve={};["status","statusText","headers"].forEach(it=>{Ve[it]=Z[it]});const Ce=Ln.toFiniteNumber(Z.headers.get("content-length")),[Y,Re]=C&&Yre(Ce,gz(Kre(C),!0))||[];Z=new Response(Jre(Z.body,Qre,Y,()=>{Re&&Re(),G&&G()}),Ve)}_=_||"text";let fe=await hz[Ln.findKey(hz,_)||"text"](Z,o);return!L&&G&&G(),await new Promise((Ve,Ce)=>{Qce(Ve,Ce,{data:fe,headers:xm.from(Z.headers),status:Z.status,statusText:Z.statusText,config:o,request:W})})}catch(q){throw G&&G(),q&&q.name==="TypeError"&&/fetch/i.test(q.message)?Object.assign(new kr("Network Error",kr.ERR_NETWORK,o,W),{cause:q.cause||q}):kr.from(q,q&&q.code,o,W)}}),Kte={http:Fhe,xhr:p1e,fetch:x1e};Ln.forEach(Kte,(o,s)=>{if(o){try{Object.defineProperty(o,"name",{value:s})}catch{}Object.defineProperty(o,"adapterName",{value:s})}});const eae=o=>`- ${o}`,E1e=o=>Ln.isFunction(o)||o===null||o===!1,sue={getAdapter:o=>{o=Ln.isArray(o)?o:[o];const{length:s}=o;let i,u;const m={};for(let h=0;h<s;h++){i=o[h];let b;if(u=i,!E1e(i)&&(u=Kte[(b=String(i)).toLowerCase()],u===void 0))throw new kr(`Unknown adapter '${b}'`);if(u)break;m[b||"#"+h]=u}if(!u){const h=Object.entries(m).map(([C,S])=>`adapter ${C} `+(S===!1?"is not supported by the environment":"is not available in the build"));let b=s?h.length>1?`since :
4
4
  `+h.map(eae).join(`
@@ -123,7 +123,7 @@ Required: `+j.join(", "));return ar[In].apply(null,Yo)},log:ar=>{console.log(ar,
123
123
  * Licensed under the Tiny commercial license. See https://www.tiny.cloud/legal/
124
124
  *
125
125
  * Version: 7.9.1-173
126
- */(function(){const o=$e=>Ze=>($t=>{const Dt=typeof $t;return $t===null?"null":Dt==="object"&&Array.isArray($t)?"array":Dt==="object"&&(gn=yn=$t,(Ot=String).prototype.isPrototypeOf(gn)||((_t=yn.constructor)===null||_t===void 0?void 0:_t.name)===Ot.name)?"string":Dt;var gn,yn,Ot,_t})(Ze)===$e,s=$e=>Ze=>typeof Ze===$e,i=o("string"),u=o("array"),m=s("boolean"),h=$e=>$e===void 0,b=$e=>!(Ze=>Ze==null)($e),C=s("function"),S=s("number"),_=$e=>()=>$e,N=$e=>$e,O=_(!1),R=_(!0);class I{constructor(Ze,$t){this.tag=Ze,this.value=$t}static some(Ze){return new I(!0,Ze)}static none(){return I.singletonNone}fold(Ze,$t){return this.tag?$t(this.value):Ze()}isSome(){return this.tag}isNone(){return!this.tag}map(Ze){return this.tag?I.some(Ze(this.value)):I.none()}bind(Ze){return this.tag?Ze(this.value):I.none()}exists(Ze){return this.tag&&Ze(this.value)}forall(Ze){return!this.tag||Ze(this.value)}filter(Ze){return!this.tag||Ze(this.value)?this:I.none()}getOr(Ze){return this.tag?this.value:Ze}or(Ze){return this.tag?this:Ze}getOrThunk(Ze){return this.tag?this.value:Ze()}orThunk(Ze){return this.tag?this:Ze()}getOrDie(Ze){if(this.tag)return this.value;throw new Error(Ze??"Called getOrDie on None")}static from(Ze){return b(Ze)?I.some(Ze):I.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(Ze){this.tag&&Ze(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}I.singletonNone=new I(!1);const W=Array.prototype.indexOf,G=Array.prototype.push,Q=($e,Ze)=>(($t,Dt)=>W.call($t,Dt))($e,Ze)>-1,q=($e,Ze)=>{for(let $t=0,Dt=$e.length;$t<Dt;$t++)if(Ze($e[$t],$t))return!0;return!1},Z=($e,Ze)=>{const $t=$e.length,Dt=new Array($t);for(let gn=0;gn<$t;gn++){const yn=$e[gn];Dt[gn]=Ze(yn,gn)}return Dt},L=($e,Ze)=>{const $t=[];for(let Dt=0,gn=$e.length;Dt<gn;Dt++){const yn=$e[Dt];Ze(yn,Dt)&&$t.push(yn)}return $t},fe=($e,Ze)=>(($t,Dt,gn)=>{for(let yn=0,Ot=$t.length;yn<Ot;yn++){const _t=$t[yn];if(Dt(_t,yn))return I.some(_t);if(gn(_t,yn))break}return I.none()})($e,Ze,O),Ve=($e,Ze)=>($t=>{const Dt=[];for(let gn=0,yn=$t.length;gn<yn;++gn){if(!u($t[gn]))throw new Error("Arr.flatten item "+gn+" was not an array, input: "+$t);G.apply(Dt,$t[gn])}return Dt})(Z($e,Ze)),Ce=Object.keys,Y=Object.hasOwnProperty,Re=($e,Ze)=>{const $t=Ce($e);for(let Dt=0,gn=$t.length;Dt<gn;Dt++){const yn=$t[Dt];Ze($e[yn],yn)}},it=($e,Ze)=>{const $t={};return Re($e,(Dt,gn)=>{const yn=Ze(Dt,gn);$t[yn.k]=yn.v}),$t},Je=$e=>(Ze,$t)=>{$e[$t]=Ze},_e=$e=>((Ze,$t)=>{const Dt=[];return Re(Ze,(gn,yn)=>{Dt.push($t(gn,yn))}),Dt})($e,N),ue=($e,Ze)=>It($e,Ze)?I.from($e[Ze]):I.none(),It=($e,Ze)=>Y.call($e,Ze),pe=$e=>{let Ze=$e;return{get:()=>Ze,set:$t=>{Ze=$t}}},be=($e,Ze,$t=0,Dt)=>{const gn=$e.indexOf(Ze,$t);return gn!==-1&&(!!h(Dt)||gn+Ze.length<=Dt)},$=$e=>parseInt($e,10),ke=($e,Ze)=>{const $t=$e-Ze;return $t===0?0:$t>0?1:-1},le=($e,Ze,$t)=>({major:$e,minor:Ze,patch:$t}),qe=$e=>{const Ze=/([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec($e);return Ze?le($(Ze[1]),$(Ze[2]),$(Ze[3])):le(0,0,0)},Xe=()=>ce(0,0),ce=($e,Ze)=>({major:$e,minor:Ze}),Ue={nu:ce,detect:($e,Ze)=>{const $t=String(Ze).toLowerCase();return $e.length===0?Xe():((Dt,gn)=>{const yn=((_t,Ye)=>{for(let et=0;et<_t.length;et++){const jt=_t[et];if(jt.test(Ye))return jt}})(Dt,gn);if(!yn)return{major:0,minor:0};const Ot=_t=>Number(gn.replace(yn,"$"+_t));return ce(Ot(1),Ot(2))})($e,$t)},unknown:Xe},wt=($e,Ze)=>{const $t=String(Ze).toLowerCase();return fe($e,Dt=>Dt.search($t))},He=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,mt=$e=>Ze=>be(Ze,$e),Ie=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:$e=>be($e,"edge/")&&be($e,"chrome")&&be($e,"safari")&&be($e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,He],search:$e=>be($e,"chrome")&&!be($e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:$e=>be($e,"msie")||be($e,"trident")},{name:"Opera",versionRegexes:[He,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:mt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:mt("firefox")},{name:"Safari",versionRegexes:[He,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:$e=>(be($e,"safari")||be($e,"mobile/"))&&be($e,"applewebkit")}],pt=[{name:"Windows",search:mt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:$e=>be($e,"iphone")||be($e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:mt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:mt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:mt("linux"),versionRegexes:[]},{name:"Solaris",search:mt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:mt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:mt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],oe={browsers:_(Ie),oses:_(pt)},mn=$e=>{const Ze=$e.current,$t=$e.version,Dt=gn=>()=>Ze===gn;return{current:Ze,version:$t,isEdge:Dt("Edge"),isChromium:Dt("Chromium"),isIE:Dt("IE"),isOpera:Dt("Opera"),isFirefox:Dt("Firefox"),isSafari:Dt("Safari")}},gt=()=>mn({current:void 0,version:Ue.unknown()}),St=mn,Wt=$e=>{const Ze=$e.current,$t=$e.version,Dt=gn=>()=>Ze===gn;return{current:Ze,version:$t,isWindows:Dt("Windows"),isiOS:Dt("iOS"),isAndroid:Dt("Android"),isMacOS:Dt("macOS"),isLinux:Dt("Linux"),isSolaris:Dt("Solaris"),isFreeBSD:Dt("FreeBSD"),isChromeOS:Dt("ChromeOS")}},Et=()=>Wt({current:void 0,version:Ue.unknown()}),te=Wt,ie=($e,Ze,$t)=>{const Dt=oe.browsers(),gn=oe.oses(),yn=Ze.bind(Ye=>((et,jt)=>((nn,Dn)=>{for(let jn=0;jn<nn.length;jn++){const Yn=Dn(nn[jn]);if(Yn.isSome())return Yn}return I.none()})(jt.brands,nn=>{const Dn=nn.brand.toLowerCase();return fe(et,jn=>{var Yn;return Dn===((Yn=jn.brand)===null||Yn===void 0?void 0:Yn.toLowerCase())}).map(jn=>({current:jn.name,version:Ue.nu(parseInt(nn.version,10),0)}))}))(Dt,Ye)).orThunk(()=>((Ye,et)=>wt(Ye,et).map(jt=>{const nn=Ue.detect(jt.versionRegexes,et);return{current:jt.name,version:nn}}))(Dt,$e)).fold(gt,St),Ot=((Ye,et)=>wt(Ye,et).map(jt=>{const nn=Ue.detect(jt.versionRegexes,et);return{current:jt.name,version:nn}}))(gn,$e).fold(Et,te),_t=((Ye,et,jt,nn)=>{const Dn=Ye.isiOS()&&/ipad/i.test(jt)===!0,jn=Ye.isiOS()&&!Dn,Yn=Ye.isiOS()||Ye.isAndroid(),Wn=Yn||nn("(pointer:coarse)"),go=Dn||!jn&&Yn&&nn("(min-device-width:768px)"),ko=jn||Yn&&!go,qo=et.isSafari()&&Ye.isiOS()&&/safari/i.test(jt)===!1,Ms=!ko&&!go&&!qo;return{isiPad:_(Dn),isiPhone:_(jn),isTablet:_(go),isPhone:_(ko),isTouch:_(Wn),isAndroid:Ye.isAndroid,isiOS:Ye.isiOS,isWebView:_(qo),isDesktop:_(Ms)}})(Ot,yn,$e,$t);return{browser:yn,os:Ot,deviceType:_t}},me=$e=>window.matchMedia($e).matches;let X=($e=>{let Ze,$t=!1;return(...Dt)=>($t||($t=!0,Ze=$e.apply(null,Dt)),Ze)})(()=>ie(window.navigator.userAgent,I.from(window.navigator.userAgentData),me));const Se=()=>X(),Pe=$e=>{if($e==null)throw new Error("Node cannot be null or undefined");return{dom:$e}},Fe=Pe,vt=($e,Ze)=>$e.dom===Ze.dom,Qe=($e,Ze)=>{const $t=$e.dom;if($t.nodeType!==1)return!1;{const Dt=$t;if(Dt.matches!==void 0)return Dt.matches(Ze);if(Dt.msMatchesSelector!==void 0)return Dt.msMatchesSelector(Ze);if(Dt.webkitMatchesSelector!==void 0)return Dt.webkitMatchesSelector(Ze);if(Dt.mozMatchesSelector!==void 0)return Dt.mozMatchesSelector(Ze);throw new Error("Browser lacks native selectors")}},yt=$e=>Ze=>($t=>$t.dom.nodeType)(Ze)===$e,Ft=yt(1),bn=yt(3),Tt=yt(11),Ht=$e=>Fe($e.dom.host),vn=($e,Ze,$t)=>{((Dt,gn,yn)=>{if(!(i(yn)||m(yn)||S(yn)))throw console.error("Invalid call to Attribute.set. Key ",gn,":: Value ",yn,":: Element ",Dt),new Error("Attribute value was not simple");Dt.setAttribute(gn,yn+"")})($e.dom,Ze,$t)},kn=($e,Ze)=>{const $t=$e.dom.getAttribute(Ze);return $t===null?void 0:$t},Eo=($e,Ze)=>{$e.dom.removeAttribute(Ze)},to=$e=>{const Ze=bn($e)?$e.dom.parentNode:$e.dom;if(Ze==null||Ze.ownerDocument===null)return!1;const $t=Ze.ownerDocument;return(yn=>{const Ot=(Ye=>Fe(Ye.dom.getRootNode()))(yn);return Tt(_t=Ot)&&b(_t.dom.host)?I.some(Ot):I.none();var _t})(Fe(Ze)).fold(()=>$t.body.contains(Ze),(Dt=to,gn=Ht,yn=>Dt(gn(yn))));var Dt,gn},Rt=($e,Ze)=>{const $t=$e.dom,Dt=window.getComputedStyle($t).getPropertyValue(Ze);return Dt!==""||to($e)?Dt:dn($t,Ze)},dn=($e,Ze)=>($t=>$t.style!==void 0&&C($t.style.getPropertyValue))($e)?$e.style.getPropertyValue(Ze):"",an=($e,Ze)=>{const $t=kn($e,Ze);return $t===void 0||$t===""?[]:$t.split(" ")},Bn=($e,Ze,$t)=>{let Dt=$e.dom;const gn=C($t)?$t:O;for(;Dt.parentNode;){Dt=Dt.parentNode;const yn=Fe(Dt);if(Ze(yn))return I.some(yn);if(gn(yn))break}return I.none()},_o=($e,Ze,$t)=>((Dt,gn,yn,Ot,_t)=>Ot(yn)?I.some(yn):C(_t)&&_t(yn)?I.none():gn(yn,Ot,_t))(0,Bn,$e,Ze,$t),Do=$e=>$e.dom.classList!==void 0,ms=$e=>an($e,"class"),Co=($e,Ze)=>{Do($e)?$e.dom.classList.remove(Ze):(($t,Dt)=>{((gn,yn,Ot)=>{const _t=L(an(gn,yn),Ye=>Ye!==Ot);_t.length>0?vn(gn,yn,_t.join(" ")):Eo(gn,yn)})($t,"class",Dt)})($e,Ze),($t=>{(Do($t)?$t.dom.classList:ms($t)).length===0&&Eo($t,"class")})($e)},Is=($e,Ze)=>{$e.dispatch("FormatPainterToggle",{state:Ze})};var pn,Lo,js,Hs;(function($e){$e.Retrival="Retrieval",$e.Application="Application"})(pn||(pn={})),function($e){$e.ListSchema="ListSchema",$e.SubstitutionSchema="SubstitionSchema"}(Lo||(Lo={})),function($e){$e.InsertUnorderedList="InsertUnorderedList",$e.InsertOrderedList="InsertOrderedList",$e.InsertDefinitionList="InsertDefinitionList"}(js||(js={})),function($e){$e.Table="Table",$e.Unspecified="Unspecified"}(Hs||(Hs={}));const Tr=$e=>{var Ze,$t;Ze=Fe($e.getBody()),$t="tox-cursor-format-painter",Do(Ze)?Ze.dom.classList.add($t):((Dt,gn)=>{((yn,Ot,_t)=>{const Ye=an(yn,Ot).concat([_t]);vn(yn,Ot,Ye.join(" "))})(Dt,"class",gn)})(Ze,$t)},vr=($e,Ze)=>{($t=>{Co(Fe($t.getBody()),"tox-cursor-format-painter")})($e),Ze.set(pn.Retrival),Is($e,!1)},_s={formatpainter_checklist:{selector:"ul",classes:"tox-checklist"},formatpainter_liststyletype:{selector:"ul,ol",styles:{listStyleType:"%value"}},formatpainter_borderstyle:{selector:"td,th",styles:{borderTopStyle:"%valueTop",borderRightStyle:"%valueRight",borderBottomStyle:"%valueBottom",borderLeftStyle:"%valueLeft"},remove_similar:!0},formatpainter_bordercolor:{selector:"td,th",styles:{borderTopColor:"%valueTop",borderRightColor:"%valueRight",borderBottomColor:"%valueBottom",borderLeftColor:"%valueLeft"},remove_similar:!0},formatpainter_backgroundcolor:{selector:"td,th",styles:{backgroundColor:"%value"},remove_similar:!0},formatpainter_removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*:not(tr,td,th,table)",attributes:["style","class"],split:!1,expand:!1,deep:!0}],formatpainter_legacy_font:{inline:"font",attributes:{size:"%value"}}},br=($e,Ze)=>ue(Ze,"selector").exists($t=>{const Dt=$e.getBody(),gn=$e.selection.getStart(),yn=$e.dom.getParents(gn,R,Dt),Ot=$e.selection.getSelectedBlocks();return $e.dom.is([...yn,...Ot],$t)}),Dr=$e=>$e.length>1&&$e.charAt(0)==="%",ps=($e,Ze)=>ue($e,Ze).filter($t=>!u($t)),po=$e=>Qe($e,"OL,UL,DL"),Ds=$e=>Qe($e,"LI,DT,DD"),Nt=$e=>$e.replace(/([A-Z])/g,Ze=>`-${Ze[0].toLowerCase()}`),Gt=($e,Ze,$t)=>{const Dt=$e.formatter,gn=((Ye,et)=>q(Ye.formatter.get(et),jt=>((nn,Dn)=>It(Dn,"inline")&&!br(nn,Dn))(Ye,jt)))($e,$t.formatName),yn=((Ye,et,jt)=>q(et.get(jt),nn=>((Dn,jn)=>It(jn,"block")||br(Dn,jn))(Ye,nn)))($e,Dt,$t.formatName),Ot=(_t=$t.formatName,Q(["formatpainter_borderstyle","formatpainter_bordercolor","formatpainter_backgroundcolor"],_t));var _t;(Ze.table&&Ot||gn||Ze.block&&yn&&!Ot)&&Dt.apply($t.formatName,$t.substitutedVariables)},Un=$e=>{const Ze=$e.selection,$t=Ze.getRng(),Dt=Fe($e.getBody()),gn=(_t=>L(_t.selection.getSelectedBlocks().map(Fe),Ds))($e),yn=$t.collapsed&&gn.length,Ot=gn.length&&!((_t,Ye)=>{const et=jn=>vt(jn,Ye);return(jt=_o(Fe(_t.getStart()),po,et),nn=_o(Fe(_t.getEnd()),po,et),Dn=(jn,Yn)=>vt(jn,Yn),jt.isSome()&&nn.isSome()?I.some(Dn(jt.getOrDie(),nn.getOrDie())):I.none()).getOr(!1);var jt,nn,Dn})(Ze,Dt);return gn.length>1||yn||Ot},uo=$e=>$e.options.get("formatpainter_ignored_formats"),Fo=($e,Ze)=>{return Ze==="class"?(gn=>Do(gn)?(yn=>{const Ot=yn.dom.classList,_t=new Array(Ot.length);for(let Ye=0;Ye<Ot.length;Ye++){const et=Ot.item(Ye);et!==null&&(_t[Ye]=et)}return _t})(gn):ms(gn))($e).filter(gn=>!/^(mce-.*)/.test(gn)).join(" "):($t=$e,Dt=Ze,I.from(kn($t,Dt))).getOr("");var $t,Dt},ss=$e=>((Ze,$t)=>{const Dt={},gn={};return((yn,Ot,_t,Ye)=>{Re(yn,(et,jt)=>{(Ot(et,jt)?_t:Ye)(et,jt)})})(Ze,$t,Je(Dt),Je(gn)),{t:Dt,f:gn}})($e,Ze=>{return($t=Ze).length>1&&$t.charAt(0)==="%";var $t}).t,ur=($e,Ze)=>($t=>{const Dt=uo($t);return Ce($t.formatter.get()).filter(gn=>!Q(Dt,gn))})($e).filter($t=>{const Dt=((gn,yn)=>q(gn.formatter.get(yn),Ot=>(_t=>{const Ye=ps(_t,"styles").exists(jt=>q(_e(jt),Dr)),et=ps(_t,"attributes").exists(jt=>q(_e(jt),Dr));return Ye||et})(Ot)))($e,$t);return $e.formatter.matchNode(Ze.dom,$t,{},Dt)}),dr=($e,Ze)=>{const $t=Z($e.dom.getParents(Ze,R),Fe);return Ve(L($t,Ft),Dt=>Ve(ur($e,Dt),gn=>((yn,Ot,_t)=>{return(Ye=yn.get(Ot),(et=>0<et.length?I.some(et[0]):I.none())(Ye)).bind(et=>((jt,nn)=>{const Dn=ps(jt,"styles").map(Wn=>{return go=nn,ko=ss(Wn),it(ko,(qo,Ms)=>({k:qo.slice(1,qo.length),v:Rt(go,Nt(Ms))}));var go,ko}),jn=ps(jt,"attributes").map(Wn=>{return go=nn,ko=ss(Wn),it(ko,(qo,Ms)=>({k:qo.slice(1,qo.length),v:Fo(go,Ms)}));var go,ko}),Yn={...Dn.getOr({}),...jn.getOr({})};return _e(Yn).every(Wn=>Wn!=="")?I.some(Yn):I.none()})(et,_t)).map(et=>({kind:Lo.SubstitutionSchema,formatName:Ot,substitutedVariables:et}));var Ye})($e.formatter,gn,Dt).toArray()))},or=$e=>(Ze=>fe(_e(js),$t=>Ze.queryCommandState($t)))($e).map(Ze=>({kind:Lo.ListSchema,command:Ze})),rt=($e,Ze)=>$e.getParent(Ze,"TABLE")?Hs.Table:Hs.Unspecified,nt=($e,Ze,$t)=>{$e.addCommand("mceToggleFormatPainter",()=>{((Dt,gn)=>{gn.get()===pn.Application?vr(Dt,gn):((yn,Ot)=>{const _t=Se(),Ye=pe(!1);Tr(yn),Ot.set(pn.Application),Is(yn,!0),yn.execCommand("mceRetrieveFormats");const et=()=>{yn.execCommand("mcePaintFormats"),vr(yn,Ot)},jt=()=>{Ot.get()===pn.Application&&et(),Yn()},nn=Wn=>{Ot.get()===pn.Application&&(Wn.type==="touchcancel"&&_t.os.isAndroid()?yn.once("contextmenu",et):Ye.get()?et():yn.once("selectionchange",et)),Yn()},Dn=Wn=>{Wn.keyCode===27&&(vr(yn,Ot),Yn())},jn=Wn=>{Ye.set(Wn.type==="touchmove")};yn.on("click",jt),yn.on("touchstart touchmove",jn),yn.on("touchend touchcancel",nn),yn.on("keydown",Dn);const Yn=()=>{yn.off("click",jt),yn.off("touchstart touchmove",jn),yn.off("touchend touchcancel",nn),yn.off("keydown",Dn)}})(Dt,gn)})($e,Ze)}),$e.addCommand("mcePaintFormats",()=>{$e.selection.isEditable()&&$e.undoManager.transact(()=>{((Dt,gn)=>{((Ot,_t)=>{Ot.formatter.remove("formatpainter_removeformat"),_t===Hs.Table&&(Ye=>{for(let jt=0,nn=Ye.length;jt<nn;jt++)et=Ye[jt],Ot.formatter.remove(et);var et})(["formatpainter_borderstyle","formatpainter_bordercolor","formatpainter_backgroundcolor"]),Un(Ot)&&Ot.execCommand("RemoveList")})(Dt,gn.context);const yn=(Ot=>{const _t=Ot.selection.getStart(),Ye=Ot.selection.getRng().collapsed,et=Ot.dom.select("td[data-mce-selected]").length>0,jt=!!Ot.dom.getParent(_t,"TABLE");return{inline:!0,table:Ye&&jt||et,block:Ye||(nn=Ot.selection,nn.getSelectedBlocks().length>1)||et};var nn})(Dt);gn.schemas.forEach(Ot=>{switch(Ot.kind){case Lo.ListSchema:((_t,Ye,et)=>{et.block&&_t.execCommand(Ye.command)})(Dt,Ot,yn);break;case Lo.SubstitutionSchema:Gt(Dt,yn,Ot)}})})($e,$t.get())})}),$e.addCommand("mceRetrieveFormats",()=>{$t.set((Dt=>{const gn=Dt.dom,yn=Dt.selection.getStart();return{schemas:[...or(Dt).toArray(),...dr(Dt,yn)],context:rt(gn,yn)}})($e))})};tinymce.PluginManager.add("formatpainter",$e=>{if(((Dt,gn)=>!!Dt&&((yn,Ot)=>{const _t=ke(yn.major,Ot.major);if(_t!==0)return _t;const Ye=ke(yn.minor,Ot.minor);if(Ye!==0)return Ye;const et=ke(yn.patch,Ot.patch);return et!==0?et:0})((yn=>qe((Ot=>[Ot.majorVersion,Ot.minorVersion].join(".").split(".").slice(0,3).join("."))(yn)))(Dt),qe(gn))===-1)(tinymce,"6.0.0"))return void window.console.error("The format painter plugin requires at least version 6.0.0 of TinyMCE.");const Ze=pe(pn.Retrival),$t=pe({schemas:[],context:Hs.Unspecified});(Dt=>{(0,Dt.options.register)("formatpainter_ignored_formats",{processor:"string[]",default:"link,address,removeformat,formatpainter_removeformat".split(",")})})($e),(Dt=>{Dt.on("PreInit",()=>{Re(_s,(gn,yn)=>{Dt.formatter.get(yn)||Dt.formatter.register(yn,gn)})})})($e),nt($e,Ze,$t),(Dt=>{Dt.ui.registry.addToggleButton("formatpainter",{active:!1,icon:"format-painter",tooltip:"Format painter",onAction:()=>Dt.execCommand("mceToggleFormatPainter"),onSetup:gn=>{const yn=Ot=>{gn.setActive(Ot.state)};return Dt.on("FormatPainterToggle",yn),()=>Dt.off("FormatPainterToggle",yn)}})})($e),((Dt,gn)=>{Dt.ui.registry.addToggleMenuItem("formatpainter",{active:!1,icon:"format-painter",text:"Format painter",onAction:()=>Dt.execCommand("mceToggleFormatPainter"),onSetup:yn=>{const Ot=_t=>{yn.setActive(_t.state)};return yn.setActive(gn.get()===pn.Application),Dt.on("FormatPainterToggle",Ot),()=>Dt.off("FormatPainterToggle",Ot)}})})($e,Ze),(Dt=>{Dt.addShortcut("Meta+alt+C","",()=>{Dt.execCommand("mceRetrieveFormats")}),Dt.addShortcut("Meta+alt+V","",()=>{Dt.execCommand("mcePaintFormats")})})($e)})})();const xfe=["accordion","advlist","anchor","autolink","autosave","charmap","code","codesample","directionality","importcss","insertdatetime","link","lists","image","media","nonbreaking","pagebreak","preview","quickbars","save","searchreplace","table","visualblocks","fullscreen","visualchars","wordcount","pasteprocess","formatpainter"],s6e="undo redo h1 h2 h3 bold italic underline strikethrough subscript superscript fontsize fontFamily lineheight forecolor backcolor alignleft aligncenter alignright alignjustify pagebreak bullist numlist outdent indent blockquotelink unlink image code removeformat formatpainter fullscreen preview ",Efe="file edit insert table tools help",r6e={menu:{pagesize:{title:"页面大小",items:n6e},orientation:{title:"页面方向",items:o6e}},menubar:Efe+" pagesize orientation",pagesize:"A4",orientation:"portrait",plugins:[...xfe,"pagesize"]},a6e={license_key:"gpl",skin:!1,content_css:["css/content.css","css/reset.css"],promotion:!1,menubar:Efe,cleanup:!0,branding:!1,language:"zh_CN",plugins:xfe,toolbar:s6e,fontsize_formats:"12px 14px 16px 18px 20px 22px 24px 28px 32px 36px 48px 56px 72px",font_formats:"微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;",lineheight_formats:"0.5 0.8 1 1.2 1.5 1.75 2 2.5 3 4 5",elementpath:!1,paste_data_images:!0,object_resizing:!0,toolbar_mode:"wrap",images_upload_handler:o=>new Promise((s,i)=>{const u=new FormData;u.append("files",o.blob(),o.filename()),fetch(`${process.env.NODE_ENV==="development"?"/api":""}/ajax/uploaddoc`,{method:"POST",body:u}).then(m=>m.json()).then(m=>{m.status===1?s(m.file_url):i(`上传失败: ${m.message}`)}).catch(m=>{i(`上传出错: ${m.message}`)})})},i6e={name:"ProEditor",components:{Editor:IMe},props:{modelValue:{type:String,default:""},pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},hasPagesize:{type:Boolean,default:!1},placeholder:{type:String,default:"请输入内容"},width:{type:[Number,String],default:"100%"},height:{type:Number,default:400}},setup(o,{emit:s}){Em(o.modelValue);const i=d.ref(null),u=d.reactive({myInit:h(a6e),contentValue:o.modelValue,timeout:null});d.onMounted(()=>{K6.init({license_key:"gpl"}),K6.activeEditor.on("pagesizechange",b=>{(o==null?void 0:o.pagesize)!==b.size&&s("update:pagesize",b.size)}),K6.activeEditor.on("orientationchange",b=>{(o==null?void 0:o.orientation)!==b.orientation&&s("update:orientation",b.orientation)})}),d.watch(()=>u.contentValue,()=>{m(()=>{s("update:modelValue",u.contentValue)})}),d.watch(()=>o.orientation,()=>{var b,C;i.value&&((C=(b=i.value)==null?void 0:b.getEditor)==null||C.call(b).fire("orientationchange",{orientation:o.orientation}))}),d.watch(()=>o.pagesize,()=>{var b,C;i.value&&((C=(b=i.value)==null?void 0:b.getEditor)==null||C.call(b).fire("pagesizechange",{size:o.pagesize}))}),d.watch(()=>o.modelValue,b=>{!dB(b)&&b!==u.contentValue&&(u.contentValue=b)}),d.watch(()=>o.height,b=>{var C,S,_,N,O,R,I,W;i.value&&((W=(N=(_=(S=(C=i.value)==null?void 0:C.getEditor)==null?void 0:S.call(C))==null?void 0:_.dom)==null?void 0:N.setStyle)==null||W.call(N,(I=(R=(O=i.value)==null?void 0:O.getEditor)==null?void 0:R.call(O))==null?void 0:I.editorContainer,"height",b+"px"))});function m(b,C=400){u.timeout!==null&&clearTimeout(u.timeout),u.timeout=setTimeout(b,C)}function h(b){var O;o!=null&&o.height&&(b.height=o.height),o!=null&&o.width&&(b.width=o.width);const{placeholder:C,pagesize:S,orientation:_}=o,N=`${location==null?void 0:location.origin}/${dB(window==null?void 0:window.zyuiAssetsPath)?"assets/":window==null?void 0:window.zyuiAssetsPath}`;return b={...b,content_css:(O=b==null?void 0:b.content_css)==null?void 0:O.map(R=>R.includes("http")?R:`${N}${R}`),placeholder:C,...o.hasPagesize?{...r6e,pagesize:S,orientation:_}:{}},b}return{...d.toRefs(u),editorRef:i,customer:h,debounce:m}}},l6e={class:"my-tinymce"};function c6e(o,s,i,u,m,h){const b=d.resolveComponent("Editor");return d.openBlock(),d.createElementBlock("div",l6e,[d.createVNode(b,{modelValue:o.contentValue,"onUpdate:modelValue":s[0]||(s[0]=C=>o.contentValue=C),init:o.myInit,ref:"editorRef"},null,8,["modelValue","init"])])}const _fe=Ja(i6e,[["render",c6e]]),u6e={name:"ShadowDomWrap",setup(o,{emit:s,expose:i}){const u=d.ref(null),m=d.ref(),h=d.ref(!1),b=Ih(),C=_=>{if(_.target.closest(".context-menu")||!u.value)return;const O=u.value.contains(_.target);!O&&h.value?(h.value=!1,s("onBlur")):O&&!h.value&&(h.value=!0,s("onFocus"))},S=_=>{h.value=!0,s("onFocus"),_.stopPropagation()};return d.onMounted(()=>{var R,I,W,G,Q;m.value=(R=u.value)==null?void 0:R.attachShadow({mode:"open"}),document.addEventListener("click",C);const _=dB(window==null?void 0:window.zyuiAssetsPath)?"assets/":window==null?void 0:window.zyuiAssetsPath,N=document.createElement("link");N.rel="stylesheet",N.href=`${location==null?void 0:location.origin}/${_}css/index.min.css`,(I=m.value)==null||I.appendChild(N);const O=document.createElement("link");O.rel="stylesheet",O.href=`${location==null?void 0:location.origin}/${_}css/reset.css`,(W=m.value)==null||W.appendChild(O),(G=b==null?void 0:b.cssConfig)!=null&&G.links&&b.cssConfig.links.forEach(q=>{var L;const Z=document.createElement("link");Z.rel="stylesheet",Z.href=q,(L=m.value)==null||L.appendChild(Z)}),(Q=b==null?void 0:b.cssConfig)!=null&&Q.styles&&b.cssConfig.styles.forEach(q=>{var L;const Z=document.createElement("style");Z.textContent=q,(L=m.value)==null||L.appendChild(Z)})}),d.onUnmounted(()=>{document.removeEventListener("click",C)}),i({focus:()=>{h.value=!0}}),{shadowHost:u,shadowRoot:m,handleClick:S}}};function d6e(o,s,i,u,m,h){return d.openBlock(),d.createElementBlock("div",{ref:"shadowHost",class:"shadow-host",onClick:s[0]||(s[0]=d.withModifiers((...b)=>u.handleClick&&u.handleClick(...b),["stop"]))},[u.shadowRoot?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:u.shadowRoot},[d.renderSlot(o.$slots,"default")],8,["to"])):d.createCommentVNode("",!0)],512)}const RB=Ja(u6e,[["render",d6e]]),f6e=["innerHTML"],kfe=d.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=d.useModel(o,"modelValue");return(i,u)=>(d.openBlock(),d.createBlock(RB,null,{default:d.withCtx(()=>[d.createElementVNode("div",{innerHTML:s.value},null,8,f6e)]),_:1}))}}),Tfe=Symbol("nodesUI"),ef=()=>{const o=d.inject(Tfe);if(!o)throw new Error("NodesUI context not found");return o};function $U(o){if(!o||!o.ownerDocument)return null;const s=[];let i=o;for(;i&&i.nodeType===Node.ELEMENT_NODE;){let u=i.nodeName.toLowerCase();if(i.parentElement){const h=Array.from(i.parentElement.children).filter(b=>b.nodeName.toLowerCase()===i.nodeName.toLowerCase());if(h.length>1){const b=h.indexOf(i)+1;u+=`:nth-of-type(${b})`}}if(s.unshift(u),i=i.parentElement,i&&(i.nodeName.toLowerCase()==="body"||i.nodeName.toLowerCase()==="html"))break}return s.length?s.join(" > "):null}function m6e(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(`#${CSS.escape(o)}`)}catch(i){return console.error("nodePath query error:",i),null}}function p6e(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(o)}catch(i){return console.error("nodePath query error:",i),null}}const WA=o=>o!=null&&o.id?o==null?void 0:o.id:o.nodePath+(o!=null&&o.textNodeIndex?`-${o==null?void 0:o.textNodeIndex}`:"")+(o!=null&&o.startOffset?`-${o==null?void 0:o.startOffset}`:"")+(o!=null&&o.subNodeSort?`-${o==null?void 0:o.subNodeSort}`:""),Afe=o=>{if(o.nodeType===Node.TEXT_NODE)return o;let s=null;for(let i=o.childNodes.length-1;i>=0;i--){const u=o.childNodes[i],m=Afe(u);if(m){s=m;break}}return s},g6e=(o,s,i)=>{var b,C,S;const u=i==null?void 0:i.getRootNode(),m=(b=u==null?void 0:u.getSelection)==null?void 0:b.call(u),h=p6e(o.nodePath,i);if(m&&o.startOffset!==void 0&&s&&h){const _=document.createRange(),N=(o==null?void 0:o.textNodeIndex)||0,O=h.childNodes[N]||h;let R,I;if(O.nodeType===Node.TEXT_NODE)R=O,I=Math.min(o.startOffset||0,((C=O.textContent)==null?void 0:C.length)||0);else{const W=Afe(O);W?(R=W,I=((S=W.textContent)==null?void 0:S.length)||0):(R=O,I=0)}_.setStart(R,I),_.setEnd(R,I),_.insertNode(s),_.setStartAfter(s),_.collapse(!0),m.removeAllRanges(),m.addRange(_)}},h6e=(o,s)=>{s!=null&&s.id&&(o.id=s==null?void 0:s.id),(s==null?void 0:s.nodePath)!==void 0&&o.setAttribute("data-nodePath",s.nodePath),(s==null?void 0:s.textNodeIndex)!==void 0&&s.textNodeIndex>=0&&o.setAttribute("data-textNodeIndex",s.textNodeIndex.toString()),s.startOffset!==void 0&&s.startOffset>=0&&o.setAttribute("data-startOffset",s.startOffset.toString()),(s==null?void 0:s.subNodeSort)!==void 0&&s.subNodeSort>=0&&o.setAttribute("data-subNodeSort",s.subNodeSort.toString()),(s==null?void 0:s.groupKey)!==void 0&&o.setAttribute("data-groupKey",s.groupKey)},v6e=o=>{const s=o.closest("TD"),i=o.closest(".node-item");let u=null;if(i?u=i:s&&s.classList.contains("node-item-td")&&(u=s),!u)return null;const m=u||o;let h=m==null?void 0:m.getAttribute("data-nodePath");if(h||(h=$U(m)),(m==null?void 0:m.getAttribute("selectable"))==="false")return null;const b={element:m,nodePath:h},C=m==null?void 0:m.getAttribute("data-textNodeIndex");C&&(b.textNodeIndex=Number(C));const S=m==null?void 0:m.getAttribute("data-startOffset");S&&(b.startOffset=Number(S));const _=m==null?void 0:m.getAttribute("data-subNodeSort");_&&(b.subNodeSort=Number(_));const N=m==null?void 0:m.getAttribute("data-groupKey");N&&(b.groupKey=N);const O=m==null?void 0:m.getAttribute("id");return O&&(b.id=O),b},Nfe=o=>Txe(o,s=>d.toValue(s.nodes).map(i=>({...i,color:s.color,activated:s==null?void 0:s.activated,dataGroupKey:s.id}))),Mz=(o,s)=>{const i=o.startsWith("#")?o.slice(1):o;let u,m,h;if(i.length===3)u=parseInt(i[0]+i[0],16),m=parseInt(i[1]+i[1],16),h=parseInt(i[2]+i[2],16);else if(i.length===6)u=parseInt(i.substring(0,2),16),m=parseInt(i.substring(2,4),16),h=parseInt(i.substring(4,6),16);else return console.warn("Invalid color format:",o),`rgba(0, 0, 0, ${s})`;return`rgba(${u}, ${m}, ${h}, ${s})`},b6e=o=>{var S;const{element:s}=o;if(!s)return null;if(!wne(o))return{showTextType:"input"};const i=s.closest("tr"),u=Array.from(i.parentElement.children).indexOf(i),m=Array.from(i.children).indexOf(s.closest("td")||s.closest("th")),h=s.closest("table"),b=((S=s.closest("body"))==null?void 0:S.querySelectorAll("table"))||[];return{showTextType:"cell",tableIndex:Array.from(b).indexOf(h)+1,colIndex:m,rowIndex:u}},y6e=(o,s)=>{var m,h;let i=1;const u=(m=o==null?void 0:o.map(b=>s==null?void 0:s.find(C=>(C==null?void 0:C.id)===(b==null?void 0:b.id))))==null?void 0:m.filter(Boolean);return(u==null?void 0:u.length)>0?(h=u==null?void 0:u.map(C=>{const S=b6e(C);return S?(S==null?void 0:S.showTextType)==="input"?{...C,...S,inputIndex:i++}:{...C,...S}:null}))==null?void 0:h.filter(Boolean):[]};function w6e(o){if(!o||o.length===0)return[];const s=[...o].sort((m,h)=>m.rowIndex!==h.rowIndex?m.rowIndex-h.rowIndex:m.colIndex-h.colIndex),i=[],u=new Set;for(const m of s){if(u.has(m))continue;const h=[];let b=0,C=0;for(let S=m.colIndex;s.find(N=>N.rowIndex===m.rowIndex&&N.colIndex===S&&!u.has(N));S++)C++;if(C!==0){b=C;for(let S=m.rowIndex;;S++){let _=0;const N=[];for(let O=m.colIndex;O<m.colIndex+b;O++){const R=s.find(I=>I.rowIndex===S&&I.colIndex===O&&!u.has(I));if(R)_++,N.push(R);else break}if(_===b)h.push(...N);else break}h.length>0&&(i.push([...h]),h.forEach(S=>u.add(S)))}}return i}function C6e(o){if(!o||o.length===0)return{min:null,max:null};let s=o[0],i=o[0];for(const u of o)(u.colIndex<s.colIndex||u.colIndex===s.colIndex&&u.rowIndex<s.rowIndex)&&(s=u),(u.colIndex>i.colIndex||u.colIndex===i.colIndex&&u.rowIndex>i.rowIndex)&&(i=u);return{min:s,max:i}}const Ofe=(o,s)=>{var _;const i=y6e(o,s||[]),u=[],m=[];(_=d.toValue(i))==null||_.forEach(N=>{(N==null?void 0:N.showTextType)==="input"?u.push(N):m.push(N)});const h=Oxe(m,"tableIndex"),b=Object.entries(h).map(([N,O])=>({tableIndex:Number(N),nodes:O})),C=mde(b==null?void 0:b.map(N=>w6e(N==null?void 0:N.nodes))),S=(C==null?void 0:C.map(N=>C6e(N)))||[];return[...u,...S]},r4=o=>{function s(i){let u="";for(;i>=0;)u=String.fromCharCode(65+i%26)+u,i=Math.floor(i/26)-1;return u}return(o==null?void 0:o.colIndex)>=0&&(o==null?void 0:o.rowIndex)>=0?`${s(o==null?void 0:o.colIndex)}${o==null?void 0:o.rowIndex}`:""},S6e=(o,s)=>{const i=Ofe(o,s||[]),u=[];return i==null||i.forEach(m=>{var h,b;(m==null?void 0:m.showTextType)==="input"?u.push(`填写${m==null?void 0:m.inputIndex}`):u.push(((h=m==null?void 0:m.min)==null?void 0:h.id)===((b=m==null?void 0:m.max)==null?void 0:b.id)?r4(m==null?void 0:m.min):`${r4(m==null?void 0:m.min)}:${r4(m==null?void 0:m.max)}`)}),u==null?void 0:u.join(",")},wne=o=>{if(!(o!=null&&o.nodePath))return!1;const s=o.nodePath.split(" > "),i=s[s.length-1];return(i==null?void 0:i.startsWith("td"))&&!(o!=null&&o.startOffset)},x6e=o=>{var i;return(i=ta(o))==null?void 0:i.map(u=>(u==null||delete u.element,u))},E6e=o=>{o.querySelectorAll("p").forEach(i=>{var u;i.classList.contains("empty")&&i.classList.remove("empty"),((u=i.innerText)==null?void 0:u.trim())===""&&i.classList.add("empty")})},_6e={key:0,class:"td-node"},k6e={key:1},T6e=d.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,i=d.computed(()=>{var m,h,b,C,S;return(h=(m=s==null?void 0:s.node)==null?void 0:m.props)!=null&&h.alias?(C=(b=s==null?void 0:s.node)==null?void 0:b.props)==null?void 0:C.alias:(S=s==null?void 0:s.node)==null?void 0:S.label}),u=d.computed(()=>{var m,h;return((h=(m=s==null?void 0:s.node)==null?void 0:m.element)==null?void 0:h.tagName)==="TD"});return(m,h)=>u.value?(d.openBlock(),d.createElementBlock("span",_6e,d.toDisplayString(i.value),1)):(d.openBlock(),d.createElementBlock("span",k6e,d.toDisplayString(i.value),1))}}),$fe=Symbol("nodesEditor"),j0=()=>{const o=d.inject($fe);if(!o)throw new Error("NodesEditor context not found");return o},DU=d.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,{currentNodes:i}=ef(),{nodes:u,renderType:m,disabledNodes:h}=j0(),b=d.computed(()=>{var O;return(O=s.node)!=null&&O.id?u.value.some(R=>R.id===s.node.id):!1}),C=d.computed(()=>{var O;if(!((O=s.node)!=null&&O.element))return!1;try{return s.node.element.parentNode!==null}catch(R){return console.warn("Element validation failed:",R),!1}}),S=d.computed(()=>{var I,W;const O=(I=h==null?void 0:h.value)==null?void 0:I.some(G=>{var Q;return(G==null?void 0:G.id)===((Q=s==null?void 0:s.node)==null?void 0:Q.id)}),R=(W=d.toValue(i))==null?void 0:W.find(G=>{var Q;return(G==null?void 0:G.id)===((Q=s==null?void 0:s.node)==null?void 0:Q.id)});return{...s==null?void 0:s.node,...R,disabled:O}}),_=O=>{var I;let R="";if(d.toValue(O==null?void 0:O.activated)&&(R="normal"),O!=null&&O.disabled&&(R="disabled"),(I=s==null?void 0:s.node)!=null&&I.element)switch(R){case"normal":s.node.element.style.setProperty("--node-color",(O==null?void 0:O.color)||"#409eff"),s.node.element.style.setProperty("--node-bg-color",Mz((O==null?void 0:O.color)||"#409eff",.1)),s.node.element.setAttribute("data-dataGroupKey",O==null?void 0:O.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("activated");break;case"disabled":s.node.element.style.setProperty("--node-color",(O==null?void 0:O.color)||"#F56C6C"),s.node.element.style.setProperty("--node-bg-color",Mz((O==null?void 0:O.color)||"#F56C6C",.1)),s.node.element.setAttribute("data-dataGroupKey",O==null?void 0:O.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("disabled");break;default:N();break}},N=()=>{var O,R,I,W,G;(O=s==null?void 0:s.node)!=null&&O.element&&((R=s.node.element)==null||R.removeAttribute("data-dataGroupKey"),(I=s.node.element)==null||I.removeAttribute("selectable"),(W=s.node.element)==null||W.classList.remove("activated"),(G=s.node.element)==null||G.classList.remove("disabled"))};return d.watch(()=>S,()=>{const O=d.toValue(S);O!=null&&O.id?_(O):N()},{immediate:!0,deep:!0}),(O,R)=>{var I;return(I=O.node)!=null&&I.element&&C.value&&b.value?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:O.node.element},[d.createElementVNode("div",{class:d.normalizeClass(["node-item-render",`node-item-${d.unref(m)}`])},[d.renderSlot(O.$slots,"default",{node:O.node},()=>[d.createVNode(T6e,{node:O.node},null,8,["node"])])],2)],8,["to"])):d.createCommentVNode("",!0)}}});function A6e(){const o=d.ref(!1),s=u=>{u.key==="Control"&&(o.value=!0)},i=u=>{u.key==="Control"&&(o.value=!1)};return d.onMounted(()=>{window.addEventListener("keydown",s),window.addEventListener("keyup",i)}),d.onUnmounted(()=>{window.removeEventListener("keydown",s),window.removeEventListener("keyup",i)}),o}function Dfe(){const{selectedNodes:o,setSelectedNodes:s,containerRef:i}=ef(),{editorId:u,nodes:m}=j0(),h=d.ref(!1),b=d.ref({x:0,y:0}),C=d.ref({x:0,y:0}),S=d.ref({left:0,top:0,width:0,height:0}),_=d.ref(null),N=Ce=>{const Y=Ce.closest(".node-item-td")||Ce.closest(".node-item");if(Y!==null){let Re=[];if(Y.classList.contains("node-selected"))return;const it=Y.getAttribute("id");if(it&&m.value){const Je=m.value.find(_e=>_e.id===it);Je&&(Re=[Je])}Re=Z(Re),s(Re)}},O=Ce=>{var Je;if(Ce.button===2&&N(Ce==null?void 0:Ce.target),Ce.button!==0||(h.value=!0,!_.value))return;const Y=(Je=i==null?void 0:i.value)==null?void 0:Je.getBoundingClientRect();if(!Y)return;const Re=Ce.clientX-(Y==null?void 0:Y.left),it=Ce.clientY-(Y==null?void 0:Y.top);b.value={x:Re,y:it},C.value={x:Re,y:it},Q(Ce),L(),_.value.style.display="block",window.addEventListener("mousemove",R),window.addEventListener("wheel",I),window.addEventListener("mouseup",W)},R=dte(Ce=>{var Y;if(h.value){const Re=(Y=i==null?void 0:i.value)==null?void 0:Y.getBoundingClientRect();if(!Re)return;const it=Ce.clientX-(Re==null?void 0:Re.left),Je=Ce.clientY-(Re==null?void 0:Re.top);C.value={x:it,y:Je},L()}},16),I=dte(Ce=>{h.value&&setTimeout(()=>{var Je;const Y=(Je=i==null?void 0:i.value)==null?void 0:Je.getBoundingClientRect();if(!Y)return;const Re=Ce.clientX-(Y==null?void 0:Y.left),it=Ce.clientY-(Y==null?void 0:Y.top);C.value={x:Re,y:it},L()},0)},16),W=Ce=>{Ce.button===0&&(h.value=!1,_.value&&(L(),_.value.style.display="none",window.removeEventListener("mousemove",R),window.removeEventListener("wheel",I),window.removeEventListener("mouseup",W)))},G=A6e(),Q=Ce=>{var Re,it;let Y=[];if(Ce.button===0&&(Ce!=null&&Ce.target)){const Je=((Re=Ce==null?void 0:Ce.target)==null?void 0:Re.closest(".node-item-td"))||((it=Ce==null?void 0:Ce.target)==null?void 0:it.closest(".node-item"));if(Je!==null){const _e=Je.getAttribute("id");if(_e&&m.value){const ue=m.value.find(It=>It.id===_e);ue&&(G.value?o.value.some(It=>WA(It)===WA(ue))?Y=o.value.filter(pe=>WA(pe)!==WA(ue)):Y=[...o.value,ue]:ue&&(Y=[ue]))}}Y=Z(Y),s(Y)}},q=()=>{var ue;if(!i.value||!(S.value.width>3||S.value.height>3))return;let Ce=[];const Y=(ue=i==null?void 0:i.value)==null?void 0:ue.getBoundingClientRect(),Re=S.value.left+(Y==null?void 0:Y.left),it=S.value.top+(Y==null?void 0:Y.top),Je={left:S.value.left+(Y==null?void 0:Y.left),right:Re+S.value.width,top:S.value.top+(Y==null?void 0:Y.top),bottom:it+S.value.height};if(i.value.querySelectorAll("*").forEach(It=>{const pe=It.getBoundingClientRect();if(!Je)return;const be={left:pe.left,right:pe.right,top:pe.top,bottom:pe.bottom};if(be.right>Je.left&&be.left<Je.right&&be.bottom>Je.top&&be.top<Je.bottom){const $=It.getAttribute("id");if($&&m.value){const ke=m.value.find(le=>le.id===$);ke&&(Ce=[...Ce,ke])}}}),Ce=Z(Ce),G.value){const It=new Set(o.value.map(be=>WA(be))),pe=Ce.filter(be=>!It.has(WA(be)));s([...o.value,...pe])}else s(Ce)},Z=Ce=>Ce,L=dte(()=>{if(!_.value||!i.value)return;const{x:Ce,y:Y}=b.value,{x:Re,y:it}=C.value,Je=Math.min(Ce,Re),_e=Math.min(Y,it),ue=Math.abs(Ce-Re),It=Math.abs(Y-it);S.value={left:Je,top:_e,width:ue,height:It}},16),fe=Ce=>{if(!_.value)return;const{left:Y,top:Re,width:it,height:Je}=d.toValue(Ce);_.value.style.left=`${Y}px`,_.value.style.top=`${Re}px`,_.value.style.width=`${it}px`,_.value.style.height=`${Je}px`},Ve=()=>{if(!i.value)return;i.value.addEventListener("mousedown",O);const Ce=document.getElementById(`select_area_${u}`);if(Ce){_.value=Ce;return}const Y=document.createElement("div");Y.id=`select_area_${u}`,Y.style.position="absolute",Y.style.border="1px solid #1677ff",Y.style.backgroundColor="rgba(22, 119, 255, 0.05)",Y.style.pointerEvents="none",Y.style.display="none",i.value.appendChild(Y),_.value=Y};return d.watch(S,(Ce,Y)=>{na(Ce,Y)||(fe(Ce),h.value&&q())},{deep:!0}),d.watch(()=>i.value,Ce=>{d.toValue(Ce)&&Ve()},{immediate:!0}),d.onUnmounted(()=>{i.value&&i.value.removeEventListener("mousedown",O)}),{isSelecting:h,selectionBox:_}}function Boe(){const{selectedNodes:o,containerRef:s}=ef(),i=()=>{var m;(m=d.toValue(s))==null||m.querySelectorAll(".node-selected").forEach(h=>{h.classList.remove("node-selected")})},u=m=>{m.forEach(h=>{h.classList.add("node-selected")})};d.watch(()=>o,()=>{i(),setTimeout(()=>{var h,b;const m=(b=(h=d.toValue(o))==null?void 0:h.map(C=>{var S;return(S=s.value)==null?void 0:S.querySelector(`[id="${C.id}"]`)}))==null?void 0:b.filter(Boolean);u(m)},0)},{deep:!0})}const IB=()=>{const{nodes:o,updateNodes:s}=j0();return{nodes:o,addNode:C=>{const _=(Array.isArray(C)?C:[C]).map(O=>({...O,id:O.id||m2()})),N=[...o.value,..._];s(N)},removeNode:async C=>{const S=Array.isArray(C)?C:[C],_=o.value.filter(N=>!S.includes(N==null?void 0:N.id));s(_)},editNodes:C=>{const S=Array.isArray(C)?C:[C],_=m2(),N=S.map(R=>{const I={...R};let W=R==null?void 0:R.id;return W||(W=m2(),I.id=W),I!=null&&I.groupKey||(I.groupKey=_),I}),O=[...o.value];N.forEach(R=>{const I=O.findIndex(W=>W.id===R.id);I!==-1?O[I]=R:O.push(R)}),s(O)},insertNodeAt:(C,S)=>{const _=[...o.value];_.splice(S,0,C),s(_)},moveNode:(C,S)=>{const _=[...o.value],[N]=_.splice(C,1);_.splice(S,0,N),s(_)},updateNodes:s}};function N6e(){const{removeNode:o}=IB(),{containerRef:s}=ef(),i=d.ref(null),u=h=>{var G,Q;if(h.target instanceof Element&&(h.target.closest(".node-item")||h.target.closest(".node-item-td")||h.target.closest(".disabeld-edit")))return;const b=h.target;if(b===s.value)return;const S=((G=s.value)==null?void 0:G.getRootNode()).getSelection(),_=(Q=s.value)==null?void 0:Q.querySelectorAll('[contenteditable="true"]');_==null||_.forEach(q=>{q.setAttribute("contenteditable","false")});const N=b.textContent||"",O=b.innerHTML||"";i.value=b,b.setAttribute("contenteditable","true"),b.focus();const R=new MutationObserver(()=>{b.textContent!==N&&(b.innerHTML=O)});R.observe(b,{characterData:!0,childList:!0,subtree:!0});const I=q=>{q.preventDefault()};b.addEventListener("input",I),b.addEventListener("paste",I),b.addEventListener("drop",I),b.addEventListener("keydown",q=>{var Z,L,fe,Ve;if(((Z=document.activeElement)==null?void 0:Z.shadowRoot)===((L=s.value)==null?void 0:L.getRootNode())&&!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(q.key)){if(q.key==="Backspace"||q.key==="Delete"){const Ce=S==null?void 0:S.getRangeAt(0);if(b.blur(),(Ce==null?void 0:Ce.startOffset)===0){const Y=Ce.startContainer;if(Y.nodeType===Node.TEXT_NODE){const Re=Y.previousSibling;if(Re&&Re.nodeType===Node.ELEMENT_NODE&&Re.classList.contains("node-item")){const it=Re.getAttribute("id");it&&o(it),(fe=Y.parentElement)==null||fe.normalize();return}}else if(Y.nodeType===Node.ELEMENT_NODE){const Re=Y.previousSibling;if(Re&&Re.nodeType===Node.ELEMENT_NODE&&Re.classList.contains("node-item")){const it=Re.getAttribute("id");it&&o(it),(Ve=Y.parentElement)==null||Ve.normalize();return}}}}q.preventDefault()}});const W=()=>{b==null||b.normalize(),R.disconnect(),b.removeEventListener("input",I),b.removeEventListener("paste",I),b.removeEventListener("drop",I),b.removeEventListener("blur",W),b.setAttribute("contenteditable","false")};b.addEventListener("blur",W)},m=()=>{var h;(h=s.value)==null||h.addEventListener("dblclick",u)};return d.watch(s,h=>{h&&m()},{immediate:!0}),d.onUnmounted(()=>{var h;(h=s.value)==null||h.removeEventListener("dblclick",u)}),{}}function O6e(){const{containerRef:o,focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}=ef(),h=_=>{var O;const N=_==null?void 0:_.getSelection();try{if((O=s.value)==null||O.normalize(),N){const I=function(){var Re,it;const G=_.getSelection();if(G.rangeCount===0)return null;const Q=G.getRangeAt(0),q=Q.startContainer;let Z=0,L=-1,fe=0,Ve=[];const Ce=q.nodeType===Node.TEXT_NODE?q.parentNode:q,Y=Array.from(Ce.childNodes);if(q.nodeType===Node.TEXT_NODE){Z=Q.startOffset,L=-1;for(let be=0;be<Y.length;be++)if(Y[be]===q){L=be;break}Ve=Y.slice(0,L);const Je=[];let _e=!1;for(let be=0;be<Ve.length;be++){const $=Ve[be];if((Re=$==null?void 0:$.classList)!=null&&Re.contains("node-item")){_e=!0;continue}else if($.nodeType===Node.TEXT_NODE){const ke=Je==null?void 0:Je[Je.length-1];_e&&typeof ke=="string"?Je[Je.length-1]=ke+($==null?void 0:$.data):Je.push($==null?void 0:$.data),_e=!1}else Je.push($),_e=!1}const ue=Ve==null?void 0:Ve[Ve.length-1],It=Je==null?void 0:Je[Je.length-1];fe=Je==null?void 0:Je.filter(be=>{var $;return!(($=be==null?void 0:be.classList)!=null&&$.contains("node-item"))}).length,(it=ue==null?void 0:ue.classList)!=null&&it.contains("node-item")&&typeof It=="string"&&fe--;const pe=Je==null?void 0:Je[Je.length-1];typeof pe=="string"&&(Z+=(pe==null?void 0:pe.length)||0)}else{const Je=Y==null?void 0:Y.filter(_e=>{var ue;return(ue=_e==null?void 0:_e.classList)==null?void 0:ue.contains("node-item")}).length;Z=Q.startOffset-Je}return{currentIndex:Math.max(fe,0),previousElements:Ve,startOffset:Math.max(Z,0)}}();return u.value=(I==null?void 0:I.currentIndex)||0,(I==null?void 0:I.startOffset)||0}}catch(R){console.error(R)}return 0},b=()=>{var N;const _=(N=o.value)==null?void 0:N.getRootNode();i.value=h(_)},C=_=>{var I;const N=_.target;if(N===o.value)return;s.value=N;const O=(I=o.value)==null?void 0:I.getRootNode();i.value=h(O),N.addEventListener("click",b),N.addEventListener("keyup",W=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(W.key)&&b()});const R=()=>{N.removeEventListener("click",b),N.removeEventListener("keyup",b),N.removeEventListener("blur",R),setTimeout(()=>{s.value=null,u.value=0,i.value=-1},300)};N.addEventListener("blur",R)},S=()=>{var _;(_=o.value)==null||_.addEventListener("focus",C,!0)};return d.watch(o,_=>{_&&S()},{immediate:!0}),d.onUnmounted(()=>{var _;(_=o.value)==null||_.removeEventListener("focus",C,!0)}),{focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}}function $6e(o){const s=o.value===null?[]:[JSON.parse(JSON.stringify(o.value))],i=d.ref(s),u=d.ref(0),m=d.ref(!1),h=d.computed(()=>i.value[u.value]),b=()=>{u.value>0&&(m.value=!0,u.value--,o.value=JSON.parse(JSON.stringify(i.value[u.value])))},C=()=>{u.value<i.value.length-1&&(m.value=!0,u.value++,o.value=JSON.parse(JSON.stringify(i.value[u.value])))},S=_=>{(_.ctrlKey||_.metaKey)&&_.key==="z"?(_.preventDefault(),b()):(_.ctrlKey||_.metaKey)&&_.key==="y"&&(_.preventDefault(),C())};return d.onMounted(()=>{window.addEventListener("keydown",S)}),d.onUnmounted(()=>{window.removeEventListener("keydown",S)}),d.watch(o,d2(_=>{_&&!m.value&&(i.value.splice(u.value+1),i.value.push(JSON.parse(JSON.stringify(_))),u.value++),m.value&&(m.value=!1)},300),{deep:!0}),{current:h,undo:b,redo:C}}var Mfe={exports:{}};(function(o,s){(function(i,u){o.exports=u()})(vE,function(){var i=1e3,u=6e4,m=36e5,h="millisecond",b="second",C="minute",S="hour",_="day",N="week",O="month",R="quarter",I="year",W="date",G="Invalid Date",Q=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,q=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,Z={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(pe){var be=["th","st","nd","rd"],$=pe%100;return"["+pe+(be[($-20)%10]||be[$]||be[0])+"]"}},L=function(pe,be,$){var ke=String(pe);return!ke||ke.length>=be?pe:""+Array(be+1-ke.length).join($)+pe},fe={s:L,z:function(pe){var be=-pe.utcOffset(),$=Math.abs(be),ke=Math.floor($/60),le=$%60;return(be<=0?"+":"-")+L(ke,2,"0")+":"+L(le,2,"0")},m:function pe(be,$){if(be.date()<$.date())return-pe($,be);var ke=12*($.year()-be.year())+($.month()-be.month()),le=be.clone().add(ke,O),qe=$-le<0,Xe=be.clone().add(ke+(qe?-1:1),O);return+(-(ke+($-le)/(qe?le-Xe:Xe-le))||0)},a:function(pe){return pe<0?Math.ceil(pe)||0:Math.floor(pe)},p:function(pe){return{M:O,y:I,w:N,d:_,D:W,h:S,m:C,s:b,ms:h,Q:R}[pe]||String(pe||"").toLowerCase().replace(/s$/,"")},u:function(pe){return pe===void 0}},Ve="en",Ce={};Ce[Ve]=Z;var Y="$isDayjsObject",Re=function(pe){return pe instanceof ue||!(!pe||!pe[Y])},it=function pe(be,$,ke){var le;if(!be)return Ve;if(typeof be=="string"){var qe=be.toLowerCase();Ce[qe]&&(le=qe),$&&(Ce[qe]=$,le=qe);var Xe=be.split("-");if(!le&&Xe.length>1)return pe(Xe[0])}else{var ce=be.name;Ce[ce]=be,le=ce}return!ke&&le&&(Ve=le),le||!ke&&Ve},Je=function(pe,be){if(Re(pe))return pe.clone();var $=typeof be=="object"?be:{};return $.date=pe,$.args=arguments,new ue($)},_e=fe;_e.l=it,_e.i=Re,_e.w=function(pe,be){return Je(pe,{locale:be.$L,utc:be.$u,x:be.$x,$offset:be.$offset})};var ue=function(){function pe($){this.$L=it($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[Y]=!0}var be=pe.prototype;return be.parse=function($){this.$d=function(ke){var le=ke.date,qe=ke.utc;if(le===null)return new Date(NaN);if(_e.u(le))return new Date;if(le instanceof Date)return new Date(le);if(typeof le=="string"&&!/Z$/i.test(le)){var Xe=le.match(Q);if(Xe){var ce=Xe[2]-1||0,Ue=(Xe[7]||"0").substring(0,3);return qe?new Date(Date.UTC(Xe[1],ce,Xe[3]||1,Xe[4]||0,Xe[5]||0,Xe[6]||0,Ue)):new Date(Xe[1],ce,Xe[3]||1,Xe[4]||0,Xe[5]||0,Xe[6]||0,Ue)}}return new Date(le)}($),this.init()},be.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},be.$utils=function(){return _e},be.isValid=function(){return this.$d.toString()!==G},be.isSame=function($,ke){var le=Je($);return this.startOf(ke)<=le&&le<=this.endOf(ke)},be.isAfter=function($,ke){return Je($)<this.startOf(ke)},be.isBefore=function($,ke){return this.endOf(ke)<Je($)},be.$g=function($,ke,le){return _e.u($)?this[ke]:this.set(le,$)},be.unix=function(){return Math.floor(this.valueOf()/1e3)},be.valueOf=function(){return this.$d.getTime()},be.startOf=function($,ke){var le=this,qe=!!_e.u(ke)||ke,Xe=_e.p($),ce=function(mn,gt){var St=_e.w(le.$u?Date.UTC(le.$y,gt,mn):new Date(le.$y,gt,mn),le);return qe?St:St.endOf(_)},Ue=function(mn,gt){return _e.w(le.toDate()[mn].apply(le.toDate("s"),(qe?[0,0,0,0]:[23,59,59,999]).slice(gt)),le)},wt=this.$W,He=this.$M,mt=this.$D,Ie="set"+(this.$u?"UTC":"");switch(Xe){case I:return qe?ce(1,0):ce(31,11);case O:return qe?ce(1,He):ce(0,He+1);case N:var pt=this.$locale().weekStart||0,oe=(wt<pt?wt+7:wt)-pt;return ce(qe?mt-oe:mt+(6-oe),He);case _:case W:return Ue(Ie+"Hours",0);case S:return Ue(Ie+"Minutes",1);case C:return Ue(Ie+"Seconds",2);case b:return Ue(Ie+"Milliseconds",3);default:return this.clone()}},be.endOf=function($){return this.startOf($,!1)},be.$set=function($,ke){var le,qe=_e.p($),Xe="set"+(this.$u?"UTC":""),ce=(le={},le[_]=Xe+"Date",le[W]=Xe+"Date",le[O]=Xe+"Month",le[I]=Xe+"FullYear",le[S]=Xe+"Hours",le[C]=Xe+"Minutes",le[b]=Xe+"Seconds",le[h]=Xe+"Milliseconds",le)[qe],Ue=qe===_?this.$D+(ke-this.$W):ke;if(qe===O||qe===I){var wt=this.clone().set(W,1);wt.$d[ce](Ue),wt.init(),this.$d=wt.set(W,Math.min(this.$D,wt.daysInMonth())).$d}else ce&&this.$d[ce](Ue);return this.init(),this},be.set=function($,ke){return this.clone().$set($,ke)},be.get=function($){return this[_e.p($)]()},be.add=function($,ke){var le,qe=this;$=Number($);var Xe=_e.p(ke),ce=function(He){var mt=Je(qe);return _e.w(mt.date(mt.date()+Math.round(He*$)),qe)};if(Xe===O)return this.set(O,this.$M+$);if(Xe===I)return this.set(I,this.$y+$);if(Xe===_)return ce(1);if(Xe===N)return ce(7);var Ue=(le={},le[C]=u,le[S]=m,le[b]=i,le)[Xe]||1,wt=this.$d.getTime()+$*Ue;return _e.w(wt,this)},be.subtract=function($,ke){return this.add(-1*$,ke)},be.format=function($){var ke=this,le=this.$locale();if(!this.isValid())return le.invalidDate||G;var qe=$||"YYYY-MM-DDTHH:mm:ssZ",Xe=_e.z(this),ce=this.$H,Ue=this.$m,wt=this.$M,He=le.weekdays,mt=le.months,Ie=le.meridiem,pt=function(gt,St,Wt,Et){return gt&&(gt[St]||gt(ke,qe))||Wt[St].slice(0,Et)},oe=function(gt){return _e.s(ce%12||12,gt,"0")},mn=Ie||function(gt,St,Wt){var Et=gt<12?"AM":"PM";return Wt?Et.toLowerCase():Et};return qe.replace(q,function(gt,St){return St||function(Wt){switch(Wt){case"YY":return String(ke.$y).slice(-2);case"YYYY":return _e.s(ke.$y,4,"0");case"M":return wt+1;case"MM":return _e.s(wt+1,2,"0");case"MMM":return pt(le.monthsShort,wt,mt,3);case"MMMM":return pt(mt,wt);case"D":return ke.$D;case"DD":return _e.s(ke.$D,2,"0");case"d":return String(ke.$W);case"dd":return pt(le.weekdaysMin,ke.$W,He,2);case"ddd":return pt(le.weekdaysShort,ke.$W,He,3);case"dddd":return He[ke.$W];case"H":return String(ce);case"HH":return _e.s(ce,2,"0");case"h":return oe(1);case"hh":return oe(2);case"a":return mn(ce,Ue,!0);case"A":return mn(ce,Ue,!1);case"m":return String(Ue);case"mm":return _e.s(Ue,2,"0");case"s":return String(ke.$s);case"ss":return _e.s(ke.$s,2,"0");case"SSS":return _e.s(ke.$ms,3,"0");case"Z":return Xe}return null}(gt)||Xe.replace(":","")})},be.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},be.diff=function($,ke,le){var qe,Xe=this,ce=_e.p(ke),Ue=Je($),wt=(Ue.utcOffset()-this.utcOffset())*u,He=this-Ue,mt=function(){return _e.m(Xe,Ue)};switch(ce){case I:qe=mt()/12;break;case O:qe=mt();break;case R:qe=mt()/3;break;case N:qe=(He-wt)/6048e5;break;case _:qe=(He-wt)/864e5;break;case S:qe=He/m;break;case C:qe=He/u;break;case b:qe=He/i;break;default:qe=He}return le?qe:_e.a(qe)},be.daysInMonth=function(){return this.endOf(O).$D},be.$locale=function(){return Ce[this.$L]},be.locale=function($,ke){if(!$)return this.$L;var le=this.clone(),qe=it($,ke,!0);return qe&&(le.$L=qe),le},be.clone=function(){return _e.w(this.$d,this)},be.toDate=function(){return new Date(this.valueOf())},be.toJSON=function(){return this.isValid()?this.toISOString():null},be.toISOString=function(){return this.$d.toISOString()},be.toString=function(){return this.$d.toUTCString()},pe}(),It=ue.prototype;return Je.prototype=It,[["$ms",h],["$s",b],["$m",C],["$H",S],["$W",_],["$M",O],["$y",I],["$D",W]].forEach(function(pe){It[pe[1]]=function(be){return this.$g(be,pe[0],pe[1])}}),Je.extend=function(pe,be){return pe.$i||(pe(be,ue,Je),pe.$i=!0),Je},Je.locale=it,Je.isDayjs=Re,Je.unix=function(pe){return Je(1e3*pe)},Je.en=Ce[Ve],Je.Ls=Ce,Je.p={},Je})})(Mfe);var D6e=Mfe.exports;const Bfe=S4(D6e);function M6e(){const{modelValue:o,inputTypes:s}=j0(),{nodes:i,updateNodes:u}=IB(),m=b=>{if(!b||typeof b!="string")return[];const S=new DOMParser().parseFromString(b,"text/html");return Array.from(S.querySelectorAll("td")).filter(O=>{var R;return!((R=O.textContent)!=null&&R.trim())})},h=async b=>{var _,N;const C=await((N=(_=s==null?void 0:s.find(O=>{var R;return((R=O.value)==null?void 0:R.toLowerCase())==="text"}))==null?void 0:_.getDefaultProps)==null?void 0:N.call(_))||{},S=b.map(O=>{let R=O==null?void 0:O.id;return R||(R=m2()),{id:R,nodeType:"Text",label:"文本",props:{...C},...O}});u(S)};d.onMounted(()=>{var I;const b=m(d.toValue(o)),C=Bfe().valueOf(),S=d.toValue(i),_=S.filter(W=>wne(W)),N=S.filter(W=>!wne(W)),R=[...(I=b.map(W=>({nodePath:$U(W),startOffset:0,subNodeSort:0,insertTime:C})))==null?void 0:I.map(W=>{const G=_==null?void 0:_.find(Q=>Q.nodePath===W.nodePath);return{...W,...G}}),...N];h(R)})}function B6e(){const{selectedNodes:o,containerRef:s,isFocused:i}=ef(),{removeNode:u}=IB(),m=d.ref(null),h=S=>{if(i.value&&(S.key==="Delete"||S.key==="Backspace")){const _=[];d.toValue(o).length>0&&(d.toValue(o).forEach(N=>{var O,R,I;if(((O=N==null?void 0:N.element)==null?void 0:O.tagName)==="TD"){const W=(R=N==null?void 0:N.element)==null?void 0:R.getAttribute("id");W&&_.push(W)}else{const W=(I=N==null?void 0:N.element)==null?void 0:I.getAttribute("id");W&&_.push(W)}}),o.value=[],(_==null?void 0:_.length)>0&&u(_))}},b=S=>{var _;(_=d.toValue(s))!=null&&_.contains(S.target)?m.value=S.target:m.value=null},C=()=>{s.value&&(window.addEventListener("keydown",h),s.value.addEventListener("mousedown",b))};d.watch(()=>s.value,S=>{d.toValue(S)&&C()},{immediate:!0}),d.onUnmounted(()=>{s.value&&(window.removeEventListener("keydown",h),s.value.removeEventListener("mousedown",b))})}function MU(){const{nodes:o}=j0(),{containerRef:s,renderNodes:i,uiReady:u}=ef(),{removeNode:m}=IB(),h=()=>{var C;i.value=[...((C=o.value)==null?void 0:C.map(S=>{var N;const _=(N=s.value)==null?void 0:N.querySelector(`[id="${S.id}"]`);return{...S,element:_}}))||[]].filter(S=>!!(S!=null&&S.element))},b=d2(C=>{d.nextTick(()=>{var S;m((S=C==null?void 0:C.map(_=>_==null?void 0:_.id))==null?void 0:S.filter(Boolean))})},500);d.watch(()=>[i.value,u],()=>{if(d.toValue(u)){const C=_xe(o.value,i.value,"id");b(C)}},{immediate:!0,deep:!0}),d.watch(()=>[o.value,s.value,u],()=>{d.toValue(u)&&d.nextTick(()=>{h()})},{immediate:!0,deep:!0})}const Cne=d.ref({});function BU(o){return d.computed(()=>{var s;return(s=Cne.value)==null?void 0:s[o]})}function Roe(){const o=j0(),s=ef();d.onMounted(()=>{const{editorId:i}=o;i&&(Cne.value[i]=d.ref({...o,...s}))}),d.onUnmounted(()=>{const{editorId:i}=o;i&&(Cne.value[i]=null)})}const R6e=d.defineComponent({__name:"NodesEditUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"edit"}},setup(o){const{nodes:s}=j0(),{uiReady:i,renderNodes:u}=ef();return Roe(),$6e(s),Dfe(),Boe(),B6e(),O6e(),N6e(),M6e(),MU(),(m,h)=>d.unref(i)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(u),b=>(d.openBlock(),d.createBlock(DU,{key:b==null?void 0:b.id,node:b},{default:d.withCtx(C=>[d.renderSlot(m.$slots,"nodeItem",{node:C==null?void 0:C.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),ale=d.defineComponent({__name:"NodesPreviewUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=ef();return Roe(),MU(),Boe(),(u,m)=>d.unref(s)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(i),h=>(d.openBlock(),d.createBlock(DU,{key:h==null?void 0:h.id,node:h},{default:d.withCtx(b=>[d.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),I6e=d.defineComponent({__name:"NodesEnterUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=ef();return MU(),(u,m)=>d.unref(s)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(i),h=>(d.openBlock(),d.createBlock(DU,{key:h==null?void 0:h.id,node:h},{default:d.withCtx(b=>[d.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),P6e=d.defineComponent({__name:"NodesSelectUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"select"}},setup(o){const{uiReady:s,renderNodes:i}=ef();return Roe(),Dfe(),Boe(),MU(),(u,m)=>d.unref(s)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(i),h=>(d.openBlock(),d.createBlock(DU,{key:h==null?void 0:h.id,node:h},{default:d.withCtx(b=>[d.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),l2=d.ref({});function Rfe(o){return d.computed(()=>(l2.value[o]||(l2.value[o]=d.ref([])),l2.value[o]))}function F6e(o){const{editorId:s}=o,i=d.ref(!1);d.onMounted(()=>{l2.value[s]||(l2.value[s]=d.ref([]));const u=l2.value[s].findIndex(m=>m.id===o.id);u!==-1&&l2.value[s].splice(u,1),i.value=!0,l2.value[s].push({...o,isMounted:i})}),d.onUnmounted(()=>{i.value=!1})}const L6e=d.defineComponent({__name:"NodesProvider",props:d.mergeModels({nodes:{type:Array,default:()=>[]},renderType:{type:String,default:"preview"},inputTypes:{type:Array,default:()=>[]},editorId:{type:String,default:""},disabledNodes:{type:Array,default:()=>[]}},{formData:{},formDataModifiers:{},nodes:{},nodesModifiers:{},modelValue:{},modelModifiers:{}}),emits:["update:formData","update:nodes","update:modelValue"],setup(o){const s=o,i=d.useModel(o,"formData"),u=d.useModel(o,"nodes"),m=d.useModel(o,"modelValue"),h=Rfe(s==null?void 0:s.editorId),b=d.computed(()=>{var O,R,I;const N=[...Nfe(((I=(R=(O=d.toValue(h))==null?void 0:O.filter(W=>d.toValue(W==null?void 0:W.activated)))==null?void 0:R.filter(W=>d.toValue(W.isMounted)))==null?void 0:I.filter(W=>d.toValue(W==null?void 0:W.isOccupy)))||[]),...s.disabledNodes||[]];return Gxe(N,"id")}),C=d.computed(()=>d.toValue(s.renderType)),S=_=>{na(u.value,_)||(u.value=_)};return d.provide($fe,{modelValue:m,renderType:C,inputTypes:s.inputTypes,editorId:s==null?void 0:s.editorId,nodes:u,disabledNodes:b,updateNodes:S,formData:i}),(_,N)=>d.renderSlot(_.$slots,"default")}}),V6e=d.defineComponent({__name:"NodesUIProvider",props:{nodes:{type:Array,default:()=>[]},selectedNodes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},editorId:{type:String,default:""},htmlRenderRef:{type:Object,default:()=>{}}},emits:["onSelectedNodes","update:selectedNodes"],setup(o,{expose:s,emit:i}){const u=o,m=i,h=d.ref(null),b=d.ref(null),C=d.ref([]),S=d.ref(null),_=d.ref(-1),N=d.ref(0),O=d.ref(0),R=Rfe(u==null?void 0:u.editorId),I=d.ref(!1),W=d.ref(!1),G=d.computed(()=>u.htmlRenderRef),Q=d.computed({get:()=>(u.selectedNodes||[]).map(Ve=>{var Re;let Ce=(Re=u==null?void 0:u.nodes)==null?void 0:Re.find(it=>(it==null?void 0:it.id)===(Ve==null?void 0:Ve.id)),Y=Ve!=null&&Ve.element?Ve==null?void 0:Ve.element:m6e(Ve==null?void 0:Ve.id,h.value);return{...Ce||{},...Ve,element:Y}}),set:Ve=>{const Ce=Ve.map(({element:Y,...Re})=>{var Je;return{...((Je=u==null?void 0:u.nodes)==null?void 0:Je.find(_e=>(_e==null?void 0:_e.id)===(Re==null?void 0:Re.id)))||{},...Re}});m("update:selectedNodes",Ce)}}),q=d.computed(()=>{var Y,Re,it;const Ve=(Re=(Y=d.toValue(R))==null?void 0:Y.filter(Je=>d.toValue(Je==null?void 0:Je.activated)))==null?void 0:Re.filter(Je=>d.toValue(Je.isMounted)),Ce=((it=d.toValue(u==null?void 0:u.nodesGroups)||[])==null?void 0:it.map(Je=>({...Je||{},activated:!0})))||[];return Nfe([...Ce,...Ve])}),Z=d.ref([]),L=Ve=>{var Re;const Ce=Ve.map(({...it})=>{var It;let Je=(It=C.value)==null?void 0:It.find(pe=>(pe==null?void 0:pe.id)===(it==null?void 0:it.id));const{element:_e,...ue}={...Je||{},...it};return ue}),Y=(Re=Q.value)==null?void 0:Re.map(({element:it,...Je})=>Je);na(Ce,Y)||(Q.value=Ce,m("onSelectedNodes",Ce))},fe=d.computed(()=>d.toValue(u==null?void 0:u.nodesGroups));return s({setSelectedNodes:L}),d.provide(Tfe,{containerRef:h,htmlRenderRef:G,contextMenuRef:b,focusedElement:S,currentRenderNodes:Z,cursorPosition:_,focusedNodeIndex:N,preNodeNumber:O,currentNodes:q,selectedNodes:Q,setSelectedNodes:L,renderNodes:C,uiReady:I,isFocused:W,nodesGroups:fe}),(Ve,Ce)=>d.renderSlot(Ve.$slots,"default")}}),H6e=["onClick"],z6e={key:0,class:"icon"},U6e={key:1,class:"arrow"},j6e=["onClick"],W6e={key:0,class:"icon"},Z6e=d.defineComponent({__name:"index",props:d.mergeModels({style:{},direction:{}},{show:{type:Boolean},showModifiers:{}}),emits:d.mergeModels(["select"],["update:show"]),setup(o,{emit:s}){const i=o,{contextMenuRef:u,selectedNodes:m,setSelectedNodes:h,focusedElement:b,cursorPosition:C,focusedNodeIndex:S,preNodeNumber:_}=ef(),{inputTypes:N}=j0(),O=d.useModel(o,"show"),R=d.ref(!1),I=()=>{R.value=!1},W=d.ref({focusedElement:null,cursorPosition:0,focusedNodeIndex:0,preNodeNumber:0});d.watch(()=>[O,i==null?void 0:i.style],()=>{d.toValue(O)&&(R.value=!1,d.nextTick(()=>{R.value=!!d.toValue(O),W.value={focusedElement:d.toValue(b),cursorPosition:d.toValue(C),focusedNodeIndex:d.toValue(S),preNodeNumber:d.toValue(_)}}))},{immediate:!0,deep:!0});const{editNodes:G}=IB(),Q=async fe=>{var Ve,Ce;if(d.toValue(W).focusedElement&&!Bxe(d.toValue(C))){const Y=$U(d.toValue(W).focusedElement),Re=d.toValue(W).cursorPosition,it=(d.toValue(W).preNodeNumber||0)+1,Je=v6e(d.toValue(W).focusedElement),_e=Bfe().valueOf();if(Y&&!dB(Re)&&Re>=0){const ue=await((Ve=fe==null?void 0:fe.getDefaultProps)==null?void 0:Ve.call(fe))||{};G({...Je,label:fe==null?void 0:fe.label,nodePath:Y,startOffset:Re,subNodeSort:it,textNodeIndex:d.toValue(S)||0,nodeType:fe==null?void 0:fe.value,insertTime:_e,props:ue})}}else if(m){const Y=d.toValue(m);if(Y!=null&&Y.length){const Re=await((Ce=fe==null?void 0:fe.getDefaultProps)==null?void 0:Ce.call(fe))||{},it=Y==null?void 0:Y.map(Je=>({...Je,label:fe==null?void 0:fe.label,element:Je==null?void 0:Je.element,nodePath:Je==null?void 0:Je.nodePath,nodeType:fe==null?void 0:fe.value,props:Re}));G(it),h(it)}}O.value=!1},q=d.computed(()=>{const fe=[],Ve=[];return d.toValue(N).forEach(Ce=>{Ce.groupName==="system"?Ve.push({...Ce,handler:()=>{Q(Ce)}}):fe.push({...Ce,handler:()=>{Q(Ce)}})}),[{label:"限定填写内容",icon:"i-bi:lock",children:fe},{label:"插入记录标识",icon:"i-bi:flag",children:Ve}].filter(Ce=>{var Y;return(Y=Ce==null?void 0:Ce.children)==null?void 0:Y.length})}),Z=s,L=(fe,Ve)=>{fe.preventDefault(),Ve!=null&&Ve.handler&&Ve.handler(),Ve!=null&&Ve.value&&(Z("select",Ve==null?void 0:Ve.value),R.value=!1)};return(fe,Ve)=>(d.openBlock(),d.createBlock(d.unref(On.ElPopover),{visible:R.value,"popper-style":"padding:0px;"},{reference:d.withCtx(()=>[d.withDirectives(d.createElementVNode("div",{class:"popover-point",style:d.normalizeStyle({...fe.style}),ref_key:"contextMenuRef",ref:u},null,4),[[d.unref(On.ClickOutside),I]])]),default:d.withCtx(()=>[d.createElementVNode("div",{ref_key:"contextMenuRef",ref:u,class:"context-menu"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(q.value,Ce=>(d.openBlock(),d.createElementBlock("div",{key:Ce==null?void 0:Ce.label,class:"menu-item"},[d.createElementVNode("div",{class:"menu-item-content",onClick:Y=>L(Y,Ce)},[Ce!=null&&Ce.icon?(d.openBlock(),d.createElementBlock("div",z6e,[d.createElementVNode("div",{class:d.normalizeClass(Ce==null?void 0:Ce.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(Ce.label)+" ",1),Ce!=null&&Ce.children?(d.openBlock(),d.createElementBlock("span",U6e,"›")):d.createCommentVNode("",!0)],8,H6e),Ce!=null&&Ce.children?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["submenu",{"submenu-bottom":fe.direction==="bottom"}])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(Ce.children,Y=>(d.openBlock(),d.createElementBlock("div",{key:Y.action,class:"menu-item",onClick:Re=>L(Re,Y)},[Y!=null&&Y.icon?(d.openBlock(),d.createElementBlock("div",W6e,[d.createElementVNode("div",{class:d.normalizeClass(Y==null?void 0:Y.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(Y.label),1)],8,j6e))),128))],2)):d.createCommentVNode("",!0)]))),128))],512)]),_:1},8,["visible"]))}}),G6e=Ja(Z6e,[["__scopeId","data-v-fdbda0b7"]]);function q6e(o){const{headerHeight:s,hasContextMenu:i}=o,{contextMenuRef:u}=ef(),m=d.ref(!1),h=d.ref("top"),b=d.ref({left:"0px",top:"0px"}),C=_=>{d.toValue(i)&&(_.preventDefault(),m.value=!0,d.nextTick(()=>{const O=_.currentTarget.getBoundingClientRect(),R=_.clientX-O.left,I=_.clientY-O.top,W=u==null?void 0:u.value,G=Array.from((W==null?void 0:W.querySelectorAll(".submenu"))||[]).reduce((Q,q)=>Math.max(Q,q.offsetHeight||0),0)||400;O.height-I<G?h.value="bottom":h.value="top",b.value={left:`${R}px`,top:`${I+d.toValue(s)}px`}}))},S=_=>{_.button===0&&(m.value=!1)};return d.onMounted(()=>{document.addEventListener("mousedown",S)}),d.onUnmounted(()=>{document.removeEventListener("mousedown",S)}),{showContextMenu:m,contextMenuStyle:b,onContextMenu:C,closeContextMenu:S,direction:h}}function Ife(o){return{all:o=o||new Map,on:function(s,i){var u=o.get(s);u?u.push(i):o.set(s,[i])},off:function(s,i){var u=o.get(s);u&&(i?u.splice(u.indexOf(i)>>>0,1):o.set(s,[]))},emit:function(s,i){var u=o.get(s);u&&u.slice().map(function(m){m(i)}),(u=o.get("*"))&&u.slice().map(function(m){m(s,i)})}}}const Sne=Ife(),Pfe=(...o)=>{const s=o[0],i=o[1];d.onMounted(()=>{Sne.on(s,i)}),d.onBeforeUnmount(()=>{Sne.off(s)})},Ioe=()=>(...s)=>{Sne.emit(...s)};let rE=null;function Y6e(o){const{onSelected:s}={},{selectedNodes:i,uiReady:u,setSelectedNodes:m}=ef(),h=d.ref("multiple"),b=(S="select")=>{var N,O;let _=[];h.value==="single"?(N=i.value)!=null&&N[0]&&_.push((O=i.value)==null?void 0:O[0]):_=ta(i.value),rE==null||rE({data:_,type:S}),S==="blur"&&(rE=null,h.value="multiple"),m(_)};return d.watch(()=>i,()=>{u.value&&(b(),s==null||s(d.toValue(i)))},{deep:!0}),Pfe("selectNodes",S=>{const{data:_,callback:N=null,mode:O="multiple"}=S;h.value=O,setTimeout(()=>{m(d.toValue(_)),rE=N},100)}),{onBlur:()=>{rE&&(b("blur"),rE=null,m([]))}}}const Bz={A3:{width:297,height:420},A4:{width:210,height:297},A5:{width:148,height:210},B3:{width:353,height:500},B4:{width:257,height:364},B5:{width:176,height:250}},K6e={class:"relative"},X6e={class:"header-container"},J6e=["innerHTML"],Q6e={style:{overflow:"hidden"}},eBe=["innerHTML"],tBe=d.defineComponent({__name:"index",props:{headerHtml:{type:String,default:""},footerHtml:{type:String,default:""},pagesize:{type:String,default:"A4"}},emits:["onUiReady"],setup(o,{expose:s,emit:i}){const u=d.ref(),{containerRef:m,uiReady:h,isFocused:b}=ef(),{nodes:C,modelValue:S,renderType:_}=j0(),N=d.computed(()=>d.toValue(_)==="edit"),O=o,R=i,I=()=>{R("onUiReady",{containerRef:m})},{height:W}=mMe(u),G=d.computed(()=>O.headerHtml?O.headerHtml.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,($,ke,le)=>{const qe=le.replace(/([^{}]+)\{/g,(Xe,ce)=>{const Ue=ce.trim();return Ue&&!Ue.includes(".header-container")?`.header-container ${Ue} {`:Xe});return`<style${ke}>${qe}</style>`}):""),Q=d.computed(()=>{const $=Bz[O.pagesize]||Bz.A4,ke=(window.devicePixelRatio||1)*96;return`${$.height*ke/25.4-d.toValue(W)}px`}),{showContextMenu:q,contextMenuStyle:Z,onContextMenu:L,direction:fe}=q6e({headerHeight:W,hasContextMenu:N}),Ve=d.ref(null),Ce=$=>{var Xe;const ke=(Xe=m.value)==null?void 0:Xe.querySelector(`[id="${$==null?void 0:$.id}"]`);if(ke)return ke;let le=null;const qe=document.createElement("span");return qe.setAttribute("contenteditable","false"),qe.classList.add("node-item"),le=qe,g6e($,le,m.value),le&&h6e(le,$),le},Y=$=>{const ke=d.toValue(m);if(!ke)return;const le=ke.querySelectorAll(".node-item");if(!le||le.length===0)return;const qe=new Map;return le.forEach(ce=>{const Ue=ce.getAttribute("id")||"",He={nodePath:$U(ce==null?void 0:ce.parentElement)||ce.getAttribute("data-nodePath")||""||void 0},mt=Ue;mt&&qe.set(mt,{id:Ue||void 0,...He})}),(d.toValue($)||[]).map(ce=>{const Ue=(ce==null?void 0:ce.id)||(ce==null?void 0:ce.nodePath),wt=Ue?qe.get(Ue):void 0;return wt?{...ce,...wt}:ce})},Re=()=>{var ke,le,qe;const $=Y(C.value)||[];if(na($,C.value)){const Xe=Vxe($,[ce=>ce.nodePath,ce=>ce.textNodeIndex||-1,ce=>(ce==null?void 0:ce.startOffset)??-1,ce=>ce.subNodeSort||-1,ce=>(ce==null?void 0:ce.insertTime)||-1],["asc","desc","desc","desc","desc"]);(le=(ke=Ve.value)==null?void 0:ke.querySelectorAll(".node-item"))==null||le.forEach(ce=>ce.remove()),(qe=Ve.value)==null||qe.normalize(),Xe==null||Xe.forEach(ce=>{Ce(ce)})}else C.value=$},it=($,ke)=>{const le=new Set((ke||[]).map(ce=>ce==null?void 0:ce.id).filter(ce=>typeof ce=="string"&&ce.length>0)),qe=document.createElement("div");return qe.innerHTML=$||"",qe.querySelectorAll(".node-item").forEach(ce=>{const Ue=ce.getAttribute("id")||"";(!Ue||!le.has(Ue))&&ce.remove()}),qe.innerHTML},Je=()=>{Ve.value&&(h.value=!1,d.nextTick(()=>{if(Ve.value){const $=it(d.toValue(S),_e.value);Ve.value.innerHTML=$,Re(),h.value=!0,S.value=Ve.value.innerHTML,d.nextTick(()=>{I(),setTimeout(()=>{d.toValue(m)&&E6e(d.toValue(m))},10)})}}))},_e=d.computed(()=>{var $;return($=d.toValue(C))==null?void 0:$.map(ke=>{const{nodePath:le,id:qe,nodeType:Xe}=ke;return{nodePath:le,id:qe,nodeType:Xe}})});d.watch(()=>[S,Ve],()=>{Je()},{deep:!0,immediate:!0}),d.watch(()=>[..._e.value],($,ke)=>{na(ke,$)||Je()},{deep:!0,immediate:!0});const ue=d.ref(),It=()=>{b.value=!0},{onBlur:pe}=Y6e(),be=()=>{b.value=!1,pe()};return s({renderHtml:Je}),($,ke)=>(d.openBlock(),d.createElementBlock("div",K6e,[d.createVNode(RB,{onOnBlur:be,onOnFocus:It,ref_key:"shadowDomRef",ref:ue},{default:d.withCtx(()=>[d.createElementVNode("div",{ref_key:"headerRef",ref:u,style:{overflow:"hidden"}},[d.createElementVNode("div",X6e,[d.createElementVNode("div",{innerHTML:G.value,class:"disabeld-edit docHeaderHtml",onClick:It},null,8,J6e)])],512),d.createElementVNode("html",{class:d.normalizeClass(["nodes-editor",`nodes-editor-${d.unref(_)}`]),ref_key:"containerRef",ref:m,style:d.normalizeStyle([{position:"relative"},{position:"relative",minHeight:Q.value}]),onContextmenu:ke[0]||(ke[0]=d.withModifiers((...le)=>d.unref(L)&&d.unref(L)(...le),["prevent"]))},[d.createElementVNode("body",{ref_key:"bodyRef",ref:Ve},null,512),d.createElementVNode("div",Q6e,[d.createElementVNode("div",{innerHTML:O==null?void 0:O.footerHtml,class:"disabeld-edit docFooterHtml",onClick:It},null,8,eBe)])],38)]),_:1},512),N.value?(d.openBlock(),d.createBlock(G6e,{key:0,show:d.unref(q),"onUpdate:show":ke[1]||(ke[1]=le=>d.isRef(q)?q.value=le:null),style:d.normalizeStyle(d.unref(Z)),direction:d.unref(fe)},null,8,["show","style","direction"])):d.createCommentVNode("",!0)]))}}),nBe={class:"pagesize"},oBe=d.defineComponent({__name:"index",props:{pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},style:{type:Object,default:()=>({})}},setup(o){const s=o,i=d.computed(()=>{const u=Bz[s.pagesize]||Bz.A4;let{width:m,height:h}=u;s.orientation==="landscape"&&([m,h]=[h,m]);const b=(window.devicePixelRatio||1)*96;return m*b/25.4});return(u,m)=>(d.openBlock(),d.createElementBlock("div",nBe,[d.createElementVNode("div",{style:d.normalizeStyle({width:`${i.value}px`,...o.style}),class:"pagesize-content"},[d.renderSlot(u.$slots,"default",{},void 0,!0)],4)]))}}),sBe=Ja(oBe,[["__scopeId","data-v-44e34db1"]]),Ffe=d.defineComponent({__name:"index",props:d.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},renderType:{type:String,default:"preview"},formData:{type:Object,default:()=>({})},inputTypes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},id:{type:String,default:""},disabledNodes:{type:Array,default:()=>[]},headerHtml:{type:String,default:""},footerHtml:{type:String,default:""},pagesizeStyle:{type:Object,default:()=>({})}},{selectedNodes:{default:[]},selectedNodesModifiers:{}}),emits:d.mergeModels(["update:modelValue","update:nodes","update:formData","onSelectedNodes","onUiReady"],["update:selectedNodes"]),setup(o,{expose:s,emit:i}){const u=o,m=i,h=d.useModel(o,"selectedNodes");Em(u.formData);const b=d.ref(),C=d.ref(null),S=Q=>{m("onUiReady",Q)},_=d.ref(),N=d.computed(()=>d.toValue(u.renderType)),O=d.computed(()=>{switch(d.toValue(N)){case"edit":return R6e;case"select":return P6e;case"preview":return ale;case"enter":return I6e;default:return ale}}),R=Q=>{m("update:nodes",Q)},I=Q=>{m("update:modelValue",Q)},W=Q=>{m("update:formData",Q)},G=Q=>{m("onSelectedNodes",Q)};return s({formRef:{validate:()=>{var Q,q,Z;return(Z=(q=(Q=b.value)==null?void 0:Q.formRef)==null?void 0:q.validate)==null?void 0:Z.call(q)}},setSelectedNodes:Q=>{var q,Z;(Z=(q=_.value)==null?void 0:q.setSelectedNodes)==null||Z.call(q,Q)}}),(Q,q)=>(d.openBlock(),d.createBlock(sBe,{pagesize:o.pagesize,orientation:u==null?void 0:u.orientation,style:d.normalizeStyle(o.pagesizeStyle)},{default:d.withCtx(()=>[d.createVNode(V6e,{ref_key:"UIRef",ref:_,nodes:o.nodes,"onUpdate:nodes":R,selectedNodes:h.value,"onUpdate:selectedNodes":q[0]||(q[0]=Z=>h.value=Z),onOnSelectedNodes:G,nodesGroups:o.nodesGroups,editorId:u==null?void 0:u.id,htmlRenderRef:C.value},{default:d.withCtx(()=>[d.createVNode(L6e,{renderType:N.value,"model-value":o.modelValue,"onUpdate:modelValue":I,nodes:o.nodes,"onUpdate:nodes":R,formData:o.formData,"onUpdate:formData":W,inputTypes:o.inputTypes,editorId:u==null?void 0:u.id,disabledNodes:o.disabledNodes},{default:d.withCtx(()=>[d.createVNode(tBe,{ref_key:"htmlRenderRef",ref:C,headerHtml:o.headerHtml,footerHtml:o.footerHtml,pagesize:u==null?void 0:u.pagesize,onOnUiReady:S},null,8,["headerHtml","footerHtml","pagesize"]),(d.openBlock(),d.createBlock(d.resolveDynamicComponent(O.value),{renderType:N.value,pagesize:o.pagesize,ref_key:"contentRef",ref:b},{nodeItem:d.withCtx(Z=>[d.renderSlot(Q.$slots,"nodeItem",{node:Z==null?void 0:Z.node})]),_:3},8,["renderType","pagesize"]))]),_:3},8,["renderType","model-value","nodes","formData","inputTypes","editorId","disabledNodes"])]),_:3},8,["nodes","selectedNodes","nodesGroups","editorId","htmlRenderRef"])]),_:3},8,["pagesize","orientation","style"]))}}),rBe={class:"nodes-text"},aBe={key:0,class:"node-text-input"},iBe={key:1,class:"node-text-td"},lBe={key:0,class:"node-text-table-index"},cBe=d.defineComponent({__name:"index",props:d.mergeModels({editorId:{type:String,default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=d.useModel(o,"modelValue"),u=BU(s==null?void 0:s.editorId),m=d.computed(()=>{var b;return Ofe(i.value,((b=d.toValue(u))==null?void 0:b.renderNodes)||[])}),h=d.computed(()=>{var b;return((b=d.toValue(m))==null?void 0:b.length)>0?!d.toValue(m).some(S=>{var _,N;return((_=S==null?void 0:S.min)==null?void 0:_.tableIndex)>1||((N=S==null?void 0:S.max)==null?void 0:N.tableIndex)>1}):!0});return(b,C)=>(d.openBlock(),d.createElementBlock("div",rBe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(m.value,(S,_)=>{var N,O,R,I,W,G,Q,q,Z;return d.openBlock(),d.createElementBlock("div",{key:_,class:"node-text-item"},[(S==null?void 0:S.showTextType)==="input"?(d.openBlock(),d.createElementBlock("span",aBe,d.toDisplayString((N=S==null?void 0:S.props)!=null&&N.alias?(O=S==null?void 0:S.props)==null?void 0:O.alias:`填写${S==null?void 0:S.inputIndex}`),1)):(d.openBlock(),d.createElementBlock("span",iBe,[h.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("span",lBe,d.toDisplayString(`表${(R=S==null?void 0:S.min)==null?void 0:R.tableIndex}.`),1)),d.createTextVNode(" "+d.toDisplayString(((I=S==null?void 0:S.min)==null?void 0:I.id)===((W=S==null?void 0:S.max)==null?void 0:W.id)?(Q=(G=S==null?void 0:S.min)==null?void 0:G.props)!=null&&Q.alias?(Z=(q=S==null?void 0:S.min)==null?void 0:q.props)==null?void 0:Z.alias:d.unref(r4)(S==null?void 0:S.min):`${d.unref(r4)(S==null?void 0:S.min)}:${d.unref(r4)(S==null?void 0:S.max)}`),1)]))])}),128))]))}}),ile=Ja(cBe,[["__scopeId","data-v-73a2b2dc"]]);function Poe(o){const{nodes:s,mode:i="multiple"}=o,u=d.ref(!1),m=Ioe();return{isSelecting:u,selectNodes:()=>{if(u.value)return!1;u.value=!0,m("selectNodes",{data:ta(d.toValue(s)),mode:i,callback:({data:b,type:C})=>{s.value=x6e(ta(d.toValue(b))),C==="blur"&&(u.value=!1)}})}}}const ZA=["#409EFF","#b36c2d","#7548ff","#5233b3","#649ee5","#aac4ed","#f9ce57","#ae74e8"],BH=d.ref(0),aE=new Map,uBe={key:0,class:"node-select-small gap-x-2"},dBe={key:1,class:"text-[#999]"},fBe={key:1,class:"node-select"},mBe={class:"flex py-2 px-2 justify-between items-center noder-select-header"},pBe={class:"flex gap-2"},gBe={key:1},hBe={class:"flex gap-1"},vBe=d.defineComponent({__name:"index",props:d.mergeModels({mode:{type:String,default:"multiple"},color:{type:String},id:{type:String,default:""},editorId:{type:String,default:""},size:{type:String,default:"default"},label:{type:String,default:"点击选择"},isOccupy:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=d.ref((aE==null?void 0:aE[s==null?void 0:s.id])||0),u=d.ref((s==null?void 0:s.id)||m2()),m=d.useModel(o,"modelValue");Em(m);const{selectNodes:h,isSelecting:b}=Poe({nodes:m,mode:s.mode}),C=()=>{m.value=[]},S=d.computed(()=>s.color||(ZA==null?void 0:ZA[d.toValue(i)%(ZA==null?void 0:ZA.length)])||"#409eff");d.onMounted(()=>{dB(aE==null?void 0:aE[s==null?void 0:s.id])&&(s!=null&&s.id)&&(aE[s==null?void 0:s.id]=BH.value,i.value=BH.value,BH.value=BH.value+1)});const _=d.computed(()=>s.isOccupy),N=d.computed(()=>!d.toValue(b));return F6e({id:u.value,editorId:s.editorId,nodes:m,activated:N,color:S,isOccupy:_}),(O,R)=>{var I,W;return s.size==="small"?(d.openBlock(),d.createElementBlock("div",uBe,[d.createElementVNode("div",{style:d.normalizeStyle({"--node-color":S.value}),class:"node-color cursor-pointer"},null,4),d.createElementVNode("div",null,d.toDisplayString(s.label),1),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",{key:0,style:d.normalizeStyle(d.unref(b)?{color:"#409eff"}:{}),onClick:R[0]||(R[0]=(...G)=>d.unref(h)&&d.unref(h)(...G))},R[6]||(R[6]=[d.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer"},null,-1)]),4)),!s.disabled&&((I=m.value)==null?void 0:I.length)>0?(d.openBlock(),d.createElementBlock("div",{key:1,class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})):d.createCommentVNode("",!0),d.createElementVNode("div",{class:"flex items-center flex-wrap gap-1 cursor-pointer",onClick:R[2]||(R[2]=()=>{s!=null&&s.disabled||d.unref(h)()})},[((W=m.value)==null?void 0:W.length)>0?(d.openBlock(),d.createBlock(ile,{key:0,modelValue:m.value,"onUpdate:modelValue":R[1]||(R[1]=G=>m.value=G),editorId:o.editorId},null,8,["modelValue","editorId"])):(d.openBlock(),d.createElementBlock("div",dBe,"未设置"))])])):(d.openBlock(),d.createElementBlock("div",fBe,[d.createElementVNode("div",mBe,[d.createElementVNode("div",pBe,[d.createElementVNode("div",{style:d.normalizeStyle({"--node-color":S.value}),class:"node-color cursor-pointer"},null,4),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",{key:0,style:d.normalizeStyle(d.unref(b)?{color:"#409eff"}:{})},[d.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer",onClick:R[3]||(R[3]=(...G)=>d.unref(h)&&d.unref(h)(...G))})],4)),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",gBe,[d.createElementVNode("div",{class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})]))]),d.createElementVNode("div",hBe,[R[9]||(R[9]=d.createElementVNode("div",{class:"color-[#999]"},"Ctrl+左键多选",-1)),d.createElementVNode("div",null,[d.createVNode(d.unref(On.ElTooltip),{placement:"right",effect:"dark"},{content:d.withCtx(()=>R[7]||(R[7]=[d.createElementVNode("strong",null,"选择位置",-1),d.createTextVNode(" :点击输入框(选中状态为蓝色),再点击左侧表格可选择填写位置范围。 "),d.createElementVNode("br",null,null,-1),d.createElementVNode("strong",null,"编辑位置",-1),d.createTextVNode(" :使用橡皮擦工具清除后重新选择。 "),d.createElementVNode("br",null,null,-1)])),default:d.withCtx(()=>[R[8]||(R[8]=d.createElementVNode("div",{class:"flex flex-center"},[d.createElementVNode("div",{class:"i-bi:info-circle-fill mr-2"}),d.createTextVNode(" 使用帮助 ")],-1))]),_:1})])])]),d.createElementVNode("div",{class:d.normalizeClass(["min-h-[42px] px-2 py-1",{"shadow-[0_0_0_2px_#409eff]":d.unref(b)}]),onClick:R[5]||(R[5]=()=>{s!=null&&s.disabled||d.unref(h)()})},[d.createVNode(ile,{modelValue:m.value,"onUpdate:modelValue":R[4]||(R[4]=G=>m.value=G),editorId:o.editorId},null,8,["modelValue","editorId"])],2)]))}}}),Lfe=Ja(vBe,[["__scopeId","data-v-9af34714"]]);function bBe(o){if(!o.startsWith("="))return[];const s=[];let i=1;for(o.startsWith("=")&&s.push({type:"startOperator",value:"="});i<o.length;){const u=o[i];if(/\s/.test(u)){i++;continue}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];if(i<o.length&&o[i]===":"){i++;let h="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)h+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)h+=o[i++];s.push({type:"range",value:`${m}:${h}`});continue}else{s.push({type:"cell",value:m});continue}}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];s.push({type:"cell",value:m});continue}if(/[A-Za-z]/.test(u)){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];if(["AVERAGE","AVEDEV","SUM","IF","COUNT","MAX","MIN","SQRT"].includes(m.toUpperCase())&&o[i]==="("){s.push({type:"function",value:m});continue}i-=m.length}if(/\d/.test(u)){let m="";for(;i<o.length&&(/\d/.test(o[i])||o[i]===".");)m+=o[i++];s.push({type:"number",value:m});continue}if(u==='"'){let m="";for(m+=u,i++;i<o.length&&o[i]!=='"';)m+=o[i++];m+=u,i++,s.push({type:"string",value:m});continue}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];s.push({type:"cell",value:m});continue}if(u===":"){s.push({type:"operator",value:":"}),i++;continue}if(/[+\-*/=><]/.test(u)){s.push({type:"operator",value:u}),i++;continue}if(/[()]/.test(u)){s.push({type:"paren",value:u}),i++;continue}if(u===","){s.push({type:"separator",value:","}),i++;continue}i++}return s}function yBe(o,s){const i=[];let u=0;for(;u<o.length;){let m=!1;for(const h of s){const b=h.value;if(o.startsWith(b,u)){i.push({type:h.type,value:b,...h.cellValue?{cellValue:h.cellValue}:{}}),u+=b.length,m=!0;break}}m||(i.push({type:"plain",value:o[u]}),u++)}return i}function wBe(o){const s=BU(o.editorId),i=(b,C)=>{const S=[],_=Math.min(b.colIndex,C.colIndex),N=Math.max(b.colIndex,C.colIndex),O=Math.min(b.rowIndex,C.rowIndex),R=Math.max(b.rowIndex,C.rowIndex);for(let I=O;I<=R;I++)for(let W=_;W<=N;W++)S.push({colIndex:W,rowIndex:I});return S},u=b=>{var N;const C=b.includes(":");let S=[];if(C){const[O,R]=b.split(":").map(I=>h(I));S=i(O,R)}else S=[h(b)];return m(S,d.toValue((N=d.toValue(s))==null?void 0:N.nodes))},m=(b,C)=>C==null?void 0:C.filter(S=>{const _=S.nodePath.split(" > ");let N=1,O=1;return _.forEach(R=>{if(R.startsWith("tr")){const I=R.match(/tr(?::nth-of-type\((\d+)\))?/);I&&I[1]&&(N=parseInt(I[1]))}else if(R.startsWith("td")){const I=R.match(/td(?::nth-of-type\((\d+)\))?/);I&&(O=I[1]?parseInt(I[1]):1)}}),b.some(R=>N===R.rowIndex+1&&O===R.colIndex+1)}),h=b=>{if(!b)return{colIndex:-1,rowIndex:-1};const C=b.match(/^([A-Za-z]+)(\d+)$/);if(!C)return{colIndex:-1,rowIndex:-1};const S=C[1].toUpperCase(),_=parseInt(C[2]);let N=0;for(let O=0;O<S.length;O++)N=N*26+(S.charCodeAt(O)-64);return{colIndex:N-1,rowIndex:_}};return{getCellValue:u}}const lle=["#0288D1","#D32F2F","#F57C00","#388E3C","#303F9F","#7B1FA2","#C2185B","#880E4F","#689F38","#5D4037"];function CBe(o,s,i){const u=d.ref(null),m=d.ref(null);function h(){return o.value&&o.value.textContent||""}d.onMounted(()=>{o.value&&(u.value=()=>{const C=h();s.value=C},m.value=()=>{const C=h();s.value=C},o.value.addEventListener("input",u.value),o.value.addEventListener("blur",m.value))}),d.onUnmounted(()=>{o.value&&(u.value&&o.value.removeEventListener("input",u.value),m.value&&o.value.removeEventListener("blur",m.value))});const b=C=>{var S,_,N,O;if(C>=0){const R=window.getSelection();if(R){const I=R.getRangeAt(0),W=((S=I.startContainer)==null?void 0:S.nodeName)==="#text"?I.startContainer:(N=(_=I.startContainer)==null?void 0:_.childNodes)==null?void 0:N[0],G=Math.min(C,((O=W.textContent)==null?void 0:O.length)||0);I.setStart(W,G)}}};return d.watch(()=>[s,o],()=>{var C;o.value&&(na((C=o.value)==null?void 0:C.textContent,d.toValue(s))||(o.value.textContent=d.toValue(s),b(d.toValue(i))))},{deep:!0,immediate:!0}),{getFormulaContent:h}}function Foe(o){const{element:s,onFocus:i,onBlur:u}=o,m=d.ref(!1),h=()=>{m.value=!0,i==null||i()},b=()=>{m.value=!1,u==null||u()};return d.onMounted(()=>{var C,S;d.toValue(s)&&((C=d.toValue(s))==null||C.addEventListener("focus",h),(S=d.toValue(s))==null||S.addEventListener("blur",b))}),d.onUnmounted(()=>{var C,S;d.toValue(s)&&((C=d.toValue(s))==null||C.removeEventListener("focus",h),(S=d.toValue(s))==null||S.removeEventListener("blur",b))}),m}function SBe(o){const{element:s,showStr:i,editorId:u}=o,m=BU(u),h=Foe({element:s}),b=d.computed(()=>{var C;return(C=i==null?void 0:i.value)==null?void 0:C.filter(S=>["range","cell"].includes(S.type))});return d.watch(()=>h,()=>{var S,_,N,O,R,I;const C=W=>{var G;W.preventDefault(),(G=d.toValue(s))==null||G.focus()};d.toValue(h)?((S=d.toValue(m))==null||S.containerRef.addEventListener("click",C),(_=d.toValue(m))==null||_.containerRef.addEventListener("mousedown",C),(N=document.querySelectorAll(".select-function"))==null||N.forEach(W=>{W.addEventListener("click",C),W.addEventListener("mousedown",C)})):((O=d.toValue(m))==null||O.containerRef.removeEventListener("click",C),(R=d.toValue(m))==null||R.containerRef.removeEventListener("mousedown",C),(I=document.querySelectorAll(".select-function"))==null||I.forEach(W=>{W.removeEventListener("click",C),W.removeEventListener("mousedown",C)}))},{deep:!0}),d.watch(()=>[h,b],()=>{var C,S,_,N,O;if((C=d.toValue(m))!=null&&C.containerRef&&((N=(_=(S=d.toValue(m))==null?void 0:S.containerRef)==null?void 0:_.querySelectorAll(".node-formula-cell"))==null||N.forEach(R=>{R.classList.remove("node-formula-cell")}),d.toValue(h))){let R=[];(O=b.value)!=null&&O.length&&(b.value.forEach(I=>{var W;R=[...R,...((W=I==null?void 0:I.cellValue)==null?void 0:W.map(G=>({color:I==null?void 0:I.color,backgroundColor:Mz((I==null?void 0:I.color)||"#000",.1),element:G==null?void 0:G.element})))||[]]}),R.forEach(I=>{var W;I!=null&&I.element&&((W=I==null?void 0:I.element)==null||W.classList.add("node-formula-cell"),I==null||I.element.style.setProperty("--formula-node-color",I==null?void 0:I.color),I==null||I.element.style.setProperty("--formula-node-bg-color",I==null?void 0:I.backgroundColor))}))}},{deep:!0}),h}const xBe=o=>{const{element:s}=o,i=d.ref(-1),u=C=>{const S=C==null?void 0:C.getSelection();try{if(S)return S.getRangeAt(0).startOffset}catch{}return 0},m=()=>{var S;const C=(S=s.value)==null?void 0:S.getRootNode();i.value=u(C)},h=C=>{var O;const S=C.target,_=(O=s.value)==null?void 0:O.getRootNode();i.value=u(_),S.addEventListener("click",m),S.addEventListener("keyup",R=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(R.key)&&m()});const N=()=>{S.removeEventListener("click",m),S.removeEventListener("keyup",m),S.removeEventListener("blur",N),setTimeout(()=>{i.value=-1},300)};S.addEventListener("blur",N)},b=()=>{var C;(C=s.value)==null||C.addEventListener("focus",h,!0)};return d.watch(s,C=>{C&&b()},{immediate:!0}),d.onUnmounted(()=>{var C;(C=s.value)==null||C.removeEventListener("focus",h,!0)}),{startOffset:i}};function EBe(o,s,i,u){if(s<0||i<0||s>=o.length)throw new Error("Invalid start or length");const m=s+i;return o.slice(0,s)+u+o.slice(m)}const _Be=(o,s)=>{var u;let i=0;for(let m=0;m<s;m++){const h=o[m];i+=(u=h==null?void 0:h.value)==null?void 0:u.length}return i},kBe=o=>{const{startOffset:s,showStr:i,value:u,editorId:m,currentItemIndex:h,currentItem:b,element:C}=o,S=BU(m),_=d.ref(-1),N=d.ref(0),O=Foe({element:C}),R=d.ref(!1),I=Ioe(),W=G=>{var Q,q;if(d.toValue(R)&&d.toValue(O)&&!na((Q=d.toValue(b))==null?void 0:Q.cellValue,G)){const Z=S6e(G,((q=d.toValue(S))==null?void 0:q.nodes)||"");let L=Z;Z&&(d.toValue(N)===0&&(L+=","),d.toValue(_)>=0&&(u.value=EBe(d.toValue(u),d.toValue(_),d.toValue(N),L),N.value=Z.length))}};d.watch(()=>h,()=>{var G,Q,q,Z,L,fe;if((G=S.value)==null||G.setSelectedNodes([]),["range","cell"].includes((Q=d.toValue(b))==null?void 0:Q.type))return _.value=_Be(i.value,h.value),N.value=(Z=(q=d.toValue(b))==null?void 0:q.value)==null?void 0:Z.length,R.value=!0,I("selectNodes",{data:(L=d.toValue(b))==null?void 0:L.cellValue,mode:"multiple",callback:({data:Ve})=>{W(Ve)}}),!1;if([",","(","="].includes((fe=d.toValue(b))==null?void 0:fe.value))return _.value=d.toValue(s),R.value=!0,N.value=0,I("selectNodes",{data:[],mode:"multiple",callback:({data:Ve})=>{W(Ve)}}),!1;R.value=!1,_.value=-1},{immediate:!0,deep:!0})},TBe=o=>{const{startOffset:s,showStr:i}=o,u=d.ref(-1);d.watch(()=>s,()=>{var h;if(d.toValue(s)<=0)u.value=-1;else{let b=0;for(let C=0;C<i.value.length;C++){const S=i.value[C];if(b+=(h=S==null?void 0:S.value)==null?void 0:h.length,b>=d.toValue(s)){u.value=C;break}}}},{deep:!0,immediate:!0});const m=d.computed(()=>{var h;return(h=d.toValue(i))==null?void 0:h[d.toValue(u)]});return{currentItemIndex:u,currentItem:m}};function ABe(o,s,i,u){if(s<0||i<0||s>=o.length)throw new Error("Invalid start or length");const m=s+i;return o.slice(0,s)+u+o.slice(m)}const NBe=(o,s)=>{var u;let i=0;for(let m=0;m<s;m++){const h=o[m];i+=(u=h==null?void 0:h.value)==null?void 0:u.length}return i},OBe=o=>{const{startOffset:s,showStr:i,value:u,currentItemIndex:m,currentItem:h,element:b}=o,C=d.ref(-1),S=d.ref(0),_=Foe({element:b}),N=d.ref(!1),O=Ioe(),R=I=>{var W;if(d.toValue(N)&&d.toValue(_)&&!na((W=d.toValue(h))==null?void 0:W.value,I)){const G=I,Q=G;G&&d.toValue(C)>=0&&(u.value=ABe(d.toValue(u),d.toValue(C),d.toValue(S),Q),S.value=G.length)}};d.watch(()=>m,()=>{var I,W,G,Q,q;if(["function"].includes((I=d.toValue(h))==null?void 0:I.type))return C.value=NBe(i.value,m.value),S.value=(G=(W=d.toValue(h))==null?void 0:W.value)==null?void 0:G.length,N.value=!0,O("selectFunction",{data:(Q=d.toValue(h))==null?void 0:Q.value,callback:({data:Z})=>{R(Z)}}),!1;if([",","(","="].includes((q=d.toValue(h))==null?void 0:q.value))return C.value=d.toValue(s),N.value=!0,S.value=0,O("selectFunction",{data:"",callback:({data:Z})=>{R(Z)}}),!1;N.value=!1,C.value=-1},{immediate:!0,deep:!0})},$Be={class:"node-formula"},DBe={class:"node-formula-show"},MBe=d.defineComponent({__name:"index",props:d.mergeModels({id:{type:String,default:""},editorId:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,{getCellValue:i}=wBe({editorId:s==null?void 0:s.editorId}),u=d.useModel(o,"modelValue"),m=d.ref(),{startOffset:h}=xBe({element:m});CBe(m,u,h);const b=d.computed(()=>{const N=bBe(u.value);return N==null?void 0:N.map(R=>R.type==="cell"||R.type==="range"?{cellValue:i(R.value),...R}:R)}),C=d.computed(()=>{const N=yBe(u.value,b.value);let O=-1;return N.map(I=>(I==null?void 0:I.type)==="cell"||(I==null?void 0:I.type)==="range"?(O++,{...I,color:lle[O%lle.length]}):(I==null?void 0:I.type)==="function"?{...I,color:"#0318ff"}:I)});SBe({element:m,showStr:C,editorId:s==null?void 0:s.editorId});const{currentItemIndex:S,currentItem:_}=TBe({element:m,startOffset:h,value:u,showStr:C});return kBe({element:m,startOffset:h,showStr:C,editorId:s==null?void 0:s.editorId,value:u,currentItemIndex:S,currentItem:_}),OBe({element:m,startOffset:h,showStr:C,value:u,currentItemIndex:S,currentItem:_}),(N,O)=>(d.openBlock(),d.createElementBlock("div",$Be,[d.createElementVNode("div",{contenteditable:"true",ref_key:"formulaRef",ref:m,class:"node-formula-input"},null,512),d.createElementVNode("div",DBe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(C.value,(R,I)=>(d.openBlock(),d.createElementBlock("span",{key:I,class:d.normalizeClass(["node-formula-item",`node-formula-item-type-${R==null?void 0:R.type}`,I===d.unref(S)?"node-formula-item-active":""]),style:d.normalizeStyle({"--text-color":(R==null?void 0:R.color)||"#000","--bg-color":d.unref(Mz)((R==null?void 0:R.color)||"#000",.1)})},d.toDisplayString(R.value),7))),128))])]))}}),Vfe=Ja(MBe,[["__scopeId","data-v-f4b96eb4"]]),BBe=[{label:"平均值",value:"AVERAGE"},{label:"均值绝对偏差",value:"AVEDEV"},{label:"求和",value:"SUM"},{label:"条件判断",value:"IF"},{label:"统计数量",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"正平方根",value:"SQRT"}],RBe={class:"select-function"},IBe=["onClick"],PBe={class:"function-item"},FBe={class:"function-item-desc"},LBe=d.defineComponent({__name:"index",props:d.mergeModels({id:{type:String,default:""},functionList:{type:Array,default:()=>[]}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o;let i=null;const u=d.computed(()=>{var b;return((b=s.functionList)==null?void 0:b.length)>0?s.functionList:BBe}),m=d.useModel(o,"modelValue"),h=b=>{m.value=b,i==null||i({data:b})};return Pfe("selectFunction",({data:b,callback:C})=>{i=C,m.value=b}),(b,C)=>(d.openBlock(),d.createElementBlock("div",RBe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(u.value,(S,_)=>(d.openBlock(),d.createElementBlock("div",{key:_},[d.createElementVNode("div",{onClick:()=>{h(S.value)},class:d.normalizeClass(["function-item-wrapper",{active:m.value===S.value}])},[d.createElementVNode("div",PBe,d.toDisplayString(S.value),1),d.createElementVNode("div",FBe,d.toDisplayString(S.label),1)],10,IBe)]))),128))]))}}),Hfe=Ja(LBe,[["__scopeId","data-v-6e079ff0"]]),VBe=["innerHTML"],zfe=d.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=d.useModel(o,"modelValue");return(i,u)=>(d.openBlock(),d.createBlock(RB,null,{default:d.withCtx(()=>[d.createElementVNode("div",{innerHTML:s.value},null,8,VBe)]),_:1}))}});function RU(o){return d.getCurrentScope()?(d.onScopeDispose(o),!0):!1}function B0(o){return typeof o=="function"?o():d.unref(o)}const HBe=typeof window<"u"&&typeof document<"u",zBe=o=>typeof o<"u",UBe=Object.prototype.toString,jBe=o=>UBe.call(o)==="[object Object]",WBe=()=>{};function ZBe(o,s){function i(...u){return new Promise((m,h)=>{Promise.resolve(o(()=>s.apply(this,u),{fn:s,thisArg:this,args:u})).then(m).catch(h)})}return i}const Ufe=o=>o();function GBe(o=Ufe){const s=d.ref(!0);function i(){s.value=!1}function u(){s.value=!0}const m=(...h)=>{s.value&&o(...h)};return{isActive:d.readonly(s),pause:i,resume:u,eventFilter:m}}function cle(o,s=!1,i="Timeout"){return new Promise((u,m)=>{setTimeout(s?()=>m(i):u,o)})}function qBe(o,s,i={}){const{eventFilter:u=Ufe,...m}=i;return d.watch(o,ZBe(u,s),m)}function GA(o,s,i={}){const{eventFilter:u,...m}=i,{eventFilter:h,pause:b,resume:C,isActive:S}=GBe(u);return{stop:qBe(o,s,{...m,eventFilter:h}),pause:b,resume:C,isActive:S}}function YBe(o,s={}){if(!d.isRef(o))return d.toRefs(o);const i=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const u in o.value)i[u]=d.customRef(()=>({get(){return o.value[u]},set(m){var h;if((h=B0(s.replaceRef))!=null?h:!0)if(Array.isArray(o.value)){const C=[...o.value];C[u]=m,o.value=C}else{const C={...o.value,[u]:m};Object.setPrototypeOf(C,Object.getPrototypeOf(o.value)),o.value=C}else o.value[u]=m}}));return i}function xne(o,s=!1){function i(O,{flush:R="sync",deep:I=!1,timeout:W,throwOnTimeout:G}={}){let Q=null;const Z=[new Promise(L=>{Q=d.watch(o,fe=>{O(fe)!==s&&(Q==null||Q(),L(fe))},{flush:R,deep:I,immediate:!0})})];return W!=null&&Z.push(cle(W,G).then(()=>B0(o)).finally(()=>Q==null?void 0:Q())),Promise.race(Z)}function u(O,R){if(!d.isRef(O))return i(fe=>fe===O,R);const{flush:I="sync",deep:W=!1,timeout:G,throwOnTimeout:Q}=R??{};let q=null;const L=[new Promise(fe=>{q=d.watch([o,O],([Ve,Ce])=>{s!==(Ve===Ce)&&(q==null||q(),fe(Ve))},{flush:I,deep:W,immediate:!0})})];return G!=null&&L.push(cle(G,Q).then(()=>B0(o)).finally(()=>(q==null||q(),B0(o)))),Promise.race(L)}function m(O){return i(R=>!!R,O)}function h(O){return u(null,O)}function b(O){return u(void 0,O)}function C(O){return i(Number.isNaN,O)}function S(O,R){return i(I=>{const W=Array.from(I);return W.includes(O)||W.includes(B0(O))},R)}function _(O){return N(1,O)}function N(O=1,R){let I=-1;return i(()=>(I+=1,I>=O),R)}return Array.isArray(B0(o))?{toMatch:i,toContains:S,changed:_,changedTimes:N,get not(){return xne(o,!s)}}:{toMatch:i,toBe:u,toBeTruthy:m,toBeNull:h,toBeNaN:C,toBeUndefined:b,changed:_,changedTimes:N,get not(){return xne(o,!s)}}}function Ene(o){return xne(o)}function KBe(o){var s;const i=B0(o);return(s=i==null?void 0:i.$el)!=null?s:i}const jfe=HBe?window:void 0;function Wfe(...o){let s,i,u,m;if(typeof o[0]=="string"||Array.isArray(o[0])?([i,u,m]=o,s=jfe):[s,i,u,m]=o,!s)return WBe;Array.isArray(i)||(i=[i]),Array.isArray(u)||(u=[u]);const h=[],b=()=>{h.forEach(N=>N()),h.length=0},C=(N,O,R,I)=>(N.addEventListener(O,R,I),()=>N.removeEventListener(O,R,I)),S=d.watch(()=>[KBe(s),B0(m)],([N,O])=>{if(b(),!N)return;const R=jBe(O)?{...O}:O;h.push(...i.flatMap(I=>u.map(W=>C(N,I,W,R))))},{immediate:!0,flush:"post"}),_=()=>{S(),b()};return RU(_),_}function XBe(o){return typeof o=="function"?o:typeof o=="string"?s=>s.key===o:Array.isArray(o)?s=>o.includes(s.key):()=>!0}function ule(...o){let s,i,u={};o.length===3?(s=o[0],i=o[1],u=o[2]):o.length===2?typeof o[1]=="object"?(s=!0,i=o[0],u=o[1]):(s=o[0],i=o[1]):(s=!0,i=o[0]);const{target:m=jfe,eventName:h="keydown",passive:b=!1,dedupe:C=!1}=u,S=XBe(s);return Wfe(m,h,N=>{N.repeat&&B0(C)||S(N)&&i(N)},b)}function JBe(o){return JSON.parse(JSON.stringify(o))}function vte(o,s,i,u={}){var m,h,b;const{clone:C=!1,passive:S=!1,eventName:_,deep:N=!1,defaultValue:O,shouldEmit:R}=u,I=d.getCurrentInstance(),W=i||(I==null?void 0:I.emit)||((m=I==null?void 0:I.$emit)==null?void 0:m.bind(I))||((b=(h=I==null?void 0:I.proxy)==null?void 0:h.$emit)==null?void 0:b.bind(I==null?void 0:I.proxy));let G=_;s||(s="modelValue"),G=G||`update:${s.toString()}`;const Q=L=>C?typeof C=="function"?C(L):JBe(L):L,q=()=>zBe(o[s])?Q(o[s]):O,Z=L=>{R?R(L)&&W(G,L):W(G,L)};if(S){const L=q(),fe=d.ref(L);let Ve=!1;return d.watch(()=>o[s],Ce=>{Ve||(Ve=!0,fe.value=Q(Ce),d.nextTick(()=>Ve=!1))}),d.watch(fe,Ce=>{!Ve&&(Ce!==o[s]||N)&&Z(Ce)},{deep:N}),fe}else return d.computed({get(){return q()},set(L){Z(L)}})}var QBe={value:()=>{}};function IU(){for(var o=0,s=arguments.length,i={},u;o<s;++o){if(!(u=arguments[o]+"")||u in i||/[\s.]/.test(u))throw new Error("illegal type: "+u);i[u]=[]}return new az(i)}function az(o){this._=o}function eRe(o,s){return o.trim().split(/^|\s+/).map(function(i){var u="",m=i.indexOf(".");if(m>=0&&(u=i.slice(m+1),i=i.slice(0,m)),i&&!s.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:u}})}az.prototype=IU.prototype={constructor:az,on:function(o,s){var i=this._,u=eRe(o+"",i),m,h=-1,b=u.length;if(arguments.length<2){for(;++h<b;)if((m=(o=u[h]).type)&&(m=tRe(i[m],o.name)))return m;return}if(s!=null&&typeof s!="function")throw new Error("invalid callback: "+s);for(;++h<b;)if(m=(o=u[h]).type)i[m]=dle(i[m],o.name,s);else if(s==null)for(m in i)i[m]=dle(i[m],o.name,null);return this},copy:function(){var o={},s=this._;for(var i in s)o[i]=s[i].slice();return new az(o)},call:function(o,s){if((m=arguments.length-2)>0)for(var i=new Array(m),u=0,m,h;u<m;++u)i[u]=arguments[u+2];if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(h=this._[o],u=0,m=h.length;u<m;++u)h[u].value.apply(s,i)},apply:function(o,s,i){if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(var u=this._[o],m=0,h=u.length;m<h;++m)u[m].value.apply(s,i)}};function tRe(o,s){for(var i=0,u=o.length,m;i<u;++i)if((m=o[i]).name===s)return m.value}function dle(o,s,i){for(var u=0,m=o.length;u<m;++u)if(o[u].name===s){o[u]=QBe,o=o.slice(0,u).concat(o.slice(u+1));break}return i!=null&&o.push({name:s,value:i}),o}var _ne="http://www.w3.org/1999/xhtml";const fle={svg:"http://www.w3.org/2000/svg",xhtml:_ne,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function PU(o){var s=o+="",i=s.indexOf(":");return i>=0&&(s=o.slice(0,i))!=="xmlns"&&(o=o.slice(i+1)),fle.hasOwnProperty(s)?{space:fle[s],local:o}:o}function nRe(o){return function(){var s=this.ownerDocument,i=this.namespaceURI;return i===_ne&&s.documentElement.namespaceURI===_ne?s.createElement(o):s.createElementNS(i,o)}}function oRe(o){return function(){return this.ownerDocument.createElementNS(o.space,o.local)}}function Zfe(o){var s=PU(o);return(s.local?oRe:nRe)(s)}function sRe(){}function Loe(o){return o==null?sRe:function(){return this.querySelector(o)}}function rRe(o){typeof o!="function"&&(o=Loe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=new Array(b),S,_,N=0;N<b;++N)(S=h[N])&&(_=o.call(S,S.__data__,N,h))&&("__data__"in S&&(_.__data__=S.__data__),C[N]=_);return new Sp(u,this._parents)}function aRe(o){return o==null?[]:Array.isArray(o)?o:Array.from(o)}function iRe(){return[]}function Gfe(o){return o==null?iRe:function(){return this.querySelectorAll(o)}}function lRe(o){return function(){return aRe(o.apply(this,arguments))}}function cRe(o){typeof o=="function"?o=lRe(o):o=Gfe(o);for(var s=this._groups,i=s.length,u=[],m=[],h=0;h<i;++h)for(var b=s[h],C=b.length,S,_=0;_<C;++_)(S=b[_])&&(u.push(o.call(S,S.__data__,_,b)),m.push(S));return new Sp(u,m)}function qfe(o){return function(){return this.matches(o)}}function Yfe(o){return function(s){return s.matches(o)}}var uRe=Array.prototype.find;function dRe(o){return function(){return uRe.call(this.children,o)}}function fRe(){return this.firstElementChild}function mRe(o){return this.select(o==null?fRe:dRe(typeof o=="function"?o:Yfe(o)))}var pRe=Array.prototype.filter;function gRe(){return Array.from(this.children)}function hRe(o){return function(){return pRe.call(this.children,o)}}function vRe(o){return this.selectAll(o==null?gRe:hRe(typeof o=="function"?o:Yfe(o)))}function bRe(o){typeof o!="function"&&(o=qfe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=[],S,_=0;_<b;++_)(S=h[_])&&o.call(S,S.__data__,_,h)&&C.push(S);return new Sp(u,this._parents)}function Kfe(o){return new Array(o.length)}function yRe(){return new Sp(this._enter||this._groups.map(Kfe),this._parents)}function Rz(o,s){this.ownerDocument=o.ownerDocument,this.namespaceURI=o.namespaceURI,this._next=null,this._parent=o,this.__data__=s}Rz.prototype={constructor:Rz,appendChild:function(o){return this._parent.insertBefore(o,this._next)},insertBefore:function(o,s){return this._parent.insertBefore(o,s)},querySelector:function(o){return this._parent.querySelector(o)},querySelectorAll:function(o){return this._parent.querySelectorAll(o)}};function wRe(o){return function(){return o}}function CRe(o,s,i,u,m,h){for(var b=0,C,S=s.length,_=h.length;b<_;++b)(C=s[b])?(C.__data__=h[b],u[b]=C):i[b]=new Rz(o,h[b]);for(;b<S;++b)(C=s[b])&&(m[b]=C)}function SRe(o,s,i,u,m,h,b){var C,S,_=new Map,N=s.length,O=h.length,R=new Array(N),I;for(C=0;C<N;++C)(S=s[C])&&(R[C]=I=b.call(S,S.__data__,C,s)+"",_.has(I)?m[C]=S:_.set(I,S));for(C=0;C<O;++C)I=b.call(o,h[C],C,h)+"",(S=_.get(I))?(u[C]=S,S.__data__=h[C],_.delete(I)):i[C]=new Rz(o,h[C]);for(C=0;C<N;++C)(S=s[C])&&_.get(R[C])===S&&(m[C]=S)}function xRe(o){return o.__data__}function ERe(o,s){if(!arguments.length)return Array.from(this,xRe);var i=s?SRe:CRe,u=this._parents,m=this._groups;typeof o!="function"&&(o=wRe(o));for(var h=m.length,b=new Array(h),C=new Array(h),S=new Array(h),_=0;_<h;++_){var N=u[_],O=m[_],R=O.length,I=_Re(o.call(N,N&&N.__data__,_,u)),W=I.length,G=C[_]=new Array(W),Q=b[_]=new Array(W),q=S[_]=new Array(R);i(N,O,G,Q,q,I,s);for(var Z=0,L=0,fe,Ve;Z<W;++Z)if(fe=G[Z]){for(Z>=L&&(L=Z+1);!(Ve=Q[L])&&++L<W;);fe._next=Ve||null}}return b=new Sp(b,u),b._enter=C,b._exit=S,b}function _Re(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function kRe(){return new Sp(this._exit||this._groups.map(Kfe),this._parents)}function TRe(o,s,i){var u=this.enter(),m=this,h=this.exit();return typeof o=="function"?(u=o(u),u&&(u=u.selection())):u=u.append(o+""),s!=null&&(m=s(m),m&&(m=m.selection())),i==null?h.remove():i(h),u&&m?u.merge(m).order():m}function ARe(o){for(var s=o.selection?o.selection():o,i=this._groups,u=s._groups,m=i.length,h=u.length,b=Math.min(m,h),C=new Array(m),S=0;S<b;++S)for(var _=i[S],N=u[S],O=_.length,R=C[S]=new Array(O),I,W=0;W<O;++W)(I=_[W]||N[W])&&(R[W]=I);for(;S<m;++S)C[S]=i[S];return new Sp(C,this._parents)}function NRe(){for(var o=this._groups,s=-1,i=o.length;++s<i;)for(var u=o[s],m=u.length-1,h=u[m],b;--m>=0;)(b=u[m])&&(h&&b.compareDocumentPosition(h)^4&&h.parentNode.insertBefore(b,h),h=b);return this}function ORe(o){o||(o=$Re);function s(O,R){return O&&R?o(O.__data__,R.__data__):!O-!R}for(var i=this._groups,u=i.length,m=new Array(u),h=0;h<u;++h){for(var b=i[h],C=b.length,S=m[h]=new Array(C),_,N=0;N<C;++N)(_=b[N])&&(S[N]=_);S.sort(s)}return new Sp(m,this._parents).order()}function $Re(o,s){return o<s?-1:o>s?1:o>=s?0:NaN}function DRe(){var o=arguments[0];return arguments[0]=this,o.apply(null,arguments),this}function MRe(){return Array.from(this)}function BRe(){for(var o=this._groups,s=0,i=o.length;s<i;++s)for(var u=o[s],m=0,h=u.length;m<h;++m){var b=u[m];if(b)return b}return null}function RRe(){let o=0;for(const s of this)++o;return o}function IRe(){return!this.node()}function PRe(o){for(var s=this._groups,i=0,u=s.length;i<u;++i)for(var m=s[i],h=0,b=m.length,C;h<b;++h)(C=m[h])&&o.call(C,C.__data__,h,m);return this}function FRe(o){return function(){this.removeAttribute(o)}}function LRe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function VRe(o,s){return function(){this.setAttribute(o,s)}}function HRe(o,s){return function(){this.setAttributeNS(o.space,o.local,s)}}function zRe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttribute(o):this.setAttribute(o,i)}}function URe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttributeNS(o.space,o.local):this.setAttributeNS(o.space,o.local,i)}}function jRe(o,s){var i=PU(o);if(arguments.length<2){var u=this.node();return i.local?u.getAttributeNS(i.space,i.local):u.getAttribute(i)}return this.each((s==null?i.local?LRe:FRe:typeof s=="function"?i.local?URe:zRe:i.local?HRe:VRe)(i,s))}function Xfe(o){return o.ownerDocument&&o.ownerDocument.defaultView||o.document&&o||o.defaultView}function WRe(o){return function(){this.style.removeProperty(o)}}function ZRe(o,s,i){return function(){this.style.setProperty(o,s,i)}}function GRe(o,s,i){return function(){var u=s.apply(this,arguments);u==null?this.style.removeProperty(o):this.style.setProperty(o,u,i)}}function qRe(o,s,i){return arguments.length>1?this.each((s==null?WRe:typeof s=="function"?GRe:ZRe)(o,s,i??"")):g4(this.node(),o)}function g4(o,s){return o.style.getPropertyValue(s)||Xfe(o).getComputedStyle(o,null).getPropertyValue(s)}function YRe(o){return function(){delete this[o]}}function KRe(o,s){return function(){this[o]=s}}function XRe(o,s){return function(){var i=s.apply(this,arguments);i==null?delete this[o]:this[o]=i}}function JRe(o,s){return arguments.length>1?this.each((s==null?YRe:typeof s=="function"?XRe:KRe)(o,s)):this.node()[o]}function Jfe(o){return o.trim().split(/^|\s+/)}function Voe(o){return o.classList||new Qfe(o)}function Qfe(o){this._node=o,this._names=Jfe(o.getAttribute("class")||"")}Qfe.prototype={add:function(o){var s=this._names.indexOf(o);s<0&&(this._names.push(o),this._node.setAttribute("class",this._names.join(" ")))},remove:function(o){var s=this._names.indexOf(o);s>=0&&(this._names.splice(s,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(o){return this._names.indexOf(o)>=0}};function eme(o,s){for(var i=Voe(o),u=-1,m=s.length;++u<m;)i.add(s[u])}function tme(o,s){for(var i=Voe(o),u=-1,m=s.length;++u<m;)i.remove(s[u])}function QRe(o){return function(){eme(this,o)}}function eIe(o){return function(){tme(this,o)}}function tIe(o,s){return function(){(s.apply(this,arguments)?eme:tme)(this,o)}}function nIe(o,s){var i=Jfe(o+"");if(arguments.length<2){for(var u=Voe(this.node()),m=-1,h=i.length;++m<h;)if(!u.contains(i[m]))return!1;return!0}return this.each((typeof s=="function"?tIe:s?QRe:eIe)(i,s))}function oIe(){this.textContent=""}function sIe(o){return function(){this.textContent=o}}function rIe(o){return function(){var s=o.apply(this,arguments);this.textContent=s??""}}function aIe(o){return arguments.length?this.each(o==null?oIe:(typeof o=="function"?rIe:sIe)(o)):this.node().textContent}function iIe(){this.innerHTML=""}function lIe(o){return function(){this.innerHTML=o}}function cIe(o){return function(){var s=o.apply(this,arguments);this.innerHTML=s??""}}function uIe(o){return arguments.length?this.each(o==null?iIe:(typeof o=="function"?cIe:lIe)(o)):this.node().innerHTML}function dIe(){this.nextSibling&&this.parentNode.appendChild(this)}function fIe(){return this.each(dIe)}function mIe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function pIe(){return this.each(mIe)}function gIe(o){var s=typeof o=="function"?o:Zfe(o);return this.select(function(){return this.appendChild(s.apply(this,arguments))})}function hIe(){return null}function vIe(o,s){var i=typeof o=="function"?o:Zfe(o),u=s==null?hIe:typeof s=="function"?s:Loe(s);return this.select(function(){return this.insertBefore(i.apply(this,arguments),u.apply(this,arguments)||null)})}function bIe(){var o=this.parentNode;o&&o.removeChild(this)}function yIe(){return this.each(bIe)}function wIe(){var o=this.cloneNode(!1),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function CIe(){var o=this.cloneNode(!0),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function SIe(o){return this.select(o?CIe:wIe)}function xIe(o){return arguments.length?this.property("__data__",o):this.node().__data__}function EIe(o){return function(s){o.call(this,s,this.__data__)}}function _Ie(o){return o.trim().split(/^|\s+/).map(function(s){var i="",u=s.indexOf(".");return u>=0&&(i=s.slice(u+1),s=s.slice(0,u)),{type:s,name:i}})}function kIe(o){return function(){var s=this.__on;if(s){for(var i=0,u=-1,m=s.length,h;i<m;++i)h=s[i],(!o.type||h.type===o.type)&&h.name===o.name?this.removeEventListener(h.type,h.listener,h.options):s[++u]=h;++u?s.length=u:delete this.__on}}}function TIe(o,s,i){return function(){var u=this.__on,m,h=EIe(s);if(u){for(var b=0,C=u.length;b<C;++b)if((m=u[b]).type===o.type&&m.name===o.name){this.removeEventListener(m.type,m.listener,m.options),this.addEventListener(m.type,m.listener=h,m.options=i),m.value=s;return}}this.addEventListener(o.type,h,i),m={type:o.type,name:o.name,value:s,listener:h,options:i},u?u.push(m):this.__on=[m]}}function AIe(o,s,i){var u=_Ie(o+""),m,h=u.length,b;if(arguments.length<2){var C=this.node().__on;if(C){for(var S=0,_=C.length,N;S<_;++S)for(m=0,N=C[S];m<h;++m)if((b=u[m]).type===N.type&&b.name===N.name)return N.value}return}for(C=s?TIe:kIe,m=0;m<h;++m)this.each(C(u[m],s,i));return this}function nme(o,s,i){var u=Xfe(o),m=u.CustomEvent;typeof m=="function"?m=new m(s,i):(m=u.document.createEvent("Event"),i?(m.initEvent(s,i.bubbles,i.cancelable),m.detail=i.detail):m.initEvent(s,!1,!1)),o.dispatchEvent(m)}function NIe(o,s){return function(){return nme(this,o,s)}}function OIe(o,s){return function(){return nme(this,o,s.apply(this,arguments))}}function $Ie(o,s){return this.each((typeof s=="function"?OIe:NIe)(o,s))}function*DIe(){for(var o=this._groups,s=0,i=o.length;s<i;++s)for(var u=o[s],m=0,h=u.length,b;m<h;++m)(b=u[m])&&(yield b)}var ome=[null];function Sp(o,s){this._groups=o,this._parents=s}function PB(){return new Sp([[document.documentElement]],ome)}function MIe(){return this}Sp.prototype=PB.prototype={constructor:Sp,select:rRe,selectAll:cRe,selectChild:mRe,selectChildren:vRe,filter:bRe,data:ERe,enter:yRe,exit:kRe,join:TRe,merge:ARe,selection:MIe,order:NRe,sort:ORe,call:DRe,nodes:MRe,node:BRe,size:RRe,empty:IRe,each:PRe,attr:jRe,style:qRe,property:JRe,classed:nIe,text:aIe,html:uIe,raise:fIe,lower:pIe,append:gIe,insert:vIe,remove:yIe,clone:SIe,datum:xIe,on:AIe,dispatch:$Ie,[Symbol.iterator]:DIe};function Mh(o){return typeof o=="string"?new Sp([[document.querySelector(o)]],[document.documentElement]):new Sp([[o]],ome)}function BIe(o){let s;for(;s=o.sourceEvent;)o=s;return o}function Ov(o,s){if(o=BIe(o),s===void 0&&(s=o.currentTarget),s){var i=s.ownerSVGElement||s;if(i.createSVGPoint){var u=i.createSVGPoint();return u.x=o.clientX,u.y=o.clientY,u=u.matrixTransform(s.getScreenCTM().inverse()),[u.x,u.y]}if(s.getBoundingClientRect){var m=s.getBoundingClientRect();return[o.clientX-m.left-s.clientLeft,o.clientY-m.top-s.clientTop]}}return[o.pageX,o.pageY]}const RIe={passive:!1},fB={capture:!0,passive:!1};function bte(o){o.stopImmediatePropagation()}function a4(o){o.preventDefault(),o.stopImmediatePropagation()}function sme(o){var s=o.document.documentElement,i=Mh(o).on("dragstart.drag",a4,fB);"onselectstart"in s?i.on("selectstart.drag",a4,fB):(s.__noselect=s.style.MozUserSelect,s.style.MozUserSelect="none")}function rme(o,s){var i=o.document.documentElement,u=Mh(o).on("dragstart.drag",null);s&&(u.on("click.drag",a4,fB),setTimeout(function(){u.on("click.drag",null)},0)),"onselectstart"in i?u.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const RH=o=>()=>o;function kne(o,{sourceEvent:s,subject:i,target:u,identifier:m,active:h,x:b,y:C,dx:S,dy:_,dispatch:N}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:s,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:u,enumerable:!0,configurable:!0},identifier:{value:m,enumerable:!0,configurable:!0},active:{value:h,enumerable:!0,configurable:!0},x:{value:b,enumerable:!0,configurable:!0},y:{value:C,enumerable:!0,configurable:!0},dx:{value:S,enumerable:!0,configurable:!0},dy:{value:_,enumerable:!0,configurable:!0},_:{value:N}})}kne.prototype.on=function(){var o=this._.on.apply(this._,arguments);return o===this._?this:o};function IIe(o){return!o.ctrlKey&&!o.button}function PIe(){return this.parentNode}function FIe(o,s){return s??{x:o.x,y:o.y}}function LIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function VIe(){var o=IIe,s=PIe,i=FIe,u=LIe,m={},h=IU("start","drag","end"),b=0,C,S,_,N,O=0;function R(fe){fe.on("mousedown.drag",I).filter(u).on("touchstart.drag",Q).on("touchmove.drag",q,RIe).on("touchend.drag touchcancel.drag",Z).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function I(fe,Ve){if(!(N||!o.call(this,fe,Ve))){var Ce=L(this,s.call(this,fe,Ve),fe,Ve,"mouse");Ce&&(Mh(fe.view).on("mousemove.drag",W,fB).on("mouseup.drag",G,fB),sme(fe.view),bte(fe),_=!1,C=fe.clientX,S=fe.clientY,Ce("start",fe))}}function W(fe){if(a4(fe),!_){var Ve=fe.clientX-C,Ce=fe.clientY-S;_=Ve*Ve+Ce*Ce>O}m.mouse("drag",fe)}function G(fe){Mh(fe.view).on("mousemove.drag mouseup.drag",null),rme(fe.view,_),a4(fe),m.mouse("end",fe)}function Q(fe,Ve){if(o.call(this,fe,Ve)){var Ce=fe.changedTouches,Y=s.call(this,fe,Ve),Re=Ce.length,it,Je;for(it=0;it<Re;++it)(Je=L(this,Y,fe,Ve,Ce[it].identifier,Ce[it]))&&(bte(fe),Je("start",fe,Ce[it]))}}function q(fe){var Ve=fe.changedTouches,Ce=Ve.length,Y,Re;for(Y=0;Y<Ce;++Y)(Re=m[Ve[Y].identifier])&&(a4(fe),Re("drag",fe,Ve[Y]))}function Z(fe){var Ve=fe.changedTouches,Ce=Ve.length,Y,Re;for(N&&clearTimeout(N),N=setTimeout(function(){N=null},500),Y=0;Y<Ce;++Y)(Re=m[Ve[Y].identifier])&&(bte(fe),Re("end",fe,Ve[Y]))}function L(fe,Ve,Ce,Y,Re,it){var Je=h.copy(),_e=Ov(it||Ce,Ve),ue,It,pe;if((pe=i.call(fe,new kne("beforestart",{sourceEvent:Ce,target:R,identifier:Re,active:b,x:_e[0],y:_e[1],dx:0,dy:0,dispatch:Je}),Y))!=null)return ue=pe.x-_e[0]||0,It=pe.y-_e[1]||0,function be($,ke,le){var qe=_e,Xe;switch($){case"start":m[Re]=be,Xe=b++;break;case"end":delete m[Re],--b;case"drag":_e=Ov(le||ke,Ve),Xe=b;break}Je.call($,fe,new kne($,{sourceEvent:ke,subject:pe,target:R,identifier:Re,active:Xe,x:_e[0]+ue,y:_e[1]+It,dx:_e[0]-qe[0],dy:_e[1]-qe[1],dispatch:Je}),Y)}}return R.filter=function(fe){return arguments.length?(o=typeof fe=="function"?fe:RH(!!fe),R):o},R.container=function(fe){return arguments.length?(s=typeof fe=="function"?fe:RH(fe),R):s},R.subject=function(fe){return arguments.length?(i=typeof fe=="function"?fe:RH(fe),R):i},R.touchable=function(fe){return arguments.length?(u=typeof fe=="function"?fe:RH(!!fe),R):u},R.on=function(){var fe=h.on.apply(h,arguments);return fe===h?R:fe},R.clickDistance=function(fe){return arguments.length?(O=(fe=+fe)*fe,R):Math.sqrt(O)},R}function Hoe(o,s,i){o.prototype=s.prototype=i,i.constructor=o}function ame(o,s){var i=Object.create(o.prototype);for(var u in s)i[u]=s[u];return i}function FB(){}var mB=.7,Iz=1/mB,i4="\\s*([+-]?\\d+)\\s*",pB="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Mv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",HIe=/^#([0-9a-f]{3,8})$/,zIe=new RegExp(`^rgb\\(${i4},${i4},${i4}\\)$`),UIe=new RegExp(`^rgb\\(${Mv},${Mv},${Mv}\\)$`),jIe=new RegExp(`^rgba\\(${i4},${i4},${i4},${pB}\\)$`),WIe=new RegExp(`^rgba\\(${Mv},${Mv},${Mv},${pB}\\)$`),ZIe=new RegExp(`^hsl\\(${pB},${Mv},${Mv}\\)$`),GIe=new RegExp(`^hsla\\(${pB},${Mv},${Mv},${pB}\\)$`),mle={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Hoe(FB,gB,{copy(o){return Object.assign(new this.constructor,this,o)},displayable(){return this.rgb().displayable()},hex:ple,formatHex:ple,formatHex8:qIe,formatHsl:YIe,formatRgb:gle,toString:gle});function ple(){return this.rgb().formatHex()}function qIe(){return this.rgb().formatHex8()}function YIe(){return ime(this).formatHsl()}function gle(){return this.rgb().formatRgb()}function gB(o){var s,i;return o=(o+"").trim().toLowerCase(),(s=HIe.exec(o))?(i=s[1].length,s=parseInt(s[1],16),i===6?hle(s):i===3?new Sm(s>>8&15|s>>4&240,s>>4&15|s&240,(s&15)<<4|s&15,1):i===8?IH(s>>24&255,s>>16&255,s>>8&255,(s&255)/255):i===4?IH(s>>12&15|s>>8&240,s>>8&15|s>>4&240,s>>4&15|s&240,((s&15)<<4|s&15)/255):null):(s=zIe.exec(o))?new Sm(s[1],s[2],s[3],1):(s=UIe.exec(o))?new Sm(s[1]*255/100,s[2]*255/100,s[3]*255/100,1):(s=jIe.exec(o))?IH(s[1],s[2],s[3],s[4]):(s=WIe.exec(o))?IH(s[1]*255/100,s[2]*255/100,s[3]*255/100,s[4]):(s=ZIe.exec(o))?yle(s[1],s[2]/100,s[3]/100,1):(s=GIe.exec(o))?yle(s[1],s[2]/100,s[3]/100,s[4]):mle.hasOwnProperty(o)?hle(mle[o]):o==="transparent"?new Sm(NaN,NaN,NaN,0):null}function hle(o){return new Sm(o>>16&255,o>>8&255,o&255,1)}function IH(o,s,i,u){return u<=0&&(o=s=i=NaN),new Sm(o,s,i,u)}function KIe(o){return o instanceof FB||(o=gB(o)),o?(o=o.rgb(),new Sm(o.r,o.g,o.b,o.opacity)):new Sm}function Tne(o,s,i,u){return arguments.length===1?KIe(o):new Sm(o,s,i,u??1)}function Sm(o,s,i,u){this.r=+o,this.g=+s,this.b=+i,this.opacity=+u}Hoe(Sm,Tne,ame(FB,{brighter(o){return o=o==null?Iz:Math.pow(Iz,o),new Sm(this.r*o,this.g*o,this.b*o,this.opacity)},darker(o){return o=o==null?mB:Math.pow(mB,o),new Sm(this.r*o,this.g*o,this.b*o,this.opacity)},rgb(){return this},clamp(){return new Sm(_E(this.r),_E(this.g),_E(this.b),Pz(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:vle,formatHex:vle,formatHex8:XIe,formatRgb:ble,toString:ble}));function vle(){return`#${bE(this.r)}${bE(this.g)}${bE(this.b)}`}function XIe(){return`#${bE(this.r)}${bE(this.g)}${bE(this.b)}${bE((isNaN(this.opacity)?1:this.opacity)*255)}`}function ble(){const o=Pz(this.opacity);return`${o===1?"rgb(":"rgba("}${_E(this.r)}, ${_E(this.g)}, ${_E(this.b)}${o===1?")":`, ${o})`}`}function Pz(o){return isNaN(o)?1:Math.max(0,Math.min(1,o))}function _E(o){return Math.max(0,Math.min(255,Math.round(o)||0))}function bE(o){return o=_E(o),(o<16?"0":"")+o.toString(16)}function yle(o,s,i,u){return u<=0?o=s=i=NaN:i<=0||i>=1?o=s=NaN:s<=0&&(o=NaN),new Bh(o,s,i,u)}function ime(o){if(o instanceof Bh)return new Bh(o.h,o.s,o.l,o.opacity);if(o instanceof FB||(o=gB(o)),!o)return new Bh;if(o instanceof Bh)return o;o=o.rgb();var s=o.r/255,i=o.g/255,u=o.b/255,m=Math.min(s,i,u),h=Math.max(s,i,u),b=NaN,C=h-m,S=(h+m)/2;return C?(s===h?b=(i-u)/C+(i<u)*6:i===h?b=(u-s)/C+2:b=(s-i)/C+4,C/=S<.5?h+m:2-h-m,b*=60):C=S>0&&S<1?0:b,new Bh(b,C,S,o.opacity)}function JIe(o,s,i,u){return arguments.length===1?ime(o):new Bh(o,s,i,u??1)}function Bh(o,s,i,u){this.h=+o,this.s=+s,this.l=+i,this.opacity=+u}Hoe(Bh,JIe,ame(FB,{brighter(o){return o=o==null?Iz:Math.pow(Iz,o),new Bh(this.h,this.s,this.l*o,this.opacity)},darker(o){return o=o==null?mB:Math.pow(mB,o),new Bh(this.h,this.s,this.l*o,this.opacity)},rgb(){var o=this.h%360+(this.h<0)*360,s=isNaN(o)||isNaN(this.s)?0:this.s,i=this.l,u=i+(i<.5?i:1-i)*s,m=2*i-u;return new Sm(yte(o>=240?o-240:o+120,m,u),yte(o,m,u),yte(o<120?o+240:o-120,m,u),this.opacity)},clamp(){return new Bh(wle(this.h),PH(this.s),PH(this.l),Pz(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const o=Pz(this.opacity);return`${o===1?"hsl(":"hsla("}${wle(this.h)}, ${PH(this.s)*100}%, ${PH(this.l)*100}%${o===1?")":`, ${o})`}`}}));function wle(o){return o=(o||0)%360,o<0?o+360:o}function PH(o){return Math.max(0,Math.min(1,o||0))}function yte(o,s,i){return(o<60?s+(i-s)*o/60:o<180?i:o<240?s+(i-s)*(240-o)/60:s)*255}const lme=o=>()=>o;function QIe(o,s){return function(i){return o+i*s}}function ePe(o,s,i){return o=Math.pow(o,i),s=Math.pow(s,i)-o,i=1/i,function(u){return Math.pow(o+u*s,i)}}function tPe(o){return(o=+o)==1?cme:function(s,i){return i-s?ePe(s,i,o):lme(isNaN(s)?i:s)}}function cme(o,s){var i=s-o;return i?QIe(o,i):lme(isNaN(o)?s:o)}const Cle=function o(s){var i=tPe(s);function u(m,h){var b=i((m=Tne(m)).r,(h=Tne(h)).r),C=i(m.g,h.g),S=i(m.b,h.b),_=cme(m.opacity,h.opacity);return function(N){return m.r=b(N),m.g=C(N),m.b=S(N),m.opacity=_(N),m+""}}return u.gamma=o,u}(1);function r2(o,s){return o=+o,s=+s,function(i){return o*(1-i)+s*i}}var Ane=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wte=new RegExp(Ane.source,"g");function nPe(o){return function(){return o}}function oPe(o){return function(s){return o(s)+""}}function sPe(o,s){var i=Ane.lastIndex=wte.lastIndex=0,u,m,h,b=-1,C=[],S=[];for(o=o+"",s=s+"";(u=Ane.exec(o))&&(m=wte.exec(s));)(h=m.index)>i&&(h=s.slice(i,h),C[b]?C[b]+=h:C[++b]=h),(u=u[0])===(m=m[0])?C[b]?C[b]+=m:C[++b]=m:(C[++b]=null,S.push({i:b,x:r2(u,m)})),i=wte.lastIndex;return i<s.length&&(h=s.slice(i),C[b]?C[b]+=h:C[++b]=h),C.length<2?S[0]?oPe(S[0].x):nPe(s):(s=S.length,function(_){for(var N=0,O;N<s;++N)C[(O=S[N]).i]=O.x(_);return C.join("")})}var Sle=180/Math.PI,Nne={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ume(o,s,i,u,m,h){var b,C,S;return(b=Math.sqrt(o*o+s*s))&&(o/=b,s/=b),(S=o*i+s*u)&&(i-=o*S,u-=s*S),(C=Math.sqrt(i*i+u*u))&&(i/=C,u/=C,S/=C),o*u<s*i&&(o=-o,s=-s,S=-S,b=-b),{translateX:m,translateY:h,rotate:Math.atan2(s,o)*Sle,skewX:Math.atan(S)*Sle,scaleX:b,scaleY:C}}var FH;function rPe(o){const s=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(o+"");return s.isIdentity?Nne:ume(s.a,s.b,s.c,s.d,s.e,s.f)}function aPe(o){return o==null||(FH||(FH=document.createElementNS("http://www.w3.org/2000/svg","g")),FH.setAttribute("transform",o),!(o=FH.transform.baseVal.consolidate()))?Nne:(o=o.matrix,ume(o.a,o.b,o.c,o.d,o.e,o.f))}function dme(o,s,i,u){function m(_){return _.length?_.pop()+" ":""}function h(_,N,O,R,I,W){if(_!==O||N!==R){var G=I.push("translate(",null,s,null,i);W.push({i:G-4,x:r2(_,O)},{i:G-2,x:r2(N,R)})}else(O||R)&&I.push("translate("+O+s+R+i)}function b(_,N,O,R){_!==N?(_-N>180?N+=360:N-_>180&&(_+=360),R.push({i:O.push(m(O)+"rotate(",null,u)-2,x:r2(_,N)})):N&&O.push(m(O)+"rotate("+N+u)}function C(_,N,O,R){_!==N?R.push({i:O.push(m(O)+"skewX(",null,u)-2,x:r2(_,N)}):N&&O.push(m(O)+"skewX("+N+u)}function S(_,N,O,R,I,W){if(_!==O||N!==R){var G=I.push(m(I)+"scale(",null,",",null,")");W.push({i:G-4,x:r2(_,O)},{i:G-2,x:r2(N,R)})}else(O!==1||R!==1)&&I.push(m(I)+"scale("+O+","+R+")")}return function(_,N){var O=[],R=[];return _=o(_),N=o(N),h(_.translateX,_.translateY,N.translateX,N.translateY,O,R),b(_.rotate,N.rotate,O,R),C(_.skewX,N.skewX,O,R),S(_.scaleX,_.scaleY,N.scaleX,N.scaleY,O,R),_=N=null,function(I){for(var W=-1,G=R.length,Q;++W<G;)O[(Q=R[W]).i]=Q.x(I);return O.join("")}}}var iPe=dme(rPe,"px, ","px)","deg)"),lPe=dme(aPe,", ",")",")"),cPe=1e-12;function xle(o){return((o=Math.exp(o))+1/o)/2}function uPe(o){return((o=Math.exp(o))-1/o)/2}function dPe(o){return((o=Math.exp(2*o))-1)/(o+1)}const fPe=function o(s,i,u){function m(h,b){var C=h[0],S=h[1],_=h[2],N=b[0],O=b[1],R=b[2],I=N-C,W=O-S,G=I*I+W*W,Q,q;if(G<cPe)q=Math.log(R/_)/s,Q=function(Y){return[C+Y*I,S+Y*W,_*Math.exp(s*Y*q)]};else{var Z=Math.sqrt(G),L=(R*R-_*_+u*G)/(2*_*i*Z),fe=(R*R-_*_-u*G)/(2*R*i*Z),Ve=Math.log(Math.sqrt(L*L+1)-L),Ce=Math.log(Math.sqrt(fe*fe+1)-fe);q=(Ce-Ve)/s,Q=function(Y){var Re=Y*q,it=xle(Ve),Je=_/(i*Z)*(it*dPe(s*Re+Ve)-uPe(Ve));return[C+Je*I,S+Je*W,_*it/xle(s*Re+Ve)]}}return Q.duration=q*1e3*s/Math.SQRT2,Q}return m.rho=function(h){var b=Math.max(.001,+h),C=b*b,S=C*C;return o(b,C,S)},m}(Math.SQRT2,2,4);var h4=0,L6=0,I6=0,fme=1e3,Fz,V6,Lz=0,$E=0,FU=0,hB=typeof performance=="object"&&performance.now?performance:Date,mme=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(o){setTimeout(o,17)};function zoe(){return $E||(mme(mPe),$E=hB.now()+FU)}function mPe(){$E=0}function Vz(){this._call=this._time=this._next=null}Vz.prototype=pme.prototype={constructor:Vz,restart:function(o,s,i){if(typeof o!="function")throw new TypeError("callback is not a function");i=(i==null?zoe():+i)+(s==null?0:+s),!this._next&&V6!==this&&(V6?V6._next=this:Fz=this,V6=this),this._call=o,this._time=i,One()},stop:function(){this._call&&(this._call=null,this._time=1/0,One())}};function pme(o,s,i){var u=new Vz;return u.restart(o,s,i),u}function pPe(){zoe(),++h4;for(var o=Fz,s;o;)(s=$E-o._time)>=0&&o._call.call(void 0,s),o=o._next;--h4}function Ele(){$E=(Lz=hB.now())+FU,h4=L6=0;try{pPe()}finally{h4=0,hPe(),$E=0}}function gPe(){var o=hB.now(),s=o-Lz;s>fme&&(FU-=s,Lz=o)}function hPe(){for(var o,s=Fz,i,u=1/0;s;)s._call?(u>s._time&&(u=s._time),o=s,s=s._next):(i=s._next,s._next=null,s=o?o._next=i:Fz=i);V6=o,One(u)}function One(o){if(!h4){L6&&(L6=clearTimeout(L6));var s=o-$E;s>24?(o<1/0&&(L6=setTimeout(Ele,o-hB.now()-FU)),I6&&(I6=clearInterval(I6))):(I6||(Lz=hB.now(),I6=setInterval(gPe,fme)),h4=1,mme(Ele))}}function _le(o,s,i){var u=new Vz;return s=s==null?0:+s,u.restart(m=>{u.stop(),o(m+s)},s,i),u}var vPe=IU("start","end","cancel","interrupt"),bPe=[],gme=0,kle=1,$ne=2,iz=3,Tle=4,Dne=5,lz=6;function LU(o,s,i,u,m,h){var b=o.__transition;if(!b)o.__transition={};else if(i in b)return;yPe(o,i,{name:s,index:u,group:m,on:vPe,tween:bPe,time:h.time,delay:h.delay,duration:h.duration,ease:h.ease,timer:null,state:gme})}function Uoe(o,s){var i=Fh(o,s);if(i.state>gme)throw new Error("too late; already scheduled");return i}function Fv(o,s){var i=Fh(o,s);if(i.state>iz)throw new Error("too late; already running");return i}function Fh(o,s){var i=o.__transition;if(!i||!(i=i[s]))throw new Error("transition not found");return i}function yPe(o,s,i){var u=o.__transition,m;u[s]=i,i.timer=pme(h,0,i.time);function h(_){i.state=kle,i.timer.restart(b,i.delay,i.time),i.delay<=_&&b(_-i.delay)}function b(_){var N,O,R,I;if(i.state!==kle)return S();for(N in u)if(I=u[N],I.name===i.name){if(I.state===iz)return _le(b);I.state===Tle?(I.state=lz,I.timer.stop(),I.on.call("interrupt",o,o.__data__,I.index,I.group),delete u[N]):+N<s&&(I.state=lz,I.timer.stop(),I.on.call("cancel",o,o.__data__,I.index,I.group),delete u[N])}if(_le(function(){i.state===iz&&(i.state=Tle,i.timer.restart(C,i.delay,i.time),C(_))}),i.state=$ne,i.on.call("start",o,o.__data__,i.index,i.group),i.state===$ne){for(i.state=iz,m=new Array(R=i.tween.length),N=0,O=-1;N<R;++N)(I=i.tween[N].value.call(o,o.__data__,i.index,i.group))&&(m[++O]=I);m.length=O+1}}function C(_){for(var N=_<i.duration?i.ease.call(null,_/i.duration):(i.timer.restart(S),i.state=Dne,1),O=-1,R=m.length;++O<R;)m[O].call(o,N);i.state===Dne&&(i.on.call("end",o,o.__data__,i.index,i.group),S())}function S(){i.state=lz,i.timer.stop(),delete u[s];for(var _ in u)return;delete o.__transition}}function cz(o,s){var i=o.__transition,u,m,h=!0,b;if(i){s=s==null?null:s+"";for(b in i){if((u=i[b]).name!==s){h=!1;continue}m=u.state>$ne&&u.state<Dne,u.state=lz,u.timer.stop(),u.on.call(m?"interrupt":"cancel",o,o.__data__,u.index,u.group),delete i[b]}h&&delete o.__transition}}function wPe(o){return this.each(function(){cz(this,o)})}function CPe(o,s){var i,u;return function(){var m=Fv(this,o),h=m.tween;if(h!==i){u=i=h;for(var b=0,C=u.length;b<C;++b)if(u[b].name===s){u=u.slice(),u.splice(b,1);break}}m.tween=u}}function SPe(o,s,i){var u,m;if(typeof i!="function")throw new Error;return function(){var h=Fv(this,o),b=h.tween;if(b!==u){m=(u=b).slice();for(var C={name:s,value:i},S=0,_=m.length;S<_;++S)if(m[S].name===s){m[S]=C;break}S===_&&m.push(C)}h.tween=m}}function xPe(o,s){var i=this._id;if(o+="",arguments.length<2){for(var u=Fh(this.node(),i).tween,m=0,h=u.length,b;m<h;++m)if((b=u[m]).name===o)return b.value;return null}return this.each((s==null?CPe:SPe)(i,o,s))}function joe(o,s,i){var u=o._id;return o.each(function(){var m=Fv(this,u);(m.value||(m.value={}))[s]=i.apply(this,arguments)}),function(m){return Fh(m,u).value[s]}}function hme(o,s){var i;return(typeof s=="number"?r2:s instanceof gB?Cle:(i=gB(s))?(s=i,Cle):sPe)(o,s)}function EPe(o){return function(){this.removeAttribute(o)}}function _Pe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function kPe(o,s,i){var u,m=i+"",h;return function(){var b=this.getAttribute(o);return b===m?null:b===u?h:h=s(u=b,i)}}function TPe(o,s,i){var u,m=i+"",h;return function(){var b=this.getAttributeNS(o.space,o.local);return b===m?null:b===u?h:h=s(u=b,i)}}function APe(o,s,i){var u,m,h;return function(){var b,C=i(this),S;return C==null?void this.removeAttribute(o):(b=this.getAttribute(o),S=C+"",b===S?null:b===u&&S===m?h:(m=S,h=s(u=b,C)))}}function NPe(o,s,i){var u,m,h;return function(){var b,C=i(this),S;return C==null?void this.removeAttributeNS(o.space,o.local):(b=this.getAttributeNS(o.space,o.local),S=C+"",b===S?null:b===u&&S===m?h:(m=S,h=s(u=b,C)))}}function OPe(o,s){var i=PU(o),u=i==="transform"?lPe:hme;return this.attrTween(o,typeof s=="function"?(i.local?NPe:APe)(i,u,joe(this,"attr."+o,s)):s==null?(i.local?_Pe:EPe)(i):(i.local?TPe:kPe)(i,u,s))}function $Pe(o,s){return function(i){this.setAttribute(o,s.call(this,i))}}function DPe(o,s){return function(i){this.setAttributeNS(o.space,o.local,s.call(this,i))}}function MPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&DPe(o,h)),i}return m._value=s,m}function BPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&$Pe(o,h)),i}return m._value=s,m}function RPe(o,s){var i="attr."+o;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(s==null)return this.tween(i,null);if(typeof s!="function")throw new Error;var u=PU(o);return this.tween(i,(u.local?MPe:BPe)(u,s))}function IPe(o,s){return function(){Uoe(this,o).delay=+s.apply(this,arguments)}}function PPe(o,s){return s=+s,function(){Uoe(this,o).delay=s}}function FPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?IPe:PPe)(s,o)):Fh(this.node(),s).delay}function LPe(o,s){return function(){Fv(this,o).duration=+s.apply(this,arguments)}}function VPe(o,s){return s=+s,function(){Fv(this,o).duration=s}}function HPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?LPe:VPe)(s,o)):Fh(this.node(),s).duration}function zPe(o,s){if(typeof s!="function")throw new Error;return function(){Fv(this,o).ease=s}}function UPe(o){var s=this._id;return arguments.length?this.each(zPe(s,o)):Fh(this.node(),s).ease}function jPe(o,s){return function(){var i=s.apply(this,arguments);if(typeof i!="function")throw new Error;Fv(this,o).ease=i}}function WPe(o){if(typeof o!="function")throw new Error;return this.each(jPe(this._id,o))}function ZPe(o){typeof o!="function"&&(o=qfe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=[],S,_=0;_<b;++_)(S=h[_])&&o.call(S,S.__data__,_,h)&&C.push(S);return new V0(u,this._parents,this._name,this._id)}function GPe(o){if(o._id!==this._id)throw new Error;for(var s=this._groups,i=o._groups,u=s.length,m=i.length,h=Math.min(u,m),b=new Array(u),C=0;C<h;++C)for(var S=s[C],_=i[C],N=S.length,O=b[C]=new Array(N),R,I=0;I<N;++I)(R=S[I]||_[I])&&(O[I]=R);for(;C<u;++C)b[C]=s[C];return new V0(b,this._parents,this._name,this._id)}function qPe(o){return(o+"").trim().split(/^|\s+/).every(function(s){var i=s.indexOf(".");return i>=0&&(s=s.slice(0,i)),!s||s==="start"})}function YPe(o,s,i){var u,m,h=qPe(s)?Uoe:Fv;return function(){var b=h(this,o),C=b.on;C!==u&&(m=(u=C).copy()).on(s,i),b.on=m}}function KPe(o,s){var i=this._id;return arguments.length<2?Fh(this.node(),i).on.on(o):this.each(YPe(i,o,s))}function XPe(o){return function(){var s=this.parentNode;for(var i in this.__transition)if(+i!==o)return;s&&s.removeChild(this)}}function JPe(){return this.on("end.remove",XPe(this._id))}function QPe(o){var s=this._name,i=this._id;typeof o!="function"&&(o=Loe(o));for(var u=this._groups,m=u.length,h=new Array(m),b=0;b<m;++b)for(var C=u[b],S=C.length,_=h[b]=new Array(S),N,O,R=0;R<S;++R)(N=C[R])&&(O=o.call(N,N.__data__,R,C))&&("__data__"in N&&(O.__data__=N.__data__),_[R]=O,LU(_[R],s,i,R,_,Fh(N,i)));return new V0(h,this._parents,s,i)}function e8e(o){var s=this._name,i=this._id;typeof o!="function"&&(o=Gfe(o));for(var u=this._groups,m=u.length,h=[],b=[],C=0;C<m;++C)for(var S=u[C],_=S.length,N,O=0;O<_;++O)if(N=S[O]){for(var R=o.call(N,N.__data__,O,S),I,W=Fh(N,i),G=0,Q=R.length;G<Q;++G)(I=R[G])&&LU(I,s,i,G,R,W);h.push(R),b.push(N)}return new V0(h,b,s,i)}var t8e=PB.prototype.constructor;function n8e(){return new t8e(this._groups,this._parents)}function o8e(o,s){var i,u,m;return function(){var h=g4(this,o),b=(this.style.removeProperty(o),g4(this,o));return h===b?null:h===i&&b===u?m:m=s(i=h,u=b)}}function vme(o){return function(){this.style.removeProperty(o)}}function s8e(o,s,i){var u,m=i+"",h;return function(){var b=g4(this,o);return b===m?null:b===u?h:h=s(u=b,i)}}function r8e(o,s,i){var u,m,h;return function(){var b=g4(this,o),C=i(this),S=C+"";return C==null&&(S=C=(this.style.removeProperty(o),g4(this,o))),b===S?null:b===u&&S===m?h:(m=S,h=s(u=b,C))}}function a8e(o,s){var i,u,m,h="style."+s,b="end."+h,C;return function(){var S=Fv(this,o),_=S.on,N=S.value[h]==null?C||(C=vme(s)):void 0;(_!==i||m!==N)&&(u=(i=_).copy()).on(b,m=N),S.on=u}}function i8e(o,s,i){var u=(o+="")=="transform"?iPe:hme;return s==null?this.styleTween(o,o8e(o,u)).on("end.style."+o,vme(o)):typeof s=="function"?this.styleTween(o,r8e(o,u,joe(this,"style."+o,s))).each(a8e(this._id,o)):this.styleTween(o,s8e(o,u,s),i).on("end.style."+o,null)}function l8e(o,s,i){return function(u){this.style.setProperty(o,s.call(this,u),i)}}function c8e(o,s,i){var u,m;function h(){var b=s.apply(this,arguments);return b!==m&&(u=(m=b)&&l8e(o,b,i)),u}return h._value=s,h}function u8e(o,s,i){var u="style."+(o+="");if(arguments.length<2)return(u=this.tween(u))&&u._value;if(s==null)return this.tween(u,null);if(typeof s!="function")throw new Error;return this.tween(u,c8e(o,s,i??""))}function d8e(o){return function(){this.textContent=o}}function f8e(o){return function(){var s=o(this);this.textContent=s??""}}function m8e(o){return this.tween("text",typeof o=="function"?f8e(joe(this,"text",o)):d8e(o==null?"":o+""))}function p8e(o){return function(s){this.textContent=o.call(this,s)}}function g8e(o){var s,i;function u(){var m=o.apply(this,arguments);return m!==i&&(s=(i=m)&&p8e(m)),s}return u._value=o,u}function h8e(o){var s="text";if(arguments.length<1)return(s=this.tween(s))&&s._value;if(o==null)return this.tween(s,null);if(typeof o!="function")throw new Error;return this.tween(s,g8e(o))}function v8e(){for(var o=this._name,s=this._id,i=bme(),u=this._groups,m=u.length,h=0;h<m;++h)for(var b=u[h],C=b.length,S,_=0;_<C;++_)if(S=b[_]){var N=Fh(S,s);LU(S,o,i,_,b,{time:N.time+N.delay+N.duration,delay:0,duration:N.duration,ease:N.ease})}return new V0(u,this._parents,o,i)}function b8e(){var o,s,i=this,u=i._id,m=i.size();return new Promise(function(h,b){var C={value:b},S={value:function(){--m===0&&h()}};i.each(function(){var _=Fv(this,u),N=_.on;N!==o&&(s=(o=N).copy(),s._.cancel.push(C),s._.interrupt.push(C),s._.end.push(S)),_.on=s}),m===0&&h()})}var y8e=0;function V0(o,s,i,u){this._groups=o,this._parents=s,this._name=i,this._id=u}function bme(){return++y8e}var $0=PB.prototype;V0.prototype={constructor:V0,select:QPe,selectAll:e8e,selectChild:$0.selectChild,selectChildren:$0.selectChildren,filter:ZPe,merge:GPe,selection:n8e,transition:v8e,call:$0.call,nodes:$0.nodes,node:$0.node,size:$0.size,empty:$0.empty,each:$0.each,on:KPe,attr:OPe,attrTween:RPe,style:i8e,styleTween:u8e,text:m8e,textTween:h8e,remove:JPe,tween:xPe,delay:FPe,duration:HPe,ease:UPe,easeVarying:WPe,end:b8e,[Symbol.iterator]:$0[Symbol.iterator]};function w8e(o){return((o*=2)<=1?o*o*o:(o-=2)*o*o+2)/2}var C8e={time:null,delay:0,duration:250,ease:w8e};function S8e(o,s){for(var i;!(i=o.__transition)||!(i=i[s]);)if(!(o=o.parentNode))throw new Error(`transition ${s} not found`);return i}function x8e(o){var s,i;o instanceof V0?(s=o._id,o=o._name):(s=bme(),(i=C8e).time=zoe(),o=o==null?null:o+"");for(var u=this._groups,m=u.length,h=0;h<m;++h)for(var b=u[h],C=b.length,S,_=0;_<C;++_)(S=b[_])&&LU(S,o,s,_,b,i||S8e(S,s));return new V0(u,this._parents,o,s)}PB.prototype.interrupt=wPe;PB.prototype.transition=x8e;const LH=o=>()=>o;function E8e(o,{sourceEvent:s,target:i,transform:u,dispatch:m}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:s,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:u,enumerable:!0,configurable:!0},_:{value:m}})}function I0(o,s,i){this.k=o,this.x=s,this.y=i}I0.prototype={constructor:I0,scale:function(o){return o===1?this:new I0(this.k*o,this.x,this.y)},translate:function(o,s){return o===0&s===0?this:new I0(this.k,this.x+this.k*o,this.y+this.k*s)},apply:function(o){return[o[0]*this.k+this.x,o[1]*this.k+this.y]},applyX:function(o){return o*this.k+this.x},applyY:function(o){return o*this.k+this.y},invert:function(o){return[(o[0]-this.x)/this.k,(o[1]-this.y)/this.k]},invertX:function(o){return(o-this.x)/this.k},invertY:function(o){return(o-this.y)/this.k},rescaleX:function(o){return o.copy().domain(o.range().map(this.invertX,this).map(o.invert,o))},rescaleY:function(o){return o.copy().domain(o.range().map(this.invertY,this).map(o.invert,o))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var v4=new I0(1,0,0);I0.prototype;function Cte(o){o.stopImmediatePropagation()}function P6(o){o.preventDefault(),o.stopImmediatePropagation()}function _8e(o){return(!o.ctrlKey||o.type==="wheel")&&!o.button}function k8e(){var o=this;return o instanceof SVGElement?(o=o.ownerSVGElement||o,o.hasAttribute("viewBox")?(o=o.viewBox.baseVal,[[o.x,o.y],[o.x+o.width,o.y+o.height]]):[[0,0],[o.width.baseVal.value,o.height.baseVal.value]]):[[0,0],[o.clientWidth,o.clientHeight]]}function Ale(){return this.__zoom||v4}function T8e(o){return-o.deltaY*(o.deltaMode===1?.05:o.deltaMode?1:.002)*(o.ctrlKey?10:1)}function A8e(){return navigator.maxTouchPoints||"ontouchstart"in this}function N8e(o,s,i){var u=o.invertX(s[0][0])-i[0][0],m=o.invertX(s[1][0])-i[1][0],h=o.invertY(s[0][1])-i[0][1],b=o.invertY(s[1][1])-i[1][1];return o.translate(m>u?(u+m)/2:Math.min(0,u)||Math.max(0,m),b>h?(h+b)/2:Math.min(0,h)||Math.max(0,b))}function O8e(){var o=_8e,s=k8e,i=N8e,u=T8e,m=A8e,h=[0,1/0],b=[[-1/0,-1/0],[1/0,1/0]],C=250,S=fPe,_=IU("start","zoom","end"),N,O,R,I=500,W=150,G=0,Q=10;function q(pe){pe.property("__zoom",Ale).on("wheel.zoom",Re,{passive:!1}).on("mousedown.zoom",it).on("dblclick.zoom",Je).filter(m).on("touchstart.zoom",_e).on("touchmove.zoom",ue).on("touchend.zoom touchcancel.zoom",It).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}q.transform=function(pe,be,$,ke){var le=pe.selection?pe.selection():pe;le.property("__zoom",Ale),pe!==le?Ve(pe,be,$,ke):le.interrupt().each(function(){Ce(this,arguments).event(ke).start().zoom(null,typeof be=="function"?be.apply(this,arguments):be).end()})},q.scaleBy=function(pe,be,$,ke){q.scaleTo(pe,function(){var le=this.__zoom.k,qe=typeof be=="function"?be.apply(this,arguments):be;return le*qe},$,ke)},q.scaleTo=function(pe,be,$,ke){q.transform(pe,function(){var le=s.apply(this,arguments),qe=this.__zoom,Xe=$==null?fe(le):typeof $=="function"?$.apply(this,arguments):$,ce=qe.invert(Xe),Ue=typeof be=="function"?be.apply(this,arguments):be;return i(L(Z(qe,Ue),Xe,ce),le,b)},$,ke)},q.translateBy=function(pe,be,$,ke){q.transform(pe,function(){return i(this.__zoom.translate(typeof be=="function"?be.apply(this,arguments):be,typeof $=="function"?$.apply(this,arguments):$),s.apply(this,arguments),b)},null,ke)},q.translateTo=function(pe,be,$,ke,le){q.transform(pe,function(){var qe=s.apply(this,arguments),Xe=this.__zoom,ce=ke==null?fe(qe):typeof ke=="function"?ke.apply(this,arguments):ke;return i(v4.translate(ce[0],ce[1]).scale(Xe.k).translate(typeof be=="function"?-be.apply(this,arguments):-be,typeof $=="function"?-$.apply(this,arguments):-$),qe,b)},ke,le)};function Z(pe,be){return be=Math.max(h[0],Math.min(h[1],be)),be===pe.k?pe:new I0(be,pe.x,pe.y)}function L(pe,be,$){var ke=be[0]-$[0]*pe.k,le=be[1]-$[1]*pe.k;return ke===pe.x&&le===pe.y?pe:new I0(pe.k,ke,le)}function fe(pe){return[(+pe[0][0]+ +pe[1][0])/2,(+pe[0][1]+ +pe[1][1])/2]}function Ve(pe,be,$,ke){pe.on("start.zoom",function(){Ce(this,arguments).event(ke).start()}).on("interrupt.zoom end.zoom",function(){Ce(this,arguments).event(ke).end()}).tween("zoom",function(){var le=this,qe=arguments,Xe=Ce(le,qe).event(ke),ce=s.apply(le,qe),Ue=$==null?fe(ce):typeof $=="function"?$.apply(le,qe):$,wt=Math.max(ce[1][0]-ce[0][0],ce[1][1]-ce[0][1]),He=le.__zoom,mt=typeof be=="function"?be.apply(le,qe):be,Ie=S(He.invert(Ue).concat(wt/He.k),mt.invert(Ue).concat(wt/mt.k));return function(pt){if(pt===1)pt=mt;else{var oe=Ie(pt),mn=wt/oe[2];pt=new I0(mn,Ue[0]-oe[0]*mn,Ue[1]-oe[1]*mn)}Xe.zoom(null,pt)}})}function Ce(pe,be,$){return!$&&pe.__zooming||new Y(pe,be)}function Y(pe,be){this.that=pe,this.args=be,this.active=0,this.sourceEvent=null,this.extent=s.apply(pe,be),this.taps=0}Y.prototype={event:function(pe){return pe&&(this.sourceEvent=pe),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(pe,be){return this.mouse&&pe!=="mouse"&&(this.mouse[1]=be.invert(this.mouse[0])),this.touch0&&pe!=="touch"&&(this.touch0[1]=be.invert(this.touch0[0])),this.touch1&&pe!=="touch"&&(this.touch1[1]=be.invert(this.touch1[0])),this.that.__zoom=be,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(pe){var be=Mh(this.that).datum();_.call(pe,this.that,new E8e(pe,{sourceEvent:this.sourceEvent,target:q,type:pe,transform:this.that.__zoom,dispatch:_}),be)}};function Re(pe,...be){if(!o.apply(this,arguments))return;var $=Ce(this,be).event(pe),ke=this.__zoom,le=Math.max(h[0],Math.min(h[1],ke.k*Math.pow(2,u.apply(this,arguments)))),qe=Ov(pe);if($.wheel)($.mouse[0][0]!==qe[0]||$.mouse[0][1]!==qe[1])&&($.mouse[1]=ke.invert($.mouse[0]=qe)),clearTimeout($.wheel);else{if(ke.k===le)return;$.mouse=[qe,ke.invert(qe)],cz(this),$.start()}P6(pe),$.wheel=setTimeout(Xe,W),$.zoom("mouse",i(L(Z(ke,le),$.mouse[0],$.mouse[1]),$.extent,b));function Xe(){$.wheel=null,$.end()}}function it(pe,...be){if(R||!o.apply(this,arguments))return;var $=pe.currentTarget,ke=Ce(this,be,!0).event(pe),le=Mh(pe.view).on("mousemove.zoom",Ue,!0).on("mouseup.zoom",wt,!0),qe=Ov(pe,$),Xe=pe.clientX,ce=pe.clientY;sme(pe.view),Cte(pe),ke.mouse=[qe,this.__zoom.invert(qe)],cz(this),ke.start();function Ue(He){if(P6(He),!ke.moved){var mt=He.clientX-Xe,Ie=He.clientY-ce;ke.moved=mt*mt+Ie*Ie>G}ke.event(He).zoom("mouse",i(L(ke.that.__zoom,ke.mouse[0]=Ov(He,$),ke.mouse[1]),ke.extent,b))}function wt(He){le.on("mousemove.zoom mouseup.zoom",null),rme(He.view,ke.moved),P6(He),ke.event(He).end()}}function Je(pe,...be){if(o.apply(this,arguments)){var $=this.__zoom,ke=Ov(pe.changedTouches?pe.changedTouches[0]:pe,this),le=$.invert(ke),qe=$.k*(pe.shiftKey?.5:2),Xe=i(L(Z($,qe),ke,le),s.apply(this,be),b);P6(pe),C>0?Mh(this).transition().duration(C).call(Ve,Xe,ke,pe):Mh(this).call(q.transform,Xe,ke,pe)}}function _e(pe,...be){if(o.apply(this,arguments)){var $=pe.touches,ke=$.length,le=Ce(this,be,pe.changedTouches.length===ke).event(pe),qe,Xe,ce,Ue;for(Cte(pe),Xe=0;Xe<ke;++Xe)ce=$[Xe],Ue=Ov(ce,this),Ue=[Ue,this.__zoom.invert(Ue),ce.identifier],le.touch0?!le.touch1&&le.touch0[2]!==Ue[2]&&(le.touch1=Ue,le.taps=0):(le.touch0=Ue,qe=!0,le.taps=1+!!N);N&&(N=clearTimeout(N)),qe&&(le.taps<2&&(O=Ue[0],N=setTimeout(function(){N=null},I)),cz(this),le.start())}}function ue(pe,...be){if(this.__zooming){var $=Ce(this,be).event(pe),ke=pe.changedTouches,le=ke.length,qe,Xe,ce,Ue;for(P6(pe),qe=0;qe<le;++qe)Xe=ke[qe],ce=Ov(Xe,this),$.touch0&&$.touch0[2]===Xe.identifier?$.touch0[0]=ce:$.touch1&&$.touch1[2]===Xe.identifier&&($.touch1[0]=ce);if(Xe=$.that.__zoom,$.touch1){var wt=$.touch0[0],He=$.touch0[1],mt=$.touch1[0],Ie=$.touch1[1],pt=(pt=mt[0]-wt[0])*pt+(pt=mt[1]-wt[1])*pt,oe=(oe=Ie[0]-He[0])*oe+(oe=Ie[1]-He[1])*oe;Xe=Z(Xe,Math.sqrt(pt/oe)),ce=[(wt[0]+mt[0])/2,(wt[1]+mt[1])/2],Ue=[(He[0]+Ie[0])/2,(He[1]+Ie[1])/2]}else if($.touch0)ce=$.touch0[0],Ue=$.touch0[1];else return;$.zoom("touch",i(L(Xe,ce,Ue),$.extent,b))}}function It(pe,...be){if(this.__zooming){var $=Ce(this,be).event(pe),ke=pe.changedTouches,le=ke.length,qe,Xe;for(Cte(pe),R&&clearTimeout(R),R=setTimeout(function(){R=null},I),qe=0;qe<le;++qe)Xe=ke[qe],$.touch0&&$.touch0[2]===Xe.identifier?delete $.touch0:$.touch1&&$.touch1[2]===Xe.identifier&&delete $.touch1;if($.touch1&&!$.touch0&&($.touch0=$.touch1,delete $.touch1),$.touch0)$.touch0[1]=this.__zoom.invert($.touch0[0]);else if($.end(),$.taps===2&&(Xe=Ov(Xe,this),Math.hypot(O[0]-Xe[0],O[1]-Xe[1])<Q)){var ce=Mh(this).on("dblclick.zoom");ce&&ce.apply(this,arguments)}}}return q.wheelDelta=function(pe){return arguments.length?(u=typeof pe=="function"?pe:LH(+pe),q):u},q.filter=function(pe){return arguments.length?(o=typeof pe=="function"?pe:LH(!!pe),q):o},q.touchable=function(pe){return arguments.length?(m=typeof pe=="function"?pe:LH(!!pe),q):m},q.extent=function(pe){return arguments.length?(s=typeof pe=="function"?pe:LH([[+pe[0][0],+pe[0][1]],[+pe[1][0],+pe[1][1]]]),q):s},q.scaleExtent=function(pe){return arguments.length?(h[0]=+pe[0],h[1]=+pe[1],q):[h[0],h[1]]},q.translateExtent=function(pe){return arguments.length?(b[0][0]=+pe[0][0],b[1][0]=+pe[1][0],b[0][1]=+pe[0][1],b[1][1]=+pe[1][1],q):[[b[0][0],b[0][1]],[b[1][0],b[1][1]]]},q.constrain=function(pe){return arguments.length?(i=pe,q):i},q.duration=function(pe){return arguments.length?(C=+pe,q):C},q.interpolate=function(pe){return arguments.length?(S=pe,q):S},q.on=function(){var pe=_.on.apply(_,arguments);return pe===_?q:pe},q.clickDistance=function(pe){return arguments.length?(G=(pe=+pe)*pe,q):Math.sqrt(G)},q.tapDistance=function(pe){return arguments.length?(Q=+pe,q):Q},q}var is=(o=>(o.Left="left",o.Top="top",o.Right="right",o.Bottom="bottom",o))(is||{}),Woe=(o=>(o.Partial="partial",o.Full="full",o))(Woe||{}),mE=(o=>(o.Bezier="default",o.SimpleBezier="simple-bezier",o.Straight="straight",o.Step="step",o.SmoothStep="smoothstep",o))(mE||{}),b2=(o=>(o.Strict="strict",o.Loose="loose",o))(b2||{}),Hz=(o=>(o.Arrow="arrow",o.ArrowClosed="arrowclosed",o))(Hz||{}),X6=(o=>(o.Free="free",o.Vertical="vertical",o.Horizontal="horizontal",o))(X6||{}),yme=(o=>(o.TopLeft="top-left",o.TopCenter="top-center",o.TopRight="top-right",o.BottomLeft="bottom-left",o.BottomCenter="bottom-center",o.BottomRight="bottom-right",o))(yme||{});const $8e=["INPUT","SELECT","TEXTAREA"];function Mne(o){var s,i;const u=((i=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:i[0])||o.target,m=typeof(u==null?void 0:u.hasAttribute)=="function"?u.hasAttribute("contenteditable"):!1,h=typeof(u==null?void 0:u.closest)=="function"?u.closest(".nokey"):null;return $8e.includes(u==null?void 0:u.nodeName)||m||!!h}function D8e(o){return o.ctrlKey||o.metaKey||o.shiftKey||o.altKey}function Nle(o,s,i,u){const m=s.replace("+",`
126
+ */(function(){const o=$e=>Ze=>($t=>{const Dt=typeof $t;return $t===null?"null":Dt==="object"&&Array.isArray($t)?"array":Dt==="object"&&(gn=yn=$t,(Ot=String).prototype.isPrototypeOf(gn)||((_t=yn.constructor)===null||_t===void 0?void 0:_t.name)===Ot.name)?"string":Dt;var gn,yn,Ot,_t})(Ze)===$e,s=$e=>Ze=>typeof Ze===$e,i=o("string"),u=o("array"),m=s("boolean"),h=$e=>$e===void 0,b=$e=>!(Ze=>Ze==null)($e),C=s("function"),S=s("number"),_=$e=>()=>$e,N=$e=>$e,O=_(!1),R=_(!0);class I{constructor(Ze,$t){this.tag=Ze,this.value=$t}static some(Ze){return new I(!0,Ze)}static none(){return I.singletonNone}fold(Ze,$t){return this.tag?$t(this.value):Ze()}isSome(){return this.tag}isNone(){return!this.tag}map(Ze){return this.tag?I.some(Ze(this.value)):I.none()}bind(Ze){return this.tag?Ze(this.value):I.none()}exists(Ze){return this.tag&&Ze(this.value)}forall(Ze){return!this.tag||Ze(this.value)}filter(Ze){return!this.tag||Ze(this.value)?this:I.none()}getOr(Ze){return this.tag?this.value:Ze}or(Ze){return this.tag?this:Ze}getOrThunk(Ze){return this.tag?this.value:Ze()}orThunk(Ze){return this.tag?this:Ze()}getOrDie(Ze){if(this.tag)return this.value;throw new Error(Ze??"Called getOrDie on None")}static from(Ze){return b(Ze)?I.some(Ze):I.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(Ze){this.tag&&Ze(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}I.singletonNone=new I(!1);const W=Array.prototype.indexOf,G=Array.prototype.push,Q=($e,Ze)=>(($t,Dt)=>W.call($t,Dt))($e,Ze)>-1,q=($e,Ze)=>{for(let $t=0,Dt=$e.length;$t<Dt;$t++)if(Ze($e[$t],$t))return!0;return!1},Z=($e,Ze)=>{const $t=$e.length,Dt=new Array($t);for(let gn=0;gn<$t;gn++){const yn=$e[gn];Dt[gn]=Ze(yn,gn)}return Dt},L=($e,Ze)=>{const $t=[];for(let Dt=0,gn=$e.length;Dt<gn;Dt++){const yn=$e[Dt];Ze(yn,Dt)&&$t.push(yn)}return $t},fe=($e,Ze)=>(($t,Dt,gn)=>{for(let yn=0,Ot=$t.length;yn<Ot;yn++){const _t=$t[yn];if(Dt(_t,yn))return I.some(_t);if(gn(_t,yn))break}return I.none()})($e,Ze,O),Ve=($e,Ze)=>($t=>{const Dt=[];for(let gn=0,yn=$t.length;gn<yn;++gn){if(!u($t[gn]))throw new Error("Arr.flatten item "+gn+" was not an array, input: "+$t);G.apply(Dt,$t[gn])}return Dt})(Z($e,Ze)),Ce=Object.keys,Y=Object.hasOwnProperty,Re=($e,Ze)=>{const $t=Ce($e);for(let Dt=0,gn=$t.length;Dt<gn;Dt++){const yn=$t[Dt];Ze($e[yn],yn)}},it=($e,Ze)=>{const $t={};return Re($e,(Dt,gn)=>{const yn=Ze(Dt,gn);$t[yn.k]=yn.v}),$t},Je=$e=>(Ze,$t)=>{$e[$t]=Ze},_e=$e=>((Ze,$t)=>{const Dt=[];return Re(Ze,(gn,yn)=>{Dt.push($t(gn,yn))}),Dt})($e,N),ue=($e,Ze)=>It($e,Ze)?I.from($e[Ze]):I.none(),It=($e,Ze)=>Y.call($e,Ze),pe=$e=>{let Ze=$e;return{get:()=>Ze,set:$t=>{Ze=$t}}},be=($e,Ze,$t=0,Dt)=>{const gn=$e.indexOf(Ze,$t);return gn!==-1&&(!!h(Dt)||gn+Ze.length<=Dt)},$=$e=>parseInt($e,10),ke=($e,Ze)=>{const $t=$e-Ze;return $t===0?0:$t>0?1:-1},le=($e,Ze,$t)=>({major:$e,minor:Ze,patch:$t}),qe=$e=>{const Ze=/([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec($e);return Ze?le($(Ze[1]),$(Ze[2]),$(Ze[3])):le(0,0,0)},Xe=()=>ce(0,0),ce=($e,Ze)=>({major:$e,minor:Ze}),Ue={nu:ce,detect:($e,Ze)=>{const $t=String(Ze).toLowerCase();return $e.length===0?Xe():((Dt,gn)=>{const yn=((_t,Ye)=>{for(let et=0;et<_t.length;et++){const jt=_t[et];if(jt.test(Ye))return jt}})(Dt,gn);if(!yn)return{major:0,minor:0};const Ot=_t=>Number(gn.replace(yn,"$"+_t));return ce(Ot(1),Ot(2))})($e,$t)},unknown:Xe},wt=($e,Ze)=>{const $t=String(Ze).toLowerCase();return fe($e,Dt=>Dt.search($t))},He=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,mt=$e=>Ze=>be(Ze,$e),Ie=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:$e=>be($e,"edge/")&&be($e,"chrome")&&be($e,"safari")&&be($e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,He],search:$e=>be($e,"chrome")&&!be($e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:$e=>be($e,"msie")||be($e,"trident")},{name:"Opera",versionRegexes:[He,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:mt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:mt("firefox")},{name:"Safari",versionRegexes:[He,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:$e=>(be($e,"safari")||be($e,"mobile/"))&&be($e,"applewebkit")}],pt=[{name:"Windows",search:mt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:$e=>be($e,"iphone")||be($e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:mt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:mt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:mt("linux"),versionRegexes:[]},{name:"Solaris",search:mt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:mt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:mt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],oe={browsers:_(Ie),oses:_(pt)},mn=$e=>{const Ze=$e.current,$t=$e.version,Dt=gn=>()=>Ze===gn;return{current:Ze,version:$t,isEdge:Dt("Edge"),isChromium:Dt("Chromium"),isIE:Dt("IE"),isOpera:Dt("Opera"),isFirefox:Dt("Firefox"),isSafari:Dt("Safari")}},gt=()=>mn({current:void 0,version:Ue.unknown()}),St=mn,Wt=$e=>{const Ze=$e.current,$t=$e.version,Dt=gn=>()=>Ze===gn;return{current:Ze,version:$t,isWindows:Dt("Windows"),isiOS:Dt("iOS"),isAndroid:Dt("Android"),isMacOS:Dt("macOS"),isLinux:Dt("Linux"),isSolaris:Dt("Solaris"),isFreeBSD:Dt("FreeBSD"),isChromeOS:Dt("ChromeOS")}},Et=()=>Wt({current:void 0,version:Ue.unknown()}),te=Wt,ie=($e,Ze,$t)=>{const Dt=oe.browsers(),gn=oe.oses(),yn=Ze.bind(Ye=>((et,jt)=>((nn,Dn)=>{for(let jn=0;jn<nn.length;jn++){const Yn=Dn(nn[jn]);if(Yn.isSome())return Yn}return I.none()})(jt.brands,nn=>{const Dn=nn.brand.toLowerCase();return fe(et,jn=>{var Yn;return Dn===((Yn=jn.brand)===null||Yn===void 0?void 0:Yn.toLowerCase())}).map(jn=>({current:jn.name,version:Ue.nu(parseInt(nn.version,10),0)}))}))(Dt,Ye)).orThunk(()=>((Ye,et)=>wt(Ye,et).map(jt=>{const nn=Ue.detect(jt.versionRegexes,et);return{current:jt.name,version:nn}}))(Dt,$e)).fold(gt,St),Ot=((Ye,et)=>wt(Ye,et).map(jt=>{const nn=Ue.detect(jt.versionRegexes,et);return{current:jt.name,version:nn}}))(gn,$e).fold(Et,te),_t=((Ye,et,jt,nn)=>{const Dn=Ye.isiOS()&&/ipad/i.test(jt)===!0,jn=Ye.isiOS()&&!Dn,Yn=Ye.isiOS()||Ye.isAndroid(),Wn=Yn||nn("(pointer:coarse)"),go=Dn||!jn&&Yn&&nn("(min-device-width:768px)"),ko=jn||Yn&&!go,qo=et.isSafari()&&Ye.isiOS()&&/safari/i.test(jt)===!1,Ms=!ko&&!go&&!qo;return{isiPad:_(Dn),isiPhone:_(jn),isTablet:_(go),isPhone:_(ko),isTouch:_(Wn),isAndroid:Ye.isAndroid,isiOS:Ye.isiOS,isWebView:_(qo),isDesktop:_(Ms)}})(Ot,yn,$e,$t);return{browser:yn,os:Ot,deviceType:_t}},me=$e=>window.matchMedia($e).matches;let X=($e=>{let Ze,$t=!1;return(...Dt)=>($t||($t=!0,Ze=$e.apply(null,Dt)),Ze)})(()=>ie(window.navigator.userAgent,I.from(window.navigator.userAgentData),me));const Se=()=>X(),Pe=$e=>{if($e==null)throw new Error("Node cannot be null or undefined");return{dom:$e}},Fe=Pe,vt=($e,Ze)=>$e.dom===Ze.dom,Qe=($e,Ze)=>{const $t=$e.dom;if($t.nodeType!==1)return!1;{const Dt=$t;if(Dt.matches!==void 0)return Dt.matches(Ze);if(Dt.msMatchesSelector!==void 0)return Dt.msMatchesSelector(Ze);if(Dt.webkitMatchesSelector!==void 0)return Dt.webkitMatchesSelector(Ze);if(Dt.mozMatchesSelector!==void 0)return Dt.mozMatchesSelector(Ze);throw new Error("Browser lacks native selectors")}},yt=$e=>Ze=>($t=>$t.dom.nodeType)(Ze)===$e,Ft=yt(1),bn=yt(3),Tt=yt(11),Ht=$e=>Fe($e.dom.host),vn=($e,Ze,$t)=>{((Dt,gn,yn)=>{if(!(i(yn)||m(yn)||S(yn)))throw console.error("Invalid call to Attribute.set. Key ",gn,":: Value ",yn,":: Element ",Dt),new Error("Attribute value was not simple");Dt.setAttribute(gn,yn+"")})($e.dom,Ze,$t)},kn=($e,Ze)=>{const $t=$e.dom.getAttribute(Ze);return $t===null?void 0:$t},Eo=($e,Ze)=>{$e.dom.removeAttribute(Ze)},to=$e=>{const Ze=bn($e)?$e.dom.parentNode:$e.dom;if(Ze==null||Ze.ownerDocument===null)return!1;const $t=Ze.ownerDocument;return(yn=>{const Ot=(Ye=>Fe(Ye.dom.getRootNode()))(yn);return Tt(_t=Ot)&&b(_t.dom.host)?I.some(Ot):I.none();var _t})(Fe(Ze)).fold(()=>$t.body.contains(Ze),(Dt=to,gn=Ht,yn=>Dt(gn(yn))));var Dt,gn},Rt=($e,Ze)=>{const $t=$e.dom,Dt=window.getComputedStyle($t).getPropertyValue(Ze);return Dt!==""||to($e)?Dt:dn($t,Ze)},dn=($e,Ze)=>($t=>$t.style!==void 0&&C($t.style.getPropertyValue))($e)?$e.style.getPropertyValue(Ze):"",an=($e,Ze)=>{const $t=kn($e,Ze);return $t===void 0||$t===""?[]:$t.split(" ")},Bn=($e,Ze,$t)=>{let Dt=$e.dom;const gn=C($t)?$t:O;for(;Dt.parentNode;){Dt=Dt.parentNode;const yn=Fe(Dt);if(Ze(yn))return I.some(yn);if(gn(yn))break}return I.none()},_o=($e,Ze,$t)=>((Dt,gn,yn,Ot,_t)=>Ot(yn)?I.some(yn):C(_t)&&_t(yn)?I.none():gn(yn,Ot,_t))(0,Bn,$e,Ze,$t),Do=$e=>$e.dom.classList!==void 0,ms=$e=>an($e,"class"),Co=($e,Ze)=>{Do($e)?$e.dom.classList.remove(Ze):(($t,Dt)=>{((gn,yn,Ot)=>{const _t=L(an(gn,yn),Ye=>Ye!==Ot);_t.length>0?vn(gn,yn,_t.join(" ")):Eo(gn,yn)})($t,"class",Dt)})($e,Ze),($t=>{(Do($t)?$t.dom.classList:ms($t)).length===0&&Eo($t,"class")})($e)},Is=($e,Ze)=>{$e.dispatch("FormatPainterToggle",{state:Ze})};var pn,Lo,js,Hs;(function($e){$e.Retrival="Retrieval",$e.Application="Application"})(pn||(pn={})),function($e){$e.ListSchema="ListSchema",$e.SubstitutionSchema="SubstitionSchema"}(Lo||(Lo={})),function($e){$e.InsertUnorderedList="InsertUnorderedList",$e.InsertOrderedList="InsertOrderedList",$e.InsertDefinitionList="InsertDefinitionList"}(js||(js={})),function($e){$e.Table="Table",$e.Unspecified="Unspecified"}(Hs||(Hs={}));const Tr=$e=>{var Ze,$t;Ze=Fe($e.getBody()),$t="tox-cursor-format-painter",Do(Ze)?Ze.dom.classList.add($t):((Dt,gn)=>{((yn,Ot,_t)=>{const Ye=an(yn,Ot).concat([_t]);vn(yn,Ot,Ye.join(" "))})(Dt,"class",gn)})(Ze,$t)},vr=($e,Ze)=>{($t=>{Co(Fe($t.getBody()),"tox-cursor-format-painter")})($e),Ze.set(pn.Retrival),Is($e,!1)},_s={formatpainter_checklist:{selector:"ul",classes:"tox-checklist"},formatpainter_liststyletype:{selector:"ul,ol",styles:{listStyleType:"%value"}},formatpainter_borderstyle:{selector:"td,th",styles:{borderTopStyle:"%valueTop",borderRightStyle:"%valueRight",borderBottomStyle:"%valueBottom",borderLeftStyle:"%valueLeft"},remove_similar:!0},formatpainter_bordercolor:{selector:"td,th",styles:{borderTopColor:"%valueTop",borderRightColor:"%valueRight",borderBottomColor:"%valueBottom",borderLeftColor:"%valueLeft"},remove_similar:!0},formatpainter_backgroundcolor:{selector:"td,th",styles:{backgroundColor:"%value"},remove_similar:!0},formatpainter_removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*:not(tr,td,th,table)",attributes:["style","class"],split:!1,expand:!1,deep:!0}],formatpainter_legacy_font:{inline:"font",attributes:{size:"%value"}}},br=($e,Ze)=>ue(Ze,"selector").exists($t=>{const Dt=$e.getBody(),gn=$e.selection.getStart(),yn=$e.dom.getParents(gn,R,Dt),Ot=$e.selection.getSelectedBlocks();return $e.dom.is([...yn,...Ot],$t)}),Dr=$e=>$e.length>1&&$e.charAt(0)==="%",ps=($e,Ze)=>ue($e,Ze).filter($t=>!u($t)),po=$e=>Qe($e,"OL,UL,DL"),Ds=$e=>Qe($e,"LI,DT,DD"),Nt=$e=>$e.replace(/([A-Z])/g,Ze=>`-${Ze[0].toLowerCase()}`),Gt=($e,Ze,$t)=>{const Dt=$e.formatter,gn=((Ye,et)=>q(Ye.formatter.get(et),jt=>((nn,Dn)=>It(Dn,"inline")&&!br(nn,Dn))(Ye,jt)))($e,$t.formatName),yn=((Ye,et,jt)=>q(et.get(jt),nn=>((Dn,jn)=>It(jn,"block")||br(Dn,jn))(Ye,nn)))($e,Dt,$t.formatName),Ot=(_t=$t.formatName,Q(["formatpainter_borderstyle","formatpainter_bordercolor","formatpainter_backgroundcolor"],_t));var _t;(Ze.table&&Ot||gn||Ze.block&&yn&&!Ot)&&Dt.apply($t.formatName,$t.substitutedVariables)},Un=$e=>{const Ze=$e.selection,$t=Ze.getRng(),Dt=Fe($e.getBody()),gn=(_t=>L(_t.selection.getSelectedBlocks().map(Fe),Ds))($e),yn=$t.collapsed&&gn.length,Ot=gn.length&&!((_t,Ye)=>{const et=jn=>vt(jn,Ye);return(jt=_o(Fe(_t.getStart()),po,et),nn=_o(Fe(_t.getEnd()),po,et),Dn=(jn,Yn)=>vt(jn,Yn),jt.isSome()&&nn.isSome()?I.some(Dn(jt.getOrDie(),nn.getOrDie())):I.none()).getOr(!1);var jt,nn,Dn})(Ze,Dt);return gn.length>1||yn||Ot},uo=$e=>$e.options.get("formatpainter_ignored_formats"),Fo=($e,Ze)=>{return Ze==="class"?(gn=>Do(gn)?(yn=>{const Ot=yn.dom.classList,_t=new Array(Ot.length);for(let Ye=0;Ye<Ot.length;Ye++){const et=Ot.item(Ye);et!==null&&(_t[Ye]=et)}return _t})(gn):ms(gn))($e).filter(gn=>!/^(mce-.*)/.test(gn)).join(" "):($t=$e,Dt=Ze,I.from(kn($t,Dt))).getOr("");var $t,Dt},ss=$e=>((Ze,$t)=>{const Dt={},gn={};return((yn,Ot,_t,Ye)=>{Re(yn,(et,jt)=>{(Ot(et,jt)?_t:Ye)(et,jt)})})(Ze,$t,Je(Dt),Je(gn)),{t:Dt,f:gn}})($e,Ze=>{return($t=Ze).length>1&&$t.charAt(0)==="%";var $t}).t,ur=($e,Ze)=>($t=>{const Dt=uo($t);return Ce($t.formatter.get()).filter(gn=>!Q(Dt,gn))})($e).filter($t=>{const Dt=((gn,yn)=>q(gn.formatter.get(yn),Ot=>(_t=>{const Ye=ps(_t,"styles").exists(jt=>q(_e(jt),Dr)),et=ps(_t,"attributes").exists(jt=>q(_e(jt),Dr));return Ye||et})(Ot)))($e,$t);return $e.formatter.matchNode(Ze.dom,$t,{},Dt)}),dr=($e,Ze)=>{const $t=Z($e.dom.getParents(Ze,R),Fe);return Ve(L($t,Ft),Dt=>Ve(ur($e,Dt),gn=>((yn,Ot,_t)=>{return(Ye=yn.get(Ot),(et=>0<et.length?I.some(et[0]):I.none())(Ye)).bind(et=>((jt,nn)=>{const Dn=ps(jt,"styles").map(Wn=>{return go=nn,ko=ss(Wn),it(ko,(qo,Ms)=>({k:qo.slice(1,qo.length),v:Rt(go,Nt(Ms))}));var go,ko}),jn=ps(jt,"attributes").map(Wn=>{return go=nn,ko=ss(Wn),it(ko,(qo,Ms)=>({k:qo.slice(1,qo.length),v:Fo(go,Ms)}));var go,ko}),Yn={...Dn.getOr({}),...jn.getOr({})};return _e(Yn).every(Wn=>Wn!=="")?I.some(Yn):I.none()})(et,_t)).map(et=>({kind:Lo.SubstitutionSchema,formatName:Ot,substitutedVariables:et}));var Ye})($e.formatter,gn,Dt).toArray()))},or=$e=>(Ze=>fe(_e(js),$t=>Ze.queryCommandState($t)))($e).map(Ze=>({kind:Lo.ListSchema,command:Ze})),rt=($e,Ze)=>$e.getParent(Ze,"TABLE")?Hs.Table:Hs.Unspecified,nt=($e,Ze,$t)=>{$e.addCommand("mceToggleFormatPainter",()=>{((Dt,gn)=>{gn.get()===pn.Application?vr(Dt,gn):((yn,Ot)=>{const _t=Se(),Ye=pe(!1);Tr(yn),Ot.set(pn.Application),Is(yn,!0),yn.execCommand("mceRetrieveFormats");const et=()=>{yn.execCommand("mcePaintFormats"),vr(yn,Ot)},jt=()=>{Ot.get()===pn.Application&&et(),Yn()},nn=Wn=>{Ot.get()===pn.Application&&(Wn.type==="touchcancel"&&_t.os.isAndroid()?yn.once("contextmenu",et):Ye.get()?et():yn.once("selectionchange",et)),Yn()},Dn=Wn=>{Wn.keyCode===27&&(vr(yn,Ot),Yn())},jn=Wn=>{Ye.set(Wn.type==="touchmove")};yn.on("click",jt),yn.on("touchstart touchmove",jn),yn.on("touchend touchcancel",nn),yn.on("keydown",Dn);const Yn=()=>{yn.off("click",jt),yn.off("touchstart touchmove",jn),yn.off("touchend touchcancel",nn),yn.off("keydown",Dn)}})(Dt,gn)})($e,Ze)}),$e.addCommand("mcePaintFormats",()=>{$e.selection.isEditable()&&$e.undoManager.transact(()=>{((Dt,gn)=>{((Ot,_t)=>{Ot.formatter.remove("formatpainter_removeformat"),_t===Hs.Table&&(Ye=>{for(let jt=0,nn=Ye.length;jt<nn;jt++)et=Ye[jt],Ot.formatter.remove(et);var et})(["formatpainter_borderstyle","formatpainter_bordercolor","formatpainter_backgroundcolor"]),Un(Ot)&&Ot.execCommand("RemoveList")})(Dt,gn.context);const yn=(Ot=>{const _t=Ot.selection.getStart(),Ye=Ot.selection.getRng().collapsed,et=Ot.dom.select("td[data-mce-selected]").length>0,jt=!!Ot.dom.getParent(_t,"TABLE");return{inline:!0,table:Ye&&jt||et,block:Ye||(nn=Ot.selection,nn.getSelectedBlocks().length>1)||et};var nn})(Dt);gn.schemas.forEach(Ot=>{switch(Ot.kind){case Lo.ListSchema:((_t,Ye,et)=>{et.block&&_t.execCommand(Ye.command)})(Dt,Ot,yn);break;case Lo.SubstitutionSchema:Gt(Dt,yn,Ot)}})})($e,$t.get())})}),$e.addCommand("mceRetrieveFormats",()=>{$t.set((Dt=>{const gn=Dt.dom,yn=Dt.selection.getStart();return{schemas:[...or(Dt).toArray(),...dr(Dt,yn)],context:rt(gn,yn)}})($e))})};tinymce.PluginManager.add("formatpainter",$e=>{if(((Dt,gn)=>!!Dt&&((yn,Ot)=>{const _t=ke(yn.major,Ot.major);if(_t!==0)return _t;const Ye=ke(yn.minor,Ot.minor);if(Ye!==0)return Ye;const et=ke(yn.patch,Ot.patch);return et!==0?et:0})((yn=>qe((Ot=>[Ot.majorVersion,Ot.minorVersion].join(".").split(".").slice(0,3).join("."))(yn)))(Dt),qe(gn))===-1)(tinymce,"6.0.0"))return void window.console.error("The format painter plugin requires at least version 6.0.0 of TinyMCE.");const Ze=pe(pn.Retrival),$t=pe({schemas:[],context:Hs.Unspecified});(Dt=>{(0,Dt.options.register)("formatpainter_ignored_formats",{processor:"string[]",default:"link,address,removeformat,formatpainter_removeformat".split(",")})})($e),(Dt=>{Dt.on("PreInit",()=>{Re(_s,(gn,yn)=>{Dt.formatter.get(yn)||Dt.formatter.register(yn,gn)})})})($e),nt($e,Ze,$t),(Dt=>{Dt.ui.registry.addToggleButton("formatpainter",{active:!1,icon:"format-painter",tooltip:"Format painter",onAction:()=>Dt.execCommand("mceToggleFormatPainter"),onSetup:gn=>{const yn=Ot=>{gn.setActive(Ot.state)};return Dt.on("FormatPainterToggle",yn),()=>Dt.off("FormatPainterToggle",yn)}})})($e),((Dt,gn)=>{Dt.ui.registry.addToggleMenuItem("formatpainter",{active:!1,icon:"format-painter",text:"Format painter",onAction:()=>Dt.execCommand("mceToggleFormatPainter"),onSetup:yn=>{const Ot=_t=>{yn.setActive(_t.state)};return yn.setActive(gn.get()===pn.Application),Dt.on("FormatPainterToggle",Ot),()=>Dt.off("FormatPainterToggle",Ot)}})})($e,Ze),(Dt=>{Dt.addShortcut("Meta+alt+C","",()=>{Dt.execCommand("mceRetrieveFormats")}),Dt.addShortcut("Meta+alt+V","",()=>{Dt.execCommand("mcePaintFormats")})})($e)})})();const xfe=["accordion","advlist","anchor","autolink","autosave","charmap","code","codesample","directionality","importcss","insertdatetime","link","lists","image","media","nonbreaking","pagebreak","preview","quickbars","save","searchreplace","table","visualblocks","fullscreen","visualchars","wordcount","pasteprocess","formatpainter"],s6e="undo redo h1 h2 h3 bold italic underline strikethrough subscript superscript fontsize fontFamily lineheight forecolor backcolor alignleft aligncenter alignright alignjustify pagebreak bullist numlist outdent indent blockquotelink unlink image code removeformat formatpainter fullscreen preview ",Efe="file edit insert table tools help",r6e={menu:{pagesize:{title:"页面大小",items:n6e},orientation:{title:"页面方向",items:o6e}},menubar:Efe+" pagesize orientation",pagesize:"A4",orientation:"portrait",plugins:[...xfe,"pagesize"]},a6e={license_key:"gpl",skin:!1,content_css:["css/content.css","css/reset.css"],promotion:!1,menubar:Efe,cleanup:!0,branding:!1,language:"zh_CN",plugins:xfe,toolbar:s6e,fontsize_formats:"12px 14px 16px 18px 20px 22px 24px 28px 32px 36px 48px 56px 72px",font_formats:"微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;",lineheight_formats:"0.5 0.8 1 1.2 1.5 1.75 2 2.5 3 4 5",elementpath:!1,paste_data_images:!0,object_resizing:!0,toolbar_mode:"wrap",images_upload_handler:o=>new Promise((s,i)=>{const u=new FormData;u.append("files",o.blob(),o.filename()),fetch(`${process.env.NODE_ENV==="development"?"/api":""}/ajax/uploaddoc`,{method:"POST",body:u}).then(m=>m.json()).then(m=>{m.status===1?s(m.file_url):i(`上传失败: ${m.message}`)}).catch(m=>{i(`上传出错: ${m.message}`)})})},i6e={name:"ProEditor",components:{Editor:IMe},props:{modelValue:{type:String,default:""},pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},hasPagesize:{type:Boolean,default:!1},placeholder:{type:String,default:"请输入内容"},width:{type:[Number,String],default:"100%"},height:{type:Number,default:400}},setup(o,{emit:s}){Em(o.modelValue);const i=d.ref(null),u=d.reactive({myInit:h(a6e),contentValue:o.modelValue,timeout:null});d.onMounted(()=>{K6.init({license_key:"gpl"}),K6.activeEditor.on("pagesizechange",b=>{(o==null?void 0:o.pagesize)!==b.size&&s("update:pagesize",b.size)}),K6.activeEditor.on("orientationchange",b=>{(o==null?void 0:o.orientation)!==b.orientation&&s("update:orientation",b.orientation)})}),d.watch(()=>u.contentValue,()=>{m(()=>{s("update:modelValue",u.contentValue)})}),d.watch(()=>o.orientation,()=>{var b,C;i.value&&((C=(b=i.value)==null?void 0:b.getEditor)==null||C.call(b).fire("orientationchange",{orientation:o.orientation}))}),d.watch(()=>o.pagesize,()=>{var b,C;i.value&&((C=(b=i.value)==null?void 0:b.getEditor)==null||C.call(b).fire("pagesizechange",{size:o.pagesize}))}),d.watch(()=>o.modelValue,b=>{!dB(b)&&b!==u.contentValue&&(u.contentValue=b)}),d.watch(()=>o.height,b=>{var C,S,_,N,O,R,I,W;i.value&&((W=(N=(_=(S=(C=i.value)==null?void 0:C.getEditor)==null?void 0:S.call(C))==null?void 0:_.dom)==null?void 0:N.setStyle)==null||W.call(N,(I=(R=(O=i.value)==null?void 0:O.getEditor)==null?void 0:R.call(O))==null?void 0:I.editorContainer,"height",b+"px"))});function m(b,C=400){u.timeout!==null&&clearTimeout(u.timeout),u.timeout=setTimeout(b,C)}function h(b){var O;o!=null&&o.height&&(b.height=o.height),o!=null&&o.width&&(b.width=o.width);const{placeholder:C,pagesize:S,orientation:_}=o,N=`${location==null?void 0:location.origin}/${dB(window==null?void 0:window.zyuiAssetsPath)?"assets/":window==null?void 0:window.zyuiAssetsPath}`;return b={...b,content_css:(O=b==null?void 0:b.content_css)==null?void 0:O.map(R=>R.includes("http")?R:`${N}${R}`),placeholder:C,...o.hasPagesize?{...r6e,pagesize:S,orientation:_}:{}},b}return{...d.toRefs(u),editorRef:i,customer:h,debounce:m}}},l6e={class:"my-tinymce"};function c6e(o,s,i,u,m,h){const b=d.resolveComponent("Editor");return d.openBlock(),d.createElementBlock("div",l6e,[d.createVNode(b,{modelValue:o.contentValue,"onUpdate:modelValue":s[0]||(s[0]=C=>o.contentValue=C),init:o.myInit,ref:"editorRef"},null,8,["modelValue","init"])])}const _fe=Ja(i6e,[["render",c6e]]),u6e={name:"ShadowDomWrap",setup(o,{emit:s,expose:i}){const u=d.ref(null),m=d.ref(),h=d.ref(!1),b=Ih(),C=_=>{if(_.target.closest(".context-menu")||!u.value)return;const O=u.value.contains(_.target);!O&&h.value?(h.value=!1,s("onBlur")):O&&!h.value&&(h.value=!0,s("onFocus"))},S=_=>{h.value=!0,s("onFocus"),_.stopPropagation()};return d.onMounted(()=>{var R,I,W,G,Q;m.value=(R=u.value)==null?void 0:R.attachShadow({mode:"open"}),document.addEventListener("click",C);const _=dB(window==null?void 0:window.zyuiAssetsPath)?"assets/":window==null?void 0:window.zyuiAssetsPath,N=document.createElement("link");N.rel="stylesheet",N.href=`${location==null?void 0:location.origin}/${_}css/index.min.css`,(I=m.value)==null||I.appendChild(N);const O=document.createElement("link");O.rel="stylesheet",O.href=`${location==null?void 0:location.origin}/${_}css/reset.css`,(W=m.value)==null||W.appendChild(O),(G=b==null?void 0:b.cssConfig)!=null&&G.links&&b.cssConfig.links.forEach(q=>{var L;const Z=document.createElement("link");Z.rel="stylesheet",Z.href=q,(L=m.value)==null||L.appendChild(Z)}),(Q=b==null?void 0:b.cssConfig)!=null&&Q.styles&&b.cssConfig.styles.forEach(q=>{var L;const Z=document.createElement("style");Z.textContent=q,(L=m.value)==null||L.appendChild(Z)})}),d.onUnmounted(()=>{document.removeEventListener("click",C)}),i({focus:()=>{h.value=!0}}),{shadowHost:u,shadowRoot:m,handleClick:S}}};function d6e(o,s,i,u,m,h){return d.openBlock(),d.createElementBlock("div",{ref:"shadowHost",class:"shadow-host",onClick:s[0]||(s[0]=d.withModifiers((...b)=>u.handleClick&&u.handleClick(...b),["stop"]))},[u.shadowRoot?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:u.shadowRoot},[d.renderSlot(o.$slots,"default")],8,["to"])):d.createCommentVNode("",!0)],512)}const RB=Ja(u6e,[["render",d6e]]),f6e=["innerHTML"],kfe=d.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=d.useModel(o,"modelValue");return(i,u)=>(d.openBlock(),d.createBlock(RB,null,{default:d.withCtx(()=>[d.createElementVNode("div",{innerHTML:s.value},null,8,f6e)]),_:1}))}}),Tfe=Symbol("nodesUI"),ef=()=>{const o=d.inject(Tfe);if(!o)throw new Error("NodesUI context not found");return o};function $U(o){if(!o||!o.ownerDocument)return null;const s=[];let i=o;for(;i&&i.nodeType===Node.ELEMENT_NODE;){let u=i.nodeName.toLowerCase();if(i.parentElement){const h=Array.from(i.parentElement.children).filter(b=>b.nodeName.toLowerCase()===i.nodeName.toLowerCase());if(h.length>1){const b=h.indexOf(i)+1;u+=`:nth-of-type(${b})`}}if(s.unshift(u),i=i.parentElement,i&&(i.nodeName.toLowerCase()==="body"||i.nodeName.toLowerCase()==="html"))break}return s.length?s.join(" > "):null}function m6e(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(`#${CSS.escape(o)}`)}catch(i){return console.error("nodePath query error:",i),null}}function p6e(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(o)}catch(i){return console.error("nodePath query error:",i),null}}const WA=o=>o!=null&&o.id?o==null?void 0:o.id:o.nodePath+(o!=null&&o.textNodeIndex?`-${o==null?void 0:o.textNodeIndex}`:"")+(o!=null&&o.startOffset?`-${o==null?void 0:o.startOffset}`:"")+(o!=null&&o.subNodeSort?`-${o==null?void 0:o.subNodeSort}`:""),Afe=o=>{if(o.nodeType===Node.TEXT_NODE)return o;let s=null;for(let i=o.childNodes.length-1;i>=0;i--){const u=o.childNodes[i],m=Afe(u);if(m){s=m;break}}return s},g6e=(o,s,i)=>{var b,C,S;const u=i==null?void 0:i.getRootNode(),m=(b=u==null?void 0:u.getSelection)==null?void 0:b.call(u),h=p6e(o.nodePath,i);if(m&&o.startOffset!==void 0&&s&&h){const _=document.createRange(),N=(o==null?void 0:o.textNodeIndex)||0,O=h.childNodes[N]||h;let R,I;if(O.nodeType===Node.TEXT_NODE)R=O,I=Math.min(o.startOffset||0,((C=O.textContent)==null?void 0:C.length)||0);else{const W=Afe(O);W?(R=W,I=((S=W.textContent)==null?void 0:S.length)||0):(R=O,I=0)}_.setStart(R,I),_.setEnd(R,I),_.insertNode(s),_.setStartAfter(s),_.collapse(!0),m.removeAllRanges(),m.addRange(_)}},h6e=(o,s)=>{s!=null&&s.id&&(o.id=s==null?void 0:s.id),(s==null?void 0:s.nodePath)!==void 0&&o.setAttribute("data-nodePath",s.nodePath),(s==null?void 0:s.textNodeIndex)!==void 0&&s.textNodeIndex>=0&&o.setAttribute("data-textNodeIndex",s.textNodeIndex.toString()),s.startOffset!==void 0&&s.startOffset>=0&&o.setAttribute("data-startOffset",s.startOffset.toString()),(s==null?void 0:s.subNodeSort)!==void 0&&s.subNodeSort>=0&&o.setAttribute("data-subNodeSort",s.subNodeSort.toString()),(s==null?void 0:s.groupKey)!==void 0&&o.setAttribute("data-groupKey",s.groupKey)},v6e=o=>{const s=o.closest("TD"),i=o.closest(".node-item");let u=null;if(i?u=i:s&&s.classList.contains("node-item-td")&&(u=s),!u)return null;const m=u||o;let h=m==null?void 0:m.getAttribute("data-nodePath");if(h||(h=$U(m)),(m==null?void 0:m.getAttribute("selectable"))==="false")return null;const b={element:m,nodePath:h},C=m==null?void 0:m.getAttribute("data-textNodeIndex");C&&(b.textNodeIndex=Number(C));const S=m==null?void 0:m.getAttribute("data-startOffset");S&&(b.startOffset=Number(S));const _=m==null?void 0:m.getAttribute("data-subNodeSort");_&&(b.subNodeSort=Number(_));const N=m==null?void 0:m.getAttribute("data-groupKey");N&&(b.groupKey=N);const O=m==null?void 0:m.getAttribute("id");return O&&(b.id=O),b},Nfe=o=>Txe(o,s=>d.toValue(s.nodes).map(i=>({...i,color:s.color,activated:s==null?void 0:s.activated,dataGroupKey:s.id}))),Mz=(o,s)=>{const i=o.startsWith("#")?o.slice(1):o;let u,m,h;if(i.length===3)u=parseInt(i[0]+i[0],16),m=parseInt(i[1]+i[1],16),h=parseInt(i[2]+i[2],16);else if(i.length===6)u=parseInt(i.substring(0,2),16),m=parseInt(i.substring(2,4),16),h=parseInt(i.substring(4,6),16);else return console.warn("Invalid color format:",o),`rgba(0, 0, 0, ${s})`;return`rgba(${u}, ${m}, ${h}, ${s})`},b6e=o=>{var S;const{element:s}=o;if(!s)return null;if(!wne(o))return{showTextType:"input"};const i=s.closest("tr"),u=Array.from(i.parentElement.children).indexOf(i),m=Array.from(i.children).indexOf(s.closest("td")||s.closest("th")),h=s.closest("table"),b=((S=s.closest("body"))==null?void 0:S.querySelectorAll("table"))||[];return{showTextType:"cell",tableIndex:Array.from(b).indexOf(h)+1,colIndex:m,rowIndex:u}},y6e=(o,s)=>{var m,h;let i=1;const u=(m=o==null?void 0:o.map(b=>s==null?void 0:s.find(C=>(C==null?void 0:C.id)===(b==null?void 0:b.id))))==null?void 0:m.filter(Boolean);return(u==null?void 0:u.length)>0?(h=u==null?void 0:u.map(C=>{const S=b6e(C);return S?(S==null?void 0:S.showTextType)==="input"?{...C,...S,inputIndex:i++}:{...C,...S}:null}))==null?void 0:h.filter(Boolean):[]};function w6e(o){if(!o||o.length===0)return[];const s=[...o].sort((m,h)=>m.rowIndex!==h.rowIndex?m.rowIndex-h.rowIndex:m.colIndex-h.colIndex),i=[],u=new Set;for(const m of s){if(u.has(m))continue;const h=[];let b=0,C=0;for(let S=m.colIndex;s.find(N=>N.rowIndex===m.rowIndex&&N.colIndex===S&&!u.has(N));S++)C++;if(C!==0){b=C;for(let S=m.rowIndex;;S++){let _=0;const N=[];for(let O=m.colIndex;O<m.colIndex+b;O++){const R=s.find(I=>I.rowIndex===S&&I.colIndex===O&&!u.has(I));if(R)_++,N.push(R);else break}if(_===b)h.push(...N);else break}h.length>0&&(i.push([...h]),h.forEach(S=>u.add(S)))}}return i}function C6e(o){if(!o||o.length===0)return{min:null,max:null};let s=o[0],i=o[0];for(const u of o)(u.colIndex<s.colIndex||u.colIndex===s.colIndex&&u.rowIndex<s.rowIndex)&&(s=u),(u.colIndex>i.colIndex||u.colIndex===i.colIndex&&u.rowIndex>i.rowIndex)&&(i=u);return{min:s,max:i}}const Ofe=(o,s)=>{var _;const i=y6e(o,s||[]),u=[],m=[];(_=d.toValue(i))==null||_.forEach(N=>{(N==null?void 0:N.showTextType)==="input"?u.push(N):m.push(N)});const h=Oxe(m,"tableIndex"),b=Object.entries(h).map(([N,O])=>({tableIndex:Number(N),nodes:O})),C=mde(b==null?void 0:b.map(N=>w6e(N==null?void 0:N.nodes))),S=(C==null?void 0:C.map(N=>C6e(N)))||[];return[...u,...S]},r4=o=>{function s(i){let u="";for(;i>=0;)u=String.fromCharCode(65+i%26)+u,i=Math.floor(i/26)-1;return u}return(o==null?void 0:o.colIndex)>=0&&(o==null?void 0:o.rowIndex)>=0?`${s(o==null?void 0:o.colIndex)}${o==null?void 0:o.rowIndex}`:""},S6e=(o,s)=>{const i=Ofe(o,s||[]),u=[];return i==null||i.forEach(m=>{var h,b;(m==null?void 0:m.showTextType)==="input"?u.push(`填写${m==null?void 0:m.inputIndex}`):u.push(((h=m==null?void 0:m.min)==null?void 0:h.id)===((b=m==null?void 0:m.max)==null?void 0:b.id)?r4(m==null?void 0:m.min):`${r4(m==null?void 0:m.min)}:${r4(m==null?void 0:m.max)}`)}),u==null?void 0:u.join(",")},wne=o=>{if(!(o!=null&&o.nodePath))return!1;const s=o.nodePath.split(" > "),i=s[s.length-1];return(i==null?void 0:i.startsWith("td"))&&!(o!=null&&o.startOffset)},x6e=o=>{var i;return(i=ta(o))==null?void 0:i.map(u=>(u==null||delete u.element,u))},E6e=o=>{o.querySelectorAll("p").forEach(i=>{var u;i.classList.contains("empty")&&i.classList.remove("empty"),((u=i.innerText)==null?void 0:u.trim())===""&&i.classList.add("empty")})},_6e={key:0,class:"td-node"},k6e={key:1},T6e=d.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,i=d.computed(()=>{var m,h,b,C,S;return(h=(m=s==null?void 0:s.node)==null?void 0:m.props)!=null&&h.alias?(C=(b=s==null?void 0:s.node)==null?void 0:b.props)==null?void 0:C.alias:(S=s==null?void 0:s.node)==null?void 0:S.label}),u=d.computed(()=>{var m,h;return((h=(m=s==null?void 0:s.node)==null?void 0:m.element)==null?void 0:h.tagName)==="TD"});return(m,h)=>u.value?(d.openBlock(),d.createElementBlock("span",_6e,d.toDisplayString(i.value),1)):(d.openBlock(),d.createElementBlock("span",k6e,d.toDisplayString(i.value),1))}}),$fe=Symbol("nodesEditor"),j0=()=>{const o=d.inject($fe);if(!o)throw new Error("NodesEditor context not found");return o},DU=d.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,{currentNodes:i}=ef(),{nodes:u,renderType:m,disabledNodes:h}=j0(),b=d.computed(()=>{var O;return(O=s.node)!=null&&O.id?u.value.some(R=>R.id===s.node.id):!1}),C=d.computed(()=>{var O;if(!((O=s.node)!=null&&O.element))return!1;try{return s.node.element.parentNode!==null}catch(R){return console.warn("Element validation failed:",R),!1}}),S=d.computed(()=>{var I,W;const O=(I=h==null?void 0:h.value)==null?void 0:I.some(G=>{var Q;return(G==null?void 0:G.id)===((Q=s==null?void 0:s.node)==null?void 0:Q.id)}),R=(W=d.toValue(i))==null?void 0:W.find(G=>{var Q;return(G==null?void 0:G.id)===((Q=s==null?void 0:s.node)==null?void 0:Q.id)});return{...s==null?void 0:s.node,...R,disabled:O}}),_=O=>{var I;let R="";if(d.toValue(O==null?void 0:O.activated)&&(R="normal"),O!=null&&O.disabled&&(R="disabled"),(I=s==null?void 0:s.node)!=null&&I.element)switch(R){case"normal":s.node.element.style.setProperty("--node-color",(O==null?void 0:O.color)||"#409eff"),s.node.element.style.setProperty("--node-bg-color",Mz((O==null?void 0:O.color)||"#409eff",.1)),s.node.element.setAttribute("data-dataGroupKey",O==null?void 0:O.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("activated");break;case"disabled":s.node.element.style.setProperty("--node-color",(O==null?void 0:O.color)||"#F56C6C"),s.node.element.style.setProperty("--node-bg-color",Mz((O==null?void 0:O.color)||"#F56C6C",.1)),s.node.element.setAttribute("data-dataGroupKey",O==null?void 0:O.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("disabled");break;default:N();break}},N=()=>{var O,R,I,W,G;(O=s==null?void 0:s.node)!=null&&O.element&&((R=s.node.element)==null||R.removeAttribute("data-dataGroupKey"),(I=s.node.element)==null||I.removeAttribute("selectable"),(W=s.node.element)==null||W.classList.remove("activated"),(G=s.node.element)==null||G.classList.remove("disabled"))};return d.watch(()=>S,()=>{const O=d.toValue(S);O!=null&&O.id?_(O):N()},{immediate:!0,deep:!0}),(O,R)=>{var I;return(I=O.node)!=null&&I.element&&C.value&&b.value?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:O.node.element},[d.createElementVNode("div",{class:d.normalizeClass(["node-item-render",`node-item-${d.unref(m)}`])},[d.renderSlot(O.$slots,"default",{node:O.node},()=>[d.createVNode(T6e,{node:O.node},null,8,["node"])])],2)],8,["to"])):d.createCommentVNode("",!0)}}});function A6e(){const o=d.ref(!1),s=u=>{u.key==="Control"&&(o.value=!0)},i=u=>{u.key==="Control"&&(o.value=!1)};return d.onMounted(()=>{window.addEventListener("keydown",s),window.addEventListener("keyup",i)}),d.onUnmounted(()=>{window.removeEventListener("keydown",s),window.removeEventListener("keyup",i)}),o}function Dfe(){const{selectedNodes:o,setSelectedNodes:s,containerRef:i}=ef(),{editorId:u,nodes:m}=j0(),h=d.ref(!1),b=d.ref({x:0,y:0}),C=d.ref({x:0,y:0}),S=d.ref({left:0,top:0,width:0,height:0}),_=d.ref(null),N=Ce=>{const Y=Ce.closest(".node-item-td")||Ce.closest(".node-item");if(Y!==null){let Re=[];if(Y.classList.contains("node-selected"))return;const it=Y.getAttribute("id");if(it&&m.value){const Je=m.value.find(_e=>_e.id===it);Je&&(Re=[Je])}Re=Z(Re),s(Re)}},O=Ce=>{var Je;if(Ce.button===2&&N(Ce==null?void 0:Ce.target),Ce.button!==0||(h.value=!0,!_.value))return;const Y=(Je=i==null?void 0:i.value)==null?void 0:Je.getBoundingClientRect();if(!Y)return;const Re=Ce.clientX-(Y==null?void 0:Y.left),it=Ce.clientY-(Y==null?void 0:Y.top);b.value={x:Re,y:it},C.value={x:Re,y:it},Q(Ce),L(),_.value.style.display="block",window.addEventListener("mousemove",R),window.addEventListener("wheel",I),window.addEventListener("mouseup",W)},R=dte(Ce=>{var Y;if(h.value){const Re=(Y=i==null?void 0:i.value)==null?void 0:Y.getBoundingClientRect();if(!Re)return;const it=Ce.clientX-(Re==null?void 0:Re.left),Je=Ce.clientY-(Re==null?void 0:Re.top);C.value={x:it,y:Je},L()}},16),I=dte(Ce=>{h.value&&setTimeout(()=>{var Je;const Y=(Je=i==null?void 0:i.value)==null?void 0:Je.getBoundingClientRect();if(!Y)return;const Re=Ce.clientX-(Y==null?void 0:Y.left),it=Ce.clientY-(Y==null?void 0:Y.top);C.value={x:Re,y:it},L()},0)},16),W=Ce=>{Ce.button===0&&(h.value=!1,_.value&&(L(),_.value.style.display="none",window.removeEventListener("mousemove",R),window.removeEventListener("wheel",I),window.removeEventListener("mouseup",W)))},G=A6e(),Q=Ce=>{var Re,it;let Y=[];if(Ce.button===0&&(Ce!=null&&Ce.target)){const Je=((Re=Ce==null?void 0:Ce.target)==null?void 0:Re.closest(".node-item-td"))||((it=Ce==null?void 0:Ce.target)==null?void 0:it.closest(".node-item"));if(Je!==null){const _e=Je.getAttribute("id");if(_e&&m.value){const ue=m.value.find(It=>It.id===_e);ue&&(G.value?o.value.some(It=>WA(It)===WA(ue))?Y=o.value.filter(pe=>WA(pe)!==WA(ue)):Y=[...o.value,ue]:ue&&(Y=[ue]))}}Y=Z(Y),s(Y)}},q=()=>{var ue;if(!i.value||!(S.value.width>3||S.value.height>3))return;let Ce=[];const Y=(ue=i==null?void 0:i.value)==null?void 0:ue.getBoundingClientRect(),Re=S.value.left+(Y==null?void 0:Y.left),it=S.value.top+(Y==null?void 0:Y.top),Je={left:S.value.left+(Y==null?void 0:Y.left),right:Re+S.value.width,top:S.value.top+(Y==null?void 0:Y.top),bottom:it+S.value.height};if(i.value.querySelectorAll("*").forEach(It=>{const pe=It.getBoundingClientRect();if(!Je)return;const be={left:pe.left,right:pe.right,top:pe.top,bottom:pe.bottom};if(be.right>Je.left&&be.left<Je.right&&be.bottom>Je.top&&be.top<Je.bottom){const $=It.getAttribute("id");if($&&m.value){const ke=m.value.find(le=>le.id===$);ke&&(Ce=[...Ce,ke])}}}),Ce=Z(Ce),G.value){const It=new Set(o.value.map(be=>WA(be))),pe=Ce.filter(be=>!It.has(WA(be)));s([...o.value,...pe])}else s(Ce)},Z=Ce=>Ce,L=dte(()=>{if(!_.value||!i.value)return;const{x:Ce,y:Y}=b.value,{x:Re,y:it}=C.value,Je=Math.min(Ce,Re),_e=Math.min(Y,it),ue=Math.abs(Ce-Re),It=Math.abs(Y-it);S.value={left:Je,top:_e,width:ue,height:It}},16),fe=Ce=>{if(!_.value)return;const{left:Y,top:Re,width:it,height:Je}=d.toValue(Ce);_.value.style.left=`${Y}px`,_.value.style.top=`${Re}px`,_.value.style.width=`${it}px`,_.value.style.height=`${Je}px`},Ve=()=>{if(!i.value)return;i.value.addEventListener("mousedown",O);const Ce=document.getElementById(`select_area_${u}`);if(Ce){_.value=Ce;return}const Y=document.createElement("div");Y.id=`select_area_${u}`,Y.style.position="absolute",Y.style.border="1px solid #1677ff",Y.style.backgroundColor="rgba(22, 119, 255, 0.05)",Y.style.pointerEvents="none",Y.style.display="none",i.value.appendChild(Y),_.value=Y};return d.watch(S,(Ce,Y)=>{na(Ce,Y)||(fe(Ce),h.value&&q())},{deep:!0}),d.watch(()=>i.value,Ce=>{d.toValue(Ce)&&Ve()},{immediate:!0}),d.onUnmounted(()=>{i.value&&i.value.removeEventListener("mousedown",O)}),{isSelecting:h,selectionBox:_}}function Boe(){const{selectedNodes:o,containerRef:s}=ef(),i=()=>{var m;(m=d.toValue(s))==null||m.querySelectorAll(".node-selected").forEach(h=>{h.classList.remove("node-selected")})},u=m=>{m.forEach(h=>{h.classList.add("node-selected")})};d.watch(()=>o,()=>{i(),setTimeout(()=>{var h,b;const m=(b=(h=d.toValue(o))==null?void 0:h.map(C=>{var S;return(S=s.value)==null?void 0:S.querySelector(`[id="${C.id}"]`)}))==null?void 0:b.filter(Boolean);u(m)},0)},{deep:!0})}const IB=()=>{const{nodes:o,updateNodes:s}=j0();return{nodes:o,addNode:C=>{const _=(Array.isArray(C)?C:[C]).map(O=>({...O,id:O.id||m2()})),N=[...o.value,..._];s(N)},removeNode:async C=>{const S=Array.isArray(C)?C:[C],_=o.value.filter(N=>!S.includes(N==null?void 0:N.id));s(_)},editNodes:C=>{const S=Array.isArray(C)?C:[C],_=m2(),N=S.map(R=>{const I={...R};let W=R==null?void 0:R.id;return W||(W=m2(),I.id=W),I!=null&&I.groupKey||(I.groupKey=_),I}),O=[...o.value];N.forEach(R=>{const I=O.findIndex(W=>W.id===R.id);I!==-1?O[I]=R:O.push(R)}),s(O)},insertNodeAt:(C,S)=>{const _=[...o.value];_.splice(S,0,C),s(_)},moveNode:(C,S)=>{const _=[...o.value],[N]=_.splice(C,1);_.splice(S,0,N),s(_)},updateNodes:s}};function N6e(){const{removeNode:o}=IB(),{containerRef:s}=ef(),i=d.ref(null),u=h=>{var G,Q;if(h.target instanceof Element&&(h.target.closest(".node-item")||h.target.closest(".node-item-td")||h.target.closest(".disabeld-edit")))return;const b=h.target;if(b===s.value)return;const S=((G=s.value)==null?void 0:G.getRootNode()).getSelection(),_=(Q=s.value)==null?void 0:Q.querySelectorAll('[contenteditable="true"]');_==null||_.forEach(q=>{q.setAttribute("contenteditable","false")});const N=b.textContent||"",O=b.innerHTML||"";i.value=b,b.setAttribute("contenteditable","true"),b.focus();const R=new MutationObserver(()=>{b.textContent!==N&&(b.innerHTML=O)});R.observe(b,{characterData:!0,childList:!0,subtree:!0});const I=q=>{q.preventDefault()};b.addEventListener("input",I),b.addEventListener("paste",I),b.addEventListener("drop",I),b.addEventListener("keydown",q=>{var Z,L,fe,Ve;if(((Z=document.activeElement)==null?void 0:Z.shadowRoot)===((L=s.value)==null?void 0:L.getRootNode())&&!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(q.key)){if(q.key==="Backspace"||q.key==="Delete"){const Ce=S==null?void 0:S.getRangeAt(0);if(b.blur(),(Ce==null?void 0:Ce.startOffset)===0){const Y=Ce.startContainer;if(Y.nodeType===Node.TEXT_NODE){const Re=Y.previousSibling;if(Re&&Re.nodeType===Node.ELEMENT_NODE&&Re.classList.contains("node-item")){const it=Re.getAttribute("id");it&&o(it),(fe=Y.parentElement)==null||fe.normalize();return}}else if(Y.nodeType===Node.ELEMENT_NODE){const Re=Y.previousSibling;if(Re&&Re.nodeType===Node.ELEMENT_NODE&&Re.classList.contains("node-item")){const it=Re.getAttribute("id");it&&o(it),(Ve=Y.parentElement)==null||Ve.normalize();return}}}}q.preventDefault()}});const W=()=>{b==null||b.normalize(),R.disconnect(),b.removeEventListener("input",I),b.removeEventListener("paste",I),b.removeEventListener("drop",I),b.removeEventListener("blur",W),b.setAttribute("contenteditable","false")};b.addEventListener("blur",W)},m=()=>{var h;(h=s.value)==null||h.addEventListener("dblclick",u)};return d.watch(s,h=>{h&&m()},{immediate:!0}),d.onUnmounted(()=>{var h;(h=s.value)==null||h.removeEventListener("dblclick",u)}),{}}function O6e(){const{containerRef:o,focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}=ef(),h=_=>{var O;const N=_==null?void 0:_.getSelection();try{if((O=s.value)==null||O.normalize(),N){const I=function(){var Re,it;const G=_.getSelection();if(G.rangeCount===0)return null;const Q=G.getRangeAt(0),q=Q.startContainer;let Z=0,L=-1,fe=0,Ve=[];const Ce=q.nodeType===Node.TEXT_NODE?q.parentNode:q,Y=Array.from(Ce.childNodes);if(q.nodeType===Node.TEXT_NODE){Z=Q.startOffset,L=-1;for(let be=0;be<Y.length;be++)if(Y[be]===q){L=be;break}Ve=Y.slice(0,L);const Je=[];let _e=!1;for(let be=0;be<Ve.length;be++){const $=Ve[be];if((Re=$==null?void 0:$.classList)!=null&&Re.contains("node-item")){_e=!0;continue}else if($.nodeType===Node.TEXT_NODE){const ke=Je==null?void 0:Je[Je.length-1];_e&&typeof ke=="string"?Je[Je.length-1]=ke+($==null?void 0:$.data):Je.push($==null?void 0:$.data),_e=!1}else Je.push($),_e=!1}const ue=Ve==null?void 0:Ve[Ve.length-1],It=Je==null?void 0:Je[Je.length-1];fe=Je==null?void 0:Je.filter(be=>{var $;return!(($=be==null?void 0:be.classList)!=null&&$.contains("node-item"))}).length,(it=ue==null?void 0:ue.classList)!=null&&it.contains("node-item")&&typeof It=="string"&&fe--;const pe=Je==null?void 0:Je[Je.length-1];typeof pe=="string"&&(Z+=(pe==null?void 0:pe.length)||0)}else{const Je=Y==null?void 0:Y.filter(_e=>{var ue;return(ue=_e==null?void 0:_e.classList)==null?void 0:ue.contains("node-item")}).length;Z=Q.startOffset-Je}return{currentIndex:Math.max(fe,0),previousElements:Ve,startOffset:Math.max(Z,0)}}();return u.value=(I==null?void 0:I.currentIndex)||0,(I==null?void 0:I.startOffset)||0}}catch(R){console.error(R)}return 0},b=()=>{var N;const _=(N=o.value)==null?void 0:N.getRootNode();i.value=h(_)},C=_=>{var I;const N=_.target;if(N===o.value)return;s.value=N;const O=(I=o.value)==null?void 0:I.getRootNode();i.value=h(O),N.addEventListener("click",b),N.addEventListener("keyup",W=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(W.key)&&b()});const R=()=>{N.removeEventListener("click",b),N.removeEventListener("keyup",b),N.removeEventListener("blur",R),setTimeout(()=>{s.value=null,u.value=0,i.value=-1},300)};N.addEventListener("blur",R)},S=()=>{var _;(_=o.value)==null||_.addEventListener("focus",C,!0)};return d.watch(o,_=>{_&&S()},{immediate:!0}),d.onUnmounted(()=>{var _;(_=o.value)==null||_.removeEventListener("focus",C,!0)}),{focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}}function $6e(o){const s=o.value===null?[]:[JSON.parse(JSON.stringify(o.value))],i=d.ref(s),u=d.ref(0),m=d.ref(!1),h=d.computed(()=>i.value[u.value]),b=()=>{u.value>0&&(m.value=!0,u.value--,o.value=JSON.parse(JSON.stringify(i.value[u.value])))},C=()=>{u.value<i.value.length-1&&(m.value=!0,u.value++,o.value=JSON.parse(JSON.stringify(i.value[u.value])))},S=_=>{(_.ctrlKey||_.metaKey)&&_.key==="z"?(_.preventDefault(),b()):(_.ctrlKey||_.metaKey)&&_.key==="y"&&(_.preventDefault(),C())};return d.onMounted(()=>{window.addEventListener("keydown",S)}),d.onUnmounted(()=>{window.removeEventListener("keydown",S)}),d.watch(o,d2(_=>{_&&!m.value&&(i.value.splice(u.value+1),i.value.push(JSON.parse(JSON.stringify(_))),u.value++),m.value&&(m.value=!1)},300),{deep:!0}),{current:h,undo:b,redo:C}}var Mfe={exports:{}};(function(o,s){(function(i,u){o.exports=u()})(vE,function(){var i=1e3,u=6e4,m=36e5,h="millisecond",b="second",C="minute",S="hour",_="day",N="week",O="month",R="quarter",I="year",W="date",G="Invalid Date",Q=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,q=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,Z={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(pe){var be=["th","st","nd","rd"],$=pe%100;return"["+pe+(be[($-20)%10]||be[$]||be[0])+"]"}},L=function(pe,be,$){var ke=String(pe);return!ke||ke.length>=be?pe:""+Array(be+1-ke.length).join($)+pe},fe={s:L,z:function(pe){var be=-pe.utcOffset(),$=Math.abs(be),ke=Math.floor($/60),le=$%60;return(be<=0?"+":"-")+L(ke,2,"0")+":"+L(le,2,"0")},m:function pe(be,$){if(be.date()<$.date())return-pe($,be);var ke=12*($.year()-be.year())+($.month()-be.month()),le=be.clone().add(ke,O),qe=$-le<0,Xe=be.clone().add(ke+(qe?-1:1),O);return+(-(ke+($-le)/(qe?le-Xe:Xe-le))||0)},a:function(pe){return pe<0?Math.ceil(pe)||0:Math.floor(pe)},p:function(pe){return{M:O,y:I,w:N,d:_,D:W,h:S,m:C,s:b,ms:h,Q:R}[pe]||String(pe||"").toLowerCase().replace(/s$/,"")},u:function(pe){return pe===void 0}},Ve="en",Ce={};Ce[Ve]=Z;var Y="$isDayjsObject",Re=function(pe){return pe instanceof ue||!(!pe||!pe[Y])},it=function pe(be,$,ke){var le;if(!be)return Ve;if(typeof be=="string"){var qe=be.toLowerCase();Ce[qe]&&(le=qe),$&&(Ce[qe]=$,le=qe);var Xe=be.split("-");if(!le&&Xe.length>1)return pe(Xe[0])}else{var ce=be.name;Ce[ce]=be,le=ce}return!ke&&le&&(Ve=le),le||!ke&&Ve},Je=function(pe,be){if(Re(pe))return pe.clone();var $=typeof be=="object"?be:{};return $.date=pe,$.args=arguments,new ue($)},_e=fe;_e.l=it,_e.i=Re,_e.w=function(pe,be){return Je(pe,{locale:be.$L,utc:be.$u,x:be.$x,$offset:be.$offset})};var ue=function(){function pe($){this.$L=it($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[Y]=!0}var be=pe.prototype;return be.parse=function($){this.$d=function(ke){var le=ke.date,qe=ke.utc;if(le===null)return new Date(NaN);if(_e.u(le))return new Date;if(le instanceof Date)return new Date(le);if(typeof le=="string"&&!/Z$/i.test(le)){var Xe=le.match(Q);if(Xe){var ce=Xe[2]-1||0,Ue=(Xe[7]||"0").substring(0,3);return qe?new Date(Date.UTC(Xe[1],ce,Xe[3]||1,Xe[4]||0,Xe[5]||0,Xe[6]||0,Ue)):new Date(Xe[1],ce,Xe[3]||1,Xe[4]||0,Xe[5]||0,Xe[6]||0,Ue)}}return new Date(le)}($),this.init()},be.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},be.$utils=function(){return _e},be.isValid=function(){return this.$d.toString()!==G},be.isSame=function($,ke){var le=Je($);return this.startOf(ke)<=le&&le<=this.endOf(ke)},be.isAfter=function($,ke){return Je($)<this.startOf(ke)},be.isBefore=function($,ke){return this.endOf(ke)<Je($)},be.$g=function($,ke,le){return _e.u($)?this[ke]:this.set(le,$)},be.unix=function(){return Math.floor(this.valueOf()/1e3)},be.valueOf=function(){return this.$d.getTime()},be.startOf=function($,ke){var le=this,qe=!!_e.u(ke)||ke,Xe=_e.p($),ce=function(mn,gt){var St=_e.w(le.$u?Date.UTC(le.$y,gt,mn):new Date(le.$y,gt,mn),le);return qe?St:St.endOf(_)},Ue=function(mn,gt){return _e.w(le.toDate()[mn].apply(le.toDate("s"),(qe?[0,0,0,0]:[23,59,59,999]).slice(gt)),le)},wt=this.$W,He=this.$M,mt=this.$D,Ie="set"+(this.$u?"UTC":"");switch(Xe){case I:return qe?ce(1,0):ce(31,11);case O:return qe?ce(1,He):ce(0,He+1);case N:var pt=this.$locale().weekStart||0,oe=(wt<pt?wt+7:wt)-pt;return ce(qe?mt-oe:mt+(6-oe),He);case _:case W:return Ue(Ie+"Hours",0);case S:return Ue(Ie+"Minutes",1);case C:return Ue(Ie+"Seconds",2);case b:return Ue(Ie+"Milliseconds",3);default:return this.clone()}},be.endOf=function($){return this.startOf($,!1)},be.$set=function($,ke){var le,qe=_e.p($),Xe="set"+(this.$u?"UTC":""),ce=(le={},le[_]=Xe+"Date",le[W]=Xe+"Date",le[O]=Xe+"Month",le[I]=Xe+"FullYear",le[S]=Xe+"Hours",le[C]=Xe+"Minutes",le[b]=Xe+"Seconds",le[h]=Xe+"Milliseconds",le)[qe],Ue=qe===_?this.$D+(ke-this.$W):ke;if(qe===O||qe===I){var wt=this.clone().set(W,1);wt.$d[ce](Ue),wt.init(),this.$d=wt.set(W,Math.min(this.$D,wt.daysInMonth())).$d}else ce&&this.$d[ce](Ue);return this.init(),this},be.set=function($,ke){return this.clone().$set($,ke)},be.get=function($){return this[_e.p($)]()},be.add=function($,ke){var le,qe=this;$=Number($);var Xe=_e.p(ke),ce=function(He){var mt=Je(qe);return _e.w(mt.date(mt.date()+Math.round(He*$)),qe)};if(Xe===O)return this.set(O,this.$M+$);if(Xe===I)return this.set(I,this.$y+$);if(Xe===_)return ce(1);if(Xe===N)return ce(7);var Ue=(le={},le[C]=u,le[S]=m,le[b]=i,le)[Xe]||1,wt=this.$d.getTime()+$*Ue;return _e.w(wt,this)},be.subtract=function($,ke){return this.add(-1*$,ke)},be.format=function($){var ke=this,le=this.$locale();if(!this.isValid())return le.invalidDate||G;var qe=$||"YYYY-MM-DDTHH:mm:ssZ",Xe=_e.z(this),ce=this.$H,Ue=this.$m,wt=this.$M,He=le.weekdays,mt=le.months,Ie=le.meridiem,pt=function(gt,St,Wt,Et){return gt&&(gt[St]||gt(ke,qe))||Wt[St].slice(0,Et)},oe=function(gt){return _e.s(ce%12||12,gt,"0")},mn=Ie||function(gt,St,Wt){var Et=gt<12?"AM":"PM";return Wt?Et.toLowerCase():Et};return qe.replace(q,function(gt,St){return St||function(Wt){switch(Wt){case"YY":return String(ke.$y).slice(-2);case"YYYY":return _e.s(ke.$y,4,"0");case"M":return wt+1;case"MM":return _e.s(wt+1,2,"0");case"MMM":return pt(le.monthsShort,wt,mt,3);case"MMMM":return pt(mt,wt);case"D":return ke.$D;case"DD":return _e.s(ke.$D,2,"0");case"d":return String(ke.$W);case"dd":return pt(le.weekdaysMin,ke.$W,He,2);case"ddd":return pt(le.weekdaysShort,ke.$W,He,3);case"dddd":return He[ke.$W];case"H":return String(ce);case"HH":return _e.s(ce,2,"0");case"h":return oe(1);case"hh":return oe(2);case"a":return mn(ce,Ue,!0);case"A":return mn(ce,Ue,!1);case"m":return String(Ue);case"mm":return _e.s(Ue,2,"0");case"s":return String(ke.$s);case"ss":return _e.s(ke.$s,2,"0");case"SSS":return _e.s(ke.$ms,3,"0");case"Z":return Xe}return null}(gt)||Xe.replace(":","")})},be.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},be.diff=function($,ke,le){var qe,Xe=this,ce=_e.p(ke),Ue=Je($),wt=(Ue.utcOffset()-this.utcOffset())*u,He=this-Ue,mt=function(){return _e.m(Xe,Ue)};switch(ce){case I:qe=mt()/12;break;case O:qe=mt();break;case R:qe=mt()/3;break;case N:qe=(He-wt)/6048e5;break;case _:qe=(He-wt)/864e5;break;case S:qe=He/m;break;case C:qe=He/u;break;case b:qe=He/i;break;default:qe=He}return le?qe:_e.a(qe)},be.daysInMonth=function(){return this.endOf(O).$D},be.$locale=function(){return Ce[this.$L]},be.locale=function($,ke){if(!$)return this.$L;var le=this.clone(),qe=it($,ke,!0);return qe&&(le.$L=qe),le},be.clone=function(){return _e.w(this.$d,this)},be.toDate=function(){return new Date(this.valueOf())},be.toJSON=function(){return this.isValid()?this.toISOString():null},be.toISOString=function(){return this.$d.toISOString()},be.toString=function(){return this.$d.toUTCString()},pe}(),It=ue.prototype;return Je.prototype=It,[["$ms",h],["$s",b],["$m",C],["$H",S],["$W",_],["$M",O],["$y",I],["$D",W]].forEach(function(pe){It[pe[1]]=function(be){return this.$g(be,pe[0],pe[1])}}),Je.extend=function(pe,be){return pe.$i||(pe(be,ue,Je),pe.$i=!0),Je},Je.locale=it,Je.isDayjs=Re,Je.unix=function(pe){return Je(1e3*pe)},Je.en=Ce[Ve],Je.Ls=Ce,Je.p={},Je})})(Mfe);var D6e=Mfe.exports;const Bfe=S4(D6e);function M6e(){const{modelValue:o,inputTypes:s}=j0(),{nodes:i,updateNodes:u}=IB(),m=b=>{if(!b||typeof b!="string")return[];const S=new DOMParser().parseFromString(b,"text/html");return Array.from(S.querySelectorAll("td")).filter(O=>{var R;return!((R=O.textContent)!=null&&R.trim())})},h=async b=>{var _,N;const C=await((N=(_=s==null?void 0:s.find(O=>{var R;return((R=O.value)==null?void 0:R.toLowerCase())==="text"}))==null?void 0:_.getDefaultProps)==null?void 0:N.call(_))||{},S=b.map(O=>{let R=O==null?void 0:O.id;return R||(R=m2()),{id:R,nodeType:"Text",label:"文本",props:{...C},...O}});u(S)};d.onMounted(()=>{var I;const b=m(d.toValue(o)),C=Bfe().valueOf(),S=d.toValue(i),_=S.filter(W=>wne(W)),N=S.filter(W=>!wne(W)),R=[...(I=b.map(W=>({nodePath:$U(W),startOffset:0,subNodeSort:0,insertTime:C})))==null?void 0:I.map(W=>{const G=_==null?void 0:_.find(Q=>Q.nodePath===W.nodePath);return{...W,...G}}),...N];h(R)})}function B6e(){const{selectedNodes:o,containerRef:s,isFocused:i}=ef(),{removeNode:u}=IB(),m=d.ref(null),h=S=>{if(i.value&&(S.key==="Delete"||S.key==="Backspace")){const _=[];d.toValue(o).length>0&&(d.toValue(o).forEach(N=>{var O,R,I;if(((O=N==null?void 0:N.element)==null?void 0:O.tagName)==="TD"){const W=(R=N==null?void 0:N.element)==null?void 0:R.getAttribute("id");W&&_.push(W)}else{const W=(I=N==null?void 0:N.element)==null?void 0:I.getAttribute("id");W&&_.push(W)}}),o.value=[],(_==null?void 0:_.length)>0&&u(_))}},b=S=>{var _;(_=d.toValue(s))!=null&&_.contains(S.target)?m.value=S.target:m.value=null},C=()=>{s.value&&(window.addEventListener("keydown",h),s.value.addEventListener("mousedown",b))};d.watch(()=>s.value,S=>{d.toValue(S)&&C()},{immediate:!0}),d.onUnmounted(()=>{s.value&&(window.removeEventListener("keydown",h),s.value.removeEventListener("mousedown",b))})}function MU(){const{nodes:o}=j0(),{containerRef:s,renderNodes:i,uiReady:u}=ef(),{removeNode:m}=IB(),h=()=>{var C;i.value=[...((C=o.value)==null?void 0:C.map(S=>{var N;const _=(N=s.value)==null?void 0:N.querySelector(`[id="${S.id}"]`);return{...S,element:_}}))||[]].filter(S=>!!(S!=null&&S.element))},b=d2(C=>{d.nextTick(()=>{var S;m((S=C==null?void 0:C.map(_=>_==null?void 0:_.id))==null?void 0:S.filter(Boolean))})},500);d.watch(()=>[i.value,u],()=>{if(d.toValue(u)){const C=_xe(o.value,i.value,"id");b(C)}},{immediate:!0,deep:!0}),d.watch(()=>[o.value,s.value,u],()=>{d.toValue(u)&&d.nextTick(()=>{h()})},{immediate:!0,deep:!0})}const Cne=d.ref({});function BU(o){return d.computed(()=>{var s;return(s=Cne.value)==null?void 0:s[o]})}function Roe(){const o=j0(),s=ef();d.onMounted(()=>{const{editorId:i}=o;i&&(Cne.value[i]=d.ref({...o,...s}))}),d.onUnmounted(()=>{const{editorId:i}=o;i&&(Cne.value[i]=null)})}const R6e=d.defineComponent({__name:"NodesEditUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"edit"}},setup(o){const{nodes:s}=j0(),{uiReady:i,renderNodes:u}=ef();return Roe(),$6e(s),Dfe(),Boe(),B6e(),O6e(),N6e(),M6e(),MU(),(m,h)=>d.unref(i)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(u),b=>(d.openBlock(),d.createBlock(DU,{key:b==null?void 0:b.id,node:b},{default:d.withCtx(C=>[d.renderSlot(m.$slots,"nodeItem",{node:C==null?void 0:C.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),ale=d.defineComponent({__name:"NodesPreviewUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=ef();return Roe(),MU(),Boe(),(u,m)=>d.unref(s)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(i),h=>(d.openBlock(),d.createBlock(DU,{key:h==null?void 0:h.id,node:h},{default:d.withCtx(b=>[d.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),I6e=d.defineComponent({__name:"NodesEnterUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=ef();return MU(),(u,m)=>d.unref(s)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(i),h=>(d.openBlock(),d.createBlock(DU,{key:h==null?void 0:h.id,node:h},{default:d.withCtx(b=>[d.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),P6e=d.defineComponent({__name:"NodesSelectUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"select"}},setup(o){const{uiReady:s,renderNodes:i}=ef();return Roe(),Dfe(),Boe(),MU(),(u,m)=>d.unref(s)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(i),h=>(d.openBlock(),d.createBlock(DU,{key:h==null?void 0:h.id,node:h},{default:d.withCtx(b=>[d.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),l2=d.ref({});function Rfe(o){return d.computed(()=>(l2.value[o]||(l2.value[o]=d.ref([])),l2.value[o]))}function F6e(o){const{editorId:s}=o,i=d.ref(!1);d.onMounted(()=>{l2.value[s]||(l2.value[s]=d.ref([]));const u=l2.value[s].findIndex(m=>m.id===o.id);u!==-1&&l2.value[s].splice(u,1),i.value=!0,l2.value[s].push({...o,isMounted:i})}),d.onUnmounted(()=>{i.value=!1})}const L6e=d.defineComponent({__name:"NodesProvider",props:d.mergeModels({nodes:{type:Array,default:()=>[]},renderType:{type:String,default:"preview"},inputTypes:{type:Array,default:()=>[]},editorId:{type:String,default:""},disabledNodes:{type:Array,default:()=>[]}},{formData:{},formDataModifiers:{},nodes:{},nodesModifiers:{},modelValue:{},modelModifiers:{}}),emits:["update:formData","update:nodes","update:modelValue"],setup(o){const s=o,i=d.useModel(o,"formData"),u=d.useModel(o,"nodes"),m=d.useModel(o,"modelValue"),h=Rfe(s==null?void 0:s.editorId),b=d.computed(()=>{var O,R,I;const N=[...Nfe(((I=(R=(O=d.toValue(h))==null?void 0:O.filter(W=>d.toValue(W==null?void 0:W.activated)))==null?void 0:R.filter(W=>d.toValue(W.isMounted)))==null?void 0:I.filter(W=>d.toValue(W==null?void 0:W.isOccupy)))||[]),...s.disabledNodes||[]];return Gxe(N,"id")}),C=d.computed(()=>d.toValue(s.renderType)),S=_=>{na(u.value,_)||(u.value=_)};return d.provide($fe,{modelValue:m,renderType:C,inputTypes:s.inputTypes,editorId:s==null?void 0:s.editorId,nodes:u,disabledNodes:b,updateNodes:S,formData:i}),(_,N)=>d.renderSlot(_.$slots,"default")}}),V6e=d.defineComponent({__name:"NodesUIProvider",props:{nodes:{type:Array,default:()=>[]},selectedNodes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},editorId:{type:String,default:""},htmlRenderRef:{type:Object,default:()=>{}}},emits:["onSelectedNodes","update:selectedNodes"],setup(o,{expose:s,emit:i}){const u=o,m=i,h=d.ref(null),b=d.ref(null),C=d.ref([]),S=d.ref(null),_=d.ref(-1),N=d.ref(0),O=d.ref(0),R=Rfe(u==null?void 0:u.editorId),I=d.ref(!1),W=d.ref(!1),G=d.computed(()=>u.htmlRenderRef),Q=d.computed({get:()=>(u.selectedNodes||[]).map(Ve=>{var Re;let Ce=(Re=u==null?void 0:u.nodes)==null?void 0:Re.find(it=>(it==null?void 0:it.id)===(Ve==null?void 0:Ve.id)),Y=Ve!=null&&Ve.element?Ve==null?void 0:Ve.element:m6e(Ve==null?void 0:Ve.id,h.value);return{...Ce||{},...Ve,element:Y}}),set:Ve=>{const Ce=Ve.map(({element:Y,...Re})=>{var Je;return{...((Je=u==null?void 0:u.nodes)==null?void 0:Je.find(_e=>(_e==null?void 0:_e.id)===(Re==null?void 0:Re.id)))||{},...Re}});m("update:selectedNodes",Ce)}}),q=d.computed(()=>{var Y,Re,it;const Ve=(Re=(Y=d.toValue(R))==null?void 0:Y.filter(Je=>d.toValue(Je==null?void 0:Je.activated)))==null?void 0:Re.filter(Je=>d.toValue(Je.isMounted)),Ce=((it=d.toValue(u==null?void 0:u.nodesGroups)||[])==null?void 0:it.map(Je=>({...Je||{},activated:!0})))||[];return Nfe([...Ce,...Ve])}),Z=d.ref([]),L=Ve=>{var Re;const Ce=Ve.map(({...it})=>{var It;let Je=(It=C.value)==null?void 0:It.find(pe=>(pe==null?void 0:pe.id)===(it==null?void 0:it.id));const{element:_e,...ue}={...Je||{},...it};return ue}),Y=(Re=Q.value)==null?void 0:Re.map(({element:it,...Je})=>Je);na(Ce,Y)||(Q.value=Ce,m("onSelectedNodes",Ce))},fe=d.computed(()=>d.toValue(u==null?void 0:u.nodesGroups));return s({setSelectedNodes:L}),d.provide(Tfe,{containerRef:h,htmlRenderRef:G,contextMenuRef:b,focusedElement:S,currentRenderNodes:Z,cursorPosition:_,focusedNodeIndex:N,preNodeNumber:O,currentNodes:q,selectedNodes:Q,setSelectedNodes:L,renderNodes:C,uiReady:I,isFocused:W,nodesGroups:fe}),(Ve,Ce)=>d.renderSlot(Ve.$slots,"default")}}),H6e=["onClick"],z6e={key:0,class:"icon"},U6e={key:1,class:"arrow"},j6e=["onClick"],W6e={key:0,class:"icon"},Z6e=d.defineComponent({__name:"index",props:d.mergeModels({style:{},direction:{}},{show:{type:Boolean},showModifiers:{}}),emits:d.mergeModels(["select"],["update:show"]),setup(o,{emit:s}){const i=o,{contextMenuRef:u,selectedNodes:m,setSelectedNodes:h,focusedElement:b,cursorPosition:C,focusedNodeIndex:S,preNodeNumber:_}=ef(),{inputTypes:N}=j0(),O=d.useModel(o,"show"),R=d.ref(!1),I=()=>{R.value=!1},W=d.ref({focusedElement:null,cursorPosition:0,focusedNodeIndex:0,preNodeNumber:0});d.watch(()=>[O,i==null?void 0:i.style],()=>{d.toValue(O)&&(R.value=!1,d.nextTick(()=>{R.value=!!d.toValue(O),W.value={focusedElement:d.toValue(b),cursorPosition:d.toValue(C),focusedNodeIndex:d.toValue(S),preNodeNumber:d.toValue(_)}}))},{immediate:!0,deep:!0});const{editNodes:G}=IB(),Q=async fe=>{var Ve,Ce;if(d.toValue(W).focusedElement&&!Bxe(d.toValue(C))){const Y=$U(d.toValue(W).focusedElement),Re=d.toValue(W).cursorPosition,it=(d.toValue(W).preNodeNumber||0)+1,Je=v6e(d.toValue(W).focusedElement),_e=Bfe().valueOf();if(Y&&!dB(Re)&&Re>=0){const ue=await((Ve=fe==null?void 0:fe.getDefaultProps)==null?void 0:Ve.call(fe))||{};G({...Je,label:fe==null?void 0:fe.label,nodePath:Y,startOffset:Re,subNodeSort:it,textNodeIndex:d.toValue(S)||0,nodeType:fe==null?void 0:fe.value,insertTime:_e,props:ue})}}else if(m){const Y=d.toValue(m);if(Y!=null&&Y.length){const Re=await((Ce=fe==null?void 0:fe.getDefaultProps)==null?void 0:Ce.call(fe))||{},it=Y==null?void 0:Y.map(Je=>({...Je,label:fe==null?void 0:fe.label,element:Je==null?void 0:Je.element,nodePath:Je==null?void 0:Je.nodePath,nodeType:fe==null?void 0:fe.value,props:Re}));G(it),h(it)}}O.value=!1},q=d.computed(()=>{const fe=[],Ve=[];return d.toValue(N).forEach(Ce=>{Ce.groupName==="system"?Ve.push({...Ce,handler:()=>{Q(Ce)}}):fe.push({...Ce,handler:()=>{Q(Ce)}})}),[{label:"限定填写内容",icon:"i-bi:lock",children:fe},{label:"插入记录标识",icon:"i-bi:flag",children:Ve}].filter(Ce=>{var Y;return(Y=Ce==null?void 0:Ce.children)==null?void 0:Y.length})}),Z=s,L=(fe,Ve)=>{fe.preventDefault(),Ve!=null&&Ve.handler&&Ve.handler(),Ve!=null&&Ve.value&&(Z("select",Ve==null?void 0:Ve.value),R.value=!1)};return(fe,Ve)=>(d.openBlock(),d.createBlock(d.unref(On.ElPopover),{visible:R.value,"popper-style":"padding:0px;"},{reference:d.withCtx(()=>[d.withDirectives(d.createElementVNode("div",{class:"popover-point",style:d.normalizeStyle({...fe.style}),ref_key:"contextMenuRef",ref:u},null,4),[[d.unref(On.ClickOutside),I]])]),default:d.withCtx(()=>[d.createElementVNode("div",{ref_key:"contextMenuRef",ref:u,class:"context-menu"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(q.value,Ce=>(d.openBlock(),d.createElementBlock("div",{key:Ce==null?void 0:Ce.label,class:"menu-item"},[d.createElementVNode("div",{class:"menu-item-content",onClick:Y=>L(Y,Ce)},[Ce!=null&&Ce.icon?(d.openBlock(),d.createElementBlock("div",z6e,[d.createElementVNode("div",{class:d.normalizeClass(Ce==null?void 0:Ce.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(Ce.label)+" ",1),Ce!=null&&Ce.children?(d.openBlock(),d.createElementBlock("span",U6e,"›")):d.createCommentVNode("",!0)],8,H6e),Ce!=null&&Ce.children?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["submenu",{"submenu-bottom":fe.direction==="bottom"}])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(Ce.children,Y=>(d.openBlock(),d.createElementBlock("div",{key:Y.action,class:"menu-item",onClick:Re=>L(Re,Y)},[Y!=null&&Y.icon?(d.openBlock(),d.createElementBlock("div",W6e,[d.createElementVNode("div",{class:d.normalizeClass(Y==null?void 0:Y.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(Y.label),1)],8,j6e))),128))],2)):d.createCommentVNode("",!0)]))),128))],512)]),_:1},8,["visible"]))}}),G6e=Ja(Z6e,[["__scopeId","data-v-fdbda0b7"]]);function q6e(o){const{headerHeight:s,hasContextMenu:i}=o,{contextMenuRef:u}=ef(),m=d.ref(!1),h=d.ref("top"),b=d.ref({left:"0px",top:"0px"}),C=_=>{d.toValue(i)&&(_.preventDefault(),m.value=!0,d.nextTick(()=>{const O=_.currentTarget.getBoundingClientRect(),R=_.clientX-O.left,I=_.clientY-O.top,W=u==null?void 0:u.value,G=Array.from((W==null?void 0:W.querySelectorAll(".submenu"))||[]).reduce((Q,q)=>Math.max(Q,q.offsetHeight||0),0)||400;O.height-I<G?h.value="bottom":h.value="top",b.value={left:`${R}px`,top:`${I+d.toValue(s)}px`}}))},S=_=>{_.button===0&&(m.value=!1)};return d.onMounted(()=>{document.addEventListener("mousedown",S)}),d.onUnmounted(()=>{document.removeEventListener("mousedown",S)}),{showContextMenu:m,contextMenuStyle:b,onContextMenu:C,closeContextMenu:S,direction:h}}function Ife(o){return{all:o=o||new Map,on:function(s,i){var u=o.get(s);u?u.push(i):o.set(s,[i])},off:function(s,i){var u=o.get(s);u&&(i?u.splice(u.indexOf(i)>>>0,1):o.set(s,[]))},emit:function(s,i){var u=o.get(s);u&&u.slice().map(function(m){m(i)}),(u=o.get("*"))&&u.slice().map(function(m){m(s,i)})}}}const Sne=Ife(),Pfe=(...o)=>{const s=o[0],i=o[1];d.onMounted(()=>{Sne.on(s,i)}),d.onBeforeUnmount(()=>{Sne.off(s)})},Ioe=()=>(...s)=>{Sne.emit(...s)};let rE=null;function Y6e(o){const{onSelected:s}={},{selectedNodes:i,uiReady:u,setSelectedNodes:m}=ef(),h=d.ref("multiple"),b=(S="select")=>{var N,O;let _=[];h.value==="single"?(N=i.value)!=null&&N[0]&&_.push((O=i.value)==null?void 0:O[0]):_=ta(i.value),rE==null||rE({data:_,type:S}),S==="blur"&&(rE=null,h.value="multiple"),m(_)};return d.watch(()=>i,()=>{u.value&&(b(),s==null||s(d.toValue(i)))},{deep:!0}),Pfe("selectNodes",S=>{const{data:_,callback:N=null,mode:O="multiple"}=S;h.value=O,setTimeout(()=>{m(d.toValue(_)),rE=N},100)}),{onBlur:()=>{rE&&(b("blur"),rE=null,m([]))}}}const Bz={A3:{width:297,height:420},A4:{width:210,height:297},A5:{width:148,height:210},B3:{width:353,height:500},B4:{width:257,height:364},B5:{width:176,height:250}},K6e={class:"relative"},X6e={class:"header-container"},J6e=["innerHTML"],Q6e={style:{overflow:"hidden"}},eBe=["innerHTML"],tBe=d.defineComponent({__name:"index",props:{headerHtml:{type:String,default:""},footerHtml:{type:String,default:""},pagesize:{type:String,default:"A4"}},emits:["onUiReady"],setup(o,{expose:s,emit:i}){const u=d.ref(),{containerRef:m,uiReady:h,isFocused:b}=ef(),{nodes:C,modelValue:S,renderType:_}=j0(),N=d.computed(()=>d.toValue(_)==="edit"),O=o,R=i,I=()=>{R("onUiReady",{containerRef:m})},{height:W}=mMe(u),G=d.computed(()=>O.headerHtml?O.headerHtml.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,($,ke,le)=>{const qe=le.replace(/([^{}]+)\{/g,(Xe,ce)=>{const Ue=ce.trim();return Ue&&!Ue.includes(".header-container")?`.header-container ${Ue} {`:Xe});return`<style${ke}>${qe}</style>`}):""),Q=d.computed(()=>{const $=Bz[O.pagesize]||Bz.A4,ke=(window.devicePixelRatio||1)*96;return`${$.height*ke/25.4-d.toValue(W)}px`}),{showContextMenu:q,contextMenuStyle:Z,onContextMenu:L,direction:fe}=q6e({headerHeight:W,hasContextMenu:N}),Ve=d.ref(null),Ce=$=>{var Xe;const ke=(Xe=m.value)==null?void 0:Xe.querySelector(`[id="${$==null?void 0:$.id}"]`);if(ke)return ke;let le=null;const qe=document.createElement("span");return qe.setAttribute("contenteditable","false"),qe.classList.add("node-item"),le=qe,g6e($,le,m.value),le&&h6e(le,$),le},Y=$=>{const ke=d.toValue(m);if(!ke)return $;const le=ke.querySelectorAll(".node-item");if(!le||le.length===0)return $;const qe=new Map;return le.forEach(ce=>{const Ue=ce.getAttribute("id")||"",He={nodePath:$U(ce==null?void 0:ce.parentElement)||ce.getAttribute("data-nodePath")||""||void 0},mt=Ue;mt&&qe.set(mt,{id:Ue||void 0,...He})}),(d.toValue($)||[]).map(ce=>{const Ue=(ce==null?void 0:ce.id)||(ce==null?void 0:ce.nodePath),wt=Ue?qe.get(Ue):void 0;return wt?{...ce,...wt}:ce})},Re=()=>{var ke,le,qe;const $=Y(C.value)||[];if(na($,C.value)){const Xe=Vxe($,[ce=>ce.nodePath,ce=>ce.textNodeIndex||-1,ce=>(ce==null?void 0:ce.startOffset)??-1,ce=>ce.subNodeSort||-1,ce=>(ce==null?void 0:ce.insertTime)||-1],["asc","desc","desc","desc","desc"]);(le=(ke=Ve.value)==null?void 0:ke.querySelectorAll(".node-item"))==null||le.forEach(ce=>ce.remove()),(qe=Ve.value)==null||qe.normalize(),Xe==null||Xe.forEach(ce=>{Ce(ce)})}},it=($,ke)=>{const le=new Set((ke||[]).map(ce=>ce==null?void 0:ce.id).filter(ce=>typeof ce=="string"&&ce.length>0)),qe=document.createElement("div");return qe.innerHTML=$||"",qe.querySelectorAll(".node-item").forEach(ce=>{const Ue=ce.getAttribute("id")||"";(!Ue||!le.has(Ue))&&ce.remove()}),qe.innerHTML},Je=()=>{Ve.value&&(h.value=!1,d.nextTick(()=>{if(Ve.value){const $=it(d.toValue(S),_e.value);Ve.value.innerHTML=$,Re(),h.value=!0,S.value=Ve.value.innerHTML,d.nextTick(()=>{I(),setTimeout(()=>{d.toValue(m)&&E6e(d.toValue(m))},10)})}}))},_e=d.computed(()=>{var $;return($=d.toValue(C))==null?void 0:$.map(ke=>{const{nodePath:le,id:qe,nodeType:Xe}=ke;return{nodePath:le,id:qe,nodeType:Xe}})});d.watch(()=>[S,Ve],()=>{Je()},{deep:!0,immediate:!0}),d.watch(()=>[..._e.value],($,ke)=>{na(ke,$)||Je()},{deep:!0,immediate:!0});const ue=d.ref(),It=()=>{b.value=!0},{onBlur:pe}=Y6e(),be=()=>{b.value=!1,pe()};return s({renderHtml:Je}),($,ke)=>(d.openBlock(),d.createElementBlock("div",K6e,[d.createVNode(RB,{onOnBlur:be,onOnFocus:It,ref_key:"shadowDomRef",ref:ue},{default:d.withCtx(()=>[d.createElementVNode("div",{ref_key:"headerRef",ref:u,style:{overflow:"hidden"}},[d.createElementVNode("div",X6e,[d.createElementVNode("div",{innerHTML:G.value,class:"disabeld-edit docHeaderHtml",onClick:It},null,8,J6e)])],512),d.createElementVNode("html",{class:d.normalizeClass(["nodes-editor",`nodes-editor-${d.unref(_)}`]),ref_key:"containerRef",ref:m,style:d.normalizeStyle([{position:"relative"},{position:"relative",minHeight:Q.value}]),onContextmenu:ke[0]||(ke[0]=d.withModifiers((...le)=>d.unref(L)&&d.unref(L)(...le),["prevent"]))},[d.createElementVNode("body",{ref_key:"bodyRef",ref:Ve},null,512),d.createElementVNode("div",Q6e,[d.createElementVNode("div",{innerHTML:O==null?void 0:O.footerHtml,class:"disabeld-edit docFooterHtml",onClick:It},null,8,eBe)])],38)]),_:1},512),N.value?(d.openBlock(),d.createBlock(G6e,{key:0,show:d.unref(q),"onUpdate:show":ke[1]||(ke[1]=le=>d.isRef(q)?q.value=le:null),style:d.normalizeStyle(d.unref(Z)),direction:d.unref(fe)},null,8,["show","style","direction"])):d.createCommentVNode("",!0)]))}}),nBe={class:"pagesize"},oBe=d.defineComponent({__name:"index",props:{pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},style:{type:Object,default:()=>({})}},setup(o){const s=o,i=d.computed(()=>{const u=Bz[s.pagesize]||Bz.A4;let{width:m,height:h}=u;s.orientation==="landscape"&&([m,h]=[h,m]);const b=(window.devicePixelRatio||1)*96;return m*b/25.4});return(u,m)=>(d.openBlock(),d.createElementBlock("div",nBe,[d.createElementVNode("div",{style:d.normalizeStyle({width:`${i.value}px`,...o.style}),class:"pagesize-content"},[d.renderSlot(u.$slots,"default",{},void 0,!0)],4)]))}}),sBe=Ja(oBe,[["__scopeId","data-v-44e34db1"]]),Ffe=d.defineComponent({__name:"index",props:d.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},renderType:{type:String,default:"preview"},formData:{type:Object,default:()=>({})},inputTypes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},id:{type:String,default:""},disabledNodes:{type:Array,default:()=>[]},headerHtml:{type:String,default:""},footerHtml:{type:String,default:""},pagesizeStyle:{type:Object,default:()=>({})}},{selectedNodes:{default:[]},selectedNodesModifiers:{}}),emits:d.mergeModels(["update:modelValue","update:nodes","update:formData","onSelectedNodes","onUiReady"],["update:selectedNodes"]),setup(o,{expose:s,emit:i}){const u=o,m=i,h=d.useModel(o,"selectedNodes");Em(u.formData);const b=d.ref(),C=d.ref(null),S=Q=>{m("onUiReady",Q)},_=d.ref(),N=d.computed(()=>d.toValue(u.renderType)),O=d.computed(()=>{switch(d.toValue(N)){case"edit":return R6e;case"select":return P6e;case"preview":return ale;case"enter":return I6e;default:return ale}}),R=Q=>{m("update:nodes",Q)},I=Q=>{m("update:modelValue",Q)},W=Q=>{m("update:formData",Q)},G=Q=>{m("onSelectedNodes",Q)};return s({formRef:{validate:()=>{var Q,q,Z;return(Z=(q=(Q=b.value)==null?void 0:Q.formRef)==null?void 0:q.validate)==null?void 0:Z.call(q)}},setSelectedNodes:Q=>{var q,Z;(Z=(q=_.value)==null?void 0:q.setSelectedNodes)==null||Z.call(q,Q)}}),(Q,q)=>(d.openBlock(),d.createBlock(sBe,{pagesize:o.pagesize,orientation:u==null?void 0:u.orientation,style:d.normalizeStyle(o.pagesizeStyle)},{default:d.withCtx(()=>[d.createVNode(V6e,{ref_key:"UIRef",ref:_,nodes:o.nodes,"onUpdate:nodes":R,selectedNodes:h.value,"onUpdate:selectedNodes":q[0]||(q[0]=Z=>h.value=Z),onOnSelectedNodes:G,nodesGroups:o.nodesGroups,editorId:u==null?void 0:u.id,htmlRenderRef:C.value},{default:d.withCtx(()=>[d.createVNode(L6e,{renderType:N.value,"model-value":o.modelValue,"onUpdate:modelValue":I,nodes:o.nodes,"onUpdate:nodes":R,formData:o.formData,"onUpdate:formData":W,inputTypes:o.inputTypes,editorId:u==null?void 0:u.id,disabledNodes:o.disabledNodes},{default:d.withCtx(()=>[d.createVNode(tBe,{ref_key:"htmlRenderRef",ref:C,headerHtml:o.headerHtml,footerHtml:o.footerHtml,pagesize:u==null?void 0:u.pagesize,onOnUiReady:S},null,8,["headerHtml","footerHtml","pagesize"]),(d.openBlock(),d.createBlock(d.resolveDynamicComponent(O.value),{renderType:N.value,pagesize:o.pagesize,ref_key:"contentRef",ref:b},{nodeItem:d.withCtx(Z=>[d.renderSlot(Q.$slots,"nodeItem",{node:Z==null?void 0:Z.node})]),_:3},8,["renderType","pagesize"]))]),_:3},8,["renderType","model-value","nodes","formData","inputTypes","editorId","disabledNodes"])]),_:3},8,["nodes","selectedNodes","nodesGroups","editorId","htmlRenderRef"])]),_:3},8,["pagesize","orientation","style"]))}}),rBe={class:"nodes-text"},aBe={key:0,class:"node-text-input"},iBe={key:1,class:"node-text-td"},lBe={key:0,class:"node-text-table-index"},cBe=d.defineComponent({__name:"index",props:d.mergeModels({editorId:{type:String,default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=d.useModel(o,"modelValue"),u=BU(s==null?void 0:s.editorId),m=d.computed(()=>{var b;return Ofe(i.value,((b=d.toValue(u))==null?void 0:b.renderNodes)||[])}),h=d.computed(()=>{var b;return((b=d.toValue(m))==null?void 0:b.length)>0?!d.toValue(m).some(S=>{var _,N;return((_=S==null?void 0:S.min)==null?void 0:_.tableIndex)>1||((N=S==null?void 0:S.max)==null?void 0:N.tableIndex)>1}):!0});return(b,C)=>(d.openBlock(),d.createElementBlock("div",rBe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(m.value,(S,_)=>{var N,O,R,I,W,G,Q,q,Z;return d.openBlock(),d.createElementBlock("div",{key:_,class:"node-text-item"},[(S==null?void 0:S.showTextType)==="input"?(d.openBlock(),d.createElementBlock("span",aBe,d.toDisplayString((N=S==null?void 0:S.props)!=null&&N.alias?(O=S==null?void 0:S.props)==null?void 0:O.alias:`填写${S==null?void 0:S.inputIndex}`),1)):(d.openBlock(),d.createElementBlock("span",iBe,[h.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("span",lBe,d.toDisplayString(`表${(R=S==null?void 0:S.min)==null?void 0:R.tableIndex}.`),1)),d.createTextVNode(" "+d.toDisplayString(((I=S==null?void 0:S.min)==null?void 0:I.id)===((W=S==null?void 0:S.max)==null?void 0:W.id)?(Q=(G=S==null?void 0:S.min)==null?void 0:G.props)!=null&&Q.alias?(Z=(q=S==null?void 0:S.min)==null?void 0:q.props)==null?void 0:Z.alias:d.unref(r4)(S==null?void 0:S.min):`${d.unref(r4)(S==null?void 0:S.min)}:${d.unref(r4)(S==null?void 0:S.max)}`),1)]))])}),128))]))}}),ile=Ja(cBe,[["__scopeId","data-v-73a2b2dc"]]);function Poe(o){const{nodes:s,mode:i="multiple"}=o,u=d.ref(!1),m=Ioe();return{isSelecting:u,selectNodes:()=>{if(u.value)return!1;u.value=!0,m("selectNodes",{data:ta(d.toValue(s)),mode:i,callback:({data:b,type:C})=>{s.value=x6e(ta(d.toValue(b))),C==="blur"&&(u.value=!1)}})}}}const ZA=["#409EFF","#b36c2d","#7548ff","#5233b3","#649ee5","#aac4ed","#f9ce57","#ae74e8"],BH=d.ref(0),aE=new Map,uBe={key:0,class:"node-select-small gap-x-2"},dBe={key:1,class:"text-[#999]"},fBe={key:1,class:"node-select"},mBe={class:"flex py-2 px-2 justify-between items-center noder-select-header"},pBe={class:"flex gap-2"},gBe={key:1},hBe={class:"flex gap-1"},vBe=d.defineComponent({__name:"index",props:d.mergeModels({mode:{type:String,default:"multiple"},color:{type:String},id:{type:String,default:""},editorId:{type:String,default:""},size:{type:String,default:"default"},label:{type:String,default:"点击选择"},isOccupy:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=d.ref((aE==null?void 0:aE[s==null?void 0:s.id])||0),u=d.ref((s==null?void 0:s.id)||m2()),m=d.useModel(o,"modelValue");Em(m);const{selectNodes:h,isSelecting:b}=Poe({nodes:m,mode:s.mode}),C=()=>{m.value=[]},S=d.computed(()=>s.color||(ZA==null?void 0:ZA[d.toValue(i)%(ZA==null?void 0:ZA.length)])||"#409eff");d.onMounted(()=>{dB(aE==null?void 0:aE[s==null?void 0:s.id])&&(s!=null&&s.id)&&(aE[s==null?void 0:s.id]=BH.value,i.value=BH.value,BH.value=BH.value+1)});const _=d.computed(()=>s.isOccupy),N=d.computed(()=>!d.toValue(b));return F6e({id:u.value,editorId:s.editorId,nodes:m,activated:N,color:S,isOccupy:_}),(O,R)=>{var I,W;return s.size==="small"?(d.openBlock(),d.createElementBlock("div",uBe,[d.createElementVNode("div",{style:d.normalizeStyle({"--node-color":S.value}),class:"node-color cursor-pointer"},null,4),d.createElementVNode("div",null,d.toDisplayString(s.label),1),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",{key:0,style:d.normalizeStyle(d.unref(b)?{color:"#409eff"}:{}),onClick:R[0]||(R[0]=(...G)=>d.unref(h)&&d.unref(h)(...G))},R[6]||(R[6]=[d.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer"},null,-1)]),4)),!s.disabled&&((I=m.value)==null?void 0:I.length)>0?(d.openBlock(),d.createElementBlock("div",{key:1,class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})):d.createCommentVNode("",!0),d.createElementVNode("div",{class:"flex items-center flex-wrap gap-1 cursor-pointer",onClick:R[2]||(R[2]=()=>{s!=null&&s.disabled||d.unref(h)()})},[((W=m.value)==null?void 0:W.length)>0?(d.openBlock(),d.createBlock(ile,{key:0,modelValue:m.value,"onUpdate:modelValue":R[1]||(R[1]=G=>m.value=G),editorId:o.editorId},null,8,["modelValue","editorId"])):(d.openBlock(),d.createElementBlock("div",dBe,"未设置"))])])):(d.openBlock(),d.createElementBlock("div",fBe,[d.createElementVNode("div",mBe,[d.createElementVNode("div",pBe,[d.createElementVNode("div",{style:d.normalizeStyle({"--node-color":S.value}),class:"node-color cursor-pointer"},null,4),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",{key:0,style:d.normalizeStyle(d.unref(b)?{color:"#409eff"}:{})},[d.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer",onClick:R[3]||(R[3]=(...G)=>d.unref(h)&&d.unref(h)(...G))})],4)),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",gBe,[d.createElementVNode("div",{class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})]))]),d.createElementVNode("div",hBe,[R[9]||(R[9]=d.createElementVNode("div",{class:"color-[#999]"},"Ctrl+左键多选",-1)),d.createElementVNode("div",null,[d.createVNode(d.unref(On.ElTooltip),{placement:"right",effect:"dark"},{content:d.withCtx(()=>R[7]||(R[7]=[d.createElementVNode("strong",null,"选择位置",-1),d.createTextVNode(" :点击输入框(选中状态为蓝色),再点击左侧表格可选择填写位置范围。 "),d.createElementVNode("br",null,null,-1),d.createElementVNode("strong",null,"编辑位置",-1),d.createTextVNode(" :使用橡皮擦工具清除后重新选择。 "),d.createElementVNode("br",null,null,-1)])),default:d.withCtx(()=>[R[8]||(R[8]=d.createElementVNode("div",{class:"flex flex-center"},[d.createElementVNode("div",{class:"i-bi:info-circle-fill mr-2"}),d.createTextVNode(" 使用帮助 ")],-1))]),_:1})])])]),d.createElementVNode("div",{class:d.normalizeClass(["min-h-[42px] px-2 py-1",{"shadow-[0_0_0_2px_#409eff]":d.unref(b)}]),onClick:R[5]||(R[5]=()=>{s!=null&&s.disabled||d.unref(h)()})},[d.createVNode(ile,{modelValue:m.value,"onUpdate:modelValue":R[4]||(R[4]=G=>m.value=G),editorId:o.editorId},null,8,["modelValue","editorId"])],2)]))}}}),Lfe=Ja(vBe,[["__scopeId","data-v-9af34714"]]);function bBe(o){if(!o.startsWith("="))return[];const s=[];let i=1;for(o.startsWith("=")&&s.push({type:"startOperator",value:"="});i<o.length;){const u=o[i];if(/\s/.test(u)){i++;continue}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];if(i<o.length&&o[i]===":"){i++;let h="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)h+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)h+=o[i++];s.push({type:"range",value:`${m}:${h}`});continue}else{s.push({type:"cell",value:m});continue}}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];s.push({type:"cell",value:m});continue}if(/[A-Za-z]/.test(u)){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];if(["AVERAGE","AVEDEV","SUM","IF","COUNT","MAX","MIN","SQRT"].includes(m.toUpperCase())&&o[i]==="("){s.push({type:"function",value:m});continue}i-=m.length}if(/\d/.test(u)){let m="";for(;i<o.length&&(/\d/.test(o[i])||o[i]===".");)m+=o[i++];s.push({type:"number",value:m});continue}if(u==='"'){let m="";for(m+=u,i++;i<o.length&&o[i]!=='"';)m+=o[i++];m+=u,i++,s.push({type:"string",value:m});continue}if(/[A-Za-z]/.test(u)&&/\d/.test(o[i+1])){let m="";for(;i<o.length&&/[A-Za-z]/.test(o[i]);)m+=o[i++];for(;i<o.length&&/\d/.test(o[i]);)m+=o[i++];s.push({type:"cell",value:m});continue}if(u===":"){s.push({type:"operator",value:":"}),i++;continue}if(/[+\-*/=><]/.test(u)){s.push({type:"operator",value:u}),i++;continue}if(/[()]/.test(u)){s.push({type:"paren",value:u}),i++;continue}if(u===","){s.push({type:"separator",value:","}),i++;continue}i++}return s}function yBe(o,s){const i=[];let u=0;for(;u<o.length;){let m=!1;for(const h of s){const b=h.value;if(o.startsWith(b,u)){i.push({type:h.type,value:b,...h.cellValue?{cellValue:h.cellValue}:{}}),u+=b.length,m=!0;break}}m||(i.push({type:"plain",value:o[u]}),u++)}return i}function wBe(o){const s=BU(o.editorId),i=(b,C)=>{const S=[],_=Math.min(b.colIndex,C.colIndex),N=Math.max(b.colIndex,C.colIndex),O=Math.min(b.rowIndex,C.rowIndex),R=Math.max(b.rowIndex,C.rowIndex);for(let I=O;I<=R;I++)for(let W=_;W<=N;W++)S.push({colIndex:W,rowIndex:I});return S},u=b=>{var N;const C=b.includes(":");let S=[];if(C){const[O,R]=b.split(":").map(I=>h(I));S=i(O,R)}else S=[h(b)];return m(S,d.toValue((N=d.toValue(s))==null?void 0:N.nodes))},m=(b,C)=>C==null?void 0:C.filter(S=>{const _=S.nodePath.split(" > ");let N=1,O=1;return _.forEach(R=>{if(R.startsWith("tr")){const I=R.match(/tr(?::nth-of-type\((\d+)\))?/);I&&I[1]&&(N=parseInt(I[1]))}else if(R.startsWith("td")){const I=R.match(/td(?::nth-of-type\((\d+)\))?/);I&&(O=I[1]?parseInt(I[1]):1)}}),b.some(R=>N===R.rowIndex+1&&O===R.colIndex+1)}),h=b=>{if(!b)return{colIndex:-1,rowIndex:-1};const C=b.match(/^([A-Za-z]+)(\d+)$/);if(!C)return{colIndex:-1,rowIndex:-1};const S=C[1].toUpperCase(),_=parseInt(C[2]);let N=0;for(let O=0;O<S.length;O++)N=N*26+(S.charCodeAt(O)-64);return{colIndex:N-1,rowIndex:_}};return{getCellValue:u}}const lle=["#0288D1","#D32F2F","#F57C00","#388E3C","#303F9F","#7B1FA2","#C2185B","#880E4F","#689F38","#5D4037"];function CBe(o,s,i){const u=d.ref(null),m=d.ref(null);function h(){return o.value&&o.value.textContent||""}d.onMounted(()=>{o.value&&(u.value=()=>{const C=h();s.value=C},m.value=()=>{const C=h();s.value=C},o.value.addEventListener("input",u.value),o.value.addEventListener("blur",m.value))}),d.onUnmounted(()=>{o.value&&(u.value&&o.value.removeEventListener("input",u.value),m.value&&o.value.removeEventListener("blur",m.value))});const b=C=>{var S,_,N,O;if(C>=0){const R=window.getSelection();if(R){const I=R.getRangeAt(0),W=((S=I.startContainer)==null?void 0:S.nodeName)==="#text"?I.startContainer:(N=(_=I.startContainer)==null?void 0:_.childNodes)==null?void 0:N[0],G=Math.min(C,((O=W.textContent)==null?void 0:O.length)||0);I.setStart(W,G)}}};return d.watch(()=>[s,o],()=>{var C;o.value&&(na((C=o.value)==null?void 0:C.textContent,d.toValue(s))||(o.value.textContent=d.toValue(s),b(d.toValue(i))))},{deep:!0,immediate:!0}),{getFormulaContent:h}}function Foe(o){const{element:s,onFocus:i,onBlur:u}=o,m=d.ref(!1),h=()=>{m.value=!0,i==null||i()},b=()=>{m.value=!1,u==null||u()};return d.onMounted(()=>{var C,S;d.toValue(s)&&((C=d.toValue(s))==null||C.addEventListener("focus",h),(S=d.toValue(s))==null||S.addEventListener("blur",b))}),d.onUnmounted(()=>{var C,S;d.toValue(s)&&((C=d.toValue(s))==null||C.removeEventListener("focus",h),(S=d.toValue(s))==null||S.removeEventListener("blur",b))}),m}function SBe(o){const{element:s,showStr:i,editorId:u}=o,m=BU(u),h=Foe({element:s}),b=d.computed(()=>{var C;return(C=i==null?void 0:i.value)==null?void 0:C.filter(S=>["range","cell"].includes(S.type))});return d.watch(()=>h,()=>{var S,_,N,O,R,I;const C=W=>{var G;W.preventDefault(),(G=d.toValue(s))==null||G.focus()};d.toValue(h)?((S=d.toValue(m))==null||S.containerRef.addEventListener("click",C),(_=d.toValue(m))==null||_.containerRef.addEventListener("mousedown",C),(N=document.querySelectorAll(".select-function"))==null||N.forEach(W=>{W.addEventListener("click",C),W.addEventListener("mousedown",C)})):((O=d.toValue(m))==null||O.containerRef.removeEventListener("click",C),(R=d.toValue(m))==null||R.containerRef.removeEventListener("mousedown",C),(I=document.querySelectorAll(".select-function"))==null||I.forEach(W=>{W.removeEventListener("click",C),W.removeEventListener("mousedown",C)}))},{deep:!0}),d.watch(()=>[h,b],()=>{var C,S,_,N,O;if((C=d.toValue(m))!=null&&C.containerRef&&((N=(_=(S=d.toValue(m))==null?void 0:S.containerRef)==null?void 0:_.querySelectorAll(".node-formula-cell"))==null||N.forEach(R=>{R.classList.remove("node-formula-cell")}),d.toValue(h))){let R=[];(O=b.value)!=null&&O.length&&(b.value.forEach(I=>{var W;R=[...R,...((W=I==null?void 0:I.cellValue)==null?void 0:W.map(G=>({color:I==null?void 0:I.color,backgroundColor:Mz((I==null?void 0:I.color)||"#000",.1),element:G==null?void 0:G.element})))||[]]}),R.forEach(I=>{var W;I!=null&&I.element&&((W=I==null?void 0:I.element)==null||W.classList.add("node-formula-cell"),I==null||I.element.style.setProperty("--formula-node-color",I==null?void 0:I.color),I==null||I.element.style.setProperty("--formula-node-bg-color",I==null?void 0:I.backgroundColor))}))}},{deep:!0}),h}const xBe=o=>{const{element:s}=o,i=d.ref(-1),u=C=>{const S=C==null?void 0:C.getSelection();try{if(S)return S.getRangeAt(0).startOffset}catch{}return 0},m=()=>{var S;const C=(S=s.value)==null?void 0:S.getRootNode();i.value=u(C)},h=C=>{var O;const S=C.target,_=(O=s.value)==null?void 0:O.getRootNode();i.value=u(_),S.addEventListener("click",m),S.addEventListener("keyup",R=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(R.key)&&m()});const N=()=>{S.removeEventListener("click",m),S.removeEventListener("keyup",m),S.removeEventListener("blur",N),setTimeout(()=>{i.value=-1},300)};S.addEventListener("blur",N)},b=()=>{var C;(C=s.value)==null||C.addEventListener("focus",h,!0)};return d.watch(s,C=>{C&&b()},{immediate:!0}),d.onUnmounted(()=>{var C;(C=s.value)==null||C.removeEventListener("focus",h,!0)}),{startOffset:i}};function EBe(o,s,i,u){if(s<0||i<0||s>=o.length)throw new Error("Invalid start or length");const m=s+i;return o.slice(0,s)+u+o.slice(m)}const _Be=(o,s)=>{var u;let i=0;for(let m=0;m<s;m++){const h=o[m];i+=(u=h==null?void 0:h.value)==null?void 0:u.length}return i},kBe=o=>{const{startOffset:s,showStr:i,value:u,editorId:m,currentItemIndex:h,currentItem:b,element:C}=o,S=BU(m),_=d.ref(-1),N=d.ref(0),O=Foe({element:C}),R=d.ref(!1),I=Ioe(),W=G=>{var Q,q;if(d.toValue(R)&&d.toValue(O)&&!na((Q=d.toValue(b))==null?void 0:Q.cellValue,G)){const Z=S6e(G,((q=d.toValue(S))==null?void 0:q.nodes)||"");let L=Z;Z&&(d.toValue(N)===0&&(L+=","),d.toValue(_)>=0&&(u.value=EBe(d.toValue(u),d.toValue(_),d.toValue(N),L),N.value=Z.length))}};d.watch(()=>h,()=>{var G,Q,q,Z,L,fe;if((G=S.value)==null||G.setSelectedNodes([]),["range","cell"].includes((Q=d.toValue(b))==null?void 0:Q.type))return _.value=_Be(i.value,h.value),N.value=(Z=(q=d.toValue(b))==null?void 0:q.value)==null?void 0:Z.length,R.value=!0,I("selectNodes",{data:(L=d.toValue(b))==null?void 0:L.cellValue,mode:"multiple",callback:({data:Ve})=>{W(Ve)}}),!1;if([",","(","="].includes((fe=d.toValue(b))==null?void 0:fe.value))return _.value=d.toValue(s),R.value=!0,N.value=0,I("selectNodes",{data:[],mode:"multiple",callback:({data:Ve})=>{W(Ve)}}),!1;R.value=!1,_.value=-1},{immediate:!0,deep:!0})},TBe=o=>{const{startOffset:s,showStr:i}=o,u=d.ref(-1);d.watch(()=>s,()=>{var h;if(d.toValue(s)<=0)u.value=-1;else{let b=0;for(let C=0;C<i.value.length;C++){const S=i.value[C];if(b+=(h=S==null?void 0:S.value)==null?void 0:h.length,b>=d.toValue(s)){u.value=C;break}}}},{deep:!0,immediate:!0});const m=d.computed(()=>{var h;return(h=d.toValue(i))==null?void 0:h[d.toValue(u)]});return{currentItemIndex:u,currentItem:m}};function ABe(o,s,i,u){if(s<0||i<0||s>=o.length)throw new Error("Invalid start or length");const m=s+i;return o.slice(0,s)+u+o.slice(m)}const NBe=(o,s)=>{var u;let i=0;for(let m=0;m<s;m++){const h=o[m];i+=(u=h==null?void 0:h.value)==null?void 0:u.length}return i},OBe=o=>{const{startOffset:s,showStr:i,value:u,currentItemIndex:m,currentItem:h,element:b}=o,C=d.ref(-1),S=d.ref(0),_=Foe({element:b}),N=d.ref(!1),O=Ioe(),R=I=>{var W;if(d.toValue(N)&&d.toValue(_)&&!na((W=d.toValue(h))==null?void 0:W.value,I)){const G=I,Q=G;G&&d.toValue(C)>=0&&(u.value=ABe(d.toValue(u),d.toValue(C),d.toValue(S),Q),S.value=G.length)}};d.watch(()=>m,()=>{var I,W,G,Q,q;if(["function"].includes((I=d.toValue(h))==null?void 0:I.type))return C.value=NBe(i.value,m.value),S.value=(G=(W=d.toValue(h))==null?void 0:W.value)==null?void 0:G.length,N.value=!0,O("selectFunction",{data:(Q=d.toValue(h))==null?void 0:Q.value,callback:({data:Z})=>{R(Z)}}),!1;if([",","(","="].includes((q=d.toValue(h))==null?void 0:q.value))return C.value=d.toValue(s),N.value=!0,S.value=0,O("selectFunction",{data:"",callback:({data:Z})=>{R(Z)}}),!1;N.value=!1,C.value=-1},{immediate:!0,deep:!0})},$Be={class:"node-formula"},DBe={class:"node-formula-show"},MBe=d.defineComponent({__name:"index",props:d.mergeModels({id:{type:String,default:""},editorId:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,{getCellValue:i}=wBe({editorId:s==null?void 0:s.editorId}),u=d.useModel(o,"modelValue"),m=d.ref(),{startOffset:h}=xBe({element:m});CBe(m,u,h);const b=d.computed(()=>{const N=bBe(u.value);return N==null?void 0:N.map(R=>R.type==="cell"||R.type==="range"?{cellValue:i(R.value),...R}:R)}),C=d.computed(()=>{const N=yBe(u.value,b.value);let O=-1;return N.map(I=>(I==null?void 0:I.type)==="cell"||(I==null?void 0:I.type)==="range"?(O++,{...I,color:lle[O%lle.length]}):(I==null?void 0:I.type)==="function"?{...I,color:"#0318ff"}:I)});SBe({element:m,showStr:C,editorId:s==null?void 0:s.editorId});const{currentItemIndex:S,currentItem:_}=TBe({element:m,startOffset:h,value:u,showStr:C});return kBe({element:m,startOffset:h,showStr:C,editorId:s==null?void 0:s.editorId,value:u,currentItemIndex:S,currentItem:_}),OBe({element:m,startOffset:h,showStr:C,value:u,currentItemIndex:S,currentItem:_}),(N,O)=>(d.openBlock(),d.createElementBlock("div",$Be,[d.createElementVNode("div",{contenteditable:"true",ref_key:"formulaRef",ref:m,class:"node-formula-input"},null,512),d.createElementVNode("div",DBe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(C.value,(R,I)=>(d.openBlock(),d.createElementBlock("span",{key:I,class:d.normalizeClass(["node-formula-item",`node-formula-item-type-${R==null?void 0:R.type}`,I===d.unref(S)?"node-formula-item-active":""]),style:d.normalizeStyle({"--text-color":(R==null?void 0:R.color)||"#000","--bg-color":d.unref(Mz)((R==null?void 0:R.color)||"#000",.1)})},d.toDisplayString(R.value),7))),128))])]))}}),Vfe=Ja(MBe,[["__scopeId","data-v-f4b96eb4"]]),BBe=[{label:"平均值",value:"AVERAGE"},{label:"均值绝对偏差",value:"AVEDEV"},{label:"求和",value:"SUM"},{label:"条件判断",value:"IF"},{label:"统计数量",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"正平方根",value:"SQRT"}],RBe={class:"select-function"},IBe=["onClick"],PBe={class:"function-item"},FBe={class:"function-item-desc"},LBe=d.defineComponent({__name:"index",props:d.mergeModels({id:{type:String,default:""},functionList:{type:Array,default:()=>[]}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o;let i=null;const u=d.computed(()=>{var b;return((b=s.functionList)==null?void 0:b.length)>0?s.functionList:BBe}),m=d.useModel(o,"modelValue"),h=b=>{m.value=b,i==null||i({data:b})};return Pfe("selectFunction",({data:b,callback:C})=>{i=C,m.value=b}),(b,C)=>(d.openBlock(),d.createElementBlock("div",RBe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(u.value,(S,_)=>(d.openBlock(),d.createElementBlock("div",{key:_},[d.createElementVNode("div",{onClick:()=>{h(S.value)},class:d.normalizeClass(["function-item-wrapper",{active:m.value===S.value}])},[d.createElementVNode("div",PBe,d.toDisplayString(S.value),1),d.createElementVNode("div",FBe,d.toDisplayString(S.label),1)],10,IBe)]))),128))]))}}),Hfe=Ja(LBe,[["__scopeId","data-v-6e079ff0"]]),VBe=["innerHTML"],zfe=d.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=d.useModel(o,"modelValue");return(i,u)=>(d.openBlock(),d.createBlock(RB,null,{default:d.withCtx(()=>[d.createElementVNode("div",{innerHTML:s.value},null,8,VBe)]),_:1}))}});function RU(o){return d.getCurrentScope()?(d.onScopeDispose(o),!0):!1}function B0(o){return typeof o=="function"?o():d.unref(o)}const HBe=typeof window<"u"&&typeof document<"u",zBe=o=>typeof o<"u",UBe=Object.prototype.toString,jBe=o=>UBe.call(o)==="[object Object]",WBe=()=>{};function ZBe(o,s){function i(...u){return new Promise((m,h)=>{Promise.resolve(o(()=>s.apply(this,u),{fn:s,thisArg:this,args:u})).then(m).catch(h)})}return i}const Ufe=o=>o();function GBe(o=Ufe){const s=d.ref(!0);function i(){s.value=!1}function u(){s.value=!0}const m=(...h)=>{s.value&&o(...h)};return{isActive:d.readonly(s),pause:i,resume:u,eventFilter:m}}function cle(o,s=!1,i="Timeout"){return new Promise((u,m)=>{setTimeout(s?()=>m(i):u,o)})}function qBe(o,s,i={}){const{eventFilter:u=Ufe,...m}=i;return d.watch(o,ZBe(u,s),m)}function GA(o,s,i={}){const{eventFilter:u,...m}=i,{eventFilter:h,pause:b,resume:C,isActive:S}=GBe(u);return{stop:qBe(o,s,{...m,eventFilter:h}),pause:b,resume:C,isActive:S}}function YBe(o,s={}){if(!d.isRef(o))return d.toRefs(o);const i=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const u in o.value)i[u]=d.customRef(()=>({get(){return o.value[u]},set(m){var h;if((h=B0(s.replaceRef))!=null?h:!0)if(Array.isArray(o.value)){const C=[...o.value];C[u]=m,o.value=C}else{const C={...o.value,[u]:m};Object.setPrototypeOf(C,Object.getPrototypeOf(o.value)),o.value=C}else o.value[u]=m}}));return i}function xne(o,s=!1){function i(O,{flush:R="sync",deep:I=!1,timeout:W,throwOnTimeout:G}={}){let Q=null;const Z=[new Promise(L=>{Q=d.watch(o,fe=>{O(fe)!==s&&(Q==null||Q(),L(fe))},{flush:R,deep:I,immediate:!0})})];return W!=null&&Z.push(cle(W,G).then(()=>B0(o)).finally(()=>Q==null?void 0:Q())),Promise.race(Z)}function u(O,R){if(!d.isRef(O))return i(fe=>fe===O,R);const{flush:I="sync",deep:W=!1,timeout:G,throwOnTimeout:Q}=R??{};let q=null;const L=[new Promise(fe=>{q=d.watch([o,O],([Ve,Ce])=>{s!==(Ve===Ce)&&(q==null||q(),fe(Ve))},{flush:I,deep:W,immediate:!0})})];return G!=null&&L.push(cle(G,Q).then(()=>B0(o)).finally(()=>(q==null||q(),B0(o)))),Promise.race(L)}function m(O){return i(R=>!!R,O)}function h(O){return u(null,O)}function b(O){return u(void 0,O)}function C(O){return i(Number.isNaN,O)}function S(O,R){return i(I=>{const W=Array.from(I);return W.includes(O)||W.includes(B0(O))},R)}function _(O){return N(1,O)}function N(O=1,R){let I=-1;return i(()=>(I+=1,I>=O),R)}return Array.isArray(B0(o))?{toMatch:i,toContains:S,changed:_,changedTimes:N,get not(){return xne(o,!s)}}:{toMatch:i,toBe:u,toBeTruthy:m,toBeNull:h,toBeNaN:C,toBeUndefined:b,changed:_,changedTimes:N,get not(){return xne(o,!s)}}}function Ene(o){return xne(o)}function KBe(o){var s;const i=B0(o);return(s=i==null?void 0:i.$el)!=null?s:i}const jfe=HBe?window:void 0;function Wfe(...o){let s,i,u,m;if(typeof o[0]=="string"||Array.isArray(o[0])?([i,u,m]=o,s=jfe):[s,i,u,m]=o,!s)return WBe;Array.isArray(i)||(i=[i]),Array.isArray(u)||(u=[u]);const h=[],b=()=>{h.forEach(N=>N()),h.length=0},C=(N,O,R,I)=>(N.addEventListener(O,R,I),()=>N.removeEventListener(O,R,I)),S=d.watch(()=>[KBe(s),B0(m)],([N,O])=>{if(b(),!N)return;const R=jBe(O)?{...O}:O;h.push(...i.flatMap(I=>u.map(W=>C(N,I,W,R))))},{immediate:!0,flush:"post"}),_=()=>{S(),b()};return RU(_),_}function XBe(o){return typeof o=="function"?o:typeof o=="string"?s=>s.key===o:Array.isArray(o)?s=>o.includes(s.key):()=>!0}function ule(...o){let s,i,u={};o.length===3?(s=o[0],i=o[1],u=o[2]):o.length===2?typeof o[1]=="object"?(s=!0,i=o[0],u=o[1]):(s=o[0],i=o[1]):(s=!0,i=o[0]);const{target:m=jfe,eventName:h="keydown",passive:b=!1,dedupe:C=!1}=u,S=XBe(s);return Wfe(m,h,N=>{N.repeat&&B0(C)||S(N)&&i(N)},b)}function JBe(o){return JSON.parse(JSON.stringify(o))}function vte(o,s,i,u={}){var m,h,b;const{clone:C=!1,passive:S=!1,eventName:_,deep:N=!1,defaultValue:O,shouldEmit:R}=u,I=d.getCurrentInstance(),W=i||(I==null?void 0:I.emit)||((m=I==null?void 0:I.$emit)==null?void 0:m.bind(I))||((b=(h=I==null?void 0:I.proxy)==null?void 0:h.$emit)==null?void 0:b.bind(I==null?void 0:I.proxy));let G=_;s||(s="modelValue"),G=G||`update:${s.toString()}`;const Q=L=>C?typeof C=="function"?C(L):JBe(L):L,q=()=>zBe(o[s])?Q(o[s]):O,Z=L=>{R?R(L)&&W(G,L):W(G,L)};if(S){const L=q(),fe=d.ref(L);let Ve=!1;return d.watch(()=>o[s],Ce=>{Ve||(Ve=!0,fe.value=Q(Ce),d.nextTick(()=>Ve=!1))}),d.watch(fe,Ce=>{!Ve&&(Ce!==o[s]||N)&&Z(Ce)},{deep:N}),fe}else return d.computed({get(){return q()},set(L){Z(L)}})}var QBe={value:()=>{}};function IU(){for(var o=0,s=arguments.length,i={},u;o<s;++o){if(!(u=arguments[o]+"")||u in i||/[\s.]/.test(u))throw new Error("illegal type: "+u);i[u]=[]}return new az(i)}function az(o){this._=o}function eRe(o,s){return o.trim().split(/^|\s+/).map(function(i){var u="",m=i.indexOf(".");if(m>=0&&(u=i.slice(m+1),i=i.slice(0,m)),i&&!s.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:u}})}az.prototype=IU.prototype={constructor:az,on:function(o,s){var i=this._,u=eRe(o+"",i),m,h=-1,b=u.length;if(arguments.length<2){for(;++h<b;)if((m=(o=u[h]).type)&&(m=tRe(i[m],o.name)))return m;return}if(s!=null&&typeof s!="function")throw new Error("invalid callback: "+s);for(;++h<b;)if(m=(o=u[h]).type)i[m]=dle(i[m],o.name,s);else if(s==null)for(m in i)i[m]=dle(i[m],o.name,null);return this},copy:function(){var o={},s=this._;for(var i in s)o[i]=s[i].slice();return new az(o)},call:function(o,s){if((m=arguments.length-2)>0)for(var i=new Array(m),u=0,m,h;u<m;++u)i[u]=arguments[u+2];if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(h=this._[o],u=0,m=h.length;u<m;++u)h[u].value.apply(s,i)},apply:function(o,s,i){if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(var u=this._[o],m=0,h=u.length;m<h;++m)u[m].value.apply(s,i)}};function tRe(o,s){for(var i=0,u=o.length,m;i<u;++i)if((m=o[i]).name===s)return m.value}function dle(o,s,i){for(var u=0,m=o.length;u<m;++u)if(o[u].name===s){o[u]=QBe,o=o.slice(0,u).concat(o.slice(u+1));break}return i!=null&&o.push({name:s,value:i}),o}var _ne="http://www.w3.org/1999/xhtml";const fle={svg:"http://www.w3.org/2000/svg",xhtml:_ne,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function PU(o){var s=o+="",i=s.indexOf(":");return i>=0&&(s=o.slice(0,i))!=="xmlns"&&(o=o.slice(i+1)),fle.hasOwnProperty(s)?{space:fle[s],local:o}:o}function nRe(o){return function(){var s=this.ownerDocument,i=this.namespaceURI;return i===_ne&&s.documentElement.namespaceURI===_ne?s.createElement(o):s.createElementNS(i,o)}}function oRe(o){return function(){return this.ownerDocument.createElementNS(o.space,o.local)}}function Zfe(o){var s=PU(o);return(s.local?oRe:nRe)(s)}function sRe(){}function Loe(o){return o==null?sRe:function(){return this.querySelector(o)}}function rRe(o){typeof o!="function"&&(o=Loe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=new Array(b),S,_,N=0;N<b;++N)(S=h[N])&&(_=o.call(S,S.__data__,N,h))&&("__data__"in S&&(_.__data__=S.__data__),C[N]=_);return new Sp(u,this._parents)}function aRe(o){return o==null?[]:Array.isArray(o)?o:Array.from(o)}function iRe(){return[]}function Gfe(o){return o==null?iRe:function(){return this.querySelectorAll(o)}}function lRe(o){return function(){return aRe(o.apply(this,arguments))}}function cRe(o){typeof o=="function"?o=lRe(o):o=Gfe(o);for(var s=this._groups,i=s.length,u=[],m=[],h=0;h<i;++h)for(var b=s[h],C=b.length,S,_=0;_<C;++_)(S=b[_])&&(u.push(o.call(S,S.__data__,_,b)),m.push(S));return new Sp(u,m)}function qfe(o){return function(){return this.matches(o)}}function Yfe(o){return function(s){return s.matches(o)}}var uRe=Array.prototype.find;function dRe(o){return function(){return uRe.call(this.children,o)}}function fRe(){return this.firstElementChild}function mRe(o){return this.select(o==null?fRe:dRe(typeof o=="function"?o:Yfe(o)))}var pRe=Array.prototype.filter;function gRe(){return Array.from(this.children)}function hRe(o){return function(){return pRe.call(this.children,o)}}function vRe(o){return this.selectAll(o==null?gRe:hRe(typeof o=="function"?o:Yfe(o)))}function bRe(o){typeof o!="function"&&(o=qfe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=[],S,_=0;_<b;++_)(S=h[_])&&o.call(S,S.__data__,_,h)&&C.push(S);return new Sp(u,this._parents)}function Kfe(o){return new Array(o.length)}function yRe(){return new Sp(this._enter||this._groups.map(Kfe),this._parents)}function Rz(o,s){this.ownerDocument=o.ownerDocument,this.namespaceURI=o.namespaceURI,this._next=null,this._parent=o,this.__data__=s}Rz.prototype={constructor:Rz,appendChild:function(o){return this._parent.insertBefore(o,this._next)},insertBefore:function(o,s){return this._parent.insertBefore(o,s)},querySelector:function(o){return this._parent.querySelector(o)},querySelectorAll:function(o){return this._parent.querySelectorAll(o)}};function wRe(o){return function(){return o}}function CRe(o,s,i,u,m,h){for(var b=0,C,S=s.length,_=h.length;b<_;++b)(C=s[b])?(C.__data__=h[b],u[b]=C):i[b]=new Rz(o,h[b]);for(;b<S;++b)(C=s[b])&&(m[b]=C)}function SRe(o,s,i,u,m,h,b){var C,S,_=new Map,N=s.length,O=h.length,R=new Array(N),I;for(C=0;C<N;++C)(S=s[C])&&(R[C]=I=b.call(S,S.__data__,C,s)+"",_.has(I)?m[C]=S:_.set(I,S));for(C=0;C<O;++C)I=b.call(o,h[C],C,h)+"",(S=_.get(I))?(u[C]=S,S.__data__=h[C],_.delete(I)):i[C]=new Rz(o,h[C]);for(C=0;C<N;++C)(S=s[C])&&_.get(R[C])===S&&(m[C]=S)}function xRe(o){return o.__data__}function ERe(o,s){if(!arguments.length)return Array.from(this,xRe);var i=s?SRe:CRe,u=this._parents,m=this._groups;typeof o!="function"&&(o=wRe(o));for(var h=m.length,b=new Array(h),C=new Array(h),S=new Array(h),_=0;_<h;++_){var N=u[_],O=m[_],R=O.length,I=_Re(o.call(N,N&&N.__data__,_,u)),W=I.length,G=C[_]=new Array(W),Q=b[_]=new Array(W),q=S[_]=new Array(R);i(N,O,G,Q,q,I,s);for(var Z=0,L=0,fe,Ve;Z<W;++Z)if(fe=G[Z]){for(Z>=L&&(L=Z+1);!(Ve=Q[L])&&++L<W;);fe._next=Ve||null}}return b=new Sp(b,u),b._enter=C,b._exit=S,b}function _Re(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function kRe(){return new Sp(this._exit||this._groups.map(Kfe),this._parents)}function TRe(o,s,i){var u=this.enter(),m=this,h=this.exit();return typeof o=="function"?(u=o(u),u&&(u=u.selection())):u=u.append(o+""),s!=null&&(m=s(m),m&&(m=m.selection())),i==null?h.remove():i(h),u&&m?u.merge(m).order():m}function ARe(o){for(var s=o.selection?o.selection():o,i=this._groups,u=s._groups,m=i.length,h=u.length,b=Math.min(m,h),C=new Array(m),S=0;S<b;++S)for(var _=i[S],N=u[S],O=_.length,R=C[S]=new Array(O),I,W=0;W<O;++W)(I=_[W]||N[W])&&(R[W]=I);for(;S<m;++S)C[S]=i[S];return new Sp(C,this._parents)}function NRe(){for(var o=this._groups,s=-1,i=o.length;++s<i;)for(var u=o[s],m=u.length-1,h=u[m],b;--m>=0;)(b=u[m])&&(h&&b.compareDocumentPosition(h)^4&&h.parentNode.insertBefore(b,h),h=b);return this}function ORe(o){o||(o=$Re);function s(O,R){return O&&R?o(O.__data__,R.__data__):!O-!R}for(var i=this._groups,u=i.length,m=new Array(u),h=0;h<u;++h){for(var b=i[h],C=b.length,S=m[h]=new Array(C),_,N=0;N<C;++N)(_=b[N])&&(S[N]=_);S.sort(s)}return new Sp(m,this._parents).order()}function $Re(o,s){return o<s?-1:o>s?1:o>=s?0:NaN}function DRe(){var o=arguments[0];return arguments[0]=this,o.apply(null,arguments),this}function MRe(){return Array.from(this)}function BRe(){for(var o=this._groups,s=0,i=o.length;s<i;++s)for(var u=o[s],m=0,h=u.length;m<h;++m){var b=u[m];if(b)return b}return null}function RRe(){let o=0;for(const s of this)++o;return o}function IRe(){return!this.node()}function PRe(o){for(var s=this._groups,i=0,u=s.length;i<u;++i)for(var m=s[i],h=0,b=m.length,C;h<b;++h)(C=m[h])&&o.call(C,C.__data__,h,m);return this}function FRe(o){return function(){this.removeAttribute(o)}}function LRe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function VRe(o,s){return function(){this.setAttribute(o,s)}}function HRe(o,s){return function(){this.setAttributeNS(o.space,o.local,s)}}function zRe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttribute(o):this.setAttribute(o,i)}}function URe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttributeNS(o.space,o.local):this.setAttributeNS(o.space,o.local,i)}}function jRe(o,s){var i=PU(o);if(arguments.length<2){var u=this.node();return i.local?u.getAttributeNS(i.space,i.local):u.getAttribute(i)}return this.each((s==null?i.local?LRe:FRe:typeof s=="function"?i.local?URe:zRe:i.local?HRe:VRe)(i,s))}function Xfe(o){return o.ownerDocument&&o.ownerDocument.defaultView||o.document&&o||o.defaultView}function WRe(o){return function(){this.style.removeProperty(o)}}function ZRe(o,s,i){return function(){this.style.setProperty(o,s,i)}}function GRe(o,s,i){return function(){var u=s.apply(this,arguments);u==null?this.style.removeProperty(o):this.style.setProperty(o,u,i)}}function qRe(o,s,i){return arguments.length>1?this.each((s==null?WRe:typeof s=="function"?GRe:ZRe)(o,s,i??"")):g4(this.node(),o)}function g4(o,s){return o.style.getPropertyValue(s)||Xfe(o).getComputedStyle(o,null).getPropertyValue(s)}function YRe(o){return function(){delete this[o]}}function KRe(o,s){return function(){this[o]=s}}function XRe(o,s){return function(){var i=s.apply(this,arguments);i==null?delete this[o]:this[o]=i}}function JRe(o,s){return arguments.length>1?this.each((s==null?YRe:typeof s=="function"?XRe:KRe)(o,s)):this.node()[o]}function Jfe(o){return o.trim().split(/^|\s+/)}function Voe(o){return o.classList||new Qfe(o)}function Qfe(o){this._node=o,this._names=Jfe(o.getAttribute("class")||"")}Qfe.prototype={add:function(o){var s=this._names.indexOf(o);s<0&&(this._names.push(o),this._node.setAttribute("class",this._names.join(" ")))},remove:function(o){var s=this._names.indexOf(o);s>=0&&(this._names.splice(s,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(o){return this._names.indexOf(o)>=0}};function eme(o,s){for(var i=Voe(o),u=-1,m=s.length;++u<m;)i.add(s[u])}function tme(o,s){for(var i=Voe(o),u=-1,m=s.length;++u<m;)i.remove(s[u])}function QRe(o){return function(){eme(this,o)}}function eIe(o){return function(){tme(this,o)}}function tIe(o,s){return function(){(s.apply(this,arguments)?eme:tme)(this,o)}}function nIe(o,s){var i=Jfe(o+"");if(arguments.length<2){for(var u=Voe(this.node()),m=-1,h=i.length;++m<h;)if(!u.contains(i[m]))return!1;return!0}return this.each((typeof s=="function"?tIe:s?QRe:eIe)(i,s))}function oIe(){this.textContent=""}function sIe(o){return function(){this.textContent=o}}function rIe(o){return function(){var s=o.apply(this,arguments);this.textContent=s??""}}function aIe(o){return arguments.length?this.each(o==null?oIe:(typeof o=="function"?rIe:sIe)(o)):this.node().textContent}function iIe(){this.innerHTML=""}function lIe(o){return function(){this.innerHTML=o}}function cIe(o){return function(){var s=o.apply(this,arguments);this.innerHTML=s??""}}function uIe(o){return arguments.length?this.each(o==null?iIe:(typeof o=="function"?cIe:lIe)(o)):this.node().innerHTML}function dIe(){this.nextSibling&&this.parentNode.appendChild(this)}function fIe(){return this.each(dIe)}function mIe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function pIe(){return this.each(mIe)}function gIe(o){var s=typeof o=="function"?o:Zfe(o);return this.select(function(){return this.appendChild(s.apply(this,arguments))})}function hIe(){return null}function vIe(o,s){var i=typeof o=="function"?o:Zfe(o),u=s==null?hIe:typeof s=="function"?s:Loe(s);return this.select(function(){return this.insertBefore(i.apply(this,arguments),u.apply(this,arguments)||null)})}function bIe(){var o=this.parentNode;o&&o.removeChild(this)}function yIe(){return this.each(bIe)}function wIe(){var o=this.cloneNode(!1),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function CIe(){var o=this.cloneNode(!0),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function SIe(o){return this.select(o?CIe:wIe)}function xIe(o){return arguments.length?this.property("__data__",o):this.node().__data__}function EIe(o){return function(s){o.call(this,s,this.__data__)}}function _Ie(o){return o.trim().split(/^|\s+/).map(function(s){var i="",u=s.indexOf(".");return u>=0&&(i=s.slice(u+1),s=s.slice(0,u)),{type:s,name:i}})}function kIe(o){return function(){var s=this.__on;if(s){for(var i=0,u=-1,m=s.length,h;i<m;++i)h=s[i],(!o.type||h.type===o.type)&&h.name===o.name?this.removeEventListener(h.type,h.listener,h.options):s[++u]=h;++u?s.length=u:delete this.__on}}}function TIe(o,s,i){return function(){var u=this.__on,m,h=EIe(s);if(u){for(var b=0,C=u.length;b<C;++b)if((m=u[b]).type===o.type&&m.name===o.name){this.removeEventListener(m.type,m.listener,m.options),this.addEventListener(m.type,m.listener=h,m.options=i),m.value=s;return}}this.addEventListener(o.type,h,i),m={type:o.type,name:o.name,value:s,listener:h,options:i},u?u.push(m):this.__on=[m]}}function AIe(o,s,i){var u=_Ie(o+""),m,h=u.length,b;if(arguments.length<2){var C=this.node().__on;if(C){for(var S=0,_=C.length,N;S<_;++S)for(m=0,N=C[S];m<h;++m)if((b=u[m]).type===N.type&&b.name===N.name)return N.value}return}for(C=s?TIe:kIe,m=0;m<h;++m)this.each(C(u[m],s,i));return this}function nme(o,s,i){var u=Xfe(o),m=u.CustomEvent;typeof m=="function"?m=new m(s,i):(m=u.document.createEvent("Event"),i?(m.initEvent(s,i.bubbles,i.cancelable),m.detail=i.detail):m.initEvent(s,!1,!1)),o.dispatchEvent(m)}function NIe(o,s){return function(){return nme(this,o,s)}}function OIe(o,s){return function(){return nme(this,o,s.apply(this,arguments))}}function $Ie(o,s){return this.each((typeof s=="function"?OIe:NIe)(o,s))}function*DIe(){for(var o=this._groups,s=0,i=o.length;s<i;++s)for(var u=o[s],m=0,h=u.length,b;m<h;++m)(b=u[m])&&(yield b)}var ome=[null];function Sp(o,s){this._groups=o,this._parents=s}function PB(){return new Sp([[document.documentElement]],ome)}function MIe(){return this}Sp.prototype=PB.prototype={constructor:Sp,select:rRe,selectAll:cRe,selectChild:mRe,selectChildren:vRe,filter:bRe,data:ERe,enter:yRe,exit:kRe,join:TRe,merge:ARe,selection:MIe,order:NRe,sort:ORe,call:DRe,nodes:MRe,node:BRe,size:RRe,empty:IRe,each:PRe,attr:jRe,style:qRe,property:JRe,classed:nIe,text:aIe,html:uIe,raise:fIe,lower:pIe,append:gIe,insert:vIe,remove:yIe,clone:SIe,datum:xIe,on:AIe,dispatch:$Ie,[Symbol.iterator]:DIe};function Mh(o){return typeof o=="string"?new Sp([[document.querySelector(o)]],[document.documentElement]):new Sp([[o]],ome)}function BIe(o){let s;for(;s=o.sourceEvent;)o=s;return o}function Ov(o,s){if(o=BIe(o),s===void 0&&(s=o.currentTarget),s){var i=s.ownerSVGElement||s;if(i.createSVGPoint){var u=i.createSVGPoint();return u.x=o.clientX,u.y=o.clientY,u=u.matrixTransform(s.getScreenCTM().inverse()),[u.x,u.y]}if(s.getBoundingClientRect){var m=s.getBoundingClientRect();return[o.clientX-m.left-s.clientLeft,o.clientY-m.top-s.clientTop]}}return[o.pageX,o.pageY]}const RIe={passive:!1},fB={capture:!0,passive:!1};function bte(o){o.stopImmediatePropagation()}function a4(o){o.preventDefault(),o.stopImmediatePropagation()}function sme(o){var s=o.document.documentElement,i=Mh(o).on("dragstart.drag",a4,fB);"onselectstart"in s?i.on("selectstart.drag",a4,fB):(s.__noselect=s.style.MozUserSelect,s.style.MozUserSelect="none")}function rme(o,s){var i=o.document.documentElement,u=Mh(o).on("dragstart.drag",null);s&&(u.on("click.drag",a4,fB),setTimeout(function(){u.on("click.drag",null)},0)),"onselectstart"in i?u.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const RH=o=>()=>o;function kne(o,{sourceEvent:s,subject:i,target:u,identifier:m,active:h,x:b,y:C,dx:S,dy:_,dispatch:N}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:s,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:u,enumerable:!0,configurable:!0},identifier:{value:m,enumerable:!0,configurable:!0},active:{value:h,enumerable:!0,configurable:!0},x:{value:b,enumerable:!0,configurable:!0},y:{value:C,enumerable:!0,configurable:!0},dx:{value:S,enumerable:!0,configurable:!0},dy:{value:_,enumerable:!0,configurable:!0},_:{value:N}})}kne.prototype.on=function(){var o=this._.on.apply(this._,arguments);return o===this._?this:o};function IIe(o){return!o.ctrlKey&&!o.button}function PIe(){return this.parentNode}function FIe(o,s){return s??{x:o.x,y:o.y}}function LIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function VIe(){var o=IIe,s=PIe,i=FIe,u=LIe,m={},h=IU("start","drag","end"),b=0,C,S,_,N,O=0;function R(fe){fe.on("mousedown.drag",I).filter(u).on("touchstart.drag",Q).on("touchmove.drag",q,RIe).on("touchend.drag touchcancel.drag",Z).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function I(fe,Ve){if(!(N||!o.call(this,fe,Ve))){var Ce=L(this,s.call(this,fe,Ve),fe,Ve,"mouse");Ce&&(Mh(fe.view).on("mousemove.drag",W,fB).on("mouseup.drag",G,fB),sme(fe.view),bte(fe),_=!1,C=fe.clientX,S=fe.clientY,Ce("start",fe))}}function W(fe){if(a4(fe),!_){var Ve=fe.clientX-C,Ce=fe.clientY-S;_=Ve*Ve+Ce*Ce>O}m.mouse("drag",fe)}function G(fe){Mh(fe.view).on("mousemove.drag mouseup.drag",null),rme(fe.view,_),a4(fe),m.mouse("end",fe)}function Q(fe,Ve){if(o.call(this,fe,Ve)){var Ce=fe.changedTouches,Y=s.call(this,fe,Ve),Re=Ce.length,it,Je;for(it=0;it<Re;++it)(Je=L(this,Y,fe,Ve,Ce[it].identifier,Ce[it]))&&(bte(fe),Je("start",fe,Ce[it]))}}function q(fe){var Ve=fe.changedTouches,Ce=Ve.length,Y,Re;for(Y=0;Y<Ce;++Y)(Re=m[Ve[Y].identifier])&&(a4(fe),Re("drag",fe,Ve[Y]))}function Z(fe){var Ve=fe.changedTouches,Ce=Ve.length,Y,Re;for(N&&clearTimeout(N),N=setTimeout(function(){N=null},500),Y=0;Y<Ce;++Y)(Re=m[Ve[Y].identifier])&&(bte(fe),Re("end",fe,Ve[Y]))}function L(fe,Ve,Ce,Y,Re,it){var Je=h.copy(),_e=Ov(it||Ce,Ve),ue,It,pe;if((pe=i.call(fe,new kne("beforestart",{sourceEvent:Ce,target:R,identifier:Re,active:b,x:_e[0],y:_e[1],dx:0,dy:0,dispatch:Je}),Y))!=null)return ue=pe.x-_e[0]||0,It=pe.y-_e[1]||0,function be($,ke,le){var qe=_e,Xe;switch($){case"start":m[Re]=be,Xe=b++;break;case"end":delete m[Re],--b;case"drag":_e=Ov(le||ke,Ve),Xe=b;break}Je.call($,fe,new kne($,{sourceEvent:ke,subject:pe,target:R,identifier:Re,active:Xe,x:_e[0]+ue,y:_e[1]+It,dx:_e[0]-qe[0],dy:_e[1]-qe[1],dispatch:Je}),Y)}}return R.filter=function(fe){return arguments.length?(o=typeof fe=="function"?fe:RH(!!fe),R):o},R.container=function(fe){return arguments.length?(s=typeof fe=="function"?fe:RH(fe),R):s},R.subject=function(fe){return arguments.length?(i=typeof fe=="function"?fe:RH(fe),R):i},R.touchable=function(fe){return arguments.length?(u=typeof fe=="function"?fe:RH(!!fe),R):u},R.on=function(){var fe=h.on.apply(h,arguments);return fe===h?R:fe},R.clickDistance=function(fe){return arguments.length?(O=(fe=+fe)*fe,R):Math.sqrt(O)},R}function Hoe(o,s,i){o.prototype=s.prototype=i,i.constructor=o}function ame(o,s){var i=Object.create(o.prototype);for(var u in s)i[u]=s[u];return i}function FB(){}var mB=.7,Iz=1/mB,i4="\\s*([+-]?\\d+)\\s*",pB="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Mv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",HIe=/^#([0-9a-f]{3,8})$/,zIe=new RegExp(`^rgb\\(${i4},${i4},${i4}\\)$`),UIe=new RegExp(`^rgb\\(${Mv},${Mv},${Mv}\\)$`),jIe=new RegExp(`^rgba\\(${i4},${i4},${i4},${pB}\\)$`),WIe=new RegExp(`^rgba\\(${Mv},${Mv},${Mv},${pB}\\)$`),ZIe=new RegExp(`^hsl\\(${pB},${Mv},${Mv}\\)$`),GIe=new RegExp(`^hsla\\(${pB},${Mv},${Mv},${pB}\\)$`),mle={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Hoe(FB,gB,{copy(o){return Object.assign(new this.constructor,this,o)},displayable(){return this.rgb().displayable()},hex:ple,formatHex:ple,formatHex8:qIe,formatHsl:YIe,formatRgb:gle,toString:gle});function ple(){return this.rgb().formatHex()}function qIe(){return this.rgb().formatHex8()}function YIe(){return ime(this).formatHsl()}function gle(){return this.rgb().formatRgb()}function gB(o){var s,i;return o=(o+"").trim().toLowerCase(),(s=HIe.exec(o))?(i=s[1].length,s=parseInt(s[1],16),i===6?hle(s):i===3?new Sm(s>>8&15|s>>4&240,s>>4&15|s&240,(s&15)<<4|s&15,1):i===8?IH(s>>24&255,s>>16&255,s>>8&255,(s&255)/255):i===4?IH(s>>12&15|s>>8&240,s>>8&15|s>>4&240,s>>4&15|s&240,((s&15)<<4|s&15)/255):null):(s=zIe.exec(o))?new Sm(s[1],s[2],s[3],1):(s=UIe.exec(o))?new Sm(s[1]*255/100,s[2]*255/100,s[3]*255/100,1):(s=jIe.exec(o))?IH(s[1],s[2],s[3],s[4]):(s=WIe.exec(o))?IH(s[1]*255/100,s[2]*255/100,s[3]*255/100,s[4]):(s=ZIe.exec(o))?yle(s[1],s[2]/100,s[3]/100,1):(s=GIe.exec(o))?yle(s[1],s[2]/100,s[3]/100,s[4]):mle.hasOwnProperty(o)?hle(mle[o]):o==="transparent"?new Sm(NaN,NaN,NaN,0):null}function hle(o){return new Sm(o>>16&255,o>>8&255,o&255,1)}function IH(o,s,i,u){return u<=0&&(o=s=i=NaN),new Sm(o,s,i,u)}function KIe(o){return o instanceof FB||(o=gB(o)),o?(o=o.rgb(),new Sm(o.r,o.g,o.b,o.opacity)):new Sm}function Tne(o,s,i,u){return arguments.length===1?KIe(o):new Sm(o,s,i,u??1)}function Sm(o,s,i,u){this.r=+o,this.g=+s,this.b=+i,this.opacity=+u}Hoe(Sm,Tne,ame(FB,{brighter(o){return o=o==null?Iz:Math.pow(Iz,o),new Sm(this.r*o,this.g*o,this.b*o,this.opacity)},darker(o){return o=o==null?mB:Math.pow(mB,o),new Sm(this.r*o,this.g*o,this.b*o,this.opacity)},rgb(){return this},clamp(){return new Sm(_E(this.r),_E(this.g),_E(this.b),Pz(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:vle,formatHex:vle,formatHex8:XIe,formatRgb:ble,toString:ble}));function vle(){return`#${bE(this.r)}${bE(this.g)}${bE(this.b)}`}function XIe(){return`#${bE(this.r)}${bE(this.g)}${bE(this.b)}${bE((isNaN(this.opacity)?1:this.opacity)*255)}`}function ble(){const o=Pz(this.opacity);return`${o===1?"rgb(":"rgba("}${_E(this.r)}, ${_E(this.g)}, ${_E(this.b)}${o===1?")":`, ${o})`}`}function Pz(o){return isNaN(o)?1:Math.max(0,Math.min(1,o))}function _E(o){return Math.max(0,Math.min(255,Math.round(o)||0))}function bE(o){return o=_E(o),(o<16?"0":"")+o.toString(16)}function yle(o,s,i,u){return u<=0?o=s=i=NaN:i<=0||i>=1?o=s=NaN:s<=0&&(o=NaN),new Bh(o,s,i,u)}function ime(o){if(o instanceof Bh)return new Bh(o.h,o.s,o.l,o.opacity);if(o instanceof FB||(o=gB(o)),!o)return new Bh;if(o instanceof Bh)return o;o=o.rgb();var s=o.r/255,i=o.g/255,u=o.b/255,m=Math.min(s,i,u),h=Math.max(s,i,u),b=NaN,C=h-m,S=(h+m)/2;return C?(s===h?b=(i-u)/C+(i<u)*6:i===h?b=(u-s)/C+2:b=(s-i)/C+4,C/=S<.5?h+m:2-h-m,b*=60):C=S>0&&S<1?0:b,new Bh(b,C,S,o.opacity)}function JIe(o,s,i,u){return arguments.length===1?ime(o):new Bh(o,s,i,u??1)}function Bh(o,s,i,u){this.h=+o,this.s=+s,this.l=+i,this.opacity=+u}Hoe(Bh,JIe,ame(FB,{brighter(o){return o=o==null?Iz:Math.pow(Iz,o),new Bh(this.h,this.s,this.l*o,this.opacity)},darker(o){return o=o==null?mB:Math.pow(mB,o),new Bh(this.h,this.s,this.l*o,this.opacity)},rgb(){var o=this.h%360+(this.h<0)*360,s=isNaN(o)||isNaN(this.s)?0:this.s,i=this.l,u=i+(i<.5?i:1-i)*s,m=2*i-u;return new Sm(yte(o>=240?o-240:o+120,m,u),yte(o,m,u),yte(o<120?o+240:o-120,m,u),this.opacity)},clamp(){return new Bh(wle(this.h),PH(this.s),PH(this.l),Pz(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const o=Pz(this.opacity);return`${o===1?"hsl(":"hsla("}${wle(this.h)}, ${PH(this.s)*100}%, ${PH(this.l)*100}%${o===1?")":`, ${o})`}`}}));function wle(o){return o=(o||0)%360,o<0?o+360:o}function PH(o){return Math.max(0,Math.min(1,o||0))}function yte(o,s,i){return(o<60?s+(i-s)*o/60:o<180?i:o<240?s+(i-s)*(240-o)/60:s)*255}const lme=o=>()=>o;function QIe(o,s){return function(i){return o+i*s}}function ePe(o,s,i){return o=Math.pow(o,i),s=Math.pow(s,i)-o,i=1/i,function(u){return Math.pow(o+u*s,i)}}function tPe(o){return(o=+o)==1?cme:function(s,i){return i-s?ePe(s,i,o):lme(isNaN(s)?i:s)}}function cme(o,s){var i=s-o;return i?QIe(o,i):lme(isNaN(o)?s:o)}const Cle=function o(s){var i=tPe(s);function u(m,h){var b=i((m=Tne(m)).r,(h=Tne(h)).r),C=i(m.g,h.g),S=i(m.b,h.b),_=cme(m.opacity,h.opacity);return function(N){return m.r=b(N),m.g=C(N),m.b=S(N),m.opacity=_(N),m+""}}return u.gamma=o,u}(1);function r2(o,s){return o=+o,s=+s,function(i){return o*(1-i)+s*i}}var Ane=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wte=new RegExp(Ane.source,"g");function nPe(o){return function(){return o}}function oPe(o){return function(s){return o(s)+""}}function sPe(o,s){var i=Ane.lastIndex=wte.lastIndex=0,u,m,h,b=-1,C=[],S=[];for(o=o+"",s=s+"";(u=Ane.exec(o))&&(m=wte.exec(s));)(h=m.index)>i&&(h=s.slice(i,h),C[b]?C[b]+=h:C[++b]=h),(u=u[0])===(m=m[0])?C[b]?C[b]+=m:C[++b]=m:(C[++b]=null,S.push({i:b,x:r2(u,m)})),i=wte.lastIndex;return i<s.length&&(h=s.slice(i),C[b]?C[b]+=h:C[++b]=h),C.length<2?S[0]?oPe(S[0].x):nPe(s):(s=S.length,function(_){for(var N=0,O;N<s;++N)C[(O=S[N]).i]=O.x(_);return C.join("")})}var Sle=180/Math.PI,Nne={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ume(o,s,i,u,m,h){var b,C,S;return(b=Math.sqrt(o*o+s*s))&&(o/=b,s/=b),(S=o*i+s*u)&&(i-=o*S,u-=s*S),(C=Math.sqrt(i*i+u*u))&&(i/=C,u/=C,S/=C),o*u<s*i&&(o=-o,s=-s,S=-S,b=-b),{translateX:m,translateY:h,rotate:Math.atan2(s,o)*Sle,skewX:Math.atan(S)*Sle,scaleX:b,scaleY:C}}var FH;function rPe(o){const s=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(o+"");return s.isIdentity?Nne:ume(s.a,s.b,s.c,s.d,s.e,s.f)}function aPe(o){return o==null||(FH||(FH=document.createElementNS("http://www.w3.org/2000/svg","g")),FH.setAttribute("transform",o),!(o=FH.transform.baseVal.consolidate()))?Nne:(o=o.matrix,ume(o.a,o.b,o.c,o.d,o.e,o.f))}function dme(o,s,i,u){function m(_){return _.length?_.pop()+" ":""}function h(_,N,O,R,I,W){if(_!==O||N!==R){var G=I.push("translate(",null,s,null,i);W.push({i:G-4,x:r2(_,O)},{i:G-2,x:r2(N,R)})}else(O||R)&&I.push("translate("+O+s+R+i)}function b(_,N,O,R){_!==N?(_-N>180?N+=360:N-_>180&&(_+=360),R.push({i:O.push(m(O)+"rotate(",null,u)-2,x:r2(_,N)})):N&&O.push(m(O)+"rotate("+N+u)}function C(_,N,O,R){_!==N?R.push({i:O.push(m(O)+"skewX(",null,u)-2,x:r2(_,N)}):N&&O.push(m(O)+"skewX("+N+u)}function S(_,N,O,R,I,W){if(_!==O||N!==R){var G=I.push(m(I)+"scale(",null,",",null,")");W.push({i:G-4,x:r2(_,O)},{i:G-2,x:r2(N,R)})}else(O!==1||R!==1)&&I.push(m(I)+"scale("+O+","+R+")")}return function(_,N){var O=[],R=[];return _=o(_),N=o(N),h(_.translateX,_.translateY,N.translateX,N.translateY,O,R),b(_.rotate,N.rotate,O,R),C(_.skewX,N.skewX,O,R),S(_.scaleX,_.scaleY,N.scaleX,N.scaleY,O,R),_=N=null,function(I){for(var W=-1,G=R.length,Q;++W<G;)O[(Q=R[W]).i]=Q.x(I);return O.join("")}}}var iPe=dme(rPe,"px, ","px)","deg)"),lPe=dme(aPe,", ",")",")"),cPe=1e-12;function xle(o){return((o=Math.exp(o))+1/o)/2}function uPe(o){return((o=Math.exp(o))-1/o)/2}function dPe(o){return((o=Math.exp(2*o))-1)/(o+1)}const fPe=function o(s,i,u){function m(h,b){var C=h[0],S=h[1],_=h[2],N=b[0],O=b[1],R=b[2],I=N-C,W=O-S,G=I*I+W*W,Q,q;if(G<cPe)q=Math.log(R/_)/s,Q=function(Y){return[C+Y*I,S+Y*W,_*Math.exp(s*Y*q)]};else{var Z=Math.sqrt(G),L=(R*R-_*_+u*G)/(2*_*i*Z),fe=(R*R-_*_-u*G)/(2*R*i*Z),Ve=Math.log(Math.sqrt(L*L+1)-L),Ce=Math.log(Math.sqrt(fe*fe+1)-fe);q=(Ce-Ve)/s,Q=function(Y){var Re=Y*q,it=xle(Ve),Je=_/(i*Z)*(it*dPe(s*Re+Ve)-uPe(Ve));return[C+Je*I,S+Je*W,_*it/xle(s*Re+Ve)]}}return Q.duration=q*1e3*s/Math.SQRT2,Q}return m.rho=function(h){var b=Math.max(.001,+h),C=b*b,S=C*C;return o(b,C,S)},m}(Math.SQRT2,2,4);var h4=0,L6=0,I6=0,fme=1e3,Fz,V6,Lz=0,$E=0,FU=0,hB=typeof performance=="object"&&performance.now?performance:Date,mme=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(o){setTimeout(o,17)};function zoe(){return $E||(mme(mPe),$E=hB.now()+FU)}function mPe(){$E=0}function Vz(){this._call=this._time=this._next=null}Vz.prototype=pme.prototype={constructor:Vz,restart:function(o,s,i){if(typeof o!="function")throw new TypeError("callback is not a function");i=(i==null?zoe():+i)+(s==null?0:+s),!this._next&&V6!==this&&(V6?V6._next=this:Fz=this,V6=this),this._call=o,this._time=i,One()},stop:function(){this._call&&(this._call=null,this._time=1/0,One())}};function pme(o,s,i){var u=new Vz;return u.restart(o,s,i),u}function pPe(){zoe(),++h4;for(var o=Fz,s;o;)(s=$E-o._time)>=0&&o._call.call(void 0,s),o=o._next;--h4}function Ele(){$E=(Lz=hB.now())+FU,h4=L6=0;try{pPe()}finally{h4=0,hPe(),$E=0}}function gPe(){var o=hB.now(),s=o-Lz;s>fme&&(FU-=s,Lz=o)}function hPe(){for(var o,s=Fz,i,u=1/0;s;)s._call?(u>s._time&&(u=s._time),o=s,s=s._next):(i=s._next,s._next=null,s=o?o._next=i:Fz=i);V6=o,One(u)}function One(o){if(!h4){L6&&(L6=clearTimeout(L6));var s=o-$E;s>24?(o<1/0&&(L6=setTimeout(Ele,o-hB.now()-FU)),I6&&(I6=clearInterval(I6))):(I6||(Lz=hB.now(),I6=setInterval(gPe,fme)),h4=1,mme(Ele))}}function _le(o,s,i){var u=new Vz;return s=s==null?0:+s,u.restart(m=>{u.stop(),o(m+s)},s,i),u}var vPe=IU("start","end","cancel","interrupt"),bPe=[],gme=0,kle=1,$ne=2,iz=3,Tle=4,Dne=5,lz=6;function LU(o,s,i,u,m,h){var b=o.__transition;if(!b)o.__transition={};else if(i in b)return;yPe(o,i,{name:s,index:u,group:m,on:vPe,tween:bPe,time:h.time,delay:h.delay,duration:h.duration,ease:h.ease,timer:null,state:gme})}function Uoe(o,s){var i=Fh(o,s);if(i.state>gme)throw new Error("too late; already scheduled");return i}function Fv(o,s){var i=Fh(o,s);if(i.state>iz)throw new Error("too late; already running");return i}function Fh(o,s){var i=o.__transition;if(!i||!(i=i[s]))throw new Error("transition not found");return i}function yPe(o,s,i){var u=o.__transition,m;u[s]=i,i.timer=pme(h,0,i.time);function h(_){i.state=kle,i.timer.restart(b,i.delay,i.time),i.delay<=_&&b(_-i.delay)}function b(_){var N,O,R,I;if(i.state!==kle)return S();for(N in u)if(I=u[N],I.name===i.name){if(I.state===iz)return _le(b);I.state===Tle?(I.state=lz,I.timer.stop(),I.on.call("interrupt",o,o.__data__,I.index,I.group),delete u[N]):+N<s&&(I.state=lz,I.timer.stop(),I.on.call("cancel",o,o.__data__,I.index,I.group),delete u[N])}if(_le(function(){i.state===iz&&(i.state=Tle,i.timer.restart(C,i.delay,i.time),C(_))}),i.state=$ne,i.on.call("start",o,o.__data__,i.index,i.group),i.state===$ne){for(i.state=iz,m=new Array(R=i.tween.length),N=0,O=-1;N<R;++N)(I=i.tween[N].value.call(o,o.__data__,i.index,i.group))&&(m[++O]=I);m.length=O+1}}function C(_){for(var N=_<i.duration?i.ease.call(null,_/i.duration):(i.timer.restart(S),i.state=Dne,1),O=-1,R=m.length;++O<R;)m[O].call(o,N);i.state===Dne&&(i.on.call("end",o,o.__data__,i.index,i.group),S())}function S(){i.state=lz,i.timer.stop(),delete u[s];for(var _ in u)return;delete o.__transition}}function cz(o,s){var i=o.__transition,u,m,h=!0,b;if(i){s=s==null?null:s+"";for(b in i){if((u=i[b]).name!==s){h=!1;continue}m=u.state>$ne&&u.state<Dne,u.state=lz,u.timer.stop(),u.on.call(m?"interrupt":"cancel",o,o.__data__,u.index,u.group),delete i[b]}h&&delete o.__transition}}function wPe(o){return this.each(function(){cz(this,o)})}function CPe(o,s){var i,u;return function(){var m=Fv(this,o),h=m.tween;if(h!==i){u=i=h;for(var b=0,C=u.length;b<C;++b)if(u[b].name===s){u=u.slice(),u.splice(b,1);break}}m.tween=u}}function SPe(o,s,i){var u,m;if(typeof i!="function")throw new Error;return function(){var h=Fv(this,o),b=h.tween;if(b!==u){m=(u=b).slice();for(var C={name:s,value:i},S=0,_=m.length;S<_;++S)if(m[S].name===s){m[S]=C;break}S===_&&m.push(C)}h.tween=m}}function xPe(o,s){var i=this._id;if(o+="",arguments.length<2){for(var u=Fh(this.node(),i).tween,m=0,h=u.length,b;m<h;++m)if((b=u[m]).name===o)return b.value;return null}return this.each((s==null?CPe:SPe)(i,o,s))}function joe(o,s,i){var u=o._id;return o.each(function(){var m=Fv(this,u);(m.value||(m.value={}))[s]=i.apply(this,arguments)}),function(m){return Fh(m,u).value[s]}}function hme(o,s){var i;return(typeof s=="number"?r2:s instanceof gB?Cle:(i=gB(s))?(s=i,Cle):sPe)(o,s)}function EPe(o){return function(){this.removeAttribute(o)}}function _Pe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function kPe(o,s,i){var u,m=i+"",h;return function(){var b=this.getAttribute(o);return b===m?null:b===u?h:h=s(u=b,i)}}function TPe(o,s,i){var u,m=i+"",h;return function(){var b=this.getAttributeNS(o.space,o.local);return b===m?null:b===u?h:h=s(u=b,i)}}function APe(o,s,i){var u,m,h;return function(){var b,C=i(this),S;return C==null?void this.removeAttribute(o):(b=this.getAttribute(o),S=C+"",b===S?null:b===u&&S===m?h:(m=S,h=s(u=b,C)))}}function NPe(o,s,i){var u,m,h;return function(){var b,C=i(this),S;return C==null?void this.removeAttributeNS(o.space,o.local):(b=this.getAttributeNS(o.space,o.local),S=C+"",b===S?null:b===u&&S===m?h:(m=S,h=s(u=b,C)))}}function OPe(o,s){var i=PU(o),u=i==="transform"?lPe:hme;return this.attrTween(o,typeof s=="function"?(i.local?NPe:APe)(i,u,joe(this,"attr."+o,s)):s==null?(i.local?_Pe:EPe)(i):(i.local?TPe:kPe)(i,u,s))}function $Pe(o,s){return function(i){this.setAttribute(o,s.call(this,i))}}function DPe(o,s){return function(i){this.setAttributeNS(o.space,o.local,s.call(this,i))}}function MPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&DPe(o,h)),i}return m._value=s,m}function BPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&$Pe(o,h)),i}return m._value=s,m}function RPe(o,s){var i="attr."+o;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(s==null)return this.tween(i,null);if(typeof s!="function")throw new Error;var u=PU(o);return this.tween(i,(u.local?MPe:BPe)(u,s))}function IPe(o,s){return function(){Uoe(this,o).delay=+s.apply(this,arguments)}}function PPe(o,s){return s=+s,function(){Uoe(this,o).delay=s}}function FPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?IPe:PPe)(s,o)):Fh(this.node(),s).delay}function LPe(o,s){return function(){Fv(this,o).duration=+s.apply(this,arguments)}}function VPe(o,s){return s=+s,function(){Fv(this,o).duration=s}}function HPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?LPe:VPe)(s,o)):Fh(this.node(),s).duration}function zPe(o,s){if(typeof s!="function")throw new Error;return function(){Fv(this,o).ease=s}}function UPe(o){var s=this._id;return arguments.length?this.each(zPe(s,o)):Fh(this.node(),s).ease}function jPe(o,s){return function(){var i=s.apply(this,arguments);if(typeof i!="function")throw new Error;Fv(this,o).ease=i}}function WPe(o){if(typeof o!="function")throw new Error;return this.each(jPe(this._id,o))}function ZPe(o){typeof o!="function"&&(o=qfe(o));for(var s=this._groups,i=s.length,u=new Array(i),m=0;m<i;++m)for(var h=s[m],b=h.length,C=u[m]=[],S,_=0;_<b;++_)(S=h[_])&&o.call(S,S.__data__,_,h)&&C.push(S);return new V0(u,this._parents,this._name,this._id)}function GPe(o){if(o._id!==this._id)throw new Error;for(var s=this._groups,i=o._groups,u=s.length,m=i.length,h=Math.min(u,m),b=new Array(u),C=0;C<h;++C)for(var S=s[C],_=i[C],N=S.length,O=b[C]=new Array(N),R,I=0;I<N;++I)(R=S[I]||_[I])&&(O[I]=R);for(;C<u;++C)b[C]=s[C];return new V0(b,this._parents,this._name,this._id)}function qPe(o){return(o+"").trim().split(/^|\s+/).every(function(s){var i=s.indexOf(".");return i>=0&&(s=s.slice(0,i)),!s||s==="start"})}function YPe(o,s,i){var u,m,h=qPe(s)?Uoe:Fv;return function(){var b=h(this,o),C=b.on;C!==u&&(m=(u=C).copy()).on(s,i),b.on=m}}function KPe(o,s){var i=this._id;return arguments.length<2?Fh(this.node(),i).on.on(o):this.each(YPe(i,o,s))}function XPe(o){return function(){var s=this.parentNode;for(var i in this.__transition)if(+i!==o)return;s&&s.removeChild(this)}}function JPe(){return this.on("end.remove",XPe(this._id))}function QPe(o){var s=this._name,i=this._id;typeof o!="function"&&(o=Loe(o));for(var u=this._groups,m=u.length,h=new Array(m),b=0;b<m;++b)for(var C=u[b],S=C.length,_=h[b]=new Array(S),N,O,R=0;R<S;++R)(N=C[R])&&(O=o.call(N,N.__data__,R,C))&&("__data__"in N&&(O.__data__=N.__data__),_[R]=O,LU(_[R],s,i,R,_,Fh(N,i)));return new V0(h,this._parents,s,i)}function e8e(o){var s=this._name,i=this._id;typeof o!="function"&&(o=Gfe(o));for(var u=this._groups,m=u.length,h=[],b=[],C=0;C<m;++C)for(var S=u[C],_=S.length,N,O=0;O<_;++O)if(N=S[O]){for(var R=o.call(N,N.__data__,O,S),I,W=Fh(N,i),G=0,Q=R.length;G<Q;++G)(I=R[G])&&LU(I,s,i,G,R,W);h.push(R),b.push(N)}return new V0(h,b,s,i)}var t8e=PB.prototype.constructor;function n8e(){return new t8e(this._groups,this._parents)}function o8e(o,s){var i,u,m;return function(){var h=g4(this,o),b=(this.style.removeProperty(o),g4(this,o));return h===b?null:h===i&&b===u?m:m=s(i=h,u=b)}}function vme(o){return function(){this.style.removeProperty(o)}}function s8e(o,s,i){var u,m=i+"",h;return function(){var b=g4(this,o);return b===m?null:b===u?h:h=s(u=b,i)}}function r8e(o,s,i){var u,m,h;return function(){var b=g4(this,o),C=i(this),S=C+"";return C==null&&(S=C=(this.style.removeProperty(o),g4(this,o))),b===S?null:b===u&&S===m?h:(m=S,h=s(u=b,C))}}function a8e(o,s){var i,u,m,h="style."+s,b="end."+h,C;return function(){var S=Fv(this,o),_=S.on,N=S.value[h]==null?C||(C=vme(s)):void 0;(_!==i||m!==N)&&(u=(i=_).copy()).on(b,m=N),S.on=u}}function i8e(o,s,i){var u=(o+="")=="transform"?iPe:hme;return s==null?this.styleTween(o,o8e(o,u)).on("end.style."+o,vme(o)):typeof s=="function"?this.styleTween(o,r8e(o,u,joe(this,"style."+o,s))).each(a8e(this._id,o)):this.styleTween(o,s8e(o,u,s),i).on("end.style."+o,null)}function l8e(o,s,i){return function(u){this.style.setProperty(o,s.call(this,u),i)}}function c8e(o,s,i){var u,m;function h(){var b=s.apply(this,arguments);return b!==m&&(u=(m=b)&&l8e(o,b,i)),u}return h._value=s,h}function u8e(o,s,i){var u="style."+(o+="");if(arguments.length<2)return(u=this.tween(u))&&u._value;if(s==null)return this.tween(u,null);if(typeof s!="function")throw new Error;return this.tween(u,c8e(o,s,i??""))}function d8e(o){return function(){this.textContent=o}}function f8e(o){return function(){var s=o(this);this.textContent=s??""}}function m8e(o){return this.tween("text",typeof o=="function"?f8e(joe(this,"text",o)):d8e(o==null?"":o+""))}function p8e(o){return function(s){this.textContent=o.call(this,s)}}function g8e(o){var s,i;function u(){var m=o.apply(this,arguments);return m!==i&&(s=(i=m)&&p8e(m)),s}return u._value=o,u}function h8e(o){var s="text";if(arguments.length<1)return(s=this.tween(s))&&s._value;if(o==null)return this.tween(s,null);if(typeof o!="function")throw new Error;return this.tween(s,g8e(o))}function v8e(){for(var o=this._name,s=this._id,i=bme(),u=this._groups,m=u.length,h=0;h<m;++h)for(var b=u[h],C=b.length,S,_=0;_<C;++_)if(S=b[_]){var N=Fh(S,s);LU(S,o,i,_,b,{time:N.time+N.delay+N.duration,delay:0,duration:N.duration,ease:N.ease})}return new V0(u,this._parents,o,i)}function b8e(){var o,s,i=this,u=i._id,m=i.size();return new Promise(function(h,b){var C={value:b},S={value:function(){--m===0&&h()}};i.each(function(){var _=Fv(this,u),N=_.on;N!==o&&(s=(o=N).copy(),s._.cancel.push(C),s._.interrupt.push(C),s._.end.push(S)),_.on=s}),m===0&&h()})}var y8e=0;function V0(o,s,i,u){this._groups=o,this._parents=s,this._name=i,this._id=u}function bme(){return++y8e}var $0=PB.prototype;V0.prototype={constructor:V0,select:QPe,selectAll:e8e,selectChild:$0.selectChild,selectChildren:$0.selectChildren,filter:ZPe,merge:GPe,selection:n8e,transition:v8e,call:$0.call,nodes:$0.nodes,node:$0.node,size:$0.size,empty:$0.empty,each:$0.each,on:KPe,attr:OPe,attrTween:RPe,style:i8e,styleTween:u8e,text:m8e,textTween:h8e,remove:JPe,tween:xPe,delay:FPe,duration:HPe,ease:UPe,easeVarying:WPe,end:b8e,[Symbol.iterator]:$0[Symbol.iterator]};function w8e(o){return((o*=2)<=1?o*o*o:(o-=2)*o*o+2)/2}var C8e={time:null,delay:0,duration:250,ease:w8e};function S8e(o,s){for(var i;!(i=o.__transition)||!(i=i[s]);)if(!(o=o.parentNode))throw new Error(`transition ${s} not found`);return i}function x8e(o){var s,i;o instanceof V0?(s=o._id,o=o._name):(s=bme(),(i=C8e).time=zoe(),o=o==null?null:o+"");for(var u=this._groups,m=u.length,h=0;h<m;++h)for(var b=u[h],C=b.length,S,_=0;_<C;++_)(S=b[_])&&LU(S,o,s,_,b,i||S8e(S,s));return new V0(u,this._parents,o,s)}PB.prototype.interrupt=wPe;PB.prototype.transition=x8e;const LH=o=>()=>o;function E8e(o,{sourceEvent:s,target:i,transform:u,dispatch:m}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:s,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:u,enumerable:!0,configurable:!0},_:{value:m}})}function I0(o,s,i){this.k=o,this.x=s,this.y=i}I0.prototype={constructor:I0,scale:function(o){return o===1?this:new I0(this.k*o,this.x,this.y)},translate:function(o,s){return o===0&s===0?this:new I0(this.k,this.x+this.k*o,this.y+this.k*s)},apply:function(o){return[o[0]*this.k+this.x,o[1]*this.k+this.y]},applyX:function(o){return o*this.k+this.x},applyY:function(o){return o*this.k+this.y},invert:function(o){return[(o[0]-this.x)/this.k,(o[1]-this.y)/this.k]},invertX:function(o){return(o-this.x)/this.k},invertY:function(o){return(o-this.y)/this.k},rescaleX:function(o){return o.copy().domain(o.range().map(this.invertX,this).map(o.invert,o))},rescaleY:function(o){return o.copy().domain(o.range().map(this.invertY,this).map(o.invert,o))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var v4=new I0(1,0,0);I0.prototype;function Cte(o){o.stopImmediatePropagation()}function P6(o){o.preventDefault(),o.stopImmediatePropagation()}function _8e(o){return(!o.ctrlKey||o.type==="wheel")&&!o.button}function k8e(){var o=this;return o instanceof SVGElement?(o=o.ownerSVGElement||o,o.hasAttribute("viewBox")?(o=o.viewBox.baseVal,[[o.x,o.y],[o.x+o.width,o.y+o.height]]):[[0,0],[o.width.baseVal.value,o.height.baseVal.value]]):[[0,0],[o.clientWidth,o.clientHeight]]}function Ale(){return this.__zoom||v4}function T8e(o){return-o.deltaY*(o.deltaMode===1?.05:o.deltaMode?1:.002)*(o.ctrlKey?10:1)}function A8e(){return navigator.maxTouchPoints||"ontouchstart"in this}function N8e(o,s,i){var u=o.invertX(s[0][0])-i[0][0],m=o.invertX(s[1][0])-i[1][0],h=o.invertY(s[0][1])-i[0][1],b=o.invertY(s[1][1])-i[1][1];return o.translate(m>u?(u+m)/2:Math.min(0,u)||Math.max(0,m),b>h?(h+b)/2:Math.min(0,h)||Math.max(0,b))}function O8e(){var o=_8e,s=k8e,i=N8e,u=T8e,m=A8e,h=[0,1/0],b=[[-1/0,-1/0],[1/0,1/0]],C=250,S=fPe,_=IU("start","zoom","end"),N,O,R,I=500,W=150,G=0,Q=10;function q(pe){pe.property("__zoom",Ale).on("wheel.zoom",Re,{passive:!1}).on("mousedown.zoom",it).on("dblclick.zoom",Je).filter(m).on("touchstart.zoom",_e).on("touchmove.zoom",ue).on("touchend.zoom touchcancel.zoom",It).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}q.transform=function(pe,be,$,ke){var le=pe.selection?pe.selection():pe;le.property("__zoom",Ale),pe!==le?Ve(pe,be,$,ke):le.interrupt().each(function(){Ce(this,arguments).event(ke).start().zoom(null,typeof be=="function"?be.apply(this,arguments):be).end()})},q.scaleBy=function(pe,be,$,ke){q.scaleTo(pe,function(){var le=this.__zoom.k,qe=typeof be=="function"?be.apply(this,arguments):be;return le*qe},$,ke)},q.scaleTo=function(pe,be,$,ke){q.transform(pe,function(){var le=s.apply(this,arguments),qe=this.__zoom,Xe=$==null?fe(le):typeof $=="function"?$.apply(this,arguments):$,ce=qe.invert(Xe),Ue=typeof be=="function"?be.apply(this,arguments):be;return i(L(Z(qe,Ue),Xe,ce),le,b)},$,ke)},q.translateBy=function(pe,be,$,ke){q.transform(pe,function(){return i(this.__zoom.translate(typeof be=="function"?be.apply(this,arguments):be,typeof $=="function"?$.apply(this,arguments):$),s.apply(this,arguments),b)},null,ke)},q.translateTo=function(pe,be,$,ke,le){q.transform(pe,function(){var qe=s.apply(this,arguments),Xe=this.__zoom,ce=ke==null?fe(qe):typeof ke=="function"?ke.apply(this,arguments):ke;return i(v4.translate(ce[0],ce[1]).scale(Xe.k).translate(typeof be=="function"?-be.apply(this,arguments):-be,typeof $=="function"?-$.apply(this,arguments):-$),qe,b)},ke,le)};function Z(pe,be){return be=Math.max(h[0],Math.min(h[1],be)),be===pe.k?pe:new I0(be,pe.x,pe.y)}function L(pe,be,$){var ke=be[0]-$[0]*pe.k,le=be[1]-$[1]*pe.k;return ke===pe.x&&le===pe.y?pe:new I0(pe.k,ke,le)}function fe(pe){return[(+pe[0][0]+ +pe[1][0])/2,(+pe[0][1]+ +pe[1][1])/2]}function Ve(pe,be,$,ke){pe.on("start.zoom",function(){Ce(this,arguments).event(ke).start()}).on("interrupt.zoom end.zoom",function(){Ce(this,arguments).event(ke).end()}).tween("zoom",function(){var le=this,qe=arguments,Xe=Ce(le,qe).event(ke),ce=s.apply(le,qe),Ue=$==null?fe(ce):typeof $=="function"?$.apply(le,qe):$,wt=Math.max(ce[1][0]-ce[0][0],ce[1][1]-ce[0][1]),He=le.__zoom,mt=typeof be=="function"?be.apply(le,qe):be,Ie=S(He.invert(Ue).concat(wt/He.k),mt.invert(Ue).concat(wt/mt.k));return function(pt){if(pt===1)pt=mt;else{var oe=Ie(pt),mn=wt/oe[2];pt=new I0(mn,Ue[0]-oe[0]*mn,Ue[1]-oe[1]*mn)}Xe.zoom(null,pt)}})}function Ce(pe,be,$){return!$&&pe.__zooming||new Y(pe,be)}function Y(pe,be){this.that=pe,this.args=be,this.active=0,this.sourceEvent=null,this.extent=s.apply(pe,be),this.taps=0}Y.prototype={event:function(pe){return pe&&(this.sourceEvent=pe),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(pe,be){return this.mouse&&pe!=="mouse"&&(this.mouse[1]=be.invert(this.mouse[0])),this.touch0&&pe!=="touch"&&(this.touch0[1]=be.invert(this.touch0[0])),this.touch1&&pe!=="touch"&&(this.touch1[1]=be.invert(this.touch1[0])),this.that.__zoom=be,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(pe){var be=Mh(this.that).datum();_.call(pe,this.that,new E8e(pe,{sourceEvent:this.sourceEvent,target:q,type:pe,transform:this.that.__zoom,dispatch:_}),be)}};function Re(pe,...be){if(!o.apply(this,arguments))return;var $=Ce(this,be).event(pe),ke=this.__zoom,le=Math.max(h[0],Math.min(h[1],ke.k*Math.pow(2,u.apply(this,arguments)))),qe=Ov(pe);if($.wheel)($.mouse[0][0]!==qe[0]||$.mouse[0][1]!==qe[1])&&($.mouse[1]=ke.invert($.mouse[0]=qe)),clearTimeout($.wheel);else{if(ke.k===le)return;$.mouse=[qe,ke.invert(qe)],cz(this),$.start()}P6(pe),$.wheel=setTimeout(Xe,W),$.zoom("mouse",i(L(Z(ke,le),$.mouse[0],$.mouse[1]),$.extent,b));function Xe(){$.wheel=null,$.end()}}function it(pe,...be){if(R||!o.apply(this,arguments))return;var $=pe.currentTarget,ke=Ce(this,be,!0).event(pe),le=Mh(pe.view).on("mousemove.zoom",Ue,!0).on("mouseup.zoom",wt,!0),qe=Ov(pe,$),Xe=pe.clientX,ce=pe.clientY;sme(pe.view),Cte(pe),ke.mouse=[qe,this.__zoom.invert(qe)],cz(this),ke.start();function Ue(He){if(P6(He),!ke.moved){var mt=He.clientX-Xe,Ie=He.clientY-ce;ke.moved=mt*mt+Ie*Ie>G}ke.event(He).zoom("mouse",i(L(ke.that.__zoom,ke.mouse[0]=Ov(He,$),ke.mouse[1]),ke.extent,b))}function wt(He){le.on("mousemove.zoom mouseup.zoom",null),rme(He.view,ke.moved),P6(He),ke.event(He).end()}}function Je(pe,...be){if(o.apply(this,arguments)){var $=this.__zoom,ke=Ov(pe.changedTouches?pe.changedTouches[0]:pe,this),le=$.invert(ke),qe=$.k*(pe.shiftKey?.5:2),Xe=i(L(Z($,qe),ke,le),s.apply(this,be),b);P6(pe),C>0?Mh(this).transition().duration(C).call(Ve,Xe,ke,pe):Mh(this).call(q.transform,Xe,ke,pe)}}function _e(pe,...be){if(o.apply(this,arguments)){var $=pe.touches,ke=$.length,le=Ce(this,be,pe.changedTouches.length===ke).event(pe),qe,Xe,ce,Ue;for(Cte(pe),Xe=0;Xe<ke;++Xe)ce=$[Xe],Ue=Ov(ce,this),Ue=[Ue,this.__zoom.invert(Ue),ce.identifier],le.touch0?!le.touch1&&le.touch0[2]!==Ue[2]&&(le.touch1=Ue,le.taps=0):(le.touch0=Ue,qe=!0,le.taps=1+!!N);N&&(N=clearTimeout(N)),qe&&(le.taps<2&&(O=Ue[0],N=setTimeout(function(){N=null},I)),cz(this),le.start())}}function ue(pe,...be){if(this.__zooming){var $=Ce(this,be).event(pe),ke=pe.changedTouches,le=ke.length,qe,Xe,ce,Ue;for(P6(pe),qe=0;qe<le;++qe)Xe=ke[qe],ce=Ov(Xe,this),$.touch0&&$.touch0[2]===Xe.identifier?$.touch0[0]=ce:$.touch1&&$.touch1[2]===Xe.identifier&&($.touch1[0]=ce);if(Xe=$.that.__zoom,$.touch1){var wt=$.touch0[0],He=$.touch0[1],mt=$.touch1[0],Ie=$.touch1[1],pt=(pt=mt[0]-wt[0])*pt+(pt=mt[1]-wt[1])*pt,oe=(oe=Ie[0]-He[0])*oe+(oe=Ie[1]-He[1])*oe;Xe=Z(Xe,Math.sqrt(pt/oe)),ce=[(wt[0]+mt[0])/2,(wt[1]+mt[1])/2],Ue=[(He[0]+Ie[0])/2,(He[1]+Ie[1])/2]}else if($.touch0)ce=$.touch0[0],Ue=$.touch0[1];else return;$.zoom("touch",i(L(Xe,ce,Ue),$.extent,b))}}function It(pe,...be){if(this.__zooming){var $=Ce(this,be).event(pe),ke=pe.changedTouches,le=ke.length,qe,Xe;for(Cte(pe),R&&clearTimeout(R),R=setTimeout(function(){R=null},I),qe=0;qe<le;++qe)Xe=ke[qe],$.touch0&&$.touch0[2]===Xe.identifier?delete $.touch0:$.touch1&&$.touch1[2]===Xe.identifier&&delete $.touch1;if($.touch1&&!$.touch0&&($.touch0=$.touch1,delete $.touch1),$.touch0)$.touch0[1]=this.__zoom.invert($.touch0[0]);else if($.end(),$.taps===2&&(Xe=Ov(Xe,this),Math.hypot(O[0]-Xe[0],O[1]-Xe[1])<Q)){var ce=Mh(this).on("dblclick.zoom");ce&&ce.apply(this,arguments)}}}return q.wheelDelta=function(pe){return arguments.length?(u=typeof pe=="function"?pe:LH(+pe),q):u},q.filter=function(pe){return arguments.length?(o=typeof pe=="function"?pe:LH(!!pe),q):o},q.touchable=function(pe){return arguments.length?(m=typeof pe=="function"?pe:LH(!!pe),q):m},q.extent=function(pe){return arguments.length?(s=typeof pe=="function"?pe:LH([[+pe[0][0],+pe[0][1]],[+pe[1][0],+pe[1][1]]]),q):s},q.scaleExtent=function(pe){return arguments.length?(h[0]=+pe[0],h[1]=+pe[1],q):[h[0],h[1]]},q.translateExtent=function(pe){return arguments.length?(b[0][0]=+pe[0][0],b[1][0]=+pe[1][0],b[0][1]=+pe[0][1],b[1][1]=+pe[1][1],q):[[b[0][0],b[0][1]],[b[1][0],b[1][1]]]},q.constrain=function(pe){return arguments.length?(i=pe,q):i},q.duration=function(pe){return arguments.length?(C=+pe,q):C},q.interpolate=function(pe){return arguments.length?(S=pe,q):S},q.on=function(){var pe=_.on.apply(_,arguments);return pe===_?q:pe},q.clickDistance=function(pe){return arguments.length?(G=(pe=+pe)*pe,q):Math.sqrt(G)},q.tapDistance=function(pe){return arguments.length?(Q=+pe,q):Q},q}var is=(o=>(o.Left="left",o.Top="top",o.Right="right",o.Bottom="bottom",o))(is||{}),Woe=(o=>(o.Partial="partial",o.Full="full",o))(Woe||{}),mE=(o=>(o.Bezier="default",o.SimpleBezier="simple-bezier",o.Straight="straight",o.Step="step",o.SmoothStep="smoothstep",o))(mE||{}),b2=(o=>(o.Strict="strict",o.Loose="loose",o))(b2||{}),Hz=(o=>(o.Arrow="arrow",o.ArrowClosed="arrowclosed",o))(Hz||{}),X6=(o=>(o.Free="free",o.Vertical="vertical",o.Horizontal="horizontal",o))(X6||{}),yme=(o=>(o.TopLeft="top-left",o.TopCenter="top-center",o.TopRight="top-right",o.BottomLeft="bottom-left",o.BottomCenter="bottom-center",o.BottomRight="bottom-right",o))(yme||{});const $8e=["INPUT","SELECT","TEXTAREA"];function Mne(o){var s,i;const u=((i=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:i[0])||o.target,m=typeof(u==null?void 0:u.hasAttribute)=="function"?u.hasAttribute("contenteditable"):!1,h=typeof(u==null?void 0:u.closest)=="function"?u.closest(".nokey"):null;return $8e.includes(u==null?void 0:u.nodeName)||m||!!h}function D8e(o){return o.ctrlKey||o.metaKey||o.shiftKey||o.altKey}function Nle(o,s,i,u){const m=s.replace("+",`
127
127
  `).replace(`
128
128
 
129
129
  `,`
package/es/index.mjs CHANGED
@@ -3,7 +3,7 @@ var Ipe = (o, s, i) => s in o ? Rpe(o, s, { enumerable: !0, configurable: !0, wr
3
3
  var fu = (o, s, i) => Ipe(o, typeof s != "symbol" ? s + "" : s, i);
4
4
  import { defineComponent as Ko, reactive as d$, provide as Jm, inject as Qm, ref as dn, watch as Go, toValue as pt, computed as $n, openBlock as ct, createElementBlock as on, createElementVNode as Vt, mergeModels as ca, useModel as fr, Fragment as er, renderList as ta, createVNode as fn, unref as Ne, withCtx as xn, createCommentVNode as Po, toDisplayString as Ss, createTextVNode as Fs, createBlock as Co, withDirectives as KU, mergeProps as cm, resolveComponent as Z4, isRef as op, onUnmounted as ud, watchEffect as Iue, onMounted as Ii, onBeforeUnmount as f$, nextTick as qc, toRefs as nC, getCurrentScope as Zoe, onScopeDispose as LR, renderSlot as Fr, normalizeStyle as wl, onActivated as Ppe, onDeactivated as Bpe, h as qa, withModifiers as oC, Teleport as Goe, normalizeClass as bi, resolveDynamicComponent as J_, createPropsRestProxy as Fpe, toRef as li, effectScope as Pue, getCurrentInstance as sC, useSlots as Lpe, onBeforeMount as Hpe, useAttrs as Vpe, isMemoSame as zpe, customRef as Upe, markRaw as HR, readonly as jpe, createStaticVNode as Wpe, createSlots as Bue, normalizeProps as Zpe, guardReactiveProps as Gpe, withKeys as gI } from "vue";
5
5
  import { ElImage as by, ElIcon as Kg, ElPopover as SE, ElForm as rC, ElFormItem as Ym, ElInput as Jg, ElButton as Fu, ElScrollbar as XU, ElLoadingDirective as qoe, ElSelect as gE, ElOption as hE, ElDialog as JU, ElTabs as Fue, ElTabPane as Lue, useFormItem as qpe, ClickOutside as Ype, ElTooltip as QU, ElTable as Kpe, ElTableColumn as _z, ElCheckbox as yy, ElMessageBox as Xpe, ElRadioGroup as Hue, ElRadio as X2, ElTree as Vue } from "element-plus";
6
- const Jpe = "0.0.120";
6
+ const Jpe = "0.0.121";
7
7
  var Qpe = Object.defineProperty, e1e = (o, s, i) => s in o ? Qpe(o, s, { enumerable: !0, configurable: !0, writable: !0, value: i }) : o[s] = i, Rte = (o, s, i) => e1e(o, typeof s != "symbol" ? s + "" : s, i);
8
8
  function zue(o, s) {
9
9
  return function() {
@@ -69929,9 +69929,9 @@ const OU = {
69929
69929
  return qe.setAttribute("contenteditable", "false"), qe.classList.add("node-item"), ie = qe, xRe(O, ie, f.value), ie && _Re(ie, O), ie;
69930
69930
  }, q = (O) => {
69931
69931
  const Ee = pt(f);
69932
- if (!Ee) return;
69932
+ if (!Ee) return O;
69933
69933
  const ie = Ee.querySelectorAll(".node-item");
69934
- if (!ie || ie.length === 0) return;
69934
+ if (!ie || ie.length === 0) return O;
69935
69935
  const qe = /* @__PURE__ */ new Map();
69936
69936
  return ie.forEach((le) => {
69937
69937
  const Ue = le.getAttribute("id") || "", Ve = {
@@ -69960,8 +69960,7 @@ const OU = {
69960
69960
  (ie = (Ee = He.value) == null ? void 0 : Ee.querySelectorAll(".node-item")) == null || ie.forEach((le) => le.remove()), (qe = He.value) == null || qe.normalize(), Xe == null || Xe.forEach((le) => {
69961
69961
  we(le);
69962
69962
  });
69963
- } else
69964
- w.value = O;
69963
+ }
69965
69964
  }, it = (O, Ee) => {
69966
69965
  const ie = new Set(
69967
69966
  (Ee || []).map((le) => le == null ? void 0 : le.id).filter((le) => typeof le == "string" && le.length > 0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyui/components",
3
- "version": "0.0.120",
3
+ "version": "0.0.121",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.mjs",
6
6
  "types": "./es/index.d.ts",