@zyui/components 0.0.59 → 0.0.61

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.
Files changed (3) hide show
  1. package/es/index.js +2 -2
  2. package/es/index.mjs +421 -421
  3. package/package.json +1 -1
package/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Dge=Object.defineProperty;var Mge=(o,s,i)=>s in o?Dge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i;var zc=(o,s,i)=>Mge(o,typeof s!="symbol"?s+"":s,i);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("vue"),Mn=require("element-plus"),Rge="0.0.59";var Bge=Object.defineProperty,Ige=(o,s,i)=>s in o?Bge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i,_ee=(o,s,i)=>Ige(o,typeof s!="symbol"?s+"":s,i);function Sce(o,s){return function(){return o.apply(s,arguments)}}const{toString:Pge}=Object.prototype,{getPrototypeOf:Dne}=Object,Wz=(o=>s=>{const i=Pge.call(s);return o[i]||(o[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Rh=o=>(o=o.toLowerCase(),s=>Wz(s)===o),Zz=o=>s=>typeof s===o,{isArray:v4}=Array,X6=Zz("undefined");function Fge(o){return o!==null&&!X6(o)&&o.constructor!==null&&!X6(o.constructor)&&yp(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const xce=Rh("ArrayBuffer");function Lge(o){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(o):s=o&&o.buffer&&xce(o.buffer),s}const Vge=Zz("string"),yp=Zz("function"),Ece=Zz("number"),Gz=o=>o!==null&&typeof o=="object",Hge=o=>o===!0||o===!1,zH=o=>{if(Wz(o)!=="object")return!1;const s=Dne(o);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)},zge=Rh("Date"),Uge=Rh("File"),jge=Rh("Blob"),Wge=Rh("FileList"),Zge=o=>Gz(o)&&yp(o.pipe),Gge=o=>{let s;return o&&(typeof FormData=="function"&&o instanceof FormData||yp(o.append)&&((s=Wz(o))==="formdata"||s==="object"&&yp(o.toString)&&o.toString()==="[object FormData]"))},qge=Rh("URLSearchParams"),[Yge,Kge,Xge,Jge]=["ReadableStream","Request","Response","Headers"].map(Rh),Qge=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function uR(o,s,{allOwnKeys:i=!1}={}){if(o===null||typeof o>"u")return;let u,m;if(typeof o!="object"&&(o=[o]),v4(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 _ce(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 iE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,kce=o=>!X6(o)&&o!==iE;function Mte(){const{caseless:o}=kce(this)&&this||{},s={},i=(u,m)=>{const h=o&&_ce(s,m)||m;zH(s[h])&&zH(u)?s[h]=Mte(s[h],u):zH(u)?s[h]=Mte({},u):v4(u)?s[h]=u.slice():s[h]=u};for(let u=0,m=arguments.length;u<m;u++)arguments[u]&&uR(arguments[u],i);return s}const ehe=(o,s,i,{allOwnKeys:u}={})=>(uR(s,(m,h)=>{i&&yp(m)?o[h]=Sce(m,i):o[h]=m},{allOwnKeys:u}),o),the=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),nhe=(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)},ohe=(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&&Dne(o)}while(o&&(!i||i(o,s))&&o!==Object.prototype);return s},she=(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},rhe=o=>{if(!o)return null;if(v4(o))return o;let s=o.length;if(!Ece(s))return null;const i=new Array(s);for(;s-- >0;)i[s]=o[s];return i},ahe=(o=>s=>o&&s instanceof o)(typeof Uint8Array<"u"&&Dne(Uint8Array)),ihe=(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])}},lhe=(o,s)=>{let i;const u=[];for(;(i=o.exec(s))!==null;)u.push(i);return u},che=Rh("HTMLFormElement"),uhe=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,i,u){return i.toUpperCase()+u}),Tre=(({hasOwnProperty:o})=>(s,i)=>o.call(s,i))(Object.prototype),dhe=Rh("RegExp"),Tce=(o,s)=>{const i=Object.getOwnPropertyDescriptors(o),u={};uR(i,(m,h)=>{let b;(b=s(m,h,o))!==!1&&(u[h]=b||m)}),Object.defineProperties(o,u)},fhe=o=>{Tce(o,(s,i)=>{if(yp(o)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const u=o[i];if(yp(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+"'")})}})},mhe=(o,s)=>{const i={},u=m=>{m.forEach(h=>{i[h]=!0})};return v4(o)?u(o):u(String(o).split(s)),i},phe=()=>{},ghe=(o,s)=>o!=null&&Number.isFinite(o=+o)?o:s,kee="abcdefghijklmnopqrstuvwxyz",Are="0123456789",Ace={DIGIT:Are,ALPHA:kee,ALPHA_DIGIT:kee+kee.toUpperCase()+Are},hhe=(o=16,s=Ace.ALPHA_DIGIT)=>{let i="";const{length:u}=s;for(;o--;)i+=s[Math.random()*u|0];return i};function vhe(o){return!!(o&&yp(o.append)&&o[Symbol.toStringTag]==="FormData"&&o[Symbol.iterator])}const bhe=o=>{const s=new Array(10),i=(u,m)=>{if(Gz(u)){if(s.indexOf(u)>=0)return;if(!("toJSON"in u)){s[m]=u;const h=v4(u)?[]:{};return uR(u,(b,C)=>{const x=i(b,m+1);!X6(x)&&(h[C]=x)}),s[m]=void 0,h}}return u};return i(o,0)},yhe=Rh("AsyncFunction"),whe=o=>o&&(Gz(o)||yp(o))&&yp(o.then)&&yp(o.catch),Nce=((o,s)=>o?setImmediate:s?((i,u)=>(iE.addEventListener("message",({source:m,data:h})=>{m===iE&&h===i&&u.length&&u.shift()()},!1),m=>{u.push(m),iE.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",yp(iE.postMessage)),Che=typeof queueMicrotask<"u"?queueMicrotask.bind(iE):typeof process<"u"&&process.nextTick||Nce,Rn={isArray:v4,isArrayBuffer:xce,isBuffer:Fge,isFormData:Gge,isArrayBufferView:Lge,isString:Vge,isNumber:Ece,isBoolean:Hge,isObject:Gz,isPlainObject:zH,isReadableStream:Yge,isRequest:Kge,isResponse:Xge,isHeaders:Jge,isUndefined:X6,isDate:zge,isFile:Uge,isBlob:jge,isRegExp:dhe,isFunction:yp,isStream:Zge,isURLSearchParams:qge,isTypedArray:ahe,isFileList:Wge,forEach:uR,merge:Mte,extend:ehe,trim:Qge,stripBOM:the,inherits:nhe,toFlatObject:ohe,kindOf:Wz,kindOfTest:Rh,endsWith:she,toArray:rhe,forEachEntry:ihe,matchAll:lhe,isHTMLForm:che,hasOwnProperty:Tre,hasOwnProp:Tre,reduceDescriptors:Tce,freezeMethods:fhe,toObjectSet:mhe,toCamelCase:uhe,noop:phe,toFiniteNumber:ghe,findKey:_ce,global:iE,isContextDefined:kce,ALPHABET:Ace,generateString:hhe,isSpecCompliantForm:vhe,toJSONObject:bhe,isAsyncFn:yhe,isThenable:whe,setImmediate:Nce,asap:Che};function Er(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)}Rn.inherits(Er,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:Rn.toJSONObject(this.config),code:this.code,status:this.status}}});const Oce=Er.prototype,$ce={};["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=>{$ce[o]={value:o}});Object.defineProperties(Er,$ce);Object.defineProperty(Oce,"isAxiosError",{value:!0});Er.from=(o,s,i,u,m,h)=>{const b=Object.create(Oce);return Rn.toFlatObject(o,b,function(C){return C!==Error.prototype},C=>C!=="isAxiosError"),Er.call(b,o.message,s,i,u,m),b.cause=o,b.name=o.name,h&&Object.assign(b,h),b};const She=null;function Rte(o){return Rn.isPlainObject(o)||Rn.isArray(o)}function Dce(o){return Rn.endsWith(o,"[]")?o.slice(0,-2):o}function Nre(o,s,i){return o?o.concat(s).map(function(u,m){return u=Dce(u),!i&&m?"["+u+"]":u}).join(i?".":""):s}function xhe(o){return Rn.isArray(o)&&!o.some(Rte)}const Ehe=Rn.toFlatObject(Rn,{},null,function(o){return/^is[A-Z]/.test(o)});function qz(o,s,i){if(!Rn.isObject(o))throw new TypeError("target must be an object");s=s||new FormData,i=Rn.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(H,Z){return!Rn.isUndefined(Z[H])});const u=i.metaTokens,m=i.visitor||_,h=i.dots,b=i.indexes,C=(i.Blob||typeof Blob<"u"&&Blob)&&Rn.isSpecCompliantForm(s);if(!Rn.isFunction(m))throw new TypeError("visitor must be a function");function x(H){if(H===null)return"";if(Rn.isDate(H))return H.toISOString();if(!C&&Rn.isBlob(H))throw new Er("Blob is not supported. Use a Buffer instead.");return Rn.isArrayBuffer(H)||Rn.isTypedArray(H)?C&&typeof Blob=="function"?new Blob([H]):Buffer.from(H):H}function _(H,Z,J){let K=H;if(H&&!J&&typeof H=="object"){if(Rn.endsWith(Z,"{}"))Z=u?Z:Z.slice(0,-2),H=JSON.stringify(H);else if(Rn.isArray(H)&&xhe(H)||(Rn.isFileList(H)||Rn.endsWith(Z,"[]"))&&(K=Rn.toArray(H)))return Z=Dce(Z),K.forEach(function(G,W){!(Rn.isUndefined(G)||G===null)&&s.append(b===!0?Nre([Z],W,h):b===null?Z:Z+"[]",x(G))}),!1}return Rte(H)?!0:(s.append(Nre(J,Z,h),x(H)),!1)}const N=[],O=Object.assign(Ehe,{defaultVisitor:_,convertValue:x,isVisitable:Rte});function B(H,Z){if(!Rn.isUndefined(H)){if(N.indexOf(H)!==-1)throw Error("Circular reference detected in "+Z.join("."));N.push(H),Rn.forEach(H,function(J,K){(!(Rn.isUndefined(J)||J===null)&&m.call(s,J,Rn.isString(K)?K.trim():K,Z,O))===!0&&B(J,Z?Z.concat(K):[K])}),N.pop()}}if(!Rn.isObject(o))throw new TypeError("data must be an object");return B(o),s}function Ore(o){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(i){return s[i]})}function Mne(o,s){this._pairs=[],o&&qz(o,this,s)}const Mce=Mne.prototype;Mce.append=function(o,s){this._pairs.push([o,s])};Mce.toString=function(o){const s=o?function(i){return o.call(this,i,Ore)}:Ore;return this._pairs.map(function(i){return s(i[0])+"="+s(i[1])},"").join("&")};function _he(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Rce(o,s,i){if(!s)return o;const u=i&&i.encode||_he;Rn.isFunction(i)&&(i={serialize:i});const m=i&&i.serialize;let h;if(m?h=m(s,i):h=Rn.isURLSearchParams(s)?s.toString():new Mne(s,i).toString(u),h){const b=o.indexOf("#");b!==-1&&(o=o.slice(0,b)),o+=(o.indexOf("?")===-1?"?":"&")+h}return o}let $re=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){Rn.forEach(this.handlers,function(i){i!==null&&s(i)})}};const Bce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},khe=typeof URLSearchParams<"u"?URLSearchParams:Mne,The=typeof FormData<"u"?FormData:null,Ahe=typeof Blob<"u"?Blob:null,Nhe={isBrowser:!0,classes:{URLSearchParams:khe,FormData:The,Blob:Ahe},protocols:["http","https","file","blob","url","data"]},Rne=typeof window<"u"&&typeof document<"u",Bte=typeof navigator=="object"&&navigator||void 0,Ohe=Rne&&(!Bte||["ReactNative","NativeScript","NS"].indexOf(Bte.product)<0),$he=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Dhe=Rne&&window.location.href||"http://localhost",Mhe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Rne,hasStandardBrowserEnv:Ohe,hasStandardBrowserWebWorkerEnv:$he,navigator:Bte,origin:Dhe},Symbol.toStringTag,{value:"Module"})),Kd={...Mhe,...Nhe};function Rhe(o,s){return qz(o,new Kd.classes.URLSearchParams,Object.assign({visitor:function(i,u,m,h){return Kd.isNode&&Rn.isBuffer(i)?(this.append(u,i.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)}},s))}function Bhe(o){return Rn.matchAll(/\w+|\[(\w*)]/g,o).map(s=>s[0]==="[]"?"":s[1]||s[0])}function Ihe(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 Ice(o){function s(i,u,m,h){let b=i[h++];if(b==="__proto__")return!0;const C=Number.isFinite(+b),x=h>=i.length;return b=!b&&Rn.isArray(m)?m.length:b,x?(Rn.hasOwnProp(m,b)?m[b]=[m[b],u]:m[b]=u,!C):((!m[b]||!Rn.isObject(m[b]))&&(m[b]=[]),s(i,u,m[b],h)&&Rn.isArray(m[b])&&(m[b]=Ihe(m[b])),!C)}if(Rn.isFormData(o)&&Rn.isFunction(o.entries)){const i={};return Rn.forEachEntry(o,(u,m)=>{s(Bhe(u),m,i,0)}),i}return null}function Phe(o,s,i){if(Rn.isString(o))try{return(s||JSON.parse)(o),Rn.trim(o)}catch(u){if(u.name!=="SyntaxError")throw u}return(0,JSON.stringify)(o)}const dR={transitional:Bce,adapter:["xhr","http","fetch"],transformRequest:[function(o,s){const i=s.getContentType()||"",u=i.indexOf("application/json")>-1,m=Rn.isObject(o);if(m&&Rn.isHTMLForm(o)&&(o=new FormData(o)),Rn.isFormData(o))return u?JSON.stringify(Ice(o)):o;if(Rn.isArrayBuffer(o)||Rn.isBuffer(o)||Rn.isStream(o)||Rn.isFile(o)||Rn.isBlob(o)||Rn.isReadableStream(o))return o;if(Rn.isArrayBufferView(o))return o.buffer;if(Rn.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 Rhe(o,this.formSerializer).toString();if((h=Rn.isFileList(o))||i.indexOf("multipart/form-data")>-1){const b=this.env&&this.env.FormData;return qz(h?{"files[]":o}:o,b&&new b,this.formSerializer)}}return m||u?(s.setContentType("application/json",!1),Phe(o)):o}],transformResponse:[function(o){const s=this.transitional||dR.transitional,i=s&&s.forcedJSONParsing,u=this.responseType==="json";if(Rn.isResponse(o)||Rn.isReadableStream(o))return o;if(o&&Rn.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"?Er.from(h,Er.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}}};Rn.forEach(["delete","get","head","post","put","patch"],o=>{dR.headers[o]={}});const Fhe=Rn.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"]),Lhe=o=>{const s={};let i,u,m;return o&&o.split(`
1
+ "use strict";var Dge=Object.defineProperty;var Mge=(o,s,i)=>s in o?Dge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i;var zc=(o,s,i)=>Mge(o,typeof s!="symbol"?s+"":s,i);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("vue"),Mn=require("element-plus"),Rge="0.0.61";var Bge=Object.defineProperty,Ige=(o,s,i)=>s in o?Bge(o,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[s]=i,_ee=(o,s,i)=>Ige(o,typeof s!="symbol"?s+"":s,i);function Sce(o,s){return function(){return o.apply(s,arguments)}}const{toString:Pge}=Object.prototype,{getPrototypeOf:Dne}=Object,Wz=(o=>s=>{const i=Pge.call(s);return o[i]||(o[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Rh=o=>(o=o.toLowerCase(),s=>Wz(s)===o),Zz=o=>s=>typeof s===o,{isArray:v4}=Array,X6=Zz("undefined");function Fge(o){return o!==null&&!X6(o)&&o.constructor!==null&&!X6(o.constructor)&&yp(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const xce=Rh("ArrayBuffer");function Lge(o){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(o):s=o&&o.buffer&&xce(o.buffer),s}const Vge=Zz("string"),yp=Zz("function"),Ece=Zz("number"),Gz=o=>o!==null&&typeof o=="object",Hge=o=>o===!0||o===!1,zH=o=>{if(Wz(o)!=="object")return!1;const s=Dne(o);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)},zge=Rh("Date"),Uge=Rh("File"),jge=Rh("Blob"),Wge=Rh("FileList"),Zge=o=>Gz(o)&&yp(o.pipe),Gge=o=>{let s;return o&&(typeof FormData=="function"&&o instanceof FormData||yp(o.append)&&((s=Wz(o))==="formdata"||s==="object"&&yp(o.toString)&&o.toString()==="[object FormData]"))},qge=Rh("URLSearchParams"),[Yge,Kge,Xge,Jge]=["ReadableStream","Request","Response","Headers"].map(Rh),Qge=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function uR(o,s,{allOwnKeys:i=!1}={}){if(o===null||typeof o>"u")return;let u,m;if(typeof o!="object"&&(o=[o]),v4(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 _ce(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 iE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,kce=o=>!X6(o)&&o!==iE;function Mte(){const{caseless:o}=kce(this)&&this||{},s={},i=(u,m)=>{const h=o&&_ce(s,m)||m;zH(s[h])&&zH(u)?s[h]=Mte(s[h],u):zH(u)?s[h]=Mte({},u):v4(u)?s[h]=u.slice():s[h]=u};for(let u=0,m=arguments.length;u<m;u++)arguments[u]&&uR(arguments[u],i);return s}const ehe=(o,s,i,{allOwnKeys:u}={})=>(uR(s,(m,h)=>{i&&yp(m)?o[h]=Sce(m,i):o[h]=m},{allOwnKeys:u}),o),the=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),nhe=(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)},ohe=(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&&Dne(o)}while(o&&(!i||i(o,s))&&o!==Object.prototype);return s},she=(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},rhe=o=>{if(!o)return null;if(v4(o))return o;let s=o.length;if(!Ece(s))return null;const i=new Array(s);for(;s-- >0;)i[s]=o[s];return i},ahe=(o=>s=>o&&s instanceof o)(typeof Uint8Array<"u"&&Dne(Uint8Array)),ihe=(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])}},lhe=(o,s)=>{let i;const u=[];for(;(i=o.exec(s))!==null;)u.push(i);return u},che=Rh("HTMLFormElement"),uhe=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,i,u){return i.toUpperCase()+u}),Tre=(({hasOwnProperty:o})=>(s,i)=>o.call(s,i))(Object.prototype),dhe=Rh("RegExp"),Tce=(o,s)=>{const i=Object.getOwnPropertyDescriptors(o),u={};uR(i,(m,h)=>{let b;(b=s(m,h,o))!==!1&&(u[h]=b||m)}),Object.defineProperties(o,u)},fhe=o=>{Tce(o,(s,i)=>{if(yp(o)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const u=o[i];if(yp(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+"'")})}})},mhe=(o,s)=>{const i={},u=m=>{m.forEach(h=>{i[h]=!0})};return v4(o)?u(o):u(String(o).split(s)),i},phe=()=>{},ghe=(o,s)=>o!=null&&Number.isFinite(o=+o)?o:s,kee="abcdefghijklmnopqrstuvwxyz",Are="0123456789",Ace={DIGIT:Are,ALPHA:kee,ALPHA_DIGIT:kee+kee.toUpperCase()+Are},hhe=(o=16,s=Ace.ALPHA_DIGIT)=>{let i="";const{length:u}=s;for(;o--;)i+=s[Math.random()*u|0];return i};function vhe(o){return!!(o&&yp(o.append)&&o[Symbol.toStringTag]==="FormData"&&o[Symbol.iterator])}const bhe=o=>{const s=new Array(10),i=(u,m)=>{if(Gz(u)){if(s.indexOf(u)>=0)return;if(!("toJSON"in u)){s[m]=u;const h=v4(u)?[]:{};return uR(u,(b,C)=>{const x=i(b,m+1);!X6(x)&&(h[C]=x)}),s[m]=void 0,h}}return u};return i(o,0)},yhe=Rh("AsyncFunction"),whe=o=>o&&(Gz(o)||yp(o))&&yp(o.then)&&yp(o.catch),Nce=((o,s)=>o?setImmediate:s?((i,u)=>(iE.addEventListener("message",({source:m,data:h})=>{m===iE&&h===i&&u.length&&u.shift()()},!1),m=>{u.push(m),iE.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",yp(iE.postMessage)),Che=typeof queueMicrotask<"u"?queueMicrotask.bind(iE):typeof process<"u"&&process.nextTick||Nce,Rn={isArray:v4,isArrayBuffer:xce,isBuffer:Fge,isFormData:Gge,isArrayBufferView:Lge,isString:Vge,isNumber:Ece,isBoolean:Hge,isObject:Gz,isPlainObject:zH,isReadableStream:Yge,isRequest:Kge,isResponse:Xge,isHeaders:Jge,isUndefined:X6,isDate:zge,isFile:Uge,isBlob:jge,isRegExp:dhe,isFunction:yp,isStream:Zge,isURLSearchParams:qge,isTypedArray:ahe,isFileList:Wge,forEach:uR,merge:Mte,extend:ehe,trim:Qge,stripBOM:the,inherits:nhe,toFlatObject:ohe,kindOf:Wz,kindOfTest:Rh,endsWith:she,toArray:rhe,forEachEntry:ihe,matchAll:lhe,isHTMLForm:che,hasOwnProperty:Tre,hasOwnProp:Tre,reduceDescriptors:Tce,freezeMethods:fhe,toObjectSet:mhe,toCamelCase:uhe,noop:phe,toFiniteNumber:ghe,findKey:_ce,global:iE,isContextDefined:kce,ALPHABET:Ace,generateString:hhe,isSpecCompliantForm:vhe,toJSONObject:bhe,isAsyncFn:yhe,isThenable:whe,setImmediate:Nce,asap:Che};function Er(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)}Rn.inherits(Er,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:Rn.toJSONObject(this.config),code:this.code,status:this.status}}});const Oce=Er.prototype,$ce={};["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=>{$ce[o]={value:o}});Object.defineProperties(Er,$ce);Object.defineProperty(Oce,"isAxiosError",{value:!0});Er.from=(o,s,i,u,m,h)=>{const b=Object.create(Oce);return Rn.toFlatObject(o,b,function(C){return C!==Error.prototype},C=>C!=="isAxiosError"),Er.call(b,o.message,s,i,u,m),b.cause=o,b.name=o.name,h&&Object.assign(b,h),b};const She=null;function Rte(o){return Rn.isPlainObject(o)||Rn.isArray(o)}function Dce(o){return Rn.endsWith(o,"[]")?o.slice(0,-2):o}function Nre(o,s,i){return o?o.concat(s).map(function(u,m){return u=Dce(u),!i&&m?"["+u+"]":u}).join(i?".":""):s}function xhe(o){return Rn.isArray(o)&&!o.some(Rte)}const Ehe=Rn.toFlatObject(Rn,{},null,function(o){return/^is[A-Z]/.test(o)});function qz(o,s,i){if(!Rn.isObject(o))throw new TypeError("target must be an object");s=s||new FormData,i=Rn.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(H,Z){return!Rn.isUndefined(Z[H])});const u=i.metaTokens,m=i.visitor||_,h=i.dots,b=i.indexes,C=(i.Blob||typeof Blob<"u"&&Blob)&&Rn.isSpecCompliantForm(s);if(!Rn.isFunction(m))throw new TypeError("visitor must be a function");function x(H){if(H===null)return"";if(Rn.isDate(H))return H.toISOString();if(!C&&Rn.isBlob(H))throw new Er("Blob is not supported. Use a Buffer instead.");return Rn.isArrayBuffer(H)||Rn.isTypedArray(H)?C&&typeof Blob=="function"?new Blob([H]):Buffer.from(H):H}function _(H,Z,J){let K=H;if(H&&!J&&typeof H=="object"){if(Rn.endsWith(Z,"{}"))Z=u?Z:Z.slice(0,-2),H=JSON.stringify(H);else if(Rn.isArray(H)&&xhe(H)||(Rn.isFileList(H)||Rn.endsWith(Z,"[]"))&&(K=Rn.toArray(H)))return Z=Dce(Z),K.forEach(function(G,W){!(Rn.isUndefined(G)||G===null)&&s.append(b===!0?Nre([Z],W,h):b===null?Z:Z+"[]",x(G))}),!1}return Rte(H)?!0:(s.append(Nre(J,Z,h),x(H)),!1)}const N=[],O=Object.assign(Ehe,{defaultVisitor:_,convertValue:x,isVisitable:Rte});function B(H,Z){if(!Rn.isUndefined(H)){if(N.indexOf(H)!==-1)throw Error("Circular reference detected in "+Z.join("."));N.push(H),Rn.forEach(H,function(J,K){(!(Rn.isUndefined(J)||J===null)&&m.call(s,J,Rn.isString(K)?K.trim():K,Z,O))===!0&&B(J,Z?Z.concat(K):[K])}),N.pop()}}if(!Rn.isObject(o))throw new TypeError("data must be an object");return B(o),s}function Ore(o){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(i){return s[i]})}function Mne(o,s){this._pairs=[],o&&qz(o,this,s)}const Mce=Mne.prototype;Mce.append=function(o,s){this._pairs.push([o,s])};Mce.toString=function(o){const s=o?function(i){return o.call(this,i,Ore)}:Ore;return this._pairs.map(function(i){return s(i[0])+"="+s(i[1])},"").join("&")};function _he(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Rce(o,s,i){if(!s)return o;const u=i&&i.encode||_he;Rn.isFunction(i)&&(i={serialize:i});const m=i&&i.serialize;let h;if(m?h=m(s,i):h=Rn.isURLSearchParams(s)?s.toString():new Mne(s,i).toString(u),h){const b=o.indexOf("#");b!==-1&&(o=o.slice(0,b)),o+=(o.indexOf("?")===-1?"?":"&")+h}return o}let $re=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){Rn.forEach(this.handlers,function(i){i!==null&&s(i)})}};const Bce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},khe=typeof URLSearchParams<"u"?URLSearchParams:Mne,The=typeof FormData<"u"?FormData:null,Ahe=typeof Blob<"u"?Blob:null,Nhe={isBrowser:!0,classes:{URLSearchParams:khe,FormData:The,Blob:Ahe},protocols:["http","https","file","blob","url","data"]},Rne=typeof window<"u"&&typeof document<"u",Bte=typeof navigator=="object"&&navigator||void 0,Ohe=Rne&&(!Bte||["ReactNative","NativeScript","NS"].indexOf(Bte.product)<0),$he=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Dhe=Rne&&window.location.href||"http://localhost",Mhe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Rne,hasStandardBrowserEnv:Ohe,hasStandardBrowserWebWorkerEnv:$he,navigator:Bte,origin:Dhe},Symbol.toStringTag,{value:"Module"})),Kd={...Mhe,...Nhe};function Rhe(o,s){return qz(o,new Kd.classes.URLSearchParams,Object.assign({visitor:function(i,u,m,h){return Kd.isNode&&Rn.isBuffer(i)?(this.append(u,i.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)}},s))}function Bhe(o){return Rn.matchAll(/\w+|\[(\w*)]/g,o).map(s=>s[0]==="[]"?"":s[1]||s[0])}function Ihe(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 Ice(o){function s(i,u,m,h){let b=i[h++];if(b==="__proto__")return!0;const C=Number.isFinite(+b),x=h>=i.length;return b=!b&&Rn.isArray(m)?m.length:b,x?(Rn.hasOwnProp(m,b)?m[b]=[m[b],u]:m[b]=u,!C):((!m[b]||!Rn.isObject(m[b]))&&(m[b]=[]),s(i,u,m[b],h)&&Rn.isArray(m[b])&&(m[b]=Ihe(m[b])),!C)}if(Rn.isFormData(o)&&Rn.isFunction(o.entries)){const i={};return Rn.forEachEntry(o,(u,m)=>{s(Bhe(u),m,i,0)}),i}return null}function Phe(o,s,i){if(Rn.isString(o))try{return(s||JSON.parse)(o),Rn.trim(o)}catch(u){if(u.name!=="SyntaxError")throw u}return(0,JSON.stringify)(o)}const dR={transitional:Bce,adapter:["xhr","http","fetch"],transformRequest:[function(o,s){const i=s.getContentType()||"",u=i.indexOf("application/json")>-1,m=Rn.isObject(o);if(m&&Rn.isHTMLForm(o)&&(o=new FormData(o)),Rn.isFormData(o))return u?JSON.stringify(Ice(o)):o;if(Rn.isArrayBuffer(o)||Rn.isBuffer(o)||Rn.isStream(o)||Rn.isFile(o)||Rn.isBlob(o)||Rn.isReadableStream(o))return o;if(Rn.isArrayBufferView(o))return o.buffer;if(Rn.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 Rhe(o,this.formSerializer).toString();if((h=Rn.isFileList(o))||i.indexOf("multipart/form-data")>-1){const b=this.env&&this.env.FormData;return qz(h?{"files[]":o}:o,b&&new b,this.formSerializer)}}return m||u?(s.setContentType("application/json",!1),Phe(o)):o}],transformResponse:[function(o){const s=this.transitional||dR.transitional,i=s&&s.forcedJSONParsing,u=this.responseType==="json";if(Rn.isResponse(o)||Rn.isReadableStream(o))return o;if(o&&Rn.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"?Er.from(h,Er.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}}};Rn.forEach(["delete","get","head","post","put","patch"],o=>{dR.headers[o]={}});const Fhe=Rn.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"]),Lhe=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]&&Fhe[i])&&(i==="set-cookie"?s[i]?s[i].push(u):s[i]=[u]:s[i]=s[i]?s[i]+", "+u:u)}),s},Dre=Symbol("internals");function k6(o){return o&&String(o).trim().toLowerCase()}function UH(o){return o===!1||o==null?o:Rn.isArray(o)?o.map(UH):String(o)}function Vhe(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 Hhe=o=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim());function Tee(o,s,i,u,m){if(Rn.isFunction(u))return u.call(this,s,i);if(m&&(s=i),!!Rn.isString(s)){if(Rn.isString(u))return s.indexOf(u)!==-1;if(Rn.isRegExp(u))return u.test(s)}}function zhe(o){return o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(s,i,u)=>i.toUpperCase()+u)}function Uhe(o,s){const i=Rn.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,x,_){const N=k6(x);if(!N)throw new Error("header name must be a non-empty string");const O=Rn.findKey(m,N);(!O||m[O]===void 0||_===!0||_===void 0&&m[O]!==!1)&&(m[O||x]=UH(C))}const b=(C,x)=>Rn.forEach(C,(_,N)=>h(_,N,x));if(Rn.isPlainObject(s)||s instanceof this.constructor)b(s,i);else if(Rn.isString(s)&&(s=s.trim())&&!Hhe(s))b(Lhe(s),i);else if(Rn.isHeaders(s))for(const[C,x]of s.entries())h(x,C,u);else s!=null&&h(i,s,u);return this}get(s,i){if(s=k6(s),s){const u=Rn.findKey(this,s);if(u){const m=this[u];if(!i)return m;if(i===!0)return Vhe(m);if(Rn.isFunction(i))return i.call(this,m,u);if(Rn.isRegExp(i))return i.exec(m);throw new TypeError("parser must be boolean|regexp|function")}}}has(s,i){if(s=k6(s),s){const u=Rn.findKey(this,s);return!!(u&&this[u]!==void 0&&(!i||Tee(this,this[u],u,i)))}return!1}delete(s,i){const u=this;let m=!1;function h(b){if(b=k6(b),b){const C=Rn.findKey(u,b);C&&(!i||Tee(u,u[C],C,i))&&(delete u[C],m=!0)}}return Rn.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||Tee(this,this[h],h,s,!0))&&(delete this[h],m=!0)}return m}normalize(s){const i=this,u={};return Rn.forEach(this,(m,h)=>{const b=Rn.findKey(u,h);if(b){i[b]=UH(m),delete i[h];return}const C=s?zhe(h):String(h).trim();C!==h&&delete i[h],i[C]=UH(m),u[C]=!0}),this}concat(...s){return this.constructor.concat(this,...s)}toJSON(s){const i=Object.create(null);return Rn.forEach(this,(u,m)=>{u!=null&&u!==!1&&(i[m]=s&&Rn.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[Dre]=this[Dre]={accessors:{}}).accessors,u=this.prototype;function m(h){const b=k6(h);i[b]||(Uhe(u,h),i[b]=!0)}return Rn.isArray(s)?s.forEach(m):m(s),this}};xm.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Rn.reduceDescriptors(xm.prototype,({value:o},s)=>{let i=s[0].toUpperCase()+s.slice(1);return{get:()=>o,set(u){this[i]=u}}});Rn.freezeMethods(xm);function Aee(o,s){const i=this||dR,u=s||i,m=xm.from(u.headers);let h=u.data;return Rn.forEach(o,function(b){h=b.call(i,h,m.normalize(),s?s.status:void 0)}),m.normalize(),h}function Pce(o){return!!(o&&o.__CANCEL__)}function b4(o,s,i){Er.call(this,o??"canceled",Er.ERR_CANCELED,s,i),this.name="CanceledError"}Rn.inherits(b4,Er,{__CANCEL__:!0});function Fce(o,s,i){const u=i.config.validateStatus;!i.status||!u||u(i.status)?o(i):s(new Er("Request failed with status code "+i.status,[Er.ERR_BAD_REQUEST,Er.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function jhe(o){const s=/^([-+\w]{1,25})(:?\/\/|:)/.exec(o);return s&&s[1]||""}function Whe(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 x=Date.now(),_=u[h];b||(b=x),i[m]=C,u[m]=x;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),x-b<s)return;const B=_&&x-_;return B?Math.round(O*1e3/B):void 0}}function Zhe(o,s){let i=0,u=1e3/s,m,h;const b=(C,x=Date.now())=>{i=x,m=null,h&&(clearTimeout(h),h=null),o.apply(null,C)};return[(...C)=>{const x=Date.now(),_=x-i;_>=u?b(C,x):(m=C,h||(h=setTimeout(()=>{h=null,b(m)},u-_)))},()=>m&&b(m)]}const az=(o,s,i=3)=>{let u=0;const m=Whe(50,250);return Zhe(h=>{const b=h.loaded,C=h.lengthComputable?h.total:void 0,x=b-u,_=m(x),N=b<=C;u=b;const O={loaded:b,total:C,progress:C?b/C:void 0,bytes:x,rate:_||void 0,estimated:_&&C&&N?(C-b)/_:void 0,event:h,lengthComputable:C!=null,[s?"download":"upload"]:!0};o(O)},i)},Mre=(o,s)=>{const i=o!=null;return[u=>s[0]({lengthComputable:i,total:o,loaded:u}),s[1]]},Rre=o=>(...s)=>Rn.asap(()=>o(...s)),Ghe=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,qhe=Kd.hasStandardBrowserEnv?{write(o,s,i,u,m,h){const b=[o+"="+encodeURIComponent(s)];Rn.isNumber(i)&&b.push("expires="+new Date(i).toGMTString()),Rn.isString(u)&&b.push("path="+u),Rn.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 Yhe(o){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o)}function Khe(o,s){return s?o.replace(/\/?\/$/,"")+"/"+s.replace(/^\/+/,""):o}function Lce(o,s){return o&&!Yhe(s)?Khe(o,s):s}const Bre=o=>o instanceof xm?{...o}:o;function CE(o,s){s=s||{};const i={};function u(_,N,O,B){return Rn.isPlainObject(_)&&Rn.isPlainObject(N)?Rn.merge.call({caseless:B},_,N):Rn.isPlainObject(N)?Rn.merge({},N):Rn.isArray(N)?N.slice():N}function m(_,N,O,B){if(Rn.isUndefined(N)){if(!Rn.isUndefined(_))return u(void 0,_,O,B)}else return u(_,N,O,B)}function h(_,N){if(!Rn.isUndefined(N))return u(void 0,N)}function b(_,N){if(Rn.isUndefined(N)){if(!Rn.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 x={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(Bre(_),Bre(N),O,!0)};return Rn.forEach(Object.keys(Object.assign({},o,s)),function(_){const N=x[_]||m,O=N(o[_],s[_],_);Rn.isUndefined(O)&&N!==C||(i[_]=O)}),i}const Vce=o=>{const s=CE({},o);let{data:i,withXSRFToken:u,xsrfHeaderName:m,xsrfCookieName:h,headers:b,auth:C}=s;s.headers=b=xm.from(b),s.url=Rce(Lce(s.baseURL,s.url),o.params,o.paramsSerializer),C&&b.set("Authorization","Basic "+btoa((C.username||"")+":"+(C.password?unescape(encodeURIComponent(C.password)):"")));let x;if(Rn.isFormData(i)){if(Kd.hasStandardBrowserEnv||Kd.hasStandardBrowserWebWorkerEnv)b.setContentType(void 0);else if((x=b.getContentType())!==!1){const[_,...N]=x?x.split(";").map(O=>O.trim()).filter(Boolean):[];b.setContentType([_||"multipart/form-data",...N].join("; "))}}if(Kd.hasStandardBrowserEnv&&(u&&Rn.isFunction(u)&&(u=u(s)),u||u!==!1&&Ghe(s.url))){const _=m&&h&&qhe.read(h);_&&b.set(m,_)}return s},Xhe=typeof XMLHttpRequest<"u",Jhe=Xhe&&function(o){return new Promise(function(s,i){const u=Vce(o);let m=u.data;const h=xm.from(u.headers).normalize();let{responseType:b,onUploadProgress:C,onDownloadProgress:x}=u,_,N,O,B,H;function Z(){B&&B(),H&&H(),u.cancelToken&&u.cancelToken.unsubscribe(_),u.signal&&u.signal.removeEventListener("abort",_)}let J=new XMLHttpRequest;J.open(u.method.toUpperCase(),u.url,!0),J.timeout=u.timeout;function K(){if(!J)return;const W=xm.from("getAllResponseHeaders"in J&&J.getAllResponseHeaders()),V={data:!b||b==="text"||b==="json"?J.responseText:J.response,status:J.status,statusText:J.statusText,headers:W,config:o,request:J};Fce(function(ge){s(ge),Z()},function(ge){i(ge),Z()},V),J=null}"onloadend"in J?J.onloadend=K:J.onreadystatechange=function(){!J||J.readyState!==4||J.status===0&&!(J.responseURL&&J.responseURL.indexOf("file:")===0)||setTimeout(K)},J.onabort=function(){J&&(i(new Er("Request aborted",Er.ECONNABORTED,o,J)),J=null)},J.onerror=function(){i(new Er("Network Error",Er.ERR_NETWORK,o,J)),J=null},J.ontimeout=function(){let W=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded";const V=u.transitional||Bce;u.timeoutErrorMessage&&(W=u.timeoutErrorMessage),i(new Er(W,V.clarifyTimeoutError?Er.ETIMEDOUT:Er.ECONNABORTED,o,J)),J=null},m===void 0&&h.setContentType(null),"setRequestHeader"in J&&Rn.forEach(h.toJSON(),function(W,V){J.setRequestHeader(V,W)}),Rn.isUndefined(u.withCredentials)||(J.withCredentials=!!u.withCredentials),b&&b!=="json"&&(J.responseType=u.responseType),x&&([O,H]=az(x,!0),J.addEventListener("progress",O)),C&&J.upload&&([N,B]=az(C),J.upload.addEventListener("progress",N),J.upload.addEventListener("loadend",B)),(u.cancelToken||u.signal)&&(_=W=>{J&&(i(!W||W.type?new b4(null,o,J):W),J.abort(),J=null)},u.cancelToken&&u.cancelToken.subscribe(_),u.signal&&(u.signal.aborted?_():u.signal.addEventListener("abort",_)));const G=jhe(u.url);if(G&&Kd.protocols.indexOf(G)===-1){i(new Er("Unsupported protocol "+G+":",Er.ERR_BAD_REQUEST,o));return}J.send(m||null)})},Qhe=(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 Er?N:new b4(N instanceof Error?N.message:N))}};let b=s&&setTimeout(()=>{b=null,h(new Er(`timeout ${s} of ms exceeded`,Er.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:x}=u;return x.unsubscribe=()=>Rn.asap(C),x}},e1e=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},t1e=async function*(o,s){for await(const i of n1e(o))yield*e1e(i,s)},n1e=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()}},Ire=(o,s,i,u)=>{const m=t1e(o,s);let h=0,b,C=x=>{b||(b=!0,u&&u(x))};return new ReadableStream({async pull(x){try{const{done:_,value:N}=await m.next();if(_){C(),x.close();return}let O=N.byteLength;if(i){let B=h+=O;i(B)}x.enqueue(new Uint8Array(N))}catch(_){throw C(_),_}},cancel(x){return C(x),m.return()}},{highWaterMark:2})},Yz=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Hce=Yz&&typeof ReadableStream=="function",o1e=Yz&&(typeof TextEncoder=="function"?(o=>s=>o.encode(s))(new TextEncoder):async o=>new Uint8Array(await new Response(o).arrayBuffer())),zce=(o,...s)=>{try{return!!o(...s)}catch{return!1}},s1e=Hce&&zce(()=>{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}),Pre=64*1024,Ite=Hce&&zce(()=>Rn.isReadableStream(new Response("").body)),iz={stream:Ite&&(o=>o.body)};Yz&&(o=>{["text","arrayBuffer","blob","formData","stream"].forEach(s=>{!iz[s]&&(iz[s]=Rn.isFunction(o[s])?i=>i[s]():(i,u)=>{throw new Er(`Response type '${s}' is not supported`,Er.ERR_NOT_SUPPORT,u)})})})(new Response);const r1e=async o=>{if(o==null)return 0;if(Rn.isBlob(o))return o.size;if(Rn.isSpecCompliantForm(o))return(await new Request(Kd.origin,{method:"POST",body:o}).arrayBuffer()).byteLength;if(Rn.isArrayBufferView(o)||Rn.isArrayBuffer(o))return o.byteLength;if(Rn.isURLSearchParams(o)&&(o=o+""),Rn.isString(o))return(await o1e(o)).byteLength},a1e=async(o,s)=>Rn.toFiniteNumber(o.getContentLength())??r1e(s),i1e=Yz&&(async o=>{let{url:s,method:i,data:u,signal:m,cancelToken:h,timeout:b,onDownloadProgress:C,onUploadProgress:x,responseType:_,headers:N,withCredentials:O="same-origin",fetchOptions:B}=Vce(o);_=_?(_+"").toLowerCase():"text";let H=Qhe([m,h&&h.toAbortSignal()],b),Z;const J=H&&H.unsubscribe&&(()=>{H.unsubscribe()});let K;try{if(x&&s1e&&i!=="get"&&i!=="head"&&(K=await a1e(N,u))!==0){let Qe=new Request(s,{method:"POST",body:u,duplex:"half"}),Ne;if(Rn.isFormData(u)&&(Ne=Qe.headers.get("content-type"))&&N.setContentType(Ne),Qe.body){const[te,Ue]=Mre(K,az(Rre(x)));u=Ire(Qe.body,Pre,te,Ue)}}Rn.isString(O)||(O=O?"include":"omit");const G="credentials"in Request.prototype;Z=new Request(s,{...B,signal:H,method:i.toUpperCase(),headers:N.normalize().toJSON(),body:u,duplex:"half",credentials:G?O:void 0});let W=await fetch(Z);const V=Ite&&(_==="stream"||_==="response");if(Ite&&(C||V&&J)){const Qe={};["status","statusText","headers"].forEach(ut=>{Qe[ut]=W[ut]});const Ne=Rn.toFiniteNumber(W.headers.get("content-length")),[te,Ue]=C&&Mre(Ne,az(Rre(C),!0))||[];W=new Response(Ire(W.body,Pre,te,()=>{Ue&&Ue(),J&&J()}),Qe)}_=_||"text";let ge=await iz[Rn.findKey(iz,_)||"text"](W,o);return!V&&J&&J(),await new Promise((Qe,Ne)=>{Fce(Qe,Ne,{data:ge,headers:xm.from(W.headers),status:W.status,statusText:W.statusText,config:o,request:Z})})}catch(G){throw J&&J(),G&&G.name==="TypeError"&&/fetch/i.test(G.message)?Object.assign(new Er("Network Error",Er.ERR_NETWORK,o,Z),{cause:G.cause||G}):Er.from(G,G&&G.code,o,Z)}}),Pte={http:She,xhr:Jhe,fetch:i1e};Rn.forEach(Pte,(o,s)=>{if(o){try{Object.defineProperty(o,"name",{value:s})}catch{}Object.defineProperty(o,"adapterName",{value:s})}});const Fre=o=>`- ${o}`,l1e=o=>Rn.isFunction(o)||o===null||o===!1,Uce={getAdapter:o=>{o=Rn.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,!l1e(i)&&(u=Pte[(b=String(i)).toLowerCase()],u===void 0))throw new Er(`Unknown adapter '${b}'`);if(u)break;m[b||"#"+h]=u}if(!u){const h=Object.entries(m).map(([C,x])=>`adapter ${C} `+(x===!1?"is not supported by the environment":"is not available in the build"));let b=s?h.length>1?`since :
4
4
  `+h.map(Fre).join(`
@@ -112,7 +112,7 @@ Required: `+w.join(", "));return bn[fe].apply(null,Ae)},log:bn=>{console.log(bn,
112
112
  `:"")+"</video>",we=(Xe,qe)=>{var Ft;const Yt=ye.extend({},qe);if(!Yt.source&&(ye.extend(Yt,nt((Ft=Yt.embed)!==null&&Ft!==void 0?Ft:"",Xe.schema)),!Yt.source))return"";Yt.altsource||(Yt.altsource=""),Yt.poster||(Yt.poster=""),Yt.source=Xe.convertURL(Yt.source,"source"),Yt.altsource=Xe.convertURL(Yt.altsource,"source"),Yt.sourcemime=pe(Yt.source),Yt.altsourcemime=pe(Yt.altsource),Yt.poster=Xe.convertURL(Yt.poster,"poster");const mo=Ct(Yt.source);if(mo&&(Yt.source=mo.url,Yt.type=mo.type,Yt.allowfullscreen=mo.allowFullscreen,Yt.width=Yt.width||String(mo.w),Yt.height=Yt.height||String(mo.h)),Yt.embed)return pn(Yt.embed,Yt,!0,Xe.schema);{const $o=Qe(Xe),Zo=Ne(Xe),js=te(Xe);return Yt.width=Yt.width||"300",Yt.height=Yt.height||"150",ye.each(Yt,(ln,Wt)=>{Yt[Wt]=Xe.dom.encode(""+ln)}),Yt.type==="iframe"?ee(Yt,js):Yt.sourcemime==="application/x-shockwave-flash"?ie(Yt):Yt.sourcemime.indexOf("audio")!==-1?ce(Yt,$o):Y(Yt,Zo)}},Me=Xe=>Xe.hasAttribute("data-mce-object")||Xe.hasAttribute("data-ephox-embed-iri"),Pe=Xe=>{Xe.on("mousedown",qe=>{const Ft=Xe.dom.getParent(qe.target,".mce-preview-object");Ft&&Xe.dom.getAttrib(Ft,"data-mce-selected")==="2"&&qe.stopImmediatePropagation()}),Xe.on("click keyup touchend",()=>{const qe=Xe.selection.getNode();qe&&Xe.dom.hasClass(qe,"mce-preview-object")&&Xe.dom.getAttrib(qe,"data-mce-selected")&&qe.setAttribute("data-mce-selected","2")}),Xe.on("ObjectResized",qe=>{const Ft=qe.target;if(Ft.getAttribute("data-mce-object")){let Yt=Ft.getAttribute("data-mce-html");Yt&&(Yt=unescape(Yt),Ft.setAttribute("data-mce-html",escape(pn(Yt,{width:String(qe.width),height:String(qe.height)},!1,Xe.schema))))}})},mt={},We=(Xe,qe,Ft)=>new Promise((Yt,mo)=>{const $o=Zo=>(Zo.html&&(mt[Xe.source]=Zo),Yt({url:Xe.source,html:Zo.html?Zo.html:qe(Xe)}));mt[Xe.source]?$o(mt[Xe.source]):Ft({url:Xe.source}).then($o).catch(mo)}),bt=(Xe,qe)=>Promise.resolve({html:qe(Xe),url:Xe.source}),$t=Xe=>qe=>we(Xe,qe),gn=(Xe,qe)=>{const Ft=lt(Xe);return Ft?We(qe,$t(Xe),Ft):bt(qe,$t(Xe))},Et=Xe=>W(mt,Xe),Bt=(Xe,qe)=>G(qe,Xe).bind(Ft=>G(Ft,"meta")),dn=(Xe,qe,Ft)=>Yt=>{const mo=()=>G(Xe,Yt),$o=()=>G(qe,Yt),Zo=Wt=>G(Wt,"value").bind(et=>et.length>0?_.some(et):_.none()),js=()=>mo().bind(Wt=>h(Wt)?Zo(Wt).orThunk($o):$o().orThunk(()=>_.from(Wt))),ln=()=>$o().orThunk(()=>mo().bind(Wt=>h(Wt)?Zo(Wt):_.from(Wt)));return{[Yt]:(Yt===Ft?js():ln()).getOr("")}},_n=(Xe,qe)=>{const Ft={};return G(Xe,"dimensions").each(Yt=>{O(["width","height"],mo=>{G(qe,mo).orThunk(()=>G(Yt,mo)).each($o=>Ft[mo]=$o)})}),Ft},xo=(Xe,qe)=>{const Ft=qe&&qe!=="dimensions"?Bt(qe,Xe).getOr({}):{},Yt=dn(Xe,Ft,qe);return{...Yt("source"),...Yt("altsource"),...Yt("poster"),...Yt("embed"),..._n(Xe,Ft)}},Qn=Xe=>{const qe={...Xe,source:{value:G(Xe,"source").getOr("")},altsource:{value:G(Xe,"altsource").getOr("")},poster:{value:G(Xe,"poster").getOr("")}};return O(["width","height"],Ft=>{G(Xe,Ft).each(Yt=>{const mo=qe.dimensions||{};mo[Ft]=Yt,qe.dimensions=mo})}),qe},Nt=Xe=>qe=>{const Ft=qe&&qe.msg?"Media embed handler error: "+qe.msg:"Media embed handler threw unknown error.";Xe.notificationManager.open({type:"error",text:Ft})},rn=Xe=>{const qe=Xe.selection.getNode(),Ft=Me(qe)?Xe.serializer.serialize(qe,{selection:!0}):"",Yt=nt(Ft,Xe.schema),$o=(()=>{if(Ro(Yt.source,Yt.type)){const Zo=Xe.dom.getRect(qe);return{width:Zo.w.toString().replace(/px$/,""),height:Zo.h.toString().replace(/px$/,"")}}else return{}})();return{embed:Ft,...Yt,...$o}},an=(Xe,qe)=>Ft=>{if(m(Ft.url)&&Ft.url.trim().length>0){const Yt=Ft.html,$o={...nt(Yt,qe.schema),source:Ft.url,embed:Yt};Xe.setData(Qn($o))}},Nn=(Xe,qe)=>{const Ft=Xe.dom.select("*[data-mce-object]");for(let Yt=0;Yt<qe.length;Yt++)for(let mo=Ft.length-1;mo>=0;mo--)qe[Yt]===Ft[mo]&&Ft.splice(mo,1);Xe.selection.select(Ft[0])},ko=(Xe,qe)=>{const Ft=Xe.dom.select("*[data-mce-object]");Xe.insertContent(qe),Nn(Xe,Ft),Xe.nodeChanged()},Ro=(Xe,qe)=>x(qe)&&qe==="ephox-embed-iri"&&x(Ct(Xe)),ws=(Xe,qe)=>((Yt,mo)=>Yt.width!==mo.width||Yt.height!==mo.height)(Xe,qe)&&Ro(qe.source,Xe.type),yo=(Xe,qe,Ft)=>{var Yt;qe.embed=ws(Xe,qe)&&Pt(Ft)?we(Ft,{...qe,embed:""}):pn((Yt=qe.embed)!==null&&Yt!==void 0?Yt:"",qe,!1,Ft.schema),qe.embed&&(Xe.source===qe.source||Et(qe.source))?ko(Ft,qe.embed):gn(Ft,qe).then(mo=>{ko(Ft,mo.html)}).catch(Nt(Ft))},Us=Xe=>{const qe=rn(Xe),Ft=H(qe),Yt=Qn(qe),mo=(oo,Co)=>{const Io=xo(Co.getData(),"source");oo.source!==Io.source&&(an(fo,Xe)({url:Io.source,html:""}),gn(Xe,Io).then(an(fo,Xe)).catch(Nt(Xe)))},$o=oo=>{var Co;const Io=xo(oo.getData()),ls=nt((Co=Io.embed)!==null&&Co!==void 0?Co:"",Xe.schema);oo.setData(Qn(ls))},Zo=(oo,Co,Io)=>{const ls=xo(oo.getData(),Co),Js=ws(Io,ls)&&Pt(Xe)?{...ls,embed:""}:ls,Es=we(Xe,Js);oo.setData(Qn({...Js,embed:Es}))},js=[{name:"source",type:"urlinput",filetype:"media",label:"Source",picker_text:"Browse files"}],ln=Pt(Xe)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],Wt={title:"General",name:"general",items:B([js,ln])},rt={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},cn=[];Oe(Xe)&&cn.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),ue(Xe)&&cn.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});const yn={title:"Advanced",name:"advanced",items:cn},zn=[Wt,rt];cn.length>0&&zn.push(yn);const co={type:"tabpanel",tabs:zn},fo=Xe.windowManager.open({title:"Insert/Edit Media",size:"normal",body:co,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:oo=>{const Co=xo(oo.getData());yo(Ft.get(),Co,Xe),oo.close()},onChange:(oo,Co)=>{switch(Co.name){case"source":mo(Ft.get(),oo);break;case"embed":$o(oo);break;case"dimensions":case"altsource":case"poster":Zo(oo,Co.name,Ft.get());break}Ft.set(xo(oo.getData()))},initialData:Yt})},fn=Xe=>({showDialog:()=>{Us(Xe)}}),Ho=Xe=>{const qe=()=>{Us(Xe)};Xe.addCommand("mceMedia",qe)},tr=(Xe,qe,Ft)=>Xe.length>=qe.length&&Xe.substr(Ft,Ft+qe.length)===qe,rr=(Xe,qe)=>tr(Xe,qe,0);var Ir=tinymce.util.Tools.resolve("tinymce.Env");const Pr=Xe=>{const qe=Xe.name;return qe==="iframe"||qe==="video"||qe==="audio"},ks=(Xe,qe,Ft,Yt=null)=>{const mo=Xe.attr(Ft);return x(mo)?mo:W(qe,Ft)?null:Yt},Nr=(Xe,qe,Ft)=>{const Yt=qe.name==="img"||Xe.name==="video",mo=Yt?"300":null,$o=Xe.name==="audio"?"30":"150",Zo=Yt?$o:null;qe.attr({width:ks(Xe,Ft,"width",mo),height:ks(Xe,Ft,"height",Zo)})},Xr=(Xe,qe,Ft,Yt)=>{const mo=He(Xe.schema).parse(Yt,{context:qe});for(;mo.firstChild;)Ft.append(mo.firstChild)},xs=(Xe,qe)=>{const Ft=qe.name,Yt=new Ze("img",1);return Ps(Xe,qe,Yt),Nr(qe,Yt,{}),Yt.attr({style:qe.attr("style"),src:Ir.transparentSrc,"data-mce-object":Ft,class:"mce-object mce-object-"+Ft}),Yt},uo=(Xe,qe)=>{var Ft;const Yt=qe.name,mo=new Ze("span",1);mo.attr({contentEditable:"false",style:qe.attr("style"),"data-mce-object":Yt,class:"mce-preview-object mce-object-"+Yt}),Ps(Xe,qe,mo);const $o=Xe.dom.parseStyle((Ft=qe.attr("style"))!==null&&Ft!==void 0?Ft:""),Zo=new Ze(Yt,1);if(Nr(qe,Zo,$o),Zo.attr({src:qe.attr("src"),style:qe.attr("style"),class:qe.attr("class")}),Yt==="iframe")Zo.attr({allowfullscreen:qe.attr("allowfullscreen"),frameborder:"0",sandbox:qe.attr("sandbox"),referrerpolicy:qe.attr("referrerpolicy")});else{O(["controls","crossorigin","currentTime","loop","muted","poster","preload"],et=>{Zo.attr(et,qe.attr(et))});const Wt=mo.attr("data-mce-html");x(Wt)&&Xr(Xe,Yt,Zo,unescape(Wt))}const js=new Ze("span",1);return js.attr("class","mce-shim"),mo.append(Zo),mo.append(js),mo},Ps=(Xe,qe,Ft)=>{var Yt;const mo=(Yt=qe.attributes)!==null&&Yt!==void 0?Yt:[];let $o=mo.length;for(;$o--;){const Wt=mo[$o].name;let et=mo[$o].value;Wt!=="width"&&Wt!=="height"&&Wt!=="style"&&!rr(Wt,"data-mce-")&&((Wt==="data"||Wt==="src")&&(et=Xe.convertURL(et,Wt)),Ft.attr("data-mce-p-"+Wt,et))}const Zo=Tt({inner:!0},Xe.schema),js=new Ze("div",1);O(qe.children(),Wt=>js.append(Wt));const ln=Zo.serialize(js);ln&&(Ft.attr("data-mce-html",escape(ln)),Ft.empty())},_t=Xe=>{const qe=Xe.attr("class");return m(qe)&&/\btiny-pageembed\b/.test(qe)},Ht=Xe=>{let qe=Xe;for(;qe=qe.parent;)if(qe.attr("data-ephox-embed-iri")||_t(qe))return!0;return!1},Fn=Xe=>qe=>{let Ft=qe.length,Yt;for(;Ft--;)Yt=qe[Ft],Yt.parent&&(Yt.parent.attr("data-mce-object")||(Pr(Yt)&&Ue(Xe)?Ht(Yt)||Yt.replace(uo(Xe,Yt)):Ht(Yt)||Yt.replace(xs(Xe,Yt))))},ao=(Xe,qe,Ft)=>{const Yt=Xe.options.get,mo=Yt("xss_sanitization"),$o=ut(Xe);return He(Xe.schema,{sanitize:mo,validate:$o}).parse(Ft,{context:qe})},Bo=Xe=>{Xe.on("PreInit",()=>{const{schema:qe,serializer:Ft,parser:Yt}=Xe,mo=qe.getBoolAttrs();O("webkitallowfullscreen mozallowfullscreen".split(" "),$o=>{mo[$o]={}}),K({embed:["wmode"]},($o,Zo)=>{const js=qe.getElementRule(Zo);js&&O($o,ln=>{js.attributes[ln]={},js.attributesOrder.push(ln)})}),Yt.addNodeFilter("iframe,video,audio,object,embed",Fn(Xe)),Ft.addAttributeFilter("data-mce-object",($o,Zo)=>{var js;let ln=$o.length;for(;ln--;){const Wt=$o[ln];if(!Wt.parent)continue;const et=Wt.attr(Zo),rt=new Ze(et,1);if(et!=="audio"){const co=Wt.attr("class");co&&co.indexOf("mce-preview-object")!==-1&&Wt.firstChild?rt.attr({width:Wt.firstChild.attr("width"),height:Wt.firstChild.attr("height")}):rt.attr({width:Wt.attr("width"),height:Wt.attr("height")})}rt.attr({style:Wt.attr("style")});const cn=(js=Wt.attributes)!==null&&js!==void 0?js:[];let yn=cn.length;for(;yn--;){const co=cn[yn].name;co.indexOf("data-mce-p-")===0&&rt.attr(co.substr(11),cn[yn].value)}const zn=Wt.attr("data-mce-html");if(zn){const co=ao(Xe,et,unescape(zn));O(co.children(),fo=>rt.append(fo))}Wt.replace(rt)}})}),Xe.on("SetContent",()=>{const qe=Xe.dom;O(qe.select("span.mce-preview-object"),Ft=>{qe.select("span.mce-shim",Ft).length===0&&qe.add(Ft,"span",{class:"mce-shim"})})})},is=Xe=>{Xe.on("ResolveName",qe=>{let Ft;qe.target.nodeType===1&&(Ft=qe.target.getAttribute("data-mce-object"))&&(qe.name=Ft)})},yr=Xe=>qe=>{const Ft=()=>{qe.setEnabled(Xe.selection.isEditable())};return Xe.on("NodeChange",Ft),Ft(),()=>{Xe.off("NodeChange",Ft)}},wr=Xe=>{const qe=()=>Xe.execCommand("mceMedia");Xe.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:qe,onSetup:Ft=>{const Yt=Xe.selection;Ft.setActive(Me(Yt.getNode()));const mo=Yt.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",Ft.setActive).unbind,$o=yr(Xe)(Ft);return()=>{mo(),$o()}}}),Xe.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:qe,onSetup:yr(Xe)})};var ar=()=>{o.add("media",Xe=>(ge(Xe),Ho(Xe),wr(Xe),is(Xe),Bo(Xe),Pe(Xe),fn(Xe)))};ar()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const s=G=>W=>typeof W===G,i=s("boolean"),u=s("number"),m=G=>W=>W.options.get(G),h=G=>{const W=G.options.register;W("nonbreaking_force_tab",{processor:V=>i(V)?{value:V?3:0,valid:!0}:u(V)?{value:V,valid:!0}:{valid:!1,message:"Must be a boolean or number."},default:!1}),W("nonbreaking_wrap",{processor:"boolean",default:!0})},b=m("nonbreaking_force_tab"),C=m("nonbreaking_wrap"),x=(G,W)=>{let V="";for(let ge=0;ge<W;ge++)V+=G;return V},_=G=>G.plugins.visualchars?G.plugins.visualchars.isEnabled():!1,N=(G,W)=>{const V=()=>_(G)?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap",ge=()=>`<span class="${V()}" contenteditable="false">${x("&nbsp;",W)}</span>`,Ne=C(G)||G.plugins.visualchars?ge():x("&nbsp;",W);G.undoManager.transact(()=>G.insertContent(Ne))},O=G=>{G.addCommand("mceNonBreaking",()=>{N(G,1)})};var B=tinymce.util.Tools.resolve("tinymce.util.VK");const H=G=>{const W=b(G);W>0&&G.on("keydown",V=>{if(V.keyCode===B.TAB&&!V.isDefaultPrevented()){if(V.shiftKey)return;V.preventDefault(),V.stopImmediatePropagation(),N(G,W)}})},Z=G=>W=>{const V=()=>{W.setEnabled(G.selection.isEditable())};return G.on("NodeChange",V),V(),()=>{G.off("NodeChange",V)}},J=G=>{const W=()=>G.execCommand("mceNonBreaking");G.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:W,onSetup:Z(G)}),G.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:W,onSetup:Z(G)})};var K=()=>{o.add("nonbreaking",G=>{h(G),O(G),J(G),H(G)})};K()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=tinymce.util.Tools.resolve("tinymce.Env");const i=Z=>J=>J.options.get(Z),u=Z=>{const J=Z.options.register;J("pagebreak_separator",{processor:"string",default:"<!-- pagebreak -->"}),J("pagebreak_split_block",{processor:"boolean",default:!1})},m=i("pagebreak_separator"),h=i("pagebreak_split_block"),b="mce-pagebreak",C=Z=>{const J=`<img src="${s.transparentSrc}" class="${b}" data-mce-resize="false" data-mce-placeholder />`;return Z?`<p>${J}</p>`:J},x=Z=>{const J=m(Z),K=()=>h(Z),G=new RegExp(J.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,W=>"\\"+W),"gi");Z.on("BeforeSetContent",W=>{W.content=W.content.replace(G,C(K()))}),Z.on("PreInit",()=>{Z.serializer.addNodeFilter("img",W=>{let V=W.length,ge,Qe;for(;V--;)if(ge=W[V],Qe=ge.attr("class"),Qe&&Qe.indexOf(b)!==-1){const Ne=ge.parent;if(Ne&&Z.schema.getBlockElements()[Ne.name]&&K()){Ne.type=3,Ne.value=J,Ne.raw=!0,ge.remove();continue}ge.type=3,ge.value=J,ge.raw=!0}})})},_=Z=>{Z.addCommand("mcePageBreak",()=>{Z.insertContent(C(h(Z)))})},N=Z=>{Z.on("ResolveName",J=>{J.target.nodeName==="IMG"&&Z.dom.hasClass(J.target,b)&&(J.name="pagebreak")})},O=Z=>J=>{const K=()=>{J.setEnabled(Z.selection.isEditable())};return Z.on("NodeChange",K),K(),()=>{Z.off("NodeChange",K)}},B=Z=>{const J=()=>Z.execCommand("mcePageBreak");Z.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:J,onSetup:O(Z)}),Z.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:J,onSetup:O(Z)})};var H=()=>{o.add("pagebreak",Z=>{u(Z),_(Z),B(Z),x(Z),N(Z)})};H()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=(Nt=>rn=>Nt===rn)(void 0),u=Nt=>Nt==null,m=Nt=>!u(Nt);class h{constructor(rn,an){this.tag=rn,this.value=an}static some(rn){return new h(!0,rn)}static none(){return h.singletonNone}fold(rn,an){return this.tag?an(this.value):rn()}isSome(){return this.tag}isNone(){return!this.tag}map(rn){return this.tag?h.some(rn(this.value)):h.none()}bind(rn){return this.tag?rn(this.value):h.none()}exists(rn){return this.tag&&rn(this.value)}forall(rn){return!this.tag||rn(this.value)}filter(rn){return!this.tag||rn(this.value)?this:h.none()}getOr(rn){return this.tag?this.value:rn}or(rn){return this.tag?this:rn}getOrThunk(rn){return this.tag?this.value:rn()}orThunk(rn){return this.tag?this:rn()}getOrDie(rn){if(this.tag)return this.value;throw new Error(rn??"Called getOrDie on None")}static from(rn){return m(rn)?h.some(rn):h.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(rn){this.tag&&rn(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}h.singletonNone=new h(!1);const b=Nt=>()=>Nt,C=b(!1),x=(Nt,rn,an)=>{for(let Nn=0,ko=Nt.length;Nn<ko;Nn++){const Ro=Nt[Nn];if(rn(Ro,Nn))return h.some(Ro);if(an(Ro,Nn))break}return h.none()},_=(Nt,rn)=>x(Nt,rn,C),N=(Nt,rn)=>{for(let an=0;an<Nt.length;an++){const Nn=rn(Nt[an],an);if(Nn.isSome())return Nn}return h.none()};typeof window<"u"||Function("return this;")();const O=Nt=>{let rn=!1,an;return(...Nn)=>(rn||(rn=!0,an=Nt.apply(null,Nn)),an)},B=(Nt,rn,an,Nn)=>{const ko=Nt.isiOS()&&/ipad/i.test(an)===!0,Ro=Nt.isiOS()&&!ko,ws=Nt.isiOS()||Nt.isAndroid(),yo=ws||Nn("(pointer:coarse)"),Us=ko||!Ro&&ws&&Nn("(min-device-width:768px)"),fn=Ro||ws&&!Us,Ho=rn.isSafari()&&Nt.isiOS()&&/safari/i.test(an)===!1,tr=!fn&&!Us&&!Ho;return{isiPad:b(ko),isiPhone:b(Ro),isTablet:b(Us),isPhone:b(fn),isTouch:b(yo),isAndroid:Nt.isAndroid,isiOS:Nt.isiOS,isWebView:b(Ho),isDesktop:b(tr)}},H=(Nt,rn)=>{for(let an=0;an<Nt.length;an++){const Nn=Nt[an];if(Nn.test(rn))return Nn}},Z=(Nt,rn)=>{const an=H(Nt,rn);if(!an)return{major:0,minor:0};const Nn=ko=>Number(rn.replace(an,"$"+ko));return G(Nn(1),Nn(2))},J=(Nt,rn)=>{const an=String(rn).toLowerCase();return Nt.length===0?K():Z(Nt,an)},K=()=>G(0,0),G=(Nt,rn)=>({major:Nt,minor:rn}),W={nu:G,detect:J,unknown:K},V=(Nt,rn)=>N(rn.brands,an=>{const Nn=an.brand.toLowerCase();return _(Nt,ko=>{var Ro;return Nn===((Ro=ko.brand)===null||Ro===void 0?void 0:Ro.toLowerCase())}).map(ko=>({current:ko.name,version:W.nu(parseInt(an.version,10),0)}))}),ge=(Nt,rn)=>{const an=String(rn).toLowerCase();return _(Nt,Nn=>Nn.search(an))},Qe=(Nt,rn)=>ge(Nt,rn).map(an=>{const Nn=W.detect(an.versionRegexes,rn);return{current:an.name,version:Nn}}),Ne=(Nt,rn)=>ge(Nt,rn).map(an=>{const Nn=W.detect(an.versionRegexes,rn);return{current:an.name,version:Nn}}),te=(Nt,rn,an=0,Nn)=>{const ko=Nt.indexOf(rn,an);return ko!==-1?i(Nn)?!0:ko+rn.length<=Nn:!1},Ue=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ut=Nt=>rn=>te(rn,Nt),lt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:Nt=>te(Nt,"edge/")&&te(Nt,"chrome")&&te(Nt,"safari")&&te(Nt,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ue],search:Nt=>te(Nt,"chrome")&&!te(Nt,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:Nt=>te(Nt,"msie")||te(Nt,"trident")},{name:"Opera",versionRegexes:[Ue,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ut("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ut("firefox")},{name:"Safari",versionRegexes:[Ue,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:Nt=>(te(Nt,"safari")||te(Nt,"mobile/"))&&te(Nt,"applewebkit")}],Oe=[{name:"Windows",search:ut("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:Nt=>te(Nt,"iphone")||te(Nt,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ut("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:ut("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ut("linux"),versionRegexes:[]},{name:"Solaris",search:ut("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ut("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:ut("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],ue={browsers:b(lt),oses:b(Oe)},Pt="Edge",ye="Chromium",De="IE",R="Opera",je="Firefox",be="Safari",ot=()=>nt({current:void 0,version:W.unknown()}),nt=Nt=>{const rn=Nt.current,an=Nt.version,Nn=ko=>()=>rn===ko;return{current:rn,version:an,isEdge:Nn(Pt),isChromium:Nn(ye),isIE:Nn(De),isOpera:Nn(R),isFirefox:Nn(je),isSafari:Nn(be)}},pe={unknown:ot,nu:nt,edge:b(Pt),chromium:b(ye),ie:b(De),opera:b(R),firefox:b(je),safari:b(be)},Ze="Windows",Tt="iOS",He="Android",vt="Linux",Be="macOS",ft="Solaris",oe="FreeBSD",pn="ChromeOS",gt=()=>St({current:void 0,version:W.unknown()}),St=Nt=>{const rn=Nt.current,an=Nt.version,Nn=ko=>()=>rn===ko;return{current:rn,version:an,isWindows:Nn(Ze),isiOS:Nn(Tt),isAndroid:Nn(He),isMacOS:Nn(Be),isLinux:Nn(vt),isSolaris:Nn(ft),isFreeBSD:Nn(oe),isChromeOS:Nn(pn)}},jt={unknown:gt,nu:St,windows:b(Ze),ios:b(Tt),android:b(He),linux:b(vt),macos:b(Be),solaris:b(ft),freebsd:b(oe),chromeos:b(pn)},ee={detect:(Nt,rn,an)=>{const Nn=ue.browsers(),ko=ue.oses(),Ro=rn.bind(Us=>V(Nn,Us)).orThunk(()=>Qe(Nn,Nt)).fold(pe.unknown,pe.nu),ws=Ne(ko,Nt).fold(jt.unknown,jt.nu),yo=B(ws,Ro,Nt,an);return{browser:Ro,os:ws,deviceType:yo}}},ie=Nt=>window.matchMedia(Nt).matches;let ce=O(()=>ee.detect(window.navigator.userAgent,h.from(window.navigator.userAgentData),ie));const Y=()=>ce(),we=()=>Y().os.isMacOS(),Me=()=>Y().os.isiOS(),Pe=()=>{const Nt=we()||Me();return`<script>(${(an=>{document.addEventListener("click",Nn=>{for(let ko=Nn.target;ko;ko=ko.parentNode)if(ko.nodeName==="A"){const ws=ko.getAttribute("href");if(ws&&ws.startsWith("#")){Nn.preventDefault();const Us=document.getElementById(ws.substring(1));Us&&Us.scrollIntoView({behavior:"smooth"});return}(an?Nn.metaKey:Nn.ctrlKey&&!Nn.altKey)||Nn.preventDefault()}},!1)}).toString()})(${Nt})<\/script>`};var mt=tinymce.util.Tools.resolve("tinymce.util.Tools");const We=Nt=>rn=>rn.options.get(Nt),bt=We("content_style"),$t=We("content_css_cors"),gn=We("body_class"),Et=We("body_id"),Bt=Nt=>{var rn;let an="";const Nn=Nt.dom.encode,ko=(rn=bt(Nt))!==null&&rn!==void 0?rn:"";an+=`<base href="${Nn(Nt.documentBaseURI.getURI())}">`;const Ro=$t(Nt)?' crossorigin="anonymous"':"";mt.each(Nt.contentCSS,tr=>{an+='<link type="text/css" rel="stylesheet" href="'+Nn(Nt.documentBaseURI.toAbsolute(tr))+'"'+Ro+">"}),ko&&(an+='<style type="text/css">'+ko+"</style>");const ws=Et(Nt),yo=gn(Nt),Us=Nt.getBody().dir,fn=Us?' dir="'+Nn(Us)+'"':"";return"<!DOCTYPE html><html><head>"+an+'</head><body id="'+Nn(ws)+'" class="mce-content-body '+Nn(yo)+'"'+fn+">"+Nt.getContent()+Pe()+"</body></html>"},dn=Nt=>{const rn=Bt(Nt);Nt.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0,transparent:!1}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:rn}}).focus("close")},_n=Nt=>{Nt.addCommand("mcePreview",()=>{dn(Nt)})},xo=Nt=>{const rn=()=>Nt.execCommand("mcePreview");Nt.ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:rn,context:"any"}),Nt.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:rn,context:"any"})};var Qn=()=>{o.add("preview",Nt=>{_n(Nt),xo(Nt)})};Qn()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const s=()=>window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295;let i=0;const u=Ct=>{const ie=new Date().getTime(),ce=Math.floor(s()*1e9);return i++,Ct+"_"+ce+i+String(ie)},m=(Ct,ee,ie)=>{Ct.execCommand("mceInsertTable",!1,{rows:ie,columns:ee})},h=(Ct,ee,ie)=>{const ce=Ct.editorUpload.blobCache,Y=ce.create(u("mceu"),ie,ee);ce.add(Y),Ct.insertContent(Ct.dom.createHTML("img",{src:Y.blobUri()}))},b=Ct=>new Promise(ee=>{const ie=new FileReader;ie.onloadend=()=>{ee(ie.result.split(",")[1])},ie.readAsDataURL(Ct)});var C=tinymce.util.Tools.resolve("tinymce.util.Delay");const x=Ct=>new Promise(ee=>{let ie=!1;const ce=document.createElement("input");ce.type="file",ce.accept="image/*",ce.style.position="fixed",ce.style.left="0",ce.style.top="0",ce.style.opacity="0.001",document.body.appendChild(ce);const Y=Pe=>{var mt;ie||((mt=ce.parentNode)===null||mt===void 0||mt.removeChild(ce),ie=!0,ee(Pe))},we=Pe=>{Y(Array.prototype.slice.call(Pe.target.files))};ce.addEventListener("input",we),ce.addEventListener("change",we);const Me=Pe=>{const mt=()=>{Y([])};ie||(Pe.type==="focusin"?C.setEditorTimeout(Ct,mt,1e3):mt()),Ct.off("focusin remove",Me)};Ct.on("focusin remove",Me),ce.click()}),_=Ct=>{Ct.on("PreInit",()=>{Ct.queryCommandSupported("QuickbarInsertImage")||Ct.addCommand("QuickbarInsertImage",()=>{x(Ct).then(ee=>{if(ee.length>0){const ie=ee[0];b(ie).then(ce=>{h(Ct,ce,ie)})}})})})},N=(Ct,ee,ie)=>{var ce;return ie(Ct,ee.prototype)?!0:((ce=Ct.constructor)===null||ce===void 0?void 0:ce.name)===ee.name},O=Ct=>{const ee=typeof Ct;return Ct===null?"null":ee==="object"&&Array.isArray(Ct)?"array":ee==="object"&&N(Ct,String,(ie,ce)=>ce.isPrototypeOf(ie))?"string":ee},B=Ct=>ee=>O(ee)===Ct,H=Ct=>ee=>typeof ee===Ct,Z=B("string"),J=H("boolean"),K=Ct=>Ct==null,G=Ct=>!K(Ct),W=H("function"),V=Ct=>ee=>ee.options.get(Ct),ge=Ct=>{const ee=Ct.options.register,ie=Me=>Pe=>{const mt=J(Pe)||Z(Pe);return mt?J(Pe)?{value:Pe?Me:"",valid:mt}:{value:Pe.trim(),valid:mt}:{valid:!1,message:"Must be a boolean or string."}},ce="bold italic | quicklink h2 h3 blockquote";ee("quickbars_selection_toolbar",{processor:ie(ce),default:ce});const Y="quickimage quicktable";ee("quickbars_insert_toolbar",{processor:ie(Y),default:Y});const we="alignleft aligncenter alignright";ee("quickbars_image_toolbar",{processor:ie(we),default:we})},Qe=V("quickbars_selection_toolbar"),Ne=V("quickbars_insert_toolbar"),te=V("quickbars_image_toolbar"),Ue=Ct=>{Ct.ui.registry.addButton("quickimage",{icon:"image",tooltip:"Insert image",onAction:()=>Ct.execCommand("QuickbarInsertImage")}),Ct.ui.registry.addButton("quicktable",{icon:"table",tooltip:"Insert table",onAction:()=>{m(Ct,2,2)}})},lt=(Ct=>()=>Ct)(!1);class Oe{constructor(ee,ie){this.tag=ee,this.value=ie}static some(ee){return new Oe(!0,ee)}static none(){return Oe.singletonNone}fold(ee,ie){return this.tag?ie(this.value):ee()}isSome(){return this.tag}isNone(){return!this.tag}map(ee){return this.tag?Oe.some(ee(this.value)):Oe.none()}bind(ee){return this.tag?ee(this.value):Oe.none()}exists(ee){return this.tag&&ee(this.value)}forall(ee){return!this.tag||ee(this.value)}filter(ee){return!this.tag||ee(this.value)?this:Oe.none()}getOr(ee){return this.tag?this.value:ee}or(ee){return this.tag?this:ee}getOrThunk(ee){return this.tag?this.value:ee()}orThunk(ee){return this.tag?this:ee()}getOrDie(ee){if(this.tag)return this.value;throw new Error(ee??"Called getOrDie on None")}static from(ee){return G(ee)?Oe.some(ee):Oe.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(ee){this.tag&&ee(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Oe.singletonNone=new Oe(!1),typeof window<"u"||Function("return this;")();const ue=1,Pt=Ct=>Ct.dom.nodeName.toLowerCase(),ye=(Ct,ee)=>{const ie=Ct.dom;return ie&&ie.hasAttribute?ie.hasAttribute(ee):!1};var De=(Ct,ee,ie,ce,Y)=>Ct(ie,ce)?Oe.some(ie):W(Y)&&Y(ie)?Oe.none():ee(ie,ce,Y);const R=(Ct,ee)=>{const ce=(ee||document).createElement("div");if(ce.innerHTML=Ct,!ce.hasChildNodes()||ce.childNodes.length>1){const Y="HTML does not have a single root node";throw console.error(Y,Ct),new Error(Y)}return ot(ce.childNodes[0])},je=(Ct,ee)=>{const ce=(ee||document).createElement(Ct);return ot(ce)},be=(Ct,ee)=>{const ce=(ee||document).createTextNode(Ct);return ot(ce)},ot=Ct=>{if(Ct==null)throw new Error("Node cannot be null or undefined");return{dom:Ct}},pe={fromHtml:R,fromTag:je,fromText:be,fromDom:ot,fromPoint:(Ct,ee,ie)=>Oe.from(Ct.dom.elementFromPoint(ee,ie)).map(ot)},Ze=(Ct,ee)=>{const ie=Ct.dom;if(ie.nodeType!==ue)return!1;{const ce=ie;if(ce.matches!==void 0)return ce.matches(ee);if(ce.msMatchesSelector!==void 0)return ce.msMatchesSelector(ee);if(ce.webkitMatchesSelector!==void 0)return ce.webkitMatchesSelector(ee);if(ce.mozMatchesSelector!==void 0)return ce.mozMatchesSelector(ee);throw new Error("Browser lacks native selectors")}},Tt=(Ct,ee,ie)=>{let ce=Ct.dom;const Y=W(ie)?ie:lt;for(;ce.parentNode;){ce=ce.parentNode;const we=pe.fromDom(ce);if(ee(we))return Oe.some(we);if(Y(we))break}return Oe.none()},He=(Ct,ee,ie)=>De((Y,we)=>we(Y),Tt,Ct,ee,ie),vt=(Ct,ee,ie)=>He(Ct,ee,ie).isSome(),Be=(Ct,ee,ie)=>Tt(Ct,ce=>Ze(ce,ee),ie),ft=(Ct,ee,ie)=>De((Y,we)=>Ze(Y,we),Be,Ct,ee,ie),oe=Ct=>{const ee=Ne(Ct);ee.length>0&&Ct.ui.registry.addContextToolbar("quickblock",{predicate:ie=>{const ce=pe.fromDom(ie),Y=Ct.schema.getTextBlockElements(),we=Me=>Me.dom===Ct.getBody();return!ye(ce,"data-mce-bogus")&&ft(ce,'table,[data-mce-bogus="all"]',we).fold(()=>vt(ce,Me=>Pt(Me)in Y&&Ct.dom.isEmpty(Me.dom),we),lt)},items:ee,position:"line",scope:"editor"})},pn=Ct=>Ct.dom.classList!==void 0,gt=(Ct,ee)=>pn(Ct)&&Ct.dom.classList.contains(ee),St=Ct=>{const ee=Me=>Ct.dom.isEditable(Me),ie=Me=>ee(Me.parentElement),ce=Me=>{const Pe=Me.nodeName==="FIGURE"&&/image/i.test(Me.className),mt=Me.nodeName==="IMG"||Pe,We=gt(pe.fromDom(Me),"mce-pagebreak");return mt&&ie(Me)&&!We},Y=te(Ct);Y.length>0&&Ct.ui.registry.addContextToolbar("imageselection",{predicate:ce,items:Y,position:"node"});const we=Qe(Ct);we.length>0&&Ct.ui.registry.addContextToolbar("textselection",{predicate:Me=>!ce(Me)&&!Ct.selection.isCollapsed()&&ee(Me),items:we,position:"selection",scope:"editor"})};var jt=()=>{o.add("quickbars",Ct=>{ge(Ct),_(Ct),Ue(Ct),oe(Ct),St(Ct)})};jt()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=(G=>W=>typeof W===G)("function");var u=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),m=tinymce.util.Tools.resolve("tinymce.util.Tools");const h=G=>W=>W.options.get(G),b=G=>{const W=G.options.register;W("save_enablewhendirty",{processor:"boolean",default:!0}),W("save_onsavecallback",{processor:"function"}),W("save_oncancelcallback",{processor:"function"})},C=h("save_enablewhendirty"),x=h("save_onsavecallback"),_=h("save_oncancelcallback"),N=(G,W)=>{G.notificationManager.open({text:W,type:"error"})},O=G=>{const W=u.DOM.getParent(G.id,"form");if(C(G)&&!G.isDirty())return;G.save();const V=x(G);if(i(V)){V.call(G,G),G.nodeChanged();return}W?(G.setDirty(!1),(!W.onsubmit||W.onsubmit())&&(typeof W.submit=="function"?W.submit():N(G,"Error: Form submit field collision.")),G.nodeChanged()):N(G,"Error: No form element found.")},B=G=>{const W=m.trim(G.startContent),V=_(G);if(i(V)){V.call(G,G);return}G.resetContent(W)},H=G=>{G.addCommand("mceSave",()=>{O(G)}),G.addCommand("mceCancel",()=>{B(G)})},Z=G=>W=>{const V=()=>{W.setEnabled(!C(G)||G.isDirty())};return V(),G.on("NodeChange dirty",V),()=>G.off("NodeChange dirty",V)},J=G=>{G.ui.registry.addButton("save",{icon:"save",tooltip:"Save",enabled:!1,onAction:()=>G.execCommand("mceSave"),onSetup:Z(G),shortcut:"Meta+S"}),G.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",enabled:!1,onAction:()=>G.execCommand("mceCancel"),onSetup:Z(G)}),G.addShortcut("Meta+S","","mceSave")};var K=()=>{o.add("save",G=>{b(G),J(G),H(G)})};K()})();(function(){const o=et=>{let rt=et;return{get:()=>rt,set:zn=>{rt=zn}}};var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=(et,rt,cn)=>{var yn;return cn(et,rt.prototype)?!0:((yn=et.constructor)===null||yn===void 0?void 0:yn.name)===rt.name},u=et=>{const rt=typeof et;return et===null?"null":rt==="object"&&Array.isArray(et)?"array":rt==="object"&&i(et,String,(cn,yn)=>yn.isPrototypeOf(cn))?"string":rt},m=et=>rt=>u(rt)===et,h=et=>rt=>typeof rt===et,b=m("string"),C=m("array"),x=h("boolean"),_=et=>et==null,N=et=>!_(et),O=h("number"),B=()=>{},H=et=>()=>et,Z=H(!0),K=H("[~№|!-*+-\\/:;?@\\[-`{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]");class G{constructor(rt,cn){this.tag=rt,this.value=cn}static some(rt){return new G(!0,rt)}static none(){return G.singletonNone}fold(rt,cn){return this.tag?cn(this.value):rt()}isSome(){return this.tag}isNone(){return!this.tag}map(rt){return this.tag?G.some(rt(this.value)):G.none()}bind(rt){return this.tag?rt(this.value):G.none()}exists(rt){return this.tag&&rt(this.value)}forall(rt){return!this.tag||rt(this.value)}filter(rt){return!this.tag||rt(this.value)?this:G.none()}getOr(rt){return this.tag?this.value:rt}or(rt){return this.tag?this:rt}getOrThunk(rt){return this.tag?this.value:rt()}orThunk(rt){return this.tag?this:rt()}getOrDie(rt){if(this.tag)return this.value;throw new Error(rt??"Called getOrDie on None")}static from(rt){return N(rt)?G.some(rt):G.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(rt){this.tag&&rt(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}G.singletonNone=new G(!1);const W=K;var V=tinymce.util.Tools.resolve("tinymce.Env"),ge=tinymce.util.Tools.resolve("tinymce.util.Tools");const Qe=Array.prototype.slice,Ne=Array.prototype.push,te=(et,rt)=>{const cn=et.length,yn=new Array(cn);for(let zn=0;zn<cn;zn++){const co=et[zn];yn[zn]=rt(co,zn)}return yn},Ue=(et,rt)=>{for(let cn=0,yn=et.length;cn<yn;cn++){const zn=et[cn];rt(zn,cn)}},ut=(et,rt)=>{for(let cn=et.length-1;cn>=0;cn--){const yn=et[cn];rt(yn,cn)}},lt=(et,rt)=>{if(et.length===0)return[];{let cn=rt(et[0]);const yn=[];let zn=[];for(let co=0,fo=et.length;co<fo;co++){const oo=et[co],Co=rt(oo);Co!==cn&&(yn.push(zn),zn=[]),cn=Co,zn.push(oo)}return zn.length!==0&&yn.push(zn),yn}},Oe=(et,rt,cn)=>(Ue(et,(yn,zn)=>{cn=rt(cn,yn,zn)}),cn),ue=et=>{const rt=[];for(let cn=0,yn=et.length;cn<yn;++cn){if(!C(et[cn]))throw new Error("Arr.flatten item "+cn+" was not an array, input: "+et);Ne.apply(rt,et[cn])}return rt},Pt=(et,rt)=>ue(te(et,rt)),ye=(et,rt)=>{const cn=Qe.call(et,0);return cn.sort(rt),cn},De=Object.hasOwnProperty,R=(et,rt)=>De.call(et,rt);typeof window<"u"||Function("return this;")();const je=9,be=11,ot=1,nt=3,pe=et=>et.dom.nodeType,Tt=(et=>rt=>pe(rt)===et)(nt),He=(et,rt,cn)=>{if(b(cn)||x(cn)||O(cn))et.setAttribute(rt,cn+"");else throw console.error("Invalid call to Attribute.set. Key ",rt,":: Value ",cn,":: Element ",et),new Error("Attribute value was not simple")},vt=(et,rt,cn)=>{He(et.dom,rt,cn)},Be=(et,rt)=>{const yn=(rt||document).createElement("div");if(yn.innerHTML=et,!yn.hasChildNodes()||yn.childNodes.length>1){const zn="HTML does not have a single root node";throw console.error(zn,et),new Error(zn)}return pn(yn.childNodes[0])},ft=(et,rt)=>{const yn=(rt||document).createElement(et);return pn(yn)},oe=(et,rt)=>{const yn=(rt||document).createTextNode(et);return pn(yn)},pn=et=>{if(et==null)throw new Error("Node cannot be null or undefined");return{dom:et}},St={fromHtml:Be,fromTag:ft,fromText:oe,fromDom:pn,fromPoint:(et,rt,cn)=>G.from(et.dom.elementFromPoint(rt,cn)).map(pn)},jt=et=>et.nodeType!==ot&&et.nodeType!==je&&et.nodeType!==be||et.childElementCount===0,Ct=(et,rt)=>{const cn=rt===void 0?document:rt.dom;return jt(cn)?[]:te(cn.querySelectorAll(et),St.fromDom)},ee=et=>G.from(et.dom.parentNode).map(St.fromDom),ie=et=>te(et.dom.childNodes,St.fromDom),ce=(et,rt)=>({element:et,offset:rt}),Y=(et,rt)=>{const cn=ie(et);return cn.length>0&&rt<cn.length?ce(cn[rt],0):ce(et,rt)},we=(et,rt)=>{ee(et).each(yn=>{yn.dom.insertBefore(rt.dom,et.dom)})},Me=(et,rt)=>{et.dom.appendChild(rt.dom)},Pe=(et,rt)=>{we(et,rt),Me(rt,et)},We=((et,rt)=>{const cn=co=>{if(!et(co))throw new Error("Can only get "+rt+" value of a "+rt+" node");return yn(co).getOr("")},yn=co=>et(co)?G.from(co.dom.nodeValue):G.none();return{get:cn,getOption:yn,set:(co,fo)=>{if(!et(co))throw new Error("Can only set raw "+rt+" value of a "+rt+" node");co.dom.nodeValue=fo}}})(Tt,"text"),bt=et=>We.get(et),$t=(et,rt,cn)=>(et.compareDocumentPosition(rt)&cn)!==0,gn=(et,rt)=>$t(et,rt,Node.DOCUMENT_POSITION_PRECEDING),Et=(et,rt)=>Ct(rt,et);var Bt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker");const dn=(et,rt)=>et.isBlock(rt)||R(et.schema.getVoidElements(),rt.nodeName),_n=(et,rt)=>!et.isEditable(rt),xo=(et,rt)=>et.getContentEditable(rt)==="true"&&rt.parentNode&&!et.isEditable(rt.parentNode),Qn=(et,rt)=>!et.isBlock(rt)&&R(et.schema.getWhitespaceElements(),rt.nodeName),Nt=(et,rt)=>dn(et,rt)||_n(et,rt)||Qn(et,rt)||xo(et,rt),rn=et=>et.nodeType===3,an=()=>({sOffset:0,fOffset:0,elements:[]}),Nn=(et,rt)=>Y(St.fromDom(et),rt),ko=(et,rt,cn,yn,zn,co=!0)=>{let fo=co?rt(!1):cn;for(;fo;){const oo=_n(et,fo);if(oo||Qn(et,fo)){if(oo?yn.cef(fo):yn.boundary(fo))break;fo=rt(!0);continue}else if(dn(et,fo)){if(yn.boundary(fo))break}else rn(fo)&&yn.text(fo);if(fo===zn)break;fo=rt(!1)}},Ro=(et,rt,cn,yn,zn)=>{var co;if(Nt(et,cn))return;const fo=(co=et.getParent(yn,et.isBlock))!==null&&co!==void 0?co:et.getRoot(),oo=new Bt(cn,fo),Co=zn?oo.next.bind(oo):oo.prev.bind(oo);ko(et,Co,cn,{boundary:Z,cef:Z,text:Io=>{zn?rt.fOffset+=Io.length:rt.sOffset+=Io.length,rt.elements.push(St.fromDom(Io))}})},ws=(et,rt,cn,yn,zn,co=!0)=>{const fo=new Bt(cn,rt),oo=[];let Co=an();Ro(et,Co,cn,rt,!1);const Io=()=>(Co.elements.length>0&&(oo.push(Co),Co=an()),!1);return ko(et,fo.next.bind(fo),cn,{boundary:Io,cef:ls=>(Io(),zn&&oo.push(...zn.cef(ls)),!1),text:ls=>{Co.elements.push(St.fromDom(ls)),zn&&zn.text(ls,Co)}},yn,co),yn&&Ro(et,Co,yn,rt,!0),Io(),oo},yo=(et,rt)=>{const cn=Nn(rt.startContainer,rt.startOffset),yn=cn.element.dom,zn=Nn(rt.endContainer,rt.endOffset),co=zn.element.dom;return ws(et,rt.commonAncestorContainer,yn,co,{text:(fo,oo)=>{fo===co?oo.fOffset+=fo.length-zn.offset:fo===yn&&(oo.sOffset+=cn.offset)},cef:fo=>{const oo=Pt(Et(St.fromDom(fo),"*[contenteditable=true]"),Co=>{const Io=Co.dom;return ws(et,Io,Io)});return ye(oo,(Co,Io)=>gn(Co.elements[0].dom,Io.elements[0].dom)?1:-1)}},!1)},Us=(et,rt)=>rt.collapsed?[]:yo(et,rt),fn=(et,rt)=>{const cn=et.createRng();return cn.selectNode(rt),Us(et,cn)},Ho=(et,rt)=>Pt(rt,cn=>fn(et,cn)),tr=(et,rt,cn=0,yn=et.length)=>{const zn=rt.regex;zn.lastIndex=cn;const co=[];let fo;for(;fo=zn.exec(et);){const oo=fo[rt.matchIndex],Co=fo.index+fo[0].indexOf(oo),Io=Co+oo.length;if(Io>yn)break;co.push({start:Co,finish:Io}),zn.lastIndex=Io}return co},rr=(et,rt)=>{const cn=Oe(et,(yn,zn)=>{const co=bt(zn),fo=yn.last,oo=fo+co.length,Co=Pt(rt,(Io,ls)=>Io.start<oo&&Io.finish>fo?[{element:zn,start:Math.max(fo,Io.start)-fo,finish:Math.min(oo,Io.finish)-fo,matchId:ls}]:[]);return{results:yn.results.concat(Co),last:oo}},{results:[],last:0}).results;return lt(cn,yn=>yn.matchId)},Ir=(et,rt)=>Pt(rt,cn=>{const yn=cn.elements,zn=te(yn,bt).join(""),co=tr(zn,et,cn.sOffset,zn.length-cn.fOffset);return rr(yn,co)}),Pr=(et,rt)=>{ut(et,(cn,yn)=>{ut(cn,zn=>{const co=St.fromDom(rt.cloneNode(!1));vt(co,"data-mce-index",yn);const fo=zn.element.dom;if(fo.length===zn.finish&&zn.start===0)Pe(zn.element,co);else{fo.length!==zn.finish&&fo.splitText(zn.finish);const oo=fo.splitText(zn.start);Pe(St.fromDom(oo),co)}})})},ks=(et,rt,cn,yn)=>{const zn=fn(et,cn),co=Ir(rt,zn);return Pr(co,yn),co.length},Nr=(et,rt,cn,yn)=>{const zn=cn.getBookmark(),co=et.select("td[data-mce-selected],th[data-mce-selected]"),fo=co.length>0?Ho(et,co):Us(et,cn.getRng()),oo=Ir(rt,fo);return Pr(oo,yn),cn.moveToBookmark(zn),oo.length},Xr=et=>et.getAttribute("data-mce-index"),xs=(et,rt,cn,yn)=>{const zn=et.dom.create("span",{"data-mce-bogus":1});zn.className="mce-match-marker";const co=et.getBody();return ar(et,rt,!1),yn?Nr(et.dom,cn,et.selection,zn):ks(et.dom,cn,co,zn)},uo=et=>{var rt;const cn=et.parentNode;et.firstChild&&cn.insertBefore(et.firstChild,et),(rt=et.parentNode)===null||rt===void 0||rt.removeChild(et)},Ps=(et,rt)=>{const cn=[],yn=ge.toArray(et.getBody().getElementsByTagName("span"));if(yn.length)for(let zn=0;zn<yn.length;zn++){const co=Xr(yn[zn]);co===null||!co.length||co===rt.toString()&&cn.push(yn[zn])}return cn},_t=(et,rt,cn)=>{const yn=rt.get();let zn=yn.index;const co=et.dom;cn?zn+1===yn.count?zn=0:zn++:zn-1===-1?zn=yn.count-1:zn--,co.removeClass(Ps(et,yn.index),"mce-match-marker-selected");const fo=Ps(et,zn);return fo.length?(co.addClass(Ps(et,zn),"mce-match-marker-selected"),et.selection.scrollIntoView(fo[0]),zn):-1},Ht=(et,rt)=>{const cn=rt.parentNode;et.remove(rt),cn&&et.isEmpty(cn)&&et.remove(cn)},Fn=(et,rt)=>{const yn="("+et.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]")+")";return rt?`(?:^|\\s|${W()})`+yn+`(?=$|\\s|${W()})`:yn},ao=(et,rt,cn,yn,zn,co)=>{const fo=et.selection,oo=Fn(cn,zn),Co=fo.isForward(),Io={regex:new RegExp(oo,yn?"g":"gi"),matchIndex:1},ls=xs(et,rt,Io,co);if(V.browser.isSafari()&&fo.setRng(fo.getRng(),Co),ls){const Js=_t(et,rt,!0);rt.set({index:Js,count:ls,text:cn,matchCase:yn,wholeWord:zn,inSelection:co})}return ls},Bo=(et,rt)=>{const cn=_t(et,rt,!0);rt.set({...rt.get(),index:cn})},is=(et,rt)=>{const cn=_t(et,rt,!1);rt.set({...rt.get(),index:cn})},yr=et=>{const rt=Xr(et);return rt!==null&&rt.length>0},wr=(et,rt,cn,yn,zn)=>{const co=rt.get(),fo=co.index;let oo,Co=fo;yn=yn!==!1;const Io=et.getBody(),ls=ge.grep(ge.toArray(Io.getElementsByTagName("span")),yr);for(let Js=0;Js<ls.length;Js++){const Es=Xr(ls[Js]);let Ja=oo=parseInt(Es,10);if(zn||Ja===co.index){for(cn.length?(ls[Js].innerText=cn,uo(ls[Js])):Ht(et.dom,ls[Js]);ls[++Js];)if(Ja=parseInt(Xr(ls[Js]),10),Ja===oo)Ht(et.dom,ls[Js]);else{Js--;break}yn&&Co--}else oo>fo&&ls[Js].setAttribute("data-mce-index",String(oo-1))}return rt.set({...co,count:zn?0:co.count-1,index:Co}),yn?Bo(et,rt):is(et,rt),!zn&&rt.get().count>0},ar=(et,rt,cn)=>{let yn,zn;const co=rt.get(),fo=ge.toArray(et.getBody().getElementsByTagName("span"));for(let oo=0;oo<fo.length;oo++){const Co=Xr(fo[oo]);Co!==null&&Co.length&&(Co===co.index.toString()&&(yn||(yn=fo[oo].firstChild),zn=fo[oo].firstChild),uo(fo[oo]))}if(rt.set({...co,index:-1,count:0,text:""}),yn&&zn){const oo=et.dom.createRng();return oo.setStart(yn,0),oo.setEnd(zn,zn.data.length),cn!==!1&&et.selection.setRng(oo),oo}else return},Xe=(et,rt)=>rt.get().count>1,qe=(et,rt)=>rt.get().count>1,Ft=(et,rt)=>({done:oo=>ar(et,rt,oo),find:(oo,Co,Io,ls=!1)=>ao(et,rt,oo,Co,Io,ls),next:()=>Bo(et,rt),prev:()=>is(et,rt),replace:(oo,Co,Io)=>wr(et,rt,oo,Co,Io)}),Yt=et=>{const rt=o(G.none()),cn=()=>rt.get().each(et);return{clear:()=>{cn(),rt.set(G.none())},isSet:()=>rt.get().isSome(),get:()=>rt.get(),set:oo=>{cn(),rt.set(G.some(oo))}}},mo=()=>{const et=Yt(B);return{...et,on:cn=>et.get().each(cn)}},$o=(et,rt)=>{const cn=mo();et.undoManager.add();const yn=ge.trim(et.selection.getContent({format:"text"})),zn=zo=>{zo.setEnabled("next",Xe(et,rt)),zo.setEnabled("prev",qe(et,rt))},co=zo=>{const Qo=zo.getData(),ns=rt.get();rt.set({...ns,matchCase:Qo.matchcase,wholeWord:Qo.wholewords,inSelection:Qo.inselection})},fo=(zo,Qo)=>{Ue(["replace","replaceall","prev","next"],na=>zo.setEnabled(na,!Qo))},oo=(zo,Qo)=>{Qo.redial(ta(zo,Qo.getData()))},Co=(zo,Qo)=>{V.browser.isSafari()&&V.deviceType.isTouch()&&(Qo==="find"||Qo==="replace"||Qo==="replaceall")&&zo.focus(Qo)},Io=zo=>{ar(et,rt,!1),fo(zo,!0),zn(zo)},ls=zo=>{const Qo=zo.getData(),ns=rt.get();if(!Qo.findtext.length){Io(zo);return}if(ns.text===Qo.findtext&&ns.matchCase===Qo.matchcase&&ns.wholeWord===Qo.wholewords)Bo(et,rt);else{const ca=ao(et,rt,Qo.findtext,Qo.matchcase,Qo.wholewords,Qo.inselection);ca<=0&&oo(!0,zo),fo(zo,ca===0)}zn(zo)},Js=rt.get(),Es={findtext:yn,replacetext:"",wholewords:Js.wholeWord,matchcase:Js.matchCase,inselection:Js.inSelection},Ja=zo=>{const Qo=[{type:"label",label:"Find",for:"findtext",items:[{type:"bar",items:[{type:"input",name:"findtext",maximized:!0,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",enabled:!1,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",enabled:!1,borderless:!0}]}]},{type:"input",name:"replacetext",label:"Replace with",inputMode:"search"}];return zo&&Qo.push({type:"alertbanner",level:"error",text:"Could not find the specified string.",icon:"warning"}),Qo},ta=(zo,Qo)=>({title:"Find and Replace",size:"normal",body:{type:"panel",items:Ja(zo)},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"},{type:"togglemenuitem",name:"inselection",text:"Find in selection"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",enabled:!1},{type:"custom",name:"replaceall",text:"Replace all",enabled:!1}],initialData:Qo,onChange:(ns,ca)=>{zo&&oo(!1,ns),ca.name==="findtext"&&rt.get().count>0&&Io(ns)},onAction:(ns,ca)=>{const na=ns.getData();switch(ca.name){case"find":ls(ns);break;case"replace":wr(et,rt,na.replacetext)?zn(ns):Io(ns);break;case"replaceall":wr(et,rt,na.replacetext,!0,!0),Io(ns);break;case"prev":is(et,rt),zn(ns);break;case"next":Bo(et,rt),zn(ns);break;case"matchcase":case"wholewords":case"inselection":oo(!1,ns),co(ns),Io(ns);break}Co(ns,ca.name)},onSubmit:ns=>{ls(ns),Co(ns,"find")},onClose:()=>{et.focus(),ar(et,rt),et.undoManager.add()}});cn.set(et.windowManager.open(ta(!1,Es),{inline:"toolbar"}))},Zo=(et,rt)=>{et.addCommand("SearchReplace",()=>{$o(et,rt)})},js=(et,rt)=>()=>{$o(et,rt)},ln=(et,rt)=>{et.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:js(et,rt),icon:"search"}),et.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:js(et,rt),icon:"search",shortcut:"Meta+F"}),et.shortcuts.add("Meta+F","",js(et,rt))};var Wt=()=>{s.add("searchreplace",et=>{const rt=o({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1,inSelection:!1});return Zo(et,rt),ln(et,rt),Ft(et,rt)})};Wt()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const s=(I,j,me)=>{var $e;return me(I,j.prototype)?!0:(($e=I.constructor)===null||$e===void 0?void 0:$e.name)===j.name},i=I=>{const j=typeof I;return I===null?"null":j==="object"&&Array.isArray(I)?"array":j==="object"&&s(I,String,(me,$e)=>$e.isPrototypeOf(me))?"string":j},u=I=>j=>i(j)===I,m=I=>j=>typeof j===I,h=I=>j=>I===j,b=u("string"),C=u("array"),x=m("boolean"),_=h(void 0),N=I=>I==null,O=I=>!N(I),B=m("function"),H=m("number"),Z=()=>{},J=(I,j)=>me=>I(j(me)),K=I=>()=>I,G=I=>I,W=(I,j)=>I===j;function V(I,...j){return(...me)=>{const $e=j.concat(me);return I.apply(null,$e)}}const ge=I=>{I()},Qe=K(!1),Ne=K(!0);class te{constructor(j,me){this.tag=j,this.value=me}static some(j){return new te(!0,j)}static none(){return te.singletonNone}fold(j,me){return this.tag?me(this.value):j()}isSome(){return this.tag}isNone(){return!this.tag}map(j){return this.tag?te.some(j(this.value)):te.none()}bind(j){return this.tag?j(this.value):te.none()}exists(j){return this.tag&&j(this.value)}forall(j){return!this.tag||j(this.value)}filter(j){return!this.tag||j(this.value)?this:te.none()}getOr(j){return this.tag?this.value:j}or(j){return this.tag?this:j}getOrThunk(j){return this.tag?this.value:j()}orThunk(j){return this.tag?this:j()}getOrDie(j){if(this.tag)return this.value;throw new Error(j??"Called getOrDie on None")}static from(j){return O(j)?te.some(j):te.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(j){this.tag&&j(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}te.singletonNone=new te(!1);const Ue=Object.keys,ut=Object.hasOwnProperty,lt=(I,j)=>{const me=Ue(I);for(let $e=0,dt=me.length;$e<dt;$e++){const on=me[$e],On=I[on];j(On,on)}},Oe=I=>(j,me)=>{I[me]=j},ue=(I,j,me,$e)=>{lt(I,(dt,on)=>{(j(dt,on)?me:$e)(dt,on)})},Pt=(I,j)=>{const me={};return ue(I,j,Oe(me),Z),me},ye=(I,j)=>{const me=[];return lt(I,($e,dt)=>{me.push(j($e,dt))}),me},De=I=>ye(I,G),R=I=>Ue(I).length,je=(I,j)=>be(I,j)?te.from(I[j]):te.none(),be=(I,j)=>ut.call(I,j),ot=(I,j)=>be(I,j)&&I[j]!==void 0&&I[j]!==null,nt=I=>{for(const j in I)if(ut.call(I,j))return!1;return!0},pe=Array.prototype.indexOf,Ze=Array.prototype.push,Tt=(I,j)=>pe.call(I,j),He=(I,j)=>Tt(I,j)>-1,vt=(I,j)=>{for(let me=0,$e=I.length;me<$e;me++){const dt=I[me];if(j(dt,me))return!0}return!1},Be=(I,j)=>{const me=[];for(let $e=0;$e<I;$e++)me.push(j($e));return me},ft=(I,j)=>{const me=I.length,$e=new Array(me);for(let dt=0;dt<me;dt++){const on=I[dt];$e[dt]=j(on,dt)}return $e},oe=(I,j)=>{for(let me=0,$e=I.length;me<$e;me++){const dt=I[me];j(dt,me)}},pn=(I,j)=>{for(let me=I.length-1;me>=0;me--){const $e=I[me];j($e,me)}},gt=(I,j)=>{const me=[],$e=[];for(let dt=0,on=I.length;dt<on;dt++){const On=I[dt];(j(On,dt)?me:$e).push(On)}return{pass:me,fail:$e}},St=(I,j)=>{const me=[];for(let $e=0,dt=I.length;$e<dt;$e++){const on=I[$e];j(on,$e)&&me.push(on)}return me},jt=(I,j,me)=>(pn(I,($e,dt)=>{me=j(me,$e,dt)}),me),Ct=(I,j,me)=>(oe(I,($e,dt)=>{me=j(me,$e,dt)}),me),ee=(I,j,me)=>{for(let $e=0,dt=I.length;$e<dt;$e++){const on=I[$e];if(j(on,$e))return te.some(on);if(me(on,$e))break}return te.none()},ie=(I,j)=>ee(I,j,Qe),ce=I=>{const j=[];for(let me=0,$e=I.length;me<$e;++me){if(!C(I[me]))throw new Error("Arr.flatten item "+me+" was not an array, input: "+I);Ze.apply(j,I[me])}return j},Y=(I,j)=>ce(ft(I,j)),we=(I,j)=>{for(let me=0,$e=I.length;me<$e;++me){const dt=I[me];if(j(dt,me)!==!0)return!1}return!0},Me=(I,j)=>{const me={};for(let $e=0,dt=I.length;$e<dt;$e++){const on=I[$e];me[String(on)]=j(on,$e)}return me},Pe=(I,j)=>j>=0&&j<I.length?te.some(I[j]):te.none(),mt=I=>Pe(I,0),We=I=>Pe(I,I.length-1),bt=(I,j)=>{for(let me=0;me<I.length;me++){const $e=j(I[me],me);if($e.isSome())return $e}return te.none()},$t=8,gn=9,Et=11,Bt=1,dn=3,_n=(I,j)=>{const $e=(j||document).createElement("div");if($e.innerHTML=I,!$e.hasChildNodes()||$e.childNodes.length>1){const dt="HTML does not have a single root node";throw console.error(dt,I),new Error(dt)}return Nt($e.childNodes[0])},xo=(I,j)=>{const $e=(j||document).createElement(I);return Nt($e)},Qn=(I,j)=>{const $e=(j||document).createTextNode(I);return Nt($e)},Nt=I=>{if(I==null)throw new Error("Node cannot be null or undefined");return{dom:I}},an={fromHtml:_n,fromTag:xo,fromText:Qn,fromDom:Nt,fromPoint:(I,j,me)=>te.from(I.dom.elementFromPoint(j,me)).map(Nt)},Nn=(I,j)=>{const me=I.dom;if(me.nodeType!==Bt)return!1;{const $e=me;if($e.matches!==void 0)return $e.matches(j);if($e.msMatchesSelector!==void 0)return $e.msMatchesSelector(j);if($e.webkitMatchesSelector!==void 0)return $e.webkitMatchesSelector(j);if($e.mozMatchesSelector!==void 0)return $e.mozMatchesSelector(j);throw new Error("Browser lacks native selectors")}},ko=I=>I.nodeType!==Bt&&I.nodeType!==gn&&I.nodeType!==Et||I.childElementCount===0,Ro=(I,j)=>{const me=j===void 0?document:j.dom;return ko(me)?[]:ft(me.querySelectorAll(I),an.fromDom)},ws=(I,j)=>{const me=j===void 0?document:j.dom;return ko(me)?te.none():te.from(me.querySelector(I)).map(an.fromDom)},yo=(I,j)=>I.dom===j.dom,Us=Nn;typeof window<"u"||Function("return this;")();const fn=I=>I.dom.nodeName.toLowerCase(),Ho=I=>I.dom.nodeType,tr=I=>j=>Ho(j)===I,rr=I=>Ho(I)===$t||fn(I)==="#comment",Ir=tr(Bt),Pr=tr(dn),ks=tr(gn),Nr=tr(Et),Xr=I=>j=>Ir(j)&&fn(j)===I,xs=I=>an.fromDom(I.dom.ownerDocument),uo=I=>ks(I)?I:xs(I),Ps=I=>te.from(I.dom.parentNode).map(an.fromDom),_t=(I,j)=>{const me=B(j)?j:Qe;let $e=I.dom;const dt=[];for(;$e.parentNode!==null&&$e.parentNode!==void 0;){const on=$e.parentNode,On=an.fromDom(on);if(dt.push(On),me(On)===!0)break;$e=on}return dt},Ht=I=>te.from(I.dom.previousSibling).map(an.fromDom),Fn=I=>te.from(I.dom.nextSibling).map(an.fromDom),ao=I=>ft(I.dom.childNodes,an.fromDom),Bo=(I,j)=>{const me=I.dom.childNodes;return te.from(me[j]).map(an.fromDom)},is=I=>Bo(I,0),yr=I=>Nr(I)&&O(I.dom.host),wr=I=>an.fromDom(I.dom.getRootNode()),ar=I=>{const j=wr(I);return yr(j)?te.some(j):te.none()},Xe=I=>an.fromDom(I.dom.host),qe=I=>{const j=Pr(I)?I.dom.parentNode:I.dom;if(j==null||j.ownerDocument===null)return!1;const me=j.ownerDocument;return ar(an.fromDom(j)).fold(()=>me.body.contains(j),J(qe,Xe))};var Ft=(I,j,me,$e,dt)=>I(me,$e)?te.some(me):B(dt)&&dt(me)?te.none():j(me,$e,dt);const Yt=(I,j,me)=>{let $e=I.dom;const dt=B(me)?me:Qe;for(;$e.parentNode;){$e=$e.parentNode;const on=an.fromDom($e);if(j(on))return te.some(on);if(dt(on))break}return te.none()},mo=(I,j,me)=>Ft((dt,on)=>on(dt),Yt,I,j,me),$o=(I,j)=>{const me=dt=>j(an.fromDom(dt));return ie(I.dom.childNodes,me).map(an.fromDom)},Zo=(I,j,me)=>Yt(I,$e=>Nn($e,j),me),js=(I,j)=>$o(I,me=>Nn(me,j)),ln=(I,j)=>ws(j,I),Wt=(I,j,me)=>Ft((dt,on)=>Nn(dt,on),Zo,I,j,me),et=I=>Wt(I,"[contenteditable]"),rt=(I,j=!1)=>qe(I)?I.dom.isContentEditable:et(I).fold(K(j),me=>cn(me)==="true"),cn=I=>I.dom.contentEditable,yn=I=>I.nodeName.toLowerCase(),zn=I=>an.fromDom(I.getBody()),co=I=>j=>yo(j,zn(I)),fo=I=>I?I.replace(/px$/,""):"",oo=I=>/^\d+(\.\d+)?$/.test(I)?I+"px":I,Co=I=>an.fromDom(I.selection.getStart()),Io=I=>an.fromDom(I.selection.getEnd()),ls=I=>mo(I,Xr("table")).forall(rt),Js=(I,j)=>St(ao(I),j),Es=(I,j)=>{let me=[];return oe(ao(I),$e=>{j($e)&&(me=me.concat([$e])),me=me.concat(Es($e,j))}),me},Ja=(I,j)=>Js(I,me=>Nn(me,j)),ta=(I,j)=>Ro(j,I),zo=(I,j,me)=>{if(b(me)||x(me)||H(me))I.setAttribute(j,me+"");else throw console.error("Invalid call to Attribute.set. Key ",j,":: Value ",me,":: Element ",I),new Error("Attribute value was not simple")},Qo=(I,j,me)=>{zo(I.dom,j,me)},ns=(I,j)=>{const me=I.dom;lt(j,($e,dt)=>{zo(me,dt,$e)})},ca=(I,j)=>{const me=I.dom.getAttribute(j);return me===null?void 0:me},na=(I,j)=>te.from(ca(I,j)),ua=(I,j)=>{I.dom.removeAttribute(j)},Ys=I=>Ct(I.dom.attributes,(j,me)=>(j[me.name]=me.value,j),{}),Yc=(I,j,me=W)=>I.exists($e=>me($e,j)),mi=I=>{const j=[],me=$e=>{j.push($e)};for(let $e=0;$e<I.length;$e++)I[$e].each(me);return j},ac=(I,j,me)=>I.isSome()&&j.isSome()?te.some(me(I.getOrDie(),j.getOrDie())):te.none(),cs=I=>I.bind(G),Mi=(I,j)=>I?te.some(j):te.none(),ir=(I,j)=>I.substring(j),Fl=(I,j,me)=>j===""||I.length>=j.length&&I.substr(me,me+j.length)===j,ai=(I,j)=>Ji(I,j)?ir(I,j.length):I,Ji=(I,j)=>Fl(I,j,0),Ll=(I=>j=>j.replace(I,""))(/^\s+|\s+$/g),pi=I=>I.length>0,Vl=I=>!pi(I),El=(I,j=10)=>{const me=parseInt(I,j);return isNaN(me)?te.none():te.some(me)},Hl=I=>{const j=parseFloat(I);return isNaN(j)?te.none():te.some(j)},Or=I=>I.style!==void 0&&B(I.style.getPropertyValue),Ri=(I,j,me)=>{if(!b(me))throw console.error("Invalid call to CSS.set. Property ",j,":: Value ",me,":: Element ",I),new Error("CSS value must be a string: "+me);Or(I)&&I.style.setProperty(j,me)},_l=(I,j)=>{Or(I)&&I.style.removeProperty(j)},kl=(I,j,me)=>{const $e=I.dom;Ri($e,j,me)},_c=(I,j)=>{const me=I.dom,dt=window.getComputedStyle(me).getPropertyValue(j);return dt===""&&!qe(I)?gi(me,j):dt},gi=(I,j)=>Or(I)?I.style.getPropertyValue(j):"",Fr=(I,j)=>{const me=I.dom,$e=gi(me,j);return te.from($e).filter(dt=>dt.length>0)},Wr=(I,j)=>{const me=I.dom;_l(me,j),Yc(na(I,"style").map(Ll),"")&&ua(I,"style")},Qa=(I,j,me=0)=>na(I,j).map($e=>parseInt($e,10)).getOr(me),ic=(I,j)=>lc(I,j,Ne),lc=(I,j,me)=>Y(ao(I),$e=>Nn($e,j)?me($e)?[$e]:[]:lc($e,j,me)),Na=["tfoot","thead","tbody","colgroup"],xe=I=>He(Na,I),Ge=(I,j)=>({rows:I,columns:j}),pt=(I,j,me)=>({element:I,rowspan:j,colspan:me}),Jt=(I,j,me,$e,dt,on)=>({element:I,rowspan:j,colspan:me,row:$e,column:dt,isLocked:on}),de=(I,j,me)=>({element:I,cells:j,section:me}),Se=(I,j,me,$e)=>({startRow:I,startCol:j,finishRow:me,finishCol:$e}),st=(I,j,me)=>({element:I,colspan:j,column:me}),Xt=(I,j)=>({element:I,columns:j}),In=(I,j,me=Qe)=>{if(me(j))return te.none();if(He(I,fn(j)))return te.some(j);const $e=dt=>Nn(dt,"table")||me(dt);return Zo(j,I.join(","),$e)},ae=(I,j)=>In(["td","th"],I,j),Ce=I=>ic(I,"th,td"),Ke=I=>Nn(I,"colgroup")?Ja(I,"col"):Y(Tn(I),j=>Ja(j,"col")),At=(I,j)=>Wt(I,"table",j),kn=I=>ic(I,"tr"),Tn=I=>At(I).fold(K([]),j=>Ja(j,"colgroup")),fs=(I,j)=>ft(I,me=>{if(fn(me)==="colgroup"){const $e=ft(Ke(me),dt=>{const on=Qa(dt,"span",1);return pt(dt,1,on)});return de(me,$e,"colgroup")}else{const $e=ft(Ce(me),dt=>{const on=Qa(dt,"rowspan",1),On=Qa(dt,"colspan",1);return pt(dt,on,On)});return de(me,$e,j(me))}}),Jr=I=>Ps(I).map(j=>{const me=fn(j);return xe(me)?me:"tbody"}).getOr("tbody"),tn=I=>{const j=kn(I),$e=[...Tn(I),...j];return fs($e,Jr)},da="data-snooker-locked-cols",Vs=I=>na(I,da).bind(j=>te.from(j.match(/\d+/g))).map(j=>Me(j,Ne)),cc=(I,j)=>I+","+j,Zr=(I,j,me)=>te.from(I.access[cc(j,me)]),us=(I,j,me)=>{const $e=hi(I,dt=>me(j,dt.element));return $e.length>0?te.some($e[0]):te.none()},hi=(I,j)=>{const me=Y(I.all,$e=>$e.cells);return St(me,j)},Oa=I=>{const j={};let me=0;return oe(I.cells,$e=>{const dt=$e.colspan;Be(dt,on=>{const On=me+on;j[On]=st($e.element,dt,On)}),me+=dt}),j},vi=I=>{const j={},me=[],dt=mt(I).map(Ol=>Ol.element).bind(At).bind(Vs).getOr({});let on=0,On=0,io=0;const{pass:Go,fail:ts}=gt(I,Ol=>Ol.section==="colgroup");oe(ts,Ol=>{const Yu=[];oe(Ol.cells,Zl=>{let wu=0;for(;j[cc(io,wu)]!==void 0;)wu++;const Bp=ot(dt,wu.toString()),Ip=Jt(Zl.element,Zl.rowspan,Zl.colspan,io,wu,Bp);for(let $l=0;$l<Zl.colspan;$l++)for(let Pp=0;Pp<Zl.rowspan;Pp++){const Fp=io+Pp,Kh=wu+$l,Mg=cc(Fp,Kh);j[Mg]=Ip,On=Math.max(On,Kh+1)}Yu.push(Ip)}),on++,me.push(de(Ol.element,Yu,Ol.section)),io++});const{columns:cr,colgroups:sr}=We(Go).map(Ol=>{const Yu=Oa(Ol);return{colgroups:[Xt(Ol.element,De(Yu))],columns:Yu}}).getOrThunk(()=>({colgroups:[],columns:{}}));return{grid:Ge(on,On),access:j,all:me,columns:cr,colgroups:sr}},Xc={fromTable:I=>{const j=tn(I);return vi(j)},generate:vi,getAt:Zr,findItem:us,filterItems:hi,justCells:I=>Y(I.all,j=>j.cells),justColumns:I=>De(I.columns),hasColumns:I=>Ue(I.columns).length>0,getColumnAt:(I,j)=>te.from(I.columns[j])};var $a=tinymce.util.Tools.resolve("tinymce.util.Tools");const Ua=(I,j,me)=>{const $e=I.select("td,th",j);let dt;for(let on=0;on<$e.length;on++){const On=I.getStyle($e[on],me);if(_(dt)&&(dt=On),dt!==On)return""}return dt},Bi=(I,j,me)=>{$a.each("left center right".split(" "),$e=>{$e!==me&&I.formatter.remove("align"+$e,{},j)}),me&&I.formatter.apply("align"+me,{},j)},pu=(I,j,me)=>{$a.each("top middle bottom".split(" "),$e=>{$e!==me&&I.formatter.remove("valign"+$e,{},j)}),me&&I.formatter.apply("valign"+me,{},j)},Re=(I,j,me)=>{I.dispatch("TableModified",{...me,table:j})},Fe=(I,j)=>Hl(I).getOr(j),Dt=(I,j,me)=>Fe(_c(I,j),me),nn=(I,j,me,$e)=>{const dt=Dt(I,`padding-${me}`,0),on=Dt(I,`padding-${$e}`,0),On=Dt(I,`border-${me}-width`,0),io=Dt(I,`border-${$e}-width`,0);return j-dt-on-On-io},vo=(I,j)=>{const me=I.dom,$e=me.getBoundingClientRect().width||me.offsetWidth;return j==="border-box"?$e:nn(I,$e,"left","right")},rs=I=>vo(I,"content-box");var lr=tinymce.util.Tools.resolve("tinymce.Env");const ga="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol",Qi=Be(5,I=>{const j=`${I+1}px`;return{title:j,value:j}}),bi=ft(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],I=>({title:I,value:I.toLowerCase()})),$r="100%",sa=I=>{var j;const me=I.dom,$e=(j=me.getParent(I.selection.getStart(),me.isBlock))!==null&&j!==void 0?j:I.getBody();return rs(an.fromDom($e))+"px"},Ea=(I,j)=>of(I)||!zl(I)?j:km(I)?{...j,width:sa(I)}:{...j,width:$r},ii=(I,j)=>of(I)||zl(I)?j:km(I)?{...j,width:sa(I)}:{...j,width:$r},Qr=I=>j=>j.options.get(I),ja=I=>{const j=I.options.register;j("table_border_widths",{processor:"object[]",default:Qi}),j("table_border_styles",{processor:"object[]",default:bi}),j("table_cell_advtab",{processor:"boolean",default:!0}),j("table_row_advtab",{processor:"boolean",default:!0}),j("table_advtab",{processor:"boolean",default:!0}),j("table_appearance_options",{processor:"boolean",default:!0}),j("table_grid",{processor:"boolean",default:!lr.deviceType.isTouch()}),j("table_cell_class_list",{processor:"object[]",default:[]}),j("table_row_class_list",{processor:"object[]",default:[]}),j("table_class_list",{processor:"object[]",default:[]}),j("table_toolbar",{processor:"string",default:ga}),j("table_background_color_map",{processor:"object[]",default:[]}),j("table_border_color_map",{processor:"object[]",default:[]})},Ks=Qr("table_sizing_mode"),Jc=Qr("table_border_widths"),_m=Qr("table_border_styles"),Lu=Qr("table_cell_advtab"),ef=Qr("table_row_advtab"),tf=Qr("table_advtab"),dd=Qr("table_appearance_options"),fd=Qr("table_grid"),zl=Qr("table_style_by_css"),Ii=Qr("table_cell_class_list"),Fh=Qr("table_row_class_list"),gu=Qr("table_class_list"),xp=Qr("table_toolbar"),nf=Qr("table_background_color_map"),Ep=Qr("table_border_color_map"),km=I=>Ks(I)==="fixed",of=I=>Ks(I)==="responsive",Tm=I=>{const j=I.options,me=j.get("table_default_styles");return j.isSet("table_default_styles")?me:Ea(I,me)},_p=I=>{const j=I.options,me=j.get("table_default_attributes");return j.isSet("table_default_attributes")?me:ii(I,me)},md=(I,j)=>j.column>=I.startCol&&j.column+j.colspan-1<=I.finishCol&&j.row>=I.startRow&&j.row+j.rowspan-1<=I.finishRow,kp=(I,j)=>{let me=!0;const $e=V(md,j);for(let dt=j.startRow;dt<=j.finishRow;dt++)for(let on=j.startCol;on<=j.finishCol;on++)me=me&&Xc.getAt(I,dt,on).exists($e);return me?te.some(j):te.none()},tt=(I,j)=>Se(Math.min(I.row,j.row),Math.min(I.column,j.column),Math.max(I.row+I.rowspan-1,j.row+j.rowspan-1),Math.max(I.column+I.colspan-1,j.column+j.colspan-1)),sf=(I,j,me)=>{const $e=Xc.findItem(I,j,yo),dt=Xc.findItem(I,me,yo);return $e.bind(on=>dt.map(On=>tt(on,On)))},cl=(I,j,me)=>sf(I,j,me).bind($e=>kp(I,$e)),Fv=(I,j,me)=>{const $e=Lh(I);return cl($e,j,me)},Lh=Xc.fromTable,pd=(I,j)=>{Ps(I).each($e=>{$e.dom.insertBefore(j.dom,I.dom)})},$s=(I,j)=>{Fn(I).fold(()=>{Ps(I).each(dt=>{yi(dt,j)})},$e=>{pd($e,j)})},ra=(I,j)=>{is(I).fold(()=>{yi(I,j)},$e=>{I.dom.insertBefore(j.dom,$e.dom)})},yi=(I,j)=>{I.dom.appendChild(j.dom)},Vu=(I,j)=>{pd(I,j),yi(j,I)},Tg=(I,j)=>{oe(j,(me,$e)=>{const dt=$e===0?I:j[$e-1];$s(dt,me)})},rf=(I,j)=>{oe(j,me=>{yi(I,me)})},Pi=I=>{const j=I.dom;j.parentNode!==null&&j.parentNode.removeChild(j)},Am=I=>{const j=ao(I);j.length>0&&Tg(I,j),Pi(I)},Hu=((I,j)=>{const me=on=>{if(!I(on))throw new Error("Can only get "+j+" value of a "+j+" node");return $e(on).getOr("")},$e=on=>I(on)?te.from(on.dom.nodeValue):te.none();return{get:me,getOption:$e,set:(on,On)=>{if(!I(on))throw new Error("Can only set raw "+j+" value of a "+j+" node");on.dom.nodeValue=On}}})(Pr,"text"),zu=I=>Hu.get(I),Pf=(I,j)=>Hu.set(I,j);var uc=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Om=()=>{const I=ts=>an.fromDom(ts.dom.cloneNode(!1)),j=ts=>uo(ts).dom,me=ts=>Ir(ts)?fn(ts)==="body"?!0:He(uc,fn(ts)):!1,$e=ts=>Ir(ts)?He(["br","img","hr","input"],fn(ts)):!1,dt=ts=>Ir(ts)&&ca(ts,"contenteditable")==="false",on=(ts,cr)=>ts.dom.compareDocumentPosition(cr.dom),On=(ts,cr)=>{const sr=Ys(ts);ns(cr,sr)},io=ts=>{const cr=fn(ts);return He(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],cr)},Go=ts=>Ir(ts)?na(ts,"lang"):te.none();return{up:K({selector:Zo,closest:Wt,predicate:Yt,all:_t}),down:K({selector:ta,predicate:Es}),styles:K({get:_c,getRaw:Fr,set:kl,remove:Wr}),attrs:K({get:ca,set:Qo,remove:ua,copyTo:On}),insert:K({before:pd,after:$s,afterAll:Tg,append:yi,appendAll:rf,prepend:ra,wrap:Vu}),remove:K({unwrap:Am,remove:Pi}),create:K({nu:an.fromTag,clone:I,text:an.fromText}),query:K({comparePosition:on,prevSibling:Ht,nextSibling:Fn}),property:K({children:ao,name:fn,parent:Ps,document:j,isText:Pr,isComment:rr,isElement:Ir,isSpecial:io,getLanguage:Go,getText:zu,setText:Pf,isBoundary:me,isEmptyTag:$e,isNonEditable:dt}),eq:yo,is:Us}};const li=(I,j,me,$e)=>{const dt=me[0],on=me.slice(1);return $e(I,j,dt,on)},Uu=(I,j,me)=>me.length>0?li(I,j,me,kc):te.none(),kc=(I,j,me,$e)=>{const dt=j(I,me);return jt($e,(on,On)=>{const io=j(I,On);return Fi(I,on,io)},dt)},Fi=(I,j,me)=>j.bind($e=>me.filter(V(I.eq,$e))),gd=Uu,Vh=Om(),$m=(I,j)=>gd(Vh,(me,$e)=>I($e),j),Qc=I=>Zo(I,"table"),af=(I,j)=>{const me=ta(I,j);return me.length>0?te.some(me):te.none()},Hh=(I,j,me)=>ln(I,j).bind($e=>ln(I,me).bind(dt=>$m(Qc,[$e,dt]).map(on=>({first:$e,last:dt,table:on})))),Tp=(I,j)=>af(I,j),zh=(I,j,me)=>Hh(I,j,me).bind($e=>{const dt=Go=>yo(I,Go),on="thead,tfoot,tbody,table",On=Zo($e.first,on,dt),io=Zo($e.last,on,dt);return On.bind(Go=>io.bind(ts=>yo(Go,ts)?Fv($e.table,$e.first,$e.last):te.none()))}),Uh=I=>ft(I,an.fromDom),Ap="data-mce-selected",ju="td["+Ap+"],th["+Ap+"]",Dm="data-mce-first-selected",hu="td["+Dm+"],th["+Dm+"]",Lr="data-mce-last-selected",Wa="td["+Lr+"],th["+Lr+"]",ul={selected:Ap,selectedSelector:ju,firstSelected:Dm,firstSelectedSelector:hu,lastSelected:Lr,lastSelectedSelector:Wa},Mm=I=>At(I).bind(j=>Tp(j,ul.firstSelectedSelector)).fold(K(I),j=>j[0]),Ff=I=>(j,me)=>{const $e=fn(j),dt=$e==="col"||$e==="colgroup"?Mm(j):j;return Wt(dt,I,me)},Za=Ff("th,td,caption"),ho=Ff("th,td"),Rm=I=>Uh(I.model.table.getSelectedCells()),Wu=(I,j)=>{const me=ho(I),$e=me.bind(dt=>At(dt)).map(dt=>kn(dt));return ac(me,$e,(dt,on)=>St(on,On=>vt(Uh(On.dom.cells),io=>ca(io,j)==="1"||yo(io,dt)))).getOr([])},dl=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],Ws=I=>({value:Ag(I)}),lf=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Bm=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Np=I=>lf.test(I)||Bm.test(I),Ag=I=>ai(I,"#").toUpperCase(),es=I=>Np(I)?te.some({value:Ag(I)}):te.none(),ha=I=>{const j=I.toString(16);return(j.length===1?"0"+j:j).toUpperCase()},hd=I=>{const j=ha(I.red)+ha(I.green)+ha(I.blue);return Ws(j)},Tl=/^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i,fl=/^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i,Ul=(I,j,me,$e)=>({red:I,green:j,blue:me,alpha:$e}),ei=(I,j,me,$e)=>{const dt=parseInt(I,10),on=parseInt(j,10),On=parseInt(me,10),io=parseFloat($e);return Ul(dt,on,On,io)},el=I=>{const j=Tl.exec(I);if(j!==null)return te.some(ei(j[1],j[2],j[3],"1"));const me=fl.exec(I);return me!==null?te.some(ei(me[1],me[2],me[3],me[4])):te.none()},dc=I=>es(I).orThunk(()=>el(I).map(hd)).getOrThunk(()=>{const j=document.createElement("canvas");j.height=1,j.width=1;const me=j.getContext("2d");me.clearRect(0,0,j.width,j.height),me.fillStyle="#FFFFFF",me.fillStyle=I,me.fillRect(0,0,1,1);const $e=me.getImageData(0,0,1,1).data,dt=$e[0],on=$e[1],On=$e[2],io=$e[3];return hd(Ul(dt,on,On,io))}),Op=I=>el(I).map(hd).map(j=>"#"+j.value).getOr(I),Dr=I=>{let j=I;return{get:()=>j,set:dt=>{j=dt}}},$p=I=>{const j=Dr(te.none()),me=()=>j.get().each(I);return{clear:()=>{me(),j.set(te.none())},isSet:()=>j.get().isSome(),get:()=>j.get(),set:io=>{me(),j.set(te.some(io))}}},_a=()=>$p(I=>I.unbind()),vd=(I,j,me)=>$e=>{const dt=_a(),on=Vl(me),On=()=>{const io=Rm(I),Go=ts=>I.formatter.match(j,{value:me},ts.dom,on);on?($e.setActive(!vt(io,Go)),dt.set(I.formatter.formatChanged(j,ts=>$e.setActive(!ts),!0))):($e.setActive(we(io,Go)),dt.set(I.formatter.formatChanged(j,$e.setActive,!1,{value:me})))};return I.initialized?On():I.on("init",On),dt.clear},vu=I=>ot(I,"menu"),ur=I=>ft(I,j=>{const me=j.text||j.title||"";return vu(j)?{text:me,items:ur(j.menu)}:{text:me,value:j.value}}),eu=I=>I.length?te.some(ur([{text:"Select...",value:"mce-no-match"},...I])):te.none(),Lf=(I,j,me,$e)=>ft(j,dt=>{const on=dt.text||dt.title;return vu(dt)?{type:"nestedmenuitem",text:on,getSubmenuItems:()=>Lf(I,dt.menu,me,$e)}:{text:on,type:"togglemenuitem",onAction:()=>$e(dt.value),onSetup:vd(I,me,dt.value)}}),bd=(I,j)=>me=>{I.execCommand("mceTableApplyCellStyle",!1,{[j]:me})},Mr=I=>Y(I,j=>vu(j)?[{...j,menu:Mr(j.menu)}]:pi(j.value)?[j]:[]),Zu=(I,j,me,$e)=>dt=>dt(Lf(I,j,me,$e)),fc=(I,j,me)=>{const $e=ft(j,dt=>({text:dt.title,value:"#"+dc(dt.value).value,type:"choiceitem"}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:$e.length>0?$e:void 0,allowCustomColors:!1},onAction:dt=>{const on=dt.value==="remove"?"":dt.value;I.execCommand("mceTableApplyCellStyle",!1,{[me]:on})}}]},vs=I=>()=>{const me=I.queryCommandValue("mceTableRowType")==="header"?"body":"header";I.execCommand("mceTableRowType",!1,{type:me})},cf=I=>()=>{const me=I.queryCommandValue("mceTableColType")==="th"?"td":"th";I.execCommand("mceTableColType",!1,{type:me})},Dp=I=>eu(Ii(I)).map(j=>({name:"class",type:"listbox",label:"Class",items:j})),L=[{name:"width",type:"input",label:"Width"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:dl}],ne=I=>L.concat(Dp(I).toArray()),ve=(I,j)=>{const $e=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(ur(_m(I)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:j==="cell"?[{name:"borderwidth",type:"input",label:"Border width"}].concat($e):$e}},ct={normal:(I,j)=>{const me=I.dom;return{setAttrib:(On,io)=>{me.setAttrib(j,On,io)},setStyle:(On,io)=>{me.setStyle(j,On,io)},setFormat:(On,io)=>{io===""?I.formatter.remove(On,{value:null},j,!0):I.formatter.apply(On,{value:io},j)}}}},wn=Xr("th"),Do=(I,j)=>I&&j?"sectionCells":I?"section":"cells",os=I=>{const j=I.section==="thead",me=Yc(Xo(I.cells),"th");return I.section==="tfoot"?{type:"footer"}:j||me?{type:"header",subType:Do(j,me)}:{type:"body"}},Xo=I=>{const j=St(I,me=>wn(me.element));return j.length===0?te.some("td"):j.length===I.length?te.some("th"):te.none()},po=I=>{const j=ft(I,dt=>os(dt).type),me=He(j,"header"),$e=He(j,"footer");if(!me&&!$e)return te.some("body");{const dt=He(j,"body");return me&&!dt&&!$e?te.some("header"):!me&&!dt&&$e?te.some("footer"):te.none()}},Vr=I=>{let j=!1,me;return(...$e)=>(j||(j=!0,me=I.apply(null,$e)),me)},aa=(I,j)=>bt(I.all,me=>ie(me.cells,$e=>yo(j,$e.element))),mc=(I,j,me)=>{const $e=ft(j.selection,on=>ae(on).bind(On=>aa(I,On)).filter(me)),dt=mi($e);return Mi(dt.length>0,dt)},jl=(I,j)=>j.mergable,Lv=(I,j)=>j.unmergable,Vf=(I,j)=>mc(I,j,Ne),jh=(I,j)=>aa(I,j).exists(me=>!me.isLocked),Li=(I,j)=>we(j,me=>jh(I,me)),Wh=(I,j)=>jl(I,j).filter(me=>Li(I,me.cells)),W0=(I,j)=>Lv(I,j).filter(me=>Li(I,me));({...{generate:I=>{if(!C(I))throw new Error("cases must be an array");if(I.length===0)throw new Error("there must be at least one case");const j=[],me={};return oe(I,($e,dt)=>{const on=Ue($e);if(on.length!==1)throw new Error("one and only one name per case");const On=on[0],io=$e[On];if(me[On]!==void 0)throw new Error("duplicate key detected:"+On);if(On==="cata")throw new Error("cannot have a case named cata (sorry)");if(!C(io))throw new Error("case arguments must be an array");j.push(On),me[On]=(...Go)=>{const ts=Go.length;if(ts!==io.length)throw new Error("Wrong number of arguments to case "+On+". Expected "+io.length+" ("+io+"), got "+ts);return{fold:(...sr)=>{if(sr.length!==I.length)throw new Error("Wrong number of arguments to fold. Expected "+I.length+", got "+sr.length);return sr[dt].apply(null,Go)},match:sr=>{const qr=Ue(sr);if(j.length!==qr.length)throw new Error("Wrong number of arguments to match. Expected: "+j.join(",")+`
113
113
  Actual: `+qr.join(","));if(!we(j,Yu=>He(qr,Yu)))throw new Error("Not all branches were specified when using match. Specified: "+qr.join(", ")+`
114
114
  Required: `+j.join(", "));return sr[On].apply(null,Go)},log:sr=>{console.log(sr,{constructors:j,constructor:On,params:Go})}}}}),me}}.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])});const Vv=(I,j)=>{const me=Xc.fromTable(I);return Vf(me,j).bind(dt=>{const on=dt[dt.length-1],On=dt[0].row,io=on.row+on.rowspan,Go=me.all.slice(On,io);return po(Go)}).getOr("")},Hi=I=>Ji(I,"rgb")?Op(I):I,Lo=I=>{const j=an.fromDom(I);return{borderwidth:Fr(j,"border-width").getOr(""),borderstyle:Fr(j,"border-style").getOr(""),bordercolor:Fr(j,"border-color").map(Hi).getOr(""),backgroundcolor:Fr(j,"background-color").map(Hi).getOr("")}},tu=I=>{const j=I[0],me=I.slice(1);return oe(me,$e=>{oe(Ue(j),dt=>{lt($e,(on,On)=>{const io=j[dt];io!==""&&dt===On&&io!==on&&(j[dt]=dt==="class"?"mce-no-match":"")})})}),j},Im=(I,j,me,$e)=>ie(I,dt=>!_(me.formatter.matchNode($e,j+dt))).getOr(""),Mp=V(Im,["left","center","right"],"align"),Z0=V(Im,["top","middle","bottom"],"valign"),qh=(I,j)=>{const me=Tm(I),$e=_p(I),dt=()=>({borderstyle:je(me,"border-style").getOr(""),bordercolor:Hi(je(me,"border-color").getOr("")),backgroundcolor:Hi(je(me,"background-color").getOr(""))}),on={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""},On=()=>{const cr=me["border-width"];return zl(I)&&cr?{border:cr}:je($e,"border").fold(()=>({}),sr=>({border:sr}))},io=j?dt():{},Go=()=>{const cr=je(me,"border-spacing").or(je($e,"cellspacing")).fold(()=>({}),qr=>({cellspacing:qr})),sr=je(me,"border-padding").or(je($e,"cellpadding")).fold(()=>({}),qr=>({cellpadding:qr}));return{...cr,...sr}};return{...on,...me,...$e,...io,...On(),...Go()}},bu=I=>At(an.fromDom(I)).map(j=>{const me={selection:Uh(I.cells)};return Vv(j,me)}).getOr(""),yd=(I,j,me)=>{const $e=(io,Go)=>{const ts=Fr(an.fromDom(Go),"border-width");return zl(I)&&ts.isSome()?ts.getOr(""):io.getAttrib(Go,"border")||Ua(I.dom,Go,"border-width")||Ua(I.dom,Go,"border")||""},dt=I.dom,on=zl(I)?dt.getStyle(j,"border-spacing")||dt.getAttrib(j,"cellspacing"):dt.getAttrib(j,"cellspacing")||dt.getStyle(j,"border-spacing"),On=zl(I)?Ua(dt,j,"padding")||dt.getAttrib(j,"cellpadding"):dt.getAttrib(j,"cellpadding")||Ua(dt,j,"padding");return{width:dt.getStyle(j,"width")||dt.getAttrib(j,"width"),height:dt.getStyle(j,"height")||dt.getAttrib(j,"height"),cellspacing:on??"",cellpadding:On??"",border:$e(dt,j),caption:!!dt.select("caption",j)[0],class:dt.getAttrib(j,"class",""),align:Mp(I,j),...me?Lo(j):{}}},Hf=(I,j,me)=>{const $e=I.dom;return{height:$e.getStyle(j,"height")||$e.getAttrib(j,"height"),class:$e.getAttrib(j,"class",""),type:bu(j),align:Mp(I,j),...me?Lo(j):{}}},Gn=(I,j,me,$e)=>{const dt=I.dom,on=$e.getOr(j);return{width:((io,Go)=>dt.getStyle(io,Go)||dt.getAttrib(io,Go))(on,"width"),scope:dt.getAttrib(j,"scope"),celltype:yn(j),class:dt.getAttrib(j,"class",""),halign:Mp(I,j),valign:Z0(I,j),...me?Lo(j):{}}},Tc=(I,j)=>{const me=Xc.fromTable(I),$e=Xc.justCells(me),dt=St($e,on=>vt(j,On=>yo(on.element,On)));return ft(dt,on=>({element:on.element.dom,column:Xc.getColumnAt(me,on.column).map(On=>On.element.dom)}))},Hv=(I,j,me,$e)=>{$e("scope")&&I.setAttrib("scope",me.scope),$e("class")&&me.class!=="mce-no-match"&&I.setAttrib("class",me.class),$e("width")&&j.setStyle("width",oo(me.width))},Pm=(I,j,me)=>{me("backgroundcolor")&&I.setFormat("tablecellbackgroundcolor",j.backgroundcolor),me("bordercolor")&&I.setFormat("tablecellbordercolor",j.bordercolor),me("borderstyle")&&I.setFormat("tablecellborderstyle",j.borderstyle),me("borderwidth")&&I.setFormat("tablecellborderwidth",oo(j.borderwidth))},yu=(I,j,me,$e)=>{const dt=j.length===1;oe(j,on=>{const On=on.element,io=dt?Ne:$e,Go=ct.normal(I,On),ts=on.column.map(cr=>ct.normal(I,cr)).getOr(Go);Hv(Go,ts,me,io),Lu(I)&&Pm(Go,me,io),$e("halign")&&Bi(I,On,me.halign),$e("valign")&&pu(I,On,me.valign)})},Ng=(I,j)=>{I.execCommand("mceTableCellType",!1,{type:j.celltype,no_events:!0})},zf=(I,j,me,$e)=>{const dt=Pt($e,(on,On)=>me[On]!==on);R(dt)>0&&j.length>=1&&At(j[0]).each(on=>{const On=Tc(on,j),io=R(Pt(dt,(ts,cr)=>cr!=="scope"&&cr!=="celltype"))>0,Go=be(dt,"celltype");(io||be(dt,"scope"))&&yu(I,On,$e,V(be,dt)),Go&&Ng(I,$e),Re(I,on.dom,{structure:Go,style:io})})},Fm=(I,j,me,$e)=>{const dt=$e.getData();$e.close(),I.undoManager.transact(()=>{zf(I,j,me,dt),I.focus()})},Og=(I,j)=>{const me=At(j[0]).map($e=>ft(Tc($e,j),dt=>Gn(I,dt.element,Lu(I),dt.column)));return tu(me.getOrDie())},Gu=I=>{const j=Rm(I);if(j.length===0)return;const me=Og(I,j),$e={type:"tabpanel",tabs:[{title:"General",name:"general",items:ne(I)},ve(I,"cell")]},dt={type:"panel",items:[{type:"grid",columns:2,items:ne(I)}]};I.windowManager.open({title:"Cell Properties",size:"normal",body:Lu(I)?$e:dt,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:me,onSubmit:V(Fm,I,j,me)})},G0=I=>eu(Fh(I)).map(j=>({name:"class",type:"listbox",label:"Class",items:j})),ia=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],Sn=I=>ia.concat(G0(I).toArray()),Al=(I,j,me)=>{me("class")&&j.class!=="mce-no-match"&&I.setAttrib("class",j.class),me("height")&&I.setStyle("height",oo(j.height))},qu=(I,j,me)=>{me("backgroundcolor")&&I.setStyle("background-color",j.backgroundcolor),me("bordercolor")&&I.setStyle("border-color",j.bordercolor),me("borderstyle")&&I.setStyle("border-style",j.borderstyle)},ti=(I,j,me,$e)=>{const on=j.length===1?Ne:$e;oe(j,On=>{const io=Ja(an.fromDom(On),"td,th"),Go=ct.normal(I,On);Al(Go,me,on),ef(I)&&qu(Go,me,on),$e("height")&&oe(io,ts=>{I.dom.setStyle(ts.dom,"height",null)}),$e("align")&&Bi(I,On,me.align)})},Rp=(I,j)=>{I.execCommand("mceTableRowType",!1,{type:j.type,no_events:!0})},ni=(I,j,me,$e)=>{const dt=Pt($e,(on,On)=>me[On]!==on);if(R(dt)>0){const on=be(dt,"type"),On=on?R(dt)>1:!0;On&&ti(I,j,$e,V(be,dt)),on&&Rp(I,$e),At(an.fromDom(j[0])).each(io=>Re(I,io.dom,{structure:on,style:On}))}},Fs=(I,j,me,$e)=>{const dt=$e.getData();$e.close(),I.undoManager.transact(()=>{ni(I,j,me,dt),I.focus()})},Yh=I=>{const j=Wu(Co(I),ul.selected);if(j.length===0)return;const me=ft(j,On=>Hf(I,On.dom,ef(I))),$e=tu(me),dt={type:"tabpanel",tabs:[{title:"General",name:"general",items:Sn(I)},ve(I,"row")]},on={type:"panel",items:[{type:"grid",columns:2,items:Sn(I)}]};I.windowManager.open({title:"Row Properties",size:"normal",body:ef(I)?dt:on,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:$e,onSubmit:V(Fs,I,ft(j,On=>On.dom),$e)})},sn=(I,j,me)=>{const $e=me?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],dt=[{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}],on=dd(I)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],On=[{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}],io=j.length>0?[{name:"class",type:"listbox",label:"Class",items:j}]:[];return $e.concat(dt).concat(on).concat(On).concat(io)},Ls=(I,j,me,$e)=>{if(j.tagName==="TD"||j.tagName==="TH")b(me)&&O($e)?I.setStyle(j,me,$e):I.setStyles(j,me);else if(j.children)for(let dt=0;dt<j.children.length;dt++)Ls(I,j.children[dt],me,$e)},zv=(I,j,me,$e)=>{const dt=I.dom,on={},On={},io=zl(I),Go=tf(I),ts=parseFloat(me.border)===0;if(!_(me.class)&&me.class!=="mce-no-match"&&(on.class=me.class),On.height=oo(me.height),io?On.width=oo(me.width):dt.getAttrib(j,"width")&&(on.width=fo(me.width)),io?(ts?(on.border=0,On["border-width"]=""):(On["border-width"]=oo(me.border),on.border=1),On["border-spacing"]=oo(me.cellspacing)):(on.border=ts?0:me.border,on.cellpadding=me.cellpadding,on.cellspacing=me.cellspacing),io&&j.children){const cr={};if(ts?cr["border-width"]="":$e.border&&(cr["border-width"]=oo(me.border)),$e.cellpadding&&(cr.padding=oo(me.cellpadding)),Go&&$e.bordercolor&&(cr["border-color"]=me.bordercolor),!nt(cr))for(let sr=0;sr<j.children.length;sr++)Ls(dt,j.children[sr],cr)}if(Go){const cr=me;On["background-color"]=cr.backgroundcolor,On["border-color"]=cr.bordercolor,On["border-style"]=cr.borderstyle}dt.setStyles(j,{...Tm(I),...On}),dt.setAttribs(j,{..._p(I),...on})},Da=(I,j,me,$e)=>{const dt=I.dom,on=$e.getData(),On=Pt(on,(io,Go)=>me[Go]!==io);$e.close(),I.undoManager.transact(()=>{if(!j){const io=El(on.cols).getOr(1),Go=El(on.rows).getOr(1);I.execCommand("mceInsertTable",!1,{rows:Go,columns:io}),j=ho(Co(I),co(I)).bind(ts=>At(ts,co(I))).map(ts=>ts.dom).getOrDie()}if(R(On)>0){const io={border:be(On,"border"),bordercolor:be(On,"bordercolor"),cellpadding:be(On,"cellpadding")};zv(I,j,on,io);const Go=dt.select("caption",j)[0];(Go&&!on.caption||!Go&&on.caption)&&I.execCommand("mceTableToggleCaption"),Bi(I,j,on.align)}if(I.focus(),I.addVisual(),R(On)>0){const io=be(On,"caption"),Go=io?R(On)>1:!0;Re(I,j,{structure:io,style:Go})}})},nu=(I,j)=>{const me=I.dom;let $e,dt=qh(I,tf(I));j?(dt.cols="1",dt.rows="1",tf(I)&&(dt.borderstyle="",dt.bordercolor="",dt.backgroundcolor="")):($e=me.getParent(I.selection.getStart(),"table",I.getBody()),$e?dt=yd(I,$e,tf(I)):tf(I)&&(dt.borderstyle="",dt.bordercolor="",dt.backgroundcolor=""));const on=eu(gu(I));on.isSome()&&dt.class&&(dt.class=dt.class.replace(/\s*mce\-item\-table\s*/g,""));const On={type:"grid",columns:2,items:sn(I,on.getOr([]),j)},io=()=>({type:"panel",items:[On]}),Go=()=>({type:"tabpanel",tabs:[{title:"General",name:"general",items:[On]},ve(I,"table")]}),ts=tf(I)?Go():io();I.windowManager.open({title:"Table Properties",size:"normal",body:ts,onSubmit:V(Da,I,$e,dt),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:dt})},wi=I=>{const j=me=>{ls(Co(I))&&me()};lt({mceTableProps:V(nu,I,!1),mceTableRowProps:V(Yh,I),mceTableCellProps:V(Gu,I),mceInsertTableDialog:V(nu,I,!0)},(me,$e)=>I.addCommand($e,()=>j(me)))},C2=(I,j)=>js(I,j).isSome(),wd=G,q0=I=>{const j=($e,dt)=>na($e,dt).exists(on=>parseInt(on,10)>1),me=$e=>j($e,"rowspan")||j($e,"colspan");return I.length>0&&we(I,me)?te.some(I):te.none()},Wl=(I,j,me)=>j.length<=1?te.none():zh(I,me.firstSelectedSelector,me.lastSelectedSelector).map($e=>({bounds:$e,cells:j})),Hs=I=>({element:I,mergable:te.none(),unmergable:te.none(),selection:[I]}),Cd=(I,j,me)=>({element:me,mergable:Wl(j,I,ul),unmergable:q0(I),selection:wd(I)}),$g=I=>{const j=Dr(te.none()),me=Dr([]);let $e=te.none();const dt=Xr("caption"),on=Ds=>$e.forall(Cr=>!Cr[Ds]),On=()=>Za(Co(I),co(I)),io=()=>Za(Io(I),co(I)),Go=()=>On().bind(Ds=>cs(ac(At(Ds),io().bind(At),(Cr,Gl)=>yo(Cr,Gl)?dt(Ds)?te.some(Hs(Ds)):te.some(Cd(Rm(I),Cr,Ds)):te.none()))),ts=Ds=>At(Ds.element).map(Gl=>{const ka=Xc.fromTable(Gl),Xh=Vf(ka,Ds).getOr([]),Rg=Ct(Xh,(Uf,gc)=>(gc.isLocked&&(Uf.onAny=!0,gc.column===0?Uf.onFirst=!0:gc.column+gc.colspan>=ka.grid.columns&&(Uf.onLast=!0)),Uf),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:Wh(ka,Ds).isSome(),unmergeable:W0(ka,Ds).isSome(),locked:Rg}}),cr=()=>{j.set(Vr(Go)()),$e=j.get().bind(ts),oe(me.get(),ge)},sr=Ds=>(Ds(),me.set(me.get().concat([Ds])),()=>{me.set(St(me.get(),Cr=>Cr!==Ds))}),qr=(Ds,Cr)=>sr(()=>j.get().fold(()=>{Ds.setEnabled(!1)},Gl=>{Ds.setEnabled(!Cr(Gl)&&I.selection.isEditable())})),Ol=(Ds,Cr,Gl)=>sr(()=>j.get().fold(()=>{Ds.setEnabled(!1),Ds.setActive(!1)},ka=>{Ds.setEnabled(!Cr(ka)&&I.selection.isEditable()),Ds.setActive(Gl(ka))})),Yu=Ds=>$e.exists(Cr=>Cr.locked[Ds]),Zl=Ds=>qr(Ds,Cr=>!1),wu=Ds=>qr(Ds,Cr=>dt(Cr.element)),Bp=Ds=>Cr=>qr(Cr,Gl=>dt(Gl.element)||Yu(Ds)),Ip=Ds=>Cr=>qr(Cr,Gl=>dt(Gl.element)||Ds().isNone()),$l=(Ds,Cr)=>Gl=>qr(Gl,ka=>dt(ka.element)||Ds().isNone()||Yu(Cr)),Pp=Ds=>qr(Ds,Cr=>on("mergeable")),Fp=Ds=>qr(Ds,Cr=>on("unmergeable")),Kh=Ds=>Ol(Ds,Qe,Cr=>At(Cr.element,co(I)).exists(ka=>C2(ka,"caption"))),Mg=(Ds,Cr)=>Gl=>Ol(Gl,ka=>dt(ka.element),()=>I.queryCommandValue(Ds)===Cr),ci=Mg("mceTableRowType","header"),Cu=Mg("mceTableColType","th");return I.on("NodeChange ExecCommand TableSelectorChange",cr),{onSetupTable:Zl,onSetupCellOrRow:wu,onSetupColumn:Bp,onSetupPasteable:Ip,onSetupPasteableColumn:$l,onSetupMergeable:Pp,onSetupUnmergeable:Fp,resetTargets:cr,onSetupTableWithCaption:Kh,onSetupTableRowHeaders:ci,onSetupTableColumnHeaders:Cu,targets:j.get}};var va=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const Dg="x-tinymce/dom-table-",uf=Dg+"rows",Y0=Dg+"columns",Nl=I=>{var j;const me=(j=va.read())!==null&&j!==void 0?j:[];return bt(me,$e=>te.from($e.getType(I)))},Ac=()=>Nl(uf),kt=()=>Nl(Y0),pc=I=>j=>{const me=()=>{j.setEnabled(I.selection.isEditable())};return I.on("NodeChange",me),me(),()=>{I.off("NodeChange",me)}},oi=(I,j)=>{I.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:pc(I),fetch:io=>io("inserttable | cell row column | advtablesort | tableprops deletetable")});const me=io=>()=>I.execCommand(io),$e=(io,Go)=>{I.queryCommandSupported(Go.command)&&I.ui.registry.addButton(io,{...Go,onAction:B(Go.onAction)?Go.onAction:me(Go.command)})},dt=(io,Go)=>{I.queryCommandSupported(Go.command)&&I.ui.registry.addToggleButton(io,{...Go,onAction:B(Go.onAction)?Go.onAction:me(Go.command)})};$e("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:j.onSetupTable}),$e("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:j.onSetupTable}),$e("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:j.onSetupCellOrRow}),$e("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:j.onSetupMergeable}),$e("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:j.onSetupUnmergeable}),$e("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:j.onSetupCellOrRow}),$e("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:j.onSetupCellOrRow}),$e("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:j.onSetupCellOrRow}),$e("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:j.onSetupCellOrRow}),$e("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:j.onSetupColumn("onFirst")}),$e("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:j.onSetupColumn("onLast")}),$e("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:j.onSetupColumn("onAny")}),$e("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:j.onSetupCellOrRow}),$e("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:j.onSetupCellOrRow}),$e("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:j.onSetupPasteable(Ac)}),$e("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:j.onSetupPasteable(Ac)}),$e("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:j.onSetupColumn("onAny")}),$e("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:j.onSetupColumn("onAny")}),$e("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:j.onSetupPasteableColumn(kt,"onFirst")}),$e("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:j.onSetupPasteableColumn(kt,"onLast")}),$e("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:pc(I)});const on=Mr(gu(I));on.length!==0&&I.queryCommandSupported("mceTableToggleClass")&&I.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Zu(I,on,"tableclass",io=>I.execCommand("mceTableToggleClass",!1,io)),onSetup:j.onSetupTable});const On=Mr(Ii(I));On.length!==0&&I.queryCommandSupported("mceTableCellToggleClass")&&I.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Zu(I,On,"tablecellclass",io=>I.execCommand("mceTableCellToggleClass",!1,io)),onSetup:j.onSetupCellOrRow}),I.queryCommandSupported("mceTableApplyCellStyle")&&(I.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Zu(I,dl,"tablecellverticalalign",bd(I,"vertical-align")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Zu(I,Jc(I),"tablecellborderwidth",bd(I,"border-width")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Zu(I,_m(I),"tablecellborderstyle",bd(I,"border-style")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:io=>io(fc(I,nf(I),"background-color")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:io=>io(fc(I,Ep(I),"border-color")),onSetup:j.onSetupCellOrRow})),dt("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:j.onSetupTableWithCaption}),dt("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:vs(I),onSetup:j.onSetupTableRowHeaders}),dt("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:cf(I),onSetup:j.onSetupTableColumnHeaders})},Gr=I=>{const j=$e=>I.dom.is($e,"table")&&I.getBody().contains($e)&&I.dom.isEditable($e.parentNode),me=xp(I);me.length>0&&I.ui.registry.addContextToolbar("table",{predicate:j,items:me,scope:"node",position:"node"})},Nc=I=>j=>{const me=()=>{j.setEnabled(I.selection.isEditable())};return I.on("NodeChange",me),me(),()=>{I.off("NodeChange",me)}},ba=(I,j)=>{const me=sr=>()=>I.execCommand(sr),$e=(sr,qr)=>I.queryCommandSupported(qr.command)?(I.ui.registry.addMenuItem(sr,{...qr,onAction:B(qr.onAction)?qr.onAction:me(qr.command)}),!0):!1,dt=(sr,qr)=>{I.queryCommandSupported(qr.command)&&I.ui.registry.addToggleMenuItem(sr,{...qr,onAction:B(qr.onAction)?qr.onAction:me(qr.command)})},on=sr=>{I.execCommand("mceInsertTable",!1,{rows:sr.numRows,columns:sr.numColumns})},On=[$e("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:j.onSetupCellOrRow}),$e("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:j.onSetupCellOrRow}),$e("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:j.onSetupCellOrRow}),$e("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:j.onSetupCellOrRow}),$e("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:j.onSetupCellOrRow}),$e("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:j.onSetupCellOrRow}),$e("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:j.onSetupPasteable(Ac)}),$e("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:j.onSetupPasteable(Ac)})],io=[$e("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:j.onSetupColumn("onFirst")}),$e("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:j.onSetupColumn("onLast")}),$e("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:j.onSetupColumn("onAny")}),$e("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:j.onSetupColumn("onAny")}),$e("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:j.onSetupColumn("onAny")}),$e("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:j.onSetupPasteableColumn(kt,"onFirst")}),$e("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:j.onSetupPasteableColumn(kt,"onLast")})],Go=[$e("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:j.onSetupCellOrRow}),$e("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:j.onSetupMergeable}),$e("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:j.onSetupUnmergeable})];fd(I)?I.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"inserttable",onAction:on}],onSetup:Nc(I)}):I.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:me("mceInsertTableDialog"),onSetup:Nc(I)}),I.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:me("mceInsertTableDialog"),onSetup:Nc(I)}),$e("tableprops",{text:"Table properties",onSetup:j.onSetupTable,command:"mceTableProps"}),$e("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:j.onSetupTable,command:"mceTableDelete"}),He(On,!0)&&I.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:K("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),He(io,!0)&&I.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:K("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),He(Go,!0)&&I.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:K("tablecellprops tablemergecells tablesplitcells")}),I.ui.registry.addContextMenu("table",{update:()=>(j.resetTargets(),j.targets().fold(K(""),sr=>fn(sr.element)==="caption"?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"))});const ts=Mr(gu(I));ts.length!==0&&I.queryCommandSupported("mceTableToggleClass")&&I.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:()=>Lf(I,ts,"tableclass",sr=>I.execCommand("mceTableToggleClass",!1,sr)),onSetup:j.onSetupTable});const cr=Mr(Ii(I));cr.length!==0&&I.queryCommandSupported("mceTableCellToggleClass")&&I.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:()=>Lf(I,cr,"tablecellclass",sr=>I.execCommand("mceTableCellToggleClass",!1,sr)),onSetup:j.onSetupCellOrRow}),I.queryCommandSupported("mceTableApplyCellStyle")&&(I.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:()=>Lf(I,dl,"tablecellverticalalign",bd(I,"vertical-align")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:()=>Lf(I,Jc(I),"tablecellborderwidth",bd(I,"border-width")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:()=>Lf(I,_m(I),"tablecellborderstyle",bd(I,"border-style")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:()=>fc(I,nf(I),"background-color"),onSetup:j.onSetupCellOrRow}),I.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:()=>fc(I,Ep(I),"border-color"),onSetup:j.onSetupCellOrRow})),dt("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:j.onSetupTableWithCaption}),dt("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:vs(I),onSetup:j.onSetupTableRowHeaders}),dt("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:cf(I),onSetup:j.onSetupTableRowHeaders})},hr=I=>{const j=$g(I);ja(I),wi(I),ba(I,j),oi(I,j),Gr(I)};var Lm=()=>{o.add("table",hr)};Lm()})();(function(){const o=B=>{let H=B;return{get:()=>H,set:K=>{H=K}}};var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=(B,H)=>{B.dispatch("VisualBlocks",{state:H})},u=(B,H,Z)=>{B.dom.toggleClass(B.getBody(),"mce-visualblocks"),Z.set(!Z.get()),i(B,Z.get())},m=(B,H,Z)=>{B.addCommand("mceVisualBlocks",()=>{u(B,H,Z)})},h=B=>H=>H.options.get(B),b=B=>{const H=B.options.register;H("visualblocks_default_state",{processor:"boolean",default:!1})},C=h("visualblocks_default_state"),x=(B,H,Z)=>{B.on("PreviewFormats AfterPreviewFormats",J=>{Z.get()&&B.dom.toggleClass(B.getBody(),"mce-visualblocks",J.type==="afterpreviewformats")}),B.on("init",()=>{C(B)&&u(B,H,Z)})},_=(B,H)=>Z=>{Z.setActive(H.get());const J=K=>Z.setActive(K.state);return B.on("VisualBlocks",J),()=>B.off("VisualBlocks",J)},N=(B,H)=>{const Z=()=>B.execCommand("mceVisualBlocks");B.ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:Z,onSetup:_(B,H),context:"any"}),B.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",icon:"visualblocks",onAction:Z,onSetup:_(B,H),context:"any"})};var O=()=>{s.add("visualblocks",(B,H)=>{b(B);const Z=o(!1);m(B,H,Z),N(B,Z),x(B,H,Z)})};O()})();(function(){const o=_t=>{let Ht=_t;return{get:()=>Ht,set:Bo=>{Ht=Bo}}};var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=_t=>({isEnabled:()=>_t.get()}),u=(_t,Ht)=>_t.dispatch("VisualChars",{state:Ht}),m=(_t,Ht,Fn)=>{var ao;return Fn(_t,Ht.prototype)?!0:((ao=_t.constructor)===null||ao===void 0?void 0:ao.name)===Ht.name},h=_t=>{const Ht=typeof _t;return _t===null?"null":Ht==="object"&&Array.isArray(_t)?"array":Ht==="object"&&m(_t,String,(Fn,ao)=>ao.isPrototypeOf(Fn))?"string":Ht},b=_t=>Ht=>h(Ht)===_t,C=_t=>Ht=>typeof Ht===_t,x=_t=>Ht=>_t===Ht,_=b("string"),N=b("object"),O=x(null),B=C("boolean"),H=_t=>_t==null,Z=_t=>!H(_t),J=C("number");class K{constructor(Ht,Fn){this.tag=Ht,this.value=Fn}static some(Ht){return new K(!0,Ht)}static none(){return K.singletonNone}fold(Ht,Fn){return this.tag?Fn(this.value):Ht()}isSome(){return this.tag}isNone(){return!this.tag}map(Ht){return this.tag?K.some(Ht(this.value)):K.none()}bind(Ht){return this.tag?Ht(this.value):K.none()}exists(Ht){return this.tag&&Ht(this.value)}forall(Ht){return!this.tag||Ht(this.value)}filter(Ht){return!this.tag||Ht(this.value)?this:K.none()}getOr(Ht){return this.tag?this.value:Ht}or(Ht){return this.tag?this:Ht}getOrThunk(Ht){return this.tag?this.value:Ht()}orThunk(Ht){return this.tag?this:Ht()}getOrDie(Ht){if(this.tag)return this.value;throw new Error(Ht??"Called getOrDie on None")}static from(Ht){return Z(Ht)?K.some(Ht):K.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(Ht){this.tag&&Ht(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}K.singletonNone=new K(!1);const G=(_t,Ht)=>{const Fn=_t.length,ao=new Array(Fn);for(let Bo=0;Bo<Fn;Bo++){const is=_t[Bo];ao[Bo]=Ht(is,Bo)}return ao},W=(_t,Ht)=>{for(let Fn=0,ao=_t.length;Fn<ao;Fn++){const Bo=_t[Fn];Ht(Bo,Fn)}},V=(_t,Ht)=>{const Fn=[];for(let ao=0,Bo=_t.length;ao<Bo;ao++){const is=_t[ao];Ht(is,ao)&&Fn.push(is)}return Fn},ge=Object.keys,Qe=(_t,Ht)=>{const Fn=ge(_t);for(let ao=0,Bo=Fn.length;ao<Bo;ao++){const is=Fn[ao],yr=_t[is];Ht(yr,is)}},Ne=typeof window<"u"?window:Function("return this;")(),te=(_t,Ht)=>{let Fn=Ht??Ne;for(let ao=0;ao<_t.length&&Fn!==void 0&&Fn!==null;++ao)Fn=Fn[_t[ao]];return Fn},Ue=(_t,Ht)=>{const Fn=_t.split(".");return te(Fn,Ht)},ut=(_t,Ht)=>Ue(_t,Ht),lt=(_t,Ht)=>{const Fn=ut(_t,Ht);if(Fn==null)throw new Error(_t+" not available on this browser");return Fn},Oe=Object.getPrototypeOf,ue=_t=>lt("HTMLElement",_t),Pt=_t=>{const Ht=Ue("ownerDocument.defaultView",_t);return N(_t)&&(ue(Ht).prototype.isPrototypeOf(_t)||/^HTML\w*Element$/.test(Oe(_t).constructor.name))},ye=1,De=3,R=_t=>_t.dom.nodeType,je=_t=>_t.dom.nodeValue,be=_t=>Ht=>R(Ht)===_t,ot=_t=>nt(_t)&&Pt(_t.dom),nt=be(ye),pe=be(De),Ze=(_t,Ht,Fn)=>{if(_(Fn)||B(Fn)||J(Fn))_t.setAttribute(Ht,Fn+"");else throw console.error("Invalid call to Attribute.set. Key ",Ht,":: Value ",Fn,":: Element ",_t),new Error("Attribute value was not simple")},Tt=(_t,Ht,Fn)=>{Ze(_t.dom,Ht,Fn)},He=(_t,Ht)=>{const Fn=_t.dom.getAttribute(Ht);return Fn===null?void 0:Fn},vt=(_t,Ht)=>{_t.dom.removeAttribute(Ht)},Be=(_t,Ht)=>{const Fn=He(_t,Ht);return Fn===void 0||Fn===""?[]:Fn.split(" ")},ft=(_t,Ht,Fn)=>{const Bo=Be(_t,Ht).concat([Fn]);return Tt(_t,Ht,Bo.join(" ")),!0},oe=(_t,Ht,Fn)=>{const ao=V(Be(_t,Ht),Bo=>Bo!==Fn);return ao.length>0?Tt(_t,Ht,ao.join(" ")):vt(_t,Ht),!1},pn=_t=>_t.dom.classList!==void 0,gt=_t=>Be(_t,"class"),St=(_t,Ht)=>ft(_t,"class",Ht),jt=(_t,Ht)=>oe(_t,"class",Ht),Ct=(_t,Ht)=>{pn(_t)?_t.dom.classList.add(Ht):St(_t,Ht)},ee=_t=>{(pn(_t)?_t.dom.classList:gt(_t)).length===0&&vt(_t,"class")},ie=(_t,Ht)=>{pn(_t)?_t.dom.classList.remove(Ht):jt(_t,Ht),ee(_t)},ce=(_t,Ht)=>{const ao=(Ht||document).createElement("div");if(ao.innerHTML=_t,!ao.hasChildNodes()||ao.childNodes.length>1){const Bo="HTML does not have a single root node";throw console.error(Bo,_t),new Error(Bo)}return Me(ao.childNodes[0])},Y=(_t,Ht)=>{const ao=(Ht||document).createElement(_t);return Me(ao)},we=(_t,Ht)=>{const ao=(Ht||document).createTextNode(_t);return Me(ao)},Me=_t=>{if(_t==null)throw new Error("Node cannot be null or undefined");return{dom:_t}},mt={fromHtml:ce,fromTag:Y,fromText:we,fromDom:Me,fromPoint:(_t,Ht,Fn)=>K.from(_t.dom.elementFromPoint(Ht,Fn)).map(Me)},We={" ":"nbsp","­":"shy"},bt=(_t,Ht)=>{let Fn="";return Qe(_t,(ao,Bo)=>{Fn+=Bo}),new RegExp("["+Fn+"]",Ht?"g":"")},$t=_t=>{let Ht="";return Qe(_t,Fn=>{Ht&&(Ht+=","),Ht+="span.mce-"+Fn}),Ht},gn=bt(We),Et=bt(We,!0),Bt=$t(We),dn="mce-nbsp",_n=_t=>_t.dom.contentEditable,xo=_t=>'<span data-mce-bogus="1" class="mce-'+We[_t]+'">'+_t+"</span>",Qn=_t=>_t.nodeName.toLowerCase()==="span"&&_t.classList.contains("mce-nbsp-wrap"),Nt=_t=>{const Ht=je(_t);return pe(_t)&&_(Ht)&&gn.test(Ht)},rn=_t=>ot(_t)&&_n(_t)==="false",an=(_t,Ht)=>{if(ot(_t)&&!Qn(_t.dom)){const Fn=_n(_t);if(Fn==="true")return!0;if(Fn==="false")return!1}return Ht},Nn=(_t,Ht,Fn)=>{let ao=[];const Bo=_t.dom,is=G(Bo.childNodes,mt.fromDom),yr=wr=>Qn(wr.dom)||!rn(wr);return W(is,wr=>{Fn&&yr(wr)&&Ht(wr)&&(ao=ao.concat([wr])),ao=ao.concat(Nn(wr,Ht,an(wr,Fn)))}),ao},ko=(_t,Ht)=>{for(;_t.parentNode;){if(_t.parentNode===Ht)return Ht;_t=_t.parentNode}},Ro=_t=>_t.replace(Et,xo),ws=(_t,Ht)=>{const Fn=_t.dom,ao=Nn(mt.fromDom(Ht),Nt,_t.dom.isEditable(Ht));W(ao,Bo=>{var is;const yr=Bo.dom.parentNode;if(Qn(yr))Ct(mt.fromDom(yr),dn);else{const wr=Ro(Fn.encode((is=je(Bo))!==null&&is!==void 0?is:"")),ar=Fn.create("div",{},wr);let Xe;for(;Xe=ar.lastChild;)Fn.insertAfter(Xe,Bo.dom);_t.dom.remove(Bo.dom)}})},yo=(_t,Ht)=>{const Fn=_t.dom.select(Bt,Ht);W(Fn,ao=>{Qn(ao)?ie(mt.fromDom(ao),dn):_t.dom.remove(ao,!0)})},Us=_t=>{const Ht=_t.getBody(),Fn=_t.selection.getBookmark();let ao=ko(_t.selection.getNode(),Ht);ao=ao!==void 0?ao:Ht,yo(_t,ao),ws(_t,ao),_t.selection.moveToBookmark(Fn)},fn=(_t,Ht)=>{u(_t,Ht.get());const Fn=_t.getBody();Ht.get()===!0?ws(_t,Fn):yo(_t,Fn)},Ho=(_t,Ht)=>{Ht.set(!Ht.get());const Fn=_t.selection.getBookmark();fn(_t,Ht),_t.selection.moveToBookmark(Fn)},tr=(_t,Ht)=>{_t.addCommand("mceVisualChars",()=>{Ho(_t,Ht)})},rr=_t=>Ht=>Ht.options.get(_t),Ir=_t=>{const Ht=_t.options.register;Ht("visualchars_default_state",{processor:"boolean",default:!1})},Pr=rr("visualchars_default_state"),ks=(_t,Ht)=>{_t.on("init",()=>{fn(_t,Ht)})},Nr=(_t,Ht)=>{let Fn=null;return{cancel:()=>{O(Fn)||(clearTimeout(Fn),Fn=null)},throttle:(...is)=>{O(Fn)&&(Fn=setTimeout(()=>{Fn=null,_t.apply(null,is)},Ht))}}},Xr=(_t,Ht)=>{const Fn=Nr(()=>{Us(_t)},300);_t.on("keydown",ao=>{Ht.get()===!0&&(ao.keyCode===13?Us(_t):Fn.throttle())}),_t.on("remove",Fn.cancel)},xs=(_t,Ht)=>Fn=>{Fn.setActive(Ht.get());const ao=Bo=>Fn.setActive(Bo.state);return _t.on("VisualChars",ao),()=>_t.off("VisualChars",ao)},uo=(_t,Ht)=>{const Fn=()=>_t.execCommand("mceVisualChars");_t.ui.registry.addToggleButton("visualchars",{tooltip:"Show invisible characters",icon:"visualchars",onAction:Fn,onSetup:xs(_t,Ht),context:"any"}),_t.ui.registry.addToggleMenuItem("visualchars",{text:"Show invisible characters",icon:"visualchars",onAction:Fn,onSetup:xs(_t,Ht),context:"any"})};var Ps=()=>{s.add("visualchars",_t=>{Ir(_t);const Ht=o(Pr(_t));return tr(_t,Ht),uo(_t,Ht),Xr(_t,Ht),ks(_t,Ht),i(Ht)})};Ps()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=(ee=>ie=>ee===ie)(null),u=ee=>ee,m=(ee,ie)=>{const ce=ee.length,Y=new Array(ce);for(let we=0;we<ce;we++){const Me=ee[we];Y[we]=ie(Me,we)}return Y},b={aletter:"[A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-׳ؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆༀཀ-ཇཉ-ཬྈ-ྌႠ-Ⴥა-ჺჼᄀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᨀ-ᨖᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᯀ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⒶ-ⓩⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〻〼ㄅ-ㄭㄱ-ㆎㆠ-ㆺꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐꞑꞠ-ꞩꟺ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]",midnumlet:"[-'\\.‘’․﹒'.]",midletter:"[:··״‧︓﹕:]",midnum:"[±+*/,;;։،؍٬߸⁄︐︔﹐﹔,;]",numeric:"[0-9٠-٩٫۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹]",cr:"\\r",lf:"\\n",newline:"[\v\f…\u2028\u2029]",extend:"[̀-ͯ҃-҉֑-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ऀ-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕౖౢౣಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣംഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈᧉᨗ-ᨛᩕ-ᩞ᩠-᩿᩼ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-᯦᮪-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ᷀-ᷦ᷼-᷿‌‍⃐-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯-꙲꙼꙽꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꨩ-ꨶꩃꩌꩍꩻꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꯣ-ꯪ꯬꯭ﬞ︀-️︠-゙゚︦]",format:"[­؀-؃۝܏឴឵‎‏‪-‮⁠-⁤-\uFEFF-]",katakana:"[〱-〵゛゜゠-ヺー-ヿㇰ-ㇿ㋐-㋾㌀-㍗ヲ-ン]",extendnumlet:"[=_‿⁀⁔︳︴﹍-﹏_∀-⋿<>]",punctuation:"[~№|!-*+-\\/:;?@\\[-`{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]"},C={ALETTER:0,MIDNUMLET:1,MIDLETTER:2,MIDNUM:3,NUMERIC:4,CR:5,LF:6,NEWLINE:7,EXTEND:8,FORMAT:9,KATAKANA:10,EXTENDNUMLET:11,AT:12,OTHER:13},x=[new RegExp(b.aletter),new RegExp(b.midnumlet),new RegExp(b.midletter),new RegExp(b.midnum),new RegExp(b.numeric),new RegExp(b.cr),new RegExp(b.lf),new RegExp(b.newline),new RegExp(b.extend),new RegExp(b.format),new RegExp(b.katakana),new RegExp(b.extendnumlet),new RegExp("@")],_="",N=new RegExp("^"+b.punctuation+"$"),O=/^\s+$/,B=x,H=C.OTHER,Z=ee=>{let ie=H;const ce=B.length;for(let Y=0;Y<ce;++Y){const we=B[Y];if(we&&we.test(ee)){ie=Y;break}}return ie},J=ee=>{const ie={};return ce=>{if(ie[ce])return ie[ce];{const Y=ee(ce);return ie[ce]=Y,Y}}},K=ee=>{const ie=J(Z);return m(ee,ie)},G=(ee,ie)=>{const ce=ee[ie],Y=ee[ie+1];if(ie<0||ie>ee.length-1&&ie!==0||ce===C.ALETTER&&Y===C.ALETTER)return!1;const we=ee[ie+2];if(ce===C.ALETTER&&(Y===C.MIDLETTER||Y===C.MIDNUMLET||Y===C.AT)&&we===C.ALETTER)return!1;const Me=ee[ie-1];return(ce===C.MIDLETTER||ce===C.MIDNUMLET||Y===C.AT)&&Y===C.ALETTER&&Me===C.ALETTER||(ce===C.NUMERIC||ce===C.ALETTER)&&(Y===C.NUMERIC||Y===C.ALETTER)||(ce===C.MIDNUM||ce===C.MIDNUMLET)&&Y===C.NUMERIC&&Me===C.NUMERIC||ce===C.NUMERIC&&(Y===C.MIDNUM||Y===C.MIDNUMLET)&&we===C.NUMERIC||(ce===C.EXTEND||ce===C.FORMAT)&&(Y===C.ALETTER||Y===C.NUMERIC||Y===C.KATAKANA||Y===C.EXTEND||Y===C.FORMAT)||(Y===C.EXTEND||Y===C.FORMAT&&(we===C.ALETTER||we===C.NUMERIC||we===C.KATAKANA||we===C.EXTEND||we===C.FORMAT))&&(ce===C.ALETTER||ce===C.NUMERIC||ce===C.KATAKANA||ce===C.EXTEND||ce===C.FORMAT)||ce===C.CR&&Y===C.LF?!1:ce===C.NEWLINE||ce===C.CR||ce===C.LF||Y===C.NEWLINE||Y===C.CR||Y===C.LF?!0:!(ce===C.KATAKANA&&Y===C.KATAKANA||Y===C.EXTENDNUMLET&&(ce===C.ALETTER||ce===C.NUMERIC||ce===C.KATAKANA||ce===C.EXTENDNUMLET)||ce===C.EXTENDNUMLET&&(Y===C.ALETTER||Y===C.NUMERIC||Y===C.KATAKANA)||ce===C.AT)},W=_,V=O,ge=N,Qe=ee=>ee==="http"||ee==="https",Ne=(ee,ie)=>{let ce;for(ce=ie;ce<ee.length&&!V.test(ee[ce]);ce++);return ce},te=(ee,ie)=>{const ce=Ne(ee,ie+1);return ee.slice(ie+1,ce).join(W).substr(0,3)==="://"?ce:ie},Ue=(ee,ie,ce,Y)=>{const we=[],Me=[];let Pe=[];for(let mt=0;mt<ce.length;++mt)if(Pe.push(ee[mt]),G(ce,mt)){const We=ie[mt];if((Y.includeWhitespace||!V.test(We))&&(Y.includePunctuation||!ge.test(We))){const bt=mt-Pe.length+1,$t=mt+1,gn=ie.slice(bt,$t).join(W);if(Qe(gn)){const Et=te(ie,mt),Bt=ee.slice($t,Et);Array.prototype.push.apply(Pe,Bt),mt=Et}ie[mt+1]==="."&&/^([a-zA-Z]\.)+$/.test(gn+".")?(Pe.push(ee[mt+1]),Me.push({start:bt,end:$t+1})):Me.push({start:bt,end:$t}),we.push(Pe)}Pe=[]}return{words:we,indices:Me}},ut=()=>({includeWhitespace:!1,includePunctuation:!1}),lt=(ee,ie,ce)=>{ce={...ut(),...ce};const Y=m(ee,ie),we=K(Y);return Ue(ee,Y,we,ce)},ue=(ee,ie,ce)=>lt(ee,ie,ce).words,Pt=ee=>ee.replace(/\uFEFF/g,"");var ye=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker");const De=(ee,ie)=>{const ce=ie.getBlockElements(),Y=ie.getVoidElements(),we=bt=>ce[bt.nodeName]||Y[bt.nodeName],Me=[];let Pe="";const mt=new ye(ee,ee);let We;for(;We=mt.next();)We.nodeType===3?Pe+=Pt(We.data):we(We)&&Pe.length&&(Me.push(Pe),Pe="");return Pe.length&&Me.push(Pe),Me},R=ee=>ee.replace(/\u200B/g,""),je=ee=>ee.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length,be=(ee,ie)=>{const ce=R(De(ee,ie).join(`
115
- `));return ue(ce.split(""),u).length},ot=(ee,ie)=>{const ce=De(ee,ie).join("");return je(ce)},nt=(ee,ie)=>{const ce=De(ee,ie).join("").replace(/\s/g,"");return je(ce)},pe=(ee,ie)=>()=>ie(ee.getBody(),ee.schema),Ze=(ee,ie)=>()=>ie(ee.selection.getRng().cloneContents(),ee.schema),Tt=ee=>pe(ee,be),He=ee=>({body:{getWordCount:Tt(ee),getCharacterCount:pe(ee,ot),getCharacterCountWithoutSpaces:pe(ee,nt)},selection:{getWordCount:Ze(ee,be),getCharacterCount:Ze(ee,ot),getCharacterCountWithoutSpaces:Ze(ee,nt)},getCount:Tt(ee)}),vt=(ee,ie)=>{ee.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(ie.body.getWordCount()),String(ie.selection.getWordCount())],["Characters (no spaces)",String(ie.body.getCharacterCountWithoutSpaces()),String(ie.selection.getCharacterCountWithoutSpaces())],["Characters",String(ie.body.getCharacterCount()),String(ie.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})},Be=(ee,ie)=>{ee.addCommand("mceWordCount",()=>vt(ee,ie))},ft=(ee,ie)=>{let ce=null;return{cancel:()=>{i(ce)||(clearTimeout(ce),ce=null)},throttle:(...Me)=>{i(ce)&&(ce=setTimeout(()=>{ce=null,ee.apply(null,Me)},ie))}}};var oe=tinymce.util.Tools.resolve("tinymce.util.Delay");const pn=(ee,ie)=>{ee.dispatch("wordCountUpdate",{wordCount:{words:ie.body.getWordCount(),characters:ie.body.getCharacterCount(),charactersWithoutSpaces:ie.body.getCharacterCountWithoutSpaces()}})},gt=(ee,ie)=>{pn(ee,ie)},St=(ee,ie,ce)=>{const Y=ft(()=>gt(ee,ie),ce);ee.on("init",()=>{gt(ee,ie),oe.setEditorTimeout(ee,()=>{ee.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",Y.throttle)},0),ee.on("remove",Y.cancel)})},jt=ee=>{const ie=()=>ee.execCommand("mceWordCount");ee.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:ie,context:"any"}),ee.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:ie,context:"any"})};var Ct=(ee=300)=>{o.add("wordcount",ie=>{const ce=He(ie);return Be(ie,ce),jt(ie),St(ie,ce,ee),ce})};Ct()})();const xMe=o=>/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument/i.test(o)||/class="OutlineElement/.test(o)||/id="?docs\-internal\-guid\-/.test(o),EMe=(o,s="wps_office")=>{const i=o.split(","),u=i[0].match(/:(.*?);/)[1],m=atob(i[1]);let h=m.length;const b=new Uint8Array(h);for(;h--;)b[h]=m.charCodeAt(h);return new File([b],s,{type:u})},_Me=o=>btoa(o.match(/\w{2}/g).map(s=>String.fromCharCode(parseInt(s,16))).join(""));function kMe(o){if(!o)return[];let s=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,i=new RegExp(`(?:(${s.source}))([\\da-fA-F\\s]+)\\}`,"g"),u=o.match(i);console.log("images",u);const m=[];if(u||(s=/{\\pict[\s\S]+?(\\pngblip-?\d+)?(\\wmetafile8-?\d+)?{\\\*\\blipuid\s?[\da-fA-F]+[\s}]*?/,i=new RegExp(`(?:(${s.source}))([\\da-fA-F\\s]+)\\}`,"g"),u=o.match(i)),u)for(const h of u){let b=!1;if(h.includes("\\pngblip")?b="image/png":h.includes("\\jpegblip")&&(b="image/jpeg"),b){const C=h.replace(s,"").replace(/[^\da-fA-F]/g,""),x=`data:${b};base64,${_Me(C)}`;m.push({base64:x,file:EMe(x)})}}return m}const TMe=(o,s)=>{if(!s)return o;try{const u=new DOMParser().parseFromString(o,"text/html"),m=u.querySelectorAll("img"),b=(s.clipboardData||window.Clipboard).getData("text/rtf"),C=kMe(b);return m.forEach((x,_)=>{var O;const N=x.getAttribute("src");if(N&&N.startsWith("file:")&&(O=C==null?void 0:C[_])!=null&&O.base64){const B=C[_].base64;x.setAttribute("src",B)}}),u.body.innerHTML}catch{return o}},AMe=o=>{const s=atob(o.split(",")[1]),i=o.split(",")[0].split(":")[1].split(";")[0],u=new ArrayBuffer(s.length),m=new Uint8Array(u);for(let h=0;h<s.length;h++)m[h]=s.charCodeAt(h);return new Blob([u],{type:i})},NMe=async o=>{try{const s=AMe(o),i=new FormData;i.append("files",s,"image.png");const m=await(await fetch("/api/ajax/uploaddoc",{method:"POST",body:i})).json();if(m.status===1)return m.file_url;throw new Error(m.message)}catch(s){throw s}},OMe=async o=>{const i=new DOMParser().parseFromString(o,"text/html"),u=i.getElementsByTagName("img"),m=[],h=3;for(let b=0;b<u.length;b++){const C=u[b],x=C.getAttribute("src");x&&x.startsWith("data:image")&&(m.push({img:C,src:x,width:C.getAttribute("width"),height:C.getAttribute("height")}),m[m.length-1].width&&C.setAttribute("width",m[m.length-1].width),m[m.length-1].height&&C.setAttribute("height",m[m.length-1].height))}for(let b=0;b<m.length;b+=h){const x=m.slice(b,b+h).map(async _=>{try{const N=await NMe(_.src);_.img.setAttribute("src",N)}catch{_.img.remove()}});await Promise.all(x)}return i.body.innerHTML},$Me=o=>{o.querySelectorAll("td").forEach(i=>{const u=i.getAttribute("width"),m=i.getAttribute("style")||"";u==="0"&&m.includes("border:none")&&i.remove()})},DMe=o=>{o.querySelectorAll("table").forEach(i=>{i.style.maxWidth="100%"})},MMe=o=>{o.querySelectorAll("table").forEach(i=>{i.style.tableLayout="fixed";const u=i.getAttribute("style")||"";if(u){const m=u.split(";").filter(b=>b.trim()),h=[];m.forEach(b=>{const[C,x]=b.split(":").map(_=>_.trim());C&&x&&(["margin","margin-top","margin-right","margin-bottom","margin-left"].includes(C.toLowerCase())?/\-\d+(\.\d+)?(px|em|rem|%|pt|pc|in|cm|mm|ex|ch|vw|vh|vmin|vmax)?/.test(x)||h.push(`${C}: ${x}`):h.push(`${C}: ${x}`))}),h.some(b=>b.toLowerCase().startsWith("width"))||h.push("width: 100%"),i.setAttribute("style",h.join("; "))}})},RMe=o=>{o.querySelectorAll("table").forEach(i=>{const u=i.querySelectorAll("tr");if(u.length>0){const b=u[0].querySelectorAll("td, th").length;if(b>0){const C=(100/b).toFixed(2);u.forEach(x=>{x.querySelectorAll("td, th").forEach((N,O)=>{const B=N,H=parseInt(B.getAttribute("colspan")||"1"),Z=(parseFloat(C)*H).toFixed(2),K=(B.getAttribute("style")||"").split(";").filter(W=>!W.trim().toLowerCase().startsWith("width")).join(";"),G=K?`${K}; width: ${Z}%`:`width: ${Z}%`;B.setAttribute("style",G)})})}}})},BMe=o=>{o.querySelectorAll("table").forEach(i=>{const u=i.querySelectorAll("td");let m=!1,h="";for(const b of u){const C=b.getAttribute("style")||"",x=C.match(/border(?:-(?:right|left|top|bottom))?(?:-style)?:\s*[0-9.]*(?:pt|px)?\s*double\s*(?:windowtext|[#a-zA-Z0-9]+)?/i)||C.match(/border(?:-(?:right|left|top|bottom))?:\s*[0-9.]*(?:pt|px)?\s*double\s*(?:windowtext|[#a-zA-Z0-9]+)?/i);(x?x[0]:"").includes("double")&&(m=!0,x&&(h=x[0].replace(/^border(?:-(?:right|left|top|bottom))?(?:-style)?:\s*/,""),b.style.borderTop=h,b.style.borderRight=h,b.style.borderBottom=h,b.style.borderLeft=h))}m&&h&&(i.style.borderCollapse="separate",i.style.borderSpacing="2px",i.style.border=h)})},IMe=o=>{o.querySelectorAll("table").forEach(i=>{i.querySelectorAll("td[rowspan]").forEach(m=>{const C=((m.getAttribute("style")||"").match(/border-[^:]+:[^;]+(?:solid|double)[^;]+/g)||[]).find(x=>!x.includes("none"));if(C){const x=C.split(":")[1].trim();m.style.borderBottom=x}})})},PMe=o=>{o.querySelectorAll('[style*="mso-"]').forEach(i=>{const m=(i.getAttribute("style")||"").replace(/mso-[^:]+:[^;]+;/g,"");i.setAttribute("style",m)})},FMe=o=>{o.querySelectorAll('[style*="tab-stops"]').forEach(i=>{const m=(i.getAttribute("style")||"").replace(/tab-stops:[^;]+;/g,"");i.setAttribute("style",m)})},LMe=o=>{o=o.replace(/<a(?!.*?href=)[^>]*>([\s\S]*?)<\/a>/gi,"$1");const i=new DOMParser().parseFromString(o,"text/html");return $Me(i),DMe(i),BMe(i),IMe(i),PMe(i),FMe(i),MMe(i),RMe(i),o=i.body.innerHTML,o};_z.PluginManager.add("pasteprocess",o=>(o.on("paste",s=>{if(s.clipboardData){const i=s.clipboardData.getData("text/html")||s.clipboardData.getData("text");if(xMe(i)){s.preventDefault();const u=o.windowManager.open({title:"处理中",body:{type:"panel",items:[{type:"htmlpanel",html:'<div style="text-align: center; padding: 20px;">正在处理Word内容,请稍候...</div>'}]},buttons:[]}),m=LMe(i),h=TMe(m,s);OMe(h).then(b=>{o.insertContent(b),u.close()})}}}),{}));let _H="A4";const ane={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}},VMe=Object.keys(ane).map(o=>`pagesize${o}`).join(" ");_z.PluginManager.add("pagesize",o=>{const s=o.options.register;s("pagesize",{processor:"string",default:"A4"}),_H=(m=>h=>h.options.get(m))("pagesize")(o);const u=m=>{const h=ane[m];if(h){const b=(window.devicePixelRatio||1)*96,C=h.width*b/25.4;o!=null&&o.container&&(o.container.style.minWidth=`${C}px`);const x=o.contentAreaContainer.querySelector("iframe");x&&(x.style.width=`${C}px`),o.fire("pagesizechange",{size:m})}};return Object.keys(ane).forEach(m=>{o.ui.registry.addToggleMenuItem(`pagesize${m}`,{text:m,onAction:()=>{_H=m,u(m)},onSetup:h=>(h.setActive(_H===m),()=>{})})}),o.on("init",()=>{u(_H)}),{}});const HMe=["accordion","advlist","anchor","autolink","autosave","charmap","directionality","importcss","insertdatetime","lists","image","media","pagebreak","preview","save","searchreplace","table","fullscreen","wordcount","pasteprocess","pagesize"],zMe="undo redo | blocks bold italic forecolor removeformat alignleft aligncenter alignright alignjustify outdent indent pagebreakfullscreen preview",UMe={license_key:"gpl",skin:!1,content_css:process.env.NODE_ENV==="development"?[`${location.origin}/css/content.css`,`${location.origin}/css/reset.css`]:["./css/content.css","./css/reset.css"],promotion:!1,menu:{pagesize:{title:"页面大小",items:VMe}},menubar:"file edit insert table tools help pagesize",cleanup:!0,branding:!1,language:"zh_CN",plugins:HMe,toolbar:zMe,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,pagesize:"A4",images_upload_handler:o=>new Promise((s,i)=>{const u=new FormData;u.append("files",o.blob(),o.filename()),fetch("/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}`)})})},jMe={name:"ProEditor",components:{Editor:CMe},props:{modelValue:{type:String,default:""},pagesize:{type:String,default:"A4"},hasPagesize:{type:Boolean,default:!1},placeholder:{type:String,default:"请输入内容"},width:{type:[Number,String],default:"100%"},height:{type:Number,default:400}},setup(o,{emit:s}){const i=f.reactive({myInit:m(UMe),contentValue:o.modelValue,timeout:null});f.onMounted(()=>{_z.init({license_key:"gpl"}),_z.activeEditor.on("pagesizechange",h=>{s("update:pagesize",h.size)})}),f.watch(()=>i.contentValue,()=>{u(()=>{s("update:modelValue",i.contentValue)})}),f.watch(()=>o.modelValue,h=>{h&&h!==i.contentValue&&(i.contentValue=h)});function u(h,b=400){i.timeout!==null&&clearTimeout(i.timeout),i.timeout=setTimeout(h,b)}function m(h){o!=null&&o.height&&(h.height=o.height),o!=null&&o.width&&(h.width=o.width);const{placeholder:b,pagesize:C}=o;return h={...h,placeholder:b,...o.hasPagesize&&{menu:{...h.menu,pagesize:h.menu.pagesize},menubar:h.menubar.includes("pagesize")?h.menubar:`${h.menubar} pagesize`,pagesize:C},...!o.hasPagesize&&{menu:Object.fromEntries(Object.entries(h.menu).filter(([x])=>x!=="pagesize")),menubar:h.menubar.replace(/pagesize/g,"").trim(),pagesize:""}},h}return{...f.toRefs(i),customer:m,debounce:u}}},WMe={class:"my-tinymce"};function ZMe(o,s,i,u,m,h){const b=f.resolveComponent("Editor");return f.openBlock(),f.createElementBlock("div",WMe,[f.createVNode(b,{modelValue:o.contentValue,"onUpdate:modelValue":s[0]||(s[0]=C=>o.contentValue=C),init:o.myInit},null,8,["modelValue","init"])])}const ufe=Di(jMe,[["render",ZMe]]),GMe={name:"ShadowDomWrap",setup(o,{emit:s,expose:i}){const u=f.ref(null),m=f.ref(),h=f.ref(!1),b=x=>{if(!u.value)return;const _=u.value.contains(x.target);!_&&h.value?(h.value=!1,s("onBlur")):_&&!h.value&&(h.value=!0)},C=x=>{x.stopPropagation(),h.value||(h.value=!0,s("onFocus"))};return f.onMounted(()=>{var N,O,B;m.value=(N=u.value)==null?void 0:N.attachShadow({mode:"open"}),document.addEventListener("click",b);const x=document.createElement("link");x.rel="stylesheet",x.href=`${location==null?void 0:location.origin}/css/index.min.css`,(O=m.value)==null||O.appendChild(x);const _=document.createElement("link");_.rel="stylesheet",_.href=`${location==null?void 0:location.origin}/css/reset.css`,(B=m.value)==null||B.appendChild(_)}),f.onUnmounted(()=>{document.removeEventListener("click",b)}),i({focus:()=>{h.value=!0}}),{shadowHost:u,shadowRoot:m,handleClick:C}}};function qMe(o,s,i,u,m,h){return f.openBlock(),f.createElementBlock("div",{ref:"shadowHost",class:"shadow-host",onClick:s[0]||(s[0]=f.withModifiers((...b)=>u.handleClick&&u.handleClick(...b),["stop"]))},[u.shadowRoot?(f.openBlock(),f.createBlock(f.Teleport,{key:0,to:u.shadowRoot},[f.renderSlot(o.$slots,"default")],8,["to"])):f.createCommentVNode("",!0)],512)}const voe=Di(GMe,[["render",qMe]]),YMe=["innerHTML"],dfe=f.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue");return(i,u)=>(f.openBlock(),f.createBlock(voe,null,{default:f.withCtx(()=>[f.createElementVNode("div",{innerHTML:s.value},null,8,YMe)]),_:1}))}}),ffe=Symbol("nodesUI"),If=()=>{const o=f.inject(ffe);if(!o)throw new Error("NodesUI context not found");return o};function boe(o){if(!o||!o.ownerDocument)return null;const s=[];for(let i=o;i&&i.nodeType===1;i=i.parentElement){let u=0;for(let b=i.previousSibling;b;b=b.previousSibling)b.nodeType===1&&b.nodeName===i.nodeName&&u++;const m=i.nodeName.toLowerCase(),h=u?`${m}:nth-child(${u+1})`:m;s.unshift(h)}return s.length?s.join(" > "):null}function KMe(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 mfe(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(o)}catch(i){return console.error("nodePath query error:",i),null}}const LA=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}`:""),XMe=(o,s,i)=>{var u,m;if(!woe(o)){const h=i==null?void 0:i.getRootNode(),b=(u=h==null?void 0:h.getSelection)==null?void 0:u.call(h),C=mfe(o.nodePath,i);if(b&&o.startOffset!==void 0&&s&&C){const x=document.createRange(),_=(o==null?void 0:o.textNodeIndex)||0,N=C.childNodes[_]||C,O=Math.min(o.startOffset,((m=N.textContent)==null?void 0:m.length)||0);x.setStart(N,O),x.setEnd(N,O);const B=document.createElement("span");B.classList.add("empty-text-node"),x.insertNode(B),x.insertNode(s),x.setStartAfter(s),x.collapse(!0),b.removeAllRanges(),b.addRange(x)}}},JMe=(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)},QMe=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},e6e=o=>{let s=o.closest("TD"),i=o.closest(".node-item"),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=boe(m)),(m==null?void 0:m.getAttribute("selectable"))==="false")return null;let b={element:m,nodePath:h};const C=m==null?void 0:m.getAttribute("data-textNodeIndex");C&&(b.textNodeIndex=Number(C));const x=m==null?void 0:m.getAttribute("data-startOffset");x&&(b.startOffset=Number(x));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},t6e=o=>hxe(o,s=>f.toValue(s.nodes).map(i=>({...i,color:s.color,activated:s==null?void 0:s.activated,dataGroupKey:s.id}))),yoe=(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})`},n6e=o=>{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").querySelectorAll("table");return{showTextType:"cell",tableIndex:Array.from(C).indexOf(b)+1,colIndex:h,rowIndex:m}},o6e=(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 x=n6e(C);return x?(x==null?void 0:x.showTextType)==="input"?{...C,...x,inputIndex:i++}:{...C,...x}:null}))==null?void 0:h.filter(Boolean):[]};function s6e(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 x=m.colIndex;s.find(N=>N.rowIndex===m.rowIndex&&N.colIndex===x&&!u.has(N));x++)C++;if(C!==0){b=C;for(let x=m.rowIndex;;x++){let _=0;const N=[];for(let O=m.colIndex;O<m.colIndex+b;O++){const B=s.find(H=>H.rowIndex===x&&H.colIndex===O&&!u.has(H));if(B)_++,N.push(B);else break}if(_===b)h.push(...N);else break}h.length>0&&(i.push([...h]),h.forEach(x=>u.add(x)))}}return i}function r6e(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 pfe=(o,s)=>{var _;const i=o6e(o,s||[]),u=[],m=[];(_=f.toValue(i))==null||_.forEach(N=>{(N==null?void 0:N.showTextType)==="input"?u.push(N):m.push(N)});const h=yxe(m,"tableIndex"),b=Object.entries(h).map(([N,O])=>({tableIndex:Number(N),nodes:O})),C=ede(b==null?void 0:b.map(N=>s6e(N==null?void 0:N.nodes))),x=(C==null?void 0:C.map(N=>r6e(N)))||[];return[...u,...x]},t4=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}`:""},a6e=(o,s)=>{const i=pfe(o,s||[]);let 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)?t4(m==null?void 0:m.min):`${t4(m==null?void 0:m.min)}:${t4(m==null?void 0:m.max)}`)}),u==null?void 0:u.join(",")},woe=o=>o.startOffset===void 0&&o.textNodeIndex===void 0,i6e=o=>{var s;if(((s=o.textContent)==null?void 0:s.trim())===""&&o.querySelector("p")){const i=o.querySelector("p");if(i){const u=O=>{const B={};return O&&O.split(";").forEach(H=>{const[Z,J]=H.split(":").map(K=>K.trim());Z&&J&&(B[Z]=J)}),B},m=O=>Object.entries(O).map(([B,H])=>`${B}: ${H}`).join("; "),h=u(o.getAttribute("style")||""),b=u(i.getAttribute("style")||""),C=i.querySelectorAll("span");let x={};C.forEach(O=>{const B=u(O.getAttribute("style")||"");x={...x,...B}});const _={...h,...b,...x},N=m(_);N&&o.setAttribute("style",N),o.removeChild(i)}}},l6e={key:0},c6e={key:1,class:"td-node"},u6e=f.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,i=f.computed(()=>{var u,m;return((m=(u=s==null?void 0:s.node)==null?void 0:u.element)==null?void 0:m.TagName)==="TD"});return(u,m)=>{var h,b;return i.value?(f.openBlock(),f.createElementBlock("span",l6e,f.toDisplayString((h=s==null?void 0:s.node)==null?void 0:h.label),1)):(f.openBlock(),f.createElementBlock("span",c6e,f.toDisplayString((b=s==null?void 0:s.node)==null?void 0:b.label),1))}}}),gfe=Symbol("nodesEditor"),z0=()=>{const o=f.inject(gfe);if(!o)throw new Error("NodesEditor context not found");return o},xU=f.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,{currentNodes:i}=If(),{nodes:u,renderType:m}=z0(),h=f.computed(()=>{var x;return(x=s.node)!=null&&x.id?u.value.some(_=>_.id===s.node.id):!1}),b=f.computed(()=>{var x;if(!((x=s.node)!=null&&x.element))return!1;try{return s.node.element.parentNode!==null}catch(_){return console.warn("Element validation failed:",_),!1}}),C=f.computed(()=>{var x;return(x=f.toValue(i))==null?void 0:x.find(_=>{var N;return(_==null?void 0:_.id)===((N=s==null?void 0:s.node)==null?void 0:N.id)})});return f.watch(()=>C,()=>{var _,N,O,B;const x=f.toValue(C);(_=s==null?void 0:s.node)!=null&&_.element&&(x?x!=null&&x.activated||(s.node.element.style.setProperty("--node-color",(x==null?void 0:x.color)||"#409eff"),s.node.element.style.setProperty("--node-bg-color",yoe((x==null?void 0:x.color)||"#409eff",.1)),s.node.element.setAttribute("data-dataGroupKey",x==null?void 0:x.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("activated")):((N=s.node.element)==null||N.removeAttribute("data-dataGroupKey"),(O=s.node.element)==null||O.removeAttribute("selectable"),(B=s.node.element)==null||B.classList.remove("activated")))},{immediate:!0,deep:!0}),(x,_)=>{var N;return(N=x.node)!=null&&N.element&&b.value&&h.value?(f.openBlock(),f.createBlock(f.Teleport,{key:0,to:x.node.element},[f.createElementVNode("div",{class:f.normalizeClass(["node-item-render",`node-item-${f.unref(m)}`])},[f.renderSlot(x.$slots,"default",{node:x.node},()=>[f.createVNode(u6e,{node:x.node},null,8,["node"])])],2)],8,["to"])):f.createCommentVNode("",!0)}}});function d6e(){const o=f.ref(!1),s=u=>{u.key==="Control"&&(o.value=!0)},i=u=>{u.key==="Control"&&(o.value=!1)};return f.onMounted(()=>{window.addEventListener("keydown",s),window.addEventListener("keyup",i)}),f.onUnmounted(()=>{window.removeEventListener("keydown",s),window.removeEventListener("keyup",i)}),o}function hfe(){const{selectedNodes:o,setSelectedNodes:s,containerRef:i,currentNodes:u}=If(),{editorId:m,nodes:h}=z0(),b=f.ref(!1),C=f.ref({x:0,y:0}),x=f.ref({x:0,y:0}),_=f.ref({left:0,top:0,width:0,height:0}),N=f.ref(null),O=Ne=>{const te=Ne.closest(".node-item-td")||Ne.closest(".node-item");if(te!==null){let Ue=[];if(te.classList.contains("node-selected"))return;const ut=te.getAttribute("id");if(ut&&h.value){const lt=h.value.find(Oe=>Oe.id===ut);lt&&(Ue=[lt])}Ue=W(Ue),s(Ue)}},B=Ne=>{Ne.button===2&&O(Ne==null?void 0:Ne.target),Ne.button===0&&(b.value=!0,N.value&&(C.value={x:Ne.pageX,y:Ne.pageY},x.value={x:Ne.pageX,y:Ne.pageY},K(Ne),V(),N.value.style.display="block",window.addEventListener("mousemove",H),window.addEventListener("mouseup",Z)))},H=Wae(Ne=>{b.value&&(x.value={x:Ne.pageX,y:Ne.pageY},V())},16),Z=Ne=>{Ne.button===0&&(b.value=!1,N.value&&(V(),N.value.style.display="none",window.removeEventListener("mousemove",H),window.removeEventListener("mouseup",Z)))},J=d6e(),K=Ne=>{var Ue,ut;let te=[];if(Ne.button===0&&(Ne!=null&&Ne.target)){const lt=((Ue=Ne==null?void 0:Ne.target)==null?void 0:Ue.closest(".node-item-td"))||((ut=Ne==null?void 0:Ne.target)==null?void 0:ut.closest(".node-item"));if(lt!==null){const Oe=lt.getAttribute("id");if(Oe&&h.value){const ue=h.value.find(Pt=>Pt.id===Oe);ue&&(J.value?o.value.some(Pt=>LA(Pt)===LA(ue))?te=o.value.filter(ye=>LA(ye)!==LA(ue)):te=[...o.value,ue]:ue&&(te=[ue]))}}te=W(te),s(te)}},G=()=>{if(!i.value||!(_.value.width>3||_.value.height>3))return;let Ne=[];const te={left:_.value.left,right:_.value.left+_.value.width,top:_.value.top,bottom:_.value.top+_.value.height};if(i.value.querySelectorAll("*").forEach(ut=>{const lt=ut.getBoundingClientRect(),Oe=window.scrollX||window.pageXOffset,ue=window.scrollY||window.pageYOffset,Pt={left:lt.left+Oe,right:lt.right+Oe,top:lt.top+ue,bottom:lt.bottom+ue};if(Pt.right>te.left&&Pt.left<te.right&&Pt.bottom>te.top&&Pt.top<te.bottom){const ye=ut.getAttribute("id");if(ye&&h.value){const De=h.value.find(R=>R.id===ye);De&&(Ne=[...Ne,De])}}}),Ne=W(Ne),J.value){const ut=new Set(o.value.map(Oe=>LA(Oe))),lt=Ne.filter(Oe=>!ut.has(LA(Oe)));s([...o.value,...lt])}else s(Ne)},W=Ne=>{var Ue;let te=[];if(Ne.length>0){const ut=(Ue=Ne.map(ye=>ye==null?void 0:ye.groupKey))==null?void 0:Ue.filter(Boolean),lt=new Set(ut),Oe=Array.from(lt),ue=h.value.filter(ye=>Oe.includes(ye.groupKey));te=[...Ne,...ue],te=[...Pxe(te.filter(ye=>ye==null?void 0:ye.id),"id")||[],...te.filter(ye=>!ye.id)]}if(u&&u.value&&u.value.length>0){const ut=new Set(u.value.map(lt=>lt.id).filter(Boolean));te=te.filter(lt=>lt.id?!ut.has(lt.id):!0)}return te},V=Wae(()=>{if(!N.value)return;const{x:Ne,y:te}=C.value,{x:Ue,y:ut}=x.value,lt=Math.min(Ne,Ue),Oe=Math.min(te,ut),ue=Math.abs(Ne-Ue),Pt=Math.abs(te-ut);_.value={left:lt,top:Oe,width:ue,height:Pt}},16),ge=Ne=>{if(!N.value)return;const{left:te,top:Ue,width:ut,height:lt}=f.toValue(Ne);N.value.style.left=`${te}px`,N.value.style.top=`${Ue}px`,N.value.style.width=`${ut}px`,N.value.style.height=`${lt}px`},Qe=()=>{if(!i.value)return;i.value.addEventListener("mousedown",B);const Ne=document.getElementById(`select_area_${m}`);if(Ne){N.value=Ne;return}const te=document.createElement("div");te.id=`select_area_${m}`,te.style.position="absolute",te.style.border="1px solid #1677ff",te.style.backgroundColor="rgba(22, 119, 255, 0.05)",te.style.pointerEvents="none",te.style.display="none",document.body.appendChild(te),N.value=te};return f.watch(_,(Ne,te)=>{xa(Ne,te)||(ge(Ne),b.value&&G())},{deep:!0}),f.watch(()=>i.value,Ne=>{f.toValue(Ne)&&Qe()},{immediate:!0}),f.onUnmounted(()=>{i.value&&i.value.removeEventListener("mousedown",B)}),{isSelecting:b,selectionBox:N}}function vfe(){const{selectedNodes:o,containerRef:s}=If(),i=()=>{var m;(m=f.toValue(s))==null||m.querySelectorAll(".node-selected").forEach(h=>{h.classList.remove("node-selected")})},u=m=>{m.forEach(h=>{h.classList.add("node-selected")})};f.watch(()=>o,()=>{i(),setTimeout(()=>{var h,b;const m=(b=(h=f.toValue(o))==null?void 0:h.map(C=>{var x;return(x=s.value)==null?void 0:x.querySelector(`[id="${C.id}"]`)}))==null?void 0:b.filter(Boolean);u(m)},0)},{deep:!0})}const EU=()=>{const{nodes:o,updateNodes:s}=z0();return{nodes:o,addNode:C=>{const _=(Array.isArray(C)?C:[C]).map(O=>({...O,id:O.id||hE()})),N=[...o.value,..._];s(N)},removeNode:C=>{const x=Array.isArray(C)?C:[C],_=[],N=[];x.forEach(B=>{const H=o.value.find(Z=>(Z==null?void 0:Z.id)===B);woe(H)?_.push(B):N.push(B)});let O=o.value.filter(B=>!N.includes(B==null?void 0:B.id));O=O==null?void 0:O.map(B=>_.includes(B==null?void 0:B.id)?{id:B==null?void 0:B.id,nodePath:B==null?void 0:B.nodePath,label:"文本",nodeType:"text"}:B),s(O)},editNodes:C=>{const x=Array.isArray(C)?C:[C],_=hE(),N=x.map(B=>{const H={...B};let Z=B==null?void 0:B.id;return Z||(Z=hE(),H.id=Z),H!=null&&H.groupKey||(H.groupKey=_),H}),O=[...o.value];N.forEach(B=>{const H=O.findIndex(Z=>Z.id===B.id);H!==-1?O[H]=B:O.push(B)}),s(O)},insertNodeAt:(C,x)=>{const _=[...o.value];_.splice(x,0,C),s(_)},moveNode:(C,x)=>{const _=[...o.value],[N]=_.splice(C,1);_.splice(x,0,N),s(_)}}};function f6e(){const{removeNode:o}=EU(),{containerRef:s}=If(),i=f.ref(null),u=h=>{var J,K;if(h.target instanceof Element&&(h.target.closest(".node-item")||h.target.closest(".node-item-td")))return;const b=h.target;if(b===s.value)return;const x=((J=s.value)==null?void 0:J.getRootNode()).getSelection(),_=(K=s.value)==null?void 0:K.querySelectorAll('[contenteditable="true"]');_==null||_.forEach(G=>{G.setAttribute("contenteditable","false")});const N=b.textContent||"",O=b.innerHTML||"";i.value=b,b.setAttribute("contenteditable","true"),b.focus();const B=new MutationObserver(()=>{b.textContent!==N&&(b.innerHTML=O)});B.observe(b,{characterData:!0,childList:!0,subtree:!0});const H=G=>{G.preventDefault()};b.addEventListener("input",H),b.addEventListener("paste",H),b.addEventListener("drop",H),b.addEventListener("keydown",G=>{var W,V,ge,Qe;if(((W=document.activeElement)==null?void 0:W.shadowRoot)===((V=s.value)==null?void 0:V.getRootNode())&&!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(G.key)){if(G.key==="Backspace"||G.key==="Delete"){const Ne=x==null?void 0:x.getRangeAt(0);if(b.blur(),(Ne==null?void 0:Ne.startOffset)===0){const te=Ne.startContainer;if(te.nodeType===Node.TEXT_NODE){const Ue=te.previousSibling;if(Ue&&Ue.nodeType===Node.ELEMENT_NODE&&Ue.classList.contains("node-item")){const ut=Ue.getAttribute("id");ut&&o(ut),(ge=te.parentElement)==null||ge.normalize();return}}else if(te.nodeType===Node.ELEMENT_NODE){const Ue=te.previousSibling;if(Ue&&Ue.nodeType===Node.ELEMENT_NODE&&Ue.classList.contains("node-item")){const ut=Ue.getAttribute("id");ut&&o(ut),(Qe=te.parentElement)==null||Qe.normalize();return}}}}G.preventDefault()}});const Z=()=>{b==null||b.normalize(),B.disconnect(),b.removeEventListener("input",H),b.removeEventListener("paste",H),b.removeEventListener("drop",H),b.removeEventListener("blur",Z),b.setAttribute("contenteditable","false")};b.addEventListener("blur",Z)},m=()=>{var h;(h=s.value)==null||h.addEventListener("dblclick",u)};return f.watch(s,h=>{h&&m()},{immediate:!0}),f.onUnmounted(()=>{var h;(h=s.value)==null||h.removeEventListener("dblclick",u)}),{}}function m6e(){const{containerRef:o,focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}=If(),h=_=>{var O,B;const N=_==null?void 0:_.getSelection();try{if((O=s.value)==null||O.normalize(),N){const H=N.getRangeAt(0);u.value=QMe(H.startContainer);const Z=H.startOffset,J=(B=s.value)==null?void 0:B.querySelectorAll(".node-item");let K=0;return m.value=0,J==null||J.forEach(G=>{const W=document.createRange();if(W.selectNode(G),W.comparePoint(H.startContainer,Z)>=0){m.value+=1;const V=G.getAttribute("data-startOffset");Number(V)>K&&(K=Number(V))}}),K+Z}}catch{}return 0},b=()=>{var N;const _=(N=o.value)==null?void 0:N.getRootNode();i.value=h(_)},C=_=>{var H;const N=_.target;if(N===o.value)return;s.value=N;const O=(H=o.value)==null?void 0:H.getRootNode();i.value=h(O),N.addEventListener("click",b),N.addEventListener("keyup",Z=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(Z.key)&&b()});const B=()=>{N.removeEventListener("click",b),N.removeEventListener("keyup",b),N.removeEventListener("blur",B),setTimeout(()=>{s.value=null,u.value=0,i.value=-1},300)};N.addEventListener("blur",B)},x=()=>{var _;(_=o.value)==null||_.addEventListener("focus",C,!0)};return f.watch(o,_=>{_&&x()},{immediate:!0}),f.onUnmounted(()=>{var _;(_=o.value)==null||_.removeEventListener("focus",C,!0)}),{focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}}function p6e(o){const s=o.value===null?[]:[JSON.parse(JSON.stringify(o.value))],i=f.ref(s),u=f.ref(0),m=f.ref(!1),h=f.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])))},x=_=>{(_.ctrlKey||_.metaKey)&&_.key==="z"?(_.preventDefault(),b()):(_.ctrlKey||_.metaKey)&&_.key==="y"&&(_.preventDefault(),C())};return f.onMounted(()=>{window.addEventListener("keydown",x)}),f.onUnmounted(()=>{window.removeEventListener("keydown",x)}),f.watch(o,cE(_=>{_&&!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 g6e(){const{modelValue:o,inputTypes:s}=z0(),{nodes:i,addNode:u}=EU(),m=C=>{if(!C||typeof C!="string")return[];const _=new DOMParser().parseFromString(C,"text/html");return Array.from(_.querySelectorAll("td")).filter(B=>{var H;return!((H=B.textContent)!=null&&H.trim())})},h=(C,x)=>{const _=x.map(O=>O.nodePath);return C==null?void 0:C.map(O=>({nodePath:boe(O)})).filter(O=>{const B=O==null?void 0:O.nodePath;return!_.includes(B)})},b=C=>{var N;const x=((N=s==null?void 0:s.find(O=>{var B;return((B=O.value)==null?void 0:B.toLowerCase())==="text"}))==null?void 0:N.getDefaultProps())||{},_=C.map(O=>({nodeType:"Text",label:"文本",props:{...x},...O}));u(_)};f.onMounted(()=>{const C=m(o),x=h(C,f.toValue(i));b(x)})}function h6e(){const{selectedNodes:o,containerRef:s}=If(),{removeNode:i}=EU(),u=f.ref(null),m=C=>{var x;if((x=f.toValue(s))!=null&&x.contains(u.value)&&(C.key==="Delete"||C.key==="Backspace")){let _=[];C.preventDefault(),f.toValue(o).length>0&&(f.toValue(o).forEach(N=>{var O,B,H;if(((O=N==null?void 0:N.element)==null?void 0:O.tagName)==="TD"){const Z=(B=N==null?void 0:N.element)==null?void 0:B.getAttribute("id");Z&&_.push(Z)}else{const Z=(H=N==null?void 0:N.element)==null?void 0:H.getAttribute("id");Z&&_.push(Z)}}),o.value=[],(_==null?void 0:_.length)>0&&i(_))}},h=C=>{var x;(x=f.toValue(s))!=null&&x.contains(C.target)?u.value=C.target:u.value=null},b=()=>{s.value&&(window.addEventListener("keydown",m),s.value.addEventListener("mousedown",h))};f.watch(()=>s.value,C=>{f.toValue(C)&&b()},{immediate:!0}),f.onUnmounted(()=>{s.value&&(window.removeEventListener("keydown",m),s.value.removeEventListener("mousedown",h))})}function _U(){const{nodes:o}=z0(),{containerRef:s,renderNodes:i,uiReady:u}=If(),m=()=>{var h;i.value=[...((h=o.value)==null?void 0:h.map(b=>{var x;const C=(x=s.value)==null?void 0:x.querySelector(`[id="${b.id}"]`);return{...b,element:C}}))||[]].filter(b=>!!(b!=null&&b.element))};f.watch(()=>[o,s.value,u],()=>{f.toValue(u)&&m()},{immediate:!0,deep:!0})}const ine=f.ref({});function kU(o){return f.computed(()=>{var s;return(s=ine.value)==null?void 0:s[o]})}function bfe(){const o=z0(),s=If();f.onMounted(()=>{const{editorId:i}=o;i&&(ine.value[i]=f.ref({...o,...s}))}),f.onUnmounted(()=>{const{editorId:i}=o;i&&(ine.value[i]=null)})}const v6e=f.defineComponent({__name:"NodesEditUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"edit"}},setup(o){const{nodes:s}=z0(),{uiReady:i,renderNodes:u}=If();return bfe(),p6e(s),hfe(),vfe(),h6e(),m6e(),f6e(),g6e(),_U(),(m,h)=>f.unref(i)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(u),b=>(f.openBlock(),f.createBlock(xU,{key:b==null?void 0:b.id,node:b},{default:f.withCtx(C=>[f.renderSlot(m.$slots,"nodeItem",{node:C==null?void 0:C.node})]),_:2},1032,["node"]))),128)):f.createCommentVNode("",!0)}}),Wie=f.defineComponent({__name:"NodesPreviewUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=If();return _U(),(u,m)=>f.unref(s)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(i),h=>(f.openBlock(),f.createBlock(xU,{key:h==null?void 0:h.id,node:h},{default:f.withCtx(b=>[f.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):f.createCommentVNode("",!0)}}),b6e=f.defineComponent({__name:"NodesEnterUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=If();return _U(),(u,m)=>f.unref(s)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(i),h=>(f.openBlock(),f.createBlock(xU,{key:h==null?void 0:h.id,node:h},{default:f.withCtx(b=>[f.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):f.createCommentVNode("",!0)}}),y6e=f.defineComponent({__name:"NodesSelectUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"select"}},setup(o){const{uiReady:s,renderNodes:i}=If();return bfe(),hfe(),vfe(),_U(),(u,m)=>f.unref(s)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(i),h=>(f.openBlock(),f.createBlock(xU,{key:h==null?void 0:h.id,node:h},{default:f.withCtx(b=>[f.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):f.createCommentVNode("",!0)}}),w6e=f.defineComponent({__name:"NodesProvider",props:f.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},renderType:{type:String,default:"preview"},inputTypes:{type:Array,default:()=>[]},editorId:{type:String,default:""}},{formData:{},formDataModifiers:{},nodes:{},nodesModifiers:{}}),emits:["update:formData","update:nodes"],setup(o){const s=o,i=f.useModel(o,"formData"),u=f.useModel(o,"nodes");return f.provide(gfe,{modelValue:s.modelValue,renderType:s.renderType,inputTypes:s.inputTypes,editorId:s==null?void 0:s.editorId,nodes:u,updateNodes:m=>u.value=m,formData:i}),(m,h)=>f.renderSlot(m.$slots,"default")}}),i2=f.ref({});function C6e(o){return f.computed(()=>(i2.value[o]||(i2.value[o]=f.ref([])),i2.value[o]))}function S6e(o){const{editorId:s}=o,i=f.ref(!1);f.onMounted(()=>{i2.value[s]||(i2.value[s]=f.ref([]));const u=i2.value[s].findIndex(m=>m.id===o.id);u!==-1&&i2.value[s].splice(u,1),i.value=!0,i2.value[s].push({...o,isMounted:i})}),f.onUnmounted(()=>{i.value=!1})}const x6e=f.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=f.computed({get:()=>(u.selectedNodes||[]).map(W=>{var Qe;let V=(Qe=u==null?void 0:u.nodes)==null?void 0:Qe.find(Ne=>(Ne==null?void 0:Ne.id)===(W==null?void 0:W.id)),ge=W!=null&&W.element?W==null?void 0:W.element:KMe(W==null?void 0:W.id,b.value);return{...V||{},...W,element:ge}}),set:W=>{const V=W.map(({element:ge,...Qe})=>{var te;return{...((te=u==null?void 0:u.nodes)==null?void 0:te.find(Ue=>(Ue==null?void 0:Ue.id)===(Qe==null?void 0:Qe.id)))||{},...Qe}});m("update:selectedNodes",V)}}),b=f.ref(null),C=f.ref([]),x=f.ref(null),_=f.ref(-1),N=f.ref(0),O=f.ref(0),B=C6e(u==null?void 0:u.editorId),H=f.ref(!1),Z=f.computed(()=>u.htmlRenderRef),J=f.computed(()=>{var V,ge,Qe;const W=((Qe=(ge=(V=f.toValue(B))==null?void 0:V.filter(Ne=>!f.toValue(Ne==null?void 0:Ne.activated)))==null?void 0:ge.filter(Ne=>f.toValue(Ne.isMounted)))==null?void 0:Qe.filter(Ne=>f.toValue(Ne==null?void 0:Ne.isOccupy)))||[];return t6e([...(u==null?void 0:u.nodesGroups)||[],...W])}),K=f.ref([]),G=W=>{const V=W.map(({element:ge,...Qe})=>{var te;return{...((te=C.value)==null?void 0:te.find(Ue=>(Ue==null?void 0:Ue.id)===(Qe==null?void 0:Qe.id)))||{},...Qe}});xa(V,h.value)||(h.value=W,m("onSelectedNodes",V))};return s({setSelectedNodes:G}),f.provide(ffe,{containerRef:b,htmlRenderRef:Z,focusedElement:x,currentRenderNodes:K,cursorPosition:_,focusedNodeIndex:N,preNodeNumber:O,currentNodes:J,selectedNodes:h,setSelectedNodes:G,renderNodes:C,uiReady:H,nodesGroups:u==null?void 0:u.nodesGroups}),(W,V)=>f.renderSlot(W.$slots,"default")}}),E6e=["onClick"],_6e={key:0,class:"icon"},k6e={key:1,class:"arrow"},T6e={key:0,class:"submenu"},A6e=["onClick"],N6e={key:0,class:"icon"},O6e=f.defineComponent({__name:"index",props:f.mergeModels({style:{}},{show:{},showModifiers:{}}),emits:f.mergeModels(["select"],["update:show"]),setup(o,{emit:s}){const{selectedNodes:i,setSelectedNodes:u,focusedElement:m,cursorPosition:h,focusedNodeIndex:b,preNodeNumber:C}=If(),{inputTypes:x}=z0(),_=f.useModel(o,"show"),{editNodes:N}=EU(),O=J=>{var G;const K=((G=J==null?void 0:J.getDefaultProps)==null?void 0:G.call(J))||{};if(f.toValue(m)&&!xxe(f.toValue(h))){const W=boe(f.toValue(m)),V=f.toValue(h),ge=(f.toValue(C)||0)+1,Qe=e6e(f.toValue(m));W&&V&&V>=0&&N({...Qe,label:J==null?void 0:J.label,nodePath:W,startOffset:V,subNodeSort:ge,textNodeIndex:f.toValue(b)||0,nodeType:J==null?void 0:J.value,props:K})}else if(i){const W=f.toValue(i);if(W!=null&&W.length){const V=W==null?void 0:W.map(ge=>({...ge,label:J==null?void 0:J.label,element:ge==null?void 0:ge.element,nodePath:ge==null?void 0:ge.nodePath,nodeType:J==null?void 0:J.value,props:K}));N(V),u(V)}}_.value=!1},B=f.computed(()=>{const J=[],K=[];return f.toValue(x).forEach(G=>{G.groupName==="system"?K.push({...G,handler:()=>{O(G)}}):J.push({...G,handler:()=>{O(G)}})}),[{label:"限定填写内容",icon:"i-bi:lock",children:J},{label:"插入记录标识",icon:"i-bi:flag",children:K}].filter(G=>{var W;return(W=G==null?void 0:G.children)==null?void 0:W.length})}),H=s,Z=(J,K)=>{J.preventDefault(),K!=null&&K.handler&&K.handler(),K!=null&&K.value&&H("select",K==null?void 0:K.value)};return(J,K)=>f.withDirectives((f.openBlock(),f.createElementBlock("div",{class:"context-menu",style:f.normalizeStyle({...J.style})},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(B.value,G=>(f.openBlock(),f.createElementBlock("div",{key:G==null?void 0:G.label,class:"menu-item"},[f.createElementVNode("div",{class:"menu-item-content",onClick:W=>Z(W,G)},[G!=null&&G.icon?(f.openBlock(),f.createElementBlock("div",_6e,[f.createElementVNode("div",{class:f.normalizeClass(G==null?void 0:G.icon)},null,2)])):f.createCommentVNode("",!0),f.createTextVNode(" "+f.toDisplayString(G.label)+" ",1),G!=null&&G.children?(f.openBlock(),f.createElementBlock("span",k6e,"›")):f.createCommentVNode("",!0)],8,E6e),G!=null&&G.children?(f.openBlock(),f.createElementBlock("div",T6e,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(G.children,W=>(f.openBlock(),f.createElementBlock("div",{key:W.action,class:"menu-item",onClick:V=>Z(V,W)},[W!=null&&W.icon?(f.openBlock(),f.createElementBlock("div",N6e,[f.createElementVNode("div",{class:f.normalizeClass(W==null?void 0:W.icon)},null,2)])):f.createCommentVNode("",!0),f.createTextVNode(" "+f.toDisplayString(W.label),1)],8,A6e))),128))])):f.createCommentVNode("",!0)]))),128))],4)),[[f.vShow,_.value]])}}),$6e=Di(O6e,[["__scopeId","data-v-16c69bc2"]]);function D6e(){const o=f.ref(!1),s=f.ref({left:"0px",top:"0px"}),i=m=>{m.preventDefault(),o.value=!0;const b=m.currentTarget.getBoundingClientRect(),C=m.clientX-b.left,x=m.clientY-b.top,_=118,N=b.width-C<_;s.value={left:N?`${C-_}px`:`${C}px`,top:`${x}px`}},u=m=>{const h=document.querySelector(".context-menu");h&&!h.contains(m.target)&&(o.value=!1)};return f.onMounted(()=>{document.addEventListener("mousedown",u)}),f.onUnmounted(()=>{document.removeEventListener("mousedown",u)}),{showContextMenu:o,contextMenuStyle:s,onContextMenu:i,closeContextMenu:u}}function yfe(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 lne=yfe(),wfe=(...o)=>{const s=o[0],i=o[1];f.onMounted(()=>{lne.on(s,i)}),f.onBeforeUnmount(()=>{lne.off(s)})},Coe=()=>(...s)=>{lne.emit(...s)};let VA=null;function M6e(o){const{onSelected:s}=o,{selectedNodes:i,uiReady:u,setSelectedNodes:m}=If(),h=f.ref("multiple"),b=(x="select")=>{var N,O;let _=[];h.value==="single"?(N=i.value)!=null&&N[0]&&_.push((O=i.value)==null?void 0:O[0]):_=Pa(i.value),VA==null||VA({data:_,type:x}),m(_)};return f.watch(()=>i,()=>{u.value&&(b(),s==null||s(f.toValue(i)))},{deep:!0}),wfe("selectNodes",x=>{const{data:_,callback:N=null,mode:O="multiple"}=x;h.value=O,setTimeout(()=>{m(f.toValue(_)),VA=N},100)}),{onBlur:()=>{VA&&(b("blur"),VA=null,m([]))}}}const R6e={class:"relative"},B6e=f.defineComponent({__name:"index",props:{hasContextMenu:{type:Boolean,default:!1}},setup(o,{expose:s}){const{containerRef:i,uiReady:u}=If(),{nodes:m,modelValue:h}=z0(),b=o,{showContextMenu:C,contextMenuStyle:x,onContextMenu:_}=D6e(),N=f.ref(null),O=K=>{let G=null;if(woe(K))G=mfe(K.nodePath,f.toValue(i)),G&&(G.classList.add("node-item-td"),G.setAttribute("contenteditable","false"),i6e(G));else{const W=document.createElement("span");W.setAttribute("contenteditable","false"),W.classList.add("node-item"),G=W,XMe(K,G,i.value)}return G&&JMe(G,K),G},B=()=>{const K=Oxe(m.value,[G=>G.nodePath,G=>G.textNodeIndex,G=>G.startOffset??-1,G=>G.subNodeSort],["asc","desc","desc","desc"]);K==null||K.forEach(G=>{O(G)})},H=()=>{N.value&&(u.value=!1,f.nextTick(()=>{N.value&&(N.value.innerHTML=h,B(),u.value=!0)}))};f.watch(()=>[m,h,N],()=>{H()},{deep:!0,immediate:!0});const Z=f.ref(),{onBlur:J}=M6e({onSelected:()=>{var K;(K=Z.value)==null||K.focus()}});return s({renderHtml:H}),(K,G)=>(f.openBlock(),f.createElementBlock("div",R6e,[f.createVNode(voe,{onOnBlur:f.unref(J),ref_key:"shadowDomRef",ref:Z},{default:f.withCtx(()=>[f.createElementVNode("html",{class:"nodes-editor",ref_key:"containerRef",ref:i,onContextmenu:G[0]||(G[0]=f.withModifiers((...W)=>f.unref(_)&&f.unref(_)(...W),["prevent"]))},[f.createElementVNode("body",{ref_key:"bodyRef",ref:N},null,512)],544)]),_:1},8,["onOnBlur"]),b!=null&&b.hasContextMenu?(f.openBlock(),f.createBlock($6e,{key:0,show:f.unref(C),"onUpdate:show":G[1]||(G[1]=W=>f.isRef(C)?C.value=W:null),style:f.normalizeStyle(f.unref(x))},null,8,["show","style"])):f.createCommentVNode("",!0)]))}}),Zie={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}},I6e={class:"pagesize"},P6e=f.defineComponent({__name:"index",props:{pagesize:{type:String,default:"A4"}},setup(o){const s=o,i=f.computed(()=>{const u=Zie[s.pagesize]||Zie.A4,m=(window.devicePixelRatio||1)*96;return u.width*m/25.4});return(u,m)=>(f.openBlock(),f.createElementBlock("div",I6e,[f.createElementVNode("div",{style:f.normalizeStyle({width:`${i.value}px`}),class:"pagesize-content"},[f.renderSlot(u.$slots,"default",{},void 0,!0)],4)]))}}),F6e=Di(P6e,[["__scopeId","data-v-46808dfa"]]),Cfe=f.defineComponent({__name:"index",props:f.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},pagesize:{type:String,default:"A4"},renderType:{type:String,default:"preview"},formData:{type:Object,default:()=>({})},inputTypes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},id:{type:String,default:""}},{selectedNodes:{default:[]},selectedNodesModifiers:{}}),emits:f.mergeModels(["update:nodes","update:formData","onSelectedNodes"],["update:selectedNodes"]),setup(o,{expose:s,emit:i}){const u=o,m=i,h=f.useModel(o,"selectedNodes"),b=f.ref(),C=f.ref(null),x=f.ref(),_=f.computed(()=>{switch(u.renderType){case"edit":return v6e;case"select":return y6e;case"preview":return Wie;case"enter":return b6e;default:return Wie}}),N=H=>{m("update:nodes",H)},O=H=>{m("update:formData",H)},B=H=>{m("onSelectedNodes",H)};return s({formRef:{validate:()=>{var H,Z,J;return(J=(Z=(H=b.value)==null?void 0:H.formRef)==null?void 0:Z.validate)==null?void 0:J.call(Z)}},setSelectedNodes:H=>{var Z,J;(J=(Z=x.value)==null?void 0:Z.setSelectedNodes)==null||J.call(Z,H)}}),(H,Z)=>(f.openBlock(),f.createBlock(F6e,{pagesize:o.pagesize},{default:f.withCtx(()=>[f.createVNode(x6e,{ref_key:"UIRef",ref:x,nodes:o.nodes,"onUpdate:nodes":N,selectedNodes:h.value,"onUpdate:selectedNodes":Z[0]||(Z[0]=J=>h.value=J),onOnSelectedNodes:B,nodesGroups:o.nodesGroups,editorId:u==null?void 0:u.id,htmlRenderRef:C.value},{default:f.withCtx(()=>[f.createVNode(w6e,{renderType:o.renderType,"model-value":o.modelValue,nodes:o.nodes,"onUpdate:nodes":N,formData:o.formData,"onUpdate:formData":O,inputTypes:o.inputTypes,editorId:u==null?void 0:u.id},{default:f.withCtx(()=>[f.createVNode(B6e,{hasContextMenu:o.renderType==="edit",ref_key:"htmlRenderRef",ref:C},null,8,["hasContextMenu"]),(f.openBlock(),f.createBlock(f.resolveDynamicComponent(_.value),{renderType:o.renderType,pagesize:o.pagesize,ref_key:"contentRef",ref:b},{nodeItem:f.withCtx(J=>[f.renderSlot(H.$slots,"nodeItem",{node:J==null?void 0:J.node})]),_:3},8,["renderType","pagesize"]))]),_:3},8,["renderType","model-value","nodes","formData","inputTypes","editorId"])]),_:3},8,["nodes","selectedNodes","nodesGroups","editorId","htmlRenderRef"])]),_:3},8,["pagesize"]))}}),L6e={class:"nodes-text"},V6e={key:0,class:"node-text-input"},H6e={key:1,class:"node-text-td"},z6e={key:0,class:"node-text-table-index"},U6e=f.defineComponent({__name:"index",props:f.mergeModels({editorId:{type:String,default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=f.useModel(o,"modelValue"),u=kU(s==null?void 0:s.editorId),m=f.computed(()=>{var b,C,x,_,N,O;if(((b=f.toValue(h))==null?void 0:b.length)>0)if((x=(C=f.toValue(h))==null?void 0:C[0])!=null&&x.element){const B=(N=(_=f.toValue(h))==null?void 0:_[0])==null?void 0:N.element.closest("body").querySelectorAll("table");return((O=Array.from(B))==null?void 0:O.length)===1}else return!0;else return!0}),h=f.computed(()=>{var b;return pfe(i.value,((b=f.toValue(u))==null?void 0:b.renderNodes)||[])});return(b,C)=>(f.openBlock(),f.createElementBlock("div",L6e,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(h.value,(x,_)=>{var N,O,B;return f.openBlock(),f.createElementBlock("div",{key:_,class:"node-text-item"},[(x==null?void 0:x.showTextType)==="input"?(f.openBlock(),f.createElementBlock("span",V6e," 填写"+f.toDisplayString(x==null?void 0:x.inputIndex),1)):(f.openBlock(),f.createElementBlock("span",H6e,[m.value?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("span",z6e,f.toDisplayString(`表${(N=x==null?void 0:x.min)==null?void 0:N.tableIndex}.`),1)),f.createTextVNode(" "+f.toDisplayString(((O=x==null?void 0:x.min)==null?void 0:O.id)===((B=x==null?void 0:x.max)==null?void 0:B.id)?f.unref(t4)(x==null?void 0:x.min):`${f.unref(t4)(x==null?void 0:x.min)}:${f.unref(t4)(x==null?void 0:x.max)}`),1)]))])}),128))]))}}),Gie=Di(U6e,[["__scopeId","data-v-67e3a210"]]);function j6e(o){const{nodes:s,mode:i="multiple"}=o,u=f.ref(!1),m=Coe();return{isSelecting:u,selectNodes:()=>{if(u.value)return!1;u.value=!0,m("selectNodes",{data:f.toValue(s),mode:i,callback:({data:b,type:C})=>{s.value=b,C==="blur"&&(u.value=!1)}})}}}const HA=["#ff9b40","#b36c2d","#7548ff","#5233b3","#649ee5","#aac4ed","#f9ce57","#ae74e8"],kH=f.ref(0),Jx=new Map,W6e={key:0,class:"node-select-small gap-x-2"},Z6e={key:1,class:"text-[#999]"},G6e={key:1,class:"node-select"},q6e={class:"flex py-2 px-2 justify-between items-center noder-select-header"},Y6e={class:"flex gap-2"},K6e={class:"flex gap-1"},X6e=f.defineComponent({__name:"index",props:f.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}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=f.ref((Jx==null?void 0:Jx[s==null?void 0:s.id])||0),u=f.ref((s==null?void 0:s.id)||hE()),m=f.useModel(o,"modelValue"),{selectNodes:h,isSelecting:b}=j6e({nodes:m,mode:s.mode}),C=()=>{m.value=[]},x=f.computed(()=>s.color||(HA==null?void 0:HA[f.toValue(i)%(HA==null?void 0:HA.length)])||"#409eff");return f.onMounted(()=>{Exe(Jx==null?void 0:Jx[s==null?void 0:s.id])&&(s!=null&&s.id)&&(Jx[s==null?void 0:s.id]=kH.value,i.value=kH.value,kH.value=kH.value+1)}),S6e({id:u.value,editorId:s.editorId,nodes:m,activated:b,color:x.value,isOccupy:s.isOccupy}),(_,N)=>{var O;return s.size==="small"?(f.openBlock(),f.createElementBlock("div",W6e,[f.createElementVNode("div",{style:f.normalizeStyle({"--node-color":x.value}),class:"node-color cursor-pointer"},null,4),f.createElementVNode("div",null,f.toDisplayString(s.label),1),f.createElementVNode("div",{style:f.normalizeStyle(f.unref(b)?{color:"#409eff"}:{}),onClick:N[0]||(N[0]=(...B)=>f.unref(h)&&f.unref(h)(...B))},N[6]||(N[6]=[f.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer"},null,-1)]),4),f.createElementVNode("div",{class:"flex items-center flex-wrap gap-1 cursor-pointer",onClick:N[2]||(N[2]=(...B)=>f.unref(h)&&f.unref(h)(...B))},[((O=m.value)==null?void 0:O.length)>0?(f.openBlock(),f.createBlock(Gie,{key:0,modelValue:m.value,"onUpdate:modelValue":N[1]||(N[1]=B=>m.value=B),editorId:o.editorId},null,8,["modelValue","editorId"])):(f.openBlock(),f.createElementBlock("div",Z6e,"未设置"))])])):(f.openBlock(),f.createElementBlock("div",G6e,[f.createElementVNode("div",q6e,[f.createElementVNode("div",Y6e,[f.createElementVNode("div",{style:f.normalizeStyle({"--node-color":x.value}),class:"node-color cursor-pointer"},null,4),f.createElementVNode("div",{style:f.normalizeStyle(f.unref(b)?{color:"#409eff"}:{})},[f.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer",onClick:N[3]||(N[3]=(...B)=>f.unref(h)&&f.unref(h)(...B))})],4),f.createElementVNode("div",null,[f.createElementVNode("div",{class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})])]),f.createElementVNode("div",K6e,[N[8]||(N[8]=f.createElementVNode("div",{class:"color-[#999]"},"Ctrl+左键多选",-1)),f.createElementVNode("div",null,[f.createVNode(f.unref(Mn.ElPopover),{placement:"top-start",width:200,trigger:"hover",content:"this is content, this is content, this is content"},{reference:f.withCtx(()=>N[7]||(N[7]=[f.createElementVNode("div",{class:"flex flex-center"},[f.createElementVNode("div",{class:"i-bi:info-circle-fill mr-2"}),f.createTextVNode(" 使用帮助 ")],-1)])),_:1})])])]),f.createElementVNode("div",{class:"min-h-[42px] px-2 py-1",onClick:N[5]||(N[5]=(...B)=>f.unref(h)&&f.unref(h)(...B))},[f.createVNode(Gie,{modelValue:m.value,"onUpdate:modelValue":N[4]||(N[4]=B=>m.value=B),editorId:o.editorId},null,8,["modelValue","editorId"])])]))}}}),Sfe=Di(X6e,[["__scopeId","data-v-3de2b0a2"]]);function J6e(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 Q6e(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 eRe(o){const s=kU(o.editorId),i=(b,C)=>{let x=[];const _=Math.min(b.colIndex,C.colIndex),N=Math.max(b.colIndex,C.colIndex),O=Math.min(b.rowIndex,C.rowIndex),B=Math.max(b.rowIndex,C.rowIndex);for(let H=O;H<=B;H++)for(let Z=_;Z<=N;Z++)x.push({colIndex:Z,rowIndex:H});return x},u=b=>{var N;const C=b.includes(":");let x=[];if(C){const[O,B]=b.split(":").map(H=>h(H));x=i(O,B)}else x=[h(b)];return m(x,f.toValue((N=f.toValue(s))==null?void 0:N.nodes))},m=(b,C)=>C==null?void 0:C.filter(x=>{const _=x.nodePath.split(" > ");let N=1,O=1;return _.forEach(B=>{if(B.startsWith("tr")){const H=B.match(/tr(?::nth-child\((\d+)\))?/);H&&H[1]&&(N=parseInt(H[1]))}else if(B.startsWith("td")){const H=B.match(/td(?::nth-child\((\d+)\))?/);H&&(O=H[1]?parseInt(H[1]):1)}}),b.some(B=>N===B.rowIndex+1&&O===B.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 x=C[1].toUpperCase(),_=parseInt(C[2]);let N=0;for(let O=0;O<x.length;O++)N=N*26+(x.charCodeAt(O)-64);return{colIndex:N-1,rowIndex:_}};return{getCellValue:u}}const qie=["#0288D1","#D32F2F","#F57C00","#388E3C","#303F9F","#7B1FA2","#C2185B","#880E4F","#689F38","#5D4037"];function tRe(o,s,i){const u=f.ref(null),m=f.ref(null);function h(){return o.value&&o.value.textContent||""}f.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))}),f.onUnmounted(()=>{o.value&&(u.value&&o.value.removeEventListener("input",u.value),m.value&&o.value.removeEventListener("blur",m.value))});const b=C=>{var x,_,N,O;if(C>=0){const B=window.getSelection();if(B){const H=B.getRangeAt(0),Z=((x=H.startContainer)==null?void 0:x.nodeName)==="#text"?H.startContainer:(N=(_=H.startContainer)==null?void 0:_.childNodes)==null?void 0:N[0],J=Math.min(C,((O=Z.textContent)==null?void 0:O.length)||0);H.setStart(Z,J)}}};return f.watch(()=>[s,o],()=>{var C;o.value&&(xa((C=o.value)==null?void 0:C.textContent,f.toValue(s))||(o.value.textContent=f.toValue(s),b(f.toValue(i))))},{deep:!0,immediate:!0}),{getFormulaContent:h}}function Soe(o){const{element:s,onFocus:i,onBlur:u}=o,m=f.ref(!1),h=()=>{m.value=!0,i==null||i()},b=()=>{m.value=!1,u==null||u()};return f.onMounted(()=>{var C,x;f.toValue(s)&&((C=f.toValue(s))==null||C.addEventListener("focus",h),(x=f.toValue(s))==null||x.addEventListener("blur",b))}),f.onUnmounted(()=>{var C,x;f.toValue(s)&&((C=f.toValue(s))==null||C.removeEventListener("focus",h),(x=f.toValue(s))==null||x.removeEventListener("blur",b))}),m}function nRe(o){const{element:s,showStr:i,editorId:u}=o,m=kU(u),h=Soe({element:s}),b=f.computed(()=>{var C;return(C=i==null?void 0:i.value)==null?void 0:C.filter(x=>["range","cell"].includes(x.type))});return f.watch(()=>h,()=>{var x,_,N,O,B,H;const C=Z=>{var J;Z.preventDefault(),(J=f.toValue(s))==null||J.focus()};f.toValue(h)?((x=f.toValue(m))==null||x.containerRef.addEventListener("click",C),(_=f.toValue(m))==null||_.containerRef.addEventListener("mousedown",C),(N=document.querySelectorAll(".select-function"))==null||N.forEach(Z=>{Z.addEventListener("click",C),Z.addEventListener("mousedown",C)})):((O=f.toValue(m))==null||O.containerRef.removeEventListener("click",C),(B=f.toValue(m))==null||B.containerRef.removeEventListener("mousedown",C),(H=document.querySelectorAll(".select-function"))==null||H.forEach(Z=>{Z.removeEventListener("click",C),Z.removeEventListener("mousedown",C)}))},{deep:!0}),f.watch(()=>[h,b],()=>{var C,x,_,N,O;if((C=f.toValue(m))!=null&&C.containerRef&&((N=(_=(x=f.toValue(m))==null?void 0:x.containerRef)==null?void 0:_.querySelectorAll(".node-formula-cell"))==null||N.forEach(B=>{B.classList.remove("node-formula-cell")}),f.toValue(h))){let B=[];(O=b.value)!=null&&O.length&&(b.value.forEach(H=>{var Z;B=[...B,...((Z=H==null?void 0:H.cellValue)==null?void 0:Z.map(J=>({color:H==null?void 0:H.color,backgroundColor:yoe((H==null?void 0:H.color)||"#000",.1),element:J==null?void 0:J.element})))||[]]}),B.forEach(H=>{var Z;H!=null&&H.element&&((Z=H==null?void 0:H.element)==null||Z.classList.add("node-formula-cell"),H==null||H.element.style.setProperty("--formula-node-color",H==null?void 0:H.color),H==null||H.element.style.setProperty("--formula-node-bg-color",H==null?void 0:H.backgroundColor))}))}},{deep:!0}),h}const oRe=o=>{const{element:s}=o,i=f.ref(-1),u=C=>{const x=C==null?void 0:C.getSelection();try{if(x)return x.getRangeAt(0).startOffset}catch{}return 0},m=()=>{var x;const C=(x=s.value)==null?void 0:x.getRootNode();i.value=u(C)},h=C=>{var O;const x=C.target,_=(O=s.value)==null?void 0:O.getRootNode();i.value=u(_),x.addEventListener("click",m),x.addEventListener("keyup",B=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(B.key)&&m()});const N=()=>{x.removeEventListener("click",m),x.removeEventListener("keyup",m),x.removeEventListener("blur",N),setTimeout(()=>{i.value=-1},300)};x.addEventListener("blur",N)},b=()=>{var C;(C=s.value)==null||C.addEventListener("focus",h,!0)};return f.watch(s,C=>{C&&b()},{immediate:!0}),f.onUnmounted(()=>{var C;(C=s.value)==null||C.removeEventListener("focus",h,!0)}),{startOffset:i}};function sRe(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 rRe=(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},aRe=o=>{const{startOffset:s,showStr:i,value:u,editorId:m,currentItemIndex:h,currentItem:b,element:C}=o,x=kU(m),_=f.ref(-1),N=f.ref(0),O=Soe({element:C}),B=f.ref(!1),H=Coe(),Z=J=>{var K,G;if(f.toValue(B)&&f.toValue(O)&&!xa((K=f.toValue(b))==null?void 0:K.cellValue,J)){const W=a6e(J,((G=f.toValue(x))==null?void 0:G.nodes)||"");let V=W;W&&(f.toValue(N)===0&&(V+=","),f.toValue(_)>=0&&(u.value=sRe(f.toValue(u),f.toValue(_),f.toValue(N),V),N.value=W.length))}};f.watch(()=>h,()=>{var J,K,G,W,V,ge;if((J=x.value)==null||J.setSelectedNodes([]),["range","cell"].includes((K=f.toValue(b))==null?void 0:K.type))return _.value=rRe(i.value,h.value),N.value=(W=(G=f.toValue(b))==null?void 0:G.value)==null?void 0:W.length,B.value=!0,H("selectNodes",{data:(V=f.toValue(b))==null?void 0:V.cellValue,mode:"multiple",callback:({data:Qe})=>{Z(Qe)}}),!1;if([",","(","="].includes((ge=f.toValue(b))==null?void 0:ge.value))return _.value=f.toValue(s),B.value=!0,N.value=0,H("selectNodes",{data:[],mode:"multiple",callback:({data:Qe})=>{Z(Qe)}}),!1;B.value=!1,_.value=-1},{immediate:!0,deep:!0})},iRe=o=>{const{startOffset:s,showStr:i}=o,u=f.ref(-1);f.watch(()=>s,()=>{var h;if(f.toValue(s)<=0)u.value=-1;else{let b=0;for(let C=0;C<i.value.length;C++){const x=i.value[C];if(b+=(h=x==null?void 0:x.value)==null?void 0:h.length,b>=f.toValue(s)){u.value=C;break}}}},{deep:!0,immediate:!0});const m=f.computed(()=>{var h;return(h=f.toValue(i))==null?void 0:h[f.toValue(u)]});return{currentItemIndex:u,currentItem:m}};function lRe(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 cRe=(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},uRe=o=>{const{startOffset:s,showStr:i,value:u,currentItemIndex:m,currentItem:h,element:b}=o,C=f.ref(-1),x=f.ref(0),_=Soe({element:b}),N=f.ref(!1),O=Coe(),B=H=>{var Z;if(f.toValue(N)&&f.toValue(_)&&!xa((Z=f.toValue(h))==null?void 0:Z.value,H)){const J=H,K=J;J&&f.toValue(C)>=0&&(u.value=lRe(f.toValue(u),f.toValue(C),f.toValue(x),K),x.value=J.length)}};f.watch(()=>m,()=>{var H,Z,J,K,G;if(["function"].includes((H=f.toValue(h))==null?void 0:H.type))return C.value=cRe(i.value,m.value),x.value=(J=(Z=f.toValue(h))==null?void 0:Z.value)==null?void 0:J.length,N.value=!0,O("selectFunction",{data:(K=f.toValue(h))==null?void 0:K.value,callback:({data:W})=>{console.log(W),B(W)}}),!1;if([",","(","="].includes((G=f.toValue(h))==null?void 0:G.value))return C.value=f.toValue(s),N.value=!0,x.value=0,O("selectFunction",{data:"",callback:({data:W})=>{console.log(W),B(W)}}),!1;N.value=!1,C.value=-1},{immediate:!0,deep:!0})},dRe={class:"node-formula"},fRe={class:"node-formula-show"},mRe=f.defineComponent({__name:"index",props:f.mergeModels({id:{type:String,default:""},editorId:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,{getCellValue:i}=eRe({editorId:s==null?void 0:s.editorId}),u=f.useModel(o,"modelValue"),m=f.ref(),{startOffset:h}=oRe({element:m});tRe(m,u,h);const b=f.computed(()=>{const N=J6e(u.value);return N==null?void 0:N.map(B=>B.type==="cell"||B.type==="range"?{cellValue:i(B.value),...B}:B)}),C=f.computed(()=>{const N=Q6e(u.value,b.value);let O=-1;return N.map(H=>(H==null?void 0:H.type)==="cell"||(H==null?void 0:H.type)==="range"?(O++,{...H,color:qie[O%qie.length]}):(H==null?void 0:H.type)==="function"?{...H,color:"#0318ff"}:H)});nRe({element:m,showStr:C,editorId:s==null?void 0:s.editorId});const{currentItemIndex:x,currentItem:_}=iRe({element:m,startOffset:h,value:u,showStr:C});return aRe({element:m,startOffset:h,showStr:C,editorId:s==null?void 0:s.editorId,value:u,currentItemIndex:x,currentItem:_}),uRe({element:m,startOffset:h,showStr:C,value:u,currentItemIndex:x,currentItem:_}),(N,O)=>(f.openBlock(),f.createElementBlock("div",dRe,[f.createElementVNode("div",{contenteditable:"true",ref_key:"formulaRef",ref:m,class:"node-formula-input"},null,512),f.createElementVNode("div",fRe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(C.value,(B,H)=>(f.openBlock(),f.createElementBlock("span",{key:H,class:f.normalizeClass(["node-formula-item",`node-formula-item-type-${B==null?void 0:B.type}`,H===f.unref(x)?"node-formula-item-active":""]),style:f.normalizeStyle({"--text-color":(B==null?void 0:B.color)||"#000","--bg-color":f.unref(yoe)((B==null?void 0:B.color)||"#000",.1)})},f.toDisplayString(B.value),7))),128))])]))}}),xfe=Di(mRe,[["__scopeId","data-v-f4b96eb4"]]),pRe=[{label:"平均值",value:"AVERAGE"},{label:"均值绝对偏差",value:"AVEDEV"},{label:"求和",value:"SUM"},{label:"条件判断",value:"IF"},{label:"统计数量",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"正平方根",value:"SQRT"}],gRe={class:"select-function"},hRe=["onClick"],vRe={class:"function-item"},bRe={class:"function-item-desc"},yRe=f.defineComponent({__name:"index",props:f.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=f.computed(()=>{var b;return((b=s.functionList)==null?void 0:b.length)>0?s.functionList:pRe}),m=f.useModel(o,"modelValue"),h=b=>{m.value=b,i==null||i({data:b})};return wfe("selectFunction",({data:b,callback:C})=>{i=C,m.value=b}),(b,C)=>(f.openBlock(),f.createElementBlock("div",gRe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(u.value,(x,_)=>(f.openBlock(),f.createElementBlock("div",{key:_},[f.createElementVNode("div",{onClick:()=>{h(x.value)},class:f.normalizeClass(["function-item-wrapper",{active:m.value===x.value}])},[f.createElementVNode("div",vRe,f.toDisplayString(x.value),1),f.createElementVNode("div",bRe,f.toDisplayString(x.label),1)],10,hRe)]))),128))]))}}),Efe=Di(yRe,[["__scopeId","data-v-6e079ff0"]]),wRe=["innerHTML"],_fe=f.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue");return(i,u)=>(f.openBlock(),f.createBlock(voe,null,{default:f.withCtx(()=>[f.createElementVNode("div",{innerHTML:s.value},null,8,wRe)]),_:1}))}});function TU(o){return f.getCurrentScope()?(f.onScopeDispose(o),!0):!1}function D0(o){return typeof o=="function"?o():f.unref(o)}const CRe=typeof window<"u"&&typeof document<"u",SRe=o=>typeof o<"u",xRe=Object.prototype.toString,ERe=o=>xRe.call(o)==="[object Object]",_Re=()=>{};function kRe(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 kfe=o=>o();function TRe(o=kfe){const s=f.ref(!0);function i(){s.value=!1}function u(){s.value=!0}const m=(...h)=>{s.value&&o(...h)};return{isActive:f.readonly(s),pause:i,resume:u,eventFilter:m}}function Yie(o,s=!1,i="Timeout"){return new Promise((u,m)=>{setTimeout(s?()=>m(i):u,o)})}function ARe(o,s,i={}){const{eventFilter:u=kfe,...m}=i;return f.watch(o,kRe(u,s),m)}function zA(o,s,i={}){const{eventFilter:u,...m}=i,{eventFilter:h,pause:b,resume:C,isActive:x}=TRe(u);return{stop:ARe(o,s,{...m,eventFilter:h}),pause:b,resume:C,isActive:x}}function NRe(o,s={}){if(!f.isRef(o))return f.toRefs(o);const i=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const u in o.value)i[u]=f.customRef(()=>({get(){return o.value[u]},set(m){var h;if((h=D0(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 cne(o,s=!1){function i(O,{flush:B="sync",deep:H=!1,timeout:Z,throwOnTimeout:J}={}){let K=null;const W=[new Promise(V=>{K=f.watch(o,ge=>{O(ge)!==s&&(K==null||K(),V(ge))},{flush:B,deep:H,immediate:!0})})];return Z!=null&&W.push(Yie(Z,J).then(()=>D0(o)).finally(()=>K==null?void 0:K())),Promise.race(W)}function u(O,B){if(!f.isRef(O))return i(ge=>ge===O,B);const{flush:H="sync",deep:Z=!1,timeout:J,throwOnTimeout:K}=B??{};let G=null;const V=[new Promise(ge=>{G=f.watch([o,O],([Qe,Ne])=>{s!==(Qe===Ne)&&(G==null||G(),ge(Qe))},{flush:H,deep:Z,immediate:!0})})];return J!=null&&V.push(Yie(J,K).then(()=>D0(o)).finally(()=>(G==null||G(),D0(o)))),Promise.race(V)}function m(O){return i(B=>!!B,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 x(O,B){return i(H=>{const Z=Array.from(H);return Z.includes(O)||Z.includes(D0(O))},B)}function _(O){return N(1,O)}function N(O=1,B){let H=-1;return i(()=>(H+=1,H>=O),B)}return Array.isArray(D0(o))?{toMatch:i,toContains:x,changed:_,changedTimes:N,get not(){return cne(o,!s)}}:{toMatch:i,toBe:u,toBeTruthy:m,toBeNull:h,toBeNaN:C,toBeUndefined:b,changed:_,changedTimes:N,get not(){return cne(o,!s)}}}function une(o){return cne(o)}function ORe(o){var s;const i=D0(o);return(s=i==null?void 0:i.$el)!=null?s:i}const Tfe=CRe?window:void 0;function Afe(...o){let s,i,u,m;if(typeof o[0]=="string"||Array.isArray(o[0])?([i,u,m]=o,s=Tfe):[s,i,u,m]=o,!s)return _Re;Array.isArray(i)||(i=[i]),Array.isArray(u)||(u=[u]);const h=[],b=()=>{h.forEach(N=>N()),h.length=0},C=(N,O,B,H)=>(N.addEventListener(O,B,H),()=>N.removeEventListener(O,B,H)),x=f.watch(()=>[ORe(s),D0(m)],([N,O])=>{if(b(),!N)return;const B=ERe(O)?{...O}:O;h.push(...i.flatMap(H=>u.map(Z=>C(N,H,Z,B))))},{immediate:!0,flush:"post"}),_=()=>{x(),b()};return TU(_),_}function $Re(o){return typeof o=="function"?o:typeof o=="string"?s=>s.key===o:Array.isArray(o)?s=>o.includes(s.key):()=>!0}function Kie(...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=Tfe,eventName:h="keydown",passive:b=!1,dedupe:C=!1}=u,x=$Re(s);return Afe(m,h,N=>{N.repeat&&D0(C)||x(N)&&i(N)},b)}function DRe(o){return JSON.parse(JSON.stringify(o))}function ste(o,s,i,u={}){var m,h,b;const{clone:C=!1,passive:x=!1,eventName:_,deep:N=!1,defaultValue:O,shouldEmit:B}=u,H=f.getCurrentInstance(),Z=i||(H==null?void 0:H.emit)||((m=H==null?void 0:H.$emit)==null?void 0:m.bind(H))||((b=(h=H==null?void 0:H.proxy)==null?void 0:h.$emit)==null?void 0:b.bind(H==null?void 0:H.proxy));let J=_;s||(s="modelValue"),J=J||`update:${s.toString()}`;const K=V=>C?typeof C=="function"?C(V):DRe(V):V,G=()=>SRe(o[s])?K(o[s]):O,W=V=>{B?B(V)&&Z(J,V):Z(J,V)};if(x){const V=G(),ge=f.ref(V);let Qe=!1;return f.watch(()=>o[s],Ne=>{Qe||(Qe=!0,ge.value=K(Ne),f.nextTick(()=>Qe=!1))}),f.watch(ge,Ne=>{!Qe&&(Ne!==o[s]||N)&&W(Ne)},{deep:N}),ge}else return f.computed({get(){return G()},set(V){W(V)}})}var MRe={value:()=>{}};function AU(){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 XH(i)}function XH(o){this._=o}function RRe(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}})}XH.prototype=AU.prototype={constructor:XH,on:function(o,s){var i=this._,u=RRe(o+"",i),m,h=-1,b=u.length;if(arguments.length<2){for(;++h<b;)if((m=(o=u[h]).type)&&(m=BRe(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]=Xie(i[m],o.name,s);else if(s==null)for(m in i)i[m]=Xie(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 XH(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 BRe(o,s){for(var i=0,u=o.length,m;i<u;++i)if((m=o[i]).name===s)return m.value}function Xie(o,s,i){for(var u=0,m=o.length;u<m;++u)if(o[u].name===s){o[u]=MRe,o=o.slice(0,u).concat(o.slice(u+1));break}return i!=null&&o.push({name:s,value:i}),o}var dne="http://www.w3.org/1999/xhtml";const Jie={svg:"http://www.w3.org/2000/svg",xhtml:dne,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function NU(o){var s=o+="",i=s.indexOf(":");return i>=0&&(s=o.slice(0,i))!=="xmlns"&&(o=o.slice(i+1)),Jie.hasOwnProperty(s)?{space:Jie[s],local:o}:o}function IRe(o){return function(){var s=this.ownerDocument,i=this.namespaceURI;return i===dne&&s.documentElement.namespaceURI===dne?s.createElement(o):s.createElementNS(i,o)}}function PRe(o){return function(){return this.ownerDocument.createElementNS(o.space,o.local)}}function Nfe(o){var s=NU(o);return(s.local?PRe:IRe)(s)}function FRe(){}function xoe(o){return o==null?FRe:function(){return this.querySelector(o)}}function LRe(o){typeof o!="function"&&(o=xoe(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),x,_,N=0;N<b;++N)(x=h[N])&&(_=o.call(x,x.__data__,N,h))&&("__data__"in x&&(_.__data__=x.__data__),C[N]=_);return new Cp(u,this._parents)}function VRe(o){return o==null?[]:Array.isArray(o)?o:Array.from(o)}function HRe(){return[]}function Ofe(o){return o==null?HRe:function(){return this.querySelectorAll(o)}}function zRe(o){return function(){return VRe(o.apply(this,arguments))}}function URe(o){typeof o=="function"?o=zRe(o):o=Ofe(o);for(var s=this._groups,i=s.length,u=[],m=[],h=0;h<i;++h)for(var b=s[h],C=b.length,x,_=0;_<C;++_)(x=b[_])&&(u.push(o.call(x,x.__data__,_,b)),m.push(x));return new Cp(u,m)}function $fe(o){return function(){return this.matches(o)}}function Dfe(o){return function(s){return s.matches(o)}}var jRe=Array.prototype.find;function WRe(o){return function(){return jRe.call(this.children,o)}}function ZRe(){return this.firstElementChild}function GRe(o){return this.select(o==null?ZRe:WRe(typeof o=="function"?o:Dfe(o)))}var qRe=Array.prototype.filter;function YRe(){return Array.from(this.children)}function KRe(o){return function(){return qRe.call(this.children,o)}}function XRe(o){return this.selectAll(o==null?YRe:KRe(typeof o=="function"?o:Dfe(o)))}function JRe(o){typeof o!="function"&&(o=$fe(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]=[],x,_=0;_<b;++_)(x=h[_])&&o.call(x,x.__data__,_,h)&&C.push(x);return new Cp(u,this._parents)}function Mfe(o){return new Array(o.length)}function QRe(){return new Cp(this._enter||this._groups.map(Mfe),this._parents)}function kz(o,s){this.ownerDocument=o.ownerDocument,this.namespaceURI=o.namespaceURI,this._next=null,this._parent=o,this.__data__=s}kz.prototype={constructor:kz,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 eBe(o){return function(){return o}}function tBe(o,s,i,u,m,h){for(var b=0,C,x=s.length,_=h.length;b<_;++b)(C=s[b])?(C.__data__=h[b],u[b]=C):i[b]=new kz(o,h[b]);for(;b<x;++b)(C=s[b])&&(m[b]=C)}function nBe(o,s,i,u,m,h,b){var C,x,_=new Map,N=s.length,O=h.length,B=new Array(N),H;for(C=0;C<N;++C)(x=s[C])&&(B[C]=H=b.call(x,x.__data__,C,s)+"",_.has(H)?m[C]=x:_.set(H,x));for(C=0;C<O;++C)H=b.call(o,h[C],C,h)+"",(x=_.get(H))?(u[C]=x,x.__data__=h[C],_.delete(H)):i[C]=new kz(o,h[C]);for(C=0;C<N;++C)(x=s[C])&&_.get(B[C])===x&&(m[C]=x)}function oBe(o){return o.__data__}function sBe(o,s){if(!arguments.length)return Array.from(this,oBe);var i=s?nBe:tBe,u=this._parents,m=this._groups;typeof o!="function"&&(o=eBe(o));for(var h=m.length,b=new Array(h),C=new Array(h),x=new Array(h),_=0;_<h;++_){var N=u[_],O=m[_],B=O.length,H=rBe(o.call(N,N&&N.__data__,_,u)),Z=H.length,J=C[_]=new Array(Z),K=b[_]=new Array(Z),G=x[_]=new Array(B);i(N,O,J,K,G,H,s);for(var W=0,V=0,ge,Qe;W<Z;++W)if(ge=J[W]){for(W>=V&&(V=W+1);!(Qe=K[V])&&++V<Z;);ge._next=Qe||null}}return b=new Cp(b,u),b._enter=C,b._exit=x,b}function rBe(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function aBe(){return new Cp(this._exit||this._groups.map(Mfe),this._parents)}function iBe(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 lBe(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),x=0;x<b;++x)for(var _=i[x],N=u[x],O=_.length,B=C[x]=new Array(O),H,Z=0;Z<O;++Z)(H=_[Z]||N[Z])&&(B[Z]=H);for(;x<m;++x)C[x]=i[x];return new Cp(C,this._parents)}function cBe(){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 uBe(o){o||(o=dBe);function s(O,B){return O&&B?o(O.__data__,B.__data__):!O-!B}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,x=m[h]=new Array(C),_,N=0;N<C;++N)(_=b[N])&&(x[N]=_);x.sort(s)}return new Cp(m,this._parents).order()}function dBe(o,s){return o<s?-1:o>s?1:o>=s?0:NaN}function fBe(){var o=arguments[0];return arguments[0]=this,o.apply(null,arguments),this}function mBe(){return Array.from(this)}function pBe(){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 gBe(){let o=0;for(const s of this)++o;return o}function hBe(){return!this.node()}function vBe(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 bBe(o){return function(){this.removeAttribute(o)}}function yBe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function wBe(o,s){return function(){this.setAttribute(o,s)}}function CBe(o,s){return function(){this.setAttributeNS(o.space,o.local,s)}}function SBe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttribute(o):this.setAttribute(o,i)}}function xBe(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 EBe(o,s){var i=NU(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?yBe:bBe:typeof s=="function"?i.local?xBe:SBe:i.local?CBe:wBe)(i,s))}function Rfe(o){return o.ownerDocument&&o.ownerDocument.defaultView||o.document&&o||o.defaultView}function _Be(o){return function(){this.style.removeProperty(o)}}function kBe(o,s,i){return function(){this.style.setProperty(o,s,i)}}function TBe(o,s,i){return function(){var u=s.apply(this,arguments);u==null?this.style.removeProperty(o):this.style.setProperty(o,u,i)}}function ABe(o,s,i){return arguments.length>1?this.each((s==null?_Be:typeof s=="function"?TBe:kBe)(o,s,i??"")):f4(this.node(),o)}function f4(o,s){return o.style.getPropertyValue(s)||Rfe(o).getComputedStyle(o,null).getPropertyValue(s)}function NBe(o){return function(){delete this[o]}}function OBe(o,s){return function(){this[o]=s}}function $Be(o,s){return function(){var i=s.apply(this,arguments);i==null?delete this[o]:this[o]=i}}function DBe(o,s){return arguments.length>1?this.each((s==null?NBe:typeof s=="function"?$Be:OBe)(o,s)):this.node()[o]}function Bfe(o){return o.trim().split(/^|\s+/)}function Eoe(o){return o.classList||new Ife(o)}function Ife(o){this._node=o,this._names=Bfe(o.getAttribute("class")||"")}Ife.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 Pfe(o,s){for(var i=Eoe(o),u=-1,m=s.length;++u<m;)i.add(s[u])}function Ffe(o,s){for(var i=Eoe(o),u=-1,m=s.length;++u<m;)i.remove(s[u])}function MBe(o){return function(){Pfe(this,o)}}function RBe(o){return function(){Ffe(this,o)}}function BBe(o,s){return function(){(s.apply(this,arguments)?Pfe:Ffe)(this,o)}}function IBe(o,s){var i=Bfe(o+"");if(arguments.length<2){for(var u=Eoe(this.node()),m=-1,h=i.length;++m<h;)if(!u.contains(i[m]))return!1;return!0}return this.each((typeof s=="function"?BBe:s?MBe:RBe)(i,s))}function PBe(){this.textContent=""}function FBe(o){return function(){this.textContent=o}}function LBe(o){return function(){var s=o.apply(this,arguments);this.textContent=s??""}}function VBe(o){return arguments.length?this.each(o==null?PBe:(typeof o=="function"?LBe:FBe)(o)):this.node().textContent}function HBe(){this.innerHTML=""}function zBe(o){return function(){this.innerHTML=o}}function UBe(o){return function(){var s=o.apply(this,arguments);this.innerHTML=s??""}}function jBe(o){return arguments.length?this.each(o==null?HBe:(typeof o=="function"?UBe:zBe)(o)):this.node().innerHTML}function WBe(){this.nextSibling&&this.parentNode.appendChild(this)}function ZBe(){return this.each(WBe)}function GBe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function qBe(){return this.each(GBe)}function YBe(o){var s=typeof o=="function"?o:Nfe(o);return this.select(function(){return this.appendChild(s.apply(this,arguments))})}function KBe(){return null}function XBe(o,s){var i=typeof o=="function"?o:Nfe(o),u=s==null?KBe:typeof s=="function"?s:xoe(s);return this.select(function(){return this.insertBefore(i.apply(this,arguments),u.apply(this,arguments)||null)})}function JBe(){var o=this.parentNode;o&&o.removeChild(this)}function QBe(){return this.each(JBe)}function eIe(){var o=this.cloneNode(!1),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function tIe(){var o=this.cloneNode(!0),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function nIe(o){return this.select(o?tIe:eIe)}function oIe(o){return arguments.length?this.property("__data__",o):this.node().__data__}function sIe(o){return function(s){o.call(this,s,this.__data__)}}function rIe(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 aIe(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 iIe(o,s,i){return function(){var u=this.__on,m,h=sIe(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 lIe(o,s,i){var u=rIe(o+""),m,h=u.length,b;if(arguments.length<2){var C=this.node().__on;if(C){for(var x=0,_=C.length,N;x<_;++x)for(m=0,N=C[x];m<h;++m)if((b=u[m]).type===N.type&&b.name===N.name)return N.value}return}for(C=s?iIe:aIe,m=0;m<h;++m)this.each(C(u[m],s,i));return this}function Lfe(o,s,i){var u=Rfe(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 cIe(o,s){return function(){return Lfe(this,o,s)}}function uIe(o,s){return function(){return Lfe(this,o,s.apply(this,arguments))}}function dIe(o,s){return this.each((typeof s=="function"?uIe:cIe)(o,s))}function*fIe(){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 Vfe=[null];function Cp(o,s){this._groups=o,this._parents=s}function AR(){return new Cp([[document.documentElement]],Vfe)}function mIe(){return this}Cp.prototype=AR.prototype={constructor:Cp,select:LRe,selectAll:URe,selectChild:GRe,selectChildren:XRe,filter:JRe,data:sBe,enter:QRe,exit:aBe,join:iBe,merge:lBe,selection:mIe,order:cBe,sort:uBe,call:fBe,nodes:mBe,node:pBe,size:gBe,empty:hBe,each:vBe,attr:EBe,style:ABe,property:DBe,classed:IBe,text:VBe,html:jBe,raise:ZBe,lower:qBe,append:YBe,insert:XBe,remove:QBe,clone:nIe,datum:oIe,on:lIe,dispatch:dIe,[Symbol.iterator]:fIe};function Dh(o){return typeof o=="string"?new Cp([[document.querySelector(o)]],[document.documentElement]):new Cp([[o]],Vfe)}function pIe(o){let s;for(;s=o.sourceEvent;)o=s;return o}function Av(o,s){if(o=pIe(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 gIe={passive:!1},oR={capture:!0,passive:!1};function rte(o){o.stopImmediatePropagation()}function n4(o){o.preventDefault(),o.stopImmediatePropagation()}function Hfe(o){var s=o.document.documentElement,i=Dh(o).on("dragstart.drag",n4,oR);"onselectstart"in s?i.on("selectstart.drag",n4,oR):(s.__noselect=s.style.MozUserSelect,s.style.MozUserSelect="none")}function zfe(o,s){var i=o.document.documentElement,u=Dh(o).on("dragstart.drag",null);s&&(u.on("click.drag",n4,oR),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 TH=o=>()=>o;function fne(o,{sourceEvent:s,subject:i,target:u,identifier:m,active:h,x:b,y:C,dx:x,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:x,enumerable:!0,configurable:!0},dy:{value:_,enumerable:!0,configurable:!0},_:{value:N}})}fne.prototype.on=function(){var o=this._.on.apply(this._,arguments);return o===this._?this:o};function hIe(o){return!o.ctrlKey&&!o.button}function vIe(){return this.parentNode}function bIe(o,s){return s??{x:o.x,y:o.y}}function yIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function wIe(){var o=hIe,s=vIe,i=bIe,u=yIe,m={},h=AU("start","drag","end"),b=0,C,x,_,N,O=0;function B(ge){ge.on("mousedown.drag",H).filter(u).on("touchstart.drag",K).on("touchmove.drag",G,gIe).on("touchend.drag touchcancel.drag",W).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function H(ge,Qe){if(!(N||!o.call(this,ge,Qe))){var Ne=V(this,s.call(this,ge,Qe),ge,Qe,"mouse");Ne&&(Dh(ge.view).on("mousemove.drag",Z,oR).on("mouseup.drag",J,oR),Hfe(ge.view),rte(ge),_=!1,C=ge.clientX,x=ge.clientY,Ne("start",ge))}}function Z(ge){if(n4(ge),!_){var Qe=ge.clientX-C,Ne=ge.clientY-x;_=Qe*Qe+Ne*Ne>O}m.mouse("drag",ge)}function J(ge){Dh(ge.view).on("mousemove.drag mouseup.drag",null),zfe(ge.view,_),n4(ge),m.mouse("end",ge)}function K(ge,Qe){if(o.call(this,ge,Qe)){var Ne=ge.changedTouches,te=s.call(this,ge,Qe),Ue=Ne.length,ut,lt;for(ut=0;ut<Ue;++ut)(lt=V(this,te,ge,Qe,Ne[ut].identifier,Ne[ut]))&&(rte(ge),lt("start",ge,Ne[ut]))}}function G(ge){var Qe=ge.changedTouches,Ne=Qe.length,te,Ue;for(te=0;te<Ne;++te)(Ue=m[Qe[te].identifier])&&(n4(ge),Ue("drag",ge,Qe[te]))}function W(ge){var Qe=ge.changedTouches,Ne=Qe.length,te,Ue;for(N&&clearTimeout(N),N=setTimeout(function(){N=null},500),te=0;te<Ne;++te)(Ue=m[Qe[te].identifier])&&(rte(ge),Ue("end",ge,Qe[te]))}function V(ge,Qe,Ne,te,Ue,ut){var lt=h.copy(),Oe=Av(ut||Ne,Qe),ue,Pt,ye;if((ye=i.call(ge,new fne("beforestart",{sourceEvent:Ne,target:B,identifier:Ue,active:b,x:Oe[0],y:Oe[1],dx:0,dy:0,dispatch:lt}),te))!=null)return ue=ye.x-Oe[0]||0,Pt=ye.y-Oe[1]||0,function De(R,je,be){var ot=Oe,nt;switch(R){case"start":m[Ue]=De,nt=b++;break;case"end":delete m[Ue],--b;case"drag":Oe=Av(be||je,Qe),nt=b;break}lt.call(R,ge,new fne(R,{sourceEvent:je,subject:ye,target:B,identifier:Ue,active:nt,x:Oe[0]+ue,y:Oe[1]+Pt,dx:Oe[0]-ot[0],dy:Oe[1]-ot[1],dispatch:lt}),te)}}return B.filter=function(ge){return arguments.length?(o=typeof ge=="function"?ge:TH(!!ge),B):o},B.container=function(ge){return arguments.length?(s=typeof ge=="function"?ge:TH(ge),B):s},B.subject=function(ge){return arguments.length?(i=typeof ge=="function"?ge:TH(ge),B):i},B.touchable=function(ge){return arguments.length?(u=typeof ge=="function"?ge:TH(!!ge),B):u},B.on=function(){var ge=h.on.apply(h,arguments);return ge===h?B:ge},B.clickDistance=function(ge){return arguments.length?(O=(ge=+ge)*ge,B):Math.sqrt(O)},B}function _oe(o,s,i){o.prototype=s.prototype=i,i.constructor=o}function Ufe(o,s){var i=Object.create(o.prototype);for(var u in s)i[u]=s[u];return i}function NR(){}var sR=.7,Tz=1/sR,o4="\\s*([+-]?\\d+)\\s*",rR="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$v="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",CIe=/^#([0-9a-f]{3,8})$/,SIe=new RegExp(`^rgb\\(${o4},${o4},${o4}\\)$`),xIe=new RegExp(`^rgb\\(${$v},${$v},${$v}\\)$`),EIe=new RegExp(`^rgba\\(${o4},${o4},${o4},${rR}\\)$`),_Ie=new RegExp(`^rgba\\(${$v},${$v},${$v},${rR}\\)$`),kIe=new RegExp(`^hsl\\(${rR},${$v},${$v}\\)$`),TIe=new RegExp(`^hsla\\(${rR},${$v},${$v},${rR}\\)$`),Qie={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};_oe(NR,aR,{copy(o){return Object.assign(new this.constructor,this,o)},displayable(){return this.rgb().displayable()},hex:ele,formatHex:ele,formatHex8:AIe,formatHsl:NIe,formatRgb:tle,toString:tle});function ele(){return this.rgb().formatHex()}function AIe(){return this.rgb().formatHex8()}function NIe(){return jfe(this).formatHsl()}function tle(){return this.rgb().formatRgb()}function aR(o){var s,i;return o=(o+"").trim().toLowerCase(),(s=CIe.exec(o))?(i=s[1].length,s=parseInt(s[1],16),i===6?nle(s):i===3?new Sm(s>>8&15|s>>4&240,s>>4&15|s&240,(s&15)<<4|s&15,1):i===8?AH(s>>24&255,s>>16&255,s>>8&255,(s&255)/255):i===4?AH(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=SIe.exec(o))?new Sm(s[1],s[2],s[3],1):(s=xIe.exec(o))?new Sm(s[1]*255/100,s[2]*255/100,s[3]*255/100,1):(s=EIe.exec(o))?AH(s[1],s[2],s[3],s[4]):(s=_Ie.exec(o))?AH(s[1]*255/100,s[2]*255/100,s[3]*255/100,s[4]):(s=kIe.exec(o))?rle(s[1],s[2]/100,s[3]/100,1):(s=TIe.exec(o))?rle(s[1],s[2]/100,s[3]/100,s[4]):Qie.hasOwnProperty(o)?nle(Qie[o]):o==="transparent"?new Sm(NaN,NaN,NaN,0):null}function nle(o){return new Sm(o>>16&255,o>>8&255,o&255,1)}function AH(o,s,i,u){return u<=0&&(o=s=i=NaN),new Sm(o,s,i,u)}function OIe(o){return o instanceof NR||(o=aR(o)),o?(o=o.rgb(),new Sm(o.r,o.g,o.b,o.opacity)):new Sm}function mne(o,s,i,u){return arguments.length===1?OIe(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}_oe(Sm,mne,Ufe(NR,{brighter(o){return o=o==null?Tz:Math.pow(Tz,o),new Sm(this.r*o,this.g*o,this.b*o,this.opacity)},darker(o){return o=o==null?sR:Math.pow(sR,o),new Sm(this.r*o,this.g*o,this.b*o,this.opacity)},rgb(){return this},clamp(){return new Sm(yE(this.r),yE(this.g),yE(this.b),Az(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:ole,formatHex:ole,formatHex8:$Ie,formatRgb:sle,toString:sle}));function ole(){return`#${uE(this.r)}${uE(this.g)}${uE(this.b)}`}function $Ie(){return`#${uE(this.r)}${uE(this.g)}${uE(this.b)}${uE((isNaN(this.opacity)?1:this.opacity)*255)}`}function sle(){const o=Az(this.opacity);return`${o===1?"rgb(":"rgba("}${yE(this.r)}, ${yE(this.g)}, ${yE(this.b)}${o===1?")":`, ${o})`}`}function Az(o){return isNaN(o)?1:Math.max(0,Math.min(1,o))}function yE(o){return Math.max(0,Math.min(255,Math.round(o)||0))}function uE(o){return o=yE(o),(o<16?"0":"")+o.toString(16)}function rle(o,s,i,u){return u<=0?o=s=i=NaN:i<=0||i>=1?o=s=NaN:s<=0&&(o=NaN),new Mh(o,s,i,u)}function jfe(o){if(o instanceof Mh)return new Mh(o.h,o.s,o.l,o.opacity);if(o instanceof NR||(o=aR(o)),!o)return new Mh;if(o instanceof Mh)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,x=(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/=x<.5?h+m:2-h-m,b*=60):C=x>0&&x<1?0:b,new Mh(b,C,x,o.opacity)}function DIe(o,s,i,u){return arguments.length===1?jfe(o):new Mh(o,s,i,u??1)}function Mh(o,s,i,u){this.h=+o,this.s=+s,this.l=+i,this.opacity=+u}_oe(Mh,DIe,Ufe(NR,{brighter(o){return o=o==null?Tz:Math.pow(Tz,o),new Mh(this.h,this.s,this.l*o,this.opacity)},darker(o){return o=o==null?sR:Math.pow(sR,o),new Mh(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(ate(o>=240?o-240:o+120,m,u),ate(o,m,u),ate(o<120?o+240:o-120,m,u),this.opacity)},clamp(){return new Mh(ale(this.h),NH(this.s),NH(this.l),Az(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=Az(this.opacity);return`${o===1?"hsl(":"hsla("}${ale(this.h)}, ${NH(this.s)*100}%, ${NH(this.l)*100}%${o===1?")":`, ${o})`}`}}));function ale(o){return o=(o||0)%360,o<0?o+360:o}function NH(o){return Math.max(0,Math.min(1,o||0))}function ate(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 Wfe=o=>()=>o;function MIe(o,s){return function(i){return o+i*s}}function RIe(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 BIe(o){return(o=+o)==1?Zfe:function(s,i){return i-s?RIe(s,i,o):Wfe(isNaN(s)?i:s)}}function Zfe(o,s){var i=s-o;return i?MIe(o,i):Wfe(isNaN(o)?s:o)}const ile=function o(s){var i=BIe(s);function u(m,h){var b=i((m=mne(m)).r,(h=mne(h)).r),C=i(m.g,h.g),x=i(m.b,h.b),_=Zfe(m.opacity,h.opacity);return function(N){return m.r=b(N),m.g=C(N),m.b=x(N),m.opacity=_(N),m+""}}return u.gamma=o,u}(1);function s2(o,s){return o=+o,s=+s,function(i){return o*(1-i)+s*i}}var pne=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ite=new RegExp(pne.source,"g");function IIe(o){return function(){return o}}function PIe(o){return function(s){return o(s)+""}}function FIe(o,s){var i=pne.lastIndex=ite.lastIndex=0,u,m,h,b=-1,C=[],x=[];for(o=o+"",s=s+"";(u=pne.exec(o))&&(m=ite.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,x.push({i:b,x:s2(u,m)})),i=ite.lastIndex;return i<s.length&&(h=s.slice(i),C[b]?C[b]+=h:C[++b]=h),C.length<2?x[0]?PIe(x[0].x):IIe(s):(s=x.length,function(_){for(var N=0,O;N<s;++N)C[(O=x[N]).i]=O.x(_);return C.join("")})}var lle=180/Math.PI,gne={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Gfe(o,s,i,u,m,h){var b,C,x;return(b=Math.sqrt(o*o+s*s))&&(o/=b,s/=b),(x=o*i+s*u)&&(i-=o*x,u-=s*x),(C=Math.sqrt(i*i+u*u))&&(i/=C,u/=C,x/=C),o*u<s*i&&(o=-o,s=-s,x=-x,b=-b),{translateX:m,translateY:h,rotate:Math.atan2(s,o)*lle,skewX:Math.atan(x)*lle,scaleX:b,scaleY:C}}var OH;function LIe(o){const s=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(o+"");return s.isIdentity?gne:Gfe(s.a,s.b,s.c,s.d,s.e,s.f)}function VIe(o){return o==null||(OH||(OH=document.createElementNS("http://www.w3.org/2000/svg","g")),OH.setAttribute("transform",o),!(o=OH.transform.baseVal.consolidate()))?gne:(o=o.matrix,Gfe(o.a,o.b,o.c,o.d,o.e,o.f))}function qfe(o,s,i,u){function m(_){return _.length?_.pop()+" ":""}function h(_,N,O,B,H,Z){if(_!==O||N!==B){var J=H.push("translate(",null,s,null,i);Z.push({i:J-4,x:s2(_,O)},{i:J-2,x:s2(N,B)})}else(O||B)&&H.push("translate("+O+s+B+i)}function b(_,N,O,B){_!==N?(_-N>180?N+=360:N-_>180&&(_+=360),B.push({i:O.push(m(O)+"rotate(",null,u)-2,x:s2(_,N)})):N&&O.push(m(O)+"rotate("+N+u)}function C(_,N,O,B){_!==N?B.push({i:O.push(m(O)+"skewX(",null,u)-2,x:s2(_,N)}):N&&O.push(m(O)+"skewX("+N+u)}function x(_,N,O,B,H,Z){if(_!==O||N!==B){var J=H.push(m(H)+"scale(",null,",",null,")");Z.push({i:J-4,x:s2(_,O)},{i:J-2,x:s2(N,B)})}else(O!==1||B!==1)&&H.push(m(H)+"scale("+O+","+B+")")}return function(_,N){var O=[],B=[];return _=o(_),N=o(N),h(_.translateX,_.translateY,N.translateX,N.translateY,O,B),b(_.rotate,N.rotate,O,B),C(_.skewX,N.skewX,O,B),x(_.scaleX,_.scaleY,N.scaleX,N.scaleY,O,B),_=N=null,function(H){for(var Z=-1,J=B.length,K;++Z<J;)O[(K=B[Z]).i]=K.x(H);return O.join("")}}}var HIe=qfe(LIe,"px, ","px)","deg)"),zIe=qfe(VIe,", ",")",")"),UIe=1e-12;function cle(o){return((o=Math.exp(o))+1/o)/2}function jIe(o){return((o=Math.exp(o))-1/o)/2}function WIe(o){return((o=Math.exp(2*o))-1)/(o+1)}const ZIe=function o(s,i,u){function m(h,b){var C=h[0],x=h[1],_=h[2],N=b[0],O=b[1],B=b[2],H=N-C,Z=O-x,J=H*H+Z*Z,K,G;if(J<UIe)G=Math.log(B/_)/s,K=function(te){return[C+te*H,x+te*Z,_*Math.exp(s*te*G)]};else{var W=Math.sqrt(J),V=(B*B-_*_+u*J)/(2*_*i*W),ge=(B*B-_*_-u*J)/(2*B*i*W),Qe=Math.log(Math.sqrt(V*V+1)-V),Ne=Math.log(Math.sqrt(ge*ge+1)-ge);G=(Ne-Qe)/s,K=function(te){var Ue=te*G,ut=cle(Qe),lt=_/(i*W)*(ut*WIe(s*Ue+Qe)-jIe(Qe));return[C+lt*H,x+lt*Z,_*ut/cle(s*Ue+Qe)]}}return K.duration=G*1e3*s/Math.SQRT2,K}return m.rho=function(h){var b=Math.max(.001,+h),C=b*b,x=C*C;return o(b,C,x)},m}(Math.SQRT2,2,4);var m4=0,M6=0,O6=0,Yfe=1e3,Nz,R6,Oz=0,_E=0,OU=0,iR=typeof performance=="object"&&performance.now?performance:Date,Kfe=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(o){setTimeout(o,17)};function koe(){return _E||(Kfe(GIe),_E=iR.now()+OU)}function GIe(){_E=0}function $z(){this._call=this._time=this._next=null}$z.prototype=Xfe.prototype={constructor:$z,restart:function(o,s,i){if(typeof o!="function")throw new TypeError("callback is not a function");i=(i==null?koe():+i)+(s==null?0:+s),!this._next&&R6!==this&&(R6?R6._next=this:Nz=this,R6=this),this._call=o,this._time=i,hne()},stop:function(){this._call&&(this._call=null,this._time=1/0,hne())}};function Xfe(o,s,i){var u=new $z;return u.restart(o,s,i),u}function qIe(){koe(),++m4;for(var o=Nz,s;o;)(s=_E-o._time)>=0&&o._call.call(void 0,s),o=o._next;--m4}function ule(){_E=(Oz=iR.now())+OU,m4=M6=0;try{qIe()}finally{m4=0,KIe(),_E=0}}function YIe(){var o=iR.now(),s=o-Oz;s>Yfe&&(OU-=s,Oz=o)}function KIe(){for(var o,s=Nz,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:Nz=i);R6=o,hne(u)}function hne(o){if(!m4){M6&&(M6=clearTimeout(M6));var s=o-_E;s>24?(o<1/0&&(M6=setTimeout(ule,o-iR.now()-OU)),O6&&(O6=clearInterval(O6))):(O6||(Oz=iR.now(),O6=setInterval(YIe,Yfe)),m4=1,Kfe(ule))}}function dle(o,s,i){var u=new $z;return s=s==null?0:+s,u.restart(m=>{u.stop(),o(m+s)},s,i),u}var XIe=AU("start","end","cancel","interrupt"),JIe=[],Jfe=0,fle=1,vne=2,JH=3,mle=4,bne=5,QH=6;function $U(o,s,i,u,m,h){var b=o.__transition;if(!b)o.__transition={};else if(i in b)return;QIe(o,i,{name:s,index:u,group:m,on:XIe,tween:JIe,time:h.time,delay:h.delay,duration:h.duration,ease:h.ease,timer:null,state:Jfe})}function Toe(o,s){var i=Ih(o,s);if(i.state>Jfe)throw new Error("too late; already scheduled");return i}function Pv(o,s){var i=Ih(o,s);if(i.state>JH)throw new Error("too late; already running");return i}function Ih(o,s){var i=o.__transition;if(!i||!(i=i[s]))throw new Error("transition not found");return i}function QIe(o,s,i){var u=o.__transition,m;u[s]=i,i.timer=Xfe(h,0,i.time);function h(_){i.state=fle,i.timer.restart(b,i.delay,i.time),i.delay<=_&&b(_-i.delay)}function b(_){var N,O,B,H;if(i.state!==fle)return x();for(N in u)if(H=u[N],H.name===i.name){if(H.state===JH)return dle(b);H.state===mle?(H.state=QH,H.timer.stop(),H.on.call("interrupt",o,o.__data__,H.index,H.group),delete u[N]):+N<s&&(H.state=QH,H.timer.stop(),H.on.call("cancel",o,o.__data__,H.index,H.group),delete u[N])}if(dle(function(){i.state===JH&&(i.state=mle,i.timer.restart(C,i.delay,i.time),C(_))}),i.state=vne,i.on.call("start",o,o.__data__,i.index,i.group),i.state===vne){for(i.state=JH,m=new Array(B=i.tween.length),N=0,O=-1;N<B;++N)(H=i.tween[N].value.call(o,o.__data__,i.index,i.group))&&(m[++O]=H);m.length=O+1}}function C(_){for(var N=_<i.duration?i.ease.call(null,_/i.duration):(i.timer.restart(x),i.state=bne,1),O=-1,B=m.length;++O<B;)m[O].call(o,N);i.state===bne&&(i.on.call("end",o,o.__data__,i.index,i.group),x())}function x(){i.state=QH,i.timer.stop(),delete u[s];for(var _ in u)return;delete o.__transition}}function ez(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>vne&&u.state<bne,u.state=QH,u.timer.stop(),u.on.call(m?"interrupt":"cancel",o,o.__data__,u.index,u.group),delete i[b]}h&&delete o.__transition}}function ePe(o){return this.each(function(){ez(this,o)})}function tPe(o,s){var i,u;return function(){var m=Pv(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 nPe(o,s,i){var u,m;if(typeof i!="function")throw new Error;return function(){var h=Pv(this,o),b=h.tween;if(b!==u){m=(u=b).slice();for(var C={name:s,value:i},x=0,_=m.length;x<_;++x)if(m[x].name===s){m[x]=C;break}x===_&&m.push(C)}h.tween=m}}function oPe(o,s){var i=this._id;if(o+="",arguments.length<2){for(var u=Ih(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?tPe:nPe)(i,o,s))}function Aoe(o,s,i){var u=o._id;return o.each(function(){var m=Pv(this,u);(m.value||(m.value={}))[s]=i.apply(this,arguments)}),function(m){return Ih(m,u).value[s]}}function Qfe(o,s){var i;return(typeof s=="number"?s2:s instanceof aR?ile:(i=aR(s))?(s=i,ile):FIe)(o,s)}function sPe(o){return function(){this.removeAttribute(o)}}function rPe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function aPe(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 iPe(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 lPe(o,s,i){var u,m,h;return function(){var b,C=i(this),x;return C==null?void this.removeAttribute(o):(b=this.getAttribute(o),x=C+"",b===x?null:b===u&&x===m?h:(m=x,h=s(u=b,C)))}}function cPe(o,s,i){var u,m,h;return function(){var b,C=i(this),x;return C==null?void this.removeAttributeNS(o.space,o.local):(b=this.getAttributeNS(o.space,o.local),x=C+"",b===x?null:b===u&&x===m?h:(m=x,h=s(u=b,C)))}}function uPe(o,s){var i=NU(o),u=i==="transform"?zIe:Qfe;return this.attrTween(o,typeof s=="function"?(i.local?cPe:lPe)(i,u,Aoe(this,"attr."+o,s)):s==null?(i.local?rPe:sPe)(i):(i.local?iPe:aPe)(i,u,s))}function dPe(o,s){return function(i){this.setAttribute(o,s.call(this,i))}}function fPe(o,s){return function(i){this.setAttributeNS(o.space,o.local,s.call(this,i))}}function mPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&fPe(o,h)),i}return m._value=s,m}function pPe(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 gPe(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=NU(o);return this.tween(i,(u.local?mPe:pPe)(u,s))}function hPe(o,s){return function(){Toe(this,o).delay=+s.apply(this,arguments)}}function vPe(o,s){return s=+s,function(){Toe(this,o).delay=s}}function bPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?hPe:vPe)(s,o)):Ih(this.node(),s).delay}function yPe(o,s){return function(){Pv(this,o).duration=+s.apply(this,arguments)}}function wPe(o,s){return s=+s,function(){Pv(this,o).duration=s}}function CPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?yPe:wPe)(s,o)):Ih(this.node(),s).duration}function SPe(o,s){if(typeof s!="function")throw new Error;return function(){Pv(this,o).ease=s}}function xPe(o){var s=this._id;return arguments.length?this.each(SPe(s,o)):Ih(this.node(),s).ease}function EPe(o,s){return function(){var i=s.apply(this,arguments);if(typeof i!="function")throw new Error;Pv(this,o).ease=i}}function _Pe(o){if(typeof o!="function")throw new Error;return this.each(EPe(this._id,o))}function kPe(o){typeof o!="function"&&(o=$fe(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]=[],x,_=0;_<b;++_)(x=h[_])&&o.call(x,x.__data__,_,h)&&C.push(x);return new F0(u,this._parents,this._name,this._id)}function TPe(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 x=s[C],_=i[C],N=x.length,O=b[C]=new Array(N),B,H=0;H<N;++H)(B=x[H]||_[H])&&(O[H]=B);for(;C<u;++C)b[C]=s[C];return new F0(b,this._parents,this._name,this._id)}function APe(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 NPe(o,s,i){var u,m,h=APe(s)?Toe:Pv;return function(){var b=h(this,o),C=b.on;C!==u&&(m=(u=C).copy()).on(s,i),b.on=m}}function OPe(o,s){var i=this._id;return arguments.length<2?Ih(this.node(),i).on.on(o):this.each(NPe(i,o,s))}function $Pe(o){return function(){var s=this.parentNode;for(var i in this.__transition)if(+i!==o)return;s&&s.removeChild(this)}}function DPe(){return this.on("end.remove",$Pe(this._id))}function MPe(o){var s=this._name,i=this._id;typeof o!="function"&&(o=xoe(o));for(var u=this._groups,m=u.length,h=new Array(m),b=0;b<m;++b)for(var C=u[b],x=C.length,_=h[b]=new Array(x),N,O,B=0;B<x;++B)(N=C[B])&&(O=o.call(N,N.__data__,B,C))&&("__data__"in N&&(O.__data__=N.__data__),_[B]=O,$U(_[B],s,i,B,_,Ih(N,i)));return new F0(h,this._parents,s,i)}function RPe(o){var s=this._name,i=this._id;typeof o!="function"&&(o=Ofe(o));for(var u=this._groups,m=u.length,h=[],b=[],C=0;C<m;++C)for(var x=u[C],_=x.length,N,O=0;O<_;++O)if(N=x[O]){for(var B=o.call(N,N.__data__,O,x),H,Z=Ih(N,i),J=0,K=B.length;J<K;++J)(H=B[J])&&$U(H,s,i,J,B,Z);h.push(B),b.push(N)}return new F0(h,b,s,i)}var BPe=AR.prototype.constructor;function IPe(){return new BPe(this._groups,this._parents)}function PPe(o,s){var i,u,m;return function(){var h=f4(this,o),b=(this.style.removeProperty(o),f4(this,o));return h===b?null:h===i&&b===u?m:m=s(i=h,u=b)}}function eme(o){return function(){this.style.removeProperty(o)}}function FPe(o,s,i){var u,m=i+"",h;return function(){var b=f4(this,o);return b===m?null:b===u?h:h=s(u=b,i)}}function LPe(o,s,i){var u,m,h;return function(){var b=f4(this,o),C=i(this),x=C+"";return C==null&&(x=C=(this.style.removeProperty(o),f4(this,o))),b===x?null:b===u&&x===m?h:(m=x,h=s(u=b,C))}}function VPe(o,s){var i,u,m,h="style."+s,b="end."+h,C;return function(){var x=Pv(this,o),_=x.on,N=x.value[h]==null?C||(C=eme(s)):void 0;(_!==i||m!==N)&&(u=(i=_).copy()).on(b,m=N),x.on=u}}function HPe(o,s,i){var u=(o+="")=="transform"?HIe:Qfe;return s==null?this.styleTween(o,PPe(o,u)).on("end.style."+o,eme(o)):typeof s=="function"?this.styleTween(o,LPe(o,u,Aoe(this,"style."+o,s))).each(VPe(this._id,o)):this.styleTween(o,FPe(o,u,s),i).on("end.style."+o,null)}function zPe(o,s,i){return function(u){this.style.setProperty(o,s.call(this,u),i)}}function UPe(o,s,i){var u,m;function h(){var b=s.apply(this,arguments);return b!==m&&(u=(m=b)&&zPe(o,b,i)),u}return h._value=s,h}function jPe(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,UPe(o,s,i??""))}function WPe(o){return function(){this.textContent=o}}function ZPe(o){return function(){var s=o(this);this.textContent=s??""}}function GPe(o){return this.tween("text",typeof o=="function"?ZPe(Aoe(this,"text",o)):WPe(o==null?"":o+""))}function qPe(o){return function(s){this.textContent=o.call(this,s)}}function YPe(o){var s,i;function u(){var m=o.apply(this,arguments);return m!==i&&(s=(i=m)&&qPe(m)),s}return u._value=o,u}function KPe(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,YPe(o))}function XPe(){for(var o=this._name,s=this._id,i=tme(),u=this._groups,m=u.length,h=0;h<m;++h)for(var b=u[h],C=b.length,x,_=0;_<C;++_)if(x=b[_]){var N=Ih(x,s);$U(x,o,i,_,b,{time:N.time+N.delay+N.duration,delay:0,duration:N.duration,ease:N.ease})}return new F0(u,this._parents,o,i)}function JPe(){var o,s,i=this,u=i._id,m=i.size();return new Promise(function(h,b){var C={value:b},x={value:function(){--m===0&&h()}};i.each(function(){var _=Pv(this,u),N=_.on;N!==o&&(s=(o=N).copy(),s._.cancel.push(C),s._.interrupt.push(C),s._.end.push(x)),_.on=s}),m===0&&h()})}var QPe=0;function F0(o,s,i,u){this._groups=o,this._parents=s,this._name=i,this._id=u}function tme(){return++QPe}var N0=AR.prototype;F0.prototype={constructor:F0,select:MPe,selectAll:RPe,selectChild:N0.selectChild,selectChildren:N0.selectChildren,filter:kPe,merge:TPe,selection:IPe,transition:XPe,call:N0.call,nodes:N0.nodes,node:N0.node,size:N0.size,empty:N0.empty,each:N0.each,on:OPe,attr:uPe,attrTween:gPe,style:HPe,styleTween:jPe,text:GPe,textTween:KPe,remove:DPe,tween:oPe,delay:bPe,duration:CPe,ease:xPe,easeVarying:_Pe,end:JPe,[Symbol.iterator]:N0[Symbol.iterator]};function e8e(o){return((o*=2)<=1?o*o*o:(o-=2)*o*o+2)/2}var t8e={time:null,delay:0,duration:250,ease:e8e};function n8e(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 o8e(o){var s,i;o instanceof F0?(s=o._id,o=o._name):(s=tme(),(i=t8e).time=koe(),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,x,_=0;_<C;++_)(x=b[_])&&$U(x,o,s,_,b,i||n8e(x,s));return new F0(u,this._parents,o,s)}AR.prototype.interrupt=ePe;AR.prototype.transition=o8e;const $H=o=>()=>o;function s8e(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 R0(o,s,i){this.k=o,this.x=s,this.y=i}R0.prototype={constructor:R0,scale:function(o){return o===1?this:new R0(this.k*o,this.x,this.y)},translate:function(o,s){return o===0&s===0?this:new R0(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 p4=new R0(1,0,0);R0.prototype;function lte(o){o.stopImmediatePropagation()}function $6(o){o.preventDefault(),o.stopImmediatePropagation()}function r8e(o){return(!o.ctrlKey||o.type==="wheel")&&!o.button}function a8e(){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 ple(){return this.__zoom||p4}function i8e(o){return-o.deltaY*(o.deltaMode===1?.05:o.deltaMode?1:.002)*(o.ctrlKey?10:1)}function l8e(){return navigator.maxTouchPoints||"ontouchstart"in this}function c8e(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 u8e(){var o=r8e,s=a8e,i=c8e,u=i8e,m=l8e,h=[0,1/0],b=[[-1/0,-1/0],[1/0,1/0]],C=250,x=ZIe,_=AU("start","zoom","end"),N,O,B,H=500,Z=150,J=0,K=10;function G(ye){ye.property("__zoom",ple).on("wheel.zoom",Ue,{passive:!1}).on("mousedown.zoom",ut).on("dblclick.zoom",lt).filter(m).on("touchstart.zoom",Oe).on("touchmove.zoom",ue).on("touchend.zoom touchcancel.zoom",Pt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}G.transform=function(ye,De,R,je){var be=ye.selection?ye.selection():ye;be.property("__zoom",ple),ye!==be?Qe(ye,De,R,je):be.interrupt().each(function(){Ne(this,arguments).event(je).start().zoom(null,typeof De=="function"?De.apply(this,arguments):De).end()})},G.scaleBy=function(ye,De,R,je){G.scaleTo(ye,function(){var be=this.__zoom.k,ot=typeof De=="function"?De.apply(this,arguments):De;return be*ot},R,je)},G.scaleTo=function(ye,De,R,je){G.transform(ye,function(){var be=s.apply(this,arguments),ot=this.__zoom,nt=R==null?ge(be):typeof R=="function"?R.apply(this,arguments):R,pe=ot.invert(nt),Ze=typeof De=="function"?De.apply(this,arguments):De;return i(V(W(ot,Ze),nt,pe),be,b)},R,je)},G.translateBy=function(ye,De,R,je){G.transform(ye,function(){return i(this.__zoom.translate(typeof De=="function"?De.apply(this,arguments):De,typeof R=="function"?R.apply(this,arguments):R),s.apply(this,arguments),b)},null,je)},G.translateTo=function(ye,De,R,je,be){G.transform(ye,function(){var ot=s.apply(this,arguments),nt=this.__zoom,pe=je==null?ge(ot):typeof je=="function"?je.apply(this,arguments):je;return i(p4.translate(pe[0],pe[1]).scale(nt.k).translate(typeof De=="function"?-De.apply(this,arguments):-De,typeof R=="function"?-R.apply(this,arguments):-R),ot,b)},je,be)};function W(ye,De){return De=Math.max(h[0],Math.min(h[1],De)),De===ye.k?ye:new R0(De,ye.x,ye.y)}function V(ye,De,R){var je=De[0]-R[0]*ye.k,be=De[1]-R[1]*ye.k;return je===ye.x&&be===ye.y?ye:new R0(ye.k,je,be)}function ge(ye){return[(+ye[0][0]+ +ye[1][0])/2,(+ye[0][1]+ +ye[1][1])/2]}function Qe(ye,De,R,je){ye.on("start.zoom",function(){Ne(this,arguments).event(je).start()}).on("interrupt.zoom end.zoom",function(){Ne(this,arguments).event(je).end()}).tween("zoom",function(){var be=this,ot=arguments,nt=Ne(be,ot).event(je),pe=s.apply(be,ot),Ze=R==null?ge(pe):typeof R=="function"?R.apply(be,ot):R,Tt=Math.max(pe[1][0]-pe[0][0],pe[1][1]-pe[0][1]),He=be.__zoom,vt=typeof De=="function"?De.apply(be,ot):De,Be=x(He.invert(Ze).concat(Tt/He.k),vt.invert(Ze).concat(Tt/vt.k));return function(ft){if(ft===1)ft=vt;else{var oe=Be(ft),pn=Tt/oe[2];ft=new R0(pn,Ze[0]-oe[0]*pn,Ze[1]-oe[1]*pn)}nt.zoom(null,ft)}})}function Ne(ye,De,R){return!R&&ye.__zooming||new te(ye,De)}function te(ye,De){this.that=ye,this.args=De,this.active=0,this.sourceEvent=null,this.extent=s.apply(ye,De),this.taps=0}te.prototype={event:function(ye){return ye&&(this.sourceEvent=ye),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(ye,De){return this.mouse&&ye!=="mouse"&&(this.mouse[1]=De.invert(this.mouse[0])),this.touch0&&ye!=="touch"&&(this.touch0[1]=De.invert(this.touch0[0])),this.touch1&&ye!=="touch"&&(this.touch1[1]=De.invert(this.touch1[0])),this.that.__zoom=De,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(ye){var De=Dh(this.that).datum();_.call(ye,this.that,new s8e(ye,{sourceEvent:this.sourceEvent,target:G,type:ye,transform:this.that.__zoom,dispatch:_}),De)}};function Ue(ye,...De){if(!o.apply(this,arguments))return;var R=Ne(this,De).event(ye),je=this.__zoom,be=Math.max(h[0],Math.min(h[1],je.k*Math.pow(2,u.apply(this,arguments)))),ot=Av(ye);if(R.wheel)(R.mouse[0][0]!==ot[0]||R.mouse[0][1]!==ot[1])&&(R.mouse[1]=je.invert(R.mouse[0]=ot)),clearTimeout(R.wheel);else{if(je.k===be)return;R.mouse=[ot,je.invert(ot)],ez(this),R.start()}$6(ye),R.wheel=setTimeout(nt,Z),R.zoom("mouse",i(V(W(je,be),R.mouse[0],R.mouse[1]),R.extent,b));function nt(){R.wheel=null,R.end()}}function ut(ye,...De){if(B||!o.apply(this,arguments))return;var R=ye.currentTarget,je=Ne(this,De,!0).event(ye),be=Dh(ye.view).on("mousemove.zoom",Ze,!0).on("mouseup.zoom",Tt,!0),ot=Av(ye,R),nt=ye.clientX,pe=ye.clientY;Hfe(ye.view),lte(ye),je.mouse=[ot,this.__zoom.invert(ot)],ez(this),je.start();function Ze(He){if($6(He),!je.moved){var vt=He.clientX-nt,Be=He.clientY-pe;je.moved=vt*vt+Be*Be>J}je.event(He).zoom("mouse",i(V(je.that.__zoom,je.mouse[0]=Av(He,R),je.mouse[1]),je.extent,b))}function Tt(He){be.on("mousemove.zoom mouseup.zoom",null),zfe(He.view,je.moved),$6(He),je.event(He).end()}}function lt(ye,...De){if(o.apply(this,arguments)){var R=this.__zoom,je=Av(ye.changedTouches?ye.changedTouches[0]:ye,this),be=R.invert(je),ot=R.k*(ye.shiftKey?.5:2),nt=i(V(W(R,ot),je,be),s.apply(this,De),b);$6(ye),C>0?Dh(this).transition().duration(C).call(Qe,nt,je,ye):Dh(this).call(G.transform,nt,je,ye)}}function Oe(ye,...De){if(o.apply(this,arguments)){var R=ye.touches,je=R.length,be=Ne(this,De,ye.changedTouches.length===je).event(ye),ot,nt,pe,Ze;for(lte(ye),nt=0;nt<je;++nt)pe=R[nt],Ze=Av(pe,this),Ze=[Ze,this.__zoom.invert(Ze),pe.identifier],be.touch0?!be.touch1&&be.touch0[2]!==Ze[2]&&(be.touch1=Ze,be.taps=0):(be.touch0=Ze,ot=!0,be.taps=1+!!N);N&&(N=clearTimeout(N)),ot&&(be.taps<2&&(O=Ze[0],N=setTimeout(function(){N=null},H)),ez(this),be.start())}}function ue(ye,...De){if(this.__zooming){var R=Ne(this,De).event(ye),je=ye.changedTouches,be=je.length,ot,nt,pe,Ze;for($6(ye),ot=0;ot<be;++ot)nt=je[ot],pe=Av(nt,this),R.touch0&&R.touch0[2]===nt.identifier?R.touch0[0]=pe:R.touch1&&R.touch1[2]===nt.identifier&&(R.touch1[0]=pe);if(nt=R.that.__zoom,R.touch1){var Tt=R.touch0[0],He=R.touch0[1],vt=R.touch1[0],Be=R.touch1[1],ft=(ft=vt[0]-Tt[0])*ft+(ft=vt[1]-Tt[1])*ft,oe=(oe=Be[0]-He[0])*oe+(oe=Be[1]-He[1])*oe;nt=W(nt,Math.sqrt(ft/oe)),pe=[(Tt[0]+vt[0])/2,(Tt[1]+vt[1])/2],Ze=[(He[0]+Be[0])/2,(He[1]+Be[1])/2]}else if(R.touch0)pe=R.touch0[0],Ze=R.touch0[1];else return;R.zoom("touch",i(V(nt,pe,Ze),R.extent,b))}}function Pt(ye,...De){if(this.__zooming){var R=Ne(this,De).event(ye),je=ye.changedTouches,be=je.length,ot,nt;for(lte(ye),B&&clearTimeout(B),B=setTimeout(function(){B=null},H),ot=0;ot<be;++ot)nt=je[ot],R.touch0&&R.touch0[2]===nt.identifier?delete R.touch0:R.touch1&&R.touch1[2]===nt.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(nt=Av(nt,this),Math.hypot(O[0]-nt[0],O[1]-nt[1])<K)){var pe=Dh(this).on("dblclick.zoom");pe&&pe.apply(this,arguments)}}}return G.wheelDelta=function(ye){return arguments.length?(u=typeof ye=="function"?ye:$H(+ye),G):u},G.filter=function(ye){return arguments.length?(o=typeof ye=="function"?ye:$H(!!ye),G):o},G.touchable=function(ye){return arguments.length?(m=typeof ye=="function"?ye:$H(!!ye),G):m},G.extent=function(ye){return arguments.length?(s=typeof ye=="function"?ye:$H([[+ye[0][0],+ye[0][1]],[+ye[1][0],+ye[1][1]]]),G):s},G.scaleExtent=function(ye){return arguments.length?(h[0]=+ye[0],h[1]=+ye[1],G):[h[0],h[1]]},G.translateExtent=function(ye){return arguments.length?(b[0][0]=+ye[0][0],b[1][0]=+ye[1][0],b[0][1]=+ye[0][1],b[1][1]=+ye[1][1],G):[[b[0][0],b[0][1]],[b[1][0],b[1][1]]]},G.constrain=function(ye){return arguments.length?(i=ye,G):i},G.duration=function(ye){return arguments.length?(C=+ye,G):C},G.interpolate=function(ye){return arguments.length?(x=ye,G):x},G.on=function(){var ye=_.on.apply(_,arguments);return ye===_?G:ye},G.clickDistance=function(ye){return arguments.length?(J=(ye=+ye)*ye,G):Math.sqrt(J)},G.tapDistance=function(ye){return arguments.length?(K=+ye,G):K},G}var ss=(o=>(o.Left="left",o.Top="top",o.Right="right",o.Bottom="bottom",o))(ss||{}),Noe=(o=>(o.Partial="partial",o.Full="full",o))(Noe||{}),rE=(o=>(o.Bezier="default",o.SimpleBezier="simple-bezier",o.Straight="straight",o.Step="step",o.SmoothStep="smoothstep",o))(rE||{}),m2=(o=>(o.Strict="strict",o.Loose="loose",o))(m2||{}),Dz=(o=>(o.Arrow="arrow",o.ArrowClosed="arrowclosed",o))(Dz||{}),j6=(o=>(o.Free="free",o.Vertical="vertical",o.Horizontal="horizontal",o))(j6||{}),nme=(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))(nme||{});const d8e=["INPUT","SELECT","TEXTAREA"];function yne(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 f8e(o){return o.ctrlKey||o.metaKey||o.shiftKey||o.altKey}function gle(o,s,i,u){const m=s.replace("+",`
115
+ `));return ue(ce.split(""),u).length},ot=(ee,ie)=>{const ce=De(ee,ie).join("");return je(ce)},nt=(ee,ie)=>{const ce=De(ee,ie).join("").replace(/\s/g,"");return je(ce)},pe=(ee,ie)=>()=>ie(ee.getBody(),ee.schema),Ze=(ee,ie)=>()=>ie(ee.selection.getRng().cloneContents(),ee.schema),Tt=ee=>pe(ee,be),He=ee=>({body:{getWordCount:Tt(ee),getCharacterCount:pe(ee,ot),getCharacterCountWithoutSpaces:pe(ee,nt)},selection:{getWordCount:Ze(ee,be),getCharacterCount:Ze(ee,ot),getCharacterCountWithoutSpaces:Ze(ee,nt)},getCount:Tt(ee)}),vt=(ee,ie)=>{ee.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(ie.body.getWordCount()),String(ie.selection.getWordCount())],["Characters (no spaces)",String(ie.body.getCharacterCountWithoutSpaces()),String(ie.selection.getCharacterCountWithoutSpaces())],["Characters",String(ie.body.getCharacterCount()),String(ie.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})},Be=(ee,ie)=>{ee.addCommand("mceWordCount",()=>vt(ee,ie))},ft=(ee,ie)=>{let ce=null;return{cancel:()=>{i(ce)||(clearTimeout(ce),ce=null)},throttle:(...Me)=>{i(ce)&&(ce=setTimeout(()=>{ce=null,ee.apply(null,Me)},ie))}}};var oe=tinymce.util.Tools.resolve("tinymce.util.Delay");const pn=(ee,ie)=>{ee.dispatch("wordCountUpdate",{wordCount:{words:ie.body.getWordCount(),characters:ie.body.getCharacterCount(),charactersWithoutSpaces:ie.body.getCharacterCountWithoutSpaces()}})},gt=(ee,ie)=>{pn(ee,ie)},St=(ee,ie,ce)=>{const Y=ft(()=>gt(ee,ie),ce);ee.on("init",()=>{gt(ee,ie),oe.setEditorTimeout(ee,()=>{ee.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",Y.throttle)},0),ee.on("remove",Y.cancel)})},jt=ee=>{const ie=()=>ee.execCommand("mceWordCount");ee.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:ie,context:"any"}),ee.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:ie,context:"any"})};var Ct=(ee=300)=>{o.add("wordcount",ie=>{const ce=He(ie);return Be(ie,ce),jt(ie),St(ie,ce,ee),ce})};Ct()})();const xMe=o=>/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument/i.test(o)||/class="OutlineElement/.test(o)||/id="?docs\-internal\-guid\-/.test(o),EMe=(o,s="wps_office")=>{const i=o.split(","),u=i[0].match(/:(.*?);/)[1],m=atob(i[1]);let h=m.length;const b=new Uint8Array(h);for(;h--;)b[h]=m.charCodeAt(h);return new File([b],s,{type:u})},_Me=o=>btoa(o.match(/\w{2}/g).map(s=>String.fromCharCode(parseInt(s,16))).join(""));function kMe(o){if(!o)return[];let s=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,i=new RegExp(`(?:(${s.source}))([\\da-fA-F\\s]+)\\}`,"g"),u=o.match(i);console.log("images",u);const m=[];if(u||(s=/{\\pict[\s\S]+?(\\pngblip-?\d+)?(\\wmetafile8-?\d+)?{\\\*\\blipuid\s?[\da-fA-F]+[\s}]*?/,i=new RegExp(`(?:(${s.source}))([\\da-fA-F\\s]+)\\}`,"g"),u=o.match(i)),u)for(const h of u){let b=!1;if(h.includes("\\pngblip")?b="image/png":h.includes("\\jpegblip")&&(b="image/jpeg"),b){const C=h.replace(s,"").replace(/[^\da-fA-F]/g,""),x=`data:${b};base64,${_Me(C)}`;m.push({base64:x,file:EMe(x)})}}return m}const TMe=(o,s)=>{if(!s)return o;try{const u=new DOMParser().parseFromString(o,"text/html"),m=u.querySelectorAll("img"),b=(s.clipboardData||window.Clipboard).getData("text/rtf"),C=kMe(b);return m.forEach((x,_)=>{var O;const N=x.getAttribute("src");if(N&&N.startsWith("file:")&&(O=C==null?void 0:C[_])!=null&&O.base64){const B=C[_].base64;x.setAttribute("src",B)}}),u.body.innerHTML}catch{return o}},AMe=o=>{const s=atob(o.split(",")[1]),i=o.split(",")[0].split(":")[1].split(";")[0],u=new ArrayBuffer(s.length),m=new Uint8Array(u);for(let h=0;h<s.length;h++)m[h]=s.charCodeAt(h);return new Blob([u],{type:i})},NMe=async o=>{try{const s=AMe(o),i=new FormData;i.append("files",s,"image.png");const m=await(await fetch("/api/ajax/uploaddoc",{method:"POST",body:i})).json();if(m.status===1)return m.file_url;throw new Error(m.message)}catch(s){throw s}},OMe=async o=>{const i=new DOMParser().parseFromString(o,"text/html"),u=i.getElementsByTagName("img"),m=[],h=3;for(let b=0;b<u.length;b++){const C=u[b],x=C.getAttribute("src");x&&x.startsWith("data:image")&&(m.push({img:C,src:x,width:C.getAttribute("width"),height:C.getAttribute("height")}),m[m.length-1].width&&C.setAttribute("width",m[m.length-1].width),m[m.length-1].height&&C.setAttribute("height",m[m.length-1].height))}for(let b=0;b<m.length;b+=h){const x=m.slice(b,b+h).map(async _=>{try{const N=await NMe(_.src);_.img.setAttribute("src",N)}catch{_.img.remove()}});await Promise.all(x)}return i.body.innerHTML},$Me=o=>{o.querySelectorAll("td").forEach(i=>{const u=i.getAttribute("width"),m=i.getAttribute("style")||"";u==="0"&&m.includes("border:none")&&i.remove()})},DMe=o=>{o.querySelectorAll("table").forEach(i=>{i.style.maxWidth="100%"})},MMe=o=>{o.querySelectorAll("table").forEach(i=>{i.style.tableLayout="fixed";const u=i.getAttribute("style")||"";if(u){const m=u.split(";").filter(b=>b.trim()),h=[];m.forEach(b=>{const[C,x]=b.split(":").map(_=>_.trim());C&&x&&(["margin","margin-top","margin-right","margin-bottom","margin-left"].includes(C.toLowerCase())?/\-\d+(\.\d+)?(px|em|rem|%|pt|pc|in|cm|mm|ex|ch|vw|vh|vmin|vmax)?/.test(x)||h.push(`${C}: ${x}`):h.push(`${C}: ${x}`))}),h.some(b=>b.toLowerCase().startsWith("width"))||h.push("width: 100%"),i.setAttribute("style",h.join("; "))}})},RMe=o=>{o.querySelectorAll("table").forEach(i=>{const u=i.querySelectorAll("tr");if(u.length>0){const b=u[0].querySelectorAll("td, th").length;if(b>0){const C=(100/b).toFixed(2);u.forEach(x=>{x.querySelectorAll("td, th").forEach((N,O)=>{const B=N,H=parseInt(B.getAttribute("colspan")||"1"),Z=(parseFloat(C)*H).toFixed(2),K=(B.getAttribute("style")||"").split(";").filter(W=>!W.trim().toLowerCase().startsWith("width")).join(";"),G=K?`${K}; width: ${Z}%`:`width: ${Z}%`;B.setAttribute("style",G)})})}}})},BMe=o=>{o.querySelectorAll("table").forEach(i=>{const u=i.querySelectorAll("td");let m=!1,h="";for(const b of u){const C=b.getAttribute("style")||"",x=C.match(/border(?:-(?:right|left|top|bottom))?(?:-style)?:\s*[0-9.]*(?:pt|px)?\s*double\s*(?:windowtext|[#a-zA-Z0-9]+)?/i)||C.match(/border(?:-(?:right|left|top|bottom))?:\s*[0-9.]*(?:pt|px)?\s*double\s*(?:windowtext|[#a-zA-Z0-9]+)?/i);(x?x[0]:"").includes("double")&&(m=!0,x&&(h=x[0].replace(/^border(?:-(?:right|left|top|bottom))?(?:-style)?:\s*/,""),b.style.borderTop=h,b.style.borderRight=h,b.style.borderBottom=h,b.style.borderLeft=h))}m&&h&&(i.style.borderCollapse="separate",i.style.borderSpacing="2px",i.style.border=h)})},IMe=o=>{o.querySelectorAll("table").forEach(i=>{i.querySelectorAll("td[rowspan]").forEach(m=>{const C=((m.getAttribute("style")||"").match(/border-[^:]+:[^;]+(?:solid|double)[^;]+/g)||[]).find(x=>!x.includes("none"));if(C){const x=C.split(":")[1].trim();m.style.borderBottom=x}})})},PMe=o=>{o.querySelectorAll('[style*="mso-"]').forEach(i=>{const m=(i.getAttribute("style")||"").replace(/mso-[^:]+:[^;]+;/g,"");i.setAttribute("style",m)})},FMe=o=>{o.querySelectorAll('[style*="tab-stops"]').forEach(i=>{const m=(i.getAttribute("style")||"").replace(/tab-stops:[^;]+;/g,"");i.setAttribute("style",m)})},LMe=o=>{o=o.replace(/<a(?!.*?href=)[^>]*>([\s\S]*?)<\/a>/gi,"$1");const i=new DOMParser().parseFromString(o,"text/html");return $Me(i),DMe(i),BMe(i),IMe(i),PMe(i),FMe(i),MMe(i),RMe(i),o=i.body.innerHTML,o};_z.PluginManager.add("pasteprocess",o=>(o.on("paste",s=>{if(s.clipboardData){const i=s.clipboardData.getData("text/html")||s.clipboardData.getData("text");if(xMe(i)){s.preventDefault();const u=o.windowManager.open({title:"处理中",body:{type:"panel",items:[{type:"htmlpanel",html:'<div style="text-align: center; padding: 20px;">正在处理Word内容,请稍候...</div>'}]},buttons:[]}),m=LMe(i),h=TMe(m,s);OMe(h).then(b=>{o.insertContent(b),u.close()})}}}),{}));let _H="A4";const ane={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}},VMe=Object.keys(ane).map(o=>`pagesize${o}`).join(" ");_z.PluginManager.add("pagesize",o=>{const s=o.options.register;s("pagesize",{processor:"string",default:"A4"}),_H=(m=>h=>h.options.get(m))("pagesize")(o);const u=m=>{const h=ane[m];if(h){const b=(window.devicePixelRatio||1)*96,C=h.width*b/25.4;o!=null&&o.container&&(o.container.style.minWidth=`${C}px`);const x=o.contentAreaContainer.querySelector("iframe");x&&(x.style.width=`${C}px`),o.fire("pagesizechange",{size:m})}};return Object.keys(ane).forEach(m=>{o.ui.registry.addToggleMenuItem(`pagesize${m}`,{text:m,onAction:()=>{_H=m,u(m)},onSetup:h=>(h.setActive(_H===m),()=>{})})}),o.on("init",()=>{u(_H)}),{}});const HMe=["accordion","advlist","anchor","autolink","autosave","charmap","directionality","importcss","insertdatetime","lists","image","media","pagebreak","preview","save","searchreplace","table","fullscreen","wordcount","pasteprocess","pagesize"],zMe="undo redo | blocks bold italic forecolor removeformat alignleft aligncenter alignright alignjustify outdent indent pagebreakfullscreen preview",UMe={license_key:"gpl",skin:!1,content_css:process.env.NODE_ENV==="development"?[`${location.origin}/css/content.css`,`${location.origin}/css/reset.css`]:["./css/content.css","./css/reset.css"],promotion:!1,menu:{pagesize:{title:"页面大小",items:VMe}},menubar:"file edit insert table tools help pagesize",cleanup:!0,branding:!1,language:"zh_CN",plugins:HMe,toolbar:zMe,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,pagesize:"A4",images_upload_handler:o=>new Promise((s,i)=>{const u=new FormData;u.append("files",o.blob(),o.filename()),fetch("/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}`)})})},jMe={name:"ProEditor",components:{Editor:CMe},props:{modelValue:{type:String,default:""},pagesize:{type:String,default:"A4"},hasPagesize:{type:Boolean,default:!1},placeholder:{type:String,default:"请输入内容"},width:{type:[Number,String],default:"100%"},height:{type:Number,default:400}},setup(o,{emit:s}){const i=f.reactive({myInit:m(UMe),contentValue:o.modelValue,timeout:null});f.onMounted(()=>{_z.init({license_key:"gpl"}),_z.activeEditor.on("pagesizechange",h=>{s("update:pagesize",h.size)})}),f.watch(()=>i.contentValue,()=>{u(()=>{s("update:modelValue",i.contentValue)})}),f.watch(()=>o.modelValue,h=>{h&&h!==i.contentValue&&(i.contentValue=h)});function u(h,b=400){i.timeout!==null&&clearTimeout(i.timeout),i.timeout=setTimeout(h,b)}function m(h){o!=null&&o.height&&(h.height=o.height),o!=null&&o.width&&(h.width=o.width);const{placeholder:b,pagesize:C}=o;return h={...h,placeholder:b,...o.hasPagesize&&{menu:{...h.menu,pagesize:h.menu.pagesize},menubar:h.menubar.includes("pagesize")?h.menubar:`${h.menubar} pagesize`,pagesize:C},...!o.hasPagesize&&{menu:Object.fromEntries(Object.entries(h.menu).filter(([x])=>x!=="pagesize")),menubar:h.menubar.replace(/pagesize/g,"").trim(),pagesize:""}},h}return{...f.toRefs(i),customer:m,debounce:u}}},WMe={class:"my-tinymce"};function ZMe(o,s,i,u,m,h){const b=f.resolveComponent("Editor");return f.openBlock(),f.createElementBlock("div",WMe,[f.createVNode(b,{modelValue:o.contentValue,"onUpdate:modelValue":s[0]||(s[0]=C=>o.contentValue=C),init:o.myInit},null,8,["modelValue","init"])])}const ufe=Di(jMe,[["render",ZMe]]),GMe={name:"ShadowDomWrap",setup(o,{emit:s,expose:i}){const u=f.ref(null),m=f.ref(),h=f.ref(!1),b=x=>{if(!u.value)return;const _=u.value.contains(x.target);!_&&h.value?(h.value=!1,s("onBlur")):_&&!h.value&&(h.value=!0)},C=x=>{x.stopPropagation(),h.value||(h.value=!0,s("onFocus"))};return f.onMounted(()=>{var N,O,B;m.value=(N=u.value)==null?void 0:N.attachShadow({mode:"open"}),document.addEventListener("click",b);const x=document.createElement("link");x.rel="stylesheet",x.href=`${location==null?void 0:location.origin}/assets/css/index.min.css`,(O=m.value)==null||O.appendChild(x);const _=document.createElement("link");_.rel="stylesheet",_.href=`${location==null?void 0:location.origin}/assets/css/reset.css`,(B=m.value)==null||B.appendChild(_)}),f.onUnmounted(()=>{document.removeEventListener("click",b)}),i({focus:()=>{h.value=!0}}),{shadowHost:u,shadowRoot:m,handleClick:C}}};function qMe(o,s,i,u,m,h){return f.openBlock(),f.createElementBlock("div",{ref:"shadowHost",class:"shadow-host",onClick:s[0]||(s[0]=f.withModifiers((...b)=>u.handleClick&&u.handleClick(...b),["stop"]))},[u.shadowRoot?(f.openBlock(),f.createBlock(f.Teleport,{key:0,to:u.shadowRoot},[f.renderSlot(o.$slots,"default")],8,["to"])):f.createCommentVNode("",!0)],512)}const voe=Di(GMe,[["render",qMe]]),YMe=["innerHTML"],dfe=f.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue");return(i,u)=>(f.openBlock(),f.createBlock(voe,null,{default:f.withCtx(()=>[f.createElementVNode("div",{innerHTML:s.value},null,8,YMe)]),_:1}))}}),ffe=Symbol("nodesUI"),If=()=>{const o=f.inject(ffe);if(!o)throw new Error("NodesUI context not found");return o};function boe(o){if(!o||!o.ownerDocument)return null;const s=[];for(let i=o;i&&i.nodeType===1;i=i.parentElement){let u=0;for(let b=i.previousSibling;b;b=b.previousSibling)b.nodeType===1&&b.nodeName===i.nodeName&&u++;const m=i.nodeName.toLowerCase(),h=u?`${m}:nth-child(${u+1})`:m;s.unshift(h)}return s.length?s.join(" > "):null}function KMe(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 mfe(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(o)}catch(i){return console.error("nodePath query error:",i),null}}const LA=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}`:""),XMe=(o,s,i)=>{var u,m;if(!woe(o)){const h=i==null?void 0:i.getRootNode(),b=(u=h==null?void 0:h.getSelection)==null?void 0:u.call(h),C=mfe(o.nodePath,i);if(b&&o.startOffset!==void 0&&s&&C){const x=document.createRange(),_=(o==null?void 0:o.textNodeIndex)||0,N=C.childNodes[_]||C,O=Math.min(o.startOffset,((m=N.textContent)==null?void 0:m.length)||0);x.setStart(N,O),x.setEnd(N,O);const B=document.createElement("span");B.classList.add("empty-text-node"),x.insertNode(B),x.insertNode(s),x.setStartAfter(s),x.collapse(!0),b.removeAllRanges(),b.addRange(x)}}},JMe=(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)},QMe=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},e6e=o=>{let s=o.closest("TD"),i=o.closest(".node-item"),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=boe(m)),(m==null?void 0:m.getAttribute("selectable"))==="false")return null;let b={element:m,nodePath:h};const C=m==null?void 0:m.getAttribute("data-textNodeIndex");C&&(b.textNodeIndex=Number(C));const x=m==null?void 0:m.getAttribute("data-startOffset");x&&(b.startOffset=Number(x));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},t6e=o=>hxe(o,s=>f.toValue(s.nodes).map(i=>({...i,color:s.color,activated:s==null?void 0:s.activated,dataGroupKey:s.id}))),yoe=(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})`},n6e=o=>{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").querySelectorAll("table");return{showTextType:"cell",tableIndex:Array.from(C).indexOf(b)+1,colIndex:h,rowIndex:m}},o6e=(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 x=n6e(C);return x?(x==null?void 0:x.showTextType)==="input"?{...C,...x,inputIndex:i++}:{...C,...x}:null}))==null?void 0:h.filter(Boolean):[]};function s6e(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 x=m.colIndex;s.find(N=>N.rowIndex===m.rowIndex&&N.colIndex===x&&!u.has(N));x++)C++;if(C!==0){b=C;for(let x=m.rowIndex;;x++){let _=0;const N=[];for(let O=m.colIndex;O<m.colIndex+b;O++){const B=s.find(H=>H.rowIndex===x&&H.colIndex===O&&!u.has(H));if(B)_++,N.push(B);else break}if(_===b)h.push(...N);else break}h.length>0&&(i.push([...h]),h.forEach(x=>u.add(x)))}}return i}function r6e(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 pfe=(o,s)=>{var _;const i=o6e(o,s||[]),u=[],m=[];(_=f.toValue(i))==null||_.forEach(N=>{(N==null?void 0:N.showTextType)==="input"?u.push(N):m.push(N)});const h=yxe(m,"tableIndex"),b=Object.entries(h).map(([N,O])=>({tableIndex:Number(N),nodes:O})),C=ede(b==null?void 0:b.map(N=>s6e(N==null?void 0:N.nodes))),x=(C==null?void 0:C.map(N=>r6e(N)))||[];return[...u,...x]},t4=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}`:""},a6e=(o,s)=>{const i=pfe(o,s||[]);let 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)?t4(m==null?void 0:m.min):`${t4(m==null?void 0:m.min)}:${t4(m==null?void 0:m.max)}`)}),u==null?void 0:u.join(",")},woe=o=>o.startOffset===void 0&&o.textNodeIndex===void 0,i6e=o=>{var s;if(((s=o.textContent)==null?void 0:s.trim())===""&&o.querySelector("p")){const i=o.querySelector("p");if(i){const u=O=>{const B={};return O&&O.split(";").forEach(H=>{const[Z,J]=H.split(":").map(K=>K.trim());Z&&J&&(B[Z]=J)}),B},m=O=>Object.entries(O).map(([B,H])=>`${B}: ${H}`).join("; "),h=u(o.getAttribute("style")||""),b=u(i.getAttribute("style")||""),C=i.querySelectorAll("span");let x={};C.forEach(O=>{const B=u(O.getAttribute("style")||"");x={...x,...B}});const _={...h,...b,...x},N=m(_);N&&o.setAttribute("style",N),o.removeChild(i)}}},l6e={key:0},c6e={key:1,class:"td-node"},u6e=f.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,i=f.computed(()=>{var u,m;return((m=(u=s==null?void 0:s.node)==null?void 0:u.element)==null?void 0:m.TagName)==="TD"});return(u,m)=>{var h,b;return i.value?(f.openBlock(),f.createElementBlock("span",l6e,f.toDisplayString((h=s==null?void 0:s.node)==null?void 0:h.label),1)):(f.openBlock(),f.createElementBlock("span",c6e,f.toDisplayString((b=s==null?void 0:s.node)==null?void 0:b.label),1))}}}),gfe=Symbol("nodesEditor"),z0=()=>{const o=f.inject(gfe);if(!o)throw new Error("NodesEditor context not found");return o},xU=f.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,{currentNodes:i}=If(),{nodes:u,renderType:m}=z0(),h=f.computed(()=>{var x;return(x=s.node)!=null&&x.id?u.value.some(_=>_.id===s.node.id):!1}),b=f.computed(()=>{var x;if(!((x=s.node)!=null&&x.element))return!1;try{return s.node.element.parentNode!==null}catch(_){return console.warn("Element validation failed:",_),!1}}),C=f.computed(()=>{var x;return(x=f.toValue(i))==null?void 0:x.find(_=>{var N;return(_==null?void 0:_.id)===((N=s==null?void 0:s.node)==null?void 0:N.id)})});return f.watch(()=>C,()=>{var _,N,O,B;const x=f.toValue(C);(_=s==null?void 0:s.node)!=null&&_.element&&(x?x!=null&&x.activated||(s.node.element.style.setProperty("--node-color",(x==null?void 0:x.color)||"#409eff"),s.node.element.style.setProperty("--node-bg-color",yoe((x==null?void 0:x.color)||"#409eff",.1)),s.node.element.setAttribute("data-dataGroupKey",x==null?void 0:x.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("activated")):((N=s.node.element)==null||N.removeAttribute("data-dataGroupKey"),(O=s.node.element)==null||O.removeAttribute("selectable"),(B=s.node.element)==null||B.classList.remove("activated")))},{immediate:!0,deep:!0}),(x,_)=>{var N;return(N=x.node)!=null&&N.element&&b.value&&h.value?(f.openBlock(),f.createBlock(f.Teleport,{key:0,to:x.node.element},[f.createElementVNode("div",{class:f.normalizeClass(["node-item-render",`node-item-${f.unref(m)}`])},[f.renderSlot(x.$slots,"default",{node:x.node},()=>[f.createVNode(u6e,{node:x.node},null,8,["node"])])],2)],8,["to"])):f.createCommentVNode("",!0)}}});function d6e(){const o=f.ref(!1),s=u=>{u.key==="Control"&&(o.value=!0)},i=u=>{u.key==="Control"&&(o.value=!1)};return f.onMounted(()=>{window.addEventListener("keydown",s),window.addEventListener("keyup",i)}),f.onUnmounted(()=>{window.removeEventListener("keydown",s),window.removeEventListener("keyup",i)}),o}function hfe(){const{selectedNodes:o,setSelectedNodes:s,containerRef:i,currentNodes:u}=If(),{editorId:m,nodes:h}=z0(),b=f.ref(!1),C=f.ref({x:0,y:0}),x=f.ref({x:0,y:0}),_=f.ref({left:0,top:0,width:0,height:0}),N=f.ref(null),O=Ne=>{const te=Ne.closest(".node-item-td")||Ne.closest(".node-item");if(te!==null){let Ue=[];if(te.classList.contains("node-selected"))return;const ut=te.getAttribute("id");if(ut&&h.value){const lt=h.value.find(Oe=>Oe.id===ut);lt&&(Ue=[lt])}Ue=W(Ue),s(Ue)}},B=Ne=>{Ne.button===2&&O(Ne==null?void 0:Ne.target),Ne.button===0&&(b.value=!0,N.value&&(C.value={x:Ne.pageX,y:Ne.pageY},x.value={x:Ne.pageX,y:Ne.pageY},K(Ne),V(),N.value.style.display="block",window.addEventListener("mousemove",H),window.addEventListener("mouseup",Z)))},H=Wae(Ne=>{b.value&&(x.value={x:Ne.pageX,y:Ne.pageY},V())},16),Z=Ne=>{Ne.button===0&&(b.value=!1,N.value&&(V(),N.value.style.display="none",window.removeEventListener("mousemove",H),window.removeEventListener("mouseup",Z)))},J=d6e(),K=Ne=>{var Ue,ut;let te=[];if(Ne.button===0&&(Ne!=null&&Ne.target)){const lt=((Ue=Ne==null?void 0:Ne.target)==null?void 0:Ue.closest(".node-item-td"))||((ut=Ne==null?void 0:Ne.target)==null?void 0:ut.closest(".node-item"));if(lt!==null){const Oe=lt.getAttribute("id");if(Oe&&h.value){const ue=h.value.find(Pt=>Pt.id===Oe);ue&&(J.value?o.value.some(Pt=>LA(Pt)===LA(ue))?te=o.value.filter(ye=>LA(ye)!==LA(ue)):te=[...o.value,ue]:ue&&(te=[ue]))}}te=W(te),s(te)}},G=()=>{if(!i.value||!(_.value.width>3||_.value.height>3))return;let Ne=[];const te={left:_.value.left,right:_.value.left+_.value.width,top:_.value.top,bottom:_.value.top+_.value.height};if(i.value.querySelectorAll("*").forEach(ut=>{const lt=ut.getBoundingClientRect(),Oe=window.scrollX||window.pageXOffset,ue=window.scrollY||window.pageYOffset,Pt={left:lt.left+Oe,right:lt.right+Oe,top:lt.top+ue,bottom:lt.bottom+ue};if(Pt.right>te.left&&Pt.left<te.right&&Pt.bottom>te.top&&Pt.top<te.bottom){const ye=ut.getAttribute("id");if(ye&&h.value){const De=h.value.find(R=>R.id===ye);De&&(Ne=[...Ne,De])}}}),Ne=W(Ne),J.value){const ut=new Set(o.value.map(Oe=>LA(Oe))),lt=Ne.filter(Oe=>!ut.has(LA(Oe)));s([...o.value,...lt])}else s(Ne)},W=Ne=>{var Ue;let te=[];if(Ne.length>0){const ut=(Ue=Ne.map(ye=>ye==null?void 0:ye.groupKey))==null?void 0:Ue.filter(Boolean),lt=new Set(ut),Oe=Array.from(lt),ue=h.value.filter(ye=>Oe.includes(ye.groupKey));te=[...Ne,...ue],te=[...Pxe(te.filter(ye=>ye==null?void 0:ye.id),"id")||[],...te.filter(ye=>!ye.id)]}if(u&&u.value&&u.value.length>0){const ut=new Set(u.value.map(lt=>lt.id).filter(Boolean));te=te.filter(lt=>lt.id?!ut.has(lt.id):!0)}return te},V=Wae(()=>{if(!N.value)return;const{x:Ne,y:te}=C.value,{x:Ue,y:ut}=x.value,lt=Math.min(Ne,Ue),Oe=Math.min(te,ut),ue=Math.abs(Ne-Ue),Pt=Math.abs(te-ut);_.value={left:lt,top:Oe,width:ue,height:Pt}},16),ge=Ne=>{if(!N.value)return;const{left:te,top:Ue,width:ut,height:lt}=f.toValue(Ne);N.value.style.left=`${te}px`,N.value.style.top=`${Ue}px`,N.value.style.width=`${ut}px`,N.value.style.height=`${lt}px`},Qe=()=>{if(!i.value)return;i.value.addEventListener("mousedown",B);const Ne=document.getElementById(`select_area_${m}`);if(Ne){N.value=Ne;return}const te=document.createElement("div");te.id=`select_area_${m}`,te.style.position="absolute",te.style.border="1px solid #1677ff",te.style.backgroundColor="rgba(22, 119, 255, 0.05)",te.style.pointerEvents="none",te.style.display="none",document.body.appendChild(te),N.value=te};return f.watch(_,(Ne,te)=>{xa(Ne,te)||(ge(Ne),b.value&&G())},{deep:!0}),f.watch(()=>i.value,Ne=>{f.toValue(Ne)&&Qe()},{immediate:!0}),f.onUnmounted(()=>{i.value&&i.value.removeEventListener("mousedown",B)}),{isSelecting:b,selectionBox:N}}function vfe(){const{selectedNodes:o,containerRef:s}=If(),i=()=>{var m;(m=f.toValue(s))==null||m.querySelectorAll(".node-selected").forEach(h=>{h.classList.remove("node-selected")})},u=m=>{m.forEach(h=>{h.classList.add("node-selected")})};f.watch(()=>o,()=>{i(),setTimeout(()=>{var h,b;const m=(b=(h=f.toValue(o))==null?void 0:h.map(C=>{var x;return(x=s.value)==null?void 0:x.querySelector(`[id="${C.id}"]`)}))==null?void 0:b.filter(Boolean);u(m)},0)},{deep:!0})}const EU=()=>{const{nodes:o,updateNodes:s}=z0();return{nodes:o,addNode:C=>{const _=(Array.isArray(C)?C:[C]).map(O=>({...O,id:O.id||hE()})),N=[...o.value,..._];s(N)},removeNode:C=>{const x=Array.isArray(C)?C:[C],_=[],N=[];x.forEach(B=>{const H=o.value.find(Z=>(Z==null?void 0:Z.id)===B);woe(H)?_.push(B):N.push(B)});let O=o.value.filter(B=>!N.includes(B==null?void 0:B.id));O=O==null?void 0:O.map(B=>_.includes(B==null?void 0:B.id)?{id:B==null?void 0:B.id,nodePath:B==null?void 0:B.nodePath,label:"文本",nodeType:"text"}:B),s(O)},editNodes:C=>{const x=Array.isArray(C)?C:[C],_=hE(),N=x.map(B=>{const H={...B};let Z=B==null?void 0:B.id;return Z||(Z=hE(),H.id=Z),H!=null&&H.groupKey||(H.groupKey=_),H}),O=[...o.value];N.forEach(B=>{const H=O.findIndex(Z=>Z.id===B.id);H!==-1?O[H]=B:O.push(B)}),s(O)},insertNodeAt:(C,x)=>{const _=[...o.value];_.splice(x,0,C),s(_)},moveNode:(C,x)=>{const _=[...o.value],[N]=_.splice(C,1);_.splice(x,0,N),s(_)}}};function f6e(){const{removeNode:o}=EU(),{containerRef:s}=If(),i=f.ref(null),u=h=>{var J,K;if(h.target instanceof Element&&(h.target.closest(".node-item")||h.target.closest(".node-item-td")))return;const b=h.target;if(b===s.value)return;const x=((J=s.value)==null?void 0:J.getRootNode()).getSelection(),_=(K=s.value)==null?void 0:K.querySelectorAll('[contenteditable="true"]');_==null||_.forEach(G=>{G.setAttribute("contenteditable","false")});const N=b.textContent||"",O=b.innerHTML||"";i.value=b,b.setAttribute("contenteditable","true"),b.focus();const B=new MutationObserver(()=>{b.textContent!==N&&(b.innerHTML=O)});B.observe(b,{characterData:!0,childList:!0,subtree:!0});const H=G=>{G.preventDefault()};b.addEventListener("input",H),b.addEventListener("paste",H),b.addEventListener("drop",H),b.addEventListener("keydown",G=>{var W,V,ge,Qe;if(((W=document.activeElement)==null?void 0:W.shadowRoot)===((V=s.value)==null?void 0:V.getRootNode())&&!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(G.key)){if(G.key==="Backspace"||G.key==="Delete"){const Ne=x==null?void 0:x.getRangeAt(0);if(b.blur(),(Ne==null?void 0:Ne.startOffset)===0){const te=Ne.startContainer;if(te.nodeType===Node.TEXT_NODE){const Ue=te.previousSibling;if(Ue&&Ue.nodeType===Node.ELEMENT_NODE&&Ue.classList.contains("node-item")){const ut=Ue.getAttribute("id");ut&&o(ut),(ge=te.parentElement)==null||ge.normalize();return}}else if(te.nodeType===Node.ELEMENT_NODE){const Ue=te.previousSibling;if(Ue&&Ue.nodeType===Node.ELEMENT_NODE&&Ue.classList.contains("node-item")){const ut=Ue.getAttribute("id");ut&&o(ut),(Qe=te.parentElement)==null||Qe.normalize();return}}}}G.preventDefault()}});const Z=()=>{b==null||b.normalize(),B.disconnect(),b.removeEventListener("input",H),b.removeEventListener("paste",H),b.removeEventListener("drop",H),b.removeEventListener("blur",Z),b.setAttribute("contenteditable","false")};b.addEventListener("blur",Z)},m=()=>{var h;(h=s.value)==null||h.addEventListener("dblclick",u)};return f.watch(s,h=>{h&&m()},{immediate:!0}),f.onUnmounted(()=>{var h;(h=s.value)==null||h.removeEventListener("dblclick",u)}),{}}function m6e(){const{containerRef:o,focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}=If(),h=_=>{var O,B;const N=_==null?void 0:_.getSelection();try{if((O=s.value)==null||O.normalize(),N){const H=N.getRangeAt(0);u.value=QMe(H.startContainer);const Z=H.startOffset,J=(B=s.value)==null?void 0:B.querySelectorAll(".node-item");let K=0;return m.value=0,J==null||J.forEach(G=>{const W=document.createRange();if(W.selectNode(G),W.comparePoint(H.startContainer,Z)>=0){m.value+=1;const V=G.getAttribute("data-startOffset");Number(V)>K&&(K=Number(V))}}),K+Z}}catch{}return 0},b=()=>{var N;const _=(N=o.value)==null?void 0:N.getRootNode();i.value=h(_)},C=_=>{var H;const N=_.target;if(N===o.value)return;s.value=N;const O=(H=o.value)==null?void 0:H.getRootNode();i.value=h(O),N.addEventListener("click",b),N.addEventListener("keyup",Z=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(Z.key)&&b()});const B=()=>{N.removeEventListener("click",b),N.removeEventListener("keyup",b),N.removeEventListener("blur",B),setTimeout(()=>{s.value=null,u.value=0,i.value=-1},300)};N.addEventListener("blur",B)},x=()=>{var _;(_=o.value)==null||_.addEventListener("focus",C,!0)};return f.watch(o,_=>{_&&x()},{immediate:!0}),f.onUnmounted(()=>{var _;(_=o.value)==null||_.removeEventListener("focus",C,!0)}),{focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}}function p6e(o){const s=o.value===null?[]:[JSON.parse(JSON.stringify(o.value))],i=f.ref(s),u=f.ref(0),m=f.ref(!1),h=f.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])))},x=_=>{(_.ctrlKey||_.metaKey)&&_.key==="z"?(_.preventDefault(),b()):(_.ctrlKey||_.metaKey)&&_.key==="y"&&(_.preventDefault(),C())};return f.onMounted(()=>{window.addEventListener("keydown",x)}),f.onUnmounted(()=>{window.removeEventListener("keydown",x)}),f.watch(o,cE(_=>{_&&!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 g6e(){const{modelValue:o,inputTypes:s}=z0(),{nodes:i,addNode:u}=EU(),m=C=>{if(!C||typeof C!="string")return[];const _=new DOMParser().parseFromString(C,"text/html");return Array.from(_.querySelectorAll("td")).filter(B=>{var H;return!((H=B.textContent)!=null&&H.trim())})},h=(C,x)=>{const _=x.map(O=>O.nodePath);return C==null?void 0:C.map(O=>({nodePath:boe(O)})).filter(O=>{const B=O==null?void 0:O.nodePath;return!_.includes(B)})},b=C=>{var N;const x=((N=s==null?void 0:s.find(O=>{var B;return((B=O.value)==null?void 0:B.toLowerCase())==="text"}))==null?void 0:N.getDefaultProps())||{},_=C.map(O=>({nodeType:"Text",label:"文本",props:{...x},...O}));u(_)};f.onMounted(()=>{const C=m(f.toValue(o)),x=h(C,f.toValue(i));b(x)})}function h6e(){const{selectedNodes:o,containerRef:s}=If(),{removeNode:i}=EU(),u=f.ref(null),m=C=>{var x;if((x=f.toValue(s))!=null&&x.contains(u.value)&&(C.key==="Delete"||C.key==="Backspace")){let _=[];C.preventDefault(),f.toValue(o).length>0&&(f.toValue(o).forEach(N=>{var O,B,H;if(((O=N==null?void 0:N.element)==null?void 0:O.tagName)==="TD"){const Z=(B=N==null?void 0:N.element)==null?void 0:B.getAttribute("id");Z&&_.push(Z)}else{const Z=(H=N==null?void 0:N.element)==null?void 0:H.getAttribute("id");Z&&_.push(Z)}}),o.value=[],(_==null?void 0:_.length)>0&&i(_))}},h=C=>{var x;(x=f.toValue(s))!=null&&x.contains(C.target)?u.value=C.target:u.value=null},b=()=>{s.value&&(window.addEventListener("keydown",m),s.value.addEventListener("mousedown",h))};f.watch(()=>s.value,C=>{f.toValue(C)&&b()},{immediate:!0}),f.onUnmounted(()=>{s.value&&(window.removeEventListener("keydown",m),s.value.removeEventListener("mousedown",h))})}function _U(){const{nodes:o}=z0(),{containerRef:s,renderNodes:i,uiReady:u}=If(),m=()=>{var h;i.value=[...((h=o.value)==null?void 0:h.map(b=>{var x;const C=(x=s.value)==null?void 0:x.querySelector(`[id="${b.id}"]`);return{...b,element:C}}))||[]].filter(b=>!!(b!=null&&b.element))};f.watch(()=>[o,s.value,u],()=>{f.toValue(u)&&m()},{immediate:!0,deep:!0})}const ine=f.ref({});function kU(o){return f.computed(()=>{var s;return(s=ine.value)==null?void 0:s[o]})}function bfe(){const o=z0(),s=If();f.onMounted(()=>{const{editorId:i}=o;i&&(ine.value[i]=f.ref({...o,...s}))}),f.onUnmounted(()=>{const{editorId:i}=o;i&&(ine.value[i]=null)})}const v6e=f.defineComponent({__name:"NodesEditUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"edit"}},setup(o){const{nodes:s}=z0(),{uiReady:i,renderNodes:u}=If();return bfe(),p6e(s),hfe(),vfe(),h6e(),m6e(),f6e(),g6e(),_U(),(m,h)=>f.unref(i)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(u),b=>(f.openBlock(),f.createBlock(xU,{key:b==null?void 0:b.id,node:b},{default:f.withCtx(C=>[f.renderSlot(m.$slots,"nodeItem",{node:C==null?void 0:C.node})]),_:2},1032,["node"]))),128)):f.createCommentVNode("",!0)}}),Wie=f.defineComponent({__name:"NodesPreviewUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=If();return _U(),(u,m)=>f.unref(s)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(i),h=>(f.openBlock(),f.createBlock(xU,{key:h==null?void 0:h.id,node:h},{default:f.withCtx(b=>[f.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):f.createCommentVNode("",!0)}}),b6e=f.defineComponent({__name:"NodesEnterUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=If();return _U(),(u,m)=>f.unref(s)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(i),h=>(f.openBlock(),f.createBlock(xU,{key:h==null?void 0:h.id,node:h},{default:f.withCtx(b=>[f.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):f.createCommentVNode("",!0)}}),y6e=f.defineComponent({__name:"NodesSelectUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"select"}},setup(o){const{uiReady:s,renderNodes:i}=If();return bfe(),hfe(),vfe(),_U(),(u,m)=>f.unref(s)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(i),h=>(f.openBlock(),f.createBlock(xU,{key:h==null?void 0:h.id,node:h},{default:f.withCtx(b=>[f.renderSlot(u.$slots,"nodeItem",{node:b==null?void 0:b.node})]),_:2},1032,["node"]))),128)):f.createCommentVNode("",!0)}}),w6e=f.defineComponent({__name:"NodesProvider",props:f.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},renderType:{type:String,default:"preview"},inputTypes:{type:Array,default:()=>[]},editorId:{type:String,default:""}},{formData:{},formDataModifiers:{},nodes:{},nodesModifiers:{}}),emits:["update:formData","update:nodes"],setup(o){const s=o,i=f.useModel(o,"formData"),u=f.useModel(o,"nodes"),m=f.computed(()=>s.modelValue);return f.provide(gfe,{modelValue:m,renderType:s.renderType,inputTypes:s.inputTypes,editorId:s==null?void 0:s.editorId,nodes:u,updateNodes:h=>u.value=h,formData:i}),(h,b)=>f.renderSlot(h.$slots,"default")}}),i2=f.ref({});function C6e(o){return f.computed(()=>(i2.value[o]||(i2.value[o]=f.ref([])),i2.value[o]))}function S6e(o){const{editorId:s}=o,i=f.ref(!1);f.onMounted(()=>{i2.value[s]||(i2.value[s]=f.ref([]));const u=i2.value[s].findIndex(m=>m.id===o.id);u!==-1&&i2.value[s].splice(u,1),i.value=!0,i2.value[s].push({...o,isMounted:i})}),f.onUnmounted(()=>{i.value=!1})}const x6e=f.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=f.computed({get:()=>(u.selectedNodes||[]).map(W=>{var Qe;let V=(Qe=u==null?void 0:u.nodes)==null?void 0:Qe.find(Ne=>(Ne==null?void 0:Ne.id)===(W==null?void 0:W.id)),ge=W!=null&&W.element?W==null?void 0:W.element:KMe(W==null?void 0:W.id,b.value);return{...V||{},...W,element:ge}}),set:W=>{const V=W.map(({element:ge,...Qe})=>{var te;return{...((te=u==null?void 0:u.nodes)==null?void 0:te.find(Ue=>(Ue==null?void 0:Ue.id)===(Qe==null?void 0:Qe.id)))||{},...Qe}});m("update:selectedNodes",V)}}),b=f.ref(null),C=f.ref([]),x=f.ref(null),_=f.ref(-1),N=f.ref(0),O=f.ref(0),B=C6e(u==null?void 0:u.editorId),H=f.ref(!1),Z=f.computed(()=>u.htmlRenderRef),J=f.computed(()=>{var V,ge,Qe;const W=((Qe=(ge=(V=f.toValue(B))==null?void 0:V.filter(Ne=>!f.toValue(Ne==null?void 0:Ne.activated)))==null?void 0:ge.filter(Ne=>f.toValue(Ne.isMounted)))==null?void 0:Qe.filter(Ne=>f.toValue(Ne==null?void 0:Ne.isOccupy)))||[];return t6e([...(u==null?void 0:u.nodesGroups)||[],...W])}),K=f.ref([]),G=W=>{const V=W.map(({element:ge,...Qe})=>{var te;return{...((te=C.value)==null?void 0:te.find(Ue=>(Ue==null?void 0:Ue.id)===(Qe==null?void 0:Qe.id)))||{},...Qe}});xa(V,h.value)||(h.value=W,m("onSelectedNodes",V))};return s({setSelectedNodes:G}),f.provide(ffe,{containerRef:b,htmlRenderRef:Z,focusedElement:x,currentRenderNodes:K,cursorPosition:_,focusedNodeIndex:N,preNodeNumber:O,currentNodes:J,selectedNodes:h,setSelectedNodes:G,renderNodes:C,uiReady:H,nodesGroups:u==null?void 0:u.nodesGroups}),(W,V)=>f.renderSlot(W.$slots,"default")}}),E6e=["onClick"],_6e={key:0,class:"icon"},k6e={key:1,class:"arrow"},T6e={key:0,class:"submenu"},A6e=["onClick"],N6e={key:0,class:"icon"},O6e=f.defineComponent({__name:"index",props:f.mergeModels({style:{}},{show:{},showModifiers:{}}),emits:f.mergeModels(["select"],["update:show"]),setup(o,{emit:s}){const{selectedNodes:i,setSelectedNodes:u,focusedElement:m,cursorPosition:h,focusedNodeIndex:b,preNodeNumber:C}=If(),{inputTypes:x}=z0(),_=f.useModel(o,"show"),{editNodes:N}=EU(),O=J=>{var G;const K=((G=J==null?void 0:J.getDefaultProps)==null?void 0:G.call(J))||{};if(f.toValue(m)&&!xxe(f.toValue(h))){const W=boe(f.toValue(m)),V=f.toValue(h),ge=(f.toValue(C)||0)+1,Qe=e6e(f.toValue(m));W&&V&&V>=0&&N({...Qe,label:J==null?void 0:J.label,nodePath:W,startOffset:V,subNodeSort:ge,textNodeIndex:f.toValue(b)||0,nodeType:J==null?void 0:J.value,props:K})}else if(i){const W=f.toValue(i);if(W!=null&&W.length){const V=W==null?void 0:W.map(ge=>({...ge,label:J==null?void 0:J.label,element:ge==null?void 0:ge.element,nodePath:ge==null?void 0:ge.nodePath,nodeType:J==null?void 0:J.value,props:K}));N(V),u(V)}}_.value=!1},B=f.computed(()=>{const J=[],K=[];return f.toValue(x).forEach(G=>{G.groupName==="system"?K.push({...G,handler:()=>{O(G)}}):J.push({...G,handler:()=>{O(G)}})}),[{label:"限定填写内容",icon:"i-bi:lock",children:J},{label:"插入记录标识",icon:"i-bi:flag",children:K}].filter(G=>{var W;return(W=G==null?void 0:G.children)==null?void 0:W.length})}),H=s,Z=(J,K)=>{J.preventDefault(),K!=null&&K.handler&&K.handler(),K!=null&&K.value&&H("select",K==null?void 0:K.value)};return(J,K)=>f.withDirectives((f.openBlock(),f.createElementBlock("div",{class:"context-menu",style:f.normalizeStyle({...J.style})},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(B.value,G=>(f.openBlock(),f.createElementBlock("div",{key:G==null?void 0:G.label,class:"menu-item"},[f.createElementVNode("div",{class:"menu-item-content",onClick:W=>Z(W,G)},[G!=null&&G.icon?(f.openBlock(),f.createElementBlock("div",_6e,[f.createElementVNode("div",{class:f.normalizeClass(G==null?void 0:G.icon)},null,2)])):f.createCommentVNode("",!0),f.createTextVNode(" "+f.toDisplayString(G.label)+" ",1),G!=null&&G.children?(f.openBlock(),f.createElementBlock("span",k6e,"›")):f.createCommentVNode("",!0)],8,E6e),G!=null&&G.children?(f.openBlock(),f.createElementBlock("div",T6e,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(G.children,W=>(f.openBlock(),f.createElementBlock("div",{key:W.action,class:"menu-item",onClick:V=>Z(V,W)},[W!=null&&W.icon?(f.openBlock(),f.createElementBlock("div",N6e,[f.createElementVNode("div",{class:f.normalizeClass(W==null?void 0:W.icon)},null,2)])):f.createCommentVNode("",!0),f.createTextVNode(" "+f.toDisplayString(W.label),1)],8,A6e))),128))])):f.createCommentVNode("",!0)]))),128))],4)),[[f.vShow,_.value]])}}),$6e=Di(O6e,[["__scopeId","data-v-16c69bc2"]]);function D6e(){const o=f.ref(!1),s=f.ref({left:"0px",top:"0px"}),i=m=>{m.preventDefault(),o.value=!0;const b=m.currentTarget.getBoundingClientRect(),C=m.clientX-b.left,x=m.clientY-b.top,_=118,N=b.width-C<_;s.value={left:N?`${C-_}px`:`${C}px`,top:`${x}px`}},u=m=>{const h=document.querySelector(".context-menu");h&&!h.contains(m.target)&&(o.value=!1)};return f.onMounted(()=>{document.addEventListener("mousedown",u)}),f.onUnmounted(()=>{document.removeEventListener("mousedown",u)}),{showContextMenu:o,contextMenuStyle:s,onContextMenu:i,closeContextMenu:u}}function yfe(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 lne=yfe(),wfe=(...o)=>{const s=o[0],i=o[1];f.onMounted(()=>{lne.on(s,i)}),f.onBeforeUnmount(()=>{lne.off(s)})},Coe=()=>(...s)=>{lne.emit(...s)};let VA=null;function M6e(o){const{onSelected:s}=o,{selectedNodes:i,uiReady:u,setSelectedNodes:m}=If(),h=f.ref("multiple"),b=(x="select")=>{var N,O;let _=[];h.value==="single"?(N=i.value)!=null&&N[0]&&_.push((O=i.value)==null?void 0:O[0]):_=Pa(i.value),VA==null||VA({data:_,type:x}),m(_)};return f.watch(()=>i,()=>{u.value&&(b(),s==null||s(f.toValue(i)))},{deep:!0}),wfe("selectNodes",x=>{const{data:_,callback:N=null,mode:O="multiple"}=x;h.value=O,setTimeout(()=>{m(f.toValue(_)),VA=N},100)}),{onBlur:()=>{VA&&(b("blur"),VA=null,m([]))}}}const R6e={class:"relative"},B6e=f.defineComponent({__name:"index",props:{hasContextMenu:{type:Boolean,default:!1}},setup(o,{expose:s}){const{containerRef:i,uiReady:u}=If(),{nodes:m,modelValue:h}=z0(),b=o,{showContextMenu:C,contextMenuStyle:x,onContextMenu:_}=D6e(),N=f.ref(null),O=K=>{let G=null;if(woe(K))G=mfe(K.nodePath,f.toValue(i)),G&&(G.classList.add("node-item-td"),G.setAttribute("contenteditable","false"),i6e(G));else{const W=document.createElement("span");W.setAttribute("contenteditable","false"),W.classList.add("node-item"),G=W,XMe(K,G,i.value)}return G&&JMe(G,K),G},B=()=>{const K=Oxe(m.value,[G=>G.nodePath,G=>G.textNodeIndex,G=>G.startOffset??-1,G=>G.subNodeSort],["asc","desc","desc","desc"]);K==null||K.forEach(G=>{O(G)})},H=()=>{N.value&&(u.value=!1,f.nextTick(()=>{N.value&&(N.value.innerHTML=f.toValue(h),B(),u.value=!0)}))};f.watch(()=>[m,h,N],()=>{H()},{deep:!0,immediate:!0});const Z=f.ref(),{onBlur:J}=M6e({onSelected:()=>{var K;(K=Z.value)==null||K.focus()}});return s({renderHtml:H}),(K,G)=>(f.openBlock(),f.createElementBlock("div",R6e,[f.createVNode(voe,{onOnBlur:f.unref(J),ref_key:"shadowDomRef",ref:Z},{default:f.withCtx(()=>[f.createElementVNode("html",{class:"nodes-editor",ref_key:"containerRef",ref:i,onContextmenu:G[0]||(G[0]=f.withModifiers((...W)=>f.unref(_)&&f.unref(_)(...W),["prevent"]))},[f.createElementVNode("body",{ref_key:"bodyRef",ref:N},null,512)],544)]),_:1},8,["onOnBlur"]),b!=null&&b.hasContextMenu?(f.openBlock(),f.createBlock($6e,{key:0,show:f.unref(C),"onUpdate:show":G[1]||(G[1]=W=>f.isRef(C)?C.value=W:null),style:f.normalizeStyle(f.unref(x))},null,8,["show","style"])):f.createCommentVNode("",!0)]))}}),Zie={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}},I6e={class:"pagesize"},P6e=f.defineComponent({__name:"index",props:{pagesize:{type:String,default:"A4"}},setup(o){const s=o,i=f.computed(()=>{const u=Zie[s.pagesize]||Zie.A4,m=(window.devicePixelRatio||1)*96;return u.width*m/25.4});return(u,m)=>(f.openBlock(),f.createElementBlock("div",I6e,[f.createElementVNode("div",{style:f.normalizeStyle({width:`${i.value}px`}),class:"pagesize-content"},[f.renderSlot(u.$slots,"default",{},void 0,!0)],4)]))}}),F6e=Di(P6e,[["__scopeId","data-v-46808dfa"]]),Cfe=f.defineComponent({__name:"index",props:f.mergeModels({modelValue:{type:String,default:""},nodes:{type:Array,default:()=>[]},pagesize:{type:String,default:"A4"},renderType:{type:String,default:"preview"},formData:{type:Object,default:()=>({})},inputTypes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},id:{type:String,default:""}},{selectedNodes:{default:[]},selectedNodesModifiers:{}}),emits:f.mergeModels(["update:nodes","update:formData","onSelectedNodes"],["update:selectedNodes"]),setup(o,{expose:s,emit:i}){const u=o,m=i,h=f.useModel(o,"selectedNodes"),b=f.ref(),C=f.ref(null),x=f.ref(),_=f.computed(()=>{switch(u.renderType){case"edit":return v6e;case"select":return y6e;case"preview":return Wie;case"enter":return b6e;default:return Wie}}),N=H=>{m("update:nodes",H)},O=H=>{m("update:formData",H)},B=H=>{m("onSelectedNodes",H)};return s({formRef:{validate:()=>{var H,Z,J;return(J=(Z=(H=b.value)==null?void 0:H.formRef)==null?void 0:Z.validate)==null?void 0:J.call(Z)}},setSelectedNodes:H=>{var Z,J;(J=(Z=x.value)==null?void 0:Z.setSelectedNodes)==null||J.call(Z,H)}}),(H,Z)=>(f.openBlock(),f.createBlock(F6e,{pagesize:o.pagesize},{default:f.withCtx(()=>[f.createVNode(x6e,{ref_key:"UIRef",ref:x,nodes:o.nodes,"onUpdate:nodes":N,selectedNodes:h.value,"onUpdate:selectedNodes":Z[0]||(Z[0]=J=>h.value=J),onOnSelectedNodes:B,nodesGroups:o.nodesGroups,editorId:u==null?void 0:u.id,htmlRenderRef:C.value},{default:f.withCtx(()=>[f.createVNode(w6e,{renderType:o.renderType,"model-value":o.modelValue,nodes:o.nodes,"onUpdate:nodes":N,formData:o.formData,"onUpdate:formData":O,inputTypes:o.inputTypes,editorId:u==null?void 0:u.id},{default:f.withCtx(()=>[f.createVNode(B6e,{hasContextMenu:o.renderType==="edit",ref_key:"htmlRenderRef",ref:C},null,8,["hasContextMenu"]),(f.openBlock(),f.createBlock(f.resolveDynamicComponent(_.value),{renderType:o.renderType,pagesize:o.pagesize,ref_key:"contentRef",ref:b},{nodeItem:f.withCtx(J=>[f.renderSlot(H.$slots,"nodeItem",{node:J==null?void 0:J.node})]),_:3},8,["renderType","pagesize"]))]),_:3},8,["renderType","model-value","nodes","formData","inputTypes","editorId"])]),_:3},8,["nodes","selectedNodes","nodesGroups","editorId","htmlRenderRef"])]),_:3},8,["pagesize"]))}}),L6e={class:"nodes-text"},V6e={key:0,class:"node-text-input"},H6e={key:1,class:"node-text-td"},z6e={key:0,class:"node-text-table-index"},U6e=f.defineComponent({__name:"index",props:f.mergeModels({editorId:{type:String,default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=f.useModel(o,"modelValue"),u=kU(s==null?void 0:s.editorId),m=f.computed(()=>{var b,C,x,_,N,O;if(((b=f.toValue(h))==null?void 0:b.length)>0)if((x=(C=f.toValue(h))==null?void 0:C[0])!=null&&x.element){const B=(N=(_=f.toValue(h))==null?void 0:_[0])==null?void 0:N.element.closest("body").querySelectorAll("table");return((O=Array.from(B))==null?void 0:O.length)===1}else return!0;else return!0}),h=f.computed(()=>{var b;return pfe(i.value,((b=f.toValue(u))==null?void 0:b.renderNodes)||[])});return(b,C)=>(f.openBlock(),f.createElementBlock("div",L6e,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(h.value,(x,_)=>{var N,O,B;return f.openBlock(),f.createElementBlock("div",{key:_,class:"node-text-item"},[(x==null?void 0:x.showTextType)==="input"?(f.openBlock(),f.createElementBlock("span",V6e," 填写"+f.toDisplayString(x==null?void 0:x.inputIndex),1)):(f.openBlock(),f.createElementBlock("span",H6e,[m.value?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("span",z6e,f.toDisplayString(`表${(N=x==null?void 0:x.min)==null?void 0:N.tableIndex}.`),1)),f.createTextVNode(" "+f.toDisplayString(((O=x==null?void 0:x.min)==null?void 0:O.id)===((B=x==null?void 0:x.max)==null?void 0:B.id)?f.unref(t4)(x==null?void 0:x.min):`${f.unref(t4)(x==null?void 0:x.min)}:${f.unref(t4)(x==null?void 0:x.max)}`),1)]))])}),128))]))}}),Gie=Di(U6e,[["__scopeId","data-v-67e3a210"]]);function j6e(o){const{nodes:s,mode:i="multiple"}=o,u=f.ref(!1),m=Coe();return{isSelecting:u,selectNodes:()=>{if(u.value)return!1;u.value=!0,m("selectNodes",{data:f.toValue(s),mode:i,callback:({data:b,type:C})=>{s.value=b,C==="blur"&&(u.value=!1)}})}}}const HA=["#ff9b40","#b36c2d","#7548ff","#5233b3","#649ee5","#aac4ed","#f9ce57","#ae74e8"],kH=f.ref(0),Jx=new Map,W6e={key:0,class:"node-select-small gap-x-2"},Z6e={key:1,class:"text-[#999]"},G6e={key:1,class:"node-select"},q6e={class:"flex py-2 px-2 justify-between items-center noder-select-header"},Y6e={class:"flex gap-2"},K6e={class:"flex gap-1"},X6e=f.defineComponent({__name:"index",props:f.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}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=f.ref((Jx==null?void 0:Jx[s==null?void 0:s.id])||0),u=f.ref((s==null?void 0:s.id)||hE()),m=f.useModel(o,"modelValue"),{selectNodes:h,isSelecting:b}=j6e({nodes:m,mode:s.mode}),C=()=>{m.value=[]},x=f.computed(()=>s.color||(HA==null?void 0:HA[f.toValue(i)%(HA==null?void 0:HA.length)])||"#409eff");return f.onMounted(()=>{Exe(Jx==null?void 0:Jx[s==null?void 0:s.id])&&(s!=null&&s.id)&&(Jx[s==null?void 0:s.id]=kH.value,i.value=kH.value,kH.value=kH.value+1)}),S6e({id:u.value,editorId:s.editorId,nodes:m,activated:b,color:x.value,isOccupy:s.isOccupy}),(_,N)=>{var O;return s.size==="small"?(f.openBlock(),f.createElementBlock("div",W6e,[f.createElementVNode("div",{style:f.normalizeStyle({"--node-color":x.value}),class:"node-color cursor-pointer"},null,4),f.createElementVNode("div",null,f.toDisplayString(s.label),1),f.createElementVNode("div",{style:f.normalizeStyle(f.unref(b)?{color:"#409eff"}:{}),onClick:N[0]||(N[0]=(...B)=>f.unref(h)&&f.unref(h)(...B))},N[6]||(N[6]=[f.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer"},null,-1)]),4),f.createElementVNode("div",{class:"flex items-center flex-wrap gap-1 cursor-pointer",onClick:N[2]||(N[2]=(...B)=>f.unref(h)&&f.unref(h)(...B))},[((O=m.value)==null?void 0:O.length)>0?(f.openBlock(),f.createBlock(Gie,{key:0,modelValue:m.value,"onUpdate:modelValue":N[1]||(N[1]=B=>m.value=B),editorId:o.editorId},null,8,["modelValue","editorId"])):(f.openBlock(),f.createElementBlock("div",Z6e,"未设置"))])])):(f.openBlock(),f.createElementBlock("div",G6e,[f.createElementVNode("div",q6e,[f.createElementVNode("div",Y6e,[f.createElementVNode("div",{style:f.normalizeStyle({"--node-color":x.value}),class:"node-color cursor-pointer"},null,4),f.createElementVNode("div",{style:f.normalizeStyle(f.unref(b)?{color:"#409eff"}:{})},[f.createElementVNode("div",{class:"i-bi:hand-index text-[18px] cursor-pointer",onClick:N[3]||(N[3]=(...B)=>f.unref(h)&&f.unref(h)(...B))})],4),f.createElementVNode("div",null,[f.createElementVNode("div",{class:"i-bi:eraser-fill text-[18px] cursor-pointer",onClick:C})])]),f.createElementVNode("div",K6e,[N[8]||(N[8]=f.createElementVNode("div",{class:"color-[#999]"},"Ctrl+左键多选",-1)),f.createElementVNode("div",null,[f.createVNode(f.unref(Mn.ElPopover),{placement:"top-start",width:200,trigger:"hover",content:"this is content, this is content, this is content"},{reference:f.withCtx(()=>N[7]||(N[7]=[f.createElementVNode("div",{class:"flex flex-center"},[f.createElementVNode("div",{class:"i-bi:info-circle-fill mr-2"}),f.createTextVNode(" 使用帮助 ")],-1)])),_:1})])])]),f.createElementVNode("div",{class:"min-h-[42px] px-2 py-1",onClick:N[5]||(N[5]=(...B)=>f.unref(h)&&f.unref(h)(...B))},[f.createVNode(Gie,{modelValue:m.value,"onUpdate:modelValue":N[4]||(N[4]=B=>m.value=B),editorId:o.editorId},null,8,["modelValue","editorId"])])]))}}}),Sfe=Di(X6e,[["__scopeId","data-v-3de2b0a2"]]);function J6e(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 Q6e(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 eRe(o){const s=kU(o.editorId),i=(b,C)=>{let x=[];const _=Math.min(b.colIndex,C.colIndex),N=Math.max(b.colIndex,C.colIndex),O=Math.min(b.rowIndex,C.rowIndex),B=Math.max(b.rowIndex,C.rowIndex);for(let H=O;H<=B;H++)for(let Z=_;Z<=N;Z++)x.push({colIndex:Z,rowIndex:H});return x},u=b=>{var N;const C=b.includes(":");let x=[];if(C){const[O,B]=b.split(":").map(H=>h(H));x=i(O,B)}else x=[h(b)];return m(x,f.toValue((N=f.toValue(s))==null?void 0:N.nodes))},m=(b,C)=>C==null?void 0:C.filter(x=>{const _=x.nodePath.split(" > ");let N=1,O=1;return _.forEach(B=>{if(B.startsWith("tr")){const H=B.match(/tr(?::nth-child\((\d+)\))?/);H&&H[1]&&(N=parseInt(H[1]))}else if(B.startsWith("td")){const H=B.match(/td(?::nth-child\((\d+)\))?/);H&&(O=H[1]?parseInt(H[1]):1)}}),b.some(B=>N===B.rowIndex+1&&O===B.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 x=C[1].toUpperCase(),_=parseInt(C[2]);let N=0;for(let O=0;O<x.length;O++)N=N*26+(x.charCodeAt(O)-64);return{colIndex:N-1,rowIndex:_}};return{getCellValue:u}}const qie=["#0288D1","#D32F2F","#F57C00","#388E3C","#303F9F","#7B1FA2","#C2185B","#880E4F","#689F38","#5D4037"];function tRe(o,s,i){const u=f.ref(null),m=f.ref(null);function h(){return o.value&&o.value.textContent||""}f.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))}),f.onUnmounted(()=>{o.value&&(u.value&&o.value.removeEventListener("input",u.value),m.value&&o.value.removeEventListener("blur",m.value))});const b=C=>{var x,_,N,O;if(C>=0){const B=window.getSelection();if(B){const H=B.getRangeAt(0),Z=((x=H.startContainer)==null?void 0:x.nodeName)==="#text"?H.startContainer:(N=(_=H.startContainer)==null?void 0:_.childNodes)==null?void 0:N[0],J=Math.min(C,((O=Z.textContent)==null?void 0:O.length)||0);H.setStart(Z,J)}}};return f.watch(()=>[s,o],()=>{var C;o.value&&(xa((C=o.value)==null?void 0:C.textContent,f.toValue(s))||(o.value.textContent=f.toValue(s),b(f.toValue(i))))},{deep:!0,immediate:!0}),{getFormulaContent:h}}function Soe(o){const{element:s,onFocus:i,onBlur:u}=o,m=f.ref(!1),h=()=>{m.value=!0,i==null||i()},b=()=>{m.value=!1,u==null||u()};return f.onMounted(()=>{var C,x;f.toValue(s)&&((C=f.toValue(s))==null||C.addEventListener("focus",h),(x=f.toValue(s))==null||x.addEventListener("blur",b))}),f.onUnmounted(()=>{var C,x;f.toValue(s)&&((C=f.toValue(s))==null||C.removeEventListener("focus",h),(x=f.toValue(s))==null||x.removeEventListener("blur",b))}),m}function nRe(o){const{element:s,showStr:i,editorId:u}=o,m=kU(u),h=Soe({element:s}),b=f.computed(()=>{var C;return(C=i==null?void 0:i.value)==null?void 0:C.filter(x=>["range","cell"].includes(x.type))});return f.watch(()=>h,()=>{var x,_,N,O,B,H;const C=Z=>{var J;Z.preventDefault(),(J=f.toValue(s))==null||J.focus()};f.toValue(h)?((x=f.toValue(m))==null||x.containerRef.addEventListener("click",C),(_=f.toValue(m))==null||_.containerRef.addEventListener("mousedown",C),(N=document.querySelectorAll(".select-function"))==null||N.forEach(Z=>{Z.addEventListener("click",C),Z.addEventListener("mousedown",C)})):((O=f.toValue(m))==null||O.containerRef.removeEventListener("click",C),(B=f.toValue(m))==null||B.containerRef.removeEventListener("mousedown",C),(H=document.querySelectorAll(".select-function"))==null||H.forEach(Z=>{Z.removeEventListener("click",C),Z.removeEventListener("mousedown",C)}))},{deep:!0}),f.watch(()=>[h,b],()=>{var C,x,_,N,O;if((C=f.toValue(m))!=null&&C.containerRef&&((N=(_=(x=f.toValue(m))==null?void 0:x.containerRef)==null?void 0:_.querySelectorAll(".node-formula-cell"))==null||N.forEach(B=>{B.classList.remove("node-formula-cell")}),f.toValue(h))){let B=[];(O=b.value)!=null&&O.length&&(b.value.forEach(H=>{var Z;B=[...B,...((Z=H==null?void 0:H.cellValue)==null?void 0:Z.map(J=>({color:H==null?void 0:H.color,backgroundColor:yoe((H==null?void 0:H.color)||"#000",.1),element:J==null?void 0:J.element})))||[]]}),B.forEach(H=>{var Z;H!=null&&H.element&&((Z=H==null?void 0:H.element)==null||Z.classList.add("node-formula-cell"),H==null||H.element.style.setProperty("--formula-node-color",H==null?void 0:H.color),H==null||H.element.style.setProperty("--formula-node-bg-color",H==null?void 0:H.backgroundColor))}))}},{deep:!0}),h}const oRe=o=>{const{element:s}=o,i=f.ref(-1),u=C=>{const x=C==null?void 0:C.getSelection();try{if(x)return x.getRangeAt(0).startOffset}catch{}return 0},m=()=>{var x;const C=(x=s.value)==null?void 0:x.getRootNode();i.value=u(C)},h=C=>{var O;const x=C.target,_=(O=s.value)==null?void 0:O.getRootNode();i.value=u(_),x.addEventListener("click",m),x.addEventListener("keyup",B=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(B.key)&&m()});const N=()=>{x.removeEventListener("click",m),x.removeEventListener("keyup",m),x.removeEventListener("blur",N),setTimeout(()=>{i.value=-1},300)};x.addEventListener("blur",N)},b=()=>{var C;(C=s.value)==null||C.addEventListener("focus",h,!0)};return f.watch(s,C=>{C&&b()},{immediate:!0}),f.onUnmounted(()=>{var C;(C=s.value)==null||C.removeEventListener("focus",h,!0)}),{startOffset:i}};function sRe(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 rRe=(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},aRe=o=>{const{startOffset:s,showStr:i,value:u,editorId:m,currentItemIndex:h,currentItem:b,element:C}=o,x=kU(m),_=f.ref(-1),N=f.ref(0),O=Soe({element:C}),B=f.ref(!1),H=Coe(),Z=J=>{var K,G;if(f.toValue(B)&&f.toValue(O)&&!xa((K=f.toValue(b))==null?void 0:K.cellValue,J)){const W=a6e(J,((G=f.toValue(x))==null?void 0:G.nodes)||"");let V=W;W&&(f.toValue(N)===0&&(V+=","),f.toValue(_)>=0&&(u.value=sRe(f.toValue(u),f.toValue(_),f.toValue(N),V),N.value=W.length))}};f.watch(()=>h,()=>{var J,K,G,W,V,ge;if((J=x.value)==null||J.setSelectedNodes([]),["range","cell"].includes((K=f.toValue(b))==null?void 0:K.type))return _.value=rRe(i.value,h.value),N.value=(W=(G=f.toValue(b))==null?void 0:G.value)==null?void 0:W.length,B.value=!0,H("selectNodes",{data:(V=f.toValue(b))==null?void 0:V.cellValue,mode:"multiple",callback:({data:Qe})=>{Z(Qe)}}),!1;if([",","(","="].includes((ge=f.toValue(b))==null?void 0:ge.value))return _.value=f.toValue(s),B.value=!0,N.value=0,H("selectNodes",{data:[],mode:"multiple",callback:({data:Qe})=>{Z(Qe)}}),!1;B.value=!1,_.value=-1},{immediate:!0,deep:!0})},iRe=o=>{const{startOffset:s,showStr:i}=o,u=f.ref(-1);f.watch(()=>s,()=>{var h;if(f.toValue(s)<=0)u.value=-1;else{let b=0;for(let C=0;C<i.value.length;C++){const x=i.value[C];if(b+=(h=x==null?void 0:x.value)==null?void 0:h.length,b>=f.toValue(s)){u.value=C;break}}}},{deep:!0,immediate:!0});const m=f.computed(()=>{var h;return(h=f.toValue(i))==null?void 0:h[f.toValue(u)]});return{currentItemIndex:u,currentItem:m}};function lRe(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 cRe=(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},uRe=o=>{const{startOffset:s,showStr:i,value:u,currentItemIndex:m,currentItem:h,element:b}=o,C=f.ref(-1),x=f.ref(0),_=Soe({element:b}),N=f.ref(!1),O=Coe(),B=H=>{var Z;if(f.toValue(N)&&f.toValue(_)&&!xa((Z=f.toValue(h))==null?void 0:Z.value,H)){const J=H,K=J;J&&f.toValue(C)>=0&&(u.value=lRe(f.toValue(u),f.toValue(C),f.toValue(x),K),x.value=J.length)}};f.watch(()=>m,()=>{var H,Z,J,K,G;if(["function"].includes((H=f.toValue(h))==null?void 0:H.type))return C.value=cRe(i.value,m.value),x.value=(J=(Z=f.toValue(h))==null?void 0:Z.value)==null?void 0:J.length,N.value=!0,O("selectFunction",{data:(K=f.toValue(h))==null?void 0:K.value,callback:({data:W})=>{console.log(W),B(W)}}),!1;if([",","(","="].includes((G=f.toValue(h))==null?void 0:G.value))return C.value=f.toValue(s),N.value=!0,x.value=0,O("selectFunction",{data:"",callback:({data:W})=>{console.log(W),B(W)}}),!1;N.value=!1,C.value=-1},{immediate:!0,deep:!0})},dRe={class:"node-formula"},fRe={class:"node-formula-show"},mRe=f.defineComponent({__name:"index",props:f.mergeModels({id:{type:String,default:""},editorId:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,{getCellValue:i}=eRe({editorId:s==null?void 0:s.editorId}),u=f.useModel(o,"modelValue"),m=f.ref(),{startOffset:h}=oRe({element:m});tRe(m,u,h);const b=f.computed(()=>{const N=J6e(u.value);return N==null?void 0:N.map(B=>B.type==="cell"||B.type==="range"?{cellValue:i(B.value),...B}:B)}),C=f.computed(()=>{const N=Q6e(u.value,b.value);let O=-1;return N.map(H=>(H==null?void 0:H.type)==="cell"||(H==null?void 0:H.type)==="range"?(O++,{...H,color:qie[O%qie.length]}):(H==null?void 0:H.type)==="function"?{...H,color:"#0318ff"}:H)});nRe({element:m,showStr:C,editorId:s==null?void 0:s.editorId});const{currentItemIndex:x,currentItem:_}=iRe({element:m,startOffset:h,value:u,showStr:C});return aRe({element:m,startOffset:h,showStr:C,editorId:s==null?void 0:s.editorId,value:u,currentItemIndex:x,currentItem:_}),uRe({element:m,startOffset:h,showStr:C,value:u,currentItemIndex:x,currentItem:_}),(N,O)=>(f.openBlock(),f.createElementBlock("div",dRe,[f.createElementVNode("div",{contenteditable:"true",ref_key:"formulaRef",ref:m,class:"node-formula-input"},null,512),f.createElementVNode("div",fRe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(C.value,(B,H)=>(f.openBlock(),f.createElementBlock("span",{key:H,class:f.normalizeClass(["node-formula-item",`node-formula-item-type-${B==null?void 0:B.type}`,H===f.unref(x)?"node-formula-item-active":""]),style:f.normalizeStyle({"--text-color":(B==null?void 0:B.color)||"#000","--bg-color":f.unref(yoe)((B==null?void 0:B.color)||"#000",.1)})},f.toDisplayString(B.value),7))),128))])]))}}),xfe=Di(mRe,[["__scopeId","data-v-f4b96eb4"]]),pRe=[{label:"平均值",value:"AVERAGE"},{label:"均值绝对偏差",value:"AVEDEV"},{label:"求和",value:"SUM"},{label:"条件判断",value:"IF"},{label:"统计数量",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"正平方根",value:"SQRT"}],gRe={class:"select-function"},hRe=["onClick"],vRe={class:"function-item"},bRe={class:"function-item-desc"},yRe=f.defineComponent({__name:"index",props:f.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=f.computed(()=>{var b;return((b=s.functionList)==null?void 0:b.length)>0?s.functionList:pRe}),m=f.useModel(o,"modelValue"),h=b=>{m.value=b,i==null||i({data:b})};return wfe("selectFunction",({data:b,callback:C})=>{i=C,m.value=b}),(b,C)=>(f.openBlock(),f.createElementBlock("div",gRe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(u.value,(x,_)=>(f.openBlock(),f.createElementBlock("div",{key:_},[f.createElementVNode("div",{onClick:()=>{h(x.value)},class:f.normalizeClass(["function-item-wrapper",{active:m.value===x.value}])},[f.createElementVNode("div",vRe,f.toDisplayString(x.value),1),f.createElementVNode("div",bRe,f.toDisplayString(x.label),1)],10,hRe)]))),128))]))}}),Efe=Di(yRe,[["__scopeId","data-v-6e079ff0"]]),wRe=["innerHTML"],_fe=f.defineComponent({__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue");return(i,u)=>(f.openBlock(),f.createBlock(voe,null,{default:f.withCtx(()=>[f.createElementVNode("div",{innerHTML:s.value},null,8,wRe)]),_:1}))}});function TU(o){return f.getCurrentScope()?(f.onScopeDispose(o),!0):!1}function D0(o){return typeof o=="function"?o():f.unref(o)}const CRe=typeof window<"u"&&typeof document<"u",SRe=o=>typeof o<"u",xRe=Object.prototype.toString,ERe=o=>xRe.call(o)==="[object Object]",_Re=()=>{};function kRe(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 kfe=o=>o();function TRe(o=kfe){const s=f.ref(!0);function i(){s.value=!1}function u(){s.value=!0}const m=(...h)=>{s.value&&o(...h)};return{isActive:f.readonly(s),pause:i,resume:u,eventFilter:m}}function Yie(o,s=!1,i="Timeout"){return new Promise((u,m)=>{setTimeout(s?()=>m(i):u,o)})}function ARe(o,s,i={}){const{eventFilter:u=kfe,...m}=i;return f.watch(o,kRe(u,s),m)}function zA(o,s,i={}){const{eventFilter:u,...m}=i,{eventFilter:h,pause:b,resume:C,isActive:x}=TRe(u);return{stop:ARe(o,s,{...m,eventFilter:h}),pause:b,resume:C,isActive:x}}function NRe(o,s={}){if(!f.isRef(o))return f.toRefs(o);const i=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const u in o.value)i[u]=f.customRef(()=>({get(){return o.value[u]},set(m){var h;if((h=D0(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 cne(o,s=!1){function i(O,{flush:B="sync",deep:H=!1,timeout:Z,throwOnTimeout:J}={}){let K=null;const W=[new Promise(V=>{K=f.watch(o,ge=>{O(ge)!==s&&(K==null||K(),V(ge))},{flush:B,deep:H,immediate:!0})})];return Z!=null&&W.push(Yie(Z,J).then(()=>D0(o)).finally(()=>K==null?void 0:K())),Promise.race(W)}function u(O,B){if(!f.isRef(O))return i(ge=>ge===O,B);const{flush:H="sync",deep:Z=!1,timeout:J,throwOnTimeout:K}=B??{};let G=null;const V=[new Promise(ge=>{G=f.watch([o,O],([Qe,Ne])=>{s!==(Qe===Ne)&&(G==null||G(),ge(Qe))},{flush:H,deep:Z,immediate:!0})})];return J!=null&&V.push(Yie(J,K).then(()=>D0(o)).finally(()=>(G==null||G(),D0(o)))),Promise.race(V)}function m(O){return i(B=>!!B,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 x(O,B){return i(H=>{const Z=Array.from(H);return Z.includes(O)||Z.includes(D0(O))},B)}function _(O){return N(1,O)}function N(O=1,B){let H=-1;return i(()=>(H+=1,H>=O),B)}return Array.isArray(D0(o))?{toMatch:i,toContains:x,changed:_,changedTimes:N,get not(){return cne(o,!s)}}:{toMatch:i,toBe:u,toBeTruthy:m,toBeNull:h,toBeNaN:C,toBeUndefined:b,changed:_,changedTimes:N,get not(){return cne(o,!s)}}}function une(o){return cne(o)}function ORe(o){var s;const i=D0(o);return(s=i==null?void 0:i.$el)!=null?s:i}const Tfe=CRe?window:void 0;function Afe(...o){let s,i,u,m;if(typeof o[0]=="string"||Array.isArray(o[0])?([i,u,m]=o,s=Tfe):[s,i,u,m]=o,!s)return _Re;Array.isArray(i)||(i=[i]),Array.isArray(u)||(u=[u]);const h=[],b=()=>{h.forEach(N=>N()),h.length=0},C=(N,O,B,H)=>(N.addEventListener(O,B,H),()=>N.removeEventListener(O,B,H)),x=f.watch(()=>[ORe(s),D0(m)],([N,O])=>{if(b(),!N)return;const B=ERe(O)?{...O}:O;h.push(...i.flatMap(H=>u.map(Z=>C(N,H,Z,B))))},{immediate:!0,flush:"post"}),_=()=>{x(),b()};return TU(_),_}function $Re(o){return typeof o=="function"?o:typeof o=="string"?s=>s.key===o:Array.isArray(o)?s=>o.includes(s.key):()=>!0}function Kie(...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=Tfe,eventName:h="keydown",passive:b=!1,dedupe:C=!1}=u,x=$Re(s);return Afe(m,h,N=>{N.repeat&&D0(C)||x(N)&&i(N)},b)}function DRe(o){return JSON.parse(JSON.stringify(o))}function ste(o,s,i,u={}){var m,h,b;const{clone:C=!1,passive:x=!1,eventName:_,deep:N=!1,defaultValue:O,shouldEmit:B}=u,H=f.getCurrentInstance(),Z=i||(H==null?void 0:H.emit)||((m=H==null?void 0:H.$emit)==null?void 0:m.bind(H))||((b=(h=H==null?void 0:H.proxy)==null?void 0:h.$emit)==null?void 0:b.bind(H==null?void 0:H.proxy));let J=_;s||(s="modelValue"),J=J||`update:${s.toString()}`;const K=V=>C?typeof C=="function"?C(V):DRe(V):V,G=()=>SRe(o[s])?K(o[s]):O,W=V=>{B?B(V)&&Z(J,V):Z(J,V)};if(x){const V=G(),ge=f.ref(V);let Qe=!1;return f.watch(()=>o[s],Ne=>{Qe||(Qe=!0,ge.value=K(Ne),f.nextTick(()=>Qe=!1))}),f.watch(ge,Ne=>{!Qe&&(Ne!==o[s]||N)&&W(Ne)},{deep:N}),ge}else return f.computed({get(){return G()},set(V){W(V)}})}var MRe={value:()=>{}};function AU(){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 XH(i)}function XH(o){this._=o}function RRe(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}})}XH.prototype=AU.prototype={constructor:XH,on:function(o,s){var i=this._,u=RRe(o+"",i),m,h=-1,b=u.length;if(arguments.length<2){for(;++h<b;)if((m=(o=u[h]).type)&&(m=BRe(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]=Xie(i[m],o.name,s);else if(s==null)for(m in i)i[m]=Xie(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 XH(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 BRe(o,s){for(var i=0,u=o.length,m;i<u;++i)if((m=o[i]).name===s)return m.value}function Xie(o,s,i){for(var u=0,m=o.length;u<m;++u)if(o[u].name===s){o[u]=MRe,o=o.slice(0,u).concat(o.slice(u+1));break}return i!=null&&o.push({name:s,value:i}),o}var dne="http://www.w3.org/1999/xhtml";const Jie={svg:"http://www.w3.org/2000/svg",xhtml:dne,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function NU(o){var s=o+="",i=s.indexOf(":");return i>=0&&(s=o.slice(0,i))!=="xmlns"&&(o=o.slice(i+1)),Jie.hasOwnProperty(s)?{space:Jie[s],local:o}:o}function IRe(o){return function(){var s=this.ownerDocument,i=this.namespaceURI;return i===dne&&s.documentElement.namespaceURI===dne?s.createElement(o):s.createElementNS(i,o)}}function PRe(o){return function(){return this.ownerDocument.createElementNS(o.space,o.local)}}function Nfe(o){var s=NU(o);return(s.local?PRe:IRe)(s)}function FRe(){}function xoe(o){return o==null?FRe:function(){return this.querySelector(o)}}function LRe(o){typeof o!="function"&&(o=xoe(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),x,_,N=0;N<b;++N)(x=h[N])&&(_=o.call(x,x.__data__,N,h))&&("__data__"in x&&(_.__data__=x.__data__),C[N]=_);return new Cp(u,this._parents)}function VRe(o){return o==null?[]:Array.isArray(o)?o:Array.from(o)}function HRe(){return[]}function Ofe(o){return o==null?HRe:function(){return this.querySelectorAll(o)}}function zRe(o){return function(){return VRe(o.apply(this,arguments))}}function URe(o){typeof o=="function"?o=zRe(o):o=Ofe(o);for(var s=this._groups,i=s.length,u=[],m=[],h=0;h<i;++h)for(var b=s[h],C=b.length,x,_=0;_<C;++_)(x=b[_])&&(u.push(o.call(x,x.__data__,_,b)),m.push(x));return new Cp(u,m)}function $fe(o){return function(){return this.matches(o)}}function Dfe(o){return function(s){return s.matches(o)}}var jRe=Array.prototype.find;function WRe(o){return function(){return jRe.call(this.children,o)}}function ZRe(){return this.firstElementChild}function GRe(o){return this.select(o==null?ZRe:WRe(typeof o=="function"?o:Dfe(o)))}var qRe=Array.prototype.filter;function YRe(){return Array.from(this.children)}function KRe(o){return function(){return qRe.call(this.children,o)}}function XRe(o){return this.selectAll(o==null?YRe:KRe(typeof o=="function"?o:Dfe(o)))}function JRe(o){typeof o!="function"&&(o=$fe(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]=[],x,_=0;_<b;++_)(x=h[_])&&o.call(x,x.__data__,_,h)&&C.push(x);return new Cp(u,this._parents)}function Mfe(o){return new Array(o.length)}function QRe(){return new Cp(this._enter||this._groups.map(Mfe),this._parents)}function kz(o,s){this.ownerDocument=o.ownerDocument,this.namespaceURI=o.namespaceURI,this._next=null,this._parent=o,this.__data__=s}kz.prototype={constructor:kz,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 eBe(o){return function(){return o}}function tBe(o,s,i,u,m,h){for(var b=0,C,x=s.length,_=h.length;b<_;++b)(C=s[b])?(C.__data__=h[b],u[b]=C):i[b]=new kz(o,h[b]);for(;b<x;++b)(C=s[b])&&(m[b]=C)}function nBe(o,s,i,u,m,h,b){var C,x,_=new Map,N=s.length,O=h.length,B=new Array(N),H;for(C=0;C<N;++C)(x=s[C])&&(B[C]=H=b.call(x,x.__data__,C,s)+"",_.has(H)?m[C]=x:_.set(H,x));for(C=0;C<O;++C)H=b.call(o,h[C],C,h)+"",(x=_.get(H))?(u[C]=x,x.__data__=h[C],_.delete(H)):i[C]=new kz(o,h[C]);for(C=0;C<N;++C)(x=s[C])&&_.get(B[C])===x&&(m[C]=x)}function oBe(o){return o.__data__}function sBe(o,s){if(!arguments.length)return Array.from(this,oBe);var i=s?nBe:tBe,u=this._parents,m=this._groups;typeof o!="function"&&(o=eBe(o));for(var h=m.length,b=new Array(h),C=new Array(h),x=new Array(h),_=0;_<h;++_){var N=u[_],O=m[_],B=O.length,H=rBe(o.call(N,N&&N.__data__,_,u)),Z=H.length,J=C[_]=new Array(Z),K=b[_]=new Array(Z),G=x[_]=new Array(B);i(N,O,J,K,G,H,s);for(var W=0,V=0,ge,Qe;W<Z;++W)if(ge=J[W]){for(W>=V&&(V=W+1);!(Qe=K[V])&&++V<Z;);ge._next=Qe||null}}return b=new Cp(b,u),b._enter=C,b._exit=x,b}function rBe(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function aBe(){return new Cp(this._exit||this._groups.map(Mfe),this._parents)}function iBe(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 lBe(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),x=0;x<b;++x)for(var _=i[x],N=u[x],O=_.length,B=C[x]=new Array(O),H,Z=0;Z<O;++Z)(H=_[Z]||N[Z])&&(B[Z]=H);for(;x<m;++x)C[x]=i[x];return new Cp(C,this._parents)}function cBe(){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 uBe(o){o||(o=dBe);function s(O,B){return O&&B?o(O.__data__,B.__data__):!O-!B}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,x=m[h]=new Array(C),_,N=0;N<C;++N)(_=b[N])&&(x[N]=_);x.sort(s)}return new Cp(m,this._parents).order()}function dBe(o,s){return o<s?-1:o>s?1:o>=s?0:NaN}function fBe(){var o=arguments[0];return arguments[0]=this,o.apply(null,arguments),this}function mBe(){return Array.from(this)}function pBe(){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 gBe(){let o=0;for(const s of this)++o;return o}function hBe(){return!this.node()}function vBe(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 bBe(o){return function(){this.removeAttribute(o)}}function yBe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function wBe(o,s){return function(){this.setAttribute(o,s)}}function CBe(o,s){return function(){this.setAttributeNS(o.space,o.local,s)}}function SBe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttribute(o):this.setAttribute(o,i)}}function xBe(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 EBe(o,s){var i=NU(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?yBe:bBe:typeof s=="function"?i.local?xBe:SBe:i.local?CBe:wBe)(i,s))}function Rfe(o){return o.ownerDocument&&o.ownerDocument.defaultView||o.document&&o||o.defaultView}function _Be(o){return function(){this.style.removeProperty(o)}}function kBe(o,s,i){return function(){this.style.setProperty(o,s,i)}}function TBe(o,s,i){return function(){var u=s.apply(this,arguments);u==null?this.style.removeProperty(o):this.style.setProperty(o,u,i)}}function ABe(o,s,i){return arguments.length>1?this.each((s==null?_Be:typeof s=="function"?TBe:kBe)(o,s,i??"")):f4(this.node(),o)}function f4(o,s){return o.style.getPropertyValue(s)||Rfe(o).getComputedStyle(o,null).getPropertyValue(s)}function NBe(o){return function(){delete this[o]}}function OBe(o,s){return function(){this[o]=s}}function $Be(o,s){return function(){var i=s.apply(this,arguments);i==null?delete this[o]:this[o]=i}}function DBe(o,s){return arguments.length>1?this.each((s==null?NBe:typeof s=="function"?$Be:OBe)(o,s)):this.node()[o]}function Bfe(o){return o.trim().split(/^|\s+/)}function Eoe(o){return o.classList||new Ife(o)}function Ife(o){this._node=o,this._names=Bfe(o.getAttribute("class")||"")}Ife.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 Pfe(o,s){for(var i=Eoe(o),u=-1,m=s.length;++u<m;)i.add(s[u])}function Ffe(o,s){for(var i=Eoe(o),u=-1,m=s.length;++u<m;)i.remove(s[u])}function MBe(o){return function(){Pfe(this,o)}}function RBe(o){return function(){Ffe(this,o)}}function BBe(o,s){return function(){(s.apply(this,arguments)?Pfe:Ffe)(this,o)}}function IBe(o,s){var i=Bfe(o+"");if(arguments.length<2){for(var u=Eoe(this.node()),m=-1,h=i.length;++m<h;)if(!u.contains(i[m]))return!1;return!0}return this.each((typeof s=="function"?BBe:s?MBe:RBe)(i,s))}function PBe(){this.textContent=""}function FBe(o){return function(){this.textContent=o}}function LBe(o){return function(){var s=o.apply(this,arguments);this.textContent=s??""}}function VBe(o){return arguments.length?this.each(o==null?PBe:(typeof o=="function"?LBe:FBe)(o)):this.node().textContent}function HBe(){this.innerHTML=""}function zBe(o){return function(){this.innerHTML=o}}function UBe(o){return function(){var s=o.apply(this,arguments);this.innerHTML=s??""}}function jBe(o){return arguments.length?this.each(o==null?HBe:(typeof o=="function"?UBe:zBe)(o)):this.node().innerHTML}function WBe(){this.nextSibling&&this.parentNode.appendChild(this)}function ZBe(){return this.each(WBe)}function GBe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function qBe(){return this.each(GBe)}function YBe(o){var s=typeof o=="function"?o:Nfe(o);return this.select(function(){return this.appendChild(s.apply(this,arguments))})}function KBe(){return null}function XBe(o,s){var i=typeof o=="function"?o:Nfe(o),u=s==null?KBe:typeof s=="function"?s:xoe(s);return this.select(function(){return this.insertBefore(i.apply(this,arguments),u.apply(this,arguments)||null)})}function JBe(){var o=this.parentNode;o&&o.removeChild(this)}function QBe(){return this.each(JBe)}function eIe(){var o=this.cloneNode(!1),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function tIe(){var o=this.cloneNode(!0),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function nIe(o){return this.select(o?tIe:eIe)}function oIe(o){return arguments.length?this.property("__data__",o):this.node().__data__}function sIe(o){return function(s){o.call(this,s,this.__data__)}}function rIe(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 aIe(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 iIe(o,s,i){return function(){var u=this.__on,m,h=sIe(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 lIe(o,s,i){var u=rIe(o+""),m,h=u.length,b;if(arguments.length<2){var C=this.node().__on;if(C){for(var x=0,_=C.length,N;x<_;++x)for(m=0,N=C[x];m<h;++m)if((b=u[m]).type===N.type&&b.name===N.name)return N.value}return}for(C=s?iIe:aIe,m=0;m<h;++m)this.each(C(u[m],s,i));return this}function Lfe(o,s,i){var u=Rfe(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 cIe(o,s){return function(){return Lfe(this,o,s)}}function uIe(o,s){return function(){return Lfe(this,o,s.apply(this,arguments))}}function dIe(o,s){return this.each((typeof s=="function"?uIe:cIe)(o,s))}function*fIe(){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 Vfe=[null];function Cp(o,s){this._groups=o,this._parents=s}function AR(){return new Cp([[document.documentElement]],Vfe)}function mIe(){return this}Cp.prototype=AR.prototype={constructor:Cp,select:LRe,selectAll:URe,selectChild:GRe,selectChildren:XRe,filter:JRe,data:sBe,enter:QRe,exit:aBe,join:iBe,merge:lBe,selection:mIe,order:cBe,sort:uBe,call:fBe,nodes:mBe,node:pBe,size:gBe,empty:hBe,each:vBe,attr:EBe,style:ABe,property:DBe,classed:IBe,text:VBe,html:jBe,raise:ZBe,lower:qBe,append:YBe,insert:XBe,remove:QBe,clone:nIe,datum:oIe,on:lIe,dispatch:dIe,[Symbol.iterator]:fIe};function Dh(o){return typeof o=="string"?new Cp([[document.querySelector(o)]],[document.documentElement]):new Cp([[o]],Vfe)}function pIe(o){let s;for(;s=o.sourceEvent;)o=s;return o}function Av(o,s){if(o=pIe(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 gIe={passive:!1},oR={capture:!0,passive:!1};function rte(o){o.stopImmediatePropagation()}function n4(o){o.preventDefault(),o.stopImmediatePropagation()}function Hfe(o){var s=o.document.documentElement,i=Dh(o).on("dragstart.drag",n4,oR);"onselectstart"in s?i.on("selectstart.drag",n4,oR):(s.__noselect=s.style.MozUserSelect,s.style.MozUserSelect="none")}function zfe(o,s){var i=o.document.documentElement,u=Dh(o).on("dragstart.drag",null);s&&(u.on("click.drag",n4,oR),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 TH=o=>()=>o;function fne(o,{sourceEvent:s,subject:i,target:u,identifier:m,active:h,x:b,y:C,dx:x,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:x,enumerable:!0,configurable:!0},dy:{value:_,enumerable:!0,configurable:!0},_:{value:N}})}fne.prototype.on=function(){var o=this._.on.apply(this._,arguments);return o===this._?this:o};function hIe(o){return!o.ctrlKey&&!o.button}function vIe(){return this.parentNode}function bIe(o,s){return s??{x:o.x,y:o.y}}function yIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function wIe(){var o=hIe,s=vIe,i=bIe,u=yIe,m={},h=AU("start","drag","end"),b=0,C,x,_,N,O=0;function B(ge){ge.on("mousedown.drag",H).filter(u).on("touchstart.drag",K).on("touchmove.drag",G,gIe).on("touchend.drag touchcancel.drag",W).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function H(ge,Qe){if(!(N||!o.call(this,ge,Qe))){var Ne=V(this,s.call(this,ge,Qe),ge,Qe,"mouse");Ne&&(Dh(ge.view).on("mousemove.drag",Z,oR).on("mouseup.drag",J,oR),Hfe(ge.view),rte(ge),_=!1,C=ge.clientX,x=ge.clientY,Ne("start",ge))}}function Z(ge){if(n4(ge),!_){var Qe=ge.clientX-C,Ne=ge.clientY-x;_=Qe*Qe+Ne*Ne>O}m.mouse("drag",ge)}function J(ge){Dh(ge.view).on("mousemove.drag mouseup.drag",null),zfe(ge.view,_),n4(ge),m.mouse("end",ge)}function K(ge,Qe){if(o.call(this,ge,Qe)){var Ne=ge.changedTouches,te=s.call(this,ge,Qe),Ue=Ne.length,ut,lt;for(ut=0;ut<Ue;++ut)(lt=V(this,te,ge,Qe,Ne[ut].identifier,Ne[ut]))&&(rte(ge),lt("start",ge,Ne[ut]))}}function G(ge){var Qe=ge.changedTouches,Ne=Qe.length,te,Ue;for(te=0;te<Ne;++te)(Ue=m[Qe[te].identifier])&&(n4(ge),Ue("drag",ge,Qe[te]))}function W(ge){var Qe=ge.changedTouches,Ne=Qe.length,te,Ue;for(N&&clearTimeout(N),N=setTimeout(function(){N=null},500),te=0;te<Ne;++te)(Ue=m[Qe[te].identifier])&&(rte(ge),Ue("end",ge,Qe[te]))}function V(ge,Qe,Ne,te,Ue,ut){var lt=h.copy(),Oe=Av(ut||Ne,Qe),ue,Pt,ye;if((ye=i.call(ge,new fne("beforestart",{sourceEvent:Ne,target:B,identifier:Ue,active:b,x:Oe[0],y:Oe[1],dx:0,dy:0,dispatch:lt}),te))!=null)return ue=ye.x-Oe[0]||0,Pt=ye.y-Oe[1]||0,function De(R,je,be){var ot=Oe,nt;switch(R){case"start":m[Ue]=De,nt=b++;break;case"end":delete m[Ue],--b;case"drag":Oe=Av(be||je,Qe),nt=b;break}lt.call(R,ge,new fne(R,{sourceEvent:je,subject:ye,target:B,identifier:Ue,active:nt,x:Oe[0]+ue,y:Oe[1]+Pt,dx:Oe[0]-ot[0],dy:Oe[1]-ot[1],dispatch:lt}),te)}}return B.filter=function(ge){return arguments.length?(o=typeof ge=="function"?ge:TH(!!ge),B):o},B.container=function(ge){return arguments.length?(s=typeof ge=="function"?ge:TH(ge),B):s},B.subject=function(ge){return arguments.length?(i=typeof ge=="function"?ge:TH(ge),B):i},B.touchable=function(ge){return arguments.length?(u=typeof ge=="function"?ge:TH(!!ge),B):u},B.on=function(){var ge=h.on.apply(h,arguments);return ge===h?B:ge},B.clickDistance=function(ge){return arguments.length?(O=(ge=+ge)*ge,B):Math.sqrt(O)},B}function _oe(o,s,i){o.prototype=s.prototype=i,i.constructor=o}function Ufe(o,s){var i=Object.create(o.prototype);for(var u in s)i[u]=s[u];return i}function NR(){}var sR=.7,Tz=1/sR,o4="\\s*([+-]?\\d+)\\s*",rR="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$v="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",CIe=/^#([0-9a-f]{3,8})$/,SIe=new RegExp(`^rgb\\(${o4},${o4},${o4}\\)$`),xIe=new RegExp(`^rgb\\(${$v},${$v},${$v}\\)$`),EIe=new RegExp(`^rgba\\(${o4},${o4},${o4},${rR}\\)$`),_Ie=new RegExp(`^rgba\\(${$v},${$v},${$v},${rR}\\)$`),kIe=new RegExp(`^hsl\\(${rR},${$v},${$v}\\)$`),TIe=new RegExp(`^hsla\\(${rR},${$v},${$v},${rR}\\)$`),Qie={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};_oe(NR,aR,{copy(o){return Object.assign(new this.constructor,this,o)},displayable(){return this.rgb().displayable()},hex:ele,formatHex:ele,formatHex8:AIe,formatHsl:NIe,formatRgb:tle,toString:tle});function ele(){return this.rgb().formatHex()}function AIe(){return this.rgb().formatHex8()}function NIe(){return jfe(this).formatHsl()}function tle(){return this.rgb().formatRgb()}function aR(o){var s,i;return o=(o+"").trim().toLowerCase(),(s=CIe.exec(o))?(i=s[1].length,s=parseInt(s[1],16),i===6?nle(s):i===3?new Sm(s>>8&15|s>>4&240,s>>4&15|s&240,(s&15)<<4|s&15,1):i===8?AH(s>>24&255,s>>16&255,s>>8&255,(s&255)/255):i===4?AH(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=SIe.exec(o))?new Sm(s[1],s[2],s[3],1):(s=xIe.exec(o))?new Sm(s[1]*255/100,s[2]*255/100,s[3]*255/100,1):(s=EIe.exec(o))?AH(s[1],s[2],s[3],s[4]):(s=_Ie.exec(o))?AH(s[1]*255/100,s[2]*255/100,s[3]*255/100,s[4]):(s=kIe.exec(o))?rle(s[1],s[2]/100,s[3]/100,1):(s=TIe.exec(o))?rle(s[1],s[2]/100,s[3]/100,s[4]):Qie.hasOwnProperty(o)?nle(Qie[o]):o==="transparent"?new Sm(NaN,NaN,NaN,0):null}function nle(o){return new Sm(o>>16&255,o>>8&255,o&255,1)}function AH(o,s,i,u){return u<=0&&(o=s=i=NaN),new Sm(o,s,i,u)}function OIe(o){return o instanceof NR||(o=aR(o)),o?(o=o.rgb(),new Sm(o.r,o.g,o.b,o.opacity)):new Sm}function mne(o,s,i,u){return arguments.length===1?OIe(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}_oe(Sm,mne,Ufe(NR,{brighter(o){return o=o==null?Tz:Math.pow(Tz,o),new Sm(this.r*o,this.g*o,this.b*o,this.opacity)},darker(o){return o=o==null?sR:Math.pow(sR,o),new Sm(this.r*o,this.g*o,this.b*o,this.opacity)},rgb(){return this},clamp(){return new Sm(yE(this.r),yE(this.g),yE(this.b),Az(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:ole,formatHex:ole,formatHex8:$Ie,formatRgb:sle,toString:sle}));function ole(){return`#${uE(this.r)}${uE(this.g)}${uE(this.b)}`}function $Ie(){return`#${uE(this.r)}${uE(this.g)}${uE(this.b)}${uE((isNaN(this.opacity)?1:this.opacity)*255)}`}function sle(){const o=Az(this.opacity);return`${o===1?"rgb(":"rgba("}${yE(this.r)}, ${yE(this.g)}, ${yE(this.b)}${o===1?")":`, ${o})`}`}function Az(o){return isNaN(o)?1:Math.max(0,Math.min(1,o))}function yE(o){return Math.max(0,Math.min(255,Math.round(o)||0))}function uE(o){return o=yE(o),(o<16?"0":"")+o.toString(16)}function rle(o,s,i,u){return u<=0?o=s=i=NaN:i<=0||i>=1?o=s=NaN:s<=0&&(o=NaN),new Mh(o,s,i,u)}function jfe(o){if(o instanceof Mh)return new Mh(o.h,o.s,o.l,o.opacity);if(o instanceof NR||(o=aR(o)),!o)return new Mh;if(o instanceof Mh)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,x=(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/=x<.5?h+m:2-h-m,b*=60):C=x>0&&x<1?0:b,new Mh(b,C,x,o.opacity)}function DIe(o,s,i,u){return arguments.length===1?jfe(o):new Mh(o,s,i,u??1)}function Mh(o,s,i,u){this.h=+o,this.s=+s,this.l=+i,this.opacity=+u}_oe(Mh,DIe,Ufe(NR,{brighter(o){return o=o==null?Tz:Math.pow(Tz,o),new Mh(this.h,this.s,this.l*o,this.opacity)},darker(o){return o=o==null?sR:Math.pow(sR,o),new Mh(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(ate(o>=240?o-240:o+120,m,u),ate(o,m,u),ate(o<120?o+240:o-120,m,u),this.opacity)},clamp(){return new Mh(ale(this.h),NH(this.s),NH(this.l),Az(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=Az(this.opacity);return`${o===1?"hsl(":"hsla("}${ale(this.h)}, ${NH(this.s)*100}%, ${NH(this.l)*100}%${o===1?")":`, ${o})`}`}}));function ale(o){return o=(o||0)%360,o<0?o+360:o}function NH(o){return Math.max(0,Math.min(1,o||0))}function ate(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 Wfe=o=>()=>o;function MIe(o,s){return function(i){return o+i*s}}function RIe(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 BIe(o){return(o=+o)==1?Zfe:function(s,i){return i-s?RIe(s,i,o):Wfe(isNaN(s)?i:s)}}function Zfe(o,s){var i=s-o;return i?MIe(o,i):Wfe(isNaN(o)?s:o)}const ile=function o(s){var i=BIe(s);function u(m,h){var b=i((m=mne(m)).r,(h=mne(h)).r),C=i(m.g,h.g),x=i(m.b,h.b),_=Zfe(m.opacity,h.opacity);return function(N){return m.r=b(N),m.g=C(N),m.b=x(N),m.opacity=_(N),m+""}}return u.gamma=o,u}(1);function s2(o,s){return o=+o,s=+s,function(i){return o*(1-i)+s*i}}var pne=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ite=new RegExp(pne.source,"g");function IIe(o){return function(){return o}}function PIe(o){return function(s){return o(s)+""}}function FIe(o,s){var i=pne.lastIndex=ite.lastIndex=0,u,m,h,b=-1,C=[],x=[];for(o=o+"",s=s+"";(u=pne.exec(o))&&(m=ite.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,x.push({i:b,x:s2(u,m)})),i=ite.lastIndex;return i<s.length&&(h=s.slice(i),C[b]?C[b]+=h:C[++b]=h),C.length<2?x[0]?PIe(x[0].x):IIe(s):(s=x.length,function(_){for(var N=0,O;N<s;++N)C[(O=x[N]).i]=O.x(_);return C.join("")})}var lle=180/Math.PI,gne={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Gfe(o,s,i,u,m,h){var b,C,x;return(b=Math.sqrt(o*o+s*s))&&(o/=b,s/=b),(x=o*i+s*u)&&(i-=o*x,u-=s*x),(C=Math.sqrt(i*i+u*u))&&(i/=C,u/=C,x/=C),o*u<s*i&&(o=-o,s=-s,x=-x,b=-b),{translateX:m,translateY:h,rotate:Math.atan2(s,o)*lle,skewX:Math.atan(x)*lle,scaleX:b,scaleY:C}}var OH;function LIe(o){const s=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(o+"");return s.isIdentity?gne:Gfe(s.a,s.b,s.c,s.d,s.e,s.f)}function VIe(o){return o==null||(OH||(OH=document.createElementNS("http://www.w3.org/2000/svg","g")),OH.setAttribute("transform",o),!(o=OH.transform.baseVal.consolidate()))?gne:(o=o.matrix,Gfe(o.a,o.b,o.c,o.d,o.e,o.f))}function qfe(o,s,i,u){function m(_){return _.length?_.pop()+" ":""}function h(_,N,O,B,H,Z){if(_!==O||N!==B){var J=H.push("translate(",null,s,null,i);Z.push({i:J-4,x:s2(_,O)},{i:J-2,x:s2(N,B)})}else(O||B)&&H.push("translate("+O+s+B+i)}function b(_,N,O,B){_!==N?(_-N>180?N+=360:N-_>180&&(_+=360),B.push({i:O.push(m(O)+"rotate(",null,u)-2,x:s2(_,N)})):N&&O.push(m(O)+"rotate("+N+u)}function C(_,N,O,B){_!==N?B.push({i:O.push(m(O)+"skewX(",null,u)-2,x:s2(_,N)}):N&&O.push(m(O)+"skewX("+N+u)}function x(_,N,O,B,H,Z){if(_!==O||N!==B){var J=H.push(m(H)+"scale(",null,",",null,")");Z.push({i:J-4,x:s2(_,O)},{i:J-2,x:s2(N,B)})}else(O!==1||B!==1)&&H.push(m(H)+"scale("+O+","+B+")")}return function(_,N){var O=[],B=[];return _=o(_),N=o(N),h(_.translateX,_.translateY,N.translateX,N.translateY,O,B),b(_.rotate,N.rotate,O,B),C(_.skewX,N.skewX,O,B),x(_.scaleX,_.scaleY,N.scaleX,N.scaleY,O,B),_=N=null,function(H){for(var Z=-1,J=B.length,K;++Z<J;)O[(K=B[Z]).i]=K.x(H);return O.join("")}}}var HIe=qfe(LIe,"px, ","px)","deg)"),zIe=qfe(VIe,", ",")",")"),UIe=1e-12;function cle(o){return((o=Math.exp(o))+1/o)/2}function jIe(o){return((o=Math.exp(o))-1/o)/2}function WIe(o){return((o=Math.exp(2*o))-1)/(o+1)}const ZIe=function o(s,i,u){function m(h,b){var C=h[0],x=h[1],_=h[2],N=b[0],O=b[1],B=b[2],H=N-C,Z=O-x,J=H*H+Z*Z,K,G;if(J<UIe)G=Math.log(B/_)/s,K=function(te){return[C+te*H,x+te*Z,_*Math.exp(s*te*G)]};else{var W=Math.sqrt(J),V=(B*B-_*_+u*J)/(2*_*i*W),ge=(B*B-_*_-u*J)/(2*B*i*W),Qe=Math.log(Math.sqrt(V*V+1)-V),Ne=Math.log(Math.sqrt(ge*ge+1)-ge);G=(Ne-Qe)/s,K=function(te){var Ue=te*G,ut=cle(Qe),lt=_/(i*W)*(ut*WIe(s*Ue+Qe)-jIe(Qe));return[C+lt*H,x+lt*Z,_*ut/cle(s*Ue+Qe)]}}return K.duration=G*1e3*s/Math.SQRT2,K}return m.rho=function(h){var b=Math.max(.001,+h),C=b*b,x=C*C;return o(b,C,x)},m}(Math.SQRT2,2,4);var m4=0,M6=0,O6=0,Yfe=1e3,Nz,R6,Oz=0,_E=0,OU=0,iR=typeof performance=="object"&&performance.now?performance:Date,Kfe=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(o){setTimeout(o,17)};function koe(){return _E||(Kfe(GIe),_E=iR.now()+OU)}function GIe(){_E=0}function $z(){this._call=this._time=this._next=null}$z.prototype=Xfe.prototype={constructor:$z,restart:function(o,s,i){if(typeof o!="function")throw new TypeError("callback is not a function");i=(i==null?koe():+i)+(s==null?0:+s),!this._next&&R6!==this&&(R6?R6._next=this:Nz=this,R6=this),this._call=o,this._time=i,hne()},stop:function(){this._call&&(this._call=null,this._time=1/0,hne())}};function Xfe(o,s,i){var u=new $z;return u.restart(o,s,i),u}function qIe(){koe(),++m4;for(var o=Nz,s;o;)(s=_E-o._time)>=0&&o._call.call(void 0,s),o=o._next;--m4}function ule(){_E=(Oz=iR.now())+OU,m4=M6=0;try{qIe()}finally{m4=0,KIe(),_E=0}}function YIe(){var o=iR.now(),s=o-Oz;s>Yfe&&(OU-=s,Oz=o)}function KIe(){for(var o,s=Nz,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:Nz=i);R6=o,hne(u)}function hne(o){if(!m4){M6&&(M6=clearTimeout(M6));var s=o-_E;s>24?(o<1/0&&(M6=setTimeout(ule,o-iR.now()-OU)),O6&&(O6=clearInterval(O6))):(O6||(Oz=iR.now(),O6=setInterval(YIe,Yfe)),m4=1,Kfe(ule))}}function dle(o,s,i){var u=new $z;return s=s==null?0:+s,u.restart(m=>{u.stop(),o(m+s)},s,i),u}var XIe=AU("start","end","cancel","interrupt"),JIe=[],Jfe=0,fle=1,vne=2,JH=3,mle=4,bne=5,QH=6;function $U(o,s,i,u,m,h){var b=o.__transition;if(!b)o.__transition={};else if(i in b)return;QIe(o,i,{name:s,index:u,group:m,on:XIe,tween:JIe,time:h.time,delay:h.delay,duration:h.duration,ease:h.ease,timer:null,state:Jfe})}function Toe(o,s){var i=Ih(o,s);if(i.state>Jfe)throw new Error("too late; already scheduled");return i}function Pv(o,s){var i=Ih(o,s);if(i.state>JH)throw new Error("too late; already running");return i}function Ih(o,s){var i=o.__transition;if(!i||!(i=i[s]))throw new Error("transition not found");return i}function QIe(o,s,i){var u=o.__transition,m;u[s]=i,i.timer=Xfe(h,0,i.time);function h(_){i.state=fle,i.timer.restart(b,i.delay,i.time),i.delay<=_&&b(_-i.delay)}function b(_){var N,O,B,H;if(i.state!==fle)return x();for(N in u)if(H=u[N],H.name===i.name){if(H.state===JH)return dle(b);H.state===mle?(H.state=QH,H.timer.stop(),H.on.call("interrupt",o,o.__data__,H.index,H.group),delete u[N]):+N<s&&(H.state=QH,H.timer.stop(),H.on.call("cancel",o,o.__data__,H.index,H.group),delete u[N])}if(dle(function(){i.state===JH&&(i.state=mle,i.timer.restart(C,i.delay,i.time),C(_))}),i.state=vne,i.on.call("start",o,o.__data__,i.index,i.group),i.state===vne){for(i.state=JH,m=new Array(B=i.tween.length),N=0,O=-1;N<B;++N)(H=i.tween[N].value.call(o,o.__data__,i.index,i.group))&&(m[++O]=H);m.length=O+1}}function C(_){for(var N=_<i.duration?i.ease.call(null,_/i.duration):(i.timer.restart(x),i.state=bne,1),O=-1,B=m.length;++O<B;)m[O].call(o,N);i.state===bne&&(i.on.call("end",o,o.__data__,i.index,i.group),x())}function x(){i.state=QH,i.timer.stop(),delete u[s];for(var _ in u)return;delete o.__transition}}function ez(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>vne&&u.state<bne,u.state=QH,u.timer.stop(),u.on.call(m?"interrupt":"cancel",o,o.__data__,u.index,u.group),delete i[b]}h&&delete o.__transition}}function ePe(o){return this.each(function(){ez(this,o)})}function tPe(o,s){var i,u;return function(){var m=Pv(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 nPe(o,s,i){var u,m;if(typeof i!="function")throw new Error;return function(){var h=Pv(this,o),b=h.tween;if(b!==u){m=(u=b).slice();for(var C={name:s,value:i},x=0,_=m.length;x<_;++x)if(m[x].name===s){m[x]=C;break}x===_&&m.push(C)}h.tween=m}}function oPe(o,s){var i=this._id;if(o+="",arguments.length<2){for(var u=Ih(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?tPe:nPe)(i,o,s))}function Aoe(o,s,i){var u=o._id;return o.each(function(){var m=Pv(this,u);(m.value||(m.value={}))[s]=i.apply(this,arguments)}),function(m){return Ih(m,u).value[s]}}function Qfe(o,s){var i;return(typeof s=="number"?s2:s instanceof aR?ile:(i=aR(s))?(s=i,ile):FIe)(o,s)}function sPe(o){return function(){this.removeAttribute(o)}}function rPe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function aPe(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 iPe(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 lPe(o,s,i){var u,m,h;return function(){var b,C=i(this),x;return C==null?void this.removeAttribute(o):(b=this.getAttribute(o),x=C+"",b===x?null:b===u&&x===m?h:(m=x,h=s(u=b,C)))}}function cPe(o,s,i){var u,m,h;return function(){var b,C=i(this),x;return C==null?void this.removeAttributeNS(o.space,o.local):(b=this.getAttributeNS(o.space,o.local),x=C+"",b===x?null:b===u&&x===m?h:(m=x,h=s(u=b,C)))}}function uPe(o,s){var i=NU(o),u=i==="transform"?zIe:Qfe;return this.attrTween(o,typeof s=="function"?(i.local?cPe:lPe)(i,u,Aoe(this,"attr."+o,s)):s==null?(i.local?rPe:sPe)(i):(i.local?iPe:aPe)(i,u,s))}function dPe(o,s){return function(i){this.setAttribute(o,s.call(this,i))}}function fPe(o,s){return function(i){this.setAttributeNS(o.space,o.local,s.call(this,i))}}function mPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&fPe(o,h)),i}return m._value=s,m}function pPe(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 gPe(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=NU(o);return this.tween(i,(u.local?mPe:pPe)(u,s))}function hPe(o,s){return function(){Toe(this,o).delay=+s.apply(this,arguments)}}function vPe(o,s){return s=+s,function(){Toe(this,o).delay=s}}function bPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?hPe:vPe)(s,o)):Ih(this.node(),s).delay}function yPe(o,s){return function(){Pv(this,o).duration=+s.apply(this,arguments)}}function wPe(o,s){return s=+s,function(){Pv(this,o).duration=s}}function CPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?yPe:wPe)(s,o)):Ih(this.node(),s).duration}function SPe(o,s){if(typeof s!="function")throw new Error;return function(){Pv(this,o).ease=s}}function xPe(o){var s=this._id;return arguments.length?this.each(SPe(s,o)):Ih(this.node(),s).ease}function EPe(o,s){return function(){var i=s.apply(this,arguments);if(typeof i!="function")throw new Error;Pv(this,o).ease=i}}function _Pe(o){if(typeof o!="function")throw new Error;return this.each(EPe(this._id,o))}function kPe(o){typeof o!="function"&&(o=$fe(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]=[],x,_=0;_<b;++_)(x=h[_])&&o.call(x,x.__data__,_,h)&&C.push(x);return new F0(u,this._parents,this._name,this._id)}function TPe(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 x=s[C],_=i[C],N=x.length,O=b[C]=new Array(N),B,H=0;H<N;++H)(B=x[H]||_[H])&&(O[H]=B);for(;C<u;++C)b[C]=s[C];return new F0(b,this._parents,this._name,this._id)}function APe(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 NPe(o,s,i){var u,m,h=APe(s)?Toe:Pv;return function(){var b=h(this,o),C=b.on;C!==u&&(m=(u=C).copy()).on(s,i),b.on=m}}function OPe(o,s){var i=this._id;return arguments.length<2?Ih(this.node(),i).on.on(o):this.each(NPe(i,o,s))}function $Pe(o){return function(){var s=this.parentNode;for(var i in this.__transition)if(+i!==o)return;s&&s.removeChild(this)}}function DPe(){return this.on("end.remove",$Pe(this._id))}function MPe(o){var s=this._name,i=this._id;typeof o!="function"&&(o=xoe(o));for(var u=this._groups,m=u.length,h=new Array(m),b=0;b<m;++b)for(var C=u[b],x=C.length,_=h[b]=new Array(x),N,O,B=0;B<x;++B)(N=C[B])&&(O=o.call(N,N.__data__,B,C))&&("__data__"in N&&(O.__data__=N.__data__),_[B]=O,$U(_[B],s,i,B,_,Ih(N,i)));return new F0(h,this._parents,s,i)}function RPe(o){var s=this._name,i=this._id;typeof o!="function"&&(o=Ofe(o));for(var u=this._groups,m=u.length,h=[],b=[],C=0;C<m;++C)for(var x=u[C],_=x.length,N,O=0;O<_;++O)if(N=x[O]){for(var B=o.call(N,N.__data__,O,x),H,Z=Ih(N,i),J=0,K=B.length;J<K;++J)(H=B[J])&&$U(H,s,i,J,B,Z);h.push(B),b.push(N)}return new F0(h,b,s,i)}var BPe=AR.prototype.constructor;function IPe(){return new BPe(this._groups,this._parents)}function PPe(o,s){var i,u,m;return function(){var h=f4(this,o),b=(this.style.removeProperty(o),f4(this,o));return h===b?null:h===i&&b===u?m:m=s(i=h,u=b)}}function eme(o){return function(){this.style.removeProperty(o)}}function FPe(o,s,i){var u,m=i+"",h;return function(){var b=f4(this,o);return b===m?null:b===u?h:h=s(u=b,i)}}function LPe(o,s,i){var u,m,h;return function(){var b=f4(this,o),C=i(this),x=C+"";return C==null&&(x=C=(this.style.removeProperty(o),f4(this,o))),b===x?null:b===u&&x===m?h:(m=x,h=s(u=b,C))}}function VPe(o,s){var i,u,m,h="style."+s,b="end."+h,C;return function(){var x=Pv(this,o),_=x.on,N=x.value[h]==null?C||(C=eme(s)):void 0;(_!==i||m!==N)&&(u=(i=_).copy()).on(b,m=N),x.on=u}}function HPe(o,s,i){var u=(o+="")=="transform"?HIe:Qfe;return s==null?this.styleTween(o,PPe(o,u)).on("end.style."+o,eme(o)):typeof s=="function"?this.styleTween(o,LPe(o,u,Aoe(this,"style."+o,s))).each(VPe(this._id,o)):this.styleTween(o,FPe(o,u,s),i).on("end.style."+o,null)}function zPe(o,s,i){return function(u){this.style.setProperty(o,s.call(this,u),i)}}function UPe(o,s,i){var u,m;function h(){var b=s.apply(this,arguments);return b!==m&&(u=(m=b)&&zPe(o,b,i)),u}return h._value=s,h}function jPe(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,UPe(o,s,i??""))}function WPe(o){return function(){this.textContent=o}}function ZPe(o){return function(){var s=o(this);this.textContent=s??""}}function GPe(o){return this.tween("text",typeof o=="function"?ZPe(Aoe(this,"text",o)):WPe(o==null?"":o+""))}function qPe(o){return function(s){this.textContent=o.call(this,s)}}function YPe(o){var s,i;function u(){var m=o.apply(this,arguments);return m!==i&&(s=(i=m)&&qPe(m)),s}return u._value=o,u}function KPe(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,YPe(o))}function XPe(){for(var o=this._name,s=this._id,i=tme(),u=this._groups,m=u.length,h=0;h<m;++h)for(var b=u[h],C=b.length,x,_=0;_<C;++_)if(x=b[_]){var N=Ih(x,s);$U(x,o,i,_,b,{time:N.time+N.delay+N.duration,delay:0,duration:N.duration,ease:N.ease})}return new F0(u,this._parents,o,i)}function JPe(){var o,s,i=this,u=i._id,m=i.size();return new Promise(function(h,b){var C={value:b},x={value:function(){--m===0&&h()}};i.each(function(){var _=Pv(this,u),N=_.on;N!==o&&(s=(o=N).copy(),s._.cancel.push(C),s._.interrupt.push(C),s._.end.push(x)),_.on=s}),m===0&&h()})}var QPe=0;function F0(o,s,i,u){this._groups=o,this._parents=s,this._name=i,this._id=u}function tme(){return++QPe}var N0=AR.prototype;F0.prototype={constructor:F0,select:MPe,selectAll:RPe,selectChild:N0.selectChild,selectChildren:N0.selectChildren,filter:kPe,merge:TPe,selection:IPe,transition:XPe,call:N0.call,nodes:N0.nodes,node:N0.node,size:N0.size,empty:N0.empty,each:N0.each,on:OPe,attr:uPe,attrTween:gPe,style:HPe,styleTween:jPe,text:GPe,textTween:KPe,remove:DPe,tween:oPe,delay:bPe,duration:CPe,ease:xPe,easeVarying:_Pe,end:JPe,[Symbol.iterator]:N0[Symbol.iterator]};function e8e(o){return((o*=2)<=1?o*o*o:(o-=2)*o*o+2)/2}var t8e={time:null,delay:0,duration:250,ease:e8e};function n8e(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 o8e(o){var s,i;o instanceof F0?(s=o._id,o=o._name):(s=tme(),(i=t8e).time=koe(),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,x,_=0;_<C;++_)(x=b[_])&&$U(x,o,s,_,b,i||n8e(x,s));return new F0(u,this._parents,o,s)}AR.prototype.interrupt=ePe;AR.prototype.transition=o8e;const $H=o=>()=>o;function s8e(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 R0(o,s,i){this.k=o,this.x=s,this.y=i}R0.prototype={constructor:R0,scale:function(o){return o===1?this:new R0(this.k*o,this.x,this.y)},translate:function(o,s){return o===0&s===0?this:new R0(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 p4=new R0(1,0,0);R0.prototype;function lte(o){o.stopImmediatePropagation()}function $6(o){o.preventDefault(),o.stopImmediatePropagation()}function r8e(o){return(!o.ctrlKey||o.type==="wheel")&&!o.button}function a8e(){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 ple(){return this.__zoom||p4}function i8e(o){return-o.deltaY*(o.deltaMode===1?.05:o.deltaMode?1:.002)*(o.ctrlKey?10:1)}function l8e(){return navigator.maxTouchPoints||"ontouchstart"in this}function c8e(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 u8e(){var o=r8e,s=a8e,i=c8e,u=i8e,m=l8e,h=[0,1/0],b=[[-1/0,-1/0],[1/0,1/0]],C=250,x=ZIe,_=AU("start","zoom","end"),N,O,B,H=500,Z=150,J=0,K=10;function G(ye){ye.property("__zoom",ple).on("wheel.zoom",Ue,{passive:!1}).on("mousedown.zoom",ut).on("dblclick.zoom",lt).filter(m).on("touchstart.zoom",Oe).on("touchmove.zoom",ue).on("touchend.zoom touchcancel.zoom",Pt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}G.transform=function(ye,De,R,je){var be=ye.selection?ye.selection():ye;be.property("__zoom",ple),ye!==be?Qe(ye,De,R,je):be.interrupt().each(function(){Ne(this,arguments).event(je).start().zoom(null,typeof De=="function"?De.apply(this,arguments):De).end()})},G.scaleBy=function(ye,De,R,je){G.scaleTo(ye,function(){var be=this.__zoom.k,ot=typeof De=="function"?De.apply(this,arguments):De;return be*ot},R,je)},G.scaleTo=function(ye,De,R,je){G.transform(ye,function(){var be=s.apply(this,arguments),ot=this.__zoom,nt=R==null?ge(be):typeof R=="function"?R.apply(this,arguments):R,pe=ot.invert(nt),Ze=typeof De=="function"?De.apply(this,arguments):De;return i(V(W(ot,Ze),nt,pe),be,b)},R,je)},G.translateBy=function(ye,De,R,je){G.transform(ye,function(){return i(this.__zoom.translate(typeof De=="function"?De.apply(this,arguments):De,typeof R=="function"?R.apply(this,arguments):R),s.apply(this,arguments),b)},null,je)},G.translateTo=function(ye,De,R,je,be){G.transform(ye,function(){var ot=s.apply(this,arguments),nt=this.__zoom,pe=je==null?ge(ot):typeof je=="function"?je.apply(this,arguments):je;return i(p4.translate(pe[0],pe[1]).scale(nt.k).translate(typeof De=="function"?-De.apply(this,arguments):-De,typeof R=="function"?-R.apply(this,arguments):-R),ot,b)},je,be)};function W(ye,De){return De=Math.max(h[0],Math.min(h[1],De)),De===ye.k?ye:new R0(De,ye.x,ye.y)}function V(ye,De,R){var je=De[0]-R[0]*ye.k,be=De[1]-R[1]*ye.k;return je===ye.x&&be===ye.y?ye:new R0(ye.k,je,be)}function ge(ye){return[(+ye[0][0]+ +ye[1][0])/2,(+ye[0][1]+ +ye[1][1])/2]}function Qe(ye,De,R,je){ye.on("start.zoom",function(){Ne(this,arguments).event(je).start()}).on("interrupt.zoom end.zoom",function(){Ne(this,arguments).event(je).end()}).tween("zoom",function(){var be=this,ot=arguments,nt=Ne(be,ot).event(je),pe=s.apply(be,ot),Ze=R==null?ge(pe):typeof R=="function"?R.apply(be,ot):R,Tt=Math.max(pe[1][0]-pe[0][0],pe[1][1]-pe[0][1]),He=be.__zoom,vt=typeof De=="function"?De.apply(be,ot):De,Be=x(He.invert(Ze).concat(Tt/He.k),vt.invert(Ze).concat(Tt/vt.k));return function(ft){if(ft===1)ft=vt;else{var oe=Be(ft),pn=Tt/oe[2];ft=new R0(pn,Ze[0]-oe[0]*pn,Ze[1]-oe[1]*pn)}nt.zoom(null,ft)}})}function Ne(ye,De,R){return!R&&ye.__zooming||new te(ye,De)}function te(ye,De){this.that=ye,this.args=De,this.active=0,this.sourceEvent=null,this.extent=s.apply(ye,De),this.taps=0}te.prototype={event:function(ye){return ye&&(this.sourceEvent=ye),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(ye,De){return this.mouse&&ye!=="mouse"&&(this.mouse[1]=De.invert(this.mouse[0])),this.touch0&&ye!=="touch"&&(this.touch0[1]=De.invert(this.touch0[0])),this.touch1&&ye!=="touch"&&(this.touch1[1]=De.invert(this.touch1[0])),this.that.__zoom=De,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(ye){var De=Dh(this.that).datum();_.call(ye,this.that,new s8e(ye,{sourceEvent:this.sourceEvent,target:G,type:ye,transform:this.that.__zoom,dispatch:_}),De)}};function Ue(ye,...De){if(!o.apply(this,arguments))return;var R=Ne(this,De).event(ye),je=this.__zoom,be=Math.max(h[0],Math.min(h[1],je.k*Math.pow(2,u.apply(this,arguments)))),ot=Av(ye);if(R.wheel)(R.mouse[0][0]!==ot[0]||R.mouse[0][1]!==ot[1])&&(R.mouse[1]=je.invert(R.mouse[0]=ot)),clearTimeout(R.wheel);else{if(je.k===be)return;R.mouse=[ot,je.invert(ot)],ez(this),R.start()}$6(ye),R.wheel=setTimeout(nt,Z),R.zoom("mouse",i(V(W(je,be),R.mouse[0],R.mouse[1]),R.extent,b));function nt(){R.wheel=null,R.end()}}function ut(ye,...De){if(B||!o.apply(this,arguments))return;var R=ye.currentTarget,je=Ne(this,De,!0).event(ye),be=Dh(ye.view).on("mousemove.zoom",Ze,!0).on("mouseup.zoom",Tt,!0),ot=Av(ye,R),nt=ye.clientX,pe=ye.clientY;Hfe(ye.view),lte(ye),je.mouse=[ot,this.__zoom.invert(ot)],ez(this),je.start();function Ze(He){if($6(He),!je.moved){var vt=He.clientX-nt,Be=He.clientY-pe;je.moved=vt*vt+Be*Be>J}je.event(He).zoom("mouse",i(V(je.that.__zoom,je.mouse[0]=Av(He,R),je.mouse[1]),je.extent,b))}function Tt(He){be.on("mousemove.zoom mouseup.zoom",null),zfe(He.view,je.moved),$6(He),je.event(He).end()}}function lt(ye,...De){if(o.apply(this,arguments)){var R=this.__zoom,je=Av(ye.changedTouches?ye.changedTouches[0]:ye,this),be=R.invert(je),ot=R.k*(ye.shiftKey?.5:2),nt=i(V(W(R,ot),je,be),s.apply(this,De),b);$6(ye),C>0?Dh(this).transition().duration(C).call(Qe,nt,je,ye):Dh(this).call(G.transform,nt,je,ye)}}function Oe(ye,...De){if(o.apply(this,arguments)){var R=ye.touches,je=R.length,be=Ne(this,De,ye.changedTouches.length===je).event(ye),ot,nt,pe,Ze;for(lte(ye),nt=0;nt<je;++nt)pe=R[nt],Ze=Av(pe,this),Ze=[Ze,this.__zoom.invert(Ze),pe.identifier],be.touch0?!be.touch1&&be.touch0[2]!==Ze[2]&&(be.touch1=Ze,be.taps=0):(be.touch0=Ze,ot=!0,be.taps=1+!!N);N&&(N=clearTimeout(N)),ot&&(be.taps<2&&(O=Ze[0],N=setTimeout(function(){N=null},H)),ez(this),be.start())}}function ue(ye,...De){if(this.__zooming){var R=Ne(this,De).event(ye),je=ye.changedTouches,be=je.length,ot,nt,pe,Ze;for($6(ye),ot=0;ot<be;++ot)nt=je[ot],pe=Av(nt,this),R.touch0&&R.touch0[2]===nt.identifier?R.touch0[0]=pe:R.touch1&&R.touch1[2]===nt.identifier&&(R.touch1[0]=pe);if(nt=R.that.__zoom,R.touch1){var Tt=R.touch0[0],He=R.touch0[1],vt=R.touch1[0],Be=R.touch1[1],ft=(ft=vt[0]-Tt[0])*ft+(ft=vt[1]-Tt[1])*ft,oe=(oe=Be[0]-He[0])*oe+(oe=Be[1]-He[1])*oe;nt=W(nt,Math.sqrt(ft/oe)),pe=[(Tt[0]+vt[0])/2,(Tt[1]+vt[1])/2],Ze=[(He[0]+Be[0])/2,(He[1]+Be[1])/2]}else if(R.touch0)pe=R.touch0[0],Ze=R.touch0[1];else return;R.zoom("touch",i(V(nt,pe,Ze),R.extent,b))}}function Pt(ye,...De){if(this.__zooming){var R=Ne(this,De).event(ye),je=ye.changedTouches,be=je.length,ot,nt;for(lte(ye),B&&clearTimeout(B),B=setTimeout(function(){B=null},H),ot=0;ot<be;++ot)nt=je[ot],R.touch0&&R.touch0[2]===nt.identifier?delete R.touch0:R.touch1&&R.touch1[2]===nt.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(nt=Av(nt,this),Math.hypot(O[0]-nt[0],O[1]-nt[1])<K)){var pe=Dh(this).on("dblclick.zoom");pe&&pe.apply(this,arguments)}}}return G.wheelDelta=function(ye){return arguments.length?(u=typeof ye=="function"?ye:$H(+ye),G):u},G.filter=function(ye){return arguments.length?(o=typeof ye=="function"?ye:$H(!!ye),G):o},G.touchable=function(ye){return arguments.length?(m=typeof ye=="function"?ye:$H(!!ye),G):m},G.extent=function(ye){return arguments.length?(s=typeof ye=="function"?ye:$H([[+ye[0][0],+ye[0][1]],[+ye[1][0],+ye[1][1]]]),G):s},G.scaleExtent=function(ye){return arguments.length?(h[0]=+ye[0],h[1]=+ye[1],G):[h[0],h[1]]},G.translateExtent=function(ye){return arguments.length?(b[0][0]=+ye[0][0],b[1][0]=+ye[1][0],b[0][1]=+ye[0][1],b[1][1]=+ye[1][1],G):[[b[0][0],b[0][1]],[b[1][0],b[1][1]]]},G.constrain=function(ye){return arguments.length?(i=ye,G):i},G.duration=function(ye){return arguments.length?(C=+ye,G):C},G.interpolate=function(ye){return arguments.length?(x=ye,G):x},G.on=function(){var ye=_.on.apply(_,arguments);return ye===_?G:ye},G.clickDistance=function(ye){return arguments.length?(J=(ye=+ye)*ye,G):Math.sqrt(J)},G.tapDistance=function(ye){return arguments.length?(K=+ye,G):K},G}var ss=(o=>(o.Left="left",o.Top="top",o.Right="right",o.Bottom="bottom",o))(ss||{}),Noe=(o=>(o.Partial="partial",o.Full="full",o))(Noe||{}),rE=(o=>(o.Bezier="default",o.SimpleBezier="simple-bezier",o.Straight="straight",o.Step="step",o.SmoothStep="smoothstep",o))(rE||{}),m2=(o=>(o.Strict="strict",o.Loose="loose",o))(m2||{}),Dz=(o=>(o.Arrow="arrow",o.ArrowClosed="arrowclosed",o))(Dz||{}),j6=(o=>(o.Free="free",o.Vertical="vertical",o.Horizontal="horizontal",o))(j6||{}),nme=(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))(nme||{});const d8e=["INPUT","SELECT","TEXTAREA"];function yne(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 f8e(o){return o.ctrlKey||o.metaKey||o.shiftKey||o.altKey}function gle(o,s,i,u){const m=s.replace("+",`
116
116
  `).replace(`
117
117
 
118
118
  `,`