@optiaxiom/proteus 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/_virtual/_openai-shim-script.js +3 -2
- package/dist/esm/assets/src/proteus-chart/{ProteusChart.css.ts.vanilla-BeRNNwBj.css → ProteusChart.css.ts.vanilla-yGx8JdKz.css} +2 -2
- package/dist/esm/assets/src/proteus-chart/{ProteusChartTooltipContent.css.ts.vanilla-Df_IhL_i.css → ProteusChartTooltipContent.css.ts.vanilla-HapBe2oo.css} +2 -2
- package/dist/esm/assets/src/proteus-document/{ProteusDocumentShell.css.ts.vanilla-CyMtrn1n.css → ProteusDocumentShell.css.ts.vanilla-BPytQ9pT.css} +2 -2
- package/dist/esm/assets/src/proteus-image-carousel/{ProteusImageCarousel.css.ts.vanilla-Dbf7yRF1.css → ProteusImageCarousel.css.ts.vanilla-DnlXoyv1.css} +2 -2
- package/dist/esm/assets/src/proteus-question/{ProteusQuestion.css.ts.vanilla-cmHZWqNR.css → ProteusQuestion.css.ts.vanilla-CpDgoW0l.css} +2 -2
- package/dist/esm/hooks/useEffectEvent.js +11 -10
- package/dist/esm/hooks/useObserveValue.js +24 -30
- package/dist/esm/icons/IconAngleLeft.js +13 -19
- package/dist/esm/icons/IconAngleRight.js +13 -19
- package/dist/esm/icons/IconX.js +10 -18
- package/dist/esm/icons/withIcon.js +17 -28
- package/dist/esm/index.js +22 -17
- package/dist/esm/proteus-action/ProteusAction.js +44 -39
- package/dist/esm/proteus-bridge/ProteusBridge.js +71 -85
- package/dist/esm/proteus-card-link/ProteusCardLink.js +24 -37
- package/dist/esm/proteus-chart/ProteusChart-css.js +14 -5
- package/dist/esm/proteus-chart/ProteusChart.js +86 -84
- package/dist/esm/proteus-chart/ProteusChartContext.js +3 -3
- package/dist/esm/proteus-chart/ProteusChartTooltipContent-css.js +23 -6
- package/dist/esm/proteus-chart/ProteusChartTooltipContent.js +52 -66
- package/dist/esm/proteus-data-table/ProteusDataTable.js +28 -29
- package/dist/esm/proteus-date-input/ProteusDateInput.js +23 -0
- package/dist/esm/proteus-document/ProteusDocumentContext.js +4 -3
- package/dist/esm/proteus-document/ProteusDocumentPathContext.js +6 -5
- package/dist/esm/proteus-document/ProteusDocumentRenderer.js +25 -33
- package/dist/esm/proteus-document/ProteusDocumentShell-css.js +32 -6
- package/dist/esm/proteus-document/ProteusDocumentShell.js +226 -219
- package/dist/esm/proteus-document/getProteusValue.js +28 -42
- package/dist/esm/proteus-document/resolveProteusProp.js +31 -49
- package/dist/esm/proteus-document/resolveProteusValue.js +73 -136
- package/dist/esm/proteus-document/schemas.js +42 -45
- package/dist/esm/proteus-document/useResolveProteusValues.js +10 -16
- package/dist/esm/proteus-element/ProteusElement.js +114 -180
- package/dist/esm/proteus-federated/ProteusFederated.js +51 -52
- package/dist/esm/proteus-file-icon/ProteusFileIcon.js +29 -38
- package/dist/esm/proteus-file-upload/ProteusFileUpload.js +107 -133
- package/dist/esm/proteus-image/ProteusImage.js +99 -106
- package/dist/esm/proteus-image/downloadFile.js +3 -2
- package/dist/esm/proteus-image-carousel/ProteusImageCarousel-css.js +49 -11
- package/dist/esm/proteus-image-carousel/ProteusImageCarousel.js +151 -163
- package/dist/esm/proteus-input/ProteusInput.js +19 -27
- package/dist/esm/proteus-length/ProteusLength.js +10 -0
- package/dist/esm/proteus-map/ProteusMap.js +18 -31
- package/dist/esm/proteus-map-index/ProteusMapIndex.js +11 -0
- package/dist/esm/proteus-pill-menu/ProteusPillMenu.js +65 -0
- package/dist/esm/proteus-pill-menu/useInputValueChangeInteraction.js +36 -0
- package/dist/esm/proteus-question/ProteusQuestion-css.js +40 -8
- package/dist/esm/proteus-question/ProteusQuestion.js +324 -400
- package/dist/esm/proteus-select/ProteusSelect.js +25 -40
- package/dist/esm/proteus-show/ProteusShow.js +10 -18
- package/dist/esm/proteus-switch/ProteusSwitch.js +33 -36
- package/dist/esm/proteus-textarea/ProteusTextarea.js +18 -27
- package/dist/esm/proteus-value/ProteusValue.js +4 -4
- package/dist/esm/schema/public-schema.js +4537 -0
- package/dist/esm/schema/runtime-schema.js +4460 -0
- package/dist/esm/spec.js +5 -1
- package/dist/esm/use-proteus-value/useProteusValue.js +8 -12
- package/dist/index.d.ts +516 -347
- package/dist/spec.d.ts +5 -9952
- package/package.json +4 -4
- package/dist/esm/icons/IconCalendar.js +0 -20
- package/dist/esm/schema/public-schema.json.js +0 -9026
- package/dist/esm/schema/runtime-schema.json.js +0 -8959
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region \0openai-shim-script
|
|
1
2
|
const OPENAI_SHIM_SCRIPT = `<script>"use strict";(()=>{var Yl=Object.defineProperty;var kf=(e,r,n)=>r in e?Yl(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n;var qe=(e,r)=>{for(var n in r)Yl(e,n,{get:r[n],enumerable:!0})};var X=(e,r,n)=>(kf(e,typeof r!="symbol"?r+"":r,n),n);var l={};qe(l,{\$brand:()=>Cr,\$input:()=>Ji,\$output:()=>qi,NEVER:()=>uo,TimePrecision:()=>Ki,ZodAny:()=>Lu,ZodArray:()=>Ju,ZodBase64:()=>Ya,ZodBase64URL:()=>es,ZodBigInt:()=>hr,ZodBigIntFormat:()=>ns,ZodBoolean:()=>gr,ZodCIDRv4:()=>Xa,ZodCIDRv6:()=>Qa,ZodCUID:()=>qa,ZodCUID2:()=>Ja,ZodCatch:()=>dl,ZodCodec:()=>us,ZodCustom:()=>Cn,ZodCustomStringFormat:()=>mr,ZodDate:()=>Nn,ZodDefault:()=>il,ZodDiscriminatedUnion:()=>Bu,ZodE164:()=>ts,ZodEmail:()=>La,ZodEmoji:()=>Fa,ZodEnum:()=>dr,ZodError:()=>Rh,ZodExactOptional:()=>rl,ZodFile:()=>el,ZodFirstPartyTypeKind:()=>kl,ZodFunction:()=>xl,ZodGUID:()=>Pn,ZodIPv4:()=>Ka,ZodIPv6:()=>Ga,ZodISODate:()=>Ea,ZodISODateTime:()=>Ua,ZodISODuration:()=>Aa,ZodISOTime:()=>Ra,ZodIntersection:()=>Wu,ZodIssueCode:()=>Ch,ZodJWT:()=>rs,ZodKSUID:()=>Wa,ZodLazy:()=>vl,ZodLiteral:()=>Yu,ZodMAC:()=>Ru,ZodMap:()=>Xu,ZodNaN:()=>ml,ZodNanoID:()=>Va,ZodNever:()=>Vu,ZodNonOptional:()=>ss,ZodNull:()=>Mu,ZodNullable:()=>ol,ZodNumber:()=>fr,ZodNumberFormat:()=>Et,ZodObject:()=>Un,ZodOptional:()=>as,ZodPipe:()=>cs,ZodPrefault:()=>sl,ZodPromise:()=>_l,ZodReadonly:()=>fl,ZodRealError:()=>\$e,ZodRecord:()=>An,ZodSet:()=>Qu,ZodString:()=>pr,ZodStringFormat:()=>B,ZodSuccess:()=>ll,ZodSymbol:()=>Au,ZodTemplateLiteral:()=>hl,ZodTransform:()=>tl,ZodTuple:()=>Ku,ZodType:()=>O,ZodULID:()=>Ha,ZodURL:()=>On,ZodUUID:()=>Fe,ZodUndefined:()=>Cu,ZodUnion:()=>En,ZodUnknown:()=>Fu,ZodVoid:()=>qu,ZodXID:()=>Ba,ZodXor:()=>Hu,_ZodString:()=>Ma,_default:()=>al,_function:()=>Lm,any:()=>km,array:()=>U,base64:()=>am,base64url:()=>sm,bigint:()=>ym,boolean:()=>te,catch:()=>pl,check:()=>Fm,cidrv4:()=>om,cidrv6:()=>im,clone:()=>se,codec:()=>Am,coerce:()=>zl,config:()=>Y,core:()=>ze,cuid:()=>Gp,cuid2:()=>Xp,custom:()=>ls,date:()=>Sm,decode:()=>ju,decodeAsync:()=>Ou,describe:()=>Vm,discriminatedUnion:()=>Rn,e164:()=>cm,email:()=>Mp,emoji:()=>Wp,encode:()=>Pu,encodeAsync:()=>Zu,endsWith:()=>Pt,enum:()=>le,exactOptional:()=>nl,file:()=>Nm,flattenError:()=>Jt,float32:()=>fm,float64:()=>gm,formatError:()=>Ht,fromJSONSchema:()=>Km,function:()=>Lm,getErrorMap:()=>Lh,globalRegistry:()=>ie,gt:()=>Ue,gte:()=>ce,guid:()=>Lp,hash:()=>mm,hex:()=>pm,hostname:()=>dm,httpUrl:()=>Bp,includes:()=>It,instanceof:()=>Jm,int:()=>Ca,int32:()=>hm,int64:()=>_m,intersection:()=>vr,ipv4:()=>tm,ipv6:()=>nm,iso:()=>pt,json:()=>Bm,jwt:()=>um,keyof:()=>wm,ksuid:()=>em,lazy:()=>yl,length:()=>ct,literal:()=>T,locales:()=>ir,looseObject:()=>ue,looseRecord:()=>jm,lowercase:()=>St,lt:()=>Ne,lte:()=>ge,mac:()=>rm,map:()=>Zm,maxLength:()=>st,maxSize:()=>Be,meta:()=>qm,mime:()=>jt,minLength:()=>Le,minSize:()=>Ee,multipleOf:()=>He,nan:()=>Rm,nanoid:()=>Kp,nativeEnum:()=>Dm,negative:()=>zn,never:()=>os,nonnegative:()=>wn,nonoptional:()=>ul,nonpositive:()=>Sn,normalize:()=>Zt,null:()=>Dn,nullable:()=>jn,nullish:()=>Um,number:()=>M,object:()=>S,optional:()=>G,overwrite:()=>Ie,parse:()=>Su,parseAsync:()=>wu,partialRecord:()=>Pm,pipe:()=>Zn,positive:()=>kn,prefault:()=>cl,preprocess:()=>Mn,prettifyError:()=>go,promise:()=>Mm,property:()=>In,readonly:()=>gl,record:()=>J,refine:()=>bl,regex:()=>zt,regexes:()=>be,registry:()=>tn,safeDecode:()=>Nu,safeDecodeAsync:()=>Eu,safeEncode:()=>Du,safeEncodeAsync:()=>Uu,safeParse:()=>Iu,safeParseAsync:()=>Tu,set:()=>Om,setErrorMap:()=>Mh,size:()=>at,slugify:()=>cr,startsWith:()=>Tt,strictObject:()=>Im,string:()=>g,stringFormat:()=>lm,stringbool:()=>Hm,success:()=>Em,superRefine:()=>\$l,symbol:()=>bm,templateLiteral:()=>Cm,toJSONSchema:()=>lr,toLowerCase:()=>Dt,toUpperCase:()=>Nt,transform:()=>is,treeifyError:()=>fo,trim:()=>Ot,tuple:()=>Gu,uint32:()=>vm,uint64:()=>xm,ulid:()=>Qp,undefined:()=>\$m,union:()=>K,unknown:()=>W,uppercase:()=>wt,url:()=>Hp,util:()=>_,uuid:()=>Fp,uuidv4:()=>Vp,uuidv6:()=>qp,uuidv7:()=>Jp,void:()=>zm,xid:()=>Yp,xor:()=>Tm});var ze={};qe(ze,{\$ZodAny:()=>ui,\$ZodArray:()=>fi,\$ZodAsyncError:()=>De,\$ZodBase64:()=>Yo,\$ZodBase64URL:()=>ei,\$ZodBigInt:()=>Xr,\$ZodBigIntFormat:()=>ii,\$ZodBoolean:()=>tr,\$ZodCIDRv4:()=>Xo,\$ZodCIDRv6:()=>Qo,\$ZodCUID:()=>Co,\$ZodCUID2:()=>Mo,\$ZodCatch:()=>Zi,\$ZodCheck:()=>H,\$ZodCheckBigIntFormat:()=>gc,\$ZodCheckEndsWith:()=>Ic,\$ZodCheckGreaterThan:()=>Io,\$ZodCheckIncludes:()=>Sc,\$ZodCheckLengthEquals:()=>bc,\$ZodCheckLessThan:()=>wo,\$ZodCheckLowerCase:()=>kc,\$ZodCheckMaxLength:()=>_c,\$ZodCheckMaxSize:()=>hc,\$ZodCheckMimeType:()=>Pc,\$ZodCheckMinLength:()=>xc,\$ZodCheckMinSize:()=>vc,\$ZodCheckMultipleOf:()=>mc,\$ZodCheckNumberFormat:()=>fc,\$ZodCheckOverwrite:()=>jc,\$ZodCheckProperty:()=>Tc,\$ZodCheckRegex:()=>\$c,\$ZodCheckSizeEquals:()=>yc,\$ZodCheckStartsWith:()=>wc,\$ZodCheckStringFormat:()=>er,\$ZodCheckUpperCase:()=>zc,\$ZodCodec:()=>nr,\$ZodCustom:()=>Ci,\$ZodCustomStringFormat:()=>ni,\$ZodDate:()=>mi,\$ZodDefault:()=>Ii,\$ZodDiscriminatedUnion:()=>hi,\$ZodE164:()=>ti,\$ZodEmail:()=>Uo,\$ZodEmoji:()=>Ro,\$ZodEncodeError:()=>et,\$ZodEnum:()=>bi,\$ZodError:()=>Hr,\$ZodExactOptional:()=>Si,\$ZodFile:()=>ki,\$ZodFunction:()=>Ei,\$ZodGUID:()=>Do,\$ZodIPv4:()=>Wo,\$ZodIPv6:()=>Ko,\$ZodISODate:()=>Jo,\$ZodISODateTime:()=>qo,\$ZodISODuration:()=>Bo,\$ZodISOTime:()=>Ho,\$ZodIntersection:()=>vi,\$ZodJWT:()=>ri,\$ZodKSUID:()=>Vo,\$ZodLazy:()=>Ai,\$ZodLiteral:()=>\$i,\$ZodMAC:()=>Go,\$ZodMap:()=>_i,\$ZodNaN:()=>Oi,\$ZodNanoID:()=>Ao,\$ZodNever:()=>di,\$ZodNonOptional:()=>Pi,\$ZodNull:()=>ci,\$ZodNullable:()=>wi,\$ZodNumber:()=>Gr,\$ZodNumberFormat:()=>oi,\$ZodObject:()=>Nc,\$ZodObjectJIT:()=>Uc,\$ZodOptional:()=>Yr,\$ZodPipe:()=>Di,\$ZodPrefault:()=>Ti,\$ZodPromise:()=>Ri,\$ZodReadonly:()=>Ni,\$ZodRealError:()=>xe,\$ZodRecord:()=>yi,\$ZodRegistry:()=>Vi,\$ZodSet:()=>xi,\$ZodString:()=>it,\$ZodStringFormat:()=>q,\$ZodSuccess:()=>ji,\$ZodSymbol:()=>ai,\$ZodTemplateLiteral:()=>Ui,\$ZodTransform:()=>zi,\$ZodTuple:()=>Qr,\$ZodType:()=>Z,\$ZodULID:()=>Lo,\$ZodURL:()=>Eo,\$ZodUUID:()=>No,\$ZodUndefined:()=>si,\$ZodUnion:()=>rr,\$ZodUnknown:()=>li,\$ZodVoid:()=>pi,\$ZodXID:()=>Fo,\$ZodXor:()=>gi,\$brand:()=>Cr,\$constructor:()=>p,\$input:()=>Ji,\$output:()=>qi,Doc:()=>Kr,JSONSchema:()=>Ap,JSONSchemaGenerator:()=>Da,NEVER:()=>uo,TimePrecision:()=>Ki,_any:()=>ha,_array:()=>Ec,_base64:()=>_n,_base64url:()=>xn,_bigint:()=>ua,_boolean:()=>sa,_catch:()=>Ph,_check:()=>Rp,_cidrv4:()=>vn,_cidrv6:()=>yn,_coercedBigint:()=>la,_coercedBoolean:()=>ca,_coercedDate:()=>ba,_coercedNumber:()=>ta,_coercedString:()=>Bi,_cuid:()=>ln,_cuid2:()=>dn,_custom:()=>za,_date:()=>xa,_decode:()=>vo,_decodeAsync:()=>_o,_default:()=>wh,_discriminatedUnion:()=>fh,_e164:()=>bn,_email:()=>rn,_emoji:()=>cn,_encode:()=>ho,_encodeAsync:()=>yo,_endsWith:()=>Pt,_enum:()=>xh,_file:()=>ka,_float32:()=>na,_float64:()=>oa,_gt:()=>Ue,_gte:()=>ce,_guid:()=>ar,_includes:()=>It,_int:()=>ra,_int32:()=>ia,_int64:()=>da,_intersection:()=>gh,_ipv4:()=>gn,_ipv6:()=>hn,_isoDate:()=>Xi,_isoDateTime:()=>Gi,_isoDuration:()=>Yi,_isoTime:()=>Qi,_jwt:()=>\$n,_ksuid:()=>fn,_lazy:()=>Dh,_length:()=>ct,_literal:()=>\$h,_lowercase:()=>St,_lt:()=>Ne,_lte:()=>ge,_mac:()=>Wi,_map:()=>yh,_max:()=>ge,_maxLength:()=>st,_maxSize:()=>Be,_mime:()=>jt,_min:()=>ce,_minLength:()=>Le,_minSize:()=>Ee,_multipleOf:()=>He,_nan:()=>\$a,_nanoid:()=>un,_nativeEnum:()=>bh,_negative:()=>zn,_never:()=>ya,_nonnegative:()=>wn,_nonoptional:()=>Ih,_nonpositive:()=>Sn,_normalize:()=>Zt,_null:()=>ga,_nullable:()=>Sh,_number:()=>ea,_optional:()=>zh,_overwrite:()=>Ie,_parse:()=>Bt,_parseAsync:()=>Kt,_pipe:()=>jh,_positive:()=>kn,_promise:()=>Nh,_property:()=>In,_readonly:()=>Zh,_record:()=>vh,_refine:()=>Sa,_regex:()=>zt,_safeDecode:()=>bo,_safeDecodeAsync:()=>ko,_safeEncode:()=>xo,_safeEncodeAsync:()=>\$o,_safeParse:()=>Xt,_safeParseAsync:()=>Qt,_set:()=>_h,_size:()=>at,_slugify:()=>cr,_startsWith:()=>Tt,_string:()=>Hi,_stringFormat:()=>Ut,_stringbool:()=>Pa,_success:()=>Th,_superRefine:()=>wa,_symbol:()=>ma,_templateLiteral:()=>Oh,_toLowerCase:()=>Dt,_toUpperCase:()=>Nt,_transform:()=>kh,_trim:()=>Ot,_tuple:()=>hh,_uint32:()=>aa,_uint64:()=>pa,_ulid:()=>pn,_undefined:()=>fa,_union:()=>ph,_unknown:()=>va,_uppercase:()=>wt,_url:()=>sr,_uuid:()=>nn,_uuidv4:()=>on,_uuidv6:()=>an,_uuidv7:()=>sn,_void:()=>_a,_xid:()=>mn,_xor:()=>mh,clone:()=>se,config:()=>Y,createStandardJSONSchemaMethod:()=>ur,createToJSONSchemaMethod:()=>Rc,decode:()=>pd,decodeAsync:()=>fd,describe:()=>Ia,encode:()=>dd,encodeAsync:()=>md,extractDefs:()=>lt,finalize:()=>dt,flattenError:()=>Jt,formatError:()=>Ht,globalConfig:()=>Ar,globalRegistry:()=>ie,initializeContext:()=>ut,isValidBase64:()=>Dc,isValidBase64URL:()=>Ed,isValidJWT:()=>Rd,locales:()=>ir,meta:()=>Ta,parse:()=>Wt,parseAsync:()=>Gt,prettifyError:()=>go,process:()=>L,regexes:()=>be,registry:()=>tn,safeDecode:()=>hd,safeDecodeAsync:()=>yd,safeEncode:()=>gd,safeEncodeAsync:()=>vd,safeParse:()=>\$t,safeParseAsync:()=>Yt,toDotPath:()=>ld,toJSONSchema:()=>lr,treeifyError:()=>fo,util:()=>_,version:()=>Zc});var uo=Object.freeze({status:"aborted"});function p(e,r,n){function i(s,u){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),r(s,u);let c=a.prototype,d=Object.keys(c);for(let m=0;m<d.length;m++){let h=d[m];h in s||(s[h]=c[h].bind(s))}}let t=n?.Parent??Object;class o extends t{}Object.defineProperty(o,"name",{value:e});function a(s){var u;let c=n?.Parent?new o:this;i(c,s),(u=c._zod).deferred??(u.deferred=[]);for(let d of c._zod.deferred)d();return c}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>n?.Parent&&s instanceof n.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var Cr=Symbol("zod_brand"),De=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},et=class extends Error{constructor(r){super(\`Encountered unidirectional transform during encode: \${r}\`),this.name="ZodEncodeError"}},Ar={};function Y(e){return e&&Object.assign(Ar,e),Ar}var _={};qe(_,{BIGINT_FORMAT_RANGES:()=>As,Class:()=>Zs,NUMBER_FORMAT_RANGES:()=>Rs,aborted:()=>ot,allowsEval:()=>Ns,assert:()=>Tf,assertEqual:()=>zf,assertIs:()=>wf,assertNever:()=>If,assertNotEqual:()=>Sf,assignProp:()=>rt,base64ToUint8Array:()=>sd,base64urlToUint8Array:()=>Cf,cached:()=>Vt,captureStackTrace:()=>po,cleanEnum:()=>Af,cleanRegex:()=>Fr,clone:()=>se,cloneDef:()=>jf,createTransparentProxy:()=>Ef,defineLazy:()=>N,esc:()=>lo,escapeRegex:()=>we,extend:()=>nd,finalizeIssue:()=>_e,floatSafeRemainder:()=>Os,getElementAtPath:()=>Zf,getEnumValues:()=>Lr,getLengthableOrigin:()=>Jr,getParsedType:()=>Uf,getSizableOrigin:()=>qr,hexToUint8Array:()=>Lf,isObject:()=>bt,isPlainObject:()=>nt,issue:()=>qt,joinValues:()=>f,jsonStringifyReplacer:()=>Ft,merge:()=>Rf,mergeDefs:()=>Je,normalizeParams:()=>\$,nullish:()=>tt,numKeys:()=>Nf,objectClone:()=>Pf,omit:()=>rd,optionalKeys:()=>Es,parsedType:()=>b,partial:()=>id,pick:()=>td,prefixIssues:()=>ke,primitiveTypes:()=>Us,promiseAllObject:()=>Of,propertyKeyTypes:()=>Vr,randomString:()=>Df,required:()=>ad,safeExtend:()=>od,shallowClone:()=>mo,slugify:()=>Ds,stringifyPrimitive:()=>v,uint8ArrayToBase64:()=>cd,uint8ArrayToBase64url:()=>Mf,uint8ArrayToHex:()=>Ff,unwrapMessage:()=>Mr});function zf(e){return e}function Sf(e){return e}function wf(e){}function If(e){throw new Error("Unexpected value in exhaustive check")}function Tf(e){}function Lr(e){let r=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,t])=>r.indexOf(+i)===-1).map(([i,t])=>t)}function f(e,r="|"){return e.map(n=>v(n)).join(r)}function Ft(e,r){return typeof r=="bigint"?r.toString():r}function Vt(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function tt(e){return e==null}function Fr(e){let r=e.startsWith("^")?1:0,n=e.endsWith("\$")?e.length-1:e.length;return e.slice(r,n)}function Os(e,r){let n=(e.toString().split(".")[1]||"").length,i=r.toString(),t=(i.split(".")[1]||"").length;if(t===0&&/\\d?e-\\d?/.test(i)){let u=i.match(/\\d?e-(\\d?)/);u?.[1]&&(t=Number.parseInt(u[1]))}let o=n>t?n:t,a=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(r.toFixed(o).replace(".",""));return a%s/10**o}var ed=Symbol("evaluating");function N(e,r,n){let i;Object.defineProperty(e,r,{get(){if(i!==ed)return i===void 0&&(i=ed,i=n()),i},set(t){Object.defineProperty(e,r,{value:t})},configurable:!0})}function Pf(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function rt(e,r,n){Object.defineProperty(e,r,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Je(...e){let r={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(r,i)}return Object.defineProperties({},r)}function jf(e){return Je(e._zod.def)}function Zf(e,r){return r?r.reduce((n,i)=>n?.[i],e):e}function Of(e){let r=Object.keys(e),n=r.map(i=>e[i]);return Promise.all(n).then(i=>{let t={};for(let o=0;o<r.length;o++)t[r[o]]=i[o];return t})}function Df(e=10){let r="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=r[Math.floor(Math.random()*r.length)];return n}function lo(e){return JSON.stringify(e)}function Ds(e){return e.toLowerCase().trim().replace(/[^\\w\\s-]/g,"").replace(/[\\s_-]+/g,"-").replace(/^-+|-+\$/g,"")}var po="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function bt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Ns=Vt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function nt(e){if(bt(e)===!1)return!1;let r=e.constructor;if(r===void 0||typeof r!="function")return!0;let n=r.prototype;return!(bt(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function mo(e){return nt(e)?{...e}:Array.isArray(e)?[...e]:e}function Nf(e){let r=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&r++;return r}var Uf=e=>{let r=typeof e;switch(r){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(\`Unknown data type: \${r}\`)}},Vr=new Set(["string","number","symbol"]),Us=new Set(["string","number","bigint","boolean","symbol","undefined"]);function we(e){return e.replace(/[.*+?^\${}()|[\\]\\\\]/g,"\\\\\$&")}function se(e,r,n){let i=new e._zod.constr(r??e._zod.def);return(!r||n?.parent)&&(i._zod.parent=e),i}function \$(e){let r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both \`message\` and \`error\` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function Ef(e){let r;return new Proxy({},{get(n,i,t){return r??(r=e()),Reflect.get(r,i,t)},set(n,i,t,o){return r??(r=e()),Reflect.set(r,i,t,o)},has(n,i){return r??(r=e()),Reflect.has(r,i)},deleteProperty(n,i){return r??(r=e()),Reflect.deleteProperty(r,i)},ownKeys(n){return r??(r=e()),Reflect.ownKeys(r)},getOwnPropertyDescriptor(n,i){return r??(r=e()),Reflect.getOwnPropertyDescriptor(r,i)},defineProperty(n,i,t){return r??(r=e()),Reflect.defineProperty(r,i,t)}})}function v(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?\`"\${e}"\`:\`\${e}\`}function Es(e){return Object.keys(e).filter(r=>e[r]._zod.optin==="optional"&&e[r]._zod.optout==="optional")}var Rs={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},As={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function td(e,r){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=Je(e._zod.def,{get shape(){let a={};for(let s in r){if(!(s in n.shape))throw new Error(\`Unrecognized key: "\${s}"\`);r[s]&&(a[s]=n.shape[s])}return rt(this,"shape",a),a},checks:[]});return se(e,o)}function rd(e,r){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=Je(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in r){if(!(s in n.shape))throw new Error(\`Unrecognized key: "\${s}"\`);r[s]&&delete a[s]}return rt(this,"shape",a),a},checks:[]});return se(e,o)}function nd(e,r){if(!nt(r))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let o=e._zod.def.shape;for(let a in r)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use \`.safeExtend()\` instead.")}let t=Je(e._zod.def,{get shape(){let o={...e._zod.def.shape,...r};return rt(this,"shape",o),o}});return se(e,t)}function od(e,r){if(!nt(r))throw new Error("Invalid input to safeExtend: expected a plain object");let n=Je(e._zod.def,{get shape(){let i={...e._zod.def.shape,...r};return rt(this,"shape",i),i}});return se(e,n)}function Rf(e,r){let n=Je(e._zod.def,{get shape(){let i={...e._zod.def.shape,...r._zod.def.shape};return rt(this,"shape",i),i},get catchall(){return r._zod.def.catchall},checks:[]});return se(e,n)}function id(e,r,n){let t=r._zod.def.checks;if(t&&t.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=Je(r._zod.def,{get shape(){let s=r._zod.def.shape,u={...s};if(n)for(let c in n){if(!(c in s))throw new Error(\`Unrecognized key: "\${c}"\`);n[c]&&(u[c]=e?new e({type:"optional",innerType:s[c]}):s[c])}else for(let c in s)u[c]=e?new e({type:"optional",innerType:s[c]}):s[c];return rt(this,"shape",u),u},checks:[]});return se(r,a)}function ad(e,r,n){let i=Je(r._zod.def,{get shape(){let t=r._zod.def.shape,o={...t};if(n)for(let a in n){if(!(a in o))throw new Error(\`Unrecognized key: "\${a}"\`);n[a]&&(o[a]=new e({type:"nonoptional",innerType:t[a]}))}else for(let a in t)o[a]=new e({type:"nonoptional",innerType:t[a]});return rt(this,"shape",o),o}});return se(r,i)}function ot(e,r=0){if(e.aborted===!0)return!0;for(let n=r;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ke(e,r){return r.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Mr(e){return typeof e=="string"?e:e?.message}function _e(e,r,n){let i={...e,path:e.path??[]};if(!e.message){let t=Mr(e.inst?._zod.def?.error?.(e))??Mr(r?.error?.(e))??Mr(n.customError?.(e))??Mr(n.localeError?.(e))??"Invalid input";i.message=t}return delete i.inst,delete i.continue,r?.reportInput||delete i.input,i}function qr(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Jr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function b(e){let r=typeof e;switch(r){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return r}function qt(...e){let[r,n,i]=e;return typeof r=="string"?{message:r,code:"custom",input:n,inst:i}:{...r}}function Af(e){return Object.entries(e).filter(([r,n])=>Number.isNaN(Number.parseInt(r,10))).map(r=>r[1])}function sd(e){let r=atob(e),n=new Uint8Array(r.length);for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return n}function cd(e){let r="";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return btoa(r)}function Cf(e){let r=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-r.length%4)%4);return sd(r+n)}function Mf(e){return cd(e).replace(/\\+/g,"-").replace(/\\//g,"_").replace(/=/g,"")}function Lf(e){let r=e.replace(/^0x/,"");if(r.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(r.length/2);for(let i=0;i<r.length;i+=2)n[i/2]=Number.parseInt(r.slice(i,i+2),16);return n}function Ff(e){return Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}var Zs=class{constructor(...r){}};var ud=(e,r)=>{e.name="\$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:r,enumerable:!1}),e.message=JSON.stringify(r,Ft,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Hr=p("\$ZodError",ud),xe=p("\$ZodError",ud,{Parent:Error});function Jt(e,r=n=>n.message){let n={},i=[];for(let t of e.issues)t.path.length>0?(n[t.path[0]]=n[t.path[0]]||[],n[t.path[0]].push(r(t))):i.push(r(t));return{formErrors:i,fieldErrors:n}}function Ht(e,r=n=>n.message){let n={_errors:[]},i=t=>{for(let o of t.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>i({issues:a}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)n._errors.push(r(o));else{let a=n,s=0;for(;s<o.path.length;){let u=o.path[s];s===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(o))):a[u]=a[u]||{_errors:[]},a=a[u],s++}}};return i(e),n}function fo(e,r=n=>n.message){let n={errors:[]},i=(t,o=[])=>{var a,s;for(let u of t.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(c=>i({issues:c},u.path));else if(u.code==="invalid_key")i({issues:u.issues},u.path);else if(u.code==="invalid_element")i({issues:u.issues},u.path);else{let c=[...o,...u.path];if(c.length===0){n.errors.push(r(u));continue}let d=n,m=0;for(;m<c.length;){let h=c[m],y=m===c.length-1;typeof h=="string"?(d.properties??(d.properties={}),(a=d.properties)[h]??(a[h]={errors:[]}),d=d.properties[h]):(d.items??(d.items=[]),(s=d.items)[h]??(s[h]={errors:[]}),d=d.items[h]),y&&d.errors.push(r(u)),m++}}};return i(e),n}function ld(e){let r=[],n=e.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?r.push(\`[\${i}]\`):typeof i=="symbol"?r.push(\`[\${JSON.stringify(String(i))}]\`):/[^\\w\$]/.test(i)?r.push(\`[\${JSON.stringify(i)}]\`):(r.length&&r.push("."),r.push(i));return r.join("")}function go(e){let r=[],n=[...e.issues].sort((i,t)=>(i.path??[]).length-(t.path??[]).length);for(let i of n)r.push(\`\\u2716 \${i.message}\`),i.path?.length&&r.push(\` \\u2192 at \${ld(i.path)}\`);return r.join(\`
|
|
2
3
|
\`)}var Bt=e=>(r,n,i,t)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},a=r._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new De;if(a.issues.length){let s=new(t?.Err??e)(a.issues.map(u=>_e(u,o,Y())));throw po(s,t?.callee),s}return a.value},Wt=Bt(xe),Kt=e=>async(r,n,i,t)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},a=r._zod.run({value:n,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(t?.Err??e)(a.issues.map(u=>_e(u,o,Y())));throw po(s,t?.callee),s}return a.value},Gt=Kt(xe),Xt=e=>(r,n,i)=>{let t=i?{...i,async:!1}:{async:!1},o=r._zod.run({value:n,issues:[]},t);if(o instanceof Promise)throw new De;return o.issues.length?{success:!1,error:new(e??Hr)(o.issues.map(a=>_e(a,t,Y())))}:{success:!0,data:o.value}},\$t=Xt(xe),Qt=e=>async(r,n,i)=>{let t=i?Object.assign(i,{async:!0}):{async:!0},o=r._zod.run({value:n,issues:[]},t);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(a=>_e(a,t,Y())))}:{success:!0,data:o.value}},Yt=Qt(xe),ho=e=>(r,n,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Bt(e)(r,n,t)},dd=ho(xe),vo=e=>(r,n,i)=>Bt(e)(r,n,i),pd=vo(xe),yo=e=>async(r,n,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Kt(e)(r,n,t)},md=yo(xe),_o=e=>async(r,n,i)=>Kt(e)(r,n,i),fd=_o(xe),xo=e=>(r,n,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Xt(e)(r,n,t)},gd=xo(xe),bo=e=>(r,n,i)=>Xt(e)(r,n,i),hd=bo(xe),\$o=e=>async(r,n,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Qt(e)(r,n,t)},vd=\$o(xe),ko=e=>async(r,n,i)=>Qt(e)(r,n,i),yd=ko(xe);var be={};qe(be,{base64:()=>ec,base64url:()=>zo,bigint:()=>ac,boolean:()=>cc,browserEmail:()=>Xf,cidrv4:()=>Qs,cidrv6:()=>Ys,cuid:()=>Cs,cuid2:()=>Ms,date:()=>rc,datetime:()=>oc,domain:()=>eg,duration:()=>Js,e164:()=>tc,email:()=>Bs,emoji:()=>Ws,extendedDuration:()=>qf,guid:()=>Hs,hex:()=>tg,hostname:()=>Yf,html5Email:()=>Wf,idnEmail:()=>Gf,integer:()=>sc,ipv4:()=>Ks,ipv6:()=>Gs,ksuid:()=>Vs,lowercase:()=>dc,mac:()=>Xs,md5_base64:()=>ng,md5_base64url:()=>og,md5_hex:()=>rg,nanoid:()=>qs,null:()=>uc,number:()=>So,rfc5322Email:()=>Kf,sha1_base64:()=>ag,sha1_base64url:()=>sg,sha1_hex:()=>ig,sha256_base64:()=>ug,sha256_base64url:()=>lg,sha256_hex:()=>cg,sha384_base64:()=>pg,sha384_base64url:()=>mg,sha384_hex:()=>dg,sha512_base64:()=>gg,sha512_base64url:()=>hg,sha512_hex:()=>fg,string:()=>ic,time:()=>nc,ulid:()=>Ls,undefined:()=>lc,unicodeEmail:()=>_d,uppercase:()=>pc,uuid:()=>kt,uuid4:()=>Jf,uuid6:()=>Hf,uuid7:()=>Bf,xid:()=>Fs});var Cs=/^[cC][^\\s-]{8,}\$/,Ms=/^[0-9a-z]+\$/,Ls=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}\$/,Fs=/^[0-9a-vA-V]{20}\$/,Vs=/^[A-Za-z0-9]{27}\$/,qs=/^[a-zA-Z0-9_-]{21}\$/,Js=/^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)\$/,qf=/^[-+]?P(?!\$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y\$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M\$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W\$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D\$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H\$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M\$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??\$/,Hs=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\$/,kt=e=>e?new RegExp(\`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-\${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})\$\`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)\$/,Jf=kt(4),Hf=kt(6),Bf=kt(7),Bs=/^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}\$/,Wf=/^[a-zA-Z0-9.!#\$%&'*+/=?^_\`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\$/,Kf=/^(([^<>()\\[\\]\\\\.,;:\\s@"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@"]+)*)|(".+"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))\$/,_d=/^[^\\s@"]{1,64}@[^\\s@]{1,255}\$/u,Gf=_d,Xf=/^[a-zA-Z0-9.!#\$%&'*+/=?^_\`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\$/,Qf="^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+\$";function Ws(){return new RegExp(Qf,"u")}var Ks=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\$/,Gs=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\$/,Xs=e=>{let r=we(e??":");return new RegExp(\`^(?:[0-9A-F]{2}\${r}){5}[0-9A-F]{2}\$|^(?:[0-9a-f]{2}\${r}){5}[0-9a-f]{2}\$\`)},Qs=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])\$/,Ys=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])\$/,ec=/^\$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?\$/,zo=/^[A-Za-z0-9_-]*\$/,Yf=/^(?=.{1,253}\\.?\$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\\.?\$/,eg=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}\$/,tc=/^\\+[1-9]\\d{6,14}\$/,xd="(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))",rc=new RegExp(\`^\${xd}\$\`);function bd(e){let r="(?:[01]\\\\d|2[0-3]):[0-5]\\\\d";return typeof e.precision=="number"?e.precision===-1?\`\${r}\`:e.precision===0?\`\${r}:[0-5]\\\\d\`:\`\${r}:[0-5]\\\\d\\\\.\\\\d{\${e.precision}}\`:\`\${r}(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?\`}function nc(e){return new RegExp(\`^\${bd(e)}\$\`)}function oc(e){let r=bd({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)");let i=\`\${r}(?:\${n.join("|")})\`;return new RegExp(\`^\${xd}T(?:\${i})\$\`)}var ic=e=>{let r=e?\`[\\\\s\\\\S]{\${e?.minimum??0},\${e?.maximum??""}}\`:"[\\\\s\\\\S]*";return new RegExp(\`^\${r}\$\`)},ac=/^-?\\d+n?\$/,sc=/^-?\\d+\$/,So=/^-?\\d+(?:\\.\\d+)?\$/,cc=/^(?:true|false)\$/i,uc=/^null\$/i;var lc=/^undefined\$/i;var dc=/^[^A-Z]*\$/,pc=/^[^a-z]*\$/,tg=/^[0-9a-fA-F]*\$/;function Br(e,r){return new RegExp(\`^[A-Za-z0-9+/]{\${e}}\${r}\$\`)}function Wr(e){return new RegExp(\`^[A-Za-z0-9_-]{\${e}}\$\`)}var rg=/^[0-9a-fA-F]{32}\$/,ng=Br(22,"=="),og=Wr(22),ig=/^[0-9a-fA-F]{40}\$/,ag=Br(27,"="),sg=Wr(27),cg=/^[0-9a-fA-F]{64}\$/,ug=Br(43,"="),lg=Wr(43),dg=/^[0-9a-fA-F]{96}\$/,pg=Br(64,""),mg=Wr(64),fg=/^[0-9a-fA-F]{128}\$/,gg=Br(86,"=="),hg=Wr(86);var H=p("\$ZodCheck",(e,r)=>{var n;e._zod??(e._zod={}),e._zod.def=r,(n=e._zod).onattach??(n.onattach=[])}),kd={number:"number",bigint:"bigint",object:"date"},wo=p("\$ZodCheckLessThan",(e,r)=>{H.init(e,r);let n=kd[typeof r.value];e._zod.onattach.push(i=>{let t=i._zod.bag,o=(r.inclusive?t.maximum:t.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value<o&&(r.inclusive?t.maximum=r.value:t.exclusiveMaximum=r.value)}),e._zod.check=i=>{(r.inclusive?i.value<=r.value:i.value<r.value)||i.issues.push({origin:n,code:"too_big",maximum:typeof r.value=="object"?r.value.getTime():r.value,input:i.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),Io=p("\$ZodCheckGreaterThan",(e,r)=>{H.init(e,r);let n=kd[typeof r.value];e._zod.onattach.push(i=>{let t=i._zod.bag,o=(r.inclusive?t.minimum:t.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>o&&(r.inclusive?t.minimum=r.value:t.exclusiveMinimum=r.value)}),e._zod.check=i=>{(r.inclusive?i.value>=r.value:i.value>r.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof r.value=="object"?r.value.getTime():r.value,input:i.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),mc=p("\$ZodCheckMultipleOf",(e,r)=>{H.init(e,r),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=r.value)}),e._zod.check=n=>{if(typeof n.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%r.value===BigInt(0):Os(n.value,r.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:r.value,input:n.value,inst:e,continue:!r.abort})}}),fc=p("\$ZodCheckNumberFormat",(e,r)=>{H.init(e,r),r.format=r.format||"float64";let n=r.format?.includes("int"),i=n?"int":"number",[t,o]=Rs[r.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=r.format,s.minimum=t,s.maximum=o,n&&(s.pattern=sc)}),e._zod.check=a=>{let s=a.value;if(n){if(!Number.isInteger(s)){a.issues.push({expected:i,format:r.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!r.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!r.abort});return}}s<t&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:t,inclusive:!0,inst:e,continue:!r.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!r.abort})}}),gc=p("\$ZodCheckBigIntFormat",(e,r)=>{H.init(e,r);let[n,i]=As[r.format];e._zod.onattach.push(t=>{let o=t._zod.bag;o.format=r.format,o.minimum=n,o.maximum=i}),e._zod.check=t=>{let o=t.value;o<n&&t.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!r.abort}),o>i&&t.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!r.abort})}}),hc=p("\$ZodCheckMaxSize",(e,r)=>{var n;H.init(e,r),(n=e._zod.def).when??(n.when=i=>{let t=i.value;return!tt(t)&&t.size!==void 0}),e._zod.onattach.push(i=>{let t=i._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<t&&(i._zod.bag.maximum=r.maximum)}),e._zod.check=i=>{let t=i.value;t.size<=r.maximum||i.issues.push({origin:qr(t),code:"too_big",maximum:r.maximum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),vc=p("\$ZodCheckMinSize",(e,r)=>{var n;H.init(e,r),(n=e._zod.def).when??(n.when=i=>{let t=i.value;return!tt(t)&&t.size!==void 0}),e._zod.onattach.push(i=>{let t=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>t&&(i._zod.bag.minimum=r.minimum)}),e._zod.check=i=>{let t=i.value;t.size>=r.minimum||i.issues.push({origin:qr(t),code:"too_small",minimum:r.minimum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),yc=p("\$ZodCheckSizeEquals",(e,r)=>{var n;H.init(e,r),(n=e._zod.def).when??(n.when=i=>{let t=i.value;return!tt(t)&&t.size!==void 0}),e._zod.onattach.push(i=>{let t=i._zod.bag;t.minimum=r.size,t.maximum=r.size,t.size=r.size}),e._zod.check=i=>{let t=i.value,o=t.size;if(o===r.size)return;let a=o>r.size;i.issues.push({origin:qr(t),...a?{code:"too_big",maximum:r.size}:{code:"too_small",minimum:r.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!r.abort})}}),_c=p("\$ZodCheckMaxLength",(e,r)=>{var n;H.init(e,r),(n=e._zod.def).when??(n.when=i=>{let t=i.value;return!tt(t)&&t.length!==void 0}),e._zod.onattach.push(i=>{let t=i._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<t&&(i._zod.bag.maximum=r.maximum)}),e._zod.check=i=>{let t=i.value;if(t.length<=r.maximum)return;let a=Jr(t);i.issues.push({origin:a,code:"too_big",maximum:r.maximum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),xc=p("\$ZodCheckMinLength",(e,r)=>{var n;H.init(e,r),(n=e._zod.def).when??(n.when=i=>{let t=i.value;return!tt(t)&&t.length!==void 0}),e._zod.onattach.push(i=>{let t=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>t&&(i._zod.bag.minimum=r.minimum)}),e._zod.check=i=>{let t=i.value;if(t.length>=r.minimum)return;let a=Jr(t);i.issues.push({origin:a,code:"too_small",minimum:r.minimum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),bc=p("\$ZodCheckLengthEquals",(e,r)=>{var n;H.init(e,r),(n=e._zod.def).when??(n.when=i=>{let t=i.value;return!tt(t)&&t.length!==void 0}),e._zod.onattach.push(i=>{let t=i._zod.bag;t.minimum=r.length,t.maximum=r.length,t.length=r.length}),e._zod.check=i=>{let t=i.value,o=t.length;if(o===r.length)return;let a=Jr(t),s=o>r.length;i.issues.push({origin:a,...s?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!r.abort})}}),er=p("\$ZodCheckStringFormat",(e,r)=>{var n,i;H.init(e,r),e._zod.onattach.push(t=>{let o=t._zod.bag;o.format=r.format,r.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(r.pattern))}),r.pattern?(n=e._zod).check??(n.check=t=>{r.pattern.lastIndex=0,!r.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:r.format,input:t.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:e,continue:!r.abort})}):(i=e._zod).check??(i.check=()=>{})}),\$c=p("\$ZodCheckRegex",(e,r)=>{er.init(e,r),e._zod.check=n=>{r.pattern.lastIndex=0,!r.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:r.pattern.toString(),inst:e,continue:!r.abort})}}),kc=p("\$ZodCheckLowerCase",(e,r)=>{r.pattern??(r.pattern=dc),er.init(e,r)}),zc=p("\$ZodCheckUpperCase",(e,r)=>{r.pattern??(r.pattern=pc),er.init(e,r)}),Sc=p("\$ZodCheckIncludes",(e,r)=>{H.init(e,r);let n=we(r.includes),i=new RegExp(typeof r.position=="number"?\`^.{\${r.position}}\${n}\`:n);r.pattern=i,e._zod.onattach.push(t=>{let o=t._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),e._zod.check=t=>{t.value.includes(r.includes,r.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:t.value,inst:e,continue:!r.abort})}}),wc=p("\$ZodCheckStartsWith",(e,r)=>{H.init(e,r);let n=new RegExp(\`^\${we(r.prefix)}.*\`);r.pattern??(r.pattern=n),e._zod.onattach.push(i=>{let t=i._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(r.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:i.value,inst:e,continue:!r.abort})}}),Ic=p("\$ZodCheckEndsWith",(e,r)=>{H.init(e,r);let n=new RegExp(\`.*\${we(r.suffix)}\$\`);r.pattern??(r.pattern=n),e._zod.onattach.push(i=>{let t=i._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(r.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:i.value,inst:e,continue:!r.abort})}});function \$d(e,r,n){e.issues.length&&r.issues.push(...ke(n,e.issues))}var Tc=p("\$ZodCheckProperty",(e,r)=>{H.init(e,r),e._zod.check=n=>{let i=r.schema._zod.run({value:n.value[r.property],issues:[]},{});if(i instanceof Promise)return i.then(t=>\$d(t,n,r.property));\$d(i,n,r.property)}}),Pc=p("\$ZodCheckMimeType",(e,r)=>{H.init(e,r);let n=new Set(r.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=r.mime}),e._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:r.mime,input:i.value.type,inst:e,continue:!r.abort})}}),jc=p("\$ZodCheckOverwrite",(e,r)=>{H.init(e,r),e._zod.check=n=>{n.value=r.tx(n.value)}});var Kr=class{constructor(r=[]){this.content=[],this.indent=0,this&&(this.args=r)}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}let i=r.split(\`
|
|
3
4
|
\`).filter(a=>a),t=Math.min(...i.map(a=>a.length-a.trimStart().length)),o=i.map(a=>a.slice(t)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let r=Function,n=this?.args,t=[...(this?.content??[""]).map(o=>\` \${o}\`)];return new r(...n,t.join(\`
|
|
@@ -76,6 +77,6 @@ Boolean requesting whether a visible border and background is provided by the ho
|
|
|
76
77
|
- "model": Tool visible to and callable by the agent
|
|
77
78
|
- "app": Tool callable by the app from this server only\`)}),lT=l.object({mimeTypes:l.array(l.string()).optional().describe('Array of supported MIME types for UI resources.\\nMust include \`"text/html;profile=mcp-app"\` for MCP Apps support.')}),dT=l.object({method:l.literal("ui/download-file"),params:l.object({contents:l.array(l.union([Rl,Al])).describe("Resource contents to download \\u2014 embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),pT=l.object({method:l.literal("ui/message"),params:l.object({role:l.literal("user").describe('Message role, currently only "user" is supported.'),content:l.array(\$r).describe("Message content blocks (text, image, etc.).")})}),mT=l.object({method:l.literal("ui/notifications/sandbox-resource-ready"),params:l.object({html:l.string().describe("HTML content to load into the inner iframe."),sandbox:l.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:Wl.optional().describe("CSP configuration from resource metadata."),permissions:Kl.optional().describe("Sandbox permissions from resource metadata.")})}),N_=l.object({method:l.literal("ui/notifications/tool-result"),params:kr.describe("Standard MCP tool execution result.")}),bf=l.object({toolInfo:l.object({id:_r.optional().describe("JSON-RPC id of the tools/call request."),tool:ks.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:y_.optional().describe("Current color theme preference."),styles:T_.optional().describe("Style configuration for theming the app."),displayMode:so.optional().describe("How the UI is currently displayed."),availableDisplayModes:l.array(so).optional().describe("Display modes the host supports."),containerDimensions:l.union([l.object({height:l.number().describe("Fixed container height in pixels.")}),l.object({maxHeight:l.union([l.number(),l.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(l.union([l.object({width:l.number().describe("Fixed container width in pixels.")}),l.object({maxWidth:l.union([l.number(),l.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(\`Container dimensions. Represents the dimensions of the iframe or other
|
|
78
79
|
container holding the app. Specify either width or maxWidth, and either height or maxHeight.\`),locale:l.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:l.string().optional().describe("User's timezone in IANA format."),userAgent:l.string().optional().describe("Host application identifier."),platform:l.union([l.literal("web"),l.literal("desktop"),l.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:l.object({touch:l.boolean().optional().describe("Whether the device supports touch input."),hover:l.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:l.object({top:l.number().describe("Top safe area inset in pixels."),right:l.number().describe("Right safe area inset in pixels."),bottom:l.number().describe("Bottom safe area inset in pixels."),left:l.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),U_=l.object({method:l.literal("ui/notifications/host-context-changed"),params:bf.describe("Partial context update containing only changed fields.")}),fT=l.object({method:l.literal("ui/update-model-context"),params:l.object({content:l.array(\$r).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:l.record(l.string(),l.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),gT=l.object({method:l.literal("ui/initialize"),params:l.object({appInfo:qn.describe("App identification (name and version)."),appCapabilities:Z_.describe("Features and capabilities this app provides."),protocolVersion:l.string().describe("Protocol version this app supports.")})}),E_=l.object({protocolVersion:l.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:qn.describe("Host application identification and version."),hostCapabilities:j_.describe("Features and capabilities provided by the host."),hostContext:bf.describe("Rich context about the host environment.")}).passthrough();var Ps=class extends Bl{constructor(n,i={},t={autoResize:!0}){super(t);X(this,"_appInfo");X(this,"_capabilities");X(this,"options");X(this,"_hostCapabilities");X(this,"_hostInfo");X(this,"_hostContext");X(this,"eventSchemas",{toolinput:z_,toolinputpartial:S_,toolresult:N_,toolcancelled:w_,hostcontextchanged:U_});X(this,"_onteardown");X(this,"_oncalltool");X(this,"_onlisttools");X(this,"sendOpenLink",this.openLink);this._appInfo=n,this._capabilities=i,this.options=t,this.setRequestHandler(xr,o=>(console.log("Received ping:",o.params),{})),this.setEventHandler("hostcontextchanged",void 0)}onEventDispatch(n,i){n==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...i})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(n){this.setEventHandler("toolinput",n)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(n){this.setEventHandler("toolinputpartial",n)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(n){this.setEventHandler("toolresult",n)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(n){this.setEventHandler("toolcancelled",n)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(n){this.setEventHandler("hostcontextchanged",n)}get onteardown(){return this._onteardown}set onteardown(n){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,n),this._onteardown=n,this.replaceRequestHandler(P_,(i,t)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(i.params,t)})}get oncalltool(){return this._oncalltool}set oncalltool(n){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,n),this._oncalltool=n,this.replaceRequestHandler(Ml,(i,t)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(i.params,t)})}get onlisttools(){return this._onlisttools}set onlisttools(n){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,n),this._onlisttools=n,this.replaceRequestHandler(Cl,(i,t)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(i.params,t)})}assertCapabilityForMethod(n){}assertRequestHandlerCapability(n){switch(n){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(\`Client does not support tool capability (required for \${n})\`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(\`No handler for method \${n} registered\`)}}assertNotificationCapability(n){}assertTaskCapability(n){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(n){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(n,i){if(typeof n=="string")throw Error(\`callServerTool() expects an object as its first argument, but received a string ("\${n}"). Did you mean: callServerTool({ name: "\${n}", arguments: { ... } })?\`);return await this.request({method:"tools/call",params:n},kr,i)}async readServerResource(n,i){return await this.request({method:"resources/read",params:n},Dl,i)}async listServerResources(n,i){return await this.request({method:"resources/list",params:n},Zl,i)}sendMessage(n,i){return this.request({method:"ui/message",params:n},k_,i)}sendLog(n){return this.notification({method:"notifications/message",params:n})}updateModelContext(n,i){return this.request({method:"ui/update-model-context",params:n},ms,i)}openLink(n,i){return this.request({method:"ui/open-link",params:n},b_,i)}downloadFile(n,i){return this.request({method:"ui/download-file",params:n},\$_,i)}requestTeardown(n={}){return this.notification({method:"ui/notifications/request-teardown",params:n})}requestDisplayMode(n,i){return this.request({method:"ui/request-display-mode",params:n},O_,i)}sendSizeChanged(n){return this.notification({method:"ui/notifications/size-changed",params:n})}setupSizeChangedNotifications(){let n=!1,i=0,t=0,o=()=>{n||(n=!0,requestAnimationFrame(()=>{n=!1;let s=document.documentElement,u=s.style.height;s.style.height="max-content";let c=Math.ceil(s.getBoundingClientRect().height);s.style.height=u;let d=Math.ceil(window.innerWidth);(d!==i||c!==t)&&(i=d,t=c,this.sendSizeChanged({width:d,height:c}))}))};o();let a=new ResizeObserver(o);return a.observe(document.documentElement),a.observe(document.body),()=>a.disconnect()}async connect(n=new ao(window.parent,window.parent),i){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");await super.connect(n);try{let t=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:h_}},E_,i);if(t===void 0)throw Error(\`Server sent invalid initialize result: \${t}\`);this._hostCapabilities=t.hostCapabilities,this._hostInfo=t.hostInfo,this._hostContext=t.hostContext,await this.notification({method:"ui/notifications/initialized"}),this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(t){throw this.close(),t}}};var Lt=new Ps({name:"Opal Widget",version:"1.0.0"},{}),Gl={},Xl=null,xt={};function Ql(){window.dispatchEvent(new CustomEvent("openai:set_globals",{detail:{globals:{displayMode:xt.displayMode,locale:xt.locale,maxHeight:xt.containerDimensions?.maxHeight,toolInput:Gl,toolOutput:Xl}}}))}Lt.ontoolinput=e=>{Gl=e.arguments??{},Ql()};Lt.ontoolresult=e=>{Xl=e.content,Ql()};Lt.onhostcontextchanged=e=>{xt={...xt,...e},Ql()};window.openai={get displayMode(){return xt.displayMode},get locale(){return xt.locale},get maxHeight(){return xt.containerDimensions?.maxHeight},get toolInput(){return Gl},get toolOutput(){return Xl},callTool:async(e,r)=>({result:await Lt.callServerTool({arguments:r,name:e})}),openExternal:e=>Lt.openLink({url:e.href}),sendFollowUpMessage:e=>Lt.sendMessage({content:[{text:e.prompt,type:"text"}],role:"user"})};var R_=new ao(window.parent,window.parent);Lt.connect(R_);})();
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
<\/script>`;
|
|
81
|
+
//#endregion
|
|
81
82
|
export { OPENAI_SHIM_SCRIPT };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
"use client";
|
|
3
|
+
import { useCallback, useLayoutEffect, useRef } from "react";
|
|
4
|
+
//#region src/hooks/useEffectEvent.ts
|
|
4
5
|
function useEffectEvent(callback) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
const callbackRef = useRef(callback);
|
|
7
|
+
useLayoutEffect(() => {
|
|
8
|
+
callbackRef.current = callback;
|
|
9
|
+
});
|
|
10
|
+
return useCallback((...args) => {
|
|
11
|
+
return callbackRef.current(...args);
|
|
12
|
+
}, []);
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
+
//#endregion
|
|
14
15
|
export { useEffectEvent };
|
|
@@ -1,33 +1,27 @@
|
|
|
1
|
-
import { useEffect } from
|
|
2
|
-
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
//#region src/hooks/useObserveValue.ts
|
|
3
3
|
const useObserveValue = (inputRef, setValue) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (!inputRef.current) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
inputRef.current.value = value;
|
|
29
|
-
inputRef.current.dispatchEvent(new Event("change", { bubbles: true }));
|
|
30
|
-
};
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
const input = inputRef.current;
|
|
6
|
+
if (!input) return;
|
|
7
|
+
const descriptor = Object.getOwnPropertyDescriptor(input.constructor.prototype, "value");
|
|
8
|
+
Object.defineProperty(input, "value", {
|
|
9
|
+
configurable: true,
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return descriptor?.get?.call(input);
|
|
13
|
+
},
|
|
14
|
+
set: function(value) {
|
|
15
|
+
descriptor?.set?.call(input, value);
|
|
16
|
+
setValue?.(value);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}, [inputRef, setValue]);
|
|
20
|
+
return (value) => {
|
|
21
|
+
if (!inputRef.current) return;
|
|
22
|
+
inputRef.current.value = value;
|
|
23
|
+
inputRef.current.dispatchEvent(new Event("change", { bubbles: true }));
|
|
24
|
+
};
|
|
31
25
|
};
|
|
32
|
-
|
|
26
|
+
//#endregion
|
|
33
27
|
export { useObserveValue };
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const IconAngleLeft = withIcon(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
strokeLinecap: "round",
|
|
16
|
-
strokeLinejoin: "round"
|
|
17
|
-
}
|
|
18
|
-
)
|
|
19
|
-
);
|
|
20
|
-
|
|
2
|
+
import { withIcon } from "./withIcon.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/icons/IconAngleLeft.tsx
|
|
5
|
+
const IconAngleLeft = withIcon({
|
|
6
|
+
fill: "none",
|
|
7
|
+
name: "IconAngleLeft"
|
|
8
|
+
}, /* @__PURE__ */ jsx("path", {
|
|
9
|
+
d: "M12.5 13L7.5 8L12.5 3",
|
|
10
|
+
stroke: "currentColor",
|
|
11
|
+
strokeLinecap: "round",
|
|
12
|
+
strokeLinejoin: "round"
|
|
13
|
+
}));
|
|
14
|
+
//#endregion
|
|
21
15
|
export { IconAngleLeft };
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const IconAngleRight = withIcon(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
strokeLinecap: "round",
|
|
16
|
-
strokeLinejoin: "round"
|
|
17
|
-
}
|
|
18
|
-
)
|
|
19
|
-
);
|
|
20
|
-
|
|
2
|
+
import { withIcon } from "./withIcon.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/icons/IconAngleRight.tsx
|
|
5
|
+
const IconAngleRight = withIcon({
|
|
6
|
+
fill: "none",
|
|
7
|
+
name: "IconAngleRight"
|
|
8
|
+
}, /* @__PURE__ */ jsx("path", {
|
|
9
|
+
d: "M7.5 13L12.5 8L7.5 3",
|
|
10
|
+
stroke: "currentColor",
|
|
11
|
+
strokeLinecap: "round",
|
|
12
|
+
strokeLinejoin: "round"
|
|
13
|
+
}));
|
|
14
|
+
//#endregion
|
|
21
15
|
export { IconAngleRight };
|
package/dist/esm/icons/IconX.js
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const IconX = withIcon(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
clipRule: "evenodd",
|
|
13
|
-
d: "M14.8669 3.77596C15.0444 3.59845 15.0444 3.31064 14.8669 3.13313C14.6894 2.95562 14.4016 2.95562 14.224 3.13313L10 7.35718L5.77596 3.13313C5.59845 2.95562 5.31064 2.95562 5.13313 3.13313C4.95562 3.31064 4.95562 3.59845 5.13313 3.77596L9.35718 8L5.13313 12.224C4.95562 12.4016 4.95562 12.6894 5.13313 12.8669C5.31064 13.0444 5.59845 13.0444 5.77596 12.8669L10 8.64282L14.224 12.8669C14.4016 13.0444 14.6894 13.0444 14.8669 12.8669C15.0444 12.6894 15.0444 12.4016 14.8669 12.224L10.6428 8L14.8669 3.77596Z",
|
|
14
|
-
fill: "currentColor",
|
|
15
|
-
fillRule: "evenodd"
|
|
16
|
-
}
|
|
17
|
-
)
|
|
18
|
-
);
|
|
19
|
-
|
|
2
|
+
import { withIcon } from "./withIcon.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/icons/IconX.tsx
|
|
5
|
+
const IconX = withIcon({ name: "IconX" }, /* @__PURE__ */ jsx("path", {
|
|
6
|
+
clipRule: "evenodd",
|
|
7
|
+
d: "M14.8669 3.77596C15.0444 3.59845 15.0444 3.31064 14.8669 3.13313C14.6894 2.95562 14.4016 2.95562 14.224 3.13313L10 7.35718L5.77596 3.13313C5.59845 2.95562 5.31064 2.95562 5.13313 3.13313C4.95562 3.31064 4.95562 3.59845 5.13313 3.77596L9.35718 8L5.13313 12.224C4.95562 12.4016 4.95562 12.6894 5.13313 12.8669C5.31064 13.0444 5.59845 13.0444 5.77596 12.8669L10 8.64282L14.224 12.8669C14.4016 13.0444 14.6894 13.0444 14.8669 12.8669C15.0444 12.6894 15.0444 12.4016 14.8669 12.224L10.6428 8L14.8669 3.77596Z",
|
|
8
|
+
fill: "currentColor",
|
|
9
|
+
fillRule: "evenodd"
|
|
10
|
+
}));
|
|
11
|
+
//#endregion
|
|
20
12
|
export { IconX };
|
|
@@ -1,31 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const withIcon = ({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
ref,
|
|
19
|
-
viewBox: viewBox ?? `0 0 ${width} ${height}`,
|
|
20
|
-
width,
|
|
21
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
-
...props,
|
|
23
|
-
children
|
|
24
|
-
}
|
|
25
|
-
)
|
|
26
|
-
);
|
|
27
|
-
Icon.displayName = `@optiaxiom/react/${name}`;
|
|
28
|
-
return Icon;
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/icons/withIcon.tsx
|
|
5
|
+
const withIcon = ({ fill, height = 16, name, viewBox, width = 20 }, children) => {
|
|
6
|
+
const Icon = forwardRef((props, ref) => /* @__PURE__ */ jsx("svg", {
|
|
7
|
+
fill,
|
|
8
|
+
height,
|
|
9
|
+
ref,
|
|
10
|
+
viewBox: viewBox ?? `0 0 ${width} ${height}`,
|
|
11
|
+
width,
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
...props,
|
|
14
|
+
children
|
|
15
|
+
}));
|
|
16
|
+
Icon.displayName = `@optiaxiom/react/${name}`;
|
|
17
|
+
return Icon;
|
|
29
18
|
};
|
|
30
|
-
|
|
19
|
+
//#endregion
|
|
31
20
|
export { withIcon };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { ProteusAction } from "./proteus-action/ProteusAction.js";
|
|
2
|
+
import { ProteusBridge } from "./proteus-bridge/ProteusBridge.js";
|
|
3
|
+
import { ProteusChart } from "./proteus-chart/ProteusChart.js";
|
|
4
|
+
import { ProteusDataTable } from "./proteus-data-table/ProteusDataTable.js";
|
|
5
|
+
import { useProteusValue } from "./use-proteus-value/useProteusValue.js";
|
|
6
|
+
import { ProteusDateInput } from "./proteus-date-input/ProteusDateInput.js";
|
|
7
|
+
import { safeParseDocument } from "./proteus-document/schemas.js";
|
|
8
|
+
import { ProteusFederated } from "./proteus-federated/ProteusFederated.js";
|
|
9
|
+
import { ProteusFileUpload } from "./proteus-file-upload/ProteusFileUpload.js";
|
|
10
|
+
import { ProteusImage } from "./proteus-image/ProteusImage.js";
|
|
11
|
+
import { ProteusImageCarousel } from "./proteus-image-carousel/ProteusImageCarousel.js";
|
|
12
|
+
import { ProteusInput } from "./proteus-input/ProteusInput.js";
|
|
13
|
+
import { ProteusLength } from "./proteus-length/ProteusLength.js";
|
|
14
|
+
import { ProteusMapIndex } from "./proteus-map-index/ProteusMapIndex.js";
|
|
15
|
+
import { ProteusMap } from "./proteus-map/ProteusMap.js";
|
|
16
|
+
import { ProteusPillMenu } from "./proteus-pill-menu/ProteusPillMenu.js";
|
|
17
|
+
import { ProteusSelect } from "./proteus-select/ProteusSelect.js";
|
|
18
|
+
import { ProteusShow } from "./proteus-show/ProteusShow.js";
|
|
19
|
+
import { ProteusTextarea } from "./proteus-textarea/ProteusTextarea.js";
|
|
20
|
+
import { ProteusDocumentShell } from "./proteus-document/ProteusDocumentShell.js";
|
|
21
|
+
import { ProteusDocumentRenderer } from "./proteus-document/ProteusDocumentRenderer.js";
|
|
22
|
+
export { ProteusAction, ProteusBridge, ProteusChart, ProteusDataTable, ProteusDateInput, ProteusDocumentRenderer, ProteusDocumentShell, ProteusFederated, ProteusFileUpload, ProteusImage, ProteusImageCarousel, ProteusInput, ProteusLength, ProteusMap, ProteusMapIndex, ProteusPillMenu, ProteusSelect, ProteusShow, ProteusTextarea, safeParseDocument, useProteusValue };
|
|
@@ -1,43 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
2
|
+
import { useProteusDocumentContext } from "../proteus-document/ProteusDocumentContext.js";
|
|
3
|
+
import { useProteusDocumentPathContext } from "../proteus-document/ProteusDocumentPathContext.js";
|
|
4
|
+
import { useResolveProteusValues } from "../proteus-document/useResolveProteusValues.js";
|
|
5
|
+
import { Button } from "@optiaxiom/react";
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
//#region src/proteus-action/ProteusAction.tsx
|
|
9
|
+
function ProteusAction({ children, onClick, type = "button", ...props }) {
|
|
10
|
+
const { onEvent, valid } = useProteusDocumentContext("@optiaxiom/proteus/ProteusAction");
|
|
11
|
+
const { path: parentPath } = useProteusDocumentPathContext("@optiaxiom/proteus/ProteusAction");
|
|
12
|
+
const resolvedOnClick = useResolveProteusValues(onClick ?? {});
|
|
13
|
+
const [loading, setLoading] = useState(false);
|
|
14
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
15
|
+
disabled: type === "submit" && !valid,
|
|
16
|
+
justifyContent: "center",
|
|
17
|
+
loading,
|
|
18
|
+
onClick: async () => {
|
|
19
|
+
if (!onClick || loading) return;
|
|
20
|
+
setLoading(true);
|
|
21
|
+
await onEvent(resolveEventPath(resolvedOnClick, parentPath));
|
|
22
|
+
setLoading(false);
|
|
23
|
+
},
|
|
24
|
+
type,
|
|
25
|
+
...props,
|
|
26
|
+
children
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Runtime data ops (`pushValue` / `removeValue`) carry a `path` that is
|
|
31
|
+
* relative to the firing component's position in the document. Resolve it to
|
|
32
|
+
* an absolute JSON pointer here — where the positional `Map` context is
|
|
33
|
+
* available — so the document-root event handler can apply it unambiguously.
|
|
34
|
+
*/
|
|
35
|
+
function resolveEventPath(event, parentPath) {
|
|
36
|
+
if (event && typeof event === "object" && "action" in event && (event.action === "pushValue" || event.action === "removeValue")) {
|
|
37
|
+
const { path } = event;
|
|
38
|
+
const resolved = path === "" ? parentPath : path.startsWith("/") ? path : `${parentPath}/${path}`;
|
|
39
|
+
return {
|
|
40
|
+
...event,
|
|
41
|
+
path: resolved
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return event;
|
|
40
45
|
}
|
|
41
46
|
ProteusAction.displayName = "@optiaxiom/proteus/ProteusAction";
|
|
42
|
-
|
|
47
|
+
//#endregion
|
|
43
48
|
export { ProteusAction };
|