twenty-sdk 0.4.5 → 0.4.6-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{HtmlTagToRemoteComponent-C4s4D6Eo.mjs → HtmlTagToRemoteComponent-_kOtAcK_.mjs} +9 -15
- package/dist/HtmlTagToRemoteComponent-cjNxtZqX.js +1 -0
- package/dist/cli.cjs +127 -107
- package/dist/cli.mjs +1688 -1665
- package/dist/index.cjs +2 -4
- package/dist/index.mjs +190 -289
- package/dist/sdk/index.d.ts +0 -2
- package/dist/ui/index.cjs +398 -398
- package/dist/ui/index.mjs +52 -53
- package/package.json +25 -5
- package/dist/HtmlTagToRemoteComponent-B0ozyzJD.js +0 -1
- package/dist/sdk/client/index.d.ts +0 -3
- package/dist/sdk/client/twenty-client-options.d.ts +0 -11
- package/dist/sdk/client/twenty-client.d.ts +0 -43
package/dist/cli.cjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
3
|
-
${
|
|
2
|
+
"use strict";var ly=Object.create;var hc=Object.defineProperty;var fy=Object.getOwnPropertyDescriptor;var py=Object.getOwnPropertyNames;var dy=Object.getPrototypeOf,hy=Object.prototype.hasOwnProperty;var gy=(n,r,i,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of py(r))!hy.call(n,u)&&u!==i&&hc(n,u,{get:()=>r[u],enumerable:!(o=fy(r,u))||o.enumerable});return n};var gc=(n,r,i)=>(i=n!=null?ly(dy(n)):{},gy(r||!n||!n.__esModule?hc(i,"default",{value:n,enumerable:!0}):i,n));const ge=require("path"),my=require("chalk"),Fc=require("fs-extra"),yy=require("crypto"),vy=require("node:fs/promises"),Ut=require("./isValidCountryCode-B7MxBtRC-BNPnBggZ.js"),_y=require("@sniptt/guards"),xy=require("lodash.camelcase"),mc=require("./RatingValues-CT-y6O0b-D7JSZAMu.js"),Pt=require("./HtmlTagToRemoteComponent-cjNxtZqX.js"),Ty=require("fs/promises"),wy=require("esbuild"),Ey=require("chokidar"),Sy=require("os"),Ay=require("axios"),Iy=require("fs"),by=require("graphql-sse"),Ny=require("typescript"),Oy=require("module"),Dc=require("fast-glob"),B=require("./jsx-runtime-Bglt9wWZ.js"),Ry=require("@genql/cli"),Cy=require("inquirer"),pi=require("uuid"),Pc=require("commander"),Ly=require("util"),di=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 we=wn(ge),R=di(my),de=wn(Fc),kc=di(yy),Fy=wn(vy),Dy=di(xy),Py=wn(Ty),Uc=wn(wy),Mc=di(Ey),$c=wn(Sy),Mr=di(Ay),yc=wn(Iy),ui=wn(Ny),Ht=di(Cy),Xt=process.env.INIT_CWD||process.cwd(),Pi=n=>n&&!n?.startsWith("/")?ge.join(Xt,n):n,ky=async(n,r,i)=>{const o=new Set(i),u=r.filter(f=>!o.has(f));for(const f of u){const g=f.replace(/\.tsx?$/,".mjs"),v=we.default.join(n,g),w=`${v}.map`;await de.remove(v),await de.remove(w)}},Uy=async({result:n,appPath:r,fileFolder:i,lastChecksums:o,onFileBuilt:u})=>{const f=Object.keys(n.metafile?.outputs??{}).filter(g=>g.endsWith(".mjs"));for(const g of f){const v=we.default.resolve(g),w=we.default.relative(r,v),b=n.metafile?.outputs?.[g]?.entryPoint||"",O=we.default.relative(r,b),D=await de.readFile(v),P=kc.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}))}},My=["react-dom","twenty-sdk","twenty-sdk/*","twenty-shared","twenty-shared/*"],$y=n=>_y.isNonEmptyString(n)?n[0].toUpperCase()+n.slice(1):"",By=n=>$y(Dy.default(n)),jy=n=>typeof n=="object"&&n!==null&&!Array.isArray(n),Wy="RemoteComponents",Gy=()=>{const n=Object.keys(Pt.HTML_TAG_TO_REMOTE_COMPONENT).join("|");return new RegExp(`(<\\/?)\\b(${n})\\b(?=[\\s>\\/>])`,"g")},Vy=Gy(),qy=n=>n.replace(Vy,(r,i,o)=>{const u=Pt.HTML_TAG_TO_REMOTE_COMPONENT[o];return Ut.Tr(u)?`${i}${Wy}.${u}`:r}),Jy=/import\s*\{\s*defineFrontComponent\s*\}\s*from\s*['"][^'"]+['"];?\n?/g,vc=/export\s+default\s+defineFrontComponent\s*\(\s*\{[^}]*component\s*:\s*(\w+)[^}]*\}\s*\)\s*;?/s,zy=n=>{let r=n.replace(Jy,"");const i=r.match(vc);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(vc,`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 Fy.readFile(r,"utf8"),o=qy(i);return{contents:`var RemoteComponents = globalThis.RemoteComponents;
|
|
3
|
+
${zy(o)}`,loader:"tsx"}}catch(i){return{errors:[{text:`Failed to transform front component: ${i instanceof Error?i.message:String(i)}`,location:{file:r}}]}}})}},Hy=/^(\w+)\s+as\s+(\w+)$/,Yy=n=>{const r=n.trim(),i=r.match(Hy);if(Ut.Tr(i)){const[,o,u]=i;return{originalName:o,aliasName:u}}return{originalName:r,aliasName:r}},_c=/import\s+(?:(\w+)\s*,?\s*)?(?:\{([^}]*)\})?\s*from\s*['"]react['"];?/g,Xy=/^react(\/jsx-runtime)?$/,Ky=`
|
|
4
4
|
export var jsx = globalThis.jsx;
|
|
5
5
|
export var jsxs = globalThis.jsxs;
|
|
6
6
|
export var Fragment = globalThis.React.Fragment;
|
|
7
|
-
`.trim(),
|
|
8
|
-
`)},
|
|
9
|
-
`,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
|
|
10
|
-
`)}function
|
|
7
|
+
`.trim(),Zy=n=>{const r=new Set;let i;for(;Ut.Tr(i=_c.exec(n));){const o=i[1],u=i[2];o&&r.add("default"),u&&u.split(",").filter(f=>f.trim()).forEach(f=>{const{originalName:g}=Yy(f);r.add(g)})}return _c.lastIndex=0,r},ev=n=>{const r=[];for(const i of n)i==="default"?r.push("export default globalThis.React;"):r.push(`export var ${i} = globalThis.React.${i};`);return r.join(`
|
|
8
|
+
`)},tv={name:"react-globals",setup:async n=>{const r=new Map;n.onStart(()=>{r.clear()}),n.onResolve({filter:Xy},async({importer:i,path:o})=>{if(i&&!r.has(i))try{const u=await Py.readFile(i,"utf-8");r.set(i,Zy(u))}catch{r.set(i,new Set)}return{path:o==="react"&&i?`react?importer=${encodeURIComponent(i)}`:o,namespace:"react-globals",pluginData:{importer:i}}}),n.onLoad({filter:/.*/,namespace:"react-globals"},({path:i,pluginData:o})=>{if(i==="react/jsx-runtime")return{contents:Ky,loader:"js"};if(i==="react"||i.startsWith("react?importer=")){const u=o?.importer||decodeURIComponent(i.split("react?importer=")[1]||""),f=r.get(u)||new Set;return{contents:ev(f),loader:"js"}}return null})}},nv=()=>[tv,Qy],La="public",iv="TWENTY_API_KEY",rv="TWENTY_API_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 sv=["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 Bc{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=we.default.join(this.appPath,vn);await ky(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=we.default.join(this.appPath,vn),i={};for(const f of this.sourcePaths){const g=f.replace(/\.tsx?$/,"");i[g]=we.default.join(this.appPath,f)}const o=this,u=[...this.config.extraPlugins??[],{name:"build-notifications",setup:f=>{f.onEnd(async g=>{try{if(g.errors.length>0){g.errors[0].text.includes("Could not resolve")||await this.onBuildError?.(g.errors.map(v=>({error:v.text,location:v.location})));return}await Uy({result:g,appPath:this.appPath,fileFolder:this.config.fileFolder,lastChecksums:o.lastChecksums,onFileBuilt:o.onFileBuilt})}finally{o.resolveBuildComplete?.()}})}}];this.esBuildContext=await Uc.context({entryPoints:i,bundle:!0,splitting:!1,format:"esm",platform:this.config.platform,outdir:r,outExtension:{".js":".mjs"},external:this.config.externalModules,tsconfig:we.default.join(this.appPath,"tsconfig.json"),jsx:this.config.jsx,sourcemap:!0,metafile:!0,logLevel:"silent",minify:this.config.minify,plugins:u}),this.buildCompletePromise=new Promise(f=>{this.resolveBuildComplete=f}),await this.esBuildContext.rebuild(),await this.buildCompletePromise,this.watchMode&&await this.esBuildContext.watch()}}const av={name:"external-patterns",setup:n=>{n.onResolve({filter:/(?:^|\/)generated(?:\/|$)/},r=>({path:r.path,external:!0}))}},ov=n=>new Bc({...n,config:{externalModules:sv,fileFolder:Pt.N.BuiltLogicFunction,platform:"node",extraPlugins:[av]}}),uv=n=>new Bc({...n,config:{externalModules:My,fileFolder:Pt.N.BuiltFrontComponent,jsx:"automatic",extraPlugins:nv()}});class cv{constructor(r){this.watcher=null,this.appPath=r.appPath,this.handleChangeDetected=r.handleChangeDetected}async start(){this.watcher=Mc.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(La),g=["package.json","yarn.lock"].includes(o),v=o.endsWith(".ts")||o.endsWith(".tsx"),w=o.startsWith(".");(u||!v||w)&&!f&&!g||this.handleChangeDetected(o,r)})}async close(){await this.watcher?.close()}}const lv=({manifest:n,builtFileInfos:r})=>{let i=structuredClone(n);for(const[o,{fileFolder:u,checksum:f}]of r.entries()){const g=ge.relative(vn,o);if(u===Pt.N.BuiltLogicFunction){const v=i.logicFunctions,w=v.findIndex(b=>b.builtHandlerPath===g);if(w===-1)continue;i={...i,logicFunctions:v.map((b,O)=>O===w?{...b,builtHandlerChecksum:f}:b)}}if(u===Pt.N.PublicAsset){const v=i.publicAssets,w=v.findIndex(b=>b.filePath===g);if(w===-1)continue;i={...i,publicAssets:v.map((b,O)=>O===w?{...b,checksum:f}:b)};continue}if(u===Pt.N.BuiltFrontComponent){const v=i.frontComponents,w=v.findIndex(b=>b.builtComponentPath===g)??-1;if(w===-1)continue;i={...i,frontComponents:v.map((b,O)=>O===w?{...b,builtComponentChecksum:f}:b)}}u===Pt.N.Source&&(g==="package.json"&&(i.application.packageJsonChecksum=f),g==="yarn.lock"&&(i.application.yarnLockChecksum=f))}return i},fv=async(n,r)=>{const i=we.default.join(n,vn);await de.ensureDir(i);const o=we.default.join(i,"manifest.json");return await de.writeJSON(o,r,{spaces:2}),o},Qt="default",Vr=class Vr{constructor(){this.configPath=we.join($c.homedir(),".twenty","config.json")}static setActiveWorkspace(r){this.activeWorkspace=r??Qt}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===Qt&&!o.profiles?.[Qt]?o:o.profiles?.[r],f=u?.apiUrl??i.apiUrl,g=u?.apiKey;return{apiUrl:f,apiKey:g}}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(we.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===Qt){const o=this.getDefaultConfig();delete r.apiKey,r.apiUrl=o.apiUrl}await de.ensureDir(we.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(Qt),r.profiles&&Object.keys(r.profiles).forEach(o=>i.add(o)),Array.from(i).sort()}catch{return[Qt]}}async getDefaultWorkspace(){try{return(await this.readRawConfig()).defaultWorkspace??Qt}catch{return Qt}}async setDefaultWorkspace(r){const i=await this.readRawConfig();i.defaultWorkspace=r,await de.ensureDir(we.dirname(this.configPath)),await de.writeFile(this.configPath,JSON.stringify(i,null,2))}};Vr.activeWorkspace=Qt;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 pv=/\r\n|[\n\r]/g;function ba(n,r){let i=0,o=1;for(const u of n.body.matchAll(pv)){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 dv(n){return jc(n.source,ba(n.source,n.start))}function jc(n,r){const i=n.locationOffset.column-1,o="".padStart(i)+n.body,u=r.line-1,f=n.locationOffset.line-1,g=r.line+f,v=r.line===1?i:0,w=r.column+v,b=`${n.name}:${g}:${w}
|
|
9
|
+
`,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 b+xc([[`${g} |`,$[0]],...$.slice(1,P+1).map(he=>["|",he]),["|","^".padStart(M)],["|",$[P+1]]])}return b+xc([[`${g-1} |`,O[u-1]],[`${g} |`,D],["|","^".padStart(w)],[`${g+1} |`,O[u+1]]])}function xc(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(`
|
|
10
|
+
`)}function hv(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:g,source:v,positions:w,path:b,originalError:O,extensions:D}=hv(i);super(r),this.name="GraphQLError",this.path=b??void 0,this.originalError=O??void 0,this.nodes=Tc(Array.isArray(g)?g:g?[g]:void 0);const P=Tc((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($=>ba(v,$)):P?.map($=>ba($.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+=`
|
|
11
11
|
|
|
12
|
-
`+
|
|
12
|
+
`+dv(i.loc));else if(this.source&&this.locations)for(const i of this.locations)r+=`
|
|
13
13
|
|
|
14
|
-
`+
|
|
14
|
+
`+jc(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 Tc(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 gv{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 Wc{constructor(r,i,o,u,f,g){this.kind=r,this.start=i,this.end=o,this.line=u,this.column=f,this.value=g,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 Gc={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"]},mv=new Set(Object.keys(Gc));function wc(n){const r=n?.kind;return typeof r=="string"&&mv.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 Na(n){return n===9||n===32}function Bi(n){return n>=48&&n<=57}function Vc(n){return n>=97&&n<=122||n>=65&&n<=90}function Fa(n){return Vc(n)||n===95}function qc(n){return Vc(n)||Bi(n)||n===95}function yv(n){var r;let i=Number.MAX_SAFE_INTEGER,o=null,u=-1;for(let g=0;g<n.length;++g){var f;const v=n[g],w=vv(v);w!==v.length&&(o=(f=o)!==null&&f!==void 0?f:g,u=g,g!==0&&w<i&&(i=w))}return n.map((g,v)=>v===0?g:g.slice(i)).slice((r=o)!==null&&r!==void 0?r:0,u+1)}function vv(n){let r=0;for(;r<n.length&&Na(n.charCodeAt(r));)++r;return r}function _v(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 xv(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||Na(M.charCodeAt(0))),g=i.endsWith('\\"""'),v=n.endsWith('"')&&!g,w=n.endsWith("\\"),b=v||w,O=!u||n.length>70||b||f||g;let D="";const P=u&&Na(n.charCodeAt(0));return(O&&!P||f)&&(D+=`
|
|
15
15
|
`),D+=i,(O||b)&&(D+=`
|
|
16
|
-
`),'"""'+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
|
|
17
|
-
`,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
|
|
18
|
-
`));return n.line+=w.length-1,n.lineStart=u,O}if(b===92&&i.charCodeAt(f+1)===34&&i.charCodeAt(f+2)===34&&i.charCodeAt(f+3)===34){v+=i.slice(g,f),g=f+1,f+=4;continue}if(b===10||b===13){v+=i.slice(g,f),w.push(v),b===13&&i.charCodeAt(f+1)===10?f+=2:++f,v="",g=f,u=f;continue}if(
|
|
16
|
+
`),'"""'+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 Tv{constructor(r){const i=new Wc(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=Ev(this,r.end);r.next=i,i.prev=r,r=i}while(r.kind===A.COMMENT);return r}}function wv(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 hi(n){return n>=0&&n<=55295||n>=57344&&n<=1114111}function qr(n,r){return Jc(n.charCodeAt(r))&&zc(n.charCodeAt(r+1))}function Jc(n){return n>=55296&&n<=56319}function zc(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,g=1+i-n.lineStart;return new Wc(r,i,o,f,g,u)}function Ev(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 Sv(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?Rv(n,u):Iv(n,u)}if(Bi(f)||f===45)return Av(n,u,f);if(Fa(f))return Cv(n,u);throw ke(n.source,u,f===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:hi(f)||qr(i,u)?`Unexpected character: ${Bn(n,u)}.`:`Invalid character: ${Bn(n,u)}.`)}return Re(n,A.EOF,o,o)}function Sv(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(hi(f))++u;else if(qr(i,u))u+=2;else break}return Re(n,A.COMMENT,r,u,i.slice(r+1,u))}function Av(n,r,i){const o=n.source.body;let u=r,f=i,g=!1;if(f===45&&(f=o.charCodeAt(++u)),f===48){if(f=o.charCodeAt(++u),Bi(f))throw ke(n.source,u,`Invalid number, unexpected digit after 0: ${Bn(n,u)}.`)}else u=Ta(n,u,f),f=o.charCodeAt(u);if(f===46&&(g=!0,f=o.charCodeAt(++u),u=Ta(n,u,f),f=o.charCodeAt(u)),(f===69||f===101)&&(g=!0,f=o.charCodeAt(++u),(f===43||f===45)&&(f=o.charCodeAt(++u)),u=Ta(n,u,f),f=o.charCodeAt(u)),f===46||Fa(f))throw ke(n.source,u,`Invalid number, expected digit but got: ${Bn(n,u)}.`);return Re(n,g?A.FLOAT:A.INT,r,u,o.slice(r,u))}function Ta(n,r,i){if(!Bi(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(;Bi(o.charCodeAt(u));)++u;return u}function Iv(n,r){const i=n.source.body,o=i.length;let u=r+1,f=u,g="";for(;u<o;){const v=i.charCodeAt(u);if(v===34)return g+=i.slice(f,u),Re(n,A.STRING,r,u+1,g);if(v===92){g+=i.slice(f,u);const w=i.charCodeAt(u+1)===117?i.charCodeAt(u+2)===123?bv(n,u):Nv(n,u):Ov(n,u);g+=w.value,u+=w.size,f=u;continue}if(v===10||v===13)break;if(hi(v))++u;else if(qr(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 bv(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||!hi(o))break;return{value:String.fromCodePoint(o),size:u}}if(o=o<<4|Ui(f),o<0)break}throw ke(n.source,r,`Invalid Unicode escape sequence: "${i.slice(r,r+u)}".`)}function Nv(n,r){const i=n.source.body,o=Ec(i,r+2);if(hi(o))return{value:String.fromCodePoint(o),size:6};if(Jc(o)&&i.charCodeAt(r+6)===92&&i.charCodeAt(r+7)===117){const u=Ec(i,r+8);if(zc(u))return{value:String.fromCodePoint(o,u),size:12}}throw ke(n.source,r,`Invalid Unicode escape sequence: "${i.slice(r,r+6)}".`)}function Ec(n,r){return Ui(n.charCodeAt(r))<<12|Ui(n.charCodeAt(r+1))<<8|Ui(n.charCodeAt(r+2))<<4|Ui(n.charCodeAt(r+3))}function Ui(n){return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:-1}function Ov(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:`
|
|
17
|
+
`,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 Rv(n,r){const i=n.source.body,o=i.length;let u=n.lineStart,f=r+3,g=f,v="";const w=[];for(;f<o;){const b=i.charCodeAt(f);if(b===34&&i.charCodeAt(f+1)===34&&i.charCodeAt(f+2)===34){v+=i.slice(g,f),w.push(v);const O=Re(n,A.BLOCK_STRING,r,f+3,yv(w).join(`
|
|
18
|
+
`));return n.line+=w.length-1,n.lineStart=u,O}if(b===92&&i.charCodeAt(f+1)===34&&i.charCodeAt(f+2)===34&&i.charCodeAt(f+3)===34){v+=i.slice(g,f),g=f+1,f+=4;continue}if(b===10||b===13){v+=i.slice(g,f),w.push(v),b===13&&i.charCodeAt(f+1)===10?f+=2:++f,v="",g=f,u=f;continue}if(hi(b))++f;else if(qr(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 Cv(n,r){const i=n.source.body,o=i.length;let u=r+1;for(;u<o;){const f=i.charCodeAt(u);if(qc(f))++u;else break}return Re(n,A.NAME,r,u,i.slice(r,u))}const Lv=10,Qc=2;function J(n){return Jr(n,[])}function Jr(n,r){switch(typeof n){case"string":return JSON.stringify(n);case"function":return n.name?`[function ${n.name}]`:"[function]";case"object":return Fv(n,r);default:return String(n)}}function Fv(n,r){if(n===null)return"null";if(r.includes(n))return"[Circular]";const i=[...r,n];if(Dv(n)){const o=n.toJSON();if(o!==n)return typeof o=="string"?o:Jr(o,i)}else if(Array.isArray(n))return kv(n,i);return Pv(n,i)}function Dv(n){return typeof n.toJSON=="function"}function Pv(n,r){const i=Object.entries(n);return i.length===0?"{}":r.length>Qc?"["+Uv(n)+"]":"{ "+i.map(([u,f])=>u+": "+Jr(f,r)).join(", ")+" }"}function kv(n,r){if(n.length===0)return"[]";if(r.length>Qc)return"[Array]";const i=Math.min(Lv,n.length),o=n.length-i,u=[];for(let f=0;f<i;++f)u.push(Jr(n[f],r));return o===1?u.push("... 1 more item"):o>1&&u.push(`... ${o} more items`),"["+u.join(", ")+"]"}function Uv(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 g=J(r);throw new Error(`Cannot use ${u} "${g}" from another module or realm.
|
|
19
19
|
|
|
20
20
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
21
21
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -26,36 +26,36 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
|
26
26
|
Duplicate "graphql" modules cannot be used at the same time since different
|
|
27
27
|
versions may have different capabilities and behavior. The data from one
|
|
28
28
|
version used in the function from another could produce confusing and
|
|
29
|
-
spurious results.`)}}return!1};class Jc{constructor(r,i="GraphQL request",o={line:1,column:1}){typeof r=="string"||ce(!1,`Body must be a string. Received: ${J(r)}.`),this.body=r,this.name=i,this.locationOffset=o,this.locationOffset.line>0||ce(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ce(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function Fv(n){return Ut(n,Jc)}function Dv(n,r){const i=new Pv(n,r);i.expectToken(A.SOF);const o=i.parseValueLiteral(!1);return i.expectToken(A.EOF),o}class Pv{constructor(r,i={}){const o=Fv(r)?r:new Jc(r);this._lexer=new mv(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:Ht.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 Ht.QUERY;case"mutation":return Ht.MUTATION;case"subscription":return Ht.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(),g=this.parseFieldsDefinition();return this.node(r,{kind:N.OBJECT_TYPE_DEFINITION,description:i,name:o,interfaces:u,directives:f,fields:g})}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(),g=this.parseConstDirectives();return this.node(r,{kind:N.FIELD_DEFINITION,description:i,name:o,arguments:u,type:f,directives:g})}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 g=this.parseConstDirectives();return this.node(r,{kind:N.INPUT_VALUE_DEFINITION,description:i,name:o,type:u,defaultValue:f,directives:g})}parseInterfaceTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");const o=this.parseName(),u=this.parseImplementsInterfaces(),f=this.parseConstDirectives(),g=this.parseFieldsDefinition();return this.node(r,{kind:N.INTERFACE_TYPE_DEFINITION,description:i,name:o,interfaces:u,directives:f,fields:g})}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,`${Ur(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 g=this.parseDirectiveLocations();return this.node(r,{kind:N.DIRECTIVE_DEFINITION,description:i,name:o,arguments:u,repeatable:f,locations:g})}parseDirectiveLocations(){return this.delimitedMany(A.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const r=this._lexer.token,i=this.parseName();if(Object.prototype.hasOwnProperty.call(ae,i.value))return i;throw this.unexpected(r)}node(r,i){return this._options.noLocation!==!0&&(i.loc=new lv(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 ${Qc(r)}, found ${Ur(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 ${Ur(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 ${Ur(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 Ur(n){const r=n.value;return Qc(n.kind)+(r!=null?` "${r}"`:"")}function Qc(n){return yv(n)?`"${n}"`:n}const kv=5;function Uv(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 g=f.slice(0,kv),v=g.pop();return u+g.join(", ")+", or "+v+"?"}function Tc(n){return n}function zc(n,r){const i=Object.create(null);for(const o of n)i[r(o)]=o;return i}function Un(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 Mv(n,r){let i=0,o=0;for(;i<n.length&&o<r.length;){let u=n.charCodeAt(i),f=r.charCodeAt(o);if(Mr(u)&&Mr(f)){let g=0;do++i,g=g*10+u-ba,u=n.charCodeAt(i);while(Mr(u)&&g>0);let v=0;do++o,v=v*10+f-ba,f=r.charCodeAt(o);while(Mr(f)&&v>0);if(g<v)return-1;if(g>v)return 1}else{if(u<f)return-1;if(u>f)return 1;++i,++o}}return n.length-r.length}const ba=48,$v=57;function Mr(n){return!isNaN(n)&&ba<=n&&n<=$v}function Bv(n,r){const i=Object.create(null),o=new jv(n),u=Math.floor(n.length*.4)+1;for(const f of r){const g=o.measure(f,u);g!==void 0&&(i[f]=g)}return Object.keys(i).sort((f,g)=>{const v=i[f]-i[g];return v!==0?v:Mv(f,g)})}class jv{constructor(r){this._input=r,this._inputLowerCase=r.toLowerCase(),this._inputArray=wc(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=wc(o),f=this._inputArray;if(u.length<f.length){const O=u;u=f,f=O}const g=u.length,v=f.length;if(g-v>i)return;const w=this._rows;for(let O=0;O<=v;O++)w[0][O]=O;for(let O=1;O<=g;O++){const D=w[(O-1)%3],P=w[O%3];let M=P[0]=O;for(let $=1;$<=v;$++){const ge=u[O-1]===f[$-1]?0:1;let oe=Math.min(D[$]+1,P[$-1]+1,D[$-1]+ge);if(O>1&&$>1&&u[O-1]===f[$-2]&&u[O-2]===f[$-1]){const ye=w[(O-2)%3][$-2];oe=Math.min(oe,ye+1)}oe<M&&(M=oe),P[$]=oe}if(M>i)return}const b=w[g%3][v];return b<=i?b:void 0}}function wc(n){const r=n.length,i=new Array(r);for(let o=0;o<r;++o)i[o]=n.charCodeAt(o);return i}function _t(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 Wv(n){return`"${n.replace(Gv,Vv)}"`}const Gv=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Vv(n){return qv[n.charCodeAt(0)]}const qv=["\\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"],Jv=Object.freeze({});function Qv(n,r,i=Bc){const o=new Map;for(const ye of Object.values(N))o.set(ye,zv(r,ye));let u,f=Array.isArray(n),g=[n],v=-1,w=[],b=n,O,D;const P=[],M=[];do{v++;const ye=v===g.length,Ye=ye&&w.length!==0;if(ye){if(O=M.length===0?void 0:P[P.length-1],b=D,D=M.pop(),Ye)if(f){b=b.slice();let L=0;for(const[te,H]of w){const le=te-L;H===null?(b.splice(le,1),L++):b[le]=H}}else{b=Object.defineProperties({},Object.getOwnPropertyDescriptors(b));for(const[L,te]of w)b[L]=te}v=u.index,g=u.keys,w=u.edits,f=u.inArray,u=u.prev}else if(D){if(O=f?v:g[v],b=D[O],b==null)continue;P.push(O)}let Te;if(!Array.isArray(b)){var $,ge;_c(b)||ce(!1,`Invalid AST Node: ${J(b)}.`);const L=ye?($=o.get(b.kind))===null||$===void 0?void 0:$.leave:(ge=o.get(b.kind))===null||ge===void 0?void 0:ge.enter;if(Te=L?.call(r,b,O,D,P,M),Te===Jv)break;if(Te===!1){if(!ye){P.pop();continue}}else if(Te!==void 0&&(w.push([O,Te]),!ye))if(_c(Te))b=Te;else{P.pop();continue}}if(Te===void 0&&Ye&&w.push([O,b]),ye)P.pop();else{var oe;u={inArray:f,index:v,keys:g,edits:w,prev:u},f=Array.isArray(b),g=f?b:(oe=i[b.kind])!==null&&oe!==void 0?oe:[],v=-1,w=[],D&&M.push(D),D=b}}while(u!==void 0);return w.length!==0?w[w.length-1][1]:n}function zv(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 yt(n){return Qv(n,Yv)}const Hv=80,Yv={Name:{leave:n=>n.value},Variable:{leave:n=>"$"+n.name},Document:{leave:n=>k(n.definitions,`
|
|
29
|
+
spurious results.`)}}return!1};class Hc{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 Mv(n){return Mt(n,Hc)}function $v(n,r){const i=new Bv(n,r);i.expectToken(A.SOF);const o=i.parseValueLiteral(!1);return i.expectToken(A.EOF),o}class Bv{constructor(r,i={}){const o=Mv(r)?r:new Hc(r);this._lexer=new Tv(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(),g=this.parseFieldsDefinition();return this.node(r,{kind:N.OBJECT_TYPE_DEFINITION,description:i,name:o,interfaces:u,directives:f,fields:g})}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(),g=this.parseConstDirectives();return this.node(r,{kind:N.FIELD_DEFINITION,description:i,name:o,arguments:u,type:f,directives:g})}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 g=this.parseConstDirectives();return this.node(r,{kind:N.INPUT_VALUE_DEFINITION,description:i,name:o,type:u,defaultValue:f,directives:g})}parseInterfaceTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");const o=this.parseName(),u=this.parseImplementsInterfaces(),f=this.parseConstDirectives(),g=this.parseFieldsDefinition();return this.node(r,{kind:N.INTERFACE_TYPE_DEFINITION,description:i,name:o,interfaces:u,directives:f,fields:g})}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 g=this.parseDirectiveLocations();return this.node(r,{kind:N.DIRECTIVE_DEFINITION,description:i,name:o,arguments:u,repeatable:f,locations:g})}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 gv(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 ${Yc(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 Yc(n.kind)+(r!=null?` "${r}"`:"")}function Yc(n){return wv(n)?`"${n}"`:n}const jv=5;function Wv(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 g=f.slice(0,jv),v=g.pop();return u+g.join(", ")+", or "+v+"?"}function Sc(n){return n}function Xc(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 zr(n,r){const i=Object.create(null);for(const o of Object.keys(n))i[o]=r(n[o],o);return i}function Gv(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 g=0;do++i,g=g*10+u-Oa,u=n.charCodeAt(i);while(Br(u)&&g>0);let v=0;do++o,v=v*10+f-Oa,f=r.charCodeAt(o);while(Br(f)&&v>0);if(g<v)return-1;if(g>v)return 1}else{if(u<f)return-1;if(u>f)return 1;++i,++o}}return n.length-r.length}const Oa=48,Vv=57;function Br(n){return!isNaN(n)&&Oa<=n&&n<=Vv}function qv(n,r){const i=Object.create(null),o=new Jv(n),u=Math.floor(n.length*.4)+1;for(const f of r){const g=o.measure(f,u);g!==void 0&&(i[f]=g)}return Object.keys(i).sort((f,g)=>{const v=i[f]-i[g];return v!==0?v:Gv(f,g)})}class Jv{constructor(r){this._input=r,this._inputLowerCase=r.toLowerCase(),this._inputArray=Ac(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=Ac(o),f=this._inputArray;if(u.length<f.length){const O=u;u=f,f=O}const g=u.length,v=f.length;if(g-v>i)return;const w=this._rows;for(let O=0;O<=v;O++)w[0][O]=O;for(let O=1;O<=g;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 b=w[g%3][v];return b<=i?b:void 0}}function Ac(n){const r=n.length,i=new Array(r);for(let o=0;o<r;++o)i[o]=n.charCodeAt(o);return i}function _t(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 zv(n){return`"${n.replace(Qv,Hv)}"`}const Qv=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Hv(n){return Yv[n.charCodeAt(0)]}const Yv=["\\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"],Xv=Object.freeze({});function Kv(n,r,i=Gc){const o=new Map;for(const me of Object.values(N))o.set(me,Zv(r,me));let u,f=Array.isArray(n),g=[n],v=-1,w=[],b=n,O,D;const P=[],M=[];do{v++;const me=v===g.length,Ye=me&&w.length!==0;if(me){if(O=M.length===0?void 0:P[P.length-1],b=D,D=M.pop(),Ye)if(f){b=b.slice();let L=0;for(const[ee,H]of w){const ce=ee-L;H===null?(b.splice(ce,1),L++):b[ce]=H}}else{b=Object.defineProperties({},Object.getOwnPropertyDescriptors(b));for(const[L,ee]of w)b[L]=ee}v=u.index,g=u.keys,w=u.edits,f=u.inArray,u=u.prev}else if(D){if(O=f?v:g[v],b=D[O],b==null)continue;P.push(O)}let xe;if(!Array.isArray(b)){var $,he;wc(b)||ue(!1,`Invalid AST Node: ${J(b)}.`);const L=me?($=o.get(b.kind))===null||$===void 0?void 0:$.leave:(he=o.get(b.kind))===null||he===void 0?void 0:he.enter;if(xe=L?.call(r,b,O,D,P,M),xe===Xv)break;if(xe===!1){if(!me){P.pop();continue}}else if(xe!==void 0&&(w.push([O,xe]),!me))if(wc(xe))b=xe;else{P.pop();continue}}if(xe===void 0&&Ye&&w.push([O,b]),me)P.pop();else{var ae;u={inArray:f,index:v,keys:g,edits:w,prev:u},f=Array.isArray(b),g=f?b:(ae=i[b.kind])!==null&&ae!==void 0?ae:[],v=-1,w=[],D&&M.push(D),D=b}}while(u!==void 0);return w.length!==0?w[w.length-1][1]:n}function Zv(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 yt(n){return Kv(n,t_)}const e_=80,t_={Name:{leave:n=>n.value},Variable:{leave:n=>"$"+n.name},Document:{leave:n=>k(n.definitions,`
|
|
30
30
|
|
|
31
|
-
`)},OperationDefinition:{leave(n){const r=
|
|
32
|
-
`,
|
|
31
|
+
`)},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})=>bt(n)},Field:{leave({alias:n,name:r,arguments:i,directives:o,selectionSet:u}){const f=ne("",n,": ")+r;let g=f+ne("(",k(i,", "),")");return g.length>e_&&(g=f+ne(`(
|
|
32
|
+
`,Gr(k(i,`
|
|
33
33
|
`)),`
|
|
34
|
-
)`)),k([g,k(o," "),u]," ")}},Argument:{leave:({name:n,value:r})=>n+": "+r},FragmentSpread:{leave:({name:n,directives:r})=>"..."+n+
|
|
35
|
-
`)+k(["schema",k(r," "),bt(i)]," ")},OperationTypeDefinition:{leave:({operation:n,type:r})=>n+": "+r},ScalarTypeDefinition:{leave:({description:n,name:r,directives:i})=>
|
|
36
|
-
`)+k(["scalar",r,k(i," ")]," ")},ObjectTypeDefinition:{leave:({description:n,name:r,interfaces:i,directives:o,fields:u})=>
|
|
37
|
-
`)+k(["type",r,
|
|
38
|
-
`)+r+(
|
|
39
|
-
`,
|
|
34
|
+
)`)),k([g,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?xv(n):zv(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,`
|
|
35
|
+
`)+k(["schema",k(r," "),bt(i)]," ")},OperationTypeDefinition:{leave:({operation:n,type:r})=>n+": "+r},ScalarTypeDefinition:{leave:({description:n,name:r,directives:i})=>ne("",n,`
|
|
36
|
+
`)+k(["scalar",r,k(i," ")]," ")},ObjectTypeDefinition:{leave:({description:n,name:r,interfaces:i,directives:o,fields:u})=>ne("",n,`
|
|
37
|
+
`)+k(["type",r,ne("implements ",k(i," & ")),k(o," "),bt(u)]," ")},FieldDefinition:{leave:({description:n,name:r,arguments:i,type:o,directives:u})=>ne("",n,`
|
|
38
|
+
`)+r+(Ic(i)?ne(`(
|
|
39
|
+
`,Gr(k(i,`
|
|
40
40
|
`)),`
|
|
41
|
-
)`):
|
|
42
|
-
`)+k([r+": "+i,
|
|
43
|
-
`)+k(["interface",r,
|
|
44
|
-
`)+k(["union",r,k(i," "),
|
|
45
|
-
`)+k(["enum",r,k(i," "),bt(o)]," ")},EnumValueDefinition:{leave:({description:n,name:r,directives:i})=>
|
|
46
|
-
`)+k([r,k(i," ")]," ")},InputObjectTypeDefinition:{leave:({description:n,name:r,directives:i,fields:o})=>
|
|
47
|
-
`)+k(["input",r,k(i," "),bt(o)]," ")},DirectiveDefinition:{leave:({description:n,name:r,arguments:i,repeatable:o,locations:u})=>
|
|
48
|
-
`)+"directive @"+r+(
|
|
49
|
-
`,
|
|
41
|
+
)`):ne("(",k(i,", "),")"))+": "+o+ne(" ",k(u," "))},InputValueDefinition:{leave:({description:n,name:r,type:i,defaultValue:o,directives:u})=>ne("",n,`
|
|
42
|
+
`)+k([r+": "+i,ne("= ",o),k(u," ")]," ")},InterfaceTypeDefinition:{leave:({description:n,name:r,interfaces:i,directives:o,fields:u})=>ne("",n,`
|
|
43
|
+
`)+k(["interface",r,ne("implements ",k(i," & ")),k(o," "),bt(u)]," ")},UnionTypeDefinition:{leave:({description:n,name:r,directives:i,types:o})=>ne("",n,`
|
|
44
|
+
`)+k(["union",r,k(i," "),ne("= ",k(o," | "))]," ")},EnumTypeDefinition:{leave:({description:n,name:r,directives:i,values:o})=>ne("",n,`
|
|
45
|
+
`)+k(["enum",r,k(i," "),bt(o)]," ")},EnumValueDefinition:{leave:({description:n,name:r,directives:i})=>ne("",n,`
|
|
46
|
+
`)+k([r,k(i," ")]," ")},InputObjectTypeDefinition:{leave:({description:n,name:r,directives:i,fields:o})=>ne("",n,`
|
|
47
|
+
`)+k(["input",r,k(i," "),bt(o)]," ")},DirectiveDefinition:{leave:({description:n,name:r,arguments:i,repeatable:o,locations:u})=>ne("",n,`
|
|
48
|
+
`)+"directive @"+r+(Ic(i)?ne(`(
|
|
49
|
+
`,Gr(k(i,`
|
|
50
50
|
`)),`
|
|
51
|
-
)`):
|
|
52
|
-
`,
|
|
51
|
+
)`):ne("(",k(i,", "),")"))+(o?" repeatable":"")+" on "+k(u," | ")},SchemaExtension:{leave:({directives:n,operationTypes:r})=>k(["extend schema",k(n," "),bt(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," "),bt(o)]," ")},InterfaceTypeExtension:{leave:({name:n,interfaces:r,directives:i,fields:o})=>k(["extend interface",n,ne("implements ",k(r," & ")),k(i," "),bt(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," "),bt(i)]," ")},InputObjectTypeExtension:{leave:({name:n,directives:r,fields:i})=>k(["extend input",n,k(r," "),bt(i)]," ")}};function k(n,r=""){var i;return(i=n?.filter(o=>o).join(r))!==null&&i!==void 0?i:""}function bt(n){return ne(`{
|
|
52
|
+
`,Gr(k(n,`
|
|
53
53
|
`)),`
|
|
54
|
-
}`)}function
|
|
55
|
-
`))}function
|
|
56
|
-
`)))!==null&&r!==void 0?r:!1}function Na(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=>Na(i,r));case N.OBJECT:return Un(n.fields,i=>i.name.value,i=>Na(i.value,r));case N.VARIABLE:return r?.[n.name.value]}}function Ot(n){if(n!=null||ce(!1,"Must provide name."),typeof n=="string"||ce(!1,"Expected name to be a string."),n.length===0)throw new pe("Expected name to be a non-empty string.");for(let r=1;r<n.length;++r)if(!Wc(n.charCodeAt(r)))throw new pe(`Names must only contain [_a-zA-Z0-9] but "${n}" does not.`);if(!Ca(n.charCodeAt(0)))throw new pe(`Names must start with [_a-zA-Z] but "${n}" does not.`);return n}function Xv(n){if(n==="true"||n==="false"||n==="null")throw new pe(`Enum values cannot be named: ${n}`);return Ot(n)}function Hc(n){return di(n)||Xt(n)||gt(n)||yn(n)||vn(n)||_n(n)||Bi(n)||mn(n)}function di(n){return Ut(n,$n)}function Xt(n){return Ut(n,Tn)}function Kv(n){if(!Xt(n))throw new Error(`Expected ${J(n)} to be a GraphQL Object type.`);return n}function gt(n){return Ut(n,ol)}function Zv(n){if(!gt(n))throw new Error(`Expected ${J(n)} to be a GraphQL Interface type.`);return n}function yn(n){return Ut(n,ul)}function vn(n){return Ut(n,Jr)}function _n(n){return Ut(n,cl)}function Bi(n){return Ut(n,ht)}function mn(n){return Ut(n,se)}function Yc(n){return di(n)||vn(n)||_n(n)||Ra(n)&&Yc(n.ofType)}function Xc(n){return di(n)||Xt(n)||gt(n)||yn(n)||vn(n)||Ra(n)&&Xc(n.ofType)}function Kc(n){return di(n)||vn(n)}function e_(n){return gt(n)||yn(n)}class ht{constructor(r){Hc(r)||ce(!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 se{constructor(r){Zc(r)||ce(!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 Ra(n){return Bi(n)||mn(n)}function Zc(n){return Hc(n)&&!mn(n)}function t_(n){if(!Zc(n))throw new Error(`Expected ${J(n)} to be a GraphQL nullable type.`);return n}function n_(n){if(n){let r=n;for(;Ra(r);)r=r.ofType;return r}}function el(n){return typeof n=="function"?n():n}function tl(n){return typeof n=="function"?n():n}class $n{constructor(r){var i,o,u,f;const g=(i=r.parseValue)!==null&&i!==void 0?i:Tc;this.name=Ot(r.name),this.description=r.description,this.specifiedByURL=r.specifiedByURL,this.serialize=(o=r.serialize)!==null&&o!==void 0?o:Tc,this.parseValue=g,this.parseLiteral=(u=r.parseLiteral)!==null&&u!==void 0?u:(v,w)=>g(Na(v,w)),this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(f=r.extensionASTNodes)!==null&&f!==void 0?f:[],r.specifiedByURL==null||typeof r.specifiedByURL=="string"||ce(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${J(r.specifiedByURL)}.`),r.serialize==null||typeof r.serialize=="function"||ce(!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"||ce(!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 Tn{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.isTypeOf=r.isTypeOf,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=()=>il(r),this._interfaces=()=>nl(r),r.isTypeOf==null||typeof r.isTypeOf=="function"||ce(!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:sl(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function nl(n){var r;const i=el((r=n.interfaces)!==null&&r!==void 0?r:[]);return Array.isArray(i)||ce(!1,`${n.name} interfaces must be an Array or a function which returns an Array.`),i}function il(n){const r=tl(n.fields);return ui(r)||ce(!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;ui(i)||ce(!1,`${n.name}.${o} field config must be an object.`),i.resolve==null||typeof i.resolve=="function"||ce(!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 ui(f)||ce(!1,`${n.name}.${o} args must be an object with argument names as keys.`),{name:Ot(o),description:i.description,type:i.type,args:rl(f),resolve:i.resolve,subscribe:i.subscribe,deprecationReason:i.deprecationReason,extensions:_t(i.extensions),astNode:i.astNode}})}function rl(n){return Object.entries(n).map(([r,i])=>({name:Ot(r),description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:_t(i.extensions),astNode:i.astNode}))}function ui(n){return Kt(n)&&!Array.isArray(n)}function sl(n){return qr(n,r=>({description:r.description,type:r.type,args:al(r.args),resolve:r.resolve,subscribe:r.subscribe,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}))}function al(n){return Un(n,r=>r.name,r=>({description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}))}class ol{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.resolveType=r.resolveType,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=il.bind(void 0,r),this._interfaces=nl.bind(void 0,r),r.resolveType==null||typeof r.resolveType=="function"||ce(!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:sl(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class ul{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.resolveType=r.resolveType,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._types=i_.bind(void 0,r),r.resolveType==null||typeof r.resolveType=="function"||ce(!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 i_(n){const r=el(n.types);return Array.isArray(r)||ce(!1,`Must provide Array of types or a function which returns such an array for Union ${n.name}.`),r}class Jr{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._values=r_(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 pe(`Enum "${this.name}" cannot represent value: ${J(r)}`);return i.name}parseValue(r){if(typeof r!="string"){const o=J(r);throw new pe(`Enum "${this.name}" cannot represent non-string value: ${o}.`+$r(this,o))}const i=this.getValue(r);if(i==null)throw new pe(`Value "${r}" does not exist in "${this.name}" enum.`+$r(this,r));return i.value}parseLiteral(r,i){if(r.kind!==N.ENUM){const u=yt(r);throw new pe(`Enum "${this.name}" cannot represent non-enum value: ${u}.`+$r(this,u),{nodes:r})}const o=this.getValue(r.value);if(o==null){const u=yt(r);throw new pe(`Value "${u}" does not exist in "${this.name}" enum.`+$r(this,u),{nodes:r})}return o.value}toConfig(){const r=Un(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 $r(n,r){const i=n.getValues().map(u=>u.name),o=Bv(r,i);return Uv("the enum value",o)}function r_(n,r){return ui(r)||ce(!1,`${n} values must be an object with value names as keys.`),Object.entries(r).map(([i,o])=>(ui(o)||ce(!1,`${n}.${i} must refer to an object with a "value" key representing an internal value but got: ${J(o)}.`),{name:Xv(i),description:o.description,value:o.value!==void 0?o.value:i,deprecationReason:o.deprecationReason,extensions:_t(o.extensions),astNode:o.astNode}))}class cl{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=s_.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 s_(n){const r=tl(n.fields);return ui(r)||ce(!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)||ce(!1,`${n.name}.${o} field has a resolve property, but Input Types cannot define resolvers.`),{name:Ot(o),description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:_t(i.extensions),astNode:i.astNode}))}const xa=2147483647,Ta=-2147483648,a_=new $n({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=ji(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 pe(`Int cannot represent non-integer value: ${J(r)}`);if(i>xa||i<Ta)throw new pe("Int cannot represent non 32-bit signed integer value: "+J(r));return i},parseValue(n){if(typeof n!="number"||!Number.isInteger(n))throw new pe(`Int cannot represent non-integer value: ${J(n)}`);if(n>xa||n<Ta)throw new pe(`Int cannot represent non 32-bit signed integer value: ${n}`);return n},parseLiteral(n){if(n.kind!==N.INT)throw new pe(`Int cannot represent non-integer value: ${yt(n)}`,{nodes:n});const r=parseInt(n.value,10);if(r>xa||r<Ta)throw new pe(`Int cannot represent non 32-bit signed integer value: ${n.value}`,{nodes:n});return r}}),o_=new $n({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=ji(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 pe(`Float cannot represent non numeric value: ${J(r)}`);return i},parseValue(n){if(typeof n!="number"||!Number.isFinite(n))throw new pe(`Float cannot represent non numeric value: ${J(n)}`);return n},parseLiteral(n){if(n.kind!==N.FLOAT&&n.kind!==N.INT)throw new pe(`Float cannot represent non numeric value: ${yt(n)}`,n);return parseFloat(n.value)}}),Ce=new $n({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=ji(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 pe(`String cannot represent value: ${J(n)}`)},parseValue(n){if(typeof n!="string")throw new pe(`String cannot represent a non string value: ${J(n)}`);return n},parseLiteral(n){if(n.kind!==N.STRING)throw new pe(`String cannot represent a non string value: ${yt(n)}`,{nodes:n});return n.value}}),mt=new $n({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(n){const r=ji(n);if(typeof r=="boolean")return r;if(Number.isFinite(r))return r!==0;throw new pe(`Boolean cannot represent a non boolean value: ${J(r)}`)},parseValue(n){if(typeof n!="boolean")throw new pe(`Boolean cannot represent a non boolean value: ${J(n)}`);return n},parseLiteral(n){if(n.kind!==N.BOOLEAN)throw new pe(`Boolean cannot represent a non boolean value: ${yt(n)}`,{nodes:n});return n.value}}),ll=new $n({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=ji(n);if(typeof r=="string")return r;if(Number.isInteger(r))return String(r);throw new pe(`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 pe(`ID cannot represent value: ${J(n)}`)},parseLiteral(n){if(n.kind!==N.STRING&&n.kind!==N.INT)throw new pe("ID cannot represent a non-string and non-integer value: "+yt(n),{nodes:n});return n.value}}),fl=Object.freeze([Ce,a_,o_,mt,ll]);function u_(n){return fl.some(({name:r})=>n.name===r)}function ji(n){if(Kt(n)){if(typeof n.valueOf=="function"){const r=n.valueOf();if(!Kt(r))return r}if(typeof n.toJSON=="function")return n.toJSON()}return n}function c_(n){return Ut(n,hi)}class hi{constructor(r){var i,o;this.name=Ot(r.name),this.description=r.description,this.locations=r.locations,this.isRepeatable=(i=r.isRepeatable)!==null&&i!==void 0?i:!1,this.extensions=_t(r.extensions),this.astNode=r.astNode,Array.isArray(r.locations)||ce(!1,`@${r.name} locations must be an Array.`);const u=(o=r.args)!==null&&o!==void 0?o:{};Kt(u)&&!Array.isArray(u)||ce(!1,`@${r.name} args must be an object with argument names as keys.`),this.args=rl(u)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:al(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const l_=new hi({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[ae.FIELD,ae.FRAGMENT_SPREAD,ae.INLINE_FRAGMENT],args:{if:{type:new se(mt),description:"Included when true."}}}),f_=new hi({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[ae.FIELD,ae.FRAGMENT_SPREAD,ae.INLINE_FRAGMENT],args:{if:{type:new se(mt),description:"Skipped when true."}}}),pl="No longer supported",p_=new hi({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[ae.FIELD_DEFINITION,ae.ARGUMENT_DEFINITION,ae.INPUT_FIELD_DEFINITION,ae.ENUM_VALUE],args:{reason:{type:Ce,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:pl}}}),d_=new hi({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[ae.SCALAR],args:{url:{type:new se(Ce),description:"The URL that specifies the behavior of this scalar."}}}),dl=Object.freeze([l_,f_,p_,d_]);function h_(n){return dl.some(({name:r})=>r===n.name)}function g_(n){return typeof n=="object"&&typeof n?.[Symbol.iterator]=="function"}function oi(n,r){if(mn(r)){const i=oi(n,r.ofType);return i?.kind===N.NULL?null:i}if(n===null)return{kind:N.NULL};if(n===void 0)return null;if(Bi(r)){const i=r.ofType;if(g_(n)){const o=[];for(const u of n){const f=oi(u,i);f!=null&&o.push(f)}return{kind:N.LIST,values:o}}return oi(n,i)}if(_n(r)){if(!Kt(n))return null;const i=[];for(const o of Object.values(r.getFields())){const u=oi(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(Kc(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 Sc.test(o)?{kind:N.INT,value:o}:{kind:N.FLOAT,value:o}}if(typeof i=="string")return vn(r)?{kind:N.ENUM,value:i}:r===ll&&Sc.test(i)?{kind:N.INT,value:i}:{kind:N.STRING,value:i};throw new TypeError(`Cannot convert value to AST: ${J(i)}.`)}$i(!1,"Unexpected input type: "+J(r))}const Sc=/^-?(?:0|[1-9][0-9]*)$/,La=new Tn({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:Ce,resolve:n=>n.description},types:{description:"A list of all types supported by this server.",type:new se(new ht(new se(Pt))),resolve(n){return Object.values(n.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new se(Pt),resolve:n=>n.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Pt,resolve:n=>n.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Pt,resolve:n=>n.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new se(new ht(new se(hl))),resolve:n=>n.getDirectives()}})}),hl=new Tn({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
54
|
+
}`)}function ne(n,r,i=""){return r!=null&&r!==""?n+r+i:""}function Gr(n){return ne(" ",n.replace(/\n/g,`
|
|
55
|
+
`))}function Ic(n){var r;return(r=n?.some(i=>i.includes(`
|
|
56
|
+
`)))!==null&&r!==void 0?r:!1}function Ra(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=>Ra(i,r));case N.OBJECT:return $n(n.fields,i=>i.name.value,i=>Ra(i.value,r));case N.VARIABLE:return r?.[n.name.value]}}function Ot(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(!qc(n.charCodeAt(r)))throw new fe(`Names must only contain [_a-zA-Z0-9] but "${n}" does not.`);if(!Fa(n.charCodeAt(0)))throw new fe(`Names must start with [_a-zA-Z] but "${n}" does not.`);return n}function n_(n){if(n==="true"||n==="false"||n==="null")throw new fe(`Enum values cannot be named: ${n}`);return Ot(n)}function Kc(n){return gi(n)||Kt(n)||gt(n)||_n(n)||xn(n)||Tn(n)||Wi(n)||yn(n)}function gi(n){return Mt(n,jn)}function Kt(n){return Mt(n,En)}function i_(n){if(!Kt(n))throw new Error(`Expected ${J(n)} to be a GraphQL Object type.`);return n}function gt(n){return Mt(n,ll)}function r_(n){if(!gt(n))throw new Error(`Expected ${J(n)} to be a GraphQL Interface type.`);return n}function _n(n){return Mt(n,fl)}function xn(n){return Mt(n,Qr)}function Tn(n){return Mt(n,pl)}function Wi(n){return Mt(n,ht)}function yn(n){return Mt(n,re)}function Zc(n){return gi(n)||xn(n)||Tn(n)||Da(n)&&Zc(n.ofType)}function el(n){return gi(n)||Kt(n)||gt(n)||_n(n)||xn(n)||Da(n)&&el(n.ofType)}function tl(n){return gi(n)||xn(n)}function s_(n){return gt(n)||_n(n)}class ht{constructor(r){Kc(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){nl(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 Da(n){return Wi(n)||yn(n)}function nl(n){return Kc(n)&&!yn(n)}function a_(n){if(!nl(n))throw new Error(`Expected ${J(n)} to be a GraphQL nullable type.`);return n}function o_(n){if(n){let r=n;for(;Da(r);)r=r.ofType;return r}}function il(n){return typeof n=="function"?n():n}function rl(n){return typeof n=="function"?n():n}class jn{constructor(r){var i,o,u,f;const g=(i=r.parseValue)!==null&&i!==void 0?i:Sc;this.name=Ot(r.name),this.description=r.description,this.specifiedByURL=r.specifiedByURL,this.serialize=(o=r.serialize)!==null&&o!==void 0?o:Sc,this.parseValue=g,this.parseLiteral=(u=r.parseLiteral)!==null&&u!==void 0?u:(v,w)=>g(Ra(v,w)),this.extensions=_t(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=Ot(r.name),this.description=r.description,this.isTypeOf=r.isTypeOf,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=()=>al(r),this._interfaces=()=>sl(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:ul(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function sl(n){var r;const i=il((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 al(n){const r=rl(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.`),zr(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:Ot(o),description:i.description,type:i.type,args:ol(f),resolve:i.resolve,subscribe:i.subscribe,deprecationReason:i.deprecationReason,extensions:_t(i.extensions),astNode:i.astNode}})}function ol(n){return Object.entries(n).map(([r,i])=>({name:Ot(r),description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:_t(i.extensions),astNode:i.astNode}))}function li(n){return Zt(n)&&!Array.isArray(n)}function ul(n){return zr(n,r=>({description:r.description,type:r.type,args:cl(r.args),resolve:r.resolve,subscribe:r.subscribe,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}))}function cl(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 ll{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.resolveType=r.resolveType,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=al.bind(void 0,r),this._interfaces=sl.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:ul(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class fl{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.resolveType=r.resolveType,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._types=u_.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 u_(n){const r=il(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 Qr{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._values=c_(this.name,r.values),this._valueLookup=new Map(this._values.map(o=>[o.value,o])),this._nameLookup=Xc(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=yt(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=yt(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=qv(r,i);return Wv("the enum value",o)}function c_(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:n_(i),description:o.description,value:o.value!==void 0?o.value:i,deprecationReason:o.deprecationReason,extensions:_t(o.extensions),astNode:o.astNode}))}class pl{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=l_.bind(void 0,r)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const r=zr(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 l_(n){const r=rl(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.`),zr(r,(i,o)=>(!("resolve"in i)||ue(!1,`${n.name}.${o} field has a resolve property, but Input Types cannot define resolvers.`),{name:Ot(o),description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:_t(i.extensions),astNode:i.astNode}))}const wa=2147483647,Ea=-2147483648,f_=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>wa||i<Ea)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>wa||n<Ea)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: ${yt(n)}`,{nodes:n});const r=parseInt(n.value,10);if(r>wa||r<Ea)throw new fe(`Int cannot represent non 32-bit signed integer value: ${n.value}`,{nodes:n});return r}}),p_=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: ${yt(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: ${yt(n)}`,{nodes:n});return n.value}}),mt=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: ${yt(n)}`,{nodes:n});return n.value}}),dl=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: "+yt(n),{nodes:n});return n.value}}),hl=Object.freeze([Oe,f_,p_,mt,dl]);function d_(n){return hl.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 h_(n){return Mt(n,mi)}class mi{constructor(r){var i,o;this.name=Ot(r.name),this.description=r.description,this.locations=r.locations,this.isRepeatable=(i=r.isRepeatable)!==null&&i!==void 0?i:!1,this.extensions=_t(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=ol(u)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:cl(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const g_=new mi({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(mt),description:"Included when true."}}}),m_=new mi({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(mt),description:"Skipped when true."}}}),gl="No longer supported",y_=new mi({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:gl}}}),v_=new mi({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."}}}),ml=Object.freeze([g_,m_,y_,v_]);function __(n){return ml.some(({name:r})=>r===n.name)}function x_(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(x_(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(tl(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 bc.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===dl&&bc.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 bc=/^-?(?:0|[1-9][0-9]*)$/,Pa=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 ht(new re(kt))),resolve(n){return Object.values(n.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new re(kt),resolve:n=>n.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:kt,resolve:n=>n.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:kt,resolve:n=>n.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new re(new ht(new re(yl))),resolve:n=>n.getDirectives()}})}),yl=new En({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
57
57
|
|
|
58
|
-
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 se(Ce),resolve:n=>n.name},description:{type:Ce,resolve:n=>n.description},isRepeatable:{type:new se(mt),resolve:n=>n.isRepeatable},locations:{type:new se(new ht(new se(gl))),resolve:n=>n.locations},args:{type:new se(new ht(new se(Qr))),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){return r?n.args:n.args.filter(i=>i.deprecationReason==null)}}})}),gl=new Jr({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:ae.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:ae.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:ae.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:ae.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:ae.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:ae.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:ae.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:ae.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:ae.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:ae.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:ae.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:ae.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:ae.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:ae.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:ae.UNION,description:"Location adjacent to a union definition."},ENUM:{value:ae.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:ae.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:ae.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:ae.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Pt=new Tn({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 se(vl),resolve(n){if(di(n))return _e.SCALAR;if(Xt(n))return _e.OBJECT;if(gt(n))return _e.INTERFACE;if(yn(n))return _e.UNION;if(vn(n))return _e.ENUM;if(_n(n))return _e.INPUT_OBJECT;if(Bi(n))return _e.LIST;if(mn(n))return _e.NON_NULL;$i(!1,`Unexpected type: "${J(n)}".`)}},name:{type:Ce,resolve:n=>"name"in n?n.name:void 0},description:{type:Ce,resolve:n=>"description"in n?n.description:void 0},specifiedByURL:{type:Ce,resolve:n=>"specifiedByURL"in n?n.specifiedByURL:void 0},fields:{type:new ht(new se(ml)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(Xt(n)||gt(n)){const i=Object.values(n.getFields());return r?i:i.filter(o=>o.deprecationReason==null)}}},interfaces:{type:new ht(new se(Pt)),resolve(n){if(Xt(n)||gt(n))return n.getInterfaces()}},possibleTypes:{type:new ht(new se(Pt)),resolve(n,r,i,{schema:o}){if(e_(n))return o.getPossibleTypes(n)}},enumValues:{type:new ht(new se(yl)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(vn(n)){const i=n.getValues();return r?i:i.filter(o=>o.deprecationReason==null)}}},inputFields:{type:new ht(new se(Qr)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(_n(n)){const i=Object.values(n.getFields());return r?i:i.filter(o=>o.deprecationReason==null)}}},ofType:{type:Pt,resolve:n=>"ofType"in n?n.ofType:void 0}})}),ml=new Tn({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 se(Ce),resolve:n=>n.name},description:{type:Ce,resolve:n=>n.description},args:{type:new se(new ht(new se(Qr))),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){return r?n.args:n.args.filter(i=>i.deprecationReason==null)}},type:{type:new se(Pt),resolve:n=>n.type},isDeprecated:{type:new se(mt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Ce,resolve:n=>n.deprecationReason}})}),Qr=new Tn({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 se(Ce),resolve:n=>n.name},description:{type:Ce,resolve:n=>n.description},type:{type:new se(Pt),resolve:n=>n.type},defaultValue:{type:Ce,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(n){const{type:r,defaultValue:i}=n,o=oi(i,r);return o?yt(o):null}},isDeprecated:{type:new se(mt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Ce,resolve:n=>n.deprecationReason}})}),yl=new Tn({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 se(Ce),resolve:n=>n.name},description:{type:Ce,resolve:n=>n.description},isDeprecated:{type:new se(mt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Ce,resolve:n=>n.deprecationReason}})});var _e;(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"})(_e||(_e={}));const vl=new Jr({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:_e.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:_e.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:_e.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:_e.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:_e.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:_e.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:_e.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:_e.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});new se(La);new se(Ce);new se(Ce);const _l=Object.freeze([La,hl,gl,Pt,ml,Qr,yl,vl]);function m_(n){return _l.some(({name:r})=>n.name===r)}class y_{constructor(r){var i,o;this.__validationErrors=r.assumeValid===!0?[]:void 0,Kt(r)||ce(!1,"Must provide configuration object."),!r.types||Array.isArray(r.types)||ce(!1,`"types" must be Array if provided but got: ${J(r.types)}.`),!r.directives||Array.isArray(r.directives)||ce(!1,`"directives" must be Array if provided but got: ${J(r.directives)}.`),this.description=r.description,this.extensions=_t(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:dl;const u=new Set(r.types);if(r.types!=null)for(const f of r.types)u.delete(f),Nt(f,u);this._queryType!=null&&Nt(this._queryType,u),this._mutationType!=null&&Nt(this._mutationType,u),this._subscriptionType!=null&&Nt(this._subscriptionType,u);for(const f of this._directives)if(c_(f))for(const g of f.args)Nt(g.type,u);Nt(La,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 g=f.name;if(g||ce(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[g]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${g}".`);if(this._typeMap[g]=f,gt(f)){for(const v of f.getInterfaces())if(gt(v)){let w=this._implementationsMap[v.name];w===void 0&&(w=this._implementationsMap[v.name]={objects:[],interfaces:[]}),w.interfaces.push(f)}}else if(Xt(f)){for(const v of f.getInterfaces())if(gt(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 Ht.QUERY:return this.getQueryType();case Ht.MUTATION:return this.getMutationType();case Ht.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(r){return this.getTypeMap()[r]}getPossibleTypes(r){return yn(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),yn(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 Nt(n,r){const i=n_(n);if(!r.has(i)){if(r.add(i),yn(i))for(const o of i.getTypes())Nt(o,r);else if(Xt(i)||gt(i)){for(const o of i.getInterfaces())Nt(o,r);for(const o of Object.values(i.getFields())){Nt(o.type,r);for(const u of o.args)Nt(u.type,r)}}else if(_n(i))for(const o of Object.values(i.getFields()))Nt(o.type,r)}return r}function ki(n,r,i){if(n){if(n.kind===N.VARIABLE){n.name.value;return}if(mn(r))return n.kind===N.NULL?void 0:ki(n,r.ofType,i);if(n.kind===N.NULL)return null;if(Bi(r)){const o=r.ofType;if(n.kind===N.LIST){const f=[];for(const g of n.values)if(Ac(g,i)){if(mn(o))return;f.push(null)}else{const v=ki(g,o,i);if(v===void 0)return;f.push(v)}return f}const u=ki(n,o,i);return u===void 0?void 0:[u]}if(_n(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 g=u[f.name];if(!g||Ac(g.value,i)){if(f.defaultValue!==void 0)o[f.name]=f.defaultValue;else if(mn(f.type))return;continue}const v=ki(g.value,f.type,i);if(v===void 0)return;o[f.name]=v}return o}if(Kc(r)){let o;try{o=r.parseLiteral(n,i)}catch{return}return o===void 0?void 0:o}$i(!1,"Unexpected input type: "+J(r))}}function Ac(n,r){return n.kind===N.VARIABLE&&r==null}function v_(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 g(v){return r.inputValueDeprecation?v:""}return`
|
|
58
|
+
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(mt),resolve:n=>n.isRepeatable},locations:{type:new re(new ht(new re(vl))),resolve:n=>n.locations},args:{type:new re(new ht(new re(Hr))),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){return r?n.args:n.args.filter(i=>i.deprecationReason==null)}}})}),vl=new Qr({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."}}}),kt=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(Tl),resolve(n){if(gi(n))return ve.SCALAR;if(Kt(n))return ve.OBJECT;if(gt(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 ht(new re(_l)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(Kt(n)||gt(n)){const i=Object.values(n.getFields());return r?i:i.filter(o=>o.deprecationReason==null)}}},interfaces:{type:new ht(new re(kt)),resolve(n){if(Kt(n)||gt(n))return n.getInterfaces()}},possibleTypes:{type:new ht(new re(kt)),resolve(n,r,i,{schema:o}){if(s_(n))return o.getPossibleTypes(n)}},enumValues:{type:new ht(new re(xl)),args:{includeDeprecated:{type:mt,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 ht(new re(Hr)),args:{includeDeprecated:{type:mt,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:kt,resolve:n=>"ofType"in n?n.ofType:void 0}})}),_l=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 ht(new re(Hr))),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){return r?n.args:n.args.filter(i=>i.deprecationReason==null)}},type:{type:new re(kt),resolve:n=>n.type},isDeprecated:{type:new re(mt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Oe,resolve:n=>n.deprecationReason}})}),Hr=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(kt),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?yt(o):null}},isDeprecated:{type:new re(mt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Oe,resolve:n=>n.deprecationReason}})}),xl=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(mt),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 Tl=new Qr({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(Pa);new re(Oe);new re(Oe);const wl=Object.freeze([Pa,yl,vl,kt,_l,Hr,xl,Tl]);function T_(n){return wl.some(({name:r})=>n.name===r)}class w_{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=_t(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:ml;const u=new Set(r.types);if(r.types!=null)for(const f of r.types)u.delete(f),Nt(f,u);this._queryType!=null&&Nt(this._queryType,u),this._mutationType!=null&&Nt(this._mutationType,u),this._subscriptionType!=null&&Nt(this._subscriptionType,u);for(const f of this._directives)if(h_(f))for(const g of f.args)Nt(g.type,u);Nt(Pa,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 g=f.name;if(g||ue(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[g]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${g}".`);if(this._typeMap[g]=f,gt(f)){for(const v of f.getInterfaces())if(gt(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(gt(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 Nt(n,r){const i=o_(n);if(!r.has(i)){if(r.add(i),_n(i))for(const o of i.getTypes())Nt(o,r);else if(Kt(i)||gt(i)){for(const o of i.getInterfaces())Nt(o,r);for(const o of Object.values(i.getFields())){Nt(o.type,r);for(const u of o.args)Nt(u.type,r)}}else if(Tn(i))for(const o of Object.values(i.getFields()))Nt(o.type,r)}return r}function Mi(n,r,i){if(n){if(n.kind===N.VARIABLE){n.name.value;return}if(yn(r))return n.kind===N.NULL?void 0:Mi(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 g of n.values)if(Nc(g,i)){if(yn(o))return;f.push(null)}else{const v=Mi(g,o,i);if(v===void 0)return;f.push(v)}return f}const u=Mi(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=Xc(n.fields,f=>f.name.value);for(const f of Object.values(r.getFields())){const g=u[f.name];if(!g||Nc(g.value,i)){if(f.defaultValue!==void 0)o[f.name]=f.defaultValue;else if(yn(f.type))return;continue}const v=Mi(g.value,f.type,i);if(v===void 0)return;o[f.name]=v}return o}if(tl(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 Nc(n,r){return n.kind===N.VARIABLE&&r==null}function E_(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 g(v){return r.inputValueDeprecation?v:""}return`
|
|
59
59
|
query IntrospectionQuery {
|
|
60
60
|
__schema {
|
|
61
61
|
${f}
|
|
@@ -160,21 +160,21 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
`}function
|
|
163
|
+
`}function S_(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[...hl,...wl])o[x.name]&&(o[x.name]=x);const u=i.queryType?O(i.queryType):null,f=i.mutationType?O(i.mutationType):null,g=i.subscriptionType?O(i.subscriptionType):null,v=i.directives?i.directives.map(qe):[];return new w_({description:i.description,query:u,mutation:f,subscription:g,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 ht(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(a_(Se))}return b(x)}function b(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 i_(b(x))}function D(x){return r_(b(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 xe(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 ll({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 fl({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 Qr({name:x.name,description:x.description,values:$n(x.enumValues,q=>q.name,q=>({description:q.description,deprecationReason:q.deprecationReason}))})}function xe(x){if(!x.inputFields){const q=J(x);throw new Error(`Introspection result missing inputFields: ${q}.`)}return new pl({name:x.name,description:x.description,fields:()=>H(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(!el(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:H(x.args)}}function H(x){return $n(x,q=>q.name,ce)}function ce(x){const q=w(x.type);if(!Zc(q)){const xt=J(q);throw new Error(`Introspection must provide input type for arguments, but received: ${xt}.`)}const Se=x.defaultValue!=null?Mi($v(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 mi({name:x.name,description:x.description,isRepeatable:x.isRepeatable,locations:x.locations.slice(),args:H(x.args)})}}function A_(n){return b_(n,r=>!__(r),I_)}function I_(n){return!d_(n)&&!T_(n)}function b_(n,r,i){const o=n.getDirectives().filter(r),u=Object.values(n.getTypeMap()).filter(i);return[N_(n),...o.map(f=>U_(f)),...u.map(f=>R_(f))].filter(Boolean).join(`
|
|
164
164
|
|
|
165
|
-
`)}function
|
|
165
|
+
`)}function N_(n){if(n.description==null&&O_(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}`),vt(n)+`schema {
|
|
166
166
|
${r.join(`
|
|
167
167
|
`)}
|
|
168
|
-
}`}function
|
|
168
|
+
}`}function O_(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 R_(n){if(gi(n))return C_(n);if(Kt(n))return L_(n);if(gt(n))return F_(n);if(_n(n))return D_(n);if(xn(n))return P_(n);if(Tn(n))return k_(n);ji(!1,"Unexpected type: "+J(n))}function C_(n){return vt(n)+`scalar ${n.name}`+M_(n)}function El(n){const r=n.getInterfaces();return r.length?" implements "+r.map(i=>i.name).join(" & "):""}function L_(n){return vt(n)+`type ${n.name}`+El(n)+Sl(n)}function F_(n){return vt(n)+`interface ${n.name}`+El(n)+Sl(n)}function D_(n){const r=n.getTypes(),i=r.length?" = "+r.join(" | "):"";return vt(n)+"union "+n.name+i}function P_(n){const r=n.getValues().map((i,o)=>vt(i," ",!o)+" "+i.name+Ua(i.deprecationReason));return vt(n)+`enum ${n.name}`+ka(r)}function k_(n){const r=Object.values(n.getFields()).map((i,o)=>vt(i," ",!o)+" "+Ca(i));return vt(n)+`input ${n.name}`+ka(r)}function Sl(n){const r=Object.values(n.getFields()).map((i,o)=>vt(i," ",!o)+" "+i.name+Al(i.args," ")+": "+String(i.type)+Ua(i.deprecationReason));return ka(r)}function ka(n){return n.length!==0?` {
|
|
169
169
|
`+n.join(`
|
|
170
170
|
`)+`
|
|
171
|
-
}`:""}function
|
|
172
|
-
`+n.map((i,o)=>vt(i," "+r,!o)+" "+r+
|
|
171
|
+
}`:""}function Al(n,r=""){return n.length===0?"":n.every(i=>!i.description)?"("+n.map(Ca).join(", ")+")":`(
|
|
172
|
+
`+n.map((i,o)=>vt(i," "+r,!o)+" "+r+Ca(i)).join(`
|
|
173
173
|
`)+`
|
|
174
|
-
`+r+")"}function
|
|
174
|
+
`+r+")"}function Ca(n){const r=ci(n.defaultValue,n.type);let i=n.name+": "+String(n.type);return r&&(i+=` = ${yt(r)}`),i+Ua(n.deprecationReason)}function U_(n){return vt(n)+"directive @"+n.name+Al(n.args)+(n.isRepeatable?" repeatable":"")+" on "+n.locations.join(" | ")}function Ua(n){return n==null?"":n!==gl?` @deprecated(reason: ${yt({kind:N.STRING,value:n})})`:" @deprecated"}function M_(n){return n.specifiedByURL==null?"":` @specifiedBy(url: ${yt({kind:N.STRING,value:n.specifiedByURL})})`}function vt(n,r="",i=!0){const{description:o}=n;if(o==null)return"";const u=yt({kind:N.STRING,value:o,block:_v(o)});return(r&&!i?`
|
|
175
175
|
`+r:r)+u.replace(/\n/g,`
|
|
176
176
|
`+r)+`
|
|
177
|
-
`}class
|
|
177
|
+
`}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:`
|
|
178
178
|
query CurrentWorkspace {
|
|
179
179
|
currentWorkspace {
|
|
180
180
|
id
|
|
@@ -199,7 +199,7 @@ ${r.join(`
|
|
|
199
199
|
mutation UninstallApplication($universalIdentifier: String!) {
|
|
200
200
|
uninstallApplication(universalIdentifier: $universalIdentifier)
|
|
201
201
|
}
|
|
202
|
-
`,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(
|
|
202
|
+
`,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=E_(),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=S_(i.data.data);return{success:!0,data:A_(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:`
|
|
203
203
|
query FindManyLogicFunctions {
|
|
204
204
|
findManyLogicFunctions {
|
|
205
205
|
id
|
|
@@ -218,77 +218,97 @@ ${r.join(`
|
|
|
218
218
|
error
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
`,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=
|
|
221
|
+
`,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=by.createClient({url:u.apiUrl+"/graphql",headers:{Authorization:`Bearer ${u.apiKey}`,"Content-Type":"application/json",Accept:"text/event-stream"}}),g=`
|
|
222
222
|
subscription SubscribeToLogs($input: LogicFunctionLogsInput!) {
|
|
223
223
|
logicFunctionLogs(input: $input) {
|
|
224
224
|
logs
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
`,v={input:{applicationUniversalIdentifier:r,universalIdentifier:i,name:o}};f.subscribe({query:g,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=
|
|
227
|
+
`,v={input:{applicationUniversalIdentifier:r,universalIdentifier:i,name:o}};f.subscribe({query:g,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=we.resolve(r);if(!yc.existsSync(f))return{success:!1,error:`File not found: ${f}`};const g=we.basename(f),v=yc.readFileSync(f),w=this.getMimeType(g),b=`
|
|
228
228
|
mutation UploadApplicationFile($file: Upload!, $applicationUniversalIdentifier: String!, $fileFolder: FileFolder!, $filePath: String!) {
|
|
229
229
|
uploadApplicationFile(file: $file, applicationUniversalIdentifier: $applicationUniversalIdentifier, fileFolder: $fileFolder, filePath: $filePath)
|
|
230
230
|
{ path }
|
|
231
231
|
}
|
|
232
|
-
`,O=Uy(o),D=JSON.stringify({query:b,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}),g);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 ${g}`}}catch(f){return kr.default.isAxiosError(f)&&f.response?{success:!1,error:f.response.data?.errors?.[0]?.message||f.message}:{success:!1,error:f}}}getMimeType(r){const i=Ee.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 D_{constructor(r){this.apiService=new Zt,this.applicationUniversalIdentifier=r.applicationUniversalIdentifier,this.appPath=r.appPath}async uploadFile({builtPath:r,fileFolder:i}){const o=me.relative(Z.T,r);return await this.apiService.uploadFile({filePath:Ee.default.join(this.appPath,r),builtHandlerPath:o,fileFolder:i,applicationUniversalIdentifier:this.applicationUniversalIdentifier})}}var El=(n=>(n.DefineApplication="defineApplication",n.DefineField="defineField",n.DefineLogicFunction="defineLogicFunction",n.DefineObject="defineObject",n.DefineRole="defineRole",n.DefineFrontComponent="defineFrontComponent",n))(El||{}),gn=(n=>(n.Application="application",n.Fields="fields",n.LogicFunctions="logicFunctions",n.Objects="objects",n.Roles="roles",n.FrontComponents="frontComponents",n.PublicAssets="publicAssets",n))(gn||{});const P_={defineApplication:"application",defineField:"fields",defineLogicFunction:"logicFunctions",defineObject:"objects",defineRole:"roles",defineFrontComponent:"frontComponents"},k_=n=>{if(!ai.isCallExpression(n))return;const r=n.expression;if(ai.isIdentifier(r)&&Object.values(El).includes(r.text))return r.text},U_=n=>{const r=ai.createSourceFile("temp.ts",n,ai.ScriptTarget.Latest,!0),i=[];ai.forEachChild(r,o=>{i.push(o)});for(const o of i)if(ai.isExportAssignment(o)){if(o.isExportEquals||!o.expression)return;const u=k_(o.expression);if(u)return u}},si=async({filePath:n,appPath:r})=>{const i=await M_({filePath:n,appPath:r});return $_(i,n)},M_=async({filePath:n,appPath:r})=>{const i=Ee.default.join(r,"tsconfig.json"),o=await he.pathExists(i),u=Iy.createRequire(Ee.default.join(r,"package.json"));let f,g;try{f=Ee.default.dirname(u.resolve("react/package.json")),g=Ee.default.dirname(u.resolve("react-dom/package.json"))}catch{}const w=(await Dc.build({entryPoints:[n],bundle:!0,write:!1,format:"cjs",platform:"node",target:"node18",jsx:"automatic",tsconfig:o?i:void 0,alias:{...f&&{react:f},...g&&{"react-dom":g}},logLevel:"silent"})).outputFiles[0].text,b=await he.mkdtemp(Ee.default.join(kc.default.tmpdir(),"twenty-manifest-")),O=Ee.default.join(b,"module.cjs");try{return await he.writeFile(O,w),require(O)}finally{await he.remove(b)}},$_=(n,r)=>{if(kt.Tr(n.default)&&My(n.default))return n.default;throw new Error(`Config file ${r} must export a config object default export`)},B_=async n=>await Rc.glob(["**/*.ts","**/*.tsx"],{cwd:n,absolute:!0,ignore:["**/node_modules/**","**/*.d.ts","**/dist/**","**/.twenty/**"],onlyFiles:!0}),j_=async n=>await Rc.glob([`${Z.t}/**/*`],{cwd:n,onlyFiles:!0}),W_=async(n,r)=>{const i={};for(const o of r){const f=me.relative(n,o).split(me.sep),g=await he.readFile(o,"utf8");let v=i;for(let w=0;w<f.length;w++){const b=f[w];w===f.length-1?v[b]=g:(v[b]=v[b]??{},v=v[b])}}return i},zr=async n=>{const r=await B_(n),i=[];let o;const u=[],f=[],g=[],v=[],w=[],b=[],O=[],D=[],P=[],M=[],$=[],ge=[],oe=[];for(const L of r){const te=await Cc.readFile(L,"utf-8"),H=me.relative(n,L),le=U_(te);if(!le)continue;switch(P_[le]){case gn.Application:{const x=await si({appPath:n,filePath:L});o={...x.config,yarnLockChecksum:null,packageJsonChecksum:null},i.push(...x.errors),O.push(H);break}case gn.Objects:{const x=await si({appPath:n,filePath:L});u.push(x.config),i.push(...x.errors),D.push(H);break}case gn.Fields:{const x=await si({appPath:n,filePath:L});f.push(x.config),i.push(...x.errors),P.push(H);break}case gn.Roles:{const x=await si({appPath:n,filePath:L});g.push(x.config),i.push(...x.errors),M.push(H);break}case gn.LogicFunctions:{const x=await si({appPath:n,filePath:L});i.push(...x.errors);const{handler:q,...Ae}=x.config,xt=me.relative(n,L),en={...Ae,handlerName:"default.handler",sourceHandlerPath:xt,builtHandlerPath:xt.replace(/\.tsx?$/,".mjs"),builtHandlerChecksum:null};v.push(en),$.push(H);break}case gn.FrontComponents:{const x=await si({appPath:n,filePath:L});i.push(...x.errors);const{component:q,...Ae}=x.config,xt=me.relative(n,L),en={...Ae,componentName:q.name,sourceComponentPath:xt,builtComponentPath:xt.replace(/\.tsx?$/,".mjs"),builtComponentChecksum:null};w.push(en),ge.push(H);break}case gn.PublicAssets:break;default:kt.ln()}}const ye=await j_(n);for(const L of ye)b.push({filePath:L,fileName:me.basename(L),fileType:me.extname(L).replace(/^\./,""),checksum:null}),oe.push(me.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:g,logicFunctions:v,frontComponents:w,publicAssets:b,sources:await W_(n,r)}:null,filePaths:{application:O,objects:D,fields:P,roles:M,logicFunctions:$,frontComponents:ge,publicAssets:oe},errors:i}},G_=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)},Sl=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(...Sl(o));return r},V_=n=>{const r=[],i=[],o=G_(Sl(n));return o.length>0&&r.push(`Duplicate universal identifiers: ${o.join(", ")}`),kt.Zo(n.objects)||i.push("No object defined"),kt.Zo(n.logicFunctions)||i.push("No logic function defined"),kt.Zo(n.frontComponents)||i.push("No front component defined"),{errors:r,warnings:i,isValid:r.length===0}};class q_{constructor(r){this.builtFileInfos=new Map,this.fileUploader=null,this.apiService=new Zt({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 zr(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=V_(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 D_({appPath:this.appPath,applicationUniversalIdentifier:r.manifest.application.universalIdentifier});for(const[v,{fileFolder:w,sourcePath:b}]of this.builtFileInfos.entries())this.uploadFile(v,b,w)}for(;this.activeUploads.size>0;)await Promise.all(this.activeUploads);const o=sv({manifest:r.manifest,builtFileInfos:this.builtFileInfos});this.uiStateManager.addEvent({message:"Manifest checksums set",status:"info"}),await av(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 J_={pending:["building","uploading","success"],building:["pending","uploading","success"],uploading:["pending","success"],success:["pending","building","uploading"]};class Q_{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 Z._.Object;case"fields":return Z._.Field;case"logicFunctions":return Z._.LogicFunction;case"frontComponents":return Z._.FrontComponent;case"roles":return Z._.Role;default:return}}updateAllFilesTypes({manifestFilePaths:r}){const i=new Map;Object.entries(r).forEach(([u,f])=>{f.forEach(g=>{const v=this.convertEntityTypeToSyncableEntity(u);v&&i.set(g,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&&!J_[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 wa=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],Ic=["↑","⇡","↟","⤒"],Br={pending:"○",success:"✓"},Di={pending:"gray",building:"yellow",uploading:"cyan",success:"green"},Al={[Z._.Object]:"Objects",[Z._.Field]:"Fields",[Z._.LogicFunction]:"Logic functions",[Z._.FrontComponent]:"Front components",[Z._.Role]:"Roles"},Il=Object.keys(Al),z_={info:"gray",success:"green",error:"red",warning:"yellow"},H_=n=>{const r=new Map;for(const i of Il)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},Y_=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("/")}`},K_=n=>!n.frontendUrl||!n.appUniversalIdentifier?null:`${n.frontendUrl}/settings/applications`,Z_=async n=>{const[r,i]=await Promise.all([import("react"),import("ink")]),{useState:o,useEffect:u}=r,{render:f,Box:g,Text:v,Static:w}=i,b=(L,te=80)=>{const[H,le]=o(0);return u(()=>{const qe=setInterval(()=>{le(x=>(x+1)%L.length)},te);return()=>clearInterval(qe)},[L.length,te]),L[H]},O=({event:L})=>{const te=z_[L.status],H=Y_(L.timestamp);return B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[H," "]}),B.jsxRuntimeExports.jsx(v,{color:te,children:L.message})]})},D=({status:L})=>{const te=b(wa,200),H=b(Ic,200),le={building:te,uploading:H,pending:Br.pending,success:Br.success};return B.jsxRuntimeExports.jsxs(v,{color:Di[L],children:[le[L]," "]})},P=({entity:L})=>B.jsxRuntimeExports.jsxs(g,{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:te})=>te.length===0?null:B.jsxRuntimeExports.jsxs(g,{flexDirection:"column",marginTop:1,children:[B.jsxRuntimeExports.jsx(v,{bold:!0,dimColor:!0,children:Al[L]}),te.map(H=>B.jsxRuntimeExports.jsx(P,{entity:H},H.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"}},ge=({snapshot:L})=>{const te=b(wa,80),H=$[L.manifestStatus],le=H.icon==="spinner"?te:H.icon;return B.jsxRuntimeExports.jsxs(v,{color:H.color,children:[le?`${le} `:"",H.text,L.error&&`: ${L.error}`]})},oe=({snapshot:L})=>{const te=H_(L.entities),H=K_(L);return B.jsxRuntimeExports.jsxs(g,{flexDirection:"column",borderStyle:"classic",borderColor:"gray",paddingX:1,children:[B.jsxRuntimeExports.jsx(v,{bold:!0,color:"cyan",children:"Application"}),B.jsxRuntimeExports.jsxs(g,{marginLeft:2,flexDirection:"column",children:[B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Name: "}),B.jsxRuntimeExports.jsx(v,{bold:!0,children:L.appName??"Loading..."})]}),L.appDescription&&B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Description: "}),B.jsxRuntimeExports.jsx(v,{children:L.appDescription})]}),B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Status: "}),B.jsxRuntimeExports.jsx(ge,{snapshot:L})]}),H&&B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Open:"}),B.jsxRuntimeExports.jsxs(v,{bold:!0,color:"cyan",children:[" ",H]})]})]}),B.jsxRuntimeExports.jsx(g,{marginLeft:2,flexDirection:"column",children:Il.map(le=>{const qe=te.get(le)??[];return B.jsxRuntimeExports.jsx(M,{type:le,entities:qe},le)})})]})},ye=()=>B.jsxRuntimeExports.jsx(g,{marginTop:1,children:B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[B.jsxRuntimeExports.jsx(v,{color:Di.pending,children:Br.pending})," ","pending ",B.jsxRuntimeExports.jsx(v,{color:Di.building,children:wa[0]})," ","building ",B.jsxRuntimeExports.jsx(v,{color:Di.uploading,children:Ic[0]})," ","uploading"," ",B.jsxRuntimeExports.jsx(v,{color:Di.success,children:Br.success})," ","success"]})}),Ye=()=>{const[L,te]=o(n.getSnapshot());return u(()=>n.subscribe(te),[]),B.jsxRuntimeExports.jsxs(B.jsxRuntimeExports.Fragment,{children:[B.jsxRuntimeExports.jsx(w,{items:L.events,children:H=>B.jsxRuntimeExports.jsx(O,{event:H},H.id)}),B.jsxRuntimeExports.jsxs(g,{marginTop:1,flexDirection:"column",children:[B.jsxRuntimeExports.jsx(oe,{snapshot:L}),B.jsxRuntimeExports.jsx(ye,{})]})]})},{unmount:Te}=f(B.jsxRuntimeExports.jsx(Ye,{}));return{unmount:Te}};class bc{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=>me.join(this.appPath,i));for(const i of r)if(!await he.pathExists(i))return;this.watcher=Pc.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=me.relative(this.appPath,r),o=me.join(Z.T,i),u=me.join(this.appPath,o);await he.ensureDir(me.dirname(u)),await he.copy(r,u);const f=await he.readFile(u),g=Fc.default.createHash("md5").update(f).digest("hex");this.handleFileBuilt({fileFolder:this.fileFolder,builtPath:o,sourcePath:i,checksum:g})}async handleUnlink(r){const i=me.relative(this.appPath,r),o=me.join(Z.T,i),u=me.join(this.appPath,o);await he.remove(u)}}class ex{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??Yt,await this.cleanOutputDir(),this.uiStateManager=new Q_({appPath:this.appPath,frontendUrl:process.env.FRONTEND_URL});const{unmount:i}=await Z_(this.uiStateManager);this.unmountUI=i,this.orchestrator=new q_({appPath:this.appPath,handleManifestBuilt:this.handleWatcherRestarts.bind(this),uiStateManager:this.uiStateManager}),await this.startManifestWatcher(),this.setupGracefulShutdown()}async cleanOutputDir(){const r=Ee.default.join(this.appPath,Z.T);await he.ensureDir(r),await he.emptyDir(r)}async startManifestWatcher(){this.manifestWatcher=new rv({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=nv({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=iv({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 bc({appPath:this.appPath,fileFolder:Z.N.PublicAsset,watchPaths:[Z.t],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.assetWatcher.start()}async startDependencyWatcher(){this.dependencyWatcher=new bc({appPath:this.appPath,fileFolder:Z.N.Source,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 tx="generated";class nx{constructor(){this.configService=new je,this.apiService=new Zt}async generate(r){const i=me.join(r,tx);console.log(C.default.blue("📦 Generating Twenty client...")),console.log(C.default.gray(`📁 Output Path: ${i}`)),console.log("");const o=await this.configService.getConfig(),u=o.apiUrl,f=o.apiKey;if(!u||!f){console.log(C.default.yellow("⚠️ Skipping Client generation: API URL or token not configured"));return}console.log(C.default.gray(`API URL: ${u}`)),console.log(C.default.gray(`Output: ${i}`));const g=await this.apiService.getSchema();if(!g.success)return;const{data:v}=g,w=me.resolve(i);await by.generate({schema:v,output:w,scalarTypes:{DateTime:"string",JSON:"Record<string, unknown>",UUID:"string"}}),await this.injectTwentyClient(w),console.log(C.default.green("✓ Client generated successfully!")),console.log(C.default.gray(`Generated files at: ${i}`))}async injectTwentyClient(r){await he.appendFile(me.join(r,"index.ts"),`
|
|
232
|
+
`,O=By(o),D=JSON.stringify({query:b,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}),g);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 ${g}`}}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=we.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 $_{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:we.default.join(this.appPath,r),builtHandlerPath:o,fileFolder:i,applicationUniversalIdentifier:this.applicationUniversalIdentifier})}}var Il=(n=>(n.DefineApplication="defineApplication",n.DefineField="defineField",n.DefineLogicFunction="defineLogicFunction",n.DefineObject="defineObject",n.DefineRole="defineRole",n.DefineFrontComponent="defineFrontComponent",n))(Il||{}),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 B_={defineApplication:"application",defineField:"fields",defineLogicFunction:"logicFunctions",defineObject:"objects",defineRole:"roles",defineFrontComponent:"frontComponents"},j_=n=>{if(!ui.isCallExpression(n))return;const r=n.expression;if(ui.isIdentifier(r)&&Object.values(Il).includes(r.text))return r.text},W_=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=j_(o.expression);if(u)return u}},oi=async({filePath:n,appPath:r})=>{const i=await G_({filePath:n,appPath:r});return V_(i,n)},G_=async({filePath:n,appPath:r})=>{const i=we.default.join(r,"tsconfig.json"),o=await de.pathExists(i),u=Oy.createRequire(we.default.join(r,"package.json"));let f,g;try{f=we.default.dirname(u.resolve("react/package.json")),g=we.default.dirname(u.resolve("react-dom/package.json"))}catch{}const w=(await Uc.build({entryPoints:[n],bundle:!0,write:!1,format:"cjs",platform:"node",target:"node18",jsx:"automatic",tsconfig:o?i:void 0,alias:{...f&&{react:f},...g&&{"react-dom":g}},logLevel:"silent"})).outputFiles[0].text,b=await de.mkdtemp(we.default.join($c.default.tmpdir(),"twenty-manifest-")),O=we.default.join(b,"module.cjs");try{return await de.writeFile(O,w),require(O)}finally{await de.remove(b)}},V_=(n,r)=>{if(Ut.Tr(n.default)&&jy(n.default))return n.default;throw new Error(`Config file ${r} must export a config object default export`)},q_=async n=>await Dc.glob(["**/*.ts","**/*.tsx"],{cwd:n,absolute:!0,ignore:["**/node_modules/**","**/*.d.ts","**/dist/**","**/.twenty/**"],onlyFiles:!0}),J_=async n=>await Dc.glob([`${La}/**/*`],{cwd:n,onlyFiles:!0}),z_=async(n,r)=>{const i={};for(const o of r){const f=ge.relative(n,o).split(ge.sep),g=await de.readFile(o,"utf8");let v=i;for(let w=0;w<f.length;w++){const b=f[w];w===f.length-1?v[b]=g:(v[b]=v[b]??{},v=v[b])}}return i},Yr=async n=>{const r=await q_(n),i=[];let o;const u=[],f=[],g=[],v=[],w=[],b=[],O=[],D=[],P=[],M=[],$=[],he=[],ae=[];for(const L of r){const ee=await Fc.readFile(L,"utf-8"),H=ge.relative(n,L),ce=W_(ee);if(!ce)continue;switch(B_[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(H);break}case mn.Objects:{const x=await oi({appPath:n,filePath:L});u.push(x.config),i.push(...x.errors),D.push(H);break}case mn.Fields:{const x=await oi({appPath:n,filePath:L});f.push(x.config),i.push(...x.errors),P.push(H);break}case mn.Roles:{const x=await oi({appPath:n,filePath:L});g.push(x.config),i.push(...x.errors),M.push(H);break}case mn.LogicFunctions:{const x=await oi({appPath:n,filePath:L});i.push(...x.errors);const{handler:q,...Se}=x.config,xt=ge.relative(n,L),tn={...Se,handlerName:"default.handler",sourceHandlerPath:xt,builtHandlerPath:xt.replace(/\.tsx?$/,".mjs"),builtHandlerChecksum:null};v.push(tn),$.push(H);break}case mn.FrontComponents:{const x=await oi({appPath:n,filePath:L});i.push(...x.errors);const{component:q,...Se}=x.config,xt=ge.relative(n,L),tn={...Se,componentName:q.name,sourceComponentPath:xt,builtComponentPath:xt.replace(/\.tsx?$/,".mjs"),builtComponentChecksum:null};w.push(tn),he.push(H);break}case mn.PublicAssets:break;default:Ut.ln()}}const me=await J_(n);for(const L of me)b.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:g,logicFunctions:v,frontComponents:w,publicAssets:b,sources:await z_(n,r)}:null,filePaths:{application:O,objects:D,fields:P,roles:M,logicFunctions:$,frontComponents:he,publicAssets:ae},errors:i}},Q_=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)},bl=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(...bl(o));return r},H_=n=>{const r=[],i=[],o=Q_(bl(n));return o.length>0&&r.push(`Duplicate universal identifiers: ${o.join(", ")}`),Ut.Zo(n.objects)||i.push("No object defined"),Ut.Zo(n.logicFunctions)||i.push("No logic function defined"),Ut.Zo(n.frontComponents)||i.push("No front component defined"),{errors:r,warnings:i,isValid:r.length===0}};class Y_{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 Yr(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=H_(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 $_({appPath:this.appPath,applicationUniversalIdentifier:r.manifest.application.universalIdentifier});for(const[v,{fileFolder:w,sourcePath:b}]of this.builtFileInfos.entries())this.uploadFile(v,b,w)}for(;this.activeUploads.size>0;)await Promise.all(this.activeUploads);const o=lv({manifest:r.manifest,builtFileInfos:this.builtFileInfos});this.uiStateManager.addEvent({message:"Manifest checksums set",status:"info"}),await fv(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 X_={pending:["building","uploading","success"],building:["pending","uploading","success"],uploading:["pending","success"],success:["pending","building","uploading"]};class K_{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(g=>{const v=this.convertEntityTypeToSyncableEntity(u);v&&i.set(g,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&&!X_[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 Sa=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],Oc=["↑","⇡","↟","⤒"],Wr={pending:"○",success:"✓"},ki={pending:"gray",building:"yellow",uploading:"cyan",success:"green"},Nl={[De.Object]:"Objects",[De.Field]:"Fields",[De.LogicFunction]:"Logic functions",[De.FrontComponent]:"Front components",[De.Role]:"Roles"},Ol=Object.keys(Nl),Z_={info:"gray",success:"green",error:"red",warning:"yellow"},ex=n=>{const r=new Map;for(const i of Ol)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},tx=n=>n.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),nx=(n,r=40)=>{if(n.length<=r)return n;const i=n.split("/");return i.length<=2?n:`.../${i.slice(-2).join("/")}`},ix=n=>!n.frontendUrl||!n.appUniversalIdentifier?null:`${n.frontendUrl}/settings/applications`,rx=async n=>{const[r,i]=await Promise.all([import("react"),import("ink")]),{useState:o,useEffect:u}=r,{render:f,Box:g,Text:v,Static:w}=i,b=(L,ee=80)=>{const[H,ce]=o(0);return u(()=>{const qe=setInterval(()=>{ce(x=>(x+1)%L.length)},ee);return()=>clearInterval(qe)},[L.length,ee]),L[H]},O=({event:L})=>{const ee=Z_[L.status],H=tx(L.timestamp);return B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[H," "]}),B.jsxRuntimeExports.jsx(v,{color:ee,children:L.message})]})},D=({status:L})=>{const ee=b(Sa,200),H=b(Oc,200),ce={building:ee,uploading:H,pending:Wr.pending,success:Wr.success};return B.jsxRuntimeExports.jsxs(v,{color:ki[L],children:[ce[L]," "]})},P=({entity:L})=>B.jsxRuntimeExports.jsxs(g,{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:[" (",nx(L.path),")"]})]}),M=({type:L,entities:ee})=>ee.length===0?null:B.jsxRuntimeExports.jsxs(g,{flexDirection:"column",marginTop:1,children:[B.jsxRuntimeExports.jsx(v,{bold:!0,dimColor:!0,children:Nl[L]}),ee.map(H=>B.jsxRuntimeExports.jsx(P,{entity:H},H.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=b(Sa,80),H=$[L.manifestStatus],ce=H.icon==="spinner"?ee:H.icon;return B.jsxRuntimeExports.jsxs(v,{color:H.color,children:[ce?`${ce} `:"",H.text,L.error&&`: ${L.error}`]})},ae=({snapshot:L})=>{const ee=ex(L.entities),H=ix(L);return B.jsxRuntimeExports.jsxs(g,{flexDirection:"column",borderStyle:"classic",borderColor:"gray",paddingX:1,children:[B.jsxRuntimeExports.jsx(v,{bold:!0,color:"cyan",children:"Application"}),B.jsxRuntimeExports.jsxs(g,{marginLeft:2,flexDirection:"column",children:[B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Name: "}),B.jsxRuntimeExports.jsx(v,{bold:!0,children:L.appName??"Loading..."})]}),L.appDescription&&B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Description: "}),B.jsxRuntimeExports.jsx(v,{children:L.appDescription})]}),B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Status: "}),B.jsxRuntimeExports.jsx(he,{snapshot:L})]}),H&&B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Open:"}),B.jsxRuntimeExports.jsxs(v,{bold:!0,color:"cyan",children:[" ",H]})]})]}),B.jsxRuntimeExports.jsx(g,{marginLeft:2,flexDirection:"column",children:Ol.map(ce=>{const qe=ee.get(ce)??[];return B.jsxRuntimeExports.jsx(M,{type:ce,entities:qe},ce)})})]})},me=()=>B.jsxRuntimeExports.jsx(g,{marginTop:1,children:B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[B.jsxRuntimeExports.jsx(v,{color:ki.pending,children:Wr.pending})," ","pending ",B.jsxRuntimeExports.jsx(v,{color:ki.building,children:Sa[0]})," ","building ",B.jsxRuntimeExports.jsx(v,{color:ki.uploading,children:Oc[0]})," ","uploading"," ",B.jsxRuntimeExports.jsx(v,{color:ki.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:H=>B.jsxRuntimeExports.jsx(O,{event:H},H.id)}),B.jsxRuntimeExports.jsxs(g,{marginTop:1,flexDirection:"column",children:[B.jsxRuntimeExports.jsx(ae,{snapshot:L}),B.jsxRuntimeExports.jsx(me,{})]})]})},{unmount:xe}=f(B.jsxRuntimeExports.jsx(Ye,{}));return{unmount:xe}};class Rc{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=Mc.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),g=kc.default.createHash("md5").update(f).digest("hex");this.handleFileBuilt({fileFolder:this.fileFolder,builtPath:o,sourcePath:i,checksum:g})}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 sx{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 K_({appPath:this.appPath,frontendUrl:process.env.FRONTEND_URL});const{unmount:i}=await rx(this.uiStateManager);this.unmountUI=i,this.orchestrator=new Y_({appPath:this.appPath,handleManifestBuilt:this.handleWatcherRestarts.bind(this),uiStateManager:this.uiStateManager}),await this.startManifestWatcher(),this.setupGracefulShutdown()}async cleanOutputDir(){const r=we.default.join(this.appPath,vn);await de.ensureDir(r),await de.emptyDir(r)}async startManifestWatcher(){this.manifestWatcher=new cv({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=ov({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=uv({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 Rc({appPath:this.appPath,fileFolder:Pt.N.PublicAsset,watchPaths:[La],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.assetWatcher.start()}async startDependencyWatcher(){this.dependencyWatcher=new Rc({appPath:this.appPath,fileFolder:Pt.N.Source,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 ax="generated";class ox{constructor(){this.configService=new je,this.apiService=new en}async generate(r){const i=ge.join(r,ax);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 g=await this.apiService.getSchema();if(!g.success)return;const{data:v}=g,w=ge.resolve(i);await Ry.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=`
|
|
233
233
|
|
|
234
234
|
// ----------------------------------------------------
|
|
235
|
-
// ✨
|
|
236
|
-
// Uses the generic TwentyClient from twenty-sdk with generated types
|
|
235
|
+
// ✨ Custom Twenty client (auto-injected)
|
|
237
236
|
// ----------------------------------------------------
|
|
238
237
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
// Twenty client class that wraps the genql client with full type safety
|
|
257
|
-
export default class Twenty extends BaseTwentyClient<
|
|
258
|
-
QueryGenqlSelection,
|
|
259
|
-
MutationGenqlSelection,
|
|
260
|
-
FieldsSelection<Query, QueryGenqlSelection>,
|
|
261
|
-
FieldsSelection<Mutation, MutationGenqlSelection>
|
|
262
|
-
> {
|
|
263
|
-
constructor(options?: TwentyClientOptions) {
|
|
264
|
-
// Create the genql client with the options
|
|
265
|
-
const genqlClientOptions: ClientOptions = {
|
|
266
|
-
url: options?.url
|
|
267
|
-
? (options.url.endsWith('/graphql') ? options.url : \`\${options.url}/graphql\`)
|
|
268
|
-
: \`\${process.env.TWENTY_API_URL}/graphql\`,
|
|
238
|
+
const defaultOptions: ClientOptions = {
|
|
239
|
+
url: \`\${process.env.${rv}}/graphql\`,
|
|
240
|
+
headers: {
|
|
241
|
+
'Content-Type': 'application/json',
|
|
242
|
+
Authorization: \`Bearer \${process.env.${iv}}\`,
|
|
243
|
+
},
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export default class Twenty {
|
|
247
|
+
private client: Client;
|
|
248
|
+
private apiUrl: string;
|
|
249
|
+
private authorizationToken: string;
|
|
250
|
+
|
|
251
|
+
constructor(options?: ClientOptions) {
|
|
252
|
+
const merged: ClientOptions = {
|
|
253
|
+
...defaultOptions,
|
|
254
|
+
...options,
|
|
269
255
|
headers: {
|
|
270
|
-
|
|
271
|
-
...(options?.apiKey
|
|
272
|
-
? { Authorization: \`Bearer \${options.apiKey}\` }
|
|
273
|
-
: process.env.TWENTY_API_KEY
|
|
274
|
-
? { Authorization: \`Bearer \${process.env.TWENTY_API_KEY}\` }
|
|
275
|
-
: {}),
|
|
256
|
+
...defaultOptions.headers,
|
|
276
257
|
...(options?.headers ?? {}),
|
|
277
258
|
},
|
|
278
259
|
};
|
|
279
260
|
|
|
280
|
-
|
|
261
|
+
this.client = createClient(merged);
|
|
262
|
+
this.apiUrl = merged.url;
|
|
263
|
+
this.authorizationToken = merged.headers.Authorization;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
query<R extends QueryGenqlSelection>(request: R & { __name?: string }) {
|
|
267
|
+
return this.client.query(request);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
mutation<R extends MutationGenqlSelection>(request: R & { __name?: string }) {
|
|
271
|
+
return this.client.mutation(request);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
async uploadFile(
|
|
275
|
+
fileBuffer: Buffer,
|
|
276
|
+
filename: string,
|
|
277
|
+
contentType: string = 'application/octet-stream',
|
|
278
|
+
fileFolder: string = 'Attachment',
|
|
279
|
+
): Promise<{ path: string; token: string }> {
|
|
280
|
+
const form = new FormData();
|
|
281
281
|
|
|
282
|
-
|
|
282
|
+
form.append('operations', JSON.stringify({
|
|
283
|
+
query: \`mutation UploadFile($file: Upload!, $fileFolder: FileFolder) {
|
|
284
|
+
uploadFile(file: $file, fileFolder: $fileFolder) { path token }
|
|
285
|
+
}\`,
|
|
286
|
+
variables: { file: null, fileFolder },
|
|
287
|
+
}));
|
|
288
|
+
form.append('map', JSON.stringify({ '0': ['variables.file'] }));
|
|
289
|
+
form.append('0', new Blob([fileBuffer], { type: contentType }), filename);
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
const response = await fetch(\`\${this.apiUrl}/graphql\`, {
|
|
293
|
+
method: 'POST',
|
|
294
|
+
headers: {
|
|
295
|
+
Authorization: this.authorizationToken,
|
|
296
|
+
},
|
|
297
|
+
body: form,
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
const result = await response.json();
|
|
301
|
+
|
|
302
|
+
if (result.errors) {
|
|
303
|
+
throw new GenqlError(result.errors, result.data);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
return result.data.uploadFile;
|
|
283
307
|
}
|
|
284
308
|
}
|
|
285
309
|
|
|
286
|
-
|
|
287
|
-
export const createTypedTwentyClient = (options?: TwentyClientOptions): Twenty => {
|
|
288
|
-
return new Twenty(options);
|
|
289
|
-
};
|
|
290
|
-
`)}}class ix{constructor(){this.clientService=new nx}async execute(r=Yt){try{await this.clientService.generate(r)}catch(i){throw console.error(C.default.red("Generate Twenty client failed:"),i instanceof Error?i.message:i),i}}}class rx{constructor(){this.apiService=new Zt}async execute({appPath:r=Yt,askForConfirmation:i}){try{console.log(C.default.blue("🚀 Uninstall Twenty Application")),console.log(C.default.gray(`📁 App Path: ${r}`)),console.log(""),i&&!await this.confirmationPrompt()&&(console.error(C.default.red("⛔️ Aborting uninstall")),process.exit(1));const{manifest:o}=await zr(r);if(!o)return{success:!1,error:"Build failed"};const u=await this.apiService.uninstallApplication(o.application.universalIdentifier);return u.success===!1?console.error(C.default.red("❌ Uninstall failed:"),u.error):console.log(C.default.green("✅ Application uninstalled successfully")),u}catch(o){throw console.error(C.default.red("Uninstall failed:"),o instanceof Error?o.message:o),o}}async confirmationPrompt(){const{confirmation:r}=await zt.default.prompt([{type:"confirm",name:"confirmation",message:"Are you sure you want to uninstall this application?",default:!1}]);return r}}class sx{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(C.default.yellow("⚠ No workspaces configured. Use `twenty auth:login` to create one."));return}console.log(C.default.blue(`Available workspaces:
|
|
291
|
-
`));for(const o of r){const u=await this.configService.getConfigForWorkspace(o),f=!!u.apiKey,v=o===i?C.default.green(" (default)"):"",w=f?C.default.green("●"):C.default.gray("○");console.log(` ${w} ${o}${v}`),console.log(C.default.gray(` API URL: ${u.apiUrl}`))}console.log(""),console.log(C.default.gray("● = authenticated, ○ = no credentials")),console.log(C.default.gray("Use `twenty auth:switch <workspace>` to change default"))}catch(r){console.error(C.default.red("List failed:"),r instanceof Error?r.message:r),process.exit(1)}}}class ax{constructor(){this.configService=new je,this.apiService=new Zt}async execute(r){try{let{apiKey:i,apiUrl:o}=r;const u=await this.configService.getConfig();if(o||(o=(await zt.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 zt.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 g=je.getActiveWorkspace();console.log(C.default.green(`✓ Successfully authenticated with Twenty (workspace: ${g})`))}else console.log(C.default.red("✗ Authentication failed. Please check your credentials.")),process.exit(1)}catch(i){console.error(C.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(C.default.green(`✓ Successfully logged out (workspace: ${r})`))}catch(r){console.error(C.default.red("Logout failed:"),r instanceof Error?r.message:r),process.exit(1)}}}class ux{constructor(){this.configService=new je,this.apiService=new Zt}async execute(){try{const r=je.getActiveWorkspace(),i=await this.configService.getConfig();if(console.log(C.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?C.default.green("✓ Valid"):C.default.red("✗ Invalid")}`)}else console.log(`Status: ${C.default.yellow("⚠ Not authenticated")}`)}catch(r){console.error(C.default.red("Status check failed:"),r instanceof Error?r.message:r),process.exit(1)}}}class cx{constructor(){this.apiService=new Zt}async execute({appPath:r=Yt,functionUniversalIdentifier:i,functionName:o,payload:u="{}"}){try{let f;try{f=JSON.parse(u)}catch{console.error(C.default.red("Invalid JSON payload. Please provide valid JSON.")),process.exit(1)}const{manifest:g}=await zr(r);g||(console.error(C.default.red("Failed to build manifest.")),process.exit(1));const v=await this.apiService.findLogicFunctions();v.success||(console.error(C.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,g)),b=w.find(M=>i?M.universalIdentifier===i:o?M.name===o:!1);if(!b){const M=i||o;console.error(C.default.red(`Function "${M}" not found in application.`)),console.log(""),w.length>0?(console.log(C.default.cyan("Available functions:")),w.forEach($=>{console.log(` - ${C.default.white($.name)} (${$.universalIdentifier})`)})):console.log(C.default.yellow("No functions found for this application. Have you synced your app with `yarn app:sync`?")),process.exit(1)}console.log(C.default.blue(`🚀 Executing function "${b.name}"...`)),console.log(C.default.gray(` Payload: ${JSON.stringify(f)}`)),console.log("");const O=await this.apiService.executeLogicFunction({functionId:b.id,payload:f});O.success||(console.error(C.default.red("Execution failed:"),O.error instanceof Error?O.error.message:O.error),process.exit(1));const D=O.data;console.log(C.default.cyan("─".repeat(60))),console.log(C.default.cyan("Execution Result")),console.log(C.default.cyan("─".repeat(60)));const P=D.status==="SUCCESS"?C.default.green:C.default.red;console.log(`${C.default.bold("Status:")} ${P(D.status)}`),console.log(`${C.default.bold("Duration:")} ${D.duration}ms`),kt.Tr(D.data)&&(console.log(""),console.log(C.default.bold("Data:")),console.log(C.default.white(JSON.stringify(D.data,null,2)))),D.error&&(console.log(""),console.log(C.default.bold.red("Error:")),console.log(C.default.red(` Type: ${D.error.errorType}`)),console.log(C.default.red(` Message: ${D.error.errorMessage}`)),D.error.stackTrace&&(console.log(""),console.log(C.default.gray("Stack trace:")),console.log(C.default.gray(D.error.stackTrace)))),D.logs&&(console.log(""),console.log(C.default.bold("Logs:")),console.log(C.default.gray(D.logs))),console.log(C.default.cyan("─".repeat(60))),D.status!=="SUCCESS"&&process.exit(1)}catch(f){console.error(C.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 Zt}async execute({appPath:r=Yt,functionUniversalIdentifier:i,functionName:o}){try{const{manifest:u}=await zr(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(C.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(C.default.blue(`🚀 Watching ${u} ${f} logs:`)),console.log("")}}class fx{constructor(){this.configService=new je,this.apiService=new Zt}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(C.default.yellow("⚠ No workspaces configured. Use `twenty auth:login` to create one."));return}if(!i){const v=o.map(b=>({name:b===u?`${b} (current default)`:b,value:b}));i=(await zt.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(C.default.red(`✗ Workspace "${i}" not found. Available workspaces: ${o.join(", ")}`)),process.exit(1)),i===u){console.log(C.default.blue(`ℹ "${i}" is already the default workspace.`));return}await this.configService.setDefaultWorkspace(i),je.setActiveWorkspace(i);const g=!!(await this.configService.getConfig()).apiKey;console.log(C.default.green(`✓ Switched default workspace to "${i}"`)),g?(await this.apiService.validateAuth()).authValid?console.log(C.default.green("✓ Authentication is valid")):console.log(C.default.yellow("⚠ Authentication credentials exist but are invalid. Run `twenty auth:login` to re-authenticate.")):console.log(C.default.yellow("⚠ No credentials configured for this workspace. Run `twenty auth:login` to authenticate."))}catch(i){console.error(C.default.red("Switch failed:"),i instanceof Error?i.message:i),process.exit(1)}}}var Ea,Nc;function px(){if(Nc)return Ea;Nc=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",g="\\u2700-\\u27bf",v="a-z\\xdf-\\xf6\\xf8-\\xff",w="\\xac\\xb1\\xd7\\xf7",b="\\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+b+O+D,ge="['’]",oe="["+$+"]",ye="["+u+f+"]",Ye="\\d+",Te="["+g+"]",L="["+v+"]",te="[^"+o+$+Ye+g+v+P+"]",H="\\ud83c[\\udffb-\\udfff]",le="(?:"+ye+"|"+H+")",qe="[^"+o+"]",x="(?:\\ud83c[\\udde6-\\uddff]){2}",q="[\\ud800-\\udbff][\\udc00-\\udfff]",Ae="["+P+"]",xt="\\u200d",en="(?:"+L+"|"+te+")",Wi="(?:"+Ae+"|"+te+")",Gi="(?:"+ge+"(?:d|ll|m|re|s|t|ve))?",Vi="(?:"+ge+"(?:D|LL|M|RE|S|T|VE))?",Ct=le+"?",Tt="["+M+"]?",Hr="(?:"+xt+"(?:"+[qe,x,q].join("|")+")"+Tt+Ct+")*",Bn=Tt+Ct+Hr,st="(?:"+[Te,x,q].join("|")+")"+Bn,Yr=RegExp(ge,"g"),Xr=RegExp(ye,"g"),Kr=RegExp([Ae+"?"+L+"+"+Gi+"(?="+[oe,Ae,"$"].join("|")+")",Wi+"+"+Vi+"(?="+[oe,Ae+en,"$"].join("|")+")",Ae+"?"+en+"+"+Gi,Ae+"+"+Vi,Ye,st].join("|"),"g"),tn=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,jn={À:"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"},Zr=typeof B.commonjsGlobal=="object"&&B.commonjsGlobal&&B.commonjsGlobal.Object===Object&&B.commonjsGlobal,wn=typeof self=="object"&&self&&self.Object===Object&&self,En=Zr||wn||Function("return this")();function es(W,Le,Rt,Qi){for(var bn=-1,yi=W?W.length:0;++bn<yi;)Rt=Le(Rt,W[bn],bn,W);return Rt}function Wn(W){return W.match(r)||[]}function Gn(W){return function(Le){return W?.[Le]}}var qi=Gn(jn);function Xe(W){return tn.test(W)}function Sn(W){return W.match(Kr)||[]}var ts=Object.prototype,wt=ts.toString,mi=En.Symbol,Ji=mi?mi.prototype:void 0,nn=Ji?Ji.toString:void 0;function Ke(W){if(typeof W=="string")return W;if(ns(W))return nn?nn.call(W):"";var Le=W+"";return Le=="0"&&1/W==-1/0?"-0":Le}function An(W){return function(Le){return es(sn(is(Le).replace(Yr,"")),W,"")}}function Vn(W){return!!W&&typeof W=="object"}function ns(W){return typeof W=="symbol"||Vn(W)&&wt.call(W)==n}function rn(W){return W==null?"":Ke(W)}function is(W){return W=rn(W),W&&W.replace(i,qi).replace(Xr,"")}var In=An(function(W,Le,Rt){return W+(Rt?"-":"")+Le.toLowerCase()});function sn(W,Le,Rt){return W=rn(W),Le=Le,Le===void 0?Xe(W)?Sn(W):Wn(W):W.match(Le)||[]}return Ea=In,Ea}var dx=px();const ci=B.getDefaultExportFromCjs(dx),hx=({name:n,universalIdentifier:r=li.v4()})=>{const i=ci(n);return`import { defineFrontComponent } from 'twenty-sdk';
|
|
310
|
+
`;await de.appendFile(ge.join(r,"index.ts"),i)}}class ux{constructor(){this.clientService=new ox}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 cx{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 Yr(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 Ht.default.prompt([{type:"confirm",name:"confirmation",message:"Are you sure you want to uninstall this application?",default:!1}]);return r}}class lx{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:
|
|
311
|
+
`));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 fx{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 Ht.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 Ht.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 g=je.getActiveWorkspace();console.log(R.default.green(`✓ Successfully authenticated with Twenty (workspace: ${g})`))}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 px{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 dx{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 hx{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:g}=await Yr(r);g||(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,g)),b=w.find(M=>i?M.universalIdentifier===i:o?M.name===o:!1);if(!b){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 "${b.name}"...`)),console.log(R.default.gray(` Payload: ${JSON.stringify(f)}`)),console.log("");const O=await this.apiService.executeLogicFunction({functionId:b.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`),Ut.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 gx{constructor(){this.apiService=new en}async execute({appPath:r=Xt,functionUniversalIdentifier:i,functionName:o}){try{const{manifest:u}=await Yr(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 mx{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(b=>({name:b===u?`${b} (current default)`:b,value:b}));i=(await Ht.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 g=!!(await this.configService.getConfig()).apiKey;console.log(R.default.green(`✓ Switched default workspace to "${i}"`)),g?(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 Aa,Cc;function yx(){if(Cc)return Aa;Cc=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",g="\\u2700-\\u27bf",v="a-z\\xdf-\\xf6\\xf8-\\xff",w="\\xac\\xb1\\xd7\\xf7",b="\\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+b+O+D,he="['’]",ae="["+$+"]",me="["+u+f+"]",Ye="\\d+",xe="["+g+"]",L="["+v+"]",ee="[^"+o+$+Ye+g+v+P+"]",H="\\ud83c[\\udffb-\\udfff]",ce="(?:"+me+"|"+H+")",qe="[^"+o+"]",x="(?:\\ud83c[\\udde6-\\uddff]){2}",q="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="["+P+"]",xt="\\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))?",Rt=ce+"?",Tt="["+M+"]?",Xr="(?:"+xt+"(?:"+[qe,x,q].join("|")+")"+Tt+Rt+")*",Wn=Tt+Rt+Xr,st="(?:"+[xe,x,q].join("|")+")"+Wn,Kr=RegExp(he,"g"),Zr=RegExp(me,"g"),es=RegExp([Se+"?"+L+"+"+qi+"(?="+[ae,Se,"$"].join("|")+")",Vi+"+"+Ji+"(?="+[ae,Se+tn,"$"].join("|")+")",Se+"?"+tn+"+"+qi,Se+"+"+Ji,Ye,st].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"},ts=typeof B.commonjsGlobal=="object"&&B.commonjsGlobal&&B.commonjsGlobal.Object===Object&&B.commonjsGlobal,Sn=typeof self=="object"&&self&&self.Object===Object&&self,An=ts||Sn||Function("return this")();function ns(W,Ce,Ct,Hi){for(var On=-1,_i=W?W.length:0;++On<_i;)Ct=Ce(Ct,W[On],On,W);return Ct}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(es)||[]}var is=Object.prototype,wt=is.toString,vi=An.Symbol,Qi=vi?vi.prototype:void 0,rn=Qi?Qi.toString:void 0;function Ke(W){if(typeof W=="string")return W;if(rs(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 ns(an(ss(Ce).replace(Kr,"")),W,"")}}function Jn(W){return!!W&&typeof W=="object"}function rs(W){return typeof W=="symbol"||Jn(W)&&wt.call(W)==n}function sn(W){return W==null?"":Ke(W)}function ss(W){return W=sn(W),W&&W.replace(i,zi).replace(Zr,"")}var Nn=bn(function(W,Ce,Ct){return W+(Ct?"-":"")+Ce.toLowerCase()});function an(W,Ce,Ct){return W=sn(W),Ce=Ce,Ce===void 0?Xe(W)?In(W):Vn(W):W.match(Ce)||[]}return Aa=Nn,Aa}var vx=yx();const fi=B.getDefaultExportFromCjs(vx),_x=({name:n,universalIdentifier:r=pi.v4()})=>{const i=fi(n);return`import { defineFrontComponent } from 'twenty-sdk';
|
|
292
312
|
|
|
293
313
|
// React component - implement your UI here
|
|
294
314
|
const Component = () => {
|
|
@@ -306,7 +326,7 @@ export default defineFrontComponent({
|
|
|
306
326
|
description: 'Add a description for your front component',
|
|
307
327
|
component: Component,
|
|
308
328
|
});
|
|
309
|
-
`},
|
|
329
|
+
`},xx=({name:n,universalIdentifier:r=pi.v4()})=>{const i=fi(n),o=pi.v4();return`import { defineLogicFunction } from 'twenty-sdk';
|
|
310
330
|
|
|
311
331
|
// Logic function handler - rename and implement your logic
|
|
312
332
|
const handler = async (params: {
|
|
@@ -351,36 +371,36 @@ export default defineLogicFunction({
|
|
|
351
371
|
// },
|
|
352
372
|
],
|
|
353
373
|
});
|
|
354
|
-
`};var
|
|
374
|
+
`};var $i={exports:{}};/**
|
|
355
375
|
* @license
|
|
356
376
|
* Lodash <https://lodash.com/>
|
|
357
377
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
358
378
|
* Released under MIT license <https://lodash.com/license>
|
|
359
379
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
360
380
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
361
|
-
*/var mx=Ui.exports,Oc;function yx(){return Oc||(Oc=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.",g="Expected a function",v="Invalid `variable` option passed into `_.template`",w="__lodash_hash_undefined__",b=500,O="__lodash_placeholder__",D=1,P=2,M=4,$=1,ge=2,oe=1,ye=2,Ye=4,Te=8,L=16,te=32,H=64,le=128,qe=256,x=512,q=30,Ae="...",xt=800,en=16,Wi=1,Gi=2,Vi=3,Ct=1/0,Tt=9007199254740991,Hr=17976931348623157e292,Bn=NaN,st=4294967295,Yr=st-1,Xr=st>>>1,Kr=[["ary",le],["bind",oe],["bindKey",ye],["curry",Te],["curryRight",L],["flip",x],["partial",te],["partialRight",H],["rearg",qe]],tn="[object Arguments]",jn="[object Array]",Zr="[object AsyncFunction]",wn="[object Boolean]",En="[object Date]",es="[object DOMException]",Wn="[object Error]",Gn="[object Function]",qi="[object GeneratorFunction]",Xe="[object Map]",Sn="[object Number]",ts="[object Null]",wt="[object Object]",mi="[object Promise]",Ji="[object Proxy]",nn="[object RegExp]",Ke="[object Set]",An="[object String]",Vn="[object Symbol]",ns="[object Undefined]",rn="[object WeakMap]",is="[object WeakSet]",In="[object ArrayBuffer]",sn="[object DataView]",W="[object Float32Array]",Le="[object Float64Array]",Rt="[object Int8Array]",Qi="[object Int16Array]",bn="[object Int32Array]",yi="[object Uint8Array]",rs="[object Uint8ClampedArray]",ss="[object Uint16Array]",as="[object Uint32Array]",bl=/\b__p \+= '';/g,Nl=/\b(__p \+=) '' \+/g,Ol=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Pa=/&(?:amp|lt|gt|quot|#39);/g,ka=/[&<>"']/g,Cl=RegExp(Pa.source),Rl=RegExp(ka.source),Ll=/<%-([\s\S]+?)%>/g,Fl=/<%([\s\S]+?)%>/g,Ua=/<%=([\s\S]+?)%>/g,Dl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pl=/^\w*$/,kl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,os=/[\\^$.*+?()[\]{}|]/g,Ul=RegExp(os.source),us=/^\s+/,Ml=/\s/,$l=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Bl=/\{\n\/\* \[wrapped with (.+)\] \*/,jl=/,? & /,Wl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Gl=/[()=,{}\[\]\/\s]/,Vl=/\\(\\)?/g,ql=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ma=/\w*$/,Jl=/^[-+]0x[0-9a-f]+$/i,Ql=/^0b[01]+$/i,zl=/^\[object .+?Constructor\]$/,Hl=/^0o[0-7]+$/i,Yl=/^(?:0|[1-9]\d*)$/,Xl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,zi=/($^)/,Kl=/['\n\r\u2028\u2029\\]/g,Hi="\\ud800-\\udfff",Zl="\\u0300-\\u036f",ef="\\ufe20-\\ufe2f",tf="\\u20d0-\\u20ff",$a=Zl+ef+tf,Ba="\\u2700-\\u27bf",ja="a-z\\xdf-\\xf6\\xf8-\\xff",nf="\\xac\\xb1\\xd7\\xf7",rf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",sf="\\u2000-\\u206f",af=" \\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",Wa="A-Z\\xc0-\\xd6\\xd8-\\xde",Ga="\\ufe0e\\ufe0f",Va=nf+rf+sf+af,cs="['’]",of="["+Hi+"]",qa="["+Va+"]",Yi="["+$a+"]",Ja="\\d+",uf="["+Ba+"]",Qa="["+ja+"]",za="[^"+Hi+Va+Ja+Ba+ja+Wa+"]",ls="\\ud83c[\\udffb-\\udfff]",cf="(?:"+Yi+"|"+ls+")",Ha="[^"+Hi+"]",fs="(?:\\ud83c[\\udde6-\\uddff]){2}",ps="[\\ud800-\\udbff][\\udc00-\\udfff]",qn="["+Wa+"]",Ya="\\u200d",Xa="(?:"+Qa+"|"+za+")",lf="(?:"+qn+"|"+za+")",Ka="(?:"+cs+"(?:d|ll|m|re|s|t|ve))?",Za="(?:"+cs+"(?:D|LL|M|RE|S|T|VE))?",eo=cf+"?",to="["+Ga+"]?",ff="(?:"+Ya+"(?:"+[Ha,fs,ps].join("|")+")"+to+eo+")*",pf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",df="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",no=to+eo+ff,hf="(?:"+[uf,fs,ps].join("|")+")"+no,gf="(?:"+[Ha+Yi+"?",Yi,fs,ps,of].join("|")+")",mf=RegExp(cs,"g"),yf=RegExp(Yi,"g"),ds=RegExp(ls+"(?="+ls+")|"+gf+no,"g"),vf=RegExp([qn+"?"+Qa+"+"+Ka+"(?="+[qa,qn,"$"].join("|")+")",lf+"+"+Za+"(?="+[qa,qn+Xa,"$"].join("|")+")",qn+"?"+Xa+"+"+Ka,qn+"+"+Za,df,pf,Ja,hf].join("|"),"g"),_f=RegExp("["+Ya+Hi+$a+Ga+"]"),xf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Tf=["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"],wf=-1,we={};we[W]=we[Le]=we[Rt]=we[Qi]=we[bn]=we[yi]=we[rs]=we[ss]=we[as]=!0,we[tn]=we[jn]=we[In]=we[wn]=we[sn]=we[En]=we[Wn]=we[Gn]=we[Xe]=we[Sn]=we[wt]=we[nn]=we[Ke]=we[An]=we[rn]=!1;var xe={};xe[tn]=xe[jn]=xe[In]=xe[sn]=xe[wn]=xe[En]=xe[W]=xe[Le]=xe[Rt]=xe[Qi]=xe[bn]=xe[Xe]=xe[Sn]=xe[wt]=xe[nn]=xe[Ke]=xe[An]=xe[Vn]=xe[yi]=xe[rs]=xe[ss]=xe[as]=!0,xe[Wn]=xe[Gn]=xe[rn]=!1;var Ef={À:"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"},Sf={"&":"&","<":"<",">":">",'"':""","'":"'"},Af={"&":"&","<":"<",">":">",""":'"',"'":"'"},If={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},bf=parseFloat,Nf=parseInt,io=typeof B.commonjsGlobal=="object"&&B.commonjsGlobal&&B.commonjsGlobal.Object===Object&&B.commonjsGlobal,Of=typeof self=="object"&&self&&self.Object===Object&&self,Ue=io||Of||Function("return this")(),hs=r&&!r.nodeType&&r,Nn=hs&&!0&&n&&!n.nodeType&&n,ro=Nn&&Nn.exports===hs,gs=ro&&io.process,at=function(){try{var m=Nn&&Nn.require&&Nn.require("util").types;return m||gs&&gs.binding&&gs.binding("util")}catch{}}(),so=at&&at.isArrayBuffer,ao=at&&at.isDate,oo=at&&at.isMap,uo=at&&at.isRegExp,co=at&&at.isSet,lo=at&&at.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 Cf(m,T,_,F){for(var Q=-1,ue=m==null?0:m.length;++Q<ue;){var Fe=m[Q];T(F,Fe,_(Fe),m)}return F}function ot(m,T){for(var _=-1,F=m==null?0:m.length;++_<F&&T(m[_],_,m)!==!1;);return m}function Rf(m,T){for(var _=m==null?0:m.length;_--&&T(m[_],_,m)!==!1;);return m}function fo(m,T){for(var _=-1,F=m==null?0:m.length;++_<F;)if(!T(m[_],_,m))return!1;return!0}function an(m,T){for(var _=-1,F=m==null?0:m.length,Q=0,ue=[];++_<F;){var Fe=m[_];T(Fe,_,m)&&(ue[Q++]=Fe)}return ue}function Xi(m,T){var _=m==null?0:m.length;return!!_&&Jn(m,T,0)>-1}function ms(m,T,_){for(var F=-1,Q=m==null?0:m.length;++F<Q;)if(_(T,m[F]))return!0;return!1}function Se(m,T){for(var _=-1,F=m==null?0:m.length,Q=Array(F);++_<F;)Q[_]=T(m[_],_,m);return Q}function on(m,T){for(var _=-1,F=T.length,Q=m.length;++_<F;)m[Q+_]=T[_];return m}function ys(m,T,_,F){var Q=-1,ue=m==null?0:m.length;for(F&&ue&&(_=m[++Q]);++Q<ue;)_=T(_,m[Q],Q,m);return _}function Lf(m,T,_,F){var Q=m==null?0:m.length;for(F&&Q&&(_=m[--Q]);Q--;)_=T(_,m[Q],Q,m);return _}function vs(m,T){for(var _=-1,F=m==null?0:m.length;++_<F;)if(T(m[_],_,m))return!0;return!1}var Ff=_s("length");function Df(m){return m.split("")}function Pf(m){return m.match(Wl)||[]}function po(m,T,_){var F;return _(m,function(Q,ue,Fe){if(T(Q,ue,Fe))return F=ue,!1}),F}function Ki(m,T,_,F){for(var Q=m.length,ue=_+(F?1:-1);F?ue--:++ue<Q;)if(T(m[ue],ue,m))return ue;return-1}function Jn(m,T,_){return T===T?Qf(m,T,_):Ki(m,ho,_)}function kf(m,T,_,F){for(var Q=_-1,ue=m.length;++Q<ue;)if(F(m[Q],T))return Q;return-1}function ho(m){return m!==m}function go(m,T){var _=m==null?0:m.length;return _?Ts(m,T)/_:Bn}function _s(m){return function(T){return T==null?i:T[m]}}function xs(m){return function(T){return m==null?i:m[T]}}function mo(m,T,_,F,Q){return Q(m,function(ue,Fe,ve){_=F?(F=!1,ue):T(_,ue,Fe,ve)}),_}function Uf(m,T){var _=m.length;for(m.sort(T);_--;)m[_]=m[_].value;return m}function Ts(m,T){for(var _,F=-1,Q=m.length;++F<Q;){var ue=T(m[F]);ue!==i&&(_=_===i?ue:_+ue)}return _}function ws(m,T){for(var _=-1,F=Array(m);++_<m;)F[_]=T(_);return F}function Mf(m,T){return Se(T,function(_){return[_,m[_]]})}function yo(m){return m&&m.slice(0,To(m)+1).replace(us,"")}function et(m){return function(T){return m(T)}}function Es(m,T){return Se(T,function(_){return m[_]})}function vi(m,T){return m.has(T)}function vo(m,T){for(var _=-1,F=m.length;++_<F&&Jn(T,m[_],0)>-1;);return _}function _o(m,T){for(var _=m.length;_--&&Jn(T,m[_],0)>-1;);return _}function $f(m,T){for(var _=m.length,F=0;_--;)m[_]===T&&++F;return F}var Bf=xs(Ef),jf=xs(Sf);function Wf(m){return"\\"+If[m]}function Gf(m,T){return m==null?i:m[T]}function Qn(m){return _f.test(m)}function Vf(m){return xf.test(m)}function qf(m){for(var T,_=[];!(T=m.next()).done;)_.push(T.value);return _}function Ss(m){var T=-1,_=Array(m.size);return m.forEach(function(F,Q){_[++T]=[Q,F]}),_}function xo(m,T){return function(_){return m(T(_))}}function un(m,T){for(var _=-1,F=m.length,Q=0,ue=[];++_<F;){var Fe=m[_];(Fe===T||Fe===O)&&(m[_]=O,ue[Q++]=_)}return ue}function Zi(m){var T=-1,_=Array(m.size);return m.forEach(function(F){_[++T]=F}),_}function Jf(m){var T=-1,_=Array(m.size);return m.forEach(function(F){_[++T]=[F,F]}),_}function Qf(m,T,_){for(var F=_-1,Q=m.length;++F<Q;)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 zn(m){return Qn(m)?Yf(m):Ff(m)}function Et(m){return Qn(m)?Xf(m):Df(m)}function To(m){for(var T=m.length;T--&&Ml.test(m.charAt(T)););return T}var Hf=xs(Af);function Yf(m){for(var T=ds.lastIndex=0;ds.test(m);)++T;return T}function Xf(m){return m.match(ds)||[]}function Kf(m){return m.match(vf)||[]}var Zf=function m(T){T=T==null?Ue:Hn.defaults(Ue.Object(),T,Hn.pick(Ue,Tf));var _=T.Array,F=T.Date,Q=T.Error,ue=T.Function,Fe=T.Math,ve=T.Object,As=T.RegExp,ep=T.String,ut=T.TypeError,er=_.prototype,tp=ue.prototype,Yn=ve.prototype,tr=T["__core-js_shared__"],nr=tp.toString,de=Yn.hasOwnProperty,np=0,wo=function(){var e=/[^.]+$/.exec(tr&&tr.keys&&tr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ir=Yn.toString,ip=nr.call(ve),rp=Ue._,sp=As("^"+nr.call(de).replace(os,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rr=ro?T.Buffer:i,cn=T.Symbol,sr=T.Uint8Array,Eo=rr?rr.allocUnsafe:i,ar=xo(ve.getPrototypeOf,ve),So=ve.create,Ao=Yn.propertyIsEnumerable,or=er.splice,Io=cn?cn.isConcatSpreadable:i,_i=cn?cn.iterator:i,On=cn?cn.toStringTag:i,ur=function(){try{var e=Dn(ve,"defineProperty");return e({},"",{}),e}catch{}}(),ap=T.clearTimeout!==Ue.clearTimeout&&T.clearTimeout,op=F&&F.now!==Ue.Date.now&&F.now,up=T.setTimeout!==Ue.setTimeout&&T.setTimeout,cr=Fe.ceil,lr=Fe.floor,Is=ve.getOwnPropertySymbols,cp=rr?rr.isBuffer:i,bo=T.isFinite,lp=er.join,fp=xo(ve.keys,ve),De=Fe.max,$e=Fe.min,pp=F.now,dp=T.parseInt,No=Fe.random,hp=er.reverse,bs=Dn(T,"DataView"),xi=Dn(T,"Map"),Ns=Dn(T,"Promise"),Xn=Dn(T,"Set"),Ti=Dn(T,"WeakMap"),wi=Dn(ve,"create"),fr=Ti&&new Ti,Kn={},gp=Pn(bs),mp=Pn(xi),yp=Pn(Ns),vp=Pn(Xn),_p=Pn(Ti),pr=cn?cn.prototype:i,Ei=pr?pr.valueOf:i,Oo=pr?pr.toString:i;function l(e){if(be(e)&&!z(e)&&!(e instanceof ne)){if(e instanceof ct)return e;if(de.call(e,"__wrapped__"))return Cu(e)}return new ct(e)}var Zn=function(){function e(){}return function(t){if(!Ie(t))return{};if(So)return So(t);e.prototype=t;var s=new e;return e.prototype=i,s}}();function dr(){}function ct(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}l.templateSettings={escape:Ll,evaluate:Fl,interpolate:Ua,variable:"",imports:{_:l}},l.prototype=dr.prototype,l.prototype.constructor=l,ct.prototype=Zn(dr.prototype),ct.prototype.constructor=ct;function ne(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=st,this.__views__=[]}function xp(){var e=new ne(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 Tp(){if(this.__filtered__){var e=new ne(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function wp(){var e=this.__wrapped__.value(),t=this.__dir__,s=z(e),a=t<0,c=s?e.length:0,p=Dd(0,c,this.__views__),d=p.start,h=p.end,y=h-d,E=a?h:d-1,S=this.__iteratees__,I=S.length,R=0,U=$e(y,this.__takeCount__);if(!s||!a&&c==y&&U==y)return Zo(e,this.__actions__);var G=[];e:for(;y--&&R<U;){E+=t;for(var X=-1,V=e[E];++X<I;){var ee=S[X],re=ee.iteratee,it=ee.type,Ve=re(V);if(it==Gi)V=Ve;else if(!Ve){if(it==Wi)continue e;break e}}G[R++]=V}return G}ne.prototype=Zn(dr.prototype),ne.prototype.constructor=ne;function Cn(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 Ep(){this.__data__=wi?wi(null):{},this.size=0}function Sp(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Ap(e){var t=this.__data__;if(wi){var s=t[e];return s===w?i:s}return de.call(t,e)?t[e]:i}function Ip(e){var t=this.__data__;return wi?t[e]!==i:de.call(t,e)}function bp(e,t){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=wi&&t===i?w:t,this}Cn.prototype.clear=Ep,Cn.prototype.delete=Sp,Cn.prototype.get=Ap,Cn.prototype.has=Ip,Cn.prototype.set=bp;function Mt(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__=[],this.size=0}function Op(e){var t=this.__data__,s=hr(t,e);if(s<0)return!1;var a=t.length-1;return s==a?t.pop():or.call(t,s,1),--this.size,!0}function Cp(e){var t=this.__data__,s=hr(t,e);return s<0?i:t[s][1]}function Rp(e){return hr(this.__data__,e)>-1}function Lp(e,t){var s=this.__data__,a=hr(s,e);return a<0?(++this.size,s.push([e,t])):s[a][1]=t,this}Mt.prototype.clear=Np,Mt.prototype.delete=Op,Mt.prototype.get=Cp,Mt.prototype.has=Rp,Mt.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.size=0,this.__data__={hash:new Cn,map:new(xi||Mt),string:new Cn}}function Dp(e){var t=Ir(this,e).delete(e);return this.size-=t?1:0,t}function Pp(e){return Ir(this,e).get(e)}function kp(e){return Ir(this,e).has(e)}function Up(e,t){var s=Ir(this,e),a=s.size;return s.set(e,t),this.size+=s.size==a?0:1,this}$t.prototype.clear=Fp,$t.prototype.delete=Dp,$t.prototype.get=Pp,$t.prototype.has=kp,$t.prototype.set=Up;function Rn(e){var t=-1,s=e==null?0:e.length;for(this.__data__=new $t;++t<s;)this.add(e[t])}function Mp(e){return this.__data__.set(e,w),this}function $p(e){return this.__data__.has(e)}Rn.prototype.add=Rn.prototype.push=Mp,Rn.prototype.has=$p;function St(e){var t=this.__data__=new Mt(e);this.size=t.size}function Bp(){this.__data__=new Mt,this.size=0}function jp(e){var t=this.__data__,s=t.delete(e);return this.size=t.size,s}function Wp(e){return this.__data__.get(e)}function Gp(e){return this.__data__.has(e)}function Vp(e,t){var s=this.__data__;if(s instanceof Mt){var a=s.__data__;if(!xi||a.length<u-1)return a.push([e,t]),this.size=++s.size,this;s=this.__data__=new $t(a)}return s.set(e,t),this.size=s.size,this}St.prototype.clear=Bp,St.prototype.delete=jp,St.prototype.get=Wp,St.prototype.has=Gp,St.prototype.set=Vp;function Co(e,t){var s=z(e),a=!s&&kn(e),c=!s&&!a&&hn(e),p=!s&&!a&&!c&&ii(e),d=s||a||c||p,h=d?ws(e.length,ep):[],y=h.length;for(var E in e)(t||de.call(e,E))&&!(d&&(E=="length"||c&&(E=="offset"||E=="parent")||p&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||Gt(E,y)))&&h.push(E);return h}function Ro(e){var t=e.length;return t?e[$s(0,t-1)]:i}function qp(e,t){return br(Je(e),Ln(t,0,e.length))}function Jp(e){return br(Je(e))}function Os(e,t,s){(s!==i&&!At(e[t],s)||s===i&&!(t in e))&&Bt(e,t,s)}function Si(e,t,s){var a=e[t];(!(de.call(e,t)&&At(a,s))||s===i&&!(t in e))&&Bt(e,t,s)}function hr(e,t){for(var s=e.length;s--;)if(At(e[s][0],t))return s;return-1}function Qp(e,t,s,a){return ln(e,function(c,p,d){t(a,c,s(c),d)}),a}function Lo(e,t){return e&&Ft(t,Pe(t),e)}function zp(e,t){return e&&Ft(t,ze(t),e)}function Bt(e,t,s){t=="__proto__"&&ur?ur(e,t,{configurable:!0,enumerable:!0,value:s,writable:!0}):e[t]=s}function Cs(e,t){for(var s=-1,a=t.length,c=_(a),p=e==null;++s<a;)c[s]=p?i:la(e,t[s]);return c}function Ln(e,t,s){return e===e&&(s!==i&&(e=e<=s?e:s),t!==i&&(e=e>=t?e:t)),e}function lt(e,t,s,a,c,p){var d,h=t&D,y=t&P,E=t&M;if(s&&(d=c?s(e,a,c,p):s(e)),d!==i)return d;if(!Ie(e))return e;var S=z(e);if(S){if(d=kd(e),!h)return Je(e,d)}else{var I=Be(e),R=I==Gn||I==qi;if(hn(e))return nu(e,h);if(I==wt||I==tn||R&&!c){if(d=y||R?{}:Tu(e),!h)return y?Ad(e,zp(d,e)):Sd(e,Lo(d,e))}else{if(!xe[I])return c?e:{};d=Ud(e,I,h)}}p||(p=new St);var U=p.get(e);if(U)return U;p.set(e,d),Yu(e)?e.forEach(function(V){d.add(lt(V,t,s,V,e,p))}):zu(e)&&e.forEach(function(V,ee){d.set(ee,lt(V,t,s,ee,e,p))});var G=E?y?Ys:Hs:y?ze:Pe,X=S?i:G(e);return ot(X||e,function(V,ee){X&&(ee=V,V=e[ee]),Si(d,ee,lt(V,t,s,ee,e,p))}),d}function Hp(e){var t=Pe(e);return function(s){return Fo(s,e,t)}}function Fo(e,t,s){var a=s.length;if(e==null)return!a;for(e=ve(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 Do(e,t,s){if(typeof e!="function")throw new ut(g);return Ri(function(){e.apply(i,s)},t)}function Ai(e,t,s,a){var c=-1,p=Xi,d=!0,h=e.length,y=[],E=t.length;if(!h)return y;s&&(t=Se(t,et(s))),a?(p=ms,d=!1):t.length>=u&&(p=vi,d=!1,t=new Rn(t));e:for(;++c<h;){var S=e[c],I=s==null?S:s(S);if(S=a||S!==0?S:0,d&&I===I){for(var R=E;R--;)if(t[R]===I)continue e;y.push(S)}else p(t,I,a)||y.push(S)}return y}var ln=ou(Lt),Po=ou(Ls,!0);function Yp(e,t){var s=!0;return ln(e,function(a,c,p){return s=!!t(a,c,p),s}),s}function gr(e,t,s){for(var a=-1,c=e.length;++a<c;){var p=e[a],d=t(p);if(d!=null&&(h===i?d===d&&!nt(d):s(d,h)))var h=d,y=p}return y}function Xp(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:Ku(a);s<a;)e[s++]=t;return e}function ko(e,t){var s=[];return ln(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=$d),c||(c=[]);++p<d;){var h=e[p];t>0&&s(h)?t>1?Me(h,t-1,s,a,c):on(c,h):a||(c[c.length]=h)}return c}var Rs=uu(),Uo=uu(!0);function Lt(e,t){return e&&Rs(e,t,Pe)}function Ls(e,t){return e&&Uo(e,t,Pe)}function mr(e,t){return an(t,function(s){return Vt(e[s])})}function Fn(e,t){t=pn(t,e);for(var s=0,a=t.length;e!=null&&s<a;)e=e[Dt(t[s++])];return s&&s==a?e:i}function Mo(e,t,s){var a=t(e);return z(e)?a:on(a,s(e))}function We(e){return e==null?e===i?ns:ts:On&&On in ve(e)?Fd(e):Jd(e)}function Fs(e,t){return e>t}function Kp(e,t){return e!=null&&de.call(e,t)}function Zp(e,t){return e!=null&&t in ve(e)}function ed(e,t,s){return e>=$e(t,s)&&e<De(t,s)}function Ds(e,t,s){for(var a=s?ms:Xi,c=e[0].length,p=e.length,d=p,h=_(p),y=1/0,E=[];d--;){var S=e[d];d&&t&&(S=Se(S,et(t))),y=$e(S.length,y),h[d]=!s&&(t||c>=120&&S.length>=120)?new Rn(d&&S):i}S=e[0];var I=-1,R=h[0];e:for(;++I<c&&E.length<y;){var U=S[I],G=t?t(U):U;if(U=s||U!==0?U:0,!(R?vi(R,G):a(E,G,s))){for(d=p;--d;){var X=h[d];if(!(X?vi(X,G):a(e[d],G,s)))continue e}R&&R.push(G),E.push(U)}}return E}function td(e,t,s,a){return Lt(e,function(c,p,d){t(a,s(c),p,d)}),a}function Ii(e,t,s){t=pn(t,e),e=Au(e,t);var a=e==null?e:e[Dt(pt(t))];return a==null?i:Ze(a,e,s)}function $o(e){return be(e)&&We(e)==tn}function nd(e){return be(e)&&We(e)==In}function id(e){return be(e)&&We(e)==En}function bi(e,t,s,a,c){return e===t?!0:e==null||t==null||!be(e)&&!be(t)?e!==e&&t!==t:rd(e,t,s,a,bi,c)}function rd(e,t,s,a,c,p){var d=z(e),h=z(t),y=d?jn:Be(e),E=h?jn:Be(t);y=y==tn?wt:y,E=E==tn?wt:E;var S=y==wt,I=E==wt,R=y==E;if(R&&hn(e)){if(!hn(t))return!1;d=!0,S=!1}if(R&&!S)return p||(p=new St),d||ii(e)?vu(e,t,s,a,c,p):Rd(e,t,y,s,a,c,p);if(!(s&$)){var U=S&&de.call(e,"__wrapped__"),G=I&&de.call(t,"__wrapped__");if(U||G){var X=U?e.value():e,V=G?t.value():t;return p||(p=new St),c(X,V,s,a,p)}}return R?(p||(p=new St),Ld(e,t,s,a,c,p)):!1}function sd(e){return be(e)&&Be(e)==Xe}function Ps(e,t,s,a){var c=s.length,p=c,d=!a;if(e==null)return!p;for(e=ve(e);c--;){var h=s[c];if(d&&h[2]?h[1]!==e[h[0]]:!(h[0]in e))return!1}for(;++c<p;){h=s[c];var y=h[0],E=e[y],S=h[1];if(d&&h[2]){if(E===i&&!(y in e))return!1}else{var I=new St;if(a)var R=a(E,S,y,e,t,I);if(!(R===i?bi(S,E,$|ge,a,I):R))return!1}}return!0}function Bo(e){if(!Ie(e)||jd(e))return!1;var t=Vt(e)?sp:zl;return t.test(Pn(e))}function ad(e){return be(e)&&We(e)==nn}function od(e){return be(e)&&Be(e)==Ke}function ud(e){return be(e)&&Fr(e.length)&&!!we[We(e)]}function jo(e){return typeof e=="function"?e:e==null?He:typeof e=="object"?z(e)?Vo(e[0],e[1]):Go(e):cc(e)}function ks(e){if(!Ci(e))return fp(e);var t=[];for(var s in ve(e))de.call(e,s)&&s!="constructor"&&t.push(s);return t}function cd(e){if(!Ie(e))return qd(e);var t=Ci(e),s=[];for(var a in e)a=="constructor"&&(t||!de.call(e,a))||s.push(a);return s}function Us(e,t){return e<t}function Wo(e,t){var s=-1,a=Qe(e)?_(e.length):[];return ln(e,function(c,p,d){a[++s]=t(c,p,d)}),a}function Go(e){var t=Ks(e);return t.length==1&&t[0][2]?Eu(t[0][0],t[0][1]):function(s){return s===e||Ps(s,e,t)}}function Vo(e,t){return ea(e)&&wu(t)?Eu(Dt(e),t):function(s){var a=la(s,e);return a===i&&a===t?fa(s,e):bi(t,a,$|ge)}}function yr(e,t,s,a,c){e!==t&&Rs(t,function(p,d){if(c||(c=new St),Ie(p))ld(e,t,d,s,yr,a,c);else{var h=a?a(na(e,d),p,d+"",e,t,c):i;h===i&&(h=p),Os(e,d,h)}},ze)}function ld(e,t,s,a,c,p,d){var h=na(e,s),y=na(t,s),E=d.get(y);if(E){Os(e,s,E);return}var S=p?p(h,y,s+"",e,t,d):i,I=S===i;if(I){var R=z(y),U=!R&&hn(y),G=!R&&!U&&ii(y);S=y,R||U||G?z(h)?S=h:Ne(h)?S=Je(h):U?(I=!1,S=nu(y,!0)):G?(I=!1,S=iu(y,!0)):S=[]:Li(y)||kn(y)?(S=h,kn(h)?S=Zu(h):(!Ie(h)||Vt(h))&&(S=Tu(y))):I=!1}I&&(d.set(y,S),c(S,y,a,p,d),d.delete(y)),Os(e,s,S)}function qo(e,t){var s=e.length;if(s)return t+=t<0?s:0,Gt(t,s)?e[t]:i}function Jo(e,t,s){t.length?t=Se(t,function(p){return z(p)?function(d){return Fn(d,p.length===1?p[0]:p)}:p}):t=[He];var a=-1;t=Se(t,et(j()));var c=Wo(e,function(p,d,h){var y=Se(t,function(E){return E(p)});return{criteria:y,index:++a,value:p}});return Uf(c,function(p,d){return Ed(p,d,s)})}function fd(e,t){return Qo(e,t,function(s,a){return fa(e,a)})}function Qo(e,t,s){for(var a=-1,c=t.length,p={};++a<c;){var d=t[a],h=Fn(e,d);s(h,d)&&Ni(p,pn(d,e),h)}return p}function pd(e){return function(t){return Fn(t,e)}}function Ms(e,t,s,a){var c=a?kf:Jn,p=-1,d=t.length,h=e;for(e===t&&(t=Je(t)),s&&(h=Se(e,et(s)));++p<d;)for(var y=0,E=t[p],S=s?s(E):E;(y=c(h,S,y,a))>-1;)h!==e&&or.call(h,y,1),or.call(e,y,1);return e}function zo(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;Gt(c)?or.call(e,c,1):Ws(e,c)}}return e}function $s(e,t){return e+lr(No()*(t-e+1))}function dd(e,t,s,a){for(var c=-1,p=De(cr((t-e)/(s||1)),0),d=_(p);p--;)d[a?p:++c]=e,e+=s;return d}function Bs(e,t){var s="";if(!e||t<1||t>Tt)return s;do t%2&&(s+=e),t=lr(t/2),t&&(e+=e);while(t);return s}function K(e,t){return ia(Su(e,t,He),e+"")}function hd(e){return Ro(ri(e))}function gd(e,t){var s=ri(e);return br(s,Ln(t,0,s.length))}function Ni(e,t,s,a){if(!Ie(e))return e;t=pn(t,e);for(var c=-1,p=t.length,d=p-1,h=e;h!=null&&++c<p;){var y=Dt(t[c]),E=s;if(y==="__proto__"||y==="constructor"||y==="prototype")return e;if(c!=d){var S=h[y];E=a?a(S,y,h):i,E===i&&(E=Ie(S)?S:Gt(t[c+1])?[]:{})}Si(h,y,E),h=h[y]}return e}var Ho=fr?function(e,t){return fr.set(e,t),e}:He,md=ur?function(e,t){return ur(e,"toString",{configurable:!0,enumerable:!1,value:da(t),writable:!0})}:He;function yd(e){return br(ri(e))}function ft(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 vd(e,t){var s;return ln(e,function(a,c,p){return s=t(a,c,p),!s}),!!s}function vr(e,t,s){var a=0,c=e==null?a:e.length;if(typeof t=="number"&&t===t&&c<=Xr){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 js(e,t,He,s)}function js(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,h=t===null,y=nt(t),E=t===i;c<p;){var S=lr((c+p)/2),I=s(e[S]),R=I!==i,U=I===null,G=I===I,X=nt(I);if(d)var V=a||G;else E?V=G&&(a||R):h?V=G&&R&&(a||!U):y?V=G&&R&&!U&&(a||!X):U||X?V=!1:V=a?I<=t:I<t;V?c=S+1:p=S}return $e(p,Yr)}function Yo(e,t){for(var s=-1,a=e.length,c=0,p=[];++s<a;){var d=e[s],h=t?t(d):d;if(!s||!At(h,y)){var y=h;p[c++]=d===0?0:d}}return p}function Xo(e){return typeof e=="number"?e:nt(e)?Bn:+e}function tt(e){if(typeof e=="string")return e;if(z(e))return Se(e,tt)+"";if(nt(e))return Oo?Oo.call(e):"";var t=e+"";return t=="0"&&1/e==-Ct?"-0":t}function fn(e,t,s){var a=-1,c=Xi,p=e.length,d=!0,h=[],y=h;if(s)d=!1,c=ms;else if(p>=u){var E=t?null:Od(e);if(E)return Zi(E);d=!1,c=vi,y=new Rn}else y=t?[]:h;e:for(;++a<p;){var S=e[a],I=t?t(S):S;if(S=s||S!==0?S:0,d&&I===I){for(var R=y.length;R--;)if(y[R]===I)continue e;t&&y.push(I),h.push(S)}else c(y,I,s)||(y!==h&&y.push(I),h.push(S))}return h}function Ws(e,t){return t=pn(t,e),e=Au(e,t),e==null||delete e[Dt(pt(t))]}function Ko(e,t,s,a){return Ni(e,t,s(Fn(e,t)),a)}function _r(e,t,s,a){for(var c=e.length,p=a?c:-1;(a?p--:++p<c)&&t(e[p],p,e););return s?ft(e,a?0:p,a?p+1:c):ft(e,a?p+1:0,a?c:p)}function Zo(e,t){var s=e;return s instanceof ne&&(s=s.value()),ys(t,function(a,c){return c.func.apply(c.thisArg,on([a],c.args))},s)}function Gs(e,t,s){var a=e.length;if(a<2)return a?fn(e[0]):[];for(var c=-1,p=_(a);++c<a;)for(var d=e[c],h=-1;++h<a;)h!=c&&(p[c]=Ai(p[c]||d,e[h],t,s));return fn(Me(p,1),t,s)}function eu(e,t,s){for(var a=-1,c=e.length,p=t.length,d={};++a<c;){var h=a<p?t[a]:i;s(d,e[a],h)}return d}function Vs(e){return Ne(e)?e:[]}function qs(e){return typeof e=="function"?e:He}function pn(e,t){return z(e)?e:ea(e,t)?[e]:Ou(fe(e))}var _d=K;function dn(e,t,s){var a=e.length;return s=s===i?a:s,!t&&s>=a?e:ft(e,t,s)}var tu=ap||function(e){return Ue.clearTimeout(e)};function nu(e,t){if(t)return e.slice();var s=e.length,a=Eo?Eo(s):new e.constructor(s);return e.copy(a),a}function Js(e){var t=new e.constructor(e.byteLength);return new sr(t).set(new sr(e)),t}function xd(e,t){var s=t?Js(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function Td(e){var t=new e.constructor(e.source,Ma.exec(e));return t.lastIndex=e.lastIndex,t}function wd(e){return Ei?ve(Ei.call(e)):{}}function iu(e,t){var s=t?Js(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function ru(e,t){if(e!==t){var s=e!==i,a=e===null,c=e===e,p=nt(e),d=t!==i,h=t===null,y=t===t,E=nt(t);if(!h&&!E&&!p&&e>t||p&&d&&y&&!h&&!E||a&&d&&y||!s&&y||!c)return 1;if(!a&&!p&&!E&&e<t||E&&s&&c&&!a&&!p||h&&s&&c||!d&&c||!y)return-1}return 0}function Ed(e,t,s){for(var a=-1,c=e.criteria,p=t.criteria,d=c.length,h=s.length;++a<d;){var y=ru(c[a],p[a]);if(y){if(a>=h)return y;var E=s[a];return y*(E=="desc"?-1:1)}}return e.index-t.index}function su(e,t,s,a){for(var c=-1,p=e.length,d=s.length,h=-1,y=t.length,E=De(p-d,0),S=_(y+E),I=!a;++h<y;)S[h]=t[h];for(;++c<d;)(I||c<p)&&(S[s[c]]=e[c]);for(;E--;)S[h++]=e[c++];return S}function au(e,t,s,a){for(var c=-1,p=e.length,d=-1,h=s.length,y=-1,E=t.length,S=De(p-h,0),I=_(S+E),R=!a;++c<S;)I[c]=e[c];for(var U=c;++y<E;)I[U+y]=t[y];for(;++d<h;)(R||c<p)&&(I[U+s[d]]=e[c++]);return I}function Je(e,t){var s=-1,a=e.length;for(t||(t=_(a));++s<a;)t[s]=e[s];return t}function Ft(e,t,s,a){var c=!s;s||(s={});for(var p=-1,d=t.length;++p<d;){var h=t[p],y=a?a(s[h],e[h],h,s,e):i;y===i&&(y=e[h]),c?Bt(s,h,y):Si(s,h,y)}return s}function Sd(e,t){return Ft(e,Zs(e),t)}function Ad(e,t){return Ft(e,_u(e),t)}function xr(e,t){return function(s,a){var c=z(s)?Cf:Qp,p=t?t():{};return c(s,e,j(a,2),p)}}function ei(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=ve(t);++a<c;){var h=s[a];h&&e(t,h,a,p)}return t})}function ou(e,t){return function(s,a){if(s==null)return s;if(!Qe(s))return e(s,a);for(var c=s.length,p=t?c:-1,d=ve(s);(t?p--:++p<c)&&a(d[p],p,d)!==!1;);return s}}function uu(e){return function(t,s,a){for(var c=-1,p=ve(t),d=a(t),h=d.length;h--;){var y=d[e?h:++c];if(s(p[y],y,p)===!1)break}return t}}function Id(e,t,s){var a=t&oe,c=Oi(e);function p(){var d=this&&this!==Ue&&this instanceof p?c:e;return d.apply(a?s:this,arguments)}return p}function cu(e){return function(t){t=fe(t);var s=Qn(t)?Et(t):i,a=s?s[0]:t.charAt(0),c=s?dn(s,1).join(""):t.slice(1);return a[e]()+c}}function ti(e){return function(t){return ys(oc(ac(t).replace(mf,"")),e,"")}}function Oi(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=Zn(e.prototype),a=e.apply(s,t);return Ie(a)?a:s}}function bd(e,t,s){var a=Oi(e);function c(){for(var p=arguments.length,d=_(p),h=p,y=ni(c);h--;)d[h]=arguments[h];var E=p<3&&d[0]!==y&&d[p-1]!==y?[]:un(d,y);if(p-=E.length,p<s)return hu(e,t,Tr,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 lu(e){return function(t,s,a){var c=ve(t);if(!Qe(t)){var p=j(s,3);t=Pe(t),s=function(h){return p(c[h],h,c)}}var d=e(t,s,a);return d>-1?c[p?t[d]:d]:i}}function fu(e){return Wt(function(t){var s=t.length,a=s,c=ct.prototype.thru;for(e&&t.reverse();a--;){var p=t[a];if(typeof p!="function")throw new ut(g);if(c&&!d&&Ar(p)=="wrapper")var d=new ct([],!0)}for(a=d?a:s;++a<s;){p=t[a];var h=Ar(p),y=h=="wrapper"?Xs(p):i;y&&ta(y[0])&&y[1]==(le|Te|te|qe)&&!y[4].length&&y[9]==1?d=d[Ar(y[0])].apply(d,y[3]):d=p.length==1&&ta(p)?d[h]():d.thru(p)}return function(){var E=arguments,S=E[0];if(d&&E.length==1&&z(S))return d.plant(S).value();for(var I=0,R=s?t[I].apply(this,E):S;++I<s;)R=t[I].call(this,R);return R}})}function Tr(e,t,s,a,c,p,d,h,y,E){var S=t&le,I=t&oe,R=t&ye,U=t&(Te|L),G=t&x,X=R?i:Oi(e);function V(){for(var ee=arguments.length,re=_(ee),it=ee;it--;)re[it]=arguments[it];if(U)var Ve=ni(V),rt=$f(re,Ve);if(a&&(re=su(re,a,c,U)),p&&(re=au(re,p,d,U)),ee-=rt,U&&ee<E){var Oe=un(re,Ve);return hu(e,t,Tr,V.placeholder,s,re,Oe,h,y,E-ee)}var It=I?s:this,Jt=R?It[e]:e;return ee=re.length,h?re=Qd(re,h):G&&ee>1&&re.reverse(),S&&y<ee&&(re.length=y),this&&this!==Ue&&this instanceof V&&(Jt=X||Oi(Jt)),Jt.apply(It,re)}return V}function pu(e,t){return function(s,a){return td(s,e,t(a),{})}}function wr(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=Xo(s),a=Xo(a)),c=e(s,a)}return c}}function Qs(e){return Wt(function(t){return t=Se(t,et(j())),K(function(s){var a=this;return e(t,function(c){return Ze(c,a,s)})})})}function Er(e,t){t=t===i?" ":tt(t);var s=t.length;if(s<2)return s?Bs(t,e):t;var a=Bs(t,cr(e/zn(t)));return Qn(t)?dn(Et(a),0,e).join(""):a.slice(0,e)}function Nd(e,t,s,a){var c=t&oe,p=Oi(e);function d(){for(var h=-1,y=arguments.length,E=-1,S=a.length,I=_(S+y),R=this&&this!==Ue&&this instanceof d?p:e;++E<S;)I[E]=a[E];for(;y--;)I[E++]=arguments[++h];return Ze(R,c?s:this,I)}return d}function du(e){return function(t,s,a){return a&&typeof a!="number"&&Ge(t,s,a)&&(s=a=i),t=qt(t),s===i?(s=t,t=0):s=qt(s),a=a===i?t<s?1:-1:qt(a),dd(t,s,a,e)}}function Sr(e){return function(t,s){return typeof t=="string"&&typeof s=="string"||(t=dt(t),s=dt(s)),e(t,s)}}function hu(e,t,s,a,c,p,d,h,y,E){var S=t&Te,I=S?d:i,R=S?i:d,U=S?p:i,G=S?i:p;t|=S?te:H,t&=~(S?H:te),t&Ye||(t&=-4);var X=[e,t,c,U,I,G,R,h,y,E],V=s.apply(i,X);return ta(e)&&Iu(V,X),V.placeholder=a,bu(V,e,t)}function zs(e){var t=Fe[e];return function(s,a){if(s=dt(s),a=a==null?0:$e(Y(a),292),a&&bo(s)){var c=(fe(s)+"e").split("e"),p=t(c[0]+"e"+(+c[1]+a));return c=(fe(p)+"e").split("e"),+(c[0]+"e"+(+c[1]-a))}return t(s)}}var Od=Xn&&1/Zi(new Xn([,-0]))[1]==Ct?function(e){return new Xn(e)}:ma;function gu(e){return function(t){var s=Be(t);return s==Xe?Ss(t):s==Ke?Jf(t):Mf(t,e(t))}}function jt(e,t,s,a,c,p,d,h){var y=t&ye;if(!y&&typeof e!="function")throw new ut(g);var E=a?a.length:0;if(E||(t&=-97,a=c=i),d=d===i?d:De(Y(d),0),h=h===i?h:Y(h),E-=c?c.length:0,t&H){var S=a,I=c;a=c=i}var R=y?i:Xs(e),U=[e,t,s,a,c,S,I,p,d,h];if(R&&Vd(U,R),e=U[0],t=U[1],s=U[2],a=U[3],c=U[4],h=U[9]=U[9]===i?y?0:e.length:De(U[9]-E,0),!h&&t&(Te|L)&&(t&=-25),!t||t==oe)var G=Id(e,t,s);else t==Te||t==L?G=bd(e,t,h):(t==te||t==(oe|te))&&!c.length?G=Nd(e,t,s,a):G=Tr.apply(i,U);var X=R?Ho:Iu;return bu(X(G,U),e,t)}function mu(e,t,s,a){return e===i||At(e,Yn[s])&&!de.call(a,s)?t:e}function yu(e,t,s,a,c,p){return Ie(e)&&Ie(t)&&(p.set(t,e),yr(e,t,i,yu,p),p.delete(t)),e}function Cd(e){return Li(e)?i:e}function vu(e,t,s,a,c,p){var d=s&$,h=e.length,y=t.length;if(h!=y&&!(d&&y>h))return!1;var E=p.get(e),S=p.get(t);if(E&&S)return E==t&&S==e;var I=-1,R=!0,U=s&ge?new Rn:i;for(p.set(e,t),p.set(t,e);++I<h;){var G=e[I],X=t[I];if(a)var V=d?a(X,G,I,t,e,p):a(G,X,I,e,t,p);if(V!==i){if(V)continue;R=!1;break}if(U){if(!vs(t,function(ee,re){if(!vi(U,re)&&(G===ee||c(G,ee,s,a,p)))return U.push(re)})){R=!1;break}}else if(!(G===X||c(G,X,s,a,p))){R=!1;break}}return p.delete(e),p.delete(t),R}function Rd(e,t,s,a,c,p,d){switch(s){case sn:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case In:return!(e.byteLength!=t.byteLength||!p(new sr(e),new sr(t)));case wn:case En:case Sn:return At(+e,+t);case Wn:return e.name==t.name&&e.message==t.message;case nn:case An:return e==t+"";case Xe:var h=Ss;case Ke:var y=a&$;if(h||(h=Zi),e.size!=t.size&&!y)return!1;var E=d.get(e);if(E)return E==t;a|=ge,d.set(e,t);var S=vu(h(e),h(t),a,c,p,d);return d.delete(e),S;case Vn:if(Ei)return Ei.call(e)==Ei.call(t)}return!1}function Ld(e,t,s,a,c,p){var d=s&$,h=Hs(e),y=h.length,E=Hs(t),S=E.length;if(y!=S&&!d)return!1;for(var I=y;I--;){var R=h[I];if(!(d?R in t:de.call(t,R)))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;++I<y;){R=h[I];var ee=e[R],re=t[R];if(a)var it=d?a(re,ee,R,t,e,p):a(ee,re,R,e,t,p);if(!(it===i?ee===re||c(ee,re,s,a,p):it)){X=!1;break}V||(V=R=="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 Wt(e){return ia(Su(e,i,Fu),e+"")}function Hs(e){return Mo(e,Pe,Zs)}function Ys(e){return Mo(e,ze,_u)}var Xs=fr?function(e){return fr.get(e)}:ma;function Ar(e){for(var t=e.name+"",s=Kn[t],a=de.call(Kn,t)?s.length:0;a--;){var c=s[a],p=c.func;if(p==null||p==e)return c.name}return t}function ni(e){var t=de.call(l,"placeholder")?l:e;return t.placeholder}function j(){var e=l.iteratee||ha;return e=e===ha?jo:e,arguments.length?e(arguments[0],arguments[1]):e}function Ir(e,t){var s=e.__data__;return Bd(t)?s[typeof t=="string"?"string":"hash"]:s.map}function Ks(e){for(var t=Pe(e),s=t.length;s--;){var a=t[s],c=e[a];t[s]=[a,c,wu(c)]}return t}function Dn(e,t){var s=Gf(e,t);return Bo(s)?s:i}function Fd(e){var t=de.call(e,On),s=e[On];try{e[On]=i;var a=!0}catch{}var c=ir.call(e);return a&&(t?e[On]=s:delete e[On]),c}var Zs=Is?function(e){return e==null?[]:(e=ve(e),an(Is(e),function(t){return Ao.call(e,t)}))}:ya,_u=Is?function(e){for(var t=[];e;)on(t,Zs(e)),e=ar(e);return t}:ya,Be=We;(bs&&Be(new bs(new ArrayBuffer(1)))!=sn||xi&&Be(new xi)!=Xe||Ns&&Be(Ns.resolve())!=mi||Xn&&Be(new Xn)!=Ke||Ti&&Be(new Ti)!=rn)&&(Be=function(e){var t=We(e),s=t==wt?e.constructor:i,a=s?Pn(s):"";if(a)switch(a){case gp:return sn;case mp:return Xe;case yp:return mi;case vp:return Ke;case _p:return rn}return t});function Dd(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=De(e,t-d);break}}return{start:e,end:t}}function Pd(e){var t=e.match(Bl);return t?t[1].split(jl):[]}function xu(e,t,s){t=pn(t,e);for(var a=-1,c=t.length,p=!1;++a<c;){var d=Dt(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&&Fr(c)&&Gt(d,c)&&(z(e)||kn(e)))}function kd(e){var t=e.length,s=new e.constructor(t);return t&&typeof e[0]=="string"&&de.call(e,"index")&&(s.index=e.index,s.input=e.input),s}function Tu(e){return typeof e.constructor=="function"&&!Ci(e)?Zn(ar(e)):{}}function Ud(e,t,s){var a=e.constructor;switch(t){case In:return Js(e);case wn:case En:return new a(+e);case sn:return xd(e,s);case W:case Le:case Rt:case Qi:case bn:case yi:case rs:case ss:case as:return iu(e,s);case Xe:return new a;case Sn:case An:return new a(e);case nn:return Td(e);case Ke:return new a;case Vn:return wd(e)}}function Md(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($l,`{
|
|
381
|
+
*/var Tx=$i.exports,Lc;function wx(){return Lc||(Lc=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.",g="Expected a function",v="Invalid `variable` option passed into `_.template`",w="__lodash_hash_undefined__",b=500,O="__lodash_placeholder__",D=1,P=2,M=4,$=1,he=2,ae=1,me=2,Ye=4,xe=8,L=16,ee=32,H=64,ce=128,qe=256,x=512,q=30,Se="...",xt=800,tn=16,Vi=1,qi=2,Ji=3,Rt=1/0,Tt=9007199254740991,Xr=17976931348623157e292,Wn=NaN,st=4294967295,Kr=st-1,Zr=st>>>1,es=[["ary",ce],["bind",ae],["bindKey",me],["curry",xe],["curryRight",L],["flip",x],["partial",ee],["partialRight",H],["rearg",qe]],nn="[object Arguments]",Gn="[object Array]",ts="[object AsyncFunction]",Sn="[object Boolean]",An="[object Date]",ns="[object DOMException]",Vn="[object Error]",qn="[object Function]",zi="[object GeneratorFunction]",Xe="[object Map]",In="[object Number]",is="[object Null]",wt="[object Object]",vi="[object Promise]",Qi="[object Proxy]",rn="[object RegExp]",Ke="[object Set]",bn="[object String]",Jn="[object Symbol]",rs="[object Undefined]",sn="[object WeakMap]",ss="[object WeakSet]",Nn="[object ArrayBuffer]",an="[object DataView]",W="[object Float32Array]",Ce="[object Float64Array]",Ct="[object Int8Array]",Hi="[object Int16Array]",On="[object Int32Array]",_i="[object Uint8Array]",as="[object Uint8ClampedArray]",os="[object Uint16Array]",us="[object Uint32Array]",Rl=/\b__p \+= '';/g,Cl=/\b(__p \+=) '' \+/g,Ll=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ma=/&(?:amp|lt|gt|quot|#39);/g,$a=/[&<>"']/g,Fl=RegExp(Ma.source),Dl=RegExp($a.source),Pl=/<%-([\s\S]+?)%>/g,kl=/<%([\s\S]+?)%>/g,Ba=/<%=([\s\S]+?)%>/g,Ul=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ml=/^\w*$/,$l=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cs=/[\\^$.*+?()[\]{}|]/g,Bl=RegExp(cs.source),ls=/^\s+/,jl=/\s/,Wl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Gl=/\{\n\/\* \[wrapped with (.+)\] \*/,Vl=/,? & /,ql=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Jl=/[()=,{}\[\]\/\s]/,zl=/\\(\\)?/g,Ql=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ja=/\w*$/,Hl=/^[-+]0x[0-9a-f]+$/i,Yl=/^0b[01]+$/i,Xl=/^\[object .+?Constructor\]$/,Kl=/^0o[0-7]+$/i,Zl=/^(?:0|[1-9]\d*)$/,ef=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Yi=/($^)/,tf=/['\n\r\u2028\u2029\\]/g,Xi="\\ud800-\\udfff",nf="\\u0300-\\u036f",rf="\\ufe20-\\ufe2f",sf="\\u20d0-\\u20ff",Wa=nf+rf+sf,Ga="\\u2700-\\u27bf",Va="a-z\\xdf-\\xf6\\xf8-\\xff",af="\\xac\\xb1\\xd7\\xf7",of="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",uf="\\u2000-\\u206f",cf=" \\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",Ja="\\ufe0e\\ufe0f",za=af+of+uf+cf,fs="['’]",lf="["+Xi+"]",Qa="["+za+"]",Ki="["+Wa+"]",Ha="\\d+",ff="["+Ga+"]",Ya="["+Va+"]",Xa="[^"+Xi+za+Ha+Ga+Va+qa+"]",ps="\\ud83c[\\udffb-\\udfff]",pf="(?:"+Ki+"|"+ps+")",Ka="[^"+Xi+"]",ds="(?:\\ud83c[\\udde6-\\uddff]){2}",hs="[\\ud800-\\udbff][\\udc00-\\udfff]",zn="["+qa+"]",Za="\\u200d",eo="(?:"+Ya+"|"+Xa+")",df="(?:"+zn+"|"+Xa+")",to="(?:"+fs+"(?:d|ll|m|re|s|t|ve))?",no="(?:"+fs+"(?:D|LL|M|RE|S|T|VE))?",io=pf+"?",ro="["+Ja+"]?",hf="(?:"+Za+"(?:"+[Ka,ds,hs].join("|")+")"+ro+io+")*",gf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",mf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",so=ro+io+hf,yf="(?:"+[ff,ds,hs].join("|")+")"+so,vf="(?:"+[Ka+Ki+"?",Ki,ds,hs,lf].join("|")+")",_f=RegExp(fs,"g"),xf=RegExp(Ki,"g"),gs=RegExp(ps+"(?="+ps+")|"+vf+so,"g"),Tf=RegExp([zn+"?"+Ya+"+"+to+"(?="+[Qa,zn,"$"].join("|")+")",df+"+"+no+"(?="+[Qa,zn+eo,"$"].join("|")+")",zn+"?"+eo+"+"+to,zn+"+"+no,mf,gf,Ha,yf].join("|"),"g"),wf=RegExp("["+Za+Xi+Wa+Ja+"]"),Ef=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Sf=["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"],Af=-1,Te={};Te[W]=Te[Ce]=Te[Ct]=Te[Hi]=Te[On]=Te[_i]=Te[as]=Te[os]=Te[us]=!0,Te[nn]=Te[Gn]=Te[Nn]=Te[Sn]=Te[an]=Te[An]=Te[Vn]=Te[qn]=Te[Xe]=Te[In]=Te[wt]=Te[rn]=Te[Ke]=Te[bn]=Te[sn]=!1;var _e={};_e[nn]=_e[Gn]=_e[Nn]=_e[an]=_e[Sn]=_e[An]=_e[W]=_e[Ce]=_e[Ct]=_e[Hi]=_e[On]=_e[Xe]=_e[In]=_e[wt]=_e[rn]=_e[Ke]=_e[bn]=_e[Jn]=_e[_i]=_e[as]=_e[os]=_e[us]=!0,_e[Vn]=_e[qn]=_e[sn]=!1;var If={À:"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"},bf={"&":"&","<":"<",">":">",'"':""","'":"'"},Nf={"&":"&","<":"<",">":">",""":'"',"'":"'"},Of={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Rf=parseFloat,Cf=parseInt,ao=typeof B.commonjsGlobal=="object"&&B.commonjsGlobal&&B.commonjsGlobal.Object===Object&&B.commonjsGlobal,Lf=typeof self=="object"&&self&&self.Object===Object&&self,Ue=ao||Lf||Function("return this")(),ms=r&&!r.nodeType&&r,Rn=ms&&!0&&n&&!n.nodeType&&n,oo=Rn&&Rn.exports===ms,ys=oo&&ao.process,at=function(){try{var m=Rn&&Rn.require&&Rn.require("util").types;return m||ys&&ys.binding&&ys.binding("util")}catch{}}(),uo=at&&at.isArrayBuffer,co=at&&at.isDate,lo=at&&at.isMap,fo=at&&at.isRegExp,po=at&&at.isSet,ho=at&&at.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 Ff(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 ot(m,T){for(var _=-1,F=m==null?0:m.length;++_<F&&T(m[_],_,m)!==!1;);return m}function Df(m,T){for(var _=m==null?0:m.length;_--&&T(m[_],_,m)!==!1;);return m}function go(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!!_&&Qn(m,T,0)>-1}function vs(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 _s(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 Pf(m,T,_,F){var z=m==null?0:m.length;for(F&&z&&(_=m[--z]);z--;)_=T(_,m[z],z,m);return _}function xs(m,T){for(var _=-1,F=m==null?0:m.length;++_<F;)if(T(m[_],_,m))return!0;return!1}var kf=Ts("length");function Uf(m){return m.split("")}function Mf(m){return m.match(ql)||[]}function mo(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 Qn(m,T,_){return T===T?Yf(m,T,_):er(m,yo,_)}function $f(m,T,_,F){for(var z=_-1,oe=m.length;++z<oe;)if(F(m[z],T))return z;return-1}function yo(m){return m!==m}function vo(m,T){var _=m==null?0:m.length;return _?Es(m,T)/_:Wn}function Ts(m){return function(T){return T==null?i:T[m]}}function ws(m){return function(T){return m==null?i:m[T]}}function _o(m,T,_,F,z){return z(m,function(oe,Le,ye){_=F?(F=!1,oe):T(_,oe,Le,ye)}),_}function Bf(m,T){var _=m.length;for(m.sort(T);_--;)m[_]=m[_].value;return m}function Es(m,T){for(var _,F=-1,z=m.length;++F<z;){var oe=T(m[F]);oe!==i&&(_=_===i?oe:_+oe)}return _}function Ss(m,T){for(var _=-1,F=Array(m);++_<m;)F[_]=T(_);return F}function jf(m,T){return Ee(T,function(_){return[_,m[_]]})}function xo(m){return m&&m.slice(0,So(m)+1).replace(ls,"")}function et(m){return function(T){return m(T)}}function As(m,T){return Ee(T,function(_){return m[_]})}function xi(m,T){return m.has(T)}function To(m,T){for(var _=-1,F=m.length;++_<F&&Qn(T,m[_],0)>-1;);return _}function wo(m,T){for(var _=m.length;_--&&Qn(T,m[_],0)>-1;);return _}function Wf(m,T){for(var _=m.length,F=0;_--;)m[_]===T&&++F;return F}var Gf=ws(If),Vf=ws(bf);function qf(m){return"\\"+Of[m]}function Jf(m,T){return m==null?i:m[T]}function Hn(m){return wf.test(m)}function zf(m){return Ef.test(m)}function Qf(m){for(var T,_=[];!(T=m.next()).done;)_.push(T.value);return _}function Is(m){var T=-1,_=Array(m.size);return m.forEach(function(F,z){_[++T]=[z,F]}),_}function Eo(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 Hf(m){var T=-1,_=Array(m.size);return m.forEach(function(F){_[++T]=[F,F]}),_}function Yf(m,T,_){for(var F=_-1,z=m.length;++F<z;)if(m[F]===T)return F;return-1}function Xf(m,T,_){for(var F=_+1;F--;)if(m[F]===T)return F;return F}function Yn(m){return Hn(m)?Zf(m):kf(m)}function Et(m){return Hn(m)?ep(m):Uf(m)}function So(m){for(var T=m.length;T--&&jl.test(m.charAt(T)););return T}var Kf=ws(Nf);function Zf(m){for(var T=gs.lastIndex=0;gs.test(m);)++T;return T}function ep(m){return m.match(gs)||[]}function tp(m){return m.match(Tf)||[]}var np=function m(T){T=T==null?Ue:Xn.defaults(Ue.Object(),T,Xn.pick(Ue,Sf));var _=T.Array,F=T.Date,z=T.Error,oe=T.Function,Le=T.Math,ye=T.Object,bs=T.RegExp,ip=T.String,ut=T.TypeError,nr=_.prototype,rp=oe.prototype,Kn=ye.prototype,ir=T["__core-js_shared__"],rr=rp.toString,pe=Kn.hasOwnProperty,sp=0,Ao=function(){var e=/[^.]+$/.exec(ir&&ir.keys&&ir.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),sr=Kn.toString,ap=rr.call(ye),op=Ue._,up=bs("^"+rr.call(pe).replace(cs,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ar=oo?T.Buffer:i,ln=T.Symbol,or=T.Uint8Array,Io=ar?ar.allocUnsafe:i,ur=Eo(ye.getPrototypeOf,ye),bo=ye.create,No=Kn.propertyIsEnumerable,cr=nr.splice,Oo=ln?ln.isConcatSpreadable:i,Ti=ln?ln.iterator:i,Cn=ln?ln.toStringTag:i,lr=function(){try{var e=kn(ye,"defineProperty");return e({},"",{}),e}catch{}}(),cp=T.clearTimeout!==Ue.clearTimeout&&T.clearTimeout,lp=F&&F.now!==Ue.Date.now&&F.now,fp=T.setTimeout!==Ue.setTimeout&&T.setTimeout,fr=Le.ceil,pr=Le.floor,Ns=ye.getOwnPropertySymbols,pp=ar?ar.isBuffer:i,Ro=T.isFinite,dp=nr.join,hp=Eo(ye.keys,ye),Fe=Le.max,$e=Le.min,gp=F.now,mp=T.parseInt,Co=Le.random,yp=nr.reverse,Os=kn(T,"DataView"),wi=kn(T,"Map"),Rs=kn(T,"Promise"),Zn=kn(T,"Set"),Ei=kn(T,"WeakMap"),Si=kn(ye,"create"),dr=Ei&&new Ei,ei={},vp=Un(Os),_p=Un(wi),xp=Un(Rs),Tp=Un(Zn),wp=Un(Ei),hr=ln?ln.prototype:i,Ai=hr?hr.valueOf:i,Lo=hr?hr.toString:i;function l(e){if(Ie(e)&&!Q(e)&&!(e instanceof te)){if(e instanceof ct)return e;if(pe.call(e,"__wrapped__"))return Fu(e)}return new ct(e)}var ti=function(){function e(){}return function(t){if(!Ae(t))return{};if(bo)return bo(t);e.prototype=t;var s=new e;return e.prototype=i,s}}();function gr(){}function ct(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}l.templateSettings={escape:Pl,evaluate:kl,interpolate:Ba,variable:"",imports:{_:l}},l.prototype=gr.prototype,l.prototype.constructor=l,ct.prototype=ti(gr.prototype),ct.prototype.constructor=ct;function te(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=st,this.__views__=[]}function Ep(){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 Sp(){if(this.__filtered__){var e=new te(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Ap(){var e=this.__wrapped__.value(),t=this.__dir__,s=Q(e),a=t<0,c=s?e.length:0,p=Ud(0,c,this.__views__),d=p.start,h=p.end,y=h-d,E=a?h:d-1,S=this.__iteratees__,I=S.length,C=0,U=$e(y,this.__takeCount__);if(!s||!a&&c==y&&U==y)return nu(e,this.__actions__);var G=[];e:for(;y--&&C<U;){E+=t;for(var X=-1,V=e[E];++X<I;){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 Ip(){this.__data__=Si?Si(null):{},this.size=0}function bp(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Np(e){var t=this.__data__;if(Si){var s=t[e];return s===w?i:s}return pe.call(t,e)?t[e]:i}function Op(e){var t=this.__data__;return Si?t[e]!==i:pe.call(t,e)}function Rp(e,t){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=Si&&t===i?w:t,this}Ln.prototype.clear=Ip,Ln.prototype.delete=bp,Ln.prototype.get=Np,Ln.prototype.has=Op,Ln.prototype.set=Rp;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 Cp(){this.__data__=[],this.size=0}function Lp(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 Fp(e){var t=this.__data__,s=mr(t,e);return s<0?i:t[s][1]}function Dp(e){return mr(this.__data__,e)>-1}function Pp(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=Cp,$t.prototype.delete=Lp,$t.prototype.get=Fp,$t.prototype.has=Dp,$t.prototype.set=Pp;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 kp(){this.size=0,this.__data__={hash:new Ln,map:new(wi||$t),string:new Ln}}function Up(e){var t=Nr(this,e).delete(e);return this.size-=t?1:0,t}function Mp(e){return Nr(this,e).get(e)}function $p(e){return Nr(this,e).has(e)}function Bp(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=kp,Bt.prototype.delete=Up,Bt.prototype.get=Mp,Bt.prototype.has=$p,Bt.prototype.set=Bp;function Fn(e){var t=-1,s=e==null?0:e.length;for(this.__data__=new Bt;++t<s;)this.add(e[t])}function jp(e){return this.__data__.set(e,w),this}function Wp(e){return this.__data__.has(e)}Fn.prototype.add=Fn.prototype.push=jp,Fn.prototype.has=Wp;function St(e){var t=this.__data__=new $t(e);this.size=t.size}function Gp(){this.__data__=new $t,this.size=0}function Vp(e){var t=this.__data__,s=t.delete(e);return this.size=t.size,s}function qp(e){return this.__data__.get(e)}function Jp(e){return this.__data__.has(e)}function zp(e,t){var s=this.__data__;if(s instanceof $t){var a=s.__data__;if(!wi||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}St.prototype.clear=Gp,St.prototype.delete=Vp,St.prototype.get=qp,St.prototype.has=Jp,St.prototype.set=zp;function Fo(e,t){var s=Q(e),a=!s&&Mn(e),c=!s&&!a&&gn(e),p=!s&&!a&&!c&&si(e),d=s||a||c||p,h=d?Ss(e.length,ip):[],y=h.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)))&&h.push(E);return h}function Do(e){var t=e.length;return t?e[js(0,t-1)]:i}function Qp(e,t){return Or(Je(e),Dn(t,0,e.length))}function Hp(e){return Or(Je(e))}function Cs(e,t,s){(s!==i&&!At(e[t],s)||s===i&&!(t in e))&&jt(e,t,s)}function Ii(e,t,s){var a=e[t];(!(pe.call(e,t)&&At(a,s))||s===i&&!(t in e))&&jt(e,t,s)}function mr(e,t){for(var s=e.length;s--;)if(At(e[s][0],t))return s;return-1}function Yp(e,t,s,a){return fn(e,function(c,p,d){t(a,c,s(c),d)}),a}function Po(e,t){return e&&Ft(t,Pe(t),e)}function Xp(e,t){return e&&Ft(t,Qe(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 Ls(e,t){for(var s=-1,a=t.length,c=_(a),p=e==null;++s<a;)c[s]=p?i:pa(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 lt(e,t,s,a,c,p){var d,h=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=Q(e);if(S){if(d=$d(e),!h)return Je(e,d)}else{var I=Be(e),C=I==qn||I==zi;if(gn(e))return su(e,h);if(I==wt||I==nn||C&&!c){if(d=y||C?{}:Su(e),!h)return y?Nd(e,Xp(d,e)):bd(e,Po(d,e))}else{if(!_e[I])return c?e:{};d=Bd(e,I,h)}}p||(p=new St);var U=p.get(e);if(U)return U;p.set(e,d),Zu(e)?e.forEach(function(V){d.add(lt(V,t,s,V,e,p))}):Xu(e)&&e.forEach(function(V,Z){d.set(Z,lt(V,t,s,Z,e,p))});var G=E?y?Ks:Xs:y?Qe:Pe,X=S?i:G(e);return ot(X||e,function(V,Z){X&&(Z=V,V=e[Z]),Ii(d,Z,lt(V,t,s,Z,e,p))}),d}function Kp(e){var t=Pe(e);return function(s){return ko(s,e,t)}}function ko(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 Uo(e,t,s){if(typeof e!="function")throw new ut(g);return Fi(function(){e.apply(i,s)},t)}function bi(e,t,s,a){var c=-1,p=Zi,d=!0,h=e.length,y=[],E=t.length;if(!h)return y;s&&(t=Ee(t,et(s))),a?(p=vs,d=!1):t.length>=u&&(p=xi,d=!1,t=new Fn(t));e:for(;++c<h;){var S=e[c],I=s==null?S:s(S);if(S=a||S!==0?S:0,d&&I===I){for(var C=E;C--;)if(t[C]===I)continue e;y.push(S)}else p(t,I,a)||y.push(S)}return y}var fn=lu(Lt),Mo=lu(Ds,!0);function Zp(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&&(h===i?d===d&&!nt(d):s(d,h)))var h=d,y=p}return y}function ed(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:tc(a);s<a;)e[s++]=t;return e}function $o(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=Wd),c||(c=[]);++p<d;){var h=e[p];t>0&&s(h)?t>1?Me(h,t-1,s,a,c):un(c,h):a||(c[c.length]=h)}return c}var Fs=fu(),Bo=fu(!0);function Lt(e,t){return e&&Fs(e,t,Pe)}function Ds(e,t){return e&&Bo(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[Dt(t[s++])];return s&&s==a?e:i}function jo(e,t,s){var a=t(e);return Q(e)?a:un(a,s(e))}function We(e){return e==null?e===i?rs:is:Cn&&Cn in ye(e)?kd(e):Hd(e)}function Ps(e,t){return e>t}function td(e,t){return e!=null&&pe.call(e,t)}function nd(e,t){return e!=null&&t in ye(e)}function id(e,t,s){return e>=$e(t,s)&&e<Fe(t,s)}function ks(e,t,s){for(var a=s?vs:Zi,c=e[0].length,p=e.length,d=p,h=_(p),y=1/0,E=[];d--;){var S=e[d];d&&t&&(S=Ee(S,et(t))),y=$e(S.length,y),h[d]=!s&&(t||c>=120&&S.length>=120)?new Fn(d&&S):i}S=e[0];var I=-1,C=h[0];e:for(;++I<c&&E.length<y;){var U=S[I],G=t?t(U):U;if(U=s||U!==0?U:0,!(C?xi(C,G):a(E,G,s))){for(d=p;--d;){var X=h[d];if(!(X?xi(X,G):a(e[d],G,s)))continue e}C&&C.push(G),E.push(U)}}return E}function rd(e,t,s,a){return Lt(e,function(c,p,d){t(a,s(c),p,d)}),a}function Ni(e,t,s){t=dn(t,e),e=Nu(e,t);var a=e==null?e:e[Dt(pt(t))];return a==null?i:Ze(a,e,s)}function Wo(e){return Ie(e)&&We(e)==nn}function sd(e){return Ie(e)&&We(e)==Nn}function ad(e){return Ie(e)&&We(e)==An}function Oi(e,t,s,a,c){return e===t?!0:e==null||t==null||!Ie(e)&&!Ie(t)?e!==e&&t!==t:od(e,t,s,a,Oi,c)}function od(e,t,s,a,c,p){var d=Q(e),h=Q(t),y=d?Gn:Be(e),E=h?Gn:Be(t);y=y==nn?wt:y,E=E==nn?wt:E;var S=y==wt,I=E==wt,C=y==E;if(C&&gn(e)){if(!gn(t))return!1;d=!0,S=!1}if(C&&!S)return p||(p=new St),d||si(e)?Tu(e,t,s,a,c,p):Dd(e,t,y,s,a,c,p);if(!(s&$)){var U=S&&pe.call(e,"__wrapped__"),G=I&&pe.call(t,"__wrapped__");if(U||G){var X=U?e.value():e,V=G?t.value():t;return p||(p=new St),c(X,V,s,a,p)}}return C?(p||(p=new St),Pd(e,t,s,a,c,p)):!1}function ud(e){return Ie(e)&&Be(e)==Xe}function Us(e,t,s,a){var c=s.length,p=c,d=!a;if(e==null)return!p;for(e=ye(e);c--;){var h=s[c];if(d&&h[2]?h[1]!==e[h[0]]:!(h[0]in e))return!1}for(;++c<p;){h=s[c];var y=h[0],E=e[y],S=h[1];if(d&&h[2]){if(E===i&&!(y in e))return!1}else{var I=new St;if(a)var C=a(E,S,y,e,t,I);if(!(C===i?Oi(S,E,$|he,a,I):C))return!1}}return!0}function Go(e){if(!Ae(e)||Vd(e))return!1;var t=qt(e)?up:Xl;return t.test(Un(e))}function cd(e){return Ie(e)&&We(e)==rn}function ld(e){return Ie(e)&&Be(e)==Ke}function fd(e){return Ie(e)&&Pr(e.length)&&!!Te[We(e)]}function Vo(e){return typeof e=="function"?e:e==null?He:typeof e=="object"?Q(e)?zo(e[0],e[1]):Jo(e):pc(e)}function Ms(e){if(!Li(e))return hp(e);var t=[];for(var s in ye(e))pe.call(e,s)&&s!="constructor"&&t.push(s);return t}function pd(e){if(!Ae(e))return Qd(e);var t=Li(e),s=[];for(var a in e)a=="constructor"&&(t||!pe.call(e,a))||s.push(a);return s}function $s(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 Jo(e){var t=ea(e);return t.length==1&&t[0][2]?Iu(t[0][0],t[0][1]):function(s){return s===e||Us(s,e,t)}}function zo(e,t){return na(e)&&Au(t)?Iu(Dt(e),t):function(s){var a=pa(s,e);return a===i&&a===t?da(s,e):Oi(t,a,$|he)}}function _r(e,t,s,a,c){e!==t&&Fs(t,function(p,d){if(c||(c=new St),Ae(p))dd(e,t,d,s,_r,a,c);else{var h=a?a(ra(e,d),p,d+"",e,t,c):i;h===i&&(h=p),Cs(e,d,h)}},Qe)}function dd(e,t,s,a,c,p,d){var h=ra(e,s),y=ra(t,s),E=d.get(y);if(E){Cs(e,s,E);return}var S=p?p(h,y,s+"",e,t,d):i,I=S===i;if(I){var C=Q(y),U=!C&&gn(y),G=!C&&!U&&si(y);S=y,C||U||G?Q(h)?S=h:be(h)?S=Je(h):U?(I=!1,S=su(y,!0)):G?(I=!1,S=au(y,!0)):S=[]:Di(y)||Mn(y)?(S=h,Mn(h)?S=nc(h):(!Ae(h)||qt(h))&&(S=Su(y))):I=!1}I&&(d.set(y,S),c(S,y,a,p,d),d.delete(y)),Cs(e,s,S)}function Qo(e,t){var s=e.length;if(s)return t+=t<0?s:0,Vt(t,s)?e[t]:i}function Ho(e,t,s){t.length?t=Ee(t,function(p){return Q(p)?function(d){return Pn(d,p.length===1?p[0]:p)}:p}):t=[He];var a=-1;t=Ee(t,et(j()));var c=qo(e,function(p,d,h){var y=Ee(t,function(E){return E(p)});return{criteria:y,index:++a,value:p}});return Bf(c,function(p,d){return Id(p,d,s)})}function hd(e,t){return Yo(e,t,function(s,a){return da(e,a)})}function Yo(e,t,s){for(var a=-1,c=t.length,p={};++a<c;){var d=t[a],h=Pn(e,d);s(h,d)&&Ri(p,dn(d,e),h)}return p}function gd(e){return function(t){return Pn(t,e)}}function Bs(e,t,s,a){var c=a?$f:Qn,p=-1,d=t.length,h=e;for(e===t&&(t=Je(t)),s&&(h=Ee(e,et(s)));++p<d;)for(var y=0,E=t[p],S=s?s(E):E;(y=c(h,S,y,a))>-1;)h!==e&&cr.call(h,y,1),cr.call(e,y,1);return e}function Xo(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):Vs(e,c)}}return e}function js(e,t){return e+pr(Co()*(t-e+1))}function md(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 Ws(e,t){var s="";if(!e||t<1||t>Tt)return s;do t%2&&(s+=e),t=pr(t/2),t&&(e+=e);while(t);return s}function K(e,t){return sa(bu(e,t,He),e+"")}function yd(e){return Do(ai(e))}function vd(e,t){var s=ai(e);return Or(s,Dn(t,0,s.length))}function Ri(e,t,s,a){if(!Ae(e))return e;t=dn(t,e);for(var c=-1,p=t.length,d=p-1,h=e;h!=null&&++c<p;){var y=Dt(t[c]),E=s;if(y==="__proto__"||y==="constructor"||y==="prototype")return e;if(c!=d){var S=h[y];E=a?a(S,y,h):i,E===i&&(E=Ae(S)?S:Vt(t[c+1])?[]:{})}Ii(h,y,E),h=h[y]}return e}var Ko=dr?function(e,t){return dr.set(e,t),e}:He,_d=lr?function(e,t){return lr(e,"toString",{configurable:!0,enumerable:!1,value:ga(t),writable:!0})}:He;function xd(e){return Or(ai(e))}function ft(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 Td(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<=Zr){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 Gs(e,t,He,s)}function Gs(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,h=t===null,y=nt(t),E=t===i;c<p;){var S=pr((c+p)/2),I=s(e[S]),C=I!==i,U=I===null,G=I===I,X=nt(I);if(d)var V=a||G;else E?V=G&&(a||C):h?V=G&&C&&(a||!U):y?V=G&&C&&!U&&(a||!X):U||X?V=!1:V=a?I<=t:I<t;V?c=S+1:p=S}return $e(p,Kr)}function Zo(e,t){for(var s=-1,a=e.length,c=0,p=[];++s<a;){var d=e[s],h=t?t(d):d;if(!s||!At(h,y)){var y=h;p[c++]=d===0?0:d}}return p}function eu(e){return typeof e=="number"?e:nt(e)?Wn:+e}function tt(e){if(typeof e=="string")return e;if(Q(e))return Ee(e,tt)+"";if(nt(e))return Lo?Lo.call(e):"";var t=e+"";return t=="0"&&1/e==-Rt?"-0":t}function pn(e,t,s){var a=-1,c=Zi,p=e.length,d=!0,h=[],y=h;if(s)d=!1,c=vs;else if(p>=u){var E=t?null:Ld(e);if(E)return tr(E);d=!1,c=xi,y=new Fn}else y=t?[]:h;e:for(;++a<p;){var S=e[a],I=t?t(S):S;if(S=s||S!==0?S:0,d&&I===I){for(var C=y.length;C--;)if(y[C]===I)continue e;t&&y.push(I),h.push(S)}else c(y,I,s)||(y!==h&&y.push(I),h.push(S))}return h}function Vs(e,t){return t=dn(t,e),e=Nu(e,t),e==null||delete e[Dt(pt(t))]}function tu(e,t,s,a){return Ri(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?ft(e,a?0:p,a?p+1:c):ft(e,a?p+1:0,a?c:p)}function nu(e,t){var s=e;return s instanceof te&&(s=s.value()),_s(t,function(a,c){return c.func.apply(c.thisArg,un([a],c.args))},s)}function qs(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],h=-1;++h<a;)h!=c&&(p[c]=bi(p[c]||d,e[h],t,s));return pn(Me(p,1),t,s)}function iu(e,t,s){for(var a=-1,c=e.length,p=t.length,d={};++a<c;){var h=a<p?t[a]:i;s(d,e[a],h)}return d}function Js(e){return be(e)?e:[]}function zs(e){return typeof e=="function"?e:He}function dn(e,t){return Q(e)?e:na(e,t)?[e]:Lu(le(e))}var wd=K;function hn(e,t,s){var a=e.length;return s=s===i?a:s,!t&&s>=a?e:ft(e,t,s)}var ru=cp||function(e){return Ue.clearTimeout(e)};function su(e,t){if(t)return e.slice();var s=e.length,a=Io?Io(s):new e.constructor(s);return e.copy(a),a}function Qs(e){var t=new e.constructor(e.byteLength);return new or(t).set(new or(e)),t}function Ed(e,t){var s=t?Qs(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function Sd(e){var t=new e.constructor(e.source,ja.exec(e));return t.lastIndex=e.lastIndex,t}function Ad(e){return Ai?ye(Ai.call(e)):{}}function au(e,t){var s=t?Qs(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function ou(e,t){if(e!==t){var s=e!==i,a=e===null,c=e===e,p=nt(e),d=t!==i,h=t===null,y=t===t,E=nt(t);if(!h&&!E&&!p&&e>t||p&&d&&y&&!h&&!E||a&&d&&y||!s&&y||!c)return 1;if(!a&&!p&&!E&&e<t||E&&s&&c&&!a&&!p||h&&s&&c||!d&&c||!y)return-1}return 0}function Id(e,t,s){for(var a=-1,c=e.criteria,p=t.criteria,d=c.length,h=s.length;++a<d;){var y=ou(c[a],p[a]);if(y){if(a>=h)return y;var E=s[a];return y*(E=="desc"?-1:1)}}return e.index-t.index}function uu(e,t,s,a){for(var c=-1,p=e.length,d=s.length,h=-1,y=t.length,E=Fe(p-d,0),S=_(y+E),I=!a;++h<y;)S[h]=t[h];for(;++c<d;)(I||c<p)&&(S[s[c]]=e[c]);for(;E--;)S[h++]=e[c++];return S}function cu(e,t,s,a){for(var c=-1,p=e.length,d=-1,h=s.length,y=-1,E=t.length,S=Fe(p-h,0),I=_(S+E),C=!a;++c<S;)I[c]=e[c];for(var U=c;++y<E;)I[U+y]=t[y];for(;++d<h;)(C||c<p)&&(I[U+s[d]]=e[c++]);return I}function Je(e,t){var s=-1,a=e.length;for(t||(t=_(a));++s<a;)t[s]=e[s];return t}function Ft(e,t,s,a){var c=!s;s||(s={});for(var p=-1,d=t.length;++p<d;){var h=t[p],y=a?a(s[h],e[h],h,s,e):i;y===i&&(y=e[h]),c?jt(s,h,y):Ii(s,h,y)}return s}function bd(e,t){return Ft(e,ta(e),t)}function Nd(e,t){return Ft(e,wu(e),t)}function wr(e,t){return function(s,a){var c=Q(s)?Ff:Yp,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 h=s[a];h&&e(t,h,a,p)}return t})}function lu(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 fu(e){return function(t,s,a){for(var c=-1,p=ye(t),d=a(t),h=d.length;h--;){var y=d[e?h:++c];if(s(p[y],y,p)===!1)break}return t}}function Od(e,t,s){var a=t&ae,c=Ci(e);function p(){var d=this&&this!==Ue&&this instanceof p?c:e;return d.apply(a?s:this,arguments)}return p}function pu(e){return function(t){t=le(t);var s=Hn(t)?Et(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 _s(lc(cc(t).replace(_f,"")),e,"")}}function Ci(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 Rd(e,t,s){var a=Ci(e);function c(){for(var p=arguments.length,d=_(p),h=p,y=ri(c);h--;)d[h]=arguments[h];var E=p<3&&d[0]!==y&&d[p-1]!==y?[]:cn(d,y);if(p-=E.length,p<s)return yu(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 du(e){return function(t,s,a){var c=ye(t);if(!ze(t)){var p=j(s,3);t=Pe(t),s=function(h){return p(c[h],h,c)}}var d=e(t,s,a);return d>-1?c[p?t[d]:d]:i}}function hu(e){return Gt(function(t){var s=t.length,a=s,c=ct.prototype.thru;for(e&&t.reverse();a--;){var p=t[a];if(typeof p!="function")throw new ut(g);if(c&&!d&&br(p)=="wrapper")var d=new ct([],!0)}for(a=d?a:s;++a<s;){p=t[a];var h=br(p),y=h=="wrapper"?Zs(p):i;y&&ia(y[0])&&y[1]==(ce|xe|ee|qe)&&!y[4].length&&y[9]==1?d=d[br(y[0])].apply(d,y[3]):d=p.length==1&&ia(p)?d[h]():d.thru(p)}return function(){var E=arguments,S=E[0];if(d&&E.length==1&&Q(S))return d.plant(S).value();for(var I=0,C=s?t[I].apply(this,E):S;++I<s;)C=t[I].call(this,C);return C}})}function Er(e,t,s,a,c,p,d,h,y,E){var S=t&ce,I=t&ae,C=t&me,U=t&(xe|L),G=t&x,X=C?i:Ci(e);function V(){for(var Z=arguments.length,ie=_(Z),it=Z;it--;)ie[it]=arguments[it];if(U)var Ve=ri(V),rt=Wf(ie,Ve);if(a&&(ie=uu(ie,a,c,U)),p&&(ie=cu(ie,p,d,U)),Z-=rt,U&&Z<E){var Ne=cn(ie,Ve);return yu(e,t,Er,V.placeholder,s,ie,Ne,h,y,E-Z)}var It=I?s:this,zt=C?It[e]:e;return Z=ie.length,h?ie=Yd(ie,h):G&&Z>1&&ie.reverse(),S&&y<Z&&(ie.length=y),this&&this!==Ue&&this instanceof V&&(zt=X||Ci(zt)),zt.apply(It,ie)}return V}function gu(e,t){return function(s,a){return rd(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=eu(s),a=eu(a)),c=e(s,a)}return c}}function Hs(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?Ws(t,e):t;var a=Ws(t,fr(e/Yn(t)));return Hn(t)?hn(Et(a),0,e).join(""):a.slice(0,e)}function Cd(e,t,s,a){var c=t&ae,p=Ci(e);function d(){for(var h=-1,y=arguments.length,E=-1,S=a.length,I=_(S+y),C=this&&this!==Ue&&this instanceof d?p:e;++E<S;)I[E]=a[E];for(;y--;)I[E++]=arguments[++h];return Ze(C,c?s:this,I)}return d}function mu(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),md(t,s,a,e)}}function Ir(e){return function(t,s){return typeof t=="string"&&typeof s=="string"||(t=dt(t),s=dt(s)),e(t,s)}}function yu(e,t,s,a,c,p,d,h,y,E){var S=t&xe,I=S?d:i,C=S?i:d,U=S?p:i,G=S?i:p;t|=S?ee:H,t&=~(S?H:ee),t&Ye||(t&=-4);var X=[e,t,c,U,I,G,C,h,y,E],V=s.apply(i,X);return ia(e)&&Ou(V,X),V.placeholder=a,Ru(V,e,t)}function Ys(e){var t=Le[e];return function(s,a){if(s=dt(s),a=a==null?0:$e(Y(a),292),a&&Ro(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 Ld=Zn&&1/tr(new Zn([,-0]))[1]==Rt?function(e){return new Zn(e)}:va;function vu(e){return function(t){var s=Be(t);return s==Xe?Is(t):s==Ke?Hf(t):jf(t,e(t))}}function Wt(e,t,s,a,c,p,d,h){var y=t&me;if(!y&&typeof e!="function")throw new ut(g);var E=a?a.length:0;if(E||(t&=-97,a=c=i),d=d===i?d:Fe(Y(d),0),h=h===i?h:Y(h),E-=c?c.length:0,t&H){var S=a,I=c;a=c=i}var C=y?i:Zs(e),U=[e,t,s,a,c,S,I,p,d,h];if(C&&zd(U,C),e=U[0],t=U[1],s=U[2],a=U[3],c=U[4],h=U[9]=U[9]===i?y?0:e.length:Fe(U[9]-E,0),!h&&t&(xe|L)&&(t&=-25),!t||t==ae)var G=Od(e,t,s);else t==xe||t==L?G=Rd(e,t,h):(t==ee||t==(ae|ee))&&!c.length?G=Cd(e,t,s,a):G=Er.apply(i,U);var X=C?Ko:Ou;return Ru(X(G,U),e,t)}function _u(e,t,s,a){return e===i||At(e,Kn[s])&&!pe.call(a,s)?t:e}function xu(e,t,s,a,c,p){return Ae(e)&&Ae(t)&&(p.set(t,e),_r(e,t,i,xu,p),p.delete(t)),e}function Fd(e){return Di(e)?i:e}function Tu(e,t,s,a,c,p){var d=s&$,h=e.length,y=t.length;if(h!=y&&!(d&&y>h))return!1;var E=p.get(e),S=p.get(t);if(E&&S)return E==t&&S==e;var I=-1,C=!0,U=s&he?new Fn:i;for(p.set(e,t),p.set(t,e);++I<h;){var G=e[I],X=t[I];if(a)var V=d?a(X,G,I,t,e,p):a(G,X,I,e,t,p);if(V!==i){if(V)continue;C=!1;break}if(U){if(!xs(t,function(Z,ie){if(!xi(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 Dd(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 At(+e,+t);case Vn:return e.name==t.name&&e.message==t.message;case rn:case bn:return e==t+"";case Xe:var h=Is;case Ke:var y=a&$;if(h||(h=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=Tu(h(e),h(t),a,c,p,d);return d.delete(e),S;case Jn:if(Ai)return Ai.call(e)==Ai.call(t)}return!1}function Pd(e,t,s,a,c,p){var d=s&$,h=Xs(e),y=h.length,E=Xs(t),S=E.length;if(y!=S&&!d)return!1;for(var I=y;I--;){var C=h[I];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;++I<y;){C=h[I];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 sa(bu(e,i,ku),e+"")}function Xs(e){return jo(e,Pe,ta)}function Ks(e){return jo(e,Qe,wu)}var Zs=dr?function(e){return dr.get(e)}:va;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||ma;return e=e===ma?Vo:e,arguments.length?e(arguments[0],arguments[1]):e}function Nr(e,t){var s=e.__data__;return Gd(t)?s[typeof t=="string"?"string":"hash"]:s.map}function ea(e){for(var t=Pe(e),s=t.length;s--;){var a=t[s],c=e[a];t[s]=[a,c,Au(c)]}return t}function kn(e,t){var s=Jf(e,t);return Go(s)?s:i}function kd(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 ta=Ns?function(e){return e==null?[]:(e=ye(e),on(Ns(e),function(t){return No.call(e,t)}))}:_a,wu=Ns?function(e){for(var t=[];e;)un(t,ta(e)),e=ur(e);return t}:_a,Be=We;(Os&&Be(new Os(new ArrayBuffer(1)))!=an||wi&&Be(new wi)!=Xe||Rs&&Be(Rs.resolve())!=vi||Zn&&Be(new Zn)!=Ke||Ei&&Be(new Ei)!=sn)&&(Be=function(e){var t=We(e),s=t==wt?e.constructor:i,a=s?Un(s):"";if(a)switch(a){case vp:return an;case _p:return Xe;case xp:return vi;case Tp:return Ke;case wp:return sn}return t});function Ud(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 Md(e){var t=e.match(Gl);return t?t[1].split(Vl):[]}function Eu(e,t,s){t=dn(t,e);for(var a=-1,c=t.length,p=!1;++a<c;){var d=Dt(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)&&(Q(e)||Mn(e)))}function $d(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 Su(e){return typeof e.constructor=="function"&&!Li(e)?ti(ur(e)):{}}function Bd(e,t,s){var a=e.constructor;switch(t){case Nn:return Qs(e);case Sn:case An:return new a(+e);case an:return Ed(e,s);case W:case Ce:case Ct:case Hi:case On:case _i:case as:case os:case us:return au(e,s);case Xe:return new a;case In:case bn:return new a(e);case rn:return Sd(e);case Ke:return new a;case Jn:return Ad(e)}}function jd(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(Wl,`{
|
|
362
382
|
/* [wrapped with `+t+`] */
|
|
363
|
-
`)}function $d(e){return z(e)||kn(e)||!!(Io&&e&&e[Io])}function Gt(e,t){var s=typeof e;return t=t??Tt,!!t&&(s=="number"||s!="symbol"&&Yl.test(e))&&e>-1&&e%1==0&&e<t}function Ge(e,t,s){if(!Ie(s))return!1;var a=typeof t;return(a=="number"?Qe(s)&&Gt(t,s.length):a=="string"&&t in s)?At(s[t],e):!1}function ea(e,t){if(z(e))return!1;var s=typeof e;return s=="number"||s=="symbol"||s=="boolean"||e==null||nt(e)?!0:Pl.test(e)||!Dl.test(e)||t!=null&&e in ve(t)}function Bd(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ta(e){var t=Ar(e),s=l[t];if(typeof s!="function"||!(t in ne.prototype))return!1;if(e===s)return!0;var a=Xs(s);return!!a&&e===a[0]}function jd(e){return!!wo&&wo in e}var Wd=tr?Vt:va;function Ci(e){var t=e&&e.constructor,s=typeof t=="function"&&t.prototype||Yn;return e===s}function wu(e){return e===e&&!Ie(e)}function Eu(e,t){return function(s){return s==null?!1:s[e]===t&&(t!==i||e in ve(s))}}function Gd(e){var t=Rr(e,function(a){return s.size===b&&s.clear(),a}),s=t.cache;return t}function Vd(e,t){var s=e[1],a=t[1],c=s|a,p=c<(oe|ye|le),d=a==le&&s==Te||a==le&&s==qe&&e[7].length<=t[8]||a==(le|qe)&&t[7].length<=t[8]&&s==Te;if(!(p||d))return e;a&oe&&(e[2]=t[2],c|=s&oe?0:Ye);var h=t[3];if(h){var y=e[3];e[3]=y?su(y,h,t[4]):h,e[4]=y?un(e[3],O):t[4]}return h=t[5],h&&(y=e[5],e[5]=y?au(y,h,t[6]):h,e[6]=y?un(e[5],O):t[6]),h=t[7],h&&(e[7]=h),a&le&&(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 qd(e){var t=[];if(e!=null)for(var s in ve(e))t.push(s);return t}function Jd(e){return ir.call(e)}function Su(e,t,s){return t=De(t===i?e.length-1:t,0),function(){for(var a=arguments,c=-1,p=De(a.length-t,0),d=_(p);++c<p;)d[c]=a[t+c];c=-1;for(var h=_(t+1);++c<t;)h[c]=a[c];return h[t]=s(d),Ze(e,this,h)}}function Au(e,t){return t.length<2?e:Fn(e,ft(t,0,-1))}function Qd(e,t){for(var s=e.length,a=$e(t.length,s),c=Je(e);a--;){var p=t[a];e[a]=Gt(p,s)?c[p]:i}return e}function na(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Iu=Nu(Ho),Ri=up||function(e,t){return Ue.setTimeout(e,t)},ia=Nu(md);function bu(e,t,s){var a=t+"";return ia(e,Md(a,zd(Pd(a),s)))}function Nu(e){var t=0,s=0;return function(){var a=pp(),c=en-(a-s);if(s=a,c>0){if(++t>=xt)return arguments[0]}else t=0;return e.apply(i,arguments)}}function br(e,t){var s=-1,a=e.length,c=a-1;for(t=t===i?a:t;++s<t;){var p=$s(s,c),d=e[p];e[p]=e[s],e[s]=d}return e.length=t,e}var Ou=Gd(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(kl,function(s,a,c,p){t.push(c?p.replace(Vl,"$1"):a||s)}),t});function Dt(e){if(typeof e=="string"||nt(e))return e;var t=e+"";return t=="0"&&1/e==-Ct?"-0":t}function Pn(e){if(e!=null){try{return nr.call(e)}catch{}try{return e+""}catch{}}return""}function zd(e,t){return ot(Kr,function(s){var a="_."+s[0];t&s[1]&&!Xi(e,a)&&e.push(a)}),e.sort()}function Cu(e){if(e instanceof ne)return e.clone();var t=new ct(e.__wrapped__,e.__chain__);return t.__actions__=Je(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Hd(e,t,s){(s?Ge(e,t,s):t===i)?t=1:t=De(Y(t),0);var a=e==null?0:e.length;if(!a||t<1)return[];for(var c=0,p=0,d=_(cr(a/t));c<a;)d[p++]=ft(e,c,c+=t);return d}function Yd(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 Xd(){var e=arguments.length;if(!e)return[];for(var t=_(e-1),s=arguments[0],a=e;a--;)t[a-1]=arguments[a];return on(z(s)?Je(s):[s],Me(t,1))}var Kd=K(function(e,t){return Ne(e)?Ai(e,Me(t,1,Ne,!0)):[]}),Zd=K(function(e,t){var s=pt(t);return Ne(s)&&(s=i),Ne(e)?Ai(e,Me(t,1,Ne,!0),j(s,2)):[]}),eh=K(function(e,t){var s=pt(t);return Ne(s)&&(s=i),Ne(e)?Ai(e,Me(t,1,Ne,!0),i,s):[]});function th(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),ft(e,t<0?0:t,a)):[]}function nh(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),t=a-t,ft(e,0,t<0?0:t)):[]}function ih(e,t){return e&&e.length?_r(e,j(t,3),!0,!0):[]}function rh(e,t){return e&&e.length?_r(e,j(t,3),!0):[]}function sh(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),Xp(e,t,s,a)):[]}function Ru(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=De(a+c,0)),Ki(e,j(t,3),c)}function Lu(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?De(a+c,0):$e(c,a-1)),Ki(e,j(t,3),c,!0)}function Fu(e){var t=e==null?0:e.length;return t?Me(e,1):[]}function ah(e){var t=e==null?0:e.length;return t?Me(e,Ct):[]}function oh(e,t){var s=e==null?0:e.length;return s?(t=t===i?1:Y(t),Me(e,t)):[]}function uh(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 Du(e){return e&&e.length?e[0]:i}function ch(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=De(a+c,0)),Jn(e,t,c)}function lh(e){var t=e==null?0:e.length;return t?ft(e,0,-1):[]}var fh=K(function(e){var t=Se(e,Vs);return t.length&&t[0]===e[0]?Ds(t):[]}),ph=K(function(e){var t=pt(e),s=Se(e,Vs);return t===pt(s)?t=i:s.pop(),s.length&&s[0]===e[0]?Ds(s,j(t,2)):[]}),dh=K(function(e){var t=pt(e),s=Se(e,Vs);return t=typeof t=="function"?t:i,t&&s.pop(),s.length&&s[0]===e[0]?Ds(s,i,t):[]});function hh(e,t){return e==null?"":lp.call(e,t)}function pt(e){var t=e==null?0:e.length;return t?e[t-1]:i}function gh(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?De(a+c,0):$e(c,a-1)),t===t?zf(e,t,c):Ki(e,ho,c,!0)}function mh(e,t){return e&&e.length?qo(e,Y(t)):i}var yh=K(Pu);function Pu(e,t){return e&&e.length&&t&&t.length?Ms(e,t):e}function vh(e,t,s){return e&&e.length&&t&&t.length?Ms(e,t,j(s,2)):e}function _h(e,t,s){return e&&e.length&&t&&t.length?Ms(e,t,i,s):e}var xh=Wt(function(e,t){var s=e==null?0:e.length,a=Cs(e,t);return zo(e,Se(t,function(c){return Gt(c,s)?+c:c}).sort(ru)),a});function Th(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 zo(e,c),s}function ra(e){return e==null?e:hp.call(e)}function wh(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)),ft(e,t,s)):[]}function Eh(e,t){return vr(e,t)}function Sh(e,t,s){return js(e,t,j(s,2))}function Ah(e,t){var s=e==null?0:e.length;if(s){var a=vr(e,t);if(a<s&&At(e[a],t))return a}return-1}function Ih(e,t){return vr(e,t,!0)}function bh(e,t,s){return js(e,t,j(s,2),!0)}function Nh(e,t){var s=e==null?0:e.length;if(s){var a=vr(e,t,!0)-1;if(At(e[a],t))return a}return-1}function Oh(e){return e&&e.length?Yo(e):[]}function Ch(e,t){return e&&e.length?Yo(e,j(t,2)):[]}function Rh(e){var t=e==null?0:e.length;return t?ft(e,1,t):[]}function Lh(e,t,s){return e&&e.length?(t=s||t===i?1:Y(t),ft(e,0,t<0?0:t)):[]}function Fh(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),t=a-t,ft(e,t<0?0:t,a)):[]}function Dh(e,t){return e&&e.length?_r(e,j(t,3),!1,!0):[]}function Ph(e,t){return e&&e.length?_r(e,j(t,3)):[]}var kh=K(function(e){return fn(Me(e,1,Ne,!0))}),Uh=K(function(e){var t=pt(e);return Ne(t)&&(t=i),fn(Me(e,1,Ne,!0),j(t,2))}),Mh=K(function(e){var t=pt(e);return t=typeof t=="function"?t:i,fn(Me(e,1,Ne,!0),i,t)});function $h(e){return e&&e.length?fn(e):[]}function Bh(e,t){return e&&e.length?fn(e,j(t,2)):[]}function jh(e,t){return t=typeof t=="function"?t:i,e&&e.length?fn(e,i,t):[]}function sa(e){if(!(e&&e.length))return[];var t=0;return e=an(e,function(s){if(Ne(s))return t=De(s.length,t),!0}),ws(t,function(s){return Se(e,_s(s))})}function ku(e,t){if(!(e&&e.length))return[];var s=sa(e);return t==null?s:Se(s,function(a){return Ze(t,i,a)})}var Wh=K(function(e,t){return Ne(e)?Ai(e,t):[]}),Gh=K(function(e){return Gs(an(e,Ne))}),Vh=K(function(e){var t=pt(e);return Ne(t)&&(t=i),Gs(an(e,Ne),j(t,2))}),qh=K(function(e){var t=pt(e);return t=typeof t=="function"?t:i,Gs(an(e,Ne),i,t)}),Jh=K(sa);function Qh(e,t){return eu(e||[],t||[],Si)}function zh(e,t){return eu(e||[],t||[],Ni)}var Hh=K(function(e){var t=e.length,s=t>1?e[t-1]:i;return s=typeof s=="function"?(e.pop(),s):i,ku(e,s)});function Uu(e){var t=l(e);return t.__chain__=!0,t}function Yh(e,t){return t(e),e}function Nr(e,t){return t(e)}var Xh=Wt(function(e){var t=e.length,s=t?e[0]:0,a=this.__wrapped__,c=function(p){return Cs(p,e)};return t>1||this.__actions__.length||!(a instanceof ne)||!Gt(s)?this.thru(c):(a=a.slice(s,+s+(t?1:0)),a.__actions__.push({func:Nr,args:[c],thisArg:i}),new ct(a,this.__chain__).thru(function(p){return t&&!p.length&&p.push(i),p}))});function Kh(){return Uu(this)}function Zh(){return new ct(this.value(),this.__chain__)}function eg(){this.__values__===i&&(this.__values__=Xu(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function tg(){return this}function ng(e){for(var t,s=this;s instanceof dr;){var a=Cu(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 ig(){var e=this.__wrapped__;if(e instanceof ne){var t=e;return this.__actions__.length&&(t=new ne(this)),t=t.reverse(),t.__actions__.push({func:Nr,args:[ra],thisArg:i}),new ct(t,this.__chain__)}return this.thru(ra)}function rg(){return Zo(this.__wrapped__,this.__actions__)}var sg=xr(function(e,t,s){de.call(e,s)?++e[s]:Bt(e,s,1)});function ag(e,t,s){var a=z(e)?fo:Yp;return s&&Ge(e,t,s)&&(t=i),a(e,j(t,3))}function og(e,t){var s=z(e)?an:ko;return s(e,j(t,3))}var ug=lu(Ru),cg=lu(Lu);function lg(e,t){return Me(Or(e,t),1)}function fg(e,t){return Me(Or(e,t),Ct)}function pg(e,t,s){return s=s===i?1:Y(s),Me(Or(e,t),s)}function Mu(e,t){var s=z(e)?ot:ln;return s(e,j(t,3))}function $u(e,t){var s=z(e)?Rf:Po;return s(e,j(t,3))}var dg=xr(function(e,t,s){de.call(e,s)?e[s].push(t):Bt(e,s,[t])});function hg(e,t,s,a){e=Qe(e)?e:ri(e),s=s&&!a?Y(s):0;var c=e.length;return s<0&&(s=De(c+s,0)),Dr(e)?s<=c&&e.indexOf(t,s)>-1:!!c&&Jn(e,t,s)>-1}var gg=K(function(e,t,s){var a=-1,c=typeof t=="function",p=Qe(e)?_(e.length):[];return ln(e,function(d){p[++a]=c?Ze(t,d,s):Ii(d,t,s)}),p}),mg=xr(function(e,t,s){Bt(e,s,t)});function Or(e,t){var s=z(e)?Se:Wo;return s(e,j(t,3))}function yg(e,t,s,a){return e==null?[]:(z(t)||(t=t==null?[]:[t]),s=a?i:s,z(s)||(s=s==null?[]:[s]),Jo(e,t,s))}var vg=xr(function(e,t,s){e[s?0:1].push(t)},function(){return[[],[]]});function _g(e,t,s){var a=z(e)?ys:mo,c=arguments.length<3;return a(e,j(t,4),s,c,ln)}function xg(e,t,s){var a=z(e)?Lf:mo,c=arguments.length<3;return a(e,j(t,4),s,c,Po)}function Tg(e,t){var s=z(e)?an:ko;return s(e,Lr(j(t,3)))}function wg(e){var t=z(e)?Ro:hd;return t(e)}function Eg(e,t,s){(s?Ge(e,t,s):t===i)?t=1:t=Y(t);var a=z(e)?qp:gd;return a(e,t)}function Sg(e){var t=z(e)?Jp:yd;return t(e)}function Ag(e){if(e==null)return 0;if(Qe(e))return Dr(e)?zn(e):e.length;var t=Be(e);return t==Xe||t==Ke?e.size:ks(e).length}function Ig(e,t,s){var a=z(e)?vs:vd;return s&&Ge(e,t,s)&&(t=i),a(e,j(t,3))}var bg=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]]),Jo(e,Me(t,1),[])}),Cr=op||function(){return Ue.Date.now()};function Ng(e,t){if(typeof t!="function")throw new ut(g);return e=Y(e),function(){if(--e<1)return t.apply(this,arguments)}}function Bu(e,t,s){return t=s?i:t,t=e&&t==null?e.length:t,jt(e,le,i,i,i,i,t)}function ju(e,t){var s;if(typeof t!="function")throw new ut(g);return e=Y(e),function(){return--e>0&&(s=t.apply(this,arguments)),e<=1&&(t=i),s}}var aa=K(function(e,t,s){var a=oe;if(s.length){var c=un(s,ni(aa));a|=te}return jt(e,a,t,s,c)}),Wu=K(function(e,t,s){var a=oe|ye;if(s.length){var c=un(s,ni(Wu));a|=te}return jt(t,a,e,s,c)});function Gu(e,t,s){t=s?i:t;var a=jt(e,Te,i,i,i,i,i,t);return a.placeholder=Gu.placeholder,a}function Vu(e,t,s){t=s?i:t;var a=jt(e,L,i,i,i,i,i,t);return a.placeholder=Vu.placeholder,a}function qu(e,t,s){var a,c,p,d,h,y,E=0,S=!1,I=!1,R=!0;if(typeof e!="function")throw new ut(g);t=dt(t)||0,Ie(s)&&(S=!!s.leading,I="maxWait"in s,p=I?De(dt(s.maxWait)||0,t):p,R="trailing"in s?!!s.trailing:R);function U(Oe){var It=a,Jt=c;return a=c=i,E=Oe,d=e.apply(Jt,It),d}function G(Oe){return E=Oe,h=Ri(ee,t),S?U(Oe):d}function X(Oe){var It=Oe-y,Jt=Oe-E,lc=t-It;return I?$e(lc,p-Jt):lc}function V(Oe){var It=Oe-y,Jt=Oe-E;return y===i||It>=t||It<0||I&&Jt>=p}function ee(){var Oe=Cr();if(V(Oe))return re(Oe);h=Ri(ee,X(Oe))}function re(Oe){return h=i,R&&a?U(Oe):(a=c=i,d)}function it(){h!==i&&tu(h),E=0,a=y=c=h=i}function Ve(){return h===i?d:re(Cr())}function rt(){var Oe=Cr(),It=V(Oe);if(a=arguments,c=this,y=Oe,It){if(h===i)return G(y);if(I)return tu(h),h=Ri(ee,t),U(y)}return h===i&&(h=Ri(ee,t)),d}return rt.cancel=it,rt.flush=Ve,rt}var Og=K(function(e,t){return Do(e,1,t)}),Cg=K(function(e,t,s){return Do(e,dt(t)||0,s)});function Rg(e){return jt(e,x)}function Rr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new ut(g);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(Rr.Cache||$t),s}Rr.Cache=$t;function Lr(e){if(typeof e!="function")throw new ut(g);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 Lg(e){return ju(2,e)}var Fg=_d(function(e,t){t=t.length==1&&z(t[0])?Se(t[0],et(j())):Se(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)})}),oa=K(function(e,t){var s=un(t,ni(oa));return jt(e,te,i,t,s)}),Ju=K(function(e,t){var s=un(t,ni(Ju));return jt(e,H,i,t,s)}),Dg=Wt(function(e,t){return jt(e,qe,i,i,i,t)});function Pg(e,t){if(typeof e!="function")throw new ut(g);return t=t===i?t:Y(t),K(e,t)}function kg(e,t){if(typeof e!="function")throw new ut(g);return t=t==null?0:De(Y(t),0),K(function(s){var a=s[t],c=dn(s,0,t);return a&&on(c,a),Ze(e,this,c)})}function Ug(e,t,s){var a=!0,c=!0;if(typeof e!="function")throw new ut(g);return Ie(s)&&(a="leading"in s?!!s.leading:a,c="trailing"in s?!!s.trailing:c),qu(e,t,{leading:a,maxWait:t,trailing:c})}function Mg(e){return Bu(e,1)}function $g(e,t){return oa(qs(t),e)}function Bg(){if(!arguments.length)return[];var e=arguments[0];return z(e)?e:[e]}function jg(e){return lt(e,M)}function Wg(e,t){return t=typeof t=="function"?t:i,lt(e,M,t)}function Gg(e){return lt(e,D|M)}function Vg(e,t){return t=typeof t=="function"?t:i,lt(e,D|M,t)}function qg(e,t){return t==null||Fo(e,t,Pe(t))}function At(e,t){return e===t||e!==e&&t!==t}var Jg=Sr(Fs),Qg=Sr(function(e,t){return e>=t}),kn=$o(function(){return arguments}())?$o:function(e){return be(e)&&de.call(e,"callee")&&!Ao.call(e,"callee")},z=_.isArray,zg=so?et(so):nd;function Qe(e){return e!=null&&Fr(e.length)&&!Vt(e)}function Ne(e){return be(e)&&Qe(e)}function Hg(e){return e===!0||e===!1||be(e)&&We(e)==wn}var hn=cp||va,Yg=ao?et(ao):id;function Xg(e){return be(e)&&e.nodeType===1&&!Li(e)}function Kg(e){if(e==null)return!0;if(Qe(e)&&(z(e)||typeof e=="string"||typeof e.splice=="function"||hn(e)||ii(e)||kn(e)))return!e.length;var t=Be(e);if(t==Xe||t==Ke)return!e.size;if(Ci(e))return!ks(e).length;for(var s in e)if(de.call(e,s))return!1;return!0}function Zg(e,t){return bi(e,t)}function em(e,t,s){s=typeof s=="function"?s:i;var a=s?s(e,t):i;return a===i?bi(e,t,i,s):!!a}function ua(e){if(!be(e))return!1;var t=We(e);return t==Wn||t==es||typeof e.message=="string"&&typeof e.name=="string"&&!Li(e)}function tm(e){return typeof e=="number"&&bo(e)}function Vt(e){if(!Ie(e))return!1;var t=We(e);return t==Gn||t==qi||t==Zr||t==Ji}function Qu(e){return typeof e=="number"&&e==Y(e)}function Fr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Tt}function Ie(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function be(e){return e!=null&&typeof e=="object"}var zu=oo?et(oo):sd;function nm(e,t){return e===t||Ps(e,t,Ks(t))}function im(e,t,s){return s=typeof s=="function"?s:i,Ps(e,t,Ks(t),s)}function rm(e){return Hu(e)&&e!=+e}function sm(e){if(Wd(e))throw new Q(f);return Bo(e)}function am(e){return e===null}function om(e){return e==null}function Hu(e){return typeof e=="number"||be(e)&&We(e)==Sn}function Li(e){if(!be(e)||We(e)!=wt)return!1;var t=ar(e);if(t===null)return!0;var s=de.call(t,"constructor")&&t.constructor;return typeof s=="function"&&s instanceof s&&nr.call(s)==ip}var ca=uo?et(uo):ad;function um(e){return Qu(e)&&e>=-Tt&&e<=Tt}var Yu=co?et(co):od;function Dr(e){return typeof e=="string"||!z(e)&&be(e)&&We(e)==An}function nt(e){return typeof e=="symbol"||be(e)&&We(e)==Vn}var ii=lo?et(lo):ud;function cm(e){return e===i}function lm(e){return be(e)&&Be(e)==rn}function fm(e){return be(e)&&We(e)==is}var pm=Sr(Us),dm=Sr(function(e,t){return e<=t});function Xu(e){if(!e)return[];if(Qe(e))return Dr(e)?Et(e):Je(e);if(_i&&e[_i])return qf(e[_i]());var t=Be(e),s=t==Xe?Ss:t==Ke?Zi:ri;return s(e)}function qt(e){if(!e)return e===0?e:0;if(e=dt(e),e===Ct||e===-Ct){var t=e<0?-1:1;return t*Hr}return e===e?e:0}function Y(e){var t=qt(e),s=t%1;return t===t?s?t-s:t:0}function Ku(e){return e?Ln(Y(e),0,st):0}function dt(e){if(typeof e=="number")return e;if(nt(e))return Bn;if(Ie(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ie(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=yo(e);var s=Ql.test(e);return s||Hl.test(e)?Nf(e.slice(2),s?2:8):Jl.test(e)?Bn:+e}function Zu(e){return Ft(e,ze(e))}function hm(e){return e?Ln(Y(e),-Tt,Tt):e===0?e:0}function fe(e){return e==null?"":tt(e)}var gm=ei(function(e,t){if(Ci(t)||Qe(t)){Ft(t,Pe(t),e);return}for(var s in t)de.call(t,s)&&Si(e,s,t[s])}),ec=ei(function(e,t){Ft(t,ze(t),e)}),Pr=ei(function(e,t,s,a){Ft(t,ze(t),e,a)}),mm=ei(function(e,t,s,a){Ft(t,Pe(t),e,a)}),ym=Wt(Cs);function vm(e,t){var s=Zn(e);return t==null?s:Lo(s,t)}var _m=K(function(e,t){e=ve(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=ze(p),h=-1,y=d.length;++h<y;){var E=d[h],S=e[E];(S===i||At(S,Yn[E])&&!de.call(e,E))&&(e[E]=p[E])}return e}),xm=K(function(e){return e.push(i,yu),Ze(tc,i,e)});function Tm(e,t){return po(e,j(t,3),Lt)}function wm(e,t){return po(e,j(t,3),Ls)}function Em(e,t){return e==null?e:Rs(e,j(t,3),ze)}function Sm(e,t){return e==null?e:Uo(e,j(t,3),ze)}function Am(e,t){return e&&Lt(e,j(t,3))}function Im(e,t){return e&&Ls(e,j(t,3))}function bm(e){return e==null?[]:mr(e,Pe(e))}function Nm(e){return e==null?[]:mr(e,ze(e))}function la(e,t,s){var a=e==null?i:Fn(e,t);return a===i?s:a}function Om(e,t){return e!=null&&xu(e,t,Kp)}function fa(e,t){return e!=null&&xu(e,t,Zp)}var Cm=pu(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=ir.call(t)),e[t]=s},da(He)),Rm=pu(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=ir.call(t)),de.call(e,t)?e[t].push(s):e[t]=[s]},j),Lm=K(Ii);function Pe(e){return Qe(e)?Co(e):ks(e)}function ze(e){return Qe(e)?Co(e,!0):cd(e)}function Fm(e,t){var s={};return t=j(t,3),Lt(e,function(a,c,p){Bt(s,t(a,c,p),a)}),s}function Dm(e,t){var s={};return t=j(t,3),Lt(e,function(a,c,p){Bt(s,c,t(a,c,p))}),s}var Pm=ei(function(e,t,s){yr(e,t,s)}),tc=ei(function(e,t,s,a){yr(e,t,s,a)}),km=Wt(function(e,t){var s={};if(e==null)return s;var a=!1;t=Se(t,function(p){return p=pn(p,e),a||(a=p.length>1),p}),Ft(e,Ys(e),s),a&&(s=lt(s,D|P|M,Cd));for(var c=t.length;c--;)Ws(s,t[c]);return s});function Um(e,t){return nc(e,Lr(j(t)))}var Mm=Wt(function(e,t){return e==null?{}:fd(e,t)});function nc(e,t){if(e==null)return{};var s=Se(Ys(e),function(a){return[a]});return t=j(t),Qo(e,s,function(a,c){return t(a,c[0])})}function $m(e,t,s){t=pn(t,e);var a=-1,c=t.length;for(c||(c=1,e=i);++a<c;){var p=e==null?i:e[Dt(t[a])];p===i&&(a=c,p=s),e=Vt(p)?p.call(e):p}return e}function Bm(e,t,s){return e==null?e:Ni(e,t,s)}function jm(e,t,s,a){return a=typeof a=="function"?a:i,e==null?e:Ni(e,t,s,a)}var ic=gu(Pe),rc=gu(ze);function Wm(e,t,s){var a=z(e),c=a||hn(e)||ii(e);if(t=j(t,4),s==null){var p=e&&e.constructor;c?s=a?new p:[]:Ie(e)?s=Vt(p)?Zn(ar(e)):{}:s={}}return(c?ot:Lt)(e,function(d,h,y){return t(s,d,h,y)}),s}function Gm(e,t){return e==null?!0:Ws(e,t)}function Vm(e,t,s){return e==null?e:Ko(e,t,qs(s))}function qm(e,t,s,a){return a=typeof a=="function"?a:i,e==null?e:Ko(e,t,qs(s),a)}function ri(e){return e==null?[]:Es(e,Pe(e))}function Jm(e){return e==null?[]:Es(e,ze(e))}function Qm(e,t,s){return s===i&&(s=t,t=i),s!==i&&(s=dt(s),s=s===s?s:0),t!==i&&(t=dt(t),t=t===t?t:0),Ln(dt(e),t,s)}function zm(e,t,s){return t=qt(t),s===i?(s=t,t=0):s=qt(s),e=dt(e),ed(e,t,s)}function Hm(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=qt(e),t===i?(t=e,e=0):t=qt(t)),e>t){var a=e;e=t,t=a}if(s||e%1||t%1){var c=No();return $e(e+c*(t-e+bf("1e-"+((c+"").length-1))),t)}return $s(e,t)}var Ym=ti(function(e,t,s){return t=t.toLowerCase(),e+(s?sc(t):t)});function sc(e){return pa(fe(e).toLowerCase())}function ac(e){return e=fe(e),e&&e.replace(Xl,Bf).replace(yf,"")}function Xm(e,t,s){e=fe(e),t=tt(t);var a=e.length;s=s===i?a:Ln(Y(s),0,a);var c=s;return s-=t.length,s>=0&&e.slice(s,c)==t}function Km(e){return e=fe(e),e&&Rl.test(e)?e.replace(ka,jf):e}function Zm(e){return e=fe(e),e&&Ul.test(e)?e.replace(os,"\\$&"):e}var e0=ti(function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}),t0=ti(function(e,t,s){return e+(s?" ":"")+t.toLowerCase()}),n0=cu("toLowerCase");function i0(e,t,s){e=fe(e),t=Y(t);var a=t?zn(e):0;if(!t||a>=t)return e;var c=(t-a)/2;return Er(lr(c),s)+e+Er(cr(c),s)}function r0(e,t,s){e=fe(e),t=Y(t);var a=t?zn(e):0;return t&&a<t?e+Er(t-a,s):e}function s0(e,t,s){e=fe(e),t=Y(t);var a=t?zn(e):0;return t&&a<t?Er(t-a,s)+e:e}function a0(e,t,s){return s||t==null?t=0:t&&(t=+t),dp(fe(e).replace(us,""),t||0)}function o0(e,t,s){return(s?Ge(e,t,s):t===i)?t=1:t=Y(t),Bs(fe(e),t)}function u0(){var e=arguments,t=fe(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var c0=ti(function(e,t,s){return e+(s?"_":"")+t.toLowerCase()});function l0(e,t,s){return s&&typeof s!="number"&&Ge(e,t,s)&&(t=s=i),s=s===i?st:s>>>0,s?(e=fe(e),e&&(typeof t=="string"||t!=null&&!ca(t))&&(t=tt(t),!t&&Qn(e))?dn(Et(e),0,s):e.split(t,s)):[]}var f0=ti(function(e,t,s){return e+(s?" ":"")+pa(t)});function p0(e,t,s){return e=fe(e),s=s==null?0:Ln(Y(s),0,e.length),t=tt(t),e.slice(s,s+t.length)==t}function d0(e,t,s){var a=l.templateSettings;s&&Ge(e,t,s)&&(t=i),e=fe(e),t=Pr({},t,a,mu);var c=Pr({},t.imports,a.imports,mu),p=Pe(c),d=Es(c,p),h,y,E=0,S=t.interpolate||zi,I="__p += '",R=As((t.escape||zi).source+"|"+S.source+"|"+(S===Ua?ql:zi).source+"|"+(t.evaluate||zi).source+"|$","g"),U="//# sourceURL="+(de.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++wf+"]")+`
|
|
364
|
-
`;e.replace(
|
|
365
|
-
__e(`+
|
|
383
|
+
`)}function Wd(e){return Q(e)||Mn(e)||!!(Oo&&e&&e[Oo])}function Vt(e,t){var s=typeof e;return t=t??Tt,!!t&&(s=="number"||s!="symbol"&&Zl.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)?At(s[t],e):!1}function na(e,t){if(Q(e))return!1;var s=typeof e;return s=="number"||s=="symbol"||s=="boolean"||e==null||nt(e)?!0:Ml.test(e)||!Ul.test(e)||t!=null&&e in ye(t)}function Gd(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ia(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=Zs(s);return!!a&&e===a[0]}function Vd(e){return!!Ao&&Ao in e}var qd=ir?qt:xa;function Li(e){var t=e&&e.constructor,s=typeof t=="function"&&t.prototype||Kn;return e===s}function Au(e){return e===e&&!Ae(e)}function Iu(e,t){return function(s){return s==null?!1:s[e]===t&&(t!==i||e in ye(s))}}function Jd(e){var t=Fr(e,function(a){return s.size===b&&s.clear(),a}),s=t.cache;return t}function zd(e,t){var s=e[1],a=t[1],c=s|a,p=c<(ae|me|ce),d=a==ce&&s==xe||a==ce&&s==qe&&e[7].length<=t[8]||a==(ce|qe)&&t[7].length<=t[8]&&s==xe;if(!(p||d))return e;a&ae&&(e[2]=t[2],c|=s&ae?0:Ye);var h=t[3];if(h){var y=e[3];e[3]=y?uu(y,h,t[4]):h,e[4]=y?cn(e[3],O):t[4]}return h=t[5],h&&(y=e[5],e[5]=y?cu(y,h,t[6]):h,e[6]=y?cn(e[5],O):t[6]),h=t[7],h&&(e[7]=h),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 Qd(e){var t=[];if(e!=null)for(var s in ye(e))t.push(s);return t}function Hd(e){return sr.call(e)}function bu(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 h=_(t+1);++c<t;)h[c]=a[c];return h[t]=s(d),Ze(e,this,h)}}function Nu(e,t){return t.length<2?e:Pn(e,ft(t,0,-1))}function Yd(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 ra(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Ou=Cu(Ko),Fi=fp||function(e,t){return Ue.setTimeout(e,t)},sa=Cu(_d);function Ru(e,t,s){var a=t+"";return sa(e,jd(a,Xd(Md(a),s)))}function Cu(e){var t=0,s=0;return function(){var a=gp(),c=tn-(a-s);if(s=a,c>0){if(++t>=xt)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=js(s,c),d=e[p];e[p]=e[s],e[s]=d}return e.length=t,e}var Lu=Jd(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace($l,function(s,a,c,p){t.push(c?p.replace(zl,"$1"):a||s)}),t});function Dt(e){if(typeof e=="string"||nt(e))return e;var t=e+"";return t=="0"&&1/e==-Rt?"-0":t}function Un(e){if(e!=null){try{return rr.call(e)}catch{}try{return e+""}catch{}}return""}function Xd(e,t){return ot(es,function(s){var a="_."+s[0];t&s[1]&&!Zi(e,a)&&e.push(a)}),e.sort()}function Fu(e){if(e instanceof te)return e.clone();var t=new ct(e.__wrapped__,e.__chain__);return t.__actions__=Je(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Kd(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++]=ft(e,c,c+=t);return d}function Zd(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 eh(){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(Q(s)?Je(s):[s],Me(t,1))}var th=K(function(e,t){return be(e)?bi(e,Me(t,1,be,!0)):[]}),nh=K(function(e,t){var s=pt(t);return be(s)&&(s=i),be(e)?bi(e,Me(t,1,be,!0),j(s,2)):[]}),ih=K(function(e,t){var s=pt(t);return be(s)&&(s=i),be(e)?bi(e,Me(t,1,be,!0),i,s):[]});function rh(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),ft(e,t<0?0:t,a)):[]}function sh(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),t=a-t,ft(e,0,t<0?0:t)):[]}function ah(e,t){return e&&e.length?Tr(e,j(t,3),!0,!0):[]}function oh(e,t){return e&&e.length?Tr(e,j(t,3),!0):[]}function uh(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),ed(e,t,s,a)):[]}function Du(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 Pu(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 ku(e){var t=e==null?0:e.length;return t?Me(e,1):[]}function ch(e){var t=e==null?0:e.length;return t?Me(e,Rt):[]}function lh(e,t){var s=e==null?0:e.length;return s?(t=t===i?1:Y(t),Me(e,t)):[]}function fh(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 Uu(e){return e&&e.length?e[0]:i}function ph(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)),Qn(e,t,c)}function dh(e){var t=e==null?0:e.length;return t?ft(e,0,-1):[]}var hh=K(function(e){var t=Ee(e,Js);return t.length&&t[0]===e[0]?ks(t):[]}),gh=K(function(e){var t=pt(e),s=Ee(e,Js);return t===pt(s)?t=i:s.pop(),s.length&&s[0]===e[0]?ks(s,j(t,2)):[]}),mh=K(function(e){var t=pt(e),s=Ee(e,Js);return t=typeof t=="function"?t:i,t&&s.pop(),s.length&&s[0]===e[0]?ks(s,i,t):[]});function yh(e,t){return e==null?"":dp.call(e,t)}function pt(e){var t=e==null?0:e.length;return t?e[t-1]:i}function vh(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?Xf(e,t,c):er(e,yo,c,!0)}function _h(e,t){return e&&e.length?Qo(e,Y(t)):i}var xh=K(Mu);function Mu(e,t){return e&&e.length&&t&&t.length?Bs(e,t):e}function Th(e,t,s){return e&&e.length&&t&&t.length?Bs(e,t,j(s,2)):e}function wh(e,t,s){return e&&e.length&&t&&t.length?Bs(e,t,i,s):e}var Eh=Gt(function(e,t){var s=e==null?0:e.length,a=Ls(e,t);return Xo(e,Ee(t,function(c){return Vt(c,s)?+c:c}).sort(ou)),a});function Sh(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 Xo(e,c),s}function aa(e){return e==null?e:yp.call(e)}function Ah(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)),ft(e,t,s)):[]}function Ih(e,t){return xr(e,t)}function bh(e,t,s){return Gs(e,t,j(s,2))}function Nh(e,t){var s=e==null?0:e.length;if(s){var a=xr(e,t);if(a<s&&At(e[a],t))return a}return-1}function Oh(e,t){return xr(e,t,!0)}function Rh(e,t,s){return Gs(e,t,j(s,2),!0)}function Ch(e,t){var s=e==null?0:e.length;if(s){var a=xr(e,t,!0)-1;if(At(e[a],t))return a}return-1}function Lh(e){return e&&e.length?Zo(e):[]}function Fh(e,t){return e&&e.length?Zo(e,j(t,2)):[]}function Dh(e){var t=e==null?0:e.length;return t?ft(e,1,t):[]}function Ph(e,t,s){return e&&e.length?(t=s||t===i?1:Y(t),ft(e,0,t<0?0:t)):[]}function kh(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),t=a-t,ft(e,t<0?0:t,a)):[]}function Uh(e,t){return e&&e.length?Tr(e,j(t,3),!1,!0):[]}function Mh(e,t){return e&&e.length?Tr(e,j(t,3)):[]}var $h=K(function(e){return pn(Me(e,1,be,!0))}),Bh=K(function(e){var t=pt(e);return be(t)&&(t=i),pn(Me(e,1,be,!0),j(t,2))}),jh=K(function(e){var t=pt(e);return t=typeof t=="function"?t:i,pn(Me(e,1,be,!0),i,t)});function Wh(e){return e&&e.length?pn(e):[]}function Gh(e,t){return e&&e.length?pn(e,j(t,2)):[]}function Vh(e,t){return t=typeof t=="function"?t:i,e&&e.length?pn(e,i,t):[]}function oa(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}),Ss(t,function(s){return Ee(e,Ts(s))})}function $u(e,t){if(!(e&&e.length))return[];var s=oa(e);return t==null?s:Ee(s,function(a){return Ze(t,i,a)})}var qh=K(function(e,t){return be(e)?bi(e,t):[]}),Jh=K(function(e){return qs(on(e,be))}),zh=K(function(e){var t=pt(e);return be(t)&&(t=i),qs(on(e,be),j(t,2))}),Qh=K(function(e){var t=pt(e);return t=typeof t=="function"?t:i,qs(on(e,be),i,t)}),Hh=K(oa);function Yh(e,t){return iu(e||[],t||[],Ii)}function Xh(e,t){return iu(e||[],t||[],Ri)}var Kh=K(function(e){var t=e.length,s=t>1?e[t-1]:i;return s=typeof s=="function"?(e.pop(),s):i,$u(e,s)});function Bu(e){var t=l(e);return t.__chain__=!0,t}function Zh(e,t){return t(e),e}function Rr(e,t){return t(e)}var eg=Gt(function(e){var t=e.length,s=t?e[0]:0,a=this.__wrapped__,c=function(p){return Ls(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 ct(a,this.__chain__).thru(function(p){return t&&!p.length&&p.push(i),p}))});function tg(){return Bu(this)}function ng(){return new ct(this.value(),this.__chain__)}function ig(){this.__values__===i&&(this.__values__=ec(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function rg(){return this}function sg(e){for(var t,s=this;s instanceof gr;){var a=Fu(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 ag(){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:[aa],thisArg:i}),new ct(t,this.__chain__)}return this.thru(aa)}function og(){return nu(this.__wrapped__,this.__actions__)}var ug=wr(function(e,t,s){pe.call(e,s)?++e[s]:jt(e,s,1)});function cg(e,t,s){var a=Q(e)?go:Zp;return s&&Ge(e,t,s)&&(t=i),a(e,j(t,3))}function lg(e,t){var s=Q(e)?on:$o;return s(e,j(t,3))}var fg=du(Du),pg=du(Pu);function dg(e,t){return Me(Cr(e,t),1)}function hg(e,t){return Me(Cr(e,t),Rt)}function gg(e,t,s){return s=s===i?1:Y(s),Me(Cr(e,t),s)}function ju(e,t){var s=Q(e)?ot:fn;return s(e,j(t,3))}function Wu(e,t){var s=Q(e)?Df:Mo;return s(e,j(t,3))}var mg=wr(function(e,t,s){pe.call(e,s)?e[s].push(t):jt(e,s,[t])});function yg(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&&Qn(e,t,s)>-1}var vg=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):Ni(d,t,s)}),p}),_g=wr(function(e,t,s){jt(e,s,t)});function Cr(e,t){var s=Q(e)?Ee:qo;return s(e,j(t,3))}function xg(e,t,s,a){return e==null?[]:(Q(t)||(t=t==null?[]:[t]),s=a?i:s,Q(s)||(s=s==null?[]:[s]),Ho(e,t,s))}var Tg=wr(function(e,t,s){e[s?0:1].push(t)},function(){return[[],[]]});function wg(e,t,s){var a=Q(e)?_s:_o,c=arguments.length<3;return a(e,j(t,4),s,c,fn)}function Eg(e,t,s){var a=Q(e)?Pf:_o,c=arguments.length<3;return a(e,j(t,4),s,c,Mo)}function Sg(e,t){var s=Q(e)?on:$o;return s(e,Dr(j(t,3)))}function Ag(e){var t=Q(e)?Do:yd;return t(e)}function Ig(e,t,s){(s?Ge(e,t,s):t===i)?t=1:t=Y(t);var a=Q(e)?Qp:vd;return a(e,t)}function bg(e){var t=Q(e)?Hp:xd;return t(e)}function Ng(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:Ms(e).length}function Og(e,t,s){var a=Q(e)?xs:Td;return s&&Ge(e,t,s)&&(t=i),a(e,j(t,3))}var Rg=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]]),Ho(e,Me(t,1),[])}),Lr=lp||function(){return Ue.Date.now()};function Cg(e,t){if(typeof t!="function")throw new ut(g);return e=Y(e),function(){if(--e<1)return t.apply(this,arguments)}}function Gu(e,t,s){return t=s?i:t,t=e&&t==null?e.length:t,Wt(e,ce,i,i,i,i,t)}function Vu(e,t){var s;if(typeof t!="function")throw new ut(g);return e=Y(e),function(){return--e>0&&(s=t.apply(this,arguments)),e<=1&&(t=i),s}}var ua=K(function(e,t,s){var a=ae;if(s.length){var c=cn(s,ri(ua));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 Ju(e,t,s){t=s?i:t;var a=Wt(e,xe,i,i,i,i,i,t);return a.placeholder=Ju.placeholder,a}function zu(e,t,s){t=s?i:t;var a=Wt(e,L,i,i,i,i,i,t);return a.placeholder=zu.placeholder,a}function Qu(e,t,s){var a,c,p,d,h,y,E=0,S=!1,I=!1,C=!0;if(typeof e!="function")throw new ut(g);t=dt(t)||0,Ae(s)&&(S=!!s.leading,I="maxWait"in s,p=I?Fe(dt(s.maxWait)||0,t):p,C="trailing"in s?!!s.trailing:C);function U(Ne){var It=a,zt=c;return a=c=i,E=Ne,d=e.apply(zt,It),d}function G(Ne){return E=Ne,h=Fi(Z,t),S?U(Ne):d}function X(Ne){var It=Ne-y,zt=Ne-E,dc=t-It;return I?$e(dc,p-zt):dc}function V(Ne){var It=Ne-y,zt=Ne-E;return y===i||It>=t||It<0||I&&zt>=p}function Z(){var Ne=Lr();if(V(Ne))return ie(Ne);h=Fi(Z,X(Ne))}function ie(Ne){return h=i,C&&a?U(Ne):(a=c=i,d)}function it(){h!==i&&ru(h),E=0,a=y=c=h=i}function Ve(){return h===i?d:ie(Lr())}function rt(){var Ne=Lr(),It=V(Ne);if(a=arguments,c=this,y=Ne,It){if(h===i)return G(y);if(I)return ru(h),h=Fi(Z,t),U(y)}return h===i&&(h=Fi(Z,t)),d}return rt.cancel=it,rt.flush=Ve,rt}var Lg=K(function(e,t){return Uo(e,1,t)}),Fg=K(function(e,t,s){return Uo(e,dt(t)||0,s)});function Dg(e){return Wt(e,x)}function Fr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new ut(g);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 ut(g);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 Pg(e){return Vu(2,e)}var kg=wd(function(e,t){t=t.length==1&&Q(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)})}),ca=K(function(e,t){var s=cn(t,ri(ca));return Wt(e,ee,i,t,s)}),Hu=K(function(e,t){var s=cn(t,ri(Hu));return Wt(e,H,i,t,s)}),Ug=Gt(function(e,t){return Wt(e,qe,i,i,i,t)});function Mg(e,t){if(typeof e!="function")throw new ut(g);return t=t===i?t:Y(t),K(e,t)}function $g(e,t){if(typeof e!="function")throw new ut(g);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 Bg(e,t,s){var a=!0,c=!0;if(typeof e!="function")throw new ut(g);return Ae(s)&&(a="leading"in s?!!s.leading:a,c="trailing"in s?!!s.trailing:c),Qu(e,t,{leading:a,maxWait:t,trailing:c})}function jg(e){return Gu(e,1)}function Wg(e,t){return ca(zs(t),e)}function Gg(){if(!arguments.length)return[];var e=arguments[0];return Q(e)?e:[e]}function Vg(e){return lt(e,M)}function qg(e,t){return t=typeof t=="function"?t:i,lt(e,M,t)}function Jg(e){return lt(e,D|M)}function zg(e,t){return t=typeof t=="function"?t:i,lt(e,D|M,t)}function Qg(e,t){return t==null||ko(e,t,Pe(t))}function At(e,t){return e===t||e!==e&&t!==t}var Hg=Ir(Ps),Yg=Ir(function(e,t){return e>=t}),Mn=Wo(function(){return arguments}())?Wo:function(e){return Ie(e)&&pe.call(e,"callee")&&!No.call(e,"callee")},Q=_.isArray,Xg=uo?et(uo):sd;function ze(e){return e!=null&&Pr(e.length)&&!qt(e)}function be(e){return Ie(e)&&ze(e)}function Kg(e){return e===!0||e===!1||Ie(e)&&We(e)==Sn}var gn=pp||xa,Zg=co?et(co):ad;function em(e){return Ie(e)&&e.nodeType===1&&!Di(e)}function tm(e){if(e==null)return!0;if(ze(e)&&(Q(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(Li(e))return!Ms(e).length;for(var s in e)if(pe.call(e,s))return!1;return!0}function nm(e,t){return Oi(e,t)}function im(e,t,s){s=typeof s=="function"?s:i;var a=s?s(e,t):i;return a===i?Oi(e,t,i,s):!!a}function la(e){if(!Ie(e))return!1;var t=We(e);return t==Vn||t==ns||typeof e.message=="string"&&typeof e.name=="string"&&!Di(e)}function rm(e){return typeof e=="number"&&Ro(e)}function qt(e){if(!Ae(e))return!1;var t=We(e);return t==qn||t==zi||t==ts||t==Qi}function Yu(e){return typeof e=="number"&&e==Y(e)}function Pr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Tt}function Ae(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Ie(e){return e!=null&&typeof e=="object"}var Xu=lo?et(lo):ud;function sm(e,t){return e===t||Us(e,t,ea(t))}function am(e,t,s){return s=typeof s=="function"?s:i,Us(e,t,ea(t),s)}function om(e){return Ku(e)&&e!=+e}function um(e){if(qd(e))throw new z(f);return Go(e)}function cm(e){return e===null}function lm(e){return e==null}function Ku(e){return typeof e=="number"||Ie(e)&&We(e)==In}function Di(e){if(!Ie(e)||We(e)!=wt)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)==ap}var fa=fo?et(fo):cd;function fm(e){return Yu(e)&&e>=-Tt&&e<=Tt}var Zu=po?et(po):ld;function kr(e){return typeof e=="string"||!Q(e)&&Ie(e)&&We(e)==bn}function nt(e){return typeof e=="symbol"||Ie(e)&&We(e)==Jn}var si=ho?et(ho):fd;function pm(e){return e===i}function dm(e){return Ie(e)&&Be(e)==sn}function hm(e){return Ie(e)&&We(e)==ss}var gm=Ir($s),mm=Ir(function(e,t){return e<=t});function ec(e){if(!e)return[];if(ze(e))return kr(e)?Et(e):Je(e);if(Ti&&e[Ti])return Qf(e[Ti]());var t=Be(e),s=t==Xe?Is:t==Ke?tr:ai;return s(e)}function Jt(e){if(!e)return e===0?e:0;if(e=dt(e),e===Rt||e===-Rt){var t=e<0?-1:1;return t*Xr}return e===e?e:0}function Y(e){var t=Jt(e),s=t%1;return t===t?s?t-s:t:0}function tc(e){return e?Dn(Y(e),0,st):0}function dt(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=xo(e);var s=Yl.test(e);return s||Kl.test(e)?Cf(e.slice(2),s?2:8):Hl.test(e)?Wn:+e}function nc(e){return Ft(e,Qe(e))}function ym(e){return e?Dn(Y(e),-Tt,Tt):e===0?e:0}function le(e){return e==null?"":tt(e)}var vm=ni(function(e,t){if(Li(t)||ze(t)){Ft(t,Pe(t),e);return}for(var s in t)pe.call(t,s)&&Ii(e,s,t[s])}),ic=ni(function(e,t){Ft(t,Qe(t),e)}),Ur=ni(function(e,t,s,a){Ft(t,Qe(t),e,a)}),_m=ni(function(e,t,s,a){Ft(t,Pe(t),e,a)}),xm=Gt(Ls);function Tm(e,t){var s=ti(e);return t==null?s:Po(s,t)}var wm=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=Qe(p),h=-1,y=d.length;++h<y;){var E=d[h],S=e[E];(S===i||At(S,Kn[E])&&!pe.call(e,E))&&(e[E]=p[E])}return e}),Em=K(function(e){return e.push(i,xu),Ze(rc,i,e)});function Sm(e,t){return mo(e,j(t,3),Lt)}function Am(e,t){return mo(e,j(t,3),Ds)}function Im(e,t){return e==null?e:Fs(e,j(t,3),Qe)}function bm(e,t){return e==null?e:Bo(e,j(t,3),Qe)}function Nm(e,t){return e&&Lt(e,j(t,3))}function Om(e,t){return e&&Ds(e,j(t,3))}function Rm(e){return e==null?[]:vr(e,Pe(e))}function Cm(e){return e==null?[]:vr(e,Qe(e))}function pa(e,t,s){var a=e==null?i:Pn(e,t);return a===i?s:a}function Lm(e,t){return e!=null&&Eu(e,t,td)}function da(e,t){return e!=null&&Eu(e,t,nd)}var Fm=gu(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=sr.call(t)),e[t]=s},ga(He)),Dm=gu(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),Pm=K(Ni);function Pe(e){return ze(e)?Fo(e):Ms(e)}function Qe(e){return ze(e)?Fo(e,!0):pd(e)}function km(e,t){var s={};return t=j(t,3),Lt(e,function(a,c,p){jt(s,t(a,c,p),a)}),s}function Um(e,t){var s={};return t=j(t,3),Lt(e,function(a,c,p){jt(s,c,t(a,c,p))}),s}var Mm=ni(function(e,t,s){_r(e,t,s)}),rc=ni(function(e,t,s,a){_r(e,t,s,a)}),$m=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}),Ft(e,Ks(e),s),a&&(s=lt(s,D|P|M,Fd));for(var c=t.length;c--;)Vs(s,t[c]);return s});function Bm(e,t){return sc(e,Dr(j(t)))}var jm=Gt(function(e,t){return e==null?{}:hd(e,t)});function sc(e,t){if(e==null)return{};var s=Ee(Ks(e),function(a){return[a]});return t=j(t),Yo(e,s,function(a,c){return t(a,c[0])})}function Wm(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[Dt(t[a])];p===i&&(a=c,p=s),e=qt(p)?p.call(e):p}return e}function Gm(e,t,s){return e==null?e:Ri(e,t,s)}function Vm(e,t,s,a){return a=typeof a=="function"?a:i,e==null?e:Ri(e,t,s,a)}var ac=vu(Pe),oc=vu(Qe);function qm(e,t,s){var a=Q(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?ot:Lt)(e,function(d,h,y){return t(s,d,h,y)}),s}function Jm(e,t){return e==null?!0:Vs(e,t)}function zm(e,t,s){return e==null?e:tu(e,t,zs(s))}function Qm(e,t,s,a){return a=typeof a=="function"?a:i,e==null?e:tu(e,t,zs(s),a)}function ai(e){return e==null?[]:As(e,Pe(e))}function Hm(e){return e==null?[]:As(e,Qe(e))}function Ym(e,t,s){return s===i&&(s=t,t=i),s!==i&&(s=dt(s),s=s===s?s:0),t!==i&&(t=dt(t),t=t===t?t:0),Dn(dt(e),t,s)}function Xm(e,t,s){return t=Jt(t),s===i?(s=t,t=0):s=Jt(s),e=dt(e),id(e,t,s)}function Km(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=Co();return $e(e+c*(t-e+Rf("1e-"+((c+"").length-1))),t)}return js(e,t)}var Zm=ii(function(e,t,s){return t=t.toLowerCase(),e+(s?uc(t):t)});function uc(e){return ha(le(e).toLowerCase())}function cc(e){return e=le(e),e&&e.replace(ef,Gf).replace(xf,"")}function e0(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 t0(e){return e=le(e),e&&Dl.test(e)?e.replace($a,Vf):e}function n0(e){return e=le(e),e&&Bl.test(e)?e.replace(cs,"\\$&"):e}var i0=ii(function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}),r0=ii(function(e,t,s){return e+(s?" ":"")+t.toLowerCase()}),s0=pu("toLowerCase");function a0(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 o0(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 u0(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 c0(e,t,s){return s||t==null?t=0:t&&(t=+t),mp(le(e).replace(ls,""),t||0)}function l0(e,t,s){return(s?Ge(e,t,s):t===i)?t=1:t=Y(t),Ws(le(e),t)}function f0(){var e=arguments,t=le(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var p0=ii(function(e,t,s){return e+(s?"_":"")+t.toLowerCase()});function d0(e,t,s){return s&&typeof s!="number"&&Ge(e,t,s)&&(t=s=i),s=s===i?st:s>>>0,s?(e=le(e),e&&(typeof t=="string"||t!=null&&!fa(t))&&(t=tt(t),!t&&Hn(e))?hn(Et(e),0,s):e.split(t,s)):[]}var h0=ii(function(e,t,s){return e+(s?" ":"")+ha(t)});function g0(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 m0(e,t,s){var a=l.templateSettings;s&&Ge(e,t,s)&&(t=i),e=le(e),t=Ur({},t,a,_u);var c=Ur({},t.imports,a.imports,_u),p=Pe(c),d=As(c,p),h,y,E=0,S=t.interpolate||Yi,I="__p += '",C=bs((t.escape||Yi).source+"|"+S.source+"|"+(S===Ba?Ql:Yi).source+"|"+(t.evaluate||Yi).source+"|$","g"),U="//# sourceURL="+(pe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Af+"]")+`
|
|
384
|
+
`;e.replace(C,function(V,Z,ie,it,Ve,rt){return ie||(ie=it),I+=e.slice(E,rt).replace(tf,qf),Z&&(h=!0,I+=`' +
|
|
385
|
+
__e(`+Z+`) +
|
|
366
386
|
'`),Ve&&(y=!0,I+=`';
|
|
367
387
|
`+Ve+`;
|
|
368
|
-
__p += '`),
|
|
369
|
-
((__t = (`+
|
|
388
|
+
__p += '`),ie&&(I+=`' +
|
|
389
|
+
((__t = (`+ie+`)) == null ? '' : __t) +
|
|
370
390
|
'`),E=rt+V.length,V}),I+=`';
|
|
371
|
-
`;var G=
|
|
391
|
+
`;var G=pe.call(t,"variable")&&t.variable;if(!G)I=`with (obj) {
|
|
372
392
|
`+I+`
|
|
373
393
|
}
|
|
374
|
-
`;else if(
|
|
394
|
+
`;else if(Jl.test(G))throw new z(v);I=(y?I.replace(Rl,""):I).replace(Cl,"$1").replace(Ll,"$1;"),I="function("+(G||"obj")+`) {
|
|
375
395
|
`+(G?"":`obj || (obj = {});
|
|
376
396
|
`)+"var __t, __p = ''"+(h?", __e = _.escape":"")+(y?`, __j = Array.prototype.join;
|
|
377
397
|
function print() { __p += __j.call(arguments, '') }
|
|
378
398
|
`:`;
|
|
379
399
|
`)+I+`return __p
|
|
380
|
-
}`;var X=uc(function(){return ue(p,U+"return "+I).apply(i,d)});if(X.source=I,ua(X))throw X;return X}function h0(e){return fe(e).toLowerCase()}function g0(e){return fe(e).toUpperCase()}function m0(e,t,s){if(e=fe(e),e&&(s||t===i))return yo(e);if(!e||!(t=tt(t)))return e;var a=Et(e),c=Et(t),p=vo(a,c),d=_o(a,c)+1;return dn(a,p,d).join("")}function y0(e,t,s){if(e=fe(e),e&&(s||t===i))return e.slice(0,To(e)+1);if(!e||!(t=tt(t)))return e;var a=Et(e),c=_o(a,Et(t))+1;return dn(a,0,c).join("")}function v0(e,t,s){if(e=fe(e),e&&(s||t===i))return e.replace(us,"");if(!e||!(t=tt(t)))return e;var a=Et(e),c=vo(a,Et(t));return dn(a,c).join("")}function _0(e,t){var s=q,a=Ae;if(Ie(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=fe(e);var p=e.length;if(Qn(e)){var d=Et(e);p=d.length}if(s>=p)return e;var h=s-zn(a);if(h<1)return a;var y=d?dn(d,0,h).join(""):e.slice(0,h);if(c===i)return y+a;if(d&&(h+=y.length-h),ca(c)){if(e.slice(h).search(c)){var E,S=y;for(c.global||(c=As(c.source,fe(Ma.exec(c))+"g")),c.lastIndex=0;E=c.exec(S);)var I=E.index;y=y.slice(0,I===i?h:I)}}else if(e.indexOf(tt(c),h)!=h){var R=y.lastIndexOf(c);R>-1&&(y=y.slice(0,R))}return y+a}function x0(e){return e=fe(e),e&&Cl.test(e)?e.replace(Pa,Hf):e}var T0=ti(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),pa=cu("toUpperCase");function oc(e,t,s){return e=fe(e),t=s?i:t,t===i?Vf(e)?Kf(e):Pf(e):e.match(t)||[]}var uc=K(function(e,t){try{return Ze(e,i,t)}catch(s){return ua(s)?s:new Q(s)}}),w0=Wt(function(e,t){return ot(t,function(s){s=Dt(s),Bt(e,s,aa(e[s],e))}),e});function E0(e){var t=e==null?0:e.length,s=j();return e=t?Se(e,function(a){if(typeof a[1]!="function")throw new ut(g);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 S0(e){return Hp(lt(e,D))}function da(e){return function(){return e}}function A0(e,t){return e==null||e!==e?t:e}var I0=fu(),b0=fu(!0);function He(e){return e}function ha(e){return jo(typeof e=="function"?e:lt(e,D))}function N0(e){return Go(lt(e,D))}function O0(e,t){return Vo(e,lt(t,D))}var C0=K(function(e,t){return function(s){return Ii(s,e,t)}}),R0=K(function(e,t){return function(s){return Ii(e,s,t)}});function ga(e,t,s){var a=Pe(t),c=mr(t,a);s==null&&!(Ie(t)&&(c.length||!a.length))&&(s=t,t=e,e=this,c=mr(t,Pe(t)));var p=!(Ie(s)&&"chain"in s)||!!s.chain,d=Vt(e);return ot(c,function(h){var y=t[h];e[h]=y,d&&(e.prototype[h]=function(){var E=this.__chain__;if(p||E){var S=e(this.__wrapped__),I=S.__actions__=Je(this.__actions__);return I.push({func:y,args:arguments,thisArg:e}),S.__chain__=E,S}return y.apply(e,on([this.value()],arguments))})}),e}function L0(){return Ue._===this&&(Ue._=rp),this}function ma(){}function F0(e){return e=Y(e),K(function(t){return qo(t,e)})}var D0=Qs(Se),P0=Qs(fo),k0=Qs(vs);function cc(e){return ea(e)?_s(Dt(e)):pd(e)}function U0(e){return function(t){return e==null?i:Fn(e,t)}}var M0=du(),$0=du(!0);function ya(){return[]}function va(){return!1}function B0(){return{}}function j0(){return""}function W0(){return!0}function G0(e,t){if(e=Y(e),e<1||e>Tt)return[];var s=st,a=$e(e,st);t=j(t),e-=st;for(var c=ws(a,t);++s<e;)t(s);return c}function V0(e){return z(e)?Se(e,Dt):nt(e)?[e]:Je(Ou(fe(e)))}function q0(e){var t=++np;return fe(e)+t}var J0=wr(function(e,t){return e+t},0),Q0=zs("ceil"),z0=wr(function(e,t){return e/t},1),H0=zs("floor");function Y0(e){return e&&e.length?gr(e,He,Fs):i}function X0(e,t){return e&&e.length?gr(e,j(t,2),Fs):i}function K0(e){return go(e,He)}function Z0(e,t){return go(e,j(t,2))}function ey(e){return e&&e.length?gr(e,He,Us):i}function ty(e,t){return e&&e.length?gr(e,j(t,2),Us):i}var ny=wr(function(e,t){return e*t},1),iy=zs("round"),ry=wr(function(e,t){return e-t},0);function sy(e){return e&&e.length?Ts(e,He):0}function ay(e,t){return e&&e.length?Ts(e,j(t,2)):0}return l.after=Ng,l.ary=Bu,l.assign=gm,l.assignIn=ec,l.assignInWith=Pr,l.assignWith=mm,l.at=ym,l.before=ju,l.bind=aa,l.bindAll=w0,l.bindKey=Wu,l.castArray=Bg,l.chain=Uu,l.chunk=Hd,l.compact=Yd,l.concat=Xd,l.cond=E0,l.conforms=S0,l.constant=da,l.countBy=sg,l.create=vm,l.curry=Gu,l.curryRight=Vu,l.debounce=qu,l.defaults=_m,l.defaultsDeep=xm,l.defer=Og,l.delay=Cg,l.difference=Kd,l.differenceBy=Zd,l.differenceWith=eh,l.drop=th,l.dropRight=nh,l.dropRightWhile=ih,l.dropWhile=rh,l.fill=sh,l.filter=og,l.flatMap=lg,l.flatMapDeep=fg,l.flatMapDepth=pg,l.flatten=Fu,l.flattenDeep=ah,l.flattenDepth=oh,l.flip=Rg,l.flow=I0,l.flowRight=b0,l.fromPairs=uh,l.functions=bm,l.functionsIn=Nm,l.groupBy=dg,l.initial=lh,l.intersection=fh,l.intersectionBy=ph,l.intersectionWith=dh,l.invert=Cm,l.invertBy=Rm,l.invokeMap=gg,l.iteratee=ha,l.keyBy=mg,l.keys=Pe,l.keysIn=ze,l.map=Or,l.mapKeys=Fm,l.mapValues=Dm,l.matches=N0,l.matchesProperty=O0,l.memoize=Rr,l.merge=Pm,l.mergeWith=tc,l.method=C0,l.methodOf=R0,l.mixin=ga,l.negate=Lr,l.nthArg=F0,l.omit=km,l.omitBy=Um,l.once=Lg,l.orderBy=yg,l.over=D0,l.overArgs=Fg,l.overEvery=P0,l.overSome=k0,l.partial=oa,l.partialRight=Ju,l.partition=vg,l.pick=Mm,l.pickBy=nc,l.property=cc,l.propertyOf=U0,l.pull=yh,l.pullAll=Pu,l.pullAllBy=vh,l.pullAllWith=_h,l.pullAt=xh,l.range=M0,l.rangeRight=$0,l.rearg=Dg,l.reject=Tg,l.remove=Th,l.rest=Pg,l.reverse=ra,l.sampleSize=Eg,l.set=Bm,l.setWith=jm,l.shuffle=Sg,l.slice=wh,l.sortBy=bg,l.sortedUniq=Oh,l.sortedUniqBy=Ch,l.split=l0,l.spread=kg,l.tail=Rh,l.take=Lh,l.takeRight=Fh,l.takeRightWhile=Dh,l.takeWhile=Ph,l.tap=Yh,l.throttle=Ug,l.thru=Nr,l.toArray=Xu,l.toPairs=ic,l.toPairsIn=rc,l.toPath=V0,l.toPlainObject=Zu,l.transform=Wm,l.unary=Mg,l.union=kh,l.unionBy=Uh,l.unionWith=Mh,l.uniq=$h,l.uniqBy=Bh,l.uniqWith=jh,l.unset=Gm,l.unzip=sa,l.unzipWith=ku,l.update=Vm,l.updateWith=qm,l.values=ri,l.valuesIn=Jm,l.without=Wh,l.words=oc,l.wrap=$g,l.xor=Gh,l.xorBy=Vh,l.xorWith=qh,l.zip=Jh,l.zipObject=Qh,l.zipObjectDeep=zh,l.zipWith=Hh,l.entries=ic,l.entriesIn=rc,l.extend=ec,l.extendWith=Pr,ga(l,l),l.add=J0,l.attempt=uc,l.camelCase=Ym,l.capitalize=sc,l.ceil=Q0,l.clamp=Qm,l.clone=jg,l.cloneDeep=Gg,l.cloneDeepWith=Vg,l.cloneWith=Wg,l.conformsTo=qg,l.deburr=ac,l.defaultTo=A0,l.divide=z0,l.endsWith=Xm,l.eq=At,l.escape=Km,l.escapeRegExp=Zm,l.every=ag,l.find=ug,l.findIndex=Ru,l.findKey=Tm,l.findLast=cg,l.findLastIndex=Lu,l.findLastKey=wm,l.floor=H0,l.forEach=Mu,l.forEachRight=$u,l.forIn=Em,l.forInRight=Sm,l.forOwn=Am,l.forOwnRight=Im,l.get=la,l.gt=Jg,l.gte=Qg,l.has=Om,l.hasIn=fa,l.head=Du,l.identity=He,l.includes=hg,l.indexOf=ch,l.inRange=zm,l.invoke=Lm,l.isArguments=kn,l.isArray=z,l.isArrayBuffer=zg,l.isArrayLike=Qe,l.isArrayLikeObject=Ne,l.isBoolean=Hg,l.isBuffer=hn,l.isDate=Yg,l.isElement=Xg,l.isEmpty=Kg,l.isEqual=Zg,l.isEqualWith=em,l.isError=ua,l.isFinite=tm,l.isFunction=Vt,l.isInteger=Qu,l.isLength=Fr,l.isMap=zu,l.isMatch=nm,l.isMatchWith=im,l.isNaN=rm,l.isNative=sm,l.isNil=om,l.isNull=am,l.isNumber=Hu,l.isObject=Ie,l.isObjectLike=be,l.isPlainObject=Li,l.isRegExp=ca,l.isSafeInteger=um,l.isSet=Yu,l.isString=Dr,l.isSymbol=nt,l.isTypedArray=ii,l.isUndefined=cm,l.isWeakMap=lm,l.isWeakSet=fm,l.join=hh,l.kebabCase=e0,l.last=pt,l.lastIndexOf=gh,l.lowerCase=t0,l.lowerFirst=n0,l.lt=pm,l.lte=dm,l.max=Y0,l.maxBy=X0,l.mean=K0,l.meanBy=Z0,l.min=ey,l.minBy=ty,l.stubArray=ya,l.stubFalse=va,l.stubObject=B0,l.stubString=j0,l.stubTrue=W0,l.multiply=ny,l.nth=mh,l.noConflict=L0,l.noop=ma,l.now=Cr,l.pad=i0,l.padEnd=r0,l.padStart=s0,l.parseInt=a0,l.random=Hm,l.reduce=_g,l.reduceRight=xg,l.repeat=o0,l.replace=u0,l.result=$m,l.round=iy,l.runInContext=m,l.sample=wg,l.size=Ag,l.snakeCase=c0,l.some=Ig,l.sortedIndex=Eh,l.sortedIndexBy=Sh,l.sortedIndexOf=Ah,l.sortedLastIndex=Ih,l.sortedLastIndexBy=bh,l.sortedLastIndexOf=Nh,l.startCase=f0,l.startsWith=p0,l.subtract=ry,l.sum=sy,l.sumBy=ay,l.template=d0,l.times=G0,l.toFinite=qt,l.toInteger=Y,l.toLength=Ku,l.toLower=h0,l.toNumber=dt,l.toSafeInteger=hm,l.toString=fe,l.toUpper=g0,l.trim=m0,l.trimEnd=y0,l.trimStart=v0,l.truncate=_0,l.unescape=x0,l.uniqueId=q0,l.upperCase=T0,l.upperFirst=pa,l.each=Mu,l.eachRight=$u,l.first=Du,ga(l,function(){var e={};return Lt(l,function(t,s){de.call(l.prototype,s)||(e[s]=t)}),e}(),{chain:!1}),l.VERSION=o,ot(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),ot(["drop","take"],function(e,t){ne.prototype[e]=function(s){s=s===i?1:De(Y(s),0);var a=this.__filtered__&&!t?new ne(this):this.clone();return a.__filtered__?a.__takeCount__=$e(s,a.__takeCount__):a.__views__.push({size:$e(s,st),type:e+(a.__dir__<0?"Right":"")}),a},ne.prototype[e+"Right"]=function(s){return this.reverse()[e](s).reverse()}}),ot(["filter","map","takeWhile"],function(e,t){var s=t+1,a=s==Wi||s==Vi;ne.prototype[e]=function(c){var p=this.clone();return p.__iteratees__.push({iteratee:j(c,3),type:s}),p.__filtered__=p.__filtered__||a,p}}),ot(["head","last"],function(e,t){var s="take"+(t?"Right":"");ne.prototype[e]=function(){return this[s](1).value()[0]}}),ot(["initial","tail"],function(e,t){var s="drop"+(t?"":"Right");ne.prototype[e]=function(){return this.__filtered__?new ne(this):this[s](1)}}),ne.prototype.compact=function(){return this.filter(He)},ne.prototype.find=function(e){return this.filter(e).head()},ne.prototype.findLast=function(e){return this.reverse().find(e)},ne.prototype.invokeMap=K(function(e,t){return typeof e=="function"?new ne(this):this.map(function(s){return Ii(s,e,t)})}),ne.prototype.reject=function(e){return this.filter(Lr(j(e)))},ne.prototype.slice=function(e,t){e=Y(e);var s=this;return s.__filtered__&&(e>0||t<0)?new ne(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)},ne.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ne.prototype.toArray=function(){return this.take(st)},Lt(ne.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__,h=a?[1]:arguments,y=d instanceof ne,E=h[0],S=y||z(d),I=function(ee){var re=c.apply(l,on([ee],h));return a&&R?re[0]:re};S&&s&&typeof E=="function"&&E.length!=1&&(y=S=!1);var R=this.__chain__,U=!!this.__actions__.length,G=p&&!R,X=y&&!U;if(!p&&S){d=X?d:new ne(this);var V=e.apply(d,h);return V.__actions__.push({func:Nr,args:[I],thisArg:i}),new ct(V,R)}return G&&X?e.apply(this,h):(V=this.thru(I),G?a?V.value()[0]:V.value():V)})}),ot(["pop","push","shift","sort","splice","unshift"],function(e){var t=er[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(z(p)?p:[],c)}return this[s](function(d){return t.apply(z(d)?d:[],c)})}}),Lt(ne.prototype,function(e,t){var s=l[t];if(s){var a=s.name+"";de.call(Kn,a)||(Kn[a]=[]),Kn[a].push({name:t,func:s})}}),Kn[Tr(i,ye).name]=[{name:"wrapper",func:i}],ne.prototype.clone=xp,ne.prototype.reverse=Tp,ne.prototype.value=wp,l.prototype.at=Xh,l.prototype.chain=Kh,l.prototype.commit=Zh,l.prototype.next=eg,l.prototype.plant=ng,l.prototype.reverse=ig,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=rg,l.prototype.first=l.prototype.head,_i&&(l.prototype[_i]=tg),l},Hn=Zf();Nn?((Nn.exports=Hn)._=Hn,hs._=Hn):Ue._=Hn}).call(mx)}(Ui,Ui.exports)),Ui.exports}var vx=yx();const Sa=n=>{const r=vx.startCase(n).toLowerCase();return r.charAt(0).toUpperCase()+r.slice(1)},_x=({data:n})=>`import { defineObject } from 'twenty-sdk';
|
|
400
|
+
}`;var X=fc(function(){return oe(p,U+"return "+I).apply(i,d)});if(X.source=I,la(X))throw X;return X}function y0(e){return le(e).toLowerCase()}function v0(e){return le(e).toUpperCase()}function _0(e,t,s){if(e=le(e),e&&(s||t===i))return xo(e);if(!e||!(t=tt(t)))return e;var a=Et(e),c=Et(t),p=To(a,c),d=wo(a,c)+1;return hn(a,p,d).join("")}function x0(e,t,s){if(e=le(e),e&&(s||t===i))return e.slice(0,So(e)+1);if(!e||!(t=tt(t)))return e;var a=Et(e),c=wo(a,Et(t))+1;return hn(a,0,c).join("")}function T0(e,t,s){if(e=le(e),e&&(s||t===i))return e.replace(ls,"");if(!e||!(t=tt(t)))return e;var a=Et(e),c=To(a,Et(t));return hn(a,c).join("")}function w0(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(Hn(e)){var d=Et(e);p=d.length}if(s>=p)return e;var h=s-Yn(a);if(h<1)return a;var y=d?hn(d,0,h).join(""):e.slice(0,h);if(c===i)return y+a;if(d&&(h+=y.length-h),fa(c)){if(e.slice(h).search(c)){var E,S=y;for(c.global||(c=bs(c.source,le(ja.exec(c))+"g")),c.lastIndex=0;E=c.exec(S);)var I=E.index;y=y.slice(0,I===i?h:I)}}else if(e.indexOf(tt(c),h)!=h){var C=y.lastIndexOf(c);C>-1&&(y=y.slice(0,C))}return y+a}function E0(e){return e=le(e),e&&Fl.test(e)?e.replace(Ma,Kf):e}var S0=ii(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),ha=pu("toUpperCase");function lc(e,t,s){return e=le(e),t=s?i:t,t===i?zf(e)?tp(e):Mf(e):e.match(t)||[]}var fc=K(function(e,t){try{return Ze(e,i,t)}catch(s){return la(s)?s:new z(s)}}),A0=Gt(function(e,t){return ot(t,function(s){s=Dt(s),jt(e,s,ua(e[s],e))}),e});function I0(e){var t=e==null?0:e.length,s=j();return e=t?Ee(e,function(a){if(typeof a[1]!="function")throw new ut(g);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 b0(e){return Kp(lt(e,D))}function ga(e){return function(){return e}}function N0(e,t){return e==null||e!==e?t:e}var O0=hu(),R0=hu(!0);function He(e){return e}function ma(e){return Vo(typeof e=="function"?e:lt(e,D))}function C0(e){return Jo(lt(e,D))}function L0(e,t){return zo(e,lt(t,D))}var F0=K(function(e,t){return function(s){return Ni(s,e,t)}}),D0=K(function(e,t){return function(s){return Ni(e,s,t)}});function ya(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 ot(c,function(h){var y=t[h];e[h]=y,d&&(e.prototype[h]=function(){var E=this.__chain__;if(p||E){var S=e(this.__wrapped__),I=S.__actions__=Je(this.__actions__);return I.push({func:y,args:arguments,thisArg:e}),S.__chain__=E,S}return y.apply(e,un([this.value()],arguments))})}),e}function P0(){return Ue._===this&&(Ue._=op),this}function va(){}function k0(e){return e=Y(e),K(function(t){return Qo(t,e)})}var U0=Hs(Ee),M0=Hs(go),$0=Hs(xs);function pc(e){return na(e)?Ts(Dt(e)):gd(e)}function B0(e){return function(t){return e==null?i:Pn(e,t)}}var j0=mu(),W0=mu(!0);function _a(){return[]}function xa(){return!1}function G0(){return{}}function V0(){return""}function q0(){return!0}function J0(e,t){if(e=Y(e),e<1||e>Tt)return[];var s=st,a=$e(e,st);t=j(t),e-=st;for(var c=Ss(a,t);++s<e;)t(s);return c}function z0(e){return Q(e)?Ee(e,Dt):nt(e)?[e]:Je(Lu(le(e)))}function Q0(e){var t=++sp;return le(e)+t}var H0=Sr(function(e,t){return e+t},0),Y0=Ys("ceil"),X0=Sr(function(e,t){return e/t},1),K0=Ys("floor");function Z0(e){return e&&e.length?yr(e,He,Ps):i}function ey(e,t){return e&&e.length?yr(e,j(t,2),Ps):i}function ty(e){return vo(e,He)}function ny(e,t){return vo(e,j(t,2))}function iy(e){return e&&e.length?yr(e,He,$s):i}function ry(e,t){return e&&e.length?yr(e,j(t,2),$s):i}var sy=Sr(function(e,t){return e*t},1),ay=Ys("round"),oy=Sr(function(e,t){return e-t},0);function uy(e){return e&&e.length?Es(e,He):0}function cy(e,t){return e&&e.length?Es(e,j(t,2)):0}return l.after=Cg,l.ary=Gu,l.assign=vm,l.assignIn=ic,l.assignInWith=Ur,l.assignWith=_m,l.at=xm,l.before=Vu,l.bind=ua,l.bindAll=A0,l.bindKey=qu,l.castArray=Gg,l.chain=Bu,l.chunk=Kd,l.compact=Zd,l.concat=eh,l.cond=I0,l.conforms=b0,l.constant=ga,l.countBy=ug,l.create=Tm,l.curry=Ju,l.curryRight=zu,l.debounce=Qu,l.defaults=wm,l.defaultsDeep=Em,l.defer=Lg,l.delay=Fg,l.difference=th,l.differenceBy=nh,l.differenceWith=ih,l.drop=rh,l.dropRight=sh,l.dropRightWhile=ah,l.dropWhile=oh,l.fill=uh,l.filter=lg,l.flatMap=dg,l.flatMapDeep=hg,l.flatMapDepth=gg,l.flatten=ku,l.flattenDeep=ch,l.flattenDepth=lh,l.flip=Dg,l.flow=O0,l.flowRight=R0,l.fromPairs=fh,l.functions=Rm,l.functionsIn=Cm,l.groupBy=mg,l.initial=dh,l.intersection=hh,l.intersectionBy=gh,l.intersectionWith=mh,l.invert=Fm,l.invertBy=Dm,l.invokeMap=vg,l.iteratee=ma,l.keyBy=_g,l.keys=Pe,l.keysIn=Qe,l.map=Cr,l.mapKeys=km,l.mapValues=Um,l.matches=C0,l.matchesProperty=L0,l.memoize=Fr,l.merge=Mm,l.mergeWith=rc,l.method=F0,l.methodOf=D0,l.mixin=ya,l.negate=Dr,l.nthArg=k0,l.omit=$m,l.omitBy=Bm,l.once=Pg,l.orderBy=xg,l.over=U0,l.overArgs=kg,l.overEvery=M0,l.overSome=$0,l.partial=ca,l.partialRight=Hu,l.partition=Tg,l.pick=jm,l.pickBy=sc,l.property=pc,l.propertyOf=B0,l.pull=xh,l.pullAll=Mu,l.pullAllBy=Th,l.pullAllWith=wh,l.pullAt=Eh,l.range=j0,l.rangeRight=W0,l.rearg=Ug,l.reject=Sg,l.remove=Sh,l.rest=Mg,l.reverse=aa,l.sampleSize=Ig,l.set=Gm,l.setWith=Vm,l.shuffle=bg,l.slice=Ah,l.sortBy=Rg,l.sortedUniq=Lh,l.sortedUniqBy=Fh,l.split=d0,l.spread=$g,l.tail=Dh,l.take=Ph,l.takeRight=kh,l.takeRightWhile=Uh,l.takeWhile=Mh,l.tap=Zh,l.throttle=Bg,l.thru=Rr,l.toArray=ec,l.toPairs=ac,l.toPairsIn=oc,l.toPath=z0,l.toPlainObject=nc,l.transform=qm,l.unary=jg,l.union=$h,l.unionBy=Bh,l.unionWith=jh,l.uniq=Wh,l.uniqBy=Gh,l.uniqWith=Vh,l.unset=Jm,l.unzip=oa,l.unzipWith=$u,l.update=zm,l.updateWith=Qm,l.values=ai,l.valuesIn=Hm,l.without=qh,l.words=lc,l.wrap=Wg,l.xor=Jh,l.xorBy=zh,l.xorWith=Qh,l.zip=Hh,l.zipObject=Yh,l.zipObjectDeep=Xh,l.zipWith=Kh,l.entries=ac,l.entriesIn=oc,l.extend=ic,l.extendWith=Ur,ya(l,l),l.add=H0,l.attempt=fc,l.camelCase=Zm,l.capitalize=uc,l.ceil=Y0,l.clamp=Ym,l.clone=Vg,l.cloneDeep=Jg,l.cloneDeepWith=zg,l.cloneWith=qg,l.conformsTo=Qg,l.deburr=cc,l.defaultTo=N0,l.divide=X0,l.endsWith=e0,l.eq=At,l.escape=t0,l.escapeRegExp=n0,l.every=cg,l.find=fg,l.findIndex=Du,l.findKey=Sm,l.findLast=pg,l.findLastIndex=Pu,l.findLastKey=Am,l.floor=K0,l.forEach=ju,l.forEachRight=Wu,l.forIn=Im,l.forInRight=bm,l.forOwn=Nm,l.forOwnRight=Om,l.get=pa,l.gt=Hg,l.gte=Yg,l.has=Lm,l.hasIn=da,l.head=Uu,l.identity=He,l.includes=yg,l.indexOf=ph,l.inRange=Xm,l.invoke=Pm,l.isArguments=Mn,l.isArray=Q,l.isArrayBuffer=Xg,l.isArrayLike=ze,l.isArrayLikeObject=be,l.isBoolean=Kg,l.isBuffer=gn,l.isDate=Zg,l.isElement=em,l.isEmpty=tm,l.isEqual=nm,l.isEqualWith=im,l.isError=la,l.isFinite=rm,l.isFunction=qt,l.isInteger=Yu,l.isLength=Pr,l.isMap=Xu,l.isMatch=sm,l.isMatchWith=am,l.isNaN=om,l.isNative=um,l.isNil=lm,l.isNull=cm,l.isNumber=Ku,l.isObject=Ae,l.isObjectLike=Ie,l.isPlainObject=Di,l.isRegExp=fa,l.isSafeInteger=fm,l.isSet=Zu,l.isString=kr,l.isSymbol=nt,l.isTypedArray=si,l.isUndefined=pm,l.isWeakMap=dm,l.isWeakSet=hm,l.join=yh,l.kebabCase=i0,l.last=pt,l.lastIndexOf=vh,l.lowerCase=r0,l.lowerFirst=s0,l.lt=gm,l.lte=mm,l.max=Z0,l.maxBy=ey,l.mean=ty,l.meanBy=ny,l.min=iy,l.minBy=ry,l.stubArray=_a,l.stubFalse=xa,l.stubObject=G0,l.stubString=V0,l.stubTrue=q0,l.multiply=sy,l.nth=_h,l.noConflict=P0,l.noop=va,l.now=Lr,l.pad=a0,l.padEnd=o0,l.padStart=u0,l.parseInt=c0,l.random=Km,l.reduce=wg,l.reduceRight=Eg,l.repeat=l0,l.replace=f0,l.result=Wm,l.round=ay,l.runInContext=m,l.sample=Ag,l.size=Ng,l.snakeCase=p0,l.some=Og,l.sortedIndex=Ih,l.sortedIndexBy=bh,l.sortedIndexOf=Nh,l.sortedLastIndex=Oh,l.sortedLastIndexBy=Rh,l.sortedLastIndexOf=Ch,l.startCase=h0,l.startsWith=g0,l.subtract=oy,l.sum=uy,l.sumBy=cy,l.template=m0,l.times=J0,l.toFinite=Jt,l.toInteger=Y,l.toLength=tc,l.toLower=y0,l.toNumber=dt,l.toSafeInteger=ym,l.toString=le,l.toUpper=v0,l.trim=_0,l.trimEnd=x0,l.trimStart=T0,l.truncate=w0,l.unescape=E0,l.uniqueId=Q0,l.upperCase=S0,l.upperFirst=ha,l.each=ju,l.eachRight=Wu,l.first=Uu,ya(l,function(){var e={};return Lt(l,function(t,s){pe.call(l.prototype,s)||(e[s]=t)}),e}(),{chain:!1}),l.VERSION=o,ot(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),ot(["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,st),type:e+(a.__dir__<0?"Right":"")}),a},te.prototype[e+"Right"]=function(s){return this.reverse()[e](s).reverse()}}),ot(["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}}),ot(["head","last"],function(e,t){var s="take"+(t?"Right":"");te.prototype[e]=function(){return this[s](1).value()[0]}}),ot(["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(He)},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 Ni(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(st)},Lt(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__,h=a?[1]:arguments,y=d instanceof te,E=h[0],S=y||Q(d),I=function(Z){var ie=c.apply(l,un([Z],h));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,h);return V.__actions__.push({func:Rr,args:[I],thisArg:i}),new ct(V,C)}return G&&X?e.apply(this,h):(V=this.thru(I),G?a?V.value()[0]:V.value():V)})}),ot(["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(Q(p)?p:[],c)}return this[s](function(d){return t.apply(Q(d)?d:[],c)})}}),Lt(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=Ep,te.prototype.reverse=Sp,te.prototype.value=Ap,l.prototype.at=eg,l.prototype.chain=tg,l.prototype.commit=ng,l.prototype.next=ig,l.prototype.plant=sg,l.prototype.reverse=ag,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=og,l.prototype.first=l.prototype.head,Ti&&(l.prototype[Ti]=rg),l},Xn=np();Rn?((Rn.exports=Xn)._=Xn,ms._=Xn):Ue._=Xn}).call(Tx)}($i,$i.exports)),$i.exports}var Ex=wx();const Ia=n=>{const r=Ex.startCase(n).toLowerCase();return r.charAt(0).toUpperCase()+r.slice(1)},Sx=({data:n})=>`import { defineObject } from 'twenty-sdk';
|
|
381
401
|
|
|
382
402
|
export default defineObject({
|
|
383
|
-
universalIdentifier: '${
|
|
403
|
+
universalIdentifier: '${pi.v4()}',
|
|
384
404
|
nameSingular: '${n.nameSingular}',
|
|
385
405
|
namePlural: '${n.namePlural}',
|
|
386
406
|
labelSingular: '${n.labelSingular}',
|
|
@@ -397,7 +417,7 @@ export default defineObject({
|
|
|
397
417
|
// },
|
|
398
418
|
],
|
|
399
419
|
});
|
|
400
|
-
`,
|
|
420
|
+
`,Ax=({name:n,universalIdentifier:r=pi.v4()})=>{const i=fi(n);return`import { defineRole } from 'twenty-sdk';
|
|
401
421
|
|
|
402
422
|
export const ${i.toUpperCase().replace(/-/g,"_")}_ROLE_UNIVERSAL_IDENTIFIER =
|
|
403
423
|
'${r}';
|
|
@@ -411,7 +431,7 @@ export default defineRole({
|
|
|
411
431
|
canSoftDeleteAllObjectRecords: true,
|
|
412
432
|
canDestroyAllObjectRecords: false,
|
|
413
433
|
});
|
|
414
|
-
`},
|
|
434
|
+
`},Ix=({data:n})=>{const r=pi.v4(),i=n.description?`
|
|
415
435
|
description: '${n.description}',`:"";return`import { defineField, FieldType } from 'twenty-sdk';
|
|
416
436
|
|
|
417
437
|
export default defineField({
|
|
@@ -421,4 +441,4 @@ export default defineField({
|
|
|
421
441
|
type: FieldMetadataType.${n.type},
|
|
422
442
|
objectUniversalIdentifier: '${n.objectUniversalIdentifier}',${i}
|
|
423
443
|
});
|
|
424
|
-
`},
|
|
444
|
+
`},bx="src";class Nx{async execute(r,i){try{const o=r??await this.getEntity(),u=this.getFolderName(o),f=i?ge.join(Xt,i):ge.join(Xt,bx,u);await de.ensureDir(f);const{name:g,file:v}=await this.getEntityData(o),w=ge.join(f,this.getFileName(g,o));if(await de.pathExists(w)){const{overwrite:b}=await this.handleFileExist();if(!b)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=Sx({data:i});return{name:o,file:u}}case De.Field:{const i=await this.getFieldData(),o=i.name,u=Ix({data:i});return{name:o,file:u}}case De.LogicFunction:{const i=await this.getEntityName(r),o=xx({name:i});return{name:i,file:o}}case De.FrontComponent:{const i=await this.getEntityName(r),o=_x({name:i});return{name:i,file:o}}case De.Role:{const i=await this.getEntityName(r),o=Ax({name:i});return{name:i,file:o}}default:Ut.ln()}}async getEntity(){const{entity:r}=await Ht.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 Ht.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 Ht.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 Ht.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=>Ia(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(mc.s),default:mc.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 Ht.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=>Ia(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=>Ia(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 Ox=n=>{const r=new lx,i=new fx,o=new px,u=new dx,f=new mx;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 g=new sx,v=new cx,w=new Nx,b=new ux,O=new gx,D=new hx;n.command("app:dev [appPath]").description("Watch and sync local application changes").action(async P=>{await g.execute({appPath:Pi(P)})}),n.command("app:uninstall [appPath]").description("Uninstall application from Twenty").action(async P=>{try{const M=await v.execute({appPath:Pi(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 b.execute(Pi(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:Pi(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:Pi(P)})})},Rx="0.4.6-alpha",Cx={version:Rx};Ly.inspect.defaultOptions.depth=10;const yi=new Pc.Command;yi.name("twenty").description("CLI for Twenty application development").version(Cx.version);yi.option("--workspace <name>","Use a specific workspace configuration (overrides the default set by auth:switch)");yi.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()}`))});Ox(yi);yi.exitOverride();try{yi.parse()}catch(n){n instanceof Pc.CommanderError&&process.exit(n.exitCode),n instanceof Error&&(console.error(R.default.red("Error:"),n.message),process.exit(1))}
|