@maincode-ai/matilda-code 0.21.11 → 0.21.12
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/bundled/mainy/docs/configuration/settings.md +16 -5
- package/bundled/mainy/docs/configuration/trusted-folders.md +12 -6
- package/chunks/agent-WM63A6NK.js +3 -0
- package/chunks/agent-headless-QIUBDKPW.js +3 -0
- package/chunks/{anthropicContentGenerator-IYZILRDW.js → anthropicContentGenerator-VKFTAIU3.js} +1 -1
- package/chunks/{askUserQuestion-XWHJY3DM.js → askUserQuestion-2QI4NSFJ.js} +1 -1
- package/chunks/{ca-EUJBUYX5.js → ca-I2HEEIL7.js} +1 -1
- package/chunks/{chunk-MH2P4YXC.js → chunk-27Q5KW3A.js} +2 -2
- package/chunks/{chunk-NYEWHSBL.js → chunk-2HTPVSGT.js} +1 -1
- package/chunks/{chunk-2HQMJ2IU.js → chunk-2MOGYHWM.js} +1 -1
- package/chunks/{chunk-WRQLIPXW.js → chunk-3IRGBRSP.js} +10 -10
- package/chunks/{chunk-NIQK6NX3.js → chunk-5C2RJ5RR.js} +1 -1
- package/chunks/{chunk-T4P4KEDW.js → chunk-6E766NPX.js} +1 -1
- package/chunks/{chunk-QH7736R5.js → chunk-6EQMZNIY.js} +1 -1
- package/chunks/{chunk-4FVBPNTZ.js → chunk-6T2GIM76.js} +1 -1
- package/chunks/{chunk-25NCTG5H.js → chunk-6Z2MV7ZY.js} +55 -53
- package/chunks/chunk-BVOCFLC4.js +56 -0
- package/chunks/chunk-CSJTA7NE.js +101 -0
- package/chunks/{chunk-SNLH42QJ.js → chunk-CZGZ3KK7.js} +1 -1
- package/chunks/{chunk-JXUDKX6D.js → chunk-DE3HKC2W.js} +1 -1
- package/chunks/{chunk-4CSSDBOS.js → chunk-DOOFGSRV.js} +10 -10
- package/chunks/{chunk-RK2AKQAX.js → chunk-FPO57O66.js} +6 -6
- package/chunks/{chunk-ODZOYHIC.js → chunk-GOJCMVJJ.js} +1 -1
- package/chunks/{chunk-FFFZ2QMG.js → chunk-GTVCJCHR.js} +1 -1
- package/chunks/{chunk-SUH3UUWZ.js → chunk-JCE3JAVC.js} +1 -1
- package/chunks/chunk-JRECUFB3.js +2630 -0
- package/chunks/chunk-KHHJYBR5.js +9 -0
- package/chunks/{chunk-GO2GA2GY.js → chunk-LUNDTQ3G.js} +1 -1
- package/chunks/{chunk-5427BPR2.js → chunk-MCQUPLRE.js} +1 -1
- package/chunks/{chunk-QN6WSWMM.js → chunk-MO2HXJG5.js} +1 -1
- package/chunks/{chunk-ELH4YHJR.js → chunk-PGXQZVLX.js} +1 -1
- package/chunks/{chunk-Q55AVE2N.js → chunk-QVCGLQCI.js} +11 -11
- package/chunks/{chunk-W5CGKUM4.js → chunk-S3CWEVTS.js} +1 -1
- package/chunks/{chunk-YMIF2DMT.js → chunk-VTGICC67.js} +1 -1
- package/chunks/chunk-WC2VTVCE.js +27 -0
- package/chunks/{chunk-SPW5DXX4.js → chunk-WV3IUPZS.js} +1 -1
- package/chunks/{chunk-4YVN5HXG.js → chunk-YJAKOETP.js} +2 -2
- package/chunks/{chunk-WHG6N5X2.js → chunk-YRQP3SLC.js} +1 -1
- package/chunks/{chunk-GUFIMKF5.js → chunk-YV3PUOBU.js} +1 -1
- package/chunks/{computer-use-SXP25RZQ.js → computer-use-WKDNUTLD.js} +1 -1
- package/chunks/contextCommand-DAB3HOHY.js +3 -0
- package/chunks/{cron-create-2UI4AT4Q.js → cron-create-F2LXM2OA.js} +1 -1
- package/chunks/{cron-delete-ZB6BOTFF.js → cron-delete-DE6Q2S2L.js} +1 -1
- package/chunks/{cron-list-YYAXNHB6.js → cron-list-IAQEJVV7.js} +1 -1
- package/chunks/{de-DNEPG7S7.js → de-AQXFJYZI.js} +1 -1
- package/chunks/edit-QQNJZ55P.js +43 -0
- package/chunks/{en-NOD6KQNM.js → en-EJLDYIBM.js} +1 -1
- package/chunks/{enter-worktree-X47BSJLE.js → enter-worktree-5X5SAMBJ.js} +1 -1
- package/chunks/{enterPlanMode-F22ZNTYJ.js → enterPlanMode-HP35SPLN.js} +1 -1
- package/chunks/{exit-worktree-XY5UMDHX.js → exit-worktree-SRKZBEYF.js} +1 -1
- package/chunks/exitPlanMode-WSPTGGVN.js +120 -0
- package/chunks/{fr-2OE5WLJ4.js → fr-6TDHK7F2.js} +1 -1
- package/chunks/{geminiContentGenerator-EQEGOXOV.js → geminiContentGenerator-RJ73DQAP.js} +1 -1
- package/chunks/{glob-KSBEWI3E.js → glob-QQ6LGKDX.js} +1 -1
- package/chunks/{goal-tools-6QTC3UI7.js → goal-tools-C6BSBHCF.js} +1 -1
- package/chunks/{grep-6TTPZ524.js → grep-MVCOBUYW.js} +1 -1
- package/chunks/{ja-3B6V5KS7.js → ja-GGNJR7AR.js} +1 -1
- package/chunks/{keychain-token-storage-54BNK6VH.js → keychain-token-storage-KQK6MNOJ.js} +1 -1
- package/chunks/{ls-YWZU3FYL.js → ls-JYJXFSXN.js} +1 -1
- package/chunks/{lsp-4CJDKEEC.js → lsp-DYDK6XCS.js} +1 -1
- package/chunks/{matildaAgentContentGenerator-OV4U6DJD.js → matildaAgentContentGenerator-YUYS4336.js} +1 -1
- package/chunks/{matildaContentGenerator-ETIAWE22.js → matildaContentGenerator-O4Z2QPCP.js} +1 -1
- package/chunks/{matildaOAuth2-WOY7ZS43.js → matildaOAuth2-7COTQQR2.js} +1 -1
- package/chunks/mcp-client-RXVQU5VI.js +3 -0
- package/chunks/monitor-77KXDXPR.js +32 -0
- package/chunks/{notebook-edit-TL7CI5EA.js → notebook-edit-TKJD2EQZ.js} +1 -1
- package/chunks/{openaiContentGenerator-MGASUFQL.js → openaiContentGenerator-2EALAM3U.js} +1 -1
- package/chunks/{pt-KP2JCPUY.js → pt-D6L2QTDM.js} +1 -1
- package/chunks/read-file-3KUAH6ND.js +3 -0
- package/chunks/ripGrep-U2PLKXMY.js +3 -0
- package/chunks/{ru-K7IQQKHC.js → ru-BNJCHDYO.js} +1 -1
- package/chunks/{scheduler-TKWPD4LP.js → scheduler-J7VU2V5Y.js} +1 -1
- package/chunks/{send-message-OO2HAKCC.js → send-message-P3SMWNEE.js} +1 -1
- package/chunks/{serve-ZQX2WBLF.js → serve-FXH6EBQ6.js} +36 -36
- package/chunks/shell-PXR2AXDD.js +3 -0
- package/chunks/{skill-KDM3UUML.js → skill-HZPFEAPF.js} +1 -1
- package/chunks/src-RFAEPLY7.js +3 -0
- package/chunks/{symbol-search-ALYOX5JN.js → symbol-search-EAIZPWN7.js} +1 -1
- package/chunks/{syntheticOutput-UASKABJH.js → syntheticOutput-432LXITX.js} +1 -1
- package/chunks/task-create-Z3QRCMX4.js +3 -0
- package/chunks/{task-detach-I67ZE5MX.js → task-detach-XMSJ3HBM.js} +1 -1
- package/chunks/{task-list-5BGX4G5N.js → task-list-GXAJW3JP.js} +1 -1
- package/chunks/{task-stop-ERI5X4AO.js → task-stop-NTS62FLG.js} +1 -1
- package/chunks/{task-update-CD3W556L.js → task-update-AR26UFYZ.js} +1 -1
- package/chunks/{team-create-F4KQRGMB.js → team-create-PYXFVIR5.js} +1 -1
- package/chunks/{team-delete-5U3GBFKJ.js → team-delete-OMYVUAQU.js} +1 -1
- package/chunks/todoWrite-5NZ7CHTC.js +3 -0
- package/chunks/{tool-search-JFCD5W5M.js → tool-search-RKZDSRYS.js} +1 -1
- package/chunks/tree-sitter-bash-2SWKO5B7.js +3 -0
- package/chunks/{web-fetch-REWGIRWQ.js → web-fetch-VW3SVDQ6.js} +13 -13
- package/chunks/{web-search-OX2DPEVN.js → web-search-XQUIZARL.js} +1 -1
- package/chunks/{workflow-SEFYGBED.js → workflow-YXNXDRWZ.js} +2 -2
- package/chunks/{write-file-UAGVBZMC.js → write-file-XDDLTGSG.js} +1 -1
- package/cli.js +459 -449
- package/locales/ca.js +1 -0
- package/locales/de.js +1 -0
- package/locales/en.js +1 -0
- package/locales/fr.js +1 -0
- package/locales/ja.js +1 -0
- package/locales/pt.js +1 -0
- package/locales/ru.js +1 -0
- package/package.json +2 -2
- package/sandbox-macos-restrictive-closed.sb +3 -0
- package/sandbox-macos-restrictive-open.sb +3 -0
- package/sandbox-macos-restrictive-proxied.sb +3 -0
- package/chunks/agent-ZFZ4HJQC.js +0 -3
- package/chunks/agent-headless-KH2BKLP7.js +0 -3
- package/chunks/chunk-GHBKFIHC.js +0 -35
- package/chunks/chunk-HWOQNYAO.js +0 -27
- package/chunks/chunk-NVM7W7TG.js +0 -101
- package/chunks/chunk-QFNFLE2I.js +0 -2625
- package/chunks/chunk-XCFLI3OC.js +0 -9
- package/chunks/contextCommand-3GN5CAOK.js +0 -3
- package/chunks/edit-KX6V4PH3.js +0 -39
- package/chunks/exitPlanMode-G3QLIWJ4.js +0 -90
- package/chunks/monitor-F4K5HOZX.js +0 -32
- package/chunks/read-file-6EAPS2KG.js +0 -3
- package/chunks/ripGrep-K6SFFUIE.js +0 -3
- package/chunks/shell-AZRK5GIO.js +0 -3
- package/chunks/src-SGI6VLOS.js +0 -3
- package/chunks/task-create-EBJD55TB.js +0 -3
- package/chunks/todoWrite-YGG6AZ3A.js +0 -3
- package/chunks/tree-sitter-bash-XNCMPQBK.js +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{l as k}from"./chunk-
|
|
3
|
+
import{l as k}from"./chunk-YJAKOETP.js";import{Ac as It,Hc as St}from"./chunk-JRECUFB3.js";import{a as Tt}from"./chunk-WV3IUPZS.js";import{m as Ct}from"./chunk-JCE3JAVC.js";import{Gc as ht,h as nt}from"./chunk-6Z2MV7ZY.js";import{p as st}from"./chunk-6E766NPX.js";import{b as C}from"./chunk-GZPNIYVZ.js";import{d as gt,f as Bt}from"./chunk-OWGSC52X.js";var Mt=gt(i=>{"use strict";C();var at=Symbol.for("react.transitional.element"),$t=Symbol.for("react.portal"),Gt=Symbol.for("react.fragment"),jt=Symbol.for("react.strict_mode"),Wt=Symbol.for("react.profiler"),qt=Symbol.for("react.consumer"),Ft=Symbol.for("react.context"),Yt=Symbol.for("react.forward_ref"),Kt=Symbol.for("react.suspense"),Jt=Symbol.for("react.memo"),kt=Symbol.for("react.lazy"),zt=Symbol.for("react.activity"),xt=Symbol.iterator;function Qt(t){return t===null||typeof t!="object"?null:(t=xt&&t[xt]||t["@@iterator"],typeof t=="function"?t:null)}var Rt={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vt=Object.assign,Et={};function v(t,e,s){this.props=t,this.context=e,this.refs=Et,this.updater=s||Rt}v.prototype.isReactComponent={};v.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};v.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function At(){}At.prototype=v.prototype;function ut(t,e,s){this.props=t,this.context=e,this.refs=Et,this.updater=s||Rt}var mt=ut.prototype=new At;mt.constructor=ut;vt(mt,v.prototype);mt.isPureReactComponent=!0;var bt=Array.isArray;function it(){}var p={H:null,A:null,T:null,S:null},wt=Object.prototype.hasOwnProperty;function lt(t,e,s){var o=s.ref;return{$$typeof:at,type:t,key:e,ref:o!==void 0?o:null,props:s}}function Vt(t,e){return lt(t.type,e,t.props)}function pt(t){return typeof t=="object"&&t!==null&&t.$$typeof===at}function Xt(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(s){return e[s]})}var _t=/\/+/g;function rt(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Xt(""+t.key):e.toString(36)}function Zt(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(it,it):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function R(t,e,s,o,n){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var m=!1;if(t===null)m=!0;else switch(a){case"bigint":case"string":case"number":m=!0;break;case"object":switch(t.$$typeof){case at:case $t:m=!0;break;case kt:return m=t._init,R(m(t._payload),e,s,o,n)}}if(m)return n=n(t),m=o===""?"."+rt(t,0):o,bt(n)?(s="",m!=null&&(s=m.replace(_t,"$&/")+"/"),R(n,e,s,"",function(g){return g})):n!=null&&(pt(n)&&(n=Vt(n,s+(n.key==null||t&&t.key===n.key?"":(""+n.key).replace(_t,"$&/")+"/")+m)),e.push(n)),1;m=0;var d=o===""?".":o+":";if(bt(t))for(var c=0;c<t.length;c++)o=t[c],a=d+rt(o,c),m+=R(o,e,s,a,n);else if(c=Qt(t),typeof c=="function")for(t=c.call(t),c=0;!(o=t.next()).done;)o=o.value,a=d+rt(o,c++),m+=R(o,e,s,a,n);else if(a==="object"){if(typeof t.then=="function")return R(Zt(t),e,s,o,n);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return m}function B(t,e,s){if(t==null)return t;var o=[],n=0;return R(t,o,"","",function(a){return e.call(s,a,n++)}),o}function te(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(s){(t._status===0||t._status===-1)&&(t._status=1,t._result=s)},function(s){(t._status===0||t._status===-1)&&(t._status=2,t._result=s)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Ht=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ee={map:B,forEach:function(t,e,s){B(t,function(){e.apply(this,arguments)},s)},count:function(t){var e=0;return B(t,function(){e++}),e},toArray:function(t){return B(t,function(e){return e})||[]},only:function(t){if(!pt(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};i.Activity=zt;i.Children=ee;i.Component=v;i.Fragment=Gt;i.Profiler=Wt;i.PureComponent=ut;i.StrictMode=jt;i.Suspense=Kt;i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=p;i.__COMPILER_RUNTIME={__proto__:null,c:function(t){return p.H.useMemoCache(t)}};i.cache=function(t){return function(){return t.apply(null,arguments)}};i.cacheSignal=function(){return null};i.cloneElement=function(t,e,s){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var o=vt({},t.props),n=t.key;if(e!=null)for(a in e.key!==void 0&&(n=""+e.key),e)!wt.call(e,a)||a==="key"||a==="__self"||a==="__source"||a==="ref"&&e.ref===void 0||(o[a]=e[a]);var a=arguments.length-2;if(a===1)o.children=s;else if(1<a){for(var m=Array(a),d=0;d<a;d++)m[d]=arguments[d+2];o.children=m}return lt(t.type,n,o)};i.createContext=function(t){return t={$$typeof:Ft,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:qt,_context:t},t};i.createElement=function(t,e,s){var o,n={},a=null;if(e!=null)for(o in e.key!==void 0&&(a=""+e.key),e)wt.call(e,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(n[o]=e[o]);var m=arguments.length-2;if(m===1)n.children=s;else if(1<m){for(var d=Array(m),c=0;c<m;c++)d[c]=arguments[c+2];n.children=d}if(t&&t.defaultProps)for(o in m=t.defaultProps,m)n[o]===void 0&&(n[o]=m[o]);return lt(t,a,n)};i.createRef=function(){return{current:null}};i.forwardRef=function(t){return{$$typeof:Yt,render:t}};i.isValidElement=pt;i.lazy=function(t){return{$$typeof:kt,_payload:{_status:-1,_result:t},_init:te}};i.memo=function(t,e){return{$$typeof:Jt,type:t,compare:e===void 0?null:e}};i.startTransition=function(t){var e=p.T,s={};p.T=s;try{var o=t(),n=p.S;n!==null&&n(s,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(it,Ht)}catch(a){Ht(a)}finally{e!==null&&s.types!==null&&(e.types=s.types),p.T=e}};i.unstable_useCacheRefresh=function(){return p.H.useCacheRefresh()};i.use=function(t){return p.H.use(t)};i.useActionState=function(t,e,s){return p.H.useActionState(t,e,s)};i.useCallback=function(t,e){return p.H.useCallback(t,e)};i.useContext=function(t){return p.H.useContext(t)};i.useDebugValue=function(){};i.useDeferredValue=function(t,e){return p.H.useDeferredValue(t,e)};i.useEffect=function(t,e){return p.H.useEffect(t,e)};i.useEffectEvent=function(t){return p.H.useEffectEvent(t)};i.useId=function(){return p.H.useId()};i.useImperativeHandle=function(t,e,s){return p.H.useImperativeHandle(t,e,s)};i.useInsertionEffect=function(t,e){return p.H.useInsertionEffect(t,e)};i.useLayoutEffect=function(t,e){return p.H.useLayoutEffect(t,e)};i.useMemo=function(t,e){return p.H.useMemo(t,e)};i.useOptimistic=function(t,e){return p.H.useOptimistic(t,e)};i.useReducer=function(t,e,s){return p.H.useReducer(t,e,s)};i.useRef=function(t){return p.H.useRef(t)};i.useState=function(t){return p.H.useState(t)};i.useSyncExternalStore=function(t,e,s){return p.H.useSyncExternalStore(t,e,s)};i.useTransition=function(){return p.H.useTransition()};i.version="19.2.4"});var Dt=gt((de,Pt)=>{"use strict";C();Pt.exports=Mt()});C();C();C();var fe=Bt(Dt(),1);var oe=["achieved","aborted","failed"];function ge(t){return oe.includes(t)}function ne(t,e){return t>=e.hard?"hard":t>=e.auto?"auto":t>=e.warn?"warn":"safe"}function T(t){if(!t||t.length===0)return 0;let e=0,s=0;for(let o=0;o<t.length;o++)t.charCodeAt(o)<128?e++:s++;return Math.ceil(e/4+s*1.5)}function se(t){if(!t||t.trim().length===0)return[];let e=[],s=/--- Context from: (.+?) ---\n([\s\S]*?)--- End of Context from: \1 ---/g,o;for(;(o=s.exec(t))!==null;){let n=o[1],a=o[2];e.push({path:n,tokens:T(a)})}return e.length===0&&t.trim().length>0&&e.push({path:k("memory"),tokens:T(t)}),e}async function re(t,e){let s=t.getModelDisplayName()||"unknown",o=t.getContentGeneratorConfig(),n=o.contextWindowSize??131072,a=nt.getLastPromptTokenCount(),m=nt.getLastCachedContentTokenCount(),d=It(void 0,s),c=T(d),g=t.getToolRegistry(),M=g?g.getAllTools():[],r=g?g.getFunctionDeclarations():[],P=JSON.stringify(r),_=T(P),H=[],x=[];for(let u of M){if(u.shouldDefer&&!u.alwaysLoad&&!g?.isDeferredToolRevealed(u.name))continue;let h=JSON.stringify(u.schema),S=T(h);u instanceof ht?x.push({name:`${u.serverName}__${u.serverToolName||u.name}`,tokens:S}):u.name!==st.SKILL&&H.push({name:u.name,tokens:S})}let l=t.getUserMemory(),y=se(l),$=y.reduce((u,h)=>u+h.tokens,0),E=M.find(u=>u.name===st.SKILL),G=E?T(JSON.stringify(E.schema)):0,Nt=E&&"getLoadedSkillNames"in E?E.getLoadedSkillNames():new Set,dt=t.getSkillManager(),Ut=dt?await dt.listSkills():[],D=0,j=Ut.map(u=>{let h=T(`<skill>
|
|
4
4
|
<name>
|
|
5
5
|
${u.name}
|
|
6
6
|
</name>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{ba as cu}from"./chunk-MH2P4YXC.js";import{b as f}from"./chunk-GZPNIYVZ.js";import{d as g,f as oo}from"./chunk-OWGSC52X.js";var Dr=g(U=>{"use strict";f();Object.defineProperty(U,"__esModule",{value:!0});U.regexpCode=U.getEsmExportName=U.getProperty=U.safeStringify=U.stringify=U.strConcat=U.addCodeArg=U.str=U._=U.nil=U._Code=U.Name=U.IDENTIFIER=U._CodeOrName=void 0;var Cr=class{};U._CodeOrName=Cr;U.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var jt=class extends Cr{constructor(e){if(super(),!U.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};U.Name=jt;var Re=class extends Cr{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof jt&&(r[n.str]=(r[n.str]||0)+1),r),{})}};U._Code=Re;U.nil=new Re("");function lu(t,...e){let r=[t[0]],n=0;for(;n<e.length;)io(r,e[n]),r.push(t[++n]);return new Re(r)}U._=lu;var ao=new Re("+");function du(t,...e){let r=[qr(t[0])],n=0;for(;n<e.length;)r.push(ao),io(r,e[n]),r.push(ao,qr(t[++n]));return Ym(r),new Re(r)}U.str=du;function io(t,e){e instanceof Re?t.push(...e._items):e instanceof jt?t.push(e):t.push(eh(e))}U.addCodeArg=io;function Ym(t){let e=1;for(;e<t.length-1;){if(t[e]===ao){let r=Qm(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Qm(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof jt||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof jt))return`"${t}${e.slice(1)}`}function Zm(t,e){return e.emptyStr()?t:t.emptyStr()?e:du`${t}${e}`}U.strConcat=Zm;function eh(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:qr(Array.isArray(t)?t.join(","):t)}function th(t){return new Re(qr(t))}U.stringify=th;function qr(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}U.safeStringify=qr;function rh(t){return typeof t=="string"&&U.IDENTIFIER.test(t)?new Re(`.${t}`):lu`[${t}]`}U.getProperty=rh;function nh(t){if(typeof t=="string"&&U.IDENTIFIER.test(t))return new Re(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}U.getEsmExportName=nh;function sh(t){return new Re(t.toString())}U.regexpCode=sh});var lo=g($e=>{"use strict";f();Object.defineProperty($e,"__esModule",{value:!0});$e.ValueScope=$e.ValueScopeName=$e.Scope=$e.varKinds=$e.UsedValueState=void 0;var ge=Dr(),co=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},zn;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(zn||($e.UsedValueState=zn={}));$e.varKinds={const:new ge.Name("const"),let:new ge.Name("let"),var:new ge.Name("var")};var Ln=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ge.Name?e:this.name(e)}name(e){return new ge.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};$e.Scope=Ln;var Un=class extends ge.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,ge._)`.${new ge.Name(r)}[${n}]`}};$e.ValueScopeName=Un;var oh=(0,ge._)`\n`,uo=class extends Ln{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?oh:ge.nil}}get(){return this._scope}name(e){return new Un(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:o}=s,a=(n=r.key)!==null&&n!==void 0?n:r.ref,i=this._values[o];if(i){let u=i.get(a);if(u)return u}else i=this._values[o]=new Map;i.set(a,s);let c=this._scope[o]||(this._scope[o]=[]),d=c.length;return c[d]=r.ref,s.setValue(r,{property:o,itemIndex:d}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,ge._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let o=ge.nil;for(let a in e){let i=e[a];if(!i)continue;let c=n[a]=n[a]||new Map;i.forEach(d=>{if(c.has(d))return;c.set(d,zn.Started);let u=r(d);if(u){let l=this.opts.es5?$e.varKinds.var:$e.varKinds.const;o=(0,ge._)`${o}${l} ${d} = ${u};${this.opts._n}`}else if(u=s?.(d))o=(0,ge._)`${o}${u}${this.opts._n}`;else throw new co(d);c.set(d,zn.Completed)})}return o}};$e.ValueScope=uo});var O=g(I=>{"use strict";f();Object.defineProperty(I,"__esModule",{value:!0});I.or=I.and=I.not=I.CodeGen=I.operators=I.varKinds=I.ValueScopeName=I.ValueScope=I.Scope=I.Name=I.regexpCode=I.stringify=I.getProperty=I.nil=I.strConcat=I.str=I._=void 0;var V=Dr(),xe=lo(),ft=Dr();Object.defineProperty(I,"_",{enumerable:!0,get:function(){return ft._}});Object.defineProperty(I,"str",{enumerable:!0,get:function(){return ft.str}});Object.defineProperty(I,"strConcat",{enumerable:!0,get:function(){return ft.strConcat}});Object.defineProperty(I,"nil",{enumerable:!0,get:function(){return ft.nil}});Object.defineProperty(I,"getProperty",{enumerable:!0,get:function(){return ft.getProperty}});Object.defineProperty(I,"stringify",{enumerable:!0,get:function(){return ft.stringify}});Object.defineProperty(I,"regexpCode",{enumerable:!0,get:function(){return ft.regexpCode}});Object.defineProperty(I,"Name",{enumerable:!0,get:function(){return ft.Name}});var Hn=lo();Object.defineProperty(I,"Scope",{enumerable:!0,get:function(){return Hn.Scope}});Object.defineProperty(I,"ValueScope",{enumerable:!0,get:function(){return Hn.ValueScope}});Object.defineProperty(I,"ValueScopeName",{enumerable:!0,get:function(){return Hn.ValueScopeName}});Object.defineProperty(I,"varKinds",{enumerable:!0,get:function(){return Hn.varKinds}});I.operators={GT:new V._Code(">"),GTE:new V._Code(">="),LT:new V._Code("<"),LTE:new V._Code("<="),EQ:new V._Code("==="),NEQ:new V._Code("!=="),NOT:new V._Code("!"),OR:new V._Code("||"),AND:new V._Code("&&"),ADD:new V._Code("+")};var nt=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},fo=class extends nt{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?xe.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Zt(this.rhs,e,r)),this}get names(){return this.rhs instanceof V._CodeOrName?this.rhs.names:{}}},Fn=class extends nt{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof V.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Zt(this.rhs,e,r),this}get names(){let e=this.lhs instanceof V.Name?{}:{...this.lhs.names};return Gn(e,this.rhs)}},po=class extends Fn{constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},mo=class extends nt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},ho=class extends nt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},yo=class extends nt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},_o=class extends nt{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Zt(this.code,e,r),this}get names(){return this.code instanceof V._CodeOrName?this.code.names:{}}},Mr=class extends nt{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let o=n[s];o.optimizeNames(e,r)||(ah(e,o.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Ct(e,r.names),{})}},st=class extends Mr{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},go=class extends Mr{},Qt=class extends st{};Qt.kind="else";var At=class t extends st{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Qt(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(fu(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Zt(this.condition,e,r),this}get names(){let e=super.names;return Gn(e,this.condition),this.else&&Ct(e,this.else.names),e}};At.kind="if";var It=class extends st{};It.kind="for";var $o=class extends It{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Zt(this.iteration,e,r),this}get names(){return Ct(super.names,this.iteration.names)}},vo=class extends It{constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?xe.varKinds.var:this.varKind,{name:n,from:s,to:o}=this;return`for(${r} ${n}=${s}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=Gn(super.names,this.from);return Gn(e,this.to)}},Kn=class extends It{constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Zt(this.iterable,e,r),this}get names(){return Ct(super.names,this.iterable.names)}},Vr=class extends st{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Vr.kind="func";var xr=class extends Mr{render(e){return"return "+super.render(e)}};xr.kind="return";var wo=class extends st{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Ct(e,this.catch.names),this.finally&&Ct(e,this.finally.names),e}},zr=class extends st{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};zr.kind="catch";var Lr=class extends st{render(e){return"finally"+super.render(e)}};Lr.kind="finally";var bo=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
3
|
+
import{ba as cu}from"./chunk-27Q5KW3A.js";import{b as f}from"./chunk-GZPNIYVZ.js";import{d as g,f as oo}from"./chunk-OWGSC52X.js";var Dr=g(U=>{"use strict";f();Object.defineProperty(U,"__esModule",{value:!0});U.regexpCode=U.getEsmExportName=U.getProperty=U.safeStringify=U.stringify=U.strConcat=U.addCodeArg=U.str=U._=U.nil=U._Code=U.Name=U.IDENTIFIER=U._CodeOrName=void 0;var Cr=class{};U._CodeOrName=Cr;U.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var jt=class extends Cr{constructor(e){if(super(),!U.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};U.Name=jt;var Re=class extends Cr{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof jt&&(r[n.str]=(r[n.str]||0)+1),r),{})}};U._Code=Re;U.nil=new Re("");function lu(t,...e){let r=[t[0]],n=0;for(;n<e.length;)io(r,e[n]),r.push(t[++n]);return new Re(r)}U._=lu;var ao=new Re("+");function du(t,...e){let r=[qr(t[0])],n=0;for(;n<e.length;)r.push(ao),io(r,e[n]),r.push(ao,qr(t[++n]));return Ym(r),new Re(r)}U.str=du;function io(t,e){e instanceof Re?t.push(...e._items):e instanceof jt?t.push(e):t.push(eh(e))}U.addCodeArg=io;function Ym(t){let e=1;for(;e<t.length-1;){if(t[e]===ao){let r=Qm(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Qm(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof jt||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof jt))return`"${t}${e.slice(1)}`}function Zm(t,e){return e.emptyStr()?t:t.emptyStr()?e:du`${t}${e}`}U.strConcat=Zm;function eh(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:qr(Array.isArray(t)?t.join(","):t)}function th(t){return new Re(qr(t))}U.stringify=th;function qr(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}U.safeStringify=qr;function rh(t){return typeof t=="string"&&U.IDENTIFIER.test(t)?new Re(`.${t}`):lu`[${t}]`}U.getProperty=rh;function nh(t){if(typeof t=="string"&&U.IDENTIFIER.test(t))return new Re(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}U.getEsmExportName=nh;function sh(t){return new Re(t.toString())}U.regexpCode=sh});var lo=g($e=>{"use strict";f();Object.defineProperty($e,"__esModule",{value:!0});$e.ValueScope=$e.ValueScopeName=$e.Scope=$e.varKinds=$e.UsedValueState=void 0;var ge=Dr(),co=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},zn;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(zn||($e.UsedValueState=zn={}));$e.varKinds={const:new ge.Name("const"),let:new ge.Name("let"),var:new ge.Name("var")};var Ln=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ge.Name?e:this.name(e)}name(e){return new ge.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};$e.Scope=Ln;var Un=class extends ge.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,ge._)`.${new ge.Name(r)}[${n}]`}};$e.ValueScopeName=Un;var oh=(0,ge._)`\n`,uo=class extends Ln{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?oh:ge.nil}}get(){return this._scope}name(e){return new Un(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:o}=s,a=(n=r.key)!==null&&n!==void 0?n:r.ref,i=this._values[o];if(i){let u=i.get(a);if(u)return u}else i=this._values[o]=new Map;i.set(a,s);let c=this._scope[o]||(this._scope[o]=[]),d=c.length;return c[d]=r.ref,s.setValue(r,{property:o,itemIndex:d}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,ge._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let o=ge.nil;for(let a in e){let i=e[a];if(!i)continue;let c=n[a]=n[a]||new Map;i.forEach(d=>{if(c.has(d))return;c.set(d,zn.Started);let u=r(d);if(u){let l=this.opts.es5?$e.varKinds.var:$e.varKinds.const;o=(0,ge._)`${o}${l} ${d} = ${u};${this.opts._n}`}else if(u=s?.(d))o=(0,ge._)`${o}${u}${this.opts._n}`;else throw new co(d);c.set(d,zn.Completed)})}return o}};$e.ValueScope=uo});var O=g(I=>{"use strict";f();Object.defineProperty(I,"__esModule",{value:!0});I.or=I.and=I.not=I.CodeGen=I.operators=I.varKinds=I.ValueScopeName=I.ValueScope=I.Scope=I.Name=I.regexpCode=I.stringify=I.getProperty=I.nil=I.strConcat=I.str=I._=void 0;var V=Dr(),xe=lo(),ft=Dr();Object.defineProperty(I,"_",{enumerable:!0,get:function(){return ft._}});Object.defineProperty(I,"str",{enumerable:!0,get:function(){return ft.str}});Object.defineProperty(I,"strConcat",{enumerable:!0,get:function(){return ft.strConcat}});Object.defineProperty(I,"nil",{enumerable:!0,get:function(){return ft.nil}});Object.defineProperty(I,"getProperty",{enumerable:!0,get:function(){return ft.getProperty}});Object.defineProperty(I,"stringify",{enumerable:!0,get:function(){return ft.stringify}});Object.defineProperty(I,"regexpCode",{enumerable:!0,get:function(){return ft.regexpCode}});Object.defineProperty(I,"Name",{enumerable:!0,get:function(){return ft.Name}});var Hn=lo();Object.defineProperty(I,"Scope",{enumerable:!0,get:function(){return Hn.Scope}});Object.defineProperty(I,"ValueScope",{enumerable:!0,get:function(){return Hn.ValueScope}});Object.defineProperty(I,"ValueScopeName",{enumerable:!0,get:function(){return Hn.ValueScopeName}});Object.defineProperty(I,"varKinds",{enumerable:!0,get:function(){return Hn.varKinds}});I.operators={GT:new V._Code(">"),GTE:new V._Code(">="),LT:new V._Code("<"),LTE:new V._Code("<="),EQ:new V._Code("==="),NEQ:new V._Code("!=="),NOT:new V._Code("!"),OR:new V._Code("||"),AND:new V._Code("&&"),ADD:new V._Code("+")};var nt=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},fo=class extends nt{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?xe.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Zt(this.rhs,e,r)),this}get names(){return this.rhs instanceof V._CodeOrName?this.rhs.names:{}}},Fn=class extends nt{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof V.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Zt(this.rhs,e,r),this}get names(){let e=this.lhs instanceof V.Name?{}:{...this.lhs.names};return Gn(e,this.rhs)}},po=class extends Fn{constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},mo=class extends nt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},ho=class extends nt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},yo=class extends nt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},_o=class extends nt{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Zt(this.code,e,r),this}get names(){return this.code instanceof V._CodeOrName?this.code.names:{}}},Mr=class extends nt{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let o=n[s];o.optimizeNames(e,r)||(ah(e,o.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Ct(e,r.names),{})}},st=class extends Mr{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},go=class extends Mr{},Qt=class extends st{};Qt.kind="else";var At=class t extends st{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Qt(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(fu(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Zt(this.condition,e,r),this}get names(){let e=super.names;return Gn(e,this.condition),this.else&&Ct(e,this.else.names),e}};At.kind="if";var It=class extends st{};It.kind="for";var $o=class extends It{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Zt(this.iteration,e,r),this}get names(){return Ct(super.names,this.iteration.names)}},vo=class extends It{constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?xe.varKinds.var:this.varKind,{name:n,from:s,to:o}=this;return`for(${r} ${n}=${s}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=Gn(super.names,this.from);return Gn(e,this.to)}},Kn=class extends It{constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Zt(this.iterable,e,r),this}get names(){return Ct(super.names,this.iterable.names)}},Vr=class extends st{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Vr.kind="func";var xr=class extends Mr{render(e){return"return "+super.render(e)}};xr.kind="return";var wo=class extends st{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Ct(e,this.catch.names),this.finally&&Ct(e,this.finally.names),e}},zr=class extends st{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};zr.kind="catch";var Lr=class extends st{render(e){return"finally"+super.render(e)}};Lr.kind="finally";var bo=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
4
4
|
`:""},this._extScope=e,this._scope=new xe.Scope({parent:e}),this._nodes=[new go]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,s){let o=this._scope.toName(r);return n!==void 0&&s&&(this._constants[o.str]=n),this._leafNode(new fo(e,o,n)),o}const(e,r,n){return this._def(xe.varKinds.const,e,r,n)}let(e,r,n){return this._def(xe.varKinds.let,e,r,n)}var(e,r,n){return this._def(xe.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Fn(e,r,n))}add(e,r){return this._leafNode(new po(e,I.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==V.nil&&this._leafNode(new _o(e)),this}object(...e){let r=["{"];for(let[n,s]of e)r.length>1&&r.push(","),r.push(n),(n!==s||this.opts.es5)&&(r.push(":"),(0,V.addCodeArg)(r,s));return r.push("}"),new V._Code(r)}if(e,r,n){if(this._blockNode(new At(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new At(e))}else(){return this._elseNode(new Qt)}endIf(){return this._endBlockNode(At,Qt)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new $o(e),r)}forRange(e,r,n,s,o=this.opts.es5?xe.varKinds.var:xe.varKinds.let){let a=this._scope.toName(e);return this._for(new vo(o,a,r,n),()=>s(a))}forOf(e,r,n,s=xe.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let a=r instanceof V.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,V._)`${a}.length`,i=>{this.var(o,(0,V._)`${a}[${i}]`),n(o)})}return this._for(new Kn("of",s,o,r),()=>n(o))}forIn(e,r,n,s=this.opts.es5?xe.varKinds.var:xe.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,V._)`Object.keys(${r})`,n);let o=this._scope.toName(e);return this._for(new Kn("in",s,o,r),()=>n(o))}endFor(){return this._endBlockNode(It)}label(e){return this._leafNode(new mo(e))}break(e){return this._leafNode(new ho(e))}return(e){let r=new xr;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(xr)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new wo;if(this._blockNode(s),this.code(e),r){let o=this.name("e");this._currNode=s.catch=new zr(o),r(o)}return n&&(this._currNode=s.finally=new Lr,this.code(n)),this._endBlockNode(zr,Lr)}throw(e){return this._leafNode(new yo(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=V.nil,n,s){return this._blockNode(new Vr(e,r,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(Vr)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof At))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};I.CodeGen=bo;function Ct(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Gn(t,e){return e instanceof V._CodeOrName?Ct(t,e.names):t}function Zt(t,e,r){if(t instanceof V.Name)return n(t);if(!s(t))return t;return new V._Code(t._items.reduce((o,a)=>(a instanceof V.Name&&(a=n(a)),a instanceof V._Code?o.push(...a._items):o.push(a),o),[]));function n(o){let a=r[o.str];return a===void 0||e[o.str]!==1?o:(delete e[o.str],a)}function s(o){return o instanceof V._Code&&o._items.some(a=>a instanceof V.Name&&e[a.str]===1&&r[a.str]!==void 0)}}function ah(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function fu(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,V._)`!${Eo(t)}`}I.not=fu;var ih=pu(I.operators.AND);function ch(...t){return t.reduce(ih)}I.and=ch;var uh=pu(I.operators.OR);function lh(...t){return t.reduce(uh)}I.or=lh;function pu(t){return(e,r)=>e===V.nil?r:r===V.nil?e:(0,V._)`${Eo(e)} ${t} ${Eo(r)}`}function Eo(t){return t instanceof V.Name?t:(0,V._)`(${t})`}});var M=g(q=>{"use strict";f();Object.defineProperty(q,"__esModule",{value:!0});q.checkStrictMode=q.getErrorPath=q.Type=q.useFunc=q.setEvaluated=q.evaluatedPropsToName=q.mergeEvaluated=q.eachItem=q.unescapeJsonPointer=q.escapeJsonPointer=q.escapeFragment=q.unescapeFragment=q.schemaRefOrVal=q.schemaHasRulesButRef=q.schemaHasRules=q.checkUnknownRules=q.alwaysValidSchema=q.toHash=void 0;var W=O(),dh=Dr();function fh(t){let e={};for(let r of t)e[r]=!0;return e}q.toHash=fh;function ph(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(yu(t,e),!_u(e,t.self.RULES.all))}q.alwaysValidSchema=ph;function yu(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let o in e)s[o]||vu(t,`unknown keyword: "${o}"`)}q.checkUnknownRules=yu;function _u(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}q.schemaHasRules=_u;function mh(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}q.schemaHasRulesButRef=mh;function hh({topSchemaRef:t,schemaPath:e},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,W._)`${r}`}return(0,W._)`${t}${e}${(0,W.getProperty)(n)}`}q.schemaRefOrVal=hh;function yh(t){return gu(decodeURIComponent(t))}q.unescapeFragment=yh;function _h(t){return encodeURIComponent(Po(t))}q.escapeFragment=_h;function Po(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}q.escapeJsonPointer=Po;function gu(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}q.unescapeJsonPointer=gu;function gh(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}q.eachItem=gh;function mu({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(s,o,a,i)=>{let c=a===void 0?o:a instanceof W.Name?(o instanceof W.Name?t(s,o,a):e(s,o,a),a):o instanceof W.Name?(e(s,a,o),o):r(o,a);return i===W.Name&&!(c instanceof W.Name)?n(s,c):c}}q.mergeEvaluated={props:mu({mergeNames:(t,e,r)=>t.if((0,W._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,W._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,W._)`${r} || {}`).code((0,W._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,W._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,W._)`${r} || {}`),To(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:$u}),items:mu({mergeNames:(t,e,r)=>t.if((0,W._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,W._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,W._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,W._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function $u(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,W._)`{}`);return e!==void 0&&To(t,r,e),r}q.evaluatedPropsToName=$u;function To(t,e,r){Object.keys(r).forEach(n=>t.assign((0,W._)`${e}${(0,W.getProperty)(n)}`,!0))}q.setEvaluated=To;var hu={};function $h(t,e){return t.scopeValue("func",{ref:e,code:hu[e.code]||(hu[e.code]=new dh._Code(e.code))})}q.useFunc=$h;var So;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(So||(q.Type=So={}));function vh(t,e,r){if(t instanceof W.Name){let n=e===So.Num;return r?n?(0,W._)`"[" + ${t} + "]"`:(0,W._)`"['" + ${t} + "']"`:n?(0,W._)`"/" + ${t}`:(0,W._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,W.getProperty)(t).toString():"/"+Po(t)}q.getErrorPath=vh;function vu(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}q.checkStrictMode=vu});var Oe=g(ko=>{"use strict";f();Object.defineProperty(ko,"__esModule",{value:!0});var ce=O(),wh={data:new ce.Name("data"),valCxt:new ce.Name("valCxt"),instancePath:new ce.Name("instancePath"),parentData:new ce.Name("parentData"),parentDataProperty:new ce.Name("parentDataProperty"),rootData:new ce.Name("rootData"),dynamicAnchors:new ce.Name("dynamicAnchors"),vErrors:new ce.Name("vErrors"),errors:new ce.Name("errors"),this:new ce.Name("this"),self:new ce.Name("self"),scope:new ce.Name("scope"),json:new ce.Name("json"),jsonPos:new ce.Name("jsonPos"),jsonLen:new ce.Name("jsonLen"),jsonPart:new ce.Name("jsonPart")};ko.default=wh});var Ur=g(ue=>{"use strict";f();Object.defineProperty(ue,"__esModule",{value:!0});ue.extendErrors=ue.resetErrorsCount=ue.reportExtraError=ue.reportError=ue.keyword$DataError=ue.keywordError=void 0;var z=O(),Wn=M(),me=Oe();ue.keywordError={message:({keyword:t})=>(0,z.str)`must pass "${t}" keyword validation`};ue.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,z.str)`"${t}" keyword must be ${e} ($data)`:(0,z.str)`"${t}" keyword is invalid ($data)`};function bh(t,e=ue.keywordError,r,n){let{it:s}=t,{gen:o,compositeRule:a,allErrors:i}=s,c=Eu(t,e,r);n??(a||i)?wu(o,c):bu(s,(0,z._)`[${c}]`)}ue.reportError=bh;function Eh(t,e=ue.keywordError,r){let{it:n}=t,{gen:s,compositeRule:o,allErrors:a}=n,i=Eu(t,e,r);wu(s,i),o||a||bu(n,me.default.vErrors)}ue.reportExtraError=Eh;function Sh(t,e){t.assign(me.default.errors,e),t.if((0,z._)`${me.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,z._)`${me.default.vErrors}.length`,e),()=>t.assign(me.default.vErrors,null)))}ue.resetErrorsCount=Sh;function Ph({gen:t,keyword:e,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw new Error("ajv implementation error");let a=t.name("err");t.forRange("i",s,me.default.errors,i=>{t.const(a,(0,z._)`${me.default.vErrors}[${i}]`),t.if((0,z._)`${a}.instancePath === undefined`,()=>t.assign((0,z._)`${a}.instancePath`,(0,z.strConcat)(me.default.instancePath,o.errorPath))),t.assign((0,z._)`${a}.schemaPath`,(0,z.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,z._)`${a}.schema`,r),t.assign((0,z._)`${a}.data`,n))})}ue.extendErrors=Ph;function wu(t,e){let r=t.const("err",e);t.if((0,z._)`${me.default.vErrors} === null`,()=>t.assign(me.default.vErrors,(0,z._)`[${r}]`),(0,z._)`${me.default.vErrors}.push(${r})`),t.code((0,z._)`${me.default.errors}++`)}function bu(t,e){let{gen:r,validateName:n,schemaEnv:s}=t;s.$async?r.throw((0,z._)`new ${t.ValidationError}(${e})`):(r.assign((0,z._)`${n}.errors`,e),r.return(!1))}var qt={keyword:new z.Name("keyword"),schemaPath:new z.Name("schemaPath"),params:new z.Name("params"),propertyName:new z.Name("propertyName"),message:new z.Name("message"),schema:new z.Name("schema"),parentSchema:new z.Name("parentSchema")};function Eu(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,z._)`{}`:Th(t,e,r)}function Th(t,e,r={}){let{gen:n,it:s}=t,o=[kh(s,r),Rh(t,r)];return Oh(t,e,o),n.object(...o)}function kh({errorPath:t},{instancePath:e}){let r=e?(0,z.str)`${t}${(0,Wn.getErrorPath)(e,Wn.Type.Str)}`:t;return[me.default.instancePath,(0,z.strConcat)(me.default.instancePath,r)]}function Rh({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let s=n?e:(0,z.str)`${e}/${t}`;return r&&(s=(0,z.str)`${s}${(0,Wn.getErrorPath)(r,Wn.Type.Str)}`),[qt.schemaPath,s]}function Oh(t,{params:e,message:r},n){let{keyword:s,data:o,schemaValue:a,it:i}=t,{opts:c,propertyName:d,topSchemaRef:u,schemaPath:l}=i;n.push([qt.keyword,s],[qt.params,typeof e=="function"?e(t):e||(0,z._)`{}`]),c.messages&&n.push([qt.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([qt.schema,a],[qt.parentSchema,(0,z._)`${u}${l}`],[me.default.data,o]),d&&n.push([qt.propertyName,d])}});var Pu=g(er=>{"use strict";f();Object.defineProperty(er,"__esModule",{value:!0});er.boolOrEmptySchema=er.topBoolOrEmptySchema=void 0;var Nh=Ur(),jh=O(),Ah=Oe(),Ih={message:"boolean schema is false"};function Ch(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Su(t,!1):typeof r=="object"&&r.$async===!0?e.return(Ah.default.data):(e.assign((0,jh._)`${n}.errors`,null),e.return(!0))}er.topBoolOrEmptySchema=Ch;function qh(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Su(t)):r.var(e,!0)}er.boolOrEmptySchema=qh;function Su(t,e){let{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,Nh.reportError)(s,Ih,void 0,e)}});var Ro=g(tr=>{"use strict";f();Object.defineProperty(tr,"__esModule",{value:!0});tr.getRules=tr.isJSONType=void 0;var Dh=["string","number","integer","boolean","null","object","array"],Mh=new Set(Dh);function Vh(t){return typeof t=="string"&&Mh.has(t)}tr.isJSONType=Vh;function xh(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}tr.getRules=xh});var Oo=g(pt=>{"use strict";f();Object.defineProperty(pt,"__esModule",{value:!0});pt.shouldUseRule=pt.shouldUseGroup=pt.schemaHasRulesForType=void 0;function zh({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Tu(t,n)}pt.schemaHasRulesForType=zh;function Tu(t,e){return e.rules.some(r=>ku(t,r))}pt.shouldUseGroup=Tu;function ku(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}pt.shouldUseRule=ku});var Fr=g(le=>{"use strict";f();Object.defineProperty(le,"__esModule",{value:!0});le.reportTypeError=le.checkDataTypes=le.checkDataType=le.coerceAndCheckDataType=le.getJSONTypes=le.getSchemaTypes=le.DataType=void 0;var Lh=Ro(),Uh=Oo(),Fh=Ur(),N=O(),Ru=M(),rr;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(rr||(le.DataType=rr={}));function Kh(t){let e=Ou(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}le.getSchemaTypes=Kh;function Ou(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(Lh.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}le.getJSONTypes=Ou;function Gh(t,e){let{gen:r,data:n,opts:s}=t,o=Hh(e,s.coerceTypes),a=e.length>0&&!(o.length===0&&e.length===1&&(0,Uh.schemaHasRulesForType)(t,e[0]));if(a){let i=jo(e,n,s.strictNumbers,rr.Wrong);r.if(i,()=>{o.length?Wh(t,e,o):Ao(t)})}return a}le.coerceAndCheckDataType=Gh;var Nu=new Set(["string","number","integer","boolean","null"]);function Hh(t,e){return e?t.filter(r=>Nu.has(r)||e==="array"&&r==="array"):[]}function Wh(t,e,r){let{gen:n,data:s,opts:o}=t,a=n.let("dataType",(0,N._)`typeof ${s}`),i=n.let("coerced",(0,N._)`undefined`);o.coerceTypes==="array"&&n.if((0,N._)`${a} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,N._)`${s}[0]`).assign(a,(0,N._)`typeof ${s}`).if(jo(e,s,o.strictNumbers),()=>n.assign(i,s))),n.if((0,N._)`${i} !== undefined`);for(let d of r)(Nu.has(d)||d==="array"&&o.coerceTypes==="array")&&c(d);n.else(),Ao(t),n.endIf(),n.if((0,N._)`${i} !== undefined`,()=>{n.assign(s,i),Jh(t,i)});function c(d){switch(d){case"string":n.elseIf((0,N._)`${a} == "number" || ${a} == "boolean"`).assign(i,(0,N._)`"" + ${s}`).elseIf((0,N._)`${s} === null`).assign(i,(0,N._)`""`);return;case"number":n.elseIf((0,N._)`${a} == "boolean" || ${s} === null
|
|
5
5
|
|| (${a} == "string" && ${s} && ${s} == +${s})`).assign(i,(0,N._)`+${s}`);return;case"integer":n.elseIf((0,N._)`${a} === "boolean" || ${s} === null
|
|
6
6
|
|| (${a} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(i,(0,N._)`+${s}`);return;case"boolean":n.elseIf((0,N._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(i,!1).elseIf((0,N._)`${s} === "true" || ${s} === 1`).assign(i,!0);return;case"null":n.elseIf((0,N._)`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(i,null);return;case"array":n.elseIf((0,N._)`${a} === "string" || ${a} === "number"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{e as l}from"./chunk-
|
|
3
|
+
import{e as l}from"./chunk-LUNDTQ3G.js";import{Q as a,ba as e}from"./chunk-27Q5KW3A.js";import{b as n}from"./chunk-GZPNIYVZ.js";n();import*as i from"node:fs";import{randomUUID as d}from"node:crypto";import*as s from"node:path";var m=e("INSTALLATION"),o=class{getInstallationIdPath(){return a.getInstallationIdPath()}readInstallationIdFromFile(){let t=this.getInstallationIdPath();return i.existsSync(t)&&i.readFileSync(t,"utf-8").trim()||null}writeInstallationIdToFile(t){let r=this.getInstallationIdPath(),I=s.dirname(r);i.mkdirSync(I,{recursive:!0}),l(r,t,{encoding:"utf-8"})}getInstallationId(){try{let t=this.readInstallationIdFromFile();return t||(t=d(),this.writeInstallationIdToFile(t)),t}catch(t){return m.error("Error accessing installation ID file, generating ephemeral ID:",t),"123456789"}}};export{o as a};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2025 Google LLC
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{w as i}from"./chunk-
|
|
3
|
+
import{w as i}from"./chunk-PGXQZVLX.js";import{b as o}from"./chunk-GZPNIYVZ.js";o();import l from"node:path";function d(t,n){if(t.getApprovalMode()!=="bogan")return null;let r=l.resolve(n),s=t.getProjectRoot?.()??t.getTargetDir();if(i(r,s))return null;let e=t.getWorkspaceContext?.();if(!e||(typeof e.isPathWithinWorkspaceFresh=="function"?e.isPathWithinWorkspaceFresh(r):e.isPathWithinWorkspace(r)))return null;let a=e.getDirectories?.()??[t.getTargetDir()],p=t.getChannel?.()==="desktop"?"Approve the folder from Matilda Desktop, then retry the write.":"Use --include-directories to add extra roots, or a non-BOGAN approval mode for intentional external writes.";return`Refusing out-of-workspace write in BOGAN mode: ${r}. Workspace root(s): ${a.join(", ")}. This blocks path typos (e.g. writing under $HOME when the project is elsewhere). `+p}export{d as a};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2025 Matilda Team
|