@zyui/components 0.0.49 → 0.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.js +3 -3
- package/es/index.mjs +605 -584
- package/es/style.css +1 -1
- 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"),Nn=require("element-plus"),Rge="0.0.49";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,xee=(o,s,i)=>Ige(o,typeof s!="symbol"?s+"":s,i);function kce(o,s){return function(){return o.apply(s,arguments)}}const{toString:Pge}=Object.prototype,{getPrototypeOf:Rne}=Object,Uz=(o=>s=>{const i=Pge.call(s);return o[i]||(o[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Bh=o=>(o=o.toLowerCase(),s=>Uz(s)===o),jz=o=>s=>typeof s===o,{isArray:v4}=Array,KM=jz("undefined");function Fge(o){return o!==null&&!KM(o)&&o.constructor!==null&&!KM(o.constructor)&&wp(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const Tce=Bh("ArrayBuffer");function Lge(o){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(o):s=o&&o.buffer&&Tce(o.buffer),s}const Vge=jz("string"),wp=jz("function"),Ace=jz("number"),Wz=o=>o!==null&&typeof o=="object",Hge=o=>o===!0||o===!1,HH=o=>{if(Uz(o)!=="object")return!1;const s=Rne(o);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)},zge=Bh("Date"),Uge=Bh("File"),jge=Bh("Blob"),Wge=Bh("FileList"),Zge=o=>Wz(o)&&wp(o.pipe),Gge=o=>{let s;return o&&(typeof FormData=="function"&&o instanceof FormData||wp(o.append)&&((s=Uz(o))==="formdata"||s==="object"&&wp(o.toString)&&o.toString()==="[object FormData]"))},qge=Bh("URLSearchParams"),[Yge,Kge,Xge,Jge]=["ReadableStream","Request","Response","Headers"].map(Bh),Qge=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function cR(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 Nce(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 cE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Oce=o=>!KM(o)&&o!==cE;function Bte(){const{caseless:o}=Oce(this)&&this||{},s={},i=(u,m)=>{const h=o&&Nce(s,m)||m;HH(s[h])&&HH(u)?s[h]=Bte(s[h],u):HH(u)?s[h]=Bte({},u):v4(u)?s[h]=u.slice():s[h]=u};for(let u=0,m=arguments.length;u<m;u++)arguments[u]&&cR(arguments[u],i);return s}const ehe=(o,s,i,{allOwnKeys:u}={})=>(cR(s,(m,h)=>{i&&wp(m)?o[h]=kce(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&&Rne(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(!Ace(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"&&Rne(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=Bh("HTMLFormElement"),uhe=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,i,u){return i.toUpperCase()+u}),Nre=(({hasOwnProperty:o})=>(s,i)=>o.call(s,i))(Object.prototype),dhe=Bh("RegExp"),$ce=(o,s)=>{const i=Object.getOwnPropertyDescriptors(o),u={};cR(i,(m,h)=>{let b;(b=s(m,h,o))!==!1&&(u[h]=b||m)}),Object.defineProperties(o,u)},fhe=o=>{$ce(o,(s,i)=>{if(wp(o)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const u=o[i];if(wp(u)){if(s.enumerable=!1,"writable"in s){s.writable=!1;return}s.set||(s.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},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,Eee="abcdefghijklmnopqrstuvwxyz",Ore="0123456789",Dce={DIGIT:Ore,ALPHA:Eee,ALPHA_DIGIT:Eee+Eee.toUpperCase()+Ore},hhe=(o=16,s=Dce.ALPHA_DIGIT)=>{let i="";const{length:u}=s;for(;o--;)i+=s[Math.random()*u|0];return i};function vhe(o){return!!(o&&wp(o.append)&&o[Symbol.toStringTag]==="FormData"&&o[Symbol.iterator])}const bhe=o=>{const s=new Array(10),i=(u,m)=>{if(Wz(u)){if(s.indexOf(u)>=0)return;if(!("toJSON"in u)){s[m]=u;const h=v4(u)?[]:{};return cR(u,(b,C)=>{const x=i(b,m+1);!KM(x)&&(h[C]=x)}),s[m]=void 0,h}}return u};return i(o,0)},yhe=Bh("AsyncFunction"),whe=o=>o&&(Wz(o)||wp(o))&&wp(o.then)&&wp(o.catch),Mce=((o,s)=>o?setImmediate:s?((i,u)=>(cE.addEventListener("message",({source:m,data:h})=>{m===cE&&h===i&&u.length&&u.shift()()},!1),m=>{u.push(m),cE.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",wp(cE.postMessage)),Che=typeof queueMicrotask<"u"?queueMicrotask.bind(cE):typeof process<"u"&&process.nextTick||Mce,Rn={isArray:v4,isArrayBuffer:Tce,isBuffer:Fge,isFormData:Gge,isArrayBufferView:Lge,isString:Vge,isNumber:Ace,isBoolean:Hge,isObject:Wz,isPlainObject:HH,isReadableStream:Yge,isRequest:Kge,isResponse:Xge,isHeaders:Jge,isUndefined:KM,isDate:zge,isFile:Uge,isBlob:jge,isRegExp:dhe,isFunction:wp,isStream:Zge,isURLSearchParams:qge,isTypedArray:ahe,isFileList:Wge,forEach:cR,merge:Bte,extend:ehe,trim:Qge,stripBOM:the,inherits:nhe,toFlatObject:ohe,kindOf:Uz,kindOfTest:Bh,endsWith:she,toArray:rhe,forEachEntry:ihe,matchAll:lhe,isHTMLForm:che,hasOwnProperty:Nre,hasOwnProp:Nre,reduceDescriptors:$ce,freezeMethods:fhe,toObjectSet:mhe,toCamelCase:uhe,noop:phe,toFiniteNumber:ghe,findKey:Nce,global:cE,isContextDefined:Oce,ALPHABET:Dce,generateString:hhe,isSpecCompliantForm:vhe,toJSONObject:bhe,isAsyncFn:yhe,isThenable:whe,setImmediate:Mce,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 Rce=Er.prototype,Bce={};["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=>{Bce[o]={value:o}});Object.defineProperties(Er,Bce);Object.defineProperty(Rce,"isAxiosError",{value:!0});Er.from=(o,s,i,u,m,h)=>{const b=Object.create(Rce);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 Ite(o){return Rn.isPlainObject(o)||Rn.isArray(o)}function Ice(o){return Rn.endsWith(o,"[]")?o.slice(0,-2):o}function $re(o,s,i){return o?o.concat(s).map(function(u,m){return u=Ice(u),!i&&m?"["+u+"]":u}).join(i?".":""):s}function xhe(o){return Rn.isArray(o)&&!o.some(Ite)}const Ehe=Rn.toFlatObject(Rn,{},null,function(o){return/^is[A-Z]/.test(o)});function Zz(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(F,Z){return!Rn.isUndefined(Z[F])});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(F){if(F===null)return"";if(Rn.isDate(F))return F.toISOString();if(!C&&Rn.isBlob(F))throw new Er("Blob is not supported. Use a Buffer instead.");return Rn.isArrayBuffer(F)||Rn.isTypedArray(F)?C&&typeof Blob=="function"?new Blob([F]):Buffer.from(F):F}function _(F,Z,K){let X=F;if(F&&!K&&typeof F=="object"){if(Rn.endsWith(Z,"{}"))Z=u?Z:Z.slice(0,-2),F=JSON.stringify(F);else if(Rn.isArray(F)&&xhe(F)||(Rn.isFileList(F)||Rn.endsWith(Z,"[]"))&&(X=Rn.toArray(F)))return Z=Ice(Z),X.forEach(function(q,W){!(Rn.isUndefined(q)||q===null)&&s.append(b===!0?$re([Z],W,h):b===null?Z:Z+"[]",x(q))}),!1}return Ite(F)?!0:(s.append($re(K,Z,h),x(F)),!1)}const N=[],O=Object.assign(Ehe,{defaultVisitor:_,convertValue:x,isVisitable:Ite});function B(F,Z){if(!Rn.isUndefined(F)){if(N.indexOf(F)!==-1)throw Error("Circular reference detected in "+Z.join("."));N.push(F),Rn.forEach(F,function(K,X){(!(Rn.isUndefined(K)||K===null)&&m.call(s,K,Rn.isString(X)?X.trim():X,Z,O))===!0&&B(K,Z?Z.concat(X):[X])}),N.pop()}}if(!Rn.isObject(o))throw new TypeError("data must be an object");return B(o),s}function Dre(o){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(i){return s[i]})}function Bne(o,s){this._pairs=[],o&&Zz(o,this,s)}const Pce=Bne.prototype;Pce.append=function(o,s){this._pairs.push([o,s])};Pce.toString=function(o){const s=o?function(i){return o.call(this,i,Dre)}:Dre;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 Fce(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 Bne(s,i).toString(u),h){const b=o.indexOf("#");b!==-1&&(o=o.slice(0,b)),o+=(o.indexOf("?")===-1?"?":"&")+h}return o}let Mre=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 Lce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},khe=typeof URLSearchParams<"u"?URLSearchParams:Bne,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"]},Ine=typeof window<"u"&&typeof document<"u",Pte=typeof navigator=="object"&&navigator||void 0,Ohe=Ine&&(!Pte||["ReactNative","NativeScript","NS"].indexOf(Pte.product)<0),$he=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Dhe=Ine&&window.location.href||"http://localhost",Mhe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ine,hasStandardBrowserEnv:Ohe,hasStandardBrowserWebWorkerEnv:$he,navigator:Pte,origin:Dhe},Symbol.toStringTag,{value:"Module"})),Xd={...Mhe,...Nhe};function Rhe(o,s){return Zz(o,new Xd.classes.URLSearchParams,Object.assign({visitor:function(i,u,m,h){return Xd.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 Vce(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 uR={transitional:Lce,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(Vce(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 Zz(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||uR.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:Xd.classes.FormData,Blob:Xd.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=>{uR.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"),Nn=require("element-plus"),Rge="0.0.50";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,xee=(o,s,i)=>Ige(o,typeof s!="symbol"?s+"":s,i);function kce(o,s){return function(){return o.apply(s,arguments)}}const{toString:Pge}=Object.prototype,{getPrototypeOf:Rne}=Object,Uz=(o=>s=>{const i=Pge.call(s);return o[i]||(o[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Bh=o=>(o=o.toLowerCase(),s=>Uz(s)===o),jz=o=>s=>typeof s===o,{isArray:v4}=Array,KM=jz("undefined");function Fge(o){return o!==null&&!KM(o)&&o.constructor!==null&&!KM(o.constructor)&&wp(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}const Tce=Bh("ArrayBuffer");function Lge(o){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(o):s=o&&o.buffer&&Tce(o.buffer),s}const Vge=jz("string"),wp=jz("function"),Ace=jz("number"),Wz=o=>o!==null&&typeof o=="object",Hge=o=>o===!0||o===!1,HH=o=>{if(Uz(o)!=="object")return!1;const s=Rne(o);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)},zge=Bh("Date"),Uge=Bh("File"),jge=Bh("Blob"),Wge=Bh("FileList"),Zge=o=>Wz(o)&&wp(o.pipe),Gge=o=>{let s;return o&&(typeof FormData=="function"&&o instanceof FormData||wp(o.append)&&((s=Uz(o))==="formdata"||s==="object"&&wp(o.toString)&&o.toString()==="[object FormData]"))},qge=Bh("URLSearchParams"),[Yge,Kge,Xge,Jge]=["ReadableStream","Request","Response","Headers"].map(Bh),Qge=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function cR(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 Nce(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 cE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Oce=o=>!KM(o)&&o!==cE;function Bte(){const{caseless:o}=Oce(this)&&this||{},s={},i=(u,m)=>{const h=o&&Nce(s,m)||m;HH(s[h])&&HH(u)?s[h]=Bte(s[h],u):HH(u)?s[h]=Bte({},u):v4(u)?s[h]=u.slice():s[h]=u};for(let u=0,m=arguments.length;u<m;u++)arguments[u]&&cR(arguments[u],i);return s}const ehe=(o,s,i,{allOwnKeys:u}={})=>(cR(s,(m,h)=>{i&&wp(m)?o[h]=kce(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&&Rne(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(!Ace(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"&&Rne(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=Bh("HTMLFormElement"),uhe=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,i,u){return i.toUpperCase()+u}),Nre=(({hasOwnProperty:o})=>(s,i)=>o.call(s,i))(Object.prototype),dhe=Bh("RegExp"),$ce=(o,s)=>{const i=Object.getOwnPropertyDescriptors(o),u={};cR(i,(m,h)=>{let b;(b=s(m,h,o))!==!1&&(u[h]=b||m)}),Object.defineProperties(o,u)},fhe=o=>{$ce(o,(s,i)=>{if(wp(o)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const u=o[i];if(wp(u)){if(s.enumerable=!1,"writable"in s){s.writable=!1;return}s.set||(s.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},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,Eee="abcdefghijklmnopqrstuvwxyz",Ore="0123456789",Dce={DIGIT:Ore,ALPHA:Eee,ALPHA_DIGIT:Eee+Eee.toUpperCase()+Ore},hhe=(o=16,s=Dce.ALPHA_DIGIT)=>{let i="";const{length:u}=s;for(;o--;)i+=s[Math.random()*u|0];return i};function vhe(o){return!!(o&&wp(o.append)&&o[Symbol.toStringTag]==="FormData"&&o[Symbol.iterator])}const bhe=o=>{const s=new Array(10),i=(u,m)=>{if(Wz(u)){if(s.indexOf(u)>=0)return;if(!("toJSON"in u)){s[m]=u;const h=v4(u)?[]:{};return cR(u,(b,C)=>{const x=i(b,m+1);!KM(x)&&(h[C]=x)}),s[m]=void 0,h}}return u};return i(o,0)},yhe=Bh("AsyncFunction"),whe=o=>o&&(Wz(o)||wp(o))&&wp(o.then)&&wp(o.catch),Mce=((o,s)=>o?setImmediate:s?((i,u)=>(cE.addEventListener("message",({source:m,data:h})=>{m===cE&&h===i&&u.length&&u.shift()()},!1),m=>{u.push(m),cE.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",wp(cE.postMessage)),Che=typeof queueMicrotask<"u"?queueMicrotask.bind(cE):typeof process<"u"&&process.nextTick||Mce,Rn={isArray:v4,isArrayBuffer:Tce,isBuffer:Fge,isFormData:Gge,isArrayBufferView:Lge,isString:Vge,isNumber:Ace,isBoolean:Hge,isObject:Wz,isPlainObject:HH,isReadableStream:Yge,isRequest:Kge,isResponse:Xge,isHeaders:Jge,isUndefined:KM,isDate:zge,isFile:Uge,isBlob:jge,isRegExp:dhe,isFunction:wp,isStream:Zge,isURLSearchParams:qge,isTypedArray:ahe,isFileList:Wge,forEach:cR,merge:Bte,extend:ehe,trim:Qge,stripBOM:the,inherits:nhe,toFlatObject:ohe,kindOf:Uz,kindOfTest:Bh,endsWith:she,toArray:rhe,forEachEntry:ihe,matchAll:lhe,isHTMLForm:che,hasOwnProperty:Nre,hasOwnProp:Nre,reduceDescriptors:$ce,freezeMethods:fhe,toObjectSet:mhe,toCamelCase:uhe,noop:phe,toFiniteNumber:ghe,findKey:Nce,global:cE,isContextDefined:Oce,ALPHABET:Dce,generateString:hhe,isSpecCompliantForm:vhe,toJSONObject:bhe,isAsyncFn:yhe,isThenable:whe,setImmediate:Mce,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 Rce=Er.prototype,Bce={};["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=>{Bce[o]={value:o}});Object.defineProperties(Er,Bce);Object.defineProperty(Rce,"isAxiosError",{value:!0});Er.from=(o,s,i,u,m,h)=>{const b=Object.create(Rce);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 Ite(o){return Rn.isPlainObject(o)||Rn.isArray(o)}function Ice(o){return Rn.endsWith(o,"[]")?o.slice(0,-2):o}function $re(o,s,i){return o?o.concat(s).map(function(u,m){return u=Ice(u),!i&&m?"["+u+"]":u}).join(i?".":""):s}function xhe(o){return Rn.isArray(o)&&!o.some(Ite)}const Ehe=Rn.toFlatObject(Rn,{},null,function(o){return/^is[A-Z]/.test(o)});function Zz(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(F,Z){return!Rn.isUndefined(Z[F])});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(F){if(F===null)return"";if(Rn.isDate(F))return F.toISOString();if(!C&&Rn.isBlob(F))throw new Er("Blob is not supported. Use a Buffer instead.");return Rn.isArrayBuffer(F)||Rn.isTypedArray(F)?C&&typeof Blob=="function"?new Blob([F]):Buffer.from(F):F}function _(F,Z,K){let X=F;if(F&&!K&&typeof F=="object"){if(Rn.endsWith(Z,"{}"))Z=u?Z:Z.slice(0,-2),F=JSON.stringify(F);else if(Rn.isArray(F)&&xhe(F)||(Rn.isFileList(F)||Rn.endsWith(Z,"[]"))&&(X=Rn.toArray(F)))return Z=Ice(Z),X.forEach(function(q,W){!(Rn.isUndefined(q)||q===null)&&s.append(b===!0?$re([Z],W,h):b===null?Z:Z+"[]",x(q))}),!1}return Ite(F)?!0:(s.append($re(K,Z,h),x(F)),!1)}const N=[],O=Object.assign(Ehe,{defaultVisitor:_,convertValue:x,isVisitable:Ite});function B(F,Z){if(!Rn.isUndefined(F)){if(N.indexOf(F)!==-1)throw Error("Circular reference detected in "+Z.join("."));N.push(F),Rn.forEach(F,function(K,X){(!(Rn.isUndefined(K)||K===null)&&m.call(s,K,Rn.isString(X)?X.trim():X,Z,O))===!0&&B(K,Z?Z.concat(X):[X])}),N.pop()}}if(!Rn.isObject(o))throw new TypeError("data must be an object");return B(o),s}function Dre(o){const s={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(i){return s[i]})}function Bne(o,s){this._pairs=[],o&&Zz(o,this,s)}const Pce=Bne.prototype;Pce.append=function(o,s){this._pairs.push([o,s])};Pce.toString=function(o){const s=o?function(i){return o.call(this,i,Dre)}:Dre;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 Fce(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 Bne(s,i).toString(u),h){const b=o.indexOf("#");b!==-1&&(o=o.slice(0,b)),o+=(o.indexOf("?")===-1?"?":"&")+h}return o}let Mre=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 Lce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},khe=typeof URLSearchParams<"u"?URLSearchParams:Bne,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"]},Ine=typeof window<"u"&&typeof document<"u",Pte=typeof navigator=="object"&&navigator||void 0,Ohe=Ine&&(!Pte||["ReactNative","NativeScript","NS"].indexOf(Pte.product)<0),$he=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Dhe=Ine&&window.location.href||"http://localhost",Mhe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ine,hasStandardBrowserEnv:Ohe,hasStandardBrowserWebWorkerEnv:$he,navigator:Pte,origin:Dhe},Symbol.toStringTag,{value:"Module"})),Xd={...Mhe,...Nhe};function Rhe(o,s){return Zz(o,new Xd.classes.URLSearchParams,Object.assign({visitor:function(i,u,m,h){return Xd.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 Vce(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 uR={transitional:Lce,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(Vce(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 Zz(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||uR.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:Xd.classes.FormData,Blob:Xd.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=>{uR.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},Rre=Symbol("internals");function kM(o){return o&&String(o).trim().toLowerCase()}function zH(o){return o===!1||o==null?o:Rn.isArray(o)?o.map(zH):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 _ee(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 Em=class{constructor(s){s&&this.set(s)}set(s,i,u){const m=this;function h(C,x,_){const N=kM(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]=zH(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=kM(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=kM(s),s){const u=Rn.findKey(this,s);return!!(u&&this[u]!==void 0&&(!i||_ee(this,this[u],u,i)))}return!1}delete(s,i){const u=this;let m=!1;function h(b){if(b=kM(b),b){const C=Rn.findKey(u,b);C&&(!i||_ee(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||_ee(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]=zH(m),delete i[h];return}const C=s?zhe(h):String(h).trim();C!==h&&delete i[h],i[C]=zH(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[Rre]=this[Rre]={accessors:{}}).accessors,u=this.prototype;function m(h){const b=kM(h);i[b]||(Uhe(u,h),i[b]=!0)}return Rn.isArray(s)?s.forEach(m):m(s),this}};Em.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Rn.reduceDescriptors(Em.prototype,({value:o},s)=>{let i=s[0].toUpperCase()+s.slice(1);return{get:()=>o,set(u){this[i]=u}}});Rn.freezeMethods(Em);function kee(o,s){const i=this||uR,u=s||i,m=Em.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 Hce(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 zce(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 rz=(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)},Bre=(o,s)=>{const i=o!=null;return[u=>s[0]({lengthComputable:i,total:o,loaded:u}),s[1]]},Ire=o=>(...s)=>Rn.asap(()=>o(...s)),Ghe=Xd.hasStandardBrowserEnv?((o,s)=>i=>(i=new URL(i,Xd.origin),o.protocol===i.protocol&&o.host===i.host&&(s||o.port===i.port)))(new URL(Xd.origin),Xd.navigator&&/(msie|trident)/i.test(Xd.navigator.userAgent)):()=>!0,qhe=Xd.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 Uce(o,s){return o&&!Yhe(s)?Khe(o,s):s}const Pre=o=>o instanceof Em?{...o}:o;function SE(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(Pre(_),Pre(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 jce=o=>{const s=SE({},o);let{data:i,withXSRFToken:u,xsrfHeaderName:m,xsrfCookieName:h,headers:b,auth:C}=s;s.headers=b=Em.from(b),s.url=Fce(Uce(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(Xd.hasStandardBrowserEnv||Xd.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(Xd.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=jce(o);let m=u.data;const h=Em.from(u.headers).normalize();let{responseType:b,onUploadProgress:C,onDownloadProgress:x}=u,_,N,O,B,F;function Z(){B&&B(),F&&F(),u.cancelToken&&u.cancelToken.unsubscribe(_),u.signal&&u.signal.removeEventListener("abort",_)}let K=new XMLHttpRequest;K.open(u.method.toUpperCase(),u.url,!0),K.timeout=u.timeout;function X(){if(!K)return;const W=Em.from("getAllResponseHeaders"in K&&K.getAllResponseHeaders()),H={data:!b||b==="text"||b==="json"?K.responseText:K.response,status:K.status,statusText:K.statusText,headers:W,config:o,request:K};zce(function(me){s(me),Z()},function(me){i(me),Z()},H),K=null}"onloadend"in K?K.onloadend=X:K.onreadystatechange=function(){!K||K.readyState!==4||K.status===0&&!(K.responseURL&&K.responseURL.indexOf("file:")===0)||setTimeout(X)},K.onabort=function(){K&&(i(new Er("Request aborted",Er.ECONNABORTED,o,K)),K=null)},K.onerror=function(){i(new Er("Network Error",Er.ERR_NETWORK,o,K)),K=null},K.ontimeout=function(){let W=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded";const H=u.transitional||Lce;u.timeoutErrorMessage&&(W=u.timeoutErrorMessage),i(new Er(W,H.clarifyTimeoutError?Er.ETIMEDOUT:Er.ECONNABORTED,o,K)),K=null},m===void 0&&h.setContentType(null),"setRequestHeader"in K&&Rn.forEach(h.toJSON(),function(W,H){K.setRequestHeader(H,W)}),Rn.isUndefined(u.withCredentials)||(K.withCredentials=!!u.withCredentials),b&&b!=="json"&&(K.responseType=u.responseType),x&&([O,F]=rz(x,!0),K.addEventListener("progress",O)),C&&K.upload&&([N,B]=rz(C),K.upload.addEventListener("progress",N),K.upload.addEventListener("loadend",B)),(u.cancelToken||u.signal)&&(_=W=>{K&&(i(!W||W.type?new b4(null,o,K):W),K.abort(),K=null)},u.cancelToken&&u.cancelToken.subscribe(_),u.signal&&(u.signal.aborted?_():u.signal.addEventListener("abort",_)));const q=jhe(u.url);if(q&&Xd.protocols.indexOf(q)===-1){i(new Er("Unsupported protocol "+q+":",Er.ERR_BAD_REQUEST,o));return}K.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()}},Fre=(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})},Gz=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Wce=Gz&&typeof ReadableStream=="function",o1e=Gz&&(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=Wce&&Zce(()=>{let o=!1;const s=new Request(Xd.origin,{body:new ReadableStream,method:"POST",get duplex(){return o=!0,"half"}}).headers.has("Content-Type");return o&&!s}),Lre=64*1024,Fte=Wce&&Zce(()=>Rn.isReadableStream(new Response("").body)),az={stream:Fte&&(o=>o.body)};Gz&&(o=>{["text","arrayBuffer","blob","formData","stream"].forEach(s=>{!az[s]&&(az[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(Xd.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=Gz&&(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}=jce(o);_=_?(_+"").toLowerCase():"text";let F=Qhe([m,h&&h.toAbortSignal()],b),Z;const K=F&&F.unsubscribe&&(()=>{F.unsubscribe()});let X;try{if(x&&s1e&&i!=="get"&&i!=="head"&&(X=await a1e(N,u))!==0){let et=new Request(s,{method:"POST",body:u,duplex:"half"}),$e;if(Rn.isFormData(u)&&($e=et.headers.get("content-type"))&&N.setContentType($e),et.body){const[te,We]=Bre(X,rz(Ire(x)));u=Fre(et.body,Lre,te,We)}}Rn.isString(O)||(O=O?"include":"omit");const q="credentials"in Request.prototype;Z=new Request(s,{...B,signal:F,method:i.toUpperCase(),headers:N.normalize().toJSON(),body:u,duplex:"half",credentials:q?O:void 0});let W=await fetch(Z);const H=Fte&&(_==="stream"||_==="response");if(Fte&&(C||H&&K)){const et={};["status","statusText","headers"].forEach(ft=>{et[ft]=W[ft]});const $e=Rn.toFiniteNumber(W.headers.get("content-length")),[te,We]=C&&Bre($e,rz(Ire(C),!0))||[];W=new Response(Fre(W.body,Lre,te,()=>{We&&We(),K&&K()}),et)}_=_||"text";let me=await az[Rn.findKey(az,_)||"text"](W,o);return!H&&K&&K(),await new Promise((et,$e)=>{zce(et,$e,{data:me,headers:Em.from(W.headers),status:W.status,statusText:W.statusText,config:o,request:Z})})}catch(q){throw K&&K(),q&&q.name==="TypeError"&&/fetch/i.test(q.message)?Object.assign(new Er("Network Error",Er.ERR_NETWORK,o,Z),{cause:q.cause||q}):Er.from(q,q&&q.code,o,Z)}}),Lte={http:She,xhr:Jhe,fetch:i1e};Rn.forEach(Lte,(o,s)=>{if(o){try{Object.defineProperty(o,"name",{value:s})}catch{}Object.defineProperty(o,"adapterName",{value:s})}});const Vre=o=>`- ${o}`,l1e=o=>Rn.isFunction(o)||o===null||o===!1,Gce={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=Lte[(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(Vre).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=ge(Yt.source),Yt.altsourcemime=ge(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=et(Xe),Zo=$e(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={},je=(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?je(qe,$t(Xe),Ft):bt(qe,$t(Xe))},Et=Xe=>W(mt,Xe),Bt=(Xe,qe)=>q(qe,Xe).bind(Ft=>q(Ft,"meta")),dn=(Xe,qe,Ft)=>Yt=>{const mo=()=>q(Xe,Yt),$o=()=>q(qe,Yt),Zo=Wt=>q(Wt,"value").bind(Qe=>Qe.length>0?_.some(Qe):_.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 q(Xe,"dimensions").each(Yt=>{O(["width","height"],mo=>{q(qe,mo).orThunk(()=>q(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:q(Xe,"source").getOr("")},altsource:{value:q(Xe,"altsource").getOr("")},poster:{value:q(Xe,"poster").getOr("")}};return O(["width","height"],Ft=>{q(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))}},On=(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),On(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=F(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=[];Ne(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"],Qe=>{Zo.attr(Qe,qe.attr(Qe))});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 Qe=mo[$o].value;Wt!=="width"&&Wt!=="height"&&Wt!=="style"&&!rr(Wt,"data-mce-")&&((Wt==="data"||Wt==="src")&&(Qe=Xe.convertURL(Qe,Wt)),Ft.attr("data-mce-p-"+Wt,Qe))}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)&&We(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=ft(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]={}}),X({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 Qe=Wt.attr(Zo),rt=new Ze(Qe,1);if(Qe!=="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,Qe,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=>(me(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=q=>W=>typeof W===q,i=s("boolean"),u=s("number"),m=q=>W=>W.options.get(q),h=q=>{const W=q.options.register;W("nonbreaking_force_tab",{processor:H=>i(H)?{value:H?3:0,valid:!0}:u(H)?{value:H,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=(q,W)=>{let H="";for(let me=0;me<W;me++)H+=q;return H},_=q=>q.plugins.visualchars?q.plugins.visualchars.isEnabled():!1,N=(q,W)=>{const H=()=>_(q)?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap",me=()=>`<span class="${H()}" contenteditable="false">${x(" ",W)}</span>`,$e=C(q)||q.plugins.visualchars?me():x(" ",W);q.undoManager.transact(()=>q.insertContent($e))},O=q=>{q.addCommand("mceNonBreaking",()=>{N(q,1)})};var B=tinymce.util.Tools.resolve("tinymce.util.VK");const F=q=>{const W=b(q);W>0&&q.on("keydown",H=>{if(H.keyCode===B.TAB&&!H.isDefaultPrevented()){if(H.shiftKey)return;H.preventDefault(),H.stopImmediatePropagation(),N(q,W)}})},Z=q=>W=>{const H=()=>{W.setEnabled(q.selection.isEditable())};return q.on("NodeChange",H),H(),()=>{q.off("NodeChange",H)}},K=q=>{const W=()=>q.execCommand("mceNonBreaking");q.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:W,onSetup:Z(q)}),q.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:W,onSetup:Z(q)})};var X=()=>{o.add("nonbreaking",q=>{h(q),O(q),K(q),F(q)})};X()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=tinymce.util.Tools.resolve("tinymce.Env");const i=Z=>K=>K.options.get(Z),u=Z=>{const K=Z.options.register;K("pagebreak_separator",{processor:"string",default:"<!-- pagebreak -->"}),K("pagebreak_split_block",{processor:"boolean",default:!1})},m=i("pagebreak_separator"),h=i("pagebreak_split_block"),b="mce-pagebreak",C=Z=>{const K=`<img src="${s.transparentSrc}" class="${b}" data-mce-resize="false" data-mce-placeholder />`;return Z?`<p>${K}</p>`:K},x=Z=>{const K=m(Z),X=()=>h(Z),q=new RegExp(K.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,W=>"\\"+W),"gi");Z.on("BeforeSetContent",W=>{W.content=W.content.replace(q,C(X()))}),Z.on("PreInit",()=>{Z.serializer.addNodeFilter("img",W=>{let H=W.length,me,et;for(;H--;)if(me=W[H],et=me.attr("class"),et&&et.indexOf(b)!==-1){const $e=me.parent;if($e&&Z.schema.getBlockElements()[$e.name]&&X()){$e.type=3,$e.value=K,$e.raw=!0,me.remove();continue}me.type=3,me.value=K,me.raw=!0}})})},_=Z=>{Z.addCommand("mcePageBreak",()=>{Z.insertContent(C(h(Z)))})},N=Z=>{Z.on("ResolveName",K=>{K.target.nodeName==="IMG"&&Z.dom.hasClass(K.target,b)&&(K.name="pagebreak")})},O=Z=>K=>{const X=()=>{K.setEnabled(Z.selection.isEditable())};return Z.on("NodeChange",X),X(),()=>{Z.off("NodeChange",X)}},B=Z=>{const K=()=>Z.execCommand("mcePageBreak");Z.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:K,onSetup:O(Z)}),Z.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:K,onSetup:O(Z)})};var F=()=>{o.add("pagebreak",Z=>{u(Z),_(Z),B(Z),x(Z),N(Z)})};F()})();(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 On=0,ko=Nt.length;On<ko;On++){const Ro=Nt[On];if(rn(Ro,On))return h.some(Ro);if(an(Ro,On))break}return h.none()},_=(Nt,rn)=>x(Nt,rn,C),N=(Nt,rn)=>{for(let an=0;an<Nt.length;an++){const On=rn(Nt[an],an);if(On.isSome())return On}return h.none()};typeof window<"u"||Function("return this;")();const O=Nt=>{let rn=!1,an;return(...On)=>(rn||(rn=!0,an=Nt.apply(null,On)),an)},B=(Nt,rn,an,On)=>{const ko=Nt.isiOS()&&/ipad/i.test(an)===!0,Ro=Nt.isiOS()&&!ko,ws=Nt.isiOS()||Nt.isAndroid(),yo=ws||On("(pointer:coarse)"),Us=ko||!Ro&&ws&&On("(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)}},F=(Nt,rn)=>{for(let an=0;an<Nt.length;an++){const On=Nt[an];if(On.test(rn))return On}},Z=(Nt,rn)=>{const an=F(Nt,rn);if(!an)return{major:0,minor:0};const On=ko=>Number(rn.replace(an,"$"+ko));return q(On(1),On(2))},K=(Nt,rn)=>{const an=String(rn).toLowerCase();return Nt.length===0?X():Z(Nt,an)},X=()=>q(0,0),q=(Nt,rn)=>({major:Nt,minor:rn}),W={nu:q,detect:K,unknown:X},H=(Nt,rn)=>N(rn.brands,an=>{const On=an.brand.toLowerCase();return _(Nt,ko=>{var Ro;return On===((Ro=ko.brand)===null||Ro===void 0?void 0:Ro.toLowerCase())}).map(ko=>({current:ko.name,version:W.nu(parseInt(an.version,10),0)}))}),me=(Nt,rn)=>{const an=String(rn).toLowerCase();return _(Nt,On=>On.search(an))},et=(Nt,rn)=>me(Nt,rn).map(an=>{const On=W.detect(an.versionRegexes,rn);return{current:an.name,version:On}}),$e=(Nt,rn)=>me(Nt,rn).map(an=>{const On=W.detect(an.versionRegexes,rn);return{current:an.name,version:On}}),te=(Nt,rn,an=0,On)=>{const ko=Nt.indexOf(rn,an);return ko!==-1?i(On)?!0:ko+rn.length<=On:!1},We=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ft=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]+).*/,We],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:[We,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ft("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ft("firefox")},{name:"Safari",versionRegexes:[We,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:Nt=>(te(Nt,"safari")||te(Nt,"mobile/"))&&te(Nt,"applewebkit")}],Ne=[{name:"Windows",search:ft("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:ft("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:ft("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ft("linux"),versionRegexes:[]},{name:"Solaris",search:ft("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ft("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:ft("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],ue={browsers:b(lt),oses:b(Ne)},Pt="Edge",ye="Chromium",De="IE",R="Opera",Ue="Firefox",be="Safari",ot=()=>nt({current:void 0,version:W.unknown()}),nt=Nt=>{const rn=Nt.current,an=Nt.version,On=ko=>()=>rn===ko;return{current:rn,version:an,isEdge:On(Pt),isChromium:On(ye),isIE:On(De),isOpera:On(R),isFirefox:On(Ue),isSafari:On(be)}},ge={unknown:ot,nu:nt,edge:b(Pt),chromium:b(ye),ie:b(De),opera:b(R),firefox:b(Ue),safari:b(be)},Ze="Windows",Tt="iOS",He="Android",vt="Linux",Be="macOS",dt="Solaris",oe="FreeBSD",pn="ChromeOS",gt=()=>St({current:void 0,version:W.unknown()}),St=Nt=>{const rn=Nt.current,an=Nt.version,On=ko=>()=>rn===ko;return{current:rn,version:an,isWindows:On(Ze),isiOS:On(Tt),isAndroid:On(He),isMacOS:On(Be),isLinux:On(vt),isSolaris:On(dt),isFreeBSD:On(oe),isChromeOS:On(pn)}},jt={unknown:gt,nu:St,windows:b(Ze),ios:b(Tt),android:b(He),linux:b(vt),macos:b(Be),solaris:b(dt),freebsd:b(oe),chromeos:b(pn)},ee={detect:(Nt,rn,an)=>{const On=ue.browsers(),ko=ue.oses(),Ro=rn.bind(Us=>H(On,Us)).orThunk(()=>et(On,Nt)).fold(ge.unknown,ge.nu),ws=$e(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",On=>{for(let ko=On.target;ko;ko=ko.parentNode)if(ko.nodeName==="A"){const ws=ko.getAttribute("href");if(ws&&ws.startsWith("#")){On.preventDefault();const Us=document.getElementById(ws.substring(1));Us&&Us.scrollIntoView({behavior:"smooth"});return}(an?On.metaKey:On.ctrlKey&&!On.altKey)||On.preventDefault()}},!1)}).toString()})(${Nt})<\/script>`};var mt=tinymce.util.Tools.resolve("tinymce.util.Tools");const je=Nt=>rn=>rn.options.get(Nt),bt=je("content_style"),$t=je("content_css_cors"),gn=je("body_class"),Et=je("body_id"),Bt=Nt=>{var rn;let an="";const On=Nt.dom.encode,ko=(rn=bt(Nt))!==null&&rn!==void 0?rn:"";an+=`<base href="${On(Nt.documentBaseURI.getURI())}">`;const Ro=$t(Nt)?' crossorigin="anonymous"':"";mt.each(Nt.contentCSS,tr=>{an+='<link type="text/css" rel="stylesheet" href="'+On(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="'+On(Us)+'"':"";return"<!DOCTYPE html><html><head>"+an+'</head><body id="'+On(ws)+'" class="mce-content-body '+On(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,F=Ct=>ee=>typeof ee===Ct,Z=B("string"),K=F("boolean"),X=Ct=>Ct==null,q=Ct=>!X(Ct),W=F("function"),H=Ct=>ee=>ee.options.get(Ct),me=Ct=>{const ee=Ct.options.register,ie=Me=>Pe=>{const mt=K(Pe)||Z(Pe);return mt?K(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})},et=H("quickbars_selection_toolbar"),$e=H("quickbars_insert_toolbar"),te=H("quickbars_image_toolbar"),We=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 Ne{constructor(ee,ie){this.tag=ee,this.value=ie}static some(ee){return new Ne(!0,ee)}static none(){return Ne.singletonNone}fold(ee,ie){return this.tag?ie(this.value):ee()}isSome(){return this.tag}isNone(){return!this.tag}map(ee){return this.tag?Ne.some(ee(this.value)):Ne.none()}bind(ee){return this.tag?ee(this.value):Ne.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:Ne.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 q(ee)?Ne.some(ee):Ne.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()"}}Ne.singletonNone=new Ne(!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)?Ne.some(ie):W(Y)&&Y(ie)?Ne.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])},Ue=(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}},ge={fromHtml:R,fromTag:Ue,fromText:be,fromDom:ot,fromPoint:(Ct,ee,ie)=>Ne.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=ge.fromDom(ce);if(ee(we))return Ne.some(we);if(Y(we))break}return Ne.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),dt=(Ct,ee,ie)=>De((Y,we)=>Ze(Y,we),Be,Ct,ee,ie),oe=Ct=>{const ee=$e(Ct);ee.length>0&&Ct.ui.registry.addContextToolbar("quickblock",{predicate:ie=>{const ce=ge.fromDom(ie),Y=Ct.schema.getTextBlockElements(),we=Me=>Me.dom===Ct.getBody();return!ye(ce,"data-mce-bogus")&&dt(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,je=gt(ge.fromDom(Me),"mce-pagebreak");return mt&&ie(Me)&&!je},Y=te(Ct);Y.length>0&&Ct.ui.registry.addContextToolbar("imageselection",{predicate:ce,items:Y,position:"node"});const we=et(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=>{me(Ct),_(Ct),We(Ct),oe(Ct),St(Ct)})};jt()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=(q=>W=>typeof W===q)("function");var u=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),m=tinymce.util.Tools.resolve("tinymce.util.Tools");const h=q=>W=>W.options.get(q),b=q=>{const W=q.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=(q,W)=>{q.notificationManager.open({text:W,type:"error"})},O=q=>{const W=u.DOM.getParent(q.id,"form");if(C(q)&&!q.isDirty())return;q.save();const H=x(q);if(i(H)){H.call(q,q),q.nodeChanged();return}W?(q.setDirty(!1),(!W.onsubmit||W.onsubmit())&&(typeof W.submit=="function"?W.submit():N(q,"Error: Form submit field collision.")),q.nodeChanged()):N(q,"Error: No form element found.")},B=q=>{const W=m.trim(q.startContent),H=_(q);if(i(H)){H.call(q,q);return}q.resetContent(W)},F=q=>{q.addCommand("mceSave",()=>{O(q)}),q.addCommand("mceCancel",()=>{B(q)})},Z=q=>W=>{const H=()=>{W.setEnabled(!C(q)||q.isDirty())};return H(),q.on("NodeChange dirty",H),()=>q.off("NodeChange dirty",H)},K=q=>{q.ui.registry.addButton("save",{icon:"save",tooltip:"Save",enabled:!1,onAction:()=>q.execCommand("mceSave"),onSetup:Z(q),shortcut:"Meta+S"}),q.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",enabled:!1,onAction:()=>q.execCommand("mceCancel"),onSetup:Z(q)}),q.addShortcut("Meta+S","","mceSave")};var X=()=>{o.add("save",q=>{b(q),K(q),F(q)})};X()})();(function(){const o=Qe=>{let rt=Qe;return{get:()=>rt,set:zn=>{rt=zn}}};var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=(Qe,rt,cn)=>{var yn;return cn(Qe,rt.prototype)?!0:((yn=Qe.constructor)===null||yn===void 0?void 0:yn.name)===rt.name},u=Qe=>{const rt=typeof Qe;return Qe===null?"null":rt==="object"&&Array.isArray(Qe)?"array":rt==="object"&&i(Qe,String,(cn,yn)=>yn.isPrototypeOf(cn))?"string":rt},m=Qe=>rt=>u(rt)===Qe,h=Qe=>rt=>typeof rt===Qe,b=m("string"),C=m("array"),x=h("boolean"),_=Qe=>Qe==null,N=Qe=>!_(Qe),O=h("number"),B=()=>{},F=Qe=>()=>Qe,Z=F(!0),X=F("[~№|!-*+-\\/:;?@\\[-`{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]");class q{constructor(rt,cn){this.tag=rt,this.value=cn}static some(rt){return new q(!0,rt)}static none(){return q.singletonNone}fold(rt,cn){return this.tag?cn(this.value):rt()}isSome(){return this.tag}isNone(){return!this.tag}map(rt){return this.tag?q.some(rt(this.value)):q.none()}bind(rt){return this.tag?rt(this.value):q.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:q.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)?q.some(rt):q.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()"}}q.singletonNone=new q(!1);const W=X;var H=tinymce.util.Tools.resolve("tinymce.Env"),me=tinymce.util.Tools.resolve("tinymce.util.Tools");const et=Array.prototype.slice,$e=Array.prototype.push,te=(Qe,rt)=>{const cn=Qe.length,yn=new Array(cn);for(let zn=0;zn<cn;zn++){const co=Qe[zn];yn[zn]=rt(co,zn)}return yn},We=(Qe,rt)=>{for(let cn=0,yn=Qe.length;cn<yn;cn++){const zn=Qe[cn];rt(zn,cn)}},ft=(Qe,rt)=>{for(let cn=Qe.length-1;cn>=0;cn--){const yn=Qe[cn];rt(yn,cn)}},lt=(Qe,rt)=>{if(Qe.length===0)return[];{let cn=rt(Qe[0]);const yn=[];let zn=[];for(let co=0,fo=Qe.length;co<fo;co++){const oo=Qe[co],Co=rt(oo);Co!==cn&&(yn.push(zn),zn=[]),cn=Co,zn.push(oo)}return zn.length!==0&&yn.push(zn),yn}},Ne=(Qe,rt,cn)=>(We(Qe,(yn,zn)=>{cn=rt(cn,yn,zn)}),cn),ue=Qe=>{const rt=[];for(let cn=0,yn=Qe.length;cn<yn;++cn){if(!C(Qe[cn]))throw new Error("Arr.flatten item "+cn+" was not an array, input: "+Qe);$e.apply(rt,Qe[cn])}return rt},Pt=(Qe,rt)=>ue(te(Qe,rt)),ye=(Qe,rt)=>{const cn=et.call(Qe,0);return cn.sort(rt),cn},De=Object.hasOwnProperty,R=(Qe,rt)=>De.call(Qe,rt);typeof window<"u"||Function("return this;")();const Ue=9,be=11,ot=1,nt=3,ge=Qe=>Qe.dom.nodeType,Tt=(Qe=>rt=>ge(rt)===Qe)(nt),He=(Qe,rt,cn)=>{if(b(cn)||x(cn)||O(cn))Qe.setAttribute(rt,cn+"");else throw console.error("Invalid call to Attribute.set. Key ",rt,":: Value ",cn,":: Element ",Qe),new Error("Attribute value was not simple")},vt=(Qe,rt,cn)=>{He(Qe.dom,rt,cn)},Be=(Qe,rt)=>{const yn=(rt||document).createElement("div");if(yn.innerHTML=Qe,!yn.hasChildNodes()||yn.childNodes.length>1){const zn="HTML does not have a single root node";throw console.error(zn,Qe),new Error(zn)}return pn(yn.childNodes[0])},dt=(Qe,rt)=>{const yn=(rt||document).createElement(Qe);return pn(yn)},oe=(Qe,rt)=>{const yn=(rt||document).createTextNode(Qe);return pn(yn)},pn=Qe=>{if(Qe==null)throw new Error("Node cannot be null or undefined");return{dom:Qe}},St={fromHtml:Be,fromTag:dt,fromText:oe,fromDom:pn,fromPoint:(Qe,rt,cn)=>q.from(Qe.dom.elementFromPoint(rt,cn)).map(pn)},jt=Qe=>Qe.nodeType!==ot&&Qe.nodeType!==Ue&&Qe.nodeType!==be||Qe.childElementCount===0,Ct=(Qe,rt)=>{const cn=rt===void 0?document:rt.dom;return jt(cn)?[]:te(cn.querySelectorAll(Qe),St.fromDom)},ee=Qe=>q.from(Qe.dom.parentNode).map(St.fromDom),ie=Qe=>te(Qe.dom.childNodes,St.fromDom),ce=(Qe,rt)=>({element:Qe,offset:rt}),Y=(Qe,rt)=>{const cn=ie(Qe);return cn.length>0&&rt<cn.length?ce(cn[rt],0):ce(Qe,rt)},we=(Qe,rt)=>{ee(Qe).each(yn=>{yn.dom.insertBefore(rt.dom,Qe.dom)})},Me=(Qe,rt)=>{Qe.dom.appendChild(rt.dom)},Pe=(Qe,rt)=>{we(Qe,rt),Me(rt,Qe)},je=((Qe,rt)=>{const cn=co=>{if(!Qe(co))throw new Error("Can only get "+rt+" value of a "+rt+" node");return yn(co).getOr("")},yn=co=>Qe(co)?q.from(co.dom.nodeValue):q.none();return{get:cn,getOption:yn,set:(co,fo)=>{if(!Qe(co))throw new Error("Can only set raw "+rt+" value of a "+rt+" node");co.dom.nodeValue=fo}}})(Tt,"text"),bt=Qe=>je.get(Qe),$t=(Qe,rt,cn)=>(Qe.compareDocumentPosition(rt)&cn)!==0,gn=(Qe,rt)=>$t(Qe,rt,Node.DOCUMENT_POSITION_PRECEDING),Et=(Qe,rt)=>Ct(rt,Qe);var Bt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker");const dn=(Qe,rt)=>Qe.isBlock(rt)||R(Qe.schema.getVoidElements(),rt.nodeName),_n=(Qe,rt)=>!Qe.isEditable(rt),xo=(Qe,rt)=>Qe.getContentEditable(rt)==="true"&&rt.parentNode&&!Qe.isEditable(rt.parentNode),Qn=(Qe,rt)=>!Qe.isBlock(rt)&&R(Qe.schema.getWhitespaceElements(),rt.nodeName),Nt=(Qe,rt)=>dn(Qe,rt)||_n(Qe,rt)||Qn(Qe,rt)||xo(Qe,rt),rn=Qe=>Qe.nodeType===3,an=()=>({sOffset:0,fOffset:0,elements:[]}),On=(Qe,rt)=>Y(St.fromDom(Qe),rt),ko=(Qe,rt,cn,yn,zn,co=!0)=>{let fo=co?rt(!1):cn;for(;fo;){const oo=_n(Qe,fo);if(oo||Qn(Qe,fo)){if(oo?yn.cef(fo):yn.boundary(fo))break;fo=rt(!0);continue}else if(dn(Qe,fo)){if(yn.boundary(fo))break}else rn(fo)&&yn.text(fo);if(fo===zn)break;fo=rt(!1)}},Ro=(Qe,rt,cn,yn,zn)=>{var co;if(Nt(Qe,cn))return;const fo=(co=Qe.getParent(yn,Qe.isBlock))!==null&&co!==void 0?co:Qe.getRoot(),oo=new Bt(cn,fo),Co=zn?oo.next.bind(oo):oo.prev.bind(oo);ko(Qe,Co,cn,{boundary:Z,cef:Z,text:Io=>{zn?rt.fOffset+=Io.length:rt.sOffset+=Io.length,rt.elements.push(St.fromDom(Io))}})},ws=(Qe,rt,cn,yn,zn,co=!0)=>{const fo=new Bt(cn,rt),oo=[];let Co=an();Ro(Qe,Co,cn,rt,!1);const Io=()=>(Co.elements.length>0&&(oo.push(Co),Co=an()),!1);return ko(Qe,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(Qe,Co,yn,rt,!0),Io(),oo},yo=(Qe,rt)=>{const cn=On(rt.startContainer,rt.startOffset),yn=cn.element.dom,zn=On(rt.endContainer,rt.endOffset),co=zn.element.dom;return ws(Qe,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(Qe,Io,Io)});return ye(oo,(Co,Io)=>gn(Co.elements[0].dom,Io.elements[0].dom)?1:-1)}},!1)},Us=(Qe,rt)=>rt.collapsed?[]:yo(Qe,rt),fn=(Qe,rt)=>{const cn=Qe.createRng();return cn.selectNode(rt),Us(Qe,cn)},Ho=(Qe,rt)=>Pt(rt,cn=>fn(Qe,cn)),tr=(Qe,rt,cn=0,yn=Qe.length)=>{const zn=rt.regex;zn.lastIndex=cn;const co=[];let fo;for(;fo=zn.exec(Qe);){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=(Qe,rt)=>{const cn=Ne(Qe,(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=(Qe,rt)=>Pt(rt,cn=>{const yn=cn.elements,zn=te(yn,bt).join(""),co=tr(zn,Qe,cn.sOffset,zn.length-cn.fOffset);return rr(yn,co)}),Pr=(Qe,rt)=>{ft(Qe,(cn,yn)=>{ft(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=(Qe,rt,cn,yn)=>{const zn=fn(Qe,cn),co=Ir(rt,zn);return Pr(co,yn),co.length},Nr=(Qe,rt,cn,yn)=>{const zn=cn.getBookmark(),co=Qe.select("td[data-mce-selected],th[data-mce-selected]"),fo=co.length>0?Ho(Qe,co):Us(Qe,cn.getRng()),oo=Ir(rt,fo);return Pr(oo,yn),cn.moveToBookmark(zn),oo.length},Xr=Qe=>Qe.getAttribute("data-mce-index"),xs=(Qe,rt,cn,yn)=>{const zn=Qe.dom.create("span",{"data-mce-bogus":1});zn.className="mce-match-marker";const co=Qe.getBody();return ar(Qe,rt,!1),yn?Nr(Qe.dom,cn,Qe.selection,zn):ks(Qe.dom,cn,co,zn)},uo=Qe=>{var rt;const cn=Qe.parentNode;Qe.firstChild&&cn.insertBefore(Qe.firstChild,Qe),(rt=Qe.parentNode)===null||rt===void 0||rt.removeChild(Qe)},Ps=(Qe,rt)=>{const cn=[],yn=me.toArray(Qe.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=(Qe,rt,cn)=>{const yn=rt.get();let zn=yn.index;const co=Qe.dom;cn?zn+1===yn.count?zn=0:zn++:zn-1===-1?zn=yn.count-1:zn--,co.removeClass(Ps(Qe,yn.index),"mce-match-marker-selected");const fo=Ps(Qe,zn);return fo.length?(co.addClass(Ps(Qe,zn),"mce-match-marker-selected"),Qe.selection.scrollIntoView(fo[0]),zn):-1},Ht=(Qe,rt)=>{const cn=rt.parentNode;Qe.remove(rt),cn&&Qe.isEmpty(cn)&&Qe.remove(cn)},Fn=(Qe,rt)=>{const yn="("+Qe.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]")+")";return rt?`(?:^|\\s|${W()})`+yn+`(?=$|\\s|${W()})`:yn},ao=(Qe,rt,cn,yn,zn,co)=>{const fo=Qe.selection,oo=Fn(cn,zn),Co=fo.isForward(),Io={regex:new RegExp(oo,yn?"g":"gi"),matchIndex:1},ls=xs(Qe,rt,Io,co);if(H.browser.isSafari()&&fo.setRng(fo.getRng(),Co),ls){const Js=_t(Qe,rt,!0);rt.set({index:Js,count:ls,text:cn,matchCase:yn,wholeWord:zn,inSelection:co})}return ls},Bo=(Qe,rt)=>{const cn=_t(Qe,rt,!0);rt.set({...rt.get(),index:cn})},is=(Qe,rt)=>{const cn=_t(Qe,rt,!1);rt.set({...rt.get(),index:cn})},yr=Qe=>{const rt=Xr(Qe);return rt!==null&&rt.length>0},wr=(Qe,rt,cn,yn,zn)=>{const co=rt.get(),fo=co.index;let oo,Co=fo;yn=yn!==!1;const Io=Qe.getBody(),ls=me.grep(me.toArray(Io.getElementsByTagName("span")),yr);for(let Js=0;Js<ls.length;Js++){const Es=Xr(ls[Js]);let Ka=oo=parseInt(Es,10);if(zn||Ka===co.index){for(cn.length?(ls[Js].innerText=cn,uo(ls[Js])):Ht(Qe.dom,ls[Js]);ls[++Js];)if(Ka=parseInt(Xr(ls[Js]),10),Ka===oo)Ht(Qe.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(Qe,rt):is(Qe,rt),!zn&&rt.get().count>0},ar=(Qe,rt,cn)=>{let yn,zn;const co=rt.get(),fo=me.toArray(Qe.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=Qe.dom.createRng();return oo.setStart(yn,0),oo.setEnd(zn,zn.data.length),cn!==!1&&Qe.selection.setRng(oo),oo}else return},Xe=(Qe,rt)=>rt.get().count>1,qe=(Qe,rt)=>rt.get().count>1,Ft=(Qe,rt)=>({done:oo=>ar(Qe,rt,oo),find:(oo,Co,Io,ls=!1)=>ao(Qe,rt,oo,Co,Io,ls),next:()=>Bo(Qe,rt),prev:()=>is(Qe,rt),replace:(oo,Co,Io)=>wr(Qe,rt,oo,Co,Io)}),Yt=Qe=>{const rt=o(q.none()),cn=()=>rt.get().each(Qe);return{clear:()=>{cn(),rt.set(q.none())},isSet:()=>rt.get().isSome(),get:()=>rt.get(),set:oo=>{cn(),rt.set(q.some(oo))}}},mo=()=>{const Qe=Yt(B);return{...Qe,on:cn=>Qe.get().each(cn)}},$o=(Qe,rt)=>{const cn=mo();Qe.undoManager.add();const yn=me.trim(Qe.selection.getContent({format:"text"})),zn=zo=>{zo.setEnabled("next",Xe(Qe,rt)),zo.setEnabled("prev",qe(Qe,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)=>{We(["replace","replaceall","prev","next"],na=>zo.setEnabled(na,!Qo))},oo=(zo,Qo)=>{Qo.redial(ta(zo,Qo.getData()))},Co=(zo,Qo)=>{H.browser.isSafari()&&H.deviceType.isTouch()&&(Qo==="find"||Qo==="replace"||Qo==="replaceall")&&zo.focus(Qo)},Io=zo=>{ar(Qe,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(Qe,rt);else{const ca=ao(Qe,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},Ka=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:Ka(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(Qe,rt,na.replacetext)?zn(ns):Io(ns);break;case"replaceall":wr(Qe,rt,na.replacetext,!0,!0),Io(ns);break;case"prev":is(Qe,rt),zn(ns);break;case"next":Bo(Qe,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:()=>{Qe.focus(),ar(Qe,rt),Qe.undoManager.add()}});cn.set(Qe.windowManager.open(ta(!1,Es),{inline:"toolbar"}))},Zo=(Qe,rt)=>{Qe.addCommand("SearchReplace",()=>{$o(Qe,rt)})},js=(Qe,rt)=>()=>{$o(Qe,rt)},ln=(Qe,rt)=>{Qe.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:js(Qe,rt),icon:"search"}),Qe.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:js(Qe,rt),icon:"search",shortcut:"Meta+F"}),Qe.shortcuts.add("Meta+F","",js(Qe,rt))};var Wt=()=>{s.add("searchreplace",Qe=>{const rt=o({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1,inSelection:!1});return Zo(Qe,rt),ln(Qe,rt),Ft(Qe,rt)})};Wt()})();(function(){var o=tinymce.util.Tools.resolve("tinymce.PluginManager");const s=(I,j,pe)=>{var Oe;return pe(I,j.prototype)?!0:((Oe=I.constructor)===null||Oe===void 0?void 0:Oe.name)===j.name},i=I=>{const j=typeof I;return I===null?"null":j==="object"&&Array.isArray(I)?"array":j==="object"&&s(I,String,(pe,Oe)=>Oe.isPrototypeOf(pe))?"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"),F=m("number"),Z=()=>{},K=(I,j)=>pe=>I(j(pe)),X=I=>()=>I,q=I=>I,W=(I,j)=>I===j;function H(I,...j){return(...pe)=>{const Oe=j.concat(pe);return I.apply(null,Oe)}}const me=I=>{I()},et=X(!1),$e=X(!0);class te{constructor(j,pe){this.tag=j,this.value=pe}static some(j){return new te(!0,j)}static none(){return te.singletonNone}fold(j,pe){return this.tag?pe(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 We=Object.keys,ft=Object.hasOwnProperty,lt=(I,j)=>{const pe=We(I);for(let Oe=0,ut=pe.length;Oe<ut;Oe++){const on=pe[Oe],$n=I[on];j($n,on)}},Ne=I=>(j,pe)=>{I[pe]=j},ue=(I,j,pe,Oe)=>{lt(I,(ut,on)=>{(j(ut,on)?pe:Oe)(ut,on)})},Pt=(I,j)=>{const pe={};return ue(I,j,Ne(pe),Z),pe},ye=(I,j)=>{const pe=[];return lt(I,(Oe,ut)=>{pe.push(j(Oe,ut))}),pe},De=I=>ye(I,q),R=I=>We(I).length,Ue=(I,j)=>be(I,j)?te.from(I[j]):te.none(),be=(I,j)=>ft.call(I,j),ot=(I,j)=>be(I,j)&&I[j]!==void 0&&I[j]!==null,nt=I=>{for(const j in I)if(ft.call(I,j))return!1;return!0},ge=Array.prototype.indexOf,Ze=Array.prototype.push,Tt=(I,j)=>ge.call(I,j),He=(I,j)=>Tt(I,j)>-1,vt=(I,j)=>{for(let pe=0,Oe=I.length;pe<Oe;pe++){const ut=I[pe];if(j(ut,pe))return!0}return!1},Be=(I,j)=>{const pe=[];for(let Oe=0;Oe<I;Oe++)pe.push(j(Oe));return pe},dt=(I,j)=>{const pe=I.length,Oe=new Array(pe);for(let ut=0;ut<pe;ut++){const on=I[ut];Oe[ut]=j(on,ut)}return Oe},oe=(I,j)=>{for(let pe=0,Oe=I.length;pe<Oe;pe++){const ut=I[pe];j(ut,pe)}},pn=(I,j)=>{for(let pe=I.length-1;pe>=0;pe--){const Oe=I[pe];j(Oe,pe)}},gt=(I,j)=>{const pe=[],Oe=[];for(let ut=0,on=I.length;ut<on;ut++){const $n=I[ut];(j($n,ut)?pe:Oe).push($n)}return{pass:pe,fail:Oe}},St=(I,j)=>{const pe=[];for(let Oe=0,ut=I.length;Oe<ut;Oe++){const on=I[Oe];j(on,Oe)&&pe.push(on)}return pe},jt=(I,j,pe)=>(pn(I,(Oe,ut)=>{pe=j(pe,Oe,ut)}),pe),Ct=(I,j,pe)=>(oe(I,(Oe,ut)=>{pe=j(pe,Oe,ut)}),pe),ee=(I,j,pe)=>{for(let Oe=0,ut=I.length;Oe<ut;Oe++){const on=I[Oe];if(j(on,Oe))return te.some(on);if(pe(on,Oe))break}return te.none()},ie=(I,j)=>ee(I,j,et),ce=I=>{const j=[];for(let pe=0,Oe=I.length;pe<Oe;++pe){if(!C(I[pe]))throw new Error("Arr.flatten item "+pe+" was not an array, input: "+I);Ze.apply(j,I[pe])}return j},Y=(I,j)=>ce(dt(I,j)),we=(I,j)=>{for(let pe=0,Oe=I.length;pe<Oe;++pe){const ut=I[pe];if(j(ut,pe)!==!0)return!1}return!0},Me=(I,j)=>{const pe={};for(let Oe=0,ut=I.length;Oe<ut;Oe++){const on=I[Oe];pe[String(on)]=j(on,Oe)}return pe},Pe=(I,j)=>j>=0&&j<I.length?te.some(I[j]):te.none(),mt=I=>Pe(I,0),je=I=>Pe(I,I.length-1),bt=(I,j)=>{for(let pe=0;pe<I.length;pe++){const Oe=j(I[pe],pe);if(Oe.isSome())return Oe}return te.none()},$t=8,gn=9,Et=11,Bt=1,dn=3,_n=(I,j)=>{const Oe=(j||document).createElement("div");if(Oe.innerHTML=I,!Oe.hasChildNodes()||Oe.childNodes.length>1){const ut="HTML does not have a single root node";throw console.error(ut,I),new Error(ut)}return Nt(Oe.childNodes[0])},xo=(I,j)=>{const Oe=(j||document).createElement(I);return Nt(Oe)},Qn=(I,j)=>{const Oe=(j||document).createTextNode(I);return Nt(Oe)},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,pe)=>te.from(I.dom.elementFromPoint(j,pe)).map(Nt)},On=(I,j)=>{const pe=I.dom;if(pe.nodeType!==Bt)return!1;{const Oe=pe;if(Oe.matches!==void 0)return Oe.matches(j);if(Oe.msMatchesSelector!==void 0)return Oe.msMatchesSelector(j);if(Oe.webkitMatchesSelector!==void 0)return Oe.webkitMatchesSelector(j);if(Oe.mozMatchesSelector!==void 0)return Oe.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 pe=j===void 0?document:j.dom;return ko(pe)?[]:dt(pe.querySelectorAll(I),an.fromDom)},ws=(I,j)=>{const pe=j===void 0?document:j.dom;return ko(pe)?te.none():te.from(pe.querySelector(I)).map(an.fromDom)},yo=(I,j)=>I.dom===j.dom,Us=On;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 pe=B(j)?j:et;let Oe=I.dom;const ut=[];for(;Oe.parentNode!==null&&Oe.parentNode!==void 0;){const on=Oe.parentNode,$n=an.fromDom(on);if(ut.push($n),pe($n)===!0)break;Oe=on}return ut},Ht=I=>te.from(I.dom.previousSibling).map(an.fromDom),Fn=I=>te.from(I.dom.nextSibling).map(an.fromDom),ao=I=>dt(I.dom.childNodes,an.fromDom),Bo=(I,j)=>{const pe=I.dom.childNodes;return te.from(pe[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 pe=j.ownerDocument;return ar(an.fromDom(j)).fold(()=>pe.body.contains(j),K(qe,Xe))};var Ft=(I,j,pe,Oe,ut)=>I(pe,Oe)?te.some(pe):B(ut)&&ut(pe)?te.none():j(pe,Oe,ut);const Yt=(I,j,pe)=>{let Oe=I.dom;const ut=B(pe)?pe:et;for(;Oe.parentNode;){Oe=Oe.parentNode;const on=an.fromDom(Oe);if(j(on))return te.some(on);if(ut(on))break}return te.none()},mo=(I,j,pe)=>Ft((ut,on)=>on(ut),Yt,I,j,pe),$o=(I,j)=>{const pe=ut=>j(an.fromDom(ut));return ie(I.dom.childNodes,pe).map(an.fromDom)},Zo=(I,j,pe)=>Yt(I,Oe=>On(Oe,j),pe),js=(I,j)=>$o(I,pe=>On(pe,j)),ln=(I,j)=>ws(j,I),Wt=(I,j,pe)=>Ft((ut,on)=>On(ut,on),Zo,I,j,pe),Qe=I=>Wt(I,"[contenteditable]"),rt=(I,j=!1)=>qe(I)?I.dom.isContentEditable:Qe(I).fold(X(j),pe=>cn(pe)==="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 pe=[];return oe(ao(I),Oe=>{j(Oe)&&(pe=pe.concat([Oe])),pe=pe.concat(Es(Oe,j))}),pe},Ka=(I,j)=>Js(I,pe=>On(pe,j)),ta=(I,j)=>Ro(j,I),zo=(I,j,pe)=>{if(b(pe)||x(pe)||F(pe))I.setAttribute(j,pe+"");else throw console.error("Invalid call to Attribute.set. Key ",j,":: Value ",pe,":: Element ",I),new Error("Attribute value was not simple")},Qo=(I,j,pe)=>{zo(I.dom,j,pe)},ns=(I,j)=>{const pe=I.dom;lt(j,(Oe,ut)=>{zo(pe,ut,Oe)})},ca=(I,j)=>{const pe=I.dom.getAttribute(j);return pe===null?void 0:pe},na=(I,j)=>te.from(ca(I,j)),ua=(I,j)=>{I.dom.removeAttribute(j)},Ys=I=>Ct(I.dom.attributes,(j,pe)=>(j[pe.name]=pe.value,j),{}),Yc=(I,j,pe=W)=>I.exists(Oe=>pe(Oe,j)),fi=I=>{const j=[],pe=Oe=>{j.push(Oe)};for(let Oe=0;Oe<I.length;Oe++)I[Oe].each(pe);return j},ac=(I,j,pe)=>I.isSome()&&j.isSome()?te.some(pe(I.getOrDie(),j.getOrDie())):te.none(),cs=I=>I.bind(q),Di=(I,j)=>I?te.some(j):te.none(),ir=(I,j)=>I.substring(j),Fl=(I,j,pe)=>j===""||I.length>=j.length&&I.substr(pe,pe+j.length)===j,si=(I,j)=>Xi(I,j)?ir(I,j.length):I,Xi=(I,j)=>Fl(I,j,0),Ll=(I=>j=>j.replace(I,""))(/^\s+|\s+$/g),mi=I=>I.length>0,Vl=I=>!mi(I),El=(I,j=10)=>{const pe=parseInt(I,j);return isNaN(pe)?te.none():te.some(pe)},Hl=I=>{const j=parseFloat(I);return isNaN(j)?te.none():te.some(j)},Or=I=>I.style!==void 0&&B(I.style.getPropertyValue),Mi=(I,j,pe)=>{if(!b(pe))throw console.error("Invalid call to CSS.set. Property ",j,":: Value ",pe,":: Element ",I),new Error("CSS value must be a string: "+pe);Or(I)&&I.style.setProperty(j,pe)},_l=(I,j)=>{Or(I)&&I.style.removeProperty(j)},kl=(I,j,pe)=>{const Oe=I.dom;Mi(Oe,j,pe)},_c=(I,j)=>{const pe=I.dom,ut=window.getComputedStyle(pe).getPropertyValue(j);return ut===""&&!qe(I)?pi(pe,j):ut},pi=(I,j)=>Or(I)?I.style.getPropertyValue(j):"",Fr=(I,j)=>{const pe=I.dom,Oe=pi(pe,j);return te.from(Oe).filter(ut=>ut.length>0)},Wr=(I,j)=>{const pe=I.dom;_l(pe,j),Yc(na(I,"style").map(Ll),"")&&ua(I,"style")},Xa=(I,j,pe=0)=>na(I,j).map(Oe=>parseInt(Oe,10)).getOr(pe),ic=(I,j)=>lc(I,j,$e),lc=(I,j,pe)=>Y(ao(I),Oe=>On(Oe,j)?pe(Oe)?[Oe]:[]:lc(Oe,j,pe)),Aa=["tfoot","thead","tbody","colgroup"],xe=I=>He(Aa,I),Ge=(I,j)=>({rows:I,columns:j}),pt=(I,j,pe)=>({element:I,rowspan:j,colspan:pe}),Jt=(I,j,pe,Oe,ut,on)=>({element:I,rowspan:j,colspan:pe,row:Oe,column:ut,isLocked:on}),de=(I,j,pe)=>({element:I,cells:j,section:pe}),Se=(I,j,pe,Oe)=>({startRow:I,startCol:j,finishRow:pe,finishCol:Oe}),st=(I,j,pe)=>({element:I,colspan:j,column:pe}),Xt=(I,j)=>({element:I,columns:j}),In=(I,j,pe=et)=>{if(pe(j))return te.none();if(He(I,fn(j)))return te.some(j);const Oe=ut=>On(ut,"table")||pe(ut);return Zo(j,I.join(","),Oe)},ae=(I,j)=>In(["td","th"],I,j),Ce=I=>ic(I,"th,td"),Ke=I=>On(I,"colgroup")?Ka(I,"col"):Y(Tn(I),j=>Ka(j,"col")),At=(I,j)=>Wt(I,"table",j),kn=I=>ic(I,"tr"),Tn=I=>At(I).fold(X([]),j=>Ka(j,"colgroup")),fs=(I,j)=>dt(I,pe=>{if(fn(pe)==="colgroup"){const Oe=dt(Ke(pe),ut=>{const on=Xa(ut,"span",1);return pt(ut,1,on)});return de(pe,Oe,"colgroup")}else{const Oe=dt(Ce(pe),ut=>{const on=Xa(ut,"rowspan",1),$n=Xa(ut,"colspan",1);return pt(ut,on,$n)});return de(pe,Oe,j(pe))}}),Jr=I=>Ps(I).map(j=>{const pe=fn(j);return xe(pe)?pe:"tbody"}).getOr("tbody"),tn=I=>{const j=kn(I),Oe=[...Tn(I),...j];return fs(Oe,Jr)},da="data-snooker-locked-cols",Vs=I=>na(I,da).bind(j=>te.from(j.match(/\d+/g))).map(j=>Me(j,$e)),cc=(I,j)=>I+","+j,Zr=(I,j,pe)=>te.from(I.access[cc(j,pe)]),us=(I,j,pe)=>{const Oe=gi(I,ut=>pe(j,ut.element));return Oe.length>0?te.some(Oe[0]):te.none()},gi=(I,j)=>{const pe=Y(I.all,Oe=>Oe.cells);return St(pe,j)},Na=I=>{const j={};let pe=0;return oe(I.cells,Oe=>{const ut=Oe.colspan;Be(ut,on=>{const $n=pe+on;j[$n]=st(Oe.element,ut,$n)}),pe+=ut}),j},hi=I=>{const j={},pe=[],ut=mt(I).map(Ol=>Ol.element).bind(At).bind(Vs).getOr({});let on=0,$n=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 Ip=ot(ut,wu.toString()),Pp=Jt(Zl.element,Zl.rowspan,Zl.colspan,io,wu,Ip);for(let $l=0;$l<Zl.colspan;$l++)for(let Fp=0;Fp<Zl.rowspan;Fp++){const Lp=io+Fp,Xh=wu+$l,Rg=cc(Lp,Xh);j[Rg]=Pp,$n=Math.max($n,Xh+1)}Yu.push(Pp)}),on++,pe.push(de(Ol.element,Yu,Ol.section)),io++});const{columns:cr,colgroups:sr}=je(Go).map(Ol=>{const Yu=Na(Ol);return{colgroups:[Xt(Ol.element,De(Yu))],columns:Yu}}).getOrThunk(()=>({colgroups:[],columns:{}}));return{grid:Ge(on,$n),access:j,all:pe,columns:cr,colgroups:sr}},Xc={fromTable:I=>{const j=tn(I);return hi(j)},generate:hi,getAt:Zr,findItem:us,filterItems:gi,justCells:I=>Y(I.all,j=>j.cells),justColumns:I=>De(I.columns),hasColumns:I=>We(I.columns).length>0,getColumnAt:(I,j)=>te.from(I.columns[j])};var Oa=tinymce.util.Tools.resolve("tinymce.util.Tools");const Ha=(I,j,pe)=>{const Oe=I.select("td,th",j);let ut;for(let on=0;on<Oe.length;on++){const $n=I.getStyle(Oe[on],pe);if(_(ut)&&(ut=$n),ut!==$n)return""}return ut},Ri=(I,j,pe)=>{Oa.each("left center right".split(" "),Oe=>{Oe!==pe&&I.formatter.remove("align"+Oe,{},j)}),pe&&I.formatter.apply("align"+pe,{},j)},pu=(I,j,pe)=>{Oa.each("top middle bottom".split(" "),Oe=>{Oe!==pe&&I.formatter.remove("valign"+Oe,{},j)}),pe&&I.formatter.apply("valign"+pe,{},j)},Re=(I,j,pe)=>{I.dispatch("TableModified",{...pe,table:j})},Fe=(I,j)=>Hl(I).getOr(j),Dt=(I,j,pe)=>Fe(_c(I,j),pe),nn=(I,j,pe,Oe)=>{const ut=Dt(I,`padding-${pe}`,0),on=Dt(I,`padding-${Oe}`,0),$n=Dt(I,`border-${pe}-width`,0),io=Dt(I,`border-${Oe}-width`,0);return j-ut-on-$n-io},vo=(I,j)=>{const pe=I.dom,Oe=pe.getBoundingClientRect().width||pe.offsetWidth;return j==="border-box"?Oe:nn(I,Oe,"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",Ji=Be(5,I=>{const j=`${I+1}px`;return{title:j,value:j}}),vi=dt(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],I=>({title:I,value:I.toLowerCase()})),$r="100%",sa=I=>{var j;const pe=I.dom,Oe=(j=pe.getParent(I.selection.getStart(),pe.isBlock))!==null&&j!==void 0?j:I.getBody();return rs(an.fromDom(Oe))+"px"},xa=(I,j)=>sf(I)||!zl(I)?j:Tm(I)?{...j,width:sa(I)}:{...j,width:$r},ri=(I,j)=>sf(I)||zl(I)?j:Tm(I)?{...j,width:sa(I)}:{...j,width:$r},Qr=I=>j=>j.options.get(I),za=I=>{const j=I.options.register;j("table_border_widths",{processor:"object[]",default:Ji}),j("table_border_styles",{processor:"object[]",default:vi}),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"),km=Qr("table_border_styles"),Lu=Qr("table_cell_advtab"),tf=Qr("table_row_advtab"),nf=Qr("table_advtab"),fd=Qr("table_appearance_options"),md=Qr("table_grid"),zl=Qr("table_style_by_css"),Bi=Qr("table_cell_class_list"),Lh=Qr("table_row_class_list"),gu=Qr("table_class_list"),Ep=Qr("table_toolbar"),of=Qr("table_background_color_map"),_p=Qr("table_border_color_map"),Tm=I=>Ks(I)==="fixed",sf=I=>Ks(I)==="responsive",Am=I=>{const j=I.options,pe=j.get("table_default_styles");return j.isSet("table_default_styles")?pe:xa(I,pe)},kp=I=>{const j=I.options,pe=j.get("table_default_attributes");return j.isSet("table_default_attributes")?pe:ri(I,pe)},pd=(I,j)=>j.column>=I.startCol&&j.column+j.colspan-1<=I.finishCol&&j.row>=I.startRow&&j.row+j.rowspan-1<=I.finishRow,Tp=(I,j)=>{let pe=!0;const Oe=H(pd,j);for(let ut=j.startRow;ut<=j.finishRow;ut++)for(let on=j.startCol;on<=j.finishCol;on++)pe=pe&&Xc.getAt(I,ut,on).exists(Oe);return pe?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)),rf=(I,j,pe)=>{const Oe=Xc.findItem(I,j,yo),ut=Xc.findItem(I,pe,yo);return Oe.bind(on=>ut.map($n=>tt(on,$n)))},cl=(I,j,pe)=>rf(I,j,pe).bind(Oe=>Tp(I,Oe)),Lv=(I,j,pe)=>{const Oe=Vh(I);return cl(Oe,j,pe)},Vh=Xc.fromTable,gd=(I,j)=>{Ps(I).each(Oe=>{Oe.dom.insertBefore(j.dom,I.dom)})},$s=(I,j)=>{Fn(I).fold(()=>{Ps(I).each(ut=>{bi(ut,j)})},Oe=>{gd(Oe,j)})},ra=(I,j)=>{is(I).fold(()=>{bi(I,j)},Oe=>{I.dom.insertBefore(j.dom,Oe.dom)})},bi=(I,j)=>{I.dom.appendChild(j.dom)},Vu=(I,j)=>{gd(I,j),bi(j,I)},Ag=(I,j)=>{oe(j,(pe,Oe)=>{const ut=Oe===0?I:j[Oe-1];$s(ut,pe)})},af=(I,j)=>{oe(j,pe=>{bi(I,pe)})},Ii=I=>{const j=I.dom;j.parentNode!==null&&j.parentNode.removeChild(j)},Nm=I=>{const j=ao(I);j.length>0&&Ag(I,j),Ii(I)},Hu=((I,j)=>{const pe=on=>{if(!I(on))throw new Error("Can only get "+j+" value of a "+j+" node");return Oe(on).getOr("")},Oe=on=>I(on)?te.from(on.dom.nodeValue):te.none();return{get:pe,getOption:Oe,set:(on,$n)=>{if(!I(on))throw new Error("Can only set raw "+j+" value of a "+j+" node");on.dom.nodeValue=$n}}})(Pr,"text"),zu=I=>Hu.get(I),Ff=(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"],$m=()=>{const I=ts=>an.fromDom(ts.dom.cloneNode(!1)),j=ts=>uo(ts).dom,pe=ts=>Ir(ts)?fn(ts)==="body"?!0:He(uc,fn(ts)):!1,Oe=ts=>Ir(ts)?He(["br","img","hr","input"],fn(ts)):!1,ut=ts=>Ir(ts)&&ca(ts,"contenteditable")==="false",on=(ts,cr)=>ts.dom.compareDocumentPosition(cr.dom),$n=(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:X({selector:Zo,closest:Wt,predicate:Yt,all:_t}),down:X({selector:ta,predicate:Es}),styles:X({get:_c,getRaw:Fr,set:kl,remove:Wr}),attrs:X({get:ca,set:Qo,remove:ua,copyTo:$n}),insert:X({before:gd,after:$s,afterAll:Ag,append:bi,appendAll:af,prepend:ra,wrap:Vu}),remove:X({unwrap:Nm,remove:Ii}),create:X({nu:an.fromTag,clone:I,text:an.fromText}),query:X({comparePosition:on,prevSibling:Ht,nextSibling:Fn}),property:X({children:ao,name:fn,parent:Ps,document:j,isText:Pr,isComment:rr,isElement:Ir,isSpecial:io,getLanguage:Go,getText:zu,setText:Ff,isBoundary:pe,isEmptyTag:Oe,isNonEditable:ut}),eq:yo,is:Us}};const ai=(I,j,pe,Oe)=>{const ut=pe[0],on=pe.slice(1);return Oe(I,j,ut,on)},Uu=(I,j,pe)=>pe.length>0?ai(I,j,pe,kc):te.none(),kc=(I,j,pe,Oe)=>{const ut=j(I,pe);return jt(Oe,(on,$n)=>{const io=j(I,$n);return Pi(I,on,io)},ut)},Pi=(I,j,pe)=>j.bind(Oe=>pe.filter(H(I.eq,Oe))),hd=Uu,Hh=$m(),Dm=(I,j)=>hd(Hh,(pe,Oe)=>I(Oe),j),Qc=I=>Zo(I,"table"),lf=(I,j)=>{const pe=ta(I,j);return pe.length>0?te.some(pe):te.none()},zh=(I,j,pe)=>ln(I,j).bind(Oe=>ln(I,pe).bind(ut=>Dm(Qc,[Oe,ut]).map(on=>({first:Oe,last:ut,table:on})))),Ap=(I,j)=>lf(I,j),Uh=(I,j,pe)=>zh(I,j,pe).bind(Oe=>{const ut=Go=>yo(I,Go),on="thead,tfoot,tbody,table",$n=Zo(Oe.first,on,ut),io=Zo(Oe.last,on,ut);return $n.bind(Go=>io.bind(ts=>yo(Go,ts)?Lv(Oe.table,Oe.first,Oe.last):te.none()))}),jh=I=>dt(I,an.fromDom),Np="data-mce-selected",ju="td["+Np+"],th["+Np+"]",Mm="data-mce-first-selected",hu="td["+Mm+"],th["+Mm+"]",Lr="data-mce-last-selected",Ua="td["+Lr+"],th["+Lr+"]",ul={selected:Np,selectedSelector:ju,firstSelected:Mm,firstSelectedSelector:hu,lastSelected:Lr,lastSelectedSelector:Ua},Rm=I=>At(I).bind(j=>Ap(j,ul.firstSelectedSelector)).fold(X(I),j=>j[0]),Lf=I=>(j,pe)=>{const Oe=fn(j),ut=Oe==="col"||Oe==="colgroup"?Rm(j):j;return Wt(ut,I,pe)},ja=Lf("th,td,caption"),ho=Lf("th,td"),Bm=I=>jh(I.model.table.getSelectedCells()),Wu=(I,j)=>{const pe=ho(I),Oe=pe.bind(ut=>At(ut)).map(ut=>kn(ut));return ac(pe,Oe,(ut,on)=>St(on,$n=>vt(jh($n.dom.cells),io=>ca(io,j)==="1"||yo(io,ut)))).getOr([])},dl=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],Ws=I=>({value:Ng(I)}),cf=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Im=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Op=I=>cf.test(I)||Im.test(I),Ng=I=>si(I,"#").toUpperCase(),es=I=>Op(I)?te.some({value:Ng(I)}):te.none(),ha=I=>{const j=I.toString(16);return(j.length===1?"0"+j:j).toUpperCase()},vd=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,pe,Oe)=>({red:I,green:j,blue:pe,alpha:Oe}),Ja=(I,j,pe,Oe)=>{const ut=parseInt(I,10),on=parseInt(j,10),$n=parseInt(pe,10),io=parseFloat(Oe);return Ul(ut,on,$n,io)},Qi=I=>{const j=Tl.exec(I);if(j!==null)return te.some(Ja(j[1],j[2],j[3],"1"));const pe=fl.exec(I);return pe!==null?te.some(Ja(pe[1],pe[2],pe[3],pe[4])):te.none()},dc=I=>es(I).orThunk(()=>Qi(I).map(vd)).getOrThunk(()=>{const j=document.createElement("canvas");j.height=1,j.width=1;const pe=j.getContext("2d");pe.clearRect(0,0,j.width,j.height),pe.fillStyle="#FFFFFF",pe.fillStyle=I,pe.fillRect(0,0,1,1);const Oe=pe.getImageData(0,0,1,1).data,ut=Oe[0],on=Oe[1],$n=Oe[2],io=Oe[3];return vd(Ul(ut,on,$n,io))}),$p=I=>Qi(I).map(vd).map(j=>"#"+j.value).getOr(I),Dr=I=>{let j=I;return{get:()=>j,set:ut=>{j=ut}}},Dp=I=>{const j=Dr(te.none()),pe=()=>j.get().each(I);return{clear:()=>{pe(),j.set(te.none())},isSet:()=>j.get().isSome(),get:()=>j.get(),set:io=>{pe(),j.set(te.some(io))}}},Ea=()=>Dp(I=>I.unbind()),bd=(I,j,pe)=>Oe=>{const ut=Ea(),on=Vl(pe),$n=()=>{const io=Bm(I),Go=ts=>I.formatter.match(j,{value:pe},ts.dom,on);on?(Oe.setActive(!vt(io,Go)),ut.set(I.formatter.formatChanged(j,ts=>Oe.setActive(!ts),!0))):(Oe.setActive(we(io,Go)),ut.set(I.formatter.formatChanged(j,Oe.setActive,!1,{value:pe})))};return I.initialized?$n():I.on("init",$n),ut.clear},vu=I=>ot(I,"menu"),ur=I=>dt(I,j=>{const pe=j.text||j.title||"";return vu(j)?{text:pe,items:ur(j.menu)}:{text:pe,value:j.value}}),eu=I=>I.length?te.some(ur([{text:"Select...",value:"mce-no-match"},...I])):te.none(),Vf=(I,j,pe,Oe)=>dt(j,ut=>{const on=ut.text||ut.title;return vu(ut)?{type:"nestedmenuitem",text:on,getSubmenuItems:()=>Vf(I,ut.menu,pe,Oe)}:{text:on,type:"togglemenuitem",onAction:()=>Oe(ut.value),onSetup:bd(I,pe,ut.value)}}),yd=(I,j)=>pe=>{I.execCommand("mceTableApplyCellStyle",!1,{[j]:pe})},Mr=I=>Y(I,j=>vu(j)?[{...j,menu:Mr(j.menu)}]:mi(j.value)?[j]:[]),Zu=(I,j,pe,Oe)=>ut=>ut(Vf(I,j,pe,Oe)),fc=(I,j,pe)=>{const Oe=dt(j,ut=>({text:ut.title,value:"#"+dc(ut.value).value,type:"choiceitem"}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:Oe.length>0?Oe:void 0,allowCustomColors:!1},onAction:ut=>{const on=ut.value==="remove"?"":ut.value;I.execCommand("mceTableApplyCellStyle",!1,{[pe]:on})}}]},vs=I=>()=>{const pe=I.queryCommandValue("mceTableRowType")==="header"?"body":"header";I.execCommand("mceTableRowType",!1,{type:pe})},uf=I=>()=>{const pe=I.queryCommandValue("mceTableColType")==="th"?"td":"th";I.execCommand("mceTableColType",!1,{type:pe})},Mp=I=>eu(Bi(I)).map(j=>({name:"class",type:"listbox",label:"Class",items:j})),V=[{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=>V.concat(Mp(I).toArray()),ve=(I,j)=>{const Oe=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(ur(km(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(Oe):Oe}},ct={normal:(I,j)=>{const pe=I.dom;return{setAttrib:($n,io)=>{pe.setAttrib(j,$n,io)},setStyle:($n,io)=>{pe.setStyle(j,$n,io)},setFormat:($n,io)=>{io===""?I.formatter.remove($n,{value:null},j,!0):I.formatter.apply($n,{value:io},j)}}}},wn=Xr("th"),Do=(I,j)=>I&&j?"sectionCells":I?"section":"cells",os=I=>{const j=I.section==="thead",pe=Yc(Xo(I.cells),"th");return I.section==="tfoot"?{type:"footer"}:j||pe?{type:"header",subType:Do(j,pe)}:{type:"body"}},Xo=I=>{const j=St(I,pe=>wn(pe.element));return j.length===0?te.some("td"):j.length===I.length?te.some("th"):te.none()},po=I=>{const j=dt(I,ut=>os(ut).type),pe=He(j,"header"),Oe=He(j,"footer");if(!pe&&!Oe)return te.some("body");{const ut=He(j,"body");return pe&&!ut&&!Oe?te.some("header"):!pe&&!ut&&Oe?te.some("footer"):te.none()}},Vr=I=>{let j=!1,pe;return(...Oe)=>(j||(j=!0,pe=I.apply(null,Oe)),pe)},aa=(I,j)=>bt(I.all,pe=>ie(pe.cells,Oe=>yo(j,Oe.element))),mc=(I,j,pe)=>{const Oe=dt(j.selection,on=>ae(on).bind($n=>aa(I,$n)).filter(pe)),ut=fi(Oe);return Di(ut.length>0,ut)},jl=(I,j)=>j.mergable,Vv=(I,j)=>j.unmergable,Hf=(I,j)=>mc(I,j,$e),Wh=(I,j)=>aa(I,j).exists(pe=>!pe.isLocked),Fi=(I,j)=>we(j,pe=>Wh(I,pe)),Zh=(I,j)=>jl(I,j).filter(pe=>Fi(I,pe.cells)),G0=(I,j)=>Vv(I,j).filter(pe=>Fi(I,pe));({...{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=[],pe={};return oe(I,(Oe,ut)=>{const on=We(Oe);if(on.length!==1)throw new Error("one and only one name per case");const $n=on[0],io=Oe[$n];if(pe[$n]!==void 0)throw new Error("duplicate key detected:"+$n);if($n==="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($n),pe[$n]=(...Go)=>{const ts=Go.length;if(ts!==io.length)throw new Error("Wrong number of arguments to case "+$n+". 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[ut].apply(null,Go)},match:sr=>{const qr=We(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[$n].apply(null,Go)},log:sr=>{console.log(sr,{constructors:j,constructor:$n,params:Go})}}}}),pe}}.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])});const Hv=(I,j)=>{const pe=Xc.fromTable(I);return Hf(pe,j).bind(ut=>{const on=ut[ut.length-1],$n=ut[0].row,io=on.row+on.rowspan,Go=pe.all.slice($n,io);return po(Go)}).getOr("")},Vi=I=>Xi(I,"rgb")?$p(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(Vi).getOr(""),backgroundcolor:Fr(j,"background-color").map(Vi).getOr("")}},tu=I=>{const j=I[0],pe=I.slice(1);return oe(pe,Oe=>{oe(We(j),ut=>{lt(Oe,(on,$n)=>{const io=j[ut];io!==""&&ut===$n&&io!==on&&(j[ut]=ut==="class"?"mce-no-match":"")})})}),j},Pm=(I,j,pe,Oe)=>ie(I,ut=>!_(pe.formatter.matchNode(Oe,j+ut))).getOr(""),Rp=H(Pm,["left","center","right"],"align"),q0=H(Pm,["top","middle","bottom"],"valign"),Yh=(I,j)=>{const pe=Am(I),Oe=kp(I),ut=()=>({borderstyle:Ue(pe,"border-style").getOr(""),bordercolor:Vi(Ue(pe,"border-color").getOr("")),backgroundcolor:Vi(Ue(pe,"background-color").getOr(""))}),on={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""},$n=()=>{const cr=pe["border-width"];return zl(I)&&cr?{border:cr}:Ue(Oe,"border").fold(()=>({}),sr=>({border:sr}))},io=j?ut():{},Go=()=>{const cr=Ue(pe,"border-spacing").or(Ue(Oe,"cellspacing")).fold(()=>({}),qr=>({cellspacing:qr})),sr=Ue(pe,"border-padding").or(Ue(Oe,"cellpadding")).fold(()=>({}),qr=>({cellpadding:qr}));return{...cr,...sr}};return{...on,...pe,...Oe,...io,...$n(),...Go()}},bu=I=>At(an.fromDom(I)).map(j=>{const pe={selection:jh(I.cells)};return Hv(j,pe)}).getOr(""),wd=(I,j,pe)=>{const Oe=(io,Go)=>{const ts=Fr(an.fromDom(Go),"border-width");return zl(I)&&ts.isSome()?ts.getOr(""):io.getAttrib(Go,"border")||Ha(I.dom,Go,"border-width")||Ha(I.dom,Go,"border")||""},ut=I.dom,on=zl(I)?ut.getStyle(j,"border-spacing")||ut.getAttrib(j,"cellspacing"):ut.getAttrib(j,"cellspacing")||ut.getStyle(j,"border-spacing"),$n=zl(I)?Ha(ut,j,"padding")||ut.getAttrib(j,"cellpadding"):ut.getAttrib(j,"cellpadding")||Ha(ut,j,"padding");return{width:ut.getStyle(j,"width")||ut.getAttrib(j,"width"),height:ut.getStyle(j,"height")||ut.getAttrib(j,"height"),cellspacing:on??"",cellpadding:$n??"",border:Oe(ut,j),caption:!!ut.select("caption",j)[0],class:ut.getAttrib(j,"class",""),align:Rp(I,j),...pe?Lo(j):{}}},zf=(I,j,pe)=>{const Oe=I.dom;return{height:Oe.getStyle(j,"height")||Oe.getAttrib(j,"height"),class:Oe.getAttrib(j,"class",""),type:bu(j),align:Rp(I,j),...pe?Lo(j):{}}},Gn=(I,j,pe,Oe)=>{const ut=I.dom,on=Oe.getOr(j);return{width:((io,Go)=>ut.getStyle(io,Go)||ut.getAttrib(io,Go))(on,"width"),scope:ut.getAttrib(j,"scope"),celltype:yn(j),class:ut.getAttrib(j,"class",""),halign:Rp(I,j),valign:q0(I,j),...pe?Lo(j):{}}},Tc=(I,j)=>{const pe=Xc.fromTable(I),Oe=Xc.justCells(pe),ut=St(Oe,on=>vt(j,$n=>yo(on.element,$n)));return dt(ut,on=>({element:on.element.dom,column:Xc.getColumnAt(pe,on.column).map($n=>$n.element.dom)}))},zv=(I,j,pe,Oe)=>{Oe("scope")&&I.setAttrib("scope",pe.scope),Oe("class")&&pe.class!=="mce-no-match"&&I.setAttrib("class",pe.class),Oe("width")&&j.setStyle("width",oo(pe.width))},Fm=(I,j,pe)=>{pe("backgroundcolor")&&I.setFormat("tablecellbackgroundcolor",j.backgroundcolor),pe("bordercolor")&&I.setFormat("tablecellbordercolor",j.bordercolor),pe("borderstyle")&&I.setFormat("tablecellborderstyle",j.borderstyle),pe("borderwidth")&&I.setFormat("tablecellborderwidth",oo(j.borderwidth))},yu=(I,j,pe,Oe)=>{const ut=j.length===1;oe(j,on=>{const $n=on.element,io=ut?$e:Oe,Go=ct.normal(I,$n),ts=on.column.map(cr=>ct.normal(I,cr)).getOr(Go);zv(Go,ts,pe,io),Lu(I)&&Fm(Go,pe,io),Oe("halign")&&Ri(I,$n,pe.halign),Oe("valign")&&pu(I,$n,pe.valign)})},Og=(I,j)=>{I.execCommand("mceTableCellType",!1,{type:j.celltype,no_events:!0})},Uf=(I,j,pe,Oe)=>{const ut=Pt(Oe,(on,$n)=>pe[$n]!==on);R(ut)>0&&j.length>=1&&At(j[0]).each(on=>{const $n=Tc(on,j),io=R(Pt(ut,(ts,cr)=>cr!=="scope"&&cr!=="celltype"))>0,Go=be(ut,"celltype");(io||be(ut,"scope"))&&yu(I,$n,Oe,H(be,ut)),Go&&Og(I,Oe),Re(I,on.dom,{structure:Go,style:io})})},Lm=(I,j,pe,Oe)=>{const ut=Oe.getData();Oe.close(),I.undoManager.transact(()=>{Uf(I,j,pe,ut),I.focus()})},$g=(I,j)=>{const pe=At(j[0]).map(Oe=>dt(Tc(Oe,j),ut=>Gn(I,ut.element,Lu(I),ut.column)));return tu(pe.getOrDie())},Gu=I=>{const j=Bm(I);if(j.length===0)return;const pe=$g(I,j),Oe={type:"tabpanel",tabs:[{title:"General",name:"general",items:ne(I)},ve(I,"cell")]},ut={type:"panel",items:[{type:"grid",columns:2,items:ne(I)}]};I.windowManager.open({title:"Cell Properties",size:"normal",body:Lu(I)?Oe:ut,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:pe,onSubmit:H(Lm,I,j,pe)})},Y0=I=>eu(Lh(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(Y0(I).toArray()),Al=(I,j,pe)=>{pe("class")&&j.class!=="mce-no-match"&&I.setAttrib("class",j.class),pe("height")&&I.setStyle("height",oo(j.height))},qu=(I,j,pe)=>{pe("backgroundcolor")&&I.setStyle("background-color",j.backgroundcolor),pe("bordercolor")&&I.setStyle("border-color",j.bordercolor),pe("borderstyle")&&I.setStyle("border-style",j.borderstyle)},Qa=(I,j,pe,Oe)=>{const on=j.length===1?$e:Oe;oe(j,$n=>{const io=Ka(an.fromDom($n),"td,th"),Go=ct.normal(I,$n);Al(Go,pe,on),tf(I)&&qu(Go,pe,on),Oe("height")&&oe(io,ts=>{I.dom.setStyle(ts.dom,"height",null)}),Oe("align")&&Ri(I,$n,pe.align)})},Bp=(I,j)=>{I.execCommand("mceTableRowType",!1,{type:j.type,no_events:!0})},ei=(I,j,pe,Oe)=>{const ut=Pt(Oe,(on,$n)=>pe[$n]!==on);if(R(ut)>0){const on=be(ut,"type"),$n=on?R(ut)>1:!0;$n&&Qa(I,j,Oe,H(be,ut)),on&&Bp(I,Oe),At(an.fromDom(j[0])).each(io=>Re(I,io.dom,{structure:on,style:$n}))}},Fs=(I,j,pe,Oe)=>{const ut=Oe.getData();Oe.close(),I.undoManager.transact(()=>{ei(I,j,pe,ut),I.focus()})},Kh=I=>{const j=Wu(Co(I),ul.selected);if(j.length===0)return;const pe=dt(j,$n=>zf(I,$n.dom,tf(I))),Oe=tu(pe),ut={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:tf(I)?ut:on,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Oe,onSubmit:H(Fs,I,dt(j,$n=>$n.dom),Oe)})},sn=(I,j,pe)=>{const Oe=pe?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],ut=[{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}],on=fd(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"}]}]:[],$n=[{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 Oe.concat(ut).concat(on).concat($n).concat(io)},Ls=(I,j,pe,Oe)=>{if(j.tagName==="TD"||j.tagName==="TH")b(pe)&&O(Oe)?I.setStyle(j,pe,Oe):I.setStyles(j,pe);else if(j.children)for(let ut=0;ut<j.children.length;ut++)Ls(I,j.children[ut],pe,Oe)},Uv=(I,j,pe,Oe)=>{const ut=I.dom,on={},$n={},io=zl(I),Go=nf(I),ts=parseFloat(pe.border)===0;if(!_(pe.class)&&pe.class!=="mce-no-match"&&(on.class=pe.class),$n.height=oo(pe.height),io?$n.width=oo(pe.width):ut.getAttrib(j,"width")&&(on.width=fo(pe.width)),io?(ts?(on.border=0,$n["border-width"]=""):($n["border-width"]=oo(pe.border),on.border=1),$n["border-spacing"]=oo(pe.cellspacing)):(on.border=ts?0:pe.border,on.cellpadding=pe.cellpadding,on.cellspacing=pe.cellspacing),io&&j.children){const cr={};if(ts?cr["border-width"]="":Oe.border&&(cr["border-width"]=oo(pe.border)),Oe.cellpadding&&(cr.padding=oo(pe.cellpadding)),Go&&Oe.bordercolor&&(cr["border-color"]=pe.bordercolor),!nt(cr))for(let sr=0;sr<j.children.length;sr++)Ls(ut,j.children[sr],cr)}if(Go){const cr=pe;$n["background-color"]=cr.backgroundcolor,$n["border-color"]=cr.bordercolor,$n["border-style"]=cr.borderstyle}ut.setStyles(j,{...Am(I),...$n}),ut.setAttribs(j,{...kp(I),...on})},$a=(I,j,pe,Oe)=>{const ut=I.dom,on=Oe.getData(),$n=Pt(on,(io,Go)=>pe[Go]!==io);Oe.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($n)>0){const io={border:be($n,"border"),bordercolor:be($n,"bordercolor"),cellpadding:be($n,"cellpadding")};Uv(I,j,on,io);const Go=ut.select("caption",j)[0];(Go&&!on.caption||!Go&&on.caption)&&I.execCommand("mceTableToggleCaption"),Ri(I,j,on.align)}if(I.focus(),I.addVisual(),R($n)>0){const io=be($n,"caption"),Go=io?R($n)>1:!0;Re(I,j,{structure:io,style:Go})}})},nu=(I,j)=>{const pe=I.dom;let Oe,ut=Yh(I,nf(I));j?(ut.cols="1",ut.rows="1",nf(I)&&(ut.borderstyle="",ut.bordercolor="",ut.backgroundcolor="")):(Oe=pe.getParent(I.selection.getStart(),"table",I.getBody()),Oe?ut=wd(I,Oe,nf(I)):nf(I)&&(ut.borderstyle="",ut.bordercolor="",ut.backgroundcolor=""));const on=eu(gu(I));on.isSome()&&ut.class&&(ut.class=ut.class.replace(/\s*mce\-item\-table\s*/g,""));const $n={type:"grid",columns:2,items:sn(I,on.getOr([]),j)},io=()=>({type:"panel",items:[$n]}),Go=()=>({type:"tabpanel",tabs:[{title:"General",name:"general",items:[$n]},ve(I,"table")]}),ts=nf(I)?Go():io();I.windowManager.open({title:"Table Properties",size:"normal",body:ts,onSubmit:H($a,I,Oe,ut),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:ut})},yi=I=>{const j=pe=>{ls(Co(I))&&pe()};lt({mceTableProps:H(nu,I,!1),mceTableRowProps:H(Kh,I),mceTableCellProps:H(Gu,I),mceInsertTableDialog:H(nu,I,!0)},(pe,Oe)=>I.addCommand(Oe,()=>j(pe)))},x2=(I,j)=>js(I,j).isSome(),Cd=q,K0=I=>{const j=(Oe,ut)=>na(Oe,ut).exists(on=>parseInt(on,10)>1),pe=Oe=>j(Oe,"rowspan")||j(Oe,"colspan");return I.length>0&&we(I,pe)?te.some(I):te.none()},Wl=(I,j,pe)=>j.length<=1?te.none():Uh(I,pe.firstSelectedSelector,pe.lastSelectedSelector).map(Oe=>({bounds:Oe,cells:j})),Hs=I=>({element:I,mergable:te.none(),unmergable:te.none(),selection:[I]}),Sd=(I,j,pe)=>({element:pe,mergable:Wl(j,I,ul),unmergable:K0(I),selection:Cd(I)}),Dg=I=>{const j=Dr(te.none()),pe=Dr([]);let Oe=te.none();const ut=Xr("caption"),on=Ds=>Oe.forall(Cr=>!Cr[Ds]),$n=()=>ja(Co(I),co(I)),io=()=>ja(Io(I),co(I)),Go=()=>$n().bind(Ds=>cs(ac(At(Ds),io().bind(At),(Cr,Gl)=>yo(Cr,Gl)?ut(Ds)?te.some(Hs(Ds)):te.some(Sd(Bm(I),Cr,Ds)):te.none()))),ts=Ds=>At(Ds.element).map(Gl=>{const _a=Xc.fromTable(Gl),Jh=Hf(_a,Ds).getOr([]),Bg=Ct(Jh,(jf,gc)=>(gc.isLocked&&(jf.onAny=!0,gc.column===0?jf.onFirst=!0:gc.column+gc.colspan>=_a.grid.columns&&(jf.onLast=!0)),jf),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:Zh(_a,Ds).isSome(),unmergeable:G0(_a,Ds).isSome(),locked:Bg}}),cr=()=>{j.set(Vr(Go)()),Oe=j.get().bind(ts),oe(pe.get(),me)},sr=Ds=>(Ds(),pe.set(pe.get().concat([Ds])),()=>{pe.set(St(pe.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)},_a=>{Ds.setEnabled(!Cr(_a)&&I.selection.isEditable()),Ds.setActive(Gl(_a))})),Yu=Ds=>Oe.exists(Cr=>Cr.locked[Ds]),Zl=Ds=>qr(Ds,Cr=>!1),wu=Ds=>qr(Ds,Cr=>ut(Cr.element)),Ip=Ds=>Cr=>qr(Cr,Gl=>ut(Gl.element)||Yu(Ds)),Pp=Ds=>Cr=>qr(Cr,Gl=>ut(Gl.element)||Ds().isNone()),$l=(Ds,Cr)=>Gl=>qr(Gl,_a=>ut(_a.element)||Ds().isNone()||Yu(Cr)),Fp=Ds=>qr(Ds,Cr=>on("mergeable")),Lp=Ds=>qr(Ds,Cr=>on("unmergeable")),Xh=Ds=>Ol(Ds,et,Cr=>At(Cr.element,co(I)).exists(_a=>x2(_a,"caption"))),Rg=(Ds,Cr)=>Gl=>Ol(Gl,_a=>ut(_a.element),()=>I.queryCommandValue(Ds)===Cr),ii=Rg("mceTableRowType","header"),Cu=Rg("mceTableColType","th");return I.on("NodeChange ExecCommand TableSelectorChange",cr),{onSetupTable:Zl,onSetupCellOrRow:wu,onSetupColumn:Ip,onSetupPasteable:Pp,onSetupPasteableColumn:$l,onSetupMergeable:Fp,onSetupUnmergeable:Lp,resetTargets:cr,onSetupTableWithCaption:Xh,onSetupTableRowHeaders:ii,onSetupTableColumnHeaders:Cu,targets:j.get}};var va=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const Mg="x-tinymce/dom-table-",df=Mg+"rows",X0=Mg+"columns",Nl=I=>{var j;const pe=(j=va.read())!==null&&j!==void 0?j:[];return bt(pe,Oe=>te.from(Oe.getType(I)))},Ac=()=>Nl(df),kt=()=>Nl(X0),pc=I=>j=>{const pe=()=>{j.setEnabled(I.selection.isEditable())};return I.on("NodeChange",pe),pe(),()=>{I.off("NodeChange",pe)}},ti=(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 pe=io=>()=>I.execCommand(io),Oe=(io,Go)=>{I.queryCommandSupported(Go.command)&&I.ui.registry.addButton(io,{...Go,onAction:B(Go.onAction)?Go.onAction:pe(Go.command)})},ut=(io,Go)=>{I.queryCommandSupported(Go.command)&&I.ui.registry.addToggleButton(io,{...Go,onAction:B(Go.onAction)?Go.onAction:pe(Go.command)})};Oe("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:j.onSetupTable}),Oe("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:j.onSetupTable}),Oe("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:j.onSetupCellOrRow}),Oe("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:j.onSetupMergeable}),Oe("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:j.onSetupUnmergeable}),Oe("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:j.onSetupCellOrRow}),Oe("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:j.onSetupCellOrRow}),Oe("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:j.onSetupCellOrRow}),Oe("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:j.onSetupCellOrRow}),Oe("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:j.onSetupColumn("onFirst")}),Oe("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:j.onSetupColumn("onLast")}),Oe("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:j.onSetupColumn("onAny")}),Oe("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:j.onSetupCellOrRow}),Oe("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:j.onSetupCellOrRow}),Oe("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:j.onSetupPasteable(Ac)}),Oe("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:j.onSetupPasteable(Ac)}),Oe("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:j.onSetupColumn("onAny")}),Oe("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:j.onSetupColumn("onAny")}),Oe("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:j.onSetupPasteableColumn(kt,"onFirst")}),Oe("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:j.onSetupPasteableColumn(kt,"onLast")}),Oe("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 $n=Mr(Bi(I));$n.length!==0&&I.queryCommandSupported("mceTableCellToggleClass")&&I.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Zu(I,$n,"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",yd(I,"vertical-align")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Zu(I,Jc(I),"tablecellborderwidth",yd(I,"border-width")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Zu(I,km(I),"tablecellborderstyle",yd(I,"border-style")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:io=>io(fc(I,of(I),"background-color")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:io=>io(fc(I,_p(I),"border-color")),onSetup:j.onSetupCellOrRow})),ut("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:j.onSetupTableWithCaption}),ut("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:vs(I),onSetup:j.onSetupTableRowHeaders}),ut("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:uf(I),onSetup:j.onSetupTableColumnHeaders})},Gr=I=>{const j=Oe=>I.dom.is(Oe,"table")&&I.getBody().contains(Oe)&&I.dom.isEditable(Oe.parentNode),pe=Ep(I);pe.length>0&&I.ui.registry.addContextToolbar("table",{predicate:j,items:pe,scope:"node",position:"node"})},Nc=I=>j=>{const pe=()=>{j.setEnabled(I.selection.isEditable())};return I.on("NodeChange",pe),pe(),()=>{I.off("NodeChange",pe)}},ba=(I,j)=>{const pe=sr=>()=>I.execCommand(sr),Oe=(sr,qr)=>I.queryCommandSupported(qr.command)?(I.ui.registry.addMenuItem(sr,{...qr,onAction:B(qr.onAction)?qr.onAction:pe(qr.command)}),!0):!1,ut=(sr,qr)=>{I.queryCommandSupported(qr.command)&&I.ui.registry.addToggleMenuItem(sr,{...qr,onAction:B(qr.onAction)?qr.onAction:pe(qr.command)})},on=sr=>{I.execCommand("mceInsertTable",!1,{rows:sr.numRows,columns:sr.numColumns})},$n=[Oe("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:j.onSetupCellOrRow}),Oe("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:j.onSetupCellOrRow}),Oe("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:j.onSetupCellOrRow}),Oe("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:j.onSetupCellOrRow}),Oe("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:j.onSetupCellOrRow}),Oe("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:j.onSetupCellOrRow}),Oe("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:j.onSetupPasteable(Ac)}),Oe("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:j.onSetupPasteable(Ac)})],io=[Oe("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:j.onSetupColumn("onFirst")}),Oe("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:j.onSetupColumn("onLast")}),Oe("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:j.onSetupColumn("onAny")}),Oe("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:j.onSetupColumn("onAny")}),Oe("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:j.onSetupColumn("onAny")}),Oe("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:j.onSetupPasteableColumn(kt,"onFirst")}),Oe("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:j.onSetupPasteableColumn(kt,"onLast")})],Go=[Oe("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:j.onSetupCellOrRow}),Oe("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:j.onSetupMergeable}),Oe("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:j.onSetupUnmergeable})];md(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:pe("mceInsertTableDialog"),onSetup:Nc(I)}),I.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:pe("mceInsertTableDialog"),onSetup:Nc(I)}),Oe("tableprops",{text:"Table properties",onSetup:j.onSetupTable,command:"mceTableProps"}),Oe("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:j.onSetupTable,command:"mceTableDelete"}),He($n,!0)&&I.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:X("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),He(io,!0)&&I.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:X("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),He(Go,!0)&&I.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:X("tablecellprops tablemergecells tablesplitcells")}),I.ui.registry.addContextMenu("table",{update:()=>(j.resetTargets(),j.targets().fold(X(""),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:()=>Vf(I,ts,"tableclass",sr=>I.execCommand("mceTableToggleClass",!1,sr)),onSetup:j.onSetupTable});const cr=Mr(Bi(I));cr.length!==0&&I.queryCommandSupported("mceTableCellToggleClass")&&I.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:()=>Vf(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:()=>Vf(I,dl,"tablecellverticalalign",yd(I,"vertical-align")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:()=>Vf(I,Jc(I),"tablecellborderwidth",yd(I,"border-width")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:()=>Vf(I,km(I),"tablecellborderstyle",yd(I,"border-style")),onSetup:j.onSetupCellOrRow}),I.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:()=>fc(I,of(I),"background-color"),onSetup:j.onSetupCellOrRow}),I.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:()=>fc(I,_p(I),"border-color"),onSetup:j.onSetupCellOrRow})),ut("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:j.onSetupTableWithCaption}),ut("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:vs(I),onSetup:j.onSetupTableRowHeaders}),ut("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:uf(I),onSetup:j.onSetupTableRowHeaders})},hr=I=>{const j=Dg(I);za(I),yi(I),ba(I,j),ti(I,j),Gr(I)};var Vm=()=>{o.add("table",hr)};Vm()})();(function(){const o=B=>{let F=B;return{get:()=>F,set:X=>{F=X}}};var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const i=(B,F)=>{B.dispatch("VisualBlocks",{state:F})},u=(B,F,Z)=>{B.dom.toggleClass(B.getBody(),"mce-visualblocks"),Z.set(!Z.get()),i(B,Z.get())},m=(B,F,Z)=>{B.addCommand("mceVisualBlocks",()=>{u(B,F,Z)})},h=B=>F=>F.options.get(B),b=B=>{const F=B.options.register;F("visualblocks_default_state",{processor:"boolean",default:!1})},C=h("visualblocks_default_state"),x=(B,F,Z)=>{B.on("PreviewFormats AfterPreviewFormats",K=>{Z.get()&&B.dom.toggleClass(B.getBody(),"mce-visualblocks",K.type==="afterpreviewformats")}),B.on("init",()=>{C(B)&&u(B,F,Z)})},_=(B,F)=>Z=>{Z.setActive(F.get());const K=X=>Z.setActive(X.state);return B.on("VisualBlocks",K),()=>B.off("VisualBlocks",K)},N=(B,F)=>{const Z=()=>B.execCommand("mceVisualBlocks");B.ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:Z,onSetup:_(B,F),context:"any"}),B.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",icon:"visualblocks",onAction:Z,onSetup:_(B,F),context:"any"})};var O=()=>{s.add("visualblocks",(B,F)=>{b(B);const Z=o(!1);m(B,F,Z),N(B,Z),x(B,F,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"),F=_t=>_t==null,Z=_t=>!F(_t),K=C("number");class X{constructor(Ht,Fn){this.tag=Ht,this.value=Fn}static some(Ht){return new X(!0,Ht)}static none(){return X.singletonNone}fold(Ht,Fn){return this.tag?Fn(this.value):Ht()}isSome(){return this.tag}isNone(){return!this.tag}map(Ht){return this.tag?X.some(Ht(this.value)):X.none()}bind(Ht){return this.tag?Ht(this.value):X.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:X.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)?X.some(Ht):X.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()"}}X.singletonNone=new X(!1);const q=(_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)}},H=(_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},me=Object.keys,et=(_t,Ht)=>{const Fn=me(_t);for(let ao=0,Bo=Fn.length;ao<Bo;ao++){const is=Fn[ao],yr=_t[is];Ht(yr,is)}},$e=typeof window<"u"?window:Function("return this;")(),te=(_t,Ht)=>{let Fn=Ht??$e;for(let ao=0;ao<_t.length&&Fn!==void 0&&Fn!==null;++ao)Fn=Fn[_t[ao]];return Fn},We=(_t,Ht)=>{const Fn=_t.split(".");return te(Fn,Ht)},ft=(_t,Ht)=>We(_t,Ht),lt=(_t,Ht)=>{const Fn=ft(_t,Ht);if(Fn==null)throw new Error(_t+" not available on this browser");return Fn},Ne=Object.getPrototypeOf,ue=_t=>lt("HTMLElement",_t),Pt=_t=>{const Ht=We("ownerDocument.defaultView",_t);return N(_t)&&(ue(Ht).prototype.isPrototypeOf(_t)||/^HTML\w*Element$/.test(Ne(_t).constructor.name))},ye=1,De=3,R=_t=>_t.dom.nodeType,Ue=_t=>_t.dom.nodeValue,be=_t=>Ht=>R(Ht)===_t,ot=_t=>nt(_t)&&Pt(_t.dom),nt=be(ye),ge=be(De),Ze=(_t,Ht,Fn)=>{if(_(Fn)||B(Fn)||K(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(" ")},dt=(_t,Ht,Fn)=>{const Bo=Be(_t,Ht).concat([Fn]);return Tt(_t,Ht,Bo.join(" ")),!0},oe=(_t,Ht,Fn)=>{const ao=H(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)=>dt(_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)=>X.from(_t.dom.elementFromPoint(Ht,Fn)).map(Me)},je={" ":"nbsp","":"shy"},bt=(_t,Ht)=>{let Fn="";return et(_t,(ao,Bo)=>{Fn+=Bo}),new RegExp("["+Fn+"]",Ht?"g":"")},$t=_t=>{let Ht="";return et(_t,Fn=>{Ht&&(Ht+=","),Ht+="span.mce-"+Fn}),Ht},gn=bt(je),Et=bt(je,!0),Bt=$t(je),dn="mce-nbsp",_n=_t=>_t.dom.contentEditable,xo=_t=>'<span data-mce-bogus="1" class="mce-'+je[_t]+'">'+_t+"</span>",Qn=_t=>_t.nodeName.toLowerCase()==="span"&&_t.classList.contains("mce-nbsp-wrap"),Nt=_t=>{const Ht=Ue(_t);return ge(_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},On=(_t,Ht,Fn)=>{let ao=[];const Bo=_t.dom,is=q(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(On(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=On(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=Ue(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,F=C.OTHER,Z=ee=>{let ie=F;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},K=ee=>{const ie={};return ce=>{if(ie[ce])return ie[ce];{const Y=ee(ce);return ie[ce]=Y,Y}}},X=ee=>{const ie=K(Z);return m(ee,ie)},q=(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=_,H=O,me=N,et=ee=>ee==="http"||ee==="https",$e=(ee,ie)=>{let ce;for(ce=ie;ce<ee.length&&!H.test(ee[ce]);ce++);return ce},te=(ee,ie)=>{const ce=$e(ee,ie+1);return ee.slice(ie+1,ce).join(W).substr(0,3)==="://"?ce:ie},We=(ee,ie,ce,Y)=>{const we=[],Me=[];let Pe=[];for(let mt=0;mt<ce.length;++mt)if(Pe.push(ee[mt]),q(ce,mt)){const je=ie[mt];if((Y.includeWhitespace||!H.test(je))&&(Y.includePunctuation||!me.test(je))){const bt=mt-Pe.length+1,$t=mt+1,gn=ie.slice(bt,$t).join(W);if(et(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}},ft=()=>({includeWhitespace:!1,includePunctuation:!1}),lt=(ee,ie,ce)=>{ce={...ft(),...ce};const Y=m(ee,ie),we=X(Y);return We(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 je;for(;je=mt.next();)je.nodeType===3?Pe+=Pt(je.data):we(je)&&Pe.length&&(Me.push(Pe),Pe="");return Pe.length&&Me.push(Pe),Me},R=ee=>ee.replace(/\u200B/g,""),Ue=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 Ue(ce)},nt=(ee,ie)=>{const ce=De(ee,ie).join("").replace(/\s/g,"");return Ue(ce)},ge=(ee,ie)=>()=>ie(ee.getBody(),ee.schema),Ze=(ee,ie)=>()=>ie(ee.selection.getRng().cloneContents(),ee.schema),Tt=ee=>ge(ee,be),He=ee=>({body:{getWordCount:Tt(ee),getCharacterCount:ge(ee,ot),getCharacterCountWithoutSpaces:ge(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))},dt=(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=dt(()=>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 i6e=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),l6e=(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})},c6e=o=>btoa(o.match(/\w{2}/g).map(s=>String.fromCharCode(parseInt(s,16))).join(""));function u6e(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,${c6e(C)}`;m.push({base64:x,file:l6e(x)})}}return m}const d6e=(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=u6e(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}},f6e=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})},m6e=async o=>{try{const s=f6e(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}},p6e=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 m6e(_.src);_.img.setAttribute("src",N)}catch{_.img.remove()}});await Promise.all(x)}return i.body.innerHTML},g6e=o=>{o.querySelectorAll("td").forEach(i=>{const u=i.getAttribute("width"),m=i.getAttribute("style")||"";u==="0"&&m.includes("border:none")&&i.remove()})},h6e=o=>{o.querySelectorAll("table").forEach(i=>{i.style.maxWidth="100%"})},v6e=o=>{o.querySelectorAll("table").forEach(i=>{i.style.tableLayout="fixed"})},b6e=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,F=parseInt(B.getAttribute("colspan")||"1"),Z=(parseFloat(C)*F).toFixed(2),X=(B.getAttribute("style")||"").split(";").filter(W=>!W.trim().toLowerCase().startsWith("width")).join(";"),q=X?`${X}; width: ${Z}%`:`width: ${Z}%`;B.setAttribute("style",q)})})}}})},y6e=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)})},w6e=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}})})},C6e=o=>{o.querySelectorAll('[style*="mso-"]').forEach(i=>{const m=(i.getAttribute("style")||"").replace(/mso-[^:]+:[^;]+;/g,"");i.setAttribute("style",m)})},S6e=o=>{o.querySelectorAll('[style*="tab-stops"]').forEach(i=>{const m=(i.getAttribute("style")||"").replace(/tab-stops:[^;]+;/g,"");i.setAttribute("style",m)})},x6e=o=>{o=o.replace(/<a(?!.*?href=)[^>]*>([\s\S]*?)<\/a>/gi,"$1");const i=new DOMParser().parseFromString(o,"text/html");return g6e(i),h6e(i),y6e(i),w6e(i),C6e(i),S6e(i),v6e(i),b6e(i),o=i.body.innerHTML,o};xz.PluginManager.add("pasteprocess",o=>(o.on("paste",s=>{if(s.clipboardData){const i=s.clipboardData.getData("text/html")||s.clipboardData.getData("text");if(i6e(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=x6e(i),h=d6e(m,s);p6e(h).then(b=>{o.insertContent(b),u.close()})}}}),{}));let EH="A4";const lne={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}},E6e=Object.keys(lne).map(o=>`pagesize${o}`).join(" ");xz.PluginManager.add("pagesize",o=>{const s=o.options.register;s("pagesize",{processor:"string",default:"A4"}),EH=(m=>h=>h.options.get(m))("pagesize")(o);const u=m=>{const h=lne[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(lne).forEach(m=>{o.ui.registry.addToggleMenuItem(`pagesize${m}`,{text:m,onAction:()=>{EH=m,u(m)},onSetup:h=>(h.setActive(EH===m),()=>{})})}),o.on("init",()=>{u(EH)}),{}});const _6e=["accordion","advlist","anchor","autolink","autosave","charmap","directionality","importcss","insertdatetime","lists","image","media","pagebreak","preview","save","searchreplace","table","fullscreen","wordcount","pasteprocess","pagesize"],k6e="undo redo | blocks bold italic forecolor removeformat alignleft aligncenter alignright alignjustify outdent indent pagebreakfullscreen preview",T6e={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:E6e}},menubar:"file edit insert table tools help pagesize",cleanup:!0,branding:!1,language:"zh_CN",plugins:_6e,toolbar:k6e,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}`)})})},A6e={name:"ProEditor",components:{Editor:r6e},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(T6e),contentValue:o.modelValue,timeout:null});f.onMounted(()=>{xz.init({license_key:"gpl"}),xz.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}}},N6e={class:"my-tinymce"};function O6e(o,s,i,u,m,h){const b=f.resolveComponent("Editor");return f.openBlock(),f.createElementBlock("div",N6e,[f.createVNode(b,{modelValue:o.contentValue,"onUpdate:modelValue":s[0]||(s[0]=C=>o.contentValue=C),init:o.myInit},null,8,["modelValue","init"])])}const dfe=$i(A6e,[["render",O6e]]),$6e={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 D6e(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 woe=$i($6e,[["render",D6e]]),M6e=["innerHTML"],ffe=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(woe,null,{default:f.withCtx(()=>[f.createElementVNode("div",{innerHTML:s.value},null,8,M6e)]),_:1}))}}),mfe=Symbol("nodesUI"),Pf=()=>{const o=f.inject(mfe);if(!o)throw new Error("NodesUI context not found");return o};function Coe(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 R6e(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 pfe(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(o)}catch(i){return console.error("nodePath query error:",i),null}}const VA=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}`:""),B6e=(o,s,i)=>{var u,m;if(!xoe(o)){const h=i==null?void 0:i.getRootNode(),b=(u=h==null?void 0:h.getSelection)==null?void 0:u.call(h),C=pfe(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)}}},I6e=(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)},P6e=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},F6e=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=Coe(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},L6e=o=>exe(o,s=>f.toValue(s.nodes).map(i=>({...i,color:s.color,activated:s==null?void 0:s.activated,dataGroupKey:s.id}))),Soe=(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})`},V6e=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}},H6e=(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=V6e(C);return x?(x==null?void 0:x.showTextType)==="input"?{...C,...x,inputIndex:i++}:{...C,...x}:null}))==null?void 0:h.filter(Boolean):[]};function z6e(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(F=>F.rowIndex===x&&F.colIndex===O&&!u.has(F));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 U6e(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 gfe=(o,s)=>{var _;const i=H6e(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=oxe(m,"tableIndex"),b=Object.entries(h).map(([N,O])=>({tableIndex:Number(N),nodes:O})),C=tde(b==null?void 0:b.map(N=>z6e(N==null?void 0:N.nodes))),x=(C==null?void 0:C.map(N=>U6e(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}`:""},j6e=(o,s)=>{const i=gfe(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(",")},xoe=o=>o.startOffset===void 0&&o.textNodeIndex===void 0,W6e=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(F=>{const[Z,K]=F.split(":").map(X=>X.trim());Z&&K&&(B[Z]=K)}),B},m=O=>Object.entries(O).map(([B,F])=>`${B}: ${F}`).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)}}},Z6e={key:0},G6e={key:1,class:"td-node"},q6e=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",Z6e,f.toDisplayString((h=s==null?void 0:s.node)==null?void 0:h.label),1)):(f.openBlock(),f.createElementBlock("span",G6e,f.toDisplayString((b=s==null?void 0:s.node)==null?void 0:b.label),1))}}}),hfe=Symbol("nodesEditor"),j0=()=>{const o=f.inject(hfe);if(!o)throw new Error("NodesEditor context not found");return o},CU=f.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,{currentNodes:i}=Pf(),{nodes:u}=j0(),m=f.computed(()=>{var C;return(C=s.node)!=null&&C.id?u.value.some(x=>x.id===s.node.id):!1}),h=f.computed(()=>{var C;if(!((C=s.node)!=null&&C.element))return!1;try{return s.node.element.parentNode!==null}catch(x){return console.warn("Element validation failed:",x),!1}}),b=f.computed(()=>{var C;return(C=f.toValue(i))==null?void 0:C.find(x=>{var _;return(x==null?void 0:x.id)===((_=s==null?void 0:s.node)==null?void 0:_.id)})});return f.watch(()=>b,()=>{var x,_,N,O;const C=f.toValue(b);(x=s==null?void 0:s.node)!=null&&x.element&&(C?C!=null&&C.activated||(s.node.element.style.setProperty("--node-color",(C==null?void 0:C.color)||"#409eff"),s.node.element.style.setProperty("--node-bg-color",Soe((C==null?void 0:C.color)||"#409eff",.1)),s.node.element.setAttribute("data-dataGroupKey",C==null?void 0:C.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("activated")):((_=s.node.element)==null||_.removeAttribute("data-dataGroupKey"),(N=s.node.element)==null||N.removeAttribute("selectable"),(O=s.node.element)==null||O.classList.remove("activated")))},{immediate:!0,deep:!0}),(C,x)=>{var _;return(_=C.node)!=null&&_.element&&h.value&&m.value?(f.openBlock(),f.createBlock(f.Teleport,{key:0,to:C.node.element},[f.renderSlot(C.$slots,"default",{node:C.node},()=>[f.createVNode(q6e,{node:C.node},null,8,["node"])])],8,["to"])):f.createCommentVNode("",!0)}}});function Y6e(){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 vfe(){const{selectedNodes:o,setSelectedNodes:s,containerRef:i,currentNodes:u}=Pf(),{editorId:m,nodes:h}=j0(),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=$e=>{const te=$e.closest(".node-item-td")||$e.closest(".node-item");if(te!==null){let We=[];if(te.classList.contains("node-selected"))return;const ft=te.getAttribute("id");if(ft&&h.value){const lt=h.value.find(Ne=>Ne.id===ft);lt&&(We=[lt])}We=W(We),s(We)}},B=$e=>{$e.button===2&&O($e==null?void 0:$e.target),$e.button===0&&(b.value=!0,N.value&&(C.value={x:$e.pageX,y:$e.pageY},x.value={x:$e.pageX,y:$e.pageY},X($e),H(),N.value.style.display="block",window.addEventListener("mousemove",F),window.addEventListener("mouseup",Z)))},F=qae($e=>{b.value&&(x.value={x:$e.pageX,y:$e.pageY},H())},16),Z=$e=>{$e.button===0&&(b.value=!1,N.value&&(H(),N.value.style.display="none",window.removeEventListener("mousemove",F),window.removeEventListener("mouseup",Z)))},K=Y6e(),X=$e=>{var We,ft;let te=[];if($e.button===0&&($e!=null&&$e.target)){const lt=((We=$e==null?void 0:$e.target)==null?void 0:We.closest(".node-item-td"))||((ft=$e==null?void 0:$e.target)==null?void 0:ft.closest(".node-item"));if(lt!==null){const Ne=lt.getAttribute("id");if(Ne&&h.value){const ue=h.value.find(Pt=>Pt.id===Ne);ue&&(K.value?o.value.some(Pt=>VA(Pt)===VA(ue))?te=o.value.filter(ye=>VA(ye)!==VA(ue)):te=[...o.value,ue]:ue&&(te=[ue]))}}te=W(te),s(te)}},q=()=>{if(!i.value||!(_.value.width>3||_.value.height>3))return;let $e=[];const te={left:_.value.left,right:_.value.left+_.value.width,top:_.value.top,bottom:_.value.top+_.value.height};if(i.value.querySelectorAll("*").forEach(ft=>{const lt=ft.getBoundingClientRect(),Ne=window.scrollX||window.pageXOffset,ue=window.scrollY||window.pageYOffset,Pt={left:lt.left+Ne,right:lt.right+Ne,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=ft.getAttribute("id");if(ye&&h.value){const De=h.value.find(R=>R.id===ye);De&&($e=[...$e,De])}}}),$e=W($e),K.value){const ft=new Set(o.value.map(Ne=>VA(Ne))),lt=$e.filter(Ne=>!ft.has(VA(Ne)));s([...o.value,...lt])}else s($e)},W=$e=>{var We;let te=[];if($e.length>0){const ft=(We=$e.map(ye=>ye==null?void 0:ye.groupKey))==null?void 0:We.filter(Boolean),lt=new Set(ft),Ne=Array.from(lt),ue=h.value.filter(ye=>Ne.includes(ye.groupKey));te=[...$e,...ue],te=[...Cxe(te.filter(ye=>ye==null?void 0:ye.id),"id")||[],...te.filter(ye=>!ye.id)]}if(u&&u.value&&u.value.length>0){const ft=new Set(u.value.map(lt=>lt.id).filter(Boolean));te=te.filter(lt=>lt.id?!ft.has(lt.id):!0)}return te},H=qae(()=>{if(!N.value)return;const{x:$e,y:te}=C.value,{x:We,y:ft}=x.value,lt=Math.min($e,We),Ne=Math.min(te,ft),ue=Math.abs($e-We),Pt=Math.abs(te-ft);_.value={left:lt,top:Ne,width:ue,height:Pt}},16),me=$e=>{if(!N.value)return;const{left:te,top:We,width:ft,height:lt}=f.toValue($e);N.value.style.left=`${te}px`,N.value.style.top=`${We}px`,N.value.style.width=`${ft}px`,N.value.style.height=`${lt}px`},et=()=>{if(!i.value)return;i.value.addEventListener("mousedown",B);const $e=document.getElementById(`select_area_${m}`);if($e){N.value=$e;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(_,($e,te)=>{di($e,te)||(me($e),b.value&&q())},{deep:!0}),f.watch(()=>i.value,$e=>{f.toValue($e)&&et()},{immediate:!0}),f.onUnmounted(()=>{i.value&&i.value.removeEventListener("mousedown",B)}),{isSelecting:b,selectionBox:N}}function bfe(){const{selectedNodes:o,containerRef:s}=Pf(),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 ud=[];for(let o=0;o<256;++o)ud.push((o+256).toString(16).slice(1));function K6e(o,s=0){return(ud[o[s+0]]+ud[o[s+1]]+ud[o[s+2]]+ud[o[s+3]]+"-"+ud[o[s+4]]+ud[o[s+5]]+"-"+ud[o[s+6]]+ud[o[s+7]]+"-"+ud[o[s+8]]+ud[o[s+9]]+"-"+ud[o[s+10]]+ud[o[s+11]]+ud[o[s+12]]+ud[o[s+13]]+ud[o[s+14]]+ud[o[s+15]]).toLowerCase()}let rte;const X6e=new Uint8Array(16);function J6e(){if(!rte){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");rte=crypto.getRandomValues.bind(crypto)}return rte(X6e)}const Q6e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qie={randomUUID:Q6e};function yE(o,s,i){var m;if(qie.randomUUID&&!s&&!o)return qie.randomUUID();o=o||{};const u=o.random??((m=o.rng)==null?void 0:m.call(o))??J6e();if(u.length<16)throw new Error("Random bytes length must be >= 16");return u[6]=u[6]&15|64,u[8]=u[8]&63|128,K6e(u)}const SU=()=>{const{nodes:o,updateNodes:s}=j0();return{nodes:o,addNode:C=>{const _=(Array.isArray(C)?C:[C]).map(O=>({...O,id:O.id||yE()})),N=[...o.value,..._];s(N)},removeNode:C=>{const x=Array.isArray(C)?C:[C],_=[],N=[];x.forEach(B=>{const F=o.value.find(Z=>(Z==null?void 0:Z.id)===B);xoe(F)?_.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];let _=yE();const N=x.map(B=>{let F={...B},Z=B==null?void 0:B.id;return Z||(Z=yE(),F.id=Z),F!=null&&F.groupKey||(F.groupKey=_),F}),O=[...o.value];N.forEach(B=>{const F=O.findIndex(Z=>Z.id===B.id);F!==-1?O[F]=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 eMe(){const{removeNode:o}=SU(),{containerRef:s}=Pf(),i=m=>{var Z,K;if(m.target instanceof Element&&m.target.classList.contains("node-item"))return;const h=m.target;if(h===s.value)return;const C=((Z=s.value)==null?void 0:Z.getRootNode()).getSelection(),x=(K=s.value)==null?void 0:K.querySelectorAll('[contenteditable="true"]');x==null||x.forEach(X=>{X.setAttribute("contenteditable","false")});const _=h.textContent||"",N=h.innerHTML||"";h.setAttribute("contenteditable","true"),h.focus();const O=new MutationObserver(()=>{h.textContent!==_&&(h.innerHTML=N)});O.observe(h,{characterData:!0,childList:!0,subtree:!0});const B=X=>{X.preventDefault()};h.addEventListener("input",B),h.addEventListener("paste",B),h.addEventListener("drop",B),h.addEventListener("keydown",X=>{var q,W,H,me;if(((q=document.activeElement)==null?void 0:q.shadowRoot)===((W=s.value)==null?void 0:W.getRootNode())&&!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(X.key)){if(X.key==="Backspace"||X.key==="Delete"){const et=C==null?void 0:C.getRangeAt(0);if(h.blur(),(et==null?void 0:et.startOffset)===0){const $e=et.startContainer;if($e.nodeType===Node.TEXT_NODE){const te=$e.previousSibling;if(te&&te.nodeType===Node.ELEMENT_NODE&&te.classList.contains("node-item")){const We=te.getAttribute("id");We&&o(We),(H=$e.parentElement)==null||H.normalize();return}}else if($e.nodeType===Node.ELEMENT_NODE){const te=$e.previousSibling;if(te&&te.nodeType===Node.ELEMENT_NODE&&te.classList.contains("node-item")){const We=te.getAttribute("id");We&&o(We),(me=$e.parentElement)==null||me.normalize();return}}}}X.preventDefault()}});const F=()=>{O.disconnect(),h.removeEventListener("input",B),h.removeEventListener("paste",B),h.removeEventListener("drop",B),h.removeEventListener("blur",F),h.setAttribute("contenteditable","false")};h.addEventListener("blur",F)},u=()=>{var m;(m=s.value)==null||m.addEventListener("dblclick",i)};return f.watch(s,m=>{m&&u()},{immediate:!0}),f.onUnmounted(()=>{var m;(m=s.value)==null||m.removeEventListener("dblclick",i)}),{}}function tMe(){const{containerRef:o,focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}=Pf(),h=_=>{var O,B;const N=_==null?void 0:_.getSelection();try{if((O=s.value)==null||O.normalize(),N){const F=N.getRangeAt(0);u.value=P6e(F.startContainer);const Z=F.startOffset,K=(B=s.value)==null?void 0:B.querySelectorAll(".node-item");let X=0;return m.value=0,K==null||K.forEach(q=>{const W=document.createRange();if(W.selectNode(q),W.comparePoint(F.startContainer,Z)>=0){m.value+=1;const H=q.getAttribute("data-startOffset");Number(H)>X&&(X=Number(H))}}),X+Z}}catch{}return 0},b=()=>{var N;const _=(N=o.value)==null?void 0:N.getRootNode();i.value=h(_)},C=_=>{var F;const N=_.target;if(N===o.value)return;s.value=N;const O=(F=o.value)==null?void 0:F.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 nMe(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,uE(_=>{_&&!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 oMe(){const{modelValue:o,inputTypes:s}=j0(),{nodes:i,addNode:u}=SU(),m=C=>{if(!C||typeof C!="string")return[];const _=new DOMParser().parseFromString(C,"text/html");return Array.from(_.querySelectorAll("td")).filter(B=>{var F;return!((F=B.textContent)!=null&&F.trim())})},h=(C,x)=>{const _=x.map(O=>O.nodePath);return C==null?void 0:C.map(O=>({nodePath:Coe(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 sMe(){const{selectedNodes:o,containerRef:s}=Pf(),{removeNode:i}=SU(),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,F;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=(F=N==null?void 0:N.element)==null?void 0:F.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 xU(){const{nodes:o}=j0(),{containerRef:s,renderNodes:i,uiReady:u}=Pf(),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 cne=f.ref({});function EU(o){return f.computed(()=>{var s;return(s=cne.value)==null?void 0:s[o]})}function yfe(){const o=j0(),s=Pf();f.onMounted(()=>{const{editorId:i}=o;i&&(cne.value[i]=f.ref({...o,...s}))}),f.onUnmounted(()=>{const{editorId:i}=o;i&&(cne.value[i]=null)})}const rMe=f.defineComponent({__name:"NodesEditUI",setup(o){const{nodes:s}=j0(),{uiReady:i,renderNodes:u}=Pf();return yfe(),nMe(s),vfe(),bfe(),sMe(),tMe(),eMe(),oMe(),xU(),(m,h)=>f.unref(i)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(u),b=>(f.openBlock(),f.createBlock(CU,{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)}}),Yie=f.defineComponent({__name:"NodesPreviewUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=Pf();return xU(),(u,m)=>f.unref(s)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(i),h=>(f.openBlock(),f.createBlock(CU,{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)}}),aMe=f.defineComponent({__name:"NodesEnterUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=Pf();return xU(),(u,m)=>f.unref(s)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(i),h=>(f.openBlock(),f.createBlock(CU,{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)}}),iMe=f.defineComponent({__name:"NodesSelectUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=Pf();return yfe(),vfe(),bfe(),xU(),(u,m)=>f.unref(s)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(i),h=>(f.openBlock(),f.createBlock(CU,{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)}}),lMe=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(hfe,{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")}}),c2=f.ref({});function cMe(o){return f.computed(()=>(c2.value[o]||(c2.value[o]=f.ref([])),c2.value[o]))}function uMe(o){const{editorId:s}=o,i=f.ref(!1);f.onMounted(()=>{c2.value[s]||(c2.value[s]=f.ref([]));const u=c2.value[s].findIndex(m=>m.id===o.id);u!==-1&&c2.value[s].splice(u,1),i.value=!0,c2.value[s].push({...o,isMounted:i})}),f.onUnmounted(()=>{i.value=!1})}const dMe=f.defineComponent({__name:"NodesUIProvider",props:{nodes:{type:Array,default:()=>[]},selectedNodes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},editorId:{type:String,default:""}},emits:["onSelectedNodes","update:selectedNodes"],setup(o,{expose:s,emit:i}){const u=o,m=i,h=f.computed({get:()=>(u.selectedNodes||[]).map(q=>{var me;let W=(me=u==null?void 0:u.nodes)==null?void 0:me.find(et=>(et==null?void 0:et.id)===(q==null?void 0:q.id)),H=q!=null&&q.element?q==null?void 0:q.element:R6e(q==null?void 0:q.id,b.value);return{...W||{},...q,element:H}}),set:q=>{const W=q.map(({element:H,...me})=>{var $e;return{...(($e=u==null?void 0:u.nodes)==null?void 0:$e.find(te=>(te==null?void 0:te.id)===(me==null?void 0:me.id)))||{},...me}});m("update:selectedNodes",W)}}),b=f.ref(null),C=f.ref([]),x=f.ref(null),_=f.ref(-1),N=f.ref(0),O=f.ref(0),B=cMe(u==null?void 0:u.editorId),F=f.ref(!1),Z=f.computed(()=>{var W,H;const q=((H=(W=f.toValue(B))==null?void 0:W.filter(me=>!f.toValue(me==null?void 0:me.activated)))==null?void 0:H.filter(me=>f.toValue(me.isMounted)))||[];return L6e([...(u==null?void 0:u.nodesGroups)||[],...q])}),K=f.ref([]),X=q=>{const W=q.map(({element:H,...me})=>{var $e;return{...(($e=C.value)==null?void 0:$e.find(te=>(te==null?void 0:te.id)===(me==null?void 0:me.id)))||{},...me}});di(W,h.value)||(h.value=q,m("onSelectedNodes",W))};return s({setSelectedNodes:X}),f.provide(mfe,{containerRef:b,focusedElement:x,currentRenderNodes:K,cursorPosition:_,focusedNodeIndex:N,preNodeNumber:O,currentNodes:Z,selectedNodes:h,setSelectedNodes:X,renderNodes:C,uiReady:F,nodesGroups:u==null?void 0:u.nodesGroups}),(q,W)=>f.renderSlot(q.$slots,"default")}}),fMe=["onClick"],mMe={key:0,class:"icon"},pMe={key:1,class:"arrow"},gMe={key:0,class:"submenu"},hMe=["onClick"],vMe={key:0,class:"icon"},bMe=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}=Pf(),{inputTypes:x}=j0(),_=f.useModel(o,"show"),{editNodes:N}=SU(),O=K=>{var q;const X=((q=K==null?void 0:K.getDefaultProps)==null?void 0:q.call(K))||{};if(f.toValue(m)&&!ixe(f.toValue(h))){const W=Coe(f.toValue(m)),H=f.toValue(h),me=(f.toValue(C)||0)+1,et=F6e(f.toValue(m));W&&H&&H>=0&&N({...et,label:K==null?void 0:K.label,nodePath:W,startOffset:H,subNodeSort:me,textNodeIndex:f.toValue(b)||0,nodeType:K==null?void 0:K.value,props:X})}else if(i){const W=f.toValue(i);if(W!=null&&W.length){const H=W==null?void 0:W.map(me=>({...me,label:K==null?void 0:K.label,element:me==null?void 0:me.element,nodePath:me==null?void 0:me.nodePath,nodeType:K==null?void 0:K.value,props:X}));N(H),u(H)}}_.value=!1},B=f.computed(()=>{const K=[],X=[];return f.toValue(x).forEach(q=>{q.groupName==="system"?X.push({...q,handler:()=>{O(q)}}):K.push({...q,handler:()=>{O(q)}})}),[{label:"限定填写内容",icon:"i-bi:lock",children:K},{label:"插入记录标识",icon:"i-bi:flag",children:X}].filter(q=>{var W;return(W=q==null?void 0:q.children)==null?void 0:W.length})}),F=s,Z=(K,X)=>{K.preventDefault(),X!=null&&X.handler&&X.handler(),X!=null&&X.value&&F("select",X==null?void 0:X.value)};return(K,X)=>f.withDirectives((f.openBlock(),f.createElementBlock("div",{class:"context-menu",style:f.normalizeStyle({...K.style})},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(B.value,q=>(f.openBlock(),f.createElementBlock("div",{key:q==null?void 0:q.label,class:"menu-item"},[f.createElementVNode("div",{class:"menu-item-content",onClick:W=>Z(W,q)},[q!=null&&q.icon?(f.openBlock(),f.createElementBlock("div",mMe,[f.createElementVNode("div",{class:f.normalizeClass(q==null?void 0:q.icon)},null,2)])):f.createCommentVNode("",!0),f.createTextVNode(" "+f.toDisplayString(q.label)+" ",1),q!=null&&q.children?(f.openBlock(),f.createElementBlock("span",pMe,"›")):f.createCommentVNode("",!0)],8,fMe),q!=null&&q.children?(f.openBlock(),f.createElementBlock("div",gMe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(q.children,W=>(f.openBlock(),f.createElementBlock("div",{key:W.action,class:"menu-item",onClick:H=>Z(H,W)},[W!=null&&W.icon?(f.openBlock(),f.createElementBlock("div",vMe,[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,hMe))),128))])):f.createCommentVNode("",!0)]))),128))],4)),[[f.vShow,_.value]])}}),yMe=$i(bMe,[["__scopeId","data-v-16c69bc2"]]);function wMe(){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 wfe(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 une=wfe(),Cfe=(...o)=>{const s=o[0],i=o[1];f.onMounted(()=>{une.on(s,i)}),f.onBeforeUnmount(()=>{une.off(s)})},Eoe=()=>(...s)=>{une.emit(...s)};let O0=null;function CMe(o){const{onSelected:s}=o,{selectedNodes:i,setSelectedNodes:u}=Pf();return f.watch(()=>i,()=>{O0==null||O0({data:i.value}),s==null||s(f.toValue(i))},{deep:!0}),Cfe("selectNodes",h=>{const{data:b,callback:C=null,mode:x="multiple"}=h;setTimeout(()=>{u(f.toValue(b)),O0=C},100)}),{onBlur:()=>{O0&&(O0==null||O0({data:i.value,type:"blur"}),O0=null,u([]))}}}const SMe={class:"relative"},xMe=f.defineComponent({__name:"index",props:{hasContextMenu:{type:Boolean,default:!1}},setup(o){const{containerRef:s,uiReady:i}=Pf(),{nodes:u,modelValue:m}=j0(),h=o,{showContextMenu:b,contextMenuStyle:C,onContextMenu:x}=wMe(),_=f.ref(null),N=Z=>{let K=null;if(xoe(Z))K=pfe(Z.nodePath,f.toValue(s)),K&&(K.classList.add("node-item-td"),W6e(K));else{const X=document.createElement("span");X.setAttribute("contenteditable","false"),X.classList.add("node-item"),K=X,B6e(Z,K,s.value)}return K&&I6e(K,Z),K},O=()=>{const Z=pxe(u.value,[K=>K.nodePath,K=>K.textNodeIndex,K=>K.startOffset??-1,K=>K.subNodeSort],["asc","desc","desc","desc"]);Z==null||Z.forEach(K=>{N(K)})};f.watch(()=>[u,m,_],()=>{_.value&&(i.value=!1,f.nextTick(()=>{_.value&&(_.value.innerHTML=m,O(),i.value=!0)}))},{deep:!0,immediate:!0});const B=f.ref(),{onBlur:F}=CMe({onSelected:()=>{var Z;(Z=B.value)==null||Z.focus()}});return(Z,K)=>(f.openBlock(),f.createElementBlock("div",SMe,[f.createVNode(woe,{onOnBlur:f.unref(F),ref_key:"shadowDomRef",ref:B},{default:f.withCtx(()=>[f.createElementVNode("html",{class:"nodes-editor",ref_key:"containerRef",ref:s,onContextmenu:K[0]||(K[0]=f.withModifiers((...X)=>f.unref(x)&&f.unref(x)(...X),["prevent"]))},[f.createElementVNode("body",{ref_key:"bodyRef",ref:_},null,512)],544)]),_:1},8,["onOnBlur"]),h!=null&&h.hasContextMenu?(f.openBlock(),f.createBlock(yMe,{key:0,show:f.unref(b),"onUpdate:show":K[1]||(K[1]=X=>f.isRef(b)?b.value=X:null),style:f.normalizeStyle(f.unref(C))},null,8,["show","style"])):f.createCommentVNode("",!0)]))}}),Kie={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}},EMe={class:"pagesize"},_Me=f.defineComponent({__name:"index",props:{pagesize:{type:String,default:"A4"}},setup(o){const s=o,i=f.computed(()=>{const u=Kie[s.pagesize]||Kie.A4,m=(window.devicePixelRatio||1)*96;return u.width*m/25.4});return(u,m)=>(f.openBlock(),f.createElementBlock("div",EMe,[f.createElementVNode("div",{style:f.normalizeStyle({width:`${i.value}px`}),class:"pagesize-content"},[f.renderSlot(u.$slots,"default",{},void 0,!0)],4)]))}}),kMe=$i(_Me,[["__scopeId","data-v-46808dfa"]]),Sfe=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(),x=f.computed(()=>{switch(u.renderType){case"edit":return rMe;case"select":return iMe;case"preview":return Yie;case"enter":return aMe;default:return Yie}}),_=B=>{m("update:nodes",B)},N=B=>{m("update:formData",B)},O=B=>{m("onSelectedNodes",B)};return s({formRef:{validate:()=>{var B,F,Z;return(Z=(F=(B=b.value)==null?void 0:B.formRef)==null?void 0:F.validate)==null?void 0:Z.call(F)}},setSelectedNodes:B=>{var F,Z;(Z=(F=C.value)==null?void 0:F.setSelectedNodes)==null||Z.call(F,B)}}),(B,F)=>(f.openBlock(),f.createBlock(kMe,{pagesize:o.pagesize},{default:f.withCtx(()=>[f.createVNode(dMe,{ref_key:"UIRef",ref:C,nodes:o.nodes,"onUpdate:nodes":_,selectedNodes:h.value,"onUpdate:selectedNodes":F[0]||(F[0]=Z=>h.value=Z),onOnSelectedNodes:O,nodesGroups:o.nodesGroups,editorId:u==null?void 0:u.id},{default:f.withCtx(()=>[f.createVNode(lMe,{renderType:o.renderType,"model-value":o.modelValue,nodes:o.nodes,"onUpdate:nodes":_,formData:o.formData,"onUpdate:formData":N,inputTypes:o.inputTypes,editorId:u==null?void 0:u.id},{default:f.withCtx(()=>[f.createVNode(xMe,{hasContextMenu:o.renderType==="edit"},null,8,["hasContextMenu"]),(f.openBlock(),f.createBlock(f.resolveDynamicComponent(x.value),{renderType:o.renderType,pagesize:o.pagesize,ref_key:"contentRef",ref:b},{nodeItem:f.withCtx(Z=>[f.renderSlot(B.$slots,"nodeItem",{node:Z==null?void 0:Z.node})]),_:3},8,["renderType","pagesize"]))]),_:3},8,["renderType","model-value","nodes","formData","inputTypes","editorId"])]),_:3},8,["nodes","selectedNodes","nodesGroups","editorId"])]),_:3},8,["pagesize"]))}}),TMe={class:"nodes-text"},AMe={key:0,class:"node-text-input"},NMe={key:1,class:"node-text-td"},OMe={key:0,class:"node-text-table-index"},$Me=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=EU(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 gfe(i.value,((b=f.toValue(u))==null?void 0:b.renderNodes)||[])});return(b,C)=>(f.openBlock(),f.createElementBlock("div",TMe,[(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",AMe," 填写"+f.toDisplayString(x==null?void 0:x.inputIndex),1)):(f.openBlock(),f.createElementBlock("span",NMe,[m.value?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("span",OMe,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))]))}}),Xie=$i($Me,[["__scopeId","data-v-67e3a210"]]);function DMe(o){const{nodes:s,mode:i="multiple"}=o,u=f.ref(!1),m=Eoe();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"],_H=f.ref(0),eE=new Map,MMe={key:0,class:"node-select-small gap-x-2"},RMe={key:1,class:"text-[#999]"},BMe={key:1,class:"node-select"},IMe={class:"flex py-2 px-2 justify-between items-center noder-select-header"},PMe={class:"flex gap-2"},FMe={class:"flex gap-1"},LMe=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:"点击选择"}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=f.ref((eE==null?void 0:eE[s==null?void 0:s.id])||0),u=f.ref((s==null?void 0:s.id)||yE()),m=f.useModel(o,"modelValue"),{selectNodes:h,isSelecting:b}=DMe({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(()=>{lxe(eE==null?void 0:eE[s==null?void 0:s.id])&&(s!=null&&s.id)&&(eE[s==null?void 0:s.id]=_H.value,i.value=_H.value,_H.value=_H.value+1)}),uMe({id:u.value,editorId:s.editorId,nodes:m,activated:b,color:x}),(_,N)=>{var O;return s.size==="small"?(f.openBlock(),f.createElementBlock("div",MMe,[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(Xie,{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",RMe,"未设置"))])])):(f.openBlock(),f.createElementBlock("div",BMe,[f.createElementVNode("div",IMe,[f.createElementVNode("div",PMe,[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",FMe,[N[8]||(N[8]=f.createElementVNode("div",{class:"color-[#999]"},"Ctrl+左键多选",-1)),f.createElementVNode("div",null,[f.createVNode(f.unref(Nn.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(Xie,{modelValue:m.value,"onUpdate:modelValue":N[4]||(N[4]=B=>m.value=B),editorId:o.editorId},null,8,["modelValue","editorId"])])]))}}}),xfe=$i(LMe,[["__scopeId","data-v-4ab41798"]]);function VMe(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 HMe(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 zMe(o){const s=EU(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 F=O;F<=B;F++)for(let Z=_;Z<=N;Z++)x.push({colIndex:Z,rowIndex:F});return x},u=b=>{var N;const C=b.includes(":");let x=[];if(C){const[O,B]=b.split(":").map(F=>h(F));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 F=B.match(/tr(?::nth-child\((\d+)\))?/);F&&F[1]&&(N=parseInt(F[1]))}else if(B.startsWith("td")){const F=B.match(/td(?::nth-child\((\d+)\))?/);F&&(O=F[1]?parseInt(F[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 Jie=["#0288D1","#D32F2F","#F57C00","#388E3C","#303F9F","#7B1FA2","#C2185B","#880E4F","#689F38","#5D4037"];function UMe(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 F=B.getRangeAt(0),Z=((x=F.startContainer)==null?void 0:x.nodeName)==="#text"?F.startContainer:(N=(_=F.startContainer)==null?void 0:_.childNodes)==null?void 0:N[0],K=Math.min(C,((O=Z.textContent)==null?void 0:O.length)||0);F.setStart(Z,K)}}};return f.watch(()=>[s,o],()=>{var C;o.value&&(di((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 _oe(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 jMe(o){const{element:s,showStr:i,editorId:u}=o,m=EU(u),h=_oe({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,F;const C=Z=>{var K;Z.preventDefault(),(K=f.toValue(s))==null||K.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),(F=document.querySelectorAll(".select-function"))==null||F.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(F=>{var Z;B=[...B,...((Z=F==null?void 0:F.cellValue)==null?void 0:Z.map(K=>({color:F==null?void 0:F.color,backgroundColor:Soe((F==null?void 0:F.color)||"#000",.1),element:K==null?void 0:K.element})))||[]]}),B.forEach(F=>{var Z;F!=null&&F.element&&((Z=F==null?void 0:F.element)==null||Z.classList.add("node-formula-cell"),F==null||F.element.style.setProperty("--formula-node-color",F==null?void 0:F.color),F==null||F.element.style.setProperty("--formula-node-bg-color",F==null?void 0:F.backgroundColor))}))}},{deep:!0}),h}const WMe=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 ZMe(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 GMe=(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},qMe=o=>{const{startOffset:s,showStr:i,value:u,editorId:m,currentItemIndex:h,currentItem:b,element:C}=o,x=EU(m),_=f.ref(-1),N=f.ref(0),O=_oe({element:C}),B=f.ref(!1),F=Eoe(),Z=K=>{var X,q;if(f.toValue(B)&&f.toValue(O)&&!di((X=f.toValue(b))==null?void 0:X.cellValue,K)){const W=j6e(K,((q=f.toValue(x))==null?void 0:q.nodes)||"");let H=W;W&&(f.toValue(N)===0&&(H+=","),f.toValue(_)>=0&&(u.value=ZMe(f.toValue(u),f.toValue(_),f.toValue(N),H),N.value=W.length))}};f.watch(()=>h,()=>{var K,X,q,W,H,me;if((K=x.value)==null||K.setSelectedNodes([]),["range","cell"].includes((X=f.toValue(b))==null?void 0:X.type))return _.value=GMe(i.value,h.value),N.value=(W=(q=f.toValue(b))==null?void 0:q.value)==null?void 0:W.length,B.value=!0,F("selectNodes",{data:(H=f.toValue(b))==null?void 0:H.cellValue,mode:"multiple",callback:({data:et})=>{Z(et)}}),!1;if([",","(","="].includes((me=f.toValue(b))==null?void 0:me.value))return _.value=f.toValue(s),B.value=!0,N.value=0,F("selectNodes",{data:[],mode:"multiple",callback:({data:et})=>{Z(et)}}),!1;B.value=!1,_.value=-1},{immediate:!0,deep:!0})},YMe=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 KMe(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 XMe=(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},JMe=o=>{const{startOffset:s,showStr:i,value:u,currentItemIndex:m,currentItem:h,element:b}=o,C=f.ref(-1),x=f.ref(0),_=_oe({element:b}),N=f.ref(!1),O=Eoe(),B=F=>{var Z;if(f.toValue(N)&&f.toValue(_)&&!di((Z=f.toValue(h))==null?void 0:Z.value,F)){const K=F,X=K;K&&f.toValue(C)>=0&&(u.value=KMe(f.toValue(u),f.toValue(C),f.toValue(x),X),x.value=K.length)}};f.watch(()=>m,()=>{var F,Z,K,X,q;if(["function"].includes((F=f.toValue(h))==null?void 0:F.type))return C.value=XMe(i.value,m.value),x.value=(K=(Z=f.toValue(h))==null?void 0:Z.value)==null?void 0:K.length,N.value=!0,O("selectFunction",{data:(X=f.toValue(h))==null?void 0:X.value,callback:({data:W})=>{console.log(W),B(W)}}),!1;if([",","(","="].includes((q=f.toValue(h))==null?void 0:q.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})},QMe={class:"node-formula"},eRe={class:"node-formula-show"},tRe=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}=zMe({editorId:s==null?void 0:s.editorId}),u=f.useModel(o,"modelValue"),m=f.ref(),{startOffset:h}=WMe({element:m});UMe(m,u,h);const b=f.computed(()=>{const N=VMe(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=HMe(u.value,b.value);let O=-1;return N.map(F=>(F==null?void 0:F.type)==="cell"||(F==null?void 0:F.type)==="range"?(O++,{...F,color:Jie[O%Jie.length]}):(F==null?void 0:F.type)==="function"?{...F,color:"#0318ff"}:F)});jMe({element:m,showStr:C,editorId:s==null?void 0:s.editorId});const{currentItemIndex:x,currentItem:_}=YMe({element:m,startOffset:h,value:u,showStr:C});return qMe({element:m,startOffset:h,showStr:C,editorId:s==null?void 0:s.editorId,value:u,currentItemIndex:x,currentItem:_}),JMe({element:m,startOffset:h,showStr:C,value:u,currentItemIndex:x,currentItem:_}),(N,O)=>(f.openBlock(),f.createElementBlock("div",QMe,[f.createElementVNode("div",{contenteditable:"true",ref_key:"formulaRef",ref:m,class:"node-formula-input"},null,512),f.createElementVNode("div",eRe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(C.value,(B,F)=>(f.openBlock(),f.createElementBlock("span",{key:F,class:f.normalizeClass(["node-formula-item",`node-formula-item-type-${B==null?void 0:B.type}`,F===f.unref(x)?"node-formula-item-active":""]),style:f.normalizeStyle({"--text-color":(B==null?void 0:B.color)||"#000","--bg-color":f.unref(Soe)((B==null?void 0:B.color)||"#000",.1)})},f.toDisplayString(B.value),7))),128))])]))}}),Efe=$i(tRe,[["__scopeId","data-v-f4b96eb4"]]),nRe=[{label:"平均值",value:"AVERAGE"},{label:"均值绝对偏差",value:"AVEDEV"},{label:"求和",value:"SUM"},{label:"条件判断",value:"IF"},{label:"统计数量",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"正平方根",value:"SQRT"}],oRe={class:"select-function"},sRe=["onClick"],rRe={class:"function-item"},aRe={class:"function-item-desc"},iRe=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:nRe}),m=f.useModel(o,"modelValue"),h=b=>{m.value=b,i==null||i({data:b})};return Cfe("selectFunction",({data:b,callback:C})=>{i=C,m.value=b}),(b,C)=>(f.openBlock(),f.createElementBlock("div",oRe,[(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",rRe,f.toDisplayString(x.value),1),f.createElementVNode("div",aRe,f.toDisplayString(x.label),1)],10,sRe)]))),128))]))}}),_fe=$i(iRe,[["__scopeId","data-v-6e079ff0"]]),lRe=["innerHTML"],kfe=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(woe,null,{default:f.withCtx(()=>[f.createElementVNode("div",{innerHTML:s.value},null,8,lRe)]),_:1}))}});function _U(o){return f.getCurrentScope()?(f.onScopeDispose(o),!0):!1}function R0(o){return typeof o=="function"?o():f.unref(o)}const cRe=typeof window<"u"&&typeof document<"u",uRe=o=>typeof o<"u",dRe=Object.prototype.toString,fRe=o=>dRe.call(o)==="[object Object]",mRe=()=>{};function pRe(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 Tfe=o=>o();function gRe(o=Tfe){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 Qie(o,s=!1,i="Timeout"){return new Promise((u,m)=>{setTimeout(s?()=>m(i):u,o)})}function hRe(o,s,i={}){const{eventFilter:u=Tfe,...m}=i;return f.watch(o,pRe(u,s),m)}function zA(o,s,i={}){const{eventFilter:u,...m}=i,{eventFilter:h,pause:b,resume:C,isActive:x}=gRe(u);return{stop:hRe(o,s,{...m,eventFilter:h}),pause:b,resume:C,isActive:x}}function vRe(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=R0(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 dne(o,s=!1){function i(O,{flush:B="sync",deep:F=!1,timeout:Z,throwOnTimeout:K}={}){let X=null;const W=[new Promise(H=>{X=f.watch(o,me=>{O(me)!==s&&(X==null||X(),H(me))},{flush:B,deep:F,immediate:!0})})];return Z!=null&&W.push(Qie(Z,K).then(()=>R0(o)).finally(()=>X==null?void 0:X())),Promise.race(W)}function u(O,B){if(!f.isRef(O))return i(me=>me===O,B);const{flush:F="sync",deep:Z=!1,timeout:K,throwOnTimeout:X}=B??{};let q=null;const H=[new Promise(me=>{q=f.watch([o,O],([et,$e])=>{s!==(et===$e)&&(q==null||q(),me(et))},{flush:F,deep:Z,immediate:!0})})];return K!=null&&H.push(Qie(K,X).then(()=>R0(o)).finally(()=>(q==null||q(),R0(o)))),Promise.race(H)}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(F=>{const Z=Array.from(F);return Z.includes(O)||Z.includes(R0(O))},B)}function _(O){return N(1,O)}function N(O=1,B){let F=-1;return i(()=>(F+=1,F>=O),B)}return Array.isArray(R0(o))?{toMatch:i,toContains:x,changed:_,changedTimes:N,get not(){return dne(o,!s)}}:{toMatch:i,toBe:u,toBeTruthy:m,toBeNull:h,toBeNaN:C,toBeUndefined:b,changed:_,changedTimes:N,get not(){return dne(o,!s)}}}function fne(o){return dne(o)}function bRe(o){var s;const i=R0(o);return(s=i==null?void 0:i.$el)!=null?s:i}const Afe=cRe?window:void 0;function Nfe(...o){let s,i,u,m;if(typeof o[0]=="string"||Array.isArray(o[0])?([i,u,m]=o,s=Afe):[s,i,u,m]=o,!s)return mRe;Array.isArray(i)||(i=[i]),Array.isArray(u)||(u=[u]);const h=[],b=()=>{h.forEach(N=>N()),h.length=0},C=(N,O,B,F)=>(N.addEventListener(O,B,F),()=>N.removeEventListener(O,B,F)),x=f.watch(()=>[bRe(s),R0(m)],([N,O])=>{if(b(),!N)return;const B=fRe(O)?{...O}:O;h.push(...i.flatMap(F=>u.map(Z=>C(N,F,Z,B))))},{immediate:!0,flush:"post"}),_=()=>{x(),b()};return _U(_),_}function yRe(o){return typeof o=="function"?o:typeof o=="string"?s=>s.key===o:Array.isArray(o)?s=>o.includes(s.key):()=>!0}function ele(...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=Afe,eventName:h="keydown",passive:b=!1,dedupe:C=!1}=u,x=yRe(s);return Nfe(m,h,N=>{N.repeat&&R0(C)||x(N)&&i(N)},b)}function wRe(o){return JSON.parse(JSON.stringify(o))}function ate(o,s,i,u={}){var m,h,b;const{clone:C=!1,passive:x=!1,eventName:_,deep:N=!1,defaultValue:O,shouldEmit:B}=u,F=f.getCurrentInstance(),Z=i||(F==null?void 0:F.emit)||((m=F==null?void 0:F.$emit)==null?void 0:m.bind(F))||((b=(h=F==null?void 0:F.proxy)==null?void 0:h.$emit)==null?void 0:b.bind(F==null?void 0:F.proxy));let K=_;s||(s="modelValue"),K=K||`update:${s.toString()}`;const X=H=>C?typeof C=="function"?C(H):wRe(H):H,q=()=>uRe(o[s])?X(o[s]):O,W=H=>{B?B(H)&&Z(K,H):Z(K,H)};if(x){const H=q(),me=f.ref(H);let et=!1;return f.watch(()=>o[s],$e=>{et||(et=!0,me.value=X($e),f.nextTick(()=>et=!1))}),f.watch(me,$e=>{!et&&($e!==o[s]||N)&&W($e)},{deep:N}),me}else return f.computed({get(){return q()},set(H){W(H)}})}var CRe={value:()=>{}};function kU(){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 KH(i)}function KH(o){this._=o}function SRe(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}})}KH.prototype=kU.prototype={constructor:KH,on:function(o,s){var i=this._,u=SRe(o+"",i),m,h=-1,b=u.length;if(arguments.length<2){for(;++h<b;)if((m=(o=u[h]).type)&&(m=xRe(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]=tle(i[m],o.name,s);else if(s==null)for(m in i)i[m]=tle(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 KH(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 xRe(o,s){for(var i=0,u=o.length,m;i<u;++i)if((m=o[i]).name===s)return m.value}function tle(o,s,i){for(var u=0,m=o.length;u<m;++u)if(o[u].name===s){o[u]=CRe,o=o.slice(0,u).concat(o.slice(u+1));break}return i!=null&&o.push({name:s,value:i}),o}var mne="http://www.w3.org/1999/xhtml";const nle={svg:"http://www.w3.org/2000/svg",xhtml:mne,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function TU(o){var s=o+="",i=s.indexOf(":");return i>=0&&(s=o.slice(0,i))!=="xmlns"&&(o=o.slice(i+1)),nle.hasOwnProperty(s)?{space:nle[s],local:o}:o}function ERe(o){return function(){var s=this.ownerDocument,i=this.namespaceURI;return i===mne&&s.documentElement.namespaceURI===mne?s.createElement(o):s.createElementNS(i,o)}}function _Re(o){return function(){return this.ownerDocument.createElementNS(o.space,o.local)}}function Ofe(o){var s=TU(o);return(s.local?_Re:ERe)(s)}function kRe(){}function koe(o){return o==null?kRe:function(){return this.querySelector(o)}}function TRe(o){typeof o!="function"&&(o=koe(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 Sp(u,this._parents)}function ARe(o){return o==null?[]:Array.isArray(o)?o:Array.from(o)}function NRe(){return[]}function $fe(o){return o==null?NRe:function(){return this.querySelectorAll(o)}}function ORe(o){return function(){return ARe(o.apply(this,arguments))}}function $Re(o){typeof o=="function"?o=ORe(o):o=$fe(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 Sp(u,m)}function Dfe(o){return function(){return this.matches(o)}}function Mfe(o){return function(s){return s.matches(o)}}var DRe=Array.prototype.find;function MRe(o){return function(){return DRe.call(this.children,o)}}function RRe(){return this.firstElementChild}function BRe(o){return this.select(o==null?RRe:MRe(typeof o=="function"?o:Mfe(o)))}var IRe=Array.prototype.filter;function PRe(){return Array.from(this.children)}function FRe(o){return function(){return IRe.call(this.children,o)}}function LRe(o){return this.selectAll(o==null?PRe:FRe(typeof o=="function"?o:Mfe(o)))}function VRe(o){typeof o!="function"&&(o=Dfe(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 Sp(u,this._parents)}function Rfe(o){return new Array(o.length)}function HRe(){return new Sp(this._enter||this._groups.map(Rfe),this._parents)}function Ez(o,s){this.ownerDocument=o.ownerDocument,this.namespaceURI=o.namespaceURI,this._next=null,this._parent=o,this.__data__=s}Ez.prototype={constructor:Ez,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 zRe(o){return function(){return o}}function URe(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 Ez(o,h[b]);for(;b<x;++b)(C=s[b])&&(m[b]=C)}function jRe(o,s,i,u,m,h,b){var C,x,_=new Map,N=s.length,O=h.length,B=new Array(N),F;for(C=0;C<N;++C)(x=s[C])&&(B[C]=F=b.call(x,x.__data__,C,s)+"",_.has(F)?m[C]=x:_.set(F,x));for(C=0;C<O;++C)F=b.call(o,h[C],C,h)+"",(x=_.get(F))?(u[C]=x,x.__data__=h[C],_.delete(F)):i[C]=new Ez(o,h[C]);for(C=0;C<N;++C)(x=s[C])&&_.get(B[C])===x&&(m[C]=x)}function WRe(o){return o.__data__}function ZRe(o,s){if(!arguments.length)return Array.from(this,WRe);var i=s?jRe:URe,u=this._parents,m=this._groups;typeof o!="function"&&(o=zRe(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,F=GRe(o.call(N,N&&N.__data__,_,u)),Z=F.length,K=C[_]=new Array(Z),X=b[_]=new Array(Z),q=x[_]=new Array(B);i(N,O,K,X,q,F,s);for(var W=0,H=0,me,et;W<Z;++W)if(me=K[W]){for(W>=H&&(H=W+1);!(et=X[H])&&++H<Z;);me._next=et||null}}return b=new Sp(b,u),b._enter=C,b._exit=x,b}function GRe(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function qRe(){return new Sp(this._exit||this._groups.map(Rfe),this._parents)}function YRe(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 KRe(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),F,Z=0;Z<O;++Z)(F=_[Z]||N[Z])&&(B[Z]=F);for(;x<m;++x)C[x]=i[x];return new Sp(C,this._parents)}function XRe(){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 JRe(o){o||(o=QRe);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 Sp(m,this._parents).order()}function QRe(o,s){return o<s?-1:o>s?1:o>=s?0:NaN}function eBe(){var o=arguments[0];return arguments[0]=this,o.apply(null,arguments),this}function tBe(){return Array.from(this)}function nBe(){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 oBe(){let o=0;for(const s of this)++o;return o}function sBe(){return!this.node()}function rBe(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 aBe(o){return function(){this.removeAttribute(o)}}function iBe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function lBe(o,s){return function(){this.setAttribute(o,s)}}function cBe(o,s){return function(){this.setAttributeNS(o.space,o.local,s)}}function uBe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttribute(o):this.setAttribute(o,i)}}function dBe(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 fBe(o,s){var i=TU(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?iBe:aBe:typeof s=="function"?i.local?dBe:uBe:i.local?cBe:lBe)(i,s))}function Bfe(o){return o.ownerDocument&&o.ownerDocument.defaultView||o.document&&o||o.defaultView}function mBe(o){return function(){this.style.removeProperty(o)}}function pBe(o,s,i){return function(){this.style.setProperty(o,s,i)}}function gBe(o,s,i){return function(){var u=s.apply(this,arguments);u==null?this.style.removeProperty(o):this.style.setProperty(o,u,i)}}function hBe(o,s,i){return arguments.length>1?this.each((s==null?mBe:typeof s=="function"?gBe:pBe)(o,s,i??"")):f4(this.node(),o)}function f4(o,s){return o.style.getPropertyValue(s)||Bfe(o).getComputedStyle(o,null).getPropertyValue(s)}function vBe(o){return function(){delete this[o]}}function bBe(o,s){return function(){this[o]=s}}function yBe(o,s){return function(){var i=s.apply(this,arguments);i==null?delete this[o]:this[o]=i}}function wBe(o,s){return arguments.length>1?this.each((s==null?vBe:typeof s=="function"?yBe:bBe)(o,s)):this.node()[o]}function Ife(o){return o.trim().split(/^|\s+/)}function Toe(o){return o.classList||new Pfe(o)}function Pfe(o){this._node=o,this._names=Ife(o.getAttribute("class")||"")}Pfe.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 Ffe(o,s){for(var i=Toe(o),u=-1,m=s.length;++u<m;)i.add(s[u])}function Lfe(o,s){for(var i=Toe(o),u=-1,m=s.length;++u<m;)i.remove(s[u])}function CBe(o){return function(){Ffe(this,o)}}function SBe(o){return function(){Lfe(this,o)}}function xBe(o,s){return function(){(s.apply(this,arguments)?Ffe:Lfe)(this,o)}}function EBe(o,s){var i=Ife(o+"");if(arguments.length<2){for(var u=Toe(this.node()),m=-1,h=i.length;++m<h;)if(!u.contains(i[m]))return!1;return!0}return this.each((typeof s=="function"?xBe:s?CBe:SBe)(i,s))}function _Be(){this.textContent=""}function kBe(o){return function(){this.textContent=o}}function TBe(o){return function(){var s=o.apply(this,arguments);this.textContent=s??""}}function ABe(o){return arguments.length?this.each(o==null?_Be:(typeof o=="function"?TBe:kBe)(o)):this.node().textContent}function NBe(){this.innerHTML=""}function OBe(o){return function(){this.innerHTML=o}}function $Be(o){return function(){var s=o.apply(this,arguments);this.innerHTML=s??""}}function DBe(o){return arguments.length?this.each(o==null?NBe:(typeof o=="function"?$Be:OBe)(o)):this.node().innerHTML}function MBe(){this.nextSibling&&this.parentNode.appendChild(this)}function RBe(){return this.each(MBe)}function BBe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function IBe(){return this.each(BBe)}function PBe(o){var s=typeof o=="function"?o:Ofe(o);return this.select(function(){return this.appendChild(s.apply(this,arguments))})}function FBe(){return null}function LBe(o,s){var i=typeof o=="function"?o:Ofe(o),u=s==null?FBe:typeof s=="function"?s:koe(s);return this.select(function(){return this.insertBefore(i.apply(this,arguments),u.apply(this,arguments)||null)})}function VBe(){var o=this.parentNode;o&&o.removeChild(this)}function HBe(){return this.each(VBe)}function zBe(){var o=this.cloneNode(!1),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function UBe(){var o=this.cloneNode(!0),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function jBe(o){return this.select(o?UBe:zBe)}function WBe(o){return arguments.length?this.property("__data__",o):this.node().__data__}function ZBe(o){return function(s){o.call(this,s,this.__data__)}}function GBe(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 qBe(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 YBe(o,s,i){return function(){var u=this.__on,m,h=ZBe(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 KBe(o,s,i){var u=GBe(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?YBe:qBe,m=0;m<h;++m)this.each(C(u[m],s,i));return this}function Vfe(o,s,i){var u=Bfe(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 XBe(o,s){return function(){return Vfe(this,o,s)}}function JBe(o,s){return function(){return Vfe(this,o,s.apply(this,arguments))}}function QBe(o,s){return this.each((typeof s=="function"?JBe:XBe)(o,s))}function*eIe(){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 Hfe=[null];function Sp(o,s){this._groups=o,this._parents=s}function TR(){return new Sp([[document.documentElement]],Hfe)}function tIe(){return this}Sp.prototype=TR.prototype={constructor:Sp,select:TRe,selectAll:$Re,selectChild:BRe,selectChildren:LRe,filter:VRe,data:ZRe,enter:HRe,exit:qRe,join:YRe,merge:KRe,selection:tIe,order:XRe,sort:JRe,call:eBe,nodes:tBe,node:nBe,size:oBe,empty:sBe,each:rBe,attr:fBe,style:hBe,property:wBe,classed:EBe,text:ABe,html:DBe,raise:RBe,lower:IBe,append:PBe,insert:LBe,remove:HBe,clone:jBe,datum:WBe,on:KBe,dispatch:QBe,[Symbol.iterator]:eIe};function Mh(o){return typeof o=="string"?new Sp([[document.querySelector(o)]],[document.documentElement]):new Sp([[o]],Hfe)}function nIe(o){let s;for(;s=o.sourceEvent;)o=s;return o}function Nv(o,s){if(o=nIe(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 oIe={passive:!1},nR={capture:!0,passive:!1};function ite(o){o.stopImmediatePropagation()}function n4(o){o.preventDefault(),o.stopImmediatePropagation()}function zfe(o){var s=o.document.documentElement,i=Mh(o).on("dragstart.drag",n4,nR);"onselectstart"in s?i.on("selectstart.drag",n4,nR):(s.__noselect=s.style.MozUserSelect,s.style.MozUserSelect="none")}function Ufe(o,s){var i=o.document.documentElement,u=Mh(o).on("dragstart.drag",null);s&&(u.on("click.drag",n4,nR),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 kH=o=>()=>o;function pne(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}})}pne.prototype.on=function(){var o=this._.on.apply(this._,arguments);return o===this._?this:o};function sIe(o){return!o.ctrlKey&&!o.button}function rIe(){return this.parentNode}function aIe(o,s){return s??{x:o.x,y:o.y}}function iIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function lIe(){var o=sIe,s=rIe,i=aIe,u=iIe,m={},h=kU("start","drag","end"),b=0,C,x,_,N,O=0;function B(me){me.on("mousedown.drag",F).filter(u).on("touchstart.drag",X).on("touchmove.drag",q,oIe).on("touchend.drag touchcancel.drag",W).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function F(me,et){if(!(N||!o.call(this,me,et))){var $e=H(this,s.call(this,me,et),me,et,"mouse");$e&&(Mh(me.view).on("mousemove.drag",Z,nR).on("mouseup.drag",K,nR),zfe(me.view),ite(me),_=!1,C=me.clientX,x=me.clientY,$e("start",me))}}function Z(me){if(n4(me),!_){var et=me.clientX-C,$e=me.clientY-x;_=et*et+$e*$e>O}m.mouse("drag",me)}function K(me){Mh(me.view).on("mousemove.drag mouseup.drag",null),Ufe(me.view,_),n4(me),m.mouse("end",me)}function X(me,et){if(o.call(this,me,et)){var $e=me.changedTouches,te=s.call(this,me,et),We=$e.length,ft,lt;for(ft=0;ft<We;++ft)(lt=H(this,te,me,et,$e[ft].identifier,$e[ft]))&&(ite(me),lt("start",me,$e[ft]))}}function q(me){var et=me.changedTouches,$e=et.length,te,We;for(te=0;te<$e;++te)(We=m[et[te].identifier])&&(n4(me),We("drag",me,et[te]))}function W(me){var et=me.changedTouches,$e=et.length,te,We;for(N&&clearTimeout(N),N=setTimeout(function(){N=null},500),te=0;te<$e;++te)(We=m[et[te].identifier])&&(ite(me),We("end",me,et[te]))}function H(me,et,$e,te,We,ft){var lt=h.copy(),Ne=Nv(ft||$e,et),ue,Pt,ye;if((ye=i.call(me,new pne("beforestart",{sourceEvent:$e,target:B,identifier:We,active:b,x:Ne[0],y:Ne[1],dx:0,dy:0,dispatch:lt}),te))!=null)return ue=ye.x-Ne[0]||0,Pt=ye.y-Ne[1]||0,function De(R,Ue,be){var ot=Ne,nt;switch(R){case"start":m[We]=De,nt=b++;break;case"end":delete m[We],--b;case"drag":Ne=Nv(be||Ue,et),nt=b;break}lt.call(R,me,new pne(R,{sourceEvent:Ue,subject:ye,target:B,identifier:We,active:nt,x:Ne[0]+ue,y:Ne[1]+Pt,dx:Ne[0]-ot[0],dy:Ne[1]-ot[1],dispatch:lt}),te)}}return B.filter=function(me){return arguments.length?(o=typeof me=="function"?me:kH(!!me),B):o},B.container=function(me){return arguments.length?(s=typeof me=="function"?me:kH(me),B):s},B.subject=function(me){return arguments.length?(i=typeof me=="function"?me:kH(me),B):i},B.touchable=function(me){return arguments.length?(u=typeof me=="function"?me:kH(!!me),B):u},B.on=function(){var me=h.on.apply(h,arguments);return me===h?B:me},B.clickDistance=function(me){return arguments.length?(O=(me=+me)*me,B):Math.sqrt(O)},B}function Aoe(o,s,i){o.prototype=s.prototype=i,i.constructor=o}function jfe(o,s){var i=Object.create(o.prototype);for(var u in s)i[u]=s[u];return i}function AR(){}var oR=.7,_z=1/oR,o4="\\s*([+-]?\\d+)\\s*",sR="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Dv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",cIe=/^#([0-9a-f]{3,8})$/,uIe=new RegExp(`^rgb\\(${o4},${o4},${o4}\\)$`),dIe=new RegExp(`^rgb\\(${Dv},${Dv},${Dv}\\)$`),fIe=new RegExp(`^rgba\\(${o4},${o4},${o4},${sR}\\)$`),mIe=new RegExp(`^rgba\\(${Dv},${Dv},${Dv},${sR}\\)$`),pIe=new RegExp(`^hsl\\(${sR},${Dv},${Dv}\\)$`),gIe=new RegExp(`^hsla\\(${sR},${Dv},${Dv},${sR}\\)$`),ole={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};Aoe(AR,rR,{copy(o){return Object.assign(new this.constructor,this,o)},displayable(){return this.rgb().displayable()},hex:sle,formatHex:sle,formatHex8:hIe,formatHsl:vIe,formatRgb:rle,toString:rle});function sle(){return this.rgb().formatHex()}function hIe(){return this.rgb().formatHex8()}function vIe(){return Wfe(this).formatHsl()}function rle(){return this.rgb().formatRgb()}function rR(o){var s,i;return o=(o+"").trim().toLowerCase(),(s=cIe.exec(o))?(i=s[1].length,s=parseInt(s[1],16),i===6?ale(s):i===3?new xm(s>>8&15|s>>4&240,s>>4&15|s&240,(s&15)<<4|s&15,1):i===8?TH(s>>24&255,s>>16&255,s>>8&255,(s&255)/255):i===4?TH(s>>12&15|s>>8&240,s>>8&15|s>>4&240,s>>4&15|s&240,((s&15)<<4|s&15)/255):null):(s=uIe.exec(o))?new xm(s[1],s[2],s[3],1):(s=dIe.exec(o))?new xm(s[1]*255/100,s[2]*255/100,s[3]*255/100,1):(s=fIe.exec(o))?TH(s[1],s[2],s[3],s[4]):(s=mIe.exec(o))?TH(s[1]*255/100,s[2]*255/100,s[3]*255/100,s[4]):(s=pIe.exec(o))?cle(s[1],s[2]/100,s[3]/100,1):(s=gIe.exec(o))?cle(s[1],s[2]/100,s[3]/100,s[4]):ole.hasOwnProperty(o)?ale(ole[o]):o==="transparent"?new xm(NaN,NaN,NaN,0):null}function ale(o){return new xm(o>>16&255,o>>8&255,o&255,1)}function TH(o,s,i,u){return u<=0&&(o=s=i=NaN),new xm(o,s,i,u)}function bIe(o){return o instanceof AR||(o=rR(o)),o?(o=o.rgb(),new xm(o.r,o.g,o.b,o.opacity)):new xm}function gne(o,s,i,u){return arguments.length===1?bIe(o):new xm(o,s,i,u??1)}function xm(o,s,i,u){this.r=+o,this.g=+s,this.b=+i,this.opacity=+u}Aoe(xm,gne,jfe(AR,{brighter(o){return o=o==null?_z:Math.pow(_z,o),new xm(this.r*o,this.g*o,this.b*o,this.opacity)},darker(o){return o=o==null?oR:Math.pow(oR,o),new xm(this.r*o,this.g*o,this.b*o,this.opacity)},rgb(){return this},clamp(){return new xm(wE(this.r),wE(this.g),wE(this.b),kz(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:ile,formatHex:ile,formatHex8:yIe,formatRgb:lle,toString:lle}));function ile(){return`#${dE(this.r)}${dE(this.g)}${dE(this.b)}`}function yIe(){return`#${dE(this.r)}${dE(this.g)}${dE(this.b)}${dE((isNaN(this.opacity)?1:this.opacity)*255)}`}function lle(){const o=kz(this.opacity);return`${o===1?"rgb(":"rgba("}${wE(this.r)}, ${wE(this.g)}, ${wE(this.b)}${o===1?")":`, ${o})`}`}function kz(o){return isNaN(o)?1:Math.max(0,Math.min(1,o))}function wE(o){return Math.max(0,Math.min(255,Math.round(o)||0))}function dE(o){return o=wE(o),(o<16?"0":"")+o.toString(16)}function cle(o,s,i,u){return u<=0?o=s=i=NaN:i<=0||i>=1?o=s=NaN:s<=0&&(o=NaN),new Rh(o,s,i,u)}function Wfe(o){if(o instanceof Rh)return new Rh(o.h,o.s,o.l,o.opacity);if(o instanceof AR||(o=rR(o)),!o)return new Rh;if(o instanceof Rh)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 Rh(b,C,x,o.opacity)}function wIe(o,s,i,u){return arguments.length===1?Wfe(o):new Rh(o,s,i,u??1)}function Rh(o,s,i,u){this.h=+o,this.s=+s,this.l=+i,this.opacity=+u}Aoe(Rh,wIe,jfe(AR,{brighter(o){return o=o==null?_z:Math.pow(_z,o),new Rh(this.h,this.s,this.l*o,this.opacity)},darker(o){return o=o==null?oR:Math.pow(oR,o),new Rh(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 xm(lte(o>=240?o-240:o+120,m,u),lte(o,m,u),lte(o<120?o+240:o-120,m,u),this.opacity)},clamp(){return new Rh(ule(this.h),AH(this.s),AH(this.l),kz(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=kz(this.opacity);return`${o===1?"hsl(":"hsla("}${ule(this.h)}, ${AH(this.s)*100}%, ${AH(this.l)*100}%${o===1?")":`, ${o})`}`}}));function ule(o){return o=(o||0)%360,o<0?o+360:o}function AH(o){return Math.max(0,Math.min(1,o||0))}function lte(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 Zfe=o=>()=>o;function CIe(o,s){return function(i){return o+i*s}}function SIe(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 xIe(o){return(o=+o)==1?Gfe:function(s,i){return i-s?SIe(s,i,o):Zfe(isNaN(s)?i:s)}}function Gfe(o,s){var i=s-o;return i?CIe(o,i):Zfe(isNaN(o)?s:o)}const dle=function o(s){var i=xIe(s);function u(m,h){var b=i((m=gne(m)).r,(h=gne(h)).r),C=i(m.g,h.g),x=i(m.b,h.b),_=Gfe(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 a2(o,s){return o=+o,s=+s,function(i){return o*(1-i)+s*i}}var hne=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,cte=new RegExp(hne.source,"g");function EIe(o){return function(){return o}}function _Ie(o){return function(s){return o(s)+""}}function kIe(o,s){var i=hne.lastIndex=cte.lastIndex=0,u,m,h,b=-1,C=[],x=[];for(o=o+"",s=s+"";(u=hne.exec(o))&&(m=cte.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:a2(u,m)})),i=cte.lastIndex;return i<s.length&&(h=s.slice(i),C[b]?C[b]+=h:C[++b]=h),C.length<2?x[0]?_Ie(x[0].x):EIe(s):(s=x.length,function(_){for(var N=0,O;N<s;++N)C[(O=x[N]).i]=O.x(_);return C.join("")})}var fle=180/Math.PI,vne={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function qfe(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)*fle,skewX:Math.atan(x)*fle,scaleX:b,scaleY:C}}var NH;function TIe(o){const s=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(o+"");return s.isIdentity?vne:qfe(s.a,s.b,s.c,s.d,s.e,s.f)}function AIe(o){return o==null||(NH||(NH=document.createElementNS("http://www.w3.org/2000/svg","g")),NH.setAttribute("transform",o),!(o=NH.transform.baseVal.consolidate()))?vne:(o=o.matrix,qfe(o.a,o.b,o.c,o.d,o.e,o.f))}function Yfe(o,s,i,u){function m(_){return _.length?_.pop()+" ":""}function h(_,N,O,B,F,Z){if(_!==O||N!==B){var K=F.push("translate(",null,s,null,i);Z.push({i:K-4,x:a2(_,O)},{i:K-2,x:a2(N,B)})}else(O||B)&&F.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:a2(_,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:a2(_,N)}):N&&O.push(m(O)+"skewX("+N+u)}function x(_,N,O,B,F,Z){if(_!==O||N!==B){var K=F.push(m(F)+"scale(",null,",",null,")");Z.push({i:K-4,x:a2(_,O)},{i:K-2,x:a2(N,B)})}else(O!==1||B!==1)&&F.push(m(F)+"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(F){for(var Z=-1,K=B.length,X;++Z<K;)O[(X=B[Z]).i]=X.x(F);return O.join("")}}}var NIe=Yfe(TIe,"px, ","px)","deg)"),OIe=Yfe(AIe,", ",")",")"),$Ie=1e-12;function mle(o){return((o=Math.exp(o))+1/o)/2}function DIe(o){return((o=Math.exp(o))-1/o)/2}function MIe(o){return((o=Math.exp(2*o))-1)/(o+1)}const RIe=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],F=N-C,Z=O-x,K=F*F+Z*Z,X,q;if(K<$Ie)q=Math.log(B/_)/s,X=function(te){return[C+te*F,x+te*Z,_*Math.exp(s*te*q)]};else{var W=Math.sqrt(K),H=(B*B-_*_+u*K)/(2*_*i*W),me=(B*B-_*_-u*K)/(2*B*i*W),et=Math.log(Math.sqrt(H*H+1)-H),$e=Math.log(Math.sqrt(me*me+1)-me);q=($e-et)/s,X=function(te){var We=te*q,ft=mle(et),lt=_/(i*W)*(ft*MIe(s*We+et)-DIe(et));return[C+lt*F,x+lt*Z,_*ft/mle(s*We+et)]}}return X.duration=q*1e3*s/Math.SQRT2,X}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,DM=0,OM=0,Kfe=1e3,Tz,MM,Az=0,kE=0,AU=0,aR=typeof performance=="object"&&performance.now?performance:Date,Xfe=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(o){setTimeout(o,17)};function Noe(){return kE||(Xfe(BIe),kE=aR.now()+AU)}function BIe(){kE=0}function Nz(){this._call=this._time=this._next=null}Nz.prototype=Jfe.prototype={constructor:Nz,restart:function(o,s,i){if(typeof o!="function")throw new TypeError("callback is not a function");i=(i==null?Noe():+i)+(s==null?0:+s),!this._next&&MM!==this&&(MM?MM._next=this:Tz=this,MM=this),this._call=o,this._time=i,bne()},stop:function(){this._call&&(this._call=null,this._time=1/0,bne())}};function Jfe(o,s,i){var u=new Nz;return u.restart(o,s,i),u}function IIe(){Noe(),++m4;for(var o=Tz,s;o;)(s=kE-o._time)>=0&&o._call.call(void 0,s),o=o._next;--m4}function ple(){kE=(Az=aR.now())+AU,m4=DM=0;try{IIe()}finally{m4=0,FIe(),kE=0}}function PIe(){var o=aR.now(),s=o-Az;s>Kfe&&(AU-=s,Az=o)}function FIe(){for(var o,s=Tz,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:Tz=i);MM=o,bne(u)}function bne(o){if(!m4){DM&&(DM=clearTimeout(DM));var s=o-kE;s>24?(o<1/0&&(DM=setTimeout(ple,o-aR.now()-AU)),OM&&(OM=clearInterval(OM))):(OM||(Az=aR.now(),OM=setInterval(PIe,Kfe)),m4=1,Xfe(ple))}}function gle(o,s,i){var u=new Nz;return s=s==null?0:+s,u.restart(m=>{u.stop(),o(m+s)},s,i),u}var LIe=kU("start","end","cancel","interrupt"),VIe=[],Qfe=0,hle=1,yne=2,XH=3,vle=4,wne=5,JH=6;function NU(o,s,i,u,m,h){var b=o.__transition;if(!b)o.__transition={};else if(i in b)return;HIe(o,i,{name:s,index:u,group:m,on:LIe,tween:VIe,time:h.time,delay:h.delay,duration:h.duration,ease:h.ease,timer:null,state:Qfe})}function Ooe(o,s){var i=Ph(o,s);if(i.state>Qfe)throw new Error("too late; already scheduled");return i}function Fv(o,s){var i=Ph(o,s);if(i.state>XH)throw new Error("too late; already running");return i}function Ph(o,s){var i=o.__transition;if(!i||!(i=i[s]))throw new Error("transition not found");return i}function HIe(o,s,i){var u=o.__transition,m;u[s]=i,i.timer=Jfe(h,0,i.time);function h(_){i.state=hle,i.timer.restart(b,i.delay,i.time),i.delay<=_&&b(_-i.delay)}function b(_){var N,O,B,F;if(i.state!==hle)return x();for(N in u)if(F=u[N],F.name===i.name){if(F.state===XH)return gle(b);F.state===vle?(F.state=JH,F.timer.stop(),F.on.call("interrupt",o,o.__data__,F.index,F.group),delete u[N]):+N<s&&(F.state=JH,F.timer.stop(),F.on.call("cancel",o,o.__data__,F.index,F.group),delete u[N])}if(gle(function(){i.state===XH&&(i.state=vle,i.timer.restart(C,i.delay,i.time),C(_))}),i.state=yne,i.on.call("start",o,o.__data__,i.index,i.group),i.state===yne){for(i.state=XH,m=new Array(B=i.tween.length),N=0,O=-1;N<B;++N)(F=i.tween[N].value.call(o,o.__data__,i.index,i.group))&&(m[++O]=F);m.length=O+1}}function C(_){for(var N=_<i.duration?i.ease.call(null,_/i.duration):(i.timer.restart(x),i.state=wne,1),O=-1,B=m.length;++O<B;)m[O].call(o,N);i.state===wne&&(i.on.call("end",o,o.__data__,i.index,i.group),x())}function x(){i.state=JH,i.timer.stop(),delete u[s];for(var _ in u)return;delete o.__transition}}function QH(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>yne&&u.state<wne,u.state=JH,u.timer.stop(),u.on.call(m?"interrupt":"cancel",o,o.__data__,u.index,u.group),delete i[b]}h&&delete o.__transition}}function zIe(o){return this.each(function(){QH(this,o)})}function UIe(o,s){var i,u;return function(){var m=Fv(this,o),h=m.tween;if(h!==i){u=i=h;for(var b=0,C=u.length;b<C;++b)if(u[b].name===s){u=u.slice(),u.splice(b,1);break}}m.tween=u}}function jIe(o,s,i){var u,m;if(typeof i!="function")throw new Error;return function(){var h=Fv(this,o),b=h.tween;if(b!==u){m=(u=b).slice();for(var C={name:s,value:i},x=0,_=m.length;x<_;++x)if(m[x].name===s){m[x]=C;break}x===_&&m.push(C)}h.tween=m}}function WIe(o,s){var i=this._id;if(o+="",arguments.length<2){for(var u=Ph(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?UIe:jIe)(i,o,s))}function $oe(o,s,i){var u=o._id;return o.each(function(){var m=Fv(this,u);(m.value||(m.value={}))[s]=i.apply(this,arguments)}),function(m){return Ph(m,u).value[s]}}function eme(o,s){var i;return(typeof s=="number"?a2:s instanceof rR?dle:(i=rR(s))?(s=i,dle):kIe)(o,s)}function ZIe(o){return function(){this.removeAttribute(o)}}function GIe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function qIe(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 YIe(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 KIe(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 XIe(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 JIe(o,s){var i=TU(o),u=i==="transform"?OIe:eme;return this.attrTween(o,typeof s=="function"?(i.local?XIe:KIe)(i,u,$oe(this,"attr."+o,s)):s==null?(i.local?GIe:ZIe)(i):(i.local?YIe:qIe)(i,u,s))}function QIe(o,s){return function(i){this.setAttribute(o,s.call(this,i))}}function ePe(o,s){return function(i){this.setAttributeNS(o.space,o.local,s.call(this,i))}}function tPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&ePe(o,h)),i}return m._value=s,m}function nPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&QIe(o,h)),i}return m._value=s,m}function oPe(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=TU(o);return this.tween(i,(u.local?tPe:nPe)(u,s))}function sPe(o,s){return function(){Ooe(this,o).delay=+s.apply(this,arguments)}}function rPe(o,s){return s=+s,function(){Ooe(this,o).delay=s}}function aPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?sPe:rPe)(s,o)):Ph(this.node(),s).delay}function iPe(o,s){return function(){Fv(this,o).duration=+s.apply(this,arguments)}}function lPe(o,s){return s=+s,function(){Fv(this,o).duration=s}}function cPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?iPe:lPe)(s,o)):Ph(this.node(),s).duration}function uPe(o,s){if(typeof s!="function")throw new Error;return function(){Fv(this,o).ease=s}}function dPe(o){var s=this._id;return arguments.length?this.each(uPe(s,o)):Ph(this.node(),s).ease}function fPe(o,s){return function(){var i=s.apply(this,arguments);if(typeof i!="function")throw new Error;Fv(this,o).ease=i}}function mPe(o){if(typeof o!="function")throw new Error;return this.each(fPe(this._id,o))}function pPe(o){typeof o!="function"&&(o=Dfe(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 V0(u,this._parents,this._name,this._id)}function gPe(o){if(o._id!==this._id)throw new Error;for(var s=this._groups,i=o._groups,u=s.length,m=i.length,h=Math.min(u,m),b=new Array(u),C=0;C<h;++C)for(var x=s[C],_=i[C],N=x.length,O=b[C]=new Array(N),B,F=0;F<N;++F)(B=x[F]||_[F])&&(O[F]=B);for(;C<u;++C)b[C]=s[C];return new V0(b,this._parents,this._name,this._id)}function hPe(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 vPe(o,s,i){var u,m,h=hPe(s)?Ooe:Fv;return function(){var b=h(this,o),C=b.on;C!==u&&(m=(u=C).copy()).on(s,i),b.on=m}}function bPe(o,s){var i=this._id;return arguments.length<2?Ph(this.node(),i).on.on(o):this.each(vPe(i,o,s))}function yPe(o){return function(){var s=this.parentNode;for(var i in this.__transition)if(+i!==o)return;s&&s.removeChild(this)}}function wPe(){return this.on("end.remove",yPe(this._id))}function CPe(o){var s=this._name,i=this._id;typeof o!="function"&&(o=koe(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,NU(_[B],s,i,B,_,Ph(N,i)));return new V0(h,this._parents,s,i)}function SPe(o){var s=this._name,i=this._id;typeof o!="function"&&(o=$fe(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),F,Z=Ph(N,i),K=0,X=B.length;K<X;++K)(F=B[K])&&NU(F,s,i,K,B,Z);h.push(B),b.push(N)}return new V0(h,b,s,i)}var xPe=TR.prototype.constructor;function EPe(){return new xPe(this._groups,this._parents)}function _Pe(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 tme(o){return function(){this.style.removeProperty(o)}}function kPe(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 TPe(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 APe(o,s){var i,u,m,h="style."+s,b="end."+h,C;return function(){var x=Fv(this,o),_=x.on,N=x.value[h]==null?C||(C=tme(s)):void 0;(_!==i||m!==N)&&(u=(i=_).copy()).on(b,m=N),x.on=u}}function NPe(o,s,i){var u=(o+="")=="transform"?NIe:eme;return s==null?this.styleTween(o,_Pe(o,u)).on("end.style."+o,tme(o)):typeof s=="function"?this.styleTween(o,TPe(o,u,$oe(this,"style."+o,s))).each(APe(this._id,o)):this.styleTween(o,kPe(o,u,s),i).on("end.style."+o,null)}function OPe(o,s,i){return function(u){this.style.setProperty(o,s.call(this,u),i)}}function $Pe(o,s,i){var u,m;function h(){var b=s.apply(this,arguments);return b!==m&&(u=(m=b)&&OPe(o,b,i)),u}return h._value=s,h}function DPe(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,$Pe(o,s,i??""))}function MPe(o){return function(){this.textContent=o}}function RPe(o){return function(){var s=o(this);this.textContent=s??""}}function BPe(o){return this.tween("text",typeof o=="function"?RPe($oe(this,"text",o)):MPe(o==null?"":o+""))}function IPe(o){return function(s){this.textContent=o.call(this,s)}}function PPe(o){var s,i;function u(){var m=o.apply(this,arguments);return m!==i&&(s=(i=m)&&IPe(m)),s}return u._value=o,u}function FPe(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,PPe(o))}function LPe(){for(var o=this._name,s=this._id,i=nme(),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=Ph(x,s);NU(x,o,i,_,b,{time:N.time+N.delay+N.duration,delay:0,duration:N.duration,ease:N.ease})}return new V0(u,this._parents,o,i)}function VPe(){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 _=Fv(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 HPe=0;function V0(o,s,i,u){this._groups=o,this._parents=s,this._name=i,this._id=u}function nme(){return++HPe}var $0=TR.prototype;V0.prototype={constructor:V0,select:CPe,selectAll:SPe,selectChild:$0.selectChild,selectChildren:$0.selectChildren,filter:pPe,merge:gPe,selection:EPe,transition:LPe,call:$0.call,nodes:$0.nodes,node:$0.node,size:$0.size,empty:$0.empty,each:$0.each,on:bPe,attr:JIe,attrTween:oPe,style:NPe,styleTween:DPe,text:BPe,textTween:FPe,remove:wPe,tween:WIe,delay:aPe,duration:cPe,ease:dPe,easeVarying:mPe,end:VPe,[Symbol.iterator]:$0[Symbol.iterator]};function zPe(o){return((o*=2)<=1?o*o*o:(o-=2)*o*o+2)/2}var UPe={time:null,delay:0,duration:250,ease:zPe};function jPe(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 WPe(o){var s,i;o instanceof V0?(s=o._id,o=o._name):(s=nme(),(i=UPe).time=Noe(),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[_])&&NU(x,o,s,_,b,i||jPe(x,s));return new V0(u,this._parents,o,s)}TR.prototype.interrupt=zIe;TR.prototype.transition=WPe;const OH=o=>()=>o;function ZPe(o,{sourceEvent:s,target:i,transform:u,dispatch:m}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:s,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:u,enumerable:!0,configurable:!0},_:{value:m}})}function I0(o,s,i){this.k=o,this.x=s,this.y=i}I0.prototype={constructor:I0,scale:function(o){return o===1?this:new I0(this.k*o,this.x,this.y)},translate:function(o,s){return o===0&s===0?this:new I0(this.k,this.x+this.k*o,this.y+this.k*s)},apply:function(o){return[o[0]*this.k+this.x,o[1]*this.k+this.y]},applyX:function(o){return o*this.k+this.x},applyY:function(o){return o*this.k+this.y},invert:function(o){return[(o[0]-this.x)/this.k,(o[1]-this.y)/this.k]},invertX:function(o){return(o-this.x)/this.k},invertY:function(o){return(o-this.y)/this.k},rescaleX:function(o){return o.copy().domain(o.range().map(this.invertX,this).map(o.invert,o))},rescaleY:function(o){return o.copy().domain(o.range().map(this.invertY,this).map(o.invert,o))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var p4=new I0(1,0,0);I0.prototype;function ute(o){o.stopImmediatePropagation()}function $M(o){o.preventDefault(),o.stopImmediatePropagation()}function GPe(o){return(!o.ctrlKey||o.type==="wheel")&&!o.button}function qPe(){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 ble(){return this.__zoom||p4}function YPe(o){return-o.deltaY*(o.deltaMode===1?.05:o.deltaMode?1:.002)*(o.ctrlKey?10:1)}function KPe(){return navigator.maxTouchPoints||"ontouchstart"in this}function XPe(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 JPe(){var o=GPe,s=qPe,i=XPe,u=YPe,m=KPe,h=[0,1/0],b=[[-1/0,-1/0],[1/0,1/0]],C=250,x=RIe,_=kU("start","zoom","end"),N,O,B,F=500,Z=150,K=0,X=10;function q(ye){ye.property("__zoom",ble).on("wheel.zoom",We,{passive:!1}).on("mousedown.zoom",ft).on("dblclick.zoom",lt).filter(m).on("touchstart.zoom",Ne).on("touchmove.zoom",ue).on("touchend.zoom touchcancel.zoom",Pt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}q.transform=function(ye,De,R,Ue){var be=ye.selection?ye.selection():ye;be.property("__zoom",ble),ye!==be?et(ye,De,R,Ue):be.interrupt().each(function(){$e(this,arguments).event(Ue).start().zoom(null,typeof De=="function"?De.apply(this,arguments):De).end()})},q.scaleBy=function(ye,De,R,Ue){q.scaleTo(ye,function(){var be=this.__zoom.k,ot=typeof De=="function"?De.apply(this,arguments):De;return be*ot},R,Ue)},q.scaleTo=function(ye,De,R,Ue){q.transform(ye,function(){var be=s.apply(this,arguments),ot=this.__zoom,nt=R==null?me(be):typeof R=="function"?R.apply(this,arguments):R,ge=ot.invert(nt),Ze=typeof De=="function"?De.apply(this,arguments):De;return i(H(W(ot,Ze),nt,ge),be,b)},R,Ue)},q.translateBy=function(ye,De,R,Ue){q.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,Ue)},q.translateTo=function(ye,De,R,Ue,be){q.transform(ye,function(){var ot=s.apply(this,arguments),nt=this.__zoom,ge=Ue==null?me(ot):typeof Ue=="function"?Ue.apply(this,arguments):Ue;return i(p4.translate(ge[0],ge[1]).scale(nt.k).translate(typeof De=="function"?-De.apply(this,arguments):-De,typeof R=="function"?-R.apply(this,arguments):-R),ot,b)},Ue,be)};function W(ye,De){return De=Math.max(h[0],Math.min(h[1],De)),De===ye.k?ye:new I0(De,ye.x,ye.y)}function H(ye,De,R){var Ue=De[0]-R[0]*ye.k,be=De[1]-R[1]*ye.k;return Ue===ye.x&&be===ye.y?ye:new I0(ye.k,Ue,be)}function me(ye){return[(+ye[0][0]+ +ye[1][0])/2,(+ye[0][1]+ +ye[1][1])/2]}function et(ye,De,R,Ue){ye.on("start.zoom",function(){$e(this,arguments).event(Ue).start()}).on("interrupt.zoom end.zoom",function(){$e(this,arguments).event(Ue).end()}).tween("zoom",function(){var be=this,ot=arguments,nt=$e(be,ot).event(Ue),ge=s.apply(be,ot),Ze=R==null?me(ge):typeof R=="function"?R.apply(be,ot):R,Tt=Math.max(ge[1][0]-ge[0][0],ge[1][1]-ge[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(dt){if(dt===1)dt=vt;else{var oe=Be(dt),pn=Tt/oe[2];dt=new I0(pn,Ze[0]-oe[0]*pn,Ze[1]-oe[1]*pn)}nt.zoom(null,dt)}})}function $e(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=Mh(this.that).datum();_.call(ye,this.that,new ZPe(ye,{sourceEvent:this.sourceEvent,target:q,type:ye,transform:this.that.__zoom,dispatch:_}),De)}};function We(ye,...De){if(!o.apply(this,arguments))return;var R=$e(this,De).event(ye),Ue=this.__zoom,be=Math.max(h[0],Math.min(h[1],Ue.k*Math.pow(2,u.apply(this,arguments)))),ot=Nv(ye);if(R.wheel)(R.mouse[0][0]!==ot[0]||R.mouse[0][1]!==ot[1])&&(R.mouse[1]=Ue.invert(R.mouse[0]=ot)),clearTimeout(R.wheel);else{if(Ue.k===be)return;R.mouse=[ot,Ue.invert(ot)],QH(this),R.start()}$M(ye),R.wheel=setTimeout(nt,Z),R.zoom("mouse",i(H(W(Ue,be),R.mouse[0],R.mouse[1]),R.extent,b));function nt(){R.wheel=null,R.end()}}function ft(ye,...De){if(B||!o.apply(this,arguments))return;var R=ye.currentTarget,Ue=$e(this,De,!0).event(ye),be=Mh(ye.view).on("mousemove.zoom",Ze,!0).on("mouseup.zoom",Tt,!0),ot=Nv(ye,R),nt=ye.clientX,ge=ye.clientY;zfe(ye.view),ute(ye),Ue.mouse=[ot,this.__zoom.invert(ot)],QH(this),Ue.start();function Ze(He){if($M(He),!Ue.moved){var vt=He.clientX-nt,Be=He.clientY-ge;Ue.moved=vt*vt+Be*Be>K}Ue.event(He).zoom("mouse",i(H(Ue.that.__zoom,Ue.mouse[0]=Nv(He,R),Ue.mouse[1]),Ue.extent,b))}function Tt(He){be.on("mousemove.zoom mouseup.zoom",null),Ufe(He.view,Ue.moved),$M(He),Ue.event(He).end()}}function lt(ye,...De){if(o.apply(this,arguments)){var R=this.__zoom,Ue=Nv(ye.changedTouches?ye.changedTouches[0]:ye,this),be=R.invert(Ue),ot=R.k*(ye.shiftKey?.5:2),nt=i(H(W(R,ot),Ue,be),s.apply(this,De),b);$M(ye),C>0?Mh(this).transition().duration(C).call(et,nt,Ue,ye):Mh(this).call(q.transform,nt,Ue,ye)}}function Ne(ye,...De){if(o.apply(this,arguments)){var R=ye.touches,Ue=R.length,be=$e(this,De,ye.changedTouches.length===Ue).event(ye),ot,nt,ge,Ze;for(ute(ye),nt=0;nt<Ue;++nt)ge=R[nt],Ze=Nv(ge,this),Ze=[Ze,this.__zoom.invert(Ze),ge.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},F)),QH(this),be.start())}}function ue(ye,...De){if(this.__zooming){var R=$e(this,De).event(ye),Ue=ye.changedTouches,be=Ue.length,ot,nt,ge,Ze;for($M(ye),ot=0;ot<be;++ot)nt=Ue[ot],ge=Nv(nt,this),R.touch0&&R.touch0[2]===nt.identifier?R.touch0[0]=ge:R.touch1&&R.touch1[2]===nt.identifier&&(R.touch1[0]=ge);if(nt=R.that.__zoom,R.touch1){var Tt=R.touch0[0],He=R.touch0[1],vt=R.touch1[0],Be=R.touch1[1],dt=(dt=vt[0]-Tt[0])*dt+(dt=vt[1]-Tt[1])*dt,oe=(oe=Be[0]-He[0])*oe+(oe=Be[1]-He[1])*oe;nt=W(nt,Math.sqrt(dt/oe)),ge=[(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)ge=R.touch0[0],Ze=R.touch0[1];else return;R.zoom("touch",i(H(nt,ge,Ze),R.extent,b))}}function Pt(ye,...De){if(this.__zooming){var R=$e(this,De).event(ye),Ue=ye.changedTouches,be=Ue.length,ot,nt;for(ute(ye),B&&clearTimeout(B),B=setTimeout(function(){B=null},F),ot=0;ot<be;++ot)nt=Ue[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=Nv(nt,this),Math.hypot(O[0]-nt[0],O[1]-nt[1])<X)){var ge=Mh(this).on("dblclick.zoom");ge&&ge.apply(this,arguments)}}}return q.wheelDelta=function(ye){return arguments.length?(u=typeof ye=="function"?ye:OH(+ye),q):u},q.filter=function(ye){return arguments.length?(o=typeof ye=="function"?ye:OH(!!ye),q):o},q.touchable=function(ye){return arguments.length?(m=typeof ye=="function"?ye:OH(!!ye),q):m},q.extent=function(ye){return arguments.length?(s=typeof ye=="function"?ye:OH([[+ye[0][0],+ye[0][1]],[+ye[1][0],+ye[1][1]]]),q):s},q.scaleExtent=function(ye){return arguments.length?(h[0]=+ye[0],h[1]=+ye[1],q):[h[0],h[1]]},q.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],q):[[b[0][0],b[0][1]],[b[1][0],b[1][1]]]},q.constrain=function(ye){return arguments.length?(i=ye,q):i},q.duration=function(ye){return arguments.length?(C=+ye,q):C},q.interpolate=function(ye){return arguments.length?(x=ye,q):x},q.on=function(){var ye=_.on.apply(_,arguments);return ye===_?q:ye},q.clickDistance=function(ye){return arguments.length?(K=(ye=+ye)*ye,q):Math.sqrt(K)},q.tapDistance=function(ye){return arguments.length?(X=+ye,q):X},q}var ss=(o=>(o.Left="left",o.Top="top",o.Right="right",o.Bottom="bottom",o))(ss||{}),Doe=(o=>(o.Partial="partial",o.Full="full",o))(Doe||{}),iE=(o=>(o.Bezier="default",o.SimpleBezier="simple-bezier",o.Straight="straight",o.Step="step",o.SmoothStep="smoothstep",o))(iE||{}),g2=(o=>(o.Strict="strict",o.Loose="loose",o))(g2||{}),Oz=(o=>(o.Arrow="arrow",o.ArrowClosed="arrowclosed",o))(Oz||{}),UM=(o=>(o.Free="free",o.Vertical="vertical",o.Horizontal="horizontal",o))(UM||{}),ome=(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))(ome||{});const QPe=["INPUT","SELECT","TEXTAREA"];function Cne(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 QPe.includes(u==null?void 0:u.nodeName)||m||!!h}function e8e(o){return o.ctrlKey||o.metaKey||o.shiftKey||o.altKey}function yle(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 Ue(ce)},nt=(ee,ie)=>{const ce=De(ee,ie).join("").replace(/\s/g,"");return Ue(ce)},ge=(ee,ie)=>()=>ie(ee.getBody(),ee.schema),Ze=(ee,ie)=>()=>ie(ee.selection.getRng().cloneContents(),ee.schema),Tt=ee=>ge(ee,be),He=ee=>({body:{getWordCount:Tt(ee),getCharacterCount:ge(ee,ot),getCharacterCountWithoutSpaces:ge(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))},dt=(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=dt(()=>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 i6e=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),l6e=(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})},c6e=o=>btoa(o.match(/\w{2}/g).map(s=>String.fromCharCode(parseInt(s,16))).join(""));function u6e(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,${c6e(C)}`;m.push({base64:x,file:l6e(x)})}}return m}const d6e=(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=u6e(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}},f6e=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})},m6e=async o=>{try{const s=f6e(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}},p6e=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 m6e(_.src);_.img.setAttribute("src",N)}catch{_.img.remove()}});await Promise.all(x)}return i.body.innerHTML},g6e=o=>{o.querySelectorAll("td").forEach(i=>{const u=i.getAttribute("width"),m=i.getAttribute("style")||"";u==="0"&&m.includes("border:none")&&i.remove()})},h6e=o=>{o.querySelectorAll("table").forEach(i=>{i.style.maxWidth="100%"})},v6e=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("; "))}})},b6e=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,F=parseInt(B.getAttribute("colspan")||"1"),Z=(parseFloat(C)*F).toFixed(2),X=(B.getAttribute("style")||"").split(";").filter(W=>!W.trim().toLowerCase().startsWith("width")).join(";"),q=X?`${X}; width: ${Z}%`:`width: ${Z}%`;B.setAttribute("style",q)})})}}})},y6e=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)})},w6e=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}})})},C6e=o=>{o.querySelectorAll('[style*="mso-"]').forEach(i=>{const m=(i.getAttribute("style")||"").replace(/mso-[^:]+:[^;]+;/g,"");i.setAttribute("style",m)})},S6e=o=>{o.querySelectorAll('[style*="tab-stops"]').forEach(i=>{const m=(i.getAttribute("style")||"").replace(/tab-stops:[^;]+;/g,"");i.setAttribute("style",m)})},x6e=o=>{o=o.replace(/<a(?!.*?href=)[^>]*>([\s\S]*?)<\/a>/gi,"$1");const i=new DOMParser().parseFromString(o,"text/html");return g6e(i),h6e(i),y6e(i),w6e(i),C6e(i),S6e(i),v6e(i),b6e(i),o=i.body.innerHTML,o};xz.PluginManager.add("pasteprocess",o=>(o.on("paste",s=>{if(s.clipboardData){const i=s.clipboardData.getData("text/html")||s.clipboardData.getData("text");if(i6e(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=x6e(i),h=d6e(m,s);p6e(h).then(b=>{o.insertContent(b),u.close()})}}}),{}));let EH="A4";const lne={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}},E6e=Object.keys(lne).map(o=>`pagesize${o}`).join(" ");xz.PluginManager.add("pagesize",o=>{const s=o.options.register;s("pagesize",{processor:"string",default:"A4"}),EH=(m=>h=>h.options.get(m))("pagesize")(o);const u=m=>{const h=lne[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(lne).forEach(m=>{o.ui.registry.addToggleMenuItem(`pagesize${m}`,{text:m,onAction:()=>{EH=m,u(m)},onSetup:h=>(h.setActive(EH===m),()=>{})})}),o.on("init",()=>{u(EH)}),{}});const _6e=["accordion","advlist","anchor","autolink","autosave","charmap","directionality","importcss","insertdatetime","lists","image","media","pagebreak","preview","save","searchreplace","table","fullscreen","wordcount","pasteprocess","pagesize"],k6e="undo redo | blocks bold italic forecolor removeformat alignleft aligncenter alignright alignjustify outdent indent pagebreakfullscreen preview",T6e={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:E6e}},menubar:"file edit insert table tools help pagesize",cleanup:!0,branding:!1,language:"zh_CN",plugins:_6e,toolbar:k6e,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}`)})})},A6e={name:"ProEditor",components:{Editor:r6e},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(T6e),contentValue:o.modelValue,timeout:null});f.onMounted(()=>{xz.init({license_key:"gpl"}),xz.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}}},N6e={class:"my-tinymce"};function O6e(o,s,i,u,m,h){const b=f.resolveComponent("Editor");return f.openBlock(),f.createElementBlock("div",N6e,[f.createVNode(b,{modelValue:o.contentValue,"onUpdate:modelValue":s[0]||(s[0]=C=>o.contentValue=C),init:o.myInit},null,8,["modelValue","init"])])}const dfe=$i(A6e,[["render",O6e]]),$6e={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 D6e(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 woe=$i($6e,[["render",D6e]]),M6e=["innerHTML"],ffe=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(woe,null,{default:f.withCtx(()=>[f.createElementVNode("div",{innerHTML:s.value},null,8,M6e)]),_:1}))}}),mfe=Symbol("nodesUI"),Pf=()=>{const o=f.inject(mfe);if(!o)throw new Error("NodesUI context not found");return o};function Coe(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 R6e(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 pfe(o,s){if(!s)return null;try{return(s.shadowRoot||s).querySelector(o)}catch(i){return console.error("nodePath query error:",i),null}}const VA=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}`:""),B6e=(o,s,i)=>{var u,m;if(!xoe(o)){const h=i==null?void 0:i.getRootNode(),b=(u=h==null?void 0:h.getSelection)==null?void 0:u.call(h),C=pfe(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)}}},I6e=(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)},P6e=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},F6e=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=Coe(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},L6e=o=>exe(o,s=>f.toValue(s.nodes).map(i=>({...i,color:s.color,activated:s==null?void 0:s.activated,dataGroupKey:s.id}))),Soe=(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})`},V6e=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}},H6e=(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=V6e(C);return x?(x==null?void 0:x.showTextType)==="input"?{...C,...x,inputIndex:i++}:{...C,...x}:null}))==null?void 0:h.filter(Boolean):[]};function z6e(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(F=>F.rowIndex===x&&F.colIndex===O&&!u.has(F));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 U6e(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 gfe=(o,s)=>{var _;const i=H6e(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=oxe(m,"tableIndex"),b=Object.entries(h).map(([N,O])=>({tableIndex:Number(N),nodes:O})),C=tde(b==null?void 0:b.map(N=>z6e(N==null?void 0:N.nodes))),x=(C==null?void 0:C.map(N=>U6e(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}`:""},j6e=(o,s)=>{const i=gfe(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(",")},xoe=o=>o.startOffset===void 0&&o.textNodeIndex===void 0,W6e=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(F=>{const[Z,K]=F.split(":").map(X=>X.trim());Z&&K&&(B[Z]=K)}),B},m=O=>Object.entries(O).map(([B,F])=>`${B}: ${F}`).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)}}},Z6e={key:0},G6e={key:1,class:"td-node"},q6e=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",Z6e,f.toDisplayString((h=s==null?void 0:s.node)==null?void 0:h.label),1)):(f.openBlock(),f.createElementBlock("span",G6e,f.toDisplayString((b=s==null?void 0:s.node)==null?void 0:b.label),1))}}}),hfe=Symbol("nodesEditor"),j0=()=>{const o=f.inject(hfe);if(!o)throw new Error("NodesEditor context not found");return o},CU=f.defineComponent({__name:"index",props:{node:{}},setup(o){const s=o,{currentNodes:i}=Pf(),{nodes:u}=j0(),m=f.computed(()=>{var C;return(C=s.node)!=null&&C.id?u.value.some(x=>x.id===s.node.id):!1}),h=f.computed(()=>{var C;if(!((C=s.node)!=null&&C.element))return!1;try{return s.node.element.parentNode!==null}catch(x){return console.warn("Element validation failed:",x),!1}}),b=f.computed(()=>{var C;return(C=f.toValue(i))==null?void 0:C.find(x=>{var _;return(x==null?void 0:x.id)===((_=s==null?void 0:s.node)==null?void 0:_.id)})});return f.watch(()=>b,()=>{var x,_,N,O;const C=f.toValue(b);(x=s==null?void 0:s.node)!=null&&x.element&&(C?C!=null&&C.activated||(s.node.element.style.setProperty("--node-color",(C==null?void 0:C.color)||"#409eff"),s.node.element.style.setProperty("--node-bg-color",Soe((C==null?void 0:C.color)||"#409eff",.1)),s.node.element.setAttribute("data-dataGroupKey",C==null?void 0:C.dataGroupKey),s.node.element.setAttribute("selectable","false"),s.node.element.classList.add("activated")):((_=s.node.element)==null||_.removeAttribute("data-dataGroupKey"),(N=s.node.element)==null||N.removeAttribute("selectable"),(O=s.node.element)==null||O.classList.remove("activated")))},{immediate:!0,deep:!0}),(C,x)=>{var _;return(_=C.node)!=null&&_.element&&h.value&&m.value?(f.openBlock(),f.createBlock(f.Teleport,{key:0,to:C.node.element},[f.renderSlot(C.$slots,"default",{node:C.node},()=>[f.createVNode(q6e,{node:C.node},null,8,["node"])])],8,["to"])):f.createCommentVNode("",!0)}}});function Y6e(){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 vfe(){const{selectedNodes:o,setSelectedNodes:s,containerRef:i,currentNodes:u}=Pf(),{editorId:m,nodes:h}=j0(),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=$e=>{const te=$e.closest(".node-item-td")||$e.closest(".node-item");if(te!==null){let We=[];if(te.classList.contains("node-selected"))return;const ft=te.getAttribute("id");if(ft&&h.value){const lt=h.value.find(Ne=>Ne.id===ft);lt&&(We=[lt])}We=W(We),s(We)}},B=$e=>{$e.button===2&&O($e==null?void 0:$e.target),$e.button===0&&(b.value=!0,N.value&&(C.value={x:$e.pageX,y:$e.pageY},x.value={x:$e.pageX,y:$e.pageY},X($e),H(),N.value.style.display="block",window.addEventListener("mousemove",F),window.addEventListener("mouseup",Z)))},F=qae($e=>{b.value&&(x.value={x:$e.pageX,y:$e.pageY},H())},16),Z=$e=>{$e.button===0&&(b.value=!1,N.value&&(H(),N.value.style.display="none",window.removeEventListener("mousemove",F),window.removeEventListener("mouseup",Z)))},K=Y6e(),X=$e=>{var We,ft;let te=[];if($e.button===0&&($e!=null&&$e.target)){const lt=((We=$e==null?void 0:$e.target)==null?void 0:We.closest(".node-item-td"))||((ft=$e==null?void 0:$e.target)==null?void 0:ft.closest(".node-item"));if(lt!==null){const Ne=lt.getAttribute("id");if(Ne&&h.value){const ue=h.value.find(Pt=>Pt.id===Ne);ue&&(K.value?o.value.some(Pt=>VA(Pt)===VA(ue))?te=o.value.filter(ye=>VA(ye)!==VA(ue)):te=[...o.value,ue]:ue&&(te=[ue]))}}te=W(te),s(te)}},q=()=>{if(!i.value||!(_.value.width>3||_.value.height>3))return;let $e=[];const te={left:_.value.left,right:_.value.left+_.value.width,top:_.value.top,bottom:_.value.top+_.value.height};if(i.value.querySelectorAll("*").forEach(ft=>{const lt=ft.getBoundingClientRect(),Ne=window.scrollX||window.pageXOffset,ue=window.scrollY||window.pageYOffset,Pt={left:lt.left+Ne,right:lt.right+Ne,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=ft.getAttribute("id");if(ye&&h.value){const De=h.value.find(R=>R.id===ye);De&&($e=[...$e,De])}}}),$e=W($e),K.value){const ft=new Set(o.value.map(Ne=>VA(Ne))),lt=$e.filter(Ne=>!ft.has(VA(Ne)));s([...o.value,...lt])}else s($e)},W=$e=>{var We;let te=[];if($e.length>0){const ft=(We=$e.map(ye=>ye==null?void 0:ye.groupKey))==null?void 0:We.filter(Boolean),lt=new Set(ft),Ne=Array.from(lt),ue=h.value.filter(ye=>Ne.includes(ye.groupKey));te=[...$e,...ue],te=[...Cxe(te.filter(ye=>ye==null?void 0:ye.id),"id")||[],...te.filter(ye=>!ye.id)]}if(u&&u.value&&u.value.length>0){const ft=new Set(u.value.map(lt=>lt.id).filter(Boolean));te=te.filter(lt=>lt.id?!ft.has(lt.id):!0)}return te},H=qae(()=>{if(!N.value)return;const{x:$e,y:te}=C.value,{x:We,y:ft}=x.value,lt=Math.min($e,We),Ne=Math.min(te,ft),ue=Math.abs($e-We),Pt=Math.abs(te-ft);_.value={left:lt,top:Ne,width:ue,height:Pt}},16),me=$e=>{if(!N.value)return;const{left:te,top:We,width:ft,height:lt}=f.toValue($e);N.value.style.left=`${te}px`,N.value.style.top=`${We}px`,N.value.style.width=`${ft}px`,N.value.style.height=`${lt}px`},et=()=>{if(!i.value)return;i.value.addEventListener("mousedown",B);const $e=document.getElementById(`select_area_${m}`);if($e){N.value=$e;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(_,($e,te)=>{di($e,te)||(me($e),b.value&&q())},{deep:!0}),f.watch(()=>i.value,$e=>{f.toValue($e)&&et()},{immediate:!0}),f.onUnmounted(()=>{i.value&&i.value.removeEventListener("mousedown",B)}),{isSelecting:b,selectionBox:N}}function bfe(){const{selectedNodes:o,containerRef:s}=Pf(),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 ud=[];for(let o=0;o<256;++o)ud.push((o+256).toString(16).slice(1));function K6e(o,s=0){return(ud[o[s+0]]+ud[o[s+1]]+ud[o[s+2]]+ud[o[s+3]]+"-"+ud[o[s+4]]+ud[o[s+5]]+"-"+ud[o[s+6]]+ud[o[s+7]]+"-"+ud[o[s+8]]+ud[o[s+9]]+"-"+ud[o[s+10]]+ud[o[s+11]]+ud[o[s+12]]+ud[o[s+13]]+ud[o[s+14]]+ud[o[s+15]]).toLowerCase()}let rte;const X6e=new Uint8Array(16);function J6e(){if(!rte){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");rte=crypto.getRandomValues.bind(crypto)}return rte(X6e)}const Q6e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qie={randomUUID:Q6e};function yE(o,s,i){var m;if(qie.randomUUID&&!s&&!o)return qie.randomUUID();o=o||{};const u=o.random??((m=o.rng)==null?void 0:m.call(o))??J6e();if(u.length<16)throw new Error("Random bytes length must be >= 16");return u[6]=u[6]&15|64,u[8]=u[8]&63|128,K6e(u)}const SU=()=>{const{nodes:o,updateNodes:s}=j0();return{nodes:o,addNode:C=>{const _=(Array.isArray(C)?C:[C]).map(O=>({...O,id:O.id||yE()})),N=[...o.value,..._];s(N)},removeNode:C=>{const x=Array.isArray(C)?C:[C],_=[],N=[];x.forEach(B=>{const F=o.value.find(Z=>(Z==null?void 0:Z.id)===B);xoe(F)?_.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];let _=yE();const N=x.map(B=>{let F={...B},Z=B==null?void 0:B.id;return Z||(Z=yE(),F.id=Z),F!=null&&F.groupKey||(F.groupKey=_),F}),O=[...o.value];N.forEach(B=>{const F=O.findIndex(Z=>Z.id===B.id);F!==-1?O[F]=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 eMe(){const{removeNode:o}=SU(),{containerRef:s}=Pf(),i=m=>{var Z,K;if(m.target instanceof Element&&m.target.classList.contains("node-item"))return;const h=m.target;if(h===s.value)return;const C=((Z=s.value)==null?void 0:Z.getRootNode()).getSelection(),x=(K=s.value)==null?void 0:K.querySelectorAll('[contenteditable="true"]');x==null||x.forEach(X=>{X.setAttribute("contenteditable","false")});const _=h.textContent||"",N=h.innerHTML||"";h.setAttribute("contenteditable","true"),h.focus();const O=new MutationObserver(()=>{h.textContent!==_&&(h.innerHTML=N)});O.observe(h,{characterData:!0,childList:!0,subtree:!0});const B=X=>{X.preventDefault()};h.addEventListener("input",B),h.addEventListener("paste",B),h.addEventListener("drop",B),h.addEventListener("keydown",X=>{var q,W,H,me;if(((q=document.activeElement)==null?void 0:q.shadowRoot)===((W=s.value)==null?void 0:W.getRootNode())&&!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(X.key)){if(X.key==="Backspace"||X.key==="Delete"){const et=C==null?void 0:C.getRangeAt(0);if(h.blur(),(et==null?void 0:et.startOffset)===0){const $e=et.startContainer;if($e.nodeType===Node.TEXT_NODE){const te=$e.previousSibling;if(te&&te.nodeType===Node.ELEMENT_NODE&&te.classList.contains("node-item")){const We=te.getAttribute("id");We&&o(We),(H=$e.parentElement)==null||H.normalize();return}}else if($e.nodeType===Node.ELEMENT_NODE){const te=$e.previousSibling;if(te&&te.nodeType===Node.ELEMENT_NODE&&te.classList.contains("node-item")){const We=te.getAttribute("id");We&&o(We),(me=$e.parentElement)==null||me.normalize();return}}}}X.preventDefault()}});const F=()=>{O.disconnect(),h.removeEventListener("input",B),h.removeEventListener("paste",B),h.removeEventListener("drop",B),h.removeEventListener("blur",F),h.setAttribute("contenteditable","false")};h.addEventListener("blur",F)},u=()=>{var m;(m=s.value)==null||m.addEventListener("dblclick",i)};return f.watch(s,m=>{m&&u()},{immediate:!0}),f.onUnmounted(()=>{var m;(m=s.value)==null||m.removeEventListener("dblclick",i)}),{}}function tMe(){const{containerRef:o,focusedElement:s,cursorPosition:i,focusedNodeIndex:u,preNodeNumber:m}=Pf(),h=_=>{var O,B;const N=_==null?void 0:_.getSelection();try{if((O=s.value)==null||O.normalize(),N){const F=N.getRangeAt(0);u.value=P6e(F.startContainer);const Z=F.startOffset,K=(B=s.value)==null?void 0:B.querySelectorAll(".node-item");let X=0;return m.value=0,K==null||K.forEach(q=>{const W=document.createRange();if(W.selectNode(q),W.comparePoint(F.startContainer,Z)>=0){m.value+=1;const H=q.getAttribute("data-startOffset");Number(H)>X&&(X=Number(H))}}),X+Z}}catch{}return 0},b=()=>{var N;const _=(N=o.value)==null?void 0:N.getRootNode();i.value=h(_)},C=_=>{var F;const N=_.target;if(N===o.value)return;s.value=N;const O=(F=o.value)==null?void 0:F.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 nMe(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,uE(_=>{_&&!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 oMe(){const{modelValue:o,inputTypes:s}=j0(),{nodes:i,addNode:u}=SU(),m=C=>{if(!C||typeof C!="string")return[];const _=new DOMParser().parseFromString(C,"text/html");return Array.from(_.querySelectorAll("td")).filter(B=>{var F;return!((F=B.textContent)!=null&&F.trim())})},h=(C,x)=>{const _=x.map(O=>O.nodePath);return C==null?void 0:C.map(O=>({nodePath:Coe(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 sMe(){const{selectedNodes:o,containerRef:s}=Pf(),{removeNode:i}=SU(),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,F;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=(F=N==null?void 0:N.element)==null?void 0:F.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 xU(){const{nodes:o}=j0(),{containerRef:s,renderNodes:i,uiReady:u}=Pf(),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 cne=f.ref({});function EU(o){return f.computed(()=>{var s;return(s=cne.value)==null?void 0:s[o]})}function yfe(){const o=j0(),s=Pf();f.onMounted(()=>{const{editorId:i}=o;i&&(cne.value[i]=f.ref({...o,...s}))}),f.onUnmounted(()=>{const{editorId:i}=o;i&&(cne.value[i]=null)})}const rMe=f.defineComponent({__name:"NodesEditUI",setup(o){const{nodes:s}=j0(),{uiReady:i,renderNodes:u}=Pf();return yfe(),nMe(s),vfe(),bfe(),sMe(),tMe(),eMe(),oMe(),xU(),(m,h)=>f.unref(i)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(u),b=>(f.openBlock(),f.createBlock(CU,{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)}}),Yie=f.defineComponent({__name:"NodesPreviewUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=Pf();return xU(),(u,m)=>f.unref(s)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(i),h=>(f.openBlock(),f.createBlock(CU,{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)}}),aMe=f.defineComponent({__name:"NodesEnterUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=Pf();return xU(),(u,m)=>f.unref(s)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(i),h=>(f.openBlock(),f.createBlock(CU,{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)}}),iMe=f.defineComponent({__name:"NodesSelectUI",props:{pagesize:{type:String,default:"A4"},renderType:{type:String,default:"enter"}},setup(o){const{uiReady:s,renderNodes:i}=Pf();return yfe(),vfe(),bfe(),xU(),(u,m)=>f.unref(s)?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(f.unref(i),h=>(f.openBlock(),f.createBlock(CU,{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)}}),lMe=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(hfe,{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")}}),c2=f.ref({});function cMe(o){return f.computed(()=>(c2.value[o]||(c2.value[o]=f.ref([])),c2.value[o]))}function uMe(o){const{editorId:s}=o,i=f.ref(!1);f.onMounted(()=>{c2.value[s]||(c2.value[s]=f.ref([]));const u=c2.value[s].findIndex(m=>m.id===o.id);u!==-1&&c2.value[s].splice(u,1),i.value=!0,c2.value[s].push({...o,isMounted:i})}),f.onUnmounted(()=>{i.value=!1})}const dMe=f.defineComponent({__name:"NodesUIProvider",props:{nodes:{type:Array,default:()=>[]},selectedNodes:{type:Array,default:()=>[]},nodesGroups:{type:Array,default:()=>[]},editorId:{type:String,default:""}},emits:["onSelectedNodes","update:selectedNodes"],setup(o,{expose:s,emit:i}){const u=o,m=i,h=f.computed({get:()=>(u.selectedNodes||[]).map(q=>{var me;let W=(me=u==null?void 0:u.nodes)==null?void 0:me.find(et=>(et==null?void 0:et.id)===(q==null?void 0:q.id)),H=q!=null&&q.element?q==null?void 0:q.element:R6e(q==null?void 0:q.id,b.value);return{...W||{},...q,element:H}}),set:q=>{const W=q.map(({element:H,...me})=>{var $e;return{...(($e=u==null?void 0:u.nodes)==null?void 0:$e.find(te=>(te==null?void 0:te.id)===(me==null?void 0:me.id)))||{},...me}});m("update:selectedNodes",W)}}),b=f.ref(null),C=f.ref([]),x=f.ref(null),_=f.ref(-1),N=f.ref(0),O=f.ref(0),B=cMe(u==null?void 0:u.editorId),F=f.ref(!1),Z=f.computed(()=>{var W,H;const q=((H=(W=f.toValue(B))==null?void 0:W.filter(me=>!f.toValue(me==null?void 0:me.activated)))==null?void 0:H.filter(me=>f.toValue(me.isMounted)))||[];return L6e([...(u==null?void 0:u.nodesGroups)||[],...q])}),K=f.ref([]),X=q=>{const W=q.map(({element:H,...me})=>{var $e;return{...(($e=C.value)==null?void 0:$e.find(te=>(te==null?void 0:te.id)===(me==null?void 0:me.id)))||{},...me}});di(W,h.value)||(h.value=q,m("onSelectedNodes",W))};return s({setSelectedNodes:X}),f.provide(mfe,{containerRef:b,focusedElement:x,currentRenderNodes:K,cursorPosition:_,focusedNodeIndex:N,preNodeNumber:O,currentNodes:Z,selectedNodes:h,setSelectedNodes:X,renderNodes:C,uiReady:F,nodesGroups:u==null?void 0:u.nodesGroups}),(q,W)=>f.renderSlot(q.$slots,"default")}}),fMe=["onClick"],mMe={key:0,class:"icon"},pMe={key:1,class:"arrow"},gMe={key:0,class:"submenu"},hMe=["onClick"],vMe={key:0,class:"icon"},bMe=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}=Pf(),{inputTypes:x}=j0(),_=f.useModel(o,"show"),{editNodes:N}=SU(),O=K=>{var q;const X=((q=K==null?void 0:K.getDefaultProps)==null?void 0:q.call(K))||{};if(f.toValue(m)&&!ixe(f.toValue(h))){const W=Coe(f.toValue(m)),H=f.toValue(h),me=(f.toValue(C)||0)+1,et=F6e(f.toValue(m));W&&H&&H>=0&&N({...et,label:K==null?void 0:K.label,nodePath:W,startOffset:H,subNodeSort:me,textNodeIndex:f.toValue(b)||0,nodeType:K==null?void 0:K.value,props:X})}else if(i){const W=f.toValue(i);if(W!=null&&W.length){const H=W==null?void 0:W.map(me=>({...me,label:K==null?void 0:K.label,element:me==null?void 0:me.element,nodePath:me==null?void 0:me.nodePath,nodeType:K==null?void 0:K.value,props:X}));N(H),u(H)}}_.value=!1},B=f.computed(()=>{const K=[],X=[];return f.toValue(x).forEach(q=>{q.groupName==="system"?X.push({...q,handler:()=>{O(q)}}):K.push({...q,handler:()=>{O(q)}})}),[{label:"限定填写内容",icon:"i-bi:lock",children:K},{label:"插入记录标识",icon:"i-bi:flag",children:X}].filter(q=>{var W;return(W=q==null?void 0:q.children)==null?void 0:W.length})}),F=s,Z=(K,X)=>{K.preventDefault(),X!=null&&X.handler&&X.handler(),X!=null&&X.value&&F("select",X==null?void 0:X.value)};return(K,X)=>f.withDirectives((f.openBlock(),f.createElementBlock("div",{class:"context-menu",style:f.normalizeStyle({...K.style})},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(B.value,q=>(f.openBlock(),f.createElementBlock("div",{key:q==null?void 0:q.label,class:"menu-item"},[f.createElementVNode("div",{class:"menu-item-content",onClick:W=>Z(W,q)},[q!=null&&q.icon?(f.openBlock(),f.createElementBlock("div",mMe,[f.createElementVNode("div",{class:f.normalizeClass(q==null?void 0:q.icon)},null,2)])):f.createCommentVNode("",!0),f.createTextVNode(" "+f.toDisplayString(q.label)+" ",1),q!=null&&q.children?(f.openBlock(),f.createElementBlock("span",pMe,"›")):f.createCommentVNode("",!0)],8,fMe),q!=null&&q.children?(f.openBlock(),f.createElementBlock("div",gMe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(q.children,W=>(f.openBlock(),f.createElementBlock("div",{key:W.action,class:"menu-item",onClick:H=>Z(H,W)},[W!=null&&W.icon?(f.openBlock(),f.createElementBlock("div",vMe,[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,hMe))),128))])):f.createCommentVNode("",!0)]))),128))],4)),[[f.vShow,_.value]])}}),yMe=$i(bMe,[["__scopeId","data-v-16c69bc2"]]);function wMe(){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 wfe(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 une=wfe(),Cfe=(...o)=>{const s=o[0],i=o[1];f.onMounted(()=>{une.on(s,i)}),f.onBeforeUnmount(()=>{une.off(s)})},Eoe=()=>(...s)=>{une.emit(...s)};let O0=null;function CMe(o){const{onSelected:s}=o,{selectedNodes:i,setSelectedNodes:u}=Pf();return f.watch(()=>i,()=>{O0==null||O0({data:i.value}),s==null||s(f.toValue(i))},{deep:!0}),Cfe("selectNodes",h=>{const{data:b,callback:C=null,mode:x="multiple"}=h;setTimeout(()=>{u(f.toValue(b)),O0=C},100)}),{onBlur:()=>{O0&&(O0==null||O0({data:i.value,type:"blur"}),O0=null,u([]))}}}const SMe={class:"relative"},xMe=f.defineComponent({__name:"index",props:{hasContextMenu:{type:Boolean,default:!1}},setup(o){const{containerRef:s,uiReady:i}=Pf(),{nodes:u,modelValue:m}=j0(),h=o,{showContextMenu:b,contextMenuStyle:C,onContextMenu:x}=wMe(),_=f.ref(null),N=Z=>{let K=null;if(xoe(Z))K=pfe(Z.nodePath,f.toValue(s)),K&&(K.classList.add("node-item-td"),W6e(K));else{const X=document.createElement("span");X.setAttribute("contenteditable","false"),X.classList.add("node-item"),K=X,B6e(Z,K,s.value)}return K&&I6e(K,Z),K},O=()=>{const Z=pxe(u.value,[K=>K.nodePath,K=>K.textNodeIndex,K=>K.startOffset??-1,K=>K.subNodeSort],["asc","desc","desc","desc"]);Z==null||Z.forEach(K=>{N(K)})};f.watch(()=>[u,m,_],()=>{_.value&&(i.value=!1,f.nextTick(()=>{_.value&&(_.value.innerHTML=m,O(),i.value=!0)}))},{deep:!0,immediate:!0});const B=f.ref(),{onBlur:F}=CMe({onSelected:()=>{var Z;(Z=B.value)==null||Z.focus()}});return(Z,K)=>(f.openBlock(),f.createElementBlock("div",SMe,[f.createVNode(woe,{onOnBlur:f.unref(F),ref_key:"shadowDomRef",ref:B},{default:f.withCtx(()=>[f.createElementVNode("html",{class:"nodes-editor",ref_key:"containerRef",ref:s,onContextmenu:K[0]||(K[0]=f.withModifiers((...X)=>f.unref(x)&&f.unref(x)(...X),["prevent"]))},[f.createElementVNode("body",{ref_key:"bodyRef",ref:_},null,512)],544)]),_:1},8,["onOnBlur"]),h!=null&&h.hasContextMenu?(f.openBlock(),f.createBlock(yMe,{key:0,show:f.unref(b),"onUpdate:show":K[1]||(K[1]=X=>f.isRef(b)?b.value=X:null),style:f.normalizeStyle(f.unref(C))},null,8,["show","style"])):f.createCommentVNode("",!0)]))}}),Kie={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}},EMe={class:"pagesize"},_Me=f.defineComponent({__name:"index",props:{pagesize:{type:String,default:"A4"}},setup(o){const s=o,i=f.computed(()=>{const u=Kie[s.pagesize]||Kie.A4,m=(window.devicePixelRatio||1)*96;return u.width*m/25.4});return(u,m)=>(f.openBlock(),f.createElementBlock("div",EMe,[f.createElementVNode("div",{style:f.normalizeStyle({width:`${i.value}px`}),class:"pagesize-content"},[f.renderSlot(u.$slots,"default",{},void 0,!0)],4)]))}}),kMe=$i(_Me,[["__scopeId","data-v-46808dfa"]]),Sfe=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(),x=f.computed(()=>{switch(u.renderType){case"edit":return rMe;case"select":return iMe;case"preview":return Yie;case"enter":return aMe;default:return Yie}}),_=B=>{m("update:nodes",B)},N=B=>{m("update:formData",B)},O=B=>{m("onSelectedNodes",B)};return s({formRef:{validate:()=>{var B,F,Z;return(Z=(F=(B=b.value)==null?void 0:B.formRef)==null?void 0:F.validate)==null?void 0:Z.call(F)}},setSelectedNodes:B=>{var F,Z;(Z=(F=C.value)==null?void 0:F.setSelectedNodes)==null||Z.call(F,B)}}),(B,F)=>(f.openBlock(),f.createBlock(kMe,{pagesize:o.pagesize},{default:f.withCtx(()=>[f.createVNode(dMe,{ref_key:"UIRef",ref:C,nodes:o.nodes,"onUpdate:nodes":_,selectedNodes:h.value,"onUpdate:selectedNodes":F[0]||(F[0]=Z=>h.value=Z),onOnSelectedNodes:O,nodesGroups:o.nodesGroups,editorId:u==null?void 0:u.id},{default:f.withCtx(()=>[f.createVNode(lMe,{renderType:o.renderType,"model-value":o.modelValue,nodes:o.nodes,"onUpdate:nodes":_,formData:o.formData,"onUpdate:formData":N,inputTypes:o.inputTypes,editorId:u==null?void 0:u.id},{default:f.withCtx(()=>[f.createVNode(xMe,{hasContextMenu:o.renderType==="edit"},null,8,["hasContextMenu"]),(f.openBlock(),f.createBlock(f.resolveDynamicComponent(x.value),{renderType:o.renderType,pagesize:o.pagesize,ref_key:"contentRef",ref:b},{nodeItem:f.withCtx(Z=>[f.renderSlot(B.$slots,"nodeItem",{node:Z==null?void 0:Z.node})]),_:3},8,["renderType","pagesize"]))]),_:3},8,["renderType","model-value","nodes","formData","inputTypes","editorId"])]),_:3},8,["nodes","selectedNodes","nodesGroups","editorId"])]),_:3},8,["pagesize"]))}}),TMe={class:"nodes-text"},AMe={key:0,class:"node-text-input"},NMe={key:1,class:"node-text-td"},OMe={key:0,class:"node-text-table-index"},$Me=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=EU(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 gfe(i.value,((b=f.toValue(u))==null?void 0:b.renderNodes)||[])});return(b,C)=>(f.openBlock(),f.createElementBlock("div",TMe,[(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",AMe," 填写"+f.toDisplayString(x==null?void 0:x.inputIndex),1)):(f.openBlock(),f.createElementBlock("span",NMe,[m.value?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("span",OMe,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))]))}}),Xie=$i($Me,[["__scopeId","data-v-67e3a210"]]);function DMe(o){const{nodes:s,mode:i="multiple"}=o,u=f.ref(!1),m=Eoe();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"],_H=f.ref(0),eE=new Map,MMe={key:0,class:"node-select-small gap-x-2"},RMe={key:1,class:"text-[#999]"},BMe={key:1,class:"node-select"},IMe={class:"flex py-2 px-2 justify-between items-center noder-select-header"},PMe={class:"flex gap-2"},FMe={class:"flex gap-1"},LMe=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:"点击选择"}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=f.ref((eE==null?void 0:eE[s==null?void 0:s.id])||0),u=f.ref((s==null?void 0:s.id)||yE()),m=f.useModel(o,"modelValue"),{selectNodes:h,isSelecting:b}=DMe({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(()=>{lxe(eE==null?void 0:eE[s==null?void 0:s.id])&&(s!=null&&s.id)&&(eE[s==null?void 0:s.id]=_H.value,i.value=_H.value,_H.value=_H.value+1)}),uMe({id:u.value,editorId:s.editorId,nodes:m,activated:b,color:x}),(_,N)=>{var O;return s.size==="small"?(f.openBlock(),f.createElementBlock("div",MMe,[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(Xie,{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",RMe,"未设置"))])])):(f.openBlock(),f.createElementBlock("div",BMe,[f.createElementVNode("div",IMe,[f.createElementVNode("div",PMe,[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",FMe,[N[8]||(N[8]=f.createElementVNode("div",{class:"color-[#999]"},"Ctrl+左键多选",-1)),f.createElementVNode("div",null,[f.createVNode(f.unref(Nn.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(Xie,{modelValue:m.value,"onUpdate:modelValue":N[4]||(N[4]=B=>m.value=B),editorId:o.editorId},null,8,["modelValue","editorId"])])]))}}}),xfe=$i(LMe,[["__scopeId","data-v-4ab41798"]]);function VMe(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 HMe(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 zMe(o){const s=EU(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 F=O;F<=B;F++)for(let Z=_;Z<=N;Z++)x.push({colIndex:Z,rowIndex:F});return x},u=b=>{var N;const C=b.includes(":");let x=[];if(C){const[O,B]=b.split(":").map(F=>h(F));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 F=B.match(/tr(?::nth-child\((\d+)\))?/);F&&F[1]&&(N=parseInt(F[1]))}else if(B.startsWith("td")){const F=B.match(/td(?::nth-child\((\d+)\))?/);F&&(O=F[1]?parseInt(F[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 Jie=["#0288D1","#D32F2F","#F57C00","#388E3C","#303F9F","#7B1FA2","#C2185B","#880E4F","#689F38","#5D4037"];function UMe(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 F=B.getRangeAt(0),Z=((x=F.startContainer)==null?void 0:x.nodeName)==="#text"?F.startContainer:(N=(_=F.startContainer)==null?void 0:_.childNodes)==null?void 0:N[0],K=Math.min(C,((O=Z.textContent)==null?void 0:O.length)||0);F.setStart(Z,K)}}};return f.watch(()=>[s,o],()=>{var C;o.value&&(di((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 _oe(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 jMe(o){const{element:s,showStr:i,editorId:u}=o,m=EU(u),h=_oe({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,F;const C=Z=>{var K;Z.preventDefault(),(K=f.toValue(s))==null||K.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),(F=document.querySelectorAll(".select-function"))==null||F.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(F=>{var Z;B=[...B,...((Z=F==null?void 0:F.cellValue)==null?void 0:Z.map(K=>({color:F==null?void 0:F.color,backgroundColor:Soe((F==null?void 0:F.color)||"#000",.1),element:K==null?void 0:K.element})))||[]]}),B.forEach(F=>{var Z;F!=null&&F.element&&((Z=F==null?void 0:F.element)==null||Z.classList.add("node-formula-cell"),F==null||F.element.style.setProperty("--formula-node-color",F==null?void 0:F.color),F==null||F.element.style.setProperty("--formula-node-bg-color",F==null?void 0:F.backgroundColor))}))}},{deep:!0}),h}const WMe=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 ZMe(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 GMe=(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},qMe=o=>{const{startOffset:s,showStr:i,value:u,editorId:m,currentItemIndex:h,currentItem:b,element:C}=o,x=EU(m),_=f.ref(-1),N=f.ref(0),O=_oe({element:C}),B=f.ref(!1),F=Eoe(),Z=K=>{var X,q;if(f.toValue(B)&&f.toValue(O)&&!di((X=f.toValue(b))==null?void 0:X.cellValue,K)){const W=j6e(K,((q=f.toValue(x))==null?void 0:q.nodes)||"");let H=W;W&&(f.toValue(N)===0&&(H+=","),f.toValue(_)>=0&&(u.value=ZMe(f.toValue(u),f.toValue(_),f.toValue(N),H),N.value=W.length))}};f.watch(()=>h,()=>{var K,X,q,W,H,me;if((K=x.value)==null||K.setSelectedNodes([]),["range","cell"].includes((X=f.toValue(b))==null?void 0:X.type))return _.value=GMe(i.value,h.value),N.value=(W=(q=f.toValue(b))==null?void 0:q.value)==null?void 0:W.length,B.value=!0,F("selectNodes",{data:(H=f.toValue(b))==null?void 0:H.cellValue,mode:"multiple",callback:({data:et})=>{Z(et)}}),!1;if([",","(","="].includes((me=f.toValue(b))==null?void 0:me.value))return _.value=f.toValue(s),B.value=!0,N.value=0,F("selectNodes",{data:[],mode:"multiple",callback:({data:et})=>{Z(et)}}),!1;B.value=!1,_.value=-1},{immediate:!0,deep:!0})},YMe=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 KMe(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 XMe=(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},JMe=o=>{const{startOffset:s,showStr:i,value:u,currentItemIndex:m,currentItem:h,element:b}=o,C=f.ref(-1),x=f.ref(0),_=_oe({element:b}),N=f.ref(!1),O=Eoe(),B=F=>{var Z;if(f.toValue(N)&&f.toValue(_)&&!di((Z=f.toValue(h))==null?void 0:Z.value,F)){const K=F,X=K;K&&f.toValue(C)>=0&&(u.value=KMe(f.toValue(u),f.toValue(C),f.toValue(x),X),x.value=K.length)}};f.watch(()=>m,()=>{var F,Z,K,X,q;if(["function"].includes((F=f.toValue(h))==null?void 0:F.type))return C.value=XMe(i.value,m.value),x.value=(K=(Z=f.toValue(h))==null?void 0:Z.value)==null?void 0:K.length,N.value=!0,O("selectFunction",{data:(X=f.toValue(h))==null?void 0:X.value,callback:({data:W})=>{console.log(W),B(W)}}),!1;if([",","(","="].includes((q=f.toValue(h))==null?void 0:q.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})},QMe={class:"node-formula"},eRe={class:"node-formula-show"},tRe=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}=zMe({editorId:s==null?void 0:s.editorId}),u=f.useModel(o,"modelValue"),m=f.ref(),{startOffset:h}=WMe({element:m});UMe(m,u,h);const b=f.computed(()=>{const N=VMe(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=HMe(u.value,b.value);let O=-1;return N.map(F=>(F==null?void 0:F.type)==="cell"||(F==null?void 0:F.type)==="range"?(O++,{...F,color:Jie[O%Jie.length]}):(F==null?void 0:F.type)==="function"?{...F,color:"#0318ff"}:F)});jMe({element:m,showStr:C,editorId:s==null?void 0:s.editorId});const{currentItemIndex:x,currentItem:_}=YMe({element:m,startOffset:h,value:u,showStr:C});return qMe({element:m,startOffset:h,showStr:C,editorId:s==null?void 0:s.editorId,value:u,currentItemIndex:x,currentItem:_}),JMe({element:m,startOffset:h,showStr:C,value:u,currentItemIndex:x,currentItem:_}),(N,O)=>(f.openBlock(),f.createElementBlock("div",QMe,[f.createElementVNode("div",{contenteditable:"true",ref_key:"formulaRef",ref:m,class:"node-formula-input"},null,512),f.createElementVNode("div",eRe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(C.value,(B,F)=>(f.openBlock(),f.createElementBlock("span",{key:F,class:f.normalizeClass(["node-formula-item",`node-formula-item-type-${B==null?void 0:B.type}`,F===f.unref(x)?"node-formula-item-active":""]),style:f.normalizeStyle({"--text-color":(B==null?void 0:B.color)||"#000","--bg-color":f.unref(Soe)((B==null?void 0:B.color)||"#000",.1)})},f.toDisplayString(B.value),7))),128))])]))}}),Efe=$i(tRe,[["__scopeId","data-v-f4b96eb4"]]),nRe=[{label:"平均值",value:"AVERAGE"},{label:"均值绝对偏差",value:"AVEDEV"},{label:"求和",value:"SUM"},{label:"条件判断",value:"IF"},{label:"统计数量",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"正平方根",value:"SQRT"}],oRe={class:"select-function"},sRe=["onClick"],rRe={class:"function-item"},aRe={class:"function-item-desc"},iRe=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:nRe}),m=f.useModel(o,"modelValue"),h=b=>{m.value=b,i==null||i({data:b})};return Cfe("selectFunction",({data:b,callback:C})=>{i=C,m.value=b}),(b,C)=>(f.openBlock(),f.createElementBlock("div",oRe,[(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",rRe,f.toDisplayString(x.value),1),f.createElementVNode("div",aRe,f.toDisplayString(x.label),1)],10,sRe)]))),128))]))}}),_fe=$i(iRe,[["__scopeId","data-v-6e079ff0"]]),lRe=["innerHTML"],kfe=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(woe,null,{default:f.withCtx(()=>[f.createElementVNode("div",{innerHTML:s.value},null,8,lRe)]),_:1}))}});function _U(o){return f.getCurrentScope()?(f.onScopeDispose(o),!0):!1}function R0(o){return typeof o=="function"?o():f.unref(o)}const cRe=typeof window<"u"&&typeof document<"u",uRe=o=>typeof o<"u",dRe=Object.prototype.toString,fRe=o=>dRe.call(o)==="[object Object]",mRe=()=>{};function pRe(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 Tfe=o=>o();function gRe(o=Tfe){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 Qie(o,s=!1,i="Timeout"){return new Promise((u,m)=>{setTimeout(s?()=>m(i):u,o)})}function hRe(o,s,i={}){const{eventFilter:u=Tfe,...m}=i;return f.watch(o,pRe(u,s),m)}function zA(o,s,i={}){const{eventFilter:u,...m}=i,{eventFilter:h,pause:b,resume:C,isActive:x}=gRe(u);return{stop:hRe(o,s,{...m,eventFilter:h}),pause:b,resume:C,isActive:x}}function vRe(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=R0(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 dne(o,s=!1){function i(O,{flush:B="sync",deep:F=!1,timeout:Z,throwOnTimeout:K}={}){let X=null;const W=[new Promise(H=>{X=f.watch(o,me=>{O(me)!==s&&(X==null||X(),H(me))},{flush:B,deep:F,immediate:!0})})];return Z!=null&&W.push(Qie(Z,K).then(()=>R0(o)).finally(()=>X==null?void 0:X())),Promise.race(W)}function u(O,B){if(!f.isRef(O))return i(me=>me===O,B);const{flush:F="sync",deep:Z=!1,timeout:K,throwOnTimeout:X}=B??{};let q=null;const H=[new Promise(me=>{q=f.watch([o,O],([et,$e])=>{s!==(et===$e)&&(q==null||q(),me(et))},{flush:F,deep:Z,immediate:!0})})];return K!=null&&H.push(Qie(K,X).then(()=>R0(o)).finally(()=>(q==null||q(),R0(o)))),Promise.race(H)}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(F=>{const Z=Array.from(F);return Z.includes(O)||Z.includes(R0(O))},B)}function _(O){return N(1,O)}function N(O=1,B){let F=-1;return i(()=>(F+=1,F>=O),B)}return Array.isArray(R0(o))?{toMatch:i,toContains:x,changed:_,changedTimes:N,get not(){return dne(o,!s)}}:{toMatch:i,toBe:u,toBeTruthy:m,toBeNull:h,toBeNaN:C,toBeUndefined:b,changed:_,changedTimes:N,get not(){return dne(o,!s)}}}function fne(o){return dne(o)}function bRe(o){var s;const i=R0(o);return(s=i==null?void 0:i.$el)!=null?s:i}const Afe=cRe?window:void 0;function Nfe(...o){let s,i,u,m;if(typeof o[0]=="string"||Array.isArray(o[0])?([i,u,m]=o,s=Afe):[s,i,u,m]=o,!s)return mRe;Array.isArray(i)||(i=[i]),Array.isArray(u)||(u=[u]);const h=[],b=()=>{h.forEach(N=>N()),h.length=0},C=(N,O,B,F)=>(N.addEventListener(O,B,F),()=>N.removeEventListener(O,B,F)),x=f.watch(()=>[bRe(s),R0(m)],([N,O])=>{if(b(),!N)return;const B=fRe(O)?{...O}:O;h.push(...i.flatMap(F=>u.map(Z=>C(N,F,Z,B))))},{immediate:!0,flush:"post"}),_=()=>{x(),b()};return _U(_),_}function yRe(o){return typeof o=="function"?o:typeof o=="string"?s=>s.key===o:Array.isArray(o)?s=>o.includes(s.key):()=>!0}function ele(...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=Afe,eventName:h="keydown",passive:b=!1,dedupe:C=!1}=u,x=yRe(s);return Nfe(m,h,N=>{N.repeat&&R0(C)||x(N)&&i(N)},b)}function wRe(o){return JSON.parse(JSON.stringify(o))}function ate(o,s,i,u={}){var m,h,b;const{clone:C=!1,passive:x=!1,eventName:_,deep:N=!1,defaultValue:O,shouldEmit:B}=u,F=f.getCurrentInstance(),Z=i||(F==null?void 0:F.emit)||((m=F==null?void 0:F.$emit)==null?void 0:m.bind(F))||((b=(h=F==null?void 0:F.proxy)==null?void 0:h.$emit)==null?void 0:b.bind(F==null?void 0:F.proxy));let K=_;s||(s="modelValue"),K=K||`update:${s.toString()}`;const X=H=>C?typeof C=="function"?C(H):wRe(H):H,q=()=>uRe(o[s])?X(o[s]):O,W=H=>{B?B(H)&&Z(K,H):Z(K,H)};if(x){const H=q(),me=f.ref(H);let et=!1;return f.watch(()=>o[s],$e=>{et||(et=!0,me.value=X($e),f.nextTick(()=>et=!1))}),f.watch(me,$e=>{!et&&($e!==o[s]||N)&&W($e)},{deep:N}),me}else return f.computed({get(){return q()},set(H){W(H)}})}var CRe={value:()=>{}};function kU(){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 KH(i)}function KH(o){this._=o}function SRe(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}})}KH.prototype=kU.prototype={constructor:KH,on:function(o,s){var i=this._,u=SRe(o+"",i),m,h=-1,b=u.length;if(arguments.length<2){for(;++h<b;)if((m=(o=u[h]).type)&&(m=xRe(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]=tle(i[m],o.name,s);else if(s==null)for(m in i)i[m]=tle(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 KH(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 xRe(o,s){for(var i=0,u=o.length,m;i<u;++i)if((m=o[i]).name===s)return m.value}function tle(o,s,i){for(var u=0,m=o.length;u<m;++u)if(o[u].name===s){o[u]=CRe,o=o.slice(0,u).concat(o.slice(u+1));break}return i!=null&&o.push({name:s,value:i}),o}var mne="http://www.w3.org/1999/xhtml";const nle={svg:"http://www.w3.org/2000/svg",xhtml:mne,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function TU(o){var s=o+="",i=s.indexOf(":");return i>=0&&(s=o.slice(0,i))!=="xmlns"&&(o=o.slice(i+1)),nle.hasOwnProperty(s)?{space:nle[s],local:o}:o}function ERe(o){return function(){var s=this.ownerDocument,i=this.namespaceURI;return i===mne&&s.documentElement.namespaceURI===mne?s.createElement(o):s.createElementNS(i,o)}}function _Re(o){return function(){return this.ownerDocument.createElementNS(o.space,o.local)}}function Ofe(o){var s=TU(o);return(s.local?_Re:ERe)(s)}function kRe(){}function koe(o){return o==null?kRe:function(){return this.querySelector(o)}}function TRe(o){typeof o!="function"&&(o=koe(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 Sp(u,this._parents)}function ARe(o){return o==null?[]:Array.isArray(o)?o:Array.from(o)}function NRe(){return[]}function $fe(o){return o==null?NRe:function(){return this.querySelectorAll(o)}}function ORe(o){return function(){return ARe(o.apply(this,arguments))}}function $Re(o){typeof o=="function"?o=ORe(o):o=$fe(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 Sp(u,m)}function Dfe(o){return function(){return this.matches(o)}}function Mfe(o){return function(s){return s.matches(o)}}var DRe=Array.prototype.find;function MRe(o){return function(){return DRe.call(this.children,o)}}function RRe(){return this.firstElementChild}function BRe(o){return this.select(o==null?RRe:MRe(typeof o=="function"?o:Mfe(o)))}var IRe=Array.prototype.filter;function PRe(){return Array.from(this.children)}function FRe(o){return function(){return IRe.call(this.children,o)}}function LRe(o){return this.selectAll(o==null?PRe:FRe(typeof o=="function"?o:Mfe(o)))}function VRe(o){typeof o!="function"&&(o=Dfe(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 Sp(u,this._parents)}function Rfe(o){return new Array(o.length)}function HRe(){return new Sp(this._enter||this._groups.map(Rfe),this._parents)}function Ez(o,s){this.ownerDocument=o.ownerDocument,this.namespaceURI=o.namespaceURI,this._next=null,this._parent=o,this.__data__=s}Ez.prototype={constructor:Ez,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 zRe(o){return function(){return o}}function URe(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 Ez(o,h[b]);for(;b<x;++b)(C=s[b])&&(m[b]=C)}function jRe(o,s,i,u,m,h,b){var C,x,_=new Map,N=s.length,O=h.length,B=new Array(N),F;for(C=0;C<N;++C)(x=s[C])&&(B[C]=F=b.call(x,x.__data__,C,s)+"",_.has(F)?m[C]=x:_.set(F,x));for(C=0;C<O;++C)F=b.call(o,h[C],C,h)+"",(x=_.get(F))?(u[C]=x,x.__data__=h[C],_.delete(F)):i[C]=new Ez(o,h[C]);for(C=0;C<N;++C)(x=s[C])&&_.get(B[C])===x&&(m[C]=x)}function WRe(o){return o.__data__}function ZRe(o,s){if(!arguments.length)return Array.from(this,WRe);var i=s?jRe:URe,u=this._parents,m=this._groups;typeof o!="function"&&(o=zRe(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,F=GRe(o.call(N,N&&N.__data__,_,u)),Z=F.length,K=C[_]=new Array(Z),X=b[_]=new Array(Z),q=x[_]=new Array(B);i(N,O,K,X,q,F,s);for(var W=0,H=0,me,et;W<Z;++W)if(me=K[W]){for(W>=H&&(H=W+1);!(et=X[H])&&++H<Z;);me._next=et||null}}return b=new Sp(b,u),b._enter=C,b._exit=x,b}function GRe(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function qRe(){return new Sp(this._exit||this._groups.map(Rfe),this._parents)}function YRe(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 KRe(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),F,Z=0;Z<O;++Z)(F=_[Z]||N[Z])&&(B[Z]=F);for(;x<m;++x)C[x]=i[x];return new Sp(C,this._parents)}function XRe(){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 JRe(o){o||(o=QRe);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 Sp(m,this._parents).order()}function QRe(o,s){return o<s?-1:o>s?1:o>=s?0:NaN}function eBe(){var o=arguments[0];return arguments[0]=this,o.apply(null,arguments),this}function tBe(){return Array.from(this)}function nBe(){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 oBe(){let o=0;for(const s of this)++o;return o}function sBe(){return!this.node()}function rBe(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 aBe(o){return function(){this.removeAttribute(o)}}function iBe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function lBe(o,s){return function(){this.setAttribute(o,s)}}function cBe(o,s){return function(){this.setAttributeNS(o.space,o.local,s)}}function uBe(o,s){return function(){var i=s.apply(this,arguments);i==null?this.removeAttribute(o):this.setAttribute(o,i)}}function dBe(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 fBe(o,s){var i=TU(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?iBe:aBe:typeof s=="function"?i.local?dBe:uBe:i.local?cBe:lBe)(i,s))}function Bfe(o){return o.ownerDocument&&o.ownerDocument.defaultView||o.document&&o||o.defaultView}function mBe(o){return function(){this.style.removeProperty(o)}}function pBe(o,s,i){return function(){this.style.setProperty(o,s,i)}}function gBe(o,s,i){return function(){var u=s.apply(this,arguments);u==null?this.style.removeProperty(o):this.style.setProperty(o,u,i)}}function hBe(o,s,i){return arguments.length>1?this.each((s==null?mBe:typeof s=="function"?gBe:pBe)(o,s,i??"")):f4(this.node(),o)}function f4(o,s){return o.style.getPropertyValue(s)||Bfe(o).getComputedStyle(o,null).getPropertyValue(s)}function vBe(o){return function(){delete this[o]}}function bBe(o,s){return function(){this[o]=s}}function yBe(o,s){return function(){var i=s.apply(this,arguments);i==null?delete this[o]:this[o]=i}}function wBe(o,s){return arguments.length>1?this.each((s==null?vBe:typeof s=="function"?yBe:bBe)(o,s)):this.node()[o]}function Ife(o){return o.trim().split(/^|\s+/)}function Toe(o){return o.classList||new Pfe(o)}function Pfe(o){this._node=o,this._names=Ife(o.getAttribute("class")||"")}Pfe.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 Ffe(o,s){for(var i=Toe(o),u=-1,m=s.length;++u<m;)i.add(s[u])}function Lfe(o,s){for(var i=Toe(o),u=-1,m=s.length;++u<m;)i.remove(s[u])}function CBe(o){return function(){Ffe(this,o)}}function SBe(o){return function(){Lfe(this,o)}}function xBe(o,s){return function(){(s.apply(this,arguments)?Ffe:Lfe)(this,o)}}function EBe(o,s){var i=Ife(o+"");if(arguments.length<2){for(var u=Toe(this.node()),m=-1,h=i.length;++m<h;)if(!u.contains(i[m]))return!1;return!0}return this.each((typeof s=="function"?xBe:s?CBe:SBe)(i,s))}function _Be(){this.textContent=""}function kBe(o){return function(){this.textContent=o}}function TBe(o){return function(){var s=o.apply(this,arguments);this.textContent=s??""}}function ABe(o){return arguments.length?this.each(o==null?_Be:(typeof o=="function"?TBe:kBe)(o)):this.node().textContent}function NBe(){this.innerHTML=""}function OBe(o){return function(){this.innerHTML=o}}function $Be(o){return function(){var s=o.apply(this,arguments);this.innerHTML=s??""}}function DBe(o){return arguments.length?this.each(o==null?NBe:(typeof o=="function"?$Be:OBe)(o)):this.node().innerHTML}function MBe(){this.nextSibling&&this.parentNode.appendChild(this)}function RBe(){return this.each(MBe)}function BBe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function IBe(){return this.each(BBe)}function PBe(o){var s=typeof o=="function"?o:Ofe(o);return this.select(function(){return this.appendChild(s.apply(this,arguments))})}function FBe(){return null}function LBe(o,s){var i=typeof o=="function"?o:Ofe(o),u=s==null?FBe:typeof s=="function"?s:koe(s);return this.select(function(){return this.insertBefore(i.apply(this,arguments),u.apply(this,arguments)||null)})}function VBe(){var o=this.parentNode;o&&o.removeChild(this)}function HBe(){return this.each(VBe)}function zBe(){var o=this.cloneNode(!1),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function UBe(){var o=this.cloneNode(!0),s=this.parentNode;return s?s.insertBefore(o,this.nextSibling):o}function jBe(o){return this.select(o?UBe:zBe)}function WBe(o){return arguments.length?this.property("__data__",o):this.node().__data__}function ZBe(o){return function(s){o.call(this,s,this.__data__)}}function GBe(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 qBe(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 YBe(o,s,i){return function(){var u=this.__on,m,h=ZBe(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 KBe(o,s,i){var u=GBe(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?YBe:qBe,m=0;m<h;++m)this.each(C(u[m],s,i));return this}function Vfe(o,s,i){var u=Bfe(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 XBe(o,s){return function(){return Vfe(this,o,s)}}function JBe(o,s){return function(){return Vfe(this,o,s.apply(this,arguments))}}function QBe(o,s){return this.each((typeof s=="function"?JBe:XBe)(o,s))}function*eIe(){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 Hfe=[null];function Sp(o,s){this._groups=o,this._parents=s}function TR(){return new Sp([[document.documentElement]],Hfe)}function tIe(){return this}Sp.prototype=TR.prototype={constructor:Sp,select:TRe,selectAll:$Re,selectChild:BRe,selectChildren:LRe,filter:VRe,data:ZRe,enter:HRe,exit:qRe,join:YRe,merge:KRe,selection:tIe,order:XRe,sort:JRe,call:eBe,nodes:tBe,node:nBe,size:oBe,empty:sBe,each:rBe,attr:fBe,style:hBe,property:wBe,classed:EBe,text:ABe,html:DBe,raise:RBe,lower:IBe,append:PBe,insert:LBe,remove:HBe,clone:jBe,datum:WBe,on:KBe,dispatch:QBe,[Symbol.iterator]:eIe};function Mh(o){return typeof o=="string"?new Sp([[document.querySelector(o)]],[document.documentElement]):new Sp([[o]],Hfe)}function nIe(o){let s;for(;s=o.sourceEvent;)o=s;return o}function Nv(o,s){if(o=nIe(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 oIe={passive:!1},nR={capture:!0,passive:!1};function ite(o){o.stopImmediatePropagation()}function n4(o){o.preventDefault(),o.stopImmediatePropagation()}function zfe(o){var s=o.document.documentElement,i=Mh(o).on("dragstart.drag",n4,nR);"onselectstart"in s?i.on("selectstart.drag",n4,nR):(s.__noselect=s.style.MozUserSelect,s.style.MozUserSelect="none")}function Ufe(o,s){var i=o.document.documentElement,u=Mh(o).on("dragstart.drag",null);s&&(u.on("click.drag",n4,nR),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 kH=o=>()=>o;function pne(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}})}pne.prototype.on=function(){var o=this._.on.apply(this._,arguments);return o===this._?this:o};function sIe(o){return!o.ctrlKey&&!o.button}function rIe(){return this.parentNode}function aIe(o,s){return s??{x:o.x,y:o.y}}function iIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function lIe(){var o=sIe,s=rIe,i=aIe,u=iIe,m={},h=kU("start","drag","end"),b=0,C,x,_,N,O=0;function B(me){me.on("mousedown.drag",F).filter(u).on("touchstart.drag",X).on("touchmove.drag",q,oIe).on("touchend.drag touchcancel.drag",W).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function F(me,et){if(!(N||!o.call(this,me,et))){var $e=H(this,s.call(this,me,et),me,et,"mouse");$e&&(Mh(me.view).on("mousemove.drag",Z,nR).on("mouseup.drag",K,nR),zfe(me.view),ite(me),_=!1,C=me.clientX,x=me.clientY,$e("start",me))}}function Z(me){if(n4(me),!_){var et=me.clientX-C,$e=me.clientY-x;_=et*et+$e*$e>O}m.mouse("drag",me)}function K(me){Mh(me.view).on("mousemove.drag mouseup.drag",null),Ufe(me.view,_),n4(me),m.mouse("end",me)}function X(me,et){if(o.call(this,me,et)){var $e=me.changedTouches,te=s.call(this,me,et),We=$e.length,ft,lt;for(ft=0;ft<We;++ft)(lt=H(this,te,me,et,$e[ft].identifier,$e[ft]))&&(ite(me),lt("start",me,$e[ft]))}}function q(me){var et=me.changedTouches,$e=et.length,te,We;for(te=0;te<$e;++te)(We=m[et[te].identifier])&&(n4(me),We("drag",me,et[te]))}function W(me){var et=me.changedTouches,$e=et.length,te,We;for(N&&clearTimeout(N),N=setTimeout(function(){N=null},500),te=0;te<$e;++te)(We=m[et[te].identifier])&&(ite(me),We("end",me,et[te]))}function H(me,et,$e,te,We,ft){var lt=h.copy(),Ne=Nv(ft||$e,et),ue,Pt,ye;if((ye=i.call(me,new pne("beforestart",{sourceEvent:$e,target:B,identifier:We,active:b,x:Ne[0],y:Ne[1],dx:0,dy:0,dispatch:lt}),te))!=null)return ue=ye.x-Ne[0]||0,Pt=ye.y-Ne[1]||0,function De(R,Ue,be){var ot=Ne,nt;switch(R){case"start":m[We]=De,nt=b++;break;case"end":delete m[We],--b;case"drag":Ne=Nv(be||Ue,et),nt=b;break}lt.call(R,me,new pne(R,{sourceEvent:Ue,subject:ye,target:B,identifier:We,active:nt,x:Ne[0]+ue,y:Ne[1]+Pt,dx:Ne[0]-ot[0],dy:Ne[1]-ot[1],dispatch:lt}),te)}}return B.filter=function(me){return arguments.length?(o=typeof me=="function"?me:kH(!!me),B):o},B.container=function(me){return arguments.length?(s=typeof me=="function"?me:kH(me),B):s},B.subject=function(me){return arguments.length?(i=typeof me=="function"?me:kH(me),B):i},B.touchable=function(me){return arguments.length?(u=typeof me=="function"?me:kH(!!me),B):u},B.on=function(){var me=h.on.apply(h,arguments);return me===h?B:me},B.clickDistance=function(me){return arguments.length?(O=(me=+me)*me,B):Math.sqrt(O)},B}function Aoe(o,s,i){o.prototype=s.prototype=i,i.constructor=o}function jfe(o,s){var i=Object.create(o.prototype);for(var u in s)i[u]=s[u];return i}function AR(){}var oR=.7,_z=1/oR,o4="\\s*([+-]?\\d+)\\s*",sR="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Dv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",cIe=/^#([0-9a-f]{3,8})$/,uIe=new RegExp(`^rgb\\(${o4},${o4},${o4}\\)$`),dIe=new RegExp(`^rgb\\(${Dv},${Dv},${Dv}\\)$`),fIe=new RegExp(`^rgba\\(${o4},${o4},${o4},${sR}\\)$`),mIe=new RegExp(`^rgba\\(${Dv},${Dv},${Dv},${sR}\\)$`),pIe=new RegExp(`^hsl\\(${sR},${Dv},${Dv}\\)$`),gIe=new RegExp(`^hsla\\(${sR},${Dv},${Dv},${sR}\\)$`),ole={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};Aoe(AR,rR,{copy(o){return Object.assign(new this.constructor,this,o)},displayable(){return this.rgb().displayable()},hex:sle,formatHex:sle,formatHex8:hIe,formatHsl:vIe,formatRgb:rle,toString:rle});function sle(){return this.rgb().formatHex()}function hIe(){return this.rgb().formatHex8()}function vIe(){return Wfe(this).formatHsl()}function rle(){return this.rgb().formatRgb()}function rR(o){var s,i;return o=(o+"").trim().toLowerCase(),(s=cIe.exec(o))?(i=s[1].length,s=parseInt(s[1],16),i===6?ale(s):i===3?new xm(s>>8&15|s>>4&240,s>>4&15|s&240,(s&15)<<4|s&15,1):i===8?TH(s>>24&255,s>>16&255,s>>8&255,(s&255)/255):i===4?TH(s>>12&15|s>>8&240,s>>8&15|s>>4&240,s>>4&15|s&240,((s&15)<<4|s&15)/255):null):(s=uIe.exec(o))?new xm(s[1],s[2],s[3],1):(s=dIe.exec(o))?new xm(s[1]*255/100,s[2]*255/100,s[3]*255/100,1):(s=fIe.exec(o))?TH(s[1],s[2],s[3],s[4]):(s=mIe.exec(o))?TH(s[1]*255/100,s[2]*255/100,s[3]*255/100,s[4]):(s=pIe.exec(o))?cle(s[1],s[2]/100,s[3]/100,1):(s=gIe.exec(o))?cle(s[1],s[2]/100,s[3]/100,s[4]):ole.hasOwnProperty(o)?ale(ole[o]):o==="transparent"?new xm(NaN,NaN,NaN,0):null}function ale(o){return new xm(o>>16&255,o>>8&255,o&255,1)}function TH(o,s,i,u){return u<=0&&(o=s=i=NaN),new xm(o,s,i,u)}function bIe(o){return o instanceof AR||(o=rR(o)),o?(o=o.rgb(),new xm(o.r,o.g,o.b,o.opacity)):new xm}function gne(o,s,i,u){return arguments.length===1?bIe(o):new xm(o,s,i,u??1)}function xm(o,s,i,u){this.r=+o,this.g=+s,this.b=+i,this.opacity=+u}Aoe(xm,gne,jfe(AR,{brighter(o){return o=o==null?_z:Math.pow(_z,o),new xm(this.r*o,this.g*o,this.b*o,this.opacity)},darker(o){return o=o==null?oR:Math.pow(oR,o),new xm(this.r*o,this.g*o,this.b*o,this.opacity)},rgb(){return this},clamp(){return new xm(wE(this.r),wE(this.g),wE(this.b),kz(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:ile,formatHex:ile,formatHex8:yIe,formatRgb:lle,toString:lle}));function ile(){return`#${dE(this.r)}${dE(this.g)}${dE(this.b)}`}function yIe(){return`#${dE(this.r)}${dE(this.g)}${dE(this.b)}${dE((isNaN(this.opacity)?1:this.opacity)*255)}`}function lle(){const o=kz(this.opacity);return`${o===1?"rgb(":"rgba("}${wE(this.r)}, ${wE(this.g)}, ${wE(this.b)}${o===1?")":`, ${o})`}`}function kz(o){return isNaN(o)?1:Math.max(0,Math.min(1,o))}function wE(o){return Math.max(0,Math.min(255,Math.round(o)||0))}function dE(o){return o=wE(o),(o<16?"0":"")+o.toString(16)}function cle(o,s,i,u){return u<=0?o=s=i=NaN:i<=0||i>=1?o=s=NaN:s<=0&&(o=NaN),new Rh(o,s,i,u)}function Wfe(o){if(o instanceof Rh)return new Rh(o.h,o.s,o.l,o.opacity);if(o instanceof AR||(o=rR(o)),!o)return new Rh;if(o instanceof Rh)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 Rh(b,C,x,o.opacity)}function wIe(o,s,i,u){return arguments.length===1?Wfe(o):new Rh(o,s,i,u??1)}function Rh(o,s,i,u){this.h=+o,this.s=+s,this.l=+i,this.opacity=+u}Aoe(Rh,wIe,jfe(AR,{brighter(o){return o=o==null?_z:Math.pow(_z,o),new Rh(this.h,this.s,this.l*o,this.opacity)},darker(o){return o=o==null?oR:Math.pow(oR,o),new Rh(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 xm(lte(o>=240?o-240:o+120,m,u),lte(o,m,u),lte(o<120?o+240:o-120,m,u),this.opacity)},clamp(){return new Rh(ule(this.h),AH(this.s),AH(this.l),kz(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=kz(this.opacity);return`${o===1?"hsl(":"hsla("}${ule(this.h)}, ${AH(this.s)*100}%, ${AH(this.l)*100}%${o===1?")":`, ${o})`}`}}));function ule(o){return o=(o||0)%360,o<0?o+360:o}function AH(o){return Math.max(0,Math.min(1,o||0))}function lte(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 Zfe=o=>()=>o;function CIe(o,s){return function(i){return o+i*s}}function SIe(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 xIe(o){return(o=+o)==1?Gfe:function(s,i){return i-s?SIe(s,i,o):Zfe(isNaN(s)?i:s)}}function Gfe(o,s){var i=s-o;return i?CIe(o,i):Zfe(isNaN(o)?s:o)}const dle=function o(s){var i=xIe(s);function u(m,h){var b=i((m=gne(m)).r,(h=gne(h)).r),C=i(m.g,h.g),x=i(m.b,h.b),_=Gfe(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 a2(o,s){return o=+o,s=+s,function(i){return o*(1-i)+s*i}}var hne=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,cte=new RegExp(hne.source,"g");function EIe(o){return function(){return o}}function _Ie(o){return function(s){return o(s)+""}}function kIe(o,s){var i=hne.lastIndex=cte.lastIndex=0,u,m,h,b=-1,C=[],x=[];for(o=o+"",s=s+"";(u=hne.exec(o))&&(m=cte.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:a2(u,m)})),i=cte.lastIndex;return i<s.length&&(h=s.slice(i),C[b]?C[b]+=h:C[++b]=h),C.length<2?x[0]?_Ie(x[0].x):EIe(s):(s=x.length,function(_){for(var N=0,O;N<s;++N)C[(O=x[N]).i]=O.x(_);return C.join("")})}var fle=180/Math.PI,vne={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function qfe(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)*fle,skewX:Math.atan(x)*fle,scaleX:b,scaleY:C}}var NH;function TIe(o){const s=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(o+"");return s.isIdentity?vne:qfe(s.a,s.b,s.c,s.d,s.e,s.f)}function AIe(o){return o==null||(NH||(NH=document.createElementNS("http://www.w3.org/2000/svg","g")),NH.setAttribute("transform",o),!(o=NH.transform.baseVal.consolidate()))?vne:(o=o.matrix,qfe(o.a,o.b,o.c,o.d,o.e,o.f))}function Yfe(o,s,i,u){function m(_){return _.length?_.pop()+" ":""}function h(_,N,O,B,F,Z){if(_!==O||N!==B){var K=F.push("translate(",null,s,null,i);Z.push({i:K-4,x:a2(_,O)},{i:K-2,x:a2(N,B)})}else(O||B)&&F.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:a2(_,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:a2(_,N)}):N&&O.push(m(O)+"skewX("+N+u)}function x(_,N,O,B,F,Z){if(_!==O||N!==B){var K=F.push(m(F)+"scale(",null,",",null,")");Z.push({i:K-4,x:a2(_,O)},{i:K-2,x:a2(N,B)})}else(O!==1||B!==1)&&F.push(m(F)+"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(F){for(var Z=-1,K=B.length,X;++Z<K;)O[(X=B[Z]).i]=X.x(F);return O.join("")}}}var NIe=Yfe(TIe,"px, ","px)","deg)"),OIe=Yfe(AIe,", ",")",")"),$Ie=1e-12;function mle(o){return((o=Math.exp(o))+1/o)/2}function DIe(o){return((o=Math.exp(o))-1/o)/2}function MIe(o){return((o=Math.exp(2*o))-1)/(o+1)}const RIe=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],F=N-C,Z=O-x,K=F*F+Z*Z,X,q;if(K<$Ie)q=Math.log(B/_)/s,X=function(te){return[C+te*F,x+te*Z,_*Math.exp(s*te*q)]};else{var W=Math.sqrt(K),H=(B*B-_*_+u*K)/(2*_*i*W),me=(B*B-_*_-u*K)/(2*B*i*W),et=Math.log(Math.sqrt(H*H+1)-H),$e=Math.log(Math.sqrt(me*me+1)-me);q=($e-et)/s,X=function(te){var We=te*q,ft=mle(et),lt=_/(i*W)*(ft*MIe(s*We+et)-DIe(et));return[C+lt*F,x+lt*Z,_*ft/mle(s*We+et)]}}return X.duration=q*1e3*s/Math.SQRT2,X}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,DM=0,OM=0,Kfe=1e3,Tz,MM,Az=0,kE=0,AU=0,aR=typeof performance=="object"&&performance.now?performance:Date,Xfe=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(o){setTimeout(o,17)};function Noe(){return kE||(Xfe(BIe),kE=aR.now()+AU)}function BIe(){kE=0}function Nz(){this._call=this._time=this._next=null}Nz.prototype=Jfe.prototype={constructor:Nz,restart:function(o,s,i){if(typeof o!="function")throw new TypeError("callback is not a function");i=(i==null?Noe():+i)+(s==null?0:+s),!this._next&&MM!==this&&(MM?MM._next=this:Tz=this,MM=this),this._call=o,this._time=i,bne()},stop:function(){this._call&&(this._call=null,this._time=1/0,bne())}};function Jfe(o,s,i){var u=new Nz;return u.restart(o,s,i),u}function IIe(){Noe(),++m4;for(var o=Tz,s;o;)(s=kE-o._time)>=0&&o._call.call(void 0,s),o=o._next;--m4}function ple(){kE=(Az=aR.now())+AU,m4=DM=0;try{IIe()}finally{m4=0,FIe(),kE=0}}function PIe(){var o=aR.now(),s=o-Az;s>Kfe&&(AU-=s,Az=o)}function FIe(){for(var o,s=Tz,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:Tz=i);MM=o,bne(u)}function bne(o){if(!m4){DM&&(DM=clearTimeout(DM));var s=o-kE;s>24?(o<1/0&&(DM=setTimeout(ple,o-aR.now()-AU)),OM&&(OM=clearInterval(OM))):(OM||(Az=aR.now(),OM=setInterval(PIe,Kfe)),m4=1,Xfe(ple))}}function gle(o,s,i){var u=new Nz;return s=s==null?0:+s,u.restart(m=>{u.stop(),o(m+s)},s,i),u}var LIe=kU("start","end","cancel","interrupt"),VIe=[],Qfe=0,hle=1,yne=2,XH=3,vle=4,wne=5,JH=6;function NU(o,s,i,u,m,h){var b=o.__transition;if(!b)o.__transition={};else if(i in b)return;HIe(o,i,{name:s,index:u,group:m,on:LIe,tween:VIe,time:h.time,delay:h.delay,duration:h.duration,ease:h.ease,timer:null,state:Qfe})}function Ooe(o,s){var i=Ph(o,s);if(i.state>Qfe)throw new Error("too late; already scheduled");return i}function Fv(o,s){var i=Ph(o,s);if(i.state>XH)throw new Error("too late; already running");return i}function Ph(o,s){var i=o.__transition;if(!i||!(i=i[s]))throw new Error("transition not found");return i}function HIe(o,s,i){var u=o.__transition,m;u[s]=i,i.timer=Jfe(h,0,i.time);function h(_){i.state=hle,i.timer.restart(b,i.delay,i.time),i.delay<=_&&b(_-i.delay)}function b(_){var N,O,B,F;if(i.state!==hle)return x();for(N in u)if(F=u[N],F.name===i.name){if(F.state===XH)return gle(b);F.state===vle?(F.state=JH,F.timer.stop(),F.on.call("interrupt",o,o.__data__,F.index,F.group),delete u[N]):+N<s&&(F.state=JH,F.timer.stop(),F.on.call("cancel",o,o.__data__,F.index,F.group),delete u[N])}if(gle(function(){i.state===XH&&(i.state=vle,i.timer.restart(C,i.delay,i.time),C(_))}),i.state=yne,i.on.call("start",o,o.__data__,i.index,i.group),i.state===yne){for(i.state=XH,m=new Array(B=i.tween.length),N=0,O=-1;N<B;++N)(F=i.tween[N].value.call(o,o.__data__,i.index,i.group))&&(m[++O]=F);m.length=O+1}}function C(_){for(var N=_<i.duration?i.ease.call(null,_/i.duration):(i.timer.restart(x),i.state=wne,1),O=-1,B=m.length;++O<B;)m[O].call(o,N);i.state===wne&&(i.on.call("end",o,o.__data__,i.index,i.group),x())}function x(){i.state=JH,i.timer.stop(),delete u[s];for(var _ in u)return;delete o.__transition}}function QH(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>yne&&u.state<wne,u.state=JH,u.timer.stop(),u.on.call(m?"interrupt":"cancel",o,o.__data__,u.index,u.group),delete i[b]}h&&delete o.__transition}}function zIe(o){return this.each(function(){QH(this,o)})}function UIe(o,s){var i,u;return function(){var m=Fv(this,o),h=m.tween;if(h!==i){u=i=h;for(var b=0,C=u.length;b<C;++b)if(u[b].name===s){u=u.slice(),u.splice(b,1);break}}m.tween=u}}function jIe(o,s,i){var u,m;if(typeof i!="function")throw new Error;return function(){var h=Fv(this,o),b=h.tween;if(b!==u){m=(u=b).slice();for(var C={name:s,value:i},x=0,_=m.length;x<_;++x)if(m[x].name===s){m[x]=C;break}x===_&&m.push(C)}h.tween=m}}function WIe(o,s){var i=this._id;if(o+="",arguments.length<2){for(var u=Ph(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?UIe:jIe)(i,o,s))}function $oe(o,s,i){var u=o._id;return o.each(function(){var m=Fv(this,u);(m.value||(m.value={}))[s]=i.apply(this,arguments)}),function(m){return Ph(m,u).value[s]}}function eme(o,s){var i;return(typeof s=="number"?a2:s instanceof rR?dle:(i=rR(s))?(s=i,dle):kIe)(o,s)}function ZIe(o){return function(){this.removeAttribute(o)}}function GIe(o){return function(){this.removeAttributeNS(o.space,o.local)}}function qIe(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 YIe(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 KIe(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 XIe(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 JIe(o,s){var i=TU(o),u=i==="transform"?OIe:eme;return this.attrTween(o,typeof s=="function"?(i.local?XIe:KIe)(i,u,$oe(this,"attr."+o,s)):s==null?(i.local?GIe:ZIe)(i):(i.local?YIe:qIe)(i,u,s))}function QIe(o,s){return function(i){this.setAttribute(o,s.call(this,i))}}function ePe(o,s){return function(i){this.setAttributeNS(o.space,o.local,s.call(this,i))}}function tPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&ePe(o,h)),i}return m._value=s,m}function nPe(o,s){var i,u;function m(){var h=s.apply(this,arguments);return h!==u&&(i=(u=h)&&QIe(o,h)),i}return m._value=s,m}function oPe(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=TU(o);return this.tween(i,(u.local?tPe:nPe)(u,s))}function sPe(o,s){return function(){Ooe(this,o).delay=+s.apply(this,arguments)}}function rPe(o,s){return s=+s,function(){Ooe(this,o).delay=s}}function aPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?sPe:rPe)(s,o)):Ph(this.node(),s).delay}function iPe(o,s){return function(){Fv(this,o).duration=+s.apply(this,arguments)}}function lPe(o,s){return s=+s,function(){Fv(this,o).duration=s}}function cPe(o){var s=this._id;return arguments.length?this.each((typeof o=="function"?iPe:lPe)(s,o)):Ph(this.node(),s).duration}function uPe(o,s){if(typeof s!="function")throw new Error;return function(){Fv(this,o).ease=s}}function dPe(o){var s=this._id;return arguments.length?this.each(uPe(s,o)):Ph(this.node(),s).ease}function fPe(o,s){return function(){var i=s.apply(this,arguments);if(typeof i!="function")throw new Error;Fv(this,o).ease=i}}function mPe(o){if(typeof o!="function")throw new Error;return this.each(fPe(this._id,o))}function pPe(o){typeof o!="function"&&(o=Dfe(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 V0(u,this._parents,this._name,this._id)}function gPe(o){if(o._id!==this._id)throw new Error;for(var s=this._groups,i=o._groups,u=s.length,m=i.length,h=Math.min(u,m),b=new Array(u),C=0;C<h;++C)for(var x=s[C],_=i[C],N=x.length,O=b[C]=new Array(N),B,F=0;F<N;++F)(B=x[F]||_[F])&&(O[F]=B);for(;C<u;++C)b[C]=s[C];return new V0(b,this._parents,this._name,this._id)}function hPe(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 vPe(o,s,i){var u,m,h=hPe(s)?Ooe:Fv;return function(){var b=h(this,o),C=b.on;C!==u&&(m=(u=C).copy()).on(s,i),b.on=m}}function bPe(o,s){var i=this._id;return arguments.length<2?Ph(this.node(),i).on.on(o):this.each(vPe(i,o,s))}function yPe(o){return function(){var s=this.parentNode;for(var i in this.__transition)if(+i!==o)return;s&&s.removeChild(this)}}function wPe(){return this.on("end.remove",yPe(this._id))}function CPe(o){var s=this._name,i=this._id;typeof o!="function"&&(o=koe(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,NU(_[B],s,i,B,_,Ph(N,i)));return new V0(h,this._parents,s,i)}function SPe(o){var s=this._name,i=this._id;typeof o!="function"&&(o=$fe(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),F,Z=Ph(N,i),K=0,X=B.length;K<X;++K)(F=B[K])&&NU(F,s,i,K,B,Z);h.push(B),b.push(N)}return new V0(h,b,s,i)}var xPe=TR.prototype.constructor;function EPe(){return new xPe(this._groups,this._parents)}function _Pe(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 tme(o){return function(){this.style.removeProperty(o)}}function kPe(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 TPe(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 APe(o,s){var i,u,m,h="style."+s,b="end."+h,C;return function(){var x=Fv(this,o),_=x.on,N=x.value[h]==null?C||(C=tme(s)):void 0;(_!==i||m!==N)&&(u=(i=_).copy()).on(b,m=N),x.on=u}}function NPe(o,s,i){var u=(o+="")=="transform"?NIe:eme;return s==null?this.styleTween(o,_Pe(o,u)).on("end.style."+o,tme(o)):typeof s=="function"?this.styleTween(o,TPe(o,u,$oe(this,"style."+o,s))).each(APe(this._id,o)):this.styleTween(o,kPe(o,u,s),i).on("end.style."+o,null)}function OPe(o,s,i){return function(u){this.style.setProperty(o,s.call(this,u),i)}}function $Pe(o,s,i){var u,m;function h(){var b=s.apply(this,arguments);return b!==m&&(u=(m=b)&&OPe(o,b,i)),u}return h._value=s,h}function DPe(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,$Pe(o,s,i??""))}function MPe(o){return function(){this.textContent=o}}function RPe(o){return function(){var s=o(this);this.textContent=s??""}}function BPe(o){return this.tween("text",typeof o=="function"?RPe($oe(this,"text",o)):MPe(o==null?"":o+""))}function IPe(o){return function(s){this.textContent=o.call(this,s)}}function PPe(o){var s,i;function u(){var m=o.apply(this,arguments);return m!==i&&(s=(i=m)&&IPe(m)),s}return u._value=o,u}function FPe(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,PPe(o))}function LPe(){for(var o=this._name,s=this._id,i=nme(),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=Ph(x,s);NU(x,o,i,_,b,{time:N.time+N.delay+N.duration,delay:0,duration:N.duration,ease:N.ease})}return new V0(u,this._parents,o,i)}function VPe(){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 _=Fv(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 HPe=0;function V0(o,s,i,u){this._groups=o,this._parents=s,this._name=i,this._id=u}function nme(){return++HPe}var $0=TR.prototype;V0.prototype={constructor:V0,select:CPe,selectAll:SPe,selectChild:$0.selectChild,selectChildren:$0.selectChildren,filter:pPe,merge:gPe,selection:EPe,transition:LPe,call:$0.call,nodes:$0.nodes,node:$0.node,size:$0.size,empty:$0.empty,each:$0.each,on:bPe,attr:JIe,attrTween:oPe,style:NPe,styleTween:DPe,text:BPe,textTween:FPe,remove:wPe,tween:WIe,delay:aPe,duration:cPe,ease:dPe,easeVarying:mPe,end:VPe,[Symbol.iterator]:$0[Symbol.iterator]};function zPe(o){return((o*=2)<=1?o*o*o:(o-=2)*o*o+2)/2}var UPe={time:null,delay:0,duration:250,ease:zPe};function jPe(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 WPe(o){var s,i;o instanceof V0?(s=o._id,o=o._name):(s=nme(),(i=UPe).time=Noe(),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[_])&&NU(x,o,s,_,b,i||jPe(x,s));return new V0(u,this._parents,o,s)}TR.prototype.interrupt=zIe;TR.prototype.transition=WPe;const OH=o=>()=>o;function ZPe(o,{sourceEvent:s,target:i,transform:u,dispatch:m}){Object.defineProperties(this,{type:{value:o,enumerable:!0,configurable:!0},sourceEvent:{value:s,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:u,enumerable:!0,configurable:!0},_:{value:m}})}function I0(o,s,i){this.k=o,this.x=s,this.y=i}I0.prototype={constructor:I0,scale:function(o){return o===1?this:new I0(this.k*o,this.x,this.y)},translate:function(o,s){return o===0&s===0?this:new I0(this.k,this.x+this.k*o,this.y+this.k*s)},apply:function(o){return[o[0]*this.k+this.x,o[1]*this.k+this.y]},applyX:function(o){return o*this.k+this.x},applyY:function(o){return o*this.k+this.y},invert:function(o){return[(o[0]-this.x)/this.k,(o[1]-this.y)/this.k]},invertX:function(o){return(o-this.x)/this.k},invertY:function(o){return(o-this.y)/this.k},rescaleX:function(o){return o.copy().domain(o.range().map(this.invertX,this).map(o.invert,o))},rescaleY:function(o){return o.copy().domain(o.range().map(this.invertY,this).map(o.invert,o))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var p4=new I0(1,0,0);I0.prototype;function ute(o){o.stopImmediatePropagation()}function $M(o){o.preventDefault(),o.stopImmediatePropagation()}function GPe(o){return(!o.ctrlKey||o.type==="wheel")&&!o.button}function qPe(){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 ble(){return this.__zoom||p4}function YPe(o){return-o.deltaY*(o.deltaMode===1?.05:o.deltaMode?1:.002)*(o.ctrlKey?10:1)}function KPe(){return navigator.maxTouchPoints||"ontouchstart"in this}function XPe(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 JPe(){var o=GPe,s=qPe,i=XPe,u=YPe,m=KPe,h=[0,1/0],b=[[-1/0,-1/0],[1/0,1/0]],C=250,x=RIe,_=kU("start","zoom","end"),N,O,B,F=500,Z=150,K=0,X=10;function q(ye){ye.property("__zoom",ble).on("wheel.zoom",We,{passive:!1}).on("mousedown.zoom",ft).on("dblclick.zoom",lt).filter(m).on("touchstart.zoom",Ne).on("touchmove.zoom",ue).on("touchend.zoom touchcancel.zoom",Pt).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}q.transform=function(ye,De,R,Ue){var be=ye.selection?ye.selection():ye;be.property("__zoom",ble),ye!==be?et(ye,De,R,Ue):be.interrupt().each(function(){$e(this,arguments).event(Ue).start().zoom(null,typeof De=="function"?De.apply(this,arguments):De).end()})},q.scaleBy=function(ye,De,R,Ue){q.scaleTo(ye,function(){var be=this.__zoom.k,ot=typeof De=="function"?De.apply(this,arguments):De;return be*ot},R,Ue)},q.scaleTo=function(ye,De,R,Ue){q.transform(ye,function(){var be=s.apply(this,arguments),ot=this.__zoom,nt=R==null?me(be):typeof R=="function"?R.apply(this,arguments):R,ge=ot.invert(nt),Ze=typeof De=="function"?De.apply(this,arguments):De;return i(H(W(ot,Ze),nt,ge),be,b)},R,Ue)},q.translateBy=function(ye,De,R,Ue){q.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,Ue)},q.translateTo=function(ye,De,R,Ue,be){q.transform(ye,function(){var ot=s.apply(this,arguments),nt=this.__zoom,ge=Ue==null?me(ot):typeof Ue=="function"?Ue.apply(this,arguments):Ue;return i(p4.translate(ge[0],ge[1]).scale(nt.k).translate(typeof De=="function"?-De.apply(this,arguments):-De,typeof R=="function"?-R.apply(this,arguments):-R),ot,b)},Ue,be)};function W(ye,De){return De=Math.max(h[0],Math.min(h[1],De)),De===ye.k?ye:new I0(De,ye.x,ye.y)}function H(ye,De,R){var Ue=De[0]-R[0]*ye.k,be=De[1]-R[1]*ye.k;return Ue===ye.x&&be===ye.y?ye:new I0(ye.k,Ue,be)}function me(ye){return[(+ye[0][0]+ +ye[1][0])/2,(+ye[0][1]+ +ye[1][1])/2]}function et(ye,De,R,Ue){ye.on("start.zoom",function(){$e(this,arguments).event(Ue).start()}).on("interrupt.zoom end.zoom",function(){$e(this,arguments).event(Ue).end()}).tween("zoom",function(){var be=this,ot=arguments,nt=$e(be,ot).event(Ue),ge=s.apply(be,ot),Ze=R==null?me(ge):typeof R=="function"?R.apply(be,ot):R,Tt=Math.max(ge[1][0]-ge[0][0],ge[1][1]-ge[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(dt){if(dt===1)dt=vt;else{var oe=Be(dt),pn=Tt/oe[2];dt=new I0(pn,Ze[0]-oe[0]*pn,Ze[1]-oe[1]*pn)}nt.zoom(null,dt)}})}function $e(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=Mh(this.that).datum();_.call(ye,this.that,new ZPe(ye,{sourceEvent:this.sourceEvent,target:q,type:ye,transform:this.that.__zoom,dispatch:_}),De)}};function We(ye,...De){if(!o.apply(this,arguments))return;var R=$e(this,De).event(ye),Ue=this.__zoom,be=Math.max(h[0],Math.min(h[1],Ue.k*Math.pow(2,u.apply(this,arguments)))),ot=Nv(ye);if(R.wheel)(R.mouse[0][0]!==ot[0]||R.mouse[0][1]!==ot[1])&&(R.mouse[1]=Ue.invert(R.mouse[0]=ot)),clearTimeout(R.wheel);else{if(Ue.k===be)return;R.mouse=[ot,Ue.invert(ot)],QH(this),R.start()}$M(ye),R.wheel=setTimeout(nt,Z),R.zoom("mouse",i(H(W(Ue,be),R.mouse[0],R.mouse[1]),R.extent,b));function nt(){R.wheel=null,R.end()}}function ft(ye,...De){if(B||!o.apply(this,arguments))return;var R=ye.currentTarget,Ue=$e(this,De,!0).event(ye),be=Mh(ye.view).on("mousemove.zoom",Ze,!0).on("mouseup.zoom",Tt,!0),ot=Nv(ye,R),nt=ye.clientX,ge=ye.clientY;zfe(ye.view),ute(ye),Ue.mouse=[ot,this.__zoom.invert(ot)],QH(this),Ue.start();function Ze(He){if($M(He),!Ue.moved){var vt=He.clientX-nt,Be=He.clientY-ge;Ue.moved=vt*vt+Be*Be>K}Ue.event(He).zoom("mouse",i(H(Ue.that.__zoom,Ue.mouse[0]=Nv(He,R),Ue.mouse[1]),Ue.extent,b))}function Tt(He){be.on("mousemove.zoom mouseup.zoom",null),Ufe(He.view,Ue.moved),$M(He),Ue.event(He).end()}}function lt(ye,...De){if(o.apply(this,arguments)){var R=this.__zoom,Ue=Nv(ye.changedTouches?ye.changedTouches[0]:ye,this),be=R.invert(Ue),ot=R.k*(ye.shiftKey?.5:2),nt=i(H(W(R,ot),Ue,be),s.apply(this,De),b);$M(ye),C>0?Mh(this).transition().duration(C).call(et,nt,Ue,ye):Mh(this).call(q.transform,nt,Ue,ye)}}function Ne(ye,...De){if(o.apply(this,arguments)){var R=ye.touches,Ue=R.length,be=$e(this,De,ye.changedTouches.length===Ue).event(ye),ot,nt,ge,Ze;for(ute(ye),nt=0;nt<Ue;++nt)ge=R[nt],Ze=Nv(ge,this),Ze=[Ze,this.__zoom.invert(Ze),ge.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},F)),QH(this),be.start())}}function ue(ye,...De){if(this.__zooming){var R=$e(this,De).event(ye),Ue=ye.changedTouches,be=Ue.length,ot,nt,ge,Ze;for($M(ye),ot=0;ot<be;++ot)nt=Ue[ot],ge=Nv(nt,this),R.touch0&&R.touch0[2]===nt.identifier?R.touch0[0]=ge:R.touch1&&R.touch1[2]===nt.identifier&&(R.touch1[0]=ge);if(nt=R.that.__zoom,R.touch1){var Tt=R.touch0[0],He=R.touch0[1],vt=R.touch1[0],Be=R.touch1[1],dt=(dt=vt[0]-Tt[0])*dt+(dt=vt[1]-Tt[1])*dt,oe=(oe=Be[0]-He[0])*oe+(oe=Be[1]-He[1])*oe;nt=W(nt,Math.sqrt(dt/oe)),ge=[(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)ge=R.touch0[0],Ze=R.touch0[1];else return;R.zoom("touch",i(H(nt,ge,Ze),R.extent,b))}}function Pt(ye,...De){if(this.__zooming){var R=$e(this,De).event(ye),Ue=ye.changedTouches,be=Ue.length,ot,nt;for(ute(ye),B&&clearTimeout(B),B=setTimeout(function(){B=null},F),ot=0;ot<be;++ot)nt=Ue[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=Nv(nt,this),Math.hypot(O[0]-nt[0],O[1]-nt[1])<X)){var ge=Mh(this).on("dblclick.zoom");ge&&ge.apply(this,arguments)}}}return q.wheelDelta=function(ye){return arguments.length?(u=typeof ye=="function"?ye:OH(+ye),q):u},q.filter=function(ye){return arguments.length?(o=typeof ye=="function"?ye:OH(!!ye),q):o},q.touchable=function(ye){return arguments.length?(m=typeof ye=="function"?ye:OH(!!ye),q):m},q.extent=function(ye){return arguments.length?(s=typeof ye=="function"?ye:OH([[+ye[0][0],+ye[0][1]],[+ye[1][0],+ye[1][1]]]),q):s},q.scaleExtent=function(ye){return arguments.length?(h[0]=+ye[0],h[1]=+ye[1],q):[h[0],h[1]]},q.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],q):[[b[0][0],b[0][1]],[b[1][0],b[1][1]]]},q.constrain=function(ye){return arguments.length?(i=ye,q):i},q.duration=function(ye){return arguments.length?(C=+ye,q):C},q.interpolate=function(ye){return arguments.length?(x=ye,q):x},q.on=function(){var ye=_.on.apply(_,arguments);return ye===_?q:ye},q.clickDistance=function(ye){return arguments.length?(K=(ye=+ye)*ye,q):Math.sqrt(K)},q.tapDistance=function(ye){return arguments.length?(X=+ye,q):X},q}var ss=(o=>(o.Left="left",o.Top="top",o.Right="right",o.Bottom="bottom",o))(ss||{}),Doe=(o=>(o.Partial="partial",o.Full="full",o))(Doe||{}),iE=(o=>(o.Bezier="default",o.SimpleBezier="simple-bezier",o.Straight="straight",o.Step="step",o.SmoothStep="smoothstep",o))(iE||{}),g2=(o=>(o.Strict="strict",o.Loose="loose",o))(g2||{}),Oz=(o=>(o.Arrow="arrow",o.ArrowClosed="arrowclosed",o))(Oz||{}),UM=(o=>(o.Free="free",o.Vertical="vertical",o.Horizontal="horizontal",o))(UM||{}),ome=(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))(ome||{});const QPe=["INPUT","SELECT","TEXTAREA"];function Cne(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 QPe.includes(u==null?void 0:u.nodeName)||m||!!h}function e8e(o){return o.ctrlKey||o.metaKey||o.shiftKey||o.altKey}function yle(o,s,i,u){const m=s.replace("+",`
|
|
116
116
|
`).replace(`
|
|
117
117
|
|
|
118
118
|
`,`
|
|
@@ -144,4 +144,4 @@ Edge: ${o}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will
|
|
|
144
144
|
* @license MIT
|
|
145
145
|
*/function pce(o,s){var i=Object.keys(o);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(o);s&&(u=u.filter(function(m){return Object.getOwnPropertyDescriptor(o,m).enumerable})),i.push.apply(i,u)}return i}function Bv(o){for(var s=1;s<arguments.length;s++){var i=arguments[s]!=null?arguments[s]:{};s%2?pce(Object(i),!0).forEach(function(u){jze(o,u,i[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):pce(Object(i)).forEach(function(u){Object.defineProperty(o,u,Object.getOwnPropertyDescriptor(i,u))})}return o}function ez(o){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ez=function(s){return typeof s}:ez=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},ez(o)}function jze(o,s,i){return s in o?Object.defineProperty(o,s,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[s]=i,o}function H0(){return H0=Object.assign||function(o){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(o[u]=i[u])}return o},H0.apply(this,arguments)}function Wze(o,s){if(o==null)return{};var i={},u=Object.keys(o),m,h;for(h=0;h<u.length;h++)m=u[h],!(s.indexOf(m)>=0)&&(i[m]=o[m]);return i}function Zze(o,s){if(o==null)return{};var i=Wze(o,s),u,m;if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(o);for(m=0;m<h.length;m++)u=h[m],!(s.indexOf(u)>=0)&&Object.prototype.propertyIsEnumerable.call(o,u)&&(i[u]=o[u])}return i}var Gze="1.15.2";function F0(o){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(o)}var Z0=F0(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),OR=F0(/Edge/i),gce=F0(/firefox/i),WM=F0(/safari/i)&&!F0(/chrome/i)&&!F0(/android/i),Rpe=F0(/iP(ad|od|hone)/i),Bpe=F0(/chrome/i)&&F0(/android/i),Ipe={capture:!1,passive:!1};function Va(o,s,i){o.addEventListener(s,i,!Z0&&Ipe)}function Ta(o,s,i){o.removeEventListener(s,i,!Z0&&Ipe)}function Fz(o,s){if(s){if(s[0]===">"&&(s=s.substring(1)),o)try{if(o.matches)return o.matches(s);if(o.msMatchesSelector)return o.msMatchesSelector(s);if(o.webkitMatchesSelector)return o.webkitMatchesSelector(s)}catch{return!1}return!1}}function qze(o){return o.host&&o!==document&&o.host.nodeType?o.host:o.parentNode}function $h(o,s,i,u){if(o){i=i||document;do{if(s!=null&&(s[0]===">"?o.parentNode===i&&Fz(o,s):Fz(o,s))||u&&o===i)return o;if(o===i)break}while(o=qze(o))}return null}var hce=/\s+/g;function vp(o,s,i){if(o&&s)if(o.classList)o.classList[i?"add":"remove"](s);else{var u=(" "+o.className+" ").replace(hce," ").replace(" "+s+" "," ");o.className=(u+(i?" "+s:"")).replace(hce," ")}}function Qs(o,s,i){var u=o&&o.style;if(u){if(i===void 0)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(o,""):o.currentStyle&&(i=o.currentStyle),s===void 0?i:i[s];!(s in u)&&s.indexOf("webkit")===-1&&(s="-webkit-"+s),u[s]=i+(typeof i=="string"?"":"px")}}function a4(o,s){var i="";if(typeof o=="string")i=o;else do{var u=Qs(o,"transform");u&&u!=="none"&&(i=u+" "+i)}while(!s&&(o=o.parentNode));var m=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return m&&new m(i)}function Ppe(o,s,i){if(o){var u=o.getElementsByTagName(s),m=0,h=u.length;if(i)for(;m<h;m++)i(u[m],m);return u}return[]}function Mv(){var o=document.scrollingElement;return o||document.documentElement}function Wc(o,s,i,u,m){if(!(!o.getBoundingClientRect&&o!==window)){var h,b,C,x,_,N,O;if(o!==window&&o.parentNode&&o!==Mv()?(h=o.getBoundingClientRect(),b=h.top,C=h.left,x=h.bottom,_=h.right,N=h.height,O=h.width):(b=0,C=0,x=window.innerHeight,_=window.innerWidth,N=window.innerHeight,O=window.innerWidth),(s||i)&&o!==window&&(m=m||o.parentNode,!Z0))do if(m&&m.getBoundingClientRect&&(Qs(m,"transform")!=="none"||i&&Qs(m,"position")!=="static")){var B=m.getBoundingClientRect();b-=B.top+parseInt(Qs(m,"border-top-width")),C-=B.left+parseInt(Qs(m,"border-left-width")),x=b+h.height,_=C+h.width;break}while(m=m.parentNode);if(u&&o!==window){var F=a4(m||o),Z=F&&F.a,K=F&&F.d;F&&(b/=K,C/=Z,O/=Z,N/=K,x=b+N,_=C+O)}return{top:b,left:C,bottom:x,right:_,width:O,height:N}}}function vce(o,s,i){for(var u=f2(o,!0),m=Wc(o)[s];u;){var h=Wc(u)[i],b=void 0;if(b=m>=h,!b)return u;if(u===Mv())break;u=f2(u,!1)}return!1}function h4(o,s,i,u){for(var m=0,h=0,b=o.children;h<b.length;){if(b[h].style.display!=="none"&&b[h]!==er.ghost&&(u||b[h]!==er.dragged)&&$h(b[h],i.draggable,o,!1)){if(m===s)return b[h];m++}h++}return null}function zoe(o,s){for(var i=o.lastElementChild;i&&(i===er.ghost||Qs(i,"display")==="none"||s&&!Fz(i,s));)i=i.previousElementSibling;return i||null}function xg(o,s){var i=0;if(!o||!o.parentNode)return-1;for(;o=o.previousElementSibling;)o.nodeName.toUpperCase()!=="TEMPLATE"&&o!==er.clone&&(!s||Fz(o,s))&&i++;return i}function bce(o){var s=0,i=0,u=Mv();if(o)do{var m=a4(o),h=m.a,b=m.d;s+=o.scrollLeft*h,i+=o.scrollTop*b}while(o!==u&&(o=o.parentNode));return[s,i]}function Yze(o,s){for(var i in o)if(o.hasOwnProperty(i)){for(var u in s)if(s.hasOwnProperty(u)&&s[u]===o[i][u])return Number(i)}return-1}function f2(o,s){if(!o||!o.getBoundingClientRect)return Mv();var i=o,u=!1;do if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var m=Qs(i);if(i.clientWidth<i.scrollWidth&&(m.overflowX=="auto"||m.overflowX=="scroll")||i.clientHeight<i.scrollHeight&&(m.overflowY=="auto"||m.overflowY=="scroll")){if(!i.getBoundingClientRect||i===document.body)return Mv();if(u||s)return i;u=!0}}while(i=i.parentNode);return Mv()}function Kze(o,s){if(o&&s)for(var i in s)s.hasOwnProperty(i)&&(o[i]=s[i]);return o}function kte(o,s){return Math.round(o.top)===Math.round(s.top)&&Math.round(o.left)===Math.round(s.left)&&Math.round(o.height)===Math.round(s.height)&&Math.round(o.width)===Math.round(s.width)}var ZM;function Fpe(o,s){return function(){if(!ZM){var i=arguments,u=this;i.length===1?o.call(u,i[0]):o.apply(u,i),ZM=setTimeout(function(){ZM=void 0},s)}}}function Xze(){clearTimeout(ZM),ZM=void 0}function Lpe(o,s,i){o.scrollLeft+=s,o.scrollTop+=i}function Vpe(o){var s=window.Polymer,i=window.jQuery||window.Zepto;return s&&s.dom?s.dom(o).cloneNode(!0):i?i(o).clone(!0)[0]:o.cloneNode(!0)}function Hpe(o,s,i){var u={};return Array.from(o.children).forEach(function(m){var h,b,C,x;if(!(!$h(m,s.draggable,o,!1)||m.animated||m===i)){var _=Wc(m);u.left=Math.min((h=u.left)!==null&&h!==void 0?h:1/0,_.left),u.top=Math.min((b=u.top)!==null&&b!==void 0?b:1/0,_.top),u.right=Math.max((C=u.right)!==null&&C!==void 0?C:-1/0,_.right),u.bottom=Math.max((x=u.bottom)!==null&&x!==void 0?x:-1/0,_.bottom)}}),u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}var yp="Sortable"+new Date().getTime();function Jze(){var o=[],s;return{captureAnimationState:function(){if(o=[],!!this.options.animation){var i=[].slice.call(this.el.children);i.forEach(function(u){if(!(Qs(u,"display")==="none"||u===er.ghost)){o.push({target:u,rect:Wc(u)});var m=Bv({},o[o.length-1].rect);if(u.thisAnimationDuration){var h=a4(u,!0);h&&(m.top-=h.f,m.left-=h.e)}u.fromRect=m}})}},addAnimationState:function(i){o.push(i)},removeAnimationState:function(i){o.splice(Yze(o,{target:i}),1)},animateAll:function(i){var u=this;if(!this.options.animation){clearTimeout(s),typeof i=="function"&&i();return}var m=!1,h=0;o.forEach(function(b){var C=0,x=b.target,_=x.fromRect,N=Wc(x),O=x.prevFromRect,B=x.prevToRect,F=b.rect,Z=a4(x,!0);Z&&(N.top-=Z.f,N.left-=Z.e),x.toRect=N,x.thisAnimationDuration&&kte(O,N)&&!kte(_,N)&&(F.top-N.top)/(F.left-N.left)===(_.top-N.top)/(_.left-N.left)&&(C=eUe(F,O,B,u.options)),kte(N,_)||(x.prevFromRect=_,x.prevToRect=N,C||(C=u.options.animation),u.animate(x,F,N,C)),C&&(m=!0,h=Math.max(h,C),clearTimeout(x.animationResetTimer),x.animationResetTimer=setTimeout(function(){x.animationTime=0,x.prevFromRect=null,x.fromRect=null,x.prevToRect=null,x.thisAnimationDuration=null},C),x.thisAnimationDuration=C)}),clearTimeout(s),m?s=setTimeout(function(){typeof i=="function"&&i()},h):typeof i=="function"&&i(),o=[]},animate:function(i,u,m,h){if(h){Qs(i,"transition",""),Qs(i,"transform","");var b=a4(this.el),C=b&&b.a,x=b&&b.d,_=(u.left-m.left)/(C||1),N=(u.top-m.top)/(x||1);i.animatingX=!!_,i.animatingY=!!N,Qs(i,"transform","translate3d("+_+"px,"+N+"px,0)"),this.forRepaintDummy=Qze(i),Qs(i,"transition","transform "+h+"ms"+(this.options.easing?" "+this.options.easing:"")),Qs(i,"transform","translate3d(0,0,0)"),typeof i.animated=="number"&&clearTimeout(i.animated),i.animated=setTimeout(function(){Qs(i,"transition",""),Qs(i,"transform",""),i.animated=!1,i.animatingX=!1,i.animatingY=!1},h)}}}}function Qze(o){return o.offsetWidth}function eUe(o,s,i,u){return Math.sqrt(Math.pow(s.top-o.top,2)+Math.pow(s.left-o.left,2))/Math.sqrt(Math.pow(s.top-i.top,2)+Math.pow(s.left-i.left,2))*u.animation}var UA=[],Tte={initializeByDefault:!0},$R={mount:function(o){for(var s in Tte)Tte.hasOwnProperty(s)&&!(s in o)&&(o[s]=Tte[s]);UA.forEach(function(i){if(i.pluginName===o.pluginName)throw"Sortable: Cannot mount plugin ".concat(o.pluginName," more than once")}),UA.push(o)},pluginEvent:function(o,s,i){var u=this;this.eventCanceled=!1,i.cancel=function(){u.eventCanceled=!0};var m=o+"Global";UA.forEach(function(h){s[h.pluginName]&&(s[h.pluginName][m]&&s[h.pluginName][m](Bv({sortable:s},i)),s.options[h.pluginName]&&s[h.pluginName][o]&&s[h.pluginName][o](Bv({sortable:s},i)))})},initializePlugins:function(o,s,i,u){UA.forEach(function(b){var C=b.pluginName;if(!(!o.options[C]&&!b.initializeByDefault)){var x=new b(o,s,o.options);x.sortable=o,x.options=o.options,o[C]=x,H0(i,x.defaults)}});for(var m in o.options)if(o.options.hasOwnProperty(m)){var h=this.modifyOption(o,m,o.options[m]);typeof h<"u"&&(o.options[m]=h)}},getEventProperties:function(o,s){var i={};return UA.forEach(function(u){typeof u.eventProperties=="function"&&H0(i,u.eventProperties.call(s[u.pluginName],o))}),i},modifyOption:function(o,s,i){var u;return UA.forEach(function(m){o[m.pluginName]&&m.optionListeners&&typeof m.optionListeners[s]=="function"&&(u=m.optionListeners[s].call(o[m.pluginName],i))}),u}};function tUe(o){var s=o.sortable,i=o.rootEl,u=o.name,m=o.targetEl,h=o.cloneEl,b=o.toEl,C=o.fromEl,x=o.oldIndex,_=o.newIndex,N=o.oldDraggableIndex,O=o.newDraggableIndex,B=o.originalEvent,F=o.putSortable,Z=o.extraEventProperties;if(s=s||i&&i[yp],!!s){var K,X=s.options,q="on"+u.charAt(0).toUpperCase()+u.substr(1);window.CustomEvent&&!Z0&&!OR?K=new CustomEvent(u,{bubbles:!0,cancelable:!0}):(K=document.createEvent("Event"),K.initEvent(u,!0,!0)),K.to=b||i,K.from=C||i,K.item=m||i,K.clone=h,K.oldIndex=x,K.newIndex=_,K.oldDraggableIndex=N,K.newDraggableIndex=O,K.originalEvent=B,K.pullMode=F?F.lastPutMode:void 0;var W=Bv(Bv({},Z),$R.getEventProperties(u,s));for(var H in W)K[H]=W[H];i&&i.dispatchEvent(K),X[q]&&X[q].call(s,K)}}var nUe=["evt"],Sm=function(o,s){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=i.evt,m=Zze(i,nUe);$R.pluginEvent.bind(er)(o,s,Bv({dragEl:Fo,parentEl:sc,ghostEl:pr,rootEl:xl,nextEl:rE,lastDownEl:tz,cloneEl:Pl,cloneHidden:u2,dragStarted:IM,putSortable:dd,activeSortable:er.active,originalEvent:u,oldIndex:XA,oldDraggableIndex:GM,newIndex:bp,newDraggableIndex:l2,hideGhostForTarget:Wpe,unhideGhostForTarget:Zpe,cloneNowHidden:function(){u2=!0},cloneNowShown:function(){u2=!1},dispatchSortableEvent:function(h){If({sortable:s,name:h,originalEvent:u})}},m))};function If(o){tUe(Bv({putSortable:dd,cloneEl:Pl,targetEl:Fo,rootEl:xl,oldIndex:XA,oldDraggableIndex:GM,newIndex:bp,newDraggableIndex:l2},o))}var Fo,sc,pr,xl,rE,tz,Pl,u2,XA,bp,GM,l2,IH,dd,GA=!1,Lz=!1,Vz=[],nE,Oh,Ate,Nte,yce,wce,IM,jA,qM,YM=!1,PH=!1,nz,Kd,Ote=[],Nne=!1,Hz=[],zU=typeof document<"u",FH=Rpe,Cce=OR||Z0?"cssFloat":"float",oUe=zU&&!Bpe&&!Rpe&&"draggable"in document.createElement("div"),zpe=function(){if(zU){if(Z0)return!1;var o=document.createElement("x");return o.style.cssText="pointer-events:auto",o.style.pointerEvents==="auto"}}(),Upe=function(o,s){var i=Qs(o),u=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),m=h4(o,0,s),h=h4(o,1,s),b=m&&Qs(m),C=h&&Qs(h),x=b&&parseInt(b.marginLeft)+parseInt(b.marginRight)+Wc(m).width,_=C&&parseInt(C.marginLeft)+parseInt(C.marginRight)+Wc(h).width;if(i.display==="flex")return i.flexDirection==="column"||i.flexDirection==="column-reverse"?"vertical":"horizontal";if(i.display==="grid")return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(m&&b.float&&b.float!=="none"){var N=b.float==="left"?"left":"right";return h&&(C.clear==="both"||C.clear===N)?"vertical":"horizontal"}return m&&(b.display==="block"||b.display==="flex"||b.display==="table"||b.display==="grid"||x>=u&&i[Cce]==="none"||h&&i[Cce]==="none"&&x+_>u)?"vertical":"horizontal"},sUe=function(o,s,i){var u=i?o.left:o.top,m=i?o.right:o.bottom,h=i?o.width:o.height,b=i?s.left:s.top,C=i?s.right:s.bottom,x=i?s.width:s.height;return u===b||m===C||u+h/2===b+x/2},rUe=function(o,s){var i;return Vz.some(function(u){var m=u[yp].options.emptyInsertThreshold;if(!(!m||zoe(u))){var h=Wc(u),b=o>=h.left-m&&o<=h.right+m,C=s>=h.top-m&&s<=h.bottom+m;if(b&&C)return i=u}}),i},jpe=function(o){function s(m,h){return function(b,C,x,_){var N=b.options.group.name&&C.options.group.name&&b.options.group.name===C.options.group.name;if(m==null&&(h||N))return!0;if(m==null||m===!1)return!1;if(h&&m==="clone")return m;if(typeof m=="function")return s(m(b,C,x,_),h)(b,C,x,_);var O=(h?b:C).options.group.name;return m===!0||typeof m=="string"&&m===O||m.join&&m.indexOf(O)>-1}}var i={},u=o.group;(!u||ez(u)!="object")&&(u={name:u}),i.name=u.name,i.checkPull=s(u.pull,!0),i.checkPut=s(u.put),i.revertClone=u.revertClone,o.group=i},Wpe=function(){!zpe&&pr&&Qs(pr,"display","none")},Zpe=function(){!zpe&&pr&&Qs(pr,"display","")};zU&&!Bpe&&document.addEventListener("click",function(o){if(Lz)return o.preventDefault(),o.stopPropagation&&o.stopPropagation(),o.stopImmediatePropagation&&o.stopImmediatePropagation(),Lz=!1,!1},!0);var oE=function(o){if(Fo){o=o.touches?o.touches[0]:o;var s=rUe(o.clientX,o.clientY);if(s){var i={};for(var u in o)o.hasOwnProperty(u)&&(i[u]=o[u]);i.target=i.rootEl=s,i.preventDefault=void 0,i.stopPropagation=void 0,s[yp]._onDragOver(i)}}},aUe=function(o){Fo&&Fo.parentNode[yp]._isOutsideThisEl(o.target)};function er(o,s){if(!(o&&o.nodeType&&o.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(o));this.el=o,this.options=s=H0({},s),o[yp]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(o.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Upe(o,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(h,b){h.setData("Text",b.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:er.supportPointer!==!1&&"PointerEvent"in window&&!WM,emptyInsertThreshold:5};$R.initializePlugins(this,o,i);for(var u in i)!(u in s)&&(s[u]=i[u]);jpe(s);for(var m in this)m.charAt(0)==="_"&&typeof this[m]=="function"&&(this[m]=this[m].bind(this));this.nativeDraggable=s.forceFallback?!1:oUe,this.nativeDraggable&&(this.options.touchStartThreshold=1),s.supportPointer?Va(o,"pointerdown",this._onTapStart):(Va(o,"mousedown",this._onTapStart),Va(o,"touchstart",this._onTapStart)),this.nativeDraggable&&(Va(o,"dragover",this),Va(o,"dragenter",this)),Vz.push(this.el),s.store&&s.store.get&&this.sort(s.store.get(this)||[]),H0(this,Jze())}er.prototype={constructor:er,_isOutsideThisEl:function(o){!this.el.contains(o)&&o!==this.el&&(jA=null)},_getDirection:function(o,s){return typeof this.options.direction=="function"?this.options.direction.call(this,o,s,Fo):this.options.direction},_onTapStart:function(o){if(o.cancelable){var s=this,i=this.el,u=this.options,m=u.preventOnFilter,h=o.type,b=o.touches&&o.touches[0]||o.pointerType&&o.pointerType==="touch"&&o,C=(b||o).target,x=o.target.shadowRoot&&(o.path&&o.path[0]||o.composedPath&&o.composedPath()[0])||C,_=u.filter;if(pUe(i),!Fo&&!(/mousedown|pointerdown/.test(h)&&o.button!==0||u.disabled)&&!x.isContentEditable&&!(!this.nativeDraggable&&WM&&C&&C.tagName.toUpperCase()==="SELECT")&&(C=$h(C,u.draggable,i,!1),!(C&&C.animated)&&tz!==C)){if(XA=xg(C),GM=xg(C,u.draggable),typeof _=="function"){if(_.call(this,o,C,this)){If({sortable:s,rootEl:x,name:"filter",targetEl:C,toEl:i,fromEl:i}),Sm("filter",s,{evt:o}),m&&o.cancelable&&o.preventDefault();return}}else if(_&&(_=_.split(",").some(function(N){if(N=$h(x,N.trim(),i,!1),N)return If({sortable:s,rootEl:N,name:"filter",targetEl:C,fromEl:i,toEl:i}),Sm("filter",s,{evt:o}),!0}),_)){m&&o.cancelable&&o.preventDefault();return}u.handle&&!$h(x,u.handle,i,!1)||this._prepareDragStart(o,b,C)}}},_prepareDragStart:function(o,s,i){var u=this,m=u.el,h=u.options,b=m.ownerDocument,C;if(i&&!Fo&&i.parentNode===m){var x=Wc(i);if(xl=m,Fo=i,sc=Fo.parentNode,rE=Fo.nextSibling,tz=i,IH=h.group,er.dragged=Fo,nE={target:Fo,clientX:(s||o).clientX,clientY:(s||o).clientY},yce=nE.clientX-x.left,wce=nE.clientY-x.top,this._lastX=(s||o).clientX,this._lastY=(s||o).clientY,Fo.style["will-change"]="all",C=function(){if(Sm("delayEnded",u,{evt:o}),er.eventCanceled){u._onDrop();return}u._disableDelayedDragEvents(),!gce&&u.nativeDraggable&&(Fo.draggable=!0),u._triggerDragStart(o,s),If({sortable:u,name:"choose",originalEvent:o}),vp(Fo,h.chosenClass,!0)},h.ignore.split(",").forEach(function(_){Ppe(Fo,_.trim(),$te)}),Va(b,"dragover",oE),Va(b,"mousemove",oE),Va(b,"touchmove",oE),Va(b,"mouseup",u._onDrop),Va(b,"touchend",u._onDrop),Va(b,"touchcancel",u._onDrop),gce&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Fo.draggable=!0),Sm("delayStart",this,{evt:o}),h.delay&&(!h.delayOnTouchOnly||s)&&(!this.nativeDraggable||!(OR||Z0))){if(er.eventCanceled){this._onDrop();return}Va(b,"mouseup",u._disableDelayedDrag),Va(b,"touchend",u._disableDelayedDrag),Va(b,"touchcancel",u._disableDelayedDrag),Va(b,"mousemove",u._delayedDragTouchMoveHandler),Va(b,"touchmove",u._delayedDragTouchMoveHandler),h.supportPointer&&Va(b,"pointermove",u._delayedDragTouchMoveHandler),u._dragStartTimer=setTimeout(C,h.delay)}else C()}},_delayedDragTouchMoveHandler:function(o){var s=o.touches?o.touches[0]:o;Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Fo&&$te(Fo),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var o=this.el.ownerDocument;Ta(o,"mouseup",this._disableDelayedDrag),Ta(o,"touchend",this._disableDelayedDrag),Ta(o,"touchcancel",this._disableDelayedDrag),Ta(o,"mousemove",this._delayedDragTouchMoveHandler),Ta(o,"touchmove",this._delayedDragTouchMoveHandler),Ta(o,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(o,s){s=s||o.pointerType=="touch"&&o,!this.nativeDraggable||s?this.options.supportPointer?Va(document,"pointermove",this._onTouchMove):s?Va(document,"touchmove",this._onTouchMove):Va(document,"mousemove",this._onTouchMove):(Va(Fo,"dragend",this),Va(xl,"dragstart",this._onDragStart));try{document.selection?oz(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(o,s){if(GA=!1,xl&&Fo){Sm("dragStarted",this,{evt:s}),this.nativeDraggable&&Va(document,"dragover",aUe);var i=this.options;!o&&vp(Fo,i.dragClass,!1),vp(Fo,i.ghostClass,!0),er.active=this,o&&this._appendGhost(),If({sortable:this,name:"start",originalEvent:s})}else this._nulling()},_emulateDragOver:function(){if(Oh){this._lastX=Oh.clientX,this._lastY=Oh.clientY,Wpe();for(var o=document.elementFromPoint(Oh.clientX,Oh.clientY),s=o;o&&o.shadowRoot&&(o=o.shadowRoot.elementFromPoint(Oh.clientX,Oh.clientY),o!==s);)s=o;if(Fo.parentNode[yp]._isOutsideThisEl(o),s)do{if(s[yp]){var i=void 0;if(i=s[yp]._onDragOver({clientX:Oh.clientX,clientY:Oh.clientY,target:o,rootEl:s}),i&&!this.options.dragoverBubble)break}o=s}while(s=s.parentNode);Zpe()}},_onTouchMove:function(o){if(nE){var s=this.options,i=s.fallbackTolerance,u=s.fallbackOffset,m=o.touches?o.touches[0]:o,h=pr&&a4(pr,!0),b=pr&&h&&h.a,C=pr&&h&&h.d,x=FH&&Kd&&bce(Kd),_=(m.clientX-nE.clientX+u.x)/(b||1)+(x?x[0]-Ote[0]:0)/(b||1),N=(m.clientY-nE.clientY+u.y)/(C||1)+(x?x[1]-Ote[1]:0)/(C||1);if(!er.active&&!GA){if(i&&Math.max(Math.abs(m.clientX-this._lastX),Math.abs(m.clientY-this._lastY))<i)return;this._onDragStart(o,!0)}if(pr){h?(h.e+=_-(Ate||0),h.f+=N-(Nte||0)):h={a:1,b:0,c:0,d:1,e:_,f:N};var O="matrix(".concat(h.a,",").concat(h.b,",").concat(h.c,",").concat(h.d,",").concat(h.e,",").concat(h.f,")");Qs(pr,"webkitTransform",O),Qs(pr,"mozTransform",O),Qs(pr,"msTransform",O),Qs(pr,"transform",O),Ate=_,Nte=N,Oh=m}o.cancelable&&o.preventDefault()}},_appendGhost:function(){if(!pr){var o=this.options.fallbackOnBody?document.body:xl,s=Wc(Fo,!0,FH,!0,o),i=this.options;if(FH){for(Kd=o;Qs(Kd,"position")==="static"&&Qs(Kd,"transform")==="none"&&Kd!==document;)Kd=Kd.parentNode;Kd!==document.body&&Kd!==document.documentElement?(Kd===document&&(Kd=Mv()),s.top+=Kd.scrollTop,s.left+=Kd.scrollLeft):Kd=Mv(),Ote=bce(Kd)}pr=Fo.cloneNode(!0),vp(pr,i.ghostClass,!1),vp(pr,i.fallbackClass,!0),vp(pr,i.dragClass,!0),Qs(pr,"transition",""),Qs(pr,"transform",""),Qs(pr,"box-sizing","border-box"),Qs(pr,"margin",0),Qs(pr,"top",s.top),Qs(pr,"left",s.left),Qs(pr,"width",s.width),Qs(pr,"height",s.height),Qs(pr,"opacity","0.8"),Qs(pr,"position",FH?"absolute":"fixed"),Qs(pr,"zIndex","100000"),Qs(pr,"pointerEvents","none"),er.ghost=pr,o.appendChild(pr),Qs(pr,"transform-origin",yce/parseInt(pr.style.width)*100+"% "+wce/parseInt(pr.style.height)*100+"%")}},_onDragStart:function(o,s){var i=this,u=o.dataTransfer,m=i.options;if(Sm("dragStart",this,{evt:o}),er.eventCanceled){this._onDrop();return}Sm("setupClone",this),er.eventCanceled||(Pl=Vpe(Fo),Pl.removeAttribute("id"),Pl.draggable=!1,Pl.style["will-change"]="",this._hideClone(),vp(Pl,this.options.chosenClass,!1),er.clone=Pl),i.cloneId=oz(function(){Sm("clone",i),!er.eventCanceled&&(i.options.removeCloneOnHide||xl.insertBefore(Pl,Fo),i._hideClone(),If({sortable:i,name:"clone"}))}),!s&&vp(Fo,m.dragClass,!0),s?(Lz=!0,i._loopId=setInterval(i._emulateDragOver,50)):(Ta(document,"mouseup",i._onDrop),Ta(document,"touchend",i._onDrop),Ta(document,"touchcancel",i._onDrop),u&&(u.effectAllowed="move",m.setData&&m.setData.call(i,u,Fo)),Va(document,"drop",i),Qs(Fo,"transform","translateZ(0)")),GA=!0,i._dragStartId=oz(i._dragStarted.bind(i,s,o)),Va(document,"selectstart",i),IM=!0,WM&&Qs(document.body,"user-select","none")},_onDragOver:function(o){var s=this.el,i=o.target,u,m,h,b=this.options,C=b.group,x=er.active,_=IH===C,N=b.sort,O=dd||x,B,F=this,Z=!1;if(Nne)return;function K(Ue,be){Sm(Ue,F,Bv({evt:o,isOwner:_,axis:B?"vertical":"horizontal",revert:h,dragRect:u,targetRect:m,canSort:N,fromSortable:O,target:i,completed:q,onMove:function(ot,nt){return LH(xl,s,Fo,u,ot,Wc(ot),o,nt)},changed:W},be))}function X(){K("dragOverAnimationCapture"),F.captureAnimationState(),F!==O&&O.captureAnimationState()}function q(Ue){return K("dragOverCompleted",{insertion:Ue}),Ue&&(_?x._hideClone():x._showClone(F),F!==O&&(vp(Fo,dd?dd.options.ghostClass:x.options.ghostClass,!1),vp(Fo,b.ghostClass,!0)),dd!==F&&F!==er.active?dd=F:F===er.active&&dd&&(dd=null),O===F&&(F._ignoreWhileAnimating=i),F.animateAll(function(){K("dragOverAnimationComplete"),F._ignoreWhileAnimating=null}),F!==O&&(O.animateAll(),O._ignoreWhileAnimating=null)),(i===Fo&&!Fo.animated||i===s&&!i.animated)&&(jA=null),!b.dragoverBubble&&!o.rootEl&&i!==document&&(Fo.parentNode[yp]._isOutsideThisEl(o.target),!Ue&&oE(o)),!b.dragoverBubble&&o.stopPropagation&&o.stopPropagation(),Z=!0}function W(){bp=xg(Fo),l2=xg(Fo,b.draggable),If({sortable:F,name:"change",toEl:s,newIndex:bp,newDraggableIndex:l2,originalEvent:o})}if(o.preventDefault!==void 0&&o.cancelable&&o.preventDefault(),i=$h(i,b.draggable,s,!0),K("dragOver"),er.eventCanceled)return Z;if(Fo.contains(o.target)||i.animated&&i.animatingX&&i.animatingY||F._ignoreWhileAnimating===i)return q(!1);if(Lz=!1,x&&!b.disabled&&(_?N||(h=sc!==xl):dd===this||(this.lastPutMode=IH.checkPull(this,x,Fo,o))&&C.checkPut(this,x,Fo,o))){if(B=this._getDirection(o,i)==="vertical",u=Wc(Fo),K("dragOverValid"),er.eventCanceled)return Z;if(h)return sc=xl,X(),this._hideClone(),K("revert"),er.eventCanceled||(rE?xl.insertBefore(Fo,rE):xl.appendChild(Fo)),q(!0);var H=zoe(s,b.draggable);if(!H||uUe(o,B,this)&&!H.animated){if(H===Fo)return q(!1);if(H&&s===o.target&&(i=H),i&&(m=Wc(i)),LH(xl,s,Fo,u,i,m,o,!!i)!==!1)return X(),H&&H.nextSibling?s.insertBefore(Fo,H.nextSibling):s.appendChild(Fo),sc=s,W(),q(!0)}else if(H&&cUe(o,B,this)){var me=h4(s,0,b,!0);if(me===Fo)return q(!1);if(i=me,m=Wc(i),LH(xl,s,Fo,u,i,m,o,!1)!==!1)return X(),s.insertBefore(Fo,me),sc=s,W(),q(!0)}else if(i.parentNode===s){m=Wc(i);var et=0,$e,te=Fo.parentNode!==s,We=!sUe(Fo.animated&&Fo.toRect||u,i.animated&&i.toRect||m,B),ft=B?"top":"left",lt=vce(i,"top","top")||vce(Fo,"top","top"),Ne=lt?lt.scrollTop:void 0;jA!==i&&($e=m[ft],YM=!1,PH=!We&&b.invertSwap||te),et=dUe(o,i,m,B,We?1:b.swapThreshold,b.invertedSwapThreshold==null?b.swapThreshold:b.invertedSwapThreshold,PH,jA===i);var ue;if(et!==0){var Pt=xg(Fo);do Pt-=et,ue=sc.children[Pt];while(ue&&(Qs(ue,"display")==="none"||ue===pr))}if(et===0||ue===i)return q(!1);jA=i,qM=et;var ye=i.nextElementSibling,De=!1;De=et===1;var R=LH(xl,s,Fo,u,i,m,o,De);if(R!==!1)return(R===1||R===-1)&&(De=R===1),Nne=!0,setTimeout(lUe,30),X(),De&&!ye?s.appendChild(Fo):i.parentNode.insertBefore(Fo,De?ye:i),lt&&Lpe(lt,0,Ne-lt.scrollTop),sc=Fo.parentNode,$e!==void 0&&!PH&&(nz=Math.abs($e-Wc(i)[ft])),W(),q(!0)}if(s.contains(Fo))return q(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Ta(document,"mousemove",this._onTouchMove),Ta(document,"touchmove",this._onTouchMove),Ta(document,"pointermove",this._onTouchMove),Ta(document,"dragover",oE),Ta(document,"mousemove",oE),Ta(document,"touchmove",oE)},_offUpEvents:function(){var o=this.el.ownerDocument;Ta(o,"mouseup",this._onDrop),Ta(o,"touchend",this._onDrop),Ta(o,"pointerup",this._onDrop),Ta(o,"touchcancel",this._onDrop),Ta(document,"selectstart",this)},_onDrop:function(o){var s=this.el,i=this.options;if(bp=xg(Fo),l2=xg(Fo,i.draggable),Sm("drop",this,{evt:o}),sc=Fo&&Fo.parentNode,bp=xg(Fo),l2=xg(Fo,i.draggable),er.eventCanceled){this._nulling();return}GA=!1,PH=!1,YM=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),One(this.cloneId),One(this._dragStartId),this.nativeDraggable&&(Ta(document,"drop",this),Ta(s,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),WM&&Qs(document.body,"user-select",""),Qs(Fo,"transform",""),o&&(IM&&(o.cancelable&&o.preventDefault(),!i.dropBubble&&o.stopPropagation()),pr&&pr.parentNode&&pr.parentNode.removeChild(pr),(xl===sc||dd&&dd.lastPutMode!=="clone")&&Pl&&Pl.parentNode&&Pl.parentNode.removeChild(Pl),Fo&&(this.nativeDraggable&&Ta(Fo,"dragend",this),$te(Fo),Fo.style["will-change"]="",IM&&!GA&&vp(Fo,dd?dd.options.ghostClass:this.options.ghostClass,!1),vp(Fo,this.options.chosenClass,!1),If({sortable:this,name:"unchoose",toEl:sc,newIndex:null,newDraggableIndex:null,originalEvent:o}),xl!==sc?(bp>=0&&(If({rootEl:sc,name:"add",toEl:sc,fromEl:xl,originalEvent:o}),If({sortable:this,name:"remove",toEl:sc,originalEvent:o}),If({rootEl:sc,name:"sort",toEl:sc,fromEl:xl,originalEvent:o}),If({sortable:this,name:"sort",toEl:sc,originalEvent:o})),dd&&dd.save()):bp!==XA&&bp>=0&&(If({sortable:this,name:"update",toEl:sc,originalEvent:o}),If({sortable:this,name:"sort",toEl:sc,originalEvent:o})),er.active&&((bp==null||bp===-1)&&(bp=XA,l2=GM),If({sortable:this,name:"end",toEl:sc,originalEvent:o}),this.save()))),this._nulling()},_nulling:function(){Sm("nulling",this),xl=Fo=sc=pr=rE=Pl=tz=u2=nE=Oh=IM=bp=l2=XA=GM=jA=qM=dd=IH=er.dragged=er.ghost=er.clone=er.active=null,Hz.forEach(function(o){o.checked=!0}),Hz.length=Ate=Nte=0},handleEvent:function(o){switch(o.type){case"drop":case"dragend":this._onDrop(o);break;case"dragenter":case"dragover":Fo&&(this._onDragOver(o),iUe(o));break;case"selectstart":o.preventDefault();break}},toArray:function(){for(var o=[],s,i=this.el.children,u=0,m=i.length,h=this.options;u<m;u++)s=i[u],$h(s,h.draggable,this.el,!1)&&o.push(s.getAttribute(h.dataIdAttr)||mUe(s));return o},sort:function(o,s){var i={},u=this.el;this.toArray().forEach(function(m,h){var b=u.children[h];$h(b,this.options.draggable,u,!1)&&(i[m]=b)},this),s&&this.captureAnimationState(),o.forEach(function(m){i[m]&&(u.removeChild(i[m]),u.appendChild(i[m]))}),s&&this.animateAll()},save:function(){var o=this.options.store;o&&o.set&&o.set(this)},closest:function(o,s){return $h(o,s||this.options.draggable,this.el,!1)},option:function(o,s){var i=this.options;if(s===void 0)return i[o];var u=$R.modifyOption(this,o,s);typeof u<"u"?i[o]=u:i[o]=s,o==="group"&&jpe(i)},destroy:function(){Sm("destroy",this);var o=this.el;o[yp]=null,Ta(o,"mousedown",this._onTapStart),Ta(o,"touchstart",this._onTapStart),Ta(o,"pointerdown",this._onTapStart),this.nativeDraggable&&(Ta(o,"dragover",this),Ta(o,"dragenter",this)),Array.prototype.forEach.call(o.querySelectorAll("[draggable]"),function(s){s.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Vz.splice(Vz.indexOf(this.el),1),this.el=o=null},_hideClone:function(){if(!u2){if(Sm("hideClone",this),er.eventCanceled)return;Qs(Pl,"display","none"),this.options.removeCloneOnHide&&Pl.parentNode&&Pl.parentNode.removeChild(Pl),u2=!0}},_showClone:function(o){if(o.lastPutMode!=="clone"){this._hideClone();return}if(u2){if(Sm("showClone",this),er.eventCanceled)return;Fo.parentNode==xl&&!this.options.group.revertClone?xl.insertBefore(Pl,Fo):rE?xl.insertBefore(Pl,rE):xl.appendChild(Pl),this.options.group.revertClone&&this.animate(Fo,Pl),Qs(Pl,"display",""),u2=!1}}};function iUe(o){o.dataTransfer&&(o.dataTransfer.dropEffect="move"),o.cancelable&&o.preventDefault()}function LH(o,s,i,u,m,h,b,C){var x,_=o[yp],N=_.options.onMove,O;return window.CustomEvent&&!Z0&&!OR?x=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(x=document.createEvent("Event"),x.initEvent("move",!0,!0)),x.to=s,x.from=o,x.dragged=i,x.draggedRect=u,x.related=m||s,x.relatedRect=h||Wc(s),x.willInsertAfter=C,x.originalEvent=b,o.dispatchEvent(x),N&&(O=N.call(_,x,b)),O}function $te(o){o.draggable=!1}function lUe(){Nne=!1}function cUe(o,s,i){var u=Wc(h4(i.el,0,i.options,!0)),m=Hpe(i.el,i.options,pr),h=10;return s?o.clientX<m.left-h||o.clientY<u.top&&o.clientX<u.right:o.clientY<m.top-h||o.clientY<u.bottom&&o.clientX<u.left}function uUe(o,s,i){var u=Wc(zoe(i.el,i.options.draggable)),m=Hpe(i.el,i.options,pr),h=10;return s?o.clientX>m.right+h||o.clientY>u.bottom&&o.clientX>u.left:o.clientY>m.bottom+h||o.clientX>u.right&&o.clientY>u.top}function dUe(o,s,i,u,m,h,b,C){var x=u?o.clientY:o.clientX,_=u?i.height:i.width,N=u?i.top:i.left,O=u?i.bottom:i.right,B=!1;if(!b){if(C&&nz<_*m){if(!YM&&(qM===1?x>N+_*h/2:x<O-_*h/2)&&(YM=!0),YM)B=!0;else if(qM===1?x<N+nz:x>O-nz)return-qM}else if(x>N+_*(1-m)/2&&x<O-_*(1-m)/2)return fUe(s)}return B=B||b,B&&(x<N+_*h/2||x>O-_*h/2)?x>N+_/2?1:-1:0}function fUe(o){return xg(Fo)<xg(o)?1:-1}function mUe(o){for(var s=o.tagName+o.className+o.src+o.href+o.textContent,i=s.length,u=0;i--;)u+=s.charCodeAt(i);return u.toString(36)}function pUe(o){Hz.length=0;for(var s=o.getElementsByTagName("input"),i=s.length;i--;){var u=s[i];u.checked&&Hz.push(u)}}function oz(o){return setTimeout(o,0)}function One(o){return clearTimeout(o)}zU&&Va(document,"touchmove",function(o){(er.active||GA)&&o.cancelable&&o.preventDefault()});er.utils={on:Va,off:Ta,css:Qs,find:Ppe,is:function(o,s){return!!$h(o,s,o,!1)},extend:Kze,throttle:Fpe,closest:$h,toggleClass:vp,clone:Vpe,index:xg,nextTick:oz,cancelNextTick:One,detectDirection:Upe,getChild:h4};er.get=function(o){return o[yp]};er.mount=function(){for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];s[0].constructor===Array&&(s=s[0]),s.forEach(function(u){if(!u.prototype||!u.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(u));u.utils&&(er.utils=Bv(Bv({},er.utils),u.utils)),$R.mount(u)})};er.create=function(o,s){return new er(o,s)};er.version=Gze;var Uc=[],PM,$ne,Dne=!1,Dte,Mte,zz,FM;function gUe(){function o(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this))}return o.prototype={dragStarted:function(s){var i=s.originalEvent;this.sortable.nativeDraggable?Va(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Va(document,"pointermove",this._handleFallbackAutoScroll):i.touches?Va(document,"touchmove",this._handleFallbackAutoScroll):Va(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(s){var i=s.originalEvent;!this.options.dragOverBubble&&!i.rootEl&&this._handleAutoScroll(i)},drop:function(){this.sortable.nativeDraggable?Ta(document,"dragover",this._handleAutoScroll):(Ta(document,"pointermove",this._handleFallbackAutoScroll),Ta(document,"touchmove",this._handleFallbackAutoScroll),Ta(document,"mousemove",this._handleFallbackAutoScroll)),Sce(),sz(),Xze()},nulling:function(){zz=$ne=PM=Dne=FM=Dte=Mte=null,Uc.length=0},_handleFallbackAutoScroll:function(s){this._handleAutoScroll(s,!0)},_handleAutoScroll:function(s,i){var u=this,m=(s.touches?s.touches[0]:s).clientX,h=(s.touches?s.touches[0]:s).clientY,b=document.elementFromPoint(m,h);if(zz=s,i||this.options.forceAutoScrollFallback||OR||Z0||WM){Rte(s,this.options,b,i);var C=f2(b,!0);Dne&&(!FM||m!==Dte||h!==Mte)&&(FM&&Sce(),FM=setInterval(function(){var x=f2(document.elementFromPoint(m,h),!0);x!==C&&(C=x,sz()),Rte(s,u.options,x,i)},10),Dte=m,Mte=h)}else{if(!this.options.bubbleScroll||f2(b,!0)===Mv()){sz();return}Rte(s,this.options,f2(b,!1),!1)}}},H0(o,{pluginName:"scroll",initializeByDefault:!0})}function sz(){Uc.forEach(function(o){clearInterval(o.pid)}),Uc=[]}function Sce(){clearInterval(FM)}var Rte=Fpe(function(o,s,i,u){if(s.scroll){var m=(o.touches?o.touches[0]:o).clientX,h=(o.touches?o.touches[0]:o).clientY,b=s.scrollSensitivity,C=s.scrollSpeed,x=Mv(),_=!1,N;$ne!==i&&($ne=i,sz(),PM=s.scroll,N=s.scrollFn,PM===!0&&(PM=f2(i,!0)));var O=0,B=PM;do{var F=B,Z=Wc(F),K=Z.top,X=Z.bottom,q=Z.left,W=Z.right,H=Z.width,me=Z.height,et=void 0,$e=void 0,te=F.scrollWidth,We=F.scrollHeight,ft=Qs(F),lt=F.scrollLeft,Ne=F.scrollTop;F===x?(et=H<te&&(ft.overflowX==="auto"||ft.overflowX==="scroll"||ft.overflowX==="visible"),$e=me<We&&(ft.overflowY==="auto"||ft.overflowY==="scroll"||ft.overflowY==="visible")):(et=H<te&&(ft.overflowX==="auto"||ft.overflowX==="scroll"),$e=me<We&&(ft.overflowY==="auto"||ft.overflowY==="scroll"));var ue=et&&(Math.abs(W-m)<=b&<+H<te)-(Math.abs(q-m)<=b&&!!lt),Pt=$e&&(Math.abs(X-h)<=b&&Ne+me<We)-(Math.abs(K-h)<=b&&!!Ne);if(!Uc[O])for(var ye=0;ye<=O;ye++)Uc[ye]||(Uc[ye]={});(Uc[O].vx!=ue||Uc[O].vy!=Pt||Uc[O].el!==F)&&(Uc[O].el=F,Uc[O].vx=ue,Uc[O].vy=Pt,clearInterval(Uc[O].pid),(ue!=0||Pt!=0)&&(_=!0,Uc[O].pid=setInterval((function(){u&&this.layer===0&&er.active._onTouchMove(zz);var De=Uc[this.layer].vy?Uc[this.layer].vy*C:0,R=Uc[this.layer].vx?Uc[this.layer].vx*C:0;typeof N=="function"&&N.call(er.dragged.parentNode[yp],R,De,o,zz,Uc[this.layer].el)!=="continue"||Lpe(Uc[this.layer].el,R,De)}).bind({layer:O}),24))),O++}while(s.bubbleScroll&&B!==x&&(B=f2(B,!1)));Dne=_}},30),Gpe=function(o){var s=o.originalEvent,i=o.putSortable,u=o.dragEl,m=o.activeSortable,h=o.dispatchSortableEvent,b=o.hideGhostForTarget,C=o.unhideGhostForTarget;if(s){var x=i||m;b();var _=s.changedTouches&&s.changedTouches.length?s.changedTouches[0]:s,N=document.elementFromPoint(_.clientX,_.clientY);C(),x&&!x.el.contains(N)&&(h("spill"),this.onSpill({dragEl:u,putSortable:i}))}};function Uoe(){}Uoe.prototype={startIndex:null,dragStart:function(o){var s=o.oldDraggableIndex;this.startIndex=s},onSpill:function(o){var s=o.dragEl,i=o.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var u=h4(this.sortable.el,this.startIndex,this.options);u?this.sortable.el.insertBefore(s,u):this.sortable.el.appendChild(s),this.sortable.animateAll(),i&&i.animateAll()},drop:Gpe};H0(Uoe,{pluginName:"revertOnSpill"});function joe(){}joe.prototype={onSpill:function(o){var s=o.dragEl,i=o.putSortable,u=i||this.sortable;u.captureAnimationState(),s.parentNode&&s.parentNode.removeChild(s),u.animateAll()},drop:Gpe};H0(joe,{pluginName:"removeOnSpill"});er.mount(new gUe);er.mount(joe,Uoe);function hUe(o){return o==null?o:JSON.parse(JSON.stringify(o))}function vUe(o){f.getCurrentInstance()&&f.onUnmounted(o)}function bUe(o){f.getCurrentInstance()?f.onMounted(o):f.nextTick(o)}let qpe=null,Ype=null;function xce(o=null,s=null){qpe=o,Ype=s}function yUe(){return{data:qpe,clonedData:Ype}}const Ece=Symbol("cloneElement");function wUe(...o){var s,i;const u=(s=f.getCurrentInstance())==null?void 0:s.proxy;let m=null;const h=o[0];let[,b,C]=o;Array.isArray(f.unref(b))||(C=b,b=null);let x=null;const{immediate:_=!0,clone:N=hUe,customUpdate:O}=(i=f.unref(C))!=null?i:{};function B(We){var ft;const{from:lt,oldIndex:Ne,item:ue}=We;m=Array.from(lt.childNodes);const Pt=f.unref((ft=f.unref(b))==null?void 0:ft[Ne]),ye=N(Pt);xce(Pt,ye),ue[Ece]=ye}function F(We){const ft=We.item[Ece];if(!Ize(ft)){if(_te(We.item),f.isRef(b)){const lt=[...f.unref(b)];b.value=dce(lt,We.newDraggableIndex,ft);return}dce(f.unref(b),We.newDraggableIndex,ft)}}function Z(We){const{from:ft,item:lt,oldIndex:Ne,oldDraggableIndex:ue,pullMode:Pt,clone:ye}=We;if(fce(ft,lt,Ne),Pt==="clone"){_te(ye);return}if(f.isRef(b)){const De=[...f.unref(b)];b.value=uce(De,ue);return}uce(f.unref(b),ue)}function K(We){if(O){O(We);return}const{from:ft,item:lt,oldIndex:Ne,oldDraggableIndex:ue,newDraggableIndex:Pt}=We;if(_te(lt),fce(ft,lt,Ne),f.isRef(b)){const ye=[...f.unref(b)];b.value=cce(ye,ue,Pt);return}cce(f.unref(b),ue,Pt)}function X(We){const{newIndex:ft,oldIndex:lt,from:Ne,to:ue}=We;let Pt=null;const ye=ft===lt&&Ne===ue;try{if(ye){let De=null;m==null||m.some((R,Ue)=>{if(De&&(m==null?void 0:m.length)!==ue.childNodes.length)return Ne.insertBefore(De,R.nextSibling),!0;const be=ue.childNodes[Ue];De=ue==null?void 0:ue.replaceChild(R,be)})}}catch(De){Pt=De}finally{m=null}f.nextTick(()=>{if(xce(),Pt)throw Pt})}const q={onUpdate:K,onStart:B,onAdd:F,onRemove:Z,onEnd:X};function W(We){const ft=f.unref(h);return We||(We=Pze(ft)?Fze(ft,u==null?void 0:u.$el):ft),We&&!Hze(We)&&(We=We.$el),We||Mze("Root element not found"),We}function H(){var We;const ft=(We=f.unref(C))!=null?We:{},lt=Dpe(ft,["immediate","clone"]);return mce(lt,(Ne,ue)=>{zze(Ne)&&(lt[Ne]=(Pt,...ye)=>{const De=yUe();return Uze(Pt,De),ue(Pt,...ye)})}),Vze(b===null?{}:q,lt)}const me=We=>{We=W(We),x&&et.destroy(),x=new er(We,H())};f.watch(()=>C,()=>{x&&mce(H(),(We,ft)=>{x==null||x.option(We,ft)})},{deep:!0});const et={option:(We,ft)=>x==null?void 0:x.option(We,ft),destroy:()=>{x==null||x.destroy(),x=null},save:()=>x==null?void 0:x.save(),toArray:()=>x==null?void 0:x.toArray(),closest:(...We)=>x==null?void 0:x.closest(...We)},$e=()=>et==null?void 0:et.option("disabled",!0),te=()=>et==null?void 0:et.option("disabled",!1);return bUe(()=>{_&&me()}),vUe(et.destroy),KA({start:me,pause:$e,resume:te},et)}const Mne=["update","start","add","remove","choose","unchoose","end","sort","filter","clone","move","change"],CUe=["clone","animation","ghostClass","group","sort","disabled","store","handle","draggable","swapThreshold","invertSwap","invertedSwapThreshold","removeCloneOnHide","direction","chosenClass","dragClass","ignore","filter","preventOnFilter","easing","setData","dropBubble","dragoverBubble","dataIdAttr","delay","delayOnTouchOnly","touchStartThreshold","forceFallback","fallbackClass","fallbackOnBody","fallbackTolerance","fallbackOffset","supportPointer","emptyInsertThreshold","scroll","forceAutoScrollFallback","scrollSensitivity","scrollSpeed","bubbleScroll","modelValue","tag","target","customUpdate",...Mne.map(o=>`on${o.replace(/^\S/,s=>s.toUpperCase())}`)],SUe=f.defineComponent({name:"VueDraggable",model:{prop:"modelValue",event:"update:modelValue"},props:CUe,emits:["update:modelValue",...Mne],setup(o,{slots:s,emit:i,expose:u,attrs:m}){const h=Mne.reduce((N,O)=>{const B=`on${O.replace(/^\S/,F=>F.toUpperCase())}`;return N[B]=(...F)=>i(O,...F),N},{}),b=f.computed(()=>{const N=f.toRefs(o),O=Dpe(N,["modelValue"]),B=Object.entries(O).reduce((F,[Z,K])=>{const X=f.unref(K);return X!==void 0&&(F[Z]=X),F},{});return KA(KA({},h),Bze(KA(KA({},m),B)))}),C=f.computed({get:()=>o.modelValue,set:N=>i("update:modelValue",N)}),x=f.ref(),_=f.reactive(wUe(o.target||x,C,b));return u(_),()=>{var N;return f.h(o.tag||"div",{ref:x},(N=s==null?void 0:s.default)==null?void 0:N.call(s,_))}}}),xUe={class:"flex-center gap-x-2"},EUe={class:"flex-center"},Kpe={__name:"index",props:f.mergeModels({isSingle:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{},defaultValue:{},defaultValueModifiers:{}}),emits:["update:modelValue","update:defaultValue"],setup(o){const s=o,i=f.useModel(o,"modelValue"),u=f.useModel(o,"defaultValue"),m=f.ref("");f.watch(m,x=>{const _=x.split(`
|
|
146
146
|
`).filter(Boolean).map((N,O)=>({sort:O+1,label:N.trim(),value:N.trim()}));di(_,i.value)||(i.value=_)}),f.watch(i,x=>{var _;x&&(m.value=(_=x==null?void 0:x.map(N=>N==null?void 0:N.label))==null?void 0:_.join(`
|
|
147
|
-
`))},{immediate:!0});const h=x=>{Nn.ElMessageBox.confirm("确定删除吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{i.value=i.value.filter(_=>(_==null?void 0:_.sort)!==(x==null?void 0:x.sort)),u.value&&u.value.some(_=>_.value===x.value)&&(u.value=u.value.filter(_=>_.value!==x.value))})},b=x=>u.value?u.value.some(_=>_===x.sort):!1,C=(x,_)=>{u.value||(u.value=[]),_?s.isSingle?u.value=[x==null?void 0:x.sort]:u.value=[...u.value||[],x==null?void 0:x.sort]:u.value=u.value.filter(N=>N!==x.sort)};return(x,_)=>(f.openBlock(),f.createElementBlock("div",null,[f.createVNode(f.unref(Nn.ElInput),{modelValue:m.value,"onUpdate:modelValue":_[0]||(_[0]=N=>m.value=N),style:{width:"240px"},rows:2,type:"textarea"},null,8,["modelValue"]),_[3]||(_[3]=f.createElementVNode("div",null,"每行一个选择项,显示顺序从上至下",-1)),f.createVNode(f.unref(SUe),{handle:".handle",target:"tbody",modelValue:i.value,"onUpdate:modelValue":_[1]||(_[1]=N=>i.value=N),animation:150},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElTable),{data:i.value,size:"small",border:""},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElTableColumn),{prop:"sort",label:"显示序号",width:"180",align:"center"},{default:f.withCtx(({row:N})=>[f.createElementVNode("div",xUe,[_[2]||(_[2]=f.createElementVNode("div",{class:"i-bi:list-ul text-[16px] cursor-pointer handle"},null,-1)),f.createTextVNode(" "+f.toDisplayString(N==null?void 0:N.sort),1)])]),_:1}),f.createVNode(f.unref(Nn.ElTableColumn),{prop:"label",label:"选项",align:"center"}),f.createVNode(f.unref(Nn.ElTableColumn),{prop:"name",label:"默认选中",width:"110",align:"center"},{default:f.withCtx(({row:N})=>[f.createVNode(f.unref(Nn.ElCheckbox),{"model-value":b(N),onChange:O=>C(N,O)},null,8,["model-value","onChange"])]),_:1}),f.createVNode(f.unref(Nn.ElTableColumn),{prop:"name",label:"操作",align:"center"},{default:f.withCtx(({row:N})=>[f.createElementVNode("div",EUe,[f.createVNode(f.unref(Nn.ElIcon),{size:18,class:"cursor-pointer",onClick:()=>h(N)},{default:f.withCtx(()=>[f.createVNode(f.unref(Nxe))]),_:2},1032,["onClick"])])]),_:1})]),_:1},8,["data"])]),_:1},8,["modelValue"])]))}},_Ue=[{label:"2025年1月1日 0时0分",value:"YYYY年M月D日 h时m分"},{label:"2025-01-01 00:00",value:"YYYY-MM-DD hh:mm"},{label:"2025/01/01 00:00",value:"YYYY/MM/DD hh:mm"},{label:"2025.01.01 00:00",value:"YYYY.MM.DD hh:mm"},{label:"2025年1月1日",value:"YYYY年M月D日"},{label:"2025-01-01",value:"YYYY-MM-DD"},{label:"2025/01/01",value:"YYYY/MM/DD"},{label:"2025.01.01",value:"YYYY.MM.DD"},{label:"2025年1月",value:"YYYY年M月"},{label:"2025-01",value:"YYYY-MM"},{label:"2025.01",value:"YYYY.MM"},{label:"1月1日 0时0分",value:"M月D日 h时m分"},{label:"01-01 00:00",value:"MM-DD hh:mm"},{label:"01.01 00:00",value:"MM.DD hh:mm"},{label:"2025年",value:"YYYY年"},{label:"1月",value:"M月"},{label:"1日",value:"D日"},{label:"年(2025)",value:"YYYY"},{label:"月(1)",value:"M"},{label:"日(1)",value:"D"},{label:"0时0分",value:"h时m分"},{label:"时:分(00:00)",value:"h:m"},{label:"二〇二五年一月一日",value:"ChineseDate"},{label:"星期三",value:"星期dd"}],Xpe={__name:"index",props:f.mergeModels({},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue");return(i,u)=>(f.openBlock(),f.createElementBlock("div",null,[f.createVNode(f.unref(Nn.ElRadioGroup),{modelValue:s.value,"onUpdate:modelValue":u[0]||(u[0]=m=>s.value=m)},{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(_Ue),m=>(f.openBlock(),f.createBlock(f.unref(Nn.ElRadio),{value:m==null?void 0:m.value,class:"w-full"},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(m==null?void 0:m.label),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"])]))}},VH=[{label:"是/否",value:"是/否"},{label:"同意/拒绝",value:"同意/拒绝"},{label:"符合/不符合",value:"符合/不符合"},{label:"通过/未通过",value:"通过/未通过"},{label:"完成/未完成",value:"完成/未完成"},{label:"合格/不合格",value:"合格/不合格"}],kUe={key:0,class:"gap-x-2 flex w-full max-w-[280px] input-box"},TUe={__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue"),i=f.ref(""),u=f.ref({"true-value":"","false-value":""}),m=f.computed(()=>VH==null?void 0:VH.find(h=>{var b,C;return(h==null?void 0:h.label)===`${(b=s.value)==null?void 0:b["true-value"]}/${(C=s.value)==null?void 0:C["false-value"]}`}));return f.watch(i,h=>{var b;if(h){const[C,x]=((b=h==null?void 0:h.split("/"))==null?void 0:b.filter(Boolean))||[];C&&x&&(s.value={"true-value":C,"false-value":x})}else s.value=JSON.parse(JSON.stringify(u.value))}),f.onMounted(()=>{if(m.value)i.value=`${f.toValue(s)["true-value"]}/${f.toValue(s)["false-value"]}`;else try{u.value=JSON.parse(JSON.stringify(s.value))||{}}catch(h){console.log(h)}}),f.watch(u,()=>{if(u.value["true-value"]&&u.value["false-value"])try{s.value=JSON.parse(JSON.stringify(u.value))||{}}catch(h){console.log(h)}},{deep:!0}),(h,b)=>(f.openBlock(),f.createElementBlock("div",null,[f.createVNode(f.unref(Nn.ElRadioGroup),{modelValue:i.value,"onUpdate:modelValue":b[0]||(b[0]=C=>i.value=C),class:"radio-grid"},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElRow),{gutter:8},{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(VH),C=>(f.openBlock(),f.createBlock(f.unref(Nn.ElCol),{key:C==null?void 0:C.value,xs:12,sm:12,md:8,lg:6,xl:4,class:"radio-col"},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElRadio),{value:C==null?void 0:C.value,class:"radio-item"},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(C==null?void 0:C.label),1)]),_:2},1032,["value"])]),_:2},1024))),128)),f.createVNode(f.unref(Nn.ElCol),{xs:12,sm:12,md:8,lg:6,xl:4,class:"radio-col"},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElRadio),{value:"",class:"radio-item"},{default:f.withCtx(()=>b[3]||(b[3]=[f.createTextVNode("自定义")])),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),m.value?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("div",kUe,[f.createVNode(f.unref(Nn.ElInput),{placeholder:"请输入内容",modelValue:u.value["true-value"],"onUpdate:modelValue":b[1]||(b[1]=C=>u.value["true-value"]=C)},{prepend:f.withCtx(()=>b[4]||(b[4]=[f.createTextVNode("是")])),_:1},8,["modelValue"]),f.createVNode(f.unref(Nn.ElInput),{placeholder:"请输入内容",modelValue:u.value["false-value"],"onUpdate:modelValue":b[2]||(b[2]=C=>u.value["false-value"]=C)},{prepend:f.withCtx(()=>b[5]||(b[5]=[f.createTextVNode("否")])),_:1},8,["modelValue"])]))]))}},Jpe=$i(TUe,[["__scopeId","data-v-b58c7782"]]),Qpe=Symbol("userPicker"),DR=()=>{const o=f.inject(Qpe);if(!o)throw new Error("NodesEditor context not found");return o},AUe=f.defineComponent({__name:"provider",props:f.mergeModels({isAbbr:{type:Boolean,default:!0},showCount:{type:Number,default:2},multiple:{type:Boolean,default:!0},disabledIds:{type:Array,default:()=>[]}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=f.useModel(o,"modelValue");return f.provide(Qpe,{modelValue:i,props:s}),(u,m)=>f.renderSlot(u.$slots,"default")}}),wv={userSelector:{},roleByGroup:{}},ege=async(o,s)=>{const i=Date.now();if(wv[o]&&wv[o].timestamp+1e4>i)return wv[o].data;if(wv[o]&&wv[o].isFetching)return await wv[o].promise;wv[o]={isFetching:!0};const u=s().then(m=>(wv[o]={data:m,timestamp:i,isFetching:!1},m)).catch(m=>{throw wv[o].isFetching=!1,m});return wv[o].promise=u,await u},NUe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="userSelector_"+JSON.stringify(o);return await ege(u,()=>i.get(`/ajax/userselectornew?${ef.stringify(o)}`))},OUe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="roleByGroup_"+JSON.stringify(o);return await ege(u,()=>i.get(`/v3role/getByGroup?${ef.stringify(o)}`))},$Ue=o=>{const{params:s,type:i="userIds"}=o,{http:u}=Iv(),m=f.ref(!1),h=f.ref({userlist:[],rolelist:[],grouplist:[],positionlist:[]}),b=async()=>{const C=f.toValue(s)||{},x=(C==null?void 0:C.groupIds)&&f.toValue(i)==="role",_=x?OUe:NUe;m.value=!0,await(_==null?void 0:_(C,u).then(N=>{x?h.value={...h.value,rolelist:N==null?void 0:N.data}:h.value=N==null?void 0:N.data}).finally(()=>{m.value=!1}))};return f.watch(()=>f.toValue(s),(C,x)=>{di(C,x)||b()},{deep:!0,immediate:!0}),{loading:m,refresh:b,allData:h}},T4=o=>{const{params:s,type:i="userIds"}=o,u=f.computed(()=>{const{keyword:x,unitId:_,groupIds:N}=f.toValue(s)||{};let O={keyword:x,unitId:_};return i==="roleIds"&&(O={...O,groupIds:N}),O=y2(O),O}),{loading:m,refresh:h,allData:b}=$Ue({params:u,type:i}),C=f.computed(()=>{var F,Z,K,X,q;let x=[];const{groupIds:_,roleIds:N}=f.toValue(s)||{},O=(F=_==null?void 0:_.split(","))==null?void 0:F.filter(Boolean),B=(Z=N==null?void 0:N.split(","))==null?void 0:Z.filter(Boolean);switch(f.toValue(i)){case"userIds":x=(K=b.value)==null?void 0:K.userlist,(O==null?void 0:O.length)>0&&(x=x.filter(W=>O.includes((W==null?void 0:W.group_id)+""))),(B==null?void 0:B.length)>0&&(x=x.filter(W=>{var H;return((H=b2(B,W==null?void 0:W.role))==null?void 0:H.length)>0}));break;case"roleIds":x=(X=b.value)==null?void 0:X.rolelist;break;case"groupIds":x=(q=b.value)==null?void 0:q.grouplist;break}return x});return{loading:m,data:C,refresh:h,allData:b}},tge=o=>{const{data:s}=T4({type:"userIds"});return f.computed(()=>{var m,h;const u=f.toValue(o);return!u||(u==null?void 0:u.length)===0?[]:Array.isArray(u)?((h=s.value)==null?void 0:h.filter(b=>u.includes(b.id)))||[]:((m=s.value)==null?void 0:m.filter(b=>b.id===u))||[]})},DUe={class:"h-full flex flex-col pr-2"},MUe={class:"flex py-1 mb-2 items-center justify-between border-0 border-solid border-b-1 border-[#e4e7ed]"},RUe={class:"color-[#333]"},BUe={class:"color-[#909399]"},IUe={class:"flex-grow h-1 overflow-auto"},PUe={class:"flex flex-wrap gap-2"},FUe={class:"color-[#909399]"},LUe=f.defineComponent({__name:"list",props:{modelValue:{default:[]},modelModifiers:{}},emits:["update:modelValue"],setup(o){const{props:s}=DR(),i=s.disabledIds||[],u=f.useModel(o,"modelValue"),m=tge(u),h=x=>i.includes(x==null?void 0:x.id),b=()=>{const x=u.value.filter(_=>i.includes(_));u.value=x},C=x=>{h(x)||(u.value=u.value.filter(_=>_!==(x==null?void 0:x.id)))};return(x,_)=>(f.openBlock(),f.createElementBlock("div",DUe,[f.createElementVNode("div",MUe,[f.createElementVNode("div",RUe,[_[0]||(_[0]=f.createTextVNode(" 已选择 ")),f.createElementVNode("span",BUe,f.toDisplayString(u.value.length),1)]),f.createElementVNode("div",{class:"flex flex-center gap-1 color-[#909399] cursor-pointer",onClick:b},_[1]||(_[1]=[f.createElementVNode("div",{class:"i-bi:eraser"},null,-1),f.createTextVNode(" 清空 ")]))]),f.createElementVNode("div",IUe,[f.createElementVNode("div",PUe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(m),N=>(f.openBlock(),f.createElementBlock("div",{key:N==null?void 0:N.id,class:f.normalizeClass(["flex-center gap-2 px-2 rounded-[4px] bg-[#f5f7fa] hover:bg-[#ebedf0] group",{"opacity-50":h(N)}])},[f.createElementVNode("div",FUe,f.toDisplayString(N==null?void 0:N.name),1),h(N)?f.createCommentVNode("",!0):(f.openBlock(),f.createBlock(f.unref(Nn.ElIcon),{key:0,onClick:O=>C(N),class:"cursor-pointer color-[#C0C4CC] group-hover:color-[#909399]"},{default:f.withCtx(()=>[f.createVNode(f.unref(aoe))]),_:2},1032,["onClick"]))],2))),128))])])]))}}),VUe=o=>{const{allData:s}=T4({type:"userIds"});return f.computed(()=>{var b,C;const u=((b=s.value)==null?void 0:b.grouplist)||[],h=(f.toValue(o)||[]).reduce((x,_)=>{const N=_.group_id;return x[N]||(x[N]=[]),x[N].push({..._}),x},{});return(C=u.map(x=>({...x,children:h[x==null?void 0:x.id]||[]})))==null?void 0:C.filter(x=>{var _;return((_=x==null?void 0:x.children)==null?void 0:_.length)>0})})},HUe={class:"h-full flex flex-col"},zUe={class:"px-2"},UUe={class:"flex-grow h-1 overflow-auto px-2"},jUe={class:"img"},WUe={class:"img text-[12px]"},ZUe={key:3,class:"color-[#C0C4CC]"},GUe=f.defineComponent({__name:"department",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const{props:s}=DR(),i=s.multiple,u=s.disabledIds||[],m=f.ref({keyword:""}),h=f.useModel(o,"modelValue"),{data:b,refresh:C}=T4({params:m,type:"userIds"}),x=VUe(b),_=f.computed(()=>(x.value||[]).map(X=>{var q;return{...X,children:(q=X.children)==null?void 0:q.map(W=>({...W,disabled:u.includes(W.id)}))}})),N=f.ref(null);f.watch(()=>h.value,K=>{N.value&&K&&(i?N.value.setCheckedKeys(K):N.value.setCurrentKey(K))},{deep:!0});const O=f.computed(()=>{var X;let K=[];return(X=_.value)==null||X.forEach(q=>{var W,H;K=[...K,...((H=(W=q==null?void 0:q.children)==null?void 0:W.map(me=>me==null?void 0:me.id))==null?void 0:H.filter(Boolean))||[]]}),K.filter(q=>!u.includes(q))}),B=f.computed({get:()=>{var K,X;return!i||!((K=O.value)!=null&&K.length)||!((X=h.value)!=null&&X.length)?!1:O.value.every(q=>{var W;return q&&((W=h.value)==null?void 0:W.includes(q))})},set:K=>{var X;if(i)if(K){const q=((X=O.value)==null?void 0:X.filter(Boolean))||[],W=[...h.value||[],...q];h.value=[...new Set(W)]}else{const W=(h.value||[]).filter(H=>u.includes(H));h.value=W}}}),F=(K,X)=>{if(!i)return;let q=[];const{checkedNodes:W}=X;W.forEach(et=>{(et==null?void 0:et.type)==="user"&&!(et!=null&&et.disabled)&&q.push(et==null?void 0:et.id)});const me=(h.value||[]).filter(et=>u.includes(et));h.value=[...new Set([...q,...me])]},Z=K=>{!i&&(K==null?void 0:K.type)==="user"&&!(K!=null&&K.disabled)&&(h.value=[K==null?void 0:K.id])};return(K,X)=>{var q;return f.openBlock(),f.createElementBlock("div",HUe,[f.createElementVNode("div",zUe,[f.createVNode(f.unref(Nn.ElForm),{inline:!0,model:m.value,onSubmit:X[1]||(X[1]=f.withModifiers(()=>{},["prevent"]))},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElFormItem),{class:"mb-0"},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElInput),{modelValue:m.value.keyword,"onUpdate:modelValue":X[0]||(X[0]=W=>m.value.keyword=W),placeholder:"请输入关键字",clearable:"",class:"w-[160px]",onKeyup:f.withKeys(f.unref(C),["enter"])},null,8,["modelValue","onKeyup"])]),_:1})]),_:1},8,["model"]),f.unref(i)?(f.openBlock(),f.createBlock(f.unref(Nn.ElCheckbox),{key:0,modelValue:B.value,"onUpdate:modelValue":X[2]||(X[2]=W=>B.value=W),label:"全选",size:"large"},null,8,["modelValue"])):f.createCommentVNode("",!0)]),f.createElementVNode("div",UUe,[f.createVNode(f.unref(Nn.ElTree),{class:"tree-picker",ref_key:"treeRef",ref:N,data:_.value,"show-checkbox":f.unref(i),"show-radio":!f.unref(i),"node-key":"id","highlight-current":"","default-checked-keys":f.unref(i)&&Array.isArray(h.value)?h.value:[],"current-node-key":f.unref(i)||(q=h.value)==null?void 0:q[0],onCheck:F,onNodeClick:Z,props:{label:"name",disabled:"disabled"}},{default:f.withCtx(({node:W,data:H})=>{var me,et;return[f.createElementVNode("div",{class:f.normalizeClass(["flex items-center gap-2",{"opacity-50":H==null?void 0:H.disabled}])},[!f.unref(i)&&(H==null?void 0:H.type)==="user"?(f.openBlock(),f.createBlock(f.unref(Nn.ElRadio),{key:0,"model-value":(me=h.value)==null?void 0:me[0],value:H==null?void 0:H.id,disabled:H==null?void 0:H.disabled,size:"large",class:"mr-0"},null,8,["model-value","value","disabled"])):f.createCommentVNode("",!0),(H==null?void 0:H.type)==="user"?(f.openBlock(),f.createBlock(f.unref(Nn.ElImage),{key:1,src:(H==null?void 0:H.face)||"",class:"face-img"},{error:f.withCtx(()=>[f.createElementVNode("div",jUe,[f.createVNode(f.unref(Nn.ElIcon),{size:"14"},{default:f.withCtx(()=>[f.createVNode(f.unref(wR),{color:"#fff"})]),_:1})])]),_:2},1032,["src"])):(f.openBlock(),f.createBlock(f.unref(Nn.ElImage),{key:2,src:(H==null?void 0:H.face)||"",class:"face-img"},{error:f.withCtx(()=>{var $e;return[f.createElementVNode("div",WUe,f.toDisplayString((($e=H==null?void 0:H.name)==null?void 0:$e.charAt(0))||""),1)]}),_:2},1032,["src"])),f.createElementVNode("span",null,f.toDisplayString(W.label),1),(H==null?void 0:H.type)==="group"?(f.openBlock(),f.createElementBlock("span",ZUe," ("+f.toDisplayString((et=H==null?void 0:H.children)==null?void 0:et.length)+") ",1)):f.createCommentVNode("",!0)],2)]}),_:1},8,["data","show-checkbox","show-radio","default-checked-keys","current-node-key"])])])}}}),qUe=$i(GUe,[["__scopeId","data-v-fd7c4b6c"]]),YUe={class:"h-full flex flex-col"},KUe={class:"px-2"},XUe=["onClick"],JUe={class:"flex items-center gap-2"},QUe={class:"img"},eje=f.defineComponent({__name:"people",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const{props:s}=DR(),i=s.multiple,u=s.disabledIds||[],m=f.ref({keyword:""}),h=f.useModel(o,"modelValue"),{data:b,refresh:C}=T4({params:m,type:"userIds"}),x=O=>u.includes(O==null?void 0:O.id),_=f.computed({get:()=>{var B,F;return!i||!((B=b.value)!=null&&B.length)||!((F=h.value)!=null&&F.length)?!1:b.value.filter(Z=>!x(Z)).every(Z=>{var K;return(Z==null?void 0:Z.id)&&((K=h.value)==null?void 0:K.includes(Z.id))})},set:O=>{var B,F;if(i)if(O){const Z=((F=(B=b.value)==null?void 0:B.filter(X=>!x(X)).map(X=>X==null?void 0:X.id))==null?void 0:F.filter(Boolean))||[],K=[...h.value||[],...Z];h.value=[...new Set(K)]}else{const K=(h.value||[]).filter(X=>u.includes(X));h.value=K}}}),N=O=>{if(O!=null&&O.id&&!x(O))if(i){const B=h.value||[];B.includes(O==null?void 0:O.id)?h.value=B.filter(F=>F!==(O==null?void 0:O.id)):h.value=[...B,O==null?void 0:O.id]}else h.value=[O==null?void 0:O.id]};return(O,B)=>(f.openBlock(),f.createElementBlock("div",YUe,[f.createElementVNode("div",KUe,[f.createVNode(f.unref(Nn.ElForm),{inline:!0,model:m.value,onSubmit:B[1]||(B[1]=f.withModifiers(()=>{},["prevent"]))},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElFormItem),{class:"mb-0"},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElInput),{modelValue:m.value.keyword,"onUpdate:modelValue":B[0]||(B[0]=F=>m.value.keyword=F),placeholder:"请输入关键字",clearable:"",class:"w-[160px]",onKeyup:f.withKeys(f.unref(C),["enter"])},null,8,["modelValue","onKeyup"])]),_:1})]),_:1},8,["model"]),f.unref(i)?(f.openBlock(),f.createBlock(f.unref(Nn.ElCheckbox),{key:0,modelValue:_.value,"onUpdate:modelValue":B[2]||(B[2]=F=>_.value=F),label:"全选",size:"large"},null,8,["modelValue"])):f.createCommentVNode("",!0)]),f.createElementVNode("div",{class:f.normalizeClass(["flex-grow h-1 overflow-auto",{"mt-2":!f.unref(i)}])},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(b),(F,Z)=>{var K,X;return f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["flex items-center justify-between cursor-pointer hover:bg-[#f5f7fa] px-2 rounded-[4px]",{"opacity-50 cursor-not-allowed":x(F)}]),key:Z,onClick:q=>N(F)},[f.createElementVNode("div",JUe,[f.unref(i)?(f.openBlock(),f.createBlock(f.unref(Nn.ElCheckbox),{key:0,"model-value":(K=h.value)==null?void 0:K.includes(F==null?void 0:F.id),disabled:x(F),size:"large"},null,8,["model-value","disabled"])):(f.openBlock(),f.createBlock(f.unref(Nn.ElRadio),{key:1,"model-value":(X=h.value)==null?void 0:X[0],value:F==null?void 0:F.id,disabled:x(F),size:"large",class:"mr-0"},null,8,["model-value","value","disabled"])),f.createVNode(f.unref(Nn.ElImage),{src:F.face||"",class:"face-img"},{error:f.withCtx(()=>[f.createElementVNode("div",QUe,[f.createVNode(f.unref(Nn.ElIcon),{size:"16"},{default:f.withCtx(()=>[f.createVNode(f.unref(wR),{color:"#fff"})]),_:1})])]),_:2},1032,["src"]),f.createElementVNode("div",null,f.toDisplayString(F==null?void 0:F.name),1)])],10,XUe)}),128))],2)]))}}),tje=$i(eje,[["__scopeId","data-v-ac82282f"]]),nje=o=>{const{allData:s}=T4({type:"roleIds"});return f.computed(()=>{var b,C;const u=((b=s.value)==null?void 0:b.rolelist)||[],h=(f.toValue(o)||[]).reduce((x,_)=>((_.role||[]).forEach(O=>{x[O]||(x[O]=[]),x[O].some(F=>F.originalId===_.id)||x[O].push({..._,id:`${O}_${_.id}`,originalId:_.id,type:"user"})}),x),{});return(C=u.map(x=>({...x,type:"role",children:h[x==null?void 0:x.id]||[]})))==null?void 0:C.filter(x=>{var _;return((_=x==null?void 0:x.children)==null?void 0:_.length)>0})})},oje={class:"h-full flex flex-col"},sje={class:"px-2"},rje={class:"flex-grow h-1 overflow-auto px-2"},aje={class:"img"},ije={class:"img text-[12px]"},lje={key:3,class:"color-[#C0C4CC]"},cje=f.defineComponent({__name:"role",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const{props:s}=DR(),i=s.multiple,u=s.disabledIds||[],m=f.ref({keyword:""}),h=f.useModel(o,"modelValue"),{data:b,refresh:C}=T4({params:m,type:"userIds"}),x=nje(b),_=f.computed(()=>(x.value||[]).map(W=>{var H;return{...W,children:(H=W.children)==null?void 0:H.map(me=>({...me,disabled:u.includes(me.originalId)}))}})),N=f.ref(null),O=f.computed(()=>{if(!i)return[];const q=[];return(f.toValue(h)||[]).forEach(H=>{var me;(me=_.value)==null||me.forEach(et=>{var $e;($e=et.children)==null||$e.forEach(te=>{te.originalId===H&&q.push(te.id)})})}),q}),B=f.computed(()=>{var W;if(i||!h.value)return;let q;return(W=_.value)==null||W.forEach(H=>{var me;(me=H.children)==null||me.forEach(et=>{et.originalId===h.value&&(q=et.id)})}),q});f.watch(()=>i?O.value:B.value,q=>{N.value&&(i&&q?N.value.setCheckedKeys(q):!i&&q&&N.value.setCurrentKey(q))},{deep:!0});const F=f.computed(()=>{var W;let q=[];return(W=_.value)==null||W.forEach(H=>{var me,et;q=[...q,...((et=(me=H==null?void 0:H.children)==null?void 0:me.map($e=>$e==null?void 0:$e.originalId))==null?void 0:et.filter(Boolean))||[]]}),q.filter(H=>!u.includes(H))}),Z=f.computed({get:()=>{var q,W;return!i||!((q=F.value)!=null&&q.length)||!((W=h.value)!=null&&W.length)?!1:F.value.every(H=>{var me;return H&&((me=h.value)==null?void 0:me.includes(H))})},set:q=>{var W,H,me;if(i)if(q){const et=((W=F.value)==null?void 0:W.filter(Boolean))||[],$e=[...h.value||[],...et];h.value=[...new Set($e)],(H=N==null?void 0:N.value)==null||H.setCheckedNodes([...new Set($e)])}else{const $e=(h.value||[]).filter(We=>u.includes(We));h.value=$e;const te=[];$e.forEach(We=>{var ft;(ft=x.value)==null||ft.forEach(lt=>{var Ne;(Ne=lt.children)==null||Ne.forEach(ue=>{ue.originalId===We&&te.push(ue.id)})})}),(me=N==null?void 0:N.value)==null||me.setCheckedKeys(te)}}}),K=(q,W)=>{var et,$e;if(!i)return;let H=[...h.value||[]];const{checkedKeys:me}=W;if((q==null?void 0:q.type)==="user"&&!(q!=null&&q.disabled)&&(me!=null&&me.includes(q==null?void 0:q.id)?H.push(q==null?void 0:q.originalId):H=H.filter(te=>te!==(q==null?void 0:q.originalId))),(q==null?void 0:q.type)==="role"){const te=((et=q==null?void 0:q.children)==null?void 0:et.filter(lt=>!lt.disabled).map(lt=>lt==null?void 0:lt.originalId))||[];((($e=q==null?void 0:q.children)==null?void 0:$e.filter(lt=>!lt.disabled).map(lt=>lt==null?void 0:lt.id))||[]).every(lt=>me==null?void 0:me.includes(lt))?H=[...H,...te]:H=H.filter(lt=>!te.includes(lt))}h.value=[...new Set(H)]},X=q=>{!i&&(q==null?void 0:q.type)==="user"&&!(q!=null&&q.disabled)&&(h.value=[q==null?void 0:q.originalId])};return(q,W)=>(f.openBlock(),f.createElementBlock("div",oje,[f.createElementVNode("div",sje,[f.createVNode(f.unref(Nn.ElForm),{inline:!0,model:m.value,onSubmit:W[1]||(W[1]=f.withModifiers(()=>{},["prevent"]))},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElFormItem),{class:"mb-0"},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElInput),{modelValue:m.value.keyword,"onUpdate:modelValue":W[0]||(W[0]=H=>m.value.keyword=H),placeholder:"请输入关键字",clearable:"",class:"w-[160px]",onKeyup:f.withKeys(f.unref(C),["enter"])},null,8,["modelValue","onKeyup"])]),_:1})]),_:1},8,["model"]),f.unref(i)?(f.openBlock(),f.createBlock(f.unref(Nn.ElCheckbox),{key:0,modelValue:Z.value,"onUpdate:modelValue":W[2]||(W[2]=H=>Z.value=H),label:"全选",size:"large"},null,8,["modelValue"])):f.createCommentVNode("",!0)]),f.createElementVNode("div",rje,[f.createVNode(f.unref(Nn.ElTree),{class:"tree-picker",ref_key:"treeRef",ref:N,data:_.value,"show-checkbox":f.unref(i),"show-radio":!f.unref(i),"node-key":"id","highlight-current":"","default-checked-keys":f.unref(i)?O.value:[],"current-node-key":f.unref(i)?void 0:B.value,onCheck:K,onNodeClick:X,props:{label:"name",disabled:"disabled"}},{default:f.withCtx(({node:H,data:me})=>{var et,$e;return[f.createElementVNode("div",{class:f.normalizeClass(["flex items-center gap-2",{"opacity-50":me==null?void 0:me.disabled}])},[!f.unref(i)&&(me==null?void 0:me.type)==="user"?(f.openBlock(),f.createBlock(f.unref(Nn.ElRadio),{key:0,class:"mr-0","model-value":(et=h.value)==null?void 0:et[0],value:me==null?void 0:me.originalId,disabled:me==null?void 0:me.disabled,size:"large"},null,8,["model-value","value","disabled"])):f.createCommentVNode("",!0),(me==null?void 0:me.type)==="user"?(f.openBlock(),f.createBlock(f.unref(Nn.ElImage),{key:1,src:(me==null?void 0:me.face)||"",class:"face-img"},{error:f.withCtx(()=>[f.createElementVNode("div",aje,[f.createVNode(f.unref(Nn.ElIcon),{size:"14"},{default:f.withCtx(()=>[f.createVNode(f.unref(wR),{color:"#fff"})]),_:1})])]),_:2},1032,["src"])):(f.openBlock(),f.createBlock(f.unref(Nn.ElImage),{key:2,src:(me==null?void 0:me.face)||"",class:"face-img"},{error:f.withCtx(()=>{var te;return[f.createElementVNode("div",ije,f.toDisplayString(((te=me==null?void 0:me.name)==null?void 0:te.charAt(0))||""),1)]}),_:2},1032,["src"])),f.createElementVNode("span",null,f.toDisplayString(H.label),1),(me==null?void 0:me.type)==="role"?(f.openBlock(),f.createElementBlock("span",lje," ("+f.toDisplayString(($e=me==null?void 0:me.children)==null?void 0:$e.length)+") ",1)):f.createCommentVNode("",!0)],2)]}),_:1},8,["data","show-checkbox","show-radio","default-checked-keys","current-node-key"])])]))}}),uje=$i(cje,[["__scopeId","data-v-f27c1f24"]]),dje={class:"flex flex-row h-[420px]"},fje={class:"w-[50%] border-0 border-r-1 border-solid border-gray-200"},mje={class:"h-full"},pje={class:"w-[50%] pl-2"},gje={class:"h-full flex flex-col"},hje={class:"flex-grow overflow-auto flex-shrink h-1"},vje={class:"flex justify-between"},bje=f.defineComponent({__name:"index",setup(o,{expose:s}){const{props:i}=DR(),u=i.multiple,m=[{label:"按人员",value:"people"},{label:"按部门",value:"department"},{label:"按岗位",value:"role"}],h=f.ref(!1);let b=null;const C=f.ref([]),x=f.ref("people"),_=()=>{b==null||b(C.value),h.value=!1};return s({show:({data:O,callback:B})=>{h.value=!0,C.value=O,b=B}}),(O,B)=>(f.openBlock(),f.createBlock(f.unref(Nn.ElDialog),{modelValue:h.value,"onUpdate:modelValue":B[6]||(B[6]=F=>h.value=F),class:"picker-dialog",title:"选择人员",width:"860px","append-to-body":!0,"destroy-on-close":!0},{footer:f.withCtx(()=>[f.createElementVNode("div",vje,[B[9]||(B[9]=f.createElementVNode("div",null,null,-1)),f.createElementVNode("div",null,[f.createVNode(f.unref(Nn.ElButton),{onClick:B[5]||(B[5]=F=>h.value=!1)},{default:f.withCtx(()=>B[7]||(B[7]=[f.createTextVNode("取消")])),_:1}),f.createVNode(f.unref(Nn.ElButton),{type:"primary",onClick:_},{default:f.withCtx(()=>B[8]||(B[8]=[f.createTextVNode("确定")])),_:1})])])]),default:f.withCtx(()=>[f.createElementVNode("div",dje,[f.createElementVNode("div",fje,[f.createElementVNode("div",mje,[f.createVNode(LUe,{modelValue:C.value,"onUpdate:modelValue":B[0]||(B[0]=F=>C.value=F),multiple:f.unref(u)},null,8,["modelValue","multiple"])])]),f.createElementVNode("div",pje,[f.createElementVNode("div",gje,[f.createVNode(f.unref(Nn.ElTabs),{modelValue:x.value,"onUpdate:modelValue":B[1]||(B[1]=F=>x.value=F)},{default:f.withCtx(()=>[(f.openBlock(),f.createElementBlock(f.Fragment,null,f.renderList(m,F=>f.createVNode(f.unref(Nn.ElTabPane),{label:F.label,name:F.value,key:F.value},null,8,["label","name"])),64))]),_:1},8,["modelValue"]),f.createElementVNode("div",hje,[x.value==="department"?(f.openBlock(),f.createBlock(qUe,{key:0,modelValue:C.value,"onUpdate:modelValue":B[2]||(B[2]=F=>C.value=F),ref:"groupRef",multiple:f.unref(u)},null,8,["modelValue","multiple"])):f.createCommentVNode("",!0),x.value==="role"?(f.openBlock(),f.createBlock(uje,{key:1,modelValue:C.value,"onUpdate:modelValue":B[3]||(B[3]=F=>C.value=F),ref:"roleRef",multiple:f.unref(u)},null,8,["modelValue","multiple"])):f.createCommentVNode("",!0),x.value==="people"?(f.openBlock(),f.createBlock(tje,{key:2,modelValue:C.value,"onUpdate:modelValue":B[4]||(B[4]=F=>C.value=F),ref:"userRef",multiple:f.unref(u)},null,8,["modelValue","multiple"])):f.createCommentVNode("",!0)])])])])]),_:1},8,["modelValue"]))}}),yje={key:0,class:"inline-block"},wje={class:"color-[#409EFF]"},Woe=f.defineComponent({__name:"userPickerDisplay",props:{value:{type:Array,default:()=>[]},isAbbr:{type:Boolean,default:!0},showCount:{type:Number,default:2}},emits:["click"],setup(o,{emit:s}){const i=s,u=o,m=h=>{var x;return!h||h.length===0?"":h.length<=(u==null?void 0:u.showCount)||!(u!=null&&u.isAbbr)?(x=h==null?void 0:h.map(_=>_==null?void 0:_.name))==null?void 0:x.join(","):`${h.slice(0,u==null?void 0:u.showCount).map(_=>(_==null?void 0:_.name)||"").filter(Boolean).join(",")}`};return(h,b)=>{var C,x,_;return f.openBlock(),f.createElementBlock("div",null,[f.createTextVNode(f.toDisplayString(m(u==null?void 0:u.value))+" ",1),((C=u==null?void 0:u.value)==null?void 0:C.length)>=(u==null?void 0:u.showCount)+1&&(u!=null&&u.isAbbr)?(f.openBlock(),f.createElementBlock("div",yje,[b[1]||(b[1]=f.createTextVNode(" 等 ")),f.createElementVNode("span",wje,f.toDisplayString((x=u==null?void 0:u.value)==null?void 0:x.length),1),b[2]||(b[2]=f.createTextVNode(" 人 "))])):f.createCommentVNode("",!0),f.createVNode(f.unref(Nn.ElButton),{size:"small",class:f.normalizeClass(["align-middle",{"ml-2":(_=u==null?void 0:u.value)==null?void 0:_.length}]),onClick:b[0]||(b[0]=()=>{i("click")})},{default:f.withCtx(()=>b[3]||(b[3]=[f.createTextVNode(" 设置 ")])),_:1},8,["class"])])}}}),nge=f.defineComponent({__name:"index",props:f.mergeModels({isAbbr:{type:Boolean,default:!0},showCount:{type:Number,default:2},multiple:{type:Boolean,default:!0},disabledIds:{type:Array,default:()=>[]}},{modelValue:{},modelModifiers:{}}),emits:f.mergeModels(["ok"],["update:modelValue"]),setup(o,{emit:s}){const i=o,u=f.useModel(o,"modelValue"),m=f.ref(null),h=tge(u),b=s,C=()=>{var _;const x=i.multiple?ll(f.toValue(u)):[ll(f.toValue(u))].filter(Boolean);(_=m.value)==null||_.show({data:x,callback:N=>{i.multiple?u.value=N:u.value=N&&N.length>0?N[0]:"",b("ok",u.value)}})};return(x,_)=>(f.openBlock(),f.createBlock(AUe,f.mergeProps({modelValue:u.value,"onUpdate:modelValue":_[0]||(_[0]=N=>u.value=N)},i),{default:f.withCtx(()=>[f.renderSlot(x.$slots,"default",{value:f.unref(h)||[],selectHandler:C},()=>[f.createVNode(Woe,{value:f.unref(h),onClick:C,isAbbr:i==null?void 0:i.isAbbr,showCount:i==null?void 0:i.showCount},null,8,["value","isAbbr","showCount"])]),f.createVNode(bje,{ref_key:"dialogRef",ref:m},null,512)]),_:3},16,["modelValue"]))}}),Cv={userSelector:{},roleByGroup:{}},oge=async(o,s)=>{const i=Date.now();if(Cv[o]&&Cv[o].timestamp+1e4>i)return Cv[o].data;if(Cv[o]&&Cv[o].isFetching)return await Cv[o].promise;Cv[o]={isFetching:!0};const u=s().then(m=>(Cv[o]={data:m,timestamp:i,isFetching:!1},m)).catch(m=>{throw Cv[o].isFetching=!1,m});return Cv[o].promise=u,await u},Cje=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="userSelector_"+JSON.stringify(o);return await oge(u,()=>i.get(`/ajax/userselectornew?${ef.stringify(o)}`))},Sje=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="roleByGroup_"+JSON.stringify(o);return await oge(u,()=>i.get(`/v3role/getByGroup?${ef.stringify(o)}`))},xje=o=>{const{params:s,type:i="userIds"}=o,{http:u}=Iv(),m=f.ref(!1),h=f.ref({userlist:[],rolelist:[],grouplist:[],positionlist:[]}),b=async()=>{const C=f.toValue(s)||{},x=(C==null?void 0:C.groupIds)&&f.toValue(i)==="role",_=x?Sje:Cje;m.value=!0,await(_==null?void 0:_(C,u).then(N=>{x?h.value={...h.value,rolelist:N==null?void 0:N.data}:h.value=N==null?void 0:N.data}).finally(()=>{m.value=!1}))};return f.watch(()=>f.toValue(s),(C,x)=>{di(C,x)||b()},{deep:!0,immediate:!0}),{loading:m,refresh:b,allData:h}},Eje=o=>{const{params:s,type:i="userIds"}=o,u=f.computed(()=>{const{keyword:x,unitId:_,groupIds:N}=f.toValue(s)||{};let O={keyword:x,unitId:_};return i==="roleIds"&&(O={...O,groupIds:N}),O=y2(O),O}),{loading:m,refresh:h,allData:b}=xje({params:u,type:i}),C=f.computed(()=>{var F,Z,K,X,q;let x=[];const{groupIds:_,roleIds:N}=f.toValue(s)||{},O=(F=_==null?void 0:_.split(","))==null?void 0:F.filter(Boolean),B=(Z=N==null?void 0:N.split(","))==null?void 0:Z.filter(Boolean);switch(f.toValue(i)){case"userIds":x=(K=b.value)==null?void 0:K.userlist,(O==null?void 0:O.length)>0&&(x=x.filter(W=>O.includes((W==null?void 0:W.group_id)+""))),(B==null?void 0:B.length)>0&&(x=x.filter(W=>{var H;return((H=b2(B,W==null?void 0:W.role))==null?void 0:H.length)>0}));break;case"roleIds":x=(X=b.value)==null?void 0:X.rolelist;break;case"groupIds":x=(q=b.value)==null?void 0:q.grouplist;break}return x});return{loading:m,data:C,refresh:h,allData:b}},sge=f.defineComponent({__name:"index",props:f.mergeModels({ariaLabel:{},id:{},size:{},disabled:{type:Boolean},modelValue:{},maxlength:{},minlength:{},type:{},resize:{},autosize:{},autocomplete:{},formatter:{},parser:{},placeholder:{},form:{},readonly:{type:Boolean},clearable:{type:Boolean,default:!0},showPassword:{type:Boolean},showWordLimit:{type:Boolean},suffixIcon:{},prefixIcon:{},containerRole:{},tabindex:{},validateEvent:{type:Boolean},inputStyle:{},autofocus:{type:Boolean},rows:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=f.ref({keyword:""}),i=f.useModel(o,"modelValue"),{data:u,loading:m}=Eje({params:s,type:"userIds"}),h=C=>{s.value.keyword=C},b=o;return console.log(b),(C,x)=>(f.openBlock(),f.createBlock(f.unref(Nn.ElSelect),f.mergeProps({modelValue:i.value,"onUpdate:modelValue":x[0]||(x[0]=_=>i.value=_),filterable:"",remote:"","remote-show-suffix":"","remote-method":h,loading:f.unref(m)},f.mergeProps(C.$attrs,b)),{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(u),_=>(f.openBlock(),f.createBlock(f.unref(Nn.ElOption),{key:_.id,label:_.name,value:_.id},null,8,["label","value"]))),128))]),_:1},16,["modelValue","loading"]))}}),_je=Symbol("userPicker"),kje=f.defineComponent({__name:"provider",props:f.mergeModels({multiple:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue"),i=o;return f.provide(_je,{modelValue:s,multiple:i.multiple}),(u,m)=>f.renderSlot(u.$slots,"default")}}),Sv={userSelector:{},roleByGroup:{}},rge=async(o,s)=>{const i=Date.now();if(Sv[o]&&Sv[o].timestamp+1e4>i)return Sv[o].data;if(Sv[o]&&Sv[o].isFetching)return await Sv[o].promise;Sv[o]={isFetching:!0};const u=s().then(m=>(Sv[o]={data:m,timestamp:i,isFetching:!1},m)).catch(m=>{throw Sv[o].isFetching=!1,m});return Sv[o].promise=u,await u},Tje=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="userSelector_"+JSON.stringify(o);return await rge(u,()=>i.get(`/ajax/userselectornew?${ef.stringify(o)}`))},Aje=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="roleByGroup_"+JSON.stringify(o);return await rge(u,()=>i.get(`/v3role/getByGroup?${ef.stringify(o)}`))},Nje=o=>{const{params:s,type:i="userIds"}=o,{http:u}=Iv(),m=f.ref(!1),h=f.ref({userlist:[],rolelist:[],grouplist:[],positionlist:[]}),b=async()=>{const C=f.toValue(s)||{},x=(C==null?void 0:C.groupIds)&&f.toValue(i)==="role",_=x?Aje:Tje;m.value=!0,await(_==null?void 0:_(C,u).then(N=>{x?h.value={...h.value,rolelist:N==null?void 0:N.data}:h.value=N==null?void 0:N.data}).finally(()=>{m.value=!1}))};return f.watch(()=>f.toValue(s),(C,x)=>{di(C,x)||b()},{deep:!0,immediate:!0}),{loading:m,refresh:b,allData:h}},age=o=>{const{params:s,type:i="groupIds"}=o,u=f.computed(()=>{const{keyword:x,unitId:_,groupIds:N}=f.toValue(s)||{};let O={keyword:x,unitId:_};return i==="roleIds"&&(O={...O,groupIds:N}),O=y2(O),O}),{loading:m,refresh:h,allData:b}=Nje({params:u,type:i}),C=f.computed(()=>{var F,Z,K,X,q;let x=[];const{groupIds:_,roleIds:N}=f.toValue(s)||{},O=(F=_==null?void 0:_.split(","))==null?void 0:F.filter(Boolean),B=(Z=N==null?void 0:N.split(","))==null?void 0:Z.filter(Boolean);switch(f.toValue(i)){case"userIds":x=(K=b.value)==null?void 0:K.userlist,(O==null?void 0:O.length)>0&&(x=x.filter(W=>O.includes((W==null?void 0:W.group_id)+""))),(B==null?void 0:B.length)>0&&(x=x.filter(W=>{var H;return((H=b2(B,W==null?void 0:W.role))==null?void 0:H.length)>0}));break;case"roleIds":x=(X=b.value)==null?void 0:X.rolelist;break;case"groupIds":x=(q=b.value)==null?void 0:q.grouplist;break}return x});return{loading:m,data:C,refresh:h,allData:b}},ige=o=>{const{data:s}=age({type:"groupIds"});return f.computed(()=>{var m,h;const u=f.toValue(o);return!u||(u==null?void 0:u.length)===0?[]:Array.isArray(u)?((h=s.value)==null?void 0:h.filter(b=>u.includes(b.id)))||[]:((m=s.value)==null?void 0:m.filter(b=>b.id===u))||[]})},Oje={class:"h-full flex flex-col pr-2"},$je={class:"flex py-1 mb-2 items-center justify-between border-0 border-solid border-b-1 border-[#e4e7ed]"},Dje={class:"color-[#333]"},Mje={class:"color-[#909399]"},Rje={class:"flex-grow h-1 overflow-auto"},Bje={class:"flex flex-wrap gap-2"},Ije={class:"color-[#909399]"},Pje=f.defineComponent({__name:"list",props:{modelValue:{default:[]},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue"),i=ige(s),u=()=>{s.value=[]},m=h=>{s.value=s.value.filter(b=>b!==(h==null?void 0:h.id))};return(h,b)=>(f.openBlock(),f.createElementBlock("div",Oje,[f.createElementVNode("div",$je,[f.createElementVNode("div",Dje,[b[0]||(b[0]=f.createTextVNode(" 已选择 ")),f.createElementVNode("span",Mje,f.toDisplayString(s.value.length),1)]),f.createElementVNode("div",{class:"flex flex-center gap-1 color-[#909399] cursor-pointer",onClick:u},b[1]||(b[1]=[f.createElementVNode("div",{class:"i-bi:eraser"},null,-1),f.createTextVNode(" 清空 ")]))]),f.createElementVNode("div",Rje,[f.createElementVNode("div",Bje,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(i),C=>(f.openBlock(),f.createElementBlock("div",{key:C==null?void 0:C.id,class:"flex-center gap-2 px-2 rounded-[4px] bg-[#f5f7fa] hover:bg-[#ebedf0] group"},[f.createElementVNode("div",Ije,f.toDisplayString(C==null?void 0:C.name),1),f.createVNode(f.unref(Nn.ElIcon),{onClick:x=>m(C),class:"cursor-pointer color-[#C0C4CC] group-hover:color-[#909399]"},{default:f.withCtx(()=>[f.createVNode(f.unref(aoe))]),_:2},1032,["onClick"])]))),128))])])]))}}),Fje={class:"h-full flex flex-col"},Lje={class:"px-2"},Vje=["onClick"],Hje={class:"flex items-center gap-2"},zje={class:"img"},Uje=f.defineComponent({__name:"department",props:f.mergeModels({multiple:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,{multiple:i}=f.toRefs(s),u=f.ref({keyword:""}),m=f.useModel(o,"modelValue"),{data:h,refresh:b}=age({params:u,type:"groupIds"}),C=f.computed({get:()=>{var _,N;return!((_=h.value)!=null&&_.length)||!((N=m.value)!=null&&N.length)?!1:h.value.every(O=>{var B;return(O==null?void 0:O.id)&&((B=m.value)==null?void 0:B.includes(O.id))})},set:_=>{var N,O;if(_){const B=((O=(N=h.value)==null?void 0:N.map(Z=>Z==null?void 0:Z.id))==null?void 0:O.filter(Boolean))||[],F=[...m.value||[],...B];m.value=[...new Set(F)]}else m.value=[]}}),x=_=>{var N,O,B;_!=null&&_.id&&(i.value?(N=m.value)!=null&&N.includes(_==null?void 0:_.id)?m.value=(O=m.value)==null?void 0:O.filter(F=>F!==(_==null?void 0:_.id)):(B=m.value)==null||B.push(_==null?void 0:_.id):m.value=[_==null?void 0:_.id])};return(_,N)=>(f.openBlock(),f.createElementBlock("div",Fje,[f.createElementVNode("div",Lje,[f.createVNode(f.unref(Nn.ElForm),{inline:!0,model:u.value,onSubmit:N[1]||(N[1]=f.withModifiers(()=>{},["prevent"]))},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElFormItem),{class:"mb-0"},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElInput),{modelValue:u.value.keyword,"onUpdate:modelValue":N[0]||(N[0]=O=>u.value.keyword=O),placeholder:"请输入关键字",clearable:"",class:"w-[160px]",onKeyup:f.withKeys(f.unref(b),["enter"])},null,8,["modelValue","onKeyup"])]),_:1})]),_:1},8,["model"]),f.unref(i)?(f.openBlock(),f.createBlock(f.unref(Nn.ElCheckbox),{key:0,modelValue:C.value,"onUpdate:modelValue":N[2]||(N[2]=O=>C.value=O),label:"全选",size:"large"},null,8,["modelValue"])):f.createCommentVNode("",!0)]),f.createElementVNode("div",{class:f.normalizeClass(["flex-grow h-1 overflow-auto",{"mt-2":!f.unref(i)}])},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(h),(O,B)=>{var F,Z;return f.openBlock(),f.createElementBlock("div",{class:"flex items-center justify-between cursor-pointer hover:bg-[#f5f7fa] px-2 rounded-[4px]",key:B,onClick:K=>x(O)},[f.createElementVNode("div",Hje,[f.unref(i)?(f.openBlock(),f.createBlock(f.unref(Nn.ElCheckbox),{key:0,"model-value":(F=m.value)==null?void 0:F.includes(O==null?void 0:O.id),size:"large"},null,8,["model-value"])):(f.openBlock(),f.createBlock(f.unref(Nn.ElRadio),{key:1,"model-value":(Z=m.value)==null?void 0:Z[0],value:O==null?void 0:O.id,size:"large",class:"mr-0"},null,8,["model-value","value"])),f.createVNode(f.unref(Nn.ElImage),{src:O.face||"",class:"face-img"},{error:f.withCtx(()=>[f.createElementVNode("div",zje,[f.createVNode(f.unref(Nn.ElIcon),{size:"16"},{default:f.withCtx(()=>[f.createVNode(f.unref(wR),{color:"#fff"})]),_:1})])]),_:2},1032,["src"]),f.createElementVNode("div",null,f.toDisplayString(O==null?void 0:O.name),1)])],8,Vje)}),128))],2)]))}}),jje=$i(Uje,[["__scopeId","data-v-0a06840f"]]),Wje={class:"flex flex-row h-[420px]"},Zje={class:"w-[50%] border-0 border-r-1 border-solid border-gray-200"},Gje={class:"h-full"},qje={class:"w-[50%] pl-2"},Yje={class:"h-full flex flex-col"},Kje={class:"flex-grow overflow-auto flex-shrink h-1"},Xje={class:"flex justify-between"},Jje=f.defineComponent({__name:"index",setup(o,{expose:s}){const i=f.ref(!1),u=f.ref(!0);let m=null;const h=f.ref([]),b=()=>{m==null||m(h.value),i.value=!1};return s({show:({data:x,callback:_,multiple:N=!0})=>{i.value=!0,u.value=N,h.value=ll(f.toValue(x)),m=_}}),(x,_)=>(f.openBlock(),f.createBlock(f.unref(Nn.ElDialog),{modelValue:i.value,"onUpdate:modelValue":_[3]||(_[3]=N=>i.value=N),class:"picker-dialog",title:"选择部门",width:"860px","append-to-body":!0,"destroy-on-close":!0},{footer:f.withCtx(()=>[f.createElementVNode("div",Xje,[_[6]||(_[6]=f.createElementVNode("div",null,null,-1)),f.createElementVNode("div",null,[f.createVNode(f.unref(Nn.ElButton),{onClick:_[2]||(_[2]=N=>i.value=!1)},{default:f.withCtx(()=>_[4]||(_[4]=[f.createTextVNode("取消")])),_:1}),f.createVNode(f.unref(Nn.ElButton),{type:"primary",onClick:b},{default:f.withCtx(()=>_[5]||(_[5]=[f.createTextVNode("确定")])),_:1})])])]),default:f.withCtx(()=>[f.createElementVNode("div",Wje,[f.createElementVNode("div",Zje,[f.createElementVNode("div",Gje,[f.createVNode(Pje,{modelValue:h.value,"onUpdate:modelValue":_[0]||(_[0]=N=>h.value=N),multiple:u.value},null,8,["modelValue","multiple"])])]),f.createElementVNode("div",qje,[f.createElementVNode("div",Yje,[f.createElementVNode("div",Kje,[f.createVNode(jje,{modelValue:h.value,"onUpdate:modelValue":_[1]||(_[1]=N=>h.value=N),multiple:u.value,ref:"groupRef"},null,8,["modelValue","multiple"])])])])])]),_:1},8,["modelValue"]))}}),Qje={key:0,class:"inline-block"},eWe={class:"color-[#409EFF]"},Zoe=f.defineComponent({__name:"departmentPickerDisplay",props:{value:{type:[Array,String],default:()=>[]},isAbbr:{type:Boolean,default:!0},showCount:{type:Number,default:2}},emits:["click"],setup(o,{emit:s}){const i=s,u=o,m=f.computed(()=>u.value?typeof u.value=="string"?[u.value]:Array.isArray(u.value)?u.value:[]:[]),h=b=>{var _;return!b||b.length===0?"":b.length<=(u==null?void 0:u.showCount)||!u.isAbbr?(_=b==null?void 0:b.map(N=>N==null?void 0:N.name))==null?void 0:_.join(","):`${b.slice(0,u==null?void 0:u.showCount).map(N=>(N==null?void 0:N.name)||"").filter(Boolean).join(",")}`};return(b,C)=>{var x,_,N;return f.openBlock(),f.createElementBlock("div",null,[f.createTextVNode(f.toDisplayString(h(m.value))+" ",1),((x=m.value)==null?void 0:x.length)>=(u==null?void 0:u.showCount)+1&&(u!=null&&u.isAbbr)?(f.openBlock(),f.createElementBlock("div",Qje,[C[1]||(C[1]=f.createTextVNode(" 等 ")),f.createElementVNode("span",eWe,f.toDisplayString((_=m.value)==null?void 0:_.length),1),C[2]||(C[2]=f.createTextVNode(" 部门 "))])):f.createCommentVNode("",!0),f.createVNode(f.unref(Nn.ElButton),{size:"small",class:f.normalizeClass(["align-middle",{"ml-2":(N=m.value)==null?void 0:N.length}]),onClick:C[0]||(C[0]=()=>{i("click")})},{default:f.withCtx(()=>C[3]||(C[3]=[f.createTextVNode(" 设置 ")])),_:1},8,["class"])])}}}),lge=f.defineComponent({__name:"index",props:f.mergeModels({isAbbr:{type:Boolean,default:!0},showCount:{type:Number,default:2},multiple:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=f.useModel(o,"modelValue"),u=f.ref(null),m=ige(i),h=()=>{var C;const b=s.multiple?ll(f.toValue(i)):[ll(f.toValue(i))].filter(Boolean);(C=u.value)==null||C.show({data:b,multiple:s.multiple,callback:x=>{s.multiple?i.value=x:i.value=x&&x.length>0?x[0]:""}})};return(b,C)=>(f.openBlock(),f.createBlock(kje,{modelValue:i.value,"onUpdate:modelValue":C[0]||(C[0]=x=>i.value=x)},{default:f.withCtx(()=>[f.renderSlot(b.$slots,"default",{value:f.unref(m)||[],selectHandler:h},()=>[f.createVNode(Zoe,{value:f.unref(m),onClick:h,isAbbr:s.isAbbr,showCount:s.showCount},null,8,["value","isAbbr","showCount"])]),f.createVNode(Jje,{ref_key:"dialogRef",ref:u},null,512)]),_:3},8,["modelValue"]))}}),xv={userSelector:{},roleByGroup:{}},cge=async(o,s)=>{const i=Date.now();if(xv[o]&&xv[o].timestamp+1e4>i)return xv[o].data;if(xv[o]&&xv[o].isFetching)return await xv[o].promise;xv[o]={isFetching:!0};const u=s().then(m=>(xv[o]={data:m,timestamp:i,isFetching:!1},m)).catch(m=>{throw xv[o].isFetching=!1,m});return xv[o].promise=u,await u},tWe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="userSelector_"+JSON.stringify(o);return await cge(u,()=>i.get(`/ajax/userselectornew?${ef.stringify(o)}`))},nWe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="roleByGroup_"+JSON.stringify(o);return await cge(u,()=>i.get(`/v3role/getByGroup?${ef.stringify(o)}`))},oWe=o=>{const{params:s,type:i="userIds"}=o,{http:u}=Iv(),m=f.ref(!1),h=f.ref({userlist:[],rolelist:[],grouplist:[],positionlist:[]}),b=async()=>{const C=f.toValue(s)||{},x=(C==null?void 0:C.groupIds)&&f.toValue(i)==="role",_=x?nWe:tWe;m.value=!0,await(_==null?void 0:_(C,u).then(N=>{x?h.value={...h.value,rolelist:N==null?void 0:N.data}:h.value=N==null?void 0:N.data}).finally(()=>{m.value=!1}))};return f.watch(()=>f.toValue(s),(C,x)=>{di(C,x)||b()},{deep:!0,immediate:!0}),{loading:m,refresh:b,allData:h}},sWe=o=>{const{params:s,type:i="groupIds"}=o,u=f.computed(()=>{const{keyword:x,unitId:_,groupIds:N}=f.toValue(s)||{};let O={keyword:x,unitId:_};return i==="roleIds"&&(O={...O,groupIds:N}),O=y2(O),O}),{loading:m,refresh:h,allData:b}=oWe({params:u,type:i}),C=f.computed(()=>{var F,Z,K,X,q;let x=[];const{groupIds:_,roleIds:N}=f.toValue(s)||{},O=(F=_==null?void 0:_.split(","))==null?void 0:F.filter(Boolean),B=(Z=N==null?void 0:N.split(","))==null?void 0:Z.filter(Boolean);switch(f.toValue(i)){case"userIds":x=(K=b.value)==null?void 0:K.userlist,(O==null?void 0:O.length)>0&&(x=x.filter(W=>O.includes((W==null?void 0:W.group_id)+""))),(B==null?void 0:B.length)>0&&(x=x.filter(W=>{var H;return((H=b2(B,W==null?void 0:W.role))==null?void 0:H.length)>0}));break;case"roleIds":x=(X=b.value)==null?void 0:X.rolelist;break;case"groupIds":x=(q=b.value)==null?void 0:q.grouplist;break}return x});return{loading:m,data:C,refresh:h,allData:b}},uge=f.defineComponent({__name:"index",props:f.mergeModels({ariaLabel:{},id:{},size:{},disabled:{type:Boolean},modelValue:{},maxlength:{},minlength:{},type:{},resize:{},autosize:{},autocomplete:{},formatter:{},parser:{},placeholder:{},form:{},readonly:{type:Boolean},clearable:{type:Boolean,default:!0},showPassword:{type:Boolean},showWordLimit:{type:Boolean},suffixIcon:{},prefixIcon:{},containerRole:{},tabindex:{},validateEvent:{type:Boolean},inputStyle:{},autofocus:{type:Boolean},rows:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=f.ref({keyword:""}),i=f.useModel(o,"modelValue"),{data:u,loading:m}=sWe({params:s,type:"groupIds"}),h=C=>{s.value.keyword=C},b=o;return console.log(b),(C,x)=>(f.openBlock(),f.createBlock(f.unref(Nn.ElSelect),f.mergeProps({modelValue:i.value,"onUpdate:modelValue":x[0]||(x[0]=_=>i.value=_),filterable:"",remote:"","remote-show-suffix":"","remote-method":h,loading:f.unref(m)},f.mergeProps(C.$attrs,b)),{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(u),_=>(f.openBlock(),f.createBlock(f.unref(Nn.ElOption),{key:_.id,label:_.name,value:_.id},null,8,["label","value"]))),128))]),_:1},16,["modelValue","loading"]))}}),rWe=Symbol("userPicker"),aWe=f.defineComponent({__name:"provider",props:f.mergeModels({multiple:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue"),i=o;return f.provide(rWe,{modelValue:s,multiple:i.multiple}),(u,m)=>f.renderSlot(u.$slots,"default")}}),Ev={userSelector:{},roleByGroup:{}},dge=async(o,s)=>{const i=Date.now();if(Ev[o]&&Ev[o].timestamp+1e4>i)return Ev[o].data;if(Ev[o]&&Ev[o].isFetching)return await Ev[o].promise;Ev[o]={isFetching:!0};const u=s().then(m=>(Ev[o]={data:m,timestamp:i,isFetching:!1},m)).catch(m=>{throw Ev[o].isFetching=!1,m});return Ev[o].promise=u,await u},iWe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="userSelector_"+JSON.stringify(o);return await dge(u,()=>i.get(`/ajax/userselectornew?${ef.stringify(o)}`))},lWe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="roleByGroup_"+JSON.stringify(o);return await dge(u,()=>i.get(`/v3role/getByGroup?${ef.stringify(o)}`))},cWe=o=>{const{params:s,type:i="roleIds"}=o,{http:u}=Iv(),m=f.ref(!1),h=f.ref({userlist:[],rolelist:[],grouplist:[],positionlist:[]}),b=async()=>{const C=f.toValue(s)||{},x=(C==null?void 0:C.groupIds)&&f.toValue(i)==="role",_=x?lWe:iWe;m.value=!0,await(_==null?void 0:_(C,u).then(N=>{x?h.value={...h.value,rolelist:N==null?void 0:N.data}:h.value=N==null?void 0:N.data}).finally(()=>{m.value=!1}))};return f.watch(()=>f.toValue(s),(C,x)=>{di(C,x)||b()},{deep:!0,immediate:!0}),{loading:m,refresh:b,allData:h}},fge=o=>{const{params:s,type:i="roleIds"}=o,u=f.computed(()=>{const{keyword:x,unitId:_,groupIds:N}=f.toValue(s)||{};let O={keyword:x,unitId:_};return i==="roleIds"&&(O={...O,groupIds:N}),O=y2(O),O}),{loading:m,refresh:h,allData:b}=cWe({params:u,type:i}),C=f.computed(()=>{var F,Z,K,X,q;let x=[];const{groupIds:_,roleIds:N}=f.toValue(s)||{},O=(F=_==null?void 0:_.split(","))==null?void 0:F.filter(Boolean),B=(Z=N==null?void 0:N.split(","))==null?void 0:Z.filter(Boolean);switch(f.toValue(i)){case"userIds":x=(K=b.value)==null?void 0:K.userlist,(O==null?void 0:O.length)>0&&(x=x.filter(W=>O.includes((W==null?void 0:W.group_id)+""))),(B==null?void 0:B.length)>0&&(x=x.filter(W=>{var H;return((H=b2(B,W==null?void 0:W.role))==null?void 0:H.length)>0}));break;case"roleIds":x=(X=b.value)==null?void 0:X.rolelist;break;case"groupIds":x=(q=b.value)==null?void 0:q.grouplist;break}return x});return{loading:m,data:C,refresh:h,allData:b}},mge=o=>{const{data:s}=fge({type:"roleIds"});return f.computed(()=>{var m,h;const u=f.toValue(o);return!u||(u==null?void 0:u.length)===0?[]:Array.isArray(u)?((h=s.value)==null?void 0:h.filter(b=>u.includes(b.id)))||[]:((m=s.value)==null?void 0:m.filter(b=>b.id===u))||[]})},uWe={class:"h-full flex flex-col pr-2"},dWe={class:"flex py-1 mb-2 items-center justify-between border-0 border-solid border-b-1 border-[#e4e7ed]"},fWe={class:"color-[#333]"},mWe={class:"color-[#909399]"},pWe={class:"flex-grow h-1 overflow-auto"},gWe={class:"flex flex-wrap gap-2"},hWe={class:"color-[#909399]"},vWe=f.defineComponent({__name:"list",props:{modelValue:{default:[]},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue"),i=mge(s),u=()=>{s.value=[]},m=h=>{s.value=s.value.filter(b=>b!==(h==null?void 0:h.id))};return(h,b)=>(f.openBlock(),f.createElementBlock("div",uWe,[f.createElementVNode("div",dWe,[f.createElementVNode("div",fWe,[b[0]||(b[0]=f.createTextVNode(" 已选择 ")),f.createElementVNode("span",mWe,f.toDisplayString(s.value.length),1)]),f.createElementVNode("div",{class:"flex flex-center gap-1 color-[#909399] cursor-pointer",onClick:u},b[1]||(b[1]=[f.createElementVNode("div",{class:"i-bi:eraser"},null,-1),f.createTextVNode(" 清空 ")]))]),f.createElementVNode("div",pWe,[f.createElementVNode("div",gWe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(i),C=>(f.openBlock(),f.createElementBlock("div",{key:C==null?void 0:C.id,class:"flex-center gap-2 px-2 rounded-[4px] bg-[#f5f7fa] hover:bg-[#ebedf0] group"},[f.createElementVNode("div",hWe,f.toDisplayString(C==null?void 0:C.name),1),f.createVNode(f.unref(Nn.ElIcon),{onClick:x=>m(C),class:"cursor-pointer color-[#C0C4CC] group-hover:color-[#909399]"},{default:f.withCtx(()=>[f.createVNode(f.unref(aoe))]),_:2},1032,["onClick"])]))),128))])])]))}}),bWe={class:"h-full flex flex-col"},yWe={class:"px-2"},wWe=["onClick"],CWe={class:"flex items-center gap-2"},SWe=f.defineComponent({__name:"role",props:f.mergeModels({multiple:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,{multiple:i}=f.toRefs(s),u=f.ref({keyword:""}),m=f.useModel(o,"modelValue"),{data:h,refresh:b}=fge({params:u,type:"roleIds"}),C=f.computed({get:()=>{var _,N;return!((_=h.value)!=null&&_.length)||!((N=m.value)!=null&&N.length)?!1:h.value.every(O=>{var B;return(O==null?void 0:O.id)&&((B=m.value)==null?void 0:B.includes(O.id))})},set:_=>{var N,O;if(_){const B=((O=(N=h.value)==null?void 0:N.map(Z=>Z==null?void 0:Z.id))==null?void 0:O.filter(Boolean))||[],F=[...m.value||[],...B];m.value=[...new Set(F)]}else m.value=[]}}),x=_=>{var N,O,B;_!=null&&_.id&&(i.value?(N=m.value)!=null&&N.includes(_==null?void 0:_.id)?m.value=(O=m.value)==null?void 0:O.filter(F=>F!==(_==null?void 0:_.id)):(B=m.value)==null||B.push(_==null?void 0:_.id):m.value=[_==null?void 0:_.id])};return(_,N)=>(f.openBlock(),f.createElementBlock("div",bWe,[f.createElementVNode("div",yWe,[f.createVNode(f.unref(Nn.ElForm),{inline:!0,model:u.value,onSubmit:N[1]||(N[1]=f.withModifiers(()=>{},["prevent"]))},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElFormItem),{class:"mb-0"},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElInput),{modelValue:u.value.keyword,"onUpdate:modelValue":N[0]||(N[0]=O=>u.value.keyword=O),placeholder:"请输入关键字",clearable:"",class:"w-[160px]",onKeyup:f.withKeys(f.unref(b),["enter"])},null,8,["modelValue","onKeyup"])]),_:1})]),_:1},8,["model"]),f.unref(i)?(f.openBlock(),f.createBlock(f.unref(Nn.ElCheckbox),{key:0,modelValue:C.value,"onUpdate:modelValue":N[2]||(N[2]=O=>C.value=O),label:"全选",size:"large"},null,8,["modelValue"])):f.createCommentVNode("",!0)]),f.createElementVNode("div",{class:f.normalizeClass(["flex-grow h-1 overflow-auto",{"mt-2":!f.unref(i)}])},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(h),(O,B)=>{var F,Z;return f.openBlock(),f.createElementBlock("div",{class:"flex items-center justify-between cursor-pointer hover:bg-[#f5f7fa] px-2 rounded-[4px]",key:B,onClick:K=>x(O)},[f.createElementVNode("div",CWe,[f.unref(i)?(f.openBlock(),f.createBlock(f.unref(Nn.ElCheckbox),{key:0,"model-value":(F=m.value)==null?void 0:F.includes(O==null?void 0:O.id),size:"large"},null,8,["model-value"])):(f.openBlock(),f.createBlock(f.unref(Nn.ElRadio),{key:1,"model-value":(Z=m.value)==null?void 0:Z[0],value:O==null?void 0:O.id,size:"large",class:"mr-0"},null,8,["model-value","value"])),f.createVNode(f.unref(Nn.ElImage),{src:O.face||"",class:"face-img"},{error:f.withCtx(()=>N[3]||(N[3]=[f.createElementVNode("div",{class:"img"},[f.createElementVNode("div",{class:"i-bi:person-vcard color-white text-[16px]"})],-1)])),_:2},1032,["src"]),f.createElementVNode("div",null,f.toDisplayString(O==null?void 0:O.name),1)])],8,wWe)}),128))],2)]))}}),xWe=$i(SWe,[["__scopeId","data-v-97997685"]]),EWe={class:"flex flex-row h-[420px]"},_We={class:"w-[50%] border-0 border-r-1 border-solid border-gray-200"},kWe={class:"h-full"},TWe={class:"w-[50%] pl-2"},AWe={class:"h-full flex flex-col"},NWe={class:"flex-grow overflow-auto flex-shrink h-1"},OWe={class:"flex justify-between"},$We=f.defineComponent({__name:"index",setup(o,{expose:s}){const i=f.ref(!1),u=f.ref(!0);let m=null;const h=f.ref([]),b=()=>{m==null||m(h.value),i.value=!1};return s({show:({data:x,callback:_,multiple:N=!0})=>{i.value=!0,u.value=N,h.value=ll(f.toValue(x)),m=_}}),(x,_)=>(f.openBlock(),f.createBlock(f.unref(Nn.ElDialog),{modelValue:i.value,"onUpdate:modelValue":_[3]||(_[3]=N=>i.value=N),class:"picker-dialog",title:"选择岗位",width:"860px","append-to-body":!0,"destroy-on-close":!0},{footer:f.withCtx(()=>[f.createElementVNode("div",OWe,[_[6]||(_[6]=f.createElementVNode("div",null,null,-1)),f.createElementVNode("div",null,[f.createVNode(f.unref(Nn.ElButton),{onClick:_[2]||(_[2]=N=>i.value=!1)},{default:f.withCtx(()=>_[4]||(_[4]=[f.createTextVNode("取消")])),_:1}),f.createVNode(f.unref(Nn.ElButton),{type:"primary",onClick:b},{default:f.withCtx(()=>_[5]||(_[5]=[f.createTextVNode("确定")])),_:1})])])]),default:f.withCtx(()=>[f.createElementVNode("div",EWe,[f.createElementVNode("div",_We,[f.createElementVNode("div",kWe,[f.createVNode(vWe,{modelValue:h.value,"onUpdate:modelValue":_[0]||(_[0]=N=>h.value=N),multiple:u.value},null,8,["modelValue","multiple"])])]),f.createElementVNode("div",TWe,[f.createElementVNode("div",AWe,[f.createElementVNode("div",NWe,[f.createVNode(xWe,{modelValue:h.value,"onUpdate:modelValue":_[1]||(_[1]=N=>h.value=N),multiple:u.value},null,8,["modelValue","multiple"])])])])])]),_:1},8,["modelValue"]))}}),DWe={key:0,class:"inline-block"},MWe={class:"color-[#409EFF]"},Goe=f.defineComponent({__name:"rolePickerDisplay",props:{value:{type:[Array,String],default:()=>[]},isAbbr:{type:Boolean,default:!0}},emits:["click"],setup(o,{emit:s}){const i=s,u=o,m=f.computed(()=>u.value?typeof u.value=="string"?[u.value]:Array.isArray(u.value)?u.value:[]:[]),h=b=>{var _;return!b||b.length===0?"":b.length<=2||!u.isAbbr?(_=b==null?void 0:b.map(N=>N==null?void 0:N.name))==null?void 0:_.join(","):`${b.slice(0,2).map(N=>(N==null?void 0:N.name)||"").filter(Boolean).join(",")}`};return(b,C)=>{var x,_,N;return f.openBlock(),f.createElementBlock("div",null,[f.createTextVNode(f.toDisplayString(h(m.value))+" ",1),((x=m.value)==null?void 0:x.length)>=3&&(u!=null&&u.isAbbr)?(f.openBlock(),f.createElementBlock("div",DWe,[C[1]||(C[1]=f.createTextVNode(" 等 ")),f.createElementVNode("span",MWe,f.toDisplayString((_=m.value)==null?void 0:_.length),1),C[2]||(C[2]=f.createTextVNode(" 岗位 "))])):f.createCommentVNode("",!0),f.createVNode(f.unref(Nn.ElButton),{size:"small",class:f.normalizeClass(["align-middle",{"ml-2":(N=m.value)==null?void 0:N.length}]),onClick:C[0]||(C[0]=()=>{i("click")})},{default:f.withCtx(()=>C[3]||(C[3]=[f.createTextVNode(" 设置 ")])),_:1},8,["class"])])}}}),pge=f.defineComponent({__name:"index",props:f.mergeModels({isAbbr:{type:Boolean,default:!0},multiple:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=f.useModel(o,"modelValue"),u=f.ref(null),m=mge(i),h=()=>{var C;const b=s.multiple?ll(f.toValue(i)):[ll(f.toValue(i))].filter(Boolean);(C=u.value)==null||C.show({data:b,multiple:s.multiple,callback:x=>{s.multiple?i.value=x:i.value=x&&x.length>0?x[0]:""}})};return(b,C)=>(f.openBlock(),f.createBlock(aWe,{modelValue:i.value,"onUpdate:modelValue":C[0]||(C[0]=x=>i.value=x)},{default:f.withCtx(()=>[f.renderSlot(b.$slots,"default",{value:f.unref(m)||[],selectHandler:h},()=>[f.createVNode(Goe,{value:f.unref(m),onClick:h,isAbbr:s.isAbbr},null,8,["value","isAbbr"])]),f.createVNode($We,{ref_key:"dialogRef",ref:u},null,512)]),_:3},8,["modelValue"]))}}),_v={userSelector:{},roleByGroup:{}},gge=async(o,s)=>{const i=Date.now();if(_v[o]&&_v[o].timestamp+1e4>i)return _v[o].data;if(_v[o]&&_v[o].isFetching)return await _v[o].promise;_v[o]={isFetching:!0};const u=s().then(m=>(_v[o]={data:m,timestamp:i,isFetching:!1},m)).catch(m=>{throw _v[o].isFetching=!1,m});return _v[o].promise=u,await u},RWe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="userSelector_"+JSON.stringify(o);return await gge(u,()=>i.get(`/ajax/userselectornew?${ef.stringify(o)}`))},BWe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="roleByGroup_"+JSON.stringify(o);return await gge(u,()=>i.get(`/v3role/getByGroup?${ef.stringify(o)}`))},IWe=o=>{const{params:s,type:i="userIds"}=o,{http:u}=Iv(),m=f.ref(!1),h=f.ref({userlist:[],rolelist:[],grouplist:[],positionlist:[]}),b=async()=>{const C=f.toValue(s)||{},x=(C==null?void 0:C.groupIds)&&f.toValue(i)==="role",_=x?BWe:RWe;m.value=!0,await(_==null?void 0:_(C,u).then(N=>{x?h.value={...h.value,rolelist:N==null?void 0:N.data}:h.value=N==null?void 0:N.data}).finally(()=>{m.value=!1}))};return f.watch(()=>f.toValue(s),(C,x)=>{di(C,x)||b()},{deep:!0,immediate:!0}),{loading:m,refresh:b,allData:h}},PWe=o=>{const{params:s,type:i="userIds"}=o,u=f.computed(()=>{const{keyword:x,unitId:_,groupIds:N}=f.toValue(s)||{};let O={keyword:x,unitId:_};return i==="roleIds"&&(O={...O,groupIds:N}),O=y2(O),O}),{loading:m,refresh:h,allData:b}=IWe({params:u,type:i}),C=f.computed(()=>{var F,Z,K,X,q;let x=[];const{groupIds:_,roleIds:N}=f.toValue(s)||{},O=(F=_==null?void 0:_.split(","))==null?void 0:F.filter(Boolean),B=(Z=N==null?void 0:N.split(","))==null?void 0:Z.filter(Boolean);switch(f.toValue(i)){case"userIds":x=(K=b.value)==null?void 0:K.userlist,(O==null?void 0:O.length)>0&&(x=x.filter(W=>O.includes((W==null?void 0:W.group_id)+""))),(B==null?void 0:B.length)>0&&(x=x.filter(W=>{var H;return((H=b2(B,W==null?void 0:W.role))==null?void 0:H.length)>0}));break;case"roleIds":x=(X=b.value)==null?void 0:X.rolelist;break;case"groupIds":x=(q=b.value)==null?void 0:q.grouplist;break}return x});return{loading:m,data:C,refresh:h,allData:b}},hge=f.defineComponent({__name:"index",props:f.mergeModels({ariaLabel:{},id:{},size:{},disabled:{type:Boolean},modelValue:{},maxlength:{},minlength:{},type:{},resize:{},autosize:{},autocomplete:{},formatter:{},parser:{},placeholder:{},form:{},readonly:{type:Boolean},clearable:{type:Boolean,default:!0},showPassword:{type:Boolean},showWordLimit:{type:Boolean},suffixIcon:{},prefixIcon:{},containerRole:{},tabindex:{},validateEvent:{type:Boolean},inputStyle:{},autofocus:{type:Boolean},rows:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=f.ref({keyword:""}),i=f.useModel(o,"modelValue"),{data:u,loading:m}=PWe({params:s,type:"roleIds"}),h=C=>{s.value.keyword=C},b=o;return console.log(b),(C,x)=>(f.openBlock(),f.createBlock(f.unref(Nn.ElSelect),f.mergeProps({modelValue:i.value,"onUpdate:modelValue":x[0]||(x[0]=_=>i.value=_),filterable:"",remote:"","remote-show-suffix":"","remote-method":h,loading:f.unref(m)},f.mergeProps(C.$attrs,b)),{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(u),_=>(f.openBlock(),f.createBlock(f.unref(Nn.ElOption),{key:_.id,label:_.name,value:_.id},null,8,["label","value"]))),128))]),_:1},16,["modelValue","loading"]))}}),kv={userSelector:{},roleByGroup:{}},vge=async(o,s)=>{const i=Date.now();if(kv[o]&&kv[o].timestamp+1e4>i)return kv[o].data;if(kv[o]&&kv[o].isFetching)return await kv[o].promise;kv[o]={isFetching:!0};const u=s().then(m=>(kv[o]={data:m,timestamp:i,isFetching:!1},m)).catch(m=>{throw kv[o].isFetching=!1,m});return kv[o].promise=u,await u},FWe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="userSelector_"+JSON.stringify(o);return await vge(u,()=>i.get(`/ajax/userselectornew?${ef.stringify(o)}`))},LWe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="roleByGroup_"+JSON.stringify(o);return await vge(u,()=>i.get(`/v3role/getByGroup?${ef.stringify(o)}`))},VWe=o=>{const{params:s,type:i="userIds"}=o,{http:u}=Iv(),m=f.ref(!1),h=f.ref({userlist:[],rolelist:[],grouplist:[],positionlist:[]}),b=async()=>{const C=f.toValue(s)||{},x=(C==null?void 0:C.groupIds)&&f.toValue(i)==="role",_=x?LWe:FWe;m.value=!0,await(_==null?void 0:_(C,u).then(N=>{x?h.value={...h.value,rolelist:N==null?void 0:N.data}:h.value=N==null?void 0:N.data}).finally(()=>{m.value=!1}))};return f.watch(()=>f.toValue(s),(C,x)=>{di(C,x)||b()},{deep:!0,immediate:!0}),{loading:m,refresh:b,allData:h}},bge=o=>{const{params:s,type:i="groupIds"}=o,u=f.computed(()=>{const{keyword:x,unitId:_,groupIds:N}=f.toValue(s)||{};let O={keyword:x,unitId:_};return i==="roleIds"&&(O={...O,groupIds:N}),O=y2(O),O}),{loading:m,refresh:h,allData:b}=VWe({params:u,type:i}),C=f.computed(()=>{var F,Z,K,X,q;let x=[];const{groupIds:_,roleIds:N}=f.toValue(s)||{},O=(F=_==null?void 0:_.split(","))==null?void 0:F.filter(Boolean),B=(Z=N==null?void 0:N.split(","))==null?void 0:Z.filter(Boolean);switch(f.toValue(i)){case"userIds":x=(K=b.value)==null?void 0:K.userlist,(O==null?void 0:O.length)>0&&(x=x.filter(W=>O.includes((W==null?void 0:W.group_id)+""))),(B==null?void 0:B.length)>0&&(x=x.filter(W=>{var H;return((H=b2(B,W==null?void 0:W.role))==null?void 0:H.length)>0}));break;case"roleIds":x=(X=b.value)==null?void 0:X.rolelist;break;case"groupIds":x=(q=b.value)==null?void 0:q.grouplist;break}return x});return{loading:m,data:C,refresh:h,allData:b}},HWe={class:"w-[420px] flex h-[300px]"},zWe={class:"h-full w-1/2 leftContent flex flex-col pr-2"},UWe={class:"mb-1"},jWe={class:"h-1 overflow-auto flex-grow"},WWe=["onClick"],ZWe={key:0,class:"i-bi:check2"},GWe={class:"h-full w-1/2 flex flex-col pl-2"},qWe={class:"mb-1"},YWe={class:"h-1 overflow-auto flex-grow"},KWe=["onClick"],XWe={key:0,class:"i-bi:check2"},JWe={class:"color-[#6B7280] text-[12px] tips flex items-center pt-2 justify-between"},QWe=f.defineComponent({__name:"roleAndDepartmentSelect",props:{modelValue:{default:{roleId:"",groupId:""}},modelModifiers:{}},emits:f.mergeModels(["ok"],["update:modelValue"]),setup(o,{emit:s}){const i=f.useModel(o,"modelValue"),u=s,m=()=>{u("ok",ll(f.toValue(i)))},h=f.ref(""),b=f.ref(""),{allData:C}=bge({}),x=f.computed(()=>{var O;const N=((O=C.value)==null?void 0:O.grouplist)||[];return b.value?N.filter(B=>{var F;return(F=B==null?void 0:B.name)==null?void 0:F.toLowerCase().includes(b.value.toLowerCase())}):N}),_=f.computed(()=>{var O;const N=((O=C.value)==null?void 0:O.rolelist)||[];return h.value?N.filter(B=>{var F;return(F=B==null?void 0:B.name)==null?void 0:F.toLowerCase().includes(h.value.toLowerCase())}):N});return(N,O)=>(f.openBlock(),f.createElementBlock("div",null,[f.createElementVNode("div",HWe,[f.createElementVNode("div",zWe,[f.createElementVNode("div",UWe,[O[2]||(O[2]=f.createElementVNode("div",{class:"color-[#333] font-bold mb-2"},"选择部门",-1)),f.createVNode(f.unref(Nn.ElInput),{modelValue:b.value,"onUpdate:modelValue":O[0]||(O[0]=B=>b.value=B),placeholder:"请输入关键字",size:"small",clearable:"",class:"w-full"},null,8,["modelValue"])]),f.createElementVNode("div",jWe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(x.value,B=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["flex items-center justify-between hover:bg-[#F5F7FA] rounded-[4px] py-2 px-2 cursor-pointer",{"color-[#409EFF]":(B==null?void 0:B.id)===i.value.groupId}]),key:B==null?void 0:B.id,onClick:F=>i.value.groupId=B==null?void 0:B.id},[f.createTextVNode(f.toDisplayString(B==null?void 0:B.name)+" ",1),(B==null?void 0:B.id)===i.value.groupId?(f.openBlock(),f.createElementBlock("div",ZWe)):f.createCommentVNode("",!0)],10,WWe))),128))])]),f.createElementVNode("div",GWe,[f.createElementVNode("div",qWe,[O[3]||(O[3]=f.createElementVNode("div",{class:"color-[#333] font-bold mb-2"},"选择岗位",-1)),f.createVNode(f.unref(Nn.ElInput),{modelValue:h.value,"onUpdate:modelValue":O[1]||(O[1]=B=>h.value=B),placeholder:"请输入关键字",size:"small",clearable:"",class:"w-full"},null,8,["modelValue"])]),f.createElementVNode("div",YWe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(_.value,B=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["flex items-center justify-between hover:bg-[#F5F7FA] rounded-[4px] py-2 px-2 cursor-pointer",{"color-[#409EFF]":(B==null?void 0:B.id)===i.value.roleId}]),key:B==null?void 0:B.id,onClick:F=>i.value.roleId=B==null?void 0:B.id},[f.createTextVNode(f.toDisplayString(B==null?void 0:B.name)+" ",1),(B==null?void 0:B.id)===i.value.roleId?(f.openBlock(),f.createElementBlock("div",XWe)):f.createCommentVNode("",!0)],10,KWe))),128))])])]),f.createElementVNode("div",JWe,[O[5]||(O[5]=f.createElementVNode("div",null,[f.createElementVNode("span",{class:"font-bold"},"提示:"),f.createTextVNode(" 若部门和岗位均选择不限则视为不限制 ")],-1)),f.createVNode(f.unref(Nn.ElButton),{size:"small",type:"primary",onClick:m},{default:f.withCtx(()=>O[4]||(O[4]=[f.createTextVNode("确定")])),_:1})])]))}}),eZe=$i(QWe,[["__scopeId","data-v-4d4aa43e"]]),tZe=o=>{if(f.toValue(o)){const{allData:s}=bge({type:"groupIds"});return f.computed(()=>{const u=f.toValue(o)||[],m=[];return u.forEach(h=>{var C,x;let b={};if(h.roleId&&((C=s.value)!=null&&C.rolelist)){const _=s.value.rolelist.find(N=>N.id==h.roleId);_&&(b.role=_)}if(h.groupId&&((x=s.value)!=null&&x.grouplist)){const _=s.value.grouplist.find(N=>N.id==h.groupId);_&&(b.group=_)}m.push(b)}),m})}else return f.computed(()=>[])},nZe={class:"w-full"},oZe={class:"flex justify-between header items-center h-[32px]"},sZe={class:"flex gap-1"},rZe={class:"content mt-2"},aZe={class:"flex-center gap-1"},iZe=["onClick"],lZe={key:0,class:"h-[100px] flex-center"},cZe=f.defineComponent({__name:"index",props:{modelValue:{default:[]},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue"),i=f.ref({roleId:"",groupId:""}),u=_=>{var N,O;_!=null&&_.roleId&&(_!=null&&_.groupId)&&((N=s.value)!=null&&N.some(F=>F.roleId===_.roleId&&F.groupId===_.groupId)||(s.value=[...s.value||[],_])),(O=m.value)==null||O.hide()},m=f.ref(null),h=tZe(s),b=_=>{var B,F;let N=(B=_==null?void 0:_.role)==null?void 0:B.id,O=(F=_==null?void 0:_.group)==null?void 0:F.id;s.value=s.value.filter(Z=>!di(Z,{roleId:N,groupId:O}))},C=()=>{s.value=[]},x=()=>{i.value={roleId:"",groupId:""}};return(_,N)=>{var O;return f.openBlock(),f.createElementBlock("div",nZe,[f.createElementVNode("div",oZe,[N[3]||(N[3]=f.createElementVNode("div",{class:"color-[#333]"},[f.createTextVNode(" 已选择 "),f.createElementVNode("span",{class:"color-[#909399] text-[13px]"},"(3)")],-1)),f.createElementVNode("div",sZe,[f.createVNode(f.unref(Nn.ElPopover),{ref_key:"popoverRef",ref:m,width:"auto",trigger:"click",onAfterLeave:x},{reference:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElButton),{link:""},{default:f.withCtx(()=>N[1]||(N[1]=[f.createElementVNode("div",{class:"i-bi:plus-lg mr-1"},null,-1),f.createTextVNode(" 增加 ")])),_:1})]),default:f.withCtx(()=>[f.createVNode(eZe,{modelValue:i.value,"onUpdate:modelValue":N[0]||(N[0]=B=>i.value=B),onOk:u},null,8,["modelValue"])]),_:1},512),f.createVNode(f.unref(Nn.ElButton),{link:"",onClick:C},{default:f.withCtx(()=>N[2]||(N[2]=[f.createElementVNode("div",{class:"i-bi:eraser mr-1"},null,-1),f.createTextVNode(" 清空 ")])),_:1})])]),f.createElementVNode("div",rZe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(h),(B,F)=>{var Z,K;return f.openBlock(),f.createElementBlock("div",{key:F,class:"item"},[f.createElementVNode("div",aZe,[N[4]||(N[4]=f.createElementVNode("div",{class:"i-bi:diagram-2 color-[#D4D7DE]"},null,-1)),f.createTextVNode(" "+f.toDisplayString((Z=B==null?void 0:B.group)==null?void 0:Z.name)+" - "+f.toDisplayString((K=B==null?void 0:B.role)==null?void 0:K.name),1)]),f.createElementVNode("div",{class:"i-bi:x-circle-fill color-[#C0C4CC] hover:color-[#409EFF] cursor-pointer",onClick:()=>b(B)},null,8,iZe)])}),128)),((O=f.unref(h))==null?void 0:O.length)>0?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("div",lZe,"暂无数据"))])])}}}),yge=$i(cZe,[["__scopeId","data-v-6811f20c"]]),_ce=Object.freeze(Object.defineProperty({__proto__:null,ConfigProvider:gue,ConfirmTextSetter:Jpe,DateFormatSetter:Xpe,DepartmentPicker:lge,DepartmentPickerDisplay:Zoe,DepartmentSelect:uge,FilePreview:lfe,FormFlow:Ape,FormFlowPreview:Npe,FunctionSelect:_fe,NodeFormula:Efe,NodeSelect:xfe,NodesEditor:Sfe,NodesEditorPreview:kfe,OptionsSetter:Kpe,ProEditor:dfe,ProEditorPreview:ffe,RoleAndDepartmentPicker:yge,RolePicker:pge,RolePickerDisplay:Goe,RoleSelect:hge,UserPicker:nge,UserPickerDisplay:Woe,UserSelect:sge,UserSelector:xde,ZyPageLayout:ife,configProviderContextKey:Xz,defaultConfig:Une,useConfigProvider:Iv},Symbol.toStringTag,{value:"Module"})),wge=Rge;function Cge(o){return Object.keys(_ce).forEach(s=>{o.component(s,_ce[s])}),o}const uZe={install:Cge,version:wge};exports.ConfigProvider=gue;exports.ConfirmTextSetter=Jpe;exports.DateFormatSetter=Xpe;exports.DepartmentPicker=lge;exports.DepartmentPickerDisplay=Zoe;exports.DepartmentSelect=uge;exports.FilePreview=lfe;exports.FormFlow=Ape;exports.FormFlowPreview=Npe;exports.FunctionSelect=_fe;exports.NodeFormula=Efe;exports.NodeSelect=xfe;exports.NodesEditor=Sfe;exports.NodesEditorPreview=kfe;exports.OptionsSetter=Kpe;exports.ProEditor=dfe;exports.ProEditorPreview=ffe;exports.RoleAndDepartmentPicker=yge;exports.RolePicker=pge;exports.RolePickerDisplay=Goe;exports.RoleSelect=hge;exports.UserPicker=nge;exports.UserPickerDisplay=Woe;exports.UserSelect=sge;exports.UserSelector=xde;exports.ZyPageLayout=ife;exports.configProviderContextKey=Xz;exports.default=uZe;exports.defaultConfig=Une;exports.install=Cge;exports.useConfigProvider=Iv;exports.version=wge;
|
|
147
|
+
`))},{immediate:!0});const h=x=>{Nn.ElMessageBox.confirm("确定删除吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{i.value=i.value.filter(_=>(_==null?void 0:_.sort)!==(x==null?void 0:x.sort)),u.value&&u.value.some(_=>_.value===x.value)&&(u.value=u.value.filter(_=>_.value!==x.value))})},b=x=>u.value?u.value.some(_=>_===x.sort):!1,C=(x,_)=>{u.value||(u.value=[]),_?s.isSingle?u.value=[x==null?void 0:x.sort]:u.value=[...u.value||[],x==null?void 0:x.sort]:u.value=u.value.filter(N=>N!==x.sort)};return(x,_)=>(f.openBlock(),f.createElementBlock("div",null,[f.createVNode(f.unref(Nn.ElInput),{modelValue:m.value,"onUpdate:modelValue":_[0]||(_[0]=N=>m.value=N),style:{width:"240px"},rows:2,type:"textarea"},null,8,["modelValue"]),_[3]||(_[3]=f.createElementVNode("div",null,"每行一个选择项,显示顺序从上至下",-1)),f.createVNode(f.unref(SUe),{handle:".handle",target:"tbody",modelValue:i.value,"onUpdate:modelValue":_[1]||(_[1]=N=>i.value=N),animation:150},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElTable),{data:i.value,size:"small",border:""},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElTableColumn),{prop:"sort",label:"显示序号",width:"180",align:"center"},{default:f.withCtx(({row:N})=>[f.createElementVNode("div",xUe,[_[2]||(_[2]=f.createElementVNode("div",{class:"i-bi:list-ul text-[16px] cursor-pointer handle"},null,-1)),f.createTextVNode(" "+f.toDisplayString(N==null?void 0:N.sort),1)])]),_:1}),f.createVNode(f.unref(Nn.ElTableColumn),{prop:"label",label:"选项",align:"center"}),f.createVNode(f.unref(Nn.ElTableColumn),{prop:"name",label:"默认选中",width:"110",align:"center"},{default:f.withCtx(({row:N})=>[f.createVNode(f.unref(Nn.ElCheckbox),{"model-value":b(N),onChange:O=>C(N,O)},null,8,["model-value","onChange"])]),_:1}),f.createVNode(f.unref(Nn.ElTableColumn),{prop:"name",label:"操作",align:"center"},{default:f.withCtx(({row:N})=>[f.createElementVNode("div",EUe,[f.createVNode(f.unref(Nn.ElIcon),{size:18,class:"cursor-pointer",onClick:()=>h(N)},{default:f.withCtx(()=>[f.createVNode(f.unref(Nxe))]),_:2},1032,["onClick"])])]),_:1})]),_:1},8,["data"])]),_:1},8,["modelValue"])]))}},_Ue=[{label:"2025年1月1日 0时0分",value:"YYYY年M月D日 h时m分"},{label:"2025-01-01 00:00",value:"YYYY-MM-DD hh:mm"},{label:"2025/01/01 00:00",value:"YYYY/MM/DD hh:mm"},{label:"2025.01.01 00:00",value:"YYYY.MM.DD hh:mm"},{label:"2025年1月1日",value:"YYYY年M月D日"},{label:"2025-01-01",value:"YYYY-MM-DD"},{label:"2025/01/01",value:"YYYY/MM/DD"},{label:"2025.01.01",value:"YYYY.MM.DD"},{label:"2025年1月",value:"YYYY年M月"},{label:"2025-01",value:"YYYY-MM"},{label:"2025.01",value:"YYYY.MM"},{label:"1月1日 0时0分",value:"M月D日 h时m分"},{label:"01-01 00:00",value:"MM-DD hh:mm"},{label:"01.01 00:00",value:"MM.DD hh:mm"},{label:"2025年",value:"YYYY年"},{label:"1月",value:"M月"},{label:"1日",value:"D日"},{label:"年(2025)",value:"YYYY"},{label:"月(1)",value:"M"},{label:"日(1)",value:"D"},{label:"0时0分",value:"h时m分"},{label:"时:分(00:00)",value:"h:m"},{label:"二〇二五年一月一日",value:"ChineseDate"},{label:"星期三",value:"星期dd"}],Xpe={__name:"index",props:f.mergeModels({},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue");return(i,u)=>(f.openBlock(),f.createElementBlock("div",null,[f.createVNode(f.unref(Nn.ElRadioGroup),{modelValue:s.value,"onUpdate:modelValue":u[0]||(u[0]=m=>s.value=m)},{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(_Ue),m=>(f.openBlock(),f.createBlock(f.unref(Nn.ElRadio),{value:m==null?void 0:m.value,class:"w-full"},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(m==null?void 0:m.label),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"])]))}},VH=[{label:"是/否",value:"是/否"},{label:"同意/拒绝",value:"同意/拒绝"},{label:"符合/不符合",value:"符合/不符合"},{label:"通过/未通过",value:"通过/未通过"},{label:"完成/未完成",value:"完成/未完成"},{label:"合格/不合格",value:"合格/不合格"}],kUe={key:0,class:"gap-x-2 flex w-full max-w-[280px] input-box"},TUe={__name:"index",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue"),i=f.ref(""),u=f.ref({"true-value":"","false-value":""}),m=f.computed(()=>VH==null?void 0:VH.find(h=>{var b,C;return(h==null?void 0:h.label)===`${(b=s.value)==null?void 0:b["true-value"]}/${(C=s.value)==null?void 0:C["false-value"]}`}));return f.watch(i,h=>{var b;if(h){const[C,x]=((b=h==null?void 0:h.split("/"))==null?void 0:b.filter(Boolean))||[];C&&x&&(s.value={"true-value":C,"false-value":x})}else s.value=JSON.parse(JSON.stringify(u.value))}),f.watch(()=>s.value,()=>{if(m.value)i.value=`${f.toValue(s)["true-value"]}/${f.toValue(s)["false-value"]}`,u.value={};else try{u.value=JSON.parse(JSON.stringify(s.value))||{}}catch(h){console.log(h)}},{immediate:!0,deep:!0}),f.watch(u,()=>{if(u.value["true-value"]&&u.value["false-value"])try{s.value=JSON.parse(JSON.stringify(u.value))||{}}catch(h){console.log(h)}},{deep:!0}),(h,b)=>(f.openBlock(),f.createElementBlock("div",null,[f.createVNode(f.unref(Nn.ElRadioGroup),{modelValue:i.value,"onUpdate:modelValue":b[0]||(b[0]=C=>i.value=C),class:"radio-grid"},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElRow),{gutter:8},{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(VH),C=>(f.openBlock(),f.createBlock(f.unref(Nn.ElCol),{key:C==null?void 0:C.value,xs:12,sm:12,md:8,lg:6,xl:4,class:"radio-col"},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElRadio),{value:C==null?void 0:C.value,class:"radio-item"},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(C==null?void 0:C.label),1)]),_:2},1032,["value"])]),_:2},1024))),128)),f.createVNode(f.unref(Nn.ElCol),{xs:12,sm:12,md:8,lg:6,xl:4,class:"radio-col"},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElRadio),{value:"",class:"radio-item"},{default:f.withCtx(()=>b[3]||(b[3]=[f.createTextVNode("自定义")])),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),m.value?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("div",kUe,[f.createVNode(f.unref(Nn.ElInput),{placeholder:"请输入内容",modelValue:u.value["true-value"],"onUpdate:modelValue":b[1]||(b[1]=C=>u.value["true-value"]=C)},{prepend:f.withCtx(()=>b[4]||(b[4]=[f.createTextVNode("是")])),_:1},8,["modelValue"]),f.createVNode(f.unref(Nn.ElInput),{placeholder:"请输入内容",modelValue:u.value["false-value"],"onUpdate:modelValue":b[2]||(b[2]=C=>u.value["false-value"]=C)},{prepend:f.withCtx(()=>b[5]||(b[5]=[f.createTextVNode("否")])),_:1},8,["modelValue"])]))]))}},Jpe=$i(TUe,[["__scopeId","data-v-edbd7ef2"]]),Qpe=Symbol("userPicker"),DR=()=>{const o=f.inject(Qpe);if(!o)throw new Error("NodesEditor context not found");return o},AUe=f.defineComponent({__name:"provider",props:f.mergeModels({isAbbr:{type:Boolean,default:!0},showCount:{type:Number,default:2},multiple:{type:Boolean,default:!0},disabledIds:{type:Array,default:()=>[]}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=f.useModel(o,"modelValue");return f.provide(Qpe,{modelValue:i,props:s}),(u,m)=>f.renderSlot(u.$slots,"default")}}),wv={userSelector:{},roleByGroup:{}},ege=async(o,s)=>{const i=Date.now();if(wv[o]&&wv[o].timestamp+1e4>i)return wv[o].data;if(wv[o]&&wv[o].isFetching)return await wv[o].promise;wv[o]={isFetching:!0};const u=s().then(m=>(wv[o]={data:m,timestamp:i,isFetching:!1},m)).catch(m=>{throw wv[o].isFetching=!1,m});return wv[o].promise=u,await u},NUe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="userSelector_"+JSON.stringify(o);return await ege(u,()=>i.get(`/ajax/userselectornew?${ef.stringify(o)}`))},OUe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="roleByGroup_"+JSON.stringify(o);return await ege(u,()=>i.get(`/v3role/getByGroup?${ef.stringify(o)}`))},$Ue=o=>{const{params:s,type:i="userIds"}=o,{http:u}=Iv(),m=f.ref(!1),h=f.ref({userlist:[],rolelist:[],grouplist:[],positionlist:[]}),b=async()=>{const C=f.toValue(s)||{},x=(C==null?void 0:C.groupIds)&&f.toValue(i)==="role",_=x?OUe:NUe;m.value=!0,await(_==null?void 0:_(C,u).then(N=>{x?h.value={...h.value,rolelist:N==null?void 0:N.data}:h.value=N==null?void 0:N.data}).finally(()=>{m.value=!1}))};return f.watch(()=>f.toValue(s),(C,x)=>{di(C,x)||b()},{deep:!0,immediate:!0}),{loading:m,refresh:b,allData:h}},T4=o=>{const{params:s,type:i="userIds"}=o,u=f.computed(()=>{const{keyword:x,unitId:_,groupIds:N}=f.toValue(s)||{};let O={keyword:x,unitId:_};return i==="roleIds"&&(O={...O,groupIds:N}),O=y2(O),O}),{loading:m,refresh:h,allData:b}=$Ue({params:u,type:i}),C=f.computed(()=>{var F,Z,K,X,q;let x=[];const{groupIds:_,roleIds:N}=f.toValue(s)||{},O=(F=_==null?void 0:_.split(","))==null?void 0:F.filter(Boolean),B=(Z=N==null?void 0:N.split(","))==null?void 0:Z.filter(Boolean);switch(f.toValue(i)){case"userIds":x=(K=b.value)==null?void 0:K.userlist,(O==null?void 0:O.length)>0&&(x=x.filter(W=>O.includes((W==null?void 0:W.group_id)+""))),(B==null?void 0:B.length)>0&&(x=x.filter(W=>{var H;return((H=b2(B,W==null?void 0:W.role))==null?void 0:H.length)>0}));break;case"roleIds":x=(X=b.value)==null?void 0:X.rolelist;break;case"groupIds":x=(q=b.value)==null?void 0:q.grouplist;break}return x});return{loading:m,data:C,refresh:h,allData:b}},tge=o=>{const{data:s}=T4({type:"userIds"});return f.computed(()=>{var m,h;const u=f.toValue(o);return!u||(u==null?void 0:u.length)===0?[]:Array.isArray(u)?((h=s.value)==null?void 0:h.filter(b=>u.includes(b.id)))||[]:((m=s.value)==null?void 0:m.filter(b=>b.id===u))||[]})},DUe={class:"h-full flex flex-col pr-2"},MUe={class:"flex py-1 mb-2 items-center justify-between border-0 border-solid border-b-1 border-[#e4e7ed]"},RUe={class:"color-[#333]"},BUe={class:"color-[#909399]"},IUe={class:"flex-grow h-1 overflow-auto"},PUe={class:"flex flex-wrap gap-2"},FUe={class:"color-[#909399]"},LUe=f.defineComponent({__name:"list",props:{modelValue:{default:[]},modelModifiers:{}},emits:["update:modelValue"],setup(o){const{props:s}=DR(),i=s.disabledIds||[],u=f.useModel(o,"modelValue"),m=tge(u),h=x=>i.includes(x==null?void 0:x.id),b=()=>{const x=u.value.filter(_=>i.includes(_));u.value=x},C=x=>{h(x)||(u.value=u.value.filter(_=>_!==(x==null?void 0:x.id)))};return(x,_)=>(f.openBlock(),f.createElementBlock("div",DUe,[f.createElementVNode("div",MUe,[f.createElementVNode("div",RUe,[_[0]||(_[0]=f.createTextVNode(" 已选择 ")),f.createElementVNode("span",BUe,f.toDisplayString(u.value.length),1)]),f.createElementVNode("div",{class:"flex flex-center gap-1 color-[#909399] cursor-pointer",onClick:b},_[1]||(_[1]=[f.createElementVNode("div",{class:"i-bi:eraser"},null,-1),f.createTextVNode(" 清空 ")]))]),f.createElementVNode("div",IUe,[f.createElementVNode("div",PUe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(m),N=>(f.openBlock(),f.createElementBlock("div",{key:N==null?void 0:N.id,class:f.normalizeClass(["flex-center gap-2 px-2 rounded-[4px] bg-[#f5f7fa] hover:bg-[#ebedf0] group",{"opacity-50":h(N)}])},[f.createElementVNode("div",FUe,f.toDisplayString(N==null?void 0:N.name),1),h(N)?f.createCommentVNode("",!0):(f.openBlock(),f.createBlock(f.unref(Nn.ElIcon),{key:0,onClick:O=>C(N),class:"cursor-pointer color-[#C0C4CC] group-hover:color-[#909399]"},{default:f.withCtx(()=>[f.createVNode(f.unref(aoe))]),_:2},1032,["onClick"]))],2))),128))])])]))}}),VUe=o=>{const{allData:s}=T4({type:"userIds"});return f.computed(()=>{var b,C;const u=((b=s.value)==null?void 0:b.grouplist)||[],h=(f.toValue(o)||[]).reduce((x,_)=>{const N=_.group_id;return x[N]||(x[N]=[]),x[N].push({..._}),x},{});return(C=u.map(x=>({...x,children:h[x==null?void 0:x.id]||[]})))==null?void 0:C.filter(x=>{var _;return((_=x==null?void 0:x.children)==null?void 0:_.length)>0})})},HUe={class:"h-full flex flex-col"},zUe={class:"px-2"},UUe={class:"flex-grow h-1 overflow-auto px-2"},jUe={class:"img"},WUe={class:"img text-[12px]"},ZUe={key:3,class:"color-[#C0C4CC]"},GUe=f.defineComponent({__name:"department",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const{props:s}=DR(),i=s.multiple,u=s.disabledIds||[],m=f.ref({keyword:""}),h=f.useModel(o,"modelValue"),{data:b,refresh:C}=T4({params:m,type:"userIds"}),x=VUe(b),_=f.computed(()=>(x.value||[]).map(X=>{var q;return{...X,children:(q=X.children)==null?void 0:q.map(W=>({...W,disabled:u.includes(W.id)}))}})),N=f.ref(null);f.watch(()=>h.value,K=>{N.value&&K&&(i?N.value.setCheckedKeys(K):N.value.setCurrentKey(K))},{deep:!0});const O=f.computed(()=>{var X;let K=[];return(X=_.value)==null||X.forEach(q=>{var W,H;K=[...K,...((H=(W=q==null?void 0:q.children)==null?void 0:W.map(me=>me==null?void 0:me.id))==null?void 0:H.filter(Boolean))||[]]}),K.filter(q=>!u.includes(q))}),B=f.computed({get:()=>{var K,X;return!i||!((K=O.value)!=null&&K.length)||!((X=h.value)!=null&&X.length)?!1:O.value.every(q=>{var W;return q&&((W=h.value)==null?void 0:W.includes(q))})},set:K=>{var X;if(i)if(K){const q=((X=O.value)==null?void 0:X.filter(Boolean))||[],W=[...h.value||[],...q];h.value=[...new Set(W)]}else{const W=(h.value||[]).filter(H=>u.includes(H));h.value=W}}}),F=(K,X)=>{if(!i)return;let q=[];const{checkedNodes:W}=X;W.forEach(et=>{(et==null?void 0:et.type)==="user"&&!(et!=null&&et.disabled)&&q.push(et==null?void 0:et.id)});const me=(h.value||[]).filter(et=>u.includes(et));h.value=[...new Set([...q,...me])]},Z=K=>{!i&&(K==null?void 0:K.type)==="user"&&!(K!=null&&K.disabled)&&(h.value=[K==null?void 0:K.id])};return(K,X)=>{var q;return f.openBlock(),f.createElementBlock("div",HUe,[f.createElementVNode("div",zUe,[f.createVNode(f.unref(Nn.ElForm),{inline:!0,model:m.value,onSubmit:X[1]||(X[1]=f.withModifiers(()=>{},["prevent"]))},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElFormItem),{class:"mb-0"},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElInput),{modelValue:m.value.keyword,"onUpdate:modelValue":X[0]||(X[0]=W=>m.value.keyword=W),placeholder:"请输入关键字",clearable:"",class:"w-[160px]",onKeyup:f.withKeys(f.unref(C),["enter"])},null,8,["modelValue","onKeyup"])]),_:1})]),_:1},8,["model"]),f.unref(i)?(f.openBlock(),f.createBlock(f.unref(Nn.ElCheckbox),{key:0,modelValue:B.value,"onUpdate:modelValue":X[2]||(X[2]=W=>B.value=W),label:"全选",size:"large"},null,8,["modelValue"])):f.createCommentVNode("",!0)]),f.createElementVNode("div",UUe,[f.createVNode(f.unref(Nn.ElTree),{class:"tree-picker",ref_key:"treeRef",ref:N,data:_.value,"show-checkbox":f.unref(i),"show-radio":!f.unref(i),"node-key":"id","highlight-current":"","default-checked-keys":f.unref(i)&&Array.isArray(h.value)?h.value:[],"current-node-key":f.unref(i)||(q=h.value)==null?void 0:q[0],onCheck:F,onNodeClick:Z,props:{label:"name",disabled:"disabled"}},{default:f.withCtx(({node:W,data:H})=>{var me,et;return[f.createElementVNode("div",{class:f.normalizeClass(["flex items-center gap-2",{"opacity-50":H==null?void 0:H.disabled}])},[!f.unref(i)&&(H==null?void 0:H.type)==="user"?(f.openBlock(),f.createBlock(f.unref(Nn.ElRadio),{key:0,"model-value":(me=h.value)==null?void 0:me[0],value:H==null?void 0:H.id,disabled:H==null?void 0:H.disabled,size:"large",class:"mr-0"},null,8,["model-value","value","disabled"])):f.createCommentVNode("",!0),(H==null?void 0:H.type)==="user"?(f.openBlock(),f.createBlock(f.unref(Nn.ElImage),{key:1,src:(H==null?void 0:H.face)||"",class:"face-img"},{error:f.withCtx(()=>[f.createElementVNode("div",jUe,[f.createVNode(f.unref(Nn.ElIcon),{size:"14"},{default:f.withCtx(()=>[f.createVNode(f.unref(wR),{color:"#fff"})]),_:1})])]),_:2},1032,["src"])):(f.openBlock(),f.createBlock(f.unref(Nn.ElImage),{key:2,src:(H==null?void 0:H.face)||"",class:"face-img"},{error:f.withCtx(()=>{var $e;return[f.createElementVNode("div",WUe,f.toDisplayString((($e=H==null?void 0:H.name)==null?void 0:$e.charAt(0))||""),1)]}),_:2},1032,["src"])),f.createElementVNode("span",null,f.toDisplayString(W.label),1),(H==null?void 0:H.type)==="group"?(f.openBlock(),f.createElementBlock("span",ZUe," ("+f.toDisplayString((et=H==null?void 0:H.children)==null?void 0:et.length)+") ",1)):f.createCommentVNode("",!0)],2)]}),_:1},8,["data","show-checkbox","show-radio","default-checked-keys","current-node-key"])])])}}}),qUe=$i(GUe,[["__scopeId","data-v-fd7c4b6c"]]),YUe={class:"h-full flex flex-col"},KUe={class:"px-2"},XUe=["onClick"],JUe={class:"flex items-center gap-2"},QUe={class:"img"},eje=f.defineComponent({__name:"people",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const{props:s}=DR(),i=s.multiple,u=s.disabledIds||[],m=f.ref({keyword:""}),h=f.useModel(o,"modelValue"),{data:b,refresh:C}=T4({params:m,type:"userIds"}),x=O=>u.includes(O==null?void 0:O.id),_=f.computed({get:()=>{var B,F;return!i||!((B=b.value)!=null&&B.length)||!((F=h.value)!=null&&F.length)?!1:b.value.filter(Z=>!x(Z)).every(Z=>{var K;return(Z==null?void 0:Z.id)&&((K=h.value)==null?void 0:K.includes(Z.id))})},set:O=>{var B,F;if(i)if(O){const Z=((F=(B=b.value)==null?void 0:B.filter(X=>!x(X)).map(X=>X==null?void 0:X.id))==null?void 0:F.filter(Boolean))||[],K=[...h.value||[],...Z];h.value=[...new Set(K)]}else{const K=(h.value||[]).filter(X=>u.includes(X));h.value=K}}}),N=O=>{if(O!=null&&O.id&&!x(O))if(i){const B=h.value||[];B.includes(O==null?void 0:O.id)?h.value=B.filter(F=>F!==(O==null?void 0:O.id)):h.value=[...B,O==null?void 0:O.id]}else h.value=[O==null?void 0:O.id]};return(O,B)=>(f.openBlock(),f.createElementBlock("div",YUe,[f.createElementVNode("div",KUe,[f.createVNode(f.unref(Nn.ElForm),{inline:!0,model:m.value,onSubmit:B[1]||(B[1]=f.withModifiers(()=>{},["prevent"]))},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElFormItem),{class:"mb-0"},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElInput),{modelValue:m.value.keyword,"onUpdate:modelValue":B[0]||(B[0]=F=>m.value.keyword=F),placeholder:"请输入关键字",clearable:"",class:"w-[160px]",onKeyup:f.withKeys(f.unref(C),["enter"])},null,8,["modelValue","onKeyup"])]),_:1})]),_:1},8,["model"]),f.unref(i)?(f.openBlock(),f.createBlock(f.unref(Nn.ElCheckbox),{key:0,modelValue:_.value,"onUpdate:modelValue":B[2]||(B[2]=F=>_.value=F),label:"全选",size:"large"},null,8,["modelValue"])):f.createCommentVNode("",!0)]),f.createElementVNode("div",{class:f.normalizeClass(["flex-grow h-1 overflow-auto",{"mt-2":!f.unref(i)}])},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(b),(F,Z)=>{var K,X;return f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["flex items-center justify-between cursor-pointer hover:bg-[#f5f7fa] px-2 rounded-[4px]",{"opacity-50 cursor-not-allowed":x(F)}]),key:Z,onClick:q=>N(F)},[f.createElementVNode("div",JUe,[f.unref(i)?(f.openBlock(),f.createBlock(f.unref(Nn.ElCheckbox),{key:0,"model-value":(K=h.value)==null?void 0:K.includes(F==null?void 0:F.id),disabled:x(F),size:"large"},null,8,["model-value","disabled"])):(f.openBlock(),f.createBlock(f.unref(Nn.ElRadio),{key:1,"model-value":(X=h.value)==null?void 0:X[0],value:F==null?void 0:F.id,disabled:x(F),size:"large",class:"mr-0"},null,8,["model-value","value","disabled"])),f.createVNode(f.unref(Nn.ElImage),{src:F.face||"",class:"face-img"},{error:f.withCtx(()=>[f.createElementVNode("div",QUe,[f.createVNode(f.unref(Nn.ElIcon),{size:"16"},{default:f.withCtx(()=>[f.createVNode(f.unref(wR),{color:"#fff"})]),_:1})])]),_:2},1032,["src"]),f.createElementVNode("div",null,f.toDisplayString(F==null?void 0:F.name),1)])],10,XUe)}),128))],2)]))}}),tje=$i(eje,[["__scopeId","data-v-ac82282f"]]),nje=o=>{const{allData:s}=T4({type:"roleIds"});return f.computed(()=>{var b,C;const u=((b=s.value)==null?void 0:b.rolelist)||[],h=(f.toValue(o)||[]).reduce((x,_)=>((_.role||[]).forEach(O=>{x[O]||(x[O]=[]),x[O].some(F=>F.originalId===_.id)||x[O].push({..._,id:`${O}_${_.id}`,originalId:_.id,type:"user"})}),x),{});return(C=u.map(x=>({...x,type:"role",children:h[x==null?void 0:x.id]||[]})))==null?void 0:C.filter(x=>{var _;return((_=x==null?void 0:x.children)==null?void 0:_.length)>0})})},oje={class:"h-full flex flex-col"},sje={class:"px-2"},rje={class:"flex-grow h-1 overflow-auto px-2"},aje={class:"img"},ije={class:"img text-[12px]"},lje={key:3,class:"color-[#C0C4CC]"},cje=f.defineComponent({__name:"role",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const{props:s}=DR(),i=s.multiple,u=s.disabledIds||[],m=f.ref({keyword:""}),h=f.useModel(o,"modelValue"),{data:b,refresh:C}=T4({params:m,type:"userIds"}),x=nje(b),_=f.computed(()=>(x.value||[]).map(W=>{var H;return{...W,children:(H=W.children)==null?void 0:H.map(me=>({...me,disabled:u.includes(me.originalId)}))}})),N=f.ref(null),O=f.computed(()=>{if(!i)return[];const q=[];return(f.toValue(h)||[]).forEach(H=>{var me;(me=_.value)==null||me.forEach(et=>{var $e;($e=et.children)==null||$e.forEach(te=>{te.originalId===H&&q.push(te.id)})})}),q}),B=f.computed(()=>{var W;if(i||!h.value)return;let q;return(W=_.value)==null||W.forEach(H=>{var me;(me=H.children)==null||me.forEach(et=>{et.originalId===h.value&&(q=et.id)})}),q});f.watch(()=>i?O.value:B.value,q=>{N.value&&(i&&q?N.value.setCheckedKeys(q):!i&&q&&N.value.setCurrentKey(q))},{deep:!0});const F=f.computed(()=>{var W;let q=[];return(W=_.value)==null||W.forEach(H=>{var me,et;q=[...q,...((et=(me=H==null?void 0:H.children)==null?void 0:me.map($e=>$e==null?void 0:$e.originalId))==null?void 0:et.filter(Boolean))||[]]}),q.filter(H=>!u.includes(H))}),Z=f.computed({get:()=>{var q,W;return!i||!((q=F.value)!=null&&q.length)||!((W=h.value)!=null&&W.length)?!1:F.value.every(H=>{var me;return H&&((me=h.value)==null?void 0:me.includes(H))})},set:q=>{var W,H,me;if(i)if(q){const et=((W=F.value)==null?void 0:W.filter(Boolean))||[],$e=[...h.value||[],...et];h.value=[...new Set($e)],(H=N==null?void 0:N.value)==null||H.setCheckedNodes([...new Set($e)])}else{const $e=(h.value||[]).filter(We=>u.includes(We));h.value=$e;const te=[];$e.forEach(We=>{var ft;(ft=x.value)==null||ft.forEach(lt=>{var Ne;(Ne=lt.children)==null||Ne.forEach(ue=>{ue.originalId===We&&te.push(ue.id)})})}),(me=N==null?void 0:N.value)==null||me.setCheckedKeys(te)}}}),K=(q,W)=>{var et,$e;if(!i)return;let H=[...h.value||[]];const{checkedKeys:me}=W;if((q==null?void 0:q.type)==="user"&&!(q!=null&&q.disabled)&&(me!=null&&me.includes(q==null?void 0:q.id)?H.push(q==null?void 0:q.originalId):H=H.filter(te=>te!==(q==null?void 0:q.originalId))),(q==null?void 0:q.type)==="role"){const te=((et=q==null?void 0:q.children)==null?void 0:et.filter(lt=>!lt.disabled).map(lt=>lt==null?void 0:lt.originalId))||[];((($e=q==null?void 0:q.children)==null?void 0:$e.filter(lt=>!lt.disabled).map(lt=>lt==null?void 0:lt.id))||[]).every(lt=>me==null?void 0:me.includes(lt))?H=[...H,...te]:H=H.filter(lt=>!te.includes(lt))}h.value=[...new Set(H)]},X=q=>{!i&&(q==null?void 0:q.type)==="user"&&!(q!=null&&q.disabled)&&(h.value=[q==null?void 0:q.originalId])};return(q,W)=>(f.openBlock(),f.createElementBlock("div",oje,[f.createElementVNode("div",sje,[f.createVNode(f.unref(Nn.ElForm),{inline:!0,model:m.value,onSubmit:W[1]||(W[1]=f.withModifiers(()=>{},["prevent"]))},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElFormItem),{class:"mb-0"},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElInput),{modelValue:m.value.keyword,"onUpdate:modelValue":W[0]||(W[0]=H=>m.value.keyword=H),placeholder:"请输入关键字",clearable:"",class:"w-[160px]",onKeyup:f.withKeys(f.unref(C),["enter"])},null,8,["modelValue","onKeyup"])]),_:1})]),_:1},8,["model"]),f.unref(i)?(f.openBlock(),f.createBlock(f.unref(Nn.ElCheckbox),{key:0,modelValue:Z.value,"onUpdate:modelValue":W[2]||(W[2]=H=>Z.value=H),label:"全选",size:"large"},null,8,["modelValue"])):f.createCommentVNode("",!0)]),f.createElementVNode("div",rje,[f.createVNode(f.unref(Nn.ElTree),{class:"tree-picker",ref_key:"treeRef",ref:N,data:_.value,"show-checkbox":f.unref(i),"show-radio":!f.unref(i),"node-key":"id","highlight-current":"","default-checked-keys":f.unref(i)?O.value:[],"current-node-key":f.unref(i)?void 0:B.value,onCheck:K,onNodeClick:X,props:{label:"name",disabled:"disabled"}},{default:f.withCtx(({node:H,data:me})=>{var et,$e;return[f.createElementVNode("div",{class:f.normalizeClass(["flex items-center gap-2",{"opacity-50":me==null?void 0:me.disabled}])},[!f.unref(i)&&(me==null?void 0:me.type)==="user"?(f.openBlock(),f.createBlock(f.unref(Nn.ElRadio),{key:0,class:"mr-0","model-value":(et=h.value)==null?void 0:et[0],value:me==null?void 0:me.originalId,disabled:me==null?void 0:me.disabled,size:"large"},null,8,["model-value","value","disabled"])):f.createCommentVNode("",!0),(me==null?void 0:me.type)==="user"?(f.openBlock(),f.createBlock(f.unref(Nn.ElImage),{key:1,src:(me==null?void 0:me.face)||"",class:"face-img"},{error:f.withCtx(()=>[f.createElementVNode("div",aje,[f.createVNode(f.unref(Nn.ElIcon),{size:"14"},{default:f.withCtx(()=>[f.createVNode(f.unref(wR),{color:"#fff"})]),_:1})])]),_:2},1032,["src"])):(f.openBlock(),f.createBlock(f.unref(Nn.ElImage),{key:2,src:(me==null?void 0:me.face)||"",class:"face-img"},{error:f.withCtx(()=>{var te;return[f.createElementVNode("div",ije,f.toDisplayString(((te=me==null?void 0:me.name)==null?void 0:te.charAt(0))||""),1)]}),_:2},1032,["src"])),f.createElementVNode("span",null,f.toDisplayString(H.label),1),(me==null?void 0:me.type)==="role"?(f.openBlock(),f.createElementBlock("span",lje," ("+f.toDisplayString(($e=me==null?void 0:me.children)==null?void 0:$e.length)+") ",1)):f.createCommentVNode("",!0)],2)]}),_:1},8,["data","show-checkbox","show-radio","default-checked-keys","current-node-key"])])]))}}),uje=$i(cje,[["__scopeId","data-v-f27c1f24"]]),dje={class:"flex flex-row h-[420px]"},fje={class:"w-[50%] border-0 border-r-1 border-solid border-gray-200"},mje={class:"h-full"},pje={class:"w-[50%] pl-2"},gje={class:"h-full flex flex-col"},hje={class:"flex-grow overflow-auto flex-shrink h-1"},vje={class:"flex justify-between"},bje=f.defineComponent({__name:"index",setup(o,{expose:s}){const{props:i}=DR(),u=i.multiple,m=[{label:"按人员",value:"people"},{label:"按部门",value:"department"},{label:"按岗位",value:"role"}],h=f.ref(!1);let b=null;const C=f.ref([]),x=f.ref("people"),_=()=>{b==null||b(C.value),h.value=!1};return s({show:({data:O,callback:B})=>{h.value=!0,C.value=O,b=B}}),(O,B)=>(f.openBlock(),f.createBlock(f.unref(Nn.ElDialog),{modelValue:h.value,"onUpdate:modelValue":B[6]||(B[6]=F=>h.value=F),class:"picker-dialog",title:"选择人员",width:"860px","append-to-body":!0,"destroy-on-close":!0},{footer:f.withCtx(()=>[f.createElementVNode("div",vje,[B[9]||(B[9]=f.createElementVNode("div",null,null,-1)),f.createElementVNode("div",null,[f.createVNode(f.unref(Nn.ElButton),{onClick:B[5]||(B[5]=F=>h.value=!1)},{default:f.withCtx(()=>B[7]||(B[7]=[f.createTextVNode("取消")])),_:1}),f.createVNode(f.unref(Nn.ElButton),{type:"primary",onClick:_},{default:f.withCtx(()=>B[8]||(B[8]=[f.createTextVNode("确定")])),_:1})])])]),default:f.withCtx(()=>[f.createElementVNode("div",dje,[f.createElementVNode("div",fje,[f.createElementVNode("div",mje,[f.createVNode(LUe,{modelValue:C.value,"onUpdate:modelValue":B[0]||(B[0]=F=>C.value=F),multiple:f.unref(u)},null,8,["modelValue","multiple"])])]),f.createElementVNode("div",pje,[f.createElementVNode("div",gje,[f.createVNode(f.unref(Nn.ElTabs),{modelValue:x.value,"onUpdate:modelValue":B[1]||(B[1]=F=>x.value=F)},{default:f.withCtx(()=>[(f.openBlock(),f.createElementBlock(f.Fragment,null,f.renderList(m,F=>f.createVNode(f.unref(Nn.ElTabPane),{label:F.label,name:F.value,key:F.value},null,8,["label","name"])),64))]),_:1},8,["modelValue"]),f.createElementVNode("div",hje,[x.value==="department"?(f.openBlock(),f.createBlock(qUe,{key:0,modelValue:C.value,"onUpdate:modelValue":B[2]||(B[2]=F=>C.value=F),ref:"groupRef",multiple:f.unref(u)},null,8,["modelValue","multiple"])):f.createCommentVNode("",!0),x.value==="role"?(f.openBlock(),f.createBlock(uje,{key:1,modelValue:C.value,"onUpdate:modelValue":B[3]||(B[3]=F=>C.value=F),ref:"roleRef",multiple:f.unref(u)},null,8,["modelValue","multiple"])):f.createCommentVNode("",!0),x.value==="people"?(f.openBlock(),f.createBlock(tje,{key:2,modelValue:C.value,"onUpdate:modelValue":B[4]||(B[4]=F=>C.value=F),ref:"userRef",multiple:f.unref(u)},null,8,["modelValue","multiple"])):f.createCommentVNode("",!0)])])])])]),_:1},8,["modelValue"]))}}),yje={key:0,class:"inline-block"},wje={class:"color-[#409EFF]"},Woe=f.defineComponent({__name:"userPickerDisplay",props:{value:{type:Array,default:()=>[]},isAbbr:{type:Boolean,default:!0},showCount:{type:Number,default:2}},emits:["click"],setup(o,{emit:s}){const i=s,u=o,m=h=>{var x;return!h||h.length===0?"":h.length<=(u==null?void 0:u.showCount)||!(u!=null&&u.isAbbr)?(x=h==null?void 0:h.map(_=>_==null?void 0:_.name))==null?void 0:x.join(","):`${h.slice(0,u==null?void 0:u.showCount).map(_=>(_==null?void 0:_.name)||"").filter(Boolean).join(",")}`};return(h,b)=>{var C,x,_;return f.openBlock(),f.createElementBlock("div",null,[f.createTextVNode(f.toDisplayString(m(u==null?void 0:u.value))+" ",1),((C=u==null?void 0:u.value)==null?void 0:C.length)>=(u==null?void 0:u.showCount)+1&&(u!=null&&u.isAbbr)?(f.openBlock(),f.createElementBlock("div",yje,[b[1]||(b[1]=f.createTextVNode(" 等 ")),f.createElementVNode("span",wje,f.toDisplayString((x=u==null?void 0:u.value)==null?void 0:x.length),1),b[2]||(b[2]=f.createTextVNode(" 人 "))])):f.createCommentVNode("",!0),f.createVNode(f.unref(Nn.ElButton),{size:"small",class:f.normalizeClass(["align-middle",{"ml-2":(_=u==null?void 0:u.value)==null?void 0:_.length}]),onClick:b[0]||(b[0]=()=>{i("click")})},{default:f.withCtx(()=>b[3]||(b[3]=[f.createTextVNode(" 设置 ")])),_:1},8,["class"])])}}}),nge=f.defineComponent({__name:"index",props:f.mergeModels({isAbbr:{type:Boolean,default:!0},showCount:{type:Number,default:2},multiple:{type:Boolean,default:!0},disabledIds:{type:Array,default:()=>[]}},{modelValue:{},modelModifiers:{}}),emits:f.mergeModels(["ok"],["update:modelValue"]),setup(o,{emit:s}){const i=o,u=f.useModel(o,"modelValue"),m=f.ref(null),h=tge(u),b=s,C=()=>{var _;const x=i.multiple?ll(f.toValue(u)):[ll(f.toValue(u))].filter(Boolean);(_=m.value)==null||_.show({data:x,callback:N=>{i.multiple?u.value=N:u.value=N&&N.length>0?N[0]:"",b("ok",u.value)}})};return(x,_)=>(f.openBlock(),f.createBlock(AUe,f.mergeProps({modelValue:u.value,"onUpdate:modelValue":_[0]||(_[0]=N=>u.value=N)},i),{default:f.withCtx(()=>[f.renderSlot(x.$slots,"default",{value:f.unref(h)||[],selectHandler:C},()=>[f.createVNode(Woe,{value:f.unref(h),onClick:C,isAbbr:i==null?void 0:i.isAbbr,showCount:i==null?void 0:i.showCount},null,8,["value","isAbbr","showCount"])]),f.createVNode(bje,{ref_key:"dialogRef",ref:m},null,512)]),_:3},16,["modelValue"]))}}),Cv={userSelector:{},roleByGroup:{}},oge=async(o,s)=>{const i=Date.now();if(Cv[o]&&Cv[o].timestamp+1e4>i)return Cv[o].data;if(Cv[o]&&Cv[o].isFetching)return await Cv[o].promise;Cv[o]={isFetching:!0};const u=s().then(m=>(Cv[o]={data:m,timestamp:i,isFetching:!1},m)).catch(m=>{throw Cv[o].isFetching=!1,m});return Cv[o].promise=u,await u},Cje=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="userSelector_"+JSON.stringify(o);return await oge(u,()=>i.get(`/ajax/userselectornew?${ef.stringify(o)}`))},Sje=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="roleByGroup_"+JSON.stringify(o);return await oge(u,()=>i.get(`/v3role/getByGroup?${ef.stringify(o)}`))},xje=o=>{const{params:s,type:i="userIds"}=o,{http:u}=Iv(),m=f.ref(!1),h=f.ref({userlist:[],rolelist:[],grouplist:[],positionlist:[]}),b=async()=>{const C=f.toValue(s)||{},x=(C==null?void 0:C.groupIds)&&f.toValue(i)==="role",_=x?Sje:Cje;m.value=!0,await(_==null?void 0:_(C,u).then(N=>{x?h.value={...h.value,rolelist:N==null?void 0:N.data}:h.value=N==null?void 0:N.data}).finally(()=>{m.value=!1}))};return f.watch(()=>f.toValue(s),(C,x)=>{di(C,x)||b()},{deep:!0,immediate:!0}),{loading:m,refresh:b,allData:h}},Eje=o=>{const{params:s,type:i="userIds"}=o,u=f.computed(()=>{const{keyword:x,unitId:_,groupIds:N}=f.toValue(s)||{};let O={keyword:x,unitId:_};return i==="roleIds"&&(O={...O,groupIds:N}),O=y2(O),O}),{loading:m,refresh:h,allData:b}=xje({params:u,type:i}),C=f.computed(()=>{var F,Z,K,X,q;let x=[];const{groupIds:_,roleIds:N}=f.toValue(s)||{},O=(F=_==null?void 0:_.split(","))==null?void 0:F.filter(Boolean),B=(Z=N==null?void 0:N.split(","))==null?void 0:Z.filter(Boolean);switch(f.toValue(i)){case"userIds":x=(K=b.value)==null?void 0:K.userlist,(O==null?void 0:O.length)>0&&(x=x.filter(W=>O.includes((W==null?void 0:W.group_id)+""))),(B==null?void 0:B.length)>0&&(x=x.filter(W=>{var H;return((H=b2(B,W==null?void 0:W.role))==null?void 0:H.length)>0}));break;case"roleIds":x=(X=b.value)==null?void 0:X.rolelist;break;case"groupIds":x=(q=b.value)==null?void 0:q.grouplist;break}return x});return{loading:m,data:C,refresh:h,allData:b}},sge=f.defineComponent({__name:"index",props:f.mergeModels({ariaLabel:{},id:{},size:{},disabled:{type:Boolean},modelValue:{},maxlength:{},minlength:{},type:{},resize:{},autosize:{},autocomplete:{},formatter:{},parser:{},placeholder:{},form:{},readonly:{type:Boolean},clearable:{type:Boolean,default:!0},showPassword:{type:Boolean},showWordLimit:{type:Boolean},suffixIcon:{},prefixIcon:{},containerRole:{},tabindex:{},validateEvent:{type:Boolean},inputStyle:{},autofocus:{type:Boolean},rows:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=f.ref({keyword:""}),i=f.useModel(o,"modelValue"),{data:u,loading:m}=Eje({params:s,type:"userIds"}),h=C=>{s.value.keyword=C},b=o;return console.log(b),(C,x)=>(f.openBlock(),f.createBlock(f.unref(Nn.ElSelect),f.mergeProps({modelValue:i.value,"onUpdate:modelValue":x[0]||(x[0]=_=>i.value=_),filterable:"",remote:"","remote-show-suffix":"","remote-method":h,loading:f.unref(m)},f.mergeProps(C.$attrs,b)),{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(u),_=>(f.openBlock(),f.createBlock(f.unref(Nn.ElOption),{key:_.id,label:_.name,value:_.id},null,8,["label","value"]))),128))]),_:1},16,["modelValue","loading"]))}}),_je=Symbol("userPicker"),kje=f.defineComponent({__name:"provider",props:f.mergeModels({multiple:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue"),i=o;return f.provide(_je,{modelValue:s,multiple:i.multiple}),(u,m)=>f.renderSlot(u.$slots,"default")}}),Sv={userSelector:{},roleByGroup:{}},rge=async(o,s)=>{const i=Date.now();if(Sv[o]&&Sv[o].timestamp+1e4>i)return Sv[o].data;if(Sv[o]&&Sv[o].isFetching)return await Sv[o].promise;Sv[o]={isFetching:!0};const u=s().then(m=>(Sv[o]={data:m,timestamp:i,isFetching:!1},m)).catch(m=>{throw Sv[o].isFetching=!1,m});return Sv[o].promise=u,await u},Tje=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="userSelector_"+JSON.stringify(o);return await rge(u,()=>i.get(`/ajax/userselectornew?${ef.stringify(o)}`))},Aje=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="roleByGroup_"+JSON.stringify(o);return await rge(u,()=>i.get(`/v3role/getByGroup?${ef.stringify(o)}`))},Nje=o=>{const{params:s,type:i="userIds"}=o,{http:u}=Iv(),m=f.ref(!1),h=f.ref({userlist:[],rolelist:[],grouplist:[],positionlist:[]}),b=async()=>{const C=f.toValue(s)||{},x=(C==null?void 0:C.groupIds)&&f.toValue(i)==="role",_=x?Aje:Tje;m.value=!0,await(_==null?void 0:_(C,u).then(N=>{x?h.value={...h.value,rolelist:N==null?void 0:N.data}:h.value=N==null?void 0:N.data}).finally(()=>{m.value=!1}))};return f.watch(()=>f.toValue(s),(C,x)=>{di(C,x)||b()},{deep:!0,immediate:!0}),{loading:m,refresh:b,allData:h}},age=o=>{const{params:s,type:i="groupIds"}=o,u=f.computed(()=>{const{keyword:x,unitId:_,groupIds:N}=f.toValue(s)||{};let O={keyword:x,unitId:_};return i==="roleIds"&&(O={...O,groupIds:N}),O=y2(O),O}),{loading:m,refresh:h,allData:b}=Nje({params:u,type:i}),C=f.computed(()=>{var F,Z,K,X,q;let x=[];const{groupIds:_,roleIds:N}=f.toValue(s)||{},O=(F=_==null?void 0:_.split(","))==null?void 0:F.filter(Boolean),B=(Z=N==null?void 0:N.split(","))==null?void 0:Z.filter(Boolean);switch(f.toValue(i)){case"userIds":x=(K=b.value)==null?void 0:K.userlist,(O==null?void 0:O.length)>0&&(x=x.filter(W=>O.includes((W==null?void 0:W.group_id)+""))),(B==null?void 0:B.length)>0&&(x=x.filter(W=>{var H;return((H=b2(B,W==null?void 0:W.role))==null?void 0:H.length)>0}));break;case"roleIds":x=(X=b.value)==null?void 0:X.rolelist;break;case"groupIds":x=(q=b.value)==null?void 0:q.grouplist;break}return x});return{loading:m,data:C,refresh:h,allData:b}},ige=o=>{const{data:s}=age({type:"groupIds"});return f.computed(()=>{var m,h;const u=f.toValue(o);return!u||(u==null?void 0:u.length)===0?[]:Array.isArray(u)?((h=s.value)==null?void 0:h.filter(b=>u.includes(b.id)))||[]:((m=s.value)==null?void 0:m.filter(b=>b.id===u))||[]})},Oje={class:"h-full flex flex-col pr-2"},$je={class:"flex py-1 mb-2 items-center justify-between border-0 border-solid border-b-1 border-[#e4e7ed]"},Dje={class:"color-[#333]"},Mje={class:"color-[#909399]"},Rje={class:"flex-grow h-1 overflow-auto"},Bje={class:"flex flex-wrap gap-2"},Ije={class:"color-[#909399]"},Pje=f.defineComponent({__name:"list",props:{modelValue:{default:[]},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue"),i=ige(s),u=()=>{s.value=[]},m=h=>{s.value=s.value.filter(b=>b!==(h==null?void 0:h.id))};return(h,b)=>(f.openBlock(),f.createElementBlock("div",Oje,[f.createElementVNode("div",$je,[f.createElementVNode("div",Dje,[b[0]||(b[0]=f.createTextVNode(" 已选择 ")),f.createElementVNode("span",Mje,f.toDisplayString(s.value.length),1)]),f.createElementVNode("div",{class:"flex flex-center gap-1 color-[#909399] cursor-pointer",onClick:u},b[1]||(b[1]=[f.createElementVNode("div",{class:"i-bi:eraser"},null,-1),f.createTextVNode(" 清空 ")]))]),f.createElementVNode("div",Rje,[f.createElementVNode("div",Bje,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(i),C=>(f.openBlock(),f.createElementBlock("div",{key:C==null?void 0:C.id,class:"flex-center gap-2 px-2 rounded-[4px] bg-[#f5f7fa] hover:bg-[#ebedf0] group"},[f.createElementVNode("div",Ije,f.toDisplayString(C==null?void 0:C.name),1),f.createVNode(f.unref(Nn.ElIcon),{onClick:x=>m(C),class:"cursor-pointer color-[#C0C4CC] group-hover:color-[#909399]"},{default:f.withCtx(()=>[f.createVNode(f.unref(aoe))]),_:2},1032,["onClick"])]))),128))])])]))}}),Fje={class:"h-full flex flex-col"},Lje={class:"px-2"},Vje=["onClick"],Hje={class:"flex items-center gap-2"},zje={class:"img"},Uje=f.defineComponent({__name:"department",props:f.mergeModels({multiple:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,{multiple:i}=f.toRefs(s),u=f.ref({keyword:""}),m=f.useModel(o,"modelValue"),{data:h,refresh:b}=age({params:u,type:"groupIds"}),C=f.computed({get:()=>{var _,N;return!((_=h.value)!=null&&_.length)||!((N=m.value)!=null&&N.length)?!1:h.value.every(O=>{var B;return(O==null?void 0:O.id)&&((B=m.value)==null?void 0:B.includes(O.id))})},set:_=>{var N,O;if(_){const B=((O=(N=h.value)==null?void 0:N.map(Z=>Z==null?void 0:Z.id))==null?void 0:O.filter(Boolean))||[],F=[...m.value||[],...B];m.value=[...new Set(F)]}else m.value=[]}}),x=_=>{var N,O,B;_!=null&&_.id&&(i.value?(N=m.value)!=null&&N.includes(_==null?void 0:_.id)?m.value=(O=m.value)==null?void 0:O.filter(F=>F!==(_==null?void 0:_.id)):(B=m.value)==null||B.push(_==null?void 0:_.id):m.value=[_==null?void 0:_.id])};return(_,N)=>(f.openBlock(),f.createElementBlock("div",Fje,[f.createElementVNode("div",Lje,[f.createVNode(f.unref(Nn.ElForm),{inline:!0,model:u.value,onSubmit:N[1]||(N[1]=f.withModifiers(()=>{},["prevent"]))},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElFormItem),{class:"mb-0"},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElInput),{modelValue:u.value.keyword,"onUpdate:modelValue":N[0]||(N[0]=O=>u.value.keyword=O),placeholder:"请输入关键字",clearable:"",class:"w-[160px]",onKeyup:f.withKeys(f.unref(b),["enter"])},null,8,["modelValue","onKeyup"])]),_:1})]),_:1},8,["model"]),f.unref(i)?(f.openBlock(),f.createBlock(f.unref(Nn.ElCheckbox),{key:0,modelValue:C.value,"onUpdate:modelValue":N[2]||(N[2]=O=>C.value=O),label:"全选",size:"large"},null,8,["modelValue"])):f.createCommentVNode("",!0)]),f.createElementVNode("div",{class:f.normalizeClass(["flex-grow h-1 overflow-auto",{"mt-2":!f.unref(i)}])},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(h),(O,B)=>{var F,Z;return f.openBlock(),f.createElementBlock("div",{class:"flex items-center justify-between cursor-pointer hover:bg-[#f5f7fa] px-2 rounded-[4px]",key:B,onClick:K=>x(O)},[f.createElementVNode("div",Hje,[f.unref(i)?(f.openBlock(),f.createBlock(f.unref(Nn.ElCheckbox),{key:0,"model-value":(F=m.value)==null?void 0:F.includes(O==null?void 0:O.id),size:"large"},null,8,["model-value"])):(f.openBlock(),f.createBlock(f.unref(Nn.ElRadio),{key:1,"model-value":(Z=m.value)==null?void 0:Z[0],value:O==null?void 0:O.id,size:"large",class:"mr-0"},null,8,["model-value","value"])),f.createVNode(f.unref(Nn.ElImage),{src:O.face||"",class:"face-img"},{error:f.withCtx(()=>[f.createElementVNode("div",zje,[f.createVNode(f.unref(Nn.ElIcon),{size:"16"},{default:f.withCtx(()=>[f.createVNode(f.unref(wR),{color:"#fff"})]),_:1})])]),_:2},1032,["src"]),f.createElementVNode("div",null,f.toDisplayString(O==null?void 0:O.name),1)])],8,Vje)}),128))],2)]))}}),jje=$i(Uje,[["__scopeId","data-v-0a06840f"]]),Wje={class:"flex flex-row h-[420px]"},Zje={class:"w-[50%] border-0 border-r-1 border-solid border-gray-200"},Gje={class:"h-full"},qje={class:"w-[50%] pl-2"},Yje={class:"h-full flex flex-col"},Kje={class:"flex-grow overflow-auto flex-shrink h-1"},Xje={class:"flex justify-between"},Jje=f.defineComponent({__name:"index",setup(o,{expose:s}){const i=f.ref(!1),u=f.ref(!0);let m=null;const h=f.ref([]),b=()=>{m==null||m(h.value),i.value=!1};return s({show:({data:x,callback:_,multiple:N=!0})=>{i.value=!0,u.value=N,h.value=ll(f.toValue(x)),m=_}}),(x,_)=>(f.openBlock(),f.createBlock(f.unref(Nn.ElDialog),{modelValue:i.value,"onUpdate:modelValue":_[3]||(_[3]=N=>i.value=N),class:"picker-dialog",title:"选择部门",width:"860px","append-to-body":!0,"destroy-on-close":!0},{footer:f.withCtx(()=>[f.createElementVNode("div",Xje,[_[6]||(_[6]=f.createElementVNode("div",null,null,-1)),f.createElementVNode("div",null,[f.createVNode(f.unref(Nn.ElButton),{onClick:_[2]||(_[2]=N=>i.value=!1)},{default:f.withCtx(()=>_[4]||(_[4]=[f.createTextVNode("取消")])),_:1}),f.createVNode(f.unref(Nn.ElButton),{type:"primary",onClick:b},{default:f.withCtx(()=>_[5]||(_[5]=[f.createTextVNode("确定")])),_:1})])])]),default:f.withCtx(()=>[f.createElementVNode("div",Wje,[f.createElementVNode("div",Zje,[f.createElementVNode("div",Gje,[f.createVNode(Pje,{modelValue:h.value,"onUpdate:modelValue":_[0]||(_[0]=N=>h.value=N),multiple:u.value},null,8,["modelValue","multiple"])])]),f.createElementVNode("div",qje,[f.createElementVNode("div",Yje,[f.createElementVNode("div",Kje,[f.createVNode(jje,{modelValue:h.value,"onUpdate:modelValue":_[1]||(_[1]=N=>h.value=N),multiple:u.value,ref:"groupRef"},null,8,["modelValue","multiple"])])])])])]),_:1},8,["modelValue"]))}}),Qje={key:0,class:"inline-block"},eWe={class:"color-[#409EFF]"},Zoe=f.defineComponent({__name:"departmentPickerDisplay",props:{value:{type:[Array,String],default:()=>[]},isAbbr:{type:Boolean,default:!0},showCount:{type:Number,default:2}},emits:["click"],setup(o,{emit:s}){const i=s,u=o,m=f.computed(()=>u.value?typeof u.value=="string"?[u.value]:Array.isArray(u.value)?u.value:[]:[]),h=b=>{var _;return!b||b.length===0?"":b.length<=(u==null?void 0:u.showCount)||!u.isAbbr?(_=b==null?void 0:b.map(N=>N==null?void 0:N.name))==null?void 0:_.join(","):`${b.slice(0,u==null?void 0:u.showCount).map(N=>(N==null?void 0:N.name)||"").filter(Boolean).join(",")}`};return(b,C)=>{var x,_,N;return f.openBlock(),f.createElementBlock("div",null,[f.createTextVNode(f.toDisplayString(h(m.value))+" ",1),((x=m.value)==null?void 0:x.length)>=(u==null?void 0:u.showCount)+1&&(u!=null&&u.isAbbr)?(f.openBlock(),f.createElementBlock("div",Qje,[C[1]||(C[1]=f.createTextVNode(" 等 ")),f.createElementVNode("span",eWe,f.toDisplayString((_=m.value)==null?void 0:_.length),1),C[2]||(C[2]=f.createTextVNode(" 部门 "))])):f.createCommentVNode("",!0),f.createVNode(f.unref(Nn.ElButton),{size:"small",class:f.normalizeClass(["align-middle",{"ml-2":(N=m.value)==null?void 0:N.length}]),onClick:C[0]||(C[0]=()=>{i("click")})},{default:f.withCtx(()=>C[3]||(C[3]=[f.createTextVNode(" 设置 ")])),_:1},8,["class"])])}}}),lge=f.defineComponent({__name:"index",props:f.mergeModels({isAbbr:{type:Boolean,default:!0},showCount:{type:Number,default:2},multiple:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=f.useModel(o,"modelValue"),u=f.ref(null),m=ige(i),h=()=>{var C;const b=s.multiple?ll(f.toValue(i)):[ll(f.toValue(i))].filter(Boolean);(C=u.value)==null||C.show({data:b,multiple:s.multiple,callback:x=>{s.multiple?i.value=x:i.value=x&&x.length>0?x[0]:""}})};return(b,C)=>(f.openBlock(),f.createBlock(kje,{modelValue:i.value,"onUpdate:modelValue":C[0]||(C[0]=x=>i.value=x)},{default:f.withCtx(()=>[f.renderSlot(b.$slots,"default",{value:f.unref(m)||[],selectHandler:h},()=>[f.createVNode(Zoe,{value:f.unref(m),onClick:h,isAbbr:s.isAbbr,showCount:s.showCount},null,8,["value","isAbbr","showCount"])]),f.createVNode(Jje,{ref_key:"dialogRef",ref:u},null,512)]),_:3},8,["modelValue"]))}}),xv={userSelector:{},roleByGroup:{}},cge=async(o,s)=>{const i=Date.now();if(xv[o]&&xv[o].timestamp+1e4>i)return xv[o].data;if(xv[o]&&xv[o].isFetching)return await xv[o].promise;xv[o]={isFetching:!0};const u=s().then(m=>(xv[o]={data:m,timestamp:i,isFetching:!1},m)).catch(m=>{throw xv[o].isFetching=!1,m});return xv[o].promise=u,await u},tWe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="userSelector_"+JSON.stringify(o);return await cge(u,()=>i.get(`/ajax/userselectornew?${ef.stringify(o)}`))},nWe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="roleByGroup_"+JSON.stringify(o);return await cge(u,()=>i.get(`/v3role/getByGroup?${ef.stringify(o)}`))},oWe=o=>{const{params:s,type:i="userIds"}=o,{http:u}=Iv(),m=f.ref(!1),h=f.ref({userlist:[],rolelist:[],grouplist:[],positionlist:[]}),b=async()=>{const C=f.toValue(s)||{},x=(C==null?void 0:C.groupIds)&&f.toValue(i)==="role",_=x?nWe:tWe;m.value=!0,await(_==null?void 0:_(C,u).then(N=>{x?h.value={...h.value,rolelist:N==null?void 0:N.data}:h.value=N==null?void 0:N.data}).finally(()=>{m.value=!1}))};return f.watch(()=>f.toValue(s),(C,x)=>{di(C,x)||b()},{deep:!0,immediate:!0}),{loading:m,refresh:b,allData:h}},sWe=o=>{const{params:s,type:i="groupIds"}=o,u=f.computed(()=>{const{keyword:x,unitId:_,groupIds:N}=f.toValue(s)||{};let O={keyword:x,unitId:_};return i==="roleIds"&&(O={...O,groupIds:N}),O=y2(O),O}),{loading:m,refresh:h,allData:b}=oWe({params:u,type:i}),C=f.computed(()=>{var F,Z,K,X,q;let x=[];const{groupIds:_,roleIds:N}=f.toValue(s)||{},O=(F=_==null?void 0:_.split(","))==null?void 0:F.filter(Boolean),B=(Z=N==null?void 0:N.split(","))==null?void 0:Z.filter(Boolean);switch(f.toValue(i)){case"userIds":x=(K=b.value)==null?void 0:K.userlist,(O==null?void 0:O.length)>0&&(x=x.filter(W=>O.includes((W==null?void 0:W.group_id)+""))),(B==null?void 0:B.length)>0&&(x=x.filter(W=>{var H;return((H=b2(B,W==null?void 0:W.role))==null?void 0:H.length)>0}));break;case"roleIds":x=(X=b.value)==null?void 0:X.rolelist;break;case"groupIds":x=(q=b.value)==null?void 0:q.grouplist;break}return x});return{loading:m,data:C,refresh:h,allData:b}},uge=f.defineComponent({__name:"index",props:f.mergeModels({ariaLabel:{},id:{},size:{},disabled:{type:Boolean},modelValue:{},maxlength:{},minlength:{},type:{},resize:{},autosize:{},autocomplete:{},formatter:{},parser:{},placeholder:{},form:{},readonly:{type:Boolean},clearable:{type:Boolean,default:!0},showPassword:{type:Boolean},showWordLimit:{type:Boolean},suffixIcon:{},prefixIcon:{},containerRole:{},tabindex:{},validateEvent:{type:Boolean},inputStyle:{},autofocus:{type:Boolean},rows:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=f.ref({keyword:""}),i=f.useModel(o,"modelValue"),{data:u,loading:m}=sWe({params:s,type:"groupIds"}),h=C=>{s.value.keyword=C},b=o;return console.log(b),(C,x)=>(f.openBlock(),f.createBlock(f.unref(Nn.ElSelect),f.mergeProps({modelValue:i.value,"onUpdate:modelValue":x[0]||(x[0]=_=>i.value=_),filterable:"",remote:"","remote-show-suffix":"","remote-method":h,loading:f.unref(m)},f.mergeProps(C.$attrs,b)),{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(u),_=>(f.openBlock(),f.createBlock(f.unref(Nn.ElOption),{key:_.id,label:_.name,value:_.id},null,8,["label","value"]))),128))]),_:1},16,["modelValue","loading"]))}}),rWe=Symbol("userPicker"),aWe=f.defineComponent({__name:"provider",props:f.mergeModels({multiple:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue"),i=o;return f.provide(rWe,{modelValue:s,multiple:i.multiple}),(u,m)=>f.renderSlot(u.$slots,"default")}}),Ev={userSelector:{},roleByGroup:{}},dge=async(o,s)=>{const i=Date.now();if(Ev[o]&&Ev[o].timestamp+1e4>i)return Ev[o].data;if(Ev[o]&&Ev[o].isFetching)return await Ev[o].promise;Ev[o]={isFetching:!0};const u=s().then(m=>(Ev[o]={data:m,timestamp:i,isFetching:!1},m)).catch(m=>{throw Ev[o].isFetching=!1,m});return Ev[o].promise=u,await u},iWe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="userSelector_"+JSON.stringify(o);return await dge(u,()=>i.get(`/ajax/userselectornew?${ef.stringify(o)}`))},lWe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="roleByGroup_"+JSON.stringify(o);return await dge(u,()=>i.get(`/v3role/getByGroup?${ef.stringify(o)}`))},cWe=o=>{const{params:s,type:i="roleIds"}=o,{http:u}=Iv(),m=f.ref(!1),h=f.ref({userlist:[],rolelist:[],grouplist:[],positionlist:[]}),b=async()=>{const C=f.toValue(s)||{},x=(C==null?void 0:C.groupIds)&&f.toValue(i)==="role",_=x?lWe:iWe;m.value=!0,await(_==null?void 0:_(C,u).then(N=>{x?h.value={...h.value,rolelist:N==null?void 0:N.data}:h.value=N==null?void 0:N.data}).finally(()=>{m.value=!1}))};return f.watch(()=>f.toValue(s),(C,x)=>{di(C,x)||b()},{deep:!0,immediate:!0}),{loading:m,refresh:b,allData:h}},fge=o=>{const{params:s,type:i="roleIds"}=o,u=f.computed(()=>{const{keyword:x,unitId:_,groupIds:N}=f.toValue(s)||{};let O={keyword:x,unitId:_};return i==="roleIds"&&(O={...O,groupIds:N}),O=y2(O),O}),{loading:m,refresh:h,allData:b}=cWe({params:u,type:i}),C=f.computed(()=>{var F,Z,K,X,q;let x=[];const{groupIds:_,roleIds:N}=f.toValue(s)||{},O=(F=_==null?void 0:_.split(","))==null?void 0:F.filter(Boolean),B=(Z=N==null?void 0:N.split(","))==null?void 0:Z.filter(Boolean);switch(f.toValue(i)){case"userIds":x=(K=b.value)==null?void 0:K.userlist,(O==null?void 0:O.length)>0&&(x=x.filter(W=>O.includes((W==null?void 0:W.group_id)+""))),(B==null?void 0:B.length)>0&&(x=x.filter(W=>{var H;return((H=b2(B,W==null?void 0:W.role))==null?void 0:H.length)>0}));break;case"roleIds":x=(X=b.value)==null?void 0:X.rolelist;break;case"groupIds":x=(q=b.value)==null?void 0:q.grouplist;break}return x});return{loading:m,data:C,refresh:h,allData:b}},mge=o=>{const{data:s}=fge({type:"roleIds"});return f.computed(()=>{var m,h;const u=f.toValue(o);return!u||(u==null?void 0:u.length)===0?[]:Array.isArray(u)?((h=s.value)==null?void 0:h.filter(b=>u.includes(b.id)))||[]:((m=s.value)==null?void 0:m.filter(b=>b.id===u))||[]})},uWe={class:"h-full flex flex-col pr-2"},dWe={class:"flex py-1 mb-2 items-center justify-between border-0 border-solid border-b-1 border-[#e4e7ed]"},fWe={class:"color-[#333]"},mWe={class:"color-[#909399]"},pWe={class:"flex-grow h-1 overflow-auto"},gWe={class:"flex flex-wrap gap-2"},hWe={class:"color-[#909399]"},vWe=f.defineComponent({__name:"list",props:{modelValue:{default:[]},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue"),i=mge(s),u=()=>{s.value=[]},m=h=>{s.value=s.value.filter(b=>b!==(h==null?void 0:h.id))};return(h,b)=>(f.openBlock(),f.createElementBlock("div",uWe,[f.createElementVNode("div",dWe,[f.createElementVNode("div",fWe,[b[0]||(b[0]=f.createTextVNode(" 已选择 ")),f.createElementVNode("span",mWe,f.toDisplayString(s.value.length),1)]),f.createElementVNode("div",{class:"flex flex-center gap-1 color-[#909399] cursor-pointer",onClick:u},b[1]||(b[1]=[f.createElementVNode("div",{class:"i-bi:eraser"},null,-1),f.createTextVNode(" 清空 ")]))]),f.createElementVNode("div",pWe,[f.createElementVNode("div",gWe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(i),C=>(f.openBlock(),f.createElementBlock("div",{key:C==null?void 0:C.id,class:"flex-center gap-2 px-2 rounded-[4px] bg-[#f5f7fa] hover:bg-[#ebedf0] group"},[f.createElementVNode("div",hWe,f.toDisplayString(C==null?void 0:C.name),1),f.createVNode(f.unref(Nn.ElIcon),{onClick:x=>m(C),class:"cursor-pointer color-[#C0C4CC] group-hover:color-[#909399]"},{default:f.withCtx(()=>[f.createVNode(f.unref(aoe))]),_:2},1032,["onClick"])]))),128))])])]))}}),bWe={class:"h-full flex flex-col"},yWe={class:"px-2"},wWe=["onClick"],CWe={class:"flex items-center gap-2"},SWe=f.defineComponent({__name:"role",props:f.mergeModels({multiple:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,{multiple:i}=f.toRefs(s),u=f.ref({keyword:""}),m=f.useModel(o,"modelValue"),{data:h,refresh:b}=fge({params:u,type:"roleIds"}),C=f.computed({get:()=>{var _,N;return!((_=h.value)!=null&&_.length)||!((N=m.value)!=null&&N.length)?!1:h.value.every(O=>{var B;return(O==null?void 0:O.id)&&((B=m.value)==null?void 0:B.includes(O.id))})},set:_=>{var N,O;if(_){const B=((O=(N=h.value)==null?void 0:N.map(Z=>Z==null?void 0:Z.id))==null?void 0:O.filter(Boolean))||[],F=[...m.value||[],...B];m.value=[...new Set(F)]}else m.value=[]}}),x=_=>{var N,O,B;_!=null&&_.id&&(i.value?(N=m.value)!=null&&N.includes(_==null?void 0:_.id)?m.value=(O=m.value)==null?void 0:O.filter(F=>F!==(_==null?void 0:_.id)):(B=m.value)==null||B.push(_==null?void 0:_.id):m.value=[_==null?void 0:_.id])};return(_,N)=>(f.openBlock(),f.createElementBlock("div",bWe,[f.createElementVNode("div",yWe,[f.createVNode(f.unref(Nn.ElForm),{inline:!0,model:u.value,onSubmit:N[1]||(N[1]=f.withModifiers(()=>{},["prevent"]))},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElFormItem),{class:"mb-0"},{default:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElInput),{modelValue:u.value.keyword,"onUpdate:modelValue":N[0]||(N[0]=O=>u.value.keyword=O),placeholder:"请输入关键字",clearable:"",class:"w-[160px]",onKeyup:f.withKeys(f.unref(b),["enter"])},null,8,["modelValue","onKeyup"])]),_:1})]),_:1},8,["model"]),f.unref(i)?(f.openBlock(),f.createBlock(f.unref(Nn.ElCheckbox),{key:0,modelValue:C.value,"onUpdate:modelValue":N[2]||(N[2]=O=>C.value=O),label:"全选",size:"large"},null,8,["modelValue"])):f.createCommentVNode("",!0)]),f.createElementVNode("div",{class:f.normalizeClass(["flex-grow h-1 overflow-auto",{"mt-2":!f.unref(i)}])},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(h),(O,B)=>{var F,Z;return f.openBlock(),f.createElementBlock("div",{class:"flex items-center justify-between cursor-pointer hover:bg-[#f5f7fa] px-2 rounded-[4px]",key:B,onClick:K=>x(O)},[f.createElementVNode("div",CWe,[f.unref(i)?(f.openBlock(),f.createBlock(f.unref(Nn.ElCheckbox),{key:0,"model-value":(F=m.value)==null?void 0:F.includes(O==null?void 0:O.id),size:"large"},null,8,["model-value"])):(f.openBlock(),f.createBlock(f.unref(Nn.ElRadio),{key:1,"model-value":(Z=m.value)==null?void 0:Z[0],value:O==null?void 0:O.id,size:"large",class:"mr-0"},null,8,["model-value","value"])),f.createVNode(f.unref(Nn.ElImage),{src:O.face||"",class:"face-img"},{error:f.withCtx(()=>N[3]||(N[3]=[f.createElementVNode("div",{class:"img"},[f.createElementVNode("div",{class:"i-bi:person-vcard color-white text-[16px]"})],-1)])),_:2},1032,["src"]),f.createElementVNode("div",null,f.toDisplayString(O==null?void 0:O.name),1)])],8,wWe)}),128))],2)]))}}),xWe=$i(SWe,[["__scopeId","data-v-97997685"]]),EWe={class:"flex flex-row h-[420px]"},_We={class:"w-[50%] border-0 border-r-1 border-solid border-gray-200"},kWe={class:"h-full"},TWe={class:"w-[50%] pl-2"},AWe={class:"h-full flex flex-col"},NWe={class:"flex-grow overflow-auto flex-shrink h-1"},OWe={class:"flex justify-between"},$We=f.defineComponent({__name:"index",setup(o,{expose:s}){const i=f.ref(!1),u=f.ref(!0);let m=null;const h=f.ref([]),b=()=>{m==null||m(h.value),i.value=!1};return s({show:({data:x,callback:_,multiple:N=!0})=>{i.value=!0,u.value=N,h.value=ll(f.toValue(x)),m=_}}),(x,_)=>(f.openBlock(),f.createBlock(f.unref(Nn.ElDialog),{modelValue:i.value,"onUpdate:modelValue":_[3]||(_[3]=N=>i.value=N),class:"picker-dialog",title:"选择岗位",width:"860px","append-to-body":!0,"destroy-on-close":!0},{footer:f.withCtx(()=>[f.createElementVNode("div",OWe,[_[6]||(_[6]=f.createElementVNode("div",null,null,-1)),f.createElementVNode("div",null,[f.createVNode(f.unref(Nn.ElButton),{onClick:_[2]||(_[2]=N=>i.value=!1)},{default:f.withCtx(()=>_[4]||(_[4]=[f.createTextVNode("取消")])),_:1}),f.createVNode(f.unref(Nn.ElButton),{type:"primary",onClick:b},{default:f.withCtx(()=>_[5]||(_[5]=[f.createTextVNode("确定")])),_:1})])])]),default:f.withCtx(()=>[f.createElementVNode("div",EWe,[f.createElementVNode("div",_We,[f.createElementVNode("div",kWe,[f.createVNode(vWe,{modelValue:h.value,"onUpdate:modelValue":_[0]||(_[0]=N=>h.value=N),multiple:u.value},null,8,["modelValue","multiple"])])]),f.createElementVNode("div",TWe,[f.createElementVNode("div",AWe,[f.createElementVNode("div",NWe,[f.createVNode(xWe,{modelValue:h.value,"onUpdate:modelValue":_[1]||(_[1]=N=>h.value=N),multiple:u.value},null,8,["modelValue","multiple"])])])])])]),_:1},8,["modelValue"]))}}),DWe={key:0,class:"inline-block"},MWe={class:"color-[#409EFF]"},Goe=f.defineComponent({__name:"rolePickerDisplay",props:{value:{type:[Array,String],default:()=>[]},isAbbr:{type:Boolean,default:!0}},emits:["click"],setup(o,{emit:s}){const i=s,u=o,m=f.computed(()=>u.value?typeof u.value=="string"?[u.value]:Array.isArray(u.value)?u.value:[]:[]),h=b=>{var _;return!b||b.length===0?"":b.length<=2||!u.isAbbr?(_=b==null?void 0:b.map(N=>N==null?void 0:N.name))==null?void 0:_.join(","):`${b.slice(0,2).map(N=>(N==null?void 0:N.name)||"").filter(Boolean).join(",")}`};return(b,C)=>{var x,_,N;return f.openBlock(),f.createElementBlock("div",null,[f.createTextVNode(f.toDisplayString(h(m.value))+" ",1),((x=m.value)==null?void 0:x.length)>=3&&(u!=null&&u.isAbbr)?(f.openBlock(),f.createElementBlock("div",DWe,[C[1]||(C[1]=f.createTextVNode(" 等 ")),f.createElementVNode("span",MWe,f.toDisplayString((_=m.value)==null?void 0:_.length),1),C[2]||(C[2]=f.createTextVNode(" 岗位 "))])):f.createCommentVNode("",!0),f.createVNode(f.unref(Nn.ElButton),{size:"small",class:f.normalizeClass(["align-middle",{"ml-2":(N=m.value)==null?void 0:N.length}]),onClick:C[0]||(C[0]=()=>{i("click")})},{default:f.withCtx(()=>C[3]||(C[3]=[f.createTextVNode(" 设置 ")])),_:1},8,["class"])])}}}),pge=f.defineComponent({__name:"index",props:f.mergeModels({isAbbr:{type:Boolean,default:!0},multiple:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=o,i=f.useModel(o,"modelValue"),u=f.ref(null),m=mge(i),h=()=>{var C;const b=s.multiple?ll(f.toValue(i)):[ll(f.toValue(i))].filter(Boolean);(C=u.value)==null||C.show({data:b,multiple:s.multiple,callback:x=>{s.multiple?i.value=x:i.value=x&&x.length>0?x[0]:""}})};return(b,C)=>(f.openBlock(),f.createBlock(aWe,{modelValue:i.value,"onUpdate:modelValue":C[0]||(C[0]=x=>i.value=x)},{default:f.withCtx(()=>[f.renderSlot(b.$slots,"default",{value:f.unref(m)||[],selectHandler:h},()=>[f.createVNode(Goe,{value:f.unref(m),onClick:h,isAbbr:s.isAbbr},null,8,["value","isAbbr"])]),f.createVNode($We,{ref_key:"dialogRef",ref:u},null,512)]),_:3},8,["modelValue"]))}}),_v={userSelector:{},roleByGroup:{}},gge=async(o,s)=>{const i=Date.now();if(_v[o]&&_v[o].timestamp+1e4>i)return _v[o].data;if(_v[o]&&_v[o].isFetching)return await _v[o].promise;_v[o]={isFetching:!0};const u=s().then(m=>(_v[o]={data:m,timestamp:i,isFetching:!1},m)).catch(m=>{throw _v[o].isFetching=!1,m});return _v[o].promise=u,await u},RWe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="userSelector_"+JSON.stringify(o);return await gge(u,()=>i.get(`/ajax/userselectornew?${ef.stringify(o)}`))},BWe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="roleByGroup_"+JSON.stringify(o);return await gge(u,()=>i.get(`/v3role/getByGroup?${ef.stringify(o)}`))},IWe=o=>{const{params:s,type:i="userIds"}=o,{http:u}=Iv(),m=f.ref(!1),h=f.ref({userlist:[],rolelist:[],grouplist:[],positionlist:[]}),b=async()=>{const C=f.toValue(s)||{},x=(C==null?void 0:C.groupIds)&&f.toValue(i)==="role",_=x?BWe:RWe;m.value=!0,await(_==null?void 0:_(C,u).then(N=>{x?h.value={...h.value,rolelist:N==null?void 0:N.data}:h.value=N==null?void 0:N.data}).finally(()=>{m.value=!1}))};return f.watch(()=>f.toValue(s),(C,x)=>{di(C,x)||b()},{deep:!0,immediate:!0}),{loading:m,refresh:b,allData:h}},PWe=o=>{const{params:s,type:i="userIds"}=o,u=f.computed(()=>{const{keyword:x,unitId:_,groupIds:N}=f.toValue(s)||{};let O={keyword:x,unitId:_};return i==="roleIds"&&(O={...O,groupIds:N}),O=y2(O),O}),{loading:m,refresh:h,allData:b}=IWe({params:u,type:i}),C=f.computed(()=>{var F,Z,K,X,q;let x=[];const{groupIds:_,roleIds:N}=f.toValue(s)||{},O=(F=_==null?void 0:_.split(","))==null?void 0:F.filter(Boolean),B=(Z=N==null?void 0:N.split(","))==null?void 0:Z.filter(Boolean);switch(f.toValue(i)){case"userIds":x=(K=b.value)==null?void 0:K.userlist,(O==null?void 0:O.length)>0&&(x=x.filter(W=>O.includes((W==null?void 0:W.group_id)+""))),(B==null?void 0:B.length)>0&&(x=x.filter(W=>{var H;return((H=b2(B,W==null?void 0:W.role))==null?void 0:H.length)>0}));break;case"roleIds":x=(X=b.value)==null?void 0:X.rolelist;break;case"groupIds":x=(q=b.value)==null?void 0:q.grouplist;break}return x});return{loading:m,data:C,refresh:h,allData:b}},hge=f.defineComponent({__name:"index",props:f.mergeModels({ariaLabel:{},id:{},size:{},disabled:{type:Boolean},modelValue:{},maxlength:{},minlength:{},type:{},resize:{},autosize:{},autocomplete:{},formatter:{},parser:{},placeholder:{},form:{},readonly:{type:Boolean},clearable:{type:Boolean,default:!0},showPassword:{type:Boolean},showWordLimit:{type:Boolean},suffixIcon:{},prefixIcon:{},containerRole:{},tabindex:{},validateEvent:{type:Boolean},inputStyle:{},autofocus:{type:Boolean},rows:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const s=f.ref({keyword:""}),i=f.useModel(o,"modelValue"),{data:u,loading:m}=PWe({params:s,type:"roleIds"}),h=C=>{s.value.keyword=C},b=o;return console.log(b),(C,x)=>(f.openBlock(),f.createBlock(f.unref(Nn.ElSelect),f.mergeProps({modelValue:i.value,"onUpdate:modelValue":x[0]||(x[0]=_=>i.value=_),filterable:"",remote:"","remote-show-suffix":"","remote-method":h,loading:f.unref(m)},f.mergeProps(C.$attrs,b)),{default:f.withCtx(()=>[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(u),_=>(f.openBlock(),f.createBlock(f.unref(Nn.ElOption),{key:_.id,label:_.name,value:_.id},null,8,["label","value"]))),128))]),_:1},16,["modelValue","loading"]))}}),kv={userSelector:{},roleByGroup:{}},vge=async(o,s)=>{const i=Date.now();if(kv[o]&&kv[o].timestamp+1e4>i)return kv[o].data;if(kv[o]&&kv[o].isFetching)return await kv[o].promise;kv[o]={isFetching:!0};const u=s().then(m=>(kv[o]={data:m,timestamp:i,isFetching:!1},m)).catch(m=>{throw kv[o].isFetching=!1,m});return kv[o].promise=u,await u},FWe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="userSelector_"+JSON.stringify(o);return await vge(u,()=>i.get(`/ajax/userselectornew?${ef.stringify(o)}`))},LWe=async(o,s)=>{const i=s;if(!i)throw new Error("http 实例未提供");const u="roleByGroup_"+JSON.stringify(o);return await vge(u,()=>i.get(`/v3role/getByGroup?${ef.stringify(o)}`))},VWe=o=>{const{params:s,type:i="userIds"}=o,{http:u}=Iv(),m=f.ref(!1),h=f.ref({userlist:[],rolelist:[],grouplist:[],positionlist:[]}),b=async()=>{const C=f.toValue(s)||{},x=(C==null?void 0:C.groupIds)&&f.toValue(i)==="role",_=x?LWe:FWe;m.value=!0,await(_==null?void 0:_(C,u).then(N=>{x?h.value={...h.value,rolelist:N==null?void 0:N.data}:h.value=N==null?void 0:N.data}).finally(()=>{m.value=!1}))};return f.watch(()=>f.toValue(s),(C,x)=>{di(C,x)||b()},{deep:!0,immediate:!0}),{loading:m,refresh:b,allData:h}},bge=o=>{const{params:s,type:i="groupIds"}=o,u=f.computed(()=>{const{keyword:x,unitId:_,groupIds:N}=f.toValue(s)||{};let O={keyword:x,unitId:_};return i==="roleIds"&&(O={...O,groupIds:N}),O=y2(O),O}),{loading:m,refresh:h,allData:b}=VWe({params:u,type:i}),C=f.computed(()=>{var F,Z,K,X,q;let x=[];const{groupIds:_,roleIds:N}=f.toValue(s)||{},O=(F=_==null?void 0:_.split(","))==null?void 0:F.filter(Boolean),B=(Z=N==null?void 0:N.split(","))==null?void 0:Z.filter(Boolean);switch(f.toValue(i)){case"userIds":x=(K=b.value)==null?void 0:K.userlist,(O==null?void 0:O.length)>0&&(x=x.filter(W=>O.includes((W==null?void 0:W.group_id)+""))),(B==null?void 0:B.length)>0&&(x=x.filter(W=>{var H;return((H=b2(B,W==null?void 0:W.role))==null?void 0:H.length)>0}));break;case"roleIds":x=(X=b.value)==null?void 0:X.rolelist;break;case"groupIds":x=(q=b.value)==null?void 0:q.grouplist;break}return x});return{loading:m,data:C,refresh:h,allData:b}},HWe={class:"w-[420px] flex h-[300px]"},zWe={class:"h-full w-1/2 leftContent flex flex-col pr-2"},UWe={class:"mb-1"},jWe={class:"h-1 overflow-auto flex-grow"},WWe=["onClick"],ZWe={key:0,class:"i-bi:check2"},GWe={class:"h-full w-1/2 flex flex-col pl-2"},qWe={class:"mb-1"},YWe={class:"h-1 overflow-auto flex-grow"},KWe=["onClick"],XWe={key:0,class:"i-bi:check2"},JWe={class:"color-[#6B7280] text-[12px] tips flex items-center pt-2 justify-between"},QWe=f.defineComponent({__name:"roleAndDepartmentSelect",props:{modelValue:{default:{roleId:"",groupId:""}},modelModifiers:{}},emits:f.mergeModels(["ok"],["update:modelValue"]),setup(o,{emit:s}){const i=f.useModel(o,"modelValue"),u=s,m=()=>{u("ok",ll(f.toValue(i)))},h=f.ref(""),b=f.ref(""),{allData:C}=bge({}),x=f.computed(()=>{var O;const N=((O=C.value)==null?void 0:O.grouplist)||[];return b.value?N.filter(B=>{var F;return(F=B==null?void 0:B.name)==null?void 0:F.toLowerCase().includes(b.value.toLowerCase())}):N}),_=f.computed(()=>{var O;const N=((O=C.value)==null?void 0:O.rolelist)||[];return h.value?N.filter(B=>{var F;return(F=B==null?void 0:B.name)==null?void 0:F.toLowerCase().includes(h.value.toLowerCase())}):N});return(N,O)=>(f.openBlock(),f.createElementBlock("div",null,[f.createElementVNode("div",HWe,[f.createElementVNode("div",zWe,[f.createElementVNode("div",UWe,[O[2]||(O[2]=f.createElementVNode("div",{class:"color-[#333] font-bold mb-2"},"选择部门",-1)),f.createVNode(f.unref(Nn.ElInput),{modelValue:b.value,"onUpdate:modelValue":O[0]||(O[0]=B=>b.value=B),placeholder:"请输入关键字",size:"small",clearable:"",class:"w-full"},null,8,["modelValue"])]),f.createElementVNode("div",jWe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(x.value,B=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["flex items-center justify-between hover:bg-[#F5F7FA] rounded-[4px] py-2 px-2 cursor-pointer",{"color-[#409EFF]":(B==null?void 0:B.id)===i.value.groupId}]),key:B==null?void 0:B.id,onClick:F=>i.value.groupId=B==null?void 0:B.id},[f.createTextVNode(f.toDisplayString(B==null?void 0:B.name)+" ",1),(B==null?void 0:B.id)===i.value.groupId?(f.openBlock(),f.createElementBlock("div",ZWe)):f.createCommentVNode("",!0)],10,WWe))),128))])]),f.createElementVNode("div",GWe,[f.createElementVNode("div",qWe,[O[3]||(O[3]=f.createElementVNode("div",{class:"color-[#333] font-bold mb-2"},"选择岗位",-1)),f.createVNode(f.unref(Nn.ElInput),{modelValue:h.value,"onUpdate:modelValue":O[1]||(O[1]=B=>h.value=B),placeholder:"请输入关键字",size:"small",clearable:"",class:"w-full"},null,8,["modelValue"])]),f.createElementVNode("div",YWe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(_.value,B=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["flex items-center justify-between hover:bg-[#F5F7FA] rounded-[4px] py-2 px-2 cursor-pointer",{"color-[#409EFF]":(B==null?void 0:B.id)===i.value.roleId}]),key:B==null?void 0:B.id,onClick:F=>i.value.roleId=B==null?void 0:B.id},[f.createTextVNode(f.toDisplayString(B==null?void 0:B.name)+" ",1),(B==null?void 0:B.id)===i.value.roleId?(f.openBlock(),f.createElementBlock("div",XWe)):f.createCommentVNode("",!0)],10,KWe))),128))])])]),f.createElementVNode("div",JWe,[O[5]||(O[5]=f.createElementVNode("div",null,[f.createElementVNode("span",{class:"font-bold"},"提示:"),f.createTextVNode(" 若部门和岗位均选择不限则视为不限制 ")],-1)),f.createVNode(f.unref(Nn.ElButton),{size:"small",type:"primary",onClick:m},{default:f.withCtx(()=>O[4]||(O[4]=[f.createTextVNode("确定")])),_:1})])]))}}),eZe=$i(QWe,[["__scopeId","data-v-4d4aa43e"]]),tZe=o=>{if(f.toValue(o)){const{allData:s}=bge({type:"groupIds"});return f.computed(()=>{const u=f.toValue(o)||[],m=[];return u.forEach(h=>{var C,x;let b={};if(h.roleId&&((C=s.value)!=null&&C.rolelist)){const _=s.value.rolelist.find(N=>N.id==h.roleId);_&&(b.role=_)}if(h.groupId&&((x=s.value)!=null&&x.grouplist)){const _=s.value.grouplist.find(N=>N.id==h.groupId);_&&(b.group=_)}m.push(b)}),m})}else return f.computed(()=>[])},nZe={class:"w-full"},oZe={class:"flex justify-between header items-center h-[32px]"},sZe={class:"flex gap-1"},rZe={class:"content mt-2"},aZe={class:"flex-center gap-1"},iZe=["onClick"],lZe={key:0,class:"h-[100px] flex-center"},cZe=f.defineComponent({__name:"index",props:{modelValue:{default:[]},modelModifiers:{}},emits:["update:modelValue"],setup(o){const s=f.useModel(o,"modelValue"),i=f.ref({roleId:"",groupId:""}),u=_=>{var N,O;_!=null&&_.roleId&&(_!=null&&_.groupId)&&((N=s.value)!=null&&N.some(F=>F.roleId===_.roleId&&F.groupId===_.groupId)||(s.value=[...s.value||[],_])),(O=m.value)==null||O.hide()},m=f.ref(null),h=tZe(s),b=_=>{var B,F;let N=(B=_==null?void 0:_.role)==null?void 0:B.id,O=(F=_==null?void 0:_.group)==null?void 0:F.id;s.value=s.value.filter(Z=>!di(Z,{roleId:N,groupId:O}))},C=()=>{s.value=[]},x=()=>{i.value={roleId:"",groupId:""}};return(_,N)=>{var O;return f.openBlock(),f.createElementBlock("div",nZe,[f.createElementVNode("div",oZe,[N[3]||(N[3]=f.createElementVNode("div",{class:"color-[#333]"},[f.createTextVNode(" 已选择 "),f.createElementVNode("span",{class:"color-[#909399] text-[13px]"},"(3)")],-1)),f.createElementVNode("div",sZe,[f.createVNode(f.unref(Nn.ElPopover),{ref_key:"popoverRef",ref:m,width:"auto",trigger:"click",onAfterLeave:x},{reference:f.withCtx(()=>[f.createVNode(f.unref(Nn.ElButton),{link:""},{default:f.withCtx(()=>N[1]||(N[1]=[f.createElementVNode("div",{class:"i-bi:plus-lg mr-1"},null,-1),f.createTextVNode(" 增加 ")])),_:1})]),default:f.withCtx(()=>[f.createVNode(eZe,{modelValue:i.value,"onUpdate:modelValue":N[0]||(N[0]=B=>i.value=B),onOk:u},null,8,["modelValue"])]),_:1},512),f.createVNode(f.unref(Nn.ElButton),{link:"",onClick:C},{default:f.withCtx(()=>N[2]||(N[2]=[f.createElementVNode("div",{class:"i-bi:eraser mr-1"},null,-1),f.createTextVNode(" 清空 ")])),_:1})])]),f.createElementVNode("div",rZe,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(f.unref(h),(B,F)=>{var Z,K;return f.openBlock(),f.createElementBlock("div",{key:F,class:"item"},[f.createElementVNode("div",aZe,[N[4]||(N[4]=f.createElementVNode("div",{class:"i-bi:diagram-2 color-[#D4D7DE]"},null,-1)),f.createTextVNode(" "+f.toDisplayString((Z=B==null?void 0:B.group)==null?void 0:Z.name)+" - "+f.toDisplayString((K=B==null?void 0:B.role)==null?void 0:K.name),1)]),f.createElementVNode("div",{class:"i-bi:x-circle-fill color-[#C0C4CC] hover:color-[#409EFF] cursor-pointer",onClick:()=>b(B)},null,8,iZe)])}),128)),((O=f.unref(h))==null?void 0:O.length)>0?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("div",lZe,"暂无数据"))])])}}}),yge=$i(cZe,[["__scopeId","data-v-6811f20c"]]),_ce=Object.freeze(Object.defineProperty({__proto__:null,ConfigProvider:gue,ConfirmTextSetter:Jpe,DateFormatSetter:Xpe,DepartmentPicker:lge,DepartmentPickerDisplay:Zoe,DepartmentSelect:uge,FilePreview:lfe,FormFlow:Ape,FormFlowPreview:Npe,FunctionSelect:_fe,NodeFormula:Efe,NodeSelect:xfe,NodesEditor:Sfe,NodesEditorPreview:kfe,OptionsSetter:Kpe,ProEditor:dfe,ProEditorPreview:ffe,RoleAndDepartmentPicker:yge,RolePicker:pge,RolePickerDisplay:Goe,RoleSelect:hge,UserPicker:nge,UserPickerDisplay:Woe,UserSelect:sge,UserSelector:xde,ZyPageLayout:ife,configProviderContextKey:Xz,defaultConfig:Une,useConfigProvider:Iv},Symbol.toStringTag,{value:"Module"})),wge=Rge;function Cge(o){return Object.keys(_ce).forEach(s=>{o.component(s,_ce[s])}),o}const uZe={install:Cge,version:wge};exports.ConfigProvider=gue;exports.ConfirmTextSetter=Jpe;exports.DateFormatSetter=Xpe;exports.DepartmentPicker=lge;exports.DepartmentPickerDisplay=Zoe;exports.DepartmentSelect=uge;exports.FilePreview=lfe;exports.FormFlow=Ape;exports.FormFlowPreview=Npe;exports.FunctionSelect=_fe;exports.NodeFormula=Efe;exports.NodeSelect=xfe;exports.NodesEditor=Sfe;exports.NodesEditorPreview=kfe;exports.OptionsSetter=Kpe;exports.ProEditor=dfe;exports.ProEditorPreview=ffe;exports.RoleAndDepartmentPicker=yge;exports.RolePicker=pge;exports.RolePickerDisplay=Goe;exports.RoleSelect=hge;exports.UserPicker=nge;exports.UserPickerDisplay=Woe;exports.UserSelect=sge;exports.UserSelector=xde;exports.ZyPageLayout=ife;exports.configProviderContextKey=Xz;exports.default=uZe;exports.defaultConfig=Une;exports.install=Cge;exports.useConfigProvider=Iv;exports.version=wge;
|