@zyui/components 0.0.129 → 0.0.130

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.129";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,Z){return!Ln.isUndefined(Z[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,Z,q){let J=I;if(I&&!q&&typeof I=="object"){if(Ln.endsWith(Z,"{}"))Z=u?Z:Z.slice(0,-2),I=JSON.stringify(I);else if(Ln.isArray(I)&&Lhe(I)||(Ln.isFileList(I)||Ln.endsWith(Z,"[]"))&&(J=Ln.toArray(I)))return Z=Gce(Z),J.forEach(function(G,W){!(Ln.isUndefined(G)||G===null)&&s.append(b===!0?Wre([Z],W,h):b===null?Z:Z+"[]",S(G))}),!1}return Gte(I)?!0:(s.append(Wre(q,Z,h),S(I)),!1)}const N=[],O=Object.assign(Vhe,{defaultVisitor:_,convertValue:S,isVisitable:Gte});function R(I,Z){if(!Ln.isUndefined(I)){if(N.indexOf(I)!==-1)throw Error("Circular reference detected in "+Z.join("."));N.push(I),Ln.forEach(I,function(q,J){(!(Ln.isUndefined(q)||q===null)&&m.call(s,q,Ln.isString(J)?J.trim():J,Z,O))===!0&&R(q,Z?Z.concat(J):[J])}),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.130";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,Z){return!Ln.isUndefined(Z[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,Z,q){let J=I;if(I&&!q&&typeof I=="object"){if(Ln.endsWith(Z,"{}"))Z=u?Z:Z.slice(0,-2),I=JSON.stringify(I);else if(Ln.isArray(I)&&Lhe(I)||(Ln.isFileList(I)||Ln.endsWith(Z,"[]"))&&(J=Ln.toArray(I)))return Z=Gce(Z),J.forEach(function(G,W){!(Ln.isUndefined(G)||G===null)&&s.append(b===!0?Wre([Z],W,h):b===null?Z:Z+"[]",S(G))}),!1}return Gte(I)?!0:(s.append(Wre(q,Z,h),S(I)),!1)}const N=[],O=Object.assign(Vhe,{defaultVisitor:_,convertValue:S,isVisitable:Gte});function R(I,Z){if(!Ln.isUndefined(I)){if(N.indexOf(I)!==-1)throw Error("Circular reference detected in "+Z.join("."));N.push(I),Ln.forEach(I,function(q,J){(!(Ln.isUndefined(q)||q===null)&&m.call(s,q,Ln.isString(J)?J.trim():J,Z,O))===!0&&R(q,Z?Z.concat(J):[J])}),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 Z(){R&&R(),I&&I(),u.cancelToken&&u.cancelToken.unsubscribe(_),u.signal&&u.signal.removeEventListener("abort",_)}let q=new XMLHttpRequest;q.open(u.method.toUpperCase(),u.url,!0),q.timeout=u.timeout;function J(){if(!q)return;const W=xm.from("getAllResponseHeaders"in q&&q.getAllResponseHeaders()),L={data:!b||b==="text"||b==="json"?q.responseText:q.response,status:q.status,statusText:q.statusText,headers:W,config:o,request:q};Qce(function(pe){s(pe),Z()},function(pe){i(pe),Z()},L),q=null}"onloadend"in q?q.onloadend=J:q.onreadystatechange=function(){!q||q.readyState!==4||q.status===0&&!(q.responseURL&&q.responseURL.indexOf("file:")===0)||setTimeout(J)},q.onabort=function(){q&&(i(new kr("Request aborted",kr.ECONNABORTED,o,q)),q=null)},q.onerror=function(){i(new kr("Network Error",kr.ERR_NETWORK,o,q)),q=null},q.ontimeout=function(){let W=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded";const L=u.transitional||Kce;u.timeoutErrorMessage&&(W=u.timeoutErrorMessage),i(new kr(W,L.clarifyTimeoutError?kr.ETIMEDOUT:kr.ECONNABORTED,o,q)),q=null},m===void 0&&h.setContentType(null),"setRequestHeader"in q&&Ln.forEach(h.toJSON(),function(W,L){q.setRequestHeader(L,W)}),Ln.isUndefined(u.withCredentials)||(q.withCredentials=!!u.withCredentials),b&&b!=="json"&&(q.responseType=u.responseType),S&&([O,I]=gz(S,!0),q.addEventListener("progress",O)),C&&q.upload&&([N,R]=gz(C),q.upload.addEventListener("progress",N),q.upload.addEventListener("loadend",R)),(u.cancelToken||u.signal)&&(_=W=>{q&&(i(!W||W.type?new C4(null,o,q):W),q.abort(),q=null)},u.cancelToken&&u.cancelToken.subscribe(_),u.signal&&(u.signal.aborted?_():u.signal.addEventListener("abort",_)));const G=a1e(u.url);if(G&&Kd.protocols.indexOf(G)===-1){i(new kr("Unsupported protocol "+G+":",kr.ERR_BAD_REQUEST,o));return}q.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),Z;const q=I&&I.unsubscribe&&(()=>{I.unsubscribe()});let J;try{if(S&&w1e&&i!=="get"&&i!=="head"&&(J=await S1e(N,u))!==0){let Ke=new Request(s,{method:"POST",body:u,duplex:"half"}),Be;if(Ln.isFormData(u)&&(Be=Ke.headers.get("content-type"))&&N.setContentType(Be),Ke.body){const[Y,ke]=Yre(J,gz(Kre(S)));u=Jre(Ke.body,Qre,Y,ke)}}Ln.isString(O)||(O=O?"include":"omit");const G="credentials"in Request.prototype;Z=new Request(s,{...R,signal:I,method:i.toUpperCase(),headers:N.normalize().toJSON(),body:u,duplex:"half",credentials:G?O:void 0});let W=await fetch(Z);const L=Yte&&(_==="stream"||_==="response");if(Yte&&(C||L&&q)){const Ke={};["status","statusText","headers"].forEach(et=>{Ke[et]=W[et]});const Be=Ln.toFiniteNumber(W.headers.get("content-length")),[Y,ke]=C&&Yre(Be,gz(Kre(C),!0))||[];W=new Response(Jre(W.body,Qre,Y,()=>{ke&&ke(),q&&q()}),Ke)}_=_||"text";let pe=await hz[Ln.findKey(hz,_)||"text"](W,o);return!L&&q&&q(),await new Promise((Ke,Be)=>{Qce(Ke,Be,{data:pe,headers:xm.from(W.headers),status:W.status,statusText:W.statusText,config:o,request:Z})})}catch(G){throw q&&q(),G&&G.name==="TypeError"&&/fetch/i.test(G.message)?Object.assign(new kr("Network Error",kr.ERR_NETWORK,o,Z),{cause:G.cause||G}):kr.from(G,G&&G.code,o,Z)}}),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=>qe=>($t=>{const Mt=typeof $t;return $t===null?"null":Mt==="object"&&Array.isArray($t)?"array":Mt==="object"&&(gn=yn=$t,(Ot=String).prototype.isPrototypeOf(gn)||((_t=yn.constructor)===null||_t===void 0?void 0:_t.name)===Ot.name)?"string":Mt;var gn,yn,Ot,_t})(qe)===$e,s=$e=>qe=>typeof qe===$e,i=o("string"),u=o("array"),m=s("boolean"),h=$e=>$e===void 0,b=$e=>!(qe=>qe==null)($e),C=s("function"),S=s("number"),_=$e=>()=>$e,N=$e=>$e,O=_(!1),R=_(!0);class I{constructor(qe,$t){this.tag=qe,this.value=$t}static some(qe){return new I(!0,qe)}static none(){return I.singletonNone}fold(qe,$t){return this.tag?$t(this.value):qe()}isSome(){return this.tag}isNone(){return!this.tag}map(qe){return this.tag?I.some(qe(this.value)):I.none()}bind(qe){return this.tag?qe(this.value):I.none()}exists(qe){return this.tag&&qe(this.value)}forall(qe){return!this.tag||qe(this.value)}filter(qe){return!this.tag||qe(this.value)?this:I.none()}getOr(qe){return this.tag?this.value:qe}or(qe){return this.tag?this:qe}getOrThunk(qe){return this.tag?this.value:qe()}orThunk(qe){return this.tag?this:qe()}getOrDie(qe){if(this.tag)return this.value;throw new Error(qe??"Called getOrDie on None")}static from(qe){return b(qe)?I.some(qe):I.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(qe){this.tag&&qe(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}I.singletonNone=new I(!1);const Z=Array.prototype.indexOf,q=Array.prototype.push,J=($e,qe)=>(($t,Mt)=>Z.call($t,Mt))($e,qe)>-1,G=($e,qe)=>{for(let $t=0,Mt=$e.length;$t<Mt;$t++)if(qe($e[$t],$t))return!0;return!1},W=($e,qe)=>{const $t=$e.length,Mt=new Array($t);for(let gn=0;gn<$t;gn++){const yn=$e[gn];Mt[gn]=qe(yn,gn)}return Mt},L=($e,qe)=>{const $t=[];for(let Mt=0,gn=$e.length;Mt<gn;Mt++){const yn=$e[Mt];qe(yn,Mt)&&$t.push(yn)}return $t},pe=($e,qe)=>(($t,Mt,gn)=>{for(let yn=0,Ot=$t.length;yn<Ot;yn++){const _t=$t[yn];if(Mt(_t,yn))return I.some(_t);if(gn(_t,yn))break}return I.none()})($e,qe,O),Ke=($e,qe)=>($t=>{const Mt=[];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);q.apply(Mt,$t[gn])}return Mt})(W($e,qe)),Be=Object.keys,Y=Object.hasOwnProperty,ke=($e,qe)=>{const $t=Be($e);for(let Mt=0,gn=$t.length;Mt<gn;Mt++){const yn=$t[Mt];qe($e[yn],yn)}},et=($e,qe)=>{const $t={};return ke($e,(Mt,gn)=>{const yn=qe(Mt,gn);$t[yn.k]=yn.v}),$t},je=$e=>(qe,$t)=>{$e[$t]=qe},Ce=$e=>((qe,$t)=>{const Mt=[];return ke(qe,(gn,yn)=>{Mt.push($t(gn,yn))}),Mt})($e,N),ce=($e,qe)=>Dt($e,qe)?I.from($e[qe]):I.none(),Dt=($e,qe)=>Y.call($e,qe),me=$e=>{let qe=$e;return{get:()=>qe,set:$t=>{qe=$t}}},be=($e,qe,$t=0,Mt)=>{const gn=$e.indexOf(qe,$t);return gn!==-1&&(!!h(Mt)||gn+qe.length<=Mt)},$=$e=>parseInt($e,10),_e=($e,qe)=>{const $t=$e-qe;return $t===0?0:$t>0?1:-1},le=($e,qe,$t)=>({major:$e,minor:qe,patch:$t}),He=$e=>{const qe=/([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec($e);return qe?le($(qe[1]),$(qe[2]),$(qe[3])):le(0,0,0)},Ge=()=>fe(0,0),fe=($e,qe)=>({major:$e,minor:qe}),Ue={nu:fe,detect:($e,qe)=>{const $t=String(qe).toLowerCase();return $e.length===0?Ge():((Mt,gn)=>{const yn=((_t,Xe)=>{for(let tt=0;tt<_t.length;tt++){const jt=_t[tt];if(jt.test(Xe))return jt}})(Mt,gn);if(!yn)return{major:0,minor:0};const Ot=_t=>Number(gn.replace(yn,"$"+_t));return fe(Ot(1),Ot(2))})($e,$t)},unknown:Ge},yt=($e,qe)=>{const $t=String(qe).toLowerCase();return pe($e,Mt=>Mt.search($t))},Ve=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,pt=$e=>qe=>be(qe,$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]+).*/,Ve],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:[Ve,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:pt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:pt("firefox")},{name:"Safari",versionRegexes:[Ve,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:$e=>(be($e,"safari")||be($e,"mobile/"))&&be($e,"applewebkit")}],mt=[{name:"Windows",search:pt("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:pt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:pt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:pt("linux"),versionRegexes:[]},{name:"Solaris",search:pt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:pt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:pt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],oe={browsers:_(Ie),oses:_(mt)},mn=$e=>{const qe=$e.current,$t=$e.version,Mt=gn=>()=>qe===gn;return{current:qe,version:$t,isEdge:Mt("Edge"),isChromium:Mt("Chromium"),isIE:Mt("IE"),isOpera:Mt("Opera"),isFirefox:Mt("Firefox"),isSafari:Mt("Safari")}},gt=()=>mn({current:void 0,version:Ue.unknown()}),St=mn,Wt=$e=>{const qe=$e.current,$t=$e.version,Mt=gn=>()=>qe===gn;return{current:qe,version:$t,isWindows:Mt("Windows"),isiOS:Mt("iOS"),isAndroid:Mt("Android"),isMacOS:Mt("macOS"),isLinux:Mt("Linux"),isSolaris:Mt("Solaris"),isFreeBSD:Mt("FreeBSD"),isChromeOS:Mt("ChromeOS")}},Et=()=>Wt({current:void 0,version:Ue.unknown()}),te=Wt,ie=($e,qe,$t)=>{const Mt=oe.browsers(),gn=oe.oses(),yn=qe.bind(Xe=>((tt,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 pe(tt,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)}))}))(Mt,Xe)).orThunk(()=>((Xe,tt)=>yt(Xe,tt).map(jt=>{const nn=Ue.detect(jt.versionRegexes,tt);return{current:jt.name,version:nn}}))(Mt,$e)).fold(gt,St),Ot=((Xe,tt)=>yt(Xe,tt).map(jt=>{const nn=Ue.detect(jt.versionRegexes,tt);return{current:jt.name,version:nn}}))(gn,$e).fold(Et,te),_t=((Xe,tt,jt,nn)=>{const Dn=Xe.isiOS()&&/ipad/i.test(jt)===!0,jn=Xe.isiOS()&&!Dn,Yn=Xe.isiOS()||Xe.isAndroid(),Wn=Yn||nn("(pointer:coarse)"),go=Dn||!jn&&Yn&&nn("(min-device-width:768px)"),ko=jn||Yn&&!go,qo=tt.isSafari()&&Xe.isiOS()&&/safari/i.test(jt)===!1,Ms=!ko&&!go&&!qo;return{isiPad:_(Dn),isiPhone:_(jn),isTablet:_(go),isPhone:_(ko),isTouch:_(Wn),isAndroid:Xe.isAndroid,isiOS:Xe.isiOS,isWebView:_(qo),isDesktop:_(Ms)}})(Ot,yn,$e,$t);return{browser:yn,os:Ot,deviceType:_t}},de=$e=>window.matchMedia($e).matches;let X=($e=>{let qe,$t=!1;return(...Mt)=>($t||($t=!0,qe=$e.apply(null,Mt)),qe)})(()=>ie(window.navigator.userAgent,I.from(window.navigator.userAgentData),de));const Se=()=>X(),Pe=$e=>{if($e==null)throw new Error("Node cannot be null or undefined");return{dom:$e}},Fe=Pe,vt=($e,qe)=>$e.dom===qe.dom,Qe=($e,qe)=>{const $t=$e.dom;if($t.nodeType!==1)return!1;{const Mt=$t;if(Mt.matches!==void 0)return Mt.matches(qe);if(Mt.msMatchesSelector!==void 0)return Mt.msMatchesSelector(qe);if(Mt.webkitMatchesSelector!==void 0)return Mt.webkitMatchesSelector(qe);if(Mt.mozMatchesSelector!==void 0)return Mt.mozMatchesSelector(qe);throw new Error("Browser lacks native selectors")}},wt=$e=>qe=>($t=>$t.dom.nodeType)(qe)===$e,Ft=wt(1),bn=wt(3),Tt=wt(11),Ht=$e=>Fe($e.dom.host),vn=($e,qe,$t)=>{((Mt,gn,yn)=>{if(!(i(yn)||m(yn)||S(yn)))throw console.error("Invalid call to Attribute.set. Key ",gn,":: Value ",yn,":: Element ",Mt),new Error("Attribute value was not simple");Mt.setAttribute(gn,yn+"")})($e.dom,qe,$t)},kn=($e,qe)=>{const $t=$e.dom.getAttribute(qe);return $t===null?void 0:$t},Eo=($e,qe)=>{$e.dom.removeAttribute(qe)},to=$e=>{const qe=bn($e)?$e.dom.parentNode:$e.dom;if(qe==null||qe.ownerDocument===null)return!1;const $t=qe.ownerDocument;return(yn=>{const Ot=(Xe=>Fe(Xe.dom.getRootNode()))(yn);return Tt(_t=Ot)&&b(_t.dom.host)?I.some(Ot):I.none();var _t})(Fe(qe)).fold(()=>$t.body.contains(qe),(Mt=to,gn=Ht,yn=>Mt(gn(yn))));var Mt,gn},It=($e,qe)=>{const $t=$e.dom,Mt=window.getComputedStyle($t).getPropertyValue(qe);return Mt!==""||to($e)?Mt:dn($t,qe)},dn=($e,qe)=>($t=>$t.style!==void 0&&C($t.style.getPropertyValue))($e)?$e.style.getPropertyValue(qe):"",an=($e,qe)=>{const $t=kn($e,qe);return $t===void 0||$t===""?[]:$t.split(" ")},Bn=($e,qe,$t)=>{let Mt=$e.dom;const gn=C($t)?$t:O;for(;Mt.parentNode;){Mt=Mt.parentNode;const yn=Fe(Mt);if(qe(yn))return I.some(yn);if(gn(yn))break}return I.none()},_o=($e,qe,$t)=>((Mt,gn,yn,Ot,_t)=>Ot(yn)?I.some(yn):C(_t)&&_t(yn)?I.none():gn(yn,Ot,_t))(0,Bn,$e,qe,$t),Do=$e=>$e.dom.classList!==void 0,ms=$e=>an($e,"class"),Co=($e,qe)=>{Do($e)?$e.dom.classList.remove(qe):(($t,Mt)=>{((gn,yn,Ot)=>{const _t=L(an(gn,yn),Xe=>Xe!==Ot);_t.length>0?vn(gn,yn,_t.join(" ")):Eo(gn,yn)})($t,"class",Mt)})($e,qe),($t=>{(Do($t)?$t.dom.classList:ms($t)).length===0&&Eo($t,"class")})($e)},Is=($e,qe)=>{$e.dispatch("FormatPainterToggle",{state:qe})};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 qe,$t;qe=Fe($e.getBody()),$t="tox-cursor-format-painter",Do(qe)?qe.dom.classList.add($t):((Mt,gn)=>{((yn,Ot,_t)=>{const Xe=an(yn,Ot).concat([_t]);vn(yn,Ot,Xe.join(" "))})(Mt,"class",gn)})(qe,$t)},vr=($e,qe)=>{($t=>{Co(Fe($t.getBody()),"tox-cursor-format-painter")})($e),qe.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,qe)=>ce(qe,"selector").exists($t=>{const Mt=$e.getBody(),gn=$e.selection.getStart(),yn=$e.dom.getParents(gn,R,Mt),Ot=$e.selection.getSelectedBlocks();return $e.dom.is([...yn,...Ot],$t)}),Dr=$e=>$e.length>1&&$e.charAt(0)==="%",ps=($e,qe)=>ce($e,qe).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,qe=>`-${qe[0].toLowerCase()}`),Gt=($e,qe,$t)=>{const Mt=$e.formatter,gn=((Xe,tt)=>G(Xe.formatter.get(tt),jt=>((nn,Dn)=>Dt(Dn,"inline")&&!br(nn,Dn))(Xe,jt)))($e,$t.formatName),yn=((Xe,tt,jt)=>G(tt.get(jt),nn=>((Dn,jn)=>Dt(jn,"block")||br(Dn,jn))(Xe,nn)))($e,Mt,$t.formatName),Ot=(_t=$t.formatName,J(["formatpainter_borderstyle","formatpainter_bordercolor","formatpainter_backgroundcolor"],_t));var _t;(qe.table&&Ot||gn||qe.block&&yn&&!Ot)&&Mt.apply($t.formatName,$t.substitutedVariables)},Un=$e=>{const qe=$e.selection,$t=qe.getRng(),Mt=Fe($e.getBody()),gn=(_t=>L(_t.selection.getSelectedBlocks().map(Fe),Ds))($e),yn=$t.collapsed&&gn.length,Ot=gn.length&&!((_t,Xe)=>{const tt=jn=>vt(jn,Xe);return(jt=_o(Fe(_t.getStart()),po,tt),nn=_o(Fe(_t.getEnd()),po,tt),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})(qe,Mt);return gn.length>1||yn||Ot},uo=$e=>$e.options.get("formatpainter_ignored_formats"),Fo=($e,qe)=>{return qe==="class"?(gn=>Do(gn)?(yn=>{const Ot=yn.dom.classList,_t=new Array(Ot.length);for(let Xe=0;Xe<Ot.length;Xe++){const tt=Ot.item(Xe);tt!==null&&(_t[Xe]=tt)}return _t})(gn):ms(gn))($e).filter(gn=>!/^(mce-.*)/.test(gn)).join(" "):($t=$e,Mt=qe,I.from(kn($t,Mt))).getOr("");var $t,Mt},ss=$e=>((qe,$t)=>{const Mt={},gn={};return((yn,Ot,_t,Xe)=>{ke(yn,(tt,jt)=>{(Ot(tt,jt)?_t:Xe)(tt,jt)})})(qe,$t,je(Mt),je(gn)),{t:Mt,f:gn}})($e,qe=>{return($t=qe).length>1&&$t.charAt(0)==="%";var $t}).t,ur=($e,qe)=>($t=>{const Mt=uo($t);return Be($t.formatter.get()).filter(gn=>!J(Mt,gn))})($e).filter($t=>{const Mt=((gn,yn)=>G(gn.formatter.get(yn),Ot=>(_t=>{const Xe=ps(_t,"styles").exists(jt=>G(Ce(jt),Dr)),tt=ps(_t,"attributes").exists(jt=>G(Ce(jt),Dr));return Xe||tt})(Ot)))($e,$t);return $e.formatter.matchNode(qe.dom,$t,{},Mt)}),dr=($e,qe)=>{const $t=W($e.dom.getParents(qe,R),Fe);return Ke(L($t,Ft),Mt=>Ke(ur($e,Mt),gn=>((yn,Ot,_t)=>{return(Xe=yn.get(Ot),(tt=>0<tt.length?I.some(tt[0]):I.none())(Xe)).bind(tt=>((jt,nn)=>{const Dn=ps(jt,"styles").map(Wn=>{return go=nn,ko=ss(Wn),et(ko,(qo,Ms)=>({k:qo.slice(1,qo.length),v:It(go,Nt(Ms))}));var go,ko}),jn=ps(jt,"attributes").map(Wn=>{return go=nn,ko=ss(Wn),et(ko,(qo,Ms)=>({k:qo.slice(1,qo.length),v:Fo(go,Ms)}));var go,ko}),Yn={...Dn.getOr({}),...jn.getOr({})};return Ce(Yn).every(Wn=>Wn!=="")?I.some(Yn):I.none()})(tt,_t)).map(tt=>({kind:Lo.SubstitutionSchema,formatName:Ot,substitutedVariables:tt}));var Xe})($e.formatter,gn,Mt).toArray()))},or=$e=>(qe=>pe(Ce(js),$t=>qe.queryCommandState($t)))($e).map(qe=>({kind:Lo.ListSchema,command:qe})),at=($e,qe)=>$e.getParent(qe,"TABLE")?Hs.Table:Hs.Unspecified,ot=($e,qe,$t)=>{$e.addCommand("mceToggleFormatPainter",()=>{((Mt,gn)=>{gn.get()===pn.Application?vr(Mt,gn):((yn,Ot)=>{const _t=Se(),Xe=me(!1);Tr(yn),Ot.set(pn.Application),Is(yn,!0),yn.execCommand("mceRetrieveFormats");const tt=()=>{yn.execCommand("mcePaintFormats"),vr(yn,Ot)},jt=()=>{Ot.get()===pn.Application&&tt(),Yn()},nn=Wn=>{Ot.get()===pn.Application&&(Wn.type==="touchcancel"&&_t.os.isAndroid()?yn.once("contextmenu",tt):Xe.get()?tt():yn.once("selectionchange",tt)),Yn()},Dn=Wn=>{Wn.keyCode===27&&(vr(yn,Ot),Yn())},jn=Wn=>{Xe.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)}})(Mt,gn)})($e,qe)}),$e.addCommand("mcePaintFormats",()=>{$e.selection.isEditable()&&$e.undoManager.transact(()=>{((Mt,gn)=>{((Ot,_t)=>{Ot.formatter.remove("formatpainter_removeformat"),_t===Hs.Table&&(Xe=>{for(let jt=0,nn=Xe.length;jt<nn;jt++)tt=Xe[jt],Ot.formatter.remove(tt);var tt})(["formatpainter_borderstyle","formatpainter_bordercolor","formatpainter_backgroundcolor"]),Un(Ot)&&Ot.execCommand("RemoveList")})(Mt,gn.context);const yn=(Ot=>{const _t=Ot.selection.getStart(),Xe=Ot.selection.getRng().collapsed,tt=Ot.dom.select("td[data-mce-selected]").length>0,jt=!!Ot.dom.getParent(_t,"TABLE");return{inline:!0,table:Xe&&jt||tt,block:Xe||(nn=Ot.selection,nn.getSelectedBlocks().length>1)||tt};var nn})(Mt);gn.schemas.forEach(Ot=>{switch(Ot.kind){case Lo.ListSchema:((_t,Xe,tt)=>{tt.block&&_t.execCommand(Xe.command)})(Mt,Ot,yn);break;case Lo.SubstitutionSchema:Gt(Mt,yn,Ot)}})})($e,$t.get())})}),$e.addCommand("mceRetrieveFormats",()=>{$t.set((Mt=>{const gn=Mt.dom,yn=Mt.selection.getStart();return{schemas:[...or(Mt).toArray(),...dr(Mt,yn)],context:at(gn,yn)}})($e))})};tinymce.PluginManager.add("formatpainter",$e=>{if(((Mt,gn)=>!!Mt&&((yn,Ot)=>{const _t=_e(yn.major,Ot.major);if(_t!==0)return _t;const Xe=_e(yn.minor,Ot.minor);if(Xe!==0)return Xe;const tt=_e(yn.patch,Ot.patch);return tt!==0?tt:0})((yn=>He((Ot=>[Ot.majorVersion,Ot.minorVersion].join(".").split(".").slice(0,3).join("."))(yn)))(Mt),He(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 qe=me(pn.Retrival),$t=me({schemas:[],context:Hs.Unspecified});(Mt=>{(0,Mt.options.register)("formatpainter_ignored_formats",{processor:"string[]",default:"link,address,removeformat,formatpainter_removeformat".split(",")})})($e),(Mt=>{Mt.on("PreInit",()=>{ke(_s,(gn,yn)=>{Mt.formatter.get(yn)||Mt.formatter.register(yn,gn)})})})($e),ot($e,qe,$t),(Mt=>{Mt.ui.registry.addToggleButton("formatpainter",{active:!1,icon:"format-painter",tooltip:"Format painter",onAction:()=>Mt.execCommand("mceToggleFormatPainter"),onSetup:gn=>{const yn=Ot=>{gn.setActive(Ot.state)};return Mt.on("FormatPainterToggle",yn),()=>Mt.off("FormatPainterToggle",yn)}})})($e),((Mt,gn)=>{Mt.ui.registry.addToggleMenuItem("formatpainter",{active:!1,icon:"format-painter",text:"Format painter",onAction:()=>Mt.execCommand("mceToggleFormatPainter"),onSetup:yn=>{const Ot=_t=>{yn.setActive(_t.state)};return yn.setActive(gn.get()===pn.Application),Mt.on("FormatPainterToggle",Ot),()=>Mt.off("FormatPainterToggle",Ot)}})})($e,qe),(Mt=>{Mt.addShortcut("Meta+alt+C","",()=>{Mt.execCommand("mceRetrieveFormats")}),Mt.addShortcut("Meta+alt+V","",()=>{Mt.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,Z;i.value&&((Z=(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||Z.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,Z,q,J;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`,(Z=m.value)==null||Z.appendChild(O),(q=b==null?void 0:b.cssConfig)!=null&&q.links&&b.cssConfig.links.forEach(G=>{var L;const W=document.createElement("link");W.rel="stylesheet",W.href=G,(L=m.value)==null||L.appendChild(W)}),(J=b==null?void 0:b.cssConfig)!=null&&J.styles&&b.cssConfig.styles.forEach(G=>{var L;const W=document.createElement("style");W.textContent=G,(L=m.value)==null||L.appendChild(W)})}),d.onUnmounted(()=>{document.removeEventListener("click",C)}),i({focus:()=>{h.value=!0},getInnerHTML:()=>{var _;return((_=m.value)==null?void 0:_.innerHTML)||""}}),{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&&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 Z=Afe(O);Z?(R=Z,I=((S=Z.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,Z;const O=(I=h==null?void 0:h.value)==null?void 0:I.some(q=>{var J;return(q==null?void 0:q.id)===((J=s==null?void 0:s.node)==null?void 0:J.id)}),R=(Z=d.toValue(i))==null?void 0:Z.find(q=>{var J;return(q==null?void 0:q.id)===((J=s==null?void 0:s.node)==null?void 0:J.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"),N(),(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,Z,q;(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"),(Z=s.node.element)==null||Z.classList.remove("activated"),(q=s.node.element)==null||q.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,disabledNodes:h}=j0(),b=d.ref(!1),C=d.ref({x:0,y:0}),S=d.ref({x:0,y:0}),_=d.ref({left:0,top:0,width:0,height:0}),N=d.ref(null),O=Y=>{const ke=Y.closest(".node-item-td")||Y.closest(".node-item");if(ke!==null){let et=[];if(ke.classList.contains("node-selected"))return;const je=ke.getAttribute("id");if(je&&m.value){const Ce=m.value.find(ce=>ce.id===je);Ce&&(et=[Ce])}et=L(et),s(et)}},R=Y=>{var Ce;if(Y.button===2&&O(Y==null?void 0:Y.target),Y.button!==0||(b.value=!0,!N.value))return;const ke=(Ce=i==null?void 0:i.value)==null?void 0:Ce.getBoundingClientRect();if(!ke)return;const et=Y.clientX-(ke==null?void 0:ke.left),je=Y.clientY-(ke==null?void 0:ke.top);C.value={x:et,y:je},S.value={x:et,y:je},G(Y),pe(),N.value.style.display="block",window.addEventListener("mousemove",I),window.addEventListener("wheel",Z),window.addEventListener("mouseup",q)},I=dte(Y=>{var ke;if(b.value){const et=(ke=i==null?void 0:i.value)==null?void 0:ke.getBoundingClientRect();if(!et)return;const je=Y.clientX-(et==null?void 0:et.left),Ce=Y.clientY-(et==null?void 0:et.top);S.value={x:je,y:Ce},pe()}},16),Z=dte(Y=>{b.value&&setTimeout(()=>{var Ce;const ke=(Ce=i==null?void 0:i.value)==null?void 0:Ce.getBoundingClientRect();if(!ke)return;const et=Y.clientX-(ke==null?void 0:ke.left),je=Y.clientY-(ke==null?void 0:ke.top);S.value={x:et,y:je},pe()},0)},16),q=Y=>{Y.button===0&&(b.value=!1,N.value&&(pe(),N.value.style.display="none",window.removeEventListener("mousemove",I),window.removeEventListener("wheel",Z),window.removeEventListener("mouseup",q)))},J=A6e(),G=Y=>{var et,je;let ke=[];if(Y.button===0&&(Y!=null&&Y.target)){const Ce=((et=Y==null?void 0:Y.target)==null?void 0:et.closest(".node-item-td"))||((je=Y==null?void 0:Y.target)==null?void 0:je.closest(".node-item"));if(Ce!==null){const ce=Ce.getAttribute("id");if(ce&&m.value){const Dt=m.value.find(me=>me.id===ce);Dt&&(J.value?o.value.some(me=>WA(me)===WA(Dt))?ke=o.value.filter(be=>WA(be)!==WA(Dt)):ke=[...o.value,Dt]:Dt&&(ke=[Dt]))}}ke=L(ke),s(ke)}},W=()=>{var Dt;if(!i.value||!(_.value.width>3||_.value.height>3))return;let Y=[];const ke=(Dt=i==null?void 0:i.value)==null?void 0:Dt.getBoundingClientRect(),et=_.value.left+(ke==null?void 0:ke.left),je=_.value.top+(ke==null?void 0:ke.top),Ce={left:_.value.left+(ke==null?void 0:ke.left),right:et+_.value.width,top:_.value.top+(ke==null?void 0:ke.top),bottom:je+_.value.height};if(i.value.querySelectorAll("*").forEach(me=>{const be=me.getBoundingClientRect();if(!Ce)return;const $={left:be.left,right:be.right,top:be.top,bottom:be.bottom};if($.right>Ce.left&&$.left<Ce.right&&$.bottom>Ce.top&&$.top<Ce.bottom){const _e=me.getAttribute("id");if(_e&&m.value){const le=m.value.find(He=>He.id===_e);le&&(Y=[...Y,le])}}}),Y=L(Y),J.value){const me=new Set(o.value.map($=>WA($))),be=Y.filter($=>!me.has(WA($)));s([...o.value,...be])}else s(Y)},L=Y=>{let ke=[];if(Y.length>0&&(ke=[...Y]),h&&h.value&&h.value.length>0){const et=new Set(h.value.map(je=>je.id).filter(Boolean));ke=ke.filter(je=>je.id?!et.has(je.id):!0)}return ke},pe=dte(()=>{if(!N.value||!i.value)return;const{x:Y,y:ke}=C.value,{x:et,y:je}=S.value,Ce=Math.min(Y,et),ce=Math.min(ke,je),Dt=Math.abs(Y-et),me=Math.abs(ke-je);_.value={left:Ce,top:ce,width:Dt,height:me}},16),Ke=Y=>{if(!N.value)return;const{left:ke,top:et,width:je,height:Ce}=d.toValue(Y);N.value.style.left=`${ke}px`,N.value.style.top=`${et}px`,N.value.style.width=`${je}px`,N.value.style.height=`${Ce}px`},Be=()=>{if(!i.value)return;i.value.addEventListener("mousedown",R);const Y=document.getElementById(`select_area_${u}`);if(Y){N.value=Y;return}const ke=document.createElement("div");ke.id=`select_area_${u}`,ke.style.position="absolute",ke.style.border="1px solid #1677ff",ke.style.backgroundColor="rgba(22, 119, 255, 0.05)",ke.style.pointerEvents="none",ke.style.display="none",i.value.appendChild(ke),N.value=ke};return d.watch(_,(Y,ke)=>{na(Y,ke)||(Ke(Y),b.value&&W())},{deep:!0}),d.watch(()=>i.value,Y=>{d.toValue(Y)&&Be()},{immediate:!0}),d.onUnmounted(()=>{i.value&&i.value.removeEventListener("mousedown",R)}),{isSelecting:b,selectionBox:N}}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 Z=R==null?void 0:R.id;return Z||(Z=m2(),I.id=Z),I!=null&&I.groupKey||(I.groupKey=_),I}),O=[...o.value];N.forEach(R=>{const I=O.findIndex(Z=>Z.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 q,J;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=((q=s.value)==null?void 0:q.getRootNode()).getSelection(),_=(J=s.value)==null?void 0:J.querySelectorAll('[contenteditable="true"]');_==null||_.forEach(G=>{G.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=G=>{G.preventDefault()};b.addEventListener("input",I),b.addEventListener("paste",I),b.addEventListener("drop",I),b.addEventListener("keydown",G=>{var W,L,pe,Ke;if(((W=document.activeElement)==null?void 0:W.shadowRoot)===((L=s.value)==null?void 0:L.getRootNode())&&!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(G.key)){if(G.key==="Backspace"||G.key==="Delete"){const Be=S==null?void 0:S.getRangeAt(0);if(b.blur(),(Be==null?void 0:Be.startOffset)===0){const Y=Be.startContainer;if(Y.nodeType===Node.TEXT_NODE){const ke=Y.previousSibling;if(ke&&ke.nodeType===Node.ELEMENT_NODE&&ke.classList.contains("node-item")){const et=ke.getAttribute("id");et&&o(et),(pe=Y.parentElement)==null||pe.normalize();return}}else if(Y.nodeType===Node.ELEMENT_NODE){const ke=Y.previousSibling;if(ke&&ke.nodeType===Node.ELEMENT_NODE&&ke.classList.contains("node-item")){const et=ke.getAttribute("id");et&&o(et),(Ke=Y.parentElement)==null||Ke.normalize();return}}}}G.preventDefault()}});const Z=()=>{b==null||b.normalize(),R.disconnect(),b.removeEventListener("input",I),b.removeEventListener("paste",I),b.removeEventListener("drop",I),b.removeEventListener("blur",Z),b.setAttribute("contenteditable","false")};b.addEventListener("blur",Z)},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 ke,et;const q=_.getSelection();if(q.rangeCount===0)return null;const J=q.getRangeAt(0),G=J.startContainer;let W=0,L=-1,pe=0,Ke=[];const Be=G.nodeType===Node.TEXT_NODE?G.parentNode:G;s.value=Be;const Y=Array.from(Be.childNodes);if(G.nodeType===Node.TEXT_NODE){W=J.startOffset,L=-1;for(let be=0;be<Y.length;be++)if(Y[be]===G){L=be;break}Ke=Y.slice(0,L);const je=[];let Ce=!1;for(let be=0;be<Ke.length;be++){const $=Ke[be];if((ke=$==null?void 0:$.classList)!=null&&ke.contains("node-item")){Ce=!0;continue}else if($.nodeType===Node.TEXT_NODE){const _e=je==null?void 0:je[je.length-1];Ce&&typeof _e=="string"?je[je.length-1]=_e+($==null?void 0:$.data):je.push($==null?void 0:$.data),Ce=!1}else je.push($),Ce=!1}const ce=Ke==null?void 0:Ke[Ke.length-1],Dt=je==null?void 0:je[je.length-1];pe=je==null?void 0:je.filter(be=>{var $;return!(($=be==null?void 0:be.classList)!=null&&$.contains("node-item"))}).length,(et=ce==null?void 0:ce.classList)!=null&&et.contains("node-item")&&typeof Dt=="string"&&pe--;const me=je==null?void 0:je[je.length-1];typeof me=="string"&&(W+=(me==null?void 0:me.length)||0)}else{const je=Y==null?void 0:Y.filter(Ce=>{var ce;return(ce=Ce==null?void 0:Ce.classList)==null?void 0:ce.contains("node-item")}).length;W=J.startOffset-je}return{currentIndex:Math.max(pe,0),previousElements:Ke,startOffset:Math.max(W,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",Z=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(Z.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",Z="date",q="Invalid Date",J=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,G=/\[([^\]]+)]|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,W={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(me){var be=["th","st","nd","rd"],$=me%100;return"["+me+(be[($-20)%10]||be[$]||be[0])+"]"}},L=function(me,be,$){var _e=String(me);return!_e||_e.length>=be?me:""+Array(be+1-_e.length).join($)+me},pe={s:L,z:function(me){var be=-me.utcOffset(),$=Math.abs(be),_e=Math.floor($/60),le=$%60;return(be<=0?"+":"-")+L(_e,2,"0")+":"+L(le,2,"0")},m:function me(be,$){if(be.date()<$.date())return-me($,be);var _e=12*($.year()-be.year())+($.month()-be.month()),le=be.clone().add(_e,O),He=$-le<0,Ge=be.clone().add(_e+(He?-1:1),O);return+(-(_e+($-le)/(He?le-Ge:Ge-le))||0)},a:function(me){return me<0?Math.ceil(me)||0:Math.floor(me)},p:function(me){return{M:O,y:I,w:N,d:_,D:Z,h:S,m:C,s:b,ms:h,Q:R}[me]||String(me||"").toLowerCase().replace(/s$/,"")},u:function(me){return me===void 0}},Ke="en",Be={};Be[Ke]=W;var Y="$isDayjsObject",ke=function(me){return me instanceof ce||!(!me||!me[Y])},et=function me(be,$,_e){var le;if(!be)return Ke;if(typeof be=="string"){var He=be.toLowerCase();Be[He]&&(le=He),$&&(Be[He]=$,le=He);var Ge=be.split("-");if(!le&&Ge.length>1)return me(Ge[0])}else{var fe=be.name;Be[fe]=be,le=fe}return!_e&&le&&(Ke=le),le||!_e&&Ke},je=function(me,be){if(ke(me))return me.clone();var $=typeof be=="object"?be:{};return $.date=me,$.args=arguments,new ce($)},Ce=pe;Ce.l=et,Ce.i=ke,Ce.w=function(me,be){return je(me,{locale:be.$L,utc:be.$u,x:be.$x,$offset:be.$offset})};var ce=function(){function me($){this.$L=et($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[Y]=!0}var be=me.prototype;return be.parse=function($){this.$d=function(_e){var le=_e.date,He=_e.utc;if(le===null)return new Date(NaN);if(Ce.u(le))return new Date;if(le instanceof Date)return new Date(le);if(typeof le=="string"&&!/Z$/i.test(le)){var Ge=le.match(J);if(Ge){var fe=Ge[2]-1||0,Ue=(Ge[7]||"0").substring(0,3);return He?new Date(Date.UTC(Ge[1],fe,Ge[3]||1,Ge[4]||0,Ge[5]||0,Ge[6]||0,Ue)):new Date(Ge[1],fe,Ge[3]||1,Ge[4]||0,Ge[5]||0,Ge[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 Ce},be.isValid=function(){return this.$d.toString()!==q},be.isSame=function($,_e){var le=je($);return this.startOf(_e)<=le&&le<=this.endOf(_e)},be.isAfter=function($,_e){return je($)<this.startOf(_e)},be.isBefore=function($,_e){return this.endOf(_e)<je($)},be.$g=function($,_e,le){return Ce.u($)?this[_e]:this.set(le,$)},be.unix=function(){return Math.floor(this.valueOf()/1e3)},be.valueOf=function(){return this.$d.getTime()},be.startOf=function($,_e){var le=this,He=!!Ce.u(_e)||_e,Ge=Ce.p($),fe=function(mn,gt){var St=Ce.w(le.$u?Date.UTC(le.$y,gt,mn):new Date(le.$y,gt,mn),le);return He?St:St.endOf(_)},Ue=function(mn,gt){return Ce.w(le.toDate()[mn].apply(le.toDate("s"),(He?[0,0,0,0]:[23,59,59,999]).slice(gt)),le)},yt=this.$W,Ve=this.$M,pt=this.$D,Ie="set"+(this.$u?"UTC":"");switch(Ge){case I:return He?fe(1,0):fe(31,11);case O:return He?fe(1,Ve):fe(0,Ve+1);case N:var mt=this.$locale().weekStart||0,oe=(yt<mt?yt+7:yt)-mt;return fe(He?pt-oe:pt+(6-oe),Ve);case _:case Z: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($,_e){var le,He=Ce.p($),Ge="set"+(this.$u?"UTC":""),fe=(le={},le[_]=Ge+"Date",le[Z]=Ge+"Date",le[O]=Ge+"Month",le[I]=Ge+"FullYear",le[S]=Ge+"Hours",le[C]=Ge+"Minutes",le[b]=Ge+"Seconds",le[h]=Ge+"Milliseconds",le)[He],Ue=He===_?this.$D+(_e-this.$W):_e;if(He===O||He===I){var yt=this.clone().set(Z,1);yt.$d[fe](Ue),yt.init(),this.$d=yt.set(Z,Math.min(this.$D,yt.daysInMonth())).$d}else fe&&this.$d[fe](Ue);return this.init(),this},be.set=function($,_e){return this.clone().$set($,_e)},be.get=function($){return this[Ce.p($)]()},be.add=function($,_e){var le,He=this;$=Number($);var Ge=Ce.p(_e),fe=function(Ve){var pt=je(He);return Ce.w(pt.date(pt.date()+Math.round(Ve*$)),He)};if(Ge===O)return this.set(O,this.$M+$);if(Ge===I)return this.set(I,this.$y+$);if(Ge===_)return fe(1);if(Ge===N)return fe(7);var Ue=(le={},le[C]=u,le[S]=m,le[b]=i,le)[Ge]||1,yt=this.$d.getTime()+$*Ue;return Ce.w(yt,this)},be.subtract=function($,_e){return this.add(-1*$,_e)},be.format=function($){var _e=this,le=this.$locale();if(!this.isValid())return le.invalidDate||q;var He=$||"YYYY-MM-DDTHH:mm:ssZ",Ge=Ce.z(this),fe=this.$H,Ue=this.$m,yt=this.$M,Ve=le.weekdays,pt=le.months,Ie=le.meridiem,mt=function(gt,St,Wt,Et){return gt&&(gt[St]||gt(_e,He))||Wt[St].slice(0,Et)},oe=function(gt){return Ce.s(fe%12||12,gt,"0")},mn=Ie||function(gt,St,Wt){var Et=gt<12?"AM":"PM";return Wt?Et.toLowerCase():Et};return He.replace(G,function(gt,St){return St||function(Wt){switch(Wt){case"YY":return String(_e.$y).slice(-2);case"YYYY":return Ce.s(_e.$y,4,"0");case"M":return yt+1;case"MM":return Ce.s(yt+1,2,"0");case"MMM":return mt(le.monthsShort,yt,pt,3);case"MMMM":return mt(pt,yt);case"D":return _e.$D;case"DD":return Ce.s(_e.$D,2,"0");case"d":return String(_e.$W);case"dd":return mt(le.weekdaysMin,_e.$W,Ve,2);case"ddd":return mt(le.weekdaysShort,_e.$W,Ve,3);case"dddd":return Ve[_e.$W];case"H":return String(fe);case"HH":return Ce.s(fe,2,"0");case"h":return oe(1);case"hh":return oe(2);case"a":return mn(fe,Ue,!0);case"A":return mn(fe,Ue,!1);case"m":return String(Ue);case"mm":return Ce.s(Ue,2,"0");case"s":return String(_e.$s);case"ss":return Ce.s(_e.$s,2,"0");case"SSS":return Ce.s(_e.$ms,3,"0");case"Z":return Ge}return null}(gt)||Ge.replace(":","")})},be.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},be.diff=function($,_e,le){var He,Ge=this,fe=Ce.p(_e),Ue=je($),yt=(Ue.utcOffset()-this.utcOffset())*u,Ve=this-Ue,pt=function(){return Ce.m(Ge,Ue)};switch(fe){case I:He=pt()/12;break;case O:He=pt();break;case R:He=pt()/3;break;case N:He=(Ve-yt)/6048e5;break;case _:He=(Ve-yt)/864e5;break;case S:He=Ve/m;break;case C:He=Ve/u;break;case b:He=Ve/i;break;default:He=Ve}return le?He:Ce.a(He)},be.daysInMonth=function(){return this.endOf(O).$D},be.$locale=function(){return Be[this.$L]},be.locale=function($,_e){if(!$)return this.$L;var le=this.clone(),He=et($,_e,!0);return He&&(le.$L=He),le},be.clone=function(){return Ce.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()},me}(),Dt=ce.prototype;return je.prototype=Dt,[["$ms",h],["$s",b],["$m",C],["$H",S],["$W",_],["$M",O],["$y",I],["$D",Z]].forEach(function(me){Dt[me[1]]=function(be){return this.$g(be,me[0],me[1])}}),je.extend=function(me,be){return me.$i||(me(be,ce,je),me.$i=!0),je},je.locale=et,je.isDayjs=ke,je.unix=function(me){return je(1e3*me)},je.en=Be[Ke],je.Ls=Be,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=C=>{if(!C||typeof C!="string")return[];const _=new DOMParser().parseFromString(C,"text/html");return Array.from(_.querySelectorAll("td")).filter(R=>{var I;return!((I=R.textContent)!=null&&I.trim())})},h=async C=>{var N,O;const S=await((O=(N=s==null?void 0:s.find(R=>{var I;return((I=R.value)==null?void 0:I.toLowerCase())==="text"}))==null?void 0:N.getDefaultProps)==null?void 0:O.call(N))||{},_=C.map(R=>{let I=R==null?void 0:R.id;return I||(I=m2()),{id:I,nodeType:"Text",label:"文本",props:{...S},...R}});return u(_),_},b=()=>{var Z,q;const C=m(d.toValue(o)),S=Bfe().valueOf(),_=d.toValue(i),N=_.filter(J=>wne(J)),O=_.filter(J=>!wne(J)),I=[...(q=(Z=C.map(J=>({nodePath:$U(J),startOffset:0,subNodeSort:0,insertTime:S})))==null?void 0:Z.filter(J=>!!(N==null?void 0:N.find(W=>{var L;return(L=W.nodePath)==null?void 0:L.includes(J.nodePath)}))))==null?void 0:q.map(J=>{const G=N==null?void 0:N.find(W=>W.nodePath===J.nodePath&&!(W!=null&&W.startOffset));return{...J,...G}}),...O];return h(I)};return d.onMounted(()=>{b()}),b}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 Z=(R=N==null?void 0:N.element)==null?void 0:R.getAttribute("id");Z&&_.push(Z)}else{const Z=(I=N==null?void 0:N.element)==null?void 0:I.getAttribute("id");Z&&_.push(Z)}}),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,{expose:s}){const{nodes:i}=j0(),{uiReady:u,renderNodes:m}=ef();Roe(),$6e(i),Dfe(),Boe(),B6e(),O6e(),N6e();const h=M6e();return MU(),s({initNodes:h}),(b,C)=>d.unref(u)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(m),S=>(d.openBlock(),d.createBlock(DU,{key:S==null?void 0:S.id,node:S},{default:d.withCtx(_=>[d.renderSlot(b.$slots,"nodeItem",{node:_==null?void 0:_.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(Z=>d.toValue(Z==null?void 0:Z.activated)))==null?void 0:R.filter(Z=>d.toValue(Z.isMounted)))==null?void 0:I.filter(Z=>d.toValue(Z==null?void 0:Z.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),Z=d.ref(!1),q=d.computed(()=>u.htmlRenderRef),J=d.computed({get:()=>(u.selectedNodes||[]).map(Ke=>{var ke;let Be=(ke=u==null?void 0:u.nodes)==null?void 0:ke.find(et=>(et==null?void 0:et.id)===(Ke==null?void 0:Ke.id)),Y=Ke!=null&&Ke.element?Ke==null?void 0:Ke.element:m6e(Ke==null?void 0:Ke.id,h.value);return{...Be||{},...Ke,element:Y}}),set:Ke=>{const Be=Ke.map(({element:Y,...ke})=>{var je;return{...((je=u==null?void 0:u.nodes)==null?void 0:je.find(Ce=>(Ce==null?void 0:Ce.id)===(ke==null?void 0:ke.id)))||{},...ke}});m("update:selectedNodes",Be)}}),G=d.computed(()=>{var Y,ke,et;const Ke=(ke=(Y=d.toValue(R))==null?void 0:Y.filter(je=>d.toValue(je==null?void 0:je.activated)))==null?void 0:ke.filter(je=>d.toValue(je.isMounted)),Be=((et=d.toValue(u==null?void 0:u.nodesGroups)||[])==null?void 0:et.map(je=>({...je||{},activated:!0})))||[];return Nfe([...Be,...Ke])}),W=d.ref([]),L=Ke=>{var ke;const Be=Ke.map(({...et})=>{var Dt;let je=(Dt=C.value)==null?void 0:Dt.find(me=>(me==null?void 0:me.id)===(et==null?void 0:et.id));const{element:Ce,...ce}={...je||{},...et};return ce}),Y=(ke=J.value)==null?void 0:ke.map(({element:et,...je})=>je);na(Be,Y)||(J.value=Be,m("onSelectedNodes",Be))},pe=d.computed(()=>d.toValue(u==null?void 0:u.nodesGroups));return s({setSelectedNodes:L}),d.provide(Tfe,{containerRef:h,htmlRenderRef:q,contextMenuRef:b,focusedElement:S,currentRenderNodes:W,cursorPosition:_,focusedNodeIndex:N,preNodeNumber:O,currentNodes:G,selectedNodes:J,setSelectedNodes:L,renderNodes:C,uiReady:I,isFocused:Z,nodesGroups:pe}),(Ke,Be)=>d.renderSlot(Ke.$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},Z=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),Z.value={focusedElement:d.toValue(b),cursorPosition:d.toValue(C),focusedNodeIndex:d.toValue(S),preNodeNumber:d.toValue(_)}}))},{immediate:!0,deep:!0});const{editNodes:q}=IB(),J=async Y=>{var ke,et;if(d.toValue(Z).focusedElement&&!Bxe(d.toValue(C))){const je=$U(d.toValue(Z).focusedElement),Ce=d.toValue(Z).cursorPosition,ce=(d.toValue(Z).preNodeNumber||0)+1,Dt=v6e(d.toValue(Z).focusedElement),me=Bfe().valueOf();if(je&&!dB(Ce)&&Ce>=0){const be=await((ke=Y==null?void 0:Y.getDefaultProps)==null?void 0:ke.call(Y))||{};q({...Dt,label:Y==null?void 0:Y.label,nodePath:je,startOffset:Ce,subNodeSort:ce,textNodeIndex:d.toValue(S)||0,nodeType:Y==null?void 0:Y.value,insertTime:me,props:be})}}else if(m){const je=d.toValue(m);if(je!=null&&je.length){const Ce=await((et=Y==null?void 0:Y.getDefaultProps)==null?void 0:et.call(Y))||{},ce=je==null?void 0:je.map(Dt=>({...Dt,label:Y==null?void 0:Y.label,element:Dt==null?void 0:Dt.element,nodePath:Dt==null?void 0:Dt.nodePath,nodeType:Y==null?void 0:Y.value,props:Ce}));q(ce),h(ce)}}O.value=!1},G=d.computed(()=>{const Y=[],ke=[];return d.toValue(N).forEach(et=>{et.groupName==="system"?ke.push({...et,handler:()=>{J(et)}}):Y.push({...et,handler:()=>{J(et)}})}),[{label:"限定填写内容",icon:"i-bi:lock",children:Y},{label:"插入记录标识",icon:"i-bi:flag",children:ke}].filter(et=>{var je;return(je=et==null?void 0:et.children)==null?void 0:je.length})}),W=s,L=(Y,ke)=>{Y.preventDefault(),ke!=null&&ke.handler&&ke.handler(),ke!=null&&ke.value&&(W("select",ke==null?void 0:ke.value),R.value=!1)},pe=d.computed(()=>{var et,je;const Y=d.toValue(m)||[];if(!Array.isArray(Y)||Y.length===0)return null;const ke=((et=Y[0])==null?void 0:et.nodeType)??null;for(let Ce=1;Ce<Y.length;Ce++)if(((je=Y[Ce])==null?void 0:je.nodeType)!==ke)return null;return ke}),Ke=Y=>Y==null?"":String(Y).toLowerCase(),Be=Y=>Ke(pe.value)===Ke(Y);return(Y,ke)=>(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({...Y.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(G.value,et=>(d.openBlock(),d.createElementBlock("div",{key:et==null?void 0:et.label,class:"menu-item"},[d.createElementVNode("div",{class:"menu-item-content",onClick:je=>L(je,et)},[et!=null&&et.icon?(d.openBlock(),d.createElementBlock("div",z6e,[d.createElementVNode("div",{class:d.normalizeClass(et==null?void 0:et.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(et.label)+" ",1),et!=null&&et.children?(d.openBlock(),d.createElementBlock("span",U6e,"›")):d.createCommentVNode("",!0)],8,H6e),et!=null&&et.children?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["submenu",{"submenu-bottom":Y.direction==="bottom"}])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(et.children,je=>(d.openBlock(),d.createElementBlock("div",{key:je.action,class:d.normalizeClass(["menu-item",{active:Be(je.value)}]),onClick:Ce=>L(Ce,je)},[je!=null&&je.icon?(d.openBlock(),d.createElementBlock("div",W6e,[d.createElementVNode("div",{class:d.normalizeClass(je==null?void 0:je.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(je.label),1)],10,j6e))),128))],2)):d.createCommentVNode("",!0)]))),128))],512)]),_:1},8,["visible"]))}}),G6e=Ja(Z6e,[["__scopeId","data-v-24001f4f"]]);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,Z=u==null?void 0:u.value,q=Array.from((Z==null?void 0:Z.querySelectorAll(".submenu"))||[]).reduce((J,G)=>Math.max(J,G.offsetHeight||0),0)||400;O.height-I<q?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:_,updateNodes:N}=j0(),O=d.computed(()=>d.toValue(_)==="edit"),R=o,I=i,Z=()=>{I("onUiReady",{containerRef:m})},{height:q}=mMe(u),J=d.computed(()=>R.headerHtml?R.headerHtml.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(_e,le,He)=>{const Ge=He.replace(/([^{}]+)\{/g,(fe,Ue)=>{const yt=Ue.trim();return yt&&!yt.includes(".header-container")?`.header-container ${yt} {`:fe});return`<style${le}>${Ge}</style>`}):""),G=d.computed(()=>{const _e=Bz[R.pagesize]||Bz.A4,le=(window.devicePixelRatio||1)*96;return`${_e.height*le/25.4-d.toValue(q)}px`}),{showContextMenu:W,contextMenuStyle:L,onContextMenu:pe,direction:Ke}=q6e({headerHeight:q,hasContextMenu:O}),Be=d.ref(null),Y=d.computed(()=>{var _e;return(_e=d.toValue(C))==null?void 0:_e.map(le=>{const{nodePath:He,id:Ge,nodeType:fe}=le;return{nodePath:He,id:Ge,nodeType:fe}})}),ke=_e=>{const le=document.createElement("div");return le.innerHTML=_e||"",le.querySelectorAll(".node-item").forEach(Ge=>{(Ge.getAttribute("id")||"")&&Ge.remove()}),le.normalize(),le.innerHTML},et=_e=>{var fe;const le=(fe=m.value)==null?void 0:fe.querySelector(`[id="${_e==null?void 0:_e.id}"]`);if(le)return le;let He=null;const Ge=document.createElement("span");return Ge.setAttribute("contenteditable","false"),Ge.classList.add("node-item"),He=Ge,g6e(_e,He,m.value),He&&h6e(He,_e),He},je=()=>{const _e=C.value||[],le=Vxe(_e,[He=>He.nodePath,He=>He.textNodeIndex||-1,He=>(He==null?void 0:He.startOffset)??-1,He=>He.subNodeSort||-1,He=>(He==null?void 0:He.insertTime)||-1],["asc","desc","desc","desc","desc"]);le==null||le.forEach(He=>{et(He)})},Ce=()=>{Be.value&&(h.value=!1,d.nextTick(()=>{if(Be.value){const _e=ke(d.toValue(S));Be.value.innerHTML=_e,je(),h.value=!0,S.value=Be.value.innerHTML,d.nextTick(()=>{Z(),setTimeout(()=>{d.toValue(m)&&E6e(d.toValue(m))},10)})}}))},ce=_e=>{const le=document.createElement("html"),He=document.createElement("body");le.appendChild(He),He.innerHTML=_e||"";const Ge=[];return He.querySelectorAll(".node-item").forEach(Ue=>{const yt=Ue.getAttribute("id")||"",Ve=$U(Ue==null?void 0:Ue.parentElement)||"";Ge.push({nodePath:Ve,id:yt})}),Ge};d.watch(()=>S,()=>{var He;const _e=ce(d.toValue(S)),le=Y.value.map(Ge=>{const{nodePath:fe}=(_e==null?void 0:_e.find(Ue=>(Ue==null?void 0:Ue.id)===(Ge==null?void 0:Ge.id)))||{};return fe?{...Ge,nodePath:fe}:Ge});na(le,Y.value)?Ce():N((He=d.toValue(C))==null?void 0:He.map(Ge=>{const{nodePath:fe}=(le==null?void 0:le.find(Ue=>(Ue==null?void 0:Ue.id)===(Ge==null?void 0:Ge.id)))||{};return fe?{...Ge,nodePath:fe}:Ge}))},{deep:!0,immediate:!0}),d.watch(()=>Be,()=>{Ce()},{deep:!0,immediate:!0}),d.watch(()=>[...Y.value],(_e,le)=>{na(le,_e)||Ce()},{deep:!0,immediate:!0});const Dt=d.ref(),me=()=>{b.value=!0},{onBlur:be}=Y6e(),$=()=>{b.value=!1,be()};return s({renderHtml:Ce,getInnerHTML:()=>{var _e,le;return((le=(_e=Dt.value)==null?void 0:_e.getInnerHTML)==null?void 0:le.call(_e))||""},getContainerHTML:()=>{var _e;return((_e=m.value)==null?void 0:_e.innerHTML)||""}}),(_e,le)=>(d.openBlock(),d.createElementBlock("div",K6e,[d.createVNode(RB,{onOnBlur:$,onOnFocus:me,ref_key:"shadowDomRef",ref:Dt},{default:d.withCtx(()=>[d.createElementVNode("div",{ref_key:"headerRef",ref:u,style:{overflow:"hidden"}},[d.createElementVNode("div",X6e,[d.createElementVNode("div",{innerHTML:J.value,class:"disabeld-edit docHeaderHtml",onClick:me},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:G.value}]),onContextmenu:le[0]||(le[0]=d.withModifiers((...He)=>d.unref(pe)&&d.unref(pe)(...He),["prevent"]))},[d.createElementVNode("body",{ref_key:"bodyRef",ref:Be},null,512),d.createElementVNode("div",Q6e,[d.createElementVNode("div",{innerHTML:R==null?void 0:R.footerHtml,class:"disabeld-edit docFooterHtml",onClick:me},null,8,eBe)])],38)]),_:1},512),O.value?(d.openBlock(),d.createBlock(G6e,{key:0,show:d.unref(W),"onUpdate:show":le[1]||(le[1]=He=>d.isRef(W)?W.value=He:null),style:d.normalizeStyle(d.unref(L)),direction:d.unref(Ke)},null,8,["show","style","direction"])):d.createCommentVNode("",!0)]))}}),nBe=d.defineComponent({__name:"index",props:{pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},style:{type:Object,default:()=>({})},pagesizeWrapStyle:{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",{class:"pagesize",style:d.normalizeStyle(s==null?void 0:s.pagesizeWrapStyle)},[d.createElementVNode("div",{style:d.normalizeStyle({width:`${i.value}px`,...o.style}),class:"pagesize-content"},[d.renderSlot(u.$slots,"default",{},void 0,!0)],4)],4))}}),oBe=Ja(nBe,[["__scopeId","data-v-1f48410e"]]),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:()=>({})},pagesizeWrapStyle:{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=J=>{m("onUiReady",J)},_=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=J=>{m("update:nodes",J)},I=J=>{m("update:modelValue",J)},Z=J=>{m("update:formData",J)},q=J=>{m("onSelectedNodes",J)};return s({formRef:{validate:()=>{var J,G,W;return(W=(G=(J=b.value)==null?void 0:J.formRef)==null?void 0:G.validate)==null?void 0:W.call(G)}},setSelectedNodes:J=>{var G,W;(W=(G=_.value)==null?void 0:G.setSelectedNodes)==null||W.call(G,J)},initNodes:()=>{var J,G;return(G=(J=b.value)==null?void 0:J.initNodes)==null?void 0:G.call(J)},getInnerHTML:()=>{var J,G;return((G=(J=C.value)==null?void 0:J.getInnerHTML)==null?void 0:G.call(J))||""},getContainerHTML:()=>{var J,G;return((G=(J=C.value)==null?void 0:J.getContainerHTML)==null?void 0:G.call(J))||""}}),(J,G)=>(d.openBlock(),d.createBlock(oBe,{pagesize:o.pagesize,orientation:u==null?void 0:u.orientation,style:d.normalizeStyle(o.pagesizeStyle),pagesizeWrapStyle:o.pagesizeWrapStyle},{default:d.withCtx(()=>[d.createVNode(V6e,{ref_key:"UIRef",ref:_,nodes:o.nodes,"onUpdate:nodes":R,selectedNodes:h.value,"onUpdate:selectedNodes":G[0]||(G[0]=W=>h.value=W),onOnSelectedNodes:q,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":Z,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(W=>[d.renderSlot(J.$slots,"nodeItem",{node:W==null?void 0:W.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","pagesizeWrapStyle"]))}}),sBe={class:"nodes-text"},rBe={key:0,class:"node-text-input"},aBe={key:1,class:"node-text-td"},iBe={key:0,class:"node-text-table-index"},lBe=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",sBe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(m.value,(S,_)=>{var N,O,R,I,Z,q,J,G,W;return d.openBlock(),d.createElementBlock("div",{key:_,class:"node-text-item"},[(S==null?void 0:S.showTextType)==="input"?(d.openBlock(),d.createElementBlock("span",rBe,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",aBe,[h.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("span",iBe,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)===((Z=S==null?void 0:S.max)==null?void 0:Z.id)?(J=(q=S==null?void 0:S.min)==null?void 0:q.props)!=null&&J.alias?(W=(G=S==null?void 0:S.min)==null?void 0:G.props)==null?void 0:W.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(lBe,[["__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 u.value=!1,!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,cBe={key:0,class:"node-select-small gap-x-2"},uBe={key:1,class:"text-[#999]"},dBe={key:1,class:"node-select"},fBe={class:"flex py-2 px-2 justify-between items-center noder-select-header"},mBe={class:"flex gap-2"},pBe={key:1},gBe={class:"flex gap-1"},hBe=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=()=>{b.value=!1,setTimeout(()=>{m.value=[]},0)},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,Z;return s.size==="small"?(d.openBlock(),d.createElementBlock("div",cBe,[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]=(...q)=>d.unref(h)&&d.unref(h)(...q))},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)()})},[((Z=m.value)==null?void 0:Z.length)>0?(d.openBlock(),d.createBlock(ile,{key:0,modelValue:m.value,"onUpdate:modelValue":R[1]||(R[1]=q=>m.value=q),editorId:o.editorId},null,8,["modelValue","editorId"])):(d.openBlock(),d.createElementBlock("div",uBe,"未设置"))])])):(d.openBlock(),d.createElementBlock("div",dBe,[d.createElementVNode("div",fBe,[d.createElementVNode("div",mBe,[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]=(...q)=>d.unref(h)&&d.unref(h)(...q))})],4)),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",pBe,[d.createElementVNode("div",{class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})]))]),d.createElementVNode("div",gBe,[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]=q=>m.value=q),editorId:o.editorId},null,8,["modelValue","editorId"])],2)]))}}}),Lfe=Ja(hBe,[["__scopeId","data-v-cc571e72"]]);function vBe(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 bBe(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 yBe(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 Z=_;Z<=N;Z++)S.push({colIndex:Z,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 wBe(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),Z=((S=I.startContainer)==null?void 0:S.nodeName)==="#text"?I.startContainer:(N=(_=I.startContainer)==null?void 0:_.childNodes)==null?void 0:N[0],q=Math.min(C,((O=Z.textContent)==null?void 0:O.length)||0);I.setStart(Z,q)}}};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 CBe(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=Z=>{var q;Z.preventDefault(),(q=d.toValue(s))==null||q.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(Z=>{Z.addEventListener("click",C),Z.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(Z=>{Z.removeEventListener("click",C),Z.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 Z;R=[...R,...((Z=I==null?void 0:I.cellValue)==null?void 0:Z.map(q=>({color:I==null?void 0:I.color,backgroundColor:Mz((I==null?void 0:I.color)||"#000",.1),element:q==null?void 0:q.element})))||[]]}),R.forEach(I=>{var Z;I!=null&&I.element&&((Z=I==null?void 0:I.element)==null||Z.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 SBe=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 xBe(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 EBe=(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},_Be=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(),Z=q=>{var J,G;if(d.toValue(R)&&d.toValue(O)&&!na((J=d.toValue(b))==null?void 0:J.cellValue,q)){const W=S6e(q,((G=d.toValue(S))==null?void 0:G.nodes)||"");let L=W;W&&(d.toValue(N)===0&&(L+=","),d.toValue(_)>=0&&(u.value=xBe(d.toValue(u),d.toValue(_),d.toValue(N),L),N.value=W.length))}};d.watch(()=>h,()=>{var q,J,G,W,L,pe;if((q=S.value)==null||q.setSelectedNodes([]),["range","cell"].includes((J=d.toValue(b))==null?void 0:J.type))return _.value=EBe(i.value,h.value),N.value=(W=(G=d.toValue(b))==null?void 0:G.value)==null?void 0:W.length,R.value=!0,I("selectNodes",{data:(L=d.toValue(b))==null?void 0:L.cellValue,mode:"multiple",callback:({data:Ke})=>{Z(Ke)}}),!1;if([",","(","="].includes((pe=d.toValue(b))==null?void 0:pe.value))return _.value=d.toValue(s),R.value=!0,N.value=0,I("selectNodes",{data:[],mode:"multiple",callback:({data:Ke})=>{Z(Ke)}}),!1;R.value=!1,_.value=-1},{immediate:!0,deep:!0})},kBe=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 TBe(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 ABe=(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},NBe=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 Z;if(d.toValue(N)&&d.toValue(_)&&!na((Z=d.toValue(h))==null?void 0:Z.value,I)){const q=I,J=q;q&&d.toValue(C)>=0&&(u.value=TBe(d.toValue(u),d.toValue(C),d.toValue(S),J),S.value=q.length)}};d.watch(()=>m,()=>{var I,Z,q,J,G;if(["function"].includes((I=d.toValue(h))==null?void 0:I.type))return C.value=ABe(i.value,m.value),S.value=(q=(Z=d.toValue(h))==null?void 0:Z.value)==null?void 0:q.length,N.value=!0,O("selectFunction",{data:(J=d.toValue(h))==null?void 0:J.value,callback:({data:W})=>{R(W)}}),!1;if([",","(","="].includes((G=d.toValue(h))==null?void 0:G.value))return C.value=d.toValue(s),N.value=!0,S.value=0,O("selectFunction",{data:"",callback:({data:W})=>{R(W)}}),!1;N.value=!1,C.value=-1},{immediate:!0,deep:!0})},OBe={class:"node-formula"},$Be={class:"node-formula-show"},DBe=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}=yBe({editorId:s==null?void 0:s.editorId}),u=d.useModel(o,"modelValue"),m=d.ref(),{startOffset:h}=SBe({element:m});wBe(m,u,h);const b=d.computed(()=>{const N=vBe(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=bBe(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)});CBe({element:m,showStr:C,editorId:s==null?void 0:s.editorId});const{currentItemIndex:S,currentItem:_}=kBe({element:m,startOffset:h,value:u,showStr:C});return _Be({element:m,startOffset:h,showStr:C,editorId:s==null?void 0:s.editorId,value:u,currentItemIndex:S,currentItem:_}),NBe({element:m,startOffset:h,showStr:C,value:u,currentItemIndex:S,currentItem:_}),(N,O)=>(d.openBlock(),d.createElementBlock("div",OBe,[d.createElementVNode("div",{contenteditable:"true",ref_key:"formulaRef",ref:m,class:"node-formula-input"},null,512),d.createElementVNode("div",$Be,[(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(DBe,[["__scopeId","data-v-f4b96eb4"]]),MBe=[{label:"平均值",value:"AVERAGE"},{label:"均值绝对偏差",value:"AVEDEV"},{label:"求和",value:"SUM"},{label:"条件判断",value:"IF"},{label:"统计数量",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"正平方根",value:"SQRT"}],BBe={class:"select-function"},RBe=["onClick"],IBe={class:"function-item"},PBe={class:"function-item-desc"},FBe=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:MBe}),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",BBe,[(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",IBe,d.toDisplayString(S.value),1),d.createElementVNode("div",PBe,d.toDisplayString(S.label),1)],10,RBe)]))),128))]))}}),Hfe=Ja(FBe,[["__scopeId","data-v-6e079ff0"]]),LBe=["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,LBe)]),_:1}))}});function RU(o){return d.getCurrentScope()?(d.onScopeDispose(o),!0):!1}function B0(o){return typeof o=="function"?o():d.unref(o)}const VBe=typeof window<"u"&&typeof document<"u",HBe=o=>typeof o<"u",zBe=Object.prototype.toString,UBe=o=>zBe.call(o)==="[object Object]",jBe=()=>{};function WBe(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 ZBe(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 GBe(o,s,i={}){const{eventFilter:u=Ufe,...m}=i;return d.watch(o,WBe(u,s),m)}function GA(o,s,i={}){const{eventFilter:u,...m}=i,{eventFilter:h,pause:b,resume:C,isActive:S}=ZBe(u);return{stop:GBe(o,s,{...m,eventFilter:h}),pause:b,resume:C,isActive:S}}function qBe(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:Z,throwOnTimeout:q}={}){let J=null;const W=[new Promise(L=>{J=d.watch(o,pe=>{O(pe)!==s&&(J==null||J(),L(pe))},{flush:R,deep:I,immediate:!0})})];return Z!=null&&W.push(cle(Z,q).then(()=>B0(o)).finally(()=>J==null?void 0:J())),Promise.race(W)}function u(O,R){if(!d.isRef(O))return i(pe=>pe===O,R);const{flush:I="sync",deep:Z=!1,timeout:q,throwOnTimeout:J}=R??{};let G=null;const L=[new Promise(pe=>{G=d.watch([o,O],([Ke,Be])=>{s!==(Ke===Be)&&(G==null||G(),pe(Ke))},{flush:I,deep:Z,immediate:!0})})];return q!=null&&L.push(cle(q,J).then(()=>B0(o)).finally(()=>(G==null||G(),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 Z=Array.from(I);return Z.includes(O)||Z.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 YBe(o){var s;const i=B0(o);return(s=i==null?void 0:i.$el)!=null?s:i}const jfe=VBe?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 jBe;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(()=>[YBe(s),B0(m)],([N,O])=>{if(b(),!N)return;const R=UBe(O)?{...O}:O;h.push(...i.flatMap(I=>u.map(Z=>C(N,I,Z,R))))},{immediate:!0,flush:"post"}),_=()=>{S(),b()};return RU(_),_}function KBe(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=KBe(s);return Wfe(m,h,N=>{N.repeat&&B0(C)||S(N)&&i(N)},b)}function XBe(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(),Z=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 q=_;s||(s="modelValue"),q=q||`update:${s.toString()}`;const J=L=>C?typeof C=="function"?C(L):XBe(L):L,G=()=>HBe(o[s])?J(o[s]):O,W=L=>{R?R(L)&&Z(q,L):Z(q,L)};if(S){const L=G(),pe=d.ref(L);let Ke=!1;return d.watch(()=>o[s],Be=>{Ke||(Ke=!0,pe.value=J(Be),d.nextTick(()=>Ke=!1))}),d.watch(pe,Be=>{!Ke&&(Be!==o[s]||N)&&W(Be)},{deep:N}),pe}else return d.computed({get(){return G()},set(L){W(L)}})}var JBe={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 QBe(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=QBe(o+"",i),m,h=-1,b=u.length;if(arguments.length<2){for(;++h<b;)if((m=(o=u[h]).type)&&(m=eRe(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 eRe(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]=JBe,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 tRe(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 nRe(o){return function(){return this.ownerDocument.createElementNS(o.space,o.local)}}function Zfe(o){var s=PU(o);return(s.local?nRe:tRe)(s)}function oRe(){}function Loe(o){return o==null?oRe:function(){return this.querySelector(o)}}function sRe(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 rRe(o){return o==null?[]:Array.isArray(o)?o:Array.from(o)}function aRe(){return[]}function Gfe(o){return o==null?aRe:function(){return this.querySelectorAll(o)}}function iRe(o){return function(){return rRe(o.apply(this,arguments))}}function lRe(o){typeof o=="function"?o=iRe(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 cRe=Array.prototype.find;function uRe(o){return function(){return cRe.call(this.children,o)}}function dRe(){return this.firstElementChild}function fRe(o){return this.select(o==null?dRe:uRe(typeof o=="function"?o:Yfe(o)))}var mRe=Array.prototype.filter;function pRe(){return Array.from(this.children)}function gRe(o){return function(){return mRe.call(this.children,o)}}function hRe(o){return this.selectAll(o==null?pRe:gRe(typeof o=="function"?o:Yfe(o)))}function vRe(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 bRe(){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 yRe(o){return function(){return o}}function wRe(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 CRe(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 SRe(o){return o.__data__}function xRe(o,s){if(!arguments.length)return Array.from(this,SRe);var i=s?CRe:wRe,u=this._parents,m=this._groups;typeof o!="function"&&(o=yRe(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=ERe(o.call(N,N&&N.__data__,_,u)),Z=I.length,q=C[_]=new Array(Z),J=b[_]=new Array(Z),G=S[_]=new Array(R);i(N,O,q,J,G,I,s);for(var W=0,L=0,pe,Ke;W<Z;++W)if(pe=q[W]){for(W>=L&&(L=W+1);!(Ke=J[L])&&++L<Z;);pe._next=Ke||null}}return b=new Sp(b,u),b._enter=C,b._exit=S,b}function ERe(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function _Re(){return new Sp(this._exit||this._groups.map(Kfe),this._parents)}function kRe(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 TRe(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,Z=0;Z<O;++Z)(I=_[Z]||N[Z])&&(R[Z]=I);for(;S<m;++S)C[S]=i[S];return new Sp(C,this._parents)}function ARe(){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 NRe(o){o||(o=ORe);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 ORe(o,s){return o<s?-1:o>s?1:o>=s?0:NaN}function $Re(){var o=arguments[0];return arguments[0]=this,o.apply(null,arguments),this}function DRe(){return Array.from(this)}function MRe(){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 BRe(){let o=0;for(const s of this)++o;return o}function RRe(){return!this.node()}function IRe(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 PRe(o){return function(){this.removeAttribute(o)}}function FRe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function LRe(o,s){return function(){this.setAttribute(o,s)}}function VRe(o,s){return function(){this.setAttributeNS(o.space,o.local,s)}}function HRe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttribute(o):this.setAttribute(o,i)}}function zRe(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 URe(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?FRe:PRe:typeof s=="function"?i.local?zRe:HRe:i.local?VRe:LRe)(i,s))}function Xfe(o){return o.ownerDocument&&o.ownerDocument.defaultView||o.document&&o||o.defaultView}function jRe(o){return function(){this.style.removeProperty(o)}}function WRe(o,s,i){return function(){this.style.setProperty(o,s,i)}}function ZRe(o,s,i){return function(){var u=s.apply(this,arguments);u==null?this.style.removeProperty(o):this.style.setProperty(o,u,i)}}function GRe(o,s,i){return arguments.length>1?this.each((s==null?jRe:typeof s=="function"?ZRe:WRe)(o,s,i??"")):g4(this.node(),o)}function g4(o,s){return o.style.getPropertyValue(s)||Xfe(o).getComputedStyle(o,null).getPropertyValue(s)}function qRe(o){return function(){delete this[o]}}function YRe(o,s){return function(){this[o]=s}}function KRe(o,s){return function(){var i=s.apply(this,arguments);i==null?delete this[o]:this[o]=i}}function XRe(o,s){return arguments.length>1?this.each((s==null?qRe:typeof s=="function"?KRe:YRe)(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 JRe(o){return function(){eme(this,o)}}function QRe(o){return function(){tme(this,o)}}function eIe(o,s){return function(){(s.apply(this,arguments)?eme:tme)(this,o)}}function tIe(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"?eIe:s?JRe:QRe)(i,s))}function nIe(){this.textContent=""}function oIe(o){return function(){this.textContent=o}}function sIe(o){return function(){var s=o.apply(this,arguments);this.textContent=s??""}}function rIe(o){return arguments.length?this.each(o==null?nIe:(typeof o=="function"?sIe:oIe)(o)):this.node().textContent}function aIe(){this.innerHTML=""}function iIe(o){return function(){this.innerHTML=o}}function lIe(o){return function(){var s=o.apply(this,arguments);this.innerHTML=s??""}}function cIe(o){return arguments.length?this.each(o==null?aIe:(typeof o=="function"?lIe:iIe)(o)):this.node().innerHTML}function uIe(){this.nextSibling&&this.parentNode.appendChild(this)}function dIe(){return this.each(uIe)}function fIe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mIe(){return this.each(fIe)}function pIe(o){var s=typeof o=="function"?o:Zfe(o);return this.select(function(){return this.appendChild(s.apply(this,arguments))})}function gIe(){return null}function hIe(o,s){var i=typeof o=="function"?o:Zfe(o),u=s==null?gIe:typeof s=="function"?s:Loe(s);return this.select(function(){return this.insertBefore(i.apply(this,arguments),u.apply(this,arguments)||null)})}function vIe(){var o=this.parentNode;o&&o.removeChild(this)}function bIe(){return this.each(vIe)}function yIe(){var o=this.cloneNode(!1),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function wIe(){var o=this.cloneNode(!0),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function CIe(o){return this.select(o?wIe:yIe)}function SIe(o){return arguments.length?this.property("__data__",o):this.node().__data__}function xIe(o){return function(s){o.call(this,s,this.__data__)}}function EIe(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 _Ie(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 kIe(o,s,i){return function(){var u=this.__on,m,h=xIe(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 TIe(o,s,i){var u=EIe(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?kIe:_Ie,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 AIe(o,s){return function(){return nme(this,o,s)}}function NIe(o,s){return function(){return nme(this,o,s.apply(this,arguments))}}function OIe(o,s){return this.each((typeof s=="function"?NIe:AIe)(o,s))}function*$Ie(){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 DIe(){return this}Sp.prototype=PB.prototype={constructor:Sp,select:sRe,selectAll:lRe,selectChild:fRe,selectChildren:hRe,filter:vRe,data:xRe,enter:bRe,exit:_Re,join:kRe,merge:TRe,selection:DIe,order:ARe,sort:NRe,call:$Re,nodes:DRe,node:MRe,size:BRe,empty:RRe,each:IRe,attr:URe,style:GRe,property:XRe,classed:tIe,text:rIe,html:cIe,raise:dIe,lower:mIe,append:pIe,insert:hIe,remove:bIe,clone:CIe,datum:SIe,on:TIe,dispatch:OIe,[Symbol.iterator]:$Ie};function Mh(o){return typeof o=="string"?new Sp([[document.querySelector(o)]],[document.documentElement]):new Sp([[o]],ome)}function MIe(o){let s;for(;s=o.sourceEvent;)o=s;return o}function Ov(o,s){if(o=MIe(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 BIe={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 RIe(o){return!o.ctrlKey&&!o.button}function IIe(){return this.parentNode}function PIe(o,s){return s??{x:o.x,y:o.y}}function FIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function LIe(){var o=RIe,s=IIe,i=PIe,u=FIe,m={},h=IU("start","drag","end"),b=0,C,S,_,N,O=0;function R(pe){pe.on("mousedown.drag",I).filter(u).on("touchstart.drag",J).on("touchmove.drag",G,BIe).on("touchend.drag touchcancel.drag",W).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function I(pe,Ke){if(!(N||!o.call(this,pe,Ke))){var Be=L(this,s.call(this,pe,Ke),pe,Ke,"mouse");Be&&(Mh(pe.view).on("mousemove.drag",Z,fB).on("mouseup.drag",q,fB),sme(pe.view),bte(pe),_=!1,C=pe.clientX,S=pe.clientY,Be("start",pe))}}function Z(pe){if(a4(pe),!_){var Ke=pe.clientX-C,Be=pe.clientY-S;_=Ke*Ke+Be*Be>O}m.mouse("drag",pe)}function q(pe){Mh(pe.view).on("mousemove.drag mouseup.drag",null),rme(pe.view,_),a4(pe),m.mouse("end",pe)}function J(pe,Ke){if(o.call(this,pe,Ke)){var Be=pe.changedTouches,Y=s.call(this,pe,Ke),ke=Be.length,et,je;for(et=0;et<ke;++et)(je=L(this,Y,pe,Ke,Be[et].identifier,Be[et]))&&(bte(pe),je("start",pe,Be[et]))}}function G(pe){var Ke=pe.changedTouches,Be=Ke.length,Y,ke;for(Y=0;Y<Be;++Y)(ke=m[Ke[Y].identifier])&&(a4(pe),ke("drag",pe,Ke[Y]))}function W(pe){var Ke=pe.changedTouches,Be=Ke.length,Y,ke;for(N&&clearTimeout(N),N=setTimeout(function(){N=null},500),Y=0;Y<Be;++Y)(ke=m[Ke[Y].identifier])&&(bte(pe),ke("end",pe,Ke[Y]))}function L(pe,Ke,Be,Y,ke,et){var je=h.copy(),Ce=Ov(et||Be,Ke),ce,Dt,me;if((me=i.call(pe,new kne("beforestart",{sourceEvent:Be,target:R,identifier:ke,active:b,x:Ce[0],y:Ce[1],dx:0,dy:0,dispatch:je}),Y))!=null)return ce=me.x-Ce[0]||0,Dt=me.y-Ce[1]||0,function be($,_e,le){var He=Ce,Ge;switch($){case"start":m[ke]=be,Ge=b++;break;case"end":delete m[ke],--b;case"drag":Ce=Ov(le||_e,Ke),Ge=b;break}je.call($,pe,new kne($,{sourceEvent:_e,subject:me,target:R,identifier:ke,active:Ge,x:Ce[0]+ce,y:Ce[1]+Dt,dx:Ce[0]-He[0],dy:Ce[1]-He[1],dispatch:je}),Y)}}return R.filter=function(pe){return arguments.length?(o=typeof pe=="function"?pe:RH(!!pe),R):o},R.container=function(pe){return arguments.length?(s=typeof pe=="function"?pe:RH(pe),R):s},R.subject=function(pe){return arguments.length?(i=typeof pe=="function"?pe:RH(pe),R):i},R.touchable=function(pe){return arguments.length?(u=typeof pe=="function"?pe:RH(!!pe),R):u},R.on=function(){var pe=h.on.apply(h,arguments);return pe===h?R:pe},R.clickDistance=function(pe){return arguments.length?(O=(pe=+pe)*pe,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*",VIe=/^#([0-9a-f]{3,8})$/,HIe=new RegExp(`^rgb\\(${i4},${i4},${i4}\\)$`),zIe=new RegExp(`^rgb\\(${Mv},${Mv},${Mv}\\)$`),UIe=new RegExp(`^rgba\\(${i4},${i4},${i4},${pB}\\)$`),jIe=new RegExp(`^rgba\\(${Mv},${Mv},${Mv},${pB}\\)$`),WIe=new RegExp(`^hsl\\(${pB},${Mv},${Mv}\\)$`),ZIe=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:GIe,formatHsl:qIe,formatRgb:gle,toString:gle});function ple(){return this.rgb().formatHex()}function GIe(){return this.rgb().formatHex8()}function qIe(){return ime(this).formatHsl()}function gle(){return this.rgb().formatRgb()}function gB(o){var s,i;return o=(o+"").trim().toLowerCase(),(s=VIe.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=HIe.exec(o))?new Sm(s[1],s[2],s[3],1):(s=zIe.exec(o))?new Sm(s[1]*255/100,s[2]*255/100,s[3]*255/100,1):(s=UIe.exec(o))?IH(s[1],s[2],s[3],s[4]):(s=jIe.exec(o))?IH(s[1]*255/100,s[2]*255/100,s[3]*255/100,s[4]):(s=WIe.exec(o))?yle(s[1],s[2]/100,s[3]/100,1):(s=ZIe.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 YIe(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?YIe(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:KIe,formatRgb:ble,toString:ble}));function vle(){return`#${bE(this.r)}${bE(this.g)}${bE(this.b)}`}function KIe(){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 XIe(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,XIe,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 JIe(o,s){return function(i){return o+i*s}}function QIe(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 ePe(o){return(o=+o)==1?cme:function(s,i){return i-s?QIe(s,i,o):lme(isNaN(s)?i:s)}}function cme(o,s){var i=s-o;return i?JIe(o,i):lme(isNaN(o)?s:o)}const Cle=function o(s){var i=ePe(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 tPe(o){return function(){return o}}function nPe(o){return function(s){return o(s)+""}}function oPe(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]?nPe(S[0].x):tPe(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 sPe(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 rPe(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,Z){if(_!==O||N!==R){var q=I.push("translate(",null,s,null,i);Z.push({i:q-4,x:r2(_,O)},{i:q-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,Z){if(_!==O||N!==R){var q=I.push(m(I)+"scale(",null,",",null,")");Z.push({i:q-4,x:r2(_,O)},{i:q-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 Z=-1,q=R.length,J;++Z<q;)O[(J=R[Z]).i]=J.x(I);return O.join("")}}}var aPe=dme(sPe,"px, ","px)","deg)"),iPe=dme(rPe,", ",")",")"),lPe=1e-12;function xle(o){return((o=Math.exp(o))+1/o)/2}function cPe(o){return((o=Math.exp(o))-1/o)/2}function uPe(o){return((o=Math.exp(2*o))-1)/(o+1)}const dPe=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,Z=O-S,q=I*I+Z*Z,J,G;if(q<lPe)G=Math.log(R/_)/s,J=function(Y){return[C+Y*I,S+Y*Z,_*Math.exp(s*Y*G)]};else{var W=Math.sqrt(q),L=(R*R-_*_+u*q)/(2*_*i*W),pe=(R*R-_*_-u*q)/(2*R*i*W),Ke=Math.log(Math.sqrt(L*L+1)-L),Be=Math.log(Math.sqrt(pe*pe+1)-pe);G=(Be-Ke)/s,J=function(Y){var ke=Y*G,et=xle(Ke),je=_/(i*W)*(et*uPe(s*ke+Ke)-cPe(Ke));return[C+je*I,S+je*Z,_*et/xle(s*ke+Ke)]}}return J.duration=G*1e3*s/Math.SQRT2,J}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(fPe),$E=hB.now()+FU)}function fPe(){$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 mPe(){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{mPe()}finally{h4=0,gPe(),$E=0}}function pPe(){var o=hB.now(),s=o-Lz;s>fme&&(FU-=s,Lz=o)}function gPe(){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(pPe,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 hPe=IU("start","end","cancel","interrupt"),vPe=[],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;bPe(o,i,{name:s,index:u,group:m,on:hPe,tween:vPe,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 bPe(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 yPe(o){return this.each(function(){cz(this,o)})}function wPe(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 CPe(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 SPe(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?wPe:CPe)(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):oPe)(o,s)}function xPe(o){return function(){this.removeAttribute(o)}}function EPe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function _Pe(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 kPe(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 TPe(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 APe(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 NPe(o,s){var i=PU(o),u=i==="transform"?iPe:hme;return this.attrTween(o,typeof s=="function"?(i.local?APe:TPe)(i,u,joe(this,"attr."+o,s)):s==null?(i.local?EPe:xPe)(i):(i.local?kPe:_Pe)(i,u,s))}function OPe(o,s){return function(i){this.setAttribute(o,s.call(this,i))}}function $Pe(o,s){return function(i){this.setAttributeNS(o.space,o.local,s.call(this,i))}}function DPe(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 MPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&OPe(o,h)),i}return m._value=s,m}function BPe(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?DPe:MPe)(u,s))}function RPe(o,s){return function(){Uoe(this,o).delay=+s.apply(this,arguments)}}function IPe(o,s){return s=+s,function(){Uoe(this,o).delay=s}}function PPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?RPe:IPe)(s,o)):Fh(this.node(),s).delay}function FPe(o,s){return function(){Fv(this,o).duration=+s.apply(this,arguments)}}function LPe(o,s){return s=+s,function(){Fv(this,o).duration=s}}function VPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?FPe:LPe)(s,o)):Fh(this.node(),s).duration}function HPe(o,s){if(typeof s!="function")throw new Error;return function(){Fv(this,o).ease=s}}function zPe(o){var s=this._id;return arguments.length?this.each(HPe(s,o)):Fh(this.node(),s).ease}function UPe(o,s){return function(){var i=s.apply(this,arguments);if(typeof i!="function")throw new Error;Fv(this,o).ease=i}}function jPe(o){if(typeof o!="function")throw new Error;return this.each(UPe(this._id,o))}function WPe(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 ZPe(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 GPe(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 qPe(o,s,i){var u,m,h=GPe(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 YPe(o,s){var i=this._id;return arguments.length<2?Fh(this.node(),i).on.on(o):this.each(qPe(i,o,s))}function KPe(o){return function(){var s=this.parentNode;for(var i in this.__transition)if(+i!==o)return;s&&s.removeChild(this)}}function XPe(){return this.on("end.remove",KPe(this._id))}function JPe(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 QPe(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,Z=Fh(N,i),q=0,J=R.length;q<J;++q)(I=R[q])&&LU(I,s,i,q,R,Z);h.push(R),b.push(N)}return new V0(h,b,s,i)}var e8e=PB.prototype.constructor;function t8e(){return new e8e(this._groups,this._parents)}function n8e(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 o8e(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 s8e(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 r8e(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 a8e(o,s,i){var u=(o+="")=="transform"?aPe:hme;return s==null?this.styleTween(o,n8e(o,u)).on("end.style."+o,vme(o)):typeof s=="function"?this.styleTween(o,s8e(o,u,joe(this,"style."+o,s))).each(r8e(this._id,o)):this.styleTween(o,o8e(o,u,s),i).on("end.style."+o,null)}function i8e(o,s,i){return function(u){this.style.setProperty(o,s.call(this,u),i)}}function l8e(o,s,i){var u,m;function h(){var b=s.apply(this,arguments);return b!==m&&(u=(m=b)&&i8e(o,b,i)),u}return h._value=s,h}function c8e(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,l8e(o,s,i??""))}function u8e(o){return function(){this.textContent=o}}function d8e(o){return function(){var s=o(this);this.textContent=s??""}}function f8e(o){return this.tween("text",typeof o=="function"?d8e(joe(this,"text",o)):u8e(o==null?"":o+""))}function m8e(o){return function(s){this.textContent=o.call(this,s)}}function p8e(o){var s,i;function u(){var m=o.apply(this,arguments);return m!==i&&(s=(i=m)&&m8e(m)),s}return u._value=o,u}function g8e(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,p8e(o))}function h8e(){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 v8e(){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 b8e=0;function V0(o,s,i,u){this._groups=o,this._parents=s,this._name=i,this._id=u}function bme(){return++b8e}var $0=PB.prototype;V0.prototype={constructor:V0,select:JPe,selectAll:QPe,selectChild:$0.selectChild,selectChildren:$0.selectChildren,filter:WPe,merge:ZPe,selection:t8e,transition:h8e,call:$0.call,nodes:$0.nodes,node:$0.node,size:$0.size,empty:$0.empty,each:$0.each,on:YPe,attr:NPe,attrTween:BPe,style:a8e,styleTween:c8e,text:f8e,textTween:g8e,remove:XPe,tween:SPe,delay:PPe,duration:VPe,ease:zPe,easeVarying:jPe,end:v8e,[Symbol.iterator]:$0[Symbol.iterator]};function y8e(o){return((o*=2)<=1?o*o*o:(o-=2)*o*o+2)/2}var w8e={time:null,delay:0,duration:250,ease:y8e};function C8e(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 S8e(o){var s,i;o instanceof V0?(s=o._id,o=o._name):(s=bme(),(i=w8e).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||C8e(S,s));return new V0(u,this._parents,o,s)}PB.prototype.interrupt=yPe;PB.prototype.transition=S8e;const LH=o=>()=>o;function x8e(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 E8e(o){return(!o.ctrlKey||o.type==="wheel")&&!o.button}function _8e(){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 k8e(o){return-o.deltaY*(o.deltaMode===1?.05:o.deltaMode?1:.002)*(o.ctrlKey?10:1)}function T8e(){return navigator.maxTouchPoints||"ontouchstart"in this}function A8e(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 N8e(){var o=E8e,s=_8e,i=A8e,u=k8e,m=T8e,h=[0,1/0],b=[[-1/0,-1/0],[1/0,1/0]],C=250,S=dPe,_=IU("start","zoom","end"),N,O,R,I=500,Z=150,q=0,J=10;function G(me){me.property("__zoom",Ale).on("wheel.zoom",ke,{passive:!1}).on("mousedown.zoom",et).on("dblclick.zoom",je).filter(m).on("touchstart.zoom",Ce).on("touchmove.zoom",ce).on("touchend.zoom touchcancel.zoom",Dt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}G.transform=function(me,be,$,_e){var le=me.selection?me.selection():me;le.property("__zoom",Ale),me!==le?Ke(me,be,$,_e):le.interrupt().each(function(){Be(this,arguments).event(_e).start().zoom(null,typeof be=="function"?be.apply(this,arguments):be).end()})},G.scaleBy=function(me,be,$,_e){G.scaleTo(me,function(){var le=this.__zoom.k,He=typeof be=="function"?be.apply(this,arguments):be;return le*He},$,_e)},G.scaleTo=function(me,be,$,_e){G.transform(me,function(){var le=s.apply(this,arguments),He=this.__zoom,Ge=$==null?pe(le):typeof $=="function"?$.apply(this,arguments):$,fe=He.invert(Ge),Ue=typeof be=="function"?be.apply(this,arguments):be;return i(L(W(He,Ue),Ge,fe),le,b)},$,_e)},G.translateBy=function(me,be,$,_e){G.transform(me,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,_e)},G.translateTo=function(me,be,$,_e,le){G.transform(me,function(){var He=s.apply(this,arguments),Ge=this.__zoom,fe=_e==null?pe(He):typeof _e=="function"?_e.apply(this,arguments):_e;return i(v4.translate(fe[0],fe[1]).scale(Ge.k).translate(typeof be=="function"?-be.apply(this,arguments):-be,typeof $=="function"?-$.apply(this,arguments):-$),He,b)},_e,le)};function W(me,be){return be=Math.max(h[0],Math.min(h[1],be)),be===me.k?me:new I0(be,me.x,me.y)}function L(me,be,$){var _e=be[0]-$[0]*me.k,le=be[1]-$[1]*me.k;return _e===me.x&&le===me.y?me:new I0(me.k,_e,le)}function pe(me){return[(+me[0][0]+ +me[1][0])/2,(+me[0][1]+ +me[1][1])/2]}function Ke(me,be,$,_e){me.on("start.zoom",function(){Be(this,arguments).event(_e).start()}).on("interrupt.zoom end.zoom",function(){Be(this,arguments).event(_e).end()}).tween("zoom",function(){var le=this,He=arguments,Ge=Be(le,He).event(_e),fe=s.apply(le,He),Ue=$==null?pe(fe):typeof $=="function"?$.apply(le,He):$,yt=Math.max(fe[1][0]-fe[0][0],fe[1][1]-fe[0][1]),Ve=le.__zoom,pt=typeof be=="function"?be.apply(le,He):be,Ie=S(Ve.invert(Ue).concat(yt/Ve.k),pt.invert(Ue).concat(yt/pt.k));return function(mt){if(mt===1)mt=pt;else{var oe=Ie(mt),mn=yt/oe[2];mt=new I0(mn,Ue[0]-oe[0]*mn,Ue[1]-oe[1]*mn)}Ge.zoom(null,mt)}})}function Be(me,be,$){return!$&&me.__zooming||new Y(me,be)}function Y(me,be){this.that=me,this.args=be,this.active=0,this.sourceEvent=null,this.extent=s.apply(me,be),this.taps=0}Y.prototype={event:function(me){return me&&(this.sourceEvent=me),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(me,be){return this.mouse&&me!=="mouse"&&(this.mouse[1]=be.invert(this.mouse[0])),this.touch0&&me!=="touch"&&(this.touch0[1]=be.invert(this.touch0[0])),this.touch1&&me!=="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(me){var be=Mh(this.that).datum();_.call(me,this.that,new x8e(me,{sourceEvent:this.sourceEvent,target:G,type:me,transform:this.that.__zoom,dispatch:_}),be)}};function ke(me,...be){if(!o.apply(this,arguments))return;var $=Be(this,be).event(me),_e=this.__zoom,le=Math.max(h[0],Math.min(h[1],_e.k*Math.pow(2,u.apply(this,arguments)))),He=Ov(me);if($.wheel)($.mouse[0][0]!==He[0]||$.mouse[0][1]!==He[1])&&($.mouse[1]=_e.invert($.mouse[0]=He)),clearTimeout($.wheel);else{if(_e.k===le)return;$.mouse=[He,_e.invert(He)],cz(this),$.start()}P6(me),$.wheel=setTimeout(Ge,Z),$.zoom("mouse",i(L(W(_e,le),$.mouse[0],$.mouse[1]),$.extent,b));function Ge(){$.wheel=null,$.end()}}function et(me,...be){if(R||!o.apply(this,arguments))return;var $=me.currentTarget,_e=Be(this,be,!0).event(me),le=Mh(me.view).on("mousemove.zoom",Ue,!0).on("mouseup.zoom",yt,!0),He=Ov(me,$),Ge=me.clientX,fe=me.clientY;sme(me.view),Cte(me),_e.mouse=[He,this.__zoom.invert(He)],cz(this),_e.start();function Ue(Ve){if(P6(Ve),!_e.moved){var pt=Ve.clientX-Ge,Ie=Ve.clientY-fe;_e.moved=pt*pt+Ie*Ie>q}_e.event(Ve).zoom("mouse",i(L(_e.that.__zoom,_e.mouse[0]=Ov(Ve,$),_e.mouse[1]),_e.extent,b))}function yt(Ve){le.on("mousemove.zoom mouseup.zoom",null),rme(Ve.view,_e.moved),P6(Ve),_e.event(Ve).end()}}function je(me,...be){if(o.apply(this,arguments)){var $=this.__zoom,_e=Ov(me.changedTouches?me.changedTouches[0]:me,this),le=$.invert(_e),He=$.k*(me.shiftKey?.5:2),Ge=i(L(W($,He),_e,le),s.apply(this,be),b);P6(me),C>0?Mh(this).transition().duration(C).call(Ke,Ge,_e,me):Mh(this).call(G.transform,Ge,_e,me)}}function Ce(me,...be){if(o.apply(this,arguments)){var $=me.touches,_e=$.length,le=Be(this,be,me.changedTouches.length===_e).event(me),He,Ge,fe,Ue;for(Cte(me),Ge=0;Ge<_e;++Ge)fe=$[Ge],Ue=Ov(fe,this),Ue=[Ue,this.__zoom.invert(Ue),fe.identifier],le.touch0?!le.touch1&&le.touch0[2]!==Ue[2]&&(le.touch1=Ue,le.taps=0):(le.touch0=Ue,He=!0,le.taps=1+!!N);N&&(N=clearTimeout(N)),He&&(le.taps<2&&(O=Ue[0],N=setTimeout(function(){N=null},I)),cz(this),le.start())}}function ce(me,...be){if(this.__zooming){var $=Be(this,be).event(me),_e=me.changedTouches,le=_e.length,He,Ge,fe,Ue;for(P6(me),He=0;He<le;++He)Ge=_e[He],fe=Ov(Ge,this),$.touch0&&$.touch0[2]===Ge.identifier?$.touch0[0]=fe:$.touch1&&$.touch1[2]===Ge.identifier&&($.touch1[0]=fe);if(Ge=$.that.__zoom,$.touch1){var yt=$.touch0[0],Ve=$.touch0[1],pt=$.touch1[0],Ie=$.touch1[1],mt=(mt=pt[0]-yt[0])*mt+(mt=pt[1]-yt[1])*mt,oe=(oe=Ie[0]-Ve[0])*oe+(oe=Ie[1]-Ve[1])*oe;Ge=W(Ge,Math.sqrt(mt/oe)),fe=[(yt[0]+pt[0])/2,(yt[1]+pt[1])/2],Ue=[(Ve[0]+Ie[0])/2,(Ve[1]+Ie[1])/2]}else if($.touch0)fe=$.touch0[0],Ue=$.touch0[1];else return;$.zoom("touch",i(L(Ge,fe,Ue),$.extent,b))}}function Dt(me,...be){if(this.__zooming){var $=Be(this,be).event(me),_e=me.changedTouches,le=_e.length,He,Ge;for(Cte(me),R&&clearTimeout(R),R=setTimeout(function(){R=null},I),He=0;He<le;++He)Ge=_e[He],$.touch0&&$.touch0[2]===Ge.identifier?delete $.touch0:$.touch1&&$.touch1[2]===Ge.identifier&&delete $.touch1;if($.touch1&&!$.touch0&&($.touch0=$.touch1,delete $.touch1),$.touch0)$.touch0[1]=this.__zoom.invert($.touch0[0]);else if($.end(),$.taps===2&&(Ge=Ov(Ge,this),Math.hypot(O[0]-Ge[0],O[1]-Ge[1])<J)){var fe=Mh(this).on("dblclick.zoom");fe&&fe.apply(this,arguments)}}}return G.wheelDelta=function(me){return arguments.length?(u=typeof me=="function"?me:LH(+me),G):u},G.filter=function(me){return arguments.length?(o=typeof me=="function"?me:LH(!!me),G):o},G.touchable=function(me){return arguments.length?(m=typeof me=="function"?me:LH(!!me),G):m},G.extent=function(me){return arguments.length?(s=typeof me=="function"?me:LH([[+me[0][0],+me[0][1]],[+me[1][0],+me[1][1]]]),G):s},G.scaleExtent=function(me){return arguments.length?(h[0]=+me[0],h[1]=+me[1],G):[h[0],h[1]]},G.translateExtent=function(me){return arguments.length?(b[0][0]=+me[0][0],b[1][0]=+me[1][0],b[0][1]=+me[0][1],b[1][1]=+me[1][1],G):[[b[0][0],b[0][1]],[b[1][0],b[1][1]]]},G.constrain=function(me){return arguments.length?(i=me,G):i},G.duration=function(me){return arguments.length?(C=+me,G):C},G.interpolate=function(me){return arguments.length?(S=me,G):S},G.on=function(){var me=_.on.apply(_,arguments);return me===_?G:me},G.clickDistance=function(me){return arguments.length?(q=(me=+me)*me,G):Math.sqrt(q)},G.tapDistance=function(me){return arguments.length?(J=+me,G):J},G}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 O8e=["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 O8e.includes(u==null?void 0:u.nodeName)||m||!!h}function $8e(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=>qe=>($t=>{const Mt=typeof $t;return $t===null?"null":Mt==="object"&&Array.isArray($t)?"array":Mt==="object"&&(gn=yn=$t,(Ot=String).prototype.isPrototypeOf(gn)||((_t=yn.constructor)===null||_t===void 0?void 0:_t.name)===Ot.name)?"string":Mt;var gn,yn,Ot,_t})(qe)===$e,s=$e=>qe=>typeof qe===$e,i=o("string"),u=o("array"),m=s("boolean"),h=$e=>$e===void 0,b=$e=>!(qe=>qe==null)($e),C=s("function"),S=s("number"),_=$e=>()=>$e,N=$e=>$e,O=_(!1),R=_(!0);class I{constructor(qe,$t){this.tag=qe,this.value=$t}static some(qe){return new I(!0,qe)}static none(){return I.singletonNone}fold(qe,$t){return this.tag?$t(this.value):qe()}isSome(){return this.tag}isNone(){return!this.tag}map(qe){return this.tag?I.some(qe(this.value)):I.none()}bind(qe){return this.tag?qe(this.value):I.none()}exists(qe){return this.tag&&qe(this.value)}forall(qe){return!this.tag||qe(this.value)}filter(qe){return!this.tag||qe(this.value)?this:I.none()}getOr(qe){return this.tag?this.value:qe}or(qe){return this.tag?this:qe}getOrThunk(qe){return this.tag?this.value:qe()}orThunk(qe){return this.tag?this:qe()}getOrDie(qe){if(this.tag)return this.value;throw new Error(qe??"Called getOrDie on None")}static from(qe){return b(qe)?I.some(qe):I.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(qe){this.tag&&qe(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}I.singletonNone=new I(!1);const Z=Array.prototype.indexOf,q=Array.prototype.push,J=($e,qe)=>(($t,Mt)=>Z.call($t,Mt))($e,qe)>-1,G=($e,qe)=>{for(let $t=0,Mt=$e.length;$t<Mt;$t++)if(qe($e[$t],$t))return!0;return!1},W=($e,qe)=>{const $t=$e.length,Mt=new Array($t);for(let gn=0;gn<$t;gn++){const yn=$e[gn];Mt[gn]=qe(yn,gn)}return Mt},L=($e,qe)=>{const $t=[];for(let Mt=0,gn=$e.length;Mt<gn;Mt++){const yn=$e[Mt];qe(yn,Mt)&&$t.push(yn)}return $t},pe=($e,qe)=>(($t,Mt,gn)=>{for(let yn=0,Ot=$t.length;yn<Ot;yn++){const _t=$t[yn];if(Mt(_t,yn))return I.some(_t);if(gn(_t,yn))break}return I.none()})($e,qe,O),Ke=($e,qe)=>($t=>{const Mt=[];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);q.apply(Mt,$t[gn])}return Mt})(W($e,qe)),Be=Object.keys,Y=Object.hasOwnProperty,ke=($e,qe)=>{const $t=Be($e);for(let Mt=0,gn=$t.length;Mt<gn;Mt++){const yn=$t[Mt];qe($e[yn],yn)}},et=($e,qe)=>{const $t={};return ke($e,(Mt,gn)=>{const yn=qe(Mt,gn);$t[yn.k]=yn.v}),$t},je=$e=>(qe,$t)=>{$e[$t]=qe},Ce=$e=>((qe,$t)=>{const Mt=[];return ke(qe,(gn,yn)=>{Mt.push($t(gn,yn))}),Mt})($e,N),ce=($e,qe)=>Dt($e,qe)?I.from($e[qe]):I.none(),Dt=($e,qe)=>Y.call($e,qe),me=$e=>{let qe=$e;return{get:()=>qe,set:$t=>{qe=$t}}},be=($e,qe,$t=0,Mt)=>{const gn=$e.indexOf(qe,$t);return gn!==-1&&(!!h(Mt)||gn+qe.length<=Mt)},$=$e=>parseInt($e,10),_e=($e,qe)=>{const $t=$e-qe;return $t===0?0:$t>0?1:-1},le=($e,qe,$t)=>({major:$e,minor:qe,patch:$t}),He=$e=>{const qe=/([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec($e);return qe?le($(qe[1]),$(qe[2]),$(qe[3])):le(0,0,0)},Ge=()=>fe(0,0),fe=($e,qe)=>({major:$e,minor:qe}),Ue={nu:fe,detect:($e,qe)=>{const $t=String(qe).toLowerCase();return $e.length===0?Ge():((Mt,gn)=>{const yn=((_t,Xe)=>{for(let tt=0;tt<_t.length;tt++){const jt=_t[tt];if(jt.test(Xe))return jt}})(Mt,gn);if(!yn)return{major:0,minor:0};const Ot=_t=>Number(gn.replace(yn,"$"+_t));return fe(Ot(1),Ot(2))})($e,$t)},unknown:Ge},yt=($e,qe)=>{const $t=String(qe).toLowerCase();return pe($e,Mt=>Mt.search($t))},Ve=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,pt=$e=>qe=>be(qe,$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]+).*/,Ve],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:[Ve,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:pt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:pt("firefox")},{name:"Safari",versionRegexes:[Ve,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:$e=>(be($e,"safari")||be($e,"mobile/"))&&be($e,"applewebkit")}],mt=[{name:"Windows",search:pt("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:pt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:pt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:pt("linux"),versionRegexes:[]},{name:"Solaris",search:pt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:pt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:pt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],oe={browsers:_(Ie),oses:_(mt)},mn=$e=>{const qe=$e.current,$t=$e.version,Mt=gn=>()=>qe===gn;return{current:qe,version:$t,isEdge:Mt("Edge"),isChromium:Mt("Chromium"),isIE:Mt("IE"),isOpera:Mt("Opera"),isFirefox:Mt("Firefox"),isSafari:Mt("Safari")}},gt=()=>mn({current:void 0,version:Ue.unknown()}),St=mn,Wt=$e=>{const qe=$e.current,$t=$e.version,Mt=gn=>()=>qe===gn;return{current:qe,version:$t,isWindows:Mt("Windows"),isiOS:Mt("iOS"),isAndroid:Mt("Android"),isMacOS:Mt("macOS"),isLinux:Mt("Linux"),isSolaris:Mt("Solaris"),isFreeBSD:Mt("FreeBSD"),isChromeOS:Mt("ChromeOS")}},Et=()=>Wt({current:void 0,version:Ue.unknown()}),te=Wt,ie=($e,qe,$t)=>{const Mt=oe.browsers(),gn=oe.oses(),yn=qe.bind(Xe=>((tt,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 pe(tt,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)}))}))(Mt,Xe)).orThunk(()=>((Xe,tt)=>yt(Xe,tt).map(jt=>{const nn=Ue.detect(jt.versionRegexes,tt);return{current:jt.name,version:nn}}))(Mt,$e)).fold(gt,St),Ot=((Xe,tt)=>yt(Xe,tt).map(jt=>{const nn=Ue.detect(jt.versionRegexes,tt);return{current:jt.name,version:nn}}))(gn,$e).fold(Et,te),_t=((Xe,tt,jt,nn)=>{const Dn=Xe.isiOS()&&/ipad/i.test(jt)===!0,jn=Xe.isiOS()&&!Dn,Yn=Xe.isiOS()||Xe.isAndroid(),Wn=Yn||nn("(pointer:coarse)"),go=Dn||!jn&&Yn&&nn("(min-device-width:768px)"),ko=jn||Yn&&!go,qo=tt.isSafari()&&Xe.isiOS()&&/safari/i.test(jt)===!1,Ms=!ko&&!go&&!qo;return{isiPad:_(Dn),isiPhone:_(jn),isTablet:_(go),isPhone:_(ko),isTouch:_(Wn),isAndroid:Xe.isAndroid,isiOS:Xe.isiOS,isWebView:_(qo),isDesktop:_(Ms)}})(Ot,yn,$e,$t);return{browser:yn,os:Ot,deviceType:_t}},de=$e=>window.matchMedia($e).matches;let X=($e=>{let qe,$t=!1;return(...Mt)=>($t||($t=!0,qe=$e.apply(null,Mt)),qe)})(()=>ie(window.navigator.userAgent,I.from(window.navigator.userAgentData),de));const Se=()=>X(),Pe=$e=>{if($e==null)throw new Error("Node cannot be null or undefined");return{dom:$e}},Fe=Pe,vt=($e,qe)=>$e.dom===qe.dom,Qe=($e,qe)=>{const $t=$e.dom;if($t.nodeType!==1)return!1;{const Mt=$t;if(Mt.matches!==void 0)return Mt.matches(qe);if(Mt.msMatchesSelector!==void 0)return Mt.msMatchesSelector(qe);if(Mt.webkitMatchesSelector!==void 0)return Mt.webkitMatchesSelector(qe);if(Mt.mozMatchesSelector!==void 0)return Mt.mozMatchesSelector(qe);throw new Error("Browser lacks native selectors")}},wt=$e=>qe=>($t=>$t.dom.nodeType)(qe)===$e,Ft=wt(1),bn=wt(3),Tt=wt(11),Ht=$e=>Fe($e.dom.host),vn=($e,qe,$t)=>{((Mt,gn,yn)=>{if(!(i(yn)||m(yn)||S(yn)))throw console.error("Invalid call to Attribute.set. Key ",gn,":: Value ",yn,":: Element ",Mt),new Error("Attribute value was not simple");Mt.setAttribute(gn,yn+"")})($e.dom,qe,$t)},kn=($e,qe)=>{const $t=$e.dom.getAttribute(qe);return $t===null?void 0:$t},Eo=($e,qe)=>{$e.dom.removeAttribute(qe)},to=$e=>{const qe=bn($e)?$e.dom.parentNode:$e.dom;if(qe==null||qe.ownerDocument===null)return!1;const $t=qe.ownerDocument;return(yn=>{const Ot=(Xe=>Fe(Xe.dom.getRootNode()))(yn);return Tt(_t=Ot)&&b(_t.dom.host)?I.some(Ot):I.none();var _t})(Fe(qe)).fold(()=>$t.body.contains(qe),(Mt=to,gn=Ht,yn=>Mt(gn(yn))));var Mt,gn},It=($e,qe)=>{const $t=$e.dom,Mt=window.getComputedStyle($t).getPropertyValue(qe);return Mt!==""||to($e)?Mt:dn($t,qe)},dn=($e,qe)=>($t=>$t.style!==void 0&&C($t.style.getPropertyValue))($e)?$e.style.getPropertyValue(qe):"",an=($e,qe)=>{const $t=kn($e,qe);return $t===void 0||$t===""?[]:$t.split(" ")},Bn=($e,qe,$t)=>{let Mt=$e.dom;const gn=C($t)?$t:O;for(;Mt.parentNode;){Mt=Mt.parentNode;const yn=Fe(Mt);if(qe(yn))return I.some(yn);if(gn(yn))break}return I.none()},_o=($e,qe,$t)=>((Mt,gn,yn,Ot,_t)=>Ot(yn)?I.some(yn):C(_t)&&_t(yn)?I.none():gn(yn,Ot,_t))(0,Bn,$e,qe,$t),Do=$e=>$e.dom.classList!==void 0,ms=$e=>an($e,"class"),Co=($e,qe)=>{Do($e)?$e.dom.classList.remove(qe):(($t,Mt)=>{((gn,yn,Ot)=>{const _t=L(an(gn,yn),Xe=>Xe!==Ot);_t.length>0?vn(gn,yn,_t.join(" ")):Eo(gn,yn)})($t,"class",Mt)})($e,qe),($t=>{(Do($t)?$t.dom.classList:ms($t)).length===0&&Eo($t,"class")})($e)},Is=($e,qe)=>{$e.dispatch("FormatPainterToggle",{state:qe})};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 qe,$t;qe=Fe($e.getBody()),$t="tox-cursor-format-painter",Do(qe)?qe.dom.classList.add($t):((Mt,gn)=>{((yn,Ot,_t)=>{const Xe=an(yn,Ot).concat([_t]);vn(yn,Ot,Xe.join(" "))})(Mt,"class",gn)})(qe,$t)},vr=($e,qe)=>{($t=>{Co(Fe($t.getBody()),"tox-cursor-format-painter")})($e),qe.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,qe)=>ce(qe,"selector").exists($t=>{const Mt=$e.getBody(),gn=$e.selection.getStart(),yn=$e.dom.getParents(gn,R,Mt),Ot=$e.selection.getSelectedBlocks();return $e.dom.is([...yn,...Ot],$t)}),Dr=$e=>$e.length>1&&$e.charAt(0)==="%",ps=($e,qe)=>ce($e,qe).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,qe=>`-${qe[0].toLowerCase()}`),Gt=($e,qe,$t)=>{const Mt=$e.formatter,gn=((Xe,tt)=>G(Xe.formatter.get(tt),jt=>((nn,Dn)=>Dt(Dn,"inline")&&!br(nn,Dn))(Xe,jt)))($e,$t.formatName),yn=((Xe,tt,jt)=>G(tt.get(jt),nn=>((Dn,jn)=>Dt(jn,"block")||br(Dn,jn))(Xe,nn)))($e,Mt,$t.formatName),Ot=(_t=$t.formatName,J(["formatpainter_borderstyle","formatpainter_bordercolor","formatpainter_backgroundcolor"],_t));var _t;(qe.table&&Ot||gn||qe.block&&yn&&!Ot)&&Mt.apply($t.formatName,$t.substitutedVariables)},Un=$e=>{const qe=$e.selection,$t=qe.getRng(),Mt=Fe($e.getBody()),gn=(_t=>L(_t.selection.getSelectedBlocks().map(Fe),Ds))($e),yn=$t.collapsed&&gn.length,Ot=gn.length&&!((_t,Xe)=>{const tt=jn=>vt(jn,Xe);return(jt=_o(Fe(_t.getStart()),po,tt),nn=_o(Fe(_t.getEnd()),po,tt),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})(qe,Mt);return gn.length>1||yn||Ot},uo=$e=>$e.options.get("formatpainter_ignored_formats"),Fo=($e,qe)=>{return qe==="class"?(gn=>Do(gn)?(yn=>{const Ot=yn.dom.classList,_t=new Array(Ot.length);for(let Xe=0;Xe<Ot.length;Xe++){const tt=Ot.item(Xe);tt!==null&&(_t[Xe]=tt)}return _t})(gn):ms(gn))($e).filter(gn=>!/^(mce-.*)/.test(gn)).join(" "):($t=$e,Mt=qe,I.from(kn($t,Mt))).getOr("");var $t,Mt},ss=$e=>((qe,$t)=>{const Mt={},gn={};return((yn,Ot,_t,Xe)=>{ke(yn,(tt,jt)=>{(Ot(tt,jt)?_t:Xe)(tt,jt)})})(qe,$t,je(Mt),je(gn)),{t:Mt,f:gn}})($e,qe=>{return($t=qe).length>1&&$t.charAt(0)==="%";var $t}).t,ur=($e,qe)=>($t=>{const Mt=uo($t);return Be($t.formatter.get()).filter(gn=>!J(Mt,gn))})($e).filter($t=>{const Mt=((gn,yn)=>G(gn.formatter.get(yn),Ot=>(_t=>{const Xe=ps(_t,"styles").exists(jt=>G(Ce(jt),Dr)),tt=ps(_t,"attributes").exists(jt=>G(Ce(jt),Dr));return Xe||tt})(Ot)))($e,$t);return $e.formatter.matchNode(qe.dom,$t,{},Mt)}),dr=($e,qe)=>{const $t=W($e.dom.getParents(qe,R),Fe);return Ke(L($t,Ft),Mt=>Ke(ur($e,Mt),gn=>((yn,Ot,_t)=>{return(Xe=yn.get(Ot),(tt=>0<tt.length?I.some(tt[0]):I.none())(Xe)).bind(tt=>((jt,nn)=>{const Dn=ps(jt,"styles").map(Wn=>{return go=nn,ko=ss(Wn),et(ko,(qo,Ms)=>({k:qo.slice(1,qo.length),v:It(go,Nt(Ms))}));var go,ko}),jn=ps(jt,"attributes").map(Wn=>{return go=nn,ko=ss(Wn),et(ko,(qo,Ms)=>({k:qo.slice(1,qo.length),v:Fo(go,Ms)}));var go,ko}),Yn={...Dn.getOr({}),...jn.getOr({})};return Ce(Yn).every(Wn=>Wn!=="")?I.some(Yn):I.none()})(tt,_t)).map(tt=>({kind:Lo.SubstitutionSchema,formatName:Ot,substitutedVariables:tt}));var Xe})($e.formatter,gn,Mt).toArray()))},or=$e=>(qe=>pe(Ce(js),$t=>qe.queryCommandState($t)))($e).map(qe=>({kind:Lo.ListSchema,command:qe})),at=($e,qe)=>$e.getParent(qe,"TABLE")?Hs.Table:Hs.Unspecified,ot=($e,qe,$t)=>{$e.addCommand("mceToggleFormatPainter",()=>{((Mt,gn)=>{gn.get()===pn.Application?vr(Mt,gn):((yn,Ot)=>{const _t=Se(),Xe=me(!1);Tr(yn),Ot.set(pn.Application),Is(yn,!0),yn.execCommand("mceRetrieveFormats");const tt=()=>{yn.execCommand("mcePaintFormats"),vr(yn,Ot)},jt=()=>{Ot.get()===pn.Application&&tt(),Yn()},nn=Wn=>{Ot.get()===pn.Application&&(Wn.type==="touchcancel"&&_t.os.isAndroid()?yn.once("contextmenu",tt):Xe.get()?tt():yn.once("selectionchange",tt)),Yn()},Dn=Wn=>{Wn.keyCode===27&&(vr(yn,Ot),Yn())},jn=Wn=>{Xe.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)}})(Mt,gn)})($e,qe)}),$e.addCommand("mcePaintFormats",()=>{$e.selection.isEditable()&&$e.undoManager.transact(()=>{((Mt,gn)=>{((Ot,_t)=>{Ot.formatter.remove("formatpainter_removeformat"),_t===Hs.Table&&(Xe=>{for(let jt=0,nn=Xe.length;jt<nn;jt++)tt=Xe[jt],Ot.formatter.remove(tt);var tt})(["formatpainter_borderstyle","formatpainter_bordercolor","formatpainter_backgroundcolor"]),Un(Ot)&&Ot.execCommand("RemoveList")})(Mt,gn.context);const yn=(Ot=>{const _t=Ot.selection.getStart(),Xe=Ot.selection.getRng().collapsed,tt=Ot.dom.select("td[data-mce-selected]").length>0,jt=!!Ot.dom.getParent(_t,"TABLE");return{inline:!0,table:Xe&&jt||tt,block:Xe||(nn=Ot.selection,nn.getSelectedBlocks().length>1)||tt};var nn})(Mt);gn.schemas.forEach(Ot=>{switch(Ot.kind){case Lo.ListSchema:((_t,Xe,tt)=>{tt.block&&_t.execCommand(Xe.command)})(Mt,Ot,yn);break;case Lo.SubstitutionSchema:Gt(Mt,yn,Ot)}})})($e,$t.get())})}),$e.addCommand("mceRetrieveFormats",()=>{$t.set((Mt=>{const gn=Mt.dom,yn=Mt.selection.getStart();return{schemas:[...or(Mt).toArray(),...dr(Mt,yn)],context:at(gn,yn)}})($e))})};tinymce.PluginManager.add("formatpainter",$e=>{if(((Mt,gn)=>!!Mt&&((yn,Ot)=>{const _t=_e(yn.major,Ot.major);if(_t!==0)return _t;const Xe=_e(yn.minor,Ot.minor);if(Xe!==0)return Xe;const tt=_e(yn.patch,Ot.patch);return tt!==0?tt:0})((yn=>He((Ot=>[Ot.majorVersion,Ot.minorVersion].join(".").split(".").slice(0,3).join("."))(yn)))(Mt),He(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 qe=me(pn.Retrival),$t=me({schemas:[],context:Hs.Unspecified});(Mt=>{(0,Mt.options.register)("formatpainter_ignored_formats",{processor:"string[]",default:"link,address,removeformat,formatpainter_removeformat".split(",")})})($e),(Mt=>{Mt.on("PreInit",()=>{ke(_s,(gn,yn)=>{Mt.formatter.get(yn)||Mt.formatter.register(yn,gn)})})})($e),ot($e,qe,$t),(Mt=>{Mt.ui.registry.addToggleButton("formatpainter",{active:!1,icon:"format-painter",tooltip:"Format painter",onAction:()=>Mt.execCommand("mceToggleFormatPainter"),onSetup:gn=>{const yn=Ot=>{gn.setActive(Ot.state)};return Mt.on("FormatPainterToggle",yn),()=>Mt.off("FormatPainterToggle",yn)}})})($e),((Mt,gn)=>{Mt.ui.registry.addToggleMenuItem("formatpainter",{active:!1,icon:"format-painter",text:"Format painter",onAction:()=>Mt.execCommand("mceToggleFormatPainter"),onSetup:yn=>{const Ot=_t=>{yn.setActive(_t.state)};return yn.setActive(gn.get()===pn.Application),Mt.on("FormatPainterToggle",Ot),()=>Mt.off("FormatPainterToggle",Ot)}})})($e,qe),(Mt=>{Mt.addShortcut("Meta+alt+C","",()=>{Mt.execCommand("mceRetrieveFormats")}),Mt.addShortcut("Meta+alt+V","",()=>{Mt.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,Z;i.value&&((Z=(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||Z.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,Z,q,J;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`,(Z=m.value)==null||Z.appendChild(O),(q=b==null?void 0:b.cssConfig)!=null&&q.links&&b.cssConfig.links.forEach(G=>{var L;const W=document.createElement("link");W.rel="stylesheet",W.href=G,(L=m.value)==null||L.appendChild(W)}),(J=b==null?void 0:b.cssConfig)!=null&&J.styles&&b.cssConfig.styles.forEach(G=>{var L;const W=document.createElement("style");W.textContent=G,(L=m.value)==null||L.appendChild(W)})}),d.onUnmounted(()=>{document.removeEventListener("click",C)}),i({focus:()=>{h.value=!0},getInnerHTML:()=>{var _;return((_=m.value)==null?void 0:_.innerHTML)||""}}),{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&&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 Z=Afe(O);Z?(R=Z,I=((S=Z.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,Z;const O=(I=h==null?void 0:h.value)==null?void 0:I.some(q=>{var J;return(q==null?void 0:q.id)===((J=s==null?void 0:s.node)==null?void 0:J.id)}),R=(Z=d.toValue(i))==null?void 0:Z.find(q=>{var J;return(q==null?void 0:q.id)===((J=s==null?void 0:s.node)==null?void 0:J.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"),N(),(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,Z,q;(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"),(Z=s.node.element)==null||Z.classList.remove("activated"),(q=s.node.element)==null||q.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,disabledNodes:h}=j0(),b=d.ref(!1),C=d.ref({x:0,y:0}),S=d.ref({x:0,y:0}),_=d.ref({left:0,top:0,width:0,height:0}),N=d.ref(null),O=Y=>{const ke=Y.closest(".node-item-td")||Y.closest(".node-item");if(ke!==null){let et=[];if(ke.classList.contains("node-selected"))return;const je=ke.getAttribute("id");if(je&&m.value){const Ce=m.value.find(ce=>ce.id===je);Ce&&(et=[Ce])}et=L(et),s(et)}},R=Y=>{var Ce;if(Y.button===2&&O(Y==null?void 0:Y.target),Y.button!==0||(b.value=!0,!N.value))return;const ke=(Ce=i==null?void 0:i.value)==null?void 0:Ce.getBoundingClientRect();if(!ke)return;const et=Y.clientX-(ke==null?void 0:ke.left),je=Y.clientY-(ke==null?void 0:ke.top);C.value={x:et,y:je},S.value={x:et,y:je},G(Y),pe(),N.value.style.display="block",window.addEventListener("mousemove",I),window.addEventListener("wheel",Z),window.addEventListener("mouseup",q)},I=dte(Y=>{var ke;if(b.value){const et=(ke=i==null?void 0:i.value)==null?void 0:ke.getBoundingClientRect();if(!et)return;const je=Y.clientX-(et==null?void 0:et.left),Ce=Y.clientY-(et==null?void 0:et.top);S.value={x:je,y:Ce},pe()}},16),Z=dte(Y=>{b.value&&setTimeout(()=>{var Ce;const ke=(Ce=i==null?void 0:i.value)==null?void 0:Ce.getBoundingClientRect();if(!ke)return;const et=Y.clientX-(ke==null?void 0:ke.left),je=Y.clientY-(ke==null?void 0:ke.top);S.value={x:et,y:je},pe()},0)},16),q=Y=>{Y.button===0&&(b.value=!1,N.value&&(pe(),N.value.style.display="none",window.removeEventListener("mousemove",I),window.removeEventListener("wheel",Z),window.removeEventListener("mouseup",q)))},J=A6e(),G=Y=>{var et,je;let ke=[];if(Y.button===0&&(Y!=null&&Y.target)){const Ce=((et=Y==null?void 0:Y.target)==null?void 0:et.closest(".node-item-td"))||((je=Y==null?void 0:Y.target)==null?void 0:je.closest(".node-item"));if(Ce!==null){const ce=Ce.getAttribute("id");if(ce&&m.value){const Dt=m.value.find(me=>me.id===ce);Dt&&(J.value?o.value.some(me=>WA(me)===WA(Dt))?ke=o.value.filter(be=>WA(be)!==WA(Dt)):ke=[...o.value,Dt]:Dt&&(ke=[Dt]))}}else J.value&&(ke=[...o.value]);ke=L(ke),s(ke)}},W=()=>{var Dt;if(!i.value||!(_.value.width>3||_.value.height>3))return;let Y=[];const ke=(Dt=i==null?void 0:i.value)==null?void 0:Dt.getBoundingClientRect(),et=_.value.left+(ke==null?void 0:ke.left),je=_.value.top+(ke==null?void 0:ke.top),Ce={left:_.value.left+(ke==null?void 0:ke.left),right:et+_.value.width,top:_.value.top+(ke==null?void 0:ke.top),bottom:je+_.value.height};if(i.value.querySelectorAll("*").forEach(me=>{const be=me.getBoundingClientRect();if(!Ce)return;const $={left:be.left,right:be.right,top:be.top,bottom:be.bottom};if($.right>Ce.left&&$.left<Ce.right&&$.bottom>Ce.top&&$.top<Ce.bottom){const _e=me.getAttribute("id");if(_e&&m.value){const le=m.value.find(He=>He.id===_e);le&&(Y=[...Y,le])}}}),Y=L(Y),J.value){const me=new Set(o.value.map($=>WA($))),be=Y.filter($=>!me.has(WA($)));s([...o.value,...be])}else s(Y)},L=Y=>{let ke=[];if(Y.length>0&&(ke=[...Y]),h&&h.value&&h.value.length>0){const et=new Set(h.value.map(je=>je.id).filter(Boolean));ke=ke.filter(je=>je.id?!et.has(je.id):!0)}return ke},pe=dte(()=>{if(!N.value||!i.value)return;const{x:Y,y:ke}=C.value,{x:et,y:je}=S.value,Ce=Math.min(Y,et),ce=Math.min(ke,je),Dt=Math.abs(Y-et),me=Math.abs(ke-je);_.value={left:Ce,top:ce,width:Dt,height:me}},16),Ke=Y=>{if(!N.value)return;const{left:ke,top:et,width:je,height:Ce}=d.toValue(Y);N.value.style.left=`${ke}px`,N.value.style.top=`${et}px`,N.value.style.width=`${je}px`,N.value.style.height=`${Ce}px`},Be=()=>{if(!i.value)return;i.value.addEventListener("mousedown",R);const Y=document.getElementById(`select_area_${u}`);if(Y){N.value=Y;return}const ke=document.createElement("div");ke.id=`select_area_${u}`,ke.style.position="absolute",ke.style.border="1px solid #1677ff",ke.style.backgroundColor="rgba(22, 119, 255, 0.05)",ke.style.pointerEvents="none",ke.style.display="none",i.value.appendChild(ke),N.value=ke};return d.watch(_,(Y,ke)=>{na(Y,ke)||(Ke(Y),b.value&&W())},{deep:!0}),d.watch(()=>i.value,Y=>{d.toValue(Y)&&Be()},{immediate:!0}),d.onUnmounted(()=>{i.value&&i.value.removeEventListener("mousedown",R)}),{isSelecting:b,selectionBox:N}}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 Z=R==null?void 0:R.id;return Z||(Z=m2(),I.id=Z),I!=null&&I.groupKey||(I.groupKey=_),I}),O=[...o.value];N.forEach(R=>{const I=O.findIndex(Z=>Z.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 q,J;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=((q=s.value)==null?void 0:q.getRootNode()).getSelection(),_=(J=s.value)==null?void 0:J.querySelectorAll('[contenteditable="true"]');_==null||_.forEach(G=>{G.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=G=>{G.preventDefault()};b.addEventListener("input",I),b.addEventListener("paste",I),b.addEventListener("drop",I),b.addEventListener("keydown",G=>{var W,L,pe,Ke;if(((W=document.activeElement)==null?void 0:W.shadowRoot)===((L=s.value)==null?void 0:L.getRootNode())&&!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(G.key)){if(G.key==="Backspace"||G.key==="Delete"){const Be=S==null?void 0:S.getRangeAt(0);if(b.blur(),(Be==null?void 0:Be.startOffset)===0){const Y=Be.startContainer;if(Y.nodeType===Node.TEXT_NODE){const ke=Y.previousSibling;if(ke&&ke.nodeType===Node.ELEMENT_NODE&&ke.classList.contains("node-item")){const et=ke.getAttribute("id");et&&o(et),(pe=Y.parentElement)==null||pe.normalize();return}}else if(Y.nodeType===Node.ELEMENT_NODE){const ke=Y.previousSibling;if(ke&&ke.nodeType===Node.ELEMENT_NODE&&ke.classList.contains("node-item")){const et=ke.getAttribute("id");et&&o(et),(Ke=Y.parentElement)==null||Ke.normalize();return}}}}G.preventDefault()}});const Z=()=>{b==null||b.normalize(),R.disconnect(),b.removeEventListener("input",I),b.removeEventListener("paste",I),b.removeEventListener("drop",I),b.removeEventListener("blur",Z),b.setAttribute("contenteditable","false")};b.addEventListener("blur",Z)},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 ke,et;const q=_.getSelection();if(q.rangeCount===0)return null;const J=q.getRangeAt(0),G=J.startContainer;let W=0,L=-1,pe=0,Ke=[];const Be=G.nodeType===Node.TEXT_NODE?G.parentNode:G;s.value=Be;const Y=Array.from(Be.childNodes);if(G.nodeType===Node.TEXT_NODE){W=J.startOffset,L=-1;for(let be=0;be<Y.length;be++)if(Y[be]===G){L=be;break}Ke=Y.slice(0,L);const je=[];let Ce=!1;for(let be=0;be<Ke.length;be++){const $=Ke[be];if((ke=$==null?void 0:$.classList)!=null&&ke.contains("node-item")){Ce=!0;continue}else if($.nodeType===Node.TEXT_NODE){const _e=je==null?void 0:je[je.length-1];Ce&&typeof _e=="string"?je[je.length-1]=_e+($==null?void 0:$.data):je.push($==null?void 0:$.data),Ce=!1}else je.push($),Ce=!1}const ce=Ke==null?void 0:Ke[Ke.length-1],Dt=je==null?void 0:je[je.length-1];pe=je==null?void 0:je.filter(be=>{var $;return!(($=be==null?void 0:be.classList)!=null&&$.contains("node-item"))}).length,(et=ce==null?void 0:ce.classList)!=null&&et.contains("node-item")&&typeof Dt=="string"&&pe--;const me=je==null?void 0:je[je.length-1];typeof me=="string"&&(W+=(me==null?void 0:me.length)||0)}else{const je=Y==null?void 0:Y.filter(Ce=>{var ce;return(ce=Ce==null?void 0:Ce.classList)==null?void 0:ce.contains("node-item")}).length;W=J.startOffset-je}return{currentIndex:Math.max(pe,0),previousElements:Ke,startOffset:Math.max(W,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",Z=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(Z.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",Z="date",q="Invalid Date",J=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,G=/\[([^\]]+)]|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,W={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(me){var be=["th","st","nd","rd"],$=me%100;return"["+me+(be[($-20)%10]||be[$]||be[0])+"]"}},L=function(me,be,$){var _e=String(me);return!_e||_e.length>=be?me:""+Array(be+1-_e.length).join($)+me},pe={s:L,z:function(me){var be=-me.utcOffset(),$=Math.abs(be),_e=Math.floor($/60),le=$%60;return(be<=0?"+":"-")+L(_e,2,"0")+":"+L(le,2,"0")},m:function me(be,$){if(be.date()<$.date())return-me($,be);var _e=12*($.year()-be.year())+($.month()-be.month()),le=be.clone().add(_e,O),He=$-le<0,Ge=be.clone().add(_e+(He?-1:1),O);return+(-(_e+($-le)/(He?le-Ge:Ge-le))||0)},a:function(me){return me<0?Math.ceil(me)||0:Math.floor(me)},p:function(me){return{M:O,y:I,w:N,d:_,D:Z,h:S,m:C,s:b,ms:h,Q:R}[me]||String(me||"").toLowerCase().replace(/s$/,"")},u:function(me){return me===void 0}},Ke="en",Be={};Be[Ke]=W;var Y="$isDayjsObject",ke=function(me){return me instanceof ce||!(!me||!me[Y])},et=function me(be,$,_e){var le;if(!be)return Ke;if(typeof be=="string"){var He=be.toLowerCase();Be[He]&&(le=He),$&&(Be[He]=$,le=He);var Ge=be.split("-");if(!le&&Ge.length>1)return me(Ge[0])}else{var fe=be.name;Be[fe]=be,le=fe}return!_e&&le&&(Ke=le),le||!_e&&Ke},je=function(me,be){if(ke(me))return me.clone();var $=typeof be=="object"?be:{};return $.date=me,$.args=arguments,new ce($)},Ce=pe;Ce.l=et,Ce.i=ke,Ce.w=function(me,be){return je(me,{locale:be.$L,utc:be.$u,x:be.$x,$offset:be.$offset})};var ce=function(){function me($){this.$L=et($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[Y]=!0}var be=me.prototype;return be.parse=function($){this.$d=function(_e){var le=_e.date,He=_e.utc;if(le===null)return new Date(NaN);if(Ce.u(le))return new Date;if(le instanceof Date)return new Date(le);if(typeof le=="string"&&!/Z$/i.test(le)){var Ge=le.match(J);if(Ge){var fe=Ge[2]-1||0,Ue=(Ge[7]||"0").substring(0,3);return He?new Date(Date.UTC(Ge[1],fe,Ge[3]||1,Ge[4]||0,Ge[5]||0,Ge[6]||0,Ue)):new Date(Ge[1],fe,Ge[3]||1,Ge[4]||0,Ge[5]||0,Ge[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 Ce},be.isValid=function(){return this.$d.toString()!==q},be.isSame=function($,_e){var le=je($);return this.startOf(_e)<=le&&le<=this.endOf(_e)},be.isAfter=function($,_e){return je($)<this.startOf(_e)},be.isBefore=function($,_e){return this.endOf(_e)<je($)},be.$g=function($,_e,le){return Ce.u($)?this[_e]:this.set(le,$)},be.unix=function(){return Math.floor(this.valueOf()/1e3)},be.valueOf=function(){return this.$d.getTime()},be.startOf=function($,_e){var le=this,He=!!Ce.u(_e)||_e,Ge=Ce.p($),fe=function(mn,gt){var St=Ce.w(le.$u?Date.UTC(le.$y,gt,mn):new Date(le.$y,gt,mn),le);return He?St:St.endOf(_)},Ue=function(mn,gt){return Ce.w(le.toDate()[mn].apply(le.toDate("s"),(He?[0,0,0,0]:[23,59,59,999]).slice(gt)),le)},yt=this.$W,Ve=this.$M,pt=this.$D,Ie="set"+(this.$u?"UTC":"");switch(Ge){case I:return He?fe(1,0):fe(31,11);case O:return He?fe(1,Ve):fe(0,Ve+1);case N:var mt=this.$locale().weekStart||0,oe=(yt<mt?yt+7:yt)-mt;return fe(He?pt-oe:pt+(6-oe),Ve);case _:case Z: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($,_e){var le,He=Ce.p($),Ge="set"+(this.$u?"UTC":""),fe=(le={},le[_]=Ge+"Date",le[Z]=Ge+"Date",le[O]=Ge+"Month",le[I]=Ge+"FullYear",le[S]=Ge+"Hours",le[C]=Ge+"Minutes",le[b]=Ge+"Seconds",le[h]=Ge+"Milliseconds",le)[He],Ue=He===_?this.$D+(_e-this.$W):_e;if(He===O||He===I){var yt=this.clone().set(Z,1);yt.$d[fe](Ue),yt.init(),this.$d=yt.set(Z,Math.min(this.$D,yt.daysInMonth())).$d}else fe&&this.$d[fe](Ue);return this.init(),this},be.set=function($,_e){return this.clone().$set($,_e)},be.get=function($){return this[Ce.p($)]()},be.add=function($,_e){var le,He=this;$=Number($);var Ge=Ce.p(_e),fe=function(Ve){var pt=je(He);return Ce.w(pt.date(pt.date()+Math.round(Ve*$)),He)};if(Ge===O)return this.set(O,this.$M+$);if(Ge===I)return this.set(I,this.$y+$);if(Ge===_)return fe(1);if(Ge===N)return fe(7);var Ue=(le={},le[C]=u,le[S]=m,le[b]=i,le)[Ge]||1,yt=this.$d.getTime()+$*Ue;return Ce.w(yt,this)},be.subtract=function($,_e){return this.add(-1*$,_e)},be.format=function($){var _e=this,le=this.$locale();if(!this.isValid())return le.invalidDate||q;var He=$||"YYYY-MM-DDTHH:mm:ssZ",Ge=Ce.z(this),fe=this.$H,Ue=this.$m,yt=this.$M,Ve=le.weekdays,pt=le.months,Ie=le.meridiem,mt=function(gt,St,Wt,Et){return gt&&(gt[St]||gt(_e,He))||Wt[St].slice(0,Et)},oe=function(gt){return Ce.s(fe%12||12,gt,"0")},mn=Ie||function(gt,St,Wt){var Et=gt<12?"AM":"PM";return Wt?Et.toLowerCase():Et};return He.replace(G,function(gt,St){return St||function(Wt){switch(Wt){case"YY":return String(_e.$y).slice(-2);case"YYYY":return Ce.s(_e.$y,4,"0");case"M":return yt+1;case"MM":return Ce.s(yt+1,2,"0");case"MMM":return mt(le.monthsShort,yt,pt,3);case"MMMM":return mt(pt,yt);case"D":return _e.$D;case"DD":return Ce.s(_e.$D,2,"0");case"d":return String(_e.$W);case"dd":return mt(le.weekdaysMin,_e.$W,Ve,2);case"ddd":return mt(le.weekdaysShort,_e.$W,Ve,3);case"dddd":return Ve[_e.$W];case"H":return String(fe);case"HH":return Ce.s(fe,2,"0");case"h":return oe(1);case"hh":return oe(2);case"a":return mn(fe,Ue,!0);case"A":return mn(fe,Ue,!1);case"m":return String(Ue);case"mm":return Ce.s(Ue,2,"0");case"s":return String(_e.$s);case"ss":return Ce.s(_e.$s,2,"0");case"SSS":return Ce.s(_e.$ms,3,"0");case"Z":return Ge}return null}(gt)||Ge.replace(":","")})},be.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},be.diff=function($,_e,le){var He,Ge=this,fe=Ce.p(_e),Ue=je($),yt=(Ue.utcOffset()-this.utcOffset())*u,Ve=this-Ue,pt=function(){return Ce.m(Ge,Ue)};switch(fe){case I:He=pt()/12;break;case O:He=pt();break;case R:He=pt()/3;break;case N:He=(Ve-yt)/6048e5;break;case _:He=(Ve-yt)/864e5;break;case S:He=Ve/m;break;case C:He=Ve/u;break;case b:He=Ve/i;break;default:He=Ve}return le?He:Ce.a(He)},be.daysInMonth=function(){return this.endOf(O).$D},be.$locale=function(){return Be[this.$L]},be.locale=function($,_e){if(!$)return this.$L;var le=this.clone(),He=et($,_e,!0);return He&&(le.$L=He),le},be.clone=function(){return Ce.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()},me}(),Dt=ce.prototype;return je.prototype=Dt,[["$ms",h],["$s",b],["$m",C],["$H",S],["$W",_],["$M",O],["$y",I],["$D",Z]].forEach(function(me){Dt[me[1]]=function(be){return this.$g(be,me[0],me[1])}}),je.extend=function(me,be){return me.$i||(me(be,ce,je),me.$i=!0),je},je.locale=et,je.isDayjs=ke,je.unix=function(me){return je(1e3*me)},je.en=Be[Ke],je.Ls=Be,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=C=>{if(!C||typeof C!="string")return[];const _=new DOMParser().parseFromString(C,"text/html");return Array.from(_.querySelectorAll("td")).filter(R=>{var I;return!((I=R.textContent)!=null&&I.trim())})},h=async C=>{var N,O;const S=await((O=(N=s==null?void 0:s.find(R=>{var I;return((I=R.value)==null?void 0:I.toLowerCase())==="text"}))==null?void 0:N.getDefaultProps)==null?void 0:O.call(N))||{},_=C.map(R=>{let I=R==null?void 0:R.id;return I||(I=m2()),{id:I,nodeType:"Text",label:"文本",props:{...S},...R}});return u(_),_},b=()=>{var Z,q;const C=m(d.toValue(o)),S=Bfe().valueOf(),_=d.toValue(i),N=_.filter(J=>wne(J)),O=_.filter(J=>!wne(J)),I=[...(q=(Z=C.map(J=>({nodePath:$U(J),startOffset:0,subNodeSort:0,insertTime:S})))==null?void 0:Z.filter(J=>!!(N==null?void 0:N.find(W=>{var L;return(L=W.nodePath)==null?void 0:L.includes(J.nodePath)}))))==null?void 0:q.map(J=>{const G=N==null?void 0:N.find(W=>W.nodePath===J.nodePath&&!(W!=null&&W.startOffset));return{...J,...G}}),...O];return h(I)};return d.onMounted(()=>{b()}),b}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 Z=(R=N==null?void 0:N.element)==null?void 0:R.getAttribute("id");Z&&_.push(Z)}else{const Z=(I=N==null?void 0:N.element)==null?void 0:I.getAttribute("id");Z&&_.push(Z)}}),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,{expose:s}){const{nodes:i}=j0(),{uiReady:u,renderNodes:m}=ef();Roe(),$6e(i),Dfe(),Boe(),B6e(),O6e(),N6e();const h=M6e();return MU(),s({initNodes:h}),(b,C)=>d.unref(u)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(m),S=>(d.openBlock(),d.createBlock(DU,{key:S==null?void 0:S.id,node:S},{default:d.withCtx(_=>[d.renderSlot(b.$slots,"nodeItem",{node:_==null?void 0:_.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(Z=>d.toValue(Z==null?void 0:Z.activated)))==null?void 0:R.filter(Z=>d.toValue(Z.isMounted)))==null?void 0:I.filter(Z=>d.toValue(Z==null?void 0:Z.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),Z=d.ref(!1),q=d.computed(()=>u.htmlRenderRef),J=d.computed({get:()=>(u.selectedNodes||[]).map(Ke=>{var ke;let Be=(ke=u==null?void 0:u.nodes)==null?void 0:ke.find(et=>(et==null?void 0:et.id)===(Ke==null?void 0:Ke.id)),Y=Ke!=null&&Ke.element?Ke==null?void 0:Ke.element:m6e(Ke==null?void 0:Ke.id,h.value);return{...Be||{},...Ke,element:Y}}),set:Ke=>{const Be=Ke.map(({element:Y,...ke})=>{var je;return{...((je=u==null?void 0:u.nodes)==null?void 0:je.find(Ce=>(Ce==null?void 0:Ce.id)===(ke==null?void 0:ke.id)))||{},...ke}});m("update:selectedNodes",Be)}}),G=d.computed(()=>{var Y,ke,et;const Ke=(ke=(Y=d.toValue(R))==null?void 0:Y.filter(je=>d.toValue(je==null?void 0:je.activated)))==null?void 0:ke.filter(je=>d.toValue(je.isMounted)),Be=((et=d.toValue(u==null?void 0:u.nodesGroups)||[])==null?void 0:et.map(je=>({...je||{},activated:!0})))||[];return Nfe([...Be,...Ke])}),W=d.ref([]),L=Ke=>{var ke;const Be=Ke.map(({...et})=>{var Dt;let je=(Dt=C.value)==null?void 0:Dt.find(me=>(me==null?void 0:me.id)===(et==null?void 0:et.id));const{element:Ce,...ce}={...je||{},...et};return ce}),Y=(ke=J.value)==null?void 0:ke.map(({element:et,...je})=>je);na(Be,Y)||(J.value=Be,m("onSelectedNodes",Be))},pe=d.computed(()=>d.toValue(u==null?void 0:u.nodesGroups));return s({setSelectedNodes:L}),d.provide(Tfe,{containerRef:h,htmlRenderRef:q,contextMenuRef:b,focusedElement:S,currentRenderNodes:W,cursorPosition:_,focusedNodeIndex:N,preNodeNumber:O,currentNodes:G,selectedNodes:J,setSelectedNodes:L,renderNodes:C,uiReady:I,isFocused:Z,nodesGroups:pe}),(Ke,Be)=>d.renderSlot(Ke.$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},Z=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),Z.value={focusedElement:d.toValue(b),cursorPosition:d.toValue(C),focusedNodeIndex:d.toValue(S),preNodeNumber:d.toValue(_)}}))},{immediate:!0,deep:!0});const{editNodes:q}=IB(),J=async Y=>{var ke,et;if(d.toValue(Z).focusedElement&&!Bxe(d.toValue(C))){const je=$U(d.toValue(Z).focusedElement),Ce=d.toValue(Z).cursorPosition,ce=(d.toValue(Z).preNodeNumber||0)+1,Dt=v6e(d.toValue(Z).focusedElement),me=Bfe().valueOf();if(je&&!dB(Ce)&&Ce>=0){const be=await((ke=Y==null?void 0:Y.getDefaultProps)==null?void 0:ke.call(Y))||{};q({...Dt,label:Y==null?void 0:Y.label,nodePath:je,startOffset:Ce,subNodeSort:ce,textNodeIndex:d.toValue(S)||0,nodeType:Y==null?void 0:Y.value,insertTime:me,props:be})}}else if(m){const je=d.toValue(m);if(je!=null&&je.length){const Ce=await((et=Y==null?void 0:Y.getDefaultProps)==null?void 0:et.call(Y))||{},ce=je==null?void 0:je.map(Dt=>({...Dt,label:Y==null?void 0:Y.label,element:Dt==null?void 0:Dt.element,nodePath:Dt==null?void 0:Dt.nodePath,nodeType:Y==null?void 0:Y.value,props:Ce}));q(ce),h(ce)}}O.value=!1},G=d.computed(()=>{const Y=[],ke=[];return d.toValue(N).forEach(et=>{et.groupName==="system"?ke.push({...et,handler:()=>{J(et)}}):Y.push({...et,handler:()=>{J(et)}})}),[{label:"限定填写内容",icon:"i-bi:lock",children:Y},{label:"插入记录标识",icon:"i-bi:flag",children:ke}].filter(et=>{var je;return(je=et==null?void 0:et.children)==null?void 0:je.length})}),W=s,L=(Y,ke)=>{Y.preventDefault(),ke!=null&&ke.handler&&ke.handler(),ke!=null&&ke.value&&(W("select",ke==null?void 0:ke.value),R.value=!1)},pe=d.computed(()=>{var et,je;const Y=d.toValue(m)||[];if(!Array.isArray(Y)||Y.length===0)return null;const ke=((et=Y[0])==null?void 0:et.nodeType)??null;for(let Ce=1;Ce<Y.length;Ce++)if(((je=Y[Ce])==null?void 0:je.nodeType)!==ke)return null;return ke}),Ke=Y=>Y==null?"":String(Y).toLowerCase(),Be=Y=>Ke(pe.value)===Ke(Y);return(Y,ke)=>(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({...Y.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(G.value,et=>(d.openBlock(),d.createElementBlock("div",{key:et==null?void 0:et.label,class:"menu-item"},[d.createElementVNode("div",{class:"menu-item-content",onClick:je=>L(je,et)},[et!=null&&et.icon?(d.openBlock(),d.createElementBlock("div",z6e,[d.createElementVNode("div",{class:d.normalizeClass(et==null?void 0:et.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(et.label)+" ",1),et!=null&&et.children?(d.openBlock(),d.createElementBlock("span",U6e,"›")):d.createCommentVNode("",!0)],8,H6e),et!=null&&et.children?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["submenu",{"submenu-bottom":Y.direction==="bottom"}])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(et.children,je=>(d.openBlock(),d.createElementBlock("div",{key:je.action,class:d.normalizeClass(["menu-item",{active:Be(je.value)}]),onClick:Ce=>L(Ce,je)},[je!=null&&je.icon?(d.openBlock(),d.createElementBlock("div",W6e,[d.createElementVNode("div",{class:d.normalizeClass(je==null?void 0:je.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(je.label),1)],10,j6e))),128))],2)):d.createCommentVNode("",!0)]))),128))],512)]),_:1},8,["visible"]))}}),G6e=Ja(Z6e,[["__scopeId","data-v-24001f4f"]]);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,Z=u==null?void 0:u.value,q=Array.from((Z==null?void 0:Z.querySelectorAll(".submenu"))||[]).reduce((J,G)=>Math.max(J,G.offsetHeight||0),0)||400;O.height-I<q?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:_,updateNodes:N}=j0(),O=d.computed(()=>d.toValue(_)==="edit"),R=o,I=i,Z=()=>{I("onUiReady",{containerRef:m})},{height:q}=mMe(u),J=d.computed(()=>R.headerHtml?R.headerHtml.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(_e,le,He)=>{const Ge=He.replace(/([^{}]+)\{/g,(fe,Ue)=>{const yt=Ue.trim();return yt&&!yt.includes(".header-container")?`.header-container ${yt} {`:fe});return`<style${le}>${Ge}</style>`}):""),G=d.computed(()=>{const _e=Bz[R.pagesize]||Bz.A4,le=(window.devicePixelRatio||1)*96;return`${_e.height*le/25.4-d.toValue(q)}px`}),{showContextMenu:W,contextMenuStyle:L,onContextMenu:pe,direction:Ke}=q6e({headerHeight:q,hasContextMenu:O}),Be=d.ref(null),Y=d.computed(()=>{var _e;return(_e=d.toValue(C))==null?void 0:_e.map(le=>{const{nodePath:He,id:Ge,nodeType:fe}=le;return{nodePath:He,id:Ge,nodeType:fe}})}),ke=_e=>{const le=document.createElement("div");return le.innerHTML=_e||"",le.querySelectorAll(".node-item").forEach(Ge=>{(Ge.getAttribute("id")||"")&&Ge.remove()}),le.normalize(),le.innerHTML},et=_e=>{var fe;const le=(fe=m.value)==null?void 0:fe.querySelector(`[id="${_e==null?void 0:_e.id}"]`);if(le)return le;let He=null;const Ge=document.createElement("span");return Ge.setAttribute("contenteditable","false"),Ge.classList.add("node-item"),He=Ge,g6e(_e,He,m.value),He&&h6e(He,_e),He},je=()=>{const _e=C.value||[],le=Vxe(_e,[He=>He.nodePath,He=>He.textNodeIndex||-1,He=>(He==null?void 0:He.startOffset)??-1,He=>He.subNodeSort||-1,He=>(He==null?void 0:He.insertTime)||-1],["asc","desc","desc","desc","desc"]);le==null||le.forEach(He=>{et(He)})},Ce=()=>{Be.value&&(h.value=!1,d.nextTick(()=>{if(Be.value){const _e=ke(d.toValue(S));Be.value.innerHTML=_e,je(),h.value=!0,S.value=Be.value.innerHTML,d.nextTick(()=>{Z(),setTimeout(()=>{d.toValue(m)&&E6e(d.toValue(m))},10)})}}))},ce=_e=>{const le=document.createElement("html"),He=document.createElement("body");le.appendChild(He),He.innerHTML=_e||"";const Ge=[];return He.querySelectorAll(".node-item").forEach(Ue=>{const yt=Ue.getAttribute("id")||"",Ve=$U(Ue==null?void 0:Ue.parentElement)||"";Ge.push({nodePath:Ve,id:yt})}),Ge};d.watch(()=>S,()=>{var He;const _e=ce(d.toValue(S)),le=Y.value.map(Ge=>{const{nodePath:fe}=(_e==null?void 0:_e.find(Ue=>(Ue==null?void 0:Ue.id)===(Ge==null?void 0:Ge.id)))||{};return fe?{...Ge,nodePath:fe}:Ge});na(le,Y.value)?Ce():N((He=d.toValue(C))==null?void 0:He.map(Ge=>{const{nodePath:fe}=(le==null?void 0:le.find(Ue=>(Ue==null?void 0:Ue.id)===(Ge==null?void 0:Ge.id)))||{};return fe?{...Ge,nodePath:fe}:Ge}))},{deep:!0,immediate:!0}),d.watch(()=>Be,()=>{Ce()},{deep:!0,immediate:!0}),d.watch(()=>[...Y.value],(_e,le)=>{na(le,_e)||Ce()},{deep:!0,immediate:!0});const Dt=d.ref(),me=()=>{b.value=!0},{onBlur:be}=Y6e(),$=()=>{b.value=!1,be()};return s({renderHtml:Ce,getInnerHTML:()=>{var _e,le;return((le=(_e=Dt.value)==null?void 0:_e.getInnerHTML)==null?void 0:le.call(_e))||""},getContainerHTML:()=>{var _e;return((_e=m.value)==null?void 0:_e.innerHTML)||""}}),(_e,le)=>(d.openBlock(),d.createElementBlock("div",K6e,[d.createVNode(RB,{onOnBlur:$,onOnFocus:me,ref_key:"shadowDomRef",ref:Dt},{default:d.withCtx(()=>[d.createElementVNode("div",{ref_key:"headerRef",ref:u,style:{overflow:"hidden"}},[d.createElementVNode("div",X6e,[d.createElementVNode("div",{innerHTML:J.value,class:"disabeld-edit docHeaderHtml",onClick:me},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:G.value}]),onContextmenu:le[0]||(le[0]=d.withModifiers((...He)=>d.unref(pe)&&d.unref(pe)(...He),["prevent"]))},[d.createElementVNode("body",{ref_key:"bodyRef",ref:Be},null,512),d.createElementVNode("div",Q6e,[d.createElementVNode("div",{innerHTML:R==null?void 0:R.footerHtml,class:"disabeld-edit docFooterHtml",onClick:me},null,8,eBe)])],38)]),_:1},512),O.value?(d.openBlock(),d.createBlock(G6e,{key:0,show:d.unref(W),"onUpdate:show":le[1]||(le[1]=He=>d.isRef(W)?W.value=He:null),style:d.normalizeStyle(d.unref(L)),direction:d.unref(Ke)},null,8,["show","style","direction"])):d.createCommentVNode("",!0)]))}}),nBe=d.defineComponent({__name:"index",props:{pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},style:{type:Object,default:()=>({})},pagesizeWrapStyle:{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",{class:"pagesize",style:d.normalizeStyle(s==null?void 0:s.pagesizeWrapStyle)},[d.createElementVNode("div",{style:d.normalizeStyle({width:`${i.value}px`,...o.style}),class:"pagesize-content"},[d.renderSlot(u.$slots,"default",{},void 0,!0)],4)],4))}}),oBe=Ja(nBe,[["__scopeId","data-v-1f48410e"]]),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:()=>({})},pagesizeWrapStyle:{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=J=>{m("onUiReady",J)},_=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=J=>{m("update:nodes",J)},I=J=>{m("update:modelValue",J)},Z=J=>{m("update:formData",J)},q=J=>{m("onSelectedNodes",J)};return s({formRef:{validate:()=>{var J,G,W;return(W=(G=(J=b.value)==null?void 0:J.formRef)==null?void 0:G.validate)==null?void 0:W.call(G)}},setSelectedNodes:J=>{var G,W;(W=(G=_.value)==null?void 0:G.setSelectedNodes)==null||W.call(G,J)},initNodes:()=>{var J,G;return(G=(J=b.value)==null?void 0:J.initNodes)==null?void 0:G.call(J)},getInnerHTML:()=>{var J,G;return((G=(J=C.value)==null?void 0:J.getInnerHTML)==null?void 0:G.call(J))||""},getContainerHTML:()=>{var J,G;return((G=(J=C.value)==null?void 0:J.getContainerHTML)==null?void 0:G.call(J))||""}}),(J,G)=>(d.openBlock(),d.createBlock(oBe,{pagesize:o.pagesize,orientation:u==null?void 0:u.orientation,style:d.normalizeStyle(o.pagesizeStyle),pagesizeWrapStyle:o.pagesizeWrapStyle},{default:d.withCtx(()=>[d.createVNode(V6e,{ref_key:"UIRef",ref:_,nodes:o.nodes,"onUpdate:nodes":R,selectedNodes:h.value,"onUpdate:selectedNodes":G[0]||(G[0]=W=>h.value=W),onOnSelectedNodes:q,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":Z,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(W=>[d.renderSlot(J.$slots,"nodeItem",{node:W==null?void 0:W.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","pagesizeWrapStyle"]))}}),sBe={class:"nodes-text"},rBe={key:0,class:"node-text-input"},aBe={key:1,class:"node-text-td"},iBe={key:0,class:"node-text-table-index"},lBe=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",sBe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(m.value,(S,_)=>{var N,O,R,I,Z,q,J,G,W;return d.openBlock(),d.createElementBlock("div",{key:_,class:"node-text-item"},[(S==null?void 0:S.showTextType)==="input"?(d.openBlock(),d.createElementBlock("span",rBe,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",aBe,[h.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("span",iBe,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)===((Z=S==null?void 0:S.max)==null?void 0:Z.id)?(J=(q=S==null?void 0:S.min)==null?void 0:q.props)!=null&&J.alias?(W=(G=S==null?void 0:S.min)==null?void 0:G.props)==null?void 0:W.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(lBe,[["__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 u.value=!1,!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,cBe={key:0,class:"node-select-small gap-x-2"},uBe={key:1,class:"text-[#999]"},dBe={key:1,class:"node-select"},fBe={class:"flex py-2 px-2 justify-between items-center noder-select-header"},mBe={class:"flex gap-2"},pBe={key:1},gBe={class:"flex gap-1"},hBe=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=()=>{b.value=!1,setTimeout(()=>{m.value=[]},0)},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,Z;return s.size==="small"?(d.openBlock(),d.createElementBlock("div",cBe,[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]=(...q)=>d.unref(h)&&d.unref(h)(...q))},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)()})},[((Z=m.value)==null?void 0:Z.length)>0?(d.openBlock(),d.createBlock(ile,{key:0,modelValue:m.value,"onUpdate:modelValue":R[1]||(R[1]=q=>m.value=q),editorId:o.editorId},null,8,["modelValue","editorId"])):(d.openBlock(),d.createElementBlock("div",uBe,"未设置"))])])):(d.openBlock(),d.createElementBlock("div",dBe,[d.createElementVNode("div",fBe,[d.createElementVNode("div",mBe,[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]=(...q)=>d.unref(h)&&d.unref(h)(...q))})],4)),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",pBe,[d.createElementVNode("div",{class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})]))]),d.createElementVNode("div",gBe,[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]=q=>m.value=q),editorId:o.editorId},null,8,["modelValue","editorId"])],2)]))}}}),Lfe=Ja(hBe,[["__scopeId","data-v-cc571e72"]]);function vBe(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 bBe(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 yBe(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 Z=_;Z<=N;Z++)S.push({colIndex:Z,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 wBe(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),Z=((S=I.startContainer)==null?void 0:S.nodeName)==="#text"?I.startContainer:(N=(_=I.startContainer)==null?void 0:_.childNodes)==null?void 0:N[0],q=Math.min(C,((O=Z.textContent)==null?void 0:O.length)||0);I.setStart(Z,q)}}};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 CBe(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=Z=>{var q;Z.preventDefault(),(q=d.toValue(s))==null||q.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(Z=>{Z.addEventListener("click",C),Z.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(Z=>{Z.removeEventListener("click",C),Z.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 Z;R=[...R,...((Z=I==null?void 0:I.cellValue)==null?void 0:Z.map(q=>({color:I==null?void 0:I.color,backgroundColor:Mz((I==null?void 0:I.color)||"#000",.1),element:q==null?void 0:q.element})))||[]]}),R.forEach(I=>{var Z;I!=null&&I.element&&((Z=I==null?void 0:I.element)==null||Z.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 SBe=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 xBe(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 EBe=(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},_Be=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(),Z=q=>{var J,G;if(d.toValue(R)&&d.toValue(O)&&!na((J=d.toValue(b))==null?void 0:J.cellValue,q)){const W=S6e(q,((G=d.toValue(S))==null?void 0:G.nodes)||"");let L=W;W&&(d.toValue(N)===0&&(L+=","),d.toValue(_)>=0&&(u.value=xBe(d.toValue(u),d.toValue(_),d.toValue(N),L),N.value=W.length))}};d.watch(()=>h,()=>{var q,J,G,W,L,pe;if((q=S.value)==null||q.setSelectedNodes([]),["range","cell"].includes((J=d.toValue(b))==null?void 0:J.type))return _.value=EBe(i.value,h.value),N.value=(W=(G=d.toValue(b))==null?void 0:G.value)==null?void 0:W.length,R.value=!0,I("selectNodes",{data:(L=d.toValue(b))==null?void 0:L.cellValue,mode:"multiple",callback:({data:Ke})=>{Z(Ke)}}),!1;if([",","(","="].includes((pe=d.toValue(b))==null?void 0:pe.value))return _.value=d.toValue(s),R.value=!0,N.value=0,I("selectNodes",{data:[],mode:"multiple",callback:({data:Ke})=>{Z(Ke)}}),!1;R.value=!1,_.value=-1},{immediate:!0,deep:!0})},kBe=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 TBe(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 ABe=(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},NBe=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 Z;if(d.toValue(N)&&d.toValue(_)&&!na((Z=d.toValue(h))==null?void 0:Z.value,I)){const q=I,J=q;q&&d.toValue(C)>=0&&(u.value=TBe(d.toValue(u),d.toValue(C),d.toValue(S),J),S.value=q.length)}};d.watch(()=>m,()=>{var I,Z,q,J,G;if(["function"].includes((I=d.toValue(h))==null?void 0:I.type))return C.value=ABe(i.value,m.value),S.value=(q=(Z=d.toValue(h))==null?void 0:Z.value)==null?void 0:q.length,N.value=!0,O("selectFunction",{data:(J=d.toValue(h))==null?void 0:J.value,callback:({data:W})=>{R(W)}}),!1;if([",","(","="].includes((G=d.toValue(h))==null?void 0:G.value))return C.value=d.toValue(s),N.value=!0,S.value=0,O("selectFunction",{data:"",callback:({data:W})=>{R(W)}}),!1;N.value=!1,C.value=-1},{immediate:!0,deep:!0})},OBe={class:"node-formula"},$Be={class:"node-formula-show"},DBe=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}=yBe({editorId:s==null?void 0:s.editorId}),u=d.useModel(o,"modelValue"),m=d.ref(),{startOffset:h}=SBe({element:m});wBe(m,u,h);const b=d.computed(()=>{const N=vBe(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=bBe(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)});CBe({element:m,showStr:C,editorId:s==null?void 0:s.editorId});const{currentItemIndex:S,currentItem:_}=kBe({element:m,startOffset:h,value:u,showStr:C});return _Be({element:m,startOffset:h,showStr:C,editorId:s==null?void 0:s.editorId,value:u,currentItemIndex:S,currentItem:_}),NBe({element:m,startOffset:h,showStr:C,value:u,currentItemIndex:S,currentItem:_}),(N,O)=>(d.openBlock(),d.createElementBlock("div",OBe,[d.createElementVNode("div",{contenteditable:"true",ref_key:"formulaRef",ref:m,class:"node-formula-input"},null,512),d.createElementVNode("div",$Be,[(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(DBe,[["__scopeId","data-v-f4b96eb4"]]),MBe=[{label:"平均值",value:"AVERAGE"},{label:"均值绝对偏差",value:"AVEDEV"},{label:"求和",value:"SUM"},{label:"条件判断",value:"IF"},{label:"统计数量",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"正平方根",value:"SQRT"}],BBe={class:"select-function"},RBe=["onClick"],IBe={class:"function-item"},PBe={class:"function-item-desc"},FBe=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:MBe}),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",BBe,[(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",IBe,d.toDisplayString(S.value),1),d.createElementVNode("div",PBe,d.toDisplayString(S.label),1)],10,RBe)]))),128))]))}}),Hfe=Ja(FBe,[["__scopeId","data-v-6e079ff0"]]),LBe=["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,LBe)]),_:1}))}});function RU(o){return d.getCurrentScope()?(d.onScopeDispose(o),!0):!1}function B0(o){return typeof o=="function"?o():d.unref(o)}const VBe=typeof window<"u"&&typeof document<"u",HBe=o=>typeof o<"u",zBe=Object.prototype.toString,UBe=o=>zBe.call(o)==="[object Object]",jBe=()=>{};function WBe(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 ZBe(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 GBe(o,s,i={}){const{eventFilter:u=Ufe,...m}=i;return d.watch(o,WBe(u,s),m)}function GA(o,s,i={}){const{eventFilter:u,...m}=i,{eventFilter:h,pause:b,resume:C,isActive:S}=ZBe(u);return{stop:GBe(o,s,{...m,eventFilter:h}),pause:b,resume:C,isActive:S}}function qBe(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:Z,throwOnTimeout:q}={}){let J=null;const W=[new Promise(L=>{J=d.watch(o,pe=>{O(pe)!==s&&(J==null||J(),L(pe))},{flush:R,deep:I,immediate:!0})})];return Z!=null&&W.push(cle(Z,q).then(()=>B0(o)).finally(()=>J==null?void 0:J())),Promise.race(W)}function u(O,R){if(!d.isRef(O))return i(pe=>pe===O,R);const{flush:I="sync",deep:Z=!1,timeout:q,throwOnTimeout:J}=R??{};let G=null;const L=[new Promise(pe=>{G=d.watch([o,O],([Ke,Be])=>{s!==(Ke===Be)&&(G==null||G(),pe(Ke))},{flush:I,deep:Z,immediate:!0})})];return q!=null&&L.push(cle(q,J).then(()=>B0(o)).finally(()=>(G==null||G(),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 Z=Array.from(I);return Z.includes(O)||Z.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 YBe(o){var s;const i=B0(o);return(s=i==null?void 0:i.$el)!=null?s:i}const jfe=VBe?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 jBe;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(()=>[YBe(s),B0(m)],([N,O])=>{if(b(),!N)return;const R=UBe(O)?{...O}:O;h.push(...i.flatMap(I=>u.map(Z=>C(N,I,Z,R))))},{immediate:!0,flush:"post"}),_=()=>{S(),b()};return RU(_),_}function KBe(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=KBe(s);return Wfe(m,h,N=>{N.repeat&&B0(C)||S(N)&&i(N)},b)}function XBe(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(),Z=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 q=_;s||(s="modelValue"),q=q||`update:${s.toString()}`;const J=L=>C?typeof C=="function"?C(L):XBe(L):L,G=()=>HBe(o[s])?J(o[s]):O,W=L=>{R?R(L)&&Z(q,L):Z(q,L)};if(S){const L=G(),pe=d.ref(L);let Ke=!1;return d.watch(()=>o[s],Be=>{Ke||(Ke=!0,pe.value=J(Be),d.nextTick(()=>Ke=!1))}),d.watch(pe,Be=>{!Ke&&(Be!==o[s]||N)&&W(Be)},{deep:N}),pe}else return d.computed({get(){return G()},set(L){W(L)}})}var JBe={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 QBe(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=QBe(o+"",i),m,h=-1,b=u.length;if(arguments.length<2){for(;++h<b;)if((m=(o=u[h]).type)&&(m=eRe(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 eRe(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]=JBe,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 tRe(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 nRe(o){return function(){return this.ownerDocument.createElementNS(o.space,o.local)}}function Zfe(o){var s=PU(o);return(s.local?nRe:tRe)(s)}function oRe(){}function Loe(o){return o==null?oRe:function(){return this.querySelector(o)}}function sRe(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 rRe(o){return o==null?[]:Array.isArray(o)?o:Array.from(o)}function aRe(){return[]}function Gfe(o){return o==null?aRe:function(){return this.querySelectorAll(o)}}function iRe(o){return function(){return rRe(o.apply(this,arguments))}}function lRe(o){typeof o=="function"?o=iRe(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 cRe=Array.prototype.find;function uRe(o){return function(){return cRe.call(this.children,o)}}function dRe(){return this.firstElementChild}function fRe(o){return this.select(o==null?dRe:uRe(typeof o=="function"?o:Yfe(o)))}var mRe=Array.prototype.filter;function pRe(){return Array.from(this.children)}function gRe(o){return function(){return mRe.call(this.children,o)}}function hRe(o){return this.selectAll(o==null?pRe:gRe(typeof o=="function"?o:Yfe(o)))}function vRe(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 bRe(){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 yRe(o){return function(){return o}}function wRe(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 CRe(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 SRe(o){return o.__data__}function xRe(o,s){if(!arguments.length)return Array.from(this,SRe);var i=s?CRe:wRe,u=this._parents,m=this._groups;typeof o!="function"&&(o=yRe(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=ERe(o.call(N,N&&N.__data__,_,u)),Z=I.length,q=C[_]=new Array(Z),J=b[_]=new Array(Z),G=S[_]=new Array(R);i(N,O,q,J,G,I,s);for(var W=0,L=0,pe,Ke;W<Z;++W)if(pe=q[W]){for(W>=L&&(L=W+1);!(Ke=J[L])&&++L<Z;);pe._next=Ke||null}}return b=new Sp(b,u),b._enter=C,b._exit=S,b}function ERe(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function _Re(){return new Sp(this._exit||this._groups.map(Kfe),this._parents)}function kRe(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 TRe(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,Z=0;Z<O;++Z)(I=_[Z]||N[Z])&&(R[Z]=I);for(;S<m;++S)C[S]=i[S];return new Sp(C,this._parents)}function ARe(){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 NRe(o){o||(o=ORe);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 ORe(o,s){return o<s?-1:o>s?1:o>=s?0:NaN}function $Re(){var o=arguments[0];return arguments[0]=this,o.apply(null,arguments),this}function DRe(){return Array.from(this)}function MRe(){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 BRe(){let o=0;for(const s of this)++o;return o}function RRe(){return!this.node()}function IRe(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 PRe(o){return function(){this.removeAttribute(o)}}function FRe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function LRe(o,s){return function(){this.setAttribute(o,s)}}function VRe(o,s){return function(){this.setAttributeNS(o.space,o.local,s)}}function HRe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttribute(o):this.setAttribute(o,i)}}function zRe(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 URe(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?FRe:PRe:typeof s=="function"?i.local?zRe:HRe:i.local?VRe:LRe)(i,s))}function Xfe(o){return o.ownerDocument&&o.ownerDocument.defaultView||o.document&&o||o.defaultView}function jRe(o){return function(){this.style.removeProperty(o)}}function WRe(o,s,i){return function(){this.style.setProperty(o,s,i)}}function ZRe(o,s,i){return function(){var u=s.apply(this,arguments);u==null?this.style.removeProperty(o):this.style.setProperty(o,u,i)}}function GRe(o,s,i){return arguments.length>1?this.each((s==null?jRe:typeof s=="function"?ZRe:WRe)(o,s,i??"")):g4(this.node(),o)}function g4(o,s){return o.style.getPropertyValue(s)||Xfe(o).getComputedStyle(o,null).getPropertyValue(s)}function qRe(o){return function(){delete this[o]}}function YRe(o,s){return function(){this[o]=s}}function KRe(o,s){return function(){var i=s.apply(this,arguments);i==null?delete this[o]:this[o]=i}}function XRe(o,s){return arguments.length>1?this.each((s==null?qRe:typeof s=="function"?KRe:YRe)(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 JRe(o){return function(){eme(this,o)}}function QRe(o){return function(){tme(this,o)}}function eIe(o,s){return function(){(s.apply(this,arguments)?eme:tme)(this,o)}}function tIe(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"?eIe:s?JRe:QRe)(i,s))}function nIe(){this.textContent=""}function oIe(o){return function(){this.textContent=o}}function sIe(o){return function(){var s=o.apply(this,arguments);this.textContent=s??""}}function rIe(o){return arguments.length?this.each(o==null?nIe:(typeof o=="function"?sIe:oIe)(o)):this.node().textContent}function aIe(){this.innerHTML=""}function iIe(o){return function(){this.innerHTML=o}}function lIe(o){return function(){var s=o.apply(this,arguments);this.innerHTML=s??""}}function cIe(o){return arguments.length?this.each(o==null?aIe:(typeof o=="function"?lIe:iIe)(o)):this.node().innerHTML}function uIe(){this.nextSibling&&this.parentNode.appendChild(this)}function dIe(){return this.each(uIe)}function fIe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mIe(){return this.each(fIe)}function pIe(o){var s=typeof o=="function"?o:Zfe(o);return this.select(function(){return this.appendChild(s.apply(this,arguments))})}function gIe(){return null}function hIe(o,s){var i=typeof o=="function"?o:Zfe(o),u=s==null?gIe:typeof s=="function"?s:Loe(s);return this.select(function(){return this.insertBefore(i.apply(this,arguments),u.apply(this,arguments)||null)})}function vIe(){var o=this.parentNode;o&&o.removeChild(this)}function bIe(){return this.each(vIe)}function yIe(){var o=this.cloneNode(!1),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function wIe(){var o=this.cloneNode(!0),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function CIe(o){return this.select(o?wIe:yIe)}function SIe(o){return arguments.length?this.property("__data__",o):this.node().__data__}function xIe(o){return function(s){o.call(this,s,this.__data__)}}function EIe(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 _Ie(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 kIe(o,s,i){return function(){var u=this.__on,m,h=xIe(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 TIe(o,s,i){var u=EIe(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?kIe:_Ie,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 AIe(o,s){return function(){return nme(this,o,s)}}function NIe(o,s){return function(){return nme(this,o,s.apply(this,arguments))}}function OIe(o,s){return this.each((typeof s=="function"?NIe:AIe)(o,s))}function*$Ie(){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 DIe(){return this}Sp.prototype=PB.prototype={constructor:Sp,select:sRe,selectAll:lRe,selectChild:fRe,selectChildren:hRe,filter:vRe,data:xRe,enter:bRe,exit:_Re,join:kRe,merge:TRe,selection:DIe,order:ARe,sort:NRe,call:$Re,nodes:DRe,node:MRe,size:BRe,empty:RRe,each:IRe,attr:URe,style:GRe,property:XRe,classed:tIe,text:rIe,html:cIe,raise:dIe,lower:mIe,append:pIe,insert:hIe,remove:bIe,clone:CIe,datum:SIe,on:TIe,dispatch:OIe,[Symbol.iterator]:$Ie};function Mh(o){return typeof o=="string"?new Sp([[document.querySelector(o)]],[document.documentElement]):new Sp([[o]],ome)}function MIe(o){let s;for(;s=o.sourceEvent;)o=s;return o}function Ov(o,s){if(o=MIe(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 BIe={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 RIe(o){return!o.ctrlKey&&!o.button}function IIe(){return this.parentNode}function PIe(o,s){return s??{x:o.x,y:o.y}}function FIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function LIe(){var o=RIe,s=IIe,i=PIe,u=FIe,m={},h=IU("start","drag","end"),b=0,C,S,_,N,O=0;function R(pe){pe.on("mousedown.drag",I).filter(u).on("touchstart.drag",J).on("touchmove.drag",G,BIe).on("touchend.drag touchcancel.drag",W).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function I(pe,Ke){if(!(N||!o.call(this,pe,Ke))){var Be=L(this,s.call(this,pe,Ke),pe,Ke,"mouse");Be&&(Mh(pe.view).on("mousemove.drag",Z,fB).on("mouseup.drag",q,fB),sme(pe.view),bte(pe),_=!1,C=pe.clientX,S=pe.clientY,Be("start",pe))}}function Z(pe){if(a4(pe),!_){var Ke=pe.clientX-C,Be=pe.clientY-S;_=Ke*Ke+Be*Be>O}m.mouse("drag",pe)}function q(pe){Mh(pe.view).on("mousemove.drag mouseup.drag",null),rme(pe.view,_),a4(pe),m.mouse("end",pe)}function J(pe,Ke){if(o.call(this,pe,Ke)){var Be=pe.changedTouches,Y=s.call(this,pe,Ke),ke=Be.length,et,je;for(et=0;et<ke;++et)(je=L(this,Y,pe,Ke,Be[et].identifier,Be[et]))&&(bte(pe),je("start",pe,Be[et]))}}function G(pe){var Ke=pe.changedTouches,Be=Ke.length,Y,ke;for(Y=0;Y<Be;++Y)(ke=m[Ke[Y].identifier])&&(a4(pe),ke("drag",pe,Ke[Y]))}function W(pe){var Ke=pe.changedTouches,Be=Ke.length,Y,ke;for(N&&clearTimeout(N),N=setTimeout(function(){N=null},500),Y=0;Y<Be;++Y)(ke=m[Ke[Y].identifier])&&(bte(pe),ke("end",pe,Ke[Y]))}function L(pe,Ke,Be,Y,ke,et){var je=h.copy(),Ce=Ov(et||Be,Ke),ce,Dt,me;if((me=i.call(pe,new kne("beforestart",{sourceEvent:Be,target:R,identifier:ke,active:b,x:Ce[0],y:Ce[1],dx:0,dy:0,dispatch:je}),Y))!=null)return ce=me.x-Ce[0]||0,Dt=me.y-Ce[1]||0,function be($,_e,le){var He=Ce,Ge;switch($){case"start":m[ke]=be,Ge=b++;break;case"end":delete m[ke],--b;case"drag":Ce=Ov(le||_e,Ke),Ge=b;break}je.call($,pe,new kne($,{sourceEvent:_e,subject:me,target:R,identifier:ke,active:Ge,x:Ce[0]+ce,y:Ce[1]+Dt,dx:Ce[0]-He[0],dy:Ce[1]-He[1],dispatch:je}),Y)}}return R.filter=function(pe){return arguments.length?(o=typeof pe=="function"?pe:RH(!!pe),R):o},R.container=function(pe){return arguments.length?(s=typeof pe=="function"?pe:RH(pe),R):s},R.subject=function(pe){return arguments.length?(i=typeof pe=="function"?pe:RH(pe),R):i},R.touchable=function(pe){return arguments.length?(u=typeof pe=="function"?pe:RH(!!pe),R):u},R.on=function(){var pe=h.on.apply(h,arguments);return pe===h?R:pe},R.clickDistance=function(pe){return arguments.length?(O=(pe=+pe)*pe,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*",VIe=/^#([0-9a-f]{3,8})$/,HIe=new RegExp(`^rgb\\(${i4},${i4},${i4}\\)$`),zIe=new RegExp(`^rgb\\(${Mv},${Mv},${Mv}\\)$`),UIe=new RegExp(`^rgba\\(${i4},${i4},${i4},${pB}\\)$`),jIe=new RegExp(`^rgba\\(${Mv},${Mv},${Mv},${pB}\\)$`),WIe=new RegExp(`^hsl\\(${pB},${Mv},${Mv}\\)$`),ZIe=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:GIe,formatHsl:qIe,formatRgb:gle,toString:gle});function ple(){return this.rgb().formatHex()}function GIe(){return this.rgb().formatHex8()}function qIe(){return ime(this).formatHsl()}function gle(){return this.rgb().formatRgb()}function gB(o){var s,i;return o=(o+"").trim().toLowerCase(),(s=VIe.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=HIe.exec(o))?new Sm(s[1],s[2],s[3],1):(s=zIe.exec(o))?new Sm(s[1]*255/100,s[2]*255/100,s[3]*255/100,1):(s=UIe.exec(o))?IH(s[1],s[2],s[3],s[4]):(s=jIe.exec(o))?IH(s[1]*255/100,s[2]*255/100,s[3]*255/100,s[4]):(s=WIe.exec(o))?yle(s[1],s[2]/100,s[3]/100,1):(s=ZIe.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 YIe(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?YIe(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:KIe,formatRgb:ble,toString:ble}));function vle(){return`#${bE(this.r)}${bE(this.g)}${bE(this.b)}`}function KIe(){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 XIe(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,XIe,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 JIe(o,s){return function(i){return o+i*s}}function QIe(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 ePe(o){return(o=+o)==1?cme:function(s,i){return i-s?QIe(s,i,o):lme(isNaN(s)?i:s)}}function cme(o,s){var i=s-o;return i?JIe(o,i):lme(isNaN(o)?s:o)}const Cle=function o(s){var i=ePe(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 tPe(o){return function(){return o}}function nPe(o){return function(s){return o(s)+""}}function oPe(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]?nPe(S[0].x):tPe(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 sPe(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 rPe(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,Z){if(_!==O||N!==R){var q=I.push("translate(",null,s,null,i);Z.push({i:q-4,x:r2(_,O)},{i:q-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,Z){if(_!==O||N!==R){var q=I.push(m(I)+"scale(",null,",",null,")");Z.push({i:q-4,x:r2(_,O)},{i:q-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 Z=-1,q=R.length,J;++Z<q;)O[(J=R[Z]).i]=J.x(I);return O.join("")}}}var aPe=dme(sPe,"px, ","px)","deg)"),iPe=dme(rPe,", ",")",")"),lPe=1e-12;function xle(o){return((o=Math.exp(o))+1/o)/2}function cPe(o){return((o=Math.exp(o))-1/o)/2}function uPe(o){return((o=Math.exp(2*o))-1)/(o+1)}const dPe=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,Z=O-S,q=I*I+Z*Z,J,G;if(q<lPe)G=Math.log(R/_)/s,J=function(Y){return[C+Y*I,S+Y*Z,_*Math.exp(s*Y*G)]};else{var W=Math.sqrt(q),L=(R*R-_*_+u*q)/(2*_*i*W),pe=(R*R-_*_-u*q)/(2*R*i*W),Ke=Math.log(Math.sqrt(L*L+1)-L),Be=Math.log(Math.sqrt(pe*pe+1)-pe);G=(Be-Ke)/s,J=function(Y){var ke=Y*G,et=xle(Ke),je=_/(i*W)*(et*uPe(s*ke+Ke)-cPe(Ke));return[C+je*I,S+je*Z,_*et/xle(s*ke+Ke)]}}return J.duration=G*1e3*s/Math.SQRT2,J}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(fPe),$E=hB.now()+FU)}function fPe(){$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 mPe(){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{mPe()}finally{h4=0,gPe(),$E=0}}function pPe(){var o=hB.now(),s=o-Lz;s>fme&&(FU-=s,Lz=o)}function gPe(){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(pPe,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 hPe=IU("start","end","cancel","interrupt"),vPe=[],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;bPe(o,i,{name:s,index:u,group:m,on:hPe,tween:vPe,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 bPe(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 yPe(o){return this.each(function(){cz(this,o)})}function wPe(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 CPe(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 SPe(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?wPe:CPe)(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):oPe)(o,s)}function xPe(o){return function(){this.removeAttribute(o)}}function EPe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function _Pe(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 kPe(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 TPe(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 APe(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 NPe(o,s){var i=PU(o),u=i==="transform"?iPe:hme;return this.attrTween(o,typeof s=="function"?(i.local?APe:TPe)(i,u,joe(this,"attr."+o,s)):s==null?(i.local?EPe:xPe)(i):(i.local?kPe:_Pe)(i,u,s))}function OPe(o,s){return function(i){this.setAttribute(o,s.call(this,i))}}function $Pe(o,s){return function(i){this.setAttributeNS(o.space,o.local,s.call(this,i))}}function DPe(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 MPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&OPe(o,h)),i}return m._value=s,m}function BPe(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?DPe:MPe)(u,s))}function RPe(o,s){return function(){Uoe(this,o).delay=+s.apply(this,arguments)}}function IPe(o,s){return s=+s,function(){Uoe(this,o).delay=s}}function PPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?RPe:IPe)(s,o)):Fh(this.node(),s).delay}function FPe(o,s){return function(){Fv(this,o).duration=+s.apply(this,arguments)}}function LPe(o,s){return s=+s,function(){Fv(this,o).duration=s}}function VPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?FPe:LPe)(s,o)):Fh(this.node(),s).duration}function HPe(o,s){if(typeof s!="function")throw new Error;return function(){Fv(this,o).ease=s}}function zPe(o){var s=this._id;return arguments.length?this.each(HPe(s,o)):Fh(this.node(),s).ease}function UPe(o,s){return function(){var i=s.apply(this,arguments);if(typeof i!="function")throw new Error;Fv(this,o).ease=i}}function jPe(o){if(typeof o!="function")throw new Error;return this.each(UPe(this._id,o))}function WPe(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 ZPe(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 GPe(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 qPe(o,s,i){var u,m,h=GPe(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 YPe(o,s){var i=this._id;return arguments.length<2?Fh(this.node(),i).on.on(o):this.each(qPe(i,o,s))}function KPe(o){return function(){var s=this.parentNode;for(var i in this.__transition)if(+i!==o)return;s&&s.removeChild(this)}}function XPe(){return this.on("end.remove",KPe(this._id))}function JPe(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 QPe(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,Z=Fh(N,i),q=0,J=R.length;q<J;++q)(I=R[q])&&LU(I,s,i,q,R,Z);h.push(R),b.push(N)}return new V0(h,b,s,i)}var e8e=PB.prototype.constructor;function t8e(){return new e8e(this._groups,this._parents)}function n8e(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 o8e(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 s8e(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 r8e(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 a8e(o,s,i){var u=(o+="")=="transform"?aPe:hme;return s==null?this.styleTween(o,n8e(o,u)).on("end.style."+o,vme(o)):typeof s=="function"?this.styleTween(o,s8e(o,u,joe(this,"style."+o,s))).each(r8e(this._id,o)):this.styleTween(o,o8e(o,u,s),i).on("end.style."+o,null)}function i8e(o,s,i){return function(u){this.style.setProperty(o,s.call(this,u),i)}}function l8e(o,s,i){var u,m;function h(){var b=s.apply(this,arguments);return b!==m&&(u=(m=b)&&i8e(o,b,i)),u}return h._value=s,h}function c8e(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,l8e(o,s,i??""))}function u8e(o){return function(){this.textContent=o}}function d8e(o){return function(){var s=o(this);this.textContent=s??""}}function f8e(o){return this.tween("text",typeof o=="function"?d8e(joe(this,"text",o)):u8e(o==null?"":o+""))}function m8e(o){return function(s){this.textContent=o.call(this,s)}}function p8e(o){var s,i;function u(){var m=o.apply(this,arguments);return m!==i&&(s=(i=m)&&m8e(m)),s}return u._value=o,u}function g8e(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,p8e(o))}function h8e(){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 v8e(){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 b8e=0;function V0(o,s,i,u){this._groups=o,this._parents=s,this._name=i,this._id=u}function bme(){return++b8e}var $0=PB.prototype;V0.prototype={constructor:V0,select:JPe,selectAll:QPe,selectChild:$0.selectChild,selectChildren:$0.selectChildren,filter:WPe,merge:ZPe,selection:t8e,transition:h8e,call:$0.call,nodes:$0.nodes,node:$0.node,size:$0.size,empty:$0.empty,each:$0.each,on:YPe,attr:NPe,attrTween:BPe,style:a8e,styleTween:c8e,text:f8e,textTween:g8e,remove:XPe,tween:SPe,delay:PPe,duration:VPe,ease:zPe,easeVarying:jPe,end:v8e,[Symbol.iterator]:$0[Symbol.iterator]};function y8e(o){return((o*=2)<=1?o*o*o:(o-=2)*o*o+2)/2}var w8e={time:null,delay:0,duration:250,ease:y8e};function C8e(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 S8e(o){var s,i;o instanceof V0?(s=o._id,o=o._name):(s=bme(),(i=w8e).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||C8e(S,s));return new V0(u,this._parents,o,s)}PB.prototype.interrupt=yPe;PB.prototype.transition=S8e;const LH=o=>()=>o;function x8e(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 E8e(o){return(!o.ctrlKey||o.type==="wheel")&&!o.button}function _8e(){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 k8e(o){return-o.deltaY*(o.deltaMode===1?.05:o.deltaMode?1:.002)*(o.ctrlKey?10:1)}function T8e(){return navigator.maxTouchPoints||"ontouchstart"in this}function A8e(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 N8e(){var o=E8e,s=_8e,i=A8e,u=k8e,m=T8e,h=[0,1/0],b=[[-1/0,-1/0],[1/0,1/0]],C=250,S=dPe,_=IU("start","zoom","end"),N,O,R,I=500,Z=150,q=0,J=10;function G(me){me.property("__zoom",Ale).on("wheel.zoom",ke,{passive:!1}).on("mousedown.zoom",et).on("dblclick.zoom",je).filter(m).on("touchstart.zoom",Ce).on("touchmove.zoom",ce).on("touchend.zoom touchcancel.zoom",Dt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}G.transform=function(me,be,$,_e){var le=me.selection?me.selection():me;le.property("__zoom",Ale),me!==le?Ke(me,be,$,_e):le.interrupt().each(function(){Be(this,arguments).event(_e).start().zoom(null,typeof be=="function"?be.apply(this,arguments):be).end()})},G.scaleBy=function(me,be,$,_e){G.scaleTo(me,function(){var le=this.__zoom.k,He=typeof be=="function"?be.apply(this,arguments):be;return le*He},$,_e)},G.scaleTo=function(me,be,$,_e){G.transform(me,function(){var le=s.apply(this,arguments),He=this.__zoom,Ge=$==null?pe(le):typeof $=="function"?$.apply(this,arguments):$,fe=He.invert(Ge),Ue=typeof be=="function"?be.apply(this,arguments):be;return i(L(W(He,Ue),Ge,fe),le,b)},$,_e)},G.translateBy=function(me,be,$,_e){G.transform(me,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,_e)},G.translateTo=function(me,be,$,_e,le){G.transform(me,function(){var He=s.apply(this,arguments),Ge=this.__zoom,fe=_e==null?pe(He):typeof _e=="function"?_e.apply(this,arguments):_e;return i(v4.translate(fe[0],fe[1]).scale(Ge.k).translate(typeof be=="function"?-be.apply(this,arguments):-be,typeof $=="function"?-$.apply(this,arguments):-$),He,b)},_e,le)};function W(me,be){return be=Math.max(h[0],Math.min(h[1],be)),be===me.k?me:new I0(be,me.x,me.y)}function L(me,be,$){var _e=be[0]-$[0]*me.k,le=be[1]-$[1]*me.k;return _e===me.x&&le===me.y?me:new I0(me.k,_e,le)}function pe(me){return[(+me[0][0]+ +me[1][0])/2,(+me[0][1]+ +me[1][1])/2]}function Ke(me,be,$,_e){me.on("start.zoom",function(){Be(this,arguments).event(_e).start()}).on("interrupt.zoom end.zoom",function(){Be(this,arguments).event(_e).end()}).tween("zoom",function(){var le=this,He=arguments,Ge=Be(le,He).event(_e),fe=s.apply(le,He),Ue=$==null?pe(fe):typeof $=="function"?$.apply(le,He):$,yt=Math.max(fe[1][0]-fe[0][0],fe[1][1]-fe[0][1]),Ve=le.__zoom,pt=typeof be=="function"?be.apply(le,He):be,Ie=S(Ve.invert(Ue).concat(yt/Ve.k),pt.invert(Ue).concat(yt/pt.k));return function(mt){if(mt===1)mt=pt;else{var oe=Ie(mt),mn=yt/oe[2];mt=new I0(mn,Ue[0]-oe[0]*mn,Ue[1]-oe[1]*mn)}Ge.zoom(null,mt)}})}function Be(me,be,$){return!$&&me.__zooming||new Y(me,be)}function Y(me,be){this.that=me,this.args=be,this.active=0,this.sourceEvent=null,this.extent=s.apply(me,be),this.taps=0}Y.prototype={event:function(me){return me&&(this.sourceEvent=me),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(me,be){return this.mouse&&me!=="mouse"&&(this.mouse[1]=be.invert(this.mouse[0])),this.touch0&&me!=="touch"&&(this.touch0[1]=be.invert(this.touch0[0])),this.touch1&&me!=="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(me){var be=Mh(this.that).datum();_.call(me,this.that,new x8e(me,{sourceEvent:this.sourceEvent,target:G,type:me,transform:this.that.__zoom,dispatch:_}),be)}};function ke(me,...be){if(!o.apply(this,arguments))return;var $=Be(this,be).event(me),_e=this.__zoom,le=Math.max(h[0],Math.min(h[1],_e.k*Math.pow(2,u.apply(this,arguments)))),He=Ov(me);if($.wheel)($.mouse[0][0]!==He[0]||$.mouse[0][1]!==He[1])&&($.mouse[1]=_e.invert($.mouse[0]=He)),clearTimeout($.wheel);else{if(_e.k===le)return;$.mouse=[He,_e.invert(He)],cz(this),$.start()}P6(me),$.wheel=setTimeout(Ge,Z),$.zoom("mouse",i(L(W(_e,le),$.mouse[0],$.mouse[1]),$.extent,b));function Ge(){$.wheel=null,$.end()}}function et(me,...be){if(R||!o.apply(this,arguments))return;var $=me.currentTarget,_e=Be(this,be,!0).event(me),le=Mh(me.view).on("mousemove.zoom",Ue,!0).on("mouseup.zoom",yt,!0),He=Ov(me,$),Ge=me.clientX,fe=me.clientY;sme(me.view),Cte(me),_e.mouse=[He,this.__zoom.invert(He)],cz(this),_e.start();function Ue(Ve){if(P6(Ve),!_e.moved){var pt=Ve.clientX-Ge,Ie=Ve.clientY-fe;_e.moved=pt*pt+Ie*Ie>q}_e.event(Ve).zoom("mouse",i(L(_e.that.__zoom,_e.mouse[0]=Ov(Ve,$),_e.mouse[1]),_e.extent,b))}function yt(Ve){le.on("mousemove.zoom mouseup.zoom",null),rme(Ve.view,_e.moved),P6(Ve),_e.event(Ve).end()}}function je(me,...be){if(o.apply(this,arguments)){var $=this.__zoom,_e=Ov(me.changedTouches?me.changedTouches[0]:me,this),le=$.invert(_e),He=$.k*(me.shiftKey?.5:2),Ge=i(L(W($,He),_e,le),s.apply(this,be),b);P6(me),C>0?Mh(this).transition().duration(C).call(Ke,Ge,_e,me):Mh(this).call(G.transform,Ge,_e,me)}}function Ce(me,...be){if(o.apply(this,arguments)){var $=me.touches,_e=$.length,le=Be(this,be,me.changedTouches.length===_e).event(me),He,Ge,fe,Ue;for(Cte(me),Ge=0;Ge<_e;++Ge)fe=$[Ge],Ue=Ov(fe,this),Ue=[Ue,this.__zoom.invert(Ue),fe.identifier],le.touch0?!le.touch1&&le.touch0[2]!==Ue[2]&&(le.touch1=Ue,le.taps=0):(le.touch0=Ue,He=!0,le.taps=1+!!N);N&&(N=clearTimeout(N)),He&&(le.taps<2&&(O=Ue[0],N=setTimeout(function(){N=null},I)),cz(this),le.start())}}function ce(me,...be){if(this.__zooming){var $=Be(this,be).event(me),_e=me.changedTouches,le=_e.length,He,Ge,fe,Ue;for(P6(me),He=0;He<le;++He)Ge=_e[He],fe=Ov(Ge,this),$.touch0&&$.touch0[2]===Ge.identifier?$.touch0[0]=fe:$.touch1&&$.touch1[2]===Ge.identifier&&($.touch1[0]=fe);if(Ge=$.that.__zoom,$.touch1){var yt=$.touch0[0],Ve=$.touch0[1],pt=$.touch1[0],Ie=$.touch1[1],mt=(mt=pt[0]-yt[0])*mt+(mt=pt[1]-yt[1])*mt,oe=(oe=Ie[0]-Ve[0])*oe+(oe=Ie[1]-Ve[1])*oe;Ge=W(Ge,Math.sqrt(mt/oe)),fe=[(yt[0]+pt[0])/2,(yt[1]+pt[1])/2],Ue=[(Ve[0]+Ie[0])/2,(Ve[1]+Ie[1])/2]}else if($.touch0)fe=$.touch0[0],Ue=$.touch0[1];else return;$.zoom("touch",i(L(Ge,fe,Ue),$.extent,b))}}function Dt(me,...be){if(this.__zooming){var $=Be(this,be).event(me),_e=me.changedTouches,le=_e.length,He,Ge;for(Cte(me),R&&clearTimeout(R),R=setTimeout(function(){R=null},I),He=0;He<le;++He)Ge=_e[He],$.touch0&&$.touch0[2]===Ge.identifier?delete $.touch0:$.touch1&&$.touch1[2]===Ge.identifier&&delete $.touch1;if($.touch1&&!$.touch0&&($.touch0=$.touch1,delete $.touch1),$.touch0)$.touch0[1]=this.__zoom.invert($.touch0[0]);else if($.end(),$.taps===2&&(Ge=Ov(Ge,this),Math.hypot(O[0]-Ge[0],O[1]-Ge[1])<J)){var fe=Mh(this).on("dblclick.zoom");fe&&fe.apply(this,arguments)}}}return G.wheelDelta=function(me){return arguments.length?(u=typeof me=="function"?me:LH(+me),G):u},G.filter=function(me){return arguments.length?(o=typeof me=="function"?me:LH(!!me),G):o},G.touchable=function(me){return arguments.length?(m=typeof me=="function"?me:LH(!!me),G):m},G.extent=function(me){return arguments.length?(s=typeof me=="function"?me:LH([[+me[0][0],+me[0][1]],[+me[1][0],+me[1][1]]]),G):s},G.scaleExtent=function(me){return arguments.length?(h[0]=+me[0],h[1]=+me[1],G):[h[0],h[1]]},G.translateExtent=function(me){return arguments.length?(b[0][0]=+me[0][0],b[1][0]=+me[1][0],b[0][1]=+me[0][1],b[1][1]=+me[1][1],G):[[b[0][0],b[0][1]],[b[1][0],b[1][1]]]},G.constrain=function(me){return arguments.length?(i=me,G):i},G.duration=function(me){return arguments.length?(C=+me,G):C},G.interpolate=function(me){return arguments.length?(S=me,G):S},G.on=function(){var me=_.on.apply(_,arguments);return me===_?G:me},G.clickDistance=function(me){return arguments.length?(q=(me=+me)*me,G):Math.sqrt(q)},G.tapDistance=function(me){return arguments.length?(J=+me,G):J},G}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 O8e=["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 O8e.includes(u==null?void 0:u.nodeName)||m||!!h}function $8e(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 Wo, toValue as ht, 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 tl, onActivated as Ppe, onDeactivated as Bpe, h as qa, withModifiers as oC, Teleport as Goe, normalizeClass as ci, 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.129";
6
+ const Jpe = "0.0.130";
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() {
@@ -68586,7 +68586,8 @@ function Nme() {
68586
68586
  const Rt = f.value.find((fe) => fe.id === le);
68587
68587
  Rt && (X.value ? o.value.some((fe) => I4(fe) === I4(Rt)) ? Ee = o.value.filter((ve) => I4(ve) !== I4(Rt)) : Ee = [...o.value, Rt] : Rt && (Ee = [Rt]));
68588
68588
  }
68589
- }
68589
+ } else
68590
+ X.value && (Ee = [...o.value]);
68590
68591
  Ee = F(Ee), s(Ee);
68591
68592
  }
68592
68593
  }, j = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyui/components",
3
- "version": "0.0.129",
3
+ "version": "0.0.130",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.mjs",
6
6
  "types": "./es/index.d.ts",