twenty-sdk 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/{AllIcons-CGPKtPQS-DL2Ipn0N.mjs → AllIcons-CGPKtPQS-C-ZFgy8B.mjs} +6431 -6459
  2. package/dist/{AllIcons-CGPKtPQS-cyMLi0D3.js → AllIcons-CGPKtPQS-sO2O4z-k.js} +1888 -1908
  3. package/dist/{HtmlTagToRemoteComponent-dGw8vtni.js → HtmlTagToRemoteComponent-B6lQe_K8.js} +1 -1
  4. package/dist/{HtmlTagToRemoteComponent-CnoNG9cX.mjs → HtmlTagToRemoteComponent-DRdIf3GJ.mjs} +1 -1
  5. package/dist/IconWorld-DynX4UYH.mjs +3003 -0
  6. package/dist/IconWorld-JYjJym3l.js +1876 -0
  7. package/dist/_commonjsHelpers-DKOUU3wS.js +1 -0
  8. package/dist/_commonjsHelpers-DaMA6jEr.mjs +8 -0
  9. package/dist/cli/commands/app/app-dev.d.ts +1 -0
  10. package/dist/cli/utilities/config/get-config-path.d.ts +1 -0
  11. package/dist/cli.cjs +57 -226
  12. package/dist/cli.mjs +3619 -8425
  13. package/dist/front-component/index.cjs +1 -1
  14. package/dist/front-component/index.mjs +5099 -2099
  15. package/dist/front-component/remote/generated/remote-components.d.ts +256 -1
  16. package/dist/front-component/remote/generated/remote-elements.d.ts +3141 -2
  17. package/dist/front-component/types/PropertySchema.d.ts +1 -1
  18. package/dist/index.cjs +2 -2
  19. package/dist/index.mjs +344 -166
  20. package/dist/{isValidCountryCode-B7MxBtRC-Do8IFgFH.mjs → isValidCountryCode-ujmwsK7z-B8kSH7O8.mjs} +1170 -1159
  21. package/dist/{isValidCountryCode-B7MxBtRC-BdzSztjn.js → isValidCountryCode-ujmwsK7z-DwSvvT1u.js} +10 -10
  22. package/dist/navigation-_M4-TT0O.js +503 -0
  23. package/dist/{input-r2MHVbqO.mjs → navigation-udgao_jA.mjs} +25155 -23133
  24. package/dist/sdk/front-component-common/index.d.ts +0 -2
  25. package/dist/sdk/index.d.ts +0 -2
  26. package/dist/ui/index.cjs +12 -1980
  27. package/dist/ui/index.mjs +1971 -9520
  28. package/package.json +2 -2
  29. package/dist/input-pdm2U5rP.js +0 -402
  30. package/dist/jsx-runtime-BdMIAavf.mjs +0 -639
  31. package/dist/jsx-runtime-Bglt9wWZ.js +0 -30
  32. package/dist/sdk/front-component-common/AllowedUiComponents.d.ts +0 -9
package/dist/cli.cjs CHANGED
@@ -1,209 +1,40 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var py=Object.create;var vc=Object.defineProperty;var dy=Object.getOwnPropertyDescriptor;var hy=Object.getOwnPropertyNames;var gy=Object.getPrototypeOf,my=Object.prototype.hasOwnProperty;var yy=(n,r,i,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of hy(r))!my.call(n,u)&&u!==i&&vc(n,u,{get:()=>r[u],enumerable:!(o=dy(r,u))||o.enumerable});return n};var _c=(n,r,i)=>(i=n!=null?py(gy(n)):{},yy(r||!n||!n.__esModule?vc(i,"default",{value:n,enumerable:!0}):i,n));const ge=require("path"),vy=require("chalk"),Pc=require("fs-extra"),_y=require("crypto"),xy=require("node:fs/promises"),st=require("./isValidCountryCode-B7MxBtRC-BdzSztjn.js"),Ty=require("@sniptt/guards"),wy=require("lodash.camelcase"),kt=require("./HtmlTagToRemoteComponent-dGw8vtni.js"),Ey=require("fs/promises"),Sy=require("esbuild"),Ay=require("chokidar"),Iy=require("os"),by=require("axios"),Ny=require("fs"),Oy=require("graphql-sse"),Ry=require("typescript"),Cy=require("module"),kc=require("fast-glob"),B=require("./jsx-runtime-Bglt9wWZ.js"),Ly=require("@genql/cli"),Fy=require("inquirer"),Bi=require("uuid"),Uc=require("commander"),Dy=require("util"),pi=n=>n&&n.__esModule?n:{default:n};function wn(n){if(n&&n.__esModule)return n;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const i in n)if(i!=="default"){const o=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(r,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}return r.default=n,Object.freeze(r)}const xe=wn(ge),R=pi(vy),de=wn(Pc),Mc=pi(_y),Py=wn(xy),ky=pi(wy),Ra=wn(Ey),$c=wn(Sy),Bc=pi(Ay),jc=wn(Iy),Mr=pi(by),xc=wn(Ny),ui=wn(Ry),Qt=pi(Fy),Uy=n=>Ty.isNonEmptyString(n)?n[0].toUpperCase()+n.slice(1):"",My=n=>Uy(ky.default(n)),$y=n=>typeof n=="object"&&n!==null&&!Array.isArray(n),Xt=process.env.INIT_CWD||process.cwd(),Di=n=>n&&!n?.startsWith("/")?ge.join(Xt,n):n,By=async(n,r,i)=>{const o=new Set(i),u=r.filter(f=>!o.has(f));for(const f of u){const h=f.replace(/\.tsx?$/,".mjs"),v=xe.default.join(n,h),w=`${v}.map`;await de.remove(v),await de.remove(w)}},jy=async({result:n,appPath:r,fileFolder:i,lastChecksums:o,onFileBuilt:u})=>{const f=Object.keys(n.metafile?.outputs??{}).filter(h=>h.endsWith(".mjs"));for(const h of f){const v=xe.default.resolve(h),w=xe.default.relative(r,v),I=n.metafile?.outputs?.[h]?.entryPoint||"",O=xe.default.relative(r,I),D=await de.readFile(v),P=Mc.default.createHash("md5").update(D).digest("hex");o.get(w)!==P&&(o.set(w,P),u&&await u({fileFolder:i,builtPath:w,sourcePath:O,checksum:P}))}},Wy=["react-dom"],Gy="RemoteComponents",Vy=()=>{const n=Object.keys(kt.HTML_TAG_TO_REMOTE_COMPONENT).join("|");return new RegExp(`(<\\/?)\\b(${n})\\b(?=[\\s>\\/>])`,"g")},qy=Vy(),Jy=n=>n.replace(qy,(r,i,o)=>{const u=kt.HTML_TAG_TO_REMOTE_COMPONENT[o];return st.Tr(u)?`${i}${Gy}.${u}`:r}),zy=/import\s*\{\s*defineFrontComponent\s*\}\s*from\s*['"][^'"]+['"];?\n?/g,Tc=/export\s+default\s+defineFrontComponent\s*\(\s*\{[^}]*component\s*:\s*(\w+)[^}]*\}\s*\)\s*;?/s,Hy=n=>{let r=n.replace(zy,"");const i=r.match(Tc);if(i){const o=i[1],u=new RegExp(`export\\s+(const|function)\\s+${o}\\b`);r=r.replace(u,`$1 ${o}`),r=r.replace(Tc,`export default globalThis.jsx(${o}, {});`)}return r},Qy={name:"jsx-transform-to-remote-dom-worker-format-plugin",setup:n=>{n.onLoad({filter:/\.tsx$/},async({path:r})=>{try{const i=await Py.readFile(r,"utf8"),o=Jy(i),u=o!==i,f=Hy(o);return{contents:u?`var RemoteComponents = globalThis.RemoteComponents;
3
- ${f}`:f,loader:"tsx"}}catch(i){return{errors:[{text:`Failed to transform front component: ${i instanceof Error?i.message:String(i)}`,location:{file:r}}]}}})}},Yy=/^(\w+)\s+as\s+(\w+)$/,Xy=n=>{const r=n.trim(),i=r.match(Yy);if(st.Tr(i)){const[,o,u]=i;return{originalName:o,aliasName:u}}return{originalName:r,aliasName:r}},Ky=n=>n.split(",").map(r=>r.trim()).filter(r=>r.length>0).filter(r=>!r.startsWith("type ")).map(r=>Xy(r).originalName),qr=({sourceContent:n,pattern:r})=>{const i=new Map;let o;for(;st.Tr(o=r.exec(n));){const u=o.groups?.namedImports,f=o.groups?.subPath??"";i.has(f)||i.set(f,new Set),u&&Ky(u).forEach(h=>i.get(f)?.add(h))}return r.lastIndex=0,i},Jr=n=>{const r=n.namespace??n.pluginName;return{name:n.pluginName,setup:i=>{const o=new Map;i.onStart(()=>{o.clear()}),i.onResolve({filter:n.moduleFilter},async({importer:u,path:f})=>{if(u&&!o.has(u))try{const h=await Ra.readFile(u,"utf-8");o.set(u,n.collectImports(h))}catch{o.set(u,new Map)}return{path:u?`${f}?importer=${encodeURIComponent(u)}`:f,namespace:r,pluginData:{importerFilePath:u,originalPath:f}}}),i.onLoad({filter:/.*/,namespace:r},({pluginData:u})=>{const{originalPath:f,importerFilePath:h}=u;if(n.staticContents?.[f])return{contents:n.staticContents[f],loader:"js"};const v=f===n.moduleName?"":f.replace(`${n.moduleName}/`,""),I=o.get(h)?.get(v)??new Set;return{contents:n.generateExports({namedImports:I,moduleSubPath:v}),loader:"js"}})}}},Ea=/import\s+(?:(?<defaultImport>\w+)\s*,?\s*)?(?:\{(?<namedImports>[^}]*)\})?\s*from\s*['"]react['"];?/g,Zy=/^react(\/jsx-runtime)?$/,ev=`
2
+ "use strict";var am=Object.create;var ou=Object.defineProperty;var om=Object.getOwnPropertyDescriptor;var um=Object.getOwnPropertyNames;var cm=Object.getPrototypeOf,lm=Object.prototype.hasOwnProperty;var fm=(c,a,i,f)=>{if(a&&typeof a=="object"||typeof a=="function")for(let g of um(a))!lm.call(c,g)&&g!==i&&ou(c,g,{get:()=>a[g],enumerable:!(f=om(a,g))||f.enumerable});return c};var uu=(c,a,i)=>(i=c!=null?am(cm(c)):{},fm(a||!c||!c.__esModule?ou(i,"default",{value:c,enumerable:!0}):i,c));const ie=require("path"),hm=require("chalk"),gu=require("fs-extra"),pm=require("crypto"),dm=require("node:fs/promises"),je=require("./isValidCountryCode-ujmwsK7z-DwSvvT1u.js"),gm=require("@sniptt/guards"),mm=require("lodash.camelcase"),ft=require("./HtmlTagToRemoteComponent-B6lQe_K8.js"),vm=require("fs/promises"),_m=require("esbuild"),wm=require("chokidar"),ym=require("os"),xm=require("axios"),Sm=require("fs"),Am=require("graphql-sse"),As=require("graphql/index"),bm=require("typescript"),Em=require("module"),mu=require("fast-glob"),W=require("react/jsx-runtime"),Cm=require("@genql/cli"),Tm=require("inquirer"),bt=require("./_commonjsHelpers-DKOUU3wS.js"),Qn=require("uuid"),vu=require("commander"),Fm=require("util"),Rn=c=>c&&c.__esModule?c:{default:c};function Gt(c){if(c&&c.__esModule)return c;const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const i in c)if(i!=="default"){const f=Object.getOwnPropertyDescriptor(c,i);Object.defineProperty(a,i,f.get?f:{enumerable:!0,get:()=>c[i]})}}return a.default=c,Object.freeze(a)}const ee=Gt(ie),b=Rn(hm),V=Gt(gu),_u=Rn(pm),Im=Gt(dm),Rm=Rn(mm),Fs=Gt(vm),wu=Gt(_m),yu=Rn(wm),Is=Gt(ym),zr=Rn(xm),cu=Gt(Sm),Fn=Gt(bm),At=Rn(Tm),Pm=c=>gm.isNonEmptyString(c)?c[0].toUpperCase()+c.slice(1):"",Om=c=>Pm(Rm.default(c)),Lm=c=>typeof c=="object"&&c!==null&&!Array.isArray(c),Et=process.env.INIT_CWD||process.cwd(),Yn=c=>c&&!c?.startsWith("/")?ie.join(Et,c):c,Mm=async(c,a,i)=>{const f=new Set(i),g=a.filter(_=>!f.has(_));for(const _ of g){const S=_.replace(/\.tsx?$/,".mjs"),A=ee.default.join(c,S),I=`${A}.map`;await V.remove(A),await V.remove(I)}},Nm=async({result:c,appPath:a,fileFolder:i,lastChecksums:f,onFileBuilt:g})=>{const _=Object.keys(c.metafile?.outputs??{}).filter(S=>S.endsWith(".mjs"));for(const S of _){const A=ee.default.resolve(S),I=ee.default.relative(a,A),P=c.metafile?.outputs?.[S]?.entryPoint||"",J=ee.default.relative(a,P),G=await V.readFile(A),K=_u.default.createHash("md5").update(G).digest("hex");f.get(I)!==K&&(f.set(I,K),g&&await g({fileFolder:i,builtPath:I,sourcePath:J,checksum:K}))}},Um=["react-dom"],Wm="RemoteComponents",Dm=()=>{const c=Object.keys(ft.HTML_TAG_TO_REMOTE_COMPONENT).join("|");return new RegExp(`(<\\/?)\\b(${c})\\b(?=[\\s>\\/>])`,"g")},$m=Dm(),Bm=c=>c.replace($m,(a,i,f)=>{const g=ft.HTML_TAG_TO_REMOTE_COMPONENT[f];return je.Tr(g)?`${i}${Wm}.${g}`:a}),km=/import\s*\{\s*defineFrontComponent\s*\}\s*from\s*['"][^'"]+['"];?\n?/g,lu=/export\s+default\s+defineFrontComponent\s*\(\s*\{[^}]*component\s*:\s*(\w+)[^}]*\}\s*\)\s*;?/s,jm=c=>{let a=c.replace(km,"");const i=a.match(lu);if(i){const f=i[1],g=new RegExp(`export\\s+(const|function)\\s+${f}\\b`);a=a.replace(g,`$1 ${f}`),a=a.replace(lu,`export default globalThis.jsx(${f}, {});`)}return a},qm={name:"jsx-transform-to-remote-dom-worker-format-plugin",setup:c=>{c.onLoad({filter:/\.tsx$/},async({path:a})=>{try{const i=await Im.readFile(a,"utf8"),f=Bm(i),g=f!==i,_=jm(f);return{contents:g?`var RemoteComponents = globalThis.RemoteComponents;
3
+ ${_}`:_,loader:"tsx"}}catch(i){return{errors:[{text:`Failed to transform front component: ${i instanceof Error?i.message:String(i)}`,location:{file:a}}]}}})}},Gm=/^(\w+)\s+as\s+(\w+)$/,Hm=c=>{const a=c.trim(),i=a.match(Gm);if(je.Tr(i)){const[,f,g]=i;return{originalName:f,aliasName:g}}return{originalName:a,aliasName:a}},Km=c=>c.split(",").map(a=>a.trim()).filter(a=>a.length>0).filter(a=>!a.startsWith("type ")).map(a=>Hm(a).originalName),Zr=({sourceContent:c,pattern:a})=>{const i=new Map;let f;for(;je.Tr(f=a.exec(c));){const g=f.groups?.namedImports,_=f.groups?.subPath??"";i.has(_)||i.set(_,new Set),g&&Km(g).forEach(S=>i.get(_)?.add(S))}return a.lastIndex=0,i},Xr=c=>{const a=c.namespace??c.pluginName;return{name:c.pluginName,setup:i=>{const f=new Map;i.onStart(()=>{f.clear()}),i.onResolve({filter:c.moduleFilter},async({importer:g,path:_})=>{if(g&&!f.has(g))try{const S=await Fs.readFile(g,"utf-8");f.set(g,c.collectImports(S))}catch{f.set(g,new Map)}return{path:g?`${_}?importer=${encodeURIComponent(g)}`:_,namespace:a,pluginData:{importerFilePath:g,originalPath:_}}}),i.onLoad({filter:/.*/,namespace:a},({pluginData:g})=>{const{originalPath:_,importerFilePath:S}=g;if(c.staticContents?.[_])return{contents:c.staticContents[_],loader:"js"};const A=_===c.moduleName?"":_.replace(`${c.moduleName}/`,""),P=f.get(S)?.get(A)??new Set;return{contents:c.generateExports({namedImports:P,moduleSubPath:A}),loader:"js"}})}}},bs=/import\s+(?:(?<defaultImport>\w+)\s*,?\s*)?(?:\{(?<namedImports>[^}]*)\})?\s*from\s*['"]react['"];?/g,zm=/^react(\/jsx-runtime)?$/,Jm=`
4
4
  export var jsx = /* @__PURE__ */ (() => globalThis.jsx)();
5
5
  export var jsxs = /* @__PURE__ */ (() => globalThis.jsxs)();
6
6
  export var Fragment = /* @__PURE__ */ (() => globalThis.React.Fragment)();
7
- `.trim(),tv=n=>{const r=qr({sourceContent:n,pattern:Ea});let i;for(;st.Tr(i=Ea.exec(n));)i.groups?.defaultImport&&(r.has("")||r.set("",new Set),r.get("").add("default"));return Ea.lastIndex=0,r},nv=({namedImports:n})=>{const r=[];for(const i of n)i==="default"?r.push("export default /* @__PURE__ */ (() => globalThis.React)();"):r.push(`export var ${i} = /* @__PURE__ */ (() => globalThis.React.${i})();`);return r.join(`
8
- `)},iv=Jr({pluginName:"react-globals",namespace:"react-globals",moduleName:"react",moduleFilter:Zy,collectImports:tv,generateExports:nv,staticContents:{"react/jsx-runtime":ev}}),rv=/^\/\/.*$\n/gm,sv={name:"strip-comments",setup:n=>{n.onEnd(async r=>{if(r.errors.length>0)return;const i=Object.keys(r.metafile?.outputs??{}).filter(o=>o.endsWith(".mjs"));for(const o of i){const u=xe.default.resolve(o),f=await Ra.readFile(u,"utf-8"),h=f.replace(rv,"");h!==f&&await Ra.writeFile(u,h,"utf-8")}})}},av=/import\s+(?:\{(?<namedImports>[^}]*)\})?\s*from\s*['"]twenty-sdk['"];?/g,ov=/^twenty-sdk$/,uv=Jr({pluginName:"twenty-sdk-globals",namespace:"twenty-sdk-globals",moduleName:"twenty-sdk",moduleFilter:ov,collectImports:n=>qr({sourceContent:n,pattern:av}),generateExports:({namedImports:n})=>[...n].map(r=>`export var ${r} = /* @__PURE__ */ (() => globalThis.TwentySdk.${r})();`).join(`
9
- `)}),cv=/import\s+\{(?<namedImports>[^}]*)\}\s*from\s*['"]twenty-sdk\/ui['"];?/g,lv=/^twenty-sdk\/ui$/,fv=Jr({pluginName:"twenty-sdk-ui-globals",namespace:"twenty-sdk-ui-globals",moduleName:"twenty-sdk/ui",moduleFilter:lv,collectImports:n=>qr({sourceContent:n,pattern:cv}),generateExports:({namedImports:n})=>[...n].map(r=>`export var ${r} = /* @__PURE__ */ (() => globalThis.RemoteComponents.TwentyUi${r})();`).join(`
10
- `)}),pv=/import\s+\{(?<namedImports>[^}]*)\}\s*from\s*['"]twenty-shared(?:\/(?<subPath>[^'"]*?))?['"];?/g,dv=/^twenty-shared(\/.*)?$/,hv=n=>n===""?"globalThis.TwentyShared":`globalThis.TwentyShared['${n}']`,gv=Jr({pluginName:"twenty-shared-globals",namespace:"twenty-shared-globals",moduleName:"twenty-shared",moduleFilter:dv,collectImports:n=>qr({sourceContent:n,pattern:pv}),generateExports:({namedImports:n,moduleSubPath:r})=>{const i=hv(r);return[...n].map(o=>`export var ${o} = /* @__PURE__ */ (() => ${i}.${o})();`).join(`
11
- `)}}),mv=()=>[iv,uv,fv,gv,Qy,sv],ka="public",yv="TWENTY_API_KEY",vv="TWENTY_API_URL",_v={js:`import { createRequire as __createRequire } from 'module';
12
- const require = __createRequire(import.meta.url);`},vn=".twenty/output";var De=(n=>(n.Object="object",n.Field="field",n.LogicFunction="logicFunction",n.FrontComponent="frontComponent",n.Role="role",n))(De||{});const xv=["path","fs","crypto","stream","util","os","url","http","https","events","buffer","querystring","assert","zlib","net","tls","child_process","worker_threads","twenty-sdk","twenty-sdk/*","twenty-shared","twenty-shared/*"];class Wc{constructor(r){this.esBuildContext=null,this.isRestarting=!1,this.lastChecksums=new Map,this.buildCompletePromise=Promise.resolve(),this.resolveBuildComplete=null,this.appPath=r.appPath,this.sourcePaths=r.sourcePaths,this.watchMode=r.watch??!0,this.onFileBuilt=r.handleFileBuilt,this.onBuildError=r.handleBuildError,this.config=r.config}shouldRestart(r){const i=this.sourcePaths.sort().join(","),o=[...r].sort().join(",");return i!==o}async start(){this.sourcePaths.length>0&&await this.createContext()}async close(){await this.esBuildContext?.dispose(),this.esBuildContext=null}async restart(r){if(!this.isRestarting){this.isRestarting=!0;try{await this.close();const i=xe.default.join(this.appPath,vn);await By(i,this.sourcePaths,r),this.sourcePaths=r,this.lastChecksums.clear(),this.sourcePaths.length>0&&await this.createContext()}finally{this.isRestarting=!1}}}async createContext(){const r=xe.default.join(this.appPath,vn),i={};for(const f of this.sourcePaths){const h=f.replace(/\.tsx?$/,"");i[h]=xe.default.join(this.appPath,f)}const o=this,u=[...this.config.extraPlugins??[],{name:"build-notifications",setup:f=>{f.onEnd(async h=>{try{if(h.errors.length>0){h.errors[0].text.includes("Could not resolve")||await this.onBuildError?.(h.errors.map(v=>({error:v.text,location:v.location})));return}await jy({result:h,appPath:this.appPath,fileFolder:this.config.fileFolder,lastChecksums:o.lastChecksums,onFileBuilt:o.onFileBuilt})}finally{o.resolveBuildComplete?.()}})}}];this.esBuildContext=await $c.context({entryPoints:i,bundle:!0,splitting:!1,format:"esm",platform:this.config.platform,outdir:r,outExtension:{".js":".mjs"},external:this.config.externalModules,tsconfig:xe.default.join(this.appPath,"tsconfig.json"),jsx:this.config.jsx,sourcemap:!0,metafile:!0,logLevel:"silent",minify:this.config.minify,banner:this.config.banner,plugins:u}),this.buildCompletePromise=new Promise(f=>{this.resolveBuildComplete=f}),await this.esBuildContext.rebuild(),await this.buildCompletePromise,this.watchMode&&await this.esBuildContext.watch()}}const Tv={name:"external-patterns",setup:n=>{n.onResolve({filter:/(?:^|\/)generated(?:\/|$)/},r=>({path:r.path,external:!0}))}},wv=n=>new Wc({...n,config:{externalModules:xv,fileFolder:kt.N.BuiltLogicFunction,platform:"node",extraPlugins:[Tv],banner:_v}}),Ev=n=>new Wc({...n,config:{externalModules:Wy,fileFolder:kt.N.BuiltFrontComponent,jsx:"automatic",extraPlugins:mv()}});class Sv{constructor(r){this.watcher=null,this.appPath=r.appPath,this.handleChangeDetected=r.handleChangeDetected}async start(){this.watcher=Bc.default.watch(this.appPath,{awaitWriteFinish:{stabilityThreshold:100,pollInterval:50},usePolling:!0}),this.watcher.on("all",async(r,i)=>{if(r==="addDir")return;const o=ge.relative(this.appPath,i),u=o.startsWith("node_modules")||o.startsWith("generated")||o.startsWith("dist"),f=o.startsWith(ka),h=["package.json","yarn.lock"].includes(o),v=o.endsWith(".ts")||o.endsWith(".tsx"),w=o.startsWith(".");(u||!v||w)&&!f&&!h||this.handleChangeDetected(o,r)})}async close(){await this.watcher?.close()}}const Av=({manifest:n,builtFileInfos:r})=>{let i=structuredClone(n);for(const[o,{fileFolder:u,checksum:f}]of r.entries()){const h=ge.relative(vn,o);if(u===kt.N.BuiltLogicFunction){const v=i.logicFunctions,w=v.findIndex(I=>I.builtHandlerPath===h);if(w===-1)continue;i={...i,logicFunctions:v.map((I,O)=>O===w?{...I,builtHandlerChecksum:f}:I)}}if(u===kt.N.PublicAsset){const v=i.publicAssets,w=v.findIndex(I=>I.filePath===h);if(w===-1)continue;i={...i,publicAssets:v.map((I,O)=>O===w?{...I,checksum:f}:I)};continue}if(u===kt.N.BuiltFrontComponent){const v=i.frontComponents,w=v.findIndex(I=>I.builtComponentPath===h)??-1;if(w===-1)continue;i={...i,frontComponents:v.map((I,O)=>O===w?{...I,builtComponentChecksum:f}:I)}}u===kt.N.Dependencies&&(h==="package.json"&&(i.application.packageJsonChecksum=f),h==="yarn.lock"&&(i.application.yarnLockChecksum=f))}return i},Iv=async(n,r)=>{const i=xe.default.join(n,vn);await de.ensureDir(i);const o=xe.default.join(i,"manifest.json");return await de.writeJSON(o,r,{spaces:2}),o},Ht="default",Vr=class Vr{constructor(){this.configPath=xe.join(jc.homedir(),".twenty","config.json")}static setActiveWorkspace(r){this.activeWorkspace=r??Ht}static getActiveWorkspace(){return this.activeWorkspace}getActiveWorkspaceName(){return Vr.getActiveWorkspace()}async readRawConfig(){await de.ensureFile(this.configPath);const r=await de.readFile(this.configPath,"utf8");return JSON.parse(r||"{}")}async getConfig(){return this.getConfigForWorkspace(this.getActiveWorkspaceName())}async getConfigForWorkspace(r){const i=this.getDefaultConfig();try{const o=await this.readRawConfig(),u=r===Ht&&!o.profiles?.[Ht]?o:o.profiles?.[r],f=u?.apiUrl??i.apiUrl,h=u?.apiKey;return{apiUrl:f,apiKey:h}}catch{return i}}async setConfig(r){const i=await this.readRawConfig(),o=this.getActiveWorkspaceName();i.profiles||(i.profiles={});const u=i.profiles[o]||{apiUrl:""};i.profiles[o]={...u,...r},await de.ensureDir(xe.dirname(this.configPath)),await de.writeFile(this.configPath,JSON.stringify(i,null,2))}async clearConfig(){const r=await this.readRawConfig(),i=this.getActiveWorkspaceName();if(r.profiles||(r.profiles={}),r.profiles[i]&&delete r.profiles[i],i===Ht){const o=this.getDefaultConfig();delete r.apiKey,r.apiUrl=o.apiUrl}await de.ensureDir(xe.dirname(this.configPath)),await de.writeFile(this.configPath,JSON.stringify(r,null,2))}getDefaultConfig(){return{apiUrl:"http://localhost:3000"}}async getAvailableWorkspaces(){try{const r=await this.readRawConfig(),i=new Set;return i.add(Ht),r.profiles&&Object.keys(r.profiles).forEach(o=>i.add(o)),Array.from(i).sort()}catch{return[Ht]}}async getDefaultWorkspace(){try{return(await this.readRawConfig()).defaultWorkspace??Ht}catch{return Ht}}async setDefaultWorkspace(r){const i=await this.readRawConfig();i.defaultWorkspace=r,await de.ensureDir(xe.dirname(this.configPath)),await de.writeFile(this.configPath,JSON.stringify(i,null,2))}};Vr.activeWorkspace=Ht;let je=Vr;function ue(n,r){if(!!!n)throw new Error(r)}function Zt(n){return typeof n=="object"&&n!==null}function ji(n,r){if(!!!n)throw new Error(r??"Unexpected invariant triggered.")}const bv=/\r\n|[\n\r]/g;function Ca(n,r){let i=0,o=1;for(const u of n.body.matchAll(bv)){if(typeof u.index=="number"||ji(!1),u.index>=r)break;i=u.index+u[0].length,o+=1}return{line:o,column:r+1-i}}function Nv(n){return Gc(n.source,Ca(n.source,n.start))}function Gc(n,r){const i=n.locationOffset.column-1,o="".padStart(i)+n.body,u=r.line-1,f=n.locationOffset.line-1,h=r.line+f,v=r.line===1?i:0,w=r.column+v,I=`${n.name}:${h}:${w}
13
- `,O=o.split(/\r\n|[\n\r]/g),D=O[u];if(D.length>120){const P=Math.floor(w/80),M=w%80,$=[];for(let he=0;he<D.length;he+=80)$.push(D.slice(he,he+80));return I+wc([[`${h} |`,$[0]],...$.slice(1,P+1).map(he=>["|",he]),["|","^".padStart(M)],["|",$[P+1]]])}return I+wc([[`${h-1} |`,O[u-1]],[`${h} |`,D],["|","^".padStart(w)],[`${h+1} |`,O[u+1]]])}function wc(n){const r=n.filter(([o,u])=>u!==void 0),i=Math.max(...r.map(([o])=>o.length));return r.map(([o,u])=>o.padStart(i)+(u?" "+u:"")).join(`
14
- `)}function Ov(n){const r=n[0];return r==null||"kind"in r||"length"in r?{nodes:r,source:n[1],positions:n[2],path:n[3],originalError:n[4],extensions:n[5]}:r}class fe extends Error{constructor(r,...i){var o,u,f;const{nodes:h,source:v,positions:w,path:I,originalError:O,extensions:D}=Ov(i);super(r),this.name="GraphQLError",this.path=I??void 0,this.originalError=O??void 0,this.nodes=Ec(Array.isArray(h)?h:h?[h]:void 0);const P=Ec((o=this.nodes)===null||o===void 0?void 0:o.map($=>$.loc).filter($=>$!=null));this.source=v??(P==null||(u=P[0])===null||u===void 0?void 0:u.source),this.positions=w??P?.map($=>$.start),this.locations=w&&v?w.map($=>Ca(v,$)):P?.map($=>Ca($.source,$.start));const M=Zt(O?.extensions)?O?.extensions:void 0;this.extensions=(f=D??M)!==null&&f!==void 0?f:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),O!=null&&O.stack?Object.defineProperty(this,"stack",{value:O.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,fe):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let r=this.message;if(this.nodes)for(const i of this.nodes)i.loc&&(r+=`
15
-
16
- `+Nv(i.loc));else if(this.source&&this.locations)for(const i of this.locations)r+=`
17
-
18
- `+Gc(this.source,i);return r}toJSON(){const r={message:this.message};return this.locations!=null&&(r.locations=this.locations),this.path!=null&&(r.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(r.extensions=this.extensions),r}}function Ec(n){return n===void 0||n.length===0?void 0:n}function ke(n,r,i){return new fe(`Syntax Error: ${i}`,{source:n,positions:[r]})}class Rv{constructor(r,i,o){this.start=r.start,this.end=i.end,this.startToken=r,this.endToken=i,this.source=o}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Vc{constructor(r,i,o,u,f,h){this.kind=r,this.start=i,this.end=o,this.line=u,this.column=f,this.value=h,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const qc={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Cv=new Set(Object.keys(qc));function Sc(n){const r=n?.kind;return typeof r=="string"&&Cv.has(r)}var Yt;(function(n){n.QUERY="query",n.MUTATION="mutation",n.SUBSCRIPTION="subscription"})(Yt||(Yt={}));var se;(function(n){n.QUERY="QUERY",n.MUTATION="MUTATION",n.SUBSCRIPTION="SUBSCRIPTION",n.FIELD="FIELD",n.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",n.FRAGMENT_SPREAD="FRAGMENT_SPREAD",n.INLINE_FRAGMENT="INLINE_FRAGMENT",n.VARIABLE_DEFINITION="VARIABLE_DEFINITION",n.SCHEMA="SCHEMA",n.SCALAR="SCALAR",n.OBJECT="OBJECT",n.FIELD_DEFINITION="FIELD_DEFINITION",n.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.ENUM_VALUE="ENUM_VALUE",n.INPUT_OBJECT="INPUT_OBJECT",n.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(se||(se={}));var N;(function(n){n.NAME="Name",n.DOCUMENT="Document",n.OPERATION_DEFINITION="OperationDefinition",n.VARIABLE_DEFINITION="VariableDefinition",n.SELECTION_SET="SelectionSet",n.FIELD="Field",n.ARGUMENT="Argument",n.FRAGMENT_SPREAD="FragmentSpread",n.INLINE_FRAGMENT="InlineFragment",n.FRAGMENT_DEFINITION="FragmentDefinition",n.VARIABLE="Variable",n.INT="IntValue",n.FLOAT="FloatValue",n.STRING="StringValue",n.BOOLEAN="BooleanValue",n.NULL="NullValue",n.ENUM="EnumValue",n.LIST="ListValue",n.OBJECT="ObjectValue",n.OBJECT_FIELD="ObjectField",n.DIRECTIVE="Directive",n.NAMED_TYPE="NamedType",n.LIST_TYPE="ListType",n.NON_NULL_TYPE="NonNullType",n.SCHEMA_DEFINITION="SchemaDefinition",n.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",n.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",n.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",n.FIELD_DEFINITION="FieldDefinition",n.INPUT_VALUE_DEFINITION="InputValueDefinition",n.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",n.UNION_TYPE_DEFINITION="UnionTypeDefinition",n.ENUM_TYPE_DEFINITION="EnumTypeDefinition",n.ENUM_VALUE_DEFINITION="EnumValueDefinition",n.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",n.DIRECTIVE_DEFINITION="DirectiveDefinition",n.SCHEMA_EXTENSION="SchemaExtension",n.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",n.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",n.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",n.UNION_TYPE_EXTENSION="UnionTypeExtension",n.ENUM_TYPE_EXTENSION="EnumTypeExtension",n.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(N||(N={}));function La(n){return n===9||n===32}function $i(n){return n>=48&&n<=57}function Jc(n){return n>=97&&n<=122||n>=65&&n<=90}function Ua(n){return Jc(n)||n===95}function zc(n){return Jc(n)||$i(n)||n===95}function Lv(n){var r;let i=Number.MAX_SAFE_INTEGER,o=null,u=-1;for(let h=0;h<n.length;++h){var f;const v=n[h],w=Fv(v);w!==v.length&&(o=(f=o)!==null&&f!==void 0?f:h,u=h,h!==0&&w<i&&(i=w))}return n.map((h,v)=>v===0?h:h.slice(i)).slice((r=o)!==null&&r!==void 0?r:0,u+1)}function Fv(n){let r=0;for(;r<n.length&&La(n.charCodeAt(r));)++r;return r}function Dv(n){if(n==="")return!0;let r=!0,i=!1,o=!0,u=!1;for(let f=0;f<n.length;++f)switch(n.codePointAt(f)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(r&&!u)return!1;u=!0,r=!0,i=!1;break;case 9:case 32:i||(i=r);break;default:o&&(o=i),r=!1}return!(r||o&&u)}function Pv(n,r){const i=n.replace(/"""/g,'\\"""'),o=i.split(/\r\n|[\n\r]/g),u=o.length===1,f=o.length>1&&o.slice(1).every(M=>M.length===0||La(M.charCodeAt(0))),h=i.endsWith('\\"""'),v=n.endsWith('"')&&!h,w=n.endsWith("\\"),I=v||w,O=!u||n.length>70||I||f||h;let D="";const P=u&&La(n.charCodeAt(0));return(O&&!P||f)&&(D+=`
19
- `),D+=i,(O||I)&&(D+=`
20
- `),'"""'+D+'"""'}var A;(function(n){n.SOF="<SOF>",n.EOF="<EOF>",n.BANG="!",n.DOLLAR="$",n.AMP="&",n.PAREN_L="(",n.PAREN_R=")",n.SPREAD="...",n.COLON=":",n.EQUALS="=",n.AT="@",n.BRACKET_L="[",n.BRACKET_R="]",n.BRACE_L="{",n.PIPE="|",n.BRACE_R="}",n.NAME="Name",n.INT="Int",n.FLOAT="Float",n.STRING="String",n.BLOCK_STRING="BlockString",n.COMMENT="Comment"})(A||(A={}));class kv{constructor(r){const i=new Vc(A.SOF,0,0,0,0);this.source=r,this.lastToken=i,this.token=i,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let r=this.token;if(r.kind!==A.EOF)do if(r.next)r=r.next;else{const i=Mv(this,r.end);r.next=i,i.prev=r,r=i}while(r.kind===A.COMMENT);return r}}function Uv(n){return n===A.BANG||n===A.DOLLAR||n===A.AMP||n===A.PAREN_L||n===A.PAREN_R||n===A.SPREAD||n===A.COLON||n===A.EQUALS||n===A.AT||n===A.BRACKET_L||n===A.BRACKET_R||n===A.BRACE_L||n===A.PIPE||n===A.BRACE_R}function di(n){return n>=0&&n<=55295||n>=57344&&n<=1114111}function zr(n,r){return Hc(n.charCodeAt(r))&&Qc(n.charCodeAt(r+1))}function Hc(n){return n>=55296&&n<=56319}function Qc(n){return n>=56320&&n<=57343}function Bn(n,r){const i=n.source.body.codePointAt(r);if(i===void 0)return A.EOF;if(i>=32&&i<=126){const o=String.fromCodePoint(i);return o==='"'?`'"'`:`"${o}"`}return"U+"+i.toString(16).toUpperCase().padStart(4,"0")}function Re(n,r,i,o,u){const f=n.line,h=1+i-n.lineStart;return new Vc(r,i,o,f,h,u)}function Mv(n,r){const i=n.source.body,o=i.length;let u=r;for(;u<o;){const f=i.charCodeAt(u);switch(f){case 65279:case 9:case 32:case 44:++u;continue;case 10:++u,++n.line,n.lineStart=u;continue;case 13:i.charCodeAt(u+1)===10?u+=2:++u,++n.line,n.lineStart=u;continue;case 35:return $v(n,u);case 33:return Re(n,A.BANG,u,u+1);case 36:return Re(n,A.DOLLAR,u,u+1);case 38:return Re(n,A.AMP,u,u+1);case 40:return Re(n,A.PAREN_L,u,u+1);case 41:return Re(n,A.PAREN_R,u,u+1);case 46:if(i.charCodeAt(u+1)===46&&i.charCodeAt(u+2)===46)return Re(n,A.SPREAD,u,u+3);break;case 58:return Re(n,A.COLON,u,u+1);case 61:return Re(n,A.EQUALS,u,u+1);case 64:return Re(n,A.AT,u,u+1);case 91:return Re(n,A.BRACKET_L,u,u+1);case 93:return Re(n,A.BRACKET_R,u,u+1);case 123:return Re(n,A.BRACE_L,u,u+1);case 124:return Re(n,A.PIPE,u,u+1);case 125:return Re(n,A.BRACE_R,u,u+1);case 34:return i.charCodeAt(u+1)===34&&i.charCodeAt(u+2)===34?qv(n,u):jv(n,u)}if($i(f)||f===45)return Bv(n,u,f);if(Ua(f))return Jv(n,u);throw ke(n.source,u,f===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:di(f)||zr(i,u)?`Unexpected character: ${Bn(n,u)}.`:`Invalid character: ${Bn(n,u)}.`)}return Re(n,A.EOF,o,o)}function $v(n,r){const i=n.source.body,o=i.length;let u=r+1;for(;u<o;){const f=i.charCodeAt(u);if(f===10||f===13)break;if(di(f))++u;else if(zr(i,u))u+=2;else break}return Re(n,A.COMMENT,r,u,i.slice(r+1,u))}function Bv(n,r,i){const o=n.source.body;let u=r,f=i,h=!1;if(f===45&&(f=o.charCodeAt(++u)),f===48){if(f=o.charCodeAt(++u),$i(f))throw ke(n.source,u,`Invalid number, unexpected digit after 0: ${Bn(n,u)}.`)}else u=Sa(n,u,f),f=o.charCodeAt(u);if(f===46&&(h=!0,f=o.charCodeAt(++u),u=Sa(n,u,f),f=o.charCodeAt(u)),(f===69||f===101)&&(h=!0,f=o.charCodeAt(++u),(f===43||f===45)&&(f=o.charCodeAt(++u)),u=Sa(n,u,f),f=o.charCodeAt(u)),f===46||Ua(f))throw ke(n.source,u,`Invalid number, expected digit but got: ${Bn(n,u)}.`);return Re(n,h?A.FLOAT:A.INT,r,u,o.slice(r,u))}function Sa(n,r,i){if(!$i(i))throw ke(n.source,r,`Invalid number, expected digit but got: ${Bn(n,r)}.`);const o=n.source.body;let u=r+1;for(;$i(o.charCodeAt(u));)++u;return u}function jv(n,r){const i=n.source.body,o=i.length;let u=r+1,f=u,h="";for(;u<o;){const v=i.charCodeAt(u);if(v===34)return h+=i.slice(f,u),Re(n,A.STRING,r,u+1,h);if(v===92){h+=i.slice(f,u);const w=i.charCodeAt(u+1)===117?i.charCodeAt(u+2)===123?Wv(n,u):Gv(n,u):Vv(n,u);h+=w.value,u+=w.size,f=u;continue}if(v===10||v===13)break;if(di(v))++u;else if(zr(i,u))u+=2;else throw ke(n.source,u,`Invalid character within String: ${Bn(n,u)}.`)}throw ke(n.source,u,"Unterminated string.")}function Wv(n,r){const i=n.source.body;let o=0,u=3;for(;u<12;){const f=i.charCodeAt(r+u++);if(f===125){if(u<5||!di(o))break;return{value:String.fromCodePoint(o),size:u}}if(o=o<<4|ki(f),o<0)break}throw ke(n.source,r,`Invalid Unicode escape sequence: "${i.slice(r,r+u)}".`)}function Gv(n,r){const i=n.source.body,o=Ac(i,r+2);if(di(o))return{value:String.fromCodePoint(o),size:6};if(Hc(o)&&i.charCodeAt(r+6)===92&&i.charCodeAt(r+7)===117){const u=Ac(i,r+8);if(Qc(u))return{value:String.fromCodePoint(o,u),size:12}}throw ke(n.source,r,`Invalid Unicode escape sequence: "${i.slice(r,r+6)}".`)}function Ac(n,r){return ki(n.charCodeAt(r))<<12|ki(n.charCodeAt(r+1))<<8|ki(n.charCodeAt(r+2))<<4|ki(n.charCodeAt(r+3))}function ki(n){return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:-1}function Vv(n,r){const i=n.source.body;switch(i.charCodeAt(r+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
21
- `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw ke(n.source,r,`Invalid character escape sequence: "${i.slice(r,r+2)}".`)}function qv(n,r){const i=n.source.body,o=i.length;let u=n.lineStart,f=r+3,h=f,v="";const w=[];for(;f<o;){const I=i.charCodeAt(f);if(I===34&&i.charCodeAt(f+1)===34&&i.charCodeAt(f+2)===34){v+=i.slice(h,f),w.push(v);const O=Re(n,A.BLOCK_STRING,r,f+3,Lv(w).join(`
22
- `));return n.line+=w.length-1,n.lineStart=u,O}if(I===92&&i.charCodeAt(f+1)===34&&i.charCodeAt(f+2)===34&&i.charCodeAt(f+3)===34){v+=i.slice(h,f),h=f+1,f+=4;continue}if(I===10||I===13){v+=i.slice(h,f),w.push(v),I===13&&i.charCodeAt(f+1)===10?f+=2:++f,v="",h=f,u=f;continue}if(di(I))++f;else if(zr(i,f))f+=2;else throw ke(n.source,f,`Invalid character within String: ${Bn(n,f)}.`)}throw ke(n.source,f,"Unterminated string.")}function Jv(n,r){const i=n.source.body,o=i.length;let u=r+1;for(;u<o;){const f=i.charCodeAt(u);if(zc(f))++u;else break}return Re(n,A.NAME,r,u,i.slice(r,u))}const zv=10,Yc=2;function J(n){return Hr(n,[])}function Hr(n,r){switch(typeof n){case"string":return JSON.stringify(n);case"function":return n.name?`[function ${n.name}]`:"[function]";case"object":return Hv(n,r);default:return String(n)}}function Hv(n,r){if(n===null)return"null";if(r.includes(n))return"[Circular]";const i=[...r,n];if(Qv(n)){const o=n.toJSON();if(o!==n)return typeof o=="string"?o:Hr(o,i)}else if(Array.isArray(n))return Xv(n,i);return Yv(n,i)}function Qv(n){return typeof n.toJSON=="function"}function Yv(n,r){const i=Object.entries(n);return i.length===0?"{}":r.length>Yc?"["+Kv(n)+"]":"{ "+i.map(([u,f])=>u+": "+Hr(f,r)).join(", ")+" }"}function Xv(n,r){if(n.length===0)return"[]";if(r.length>Yc)return"[Array]";const i=Math.min(zv,n.length),o=n.length-i,u=[];for(let f=0;f<i;++f)u.push(Hr(n[f],r));return o===1?u.push("... 1 more item"):o>1&&u.push(`... ${o} more items`),"["+u.join(", ")+"]"}function Kv(n){const r=Object.prototype.toString.call(n).replace(/^\[object /,"").replace(/]$/,"");if(r==="Object"&&typeof n.constructor=="function"){const i=n.constructor.name;if(typeof i=="string"&&i!=="")return i}return r}const Mt=globalThis.process&&globalThis.process.env.NODE_ENV==="production"?function(r,i){return r instanceof i}:function(r,i){if(r instanceof i)return!0;if(typeof r=="object"&&r!==null){var o;const u=i.prototype[Symbol.toStringTag],f=Symbol.toStringTag in r?r[Symbol.toStringTag]:(o=r.constructor)===null||o===void 0?void 0:o.name;if(u===f){const h=J(r);throw new Error(`Cannot use ${u} "${h}" from another module or realm.
23
-
24
- Ensure that there is only one instance of "graphql" in the node_modules
25
- directory. If different versions of "graphql" are the dependencies of other
26
- relied on modules, use "resolutions" to ensure only one version is installed.
27
-
28
- https://yarnpkg.com/en/docs/selective-version-resolutions
29
-
30
- Duplicate "graphql" modules cannot be used at the same time since different
31
- versions may have different capabilities and behavior. The data from one
32
- version used in the function from another could produce confusing and
33
- spurious results.`)}}return!1};class Xc{constructor(r,i="GraphQL request",o={line:1,column:1}){typeof r=="string"||ue(!1,`Body must be a string. Received: ${J(r)}.`),this.body=r,this.name=i,this.locationOffset=o,this.locationOffset.line>0||ue(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ue(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function Zv(n){return Mt(n,Xc)}function e_(n,r){const i=new t_(n,r);i.expectToken(A.SOF);const o=i.parseValueLiteral(!1);return i.expectToken(A.EOF),o}class t_{constructor(r,i={}){const o=Zv(r)?r:new Xc(r);this._lexer=new kv(o),this._options=i,this._tokenCounter=0}parseName(){const r=this.expectToken(A.NAME);return this.node(r,{kind:N.NAME,value:r.value})}parseDocument(){return this.node(this._lexer.token,{kind:N.DOCUMENT,definitions:this.many(A.SOF,this.parseDefinition,A.EOF)})}parseDefinition(){if(this.peek(A.BRACE_L))return this.parseOperationDefinition();const r=this.peekDescription(),i=r?this._lexer.lookahead():this._lexer.token;if(i.kind===A.NAME){switch(i.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(r)throw ke(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(i.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(i)}parseOperationDefinition(){const r=this._lexer.token;if(this.peek(A.BRACE_L))return this.node(r,{kind:N.OPERATION_DEFINITION,operation:Yt.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const i=this.parseOperationType();let o;return this.peek(A.NAME)&&(o=this.parseName()),this.node(r,{kind:N.OPERATION_DEFINITION,operation:i,name:o,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const r=this.expectToken(A.NAME);switch(r.value){case"query":return Yt.QUERY;case"mutation":return Yt.MUTATION;case"subscription":return Yt.SUBSCRIPTION}throw this.unexpected(r)}parseVariableDefinitions(){return this.optionalMany(A.PAREN_L,this.parseVariableDefinition,A.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:N.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(A.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(A.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const r=this._lexer.token;return this.expectToken(A.DOLLAR),this.node(r,{kind:N.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:N.SELECTION_SET,selections:this.many(A.BRACE_L,this.parseSelection,A.BRACE_R)})}parseSelection(){return this.peek(A.SPREAD)?this.parseFragment():this.parseField()}parseField(){const r=this._lexer.token,i=this.parseName();let o,u;return this.expectOptionalToken(A.COLON)?(o=i,u=this.parseName()):u=i,this.node(r,{kind:N.FIELD,alias:o,name:u,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(A.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(r){const i=r?this.parseConstArgument:this.parseArgument;return this.optionalMany(A.PAREN_L,i,A.PAREN_R)}parseArgument(r=!1){const i=this._lexer.token,o=this.parseName();return this.expectToken(A.COLON),this.node(i,{kind:N.ARGUMENT,name:o,value:this.parseValueLiteral(r)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const r=this._lexer.token;this.expectToken(A.SPREAD);const i=this.expectOptionalKeyword("on");return!i&&this.peek(A.NAME)?this.node(r,{kind:N.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(r,{kind:N.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const r=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(r,{kind:N.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(r,{kind:N.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(r){const i=this._lexer.token;switch(i.kind){case A.BRACKET_L:return this.parseList(r);case A.BRACE_L:return this.parseObject(r);case A.INT:return this.advanceLexer(),this.node(i,{kind:N.INT,value:i.value});case A.FLOAT:return this.advanceLexer(),this.node(i,{kind:N.FLOAT,value:i.value});case A.STRING:case A.BLOCK_STRING:return this.parseStringLiteral();case A.NAME:switch(this.advanceLexer(),i.value){case"true":return this.node(i,{kind:N.BOOLEAN,value:!0});case"false":return this.node(i,{kind:N.BOOLEAN,value:!1});case"null":return this.node(i,{kind:N.NULL});default:return this.node(i,{kind:N.ENUM,value:i.value})}case A.DOLLAR:if(r)if(this.expectToken(A.DOLLAR),this._lexer.token.kind===A.NAME){const o=this._lexer.token.value;throw ke(this._lexer.source,i.start,`Unexpected variable "$${o}" in constant value.`)}else throw this.unexpected(i);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const r=this._lexer.token;return this.advanceLexer(),this.node(r,{kind:N.STRING,value:r.value,block:r.kind===A.BLOCK_STRING})}parseList(r){const i=()=>this.parseValueLiteral(r);return this.node(this._lexer.token,{kind:N.LIST,values:this.any(A.BRACKET_L,i,A.BRACKET_R)})}parseObject(r){const i=()=>this.parseObjectField(r);return this.node(this._lexer.token,{kind:N.OBJECT,fields:this.any(A.BRACE_L,i,A.BRACE_R)})}parseObjectField(r){const i=this._lexer.token,o=this.parseName();return this.expectToken(A.COLON),this.node(i,{kind:N.OBJECT_FIELD,name:o,value:this.parseValueLiteral(r)})}parseDirectives(r){const i=[];for(;this.peek(A.AT);)i.push(this.parseDirective(r));return i}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(r){const i=this._lexer.token;return this.expectToken(A.AT),this.node(i,{kind:N.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(r)})}parseTypeReference(){const r=this._lexer.token;let i;if(this.expectOptionalToken(A.BRACKET_L)){const o=this.parseTypeReference();this.expectToken(A.BRACKET_R),i=this.node(r,{kind:N.LIST_TYPE,type:o})}else i=this.parseNamedType();return this.expectOptionalToken(A.BANG)?this.node(r,{kind:N.NON_NULL_TYPE,type:i}):i}parseNamedType(){return this.node(this._lexer.token,{kind:N.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(A.STRING)||this.peek(A.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");const o=this.parseConstDirectives(),u=this.many(A.BRACE_L,this.parseOperationTypeDefinition,A.BRACE_R);return this.node(r,{kind:N.SCHEMA_DEFINITION,description:i,directives:o,operationTypes:u})}parseOperationTypeDefinition(){const r=this._lexer.token,i=this.parseOperationType();this.expectToken(A.COLON);const o=this.parseNamedType();return this.node(r,{kind:N.OPERATION_TYPE_DEFINITION,operation:i,type:o})}parseScalarTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");const o=this.parseName(),u=this.parseConstDirectives();return this.node(r,{kind:N.SCALAR_TYPE_DEFINITION,description:i,name:o,directives:u})}parseObjectTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");const o=this.parseName(),u=this.parseImplementsInterfaces(),f=this.parseConstDirectives(),h=this.parseFieldsDefinition();return this.node(r,{kind:N.OBJECT_TYPE_DEFINITION,description:i,name:o,interfaces:u,directives:f,fields:h})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(A.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(A.BRACE_L,this.parseFieldDefinition,A.BRACE_R)}parseFieldDefinition(){const r=this._lexer.token,i=this.parseDescription(),o=this.parseName(),u=this.parseArgumentDefs();this.expectToken(A.COLON);const f=this.parseTypeReference(),h=this.parseConstDirectives();return this.node(r,{kind:N.FIELD_DEFINITION,description:i,name:o,arguments:u,type:f,directives:h})}parseArgumentDefs(){return this.optionalMany(A.PAREN_L,this.parseInputValueDef,A.PAREN_R)}parseInputValueDef(){const r=this._lexer.token,i=this.parseDescription(),o=this.parseName();this.expectToken(A.COLON);const u=this.parseTypeReference();let f;this.expectOptionalToken(A.EQUALS)&&(f=this.parseConstValueLiteral());const h=this.parseConstDirectives();return this.node(r,{kind:N.INPUT_VALUE_DEFINITION,description:i,name:o,type:u,defaultValue:f,directives:h})}parseInterfaceTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");const o=this.parseName(),u=this.parseImplementsInterfaces(),f=this.parseConstDirectives(),h=this.parseFieldsDefinition();return this.node(r,{kind:N.INTERFACE_TYPE_DEFINITION,description:i,name:o,interfaces:u,directives:f,fields:h})}parseUnionTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");const o=this.parseName(),u=this.parseConstDirectives(),f=this.parseUnionMemberTypes();return this.node(r,{kind:N.UNION_TYPE_DEFINITION,description:i,name:o,directives:u,types:f})}parseUnionMemberTypes(){return this.expectOptionalToken(A.EQUALS)?this.delimitedMany(A.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");const o=this.parseName(),u=this.parseConstDirectives(),f=this.parseEnumValuesDefinition();return this.node(r,{kind:N.ENUM_TYPE_DEFINITION,description:i,name:o,directives:u,values:f})}parseEnumValuesDefinition(){return this.optionalMany(A.BRACE_L,this.parseEnumValueDefinition,A.BRACE_R)}parseEnumValueDefinition(){const r=this._lexer.token,i=this.parseDescription(),o=this.parseEnumValueName(),u=this.parseConstDirectives();return this.node(r,{kind:N.ENUM_VALUE_DEFINITION,description:i,name:o,directives:u})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw ke(this._lexer.source,this._lexer.token.start,`${$r(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");const o=this.parseName(),u=this.parseConstDirectives(),f=this.parseInputFieldsDefinition();return this.node(r,{kind:N.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:o,directives:u,fields:f})}parseInputFieldsDefinition(){return this.optionalMany(A.BRACE_L,this.parseInputValueDef,A.BRACE_R)}parseTypeSystemExtension(){const r=this._lexer.lookahead();if(r.kind===A.NAME)switch(r.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(r)}parseSchemaExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const i=this.parseConstDirectives(),o=this.optionalMany(A.BRACE_L,this.parseOperationTypeDefinition,A.BRACE_R);if(i.length===0&&o.length===0)throw this.unexpected();return this.node(r,{kind:N.SCHEMA_EXTENSION,directives:i,operationTypes:o})}parseScalarTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const i=this.parseName(),o=this.parseConstDirectives();if(o.length===0)throw this.unexpected();return this.node(r,{kind:N.SCALAR_TYPE_EXTENSION,name:i,directives:o})}parseObjectTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const i=this.parseName(),o=this.parseImplementsInterfaces(),u=this.parseConstDirectives(),f=this.parseFieldsDefinition();if(o.length===0&&u.length===0&&f.length===0)throw this.unexpected();return this.node(r,{kind:N.OBJECT_TYPE_EXTENSION,name:i,interfaces:o,directives:u,fields:f})}parseInterfaceTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const i=this.parseName(),o=this.parseImplementsInterfaces(),u=this.parseConstDirectives(),f=this.parseFieldsDefinition();if(o.length===0&&u.length===0&&f.length===0)throw this.unexpected();return this.node(r,{kind:N.INTERFACE_TYPE_EXTENSION,name:i,interfaces:o,directives:u,fields:f})}parseUnionTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const i=this.parseName(),o=this.parseConstDirectives(),u=this.parseUnionMemberTypes();if(o.length===0&&u.length===0)throw this.unexpected();return this.node(r,{kind:N.UNION_TYPE_EXTENSION,name:i,directives:o,types:u})}parseEnumTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const i=this.parseName(),o=this.parseConstDirectives(),u=this.parseEnumValuesDefinition();if(o.length===0&&u.length===0)throw this.unexpected();return this.node(r,{kind:N.ENUM_TYPE_EXTENSION,name:i,directives:o,values:u})}parseInputObjectTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const i=this.parseName(),o=this.parseConstDirectives(),u=this.parseInputFieldsDefinition();if(o.length===0&&u.length===0)throw this.unexpected();return this.node(r,{kind:N.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:o,fields:u})}parseDirectiveDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(A.AT);const o=this.parseName(),u=this.parseArgumentDefs(),f=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const h=this.parseDirectiveLocations();return this.node(r,{kind:N.DIRECTIVE_DEFINITION,description:i,name:o,arguments:u,repeatable:f,locations:h})}parseDirectiveLocations(){return this.delimitedMany(A.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const r=this._lexer.token,i=this.parseName();if(Object.prototype.hasOwnProperty.call(se,i.value))return i;throw this.unexpected(r)}node(r,i){return this._options.noLocation!==!0&&(i.loc=new Rv(r,this._lexer.lastToken,this._lexer.source)),i}peek(r){return this._lexer.token.kind===r}expectToken(r){const i=this._lexer.token;if(i.kind===r)return this.advanceLexer(),i;throw ke(this._lexer.source,i.start,`Expected ${Kc(r)}, found ${$r(i)}.`)}expectOptionalToken(r){return this._lexer.token.kind===r?(this.advanceLexer(),!0):!1}expectKeyword(r){const i=this._lexer.token;if(i.kind===A.NAME&&i.value===r)this.advanceLexer();else throw ke(this._lexer.source,i.start,`Expected "${r}", found ${$r(i)}.`)}expectOptionalKeyword(r){const i=this._lexer.token;return i.kind===A.NAME&&i.value===r?(this.advanceLexer(),!0):!1}unexpected(r){const i=r??this._lexer.token;return ke(this._lexer.source,i.start,`Unexpected ${$r(i)}.`)}any(r,i,o){this.expectToken(r);const u=[];for(;!this.expectOptionalToken(o);)u.push(i.call(this));return u}optionalMany(r,i,o){if(this.expectOptionalToken(r)){const u=[];do u.push(i.call(this));while(!this.expectOptionalToken(o));return u}return[]}many(r,i,o){this.expectToken(r);const u=[];do u.push(i.call(this));while(!this.expectOptionalToken(o));return u}delimitedMany(r,i){this.expectOptionalToken(r);const o=[];do o.push(i.call(this));while(this.expectOptionalToken(r));return o}advanceLexer(){const{maxTokens:r}=this._options,i=this._lexer.advance();if(r!==void 0&&i.kind!==A.EOF&&(++this._tokenCounter,this._tokenCounter>r))throw ke(this._lexer.source,i.start,`Document contains more that ${r} tokens. Parsing aborted.`)}}function $r(n){const r=n.value;return Kc(n.kind)+(r!=null?` "${r}"`:"")}function Kc(n){return Uv(n)?`"${n}"`:n}const n_=5;function i_(n,r){const[i,o]=r?[n,r]:[void 0,n];let u=" Did you mean ";i&&(u+=i+" ");const f=o.map(w=>`"${w}"`);switch(f.length){case 0:return"";case 1:return u+f[0]+"?";case 2:return u+f[0]+" or "+f[1]+"?"}const h=f.slice(0,n_),v=h.pop();return u+h.join(", ")+", or "+v+"?"}function Ic(n){return n}function Zc(n,r){const i=Object.create(null);for(const o of n)i[r(o)]=o;return i}function $n(n,r,i){const o=Object.create(null);for(const u of n)o[r(u)]=i(u);return o}function Qr(n,r){const i=Object.create(null);for(const o of Object.keys(n))i[o]=r(n[o],o);return i}function r_(n,r){let i=0,o=0;for(;i<n.length&&o<r.length;){let u=n.charCodeAt(i),f=r.charCodeAt(o);if(Br(u)&&Br(f)){let h=0;do++i,h=h*10+u-Fa,u=n.charCodeAt(i);while(Br(u)&&h>0);let v=0;do++o,v=v*10+f-Fa,f=r.charCodeAt(o);while(Br(f)&&v>0);if(h<v)return-1;if(h>v)return 1}else{if(u<f)return-1;if(u>f)return 1;++i,++o}}return n.length-r.length}const Fa=48,s_=57;function Br(n){return!isNaN(n)&&Fa<=n&&n<=s_}function a_(n,r){const i=Object.create(null),o=new o_(n),u=Math.floor(n.length*.4)+1;for(const f of r){const h=o.measure(f,u);h!==void 0&&(i[f]=h)}return Object.keys(i).sort((f,h)=>{const v=i[f]-i[h];return v!==0?v:r_(f,h)})}class o_{constructor(r){this._input=r,this._inputLowerCase=r.toLowerCase(),this._inputArray=bc(this._inputLowerCase),this._rows=[new Array(r.length+1).fill(0),new Array(r.length+1).fill(0),new Array(r.length+1).fill(0)]}measure(r,i){if(this._input===r)return 0;const o=r.toLowerCase();if(this._inputLowerCase===o)return 1;let u=bc(o),f=this._inputArray;if(u.length<f.length){const O=u;u=f,f=O}const h=u.length,v=f.length;if(h-v>i)return;const w=this._rows;for(let O=0;O<=v;O++)w[0][O]=O;for(let O=1;O<=h;O++){const D=w[(O-1)%3],P=w[O%3];let M=P[0]=O;for(let $=1;$<=v;$++){const he=u[O-1]===f[$-1]?0:1;let ae=Math.min(D[$]+1,P[$-1]+1,D[$-1]+he);if(O>1&&$>1&&u[O-1]===f[$-2]&&u[O-2]===f[$-1]){const me=w[(O-2)%3][$-2];ae=Math.min(ae,me+1)}ae<M&&(M=ae),P[$]=ae}if(M>i)return}const I=w[h%3][v];return I<=i?I:void 0}}function bc(n){const r=n.length,i=new Array(r);for(let o=0;o<r;++o)i[o]=n.charCodeAt(o);return i}function xt(n){if(n==null)return Object.create(null);if(Object.getPrototypeOf(n)===null)return n;const r=Object.create(null);for(const[i,o]of Object.entries(n))r[i]=o;return r}function u_(n){return`"${n.replace(c_,l_)}"`}const c_=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function l_(n){return f_[n.charCodeAt(0)]}const f_=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],p_=Object.freeze({});function d_(n,r,i=qc){const o=new Map;for(const me of Object.values(N))o.set(me,h_(r,me));let u,f=Array.isArray(n),h=[n],v=-1,w=[],I=n,O,D;const P=[],M=[];do{v++;const me=v===h.length,Ye=me&&w.length!==0;if(me){if(O=M.length===0?void 0:P[P.length-1],I=D,D=M.pop(),Ye)if(f){I=I.slice();let L=0;for(const[ee,Q]of w){const ce=ee-L;Q===null?(I.splice(ce,1),L++):I[ce]=Q}}else{I=Object.defineProperties({},Object.getOwnPropertyDescriptors(I));for(const[L,ee]of w)I[L]=ee}v=u.index,h=u.keys,w=u.edits,f=u.inArray,u=u.prev}else if(D){if(O=f?v:h[v],I=D[O],I==null)continue;P.push(O)}let Te;if(!Array.isArray(I)){var $,he;Sc(I)||ue(!1,`Invalid AST Node: ${J(I)}.`);const L=me?($=o.get(I.kind))===null||$===void 0?void 0:$.leave:(he=o.get(I.kind))===null||he===void 0?void 0:he.enter;if(Te=L?.call(r,I,O,D,P,M),Te===p_)break;if(Te===!1){if(!me){P.pop();continue}}else if(Te!==void 0&&(w.push([O,Te]),!me))if(Sc(Te))I=Te;else{P.pop();continue}}if(Te===void 0&&Ye&&w.push([O,I]),me)P.pop();else{var ae;u={inArray:f,index:v,keys:h,edits:w,prev:u},f=Array.isArray(I),h=f?I:(ae=i[I.kind])!==null&&ae!==void 0?ae:[],v=-1,w=[],D&&M.push(D),D=I}}while(u!==void 0);return w.length!==0?w[w.length-1][1]:n}function h_(n,r){const i=n[r];return typeof i=="object"?i:typeof i=="function"?{enter:i,leave:void 0}:{enter:n.enter,leave:n.leave}}function vt(n){return d_(n,m_)}const g_=80,m_={Name:{leave:n=>n.value},Variable:{leave:n=>"$"+n.name},Document:{leave:n=>k(n.definitions,`
34
-
35
- `)},OperationDefinition:{leave(n){const r=ne("(",k(n.variableDefinitions,", "),")"),i=k([n.operation,k([n.name,r]),k(n.directives," ")]," ");return(i==="query"?"":i+" ")+n.selectionSet}},VariableDefinition:{leave:({variable:n,type:r,defaultValue:i,directives:o})=>n+": "+r+ne(" = ",i)+ne(" ",k(o," "))},SelectionSet:{leave:({selections:n})=>Nt(n)},Field:{leave({alias:n,name:r,arguments:i,directives:o,selectionSet:u}){const f=ne("",n,": ")+r;let h=f+ne("(",k(i,", "),")");return h.length>g_&&(h=f+ne(`(
36
- `,Gr(k(i,`
37
- `)),`
38
- )`)),k([h,k(o," "),u]," ")}},Argument:{leave:({name:n,value:r})=>n+": "+r},FragmentSpread:{leave:({name:n,directives:r})=>"..."+n+ne(" ",k(r," "))},InlineFragment:{leave:({typeCondition:n,directives:r,selectionSet:i})=>k(["...",ne("on ",n),k(r," "),i]," ")},FragmentDefinition:{leave:({name:n,typeCondition:r,variableDefinitions:i,directives:o,selectionSet:u})=>`fragment ${n}${ne("(",k(i,", "),")")} on ${r} ${ne("",k(o," ")," ")}`+u},IntValue:{leave:({value:n})=>n},FloatValue:{leave:({value:n})=>n},StringValue:{leave:({value:n,block:r})=>r?Pv(n):u_(n)},BooleanValue:{leave:({value:n})=>n?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:n})=>n},ListValue:{leave:({values:n})=>"["+k(n,", ")+"]"},ObjectValue:{leave:({fields:n})=>"{"+k(n,", ")+"}"},ObjectField:{leave:({name:n,value:r})=>n+": "+r},Directive:{leave:({name:n,arguments:r})=>"@"+n+ne("(",k(r,", "),")")},NamedType:{leave:({name:n})=>n},ListType:{leave:({type:n})=>"["+n+"]"},NonNullType:{leave:({type:n})=>n+"!"},SchemaDefinition:{leave:({description:n,directives:r,operationTypes:i})=>ne("",n,`
39
- `)+k(["schema",k(r," "),Nt(i)]," ")},OperationTypeDefinition:{leave:({operation:n,type:r})=>n+": "+r},ScalarTypeDefinition:{leave:({description:n,name:r,directives:i})=>ne("",n,`
40
- `)+k(["scalar",r,k(i," ")]," ")},ObjectTypeDefinition:{leave:({description:n,name:r,interfaces:i,directives:o,fields:u})=>ne("",n,`
41
- `)+k(["type",r,ne("implements ",k(i," & ")),k(o," "),Nt(u)]," ")},FieldDefinition:{leave:({description:n,name:r,arguments:i,type:o,directives:u})=>ne("",n,`
42
- `)+r+(Nc(i)?ne(`(
43
- `,Gr(k(i,`
44
- `)),`
45
- )`):ne("(",k(i,", "),")"))+": "+o+ne(" ",k(u," "))},InputValueDefinition:{leave:({description:n,name:r,type:i,defaultValue:o,directives:u})=>ne("",n,`
46
- `)+k([r+": "+i,ne("= ",o),k(u," ")]," ")},InterfaceTypeDefinition:{leave:({description:n,name:r,interfaces:i,directives:o,fields:u})=>ne("",n,`
47
- `)+k(["interface",r,ne("implements ",k(i," & ")),k(o," "),Nt(u)]," ")},UnionTypeDefinition:{leave:({description:n,name:r,directives:i,types:o})=>ne("",n,`
48
- `)+k(["union",r,k(i," "),ne("= ",k(o," | "))]," ")},EnumTypeDefinition:{leave:({description:n,name:r,directives:i,values:o})=>ne("",n,`
49
- `)+k(["enum",r,k(i," "),Nt(o)]," ")},EnumValueDefinition:{leave:({description:n,name:r,directives:i})=>ne("",n,`
50
- `)+k([r,k(i," ")]," ")},InputObjectTypeDefinition:{leave:({description:n,name:r,directives:i,fields:o})=>ne("",n,`
51
- `)+k(["input",r,k(i," "),Nt(o)]," ")},DirectiveDefinition:{leave:({description:n,name:r,arguments:i,repeatable:o,locations:u})=>ne("",n,`
52
- `)+"directive @"+r+(Nc(i)?ne(`(
53
- `,Gr(k(i,`
54
- `)),`
55
- )`):ne("(",k(i,", "),")"))+(o?" repeatable":"")+" on "+k(u," | ")},SchemaExtension:{leave:({directives:n,operationTypes:r})=>k(["extend schema",k(n," "),Nt(r)]," ")},ScalarTypeExtension:{leave:({name:n,directives:r})=>k(["extend scalar",n,k(r," ")]," ")},ObjectTypeExtension:{leave:({name:n,interfaces:r,directives:i,fields:o})=>k(["extend type",n,ne("implements ",k(r," & ")),k(i," "),Nt(o)]," ")},InterfaceTypeExtension:{leave:({name:n,interfaces:r,directives:i,fields:o})=>k(["extend interface",n,ne("implements ",k(r," & ")),k(i," "),Nt(o)]," ")},UnionTypeExtension:{leave:({name:n,directives:r,types:i})=>k(["extend union",n,k(r," "),ne("= ",k(i," | "))]," ")},EnumTypeExtension:{leave:({name:n,directives:r,values:i})=>k(["extend enum",n,k(r," "),Nt(i)]," ")},InputObjectTypeExtension:{leave:({name:n,directives:r,fields:i})=>k(["extend input",n,k(r," "),Nt(i)]," ")}};function k(n,r=""){var i;return(i=n?.filter(o=>o).join(r))!==null&&i!==void 0?i:""}function Nt(n){return ne(`{
56
- `,Gr(k(n,`
57
- `)),`
58
- }`)}function ne(n,r,i=""){return r!=null&&r!==""?n+r+i:""}function Gr(n){return ne(" ",n.replace(/\n/g,`
59
- `))}function Nc(n){var r;return(r=n?.some(i=>i.includes(`
60
- `)))!==null&&r!==void 0?r:!1}function Da(n,r){switch(n.kind){case N.NULL:return null;case N.INT:return parseInt(n.value,10);case N.FLOAT:return parseFloat(n.value);case N.STRING:case N.ENUM:case N.BOOLEAN:return n.value;case N.LIST:return n.values.map(i=>Da(i,r));case N.OBJECT:return $n(n.fields,i=>i.name.value,i=>Da(i.value,r));case N.VARIABLE:return r?.[n.name.value]}}function Rt(n){if(n!=null||ue(!1,"Must provide name."),typeof n=="string"||ue(!1,"Expected name to be a string."),n.length===0)throw new fe("Expected name to be a non-empty string.");for(let r=1;r<n.length;++r)if(!zc(n.charCodeAt(r)))throw new fe(`Names must only contain [_a-zA-Z0-9] but "${n}" does not.`);if(!Ua(n.charCodeAt(0)))throw new fe(`Names must start with [_a-zA-Z] but "${n}" does not.`);return n}function y_(n){if(n==="true"||n==="false"||n==="null")throw new fe(`Enum values cannot be named: ${n}`);return Rt(n)}function el(n){return hi(n)||Kt(n)||mt(n)||_n(n)||xn(n)||Tn(n)||Wi(n)||yn(n)}function hi(n){return Mt(n,jn)}function Kt(n){return Mt(n,En)}function v_(n){if(!Kt(n))throw new Error(`Expected ${J(n)} to be a GraphQL Object type.`);return n}function mt(n){return Mt(n,pl)}function __(n){if(!mt(n))throw new Error(`Expected ${J(n)} to be a GraphQL Interface type.`);return n}function _n(n){return Mt(n,dl)}function xn(n){return Mt(n,Yr)}function Tn(n){return Mt(n,hl)}function Wi(n){return Mt(n,gt)}function yn(n){return Mt(n,re)}function tl(n){return hi(n)||xn(n)||Tn(n)||Ma(n)&&tl(n.ofType)}function nl(n){return hi(n)||Kt(n)||mt(n)||_n(n)||xn(n)||Ma(n)&&nl(n.ofType)}function il(n){return hi(n)||xn(n)}function x_(n){return mt(n)||_n(n)}class gt{constructor(r){el(r)||ue(!1,`Expected ${J(r)} to be a GraphQL type.`),this.ofType=r}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class re{constructor(r){rl(r)||ue(!1,`Expected ${J(r)} to be a GraphQL nullable type.`),this.ofType=r}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function Ma(n){return Wi(n)||yn(n)}function rl(n){return el(n)&&!yn(n)}function T_(n){if(!rl(n))throw new Error(`Expected ${J(n)} to be a GraphQL nullable type.`);return n}function w_(n){if(n){let r=n;for(;Ma(r);)r=r.ofType;return r}}function sl(n){return typeof n=="function"?n():n}function al(n){return typeof n=="function"?n():n}class jn{constructor(r){var i,o,u,f;const h=(i=r.parseValue)!==null&&i!==void 0?i:Ic;this.name=Rt(r.name),this.description=r.description,this.specifiedByURL=r.specifiedByURL,this.serialize=(o=r.serialize)!==null&&o!==void 0?o:Ic,this.parseValue=h,this.parseLiteral=(u=r.parseLiteral)!==null&&u!==void 0?u:(v,w)=>h(Da(v,w)),this.extensions=xt(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(f=r.extensionASTNodes)!==null&&f!==void 0?f:[],r.specifiedByURL==null||typeof r.specifiedByURL=="string"||ue(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${J(r.specifiedByURL)}.`),r.serialize==null||typeof r.serialize=="function"||ue(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),r.parseLiteral&&(typeof r.parseValue=="function"&&typeof r.parseLiteral=="function"||ue(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class En{constructor(r){var i;this.name=Rt(r.name),this.description=r.description,this.isTypeOf=r.isTypeOf,this.extensions=xt(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=()=>ul(r),this._interfaces=()=>ol(r),r.isTypeOf==null||typeof r.isTypeOf=="function"||ue(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${J(r.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ll(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function ol(n){var r;const i=sl((r=n.interfaces)!==null&&r!==void 0?r:[]);return Array.isArray(i)||ue(!1,`${n.name} interfaces must be an Array or a function which returns an Array.`),i}function ul(n){const r=al(n.fields);return li(r)||ue(!1,`${n.name} fields must be an object with field names as keys or a function which returns such an object.`),Qr(r,(i,o)=>{var u;li(i)||ue(!1,`${n.name}.${o} field config must be an object.`),i.resolve==null||typeof i.resolve=="function"||ue(!1,`${n.name}.${o} field resolver must be a function if provided, but got: ${J(i.resolve)}.`);const f=(u=i.args)!==null&&u!==void 0?u:{};return li(f)||ue(!1,`${n.name}.${o} args must be an object with argument names as keys.`),{name:Rt(o),description:i.description,type:i.type,args:cl(f),resolve:i.resolve,subscribe:i.subscribe,deprecationReason:i.deprecationReason,extensions:xt(i.extensions),astNode:i.astNode}})}function cl(n){return Object.entries(n).map(([r,i])=>({name:Rt(r),description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:xt(i.extensions),astNode:i.astNode}))}function li(n){return Zt(n)&&!Array.isArray(n)}function ll(n){return Qr(n,r=>({description:r.description,type:r.type,args:fl(r.args),resolve:r.resolve,subscribe:r.subscribe,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}))}function fl(n){return $n(n,r=>r.name,r=>({description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}))}class pl{constructor(r){var i;this.name=Rt(r.name),this.description=r.description,this.resolveType=r.resolveType,this.extensions=xt(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=ul.bind(void 0,r),this._interfaces=ol.bind(void 0,r),r.resolveType==null||typeof r.resolveType=="function"||ue(!1,`${this.name} must provide "resolveType" as a function, but got: ${J(r.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ll(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class dl{constructor(r){var i;this.name=Rt(r.name),this.description=r.description,this.resolveType=r.resolveType,this.extensions=xt(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._types=E_.bind(void 0,r),r.resolveType==null||typeof r.resolveType=="function"||ue(!1,`${this.name} must provide "resolveType" as a function, but got: ${J(r.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function E_(n){const r=sl(n.types);return Array.isArray(r)||ue(!1,`Must provide Array of types or a function which returns such an array for Union ${n.name}.`),r}class Yr{constructor(r){var i;this.name=Rt(r.name),this.description=r.description,this.extensions=xt(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._values=S_(this.name,r.values),this._valueLookup=new Map(this._values.map(o=>[o.value,o])),this._nameLookup=Zc(this._values,o=>o.name)}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(r){return this._nameLookup[r]}serialize(r){const i=this._valueLookup.get(r);if(i===void 0)throw new fe(`Enum "${this.name}" cannot represent value: ${J(r)}`);return i.name}parseValue(r){if(typeof r!="string"){const o=J(r);throw new fe(`Enum "${this.name}" cannot represent non-string value: ${o}.`+jr(this,o))}const i=this.getValue(r);if(i==null)throw new fe(`Value "${r}" does not exist in "${this.name}" enum.`+jr(this,r));return i.value}parseLiteral(r,i){if(r.kind!==N.ENUM){const u=vt(r);throw new fe(`Enum "${this.name}" cannot represent non-enum value: ${u}.`+jr(this,u),{nodes:r})}const o=this.getValue(r.value);if(o==null){const u=vt(r);throw new fe(`Value "${u}" does not exist in "${this.name}" enum.`+jr(this,u),{nodes:r})}return o.value}toConfig(){const r=$n(this.getValues(),i=>i.name,i=>({description:i.description,value:i.value,deprecationReason:i.deprecationReason,extensions:i.extensions,astNode:i.astNode}));return{name:this.name,description:this.description,values:r,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function jr(n,r){const i=n.getValues().map(u=>u.name),o=a_(r,i);return i_("the enum value",o)}function S_(n,r){return li(r)||ue(!1,`${n} values must be an object with value names as keys.`),Object.entries(r).map(([i,o])=>(li(o)||ue(!1,`${n}.${i} must refer to an object with a "value" key representing an internal value but got: ${J(o)}.`),{name:y_(i),description:o.description,value:o.value!==void 0?o.value:i,deprecationReason:o.deprecationReason,extensions:xt(o.extensions),astNode:o.astNode}))}class hl{constructor(r){var i;this.name=Rt(r.name),this.description=r.description,this.extensions=xt(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=A_.bind(void 0,r)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const r=Qr(this.getFields(),i=>({description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:i.extensions,astNode:i.astNode}));return{name:this.name,description:this.description,fields:r,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function A_(n){const r=al(n.fields);return li(r)||ue(!1,`${n.name} fields must be an object with field names as keys or a function which returns such an object.`),Qr(r,(i,o)=>(!("resolve"in i)||ue(!1,`${n.name}.${o} field has a resolve property, but Input Types cannot define resolvers.`),{name:Rt(o),description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:xt(i.extensions),astNode:i.astNode}))}const Aa=2147483647,Ia=-2147483648,I_=new jn({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(n){const r=Gi(n);if(typeof r=="boolean")return r?1:0;let i=r;if(typeof r=="string"&&r!==""&&(i=Number(r)),typeof i!="number"||!Number.isInteger(i))throw new fe(`Int cannot represent non-integer value: ${J(r)}`);if(i>Aa||i<Ia)throw new fe("Int cannot represent non 32-bit signed integer value: "+J(r));return i},parseValue(n){if(typeof n!="number"||!Number.isInteger(n))throw new fe(`Int cannot represent non-integer value: ${J(n)}`);if(n>Aa||n<Ia)throw new fe(`Int cannot represent non 32-bit signed integer value: ${n}`);return n},parseLiteral(n){if(n.kind!==N.INT)throw new fe(`Int cannot represent non-integer value: ${vt(n)}`,{nodes:n});const r=parseInt(n.value,10);if(r>Aa||r<Ia)throw new fe(`Int cannot represent non 32-bit signed integer value: ${n.value}`,{nodes:n});return r}}),b_=new jn({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(n){const r=Gi(n);if(typeof r=="boolean")return r?1:0;let i=r;if(typeof r=="string"&&r!==""&&(i=Number(r)),typeof i!="number"||!Number.isFinite(i))throw new fe(`Float cannot represent non numeric value: ${J(r)}`);return i},parseValue(n){if(typeof n!="number"||!Number.isFinite(n))throw new fe(`Float cannot represent non numeric value: ${J(n)}`);return n},parseLiteral(n){if(n.kind!==N.FLOAT&&n.kind!==N.INT)throw new fe(`Float cannot represent non numeric value: ${vt(n)}`,n);return parseFloat(n.value)}}),Oe=new jn({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(n){const r=Gi(n);if(typeof r=="string")return r;if(typeof r=="boolean")return r?"true":"false";if(typeof r=="number"&&Number.isFinite(r))return r.toString();throw new fe(`String cannot represent value: ${J(n)}`)},parseValue(n){if(typeof n!="string")throw new fe(`String cannot represent a non string value: ${J(n)}`);return n},parseLiteral(n){if(n.kind!==N.STRING)throw new fe(`String cannot represent a non string value: ${vt(n)}`,{nodes:n});return n.value}}),yt=new jn({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(n){const r=Gi(n);if(typeof r=="boolean")return r;if(Number.isFinite(r))return r!==0;throw new fe(`Boolean cannot represent a non boolean value: ${J(r)}`)},parseValue(n){if(typeof n!="boolean")throw new fe(`Boolean cannot represent a non boolean value: ${J(n)}`);return n},parseLiteral(n){if(n.kind!==N.BOOLEAN)throw new fe(`Boolean cannot represent a non boolean value: ${vt(n)}`,{nodes:n});return n.value}}),gl=new jn({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(n){const r=Gi(n);if(typeof r=="string")return r;if(Number.isInteger(r))return String(r);throw new fe(`ID cannot represent value: ${J(n)}`)},parseValue(n){if(typeof n=="string")return n;if(typeof n=="number"&&Number.isInteger(n))return n.toString();throw new fe(`ID cannot represent value: ${J(n)}`)},parseLiteral(n){if(n.kind!==N.STRING&&n.kind!==N.INT)throw new fe("ID cannot represent a non-string and non-integer value: "+vt(n),{nodes:n});return n.value}}),ml=Object.freeze([Oe,I_,b_,yt,gl]);function N_(n){return ml.some(({name:r})=>n.name===r)}function Gi(n){if(Zt(n)){if(typeof n.valueOf=="function"){const r=n.valueOf();if(!Zt(r))return r}if(typeof n.toJSON=="function")return n.toJSON()}return n}function O_(n){return Mt(n,gi)}class gi{constructor(r){var i,o;this.name=Rt(r.name),this.description=r.description,this.locations=r.locations,this.isRepeatable=(i=r.isRepeatable)!==null&&i!==void 0?i:!1,this.extensions=xt(r.extensions),this.astNode=r.astNode,Array.isArray(r.locations)||ue(!1,`@${r.name} locations must be an Array.`);const u=(o=r.args)!==null&&o!==void 0?o:{};Zt(u)&&!Array.isArray(u)||ue(!1,`@${r.name} args must be an object with argument names as keys.`),this.args=cl(u)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:fl(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const R_=new gi({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[se.FIELD,se.FRAGMENT_SPREAD,se.INLINE_FRAGMENT],args:{if:{type:new re(yt),description:"Included when true."}}}),C_=new gi({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[se.FIELD,se.FRAGMENT_SPREAD,se.INLINE_FRAGMENT],args:{if:{type:new re(yt),description:"Skipped when true."}}}),yl="No longer supported",L_=new gi({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[se.FIELD_DEFINITION,se.ARGUMENT_DEFINITION,se.INPUT_FIELD_DEFINITION,se.ENUM_VALUE],args:{reason:{type:Oe,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:yl}}}),F_=new gi({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[se.SCALAR],args:{url:{type:new re(Oe),description:"The URL that specifies the behavior of this scalar."}}}),vl=Object.freeze([R_,C_,L_,F_]);function D_(n){return vl.some(({name:r})=>r===n.name)}function P_(n){return typeof n=="object"&&typeof n?.[Symbol.iterator]=="function"}function ci(n,r){if(yn(r)){const i=ci(n,r.ofType);return i?.kind===N.NULL?null:i}if(n===null)return{kind:N.NULL};if(n===void 0)return null;if(Wi(r)){const i=r.ofType;if(P_(n)){const o=[];for(const u of n){const f=ci(u,i);f!=null&&o.push(f)}return{kind:N.LIST,values:o}}return ci(n,i)}if(Tn(r)){if(!Zt(n))return null;const i=[];for(const o of Object.values(r.getFields())){const u=ci(n[o.name],o.type);u&&i.push({kind:N.OBJECT_FIELD,name:{kind:N.NAME,value:o.name},value:u})}return{kind:N.OBJECT,fields:i}}if(il(r)){const i=r.serialize(n);if(i==null)return null;if(typeof i=="boolean")return{kind:N.BOOLEAN,value:i};if(typeof i=="number"&&Number.isFinite(i)){const o=String(i);return Oc.test(o)?{kind:N.INT,value:o}:{kind:N.FLOAT,value:o}}if(typeof i=="string")return xn(r)?{kind:N.ENUM,value:i}:r===gl&&Oc.test(i)?{kind:N.INT,value:i}:{kind:N.STRING,value:i};throw new TypeError(`Cannot convert value to AST: ${J(i)}.`)}ji(!1,"Unexpected input type: "+J(r))}const Oc=/^-?(?:0|[1-9][0-9]*)$/,$a=new En({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:Oe,resolve:n=>n.description},types:{description:"A list of all types supported by this server.",type:new re(new gt(new re(Ut))),resolve(n){return Object.values(n.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new re(Ut),resolve:n=>n.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Ut,resolve:n=>n.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Ut,resolve:n=>n.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new re(new gt(new re(_l))),resolve:n=>n.getDirectives()}})}),_l=new En({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
61
-
62
- In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},isRepeatable:{type:new re(yt),resolve:n=>n.isRepeatable},locations:{type:new re(new gt(new re(xl))),resolve:n=>n.locations},args:{type:new re(new gt(new re(Xr))),args:{includeDeprecated:{type:yt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){return r?n.args:n.args.filter(i=>i.deprecationReason==null)}}})}),xl=new Yr({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:se.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:se.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:se.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:se.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:se.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:se.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:se.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:se.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:se.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:se.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:se.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:se.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:se.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:se.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:se.UNION,description:"Location adjacent to a union definition."},ENUM:{value:se.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:se.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:se.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:se.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Ut=new En({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new re(El),resolve(n){if(hi(n))return ve.SCALAR;if(Kt(n))return ve.OBJECT;if(mt(n))return ve.INTERFACE;if(_n(n))return ve.UNION;if(xn(n))return ve.ENUM;if(Tn(n))return ve.INPUT_OBJECT;if(Wi(n))return ve.LIST;if(yn(n))return ve.NON_NULL;ji(!1,`Unexpected type: "${J(n)}".`)}},name:{type:Oe,resolve:n=>"name"in n?n.name:void 0},description:{type:Oe,resolve:n=>"description"in n?n.description:void 0},specifiedByURL:{type:Oe,resolve:n=>"specifiedByURL"in n?n.specifiedByURL:void 0},fields:{type:new gt(new re(Tl)),args:{includeDeprecated:{type:yt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(Kt(n)||mt(n)){const i=Object.values(n.getFields());return r?i:i.filter(o=>o.deprecationReason==null)}}},interfaces:{type:new gt(new re(Ut)),resolve(n){if(Kt(n)||mt(n))return n.getInterfaces()}},possibleTypes:{type:new gt(new re(Ut)),resolve(n,r,i,{schema:o}){if(x_(n))return o.getPossibleTypes(n)}},enumValues:{type:new gt(new re(wl)),args:{includeDeprecated:{type:yt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(xn(n)){const i=n.getValues();return r?i:i.filter(o=>o.deprecationReason==null)}}},inputFields:{type:new gt(new re(Xr)),args:{includeDeprecated:{type:yt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(Tn(n)){const i=Object.values(n.getFields());return r?i:i.filter(o=>o.deprecationReason==null)}}},ofType:{type:Ut,resolve:n=>"ofType"in n?n.ofType:void 0}})}),Tl=new En({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},args:{type:new re(new gt(new re(Xr))),args:{includeDeprecated:{type:yt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){return r?n.args:n.args.filter(i=>i.deprecationReason==null)}},type:{type:new re(Ut),resolve:n=>n.type},isDeprecated:{type:new re(yt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Oe,resolve:n=>n.deprecationReason}})}),Xr=new En({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},type:{type:new re(Ut),resolve:n=>n.type},defaultValue:{type:Oe,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(n){const{type:r,defaultValue:i}=n,o=ci(i,r);return o?vt(o):null}},isDeprecated:{type:new re(yt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Oe,resolve:n=>n.deprecationReason}})}),wl=new En({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},isDeprecated:{type:new re(yt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Oe,resolve:n=>n.deprecationReason}})});var ve;(function(n){n.SCALAR="SCALAR",n.OBJECT="OBJECT",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.INPUT_OBJECT="INPUT_OBJECT",n.LIST="LIST",n.NON_NULL="NON_NULL"})(ve||(ve={}));const El=new Yr({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:ve.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:ve.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:ve.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:ve.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:ve.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:ve.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:ve.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:ve.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});new re($a);new re(Oe);new re(Oe);const Sl=Object.freeze([$a,_l,xl,Ut,Tl,Xr,wl,El]);function k_(n){return Sl.some(({name:r})=>n.name===r)}class U_{constructor(r){var i,o;this.__validationErrors=r.assumeValid===!0?[]:void 0,Zt(r)||ue(!1,"Must provide configuration object."),!r.types||Array.isArray(r.types)||ue(!1,`"types" must be Array if provided but got: ${J(r.types)}.`),!r.directives||Array.isArray(r.directives)||ue(!1,`"directives" must be Array if provided but got: ${J(r.directives)}.`),this.description=r.description,this.extensions=xt(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._queryType=r.query,this._mutationType=r.mutation,this._subscriptionType=r.subscription,this._directives=(o=r.directives)!==null&&o!==void 0?o:vl;const u=new Set(r.types);if(r.types!=null)for(const f of r.types)u.delete(f),Ot(f,u);this._queryType!=null&&Ot(this._queryType,u),this._mutationType!=null&&Ot(this._mutationType,u),this._subscriptionType!=null&&Ot(this._subscriptionType,u);for(const f of this._directives)if(O_(f))for(const h of f.args)Ot(h.type,u);Ot($a,u),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const f of u){if(f==null)continue;const h=f.name;if(h||ue(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[h]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${h}".`);if(this._typeMap[h]=f,mt(f)){for(const v of f.getInterfaces())if(mt(v)){let w=this._implementationsMap[v.name];w===void 0&&(w=this._implementationsMap[v.name]={objects:[],interfaces:[]}),w.interfaces.push(f)}}else if(Kt(f)){for(const v of f.getInterfaces())if(mt(v)){let w=this._implementationsMap[v.name];w===void 0&&(w=this._implementationsMap[v.name]={objects:[],interfaces:[]}),w.objects.push(f)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(r){switch(r){case Yt.QUERY:return this.getQueryType();case Yt.MUTATION:return this.getMutationType();case Yt.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(r){return this.getTypeMap()[r]}getPossibleTypes(r){return _n(r)?r.getTypes():this.getImplementations(r).objects}getImplementations(r){const i=this._implementationsMap[r.name];return i??{objects:[],interfaces:[]}}isSubType(r,i){let o=this._subTypeMap[r.name];if(o===void 0){if(o=Object.create(null),_n(r))for(const u of r.getTypes())o[u.name]=!0;else{const u=this.getImplementations(r);for(const f of u.objects)o[f.name]=!0;for(const f of u.interfaces)o[f.name]=!0}this._subTypeMap[r.name]=o}return o[i.name]!==void 0}getDirectives(){return this._directives}getDirective(r){return this.getDirectives().find(i=>i.name===r)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function Ot(n,r){const i=w_(n);if(!r.has(i)){if(r.add(i),_n(i))for(const o of i.getTypes())Ot(o,r);else if(Kt(i)||mt(i)){for(const o of i.getInterfaces())Ot(o,r);for(const o of Object.values(i.getFields())){Ot(o.type,r);for(const u of o.args)Ot(u.type,r)}}else if(Tn(i))for(const o of Object.values(i.getFields()))Ot(o.type,r)}return r}function Ui(n,r,i){if(n){if(n.kind===N.VARIABLE){n.name.value;return}if(yn(r))return n.kind===N.NULL?void 0:Ui(n,r.ofType,i);if(n.kind===N.NULL)return null;if(Wi(r)){const o=r.ofType;if(n.kind===N.LIST){const f=[];for(const h of n.values)if(Rc(h,i)){if(yn(o))return;f.push(null)}else{const v=Ui(h,o,i);if(v===void 0)return;f.push(v)}return f}const u=Ui(n,o,i);return u===void 0?void 0:[u]}if(Tn(r)){if(n.kind!==N.OBJECT)return;const o=Object.create(null),u=Zc(n.fields,f=>f.name.value);for(const f of Object.values(r.getFields())){const h=u[f.name];if(!h||Rc(h.value,i)){if(f.defaultValue!==void 0)o[f.name]=f.defaultValue;else if(yn(f.type))return;continue}const v=Ui(h.value,f.type,i);if(v===void 0)return;o[f.name]=v}return o}if(il(r)){let o;try{o=r.parseLiteral(n,i)}catch{return}return o===void 0?void 0:o}ji(!1,"Unexpected input type: "+J(r))}}function Rc(n,r){return n.kind===N.VARIABLE&&r==null}function M_(n){const r={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...n},i=r.descriptions?"description":"",o=r.specifiedByUrl?"specifiedByURL":"",u=r.directiveIsRepeatable?"isRepeatable":"",f=r.schemaDescription?i:"";function h(v){return r.inputValueDeprecation?v:""}return`
63
- query IntrospectionQuery {
64
- __schema {
65
- ${f}
66
- queryType { name }
67
- mutationType { name }
68
- subscriptionType { name }
69
- types {
70
- ...FullType
71
- }
72
- directives {
73
- name
74
- ${i}
75
- ${u}
76
- locations
77
- args${h("(includeDeprecated: true)")} {
78
- ...InputValue
79
- }
80
- }
81
- }
82
- }
83
-
84
- fragment FullType on __Type {
85
- kind
86
- name
87
- ${i}
88
- ${o}
89
- fields(includeDeprecated: true) {
90
- name
91
- ${i}
92
- args${h("(includeDeprecated: true)")} {
93
- ...InputValue
94
- }
95
- type {
96
- ...TypeRef
97
- }
98
- isDeprecated
99
- deprecationReason
100
- }
101
- inputFields${h("(includeDeprecated: true)")} {
102
- ...InputValue
103
- }
104
- interfaces {
105
- ...TypeRef
106
- }
107
- enumValues(includeDeprecated: true) {
108
- name
109
- ${i}
110
- isDeprecated
111
- deprecationReason
112
- }
113
- possibleTypes {
114
- ...TypeRef
115
- }
116
- }
117
-
118
- fragment InputValue on __InputValue {
119
- name
120
- ${i}
121
- type { ...TypeRef }
122
- defaultValue
123
- ${h("isDeprecated")}
124
- ${h("deprecationReason")}
125
- }
126
-
127
- fragment TypeRef on __Type {
128
- kind
129
- name
130
- ofType {
131
- kind
132
- name
133
- ofType {
134
- kind
135
- name
136
- ofType {
137
- kind
138
- name
139
- ofType {
140
- kind
141
- name
142
- ofType {
143
- kind
144
- name
145
- ofType {
146
- kind
147
- name
148
- ofType {
149
- kind
150
- name
151
- ofType {
152
- kind
153
- name
154
- ofType {
155
- kind
156
- name
157
- }
158
- }
159
- }
160
- }
161
- }
162
- }
163
- }
164
- }
165
- }
166
- }
167
- `}function $_(n,r){Zt(n)&&Zt(n.__schema)||ue(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${J(n)}.`);const i=n.__schema,o=$n(i.types,x=>x.name,x=>P(x));for(const x of[...ml,...Sl])o[x.name]&&(o[x.name]=x);const u=i.queryType?O(i.queryType):null,f=i.mutationType?O(i.mutationType):null,h=i.subscriptionType?O(i.subscriptionType):null,v=i.directives?i.directives.map(qe):[];return new U_({description:i.description,query:u,mutation:f,subscription:h,types:Object.values(o),directives:v,assumeValid:void 0});function w(x){if(x.kind===ve.LIST){const q=x.ofType;if(!q)throw new Error("Decorated type deeper than introspection query.");return new gt(w(q))}if(x.kind===ve.NON_NULL){const q=x.ofType;if(!q)throw new Error("Decorated type deeper than introspection query.");const Se=w(q);return new re(T_(Se))}return I(x)}function I(x){const q=x.name;if(!q)throw new Error(`Unknown type reference: ${J(x)}.`);const Se=o[q];if(!Se)throw new Error(`Invalid or incomplete schema, unknown type: ${q}. Ensure that a full introspection query is used in order to build a client schema.`);return Se}function O(x){return v_(I(x))}function D(x){return __(I(x))}function P(x){if(x!=null&&x.name!=null&&x.kind!=null)switch(x.kind){case ve.SCALAR:return M(x);case ve.OBJECT:return he(x);case ve.INTERFACE:return ae(x);case ve.UNION:return me(x);case ve.ENUM:return Ye(x);case ve.INPUT_OBJECT:return Te(x)}const q=J(x);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${q}.`)}function M(x){return new jn({name:x.name,description:x.description,specifiedByURL:x.specifiedByURL})}function $(x){if(x.interfaces===null&&x.kind===ve.INTERFACE)return[];if(!x.interfaces){const q=J(x);throw new Error(`Introspection result missing interfaces: ${q}.`)}return x.interfaces.map(D)}function he(x){return new En({name:x.name,description:x.description,interfaces:()=>$(x),fields:()=>L(x)})}function ae(x){return new pl({name:x.name,description:x.description,interfaces:()=>$(x),fields:()=>L(x)})}function me(x){if(!x.possibleTypes){const q=J(x);throw new Error(`Introspection result missing possibleTypes: ${q}.`)}return new dl({name:x.name,description:x.description,types:()=>x.possibleTypes.map(O)})}function Ye(x){if(!x.enumValues){const q=J(x);throw new Error(`Introspection result missing enumValues: ${q}.`)}return new Yr({name:x.name,description:x.description,values:$n(x.enumValues,q=>q.name,q=>({description:q.description,deprecationReason:q.deprecationReason}))})}function Te(x){if(!x.inputFields){const q=J(x);throw new Error(`Introspection result missing inputFields: ${q}.`)}return new hl({name:x.name,description:x.description,fields:()=>Q(x.inputFields)})}function L(x){if(!x.fields)throw new Error(`Introspection result missing fields: ${J(x)}.`);return $n(x.fields,q=>q.name,ee)}function ee(x){const q=w(x.type);if(!nl(q)){const Se=J(q);throw new Error(`Introspection must provide output type for fields, but received: ${Se}.`)}if(!x.args){const Se=J(x);throw new Error(`Introspection result missing field args: ${Se}.`)}return{description:x.description,deprecationReason:x.deprecationReason,type:q,args:Q(x.args)}}function Q(x){return $n(x,q=>q.name,ce)}function ce(x){const q=w(x.type);if(!tl(q)){const Tt=J(q);throw new Error(`Introspection must provide input type for arguments, but received: ${Tt}.`)}const Se=x.defaultValue!=null?Ui(e_(x.defaultValue),q):void 0;return{description:x.description,type:q,defaultValue:Se,deprecationReason:x.deprecationReason}}function qe(x){if(!x.args){const q=J(x);throw new Error(`Introspection result missing directive args: ${q}.`)}if(!x.locations){const q=J(x);throw new Error(`Introspection result missing directive locations: ${q}.`)}return new gi({name:x.name,description:x.description,isRepeatable:x.isRepeatable,locations:x.locations.slice(),args:Q(x.args)})}}function B_(n){return W_(n,r=>!D_(r),j_)}function j_(n){return!N_(n)&&!k_(n)}function W_(n,r,i){const o=n.getDirectives().filter(r),u=Object.values(n.getTypeMap()).filter(i);return[G_(n),...o.map(f=>K_(f)),...u.map(f=>q_(f))].filter(Boolean).join(`
168
-
169
- `)}function G_(n){if(n.description==null&&V_(n))return;const r=[],i=n.getQueryType();i&&r.push(` query: ${i.name}`);const o=n.getMutationType();o&&r.push(` mutation: ${o.name}`);const u=n.getSubscriptionType();return u&&r.push(` subscription: ${u.name}`),_t(n)+`schema {
170
- ${r.join(`
171
- `)}
172
- }`}function V_(n){const r=n.getQueryType();if(r&&r.name!=="Query")return!1;const i=n.getMutationType();if(i&&i.name!=="Mutation")return!1;const o=n.getSubscriptionType();return!(o&&o.name!=="Subscription")}function q_(n){if(hi(n))return J_(n);if(Kt(n))return z_(n);if(mt(n))return H_(n);if(_n(n))return Q_(n);if(xn(n))return Y_(n);if(Tn(n))return X_(n);ji(!1,"Unexpected type: "+J(n))}function J_(n){return _t(n)+`scalar ${n.name}`+Z_(n)}function Al(n){const r=n.getInterfaces();return r.length?" implements "+r.map(i=>i.name).join(" & "):""}function z_(n){return _t(n)+`type ${n.name}`+Al(n)+Il(n)}function H_(n){return _t(n)+`interface ${n.name}`+Al(n)+Il(n)}function Q_(n){const r=n.getTypes(),i=r.length?" = "+r.join(" | "):"";return _t(n)+"union "+n.name+i}function Y_(n){const r=n.getValues().map((i,o)=>_t(i," ",!o)+" "+i.name+ja(i.deprecationReason));return _t(n)+`enum ${n.name}`+Ba(r)}function X_(n){const r=Object.values(n.getFields()).map((i,o)=>_t(i," ",!o)+" "+Pa(i));return _t(n)+`input ${n.name}`+Ba(r)}function Il(n){const r=Object.values(n.getFields()).map((i,o)=>_t(i," ",!o)+" "+i.name+bl(i.args," ")+": "+String(i.type)+ja(i.deprecationReason));return Ba(r)}function Ba(n){return n.length!==0?` {
173
- `+n.join(`
174
- `)+`
175
- }`:""}function bl(n,r=""){return n.length===0?"":n.every(i=>!i.description)?"("+n.map(Pa).join(", ")+")":`(
176
- `+n.map((i,o)=>_t(i," "+r,!o)+" "+r+Pa(i)).join(`
177
- `)+`
178
- `+r+")"}function Pa(n){const r=ci(n.defaultValue,n.type);let i=n.name+": "+String(n.type);return r&&(i+=` = ${vt(r)}`),i+ja(n.deprecationReason)}function K_(n){return _t(n)+"directive @"+n.name+bl(n.args)+(n.isRepeatable?" repeatable":"")+" on "+n.locations.join(" | ")}function ja(n){return n==null?"":n!==yl?` @deprecated(reason: ${vt({kind:N.STRING,value:n})})`:" @deprecated"}function Z_(n){return n.specifiedByURL==null?"":` @specifiedBy(url: ${vt({kind:N.STRING,value:n.specifiedByURL})})`}function _t(n,r="",i=!0){const{description:o}=n;if(o==null)return"";const u=vt({kind:N.STRING,value:o,block:Dv(o)});return(r&&!i?`
179
- `+r:r)+u.replace(/\n/g,`
180
- `+r)+`
181
- `}class en{constructor(r){const{disableInterceptors:i=!1}=r||{};this.configService=new je,this.client=Mr.default.create(),this.client.interceptors.request.use(async o=>{const u=await this.configService.getConfig();return o.baseURL=u.apiUrl,u.apiKey&&(o.headers.Authorization=`Bearer ${u.apiKey}`),o}),!i&&this.client.interceptors.response.use(o=>o,o=>{throw o.response?.status===401?console.error(R.default.red("Authentication failed. Please run `twenty auth:login` first.")):o.response?.status===403?console.error(R.default.red("Access denied. Check your API key and workspace permissions.")):o.code==="ECONNREFUSED"&&console.error(R.default.red("Cannot connect to Twenty server. Is it running?")),o})}async validateAuth(){try{const i=await this.client.post("/metadata",{query:`
7
+ `.trim(),Ym=c=>{const a=Zr({sourceContent:c,pattern:bs});let i;for(;je.Tr(i=bs.exec(c));)i.groups?.defaultImport&&(a.has("")||a.set("",new Set),a.get("").add("default"));return bs.lastIndex=0,a},Zm=({namedImports:c})=>{const a=[];for(const i of c)i==="default"?a.push("export default /* @__PURE__ */ (() => globalThis.React)();"):a.push(`export var ${i} = /* @__PURE__ */ (() => globalThis.React.${i})();`);return a.join(`
8
+ `)},Xm=Xr({pluginName:"react-globals",namespace:"react-globals",moduleName:"react",moduleFilter:zm,collectImports:Ym,generateExports:Zm,staticContents:{"react/jsx-runtime":Jm}}),Qm=/^\/\/.*$\n/gm,Vm={name:"strip-comments",setup:c=>{c.onEnd(async a=>{if(a.errors.length>0)return;const i=Object.keys(a.metafile?.outputs??{}).filter(f=>f.endsWith(".mjs"));for(const f of i){const g=ee.default.resolve(f),_=await Fs.readFile(g,"utf-8"),S=_.replace(Qm,"");S!==_&&await Fs.writeFile(g,S,"utf-8")}})}},e0=/import\s+(?:\{(?<namedImports>[^}]*)\})?\s*from\s*['"]twenty-sdk['"];?/g,t0=/^twenty-sdk$/,n0=Xr({pluginName:"twenty-sdk-globals",namespace:"twenty-sdk-globals",moduleName:"twenty-sdk",moduleFilter:t0,collectImports:c=>Zr({sourceContent:c,pattern:e0}),generateExports:({namedImports:c})=>[...c].map(a=>`export var ${a} = /* @__PURE__ */ (() => globalThis.TwentySdk.${a})();`).join(`
9
+ `)}),r0=/import\s+\{(?<namedImports>[^}]*)\}\s*from\s*['"]twenty-sdk\/ui['"];?/g,i0=/^twenty-sdk\/ui$/,s0=Xr({pluginName:"twenty-sdk-ui-globals",namespace:"twenty-sdk-ui-globals",moduleName:"twenty-sdk/ui",moduleFilter:i0,collectImports:c=>Zr({sourceContent:c,pattern:r0}),generateExports:({namedImports:c})=>[...c].map(a=>`export var ${a} = /* @__PURE__ */ (() => globalThis.RemoteComponents.TwentyUi${a})();`).join(`
10
+ `)}),a0=/import\s+\{(?<namedImports>[^}]*)\}\s*from\s*['"]twenty-shared(?:\/(?<subPath>[^'"]*?))?['"];?/g,o0=/^twenty-shared(\/.*)?$/,u0=c=>c===""?"globalThis.TwentyShared":`globalThis.TwentyShared['${c}']`,c0=Xr({pluginName:"twenty-shared-globals",namespace:"twenty-shared-globals",moduleName:"twenty-shared",moduleFilter:o0,collectImports:c=>Zr({sourceContent:c,pattern:a0}),generateExports:({namedImports:c,moduleSubPath:a})=>{const i=u0(a);return[...c].map(f=>`export var ${f} = /* @__PURE__ */ (() => ${i}.${f})();`).join(`
11
+ `)}}),l0=()=>[Xm,n0,s0,c0,qm,Vm],Rs="public",f0="TWENTY_API_KEY",h0="TWENTY_API_URL",p0={js:`import { createRequire as __createRequire } from 'module';
12
+ const require = __createRequire(import.meta.url);`},qt=".twenty/output";var ve=(c=>(c.Object="object",c.Field="field",c.LogicFunction="logicFunction",c.FrontComponent="frontComponent",c.Role="role",c))(ve||{});const d0=["path","fs","crypto","stream","util","os","url","http","https","events","buffer","querystring","assert","zlib","net","tls","child_process","worker_threads","twenty-sdk","twenty-sdk/*","twenty-shared","twenty-shared/*"];class xu{constructor(a){this.esBuildContext=null,this.isRestarting=!1,this.lastChecksums=new Map,this.buildCompletePromise=Promise.resolve(),this.resolveBuildComplete=null,this.appPath=a.appPath,this.sourcePaths=a.sourcePaths,this.watchMode=a.watch??!0,this.onFileBuilt=a.handleFileBuilt,this.onBuildError=a.handleBuildError,this.config=a.config}shouldRestart(a){const i=this.sourcePaths.sort().join(","),f=[...a].sort().join(",");return i!==f}async start(){this.sourcePaths.length>0&&await this.createContext()}async close(){await this.esBuildContext?.dispose(),this.esBuildContext=null}async restart(a){if(!this.isRestarting){this.isRestarting=!0;try{await this.close();const i=ee.default.join(this.appPath,qt);await Mm(i,this.sourcePaths,a),this.sourcePaths=a,this.lastChecksums.clear(),this.sourcePaths.length>0&&await this.createContext()}finally{this.isRestarting=!1}}}async createContext(){const a=ee.default.join(this.appPath,qt),i={};for(const _ of this.sourcePaths){const S=_.replace(/\.tsx?$/,"");i[S]=ee.default.join(this.appPath,_)}const f=this,g=[...this.config.extraPlugins??[],{name:"build-notifications",setup:_=>{_.onEnd(async S=>{try{if(S.errors.length>0){S.errors[0].text.includes("Could not resolve")||await this.onBuildError?.(S.errors.map(A=>({error:A.text,location:A.location})));return}await Nm({result:S,appPath:this.appPath,fileFolder:this.config.fileFolder,lastChecksums:f.lastChecksums,onFileBuilt:f.onFileBuilt})}finally{f.resolveBuildComplete?.()}})}}];this.esBuildContext=await wu.context({entryPoints:i,bundle:!0,splitting:!1,format:"esm",platform:this.config.platform,outdir:a,outExtension:{".js":".mjs"},external:this.config.externalModules,tsconfig:ee.default.join(this.appPath,"tsconfig.json"),jsx:this.config.jsx,sourcemap:!0,metafile:!0,logLevel:"silent",minify:this.config.minify,banner:this.config.banner,plugins:g}),this.buildCompletePromise=new Promise(_=>{this.resolveBuildComplete=_}),await this.esBuildContext.rebuild(),await this.buildCompletePromise,this.watchMode&&await this.esBuildContext.watch()}}const g0={name:"external-patterns",setup:c=>{c.onResolve({filter:/(?:^|\/)generated(?:\/|$)/},a=>({path:a.path,external:!0}))}},m0=c=>new xu({...c,config:{externalModules:d0,fileFolder:ft.N.BuiltLogicFunction,platform:"node",extraPlugins:[g0],banner:p0}}),v0=c=>new xu({...c,config:{externalModules:Um,fileFolder:ft.N.BuiltFrontComponent,jsx:"automatic",extraPlugins:l0()}});class _0{constructor(a){this.watcher=null,this.appPath=a.appPath,this.handleChangeDetected=a.handleChangeDetected}async start(){this.watcher=yu.default.watch(this.appPath,{awaitWriteFinish:{stabilityThreshold:100,pollInterval:50},usePolling:!0}),this.watcher.on("all",async(a,i)=>{if(a==="addDir")return;const f=ie.relative(this.appPath,i),g=f.startsWith("node_modules")||f.startsWith("generated")||f.startsWith("dist"),_=f.startsWith(Rs),S=["package.json","yarn.lock"].includes(f),A=f.endsWith(".ts")||f.endsWith(".tsx"),I=f.startsWith(".");(g||!A||I)&&!_&&!S||this.handleChangeDetected(f,a)})}async close(){await this.watcher?.close()}}const w0=({manifest:c,builtFileInfos:a})=>{let i=structuredClone(c);for(const[f,{fileFolder:g,checksum:_}]of a.entries()){const S=ie.relative(qt,f);if(g===ft.N.BuiltLogicFunction){const A=i.logicFunctions,I=A.findIndex(P=>P.builtHandlerPath===S);if(I===-1)continue;i={...i,logicFunctions:A.map((P,J)=>J===I?{...P,builtHandlerChecksum:_}:P)}}if(g===ft.N.PublicAsset){const A=i.publicAssets,I=A.findIndex(P=>P.filePath===S);if(I===-1)continue;i={...i,publicAssets:A.map((P,J)=>J===I?{...P,checksum:_}:P)};continue}if(g===ft.N.BuiltFrontComponent){const A=i.frontComponents,I=A.findIndex(P=>P.builtComponentPath===S)??-1;if(I===-1)continue;i={...i,frontComponents:A.map((P,J)=>J===I?{...P,builtComponentChecksum:_}:P)}}g===ft.N.Dependencies&&(S==="package.json"&&(i.application.packageJsonChecksum=_),S==="yarn.lock"&&(i.application.yarnLockChecksum=_))}return i},y0=async(c,a)=>{const i=ee.default.join(c,qt);await V.ensureDir(i);const f=ee.default.join(i,"manifest.json");return await V.writeJSON(f,a,{spaces:2}),f},x0=ee.join(Is.tmpdir(),".twenty-sdk-test"),S0=()=>process.env.NODE_ENV==="test"?ee.join(x0,"config.json"):ee.join(Is.homedir(),".twenty","config.json"),St="default",Yr=class Yr{constructor(){this.configPath=S0()}static setActiveWorkspace(a){this.activeWorkspace=a??St}static getActiveWorkspace(){return this.activeWorkspace}getActiveWorkspaceName(){return Yr.getActiveWorkspace()}async readRawConfig(){await V.ensureFile(this.configPath);const a=await V.readFile(this.configPath,"utf8");return JSON.parse(a||"{}")}async getConfig(){return this.getConfigForWorkspace(this.getActiveWorkspaceName())}async getConfigForWorkspace(a){const i=this.getDefaultConfig();try{const f=await this.readRawConfig(),g=a===St&&!f.profiles?.[St]?f:f.profiles?.[a],_=g?.apiUrl??i.apiUrl,S=g?.apiKey;return{apiUrl:_,apiKey:S}}catch{return i}}async setConfig(a){const i=await this.readRawConfig(),f=this.getActiveWorkspaceName();i.profiles||(i.profiles={});const g=i.profiles[f]||{apiUrl:""};i.profiles[f]={...g,...a},await V.ensureDir(ee.dirname(this.configPath)),await V.writeFile(this.configPath,JSON.stringify(i,null,2))}async clearConfig(){const a=await this.readRawConfig(),i=this.getActiveWorkspaceName();if(a.profiles||(a.profiles={}),a.profiles[i]&&delete a.profiles[i],i===St){const f=this.getDefaultConfig();delete a.apiKey,a.apiUrl=f.apiUrl}await V.ensureDir(ee.dirname(this.configPath)),await V.writeFile(this.configPath,JSON.stringify(a,null,2))}getDefaultConfig(){return{apiUrl:"http://localhost:3000"}}async getAvailableWorkspaces(){try{const a=await this.readRawConfig(),i=new Set;return i.add(St),a.profiles&&Object.keys(a.profiles).forEach(f=>i.add(f)),Array.from(i).sort()}catch{return[St]}}async getDefaultWorkspace(){try{return(await this.readRawConfig()).defaultWorkspace??St}catch{return St}}async setDefaultWorkspace(a){const i=await this.readRawConfig();i.defaultWorkspace=a,await V.ensureDir(ee.dirname(this.configPath)),await V.writeFile(this.configPath,JSON.stringify(i,null,2))}};Yr.activeWorkspace=St;let Ae=Yr;class Ct{constructor(a){const{disableInterceptors:i=!1}=a||{};this.configService=new Ae,this.client=zr.default.create(),this.client.interceptors.request.use(async f=>{const g=await this.configService.getConfig();return f.baseURL=g.apiUrl,g.apiKey&&(f.headers.Authorization=`Bearer ${g.apiKey}`),f}),!i&&this.client.interceptors.response.use(f=>f,f=>{throw f.response?.status===401?console.error(b.default.red("Authentication failed. Please run `twenty auth:login` first.")):f.response?.status===403?console.error(b.default.red("Access denied. Check your API key and workspace permissions.")):f.code==="ECONNREFUSED"&&console.error(b.default.red("Cannot connect to Twenty server. Is it running?")),f})}async validateAuth(){try{const i=await this.client.post("/metadata",{query:`
182
13
  query CurrentWorkspace {
183
14
  currentWorkspace {
184
15
  id
185
16
  }
186
17
  }
187
- `},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return{authValid:i.status===200&&!i.data.errors,serverUp:i.status===200}}catch{return{authValid:!1,serverUp:!1}}}async checkApplicationExist(r){try{const o=await this.client.post("/metadata",{query:`
18
+ `},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return{authValid:i.status===200&&!i.data.errors,serverUp:i.status===200}}catch{return{authValid:!1,serverUp:!1}}}async checkApplicationExist(a){try{const f=await this.client.post("/metadata",{query:`
188
19
  query CheckApplicationExist($universalIdentifier: UUID!) {
189
20
  checkApplicationExist(universalIdentifier: $universalIdentifier)
190
21
  }
191
- `,variables:{universalIdentifier:r}},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return o.data.errors?{success:!1,error:o.data.errors[0]}:{success:!0,data:o.data.data.checkApplicationExist,message:"Successfully find application"}}catch(i){return{success:!1,error:i}}}async createApplication(r){try{const i=`
22
+ `,variables:{universalIdentifier:a}},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return f.data.errors?{success:!1,error:f.data.errors[0]}:{success:!0,data:f.data.data.checkApplicationExist,message:"Successfully find application"}}catch(i){return{success:!1,error:i}}}async createApplication(a){try{const i=`
192
23
  mutation CreateOneApplication($input: CreateApplicationInput!) {
193
24
  createOneApplication(input: $input) {
194
25
  id
195
26
  universalIdentifier
196
27
  }
197
28
  }
198
- `,o={input:{universalIdentifier:r.application.universalIdentifier,name:r.application.displayName,version:"0.0.1",sourcePath:"cli-sync"}},u=await this.client.post("/metadata",{query:i,variables:o},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return u.data.errors?{success:!1,error:u.data.errors[0]}:{success:!0,data:u.data.data.createOneApplication,message:`Successfully create application: ${r.application.displayName}`}}catch(i){return{success:!1,error:i}}}async syncApplication(r){try{const i=`
29
+ `,f={input:{universalIdentifier:a.application.universalIdentifier,name:a.application.displayName,version:"0.0.1",sourcePath:"cli-sync"}},g=await this.client.post("/metadata",{query:i,variables:f},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return g.data.errors?{success:!1,error:g.data.errors[0]}:{success:!0,data:g.data.data.createOneApplication,message:`Successfully create application: ${a.application.displayName}`}}catch(i){return{success:!1,error:i}}}async syncApplication(a){try{const i=`
199
30
  mutation SyncApplication($manifest: JSON!) {
200
31
  syncApplication(manifest: $manifest)
201
32
  }
202
- `,o={manifest:r},u=await this.client.post("/metadata",{query:i,variables:o},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return u.data.errors?{success:!1,error:u.data.errors[0]}:{success:!0,data:u.data.data.syncApplication,message:`Successfully synced application: ${r.application.displayName}`}}catch(i){return{success:!1,error:i}}}async uninstallApplication(r){try{const i=`
33
+ `,f={manifest:a},g=await this.client.post("/metadata",{query:i,variables:f},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return g.data.errors?{success:!1,error:g.data.errors[0]}:{success:!0,data:g.data.data.syncApplication,message:`Successfully synced application: ${a.application.displayName}`}}catch(i){return{success:!1,error:i}}}async uninstallApplication(a){try{const i=`
203
34
  mutation UninstallApplication($universalIdentifier: String!) {
204
35
  uninstallApplication(universalIdentifier: $universalIdentifier)
205
36
  }
206
- `,o={universalIdentifier:r},u=await this.client.post("/metadata",{query:i,variables:o},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return u.data.errors?{success:!1,error:u.data.errors[0]?.message||"Failed to delete application"}:{success:!0,data:u.data.data.uninstallApplication,message:"Successfully uninstalled application"}}catch(i){if(Mr.default.isAxiosError(i)&&i.response)return{success:!1,error:i.response.data?.errors?.[0]?.message||i.message};throw i}}async getSchema(){try{const r=M_(),i=await this.client.post("/graphql",{query:r},{headers:{"Content-Type":"application/json",Accept:"*/*"}});if(i.data.errors)return{success:!1,error:`GraphQL introspection errors: ${JSON.stringify(i.data.errors)}`};const o=$_(i.data.data);return{success:!0,data:B_(o),message:"Successfully load schema"}}catch(r){if(Mr.default.isAxiosError(r)&&r.response)return{success:!1,error:r.response.data.errors[0]?.message||"Failed to load graphql Schema"};throw r}}async findLogicFunctions(){try{const i=await this.client.post("/metadata",{query:`
37
+ `,f={universalIdentifier:a},g=await this.client.post("/metadata",{query:i,variables:f},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return g.data.errors?{success:!1,error:g.data.errors[0]?.message||"Failed to delete application"}:{success:!0,data:g.data.data.uninstallApplication,message:"Successfully uninstalled application"}}catch(i){if(zr.default.isAxiosError(i)&&i.response)return{success:!1,error:i.response.data?.errors?.[0]?.message||i.message};throw i}}async getSchema(){try{const a=As.getIntrospectionQuery(),i=await this.client.post("/graphql",{query:a},{headers:{"Content-Type":"application/json",Accept:"*/*"}});if(i.data.errors)return{success:!1,error:`GraphQL introspection errors: ${JSON.stringify(i.data.errors)}`};const f=As.buildClientSchema(i.data.data);return{success:!0,data:As.printSchema(f),message:"Successfully load schema"}}catch(a){if(zr.default.isAxiosError(a)&&a.response)return{success:!1,error:a.response.data.errors[0]?.message||"Failed to load graphql Schema"};throw a}}async findLogicFunctions(){try{const i=await this.client.post("/metadata",{query:`
207
38
  query FindManyLogicFunctions {
208
39
  findManyLogicFunctions {
209
40
  id
@@ -212,7 +43,7 @@ ${r.join(`
212
43
  applicationId
213
44
  }
214
45
  }
215
- `},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return i.data.errors?{success:!1,error:i.data.errors[0]?.message||"Failed to fetch functions"}:{success:!0,data:i.data.data.findManyLogicFunctions}}catch(r){return{success:!1,error:r}}}async executeLogicFunction({functionId:r,payload:i}){try{const o=`
46
+ `},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return i.data.errors?{success:!1,error:i.data.errors[0]?.message||"Failed to fetch functions"}:{success:!0,data:i.data.data.findManyLogicFunctions}}catch(a){return{success:!1,error:a}}}async executeLogicFunction({functionId:a,payload:i}){try{const f=`
216
47
  mutation ExecuteOneLogicFunction($input: ExecuteOneLogicFunctionInput!) {
217
48
  executeOneLogicFunction(input: $input) {
218
49
  data
@@ -222,28 +53,28 @@ ${r.join(`
222
53
  error
223
54
  }
224
55
  }
225
- `,u={input:{id:r,payload:i}},f=await this.client.post("/metadata",{query:o,variables:u},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return f.data.errors?{success:!1,error:f.data.errors[0]?.message||"Failed to execute logic function"}:{success:!0,data:f.data.data.executeOneLogicFunction}}catch(o){return{success:!1,error:o}}}async subscribeToLogs({applicationUniversalIdentifier:r,functionUniversalIdentifier:i,functionName:o}){const u=await this.configService.getConfig(),f=Oy.createClient({url:u.apiUrl+"/graphql",headers:{Authorization:`Bearer ${u.apiKey}`,"Content-Type":"application/json",Accept:"text/event-stream"}}),h=`
56
+ `,g={input:{id:a,payload:i}},_=await this.client.post("/metadata",{query:f,variables:g},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return _.data.errors?{success:!1,error:_.data.errors[0]?.message||"Failed to execute logic function"}:{success:!0,data:_.data.data.executeOneLogicFunction}}catch(f){return{success:!1,error:f}}}async subscribeToLogs({applicationUniversalIdentifier:a,functionUniversalIdentifier:i,functionName:f}){const g=await this.configService.getConfig(),_=Am.createClient({url:g.apiUrl+"/graphql",headers:{Authorization:`Bearer ${g.apiKey}`,"Content-Type":"application/json",Accept:"text/event-stream"}}),S=`
226
57
  subscription SubscribeToLogs($input: LogicFunctionLogsInput!) {
227
58
  logicFunctionLogs(input: $input) {
228
59
  logs
229
60
  }
230
61
  }
231
- `,v={input:{applicationUniversalIdentifier:r,universalIdentifier:i,name:o}};f.subscribe({query:h,variables:v},{next:({data:w})=>console.log(w?.logicFunctionLogs.logs),error:w=>console.error(w),complete:()=>console.log("Completed")})}async uploadFile({filePath:r,builtHandlerPath:i,fileFolder:o,applicationUniversalIdentifier:u}){try{const f=xe.resolve(r);if(!xc.existsSync(f))return{success:!1,error:`File not found: ${f}`};const h=xe.basename(f),v=xc.readFileSync(f),w=this.getMimeType(h),I=`
62
+ `,A={input:{applicationUniversalIdentifier:a,universalIdentifier:i,name:f}};_.subscribe({query:S,variables:A},{next:({data:I})=>console.log(I?.logicFunctionLogs.logs),error:I=>console.error(I),complete:()=>console.log("Completed")})}async uploadFile({filePath:a,builtHandlerPath:i,fileFolder:f,applicationUniversalIdentifier:g}){try{const _=ee.resolve(a);if(!cu.existsSync(_))return{success:!1,error:`File not found: ${_}`};const S=ee.basename(_),A=cu.readFileSync(_),I=this.getMimeType(S),P=`
232
63
  mutation UploadApplicationFile($file: Upload!, $applicationUniversalIdentifier: String!, $fileFolder: FileFolder!, $filePath: String!) {
233
64
  uploadApplicationFile(file: $file, applicationUniversalIdentifier: $applicationUniversalIdentifier, fileFolder: $fileFolder, filePath: $filePath)
234
65
  { path }
235
66
  }
236
- `,O=My(o),D=JSON.stringify({query:I,variables:{file:null,applicationUniversalIdentifier:u,filePath:i,fileFolder:O}}),P=JSON.stringify({0:["variables.file"]}),M=new FormData;M.append("operations",D),M.append("map",P),M.append("0",new Blob([new Uint8Array(v)],{type:w}),h);const $=await this.client.post("/graphql",M);return $.data.errors?{success:!1,error:$.data.errors[0]?.message||"Failed to upload file"}:{success:!0,data:$.data.data.uploadApplicationFile,message:`Successfully uploaded ${h}`}}catch(f){return Mr.default.isAxiosError(f)&&f.response?{success:!1,error:f.response.data?.errors?.[0]?.message||f.message}:{success:!1,error:f}}}getMimeType(r){const i=xe.extname(r).toLowerCase();return{".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml",".bmp":"image/bmp",".ico":"image/x-icon",".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".txt":"text/plain",".csv":"text/csv",".json":"application/json",".xml":"application/xml",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".mp3":"audio/mpeg",".mp4":"video/mp4",".avi":"video/x-msvideo",".mov":"video/quicktime",".js":"application/javascript",".ts":"application/typescript",".jsx":"application/javascript",".tsx":"application/typescript",".html":"text/html",".css":"text/css"}[i]||"application/octet-stream"}}class ex{constructor(r){this.apiService=new en,this.applicationUniversalIdentifier=r.applicationUniversalIdentifier,this.appPath=r.appPath}async uploadFile({builtPath:r,fileFolder:i}){const o=ge.relative(vn,r);return await this.apiService.uploadFile({filePath:xe.default.join(this.appPath,r),builtHandlerPath:o,fileFolder:i,applicationUniversalIdentifier:this.applicationUniversalIdentifier})}}var Nl=(n=>(n.DefineApplication="defineApplication",n.DefineField="defineField",n.DefineLogicFunction="defineLogicFunction",n.DefineObject="defineObject",n.DefineRole="defineRole",n.DefineFrontComponent="defineFrontComponent",n))(Nl||{}),mn=(n=>(n.Application="application",n.Fields="fields",n.LogicFunctions="logicFunctions",n.Objects="objects",n.Roles="roles",n.FrontComponents="frontComponents",n.PublicAssets="publicAssets",n))(mn||{});const tx={defineApplication:"application",defineField:"fields",defineLogicFunction:"logicFunctions",defineObject:"objects",defineRole:"roles",defineFrontComponent:"frontComponents"},nx=n=>{if(!ui.isCallExpression(n))return;const r=n.expression;if(ui.isIdentifier(r)&&Object.values(Nl).includes(r.text))return r.text},ix=n=>{const r=ui.createSourceFile("temp.ts",n,ui.ScriptTarget.Latest,!0),i=[];ui.forEachChild(r,o=>{i.push(o)});for(const o of i)if(ui.isExportAssignment(o)){if(o.isExportEquals||!o.expression)return;const u=nx(o.expression);if(u)return u}},rx=["twenty-sdk/ui"],sx={name:"manifest-mock",setup:n=>{const r=new RegExp(`^(${rx.map(i=>i.replace("/","\\/")).join("|")})$`);n.onResolve({filter:r},({path:i})=>({path:i,namespace:"manifest-mock"})),n.onLoad({filter:/.*/,namespace:"manifest-mock"},()=>({contents:"module.exports = new Proxy({}, { get: () => () => {} });",loader:"js"}))}},oi=async({filePath:n,appPath:r})=>{const i=await ax({filePath:n,appPath:r});return ox(i,n)},ax=async({filePath:n,appPath:r})=>{const i=xe.default.join(r,"tsconfig.json"),o=await de.pathExists(i),u=Cy.createRequire(xe.default.join(r,"package.json"));let f,h;try{f=xe.default.dirname(u.resolve("react/package.json")),h=xe.default.dirname(u.resolve("react-dom/package.json"))}catch{}const w=(await $c.build({entryPoints:[n],bundle:!0,write:!1,format:"cjs",platform:"node",target:"node18",jsx:"automatic",tsconfig:o?i:void 0,alias:{...f&&{react:f},...h&&{"react-dom":h}},plugins:[sx],logLevel:"silent"})).outputFiles[0].text,I=await de.mkdtemp(xe.default.join(jc.default.tmpdir(),"twenty-manifest-")),O=xe.default.join(I,"module.cjs");try{return await de.writeFile(O,w),require(O)}finally{await de.remove(I)}},ox=(n,r)=>{if(st.Tr(n.default)&&$y(n.default))return n.default;throw new Error(`Config file ${r} must export a config object default export`)},ux=async n=>await kc.glob(["**/*.ts","**/*.tsx"],{cwd:n,absolute:!0,ignore:["**/node_modules/**","**/*.d.ts","**/dist/**","**/.twenty/**"],onlyFiles:!0}),cx=async n=>await kc.glob([`${ka}/**/*`],{cwd:n,onlyFiles:!0}),lx=async(n,r)=>{const i={};for(const o of r){const f=ge.relative(n,o).split(ge.sep),h=await de.readFile(o,"utf8");let v=i;for(let w=0;w<f.length;w++){const I=f[w];w===f.length-1?v[I]=h:(v[I]=v[I]??{},v=v[I])}}return i},Kr=async n=>{const r=await ux(n),i=[];let o;const u=[],f=[],h=[],v=[],w=[],I=[],O=[],D=[],P=[],M=[],$=[],he=[],ae=[];for(const L of r){const ee=await Pc.readFile(L,"utf-8"),Q=ge.relative(n,L),ce=ix(ee);if(!ce)continue;switch(tx[ce]){case mn.Application:{const x=await oi({appPath:n,filePath:L});o={...x.config,yarnLockChecksum:null,packageJsonChecksum:null},i.push(...x.errors),O.push(Q);break}case mn.Objects:{const x=await oi({appPath:n,filePath:L});u.push(x.config),i.push(...x.errors),D.push(Q);break}case mn.Fields:{const x=await oi({appPath:n,filePath:L});f.push(x.config),i.push(...x.errors),P.push(Q);break}case mn.Roles:{const x=await oi({appPath:n,filePath:L});h.push(x.config),i.push(...x.errors),M.push(Q);break}case mn.LogicFunctions:{const x=await oi({appPath:n,filePath:L});i.push(...x.errors);const{handler:q,...Se}=x.config,Tt=ge.relative(n,L),tn={...Se,handlerName:"default.config.handler",sourceHandlerPath:Tt,builtHandlerPath:Tt.replace(/\.tsx?$/,".mjs"),builtHandlerChecksum:"[default-checksum]"};v.push(tn),$.push(Q);break}case mn.FrontComponents:{const x=await oi({appPath:n,filePath:L});i.push(...x.errors);const{component:q,...Se}=x.config,Tt=ge.relative(n,L),tn={...Se,componentName:q.name,sourceComponentPath:Tt,builtComponentPath:Tt.replace(/\.tsx?$/,".mjs"),builtComponentChecksum:""};w.push(tn),he.push(Q);break}case mn.PublicAssets:break;default:st.ln()}}const me=await cx(n);for(const L of me)I.push({filePath:L,fileName:ge.basename(L),fileType:ge.extname(L).replace(/^\./,""),checksum:null}),ae.push(ge.relative(n,L));return o||i.push("Cannot build application, please export default defineApplication() to define an application"),{manifest:o?{application:o,objects:u,fields:f,roles:h,logicFunctions:v,frontComponents:w,publicAssets:I,sources:await lx(n,r)}:null,filePaths:{application:O,objects:D,fields:P,roles:M,logicFunctions:$,frontComponents:he,publicAssets:ae},errors:i}},fx=n=>{const r=new Set,i=new Set;for(const o of n)r.has(o)?i.add(o):r.add(o);return Array.from(i)},Ol=n=>{const r=[];if(!n)return[];for(const[i,o]of Object.entries(n))i==="universalIdentifier"&&typeof o=="string"&&r.push(o),typeof o=="object"&&r.push(...Ol(o));return r},px=n=>{const r=[],i=[],o=fx(Ol(n));return o.length>0&&r.push(`Duplicate universal identifiers: ${o.join(", ")}`),st.Zo(n.objects)||i.push("No object defined"),st.Zo(n.logicFunctions)||i.push("No logic function defined"),st.Zo(n.frontComponents)||i.push("No front component defined"),{errors:r,warnings:i,isValid:r.length===0}};class dx{constructor(r){this.builtFileInfos=new Map,this.fileUploader=null,this.apiService=new en({disableInterceptors:!0}),this.activeUploads=new Set,this.syncTimer=null,this.isSyncing=!1,this.serverReady=!1,this.serverErrorLogged=!1,this.appPath=r.appPath,this.debounceMs=r.debounceMs??200,this.handleManifestBuilt=r.handleManifestBuilt,this.uiStateManager=r.uiStateManager}async checkServer(){const r=await this.apiService.validateAuth();if(!r.serverUp){this.serverErrorLogged||(this.uiStateManager.addEvent({message:"Cannot reach server",status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:"Cannot connect to Twenty server. Is it running?"}),this.serverErrorLogged=!0);return}if(!r.authValid){this.serverErrorLogged||(this.uiStateManager.addEvent({message:"Authentication failed",status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:'Cannot authenticate. Check your credentials are correct with "yarn auth:login"'}),this.serverErrorLogged=!0);return}this.serverErrorLogged=!1,this.serverReady=!0}async handleChangeDetected(r,i){this.serverReady||await this.checkServer(),this.serverReady&&(this.uiStateManager.addEvent({message:`Change detected: ${r}`,status:"info"}),i==="unlink"?this.uiStateManager.removeEntity(r):this.uiStateManager.updateFileStatus(r,"building"),this.scheduleSync())}handleFileBuildError(r){this.uiStateManager.addEvent({message:"Build failed:",status:"error"});for(const i of r)this.uiStateManager.addEvent({message:i.error,status:"error"})}handleFileBuilt({fileFolder:r,builtPath:i,sourcePath:o,checksum:u}){this.uiStateManager.addEvent({message:`Successfully built ${i}`,status:"success"}),this.builtFileInfos.set(i,{checksum:u,builtPath:i,sourcePath:o,fileFolder:r}),this.fileUploader&&this.uploadFile(i,o,r),this.scheduleSync()}uploadFile(r,i,o){this.uiStateManager.addEvent({message:`Uploading ${r}`,status:"info"}),this.uiStateManager.updateFileStatus(i,"uploading");const u=this.fileUploader.uploadFile({builtPath:r,fileFolder:o}).then(f=>{f.success?(this.uiStateManager.addEvent({message:`Successfully uploaded ${r}`,status:"success"}),this.uiStateManager.updateFileStatus(i,"success")):this.uiStateManager.addEvent({message:`Failed to upload ${r}: ${f.error}`,status:"error"})}).catch(f=>{this.uiStateManager.addEvent({message:`Upload failed for ${r}: ${f}`,status:"error"})}).finally(()=>{this.activeUploads.delete(u)});this.activeUploads.add(u)}cancelPendingSync(){this.syncTimer&&(clearTimeout(this.syncTimer),this.syncTimer=null)}scheduleSync(){this.cancelPendingSync(),this.syncTimer=setTimeout(()=>{this.syncTimer=null,this.performSync()},this.debounceMs)}async performSync(){if(!this.isSyncing){this.isSyncing=!0;try{this.uiStateManager.addEvent({message:"Building manifest",status:"info"}),this.uiStateManager.updateManifestState({manifestStatus:"building"});const r=await Kr(this.appPath);if(r.errors.length>0||!r.manifest){for(const f of r.errors)this.uiStateManager.addEvent({message:f,status:"error"});this.uiStateManager.updateManifestState({manifestStatus:"error",error:r.errors[r.errors.length-1]});return}const i=px(r.manifest);if(!i.isValid){for(const f of i.errors)this.uiStateManager.addEvent({message:f,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:f});return}if(this.uiStateManager.updateManifestState({appName:r.manifest.application.displayName}),this.uiStateManager.updateAllFilesTypes({manifestFilePaths:r.filePaths}),i.warnings.length>0)for(const f of i.warnings)this.uiStateManager.addEvent({message:`⚠ ${f}`,status:"warning"});if(this.uiStateManager.addEvent({message:"Successfully built manifest",status:"success"}),await this.handleManifestBuilt(r),!this.fileUploader){const f=await this.apiService.checkApplicationExist(r.manifest.application.universalIdentifier);if(!f.success){this.uiStateManager.addEvent({message:`Failed to check if application ${r.manifest.application.universalIdentifier} already exists`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:"Failed to check if application already exists"});return}if(!f.data){this.uiStateManager.addEvent({message:"Creating application",status:"info"});const v=await this.apiService.createApplication(r.manifest);if(v.success)this.uiStateManager.addEvent({message:"Application created",status:"success"});else{this.uiStateManager.addEvent({message:`Application creation failed with error ${JSON.stringify(v.error,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:`Application creation failed with error ${JSON.stringify(v.error,null,2)}`});return}}this.fileUploader=new ex({appPath:this.appPath,applicationUniversalIdentifier:r.manifest.application.universalIdentifier});for(const[v,{fileFolder:w,sourcePath:I}]of this.builtFileInfos.entries())this.uploadFile(v,I,w)}for(;this.activeUploads.size>0;)await Promise.all(this.activeUploads);const o=Av({manifest:r.manifest,builtFileInfos:this.builtFileInfos});this.uiStateManager.addEvent({message:"Manifest checksums set",status:"info"}),await Iv(this.appPath,o),this.uiStateManager.addEvent({message:"Manifest saved to output directory",status:"info"}),this.uiStateManager.addEvent({message:"Syncing manifest",status:"info"}),this.uiStateManager.updateManifestState({manifestStatus:"syncing"});const u=await this.apiService.syncApplication(o);this.uiStateManager.updateAllFilesStatus("success"),u.success?(this.uiStateManager.addEvent({message:"✓ Synced",status:"success"}),this.uiStateManager.updateManifestState({manifestStatus:"synced"})):(this.uiStateManager.addEvent({message:`Sync failed with error ${JSON.stringify(u.error,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error"}))}catch(r){this.uiStateManager.addEvent({message:`Sync failed with error ${JSON.stringify(r,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error"})}finally{this.isSyncing=!1}}}}const hx={pending:["building","uploading","success"],building:["pending","uploading","success"],uploading:["pending","success"],success:["pending","building","uploading"]};class gx{constructor({appPath:r,frontendUrl:i}){this.eventIdCounter=0,this.listeners=new Set,this.state={appPath:r,frontendUrl:i,appName:null,appDescription:null,appUniversalIdentifier:null,manifestStatus:"idle",entities:new Map,events:[]}}getSnapshot(){return this.state}subscribe(r){return this.listeners.add(r),r(this.getSnapshot()),()=>this.listeners.delete(r)}notify(){for(const r of this.listeners)r(this.state)}addEvent({message:r,status:i="info"}){const o={id:++this.eventIdCounter,timestamp:new Date,message:r.slice(0,5e3),status:i};this.state={...this.state,events:[...this.state.events.slice(-201),o]},this.notify()}updateManifestState({manifestStatus:r,appName:i,error:o}){this.state={...this.state,...r?{manifestStatus:r}:{},...i?{appName:i}:{},...o?{error:o.slice(0,5e3)}:{error:void 0}},this.notify()}convertEntityTypeToSyncableEntity(r){switch(r){case"objects":return De.Object;case"fields":return De.Field;case"logicFunctions":return De.LogicFunction;case"frontComponents":return De.FrontComponent;case"roles":return De.Role;default:return}}updateAllFilesTypes({manifestFilePaths:r}){const i=new Map;Object.entries(r).forEach(([u,f])=>{f.forEach(h=>{const v=this.convertEntityTypeToSyncableEntity(u);v&&i.set(h,v)})});const o=new Map(this.state.entities);for(const[u,f]of o)o.set(u,{...f,type:i.get(u)});this.state={...this.state,entities:o},this.notify()}updateAllFilesStatus(r){const i=new Map(this.state.entities);for(const[o,u]of i)i.set(o,{...u,status:r});this.state={...this.state,entities:i},this.notify()}removeEntity(r){const i=new Map(this.state.entities);i.delete(r),this.state={...this.state,entities:i}}updateFileStatus(r,i){const o=new Map(this.state.entities),u=o.get(r);u?.status&&!hx[u.status].find(f=>f===i)||(o.set(r,u?{...u,status:i}:{name:r,path:r,status:i}),this.state={...this.state,entities:o},this.notify())}}const ba=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],Cc=["↑","⇡","↟","⤒"],Wr={pending:"○",success:"✓"},Pi={pending:"gray",building:"yellow",uploading:"cyan",success:"green"},Rl={[De.Object]:"Objects",[De.Field]:"Fields",[De.LogicFunction]:"Logic functions",[De.FrontComponent]:"Front components",[De.Role]:"Roles"},Cl=Object.keys(Rl),mx={info:"gray",success:"green",error:"red",warning:"yellow"},yx=n=>{const r=new Map;for(const i of Cl)r.set(i,[]);for(const i of n.values()){if(!i.type)continue;const o=r.get(i.type)??[];o.push(i),r.set(i.type,o)}return r},vx=n=>n.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),_x=(n,r=40)=>{if(n.length<=r)return n;const i=n.split("/");return i.length<=2?n:`.../${i.slice(-2).join("/")}`},xx=n=>!n.frontendUrl||!n.appUniversalIdentifier?null:`${n.frontendUrl}/settings/applications`,Tx=async n=>{const[r,i]=await Promise.all([import("react"),import("ink")]),{useState:o,useEffect:u}=r,{render:f,Box:h,Text:v,Static:w}=i,I=(L,ee=80)=>{const[Q,ce]=o(0);return u(()=>{const qe=setInterval(()=>{ce(x=>(x+1)%L.length)},ee);return()=>clearInterval(qe)},[L.length,ee]),L[Q]},O=({event:L})=>{const ee=mx[L.status],Q=vx(L.timestamp);return B.jsxRuntimeExports.jsxs(h,{children:[B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[Q," "]}),B.jsxRuntimeExports.jsx(v,{color:ee,children:L.message})]})},D=({status:L})=>{const ee=I(ba,200),Q=I(Cc,200),ce={building:ee,uploading:Q,pending:Wr.pending,success:Wr.success};return B.jsxRuntimeExports.jsxs(v,{color:Pi[L],children:[ce[L]," "]})},P=({entity:L})=>B.jsxRuntimeExports.jsxs(h,{children:[B.jsxRuntimeExports.jsx(D,{status:L.status}),B.jsxRuntimeExports.jsx(v,{children:L.name}),L.path!==L.name&&B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[" (",_x(L.path),")"]})]}),M=({type:L,entities:ee})=>ee.length===0?null:B.jsxRuntimeExports.jsxs(h,{flexDirection:"column",marginTop:1,children:[B.jsxRuntimeExports.jsx(v,{bold:!0,dimColor:!0,children:Rl[L]}),ee.map(Q=>B.jsxRuntimeExports.jsx(P,{entity:Q},Q.path))]}),$={synced:{color:"green",icon:"✓",text:"Synced"},building:{color:"yellow",icon:"spinner",text:"Building..."},syncing:{color:"yellow",icon:"spinner",text:"Syncing..."},error:{color:"red",icon:null,text:"Error"},idle:{color:"gray",icon:null,text:"Idle"}},he=({snapshot:L})=>{const ee=I(ba,80),Q=$[L.manifestStatus],ce=Q.icon==="spinner"?ee:Q.icon;return B.jsxRuntimeExports.jsxs(v,{color:Q.color,children:[ce?`${ce} `:"",Q.text,L.error&&`: ${L.error}`]})},ae=({snapshot:L})=>{const ee=yx(L.entities),Q=xx(L);return B.jsxRuntimeExports.jsxs(h,{flexDirection:"column",borderStyle:"classic",borderColor:"gray",paddingX:1,children:[B.jsxRuntimeExports.jsx(v,{bold:!0,color:"cyan",children:"Application"}),B.jsxRuntimeExports.jsxs(h,{marginLeft:2,flexDirection:"column",children:[B.jsxRuntimeExports.jsxs(h,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Name: "}),B.jsxRuntimeExports.jsx(v,{bold:!0,children:L.appName??"Loading..."})]}),L.appDescription&&B.jsxRuntimeExports.jsxs(h,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Description: "}),B.jsxRuntimeExports.jsx(v,{children:L.appDescription})]}),B.jsxRuntimeExports.jsxs(h,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Status: "}),B.jsxRuntimeExports.jsx(he,{snapshot:L})]}),Q&&B.jsxRuntimeExports.jsxs(h,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Open:"}),B.jsxRuntimeExports.jsxs(v,{bold:!0,color:"cyan",children:[" ",Q]})]})]}),B.jsxRuntimeExports.jsx(h,{marginLeft:2,flexDirection:"column",children:Cl.map(ce=>{const qe=ee.get(ce)??[];return B.jsxRuntimeExports.jsx(M,{type:ce,entities:qe},ce)})})]})},me=()=>B.jsxRuntimeExports.jsx(h,{marginTop:1,children:B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[B.jsxRuntimeExports.jsx(v,{color:Pi.pending,children:Wr.pending})," ","pending ",B.jsxRuntimeExports.jsx(v,{color:Pi.building,children:ba[0]})," ","building ",B.jsxRuntimeExports.jsx(v,{color:Pi.uploading,children:Cc[0]})," ","uploading"," ",B.jsxRuntimeExports.jsx(v,{color:Pi.success,children:Wr.success})," ","success"]})}),Ye=()=>{const[L,ee]=o(n.getSnapshot());return u(()=>n.subscribe(ee),[]),B.jsxRuntimeExports.jsxs(B.jsxRuntimeExports.Fragment,{children:[B.jsxRuntimeExports.jsx(w,{items:L.events,children:Q=>B.jsxRuntimeExports.jsx(O,{event:Q},Q.id)}),B.jsxRuntimeExports.jsxs(h,{marginTop:1,flexDirection:"column",children:[B.jsxRuntimeExports.jsx(ae,{snapshot:L}),B.jsxRuntimeExports.jsx(me,{})]})]})},{unmount:Te}=f(B.jsxRuntimeExports.jsx(Ye,{}));return{unmount:Te}};class Lc{constructor(r){this.watcher=null,this.appPath=r.appPath,this.fileFolder=r.fileFolder,this.watchPaths=r.watchPaths,this.handleFileBuilt=r.handleFileBuilt}async start(){const r=this.watchPaths.map(i=>ge.join(this.appPath,i));for(const i of r)if(!await de.pathExists(i))return;this.watcher=Bc.default.watch(r,{awaitWriteFinish:{stabilityThreshold:100,pollInterval:50},usePolling:!0}),this.watcher.on("all",(i,o)=>{i!=="addDir"&&((i==="add"||i==="change")&&this.copyAndNotify(o),i==="unlink"&&this.handleUnlink(o))})}async close(){await this.watcher?.close()}async copyAndNotify(r){const i=ge.relative(this.appPath,r),o=ge.join(vn,i),u=ge.join(this.appPath,o);await de.ensureDir(ge.dirname(u)),await de.copy(r,u);const f=await de.readFile(u),h=Mc.default.createHash("md5").update(f).digest("hex");this.handleFileBuilt({fileFolder:this.fileFolder,builtPath:o,sourcePath:i,checksum:h})}async handleUnlink(r){const i=ge.relative(this.appPath,r),o=ge.join(vn,i),u=ge.join(this.appPath,o);await de.remove(u)}}class wx{constructor(){this.appPath="",this.orchestrator=null,this.manifestWatcher=null,this.logicFunctionsWatcher=null,this.frontComponentsWatcher=null,this.assetWatcher=null,this.dependencyWatcher=null,this.watchersStarted=!1,this.uiStateManager=null,this.unmountUI=null}async execute(r){this.appPath=r.appPath??Xt,await this.cleanOutputDir(),this.uiStateManager=new gx({appPath:this.appPath,frontendUrl:process.env.FRONTEND_URL});const{unmount:i}=await Tx(this.uiStateManager);this.unmountUI=i,this.orchestrator=new dx({appPath:this.appPath,handleManifestBuilt:this.handleWatcherRestarts.bind(this),uiStateManager:this.uiStateManager}),await this.startManifestWatcher(),this.setupGracefulShutdown()}async cleanOutputDir(){const r=xe.default.join(this.appPath,vn);await de.ensureDir(r),await de.emptyDir(r)}async startManifestWatcher(){this.manifestWatcher=new Sv({appPath:this.appPath,handleChangeDetected:this.orchestrator.handleChangeDetected.bind(this.orchestrator)}),await this.manifestWatcher.start()}async handleWatcherRestarts(r){const{logicFunctions:i,frontComponents:o}=r.filePaths;if(!this.watchersStarted){this.watchersStarted=!0,await this.startFileWatchers(i,o);return}this.logicFunctionsWatcher?.shouldRestart(i)&&await this.logicFunctionsWatcher.restart(i),this.frontComponentsWatcher?.shouldRestart(o)&&await this.frontComponentsWatcher.restart(o)}async startFileWatchers(r,i){await Promise.all([this.startLogicFunctionsWatcher(r),this.startFrontComponentsWatcher(i),this.startAssetWatcher(),this.startDependencyWatcher()])}async startLogicFunctionsWatcher(r){this.logicFunctionsWatcher=wv({appPath:this.appPath,sourcePaths:r,handleBuildError:this.orchestrator.handleFileBuildError.bind(this.orchestrator),handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.logicFunctionsWatcher.start()}async startFrontComponentsWatcher(r){this.frontComponentsWatcher=Ev({appPath:this.appPath,sourcePaths:r,handleBuildError:this.orchestrator.handleFileBuildError.bind(this.orchestrator),handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.frontComponentsWatcher.start()}async startAssetWatcher(){this.assetWatcher=new Lc({appPath:this.appPath,fileFolder:kt.N.PublicAsset,watchPaths:[ka],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.assetWatcher.start()}async startDependencyWatcher(){this.dependencyWatcher=new Lc({appPath:this.appPath,fileFolder:kt.N.Dependencies,watchPaths:["package.json","yarn.lock"],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),this.dependencyWatcher.start()}setupGracefulShutdown(){const r=async()=>{this.unmountUI?.(),await Promise.all([this.manifestWatcher?.close(),this.logicFunctionsWatcher?.close(),this.frontComponentsWatcher?.close(),this.assetWatcher?.close(),this.dependencyWatcher?.close()]),process.exit(0)};process.on("SIGINT",()=>void r()),process.on("SIGTERM",()=>void r())}}const Ex="generated";class Sx{constructor(){this.configService=new je,this.apiService=new en}async generate(r){const i=ge.join(r,Ex);console.log(R.default.blue("📦 Generating Twenty client...")),console.log(R.default.gray(`📁 Output Path: ${i}`)),console.log("");const o=await this.configService.getConfig(),u=o.apiUrl,f=o.apiKey;if(!u||!f){console.log(R.default.yellow("⚠️ Skipping Client generation: API URL or token not configured"));return}console.log(R.default.gray(`API URL: ${u}`)),console.log(R.default.gray(`Output: ${i}`));const h=await this.apiService.getSchema();if(!h.success)return;const{data:v}=h,w=ge.resolve(i);await Ly.generate({schema:v,output:w,scalarTypes:{DateTime:"string",JSON:"Record<string, unknown>",UUID:"string"}}),await this.injectTwentyClient(w),console.log(R.default.green("✓ Client generated successfully!")),console.log(R.default.gray(`Generated files at: ${i}`))}async injectTwentyClient(r){const i=`
67
+ `,J=Om(f),G=JSON.stringify({query:P,variables:{file:null,applicationUniversalIdentifier:g,filePath:i,fileFolder:J}}),K=JSON.stringify({0:["variables.file"]}),k=new FormData;k.append("operations",G),k.append("map",K),k.append("0",new Blob([new Uint8Array(A)],{type:I}),S);const ue=await this.client.post("/metadata",k);return ue.data.errors?{success:!1,error:ue.data.errors[0]?.message||"Failed to upload file"}:{success:!0,data:ue.data.data.uploadApplicationFile,message:`Successfully uploaded ${S}`}}catch(_){return zr.default.isAxiosError(_)&&_.response?{success:!1,error:_.response.data?.errors?.[0]?.message||_.message}:{success:!1,error:_}}}getMimeType(a){const i=ee.extname(a).toLowerCase();return{".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml",".bmp":"image/bmp",".ico":"image/x-icon",".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".txt":"text/plain",".csv":"text/csv",".json":"application/json",".xml":"application/xml",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".mp3":"audio/mpeg",".mp4":"video/mp4",".avi":"video/x-msvideo",".mov":"video/quicktime",".js":"application/javascript",".ts":"application/typescript",".jsx":"application/javascript",".tsx":"application/typescript",".html":"text/html",".css":"text/css"}[i]||"application/octet-stream"}}class A0{constructor(a){this.apiService=new Ct,this.applicationUniversalIdentifier=a.applicationUniversalIdentifier,this.appPath=a.appPath}async uploadFile({builtPath:a,fileFolder:i}){const f=ie.relative(qt,a);return await this.apiService.uploadFile({filePath:ee.default.join(this.appPath,a),builtHandlerPath:f,fileFolder:i,applicationUniversalIdentifier:this.applicationUniversalIdentifier})}}var Su=(c=>(c.DefineApplication="defineApplication",c.DefineField="defineField",c.DefineLogicFunction="defineLogicFunction",c.DefineObject="defineObject",c.DefineRole="defineRole",c.DefineFrontComponent="defineFrontComponent",c))(Su||{}),jt=(c=>(c.Application="application",c.Fields="fields",c.LogicFunctions="logicFunctions",c.Objects="objects",c.Roles="roles",c.FrontComponents="frontComponents",c.PublicAssets="publicAssets",c))(jt||{});const b0={defineApplication:"application",defineField:"fields",defineLogicFunction:"logicFunctions",defineObject:"objects",defineRole:"roles",defineFrontComponent:"frontComponents"},E0=c=>{if(!Fn.isCallExpression(c))return;const a=c.expression;if(Fn.isIdentifier(a)&&Object.values(Su).includes(a.text))return a.text},C0=c=>{const a=Fn.createSourceFile("temp.ts",c,Fn.ScriptTarget.Latest,!0),i=[];Fn.forEachChild(a,f=>{i.push(f)});for(const f of i)if(Fn.isExportAssignment(f)){if(f.isExportEquals||!f.expression)return;const g=E0(f.expression);if(g)return g}},T0=["twenty-sdk/ui"],F0={name:"manifest-mock",setup:c=>{const a=new RegExp(`^(${T0.map(i=>i.replace("/","\\/")).join("|")})$`);c.onResolve({filter:a},({path:i})=>({path:i,namespace:"manifest-mock"})),c.onLoad({filter:/.*/,namespace:"manifest-mock"},()=>({contents:"module.exports = new Proxy({}, { get: () => () => {} });",loader:"js"}))}},Tn=async({filePath:c,appPath:a})=>{const i=await I0({filePath:c,appPath:a});return R0(i,c)},I0=async({filePath:c,appPath:a})=>{const i=ee.default.join(a,"tsconfig.json"),f=await V.pathExists(i),g=Em.createRequire(ee.default.join(a,"package.json"));let _,S;try{_=ee.default.dirname(g.resolve("react/package.json")),S=ee.default.dirname(g.resolve("react-dom/package.json"))}catch{}const I=(await wu.build({entryPoints:[c],bundle:!0,write:!1,format:"cjs",platform:"node",target:"node18",jsx:"automatic",tsconfig:f?i:void 0,alias:{..._&&{react:_},...S&&{"react-dom":S}},plugins:[F0],logLevel:"silent"})).outputFiles[0].text,P=await V.mkdtemp(ee.default.join(Is.default.tmpdir(),"twenty-manifest-")),J=ee.default.join(P,"module.cjs");try{return await V.writeFile(J,I),require(J)}finally{await V.remove(P)}},R0=(c,a)=>{if(je.Tr(c.default)&&Lm(c.default))return c.default;throw new Error(`Config file ${a} must export a config object default export`)},P0=async c=>await mu.glob(["**/*.ts","**/*.tsx"],{cwd:c,absolute:!0,ignore:["**/node_modules/**","**/*.d.ts","**/dist/**","**/.twenty/**"],onlyFiles:!0}),O0=async c=>await mu.glob([`${Rs}/**/*`],{cwd:c,onlyFiles:!0}),Qr=async c=>{const a=await P0(c),i=[];let f;const g=[],_=[],S=[],A=[],I=[],P=[],J=[],G=[],K=[],k=[],ue=[],Oe=[],pe=[];for(const F of a){const Z=await gu.readFile(F,"utf-8"),z=ie.relative(c,F),se=C0(Z);if(!se)continue;switch(b0[se]){case jt.Application:{const ne=await Tn({appPath:c,filePath:F});f={...ne.config,yarnLockChecksum:null,packageJsonChecksum:null},i.push(...ne.errors),J.push(z);break}case jt.Objects:{const ne=await Tn({appPath:c,filePath:F});g.push(ne.config),i.push(...ne.errors),G.push(z);break}case jt.Fields:{const ne=await Tn({appPath:c,filePath:F});_.push(ne.config),i.push(...ne.errors),K.push(z);break}case jt.Roles:{const ne=await Tn({appPath:c,filePath:F});S.push(ne.config),i.push(...ne.errors),k.push(z);break}case jt.LogicFunctions:{const ne=await Tn({appPath:c,filePath:F});i.push(...ne.errors);const{handler:Ht,...Ge}=ne.config,ht=ie.relative(c,F),Ft={...Ge,handlerName:"default.config.handler",sourceHandlerPath:ht,builtHandlerPath:ht.replace(/\.tsx?$/,".mjs"),builtHandlerChecksum:"[default-checksum]"};A.push(Ft),ue.push(z);break}case jt.FrontComponents:{const ne=await Tn({appPath:c,filePath:F});i.push(...ne.errors);const{component:Ht,...Ge}=ne.config,ht=ie.relative(c,F),Ft={...Ge,componentName:Ht.name,sourceComponentPath:ht,builtComponentPath:ht.replace(/\.tsx?$/,".mjs"),builtComponentChecksum:""};I.push(Ft),Oe.push(z);break}case jt.PublicAssets:break;default:je.ln()}}const Le=await O0(c);for(const F of Le)P.push({filePath:F,fileName:ie.basename(F),fileType:ie.extname(F).replace(/^\./,""),checksum:null}),pe.push(ie.relative(c,F));return f||i.push("Cannot build application, please export default defineApplication() to define an application"),{manifest:f?{application:f,objects:g,fields:_,roles:S,logicFunctions:A,frontComponents:I,publicAssets:P}:null,filePaths:{application:J,objects:G,fields:K,roles:k,logicFunctions:ue,frontComponents:Oe,publicAssets:pe},errors:i}},L0=c=>{const a=new Set,i=new Set;for(const f of c)a.has(f)?i.add(f):a.add(f);return Array.from(i)},Au=c=>{const a=[];if(!c)return[];for(const[i,f]of Object.entries(c))i==="universalIdentifier"&&typeof f=="string"&&a.push(f),typeof f=="object"&&a.push(...Au(f));return a},M0=c=>{const a=[],i=[],f=L0(Au(c));return f.length>0&&a.push(`Duplicate universal identifiers: ${f.join(", ")}`),je.Zo(c.objects)||i.push("No object defined"),je.Zo(c.logicFunctions)||i.push("No logic function defined"),je.Zo(c.frontComponents)||i.push("No front component defined"),{errors:a,warnings:i,isValid:a.length===0}};class N0{constructor(a){this.builtFileInfos=new Map,this.fileUploader=null,this.apiService=new Ct({disableInterceptors:!0}),this.activeUploads=new Set,this.syncTimer=null,this.isSyncing=!1,this.serverReady=!1,this.serverErrorLogged=!1,this.appPath=a.appPath,this.debounceMs=a.debounceMs??200,this.handleManifestBuilt=a.handleManifestBuilt,this.uiStateManager=a.uiStateManager}async checkServer(){const a=await this.apiService.validateAuth();if(!a.serverUp){this.serverErrorLogged||(this.uiStateManager.addEvent({message:"Cannot reach server",status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:"Cannot connect to Twenty server. Is it running?"}),this.serverErrorLogged=!0);return}if(!a.authValid){this.serverErrorLogged||(this.uiStateManager.addEvent({message:"Authentication failed",status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:'Cannot authenticate. Check your credentials are correct with "yarn auth:login"'}),this.serverErrorLogged=!0);return}this.serverErrorLogged=!1,this.serverReady=!0}async handleChangeDetected(a,i){this.serverReady||await this.checkServer(),this.serverReady&&(this.uiStateManager.addEvent({message:`Change detected: ${a}`,status:"info"}),i==="unlink"?this.uiStateManager.removeEntity(a):this.uiStateManager.updateFileStatus(a,"building"),this.scheduleSync())}handleFileBuildError(a){this.uiStateManager.addEvent({message:"Build failed:",status:"error"});for(const i of a)this.uiStateManager.addEvent({message:i.error,status:"error"})}handleFileBuilt({fileFolder:a,builtPath:i,sourcePath:f,checksum:g}){this.uiStateManager.addEvent({message:`Successfully built ${i}`,status:"success"}),this.builtFileInfos.set(i,{checksum:g,builtPath:i,sourcePath:f,fileFolder:a}),this.fileUploader&&this.uploadFile(i,f,a),this.scheduleSync()}uploadFile(a,i,f){this.uiStateManager.addEvent({message:`Uploading ${a}`,status:"info"}),this.uiStateManager.updateFileStatus(i,"uploading");const g=this.fileUploader.uploadFile({builtPath:a,fileFolder:f}).then(_=>{_.success?(this.uiStateManager.addEvent({message:`Successfully uploaded ${a}`,status:"success"}),this.uiStateManager.updateFileStatus(i,"success")):this.uiStateManager.addEvent({message:`Failed to upload ${a}: ${_.error}`,status:"error"})}).catch(_=>{this.uiStateManager.addEvent({message:`Upload failed for ${a}: ${_}`,status:"error"})}).finally(()=>{this.activeUploads.delete(g)});this.activeUploads.add(g)}cancelPendingSync(){this.syncTimer&&(clearTimeout(this.syncTimer),this.syncTimer=null)}scheduleSync(){this.cancelPendingSync(),this.syncTimer=setTimeout(()=>{this.syncTimer=null,this.performSync()},this.debounceMs)}async performSync(){if(!this.isSyncing){this.isSyncing=!0;try{this.uiStateManager.addEvent({message:"Building manifest",status:"info"}),this.uiStateManager.updateManifestState({manifestStatus:"building"});const a=await Qr(this.appPath);if(a.errors.length>0||!a.manifest){for(const _ of a.errors)this.uiStateManager.addEvent({message:_,status:"error"});this.uiStateManager.updateManifestState({manifestStatus:"error",error:a.errors[a.errors.length-1]});return}const i=M0(a.manifest);if(!i.isValid){for(const _ of i.errors)this.uiStateManager.addEvent({message:_,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:_});return}if(this.uiStateManager.updateManifestState({appName:a.manifest.application.displayName}),this.uiStateManager.updateAllFilesTypes({manifestFilePaths:a.filePaths}),i.warnings.length>0)for(const _ of i.warnings)this.uiStateManager.addEvent({message:`⚠ ${_}`,status:"warning"});if(this.uiStateManager.addEvent({message:"Successfully built manifest",status:"success"}),await this.handleManifestBuilt(a),!this.fileUploader){const _=await this.apiService.checkApplicationExist(a.manifest.application.universalIdentifier);if(!_.success){this.uiStateManager.addEvent({message:`Failed to check if application ${a.manifest.application.universalIdentifier} already exists`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:"Failed to check if application already exists"});return}if(!_.data){this.uiStateManager.addEvent({message:"Creating application",status:"info"});const A=await this.apiService.createApplication(a.manifest);if(A.success)this.uiStateManager.addEvent({message:"Application created",status:"success"});else{this.uiStateManager.addEvent({message:`Application creation failed with error ${JSON.stringify(A.error,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:`Application creation failed with error ${JSON.stringify(A.error,null,2)}`});return}}this.fileUploader=new A0({appPath:this.appPath,applicationUniversalIdentifier:a.manifest.application.universalIdentifier});for(const[A,{fileFolder:I,sourcePath:P}]of this.builtFileInfos.entries())this.uploadFile(A,P,I)}for(;this.activeUploads.size>0;)await Promise.all(this.activeUploads);const f=w0({manifest:a.manifest,builtFileInfos:this.builtFileInfos});this.uiStateManager.addEvent({message:"Manifest checksums set",status:"info"}),await y0(this.appPath,f),this.uiStateManager.addEvent({message:"Manifest saved to output directory",status:"info"}),this.uiStateManager.addEvent({message:"Syncing manifest",status:"info"}),this.uiStateManager.updateManifestState({manifestStatus:"syncing"});const g=await this.apiService.syncApplication(f);this.uiStateManager.updateAllFilesStatus("success"),g.success?(this.uiStateManager.addEvent({message:"✓ Synced",status:"success"}),this.uiStateManager.updateManifestState({manifestStatus:"synced"})):(this.uiStateManager.addEvent({message:`Sync failed with error ${JSON.stringify(g.error,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error"}))}catch(a){this.uiStateManager.addEvent({message:`Sync failed with error ${JSON.stringify(a,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error"})}finally{this.isSyncing=!1}}}}const U0={pending:["building","uploading","success"],building:["pending","uploading","success"],uploading:["pending","success"],success:["pending","building","uploading"]};class W0{constructor({appPath:a,frontendUrl:i}){this.eventIdCounter=0,this.listeners=new Set,this.state={appPath:a,frontendUrl:i,appName:null,appDescription:null,appUniversalIdentifier:null,manifestStatus:"idle",entities:new Map,events:[]}}getSnapshot(){return this.state}subscribe(a){return this.listeners.add(a),a(this.getSnapshot()),()=>this.listeners.delete(a)}notify(){for(const a of this.listeners)a(this.state)}addEvent({message:a,status:i="info"}){const f={id:++this.eventIdCounter,timestamp:new Date,message:a.slice(0,5e3),status:i};this.state={...this.state,events:[...this.state.events.slice(-201),f]},this.notify()}updateManifestState({manifestStatus:a,appName:i,error:f}){this.state={...this.state,...a?{manifestStatus:a}:{},...i?{appName:i}:{},...f?{error:f.slice(0,5e3)}:{error:void 0}},this.notify()}convertEntityTypeToSyncableEntity(a){switch(a){case"objects":return ve.Object;case"fields":return ve.Field;case"logicFunctions":return ve.LogicFunction;case"frontComponents":return ve.FrontComponent;case"roles":return ve.Role;default:return}}updateAllFilesTypes({manifestFilePaths:a}){const i=new Map;Object.entries(a).forEach(([g,_])=>{_.forEach(S=>{const A=this.convertEntityTypeToSyncableEntity(g);A&&i.set(S,A)})});const f=new Map(this.state.entities);for(const[g,_]of f)f.set(g,{..._,type:i.get(g)});this.state={...this.state,entities:f},this.notify()}updateAllFilesStatus(a){const i=new Map(this.state.entities);for(const[f,g]of i)i.set(f,{...g,status:a});this.state={...this.state,entities:i},this.notify()}removeEntity(a){const i=new Map(this.state.entities);i.delete(a),this.state={...this.state,entities:i}}updateFileStatus(a,i){const f=new Map(this.state.entities),g=f.get(a);g?.status&&!U0[g.status].find(_=>_===i)||(f.set(a,g?{...g,status:i}:{name:a,path:a,status:i}),this.state={...this.state,entities:f},this.notify())}}const Es=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],fu=["↑","⇡","↟","⤒"],Jr={pending:"○",success:"✓"},Zn={pending:"gray",building:"yellow",uploading:"cyan",success:"green"},bu={[ve.Object]:"Objects",[ve.Field]:"Fields",[ve.LogicFunction]:"Logic functions",[ve.FrontComponent]:"Front components",[ve.Role]:"Roles"},Eu=Object.keys(bu),D0={info:"gray",success:"green",error:"red",warning:"yellow"},$0=c=>{const a=new Map;for(const i of Eu)a.set(i,[]);for(const i of c.values()){if(!i.type)continue;const f=a.get(i.type)??[];f.push(i),a.set(i.type,f)}return a},B0=c=>c.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),k0=(c,a=40)=>{if(c.length<=a)return c;const i=c.split("/");return i.length<=2?c:`.../${i.slice(-2).join("/")}`},j0=c=>!c.frontendUrl||!c.appUniversalIdentifier?null:`${c.frontendUrl}/settings/applications`,q0=async c=>{const[a,i]=await Promise.all([import("react"),import("ink")]),{useState:f,useEffect:g}=a,{render:_,Box:S,Text:A,Static:I}=i,P=(F,Z=80)=>{const[z,se]=f(0);return g(()=>{const qe=setInterval(()=>{se(ne=>(ne+1)%F.length)},Z);return()=>clearInterval(qe)},[F.length,Z]),F[z]},J=({event:F})=>{const Z=D0[F.status],z=B0(F.timestamp);return W.jsxs(S,{children:[W.jsxs(A,{dimColor:!0,children:[z," "]}),W.jsx(A,{color:Z,children:F.message})]})},G=({status:F})=>{const Z=P(Es,200),z=P(fu,200),se={building:Z,uploading:z,pending:Jr.pending,success:Jr.success};return W.jsxs(A,{color:Zn[F],children:[se[F]," "]})},K=({entity:F})=>W.jsxs(S,{children:[W.jsx(G,{status:F.status}),W.jsx(A,{children:F.name}),F.path!==F.name&&W.jsxs(A,{dimColor:!0,children:[" (",k0(F.path),")"]})]}),k=({type:F,entities:Z})=>Z.length===0?null:W.jsxs(S,{flexDirection:"column",marginTop:1,children:[W.jsx(A,{bold:!0,dimColor:!0,children:bu[F]}),Z.map(z=>W.jsx(K,{entity:z},z.path))]}),ue={synced:{color:"green",icon:"✓",text:"Synced"},building:{color:"yellow",icon:"spinner",text:"Building..."},syncing:{color:"yellow",icon:"spinner",text:"Syncing..."},error:{color:"red",icon:null,text:"Error"},idle:{color:"gray",icon:null,text:"Idle"}},Oe=({snapshot:F})=>{const Z=P(Es,80),z=ue[F.manifestStatus],se=z.icon==="spinner"?Z:z.icon;return W.jsxs(A,{color:z.color,children:[se?`${se} `:"",z.text,F.error&&`: ${F.error}`]})},pe=({snapshot:F})=>{const Z=$0(F.entities),z=j0(F);return W.jsxs(S,{flexDirection:"column",borderStyle:"classic",borderColor:"gray",paddingX:1,children:[W.jsx(A,{bold:!0,color:"cyan",children:"Application"}),W.jsxs(S,{marginLeft:2,flexDirection:"column",children:[W.jsxs(S,{children:[W.jsx(A,{dimColor:!0,children:"Name: "}),W.jsx(A,{bold:!0,children:F.appName??"Loading..."})]}),F.appDescription&&W.jsxs(S,{children:[W.jsx(A,{dimColor:!0,children:"Description: "}),W.jsx(A,{children:F.appDescription})]}),W.jsxs(S,{children:[W.jsx(A,{dimColor:!0,children:"Status: "}),W.jsx(Oe,{snapshot:F})]}),z&&W.jsxs(S,{children:[W.jsx(A,{dimColor:!0,children:"Open:"}),W.jsxs(A,{bold:!0,color:"cyan",children:[" ",z]})]})]}),W.jsx(S,{marginLeft:2,flexDirection:"column",children:Eu.map(se=>{const qe=Z.get(se)??[];return W.jsx(k,{type:se,entities:qe},se)})})]})},Le=()=>W.jsx(S,{marginTop:1,children:W.jsxs(A,{dimColor:!0,children:[W.jsx(A,{color:Zn.pending,children:Jr.pending})," ","pending ",W.jsx(A,{color:Zn.building,children:Es[0]})," ","building ",W.jsx(A,{color:Zn.uploading,children:fu[0]})," ","uploading"," ",W.jsx(A,{color:Zn.success,children:Jr.success})," ","success"]})}),Tt=()=>{const[F,Z]=f(c.getSnapshot());return g(()=>c.subscribe(Z),[]),W.jsxs(W.Fragment,{children:[W.jsx(I,{items:F.events,children:z=>W.jsx(J,{event:z},z.id)}),W.jsxs(S,{marginTop:1,flexDirection:"column",children:[W.jsx(pe,{snapshot:F}),W.jsx(Le,{})]})]})},{unmount:Te}=_(W.jsx(Tt,{}));return{unmount:Te}};class hu{constructor(a){this.watcher=null,this.appPath=a.appPath,this.fileFolder=a.fileFolder,this.watchPaths=a.watchPaths,this.handleFileBuilt=a.handleFileBuilt}async start(){const a=this.watchPaths.map(i=>ie.join(this.appPath,i));for(const i of a)if(!await V.pathExists(i))return;this.watcher=yu.default.watch(a,{awaitWriteFinish:{stabilityThreshold:100,pollInterval:50},usePolling:!0}),this.watcher.on("all",(i,f)=>{i!=="addDir"&&((i==="add"||i==="change")&&this.copyAndNotify(f),i==="unlink"&&this.handleUnlink(f))})}async close(){await this.watcher?.close()}async copyAndNotify(a){const i=ie.relative(this.appPath,a),f=ie.join(qt,i),g=ie.join(this.appPath,f);await V.ensureDir(ie.dirname(g)),await V.copy(a,g);const _=await V.readFile(g),S=_u.default.createHash("md5").update(_).digest("hex");this.handleFileBuilt({fileFolder:this.fileFolder,builtPath:f,sourcePath:i,checksum:S})}async handleUnlink(a){const i=ie.relative(this.appPath,a),f=ie.join(qt,i),g=ie.join(this.appPath,f);await V.remove(g)}}class G0{constructor(){this.appPath="",this.orchestrator=null,this.manifestWatcher=null,this.logicFunctionsWatcher=null,this.frontComponentsWatcher=null,this.assetWatcher=null,this.dependencyWatcher=null,this.watchersStarted=!1,this.uiStateManager=null,this.unmountUI=null}async close(){this.unmountUI?.(),await Promise.all([this.manifestWatcher?.close(),this.logicFunctionsWatcher?.close(),this.frontComponentsWatcher?.close(),this.assetWatcher?.close(),this.dependencyWatcher?.close()])}async execute(a){this.appPath=a.appPath??Et,await this.cleanOutputDir(),this.uiStateManager=new W0({appPath:this.appPath,frontendUrl:process.env.FRONTEND_URL});const{unmount:i}=await q0(this.uiStateManager);this.unmountUI=i,this.orchestrator=new N0({appPath:this.appPath,handleManifestBuilt:this.handleWatcherRestarts.bind(this),uiStateManager:this.uiStateManager}),await this.startManifestWatcher(),this.setupGracefulShutdown()}async cleanOutputDir(){const a=ee.default.join(this.appPath,qt);await V.ensureDir(a),await V.emptyDir(a)}async startManifestWatcher(){this.manifestWatcher=new _0({appPath:this.appPath,handleChangeDetected:this.orchestrator.handleChangeDetected.bind(this.orchestrator)}),await this.manifestWatcher.start()}async handleWatcherRestarts(a){const{logicFunctions:i,frontComponents:f}=a.filePaths;if(!this.watchersStarted){this.watchersStarted=!0,await this.startFileWatchers(i,f);return}this.logicFunctionsWatcher?.shouldRestart(i)&&await this.logicFunctionsWatcher.restart(i),this.frontComponentsWatcher?.shouldRestart(f)&&await this.frontComponentsWatcher.restart(f)}async startFileWatchers(a,i){await Promise.all([this.startLogicFunctionsWatcher(a),this.startFrontComponentsWatcher(i),this.startAssetWatcher(),this.startDependencyWatcher()])}async startLogicFunctionsWatcher(a){this.logicFunctionsWatcher=m0({appPath:this.appPath,sourcePaths:a,handleBuildError:this.orchestrator.handleFileBuildError.bind(this.orchestrator),handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.logicFunctionsWatcher.start()}async startFrontComponentsWatcher(a){this.frontComponentsWatcher=v0({appPath:this.appPath,sourcePaths:a,handleBuildError:this.orchestrator.handleFileBuildError.bind(this.orchestrator),handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.frontComponentsWatcher.start()}async startAssetWatcher(){this.assetWatcher=new hu({appPath:this.appPath,fileFolder:ft.N.PublicAsset,watchPaths:[Rs],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.assetWatcher.start()}async startDependencyWatcher(){this.dependencyWatcher=new hu({appPath:this.appPath,fileFolder:ft.N.Dependencies,watchPaths:["package.json","yarn.lock"],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),this.dependencyWatcher.start()}setupGracefulShutdown(){const a=()=>void this.close().then(()=>process.exit(0));process.on("SIGINT",a),process.on("SIGTERM",a)}}const H0="generated";class K0{constructor(){this.configService=new Ae,this.apiService=new Ct}async generate(a){const i=ie.join(a,H0);console.log(b.default.blue("📦 Generating Twenty client...")),console.log(b.default.gray(`📁 Output Path: ${i}`)),console.log("");const f=await this.configService.getConfig(),g=f.apiUrl,_=f.apiKey;if(!g||!_){console.log(b.default.yellow("⚠️ Skipping Client generation: API URL or token not configured"));return}console.log(b.default.gray(`API URL: ${g}`)),console.log(b.default.gray(`Output: ${i}`));const S=await this.apiService.getSchema();if(!S.success)return;const{data:A}=S,I=ie.resolve(i);await Cm.generate({schema:A,output:I,scalarTypes:{DateTime:"string",JSON:"Record<string, unknown>",UUID:"string"}}),await this.injectTwentyClient(I),console.log(b.default.green("✓ Client generated successfully!")),console.log(b.default.gray(`Generated files at: ${i}`))}async injectTwentyClient(a){const i=`
237
68
 
238
69
  // ----------------------------------------------------
239
70
  // ✨ Custom Twenty client (auto-injected)
240
71
  // ----------------------------------------------------
241
72
 
242
73
  const defaultOptions: ClientOptions = {
243
- url: \`\${process.env.${vv}}/graphql\`,
74
+ url: \`\${process.env.${h0}}/graphql\`,
244
75
  headers: {
245
76
  'Content-Type': 'application/json',
246
- Authorization: \`Bearer \${process.env.${yv}}\`,
77
+ Authorization: \`Bearer \${process.env.${f0}}\`,
247
78
  },
248
79
  }
249
80
 
@@ -311,8 +142,8 @@ export default class Twenty {
311
142
  }
312
143
  }
313
144
 
314
- `;await de.appendFile(ge.join(r,"index.ts"),i)}}class Ax{constructor(){this.clientService=new Sx}async execute(r=Xt){try{await this.clientService.generate(r)}catch(i){throw console.error(R.default.red("Generate Twenty client failed:"),i instanceof Error?i.message:i),i}}}class Ix{constructor(){this.apiService=new en}async execute({appPath:r=Xt,askForConfirmation:i}){try{console.log(R.default.blue("🚀 Uninstall Twenty Application")),console.log(R.default.gray(`📁 App Path: ${r}`)),console.log(""),i&&!await this.confirmationPrompt()&&(console.error(R.default.red("⛔️ Aborting uninstall")),process.exit(1));const{manifest:o}=await Kr(r);if(!o)return{success:!1,error:"Build failed"};const u=await this.apiService.uninstallApplication(o.application.universalIdentifier);return u.success===!1?console.error(R.default.red("❌ Uninstall failed:"),u.error):console.log(R.default.green("✅ Application uninstalled successfully")),u}catch(o){throw console.error(R.default.red("Uninstall failed:"),o instanceof Error?o.message:o),o}}async confirmationPrompt(){const{confirmation:r}=await Qt.default.prompt([{type:"confirm",name:"confirmation",message:"Are you sure you want to uninstall this application?",default:!1}]);return r}}class bx{constructor(){this.configService=new je}async execute(){try{const r=await this.configService.getAvailableWorkspaces(),i=await this.configService.getDefaultWorkspace();if(r.length===0){console.log(R.default.yellow("⚠ No workspaces configured. Use `twenty auth:login` to create one."));return}console.log(R.default.blue(`Available workspaces:
315
- `));for(const o of r){const u=await this.configService.getConfigForWorkspace(o),f=!!u.apiKey,v=o===i?R.default.green(" (default)"):"",w=f?R.default.green("●"):R.default.gray("○");console.log(` ${w} ${o}${v}`),console.log(R.default.gray(` API URL: ${u.apiUrl}`))}console.log(""),console.log(R.default.gray("● = authenticated, ○ = no credentials")),console.log(R.default.gray("Use `twenty auth:switch <workspace>` to change default"))}catch(r){console.error(R.default.red("List failed:"),r instanceof Error?r.message:r),process.exit(1)}}}class Nx{constructor(){this.configService=new je,this.apiService=new en}async execute(r){try{let{apiKey:i,apiUrl:o}=r;const u=await this.configService.getConfig();if(o||(o=(await Qt.default.prompt([{type:"input",name:"apiUrl",message:"Twenty API URL:",default:u.apiUrl,validate:v=>{try{return new URL(v),!0}catch{return"Please enter a valid URL"}}}])).apiUrl),i||(i=(await Qt.default.prompt([{type:"password",name:"apiKey",message:"API Key:",mask:"*",validate:v=>v.length>0||"API key is required"}])).apiKey),await this.configService.setConfig({apiUrl:o,apiKey:i}),(await this.apiService.validateAuth()).authValid){const h=je.getActiveWorkspace();console.log(R.default.green(`✓ Successfully authenticated with Twenty (workspace: ${h})`))}else console.log(R.default.red("✗ Authentication failed. Please check your credentials.")),process.exit(1)}catch(i){console.error(R.default.red("Login failed:"),i instanceof Error?i.message:i),process.exit(1)}}}class Ox{constructor(){this.configService=new je}async execute(){try{await this.configService.clearConfig();const r=je.getActiveWorkspace();console.log(R.default.green(`✓ Successfully logged out (workspace: ${r})`))}catch(r){console.error(R.default.red("Logout failed:"),r instanceof Error?r.message:r),process.exit(1)}}}class Rx{constructor(){this.configService=new je,this.apiService=new en}async execute(){try{const r=je.getActiveWorkspace(),i=await this.configService.getConfig();if(console.log(R.default.blue("Authentication Status:")),console.log(`Workspace: ${r}`),console.log(`API URL: ${i.apiUrl}`),console.log(`API Key: ${i.apiKey?"***"+i.apiKey.slice(-4):"Not set"}`),i.apiKey){const o=await this.apiService.validateAuth();console.log(`Status: ${o.authValid?R.default.green("✓ Valid"):R.default.red("✗ Invalid")}`)}else console.log(`Status: ${R.default.yellow("⚠ Not authenticated")}`)}catch(r){console.error(R.default.red("Status check failed:"),r instanceof Error?r.message:r),process.exit(1)}}}class Cx{constructor(){this.apiService=new en}async execute({appPath:r=Xt,functionUniversalIdentifier:i,functionName:o,payload:u="{}"}){try{let f;try{f=JSON.parse(u)}catch{console.error(R.default.red("Invalid JSON payload. Please provide valid JSON.")),process.exit(1)}const{manifest:h}=await Kr(r);h||(console.error(R.default.red("Failed to build manifest.")),process.exit(1));const v=await this.apiService.findLogicFunctions();v.success||(console.error(R.default.red("Failed to fetch functions:"),v.error instanceof Error?v.error.message:v.error),process.exit(1));const w=v.data.filter(M=>M.universalIdentifier&&this.belongsToApplication(M,h)),I=w.find(M=>i?M.universalIdentifier===i:o?M.name===o:!1);if(!I){const M=i||o;console.error(R.default.red(`Function "${M}" not found in application.`)),console.log(""),w.length>0?(console.log(R.default.cyan("Available functions:")),w.forEach($=>{console.log(` - ${R.default.white($.name)} (${$.universalIdentifier})`)})):console.log(R.default.yellow("No functions found for this application. Have you synced your app with `yarn app:sync`?")),process.exit(1)}console.log(R.default.blue(`🚀 Executing function "${I.name}"...`)),console.log(R.default.gray(` Payload: ${JSON.stringify(f)}`)),console.log("");const O=await this.apiService.executeLogicFunction({functionId:I.id,payload:f});O.success||(console.error(R.default.red("Execution failed:"),O.error instanceof Error?O.error.message:O.error),process.exit(1));const D=O.data;console.log(R.default.cyan("─".repeat(60))),console.log(R.default.cyan("Execution Result")),console.log(R.default.cyan("─".repeat(60)));const P=D.status==="SUCCESS"?R.default.green:R.default.red;console.log(`${R.default.bold("Status:")} ${P(D.status)}`),console.log(`${R.default.bold("Duration:")} ${D.duration}ms`),st.Tr(D.data)&&(console.log(""),console.log(R.default.bold("Data:")),console.log(R.default.white(JSON.stringify(D.data,null,2)))),D.error&&(console.log(""),console.log(R.default.bold.red("Error:")),console.log(R.default.red(` Type: ${D.error.errorType}`)),console.log(R.default.red(` Message: ${D.error.errorMessage}`)),D.error.stackTrace&&(console.log(""),console.log(R.default.gray("Stack trace:")),console.log(R.default.gray(D.error.stackTrace)))),D.logs&&(console.log(""),console.log(R.default.bold("Logs:")),console.log(R.default.gray(D.logs))),console.log(R.default.cyan("─".repeat(60))),D.status!=="SUCCESS"&&process.exit(1)}catch(f){console.error(R.default.red("Execution failed:"),f instanceof Error?f.message:f),process.exit(1)}}belongsToApplication(r,i){return i.logicFunctions.some(o=>o.universalIdentifier===r.universalIdentifier)}}class Lx{constructor(){this.apiService=new en}async execute({appPath:r=Xt,functionUniversalIdentifier:i,functionName:o}){try{const{manifest:u}=await Kr(r);u||process.exit(1),this.logWatchInfo({appName:u.application.displayName,functionUniversalIdentifier:i,functionName:o}),await this.apiService.subscribeToLogs({applicationUniversalIdentifier:u.application.universalIdentifier,functionUniversalIdentifier:i,functionName:o})}catch(u){console.error(R.default.red("Watch logs failed:"),u instanceof Error?u.message:u),process.exit(1)}}logWatchInfo({appName:r,functionUniversalIdentifier:i,functionName:o}){const u=r??"Twenty Application",f=i||o?`function "${i||o}"`:"functions";console.log(R.default.blue(`🚀 Watching ${u} ${f} logs:`)),console.log("")}}class Fx{constructor(){this.configService=new je,this.apiService=new en}async execute(r){try{let{workspace:i}=r;const o=await this.configService.getAvailableWorkspaces(),u=await this.configService.getDefaultWorkspace();if(o.length===0){console.log(R.default.yellow("⚠ No workspaces configured. Use `twenty auth:login` to create one."));return}if(!i){const v=o.map(I=>({name:I===u?`${I} (current default)`:I,value:I}));i=(await Qt.default.prompt([{type:"list",name:"workspace",message:"Select a workspace to set as default:",choices:v,default:u}])).workspace}if(o.includes(i)||(console.log(R.default.red(`✗ Workspace "${i}" not found. Available workspaces: ${o.join(", ")}`)),process.exit(1)),i===u){console.log(R.default.blue(`ℹ "${i}" is already the default workspace.`));return}await this.configService.setDefaultWorkspace(i),je.setActiveWorkspace(i);const h=!!(await this.configService.getConfig()).apiKey;console.log(R.default.green(`✓ Switched default workspace to "${i}"`)),h?(await this.apiService.validateAuth()).authValid?console.log(R.default.green("✓ Authentication is valid")):console.log(R.default.yellow("⚠ Authentication credentials exist but are invalid. Run `twenty auth:login` to re-authenticate.")):console.log(R.default.yellow("⚠ No credentials configured for this workspace. Run `twenty auth:login` to authenticate."))}catch(i){console.error(R.default.red("Switch failed:"),i instanceof Error?i.message:i),process.exit(1)}}}var Na,Fc;function Dx(){if(Fc)return Na;Fc=1;var n="[object Symbol]",r=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o="\\ud800-\\udfff",u="\\u0300-\\u036f\\ufe20-\\ufe23",f="\\u20d0-\\u20f0",h="\\u2700-\\u27bf",v="a-z\\xdf-\\xf6\\xf8-\\xff",w="\\xac\\xb1\\xd7\\xf7",I="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",O="\\u2000-\\u206f",D=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",P="A-Z\\xc0-\\xd6\\xd8-\\xde",M="\\ufe0e\\ufe0f",$=w+I+O+D,he="['’]",ae="["+$+"]",me="["+u+f+"]",Ye="\\d+",Te="["+h+"]",L="["+v+"]",ee="[^"+o+$+Ye+h+v+P+"]",Q="\\ud83c[\\udffb-\\udfff]",ce="(?:"+me+"|"+Q+")",qe="[^"+o+"]",x="(?:\\ud83c[\\udde6-\\uddff]){2}",q="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="["+P+"]",Tt="\\u200d",tn="(?:"+L+"|"+ee+")",Vi="(?:"+Se+"|"+ee+")",qi="(?:"+he+"(?:d|ll|m|re|s|t|ve))?",Ji="(?:"+he+"(?:D|LL|M|RE|S|T|VE))?",Ct=ce+"?",wt="["+M+"]?",Zr="(?:"+Tt+"(?:"+[qe,x,q].join("|")+")"+wt+Ct+")*",Wn=wt+Ct+Zr,at="(?:"+[Te,x,q].join("|")+")"+Wn,es=RegExp(he,"g"),ts=RegExp(me,"g"),ns=RegExp([Se+"?"+L+"+"+qi+"(?="+[ae,Se,"$"].join("|")+")",Vi+"+"+Ji+"(?="+[ae,Se+tn,"$"].join("|")+")",Se+"?"+tn+"+"+qi,Se+"+"+Ji,Ye,at].join("|"),"g"),nn=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gn={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"ss"},is=typeof B.commonjsGlobal=="object"&&B.commonjsGlobal&&B.commonjsGlobal.Object===Object&&B.commonjsGlobal,Sn=typeof self=="object"&&self&&self.Object===Object&&self,An=is||Sn||Function("return this")();function rs(W,Ce,Lt,Qi){for(var On=-1,vi=W?W.length:0;++On<vi;)Lt=Ce(Lt,W[On],On,W);return Lt}function Vn(W){return W.match(r)||[]}function qn(W){return function(Ce){return W?.[Ce]}}var zi=qn(Gn);function Xe(W){return nn.test(W)}function In(W){return W.match(ns)||[]}var ss=Object.prototype,Et=ss.toString,yi=An.Symbol,Hi=yi?yi.prototype:void 0,rn=Hi?Hi.toString:void 0;function Ke(W){if(typeof W=="string")return W;if(as(W))return rn?rn.call(W):"";var Ce=W+"";return Ce=="0"&&1/W==-1/0?"-0":Ce}function bn(W){return function(Ce){return rs(an(os(Ce).replace(es,"")),W,"")}}function Jn(W){return!!W&&typeof W=="object"}function as(W){return typeof W=="symbol"||Jn(W)&&Et.call(W)==n}function sn(W){return W==null?"":Ke(W)}function os(W){return W=sn(W),W&&W.replace(i,zi).replace(ts,"")}var Nn=bn(function(W,Ce,Lt){return W+(Lt?"-":"")+Ce.toLowerCase()});function an(W,Ce,Lt){return W=sn(W),Ce=Ce,Ce===void 0?Xe(W)?In(W):Vn(W):W.match(Ce)||[]}return Na=Nn,Na}var Px=Dx();const fi=B.getDefaultExportFromCjs(Px),kx=({name:n,universalIdentifier:r=Bi.v4()})=>{const i=fi(n);return`import { defineFrontComponent } from 'twenty-sdk';
145
+ `;await V.appendFile(ie.join(a,"index.ts"),i)}}class z0{constructor(){this.clientService=new K0}async execute(a=Et){try{await this.clientService.generate(a)}catch(i){throw console.error(b.default.red("Generate Twenty client failed:"),i instanceof Error?i.message:i),i}}}class J0{constructor(){this.apiService=new Ct}async execute({appPath:a=Et,askForConfirmation:i}){try{console.log(b.default.blue("🚀 Uninstall Twenty Application")),console.log(b.default.gray(`📁 App Path: ${a}`)),console.log(""),i&&!await this.confirmationPrompt()&&(console.error(b.default.red("⛔️ Aborting uninstall")),process.exit(1));const{manifest:f}=await Qr(a);if(!f)return{success:!1,error:"Build failed"};const g=await this.apiService.uninstallApplication(f.application.universalIdentifier);return g.success===!1?console.error(b.default.red("❌ Uninstall failed:"),g.error):console.log(b.default.green("✅ Application uninstalled successfully")),g}catch(f){throw console.error(b.default.red("Uninstall failed:"),f instanceof Error?f.message:f),f}}async confirmationPrompt(){const{confirmation:a}=await At.default.prompt([{type:"confirm",name:"confirmation",message:"Are you sure you want to uninstall this application?",default:!1}]);return a}}class Y0{constructor(){this.configService=new Ae}async execute(){try{const a=await this.configService.getAvailableWorkspaces(),i=await this.configService.getDefaultWorkspace();if(a.length===0){console.log(b.default.yellow("⚠ No workspaces configured. Use `twenty auth:login` to create one."));return}console.log(b.default.blue(`Available workspaces:
146
+ `));for(const f of a){const g=await this.configService.getConfigForWorkspace(f),_=!!g.apiKey,A=f===i?b.default.green(" (default)"):"",I=_?b.default.green("●"):b.default.gray("○");console.log(` ${I} ${f}${A}`),console.log(b.default.gray(` API URL: ${g.apiUrl}`))}console.log(""),console.log(b.default.gray("● = authenticated, ○ = no credentials")),console.log(b.default.gray("Use `twenty auth:switch <workspace>` to change default"))}catch(a){console.error(b.default.red("List failed:"),a instanceof Error?a.message:a),process.exit(1)}}}class Z0{constructor(){this.configService=new Ae,this.apiService=new Ct}async execute(a){try{let{apiKey:i,apiUrl:f}=a;const g=await this.configService.getConfig();if(f||(f=(await At.default.prompt([{type:"input",name:"apiUrl",message:"Twenty API URL:",default:g.apiUrl,validate:A=>{try{return new URL(A),!0}catch{return"Please enter a valid URL"}}}])).apiUrl),i||(i=(await At.default.prompt([{type:"password",name:"apiKey",message:"API Key:",mask:"*",validate:A=>A.length>0||"API key is required"}])).apiKey),await this.configService.setConfig({apiUrl:f,apiKey:i}),(await this.apiService.validateAuth()).authValid){const S=Ae.getActiveWorkspace();console.log(b.default.green(`✓ Successfully authenticated with Twenty (workspace: ${S})`))}else console.log(b.default.red("✗ Authentication failed. Please check your credentials.")),process.exit(1)}catch(i){console.error(b.default.red("Login failed:"),i instanceof Error?i.message:i),process.exit(1)}}}class X0{constructor(){this.configService=new Ae}async execute(){try{await this.configService.clearConfig();const a=Ae.getActiveWorkspace();console.log(b.default.green(`✓ Successfully logged out (workspace: ${a})`))}catch(a){console.error(b.default.red("Logout failed:"),a instanceof Error?a.message:a),process.exit(1)}}}class Q0{constructor(){this.configService=new Ae,this.apiService=new Ct}async execute(){try{const a=Ae.getActiveWorkspace(),i=await this.configService.getConfig();if(console.log(b.default.blue("Authentication Status:")),console.log(`Workspace: ${a}`),console.log(`API URL: ${i.apiUrl}`),console.log(`API Key: ${i.apiKey?"***"+i.apiKey.slice(-4):"Not set"}`),i.apiKey){const f=await this.apiService.validateAuth();console.log(`Status: ${f.authValid?b.default.green("✓ Valid"):b.default.red("✗ Invalid")}`)}else console.log(`Status: ${b.default.yellow("⚠ Not authenticated")}`)}catch(a){console.error(b.default.red("Status check failed:"),a instanceof Error?a.message:a),process.exit(1)}}}class V0{constructor(){this.apiService=new Ct}async execute({appPath:a=Et,functionUniversalIdentifier:i,functionName:f,payload:g="{}"}){try{let _;try{_=JSON.parse(g)}catch{console.error(b.default.red("Invalid JSON payload. Please provide valid JSON.")),process.exit(1)}const{manifest:S}=await Qr(a);S||(console.error(b.default.red("Failed to build manifest.")),process.exit(1));const A=await this.apiService.findLogicFunctions();A.success||(console.error(b.default.red("Failed to fetch functions:"),A.error instanceof Error?A.error.message:A.error),process.exit(1));const I=A.data.filter(k=>k.universalIdentifier&&this.belongsToApplication(k,S)),P=I.find(k=>i?k.universalIdentifier===i:f?k.name===f:!1);if(!P){const k=i||f;console.error(b.default.red(`Function "${k}" not found in application.`)),console.log(""),I.length>0?(console.log(b.default.cyan("Available functions:")),I.forEach(ue=>{console.log(` - ${b.default.white(ue.name)} (${ue.universalIdentifier})`)})):console.log(b.default.yellow("No functions found for this application. Have you synced your app with `yarn app:dev`?")),process.exit(1)}console.log(b.default.blue(`🚀 Executing function "${P.name}"...`)),console.log(b.default.gray(` Payload: ${JSON.stringify(_)}`)),console.log("");const J=await this.apiService.executeLogicFunction({functionId:P.id,payload:_});J.success||(console.error(b.default.red("Execution failed:"),J.error instanceof Error?J.error.message:J.error),process.exit(1));const G=J.data;console.log(b.default.cyan("─".repeat(60))),console.log(b.default.cyan("Execution Result")),console.log(b.default.cyan("─".repeat(60)));const K=G.status==="SUCCESS"?b.default.green:b.default.red;console.log(`${b.default.bold("Status:")} ${K(G.status)}`),console.log(`${b.default.bold("Duration:")} ${G.duration}ms`),je.Tr(G.data)&&(console.log(""),console.log(b.default.bold("Data:")),console.log(b.default.white(JSON.stringify(G.data,null,2)))),G.error&&(console.log(""),console.log(b.default.bold.red("Error:")),console.log(b.default.red(` Type: ${G.error.errorType}`)),console.log(b.default.red(` Message: ${G.error.errorMessage}`)),G.error.stackTrace&&(console.log(""),console.log(b.default.gray("Stack trace:")),console.log(b.default.gray(G.error.stackTrace)))),G.logs&&(console.log(""),console.log(b.default.bold("Logs:")),console.log(b.default.gray(G.logs))),console.log(b.default.cyan("─".repeat(60))),G.status!=="SUCCESS"&&process.exit(1)}catch(_){console.error(b.default.red("Execution failed:"),_ instanceof Error?_.message:_),process.exit(1)}}belongsToApplication(a,i){return i.logicFunctions.some(f=>f.universalIdentifier===a.universalIdentifier)}}class ev{constructor(){this.apiService=new Ct}async execute({appPath:a=Et,functionUniversalIdentifier:i,functionName:f}){try{const{manifest:g}=await Qr(a);g||process.exit(1),this.logWatchInfo({appName:g.application.displayName,functionUniversalIdentifier:i,functionName:f}),await this.apiService.subscribeToLogs({applicationUniversalIdentifier:g.application.universalIdentifier,functionUniversalIdentifier:i,functionName:f})}catch(g){console.error(b.default.red("Watch logs failed:"),g instanceof Error?g.message:g),process.exit(1)}}logWatchInfo({appName:a,functionUniversalIdentifier:i,functionName:f}){const g=a??"Twenty Application",_=i||f?`function "${i||f}"`:"functions";console.log(b.default.blue(`🚀 Watching ${g} ${_} logs:`)),console.log("")}}class tv{constructor(){this.configService=new Ae,this.apiService=new Ct}async execute(a){try{let{workspace:i}=a;const f=await this.configService.getAvailableWorkspaces(),g=await this.configService.getDefaultWorkspace();if(f.length===0){console.log(b.default.yellow("⚠ No workspaces configured. Use `twenty auth:login` to create one."));return}if(!i){const A=f.map(P=>({name:P===g?`${P} (current default)`:P,value:P}));i=(await At.default.prompt([{type:"list",name:"workspace",message:"Select a workspace to set as default:",choices:A,default:g}])).workspace}if(f.includes(i)||(console.log(b.default.red(`✗ Workspace "${i}" not found. Available workspaces: ${f.join(", ")}`)),process.exit(1)),i===g){console.log(b.default.blue(`ℹ "${i}" is already the default workspace.`));return}await this.configService.setDefaultWorkspace(i),Ae.setActiveWorkspace(i);const S=!!(await this.configService.getConfig()).apiKey;console.log(b.default.green(`✓ Switched default workspace to "${i}"`)),S?(await this.apiService.validateAuth()).authValid?console.log(b.default.green("✓ Authentication is valid")):console.log(b.default.yellow("⚠ Authentication credentials exist but are invalid. Run `twenty auth:login` to re-authenticate.")):console.log(b.default.yellow("⚠ No credentials configured for this workspace. Run `twenty auth:login` to authenticate."))}catch(i){console.error(b.default.red("Switch failed:"),i instanceof Error?i.message:i),process.exit(1)}}}var Cs,pu;function nv(){if(pu)return Cs;pu=1;var c="[object Symbol]",a=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,f="\\ud800-\\udfff",g="\\u0300-\\u036f\\ufe20-\\ufe23",_="\\u20d0-\\u20f0",S="\\u2700-\\u27bf",A="a-z\\xdf-\\xf6\\xf8-\\xff",I="\\xac\\xb1\\xd7\\xf7",P="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",J="\\u2000-\\u206f",G=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",K="A-Z\\xc0-\\xd6\\xd8-\\xde",k="\\ufe0e\\ufe0f",ue=I+P+J+G,Oe="['’]",pe="["+ue+"]",Le="["+g+_+"]",Tt="\\d+",Te="["+S+"]",F="["+A+"]",Z="[^"+f+ue+Tt+S+A+K+"]",z="\\ud83c[\\udffb-\\udfff]",se="(?:"+Le+"|"+z+")",qe="[^"+f+"]",ne="(?:\\ud83c[\\udde6-\\uddff]){2}",Ht="[\\ud800-\\udbff][\\udc00-\\udfff]",Ge="["+K+"]",ht="\\u200d",Ft="(?:"+F+"|"+Z+")",Vn="(?:"+Ge+"|"+Z+")",er="(?:"+Oe+"(?:d|ll|m|re|s|t|ve))?",tr="(?:"+Oe+"(?:D|LL|M|RE|S|T|VE))?",at=se+"?",et="["+k+"]?",Vr="(?:"+ht+"(?:"+[qe,ne,Ht].join("|")+")"+et+at+")*",un=et+at+Vr,He="(?:"+[Te,ne,Ht].join("|")+")"+un,ei=RegExp(Oe,"g"),ti=RegExp(Le,"g"),ni=RegExp([Ge+"?"+F+"+"+er+"(?="+[pe,Ge,"$"].join("|")+")",Vn+"+"+tr+"(?="+[pe,Ge+Ft,"$"].join("|")+")",Ge+"?"+Ft+"+"+er,Ge+"+"+tr,Tt,He].join("|"),"g"),It=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,cn={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"ss"},ri=typeof bt.commonjsGlobal=="object"&&bt.commonjsGlobal&&bt.commonjsGlobal.Object===Object&&bt.commonjsGlobal,Kt=typeof self=="object"&&self&&self.Object===Object&&self,zt=ri||Kt||Function("return this")();function ii(O,de,ot,ir){for(var Xt=-1,Ln=O?O.length:0;++Xt<Ln;)ot=de(ot,O[Xt],Xt,O);return ot}function ln(O){return O.match(a)||[]}function fn(O){return function(de){return O?.[de]}}var nr=fn(cn);function Me(O){return It.test(O)}function Jt(O){return O.match(ni)||[]}var si=Object.prototype,tt=si.toString,On=zt.Symbol,rr=On?On.prototype:void 0,Rt=rr?rr.toString:void 0;function Ne(O){if(typeof O=="string")return O;if(ai(O))return Rt?Rt.call(O):"";var de=O+"";return de=="0"&&1/O==-1/0?"-0":de}function Yt(O){return function(de){return ii(Ot(oi(de).replace(ei,"")),O,"")}}function hn(O){return!!O&&typeof O=="object"}function ai(O){return typeof O=="symbol"||hn(O)&&tt.call(O)==c}function Pt(O){return O==null?"":Ne(O)}function oi(O){return O=Pt(O),O&&O.replace(i,nr).replace(ti,"")}var Zt=Yt(function(O,de,ot){return O+(ot?"-":"")+de.toLowerCase()});function Ot(O,de,ot){return O=Pt(O),de=de,de===void 0?Me(O)?Jt(O):ln(O):O.match(de)||[]}return Cs=Zt,Cs}var rv=nv();const In=bt.getDefaultExportFromCjs(rv),iv=({name:c,universalIdentifier:a=Qn.v4()})=>{const i=In(c);return`import { defineFrontComponent } from 'twenty-sdk';
316
147
 
317
148
  // React component - implement your UI here
318
149
  const Component = () => {
@@ -325,12 +156,12 @@ const Component = () => {
325
156
  };
326
157
 
327
158
  export default defineFrontComponent({
328
- universalIdentifier: '${r}',
159
+ universalIdentifier: '${a}',
329
160
  name: '${i}',
330
161
  description: 'Add a description for your front component',
331
162
  component: Component,
332
163
  });
333
- `},Ux=({name:n,universalIdentifier:r=Bi.v4()})=>{const i=fi(n);return`import { defineLogicFunction } from 'twenty-sdk';
164
+ `},sv=({name:c,universalIdentifier:a=Qn.v4()})=>{const i=In(c);return`import { defineLogicFunction } from 'twenty-sdk';
334
165
 
335
166
  // Logic function handler - rename and implement your logic
336
167
  const handler = async (params: {
@@ -346,7 +177,7 @@ const handler = async (params: {
346
177
  };
347
178
 
348
179
  export default defineLogicFunction({
349
- universalIdentifier: '${r}',
180
+ universalIdentifier: '${a}',
350
181
  name: '${i}',
351
182
  description: 'Add a description for your logic function',
352
183
  timeoutSeconds: 5,
@@ -368,40 +199,40 @@ export default defineLogicFunction({
368
199
  // },
369
200
  ],
370
201
  });
371
- `};var Mi={exports:{}};/**
202
+ `};var Xn={exports:{}};/**
372
203
  * @license
373
204
  * Lodash <https://lodash.com/>
374
205
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
375
206
  * Released under MIT license <https://lodash.com/license>
376
207
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
377
208
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
378
- */var Mx=Mi.exports,Dc;function $x(){return Dc||(Dc=1,function(n,r){(function(){var i,o="4.17.21",u=200,f="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",h="Expected a function",v="Invalid `variable` option passed into `_.template`",w="__lodash_hash_undefined__",I=500,O="__lodash_placeholder__",D=1,P=2,M=4,$=1,he=2,ae=1,me=2,Ye=4,Te=8,L=16,ee=32,Q=64,ce=128,qe=256,x=512,q=30,Se="...",Tt=800,tn=16,Vi=1,qi=2,Ji=3,Ct=1/0,wt=9007199254740991,Zr=17976931348623157e292,Wn=NaN,at=4294967295,es=at-1,ts=at>>>1,ns=[["ary",ce],["bind",ae],["bindKey",me],["curry",Te],["curryRight",L],["flip",x],["partial",ee],["partialRight",Q],["rearg",qe]],nn="[object Arguments]",Gn="[object Array]",is="[object AsyncFunction]",Sn="[object Boolean]",An="[object Date]",rs="[object DOMException]",Vn="[object Error]",qn="[object Function]",zi="[object GeneratorFunction]",Xe="[object Map]",In="[object Number]",ss="[object Null]",Et="[object Object]",yi="[object Promise]",Hi="[object Proxy]",rn="[object RegExp]",Ke="[object Set]",bn="[object String]",Jn="[object Symbol]",as="[object Undefined]",sn="[object WeakMap]",os="[object WeakSet]",Nn="[object ArrayBuffer]",an="[object DataView]",W="[object Float32Array]",Ce="[object Float64Array]",Lt="[object Int8Array]",Qi="[object Int16Array]",On="[object Int32Array]",vi="[object Uint8Array]",us="[object Uint8ClampedArray]",cs="[object Uint16Array]",ls="[object Uint32Array]",Ll=/\b__p \+= '';/g,Fl=/\b(__p \+=) '' \+/g,Dl=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Wa=/&(?:amp|lt|gt|quot|#39);/g,Ga=/[&<>"']/g,Pl=RegExp(Wa.source),kl=RegExp(Ga.source),Ul=/<%-([\s\S]+?)%>/g,Ml=/<%([\s\S]+?)%>/g,Va=/<%=([\s\S]+?)%>/g,$l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Bl=/^\w*$/,jl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fs=/[\\^$.*+?()[\]{}|]/g,Wl=RegExp(fs.source),ps=/^\s+/,Gl=/\s/,Vl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ql=/\{\n\/\* \[wrapped with (.+)\] \*/,Jl=/,? & /,zl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Hl=/[()=,{}\[\]\/\s]/,Ql=/\\(\\)?/g,Yl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,qa=/\w*$/,Xl=/^[-+]0x[0-9a-f]+$/i,Kl=/^0b[01]+$/i,Zl=/^\[object .+?Constructor\]$/,ef=/^0o[0-7]+$/i,tf=/^(?:0|[1-9]\d*)$/,nf=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Yi=/($^)/,rf=/['\n\r\u2028\u2029\\]/g,Xi="\\ud800-\\udfff",sf="\\u0300-\\u036f",af="\\ufe20-\\ufe2f",of="\\u20d0-\\u20ff",Ja=sf+af+of,za="\\u2700-\\u27bf",Ha="a-z\\xdf-\\xf6\\xf8-\\xff",uf="\\xac\\xb1\\xd7\\xf7",cf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",lf="\\u2000-\\u206f",ff=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Qa="A-Z\\xc0-\\xd6\\xd8-\\xde",Ya="\\ufe0e\\ufe0f",Xa=uf+cf+lf+ff,ds="['’]",pf="["+Xi+"]",Ka="["+Xa+"]",Ki="["+Ja+"]",Za="\\d+",df="["+za+"]",eo="["+Ha+"]",to="[^"+Xi+Xa+Za+za+Ha+Qa+"]",hs="\\ud83c[\\udffb-\\udfff]",hf="(?:"+Ki+"|"+hs+")",no="[^"+Xi+"]",gs="(?:\\ud83c[\\udde6-\\uddff]){2}",ms="[\\ud800-\\udbff][\\udc00-\\udfff]",zn="["+Qa+"]",io="\\u200d",ro="(?:"+eo+"|"+to+")",gf="(?:"+zn+"|"+to+")",so="(?:"+ds+"(?:d|ll|m|re|s|t|ve))?",ao="(?:"+ds+"(?:D|LL|M|RE|S|T|VE))?",oo=hf+"?",uo="["+Ya+"]?",mf="(?:"+io+"(?:"+[no,gs,ms].join("|")+")"+uo+oo+")*",yf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",co=uo+oo+mf,_f="(?:"+[df,gs,ms].join("|")+")"+co,xf="(?:"+[no+Ki+"?",Ki,gs,ms,pf].join("|")+")",Tf=RegExp(ds,"g"),wf=RegExp(Ki,"g"),ys=RegExp(hs+"(?="+hs+")|"+xf+co,"g"),Ef=RegExp([zn+"?"+eo+"+"+so+"(?="+[Ka,zn,"$"].join("|")+")",gf+"+"+ao+"(?="+[Ka,zn+ro,"$"].join("|")+")",zn+"?"+ro+"+"+so,zn+"+"+ao,vf,yf,Za,_f].join("|"),"g"),Sf=RegExp("["+io+Xi+Ja+Ya+"]"),Af=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,If=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],bf=-1,we={};we[W]=we[Ce]=we[Lt]=we[Qi]=we[On]=we[vi]=we[us]=we[cs]=we[ls]=!0,we[nn]=we[Gn]=we[Nn]=we[Sn]=we[an]=we[An]=we[Vn]=we[qn]=we[Xe]=we[In]=we[Et]=we[rn]=we[Ke]=we[bn]=we[sn]=!1;var _e={};_e[nn]=_e[Gn]=_e[Nn]=_e[an]=_e[Sn]=_e[An]=_e[W]=_e[Ce]=_e[Lt]=_e[Qi]=_e[On]=_e[Xe]=_e[In]=_e[Et]=_e[rn]=_e[Ke]=_e[bn]=_e[Jn]=_e[vi]=_e[us]=_e[cs]=_e[ls]=!0,_e[Vn]=_e[qn]=_e[sn]=!1;var Nf={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Of={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Rf={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Cf={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Lf=parseFloat,Ff=parseInt,lo=typeof B.commonjsGlobal=="object"&&B.commonjsGlobal&&B.commonjsGlobal.Object===Object&&B.commonjsGlobal,Df=typeof self=="object"&&self&&self.Object===Object&&self,Ue=lo||Df||Function("return this")(),vs=r&&!r.nodeType&&r,Rn=vs&&!0&&n&&!n.nodeType&&n,fo=Rn&&Rn.exports===vs,_s=fo&&lo.process,ot=function(){try{var m=Rn&&Rn.require&&Rn.require("util").types;return m||_s&&_s.binding&&_s.binding("util")}catch{}}(),po=ot&&ot.isArrayBuffer,ho=ot&&ot.isDate,go=ot&&ot.isMap,mo=ot&&ot.isRegExp,yo=ot&&ot.isSet,vo=ot&&ot.isTypedArray;function Ze(m,T,_){switch(_.length){case 0:return m.call(T);case 1:return m.call(T,_[0]);case 2:return m.call(T,_[0],_[1]);case 3:return m.call(T,_[0],_[1],_[2])}return m.apply(T,_)}function Pf(m,T,_,F){for(var z=-1,oe=m==null?0:m.length;++z<oe;){var Le=m[z];T(F,Le,_(Le),m)}return F}function ut(m,T){for(var _=-1,F=m==null?0:m.length;++_<F&&T(m[_],_,m)!==!1;);return m}function kf(m,T){for(var _=m==null?0:m.length;_--&&T(m[_],_,m)!==!1;);return m}function _o(m,T){for(var _=-1,F=m==null?0:m.length;++_<F;)if(!T(m[_],_,m))return!1;return!0}function on(m,T){for(var _=-1,F=m==null?0:m.length,z=0,oe=[];++_<F;){var Le=m[_];T(Le,_,m)&&(oe[z++]=Le)}return oe}function Zi(m,T){var _=m==null?0:m.length;return!!_&&Hn(m,T,0)>-1}function xs(m,T,_){for(var F=-1,z=m==null?0:m.length;++F<z;)if(_(T,m[F]))return!0;return!1}function Ee(m,T){for(var _=-1,F=m==null?0:m.length,z=Array(F);++_<F;)z[_]=T(m[_],_,m);return z}function un(m,T){for(var _=-1,F=T.length,z=m.length;++_<F;)m[z+_]=T[_];return m}function Ts(m,T,_,F){var z=-1,oe=m==null?0:m.length;for(F&&oe&&(_=m[++z]);++z<oe;)_=T(_,m[z],z,m);return _}function Uf(m,T,_,F){var z=m==null?0:m.length;for(F&&z&&(_=m[--z]);z--;)_=T(_,m[z],z,m);return _}function ws(m,T){for(var _=-1,F=m==null?0:m.length;++_<F;)if(T(m[_],_,m))return!0;return!1}var Mf=Es("length");function $f(m){return m.split("")}function Bf(m){return m.match(zl)||[]}function xo(m,T,_){var F;return _(m,function(z,oe,Le){if(T(z,oe,Le))return F=oe,!1}),F}function er(m,T,_,F){for(var z=m.length,oe=_+(F?1:-1);F?oe--:++oe<z;)if(T(m[oe],oe,m))return oe;return-1}function Hn(m,T,_){return T===T?Kf(m,T,_):er(m,To,_)}function jf(m,T,_,F){for(var z=_-1,oe=m.length;++z<oe;)if(F(m[z],T))return z;return-1}function To(m){return m!==m}function wo(m,T){var _=m==null?0:m.length;return _?As(m,T)/_:Wn}function Es(m){return function(T){return T==null?i:T[m]}}function Ss(m){return function(T){return m==null?i:m[T]}}function Eo(m,T,_,F,z){return z(m,function(oe,Le,ye){_=F?(F=!1,oe):T(_,oe,Le,ye)}),_}function Wf(m,T){var _=m.length;for(m.sort(T);_--;)m[_]=m[_].value;return m}function As(m,T){for(var _,F=-1,z=m.length;++F<z;){var oe=T(m[F]);oe!==i&&(_=_===i?oe:_+oe)}return _}function Is(m,T){for(var _=-1,F=Array(m);++_<m;)F[_]=T(_);return F}function Gf(m,T){return Ee(T,function(_){return[_,m[_]]})}function So(m){return m&&m.slice(0,No(m)+1).replace(ps,"")}function et(m){return function(T){return m(T)}}function bs(m,T){return Ee(T,function(_){return m[_]})}function _i(m,T){return m.has(T)}function Ao(m,T){for(var _=-1,F=m.length;++_<F&&Hn(T,m[_],0)>-1;);return _}function Io(m,T){for(var _=m.length;_--&&Hn(T,m[_],0)>-1;);return _}function Vf(m,T){for(var _=m.length,F=0;_--;)m[_]===T&&++F;return F}var qf=Ss(Nf),Jf=Ss(Of);function zf(m){return"\\"+Cf[m]}function Hf(m,T){return m==null?i:m[T]}function Qn(m){return Sf.test(m)}function Qf(m){return Af.test(m)}function Yf(m){for(var T,_=[];!(T=m.next()).done;)_.push(T.value);return _}function Ns(m){var T=-1,_=Array(m.size);return m.forEach(function(F,z){_[++T]=[z,F]}),_}function bo(m,T){return function(_){return m(T(_))}}function cn(m,T){for(var _=-1,F=m.length,z=0,oe=[];++_<F;){var Le=m[_];(Le===T||Le===O)&&(m[_]=O,oe[z++]=_)}return oe}function tr(m){var T=-1,_=Array(m.size);return m.forEach(function(F){_[++T]=F}),_}function Xf(m){var T=-1,_=Array(m.size);return m.forEach(function(F){_[++T]=[F,F]}),_}function Kf(m,T,_){for(var F=_-1,z=m.length;++F<z;)if(m[F]===T)return F;return-1}function Zf(m,T,_){for(var F=_+1;F--;)if(m[F]===T)return F;return F}function Yn(m){return Qn(m)?tp(m):Mf(m)}function St(m){return Qn(m)?np(m):$f(m)}function No(m){for(var T=m.length;T--&&Gl.test(m.charAt(T)););return T}var ep=Ss(Rf);function tp(m){for(var T=ys.lastIndex=0;ys.test(m);)++T;return T}function np(m){return m.match(ys)||[]}function ip(m){return m.match(Ef)||[]}var rp=function m(T){T=T==null?Ue:Xn.defaults(Ue.Object(),T,Xn.pick(Ue,If));var _=T.Array,F=T.Date,z=T.Error,oe=T.Function,Le=T.Math,ye=T.Object,Os=T.RegExp,sp=T.String,ct=T.TypeError,nr=_.prototype,ap=oe.prototype,Kn=ye.prototype,ir=T["__core-js_shared__"],rr=ap.toString,pe=Kn.hasOwnProperty,op=0,Oo=function(){var e=/[^.]+$/.exec(ir&&ir.keys&&ir.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),sr=Kn.toString,up=rr.call(ye),cp=Ue._,lp=Os("^"+rr.call(pe).replace(fs,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ar=fo?T.Buffer:i,ln=T.Symbol,or=T.Uint8Array,Ro=ar?ar.allocUnsafe:i,ur=bo(ye.getPrototypeOf,ye),Co=ye.create,Lo=Kn.propertyIsEnumerable,cr=nr.splice,Fo=ln?ln.isConcatSpreadable:i,xi=ln?ln.iterator:i,Cn=ln?ln.toStringTag:i,lr=function(){try{var e=kn(ye,"defineProperty");return e({},"",{}),e}catch{}}(),fp=T.clearTimeout!==Ue.clearTimeout&&T.clearTimeout,pp=F&&F.now!==Ue.Date.now&&F.now,dp=T.setTimeout!==Ue.setTimeout&&T.setTimeout,fr=Le.ceil,pr=Le.floor,Rs=ye.getOwnPropertySymbols,hp=ar?ar.isBuffer:i,Do=T.isFinite,gp=nr.join,mp=bo(ye.keys,ye),Fe=Le.max,$e=Le.min,yp=F.now,vp=T.parseInt,Po=Le.random,_p=nr.reverse,Cs=kn(T,"DataView"),Ti=kn(T,"Map"),Ls=kn(T,"Promise"),Zn=kn(T,"Set"),wi=kn(T,"WeakMap"),Ei=kn(ye,"create"),dr=wi&&new wi,ei={},xp=Un(Cs),Tp=Un(Ti),wp=Un(Ls),Ep=Un(Zn),Sp=Un(wi),hr=ln?ln.prototype:i,Si=hr?hr.valueOf:i,ko=hr?hr.toString:i;function l(e){if(Ie(e)&&!H(e)&&!(e instanceof te)){if(e instanceof lt)return e;if(pe.call(e,"__wrapped__"))return Uu(e)}return new lt(e)}var ti=function(){function e(){}return function(t){if(!Ae(t))return{};if(Co)return Co(t);e.prototype=t;var s=new e;return e.prototype=i,s}}();function gr(){}function lt(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}l.templateSettings={escape:Ul,evaluate:Ml,interpolate:Va,variable:"",imports:{_:l}},l.prototype=gr.prototype,l.prototype.constructor=l,lt.prototype=ti(gr.prototype),lt.prototype.constructor=lt;function te(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=at,this.__views__=[]}function Ap(){var e=new te(this.__wrapped__);return e.__actions__=Je(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Je(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Je(this.__views__),e}function Ip(){if(this.__filtered__){var e=new te(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function bp(){var e=this.__wrapped__.value(),t=this.__dir__,s=H(e),a=t<0,c=s?e.length:0,p=$d(0,c,this.__views__),d=p.start,g=p.end,y=g-d,E=a?g:d-1,S=this.__iteratees__,b=S.length,C=0,U=$e(y,this.__takeCount__);if(!s||!a&&c==y&&U==y)return au(e,this.__actions__);var G=[];e:for(;y--&&C<U;){E+=t;for(var X=-1,V=e[E];++X<b;){var Z=S[X],ie=Z.iteratee,it=Z.type,Ve=ie(V);if(it==qi)V=Ve;else if(!Ve){if(it==Vi)continue e;break e}}G[C++]=V}return G}te.prototype=ti(gr.prototype),te.prototype.constructor=te;function Ln(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var a=e[t];this.set(a[0],a[1])}}function Np(){this.__data__=Ei?Ei(null):{},this.size=0}function Op(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Rp(e){var t=this.__data__;if(Ei){var s=t[e];return s===w?i:s}return pe.call(t,e)?t[e]:i}function Cp(e){var t=this.__data__;return Ei?t[e]!==i:pe.call(t,e)}function Lp(e,t){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=Ei&&t===i?w:t,this}Ln.prototype.clear=Np,Ln.prototype.delete=Op,Ln.prototype.get=Rp,Ln.prototype.has=Cp,Ln.prototype.set=Lp;function $t(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var a=e[t];this.set(a[0],a[1])}}function Fp(){this.__data__=[],this.size=0}function Dp(e){var t=this.__data__,s=mr(t,e);if(s<0)return!1;var a=t.length-1;return s==a?t.pop():cr.call(t,s,1),--this.size,!0}function Pp(e){var t=this.__data__,s=mr(t,e);return s<0?i:t[s][1]}function kp(e){return mr(this.__data__,e)>-1}function Up(e,t){var s=this.__data__,a=mr(s,e);return a<0?(++this.size,s.push([e,t])):s[a][1]=t,this}$t.prototype.clear=Fp,$t.prototype.delete=Dp,$t.prototype.get=Pp,$t.prototype.has=kp,$t.prototype.set=Up;function Bt(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var a=e[t];this.set(a[0],a[1])}}function Mp(){this.size=0,this.__data__={hash:new Ln,map:new(Ti||$t),string:new Ln}}function $p(e){var t=Nr(this,e).delete(e);return this.size-=t?1:0,t}function Bp(e){return Nr(this,e).get(e)}function jp(e){return Nr(this,e).has(e)}function Wp(e,t){var s=Nr(this,e),a=s.size;return s.set(e,t),this.size+=s.size==a?0:1,this}Bt.prototype.clear=Mp,Bt.prototype.delete=$p,Bt.prototype.get=Bp,Bt.prototype.has=jp,Bt.prototype.set=Wp;function Fn(e){var t=-1,s=e==null?0:e.length;for(this.__data__=new Bt;++t<s;)this.add(e[t])}function Gp(e){return this.__data__.set(e,w),this}function Vp(e){return this.__data__.has(e)}Fn.prototype.add=Fn.prototype.push=Gp,Fn.prototype.has=Vp;function At(e){var t=this.__data__=new $t(e);this.size=t.size}function qp(){this.__data__=new $t,this.size=0}function Jp(e){var t=this.__data__,s=t.delete(e);return this.size=t.size,s}function zp(e){return this.__data__.get(e)}function Hp(e){return this.__data__.has(e)}function Qp(e,t){var s=this.__data__;if(s instanceof $t){var a=s.__data__;if(!Ti||a.length<u-1)return a.push([e,t]),this.size=++s.size,this;s=this.__data__=new Bt(a)}return s.set(e,t),this.size=s.size,this}At.prototype.clear=qp,At.prototype.delete=Jp,At.prototype.get=zp,At.prototype.has=Hp,At.prototype.set=Qp;function Uo(e,t){var s=H(e),a=!s&&Mn(e),c=!s&&!a&&gn(e),p=!s&&!a&&!c&&si(e),d=s||a||c||p,g=d?Is(e.length,sp):[],y=g.length;for(var E in e)(t||pe.call(e,E))&&!(d&&(E=="length"||c&&(E=="offset"||E=="parent")||p&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||Vt(E,y)))&&g.push(E);return g}function Mo(e){var t=e.length;return t?e[Gs(0,t-1)]:i}function Yp(e,t){return Or(Je(e),Dn(t,0,e.length))}function Xp(e){return Or(Je(e))}function Fs(e,t,s){(s!==i&&!It(e[t],s)||s===i&&!(t in e))&&jt(e,t,s)}function Ai(e,t,s){var a=e[t];(!(pe.call(e,t)&&It(a,s))||s===i&&!(t in e))&&jt(e,t,s)}function mr(e,t){for(var s=e.length;s--;)if(It(e[s][0],t))return s;return-1}function Kp(e,t,s,a){return fn(e,function(c,p,d){t(a,c,s(c),d)}),a}function $o(e,t){return e&&Dt(t,Pe(t),e)}function Zp(e,t){return e&&Dt(t,He(t),e)}function jt(e,t,s){t=="__proto__"&&lr?lr(e,t,{configurable:!0,enumerable:!0,value:s,writable:!0}):e[t]=s}function Ds(e,t){for(var s=-1,a=t.length,c=_(a),p=e==null;++s<a;)c[s]=p?i:ha(e,t[s]);return c}function Dn(e,t,s){return e===e&&(s!==i&&(e=e<=s?e:s),t!==i&&(e=e>=t?e:t)),e}function ft(e,t,s,a,c,p){var d,g=t&D,y=t&P,E=t&M;if(s&&(d=c?s(e,a,c,p):s(e)),d!==i)return d;if(!Ae(e))return e;var S=H(e);if(S){if(d=jd(e),!g)return Je(e,d)}else{var b=Be(e),C=b==qn||b==zi;if(gn(e))return cu(e,g);if(b==Et||b==nn||C&&!c){if(d=y||C?{}:Nu(e),!g)return y?Rd(e,Zp(d,e)):Od(e,$o(d,e))}else{if(!_e[b])return c?e:{};d=Wd(e,b,g)}}p||(p=new At);var U=p.get(e);if(U)return U;p.set(e,d),ic(e)?e.forEach(function(V){d.add(ft(V,t,s,V,e,p))}):tc(e)&&e.forEach(function(V,Z){d.set(Z,ft(V,t,s,Z,e,p))});var G=E?y?ea:Zs:y?He:Pe,X=S?i:G(e);return ut(X||e,function(V,Z){X&&(Z=V,V=e[Z]),Ai(d,Z,ft(V,t,s,Z,e,p))}),d}function ed(e){var t=Pe(e);return function(s){return Bo(s,e,t)}}function Bo(e,t,s){var a=s.length;if(e==null)return!a;for(e=ye(e);a--;){var c=s[a],p=t[c],d=e[c];if(d===i&&!(c in e)||!p(d))return!1}return!0}function jo(e,t,s){if(typeof e!="function")throw new ct(h);return Li(function(){e.apply(i,s)},t)}function Ii(e,t,s,a){var c=-1,p=Zi,d=!0,g=e.length,y=[],E=t.length;if(!g)return y;s&&(t=Ee(t,et(s))),a?(p=xs,d=!1):t.length>=u&&(p=_i,d=!1,t=new Fn(t));e:for(;++c<g;){var S=e[c],b=s==null?S:s(S);if(S=a||S!==0?S:0,d&&b===b){for(var C=E;C--;)if(t[C]===b)continue e;y.push(S)}else p(t,b,a)||y.push(S)}return y}var fn=hu(Ft),Wo=hu(ks,!0);function td(e,t){var s=!0;return fn(e,function(a,c,p){return s=!!t(a,c,p),s}),s}function yr(e,t,s){for(var a=-1,c=e.length;++a<c;){var p=e[a],d=t(p);if(d!=null&&(g===i?d===d&&!nt(d):s(d,g)))var g=d,y=p}return y}function nd(e,t,s,a){var c=e.length;for(s=Y(s),s<0&&(s=-s>c?0:c+s),a=a===i||a>c?c:Y(a),a<0&&(a+=c),a=s>a?0:sc(a);s<a;)e[s++]=t;return e}function Go(e,t){var s=[];return fn(e,function(a,c,p){t(a,c,p)&&s.push(a)}),s}function Me(e,t,s,a,c){var p=-1,d=e.length;for(s||(s=Vd),c||(c=[]);++p<d;){var g=e[p];t>0&&s(g)?t>1?Me(g,t-1,s,a,c):un(c,g):a||(c[c.length]=g)}return c}var Ps=gu(),Vo=gu(!0);function Ft(e,t){return e&&Ps(e,t,Pe)}function ks(e,t){return e&&Vo(e,t,Pe)}function vr(e,t){return on(t,function(s){return qt(e[s])})}function Pn(e,t){t=dn(t,e);for(var s=0,a=t.length;e!=null&&s<a;)e=e[Pt(t[s++])];return s&&s==a?e:i}function qo(e,t,s){var a=t(e);return H(e)?a:un(a,s(e))}function We(e){return e==null?e===i?as:ss:Cn&&Cn in ye(e)?Md(e):Xd(e)}function Us(e,t){return e>t}function id(e,t){return e!=null&&pe.call(e,t)}function rd(e,t){return e!=null&&t in ye(e)}function sd(e,t,s){return e>=$e(t,s)&&e<Fe(t,s)}function Ms(e,t,s){for(var a=s?xs:Zi,c=e[0].length,p=e.length,d=p,g=_(p),y=1/0,E=[];d--;){var S=e[d];d&&t&&(S=Ee(S,et(t))),y=$e(S.length,y),g[d]=!s&&(t||c>=120&&S.length>=120)?new Fn(d&&S):i}S=e[0];var b=-1,C=g[0];e:for(;++b<c&&E.length<y;){var U=S[b],G=t?t(U):U;if(U=s||U!==0?U:0,!(C?_i(C,G):a(E,G,s))){for(d=p;--d;){var X=g[d];if(!(X?_i(X,G):a(e[d],G,s)))continue e}C&&C.push(G),E.push(U)}}return E}function ad(e,t,s,a){return Ft(e,function(c,p,d){t(a,s(c),p,d)}),a}function bi(e,t,s){t=dn(t,e),e=Lu(e,t);var a=e==null?e:e[Pt(dt(t))];return a==null?i:Ze(a,e,s)}function Jo(e){return Ie(e)&&We(e)==nn}function od(e){return Ie(e)&&We(e)==Nn}function ud(e){return Ie(e)&&We(e)==An}function Ni(e,t,s,a,c){return e===t?!0:e==null||t==null||!Ie(e)&&!Ie(t)?e!==e&&t!==t:cd(e,t,s,a,Ni,c)}function cd(e,t,s,a,c,p){var d=H(e),g=H(t),y=d?Gn:Be(e),E=g?Gn:Be(t);y=y==nn?Et:y,E=E==nn?Et:E;var S=y==Et,b=E==Et,C=y==E;if(C&&gn(e)){if(!gn(t))return!1;d=!0,S=!1}if(C&&!S)return p||(p=new At),d||si(e)?Au(e,t,s,a,c,p):kd(e,t,y,s,a,c,p);if(!(s&$)){var U=S&&pe.call(e,"__wrapped__"),G=b&&pe.call(t,"__wrapped__");if(U||G){var X=U?e.value():e,V=G?t.value():t;return p||(p=new At),c(X,V,s,a,p)}}return C?(p||(p=new At),Ud(e,t,s,a,c,p)):!1}function ld(e){return Ie(e)&&Be(e)==Xe}function $s(e,t,s,a){var c=s.length,p=c,d=!a;if(e==null)return!p;for(e=ye(e);c--;){var g=s[c];if(d&&g[2]?g[1]!==e[g[0]]:!(g[0]in e))return!1}for(;++c<p;){g=s[c];var y=g[0],E=e[y],S=g[1];if(d&&g[2]){if(E===i&&!(y in e))return!1}else{var b=new At;if(a)var C=a(E,S,y,e,t,b);if(!(C===i?Ni(S,E,$|he,a,b):C))return!1}}return!0}function zo(e){if(!Ae(e)||Jd(e))return!1;var t=qt(e)?lp:Zl;return t.test(Un(e))}function fd(e){return Ie(e)&&We(e)==rn}function pd(e){return Ie(e)&&Be(e)==Ke}function dd(e){return Ie(e)&&Pr(e.length)&&!!we[We(e)]}function Ho(e){return typeof e=="function"?e:e==null?Qe:typeof e=="object"?H(e)?Xo(e[0],e[1]):Yo(e):mc(e)}function Bs(e){if(!Ci(e))return mp(e);var t=[];for(var s in ye(e))pe.call(e,s)&&s!="constructor"&&t.push(s);return t}function hd(e){if(!Ae(e))return Yd(e);var t=Ci(e),s=[];for(var a in e)a=="constructor"&&(t||!pe.call(e,a))||s.push(a);return s}function js(e,t){return e<t}function Qo(e,t){var s=-1,a=ze(e)?_(e.length):[];return fn(e,function(c,p,d){a[++s]=t(c,p,d)}),a}function Yo(e){var t=na(e);return t.length==1&&t[0][2]?Ru(t[0][0],t[0][1]):function(s){return s===e||$s(s,e,t)}}function Xo(e,t){return ra(e)&&Ou(t)?Ru(Pt(e),t):function(s){var a=ha(s,e);return a===i&&a===t?ga(s,e):Ni(t,a,$|he)}}function _r(e,t,s,a,c){e!==t&&Ps(t,function(p,d){if(c||(c=new At),Ae(p))gd(e,t,d,s,_r,a,c);else{var g=a?a(aa(e,d),p,d+"",e,t,c):i;g===i&&(g=p),Fs(e,d,g)}},He)}function gd(e,t,s,a,c,p,d){var g=aa(e,s),y=aa(t,s),E=d.get(y);if(E){Fs(e,s,E);return}var S=p?p(g,y,s+"",e,t,d):i,b=S===i;if(b){var C=H(y),U=!C&&gn(y),G=!C&&!U&&si(y);S=y,C||U||G?H(g)?S=g:be(g)?S=Je(g):U?(b=!1,S=cu(y,!0)):G?(b=!1,S=lu(y,!0)):S=[]:Fi(y)||Mn(y)?(S=g,Mn(g)?S=ac(g):(!Ae(g)||qt(g))&&(S=Nu(y))):b=!1}b&&(d.set(y,S),c(S,y,a,p,d),d.delete(y)),Fs(e,s,S)}function Ko(e,t){var s=e.length;if(s)return t+=t<0?s:0,Vt(t,s)?e[t]:i}function Zo(e,t,s){t.length?t=Ee(t,function(p){return H(p)?function(d){return Pn(d,p.length===1?p[0]:p)}:p}):t=[Qe];var a=-1;t=Ee(t,et(j()));var c=Qo(e,function(p,d,g){var y=Ee(t,function(E){return E(p)});return{criteria:y,index:++a,value:p}});return Wf(c,function(p,d){return Nd(p,d,s)})}function md(e,t){return eu(e,t,function(s,a){return ga(e,a)})}function eu(e,t,s){for(var a=-1,c=t.length,p={};++a<c;){var d=t[a],g=Pn(e,d);s(g,d)&&Oi(p,dn(d,e),g)}return p}function yd(e){return function(t){return Pn(t,e)}}function Ws(e,t,s,a){var c=a?jf:Hn,p=-1,d=t.length,g=e;for(e===t&&(t=Je(t)),s&&(g=Ee(e,et(s)));++p<d;)for(var y=0,E=t[p],S=s?s(E):E;(y=c(g,S,y,a))>-1;)g!==e&&cr.call(g,y,1),cr.call(e,y,1);return e}function tu(e,t){for(var s=e?t.length:0,a=s-1;s--;){var c=t[s];if(s==a||c!==p){var p=c;Vt(c)?cr.call(e,c,1):Js(e,c)}}return e}function Gs(e,t){return e+pr(Po()*(t-e+1))}function vd(e,t,s,a){for(var c=-1,p=Fe(fr((t-e)/(s||1)),0),d=_(p);p--;)d[a?p:++c]=e,e+=s;return d}function Vs(e,t){var s="";if(!e||t<1||t>wt)return s;do t%2&&(s+=e),t=pr(t/2),t&&(e+=e);while(t);return s}function K(e,t){return oa(Cu(e,t,Qe),e+"")}function _d(e){return Mo(ai(e))}function xd(e,t){var s=ai(e);return Or(s,Dn(t,0,s.length))}function Oi(e,t,s,a){if(!Ae(e))return e;t=dn(t,e);for(var c=-1,p=t.length,d=p-1,g=e;g!=null&&++c<p;){var y=Pt(t[c]),E=s;if(y==="__proto__"||y==="constructor"||y==="prototype")return e;if(c!=d){var S=g[y];E=a?a(S,y,g):i,E===i&&(E=Ae(S)?S:Vt(t[c+1])?[]:{})}Ai(g,y,E),g=g[y]}return e}var nu=dr?function(e,t){return dr.set(e,t),e}:Qe,Td=lr?function(e,t){return lr(e,"toString",{configurable:!0,enumerable:!1,value:ya(t),writable:!0})}:Qe;function wd(e){return Or(ai(e))}function pt(e,t,s){var a=-1,c=e.length;t<0&&(t=-t>c?0:c+t),s=s>c?c:s,s<0&&(s+=c),c=t>s?0:s-t>>>0,t>>>=0;for(var p=_(c);++a<c;)p[a]=e[a+t];return p}function Ed(e,t){var s;return fn(e,function(a,c,p){return s=t(a,c,p),!s}),!!s}function xr(e,t,s){var a=0,c=e==null?a:e.length;if(typeof t=="number"&&t===t&&c<=ts){for(;a<c;){var p=a+c>>>1,d=e[p];d!==null&&!nt(d)&&(s?d<=t:d<t)?a=p+1:c=p}return c}return qs(e,t,Qe,s)}function qs(e,t,s,a){var c=0,p=e==null?0:e.length;if(p===0)return 0;t=s(t);for(var d=t!==t,g=t===null,y=nt(t),E=t===i;c<p;){var S=pr((c+p)/2),b=s(e[S]),C=b!==i,U=b===null,G=b===b,X=nt(b);if(d)var V=a||G;else E?V=G&&(a||C):g?V=G&&C&&(a||!U):y?V=G&&C&&!U&&(a||!X):U||X?V=!1:V=a?b<=t:b<t;V?c=S+1:p=S}return $e(p,es)}function iu(e,t){for(var s=-1,a=e.length,c=0,p=[];++s<a;){var d=e[s],g=t?t(d):d;if(!s||!It(g,y)){var y=g;p[c++]=d===0?0:d}}return p}function ru(e){return typeof e=="number"?e:nt(e)?Wn:+e}function tt(e){if(typeof e=="string")return e;if(H(e))return Ee(e,tt)+"";if(nt(e))return ko?ko.call(e):"";var t=e+"";return t=="0"&&1/e==-Ct?"-0":t}function pn(e,t,s){var a=-1,c=Zi,p=e.length,d=!0,g=[],y=g;if(s)d=!1,c=xs;else if(p>=u){var E=t?null:Dd(e);if(E)return tr(E);d=!1,c=_i,y=new Fn}else y=t?[]:g;e:for(;++a<p;){var S=e[a],b=t?t(S):S;if(S=s||S!==0?S:0,d&&b===b){for(var C=y.length;C--;)if(y[C]===b)continue e;t&&y.push(b),g.push(S)}else c(y,b,s)||(y!==g&&y.push(b),g.push(S))}return g}function Js(e,t){return t=dn(t,e),e=Lu(e,t),e==null||delete e[Pt(dt(t))]}function su(e,t,s,a){return Oi(e,t,s(Pn(e,t)),a)}function Tr(e,t,s,a){for(var c=e.length,p=a?c:-1;(a?p--:++p<c)&&t(e[p],p,e););return s?pt(e,a?0:p,a?p+1:c):pt(e,a?p+1:0,a?c:p)}function au(e,t){var s=e;return s instanceof te&&(s=s.value()),Ts(t,function(a,c){return c.func.apply(c.thisArg,un([a],c.args))},s)}function zs(e,t,s){var a=e.length;if(a<2)return a?pn(e[0]):[];for(var c=-1,p=_(a);++c<a;)for(var d=e[c],g=-1;++g<a;)g!=c&&(p[c]=Ii(p[c]||d,e[g],t,s));return pn(Me(p,1),t,s)}function ou(e,t,s){for(var a=-1,c=e.length,p=t.length,d={};++a<c;){var g=a<p?t[a]:i;s(d,e[a],g)}return d}function Hs(e){return be(e)?e:[]}function Qs(e){return typeof e=="function"?e:Qe}function dn(e,t){return H(e)?e:ra(e,t)?[e]:ku(le(e))}var Sd=K;function hn(e,t,s){var a=e.length;return s=s===i?a:s,!t&&s>=a?e:pt(e,t,s)}var uu=fp||function(e){return Ue.clearTimeout(e)};function cu(e,t){if(t)return e.slice();var s=e.length,a=Ro?Ro(s):new e.constructor(s);return e.copy(a),a}function Ys(e){var t=new e.constructor(e.byteLength);return new or(t).set(new or(e)),t}function Ad(e,t){var s=t?Ys(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function Id(e){var t=new e.constructor(e.source,qa.exec(e));return t.lastIndex=e.lastIndex,t}function bd(e){return Si?ye(Si.call(e)):{}}function lu(e,t){var s=t?Ys(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function fu(e,t){if(e!==t){var s=e!==i,a=e===null,c=e===e,p=nt(e),d=t!==i,g=t===null,y=t===t,E=nt(t);if(!g&&!E&&!p&&e>t||p&&d&&y&&!g&&!E||a&&d&&y||!s&&y||!c)return 1;if(!a&&!p&&!E&&e<t||E&&s&&c&&!a&&!p||g&&s&&c||!d&&c||!y)return-1}return 0}function Nd(e,t,s){for(var a=-1,c=e.criteria,p=t.criteria,d=c.length,g=s.length;++a<d;){var y=fu(c[a],p[a]);if(y){if(a>=g)return y;var E=s[a];return y*(E=="desc"?-1:1)}}return e.index-t.index}function pu(e,t,s,a){for(var c=-1,p=e.length,d=s.length,g=-1,y=t.length,E=Fe(p-d,0),S=_(y+E),b=!a;++g<y;)S[g]=t[g];for(;++c<d;)(b||c<p)&&(S[s[c]]=e[c]);for(;E--;)S[g++]=e[c++];return S}function du(e,t,s,a){for(var c=-1,p=e.length,d=-1,g=s.length,y=-1,E=t.length,S=Fe(p-g,0),b=_(S+E),C=!a;++c<S;)b[c]=e[c];for(var U=c;++y<E;)b[U+y]=t[y];for(;++d<g;)(C||c<p)&&(b[U+s[d]]=e[c++]);return b}function Je(e,t){var s=-1,a=e.length;for(t||(t=_(a));++s<a;)t[s]=e[s];return t}function Dt(e,t,s,a){var c=!s;s||(s={});for(var p=-1,d=t.length;++p<d;){var g=t[p],y=a?a(s[g],e[g],g,s,e):i;y===i&&(y=e[g]),c?jt(s,g,y):Ai(s,g,y)}return s}function Od(e,t){return Dt(e,ia(e),t)}function Rd(e,t){return Dt(e,Iu(e),t)}function wr(e,t){return function(s,a){var c=H(s)?Pf:Kp,p=t?t():{};return c(s,e,j(a,2),p)}}function ni(e){return K(function(t,s){var a=-1,c=s.length,p=c>1?s[c-1]:i,d=c>2?s[2]:i;for(p=e.length>3&&typeof p=="function"?(c--,p):i,d&&Ge(s[0],s[1],d)&&(p=c<3?i:p,c=1),t=ye(t);++a<c;){var g=s[a];g&&e(t,g,a,p)}return t})}function hu(e,t){return function(s,a){if(s==null)return s;if(!ze(s))return e(s,a);for(var c=s.length,p=t?c:-1,d=ye(s);(t?p--:++p<c)&&a(d[p],p,d)!==!1;);return s}}function gu(e){return function(t,s,a){for(var c=-1,p=ye(t),d=a(t),g=d.length;g--;){var y=d[e?g:++c];if(s(p[y],y,p)===!1)break}return t}}function Cd(e,t,s){var a=t&ae,c=Ri(e);function p(){var d=this&&this!==Ue&&this instanceof p?c:e;return d.apply(a?s:this,arguments)}return p}function mu(e){return function(t){t=le(t);var s=Qn(t)?St(t):i,a=s?s[0]:t.charAt(0),c=s?hn(s,1).join(""):t.slice(1);return a[e]()+c}}function ii(e){return function(t){return Ts(hc(dc(t).replace(Tf,"")),e,"")}}function Ri(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var s=ti(e.prototype),a=e.apply(s,t);return Ae(a)?a:s}}function Ld(e,t,s){var a=Ri(e);function c(){for(var p=arguments.length,d=_(p),g=p,y=ri(c);g--;)d[g]=arguments[g];var E=p<3&&d[0]!==y&&d[p-1]!==y?[]:cn(d,y);if(p-=E.length,p<s)return Tu(e,t,Er,c.placeholder,i,d,E,i,i,s-p);var S=this&&this!==Ue&&this instanceof c?a:e;return Ze(S,this,d)}return c}function yu(e){return function(t,s,a){var c=ye(t);if(!ze(t)){var p=j(s,3);t=Pe(t),s=function(g){return p(c[g],g,c)}}var d=e(t,s,a);return d>-1?c[p?t[d]:d]:i}}function vu(e){return Gt(function(t){var s=t.length,a=s,c=lt.prototype.thru;for(e&&t.reverse();a--;){var p=t[a];if(typeof p!="function")throw new ct(h);if(c&&!d&&br(p)=="wrapper")var d=new lt([],!0)}for(a=d?a:s;++a<s;){p=t[a];var g=br(p),y=g=="wrapper"?ta(p):i;y&&sa(y[0])&&y[1]==(ce|Te|ee|qe)&&!y[4].length&&y[9]==1?d=d[br(y[0])].apply(d,y[3]):d=p.length==1&&sa(p)?d[g]():d.thru(p)}return function(){var E=arguments,S=E[0];if(d&&E.length==1&&H(S))return d.plant(S).value();for(var b=0,C=s?t[b].apply(this,E):S;++b<s;)C=t[b].call(this,C);return C}})}function Er(e,t,s,a,c,p,d,g,y,E){var S=t&ce,b=t&ae,C=t&me,U=t&(Te|L),G=t&x,X=C?i:Ri(e);function V(){for(var Z=arguments.length,ie=_(Z),it=Z;it--;)ie[it]=arguments[it];if(U)var Ve=ri(V),rt=Vf(ie,Ve);if(a&&(ie=pu(ie,a,c,U)),p&&(ie=du(ie,p,d,U)),Z-=rt,U&&Z<E){var Ne=cn(ie,Ve);return Tu(e,t,Er,V.placeholder,s,ie,Ne,g,y,E-Z)}var bt=b?s:this,zt=C?bt[e]:e;return Z=ie.length,g?ie=Kd(ie,g):G&&Z>1&&ie.reverse(),S&&y<Z&&(ie.length=y),this&&this!==Ue&&this instanceof V&&(zt=X||Ri(zt)),zt.apply(bt,ie)}return V}function _u(e,t){return function(s,a){return ad(s,e,t(a),{})}}function Sr(e,t){return function(s,a){var c;if(s===i&&a===i)return t;if(s!==i&&(c=s),a!==i){if(c===i)return a;typeof s=="string"||typeof a=="string"?(s=tt(s),a=tt(a)):(s=ru(s),a=ru(a)),c=e(s,a)}return c}}function Xs(e){return Gt(function(t){return t=Ee(t,et(j())),K(function(s){var a=this;return e(t,function(c){return Ze(c,a,s)})})})}function Ar(e,t){t=t===i?" ":tt(t);var s=t.length;if(s<2)return s?Vs(t,e):t;var a=Vs(t,fr(e/Yn(t)));return Qn(t)?hn(St(a),0,e).join(""):a.slice(0,e)}function Fd(e,t,s,a){var c=t&ae,p=Ri(e);function d(){for(var g=-1,y=arguments.length,E=-1,S=a.length,b=_(S+y),C=this&&this!==Ue&&this instanceof d?p:e;++E<S;)b[E]=a[E];for(;y--;)b[E++]=arguments[++g];return Ze(C,c?s:this,b)}return d}function xu(e){return function(t,s,a){return a&&typeof a!="number"&&Ge(t,s,a)&&(s=a=i),t=Jt(t),s===i?(s=t,t=0):s=Jt(s),a=a===i?t<s?1:-1:Jt(a),vd(t,s,a,e)}}function Ir(e){return function(t,s){return typeof t=="string"&&typeof s=="string"||(t=ht(t),s=ht(s)),e(t,s)}}function Tu(e,t,s,a,c,p,d,g,y,E){var S=t&Te,b=S?d:i,C=S?i:d,U=S?p:i,G=S?i:p;t|=S?ee:Q,t&=~(S?Q:ee),t&Ye||(t&=-4);var X=[e,t,c,U,b,G,C,g,y,E],V=s.apply(i,X);return sa(e)&&Fu(V,X),V.placeholder=a,Du(V,e,t)}function Ks(e){var t=Le[e];return function(s,a){if(s=ht(s),a=a==null?0:$e(Y(a),292),a&&Do(s)){var c=(le(s)+"e").split("e"),p=t(c[0]+"e"+(+c[1]+a));return c=(le(p)+"e").split("e"),+(c[0]+"e"+(+c[1]-a))}return t(s)}}var Dd=Zn&&1/tr(new Zn([,-0]))[1]==Ct?function(e){return new Zn(e)}:xa;function wu(e){return function(t){var s=Be(t);return s==Xe?Ns(t):s==Ke?Xf(t):Gf(t,e(t))}}function Wt(e,t,s,a,c,p,d,g){var y=t&me;if(!y&&typeof e!="function")throw new ct(h);var E=a?a.length:0;if(E||(t&=-97,a=c=i),d=d===i?d:Fe(Y(d),0),g=g===i?g:Y(g),E-=c?c.length:0,t&Q){var S=a,b=c;a=c=i}var C=y?i:ta(e),U=[e,t,s,a,c,S,b,p,d,g];if(C&&Qd(U,C),e=U[0],t=U[1],s=U[2],a=U[3],c=U[4],g=U[9]=U[9]===i?y?0:e.length:Fe(U[9]-E,0),!g&&t&(Te|L)&&(t&=-25),!t||t==ae)var G=Cd(e,t,s);else t==Te||t==L?G=Ld(e,t,g):(t==ee||t==(ae|ee))&&!c.length?G=Fd(e,t,s,a):G=Er.apply(i,U);var X=C?nu:Fu;return Du(X(G,U),e,t)}function Eu(e,t,s,a){return e===i||It(e,Kn[s])&&!pe.call(a,s)?t:e}function Su(e,t,s,a,c,p){return Ae(e)&&Ae(t)&&(p.set(t,e),_r(e,t,i,Su,p),p.delete(t)),e}function Pd(e){return Fi(e)?i:e}function Au(e,t,s,a,c,p){var d=s&$,g=e.length,y=t.length;if(g!=y&&!(d&&y>g))return!1;var E=p.get(e),S=p.get(t);if(E&&S)return E==t&&S==e;var b=-1,C=!0,U=s&he?new Fn:i;for(p.set(e,t),p.set(t,e);++b<g;){var G=e[b],X=t[b];if(a)var V=d?a(X,G,b,t,e,p):a(G,X,b,e,t,p);if(V!==i){if(V)continue;C=!1;break}if(U){if(!ws(t,function(Z,ie){if(!_i(U,ie)&&(G===Z||c(G,Z,s,a,p)))return U.push(ie)})){C=!1;break}}else if(!(G===X||c(G,X,s,a,p))){C=!1;break}}return p.delete(e),p.delete(t),C}function kd(e,t,s,a,c,p,d){switch(s){case an:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Nn:return!(e.byteLength!=t.byteLength||!p(new or(e),new or(t)));case Sn:case An:case In:return It(+e,+t);case Vn:return e.name==t.name&&e.message==t.message;case rn:case bn:return e==t+"";case Xe:var g=Ns;case Ke:var y=a&$;if(g||(g=tr),e.size!=t.size&&!y)return!1;var E=d.get(e);if(E)return E==t;a|=he,d.set(e,t);var S=Au(g(e),g(t),a,c,p,d);return d.delete(e),S;case Jn:if(Si)return Si.call(e)==Si.call(t)}return!1}function Ud(e,t,s,a,c,p){var d=s&$,g=Zs(e),y=g.length,E=Zs(t),S=E.length;if(y!=S&&!d)return!1;for(var b=y;b--;){var C=g[b];if(!(d?C in t:pe.call(t,C)))return!1}var U=p.get(e),G=p.get(t);if(U&&G)return U==t&&G==e;var X=!0;p.set(e,t),p.set(t,e);for(var V=d;++b<y;){C=g[b];var Z=e[C],ie=t[C];if(a)var it=d?a(ie,Z,C,t,e,p):a(Z,ie,C,e,t,p);if(!(it===i?Z===ie||c(Z,ie,s,a,p):it)){X=!1;break}V||(V=C=="constructor")}if(X&&!V){var Ve=e.constructor,rt=t.constructor;Ve!=rt&&"constructor"in e&&"constructor"in t&&!(typeof Ve=="function"&&Ve instanceof Ve&&typeof rt=="function"&&rt instanceof rt)&&(X=!1)}return p.delete(e),p.delete(t),X}function Gt(e){return oa(Cu(e,i,Bu),e+"")}function Zs(e){return qo(e,Pe,ia)}function ea(e){return qo(e,He,Iu)}var ta=dr?function(e){return dr.get(e)}:xa;function br(e){for(var t=e.name+"",s=ei[t],a=pe.call(ei,t)?s.length:0;a--;){var c=s[a],p=c.func;if(p==null||p==e)return c.name}return t}function ri(e){var t=pe.call(l,"placeholder")?l:e;return t.placeholder}function j(){var e=l.iteratee||va;return e=e===va?Ho:e,arguments.length?e(arguments[0],arguments[1]):e}function Nr(e,t){var s=e.__data__;return qd(t)?s[typeof t=="string"?"string":"hash"]:s.map}function na(e){for(var t=Pe(e),s=t.length;s--;){var a=t[s],c=e[a];t[s]=[a,c,Ou(c)]}return t}function kn(e,t){var s=Hf(e,t);return zo(s)?s:i}function Md(e){var t=pe.call(e,Cn),s=e[Cn];try{e[Cn]=i;var a=!0}catch{}var c=sr.call(e);return a&&(t?e[Cn]=s:delete e[Cn]),c}var ia=Rs?function(e){return e==null?[]:(e=ye(e),on(Rs(e),function(t){return Lo.call(e,t)}))}:Ta,Iu=Rs?function(e){for(var t=[];e;)un(t,ia(e)),e=ur(e);return t}:Ta,Be=We;(Cs&&Be(new Cs(new ArrayBuffer(1)))!=an||Ti&&Be(new Ti)!=Xe||Ls&&Be(Ls.resolve())!=yi||Zn&&Be(new Zn)!=Ke||wi&&Be(new wi)!=sn)&&(Be=function(e){var t=We(e),s=t==Et?e.constructor:i,a=s?Un(s):"";if(a)switch(a){case xp:return an;case Tp:return Xe;case wp:return yi;case Ep:return Ke;case Sp:return sn}return t});function $d(e,t,s){for(var a=-1,c=s.length;++a<c;){var p=s[a],d=p.size;switch(p.type){case"drop":e+=d;break;case"dropRight":t-=d;break;case"take":t=$e(t,e+d);break;case"takeRight":e=Fe(e,t-d);break}}return{start:e,end:t}}function Bd(e){var t=e.match(ql);return t?t[1].split(Jl):[]}function bu(e,t,s){t=dn(t,e);for(var a=-1,c=t.length,p=!1;++a<c;){var d=Pt(t[a]);if(!(p=e!=null&&s(e,d)))break;e=e[d]}return p||++a!=c?p:(c=e==null?0:e.length,!!c&&Pr(c)&&Vt(d,c)&&(H(e)||Mn(e)))}function jd(e){var t=e.length,s=new e.constructor(t);return t&&typeof e[0]=="string"&&pe.call(e,"index")&&(s.index=e.index,s.input=e.input),s}function Nu(e){return typeof e.constructor=="function"&&!Ci(e)?ti(ur(e)):{}}function Wd(e,t,s){var a=e.constructor;switch(t){case Nn:return Ys(e);case Sn:case An:return new a(+e);case an:return Ad(e,s);case W:case Ce:case Lt:case Qi:case On:case vi:case us:case cs:case ls:return lu(e,s);case Xe:return new a;case In:case bn:return new a(e);case rn:return Id(e);case Ke:return new a;case Jn:return bd(e)}}function Gd(e,t){var s=t.length;if(!s)return e;var a=s-1;return t[a]=(s>1?"& ":"")+t[a],t=t.join(s>2?", ":" "),e.replace(Vl,`{
209
+ */var av=Xn.exports,du;function ov(){return du||(du=1,function(c,a){(function(){var i,f="4.17.21",g=200,_="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",S="Expected a function",A="Invalid `variable` option passed into `_.template`",I="__lodash_hash_undefined__",P=500,J="__lodash_placeholder__",G=1,K=2,k=4,ue=1,Oe=2,pe=1,Le=2,Tt=4,Te=8,F=16,Z=32,z=64,se=128,qe=256,ne=512,Ht=30,Ge="...",ht=800,Ft=16,Vn=1,er=2,tr=3,at=1/0,et=9007199254740991,Vr=17976931348623157e292,un=NaN,He=4294967295,ei=He-1,ti=He>>>1,ni=[["ary",se],["bind",pe],["bindKey",Le],["curry",Te],["curryRight",F],["flip",ne],["partial",Z],["partialRight",z],["rearg",qe]],It="[object Arguments]",cn="[object Array]",ri="[object AsyncFunction]",Kt="[object Boolean]",zt="[object Date]",ii="[object DOMException]",ln="[object Error]",fn="[object Function]",nr="[object GeneratorFunction]",Me="[object Map]",Jt="[object Number]",si="[object Null]",tt="[object Object]",On="[object Promise]",rr="[object Proxy]",Rt="[object RegExp]",Ne="[object Set]",Yt="[object String]",hn="[object Symbol]",ai="[object Undefined]",Pt="[object WeakMap]",oi="[object WeakSet]",Zt="[object ArrayBuffer]",Ot="[object DataView]",O="[object Float32Array]",de="[object Float64Array]",ot="[object Int8Array]",ir="[object Int16Array]",Xt="[object Int32Array]",Ln="[object Uint8Array]",ui="[object Uint8ClampedArray]",ci="[object Uint16Array]",li="[object Uint32Array]",Cu=/\b__p \+= '';/g,Tu=/\b(__p \+=) '' \+/g,Fu=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ps=/&(?:amp|lt|gt|quot|#39);/g,Os=/[&<>"']/g,Iu=RegExp(Ps.source),Ru=RegExp(Os.source),Pu=/<%-([\s\S]+?)%>/g,Ou=/<%([\s\S]+?)%>/g,Ls=/<%=([\s\S]+?)%>/g,Lu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mu=/^\w*$/,Nu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fi=/[\\^$.*+?()[\]{}|]/g,Uu=RegExp(fi.source),hi=/^\s+/,Wu=/\s/,Du=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,$u=/\{\n\/\* \[wrapped with (.+)\] \*/,Bu=/,? & /,ku=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ju=/[()=,{}\[\]\/\s]/,qu=/\\(\\)?/g,Gu=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ms=/\w*$/,Hu=/^[-+]0x[0-9a-f]+$/i,Ku=/^0b[01]+$/i,zu=/^\[object .+?Constructor\]$/,Ju=/^0o[0-7]+$/i,Yu=/^(?:0|[1-9]\d*)$/,Zu=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,sr=/($^)/,Xu=/['\n\r\u2028\u2029\\]/g,ar="\\ud800-\\udfff",Qu="\\u0300-\\u036f",Vu="\\ufe20-\\ufe2f",ec="\\u20d0-\\u20ff",Ns=Qu+Vu+ec,Us="\\u2700-\\u27bf",Ws="a-z\\xdf-\\xf6\\xf8-\\xff",tc="\\xac\\xb1\\xd7\\xf7",nc="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rc="\\u2000-\\u206f",ic=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ds="A-Z\\xc0-\\xd6\\xd8-\\xde",$s="\\ufe0e\\ufe0f",Bs=tc+nc+rc+ic,pi="['’]",sc="["+ar+"]",ks="["+Bs+"]",or="["+Ns+"]",js="\\d+",ac="["+Us+"]",qs="["+Ws+"]",Gs="[^"+ar+Bs+js+Us+Ws+Ds+"]",di="\\ud83c[\\udffb-\\udfff]",oc="(?:"+or+"|"+di+")",Hs="[^"+ar+"]",gi="(?:\\ud83c[\\udde6-\\uddff]){2}",mi="[\\ud800-\\udbff][\\udc00-\\udfff]",pn="["+Ds+"]",Ks="\\u200d",zs="(?:"+qs+"|"+Gs+")",uc="(?:"+pn+"|"+Gs+")",Js="(?:"+pi+"(?:d|ll|m|re|s|t|ve))?",Ys="(?:"+pi+"(?:D|LL|M|RE|S|T|VE))?",Zs=oc+"?",Xs="["+$s+"]?",cc="(?:"+Ks+"(?:"+[Hs,gi,mi].join("|")+")"+Xs+Zs+")*",lc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",fc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Qs=Xs+Zs+cc,hc="(?:"+[ac,gi,mi].join("|")+")"+Qs,pc="(?:"+[Hs+or+"?",or,gi,mi,sc].join("|")+")",dc=RegExp(pi,"g"),gc=RegExp(or,"g"),vi=RegExp(di+"(?="+di+")|"+pc+Qs,"g"),mc=RegExp([pn+"?"+qs+"+"+Js+"(?="+[ks,pn,"$"].join("|")+")",uc+"+"+Ys+"(?="+[ks,pn+zs,"$"].join("|")+")",pn+"?"+zs+"+"+Js,pn+"+"+Ys,fc,lc,js,hc].join("|"),"g"),vc=RegExp("["+Ks+ar+Ns+$s+"]"),_c=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,wc=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],yc=-1,ae={};ae[O]=ae[de]=ae[ot]=ae[ir]=ae[Xt]=ae[Ln]=ae[ui]=ae[ci]=ae[li]=!0,ae[It]=ae[cn]=ae[Zt]=ae[Kt]=ae[Ot]=ae[zt]=ae[ln]=ae[fn]=ae[Me]=ae[Jt]=ae[tt]=ae[Rt]=ae[Ne]=ae[Yt]=ae[Pt]=!1;var re={};re[It]=re[cn]=re[Zt]=re[Ot]=re[Kt]=re[zt]=re[O]=re[de]=re[ot]=re[ir]=re[Xt]=re[Me]=re[Jt]=re[tt]=re[Rt]=re[Ne]=re[Yt]=re[hn]=re[Ln]=re[ui]=re[ci]=re[li]=!0,re[ln]=re[fn]=re[Pt]=!1;var xc={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Sc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ac={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},bc={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ec=parseFloat,Cc=parseInt,Vs=typeof bt.commonjsGlobal=="object"&&bt.commonjsGlobal&&bt.commonjsGlobal.Object===Object&&bt.commonjsGlobal,Tc=typeof self=="object"&&self&&self.Object===Object&&self,we=Vs||Tc||Function("return this")(),_i=a&&!a.nodeType&&a,Qt=_i&&!0&&c&&!c.nodeType&&c,ea=Qt&&Qt.exports===_i,wi=ea&&Vs.process,Ke=function(){try{var p=Qt&&Qt.require&&Qt.require("util").types;return p||wi&&wi.binding&&wi.binding("util")}catch{}}(),ta=Ke&&Ke.isArrayBuffer,na=Ke&&Ke.isDate,ra=Ke&&Ke.isMap,ia=Ke&&Ke.isRegExp,sa=Ke&&Ke.isSet,aa=Ke&&Ke.isTypedArray;function Ue(p,v,m){switch(m.length){case 0:return p.call(v);case 1:return p.call(v,m[0]);case 2:return p.call(v,m[0],m[1]);case 3:return p.call(v,m[0],m[1],m[2])}return p.apply(v,m)}function Fc(p,v,m,C){for(var N=-1,Y=p==null?0:p.length;++N<Y;){var ge=p[N];v(C,ge,m(ge),p)}return C}function ze(p,v){for(var m=-1,C=p==null?0:p.length;++m<C&&v(p[m],m,p)!==!1;);return p}function Ic(p,v){for(var m=p==null?0:p.length;m--&&v(p[m],m,p)!==!1;);return p}function oa(p,v){for(var m=-1,C=p==null?0:p.length;++m<C;)if(!v(p[m],m,p))return!1;return!0}function Lt(p,v){for(var m=-1,C=p==null?0:p.length,N=0,Y=[];++m<C;){var ge=p[m];v(ge,m,p)&&(Y[N++]=ge)}return Y}function ur(p,v){var m=p==null?0:p.length;return!!m&&dn(p,v,0)>-1}function yi(p,v,m){for(var C=-1,N=p==null?0:p.length;++C<N;)if(m(v,p[C]))return!0;return!1}function oe(p,v){for(var m=-1,C=p==null?0:p.length,N=Array(C);++m<C;)N[m]=v(p[m],m,p);return N}function Mt(p,v){for(var m=-1,C=v.length,N=p.length;++m<C;)p[N+m]=v[m];return p}function xi(p,v,m,C){var N=-1,Y=p==null?0:p.length;for(C&&Y&&(m=p[++N]);++N<Y;)m=v(m,p[N],N,p);return m}function Rc(p,v,m,C){var N=p==null?0:p.length;for(C&&N&&(m=p[--N]);N--;)m=v(m,p[N],N,p);return m}function Si(p,v){for(var m=-1,C=p==null?0:p.length;++m<C;)if(v(p[m],m,p))return!0;return!1}var Pc=Ai("length");function Oc(p){return p.split("")}function Lc(p){return p.match(ku)||[]}function ua(p,v,m){var C;return m(p,function(N,Y,ge){if(v(N,Y,ge))return C=Y,!1}),C}function cr(p,v,m,C){for(var N=p.length,Y=m+(C?1:-1);C?Y--:++Y<N;)if(v(p[Y],Y,p))return Y;return-1}function dn(p,v,m){return v===v?Hc(p,v,m):cr(p,ca,m)}function Mc(p,v,m,C){for(var N=m-1,Y=p.length;++N<Y;)if(C(p[N],v))return N;return-1}function ca(p){return p!==p}function la(p,v){var m=p==null?0:p.length;return m?Ei(p,v)/m:un}function Ai(p){return function(v){return v==null?i:v[p]}}function bi(p){return function(v){return p==null?i:p[v]}}function fa(p,v,m,C,N){return N(p,function(Y,ge,te){m=C?(C=!1,Y):v(m,Y,ge,te)}),m}function Nc(p,v){var m=p.length;for(p.sort(v);m--;)p[m]=p[m].value;return p}function Ei(p,v){for(var m,C=-1,N=p.length;++C<N;){var Y=v(p[C]);Y!==i&&(m=m===i?Y:m+Y)}return m}function Ci(p,v){for(var m=-1,C=Array(p);++m<p;)C[m]=v(m);return C}function Uc(p,v){return oe(v,function(m){return[m,p[m]]})}function ha(p){return p&&p.slice(0,ma(p)+1).replace(hi,"")}function We(p){return function(v){return p(v)}}function Ti(p,v){return oe(v,function(m){return p[m]})}function Mn(p,v){return p.has(v)}function pa(p,v){for(var m=-1,C=p.length;++m<C&&dn(v,p[m],0)>-1;);return m}function da(p,v){for(var m=p.length;m--&&dn(v,p[m],0)>-1;);return m}function Wc(p,v){for(var m=p.length,C=0;m--;)p[m]===v&&++C;return C}var Dc=bi(xc),$c=bi(Sc);function Bc(p){return"\\"+bc[p]}function kc(p,v){return p==null?i:p[v]}function gn(p){return vc.test(p)}function jc(p){return _c.test(p)}function qc(p){for(var v,m=[];!(v=p.next()).done;)m.push(v.value);return m}function Fi(p){var v=-1,m=Array(p.size);return p.forEach(function(C,N){m[++v]=[N,C]}),m}function ga(p,v){return function(m){return p(v(m))}}function Nt(p,v){for(var m=-1,C=p.length,N=0,Y=[];++m<C;){var ge=p[m];(ge===v||ge===J)&&(p[m]=J,Y[N++]=m)}return Y}function lr(p){var v=-1,m=Array(p.size);return p.forEach(function(C){m[++v]=C}),m}function Gc(p){var v=-1,m=Array(p.size);return p.forEach(function(C){m[++v]=[C,C]}),m}function Hc(p,v,m){for(var C=m-1,N=p.length;++C<N;)if(p[C]===v)return C;return-1}function Kc(p,v,m){for(var C=m+1;C--;)if(p[C]===v)return C;return C}function mn(p){return gn(p)?Jc(p):Pc(p)}function nt(p){return gn(p)?Yc(p):Oc(p)}function ma(p){for(var v=p.length;v--&&Wu.test(p.charAt(v)););return v}var zc=bi(Ac);function Jc(p){for(var v=vi.lastIndex=0;vi.test(p);)++v;return v}function Yc(p){return p.match(vi)||[]}function Zc(p){return p.match(mc)||[]}var Xc=function p(v){v=v==null?we:vn.defaults(we.Object(),v,vn.pick(we,wc));var m=v.Array,C=v.Date,N=v.Error,Y=v.Function,ge=v.Math,te=v.Object,Ii=v.RegExp,Qc=v.String,Je=v.TypeError,fr=m.prototype,Vc=Y.prototype,_n=te.prototype,hr=v["__core-js_shared__"],pr=Vc.toString,Q=_n.hasOwnProperty,el=0,va=function(){var e=/[^.]+$/.exec(hr&&hr.keys&&hr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),dr=_n.toString,tl=pr.call(te),nl=we._,rl=Ii("^"+pr.call(Q).replace(fi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gr=ea?v.Buffer:i,Ut=v.Symbol,mr=v.Uint8Array,_a=gr?gr.allocUnsafe:i,vr=ga(te.getPrototypeOf,te),wa=te.create,ya=_n.propertyIsEnumerable,_r=fr.splice,xa=Ut?Ut.isConcatSpreadable:i,Nn=Ut?Ut.iterator:i,Vt=Ut?Ut.toStringTag:i,wr=function(){try{var e=sn(te,"defineProperty");return e({},"",{}),e}catch{}}(),il=v.clearTimeout!==we.clearTimeout&&v.clearTimeout,sl=C&&C.now!==we.Date.now&&C.now,al=v.setTimeout!==we.setTimeout&&v.setTimeout,yr=ge.ceil,xr=ge.floor,Ri=te.getOwnPropertySymbols,ol=gr?gr.isBuffer:i,Sa=v.isFinite,ul=fr.join,cl=ga(te.keys,te),me=ge.max,xe=ge.min,ll=C.now,fl=v.parseInt,Aa=ge.random,hl=fr.reverse,Pi=sn(v,"DataView"),Un=sn(v,"Map"),Oi=sn(v,"Promise"),wn=sn(v,"Set"),Wn=sn(v,"WeakMap"),Dn=sn(te,"create"),Sr=Wn&&new Wn,yn={},pl=an(Pi),dl=an(Un),gl=an(Oi),ml=an(wn),vl=an(Wn),Ar=Ut?Ut.prototype:i,$n=Ar?Ar.valueOf:i,ba=Ar?Ar.toString:i;function o(e){if(le(e)&&!U(e)&&!(e instanceof q)){if(e instanceof Ye)return e;if(Q.call(e,"__wrapped__"))return Co(e)}return new Ye(e)}var xn=function(){function e(){}return function(t){if(!ce(t))return{};if(wa)return wa(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function br(){}function Ye(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}o.templateSettings={escape:Pu,evaluate:Ou,interpolate:Ls,variable:"",imports:{_:o}},o.prototype=br.prototype,o.prototype.constructor=o,Ye.prototype=xn(br.prototype),Ye.prototype.constructor=Ye;function q(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=He,this.__views__=[]}function _l(){var e=new q(this.__wrapped__);return e.__actions__=Fe(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Fe(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Fe(this.__views__),e}function wl(){if(this.__filtered__){var e=new q(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function yl(){var e=this.__wrapped__.value(),t=this.__dir__,n=U(e),r=t<0,s=n?e.length:0,u=Lf(0,s,this.__views__),l=u.start,h=u.end,d=h-l,w=r?h:l-1,y=this.__iteratees__,x=y.length,E=0,T=xe(d,this.__takeCount__);if(!n||!r&&s==d&&T==d)return Ja(e,this.__actions__);var L=[];e:for(;d--&&E<T;){w+=t;for(var $=-1,M=e[w];++$<x;){var j=y[$],H=j.iteratee,Be=j.type,Ce=H(M);if(Be==er)M=Ce;else if(!Ce){if(Be==Vn)continue e;break e}}L[E++]=M}return L}q.prototype=xn(br.prototype),q.prototype.constructor=q;function en(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function xl(){this.__data__=Dn?Dn(null):{},this.size=0}function Sl(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Al(e){var t=this.__data__;if(Dn){var n=t[e];return n===I?i:n}return Q.call(t,e)?t[e]:i}function bl(e){var t=this.__data__;return Dn?t[e]!==i:Q.call(t,e)}function El(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Dn&&t===i?I:t,this}en.prototype.clear=xl,en.prototype.delete=Sl,en.prototype.get=Al,en.prototype.has=bl,en.prototype.set=El;function pt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Cl(){this.__data__=[],this.size=0}function Tl(e){var t=this.__data__,n=Er(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():_r.call(t,n,1),--this.size,!0}function Fl(e){var t=this.__data__,n=Er(t,e);return n<0?i:t[n][1]}function Il(e){return Er(this.__data__,e)>-1}function Rl(e,t){var n=this.__data__,r=Er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}pt.prototype.clear=Cl,pt.prototype.delete=Tl,pt.prototype.get=Fl,pt.prototype.has=Il,pt.prototype.set=Rl;function dt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Pl(){this.size=0,this.__data__={hash:new en,map:new(Un||pt),string:new en}}function Ol(e){var t=Wr(this,e).delete(e);return this.size-=t?1:0,t}function Ll(e){return Wr(this,e).get(e)}function Ml(e){return Wr(this,e).has(e)}function Nl(e,t){var n=Wr(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}dt.prototype.clear=Pl,dt.prototype.delete=Ol,dt.prototype.get=Ll,dt.prototype.has=Ml,dt.prototype.set=Nl;function tn(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new dt;++t<n;)this.add(e[t])}function Ul(e){return this.__data__.set(e,I),this}function Wl(e){return this.__data__.has(e)}tn.prototype.add=tn.prototype.push=Ul,tn.prototype.has=Wl;function rt(e){var t=this.__data__=new pt(e);this.size=t.size}function Dl(){this.__data__=new pt,this.size=0}function $l(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Bl(e){return this.__data__.get(e)}function kl(e){return this.__data__.has(e)}function jl(e,t){var n=this.__data__;if(n instanceof pt){var r=n.__data__;if(!Un||r.length<g-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new dt(r)}return n.set(e,t),this.size=n.size,this}rt.prototype.clear=Dl,rt.prototype.delete=$l,rt.prototype.get=Bl,rt.prototype.has=kl,rt.prototype.set=jl;function Ea(e,t){var n=U(e),r=!n&&on(e),s=!n&&!r&&kt(e),u=!n&&!r&&!s&&En(e),l=n||r||s||u,h=l?Ci(e.length,Qc):[],d=h.length;for(var w in e)(t||Q.call(e,w))&&!(l&&(w=="length"||s&&(w=="offset"||w=="parent")||u&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||_t(w,d)))&&h.push(w);return h}function Ca(e){var t=e.length;return t?e[qi(0,t-1)]:i}function ql(e,t){return Dr(Fe(e),nn(t,0,e.length))}function Gl(e){return Dr(Fe(e))}function Li(e,t,n){(n!==i&&!it(e[t],n)||n===i&&!(t in e))&&gt(e,t,n)}function Bn(e,t,n){var r=e[t];(!(Q.call(e,t)&&it(r,n))||n===i&&!(t in e))&&gt(e,t,n)}function Er(e,t){for(var n=e.length;n--;)if(it(e[n][0],t))return n;return-1}function Hl(e,t,n,r){return Wt(e,function(s,u,l){t(r,s,n(s),l)}),r}function Ta(e,t){return e&&ct(t,_e(t),e)}function Kl(e,t){return e&&ct(t,Re(t),e)}function gt(e,t,n){t=="__proto__"&&wr?wr(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Mi(e,t){for(var n=-1,r=t.length,s=m(r),u=e==null;++n<r;)s[n]=u?i:ds(e,t[n]);return s}function nn(e,t,n){return e===e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function Ze(e,t,n,r,s,u){var l,h=t&G,d=t&K,w=t&k;if(n&&(l=s?n(e,r,s,u):n(e)),l!==i)return l;if(!ce(e))return e;var y=U(e);if(y){if(l=Nf(e),!h)return Fe(e,l)}else{var x=Se(e),E=x==fn||x==nr;if(kt(e))return Xa(e,h);if(x==tt||x==It||E&&!s){if(l=d||E?{}:vo(e),!h)return d?bf(e,Kl(l,e)):Af(e,Ta(l,e))}else{if(!re[x])return s?e:{};l=Uf(e,x,h)}}u||(u=new rt);var T=u.get(e);if(T)return T;u.set(e,l),Ko(e)?e.forEach(function(M){l.add(Ze(M,t,n,M,e,u))}):Go(e)&&e.forEach(function(M,j){l.set(j,Ze(M,t,n,j,e,u))});var L=w?d?es:Vi:d?Re:_e,$=y?i:L(e);return ze($||e,function(M,j){$&&(j=M,M=e[j]),Bn(l,j,Ze(M,t,n,j,e,u))}),l}function zl(e){var t=_e(e);return function(n){return Fa(n,e,t)}}function Fa(e,t,n){var r=n.length;if(e==null)return!r;for(e=te(e);r--;){var s=n[r],u=t[s],l=e[s];if(l===i&&!(s in e)||!u(l))return!1}return!0}function Ia(e,t,n){if(typeof e!="function")throw new Je(S);return zn(function(){e.apply(i,n)},t)}function kn(e,t,n,r){var s=-1,u=ur,l=!0,h=e.length,d=[],w=t.length;if(!h)return d;n&&(t=oe(t,We(n))),r?(u=yi,l=!1):t.length>=g&&(u=Mn,l=!1,t=new tn(t));e:for(;++s<h;){var y=e[s],x=n==null?y:n(y);if(y=r||y!==0?y:0,l&&x===x){for(var E=w;E--;)if(t[E]===x)continue e;d.push(y)}else u(t,x,r)||d.push(y)}return d}var Wt=no(ut),Ra=no(Ui,!0);function Jl(e,t){var n=!0;return Wt(e,function(r,s,u){return n=!!t(r,s,u),n}),n}function Cr(e,t,n){for(var r=-1,s=e.length;++r<s;){var u=e[r],l=t(u);if(l!=null&&(h===i?l===l&&!$e(l):n(l,h)))var h=l,d=u}return d}function Yl(e,t,n,r){var s=e.length;for(n=D(n),n<0&&(n=-n>s?0:s+n),r=r===i||r>s?s:D(r),r<0&&(r+=s),r=n>r?0:Jo(r);n<r;)e[n++]=t;return e}function Pa(e,t){var n=[];return Wt(e,function(r,s,u){t(r,s,u)&&n.push(r)}),n}function ye(e,t,n,r,s){var u=-1,l=e.length;for(n||(n=Df),s||(s=[]);++u<l;){var h=e[u];t>0&&n(h)?t>1?ye(h,t-1,n,r,s):Mt(s,h):r||(s[s.length]=h)}return s}var Ni=ro(),Oa=ro(!0);function ut(e,t){return e&&Ni(e,t,_e)}function Ui(e,t){return e&&Oa(e,t,_e)}function Tr(e,t){return Lt(t,function(n){return wt(e[n])})}function rn(e,t){t=$t(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[lt(t[n++])];return n&&n==r?e:i}function La(e,t,n){var r=t(e);return U(e)?r:Mt(r,n(e))}function be(e){return e==null?e===i?ai:si:Vt&&Vt in te(e)?Of(e):Hf(e)}function Wi(e,t){return e>t}function Zl(e,t){return e!=null&&Q.call(e,t)}function Xl(e,t){return e!=null&&t in te(e)}function Ql(e,t,n){return e>=xe(t,n)&&e<me(t,n)}function Di(e,t,n){for(var r=n?yi:ur,s=e[0].length,u=e.length,l=u,h=m(u),d=1/0,w=[];l--;){var y=e[l];l&&t&&(y=oe(y,We(t))),d=xe(y.length,d),h[l]=!n&&(t||s>=120&&y.length>=120)?new tn(l&&y):i}y=e[0];var x=-1,E=h[0];e:for(;++x<s&&w.length<d;){var T=y[x],L=t?t(T):T;if(T=n||T!==0?T:0,!(E?Mn(E,L):r(w,L,n))){for(l=u;--l;){var $=h[l];if(!($?Mn($,L):r(e[l],L,n)))continue e}E&&E.push(L),w.push(T)}}return w}function Vl(e,t,n,r){return ut(e,function(s,u,l){t(r,n(s),u,l)}),r}function jn(e,t,n){t=$t(t,e),e=xo(e,t);var r=e==null?e:e[lt(Qe(t))];return r==null?i:Ue(r,e,n)}function Ma(e){return le(e)&&be(e)==It}function ef(e){return le(e)&&be(e)==Zt}function tf(e){return le(e)&&be(e)==zt}function qn(e,t,n,r,s){return e===t?!0:e==null||t==null||!le(e)&&!le(t)?e!==e&&t!==t:nf(e,t,n,r,qn,s)}function nf(e,t,n,r,s,u){var l=U(e),h=U(t),d=l?cn:Se(e),w=h?cn:Se(t);d=d==It?tt:d,w=w==It?tt:w;var y=d==tt,x=w==tt,E=d==w;if(E&&kt(e)){if(!kt(t))return!1;l=!0,y=!1}if(E&&!y)return u||(u=new rt),l||En(e)?po(e,t,n,r,s,u):Rf(e,t,d,n,r,s,u);if(!(n&ue)){var T=y&&Q.call(e,"__wrapped__"),L=x&&Q.call(t,"__wrapped__");if(T||L){var $=T?e.value():e,M=L?t.value():t;return u||(u=new rt),s($,M,n,r,u)}}return E?(u||(u=new rt),Pf(e,t,n,r,s,u)):!1}function rf(e){return le(e)&&Se(e)==Me}function $i(e,t,n,r){var s=n.length,u=s,l=!r;if(e==null)return!u;for(e=te(e);s--;){var h=n[s];if(l&&h[2]?h[1]!==e[h[0]]:!(h[0]in e))return!1}for(;++s<u;){h=n[s];var d=h[0],w=e[d],y=h[1];if(l&&h[2]){if(w===i&&!(d in e))return!1}else{var x=new rt;if(r)var E=r(w,y,d,e,t,x);if(!(E===i?qn(y,w,ue|Oe,r,x):E))return!1}}return!0}function Na(e){if(!ce(e)||Bf(e))return!1;var t=wt(e)?rl:zu;return t.test(an(e))}function sf(e){return le(e)&&be(e)==Rt}function af(e){return le(e)&&Se(e)==Ne}function of(e){return le(e)&&Gr(e.length)&&!!ae[be(e)]}function Ua(e){return typeof e=="function"?e:e==null?Pe:typeof e=="object"?U(e)?$a(e[0],e[1]):Da(e):su(e)}function Bi(e){if(!Kn(e))return cl(e);var t=[];for(var n in te(e))Q.call(e,n)&&n!="constructor"&&t.push(n);return t}function uf(e){if(!ce(e))return Gf(e);var t=Kn(e),n=[];for(var r in e)r=="constructor"&&(t||!Q.call(e,r))||n.push(r);return n}function ki(e,t){return e<t}function Wa(e,t){var n=-1,r=Ie(e)?m(e.length):[];return Wt(e,function(s,u,l){r[++n]=t(s,u,l)}),r}function Da(e){var t=ns(e);return t.length==1&&t[0][2]?wo(t[0][0],t[0][1]):function(n){return n===e||$i(n,e,t)}}function $a(e,t){return is(e)&&_o(t)?wo(lt(e),t):function(n){var r=ds(n,e);return r===i&&r===t?gs(n,e):qn(t,r,ue|Oe)}}function Fr(e,t,n,r,s){e!==t&&Ni(t,function(u,l){if(s||(s=new rt),ce(u))cf(e,t,l,n,Fr,r,s);else{var h=r?r(as(e,l),u,l+"",e,t,s):i;h===i&&(h=u),Li(e,l,h)}},Re)}function cf(e,t,n,r,s,u,l){var h=as(e,n),d=as(t,n),w=l.get(d);if(w){Li(e,n,w);return}var y=u?u(h,d,n+"",e,t,l):i,x=y===i;if(x){var E=U(d),T=!E&&kt(d),L=!E&&!T&&En(d);y=d,E||T||L?U(h)?y=h:fe(h)?y=Fe(h):T?(x=!1,y=Xa(d,!0)):L?(x=!1,y=Qa(d,!0)):y=[]:Jn(d)||on(d)?(y=h,on(h)?y=Yo(h):(!ce(h)||wt(h))&&(y=vo(d))):x=!1}x&&(l.set(d,y),s(y,d,r,u,l),l.delete(d)),Li(e,n,y)}function Ba(e,t){var n=e.length;if(n)return t+=t<0?n:0,_t(t,n)?e[t]:i}function ka(e,t,n){t.length?t=oe(t,function(u){return U(u)?function(l){return rn(l,u.length===1?u[0]:u)}:u}):t=[Pe];var r=-1;t=oe(t,We(R()));var s=Wa(e,function(u,l,h){var d=oe(t,function(w){return w(u)});return{criteria:d,index:++r,value:u}});return Nc(s,function(u,l){return Sf(u,l,n)})}function lf(e,t){return ja(e,t,function(n,r){return gs(e,r)})}function ja(e,t,n){for(var r=-1,s=t.length,u={};++r<s;){var l=t[r],h=rn(e,l);n(h,l)&&Gn(u,$t(l,e),h)}return u}function ff(e){return function(t){return rn(t,e)}}function ji(e,t,n,r){var s=r?Mc:dn,u=-1,l=t.length,h=e;for(e===t&&(t=Fe(t)),n&&(h=oe(e,We(n)));++u<l;)for(var d=0,w=t[u],y=n?n(w):w;(d=s(h,y,d,r))>-1;)h!==e&&_r.call(h,d,1),_r.call(e,d,1);return e}function qa(e,t){for(var n=e?t.length:0,r=n-1;n--;){var s=t[n];if(n==r||s!==u){var u=s;_t(s)?_r.call(e,s,1):Ki(e,s)}}return e}function qi(e,t){return e+xr(Aa()*(t-e+1))}function hf(e,t,n,r){for(var s=-1,u=me(yr((t-e)/(n||1)),0),l=m(u);u--;)l[r?u:++s]=e,e+=n;return l}function Gi(e,t){var n="";if(!e||t<1||t>et)return n;do t%2&&(n+=e),t=xr(t/2),t&&(e+=e);while(t);return n}function B(e,t){return os(yo(e,t,Pe),e+"")}function pf(e){return Ca(Cn(e))}function df(e,t){var n=Cn(e);return Dr(n,nn(t,0,n.length))}function Gn(e,t,n,r){if(!ce(e))return e;t=$t(t,e);for(var s=-1,u=t.length,l=u-1,h=e;h!=null&&++s<u;){var d=lt(t[s]),w=n;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(s!=l){var y=h[d];w=r?r(y,d,h):i,w===i&&(w=ce(y)?y:_t(t[s+1])?[]:{})}Bn(h,d,w),h=h[d]}return e}var Ga=Sr?function(e,t){return Sr.set(e,t),e}:Pe,gf=wr?function(e,t){return wr(e,"toString",{configurable:!0,enumerable:!1,value:vs(t),writable:!0})}:Pe;function mf(e){return Dr(Cn(e))}function Xe(e,t,n){var r=-1,s=e.length;t<0&&(t=-t>s?0:s+t),n=n>s?s:n,n<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var u=m(s);++r<s;)u[r]=e[r+t];return u}function vf(e,t){var n;return Wt(e,function(r,s,u){return n=t(r,s,u),!n}),!!n}function Ir(e,t,n){var r=0,s=e==null?r:e.length;if(typeof t=="number"&&t===t&&s<=ti){for(;r<s;){var u=r+s>>>1,l=e[u];l!==null&&!$e(l)&&(n?l<=t:l<t)?r=u+1:s=u}return s}return Hi(e,t,Pe,n)}function Hi(e,t,n,r){var s=0,u=e==null?0:e.length;if(u===0)return 0;t=n(t);for(var l=t!==t,h=t===null,d=$e(t),w=t===i;s<u;){var y=xr((s+u)/2),x=n(e[y]),E=x!==i,T=x===null,L=x===x,$=$e(x);if(l)var M=r||L;else w?M=L&&(r||E):h?M=L&&E&&(r||!T):d?M=L&&E&&!T&&(r||!$):T||$?M=!1:M=r?x<=t:x<t;M?s=y+1:u=y}return xe(u,ei)}function Ha(e,t){for(var n=-1,r=e.length,s=0,u=[];++n<r;){var l=e[n],h=t?t(l):l;if(!n||!it(h,d)){var d=h;u[s++]=l===0?0:l}}return u}function Ka(e){return typeof e=="number"?e:$e(e)?un:+e}function De(e){if(typeof e=="string")return e;if(U(e))return oe(e,De)+"";if($e(e))return ba?ba.call(e):"";var t=e+"";return t=="0"&&1/e==-at?"-0":t}function Dt(e,t,n){var r=-1,s=ur,u=e.length,l=!0,h=[],d=h;if(n)l=!1,s=yi;else if(u>=g){var w=t?null:Ff(e);if(w)return lr(w);l=!1,s=Mn,d=new tn}else d=t?[]:h;e:for(;++r<u;){var y=e[r],x=t?t(y):y;if(y=n||y!==0?y:0,l&&x===x){for(var E=d.length;E--;)if(d[E]===x)continue e;t&&d.push(x),h.push(y)}else s(d,x,n)||(d!==h&&d.push(x),h.push(y))}return h}function Ki(e,t){return t=$t(t,e),e=xo(e,t),e==null||delete e[lt(Qe(t))]}function za(e,t,n,r){return Gn(e,t,n(rn(e,t)),r)}function Rr(e,t,n,r){for(var s=e.length,u=r?s:-1;(r?u--:++u<s)&&t(e[u],u,e););return n?Xe(e,r?0:u,r?u+1:s):Xe(e,r?u+1:0,r?s:u)}function Ja(e,t){var n=e;return n instanceof q&&(n=n.value()),xi(t,function(r,s){return s.func.apply(s.thisArg,Mt([r],s.args))},n)}function zi(e,t,n){var r=e.length;if(r<2)return r?Dt(e[0]):[];for(var s=-1,u=m(r);++s<r;)for(var l=e[s],h=-1;++h<r;)h!=s&&(u[s]=kn(u[s]||l,e[h],t,n));return Dt(ye(u,1),t,n)}function Ya(e,t,n){for(var r=-1,s=e.length,u=t.length,l={};++r<s;){var h=r<u?t[r]:i;n(l,e[r],h)}return l}function Ji(e){return fe(e)?e:[]}function Yi(e){return typeof e=="function"?e:Pe}function $t(e,t){return U(e)?e:is(e,t)?[e]:Eo(X(e))}var _f=B;function Bt(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:Xe(e,t,n)}var Za=il||function(e){return we.clearTimeout(e)};function Xa(e,t){if(t)return e.slice();var n=e.length,r=_a?_a(n):new e.constructor(n);return e.copy(r),r}function Zi(e){var t=new e.constructor(e.byteLength);return new mr(t).set(new mr(e)),t}function wf(e,t){var n=t?Zi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function yf(e){var t=new e.constructor(e.source,Ms.exec(e));return t.lastIndex=e.lastIndex,t}function xf(e){return $n?te($n.call(e)):{}}function Qa(e,t){var n=t?Zi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Va(e,t){if(e!==t){var n=e!==i,r=e===null,s=e===e,u=$e(e),l=t!==i,h=t===null,d=t===t,w=$e(t);if(!h&&!w&&!u&&e>t||u&&l&&d&&!h&&!w||r&&l&&d||!n&&d||!s)return 1;if(!r&&!u&&!w&&e<t||w&&n&&s&&!r&&!u||h&&n&&s||!l&&s||!d)return-1}return 0}function Sf(e,t,n){for(var r=-1,s=e.criteria,u=t.criteria,l=s.length,h=n.length;++r<l;){var d=Va(s[r],u[r]);if(d){if(r>=h)return d;var w=n[r];return d*(w=="desc"?-1:1)}}return e.index-t.index}function eo(e,t,n,r){for(var s=-1,u=e.length,l=n.length,h=-1,d=t.length,w=me(u-l,0),y=m(d+w),x=!r;++h<d;)y[h]=t[h];for(;++s<l;)(x||s<u)&&(y[n[s]]=e[s]);for(;w--;)y[h++]=e[s++];return y}function to(e,t,n,r){for(var s=-1,u=e.length,l=-1,h=n.length,d=-1,w=t.length,y=me(u-h,0),x=m(y+w),E=!r;++s<y;)x[s]=e[s];for(var T=s;++d<w;)x[T+d]=t[d];for(;++l<h;)(E||s<u)&&(x[T+n[l]]=e[s++]);return x}function Fe(e,t){var n=-1,r=e.length;for(t||(t=m(r));++n<r;)t[n]=e[n];return t}function ct(e,t,n,r){var s=!n;n||(n={});for(var u=-1,l=t.length;++u<l;){var h=t[u],d=r?r(n[h],e[h],h,n,e):i;d===i&&(d=e[h]),s?gt(n,h,d):Bn(n,h,d)}return n}function Af(e,t){return ct(e,rs(e),t)}function bf(e,t){return ct(e,go(e),t)}function Pr(e,t){return function(n,r){var s=U(n)?Fc:Hl,u=t?t():{};return s(n,e,R(r,2),u)}}function Sn(e){return B(function(t,n){var r=-1,s=n.length,u=s>1?n[s-1]:i,l=s>2?n[2]:i;for(u=e.length>3&&typeof u=="function"?(s--,u):i,l&&Ee(n[0],n[1],l)&&(u=s<3?i:u,s=1),t=te(t);++r<s;){var h=n[r];h&&e(t,h,r,u)}return t})}function no(e,t){return function(n,r){if(n==null)return n;if(!Ie(n))return e(n,r);for(var s=n.length,u=t?s:-1,l=te(n);(t?u--:++u<s)&&r(l[u],u,l)!==!1;);return n}}function ro(e){return function(t,n,r){for(var s=-1,u=te(t),l=r(t),h=l.length;h--;){var d=l[e?h:++s];if(n(u[d],d,u)===!1)break}return t}}function Ef(e,t,n){var r=t&pe,s=Hn(e);function u(){var l=this&&this!==we&&this instanceof u?s:e;return l.apply(r?n:this,arguments)}return u}function io(e){return function(t){t=X(t);var n=gn(t)?nt(t):i,r=n?n[0]:t.charAt(0),s=n?Bt(n,1).join(""):t.slice(1);return r[e]()+s}}function An(e){return function(t){return xi(ru(nu(t).replace(dc,"")),e,"")}}function Hn(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=xn(e.prototype),r=e.apply(n,t);return ce(r)?r:n}}function Cf(e,t,n){var r=Hn(e);function s(){for(var u=arguments.length,l=m(u),h=u,d=bn(s);h--;)l[h]=arguments[h];var w=u<3&&l[0]!==d&&l[u-1]!==d?[]:Nt(l,d);if(u-=w.length,u<n)return co(e,t,Or,s.placeholder,i,l,w,i,i,n-u);var y=this&&this!==we&&this instanceof s?r:e;return Ue(y,this,l)}return s}function so(e){return function(t,n,r){var s=te(t);if(!Ie(t)){var u=R(n,3);t=_e(t),n=function(h){return u(s[h],h,s)}}var l=e(t,n,r);return l>-1?s[u?t[l]:l]:i}}function ao(e){return vt(function(t){var n=t.length,r=n,s=Ye.prototype.thru;for(e&&t.reverse();r--;){var u=t[r];if(typeof u!="function")throw new Je(S);if(s&&!l&&Ur(u)=="wrapper")var l=new Ye([],!0)}for(r=l?r:n;++r<n;){u=t[r];var h=Ur(u),d=h=="wrapper"?ts(u):i;d&&ss(d[0])&&d[1]==(se|Te|Z|qe)&&!d[4].length&&d[9]==1?l=l[Ur(d[0])].apply(l,d[3]):l=u.length==1&&ss(u)?l[h]():l.thru(u)}return function(){var w=arguments,y=w[0];if(l&&w.length==1&&U(y))return l.plant(y).value();for(var x=0,E=n?t[x].apply(this,w):y;++x<n;)E=t[x].call(this,E);return E}})}function Or(e,t,n,r,s,u,l,h,d,w){var y=t&se,x=t&pe,E=t&Le,T=t&(Te|F),L=t&ne,$=E?i:Hn(e);function M(){for(var j=arguments.length,H=m(j),Be=j;Be--;)H[Be]=arguments[Be];if(T)var Ce=bn(M),ke=Wc(H,Ce);if(r&&(H=eo(H,r,s,T)),u&&(H=to(H,u,l,T)),j-=ke,T&&j<w){var he=Nt(H,Ce);return co(e,t,Or,M.placeholder,n,H,he,h,d,w-j)}var st=x?n:this,xt=E?st[e]:e;return j=H.length,h?H=Kf(H,h):L&&j>1&&H.reverse(),y&&d<j&&(H.length=d),this&&this!==we&&this instanceof M&&(xt=$||Hn(xt)),xt.apply(st,H)}return M}function oo(e,t){return function(n,r){return Vl(n,e,t(r),{})}}function Lr(e,t){return function(n,r){var s;if(n===i&&r===i)return t;if(n!==i&&(s=n),r!==i){if(s===i)return r;typeof n=="string"||typeof r=="string"?(n=De(n),r=De(r)):(n=Ka(n),r=Ka(r)),s=e(n,r)}return s}}function Xi(e){return vt(function(t){return t=oe(t,We(R())),B(function(n){var r=this;return e(t,function(s){return Ue(s,r,n)})})})}function Mr(e,t){t=t===i?" ":De(t);var n=t.length;if(n<2)return n?Gi(t,e):t;var r=Gi(t,yr(e/mn(t)));return gn(t)?Bt(nt(r),0,e).join(""):r.slice(0,e)}function Tf(e,t,n,r){var s=t&pe,u=Hn(e);function l(){for(var h=-1,d=arguments.length,w=-1,y=r.length,x=m(y+d),E=this&&this!==we&&this instanceof l?u:e;++w<y;)x[w]=r[w];for(;d--;)x[w++]=arguments[++h];return Ue(E,s?n:this,x)}return l}function uo(e){return function(t,n,r){return r&&typeof r!="number"&&Ee(t,n,r)&&(n=r=i),t=yt(t),n===i?(n=t,t=0):n=yt(n),r=r===i?t<n?1:-1:yt(r),hf(t,n,r,e)}}function Nr(e){return function(t,n){return typeof t=="string"&&typeof n=="string"||(t=Ve(t),n=Ve(n)),e(t,n)}}function co(e,t,n,r,s,u,l,h,d,w){var y=t&Te,x=y?l:i,E=y?i:l,T=y?u:i,L=y?i:u;t|=y?Z:z,t&=~(y?z:Z),t&Tt||(t&=-4);var $=[e,t,s,T,x,L,E,h,d,w],M=n.apply(i,$);return ss(e)&&So(M,$),M.placeholder=r,Ao(M,e,t)}function Qi(e){var t=ge[e];return function(n,r){if(n=Ve(n),r=r==null?0:xe(D(r),292),r&&Sa(n)){var s=(X(n)+"e").split("e"),u=t(s[0]+"e"+(+s[1]+r));return s=(X(u)+"e").split("e"),+(s[0]+"e"+(+s[1]-r))}return t(n)}}var Ff=wn&&1/lr(new wn([,-0]))[1]==at?function(e){return new wn(e)}:ys;function lo(e){return function(t){var n=Se(t);return n==Me?Fi(t):n==Ne?Gc(t):Uc(t,e(t))}}function mt(e,t,n,r,s,u,l,h){var d=t&Le;if(!d&&typeof e!="function")throw new Je(S);var w=r?r.length:0;if(w||(t&=-97,r=s=i),l=l===i?l:me(D(l),0),h=h===i?h:D(h),w-=s?s.length:0,t&z){var y=r,x=s;r=s=i}var E=d?i:ts(e),T=[e,t,n,r,s,y,x,u,l,h];if(E&&qf(T,E),e=T[0],t=T[1],n=T[2],r=T[3],s=T[4],h=T[9]=T[9]===i?d?0:e.length:me(T[9]-w,0),!h&&t&(Te|F)&&(t&=-25),!t||t==pe)var L=Ef(e,t,n);else t==Te||t==F?L=Cf(e,t,h):(t==Z||t==(pe|Z))&&!s.length?L=Tf(e,t,n,r):L=Or.apply(i,T);var $=E?Ga:So;return Ao($(L,T),e,t)}function fo(e,t,n,r){return e===i||it(e,_n[n])&&!Q.call(r,n)?t:e}function ho(e,t,n,r,s,u){return ce(e)&&ce(t)&&(u.set(t,e),Fr(e,t,i,ho,u),u.delete(t)),e}function If(e){return Jn(e)?i:e}function po(e,t,n,r,s,u){var l=n&ue,h=e.length,d=t.length;if(h!=d&&!(l&&d>h))return!1;var w=u.get(e),y=u.get(t);if(w&&y)return w==t&&y==e;var x=-1,E=!0,T=n&Oe?new tn:i;for(u.set(e,t),u.set(t,e);++x<h;){var L=e[x],$=t[x];if(r)var M=l?r($,L,x,t,e,u):r(L,$,x,e,t,u);if(M!==i){if(M)continue;E=!1;break}if(T){if(!Si(t,function(j,H){if(!Mn(T,H)&&(L===j||s(L,j,n,r,u)))return T.push(H)})){E=!1;break}}else if(!(L===$||s(L,$,n,r,u))){E=!1;break}}return u.delete(e),u.delete(t),E}function Rf(e,t,n,r,s,u,l){switch(n){case Ot:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Zt:return!(e.byteLength!=t.byteLength||!u(new mr(e),new mr(t)));case Kt:case zt:case Jt:return it(+e,+t);case ln:return e.name==t.name&&e.message==t.message;case Rt:case Yt:return e==t+"";case Me:var h=Fi;case Ne:var d=r&ue;if(h||(h=lr),e.size!=t.size&&!d)return!1;var w=l.get(e);if(w)return w==t;r|=Oe,l.set(e,t);var y=po(h(e),h(t),r,s,u,l);return l.delete(e),y;case hn:if($n)return $n.call(e)==$n.call(t)}return!1}function Pf(e,t,n,r,s,u){var l=n&ue,h=Vi(e),d=h.length,w=Vi(t),y=w.length;if(d!=y&&!l)return!1;for(var x=d;x--;){var E=h[x];if(!(l?E in t:Q.call(t,E)))return!1}var T=u.get(e),L=u.get(t);if(T&&L)return T==t&&L==e;var $=!0;u.set(e,t),u.set(t,e);for(var M=l;++x<d;){E=h[x];var j=e[E],H=t[E];if(r)var Be=l?r(H,j,E,t,e,u):r(j,H,E,e,t,u);if(!(Be===i?j===H||s(j,H,n,r,u):Be)){$=!1;break}M||(M=E=="constructor")}if($&&!M){var Ce=e.constructor,ke=t.constructor;Ce!=ke&&"constructor"in e&&"constructor"in t&&!(typeof Ce=="function"&&Ce instanceof Ce&&typeof ke=="function"&&ke instanceof ke)&&($=!1)}return u.delete(e),u.delete(t),$}function vt(e){return os(yo(e,i,Io),e+"")}function Vi(e){return La(e,_e,rs)}function es(e){return La(e,Re,go)}var ts=Sr?function(e){return Sr.get(e)}:ys;function Ur(e){for(var t=e.name+"",n=yn[t],r=Q.call(yn,t)?n.length:0;r--;){var s=n[r],u=s.func;if(u==null||u==e)return s.name}return t}function bn(e){var t=Q.call(o,"placeholder")?o:e;return t.placeholder}function R(){var e=o.iteratee||_s;return e=e===_s?Ua:e,arguments.length?e(arguments[0],arguments[1]):e}function Wr(e,t){var n=e.__data__;return $f(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ns(e){for(var t=_e(e),n=t.length;n--;){var r=t[n],s=e[r];t[n]=[r,s,_o(s)]}return t}function sn(e,t){var n=kc(e,t);return Na(n)?n:i}function Of(e){var t=Q.call(e,Vt),n=e[Vt];try{e[Vt]=i;var r=!0}catch{}var s=dr.call(e);return r&&(t?e[Vt]=n:delete e[Vt]),s}var rs=Ri?function(e){return e==null?[]:(e=te(e),Lt(Ri(e),function(t){return ya.call(e,t)}))}:xs,go=Ri?function(e){for(var t=[];e;)Mt(t,rs(e)),e=vr(e);return t}:xs,Se=be;(Pi&&Se(new Pi(new ArrayBuffer(1)))!=Ot||Un&&Se(new Un)!=Me||Oi&&Se(Oi.resolve())!=On||wn&&Se(new wn)!=Ne||Wn&&Se(new Wn)!=Pt)&&(Se=function(e){var t=be(e),n=t==tt?e.constructor:i,r=n?an(n):"";if(r)switch(r){case pl:return Ot;case dl:return Me;case gl:return On;case ml:return Ne;case vl:return Pt}return t});function Lf(e,t,n){for(var r=-1,s=n.length;++r<s;){var u=n[r],l=u.size;switch(u.type){case"drop":e+=l;break;case"dropRight":t-=l;break;case"take":t=xe(t,e+l);break;case"takeRight":e=me(e,t-l);break}}return{start:e,end:t}}function Mf(e){var t=e.match($u);return t?t[1].split(Bu):[]}function mo(e,t,n){t=$t(t,e);for(var r=-1,s=t.length,u=!1;++r<s;){var l=lt(t[r]);if(!(u=e!=null&&n(e,l)))break;e=e[l]}return u||++r!=s?u:(s=e==null?0:e.length,!!s&&Gr(s)&&_t(l,s)&&(U(e)||on(e)))}function Nf(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Q.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function vo(e){return typeof e.constructor=="function"&&!Kn(e)?xn(vr(e)):{}}function Uf(e,t,n){var r=e.constructor;switch(t){case Zt:return Zi(e);case Kt:case zt:return new r(+e);case Ot:return wf(e,n);case O:case de:case ot:case ir:case Xt:case Ln:case ui:case ci:case li:return Qa(e,n);case Me:return new r;case Jt:case Yt:return new r(e);case Rt:return yf(e);case Ne:return new r;case hn:return xf(e)}}function Wf(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Du,`{
379
210
  /* [wrapped with `+t+`] */
380
- `)}function Vd(e){return H(e)||Mn(e)||!!(Fo&&e&&e[Fo])}function Vt(e,t){var s=typeof e;return t=t??wt,!!t&&(s=="number"||s!="symbol"&&tf.test(e))&&e>-1&&e%1==0&&e<t}function Ge(e,t,s){if(!Ae(s))return!1;var a=typeof t;return(a=="number"?ze(s)&&Vt(t,s.length):a=="string"&&t in s)?It(s[t],e):!1}function ra(e,t){if(H(e))return!1;var s=typeof e;return s=="number"||s=="symbol"||s=="boolean"||e==null||nt(e)?!0:Bl.test(e)||!$l.test(e)||t!=null&&e in ye(t)}function qd(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function sa(e){var t=br(e),s=l[t];if(typeof s!="function"||!(t in te.prototype))return!1;if(e===s)return!0;var a=ta(s);return!!a&&e===a[0]}function Jd(e){return!!Oo&&Oo in e}var zd=ir?qt:wa;function Ci(e){var t=e&&e.constructor,s=typeof t=="function"&&t.prototype||Kn;return e===s}function Ou(e){return e===e&&!Ae(e)}function Ru(e,t){return function(s){return s==null?!1:s[e]===t&&(t!==i||e in ye(s))}}function Hd(e){var t=Fr(e,function(a){return s.size===I&&s.clear(),a}),s=t.cache;return t}function Qd(e,t){var s=e[1],a=t[1],c=s|a,p=c<(ae|me|ce),d=a==ce&&s==Te||a==ce&&s==qe&&e[7].length<=t[8]||a==(ce|qe)&&t[7].length<=t[8]&&s==Te;if(!(p||d))return e;a&ae&&(e[2]=t[2],c|=s&ae?0:Ye);var g=t[3];if(g){var y=e[3];e[3]=y?pu(y,g,t[4]):g,e[4]=y?cn(e[3],O):t[4]}return g=t[5],g&&(y=e[5],e[5]=y?du(y,g,t[6]):g,e[6]=y?cn(e[5],O):t[6]),g=t[7],g&&(e[7]=g),a&ce&&(e[8]=e[8]==null?t[8]:$e(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=c,e}function Yd(e){var t=[];if(e!=null)for(var s in ye(e))t.push(s);return t}function Xd(e){return sr.call(e)}function Cu(e,t,s){return t=Fe(t===i?e.length-1:t,0),function(){for(var a=arguments,c=-1,p=Fe(a.length-t,0),d=_(p);++c<p;)d[c]=a[t+c];c=-1;for(var g=_(t+1);++c<t;)g[c]=a[c];return g[t]=s(d),Ze(e,this,g)}}function Lu(e,t){return t.length<2?e:Pn(e,pt(t,0,-1))}function Kd(e,t){for(var s=e.length,a=$e(t.length,s),c=Je(e);a--;){var p=t[a];e[a]=Vt(p,s)?c[p]:i}return e}function aa(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Fu=Pu(nu),Li=dp||function(e,t){return Ue.setTimeout(e,t)},oa=Pu(Td);function Du(e,t,s){var a=t+"";return oa(e,Gd(a,Zd(Bd(a),s)))}function Pu(e){var t=0,s=0;return function(){var a=yp(),c=tn-(a-s);if(s=a,c>0){if(++t>=Tt)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Or(e,t){var s=-1,a=e.length,c=a-1;for(t=t===i?a:t;++s<t;){var p=Gs(s,c),d=e[p];e[p]=e[s],e[s]=d}return e.length=t,e}var ku=Hd(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(jl,function(s,a,c,p){t.push(c?p.replace(Ql,"$1"):a||s)}),t});function Pt(e){if(typeof e=="string"||nt(e))return e;var t=e+"";return t=="0"&&1/e==-Ct?"-0":t}function Un(e){if(e!=null){try{return rr.call(e)}catch{}try{return e+""}catch{}}return""}function Zd(e,t){return ut(ns,function(s){var a="_."+s[0];t&s[1]&&!Zi(e,a)&&e.push(a)}),e.sort()}function Uu(e){if(e instanceof te)return e.clone();var t=new lt(e.__wrapped__,e.__chain__);return t.__actions__=Je(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function eh(e,t,s){(s?Ge(e,t,s):t===i)?t=1:t=Fe(Y(t),0);var a=e==null?0:e.length;if(!a||t<1)return[];for(var c=0,p=0,d=_(fr(a/t));c<a;)d[p++]=pt(e,c,c+=t);return d}function th(e){for(var t=-1,s=e==null?0:e.length,a=0,c=[];++t<s;){var p=e[t];p&&(c[a++]=p)}return c}function nh(){var e=arguments.length;if(!e)return[];for(var t=_(e-1),s=arguments[0],a=e;a--;)t[a-1]=arguments[a];return un(H(s)?Je(s):[s],Me(t,1))}var ih=K(function(e,t){return be(e)?Ii(e,Me(t,1,be,!0)):[]}),rh=K(function(e,t){var s=dt(t);return be(s)&&(s=i),be(e)?Ii(e,Me(t,1,be,!0),j(s,2)):[]}),sh=K(function(e,t){var s=dt(t);return be(s)&&(s=i),be(e)?Ii(e,Me(t,1,be,!0),i,s):[]});function ah(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),pt(e,t<0?0:t,a)):[]}function oh(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),t=a-t,pt(e,0,t<0?0:t)):[]}function uh(e,t){return e&&e.length?Tr(e,j(t,3),!0,!0):[]}function ch(e,t){return e&&e.length?Tr(e,j(t,3),!0):[]}function lh(e,t,s,a){var c=e==null?0:e.length;return c?(s&&typeof s!="number"&&Ge(e,t,s)&&(s=0,a=c),nd(e,t,s,a)):[]}function Mu(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=s==null?0:Y(s);return c<0&&(c=Fe(a+c,0)),er(e,j(t,3),c)}function $u(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=a-1;return s!==i&&(c=Y(s),c=s<0?Fe(a+c,0):$e(c,a-1)),er(e,j(t,3),c,!0)}function Bu(e){var t=e==null?0:e.length;return t?Me(e,1):[]}function fh(e){var t=e==null?0:e.length;return t?Me(e,Ct):[]}function ph(e,t){var s=e==null?0:e.length;return s?(t=t===i?1:Y(t),Me(e,t)):[]}function dh(e){for(var t=-1,s=e==null?0:e.length,a={};++t<s;){var c=e[t];a[c[0]]=c[1]}return a}function ju(e){return e&&e.length?e[0]:i}function hh(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=s==null?0:Y(s);return c<0&&(c=Fe(a+c,0)),Hn(e,t,c)}function gh(e){var t=e==null?0:e.length;return t?pt(e,0,-1):[]}var mh=K(function(e){var t=Ee(e,Hs);return t.length&&t[0]===e[0]?Ms(t):[]}),yh=K(function(e){var t=dt(e),s=Ee(e,Hs);return t===dt(s)?t=i:s.pop(),s.length&&s[0]===e[0]?Ms(s,j(t,2)):[]}),vh=K(function(e){var t=dt(e),s=Ee(e,Hs);return t=typeof t=="function"?t:i,t&&s.pop(),s.length&&s[0]===e[0]?Ms(s,i,t):[]});function _h(e,t){return e==null?"":gp.call(e,t)}function dt(e){var t=e==null?0:e.length;return t?e[t-1]:i}function xh(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=a;return s!==i&&(c=Y(s),c=c<0?Fe(a+c,0):$e(c,a-1)),t===t?Zf(e,t,c):er(e,To,c,!0)}function Th(e,t){return e&&e.length?Ko(e,Y(t)):i}var wh=K(Wu);function Wu(e,t){return e&&e.length&&t&&t.length?Ws(e,t):e}function Eh(e,t,s){return e&&e.length&&t&&t.length?Ws(e,t,j(s,2)):e}function Sh(e,t,s){return e&&e.length&&t&&t.length?Ws(e,t,i,s):e}var Ah=Gt(function(e,t){var s=e==null?0:e.length,a=Ds(e,t);return tu(e,Ee(t,function(c){return Vt(c,s)?+c:c}).sort(fu)),a});function Ih(e,t){var s=[];if(!(e&&e.length))return s;var a=-1,c=[],p=e.length;for(t=j(t,3);++a<p;){var d=e[a];t(d,a,e)&&(s.push(d),c.push(a))}return tu(e,c),s}function ua(e){return e==null?e:_p.call(e)}function bh(e,t,s){var a=e==null?0:e.length;return a?(s&&typeof s!="number"&&Ge(e,t,s)?(t=0,s=a):(t=t==null?0:Y(t),s=s===i?a:Y(s)),pt(e,t,s)):[]}function Nh(e,t){return xr(e,t)}function Oh(e,t,s){return qs(e,t,j(s,2))}function Rh(e,t){var s=e==null?0:e.length;if(s){var a=xr(e,t);if(a<s&&It(e[a],t))return a}return-1}function Ch(e,t){return xr(e,t,!0)}function Lh(e,t,s){return qs(e,t,j(s,2),!0)}function Fh(e,t){var s=e==null?0:e.length;if(s){var a=xr(e,t,!0)-1;if(It(e[a],t))return a}return-1}function Dh(e){return e&&e.length?iu(e):[]}function Ph(e,t){return e&&e.length?iu(e,j(t,2)):[]}function kh(e){var t=e==null?0:e.length;return t?pt(e,1,t):[]}function Uh(e,t,s){return e&&e.length?(t=s||t===i?1:Y(t),pt(e,0,t<0?0:t)):[]}function Mh(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),t=a-t,pt(e,t<0?0:t,a)):[]}function $h(e,t){return e&&e.length?Tr(e,j(t,3),!1,!0):[]}function Bh(e,t){return e&&e.length?Tr(e,j(t,3)):[]}var jh=K(function(e){return pn(Me(e,1,be,!0))}),Wh=K(function(e){var t=dt(e);return be(t)&&(t=i),pn(Me(e,1,be,!0),j(t,2))}),Gh=K(function(e){var t=dt(e);return t=typeof t=="function"?t:i,pn(Me(e,1,be,!0),i,t)});function Vh(e){return e&&e.length?pn(e):[]}function qh(e,t){return e&&e.length?pn(e,j(t,2)):[]}function Jh(e,t){return t=typeof t=="function"?t:i,e&&e.length?pn(e,i,t):[]}function ca(e){if(!(e&&e.length))return[];var t=0;return e=on(e,function(s){if(be(s))return t=Fe(s.length,t),!0}),Is(t,function(s){return Ee(e,Es(s))})}function Gu(e,t){if(!(e&&e.length))return[];var s=ca(e);return t==null?s:Ee(s,function(a){return Ze(t,i,a)})}var zh=K(function(e,t){return be(e)?Ii(e,t):[]}),Hh=K(function(e){return zs(on(e,be))}),Qh=K(function(e){var t=dt(e);return be(t)&&(t=i),zs(on(e,be),j(t,2))}),Yh=K(function(e){var t=dt(e);return t=typeof t=="function"?t:i,zs(on(e,be),i,t)}),Xh=K(ca);function Kh(e,t){return ou(e||[],t||[],Ai)}function Zh(e,t){return ou(e||[],t||[],Oi)}var eg=K(function(e){var t=e.length,s=t>1?e[t-1]:i;return s=typeof s=="function"?(e.pop(),s):i,Gu(e,s)});function Vu(e){var t=l(e);return t.__chain__=!0,t}function tg(e,t){return t(e),e}function Rr(e,t){return t(e)}var ng=Gt(function(e){var t=e.length,s=t?e[0]:0,a=this.__wrapped__,c=function(p){return Ds(p,e)};return t>1||this.__actions__.length||!(a instanceof te)||!Vt(s)?this.thru(c):(a=a.slice(s,+s+(t?1:0)),a.__actions__.push({func:Rr,args:[c],thisArg:i}),new lt(a,this.__chain__).thru(function(p){return t&&!p.length&&p.push(i),p}))});function ig(){return Vu(this)}function rg(){return new lt(this.value(),this.__chain__)}function sg(){this.__values__===i&&(this.__values__=rc(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function ag(){return this}function og(e){for(var t,s=this;s instanceof gr;){var a=Uu(s);a.__index__=0,a.__values__=i,t?c.__wrapped__=a:t=a;var c=a;s=s.__wrapped__}return c.__wrapped__=e,t}function ug(){var e=this.__wrapped__;if(e instanceof te){var t=e;return this.__actions__.length&&(t=new te(this)),t=t.reverse(),t.__actions__.push({func:Rr,args:[ua],thisArg:i}),new lt(t,this.__chain__)}return this.thru(ua)}function cg(){return au(this.__wrapped__,this.__actions__)}var lg=wr(function(e,t,s){pe.call(e,s)?++e[s]:jt(e,s,1)});function fg(e,t,s){var a=H(e)?_o:td;return s&&Ge(e,t,s)&&(t=i),a(e,j(t,3))}function pg(e,t){var s=H(e)?on:Go;return s(e,j(t,3))}var dg=yu(Mu),hg=yu($u);function gg(e,t){return Me(Cr(e,t),1)}function mg(e,t){return Me(Cr(e,t),Ct)}function yg(e,t,s){return s=s===i?1:Y(s),Me(Cr(e,t),s)}function qu(e,t){var s=H(e)?ut:fn;return s(e,j(t,3))}function Ju(e,t){var s=H(e)?kf:Wo;return s(e,j(t,3))}var vg=wr(function(e,t,s){pe.call(e,s)?e[s].push(t):jt(e,s,[t])});function _g(e,t,s,a){e=ze(e)?e:ai(e),s=s&&!a?Y(s):0;var c=e.length;return s<0&&(s=Fe(c+s,0)),kr(e)?s<=c&&e.indexOf(t,s)>-1:!!c&&Hn(e,t,s)>-1}var xg=K(function(e,t,s){var a=-1,c=typeof t=="function",p=ze(e)?_(e.length):[];return fn(e,function(d){p[++a]=c?Ze(t,d,s):bi(d,t,s)}),p}),Tg=wr(function(e,t,s){jt(e,s,t)});function Cr(e,t){var s=H(e)?Ee:Qo;return s(e,j(t,3))}function wg(e,t,s,a){return e==null?[]:(H(t)||(t=t==null?[]:[t]),s=a?i:s,H(s)||(s=s==null?[]:[s]),Zo(e,t,s))}var Eg=wr(function(e,t,s){e[s?0:1].push(t)},function(){return[[],[]]});function Sg(e,t,s){var a=H(e)?Ts:Eo,c=arguments.length<3;return a(e,j(t,4),s,c,fn)}function Ag(e,t,s){var a=H(e)?Uf:Eo,c=arguments.length<3;return a(e,j(t,4),s,c,Wo)}function Ig(e,t){var s=H(e)?on:Go;return s(e,Dr(j(t,3)))}function bg(e){var t=H(e)?Mo:_d;return t(e)}function Ng(e,t,s){(s?Ge(e,t,s):t===i)?t=1:t=Y(t);var a=H(e)?Yp:xd;return a(e,t)}function Og(e){var t=H(e)?Xp:wd;return t(e)}function Rg(e){if(e==null)return 0;if(ze(e))return kr(e)?Yn(e):e.length;var t=Be(e);return t==Xe||t==Ke?e.size:Bs(e).length}function Cg(e,t,s){var a=H(e)?ws:Ed;return s&&Ge(e,t,s)&&(t=i),a(e,j(t,3))}var Lg=K(function(e,t){if(e==null)return[];var s=t.length;return s>1&&Ge(e,t[0],t[1])?t=[]:s>2&&Ge(t[0],t[1],t[2])&&(t=[t[0]]),Zo(e,Me(t,1),[])}),Lr=pp||function(){return Ue.Date.now()};function Fg(e,t){if(typeof t!="function")throw new ct(h);return e=Y(e),function(){if(--e<1)return t.apply(this,arguments)}}function zu(e,t,s){return t=s?i:t,t=e&&t==null?e.length:t,Wt(e,ce,i,i,i,i,t)}function Hu(e,t){var s;if(typeof t!="function")throw new ct(h);return e=Y(e),function(){return--e>0&&(s=t.apply(this,arguments)),e<=1&&(t=i),s}}var la=K(function(e,t,s){var a=ae;if(s.length){var c=cn(s,ri(la));a|=ee}return Wt(e,a,t,s,c)}),Qu=K(function(e,t,s){var a=ae|me;if(s.length){var c=cn(s,ri(Qu));a|=ee}return Wt(t,a,e,s,c)});function Yu(e,t,s){t=s?i:t;var a=Wt(e,Te,i,i,i,i,i,t);return a.placeholder=Yu.placeholder,a}function Xu(e,t,s){t=s?i:t;var a=Wt(e,L,i,i,i,i,i,t);return a.placeholder=Xu.placeholder,a}function Ku(e,t,s){var a,c,p,d,g,y,E=0,S=!1,b=!1,C=!0;if(typeof e!="function")throw new ct(h);t=ht(t)||0,Ae(s)&&(S=!!s.leading,b="maxWait"in s,p=b?Fe(ht(s.maxWait)||0,t):p,C="trailing"in s?!!s.trailing:C);function U(Ne){var bt=a,zt=c;return a=c=i,E=Ne,d=e.apply(zt,bt),d}function G(Ne){return E=Ne,g=Li(Z,t),S?U(Ne):d}function X(Ne){var bt=Ne-y,zt=Ne-E,yc=t-bt;return b?$e(yc,p-zt):yc}function V(Ne){var bt=Ne-y,zt=Ne-E;return y===i||bt>=t||bt<0||b&&zt>=p}function Z(){var Ne=Lr();if(V(Ne))return ie(Ne);g=Li(Z,X(Ne))}function ie(Ne){return g=i,C&&a?U(Ne):(a=c=i,d)}function it(){g!==i&&uu(g),E=0,a=y=c=g=i}function Ve(){return g===i?d:ie(Lr())}function rt(){var Ne=Lr(),bt=V(Ne);if(a=arguments,c=this,y=Ne,bt){if(g===i)return G(y);if(b)return uu(g),g=Li(Z,t),U(y)}return g===i&&(g=Li(Z,t)),d}return rt.cancel=it,rt.flush=Ve,rt}var Dg=K(function(e,t){return jo(e,1,t)}),Pg=K(function(e,t,s){return jo(e,ht(t)||0,s)});function kg(e){return Wt(e,x)}function Fr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new ct(h);var s=function(){var a=arguments,c=t?t.apply(this,a):a[0],p=s.cache;if(p.has(c))return p.get(c);var d=e.apply(this,a);return s.cache=p.set(c,d)||p,d};return s.cache=new(Fr.Cache||Bt),s}Fr.Cache=Bt;function Dr(e){if(typeof e!="function")throw new ct(h);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Ug(e){return Hu(2,e)}var Mg=Sd(function(e,t){t=t.length==1&&H(t[0])?Ee(t[0],et(j())):Ee(Me(t,1),et(j()));var s=t.length;return K(function(a){for(var c=-1,p=$e(a.length,s);++c<p;)a[c]=t[c].call(this,a[c]);return Ze(e,this,a)})}),fa=K(function(e,t){var s=cn(t,ri(fa));return Wt(e,ee,i,t,s)}),Zu=K(function(e,t){var s=cn(t,ri(Zu));return Wt(e,Q,i,t,s)}),$g=Gt(function(e,t){return Wt(e,qe,i,i,i,t)});function Bg(e,t){if(typeof e!="function")throw new ct(h);return t=t===i?t:Y(t),K(e,t)}function jg(e,t){if(typeof e!="function")throw new ct(h);return t=t==null?0:Fe(Y(t),0),K(function(s){var a=s[t],c=hn(s,0,t);return a&&un(c,a),Ze(e,this,c)})}function Wg(e,t,s){var a=!0,c=!0;if(typeof e!="function")throw new ct(h);return Ae(s)&&(a="leading"in s?!!s.leading:a,c="trailing"in s?!!s.trailing:c),Ku(e,t,{leading:a,maxWait:t,trailing:c})}function Gg(e){return zu(e,1)}function Vg(e,t){return fa(Qs(t),e)}function qg(){if(!arguments.length)return[];var e=arguments[0];return H(e)?e:[e]}function Jg(e){return ft(e,M)}function zg(e,t){return t=typeof t=="function"?t:i,ft(e,M,t)}function Hg(e){return ft(e,D|M)}function Qg(e,t){return t=typeof t=="function"?t:i,ft(e,D|M,t)}function Yg(e,t){return t==null||Bo(e,t,Pe(t))}function It(e,t){return e===t||e!==e&&t!==t}var Xg=Ir(Us),Kg=Ir(function(e,t){return e>=t}),Mn=Jo(function(){return arguments}())?Jo:function(e){return Ie(e)&&pe.call(e,"callee")&&!Lo.call(e,"callee")},H=_.isArray,Zg=po?et(po):od;function ze(e){return e!=null&&Pr(e.length)&&!qt(e)}function be(e){return Ie(e)&&ze(e)}function em(e){return e===!0||e===!1||Ie(e)&&We(e)==Sn}var gn=hp||wa,tm=ho?et(ho):ud;function nm(e){return Ie(e)&&e.nodeType===1&&!Fi(e)}function im(e){if(e==null)return!0;if(ze(e)&&(H(e)||typeof e=="string"||typeof e.splice=="function"||gn(e)||si(e)||Mn(e)))return!e.length;var t=Be(e);if(t==Xe||t==Ke)return!e.size;if(Ci(e))return!Bs(e).length;for(var s in e)if(pe.call(e,s))return!1;return!0}function rm(e,t){return Ni(e,t)}function sm(e,t,s){s=typeof s=="function"?s:i;var a=s?s(e,t):i;return a===i?Ni(e,t,i,s):!!a}function pa(e){if(!Ie(e))return!1;var t=We(e);return t==Vn||t==rs||typeof e.message=="string"&&typeof e.name=="string"&&!Fi(e)}function am(e){return typeof e=="number"&&Do(e)}function qt(e){if(!Ae(e))return!1;var t=We(e);return t==qn||t==zi||t==is||t==Hi}function ec(e){return typeof e=="number"&&e==Y(e)}function Pr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=wt}function Ae(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Ie(e){return e!=null&&typeof e=="object"}var tc=go?et(go):ld;function om(e,t){return e===t||$s(e,t,na(t))}function um(e,t,s){return s=typeof s=="function"?s:i,$s(e,t,na(t),s)}function cm(e){return nc(e)&&e!=+e}function lm(e){if(zd(e))throw new z(f);return zo(e)}function fm(e){return e===null}function pm(e){return e==null}function nc(e){return typeof e=="number"||Ie(e)&&We(e)==In}function Fi(e){if(!Ie(e)||We(e)!=Et)return!1;var t=ur(e);if(t===null)return!0;var s=pe.call(t,"constructor")&&t.constructor;return typeof s=="function"&&s instanceof s&&rr.call(s)==up}var da=mo?et(mo):fd;function dm(e){return ec(e)&&e>=-wt&&e<=wt}var ic=yo?et(yo):pd;function kr(e){return typeof e=="string"||!H(e)&&Ie(e)&&We(e)==bn}function nt(e){return typeof e=="symbol"||Ie(e)&&We(e)==Jn}var si=vo?et(vo):dd;function hm(e){return e===i}function gm(e){return Ie(e)&&Be(e)==sn}function mm(e){return Ie(e)&&We(e)==os}var ym=Ir(js),vm=Ir(function(e,t){return e<=t});function rc(e){if(!e)return[];if(ze(e))return kr(e)?St(e):Je(e);if(xi&&e[xi])return Yf(e[xi]());var t=Be(e),s=t==Xe?Ns:t==Ke?tr:ai;return s(e)}function Jt(e){if(!e)return e===0?e:0;if(e=ht(e),e===Ct||e===-Ct){var t=e<0?-1:1;return t*Zr}return e===e?e:0}function Y(e){var t=Jt(e),s=t%1;return t===t?s?t-s:t:0}function sc(e){return e?Dn(Y(e),0,at):0}function ht(e){if(typeof e=="number")return e;if(nt(e))return Wn;if(Ae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=So(e);var s=Kl.test(e);return s||ef.test(e)?Ff(e.slice(2),s?2:8):Xl.test(e)?Wn:+e}function ac(e){return Dt(e,He(e))}function _m(e){return e?Dn(Y(e),-wt,wt):e===0?e:0}function le(e){return e==null?"":tt(e)}var xm=ni(function(e,t){if(Ci(t)||ze(t)){Dt(t,Pe(t),e);return}for(var s in t)pe.call(t,s)&&Ai(e,s,t[s])}),oc=ni(function(e,t){Dt(t,He(t),e)}),Ur=ni(function(e,t,s,a){Dt(t,He(t),e,a)}),Tm=ni(function(e,t,s,a){Dt(t,Pe(t),e,a)}),wm=Gt(Ds);function Em(e,t){var s=ti(e);return t==null?s:$o(s,t)}var Sm=K(function(e,t){e=ye(e);var s=-1,a=t.length,c=a>2?t[2]:i;for(c&&Ge(t[0],t[1],c)&&(a=1);++s<a;)for(var p=t[s],d=He(p),g=-1,y=d.length;++g<y;){var E=d[g],S=e[E];(S===i||It(S,Kn[E])&&!pe.call(e,E))&&(e[E]=p[E])}return e}),Am=K(function(e){return e.push(i,Su),Ze(uc,i,e)});function Im(e,t){return xo(e,j(t,3),Ft)}function bm(e,t){return xo(e,j(t,3),ks)}function Nm(e,t){return e==null?e:Ps(e,j(t,3),He)}function Om(e,t){return e==null?e:Vo(e,j(t,3),He)}function Rm(e,t){return e&&Ft(e,j(t,3))}function Cm(e,t){return e&&ks(e,j(t,3))}function Lm(e){return e==null?[]:vr(e,Pe(e))}function Fm(e){return e==null?[]:vr(e,He(e))}function ha(e,t,s){var a=e==null?i:Pn(e,t);return a===i?s:a}function Dm(e,t){return e!=null&&bu(e,t,id)}function ga(e,t){return e!=null&&bu(e,t,rd)}var Pm=_u(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=sr.call(t)),e[t]=s},ya(Qe)),km=_u(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=sr.call(t)),pe.call(e,t)?e[t].push(s):e[t]=[s]},j),Um=K(bi);function Pe(e){return ze(e)?Uo(e):Bs(e)}function He(e){return ze(e)?Uo(e,!0):hd(e)}function Mm(e,t){var s={};return t=j(t,3),Ft(e,function(a,c,p){jt(s,t(a,c,p),a)}),s}function $m(e,t){var s={};return t=j(t,3),Ft(e,function(a,c,p){jt(s,c,t(a,c,p))}),s}var Bm=ni(function(e,t,s){_r(e,t,s)}),uc=ni(function(e,t,s,a){_r(e,t,s,a)}),jm=Gt(function(e,t){var s={};if(e==null)return s;var a=!1;t=Ee(t,function(p){return p=dn(p,e),a||(a=p.length>1),p}),Dt(e,ea(e),s),a&&(s=ft(s,D|P|M,Pd));for(var c=t.length;c--;)Js(s,t[c]);return s});function Wm(e,t){return cc(e,Dr(j(t)))}var Gm=Gt(function(e,t){return e==null?{}:md(e,t)});function cc(e,t){if(e==null)return{};var s=Ee(ea(e),function(a){return[a]});return t=j(t),eu(e,s,function(a,c){return t(a,c[0])})}function Vm(e,t,s){t=dn(t,e);var a=-1,c=t.length;for(c||(c=1,e=i);++a<c;){var p=e==null?i:e[Pt(t[a])];p===i&&(a=c,p=s),e=qt(p)?p.call(e):p}return e}function qm(e,t,s){return e==null?e:Oi(e,t,s)}function Jm(e,t,s,a){return a=typeof a=="function"?a:i,e==null?e:Oi(e,t,s,a)}var lc=wu(Pe),fc=wu(He);function zm(e,t,s){var a=H(e),c=a||gn(e)||si(e);if(t=j(t,4),s==null){var p=e&&e.constructor;c?s=a?new p:[]:Ae(e)?s=qt(p)?ti(ur(e)):{}:s={}}return(c?ut:Ft)(e,function(d,g,y){return t(s,d,g,y)}),s}function Hm(e,t){return e==null?!0:Js(e,t)}function Qm(e,t,s){return e==null?e:su(e,t,Qs(s))}function Ym(e,t,s,a){return a=typeof a=="function"?a:i,e==null?e:su(e,t,Qs(s),a)}function ai(e){return e==null?[]:bs(e,Pe(e))}function Xm(e){return e==null?[]:bs(e,He(e))}function Km(e,t,s){return s===i&&(s=t,t=i),s!==i&&(s=ht(s),s=s===s?s:0),t!==i&&(t=ht(t),t=t===t?t:0),Dn(ht(e),t,s)}function Zm(e,t,s){return t=Jt(t),s===i?(s=t,t=0):s=Jt(s),e=ht(e),sd(e,t,s)}function e0(e,t,s){if(s&&typeof s!="boolean"&&Ge(e,t,s)&&(t=s=i),s===i&&(typeof t=="boolean"?(s=t,t=i):typeof e=="boolean"&&(s=e,e=i)),e===i&&t===i?(e=0,t=1):(e=Jt(e),t===i?(t=e,e=0):t=Jt(t)),e>t){var a=e;e=t,t=a}if(s||e%1||t%1){var c=Po();return $e(e+c*(t-e+Lf("1e-"+((c+"").length-1))),t)}return Gs(e,t)}var t0=ii(function(e,t,s){return t=t.toLowerCase(),e+(s?pc(t):t)});function pc(e){return ma(le(e).toLowerCase())}function dc(e){return e=le(e),e&&e.replace(nf,qf).replace(wf,"")}function n0(e,t,s){e=le(e),t=tt(t);var a=e.length;s=s===i?a:Dn(Y(s),0,a);var c=s;return s-=t.length,s>=0&&e.slice(s,c)==t}function i0(e){return e=le(e),e&&kl.test(e)?e.replace(Ga,Jf):e}function r0(e){return e=le(e),e&&Wl.test(e)?e.replace(fs,"\\$&"):e}var s0=ii(function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}),a0=ii(function(e,t,s){return e+(s?" ":"")+t.toLowerCase()}),o0=mu("toLowerCase");function u0(e,t,s){e=le(e),t=Y(t);var a=t?Yn(e):0;if(!t||a>=t)return e;var c=(t-a)/2;return Ar(pr(c),s)+e+Ar(fr(c),s)}function c0(e,t,s){e=le(e),t=Y(t);var a=t?Yn(e):0;return t&&a<t?e+Ar(t-a,s):e}function l0(e,t,s){e=le(e),t=Y(t);var a=t?Yn(e):0;return t&&a<t?Ar(t-a,s)+e:e}function f0(e,t,s){return s||t==null?t=0:t&&(t=+t),vp(le(e).replace(ps,""),t||0)}function p0(e,t,s){return(s?Ge(e,t,s):t===i)?t=1:t=Y(t),Vs(le(e),t)}function d0(){var e=arguments,t=le(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var h0=ii(function(e,t,s){return e+(s?"_":"")+t.toLowerCase()});function g0(e,t,s){return s&&typeof s!="number"&&Ge(e,t,s)&&(t=s=i),s=s===i?at:s>>>0,s?(e=le(e),e&&(typeof t=="string"||t!=null&&!da(t))&&(t=tt(t),!t&&Qn(e))?hn(St(e),0,s):e.split(t,s)):[]}var m0=ii(function(e,t,s){return e+(s?" ":"")+ma(t)});function y0(e,t,s){return e=le(e),s=s==null?0:Dn(Y(s),0,e.length),t=tt(t),e.slice(s,s+t.length)==t}function v0(e,t,s){var a=l.templateSettings;s&&Ge(e,t,s)&&(t=i),e=le(e),t=Ur({},t,a,Eu);var c=Ur({},t.imports,a.imports,Eu),p=Pe(c),d=bs(c,p),g,y,E=0,S=t.interpolate||Yi,b="__p += '",C=Os((t.escape||Yi).source+"|"+S.source+"|"+(S===Va?Yl:Yi).source+"|"+(t.evaluate||Yi).source+"|$","g"),U="//# sourceURL="+(pe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++bf+"]")+`
381
- `;e.replace(C,function(V,Z,ie,it,Ve,rt){return ie||(ie=it),b+=e.slice(E,rt).replace(rf,zf),Z&&(g=!0,b+=`' +
382
- __e(`+Z+`) +
383
- '`),Ve&&(y=!0,b+=`';
384
- `+Ve+`;
385
- __p += '`),ie&&(b+=`' +
386
- ((__t = (`+ie+`)) == null ? '' : __t) +
387
- '`),E=rt+V.length,V}),b+=`';
388
- `;var G=pe.call(t,"variable")&&t.variable;if(!G)b=`with (obj) {
389
- `+b+`
211
+ `)}function Df(e){return U(e)||on(e)||!!(xa&&e&&e[xa])}function _t(e,t){var n=typeof e;return t=t??et,!!t&&(n=="number"||n!="symbol"&&Yu.test(e))&&e>-1&&e%1==0&&e<t}function Ee(e,t,n){if(!ce(n))return!1;var r=typeof t;return(r=="number"?Ie(n)&&_t(t,n.length):r=="string"&&t in n)?it(n[t],e):!1}function is(e,t){if(U(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||$e(e)?!0:Mu.test(e)||!Lu.test(e)||t!=null&&e in te(t)}function $f(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ss(e){var t=Ur(e),n=o[t];if(typeof n!="function"||!(t in q.prototype))return!1;if(e===n)return!0;var r=ts(n);return!!r&&e===r[0]}function Bf(e){return!!va&&va in e}var kf=hr?wt:Ss;function Kn(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||_n;return e===n}function _o(e){return e===e&&!ce(e)}function wo(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==i||e in te(n))}}function jf(e){var t=jr(e,function(r){return n.size===P&&n.clear(),r}),n=t.cache;return t}function qf(e,t){var n=e[1],r=t[1],s=n|r,u=s<(pe|Le|se),l=r==se&&n==Te||r==se&&n==qe&&e[7].length<=t[8]||r==(se|qe)&&t[7].length<=t[8]&&n==Te;if(!(u||l))return e;r&pe&&(e[2]=t[2],s|=n&pe?0:Tt);var h=t[3];if(h){var d=e[3];e[3]=d?eo(d,h,t[4]):h,e[4]=d?Nt(e[3],J):t[4]}return h=t[5],h&&(d=e[5],e[5]=d?to(d,h,t[6]):h,e[6]=d?Nt(e[5],J):t[6]),h=t[7],h&&(e[7]=h),r&se&&(e[8]=e[8]==null?t[8]:xe(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=s,e}function Gf(e){var t=[];if(e!=null)for(var n in te(e))t.push(n);return t}function Hf(e){return dr.call(e)}function yo(e,t,n){return t=me(t===i?e.length-1:t,0),function(){for(var r=arguments,s=-1,u=me(r.length-t,0),l=m(u);++s<u;)l[s]=r[t+s];s=-1;for(var h=m(t+1);++s<t;)h[s]=r[s];return h[t]=n(l),Ue(e,this,h)}}function xo(e,t){return t.length<2?e:rn(e,Xe(t,0,-1))}function Kf(e,t){for(var n=e.length,r=xe(t.length,n),s=Fe(e);r--;){var u=t[r];e[r]=_t(u,n)?s[u]:i}return e}function as(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var So=bo(Ga),zn=al||function(e,t){return we.setTimeout(e,t)},os=bo(gf);function Ao(e,t,n){var r=t+"";return os(e,Wf(r,zf(Mf(r),n)))}function bo(e){var t=0,n=0;return function(){var r=ll(),s=Ft-(r-n);if(n=r,s>0){if(++t>=ht)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Dr(e,t){var n=-1,r=e.length,s=r-1;for(t=t===i?r:t;++n<t;){var u=qi(n,s),l=e[u];e[u]=e[n],e[n]=l}return e.length=t,e}var Eo=jf(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Nu,function(n,r,s,u){t.push(s?u.replace(qu,"$1"):r||n)}),t});function lt(e){if(typeof e=="string"||$e(e))return e;var t=e+"";return t=="0"&&1/e==-at?"-0":t}function an(e){if(e!=null){try{return pr.call(e)}catch{}try{return e+""}catch{}}return""}function zf(e,t){return ze(ni,function(n){var r="_."+n[0];t&n[1]&&!ur(e,r)&&e.push(r)}),e.sort()}function Co(e){if(e instanceof q)return e.clone();var t=new Ye(e.__wrapped__,e.__chain__);return t.__actions__=Fe(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Jf(e,t,n){(n?Ee(e,t,n):t===i)?t=1:t=me(D(t),0);var r=e==null?0:e.length;if(!r||t<1)return[];for(var s=0,u=0,l=m(yr(r/t));s<r;)l[u++]=Xe(e,s,s+=t);return l}function Yf(e){for(var t=-1,n=e==null?0:e.length,r=0,s=[];++t<n;){var u=e[t];u&&(s[r++]=u)}return s}function Zf(){var e=arguments.length;if(!e)return[];for(var t=m(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Mt(U(n)?Fe(n):[n],ye(t,1))}var Xf=B(function(e,t){return fe(e)?kn(e,ye(t,1,fe,!0)):[]}),Qf=B(function(e,t){var n=Qe(t);return fe(n)&&(n=i),fe(e)?kn(e,ye(t,1,fe,!0),R(n,2)):[]}),Vf=B(function(e,t){var n=Qe(t);return fe(n)&&(n=i),fe(e)?kn(e,ye(t,1,fe,!0),i,n):[]});function eh(e,t,n){var r=e==null?0:e.length;return r?(t=n||t===i?1:D(t),Xe(e,t<0?0:t,r)):[]}function th(e,t,n){var r=e==null?0:e.length;return r?(t=n||t===i?1:D(t),t=r-t,Xe(e,0,t<0?0:t)):[]}function nh(e,t){return e&&e.length?Rr(e,R(t,3),!0,!0):[]}function rh(e,t){return e&&e.length?Rr(e,R(t,3),!0):[]}function ih(e,t,n,r){var s=e==null?0:e.length;return s?(n&&typeof n!="number"&&Ee(e,t,n)&&(n=0,r=s),Yl(e,t,n,r)):[]}function To(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var s=n==null?0:D(n);return s<0&&(s=me(r+s,0)),cr(e,R(t,3),s)}function Fo(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var s=r-1;return n!==i&&(s=D(n),s=n<0?me(r+s,0):xe(s,r-1)),cr(e,R(t,3),s,!0)}function Io(e){var t=e==null?0:e.length;return t?ye(e,1):[]}function sh(e){var t=e==null?0:e.length;return t?ye(e,at):[]}function ah(e,t){var n=e==null?0:e.length;return n?(t=t===i?1:D(t),ye(e,t)):[]}function oh(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var s=e[t];r[s[0]]=s[1]}return r}function Ro(e){return e&&e.length?e[0]:i}function uh(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var s=n==null?0:D(n);return s<0&&(s=me(r+s,0)),dn(e,t,s)}function ch(e){var t=e==null?0:e.length;return t?Xe(e,0,-1):[]}var lh=B(function(e){var t=oe(e,Ji);return t.length&&t[0]===e[0]?Di(t):[]}),fh=B(function(e){var t=Qe(e),n=oe(e,Ji);return t===Qe(n)?t=i:n.pop(),n.length&&n[0]===e[0]?Di(n,R(t,2)):[]}),hh=B(function(e){var t=Qe(e),n=oe(e,Ji);return t=typeof t=="function"?t:i,t&&n.pop(),n.length&&n[0]===e[0]?Di(n,i,t):[]});function ph(e,t){return e==null?"":ul.call(e,t)}function Qe(e){var t=e==null?0:e.length;return t?e[t-1]:i}function dh(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var s=r;return n!==i&&(s=D(n),s=s<0?me(r+s,0):xe(s,r-1)),t===t?Kc(e,t,s):cr(e,ca,s,!0)}function gh(e,t){return e&&e.length?Ba(e,D(t)):i}var mh=B(Po);function Po(e,t){return e&&e.length&&t&&t.length?ji(e,t):e}function vh(e,t,n){return e&&e.length&&t&&t.length?ji(e,t,R(n,2)):e}function _h(e,t,n){return e&&e.length&&t&&t.length?ji(e,t,i,n):e}var wh=vt(function(e,t){var n=e==null?0:e.length,r=Mi(e,t);return qa(e,oe(t,function(s){return _t(s,n)?+s:s}).sort(Va)),r});function yh(e,t){var n=[];if(!(e&&e.length))return n;var r=-1,s=[],u=e.length;for(t=R(t,3);++r<u;){var l=e[r];t(l,r,e)&&(n.push(l),s.push(r))}return qa(e,s),n}function us(e){return e==null?e:hl.call(e)}function xh(e,t,n){var r=e==null?0:e.length;return r?(n&&typeof n!="number"&&Ee(e,t,n)?(t=0,n=r):(t=t==null?0:D(t),n=n===i?r:D(n)),Xe(e,t,n)):[]}function Sh(e,t){return Ir(e,t)}function Ah(e,t,n){return Hi(e,t,R(n,2))}function bh(e,t){var n=e==null?0:e.length;if(n){var r=Ir(e,t);if(r<n&&it(e[r],t))return r}return-1}function Eh(e,t){return Ir(e,t,!0)}function Ch(e,t,n){return Hi(e,t,R(n,2),!0)}function Th(e,t){var n=e==null?0:e.length;if(n){var r=Ir(e,t,!0)-1;if(it(e[r],t))return r}return-1}function Fh(e){return e&&e.length?Ha(e):[]}function Ih(e,t){return e&&e.length?Ha(e,R(t,2)):[]}function Rh(e){var t=e==null?0:e.length;return t?Xe(e,1,t):[]}function Ph(e,t,n){return e&&e.length?(t=n||t===i?1:D(t),Xe(e,0,t<0?0:t)):[]}function Oh(e,t,n){var r=e==null?0:e.length;return r?(t=n||t===i?1:D(t),t=r-t,Xe(e,t<0?0:t,r)):[]}function Lh(e,t){return e&&e.length?Rr(e,R(t,3),!1,!0):[]}function Mh(e,t){return e&&e.length?Rr(e,R(t,3)):[]}var Nh=B(function(e){return Dt(ye(e,1,fe,!0))}),Uh=B(function(e){var t=Qe(e);return fe(t)&&(t=i),Dt(ye(e,1,fe,!0),R(t,2))}),Wh=B(function(e){var t=Qe(e);return t=typeof t=="function"?t:i,Dt(ye(e,1,fe,!0),i,t)});function Dh(e){return e&&e.length?Dt(e):[]}function $h(e,t){return e&&e.length?Dt(e,R(t,2)):[]}function Bh(e,t){return t=typeof t=="function"?t:i,e&&e.length?Dt(e,i,t):[]}function cs(e){if(!(e&&e.length))return[];var t=0;return e=Lt(e,function(n){if(fe(n))return t=me(n.length,t),!0}),Ci(t,function(n){return oe(e,Ai(n))})}function Oo(e,t){if(!(e&&e.length))return[];var n=cs(e);return t==null?n:oe(n,function(r){return Ue(t,i,r)})}var kh=B(function(e,t){return fe(e)?kn(e,t):[]}),jh=B(function(e){return zi(Lt(e,fe))}),qh=B(function(e){var t=Qe(e);return fe(t)&&(t=i),zi(Lt(e,fe),R(t,2))}),Gh=B(function(e){var t=Qe(e);return t=typeof t=="function"?t:i,zi(Lt(e,fe),i,t)}),Hh=B(cs);function Kh(e,t){return Ya(e||[],t||[],Bn)}function zh(e,t){return Ya(e||[],t||[],Gn)}var Jh=B(function(e){var t=e.length,n=t>1?e[t-1]:i;return n=typeof n=="function"?(e.pop(),n):i,Oo(e,n)});function Lo(e){var t=o(e);return t.__chain__=!0,t}function Yh(e,t){return t(e),e}function $r(e,t){return t(e)}var Zh=vt(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,s=function(u){return Mi(u,e)};return t>1||this.__actions__.length||!(r instanceof q)||!_t(n)?this.thru(s):(r=r.slice(n,+n+(t?1:0)),r.__actions__.push({func:$r,args:[s],thisArg:i}),new Ye(r,this.__chain__).thru(function(u){return t&&!u.length&&u.push(i),u}))});function Xh(){return Lo(this)}function Qh(){return new Ye(this.value(),this.__chain__)}function Vh(){this.__values__===i&&(this.__values__=zo(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function ep(){return this}function tp(e){for(var t,n=this;n instanceof br;){var r=Co(n);r.__index__=0,r.__values__=i,t?s.__wrapped__=r:t=r;var s=r;n=n.__wrapped__}return s.__wrapped__=e,t}function np(){var e=this.__wrapped__;if(e instanceof q){var t=e;return this.__actions__.length&&(t=new q(this)),t=t.reverse(),t.__actions__.push({func:$r,args:[us],thisArg:i}),new Ye(t,this.__chain__)}return this.thru(us)}function rp(){return Ja(this.__wrapped__,this.__actions__)}var ip=Pr(function(e,t,n){Q.call(e,n)?++e[n]:gt(e,n,1)});function sp(e,t,n){var r=U(e)?oa:Jl;return n&&Ee(e,t,n)&&(t=i),r(e,R(t,3))}function ap(e,t){var n=U(e)?Lt:Pa;return n(e,R(t,3))}var op=so(To),up=so(Fo);function cp(e,t){return ye(Br(e,t),1)}function lp(e,t){return ye(Br(e,t),at)}function fp(e,t,n){return n=n===i?1:D(n),ye(Br(e,t),n)}function Mo(e,t){var n=U(e)?ze:Wt;return n(e,R(t,3))}function No(e,t){var n=U(e)?Ic:Ra;return n(e,R(t,3))}var hp=Pr(function(e,t,n){Q.call(e,n)?e[n].push(t):gt(e,n,[t])});function pp(e,t,n,r){e=Ie(e)?e:Cn(e),n=n&&!r?D(n):0;var s=e.length;return n<0&&(n=me(s+n,0)),Hr(e)?n<=s&&e.indexOf(t,n)>-1:!!s&&dn(e,t,n)>-1}var dp=B(function(e,t,n){var r=-1,s=typeof t=="function",u=Ie(e)?m(e.length):[];return Wt(e,function(l){u[++r]=s?Ue(t,l,n):jn(l,t,n)}),u}),gp=Pr(function(e,t,n){gt(e,n,t)});function Br(e,t){var n=U(e)?oe:Wa;return n(e,R(t,3))}function mp(e,t,n,r){return e==null?[]:(U(t)||(t=t==null?[]:[t]),n=r?i:n,U(n)||(n=n==null?[]:[n]),ka(e,t,n))}var vp=Pr(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});function _p(e,t,n){var r=U(e)?xi:fa,s=arguments.length<3;return r(e,R(t,4),n,s,Wt)}function wp(e,t,n){var r=U(e)?Rc:fa,s=arguments.length<3;return r(e,R(t,4),n,s,Ra)}function yp(e,t){var n=U(e)?Lt:Pa;return n(e,qr(R(t,3)))}function xp(e){var t=U(e)?Ca:pf;return t(e)}function Sp(e,t,n){(n?Ee(e,t,n):t===i)?t=1:t=D(t);var r=U(e)?ql:df;return r(e,t)}function Ap(e){var t=U(e)?Gl:mf;return t(e)}function bp(e){if(e==null)return 0;if(Ie(e))return Hr(e)?mn(e):e.length;var t=Se(e);return t==Me||t==Ne?e.size:Bi(e).length}function Ep(e,t,n){var r=U(e)?Si:vf;return n&&Ee(e,t,n)&&(t=i),r(e,R(t,3))}var Cp=B(function(e,t){if(e==null)return[];var n=t.length;return n>1&&Ee(e,t[0],t[1])?t=[]:n>2&&Ee(t[0],t[1],t[2])&&(t=[t[0]]),ka(e,ye(t,1),[])}),kr=sl||function(){return we.Date.now()};function Tp(e,t){if(typeof t!="function")throw new Je(S);return e=D(e),function(){if(--e<1)return t.apply(this,arguments)}}function Uo(e,t,n){return t=n?i:t,t=e&&t==null?e.length:t,mt(e,se,i,i,i,i,t)}function Wo(e,t){var n;if(typeof t!="function")throw new Je(S);return e=D(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var ls=B(function(e,t,n){var r=pe;if(n.length){var s=Nt(n,bn(ls));r|=Z}return mt(e,r,t,n,s)}),Do=B(function(e,t,n){var r=pe|Le;if(n.length){var s=Nt(n,bn(Do));r|=Z}return mt(t,r,e,n,s)});function $o(e,t,n){t=n?i:t;var r=mt(e,Te,i,i,i,i,i,t);return r.placeholder=$o.placeholder,r}function Bo(e,t,n){t=n?i:t;var r=mt(e,F,i,i,i,i,i,t);return r.placeholder=Bo.placeholder,r}function ko(e,t,n){var r,s,u,l,h,d,w=0,y=!1,x=!1,E=!0;if(typeof e!="function")throw new Je(S);t=Ve(t)||0,ce(n)&&(y=!!n.leading,x="maxWait"in n,u=x?me(Ve(n.maxWait)||0,t):u,E="trailing"in n?!!n.trailing:E);function T(he){var st=r,xt=s;return r=s=i,w=he,l=e.apply(xt,st),l}function L(he){return w=he,h=zn(j,t),y?T(he):l}function $(he){var st=he-d,xt=he-w,au=t-st;return x?xe(au,u-xt):au}function M(he){var st=he-d,xt=he-w;return d===i||st>=t||st<0||x&&xt>=u}function j(){var he=kr();if(M(he))return H(he);h=zn(j,$(he))}function H(he){return h=i,E&&r?T(he):(r=s=i,l)}function Be(){h!==i&&Za(h),w=0,r=d=s=h=i}function Ce(){return h===i?l:H(kr())}function ke(){var he=kr(),st=M(he);if(r=arguments,s=this,d=he,st){if(h===i)return L(d);if(x)return Za(h),h=zn(j,t),T(d)}return h===i&&(h=zn(j,t)),l}return ke.cancel=Be,ke.flush=Ce,ke}var Fp=B(function(e,t){return Ia(e,1,t)}),Ip=B(function(e,t,n){return Ia(e,Ve(t)||0,n)});function Rp(e){return mt(e,ne)}function jr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new Je(S);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],u=n.cache;if(u.has(s))return u.get(s);var l=e.apply(this,r);return n.cache=u.set(s,l)||u,l};return n.cache=new(jr.Cache||dt),n}jr.Cache=dt;function qr(e){if(typeof e!="function")throw new Je(S);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Pp(e){return Wo(2,e)}var Op=_f(function(e,t){t=t.length==1&&U(t[0])?oe(t[0],We(R())):oe(ye(t,1),We(R()));var n=t.length;return B(function(r){for(var s=-1,u=xe(r.length,n);++s<u;)r[s]=t[s].call(this,r[s]);return Ue(e,this,r)})}),fs=B(function(e,t){var n=Nt(t,bn(fs));return mt(e,Z,i,t,n)}),jo=B(function(e,t){var n=Nt(t,bn(jo));return mt(e,z,i,t,n)}),Lp=vt(function(e,t){return mt(e,qe,i,i,i,t)});function Mp(e,t){if(typeof e!="function")throw new Je(S);return t=t===i?t:D(t),B(e,t)}function Np(e,t){if(typeof e!="function")throw new Je(S);return t=t==null?0:me(D(t),0),B(function(n){var r=n[t],s=Bt(n,0,t);return r&&Mt(s,r),Ue(e,this,s)})}function Up(e,t,n){var r=!0,s=!0;if(typeof e!="function")throw new Je(S);return ce(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),ko(e,t,{leading:r,maxWait:t,trailing:s})}function Wp(e){return Uo(e,1)}function Dp(e,t){return fs(Yi(t),e)}function $p(){if(!arguments.length)return[];var e=arguments[0];return U(e)?e:[e]}function Bp(e){return Ze(e,k)}function kp(e,t){return t=typeof t=="function"?t:i,Ze(e,k,t)}function jp(e){return Ze(e,G|k)}function qp(e,t){return t=typeof t=="function"?t:i,Ze(e,G|k,t)}function Gp(e,t){return t==null||Fa(e,t,_e(t))}function it(e,t){return e===t||e!==e&&t!==t}var Hp=Nr(Wi),Kp=Nr(function(e,t){return e>=t}),on=Ma(function(){return arguments}())?Ma:function(e){return le(e)&&Q.call(e,"callee")&&!ya.call(e,"callee")},U=m.isArray,zp=ta?We(ta):ef;function Ie(e){return e!=null&&Gr(e.length)&&!wt(e)}function fe(e){return le(e)&&Ie(e)}function Jp(e){return e===!0||e===!1||le(e)&&be(e)==Kt}var kt=ol||Ss,Yp=na?We(na):tf;function Zp(e){return le(e)&&e.nodeType===1&&!Jn(e)}function Xp(e){if(e==null)return!0;if(Ie(e)&&(U(e)||typeof e=="string"||typeof e.splice=="function"||kt(e)||En(e)||on(e)))return!e.length;var t=Se(e);if(t==Me||t==Ne)return!e.size;if(Kn(e))return!Bi(e).length;for(var n in e)if(Q.call(e,n))return!1;return!0}function Qp(e,t){return qn(e,t)}function Vp(e,t,n){n=typeof n=="function"?n:i;var r=n?n(e,t):i;return r===i?qn(e,t,i,n):!!r}function hs(e){if(!le(e))return!1;var t=be(e);return t==ln||t==ii||typeof e.message=="string"&&typeof e.name=="string"&&!Jn(e)}function ed(e){return typeof e=="number"&&Sa(e)}function wt(e){if(!ce(e))return!1;var t=be(e);return t==fn||t==nr||t==ri||t==rr}function qo(e){return typeof e=="number"&&e==D(e)}function Gr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=et}function ce(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function le(e){return e!=null&&typeof e=="object"}var Go=ra?We(ra):rf;function td(e,t){return e===t||$i(e,t,ns(t))}function nd(e,t,n){return n=typeof n=="function"?n:i,$i(e,t,ns(t),n)}function rd(e){return Ho(e)&&e!=+e}function id(e){if(kf(e))throw new N(_);return Na(e)}function sd(e){return e===null}function ad(e){return e==null}function Ho(e){return typeof e=="number"||le(e)&&be(e)==Jt}function Jn(e){if(!le(e)||be(e)!=tt)return!1;var t=vr(e);if(t===null)return!0;var n=Q.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&pr.call(n)==tl}var ps=ia?We(ia):sf;function od(e){return qo(e)&&e>=-et&&e<=et}var Ko=sa?We(sa):af;function Hr(e){return typeof e=="string"||!U(e)&&le(e)&&be(e)==Yt}function $e(e){return typeof e=="symbol"||le(e)&&be(e)==hn}var En=aa?We(aa):of;function ud(e){return e===i}function cd(e){return le(e)&&Se(e)==Pt}function ld(e){return le(e)&&be(e)==oi}var fd=Nr(ki),hd=Nr(function(e,t){return e<=t});function zo(e){if(!e)return[];if(Ie(e))return Hr(e)?nt(e):Fe(e);if(Nn&&e[Nn])return qc(e[Nn]());var t=Se(e),n=t==Me?Fi:t==Ne?lr:Cn;return n(e)}function yt(e){if(!e)return e===0?e:0;if(e=Ve(e),e===at||e===-at){var t=e<0?-1:1;return t*Vr}return e===e?e:0}function D(e){var t=yt(e),n=t%1;return t===t?n?t-n:t:0}function Jo(e){return e?nn(D(e),0,He):0}function Ve(e){if(typeof e=="number")return e;if($e(e))return un;if(ce(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ce(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=ha(e);var n=Ku.test(e);return n||Ju.test(e)?Cc(e.slice(2),n?2:8):Hu.test(e)?un:+e}function Yo(e){return ct(e,Re(e))}function pd(e){return e?nn(D(e),-et,et):e===0?e:0}function X(e){return e==null?"":De(e)}var dd=Sn(function(e,t){if(Kn(t)||Ie(t)){ct(t,_e(t),e);return}for(var n in t)Q.call(t,n)&&Bn(e,n,t[n])}),Zo=Sn(function(e,t){ct(t,Re(t),e)}),Kr=Sn(function(e,t,n,r){ct(t,Re(t),e,r)}),gd=Sn(function(e,t,n,r){ct(t,_e(t),e,r)}),md=vt(Mi);function vd(e,t){var n=xn(e);return t==null?n:Ta(n,t)}var _d=B(function(e,t){e=te(e);var n=-1,r=t.length,s=r>2?t[2]:i;for(s&&Ee(t[0],t[1],s)&&(r=1);++n<r;)for(var u=t[n],l=Re(u),h=-1,d=l.length;++h<d;){var w=l[h],y=e[w];(y===i||it(y,_n[w])&&!Q.call(e,w))&&(e[w]=u[w])}return e}),wd=B(function(e){return e.push(i,ho),Ue(Xo,i,e)});function yd(e,t){return ua(e,R(t,3),ut)}function xd(e,t){return ua(e,R(t,3),Ui)}function Sd(e,t){return e==null?e:Ni(e,R(t,3),Re)}function Ad(e,t){return e==null?e:Oa(e,R(t,3),Re)}function bd(e,t){return e&&ut(e,R(t,3))}function Ed(e,t){return e&&Ui(e,R(t,3))}function Cd(e){return e==null?[]:Tr(e,_e(e))}function Td(e){return e==null?[]:Tr(e,Re(e))}function ds(e,t,n){var r=e==null?i:rn(e,t);return r===i?n:r}function Fd(e,t){return e!=null&&mo(e,t,Zl)}function gs(e,t){return e!=null&&mo(e,t,Xl)}var Id=oo(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=dr.call(t)),e[t]=n},vs(Pe)),Rd=oo(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=dr.call(t)),Q.call(e,t)?e[t].push(n):e[t]=[n]},R),Pd=B(jn);function _e(e){return Ie(e)?Ea(e):Bi(e)}function Re(e){return Ie(e)?Ea(e,!0):uf(e)}function Od(e,t){var n={};return t=R(t,3),ut(e,function(r,s,u){gt(n,t(r,s,u),r)}),n}function Ld(e,t){var n={};return t=R(t,3),ut(e,function(r,s,u){gt(n,s,t(r,s,u))}),n}var Md=Sn(function(e,t,n){Fr(e,t,n)}),Xo=Sn(function(e,t,n,r){Fr(e,t,n,r)}),Nd=vt(function(e,t){var n={};if(e==null)return n;var r=!1;t=oe(t,function(u){return u=$t(u,e),r||(r=u.length>1),u}),ct(e,es(e),n),r&&(n=Ze(n,G|K|k,If));for(var s=t.length;s--;)Ki(n,t[s]);return n});function Ud(e,t){return Qo(e,qr(R(t)))}var Wd=vt(function(e,t){return e==null?{}:lf(e,t)});function Qo(e,t){if(e==null)return{};var n=oe(es(e),function(r){return[r]});return t=R(t),ja(e,n,function(r,s){return t(r,s[0])})}function Dd(e,t,n){t=$t(t,e);var r=-1,s=t.length;for(s||(s=1,e=i);++r<s;){var u=e==null?i:e[lt(t[r])];u===i&&(r=s,u=n),e=wt(u)?u.call(e):u}return e}function $d(e,t,n){return e==null?e:Gn(e,t,n)}function Bd(e,t,n,r){return r=typeof r=="function"?r:i,e==null?e:Gn(e,t,n,r)}var Vo=lo(_e),eu=lo(Re);function kd(e,t,n){var r=U(e),s=r||kt(e)||En(e);if(t=R(t,4),n==null){var u=e&&e.constructor;s?n=r?new u:[]:ce(e)?n=wt(u)?xn(vr(e)):{}:n={}}return(s?ze:ut)(e,function(l,h,d){return t(n,l,h,d)}),n}function jd(e,t){return e==null?!0:Ki(e,t)}function qd(e,t,n){return e==null?e:za(e,t,Yi(n))}function Gd(e,t,n,r){return r=typeof r=="function"?r:i,e==null?e:za(e,t,Yi(n),r)}function Cn(e){return e==null?[]:Ti(e,_e(e))}function Hd(e){return e==null?[]:Ti(e,Re(e))}function Kd(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=Ve(n),n=n===n?n:0),t!==i&&(t=Ve(t),t=t===t?t:0),nn(Ve(e),t,n)}function zd(e,t,n){return t=yt(t),n===i?(n=t,t=0):n=yt(n),e=Ve(e),Ql(e,t,n)}function Jd(e,t,n){if(n&&typeof n!="boolean"&&Ee(e,t,n)&&(t=n=i),n===i&&(typeof t=="boolean"?(n=t,t=i):typeof e=="boolean"&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=yt(e),t===i?(t=e,e=0):t=yt(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var s=Aa();return xe(e+s*(t-e+Ec("1e-"+((s+"").length-1))),t)}return qi(e,t)}var Yd=An(function(e,t,n){return t=t.toLowerCase(),e+(n?tu(t):t)});function tu(e){return ms(X(e).toLowerCase())}function nu(e){return e=X(e),e&&e.replace(Zu,Dc).replace(gc,"")}function Zd(e,t,n){e=X(e),t=De(t);var r=e.length;n=n===i?r:nn(D(n),0,r);var s=n;return n-=t.length,n>=0&&e.slice(n,s)==t}function Xd(e){return e=X(e),e&&Ru.test(e)?e.replace(Os,$c):e}function Qd(e){return e=X(e),e&&Uu.test(e)?e.replace(fi,"\\$&"):e}var Vd=An(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),eg=An(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),tg=io("toLowerCase");function ng(e,t,n){e=X(e),t=D(t);var r=t?mn(e):0;if(!t||r>=t)return e;var s=(t-r)/2;return Mr(xr(s),n)+e+Mr(yr(s),n)}function rg(e,t,n){e=X(e),t=D(t);var r=t?mn(e):0;return t&&r<t?e+Mr(t-r,n):e}function ig(e,t,n){e=X(e),t=D(t);var r=t?mn(e):0;return t&&r<t?Mr(t-r,n)+e:e}function sg(e,t,n){return n||t==null?t=0:t&&(t=+t),fl(X(e).replace(hi,""),t||0)}function ag(e,t,n){return(n?Ee(e,t,n):t===i)?t=1:t=D(t),Gi(X(e),t)}function og(){var e=arguments,t=X(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var ug=An(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});function cg(e,t,n){return n&&typeof n!="number"&&Ee(e,t,n)&&(t=n=i),n=n===i?He:n>>>0,n?(e=X(e),e&&(typeof t=="string"||t!=null&&!ps(t))&&(t=De(t),!t&&gn(e))?Bt(nt(e),0,n):e.split(t,n)):[]}var lg=An(function(e,t,n){return e+(n?" ":"")+ms(t)});function fg(e,t,n){return e=X(e),n=n==null?0:nn(D(n),0,e.length),t=De(t),e.slice(n,n+t.length)==t}function hg(e,t,n){var r=o.templateSettings;n&&Ee(e,t,n)&&(t=i),e=X(e),t=Kr({},t,r,fo);var s=Kr({},t.imports,r.imports,fo),u=_e(s),l=Ti(s,u),h,d,w=0,y=t.interpolate||sr,x="__p += '",E=Ii((t.escape||sr).source+"|"+y.source+"|"+(y===Ls?Gu:sr).source+"|"+(t.evaluate||sr).source+"|$","g"),T="//# sourceURL="+(Q.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++yc+"]")+`
212
+ `;e.replace(E,function(M,j,H,Be,Ce,ke){return H||(H=Be),x+=e.slice(w,ke).replace(Xu,Bc),j&&(h=!0,x+=`' +
213
+ __e(`+j+`) +
214
+ '`),Ce&&(d=!0,x+=`';
215
+ `+Ce+`;
216
+ __p += '`),H&&(x+=`' +
217
+ ((__t = (`+H+`)) == null ? '' : __t) +
218
+ '`),w=ke+M.length,M}),x+=`';
219
+ `;var L=Q.call(t,"variable")&&t.variable;if(!L)x=`with (obj) {
220
+ `+x+`
390
221
  }
391
- `;else if(Hl.test(G))throw new z(v);b=(y?b.replace(Ll,""):b).replace(Fl,"$1").replace(Dl,"$1;"),b="function("+(G||"obj")+`) {
392
- `+(G?"":`obj || (obj = {});
393
- `)+"var __t, __p = ''"+(g?", __e = _.escape":"")+(y?`, __j = Array.prototype.join;
222
+ `;else if(ju.test(L))throw new N(A);x=(d?x.replace(Cu,""):x).replace(Tu,"$1").replace(Fu,"$1;"),x="function("+(L||"obj")+`) {
223
+ `+(L?"":`obj || (obj = {});
224
+ `)+"var __t, __p = ''"+(h?", __e = _.escape":"")+(d?`, __j = Array.prototype.join;
394
225
  function print() { __p += __j.call(arguments, '') }
395
226
  `:`;
396
- `)+b+`return __p
397
- }`;var X=gc(function(){return oe(p,U+"return "+b).apply(i,d)});if(X.source=b,pa(X))throw X;return X}function _0(e){return le(e).toLowerCase()}function x0(e){return le(e).toUpperCase()}function T0(e,t,s){if(e=le(e),e&&(s||t===i))return So(e);if(!e||!(t=tt(t)))return e;var a=St(e),c=St(t),p=Ao(a,c),d=Io(a,c)+1;return hn(a,p,d).join("")}function w0(e,t,s){if(e=le(e),e&&(s||t===i))return e.slice(0,No(e)+1);if(!e||!(t=tt(t)))return e;var a=St(e),c=Io(a,St(t))+1;return hn(a,0,c).join("")}function E0(e,t,s){if(e=le(e),e&&(s||t===i))return e.replace(ps,"");if(!e||!(t=tt(t)))return e;var a=St(e),c=Ao(a,St(t));return hn(a,c).join("")}function S0(e,t){var s=q,a=Se;if(Ae(t)){var c="separator"in t?t.separator:c;s="length"in t?Y(t.length):s,a="omission"in t?tt(t.omission):a}e=le(e);var p=e.length;if(Qn(e)){var d=St(e);p=d.length}if(s>=p)return e;var g=s-Yn(a);if(g<1)return a;var y=d?hn(d,0,g).join(""):e.slice(0,g);if(c===i)return y+a;if(d&&(g+=y.length-g),da(c)){if(e.slice(g).search(c)){var E,S=y;for(c.global||(c=Os(c.source,le(qa.exec(c))+"g")),c.lastIndex=0;E=c.exec(S);)var b=E.index;y=y.slice(0,b===i?g:b)}}else if(e.indexOf(tt(c),g)!=g){var C=y.lastIndexOf(c);C>-1&&(y=y.slice(0,C))}return y+a}function A0(e){return e=le(e),e&&Pl.test(e)?e.replace(Wa,ep):e}var I0=ii(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),ma=mu("toUpperCase");function hc(e,t,s){return e=le(e),t=s?i:t,t===i?Qf(e)?ip(e):Bf(e):e.match(t)||[]}var gc=K(function(e,t){try{return Ze(e,i,t)}catch(s){return pa(s)?s:new z(s)}}),b0=Gt(function(e,t){return ut(t,function(s){s=Pt(s),jt(e,s,la(e[s],e))}),e});function N0(e){var t=e==null?0:e.length,s=j();return e=t?Ee(e,function(a){if(typeof a[1]!="function")throw new ct(h);return[s(a[0]),a[1]]}):[],K(function(a){for(var c=-1;++c<t;){var p=e[c];if(Ze(p[0],this,a))return Ze(p[1],this,a)}})}function O0(e){return ed(ft(e,D))}function ya(e){return function(){return e}}function R0(e,t){return e==null||e!==e?t:e}var C0=vu(),L0=vu(!0);function Qe(e){return e}function va(e){return Ho(typeof e=="function"?e:ft(e,D))}function F0(e){return Yo(ft(e,D))}function D0(e,t){return Xo(e,ft(t,D))}var P0=K(function(e,t){return function(s){return bi(s,e,t)}}),k0=K(function(e,t){return function(s){return bi(e,s,t)}});function _a(e,t,s){var a=Pe(t),c=vr(t,a);s==null&&!(Ae(t)&&(c.length||!a.length))&&(s=t,t=e,e=this,c=vr(t,Pe(t)));var p=!(Ae(s)&&"chain"in s)||!!s.chain,d=qt(e);return ut(c,function(g){var y=t[g];e[g]=y,d&&(e.prototype[g]=function(){var E=this.__chain__;if(p||E){var S=e(this.__wrapped__),b=S.__actions__=Je(this.__actions__);return b.push({func:y,args:arguments,thisArg:e}),S.__chain__=E,S}return y.apply(e,un([this.value()],arguments))})}),e}function U0(){return Ue._===this&&(Ue._=cp),this}function xa(){}function M0(e){return e=Y(e),K(function(t){return Ko(t,e)})}var $0=Xs(Ee),B0=Xs(_o),j0=Xs(ws);function mc(e){return ra(e)?Es(Pt(e)):yd(e)}function W0(e){return function(t){return e==null?i:Pn(e,t)}}var G0=xu(),V0=xu(!0);function Ta(){return[]}function wa(){return!1}function q0(){return{}}function J0(){return""}function z0(){return!0}function H0(e,t){if(e=Y(e),e<1||e>wt)return[];var s=at,a=$e(e,at);t=j(t),e-=at;for(var c=Is(a,t);++s<e;)t(s);return c}function Q0(e){return H(e)?Ee(e,Pt):nt(e)?[e]:Je(ku(le(e)))}function Y0(e){var t=++op;return le(e)+t}var X0=Sr(function(e,t){return e+t},0),K0=Ks("ceil"),Z0=Sr(function(e,t){return e/t},1),ey=Ks("floor");function ty(e){return e&&e.length?yr(e,Qe,Us):i}function ny(e,t){return e&&e.length?yr(e,j(t,2),Us):i}function iy(e){return wo(e,Qe)}function ry(e,t){return wo(e,j(t,2))}function sy(e){return e&&e.length?yr(e,Qe,js):i}function ay(e,t){return e&&e.length?yr(e,j(t,2),js):i}var oy=Sr(function(e,t){return e*t},1),uy=Ks("round"),cy=Sr(function(e,t){return e-t},0);function ly(e){return e&&e.length?As(e,Qe):0}function fy(e,t){return e&&e.length?As(e,j(t,2)):0}return l.after=Fg,l.ary=zu,l.assign=xm,l.assignIn=oc,l.assignInWith=Ur,l.assignWith=Tm,l.at=wm,l.before=Hu,l.bind=la,l.bindAll=b0,l.bindKey=Qu,l.castArray=qg,l.chain=Vu,l.chunk=eh,l.compact=th,l.concat=nh,l.cond=N0,l.conforms=O0,l.constant=ya,l.countBy=lg,l.create=Em,l.curry=Yu,l.curryRight=Xu,l.debounce=Ku,l.defaults=Sm,l.defaultsDeep=Am,l.defer=Dg,l.delay=Pg,l.difference=ih,l.differenceBy=rh,l.differenceWith=sh,l.drop=ah,l.dropRight=oh,l.dropRightWhile=uh,l.dropWhile=ch,l.fill=lh,l.filter=pg,l.flatMap=gg,l.flatMapDeep=mg,l.flatMapDepth=yg,l.flatten=Bu,l.flattenDeep=fh,l.flattenDepth=ph,l.flip=kg,l.flow=C0,l.flowRight=L0,l.fromPairs=dh,l.functions=Lm,l.functionsIn=Fm,l.groupBy=vg,l.initial=gh,l.intersection=mh,l.intersectionBy=yh,l.intersectionWith=vh,l.invert=Pm,l.invertBy=km,l.invokeMap=xg,l.iteratee=va,l.keyBy=Tg,l.keys=Pe,l.keysIn=He,l.map=Cr,l.mapKeys=Mm,l.mapValues=$m,l.matches=F0,l.matchesProperty=D0,l.memoize=Fr,l.merge=Bm,l.mergeWith=uc,l.method=P0,l.methodOf=k0,l.mixin=_a,l.negate=Dr,l.nthArg=M0,l.omit=jm,l.omitBy=Wm,l.once=Ug,l.orderBy=wg,l.over=$0,l.overArgs=Mg,l.overEvery=B0,l.overSome=j0,l.partial=fa,l.partialRight=Zu,l.partition=Eg,l.pick=Gm,l.pickBy=cc,l.property=mc,l.propertyOf=W0,l.pull=wh,l.pullAll=Wu,l.pullAllBy=Eh,l.pullAllWith=Sh,l.pullAt=Ah,l.range=G0,l.rangeRight=V0,l.rearg=$g,l.reject=Ig,l.remove=Ih,l.rest=Bg,l.reverse=ua,l.sampleSize=Ng,l.set=qm,l.setWith=Jm,l.shuffle=Og,l.slice=bh,l.sortBy=Lg,l.sortedUniq=Dh,l.sortedUniqBy=Ph,l.split=g0,l.spread=jg,l.tail=kh,l.take=Uh,l.takeRight=Mh,l.takeRightWhile=$h,l.takeWhile=Bh,l.tap=tg,l.throttle=Wg,l.thru=Rr,l.toArray=rc,l.toPairs=lc,l.toPairsIn=fc,l.toPath=Q0,l.toPlainObject=ac,l.transform=zm,l.unary=Gg,l.union=jh,l.unionBy=Wh,l.unionWith=Gh,l.uniq=Vh,l.uniqBy=qh,l.uniqWith=Jh,l.unset=Hm,l.unzip=ca,l.unzipWith=Gu,l.update=Qm,l.updateWith=Ym,l.values=ai,l.valuesIn=Xm,l.without=zh,l.words=hc,l.wrap=Vg,l.xor=Hh,l.xorBy=Qh,l.xorWith=Yh,l.zip=Xh,l.zipObject=Kh,l.zipObjectDeep=Zh,l.zipWith=eg,l.entries=lc,l.entriesIn=fc,l.extend=oc,l.extendWith=Ur,_a(l,l),l.add=X0,l.attempt=gc,l.camelCase=t0,l.capitalize=pc,l.ceil=K0,l.clamp=Km,l.clone=Jg,l.cloneDeep=Hg,l.cloneDeepWith=Qg,l.cloneWith=zg,l.conformsTo=Yg,l.deburr=dc,l.defaultTo=R0,l.divide=Z0,l.endsWith=n0,l.eq=It,l.escape=i0,l.escapeRegExp=r0,l.every=fg,l.find=dg,l.findIndex=Mu,l.findKey=Im,l.findLast=hg,l.findLastIndex=$u,l.findLastKey=bm,l.floor=ey,l.forEach=qu,l.forEachRight=Ju,l.forIn=Nm,l.forInRight=Om,l.forOwn=Rm,l.forOwnRight=Cm,l.get=ha,l.gt=Xg,l.gte=Kg,l.has=Dm,l.hasIn=ga,l.head=ju,l.identity=Qe,l.includes=_g,l.indexOf=hh,l.inRange=Zm,l.invoke=Um,l.isArguments=Mn,l.isArray=H,l.isArrayBuffer=Zg,l.isArrayLike=ze,l.isArrayLikeObject=be,l.isBoolean=em,l.isBuffer=gn,l.isDate=tm,l.isElement=nm,l.isEmpty=im,l.isEqual=rm,l.isEqualWith=sm,l.isError=pa,l.isFinite=am,l.isFunction=qt,l.isInteger=ec,l.isLength=Pr,l.isMap=tc,l.isMatch=om,l.isMatchWith=um,l.isNaN=cm,l.isNative=lm,l.isNil=pm,l.isNull=fm,l.isNumber=nc,l.isObject=Ae,l.isObjectLike=Ie,l.isPlainObject=Fi,l.isRegExp=da,l.isSafeInteger=dm,l.isSet=ic,l.isString=kr,l.isSymbol=nt,l.isTypedArray=si,l.isUndefined=hm,l.isWeakMap=gm,l.isWeakSet=mm,l.join=_h,l.kebabCase=s0,l.last=dt,l.lastIndexOf=xh,l.lowerCase=a0,l.lowerFirst=o0,l.lt=ym,l.lte=vm,l.max=ty,l.maxBy=ny,l.mean=iy,l.meanBy=ry,l.min=sy,l.minBy=ay,l.stubArray=Ta,l.stubFalse=wa,l.stubObject=q0,l.stubString=J0,l.stubTrue=z0,l.multiply=oy,l.nth=Th,l.noConflict=U0,l.noop=xa,l.now=Lr,l.pad=u0,l.padEnd=c0,l.padStart=l0,l.parseInt=f0,l.random=e0,l.reduce=Sg,l.reduceRight=Ag,l.repeat=p0,l.replace=d0,l.result=Vm,l.round=uy,l.runInContext=m,l.sample=bg,l.size=Rg,l.snakeCase=h0,l.some=Cg,l.sortedIndex=Nh,l.sortedIndexBy=Oh,l.sortedIndexOf=Rh,l.sortedLastIndex=Ch,l.sortedLastIndexBy=Lh,l.sortedLastIndexOf=Fh,l.startCase=m0,l.startsWith=y0,l.subtract=cy,l.sum=ly,l.sumBy=fy,l.template=v0,l.times=H0,l.toFinite=Jt,l.toInteger=Y,l.toLength=sc,l.toLower=_0,l.toNumber=ht,l.toSafeInteger=_m,l.toString=le,l.toUpper=x0,l.trim=T0,l.trimEnd=w0,l.trimStart=E0,l.truncate=S0,l.unescape=A0,l.uniqueId=Y0,l.upperCase=I0,l.upperFirst=ma,l.each=qu,l.eachRight=Ju,l.first=ju,_a(l,function(){var e={};return Ft(l,function(t,s){pe.call(l.prototype,s)||(e[s]=t)}),e}(),{chain:!1}),l.VERSION=o,ut(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),ut(["drop","take"],function(e,t){te.prototype[e]=function(s){s=s===i?1:Fe(Y(s),0);var a=this.__filtered__&&!t?new te(this):this.clone();return a.__filtered__?a.__takeCount__=$e(s,a.__takeCount__):a.__views__.push({size:$e(s,at),type:e+(a.__dir__<0?"Right":"")}),a},te.prototype[e+"Right"]=function(s){return this.reverse()[e](s).reverse()}}),ut(["filter","map","takeWhile"],function(e,t){var s=t+1,a=s==Vi||s==Ji;te.prototype[e]=function(c){var p=this.clone();return p.__iteratees__.push({iteratee:j(c,3),type:s}),p.__filtered__=p.__filtered__||a,p}}),ut(["head","last"],function(e,t){var s="take"+(t?"Right":"");te.prototype[e]=function(){return this[s](1).value()[0]}}),ut(["initial","tail"],function(e,t){var s="drop"+(t?"":"Right");te.prototype[e]=function(){return this.__filtered__?new te(this):this[s](1)}}),te.prototype.compact=function(){return this.filter(Qe)},te.prototype.find=function(e){return this.filter(e).head()},te.prototype.findLast=function(e){return this.reverse().find(e)},te.prototype.invokeMap=K(function(e,t){return typeof e=="function"?new te(this):this.map(function(s){return bi(s,e,t)})}),te.prototype.reject=function(e){return this.filter(Dr(j(e)))},te.prototype.slice=function(e,t){e=Y(e);var s=this;return s.__filtered__&&(e>0||t<0)?new te(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==i&&(t=Y(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},te.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},te.prototype.toArray=function(){return this.take(at)},Ft(te.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),a=/^(?:head|last)$/.test(t),c=l[a?"take"+(t=="last"?"Right":""):t],p=a||/^find/.test(t);c&&(l.prototype[t]=function(){var d=this.__wrapped__,g=a?[1]:arguments,y=d instanceof te,E=g[0],S=y||H(d),b=function(Z){var ie=c.apply(l,un([Z],g));return a&&C?ie[0]:ie};S&&s&&typeof E=="function"&&E.length!=1&&(y=S=!1);var C=this.__chain__,U=!!this.__actions__.length,G=p&&!C,X=y&&!U;if(!p&&S){d=X?d:new te(this);var V=e.apply(d,g);return V.__actions__.push({func:Rr,args:[b],thisArg:i}),new lt(V,C)}return G&&X?e.apply(this,g):(V=this.thru(b),G?a?V.value()[0]:V.value():V)})}),ut(["pop","push","shift","sort","splice","unshift"],function(e){var t=nr[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",a=/^(?:pop|shift)$/.test(e);l.prototype[e]=function(){var c=arguments;if(a&&!this.__chain__){var p=this.value();return t.apply(H(p)?p:[],c)}return this[s](function(d){return t.apply(H(d)?d:[],c)})}}),Ft(te.prototype,function(e,t){var s=l[t];if(s){var a=s.name+"";pe.call(ei,a)||(ei[a]=[]),ei[a].push({name:t,func:s})}}),ei[Er(i,me).name]=[{name:"wrapper",func:i}],te.prototype.clone=Ap,te.prototype.reverse=Ip,te.prototype.value=bp,l.prototype.at=ng,l.prototype.chain=ig,l.prototype.commit=rg,l.prototype.next=sg,l.prototype.plant=og,l.prototype.reverse=ug,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=cg,l.prototype.first=l.prototype.head,xi&&(l.prototype[xi]=ag),l},Xn=rp();Rn?((Rn.exports=Xn)._=Xn,vs._=Xn):Ue._=Xn}).call(Mx)}(Mi,Mi.exports)),Mi.exports}var Bx=$x();const Oa=n=>{const r=Bx.startCase(n).toLowerCase();return r.charAt(0).toUpperCase()+r.slice(1)},jx=({data:n})=>`import { defineObject } from 'twenty-sdk';
227
+ `)+x+`return __p
228
+ }`;var $=iu(function(){return Y(u,T+"return "+x).apply(i,l)});if($.source=x,hs($))throw $;return $}function pg(e){return X(e).toLowerCase()}function dg(e){return X(e).toUpperCase()}function gg(e,t,n){if(e=X(e),e&&(n||t===i))return ha(e);if(!e||!(t=De(t)))return e;var r=nt(e),s=nt(t),u=pa(r,s),l=da(r,s)+1;return Bt(r,u,l).join("")}function mg(e,t,n){if(e=X(e),e&&(n||t===i))return e.slice(0,ma(e)+1);if(!e||!(t=De(t)))return e;var r=nt(e),s=da(r,nt(t))+1;return Bt(r,0,s).join("")}function vg(e,t,n){if(e=X(e),e&&(n||t===i))return e.replace(hi,"");if(!e||!(t=De(t)))return e;var r=nt(e),s=pa(r,nt(t));return Bt(r,s).join("")}function _g(e,t){var n=Ht,r=Ge;if(ce(t)){var s="separator"in t?t.separator:s;n="length"in t?D(t.length):n,r="omission"in t?De(t.omission):r}e=X(e);var u=e.length;if(gn(e)){var l=nt(e);u=l.length}if(n>=u)return e;var h=n-mn(r);if(h<1)return r;var d=l?Bt(l,0,h).join(""):e.slice(0,h);if(s===i)return d+r;if(l&&(h+=d.length-h),ps(s)){if(e.slice(h).search(s)){var w,y=d;for(s.global||(s=Ii(s.source,X(Ms.exec(s))+"g")),s.lastIndex=0;w=s.exec(y);)var x=w.index;d=d.slice(0,x===i?h:x)}}else if(e.indexOf(De(s),h)!=h){var E=d.lastIndexOf(s);E>-1&&(d=d.slice(0,E))}return d+r}function wg(e){return e=X(e),e&&Iu.test(e)?e.replace(Ps,zc):e}var yg=An(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),ms=io("toUpperCase");function ru(e,t,n){return e=X(e),t=n?i:t,t===i?jc(e)?Zc(e):Lc(e):e.match(t)||[]}var iu=B(function(e,t){try{return Ue(e,i,t)}catch(n){return hs(n)?n:new N(n)}}),xg=vt(function(e,t){return ze(t,function(n){n=lt(n),gt(e,n,ls(e[n],e))}),e});function Sg(e){var t=e==null?0:e.length,n=R();return e=t?oe(e,function(r){if(typeof r[1]!="function")throw new Je(S);return[n(r[0]),r[1]]}):[],B(function(r){for(var s=-1;++s<t;){var u=e[s];if(Ue(u[0],this,r))return Ue(u[1],this,r)}})}function Ag(e){return zl(Ze(e,G))}function vs(e){return function(){return e}}function bg(e,t){return e==null||e!==e?t:e}var Eg=ao(),Cg=ao(!0);function Pe(e){return e}function _s(e){return Ua(typeof e=="function"?e:Ze(e,G))}function Tg(e){return Da(Ze(e,G))}function Fg(e,t){return $a(e,Ze(t,G))}var Ig=B(function(e,t){return function(n){return jn(n,e,t)}}),Rg=B(function(e,t){return function(n){return jn(e,n,t)}});function ws(e,t,n){var r=_e(t),s=Tr(t,r);n==null&&!(ce(t)&&(s.length||!r.length))&&(n=t,t=e,e=this,s=Tr(t,_e(t)));var u=!(ce(n)&&"chain"in n)||!!n.chain,l=wt(e);return ze(s,function(h){var d=t[h];e[h]=d,l&&(e.prototype[h]=function(){var w=this.__chain__;if(u||w){var y=e(this.__wrapped__),x=y.__actions__=Fe(this.__actions__);return x.push({func:d,args:arguments,thisArg:e}),y.__chain__=w,y}return d.apply(e,Mt([this.value()],arguments))})}),e}function Pg(){return we._===this&&(we._=nl),this}function ys(){}function Og(e){return e=D(e),B(function(t){return Ba(t,e)})}var Lg=Xi(oe),Mg=Xi(oa),Ng=Xi(Si);function su(e){return is(e)?Ai(lt(e)):ff(e)}function Ug(e){return function(t){return e==null?i:rn(e,t)}}var Wg=uo(),Dg=uo(!0);function xs(){return[]}function Ss(){return!1}function $g(){return{}}function Bg(){return""}function kg(){return!0}function jg(e,t){if(e=D(e),e<1||e>et)return[];var n=He,r=xe(e,He);t=R(t),e-=He;for(var s=Ci(r,t);++n<e;)t(n);return s}function qg(e){return U(e)?oe(e,lt):$e(e)?[e]:Fe(Eo(X(e)))}function Gg(e){var t=++el;return X(e)+t}var Hg=Lr(function(e,t){return e+t},0),Kg=Qi("ceil"),zg=Lr(function(e,t){return e/t},1),Jg=Qi("floor");function Yg(e){return e&&e.length?Cr(e,Pe,Wi):i}function Zg(e,t){return e&&e.length?Cr(e,R(t,2),Wi):i}function Xg(e){return la(e,Pe)}function Qg(e,t){return la(e,R(t,2))}function Vg(e){return e&&e.length?Cr(e,Pe,ki):i}function em(e,t){return e&&e.length?Cr(e,R(t,2),ki):i}var tm=Lr(function(e,t){return e*t},1),nm=Qi("round"),rm=Lr(function(e,t){return e-t},0);function im(e){return e&&e.length?Ei(e,Pe):0}function sm(e,t){return e&&e.length?Ei(e,R(t,2)):0}return o.after=Tp,o.ary=Uo,o.assign=dd,o.assignIn=Zo,o.assignInWith=Kr,o.assignWith=gd,o.at=md,o.before=Wo,o.bind=ls,o.bindAll=xg,o.bindKey=Do,o.castArray=$p,o.chain=Lo,o.chunk=Jf,o.compact=Yf,o.concat=Zf,o.cond=Sg,o.conforms=Ag,o.constant=vs,o.countBy=ip,o.create=vd,o.curry=$o,o.curryRight=Bo,o.debounce=ko,o.defaults=_d,o.defaultsDeep=wd,o.defer=Fp,o.delay=Ip,o.difference=Xf,o.differenceBy=Qf,o.differenceWith=Vf,o.drop=eh,o.dropRight=th,o.dropRightWhile=nh,o.dropWhile=rh,o.fill=ih,o.filter=ap,o.flatMap=cp,o.flatMapDeep=lp,o.flatMapDepth=fp,o.flatten=Io,o.flattenDeep=sh,o.flattenDepth=ah,o.flip=Rp,o.flow=Eg,o.flowRight=Cg,o.fromPairs=oh,o.functions=Cd,o.functionsIn=Td,o.groupBy=hp,o.initial=ch,o.intersection=lh,o.intersectionBy=fh,o.intersectionWith=hh,o.invert=Id,o.invertBy=Rd,o.invokeMap=dp,o.iteratee=_s,o.keyBy=gp,o.keys=_e,o.keysIn=Re,o.map=Br,o.mapKeys=Od,o.mapValues=Ld,o.matches=Tg,o.matchesProperty=Fg,o.memoize=jr,o.merge=Md,o.mergeWith=Xo,o.method=Ig,o.methodOf=Rg,o.mixin=ws,o.negate=qr,o.nthArg=Og,o.omit=Nd,o.omitBy=Ud,o.once=Pp,o.orderBy=mp,o.over=Lg,o.overArgs=Op,o.overEvery=Mg,o.overSome=Ng,o.partial=fs,o.partialRight=jo,o.partition=vp,o.pick=Wd,o.pickBy=Qo,o.property=su,o.propertyOf=Ug,o.pull=mh,o.pullAll=Po,o.pullAllBy=vh,o.pullAllWith=_h,o.pullAt=wh,o.range=Wg,o.rangeRight=Dg,o.rearg=Lp,o.reject=yp,o.remove=yh,o.rest=Mp,o.reverse=us,o.sampleSize=Sp,o.set=$d,o.setWith=Bd,o.shuffle=Ap,o.slice=xh,o.sortBy=Cp,o.sortedUniq=Fh,o.sortedUniqBy=Ih,o.split=cg,o.spread=Np,o.tail=Rh,o.take=Ph,o.takeRight=Oh,o.takeRightWhile=Lh,o.takeWhile=Mh,o.tap=Yh,o.throttle=Up,o.thru=$r,o.toArray=zo,o.toPairs=Vo,o.toPairsIn=eu,o.toPath=qg,o.toPlainObject=Yo,o.transform=kd,o.unary=Wp,o.union=Nh,o.unionBy=Uh,o.unionWith=Wh,o.uniq=Dh,o.uniqBy=$h,o.uniqWith=Bh,o.unset=jd,o.unzip=cs,o.unzipWith=Oo,o.update=qd,o.updateWith=Gd,o.values=Cn,o.valuesIn=Hd,o.without=kh,o.words=ru,o.wrap=Dp,o.xor=jh,o.xorBy=qh,o.xorWith=Gh,o.zip=Hh,o.zipObject=Kh,o.zipObjectDeep=zh,o.zipWith=Jh,o.entries=Vo,o.entriesIn=eu,o.extend=Zo,o.extendWith=Kr,ws(o,o),o.add=Hg,o.attempt=iu,o.camelCase=Yd,o.capitalize=tu,o.ceil=Kg,o.clamp=Kd,o.clone=Bp,o.cloneDeep=jp,o.cloneDeepWith=qp,o.cloneWith=kp,o.conformsTo=Gp,o.deburr=nu,o.defaultTo=bg,o.divide=zg,o.endsWith=Zd,o.eq=it,o.escape=Xd,o.escapeRegExp=Qd,o.every=sp,o.find=op,o.findIndex=To,o.findKey=yd,o.findLast=up,o.findLastIndex=Fo,o.findLastKey=xd,o.floor=Jg,o.forEach=Mo,o.forEachRight=No,o.forIn=Sd,o.forInRight=Ad,o.forOwn=bd,o.forOwnRight=Ed,o.get=ds,o.gt=Hp,o.gte=Kp,o.has=Fd,o.hasIn=gs,o.head=Ro,o.identity=Pe,o.includes=pp,o.indexOf=uh,o.inRange=zd,o.invoke=Pd,o.isArguments=on,o.isArray=U,o.isArrayBuffer=zp,o.isArrayLike=Ie,o.isArrayLikeObject=fe,o.isBoolean=Jp,o.isBuffer=kt,o.isDate=Yp,o.isElement=Zp,o.isEmpty=Xp,o.isEqual=Qp,o.isEqualWith=Vp,o.isError=hs,o.isFinite=ed,o.isFunction=wt,o.isInteger=qo,o.isLength=Gr,o.isMap=Go,o.isMatch=td,o.isMatchWith=nd,o.isNaN=rd,o.isNative=id,o.isNil=ad,o.isNull=sd,o.isNumber=Ho,o.isObject=ce,o.isObjectLike=le,o.isPlainObject=Jn,o.isRegExp=ps,o.isSafeInteger=od,o.isSet=Ko,o.isString=Hr,o.isSymbol=$e,o.isTypedArray=En,o.isUndefined=ud,o.isWeakMap=cd,o.isWeakSet=ld,o.join=ph,o.kebabCase=Vd,o.last=Qe,o.lastIndexOf=dh,o.lowerCase=eg,o.lowerFirst=tg,o.lt=fd,o.lte=hd,o.max=Yg,o.maxBy=Zg,o.mean=Xg,o.meanBy=Qg,o.min=Vg,o.minBy=em,o.stubArray=xs,o.stubFalse=Ss,o.stubObject=$g,o.stubString=Bg,o.stubTrue=kg,o.multiply=tm,o.nth=gh,o.noConflict=Pg,o.noop=ys,o.now=kr,o.pad=ng,o.padEnd=rg,o.padStart=ig,o.parseInt=sg,o.random=Jd,o.reduce=_p,o.reduceRight=wp,o.repeat=ag,o.replace=og,o.result=Dd,o.round=nm,o.runInContext=p,o.sample=xp,o.size=bp,o.snakeCase=ug,o.some=Ep,o.sortedIndex=Sh,o.sortedIndexBy=Ah,o.sortedIndexOf=bh,o.sortedLastIndex=Eh,o.sortedLastIndexBy=Ch,o.sortedLastIndexOf=Th,o.startCase=lg,o.startsWith=fg,o.subtract=rm,o.sum=im,o.sumBy=sm,o.template=hg,o.times=jg,o.toFinite=yt,o.toInteger=D,o.toLength=Jo,o.toLower=pg,o.toNumber=Ve,o.toSafeInteger=pd,o.toString=X,o.toUpper=dg,o.trim=gg,o.trimEnd=mg,o.trimStart=vg,o.truncate=_g,o.unescape=wg,o.uniqueId=Gg,o.upperCase=yg,o.upperFirst=ms,o.each=Mo,o.eachRight=No,o.first=Ro,ws(o,function(){var e={};return ut(o,function(t,n){Q.call(o.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),o.VERSION=f,ze(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){o[e].placeholder=o}),ze(["drop","take"],function(e,t){q.prototype[e]=function(n){n=n===i?1:me(D(n),0);var r=this.__filtered__&&!t?new q(this):this.clone();return r.__filtered__?r.__takeCount__=xe(n,r.__takeCount__):r.__views__.push({size:xe(n,He),type:e+(r.__dir__<0?"Right":"")}),r},q.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),ze(["filter","map","takeWhile"],function(e,t){var n=t+1,r=n==Vn||n==tr;q.prototype[e]=function(s){var u=this.clone();return u.__iteratees__.push({iteratee:R(s,3),type:n}),u.__filtered__=u.__filtered__||r,u}}),ze(["head","last"],function(e,t){var n="take"+(t?"Right":"");q.prototype[e]=function(){return this[n](1).value()[0]}}),ze(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");q.prototype[e]=function(){return this.__filtered__?new q(this):this[n](1)}}),q.prototype.compact=function(){return this.filter(Pe)},q.prototype.find=function(e){return this.filter(e).head()},q.prototype.findLast=function(e){return this.reverse().find(e)},q.prototype.invokeMap=B(function(e,t){return typeof e=="function"?new q(this):this.map(function(n){return jn(n,e,t)})}),q.prototype.reject=function(e){return this.filter(qr(R(e)))},q.prototype.slice=function(e,t){e=D(e);var n=this;return n.__filtered__&&(e>0||t<0)?new q(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(t=D(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},q.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},q.prototype.toArray=function(){return this.take(He)},ut(q.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),s=o[r?"take"+(t=="last"?"Right":""):t],u=r||/^find/.test(t);s&&(o.prototype[t]=function(){var l=this.__wrapped__,h=r?[1]:arguments,d=l instanceof q,w=h[0],y=d||U(l),x=function(j){var H=s.apply(o,Mt([j],h));return r&&E?H[0]:H};y&&n&&typeof w=="function"&&w.length!=1&&(d=y=!1);var E=this.__chain__,T=!!this.__actions__.length,L=u&&!E,$=d&&!T;if(!u&&y){l=$?l:new q(this);var M=e.apply(l,h);return M.__actions__.push({func:$r,args:[x],thisArg:i}),new Ye(M,E)}return L&&$?e.apply(this,h):(M=this.thru(x),L?r?M.value()[0]:M.value():M)})}),ze(["pop","push","shift","sort","splice","unshift"],function(e){var t=fr[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);o.prototype[e]=function(){var s=arguments;if(r&&!this.__chain__){var u=this.value();return t.apply(U(u)?u:[],s)}return this[n](function(l){return t.apply(U(l)?l:[],s)})}}),ut(q.prototype,function(e,t){var n=o[t];if(n){var r=n.name+"";Q.call(yn,r)||(yn[r]=[]),yn[r].push({name:t,func:n})}}),yn[Or(i,Le).name]=[{name:"wrapper",func:i}],q.prototype.clone=_l,q.prototype.reverse=wl,q.prototype.value=yl,o.prototype.at=Zh,o.prototype.chain=Xh,o.prototype.commit=Qh,o.prototype.next=Vh,o.prototype.plant=tp,o.prototype.reverse=np,o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=rp,o.prototype.first=o.prototype.head,Nn&&(o.prototype[Nn]=ep),o},vn=Xc();Qt?((Qt.exports=vn)._=vn,_i._=vn):we._=vn}).call(av)}(Xn,Xn.exports)),Xn.exports}var uv=ov();const Ts=c=>{const a=uv.startCase(c).toLowerCase();return a.charAt(0).toUpperCase()+a.slice(1)},cv=({data:c})=>`import { defineObject } from 'twenty-sdk';
398
229
 
399
230
  export default defineObject({
400
- universalIdentifier: '${Bi.v4()}',
401
- nameSingular: '${n.nameSingular}',
402
- namePlural: '${n.namePlural}',
403
- labelSingular: '${n.labelSingular}',
404
- labelPlural: '${n.labelPlural}',
231
+ universalIdentifier: '${Qn.v4()}',
232
+ nameSingular: '${c.nameSingular}',
233
+ namePlural: '${c.namePlural}',
234
+ labelSingular: '${c.labelSingular}',
235
+ labelPlural: '${c.labelPlural}',
405
236
  icon: 'IconBox',
406
237
  fields: [
407
238
  // Add your fields here using defineField helper
@@ -414,28 +245,28 @@ export default defineObject({
414
245
  // },
415
246
  ],
416
247
  });
417
- `,Wx=({name:n,universalIdentifier:r=Bi.v4()})=>{const i=fi(n);return`import { defineRole } from 'twenty-sdk';
248
+ `,lv=({name:c,universalIdentifier:a=Qn.v4()})=>{const i=In(c);return`import { defineRole } from 'twenty-sdk';
418
249
 
419
250
  export const ${i.toUpperCase().replace(/-/g,"_")}_ROLE_UNIVERSAL_IDENTIFIER =
420
- '${r}';
251
+ '${a}';
421
252
 
422
253
  export default defineRole({
423
254
  universalIdentifier: ${i.toUpperCase().replace(/-/g,"_")}_ROLE_UNIVERSAL_IDENTIFIER,
424
- label: '${n}',
255
+ label: '${c}',
425
256
  description: 'Add a description for your role',
426
257
  canReadAllObjectRecords: true,
427
258
  canUpdateAllObjectRecords: true,
428
259
  canSoftDeleteAllObjectRecords: true,
429
260
  canDestroyAllObjectRecords: false,
430
261
  });
431
- `},Gx=({data:n})=>{const r=Bi.v4(),i=n.description?`
432
- description: '${n.description}',`:"";return`import { defineField, FieldType } from 'twenty-sdk';
262
+ `},fv=({data:c})=>{const a=Qn.v4(),i=c.description?`
263
+ description: '${c.description}',`:"";return`import { defineField, FieldType } from 'twenty-sdk';
433
264
 
434
265
  export default defineField({
435
- universalIdentifier: '${r}',
436
- name: '${n.name}',
437
- label: '${n.label}',
438
- type: FieldMetadataType.${n.type},
439
- objectUniversalIdentifier: '${n.objectUniversalIdentifier}',${i}
266
+ universalIdentifier: '${a}',
267
+ name: '${c.name}',
268
+ label: '${c.label}',
269
+ type: FieldMetadataType.${c.type},
270
+ objectUniversalIdentifier: '${c.objectUniversalIdentifier}',${i}
440
271
  });
441
- `},Vx="src";class qx{async execute(r,i){try{const o=r??await this.getEntity(),u=this.getFolderName(o),f=i?ge.join(Xt,i):ge.join(Xt,Vx,u);await de.ensureDir(f);const{name:h,file:v}=await this.getEntityData(o),w=ge.join(f,this.getFileName(h,o));if(await de.pathExists(w)){const{overwrite:I}=await this.handleFileExist();if(!I)return}await de.writeFile(w,v),console.log(R.default.green(`✓ Created ${u}:`),R.default.cyan(ge.relative(Xt,w)))}catch(o){console.error(R.default.red("Add new entity failed:"),o instanceof Error?o.message:o),process.exit(1)}}async getEntityData(r){switch(r){case De.Object:{const i=await this.getObjectData(),o=i.nameSingular,u=jx({data:i});return{name:o,file:u}}case De.Field:{const i=await this.getFieldData(),o=i.name,u=Gx({data:i});return{name:o,file:u}}case De.LogicFunction:{const i=await this.getEntityName(r),o=Ux({name:i});return{name:i,file:o}}case De.FrontComponent:{const i=await this.getEntityName(r),o=kx({name:i});return{name:i,file:o}}case De.Role:{const i=await this.getEntityName(r),o=Wx({name:i});return{name:i,file:o}}default:st.ln()}}async getEntity(){const{entity:r}=await Qt.default.prompt([{type:"select",name:"entity",message:"What entity do you want to create?",default:"",choices:Object.values(De)}]);return r}async handleFileExist(){return await Qt.default.prompt([{type:"confirm",name:"overwrite",message:"File already exists. Do you want to overwrite it?",default:!1}])}async getEntityName(r){const{name:i}=await Qt.default.prompt([{type:"input",name:"name",message:`Enter a name for your new ${r}:`,default:"",validate:o=>o.length===0?`${r} name is required`:!0}]);return i}async getFieldData(){return Qt.default.prompt([{type:"input",name:"name",message:"Enter a name for your field:",default:"",validate:r=>!r||r.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"label",message:"Enter a label for your field:",default:r=>Oa(r.name),validate:r=>!r||r.trim().length===0?"Please enter a non empty string":!0},{type:"select",name:"type",message:"Select the field type:",choices:Object.values(st.s),default:st.s.TEXT},{type:"input",name:"objectUniversalIdentifier",message:"Enter the universalIdentifier of the object this field belongs to:",default:"fill-later",validate:r=>!r||r.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"description",message:"Enter a description for your field (optional):",default:""}])}async getObjectData(){return Qt.default.prompt([{type:"input",name:"nameSingular",message:"Enter a name singular for your object (eg: company):",default:"",validate:r=>!r||r.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"namePlural",message:"Enter a name plural for your object (eg: companies):",default:"",validate:(r,i)=>r.trim()===i?.nameSingular.trim()?"Name plural must be different from name singular":!r||r.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"labelSingular",message:"Enter a label singular for your object:",default:r=>Oa(r.nameSingular),validate:r=>!r||r.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"labelPlural",message:"Enter a label plural for your object:",default:r=>Oa(r.namePlural),validate:r=>!r||r.trim().length===0?"Please enter a non empty string":!0}])}getFolderName(r){return`${fi(r)}s`}getFileName(r,i){switch(i){case De.FrontComponent:return`${fi(r)}.tsx`;default:return`${fi(r)}.ts`}}}const Jx=n=>{const r=new bx,i=new Nx,o=new Ox,u=new Rx,f=new Fx;n.command("auth:login").description("Authenticate with Twenty").option("--api-key <key>","API key for authentication").option("--api-url <url>","Twenty API URL").action(async P=>{await i.execute(P)}),n.command("auth:logout").description("Remove authentication credentials").action(async()=>{await o.execute()}),n.command("auth:status").description("Check authentication status").action(async()=>{await u.execute()}),n.command("auth:switch [workspace]").description("Switch the default workspace for authentication").action(async P=>{await f.execute({workspace:P})}),n.command("auth:list").description("List all configured workspaces").action(async()=>{await r.execute()});const h=new wx,v=new Ix,w=new qx,I=new Ax,O=new Lx,D=new Cx;n.command("app:dev [appPath]").description("Watch and sync local application changes").action(async P=>{await h.execute({appPath:Di(P)})}),n.command("app:uninstall [appPath]").description("Uninstall application from Twenty").action(async P=>{try{const M=await v.execute({appPath:Di(P),askForConfirmation:!0});process.exit(M.success?0:1)}catch{process.exit(1)}}),n.command("entity:add [entityType]").option("--path <path>","Path in which the entity should be created.").description(`Add a new entity to your application (${Object.values(De).join("|")})`).action(async(P,M)=>{await w.execute(P,M?.path)}),n.command("app:generate [appPath]").description("Generate Twenty client").action(async P=>{await I.execute(Di(P))}),n.command("function:logs [appPath]").option("-u, --functionUniversalIdentifier <functionUniversalIdentifier>","Only show logs for the function with this universal ID").option("-n, --functionName <functionName>","Only show logs for the function with this name").description("Watch application function logs").action(async(P,M)=>{await O.execute({...M,appPath:Di(P)})}),n.command("function:execute [appPath]").option("-p, --payload <payload>","JSON payload to send to the function","{}").option("-u, --functionUniversalIdentifier <functionUniversalIdentifier>","Universal ID of the function to execute").option("-n, --functionName <functionName>","Name of the function to execute").description("Execute a logic function with a JSON payload").action(async(P,M)=>{!M?.functionUniversalIdentifier&&!M?.functionName&&(console.error(R.default.red("Error: Either --functionName (-n) or --functionUniversalIdentifier (-u) is required.")),process.exit(1)),await D.execute({...M,payload:M?.payload??"{}",appPath:Di(P)})})},zx="0.5.0",Hx={version:zx};Dy.inspect.defaultOptions.depth=10;const mi=new Uc.Command;mi.name("twenty").description("CLI for Twenty application development").version(Hx.version);mi.option("--workspace <name>","Use a specific workspace configuration (overrides the default set by auth:switch)");mi.hook("preAction",async n=>{let i=(n.optsWithGlobals?n.optsWithGlobals():n.opts()).workspace;i||(i=await new je().getDefaultWorkspace()),je.setActiveWorkspace(i),console.log(R.default.gray(`👩‍💻 Workspace - ${je.getActiveWorkspace()}`))});Jx(mi);mi.exitOverride();try{mi.parse()}catch(n){n instanceof Uc.CommanderError&&process.exit(n.exitCode),n instanceof Error&&(console.error(R.default.red("Error:"),n.message),process.exit(1))}
272
+ `},hv="src";class pv{async execute(a,i){try{const f=a??await this.getEntity(),g=this.getFolderName(f),_=i?ie.join(Et,i):ie.join(Et,hv,g);await V.ensureDir(_);const{name:S,file:A}=await this.getEntityData(f),I=ie.join(_,this.getFileName(S,f));if(await V.pathExists(I)){const{overwrite:P}=await this.handleFileExist();if(!P)return}await V.writeFile(I,A),console.log(b.default.green(`✓ Created ${g}:`),b.default.cyan(ie.relative(Et,I)))}catch(f){console.error(b.default.red("Add new entity failed:"),f instanceof Error?f.message:f),process.exit(1)}}async getEntityData(a){switch(a){case ve.Object:{const i=await this.getObjectData(),f=i.nameSingular,g=cv({data:i});return{name:f,file:g}}case ve.Field:{const i=await this.getFieldData(),f=i.name,g=fv({data:i});return{name:f,file:g}}case ve.LogicFunction:{const i=await this.getEntityName(a),f=sv({name:i});return{name:i,file:f}}case ve.FrontComponent:{const i=await this.getEntityName(a),f=iv({name:i});return{name:i,file:f}}case ve.Role:{const i=await this.getEntityName(a),f=lv({name:i});return{name:i,file:f}}default:je.ln()}}async getEntity(){const{entity:a}=await At.default.prompt([{type:"select",name:"entity",message:"What entity do you want to create?",default:"",choices:Object.values(ve)}]);return a}async handleFileExist(){return await At.default.prompt([{type:"confirm",name:"overwrite",message:"File already exists. Do you want to overwrite it?",default:!1}])}async getEntityName(a){const{name:i}=await At.default.prompt([{type:"input",name:"name",message:`Enter a name for your new ${a}:`,default:"",validate:f=>f.length===0?`${a} name is required`:!0}]);return i}async getFieldData(){return At.default.prompt([{type:"input",name:"name",message:"Enter a name for your field:",default:"",validate:a=>!a||a.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"label",message:"Enter a label for your field:",default:a=>Ts(a.name),validate:a=>!a||a.trim().length===0?"Please enter a non empty string":!0},{type:"select",name:"type",message:"Select the field type:",choices:Object.values(je.s),default:je.s.TEXT},{type:"input",name:"objectUniversalIdentifier",message:"Enter the universalIdentifier of the object this field belongs to:",default:"fill-later",validate:a=>!a||a.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"description",message:"Enter a description for your field (optional):",default:""}])}async getObjectData(){return At.default.prompt([{type:"input",name:"nameSingular",message:"Enter a name singular for your object (eg: company):",default:"",validate:a=>!a||a.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"namePlural",message:"Enter a name plural for your object (eg: companies):",default:"",validate:(a,i)=>a.trim()===i?.nameSingular.trim()?"Name plural must be different from name singular":!a||a.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"labelSingular",message:"Enter a label singular for your object:",default:a=>Ts(a.nameSingular),validate:a=>!a||a.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"labelPlural",message:"Enter a label plural for your object:",default:a=>Ts(a.namePlural),validate:a=>!a||a.trim().length===0?"Please enter a non empty string":!0}])}getFolderName(a){return`${In(a)}s`}getFileName(a,i){switch(i){case ve.FrontComponent:return`${In(a)}.tsx`;default:return`${In(a)}.ts`}}}const dv=c=>{const a=new Y0,i=new Z0,f=new X0,g=new Q0,_=new tv;c.command("auth:login").description("Authenticate with Twenty").option("--api-key <key>","API key for authentication").option("--api-url <url>","Twenty API URL").action(async K=>{await i.execute(K)}),c.command("auth:logout").description("Remove authentication credentials").action(async()=>{await f.execute()}),c.command("auth:status").description("Check authentication status").action(async()=>{await g.execute()}),c.command("auth:switch [workspace]").description("Switch the default workspace for authentication").action(async K=>{await _.execute({workspace:K})}),c.command("auth:list").description("List all configured workspaces").action(async()=>{await a.execute()});const S=new G0,A=new J0,I=new pv,P=new z0,J=new ev,G=new V0;c.command("app:dev [appPath]").description("Watch and sync local application changes").action(async K=>{await S.execute({appPath:Yn(K)})}),c.command("app:uninstall [appPath]").description("Uninstall application from Twenty").option("-y, --yes","Skip confirmation prompt").action(async(K,k)=>{try{const ue=await A.execute({appPath:Yn(K),askForConfirmation:!k?.yes});process.exit(ue.success?0:1)}catch{process.exit(1)}}),c.command("entity:add [entityType]").option("--path <path>","Path in which the entity should be created.").description(`Add a new entity to your application (${Object.values(ve).join("|")})`).action(async(K,k)=>{await I.execute(K,k?.path)}),c.command("app:generate [appPath]").description("Generate Twenty client").action(async K=>{await P.execute(Yn(K))}),c.command("function:logs [appPath]").option("-u, --functionUniversalIdentifier <functionUniversalIdentifier>","Only show logs for the function with this universal ID").option("-n, --functionName <functionName>","Only show logs for the function with this name").description("Watch application function logs").action(async(K,k)=>{await J.execute({...k,appPath:Yn(K)})}),c.command("function:execute [appPath]").option("-p, --payload <payload>","JSON payload to send to the function","{}").option("-u, --functionUniversalIdentifier <functionUniversalIdentifier>","Universal ID of the function to execute").option("-n, --functionName <functionName>","Name of the function to execute").description("Execute a logic function with a JSON payload").action(async(K,k)=>{!k?.functionUniversalIdentifier&&!k?.functionName&&(console.error(b.default.red("Error: Either --functionName (-n) or --functionUniversalIdentifier (-u) is required.")),process.exit(1)),await G.execute({...k,payload:k?.payload??"{}",appPath:Yn(K)})})},gv="0.5.2",mv={version:gv};Fm.inspect.defaultOptions.depth=10;const Pn=new vu.Command;Pn.name("twenty").description("CLI for Twenty application development").version(mv.version);Pn.option("--workspace <name>","Use a specific workspace configuration (overrides the default set by auth:switch)");Pn.hook("preAction",async c=>{let i=(c.optsWithGlobals?c.optsWithGlobals():c.opts()).workspace;i||(i=await new Ae().getDefaultWorkspace()),Ae.setActiveWorkspace(i),console.log(b.default.gray(`👩‍💻 Workspace - ${Ae.getActiveWorkspace()}`))});dv(Pn);Pn.exitOverride();try{Pn.parse()}catch(c){c instanceof vu.CommanderError&&process.exit(c.exitCode),c instanceof Error&&(console.error(b.default.red("Error:"),c.message),process.exit(1))}