From 4a97b369c9eae1fc3c45b1aed32584af73779b5f Mon Sep 17 00:00:00 2001 From: patrick-codaio <84040450+patrick-codaio@users.noreply.github.com> Date: Mon, 16 Dec 2024 14:36:30 -0800 Subject: [PATCH] Default titleProperty to displayProperty (#3134) --- dist/bundle.js | 2 +- dist/helpers/migration.d.ts | 1 + dist/helpers/migration.js | 4 ++++ helpers/migration.ts | 4 ++++ package.json | 2 +- schema.ts | 2 +- test/upload_validation_test.ts | 24 +++++++++++++----------- 7 files changed, 25 insertions(+), 14 deletions(-) diff --git a/dist/bundle.js b/dist/bundle.js index 9497ca393..ac60ae4a8 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -1,7 +1,7 @@ "use strict";var so=Object.create;var Fe=Object.defineProperty;var po=Object.getOwnPropertyDescriptor;var co=Object.getOwnPropertyNames;var mo=Object.getPrototypeOf,yo=Object.prototype.hasOwnProperty;var i=(t,e)=>Fe(t,"name",{value:e,configurable:!0});var O=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),uo=(t,e)=>{for(var r in e)Fe(t,r,{get:e[r],enumerable:!0})},Fr=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of co(e))!yo.call(t,o)&&o!==r&&Fe(t,o,{get:()=>e[o],enumerable:!(n=po(e,o))||n.enumerable});return t};var Ue=(t,e,r)=>(r=t!=null?so(mo(t)):{},Fr(e||!t||!t.__esModule?Fe(r,"default",{value:t,enumerable:!0}):r,t)),lo=t=>Fr(Fe({},"__esModule",{value:!0}),t);var Ir=O((ep,Mr)=>{var To=i(t=>t[0].toLocaleUpperCase()+t.slice(1),"titlecase");Mr.exports=t=>{if(t==null||typeof t.toString!="function")return"";let e=t.toString().trim();if(e==="")return"";if(e.length===1)return e.toLocaleUpperCase();let r=e.match(/[a-zA-Z0-9]+/g);return r?r.map(n=>To(n)).join(""):e}});var Hr=O((yp,ze)=>{var Po=function(){"use strict";function t(u,c){return c!=null&&u instanceof c}i(t,"_instanceof");var e;try{e=Map}catch{e=i(function(){},"nativeMap")}var r;try{r=Set}catch{r=i(function(){},"nativeSet")}var n;try{n=Promise}catch{n=i(function(){},"nativePromise")}function o(u,c,l,T,P){typeof c=="object"&&(l=c.depth,T=c.prototype,P=c.includeNonEnumerable,c=c.circular);var F=[],x=[],d=typeof Buffer<"u";typeof c>"u"&&(c=!0),typeof l>"u"&&(l=1/0);function v(f,S){if(f===null)return null;if(S===0)return f;var A,b;if(typeof f!="object")return f;if(t(f,e))A=new e;else if(t(f,r))A=new r;else if(t(f,n))A=new n(function(g,C){f.then(function(q){g(v(q,S-1))},function(q){C(v(q,S-1))})});else if(o.__isArray(f))A=[];else if(o.__isRegExp(f))A=new RegExp(f.source,y(f)),f.lastIndex&&(A.lastIndex=f.lastIndex);else if(o.__isDate(f))A=new Date(f.getTime());else{if(d&&Buffer.isBuffer(f))return Buffer.allocUnsafe?A=Buffer.allocUnsafe(f.length):A=new Buffer(f.length),f.copy(A),A;t(f,Error)?A=Object.create(f):typeof T>"u"?(b=Object.getPrototypeOf(f),A=Object.create(b)):(A=Object.create(T),b=T)}if(c){var _=F.indexOf(f);if(_!=-1)return x[_];F.push(f),x.push(A)}t(f,e)&&f.forEach(function(g,C){var q=v(C,S-1),te=v(g,S-1);A.set(q,te)}),t(f,r)&&f.forEach(function(g){var C=v(g,S-1);A.add(C)});for(var h in f){var k;b&&(k=Object.getOwnPropertyDescriptor(b,h)),!(k&&k.set==null)&&(A[h]=v(f[h],S-1))}if(Object.getOwnPropertySymbols)for(var K=Object.getOwnPropertySymbols(f),h=0;h{"use strict";Gr.exports=Error});var zr=O((fp,$r)=>{"use strict";$r.exports=EvalError});var Jr=O((dp,Qr)=>{"use strict";Qr.exports=RangeError});var Zr=O((hp,Yr)=>{"use strict";Yr.exports=ReferenceError});var Wt=O((Tp,Xr)=>{"use strict";Xr.exports=SyntaxError});var Te=O((xp,en)=>{"use strict";en.exports=TypeError});var rn=O((gp,tn)=>{"use strict";tn.exports=URIError});var an=O((Sp,nn)=>{"use strict";nn.exports=i(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;e[r]=o;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==o||s.enumerable!==!0)return!1}return!0},"hasSymbols")});var pn=O((Ap,sn)=>{"use strict";var on=typeof Symbol<"u"&&Symbol,Ao=an();sn.exports=i(function(){return typeof on!="function"||typeof Symbol!="function"||typeof on("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Ao()},"hasNativeSymbols")});var mn=O((Dp,cn)=>{"use strict";var $t={__proto__:null,foo:{}},bo=Object;cn.exports=i(function(){return{__proto__:$t}.foo===$t.foo&&!($t instanceof bo)},"hasProto")});var ln=O((vp,un)=>{"use strict";var Do="Function.prototype.bind called on incompatible ",Oo=Object.prototype.toString,vo=Math.max,Fo="[object Function]",yn=i(function(e,r){for(var n=[],o=0;o{"use strict";var Ro=ln();fn.exports=Function.prototype.bind||Ro});var hn=O((kp,dn)=>{"use strict";var Eo=Function.prototype.call,Co=Object.prototype.hasOwnProperty,Mo=Qe();dn.exports=Mo.call(Eo,Co)});var ce=O((Rp,Pn)=>{"use strict";var D,Io=Wr(),_o=zr(),jo=Jr(),No=Zr(),Pe=Wt(),Se=Te(),Bo=rn(),Sn=Function,zt=i(function(t){try{return Sn('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),se=Object.getOwnPropertyDescriptor;if(se)try{se({},"")}catch{se=null}var Qt=i(function(){throw new Se},"throwTypeError"),Uo=se?function(){try{return arguments.callee,Qt}catch{try{return se(arguments,"callee").get}catch{return Qt}}}():Qt,xe=pn()(),Vo=mn()(),N=Object.getPrototypeOf||(Vo?function(t){return t.__proto__}:null),ge={},Lo=typeof Uint8Array>"u"||!N?D:N(Uint8Array),pe={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?D:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?D:ArrayBuffer,"%ArrayIteratorPrototype%":xe&&N?N([][Symbol.iterator]()):D,"%AsyncFromSyncIteratorPrototype%":D,"%AsyncFunction%":ge,"%AsyncGenerator%":ge,"%AsyncGeneratorFunction%":ge,"%AsyncIteratorPrototype%":ge,"%Atomics%":typeof Atomics>"u"?D:Atomics,"%BigInt%":typeof BigInt>"u"?D:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?D:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?D:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?D:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Io,"%eval%":eval,"%EvalError%":_o,"%Float32Array%":typeof Float32Array>"u"?D:Float32Array,"%Float64Array%":typeof Float64Array>"u"?D:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?D:FinalizationRegistry,"%Function%":Sn,"%GeneratorFunction%":ge,"%Int8Array%":typeof Int8Array>"u"?D:Int8Array,"%Int16Array%":typeof Int16Array>"u"?D:Int16Array,"%Int32Array%":typeof Int32Array>"u"?D:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":xe&&N?N(N([][Symbol.iterator]())):D,"%JSON%":typeof JSON=="object"?JSON:D,"%Map%":typeof Map>"u"?D:Map,"%MapIteratorPrototype%":typeof Map>"u"||!xe||!N?D:N(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?D:Promise,"%Proxy%":typeof Proxy>"u"?D:Proxy,"%RangeError%":jo,"%ReferenceError%":No,"%Reflect%":typeof Reflect>"u"?D:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?D:Set,"%SetIteratorPrototype%":typeof Set>"u"||!xe||!N?D:N(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?D:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":xe&&N?N(""[Symbol.iterator]()):D,"%Symbol%":xe?Symbol:D,"%SyntaxError%":Pe,"%ThrowTypeError%":Uo,"%TypedArray%":Lo,"%TypeError%":Se,"%Uint8Array%":typeof Uint8Array>"u"?D:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?D:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?D:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?D:Uint32Array,"%URIError%":Bo,"%WeakMap%":typeof WeakMap>"u"?D:WeakMap,"%WeakRef%":typeof WeakRef>"u"?D:WeakRef,"%WeakSet%":typeof WeakSet>"u"?D:WeakSet};if(N)try{null.error}catch(t){Tn=N(N(t)),pe["%Error.prototype%"]=Tn}var Tn,Ko=i(function t(e){var r;if(e==="%AsyncFunction%")r=zt("async function () {}");else if(e==="%GeneratorFunction%")r=zt("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=zt("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&N&&(r=N(o.prototype))}return pe[e]=r,r},"doEval"),xn={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Re=Qe(),Je=hn(),qo=Re.call(Function.call,Array.prototype.concat),Ho=Re.call(Function.apply,Array.prototype.splice),gn=Re.call(Function.call,String.prototype.replace),Ye=Re.call(Function.call,String.prototype.slice),Go=Re.call(Function.call,RegExp.prototype.exec),Wo=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,$o=/\\(\\)?/g,zo=i(function(e){var r=Ye(e,0,1),n=Ye(e,-1);if(r==="%"&&n!=="%")throw new Pe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Pe("invalid intrinsic syntax, expected opening `%`");var o=[];return gn(e,Wo,function(a,s,p,m){o[o.length]=p?gn(m,$o,"$1"):s||a}),o},"stringToPath"),Qo=i(function(e,r){var n=e,o;if(Je(xn,n)&&(o=xn[n],n="%"+o[0]+"%"),Je(pe,n)){var a=pe[n];if(a===ge&&(a=Ko(n)),typeof a>"u"&&!r)throw new Se("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:a}}throw new Pe("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");Pn.exports=i(function(e,r){if(typeof e!="string"||e.length===0)throw new Se("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Se('"allowMissing" argument must be a boolean');if(Go(/^%?[^%]*%?$/,e)===null)throw new Pe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=zo(e),o=n.length>0?n[0]:"",a=Qo("%"+o+"%",r),s=a.name,p=a.value,m=!1,y=a.alias;y&&(o=y[0],Ho(n,qo([0,1],y)));for(var u=1,c=!0;u=n.length){var F=se(p,l);c=!!F,c&&"get"in F&&!("originalValue"in F.get)?p=F.get:p=p[l]}else c=Je(p,l),p=p[l];c&&!m&&(pe[s]=p)}}return p},"GetIntrinsic")});var Xe=O((Cp,An)=>{"use strict";var Jo=ce(),Ze=Jo("%Object.defineProperty%",!0)||!1;if(Ze)try{Ze({},"a",{value:1})}catch{Ze=!1}An.exports=Ze});var Jt=O((Mp,bn)=>{"use strict";var Yo=ce(),et=Yo("%Object.getOwnPropertyDescriptor%",!0);if(et)try{et([],"length")}catch{et=null}bn.exports=et});var Fn=O((Ip,vn)=>{"use strict";var Dn=Xe(),Zo=Wt(),Ae=Te(),On=Jt();vn.exports=i(function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Ae("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Ae("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ae("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ae("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ae("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ae("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,m=!!On&&On(e,r);if(Dn)Dn(e,r,{configurable:s===null&&m?m.configurable:!s,enumerable:o===null&&m?m.enumerable:!o,value:n,writable:a===null&&m?m.writable:!a});else if(p||!o&&!a&&!s)e[r]=n;else throw new Zo("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var Rn=O((jp,kn)=>{"use strict";var Yt=Xe(),wn=i(function(){return!!Yt},"hasPropertyDescriptors");wn.hasArrayLengthDefineBug=i(function(){if(!Yt)return null;try{return Yt([],"length",{value:1}).length!==1}catch{return!0}},"hasArrayLengthDefineBug");kn.exports=wn});var _n=O((Bp,In)=>{"use strict";var Xo=ce(),En=Fn(),ei=Rn()(),Cn=Jt(),Mn=Te(),ti=Xo("%Math.floor%");In.exports=i(function(e,r){if(typeof e!="function")throw new Mn("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||ti(r)!==r)throw new Mn("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,a=!0;if("length"in e&&Cn){var s=Cn(e,"length");s&&!s.configurable&&(o=!1),s&&!s.writable&&(a=!1)}return(o||a||!n)&&(ei?En(e,"length",r,!0,!0):En(e,"length",r)),e},"setFunctionLength")});var Ln=O((Vp,tt)=>{"use strict";var Zt=Qe(),rt=ce(),ri=_n(),ni=Te(),Bn=rt("%Function.prototype.apply%"),Un=rt("%Function.prototype.call%"),Vn=rt("%Reflect.apply%",!0)||Zt.call(Un,Bn),jn=Xe(),ai=rt("%Math.max%");tt.exports=i(function(e){if(typeof e!="function")throw new ni("a function is required");var r=Vn(Zt,Un,arguments);return ri(r,1+ai(0,e.length-(arguments.length-1)),!0)},"callBind");var Nn=i(function(){return Vn(Zt,Bn,arguments)},"applyBind");jn?jn(tt.exports,"apply",{value:Nn}):tt.exports.apply=Nn});var Gn=O((Kp,Hn)=>{"use strict";var Kn=ce(),qn=Ln(),oi=qn(Kn("String.prototype.indexOf"));Hn.exports=i(function(e,r){var n=Kn(e,!!r);return typeof n=="function"&&oi(e,".prototype.")>-1?qn(n):n},"callBoundIntrinsic")});var Wn=O(()=>{});var ua=O((Wp,ya)=>{var pr=typeof Map=="function"&&Map.prototype,Xt=Object.getOwnPropertyDescriptor&&pr?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,at=pr&&Xt&&typeof Xt.get=="function"?Xt.get:null,$n=pr&&Map.prototype.forEach,cr=typeof Set=="function"&&Set.prototype,er=Object.getOwnPropertyDescriptor&&cr?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ot=cr&&er&&typeof er.get=="function"?er.get:null,zn=cr&&Set.prototype.forEach,ii=typeof WeakMap=="function"&&WeakMap.prototype,Ce=ii?WeakMap.prototype.has:null,si=typeof WeakSet=="function"&&WeakSet.prototype,Me=si?WeakSet.prototype.has:null,pi=typeof WeakRef=="function"&&WeakRef.prototype,Qn=pi?WeakRef.prototype.deref:null,ci=Boolean.prototype.valueOf,mi=Object.prototype.toString,yi=Function.prototype.toString,ui=String.prototype.match,mr=String.prototype.slice,oe=String.prototype.replace,li=String.prototype.toUpperCase,Jn=String.prototype.toLowerCase,oa=RegExp.prototype.test,Yn=Array.prototype.concat,z=Array.prototype.join,fi=Array.prototype.slice,Zn=Math.floor,nr=typeof BigInt=="function"?BigInt.prototype.valueOf:null,tr=Object.getOwnPropertySymbols,ar=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,be=typeof Symbol=="function"&&typeof Symbol.iterator=="object",V=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===be||!0)?Symbol.toStringTag:null,ia=Object.prototype.propertyIsEnumerable,Xn=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function ea(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||oa.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-Zn(-t):Zn(t);if(n!==t){var o=String(n),a=mr.call(e,o.length+1);return oe.call(o,r,"$&_")+"."+oe.call(oe.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return oe.call(e,r,"$&_")}i(ea,"addNumericSeparator");var or=Wn(),ta=or.custom,ra=pa(ta)?ta:null;ya.exports=i(function t(e,r,n,o){var a=r||{};if(ae(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ae(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=ae(a,"customInspect")?a.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ae(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ae(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var p=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return ma(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var m=String(e);return p?ea(e,m):m}if(typeof e=="bigint"){var y=String(e)+"n";return p?ea(e,y):y}var u=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=u&&u>0&&typeof e=="object")return ir(e)?"[Array]":"[Object]";var c=Ci(a,n);if(typeof o>"u")o=[];else if(ca(o,e)>=0)return"[Circular]";function l(R,E,g){if(E&&(o=fi.call(o),o.push(E)),g){var C={depth:a.depth};return ae(a,"quoteStyle")&&(C.quoteStyle=a.quoteStyle),t(R,C,n+1,o)}return t(R,a,n+1,o)}if(i(l,"inspect"),typeof e=="function"&&!na(e)){var T=bi(e),P=nt(e,l);return"[Function"+(T?": "+T:" (anonymous)")+"]"+(P.length>0?" { "+z.call(P,", ")+" }":"")}if(pa(e)){var F=be?oe.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):ar.call(e);return typeof e=="object"&&!be?Ee(F):F}if(ki(e)){for(var x="<"+Jn.call(String(e.nodeName)),d=e.attributes||[],v=0;v",x}if(ir(e)){if(e.length===0)return"[]";var f=nt(e,l);return c&&!Ei(f)?"["+sr(f,c)+"]":"[ "+z.call(f,", ")+" ]"}if(Ti(e)){var S=nt(e,l);return!("cause"in Error.prototype)&&"cause"in e&&!ia.call(e,"cause")?"{ ["+String(e)+"] "+z.call(Yn.call("[cause]: "+l(e.cause),S),", ")+" }":S.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+z.call(S,", ")+" }"}if(typeof e=="object"&&s){if(ra&&typeof e[ra]=="function"&&or)return or(e,{depth:u-n});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Di(e)){var A=[];return $n&&$n.call(e,function(R,E){A.push(l(E,e,!0)+" => "+l(R,e))}),aa("Map",at.call(e),A,c)}if(Fi(e)){var b=[];return zn&&zn.call(e,function(R){b.push(l(R,e))}),aa("Set",ot.call(e),b,c)}if(Oi(e))return rr("WeakMap");if(wi(e))return rr("WeakSet");if(vi(e))return rr("WeakRef");if(gi(e))return Ee(l(Number(e)));if(Pi(e))return Ee(l(nr.call(e)));if(Si(e))return Ee(ci.call(e));if(xi(e))return Ee(l(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof global<"u"&&e===global)return"{ [object globalThis] }";if(!hi(e)&&!na(e)){var _=nt(e,l),h=Xn?Xn(e)===Object.prototype:e instanceof Object||e.constructor===Object,k=e instanceof Object?"":"null prototype",K=!h&&V&&Object(e)===e&&V in e?mr.call(ie(e),8,-1):k?"Object":"",U=h||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",w=U+(K||k?"["+z.call(Yn.call([],K||[],k||[]),": ")+"] ":"");return _.length===0?w+"{}":c?w+"{"+sr(_,c)+"}":w+"{ "+z.call(_,", ")+" }"}return String(e)},"inspect_");function sa(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}i(sa,"wrapQuotes");function di(t){return oe.call(String(t),/"/g,""")}i(di,"quote");function ir(t){return ie(t)==="[object Array]"&&(!V||!(typeof t=="object"&&V in t))}i(ir,"isArray");function hi(t){return ie(t)==="[object Date]"&&(!V||!(typeof t=="object"&&V in t))}i(hi,"isDate");function na(t){return ie(t)==="[object RegExp]"&&(!V||!(typeof t=="object"&&V in t))}i(na,"isRegExp");function Ti(t){return ie(t)==="[object Error]"&&(!V||!(typeof t=="object"&&V in t))}i(Ti,"isError");function xi(t){return ie(t)==="[object String]"&&(!V||!(typeof t=="object"&&V in t))}i(xi,"isString");function gi(t){return ie(t)==="[object Number]"&&(!V||!(typeof t=="object"&&V in t))}i(gi,"isNumber");function Si(t){return ie(t)==="[object Boolean]"&&(!V||!(typeof t=="object"&&V in t))}i(Si,"isBoolean");function pa(t){if(be)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!ar)return!1;try{return ar.call(t),!0}catch{}return!1}i(pa,"isSymbol");function Pi(t){if(!t||typeof t!="object"||!nr)return!1;try{return nr.call(t),!0}catch{}return!1}i(Pi,"isBigInt");var Ai=Object.prototype.hasOwnProperty||function(t){return t in this};function ae(t,e){return Ai.call(t,e)}i(ae,"has");function ie(t){return mi.call(t)}i(ie,"toStr");function bi(t){if(t.name)return t.name;var e=ui.call(yi.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}i(bi,"nameOf");function ca(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return ma(mr.call(t,0,e.maxStringLength),e)+n}var o=oe.call(oe.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Ri);return sa(o,"single",e)}i(ma,"inspectString");function Ri(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+li.call(e.toString(16))}i(Ri,"lowbyte");function Ee(t){return"Object("+t+")"}i(Ee,"markBoxed");function rr(t){return t+" { ? }"}i(rr,"weakCollectionOf");function aa(t,e,r,n){var o=n?sr(r,n):z.call(r,", ");return t+" ("+e+") {"+o+"}"}i(aa,"collectionOf");function Ei(t){for(var e=0;e=0)return!1;return!0}i(Ei,"singleLineValues");function Ci(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=z.call(Array(t.indent+1)," ");else return null;return{base:r,prev:z.call(Array(e+1),r)}}i(Ci,"getIndent");function sr(t,e){if(t.length===0)return"";var r=` `+e.prev+e.base;return r+z.call(t,","+r)+` -`+e.prev}i(sr,"indentedJoin");function nt(t,e){var r=ir(t),n=[];if(r){n.length=t.length;for(var o=0;o{"use strict";var la=ce(),De=Gn(),Mi=ua(),Ii=Te(),it=la("%WeakMap%",!0),st=la("%Map%",!0),_i=De("WeakMap.prototype.get",!0),ji=De("WeakMap.prototype.set",!0),Ni=De("WeakMap.prototype.has",!0),Bi=De("Map.prototype.get",!0),Ui=De("Map.prototype.set",!0),Vi=De("Map.prototype.has",!0),yr=i(function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},"listGetNode"),Li=i(function(t,e){var r=yr(t,e);return r&&r.value},"listGet"),Ki=i(function(t,e,r){var n=yr(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),qi=i(function(t,e){return!!yr(t,e)},"listHas");fa.exports=i(function(){var e,r,n,o={assert:function(a){if(!o.has(a))throw new Ii("Side channel does not contain "+Mi(a))},get:function(a){if(it&&a&&(typeof a=="object"||typeof a=="function")){if(e)return _i(e,a)}else if(st){if(r)return Bi(r,a)}else if(n)return Li(n,a)},has:function(a){if(it&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Ni(e,a)}else if(st){if(r)return Vi(r,a)}else if(n)return qi(n,a);return!1},set:function(a,s){it&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new it),ji(e,a,s)):st?(r||(r=new st),Ui(r,a,s)):(n||(n={key:{},next:null}),Ki(n,a,s))}};return o},"getSideChannel")});var pt=O((Jp,ha)=>{"use strict";var Hi=String.prototype.replace,Gi=/%20/g,ur={RFC1738:"RFC1738",RFC3986:"RFC3986"};ha.exports={default:ur.RFC3986,formatters:{RFC1738:function(t){return Hi.call(t,Gi,"+")},RFC3986:function(t){return String(t)}},RFC1738:ur.RFC1738,RFC3986:ur.RFC3986}});var fr=O((Yp,xa)=>{"use strict";var Wi=pt(),lr=Object.prototype.hasOwnProperty,me=Array.isArray,Q=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),$i=i(function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(me(n)){for(var o=[],a=0;a=48&&y<=57||y>=65&&y<=90||y>=97&&y<=122||a===Wi.RFC1738&&(y===40||y===41)){p+=s.charAt(m);continue}if(y<128){p=p+Q[y];continue}if(y<2048){p=p+(Q[192|y>>6]+Q[128|y&63]);continue}if(y<55296||y>=57344){p=p+(Q[224|y>>12]+Q[128|y>>6&63]+Q[128|y&63]);continue}m+=1,y=65536+((y&1023)<<10|s.charCodeAt(m)&1023),p+=Q[240|y>>18]+Q[128|y>>12&63]+Q[128|y>>6&63]+Q[128|y&63]}return p},"encode"),Zi=i(function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],o=0;o{"use strict";var Pa=da(),ct=fr(),Ie=pt(),ns=Object.prototype.hasOwnProperty,ga={brackets:i(function(e){return e+"[]"},"brackets"),comma:"comma",indices:i(function(e,r){return e+"["+r+"]"},"indices"),repeat:i(function(e){return e},"repeat")},ee=Array.isArray,as=Array.prototype.push,Aa=i(function(t,e){as.apply(t,ee(e)?e:[e])},"pushToArray"),os=Date.prototype.toISOString,Sa=Ie.default,L={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:ct.encode,encodeValuesOnly:!1,format:Sa,formatter:Ie.formatters[Sa],indices:!1,serializeDate:i(function(e){return os.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},is=i(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),dr={},ss=i(function t(e,r,n,o,a,s,p,m,y,u,c,l,T,P,F,x){for(var d=e,v=x,f=0,S=!1;(v=v.get(dr))!==void 0&&!S;){var A=v.get(e);if(f+=1,typeof A<"u"){if(A===f)throw new RangeError("Cyclic object value");S=!0}typeof v.get(dr)>"u"&&(f=0)}if(typeof m=="function"?d=m(r,d):d instanceof Date?d=c(d):n==="comma"&&ee(d)&&(d=ct.maybeMap(d,function(C){return C instanceof Date?c(C):C})),d===null){if(a)return p&&!P?p(r,L.encoder,F,"key",l):r;d=""}if(is(d)||ct.isBuffer(d)){if(p){var b=P?r:p(r,L.encoder,F,"key",l);return[T(b)+"="+T(p(d,L.encoder,F,"value",l))]}return[T(r)+"="+T(String(d))]}var _=[];if(typeof d>"u")return _;var h;if(n==="comma"&&ee(d))P&&p&&(d=ct.maybeMap(d,p)),h=[{value:d.length>0?d.join(",")||null:void 0}];else if(ee(m))h=m;else{var k=Object.keys(d);h=y?k.sort(y):k}for(var K=o&&ee(d)&&d.length===1?r+"[]":r,U=0;U"u"?L.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:L.charsetSentinel,delimiter:typeof e.delimiter>"u"?L.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:L.encode,encoder:typeof e.encoder=="function"?e.encoder:L.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:L.encodeValuesOnly,filter:a,format:n,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:L.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:L.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:L.strictNullHandling}},"normalizeStringifyOptions");ba.exports=function(t,e){var r=t,n=ps(e),o,a;typeof n.filter=="function"?(a=n.filter,r=a("",r)):ee(n.filter)&&(a=n.filter,o=a);var s=[];if(typeof r!="object"||r===null)return"";var p;e&&e.arrayFormat in ga?p=e.arrayFormat:e&&"indices"in e?p=e.indices?"indices":"repeat":p="indices";var m=ga[p];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var y=m==="comma"&&e&&e.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);for(var u=Pa(),c=0;c0?P+T:""}});var Fa=O((tc,va)=>{"use strict";var Oe=fr(),hr=Object.prototype.hasOwnProperty,cs=Array.isArray,B={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Oe.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},ms=i(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),Oa=i(function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},"parseArrayValue"),ys="utf8=%26%2310003%3B",us="utf8=%E2%9C%93",ls=i(function(e,r){var n={__proto__:null},o=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=r.parameterLimit===1/0?void 0:r.parameterLimit,s=o.split(r.delimiter,a),p=-1,m,y=r.charset;if(r.charsetSentinel)for(m=0;m-1&&(P=cs(P)?[P]:P),hr.call(n,T)?n[T]=Oe.combine(n[T],P):n[T]=P}return n},"parseQueryStringValues"),fs=i(function(t,e,r,n){for(var o=n?e:Oa(e,r),a=t.length-1;a>=0;--a){var s,p=t[a];if(p==="[]"&&r.parseArrays)s=[].concat(o);else{s=r.plainObjects?Object.create(null):{};var m=p.charAt(0)==="["&&p.charAt(p.length-1)==="]"?p.slice(1,-1):p,y=parseInt(m,10);!r.parseArrays&&m===""?s={0:o}:!isNaN(y)&&p!==m&&String(y)===m&&y>=0&&r.parseArrays&&y<=r.arrayLimit?(s=[],s[y]=o):m!=="__proto__"&&(s[m]=o)}o=s}return o},"parseObject"),ds=i(function(e,r,n,o){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,p=/(\[[^[\]]*])/g,m=n.depth>0&&s.exec(a),y=m?a.slice(0,m.index):a,u=[];if(y){if(!n.plainObjects&&hr.call(Object.prototype,y)&&!n.allowPrototypes)return;u.push(y)}for(var c=0;n.depth>0&&(m=p.exec(a))!==null&&c"u"?B.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?B.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:B.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:B.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:B.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:B.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:B.comma,decoder:typeof e.decoder=="function"?e.decoder:B.decoder,delimiter:typeof e.delimiter=="string"||Oe.isRegExp(e.delimiter)?e.delimiter:B.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:B.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:B.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:B.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:B.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:B.strictNullHandling}},"normalizeParseOptions");va.exports=function(t,e){var r=hs(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?ls(t,r):t,o=r.plainObjects?Object.create(null):{},a=Object.keys(n),s=0;s{"use strict";var Ts=Da(),xs=Fa(),gs=pt();wa.exports={formats:gs,parse:xs,stringify:Ts}});var Ea=O((ac,Ra)=>{"use strict";Ra.exports=i(function(e,r){if(r=r.split(":")[0],e=+e,!e)return!1;switch(r){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0},"required")});var Ia=O(Tr=>{"use strict";var Ss=Object.prototype.hasOwnProperty,Ps;function Ca(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}i(Ca,"decode");function Ma(t){try{return encodeURIComponent(t)}catch{return null}}i(Ma,"encode");function As(t){for(var e=/([^=?#&]+)=?([^&]*)/g,r={},n;n=e.exec(t);){var o=Ca(n[1]),a=Ca(n[2]);o===null||a===null||o in r||(r[o]=a)}return r}i(As,"querystring");function bs(t,e){e=e||"";var r=[],n,o;typeof e!="string"&&(e="?");for(o in t)if(Ss.call(t,o)){if(n=t[o],!n&&(n===null||n===Ps||isNaN(n))&&(n=""),o=Ma(o),n=Ma(n),o===null||n===null)continue;r.push(o+"="+n)}return r.length?e+r.join("&"):""}i(bs,"querystringify");Tr.stringify=bs;Tr.parse=As});var Ka=O((pc,La)=>{"use strict";var ja=Ea(),mt=Ia(),Ds=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Na=/[\n\r\t]/g,Os=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,Ba=/:\d+$/,vs=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,Fs=/^[a-zA-Z]:/;function gr(t){return(t||"").toString().replace(Ds,"")}i(gr,"trimLeft");var xr=[["#","hash"],["?","query"],i(function(e,r){return J(r.protocol)?e.replace(/\\/g,"/"):e},"sanitize"),["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],_a={hash:1,query:1};function Ua(t){var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e={};var r=e.location||{};t=t||r;var n={},o=typeof t,a;if(t.protocol==="blob:")n=new Y(unescape(t.pathname),{});else if(o==="string"){n=new Y(t,{});for(a in _a)delete n[a]}else if(o==="object"){for(a in t)a in _a||(n[a]=t[a]);n.slashes===void 0&&(n.slashes=Os.test(t.href))}return n}i(Ua,"lolcation");function J(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}i(J,"isSpecial");function Va(t,e){t=gr(t),t=t.replace(Na,""),e=e||{};var r=vs.exec(t),n=r[1]?r[1].toLowerCase():"",o=!!r[2],a=!!r[3],s=0,p;return o?a?(p=r[2]+r[3]+r[4],s=r[2].length+r[3].length):(p=r[2]+r[4],s=r[2].length):a?(p=r[3]+r[4],s=r[3].length):p=r[4],n==="file:"?s>=2&&(p=p.slice(2)):J(n)?p=r[4]:n?o&&(p=p.slice(2)):s>=2&&J(e.protocol)&&(p=r[4]),{protocol:n,slashes:o||J(n),slashesCount:s,rest:p}}i(Va,"extractProtocol");function ws(t,e){if(t==="")return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,o=r[n-1],a=!1,s=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),s++):s&&(n===0&&(a=!0),r.splice(n,1),s--);return a&&r.unshift(""),(o==="."||o==="..")&&r.push(""),r.join("/")}i(ws,"resolve");function Y(t,e,r){if(t=gr(t),t=t.replace(Na,""),!(this instanceof Y))return new Y(t,e,r);var n,o,a,s,p,m,y=xr.slice(),u=typeof e,c=this,l=0;for(u!=="object"&&u!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=mt.parse),e=Ua(e),o=Va(t||"",e),n=!o.protocol&&!o.slashes,c.slashes=o.slashes||n&&e.slashes,c.protocol=o.protocol||e.protocol||"",t=o.rest,(o.protocol==="file:"&&(o.slashesCount!==2||Fs.test(t))||!o.slashes&&(o.protocol||o.slashesCount<2||!J(c.protocol)))&&(y[3]=[/(.*)/,"pathname"]);lHt,AuthenticationType:()=>Ve,ConnectionRequirement:()=>we,CurrencyFormat:()=>_t,DurationUnit:()=>Kt,EmailDisplayType:()=>Nt,ImageCornerStyle:()=>Vt,ImageOutline:()=>Ut,ImageShapeStyle:()=>Lt,IndexingStrategy:()=>qt,LinkDisplayType:()=>Bt,MissingScopesError:()=>dt,NetworkConnection:()=>Ft,OptionsType:()=>qe,PackDefinitionBuilder:()=>Ne,ParameterType:()=>Ke,PostSetupType:()=>Ot,PrecannedDateRange:()=>wt,PropertyLabelValueTemplate:()=>Nr,ScaleIconSet:()=>jt,StatusCodeError:()=>ft,SvgConstants:()=>bt,TokenExchangeCredentialsLocation:()=>vt,Type:()=>Le,UpdateOutcome:()=>Ar,UserVisibleError:()=>fe,ValidFetchMethods:()=>kr,ValueHintType:()=>$e,ValueType:()=>ke,assertCondition:()=>Z,autocompleteSearchObjects:()=>Ja,ensureExists:()=>j,ensureNonEmptyString:()=>le,ensureUnreachable:()=>ue,generateSchema:()=>We,getEffectivePropertyKeysFromSchema:()=>eo,getQueryParams:()=>qa,joinUrl:()=>Ha,makeAttributionNode:()=>Br,makeDynamicSyncTable:()=>Pt,makeEmptyFormula:()=>Za,makeFormula:()=>_e,makeMetadataFormula:()=>gt,makeObjectSchema:()=>re,makeParameter:()=>ht,makePropertyOptionsFormula:()=>St,makeReferenceSchemaFromObjectSchema:()=>Kr,makeSchema:()=>Vr,makeSimpleAutocompleteMetadataFormula:()=>Dr,makeSyncTable:()=>je,makeTranslateObjectFormula:()=>Ya,newPack:()=>Xa,simpleAutocomplete:()=>br,withIdentity:()=>qr,withQueryParams:()=>ut});module.exports=lo(Bs);var Ve=(x=>(x.None="None",x.HeaderBearerToken="HeaderBearerToken",x.CustomHeaderToken="CustomHeaderToken",x.MultiHeaderToken="MultiHeaderToken",x.QueryParamToken="QueryParamToken",x.MultiQueryParamToken="MultiQueryParamToken",x.OAuth2="OAuth2",x.OAuth2ClientCredentials="OAuth2ClientCredentials",x.WebBasic="WebBasic",x.Custom="Custom",x.AWSAccessKey="AWSAccessKey",x.AWSAssumeRole="AWSAssumeRole",x.CodaApiHeaderBearerToken="CodaApiHeaderBearerToken",x.GoogleDomainWideDelegation="GoogleDomainWideDelegation",x.GoogleServiceAccount="GoogleServiceAccount",x.Various="Various",x))(Ve||{}),Ot=(e=>(e.SetEndpoint="SetEndPoint",e))(Ot||{}),vt=(n=>(n.Automatic="Automatic",n.Body="Body",n.AuthorizationHeader="AuthorizationHeader",n))(vt||{});var Le=(y=>(y[y.string=0]="string",y[y.number=1]="number",y[y.object=2]="object",y[y.boolean=3]="boolean",y[y.date=4]="date",y[y.html=5]="html",y[y.image=6]="image",y[y.file=7]="file",y[y.markdown=8]="markdown",y))(Le||{});var Ke=(h=>(h.String="string",h.Number="number",h.Boolean="boolean",h.Date="date",h.Html="html",h.Image="image",h.File="file",h.Markdown="markdown",h.StringArray="stringArray",h.SparseStringArray="sparseStringArray",h.NumberArray="numberArray",h.SparseNumberArray="sparseNumberArray",h.BooleanArray="booleanArray",h.SparseBooleanArray="sparseBooleanArray",h.DateArray="dateArray",h.SparseDateArray="sparseDateArray",h.HtmlArray="htmlArray`",h.SparseHtmlArray="sparseHtmlArray",h.ImageArray="imageArray",h.SparseImageArray="sparseImageArray",h.FileArray="fileArray",h.SparseFileArray="sparseFileArray",h.MarkdownArray="markdownArray`",h.SparseMarkdownArray="sparseMarkdownArray",h))(Ke||{}),wr={string:0,number:1,boolean:3,date:4,html:5,image:6,file:7,markdown:8,stringArray:{type:"array",items:0},numberArray:{type:"array",items:1},booleanArray:{type:"array",items:3},dateArray:{type:"array",items:4},"htmlArray`":{type:"array",items:5},imageArray:{type:"array",items:6},fileArray:{type:"array",items:7},"markdownArray`":{type:"array",items:8},sparseStringArray:{type:"array",items:0,allowEmpty:!0},sparseNumberArray:{type:"array",items:1,allowEmpty:!0},sparseBooleanArray:{type:"array",items:3,allowEmpty:!0},sparseDateArray:{type:"array",items:4,allowEmpty:!0},sparseHtmlArray:{type:"array",items:5,allowEmpty:!0},sparseImageArray:{type:"array",items:6,allowEmpty:!0},sparseFileArray:{type:"array",items:7,allowEmpty:!0},sparseMarkdownArray:{type:"array",items:8,allowEmpty:!0}},we=(n=>(n.None="none",n.Optional="optional",n.Required="required",n))(we||{}),Ft=(n=>(n.None="none",n.Optional="optional",n.Required="required",n))(Ft||{}),kr=["GET","PATCH","POST","PUT","DELETE","HEAD"];var wt=(g=>(g.Yesterday="yesterday",g.Last7Days="last_7_days",g.Last30Days="last_30_days",g.Last90Days="last_90_days",g.Last180Days="last_180_days",g.Last365Days="last_365_days",g.LastWeek="last_week",g.LastMonth="last_month",g.Last3Months="last_3_months",g.Last6Months="last_6_months",g.LastYear="last_year",g.Today="today",g.ThisWeek="this_week",g.ThisMonth="this_month",g.YearToDate="year_to_date",g.ThisYear="this_year",g.Last7AndNext7Days="last_7_and_next_7_days",g.Last30AndNext30Days="last_30_and_next_30_days",g.Last90AndNext90Days="last_90_and_next_90_days",g.Tomorrow="tomorrow",g.Next7Days="next_7_days",g.Next30Days="next_30_days",g.Next90Days="next_90_days",g.Next180Days="next_180_days",g.Next365Days="next_365_days",g.NextWeek="next_week",g.NextMonth="next_month",g.Next3Months="next_3_months",g.Next6Months="next_6_months",g.NextYear="next_year",g.Everything="everything",g))(wt||{}),fo=["today","last_7_days","last_30_days","last_90_days","last_180_days","last_365_days","year_to_date"],Ls=[...fo,"yesterday","last_week","last_month","last_year","this_week","this_month","this_year","everything"];var Rr=(T=>(T.Today="today",T.Yesterday="yesterday",T.Tomorrow="tomorrow",T.DaysAgo7="7_days_ago",T.DaysAgo30="30_days_ago",T.DaysAgo90="90_days_ago",T.DaysAgo180="180_days_ago",T.DaysAgo365="365_days_ago",T.DaysAhead7="7_days_ahead",T.DaysAhead30="30_days_ahead",T.DaysAhead90="90_days_ahead",T.DaysAhead180="180_days_ahead",T.DaysAhead365="365_days_ahead",T))(Rr||{}),Ks=Object.values(Rr);var qe=(e=>(e.Dynamic="__coda_dynamic__",e))(qe||{});function ue(t,e){throw new Error(e||`Unreachable code hit with value ${String(t)}`)}i(ue,"ensureUnreachable");function le(t,e){if(typeof t!="string"||t.length===0)throw new(kt(e))(e||`Expected non-empty string for ${String(t)}`);return t}i(le,"ensureNonEmptyString");function j(t,e){if(typeof t>"u"||t===null)throw new(kt(e))(e||`Expected value for ${String(t)}`);return t}i(j,"ensureExists");function kt(t){return t?fe:Error}i(kt,"getErrorConstructor");function Z(t,e){if(!t)throw new(kt(e))(e||"Assertion failed")}i(Z,"assertCondition");function X(t){return JSON.parse(JSON.stringify(t))}i(X,"deepCopy");function Er(t){return t&&typeof t=="object"&&"then"in t}i(Er,"isPromise");function de(t){return new Rt(t)}i(de,"objectSchemaHelper");var Ct=class Ct{constructor(e){this._schema=e,this._checkAgainstAllProperties(e)}_checkAgainstAllProperties(e){let{id:r,idProperty:n,primary:o,displayProperty:a,featuredProperties:s,featured:p,identity:m,options:y,properties:u,type:c,attribution:l,codaType:T,requireForUpdates:P,includeUnknownProperties:F,titleProperty:x,linkProperty:d,subtitleProperties:v,snippetProperty:f,imageProperty:S,description:A,createdAtProperty:b,createdByProperty:_,modifiedAtProperty:h,modifiedByProperty:k,userEmailProperty:K,userIdProperty:U,groupIdProperty:w,memberGroupIdProperty:R,bodyTextProperty:E,popularityRankProperty:g,parentIdProperty:C,versionProperty:q,index:te,...ye}=e;}get id(){return this._schema.idProperty??this._schema.id}get primary(){return this._schema.displayProperty??this._schema.primary}get featured(){return this._schema.featuredProperties??this._schema.featured}get identity(){return this._schema.identity}get options(){return this._schema.options}get properties(){return this._schema.properties}get type(){return this._schema.type}get attribution(){return this._schema.attribution??this._schema.identity?.attribution}get codaType(){return this._schema.codaType}get requireForUpdates(){return this._schema.requireForUpdates}};i(Ct,"ObjectSchemaHelper");var Rt=Ct;function Cr(t){return new Et(t)}i(Cr,"setEndpointDefHelper");var Mt=class Mt{constructor(e){this._step=e}get getOptions(){return j(this._step.getOptions??this._step.getOptionsFormula)}};i(Mt,"SetEndpointDefHelper");var Et=Mt;var jr=Ue(Ir());var ke=(a=>(a.Boolean="boolean",a.Number="number",a.String="string",a.Array="array",a.Object="object",a))(ke||{}),$e=(b=>(b.Date="date",b.Time="time",b.DateTime="datetime",b.Duration="duration",b.Email="email",b.Person="person",b.Percent="percent",b.Currency="currency",b.ImageReference="image",b.ImageAttachment="imageAttachment",b.Url="url",b.Markdown="markdown",b.Html="html",b.Embed="embed",b.Reference="reference",b.Attachment="attachment",b.Slider="slider",b.Scale="scale",b.ProgressBar="progressBar",b.Toggle="toggle",b.CodaInternalRichText="codaInternalRichText",b.SelectList="selectList",b))($e||{});var _t=(n=>(n.Currency="currency",n.Accounting="accounting",n.Financial="financial",n))(_t||{}),jt=(S=>(S.Star="star",S.Circle="circle",S.Fire="fire",S.Bug="bug",S.Diamond="diamond",S.Bell="bell",S.ThumbsUp="thumbsup",S.Heart="heart",S.Chili="chili",S.Smiley="smiley",S.Lightning="lightning",S.Currency="currency",S.Coffee="coffee",S.Person="person",S.Battery="battery",S.Cocktail="cocktail",S.Cloud="cloud",S.Sun="sun",S.Checkmark="checkmark",S.LightBulb="lightbulb",S))(jt||{}),Nt=(n=>(n.IconAndEmail="iconAndEmail",n.IconOnly="iconOnly",n.EmailOnly="emailOnly",n))(Nt||{}),Bt=(a=>(a.IconOnly="iconOnly",a.Url="url",a.Title="title",a.Card="card",a.Embed="embed",a))(Bt||{}),Ut=(r=>(r.Disabled="disabled",r.Solid="solid",r))(Ut||{}),Vt=(r=>(r.Rounded="rounded",r.Square="square",r))(Vt||{}),Lt=(r=>(r.Auto="auto",r.Circle="circle",r))(Lt||{}),Kt=(o=>(o.Days="days",o.Hours="hours",o.Minutes="minutes",o.Seconds="seconds",o))(Kt||{});var Nr="{VALUE}",qt=(r=>(r.Standard="standard",r.Raw="raw",r))(qt||{});var Ht=(n=>(n[n.Text=1]="Text",n[n.Link=2]="Link",n[n.Image=3]="Image",n))(Ht||{});function Br(t){return t}i(Br,"makeAttributionNode");function Ur(t){return!!(t&&t.type==="object")}i(Ur,"isObject");function Ge(t){return!!(t&&t.type==="array")}i(Ge,"isArray");function Gt(t){return!!t?.codaType&&["selectList","reference"].includes(t.codaType)}i(Gt,"unwrappedSchemaSupportsOptions");function he(t){if(!Ge(t))return t;if(!Ge(t.items))return t.items}i(he,"maybeUnwrapArraySchema");function We(t){if(Array.isArray(t)){if(t.length===0)throw new Error("Must have representative value.");return{type:"array",items:We(t[0])}}if(typeof t=="object"){let e={};if(t===null)return{type:"string"};for(let r in t)t.hasOwnProperty(r)&&(e[r]=We(t[r]));return{type:"object",properties:e}}else{if(typeof t=="string")return{type:"string"};if(typeof t=="boolean")return{type:"boolean"};if(typeof t=="number")return{type:"number"}}return ue(t)}i(We,"generateSchema");function Vr(t){return t}i(Vr,"makeSchema");function re(t){let e={...t,type:"object"};for(let r of Object.keys(e.properties))if(r!=="type"){let n=r,a=he(e.properties[r])?.options,s=typeof a=="function"?a:void 0;if(e.properties[n]=X(e.properties[r]),s){let p=he(e.properties[n]);j(p,"deepCopy() broke maybeUnwrapArraySchema?..."),p.options=s}}return Lr(e),e}i(re,"makeObjectSchema");function Lr(t){if(t.codaType==="reference"){let{id:e,identity:r,primary:n}=de(t);He(e,"idProperty",t.codaType),He(r,"identity",t.codaType),He(n,"displayProperty",t.codaType),It(j(e),t,"idProperty"),It(j(n),t,"displayProperty")}if(t.codaType==="person"){let{id:e}=de(t);He(e,"idProperty",t.codaType),It(j(e),t,"idProperty")}for(let[e,r]of Object.entries(t.properties))r.type==="object"&&Lr(r)}i(Lr,"validateObjectSchema");function He(t,e,r){j(t,`Objects with codaType "${r}" require a "${e}" property in the schema definition.`)}i(He,"checkRequiredFieldInObjectSchema");function It(t,e,r){let{properties:n,codaType:o}=e;Z(n[t],`${r} set to undefined field "${t}"`),Z(n[t].required,`Field "${t}" must be marked as required in schema with codaType "${o}".`)}i(It,"checkSchemaPropertyIsRequired");function H(t){return(0,jr.default)(t).replace(/:/g,"_")}i(H,"normalizeSchemaKey");function _r(t,e){return e.hasOwnProperty(H(t))?H(t):t.split(".").map(r=>{let n=r,o="";return r.includes("[")&&(n=r.substring(0,r.indexOf("[")),o=r.substring(r.indexOf("["))),H(n)+o}).join(".")}i(_r,"normalizeSchemaKeyPath");function M(t,e){if(typeof t=="string")return _r(t,e);let{label:r,property:n,placeholder:o,...a}=t;return{property:_r(n,e),label:r,placeholder:o}}i(M,"normalizeSchemaPropertyIdentifier");function xo(t,e){if(typeof t=="object"&&"strategy"in t){let{property:r,strategy:n,...o}=t;return{property:M(r,e),strategy:n}}return M(t,e)}i(xo,"normalizeIndexProperty");function go(t,e){let{properties:r,contextProperties:n,popularityRankProperty:o,...a}=t;return{properties:r.map(s=>xo(s,e)),contextProperties:n?n.map(s=>M(s,e)):void 0,popularityRankProperty:o?M(o,e):void 0}}i(go,"normalizeIndexDefinition");function ne(t){return Ge(t)?{...t,type:"array",items:ne(t.items)}:Ur(t)?So(t):{...t}}i(ne,"normalizeSchema");function So(t){let e={},{attribution:r,options:n,requireForUpdates:o,codaType:a,description:s,displayProperty:p,featured:m,featuredProperties:y,id:u,identity:c,idProperty:l,parentIdProperty:T,imageProperty:P,includeUnknownProperties:F,linkProperty:x,primary:d,properties:v,snippetProperty:f,subtitleProperties:S,titleProperty:A,type:b,__packId:_,createdAtProperty:h,createdByProperty:k,modifiedAtProperty:K,modifiedByProperty:U,userEmailProperty:w,userIdProperty:R,groupIdProperty:E,memberGroupIdProperty:g,bodyTextProperty:C,popularityRankProperty:q,versionProperty:te,index:ye,...Dt}=t;for(let W of Object.keys(v)){let ve=H(W),$=v[W],{displayName:Be,fixedId:to,fromKey:ro,mutable:no,originalKey:ao,required:oo}=$;if(ao)throw new Error("Original key is only for internal use.");let io={displayName:Be,fixedId:to,fromKey:ro||(ve!==W?W:void 0),mutable:no,originalKey:W,required:oo};e[ve]=Object.assign(ne($),io)}return{attribution:r,options:n,requireForUpdates:o,codaType:a,description:s,displayProperty:p?H(p):void 0,featured:m?m.map(H):void 0,featuredProperties:y?y.map(H):void 0,id:u?H(u):void 0,identity:c,idProperty:l?H(l):void 0,parentIdProperty:T?H(T):void 0,imageProperty:P?M(P,e):void 0,includeUnknownProperties:F,linkProperty:x?M(x,e):void 0,primary:d?H(d):void 0,properties:e,snippetProperty:f?M(f,e):void 0,subtitleProperties:S?S.map(W=>M(W,e)):void 0,titleProperty:A?M(A,e):void 0,createdAtProperty:h?M(h,e):void 0,createdByProperty:k?M(k,e):void 0,modifiedAtProperty:K?M(K,e):void 0,modifiedByProperty:U?M(U,e):void 0,userEmailProperty:w?M(w,e):void 0,userIdProperty:R?M(R,e):void 0,groupIdProperty:E?M(E,e):void 0,memberGroupIdProperty:g?M(g,e):void 0,bodyTextProperty:C?M(C,e):void 0,popularityRankProperty:q?M(q,e):void 0,versionProperty:te?M(te,e):void 0,index:ye?go(ye,e):void 0,type:"object"}}i(So,"normalizeObjectSchema");function Kr(t,e){let{type:r,id:n,primary:o,identity:a,properties:s,options:p,requireForUpdates:m}=de(t),{mutable:y}=t;j(a||e,"Source schema must have an identity field, or you must provide an identity name for the reference.");let u=j(n),c={[u]:s[u]};o&&o!==n&&(j(s[o],`Display property "${o}" must refer to a valid property schema.`),c[o]=s[o]);let l={codaType:"reference",displayProperty:o,identity:a||{name:j(e)},idProperty:n,mutable:y,options:p,properties:c,type:r,requireForUpdates:m};return re(l)}i(Kr,"makeReferenceSchemaFromObjectSchema");function qr(t,e){return re({...X(t),identity:{name:le(e)}})}i(qr,"withIdentity");var Wa=Ue(Hr());var yt=Ue(ka()),Sr=Ue(Ka());function ut(t,e){if(!e)return t;let r=(0,Sr.default)(t),n=Object.assign({},yt.default.parse(r.query,{ignoreQueryPrefix:!0}),e);return r.set("query",yt.default.stringify(JSON.parse(JSON.stringify(n)),{addQueryPrefix:!0})),r.toString()}i(ut,"withQueryParams");function qa(t){let e=(0,Sr.default)(t);return yt.default.parse(e.query,{ignoreQueryPrefix:!0})}i(qa,"getQueryParams");function Ha(...t){if(!t||!t.length)return"";let e=[];for(let n of t)le(n),e.length===0?e.push(n):e.push(n.replace(/^\/+/,"")),n.endsWith("/")||e.push("/");let r=e.join("");return t[t.length-1].endsWith("/")?r:r.slice(0,r.length-1)}i(Ha,"join");function Es(t,e,r){let n={};return t.forEach(o=>{let a=e[o];if(typeof a>"u"){if(r&&r.has(o))return;a=""}n[o]=a}),n}i(Es,"generateParamMap");function Ga(t,e,r){let n={};return t.forEach(o=>{let a=e[o];if(typeof a>"u"){if(r&&r.has(o))return;a=""}n[o]=encodeURIComponent(String(a))}),n}i(Ga,"generateQueryParamMap");function Cs(t,e){let r=t;for(let[n,o]of Object.entries(e))r=r.replace(`{${n}}`,o);return r}i(Cs,"formatString");function Pr(t,e){let{url:r,queryParams:n,nameMapping:o,bodyTemplate:a,bodyParams:s,method:p,headers:m,transforms:y}=t,u=new Map,c=new Set,l=new Set;e.forEach((F,x)=>{let d=o&&o[F.name]||F.name;if(c.has(d))throw new Error(`Duplicate name ${d} detected`);c.add(d),F.optional&&l.add(d),u.set(x,d)});let T=!!(n&&n.length),P=!!(s&&s.length);return i(function(x){let d={};x.forEach((A,b)=>{let _=j(u.get(b)),h=y?y[_]:void 0;if(h){let k=h(A);k&&typeof k=="object"?Object.assign(d,k):d[_]=k}else d[_]=A});let v=Cs(r,Ga(Object.keys(d),d)),f=T?ut(v,Ga(j(n),d,l)):v,S;if(a&&(S=(0,Wa.default)(a)),P){let A=Es(j(s),d,l);S=S?{...S,...A}:A}return{url:f,method:p,headers:{Accept:"application/json","Content-Type":"application/json",...m},body:S?JSON.stringify(S):void 0}},"requestHandler")}i(Pr,"generateRequestHandler");function lt(t){let{projectKey:e}=t;return i(function(n){let{body:o}=n;return typeof o!="object"?o:e?o[e]:o},"objectResponseHandler")}i(lt,"generateObjectResponseHandler");var Or=class Or extends Error{constructor(r,n){super(r);this.isUserVisible=!0;this.internalError=n}};i(Or,"UserVisibleError");var fe=Or,Tt=class Tt extends Error{constructor(r,n,o,a){super(`${r} - ${JSON.stringify(n)}`);this.name="StatusCodeError";this.statusCode=r,this.body=n,this.error=n,this.options=o;let s=a?.body;typeof s=="object"&&(s=JSON.stringify(s)),this.response={...a,body:s}}static isStatusCodeError(r){return"name"in r&&r.name===Tt.name}};i(Tt,"StatusCodeError");var ft=Tt,xt=class xt extends Error{constructor(r){super(r||"Additional permissions are required");this.name="MissingScopesError"}static isMissingScopesError(r){return"name"in r&&r.name===xt.name}};i(xt,"MissingScopesError");var dt=xt;function Qa(t){return"isDynamic"in t}i(Qa,"isDynamicSyncTable");function G(t){return typeof t=="function"?gt(t):t}i(G,"wrapMetadataFunction");function $a(t){return t?.type==="array"?t:{type:"array",items:t}}i($a,"transformToArraySchema");function Ms(t){if(t)return{...t,execute(e,r){let n=t.execute(e,r);return Er(n)?n.then(o=>$a(o)):$a(n)}}}i(Ms,"wrapGetSchema");function ht(t){let{type:e,autocomplete:r,crawlStrategy:n,allowManualInput:o,...a}=t,s=wr[e],p;if(Array.isArray(r)){let u=Dr(r);p=G(u)}else p=G(r);let m;if(n)if(n.parentTable){let{tableName:u,propertyKey:c,inheritPermissions:l}=n.parentTable;m={parentTable:{tableName:u,propertyKey:H(c),inheritPermissions:l}}}else m=n;return Object.freeze({...a,allowManualInput:o!==!1,autocomplete:p,type:s,crawlStrategy:m})}i(ht,"makeParameter");var Ar=(r=>(r.Success="success",r.Error="error",r))(Ar||{});function _e(t){let e;switch(t.resultType){case"string":{let n={...t,codaType:"codaType"in t?t.codaType:void 0,formulaSchema:"schema"in t?t.schema:void 0},{onError:o,resultType:a,codaType:s,formulaSchema:p,...m}=n;Z(s!=="selectList","ValueHintType.SelectList is not supported for formula result types."),e={...m,resultType:0,schema:p||(s?{type:"string",codaType:s}:void 0)};break}case"number":{let n={...t,codaType:"codaType"in t?t.codaType:void 0,formulaSchema:"schema"in t?t.schema:void 0},{onError:o,resultType:a,codaType:s,formulaSchema:p,...m}=n;e={...m,resultType:1,schema:p||(s?{type:"number",codaType:s}:void 0)};break}case"boolean":{let{onError:n,resultType:o,...a}=t;e={...a,resultType:3};break}case"array":{let{onError:n,resultType:o,items:a,...s}=t;e={...s,resultType:2,schema:X(ne({type:"array",items:a}))};break}case"object":{let{onError:n,resultType:o,schema:a,...s}=t;e={...s,resultType:2,schema:X(ne(a))};break}default:return ue(t)}let r=t.onError;if(r){let n=e.execute;e.execute=async function(o,a){try{return await n(o,a)}catch(s){return r(s)}}}return I(e,t.connectionRequirement)}i(_e,"makeFormula");function gt(t,e){return _s({name:"getMetadata",description:"Gets metadata",execute([r,n],o){let a={};try{a=JSON.parse(n||"")}catch{}return t(o,r,a)},parameters:[ht({type:"string",name:"search",description:"Metadata to search for.",optional:!0}),ht({type:"string",name:"formulaContext",description:"Serialized JSON for metadata.",optional:!0})],examples:[],connectionRequirement:e?.connectionRequirement||"optional"})}i(gt,"makeMetadataFormula");function St({execute:t,schema:e,name:r}){if(!(t instanceof Function))throw new Error("Value for execute must be a function");let n=t,o=i(async([],p)=>n(p),"innerExecute"),a={connectionRequirement:"optional",execute:o,name:r,description:`A property options function for ${r}`,parameters:[],resultType:"array",items:e};return _e(a)}i(St,"makePropertyOptionsFormula");function br(t,e){let r=(t||"").toLowerCase(),n=e.filter(a=>(typeof a=="string"||typeof a=="number"?a:a.display).toString().toLowerCase().includes(r)),o=[];for(let a of n)typeof a=="string"?o.push({value:a,display:a}):typeof a=="number"?o.push({value:a,display:a.toString()}):o.push(a);return Promise.resolve(o)}i(br,"simpleAutocomplete");async function Ja(t,e,r,n){if(typeof t!="string")throw new TypeError(`Expecting a string for "search" parameter but received ${t}`);let o=t.toLowerCase(),a=[];for(let s of e){let p=s[r];if(!p.toLowerCase().includes(o))continue;let m=s[n];a.push({display:p,value:m})}return a}i(Ja,"autocompleteSearchObjects");function Dr(t){return gt((e,r)=>br(r,t),{connectionRequirement:"optional"})}i(Dr,"makeSimpleAutocompleteMetadataFormula");function za(t){return t&&t.schema}i(za,"isResponseHandlerTemplate");function Is(t){return t&&t.example}i(Is,"isResponseExampleTemplate");function _s({response:t,...e}){let r;if(t)if(za(t)&&t.schema){let o=X(t.schema);t.schema=ne(o),r=t.schema}else Is(t);let n=e.execute;if(za(t)){let{onError:o}=t,a=n,s=lt(t);n=i(async function(m,y){let u;try{u=await a(m,y)}catch(c){if(o)u=o(c);else throw c}return s({body:u||{},status:200,headers:{}})},"exec")}return Object.assign({},e,{resultType:2,execute:n,schema:r})}i(_s,"makeObjectFormula");function je({name:t,description:e,identityName:r,schema:n,formula:o,connectionRequirement:a,dynamicOptions:s={},role:p}){let{getSchema:m,entityName:y,defaultAddDynamicColumns:u}=s,{execute:c,executeUpdate:l,executeGetPermissions:T,onError:P,...F}=I(o,a),x=X(n);if(!r)throw new Error("Sync table schemas must set an identityName");if(x.identity){if(x.identity.name&&x.identity.name!==r)throw new Error(`Identity name mismatch for sync table ${t}. Either remove the schema's identity.name (${x.identity.name}) or ensure it matches the table's identityName (${r}).`);x.identity={...x.identity,name:r}}else x.identity={name:r};if(p==="users"){if(!x.userEmailProperty)throw new Error("Sync table schemas with role users must set a userEmailProperty");if(!x.userIdProperty)throw new Error("Sync table schemas with role users must set a userIdProperty")}if(p==="groupMembers"){if(!x.groupIdProperty)throw new Error("Sync table schemas with role groupMembers must set a groupIdProperty");if(!x.userIdProperty&&!x.memberGroupIdProperty)throw new Error("Sync table schemas with role groupMembers must set a userIdProperty or memberGroupIdProperty")}let d=Ms(G(m)),v=re(x),f=Ns({inputSchema:n,schema:v,identityName:r});s.propertyOptions&&(f??(f={}),f.__coda_dynamic__=St({execute:s.propertyOptions,schema:re({properties:{}}),name:`${r}.DynamicPropertyOptions`}));let S=ne(v),A=d?void 0:{type:"array",items:S},{identity:b,id:_,primary:h}=de(v);if(!(h&&_))throw new Error("Sync table schemas should have defined properties for idProperty and displayProperty");if(!b)throw new Error("Unknown error creating sync table identity");if(t.includes(" "))throw new Error("Sync table name should not include spaces");let k=lt({schema:A}),K=i(async function(R,E){let g;try{g=await c(R,E)||{}}catch(Be){throw P?.(Be),Be}let C=E.sync.schema,q=k({body:g.result||[],status:200,headers:{}},C),{continuation:te,completion:ye,deletedItemIds:Dt,deletedRowIds:W,deletionPredicate:ve}=g,$={result:q};return te&&($.continuation=te),ye&&($.completion=ye),(W??Dt)&&($.deletedRowIds=W??Dt,$.deletedItemIds=$.deletedRowIds),ve&&($.deletionPredicate=ve),$},"exec"),U=l?i(async function(R,E,g){let{result:C}=await l(R,E,g)||{},q=g.sync.schema;return{result:k({body:C||[],status:200,headers:{}},q)}},"execUpdate"):void 0;return{name:t,description:e,schema:S,identityName:r,getter:{...F,cacheTtlSecs:0,execute:K,executeUpdate:U,schema:A,isSyncFormula:!0,supportsUpdates:!!U,supportsGetPermissions:!!T,connectionRequirement:F.connectionRequirement||a,resultType:2,executeGetPermissions:T},getSchema:I(d,a),entityName:y,defaultAddDynamicColumns:u,namedPropertyOptions:At(f,a),role:p}}i(je,"makeSyncTable");function Pt({name:t,description:e,getName:r,getSchema:n,identityName:o,getDisplayUrl:a,formula:s,listDynamicUrls:p,searchDynamicUrls:m,entityName:y,connectionRequirement:u,defaultAddDynamicColumns:c,placeholderSchema:l,propertyOptions:T}){let P=l||re({type:"object",idProperty:"id",displayProperty:"id",identity:{name:o},properties:{id:{type:"string"}}}),F=G(r),x=G(n),d=G(a),v=G(p),f=G(m);return{...je({name:t,description:e,identityName:o,schema:P,formula:s,connectionRequirement:u,dynamicOptions:{getSchema:x,entityName:y,defaultAddDynamicColumns:c,propertyOptions:T}}),isDynamic:!0,getDisplayUrl:I(d,u),listDynamicUrls:I(v,u),searchDynamicUrls:I(f,u),getName:I(F,u)}}i(Pt,"makeDynamicSyncTable");function Ya({response:t,...e}){let{request:r,...n}=e,{parameters:o}=n;t.schema=t.schema?ne(t.schema):void 0;let{onError:a}=t,s=Pr(r,o),p=lt(t);function m(y,u){return u.fetcher.fetch(s(y)).catch(c=>{throw a?.(c),c}).then(p)}return i(m,"execute"),Object.assign({},n,{execute:m,resultType:2,schema:t.schema})}i(Ya,"makeTranslateObjectFormula");function Za(t){let{request:e,...r}=t,{parameters:n}=r,o=Pr(e,n);function a(s,p){return p.fetcher.fetch(o(s)).then(()=>"")}return i(a,"execute"),Object.assign({},r,{execute:a,resultType:0})}i(Za,"makeEmptyFormula");function At(t,e){if(!t)return t;let r={};for(let n of Object.keys(t))r[n]=I(t[n],e);return r}i(At,"maybeRewriteConnectionForNamedPropertyOptions");function I(t,e){return t&&e?{...t,parameters:t.parameters.map(r=>({...r,autocomplete:r.autocomplete?I(r.autocomplete,e):void 0})),varargParameters:t.varargParameters?.map(r=>({...r,autocomplete:r.autocomplete?I(r.autocomplete,e):void 0})),connectionRequirement:e}:t}i(I,"maybeRewriteConnectionForFormula");function js(t){let e=[];for(let r of Object.keys(t.properties)){let n=he(t.properties[r]);if(!n||!("options"in n))continue;let{options:o}=n;o&&typeof o=="function"&&e.push(r)}return e}i(js,"listPropertiesWithOptionsFunctions");function Ns({inputSchema:t,schema:e,identityName:r}){let n={},o=js(t);if(o.length){for(let a of o){let s=he(t.properties[a]),p=he(e.properties[a]);Z(Gt(s),`Property "${a}" must have codaType of ValueHintType.SelectList or ValueHintType.Reference to configure property options`),Z(Gt(p),`Property "${a}" lost codaType on deep copy?...`),p.options=a,n[a]=St({execute:s.options,schema:e.properties[a],name:`${r}.${a}.Options`})}return n}}i(Ns,"moveJsPropertyOptionsFunctionsToFormulas");function Xa(t){return new Ne(t)}i(Xa,"newPack");var vr=class vr{constructor(e){let{formulas:r,formats:n,syncTables:o,networkDomains:a,defaultAuthentication:s,systemConnectionAuthentication:p,version:m,formulaNamespace:y}=e||{};this.formulas=r||[],this.formats=n||[],this.syncTables=o||[],this.networkDomains=a||[],this.defaultAuthentication=s,this.systemConnectionAuthentication=p,this.version=m,this.formulaNamespace=y||"Deprecated"}addFormula(e){let r=_e({...e,connectionRequirement:e.connectionRequirement||this._defaultConnectionRequirement});return this.formulas.push(r),this}addSyncTable(e){let r=e.connectionRequirement||this._defaultConnectionRequirement,n=je({...e,connectionRequirement:r});return this.syncTables.push(n),this}addDynamicSyncTable(e){let r=Pt({...e,connectionRequirement:e.connectionRequirement||this._defaultConnectionRequirement});return this.syncTables.push(r),this}addColumnFormat(e){return this.formats.push(e),this}_wrapAuthenticationFunctions(e){let{getConnectionName:r,getConnectionUserId:n,postSetup:o,...a}=e,s=G(r),p=G(n),m=o?.map(y=>{let u=G(Cr(y).getOptions),c=G(y.getOptionsFormula);return{...y,getOptions:u,getOptionsFormula:c}});return{...a,getConnectionName:s,getConnectionUserId:p,postSetup:m}}setUserAuthentication(e){let{defaultConnectionRequirement:r="required",...n}=e;return n.type==="None"||n.type==="Various"?this.defaultAuthentication=n:this.defaultAuthentication=this._wrapAuthenticationFunctions(n),n.type!=="None"&&this._setDefaultConnectionRequirement(r),this}setSystemAuthentication(e){return this.systemConnectionAuthentication=this._wrapAuthenticationFunctions(e),this}addAdminAuthentication(e){return this.adminAuthentications||(this.adminAuthentications=[]),this.adminAuthentications.push({...e,authentication:this._wrapAuthenticationFunctions(e.authentication)}),this}addNetworkDomain(...e){return this.networkDomains.push(...e),this}setVersion(e){return this.version=e,this}_setDefaultConnectionRequirement(e){return this._defaultConnectionRequirement=e,this.formulas=this.formulas.map(r=>r.connectionRequirement?r:I(r,e)),this.syncTables=this.syncTables.map(r=>r.getter.connectionRequirement?r:Qa(r)?{...r,getter:I(r.getter,e),getName:I(r.getName,e),getDisplayUrl:I(r.getDisplayUrl,e),getSchema:I(r.getSchema,e),listDynamicUrls:I(r.listDynamicUrls,e),searchDynamicUrls:I(r.searchDynamicUrls,e),namedPropertyOptions:At(r.namedPropertyOptions,e)}:{...r,getter:I(r.getter,e),getSchema:I(r.getSchema,e),namedPropertyOptions:At(r.namedPropertyOptions,e)}),this}};i(vr,"PackDefinitionBuilder");var Ne=vr;function eo(t){if(t.type==="array"&&(t=t.items),t.type==="object")return[...new Set(Object.entries(t.properties).map(([e,r])=>r.fromKey||e))]}i(eo,"getEffectivePropertyKeysFromSchema");var bt;(n=>(n.DarkModeFragmentId="DarkMode",n.DataUrlPrefix="data:image/svg+xml;base64,",n.DataUrlPrefixWithDarkModeSupport="data:image/svg+xml;supportsDarkMode=1;base64,"))(bt||(bt={})); +`+e.prev}i(sr,"indentedJoin");function nt(t,e){var r=ir(t),n=[];if(r){n.length=t.length;for(var o=0;o{"use strict";var la=ce(),De=Gn(),Mi=ua(),Ii=Te(),it=la("%WeakMap%",!0),st=la("%Map%",!0),_i=De("WeakMap.prototype.get",!0),ji=De("WeakMap.prototype.set",!0),Ni=De("WeakMap.prototype.has",!0),Bi=De("Map.prototype.get",!0),Ui=De("Map.prototype.set",!0),Vi=De("Map.prototype.has",!0),yr=i(function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},"listGetNode"),Li=i(function(t,e){var r=yr(t,e);return r&&r.value},"listGet"),Ki=i(function(t,e,r){var n=yr(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),qi=i(function(t,e){return!!yr(t,e)},"listHas");fa.exports=i(function(){var e,r,n,o={assert:function(a){if(!o.has(a))throw new Ii("Side channel does not contain "+Mi(a))},get:function(a){if(it&&a&&(typeof a=="object"||typeof a=="function")){if(e)return _i(e,a)}else if(st){if(r)return Bi(r,a)}else if(n)return Li(n,a)},has:function(a){if(it&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Ni(e,a)}else if(st){if(r)return Vi(r,a)}else if(n)return qi(n,a);return!1},set:function(a,s){it&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new it),ji(e,a,s)):st?(r||(r=new st),Ui(r,a,s)):(n||(n={key:{},next:null}),Ki(n,a,s))}};return o},"getSideChannel")});var pt=O((Jp,ha)=>{"use strict";var Hi=String.prototype.replace,Gi=/%20/g,ur={RFC1738:"RFC1738",RFC3986:"RFC3986"};ha.exports={default:ur.RFC3986,formatters:{RFC1738:function(t){return Hi.call(t,Gi,"+")},RFC3986:function(t){return String(t)}},RFC1738:ur.RFC1738,RFC3986:ur.RFC3986}});var fr=O((Yp,xa)=>{"use strict";var Wi=pt(),lr=Object.prototype.hasOwnProperty,me=Array.isArray,Q=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),$i=i(function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(me(n)){for(var o=[],a=0;a=48&&y<=57||y>=65&&y<=90||y>=97&&y<=122||a===Wi.RFC1738&&(y===40||y===41)){p+=s.charAt(m);continue}if(y<128){p=p+Q[y];continue}if(y<2048){p=p+(Q[192|y>>6]+Q[128|y&63]);continue}if(y<55296||y>=57344){p=p+(Q[224|y>>12]+Q[128|y>>6&63]+Q[128|y&63]);continue}m+=1,y=65536+((y&1023)<<10|s.charCodeAt(m)&1023),p+=Q[240|y>>18]+Q[128|y>>12&63]+Q[128|y>>6&63]+Q[128|y&63]}return p},"encode"),Zi=i(function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],o=0;o{"use strict";var Pa=da(),ct=fr(),Ie=pt(),ns=Object.prototype.hasOwnProperty,ga={brackets:i(function(e){return e+"[]"},"brackets"),comma:"comma",indices:i(function(e,r){return e+"["+r+"]"},"indices"),repeat:i(function(e){return e},"repeat")},ee=Array.isArray,as=Array.prototype.push,Aa=i(function(t,e){as.apply(t,ee(e)?e:[e])},"pushToArray"),os=Date.prototype.toISOString,Sa=Ie.default,L={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:ct.encode,encodeValuesOnly:!1,format:Sa,formatter:Ie.formatters[Sa],indices:!1,serializeDate:i(function(e){return os.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},is=i(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),dr={},ss=i(function t(e,r,n,o,a,s,p,m,y,u,c,l,T,P,F,x){for(var d=e,v=x,f=0,S=!1;(v=v.get(dr))!==void 0&&!S;){var A=v.get(e);if(f+=1,typeof A<"u"){if(A===f)throw new RangeError("Cyclic object value");S=!0}typeof v.get(dr)>"u"&&(f=0)}if(typeof m=="function"?d=m(r,d):d instanceof Date?d=c(d):n==="comma"&&ee(d)&&(d=ct.maybeMap(d,function(C){return C instanceof Date?c(C):C})),d===null){if(a)return p&&!P?p(r,L.encoder,F,"key",l):r;d=""}if(is(d)||ct.isBuffer(d)){if(p){var b=P?r:p(r,L.encoder,F,"key",l);return[T(b)+"="+T(p(d,L.encoder,F,"value",l))]}return[T(r)+"="+T(String(d))]}var _=[];if(typeof d>"u")return _;var h;if(n==="comma"&&ee(d))P&&p&&(d=ct.maybeMap(d,p)),h=[{value:d.length>0?d.join(",")||null:void 0}];else if(ee(m))h=m;else{var k=Object.keys(d);h=y?k.sort(y):k}for(var K=o&&ee(d)&&d.length===1?r+"[]":r,U=0;U"u"?L.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:L.charsetSentinel,delimiter:typeof e.delimiter>"u"?L.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:L.encode,encoder:typeof e.encoder=="function"?e.encoder:L.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:L.encodeValuesOnly,filter:a,format:n,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:L.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:L.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:L.strictNullHandling}},"normalizeStringifyOptions");ba.exports=function(t,e){var r=t,n=ps(e),o,a;typeof n.filter=="function"?(a=n.filter,r=a("",r)):ee(n.filter)&&(a=n.filter,o=a);var s=[];if(typeof r!="object"||r===null)return"";var p;e&&e.arrayFormat in ga?p=e.arrayFormat:e&&"indices"in e?p=e.indices?"indices":"repeat":p="indices";var m=ga[p];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var y=m==="comma"&&e&&e.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);for(var u=Pa(),c=0;c0?P+T:""}});var Fa=O((tc,va)=>{"use strict";var Oe=fr(),hr=Object.prototype.hasOwnProperty,cs=Array.isArray,B={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Oe.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},ms=i(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),Oa=i(function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},"parseArrayValue"),ys="utf8=%26%2310003%3B",us="utf8=%E2%9C%93",ls=i(function(e,r){var n={__proto__:null},o=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=r.parameterLimit===1/0?void 0:r.parameterLimit,s=o.split(r.delimiter,a),p=-1,m,y=r.charset;if(r.charsetSentinel)for(m=0;m-1&&(P=cs(P)?[P]:P),hr.call(n,T)?n[T]=Oe.combine(n[T],P):n[T]=P}return n},"parseQueryStringValues"),fs=i(function(t,e,r,n){for(var o=n?e:Oa(e,r),a=t.length-1;a>=0;--a){var s,p=t[a];if(p==="[]"&&r.parseArrays)s=[].concat(o);else{s=r.plainObjects?Object.create(null):{};var m=p.charAt(0)==="["&&p.charAt(p.length-1)==="]"?p.slice(1,-1):p,y=parseInt(m,10);!r.parseArrays&&m===""?s={0:o}:!isNaN(y)&&p!==m&&String(y)===m&&y>=0&&r.parseArrays&&y<=r.arrayLimit?(s=[],s[y]=o):m!=="__proto__"&&(s[m]=o)}o=s}return o},"parseObject"),ds=i(function(e,r,n,o){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,p=/(\[[^[\]]*])/g,m=n.depth>0&&s.exec(a),y=m?a.slice(0,m.index):a,u=[];if(y){if(!n.plainObjects&&hr.call(Object.prototype,y)&&!n.allowPrototypes)return;u.push(y)}for(var c=0;n.depth>0&&(m=p.exec(a))!==null&&c"u"?B.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?B.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:B.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:B.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:B.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:B.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:B.comma,decoder:typeof e.decoder=="function"?e.decoder:B.decoder,delimiter:typeof e.delimiter=="string"||Oe.isRegExp(e.delimiter)?e.delimiter:B.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:B.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:B.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:B.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:B.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:B.strictNullHandling}},"normalizeParseOptions");va.exports=function(t,e){var r=hs(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?ls(t,r):t,o=r.plainObjects?Object.create(null):{},a=Object.keys(n),s=0;s{"use strict";var Ts=Da(),xs=Fa(),gs=pt();wa.exports={formats:gs,parse:xs,stringify:Ts}});var Ea=O((ac,Ra)=>{"use strict";Ra.exports=i(function(e,r){if(r=r.split(":")[0],e=+e,!e)return!1;switch(r){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0},"required")});var Ia=O(Tr=>{"use strict";var Ss=Object.prototype.hasOwnProperty,Ps;function Ca(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}i(Ca,"decode");function Ma(t){try{return encodeURIComponent(t)}catch{return null}}i(Ma,"encode");function As(t){for(var e=/([^=?#&]+)=?([^&]*)/g,r={},n;n=e.exec(t);){var o=Ca(n[1]),a=Ca(n[2]);o===null||a===null||o in r||(r[o]=a)}return r}i(As,"querystring");function bs(t,e){e=e||"";var r=[],n,o;typeof e!="string"&&(e="?");for(o in t)if(Ss.call(t,o)){if(n=t[o],!n&&(n===null||n===Ps||isNaN(n))&&(n=""),o=Ma(o),n=Ma(n),o===null||n===null)continue;r.push(o+"="+n)}return r.length?e+r.join("&"):""}i(bs,"querystringify");Tr.stringify=bs;Tr.parse=As});var Ka=O((pc,La)=>{"use strict";var ja=Ea(),mt=Ia(),Ds=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Na=/[\n\r\t]/g,Os=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,Ba=/:\d+$/,vs=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,Fs=/^[a-zA-Z]:/;function gr(t){return(t||"").toString().replace(Ds,"")}i(gr,"trimLeft");var xr=[["#","hash"],["?","query"],i(function(e,r){return J(r.protocol)?e.replace(/\\/g,"/"):e},"sanitize"),["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],_a={hash:1,query:1};function Ua(t){var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e={};var r=e.location||{};t=t||r;var n={},o=typeof t,a;if(t.protocol==="blob:")n=new Y(unescape(t.pathname),{});else if(o==="string"){n=new Y(t,{});for(a in _a)delete n[a]}else if(o==="object"){for(a in t)a in _a||(n[a]=t[a]);n.slashes===void 0&&(n.slashes=Os.test(t.href))}return n}i(Ua,"lolcation");function J(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}i(J,"isSpecial");function Va(t,e){t=gr(t),t=t.replace(Na,""),e=e||{};var r=vs.exec(t),n=r[1]?r[1].toLowerCase():"",o=!!r[2],a=!!r[3],s=0,p;return o?a?(p=r[2]+r[3]+r[4],s=r[2].length+r[3].length):(p=r[2]+r[4],s=r[2].length):a?(p=r[3]+r[4],s=r[3].length):p=r[4],n==="file:"?s>=2&&(p=p.slice(2)):J(n)?p=r[4]:n?o&&(p=p.slice(2)):s>=2&&J(e.protocol)&&(p=r[4]),{protocol:n,slashes:o||J(n),slashesCount:s,rest:p}}i(Va,"extractProtocol");function ws(t,e){if(t==="")return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,o=r[n-1],a=!1,s=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),s++):s&&(n===0&&(a=!0),r.splice(n,1),s--);return a&&r.unshift(""),(o==="."||o==="..")&&r.push(""),r.join("/")}i(ws,"resolve");function Y(t,e,r){if(t=gr(t),t=t.replace(Na,""),!(this instanceof Y))return new Y(t,e,r);var n,o,a,s,p,m,y=xr.slice(),u=typeof e,c=this,l=0;for(u!=="object"&&u!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=mt.parse),e=Ua(e),o=Va(t||"",e),n=!o.protocol&&!o.slashes,c.slashes=o.slashes||n&&e.slashes,c.protocol=o.protocol||e.protocol||"",t=o.rest,(o.protocol==="file:"&&(o.slashesCount!==2||Fs.test(t))||!o.slashes&&(o.protocol||o.slashesCount<2||!J(c.protocol)))&&(y[3]=[/(.*)/,"pathname"]);lHt,AuthenticationType:()=>Ve,ConnectionRequirement:()=>we,CurrencyFormat:()=>_t,DurationUnit:()=>Kt,EmailDisplayType:()=>Nt,ImageCornerStyle:()=>Vt,ImageOutline:()=>Ut,ImageShapeStyle:()=>Lt,IndexingStrategy:()=>qt,LinkDisplayType:()=>Bt,MissingScopesError:()=>dt,NetworkConnection:()=>Ft,OptionsType:()=>qe,PackDefinitionBuilder:()=>Ne,ParameterType:()=>Ke,PostSetupType:()=>Ot,PrecannedDateRange:()=>wt,PropertyLabelValueTemplate:()=>Nr,ScaleIconSet:()=>jt,StatusCodeError:()=>ft,SvgConstants:()=>bt,TokenExchangeCredentialsLocation:()=>vt,Type:()=>Le,UpdateOutcome:()=>Ar,UserVisibleError:()=>fe,ValidFetchMethods:()=>kr,ValueHintType:()=>$e,ValueType:()=>ke,assertCondition:()=>Z,autocompleteSearchObjects:()=>Ja,ensureExists:()=>j,ensureNonEmptyString:()=>le,ensureUnreachable:()=>ue,generateSchema:()=>We,getEffectivePropertyKeysFromSchema:()=>eo,getQueryParams:()=>qa,joinUrl:()=>Ha,makeAttributionNode:()=>Br,makeDynamicSyncTable:()=>Pt,makeEmptyFormula:()=>Za,makeFormula:()=>_e,makeMetadataFormula:()=>gt,makeObjectSchema:()=>re,makeParameter:()=>ht,makePropertyOptionsFormula:()=>St,makeReferenceSchemaFromObjectSchema:()=>Kr,makeSchema:()=>Vr,makeSimpleAutocompleteMetadataFormula:()=>Dr,makeSyncTable:()=>je,makeTranslateObjectFormula:()=>Ya,newPack:()=>Xa,simpleAutocomplete:()=>br,withIdentity:()=>qr,withQueryParams:()=>ut});module.exports=lo(Bs);var Ve=(x=>(x.None="None",x.HeaderBearerToken="HeaderBearerToken",x.CustomHeaderToken="CustomHeaderToken",x.MultiHeaderToken="MultiHeaderToken",x.QueryParamToken="QueryParamToken",x.MultiQueryParamToken="MultiQueryParamToken",x.OAuth2="OAuth2",x.OAuth2ClientCredentials="OAuth2ClientCredentials",x.WebBasic="WebBasic",x.Custom="Custom",x.AWSAccessKey="AWSAccessKey",x.AWSAssumeRole="AWSAssumeRole",x.CodaApiHeaderBearerToken="CodaApiHeaderBearerToken",x.GoogleDomainWideDelegation="GoogleDomainWideDelegation",x.GoogleServiceAccount="GoogleServiceAccount",x.Various="Various",x))(Ve||{}),Ot=(e=>(e.SetEndpoint="SetEndPoint",e))(Ot||{}),vt=(n=>(n.Automatic="Automatic",n.Body="Body",n.AuthorizationHeader="AuthorizationHeader",n))(vt||{});var Le=(y=>(y[y.string=0]="string",y[y.number=1]="number",y[y.object=2]="object",y[y.boolean=3]="boolean",y[y.date=4]="date",y[y.html=5]="html",y[y.image=6]="image",y[y.file=7]="file",y[y.markdown=8]="markdown",y))(Le||{});var Ke=(h=>(h.String="string",h.Number="number",h.Boolean="boolean",h.Date="date",h.Html="html",h.Image="image",h.File="file",h.Markdown="markdown",h.StringArray="stringArray",h.SparseStringArray="sparseStringArray",h.NumberArray="numberArray",h.SparseNumberArray="sparseNumberArray",h.BooleanArray="booleanArray",h.SparseBooleanArray="sparseBooleanArray",h.DateArray="dateArray",h.SparseDateArray="sparseDateArray",h.HtmlArray="htmlArray`",h.SparseHtmlArray="sparseHtmlArray",h.ImageArray="imageArray",h.SparseImageArray="sparseImageArray",h.FileArray="fileArray",h.SparseFileArray="sparseFileArray",h.MarkdownArray="markdownArray`",h.SparseMarkdownArray="sparseMarkdownArray",h))(Ke||{}),wr={string:0,number:1,boolean:3,date:4,html:5,image:6,file:7,markdown:8,stringArray:{type:"array",items:0},numberArray:{type:"array",items:1},booleanArray:{type:"array",items:3},dateArray:{type:"array",items:4},"htmlArray`":{type:"array",items:5},imageArray:{type:"array",items:6},fileArray:{type:"array",items:7},"markdownArray`":{type:"array",items:8},sparseStringArray:{type:"array",items:0,allowEmpty:!0},sparseNumberArray:{type:"array",items:1,allowEmpty:!0},sparseBooleanArray:{type:"array",items:3,allowEmpty:!0},sparseDateArray:{type:"array",items:4,allowEmpty:!0},sparseHtmlArray:{type:"array",items:5,allowEmpty:!0},sparseImageArray:{type:"array",items:6,allowEmpty:!0},sparseFileArray:{type:"array",items:7,allowEmpty:!0},sparseMarkdownArray:{type:"array",items:8,allowEmpty:!0}},we=(n=>(n.None="none",n.Optional="optional",n.Required="required",n))(we||{}),Ft=(n=>(n.None="none",n.Optional="optional",n.Required="required",n))(Ft||{}),kr=["GET","PATCH","POST","PUT","DELETE","HEAD"];var wt=(g=>(g.Yesterday="yesterday",g.Last7Days="last_7_days",g.Last30Days="last_30_days",g.Last90Days="last_90_days",g.Last180Days="last_180_days",g.Last365Days="last_365_days",g.LastWeek="last_week",g.LastMonth="last_month",g.Last3Months="last_3_months",g.Last6Months="last_6_months",g.LastYear="last_year",g.Today="today",g.ThisWeek="this_week",g.ThisMonth="this_month",g.YearToDate="year_to_date",g.ThisYear="this_year",g.Last7AndNext7Days="last_7_and_next_7_days",g.Last30AndNext30Days="last_30_and_next_30_days",g.Last90AndNext90Days="last_90_and_next_90_days",g.Tomorrow="tomorrow",g.Next7Days="next_7_days",g.Next30Days="next_30_days",g.Next90Days="next_90_days",g.Next180Days="next_180_days",g.Next365Days="next_365_days",g.NextWeek="next_week",g.NextMonth="next_month",g.Next3Months="next_3_months",g.Next6Months="next_6_months",g.NextYear="next_year",g.Everything="everything",g))(wt||{}),fo=["today","last_7_days","last_30_days","last_90_days","last_180_days","last_365_days","year_to_date"],Ls=[...fo,"yesterday","last_week","last_month","last_year","this_week","this_month","this_year","everything"];var Rr=(T=>(T.Today="today",T.Yesterday="yesterday",T.Tomorrow="tomorrow",T.DaysAgo7="7_days_ago",T.DaysAgo30="30_days_ago",T.DaysAgo90="90_days_ago",T.DaysAgo180="180_days_ago",T.DaysAgo365="365_days_ago",T.DaysAhead7="7_days_ahead",T.DaysAhead30="30_days_ahead",T.DaysAhead90="90_days_ahead",T.DaysAhead180="180_days_ahead",T.DaysAhead365="365_days_ahead",T))(Rr||{}),Ks=Object.values(Rr);var qe=(e=>(e.Dynamic="__coda_dynamic__",e))(qe||{});function ue(t,e){throw new Error(e||`Unreachable code hit with value ${String(t)}`)}i(ue,"ensureUnreachable");function le(t,e){if(typeof t!="string"||t.length===0)throw new(kt(e))(e||`Expected non-empty string for ${String(t)}`);return t}i(le,"ensureNonEmptyString");function j(t,e){if(typeof t>"u"||t===null)throw new(kt(e))(e||`Expected value for ${String(t)}`);return t}i(j,"ensureExists");function kt(t){return t?fe:Error}i(kt,"getErrorConstructor");function Z(t,e){if(!t)throw new(kt(e))(e||"Assertion failed")}i(Z,"assertCondition");function X(t){return JSON.parse(JSON.stringify(t))}i(X,"deepCopy");function Er(t){return t&&typeof t=="object"&&"then"in t}i(Er,"isPromise");function de(t){return new Rt(t)}i(de,"objectSchemaHelper");var Ct=class Ct{constructor(e){this._schema=e,this._checkAgainstAllProperties(e)}_checkAgainstAllProperties(e){let{id:r,idProperty:n,primary:o,displayProperty:a,featuredProperties:s,featured:p,identity:m,options:y,properties:u,type:c,attribution:l,codaType:T,requireForUpdates:P,includeUnknownProperties:F,titleProperty:x,linkProperty:d,subtitleProperties:v,snippetProperty:f,imageProperty:S,description:A,createdAtProperty:b,createdByProperty:_,modifiedAtProperty:h,modifiedByProperty:k,userEmailProperty:K,userIdProperty:U,groupIdProperty:w,memberGroupIdProperty:R,bodyTextProperty:E,popularityRankProperty:g,parentIdProperty:C,versionProperty:q,index:te,...ye}=e;}get id(){return this._schema.idProperty??this._schema.id}get primary(){return this._schema.displayProperty??this._schema.primary}get featured(){return this._schema.featuredProperties??this._schema.featured}get identity(){return this._schema.identity}get options(){return this._schema.options}get properties(){return this._schema.properties}get type(){return this._schema.type}get attribution(){return this._schema.attribution??this._schema.identity?.attribution}get codaType(){return this._schema.codaType}get requireForUpdates(){return this._schema.requireForUpdates}get titleProperty(){return this._schema.titleProperty??this._schema.displayProperty}};i(Ct,"ObjectSchemaHelper");var Rt=Ct;function Cr(t){return new Et(t)}i(Cr,"setEndpointDefHelper");var Mt=class Mt{constructor(e){this._step=e}get getOptions(){return j(this._step.getOptions??this._step.getOptionsFormula)}};i(Mt,"SetEndpointDefHelper");var Et=Mt;var jr=Ue(Ir());var ke=(a=>(a.Boolean="boolean",a.Number="number",a.String="string",a.Array="array",a.Object="object",a))(ke||{}),$e=(b=>(b.Date="date",b.Time="time",b.DateTime="datetime",b.Duration="duration",b.Email="email",b.Person="person",b.Percent="percent",b.Currency="currency",b.ImageReference="image",b.ImageAttachment="imageAttachment",b.Url="url",b.Markdown="markdown",b.Html="html",b.Embed="embed",b.Reference="reference",b.Attachment="attachment",b.Slider="slider",b.Scale="scale",b.ProgressBar="progressBar",b.Toggle="toggle",b.CodaInternalRichText="codaInternalRichText",b.SelectList="selectList",b))($e||{});var _t=(n=>(n.Currency="currency",n.Accounting="accounting",n.Financial="financial",n))(_t||{}),jt=(S=>(S.Star="star",S.Circle="circle",S.Fire="fire",S.Bug="bug",S.Diamond="diamond",S.Bell="bell",S.ThumbsUp="thumbsup",S.Heart="heart",S.Chili="chili",S.Smiley="smiley",S.Lightning="lightning",S.Currency="currency",S.Coffee="coffee",S.Person="person",S.Battery="battery",S.Cocktail="cocktail",S.Cloud="cloud",S.Sun="sun",S.Checkmark="checkmark",S.LightBulb="lightbulb",S))(jt||{}),Nt=(n=>(n.IconAndEmail="iconAndEmail",n.IconOnly="iconOnly",n.EmailOnly="emailOnly",n))(Nt||{}),Bt=(a=>(a.IconOnly="iconOnly",a.Url="url",a.Title="title",a.Card="card",a.Embed="embed",a))(Bt||{}),Ut=(r=>(r.Disabled="disabled",r.Solid="solid",r))(Ut||{}),Vt=(r=>(r.Rounded="rounded",r.Square="square",r))(Vt||{}),Lt=(r=>(r.Auto="auto",r.Circle="circle",r))(Lt||{}),Kt=(o=>(o.Days="days",o.Hours="hours",o.Minutes="minutes",o.Seconds="seconds",o))(Kt||{});var Nr="{VALUE}",qt=(r=>(r.Standard="standard",r.Raw="raw",r))(qt||{});var Ht=(n=>(n[n.Text=1]="Text",n[n.Link=2]="Link",n[n.Image=3]="Image",n))(Ht||{});function Br(t){return t}i(Br,"makeAttributionNode");function Ur(t){return!!(t&&t.type==="object")}i(Ur,"isObject");function Ge(t){return!!(t&&t.type==="array")}i(Ge,"isArray");function Gt(t){return!!t?.codaType&&["selectList","reference"].includes(t.codaType)}i(Gt,"unwrappedSchemaSupportsOptions");function he(t){if(!Ge(t))return t;if(!Ge(t.items))return t.items}i(he,"maybeUnwrapArraySchema");function We(t){if(Array.isArray(t)){if(t.length===0)throw new Error("Must have representative value.");return{type:"array",items:We(t[0])}}if(typeof t=="object"){let e={};if(t===null)return{type:"string"};for(let r in t)t.hasOwnProperty(r)&&(e[r]=We(t[r]));return{type:"object",properties:e}}else{if(typeof t=="string")return{type:"string"};if(typeof t=="boolean")return{type:"boolean"};if(typeof t=="number")return{type:"number"}}return ue(t)}i(We,"generateSchema");function Vr(t){return t}i(Vr,"makeSchema");function re(t){let e={...t,type:"object"};for(let r of Object.keys(e.properties))if(r!=="type"){let n=r,a=he(e.properties[r])?.options,s=typeof a=="function"?a:void 0;if(e.properties[n]=X(e.properties[r]),s){let p=he(e.properties[n]);j(p,"deepCopy() broke maybeUnwrapArraySchema?..."),p.options=s}}return Lr(e),e}i(re,"makeObjectSchema");function Lr(t){if(t.codaType==="reference"){let{id:e,identity:r,primary:n}=de(t);He(e,"idProperty",t.codaType),He(r,"identity",t.codaType),He(n,"displayProperty",t.codaType),It(j(e),t,"idProperty"),It(j(n),t,"displayProperty")}if(t.codaType==="person"){let{id:e}=de(t);He(e,"idProperty",t.codaType),It(j(e),t,"idProperty")}for(let[e,r]of Object.entries(t.properties))r.type==="object"&&Lr(r)}i(Lr,"validateObjectSchema");function He(t,e,r){j(t,`Objects with codaType "${r}" require a "${e}" property in the schema definition.`)}i(He,"checkRequiredFieldInObjectSchema");function It(t,e,r){let{properties:n,codaType:o}=e;Z(n[t],`${r} set to undefined field "${t}"`),Z(n[t].required,`Field "${t}" must be marked as required in schema with codaType "${o}".`)}i(It,"checkSchemaPropertyIsRequired");function H(t){return(0,jr.default)(t).replace(/:/g,"_")}i(H,"normalizeSchemaKey");function _r(t,e){return e.hasOwnProperty(H(t))?H(t):t.split(".").map(r=>{let n=r,o="";return r.includes("[")&&(n=r.substring(0,r.indexOf("[")),o=r.substring(r.indexOf("["))),H(n)+o}).join(".")}i(_r,"normalizeSchemaKeyPath");function M(t,e){if(typeof t=="string")return _r(t,e);let{label:r,property:n,placeholder:o,...a}=t;return{property:_r(n,e),label:r,placeholder:o}}i(M,"normalizeSchemaPropertyIdentifier");function xo(t,e){if(typeof t=="object"&&"strategy"in t){let{property:r,strategy:n,...o}=t;return{property:M(r,e),strategy:n}}return M(t,e)}i(xo,"normalizeIndexProperty");function go(t,e){let{properties:r,contextProperties:n,popularityRankProperty:o,...a}=t;return{properties:r.map(s=>xo(s,e)),contextProperties:n?n.map(s=>M(s,e)):void 0,popularityRankProperty:o?M(o,e):void 0}}i(go,"normalizeIndexDefinition");function ne(t){return Ge(t)?{...t,type:"array",items:ne(t.items)}:Ur(t)?So(t):{...t}}i(ne,"normalizeSchema");function So(t){let e={},{attribution:r,options:n,requireForUpdates:o,codaType:a,description:s,displayProperty:p,featured:m,featuredProperties:y,id:u,identity:c,idProperty:l,parentIdProperty:T,imageProperty:P,includeUnknownProperties:F,linkProperty:x,primary:d,properties:v,snippetProperty:f,subtitleProperties:S,titleProperty:A,type:b,__packId:_,createdAtProperty:h,createdByProperty:k,modifiedAtProperty:K,modifiedByProperty:U,userEmailProperty:w,userIdProperty:R,groupIdProperty:E,memberGroupIdProperty:g,bodyTextProperty:C,popularityRankProperty:q,versionProperty:te,index:ye,...Dt}=t;for(let W of Object.keys(v)){let ve=H(W),$=v[W],{displayName:Be,fixedId:to,fromKey:ro,mutable:no,originalKey:ao,required:oo}=$;if(ao)throw new Error("Original key is only for internal use.");let io={displayName:Be,fixedId:to,fromKey:ro||(ve!==W?W:void 0),mutable:no,originalKey:W,required:oo};e[ve]=Object.assign(ne($),io)}return{attribution:r,options:n,requireForUpdates:o,codaType:a,description:s,displayProperty:p?H(p):void 0,featured:m?m.map(H):void 0,featuredProperties:y?y.map(H):void 0,id:u?H(u):void 0,identity:c,idProperty:l?H(l):void 0,parentIdProperty:T?H(T):void 0,imageProperty:P?M(P,e):void 0,includeUnknownProperties:F,linkProperty:x?M(x,e):void 0,primary:d?H(d):void 0,properties:e,snippetProperty:f?M(f,e):void 0,subtitleProperties:S?S.map(W=>M(W,e)):void 0,titleProperty:A?M(A,e):void 0,createdAtProperty:h?M(h,e):void 0,createdByProperty:k?M(k,e):void 0,modifiedAtProperty:K?M(K,e):void 0,modifiedByProperty:U?M(U,e):void 0,userEmailProperty:w?M(w,e):void 0,userIdProperty:R?M(R,e):void 0,groupIdProperty:E?M(E,e):void 0,memberGroupIdProperty:g?M(g,e):void 0,bodyTextProperty:C?M(C,e):void 0,popularityRankProperty:q?M(q,e):void 0,versionProperty:te?M(te,e):void 0,index:ye?go(ye,e):void 0,type:"object"}}i(So,"normalizeObjectSchema");function Kr(t,e){let{type:r,id:n,primary:o,identity:a,properties:s,options:p,requireForUpdates:m}=de(t),{mutable:y}=t;j(a||e,"Source schema must have an identity field, or you must provide an identity name for the reference.");let u=j(n),c={[u]:s[u]};o&&o!==n&&(j(s[o],`Display property "${o}" must refer to a valid property schema.`),c[o]=s[o]);let l={codaType:"reference",displayProperty:o,identity:a||{name:j(e)},idProperty:n,mutable:y,options:p,properties:c,type:r,requireForUpdates:m};return re(l)}i(Kr,"makeReferenceSchemaFromObjectSchema");function qr(t,e){return re({...X(t),identity:{name:le(e)}})}i(qr,"withIdentity");var Wa=Ue(Hr());var yt=Ue(ka()),Sr=Ue(Ka());function ut(t,e){if(!e)return t;let r=(0,Sr.default)(t),n=Object.assign({},yt.default.parse(r.query,{ignoreQueryPrefix:!0}),e);return r.set("query",yt.default.stringify(JSON.parse(JSON.stringify(n)),{addQueryPrefix:!0})),r.toString()}i(ut,"withQueryParams");function qa(t){let e=(0,Sr.default)(t);return yt.default.parse(e.query,{ignoreQueryPrefix:!0})}i(qa,"getQueryParams");function Ha(...t){if(!t||!t.length)return"";let e=[];for(let n of t)le(n),e.length===0?e.push(n):e.push(n.replace(/^\/+/,"")),n.endsWith("/")||e.push("/");let r=e.join("");return t[t.length-1].endsWith("/")?r:r.slice(0,r.length-1)}i(Ha,"join");function Es(t,e,r){let n={};return t.forEach(o=>{let a=e[o];if(typeof a>"u"){if(r&&r.has(o))return;a=""}n[o]=a}),n}i(Es,"generateParamMap");function Ga(t,e,r){let n={};return t.forEach(o=>{let a=e[o];if(typeof a>"u"){if(r&&r.has(o))return;a=""}n[o]=encodeURIComponent(String(a))}),n}i(Ga,"generateQueryParamMap");function Cs(t,e){let r=t;for(let[n,o]of Object.entries(e))r=r.replace(`{${n}}`,o);return r}i(Cs,"formatString");function Pr(t,e){let{url:r,queryParams:n,nameMapping:o,bodyTemplate:a,bodyParams:s,method:p,headers:m,transforms:y}=t,u=new Map,c=new Set,l=new Set;e.forEach((F,x)=>{let d=o&&o[F.name]||F.name;if(c.has(d))throw new Error(`Duplicate name ${d} detected`);c.add(d),F.optional&&l.add(d),u.set(x,d)});let T=!!(n&&n.length),P=!!(s&&s.length);return i(function(x){let d={};x.forEach((A,b)=>{let _=j(u.get(b)),h=y?y[_]:void 0;if(h){let k=h(A);k&&typeof k=="object"?Object.assign(d,k):d[_]=k}else d[_]=A});let v=Cs(r,Ga(Object.keys(d),d)),f=T?ut(v,Ga(j(n),d,l)):v,S;if(a&&(S=(0,Wa.default)(a)),P){let A=Es(j(s),d,l);S=S?{...S,...A}:A}return{url:f,method:p,headers:{Accept:"application/json","Content-Type":"application/json",...m},body:S?JSON.stringify(S):void 0}},"requestHandler")}i(Pr,"generateRequestHandler");function lt(t){let{projectKey:e}=t;return i(function(n){let{body:o}=n;return typeof o!="object"?o:e?o[e]:o},"objectResponseHandler")}i(lt,"generateObjectResponseHandler");var Or=class Or extends Error{constructor(r,n){super(r);this.isUserVisible=!0;this.internalError=n}};i(Or,"UserVisibleError");var fe=Or,Tt=class Tt extends Error{constructor(r,n,o,a){super(`${r} - ${JSON.stringify(n)}`);this.name="StatusCodeError";this.statusCode=r,this.body=n,this.error=n,this.options=o;let s=a?.body;typeof s=="object"&&(s=JSON.stringify(s)),this.response={...a,body:s}}static isStatusCodeError(r){return"name"in r&&r.name===Tt.name}};i(Tt,"StatusCodeError");var ft=Tt,xt=class xt extends Error{constructor(r){super(r||"Additional permissions are required");this.name="MissingScopesError"}static isMissingScopesError(r){return"name"in r&&r.name===xt.name}};i(xt,"MissingScopesError");var dt=xt;function Qa(t){return"isDynamic"in t}i(Qa,"isDynamicSyncTable");function G(t){return typeof t=="function"?gt(t):t}i(G,"wrapMetadataFunction");function $a(t){return t?.type==="array"?t:{type:"array",items:t}}i($a,"transformToArraySchema");function Ms(t){if(t)return{...t,execute(e,r){let n=t.execute(e,r);return Er(n)?n.then(o=>$a(o)):$a(n)}}}i(Ms,"wrapGetSchema");function ht(t){let{type:e,autocomplete:r,crawlStrategy:n,allowManualInput:o,...a}=t,s=wr[e],p;if(Array.isArray(r)){let u=Dr(r);p=G(u)}else p=G(r);let m;if(n)if(n.parentTable){let{tableName:u,propertyKey:c,inheritPermissions:l}=n.parentTable;m={parentTable:{tableName:u,propertyKey:H(c),inheritPermissions:l}}}else m=n;return Object.freeze({...a,allowManualInput:o!==!1,autocomplete:p,type:s,crawlStrategy:m})}i(ht,"makeParameter");var Ar=(r=>(r.Success="success",r.Error="error",r))(Ar||{});function _e(t){let e;switch(t.resultType){case"string":{let n={...t,codaType:"codaType"in t?t.codaType:void 0,formulaSchema:"schema"in t?t.schema:void 0},{onError:o,resultType:a,codaType:s,formulaSchema:p,...m}=n;Z(s!=="selectList","ValueHintType.SelectList is not supported for formula result types."),e={...m,resultType:0,schema:p||(s?{type:"string",codaType:s}:void 0)};break}case"number":{let n={...t,codaType:"codaType"in t?t.codaType:void 0,formulaSchema:"schema"in t?t.schema:void 0},{onError:o,resultType:a,codaType:s,formulaSchema:p,...m}=n;e={...m,resultType:1,schema:p||(s?{type:"number",codaType:s}:void 0)};break}case"boolean":{let{onError:n,resultType:o,...a}=t;e={...a,resultType:3};break}case"array":{let{onError:n,resultType:o,items:a,...s}=t;e={...s,resultType:2,schema:X(ne({type:"array",items:a}))};break}case"object":{let{onError:n,resultType:o,schema:a,...s}=t;e={...s,resultType:2,schema:X(ne(a))};break}default:return ue(t)}let r=t.onError;if(r){let n=e.execute;e.execute=async function(o,a){try{return await n(o,a)}catch(s){return r(s)}}}return I(e,t.connectionRequirement)}i(_e,"makeFormula");function gt(t,e){return _s({name:"getMetadata",description:"Gets metadata",execute([r,n],o){let a={};try{a=JSON.parse(n||"")}catch{}return t(o,r,a)},parameters:[ht({type:"string",name:"search",description:"Metadata to search for.",optional:!0}),ht({type:"string",name:"formulaContext",description:"Serialized JSON for metadata.",optional:!0})],examples:[],connectionRequirement:e?.connectionRequirement||"optional"})}i(gt,"makeMetadataFormula");function St({execute:t,schema:e,name:r}){if(!(t instanceof Function))throw new Error("Value for execute must be a function");let n=t,o=i(async([],p)=>n(p),"innerExecute"),a={connectionRequirement:"optional",execute:o,name:r,description:`A property options function for ${r}`,parameters:[],resultType:"array",items:e};return _e(a)}i(St,"makePropertyOptionsFormula");function br(t,e){let r=(t||"").toLowerCase(),n=e.filter(a=>(typeof a=="string"||typeof a=="number"?a:a.display).toString().toLowerCase().includes(r)),o=[];for(let a of n)typeof a=="string"?o.push({value:a,display:a}):typeof a=="number"?o.push({value:a,display:a.toString()}):o.push(a);return Promise.resolve(o)}i(br,"simpleAutocomplete");async function Ja(t,e,r,n){if(typeof t!="string")throw new TypeError(`Expecting a string for "search" parameter but received ${t}`);let o=t.toLowerCase(),a=[];for(let s of e){let p=s[r];if(!p.toLowerCase().includes(o))continue;let m=s[n];a.push({display:p,value:m})}return a}i(Ja,"autocompleteSearchObjects");function Dr(t){return gt((e,r)=>br(r,t),{connectionRequirement:"optional"})}i(Dr,"makeSimpleAutocompleteMetadataFormula");function za(t){return t&&t.schema}i(za,"isResponseHandlerTemplate");function Is(t){return t&&t.example}i(Is,"isResponseExampleTemplate");function _s({response:t,...e}){let r;if(t)if(za(t)&&t.schema){let o=X(t.schema);t.schema=ne(o),r=t.schema}else Is(t);let n=e.execute;if(za(t)){let{onError:o}=t,a=n,s=lt(t);n=i(async function(m,y){let u;try{u=await a(m,y)}catch(c){if(o)u=o(c);else throw c}return s({body:u||{},status:200,headers:{}})},"exec")}return Object.assign({},e,{resultType:2,execute:n,schema:r})}i(_s,"makeObjectFormula");function je({name:t,description:e,identityName:r,schema:n,formula:o,connectionRequirement:a,dynamicOptions:s={},role:p}){let{getSchema:m,entityName:y,defaultAddDynamicColumns:u}=s,{execute:c,executeUpdate:l,executeGetPermissions:T,onError:P,...F}=I(o,a),x=X(n);if(!r)throw new Error("Sync table schemas must set an identityName");if(x.identity){if(x.identity.name&&x.identity.name!==r)throw new Error(`Identity name mismatch for sync table ${t}. Either remove the schema's identity.name (${x.identity.name}) or ensure it matches the table's identityName (${r}).`);x.identity={...x.identity,name:r}}else x.identity={name:r};if(p==="users"){if(!x.userEmailProperty)throw new Error("Sync table schemas with role users must set a userEmailProperty");if(!x.userIdProperty)throw new Error("Sync table schemas with role users must set a userIdProperty")}if(p==="groupMembers"){if(!x.groupIdProperty)throw new Error("Sync table schemas with role groupMembers must set a groupIdProperty");if(!x.userIdProperty&&!x.memberGroupIdProperty)throw new Error("Sync table schemas with role groupMembers must set a userIdProperty or memberGroupIdProperty")}let d=Ms(G(m)),v=re(x),f=Ns({inputSchema:n,schema:v,identityName:r});s.propertyOptions&&(f??(f={}),f.__coda_dynamic__=St({execute:s.propertyOptions,schema:re({properties:{}}),name:`${r}.DynamicPropertyOptions`}));let S=ne(v),A=d?void 0:{type:"array",items:S},{identity:b,id:_,primary:h}=de(v);if(!(h&&_))throw new Error("Sync table schemas should have defined properties for idProperty and displayProperty");if(!b)throw new Error("Unknown error creating sync table identity");if(t.includes(" "))throw new Error("Sync table name should not include spaces");let k=lt({schema:A}),K=i(async function(R,E){let g;try{g=await c(R,E)||{}}catch(Be){throw P?.(Be),Be}let C=E.sync.schema,q=k({body:g.result||[],status:200,headers:{}},C),{continuation:te,completion:ye,deletedItemIds:Dt,deletedRowIds:W,deletionPredicate:ve}=g,$={result:q};return te&&($.continuation=te),ye&&($.completion=ye),(W??Dt)&&($.deletedRowIds=W??Dt,$.deletedItemIds=$.deletedRowIds),ve&&($.deletionPredicate=ve),$},"exec"),U=l?i(async function(R,E,g){let{result:C}=await l(R,E,g)||{},q=g.sync.schema;return{result:k({body:C||[],status:200,headers:{}},q)}},"execUpdate"):void 0;return{name:t,description:e,schema:S,identityName:r,getter:{...F,cacheTtlSecs:0,execute:K,executeUpdate:U,schema:A,isSyncFormula:!0,supportsUpdates:!!U,supportsGetPermissions:!!T,connectionRequirement:F.connectionRequirement||a,resultType:2,executeGetPermissions:T},getSchema:I(d,a),entityName:y,defaultAddDynamicColumns:u,namedPropertyOptions:At(f,a),role:p}}i(je,"makeSyncTable");function Pt({name:t,description:e,getName:r,getSchema:n,identityName:o,getDisplayUrl:a,formula:s,listDynamicUrls:p,searchDynamicUrls:m,entityName:y,connectionRequirement:u,defaultAddDynamicColumns:c,placeholderSchema:l,propertyOptions:T}){let P=l||re({type:"object",idProperty:"id",displayProperty:"id",identity:{name:o},properties:{id:{type:"string"}}}),F=G(r),x=G(n),d=G(a),v=G(p),f=G(m);return{...je({name:t,description:e,identityName:o,schema:P,formula:s,connectionRequirement:u,dynamicOptions:{getSchema:x,entityName:y,defaultAddDynamicColumns:c,propertyOptions:T}}),isDynamic:!0,getDisplayUrl:I(d,u),listDynamicUrls:I(v,u),searchDynamicUrls:I(f,u),getName:I(F,u)}}i(Pt,"makeDynamicSyncTable");function Ya({response:t,...e}){let{request:r,...n}=e,{parameters:o}=n;t.schema=t.schema?ne(t.schema):void 0;let{onError:a}=t,s=Pr(r,o),p=lt(t);function m(y,u){return u.fetcher.fetch(s(y)).catch(c=>{throw a?.(c),c}).then(p)}return i(m,"execute"),Object.assign({},n,{execute:m,resultType:2,schema:t.schema})}i(Ya,"makeTranslateObjectFormula");function Za(t){let{request:e,...r}=t,{parameters:n}=r,o=Pr(e,n);function a(s,p){return p.fetcher.fetch(o(s)).then(()=>"")}return i(a,"execute"),Object.assign({},r,{execute:a,resultType:0})}i(Za,"makeEmptyFormula");function At(t,e){if(!t)return t;let r={};for(let n of Object.keys(t))r[n]=I(t[n],e);return r}i(At,"maybeRewriteConnectionForNamedPropertyOptions");function I(t,e){return t&&e?{...t,parameters:t.parameters.map(r=>({...r,autocomplete:r.autocomplete?I(r.autocomplete,e):void 0})),varargParameters:t.varargParameters?.map(r=>({...r,autocomplete:r.autocomplete?I(r.autocomplete,e):void 0})),connectionRequirement:e}:t}i(I,"maybeRewriteConnectionForFormula");function js(t){let e=[];for(let r of Object.keys(t.properties)){let n=he(t.properties[r]);if(!n||!("options"in n))continue;let{options:o}=n;o&&typeof o=="function"&&e.push(r)}return e}i(js,"listPropertiesWithOptionsFunctions");function Ns({inputSchema:t,schema:e,identityName:r}){let n={},o=js(t);if(o.length){for(let a of o){let s=he(t.properties[a]),p=he(e.properties[a]);Z(Gt(s),`Property "${a}" must have codaType of ValueHintType.SelectList or ValueHintType.Reference to configure property options`),Z(Gt(p),`Property "${a}" lost codaType on deep copy?...`),p.options=a,n[a]=St({execute:s.options,schema:e.properties[a],name:`${r}.${a}.Options`})}return n}}i(Ns,"moveJsPropertyOptionsFunctionsToFormulas");function Xa(t){return new Ne(t)}i(Xa,"newPack");var vr=class vr{constructor(e){let{formulas:r,formats:n,syncTables:o,networkDomains:a,defaultAuthentication:s,systemConnectionAuthentication:p,version:m,formulaNamespace:y}=e||{};this.formulas=r||[],this.formats=n||[],this.syncTables=o||[],this.networkDomains=a||[],this.defaultAuthentication=s,this.systemConnectionAuthentication=p,this.version=m,this.formulaNamespace=y||"Deprecated"}addFormula(e){let r=_e({...e,connectionRequirement:e.connectionRequirement||this._defaultConnectionRequirement});return this.formulas.push(r),this}addSyncTable(e){let r=e.connectionRequirement||this._defaultConnectionRequirement,n=je({...e,connectionRequirement:r});return this.syncTables.push(n),this}addDynamicSyncTable(e){let r=Pt({...e,connectionRequirement:e.connectionRequirement||this._defaultConnectionRequirement});return this.syncTables.push(r),this}addColumnFormat(e){return this.formats.push(e),this}_wrapAuthenticationFunctions(e){let{getConnectionName:r,getConnectionUserId:n,postSetup:o,...a}=e,s=G(r),p=G(n),m=o?.map(y=>{let u=G(Cr(y).getOptions),c=G(y.getOptionsFormula);return{...y,getOptions:u,getOptionsFormula:c}});return{...a,getConnectionName:s,getConnectionUserId:p,postSetup:m}}setUserAuthentication(e){let{defaultConnectionRequirement:r="required",...n}=e;return n.type==="None"||n.type==="Various"?this.defaultAuthentication=n:this.defaultAuthentication=this._wrapAuthenticationFunctions(n),n.type!=="None"&&this._setDefaultConnectionRequirement(r),this}setSystemAuthentication(e){return this.systemConnectionAuthentication=this._wrapAuthenticationFunctions(e),this}addAdminAuthentication(e){return this.adminAuthentications||(this.adminAuthentications=[]),this.adminAuthentications.push({...e,authentication:this._wrapAuthenticationFunctions(e.authentication)}),this}addNetworkDomain(...e){return this.networkDomains.push(...e),this}setVersion(e){return this.version=e,this}_setDefaultConnectionRequirement(e){return this._defaultConnectionRequirement=e,this.formulas=this.formulas.map(r=>r.connectionRequirement?r:I(r,e)),this.syncTables=this.syncTables.map(r=>r.getter.connectionRequirement?r:Qa(r)?{...r,getter:I(r.getter,e),getName:I(r.getName,e),getDisplayUrl:I(r.getDisplayUrl,e),getSchema:I(r.getSchema,e),listDynamicUrls:I(r.listDynamicUrls,e),searchDynamicUrls:I(r.searchDynamicUrls,e),namedPropertyOptions:At(r.namedPropertyOptions,e)}:{...r,getter:I(r.getter,e),getSchema:I(r.getSchema,e),namedPropertyOptions:At(r.namedPropertyOptions,e)}),this}};i(vr,"PackDefinitionBuilder");var Ne=vr;function eo(t){if(t.type==="array"&&(t=t.items),t.type==="object")return[...new Set(Object.entries(t.properties).map(([e,r])=>r.fromKey||e))]}i(eo,"getEffectivePropertyKeysFromSchema");var bt;(n=>(n.DarkModeFragmentId="DarkMode",n.DataUrlPrefix="data:image/svg+xml;base64,",n.DataUrlPrefixWithDarkModeSupport="data:image/svg+xml;supportsDarkMode=1;base64,"))(bt||(bt={})); /*! Bundled license information: pascalcase/index.js: diff --git a/dist/helpers/migration.d.ts b/dist/helpers/migration.d.ts index 41244e143..aca54540b 100644 --- a/dist/helpers/migration.d.ts +++ b/dist/helpers/migration.d.ts @@ -20,6 +20,7 @@ declare class ObjectSchemaHelper | undefined; } export declare function paramDefHelper>(def: T): ParamDefHelper; declare class ParamDefHelper> { diff --git a/dist/helpers/migration.js b/dist/helpers/migration.js index 1b07ded26..9bbc6a4b8 100644 --- a/dist/helpers/migration.js +++ b/dist/helpers/migration.js @@ -59,6 +59,10 @@ class ObjectSchemaHelper { get requireForUpdates() { return this._schema.requireForUpdates; } + get titleProperty() { + var _a; + return (_a = this._schema.titleProperty) !== null && _a !== void 0 ? _a : this._schema.displayProperty; + } } function paramDefHelper(def) { return new ParamDefHelper(def); diff --git a/helpers/migration.ts b/helpers/migration.ts index d080c0707..571827973 100644 --- a/helpers/migration.ts +++ b/helpers/migration.ts @@ -109,6 +109,10 @@ class ObjectSchemaHelper> { get requireForUpdates() { return this._schema.requireForUpdates; } + + get titleProperty() { + return this._schema.titleProperty ?? this._schema.displayProperty; + } } export function paramDefHelper>(def: T): ParamDefHelper { diff --git a/package.json b/package.json index aa46dcd64..98b1b2a97 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@codahq/packs-sdk", - "version": "1.8.6", + "version": "1.8.7-prerelease.1", "license": "MIT", "workspaces": [ "dev/eslint" diff --git a/schema.ts b/schema.ts index f734a00f9..4928ab21a 100644 --- a/schema.ts +++ b/schema.ts @@ -1383,7 +1383,7 @@ export interface ObjectSchemaDefinition * TODO(ebo): Unhide this * @hidden */ - versionProperty? : PropertyIdentifier; + versionProperty?: PropertyIdentifier; // TODO(dweitzman): Only support options in the typing when the codaType is ValueHintType.SelectList. } diff --git a/test/upload_validation_test.ts b/test/upload_validation_test.ts index 042d5ad43..0c08682a5 100644 --- a/test/upload_validation_test.ts +++ b/test/upload_validation_test.ts @@ -1935,7 +1935,7 @@ describe('Pack metadata Validation', async () => { return {result: []}; }, parameters: [], - allowedAuthenticationNames: [ReservedAuthenticationNames.System] + allowedAuthenticationNames: [ReservedAuthenticationNames.System], }, }); const syncTable4 = makeSyncTable({ @@ -1956,11 +1956,10 @@ describe('Pack metadata Validation', async () => { return {result: []}; }, parameters: [], - allowedAuthenticationNames: [ReservedAuthenticationNames.Default] + allowedAuthenticationNames: [ReservedAuthenticationNames.Default], }, }); - let metadata = createFakePack({ syncTables: [syncTable1, syncTable2, syncTable3, syncTable4], }); @@ -1994,10 +1993,10 @@ describe('Pack metadata Validation', async () => { return {result: []}; }, parameters: [], - allowedAuthenticationNames: [ReservedAuthenticationNames.Default, ReservedAuthenticationNames.System] + allowedAuthenticationNames: [ReservedAuthenticationNames.Default, ReservedAuthenticationNames.System], }, }); - metadata = createFakePack({ + metadata = createFakePack({ syncTables: [syncTable1, syncTable2, syncTable3, syncTable4, syncTable5], }); err = await validateJsonAndAssertFails(metadata); @@ -2007,12 +2006,14 @@ describe('Pack metadata Validation', async () => { path: 'syncTables', }, { - message: 'Identity "IdentityAdminAuth" is used by multiple sync tables with non-distinct allowedAuthenticationNames: defaultUserAuthentication', - path: 'syncTables' + message: + 'Identity "IdentityAdminAuth" is used by multiple sync tables with non-distinct allowedAuthenticationNames: defaultUserAuthentication', + path: 'syncTables', }, { - message: 'Identity "IdentityAdminAuth" is used by multiple sync tables with non-distinct allowedAuthenticationNames: systemAuthentication', - path: 'syncTables' + message: + 'Identity "IdentityAdminAuth" is used by multiple sync tables with non-distinct allowedAuthenticationNames: systemAuthentication', + path: 'syncTables', }, { message: 'Sync table formula names must be unique. Found duplicate name "SyncTable".', @@ -2061,7 +2062,7 @@ describe('Pack metadata Validation', async () => { }, parameters: [], // This will still be considered a duplicate because table 1 implicitly allows all auths. - allowedAuthenticationNames: [ReservedAuthenticationNames.Default] + allowedAuthenticationNames: [ReservedAuthenticationNames.Default], }, }); @@ -2071,7 +2072,8 @@ describe('Pack metadata Validation', async () => { const err = await validateJsonAndAssertFails(metadata); assert.deepEqual(err.validationErrors, [ { - message: 'Identity "Identity" is used by multiple sync tables with non-distinct allowedAuthenticationNames: defaultUserAuthentication', + message: + 'Identity "Identity" is used by multiple sync tables with non-distinct allowedAuthenticationNames: defaultUserAuthentication', path: 'syncTables', }, {