@zyui/components 0.0.115 → 0.0.116

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.115";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 Lce(o,s){return function(){return o.apply(s,arguments)}}const{toString:Qge}=Object.prototype,{getPrototypeOf:Wne}=Object,tU=(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=>tU(s)===o),nU=o=>s=>typeof s===o,{isArray:w4}=Array,oB=nU("undefined");function ehe(o){return o!==null&&!oB(o)&&o.constructor!==null&&!oB(o.constructor)&&wp(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const Vce=Rh("ArrayBuffer");function the(o){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(o):s=o&&o.buffer&&Vce(o.buffer),s}const nhe=nU("string"),wp=nU("function"),Hce=nU("number"),oU=o=>o!==null&&typeof o=="object",ohe=o=>o===!0||o===!1,XH=o=>{if(tU(o)!=="object")return!1;const s=Wne(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=>oU(o)&&wp(o.pipe),che=o=>{let s;return o&&(typeof FormData=="function"&&o instanceof FormData||wp(o.append)&&((s=tU(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 zce(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,Uce=o=>!oB(o)&&o!==gE;function Zte(){const{caseless:o}=Uce(this)&&this||{},s={},i=(u,m)=>{const h=o&&zce(s,m)||m;XH(s[h])&&XH(u)?s[h]=Zte(s[h],u):XH(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]=Lce(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&&Wne(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(!Hce(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"&&Wne(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"),jce=(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=>{jce(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",Wce={DIGIT:jre,ALPHA:Ree,ALPHA_DIGIT:Ree+Ree.toUpperCase()+jre},Dhe=(o=16,s=Wce.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(oU(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);!oB(S)&&(h[C]=S)}),s[m]=void 0,h}}return u};return i(o,0)},Rhe=Rh("AsyncFunction"),Ihe=o=>o&&(oU(o)||wp(o))&&wp(o.then)&&wp(o.catch),Zce=((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||Zce,Ln={isArray:w4,isArrayBuffer:Vce,isBuffer:ehe,isFormData:che,isArrayBufferView:the,isString:nhe,isNumber:Hce,isBoolean:ohe,isObject:oU,isPlainObject:XH,isReadableStream:dhe,isRequest:fhe,isResponse:mhe,isHeaders:phe,isUndefined:oB,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:tU,kindOfTest:Rh,endsWith:whe,toArray:Che,forEachEntry:xhe,matchAll:Ehe,isHTMLForm:_he,hasOwnProperty:Ure,hasOwnProp:Ure,reduceDescriptors:jce,freezeMethods:Ahe,toObjectSet:Nhe,toCamelCase:khe,noop:Ohe,toFiniteNumber:$he,findKey:zce,global:gE,isContextDefined:Uce,ALPHABET:Wce,generateString:Dhe,isSpecCompliantForm:Mhe,toJSONObject:Bhe,isAsyncFn:Rhe,isThenable:Ihe,setImmediate:Zce,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 Gce=kr.prototype,qce={};["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=>{qce[o]={value:o}});Object.defineProperties(kr,qce);Object.defineProperty(Gce,"isAxiosError",{value:!0});kr.from=(o,s,i,u,m,h)=>{const b=Object.create(Gce);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 Yce(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=Yce(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 sU(o,s,i){if(!Ln.isObject(o))throw new TypeError("target must be an object");s=s||new FormData,i=Ln.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(I,W){return!Ln.isUndefined(W[I])});const u=i.metaTokens,m=i.visitor||_,h=i.dots,b=i.indexes,C=(i.Blob||typeof Blob<"u"&&Blob)&&Ln.isSpecCompliantForm(s);if(!Ln.isFunction(m))throw new TypeError("visitor must be a function");function S(I){if(I===null)return"";if(Ln.isDate(I))return I.toISOString();if(!C&&Ln.isBlob(I))throw new kr("Blob is not supported. Use a Buffer instead.");return Ln.isArrayBuffer(I)||Ln.isTypedArray(I)?C&&typeof Blob=="function"?new Blob([I]):Buffer.from(I):I}function _(I,W,G){let Q=I;if(I&&!G&&typeof I=="object"){if(Ln.endsWith(W,"{}"))W=u?W:W.slice(0,-2),I=JSON.stringify(I);else if(Ln.isArray(I)&&Lhe(I)||(Ln.isFileList(I)||Ln.endsWith(W,"[]"))&&(Q=Ln.toArray(I)))return W=Yce(W),Q.forEach(function(q,Z){!(Ln.isUndefined(q)||q===null)&&s.append(b===!0?Wre([W],Z,h):b===null?W:W+"[]",S(q))}),!1}return Gte(I)?!0:(s.append(Wre(G,W,h),S(I)),!1)}const N=[],O=Object.assign(Vhe,{defaultVisitor:_,convertValue:S,isVisitable:Gte});function R(I,W){if(!Ln.isUndefined(I)){if(N.indexOf(I)!==-1)throw Error("Circular reference detected in "+W.join("."));N.push(I),Ln.forEach(I,function(G,Q){(!(Ln.isUndefined(G)||G===null)&&m.call(s,G,Ln.isString(Q)?Q.trim():Q,W,O))===!0&&R(G,W?W.concat(Q):[Q])}),N.pop()}}if(!Ln.isObject(o))throw new TypeError("data must be an object");return R(o),s}function Zre(o){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(i){return s[i]})}function Zne(o,s){this._pairs=[],o&&sU(o,this,s)}const Kce=Zne.prototype;Kce.append=function(o,s){this._pairs.push([o,s])};Kce.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 Xce(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 Zne(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 Jce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zhe=typeof URLSearchParams<"u"?URLSearchParams:Zne,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"]},Gne=typeof window<"u"&&typeof document<"u",qte=typeof navigator=="object"&&navigator||void 0,Zhe=Gne&&(!qte||["ReactNative","NativeScript","NS"].indexOf(qte.product)<0),Ghe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",qhe=Gne&&window.location.href||"http://localhost",Yhe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Gne,hasStandardBrowserEnv:Zhe,hasStandardBrowserWebWorkerEnv:Ghe,navigator:qte,origin:qhe},Symbol.toStringTag,{value:"Module"})),Kd={...Yhe,...Whe};function Khe(o,s){return sU(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 Qce(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:Jce,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(Qce(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 sU(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.116";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 Lce(o,s){return function(){return o.apply(s,arguments)}}const{toString:Qge}=Object.prototype,{getPrototypeOf:Wne}=Object,tU=(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=>tU(s)===o),nU=o=>s=>typeof s===o,{isArray:w4}=Array,oB=nU("undefined");function ehe(o){return o!==null&&!oB(o)&&o.constructor!==null&&!oB(o.constructor)&&wp(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const Vce=Rh("ArrayBuffer");function the(o){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(o):s=o&&o.buffer&&Vce(o.buffer),s}const nhe=nU("string"),wp=nU("function"),Hce=nU("number"),oU=o=>o!==null&&typeof o=="object",ohe=o=>o===!0||o===!1,XH=o=>{if(tU(o)!=="object")return!1;const s=Wne(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=>oU(o)&&wp(o.pipe),che=o=>{let s;return o&&(typeof FormData=="function"&&o instanceof FormData||wp(o.append)&&((s=tU(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 zce(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,Uce=o=>!oB(o)&&o!==gE;function Zte(){const{caseless:o}=Uce(this)&&this||{},s={},i=(u,m)=>{const h=o&&zce(s,m)||m;XH(s[h])&&XH(u)?s[h]=Zte(s[h],u):XH(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]=Lce(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&&Wne(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(!Hce(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"&&Wne(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"),jce=(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=>{jce(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",Wce={DIGIT:jre,ALPHA:Ree,ALPHA_DIGIT:Ree+Ree.toUpperCase()+jre},Dhe=(o=16,s=Wce.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(oU(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);!oB(S)&&(h[C]=S)}),s[m]=void 0,h}}return u};return i(o,0)},Rhe=Rh("AsyncFunction"),Ihe=o=>o&&(oU(o)||wp(o))&&wp(o.then)&&wp(o.catch),Zce=((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||Zce,Ln={isArray:w4,isArrayBuffer:Vce,isBuffer:ehe,isFormData:che,isArrayBufferView:the,isString:nhe,isNumber:Hce,isBoolean:ohe,isObject:oU,isPlainObject:XH,isReadableStream:dhe,isRequest:fhe,isResponse:mhe,isHeaders:phe,isUndefined:oB,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:tU,kindOfTest:Rh,endsWith:whe,toArray:Che,forEachEntry:xhe,matchAll:Ehe,isHTMLForm:_he,hasOwnProperty:Ure,hasOwnProp:Ure,reduceDescriptors:jce,freezeMethods:Ahe,toObjectSet:Nhe,toCamelCase:khe,noop:Ohe,toFiniteNumber:$he,findKey:zce,global:gE,isContextDefined:Uce,ALPHABET:Wce,generateString:Dhe,isSpecCompliantForm:Mhe,toJSONObject:Bhe,isAsyncFn:Rhe,isThenable:Ihe,setImmediate:Zce,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 Gce=kr.prototype,qce={};["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=>{qce[o]={value:o}});Object.defineProperties(kr,qce);Object.defineProperty(Gce,"isAxiosError",{value:!0});kr.from=(o,s,i,u,m,h)=>{const b=Object.create(Gce);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 Yce(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=Yce(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 sU(o,s,i){if(!Ln.isObject(o))throw new TypeError("target must be an object");s=s||new FormData,i=Ln.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(I,W){return!Ln.isUndefined(W[I])});const u=i.metaTokens,m=i.visitor||_,h=i.dots,b=i.indexes,C=(i.Blob||typeof Blob<"u"&&Blob)&&Ln.isSpecCompliantForm(s);if(!Ln.isFunction(m))throw new TypeError("visitor must be a function");function S(I){if(I===null)return"";if(Ln.isDate(I))return I.toISOString();if(!C&&Ln.isBlob(I))throw new kr("Blob is not supported. Use a Buffer instead.");return Ln.isArrayBuffer(I)||Ln.isTypedArray(I)?C&&typeof Blob=="function"?new Blob([I]):Buffer.from(I):I}function _(I,W,G){let Q=I;if(I&&!G&&typeof I=="object"){if(Ln.endsWith(W,"{}"))W=u?W:W.slice(0,-2),I=JSON.stringify(I);else if(Ln.isArray(I)&&Lhe(I)||(Ln.isFileList(I)||Ln.endsWith(W,"[]"))&&(Q=Ln.toArray(I)))return W=Yce(W),Q.forEach(function(q,Z){!(Ln.isUndefined(q)||q===null)&&s.append(b===!0?Wre([W],Z,h):b===null?W:W+"[]",S(q))}),!1}return Gte(I)?!0:(s.append(Wre(G,W,h),S(I)),!1)}const N=[],O=Object.assign(Vhe,{defaultVisitor:_,convertValue:S,isVisitable:Gte});function R(I,W){if(!Ln.isUndefined(I)){if(N.indexOf(I)!==-1)throw Error("Circular reference detected in "+W.join("."));N.push(I),Ln.forEach(I,function(G,Q){(!(Ln.isUndefined(G)||G===null)&&m.call(s,G,Ln.isString(Q)?Q.trim():Q,W,O))===!0&&R(G,W?W.concat(Q):[Q])}),N.pop()}}if(!Ln.isObject(o))throw new TypeError("data must be an object");return R(o),s}function Zre(o){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(i){return s[i]})}function Zne(o,s){this._pairs=[],o&&sU(o,this,s)}const Kce=Zne.prototype;Kce.append=function(o,s){this._pairs.push([o,s])};Kce.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 Xce(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 Zne(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 Jce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zhe=typeof URLSearchParams<"u"?URLSearchParams:Zne,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"]},Gne=typeof window<"u"&&typeof document<"u",qte=typeof navigator=="object"&&navigator||void 0,Zhe=Gne&&(!qte||["ReactNative","NativeScript","NS"].indexOf(qte.product)<0),Ghe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",qhe=Gne&&window.location.href||"http://localhost",Yhe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Gne,hasStandardBrowserEnv:Zhe,hasStandardBrowserWebWorkerEnv:Ghe,navigator:qte,origin:qhe},Symbol.toStringTag,{value:"Module"})),Kd={...Yhe,...Whe};function Khe(o,s){return sU(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 Qce(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:Jce,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(Qce(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 sU(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 $6(o){return o&&String(o).trim().toLowerCase()}function JH(o){return o===!1||o==null?o:Ln.isArray(o)?o.map(JH):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=$6(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]=JH(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=$6(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=$6(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=$6(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]=JH(m),delete i[h];return}const C=s?s1e(h):String(h).trim();C!==h&&delete i[h],i[C]=JH(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=$6(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 eue(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 tue(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 hz=(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 nue(o,s){return o&&!d1e(s)?f1e(o,s):s}const Xre=o=>o instanceof xm?{...o}:o;function kE(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 oue=o=>{const s=kE({},o);let{data:i,withXSRFToken:u,xsrfHeaderName:m,xsrfCookieName:h,headers:b,auth:C}=s;s.headers=b=xm.from(b),s.url=Xce(nue(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=oue(o);let m=u.data;const h=xm.from(u.headers).normalize();let{responseType:b,onUploadProgress:C,onDownloadProgress:S}=u,_,N,O,R,I;function W(){R&&R(),I&&I(),u.cancelToken&&u.cancelToken.unsubscribe(_),u.signal&&u.signal.removeEventListener("abort",_)}let G=new XMLHttpRequest;G.open(u.method.toUpperCase(),u.url,!0),G.timeout=u.timeout;function Q(){if(!G)return;const Z=xm.from("getAllResponseHeaders"in G&&G.getAllResponseHeaders()),L={data:!b||b==="text"||b==="json"?G.responseText:G.response,status:G.status,statusText:G.statusText,headers:Z,config:o,request:G};tue(function(de){s(de),W()},function(de){i(de),W()},L),G=null}"onloadend"in G?G.onloadend=Q:G.onreadystatechange=function(){!G||G.readyState!==4||G.status===0&&!(G.responseURL&&G.responseURL.indexOf("file:")===0)||setTimeout(Q)},G.onabort=function(){G&&(i(new kr("Request aborted",kr.ECONNABORTED,o,G)),G=null)},G.onerror=function(){i(new kr("Network Error",kr.ERR_NETWORK,o,G)),G=null},G.ontimeout=function(){let Z=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded";const L=u.transitional||Jce;u.timeoutErrorMessage&&(Z=u.timeoutErrorMessage),i(new kr(Z,L.clarifyTimeoutError?kr.ETIMEDOUT:kr.ECONNABORTED,o,G)),G=null},m===void 0&&h.setContentType(null),"setRequestHeader"in G&&Ln.forEach(h.toJSON(),function(Z,L){G.setRequestHeader(L,Z)}),Ln.isUndefined(u.withCredentials)||(G.withCredentials=!!u.withCredentials),b&&b!=="json"&&(G.responseType=u.responseType),S&&([O,I]=hz(S,!0),G.addEventListener("progress",O)),C&&G.upload&&([N,R]=hz(C),G.upload.addEventListener("progress",N),G.upload.addEventListener("loadend",R)),(u.cancelToken||u.signal)&&(_=Z=>{G&&(i(!Z||Z.type?new C4(null,o,G):Z),G.abort(),G=null)},u.cancelToken&&u.cancelToken.subscribe(_),u.signal&&(u.signal.aborted?_():u.signal.addEventListener("abort",_)));const q=a1e(u.url);if(q&&Kd.protocols.indexOf(q)===-1){i(new kr("Unsupported protocol "+q+":",kr.ERR_BAD_REQUEST,o));return}G.send(m||null)})},g1e=(o,s)=>{const{length:i}=o=o?o.filter(Boolean):[];if(s||i){let u=new AbortController,m;const h=function(_){if(!m){m=!0,C();const N=_ instanceof Error?_:this.reason;u.abort(N instanceof kr?N:new C4(N instanceof Error?N.message:N))}};let b=s&&setTimeout(()=>{b=null,h(new kr(`timeout ${s} of ms exceeded`,kr.ETIMEDOUT))},s);const C=()=>{o&&(b&&clearTimeout(b),b=null,o.forEach(_=>{_.unsubscribe?_.unsubscribe(h):_.removeEventListener("abort",h)}),o=null)};o.forEach(_=>_.addEventListener("abort",h));const{signal:S}=u;return S.unsubscribe=()=>Ln.asap(C),S}},h1e=function*(o,s){let i=o.byteLength;if(i<s){yield o;return}let u=0,m;for(;u<i;)m=u+s,yield o.slice(u,m),u=m},v1e=async function*(o,s){for await(const i of b1e(o))yield*h1e(i,s)},b1e=async function*(o){if(o[Symbol.asyncIterator]){yield*o;return}const s=o.getReader();try{for(;;){const{done:i,value:u}=await s.read();if(i)break;yield u}}finally{await s.cancel()}},Jre=(o,s,i,u)=>{const m=v1e(o,s);let h=0,b,C=S=>{b||(b=!0,u&&u(S))};return new ReadableStream({async pull(S){try{const{done:_,value:N}=await m.next();if(_){C(),S.close();return}let O=N.byteLength;if(i){let R=h+=O;i(R)}S.enqueue(new Uint8Array(N))}catch(_){throw C(_),_}},cancel(S){return C(S),m.return()}},{highWaterMark:2})},rU=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",sue=rU&&typeof ReadableStream=="function",y1e=rU&&(typeof TextEncoder=="function"?(o=>s=>o.encode(s))(new TextEncoder):async o=>new Uint8Array(await new Response(o).arrayBuffer())),rue=(o,...s)=>{try{return!!o(...s)}catch{return!1}},w1e=sue&&rue(()=>{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=sue&&rue(()=>Ln.isReadableStream(new Response("").body)),vz={stream:Yte&&(o=>o.body)};rU&&(o=>{["text","arrayBuffer","blob","formData","stream"].forEach(s=>{!vz[s]&&(vz[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=rU&&(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}=oue(o);_=_?(_+"").toLowerCase():"text";let I=g1e([m,h&&h.toAbortSignal()],b),W;const G=I&&I.unsubscribe&&(()=>{I.unsubscribe()});let Q;try{if(S&&w1e&&i!=="get"&&i!=="head"&&(Q=await S1e(N,u))!==0){let Ve=new Request(s,{method:"POST",body:u,duplex:"half"}),Se;if(Ln.isFormData(u)&&(Se=Ve.headers.get("content-type"))&&N.setContentType(Se),Ve.body){const[J,Fe]=Yre(Q,hz(Kre(S)));u=Jre(Ve.body,Qre,J,Fe)}}Ln.isString(O)||(O=O?"include":"omit");const q="credentials"in Request.prototype;W=new Request(s,{...R,signal:I,method:i.toUpperCase(),headers:N.normalize().toJSON(),body:u,duplex:"half",credentials:q?O:void 0});let Z=await fetch(W);const L=Yte&&(_==="stream"||_==="response");if(Yte&&(C||L&&G)){const Ve={};["status","statusText","headers"].forEach(it=>{Ve[it]=Z[it]});const Se=Ln.toFiniteNumber(Z.headers.get("content-length")),[J,Fe]=C&&Yre(Se,hz(Kre(C),!0))||[];Z=new Response(Jre(Z.body,Qre,J,()=>{Fe&&Fe(),G&&G()}),Ve)}_=_||"text";let de=await vz[Ln.findKey(vz,_)||"text"](Z,o);return!L&&G&&G(),await new Promise((Ve,Se)=>{tue(Ve,Se,{data:de,headers:xm.from(Z.headers),status:Z.status,statusText:Z.statusText,config:o,request:W})})}catch(q){throw G&&G(),q&&q.name==="TypeError"&&/fetch/i.test(q.message)?Object.assign(new kr("Network Error",kr.ERR_NETWORK,o,W),{cause:q.cause||q}):kr.from(q,q&&q.code,o,W)}}),Kte={http:Fhe,xhr:p1e,fetch:x1e};Ln.forEach(Kte,(o,s)=>{if(o){try{Object.defineProperty(o,"name",{value:s})}catch{}Object.defineProperty(o,"adapterName",{value:s})}});const eae=o=>`- ${o}`,E1e=o=>Ln.isFunction(o)||o===null||o===!1,aue={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=Ne=>je=>(Ot=>{const Dt=typeof Ot;return Ot===null?"null":Dt==="object"&&Array.isArray(Ot)?"array":Dt==="object"&&(pn=yn=Ot,(Nt=String).prototype.isPrototypeOf(pn)||((St=yn.constructor)===null||St===void 0?void 0:St.name)===Nt.name)?"string":Dt;var pn,yn,Nt,St})(je)===Ne,s=Ne=>je=>typeof je===Ne,i=o("string"),u=o("array"),m=s("boolean"),h=Ne=>Ne===void 0,b=Ne=>!(je=>je==null)(Ne),C=s("function"),S=s("number"),_=Ne=>()=>Ne,N=Ne=>Ne,O=_(!1),R=_(!0);class I{constructor(je,Ot){this.tag=je,this.value=Ot}static some(je){return new I(!0,je)}static none(){return I.singletonNone}fold(je,Ot){return this.tag?Ot(this.value):je()}isSome(){return this.tag}isNone(){return!this.tag}map(je){return this.tag?I.some(je(this.value)):I.none()}bind(je){return this.tag?je(this.value):I.none()}exists(je){return this.tag&&je(this.value)}forall(je){return!this.tag||je(this.value)}filter(je){return!this.tag||je(this.value)?this:I.none()}getOr(je){return this.tag?this.value:je}or(je){return this.tag?this:je}getOrThunk(je){return this.tag?this.value:je()}orThunk(je){return this.tag?this:je()}getOrDie(je){if(this.tag)return this.value;throw new Error(je??"Called getOrDie on None")}static from(je){return b(je)?I.some(je):I.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(je){this.tag&&je(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}I.singletonNone=new I(!1);const W=Array.prototype.indexOf,G=Array.prototype.push,Q=(Ne,je)=>((Ot,Dt)=>W.call(Ot,Dt))(Ne,je)>-1,q=(Ne,je)=>{for(let Ot=0,Dt=Ne.length;Ot<Dt;Ot++)if(je(Ne[Ot],Ot))return!0;return!1},Z=(Ne,je)=>{const Ot=Ne.length,Dt=new Array(Ot);for(let pn=0;pn<Ot;pn++){const yn=Ne[pn];Dt[pn]=je(yn,pn)}return Dt},L=(Ne,je)=>{const Ot=[];for(let Dt=0,pn=Ne.length;Dt<pn;Dt++){const yn=Ne[Dt];je(yn,Dt)&&Ot.push(yn)}return Ot},de=(Ne,je)=>((Ot,Dt,pn)=>{for(let yn=0,Nt=Ot.length;yn<Nt;yn++){const St=Ot[yn];if(Dt(St,yn))return I.some(St);if(pn(St,yn))break}return I.none()})(Ne,je,O),Ve=(Ne,je)=>(Ot=>{const Dt=[];for(let pn=0,yn=Ot.length;pn<yn;++pn){if(!u(Ot[pn]))throw new Error("Arr.flatten item "+pn+" was not an array, input: "+Ot);G.apply(Dt,Ot[pn])}return Dt})(Z(Ne,je)),Se=Object.keys,J=Object.hasOwnProperty,Fe=(Ne,je)=>{const Ot=Se(Ne);for(let Dt=0,pn=Ot.length;Dt<pn;Dt++){const yn=Ot[Dt];je(Ne[yn],yn)}},it=(Ne,je)=>{const Ot={};return Fe(Ne,(Dt,pn)=>{const yn=je(Dt,pn);Ot[yn.k]=yn.v}),Ot},rt=Ne=>(je,Ot)=>{Ne[Ot]=je},De=Ne=>((je,Ot)=>{const Dt=[];return Fe(je,(pn,yn)=>{Dt.push(Ot(pn,yn))}),Dt})(Ne,N),ce=(Ne,je)=>zt(Ne,je)?I.from(Ne[je]):I.none(),zt=(Ne,je)=>J.call(Ne,je),he=Ne=>{let je=Ne;return{get:()=>je,set:Ot=>{je=Ot}}},Ee=(Ne,je,Ot=0,Dt)=>{const pn=Ne.indexOf(je,Ot);return pn!==-1&&(!!h(Dt)||pn+je.length<=Dt)},M=Ne=>parseInt(Ne,10),Ze=(Ne,je)=>{const Ot=Ne-je;return Ot===0?0:Ot>0?1:-1},ye=(Ne,je,Ot)=>({major:Ne,minor:je,patch:Ot}),at=Ne=>{const je=/([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec(Ne);return je?ye(M(je[1]),M(je[2]),M(je[3])):ye(0,0,0)},st=()=>ge(0,0),ge=(Ne,je)=>({major:Ne,minor:je}),Ke={nu:ge,detect:(Ne,je)=>{const Ot=String(je).toLowerCase();return Ne.length===0?st():((Dt,pn)=>{const yn=((St,Ge)=>{for(let Xe=0;Xe<St.length;Xe++){const jt=St[Xe];if(jt.test(Ge))return jt}})(Dt,pn);if(!yn)return{major:0,minor:0};const Nt=St=>Number(pn.replace(yn,"$"+St));return ge(Nt(1),Nt(2))})(Ne,Ot)},unknown:st},$t=(Ne,je)=>{const Ot=String(je).toLowerCase();return de(Ne,Dt=>Dt.search(Ot))},Ue=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ht=Ne=>je=>Ee(je,Ne),Pe=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:Ne=>Ee(Ne,"edge/")&&Ee(Ne,"chrome")&&Ee(Ne,"safari")&&Ee(Ne,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ue],search:Ne=>Ee(Ne,"chrome")&&!Ee(Ne,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:Ne=>Ee(Ne,"msie")||Ee(Ne,"trident")},{name:"Opera",versionRegexes:[Ue,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ht("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ht("firefox")},{name:"Safari",versionRegexes:[Ue,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:Ne=>(Ee(Ne,"safari")||Ee(Ne,"mobile/"))&&Ee(Ne,"applewebkit")}],mt=[{name:"Windows",search:ht("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:Ne=>Ee(Ne,"iphone")||Ee(Ne,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ht("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:ht("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ht("linux"),versionRegexes:[]},{name:"Solaris",search:ht("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ht("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:ht("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],oe={browsers:_(Pe),oses:_(mt)},vn=Ne=>{const je=Ne.current,Ot=Ne.version,Dt=pn=>()=>je===pn;return{current:je,version:Ot,isEdge:Dt("Edge"),isChromium:Dt("Chromium"),isIE:Dt("IE"),isOpera:Dt("Opera"),isFirefox:Dt("Firefox"),isSafari:Dt("Safari")}},bt=()=>vn({current:void 0,version:Ke.unknown()}),Et=vn,qt=Ne=>{const je=Ne.current,Ot=Ne.version,Dt=pn=>()=>je===pn;return{current:je,version:Ot,isWindows:Dt("Windows"),isiOS:Dt("iOS"),isAndroid:Dt("Android"),isMacOS:Dt("macOS"),isLinux:Dt("Linux"),isSolaris:Dt("Solaris"),isFreeBSD:Dt("FreeBSD"),isChromeOS:Dt("ChromeOS")}},xt=()=>qt({current:void 0,version:Ke.unknown()}),te=qt,ie=(Ne,je,Ot)=>{const Dt=oe.browsers(),pn=oe.oses(),yn=je.bind(Ge=>((Xe,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 de(Xe,jn=>{var Yn;return Dn===((Yn=jn.brand)===null||Yn===void 0?void 0:Yn.toLowerCase())}).map(jn=>({current:jn.name,version:Ke.nu(parseInt(nn.version,10),0)}))}))(Dt,Ge)).orThunk(()=>((Ge,Xe)=>$t(Ge,Xe).map(jt=>{const nn=Ke.detect(jt.versionRegexes,Xe);return{current:jt.name,version:nn}}))(Dt,Ne)).fold(bt,Et),Nt=((Ge,Xe)=>$t(Ge,Xe).map(jt=>{const nn=Ke.detect(jt.versionRegexes,Xe);return{current:jt.name,version:nn}}))(pn,Ne).fold(xt,te),St=((Ge,Xe,jt,nn)=>{const Dn=Ge.isiOS()&&/ipad/i.test(jt)===!0,jn=Ge.isiOS()&&!Dn,Yn=Ge.isiOS()||Ge.isAndroid(),Wn=Yn||nn("(pointer:coarse)"),go=Dn||!jn&&Yn&&nn("(min-device-width:768px)"),ko=jn||Yn&&!go,qo=Xe.isSafari()&&Ge.isiOS()&&/safari/i.test(jt)===!1,Ms=!ko&&!go&&!qo;return{isiPad:_(Dn),isiPhone:_(jn),isTablet:_(go),isPhone:_(ko),isTouch:_(Wn),isAndroid:Ge.isAndroid,isiOS:Ge.isiOS,isWebView:_(qo),isDesktop:_(Ms)}})(Nt,yn,Ne,Ot);return{browser:yn,os:Nt,deviceType:St}},ue=Ne=>window.matchMedia(Ne).matches;let K=(Ne=>{let je,Ot=!1;return(...Dt)=>(Ot||(Ot=!0,je=Ne.apply(null,Dt)),je)})(()=>ie(window.navigator.userAgent,I.from(window.navigator.userAgentData),ue));const we=()=>K(),Be=Ne=>{if(Ne==null)throw new Error("Node cannot be null or undefined");return{dom:Ne}},Re=Be,gt=(Ne,je)=>Ne.dom===je.dom,Ye=(Ne,je)=>{const Ot=Ne.dom;if(Ot.nodeType!==1)return!1;{const Dt=Ot;if(Dt.matches!==void 0)return Dt.matches(je);if(Dt.msMatchesSelector!==void 0)return Dt.msMatchesSelector(je);if(Dt.webkitMatchesSelector!==void 0)return Dt.webkitMatchesSelector(je);if(Dt.mozMatchesSelector!==void 0)return Dt.mozMatchesSelector(je);throw new Error("Browser lacks native selectors")}},yt=Ne=>je=>(Ot=>Ot.dom.nodeType)(je)===Ne,Pt=yt(1),bn=yt(3),kt=yt(11),Vt=Ne=>Re(Ne.dom.host),hn=(Ne,je,Ot)=>{((Dt,pn,yn)=>{if(!(i(yn)||m(yn)||S(yn)))throw console.error("Invalid call to Attribute.set. Key ",pn,":: Value ",yn,":: Element ",Dt),new Error("Attribute value was not simple");Dt.setAttribute(pn,yn+"")})(Ne.dom,je,Ot)},kn=(Ne,je)=>{const Ot=Ne.dom.getAttribute(je);return Ot===null?void 0:Ot},Eo=(Ne,je)=>{Ne.dom.removeAttribute(je)},to=Ne=>{const je=bn(Ne)?Ne.dom.parentNode:Ne.dom;if(je==null||je.ownerDocument===null)return!1;const Ot=je.ownerDocument;return(yn=>{const Nt=(Ge=>Re(Ge.dom.getRootNode()))(yn);return kt(St=Nt)&&b(St.dom.host)?I.some(Nt):I.none();var St})(Re(je)).fold(()=>Ot.body.contains(je),(Dt=to,pn=Vt,yn=>Dt(pn(yn))));var Dt,pn},Rt=(Ne,je)=>{const Ot=Ne.dom,Dt=window.getComputedStyle(Ot).getPropertyValue(je);return Dt!==""||to(Ne)?Dt:dn(Ot,je)},dn=(Ne,je)=>(Ot=>Ot.style!==void 0&&C(Ot.style.getPropertyValue))(Ne)?Ne.style.getPropertyValue(je):"",an=(Ne,je)=>{const Ot=kn(Ne,je);return Ot===void 0||Ot===""?[]:Ot.split(" ")},Bn=(Ne,je,Ot)=>{let Dt=Ne.dom;const pn=C(Ot)?Ot:O;for(;Dt.parentNode;){Dt=Dt.parentNode;const yn=Re(Dt);if(je(yn))return I.some(yn);if(pn(yn))break}return I.none()},_o=(Ne,je,Ot)=>((Dt,pn,yn,Nt,St)=>Nt(yn)?I.some(yn):C(St)&&St(yn)?I.none():pn(yn,Nt,St))(0,Bn,Ne,je,Ot),Do=Ne=>Ne.dom.classList!==void 0,ms=Ne=>an(Ne,"class"),Co=(Ne,je)=>{Do(Ne)?Ne.dom.classList.remove(je):((Ot,Dt)=>{((pn,yn,Nt)=>{const St=L(an(pn,yn),Ge=>Ge!==Nt);St.length>0?hn(pn,yn,St.join(" ")):Eo(pn,yn)})(Ot,"class",Dt)})(Ne,je),(Ot=>{(Do(Ot)?Ot.dom.classList:ms(Ot)).length===0&&Eo(Ot,"class")})(Ne)},Is=(Ne,je)=>{Ne.dispatch("FormatPainterToggle",{state:je})};var mn,Lo,js,Hs;(function(Ne){Ne.Retrival="Retrieval",Ne.Application="Application"})(mn||(mn={})),function(Ne){Ne.ListSchema="ListSchema",Ne.SubstitutionSchema="SubstitionSchema"}(Lo||(Lo={})),function(Ne){Ne.InsertUnorderedList="InsertUnorderedList",Ne.InsertOrderedList="InsertOrderedList",Ne.InsertDefinitionList="InsertDefinitionList"}(js||(js={})),function(Ne){Ne.Table="Table",Ne.Unspecified="Unspecified"}(Hs||(Hs={}));const Tr=Ne=>{var je,Ot;je=Re(Ne.getBody()),Ot="tox-cursor-format-painter",Do(je)?je.dom.classList.add(Ot):((Dt,pn)=>{((yn,Nt,St)=>{const Ge=an(yn,Nt).concat([St]);hn(yn,Nt,Ge.join(" "))})(Dt,"class",pn)})(je,Ot)},vr=(Ne,je)=>{(Ot=>{Co(Re(Ot.getBody()),"tox-cursor-format-painter")})(Ne),je.set(mn.Retrival),Is(Ne,!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=(Ne,je)=>ce(je,"selector").exists(Ot=>{const Dt=Ne.getBody(),pn=Ne.selection.getStart(),yn=Ne.dom.getParents(pn,R,Dt),Nt=Ne.selection.getSelectedBlocks();return Ne.dom.is([...yn,...Nt],Ot)}),Dr=Ne=>Ne.length>1&&Ne.charAt(0)==="%",ps=(Ne,je)=>ce(Ne,je).filter(Ot=>!u(Ot)),po=Ne=>Ye(Ne,"OL,UL,DL"),Ds=Ne=>Ye(Ne,"LI,DT,DD"),At=Ne=>Ne.replace(/([A-Z])/g,je=>`-${je[0].toLowerCase()}`),Zt=(Ne,je,Ot)=>{const Dt=Ne.formatter,pn=((Ge,Xe)=>q(Ge.formatter.get(Xe),jt=>((nn,Dn)=>zt(Dn,"inline")&&!br(nn,Dn))(Ge,jt)))(Ne,Ot.formatName),yn=((Ge,Xe,jt)=>q(Xe.get(jt),nn=>((Dn,jn)=>zt(jn,"block")||br(Dn,jn))(Ge,nn)))(Ne,Dt,Ot.formatName),Nt=(St=Ot.formatName,Q(["formatpainter_borderstyle","formatpainter_bordercolor","formatpainter_backgroundcolor"],St));var St;(je.table&&Nt||pn||je.block&&yn&&!Nt)&&Dt.apply(Ot.formatName,Ot.substitutedVariables)},Un=Ne=>{const je=Ne.selection,Ot=je.getRng(),Dt=Re(Ne.getBody()),pn=(St=>L(St.selection.getSelectedBlocks().map(Re),Ds))(Ne),yn=Ot.collapsed&&pn.length,Nt=pn.length&&!((St,Ge)=>{const Xe=jn=>gt(jn,Ge);return(jt=_o(Re(St.getStart()),po,Xe),nn=_o(Re(St.getEnd()),po,Xe),Dn=(jn,Yn)=>gt(jn,Yn),jt.isSome()&&nn.isSome()?I.some(Dn(jt.getOrDie(),nn.getOrDie())):I.none()).getOr(!1);var jt,nn,Dn})(je,Dt);return pn.length>1||yn||Nt},uo=Ne=>Ne.options.get("formatpainter_ignored_formats"),Fo=(Ne,je)=>{return je==="class"?(pn=>Do(pn)?(yn=>{const Nt=yn.dom.classList,St=new Array(Nt.length);for(let Ge=0;Ge<Nt.length;Ge++){const Xe=Nt.item(Ge);Xe!==null&&(St[Ge]=Xe)}return St})(pn):ms(pn))(Ne).filter(pn=>!/^(mce-.*)/.test(pn)).join(" "):(Ot=Ne,Dt=je,I.from(kn(Ot,Dt))).getOr("");var Ot,Dt},ss=Ne=>((je,Ot)=>{const Dt={},pn={};return((yn,Nt,St,Ge)=>{Fe(yn,(Xe,jt)=>{(Nt(Xe,jt)?St:Ge)(Xe,jt)})})(je,Ot,rt(Dt),rt(pn)),{t:Dt,f:pn}})(Ne,je=>{return(Ot=je).length>1&&Ot.charAt(0)==="%";var Ot}).t,ur=(Ne,je)=>(Ot=>{const Dt=uo(Ot);return Se(Ot.formatter.get()).filter(pn=>!Q(Dt,pn))})(Ne).filter(Ot=>{const Dt=((pn,yn)=>q(pn.formatter.get(yn),Nt=>(St=>{const Ge=ps(St,"styles").exists(jt=>q(De(jt),Dr)),Xe=ps(St,"attributes").exists(jt=>q(De(jt),Dr));return Ge||Xe})(Nt)))(Ne,Ot);return Ne.formatter.matchNode(je.dom,Ot,{},Dt)}),dr=(Ne,je)=>{const Ot=Z(Ne.dom.getParents(je,R),Re);return Ve(L(Ot,Pt),Dt=>Ve(ur(Ne,Dt),pn=>((yn,Nt,St)=>{return(Ge=yn.get(Nt),(Xe=>0<Xe.length?I.some(Xe[0]):I.none())(Ge)).bind(Xe=>((jt,nn)=>{const Dn=ps(jt,"styles").map(Wn=>{return go=nn,ko=ss(Wn),it(ko,(qo,Ms)=>({k:qo.slice(1,qo.length),v:Rt(go,At(Ms))}));var go,ko}),jn=ps(jt,"attributes").map(Wn=>{return go=nn,ko=ss(Wn),it(ko,(qo,Ms)=>({k:qo.slice(1,qo.length),v:Fo(go,Ms)}));var go,ko}),Yn={...Dn.getOr({}),...jn.getOr({})};return De(Yn).every(Wn=>Wn!=="")?I.some(Yn):I.none()})(Xe,St)).map(Xe=>({kind:Lo.SubstitutionSchema,formatName:Nt,substitutedVariables:Xe}));var Ge})(Ne.formatter,pn,Dt).toArray()))},or=Ne=>(je=>de(De(js),Ot=>je.queryCommandState(Ot)))(Ne).map(je=>({kind:Lo.ListSchema,command:je})),nt=(Ne,je)=>Ne.getParent(je,"TABLE")?Hs.Table:Hs.Unspecified,Qe=(Ne,je,Ot)=>{Ne.addCommand("mceToggleFormatPainter",()=>{((Dt,pn)=>{pn.get()===mn.Application?vr(Dt,pn):((yn,Nt)=>{const St=we(),Ge=he(!1);Tr(yn),Nt.set(mn.Application),Is(yn,!0),yn.execCommand("mceRetrieveFormats");const Xe=()=>{yn.execCommand("mcePaintFormats"),vr(yn,Nt)},jt=()=>{Nt.get()===mn.Application&&Xe(),Yn()},nn=Wn=>{Nt.get()===mn.Application&&(Wn.type==="touchcancel"&&St.os.isAndroid()?yn.once("contextmenu",Xe):Ge.get()?Xe():yn.once("selectionchange",Xe)),Yn()},Dn=Wn=>{Wn.keyCode===27&&(vr(yn,Nt),Yn())},jn=Wn=>{Ge.set(Wn.type==="touchmove")};yn.on("click",jt),yn.on("touchstart touchmove",jn),yn.on("touchend touchcancel",nn),yn.on("keydown",Dn);const Yn=()=>{yn.off("click",jt),yn.off("touchstart touchmove",jn),yn.off("touchend touchcancel",nn),yn.off("keydown",Dn)}})(Dt,pn)})(Ne,je)}),Ne.addCommand("mcePaintFormats",()=>{Ne.selection.isEditable()&&Ne.undoManager.transact(()=>{((Dt,pn)=>{((Nt,St)=>{Nt.formatter.remove("formatpainter_removeformat"),St===Hs.Table&&(Ge=>{for(let jt=0,nn=Ge.length;jt<nn;jt++)Xe=Ge[jt],Nt.formatter.remove(Xe);var Xe})(["formatpainter_borderstyle","formatpainter_bordercolor","formatpainter_backgroundcolor"]),Un(Nt)&&Nt.execCommand("RemoveList")})(Dt,pn.context);const yn=(Nt=>{const St=Nt.selection.getStart(),Ge=Nt.selection.getRng().collapsed,Xe=Nt.dom.select("td[data-mce-selected]").length>0,jt=!!Nt.dom.getParent(St,"TABLE");return{inline:!0,table:Ge&&jt||Xe,block:Ge||(nn=Nt.selection,nn.getSelectedBlocks().length>1)||Xe};var nn})(Dt);pn.schemas.forEach(Nt=>{switch(Nt.kind){case Lo.ListSchema:((St,Ge,Xe)=>{Xe.block&&St.execCommand(Ge.command)})(Dt,Nt,yn);break;case Lo.SubstitutionSchema:Zt(Dt,yn,Nt)}})})(Ne,Ot.get())})}),Ne.addCommand("mceRetrieveFormats",()=>{Ot.set((Dt=>{const pn=Dt.dom,yn=Dt.selection.getStart();return{schemas:[...or(Dt).toArray(),...dr(Dt,yn)],context:nt(pn,yn)}})(Ne))})};tinymce.PluginManager.add("formatpainter",Ne=>{if(((Dt,pn)=>!!Dt&&((yn,Nt)=>{const St=Ze(yn.major,Nt.major);if(St!==0)return St;const Ge=Ze(yn.minor,Nt.minor);if(Ge!==0)return Ge;const Xe=Ze(yn.patch,Nt.patch);return Xe!==0?Xe:0})((yn=>at((Nt=>[Nt.majorVersion,Nt.minorVersion].join(".").split(".").slice(0,3).join("."))(yn)))(Dt),at(pn))===-1)(tinymce,"6.0.0"))return void window.console.error("The format painter plugin requires at least version 6.0.0 of TinyMCE.");const je=he(mn.Retrival),Ot=he({schemas:[],context:Hs.Unspecified});(Dt=>{(0,Dt.options.register)("formatpainter_ignored_formats",{processor:"string[]",default:"link,address,removeformat,formatpainter_removeformat".split(",")})})(Ne),(Dt=>{Dt.on("PreInit",()=>{Fe(_s,(pn,yn)=>{Dt.formatter.get(yn)||Dt.formatter.register(yn,pn)})})})(Ne),Qe(Ne,je,Ot),(Dt=>{Dt.ui.registry.addToggleButton("formatpainter",{active:!1,icon:"format-painter",tooltip:"Format painter",onAction:()=>Dt.execCommand("mceToggleFormatPainter"),onSetup:pn=>{const yn=Nt=>{pn.setActive(Nt.state)};return Dt.on("FormatPainterToggle",yn),()=>Dt.off("FormatPainterToggle",yn)}})})(Ne),((Dt,pn)=>{Dt.ui.registry.addToggleMenuItem("formatpainter",{active:!1,icon:"format-painter",text:"Format painter",onAction:()=>Dt.execCommand("mceToggleFormatPainter"),onSetup:yn=>{const Nt=St=>{yn.setActive(St.state)};return yn.setActive(pn.get()===mn.Application),Dt.on("FormatPainterToggle",Nt),()=>Dt.off("FormatPainterToggle",Nt)}})})(Ne,je),(Dt=>{Dt.addShortcut("Meta+alt+C","",()=>{Dt.execCommand("mceRetrieveFormats")}),Dt.addShortcut("Meta+alt+V","",()=>{Dt.execCommand("mcePaintFormats")})})(Ne)})})();const Efe=["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"],r6e="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 ",_fe="file edit insert table tools help",a6e={menu:{pagesize:{title:"页面大小",items:o6e},orientation:{title:"页面方向",items:s6e}},menubar:_fe+" pagesize orientation",pagesize:"A4",orientation:"portrait",plugins:[...Efe,"pagesize"]},i6e={license_key:"gpl",skin:!1,content_css:["css/content.css","css/reset.css"],promotion:!1,menubar:_fe,cleanup:!0,branding:!1,language:"zh_CN",plugins:Efe,toolbar:r6e,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}`)})})},l6e={name:"ProEditor",components:{Editor:PMe},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(i6e),contentValue:o.modelValue,timeout:null});d.onMounted(()=>{Y6.init({license_key:"gpl"}),Y6.activeEditor.on("pagesizechange",b=>{(o==null?void 0:o.pagesize)!==b.size&&s("update:pagesize",b.size)}),Y6.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=>{!uB(b)&&b!==u.contentValue&&(u.contentValue=b)}),d.watch(()=>o.height,b=>{var C,S,_,N,O,R,I,W;i.value&&((W=(N=(_=(S=(C=i.value)==null?void 0:C.getEditor)==null?void 0:S.call(C))==null?void 0:_.dom)==null?void 0:N.setStyle)==null||W.call(N,(I=(R=(O=i.value)==null?void 0:O.getEditor)==null?void 0:R.call(O))==null?void 0:I.editorContainer,"height",b+"px"))});function m(b,C=400){u.timeout!==null&&clearTimeout(u.timeout),u.timeout=setTimeout(b,C)}function h(b){var O;o!=null&&o.height&&(b.height=o.height),o!=null&&o.width&&(b.width=o.width);const{placeholder:C,pagesize:S,orientation:_}=o,N=`${location==null?void 0:location.origin}/${uB(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?{...a6e,pagesize:S,orientation:_}:{}},b}return{...d.toRefs(u),editorRef:i,customer:h,debounce:m}}},c6e={class:"my-tinymce"};function u6e(o,s,i,u,m,h){const b=d.resolveComponent("Editor");return d.openBlock(),d.createElementBlock("div",c6e,[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 kfe=Ja(l6e,[["render",u6e]]),d6e={name:"ShadowDomWrap",setup(o,{emit:s,expose:i}){const u=d.ref(null),m=d.ref(),h=d.ref(!1),b=Ih(),C=_=>{if(_.target.closest(".context-menu")||!u.value)return;const O=u.value.contains(_.target);!O&&h.value?(h.value=!1,s("onBlur")):O&&!h.value&&(h.value=!0,s("onFocus"))},S=_=>{h.value=!0,s("onFocus"),_.stopPropagation()};return d.onMounted(()=>{var R,I,W,G,Q;m.value=(R=u.value)==null?void 0:R.attachShadow({mode:"open"}),document.addEventListener("click",C);const _=uB(window==null?void 0:window.zyuiAssetsPath)?"assets/":window==null?void 0:window.zyuiAssetsPath,N=document.createElement("link");N.rel="stylesheet",N.href=`${location==null?void 0:location.origin}/${_}css/index.min.css`,(I=m.value)==null||I.appendChild(N);const O=document.createElement("link");O.rel="stylesheet",O.href=`${location==null?void 0:location.origin}/${_}css/reset.css`,(W=m.value)==null||W.appendChild(O),(G=b==null?void 0:b.cssConfig)!=null&&G.links&&b.cssConfig.links.forEach(q=>{var L;const Z=document.createElement("link");Z.rel="stylesheet",Z.href=q,(L=m.value)==null||L.appendChild(Z)}),(Q=b==null?void 0:b.cssConfig)!=null&&Q.styles&&b.cssConfig.styles.forEach(q=>{var L;const Z=document.createElement("style");Z.textContent=q,(L=m.value)==null||L.appendChild(Z)})}),d.onUnmounted(()=>{document.removeEventListener("click",C)}),i({focus:()=>{h.value=!0}}),{shadowHost:u,shadowRoot:m,handleClick:S}}};function f6e(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 IB=Ja(d6e,[["render",f6e]]),m6e=["innerHTML"],Tfe=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(IB,null,{default:d.withCtx(()=>[d.createElementVNode("div",{innerHTML:s.value},null,8,m6e)]),_:1}))}}),Afe=Symbol("nodesUI"),ef=()=>{const o=d.inject(Afe);if(!o)throw new Error("NodesUI context not found");return o};function Moe(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.id){u=`#${CSS.escape(i.id)}`,s.unshift(u);break}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 p6e(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 Nfe(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(o)}catch(i){return console.error("nodePath query error:",i),null}}const jA=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}`:""),Ofe=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=Ofe(u);if(m){s=m;break}}return s},g6e=(o,s,i)=>{var u,m,h;if(!dB(o)){const b=i==null?void 0:i.getRootNode(),C=(u=b==null?void 0:b.getSelection)==null?void 0:u.call(b),S=Nfe(o.nodePath,i);if(C&&o.startOffset!==void 0&&s&&S){const _=document.createRange(),N=(o==null?void 0:o.textNodeIndex)||0,O=S.childNodes[N]||S;let R,I;if(O.nodeType===Node.TEXT_NODE)R=O,I=Math.min(o.startOffset,((m=O.textContent)==null?void 0:m.length)||0);else{const G=Ofe(O);G?(R=G,I=((h=G.textContent)==null?void 0:h.length)||0):(R=O,I=0)}_.setStart(R,I),_.setEnd(R,I);const W=document.createElement("span");W.classList.add("empty-text-node"),_.insertNode(W),_.insertNode(s),_.setStartAfter(s),_.collapse(!0),C.removeAllRanges(),C.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.parentNode;if(!s)return-1;let i=0;for(let u=0;u<s.childNodes.length;u++){const m=s.childNodes[u];if(m===o)return i;i++,m.nodeType===Node.ELEMENT_NODE&&(m.classList.contains("node-item")&&(i-=2,i<0&&(i=0)),m.classList.contains("empty-text-node")&&(i-=1,i<0&&(i=0)))}return-1},b6e=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=Moe(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},$fe=o=>Axe(o,s=>d.toValue(s.nodes).map(i=>({...i,color:s.color,activated:s==null?void 0:s.activated,dataGroupKey:s.id}))),Bz=(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})`},y6e=o=>{var _;const{element:s}=o;if(!s)return null;if(s.tagName.toLowerCase()!=="td")return{showTextType:"input"};const u=s.closest("tr"),m=Array.from(u.parentElement.children).indexOf(u),h=Array.from(u.children).indexOf(s),b=s.closest("table"),C=((_=s.closest("body"))==null?void 0:_.querySelectorAll("table"))||[];return{showTextType:"cell",tableIndex:Array.from(C).indexOf(b)+1,colIndex:h,rowIndex:m}},w6e=(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=y6e(C);return S?(S==null?void 0:S.showTextType)==="input"?{...C,...S,inputIndex:i++}:{...C,...S}:null}))==null?void 0:h.filter(Boolean):[]};function C6e(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 S6e(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 Dfe=(o,s)=>{var _;const i=w6e(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=$xe(m,"tableIndex"),b=Object.entries(h).map(([N,O])=>({tableIndex:Number(N),nodes:O})),C=pde(b==null?void 0:b.map(N=>C6e(N==null?void 0:N.nodes))),S=(C==null?void 0:C.map(N=>S6e(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}`:""},x6e=(o,s)=>{const i=Dfe(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(",")},dB=o=>o.startOffset===void 0&&o.textNodeIndex===void 0,E6e=o=>{var s;if(o.innerHTML==="&nbsp;"&&(o.innerHTML=""),((s=o.textContent)==null?void 0:s.trim())===""&&o.querySelector("p")){const i=o.querySelector("p");if(i){const u=O=>{const R={};return O&&O.split(";").forEach(I=>{const[W,G]=I.split(":").map(Q=>Q.trim());W&&G&&(R[W]=G)}),R},m=O=>Object.entries(O).map(([R,I])=>`${R}: ${I}`).join("; "),h=u(o.getAttribute("style")||""),b=u(i.getAttribute("style")||""),C=i.querySelectorAll("span");let S={};C.forEach(O=>{const R=u(O.getAttribute("style")||"");S={...S,...R}});const _={...h,...b,...S},N=m(_);N&&o.setAttribute("style",N),o.removeChild(i)}}},_6e=o=>{var i;return(i=ta(o))==null?void 0:i.map(u=>(u==null||delete u.element,u))},k6e=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")})},T6e={key:0,class:"td-node"},A6e={key:1},N6e=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",T6e,d.toDisplayString(i.value),1)):(d.openBlock(),d.createElementBlock("span",A6e,d.toDisplayString(i.value),1))}}),Mfe=Symbol("nodesEditor"),j0=()=>{const o=d.inject(Mfe);if(!o)throw new Error("NodesEditor context not found");return o},DU=d.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,{currentNodes:i}=ef(),{nodes:u,renderType:m,disabledNodes:h}=j0(),b=d.computed(()=>{var O;return(O=s.node)!=null&&O.id?u.value.some(R=>R.id===s.node.id):!1}),C=d.computed(()=>{var O;if(!((O=s.node)!=null&&O.element))return!1;try{return s.node.element.parentNode!==null}catch(R){return console.warn("Element validation failed:",R),!1}}),S=d.computed(()=>{var I,W;const O=(I=h==null?void 0:h.value)==null?void 0:I.some(G=>{var Q;return(G==null?void 0:G.id)===((Q=s==null?void 0:s.node)==null?void 0:Q.id)}),R=(W=d.toValue(i))==null?void 0:W.find(G=>{var Q;return(G==null?void 0:G.id)===((Q=s==null?void 0:s.node)==null?void 0:Q.id)});return{...s==null?void 0:s.node,...R,disabled:O}}),_=O=>{var I;let R="";if(d.toValue(O==null?void 0:O.activated)&&(R="normal"),O!=null&&O.disabled&&(R="disabled"),(I=s==null?void 0:s.node)!=null&&I.element)switch(R){case"normal":s.node.element.style.setProperty("--node-color",(O==null?void 0:O.color)||"#409eff"),s.node.element.style.setProperty("--node-bg-color",Bz((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",Bz((O==null?void 0:O.color)||"#F56C6C",.1)),s.node.element.setAttribute("data-dataGroupKey",O==null?void 0:O.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("disabled");break;default:N();break}},N=()=>{var O,R,I,W,G;(O=s==null?void 0:s.node)!=null&&O.element&&((R=s.node.element)==null||R.removeAttribute("data-dataGroupKey"),(I=s.node.element)==null||I.removeAttribute("selectable"),(W=s.node.element)==null||W.classList.remove("activated"),(G=s.node.element)==null||G.classList.remove("disabled"))};return d.watch(()=>S,()=>{const O=d.toValue(S);O!=null&&O.id?_(O):N()},{immediate:!0,deep:!0}),(O,R)=>{var I;return(I=O.node)!=null&&I.element&&C.value&&b.value?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:O.node.element},[d.createElementVNode("div",{class:d.normalizeClass(["node-item-render",`node-item-${d.unref(m)}`])},[d.renderSlot(O.$slots,"default",{node:O.node},()=>[d.createVNode(N6e,{node:O.node},null,8,["node"])])],2)],8,["to"])):d.createCommentVNode("",!0)}}});function O6e(){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 Bfe(){const{selectedNodes:o,setSelectedNodes:s,containerRef:i}=ef(),{editorId:u,nodes:m}=j0(),h=d.ref(!1),b=d.ref({x:0,y:0}),C=d.ref({x:0,y:0}),S=d.ref({left:0,top:0,width:0,height:0}),_=d.ref(null),N=Se=>{const J=Se.closest(".node-item-td")||Se.closest(".node-item");if(J!==null){let Fe=[];if(J.classList.contains("node-selected"))return;const it=J.getAttribute("id");if(it&&m.value){const rt=m.value.find(De=>De.id===it);rt&&(Fe=[rt])}Fe=Z(Fe),s(Fe)}},O=Se=>{var rt;if(Se.button===2&&N(Se==null?void 0:Se.target),Se.button!==0||(h.value=!0,!_.value))return;const J=(rt=i==null?void 0:i.value)==null?void 0:rt.getBoundingClientRect();if(!J)return;const Fe=Se.clientX-(J==null?void 0:J.left),it=Se.clientY-(J==null?void 0:J.top);b.value={x:Fe,y:it},C.value={x:Fe,y:it},Q(Se),L(),_.value.style.display="block",window.addEventListener("mousemove",R),window.addEventListener("wheel",I),window.addEventListener("mouseup",W)},R=dte(Se=>{var J;if(h.value){const Fe=(J=i==null?void 0:i.value)==null?void 0:J.getBoundingClientRect();if(!Fe)return;const it=Se.clientX-(Fe==null?void 0:Fe.left),rt=Se.clientY-(Fe==null?void 0:Fe.top);C.value={x:it,y:rt},L()}},16),I=dte(Se=>{h.value&&setTimeout(()=>{var rt;const J=(rt=i==null?void 0:i.value)==null?void 0:rt.getBoundingClientRect();if(!J)return;const Fe=Se.clientX-(J==null?void 0:J.left),it=Se.clientY-(J==null?void 0:J.top);C.value={x:Fe,y:it},L()},0)},16),W=Se=>{Se.button===0&&(h.value=!1,_.value&&(L(),_.value.style.display="none",window.removeEventListener("mousemove",R),window.removeEventListener("wheel",I),window.removeEventListener("mouseup",W)))},G=O6e(),Q=Se=>{var Fe,it;let J=[];if(Se.button===0&&(Se!=null&&Se.target)){const rt=((Fe=Se==null?void 0:Se.target)==null?void 0:Fe.closest(".node-item-td"))||((it=Se==null?void 0:Se.target)==null?void 0:it.closest(".node-item"));if(rt!==null){const De=rt.getAttribute("id");if(De&&m.value){const ce=m.value.find(zt=>zt.id===De);ce&&(G.value?o.value.some(zt=>jA(zt)===jA(ce))?J=o.value.filter(he=>jA(he)!==jA(ce)):J=[...o.value,ce]:ce&&(J=[ce]))}}J=Z(J),s(J)}},q=()=>{var ce;if(!i.value||!(S.value.width>3||S.value.height>3))return;let Se=[];const J=(ce=i==null?void 0:i.value)==null?void 0:ce.getBoundingClientRect(),Fe=S.value.left+(J==null?void 0:J.left),it=S.value.top+(J==null?void 0:J.top),rt={left:S.value.left+(J==null?void 0:J.left),right:Fe+S.value.width,top:S.value.top+(J==null?void 0:J.top),bottom:it+S.value.height};if(i.value.querySelectorAll("*").forEach(zt=>{const he=zt.getBoundingClientRect();if(!rt)return;const Ee={left:he.left,right:he.right,top:he.top,bottom:he.bottom};if(Ee.right>rt.left&&Ee.left<rt.right&&Ee.bottom>rt.top&&Ee.top<rt.bottom){const M=zt.getAttribute("id");if(M&&m.value){const Ze=m.value.find(ye=>ye.id===M);Ze&&(Se=[...Se,Ze])}}}),Se=Z(Se),G.value){const zt=new Set(o.value.map(Ee=>jA(Ee))),he=Se.filter(Ee=>!zt.has(jA(Ee)));s([...o.value,...he])}else s(Se)},Z=Se=>Se,L=dte(()=>{if(!_.value||!i.value)return;const{x:Se,y:J}=b.value,{x:Fe,y:it}=C.value,rt=Math.min(Se,Fe),De=Math.min(J,it),ce=Math.abs(Se-Fe),zt=Math.abs(J-it);S.value={left:rt,top:De,width:ce,height:zt}},16),de=Se=>{if(!_.value)return;const{left:J,top:Fe,width:it,height:rt}=d.toValue(Se);_.value.style.left=`${J}px`,_.value.style.top=`${Fe}px`,_.value.style.width=`${it}px`,_.value.style.height=`${rt}px`},Ve=()=>{if(!i.value)return;i.value.addEventListener("mousedown",O);const Se=document.getElementById(`select_area_${u}`);if(Se){_.value=Se;return}const J=document.createElement("div");J.id=`select_area_${u}`,J.style.position="absolute",J.style.border="1px solid #1677ff",J.style.backgroundColor="rgba(22, 119, 255, 0.05)",J.style.pointerEvents="none",J.style.display="none",i.value.appendChild(J),_.value=J};return d.watch(S,(Se,J)=>{ua(Se,J)||(de(Se),h.value&&q())},{deep:!0}),d.watch(()=>i.value,Se=>{d.toValue(Se)&&Ve()},{immediate:!0}),d.onUnmounted(()=>{i.value&&i.value.removeEventListener("mousedown",O)}),{isSelecting:h,selectionBox:_}}function Boe(){const{selectedNodes:o,containerRef:s}=ef(),i=()=>{var m;(m=d.toValue(s))==null||m.querySelectorAll(".node-selected").forEach(h=>{h.classList.remove("node-selected")})},u=m=>{m.forEach(h=>{h.classList.add("node-selected")})};d.watch(()=>o,()=>{i(),setTimeout(()=>{var h,b;const m=(b=(h=d.toValue(o))==null?void 0:h.map(C=>{var S;return(S=s.value)==null?void 0:S.querySelector(`[id="${C.id}"]`)}))==null?void 0:b.filter(Boolean);u(m)},0)},{deep:!0})}const PB=()=>{const{nodes:o,updateNodes:s,inputTypes:i}=j0();return{nodes:o,addNode:S=>{const N=(Array.isArray(S)?S:[S]).map(R=>({...R,id:R.id||m2()})),O=[...o.value,...N];s(O)},removeNode:async S=>{var W,G;const _=Array.isArray(S)?S:[S],N=[],O=[];_.forEach(Q=>{const q=o.value.find(Z=>(Z==null?void 0:Z.id)===Q);dB(q)?N.push(Q):O.push(Q)});const R=await((G=(W=i==null?void 0:i.find(Q=>{var q;return((q=Q.value)==null?void 0:q.toLowerCase())==="text"}))==null?void 0:W.getDefaultProps)==null?void 0:G.call(W))||{};let I=o.value.filter(Q=>!O.includes(Q==null?void 0:Q.id));I=I==null?void 0:I.map(Q=>N.includes(Q==null?void 0:Q.id)?{id:Q==null?void 0:Q.id,nodePath:Q==null?void 0:Q.nodePath,label:"文本",nodeType:"text",props:{...R}}:Q),s(I)},editNodes:S=>{const _=Array.isArray(S)?S:[S],N=m2(),O=_.map(I=>{const W={...I};let G=I==null?void 0:I.id;return G||(G=m2(),W.id=G),W!=null&&W.groupKey||(W.groupKey=N),W}),R=[...o.value];O.forEach(I=>{const W=R.findIndex(G=>G.id===I.id);W!==-1?R[W]=I:R.push(I)}),s(R)},insertNodeAt:(S,_)=>{const N=[...o.value];N.splice(_,0,S),s(N)},moveNode:(S,_)=>{const N=[...o.value],[O]=N.splice(S,1);N.splice(_,0,O),s(N)},updateNodes:s}};function $6e(){const{removeNode:o}=PB(),{containerRef:s}=ef(),i=d.ref(null),u=h=>{var G,Q;if(h.target instanceof Element&&(h.target.closest(".node-item")||h.target.closest(".node-item-td")||h.target.closest(".disabeld-edit")))return;const b=h.target;if(b===s.value)return;const S=((G=s.value)==null?void 0:G.getRootNode()).getSelection(),_=(Q=s.value)==null?void 0:Q.querySelectorAll('[contenteditable="true"]');_==null||_.forEach(q=>{q.setAttribute("contenteditable","false")});const N=b.textContent||"",O=b.innerHTML||"";i.value=b,b.setAttribute("contenteditable","true"),b.focus();const R=new MutationObserver(()=>{b.textContent!==N&&(b.innerHTML=O)});R.observe(b,{characterData:!0,childList:!0,subtree:!0});const I=q=>{q.preventDefault()};b.addEventListener("input",I),b.addEventListener("paste",I),b.addEventListener("drop",I),b.addEventListener("keydown",q=>{var Z,L,de,Ve;if(((Z=document.activeElement)==null?void 0:Z.shadowRoot)===((L=s.value)==null?void 0:L.getRootNode())&&!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(q.key)){if(q.key==="Backspace"||q.key==="Delete"){const Se=S==null?void 0:S.getRangeAt(0);if(b.blur(),(Se==null?void 0:Se.startOffset)===0){const J=Se.startContainer;if(J.nodeType===Node.TEXT_NODE){const Fe=J.previousSibling;if(Fe&&Fe.nodeType===Node.ELEMENT_NODE&&Fe.classList.contains("node-item")){const it=Fe.getAttribute("id");it&&o(it),(de=J.parentElement)==null||de.normalize();return}}else if(J.nodeType===Node.ELEMENT_NODE){const Fe=J.previousSibling;if(Fe&&Fe.nodeType===Node.ELEMENT_NODE&&Fe.classList.contains("node-item")){const it=Fe.getAttribute("id");it&&o(it),(Ve=J.parentElement)==null||Ve.normalize();return}}}}q.preventDefault()}});const W=()=>{b==null||b.normalize(),R.disconnect(),b.removeEventListener("input",I),b.removeEventListener("paste",I),b.removeEventListener("drop",I),b.removeEventListener("blur",W),b.setAttribute("contenteditable","false")};b.addEventListener("blur",W)},m=()=>{var h;(h=s.value)==null||h.addEventListener("dblclick",u)};return d.watch(s,h=>{h&&m()},{immediate:!0}),d.onUnmounted(()=>{var h;(h=s.value)==null||h.removeEventListener("dblclick",u)}),{}}function D6e(){const{containerRef:o,focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}=ef(),h=_=>{var O,R;const N=_==null?void 0:_.getSelection();try{if((O=s.value)==null||O.normalize(),N){const I=N.getRangeAt(0);u.value=v6e(I.startContainer);const W=I.startOffset,G=(R=s.value)==null?void 0:R.querySelectorAll(".node-item");let Q=0;return m.value=0,G==null||G.forEach(q=>{const Z=document.createRange();if(Z.selectNode(q),Z.comparePoint(I.startContainer,W)>=0){m.value+=1;const L=q.getAttribute("data-startOffset");Number(L)>Q&&(Q=Number(L))}}),Q+W}}catch{}return 0},b=()=>{var N;const _=(N=o.value)==null?void 0:N.getRootNode();i.value=h(_)},C=_=>{var I;const N=_.target;if(N===o.value)return;s.value=N;const O=(I=o.value)==null?void 0:I.getRootNode();i.value=h(O),N.addEventListener("click",b),N.addEventListener("keyup",W=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(W.key)&&b()});const R=()=>{N.removeEventListener("click",b),N.removeEventListener("keyup",b),N.removeEventListener("blur",R),setTimeout(()=>{s.value=null,u.value=0,i.value=-1},300)};N.addEventListener("blur",R)},S=()=>{var _;(_=o.value)==null||_.addEventListener("focus",C,!0)};return d.watch(o,_=>{_&&S()},{immediate:!0}),d.onUnmounted(()=>{var _;(_=o.value)==null||_.removeEventListener("focus",C,!0)}),{focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}}function M6e(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}}function B6e(){const{modelValue:o,inputTypes:s}=j0(),{nodes:i,updateNodes:u}=PB(),m=b=>{if(!b||typeof b!="string")return[];const S=new DOMParser().parseFromString(b,"text/html");return Array.from(S.querySelectorAll("td")).filter(O=>{var R;return!((R=O.textContent)!=null&&R.trim())})},h=async b=>{var _,N;const C=await((N=(_=s==null?void 0:s.find(O=>{var R;return((R=O.value)==null?void 0:R.toLowerCase())==="text"}))==null?void 0:_.getDefaultProps)==null?void 0:N.call(_))||{},S=b.map(O=>{let R=O==null?void 0:O.id;return R||(R=m2()),{id:R,nodeType:"Text",label:"文本",props:{...C},...O}});u(S)};d.onMounted(()=>{var R;const b=m(d.toValue(o)),C=d.toValue(i),S=C.filter(I=>dB(I)),_=C.filter(I=>!dB(I)),O=[...(R=b.map(I=>({nodePath:Moe(I)})))==null?void 0:R.map(I=>{const W=S==null?void 0:S.find(G=>G.nodePath===I.nodePath);return{...I,...W}}),..._];h(O)})}function R6e(){const{selectedNodes:o,containerRef:s,isFocused:i}=ef(),{removeNode:u}=PB(),m=d.ref(null),h=S=>{if(i.value&&(S.key==="Delete"||S.key==="Backspace")){const _=[];d.toValue(o).length>0&&(d.toValue(o).forEach(N=>{var O,R,I;if(((O=N==null?void 0:N.element)==null?void 0:O.tagName)==="TD"){const W=(R=N==null?void 0:N.element)==null?void 0:R.getAttribute("id");W&&_.push(W)}else{const W=(I=N==null?void 0:N.element)==null?void 0:I.getAttribute("id");W&&_.push(W)}}),o.value=[],(_==null?void 0:_.length)>0&&u(_))}},b=S=>{var _;(_=d.toValue(s))!=null&&_.contains(S.target)?m.value=S.target:m.value=null},C=()=>{s.value&&(window.addEventListener("keydown",h),s.value.addEventListener("mousedown",b))};d.watch(()=>s.value,S=>{d.toValue(S)&&C()},{immediate:!0}),d.onUnmounted(()=>{s.value&&(window.removeEventListener("keydown",h),s.value.removeEventListener("mousedown",b))})}function MU(){const{nodes:o}=j0(),{containerRef:s,renderNodes:i,uiReady:u}=ef(),{removeNode:m}=PB(),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=kxe(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 wne=d.ref({});function BU(o){return d.computed(()=>{var s;return(s=wne.value)==null?void 0:s[o]})}function Roe(){const o=j0(),s=ef();d.onMounted(()=>{const{editorId:i}=o;i&&(wne.value[i]=d.ref({...o,...s}))}),d.onUnmounted(()=>{const{editorId:i}=o;i&&(wne.value[i]=null)})}const I6e=d.defineComponent({__name:"NodesEditUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"edit"}},setup(o){const{nodes:s}=j0(),{uiReady:i,renderNodes:u}=ef();return Roe(),M6e(s),Bfe(),Boe(),R6e(),D6e(),$6e(),B6e(),MU(),(m,h)=>d.unref(i)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(u),b=>(d.openBlock(),d.createBlock(DU,{key:b==null?void 0:b.id,node:b},{default:d.withCtx(C=>[d.renderSlot(m.$slots,"nodeItem",{node:C==null?void 0:C.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),lle=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)}}),P6e=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)}}),F6e=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(),Bfe(),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 L6e(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 V6e=d.defineComponent({__name:"NodesProvider",props:d.mergeModels({modelValue:{type:String,default:""},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:{}}),emits:["update:formData","update:nodes"],setup(o){const s=o,i=d.useModel(o,"formData"),u=d.useModel(o,"nodes"),m=d.computed(()=>s.modelValue),h=Rfe(s==null?void 0:s.editorId),b=d.computed(()=>{var O,R,I;const N=[...$fe(((I=(R=(O=d.toValue(h))==null?void 0:O.filter(W=>d.toValue(W==null?void 0:W.activated)))==null?void 0:R.filter(W=>d.toValue(W.isMounted)))==null?void 0:I.filter(W=>d.toValue(W==null?void 0:W.isOccupy)))||[]),...s.disabledNodes||[]];return qxe(N,"id")}),C=d.computed(()=>d.toValue(s.renderType)),S=_=>{ua(u.value,_)||(u.value=_)};return d.provide(Mfe,{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")}}),H6e=d.defineComponent({__name:"NodesUIProvider",props:{nodes:{type:Array,default:()=>[]},selectedNodes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},editorId:{type:String,default:""},htmlRenderRef:{type:Object,default:()=>{}}},emits:["onSelectedNodes","update:selectedNodes"],setup(o,{expose:s,emit:i}){const u=o,m=i,h=d.ref(null),b=d.ref(null),C=d.ref([]),S=d.ref(null),_=d.ref(-1),N=d.ref(0),O=d.ref(0),R=Rfe(u==null?void 0:u.editorId),I=d.ref(!1),W=d.ref(!1),G=d.computed(()=>u.htmlRenderRef),Q=d.computed({get:()=>(u.selectedNodes||[]).map(Ve=>{var Fe;let Se=(Fe=u==null?void 0:u.nodes)==null?void 0:Fe.find(it=>(it==null?void 0:it.id)===(Ve==null?void 0:Ve.id)),J=Ve!=null&&Ve.element?Ve==null?void 0:Ve.element:p6e(Ve==null?void 0:Ve.id,h.value);return{...Se||{},...Ve,element:J}}),set:Ve=>{const Se=Ve.map(({element:J,...Fe})=>{var rt;return{...((rt=u==null?void 0:u.nodes)==null?void 0:rt.find(De=>(De==null?void 0:De.id)===(Fe==null?void 0:Fe.id)))||{},...Fe}});m("update:selectedNodes",Se)}}),q=d.computed(()=>{var J,Fe,it;const Ve=(Fe=(J=d.toValue(R))==null?void 0:J.filter(rt=>d.toValue(rt==null?void 0:rt.activated)))==null?void 0:Fe.filter(rt=>d.toValue(rt.isMounted)),Se=((it=d.toValue(u==null?void 0:u.nodesGroups)||[])==null?void 0:it.map(rt=>({...rt||{},activated:!0})))||[];return $fe([...Se,...Ve])}),Z=d.ref([]),L=Ve=>{var Fe;const Se=Ve.map(({...it})=>{var zt;let rt=(zt=C.value)==null?void 0:zt.find(he=>(he==null?void 0:he.id)===(it==null?void 0:it.id));const{element:De,...ce}={...rt||{},...it};return ce}),J=(Fe=Q.value)==null?void 0:Fe.map(({element:it,...rt})=>rt);ua(Se,J)||(Q.value=Se,m("onSelectedNodes",Se))},de=d.computed(()=>d.toValue(u==null?void 0:u.nodesGroups));return s({setSelectedNodes:L}),d.provide(Afe,{containerRef:h,htmlRenderRef:G,contextMenuRef:b,focusedElement:S,currentRenderNodes:Z,cursorPosition:_,focusedNodeIndex:N,preNodeNumber:O,currentNodes:q,selectedNodes:Q,setSelectedNodes:L,renderNodes:C,uiReady:I,isFocused:W,nodesGroups:de}),(Ve,Se)=>d.renderSlot(Ve.$slots,"default")}}),z6e=["onClick"],U6e={key:0,class:"icon"},j6e={key:1,class:"arrow"},W6e=["onClick"],Z6e={key:0,class:"icon"},G6e=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};d.watch(()=>[O,i==null?void 0:i.style],()=>{d.toValue(O)&&(R.value=!1),setTimeout(()=>{R.value=!!d.toValue(O)},0)},{immediate:!0,deep:!0});const{editNodes:W}=PB(),G=async L=>{var de,Ve;if(d.toValue(b)&&!Rxe(d.toValue(C))){const Se=Moe(d.toValue(b)),J=d.toValue(C),Fe=(d.toValue(_)||0)+1,it=b6e(d.toValue(b));if(Se&&!uB(J)&&J>=0){const rt=await((de=L==null?void 0:L.getDefaultProps)==null?void 0:de.call(L))||{};W({...it,label:L==null?void 0:L.label,nodePath:Se,startOffset:J,subNodeSort:Fe,textNodeIndex:d.toValue(S)||0,nodeType:L==null?void 0:L.value,props:rt})}}else if(m){const Se=d.toValue(m);if(Se!=null&&Se.length){const J=await((Ve=L==null?void 0:L.getDefaultProps)==null?void 0:Ve.call(L))||{},Fe=Se==null?void 0:Se.map(it=>({...it,label:L==null?void 0:L.label,element:it==null?void 0:it.element,nodePath:it==null?void 0:it.nodePath,nodeType:L==null?void 0:L.value,props:J}));W(Fe),h(Fe)}}O.value=!1},Q=d.computed(()=>{const L=[],de=[];return d.toValue(N).forEach(Ve=>{Ve.groupName==="system"?de.push({...Ve,handler:()=>{G(Ve)}}):L.push({...Ve,handler:()=>{G(Ve)}})}),[{label:"限定填写内容",icon:"i-bi:lock",children:L},{label:"插入记录标识",icon:"i-bi:flag",children:de}].filter(Ve=>{var Se;return(Se=Ve==null?void 0:Ve.children)==null?void 0:Se.length})}),q=s,Z=(L,de)=>{L.preventDefault(),de!=null&&de.handler&&de.handler(),de!=null&&de.value&&q("select",de==null?void 0:de.value)};return(L,de)=>(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({...L.style}),ref_key:"contextMenuRef",ref:u},null,4),[[d.unref(On.ClickOutside),I]])]),default:d.withCtx(()=>[d.createElementVNode("div",{ref_key:"contextMenuRef",ref:u},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(Q.value,Ve=>(d.openBlock(),d.createElementBlock("div",{key:Ve==null?void 0:Ve.label,class:"menu-item"},[d.createElementVNode("div",{class:"menu-item-content",onClick:Se=>Z(Se,Ve)},[Ve!=null&&Ve.icon?(d.openBlock(),d.createElementBlock("div",U6e,[d.createElementVNode("div",{class:d.normalizeClass(Ve==null?void 0:Ve.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(Ve.label)+" ",1),Ve!=null&&Ve.children?(d.openBlock(),d.createElementBlock("span",j6e,"›")):d.createCommentVNode("",!0)],8,z6e),Ve!=null&&Ve.children?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["submenu",{"submenu-bottom":L.direction==="bottom"}])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(Ve.children,Se=>(d.openBlock(),d.createElementBlock("div",{key:Se.action,class:"menu-item",onClick:J=>Z(J,Se)},[Se!=null&&Se.icon?(d.openBlock(),d.createElementBlock("div",Z6e,[d.createElementVNode("div",{class:d.normalizeClass(Se==null?void 0:Se.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(Se.label),1)],8,W6e))),128))],2)):d.createCommentVNode("",!0)]))),128))],512)]),_:1},8,["visible"]))}}),q6e=Ja(G6e,[["__scopeId","data-v-a6be18aa"]]);function Y6e(o){const{headerHeight:s,hasContextMenu:i}=o,{contextMenuRef:u}=ef(),m=d.ref(!1),h=d.ref("top"),b=d.ref({left:"0px",top:"0px"}),C=_=>{d.toValue(i)&&(_.preventDefault(),m.value=!0,d.nextTick(()=>{const O=_.currentTarget.getBoundingClientRect(),R=_.clientX-O.left,I=_.clientY-O.top,W=u==null?void 0:u.value,G=Array.from((W==null?void 0:W.querySelectorAll(".submenu"))||[]).reduce((Q,q)=>Math.max(Q,q.offsetHeight||0),0)||400;O.height-I<G?h.value="bottom":h.value="top",b.value={left:`${R}px`,top:`${I+d.toValue(s)}px`}}))},S=_=>{const N=document.querySelector(".context-menu");N&&!N.contains(_.target)&&(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 Cne=Ife(),Pfe=(...o)=>{const s=o[0],i=o[1];d.onMounted(()=>{Cne.on(s,i)}),d.onBeforeUnmount(()=>{Cne.off(s)})},Ioe=()=>(...s)=>{Cne.emit(...s)};let rE=null;function K6e(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 Rz={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}},X6e={class:"relative"},J6e={class:"header-container"},Q6e=["innerHTML"],eBe={style:{overflow:"hidden"}},tBe=["innerHTML"],nBe=d.defineComponent({__name:"index",props:{headerHtml:{type:String,default:""},footerHtml:{type:String,default:""},pagesize:{type:String,default:"A4"}},emits:["onUiReady"],setup(o,{expose:s,emit:i}){const u=d.ref(),{containerRef:m,uiReady:h,isFocused:b}=ef(),{nodes:C,modelValue:S,renderType:_}=j0(),N=d.computed(()=>d.toValue(_)==="edit"),O=o,R=i,I=()=>{R("onUiReady",{containerRef:m})},{height:W}=pMe(u),G=d.computed(()=>O.headerHtml?O.headerHtml.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(he,Ee,M)=>{const Ze=M.replace(/([^{}]+)\{/g,(ye,at)=>{const st=at.trim();return st&&!st.includes(".header-container")?`.header-container ${st} {`:ye});return`<style${Ee}>${Ze}</style>`}):""),Q=d.computed(()=>{const he=Rz[O.pagesize]||Rz.A4,Ee=(window.devicePixelRatio||1)*96;return`${he.height*Ee/25.4-d.toValue(W)}px`}),{showContextMenu:q,contextMenuStyle:Z,onContextMenu:L,direction:de}=Y6e({headerHeight:W,hasContextMenu:N}),Ve=d.ref(null),Se=he=>{let Ee=null;if(dB(he))Ee=Nfe(he.nodePath,d.toValue(m)),Ee&&(Ee.classList.add("node-item-td"),Ee.setAttribute("contenteditable","false"),E6e(Ee));else{const M=document.createElement("span");M.setAttribute("contenteditable","false"),M.classList.add("node-item"),Ee=M,g6e(he,Ee,m.value)}return Ee&&h6e(Ee,he),Ee},J=()=>{const he=Hxe(C.value,[Ee=>Ee.nodePath,Ee=>Ee.textNodeIndex,Ee=>Ee.startOffset??-1,Ee=>Ee.subNodeSort],["asc","desc","desc","desc"]);he==null||he.forEach(Ee=>{Se(Ee)})},Fe=()=>{Ve.value&&(h.value=!1,d.nextTick(()=>{Ve.value&&(Ve.value.innerHTML=d.toValue(S),J(),h.value=!0,d.nextTick(()=>{I(),setTimeout(()=>{d.toValue(m)&&k6e(d.toValue(m))},10)}))}))},it=d.computed(()=>{var he;return(he=d.toValue(C))==null?void 0:he.map(Ee=>{const{nodePath:M,id:Ze,nodeType:ye}=Ee;return{nodePath:M,id:Ze,nodeType:ye}})});d.watch(()=>[S,Ve],()=>{Fe()},{deep:!0,immediate:!0}),d.watch(()=>[...it.value],(he,Ee)=>{ua(Ee,he)||Fe()},{deep:!0,immediate:!0});const rt=d.ref(),De=()=>{b.value=!0},{onBlur:ce}=K6e(),zt=()=>{b.value=!1,ce()};return s({renderHtml:Fe}),(he,Ee)=>(d.openBlock(),d.createElementBlock("div",X6e,[d.createVNode(IB,{onOnBlur:zt,onOnFocus:De,ref_key:"shadowDomRef",ref:rt},{default:d.withCtx(()=>[d.createElementVNode("div",{ref_key:"headerRef",ref:u,style:{overflow:"hidden"}},[d.createElementVNode("div",J6e,[d.createElementVNode("div",{innerHTML:G.value,class:"disabeld-edit docHeaderHtml",onClick:De},null,8,Q6e)])],512),d.createElementVNode("html",{class:d.normalizeClass(["nodes-editor",`nodes-editor-${d.unref(_)}`]),ref_key:"containerRef",ref:m,style:d.normalizeStyle([{position:"relative"},{position:"relative",minHeight:Q.value}]),onContextmenu:Ee[0]||(Ee[0]=d.withModifiers((...M)=>d.unref(L)&&d.unref(L)(...M),["prevent"]))},[d.createElementVNode("body",{ref_key:"bodyRef",ref:Ve},null,512),d.createElementVNode("div",eBe,[d.createElementVNode("div",{innerHTML:O==null?void 0:O.footerHtml,class:"disabeld-edit docFooterHtml",onClick:De},null,8,tBe)])],38)]),_:1},512),N.value?(d.openBlock(),d.createBlock(q6e,{key:0,show:d.unref(q),"onUpdate:show":Ee[1]||(Ee[1]=M=>d.isRef(q)?q.value=M:null),style:d.normalizeStyle(d.unref(Z)),direction:d.unref(de)},null,8,["show","style","direction"])):d.createCommentVNode("",!0)]))}}),oBe={class:"pagesize"},sBe=d.defineComponent({__name:"index",props:{pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},style:{type:Object,default:()=>({})}},setup(o){const s=o,i=d.computed(()=>{const u=Rz[s.pagesize]||Rz.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",oBe,[d.createElementVNode("div",{style:d.normalizeStyle({width:`${i.value}px`,...o.style}),class:"pagesize-content"},[d.renderSlot(u.$slots,"default",{},void 0,!0)],4)]))}}),rBe=Ja(sBe,[["__scopeId","data-v-44e34db1"]]),Ffe=d.defineComponent({__name:"index",props:d.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},renderType:{type:String,default:"preview"},formData:{type:Object,default:()=>({})},inputTypes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},id:{type:String,default:""},disabledNodes:{type:Array,default:()=>[]},headerHtml:{type:String,default:""},footerHtml:{type:String,default:""},pagesizeStyle:{type:Object,default:()=>({})}},{selectedNodes:{default:[]},selectedNodesModifiers:{}}),emits:d.mergeModels(["update: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=G=>{m("onUiReady",G)},_=d.ref(),N=d.computed(()=>d.toValue(u.renderType)),O=d.computed(()=>{switch(d.toValue(N)){case"edit":return I6e;case"select":return F6e;case"preview":return lle;case"enter":return P6e;default:return lle}}),R=G=>{m("update:nodes",G)},I=G=>{m("update:formData",G)},W=G=>{m("onSelectedNodes",G)};return s({formRef:{validate:()=>{var G,Q,q;return(q=(Q=(G=b.value)==null?void 0:G.formRef)==null?void 0:Q.validate)==null?void 0:q.call(Q)}},setSelectedNodes:G=>{var Q,q;(q=(Q=_.value)==null?void 0:Q.setSelectedNodes)==null||q.call(Q,G)}}),(G,Q)=>(d.openBlock(),d.createBlock(rBe,{pagesize:o.pagesize,orientation:u==null?void 0:u.orientation,style:d.normalizeStyle(o.pagesizeStyle)},{default:d.withCtx(()=>[d.createVNode(H6e,{ref_key:"UIRef",ref:_,nodes:o.nodes,"onUpdate:nodes":R,selectedNodes:h.value,"onUpdate:selectedNodes":Q[0]||(Q[0]=q=>h.value=q),onOnSelectedNodes:W,nodesGroups:o.nodesGroups,editorId:u==null?void 0:u.id,htmlRenderRef:C.value},{default:d.withCtx(()=>[d.createVNode(V6e,{renderType:N.value,"model-value":o.modelValue,nodes:o.nodes,"onUpdate:nodes":R,formData:o.formData,"onUpdate:formData":I,inputTypes:o.inputTypes,editorId:u==null?void 0:u.id,disabledNodes:o.disabledNodes},{default:d.withCtx(()=>[d.createVNode(nBe,{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(q=>[d.renderSlot(G.$slots,"nodeItem",{node:q==null?void 0:q.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"]))}}),aBe={class:"nodes-text"},iBe={key:0,class:"node-text-input"},lBe={key:1,class:"node-text-td"},cBe={key:0,class:"node-text-table-index"},uBe=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 Dfe(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",aBe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(m.value,(S,_)=>{var N,O,R,I,W,G,Q,q,Z;return d.openBlock(),d.createElementBlock("div",{key:_,class:"node-text-item"},[(S==null?void 0:S.showTextType)==="input"?(d.openBlock(),d.createElementBlock("span",iBe,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",lBe,[h.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("span",cBe,d.toDisplayString(`表${(R=S==null?void 0:S.min)==null?void 0:R.tableIndex}.`),1)),d.createTextVNode(" "+d.toDisplayString(((I=S==null?void 0:S.min)==null?void 0:I.id)===((W=S==null?void 0:S.max)==null?void 0:W.id)?(Q=(G=S==null?void 0:S.min)==null?void 0:G.props)!=null&&Q.alias?(Z=(q=S==null?void 0:S.min)==null?void 0:q.props)==null?void 0:Z.alias:d.unref(r4)(S==null?void 0:S.min):`${d.unref(r4)(S==null?void 0:S.min)}:${d.unref(r4)(S==null?void 0:S.max)}`),1)]))])}),128))]))}}),cle=Ja(uBe,[["__scopeId","data-v-73a2b2dc"]]);function Poe(o){const{nodes:s,mode:i="multiple"}=o,u=d.ref(!1),m=Ioe();return{isSelecting:u,selectNodes:()=>{if(u.value)return!1;u.value=!0,m("selectNodes",{data:ta(d.toValue(s)),mode:i,callback:({data:b,type:C})=>{s.value=_6e(ta(d.toValue(b))),C==="blur"&&(u.value=!1)}})}}}const WA=["#409EFF","#b36c2d","#7548ff","#5233b3","#649ee5","#aac4ed","#f9ce57","#ae74e8"],RH=d.ref(0),aE=new Map,dBe={key:0,class:"node-select-small gap-x-2"},fBe={key:1,class:"text-[#999]"},mBe={key:1,class:"node-select"},pBe={class:"flex py-2 px-2 justify-between items-center noder-select-header"},gBe={class:"flex gap-2"},hBe={key:1},vBe={class:"flex gap-1"},bBe=d.defineComponent({__name:"index",props:d.mergeModels({mode:{type:String,default:"multiple"},color:{type:String},id:{type:String,default:""},editorId:{type:String,default:""},size:{type:String,default:"default"},label:{type:String,default:"点击选择"},isOccupy:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=d.ref((aE==null?void 0:aE[s==null?void 0:s.id])||0),u=d.ref((s==null?void 0:s.id)||m2()),m=d.useModel(o,"modelValue");Em(m);const{selectNodes:h,isSelecting:b}=Poe({nodes:m,mode:s.mode}),C=()=>{m.value=[]},S=d.computed(()=>s.color||(WA==null?void 0:WA[d.toValue(i)%(WA==null?void 0:WA.length)])||"#409eff");d.onMounted(()=>{uB(aE==null?void 0:aE[s==null?void 0:s.id])&&(s!=null&&s.id)&&(aE[s==null?void 0:s.id]=RH.value,i.value=RH.value,RH.value=RH.value+1)});const _=d.computed(()=>s.isOccupy),N=d.computed(()=>!d.toValue(b));return L6e({id:u.value,editorId:s.editorId,nodes:m,activated:N,color:S,isOccupy:_}),(O,R)=>{var I;return s.size==="small"?(d.openBlock(),d.createElementBlock("div",dBe,[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]=(...W)=>d.unref(h)&&d.unref(h)(...W))},R[6]||(R[6]=[d.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer"},null,-1)]),4)),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)()})},[((I=m.value)==null?void 0:I.length)>0?(d.openBlock(),d.createBlock(cle,{key:0,modelValue:m.value,"onUpdate:modelValue":R[1]||(R[1]=W=>m.value=W),editorId:o.editorId},null,8,["modelValue","editorId"])):(d.openBlock(),d.createElementBlock("div",fBe,"未设置"))])])):(d.openBlock(),d.createElementBlock("div",mBe,[d.createElementVNode("div",pBe,[d.createElementVNode("div",gBe,[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]=(...W)=>d.unref(h)&&d.unref(h)(...W))})],4)),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",hBe,[d.createElementVNode("div",{class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})]))]),d.createElementVNode("div",vBe,[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(cle,{modelValue:m.value,"onUpdate:modelValue":R[4]||(R[4]=W=>m.value=W),editorId:o.editorId},null,8,["modelValue","editorId"])],2)]))}}}),Lfe=Ja(bBe,[["__scopeId","data-v-e9e78bcd"]]);function yBe(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 wBe(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 CBe(o){const s=BU(o.editorId),i=(b,C)=>{let S=[];const _=Math.min(b.colIndex,C.colIndex),N=Math.max(b.colIndex,C.colIndex),O=Math.min(b.rowIndex,C.rowIndex),R=Math.max(b.rowIndex,C.rowIndex);for(let I=O;I<=R;I++)for(let W=_;W<=N;W++)S.push({colIndex:W,rowIndex:I});return S},u=b=>{var N;const C=b.includes(":");let S=[];if(C){const[O,R]=b.split(":").map(I=>h(I));S=i(O,R)}else S=[h(b)];return m(S,d.toValue((N=d.toValue(s))==null?void 0:N.nodes))},m=(b,C)=>C==null?void 0:C.filter(S=>{const _=S.nodePath.split(" > ");let N=1,O=1;return _.forEach(R=>{if(R.startsWith("tr")){const I=R.match(/tr(?::nth-of-type\((\d+)\))?/);I&&I[1]&&(N=parseInt(I[1]))}else if(R.startsWith("td")){const I=R.match(/td(?::nth-of-type\((\d+)\))?/);I&&(O=I[1]?parseInt(I[1]):1)}}),b.some(R=>N===R.rowIndex+1&&O===R.colIndex+1)}),h=b=>{if(!b)return{colIndex:-1,rowIndex:-1};const C=b.match(/^([A-Za-z]+)(\d+)$/);if(!C)return{colIndex:-1,rowIndex:-1};const S=C[1].toUpperCase(),_=parseInt(C[2]);let N=0;for(let O=0;O<S.length;O++)N=N*26+(S.charCodeAt(O)-64);return{colIndex:N-1,rowIndex:_}};return{getCellValue:u}}const ule=["#0288D1","#D32F2F","#F57C00","#388E3C","#303F9F","#7B1FA2","#C2185B","#880E4F","#689F38","#5D4037"];function SBe(o,s,i){const u=d.ref(null),m=d.ref(null);function h(){return o.value&&o.value.textContent||""}d.onMounted(()=>{o.value&&(u.value=()=>{const C=h();s.value=C},m.value=()=>{const C=h();s.value=C},o.value.addEventListener("input",u.value),o.value.addEventListener("blur",m.value))}),d.onUnmounted(()=>{o.value&&(u.value&&o.value.removeEventListener("input",u.value),m.value&&o.value.removeEventListener("blur",m.value))});const b=C=>{var S,_,N,O;if(C>=0){const R=window.getSelection();if(R){const I=R.getRangeAt(0),W=((S=I.startContainer)==null?void 0:S.nodeName)==="#text"?I.startContainer:(N=(_=I.startContainer)==null?void 0:_.childNodes)==null?void 0:N[0],G=Math.min(C,((O=W.textContent)==null?void 0:O.length)||0);I.setStart(W,G)}}};return d.watch(()=>[s,o],()=>{var C;o.value&&(ua((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 xBe(o){const{element:s,showStr:i,editorId:u}=o,m=BU(u),h=Foe({element:s}),b=d.computed(()=>{var C;return(C=i==null?void 0:i.value)==null?void 0:C.filter(S=>["range","cell"].includes(S.type))});return d.watch(()=>h,()=>{var S,_,N,O,R,I;const C=W=>{var G;W.preventDefault(),(G=d.toValue(s))==null||G.focus()};d.toValue(h)?((S=d.toValue(m))==null||S.containerRef.addEventListener("click",C),(_=d.toValue(m))==null||_.containerRef.addEventListener("mousedown",C),(N=document.querySelectorAll(".select-function"))==null||N.forEach(W=>{W.addEventListener("click",C),W.addEventListener("mousedown",C)})):((O=d.toValue(m))==null||O.containerRef.removeEventListener("click",C),(R=d.toValue(m))==null||R.containerRef.removeEventListener("mousedown",C),(I=document.querySelectorAll(".select-function"))==null||I.forEach(W=>{W.removeEventListener("click",C),W.removeEventListener("mousedown",C)}))},{deep:!0}),d.watch(()=>[h,b],()=>{var C,S,_,N,O;if((C=d.toValue(m))!=null&&C.containerRef&&((N=(_=(S=d.toValue(m))==null?void 0:S.containerRef)==null?void 0:_.querySelectorAll(".node-formula-cell"))==null||N.forEach(R=>{R.classList.remove("node-formula-cell")}),d.toValue(h))){let R=[];(O=b.value)!=null&&O.length&&(b.value.forEach(I=>{var W;R=[...R,...((W=I==null?void 0:I.cellValue)==null?void 0:W.map(G=>({color:I==null?void 0:I.color,backgroundColor:Bz((I==null?void 0:I.color)||"#000",.1),element:G==null?void 0:G.element})))||[]]}),R.forEach(I=>{var W;I!=null&&I.element&&((W=I==null?void 0:I.element)==null||W.classList.add("node-formula-cell"),I==null||I.element.style.setProperty("--formula-node-color",I==null?void 0:I.color),I==null||I.element.style.setProperty("--formula-node-bg-color",I==null?void 0:I.backgroundColor))}))}},{deep:!0}),h}const EBe=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 _Be(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 kBe=(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},TBe=o=>{const{startOffset:s,showStr:i,value:u,editorId:m,currentItemIndex:h,currentItem:b,element:C}=o,S=BU(m),_=d.ref(-1),N=d.ref(0),O=Foe({element:C}),R=d.ref(!1),I=Ioe(),W=G=>{var Q,q;if(d.toValue(R)&&d.toValue(O)&&!ua((Q=d.toValue(b))==null?void 0:Q.cellValue,G)){const Z=x6e(G,((q=d.toValue(S))==null?void 0:q.nodes)||"");let L=Z;Z&&(d.toValue(N)===0&&(L+=","),d.toValue(_)>=0&&(u.value=_Be(d.toValue(u),d.toValue(_),d.toValue(N),L),N.value=Z.length))}};d.watch(()=>h,()=>{var G,Q,q,Z,L,de;if((G=S.value)==null||G.setSelectedNodes([]),["range","cell"].includes((Q=d.toValue(b))==null?void 0:Q.type))return _.value=kBe(i.value,h.value),N.value=(Z=(q=d.toValue(b))==null?void 0:q.value)==null?void 0:Z.length,R.value=!0,I("selectNodes",{data:(L=d.toValue(b))==null?void 0:L.cellValue,mode:"multiple",callback:({data:Ve})=>{W(Ve)}}),!1;if([",","(","="].includes((de=d.toValue(b))==null?void 0:de.value))return _.value=d.toValue(s),R.value=!0,N.value=0,I("selectNodes",{data:[],mode:"multiple",callback:({data:Ve})=>{W(Ve)}}),!1;R.value=!1,_.value=-1},{immediate:!0,deep:!0})},ABe=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 NBe(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 OBe=(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,currentItemIndex:m,currentItem:h,element:b}=o,C=d.ref(-1),S=d.ref(0),_=Foe({element:b}),N=d.ref(!1),O=Ioe(),R=I=>{var W;if(d.toValue(N)&&d.toValue(_)&&!ua((W=d.toValue(h))==null?void 0:W.value,I)){const G=I,Q=G;G&&d.toValue(C)>=0&&(u.value=NBe(d.toValue(u),d.toValue(C),d.toValue(S),Q),S.value=G.length)}};d.watch(()=>m,()=>{var I,W,G,Q,q;if(["function"].includes((I=d.toValue(h))==null?void 0:I.type))return C.value=OBe(i.value,m.value),S.value=(G=(W=d.toValue(h))==null?void 0:W.value)==null?void 0:G.length,N.value=!0,O("selectFunction",{data:(Q=d.toValue(h))==null?void 0:Q.value,callback:({data:Z})=>{R(Z)}}),!1;if([",","(","="].includes((q=d.toValue(h))==null?void 0:q.value))return C.value=d.toValue(s),N.value=!0,S.value=0,O("selectFunction",{data:"",callback:({data:Z})=>{R(Z)}}),!1;N.value=!1,C.value=-1},{immediate:!0,deep:!0})},DBe={class:"node-formula"},MBe={class:"node-formula-show"},BBe=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}=CBe({editorId:s==null?void 0:s.editorId}),u=d.useModel(o,"modelValue"),m=d.ref(),{startOffset:h}=EBe({element:m});SBe(m,u,h);const b=d.computed(()=>{const N=yBe(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=wBe(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:ule[O%ule.length]}):(I==null?void 0:I.type)==="function"?{...I,color:"#0318ff"}:I)});xBe({element:m,showStr:C,editorId:s==null?void 0:s.editorId});const{currentItemIndex:S,currentItem:_}=ABe({element:m,startOffset:h,value:u,showStr:C});return TBe({element:m,startOffset:h,showStr:C,editorId:s==null?void 0:s.editorId,value:u,currentItemIndex:S,currentItem:_}),$Be({element:m,startOffset:h,showStr:C,value:u,currentItemIndex:S,currentItem:_}),(N,O)=>(d.openBlock(),d.createElementBlock("div",DBe,[d.createElementVNode("div",{contenteditable:"true",ref_key:"formulaRef",ref:m,class:"node-formula-input"},null,512),d.createElementVNode("div",MBe,[(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(Bz)((R==null?void 0:R.color)||"#000",.1)})},d.toDisplayString(R.value),7))),128))])]))}}),Vfe=Ja(BBe,[["__scopeId","data-v-f4b96eb4"]]),RBe=[{label:"平均值",value:"AVERAGE"},{label:"均值绝对偏差",value:"AVEDEV"},{label:"求和",value:"SUM"},{label:"条件判断",value:"IF"},{label:"统计数量",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"正平方根",value:"SQRT"}],IBe={class:"select-function"},PBe=["onClick"],FBe={class:"function-item"},LBe={class:"function-item-desc"},VBe=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:RBe}),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",IBe,[(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",FBe,d.toDisplayString(S.value),1),d.createElementVNode("div",LBe,d.toDisplayString(S.label),1)],10,PBe)]))),128))]))}}),Hfe=Ja(VBe,[["__scopeId","data-v-6e079ff0"]]),HBe=["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(IB,null,{default:d.withCtx(()=>[d.createElementVNode("div",{innerHTML:s.value},null,8,HBe)]),_:1}))}});function RU(o){return d.getCurrentScope()?(d.onScopeDispose(o),!0):!1}function B0(o){return typeof o=="function"?o():d.unref(o)}const zBe=typeof window<"u"&&typeof document<"u",UBe=o=>typeof o<"u",jBe=Object.prototype.toString,WBe=o=>jBe.call(o)==="[object Object]",ZBe=()=>{};function GBe(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 qBe(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 dle(o,s=!1,i="Timeout"){return new Promise((u,m)=>{setTimeout(s?()=>m(i):u,o)})}function YBe(o,s,i={}){const{eventFilter:u=Ufe,...m}=i;return d.watch(o,GBe(u,s),m)}function ZA(o,s,i={}){const{eventFilter:u,...m}=i,{eventFilter:h,pause:b,resume:C,isActive:S}=qBe(u);return{stop:YBe(o,s,{...m,eventFilter:h}),pause:b,resume:C,isActive:S}}function KBe(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 Sne(o,s=!1){function i(O,{flush:R="sync",deep:I=!1,timeout:W,throwOnTimeout:G}={}){let Q=null;const Z=[new Promise(L=>{Q=d.watch(o,de=>{O(de)!==s&&(Q==null||Q(),L(de))},{flush:R,deep:I,immediate:!0})})];return W!=null&&Z.push(dle(W,G).then(()=>B0(o)).finally(()=>Q==null?void 0:Q())),Promise.race(Z)}function u(O,R){if(!d.isRef(O))return i(de=>de===O,R);const{flush:I="sync",deep:W=!1,timeout:G,throwOnTimeout:Q}=R??{};let q=null;const L=[new Promise(de=>{q=d.watch([o,O],([Ve,Se])=>{s!==(Ve===Se)&&(q==null||q(),de(Ve))},{flush:I,deep:W,immediate:!0})})];return G!=null&&L.push(dle(G,Q).then(()=>B0(o)).finally(()=>(q==null||q(),B0(o)))),Promise.race(L)}function m(O){return i(R=>!!R,O)}function h(O){return u(null,O)}function b(O){return u(void 0,O)}function C(O){return i(Number.isNaN,O)}function S(O,R){return i(I=>{const W=Array.from(I);return W.includes(O)||W.includes(B0(O))},R)}function _(O){return N(1,O)}function N(O=1,R){let I=-1;return i(()=>(I+=1,I>=O),R)}return Array.isArray(B0(o))?{toMatch:i,toContains:S,changed:_,changedTimes:N,get not(){return Sne(o,!s)}}:{toMatch:i,toBe:u,toBeTruthy:m,toBeNull:h,toBeNaN:C,toBeUndefined:b,changed:_,changedTimes:N,get not(){return Sne(o,!s)}}}function xne(o){return Sne(o)}function XBe(o){var s;const i=B0(o);return(s=i==null?void 0:i.$el)!=null?s:i}const jfe=zBe?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 ZBe;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(()=>[XBe(s),B0(m)],([N,O])=>{if(b(),!N)return;const R=WBe(O)?{...O}:O;h.push(...i.flatMap(I=>u.map(W=>C(N,I,W,R))))},{immediate:!0,flush:"post"}),_=()=>{S(),b()};return RU(_),_}function JBe(o){return typeof o=="function"?o:typeof o=="string"?s=>s.key===o:Array.isArray(o)?s=>o.includes(s.key):()=>!0}function fle(...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=JBe(s);return Wfe(m,h,N=>{N.repeat&&B0(C)||S(N)&&i(N)},b)}function QBe(o){return JSON.parse(JSON.stringify(o))}function vte(o,s,i,u={}){var m,h,b;const{clone:C=!1,passive:S=!1,eventName:_,deep:N=!1,defaultValue:O,shouldEmit:R}=u,I=d.getCurrentInstance(),W=i||(I==null?void 0:I.emit)||((m=I==null?void 0:I.$emit)==null?void 0:m.bind(I))||((b=(h=I==null?void 0:I.proxy)==null?void 0:h.$emit)==null?void 0:b.bind(I==null?void 0:I.proxy));let G=_;s||(s="modelValue"),G=G||`update:${s.toString()}`;const Q=L=>C?typeof C=="function"?C(L):QBe(L):L,q=()=>UBe(o[s])?Q(o[s]):O,Z=L=>{R?R(L)&&W(G,L):W(G,L)};if(S){const L=q(),de=d.ref(L);let Ve=!1;return d.watch(()=>o[s],Se=>{Ve||(Ve=!0,de.value=Q(Se),d.nextTick(()=>Ve=!1))}),d.watch(de,Se=>{!Ve&&(Se!==o[s]||N)&&Z(Se)},{deep:N}),de}else return d.computed({get(){return q()},set(L){Z(L)}})}var eRe={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 iz(i)}function iz(o){this._=o}function tRe(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}})}iz.prototype=IU.prototype={constructor:iz,on:function(o,s){var i=this._,u=tRe(o+"",i),m,h=-1,b=u.length;if(arguments.length<2){for(;++h<b;)if((m=(o=u[h]).type)&&(m=nRe(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]=mle(i[m],o.name,s);else if(s==null)for(m in i)i[m]=mle(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 iz(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 nRe(o,s){for(var i=0,u=o.length,m;i<u;++i)if((m=o[i]).name===s)return m.value}function mle(o,s,i){for(var u=0,m=o.length;u<m;++u)if(o[u].name===s){o[u]=eRe,o=o.slice(0,u).concat(o.slice(u+1));break}return i!=null&&o.push({name:s,value:i}),o}var Ene="http://www.w3.org/1999/xhtml";const ple={svg:"http://www.w3.org/2000/svg",xhtml:Ene,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)),ple.hasOwnProperty(s)?{space:ple[s],local:o}:o}function oRe(o){return function(){var s=this.ownerDocument,i=this.namespaceURI;return i===Ene&&s.documentElement.namespaceURI===Ene?s.createElement(o):s.createElementNS(i,o)}}function sRe(o){return function(){return this.ownerDocument.createElementNS(o.space,o.local)}}function Zfe(o){var s=PU(o);return(s.local?sRe:oRe)(s)}function rRe(){}function Loe(o){return o==null?rRe:function(){return this.querySelector(o)}}function aRe(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 iRe(o){return o==null?[]:Array.isArray(o)?o:Array.from(o)}function lRe(){return[]}function Gfe(o){return o==null?lRe:function(){return this.querySelectorAll(o)}}function cRe(o){return function(){return iRe(o.apply(this,arguments))}}function uRe(o){typeof o=="function"?o=cRe(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 dRe=Array.prototype.find;function fRe(o){return function(){return dRe.call(this.children,o)}}function mRe(){return this.firstElementChild}function pRe(o){return this.select(o==null?mRe:fRe(typeof o=="function"?o:Yfe(o)))}var gRe=Array.prototype.filter;function hRe(){return Array.from(this.children)}function vRe(o){return function(){return gRe.call(this.children,o)}}function bRe(o){return this.selectAll(o==null?hRe:vRe(typeof o=="function"?o:Yfe(o)))}function yRe(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 wRe(){return new Sp(this._enter||this._groups.map(Kfe),this._parents)}function Iz(o,s){this.ownerDocument=o.ownerDocument,this.namespaceURI=o.namespaceURI,this._next=null,this._parent=o,this.__data__=s}Iz.prototype={constructor:Iz,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 CRe(o){return function(){return o}}function SRe(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 Iz(o,h[b]);for(;b<S;++b)(C=s[b])&&(m[b]=C)}function xRe(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 Iz(o,h[C]);for(C=0;C<N;++C)(S=s[C])&&_.get(R[C])===S&&(m[C]=S)}function ERe(o){return o.__data__}function _Re(o,s){if(!arguments.length)return Array.from(this,ERe);var i=s?xRe:SRe,u=this._parents,m=this._groups;typeof o!="function"&&(o=CRe(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=kRe(o.call(N,N&&N.__data__,_,u)),W=I.length,G=C[_]=new Array(W),Q=b[_]=new Array(W),q=S[_]=new Array(R);i(N,O,G,Q,q,I,s);for(var Z=0,L=0,de,Ve;Z<W;++Z)if(de=G[Z]){for(Z>=L&&(L=Z+1);!(Ve=Q[L])&&++L<W;);de._next=Ve||null}}return b=new Sp(b,u),b._enter=C,b._exit=S,b}function kRe(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function TRe(){return new Sp(this._exit||this._groups.map(Kfe),this._parents)}function ARe(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 NRe(o){for(var s=o.selection?o.selection():o,i=this._groups,u=s._groups,m=i.length,h=u.length,b=Math.min(m,h),C=new Array(m),S=0;S<b;++S)for(var _=i[S],N=u[S],O=_.length,R=C[S]=new Array(O),I,W=0;W<O;++W)(I=_[W]||N[W])&&(R[W]=I);for(;S<m;++S)C[S]=i[S];return new Sp(C,this._parents)}function ORe(){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 $Re(o){o||(o=DRe);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 DRe(o,s){return o<s?-1:o>s?1:o>=s?0:NaN}function MRe(){var o=arguments[0];return arguments[0]=this,o.apply(null,arguments),this}function BRe(){return Array.from(this)}function RRe(){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 IRe(){let o=0;for(const s of this)++o;return o}function PRe(){return!this.node()}function FRe(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 LRe(o){return function(){this.removeAttribute(o)}}function VRe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function HRe(o,s){return function(){this.setAttribute(o,s)}}function zRe(o,s){return function(){this.setAttributeNS(o.space,o.local,s)}}function URe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttribute(o):this.setAttribute(o,i)}}function jRe(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 WRe(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?VRe:LRe:typeof s=="function"?i.local?jRe:URe:i.local?zRe:HRe)(i,s))}function Xfe(o){return o.ownerDocument&&o.ownerDocument.defaultView||o.document&&o||o.defaultView}function ZRe(o){return function(){this.style.removeProperty(o)}}function GRe(o,s,i){return function(){this.style.setProperty(o,s,i)}}function qRe(o,s,i){return function(){var u=s.apply(this,arguments);u==null?this.style.removeProperty(o):this.style.setProperty(o,u,i)}}function YRe(o,s,i){return arguments.length>1?this.each((s==null?ZRe:typeof s=="function"?qRe:GRe)(o,s,i??"")):g4(this.node(),o)}function g4(o,s){return o.style.getPropertyValue(s)||Xfe(o).getComputedStyle(o,null).getPropertyValue(s)}function KRe(o){return function(){delete this[o]}}function XRe(o,s){return function(){this[o]=s}}function JRe(o,s){return function(){var i=s.apply(this,arguments);i==null?delete this[o]:this[o]=i}}function QRe(o,s){return arguments.length>1?this.each((s==null?KRe:typeof s=="function"?JRe:XRe)(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 eIe(o){return function(){eme(this,o)}}function tIe(o){return function(){tme(this,o)}}function nIe(o,s){return function(){(s.apply(this,arguments)?eme:tme)(this,o)}}function oIe(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"?nIe:s?eIe:tIe)(i,s))}function sIe(){this.textContent=""}function rIe(o){return function(){this.textContent=o}}function aIe(o){return function(){var s=o.apply(this,arguments);this.textContent=s??""}}function iIe(o){return arguments.length?this.each(o==null?sIe:(typeof o=="function"?aIe:rIe)(o)):this.node().textContent}function lIe(){this.innerHTML=""}function cIe(o){return function(){this.innerHTML=o}}function uIe(o){return function(){var s=o.apply(this,arguments);this.innerHTML=s??""}}function dIe(o){return arguments.length?this.each(o==null?lIe:(typeof o=="function"?uIe:cIe)(o)):this.node().innerHTML}function fIe(){this.nextSibling&&this.parentNode.appendChild(this)}function mIe(){return this.each(fIe)}function pIe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function gIe(){return this.each(pIe)}function hIe(o){var s=typeof o=="function"?o:Zfe(o);return this.select(function(){return this.appendChild(s.apply(this,arguments))})}function vIe(){return null}function bIe(o,s){var i=typeof o=="function"?o:Zfe(o),u=s==null?vIe:typeof s=="function"?s:Loe(s);return this.select(function(){return this.insertBefore(i.apply(this,arguments),u.apply(this,arguments)||null)})}function yIe(){var o=this.parentNode;o&&o.removeChild(this)}function wIe(){return this.each(yIe)}function CIe(){var o=this.cloneNode(!1),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function SIe(){var o=this.cloneNode(!0),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function xIe(o){return this.select(o?SIe:CIe)}function EIe(o){return arguments.length?this.property("__data__",o):this.node().__data__}function _Ie(o){return function(s){o.call(this,s,this.__data__)}}function kIe(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 TIe(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 AIe(o,s,i){return function(){var u=this.__on,m,h=_Ie(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 NIe(o,s,i){var u=kIe(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?AIe:TIe,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 OIe(o,s){return function(){return nme(this,o,s)}}function $Ie(o,s){return function(){return nme(this,o,s.apply(this,arguments))}}function DIe(o,s){return this.each((typeof s=="function"?$Ie:OIe)(o,s))}function*MIe(){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 FB(){return new Sp([[document.documentElement]],ome)}function BIe(){return this}Sp.prototype=FB.prototype={constructor:Sp,select:aRe,selectAll:uRe,selectChild:pRe,selectChildren:bRe,filter:yRe,data:_Re,enter:wRe,exit:TRe,join:ARe,merge:NRe,selection:BIe,order:ORe,sort:$Re,call:MRe,nodes:BRe,node:RRe,size:IRe,empty:PRe,each:FRe,attr:WRe,style:YRe,property:QRe,classed:oIe,text:iIe,html:dIe,raise:mIe,lower:gIe,append:hIe,insert:bIe,remove:wIe,clone:xIe,datum:EIe,on:NIe,dispatch:DIe,[Symbol.iterator]:MIe};function Mh(o){return typeof o=="string"?new Sp([[document.querySelector(o)]],[document.documentElement]):new Sp([[o]],ome)}function RIe(o){let s;for(;s=o.sourceEvent;)o=s;return o}function Ov(o,s){if(o=RIe(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 IIe={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 IH=o=>()=>o;function _ne(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}})}_ne.prototype.on=function(){var o=this._.on.apply(this._,arguments);return o===this._?this:o};function PIe(o){return!o.ctrlKey&&!o.button}function FIe(){return this.parentNode}function LIe(o,s){return s??{x:o.x,y:o.y}}function VIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function HIe(){var o=PIe,s=FIe,i=LIe,u=VIe,m={},h=IU("start","drag","end"),b=0,C,S,_,N,O=0;function R(de){de.on("mousedown.drag",I).filter(u).on("touchstart.drag",Q).on("touchmove.drag",q,IIe).on("touchend.drag touchcancel.drag",Z).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function I(de,Ve){if(!(N||!o.call(this,de,Ve))){var Se=L(this,s.call(this,de,Ve),de,Ve,"mouse");Se&&(Mh(de.view).on("mousemove.drag",W,fB).on("mouseup.drag",G,fB),sme(de.view),bte(de),_=!1,C=de.clientX,S=de.clientY,Se("start",de))}}function W(de){if(a4(de),!_){var Ve=de.clientX-C,Se=de.clientY-S;_=Ve*Ve+Se*Se>O}m.mouse("drag",de)}function G(de){Mh(de.view).on("mousemove.drag mouseup.drag",null),rme(de.view,_),a4(de),m.mouse("end",de)}function Q(de,Ve){if(o.call(this,de,Ve)){var Se=de.changedTouches,J=s.call(this,de,Ve),Fe=Se.length,it,rt;for(it=0;it<Fe;++it)(rt=L(this,J,de,Ve,Se[it].identifier,Se[it]))&&(bte(de),rt("start",de,Se[it]))}}function q(de){var Ve=de.changedTouches,Se=Ve.length,J,Fe;for(J=0;J<Se;++J)(Fe=m[Ve[J].identifier])&&(a4(de),Fe("drag",de,Ve[J]))}function Z(de){var Ve=de.changedTouches,Se=Ve.length,J,Fe;for(N&&clearTimeout(N),N=setTimeout(function(){N=null},500),J=0;J<Se;++J)(Fe=m[Ve[J].identifier])&&(bte(de),Fe("end",de,Ve[J]))}function L(de,Ve,Se,J,Fe,it){var rt=h.copy(),De=Ov(it||Se,Ve),ce,zt,he;if((he=i.call(de,new _ne("beforestart",{sourceEvent:Se,target:R,identifier:Fe,active:b,x:De[0],y:De[1],dx:0,dy:0,dispatch:rt}),J))!=null)return ce=he.x-De[0]||0,zt=he.y-De[1]||0,function Ee(M,Ze,ye){var at=De,st;switch(M){case"start":m[Fe]=Ee,st=b++;break;case"end":delete m[Fe],--b;case"drag":De=Ov(ye||Ze,Ve),st=b;break}rt.call(M,de,new _ne(M,{sourceEvent:Ze,subject:he,target:R,identifier:Fe,active:st,x:De[0]+ce,y:De[1]+zt,dx:De[0]-at[0],dy:De[1]-at[1],dispatch:rt}),J)}}return R.filter=function(de){return arguments.length?(o=typeof de=="function"?de:IH(!!de),R):o},R.container=function(de){return arguments.length?(s=typeof de=="function"?de:IH(de),R):s},R.subject=function(de){return arguments.length?(i=typeof de=="function"?de:IH(de),R):i},R.touchable=function(de){return arguments.length?(u=typeof de=="function"?de:IH(!!de),R):u},R.on=function(){var de=h.on.apply(h,arguments);return de===h?R:de},R.clickDistance=function(de){return arguments.length?(O=(de=+de)*de,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 LB(){}var mB=.7,Pz=1/mB,i4="\\s*([+-]?\\d+)\\s*",pB="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Mv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zIe=/^#([0-9a-f]{3,8})$/,UIe=new RegExp(`^rgb\\(${i4},${i4},${i4}\\)$`),jIe=new RegExp(`^rgb\\(${Mv},${Mv},${Mv}\\)$`),WIe=new RegExp(`^rgba\\(${i4},${i4},${i4},${pB}\\)$`),ZIe=new RegExp(`^rgba\\(${Mv},${Mv},${Mv},${pB}\\)$`),GIe=new RegExp(`^hsl\\(${pB},${Mv},${Mv}\\)$`),qIe=new RegExp(`^hsla\\(${pB},${Mv},${Mv},${pB}\\)$`),gle={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(LB,gB,{copy(o){return Object.assign(new this.constructor,this,o)},displayable(){return this.rgb().displayable()},hex:hle,formatHex:hle,formatHex8:YIe,formatHsl:KIe,formatRgb:vle,toString:vle});function hle(){return this.rgb().formatHex()}function YIe(){return this.rgb().formatHex8()}function KIe(){return ime(this).formatHsl()}function vle(){return this.rgb().formatRgb()}function gB(o){var s,i;return o=(o+"").trim().toLowerCase(),(s=zIe.exec(o))?(i=s[1].length,s=parseInt(s[1],16),i===6?ble(s):i===3?new Sm(s>>8&15|s>>4&240,s>>4&15|s&240,(s&15)<<4|s&15,1):i===8?PH(s>>24&255,s>>16&255,s>>8&255,(s&255)/255):i===4?PH(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=UIe.exec(o))?new Sm(s[1],s[2],s[3],1):(s=jIe.exec(o))?new Sm(s[1]*255/100,s[2]*255/100,s[3]*255/100,1):(s=WIe.exec(o))?PH(s[1],s[2],s[3],s[4]):(s=ZIe.exec(o))?PH(s[1]*255/100,s[2]*255/100,s[3]*255/100,s[4]):(s=GIe.exec(o))?Cle(s[1],s[2]/100,s[3]/100,1):(s=qIe.exec(o))?Cle(s[1],s[2]/100,s[3]/100,s[4]):gle.hasOwnProperty(o)?ble(gle[o]):o==="transparent"?new Sm(NaN,NaN,NaN,0):null}function ble(o){return new Sm(o>>16&255,o>>8&255,o&255,1)}function PH(o,s,i,u){return u<=0&&(o=s=i=NaN),new Sm(o,s,i,u)}function XIe(o){return o instanceof LB||(o=gB(o)),o?(o=o.rgb(),new Sm(o.r,o.g,o.b,o.opacity)):new Sm}function kne(o,s,i,u){return arguments.length===1?XIe(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,kne,ame(LB,{brighter(o){return o=o==null?Pz:Math.pow(Pz,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(EE(this.r),EE(this.g),EE(this.b),Fz(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:yle,formatHex:yle,formatHex8:JIe,formatRgb:wle,toString:wle}));function yle(){return`#${vE(this.r)}${vE(this.g)}${vE(this.b)}`}function JIe(){return`#${vE(this.r)}${vE(this.g)}${vE(this.b)}${vE((isNaN(this.opacity)?1:this.opacity)*255)}`}function wle(){const o=Fz(this.opacity);return`${o===1?"rgb(":"rgba("}${EE(this.r)}, ${EE(this.g)}, ${EE(this.b)}${o===1?")":`, ${o})`}`}function Fz(o){return isNaN(o)?1:Math.max(0,Math.min(1,o))}function EE(o){return Math.max(0,Math.min(255,Math.round(o)||0))}function vE(o){return o=EE(o),(o<16?"0":"")+o.toString(16)}function Cle(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 LB||(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 QIe(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,QIe,ame(LB,{brighter(o){return o=o==null?Pz:Math.pow(Pz,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(Sle(this.h),FH(this.s),FH(this.l),Fz(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=Fz(this.opacity);return`${o===1?"hsl(":"hsla("}${Sle(this.h)}, ${FH(this.s)*100}%, ${FH(this.l)*100}%${o===1?")":`, ${o})`}`}}));function Sle(o){return o=(o||0)%360,o<0?o+360:o}function FH(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 ePe(o,s){return function(i){return o+i*s}}function tPe(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 nPe(o){return(o=+o)==1?cme:function(s,i){return i-s?tPe(s,i,o):lme(isNaN(s)?i:s)}}function cme(o,s){var i=s-o;return i?ePe(o,i):lme(isNaN(o)?s:o)}const xle=function o(s){var i=nPe(s);function u(m,h){var b=i((m=kne(m)).r,(h=kne(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 Tne=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wte=new RegExp(Tne.source,"g");function oPe(o){return function(){return o}}function sPe(o){return function(s){return o(s)+""}}function rPe(o,s){var i=Tne.lastIndex=wte.lastIndex=0,u,m,h,b=-1,C=[],S=[];for(o=o+"",s=s+"";(u=Tne.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]?sPe(S[0].x):oPe(s):(s=S.length,function(_){for(var N=0,O;N<s;++N)C[(O=S[N]).i]=O.x(_);return C.join("")})}var Ele=180/Math.PI,Ane={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)*Ele,skewX:Math.atan(S)*Ele,scaleX:b,scaleY:C}}var LH;function aPe(o){const s=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(o+"");return s.isIdentity?Ane:ume(s.a,s.b,s.c,s.d,s.e,s.f)}function iPe(o){return o==null||(LH||(LH=document.createElementNS("http://www.w3.org/2000/svg","g")),LH.setAttribute("transform",o),!(o=LH.transform.baseVal.consolidate()))?Ane:(o=o.matrix,ume(o.a,o.b,o.c,o.d,o.e,o.f))}function dme(o,s,i,u){function m(_){return _.length?_.pop()+" ":""}function h(_,N,O,R,I,W){if(_!==O||N!==R){var G=I.push("translate(",null,s,null,i);W.push({i:G-4,x:r2(_,O)},{i:G-2,x:r2(N,R)})}else(O||R)&&I.push("translate("+O+s+R+i)}function b(_,N,O,R){_!==N?(_-N>180?N+=360:N-_>180&&(_+=360),R.push({i:O.push(m(O)+"rotate(",null,u)-2,x:r2(_,N)})):N&&O.push(m(O)+"rotate("+N+u)}function C(_,N,O,R){_!==N?R.push({i:O.push(m(O)+"skewX(",null,u)-2,x:r2(_,N)}):N&&O.push(m(O)+"skewX("+N+u)}function S(_,N,O,R,I,W){if(_!==O||N!==R){var G=I.push(m(I)+"scale(",null,",",null,")");W.push({i:G-4,x:r2(_,O)},{i:G-2,x:r2(N,R)})}else(O!==1||R!==1)&&I.push(m(I)+"scale("+O+","+R+")")}return function(_,N){var O=[],R=[];return _=o(_),N=o(N),h(_.translateX,_.translateY,N.translateX,N.translateY,O,R),b(_.rotate,N.rotate,O,R),C(_.skewX,N.skewX,O,R),S(_.scaleX,_.scaleY,N.scaleX,N.scaleY,O,R),_=N=null,function(I){for(var W=-1,G=R.length,Q;++W<G;)O[(Q=R[W]).i]=Q.x(I);return O.join("")}}}var lPe=dme(aPe,"px, ","px)","deg)"),cPe=dme(iPe,", ",")",")"),uPe=1e-12;function _le(o){return((o=Math.exp(o))+1/o)/2}function dPe(o){return((o=Math.exp(o))-1/o)/2}function fPe(o){return((o=Math.exp(2*o))-1)/(o+1)}const mPe=function o(s,i,u){function m(h,b){var C=h[0],S=h[1],_=h[2],N=b[0],O=b[1],R=b[2],I=N-C,W=O-S,G=I*I+W*W,Q,q;if(G<uPe)q=Math.log(R/_)/s,Q=function(J){return[C+J*I,S+J*W,_*Math.exp(s*J*q)]};else{var Z=Math.sqrt(G),L=(R*R-_*_+u*G)/(2*_*i*Z),de=(R*R-_*_-u*G)/(2*R*i*Z),Ve=Math.log(Math.sqrt(L*L+1)-L),Se=Math.log(Math.sqrt(de*de+1)-de);q=(Se-Ve)/s,Q=function(J){var Fe=J*q,it=_le(Ve),rt=_/(i*Z)*(it*fPe(s*Fe+Ve)-dPe(Ve));return[C+rt*I,S+rt*W,_*it/_le(s*Fe+Ve)]}}return Q.duration=q*1e3*s/Math.SQRT2,Q}return m.rho=function(h){var b=Math.max(.001,+h),C=b*b,S=C*C;return o(b,C,S)},m}(Math.SQRT2,2,4);var h4=0,F6=0,R6=0,fme=1e3,Lz,L6,Vz=0,OE=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 OE||(mme(pPe),OE=hB.now()+FU)}function pPe(){OE=0}function Hz(){this._call=this._time=this._next=null}Hz.prototype=pme.prototype={constructor:Hz,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&&L6!==this&&(L6?L6._next=this:Lz=this,L6=this),this._call=o,this._time=i,Nne()},stop:function(){this._call&&(this._call=null,this._time=1/0,Nne())}};function pme(o,s,i){var u=new Hz;return u.restart(o,s,i),u}function gPe(){zoe(),++h4;for(var o=Lz,s;o;)(s=OE-o._time)>=0&&o._call.call(void 0,s),o=o._next;--h4}function kle(){OE=(Vz=hB.now())+FU,h4=F6=0;try{gPe()}finally{h4=0,vPe(),OE=0}}function hPe(){var o=hB.now(),s=o-Vz;s>fme&&(FU-=s,Vz=o)}function vPe(){for(var o,s=Lz,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:Lz=i);L6=o,Nne(u)}function Nne(o){if(!h4){F6&&(F6=clearTimeout(F6));var s=o-OE;s>24?(o<1/0&&(F6=setTimeout(kle,o-hB.now()-FU)),R6&&(R6=clearInterval(R6))):(R6||(Vz=hB.now(),R6=setInterval(hPe,fme)),h4=1,mme(kle))}}function Tle(o,s,i){var u=new Hz;return s=s==null?0:+s,u.restart(m=>{u.stop(),o(m+s)},s,i),u}var bPe=IU("start","end","cancel","interrupt"),yPe=[],gme=0,Ale=1,One=2,lz=3,Nle=4,$ne=5,cz=6;function LU(o,s,i,u,m,h){var b=o.__transition;if(!b)o.__transition={};else if(i in b)return;wPe(o,i,{name:s,index:u,group:m,on:bPe,tween:yPe,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>lz)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 wPe(o,s,i){var u=o.__transition,m;u[s]=i,i.timer=pme(h,0,i.time);function h(_){i.state=Ale,i.timer.restart(b,i.delay,i.time),i.delay<=_&&b(_-i.delay)}function b(_){var N,O,R,I;if(i.state!==Ale)return S();for(N in u)if(I=u[N],I.name===i.name){if(I.state===lz)return Tle(b);I.state===Nle?(I.state=cz,I.timer.stop(),I.on.call("interrupt",o,o.__data__,I.index,I.group),delete u[N]):+N<s&&(I.state=cz,I.timer.stop(),I.on.call("cancel",o,o.__data__,I.index,I.group),delete u[N])}if(Tle(function(){i.state===lz&&(i.state=Nle,i.timer.restart(C,i.delay,i.time),C(_))}),i.state=One,i.on.call("start",o,o.__data__,i.index,i.group),i.state===One){for(i.state=lz,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=$ne,1),O=-1,R=m.length;++O<R;)m[O].call(o,N);i.state===$ne&&(i.on.call("end",o,o.__data__,i.index,i.group),S())}function S(){i.state=cz,i.timer.stop(),delete u[s];for(var _ in u)return;delete o.__transition}}function uz(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>One&&u.state<$ne,u.state=cz,u.timer.stop(),u.on.call(m?"interrupt":"cancel",o,o.__data__,u.index,u.group),delete i[b]}h&&delete o.__transition}}function CPe(o){return this.each(function(){uz(this,o)})}function SPe(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 xPe(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 EPe(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?SPe:xPe)(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?xle:(i=gB(s))?(s=i,xle):rPe)(o,s)}function _Pe(o){return function(){this.removeAttribute(o)}}function kPe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function TPe(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 APe(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 NPe(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 OPe(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 $Pe(o,s){var i=PU(o),u=i==="transform"?cPe:hme;return this.attrTween(o,typeof s=="function"?(i.local?OPe:NPe)(i,u,joe(this,"attr."+o,s)):s==null?(i.local?kPe:_Pe)(i):(i.local?APe:TPe)(i,u,s))}function DPe(o,s){return function(i){this.setAttribute(o,s.call(this,i))}}function MPe(o,s){return function(i){this.setAttributeNS(o.space,o.local,s.call(this,i))}}function BPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&MPe(o,h)),i}return m._value=s,m}function RPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&DPe(o,h)),i}return m._value=s,m}function IPe(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?BPe:RPe)(u,s))}function PPe(o,s){return function(){Uoe(this,o).delay=+s.apply(this,arguments)}}function FPe(o,s){return s=+s,function(){Uoe(this,o).delay=s}}function LPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?PPe:FPe)(s,o)):Fh(this.node(),s).delay}function VPe(o,s){return function(){Fv(this,o).duration=+s.apply(this,arguments)}}function HPe(o,s){return s=+s,function(){Fv(this,o).duration=s}}function zPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?VPe:HPe)(s,o)):Fh(this.node(),s).duration}function UPe(o,s){if(typeof s!="function")throw new Error;return function(){Fv(this,o).ease=s}}function jPe(o){var s=this._id;return arguments.length?this.each(UPe(s,o)):Fh(this.node(),s).ease}function WPe(o,s){return function(){var i=s.apply(this,arguments);if(typeof i!="function")throw new Error;Fv(this,o).ease=i}}function ZPe(o){if(typeof o!="function")throw new Error;return this.each(WPe(this._id,o))}function GPe(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 qPe(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 YPe(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 KPe(o,s,i){var u,m,h=YPe(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 XPe(o,s){var i=this._id;return arguments.length<2?Fh(this.node(),i).on.on(o):this.each(KPe(i,o,s))}function JPe(o){return function(){var s=this.parentNode;for(var i in this.__transition)if(+i!==o)return;s&&s.removeChild(this)}}function QPe(){return this.on("end.remove",JPe(this._id))}function e8e(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 t8e(o){var s=this._name,i=this._id;typeof o!="function"&&(o=Gfe(o));for(var u=this._groups,m=u.length,h=[],b=[],C=0;C<m;++C)for(var S=u[C],_=S.length,N,O=0;O<_;++O)if(N=S[O]){for(var R=o.call(N,N.__data__,O,S),I,W=Fh(N,i),G=0,Q=R.length;G<Q;++G)(I=R[G])&&LU(I,s,i,G,R,W);h.push(R),b.push(N)}return new V0(h,b,s,i)}var n8e=FB.prototype.constructor;function o8e(){return new n8e(this._groups,this._parents)}function s8e(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 r8e(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 a8e(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 i8e(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 l8e(o,s,i){var u=(o+="")=="transform"?lPe:hme;return s==null?this.styleTween(o,s8e(o,u)).on("end.style."+o,vme(o)):typeof s=="function"?this.styleTween(o,a8e(o,u,joe(this,"style."+o,s))).each(i8e(this._id,o)):this.styleTween(o,r8e(o,u,s),i).on("end.style."+o,null)}function c8e(o,s,i){return function(u){this.style.setProperty(o,s.call(this,u),i)}}function u8e(o,s,i){var u,m;function h(){var b=s.apply(this,arguments);return b!==m&&(u=(m=b)&&c8e(o,b,i)),u}return h._value=s,h}function d8e(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,u8e(o,s,i??""))}function f8e(o){return function(){this.textContent=o}}function m8e(o){return function(){var s=o(this);this.textContent=s??""}}function p8e(o){return this.tween("text",typeof o=="function"?m8e(joe(this,"text",o)):f8e(o==null?"":o+""))}function g8e(o){return function(s){this.textContent=o.call(this,s)}}function h8e(o){var s,i;function u(){var m=o.apply(this,arguments);return m!==i&&(s=(i=m)&&g8e(m)),s}return u._value=o,u}function v8e(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,h8e(o))}function b8e(){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 y8e(){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 w8e=0;function V0(o,s,i,u){this._groups=o,this._parents=s,this._name=i,this._id=u}function bme(){return++w8e}var $0=FB.prototype;V0.prototype={constructor:V0,select:e8e,selectAll:t8e,selectChild:$0.selectChild,selectChildren:$0.selectChildren,filter:GPe,merge:qPe,selection:o8e,transition:b8e,call:$0.call,nodes:$0.nodes,node:$0.node,size:$0.size,empty:$0.empty,each:$0.each,on:XPe,attr:$Pe,attrTween:IPe,style:l8e,styleTween:d8e,text:p8e,textTween:v8e,remove:QPe,tween:EPe,delay:LPe,duration:zPe,ease:jPe,easeVarying:ZPe,end:y8e,[Symbol.iterator]:$0[Symbol.iterator]};function C8e(o){return((o*=2)<=1?o*o*o:(o-=2)*o*o+2)/2}var S8e={time:null,delay:0,duration:250,ease:C8e};function x8e(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 E8e(o){var s,i;o instanceof V0?(s=o._id,o=o._name):(s=bme(),(i=S8e).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||x8e(S,s));return new V0(u,this._parents,o,s)}FB.prototype.interrupt=CPe;FB.prototype.transition=E8e;const VH=o=>()=>o;function _8e(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 I6(o){o.preventDefault(),o.stopImmediatePropagation()}function k8e(o){return(!o.ctrlKey||o.type==="wheel")&&!o.button}function T8e(){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 Ole(){return this.__zoom||v4}function A8e(o){return-o.deltaY*(o.deltaMode===1?.05:o.deltaMode?1:.002)*(o.ctrlKey?10:1)}function N8e(){return navigator.maxTouchPoints||"ontouchstart"in this}function O8e(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 $8e(){var o=k8e,s=T8e,i=O8e,u=A8e,m=N8e,h=[0,1/0],b=[[-1/0,-1/0],[1/0,1/0]],C=250,S=mPe,_=IU("start","zoom","end"),N,O,R,I=500,W=150,G=0,Q=10;function q(he){he.property("__zoom",Ole).on("wheel.zoom",Fe,{passive:!1}).on("mousedown.zoom",it).on("dblclick.zoom",rt).filter(m).on("touchstart.zoom",De).on("touchmove.zoom",ce).on("touchend.zoom touchcancel.zoom",zt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}q.transform=function(he,Ee,M,Ze){var ye=he.selection?he.selection():he;ye.property("__zoom",Ole),he!==ye?Ve(he,Ee,M,Ze):ye.interrupt().each(function(){Se(this,arguments).event(Ze).start().zoom(null,typeof Ee=="function"?Ee.apply(this,arguments):Ee).end()})},q.scaleBy=function(he,Ee,M,Ze){q.scaleTo(he,function(){var ye=this.__zoom.k,at=typeof Ee=="function"?Ee.apply(this,arguments):Ee;return ye*at},M,Ze)},q.scaleTo=function(he,Ee,M,Ze){q.transform(he,function(){var ye=s.apply(this,arguments),at=this.__zoom,st=M==null?de(ye):typeof M=="function"?M.apply(this,arguments):M,ge=at.invert(st),Ke=typeof Ee=="function"?Ee.apply(this,arguments):Ee;return i(L(Z(at,Ke),st,ge),ye,b)},M,Ze)},q.translateBy=function(he,Ee,M,Ze){q.transform(he,function(){return i(this.__zoom.translate(typeof Ee=="function"?Ee.apply(this,arguments):Ee,typeof M=="function"?M.apply(this,arguments):M),s.apply(this,arguments),b)},null,Ze)},q.translateTo=function(he,Ee,M,Ze,ye){q.transform(he,function(){var at=s.apply(this,arguments),st=this.__zoom,ge=Ze==null?de(at):typeof Ze=="function"?Ze.apply(this,arguments):Ze;return i(v4.translate(ge[0],ge[1]).scale(st.k).translate(typeof Ee=="function"?-Ee.apply(this,arguments):-Ee,typeof M=="function"?-M.apply(this,arguments):-M),at,b)},Ze,ye)};function Z(he,Ee){return Ee=Math.max(h[0],Math.min(h[1],Ee)),Ee===he.k?he:new I0(Ee,he.x,he.y)}function L(he,Ee,M){var Ze=Ee[0]-M[0]*he.k,ye=Ee[1]-M[1]*he.k;return Ze===he.x&&ye===he.y?he:new I0(he.k,Ze,ye)}function de(he){return[(+he[0][0]+ +he[1][0])/2,(+he[0][1]+ +he[1][1])/2]}function Ve(he,Ee,M,Ze){he.on("start.zoom",function(){Se(this,arguments).event(Ze).start()}).on("interrupt.zoom end.zoom",function(){Se(this,arguments).event(Ze).end()}).tween("zoom",function(){var ye=this,at=arguments,st=Se(ye,at).event(Ze),ge=s.apply(ye,at),Ke=M==null?de(ge):typeof M=="function"?M.apply(ye,at):M,$t=Math.max(ge[1][0]-ge[0][0],ge[1][1]-ge[0][1]),Ue=ye.__zoom,ht=typeof Ee=="function"?Ee.apply(ye,at):Ee,Pe=S(Ue.invert(Ke).concat($t/Ue.k),ht.invert(Ke).concat($t/ht.k));return function(mt){if(mt===1)mt=ht;else{var oe=Pe(mt),vn=$t/oe[2];mt=new I0(vn,Ke[0]-oe[0]*vn,Ke[1]-oe[1]*vn)}st.zoom(null,mt)}})}function Se(he,Ee,M){return!M&&he.__zooming||new J(he,Ee)}function J(he,Ee){this.that=he,this.args=Ee,this.active=0,this.sourceEvent=null,this.extent=s.apply(he,Ee),this.taps=0}J.prototype={event:function(he){return he&&(this.sourceEvent=he),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(he,Ee){return this.mouse&&he!=="mouse"&&(this.mouse[1]=Ee.invert(this.mouse[0])),this.touch0&&he!=="touch"&&(this.touch0[1]=Ee.invert(this.touch0[0])),this.touch1&&he!=="touch"&&(this.touch1[1]=Ee.invert(this.touch1[0])),this.that.__zoom=Ee,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(he){var Ee=Mh(this.that).datum();_.call(he,this.that,new _8e(he,{sourceEvent:this.sourceEvent,target:q,type:he,transform:this.that.__zoom,dispatch:_}),Ee)}};function Fe(he,...Ee){if(!o.apply(this,arguments))return;var M=Se(this,Ee).event(he),Ze=this.__zoom,ye=Math.max(h[0],Math.min(h[1],Ze.k*Math.pow(2,u.apply(this,arguments)))),at=Ov(he);if(M.wheel)(M.mouse[0][0]!==at[0]||M.mouse[0][1]!==at[1])&&(M.mouse[1]=Ze.invert(M.mouse[0]=at)),clearTimeout(M.wheel);else{if(Ze.k===ye)return;M.mouse=[at,Ze.invert(at)],uz(this),M.start()}I6(he),M.wheel=setTimeout(st,W),M.zoom("mouse",i(L(Z(Ze,ye),M.mouse[0],M.mouse[1]),M.extent,b));function st(){M.wheel=null,M.end()}}function it(he,...Ee){if(R||!o.apply(this,arguments))return;var M=he.currentTarget,Ze=Se(this,Ee,!0).event(he),ye=Mh(he.view).on("mousemove.zoom",Ke,!0).on("mouseup.zoom",$t,!0),at=Ov(he,M),st=he.clientX,ge=he.clientY;sme(he.view),Cte(he),Ze.mouse=[at,this.__zoom.invert(at)],uz(this),Ze.start();function Ke(Ue){if(I6(Ue),!Ze.moved){var ht=Ue.clientX-st,Pe=Ue.clientY-ge;Ze.moved=ht*ht+Pe*Pe>G}Ze.event(Ue).zoom("mouse",i(L(Ze.that.__zoom,Ze.mouse[0]=Ov(Ue,M),Ze.mouse[1]),Ze.extent,b))}function $t(Ue){ye.on("mousemove.zoom mouseup.zoom",null),rme(Ue.view,Ze.moved),I6(Ue),Ze.event(Ue).end()}}function rt(he,...Ee){if(o.apply(this,arguments)){var M=this.__zoom,Ze=Ov(he.changedTouches?he.changedTouches[0]:he,this),ye=M.invert(Ze),at=M.k*(he.shiftKey?.5:2),st=i(L(Z(M,at),Ze,ye),s.apply(this,Ee),b);I6(he),C>0?Mh(this).transition().duration(C).call(Ve,st,Ze,he):Mh(this).call(q.transform,st,Ze,he)}}function De(he,...Ee){if(o.apply(this,arguments)){var M=he.touches,Ze=M.length,ye=Se(this,Ee,he.changedTouches.length===Ze).event(he),at,st,ge,Ke;for(Cte(he),st=0;st<Ze;++st)ge=M[st],Ke=Ov(ge,this),Ke=[Ke,this.__zoom.invert(Ke),ge.identifier],ye.touch0?!ye.touch1&&ye.touch0[2]!==Ke[2]&&(ye.touch1=Ke,ye.taps=0):(ye.touch0=Ke,at=!0,ye.taps=1+!!N);N&&(N=clearTimeout(N)),at&&(ye.taps<2&&(O=Ke[0],N=setTimeout(function(){N=null},I)),uz(this),ye.start())}}function ce(he,...Ee){if(this.__zooming){var M=Se(this,Ee).event(he),Ze=he.changedTouches,ye=Ze.length,at,st,ge,Ke;for(I6(he),at=0;at<ye;++at)st=Ze[at],ge=Ov(st,this),M.touch0&&M.touch0[2]===st.identifier?M.touch0[0]=ge:M.touch1&&M.touch1[2]===st.identifier&&(M.touch1[0]=ge);if(st=M.that.__zoom,M.touch1){var $t=M.touch0[0],Ue=M.touch0[1],ht=M.touch1[0],Pe=M.touch1[1],mt=(mt=ht[0]-$t[0])*mt+(mt=ht[1]-$t[1])*mt,oe=(oe=Pe[0]-Ue[0])*oe+(oe=Pe[1]-Ue[1])*oe;st=Z(st,Math.sqrt(mt/oe)),ge=[($t[0]+ht[0])/2,($t[1]+ht[1])/2],Ke=[(Ue[0]+Pe[0])/2,(Ue[1]+Pe[1])/2]}else if(M.touch0)ge=M.touch0[0],Ke=M.touch0[1];else return;M.zoom("touch",i(L(st,ge,Ke),M.extent,b))}}function zt(he,...Ee){if(this.__zooming){var M=Se(this,Ee).event(he),Ze=he.changedTouches,ye=Ze.length,at,st;for(Cte(he),R&&clearTimeout(R),R=setTimeout(function(){R=null},I),at=0;at<ye;++at)st=Ze[at],M.touch0&&M.touch0[2]===st.identifier?delete M.touch0:M.touch1&&M.touch1[2]===st.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(st=Ov(st,this),Math.hypot(O[0]-st[0],O[1]-st[1])<Q)){var ge=Mh(this).on("dblclick.zoom");ge&&ge.apply(this,arguments)}}}return q.wheelDelta=function(he){return arguments.length?(u=typeof he=="function"?he:VH(+he),q):u},q.filter=function(he){return arguments.length?(o=typeof he=="function"?he:VH(!!he),q):o},q.touchable=function(he){return arguments.length?(m=typeof he=="function"?he:VH(!!he),q):m},q.extent=function(he){return arguments.length?(s=typeof he=="function"?he:VH([[+he[0][0],+he[0][1]],[+he[1][0],+he[1][1]]]),q):s},q.scaleExtent=function(he){return arguments.length?(h[0]=+he[0],h[1]=+he[1],q):[h[0],h[1]]},q.translateExtent=function(he){return arguments.length?(b[0][0]=+he[0][0],b[1][0]=+he[1][0],b[0][1]=+he[0][1],b[1][1]=+he[1][1],q):[[b[0][0],b[0][1]],[b[1][0],b[1][1]]]},q.constrain=function(he){return arguments.length?(i=he,q):i},q.duration=function(he){return arguments.length?(C=+he,q):C},q.interpolate=function(he){return arguments.length?(S=he,q):S},q.on=function(){var he=_.on.apply(_,arguments);return he===_?q:he},q.clickDistance=function(he){return arguments.length?(G=(he=+he)*he,q):Math.sqrt(G)},q.tapDistance=function(he){return arguments.length?(Q=+he,q):Q},q}var is=(o=>(o.Left="left",o.Top="top",o.Right="right",o.Bottom="bottom",o))(is||{}),Woe=(o=>(o.Partial="partial",o.Full="full",o))(Woe||{}),mE=(o=>(o.Bezier="default",o.SimpleBezier="simple-bezier",o.Straight="straight",o.Step="step",o.SmoothStep="smoothstep",o))(mE||{}),b2=(o=>(o.Strict="strict",o.Loose="loose",o))(b2||{}),zz=(o=>(o.Arrow="arrow",o.ArrowClosed="arrowclosed",o))(zz||{}),K6=(o=>(o.Free="free",o.Vertical="vertical",o.Horizontal="horizontal",o))(K6||{}),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 D8e=["INPUT","SELECT","TEXTAREA"];function Dne(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 D8e.includes(u==null?void 0:u.nodeName)||m||!!h}function M8e(o){return o.ctrlKey||o.metaKey||o.shiftKey||o.altKey}function $le(o,s,i,u){const m=s.replace("+",`
126
+ */(function(){const o=Ne=>je=>(Ot=>{const Dt=typeof Ot;return Ot===null?"null":Dt==="object"&&Array.isArray(Ot)?"array":Dt==="object"&&(pn=yn=Ot,(Nt=String).prototype.isPrototypeOf(pn)||((St=yn.constructor)===null||St===void 0?void 0:St.name)===Nt.name)?"string":Dt;var pn,yn,Nt,St})(je)===Ne,s=Ne=>je=>typeof je===Ne,i=o("string"),u=o("array"),m=s("boolean"),h=Ne=>Ne===void 0,b=Ne=>!(je=>je==null)(Ne),C=s("function"),S=s("number"),_=Ne=>()=>Ne,N=Ne=>Ne,O=_(!1),R=_(!0);class I{constructor(je,Ot){this.tag=je,this.value=Ot}static some(je){return new I(!0,je)}static none(){return I.singletonNone}fold(je,Ot){return this.tag?Ot(this.value):je()}isSome(){return this.tag}isNone(){return!this.tag}map(je){return this.tag?I.some(je(this.value)):I.none()}bind(je){return this.tag?je(this.value):I.none()}exists(je){return this.tag&&je(this.value)}forall(je){return!this.tag||je(this.value)}filter(je){return!this.tag||je(this.value)?this:I.none()}getOr(je){return this.tag?this.value:je}or(je){return this.tag?this:je}getOrThunk(je){return this.tag?this.value:je()}orThunk(je){return this.tag?this:je()}getOrDie(je){if(this.tag)return this.value;throw new Error(je??"Called getOrDie on None")}static from(je){return b(je)?I.some(je):I.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(je){this.tag&&je(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}I.singletonNone=new I(!1);const W=Array.prototype.indexOf,G=Array.prototype.push,Q=(Ne,je)=>((Ot,Dt)=>W.call(Ot,Dt))(Ne,je)>-1,q=(Ne,je)=>{for(let Ot=0,Dt=Ne.length;Ot<Dt;Ot++)if(je(Ne[Ot],Ot))return!0;return!1},Z=(Ne,je)=>{const Ot=Ne.length,Dt=new Array(Ot);for(let pn=0;pn<Ot;pn++){const yn=Ne[pn];Dt[pn]=je(yn,pn)}return Dt},L=(Ne,je)=>{const Ot=[];for(let Dt=0,pn=Ne.length;Dt<pn;Dt++){const yn=Ne[Dt];je(yn,Dt)&&Ot.push(yn)}return Ot},de=(Ne,je)=>((Ot,Dt,pn)=>{for(let yn=0,Nt=Ot.length;yn<Nt;yn++){const St=Ot[yn];if(Dt(St,yn))return I.some(St);if(pn(St,yn))break}return I.none()})(Ne,je,O),Ve=(Ne,je)=>(Ot=>{const Dt=[];for(let pn=0,yn=Ot.length;pn<yn;++pn){if(!u(Ot[pn]))throw new Error("Arr.flatten item "+pn+" was not an array, input: "+Ot);G.apply(Dt,Ot[pn])}return Dt})(Z(Ne,je)),Se=Object.keys,J=Object.hasOwnProperty,Fe=(Ne,je)=>{const Ot=Se(Ne);for(let Dt=0,pn=Ot.length;Dt<pn;Dt++){const yn=Ot[Dt];je(Ne[yn],yn)}},it=(Ne,je)=>{const Ot={};return Fe(Ne,(Dt,pn)=>{const yn=je(Dt,pn);Ot[yn.k]=yn.v}),Ot},rt=Ne=>(je,Ot)=>{Ne[Ot]=je},De=Ne=>((je,Ot)=>{const Dt=[];return Fe(je,(pn,yn)=>{Dt.push(Ot(pn,yn))}),Dt})(Ne,N),ce=(Ne,je)=>zt(Ne,je)?I.from(Ne[je]):I.none(),zt=(Ne,je)=>J.call(Ne,je),he=Ne=>{let je=Ne;return{get:()=>je,set:Ot=>{je=Ot}}},Ee=(Ne,je,Ot=0,Dt)=>{const pn=Ne.indexOf(je,Ot);return pn!==-1&&(!!h(Dt)||pn+je.length<=Dt)},M=Ne=>parseInt(Ne,10),Ze=(Ne,je)=>{const Ot=Ne-je;return Ot===0?0:Ot>0?1:-1},ye=(Ne,je,Ot)=>({major:Ne,minor:je,patch:Ot}),at=Ne=>{const je=/([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec(Ne);return je?ye(M(je[1]),M(je[2]),M(je[3])):ye(0,0,0)},st=()=>ge(0,0),ge=(Ne,je)=>({major:Ne,minor:je}),Ke={nu:ge,detect:(Ne,je)=>{const Ot=String(je).toLowerCase();return Ne.length===0?st():((Dt,pn)=>{const yn=((St,Ge)=>{for(let Xe=0;Xe<St.length;Xe++){const jt=St[Xe];if(jt.test(Ge))return jt}})(Dt,pn);if(!yn)return{major:0,minor:0};const Nt=St=>Number(pn.replace(yn,"$"+St));return ge(Nt(1),Nt(2))})(Ne,Ot)},unknown:st},$t=(Ne,je)=>{const Ot=String(je).toLowerCase();return de(Ne,Dt=>Dt.search(Ot))},Ue=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ht=Ne=>je=>Ee(je,Ne),Pe=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:Ne=>Ee(Ne,"edge/")&&Ee(Ne,"chrome")&&Ee(Ne,"safari")&&Ee(Ne,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ue],search:Ne=>Ee(Ne,"chrome")&&!Ee(Ne,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:Ne=>Ee(Ne,"msie")||Ee(Ne,"trident")},{name:"Opera",versionRegexes:[Ue,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ht("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ht("firefox")},{name:"Safari",versionRegexes:[Ue,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:Ne=>(Ee(Ne,"safari")||Ee(Ne,"mobile/"))&&Ee(Ne,"applewebkit")}],mt=[{name:"Windows",search:ht("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:Ne=>Ee(Ne,"iphone")||Ee(Ne,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ht("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:ht("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ht("linux"),versionRegexes:[]},{name:"Solaris",search:ht("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ht("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:ht("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],oe={browsers:_(Pe),oses:_(mt)},vn=Ne=>{const je=Ne.current,Ot=Ne.version,Dt=pn=>()=>je===pn;return{current:je,version:Ot,isEdge:Dt("Edge"),isChromium:Dt("Chromium"),isIE:Dt("IE"),isOpera:Dt("Opera"),isFirefox:Dt("Firefox"),isSafari:Dt("Safari")}},bt=()=>vn({current:void 0,version:Ke.unknown()}),Et=vn,qt=Ne=>{const je=Ne.current,Ot=Ne.version,Dt=pn=>()=>je===pn;return{current:je,version:Ot,isWindows:Dt("Windows"),isiOS:Dt("iOS"),isAndroid:Dt("Android"),isMacOS:Dt("macOS"),isLinux:Dt("Linux"),isSolaris:Dt("Solaris"),isFreeBSD:Dt("FreeBSD"),isChromeOS:Dt("ChromeOS")}},xt=()=>qt({current:void 0,version:Ke.unknown()}),te=qt,ie=(Ne,je,Ot)=>{const Dt=oe.browsers(),pn=oe.oses(),yn=je.bind(Ge=>((Xe,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 de(Xe,jn=>{var Yn;return Dn===((Yn=jn.brand)===null||Yn===void 0?void 0:Yn.toLowerCase())}).map(jn=>({current:jn.name,version:Ke.nu(parseInt(nn.version,10),0)}))}))(Dt,Ge)).orThunk(()=>((Ge,Xe)=>$t(Ge,Xe).map(jt=>{const nn=Ke.detect(jt.versionRegexes,Xe);return{current:jt.name,version:nn}}))(Dt,Ne)).fold(bt,Et),Nt=((Ge,Xe)=>$t(Ge,Xe).map(jt=>{const nn=Ke.detect(jt.versionRegexes,Xe);return{current:jt.name,version:nn}}))(pn,Ne).fold(xt,te),St=((Ge,Xe,jt,nn)=>{const Dn=Ge.isiOS()&&/ipad/i.test(jt)===!0,jn=Ge.isiOS()&&!Dn,Yn=Ge.isiOS()||Ge.isAndroid(),Wn=Yn||nn("(pointer:coarse)"),go=Dn||!jn&&Yn&&nn("(min-device-width:768px)"),ko=jn||Yn&&!go,qo=Xe.isSafari()&&Ge.isiOS()&&/safari/i.test(jt)===!1,Ms=!ko&&!go&&!qo;return{isiPad:_(Dn),isiPhone:_(jn),isTablet:_(go),isPhone:_(ko),isTouch:_(Wn),isAndroid:Ge.isAndroid,isiOS:Ge.isiOS,isWebView:_(qo),isDesktop:_(Ms)}})(Nt,yn,Ne,Ot);return{browser:yn,os:Nt,deviceType:St}},ue=Ne=>window.matchMedia(Ne).matches;let K=(Ne=>{let je,Ot=!1;return(...Dt)=>(Ot||(Ot=!0,je=Ne.apply(null,Dt)),je)})(()=>ie(window.navigator.userAgent,I.from(window.navigator.userAgentData),ue));const we=()=>K(),Be=Ne=>{if(Ne==null)throw new Error("Node cannot be null or undefined");return{dom:Ne}},Re=Be,gt=(Ne,je)=>Ne.dom===je.dom,Ye=(Ne,je)=>{const Ot=Ne.dom;if(Ot.nodeType!==1)return!1;{const Dt=Ot;if(Dt.matches!==void 0)return Dt.matches(je);if(Dt.msMatchesSelector!==void 0)return Dt.msMatchesSelector(je);if(Dt.webkitMatchesSelector!==void 0)return Dt.webkitMatchesSelector(je);if(Dt.mozMatchesSelector!==void 0)return Dt.mozMatchesSelector(je);throw new Error("Browser lacks native selectors")}},yt=Ne=>je=>(Ot=>Ot.dom.nodeType)(je)===Ne,Pt=yt(1),bn=yt(3),kt=yt(11),Vt=Ne=>Re(Ne.dom.host),hn=(Ne,je,Ot)=>{((Dt,pn,yn)=>{if(!(i(yn)||m(yn)||S(yn)))throw console.error("Invalid call to Attribute.set. Key ",pn,":: Value ",yn,":: Element ",Dt),new Error("Attribute value was not simple");Dt.setAttribute(pn,yn+"")})(Ne.dom,je,Ot)},kn=(Ne,je)=>{const Ot=Ne.dom.getAttribute(je);return Ot===null?void 0:Ot},Eo=(Ne,je)=>{Ne.dom.removeAttribute(je)},to=Ne=>{const je=bn(Ne)?Ne.dom.parentNode:Ne.dom;if(je==null||je.ownerDocument===null)return!1;const Ot=je.ownerDocument;return(yn=>{const Nt=(Ge=>Re(Ge.dom.getRootNode()))(yn);return kt(St=Nt)&&b(St.dom.host)?I.some(Nt):I.none();var St})(Re(je)).fold(()=>Ot.body.contains(je),(Dt=to,pn=Vt,yn=>Dt(pn(yn))));var Dt,pn},Rt=(Ne,je)=>{const Ot=Ne.dom,Dt=window.getComputedStyle(Ot).getPropertyValue(je);return Dt!==""||to(Ne)?Dt:dn(Ot,je)},dn=(Ne,je)=>(Ot=>Ot.style!==void 0&&C(Ot.style.getPropertyValue))(Ne)?Ne.style.getPropertyValue(je):"",an=(Ne,je)=>{const Ot=kn(Ne,je);return Ot===void 0||Ot===""?[]:Ot.split(" ")},Bn=(Ne,je,Ot)=>{let Dt=Ne.dom;const pn=C(Ot)?Ot:O;for(;Dt.parentNode;){Dt=Dt.parentNode;const yn=Re(Dt);if(je(yn))return I.some(yn);if(pn(yn))break}return I.none()},_o=(Ne,je,Ot)=>((Dt,pn,yn,Nt,St)=>Nt(yn)?I.some(yn):C(St)&&St(yn)?I.none():pn(yn,Nt,St))(0,Bn,Ne,je,Ot),Do=Ne=>Ne.dom.classList!==void 0,ms=Ne=>an(Ne,"class"),Co=(Ne,je)=>{Do(Ne)?Ne.dom.classList.remove(je):((Ot,Dt)=>{((pn,yn,Nt)=>{const St=L(an(pn,yn),Ge=>Ge!==Nt);St.length>0?hn(pn,yn,St.join(" ")):Eo(pn,yn)})(Ot,"class",Dt)})(Ne,je),(Ot=>{(Do(Ot)?Ot.dom.classList:ms(Ot)).length===0&&Eo(Ot,"class")})(Ne)},Is=(Ne,je)=>{Ne.dispatch("FormatPainterToggle",{state:je})};var mn,Lo,js,Hs;(function(Ne){Ne.Retrival="Retrieval",Ne.Application="Application"})(mn||(mn={})),function(Ne){Ne.ListSchema="ListSchema",Ne.SubstitutionSchema="SubstitionSchema"}(Lo||(Lo={})),function(Ne){Ne.InsertUnorderedList="InsertUnorderedList",Ne.InsertOrderedList="InsertOrderedList",Ne.InsertDefinitionList="InsertDefinitionList"}(js||(js={})),function(Ne){Ne.Table="Table",Ne.Unspecified="Unspecified"}(Hs||(Hs={}));const Tr=Ne=>{var je,Ot;je=Re(Ne.getBody()),Ot="tox-cursor-format-painter",Do(je)?je.dom.classList.add(Ot):((Dt,pn)=>{((yn,Nt,St)=>{const Ge=an(yn,Nt).concat([St]);hn(yn,Nt,Ge.join(" "))})(Dt,"class",pn)})(je,Ot)},vr=(Ne,je)=>{(Ot=>{Co(Re(Ot.getBody()),"tox-cursor-format-painter")})(Ne),je.set(mn.Retrival),Is(Ne,!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=(Ne,je)=>ce(je,"selector").exists(Ot=>{const Dt=Ne.getBody(),pn=Ne.selection.getStart(),yn=Ne.dom.getParents(pn,R,Dt),Nt=Ne.selection.getSelectedBlocks();return Ne.dom.is([...yn,...Nt],Ot)}),Dr=Ne=>Ne.length>1&&Ne.charAt(0)==="%",ps=(Ne,je)=>ce(Ne,je).filter(Ot=>!u(Ot)),po=Ne=>Ye(Ne,"OL,UL,DL"),Ds=Ne=>Ye(Ne,"LI,DT,DD"),At=Ne=>Ne.replace(/([A-Z])/g,je=>`-${je[0].toLowerCase()}`),Zt=(Ne,je,Ot)=>{const Dt=Ne.formatter,pn=((Ge,Xe)=>q(Ge.formatter.get(Xe),jt=>((nn,Dn)=>zt(Dn,"inline")&&!br(nn,Dn))(Ge,jt)))(Ne,Ot.formatName),yn=((Ge,Xe,jt)=>q(Xe.get(jt),nn=>((Dn,jn)=>zt(jn,"block")||br(Dn,jn))(Ge,nn)))(Ne,Dt,Ot.formatName),Nt=(St=Ot.formatName,Q(["formatpainter_borderstyle","formatpainter_bordercolor","formatpainter_backgroundcolor"],St));var St;(je.table&&Nt||pn||je.block&&yn&&!Nt)&&Dt.apply(Ot.formatName,Ot.substitutedVariables)},Un=Ne=>{const je=Ne.selection,Ot=je.getRng(),Dt=Re(Ne.getBody()),pn=(St=>L(St.selection.getSelectedBlocks().map(Re),Ds))(Ne),yn=Ot.collapsed&&pn.length,Nt=pn.length&&!((St,Ge)=>{const Xe=jn=>gt(jn,Ge);return(jt=_o(Re(St.getStart()),po,Xe),nn=_o(Re(St.getEnd()),po,Xe),Dn=(jn,Yn)=>gt(jn,Yn),jt.isSome()&&nn.isSome()?I.some(Dn(jt.getOrDie(),nn.getOrDie())):I.none()).getOr(!1);var jt,nn,Dn})(je,Dt);return pn.length>1||yn||Nt},uo=Ne=>Ne.options.get("formatpainter_ignored_formats"),Fo=(Ne,je)=>{return je==="class"?(pn=>Do(pn)?(yn=>{const Nt=yn.dom.classList,St=new Array(Nt.length);for(let Ge=0;Ge<Nt.length;Ge++){const Xe=Nt.item(Ge);Xe!==null&&(St[Ge]=Xe)}return St})(pn):ms(pn))(Ne).filter(pn=>!/^(mce-.*)/.test(pn)).join(" "):(Ot=Ne,Dt=je,I.from(kn(Ot,Dt))).getOr("");var Ot,Dt},ss=Ne=>((je,Ot)=>{const Dt={},pn={};return((yn,Nt,St,Ge)=>{Fe(yn,(Xe,jt)=>{(Nt(Xe,jt)?St:Ge)(Xe,jt)})})(je,Ot,rt(Dt),rt(pn)),{t:Dt,f:pn}})(Ne,je=>{return(Ot=je).length>1&&Ot.charAt(0)==="%";var Ot}).t,ur=(Ne,je)=>(Ot=>{const Dt=uo(Ot);return Se(Ot.formatter.get()).filter(pn=>!Q(Dt,pn))})(Ne).filter(Ot=>{const Dt=((pn,yn)=>q(pn.formatter.get(yn),Nt=>(St=>{const Ge=ps(St,"styles").exists(jt=>q(De(jt),Dr)),Xe=ps(St,"attributes").exists(jt=>q(De(jt),Dr));return Ge||Xe})(Nt)))(Ne,Ot);return Ne.formatter.matchNode(je.dom,Ot,{},Dt)}),dr=(Ne,je)=>{const Ot=Z(Ne.dom.getParents(je,R),Re);return Ve(L(Ot,Pt),Dt=>Ve(ur(Ne,Dt),pn=>((yn,Nt,St)=>{return(Ge=yn.get(Nt),(Xe=>0<Xe.length?I.some(Xe[0]):I.none())(Ge)).bind(Xe=>((jt,nn)=>{const Dn=ps(jt,"styles").map(Wn=>{return go=nn,ko=ss(Wn),it(ko,(qo,Ms)=>({k:qo.slice(1,qo.length),v:Rt(go,At(Ms))}));var go,ko}),jn=ps(jt,"attributes").map(Wn=>{return go=nn,ko=ss(Wn),it(ko,(qo,Ms)=>({k:qo.slice(1,qo.length),v:Fo(go,Ms)}));var go,ko}),Yn={...Dn.getOr({}),...jn.getOr({})};return De(Yn).every(Wn=>Wn!=="")?I.some(Yn):I.none()})(Xe,St)).map(Xe=>({kind:Lo.SubstitutionSchema,formatName:Nt,substitutedVariables:Xe}));var Ge})(Ne.formatter,pn,Dt).toArray()))},or=Ne=>(je=>de(De(js),Ot=>je.queryCommandState(Ot)))(Ne).map(je=>({kind:Lo.ListSchema,command:je})),nt=(Ne,je)=>Ne.getParent(je,"TABLE")?Hs.Table:Hs.Unspecified,Qe=(Ne,je,Ot)=>{Ne.addCommand("mceToggleFormatPainter",()=>{((Dt,pn)=>{pn.get()===mn.Application?vr(Dt,pn):((yn,Nt)=>{const St=we(),Ge=he(!1);Tr(yn),Nt.set(mn.Application),Is(yn,!0),yn.execCommand("mceRetrieveFormats");const Xe=()=>{yn.execCommand("mcePaintFormats"),vr(yn,Nt)},jt=()=>{Nt.get()===mn.Application&&Xe(),Yn()},nn=Wn=>{Nt.get()===mn.Application&&(Wn.type==="touchcancel"&&St.os.isAndroid()?yn.once("contextmenu",Xe):Ge.get()?Xe():yn.once("selectionchange",Xe)),Yn()},Dn=Wn=>{Wn.keyCode===27&&(vr(yn,Nt),Yn())},jn=Wn=>{Ge.set(Wn.type==="touchmove")};yn.on("click",jt),yn.on("touchstart touchmove",jn),yn.on("touchend touchcancel",nn),yn.on("keydown",Dn);const Yn=()=>{yn.off("click",jt),yn.off("touchstart touchmove",jn),yn.off("touchend touchcancel",nn),yn.off("keydown",Dn)}})(Dt,pn)})(Ne,je)}),Ne.addCommand("mcePaintFormats",()=>{Ne.selection.isEditable()&&Ne.undoManager.transact(()=>{((Dt,pn)=>{((Nt,St)=>{Nt.formatter.remove("formatpainter_removeformat"),St===Hs.Table&&(Ge=>{for(let jt=0,nn=Ge.length;jt<nn;jt++)Xe=Ge[jt],Nt.formatter.remove(Xe);var Xe})(["formatpainter_borderstyle","formatpainter_bordercolor","formatpainter_backgroundcolor"]),Un(Nt)&&Nt.execCommand("RemoveList")})(Dt,pn.context);const yn=(Nt=>{const St=Nt.selection.getStart(),Ge=Nt.selection.getRng().collapsed,Xe=Nt.dom.select("td[data-mce-selected]").length>0,jt=!!Nt.dom.getParent(St,"TABLE");return{inline:!0,table:Ge&&jt||Xe,block:Ge||(nn=Nt.selection,nn.getSelectedBlocks().length>1)||Xe};var nn})(Dt);pn.schemas.forEach(Nt=>{switch(Nt.kind){case Lo.ListSchema:((St,Ge,Xe)=>{Xe.block&&St.execCommand(Ge.command)})(Dt,Nt,yn);break;case Lo.SubstitutionSchema:Zt(Dt,yn,Nt)}})})(Ne,Ot.get())})}),Ne.addCommand("mceRetrieveFormats",()=>{Ot.set((Dt=>{const pn=Dt.dom,yn=Dt.selection.getStart();return{schemas:[...or(Dt).toArray(),...dr(Dt,yn)],context:nt(pn,yn)}})(Ne))})};tinymce.PluginManager.add("formatpainter",Ne=>{if(((Dt,pn)=>!!Dt&&((yn,Nt)=>{const St=Ze(yn.major,Nt.major);if(St!==0)return St;const Ge=Ze(yn.minor,Nt.minor);if(Ge!==0)return Ge;const Xe=Ze(yn.patch,Nt.patch);return Xe!==0?Xe:0})((yn=>at((Nt=>[Nt.majorVersion,Nt.minorVersion].join(".").split(".").slice(0,3).join("."))(yn)))(Dt),at(pn))===-1)(tinymce,"6.0.0"))return void window.console.error("The format painter plugin requires at least version 6.0.0 of TinyMCE.");const je=he(mn.Retrival),Ot=he({schemas:[],context:Hs.Unspecified});(Dt=>{(0,Dt.options.register)("formatpainter_ignored_formats",{processor:"string[]",default:"link,address,removeformat,formatpainter_removeformat".split(",")})})(Ne),(Dt=>{Dt.on("PreInit",()=>{Fe(_s,(pn,yn)=>{Dt.formatter.get(yn)||Dt.formatter.register(yn,pn)})})})(Ne),Qe(Ne,je,Ot),(Dt=>{Dt.ui.registry.addToggleButton("formatpainter",{active:!1,icon:"format-painter",tooltip:"Format painter",onAction:()=>Dt.execCommand("mceToggleFormatPainter"),onSetup:pn=>{const yn=Nt=>{pn.setActive(Nt.state)};return Dt.on("FormatPainterToggle",yn),()=>Dt.off("FormatPainterToggle",yn)}})})(Ne),((Dt,pn)=>{Dt.ui.registry.addToggleMenuItem("formatpainter",{active:!1,icon:"format-painter",text:"Format painter",onAction:()=>Dt.execCommand("mceToggleFormatPainter"),onSetup:yn=>{const Nt=St=>{yn.setActive(St.state)};return yn.setActive(pn.get()===mn.Application),Dt.on("FormatPainterToggle",Nt),()=>Dt.off("FormatPainterToggle",Nt)}})})(Ne,je),(Dt=>{Dt.addShortcut("Meta+alt+C","",()=>{Dt.execCommand("mceRetrieveFormats")}),Dt.addShortcut("Meta+alt+V","",()=>{Dt.execCommand("mcePaintFormats")})})(Ne)})})();const Efe=["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"],r6e="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 ",_fe="file edit insert table tools help",a6e={menu:{pagesize:{title:"页面大小",items:o6e},orientation:{title:"页面方向",items:s6e}},menubar:_fe+" pagesize orientation",pagesize:"A4",orientation:"portrait",plugins:[...Efe,"pagesize"]},i6e={license_key:"gpl",skin:!1,content_css:["css/content.css","css/reset.css"],promotion:!1,menubar:_fe,cleanup:!0,branding:!1,language:"zh_CN",plugins:Efe,toolbar:r6e,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}`)})})},l6e={name:"ProEditor",components:{Editor:PMe},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(i6e),contentValue:o.modelValue,timeout:null});d.onMounted(()=>{Y6.init({license_key:"gpl"}),Y6.activeEditor.on("pagesizechange",b=>{(o==null?void 0:o.pagesize)!==b.size&&s("update:pagesize",b.size)}),Y6.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=>{!uB(b)&&b!==u.contentValue&&(u.contentValue=b)}),d.watch(()=>o.height,b=>{var C,S,_,N,O,R,I,W;i.value&&((W=(N=(_=(S=(C=i.value)==null?void 0:C.getEditor)==null?void 0:S.call(C))==null?void 0:_.dom)==null?void 0:N.setStyle)==null||W.call(N,(I=(R=(O=i.value)==null?void 0:O.getEditor)==null?void 0:R.call(O))==null?void 0:I.editorContainer,"height",b+"px"))});function m(b,C=400){u.timeout!==null&&clearTimeout(u.timeout),u.timeout=setTimeout(b,C)}function h(b){var O;o!=null&&o.height&&(b.height=o.height),o!=null&&o.width&&(b.width=o.width);const{placeholder:C,pagesize:S,orientation:_}=o,N=`${location==null?void 0:location.origin}/${uB(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?{...a6e,pagesize:S,orientation:_}:{}},b}return{...d.toRefs(u),editorRef:i,customer:h,debounce:m}}},c6e={class:"my-tinymce"};function u6e(o,s,i,u,m,h){const b=d.resolveComponent("Editor");return d.openBlock(),d.createElementBlock("div",c6e,[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 kfe=Ja(l6e,[["render",u6e]]),d6e={name:"ShadowDomWrap",setup(o,{emit:s,expose:i}){const u=d.ref(null),m=d.ref(),h=d.ref(!1),b=Ih(),C=_=>{if(_.target.closest(".context-menu")||!u.value)return;const O=u.value.contains(_.target);!O&&h.value?(h.value=!1,s("onBlur")):O&&!h.value&&(h.value=!0,s("onFocus"))},S=_=>{h.value=!0,s("onFocus"),_.stopPropagation()};return d.onMounted(()=>{var R,I,W,G,Q;m.value=(R=u.value)==null?void 0:R.attachShadow({mode:"open"}),document.addEventListener("click",C);const _=uB(window==null?void 0:window.zyuiAssetsPath)?"assets/":window==null?void 0:window.zyuiAssetsPath,N=document.createElement("link");N.rel="stylesheet",N.href=`${location==null?void 0:location.origin}/${_}css/index.min.css`,(I=m.value)==null||I.appendChild(N);const O=document.createElement("link");O.rel="stylesheet",O.href=`${location==null?void 0:location.origin}/${_}css/reset.css`,(W=m.value)==null||W.appendChild(O),(G=b==null?void 0:b.cssConfig)!=null&&G.links&&b.cssConfig.links.forEach(q=>{var L;const Z=document.createElement("link");Z.rel="stylesheet",Z.href=q,(L=m.value)==null||L.appendChild(Z)}),(Q=b==null?void 0:b.cssConfig)!=null&&Q.styles&&b.cssConfig.styles.forEach(q=>{var L;const Z=document.createElement("style");Z.textContent=q,(L=m.value)==null||L.appendChild(Z)})}),d.onUnmounted(()=>{document.removeEventListener("click",C)}),i({focus:()=>{h.value=!0}}),{shadowHost:u,shadowRoot:m,handleClick:S}}};function f6e(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 IB=Ja(d6e,[["render",f6e]]),m6e=["innerHTML"],Tfe=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(IB,null,{default:d.withCtx(()=>[d.createElementVNode("div",{innerHTML:s.value},null,8,m6e)]),_:1}))}}),Afe=Symbol("nodesUI"),ef=()=>{const o=d.inject(Afe);if(!o)throw new Error("NodesUI context not found");return o};function Moe(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.id){u=`#${CSS.escape(i.id)}`,s.unshift(u);break}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 p6e(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 Nfe(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(o)}catch(i){return console.error("nodePath query error:",i),null}}const jA=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}`:""),Ofe=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=Ofe(u);if(m){s=m;break}}return s},g6e=(o,s,i)=>{var u,m,h;if(!dB(o)){const b=i==null?void 0:i.getRootNode(),C=(u=b==null?void 0:b.getSelection)==null?void 0:u.call(b),S=Nfe(o.nodePath,i);if(C&&o.startOffset!==void 0&&s&&S){const _=document.createRange(),N=(o==null?void 0:o.textNodeIndex)||0,O=S.childNodes[N]||S;let R,I;if(O.nodeType===Node.TEXT_NODE)R=O,I=Math.min(o.startOffset,((m=O.textContent)==null?void 0:m.length)||0);else{const G=Ofe(O);G?(R=G,I=((h=G.textContent)==null?void 0:h.length)||0):(R=O,I=0)}_.setStart(R,I),_.setEnd(R,I);const W=document.createElement("span");W.classList.add("empty-text-node"),_.insertNode(W),_.insertNode(s),_.setStartAfter(s),_.collapse(!0),C.removeAllRanges(),C.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.parentNode;if(!s)return-1;let i=0;for(let u=0;u<s.childNodes.length;u++){const m=s.childNodes[u];if(m===o)return i;i++,m.nodeType===Node.ELEMENT_NODE&&(m.classList.contains("node-item")&&(i-=2,i<0&&(i=0)),m.classList.contains("empty-text-node")&&(i-=1,i<0&&(i=0)))}return-1},b6e=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=Moe(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},$fe=o=>Axe(o,s=>d.toValue(s.nodes).map(i=>({...i,color:s.color,activated:s==null?void 0:s.activated,dataGroupKey:s.id}))),Bz=(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})`},y6e=o=>{var _;const{element:s}=o;if(!s)return null;if(s.tagName.toLowerCase()!=="td")return{showTextType:"input"};const u=s.closest("tr"),m=Array.from(u.parentElement.children).indexOf(u),h=Array.from(u.children).indexOf(s),b=s.closest("table"),C=((_=s.closest("body"))==null?void 0:_.querySelectorAll("table"))||[];return{showTextType:"cell",tableIndex:Array.from(C).indexOf(b)+1,colIndex:h,rowIndex:m}},w6e=(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=y6e(C);return S?(S==null?void 0:S.showTextType)==="input"?{...C,...S,inputIndex:i++}:{...C,...S}:null}))==null?void 0:h.filter(Boolean):[]};function C6e(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 S6e(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 Dfe=(o,s)=>{var _;const i=w6e(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=$xe(m,"tableIndex"),b=Object.entries(h).map(([N,O])=>({tableIndex:Number(N),nodes:O})),C=pde(b==null?void 0:b.map(N=>C6e(N==null?void 0:N.nodes))),S=(C==null?void 0:C.map(N=>S6e(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}`:""},x6e=(o,s)=>{const i=Dfe(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(",")},dB=o=>o.startOffset===void 0&&o.textNodeIndex===void 0,E6e=o=>{var s;if(o.innerHTML==="&nbsp;"&&(o.innerHTML=""),((s=o.textContent)==null?void 0:s.trim())===""&&o.querySelector("p")){const i=o.querySelector("p");if(i){const u=O=>{const R={};return O&&O.split(";").forEach(I=>{const[W,G]=I.split(":").map(Q=>Q.trim());W&&G&&(R[W]=G)}),R},m=O=>Object.entries(O).map(([R,I])=>`${R}: ${I}`).join("; "),h=u(o.getAttribute("style")||""),b=u(i.getAttribute("style")||""),C=i.querySelectorAll("span");let S={};C.forEach(O=>{const R=u(O.getAttribute("style")||"");S={...S,...R}});const _={...h,...b,...S},N=m(_);N&&o.setAttribute("style",N),o.removeChild(i)}}},_6e=o=>{var i;return(i=ta(o))==null?void 0:i.map(u=>(u==null||delete u.element,u))},k6e=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")})},T6e={key:0,class:"td-node"},A6e={key:1},N6e=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",T6e,d.toDisplayString(i.value),1)):(d.openBlock(),d.createElementBlock("span",A6e,d.toDisplayString(i.value),1))}}),Mfe=Symbol("nodesEditor"),j0=()=>{const o=d.inject(Mfe);if(!o)throw new Error("NodesEditor context not found");return o},DU=d.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,{currentNodes:i}=ef(),{nodes:u,renderType:m,disabledNodes:h}=j0(),b=d.computed(()=>{var O;return(O=s.node)!=null&&O.id?u.value.some(R=>R.id===s.node.id):!1}),C=d.computed(()=>{var O;if(!((O=s.node)!=null&&O.element))return!1;try{return s.node.element.parentNode!==null}catch(R){return console.warn("Element validation failed:",R),!1}}),S=d.computed(()=>{var I,W;const O=(I=h==null?void 0:h.value)==null?void 0:I.some(G=>{var Q;return(G==null?void 0:G.id)===((Q=s==null?void 0:s.node)==null?void 0:Q.id)}),R=(W=d.toValue(i))==null?void 0:W.find(G=>{var Q;return(G==null?void 0:G.id)===((Q=s==null?void 0:s.node)==null?void 0:Q.id)});return{...s==null?void 0:s.node,...R,disabled:O}}),_=O=>{var I;let R="";if(d.toValue(O==null?void 0:O.activated)&&(R="normal"),O!=null&&O.disabled&&(R="disabled"),(I=s==null?void 0:s.node)!=null&&I.element)switch(R){case"normal":s.node.element.style.setProperty("--node-color",(O==null?void 0:O.color)||"#409eff"),s.node.element.style.setProperty("--node-bg-color",Bz((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",Bz((O==null?void 0:O.color)||"#F56C6C",.1)),s.node.element.setAttribute("data-dataGroupKey",O==null?void 0:O.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("disabled");break;default:N();break}},N=()=>{var O,R,I,W,G;(O=s==null?void 0:s.node)!=null&&O.element&&((R=s.node.element)==null||R.removeAttribute("data-dataGroupKey"),(I=s.node.element)==null||I.removeAttribute("selectable"),(W=s.node.element)==null||W.classList.remove("activated"),(G=s.node.element)==null||G.classList.remove("disabled"))};return d.watch(()=>S,()=>{const O=d.toValue(S);O!=null&&O.id?_(O):N()},{immediate:!0,deep:!0}),(O,R)=>{var I;return(I=O.node)!=null&&I.element&&C.value&&b.value?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:O.node.element},[d.createElementVNode("div",{class:d.normalizeClass(["node-item-render",`node-item-${d.unref(m)}`])},[d.renderSlot(O.$slots,"default",{node:O.node},()=>[d.createVNode(N6e,{node:O.node},null,8,["node"])])],2)],8,["to"])):d.createCommentVNode("",!0)}}});function O6e(){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 Bfe(){const{selectedNodes:o,setSelectedNodes:s,containerRef:i}=ef(),{editorId:u,nodes:m}=j0(),h=d.ref(!1),b=d.ref({x:0,y:0}),C=d.ref({x:0,y:0}),S=d.ref({left:0,top:0,width:0,height:0}),_=d.ref(null),N=Se=>{const J=Se.closest(".node-item-td")||Se.closest(".node-item");if(J!==null){let Fe=[];if(J.classList.contains("node-selected"))return;const it=J.getAttribute("id");if(it&&m.value){const rt=m.value.find(De=>De.id===it);rt&&(Fe=[rt])}Fe=Z(Fe),s(Fe)}},O=Se=>{var rt;if(Se.button===2&&N(Se==null?void 0:Se.target),Se.button!==0||(h.value=!0,!_.value))return;const J=(rt=i==null?void 0:i.value)==null?void 0:rt.getBoundingClientRect();if(!J)return;const Fe=Se.clientX-(J==null?void 0:J.left),it=Se.clientY-(J==null?void 0:J.top);b.value={x:Fe,y:it},C.value={x:Fe,y:it},Q(Se),L(),_.value.style.display="block",window.addEventListener("mousemove",R),window.addEventListener("wheel",I),window.addEventListener("mouseup",W)},R=dte(Se=>{var J;if(h.value){const Fe=(J=i==null?void 0:i.value)==null?void 0:J.getBoundingClientRect();if(!Fe)return;const it=Se.clientX-(Fe==null?void 0:Fe.left),rt=Se.clientY-(Fe==null?void 0:Fe.top);C.value={x:it,y:rt},L()}},16),I=dte(Se=>{h.value&&setTimeout(()=>{var rt;const J=(rt=i==null?void 0:i.value)==null?void 0:rt.getBoundingClientRect();if(!J)return;const Fe=Se.clientX-(J==null?void 0:J.left),it=Se.clientY-(J==null?void 0:J.top);C.value={x:Fe,y:it},L()},0)},16),W=Se=>{Se.button===0&&(h.value=!1,_.value&&(L(),_.value.style.display="none",window.removeEventListener("mousemove",R),window.removeEventListener("wheel",I),window.removeEventListener("mouseup",W)))},G=O6e(),Q=Se=>{var Fe,it;let J=[];if(Se.button===0&&(Se!=null&&Se.target)){const rt=((Fe=Se==null?void 0:Se.target)==null?void 0:Fe.closest(".node-item-td"))||((it=Se==null?void 0:Se.target)==null?void 0:it.closest(".node-item"));if(rt!==null){const De=rt.getAttribute("id");if(De&&m.value){const ce=m.value.find(zt=>zt.id===De);ce&&(G.value?o.value.some(zt=>jA(zt)===jA(ce))?J=o.value.filter(he=>jA(he)!==jA(ce)):J=[...o.value,ce]:ce&&(J=[ce]))}}J=Z(J),s(J)}},q=()=>{var ce;if(!i.value||!(S.value.width>3||S.value.height>3))return;let Se=[];const J=(ce=i==null?void 0:i.value)==null?void 0:ce.getBoundingClientRect(),Fe=S.value.left+(J==null?void 0:J.left),it=S.value.top+(J==null?void 0:J.top),rt={left:S.value.left+(J==null?void 0:J.left),right:Fe+S.value.width,top:S.value.top+(J==null?void 0:J.top),bottom:it+S.value.height};if(i.value.querySelectorAll("*").forEach(zt=>{const he=zt.getBoundingClientRect();if(!rt)return;const Ee={left:he.left,right:he.right,top:he.top,bottom:he.bottom};if(Ee.right>rt.left&&Ee.left<rt.right&&Ee.bottom>rt.top&&Ee.top<rt.bottom){const M=zt.getAttribute("id");if(M&&m.value){const Ze=m.value.find(ye=>ye.id===M);Ze&&(Se=[...Se,Ze])}}}),Se=Z(Se),G.value){const zt=new Set(o.value.map(Ee=>jA(Ee))),he=Se.filter(Ee=>!zt.has(jA(Ee)));s([...o.value,...he])}else s(Se)},Z=Se=>Se,L=dte(()=>{if(!_.value||!i.value)return;const{x:Se,y:J}=b.value,{x:Fe,y:it}=C.value,rt=Math.min(Se,Fe),De=Math.min(J,it),ce=Math.abs(Se-Fe),zt=Math.abs(J-it);S.value={left:rt,top:De,width:ce,height:zt}},16),de=Se=>{if(!_.value)return;const{left:J,top:Fe,width:it,height:rt}=d.toValue(Se);_.value.style.left=`${J}px`,_.value.style.top=`${Fe}px`,_.value.style.width=`${it}px`,_.value.style.height=`${rt}px`},Ve=()=>{if(!i.value)return;i.value.addEventListener("mousedown",O);const Se=document.getElementById(`select_area_${u}`);if(Se){_.value=Se;return}const J=document.createElement("div");J.id=`select_area_${u}`,J.style.position="absolute",J.style.border="1px solid #1677ff",J.style.backgroundColor="rgba(22, 119, 255, 0.05)",J.style.pointerEvents="none",J.style.display="none",i.value.appendChild(J),_.value=J};return d.watch(S,(Se,J)=>{ua(Se,J)||(de(Se),h.value&&q())},{deep:!0}),d.watch(()=>i.value,Se=>{d.toValue(Se)&&Ve()},{immediate:!0}),d.onUnmounted(()=>{i.value&&i.value.removeEventListener("mousedown",O)}),{isSelecting:h,selectionBox:_}}function Boe(){const{selectedNodes:o,containerRef:s}=ef(),i=()=>{var m;(m=d.toValue(s))==null||m.querySelectorAll(".node-selected").forEach(h=>{h.classList.remove("node-selected")})},u=m=>{m.forEach(h=>{h.classList.add("node-selected")})};d.watch(()=>o,()=>{i(),setTimeout(()=>{var h,b;const m=(b=(h=d.toValue(o))==null?void 0:h.map(C=>{var S;return(S=s.value)==null?void 0:S.querySelector(`[id="${C.id}"]`)}))==null?void 0:b.filter(Boolean);u(m)},0)},{deep:!0})}const PB=()=>{const{nodes:o,updateNodes:s,inputTypes:i}=j0();return{nodes:o,addNode:S=>{const N=(Array.isArray(S)?S:[S]).map(R=>({...R,id:R.id||m2()})),O=[...o.value,...N];s(O)},removeNode:async S=>{var W,G;const _=Array.isArray(S)?S:[S],N=[],O=[];_.forEach(Q=>{const q=o.value.find(Z=>(Z==null?void 0:Z.id)===Q);dB(q)?N.push(Q):O.push(Q)});const R=await((G=(W=i==null?void 0:i.find(Q=>{var q;return((q=Q.value)==null?void 0:q.toLowerCase())==="text"}))==null?void 0:W.getDefaultProps)==null?void 0:G.call(W))||{};let I=o.value.filter(Q=>!O.includes(Q==null?void 0:Q.id));I=I==null?void 0:I.map(Q=>N.includes(Q==null?void 0:Q.id)?{id:Q==null?void 0:Q.id,nodePath:Q==null?void 0:Q.nodePath,label:"文本",nodeType:"text",props:{...R}}:Q),s(I)},editNodes:S=>{const _=Array.isArray(S)?S:[S],N=m2(),O=_.map(I=>{const W={...I};let G=I==null?void 0:I.id;return G||(G=m2(),W.id=G),W!=null&&W.groupKey||(W.groupKey=N),W}),R=[...o.value];O.forEach(I=>{const W=R.findIndex(G=>G.id===I.id);W!==-1?R[W]=I:R.push(I)}),s(R)},insertNodeAt:(S,_)=>{const N=[...o.value];N.splice(_,0,S),s(N)},moveNode:(S,_)=>{const N=[...o.value],[O]=N.splice(S,1);N.splice(_,0,O),s(N)},updateNodes:s}};function $6e(){const{removeNode:o}=PB(),{containerRef:s}=ef(),i=d.ref(null),u=h=>{var G,Q;if(h.target instanceof Element&&(h.target.closest(".node-item")||h.target.closest(".node-item-td")||h.target.closest(".disabeld-edit")))return;const b=h.target;if(b===s.value)return;const S=((G=s.value)==null?void 0:G.getRootNode()).getSelection(),_=(Q=s.value)==null?void 0:Q.querySelectorAll('[contenteditable="true"]');_==null||_.forEach(q=>{q.setAttribute("contenteditable","false")});const N=b.textContent||"",O=b.innerHTML||"";i.value=b,b.setAttribute("contenteditable","true"),b.focus();const R=new MutationObserver(()=>{b.textContent!==N&&(b.innerHTML=O)});R.observe(b,{characterData:!0,childList:!0,subtree:!0});const I=q=>{q.preventDefault()};b.addEventListener("input",I),b.addEventListener("paste",I),b.addEventListener("drop",I),b.addEventListener("keydown",q=>{var Z,L,de,Ve;if(((Z=document.activeElement)==null?void 0:Z.shadowRoot)===((L=s.value)==null?void 0:L.getRootNode())&&!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(q.key)){if(q.key==="Backspace"||q.key==="Delete"){const Se=S==null?void 0:S.getRangeAt(0);if(b.blur(),(Se==null?void 0:Se.startOffset)===0){const J=Se.startContainer;if(J.nodeType===Node.TEXT_NODE){const Fe=J.previousSibling;if(Fe&&Fe.nodeType===Node.ELEMENT_NODE&&Fe.classList.contains("node-item")){const it=Fe.getAttribute("id");it&&o(it),(de=J.parentElement)==null||de.normalize();return}}else if(J.nodeType===Node.ELEMENT_NODE){const Fe=J.previousSibling;if(Fe&&Fe.nodeType===Node.ELEMENT_NODE&&Fe.classList.contains("node-item")){const it=Fe.getAttribute("id");it&&o(it),(Ve=J.parentElement)==null||Ve.normalize();return}}}}q.preventDefault()}});const W=()=>{b==null||b.normalize(),R.disconnect(),b.removeEventListener("input",I),b.removeEventListener("paste",I),b.removeEventListener("drop",I),b.removeEventListener("blur",W),b.setAttribute("contenteditable","false")};b.addEventListener("blur",W)},m=()=>{var h;(h=s.value)==null||h.addEventListener("dblclick",u)};return d.watch(s,h=>{h&&m()},{immediate:!0}),d.onUnmounted(()=>{var h;(h=s.value)==null||h.removeEventListener("dblclick",u)}),{}}function D6e(){const{containerRef:o,focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}=ef(),h=_=>{var O,R;const N=_==null?void 0:_.getSelection();try{if((O=s.value)==null||O.normalize(),N){const I=N.getRangeAt(0);u.value=v6e(I.startContainer);const W=I.startOffset,G=(R=s.value)==null?void 0:R.querySelectorAll(".node-item");let Q=0;return m.value=0,G==null||G.forEach(q=>{const Z=document.createRange();if(Z.selectNode(q),Z.comparePoint(I.startContainer,W)>=0){m.value+=1;const L=q.getAttribute("data-startOffset");Number(L)>Q&&(Q=Number(L))}}),Q+W}}catch{}return 0},b=()=>{var N;const _=(N=o.value)==null?void 0:N.getRootNode();i.value=h(_)},C=_=>{var I;const N=_.target;if(N===o.value)return;s.value=N;const O=(I=o.value)==null?void 0:I.getRootNode();i.value=h(O),N.addEventListener("click",b),N.addEventListener("keyup",W=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(W.key)&&b()});const R=()=>{N.removeEventListener("click",b),N.removeEventListener("keyup",b),N.removeEventListener("blur",R),setTimeout(()=>{s.value=null,u.value=0,i.value=-1},300)};N.addEventListener("blur",R)},S=()=>{var _;(_=o.value)==null||_.addEventListener("focus",C,!0)};return d.watch(o,_=>{_&&S()},{immediate:!0}),d.onUnmounted(()=>{var _;(_=o.value)==null||_.removeEventListener("focus",C,!0)}),{focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}}function M6e(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}}function B6e(){const{modelValue:o,inputTypes:s}=j0(),{nodes:i,updateNodes:u}=PB(),m=b=>{if(!b||typeof b!="string")return[];const S=new DOMParser().parseFromString(b,"text/html");return Array.from(S.querySelectorAll("td")).filter(O=>{var R;return!((R=O.textContent)!=null&&R.trim())})},h=async b=>{var _,N;const C=await((N=(_=s==null?void 0:s.find(O=>{var R;return((R=O.value)==null?void 0:R.toLowerCase())==="text"}))==null?void 0:_.getDefaultProps)==null?void 0:N.call(_))||{},S=b.map(O=>{let R=O==null?void 0:O.id;return R||(R=m2()),{id:R,nodeType:"Text",label:"文本",props:{...C},...O}});u(S)};d.onMounted(()=>{var R;const b=m(d.toValue(o)),C=d.toValue(i),S=C.filter(I=>dB(I)),_=C.filter(I=>!dB(I)),O=[...(R=b.map(I=>({nodePath:Moe(I)})))==null?void 0:R.map(I=>{const W=S==null?void 0:S.find(G=>G.nodePath===I.nodePath);return{...I,...W}}),..._];h(O)})}function R6e(){const{selectedNodes:o,containerRef:s,isFocused:i}=ef(),{removeNode:u}=PB(),m=d.ref(null),h=S=>{if(i.value&&(S.key==="Delete"||S.key==="Backspace")){const _=[];d.toValue(o).length>0&&(d.toValue(o).forEach(N=>{var O,R,I;if(((O=N==null?void 0:N.element)==null?void 0:O.tagName)==="TD"){const W=(R=N==null?void 0:N.element)==null?void 0:R.getAttribute("id");W&&_.push(W)}else{const W=(I=N==null?void 0:N.element)==null?void 0:I.getAttribute("id");W&&_.push(W)}}),o.value=[],(_==null?void 0:_.length)>0&&u(_))}},b=S=>{var _;(_=d.toValue(s))!=null&&_.contains(S.target)?m.value=S.target:m.value=null},C=()=>{s.value&&(window.addEventListener("keydown",h),s.value.addEventListener("mousedown",b))};d.watch(()=>s.value,S=>{d.toValue(S)&&C()},{immediate:!0}),d.onUnmounted(()=>{s.value&&(window.removeEventListener("keydown",h),s.value.removeEventListener("mousedown",b))})}function MU(){const{nodes:o}=j0(),{containerRef:s,renderNodes:i,uiReady:u}=ef(),{removeNode:m}=PB(),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=kxe(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 wne=d.ref({});function BU(o){return d.computed(()=>{var s;return(s=wne.value)==null?void 0:s[o]})}function Roe(){const o=j0(),s=ef();d.onMounted(()=>{const{editorId:i}=o;i&&(wne.value[i]=d.ref({...o,...s}))}),d.onUnmounted(()=>{const{editorId:i}=o;i&&(wne.value[i]=null)})}const I6e=d.defineComponent({__name:"NodesEditUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"edit"}},setup(o){const{nodes:s}=j0(),{uiReady:i,renderNodes:u}=ef();return Roe(),M6e(s),Bfe(),Boe(),R6e(),D6e(),$6e(),B6e(),MU(),(m,h)=>d.unref(i)?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(u),b=>(d.openBlock(),d.createBlock(DU,{key:b==null?void 0:b.id,node:b},{default:d.withCtx(C=>[d.renderSlot(m.$slots,"nodeItem",{node:C==null?void 0:C.node})]),_:2},1032,["node"]))),128)):d.createCommentVNode("",!0)}}),lle=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)}}),P6e=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)}}),F6e=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(),Bfe(),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 L6e(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 V6e=d.defineComponent({__name:"NodesProvider",props:d.mergeModels({modelValue:{type:String,default:""},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:{}}),emits:["update:formData","update:nodes"],setup(o){const s=o,i=d.useModel(o,"formData"),u=d.useModel(o,"nodes"),m=d.computed(()=>s.modelValue),h=Rfe(s==null?void 0:s.editorId),b=d.computed(()=>{var O,R,I;const N=[...$fe(((I=(R=(O=d.toValue(h))==null?void 0:O.filter(W=>d.toValue(W==null?void 0:W.activated)))==null?void 0:R.filter(W=>d.toValue(W.isMounted)))==null?void 0:I.filter(W=>d.toValue(W==null?void 0:W.isOccupy)))||[]),...s.disabledNodes||[]];return qxe(N,"id")}),C=d.computed(()=>d.toValue(s.renderType)),S=_=>{ua(u.value,_)||(u.value=_)};return d.provide(Mfe,{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")}}),H6e=d.defineComponent({__name:"NodesUIProvider",props:{nodes:{type:Array,default:()=>[]},selectedNodes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},editorId:{type:String,default:""},htmlRenderRef:{type:Object,default:()=>{}}},emits:["onSelectedNodes","update:selectedNodes"],setup(o,{expose:s,emit:i}){const u=o,m=i,h=d.ref(null),b=d.ref(null),C=d.ref([]),S=d.ref(null),_=d.ref(-1),N=d.ref(0),O=d.ref(0),R=Rfe(u==null?void 0:u.editorId),I=d.ref(!1),W=d.ref(!1),G=d.computed(()=>u.htmlRenderRef),Q=d.computed({get:()=>(u.selectedNodes||[]).map(Ve=>{var Fe;let Se=(Fe=u==null?void 0:u.nodes)==null?void 0:Fe.find(it=>(it==null?void 0:it.id)===(Ve==null?void 0:Ve.id)),J=Ve!=null&&Ve.element?Ve==null?void 0:Ve.element:p6e(Ve==null?void 0:Ve.id,h.value);return{...Se||{},...Ve,element:J}}),set:Ve=>{const Se=Ve.map(({element:J,...Fe})=>{var rt;return{...((rt=u==null?void 0:u.nodes)==null?void 0:rt.find(De=>(De==null?void 0:De.id)===(Fe==null?void 0:Fe.id)))||{},...Fe}});m("update:selectedNodes",Se)}}),q=d.computed(()=>{var J,Fe,it;const Ve=(Fe=(J=d.toValue(R))==null?void 0:J.filter(rt=>d.toValue(rt==null?void 0:rt.activated)))==null?void 0:Fe.filter(rt=>d.toValue(rt.isMounted)),Se=((it=d.toValue(u==null?void 0:u.nodesGroups)||[])==null?void 0:it.map(rt=>({...rt||{},activated:!0})))||[];return $fe([...Se,...Ve])}),Z=d.ref([]),L=Ve=>{var Fe;const Se=Ve.map(({...it})=>{var zt;let rt=(zt=C.value)==null?void 0:zt.find(he=>(he==null?void 0:he.id)===(it==null?void 0:it.id));const{element:De,...ce}={...rt||{},...it};return ce}),J=(Fe=Q.value)==null?void 0:Fe.map(({element:it,...rt})=>rt);ua(Se,J)||(Q.value=Se,m("onSelectedNodes",Se))},de=d.computed(()=>d.toValue(u==null?void 0:u.nodesGroups));return s({setSelectedNodes:L}),d.provide(Afe,{containerRef:h,htmlRenderRef:G,contextMenuRef:b,focusedElement:S,currentRenderNodes:Z,cursorPosition:_,focusedNodeIndex:N,preNodeNumber:O,currentNodes:q,selectedNodes:Q,setSelectedNodes:L,renderNodes:C,uiReady:I,isFocused:W,nodesGroups:de}),(Ve,Se)=>d.renderSlot(Ve.$slots,"default")}}),z6e=["onClick"],U6e={key:0,class:"icon"},j6e={key:1,class:"arrow"},W6e=["onClick"],Z6e={key:0,class:"icon"},G6e=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};d.watch(()=>[O,i==null?void 0:i.style],()=>{d.toValue(O)&&(R.value=!1),setTimeout(()=>{R.value=!!d.toValue(O)},0)},{immediate:!0,deep:!0});const{editNodes:W}=PB(),G=async L=>{var de,Ve;if(d.toValue(b)&&!Rxe(d.toValue(C))){const Se=Moe(d.toValue(b)),J=d.toValue(C),Fe=(d.toValue(_)||0)+1,it=b6e(d.toValue(b));if(Se&&!uB(J)&&J>=0){const rt=await((de=L==null?void 0:L.getDefaultProps)==null?void 0:de.call(L))||{};W({...it,label:L==null?void 0:L.label,nodePath:Se,startOffset:J,subNodeSort:Fe,textNodeIndex:d.toValue(S)||0,nodeType:L==null?void 0:L.value,props:rt})}}else if(m){const Se=d.toValue(m);if(Se!=null&&Se.length){const J=await((Ve=L==null?void 0:L.getDefaultProps)==null?void 0:Ve.call(L))||{},Fe=Se==null?void 0:Se.map(it=>({...it,label:L==null?void 0:L.label,element:it==null?void 0:it.element,nodePath:it==null?void 0:it.nodePath,nodeType:L==null?void 0:L.value,props:J}));W(Fe),h(Fe)}}O.value=!1},Q=d.computed(()=>{const L=[],de=[];return d.toValue(N).forEach(Ve=>{Ve.groupName==="system"?de.push({...Ve,handler:()=>{G(Ve)}}):L.push({...Ve,handler:()=>{G(Ve)}})}),[{label:"限定填写内容",icon:"i-bi:lock",children:L},{label:"插入记录标识",icon:"i-bi:flag",children:de}].filter(Ve=>{var Se;return(Se=Ve==null?void 0:Ve.children)==null?void 0:Se.length})}),q=s,Z=(L,de)=>{L.preventDefault(),de!=null&&de.handler&&de.handler(),de!=null&&de.value&&q("select",de==null?void 0:de.value)};return(L,de)=>(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({...L.style}),ref_key:"contextMenuRef",ref:u},null,4),[[d.unref(On.ClickOutside),I]])]),default:d.withCtx(()=>[d.createElementVNode("div",{ref_key:"contextMenuRef",ref:u},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(Q.value,Ve=>(d.openBlock(),d.createElementBlock("div",{key:Ve==null?void 0:Ve.label,class:"menu-item"},[d.createElementVNode("div",{class:"menu-item-content",onClick:Se=>Z(Se,Ve)},[Ve!=null&&Ve.icon?(d.openBlock(),d.createElementBlock("div",U6e,[d.createElementVNode("div",{class:d.normalizeClass(Ve==null?void 0:Ve.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(Ve.label)+" ",1),Ve!=null&&Ve.children?(d.openBlock(),d.createElementBlock("span",j6e,"›")):d.createCommentVNode("",!0)],8,z6e),Ve!=null&&Ve.children?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["submenu",{"submenu-bottom":L.direction==="bottom"}])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(Ve.children,Se=>(d.openBlock(),d.createElementBlock("div",{key:Se.action,class:"menu-item",onClick:J=>Z(J,Se)},[Se!=null&&Se.icon?(d.openBlock(),d.createElementBlock("div",Z6e,[d.createElementVNode("div",{class:d.normalizeClass(Se==null?void 0:Se.icon)},null,2)])):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(Se.label),1)],8,W6e))),128))],2)):d.createCommentVNode("",!0)]))),128))],512)]),_:1},8,["visible"]))}}),q6e=Ja(G6e,[["__scopeId","data-v-a6be18aa"]]);function Y6e(o){const{headerHeight:s,hasContextMenu:i}=o,{contextMenuRef:u}=ef(),m=d.ref(!1),h=d.ref("top"),b=d.ref({left:"0px",top:"0px"}),C=_=>{d.toValue(i)&&(_.preventDefault(),m.value=!0,d.nextTick(()=>{const O=_.currentTarget.getBoundingClientRect(),R=_.clientX-O.left,I=_.clientY-O.top,W=u==null?void 0:u.value,G=Array.from((W==null?void 0:W.querySelectorAll(".submenu"))||[]).reduce((Q,q)=>Math.max(Q,q.offsetHeight||0),0)||400;O.height-I<G?h.value="bottom":h.value="top",b.value={left:`${R}px`,top:`${I+d.toValue(s)}px`}}))},S=_=>{const N=document.querySelector(".context-menu");N&&!N.contains(_.target)&&(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 Cne=Ife(),Pfe=(...o)=>{const s=o[0],i=o[1];d.onMounted(()=>{Cne.on(s,i)}),d.onBeforeUnmount(()=>{Cne.off(s)})},Ioe=()=>(...s)=>{Cne.emit(...s)};let rE=null;function K6e(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 Rz={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}},X6e={class:"relative"},J6e={class:"header-container"},Q6e=["innerHTML"],eBe={style:{overflow:"hidden"}},tBe=["innerHTML"],nBe=d.defineComponent({__name:"index",props:{headerHtml:{type:String,default:""},footerHtml:{type:String,default:""},pagesize:{type:String,default:"A4"}},emits:["onUiReady"],setup(o,{expose:s,emit:i}){const u=d.ref(),{containerRef:m,uiReady:h,isFocused:b}=ef(),{nodes:C,modelValue:S,renderType:_}=j0(),N=d.computed(()=>d.toValue(_)==="edit"),O=o,R=i,I=()=>{R("onUiReady",{containerRef:m})},{height:W}=pMe(u),G=d.computed(()=>O.headerHtml?O.headerHtml.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(he,Ee,M)=>{const Ze=M.replace(/([^{}]+)\{/g,(ye,at)=>{const st=at.trim();return st&&!st.includes(".header-container")?`.header-container ${st} {`:ye});return`<style${Ee}>${Ze}</style>`}):""),Q=d.computed(()=>{const he=Rz[O.pagesize]||Rz.A4,Ee=(window.devicePixelRatio||1)*96;return`${he.height*Ee/25.4-d.toValue(W)}px`}),{showContextMenu:q,contextMenuStyle:Z,onContextMenu:L,direction:de}=Y6e({headerHeight:W,hasContextMenu:N}),Ve=d.ref(null),Se=he=>{let Ee=null;if(dB(he))Ee=Nfe(he.nodePath,d.toValue(m)),Ee&&(Ee.classList.add("node-item-td"),Ee.setAttribute("contenteditable","false"),E6e(Ee));else{const M=document.createElement("span");M.setAttribute("contenteditable","false"),M.classList.add("node-item"),Ee=M,g6e(he,Ee,m.value)}return Ee&&h6e(Ee,he),Ee},J=()=>{const he=Hxe(C.value,[Ee=>Ee.nodePath,Ee=>Ee.textNodeIndex,Ee=>Ee.startOffset??-1,Ee=>Ee.subNodeSort],["asc","desc","desc","desc"]);he==null||he.forEach(Ee=>{Se(Ee)})},Fe=()=>{Ve.value&&(h.value=!1,d.nextTick(()=>{Ve.value&&(Ve.value.innerHTML=d.toValue(S),J(),h.value=!0,d.nextTick(()=>{I(),setTimeout(()=>{d.toValue(m)&&k6e(d.toValue(m))},10)}))}))},it=d.computed(()=>{var he;return(he=d.toValue(C))==null?void 0:he.map(Ee=>{const{nodePath:M,id:Ze,nodeType:ye}=Ee;return{nodePath:M,id:Ze,nodeType:ye}})});d.watch(()=>[S,Ve],()=>{Fe()},{deep:!0,immediate:!0}),d.watch(()=>[...it.value],(he,Ee)=>{ua(Ee,he)||Fe()},{deep:!0,immediate:!0});const rt=d.ref(),De=()=>{b.value=!0},{onBlur:ce}=K6e(),zt=()=>{b.value=!1,ce()};return s({renderHtml:Fe}),(he,Ee)=>(d.openBlock(),d.createElementBlock("div",X6e,[d.createVNode(IB,{onOnBlur:zt,onOnFocus:De,ref_key:"shadowDomRef",ref:rt},{default:d.withCtx(()=>[d.createElementVNode("div",{ref_key:"headerRef",ref:u,style:{overflow:"hidden"}},[d.createElementVNode("div",J6e,[d.createElementVNode("div",{innerHTML:G.value,class:"disabeld-edit docHeaderHtml",onClick:De},null,8,Q6e)])],512),d.createElementVNode("html",{class:d.normalizeClass(["nodes-editor",`nodes-editor-${d.unref(_)}`]),ref_key:"containerRef",ref:m,style:d.normalizeStyle([{position:"relative"},{position:"relative",minHeight:Q.value}]),onContextmenu:Ee[0]||(Ee[0]=d.withModifiers((...M)=>d.unref(L)&&d.unref(L)(...M),["prevent"]))},[d.createElementVNode("body",{ref_key:"bodyRef",ref:Ve},null,512),d.createElementVNode("div",eBe,[d.createElementVNode("div",{innerHTML:O==null?void 0:O.footerHtml,class:"disabeld-edit docFooterHtml",onClick:De},null,8,tBe)])],38)]),_:1},512),N.value?(d.openBlock(),d.createBlock(q6e,{key:0,show:d.unref(q),"onUpdate:show":Ee[1]||(Ee[1]=M=>d.isRef(q)?q.value=M:null),style:d.normalizeStyle(d.unref(Z)),direction:d.unref(de)},null,8,["show","style","direction"])):d.createCommentVNode("",!0)]))}}),oBe={class:"pagesize"},sBe=d.defineComponent({__name:"index",props:{pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},style:{type:Object,default:()=>({})}},setup(o){const s=o,i=d.computed(()=>{const u=Rz[s.pagesize]||Rz.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",oBe,[d.createElementVNode("div",{style:d.normalizeStyle({width:`${i.value}px`,...o.style}),class:"pagesize-content"},[d.renderSlot(u.$slots,"default",{},void 0,!0)],4)]))}}),rBe=Ja(sBe,[["__scopeId","data-v-44e34db1"]]),Ffe=d.defineComponent({__name:"index",props:d.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},pagesize:{type:String,default:"A4"},orientation:{type:String,default:"portrait"},renderType:{type:String,default:"preview"},formData:{type:Object,default:()=>({})},inputTypes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},id:{type:String,default:""},disabledNodes:{type:Array,default:()=>[]},headerHtml:{type:String,default:""},footerHtml:{type:String,default:""},pagesizeStyle:{type:Object,default:()=>({})}},{selectedNodes:{default:[]},selectedNodesModifiers:{}}),emits:d.mergeModels(["update: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=G=>{m("onUiReady",G)},_=d.ref(),N=d.computed(()=>d.toValue(u.renderType)),O=d.computed(()=>{switch(d.toValue(N)){case"edit":return I6e;case"select":return F6e;case"preview":return lle;case"enter":return P6e;default:return lle}}),R=G=>{m("update:nodes",G)},I=G=>{m("update:formData",G)},W=G=>{m("onSelectedNodes",G)};return s({formRef:{validate:()=>{var G,Q,q;return(q=(Q=(G=b.value)==null?void 0:G.formRef)==null?void 0:Q.validate)==null?void 0:q.call(Q)}},setSelectedNodes:G=>{var Q,q;(q=(Q=_.value)==null?void 0:Q.setSelectedNodes)==null||q.call(Q,G)}}),(G,Q)=>(d.openBlock(),d.createBlock(rBe,{pagesize:o.pagesize,orientation:u==null?void 0:u.orientation,style:d.normalizeStyle(o.pagesizeStyle)},{default:d.withCtx(()=>[d.createVNode(H6e,{ref_key:"UIRef",ref:_,nodes:o.nodes,"onUpdate:nodes":R,selectedNodes:h.value,"onUpdate:selectedNodes":Q[0]||(Q[0]=q=>h.value=q),onOnSelectedNodes:W,nodesGroups:o.nodesGroups,editorId:u==null?void 0:u.id,htmlRenderRef:C.value},{default:d.withCtx(()=>[d.createVNode(V6e,{renderType:N.value,"model-value":o.modelValue,nodes:o.nodes,"onUpdate:nodes":R,formData:o.formData,"onUpdate:formData":I,inputTypes:o.inputTypes,editorId:u==null?void 0:u.id,disabledNodes:o.disabledNodes},{default:d.withCtx(()=>[d.createVNode(nBe,{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(q=>[d.renderSlot(G.$slots,"nodeItem",{node:q==null?void 0:q.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"]))}}),aBe={class:"nodes-text"},iBe={key:0,class:"node-text-input"},lBe={key:1,class:"node-text-td"},cBe={key:0,class:"node-text-table-index"},uBe=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 Dfe(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",aBe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(m.value,(S,_)=>{var N,O,R,I,W,G,Q,q,Z;return d.openBlock(),d.createElementBlock("div",{key:_,class:"node-text-item"},[(S==null?void 0:S.showTextType)==="input"?(d.openBlock(),d.createElementBlock("span",iBe,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",lBe,[h.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("span",cBe,d.toDisplayString(`表${(R=S==null?void 0:S.min)==null?void 0:R.tableIndex}.`),1)),d.createTextVNode(" "+d.toDisplayString(((I=S==null?void 0:S.min)==null?void 0:I.id)===((W=S==null?void 0:S.max)==null?void 0:W.id)?(Q=(G=S==null?void 0:S.min)==null?void 0:G.props)!=null&&Q.alias?(Z=(q=S==null?void 0:S.min)==null?void 0:q.props)==null?void 0:Z.alias:d.unref(r4)(S==null?void 0:S.min):`${d.unref(r4)(S==null?void 0:S.min)}:${d.unref(r4)(S==null?void 0:S.max)}`),1)]))])}),128))]))}}),cle=Ja(uBe,[["__scopeId","data-v-73a2b2dc"]]);function Poe(o){const{nodes:s,mode:i="multiple"}=o,u=d.ref(!1),m=Ioe();return{isSelecting:u,selectNodes:()=>{if(u.value)return!1;u.value=!0,m("selectNodes",{data:ta(d.toValue(s)),mode:i,callback:({data:b,type:C})=>{s.value=_6e(ta(d.toValue(b))),C==="blur"&&(u.value=!1)}})}}}const WA=["#409EFF","#b36c2d","#7548ff","#5233b3","#649ee5","#aac4ed","#f9ce57","#ae74e8"],RH=d.ref(0),aE=new Map,dBe={key:0,class:"node-select-small gap-x-2"},fBe={key:1,class:"text-[#999]"},mBe={key:1,class:"node-select"},pBe={class:"flex py-2 px-2 justify-between items-center noder-select-header"},gBe={class:"flex gap-2"},hBe={key:1},vBe={class:"flex gap-1"},bBe=d.defineComponent({__name:"index",props:d.mergeModels({mode:{type:String,default:"multiple"},color:{type:String},id:{type:String,default:""},editorId:{type:String,default:""},size:{type:String,default:"default"},label:{type:String,default:"点击选择"},isOccupy:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=d.ref((aE==null?void 0:aE[s==null?void 0:s.id])||0),u=d.ref((s==null?void 0:s.id)||m2()),m=d.useModel(o,"modelValue");Em(m);const{selectNodes:h,isSelecting:b}=Poe({nodes:m,mode:s.mode}),C=()=>{m.value=[]},S=d.computed(()=>s.color||(WA==null?void 0:WA[d.toValue(i)%(WA==null?void 0:WA.length)])||"#409eff");d.onMounted(()=>{uB(aE==null?void 0:aE[s==null?void 0:s.id])&&(s!=null&&s.id)&&(aE[s==null?void 0:s.id]=RH.value,i.value=RH.value,RH.value=RH.value+1)});const _=d.computed(()=>s.isOccupy),N=d.computed(()=>!d.toValue(b));return L6e({id:u.value,editorId:s.editorId,nodes:m,activated:N,color:S,isOccupy:_}),(O,R)=>{var I,W;return s.size==="small"?(d.openBlock(),d.createElementBlock("div",dBe,[d.createElementVNode("div",{style:d.normalizeStyle({"--node-color":S.value}),class:"node-color cursor-pointer"},null,4),d.createElementVNode("div",null,d.toDisplayString(s.label),1),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",{key:0,style:d.normalizeStyle(d.unref(b)?{color:"#409eff"}:{}),onClick:R[0]||(R[0]=(...G)=>d.unref(h)&&d.unref(h)(...G))},R[6]||(R[6]=[d.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer"},null,-1)]),4)),!s.disabled&&((I=m.value)==null?void 0:I.length)>0?(d.openBlock(),d.createElementBlock("div",{key:1,class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})):d.createCommentVNode("",!0),d.createElementVNode("div",{class:"flex items-center flex-wrap gap-1 cursor-pointer",onClick:R[2]||(R[2]=()=>{s!=null&&s.disabled||d.unref(h)()})},[((W=m.value)==null?void 0:W.length)>0?(d.openBlock(),d.createBlock(cle,{key:0,modelValue:m.value,"onUpdate:modelValue":R[1]||(R[1]=G=>m.value=G),editorId:o.editorId},null,8,["modelValue","editorId"])):(d.openBlock(),d.createElementBlock("div",fBe,"未设置"))])])):(d.openBlock(),d.createElementBlock("div",mBe,[d.createElementVNode("div",pBe,[d.createElementVNode("div",gBe,[d.createElementVNode("div",{style:d.normalizeStyle({"--node-color":S.value}),class:"node-color cursor-pointer"},null,4),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",{key:0,style:d.normalizeStyle(d.unref(b)?{color:"#409eff"}:{})},[d.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer",onClick:R[3]||(R[3]=(...G)=>d.unref(h)&&d.unref(h)(...G))})],4)),s.disabled?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",hBe,[d.createElementVNode("div",{class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})]))]),d.createElementVNode("div",vBe,[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(cle,{modelValue:m.value,"onUpdate:modelValue":R[4]||(R[4]=G=>m.value=G),editorId:o.editorId},null,8,["modelValue","editorId"])],2)]))}}}),Lfe=Ja(bBe,[["__scopeId","data-v-9af34714"]]);function yBe(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 wBe(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 CBe(o){const s=BU(o.editorId),i=(b,C)=>{let S=[];const _=Math.min(b.colIndex,C.colIndex),N=Math.max(b.colIndex,C.colIndex),O=Math.min(b.rowIndex,C.rowIndex),R=Math.max(b.rowIndex,C.rowIndex);for(let I=O;I<=R;I++)for(let W=_;W<=N;W++)S.push({colIndex:W,rowIndex:I});return S},u=b=>{var N;const C=b.includes(":");let S=[];if(C){const[O,R]=b.split(":").map(I=>h(I));S=i(O,R)}else S=[h(b)];return m(S,d.toValue((N=d.toValue(s))==null?void 0:N.nodes))},m=(b,C)=>C==null?void 0:C.filter(S=>{const _=S.nodePath.split(" > ");let N=1,O=1;return _.forEach(R=>{if(R.startsWith("tr")){const I=R.match(/tr(?::nth-of-type\((\d+)\))?/);I&&I[1]&&(N=parseInt(I[1]))}else if(R.startsWith("td")){const I=R.match(/td(?::nth-of-type\((\d+)\))?/);I&&(O=I[1]?parseInt(I[1]):1)}}),b.some(R=>N===R.rowIndex+1&&O===R.colIndex+1)}),h=b=>{if(!b)return{colIndex:-1,rowIndex:-1};const C=b.match(/^([A-Za-z]+)(\d+)$/);if(!C)return{colIndex:-1,rowIndex:-1};const S=C[1].toUpperCase(),_=parseInt(C[2]);let N=0;for(let O=0;O<S.length;O++)N=N*26+(S.charCodeAt(O)-64);return{colIndex:N-1,rowIndex:_}};return{getCellValue:u}}const ule=["#0288D1","#D32F2F","#F57C00","#388E3C","#303F9F","#7B1FA2","#C2185B","#880E4F","#689F38","#5D4037"];function SBe(o,s,i){const u=d.ref(null),m=d.ref(null);function h(){return o.value&&o.value.textContent||""}d.onMounted(()=>{o.value&&(u.value=()=>{const C=h();s.value=C},m.value=()=>{const C=h();s.value=C},o.value.addEventListener("input",u.value),o.value.addEventListener("blur",m.value))}),d.onUnmounted(()=>{o.value&&(u.value&&o.value.removeEventListener("input",u.value),m.value&&o.value.removeEventListener("blur",m.value))});const b=C=>{var S,_,N,O;if(C>=0){const R=window.getSelection();if(R){const I=R.getRangeAt(0),W=((S=I.startContainer)==null?void 0:S.nodeName)==="#text"?I.startContainer:(N=(_=I.startContainer)==null?void 0:_.childNodes)==null?void 0:N[0],G=Math.min(C,((O=W.textContent)==null?void 0:O.length)||0);I.setStart(W,G)}}};return d.watch(()=>[s,o],()=>{var C;o.value&&(ua((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 xBe(o){const{element:s,showStr:i,editorId:u}=o,m=BU(u),h=Foe({element:s}),b=d.computed(()=>{var C;return(C=i==null?void 0:i.value)==null?void 0:C.filter(S=>["range","cell"].includes(S.type))});return d.watch(()=>h,()=>{var S,_,N,O,R,I;const C=W=>{var G;W.preventDefault(),(G=d.toValue(s))==null||G.focus()};d.toValue(h)?((S=d.toValue(m))==null||S.containerRef.addEventListener("click",C),(_=d.toValue(m))==null||_.containerRef.addEventListener("mousedown",C),(N=document.querySelectorAll(".select-function"))==null||N.forEach(W=>{W.addEventListener("click",C),W.addEventListener("mousedown",C)})):((O=d.toValue(m))==null||O.containerRef.removeEventListener("click",C),(R=d.toValue(m))==null||R.containerRef.removeEventListener("mousedown",C),(I=document.querySelectorAll(".select-function"))==null||I.forEach(W=>{W.removeEventListener("click",C),W.removeEventListener("mousedown",C)}))},{deep:!0}),d.watch(()=>[h,b],()=>{var C,S,_,N,O;if((C=d.toValue(m))!=null&&C.containerRef&&((N=(_=(S=d.toValue(m))==null?void 0:S.containerRef)==null?void 0:_.querySelectorAll(".node-formula-cell"))==null||N.forEach(R=>{R.classList.remove("node-formula-cell")}),d.toValue(h))){let R=[];(O=b.value)!=null&&O.length&&(b.value.forEach(I=>{var W;R=[...R,...((W=I==null?void 0:I.cellValue)==null?void 0:W.map(G=>({color:I==null?void 0:I.color,backgroundColor:Bz((I==null?void 0:I.color)||"#000",.1),element:G==null?void 0:G.element})))||[]]}),R.forEach(I=>{var W;I!=null&&I.element&&((W=I==null?void 0:I.element)==null||W.classList.add("node-formula-cell"),I==null||I.element.style.setProperty("--formula-node-color",I==null?void 0:I.color),I==null||I.element.style.setProperty("--formula-node-bg-color",I==null?void 0:I.backgroundColor))}))}},{deep:!0}),h}const EBe=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 _Be(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 kBe=(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},TBe=o=>{const{startOffset:s,showStr:i,value:u,editorId:m,currentItemIndex:h,currentItem:b,element:C}=o,S=BU(m),_=d.ref(-1),N=d.ref(0),O=Foe({element:C}),R=d.ref(!1),I=Ioe(),W=G=>{var Q,q;if(d.toValue(R)&&d.toValue(O)&&!ua((Q=d.toValue(b))==null?void 0:Q.cellValue,G)){const Z=x6e(G,((q=d.toValue(S))==null?void 0:q.nodes)||"");let L=Z;Z&&(d.toValue(N)===0&&(L+=","),d.toValue(_)>=0&&(u.value=_Be(d.toValue(u),d.toValue(_),d.toValue(N),L),N.value=Z.length))}};d.watch(()=>h,()=>{var G,Q,q,Z,L,de;if((G=S.value)==null||G.setSelectedNodes([]),["range","cell"].includes((Q=d.toValue(b))==null?void 0:Q.type))return _.value=kBe(i.value,h.value),N.value=(Z=(q=d.toValue(b))==null?void 0:q.value)==null?void 0:Z.length,R.value=!0,I("selectNodes",{data:(L=d.toValue(b))==null?void 0:L.cellValue,mode:"multiple",callback:({data:Ve})=>{W(Ve)}}),!1;if([",","(","="].includes((de=d.toValue(b))==null?void 0:de.value))return _.value=d.toValue(s),R.value=!0,N.value=0,I("selectNodes",{data:[],mode:"multiple",callback:({data:Ve})=>{W(Ve)}}),!1;R.value=!1,_.value=-1},{immediate:!0,deep:!0})},ABe=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 NBe(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 OBe=(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,currentItemIndex:m,currentItem:h,element:b}=o,C=d.ref(-1),S=d.ref(0),_=Foe({element:b}),N=d.ref(!1),O=Ioe(),R=I=>{var W;if(d.toValue(N)&&d.toValue(_)&&!ua((W=d.toValue(h))==null?void 0:W.value,I)){const G=I,Q=G;G&&d.toValue(C)>=0&&(u.value=NBe(d.toValue(u),d.toValue(C),d.toValue(S),Q),S.value=G.length)}};d.watch(()=>m,()=>{var I,W,G,Q,q;if(["function"].includes((I=d.toValue(h))==null?void 0:I.type))return C.value=OBe(i.value,m.value),S.value=(G=(W=d.toValue(h))==null?void 0:W.value)==null?void 0:G.length,N.value=!0,O("selectFunction",{data:(Q=d.toValue(h))==null?void 0:Q.value,callback:({data:Z})=>{R(Z)}}),!1;if([",","(","="].includes((q=d.toValue(h))==null?void 0:q.value))return C.value=d.toValue(s),N.value=!0,S.value=0,O("selectFunction",{data:"",callback:({data:Z})=>{R(Z)}}),!1;N.value=!1,C.value=-1},{immediate:!0,deep:!0})},DBe={class:"node-formula"},MBe={class:"node-formula-show"},BBe=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}=CBe({editorId:s==null?void 0:s.editorId}),u=d.useModel(o,"modelValue"),m=d.ref(),{startOffset:h}=EBe({element:m});SBe(m,u,h);const b=d.computed(()=>{const N=yBe(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=wBe(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:ule[O%ule.length]}):(I==null?void 0:I.type)==="function"?{...I,color:"#0318ff"}:I)});xBe({element:m,showStr:C,editorId:s==null?void 0:s.editorId});const{currentItemIndex:S,currentItem:_}=ABe({element:m,startOffset:h,value:u,showStr:C});return TBe({element:m,startOffset:h,showStr:C,editorId:s==null?void 0:s.editorId,value:u,currentItemIndex:S,currentItem:_}),$Be({element:m,startOffset:h,showStr:C,value:u,currentItemIndex:S,currentItem:_}),(N,O)=>(d.openBlock(),d.createElementBlock("div",DBe,[d.createElementVNode("div",{contenteditable:"true",ref_key:"formulaRef",ref:m,class:"node-formula-input"},null,512),d.createElementVNode("div",MBe,[(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(Bz)((R==null?void 0:R.color)||"#000",.1)})},d.toDisplayString(R.value),7))),128))])]))}}),Vfe=Ja(BBe,[["__scopeId","data-v-f4b96eb4"]]),RBe=[{label:"平均值",value:"AVERAGE"},{label:"均值绝对偏差",value:"AVEDEV"},{label:"求和",value:"SUM"},{label:"条件判断",value:"IF"},{label:"统计数量",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"正平方根",value:"SQRT"}],IBe={class:"select-function"},PBe=["onClick"],FBe={class:"function-item"},LBe={class:"function-item-desc"},VBe=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:RBe}),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",IBe,[(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",FBe,d.toDisplayString(S.value),1),d.createElementVNode("div",LBe,d.toDisplayString(S.label),1)],10,PBe)]))),128))]))}}),Hfe=Ja(VBe,[["__scopeId","data-v-6e079ff0"]]),HBe=["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(IB,null,{default:d.withCtx(()=>[d.createElementVNode("div",{innerHTML:s.value},null,8,HBe)]),_:1}))}});function RU(o){return d.getCurrentScope()?(d.onScopeDispose(o),!0):!1}function B0(o){return typeof o=="function"?o():d.unref(o)}const zBe=typeof window<"u"&&typeof document<"u",UBe=o=>typeof o<"u",jBe=Object.prototype.toString,WBe=o=>jBe.call(o)==="[object Object]",ZBe=()=>{};function GBe(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 qBe(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 dle(o,s=!1,i="Timeout"){return new Promise((u,m)=>{setTimeout(s?()=>m(i):u,o)})}function YBe(o,s,i={}){const{eventFilter:u=Ufe,...m}=i;return d.watch(o,GBe(u,s),m)}function ZA(o,s,i={}){const{eventFilter:u,...m}=i,{eventFilter:h,pause:b,resume:C,isActive:S}=qBe(u);return{stop:YBe(o,s,{...m,eventFilter:h}),pause:b,resume:C,isActive:S}}function KBe(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 Sne(o,s=!1){function i(O,{flush:R="sync",deep:I=!1,timeout:W,throwOnTimeout:G}={}){let Q=null;const Z=[new Promise(L=>{Q=d.watch(o,de=>{O(de)!==s&&(Q==null||Q(),L(de))},{flush:R,deep:I,immediate:!0})})];return W!=null&&Z.push(dle(W,G).then(()=>B0(o)).finally(()=>Q==null?void 0:Q())),Promise.race(Z)}function u(O,R){if(!d.isRef(O))return i(de=>de===O,R);const{flush:I="sync",deep:W=!1,timeout:G,throwOnTimeout:Q}=R??{};let q=null;const L=[new Promise(de=>{q=d.watch([o,O],([Ve,Se])=>{s!==(Ve===Se)&&(q==null||q(),de(Ve))},{flush:I,deep:W,immediate:!0})})];return G!=null&&L.push(dle(G,Q).then(()=>B0(o)).finally(()=>(q==null||q(),B0(o)))),Promise.race(L)}function m(O){return i(R=>!!R,O)}function h(O){return u(null,O)}function b(O){return u(void 0,O)}function C(O){return i(Number.isNaN,O)}function S(O,R){return i(I=>{const W=Array.from(I);return W.includes(O)||W.includes(B0(O))},R)}function _(O){return N(1,O)}function N(O=1,R){let I=-1;return i(()=>(I+=1,I>=O),R)}return Array.isArray(B0(o))?{toMatch:i,toContains:S,changed:_,changedTimes:N,get not(){return Sne(o,!s)}}:{toMatch:i,toBe:u,toBeTruthy:m,toBeNull:h,toBeNaN:C,toBeUndefined:b,changed:_,changedTimes:N,get not(){return Sne(o,!s)}}}function xne(o){return Sne(o)}function XBe(o){var s;const i=B0(o);return(s=i==null?void 0:i.$el)!=null?s:i}const jfe=zBe?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 ZBe;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(()=>[XBe(s),B0(m)],([N,O])=>{if(b(),!N)return;const R=WBe(O)?{...O}:O;h.push(...i.flatMap(I=>u.map(W=>C(N,I,W,R))))},{immediate:!0,flush:"post"}),_=()=>{S(),b()};return RU(_),_}function JBe(o){return typeof o=="function"?o:typeof o=="string"?s=>s.key===o:Array.isArray(o)?s=>o.includes(s.key):()=>!0}function fle(...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=JBe(s);return Wfe(m,h,N=>{N.repeat&&B0(C)||S(N)&&i(N)},b)}function QBe(o){return JSON.parse(JSON.stringify(o))}function vte(o,s,i,u={}){var m,h,b;const{clone:C=!1,passive:S=!1,eventName:_,deep:N=!1,defaultValue:O,shouldEmit:R}=u,I=d.getCurrentInstance(),W=i||(I==null?void 0:I.emit)||((m=I==null?void 0:I.$emit)==null?void 0:m.bind(I))||((b=(h=I==null?void 0:I.proxy)==null?void 0:h.$emit)==null?void 0:b.bind(I==null?void 0:I.proxy));let G=_;s||(s="modelValue"),G=G||`update:${s.toString()}`;const Q=L=>C?typeof C=="function"?C(L):QBe(L):L,q=()=>UBe(o[s])?Q(o[s]):O,Z=L=>{R?R(L)&&W(G,L):W(G,L)};if(S){const L=q(),de=d.ref(L);let Ve=!1;return d.watch(()=>o[s],Se=>{Ve||(Ve=!0,de.value=Q(Se),d.nextTick(()=>Ve=!1))}),d.watch(de,Se=>{!Ve&&(Se!==o[s]||N)&&Z(Se)},{deep:N}),de}else return d.computed({get(){return q()},set(L){Z(L)}})}var eRe={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 iz(i)}function iz(o){this._=o}function tRe(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}})}iz.prototype=IU.prototype={constructor:iz,on:function(o,s){var i=this._,u=tRe(o+"",i),m,h=-1,b=u.length;if(arguments.length<2){for(;++h<b;)if((m=(o=u[h]).type)&&(m=nRe(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]=mle(i[m],o.name,s);else if(s==null)for(m in i)i[m]=mle(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 iz(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 nRe(o,s){for(var i=0,u=o.length,m;i<u;++i)if((m=o[i]).name===s)return m.value}function mle(o,s,i){for(var u=0,m=o.length;u<m;++u)if(o[u].name===s){o[u]=eRe,o=o.slice(0,u).concat(o.slice(u+1));break}return i!=null&&o.push({name:s,value:i}),o}var Ene="http://www.w3.org/1999/xhtml";const ple={svg:"http://www.w3.org/2000/svg",xhtml:Ene,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)),ple.hasOwnProperty(s)?{space:ple[s],local:o}:o}function oRe(o){return function(){var s=this.ownerDocument,i=this.namespaceURI;return i===Ene&&s.documentElement.namespaceURI===Ene?s.createElement(o):s.createElementNS(i,o)}}function sRe(o){return function(){return this.ownerDocument.createElementNS(o.space,o.local)}}function Zfe(o){var s=PU(o);return(s.local?sRe:oRe)(s)}function rRe(){}function Loe(o){return o==null?rRe:function(){return this.querySelector(o)}}function aRe(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 iRe(o){return o==null?[]:Array.isArray(o)?o:Array.from(o)}function lRe(){return[]}function Gfe(o){return o==null?lRe:function(){return this.querySelectorAll(o)}}function cRe(o){return function(){return iRe(o.apply(this,arguments))}}function uRe(o){typeof o=="function"?o=cRe(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 dRe=Array.prototype.find;function fRe(o){return function(){return dRe.call(this.children,o)}}function mRe(){return this.firstElementChild}function pRe(o){return this.select(o==null?mRe:fRe(typeof o=="function"?o:Yfe(o)))}var gRe=Array.prototype.filter;function hRe(){return Array.from(this.children)}function vRe(o){return function(){return gRe.call(this.children,o)}}function bRe(o){return this.selectAll(o==null?hRe:vRe(typeof o=="function"?o:Yfe(o)))}function yRe(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 wRe(){return new Sp(this._enter||this._groups.map(Kfe),this._parents)}function Iz(o,s){this.ownerDocument=o.ownerDocument,this.namespaceURI=o.namespaceURI,this._next=null,this._parent=o,this.__data__=s}Iz.prototype={constructor:Iz,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 CRe(o){return function(){return o}}function SRe(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 Iz(o,h[b]);for(;b<S;++b)(C=s[b])&&(m[b]=C)}function xRe(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 Iz(o,h[C]);for(C=0;C<N;++C)(S=s[C])&&_.get(R[C])===S&&(m[C]=S)}function ERe(o){return o.__data__}function _Re(o,s){if(!arguments.length)return Array.from(this,ERe);var i=s?xRe:SRe,u=this._parents,m=this._groups;typeof o!="function"&&(o=CRe(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=kRe(o.call(N,N&&N.__data__,_,u)),W=I.length,G=C[_]=new Array(W),Q=b[_]=new Array(W),q=S[_]=new Array(R);i(N,O,G,Q,q,I,s);for(var Z=0,L=0,de,Ve;Z<W;++Z)if(de=G[Z]){for(Z>=L&&(L=Z+1);!(Ve=Q[L])&&++L<W;);de._next=Ve||null}}return b=new Sp(b,u),b._enter=C,b._exit=S,b}function kRe(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function TRe(){return new Sp(this._exit||this._groups.map(Kfe),this._parents)}function ARe(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 NRe(o){for(var s=o.selection?o.selection():o,i=this._groups,u=s._groups,m=i.length,h=u.length,b=Math.min(m,h),C=new Array(m),S=0;S<b;++S)for(var _=i[S],N=u[S],O=_.length,R=C[S]=new Array(O),I,W=0;W<O;++W)(I=_[W]||N[W])&&(R[W]=I);for(;S<m;++S)C[S]=i[S];return new Sp(C,this._parents)}function ORe(){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 $Re(o){o||(o=DRe);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 DRe(o,s){return o<s?-1:o>s?1:o>=s?0:NaN}function MRe(){var o=arguments[0];return arguments[0]=this,o.apply(null,arguments),this}function BRe(){return Array.from(this)}function RRe(){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 IRe(){let o=0;for(const s of this)++o;return o}function PRe(){return!this.node()}function FRe(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 LRe(o){return function(){this.removeAttribute(o)}}function VRe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function HRe(o,s){return function(){this.setAttribute(o,s)}}function zRe(o,s){return function(){this.setAttributeNS(o.space,o.local,s)}}function URe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttribute(o):this.setAttribute(o,i)}}function jRe(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 WRe(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?VRe:LRe:typeof s=="function"?i.local?jRe:URe:i.local?zRe:HRe)(i,s))}function Xfe(o){return o.ownerDocument&&o.ownerDocument.defaultView||o.document&&o||o.defaultView}function ZRe(o){return function(){this.style.removeProperty(o)}}function GRe(o,s,i){return function(){this.style.setProperty(o,s,i)}}function qRe(o,s,i){return function(){var u=s.apply(this,arguments);u==null?this.style.removeProperty(o):this.style.setProperty(o,u,i)}}function YRe(o,s,i){return arguments.length>1?this.each((s==null?ZRe:typeof s=="function"?qRe:GRe)(o,s,i??"")):g4(this.node(),o)}function g4(o,s){return o.style.getPropertyValue(s)||Xfe(o).getComputedStyle(o,null).getPropertyValue(s)}function KRe(o){return function(){delete this[o]}}function XRe(o,s){return function(){this[o]=s}}function JRe(o,s){return function(){var i=s.apply(this,arguments);i==null?delete this[o]:this[o]=i}}function QRe(o,s){return arguments.length>1?this.each((s==null?KRe:typeof s=="function"?JRe:XRe)(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 eIe(o){return function(){eme(this,o)}}function tIe(o){return function(){tme(this,o)}}function nIe(o,s){return function(){(s.apply(this,arguments)?eme:tme)(this,o)}}function oIe(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"?nIe:s?eIe:tIe)(i,s))}function sIe(){this.textContent=""}function rIe(o){return function(){this.textContent=o}}function aIe(o){return function(){var s=o.apply(this,arguments);this.textContent=s??""}}function iIe(o){return arguments.length?this.each(o==null?sIe:(typeof o=="function"?aIe:rIe)(o)):this.node().textContent}function lIe(){this.innerHTML=""}function cIe(o){return function(){this.innerHTML=o}}function uIe(o){return function(){var s=o.apply(this,arguments);this.innerHTML=s??""}}function dIe(o){return arguments.length?this.each(o==null?lIe:(typeof o=="function"?uIe:cIe)(o)):this.node().innerHTML}function fIe(){this.nextSibling&&this.parentNode.appendChild(this)}function mIe(){return this.each(fIe)}function pIe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function gIe(){return this.each(pIe)}function hIe(o){var s=typeof o=="function"?o:Zfe(o);return this.select(function(){return this.appendChild(s.apply(this,arguments))})}function vIe(){return null}function bIe(o,s){var i=typeof o=="function"?o:Zfe(o),u=s==null?vIe:typeof s=="function"?s:Loe(s);return this.select(function(){return this.insertBefore(i.apply(this,arguments),u.apply(this,arguments)||null)})}function yIe(){var o=this.parentNode;o&&o.removeChild(this)}function wIe(){return this.each(yIe)}function CIe(){var o=this.cloneNode(!1),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function SIe(){var o=this.cloneNode(!0),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function xIe(o){return this.select(o?SIe:CIe)}function EIe(o){return arguments.length?this.property("__data__",o):this.node().__data__}function _Ie(o){return function(s){o.call(this,s,this.__data__)}}function kIe(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 TIe(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 AIe(o,s,i){return function(){var u=this.__on,m,h=_Ie(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 NIe(o,s,i){var u=kIe(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?AIe:TIe,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 OIe(o,s){return function(){return nme(this,o,s)}}function $Ie(o,s){return function(){return nme(this,o,s.apply(this,arguments))}}function DIe(o,s){return this.each((typeof s=="function"?$Ie:OIe)(o,s))}function*MIe(){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 FB(){return new Sp([[document.documentElement]],ome)}function BIe(){return this}Sp.prototype=FB.prototype={constructor:Sp,select:aRe,selectAll:uRe,selectChild:pRe,selectChildren:bRe,filter:yRe,data:_Re,enter:wRe,exit:TRe,join:ARe,merge:NRe,selection:BIe,order:ORe,sort:$Re,call:MRe,nodes:BRe,node:RRe,size:IRe,empty:PRe,each:FRe,attr:WRe,style:YRe,property:QRe,classed:oIe,text:iIe,html:dIe,raise:mIe,lower:gIe,append:hIe,insert:bIe,remove:wIe,clone:xIe,datum:EIe,on:NIe,dispatch:DIe,[Symbol.iterator]:MIe};function Mh(o){return typeof o=="string"?new Sp([[document.querySelector(o)]],[document.documentElement]):new Sp([[o]],ome)}function RIe(o){let s;for(;s=o.sourceEvent;)o=s;return o}function Ov(o,s){if(o=RIe(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 IIe={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 IH=o=>()=>o;function _ne(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}})}_ne.prototype.on=function(){var o=this._.on.apply(this._,arguments);return o===this._?this:o};function PIe(o){return!o.ctrlKey&&!o.button}function FIe(){return this.parentNode}function LIe(o,s){return s??{x:o.x,y:o.y}}function VIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function HIe(){var o=PIe,s=FIe,i=LIe,u=VIe,m={},h=IU("start","drag","end"),b=0,C,S,_,N,O=0;function R(de){de.on("mousedown.drag",I).filter(u).on("touchstart.drag",Q).on("touchmove.drag",q,IIe).on("touchend.drag touchcancel.drag",Z).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function I(de,Ve){if(!(N||!o.call(this,de,Ve))){var Se=L(this,s.call(this,de,Ve),de,Ve,"mouse");Se&&(Mh(de.view).on("mousemove.drag",W,fB).on("mouseup.drag",G,fB),sme(de.view),bte(de),_=!1,C=de.clientX,S=de.clientY,Se("start",de))}}function W(de){if(a4(de),!_){var Ve=de.clientX-C,Se=de.clientY-S;_=Ve*Ve+Se*Se>O}m.mouse("drag",de)}function G(de){Mh(de.view).on("mousemove.drag mouseup.drag",null),rme(de.view,_),a4(de),m.mouse("end",de)}function Q(de,Ve){if(o.call(this,de,Ve)){var Se=de.changedTouches,J=s.call(this,de,Ve),Fe=Se.length,it,rt;for(it=0;it<Fe;++it)(rt=L(this,J,de,Ve,Se[it].identifier,Se[it]))&&(bte(de),rt("start",de,Se[it]))}}function q(de){var Ve=de.changedTouches,Se=Ve.length,J,Fe;for(J=0;J<Se;++J)(Fe=m[Ve[J].identifier])&&(a4(de),Fe("drag",de,Ve[J]))}function Z(de){var Ve=de.changedTouches,Se=Ve.length,J,Fe;for(N&&clearTimeout(N),N=setTimeout(function(){N=null},500),J=0;J<Se;++J)(Fe=m[Ve[J].identifier])&&(bte(de),Fe("end",de,Ve[J]))}function L(de,Ve,Se,J,Fe,it){var rt=h.copy(),De=Ov(it||Se,Ve),ce,zt,he;if((he=i.call(de,new _ne("beforestart",{sourceEvent:Se,target:R,identifier:Fe,active:b,x:De[0],y:De[1],dx:0,dy:0,dispatch:rt}),J))!=null)return ce=he.x-De[0]||0,zt=he.y-De[1]||0,function Ee(M,Ze,ye){var at=De,st;switch(M){case"start":m[Fe]=Ee,st=b++;break;case"end":delete m[Fe],--b;case"drag":De=Ov(ye||Ze,Ve),st=b;break}rt.call(M,de,new _ne(M,{sourceEvent:Ze,subject:he,target:R,identifier:Fe,active:st,x:De[0]+ce,y:De[1]+zt,dx:De[0]-at[0],dy:De[1]-at[1],dispatch:rt}),J)}}return R.filter=function(de){return arguments.length?(o=typeof de=="function"?de:IH(!!de),R):o},R.container=function(de){return arguments.length?(s=typeof de=="function"?de:IH(de),R):s},R.subject=function(de){return arguments.length?(i=typeof de=="function"?de:IH(de),R):i},R.touchable=function(de){return arguments.length?(u=typeof de=="function"?de:IH(!!de),R):u},R.on=function(){var de=h.on.apply(h,arguments);return de===h?R:de},R.clickDistance=function(de){return arguments.length?(O=(de=+de)*de,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 LB(){}var mB=.7,Pz=1/mB,i4="\\s*([+-]?\\d+)\\s*",pB="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Mv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zIe=/^#([0-9a-f]{3,8})$/,UIe=new RegExp(`^rgb\\(${i4},${i4},${i4}\\)$`),jIe=new RegExp(`^rgb\\(${Mv},${Mv},${Mv}\\)$`),WIe=new RegExp(`^rgba\\(${i4},${i4},${i4},${pB}\\)$`),ZIe=new RegExp(`^rgba\\(${Mv},${Mv},${Mv},${pB}\\)$`),GIe=new RegExp(`^hsl\\(${pB},${Mv},${Mv}\\)$`),qIe=new RegExp(`^hsla\\(${pB},${Mv},${Mv},${pB}\\)$`),gle={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(LB,gB,{copy(o){return Object.assign(new this.constructor,this,o)},displayable(){return this.rgb().displayable()},hex:hle,formatHex:hle,formatHex8:YIe,formatHsl:KIe,formatRgb:vle,toString:vle});function hle(){return this.rgb().formatHex()}function YIe(){return this.rgb().formatHex8()}function KIe(){return ime(this).formatHsl()}function vle(){return this.rgb().formatRgb()}function gB(o){var s,i;return o=(o+"").trim().toLowerCase(),(s=zIe.exec(o))?(i=s[1].length,s=parseInt(s[1],16),i===6?ble(s):i===3?new Sm(s>>8&15|s>>4&240,s>>4&15|s&240,(s&15)<<4|s&15,1):i===8?PH(s>>24&255,s>>16&255,s>>8&255,(s&255)/255):i===4?PH(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=UIe.exec(o))?new Sm(s[1],s[2],s[3],1):(s=jIe.exec(o))?new Sm(s[1]*255/100,s[2]*255/100,s[3]*255/100,1):(s=WIe.exec(o))?PH(s[1],s[2],s[3],s[4]):(s=ZIe.exec(o))?PH(s[1]*255/100,s[2]*255/100,s[3]*255/100,s[4]):(s=GIe.exec(o))?Cle(s[1],s[2]/100,s[3]/100,1):(s=qIe.exec(o))?Cle(s[1],s[2]/100,s[3]/100,s[4]):gle.hasOwnProperty(o)?ble(gle[o]):o==="transparent"?new Sm(NaN,NaN,NaN,0):null}function ble(o){return new Sm(o>>16&255,o>>8&255,o&255,1)}function PH(o,s,i,u){return u<=0&&(o=s=i=NaN),new Sm(o,s,i,u)}function XIe(o){return o instanceof LB||(o=gB(o)),o?(o=o.rgb(),new Sm(o.r,o.g,o.b,o.opacity)):new Sm}function kne(o,s,i,u){return arguments.length===1?XIe(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,kne,ame(LB,{brighter(o){return o=o==null?Pz:Math.pow(Pz,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(EE(this.r),EE(this.g),EE(this.b),Fz(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:yle,formatHex:yle,formatHex8:JIe,formatRgb:wle,toString:wle}));function yle(){return`#${vE(this.r)}${vE(this.g)}${vE(this.b)}`}function JIe(){return`#${vE(this.r)}${vE(this.g)}${vE(this.b)}${vE((isNaN(this.opacity)?1:this.opacity)*255)}`}function wle(){const o=Fz(this.opacity);return`${o===1?"rgb(":"rgba("}${EE(this.r)}, ${EE(this.g)}, ${EE(this.b)}${o===1?")":`, ${o})`}`}function Fz(o){return isNaN(o)?1:Math.max(0,Math.min(1,o))}function EE(o){return Math.max(0,Math.min(255,Math.round(o)||0))}function vE(o){return o=EE(o),(o<16?"0":"")+o.toString(16)}function Cle(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 LB||(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 QIe(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,QIe,ame(LB,{brighter(o){return o=o==null?Pz:Math.pow(Pz,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(Sle(this.h),FH(this.s),FH(this.l),Fz(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=Fz(this.opacity);return`${o===1?"hsl(":"hsla("}${Sle(this.h)}, ${FH(this.s)*100}%, ${FH(this.l)*100}%${o===1?")":`, ${o})`}`}}));function Sle(o){return o=(o||0)%360,o<0?o+360:o}function FH(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 ePe(o,s){return function(i){return o+i*s}}function tPe(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 nPe(o){return(o=+o)==1?cme:function(s,i){return i-s?tPe(s,i,o):lme(isNaN(s)?i:s)}}function cme(o,s){var i=s-o;return i?ePe(o,i):lme(isNaN(o)?s:o)}const xle=function o(s){var i=nPe(s);function u(m,h){var b=i((m=kne(m)).r,(h=kne(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 Tne=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wte=new RegExp(Tne.source,"g");function oPe(o){return function(){return o}}function sPe(o){return function(s){return o(s)+""}}function rPe(o,s){var i=Tne.lastIndex=wte.lastIndex=0,u,m,h,b=-1,C=[],S=[];for(o=o+"",s=s+"";(u=Tne.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]?sPe(S[0].x):oPe(s):(s=S.length,function(_){for(var N=0,O;N<s;++N)C[(O=S[N]).i]=O.x(_);return C.join("")})}var Ele=180/Math.PI,Ane={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)*Ele,skewX:Math.atan(S)*Ele,scaleX:b,scaleY:C}}var LH;function aPe(o){const s=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(o+"");return s.isIdentity?Ane:ume(s.a,s.b,s.c,s.d,s.e,s.f)}function iPe(o){return o==null||(LH||(LH=document.createElementNS("http://www.w3.org/2000/svg","g")),LH.setAttribute("transform",o),!(o=LH.transform.baseVal.consolidate()))?Ane:(o=o.matrix,ume(o.a,o.b,o.c,o.d,o.e,o.f))}function dme(o,s,i,u){function m(_){return _.length?_.pop()+" ":""}function h(_,N,O,R,I,W){if(_!==O||N!==R){var G=I.push("translate(",null,s,null,i);W.push({i:G-4,x:r2(_,O)},{i:G-2,x:r2(N,R)})}else(O||R)&&I.push("translate("+O+s+R+i)}function b(_,N,O,R){_!==N?(_-N>180?N+=360:N-_>180&&(_+=360),R.push({i:O.push(m(O)+"rotate(",null,u)-2,x:r2(_,N)})):N&&O.push(m(O)+"rotate("+N+u)}function C(_,N,O,R){_!==N?R.push({i:O.push(m(O)+"skewX(",null,u)-2,x:r2(_,N)}):N&&O.push(m(O)+"skewX("+N+u)}function S(_,N,O,R,I,W){if(_!==O||N!==R){var G=I.push(m(I)+"scale(",null,",",null,")");W.push({i:G-4,x:r2(_,O)},{i:G-2,x:r2(N,R)})}else(O!==1||R!==1)&&I.push(m(I)+"scale("+O+","+R+")")}return function(_,N){var O=[],R=[];return _=o(_),N=o(N),h(_.translateX,_.translateY,N.translateX,N.translateY,O,R),b(_.rotate,N.rotate,O,R),C(_.skewX,N.skewX,O,R),S(_.scaleX,_.scaleY,N.scaleX,N.scaleY,O,R),_=N=null,function(I){for(var W=-1,G=R.length,Q;++W<G;)O[(Q=R[W]).i]=Q.x(I);return O.join("")}}}var lPe=dme(aPe,"px, ","px)","deg)"),cPe=dme(iPe,", ",")",")"),uPe=1e-12;function _le(o){return((o=Math.exp(o))+1/o)/2}function dPe(o){return((o=Math.exp(o))-1/o)/2}function fPe(o){return((o=Math.exp(2*o))-1)/(o+1)}const mPe=function o(s,i,u){function m(h,b){var C=h[0],S=h[1],_=h[2],N=b[0],O=b[1],R=b[2],I=N-C,W=O-S,G=I*I+W*W,Q,q;if(G<uPe)q=Math.log(R/_)/s,Q=function(J){return[C+J*I,S+J*W,_*Math.exp(s*J*q)]};else{var Z=Math.sqrt(G),L=(R*R-_*_+u*G)/(2*_*i*Z),de=(R*R-_*_-u*G)/(2*R*i*Z),Ve=Math.log(Math.sqrt(L*L+1)-L),Se=Math.log(Math.sqrt(de*de+1)-de);q=(Se-Ve)/s,Q=function(J){var Fe=J*q,it=_le(Ve),rt=_/(i*Z)*(it*fPe(s*Fe+Ve)-dPe(Ve));return[C+rt*I,S+rt*W,_*it/_le(s*Fe+Ve)]}}return Q.duration=q*1e3*s/Math.SQRT2,Q}return m.rho=function(h){var b=Math.max(.001,+h),C=b*b,S=C*C;return o(b,C,S)},m}(Math.SQRT2,2,4);var h4=0,F6=0,R6=0,fme=1e3,Lz,L6,Vz=0,OE=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 OE||(mme(pPe),OE=hB.now()+FU)}function pPe(){OE=0}function Hz(){this._call=this._time=this._next=null}Hz.prototype=pme.prototype={constructor:Hz,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&&L6!==this&&(L6?L6._next=this:Lz=this,L6=this),this._call=o,this._time=i,Nne()},stop:function(){this._call&&(this._call=null,this._time=1/0,Nne())}};function pme(o,s,i){var u=new Hz;return u.restart(o,s,i),u}function gPe(){zoe(),++h4;for(var o=Lz,s;o;)(s=OE-o._time)>=0&&o._call.call(void 0,s),o=o._next;--h4}function kle(){OE=(Vz=hB.now())+FU,h4=F6=0;try{gPe()}finally{h4=0,vPe(),OE=0}}function hPe(){var o=hB.now(),s=o-Vz;s>fme&&(FU-=s,Vz=o)}function vPe(){for(var o,s=Lz,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:Lz=i);L6=o,Nne(u)}function Nne(o){if(!h4){F6&&(F6=clearTimeout(F6));var s=o-OE;s>24?(o<1/0&&(F6=setTimeout(kle,o-hB.now()-FU)),R6&&(R6=clearInterval(R6))):(R6||(Vz=hB.now(),R6=setInterval(hPe,fme)),h4=1,mme(kle))}}function Tle(o,s,i){var u=new Hz;return s=s==null?0:+s,u.restart(m=>{u.stop(),o(m+s)},s,i),u}var bPe=IU("start","end","cancel","interrupt"),yPe=[],gme=0,Ale=1,One=2,lz=3,Nle=4,$ne=5,cz=6;function LU(o,s,i,u,m,h){var b=o.__transition;if(!b)o.__transition={};else if(i in b)return;wPe(o,i,{name:s,index:u,group:m,on:bPe,tween:yPe,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>lz)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 wPe(o,s,i){var u=o.__transition,m;u[s]=i,i.timer=pme(h,0,i.time);function h(_){i.state=Ale,i.timer.restart(b,i.delay,i.time),i.delay<=_&&b(_-i.delay)}function b(_){var N,O,R,I;if(i.state!==Ale)return S();for(N in u)if(I=u[N],I.name===i.name){if(I.state===lz)return Tle(b);I.state===Nle?(I.state=cz,I.timer.stop(),I.on.call("interrupt",o,o.__data__,I.index,I.group),delete u[N]):+N<s&&(I.state=cz,I.timer.stop(),I.on.call("cancel",o,o.__data__,I.index,I.group),delete u[N])}if(Tle(function(){i.state===lz&&(i.state=Nle,i.timer.restart(C,i.delay,i.time),C(_))}),i.state=One,i.on.call("start",o,o.__data__,i.index,i.group),i.state===One){for(i.state=lz,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=$ne,1),O=-1,R=m.length;++O<R;)m[O].call(o,N);i.state===$ne&&(i.on.call("end",o,o.__data__,i.index,i.group),S())}function S(){i.state=cz,i.timer.stop(),delete u[s];for(var _ in u)return;delete o.__transition}}function uz(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>One&&u.state<$ne,u.state=cz,u.timer.stop(),u.on.call(m?"interrupt":"cancel",o,o.__data__,u.index,u.group),delete i[b]}h&&delete o.__transition}}function CPe(o){return this.each(function(){uz(this,o)})}function SPe(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 xPe(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 EPe(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?SPe:xPe)(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?xle:(i=gB(s))?(s=i,xle):rPe)(o,s)}function _Pe(o){return function(){this.removeAttribute(o)}}function kPe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function TPe(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 APe(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 NPe(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 OPe(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 $Pe(o,s){var i=PU(o),u=i==="transform"?cPe:hme;return this.attrTween(o,typeof s=="function"?(i.local?OPe:NPe)(i,u,joe(this,"attr."+o,s)):s==null?(i.local?kPe:_Pe)(i):(i.local?APe:TPe)(i,u,s))}function DPe(o,s){return function(i){this.setAttribute(o,s.call(this,i))}}function MPe(o,s){return function(i){this.setAttributeNS(o.space,o.local,s.call(this,i))}}function BPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&MPe(o,h)),i}return m._value=s,m}function RPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&DPe(o,h)),i}return m._value=s,m}function IPe(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?BPe:RPe)(u,s))}function PPe(o,s){return function(){Uoe(this,o).delay=+s.apply(this,arguments)}}function FPe(o,s){return s=+s,function(){Uoe(this,o).delay=s}}function LPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?PPe:FPe)(s,o)):Fh(this.node(),s).delay}function VPe(o,s){return function(){Fv(this,o).duration=+s.apply(this,arguments)}}function HPe(o,s){return s=+s,function(){Fv(this,o).duration=s}}function zPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?VPe:HPe)(s,o)):Fh(this.node(),s).duration}function UPe(o,s){if(typeof s!="function")throw new Error;return function(){Fv(this,o).ease=s}}function jPe(o){var s=this._id;return arguments.length?this.each(UPe(s,o)):Fh(this.node(),s).ease}function WPe(o,s){return function(){var i=s.apply(this,arguments);if(typeof i!="function")throw new Error;Fv(this,o).ease=i}}function ZPe(o){if(typeof o!="function")throw new Error;return this.each(WPe(this._id,o))}function GPe(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 qPe(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 YPe(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 KPe(o,s,i){var u,m,h=YPe(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 XPe(o,s){var i=this._id;return arguments.length<2?Fh(this.node(),i).on.on(o):this.each(KPe(i,o,s))}function JPe(o){return function(){var s=this.parentNode;for(var i in this.__transition)if(+i!==o)return;s&&s.removeChild(this)}}function QPe(){return this.on("end.remove",JPe(this._id))}function e8e(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 t8e(o){var s=this._name,i=this._id;typeof o!="function"&&(o=Gfe(o));for(var u=this._groups,m=u.length,h=[],b=[],C=0;C<m;++C)for(var S=u[C],_=S.length,N,O=0;O<_;++O)if(N=S[O]){for(var R=o.call(N,N.__data__,O,S),I,W=Fh(N,i),G=0,Q=R.length;G<Q;++G)(I=R[G])&&LU(I,s,i,G,R,W);h.push(R),b.push(N)}return new V0(h,b,s,i)}var n8e=FB.prototype.constructor;function o8e(){return new n8e(this._groups,this._parents)}function s8e(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 r8e(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 a8e(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 i8e(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 l8e(o,s,i){var u=(o+="")=="transform"?lPe:hme;return s==null?this.styleTween(o,s8e(o,u)).on("end.style."+o,vme(o)):typeof s=="function"?this.styleTween(o,a8e(o,u,joe(this,"style."+o,s))).each(i8e(this._id,o)):this.styleTween(o,r8e(o,u,s),i).on("end.style."+o,null)}function c8e(o,s,i){return function(u){this.style.setProperty(o,s.call(this,u),i)}}function u8e(o,s,i){var u,m;function h(){var b=s.apply(this,arguments);return b!==m&&(u=(m=b)&&c8e(o,b,i)),u}return h._value=s,h}function d8e(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,u8e(o,s,i??""))}function f8e(o){return function(){this.textContent=o}}function m8e(o){return function(){var s=o(this);this.textContent=s??""}}function p8e(o){return this.tween("text",typeof o=="function"?m8e(joe(this,"text",o)):f8e(o==null?"":o+""))}function g8e(o){return function(s){this.textContent=o.call(this,s)}}function h8e(o){var s,i;function u(){var m=o.apply(this,arguments);return m!==i&&(s=(i=m)&&g8e(m)),s}return u._value=o,u}function v8e(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,h8e(o))}function b8e(){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 y8e(){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 w8e=0;function V0(o,s,i,u){this._groups=o,this._parents=s,this._name=i,this._id=u}function bme(){return++w8e}var $0=FB.prototype;V0.prototype={constructor:V0,select:e8e,selectAll:t8e,selectChild:$0.selectChild,selectChildren:$0.selectChildren,filter:GPe,merge:qPe,selection:o8e,transition:b8e,call:$0.call,nodes:$0.nodes,node:$0.node,size:$0.size,empty:$0.empty,each:$0.each,on:XPe,attr:$Pe,attrTween:IPe,style:l8e,styleTween:d8e,text:p8e,textTween:v8e,remove:QPe,tween:EPe,delay:LPe,duration:zPe,ease:jPe,easeVarying:ZPe,end:y8e,[Symbol.iterator]:$0[Symbol.iterator]};function C8e(o){return((o*=2)<=1?o*o*o:(o-=2)*o*o+2)/2}var S8e={time:null,delay:0,duration:250,ease:C8e};function x8e(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 E8e(o){var s,i;o instanceof V0?(s=o._id,o=o._name):(s=bme(),(i=S8e).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||x8e(S,s));return new V0(u,this._parents,o,s)}FB.prototype.interrupt=CPe;FB.prototype.transition=E8e;const VH=o=>()=>o;function _8e(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 I6(o){o.preventDefault(),o.stopImmediatePropagation()}function k8e(o){return(!o.ctrlKey||o.type==="wheel")&&!o.button}function T8e(){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 Ole(){return this.__zoom||v4}function A8e(o){return-o.deltaY*(o.deltaMode===1?.05:o.deltaMode?1:.002)*(o.ctrlKey?10:1)}function N8e(){return navigator.maxTouchPoints||"ontouchstart"in this}function O8e(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 $8e(){var o=k8e,s=T8e,i=O8e,u=A8e,m=N8e,h=[0,1/0],b=[[-1/0,-1/0],[1/0,1/0]],C=250,S=mPe,_=IU("start","zoom","end"),N,O,R,I=500,W=150,G=0,Q=10;function q(he){he.property("__zoom",Ole).on("wheel.zoom",Fe,{passive:!1}).on("mousedown.zoom",it).on("dblclick.zoom",rt).filter(m).on("touchstart.zoom",De).on("touchmove.zoom",ce).on("touchend.zoom touchcancel.zoom",zt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}q.transform=function(he,Ee,M,Ze){var ye=he.selection?he.selection():he;ye.property("__zoom",Ole),he!==ye?Ve(he,Ee,M,Ze):ye.interrupt().each(function(){Se(this,arguments).event(Ze).start().zoom(null,typeof Ee=="function"?Ee.apply(this,arguments):Ee).end()})},q.scaleBy=function(he,Ee,M,Ze){q.scaleTo(he,function(){var ye=this.__zoom.k,at=typeof Ee=="function"?Ee.apply(this,arguments):Ee;return ye*at},M,Ze)},q.scaleTo=function(he,Ee,M,Ze){q.transform(he,function(){var ye=s.apply(this,arguments),at=this.__zoom,st=M==null?de(ye):typeof M=="function"?M.apply(this,arguments):M,ge=at.invert(st),Ke=typeof Ee=="function"?Ee.apply(this,arguments):Ee;return i(L(Z(at,Ke),st,ge),ye,b)},M,Ze)},q.translateBy=function(he,Ee,M,Ze){q.transform(he,function(){return i(this.__zoom.translate(typeof Ee=="function"?Ee.apply(this,arguments):Ee,typeof M=="function"?M.apply(this,arguments):M),s.apply(this,arguments),b)},null,Ze)},q.translateTo=function(he,Ee,M,Ze,ye){q.transform(he,function(){var at=s.apply(this,arguments),st=this.__zoom,ge=Ze==null?de(at):typeof Ze=="function"?Ze.apply(this,arguments):Ze;return i(v4.translate(ge[0],ge[1]).scale(st.k).translate(typeof Ee=="function"?-Ee.apply(this,arguments):-Ee,typeof M=="function"?-M.apply(this,arguments):-M),at,b)},Ze,ye)};function Z(he,Ee){return Ee=Math.max(h[0],Math.min(h[1],Ee)),Ee===he.k?he:new I0(Ee,he.x,he.y)}function L(he,Ee,M){var Ze=Ee[0]-M[0]*he.k,ye=Ee[1]-M[1]*he.k;return Ze===he.x&&ye===he.y?he:new I0(he.k,Ze,ye)}function de(he){return[(+he[0][0]+ +he[1][0])/2,(+he[0][1]+ +he[1][1])/2]}function Ve(he,Ee,M,Ze){he.on("start.zoom",function(){Se(this,arguments).event(Ze).start()}).on("interrupt.zoom end.zoom",function(){Se(this,arguments).event(Ze).end()}).tween("zoom",function(){var ye=this,at=arguments,st=Se(ye,at).event(Ze),ge=s.apply(ye,at),Ke=M==null?de(ge):typeof M=="function"?M.apply(ye,at):M,$t=Math.max(ge[1][0]-ge[0][0],ge[1][1]-ge[0][1]),Ue=ye.__zoom,ht=typeof Ee=="function"?Ee.apply(ye,at):Ee,Pe=S(Ue.invert(Ke).concat($t/Ue.k),ht.invert(Ke).concat($t/ht.k));return function(mt){if(mt===1)mt=ht;else{var oe=Pe(mt),vn=$t/oe[2];mt=new I0(vn,Ke[0]-oe[0]*vn,Ke[1]-oe[1]*vn)}st.zoom(null,mt)}})}function Se(he,Ee,M){return!M&&he.__zooming||new J(he,Ee)}function J(he,Ee){this.that=he,this.args=Ee,this.active=0,this.sourceEvent=null,this.extent=s.apply(he,Ee),this.taps=0}J.prototype={event:function(he){return he&&(this.sourceEvent=he),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(he,Ee){return this.mouse&&he!=="mouse"&&(this.mouse[1]=Ee.invert(this.mouse[0])),this.touch0&&he!=="touch"&&(this.touch0[1]=Ee.invert(this.touch0[0])),this.touch1&&he!=="touch"&&(this.touch1[1]=Ee.invert(this.touch1[0])),this.that.__zoom=Ee,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(he){var Ee=Mh(this.that).datum();_.call(he,this.that,new _8e(he,{sourceEvent:this.sourceEvent,target:q,type:he,transform:this.that.__zoom,dispatch:_}),Ee)}};function Fe(he,...Ee){if(!o.apply(this,arguments))return;var M=Se(this,Ee).event(he),Ze=this.__zoom,ye=Math.max(h[0],Math.min(h[1],Ze.k*Math.pow(2,u.apply(this,arguments)))),at=Ov(he);if(M.wheel)(M.mouse[0][0]!==at[0]||M.mouse[0][1]!==at[1])&&(M.mouse[1]=Ze.invert(M.mouse[0]=at)),clearTimeout(M.wheel);else{if(Ze.k===ye)return;M.mouse=[at,Ze.invert(at)],uz(this),M.start()}I6(he),M.wheel=setTimeout(st,W),M.zoom("mouse",i(L(Z(Ze,ye),M.mouse[0],M.mouse[1]),M.extent,b));function st(){M.wheel=null,M.end()}}function it(he,...Ee){if(R||!o.apply(this,arguments))return;var M=he.currentTarget,Ze=Se(this,Ee,!0).event(he),ye=Mh(he.view).on("mousemove.zoom",Ke,!0).on("mouseup.zoom",$t,!0),at=Ov(he,M),st=he.clientX,ge=he.clientY;sme(he.view),Cte(he),Ze.mouse=[at,this.__zoom.invert(at)],uz(this),Ze.start();function Ke(Ue){if(I6(Ue),!Ze.moved){var ht=Ue.clientX-st,Pe=Ue.clientY-ge;Ze.moved=ht*ht+Pe*Pe>G}Ze.event(Ue).zoom("mouse",i(L(Ze.that.__zoom,Ze.mouse[0]=Ov(Ue,M),Ze.mouse[1]),Ze.extent,b))}function $t(Ue){ye.on("mousemove.zoom mouseup.zoom",null),rme(Ue.view,Ze.moved),I6(Ue),Ze.event(Ue).end()}}function rt(he,...Ee){if(o.apply(this,arguments)){var M=this.__zoom,Ze=Ov(he.changedTouches?he.changedTouches[0]:he,this),ye=M.invert(Ze),at=M.k*(he.shiftKey?.5:2),st=i(L(Z(M,at),Ze,ye),s.apply(this,Ee),b);I6(he),C>0?Mh(this).transition().duration(C).call(Ve,st,Ze,he):Mh(this).call(q.transform,st,Ze,he)}}function De(he,...Ee){if(o.apply(this,arguments)){var M=he.touches,Ze=M.length,ye=Se(this,Ee,he.changedTouches.length===Ze).event(he),at,st,ge,Ke;for(Cte(he),st=0;st<Ze;++st)ge=M[st],Ke=Ov(ge,this),Ke=[Ke,this.__zoom.invert(Ke),ge.identifier],ye.touch0?!ye.touch1&&ye.touch0[2]!==Ke[2]&&(ye.touch1=Ke,ye.taps=0):(ye.touch0=Ke,at=!0,ye.taps=1+!!N);N&&(N=clearTimeout(N)),at&&(ye.taps<2&&(O=Ke[0],N=setTimeout(function(){N=null},I)),uz(this),ye.start())}}function ce(he,...Ee){if(this.__zooming){var M=Se(this,Ee).event(he),Ze=he.changedTouches,ye=Ze.length,at,st,ge,Ke;for(I6(he),at=0;at<ye;++at)st=Ze[at],ge=Ov(st,this),M.touch0&&M.touch0[2]===st.identifier?M.touch0[0]=ge:M.touch1&&M.touch1[2]===st.identifier&&(M.touch1[0]=ge);if(st=M.that.__zoom,M.touch1){var $t=M.touch0[0],Ue=M.touch0[1],ht=M.touch1[0],Pe=M.touch1[1],mt=(mt=ht[0]-$t[0])*mt+(mt=ht[1]-$t[1])*mt,oe=(oe=Pe[0]-Ue[0])*oe+(oe=Pe[1]-Ue[1])*oe;st=Z(st,Math.sqrt(mt/oe)),ge=[($t[0]+ht[0])/2,($t[1]+ht[1])/2],Ke=[(Ue[0]+Pe[0])/2,(Ue[1]+Pe[1])/2]}else if(M.touch0)ge=M.touch0[0],Ke=M.touch0[1];else return;M.zoom("touch",i(L(st,ge,Ke),M.extent,b))}}function zt(he,...Ee){if(this.__zooming){var M=Se(this,Ee).event(he),Ze=he.changedTouches,ye=Ze.length,at,st;for(Cte(he),R&&clearTimeout(R),R=setTimeout(function(){R=null},I),at=0;at<ye;++at)st=Ze[at],M.touch0&&M.touch0[2]===st.identifier?delete M.touch0:M.touch1&&M.touch1[2]===st.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(st=Ov(st,this),Math.hypot(O[0]-st[0],O[1]-st[1])<Q)){var ge=Mh(this).on("dblclick.zoom");ge&&ge.apply(this,arguments)}}}return q.wheelDelta=function(he){return arguments.length?(u=typeof he=="function"?he:VH(+he),q):u},q.filter=function(he){return arguments.length?(o=typeof he=="function"?he:VH(!!he),q):o},q.touchable=function(he){return arguments.length?(m=typeof he=="function"?he:VH(!!he),q):m},q.extent=function(he){return arguments.length?(s=typeof he=="function"?he:VH([[+he[0][0],+he[0][1]],[+he[1][0],+he[1][1]]]),q):s},q.scaleExtent=function(he){return arguments.length?(h[0]=+he[0],h[1]=+he[1],q):[h[0],h[1]]},q.translateExtent=function(he){return arguments.length?(b[0][0]=+he[0][0],b[1][0]=+he[1][0],b[0][1]=+he[0][1],b[1][1]=+he[1][1],q):[[b[0][0],b[0][1]],[b[1][0],b[1][1]]]},q.constrain=function(he){return arguments.length?(i=he,q):i},q.duration=function(he){return arguments.length?(C=+he,q):C},q.interpolate=function(he){return arguments.length?(S=he,q):S},q.on=function(){var he=_.on.apply(_,arguments);return he===_?q:he},q.clickDistance=function(he){return arguments.length?(G=(he=+he)*he,q):Math.sqrt(G)},q.tapDistance=function(he){return arguments.length?(Q=+he,q):Q},q}var is=(o=>(o.Left="left",o.Top="top",o.Right="right",o.Bottom="bottom",o))(is||{}),Woe=(o=>(o.Partial="partial",o.Full="full",o))(Woe||{}),mE=(o=>(o.Bezier="default",o.SimpleBezier="simple-bezier",o.Straight="straight",o.Step="step",o.SmoothStep="smoothstep",o))(mE||{}),b2=(o=>(o.Strict="strict",o.Loose="loose",o))(b2||{}),zz=(o=>(o.Arrow="arrow",o.ArrowClosed="arrowclosed",o))(zz||{}),K6=(o=>(o.Free="free",o.Vertical="vertical",o.Horizontal="horizontal",o))(K6||{}),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 D8e=["INPUT","SELECT","TEXTAREA"];function Dne(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 D8e.includes(u==null?void 0:u.nodeName)||m||!!h}function M8e(o){return o.ctrlKey||o.metaKey||o.shiftKey||o.altKey}function $le(o,s,i,u){const m=s.replace("+",`
127
127
  `).replace(`
128
128
 
129
129
  `,`