supercolony 0.1.3 → 0.1.5

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # colony
2
2
 
3
- Interactive payments offer two choices: **official fee + 10% optional support** (highlighted first), or **Original price**. The message is “Help us make Colony better.” Final payment confirmation still defaults to Cancel. For a 0.5 IMD task, the support option totals 0.55 IMD before network fees. The payment card shows the official fee and, for currency conversion, the actual price, maximum debit and network fee cap. Swap slippage is calculated automatically: 0.75%–5% on Ethereum and 0.75% on Robinhood. Authorization covers only the reviewed maximum; slippage is never increased after confirmation.
3
+ Interactive payments offer two choices: **official fee + 10% optional support** (highlighted first), or **Original price**. The message is “Help us make Colony better.” Final payment confirmation still defaults to Cancel. For a 0.5 IMD task, the support option totals 0.55 IMD before network fees. The payment card shows the official fee, the coin and network it pays with, the payment amount and, separately, the gas (network fee) cap paid in ETH. Swap slippage is calculated automatically: 0.75%–5% on Ethereum and 0.75% on Robinhood. Authorization covers only the reviewed maximum; slippage is never increased after confirmation.
4
4
 
5
5
  Support goes to the public address in `src/lib/support-recipient.mjs` on the selected payment network. The private key is never distributed with Colony. Support is a separate IMD transfer sent before task payment; it is not refunded if task admission fails. The review shows the support amount, total and recipient. Signed transfers are saved before broadcast and reused on recovery. Non-interactive commands and `--yes` use the original price without adding support.
6
6
 
@@ -25,13 +25,12 @@ colony --ascii
25
25
 
26
26
  The dashboard has **My tasks**, **Explore**, **Workers** and **Wallets** at the top. Wide terminals show a list and details side by side; below 100 columns, Enter opens details and Esc returns to the list. Use an interactive terminal at least 40 columns by 20 rows. `--ascii` uses ordinary ASCII borders. Special fonts, WSL and a browser are not required.
27
27
 
28
- Panel actions stay visible along the bottom of their frame. Task lists contain New task, Search and Refresh; My tasks also has Filter. The Workers list contains Add target, Search and Refresh, while the selected worker's actions stay in its details pane. Wallet actions and Refresh belong to the selected wallet; New, Import and network settings remain in Wallet management. Selection and Enter/Tab hints stay in the list; return, scrolling and detail-tab hints stay in the details pane. Shortcuts wrap as whole entries on narrow terminals. The screen footer contains only global Help and Quit; during input, confirmation or an operation, it shows Ctrl+C to exit.
28
+ Panel actions stay visible along the bottom of their frame. Task lists contain New task, Search and Refresh; My tasks also has Filter. The Workers list contains Add target, Search and Refresh, while the selected worker's actions stay in its details pane. Wallet actions and Refresh belong to the selected wallet; New, Import, Manage and Receive funds remain in Wallet management. Selection and Enter/Tab hints stay in the list; return, scrolling and detail-tab hints stay in the details pane. Shortcuts wrap as whole entries on narrow terminals. The screen footer contains only global Help and Quit; during input, confirmation or an operation, it shows Ctrl+C to exit.
29
29
 
30
30
  | Key | Action |
31
31
  | --- | --- |
32
32
  | `1`–`4` | Switch workspace |
33
33
  | `n` | Describe a task, then review its official fee |
34
- | Up / Down in the task form | Switch payment coin |
35
34
  | Up / Down, Enter, Esc | Select, open, return |
36
35
  | `/`, `f`, `r` | Search, cycle My tasks filters, refresh |
37
36
  | Tab, `[` / `]`, Page Up / Down | Focus list/details, switch detail tab, scroll |
@@ -42,11 +41,10 @@ Panel actions stay visible along the bottom of their frame. Task lists contain N
42
41
  | `n`, `i`, `m` in Wallets | Create wallet, import a private key or backup, selected wallet actions |
43
42
  | `u`, `g` in Wallets | Use the selected wallet, manage all wallets |
44
43
  | `d`, `b` in Wallets | Receive funds / QR code, back up encrypted wallet |
45
- | `p` in Wallets | Choose Ethereum or Robinhood Chain for new payments |
46
44
  | Down at the end of Explore, `l` | Automatically load older tasks; `l` also loads/retries manually |
47
45
  | `e`, `?`, `q` | Full error, keyboard help, quit |
48
46
 
49
- Form fields use Enter to advance/submit and Tab to switch fields. A new task asks only for your request, then uses the local planner and the existing IMD payment/order workflow. The payment card shows the official admission fee; confirmation defaults to **Cancel**. Currency conversion also shows the maximum debit and network fee cap. Tab selects the payment action, Enter confirms, and Esc returns to editing without signing. `--yes` never bypasses this dashboard confirmation. `i` reveals the payment network, asset, recipient and server-prepared input. Task admission does not guarantee completion. Wallet authorization transactions can incur separate gas fees.
47
+ Form fields use Enter to advance/submit and Tab to switch fields. A new task asks only for your request, then uses the local planner and the existing IMD payment/order workflow. You never pick a network up front. Colony checks Ethereum and Robinhood Chain together and picks a coin and network with enough balance (IMD first, then stablecoins, then ETH; the lower-gas network wins ties). The payment card shows the official admission fee, "Pay with <coin> on <network>", the payment amount and the gas (network fee) cap separately; confirmation defaults to **Cancel**. **Change payment** lists the other funded options with their amounts. If no option has enough funds, the card lists both networks side by side, for example "0.5 IMD or ≈ 2.01 USDC or ≈ 0.0006 ETH" plus gas, and suggests the smallest top-up. **Add funds** first asks which network you will send on, then shows that network's address, QR code and amounts. Tab selects the payment action, Enter confirms, and Esc returns to editing without signing. `--yes` never bypasses this dashboard confirmation. `i` reveals the payment network, asset, recipient and server-prepared input. Task admission does not guarantee completion. Wallet authorization transactions can incur separate gas fees.
50
48
 
51
49
  Explore shows the server's actual task total and refreshes in the background every 30 seconds. New tasks appear at the top, changed states update in place, and the selected task, loaded history and detail scroll position are preserved. Refreshing pauses during forms, payment confirmation and worker operations. Read errors are visible and the next scheduled refresh retries. Reaching the end of the loaded list automatically appends older tasks. Loading, errors and the end of history are visible; search results show the loaded count until all matches have been fetched because the API does not provide a search total. `r` reloads the latest list and resets loaded history.
52
50
 
@@ -78,6 +76,10 @@ First-time preparation names **Qwen** (about 533 MB) and explains its purpose: u
78
76
 
79
77
  Before a paid task loads the local LLM or requests an order, Colony checks the selected wallet, payment coin and ETH network fee allowance using the current IMD price and live exchange quotes. If funds are insufficient, the dashboard shows the receiving address and network with **Check balance & continue**. The entered task is kept. This read-only check needs no wallet password; the final review includes the exact quote and any optional support. `--dry-run` remains available without a wallet. Startup tips explain natural-language tasks, automatic task settings, local inference and payment review.
80
78
 
79
+ The dashboard saves your request as a local **Draft** before checking the wallet or downloading the LLM. If no wallet exists, choose **Open Wallets** to create/import one, or return to My tasks. Drafts survive restarts; select one and press `o` to continue editing and publishing. Task actions also let you delete an unwanted draft. Once an order is saved, it takes over the same local request ID and replaces the draft in My tasks.
80
+
81
+ When the balance is insufficient, choose **Add funds** to open the receiving QR code for that payment's wallet and network. Press Esc to return to the same balance prompt, then **Check balance & continue** after depositing. Saving the QR with `s` is also available. Your request and completed payment steps are kept; balances, exchange rates and fees are checked again before the payment review.
82
+
81
83
  ## 安装
82
84
 
83
85
  需要 Node.js 22+,Windows、Linux 和 macOS 使用相同安装命令。npm 包名为 `supercolony`:
@@ -127,8 +129,8 @@ npm publish
127
129
  --api <url> IMD API,默认 COLONY_API_URL 或 https://api.imd.fun
128
130
  --home <dir> 本地状态目录,默认 COLONY_HOME 或 ~/.super-colony
129
131
  --rpc <url> 可选自定义 RPC,也可用 COLONY_RPC_URL;两条付款链已内置默认节点
130
- --payment-chain <network> 可选单次指定 ethereum 或 robinhood;默认使用钱包中保存的选择
131
- --pay-with <coin> 付款币种 IMD / ETH / USDT / USDC / USDG,默认 IMD
132
+ --payment-chain <network> 可选,只在 ethereum 或 robinhood 上付款;默认按余额自动选择
133
+ --pay-with <coin> 可选,只用 IMD / ETH / USDT / USDC / USDG 付款;默认按余额自动选择
132
134
  --key-env <name> 可选脚本用私钥环境变量;没有本地钱包时使用,默认 COLONY_PRIVATE_KEY
133
135
  --json 只向 stdout 输出一份 JSON;提示/日志走 stderr
134
136
  --yes 跳过交互确认(脚本用)
@@ -213,6 +215,8 @@ colony task create --file examples/research-job.json
213
215
 
214
216
  流程:
215
217
 
218
+ 正式创建和续作任务时,Colony 会在任务描述末尾单独添加 `(Submitted via Supercolony)`。原始输入用于本地编辑和恢复,提交内容在报价前固定保存;重试和报价续期不会重复添加署名,已保存的旧订单保持原提交内容。
219
+
216
220
  1. 先以公开地址检查余额和 gas;自然语言输入随后由本地模型选择任务参数。`POST /requests/check` 有 blocker 立即停止;
217
221
  2. 生成并保存 `requestToken` 和 `requestKey`,再 `POST /requests/quote`;
218
222
  3. `POST /requests/:id/submit` 取得真实 402 challenge;
@@ -279,6 +283,8 @@ colony task continue <jobId> --request-key <requestKey>
279
283
 
280
284
  私钥和密码均隐藏输入,不必配置环境变量。钱包采用标准 Ethereum V3 JSON Keystore:首个钱包保存在 `$COLONY_HOME/wallet.json`,其他钱包保存在 `$COLONY_HOME/wallets/<address>.json`;已有首个钱包无需移动或改写,其密码就是本地统一密码。`wallet-selection.json` 仅记录当前公开地址。界面不显示锁定状态,也无需手动解锁。只有付款、授权、新增或导入等需要使用密码的操作才会询问;本次运行中已输入的密码可复用,付款仍需确认金额。浏览、查余额、收款和加密备份不需要密码。退出仪表盘清除当前进程内的密码和签名账户缓存,密码不以明文保存在磁盘。
281
285
 
286
+ 在所选本地钱包的 `m` → **Delete wallet** 中可删除钱包。两次确认均显示完整地址并默认保留;完成两次确认后删除本机加密私钥。链上资金、已导出的备份和任务记录保留。删除当前钱包会选择另一个本地钱包,删除最后一个后可重新创建或导入;其他钱包仍使用原来的统一密码。
287
+
282
288
  `d` 展示充值地址和二维码,`s` 可保存 SVG。请在发送方选择页面显示的 Ethereum 或 Robinhood Chain,并留一些 ETH 支付网络费。二维码只含公开地址、不包含私钥或密码,也不会替发送方自动选择网络。余额查询、充值和加密备份不需要解锁。终端太小时会提示扩大窗口或导出二维码,不显示被裁剪的二维码。
283
289
 
284
290
  首次充值前按 `b` 备份所选钱包,并单独保管本地统一密码。每个钱包需要分别备份。恢复需要备份文件和它原来的密码;恢复到已有钱包库时,使用本地统一密码重新加密。恢复到空目录时,备份密码成为本地密码。Colony 无法找回丢失的密码。创建、导入和恢复会添加钱包,不覆盖已有钱包;重复地址提示切换到已保存的钱包。备份和二维码导出也不会覆盖已有文件。
@@ -295,30 +301,28 @@ colony wallet receive --out colony-receive.svg
295
301
  colony wallet backup --out colony-wallet-backup.json
296
302
  colony wallet restore --file colony-wallet-backup.json # 添加并选中恢复的钱包
297
303
  colony wallet address
298
- colony wallet network # 查看当前付款网络
299
- colony wallet network robinhood # 保存为 Robinhood Chain
300
- colony wallet status
304
+ colony wallet status # 同时列出 Ethereum 和 Robinhood Chain 的余额
301
305
  colony wallet approve --amount 0.5
302
- colony task create "Build a website for my coffee shop"
303
-
304
- colony wallet network ethereum # 切回 Ethereum
305
- colony task create "Write a research report" --payment-chain robinhood
306
+ colony task create "Build a website for my coffee shop" # 自动选择网络和币种
307
+ colony task create "Write a research report" --payment-chain robinhood # 只在 Robinhood Chain 付款
306
308
  ```
307
309
 
308
310
  - 本地钱包优先使用,私钥只以加密形式写盘,不上传。`--key-env` 仅保留给没有本地钱包的脚本用法,普通用户无需使用它。密码不接受命令行参数,也不写入订单、日志或终端交接消息。
309
311
  - `wallet approve` 是显式链上交易,只授权指定数量;Ethereum 授权 Permit2,Robinhood 授权真实报价对应的 Intake,**不会默认无限授权**。
310
312
  - CLI 可用 `wallet approve --amount 0.5 --wallet <address>` 明确指定预期地址。确认时显示该地址,签名前若当前钱包已经改变则停止。任务付款也绑定本次流程开始时的钱包,避免另一终端切换钱包后从不同账户付款。
311
- - 支持 Ethereum 与 Robinhood Chain 两条正式付款链,公共 RPC 均已内置。普通用户无需设置 RPC;仪表盘按 `4` → `p` 选择网络,选择会保存在本机,供后续新任务使用。默认 Ethereum,不提供 Sepolia 测试币付款。
312
- - Ethereum 沿用 x402 签名付款;Robinhood 使用同一份 HTTP 订单返回的签名报价,通过 Intake `pay` 结算。任务和续作仍进入同一个“我的任务”列表,恢复原订单时使用其原付款网络。
313
+ - 支持 Ethereum 与 Robinhood Chain 两条正式付款链,公共 RPC 均已内置。普通用户无需设置 RPC,也不需要切换网络:同一个地址在两条链上通用,余额分别计算。每次付款时 Colony 同时查询两条链,自动选一个余额足够的方案(优先直接用 IMD,其次稳定币,再次 ETH;同类中选 gas 更低的网络)。确认卡上的 `Change payment` 可改用其他余额足够的网络或币种。不提供 Sepolia 测试币付款。
314
+ - 付款金额和 gas(网络费)分开显示。gas 总是用同一网络上的 ETH 支付;用 ETH 付款时,付款和 gas 都从 ETH 余额扣。
315
+ - 余额不足时,提示页并排列出两条链各自的价格、每种可用币种的金额(例如 “0.5 IMD 或 ≈ 2.01 USDC 或 ≈ 0.0006 ETH”)、gas 估算和最省事的补足方式。选择 `Add funds` 后先选打算转入的网络,再显示该网络的收款地址、二维码和需要的金额。
316
+ - Ethereum 沿用 x402 签名付款;Robinhood 使用同一份 HTTP 订单返回的签名报价,通过 Intake `pay` 结算。任务和续作仍进入同一个“我的任务”列表。已经签名或广播过的订单恢复时固定使用原付款网络和币种。
313
317
  - 直接用 IMD 支付时,两条链都会检查余额和授权额度;额度不足会在付款确认后自动授权本次所需数量,无需另外运行命令。原价、可选支持和自动换币使用同一付款准备流程。确认卡显示实际网络、价格、最高扣款及 ETH 手续费上限。
314
318
  - Robinhood 的签名交易及其哈希在广播前保存。中断后 `order submit` 先查原订单和交易;需要重发时只广播原字节,不创建新订单、不重新签付款。签过的记录不能本地取消或删除。
315
- - `wallet status` 从 capabilities 读取资产/价格,查询所选网络的付款币种余额及 IMD 支付额度,并校验节点链 id。
319
+ - `wallet status` 从 capabilities 读取资产/价格,同时查询两条链的付款币种余额及 IMD 支付额度,并校验节点链 id。某条链暂时不可用时,只在该链下显示错误。
316
320
  - `--rpc` / `COLONY_RPC_URL` 仅用于显式覆盖默认节点。自定义节点失败或链 id 不符时直接报错;不自动切换到其他节点。付款只支持这两条主网;其他网络的 worker 链上操作需要显式提供 RPC。
317
321
  - 开发/CI 不应执行真实 approve 或 register 交易。
318
322
 
319
323
  ### 自动换币付款
320
324
 
321
- Ethereum 支持 **IMD、ETH、USDT、USDC**;Robinhood Chain 支持 **IMD、ETH、USDG**。创建任务或继续修改时,用 `--pay-with` 选择币种;仪表盘创建表单用上/下方向键切换。
325
+ Ethereum 支持 **IMD、ETH、USDT、USDC**;Robinhood Chain 支持 **IMD、ETH、USDG**。默认自动选择余额足够的币种和网络;CLI 可用 `--pay-with` / `--payment-chain` 限定,仪表盘在确认卡上用 `Change payment` 更换。尚未签名的订单恢复时也可以更换付款方式。
322
326
 
323
327
  ```sh
324
328
  colony task create "Build a website for my coffee shop" --pay-with USDC
@@ -1 +1 @@
1
- import{writeDiagnostic as _0x21ccbf}from'../lib/terminal-text.mjs';import{paymentProgressReporter as _0x47f5e4}from'../lib/payment-progress.mjs';import{request as _0x25f307,print as _0x5afad3}from'../shared.mjs';function _0x358c(){const _0x5769d0=['\x20--refresh','length','option','retry','count','stringify','paidBy','files','source:\x20\x20\x20\x20','toFixed','saved\x20input:\x20','challenge','runnable\x20skill\x20id','--limit\x20<n>','input','updated:\x20\x20\x20','--exclude-oracle','--github','before','--commit\x20<sha>','statusUrl','github','skill','only\x20run\x20the\x20free\x20check\x20and\x20print\x20the\x20input','\x20tx\x20','Your\x20request\x20is\x20saved.\x20Continue\x20payment\x20to\x20check\x20the\x20original\x20payment\x20before\x20retrying.','s\x20(retry\x20','source','reuse\x20a\x20saved\x20order\x20request\x20key','explorerUrl','payment_failed','head','blocked','kind','browse\x20and\x20publish\x20IMD\x20tasks','requestKey','--before\x20<time>','transactionHash','\x20was\x20created\x20for\x20action\x20','\x20\x20\x20\x20hash:\x20','\x20versions=','optsWithGlobals','refusalProblems','deliverables','--path\x20<path>','trim','payTo','exclude','repo','complete:\x20\x20','show\x20<id>','prepared\x20input:','paid\x20by:\x20\x20\x20','excludeOracle','payWith','json','--file\x20<path>','result','--since\x20<time>','path','list\x20jobs','validate\x20a\x20job\x20body\x20without\x20creating\x20an\x20order','reviews','order\x20ended\x20with\x20status:\x20','\x20head=','string','mediaType','file','submissionHash','Payment\x20needs\x20review.','launch:\x20\x20\x20\x20','show\x20one\x20job','requiredOption','list','project:\x20\x20\x20','resultUrl','request\x20key\x20','status:\x20\x20\x20\x20','delivery','exitCode','home','stdin','create\x20[objective]','rpc','result\x20response\x20is\x20missing\x20jobId','jobs','--out\x20<dir>','jobs\x20response\x20is\x20missing\x20jobs','action\x20to\x20check\x20(defaults\x20from\x20parentJobId)','payer','asset','since','template:\x20\x20','paymentChain','attempt','check,\x20quote,\x20sign\x20and\x20submit\x20a\x20job\x20file','--action\x20<action>','\x20->\x20','hash','code','named\x20input\x20preset\x20(report)','node','save','reason','limit','parent:\x20\x20\x20\x20','summary','detail','base\x20commit\x20for\x20--repo','answer','isArray','interrupted','wait\x20<id>','\x20version(s))','\x20(poll\x20','updatedAt','commit','data','elapsedMs','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20500','join','url','order\x20','\x20verdict=','Network\x20error','description','yes','download:\x20','job\x20template','title','template','oracle','job:\x20\x20\x20\x20\x20\x20\x20','amount','short','complete','show\x20a\x20job\x20result\x20and\x20artifact\x20URLs','/jobs/','expired','versions','status','resultUrl:\x20','summary:\x20','check:\x20\x20\x20\x20\x20','poll\x20interval\x20in\x20seconds','completed','blockers:\x20','\x20belongs\x20to\x20parent\x20job\x20','project\x20ready','transaction','questions','job.open','outcome','payment:\x20','publish',';\x20inspect\x20it\x20with\x20colony\x20order\x20show\x20','\x20--home\x20','unknown','\x20blocker(s)','retries','result\x20<id>','check:\x20','toString','complete\x20continuation\x20body\x20JSON\x20file','/result','complete\x20job\x20body\x20JSON\x20file','input:','page\x20size\x20(1-500)','blockers','payment_reconciling','isTTY','keyEnv',',\x20not\x20','objective','download\x20a\x20completed\x20job\x27s\x20files\x20under\x20--out','padEnd','objective:\x20','wait:\x20','workflow','slice',';\x20retrying\x20in\x20','--template\x20<name>','--preset\x20<name>','ethereum','jobs\x20that\x20moved\x20after\x20this\x20time','delivery:\x20\x20','save\x20the\x20input\x20JSON\x20without\x20overwriting','action','--answer\x20<text>','quote','push','task','\x20task\x20continue\x20','api','command','verdict','exclude\x20oracle\x20panel\x20jobs','dryRun','--request-key\x20<uuid>','delayMs','s)\x0a','pendingTransaction','poll','none','poll\x20a\x20job\x20result\x20until\x20it\x20completes,\x20fails\x20or\x20times\x20out','repository\x20path\x20the\x20job\x20may\x20write\x20(repeatable)','check','\x0aquestions:\x0a','\x20\x20\x20\x20url:\x20\x20','saved','launch','\x20--request-key\x20','\x20\x20-\x20','--repo\x20<url>','set','\x20\x20-\x20none','interval','plan','wait:\x20interrupted\x0a','state','colony\x20--api\x20','destination\x20directory','refused','--save\x20<path>','isInteger','--dry-run','bytes','project','paymentStatus','statusUrl:\x20','\x20was\x20created\x20for\x20a\x20different\x20objective;\x20omit\x20the\x20new\x20objective\x20to\x20resume\x20it','nodes','type','transaction:\x20','parent','files:\x20\x20\x20\x20\x20','tx:\x20\x20\x20\x20\x20\x20\x20\x20','message','state:\x20\x20\x20\x20\x20','reviews:\x20\x20\x20','job\x20response\x20is\x20missing\x20id','parentJobId','job\x20body\x20JSON\x20file','expiresAt','orderId','job.continue','objective\x20or\x20job\x20id\x20prefix','--interval\x20<seconds>','preset','workflow:\x20\x20',';\x20rerun\x20with\x20--api\x20','jobId','create\x20a\x20job\x20from\x20a\x20clear\x20objective\x20or\x20a\x20JSON\x20file'];_0x358c=function(){return _0x5769d0;};return _0x358c();}import{checkJob as _0x51329e,publishJob as _0xe17452,readJobFile as _0xf06f7d}from'../lib/publish.mjs';import{loadOrder as _0x5e9534}from'../lib/orders.mjs';import{buildContinueInput as _0x5bd41a,buildCreateInput as _0x191f76,parentSummary as _0x180a5a,resolveAction as _0x35cbad,saveInputFile as _0x17d4ce}from'../lib/task-input.mjs';import{DEFAULT_INTERVAL_SECONDS as _0x531daf,DEFAULT_TIMEOUT_SECONDS as _0x293eeb,downloadTaskFiles as _0x500ece,waitForResult as _0xc012f9}from'../lib/task-result.mjs';import{askQuestions as _0x2a6a3f,loadLocalPlanner as _0x4d9a9e,planTask as _0x1f89a4}from'../planner/flow.mjs';import{registerMyTaskCommands as _0x59d651}from'./my-tasks.mjs';import{orderPayment as _0x228938}from'../lib/payments.mjs';import{checkTaskWallet as _0x1e393c}from'../lib/task-wallet.mjs';function V(_0x31ad26){const _0x4b2f47=_0x9bc3,_0x1cfb09=new URLSearchParams();if(_0x31ad26['q']!==void 0x0&&_0x1cfb09['set']('q',_0x31ad26['q']),_0x31ad26[_0x4b2f47(0x1d2)]!==void 0x0&&_0x1cfb09[_0x4b2f47(0x296)](_0x4b2f47(0x1d2),_0x31ad26['before']),_0x31ad26['since']!==void 0x0&&_0x1cfb09[_0x4b2f47(0x296)]('since',_0x31ad26[_0x4b2f47(0x21b)]),_0x31ad26[_0x4b2f47(0x228)]!==void 0x0){const _0x184d18=Number(_0x31ad26[_0x4b2f47(0x228)]);if(!Number[_0x4b2f47(0x2a0)](_0x184d18)||_0x184d18<0x1||_0x184d18>0x1f4)throw new Error(_0x4b2f47(0x237));_0x1cfb09['set'](_0x4b2f47(0x228),String(_0x184d18));}_0x31ad26[_0x4b2f47(0x1f5)]&&_0x1cfb09[_0x4b2f47(0x296)](_0x4b2f47(0x1ef),_0x4b2f47(0x243));const _0x3c417b=_0x1cfb09[_0x4b2f47(0x262)]();return _0x3c417b?'/jobs?'+_0x3c417b:'/jobs';}function y(_0x4e23a1,_0x32dc0e=0x5a){const _0x20d833=_0x9bc3,_0x5999cd=String(_0x4e23a1??'')['replace'](/\s+/g,'\x20')[_0x20d833(0x1ed)]();return _0x5999cd[_0x20d833(0x1c1)]>_0x32dc0e?_0x5999cd[_0x20d833(0x273)](0x0,_0x32dc0e-0x1)+'…':_0x5999cd;}function X(_0x1b8860){const _0x5e63fe=_0x9bc3;if(!Array[_0x5e63fe(0x22e)](_0x1b8860?.['jobs']))throw new Error(_0x5e63fe(0x217));const _0x19b3f2=[_0x1b8860[_0x5e63fe(0x1c4)]+'\x20job(s)'];for(const _0x4e93fd of _0x1b8860[_0x5e63fe(0x215)])_0x19b3f2['push'](_0x4e93fd['id']+'\x20\x20'+_0x4e93fd[_0x5e63fe(0x29b)][_0x5e63fe(0x26f)](0xa)+'\x20\x20'+String(_0x4e93fd[_0x5e63fe(0x242)]??'')[_0x5e63fe(0x26f)](0x16)+'\x20\x20'+(_0x4e93fd[_0x5e63fe(0x233)]??'')+'\x20\x20'+y(_0x4e93fd[_0x5e63fe(0x26d)]));return _0x19b3f2[_0x5e63fe(0x238)]('\x0a');}function Z(_0xe08137){const _0x5026a4=_0x9bc3;if(!_0xe08137?.['id'])throw new Error(_0x5026a4(0x2b0));const _0x111a0f=['job:\x20\x20\x20\x20\x20\x20\x20'+_0xe08137['id'],_0x5026a4(0x2ae)+_0xe08137[_0x5026a4(0x29b)],_0x5026a4(0x21c)+(_0xe08137[_0x5026a4(0x242)]??''),_0x5026a4(0x270)+y(_0xe08137[_0x5026a4(0x26d)],0x1f4),'created:\x20\x20\x20'+(_0xe08137['createdAt']??''),_0x5026a4(0x1cf)+(_0xe08137[_0x5026a4(0x233)]??''),_0x5026a4(0x1f4)+(_0xe08137[_0x5026a4(0x1c6)]??''),_0x5026a4(0x20a)+(_0xe08137[_0x5026a4(0x2a3)]?_0xe08137[_0x5026a4(0x2a3)]['id']+'\x20('+(_0xe08137[_0x5026a4(0x2a3)][_0x5026a4(0x24b)]?.[_0x5026a4(0x1c1)]??0x0)+_0x5026a4(0x231):_0x5026a4(0x28b)),_0x5026a4(0x279)+(_0xe08137['delivery']?JSON[_0x5026a4(0x1c5)](_0xe08137[_0x5026a4(0x20e)]):_0x5026a4(0x28b)),_0x5026a4(0x206)+(_0xe08137[_0x5026a4(0x292)]?JSON[_0x5026a4(0x1c5)](_0xe08137[_0x5026a4(0x292)]):'none')];if(Array['isArray'](_0xe08137['nodes'])){_0x111a0f[_0x5026a4(0x27e)]('nodes:\x20\x20\x20\x20\x20'+_0xe08137['nodes'][_0x5026a4(0x1c1)]);for(const _0xac8d11 of _0xe08137[_0x5026a4(0x2a7)])_0x111a0f[_0x5026a4(0x27e)](_0x5026a4(0x294)+_0xac8d11['key']+':\x20'+_0xac8d11[_0x5026a4(0x29b)]+'\x20attempt='+_0xac8d11['attempt']+_0x5026a4(0x23b)+(_0xac8d11[_0x5026a4(0x283)]?.[_0x5026a4(0x24c)]??_0x5026a4(0x28b)));}return Array[_0x5026a4(0x22e)](_0xe08137[_0x5026a4(0x1fe)])&&_0x111a0f['push'](_0x5026a4(0x2af)+_0xe08137[_0x5026a4(0x1fe)][_0x5026a4(0x1c1)]),_0xe08137[_0x5026a4(0x272)]?.['id']&&_0x111a0f[_0x5026a4(0x27e)]((_0x5026a4(0x2b9)+_0xe08137['workflow']['id']+'\x20'+(_0xe08137[_0x5026a4(0x272)][_0x5026a4(0x24c)]??''))['trim']()),_0x111a0f['join']('\x0a');}function S(_0x5e8d3f){const _0x7f955a=_0x9bc3;if(!_0x5e8d3f?.[_0x7f955a(0x2bb)])throw new Error(_0x7f955a(0x214));const _0x5454f4=['job:\x20\x20\x20\x20\x20\x20\x20'+_0x5e8d3f['jobId'],_0x7f955a(0x2ae)+_0x5e8d3f[_0x7f955a(0x29b)],_0x7f955a(0x1f1)+_0x5e8d3f['complete']],_0x2fe17c=Array[_0x7f955a(0x22e)](_0x5e8d3f[_0x7f955a(0x1c7)])?_0x5e8d3f[_0x7f955a(0x1c7)]:[];_0x5454f4[_0x7f955a(0x27e)](_0x7f955a(0x2ab)+_0x2fe17c[_0x7f955a(0x1c1)]);for(const _0x55a9de of _0x2fe17c)_0x5454f4[_0x7f955a(0x27e)](_0x7f955a(0x294)+_0x55a9de[_0x7f955a(0x1fb)]+'\x20('+_0x55a9de[_0x7f955a(0x2a2)]+'\x20bytes,\x20'+_0x55a9de[_0x7f955a(0x202)]+')'),_0x5454f4[_0x7f955a(0x27e)](_0x7f955a(0x1e7)+_0x55a9de[_0x7f955a(0x222)]),_0x5454f4['push'](_0x7f955a(0x290)+_0x55a9de[_0x7f955a(0x239)]);const _0x1393e1=Array[_0x7f955a(0x22e)](_0x5e8d3f[_0x7f955a(0x1db)])?_0x5e8d3f[_0x7f955a(0x1db)]:[];_0x5454f4[_0x7f955a(0x27e)](_0x7f955a(0x1c8)+_0x1393e1[_0x7f955a(0x1c1)]);for(const _0x5c46c8 of _0x1393e1)_0x5454f4['push']('\x20\x20-\x20'+(_0x5c46c8[_0x7f955a(0x225)]??_0x5c46c8[_0x7f955a(0x204)])+':\x20'+_0x5c46c8[_0x7f955a(0x239)]);return _0x5e8d3f[_0x7f955a(0x20e)]&&_0x5454f4[_0x7f955a(0x27e)](_0x7f955a(0x279)+JSON['stringify'](_0x5e8d3f[_0x7f955a(0x20e)])),_0x5e8d3f['launch']&&_0x5454f4['push'](_0x7f955a(0x206)+JSON[_0x7f955a(0x1c5)](_0x5e8d3f[_0x7f955a(0x292)])),_0x5454f4[_0x7f955a(0x238)]('\x0a');}function ee(_0x1bc48f){const _0x12ac00=_0x9bc3,_0x156feb=[_0x12ac00(0x244)+_0x1bc48f['jobId'],_0x12ac00(0x2ae)+_0x1bc48f[_0x12ac00(0x29b)],_0x12ac00(0x2ab)+_0x1bc48f['files']['length']];for(const _0x466e7e of _0x1bc48f[_0x12ac00(0x1c7)])_0x156feb[_0x12ac00(0x27e)](_0x12ac00(0x294)+_0x466e7e[_0x12ac00(0x1fb)]+_0x12ac00(0x221)+_0x466e7e[_0x12ac00(0x203)]+'\x20('+_0x466e7e[_0x12ac00(0x2a2)]+'\x20bytes)'),_0x156feb[_0x12ac00(0x27e)](_0x12ac00(0x1e7)+_0x466e7e[_0x12ac00(0x222)]);return _0x156feb[_0x12ac00(0x238)]('\x0a');}function x(_0x380ca6){const _0x1d21f4=_0x9bc3,_0x1b8480=[_0x1d21f4(0x252)+_0x380ca6[_0x1d21f4(0x268)][_0x1d21f4(0x1c1)]];for(const _0x313fc7 of _0x380ca6[_0x1d21f4(0x268)])_0x1b8480[_0x1d21f4(0x27e)]('\x20\x20-\x20'+_0x313fc7['code']+':\x20'+_0x313fc7['detail']);const _0x2e64f7=Array['isArray'](_0x380ca6[_0x1d21f4(0x299)])?_0x380ca6[_0x1d21f4(0x299)]:[];_0x1b8480[_0x1d21f4(0x27e)]('plan:\x20'+_0x2e64f7['length']);for(const _0x17afd2 of _0x2e64f7)_0x1b8480[_0x1d21f4(0x27e)](_0x1d21f4(0x294)+(_0x17afd2[_0x1d21f4(0x241)]??_0x17afd2[_0x1d21f4(0x246)]??_0x17afd2['skill'])+(_0x17afd2[_0x1d21f4(0x1d6)]?'\x20('+_0x17afd2[_0x1d21f4(0x1d6)]+')':''));return _0x1b8480[_0x1d21f4(0x238)]('\x0a');}function I(_0x4c647a){const _0x2e0b41=_0x9bc3,_0x3ee11b=_0x4c647a[_0x2e0b41(0x27d)]?_0x228938(_0x4c647a):null;return{'status':_0x4c647a['status'],'action':_0x4c647a[_0x2e0b41(0x27b)],'requestKey':_0x4c647a['requestKey'],'orderId':_0x4c647a['orderId'],'jobId':_0x4c647a['jobId']??null,'statusUrl':_0x4c647a['statusUrl']??null,'resultUrl':_0x4c647a[_0x2e0b41(0x20b)]??null,'transactionHash':_0x4c647a['transactionHash']??null,'problems':_0x4c647a[_0x2e0b41(0x1ea)]??null,'parentJobId':_0x4c647a[_0x2e0b41(0x1ce)]?.[_0x2e0b41(0x2b1)]??null,'parent':_0x4c647a['parent']??null,'project':_0x4c647a[_0x2e0b41(0x28e)]?.[_0x2e0b41(0x2a3)]??null,'payer':_0x4c647a[_0x2e0b41(0x219)]??null,'paymentChain':_0x4c647a[_0x2e0b41(0x21d)]??_0x2e0b41(0x277),'payWith':_0x4c647a['payWith']??'IMD','prepared':_0x4c647a['challenge']?.[_0x2e0b41(0x1ce)]??null,'quote':_0x4c647a[_0x2e0b41(0x27d)]?{'amount':_0x3ee11b[_0x2e0b41(0x245)],'asset':_0x3ee11b[_0x2e0b41(0x21a)],'payTo':_0x3ee11b[_0x2e0b41(0x1ee)],'expiresAt':_0x4c647a[_0x2e0b41(0x27d)][_0x2e0b41(0x2b3)]}:null};}function te(_0x512f17){const _0x2dde33=_0x9bc3,_0x3937dd=[_0x2dde33(0x20d)+_0x512f17[_0x2dde33(0x24c)],'action:\x20\x20\x20\x20'+_0x512f17[_0x2dde33(0x27b)],'order:\x20\x20\x20\x20\x20'+_0x512f17[_0x2dde33(0x2b4)],_0x2dde33(0x244)+(_0x512f17['jobId']??'')];if(_0x512f17[_0x2dde33(0x1d4)]&&_0x3937dd[_0x2dde33(0x27e)](_0x2dde33(0x2a5)+_0x512f17[_0x2dde33(0x1d4)]),_0x512f17[_0x2dde33(0x20b)]&&_0x3937dd[_0x2dde33(0x27e)](_0x2dde33(0x24d)+_0x512f17[_0x2dde33(0x20b)]),_0x512f17[_0x2dde33(0x1e5)]&&_0x3937dd['push'](_0x2dde33(0x2ac)+_0x512f17[_0x2dde33(0x1e5)]),_0x512f17[_0x2dde33(0x2aa)]&&(_0x3937dd[_0x2dde33(0x27e)](_0x2dde33(0x229)+_0x512f17[_0x2dde33(0x2aa)]['id']+'\x20('+(_0x512f17[_0x2dde33(0x2aa)]['state']??_0x2dde33(0x25d))+')'),_0x512f17['parent'][_0x2dde33(0x2a3)]&&_0x3937dd[_0x2dde33(0x27e)](_0x2dde33(0x20a)+_0x512f17[_0x2dde33(0x2aa)][_0x2dde33(0x2a3)]['id']+_0x2dde33(0x200)+(_0x512f17['parent'][_0x2dde33(0x2a3)][_0x2dde33(0x1df)]??''))),_0x512f17[_0x2dde33(0x28e)]?.['project']){const _0x5f9a19=_0x512f17[_0x2dde33(0x28e)][_0x2dde33(0x2a3)];_0x3937dd['push'](_0x2dde33(0x24f)+(_0x5f9a19['summary']??_0x5f9a19['id']??_0x2dde33(0x254)));}return!_0x512f17['plan']&&_0x512f17[_0x2dde33(0x27b)]===_0x2dde33(0x2b5)&&_0x512f17[_0x2dde33(0x1cb)]?.[_0x2dde33(0x1ce)]&&(_0x3937dd[_0x2dde33(0x27e)](_0x2dde33(0x1f3)),_0x3937dd[_0x2dde33(0x27e)](JSON['stringify'](_0x512f17[_0x2dde33(0x1cb)][_0x2dde33(0x1ce)],null,0x2))),_0x3937dd[_0x2dde33(0x238)]('\x0a');}function C(_0x5b7ef1,_0x144c0f){const _0x947461=_0x9bc3;if(_0x5b7ef1['status']===_0x947461(0x1e0)){_0x144c0f[_0x947461(0x1f7)]?_0x5afad3({'status':_0x947461(0x1e0),'action':_0x5b7ef1[_0x947461(0x29b)]['action'],'requestKey':_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x1e3)],'parent':_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x2aa)]??null,'check':_0x5b7ef1[_0x947461(0x28e)]},_0x144c0f):(_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x2aa)]&&_0x21ccbf(A(_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x2aa)])+'\x0a'),_0x21ccbf(x(_0x5b7ef1[_0x947461(0x28e)])+'\x0anot\x20paid:\x20blockers\x20must\x20be\x20resolved\x20first\x0a')),process[_0x947461(0x20f)]=0x1;return;}if(_0x5b7ef1[_0x947461(0x24c)]==='refused'){const _0x38663c=I(_0x5b7ef1[_0x947461(0x29b)]);if(_0x144c0f[_0x947461(0x1f7)])_0x5afad3({..._0x38663c,'status':_0x947461(0x29e)},_0x144c0f);else{const _0x3d120e=[_0x947461(0x23a)+_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x2b4)]+'\x20was\x20admitted,\x20but\x20IMD\x20refused\x20the\x20job.',_0x947461(0x259)+(_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x2a4)]??'unknown')+(_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x1e5)]?_0x947461(0x1d8)+_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x1e5)]:'')];for(const _0x192211 of _0x5b7ef1['state'][_0x947461(0x1ea)]??[])_0x3d120e[_0x947461(0x27e)](_0x947461(0x294)+(_0x192211[_0x947461(0x223)]??_0x947461(0x29e))+':\x20'+(_0x192211[_0x947461(0x22b)]??JSON[_0x947461(0x1c5)](_0x192211)));_0x3d120e[_0x947461(0x27e)]('inspect:\x20colony\x20order\x20show\x20'+_0x5b7ef1['state'][_0x947461(0x2b4)]+_0x947461(0x1c0)),_0x21ccbf(_0x3d120e[_0x947461(0x238)]('\x0a')+'\x0a');}process[_0x947461(0x20f)]=0x1;return;}if([_0x947461(0x24a),_0x947461(0x1de),'transaction_pending',_0x947461(0x269)]['includes'](_0x5b7ef1[_0x947461(0x24c)])){const _0x2eed46=_0x5b7ef1[_0x947461(0x29b)];if(_0x144c0f['json'])_0x5afad3({...I(_0x2eed46),'status':_0x5b7ef1['status']},_0x144c0f);else{const _0x5a357d=_0x2eed46[_0x947461(0x289)]??_0x2eed46[_0x947461(0x255)],_0x2dec83=[_0x947461(0x205),_0x947461(0x1d9)];_0x5a357d?.[_0x947461(0x222)]&&_0x2dec83[_0x947461(0x27e)](_0x947461(0x2a9)+_0x5a357d['hash']+(_0x5a357d[_0x947461(0x1e1)]?'\x20('+_0x5a357d['kind']+')':'')),_0x5a357d?.[_0x947461(0x227)]&&_0x2dec83[_0x947461(0x27e)]('reason:\x20\x20\x20\x20\x20\x20'+_0x5a357d[_0x947461(0x227)]),_0x5a357d?.['explorerUrl']&&_0x2dec83['push']('explorer:\x20\x20\x20\x20'+_0x5a357d[_0x947461(0x1dd)]),_0x2eed46[_0x947461(0x1e5)]&&_0x2eed46[_0x947461(0x1e5)]!==_0x5a357d?.['hash']&&_0x2dec83[_0x947461(0x27e)](_0x947461(0x2a9)+_0x2eed46[_0x947461(0x1e5)]),_0x2eed46[_0x947461(0x2b4)]&&_0x2dec83['push']('continue:\x20\x20\x20\x20colony\x20order\x20submit\x20'+_0x2eed46[_0x947461(0x2b4)]),_0x21ccbf(_0x2dec83['join']('\x0a')+'\x0a');}process[_0x947461(0x20f)]=0x1;return;}if(_0x5b7ef1[_0x947461(0x24c)]!=='admitted')throw new Error(_0x947461(0x1ff)+_0x5b7ef1['status']+_0x947461(0x25b)+_0x5b7ef1[_0x947461(0x29b)]['orderId']+_0x947461(0x1c0));_0x5afad3(_0x144c0f[_0x947461(0x1f7)]?I(_0x5b7ef1[_0x947461(0x29b)]):te(_0x5b7ef1[_0x947461(0x29b)]),_0x144c0f);}function A(_0x11c2ac){const _0x118cab=_0x9bc3,_0x12169a=_0x180a5a(_0x11c2ac),_0x3f6d4f=[_0x118cab(0x229)+_0x12169a['id'],_0x118cab(0x2ae)+(_0x12169a[_0x118cab(0x29b)]??''),'template:\x20\x20'+(_0x12169a[_0x118cab(0x242)]??''),_0x118cab(0x270)+y(_0x12169a[_0x118cab(0x26d)],0x1f4),_0x118cab(0x1f4)+(_0x12169a[_0x118cab(0x1c6)]??'')];return _0x12169a[_0x118cab(0x2a3)]&&_0x3f6d4f[_0x118cab(0x27e)](_0x118cab(0x20a)+_0x12169a[_0x118cab(0x2a3)]['id']+_0x118cab(0x200)+(_0x12169a[_0x118cab(0x2a3)][_0x118cab(0x1df)]??'')+_0x118cab(0x1e8)+_0x12169a[_0x118cab(0x2a3)][_0x118cab(0x24b)][_0x118cab(0x1c1)]),_0x3f6d4f['join']('\x0a');}function ne(_0x34bcd9){const _0x1e71dd=_0x9bc3;return _0x34bcd9?_0x34bcd9[_0x1e71dd(0x22a)]?'project:\x20\x20\x20'+y(_0x34bcd9['summary'],0x1f4):_0x34bcd9['id']?_0x1e71dd(0x20a)+_0x34bcd9['id']:null:null;}function K(_0x136c7a,_0x15d1d5,_0x5a14b8,_0x412225){const _0xbb5062=_0x9bc3,_0x4c9445=[];_0x412225&&_0x4c9445[_0xbb5062(0x27e)](A(_0x412225)),_0x4c9445[_0xbb5062(0x27e)]('action:\x20\x20\x20\x20'+_0x136c7a),_0x4c9445[_0xbb5062(0x27e)](_0xbb5062(0x266)),_0x4c9445[_0xbb5062(0x27e)](JSON[_0xbb5062(0x1c5)](_0x15d1d5,null,0x2)),_0x4c9445[_0xbb5062(0x27e)](x(_0x5a14b8));const _0x39a68e=ne(_0x5a14b8[_0xbb5062(0x2a3)]);return _0x39a68e&&_0x4c9445[_0xbb5062(0x27e)](_0x39a68e),_0x4c9445[_0xbb5062(0x238)]('\x0a');}function J(_0x54d622){const _0xa4ba9c=_0x9bc3;return _0x54d622[_0xa4ba9c(0x203)]!==void 0x0||_0x54d622[_0xa4ba9c(0x2b8)]!==void 0x0||_0x54d622[_0xa4ba9c(0x1d6)]!==void 0x0||_0x54d622[_0xa4ba9c(0x242)]!==void 0x0||Array['isArray'](_0x54d622[_0xa4ba9c(0x1fb)])&&_0x54d622[_0xa4ba9c(0x1fb)]['length']>0x0;}function O(_0xdf395){const _0x36e28c=_0x9bc3;return _0xdf395[_0x36e28c(0x203)]!==void 0x0||_0xdf395['skill']!==void 0x0||_0xdf395[_0x36e28c(0x242)]!==void 0x0||Array[_0x36e28c(0x22e)](_0xdf395[_0x36e28c(0x1fb)])&&_0xdf395[_0x36e28c(0x1fb)][_0x36e28c(0x1c1)]>0x0;}function oe(_0x14e624,_0x2c55f7){const _0x5e55a5=_0x9bc3;return typeof _0x14e624==_0x5e55a5(0x201)&&_0x14e624['trim']()!==''&&!J(_0x2c55f7);}function ie(_0x3bc16f,_0x1648c4){const _0x53a78e=_0x9bc3;return typeof _0x3bc16f==_0x53a78e(0x201)&&_0x3bc16f['trim']()!==''&&!O(_0x1648c4);}function b(_0x3467ee){const _0x4d5ec3=_0x9bc3,_0x3f4865=[_0x4d5ec3(0x24e)+_0x3467ee[_0x4d5ec3(0x22a)],'deliverables:'];_0x3467ee['deliverables'][_0x4d5ec3(0x1c1)]===0x0&&_0x3f4865['push'](_0x4d5ec3(0x297));for(const _0x3eb3b9 of _0x3467ee[_0x4d5ec3(0x1eb)])_0x3f4865[_0x4d5ec3(0x27e)](_0x4d5ec3(0x294)+_0x3eb3b9);return _0x3f4865[_0x4d5ec3(0x238)]('\x0a');}function U(_0x4abce8,_0x126245){const _0x4e3c0d=_0x9bc3,_0x27be26=[b(_0x4abce8),_0x4e3c0d(0x261)+_0x126245[_0x4e3c0d(0x268)][_0x4e3c0d(0x1c1)]+_0x4e3c0d(0x25e)];for(const _0x229107 of _0x126245['blockers'])_0x27be26[_0x4e3c0d(0x27e)](_0x4e3c0d(0x294)+_0x229107[_0x4e3c0d(0x223)]+':\x20'+_0x229107['detail']);return _0x27be26[_0x4e3c0d(0x238)]('\x0a');}function _0x9bc3(_0x587028,_0x358c72){_0x587028=_0x587028-0x1c0;const _0x9bc34=_0x358c();let _0x1ff695=_0x9bc34[_0x587028];return _0x1ff695;}function N(_0x28c01e,_0x48103c,_0x310612){const _0x447733=_0x9bc3;if(_0x310612[_0x447733(0x1f7)])_0x5afad3({'action':_0x48103c,'summary':_0x28c01e['summary'],'deliverables':_0x28c01e[_0x447733(0x1eb)],'questions':_0x28c01e['questions'],'input':null},_0x310612);else{const _0x30b3af=_0x28c01e[_0x447733(0x256)]['map'](_0x3e67da=>_0x447733(0x294)+_0x3e67da)[_0x447733(0x238)]('\x0a');_0x5afad3(b(_0x28c01e)+_0x447733(0x28f)+_0x30b3af,_0x310612);}process[_0x447733(0x20f)]=0x1;}function re(_0x1e1c9f){const _0x704d8c=_0x9bc3;return _0x1e1c9f['repo']===void 0x0&&_0x1e1c9f[_0x704d8c(0x234)]===void 0x0?null:{'repoUrl':_0x1e1c9f['repo'],'baseCommit':_0x1e1c9f[_0x704d8c(0x234)]};}async function R({api:_0x36a1ca,home:_0x12bd03,objective:_0x2e1268,answers:_0x338640,parent:_0x17953f=null,source:_0x3de999=null,github:_0x2ceb33=!0x1,opts:_0x2b0dab,loadPlanner:_0x15f3d7}){const _0x3876a0=_0x9bc3;return _0x1f89a4({'api':_0x36a1ca,'home':_0x12bd03,'loadPlanner':_0x15f3d7,'objective':_0x2e1268,'answers':_0x338640,'parent':_0x17953f,'source':_0x3de999,'github':_0x2ceb33,'ask':!_0x2b0dab[_0x3876a0(0x1f7)]&&process[_0x3876a0(0x211)][_0x3876a0(0x26a)]?_0x2a6a3f:null});}function W(_0x11cb91,_0x49e163,{api:_0x852fa0,action:_0x34e973}){const _0x5b40c9=_0x9bc3;if(!_0x11cb91)throw new Error('unknown\x20request\x20key:\x20'+_0x49e163);if(_0x11cb91[_0x5b40c9(0x281)]!==_0x852fa0)throw new Error(_0x5b40c9(0x23a)+_0x11cb91[_0x5b40c9(0x1e3)]+'\x20belongs\x20to\x20'+_0x11cb91['api']+_0x5b40c9(0x2ba)+_0x11cb91[_0x5b40c9(0x281)]);if(_0x11cb91[_0x5b40c9(0x27b)]!==_0x34e973)throw new Error('request\x20key\x20'+_0x11cb91['requestKey']+_0x5b40c9(0x1e6)+_0x11cb91[_0x5b40c9(0x27b)]+_0x5b40c9(0x26c)+_0x34e973);if(!_0x11cb91['input']||typeof _0x11cb91['input']!='object'||Array[_0x5b40c9(0x22e)](_0x11cb91[_0x5b40c9(0x1ce)]))throw new Error(_0x5b40c9(0x20c)+_0x11cb91[_0x5b40c9(0x1e3)]+'\x20has\x20no\x20saved\x20input');return _0x11cb91[_0x5b40c9(0x1ce)];}function se(_0x5635ac,_0x4bd220){const _0x3bafb5=_0x9bc3;return _0x3bafb5(0x29c)+_0x5635ac['api']+'\x20--home\x20'+_0x4bd220[_0x3bafb5(0x210)]+'\x20task\x20create\x20--request-key\x20'+_0x5635ac['requestKey'];}function ae(_0x246cbf,_0x4c9894){const _0x5e518a=_0x9bc3;return _0x5e518a(0x29c)+_0x246cbf[_0x5e518a(0x281)]+_0x5e518a(0x25c)+_0x4c9894[_0x5e518a(0x210)]+_0x5e518a(0x280)+_0x246cbf[_0x5e518a(0x1ce)][_0x5e518a(0x2b1)]+_0x5e518a(0x293)+_0x246cbf[_0x5e518a(0x1e3)];}function we(_0x3db825,{loadPlanner:_0x3ffaa9=_0x4d9a9e}={}){const _0x44034a=_0x9bc3,_0x1cc173=_0x3db825[_0x44034a(0x282)](_0x44034a(0x27f))[_0x44034a(0x23d)](_0x44034a(0x1e2));_0x59d651(_0x1cc173),_0x1cc173[_0x44034a(0x282)](_0x44034a(0x209))[_0x44034a(0x23d)](_0x44034a(0x1fc))['option']('--q\x20<text>',_0x44034a(0x2b6))[_0x44034a(0x1c2)](_0x44034a(0x1e4),'creation-time\x20cursor\x20(exclusive)')['option'](_0x44034a(0x1fa),_0x44034a(0x278))['option'](_0x44034a(0x1cd),_0x44034a(0x267))[_0x44034a(0x1c2)](_0x44034a(0x1d0),_0x44034a(0x284))[_0x44034a(0x27b)](async(_0x513872,_0x55d61)=>{const _0x467edc=_0x44034a,_0x71d0fe=_0x55d61[_0x467edc(0x1e9)](),_0x25de7e=await _0x25f307(_0x71d0fe[_0x467edc(0x281)],V(_0x71d0fe));_0x5afad3(_0x71d0fe['json']?_0x25de7e['data']:X(_0x25de7e['data']),_0x71d0fe);}),_0x1cc173[_0x44034a(0x282)](_0x44034a(0x1f2))[_0x44034a(0x23d)](_0x44034a(0x207))[_0x44034a(0x27b)](async(_0x3ad70e,_0x40604a,_0xf4bffb)=>{const _0x91f868=_0x44034a,_0xa71891=_0xf4bffb['optsWithGlobals'](),_0x5f2d67=await _0x25f307(_0xa71891[_0x91f868(0x281)],_0x91f868(0x249)+encodeURIComponent(_0x3ad70e));_0x5afad3(_0xa71891['json']?_0x5f2d67[_0x91f868(0x235)]:Z(_0x5f2d67['data']),_0xa71891);}),_0x1cc173[_0x44034a(0x282)](_0x44034a(0x260))[_0x44034a(0x23d)](_0x44034a(0x248))['action'](async(_0xcbd006,_0x4c5e32,_0x7fb975)=>{const _0x57e1fd=_0x44034a,_0x2a8c17=_0x7fb975['optsWithGlobals'](),_0x47dab5=await _0x25f307(_0x2a8c17['api'],'/jobs/'+encodeURIComponent(_0xcbd006)+_0x57e1fd(0x264));_0x5afad3(_0x2a8c17[_0x57e1fd(0x1f7)]?_0x47dab5[_0x57e1fd(0x235)]:S(_0x47dab5['data']),_0x2a8c17);}),_0x1cc173[_0x44034a(0x282)](_0x44034a(0x230))['description'](_0x44034a(0x28c))[_0x44034a(0x1c2)](_0x44034a(0x2b7),_0x44034a(0x250),String(_0x531daf))[_0x44034a(0x1c2)]('--timeout\x20<seconds>','total\x20timeout\x20in\x20seconds',String(_0x293eeb))[_0x44034a(0x27b)](async(_0x1da800,_0x1a5ac2,_0x2edc07)=>{const _0x625d34=_0x44034a,_0x282296=_0x2edc07[_0x625d34(0x1e9)](),_0x589094=await _0xc012f9({'api':_0x282296[_0x625d34(0x281)],'id':_0x1da800,'interval':_0x282296[_0x625d34(0x298)],'timeout':_0x282296['timeout'],'onProgress':_0x4b3a57=>{const _0x4955f4=_0x625d34;_0x4b3a57['type']===_0x4955f4(0x28a)?_0x21ccbf(_0x4955f4(0x271)+_0x4b3a57[_0x4955f4(0x29b)]+'\x20complete='+_0x4b3a57[_0x4955f4(0x247)]+_0x4955f4(0x232)+_0x4b3a57[_0x4955f4(0x21e)]+',\x20'+(_0x4b3a57[_0x4955f4(0x236)]/0x3e8)[_0x4955f4(0x1c9)](0x1)+_0x4955f4(0x288)):_0x4b3a57[_0x4955f4(0x2a8)]===_0x4955f4(0x1c3)&&_0x21ccbf(_0x4955f4(0x271)+(_0x4b3a57[_0x4955f4(0x24c)]?'HTTP\x20'+_0x4b3a57[_0x4955f4(0x24c)]:_0x4955f4(0x23c))+_0x4955f4(0x274)+(_0x4b3a57[_0x4955f4(0x287)]/0x3e8)['toFixed'](0x1)+_0x4955f4(0x1da)+_0x4b3a57[_0x4955f4(0x25f)]+')\x0a');}});if(_0x589094[_0x625d34(0x258)]===_0x625d34(0x22f)){_0x21ccbf(_0x625d34(0x29a)),process[_0x625d34(0x20f)]=0x82;return;}_0x589094[_0x625d34(0x1f9)]&&_0x5afad3(_0x282296[_0x625d34(0x1f7)]?_0x589094['result']:S(_0x589094[_0x625d34(0x1f9)]),_0x282296),_0x589094['outcome']!==_0x625d34(0x251)&&(_0x21ccbf(_0x625d34(0x271)+_0x589094[_0x625d34(0x2ad)]+'\x0a'),process[_0x625d34(0x20f)]=0x1);}),_0x1cc173[_0x44034a(0x282)]('download\x20<id>')[_0x44034a(0x23d)](_0x44034a(0x26e))['requiredOption'](_0x44034a(0x216),_0x44034a(0x29d))[_0x44034a(0x27b)](async(_0x5e6ff9,_0x29b04a,_0xddbeb6)=>{const _0x4cc94d=_0x44034a,_0x4dffc6=_0xddbeb6[_0x4cc94d(0x1e9)](),_0x44ef9c=await _0x500ece({'api':_0x4dffc6[_0x4cc94d(0x281)],'id':_0x5e6ff9,'out':_0x4dffc6['out'],'onProgress':_0x2359f9=>{const _0x31d9d0=_0x4cc94d;_0x2359f9['type']===_0x31d9d0(0x291)&&_0x21ccbf(_0x31d9d0(0x23f)+_0x2359f9['path']+_0x31d9d0(0x221)+_0x2359f9['file']+'\x0a');}});_0x5afad3(_0x4dffc6[_0x4cc94d(0x1f7)]?_0x44ef9c:ee(_0x44ef9c),_0x4dffc6);}),_0x1cc173['command'](_0x44034a(0x28e))[_0x44034a(0x23d)](_0x44034a(0x1fd))['requiredOption'](_0x44034a(0x1f8),_0x44034a(0x2b2))[_0x44034a(0x1c2)](_0x44034a(0x220),_0x44034a(0x218))[_0x44034a(0x27b)](async(_0x3cc2f5,_0x14bbe4)=>{const _0xded98e=_0x44034a,_0x3d9c44=_0x14bbe4[_0xded98e(0x1e9)](),_0x47a179=await _0xf06f7d(_0x3d9c44[_0xded98e(0x203)]),_0x2400af=_0x3d9c44[_0xded98e(0x27b)]??_0x35cbad(_0x47a179),_0x827386=await _0x51329e(_0x3d9c44['api'],_0x47a179,_0x2400af);_0x5afad3(_0x3d9c44['json']?_0x827386:x(_0x827386),_0x3d9c44);}),_0x1cc173['command'](_0x44034a(0x25a))[_0x44034a(0x23d)](_0x44034a(0x21f))[_0x44034a(0x208)]('--file\x20<path>',_0x44034a(0x2b2))[_0x44034a(0x1c2)](_0x44034a(0x286),_0x44034a(0x1dc))['action'](async(_0x494402,_0x2ff54a)=>{const _0x2455f8=_0x44034a,_0x35c40e=_0x2ff54a[_0x2455f8(0x1e9)]();_0x35c40e[_0x2455f8(0x1e3)]||await _0x1e393c({..._0x35c40e,'action':_0x2455f8(0x257)});const _0x486a33=await _0xe17452({'api':_0x35c40e[_0x2455f8(0x281)],'home':_0x35c40e['home'],'file':_0x35c40e['file'],'action':_0x2455f8(0x257),'requestKey':_0x35c40e[_0x2455f8(0x1e3)],'yes':_0x35c40e[_0x2455f8(0x23e)],'keyEnv':_0x35c40e['keyEnv'],'rpc':_0x35c40e[_0x2455f8(0x213)],'paymentChain':_0x35c40e['paymentChain'],'payWith':_0x35c40e[_0x2455f8(0x1f6)],'onProgress':_0x47f5e4(_0x35c40e)});C(_0x486a33,_0x35c40e);}),_0x1cc173['command'](_0x44034a(0x212))[_0x44034a(0x23d)](_0x44034a(0x2bc))[_0x44034a(0x1c2)](_0x44034a(0x1f8),_0x44034a(0x265))[_0x44034a(0x1c2)](_0x44034a(0x276),_0x44034a(0x224))[_0x44034a(0x1c2)]('--skill\x20<id>',_0x44034a(0x1cc))['option']('--template\x20<name>',_0x44034a(0x240))['option']('--path\x20<path>',_0x44034a(0x28d),(_0x2430bb,_0x412dc2)=>[..._0x412dc2,_0x2430bb],[])['option'](_0x44034a(0x295),'public\x20GitHub\x20repository\x20URL')['option'](_0x44034a(0x1d3),_0x44034a(0x22c))[_0x44034a(0x1c2)](_0x44034a(0x1d1),'publish\x20the\x20result\x20to\x20GitHub')[_0x44034a(0x1c2)](_0x44034a(0x27c),'answer\x20a\x20business\x20clarification\x20(repeatable)',(_0x8f6c43,_0x43aacc)=>[..._0x43aacc,_0x8f6c43],[])[_0x44034a(0x1c2)](_0x44034a(0x2a1),_0x44034a(0x1d7))[_0x44034a(0x1c2)](_0x44034a(0x29f),_0x44034a(0x27a))['option'](_0x44034a(0x286),_0x44034a(0x1dc))[_0x44034a(0x27b)](async(_0x6a7a1,_0x85e042,_0x4fa8fe)=>{const _0x3cb6e6=_0x44034a,_0x2fff6c=_0x4fa8fe[_0x3cb6e6(0x1e9)]();!_0x2fff6c[_0x3cb6e6(0x285)]&&!_0x2fff6c[_0x3cb6e6(0x1e3)]&&await _0x1e393c({..._0x2fff6c,'action':_0x3cb6e6(0x257)});const _0x491593=oe(_0x6a7a1,_0x2fff6c);let _0x599a7a,_0x5956f8=null;if(_0x2fff6c[_0x3cb6e6(0x1e3)]&&!J(_0x2fff6c)&&(_0x6a7a1===void 0x0||_0x491593)){const _0x1a03ed=await _0x5e9534(_0x2fff6c[_0x3cb6e6(0x210)],_0x2fff6c[_0x3cb6e6(0x1e3)]);if(_0x599a7a=W(_0x1a03ed,_0x2fff6c[_0x3cb6e6(0x1e3)],{'api':_0x2fff6c[_0x3cb6e6(0x281)],'action':_0x3cb6e6(0x257)}),_0x6a7a1!==void 0x0&&_0x6a7a1!==_0x599a7a[_0x3cb6e6(0x26d)])throw new Error(_0x3cb6e6(0x20c)+_0x2fff6c[_0x3cb6e6(0x1e3)]+_0x3cb6e6(0x2a6));}else{if(_0x491593){if(_0x5956f8=await R({'api':_0x2fff6c[_0x3cb6e6(0x281)],'home':_0x2fff6c[_0x3cb6e6(0x210)],'objective':_0x6a7a1,'answers':_0x2fff6c[_0x3cb6e6(0x22d)],'source':re(_0x2fff6c),'github':_0x2fff6c[_0x3cb6e6(0x1d5)]===!0x0,'opts':_0x2fff6c,'loadPlanner':_0x3ffaa9}),_0x5956f8[_0x3cb6e6(0x1ce)]===null){N(_0x5956f8,_0x3cb6e6(0x257),_0x2fff6c);return;}_0x599a7a=_0x5956f8[_0x3cb6e6(0x1ce)];}else{const _0x4228d5=_0x2fff6c[_0x3cb6e6(0x203)]?await _0xf06f7d(_0x2fff6c[_0x3cb6e6(0x203)]):void 0x0;_0x599a7a=await _0x191f76({'fileInput':_0x4228d5,'objective':_0x6a7a1,'preset':_0x2fff6c[_0x3cb6e6(0x2b8)],'skill':_0x2fff6c['skill'],'template':_0x2fff6c[_0x3cb6e6(0x242)],'paths':_0x2fff6c[_0x3cb6e6(0x1fb)],'repo':_0x2fff6c[_0x3cb6e6(0x1f0)],'commit':_0x2fff6c[_0x3cb6e6(0x234)],'github':_0x2fff6c[_0x3cb6e6(0x1d5)]});}}if(_0x2fff6c['save']&&(await _0x17d4ce(_0x2fff6c[_0x3cb6e6(0x226)],_0x599a7a),_0x2fff6c[_0x3cb6e6(0x1f7)]||_0x21ccbf(_0x3cb6e6(0x1ca)+_0x2fff6c[_0x3cb6e6(0x226)]+'\x0a')),_0x2fff6c[_0x3cb6e6(0x285)]){const _0xb7f4e4=await _0x51329e(_0x2fff6c['api'],_0x599a7a,_0x3cb6e6(0x257));_0x2fff6c[_0x3cb6e6(0x1f7)]?_0x5afad3({'action':_0x3cb6e6(0x257),..._0x5956f8?{'summary':_0x5956f8['summary'],'deliverables':_0x5956f8[_0x3cb6e6(0x1eb)]}:{},'input':_0x599a7a,'check':_0xb7f4e4},_0x2fff6c):_0x5afad3(_0x5956f8?U(_0x5956f8,_0xb7f4e4):K(_0x3cb6e6(0x257),_0x599a7a,_0xb7f4e4),_0x2fff6c),_0xb7f4e4[_0x3cb6e6(0x268)][_0x3cb6e6(0x1c1)]>0x0&&(process['exitCode']=0x1);return;}_0x5956f8&&!_0x2fff6c[_0x3cb6e6(0x1f7)]&&_0x21ccbf(b(_0x5956f8)+'\x0a');const _0x2b8695=await _0xe17452({'api':_0x2fff6c[_0x3cb6e6(0x281)],'home':_0x2fff6c[_0x3cb6e6(0x210)],'input':_0x599a7a,'action':_0x3cb6e6(0x257),'requestKey':_0x2fff6c['requestKey'],'plan':_0x5956f8?{'summary':_0x5956f8[_0x3cb6e6(0x22a)],'deliverables':_0x5956f8[_0x3cb6e6(0x1eb)]}:void 0x0,'yes':_0x2fff6c[_0x3cb6e6(0x23e)],'keyEnv':_0x2fff6c['keyEnv'],'rpc':_0x2fff6c[_0x3cb6e6(0x213)],'paymentChain':_0x2fff6c[_0x3cb6e6(0x21d)],'payWith':_0x2fff6c[_0x3cb6e6(0x1f6)],'onProgress':_0x47f5e4(_0x2fff6c),'retryCommand':_0x2b6cda=>se(_0x2b6cda,_0x2fff6c)});C(_0x2b8695,_0x2fff6c);}),_0x1cc173[_0x44034a(0x282)]('continue\x20<id>\x20[objective]')['description']('continue\x20the\x20project\x20of\x20a\x20job\x20you\x20paid\x20for')[_0x44034a(0x1c2)](_0x44034a(0x1f8),_0x44034a(0x263))[_0x44034a(0x1c2)]('--skill\x20<id>',_0x44034a(0x1cc))[_0x44034a(0x1c2)](_0x44034a(0x275),_0x44034a(0x240))['option'](_0x44034a(0x1ec),_0x44034a(0x28d),(_0x36ee6f,_0xca6cd8)=>[..._0xca6cd8,_0x36ee6f],[])[_0x44034a(0x1c2)](_0x44034a(0x27c),'answer\x20a\x20business\x20clarification\x20(repeatable)',(_0x1217a3,_0x12524f)=>[..._0x12524f,_0x1217a3],[])[_0x44034a(0x1c2)]('--dry-run',_0x44034a(0x1d7))['option'](_0x44034a(0x29f),_0x44034a(0x27a))[_0x44034a(0x1c2)](_0x44034a(0x286),_0x44034a(0x1dc))[_0x44034a(0x27b)](async(_0x28de72,_0x5b923b,_0x5ec3f6,_0x4f9a83)=>{const _0x3811d0=_0x44034a,_0x3ef1db=_0x4f9a83[_0x3811d0(0x1e9)]();!_0x3ef1db[_0x3811d0(0x285)]&&!_0x3ef1db[_0x3811d0(0x1e3)]&&await _0x1e393c({..._0x3ef1db,'action':_0x3811d0(0x2b5)});const _0x816a2e=ie(_0x5b923b,_0x3ef1db);let _0x2e2648,_0x5f29a2,_0x2ec3a9=null;if(_0x3ef1db['requestKey']&&!O(_0x3ef1db)&&(_0x5b923b===void 0x0||_0x816a2e)){const _0x21e942=await _0x5e9534(_0x3ef1db['home'],_0x3ef1db[_0x3811d0(0x1e3)]);if(_0x2e2648=W(_0x21e942,_0x3ef1db[_0x3811d0(0x1e3)],{'api':_0x3ef1db[_0x3811d0(0x281)],'action':'job.continue'}),_0x2e2648['parentJobId']!==_0x28de72)throw new Error(_0x3811d0(0x20c)+_0x3ef1db['requestKey']+_0x3811d0(0x253)+(_0x2e2648[_0x3811d0(0x2b1)]??'<none>')+_0x3811d0(0x26c)+_0x28de72);if(_0x5b923b!==void 0x0&&_0x5b923b!==_0x2e2648['objective'])throw new Error(_0x3811d0(0x20c)+_0x3ef1db[_0x3811d0(0x1e3)]+'\x20was\x20created\x20for\x20a\x20different\x20objective;\x20omit\x20the\x20new\x20objective\x20to\x20resume\x20it');_0x5f29a2=(await _0x25f307(_0x3ef1db[_0x3811d0(0x281)],'/jobs/'+encodeURIComponent(_0x28de72)))['data'];}else{if(_0x816a2e){if(_0x5f29a2=(await _0x25f307(_0x3ef1db[_0x3811d0(0x281)],_0x3811d0(0x249)+encodeURIComponent(_0x28de72)))[_0x3811d0(0x235)],_0x2ec3a9=await R({'api':_0x3ef1db[_0x3811d0(0x281)],'home':_0x3ef1db[_0x3811d0(0x210)],'objective':_0x5b923b,'answers':_0x3ef1db[_0x3811d0(0x22d)],'parent':_0x5f29a2,'opts':_0x3ef1db,'loadPlanner':_0x3ffaa9}),_0x2ec3a9['input']===null){N(_0x2ec3a9,_0x3811d0(0x2b5),_0x3ef1db);return;}_0x2e2648=_0x2ec3a9['input'],_0x2e2648['parentJobId']!==_0x28de72&&(_0x2e2648={..._0x2e2648,'parentJobId':_0x28de72});}else{const _0x40d9c8=_0x3ef1db[_0x3811d0(0x203)]?await _0xf06f7d(_0x3ef1db[_0x3811d0(0x203)]):void 0x0;_0x2e2648=await _0x5bd41a({'id':_0x28de72,'fileInput':_0x40d9c8,'objective':_0x5b923b,'skill':_0x3ef1db[_0x3811d0(0x1d6)],'template':_0x3ef1db['template'],'paths':_0x3ef1db[_0x3811d0(0x1fb)]}),_0x5f29a2=(await _0x25f307(_0x3ef1db['api'],'/jobs/'+encodeURIComponent(_0x28de72)))['data'];}}if(_0x3ef1db[_0x3811d0(0x226)]&&(await _0x17d4ce(_0x3ef1db[_0x3811d0(0x226)],_0x2e2648),_0x3ef1db[_0x3811d0(0x1f7)]||_0x21ccbf(_0x3811d0(0x1ca)+_0x3ef1db[_0x3811d0(0x226)]+'\x0a')),_0x3ef1db[_0x3811d0(0x285)]){const _0x113c9f=await _0x51329e(_0x3ef1db[_0x3811d0(0x281)],_0x2e2648,'job.continue');_0x3ef1db[_0x3811d0(0x1f7)]?_0x5afad3({'action':_0x3811d0(0x2b5),..._0x2ec3a9?{'summary':_0x2ec3a9[_0x3811d0(0x22a)],'deliverables':_0x2ec3a9['deliverables']}:{},'parent':_0x180a5a(_0x5f29a2),'input':_0x2e2648,'check':_0x113c9f},_0x3ef1db):_0x5afad3(_0x2ec3a9?U(_0x2ec3a9,_0x113c9f):K(_0x3811d0(0x2b5),_0x2e2648,_0x113c9f,_0x5f29a2),_0x3ef1db),_0x113c9f[_0x3811d0(0x268)][_0x3811d0(0x1c1)]>0x0&&(process[_0x3811d0(0x20f)]=0x1);return;}_0x2ec3a9&&!_0x3ef1db[_0x3811d0(0x1f7)]&&_0x21ccbf(b(_0x2ec3a9)+'\x0a');const _0x232126=await _0xe17452({'api':_0x3ef1db[_0x3811d0(0x281)],'home':_0x3ef1db[_0x3811d0(0x210)],'input':_0x2e2648,'action':_0x3811d0(0x2b5),'requestKey':_0x3ef1db[_0x3811d0(0x1e3)],'plan':_0x2ec3a9?{'summary':_0x2ec3a9[_0x3811d0(0x22a)],'deliverables':_0x2ec3a9['deliverables']}:void 0x0,'yes':_0x3ef1db['yes'],'keyEnv':_0x3ef1db[_0x3811d0(0x26b)],'rpc':_0x3ef1db[_0x3811d0(0x213)],'paymentChain':_0x3ef1db['paymentChain'],'payWith':_0x3ef1db['payWith'],'onProgress':_0x47f5e4(_0x3ef1db),'retryCommand':_0x5b7eb1=>ae(_0x5b7eb1,_0x3ef1db)});_0x232126['state']&&(_0x232126[_0x3811d0(0x29b)][_0x3811d0(0x2aa)]=_0x180a5a(_0x5f29a2)),C(_0x232126,_0x3ef1db);});}export{we as registerTaskCommands};
1
+ function _0x5516(){const _0x3256cf=['api','\x20\x20-\x20none','hash','--path\x20<path>','publish','IMD','reuse\x20a\x20saved\x20order\x20request\x20key','\x20verdict=','check:\x20\x20\x20\x20\x20','browse\x20and\x20publish\x20IMD\x20tasks','download:\x20','isInteger','timeout','join','reviews:\x20\x20\x20','\x20--refresh','complete','\x20(enough\x20balance\x20found).\x0a','optsWithGlobals','questions','admitted','\x20\x20-\x20','check','--limit\x20<n>','complete\x20continuation\x20body\x20JSON\x20file','project:\x20\x20\x20','--github','order\x20','named\x20input\x20preset\x20(report)','plan:\x20','keyEnv','--answer\x20<text>','message','slice','elapsedMs','source:\x20\x20\x20\x20','--request-key\x20<uuid>','poll','ethereum','--dry-run','parentJobId','show\x20one\x20job','continue\x20<id>\x20[objective]','save','--before\x20<time>','\x20version(s))','createdAt','challenge','--timeout\x20<seconds>','paid\x20by:\x20\x20\x20','source','expiresAt','s)\x0a','--exclude-oracle','--file\x20<path>','blockers','\x20belongs\x20to\x20','--template\x20<name>','delivery','limit','objective:\x20','summary:\x20','home','\x20head=','repo','status','json','validate\x20a\x20job\x20body\x20without\x20creating\x20an\x20order','reason','object','requiredOption','/jobs','/result','order:\x20\x20\x20\x20\x20','s\x20(retry\x20','reason:\x20\x20\x20\x20\x20\x20','blockers:\x20','head','reviews','Network\x20error','completed','base\x20commit\x20for\x20--repo','updatedAt','launch','pendingTransaction','Your\x20request\x20is\x20saved.\x20Continue\x20payment\x20to\x20check\x20the\x20original\x20payment\x20before\x20retrying.','code','short','trim','stdin','toString','url','description','created:\x20\x20\x20','\x20\x20\x20\x20url:\x20\x20','submissionHash','exclude\x20oracle\x20panel\x20jobs','answer','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20500','workflow:\x20\x20','paymentStatus','push','\x20--request-key\x20','parent:\x20\x20\x20\x20','HTTP\x20','interrupted','destination\x20directory','/jobs/','--skill\x20<id>','preset','stringify','repository\x20path\x20the\x20job\x20may\x20write\x20(repeatable)','jobId','action','payment_reconciling','bytes','--since\x20<time>','show\x20a\x20job\x20result\x20and\x20artifact\x20URLs','result\x20<id>','length','refusalProblems','dryRun','files:\x20\x20\x20\x20\x20','exclude','nodes:\x20\x20\x20\x20\x20','job:\x20\x20\x20\x20\x20\x20\x20','input','complete\x20job\x20body\x20JSON\x20file','summary','title','quote','\x20blocker(s)','none','jobs\x20that\x20moved\x20after\x20this\x20time','job.continue','transaction_pending','\x0aquestions:\x0a','transactionHash','\x20belongs\x20to\x20parent\x20job\x20','type','detail','oracle','before','state:\x20\x20\x20\x20\x20','nodes','result\x20response\x20is\x20missing\x20jobId','page\x20size\x20(1-500)','check:\x20','jobs','template','data','Payment\x20needs\x20review.','github','deliverables:','\x20was\x20created\x20for\x20action\x20','option','download\x20a\x20completed\x20job\x27s\x20files\x20under\x20--out','string','explorer:\x20\x20\x20\x20','outcome','includes','resultUrl','inspect:\x20colony\x20order\x20show\x20','continue\x20the\x20project\x20of\x20a\x20job\x20you\x20paid\x20for','job\x20response\x20is\x20missing\x20id','template:\x20\x20','paymentChain','set','attempt','\x20tx\x20','verdict','\x20task\x20continue\x20','\x20--home\x20','wait:\x20','creation-time\x20cursor\x20(exclusive)','isTTY','--action\x20<action>','launch:\x20\x20\x20\x20','requestKey','\x20->\x20','\x20bytes,\x20','job\x20body\x20JSON\x20file','\x20versions=','command','action:\x20\x20\x20\x20','publish\x20the\x20result\x20to\x20GitHub','tx:\x20\x20\x20\x20\x20\x20\x20\x20','project','payment:\x20',';\x20rerun\x20with\x20--api\x20','yes','poll\x20interval\x20in\x20seconds','kind','\x20\x20\x20\x20hash:\x20','out','wait:\x20interrupted\x0a','only\x20run\x20the\x20free\x20check\x20and\x20print\x20the\x20input','\x20attempt=','padEnd','state','public\x20GitHub\x20repository\x20URL',',\x20not\x20','project\x20ready','unknown','job.open','transaction:\x20','since','task','explorerUrl','skill','list','create\x20a\x20job\x20from\x20a\x20clear\x20objective\x20or\x20a\x20JSON\x20file','isArray','colony\x20--api\x20','--out\x20<dir>','versions','download\x20<id>','objective','path','payer','request\x20key\x20','toFixed','\x20job(s)','files','--interval\x20<seconds>','retry','payWith','objective\x20or\x20job\x20id\x20prefix','rpc','/jobs?',';\x20retrying\x20in\x20','\x20was\x20admitted,\x20but\x20IMD\x20refused\x20the\x20job.','jobs\x20response\x20is\x20missing\x20jobs','resultUrl:\x20','exitCode','result','commit','deliverables','\x20complete=','file','continue:\x20\x20\x20\x20colony\x20order\x20submit\x20','transaction','blocked','save\x20the\x20input\x20JSON\x20without\x20overwriting','refused','paidBy','excludeOracle','total\x20timeout\x20in\x20seconds','saved\x20input:\x20','answer\x20a\x20business\x20clarification\x20(repeatable)','workflow','parent','orderId','saved','payment_failed','\x20has\x20no\x20saved\x20input','\x20was\x20created\x20for\x20a\x20different\x20objective;\x20omit\x20the\x20new\x20objective\x20to\x20resume\x20it','job\x20template','complete:\x20\x20','--save\x20<path>','\x20on\x20'];_0x5516=function(){return _0x3256cf;};return _0x5516();}import{writeDiagnostic as _0x1ab7b2}from'../lib/terminal-text.mjs';import{paymentProgressReporter as _0x39d34c}from'../lib/payment-progress.mjs';function _0x434f(_0x416e29,_0x55168a){_0x416e29=_0x416e29-0x137;const _0x434fe2=_0x5516();let _0x448297=_0x434fe2[_0x416e29];return _0x448297;}import{request as _0x11f4e2,print as _0x11a1cd}from'../shared.mjs';import{checkJob as _0x281c72,publishJob as _0x17effd,readJobFile as _0x39c26e}from'../lib/publish.mjs';import{loadOrder as _0x35669f}from'../lib/orders.mjs';import{buildContinueInput as _0x14b6ea,buildCreateInput as _0x2616f0,parentSummary as _0x85a4a1,resolveAction as _0x4a2a86,saveInputFile as _0xff79a7}from'../lib/task-input.mjs';import{DEFAULT_INTERVAL_SECONDS as _0x502ffb,DEFAULT_TIMEOUT_SECONDS as _0x4a4dfa,downloadTaskFiles as _0x33c8ee,waitForResult as _0xe1778}from'../lib/task-result.mjs';import{askQuestions as _0x24b365,loadLocalPlanner as _0x4dd879,planTask as _0x776995}from'../planner/flow.mjs';import{registerMyTaskCommands as _0x2bcb6c}from'./my-tasks.mjs';import{orderPayment as _0x3a82a4}from'../lib/payments.mjs';import{checkTaskWallet as _0x68ff51}from'../lib/task-wallet.mjs';async function x(_0x1439c6,_0x1b0bc1){const _0x43fb19=_0x434f,_0x801dff=await _0x68ff51({..._0x1439c6,'action':_0x1b0bc1});return _0x1439c6[_0x43fb19(0x179)]||_0x1ab7b2('Paying\x20with\x20'+_0x801dff['payWith']+_0x43fb19(0x23b)+_0x801dff['chainName']+_0x43fb19(0x148)),_0x801dff;}function Z(_0x2cb167){const _0x5bc479=_0x434f,_0x3a52aa=new URLSearchParams();if(_0x2cb167['q']!==void 0x0&&_0x3a52aa[_0x5bc479(0x1de)]('q',_0x2cb167['q']),_0x2cb167[_0x5bc479(0x1c5)]!==void 0x0&&_0x3a52aa[_0x5bc479(0x1de)](_0x5bc479(0x1c5),_0x2cb167[_0x5bc479(0x1c5)]),_0x2cb167['since']!==void 0x0&&_0x3a52aa[_0x5bc479(0x1de)](_0x5bc479(0x205),_0x2cb167[_0x5bc479(0x205)]),_0x2cb167[_0x5bc479(0x172)]!==void 0x0){const _0x505c31=Number(_0x2cb167[_0x5bc479(0x172)]);if(!Number[_0x5bc479(0x142)](_0x505c31)||_0x505c31<0x1||_0x505c31>0x1f4)throw new Error(_0x5bc479(0x199));_0x3a52aa[_0x5bc479(0x1de)](_0x5bc479(0x172),String(_0x505c31));}_0x2cb167[_0x5bc479(0x22d)]&&_0x3a52aa[_0x5bc479(0x1de)](_0x5bc479(0x1b2),_0x5bc479(0x1c4));const _0x5cb02e=_0x3a52aa[_0x5bc479(0x191)]();return _0x5cb02e?_0x5bc479(0x21c)+_0x5cb02e:_0x5bc479(0x17e);}function b(_0x354aa5,_0xf646d9=0x5a){const _0x568dc=_0x434f,_0x443384=String(_0x354aa5??'')['replace'](/\s+/g,'\x20')[_0x568dc(0x18f)]();return _0x443384[_0x568dc(0x1ae)]>_0xf646d9?_0x443384[_0x568dc(0x158)](0x0,_0xf646d9-0x1)+'…':_0x443384;}function ee(_0xf1d3f4){const _0x244401=_0x434f;if(!Array[_0x244401(0x20b)](_0xf1d3f4?.[_0x244401(0x1cb)]))throw new Error(_0x244401(0x21f));const _0xdd3410=[_0xf1d3f4['count']+_0x244401(0x215)];for(const _0x3f9ff1 of _0xf1d3f4[_0x244401(0x1cb)])_0xdd3410[_0x244401(0x19c)](_0x3f9ff1['id']+'\x20\x20'+_0x3f9ff1[_0x244401(0x1fe)][_0x244401(0x1fd)](0xa)+'\x20\x20'+String(_0x3f9ff1['template']??'')[_0x244401(0x1fd)](0x16)+'\x20\x20'+(_0x3f9ff1[_0x244401(0x189)]??'')+'\x20\x20'+b(_0x3f9ff1['objective']));return _0xdd3410[_0x244401(0x144)]('\x0a');}function te(_0x2b26df){const _0x28650f=_0x434f;if(!_0x2b26df?.['id'])throw new Error(_0x28650f(0x1db));const _0x1138bc=[_0x28650f(0x1b4)+_0x2b26df['id'],_0x28650f(0x1c6)+_0x2b26df[_0x28650f(0x1fe)],_0x28650f(0x1dc)+(_0x2b26df[_0x28650f(0x1cc)]??''),_0x28650f(0x173)+b(_0x2b26df[_0x28650f(0x210)],0x1f4),_0x28650f(0x194)+(_0x2b26df[_0x28650f(0x165)]??''),'updated:\x20\x20\x20'+(_0x2b26df[_0x28650f(0x189)]??''),'paid\x20by:\x20\x20\x20'+(_0x2b26df[_0x28650f(0x22c)]??''),_0x28650f(0x150)+(_0x2b26df['project']?_0x2b26df[_0x28650f(0x1f2)]['id']+'\x20('+(_0x2b26df['project'][_0x28650f(0x20e)]?.['length']??0x0)+_0x28650f(0x164):_0x28650f(0x1bb)),'delivery:\x20\x20'+(_0x2b26df[_0x28650f(0x171)]?JSON[_0x28650f(0x1a5)](_0x2b26df[_0x28650f(0x171)]):_0x28650f(0x1bb)),_0x28650f(0x1e8)+(_0x2b26df[_0x28650f(0x18a)]?JSON[_0x28650f(0x1a5)](_0x2b26df[_0x28650f(0x18a)]):_0x28650f(0x1bb))];if(Array['isArray'](_0x2b26df[_0x28650f(0x1c7)])){_0x1138bc[_0x28650f(0x19c)](_0x28650f(0x1b3)+_0x2b26df[_0x28650f(0x1c7)]['length']);for(const _0x435fc1 of _0x2b26df['nodes'])_0x1138bc['push']('\x20\x20-\x20'+_0x435fc1['key']+':\x20'+_0x435fc1[_0x28650f(0x1fe)]+_0x28650f(0x1fc)+_0x435fc1['attempt']+_0x28650f(0x13e)+(_0x435fc1[_0x28650f(0x1e1)]?.[_0x28650f(0x178)]??_0x28650f(0x1bb)));}return Array[_0x28650f(0x20b)](_0x2b26df['reviews'])&&_0x1138bc[_0x28650f(0x19c)](_0x28650f(0x145)+_0x2b26df[_0x28650f(0x185)][_0x28650f(0x1ae)]),_0x2b26df[_0x28650f(0x231)]?.['id']&&_0x1138bc[_0x28650f(0x19c)]((_0x28650f(0x19a)+_0x2b26df[_0x28650f(0x231)]['id']+'\x20'+(_0x2b26df['workflow'][_0x28650f(0x178)]??''))[_0x28650f(0x18f)]()),_0x1138bc['join']('\x0a');}function A(_0x558103){const _0x3188c7=_0x434f;if(!_0x558103?.[_0x3188c7(0x1a7)])throw new Error(_0x3188c7(0x1c8));const _0x10c501=[_0x3188c7(0x1b4)+_0x558103[_0x3188c7(0x1a7)],_0x3188c7(0x1c6)+_0x558103['state'],_0x3188c7(0x239)+_0x558103[_0x3188c7(0x147)]],_0x4cc315=Array[_0x3188c7(0x20b)](_0x558103['files'])?_0x558103['files']:[];_0x10c501[_0x3188c7(0x19c)](_0x3188c7(0x1b1)+_0x4cc315[_0x3188c7(0x1ae)]);for(const _0x468d77 of _0x4cc315)_0x10c501[_0x3188c7(0x19c)](_0x3188c7(0x14c)+_0x468d77[_0x3188c7(0x211)]+'\x20('+_0x468d77[_0x3188c7(0x1aa)]+_0x3188c7(0x1eb)+_0x468d77['mediaType']+')'),_0x10c501[_0x3188c7(0x19c)]('\x20\x20\x20\x20hash:\x20'+_0x468d77[_0x3188c7(0x139)]),_0x10c501['push'](_0x3188c7(0x195)+_0x468d77[_0x3188c7(0x192)]);const _0x199b05=Array[_0x3188c7(0x20b)](_0x558103[_0x3188c7(0x169)])?_0x558103[_0x3188c7(0x169)]:[];_0x10c501['push'](_0x3188c7(0x15a)+_0x199b05['length']);for(const _0x41e809 of _0x199b05)_0x10c501[_0x3188c7(0x19c)]('\x20\x20-\x20'+(_0x41e809['node']??_0x41e809[_0x3188c7(0x196)])+':\x20'+_0x41e809[_0x3188c7(0x192)]);return _0x558103[_0x3188c7(0x171)]&&_0x10c501[_0x3188c7(0x19c)]('delivery:\x20\x20'+JSON[_0x3188c7(0x1a5)](_0x558103[_0x3188c7(0x171)])),_0x558103[_0x3188c7(0x18a)]&&_0x10c501[_0x3188c7(0x19c)](_0x3188c7(0x1e8)+JSON[_0x3188c7(0x1a5)](_0x558103[_0x3188c7(0x18a)])),_0x10c501[_0x3188c7(0x144)]('\x0a');}function ne(_0xf0e46b){const _0x58c780=_0x434f,_0x3187e1=[_0x58c780(0x1b4)+_0xf0e46b['jobId'],_0x58c780(0x1c6)+_0xf0e46b[_0x58c780(0x1fe)],_0x58c780(0x1b1)+_0xf0e46b[_0x58c780(0x216)]['length']];for(const _0x2c2d6d of _0xf0e46b['files'])_0x3187e1[_0x58c780(0x19c)]('\x20\x20-\x20'+_0x2c2d6d[_0x58c780(0x211)]+'\x20->\x20'+_0x2c2d6d['file']+'\x20('+_0x2c2d6d['bytes']+'\x20bytes)'),_0x3187e1['push'](_0x58c780(0x1f8)+_0x2c2d6d[_0x58c780(0x139)]);return _0x3187e1['join']('\x0a');}function C(_0x2fc04d){const _0x46447a=_0x434f,_0x413706=[_0x46447a(0x183)+_0x2fc04d[_0x46447a(0x16e)][_0x46447a(0x1ae)]];for(const _0x597100 of _0x2fc04d[_0x46447a(0x16e)])_0x413706[_0x46447a(0x19c)]('\x20\x20-\x20'+_0x597100[_0x46447a(0x18d)]+':\x20'+_0x597100[_0x46447a(0x1c3)]);const _0x33fa5a=Array[_0x46447a(0x20b)](_0x2fc04d['plan'])?_0x2fc04d['plan']:[];_0x413706[_0x46447a(0x19c)](_0x46447a(0x154)+_0x33fa5a['length']);for(const _0x506e5e of _0x33fa5a)_0x413706[_0x46447a(0x19c)](_0x46447a(0x14c)+(_0x506e5e[_0x46447a(0x1b8)]??_0x506e5e[_0x46447a(0x18e)]??_0x506e5e[_0x46447a(0x208)])+(_0x506e5e['skill']?'\x20('+_0x506e5e[_0x46447a(0x208)]+')':''));return _0x413706[_0x46447a(0x144)]('\x0a');}function I(_0x22a565){const _0x49feb3=_0x434f,_0x4b89a7=_0x22a565[_0x49feb3(0x1b9)]?_0x3a82a4(_0x22a565):null;return{'status':_0x22a565['status'],'action':_0x22a565[_0x49feb3(0x1a8)],'requestKey':_0x22a565[_0x49feb3(0x1e9)],'orderId':_0x22a565['orderId'],'jobId':_0x22a565[_0x49feb3(0x1a7)]??null,'statusUrl':_0x22a565['statusUrl']??null,'resultUrl':_0x22a565[_0x49feb3(0x1d8)]??null,'transactionHash':_0x22a565['transactionHash']??null,'problems':_0x22a565[_0x49feb3(0x1af)]??null,'parentJobId':_0x22a565[_0x49feb3(0x1b5)]?.[_0x49feb3(0x15f)]??null,'parent':_0x22a565[_0x49feb3(0x232)]??null,'project':_0x22a565[_0x49feb3(0x14d)]?.[_0x49feb3(0x1f2)]??null,'payer':_0x22a565[_0x49feb3(0x212)]??null,'paymentChain':_0x22a565[_0x49feb3(0x1dd)]??_0x49feb3(0x15d),'payWith':_0x22a565['payWith']??_0x49feb3(0x13c),'prepared':_0x22a565[_0x49feb3(0x166)]?.[_0x49feb3(0x1b5)]??null,'quote':_0x22a565['quote']?{'amount':_0x4b89a7['amount'],'asset':_0x4b89a7['asset'],'payTo':_0x4b89a7['payTo'],'expiresAt':_0x22a565[_0x49feb3(0x1b9)][_0x49feb3(0x16a)]}:null};}function oe(_0x1ce538){const _0x1608e6=_0x434f,_0x8284ef=['status:\x20\x20\x20\x20'+_0x1ce538[_0x1608e6(0x178)],'action:\x20\x20\x20\x20'+_0x1ce538['action'],_0x1608e6(0x180)+_0x1ce538[_0x1608e6(0x233)],_0x1608e6(0x1b4)+(_0x1ce538['jobId']??'')];if(_0x1ce538['statusUrl']&&_0x8284ef[_0x1608e6(0x19c)]('statusUrl:\x20'+_0x1ce538['statusUrl']),_0x1ce538[_0x1608e6(0x1d8)]&&_0x8284ef['push'](_0x1608e6(0x220)+_0x1ce538['resultUrl']),_0x1ce538[_0x1608e6(0x1c0)]&&_0x8284ef['push'](_0x1608e6(0x1f1)+_0x1ce538[_0x1608e6(0x1c0)]),_0x1ce538[_0x1608e6(0x232)]&&(_0x8284ef[_0x1608e6(0x19c)](_0x1608e6(0x19e)+_0x1ce538[_0x1608e6(0x232)]['id']+'\x20('+(_0x1ce538[_0x1608e6(0x232)][_0x1608e6(0x1fe)]??'unknown')+')'),_0x1ce538[_0x1608e6(0x232)][_0x1608e6(0x1f2)]&&_0x8284ef[_0x1608e6(0x19c)](_0x1608e6(0x150)+_0x1ce538[_0x1608e6(0x232)][_0x1608e6(0x1f2)]['id']+_0x1608e6(0x176)+(_0x1ce538[_0x1608e6(0x232)][_0x1608e6(0x1f2)][_0x1608e6(0x184)]??''))),_0x1ce538[_0x1608e6(0x14d)]?.[_0x1608e6(0x1f2)]){const _0x44d000=_0x1ce538[_0x1608e6(0x14d)][_0x1608e6(0x1f2)];_0x8284ef['push'](_0x1608e6(0x13f)+(_0x44d000[_0x1608e6(0x1b7)]??_0x44d000['id']??_0x1608e6(0x201)));}return!_0x1ce538['plan']&&_0x1ce538[_0x1608e6(0x1a8)]===_0x1608e6(0x1bd)&&_0x1ce538[_0x1608e6(0x166)]?.[_0x1608e6(0x1b5)]&&(_0x8284ef[_0x1608e6(0x19c)]('prepared\x20input:'),_0x8284ef[_0x1608e6(0x19c)](JSON[_0x1608e6(0x1a5)](_0x1ce538[_0x1608e6(0x166)][_0x1608e6(0x1b5)],null,0x2))),_0x8284ef[_0x1608e6(0x144)]('\x0a');}function T(_0x17ffe5,_0x1393f5){const _0x28d4a3=_0x434f;if(_0x17ffe5[_0x28d4a3(0x178)]===_0x28d4a3(0x229)){_0x1393f5[_0x28d4a3(0x179)]?_0x11a1cd({'status':_0x28d4a3(0x229),'action':_0x17ffe5['state'][_0x28d4a3(0x1a8)],'requestKey':_0x17ffe5[_0x28d4a3(0x1fe)][_0x28d4a3(0x1e9)],'parent':_0x17ffe5['state'][_0x28d4a3(0x232)]??null,'check':_0x17ffe5['check']},_0x1393f5):(_0x17ffe5[_0x28d4a3(0x1fe)][_0x28d4a3(0x232)]&&_0x1ab7b2(K(_0x17ffe5[_0x28d4a3(0x1fe)][_0x28d4a3(0x232)])+'\x0a'),_0x1ab7b2(C(_0x17ffe5[_0x28d4a3(0x14d)])+'\x0anot\x20paid:\x20blockers\x20must\x20be\x20resolved\x20first\x0a')),process[_0x28d4a3(0x221)]=0x1;return;}if(_0x17ffe5[_0x28d4a3(0x178)]===_0x28d4a3(0x22b)){const _0x46783f=I(_0x17ffe5[_0x28d4a3(0x1fe)]);if(_0x1393f5[_0x28d4a3(0x179)])_0x11a1cd({..._0x46783f,'status':_0x28d4a3(0x22b)},_0x1393f5);else{const _0x77144e=[_0x28d4a3(0x152)+_0x17ffe5[_0x28d4a3(0x1fe)][_0x28d4a3(0x233)]+_0x28d4a3(0x21e),_0x28d4a3(0x1f3)+(_0x17ffe5['state'][_0x28d4a3(0x19b)]??_0x28d4a3(0x202))+(_0x17ffe5['state'][_0x28d4a3(0x1c0)]?_0x28d4a3(0x1e0)+_0x17ffe5[_0x28d4a3(0x1fe)]['transactionHash']:'')];for(const _0x4eb9f5 of _0x17ffe5[_0x28d4a3(0x1fe)][_0x28d4a3(0x1af)]??[])_0x77144e[_0x28d4a3(0x19c)](_0x28d4a3(0x14c)+(_0x4eb9f5['code']??_0x28d4a3(0x22b))+':\x20'+(_0x4eb9f5[_0x28d4a3(0x1c3)]??JSON['stringify'](_0x4eb9f5)));_0x77144e[_0x28d4a3(0x19c)](_0x28d4a3(0x1d9)+_0x17ffe5['state'][_0x28d4a3(0x233)]+_0x28d4a3(0x146)),_0x1ab7b2(_0x77144e['join']('\x0a')+'\x0a');}process[_0x28d4a3(0x221)]=0x1;return;}if(['expired',_0x28d4a3(0x235),_0x28d4a3(0x1be),_0x28d4a3(0x1a9)][_0x28d4a3(0x1d7)](_0x17ffe5[_0x28d4a3(0x178)])){const _0x58adee=_0x17ffe5[_0x28d4a3(0x1fe)];if(_0x1393f5['json'])_0x11a1cd({...I(_0x58adee),'status':_0x17ffe5[_0x28d4a3(0x178)]},_0x1393f5);else{const _0x780b9a=_0x58adee[_0x28d4a3(0x18b)]??_0x58adee[_0x28d4a3(0x228)],_0x32e6a8=[_0x28d4a3(0x1ce),_0x28d4a3(0x18c)];_0x780b9a?.[_0x28d4a3(0x139)]&&_0x32e6a8['push'](_0x28d4a3(0x204)+_0x780b9a['hash']+(_0x780b9a[_0x28d4a3(0x1f7)]?'\x20('+_0x780b9a[_0x28d4a3(0x1f7)]+')':'')),_0x780b9a?.['reason']&&_0x32e6a8[_0x28d4a3(0x19c)](_0x28d4a3(0x182)+_0x780b9a[_0x28d4a3(0x17b)]),_0x780b9a?.['explorerUrl']&&_0x32e6a8['push'](_0x28d4a3(0x1d5)+_0x780b9a[_0x28d4a3(0x207)]),_0x58adee['transactionHash']&&_0x58adee[_0x28d4a3(0x1c0)]!==_0x780b9a?.[_0x28d4a3(0x139)]&&_0x32e6a8['push']('transaction:\x20'+_0x58adee[_0x28d4a3(0x1c0)]),_0x58adee[_0x28d4a3(0x233)]&&_0x32e6a8[_0x28d4a3(0x19c)](_0x28d4a3(0x227)+_0x58adee['orderId']),_0x1ab7b2(_0x32e6a8['join']('\x0a')+'\x0a');}process[_0x28d4a3(0x221)]=0x1;return;}if(_0x17ffe5[_0x28d4a3(0x178)]!==_0x28d4a3(0x14b))throw new Error('order\x20ended\x20with\x20status:\x20'+_0x17ffe5['status']+';\x20inspect\x20it\x20with\x20colony\x20order\x20show\x20'+_0x17ffe5[_0x28d4a3(0x1fe)][_0x28d4a3(0x233)]+_0x28d4a3(0x146));_0x11a1cd(_0x1393f5[_0x28d4a3(0x179)]?I(_0x17ffe5[_0x28d4a3(0x1fe)]):oe(_0x17ffe5['state']),_0x1393f5);}function K(_0xca3e3e){const _0x504b59=_0x434f,_0x16fc7f=_0x85a4a1(_0xca3e3e),_0x5637d5=['parent:\x20\x20\x20\x20'+_0x16fc7f['id'],'state:\x20\x20\x20\x20\x20'+(_0x16fc7f[_0x504b59(0x1fe)]??''),'template:\x20\x20'+(_0x16fc7f[_0x504b59(0x1cc)]??''),_0x504b59(0x173)+b(_0x16fc7f[_0x504b59(0x210)],0x1f4),_0x504b59(0x168)+(_0x16fc7f[_0x504b59(0x22c)]??'')];return _0x16fc7f[_0x504b59(0x1f2)]&&_0x5637d5[_0x504b59(0x19c)](_0x504b59(0x150)+_0x16fc7f[_0x504b59(0x1f2)]['id']+_0x504b59(0x176)+(_0x16fc7f[_0x504b59(0x1f2)][_0x504b59(0x184)]??'')+_0x504b59(0x1ed)+_0x16fc7f[_0x504b59(0x1f2)][_0x504b59(0x20e)]['length']),_0x5637d5[_0x504b59(0x144)]('\x0a');}function ie(_0x1a90ee){const _0x31e505=_0x434f;return _0x1a90ee?_0x1a90ee[_0x31e505(0x1b7)]?'project:\x20\x20\x20'+b(_0x1a90ee['summary'],0x1f4):_0x1a90ee['id']?_0x31e505(0x150)+_0x1a90ee['id']:null:null;}function J(_0xa685b4,_0x29055e,_0x29495a,_0x529ca8){const _0x4f3833=_0x434f,_0x12e04a=[];_0x529ca8&&_0x12e04a[_0x4f3833(0x19c)](K(_0x529ca8)),_0x12e04a[_0x4f3833(0x19c)](_0x4f3833(0x1ef)+_0xa685b4),_0x12e04a[_0x4f3833(0x19c)]('input:'),_0x12e04a[_0x4f3833(0x19c)](JSON[_0x4f3833(0x1a5)](_0x29055e,null,0x2)),_0x12e04a['push'](C(_0x29495a));const _0x2296ce=ie(_0x29495a[_0x4f3833(0x1f2)]);return _0x2296ce&&_0x12e04a[_0x4f3833(0x19c)](_0x2296ce),_0x12e04a[_0x4f3833(0x144)]('\x0a');}function O(_0x2a80bc){const _0xda3409=_0x434f;return _0x2a80bc['file']!==void 0x0||_0x2a80bc[_0xda3409(0x1a4)]!==void 0x0||_0x2a80bc['skill']!==void 0x0||_0x2a80bc['template']!==void 0x0||Array[_0xda3409(0x20b)](_0x2a80bc[_0xda3409(0x211)])&&_0x2a80bc[_0xda3409(0x211)][_0xda3409(0x1ae)]>0x0;}function N(_0x36cfdb){const _0x390b0c=_0x434f;return _0x36cfdb[_0x390b0c(0x226)]!==void 0x0||_0x36cfdb[_0x390b0c(0x208)]!==void 0x0||_0x36cfdb[_0x390b0c(0x1cc)]!==void 0x0||Array[_0x390b0c(0x20b)](_0x36cfdb[_0x390b0c(0x211)])&&_0x36cfdb[_0x390b0c(0x211)][_0x390b0c(0x1ae)]>0x0;}function re(_0x19b5ad,_0x272539){const _0x52e6d5=_0x434f;return typeof _0x19b5ad==_0x52e6d5(0x1d4)&&_0x19b5ad[_0x52e6d5(0x18f)]()!==''&&!O(_0x272539);}function se(_0x4325ae,_0x4f99c9){const _0x4f5139=_0x434f;return typeof _0x4325ae==_0x4f5139(0x1d4)&&_0x4325ae['trim']()!==''&&!N(_0x4f99c9);}function $(_0x5ca62c){const _0x3dfd9b=_0x434f,_0x5b2dd3=[_0x3dfd9b(0x174)+_0x5ca62c[_0x3dfd9b(0x1b7)],_0x3dfd9b(0x1d0)];_0x5ca62c[_0x3dfd9b(0x224)][_0x3dfd9b(0x1ae)]===0x0&&_0x5b2dd3[_0x3dfd9b(0x19c)](_0x3dfd9b(0x138));for(const _0x39536d of _0x5ca62c[_0x3dfd9b(0x224)])_0x5b2dd3[_0x3dfd9b(0x19c)]('\x20\x20-\x20'+_0x39536d);return _0x5b2dd3['join']('\x0a');}function U(_0x198a8a,_0x31a6d1){const _0xca620f=_0x434f,_0x58d911=[$(_0x198a8a),_0xca620f(0x1ca)+_0x31a6d1[_0xca620f(0x16e)][_0xca620f(0x1ae)]+_0xca620f(0x1ba)];for(const _0x43104f of _0x31a6d1[_0xca620f(0x16e)])_0x58d911['push'](_0xca620f(0x14c)+_0x43104f[_0xca620f(0x18d)]+':\x20'+_0x43104f[_0xca620f(0x1c3)]);return _0x58d911[_0xca620f(0x144)]('\x0a');}function W(_0x4189c7,_0x3b1015,_0x1492c0){const _0x57c8d7=_0x434f;if(_0x1492c0[_0x57c8d7(0x179)])_0x11a1cd({'action':_0x3b1015,'summary':_0x4189c7[_0x57c8d7(0x1b7)],'deliverables':_0x4189c7['deliverables'],'questions':_0x4189c7['questions'],'input':null},_0x1492c0);else{const _0x458402=_0x4189c7[_0x57c8d7(0x14a)]['map'](_0x32cef3=>_0x57c8d7(0x14c)+_0x32cef3)[_0x57c8d7(0x144)]('\x0a');_0x11a1cd($(_0x4189c7)+_0x57c8d7(0x1bf)+_0x458402,_0x1492c0);}process['exitCode']=0x1;}function ae(_0x1e452d){const _0x26b3c9=_0x434f;return _0x1e452d[_0x26b3c9(0x177)]===void 0x0&&_0x1e452d['commit']===void 0x0?null:{'repoUrl':_0x1e452d[_0x26b3c9(0x177)],'baseCommit':_0x1e452d['commit']};}async function P({api:_0x5c34ea,home:_0x3dca9c,objective:_0x14384e,answers:_0x12503e,parent:_0x954370=null,source:_0xf0485a=null,github:_0x2a03e7=!0x1,opts:_0xa6bf23,loadPlanner:_0x4805a9}){const _0x32f992=_0x434f;return _0x776995({'api':_0x5c34ea,'home':_0x3dca9c,'loadPlanner':_0x4805a9,'objective':_0x14384e,'answers':_0x12503e,'parent':_0x954370,'source':_0xf0485a,'github':_0x2a03e7,'ask':!_0xa6bf23[_0x32f992(0x179)]&&process[_0x32f992(0x190)][_0x32f992(0x1e6)]?_0x24b365:null});}function R(_0x2a8835,_0x2ce51c,{api:_0x579718,action:_0x9d70cc}){const _0x124c2f=_0x434f;if(!_0x2a8835)throw new Error('unknown\x20request\x20key:\x20'+_0x2ce51c);if(_0x2a8835[_0x124c2f(0x137)]!==_0x579718)throw new Error('order\x20'+_0x2a8835[_0x124c2f(0x1e9)]+_0x124c2f(0x16f)+_0x2a8835['api']+_0x124c2f(0x1f4)+_0x2a8835['api']);if(_0x2a8835[_0x124c2f(0x1a8)]!==_0x9d70cc)throw new Error('request\x20key\x20'+_0x2a8835[_0x124c2f(0x1e9)]+_0x124c2f(0x1d1)+_0x2a8835[_0x124c2f(0x1a8)]+_0x124c2f(0x200)+_0x9d70cc);if(!_0x2a8835['input']||typeof _0x2a8835[_0x124c2f(0x1b5)]!=_0x124c2f(0x17c)||Array[_0x124c2f(0x20b)](_0x2a8835['input']))throw new Error('request\x20key\x20'+_0x2a8835[_0x124c2f(0x1e9)]+_0x124c2f(0x236));return _0x2a8835[_0x124c2f(0x1b5)];}function pe(_0x5b368c,_0x12d4f4){const _0x3e6ed9=_0x434f;return _0x3e6ed9(0x20c)+_0x5b368c[_0x3e6ed9(0x137)]+_0x3e6ed9(0x1e3)+_0x12d4f4['home']+'\x20task\x20create\x20--request-key\x20'+_0x5b368c['requestKey'];}function ue(_0x2b67a8,_0x8024c0){const _0x49ec69=_0x434f;return _0x49ec69(0x20c)+_0x2b67a8[_0x49ec69(0x137)]+_0x49ec69(0x1e3)+_0x8024c0[_0x49ec69(0x175)]+_0x49ec69(0x1e2)+_0x2b67a8[_0x49ec69(0x1b5)][_0x49ec69(0x15f)]+_0x49ec69(0x19d)+_0x2b67a8[_0x49ec69(0x1e9)];}function ke(_0xbebcb8,{loadPlanner:_0x2a7079=_0x4dd879}={}){const _0x4a90f4=_0x434f,_0x855834=_0xbebcb8[_0x4a90f4(0x1ee)](_0x4a90f4(0x206))['description'](_0x4a90f4(0x140));_0x2bcb6c(_0x855834),_0x855834[_0x4a90f4(0x1ee)](_0x4a90f4(0x209))[_0x4a90f4(0x193)]('list\x20jobs')[_0x4a90f4(0x1d2)]('--q\x20<text>',_0x4a90f4(0x21a))[_0x4a90f4(0x1d2)](_0x4a90f4(0x163),_0x4a90f4(0x1e5))[_0x4a90f4(0x1d2)](_0x4a90f4(0x1ab),_0x4a90f4(0x1bc))[_0x4a90f4(0x1d2)](_0x4a90f4(0x14e),_0x4a90f4(0x1c9))[_0x4a90f4(0x1d2)](_0x4a90f4(0x16c),_0x4a90f4(0x197))[_0x4a90f4(0x1a8)](async(_0x24ff45,_0x28bd58)=>{const _0x535151=_0x4a90f4,_0x103e5=_0x28bd58[_0x535151(0x149)](),_0x6314d7=await _0x11f4e2(_0x103e5[_0x535151(0x137)],Z(_0x103e5));_0x11a1cd(_0x103e5['json']?_0x6314d7[_0x535151(0x1cd)]:ee(_0x6314d7[_0x535151(0x1cd)]),_0x103e5);}),_0x855834[_0x4a90f4(0x1ee)]('show\x20<id>')[_0x4a90f4(0x193)](_0x4a90f4(0x160))[_0x4a90f4(0x1a8)](async(_0x44cedc,_0xc74e67,_0x3260fa)=>{const _0x543eef=_0x4a90f4,_0xaf3cd4=_0x3260fa[_0x543eef(0x149)](),_0x501457=await _0x11f4e2(_0xaf3cd4['api'],'/jobs/'+encodeURIComponent(_0x44cedc));_0x11a1cd(_0xaf3cd4[_0x543eef(0x179)]?_0x501457[_0x543eef(0x1cd)]:te(_0x501457[_0x543eef(0x1cd)]),_0xaf3cd4);}),_0x855834[_0x4a90f4(0x1ee)](_0x4a90f4(0x1ad))[_0x4a90f4(0x193)](_0x4a90f4(0x1ac))[_0x4a90f4(0x1a8)](async(_0x39a9b5,_0x2a2ddd,_0x1f72be)=>{const _0x479221=_0x4a90f4,_0x540ab6=_0x1f72be[_0x479221(0x149)](),_0x49c881=await _0x11f4e2(_0x540ab6[_0x479221(0x137)],_0x479221(0x1a2)+encodeURIComponent(_0x39a9b5)+_0x479221(0x17f));_0x11a1cd(_0x540ab6[_0x479221(0x179)]?_0x49c881['data']:A(_0x49c881[_0x479221(0x1cd)]),_0x540ab6);}),_0x855834[_0x4a90f4(0x1ee)]('wait\x20<id>')['description']('poll\x20a\x20job\x20result\x20until\x20it\x20completes,\x20fails\x20or\x20times\x20out')[_0x4a90f4(0x1d2)](_0x4a90f4(0x217),_0x4a90f4(0x1f6),String(_0x502ffb))[_0x4a90f4(0x1d2)](_0x4a90f4(0x167),_0x4a90f4(0x22e),String(_0x4a4dfa))[_0x4a90f4(0x1a8)](async(_0x3426e3,_0x4b652f,_0x19f783)=>{const _0x58fa4b=_0x4a90f4,_0x1639dc=_0x19f783['optsWithGlobals'](),_0x4724b7=await _0xe1778({'api':_0x1639dc[_0x58fa4b(0x137)],'id':_0x3426e3,'interval':_0x1639dc['interval'],'timeout':_0x1639dc[_0x58fa4b(0x143)],'onProgress':_0x3629c0=>{const _0x4838f8=_0x58fa4b;_0x3629c0[_0x4838f8(0x1c2)]===_0x4838f8(0x15c)?_0x1ab7b2(_0x4838f8(0x1e4)+_0x3629c0[_0x4838f8(0x1fe)]+_0x4838f8(0x225)+_0x3629c0['complete']+'\x20(poll\x20'+_0x3629c0[_0x4838f8(0x1df)]+',\x20'+(_0x3629c0[_0x4838f8(0x159)]/0x3e8)[_0x4838f8(0x214)](0x1)+_0x4838f8(0x16b)):_0x3629c0[_0x4838f8(0x1c2)]===_0x4838f8(0x218)&&_0x1ab7b2(_0x4838f8(0x1e4)+(_0x3629c0[_0x4838f8(0x178)]?_0x4838f8(0x19f)+_0x3629c0[_0x4838f8(0x178)]:_0x4838f8(0x186))+_0x4838f8(0x21d)+(_0x3629c0['delayMs']/0x3e8)['toFixed'](0x1)+_0x4838f8(0x181)+_0x3629c0['retries']+')\x0a');}});if(_0x4724b7[_0x58fa4b(0x1d6)]===_0x58fa4b(0x1a0)){_0x1ab7b2(_0x58fa4b(0x1fa)),process[_0x58fa4b(0x221)]=0x82;return;}_0x4724b7[_0x58fa4b(0x222)]&&_0x11a1cd(_0x1639dc['json']?_0x4724b7[_0x58fa4b(0x222)]:A(_0x4724b7[_0x58fa4b(0x222)]),_0x1639dc),_0x4724b7[_0x58fa4b(0x1d6)]!==_0x58fa4b(0x187)&&(_0x1ab7b2(_0x58fa4b(0x1e4)+_0x4724b7[_0x58fa4b(0x157)]+'\x0a'),process['exitCode']=0x1);}),_0x855834[_0x4a90f4(0x1ee)](_0x4a90f4(0x20f))[_0x4a90f4(0x193)](_0x4a90f4(0x1d3))['requiredOption'](_0x4a90f4(0x20d),_0x4a90f4(0x1a1))['action'](async(_0x4cdd0d,_0x4e79cd,_0x369910)=>{const _0x37295d=_0x4a90f4,_0x786d80=_0x369910[_0x37295d(0x149)](),_0xae27e0=await _0x33c8ee({'api':_0x786d80['api'],'id':_0x4cdd0d,'out':_0x786d80[_0x37295d(0x1f9)],'onProgress':_0xc48bbc=>{const _0x3c1424=_0x37295d;_0xc48bbc['type']===_0x3c1424(0x234)&&_0x1ab7b2(_0x3c1424(0x141)+_0xc48bbc[_0x3c1424(0x211)]+_0x3c1424(0x1ea)+_0xc48bbc[_0x3c1424(0x226)]+'\x0a');}});_0x11a1cd(_0x786d80[_0x37295d(0x179)]?_0xae27e0:ne(_0xae27e0),_0x786d80);}),_0x855834['command'](_0x4a90f4(0x14d))['description'](_0x4a90f4(0x17a))[_0x4a90f4(0x17d)](_0x4a90f4(0x16d),_0x4a90f4(0x1ec))[_0x4a90f4(0x1d2)](_0x4a90f4(0x1e7),'action\x20to\x20check\x20(defaults\x20from\x20parentJobId)')['action'](async(_0x143b99,_0x597373)=>{const _0x3e26f3=_0x4a90f4,_0x2fc997=_0x597373[_0x3e26f3(0x149)](),_0x509d20=await _0x39c26e(_0x2fc997[_0x3e26f3(0x226)]),_0x3354f5=_0x2fc997[_0x3e26f3(0x1a8)]??_0x4a2a86(_0x509d20),_0x22eb50=await _0x281c72(_0x2fc997[_0x3e26f3(0x137)],_0x509d20,_0x3354f5);_0x11a1cd(_0x2fc997[_0x3e26f3(0x179)]?_0x22eb50:C(_0x22eb50),_0x2fc997);}),_0x855834['command'](_0x4a90f4(0x13b))[_0x4a90f4(0x193)]('check,\x20quote,\x20sign\x20and\x20submit\x20a\x20job\x20file')[_0x4a90f4(0x17d)](_0x4a90f4(0x16d),_0x4a90f4(0x1ec))[_0x4a90f4(0x1d2)]('--request-key\x20<uuid>',_0x4a90f4(0x13d))[_0x4a90f4(0x1a8)](async(_0x4574bb,_0x2ec930)=>{const _0x10ed47=_0x4a90f4,_0x2b42d1=_0x2ec930[_0x10ed47(0x149)](),_0x4fa3da=_0x2b42d1[_0x10ed47(0x1e9)]?null:await x(_0x2b42d1,_0x10ed47(0x203)),_0x253a11=await _0x17effd({'api':_0x2b42d1['api'],'home':_0x2b42d1['home'],'file':_0x2b42d1[_0x10ed47(0x226)],'action':'job.open','requestKey':_0x2b42d1[_0x10ed47(0x1e9)],'yes':_0x2b42d1[_0x10ed47(0x1f5)],'keyEnv':_0x2b42d1['keyEnv'],'rpc':_0x2b42d1[_0x10ed47(0x21b)],'paymentChain':_0x2b42d1[_0x10ed47(0x1dd)]??_0x4fa3da?.[_0x10ed47(0x1dd)],'payWith':_0x2b42d1[_0x10ed47(0x219)]??_0x4fa3da?.[_0x10ed47(0x219)],'onProgress':_0x39d34c(_0x2b42d1)});T(_0x253a11,_0x2b42d1);}),_0x855834[_0x4a90f4(0x1ee)]('create\x20[objective]')[_0x4a90f4(0x193)](_0x4a90f4(0x20a))[_0x4a90f4(0x1d2)](_0x4a90f4(0x16d),_0x4a90f4(0x1b6))[_0x4a90f4(0x1d2)]('--preset\x20<name>',_0x4a90f4(0x153))[_0x4a90f4(0x1d2)]('--skill\x20<id>','runnable\x20skill\x20id')[_0x4a90f4(0x1d2)]('--template\x20<name>',_0x4a90f4(0x238))['option'](_0x4a90f4(0x13a),_0x4a90f4(0x1a6),(_0xae00d,_0x26f4d6)=>[..._0x26f4d6,_0xae00d],[])[_0x4a90f4(0x1d2)]('--repo\x20<url>',_0x4a90f4(0x1ff))[_0x4a90f4(0x1d2)]('--commit\x20<sha>',_0x4a90f4(0x188))[_0x4a90f4(0x1d2)](_0x4a90f4(0x151),_0x4a90f4(0x1f0))[_0x4a90f4(0x1d2)](_0x4a90f4(0x156),_0x4a90f4(0x230),(_0xc434b0,_0x4a5aaa)=>[..._0x4a5aaa,_0xc434b0],[])['option'](_0x4a90f4(0x15e),_0x4a90f4(0x1fb))[_0x4a90f4(0x1d2)](_0x4a90f4(0x23a),_0x4a90f4(0x22a))[_0x4a90f4(0x1d2)](_0x4a90f4(0x15b),_0x4a90f4(0x13d))[_0x4a90f4(0x1a8)](async(_0x20dcc3,_0x549e57,_0x142b6c)=>{const _0x369a37=_0x4a90f4,_0x2285da=_0x142b6c[_0x369a37(0x149)](),_0xcc65ad=_0x2285da[_0x369a37(0x1b0)]||_0x2285da[_0x369a37(0x1e9)]?null:await x(_0x2285da,_0x369a37(0x203)),_0x4fbffa=re(_0x20dcc3,_0x2285da);let _0x3d7f5c,_0x39468c=null;if(_0x2285da[_0x369a37(0x1e9)]&&!O(_0x2285da)&&(_0x20dcc3===void 0x0||_0x4fbffa)){const _0x45109e=await _0x35669f(_0x2285da[_0x369a37(0x175)],_0x2285da[_0x369a37(0x1e9)]);if(_0x3d7f5c=R(_0x45109e,_0x2285da[_0x369a37(0x1e9)],{'api':_0x2285da['api'],'action':_0x369a37(0x203)}),_0x20dcc3!==void 0x0&&_0x20dcc3!==_0x3d7f5c[_0x369a37(0x210)])throw new Error('request\x20key\x20'+_0x2285da[_0x369a37(0x1e9)]+_0x369a37(0x237));}else{if(_0x4fbffa){if(_0x39468c=await P({'api':_0x2285da[_0x369a37(0x137)],'home':_0x2285da[_0x369a37(0x175)],'objective':_0x20dcc3,'answers':_0x2285da[_0x369a37(0x198)],'source':ae(_0x2285da),'github':_0x2285da[_0x369a37(0x1cf)]===!0x0,'opts':_0x2285da,'loadPlanner':_0x2a7079}),_0x39468c['input']===null){W(_0x39468c,_0x369a37(0x203),_0x2285da);return;}_0x3d7f5c=_0x39468c[_0x369a37(0x1b5)];}else{const _0x223e38=_0x2285da['file']?await _0x39c26e(_0x2285da[_0x369a37(0x226)]):void 0x0;_0x3d7f5c=await _0x2616f0({'fileInput':_0x223e38,'objective':_0x20dcc3,'preset':_0x2285da[_0x369a37(0x1a4)],'skill':_0x2285da['skill'],'template':_0x2285da[_0x369a37(0x1cc)],'paths':_0x2285da[_0x369a37(0x211)],'repo':_0x2285da[_0x369a37(0x177)],'commit':_0x2285da[_0x369a37(0x223)],'github':_0x2285da[_0x369a37(0x1cf)]});}}if(_0x2285da[_0x369a37(0x162)]&&(await _0xff79a7(_0x2285da[_0x369a37(0x162)],_0x3d7f5c),_0x2285da[_0x369a37(0x179)]||_0x1ab7b2(_0x369a37(0x22f)+_0x2285da[_0x369a37(0x162)]+'\x0a')),_0x2285da['dryRun']){const _0x50581f=await _0x281c72(_0x2285da['api'],_0x3d7f5c,_0x369a37(0x203));_0x2285da[_0x369a37(0x179)]?_0x11a1cd({'action':'job.open',..._0x39468c?{'summary':_0x39468c[_0x369a37(0x1b7)],'deliverables':_0x39468c[_0x369a37(0x224)]}:{},'input':_0x3d7f5c,'check':_0x50581f},_0x2285da):_0x11a1cd(_0x39468c?U(_0x39468c,_0x50581f):J(_0x369a37(0x203),_0x3d7f5c,_0x50581f),_0x2285da),_0x50581f[_0x369a37(0x16e)][_0x369a37(0x1ae)]>0x0&&(process[_0x369a37(0x221)]=0x1);return;}_0x39468c&&!_0x2285da['json']&&_0x1ab7b2($(_0x39468c)+'\x0a');const _0x2f9111=await _0x17effd({'api':_0x2285da['api'],'home':_0x2285da[_0x369a37(0x175)],'input':_0x3d7f5c,'action':_0x369a37(0x203),'requestKey':_0x2285da[_0x369a37(0x1e9)],'plan':_0x39468c?{'summary':_0x39468c[_0x369a37(0x1b7)],'deliverables':_0x39468c['deliverables']}:void 0x0,'yes':_0x2285da['yes'],'keyEnv':_0x2285da['keyEnv'],'rpc':_0x2285da[_0x369a37(0x21b)],'paymentChain':_0x2285da['paymentChain']??_0xcc65ad?.[_0x369a37(0x1dd)],'payWith':_0x2285da[_0x369a37(0x219)]??_0xcc65ad?.[_0x369a37(0x219)],'onProgress':_0x39d34c(_0x2285da),'retryCommand':_0x40d933=>pe(_0x40d933,_0x2285da)});T(_0x2f9111,_0x2285da);}),_0x855834[_0x4a90f4(0x1ee)](_0x4a90f4(0x161))[_0x4a90f4(0x193)](_0x4a90f4(0x1da))['option'](_0x4a90f4(0x16d),_0x4a90f4(0x14f))[_0x4a90f4(0x1d2)](_0x4a90f4(0x1a3),'runnable\x20skill\x20id')['option'](_0x4a90f4(0x170),'job\x20template')['option'](_0x4a90f4(0x13a),_0x4a90f4(0x1a6),(_0x473e16,_0x3fdf50)=>[..._0x3fdf50,_0x473e16],[])[_0x4a90f4(0x1d2)](_0x4a90f4(0x156),_0x4a90f4(0x230),(_0xb21fad,_0x1cc5fb)=>[..._0x1cc5fb,_0xb21fad],[])[_0x4a90f4(0x1d2)](_0x4a90f4(0x15e),_0x4a90f4(0x1fb))[_0x4a90f4(0x1d2)]('--save\x20<path>','save\x20the\x20input\x20JSON\x20without\x20overwriting')[_0x4a90f4(0x1d2)]('--request-key\x20<uuid>',_0x4a90f4(0x13d))[_0x4a90f4(0x1a8)](async(_0x367ae3,_0x3e5e59,_0x244be6,_0x5d9e82)=>{const _0x3c7acc=_0x4a90f4,_0x26e595=_0x5d9e82[_0x3c7acc(0x149)](),_0x236cbe=_0x26e595[_0x3c7acc(0x1b0)]||_0x26e595['requestKey']?null:await x(_0x26e595,_0x3c7acc(0x1bd)),_0x22b1c3=se(_0x3e5e59,_0x26e595);let _0x3f9c25,_0x39d9d1,_0x3df553=null;if(_0x26e595[_0x3c7acc(0x1e9)]&&!N(_0x26e595)&&(_0x3e5e59===void 0x0||_0x22b1c3)){const _0x21e4d2=await _0x35669f(_0x26e595[_0x3c7acc(0x175)],_0x26e595[_0x3c7acc(0x1e9)]);if(_0x3f9c25=R(_0x21e4d2,_0x26e595[_0x3c7acc(0x1e9)],{'api':_0x26e595[_0x3c7acc(0x137)],'action':_0x3c7acc(0x1bd)}),_0x3f9c25[_0x3c7acc(0x15f)]!==_0x367ae3)throw new Error(_0x3c7acc(0x213)+_0x26e595[_0x3c7acc(0x1e9)]+_0x3c7acc(0x1c1)+(_0x3f9c25[_0x3c7acc(0x15f)]??'<none>')+',\x20not\x20'+_0x367ae3);if(_0x3e5e59!==void 0x0&&_0x3e5e59!==_0x3f9c25[_0x3c7acc(0x210)])throw new Error(_0x3c7acc(0x213)+_0x26e595['requestKey']+'\x20was\x20created\x20for\x20a\x20different\x20objective;\x20omit\x20the\x20new\x20objective\x20to\x20resume\x20it');_0x39d9d1=(await _0x11f4e2(_0x26e595[_0x3c7acc(0x137)],_0x3c7acc(0x1a2)+encodeURIComponent(_0x367ae3)))[_0x3c7acc(0x1cd)];}else{if(_0x22b1c3){if(_0x39d9d1=(await _0x11f4e2(_0x26e595[_0x3c7acc(0x137)],'/jobs/'+encodeURIComponent(_0x367ae3)))[_0x3c7acc(0x1cd)],_0x3df553=await P({'api':_0x26e595[_0x3c7acc(0x137)],'home':_0x26e595['home'],'objective':_0x3e5e59,'answers':_0x26e595['answer'],'parent':_0x39d9d1,'opts':_0x26e595,'loadPlanner':_0x2a7079}),_0x3df553[_0x3c7acc(0x1b5)]===null){W(_0x3df553,'job.continue',_0x26e595);return;}_0x3f9c25=_0x3df553['input'],_0x3f9c25[_0x3c7acc(0x15f)]!==_0x367ae3&&(_0x3f9c25={..._0x3f9c25,'parentJobId':_0x367ae3});}else{const _0x12f01d=_0x26e595[_0x3c7acc(0x226)]?await _0x39c26e(_0x26e595[_0x3c7acc(0x226)]):void 0x0;_0x3f9c25=await _0x14b6ea({'id':_0x367ae3,'fileInput':_0x12f01d,'objective':_0x3e5e59,'skill':_0x26e595[_0x3c7acc(0x208)],'template':_0x26e595[_0x3c7acc(0x1cc)],'paths':_0x26e595[_0x3c7acc(0x211)]}),_0x39d9d1=(await _0x11f4e2(_0x26e595[_0x3c7acc(0x137)],_0x3c7acc(0x1a2)+encodeURIComponent(_0x367ae3)))[_0x3c7acc(0x1cd)];}}if(_0x26e595[_0x3c7acc(0x162)]&&(await _0xff79a7(_0x26e595[_0x3c7acc(0x162)],_0x3f9c25),_0x26e595[_0x3c7acc(0x179)]||_0x1ab7b2('saved\x20input:\x20'+_0x26e595[_0x3c7acc(0x162)]+'\x0a')),_0x26e595['dryRun']){const _0x49aab5=await _0x281c72(_0x26e595['api'],_0x3f9c25,_0x3c7acc(0x1bd));_0x26e595['json']?_0x11a1cd({'action':_0x3c7acc(0x1bd),..._0x3df553?{'summary':_0x3df553[_0x3c7acc(0x1b7)],'deliverables':_0x3df553[_0x3c7acc(0x224)]}:{},'parent':_0x85a4a1(_0x39d9d1),'input':_0x3f9c25,'check':_0x49aab5},_0x26e595):_0x11a1cd(_0x3df553?U(_0x3df553,_0x49aab5):J(_0x3c7acc(0x1bd),_0x3f9c25,_0x49aab5,_0x39d9d1),_0x26e595),_0x49aab5[_0x3c7acc(0x16e)][_0x3c7acc(0x1ae)]>0x0&&(process[_0x3c7acc(0x221)]=0x1);return;}_0x3df553&&!_0x26e595[_0x3c7acc(0x179)]&&_0x1ab7b2($(_0x3df553)+'\x0a');const _0x4b9409=await _0x17effd({'api':_0x26e595[_0x3c7acc(0x137)],'home':_0x26e595[_0x3c7acc(0x175)],'input':_0x3f9c25,'action':_0x3c7acc(0x1bd),'requestKey':_0x26e595[_0x3c7acc(0x1e9)],'plan':_0x3df553?{'summary':_0x3df553['summary'],'deliverables':_0x3df553['deliverables']}:void 0x0,'yes':_0x26e595[_0x3c7acc(0x1f5)],'keyEnv':_0x26e595[_0x3c7acc(0x155)],'rpc':_0x26e595[_0x3c7acc(0x21b)],'paymentChain':_0x26e595[_0x3c7acc(0x1dd)]??_0x236cbe?.[_0x3c7acc(0x1dd)],'payWith':_0x26e595[_0x3c7acc(0x219)]??_0x236cbe?.['payWith'],'onProgress':_0x39d34c(_0x26e595),'retryCommand':_0x54ca91=>ue(_0x54ca91,_0x26e595)});_0x4b9409[_0x3c7acc(0x1fe)]&&(_0x4b9409['state'][_0x3c7acc(0x232)]=_0x85a4a1(_0x39d9d1)),T(_0x4b9409,_0x26e595);});}export{ke as registerTaskCommands};
@@ -1 +1 @@
1
- import{erc20Abi as _0x7f37dd,parseUnits as _0xfbd0c0}from'viem';import{confirmAction as _0x38bf9c,getRpcClients as _0xb1d9e3,print as _0xe47798}from'../shared.mjs';import{loadPaymentConfig as _0x468388}from'../lib/payments.mjs';import{selectedPaymentNetwork as _0x4c0b9e,savePaymentNetwork as _0x98571a}from'../lib/payment-networks.mjs';import{walletInfo as _0x2d5ca3,saveLocalWallet as _0x11d0d2,backupWallet as _0x19da7d,restoreWallet as _0x48a6c5,walletFile as _0x54d3b9,listWallets as _0x5733fa,selectWallet as _0x30481f}from'../lib/local-wallet.mjs';function _0x8e65(){const _0x18bce6=['copy\x20the\x20encrypted\x20wallet\x20file;\x20never\x20export\x20a\x20plaintext\x20key','Confirm\x20password','length','--amount\x20<amount>','description','writeContract','Receive\x20on\x20','Passwords\x20do\x20not\x20match.','require\x20this\x20wallet\x20address\x20for\x20the\x20authorization','key','api','--amount\x20must\x20be\x20greater\x20than\x20zero','decimals','job.open','\x20(current)','payment\x20allowance:\x20\x20','map','symbol','\x0aAsset:\x20','approve\x20transaction\x20failed:\x20','priceAtomic','\x0aEncrypted\x20file:\x20','asset','allowance','requiredOption','action','list','show\x20IMD\x20balance\x20and\x20payment\x20allowance\x20on\x20the\x20selected\x20network','list\x20saved\x20local\x20wallets\x20and\x20the\x20current\x20selection','address','\x0aSpender:\x20','\x0aBack\x20up\x20this\x20file\x20and\x20keep\x20your\x20password.\x20Both\x20are\x20needed\x20to\x20restore\x20your\x20wallet.\x0aRun\x20colony\x20wallet\x20receive\x20to\x20deposit\x20funds.','authorized\x20','\x20atomic)','balance:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','address:\x20','encrypted\x20JSON\x20keystore\x20backup','optsWithGlobals','Local\x20wallet\x20password\x20(at\x20least\x208\x20characters)','chainName','payment\x20coins:','Active\x20wallet:\x20','quote\x20price:\x20\x20\x20\x20\x20\x20\x20\x20','\x20in\x20the\x20sending\x20wallet.\x20Include\x20ETH\x20for\x20network\x20fees.','path','\x20IMD\x20on\x20','Backup\x20password','asset:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','create\x20a\x20new\x20password-encrypted\x20local\x20wallet','\x0aCoins:\x20','qrFile','token\x20amount\x20to\x20approve,\x20in\x20whole\x20tokens','chain','select\x20a\x20saved\x20wallet','waitForTransactionReceipt','balanceAtomic','write','option','network\x20[name]','\x0aThis\x20transaction\x20also\x20uses\x20ETH\x20for\x20network\x20fees.','coins','--file\x20<file>','use\x20<address>','new\x20backup\x20file\x20path','wallet','active','\x0atx:\x20','amount','authorize\x20an\x20exact\x20IMD\x20amount\x20on\x20the\x20selected\x20payment\x20network','Private\x20key\x20(hidden)','join','out','receive','backup','import\x20a\x20private\x20key\x20using\x20hidden\x20terminal\x20input','approve','address:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','balance','status','--wallet\x20<address>','--out\x20<file>','name','command','home','\x0aSelect\x20','json','configured','allowanceAtomic','file','save\x20an\x20SVG\x20QR\x20code\x20to\x20a\x20new\x20file','network:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','show\x20the\x20deposit\x20address\x20and\x20QR\x20code\x20on\x20the\x20selected\x20network'];_0x8e65=function(){return _0x18bce6;};return _0x8e65();}import{readPassword as _0x2dfd36}from'../lib/password.mjs';import{walletStatus as _0x3459c5}from'../lib/wallet-status.mjs';import{receiveWallet as _0x5b9acb,receiveQr as _0x189770,saveReceiveQr as _0x3e2962}from'../lib/wallet-receive.mjs';async function k(){const _0x5e3aba=_0x1d0b,_0x35a49d=await _0x2dfd36(_0x5e3aba(0x167));if(_0x35a49d!==await _0x2dfd36(_0x5e3aba(0x142)))throw new Error(_0x5e3aba(0x148));return _0x35a49d;}function h(_0x2ddb8c,_0x2c8420){const _0x40f5ff=_0x1d0b;return'Wallet\x20ready:\x20'+_0x2ddb8c[_0x40f5ff(0x15e)]+_0x40f5ff(0x156)+_0x54d3b9(_0x2c8420)+_0x40f5ff(0x160);}function S(_0x5bcb70){const _0x25dc52=_0x1d0b;return _0x25dc52(0x164)+_0x5bcb70;}function _0x1d0b(_0x460f16,_0x8e65e7){_0x460f16=_0x460f16-0x141;const _0x1d0be5=_0x8e65();let _0x5a3a56=_0x1d0be5[_0x460f16];return _0x5a3a56;}function z(_0x247b7e){const _0x486155=_0x1d0b;return[_0x486155(0x18d)+_0x247b7e['address'],_0x486155(0x19b)+_0x247b7e[_0x486155(0x168)]+'\x20('+_0x247b7e['chainId']+')',_0x486155(0x170)+_0x247b7e[_0x486155(0x157)],_0x486155(0x163)+_0x247b7e[_0x486155(0x18e)]+'\x20('+_0x247b7e[_0x486155(0x178)]+_0x486155(0x162),_0x486155(0x150)+_0x247b7e[_0x486155(0x158)]+'\x20('+_0x247b7e[_0x486155(0x198)]+_0x486155(0x162),_0x486155(0x16b)+_0x247b7e['price']+'\x20('+_0x247b7e[_0x486155(0x155)]+_0x486155(0x162),_0x486155(0x169),..._0x247b7e[_0x486155(0x17d)][_0x486155(0x151)](_0x4ffe1a=>'\x20\x20'+_0x4ffe1a[_0x486155(0x152)]+':\x20'+_0x4ffe1a[_0x486155(0x18e)])][_0x486155(0x187)]('\x0a');}function J(_0x3edd11){const _0x550236=_0x1d0b,_0x1d5b11=_0x3edd11[_0x550236(0x193)](_0x550236(0x181))[_0x550236(0x145)]('create,\x20import,\x20back\x20up\x20and\x20fund\x20your\x20local\x20wallet');_0x1d5b11['command'](_0x550236(0x15b))[_0x550236(0x145)](_0x550236(0x15d))[_0x550236(0x15a)]((_0x387749,_0x404aed)=>{const _0x143e75=_0x550236,_0x5ac33f=_0x404aed[_0x143e75(0x166)](),_0x11b0a0=_0x5733fa(_0x5ac33f[_0x143e75(0x194)]);_0xe47798(_0x5ac33f[_0x143e75(0x196)]?_0x11b0a0:_0x11b0a0[_0x143e75(0x143)]?_0x11b0a0[_0x143e75(0x151)](_0x4d1471=>(_0x4d1471[_0x143e75(0x182)]?'*':'\x20')+'\x20'+_0x4d1471[_0x143e75(0x15e)]+(_0x4d1471[_0x143e75(0x182)]?_0x143e75(0x14f):''))[_0x143e75(0x187)]('\x0a'):'No\x20saved\x20wallets.\x20Create,\x20import\x20or\x20restore\x20one.',_0x5ac33f);}),_0x1d5b11[_0x550236(0x193)](_0x550236(0x17f))[_0x550236(0x145)](_0x550236(0x176))['action'](async(_0x30c896,_0x33c5c8,_0x5c91ad)=>{const _0x13c08b=_0x550236,_0x410058=_0x5c91ad['optsWithGlobals'](),_0x378629=await _0x30481f(_0x410058[_0x13c08b(0x194)],_0x30c896);_0xe47798(_0x410058[_0x13c08b(0x196)]?_0x378629:_0x13c08b(0x16a)+_0x378629[_0x13c08b(0x15e)],_0x410058);}),_0x1d5b11[_0x550236(0x193)]('create')[_0x550236(0x145)](_0x550236(0x171))['action'](async(_0xde360b,_0x4d9a11)=>{const _0x60abdd=_0x550236,_0x4e8c60=_0x4d9a11['optsWithGlobals'](),_0x5e256f=await _0x11d0d2(_0x4e8c60[_0x60abdd(0x194)],_0x5733fa(_0x4e8c60['home'])[_0x60abdd(0x143)]?void 0x0:await k());_0xe47798(_0x4e8c60[_0x60abdd(0x196)]?_0x5e256f:h(_0x5e256f,_0x4e8c60['home']),_0x4e8c60);}),_0x1d5b11['command']('import')['description'](_0x550236(0x18b))[_0x550236(0x15a)](async(_0x2c868d,_0x536729)=>{const _0x4c7735=_0x550236,_0x430dfc=_0x536729['optsWithGlobals'](),_0x4e97a8=await _0x2dfd36(_0x4c7735(0x186)),_0x229c8d=await _0x11d0d2(_0x430dfc['home'],_0x5733fa(_0x430dfc[_0x4c7735(0x194)])[_0x4c7735(0x143)]?void 0x0:await k(),_0x4e97a8);_0xe47798(_0x430dfc[_0x4c7735(0x196)]?_0x229c8d:h(_0x229c8d,_0x430dfc[_0x4c7735(0x194)]),_0x430dfc);}),_0x1d5b11[_0x550236(0x193)](_0x550236(0x18a))['description'](_0x550236(0x141))[_0x550236(0x159)](_0x550236(0x191),_0x550236(0x180))[_0x550236(0x15a)](async(_0x3d19bc,_0x4fef4b)=>{const _0x431d8b=_0x550236,_0x92b02b=_0x4fef4b['optsWithGlobals'](),_0x99fb7=await _0x19da7d(_0x92b02b[_0x431d8b(0x194)],_0x92b02b[_0x431d8b(0x188)]);_0xe47798(_0x92b02b[_0x431d8b(0x196)]?_0x99fb7:'Encrypted\x20backup\x20saved:\x20'+_0x99fb7[_0x431d8b(0x16d)]+'\x0aKeep\x20your\x20wallet\x20password\x20separately.',_0x92b02b);}),_0x1d5b11[_0x550236(0x193)]('restore')[_0x550236(0x145)]('add\x20a\x20wallet\x20from\x20an\x20encrypted\x20backup\x20and\x20select\x20it')[_0x550236(0x159)](_0x550236(0x17e),_0x550236(0x165))[_0x550236(0x15a)](async(_0x2830bf,_0x4a9adc)=>{const _0x4e61fa=_0x550236,_0x535771=_0x4a9adc[_0x4e61fa(0x166)](),_0x27fa7c=await _0x48a6c5(_0x535771['home'],_0x535771[_0x4e61fa(0x199)],await _0x2dfd36(_0x4e61fa(0x16f)));_0xe47798(_0x535771[_0x4e61fa(0x196)]?_0x27fa7c:h(_0x27fa7c,_0x535771['home']),_0x535771);}),_0x1d5b11[_0x550236(0x193)](_0x550236(0x189))[_0x550236(0x145)](_0x550236(0x19c))['option'](_0x550236(0x191),_0x550236(0x19a))['action'](async(_0x22a67c,_0x4e5f18)=>{const _0xc0d80d=_0x550236,_0x16913e=_0x4e5f18['optsWithGlobals'](),_0x1eb4a4=await _0x5b9acb(_0x16913e);if(_0x16913e[_0xc0d80d(0x188)]&&(_0x1eb4a4[_0xc0d80d(0x173)]=(await _0x3e2962(_0x1eb4a4[_0xc0d80d(0x15e)],_0x16913e[_0xc0d80d(0x188)]))[_0xc0d80d(0x16d)]),_0x16913e[_0xc0d80d(0x196)])return _0xe47798(_0x1eb4a4,_0x16913e);_0xe47798(_0xc0d80d(0x147)+_0x1eb4a4[_0xc0d80d(0x168)]+'\x0a'+_0x1eb4a4['address']+_0xc0d80d(0x172)+_0x1eb4a4['coins'][_0xc0d80d(0x187)](',\x20')+_0xc0d80d(0x195)+_0x1eb4a4[_0xc0d80d(0x168)]+_0xc0d80d(0x16c),_0x16913e),_0x1eb4a4[_0xc0d80d(0x173)]?_0xe47798('QR\x20saved:\x20'+_0x1eb4a4[_0xc0d80d(0x173)],_0x16913e):process['stdout'][_0xc0d80d(0x179)](await _0x189770(_0x1eb4a4[_0xc0d80d(0x15e)]));}),_0x1d5b11['command'](_0x550236(0x17b))[_0x550236(0x145)]('show\x20or\x20save\x20the\x20payment\x20network:\x20ethereum\x20or\x20robinhood')[_0x550236(0x15a)](async(_0x24816d,_0xc1d836,_0x2bc091)=>{const _0x37c9ab=_0x550236,_0xc14fbc=_0x2bc091[_0x37c9ab(0x166)](),_0x2ed18d=_0x24816d?await _0x98571a(_0xc14fbc['home'],_0x24816d):await _0x4c0b9e(_0xc14fbc),_0x46c10b={'network':_0x2ed18d[_0x37c9ab(0x14a)],'name':_0x2ed18d[_0x37c9ab(0x175)][_0x37c9ab(0x192)],'chainId':_0x2ed18d[_0x37c9ab(0x175)]['id']};_0xe47798(_0xc14fbc[_0x37c9ab(0x196)]?_0x46c10b:'Payment\x20network:\x20'+_0x46c10b[_0x37c9ab(0x192)]+'\x20('+_0x46c10b['network']+')',_0xc14fbc);}),_0x1d5b11[_0x550236(0x193)](_0x550236(0x15e))[_0x550236(0x145)]('print\x20your\x20public\x20wallet\x20address\x20without\x20unlocking')[_0x550236(0x15a)]((_0x25f766,_0x44e1dd)=>{const _0x2d148b=_0x550236,_0x1a4cb4=_0x44e1dd[_0x2d148b(0x166)](),_0x4d7573=_0x2d5ca3(_0x1a4cb4);if(!_0x4d7573[_0x2d148b(0x197)])throw new Error('Create\x20or\x20import\x20a\x20wallet\x20first.');_0xe47798(_0x1a4cb4[_0x2d148b(0x196)]?{'address':_0x4d7573[_0x2d148b(0x15e)]}:S(_0x4d7573[_0x2d148b(0x15e)]),_0x1a4cb4);}),_0x1d5b11[_0x550236(0x193)](_0x550236(0x18f))[_0x550236(0x145)](_0x550236(0x15c))['action'](async(_0x19a1eb,_0x46bbe9)=>{const _0x456882=_0x550236,_0x687490=_0x46bbe9[_0x456882(0x166)](),_0x3396b4=await _0x3459c5(_0x687490);_0xe47798(_0x687490[_0x456882(0x196)]?_0x3396b4:z(_0x3396b4),_0x687490);}),_0x1d5b11[_0x550236(0x193)](_0x550236(0x18c))[_0x550236(0x145)](_0x550236(0x185))[_0x550236(0x159)](_0x550236(0x144),_0x550236(0x174))[_0x550236(0x17a)](_0x550236(0x190),_0x550236(0x149))[_0x550236(0x15a)](async(_0xfa4bb8,_0x347dea)=>{const _0x182760=_0x550236,_0x38377e=_0x347dea['optsWithGlobals'](),_0x21f37d=_0x38377e[_0x182760(0x181)]??_0x2d5ca3(_0x38377e)[_0x182760(0x15e)],_0x92310a=await _0x4c0b9e(_0x38377e),{payment:_0x32757d,chainId:_0x188b36,spender:_0x36edb0}=await _0x468388(_0x38377e[_0x182760(0x14b)],_0x182760(0x14e),_0x92310a[_0x182760(0x14a)]),_0x43d46a=_0xfbd0c0(_0x38377e[_0x182760(0x184)],_0x32757d[_0x182760(0x14d)]);if(_0x43d46a<=0x0n)throw new Error(_0x182760(0x14c));await _0x38bf9c('Authorize\x20'+_0x38377e[_0x182760(0x184)]+'\x20IMD\x20for\x20payment\x20on\x20'+_0x92310a[_0x182760(0x175)]['name']+'?\x0aWallet:\x20'+_0x21f37d+_0x182760(0x153)+_0x32757d[_0x182760(0x157)]+_0x182760(0x15f)+_0x36edb0+_0x182760(0x17c),_0x38377e);const {publicClient:_0x582d4a,walletClient:_0x12c50f}=await _0xb1d9e3({..._0x38377e,'expectedWallet':_0x21f37d},_0x188b36),_0x8b2e16=await _0x12c50f[_0x182760(0x146)]({'address':_0x32757d[_0x182760(0x157)],'abi':_0x7f37dd,'functionName':_0x182760(0x18c),'args':[_0x36edb0,_0x43d46a]});if((await _0x582d4a[_0x182760(0x177)]({'hash':_0x8b2e16}))[_0x182760(0x18f)]!=='success')throw new Error(_0x182760(0x154)+_0x8b2e16);const _0x3b26c7={'transactionHash':_0x8b2e16,'chainId':_0x188b36,'asset':_0x32757d['asset'],'spender':_0x36edb0,'amount':_0x38377e[_0x182760(0x184)],'amountAtomic':String(_0x43d46a)};_0xe47798(_0x38377e[_0x182760(0x196)]?_0x3b26c7:_0x182760(0x161)+_0x38377e[_0x182760(0x184)]+_0x182760(0x16e)+_0x92310a[_0x182760(0x175)][_0x182760(0x192)]+_0x182760(0x183)+_0x8b2e16,_0x38377e);});}export{J as registerWalletCommands};
1
+ import{erc20Abi as _0x533225,parseUnits as _0x1fdcd8}from'viem';import{confirmAction as _0x33c220,getRpcClients as _0x3fd8b9,print as _0x2c8cb6}from'../shared.mjs';import{loadPaymentConfig as _0x490d93}from'../lib/payments.mjs';import{selectedPaymentNetwork as _0x295ec9}from'../lib/payment-networks.mjs';import{walletInfo as _0x2cc6cb,saveLocalWallet as _0x409d9c,backupWallet as _0x5eb53b,restoreWallet as _0x4c6f31,walletFile as _0x1ab51d,listWallets as _0x5dd19e,selectWallet as _0x526e30}from'../lib/local-wallet.mjs';import{readPassword as _0x1d8192}from'../lib/password.mjs';import{walletStatus as _0x49b775}from'../lib/wallet-status.mjs';import{receiveWallet as _0x61022,receiveQr as _0x572f4e,saveReceiveQr as _0x318d9c}from'../lib/wallet-receive.mjs';async function v(){const _0x58a415=_0x38f2,_0x179994=await _0x1d8192(_0x58a415(0xdd));if(_0x179994!==await _0x1d8192(_0x58a415(0xcb)))throw new Error(_0x58a415(0xc0));return _0x179994;}function _0x38f2(_0x537c22,_0x1d2251){_0x537c22=_0x537c22-0xa8;const _0x38f22c=_0x1d22();let _0x3ed0bb=_0x38f22c[_0x537c22];return _0x3ed0bb;}function w(_0x191208,_0x1af2d5){const _0x13669f=_0x38f2;return'Wallet\x20ready:\x20'+_0x191208['address']+_0x13669f(0xcf)+_0x1ab51d(_0x1af2d5)+_0x13669f(0xf8);}function z(_0x205d86){const _0x22167b=_0x38f2;return _0x22167b(0xd3)+_0x205d86;}function _0x1d22(){const _0x97d13=['length','networks','asset','symbol','\x20\x20task\x20price:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20IMD\x20for\x20payment\x20on\x20','write','path','active','QR\x20saved:\x20','requiredOption','?\x0aWallet:\x20','padEnd','price','approve','map','chainId','\x20\x20IMD\x20authorization:\x20\x20','\x20IMD','status','require\x20this\x20wallet\x20address\x20for\x20the\x20authorization','file','configured','Authorize\x20','Passwords\x20do\x20not\x20match.','waitForTransactionReceipt','--wallet\x20<address>','Encrypted\x20backup\x20saved:\x20','\x20IMD\x20on\x20','command','address','\x0aKeep\x20your\x20wallet\x20password\x20separately.','select\x20a\x20saved\x20wallet','chainName','restore','Confirm\x20password','--out\x20<file>','use\x20<address>','\x20(current)','\x0aEncrypted\x20file:\x20','list','error','action','address:\x20','decimals','name','--amount\x20<amount>','json','list\x20saved\x20local\x20wallets\x20and\x20the\x20current\x20selection','save\x20an\x20SVG\x20QR\x20code\x20to\x20a\x20new\x20file','optsWithGlobals','Create\x20or\x20import\x20a\x20wallet\x20first.','\x20\x20(also\x20pays\x20gas)','Local\x20wallet\x20password\x20(at\x20least\x208\x20characters)','chain','token\x20amount\x20to\x20approve,\x20in\x20whole\x20tokens','import','key','amount','flatMap','allowance','success','option','api','create\x20a\x20new\x20password-encrypted\x20local\x20wallet','home','show\x20the\x20deposit\x20address\x20and\x20QR\x20code\x20(same\x20address\x20on\x20every\x20payment\x20network)','This\x20address\x20works\x20on\x20both\x20networks.\x20Accepted\x20coins:','authorize\x20an\x20exact\x20IMD\x20amount\x20on\x20--payment-chain\x20(default\x20ethereum)','Accepted\x20coins:','coins','show\x20balances\x20on\x20every\x20payment\x20network\x20(narrow\x20with\x20--payment-chain)','add\x20a\x20wallet\x20from\x20an\x20encrypted\x20backup\x20and\x20select\x20it','description','wallet','out','balance','Backup\x20password','join','\x0aThis\x20transaction\x20also\x20uses\x20ETH\x20for\x20network\x20fees.','\x0aBack\x20up\x20this\x20file\x20and\x20keep\x20your\x20password.\x20Both\x20are\x20needed\x20to\x20restore\x20your\x20wallet.\x0aRun\x20colony\x20wallet\x20receive\x20to\x20deposit\x20funds.','\x0aAsset:\x20','import\x20a\x20private\x20key\x20using\x20hidden\x20terminal\x20input','qrFile','--file\x20<file>','In\x20the\x20sending\x20wallet\x20or\x20exchange,\x20choose\x20the\x20network\x20you\x20plan\x20to\x20pay\x20on.\x20Funds\x20stay\x20on\x20that\x20network.'];_0x1d22=function(){return _0x97d13;};return _0x1d22();}function F(_0x1a0b41){const _0x42bb2d=_0x38f2;return _0x1a0b41[_0x42bb2d(0xd1)]?[_0x1a0b41[_0x42bb2d(0xc9)]+'\x20('+_0x1a0b41[_0x42bb2d(0xb8)]+')','\x20\x20balances\x20unavailable:\x20'+_0x1a0b41[_0x42bb2d(0xd1)]]:[_0x1a0b41['chainName']+'\x20('+_0x1a0b41[_0x42bb2d(0xb8)]+')',_0x42bb2d(0xac)+_0x1a0b41[_0x42bb2d(0xb5)]+_0x42bb2d(0xba),..._0x1a0b41['coins'][_0x42bb2d(0xb7)](_0x24b070=>'\x20\x20'+(_0x24b070[_0x42bb2d(0xab)]+':')[_0x42bb2d(0xb4)](0x13)+'\x20'+_0x24b070[_0x42bb2d(0xf4)]+(_0x24b070['symbol']==='ETH'?_0x42bb2d(0xdc):'')),_0x42bb2d(0xb9)+_0x1a0b41[_0x42bb2d(0xe4)]];}function M(_0x5f439b){const _0xc112f4=_0x38f2;return[_0xc112f4(0xd3)+_0x5f439b[_0xc112f4(0xc6)],'The\x20same\x20address\x20works\x20on\x20every\x20network\x20below.\x20Balances\x20are\x20separate\x20per\x20network.',..._0x5f439b[_0xc112f4(0xa9)][_0xc112f4(0xe3)](_0x1f6d87=>['',...F(_0x1f6d87)])][_0xc112f4(0xf6)]('\x0a');}function P(_0x517808){const _0x3b71f3=_0x38f2,_0x252f59=_0x517808[_0x3b71f3(0xa9)][_0x3b71f3(0xb7)](_0x4fb674=>'\x20\x20'+_0x4fb674[_0x3b71f3(0xc9)]+':\x20'+_0x4fb674[_0x3b71f3(0xee)][_0x3b71f3(0xf6)](',\x20'));return[_0x517808['networks'][_0x3b71f3(0xa8)]===0x1?'Receive\x20on\x20'+_0x517808[_0x3b71f3(0xc9)]:'Receive\x20funds',_0x517808['address'],_0x517808[_0x3b71f3(0xa9)]['length']===0x1?_0x3b71f3(0xed):_0x3b71f3(0xeb),..._0x252f59,_0x3b71f3(0xfd),'Also\x20send\x20a\x20little\x20ETH\x20on\x20the\x20same\x20network\x20for\x20gas\x20(network\x20fees).']['join']('\x0a');}function U(_0x23a0ab){const _0x579bd1=_0x38f2,_0x2a260f=_0x23a0ab['command'](_0x579bd1(0xf2))[_0x579bd1(0xf1)]('create,\x20import,\x20back\x20up\x20and\x20fund\x20your\x20local\x20wallet');_0x2a260f[_0x579bd1(0xc5)](_0x579bd1(0xd0))[_0x579bd1(0xf1)](_0x579bd1(0xd8))['action']((_0x37e311,_0x20257c)=>{const _0x568c46=_0x579bd1,_0x2a4ce0=_0x20257c['optsWithGlobals'](),_0x2ec430=_0x5dd19e(_0x2a4ce0['home']);_0x2c8cb6(_0x2a4ce0[_0x568c46(0xd7)]?_0x2ec430:_0x2ec430['length']?_0x2ec430[_0x568c46(0xb7)](_0x5128ff=>(_0x5128ff[_0x568c46(0xb0)]?'*':'\x20')+'\x20'+_0x5128ff['address']+(_0x5128ff[_0x568c46(0xb0)]?_0x568c46(0xce):''))[_0x568c46(0xf6)]('\x0a'):'No\x20saved\x20wallets.\x20Create,\x20import\x20or\x20restore\x20one.',_0x2a4ce0);}),_0x2a260f[_0x579bd1(0xc5)](_0x579bd1(0xcd))[_0x579bd1(0xf1)](_0x579bd1(0xc8))[_0x579bd1(0xd2)](async(_0x5a7fb0,_0x2837c1,_0x4b6a73)=>{const _0x43d30e=_0x579bd1,_0x3a7a40=_0x4b6a73['optsWithGlobals'](),_0x198bf8=await _0x526e30(_0x3a7a40[_0x43d30e(0xe9)],_0x5a7fb0);_0x2c8cb6(_0x3a7a40['json']?_0x198bf8:'Active\x20wallet:\x20'+_0x198bf8[_0x43d30e(0xc6)],_0x3a7a40);}),_0x2a260f['command']('create')[_0x579bd1(0xf1)](_0x579bd1(0xe8))[_0x579bd1(0xd2)](async(_0x27c094,_0x47fd31)=>{const _0x1618f8=_0x579bd1,_0x13747c=_0x47fd31[_0x1618f8(0xda)](),_0x4fad8c=await _0x409d9c(_0x13747c[_0x1618f8(0xe9)],_0x5dd19e(_0x13747c['home'])[_0x1618f8(0xa8)]?void 0x0:await v());_0x2c8cb6(_0x13747c[_0x1618f8(0xd7)]?_0x4fad8c:w(_0x4fad8c,_0x13747c[_0x1618f8(0xe9)]),_0x13747c);}),_0x2a260f[_0x579bd1(0xc5)](_0x579bd1(0xe0))[_0x579bd1(0xf1)](_0x579bd1(0xfa))[_0x579bd1(0xd2)](async(_0xaab77f,_0x49c04b)=>{const _0x3abf73=_0x579bd1,_0x3225af=_0x49c04b[_0x3abf73(0xda)](),_0x30524c=await _0x1d8192('Private\x20key\x20(hidden)'),_0x3d61e9=await _0x409d9c(_0x3225af[_0x3abf73(0xe9)],_0x5dd19e(_0x3225af[_0x3abf73(0xe9)])[_0x3abf73(0xa8)]?void 0x0:await v(),_0x30524c);_0x2c8cb6(_0x3225af[_0x3abf73(0xd7)]?_0x3d61e9:w(_0x3d61e9,_0x3225af['home']),_0x3225af);}),_0x2a260f[_0x579bd1(0xc5)]('backup')[_0x579bd1(0xf1)]('copy\x20the\x20encrypted\x20wallet\x20file;\x20never\x20export\x20a\x20plaintext\x20key')[_0x579bd1(0xb2)](_0x579bd1(0xcc),'new\x20backup\x20file\x20path')[_0x579bd1(0xd2)](async(_0x26f520,_0x2cf2e0)=>{const _0x25312f=_0x579bd1,_0x330838=_0x2cf2e0[_0x25312f(0xda)](),_0x3fe297=await _0x5eb53b(_0x330838['home'],_0x330838['out']);_0x2c8cb6(_0x330838['json']?_0x3fe297:_0x25312f(0xc3)+_0x3fe297[_0x25312f(0xaf)]+_0x25312f(0xc7),_0x330838);}),_0x2a260f[_0x579bd1(0xc5)](_0x579bd1(0xca))['description'](_0x579bd1(0xf0))['requiredOption'](_0x579bd1(0xfc),'encrypted\x20JSON\x20keystore\x20backup')[_0x579bd1(0xd2)](async(_0x5cd51a,_0x371449)=>{const _0x370473=_0x579bd1,_0x355450=_0x371449[_0x370473(0xda)](),_0x79edf0=await _0x4c6f31(_0x355450['home'],_0x355450[_0x370473(0xbd)],await _0x1d8192(_0x370473(0xf5)));_0x2c8cb6(_0x355450[_0x370473(0xd7)]?_0x79edf0:w(_0x79edf0,_0x355450[_0x370473(0xe9)]),_0x355450);}),_0x2a260f[_0x579bd1(0xc5)]('receive')['description'](_0x579bd1(0xea))[_0x579bd1(0xe6)]('--out\x20<file>',_0x579bd1(0xd9))[_0x579bd1(0xd2)](async(_0x3cf6d1,_0x5cc8e8)=>{const _0x55e0a0=_0x579bd1,_0x10cfea=_0x5cc8e8[_0x55e0a0(0xda)](),_0x3672a9=await _0x61022(_0x10cfea);if(_0x10cfea[_0x55e0a0(0xf3)]&&(_0x3672a9['qrFile']=(await _0x318d9c(_0x3672a9[_0x55e0a0(0xc6)],_0x10cfea[_0x55e0a0(0xf3)]))['path']),_0x10cfea[_0x55e0a0(0xd7)])return _0x2c8cb6(_0x3672a9,_0x10cfea);_0x2c8cb6(P(_0x3672a9),_0x10cfea),_0x3672a9[_0x55e0a0(0xfb)]?_0x2c8cb6(_0x55e0a0(0xb1)+_0x3672a9[_0x55e0a0(0xfb)],_0x10cfea):process['stdout'][_0x55e0a0(0xae)](await _0x572f4e(_0x3672a9[_0x55e0a0(0xc6)]));}),_0x2a260f[_0x579bd1(0xc5)](_0x579bd1(0xc6))[_0x579bd1(0xf1)]('print\x20your\x20public\x20wallet\x20address\x20without\x20unlocking')[_0x579bd1(0xd2)]((_0x25a2dc,_0xfc6061)=>{const _0x40e557=_0x579bd1,_0x511b9b=_0xfc6061['optsWithGlobals'](),_0x1859b8=_0x2cc6cb(_0x511b9b);if(!_0x1859b8[_0x40e557(0xbe)])throw new Error(_0x40e557(0xdb));_0x2c8cb6(_0x511b9b[_0x40e557(0xd7)]?{'address':_0x1859b8[_0x40e557(0xc6)]}:z(_0x1859b8['address']),_0x511b9b);}),_0x2a260f['command'](_0x579bd1(0xbb))[_0x579bd1(0xf1)](_0x579bd1(0xef))['action'](async(_0x11e150,_0x66cee7)=>{const _0x35dc48=_0x579bd1,_0x1831ae=_0x66cee7[_0x35dc48(0xda)](),_0x450d10=await _0x49b775(_0x1831ae);_0x2c8cb6(_0x1831ae[_0x35dc48(0xd7)]?_0x450d10:M(_0x450d10),_0x1831ae);}),_0x2a260f[_0x579bd1(0xc5)](_0x579bd1(0xb6))[_0x579bd1(0xf1)](_0x579bd1(0xec))[_0x579bd1(0xb2)](_0x579bd1(0xd6),_0x579bd1(0xdf))[_0x579bd1(0xe6)](_0x579bd1(0xc2),_0x579bd1(0xbc))[_0x579bd1(0xd2)](async(_0x2eaf48,_0x24c918)=>{const _0x4b2ae6=_0x579bd1,_0x5e18fd=_0x24c918[_0x4b2ae6(0xda)](),_0x4ad3aa=_0x5e18fd['wallet']??_0x2cc6cb(_0x5e18fd)[_0x4b2ae6(0xc6)],_0x27b7f7=await _0x295ec9(_0x5e18fd),{payment:_0x33891c,chainId:_0x4f93db,spender:_0x2c3df7}=await _0x490d93(_0x5e18fd[_0x4b2ae6(0xe7)],'job.open',_0x27b7f7[_0x4b2ae6(0xe1)]),_0x4fc8fc=_0x1fdcd8(_0x5e18fd[_0x4b2ae6(0xe2)],_0x33891c[_0x4b2ae6(0xd4)]);if(_0x4fc8fc<=0x0n)throw new Error('--amount\x20must\x20be\x20greater\x20than\x20zero');await _0x33c220(_0x4b2ae6(0xbf)+_0x5e18fd[_0x4b2ae6(0xe2)]+_0x4b2ae6(0xad)+_0x27b7f7[_0x4b2ae6(0xde)][_0x4b2ae6(0xd5)]+_0x4b2ae6(0xb3)+_0x4ad3aa+_0x4b2ae6(0xf9)+_0x33891c['asset']+'\x0aSpender:\x20'+_0x2c3df7+_0x4b2ae6(0xf7),_0x5e18fd);const {publicClient:_0x1652f8,walletClient:_0x373cf8}=await _0x3fd8b9({..._0x5e18fd,'expectedWallet':_0x4ad3aa},_0x4f93db),_0x20cd82=await _0x373cf8['writeContract']({'address':_0x33891c['asset'],'abi':_0x533225,'functionName':_0x4b2ae6(0xb6),'args':[_0x2c3df7,_0x4fc8fc]});if((await _0x1652f8[_0x4b2ae6(0xc1)]({'hash':_0x20cd82}))[_0x4b2ae6(0xbb)]!==_0x4b2ae6(0xe5))throw new Error('approve\x20transaction\x20failed:\x20'+_0x20cd82);const _0x204d2f={'transactionHash':_0x20cd82,'chainId':_0x4f93db,'asset':_0x33891c[_0x4b2ae6(0xaa)],'spender':_0x2c3df7,'amount':_0x5e18fd[_0x4b2ae6(0xe2)],'amountAtomic':String(_0x4fc8fc)};_0x2c8cb6(_0x5e18fd['json']?_0x204d2f:'authorized\x20'+_0x5e18fd['amount']+_0x4b2ae6(0xc4)+_0x27b7f7[_0x4b2ae6(0xde)][_0x4b2ae6(0xd5)]+'\x0atx:\x20'+_0x20cd82,_0x5e18fd);});}export{U as registerWalletCommands};
@@ -0,0 +1 @@
1
+ import{mkdir as _0x662094,readdir as _0x2eb280,readFile as _0x86b4e6,rename as _0x28f4e0,rm as _0x8dc6df,writeFile as _0x4a70f1}from'node:fs/promises';import{randomUUID as _0x44fcde}from'node:crypto';import{join as _0x45bd89}from'node:path';import{loadOrder as _0x241e00}from'./orders.mjs';const c=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function i(_0x47ddf5,_0x409e7c){const _0xe4bd76=_0x1a0c;if(!c[_0xe4bd76(0x122)](_0x409e7c))throw new Error(_0xe4bd76(0x12a));return _0x45bd89(_0x47ddf5,_0xe4bd76(0x121),_0x409e7c+_0xe4bd76(0x12d));}function _0x5531(){const _0x4bf76a=['utf8','api','stringify','drafts','test','ENOENT','endsWith','map','parse','plan','code','slice','Invalid\x20draft\x20ID.','objective','all','.json','filter','.tmp'];_0x5531=function(){return _0x4bf76a;};return _0x5531();}async function O(_0x34b8b9,_0xa7c1ed){const _0x4a3f39=_0x1a0c,_0x155016=i(_0x34b8b9,_0xa7c1ed['id']),_0x4cd943=new Date()['toISOString'](),_0x20fffd={'id':_0xa7c1ed['id'],'api':_0xa7c1ed[_0x4a3f39(0x11f)],'objective':_0xa7c1ed[_0x4a3f39(0x12b)],'parent':_0xa7c1ed['parent']??null,..._0xa7c1ed[_0x4a3f39(0x127)]?{'plan':_0xa7c1ed['plan']}:{},'createdAt':_0xa7c1ed['createdAt']??_0x4cd943,'updatedAt':_0x4cd943};await _0x662094(_0x45bd89(_0x34b8b9,'drafts'),{'recursive':!0x0,'mode':0x1c0});const _0x3b367b=_0x45bd89(_0x34b8b9,_0x4a3f39(0x121),'.'+_0xa7c1ed['id']+'.'+_0x44fcde()+_0x4a3f39(0x12f));return await _0x4a70f1(_0x3b367b,JSON[_0x4a3f39(0x120)](_0x20fffd,null,0x2)+'\x0a',{'flag':'wx','mode':0x180}),await _0x28f4e0(_0x3b367b,_0x155016),_0x20fffd;}async function D(_0x322ef1,_0x55de34){const _0x2756f5=_0x1a0c;return JSON[_0x2756f5(0x126)](await _0x86b4e6(i(_0x322ef1,_0x55de34),_0x2756f5(0x11e)));}async function N(_0x183437,_0x5abe5d){return await _0x8dc6df(i(_0x183437,_0x5abe5d),{'force':!0x0}),{'id':_0x5abe5d};}function _0x1a0c(_0x4d5114,_0x55318e){_0x4d5114=_0x4d5114-0x11e;const _0x1a0cad=_0x5531();let _0xdbd38c=_0x1a0cad[_0x4d5114];return _0xdbd38c;}async function S(_0x1b6471){const _0x5642aa=_0x1a0c;let _0x379581;try{_0x379581=await _0x2eb280(_0x45bd89(_0x1b6471,_0x5642aa(0x121)));}catch(_0x3eb374){if(_0x3eb374[_0x5642aa(0x128)]===_0x5642aa(0x123))return[];throw _0x3eb374;}return(await Promise[_0x5642aa(0x12c)](_0x379581[_0x5642aa(0x12e)](_0xbf2279=>_0xbf2279[_0x5642aa(0x124)]('.json')&&c['test'](_0xbf2279[_0x5642aa(0x129)](0x0,-0x5)))[_0x5642aa(0x125)](async _0x3d4198=>{const _0x4fb058=_0x5642aa,_0x423963=_0x3d4198[_0x4fb058(0x129)](0x0,-0x5);return await _0x241e00(_0x1b6471,_0x423963)?null:D(_0x1b6471,_0x423963);})))[_0x5642aa(0x12e)](Boolean);}export{N as deleteDraft,S as listDrafts,D as loadDraft,O as saveDraft};
@@ -1 +1 @@
1
- function _0x583d(_0x546fee,_0x2a8ab5){_0x546fee=_0x546fee-0x150;const _0x583df1=_0x2a8a();let _0x8cb8ed=_0x583df1[_0x546fee];return _0x8cb8ed;}import{coinAmount as _0x53e1f4}from'./payment-coins.mjs';import{paymentNetwork as _0x59dc26}from'./payment-networks.mjs';function c(_0x5ac0a0,_0xa7f4bb,_0x45e800){const _0x3cbe5d=_0x583d,_0x21dbca={'address':_0x5ac0a0,'chainName':_0x59dc26(_0xa7f4bb)['chain'][_0x3cbe5d(0x153)],'shortages':_0x45e800};return Object[_0x3cbe5d(0x151)](new Error(s(_0x21dbca)[_0x3cbe5d(0x15b)]('\x0a')),{'code':_0x3cbe5d(0x152),'funding':_0x21dbca});}function _0x2a8a(){const _0x209304=['Add\x20funds\x20on\x20','assign','funding_required','name',':\x20have\x20','\x20in\x20the\x20sending\x20wallet.','map',';\x20need\x20','Send\x20to\x20your\x20wallet:','Choose\x20','\x20to\x20continue.','join','After\x20funding,\x20continue\x20this\x20task.\x20Prices\x20and\x20fees\x20will\x20be\x20checked\x20again.'];_0x2a8a=function(){return _0x209304;};return _0x2a8a();}function s({address:_0x909277,chainName:_0x2bb9fd,shortages:_0x1063b1}){const _0x593c40=_0x583d;return[_0x593c40(0x150)+_0x2bb9fd+_0x593c40(0x15a),..._0x1063b1[_0x593c40(0x156)](({coin:_0x2e9d89,balance:_0x5e06c8,required:_0x3d9995})=>_0x2e9d89+_0x593c40(0x154)+_0x53e1f4(_0x5e06c8,_0x2e9d89)+_0x593c40(0x157)+_0x53e1f4(_0x3d9995,_0x2e9d89)),'ETH\x20covers\x20network\x20fees\x20(gas).','',_0x593c40(0x158),_0x909277,'',_0x593c40(0x159)+_0x2bb9fd+_0x593c40(0x155),_0x593c40(0x15c)];}export{s as fundingInstructions,c as fundingRequired};
1
+ const _0x2e2b80=_0x36ab;import{coinAmount as _0x2a0efc,friendlyAmount as _0x328495}from'./payment-coins.mjs';import{PAYMENT_NETWORKS as _0x105c4d,paymentNetwork as _0x4d136d}from'./payment-networks.mjs';const l=_0xb372a=>Object[_0x2e2b80(0x139)](new Error(v(_0xb372a)[_0x2e2b80(0x15a)]('\x0a')),{'code':'funding_required','funding':_0xb372a});function I(_0x52e08c,_0x57217d,_0x16d887,_0x3d6e51){const _0x22751a=_0x2e2b80,_0x49ed5e=_0x4d136d(_0x57217d)['chain'][_0x22751a(0x132)],_0x4edce7={'key':_0x57217d,'chainName':_0x49ed5e,'price':_0x3d6e51?.[_0x22751a(0x14b)],'nativeBalance':_0x3d6e51?.[_0x22751a(0x153)],'options':_0x3d6e51?[{..._0x3d6e51,'funded':!0x1,'shortages':_0x16d887}]:[],'shortages':_0x16d887};return l({'address':_0x52e08c,'network':_0x57217d,'chainName':_0x49ed5e,'shortages':_0x16d887,'networks':[_0x4edce7]});}function w(_0x34173e,_0xa34be5){return l({'address':_0x34173e,'networks':_0xa34be5});}function E(_0x4d30e8){const _0x2f9055=_0x2e2b80;return _0x4d30e8[_0x2f9055(0x142)]??[{'key':_0x4d30e8[_0x2f9055(0x131)],'chainName':_0x4d30e8[_0x2f9055(0x136)],'options':[],'shortages':_0x4d30e8[_0x2f9055(0x13c)]??[]}];}const c=_0x3e683f=>BigInt(_0x3e683f[_0x2e2b80(0x156)])-BigInt(_0x3e683f[_0x2e2b80(0x15b)]),f=_0x5cf106=>(_0x5cf106*0xbn+0x9n)/0xan,u=_0x525854=>(_0x525854[_0x2e2b80(0x152)]??[])['filter'](_0x353b4e=>!_0x353b4e[_0x2e2b80(0x168)]&&_0x353b4e[_0x2e2b80(0x15c)]!==void 0x0);function d(_0x380cc8){const _0x5a6d2b=_0x2e2b80,_0x2b35cf=u(_0x380cc8)[_0x5a6d2b(0x147)](_0x28cfa6=>BigInt(_0x28cfa6[_0x5a6d2b(0x16b)]));if(!_0x2b35cf[_0x5a6d2b(0x138)])return null;const _0x3490cc=_0x2b35cf['reduce']((_0x374987,_0xff59b1)=>_0x374987<_0xff59b1?_0x374987:_0xff59b1),_0x17865b=_0x2b35cf[_0x5a6d2b(0x162)]((_0x2b1b04,_0x32554d)=>_0x2b1b04>_0x32554d?_0x2b1b04:_0x32554d),_0x2c4031=_0x328495(_0x3490cc,_0x5a6d2b(0x12f),{'up':!0x0});return{'low':_0x3490cc,'high':_0x17865b,'text':_0x3490cc===_0x17865b?_0x2c4031:_0x2c4031['replace'](/ ETH$/,'')+_0x5a6d2b(0x14a)+_0x328495(_0x17865b,_0x5a6d2b(0x12f),{'up':!0x0})};}function g(_0xff8099){const _0x97c15e=_0x2e2b80;return(_0xff8099[_0x97c15e(0x133)]===_0x97c15e(0x151)?'':'\u2248\x20')+_0x328495(_0xff8099['payment'],_0xff8099[_0x97c15e(0x133)],{'up':!0x0});}function H(_0x1dad71){const _0xc111d0=_0x2e2b80;if(_0x1dad71['error'])return'\x20\x20'+_0x1dad71[_0xc111d0(0x133)]+_0xc111d0(0x167);const _0x3c9313=_0x1dad71[_0xc111d0(0x13c)]?.[_0xc111d0(0x13f)](_0x1945eb=>_0x1945eb[_0xc111d0(0x133)]===_0x1dad71[_0xc111d0(0x133)]);let _0x44babb='';_0x1dad71[_0xc111d0(0x169)]?_0x44babb=_0xc111d0(0x149):_0x3c9313&&BigInt(_0x3c9313[_0xc111d0(0x15b)])>0x0n?_0x44babb=_0xc111d0(0x161)+_0x328495(c(_0x3c9313),_0x1dad71['coin'],{'up':!0x0})+_0xc111d0(0x159)+(_0x1dad71[_0xc111d0(0x133)]===_0xc111d0(0x12f)?_0xc111d0(0x154):''):_0x1dad71[_0xc111d0(0x133)]!==_0xc111d0(0x12f)&&_0x1dad71['balance']!==null&&_0x1dad71['balance']!==void 0x0&&(_0x44babb='\x20\xB7\x20enough');const _0x2f4d82=_0x1dad71[_0xc111d0(0x15b)]===null||_0x1dad71['balance']===void 0x0?'':'\x20\xB7\x20you\x20have\x20'+_0x328495(_0x1dad71['balance'],_0x1dad71[_0xc111d0(0x133)]);return'\x20\x20'+g(_0x1dad71)+(_0x1dad71[_0xc111d0(0x133)]===_0xc111d0(0x12f)?_0xc111d0(0x144):'')+_0x2f4d82+_0x44babb;}function _0x36ab(_0x3af9a7,_0x47d6e5){_0x3af9a7=_0x3af9a7-0x12f;const _0x36ab51=_0x47d6();let _0xd4d39e=_0x36ab51[_0x3af9a7];return _0xd4d39e;}function m(_0x2c8c52){const _0x3bb3fe=_0x2e2b80,_0x51adbf=u(_0x2c8c52)[_0x3bb3fe(0x14f)](_0x19b038=>_0x19b038[_0x3bb3fe(0x13c)]?.['length']),_0x365347=_0x51adbf[_0x3bb3fe(0x14f)](_0x1f37b2=>_0x1f37b2[_0x3bb3fe(0x133)]!==_0x3bb3fe(0x12f)&&_0x1f37b2[_0x3bb3fe(0x13c)]['every'](_0x4ff268=>_0x4ff268['coin']===_0x3bb3fe(0x12f)))['map'](_0x43f4b4=>({'option':_0x43f4b4,'amount':c(_0x43f4b4[_0x3bb3fe(0x13c)][0x0])}))[_0x3bb3fe(0x13a)]((_0x2b0b1f,_0x43d421)=>_0x2b0b1f[_0x3bb3fe(0x155)]<_0x43d421[_0x3bb3fe(0x155)]?-0x1:_0x2b0b1f[_0x3bb3fe(0x155)]>_0x43d421[_0x3bb3fe(0x155)]?0x1:0x0);if(_0x365347[_0x3bb3fe(0x138)])return _0x3bb3fe(0x14e)+_0x328495(f(_0x365347[0x0][_0x3bb3fe(0x155)]),'ETH',{'up':!0x0})+'\x20for\x20gas,\x20then\x20pay\x20with\x20your\x20'+_0x365347[0x0]['option'][_0x3bb3fe(0x133)]+'.';const _0x8f73fd=_0x51adbf[_0x3bb3fe(0x13f)](_0x3dc7de=>_0x3dc7de[_0x3bb3fe(0x133)]===_0x3bb3fe(0x12f))?.[_0x3bb3fe(0x13c)][_0x3bb3fe(0x13f)](_0x5d34ca=>_0x5d34ca['coin']===_0x3bb3fe(0x12f));return _0x8f73fd?_0x3bb3fe(0x134)+_0x328495(f(c(_0x8f73fd)),_0x3bb3fe(0x12f),{'up':!0x0})+'.\x20ETH\x20covers\x20both\x20the\x20payment\x20and\x20gas.':null;}function _0x47d6(){const _0x9dca93=['ETH','toUpperCase','network','name','coin','Simplest:\x20send\x20about\x20','\x20or\x20','chainName','\x20·\x20not\x20available\x20right\x20now','length','assign','sort','Not\x20enough\x20funds\x20on\x20','shortages','some','\x20\x20Not\x20available\x20right\x20now:\x20','find','\x20and\x20','ETH\x20for\x20gas','networks','unavailable','\x20(+\x20gas\x20from\x20the\x20same\x20ETH)','flatMap','slice','map',':\x20you\x20have\x20','\x20·\x20ready\x20to\x20pay','\x20to\x20','imd','\x20yet.\x20Add\x20funds,\x20then\x20check\x20again.','\x20·\x20gas\x20≈\x20','Quickest:\x20add\x20about\x20','filter','Not\x20enough\x20funds\x20yet.\x20Add\x20funds\x20on\x20either\x20network,\x20then\x20check\x20again.','IMD','options','nativeBalance','\x20incl.\x20gas','amount','required','Payment:','address','\x20more','join','balance','payment','text','Gas,\x20always\x20ETH:\x20≈\x20','chain','Gas\x20·\x20network\x20fee,\x20always\x20paid\x20in\x20ETH:','\x20·\x20need\x20','reduce','Send\x20to\x20your\x20wallet:','The\x20same\x20address\x20works\x20on\x20','\x20·\x20you\x20have\x20','Payment,\x20any\x20one\x20of:\x20','\x20·\x20no\x20exchange\x20route\x20right\x20now','error','funded','\x20·\x20pay\x20with\x20','gas','price'];_0x47d6=function(){return _0x9dca93;};return _0x47d6();}function x(_0x3bcc97){const _0x14e9c1=_0x2e2b80,_0x38c17c=_0x3bcc97[_0x14e9c1(0x13c)][_0x14e9c1(0x13d)](_0x318a30=>_0x318a30['coin']!==_0x14e9c1(0x12f));return _0x3bcc97[_0x14e9c1(0x13c)][_0x14e9c1(0x147)](_0x47d8ae=>'\x20\x20'+(_0x47d8ae[_0x14e9c1(0x133)]==='ETH'&&_0x38c17c?_0x14e9c1(0x141):_0x47d8ae[_0x14e9c1(0x133)])+_0x14e9c1(0x148)+_0x2a0efc(_0x47d8ae['balance'],_0x47d8ae[_0x14e9c1(0x133)])+_0x14e9c1(0x161)+_0x2a0efc(_0x47d8ae[_0x14e9c1(0x156)],_0x47d8ae['coin']));}function b(_0x1f39b5){const _0x47f636=_0x2e2b80,_0x1d2176=_0x1f39b5[_0x47f636(0x136)][_0x47f636(0x130)]()+(_0x1f39b5['price']?'\x20\xB7\x20task\x20price\x20'+_0x328495(_0x1f39b5[_0x47f636(0x16c)],'IMD',{'up':!0x0}):'');if(_0x1f39b5[_0x47f636(0x168)])return[_0x1d2176,_0x47f636(0x13e)+_0x1f39b5['error']];const _0x5244d6=_0x1f39b5['options']??[];if(!_0x5244d6[_0x47f636(0x138)])return[_0x1d2176,...x(_0x1f39b5)];const _0x2e716f=d(_0x1f39b5),_0x15a35f=_0x1f39b5[_0x47f636(0x153)]??_0x5244d6[_0x47f636(0x13f)](_0x16af5c=>_0x16af5c['nativeBalance']!==void 0x0)?.[_0x47f636(0x153)],_0x137802=_0x15a35f===void 0x0?'':_0x47f636(0x165)+_0x328495(_0x15a35f,_0x47f636(0x12f))+(_0x2e716f&&BigInt(_0x15a35f)>=_0x2e716f['high']?'\x20\xB7\x20enough':''),_0x4e8942=m(_0x1f39b5);return[_0x1d2176,_0x5244d6[_0x47f636(0x138)]>0x1?'Payment\x20\xB7\x20pick\x20any\x20one\x20coin:':_0x47f636(0x157),..._0x5244d6['map'](H),_0x47f636(0x160),'\x20\x20'+(_0x2e716f?'\u2248\x20'+_0x2e716f[_0x47f636(0x15d)]:_0x47f636(0x143))+_0x137802,..._0x4e8942?[_0x4e8942]:[]];}function j(_0xc38c4e){const _0x35dbaf=_0x2e2b80,_0x361bd3=u(_0xc38c4e);if(!_0x361bd3[_0x35dbaf(0x138)])return[];const _0x39b2ac=d(_0xc38c4e),_0x37e34d=m(_0xc38c4e);return[_0x35dbaf(0x166)+_0x361bd3[_0x35dbaf(0x147)](g)[_0x35dbaf(0x15a)](_0x35dbaf(0x135)),_0x35dbaf(0x15e)+_0x39b2ac['text'],..._0x37e34d?[_0x37e34d]:[]];}function A(_0x4b6fa9){const _0x20103d=_0x2e2b80;if(_0x4b6fa9[_0x20103d(0x168)])return _0x4b6fa9['chainName']+_0x20103d(0x137);const _0x2f1ff7=(_0x4b6fa9[_0x20103d(0x152)]??[])[_0x20103d(0x14f)](_0x4c584e=>!_0x4c584e['error'])[_0x20103d(0x147)](_0x29bbb3=>_0x29bbb3[_0x20103d(0x133)]),_0x568238=d(_0x4b6fa9),_0x17a18d=_0x2f1ff7[_0x20103d(0x138)]>0x1?_0x2f1ff7[_0x20103d(0x146)](0x0,-0x1)[_0x20103d(0x15a)](',\x20')+_0x20103d(0x135)+_0x2f1ff7['at'](-0x1):_0x2f1ff7[0x0];return _0x4b6fa9['chainName']+(_0x17a18d?_0x20103d(0x16a)+_0x17a18d:'')+(_0x568238?_0x20103d(0x14d)+_0x568238[_0x20103d(0x15d)]:'');}function v(_0x29b9c6){const _0x129fc7=_0x2e2b80,_0x1f86c7=E(_0x29b9c6),_0x3a2fc5=_0x105c4d[_0x129fc7(0x147)](_0x336bb3=>_0x336bb3[_0x129fc7(0x15f)][_0x129fc7(0x132)])[_0x129fc7(0x15a)](_0x129fc7(0x140));return[_0x1f86c7[_0x129fc7(0x138)]>0x1?_0x129fc7(0x150):_0x129fc7(0x13b)+_0x1f86c7[0x0]['chainName']+_0x129fc7(0x14c),'',_0x129fc7(0x163),_0x29b9c6[_0x129fc7(0x158)],_0x129fc7(0x164)+_0x3a2fc5+'.\x20Funds\x20stay\x20on\x20the\x20network\x20they\x20are\x20sent\x20on.','',..._0x1f86c7[_0x129fc7(0x145)](_0x4b3158=>[...b(_0x4b3158),'']),'Prices\x20and\x20fees\x20are\x20estimates.\x20They\x20are\x20checked\x20again\x20before\x20you\x20pay.'];}export{v as fundingInstructions,E as fundingNetworks,I as fundingRequired,w as fundingRequiredOptions,A as networkChoiceLabel,b as networkLines,j as networkTargets,m as quickestFix};
@@ -1 +1 @@
1
- function _0xb3c0(){var _0x59074e=['swap','IMD','kind','coin','steps','amountIn','status','minimumOut','confirmed'];_0xb3c0=function(){return _0x59074e;};return _0xb3c0();}import{formatEther as _0x574324}from'viem';import{coinAmount as _0x3191aa}from'./payment-coins.mjs';function c(_0x2426c7){var _0x5e35fa=_0x4e7f;return{'coin':_0x2426c7[_0x5e35fa(0xc8)],'amount':_0x3191aa(_0x2426c7[_0x5e35fa(0xca)],_0x2426c7[_0x5e35fa(0xc8)]),'estimatedAmount':_0x2426c7['quotedInput']===void 0x0?void 0x0:_0x3191aa(_0x2426c7['quotedInput'],_0x2426c7[_0x5e35fa(0xc8)]),'minimumImd':_0x3191aa(_0x2426c7[_0x5e35fa(0xcc)],_0x5e35fa(0xc6)),'maximumDebit':_0x3191aa(_0x2426c7['maximumDebit'],_0x2426c7[_0x5e35fa(0xc8)]),'networkFeeCap':_0x574324(BigInt(_0x2426c7['feeCap'])),'converted':_0x2426c7['steps']['some'](_0x8f8eaf=>_0x8f8eaf[_0x5e35fa(0xc7)]===_0x5e35fa(0xc5)&&_0x8f8eaf[_0x5e35fa(0xcb)]===_0x5e35fa(0xcd))&&!_0x2426c7['steps']['some'](_0x50daa7=>_0x50daa7[_0x5e35fa(0xc7)]===_0x5e35fa(0xc5)&&_0x50daa7[_0x5e35fa(0xcb)]!==_0x5e35fa(0xcd)),'steps':_0x2426c7[_0x5e35fa(0xc9)]['map'](({kind:_0x5b4820,hash:_0x402574,confirmedHash:_0x49c3a1,status:_0x3016ce})=>({'kind':_0x5b4820,'hash':_0x49c3a1??_0x402574,'status':_0x3016ce}))};}function _0x4e7f(_0xfb344d,_0xb3c08b){_0xfb344d=_0xfb344d-0xc5;var _0x4e7fa3=_0xb3c0();var _0x4959a8=_0x4e7fa3[_0xfb344d];return _0x4959a8;}export{c as fundingSummary};
1
+ import{formatEther as _0x345c63}from'viem';import{coinAmount as _0x1a2b08,friendlyAmount as _0x54111c}from'./payment-coins.mjs';function c(_0x56acda){var _0x53ecf1=_0x353b;return{'coin':_0x56acda[_0x53ecf1(0x151)],'amount':_0x1a2b08(_0x56acda['amountIn'],_0x56acda[_0x53ecf1(0x151)]),'estimatedAmount':_0x56acda['quotedInput']===void 0x0?void 0x0:_0x1a2b08(_0x56acda[_0x53ecf1(0x159)],_0x56acda[_0x53ecf1(0x151)]),'minimumImd':_0x1a2b08(_0x56acda[_0x53ecf1(0x153)],'IMD'),'maximumDebit':_0x1a2b08(_0x56acda[_0x53ecf1(0x157)],_0x56acda[_0x53ecf1(0x151)]),'networkFeeCap':_0x345c63(BigInt(_0x56acda[_0x53ecf1(0x152)])),'display':{'payment':_0x54111c(_0x56acda['amountIn'],_0x56acda[_0x53ecf1(0x151)],{'up':!0x0}),..._0x56acda[_0x53ecf1(0x159)]===void 0x0?{}:{'estimate':_0x54111c(_0x56acda[_0x53ecf1(0x159)],_0x56acda[_0x53ecf1(0x151)],{'up':!0x0})},'gas':_0x54111c(_0x56acda[_0x53ecf1(0x152)],_0x53ecf1(0x154),{'up':!0x0}),'maximumDebit':_0x54111c(_0x56acda[_0x53ecf1(0x157)],_0x56acda['coin'],{'up':!0x0})},'converted':_0x56acda['steps'][_0x53ecf1(0x155)](_0x3a3399=>_0x3a3399[_0x53ecf1(0x15a)]===_0x53ecf1(0x158)&&_0x3a3399[_0x53ecf1(0x15b)]===_0x53ecf1(0x156))&&!_0x56acda[_0x53ecf1(0x15c)][_0x53ecf1(0x155)](_0x525fa5=>_0x525fa5[_0x53ecf1(0x15a)]===_0x53ecf1(0x158)&&_0x525fa5[_0x53ecf1(0x15b)]!==_0x53ecf1(0x156)),'steps':_0x56acda['steps'][_0x53ecf1(0x150)](({kind:_0x13e04a,hash:_0x3b2a93,confirmedHash:_0x3618d7,status:_0x14c403})=>({'kind':_0x13e04a,'hash':_0x3618d7??_0x3b2a93,'status':_0x14c403}))};}function _0x353b(_0x12a765,_0x3d4e1a){_0x12a765=_0x12a765-0x150;var _0x353b47=_0x3d4e();var _0x455953=_0x353b47[_0x12a765];return _0x455953;}function _0x3d4e(){var _0x437126=['map','coin','feeCap','minimumOut','ETH','some','confirmed','maximumDebit','swap','quotedInput','kind','status','steps'];_0x3d4e=function(){return _0x437126;};return _0x3d4e();}export{c as fundingSummary};
@@ -1 +1 @@
1
- const _0x17641c=_0x4db2;function _0x4db2(_0x5f4f9a,_0x4d859b){_0x5f4f9a=_0x5f4f9a-0x66;const _0x4db2ea=_0x4d85();let _0xf3ab6e=_0x4db2ea[_0x5f4f9a];return _0xf3ab6e;}import{decodeFunctionData as _0x21f518,encodeFunctionData as _0x4b2cc2,erc20Abi as _0x1f875f,EstimateGasExecutionError as _0xbb9c6,formatEther as _0x263337,keccak256 as _0x1396e2}from'viem';import{getPublicRpcClient as _0x5f117b,getRpcClients as _0x45e0f7,getSigner as _0x124c1c}from'../shared.mjs';import{paymentCoin as _0x4e0217}from'./payment-coins.mjs';import{paymentNetwork as _0x4b25c4}from'./payment-networks.mjs';import{assertQuotePayment as _0x2fc045,orderPayment as _0x194cc3,loadPaymentConfig as _0x16ca6e}from'./payments.mjs';import{assertOrderNotCancelled as _0x2949f8,findOrder as _0x5aa9d4,saveOrder as _0x22cdc2}from'./orders.mjs';import{quoteSwap as _0x45bbd6,buildSwap as _0x377971,UNISWAP as _0x1604fc,APPROVAL_GAS as _0x4a908b,SWAP_ABI as _0x9085fe}from'./swaps.mjs';import{submitTransaction as _0x5c5117}from'./transactions.mjs';import{fundingRequired as _0x3f65d0}from'./funding-error.mjs';import{walletInfo as _0x21ddb0}from'./local-wallet.mjs';import{transactionFees as _0x439569,reviewedFees as _0x2b0c27}from'./transaction-fees.mjs';function _0x4d85(){const _0x2ff278=['.\x20No\x20replacement\x20swap\x20will\x20be\x20made\x20for\x20this\x20order.','The\x20saved\x20swap\x20has\x20finished,\x20but\x20this\x20wallet\x20no\x20longer\x20has\x20enough\x20IMD.\x20No\x20additional\x20swap\x20was\x20made.','The\x20token\x20authorization','coin\x20conversion','checking_funds','Refreshing\x20the\x20payment\x20review.\x20No\x20new\x20transaction\x20was\x20signed.','prepareTransactionRequest','gas','replacementNonce','hash','readContract','kind','paymentReview','amountIn','spender','address','success','ETH','account','signTransaction','toLowerCase','...','api','estimateGas','maxFeePerGas','router','quote','IMD','Checking\x20balances,\x20current\x20exchange\x20rate\x20and\x20network\x20fees...','asset','Required\x20network\x20fees\x20exceed\x20the\x20reviewed\x20cap.\x20No\x20new\x20transaction\x20was\x20signed.','status','Preparing\x20','reset_source_allowance','requestKey','filter','swap','funding','symbol','value','signed','signal','slippageBps','amount','action','steps','payment_review_expired','expectedWallet','reverted','.\x20Your\x20order\x20was\x20not\x20paid.','recipient','optional\x20support\x20transfer','approve','signing','\x20transaction\x20reverted:\x20','support','min','ready','transactionHash','transfer','amountOut','USDT','payWith','\x20cannot\x20currently\x20execute.\x20No\x20new\x20transaction\x20was\x20signed.\x20Any\x20completed\x20steps\x20remain\x20saved\x20in\x20this\x20order.','token\x20authorization','pendingTransaction','chain','floor','throwIfAborted','expiresAt','payment','feeCap','assign','The\x20','robinhood','args','confirmed','configured','confirmedHash','reduce','quotedInput','home','push','rawTransaction','ethereum','data','paymentChain','approve_source','now','all','balanceOf','IMD\x20payment\x20asset\x20differs\x20from\x20the\x20selected\x20network.'];_0x4d85=function(){return _0x2ff278;};return _0x4d85();}import{resumeTransaction as _0x1295f6,recoveryNonce as _0x1fedbd,retireExpiredSwap as _0x4372fa}from'./transaction-recovery.mjs';const he=0x7a120n,A=(_0x53bc5d,_0x991c64,_0x3ec0fd)=>_0x53bc5d[_0x17641c(0x70)]({'address':_0x991c64,'abi':_0x1f875f,'functionName':_0x17641c(0xc0),'args':[_0x3ec0fd]}),Y=(_0x279838,_0x246b0c,_0x119428,_0x2183c7)=>_0x279838[_0x17641c(0x70)]({'address':_0x246b0c,'abi':_0x1f875f,'functionName':'allowance','args':[_0x119428,_0x2183c7]}),R=(_0x325f5a,_0x20a950,_0x31faeb,_0x337cc1)=>({'kind':_0x325f5a,'to':_0x20a950,'value':'0','gas':String(_0x4a908b),'data':_0x4b2cc2({'abi':_0x1f875f,'functionName':_0x17641c(0x9a),'args':[_0x31faeb,_0x337cc1]})});async function ge(_0x92d27f,_0x55f477,_0x411e5e,_0x4fbc79,_0x5e0c7c){const _0x2e5c65=_0x17641c,_0x99ebc5=_0x92d27f[_0x2e5c65(0xbc)]??_0x2e5c65(0xba),_0x3498fb=_0x4e0217(_0x99ebc5,_0x92d27f[_0x2e5c65(0xa4)]),_0x277f16=_0x5e0c7c??await _0x16ca6e(_0x55f477[_0x2e5c65(0x7c)],_0x92d27f[_0x2e5c65(0x92)],_0x99ebc5,_0x55f477),_0x3838e3=_0x5e0c7c?_0x5e0c7c[_0x2e5c65(0xac)]:_0x194cc3(_0x92d27f);if(_0x2fc045(_0x3838e3),_0x3838e3[_0x2e5c65(0x83)][_0x2e5c65(0x7a)]()!==_0x277f16['payment'][_0x2e5c65(0x83)]['toLowerCase']())throw new Error(_0x2e5c65(0xc1));const _0x1528ca=BigInt(_0x3838e3[_0x2e5c65(0x91)]),[_0x5dda6f,_0x58e249,_0x1e912f]=await Promise[_0x2e5c65(0xbf)]([Y(_0x411e5e,_0x3838e3['asset'],_0x4fbc79[_0x2e5c65(0x75)],_0x277f16[_0x2e5c65(0x74)]),_0x411e5e['getBalance']({'address':_0x4fbc79[_0x2e5c65(0x75)]}),_0x439569(_0x411e5e,_0x4b25c4(_0x99ebc5)[_0x2e5c65(0xa8)]['id'])]),_0x5893f6=(_0x92d27f[_0x2e5c65(0x8b)]?.['steps']??[])[_0x2e5c65(0x89)](_0x4cab0c=>_0x4cab0c[_0x2e5c65(0x85)]===_0x2e5c65(0xb2));let _0x165f6a=0x0n,_0x1ef6bf=0x0n;for(const _0x33a10d of _0x5893f6)if(_0x33a10d[_0x2e5c65(0x71)]==='swap'){const _0x565c7f=_0x21f518({'abi':_0x9085fe,'data':_0x33a10d['data']});_0x165f6a+=_0x21f518({'abi':_0x9085fe,'data':_0x565c7f[_0x2e5c65(0xb1)][0x1][0x0]})[_0x2e5c65(0xb1)][0x0][_0x2e5c65(0xa2)];}else _0x33a10d[_0x2e5c65(0x71)]===_0x2e5c65(0x9d)&&(_0x1ef6bf+=_0x21f518({'abi':_0x1f875f,'data':_0x33a10d[_0x2e5c65(0xbb)]})[_0x2e5c65(0xb1)][0x1]);const _0x4a9915=BigInt(_0x92d27f[_0x2e5c65(0x9d)]?.[_0x2e5c65(0x91)]??0x0)-_0x1ef6bf,_0x399392=_0x1528ca+_0x4a9915,_0x524262=_0x1604fc[_0x99ebc5][_0x2e5c65(0x7f)],_0xd9e597=_0x99ebc5===_0x2e5c65(0xb0)?he:0x0n,_0x5e84bf=_0x4a9915>0x0n?0x186a0n:0x0n,_0x1d871b=_0xd9e597+_0x5e84bf+(_0x5dda6f<_0x1528ca?_0x4a908b:0x0n),_0x119ec2=[],_0x5cc99c=[];let _0x58be73;const _0x21b60e=Math[_0x2e5c65(0x9e)](Number(_0x92d27f[_0x2e5c65(0x80)]['expiresAt']),Math[_0x2e5c65(0xa9)](Date[_0x2e5c65(0xbe)]()/0x3e8)+0x12c);if(_0x3498fb['symbol']===_0x2e5c65(0x81)){const _0x5aeb87=await A(_0x411e5e,_0x3838e3[_0x2e5c65(0x83)],_0x4fbc79[_0x2e5c65(0x75)]);_0x5aeb87<_0x399392&&_0x5cc99c[_0x2e5c65(0xb8)]({'coin':_0x2e5c65(0x81),'balance':String(_0x5aeb87),'required':String(_0x399392)});}const _0x1c583c=_0x165f6a>_0x1ef6bf?_0x165f6a-_0x1ef6bf:0x0n,_0x1712d9=_0x399392>_0x1c583c?_0x399392-_0x1c583c:0x0n;if(_0x1c583c>0x0n){const _0x536c48=await A(_0x411e5e,_0x3838e3[_0x2e5c65(0x83)],_0x4fbc79['address']),_0x2fb5b1=_0x399392<_0x1c583c?_0x399392:_0x1c583c;_0x536c48<_0x2fb5b1&&_0x5cc99c[_0x2e5c65(0xb8)]({'coin':_0x2e5c65(0x81),'balance':String(_0x536c48),'required':String(_0x2fb5b1)});}if(_0x3498fb[_0x2e5c65(0x8c)]!==_0x2e5c65(0x81)&&_0x1712d9>0x0n){const _0x287331=_0x3498fb[_0x2e5c65(0x8c)]===_0x2e5c65(0x77)?0x0n:await Y(_0x411e5e,_0x3498fb[_0x2e5c65(0x75)],_0x4fbc79[_0x2e5c65(0x75)],_0x524262);_0x58be73=await _0x45bbd6(_0x99ebc5,_0x3498fb,_0x1712d9,{'client':_0x411e5e,'maxFeePerGas':_0x1e912f[_0x2e5c65(0x7e)],'sourceAllowance':_0x287331,'fixedGas':_0x1d871b,'signal':_0x55f477[_0x2e5c65(0x8f)]});const _0x42c9bf=BigInt(_0x58be73[_0x2e5c65(0x73)]);if(_0x3498fb[_0x2e5c65(0x8c)]!==_0x2e5c65(0x77)){const _0x49ca33=await A(_0x411e5e,_0x3498fb[_0x2e5c65(0x75)],_0x4fbc79[_0x2e5c65(0x75)]),_0x4e3e6a=_0x287331;_0x49ca33<_0x42c9bf&&_0x5cc99c[_0x2e5c65(0xb8)]({'coin':_0x3498fb[_0x2e5c65(0x8c)],'balance':String(_0x49ca33),'required':String(_0x42c9bf)}),_0x4e3e6a<_0x42c9bf&&(_0x3498fb[_0x2e5c65(0x8c)]===_0x2e5c65(0xa3)&&_0x4e3e6a>0x0n&&_0x119ec2[_0x2e5c65(0xb8)](R(_0x2e5c65(0x87),_0x3498fb['address'],_0x524262,0x0n)),_0x119ec2[_0x2e5c65(0xb8)](R(_0x2e5c65(0xbd),_0x3498fb[_0x2e5c65(0x75)],_0x524262,_0x42c9bf)));}const _0x55fda1=_0x377971(_0x99ebc5,_0x3498fb,_0x58be73,_0x1712d9,_0x4fbc79[_0x2e5c65(0x75)],_0x21b60e);_0x119ec2[_0x2e5c65(0xb8)]({'kind':_0x2e5c65(0x8a),..._0x55fda1,'gas':String(_0x58be73[_0x2e5c65(0x6d)]),'expiresAt':_0x21b60e});}_0x5dda6f<_0x1528ca&&_0x119ec2['push'](R('approve_imd',_0x3838e3['asset'],_0x277f16[_0x2e5c65(0x74)],_0x1528ca)),_0x4a9915>0x0n&&_0x119ec2[_0x2e5c65(0xb8)]({'kind':_0x2e5c65(0x9d),'to':_0x3838e3[_0x2e5c65(0x83)],'value':'0','gas':String(_0x5e84bf),'data':_0x4b2cc2({'abi':_0x1f875f,'functionName':_0x2e5c65(0xa1),'args':[_0x92d27f[_0x2e5c65(0x9d)][_0x2e5c65(0x98)],_0x4a9915]})});const _0x114e25=_0x119ec2[_0x2e5c65(0xb5)]((_0x49c2dd,_0x23499c)=>_0x49c2dd+BigInt(_0x23499c[_0x2e5c65(0x6d)]),_0xd9e597)*_0x1e912f[_0x2e5c65(0x7e)],_0x3bc291=_0x3498fb[_0x2e5c65(0x8c)]===_0x2e5c65(0x81)?_0x399392:BigInt(_0x58be73?.[_0x2e5c65(0x73)]??0x0),_0x2ad8de=_0x3bc291+(_0x3498fb[_0x2e5c65(0x8c)]==='ETH'?_0x114e25:0x0n),_0x34d8b3=_0x114e25+(_0x3498fb[_0x2e5c65(0x8c)]==='ETH'?_0x3bc291:0x0n);if(_0x58e249<_0x34d8b3&&_0x5cc99c['push']({'coin':_0x2e5c65(0x77),'balance':String(_0x58e249),'required':String(_0x34d8b3)}),_0x5cc99c['length'])throw _0x3f65d0(_0x4fbc79['address'],_0x99ebc5,_0x5cc99c);return{'chainId':_0x4b25c4(_0x99ebc5)[_0x2e5c65(0xa8)]['id'],'account':_0x4fbc79['address'],'coin':_0x3498fb[_0x2e5c65(0x8c)],'amountIn':String(_0x3bc291),'minimumOut':String(_0x399392),'maximumDebit':String(_0x2ad8de),'quotedInput':String(_0x3498fb['symbol']===_0x2e5c65(0x81)?_0x399392:_0x58be73?.[_0x2e5c65(0xb6)]??0x0),..._0x58be73?{'slippageBps':_0x58be73[_0x2e5c65(0x90)]}:{},'feeCap':String(_0x114e25),'maxFeePerGas':String(_0x1e912f[_0x2e5c65(0x7e)]),'maxPriorityFeePerGas':String(_0x1e912f['maxPriorityFeePerGas']),'paymentGas':String(_0xd9e597),'expiresAt':_0x21b60e,'steps':[..._0x5893f6,..._0x119ec2]};}async function Ne(_0x7e2039,_0x32e3bd,_0x5a8654){const _0x5bfa80=_0x17641c,_0x2a8b58=_0x4b25c4(_0x7e2039[_0x5bfa80(0xbc)]??_0x5bfa80(0xba))['chain']['id'],_0x153c72=_0x21ddb0(_0x32e3bd);if(!_0x153c72[_0x5bfa80(0xb3)])throw new Error('Create\x20or\x20import\x20a\x20wallet\x20in\x20Wallets\x20before\x20paying.');if(_0x32e3bd[_0x5bfa80(0x95)]&&_0x32e3bd[_0x5bfa80(0x95)][_0x5bfa80(0x7a)]()!==_0x153c72['address'][_0x5bfa80(0x7a)]())throw new Error('Payment\x20wallet\x20changed.\x20Review\x20this\x20task\x20with\x20the\x20selected\x20wallet\x20before\x20paying.');const _0x5c61c7=await _0x5f117b(_0x32e3bd,_0x2a8b58);if(_0x7e2039[_0x5bfa80(0x8b)]&&_0x7e2039[_0x5bfa80(0x8b)][_0x5bfa80(0x78)][_0x5bfa80(0x7a)]()!==_0x153c72[_0x5bfa80(0x75)][_0x5bfa80(0x7a)]())throw new Error('Resume\x20funding\x20with\x20the\x20same\x20wallet\x20that\x20started\x20this\x20order.');for(const _0x1bfd8f of _0x7e2039[_0x5bfa80(0x8b)]?.[_0x5bfa80(0x93)]??[]){if(_0x1bfd8f[_0x5bfa80(0xb9)]&&_0x1bfd8f[_0x5bfa80(0x85)]!==_0x5bfa80(0xb2)&&await _0x4372fa(_0x7e2039,_0x1bfd8f,_0x5c61c7,_0x32e3bd))continue;if(_0x1bfd8f[_0x5bfa80(0x85)]==='reverted')throw new Error(_0x5bfa80(0xaf)+_0x1bfd8f[_0x5bfa80(0x71)]+_0x5bfa80(0x9c)+_0x1bfd8f[_0x5bfa80(0x6f)]+_0x5bfa80(0x66));if(!_0x1bfd8f[_0x5bfa80(0xb9)]||_0x1bfd8f[_0x5bfa80(0x85)]===_0x5bfa80(0xb2))continue;const _0xa3071b=await _0x1295f6(_0x7e2039,_0x1bfd8f,_0x5c61c7,_0x32e3bd);if(_0x1bfd8f['status']=_0xa3071b[_0x5bfa80(0x85)]===_0x5bfa80(0x76)?_0x5bfa80(0xb2):_0x5bfa80(0x96),_0x1bfd8f[_0x5bfa80(0xb4)]=_0xa3071b[_0x5bfa80(0xa0)],delete _0x7e2039['pendingTransaction'],await _0x22cdc2(_0x32e3bd[_0x5bfa80(0xb7)],_0x7e2039),_0x1bfd8f[_0x5bfa80(0x85)]===_0x5bfa80(0x96))throw new Error(_0x5bfa80(0xaf)+_0x1bfd8f[_0x5bfa80(0x71)]+_0x5bfa80(0x9c)+_0x1bfd8f['hash']+_0x5bfa80(0x66));}_0x32e3bd['onProgress']?.({'phase':_0x5bfa80(0x6a),'message':_0x5bfa80(0x82)}),_0x7e2039[_0x5bfa80(0x8b)]=await ge(_0x7e2039,_0x32e3bd,_0x5c61c7,_0x153c72);const _0x204f49=_0x7e2039[_0x5bfa80(0x8b)];_0x7e2039[_0x5bfa80(0x72)]={'networkFeeCap':_0x263337(BigInt(_0x204f49[_0x5bfa80(0xad)]))},await _0x5a8654(_0x7e2039),_0x32e3bd[_0x5bfa80(0x8f)]?.[_0x5bfa80(0xaa)](),_0x2949f8(await _0x5aa9d4(_0x32e3bd['home'],_0x7e2039[_0x5bfa80(0x88)])),await _0x22cdc2(_0x32e3bd[_0x5bfa80(0xb7)],_0x7e2039);const {walletClient:_0x1584e2,account:_0x3ba84e}=await _0x45e0f7({..._0x32e3bd,'expectedWallet':_0x153c72[_0x5bfa80(0x75)]},_0x2a8b58);if(_0x32e3bd[_0x5bfa80(0x8f)]?.[_0x5bfa80(0xaa)](),_0x2949f8(await _0x5aa9d4(_0x32e3bd['home'],_0x7e2039[_0x5bfa80(0x88)])),_0x204f49['expiresAt']*0x3e8<=Date[_0x5bfa80(0xbe)]())throw Object[_0x5bfa80(0xae)](new Error(_0x5bfa80(0x6b)),{'code':_0x5bfa80(0x94)});for(const _0x40fd10 of _0x204f49[_0x5bfa80(0x93)]){if(_0x40fd10[_0x5bfa80(0x85)]===_0x5bfa80(0xb2))continue;if(_0x40fd10['status']===_0x5bfa80(0x96))throw new Error(_0x5bfa80(0xaf)+_0x40fd10[_0x5bfa80(0x71)]+_0x5bfa80(0x9c)+_0x40fd10[_0x5bfa80(0x6f)]+_0x5bfa80(0x66));if(!_0x40fd10[_0x5bfa80(0xb9)]){if(_0x204f49[_0x5bfa80(0xab)]*0x3e8<=Date[_0x5bfa80(0xbe)]())throw Object[_0x5bfa80(0xae)](new Error('Refreshing\x20the\x20payment\x20review.\x20No\x20new\x20transaction\x20was\x20signed.'),{'code':_0x5bfa80(0x94)});const _0x428bf7=_0x2b0c27(await _0x439569(_0x5c61c7,_0x2a8b58),_0x204f49);_0x32e3bd['onProgress']?.({'phase':_0x5bfa80(0x9b),'message':_0x5bfa80(0x86)+(_0x40fd10[_0x5bfa80(0x71)]===_0x5bfa80(0x8a)?_0x5bfa80(0x69):_0x40fd10[_0x5bfa80(0x71)]===_0x5bfa80(0x9d)?_0x5bfa80(0x99):_0x5bfa80(0xa6))+_0x5bfa80(0x7b)});const _0x51d69a={'account':_0x3ba84e,'to':_0x40fd10['to'],'data':_0x40fd10[_0x5bfa80(0xbb)],'value':BigInt(_0x40fd10[_0x5bfa80(0x8d)]),..._0x428bf7};let _0x5ee10b;try{_0x5ee10b=await _0x5c61c7[_0x5bfa80(0x7d)](_0x51d69a);}catch(_0x25c4af){throw _0x25c4af instanceof _0xbb9c6?new Error((_0x40fd10[_0x5bfa80(0x71)]===_0x5bfa80(0x8a)?'The\x20swap\x20quote':_0x40fd10[_0x5bfa80(0x71)]===_0x5bfa80(0x9d)?'The\x20support\x20transfer':_0x5bfa80(0x68))+_0x5bfa80(0xa5),{'cause':_0x25c4af}):_0x25c4af;}if(_0x5ee10b>BigInt(_0x40fd10[_0x5bfa80(0x6d)]))throw new Error(_0x5bfa80(0x84));const _0x1cb71f=await _0x1584e2[_0x5bfa80(0x6c)]({..._0x51d69a,'gas':BigInt(_0x40fd10['gas']),'nonce':await _0x1fedbd(_0x7e2039,_0x5c61c7,_0x3ba84e[_0x5bfa80(0x75)])});if(await _0x124c1c({..._0x32e3bd,'expectedWallet':_0x3ba84e['address']}),_0x32e3bd[_0x5bfa80(0x8f)]?.[_0x5bfa80(0xaa)](),_0x2949f8(await _0x5aa9d4(_0x32e3bd[_0x5bfa80(0xb7)],_0x7e2039[_0x5bfa80(0x88)])),_0x204f49[_0x5bfa80(0xab)]*0x3e8<=Date['now']())throw Object[_0x5bfa80(0xae)](new Error('Refreshing\x20the\x20payment\x20review.\x20No\x20new\x20transaction\x20was\x20signed.'),{'code':_0x5bfa80(0x94)});Object[_0x5bfa80(0xae)](_0x1cb71f,_0x2b0c27(await _0x439569(_0x5c61c7,_0x2a8b58),_0x204f49)),_0x40fd10[_0x5bfa80(0xb9)]=await _0x1584e2[_0x5bfa80(0x79)](_0x1cb71f),_0x40fd10[_0x5bfa80(0x6f)]=_0x1396e2(_0x40fd10[_0x5bfa80(0xb9)]),_0x40fd10[_0x5bfa80(0x85)]=_0x5bfa80(0x8e),delete _0x7e2039[_0x5bfa80(0x6e)],_0x7e2039['status']=_0x5bfa80(0x8b),await _0x22cdc2(_0x32e3bd['home'],_0x7e2039);}const _0x1d03e0=await _0x5c5117(_0x5c61c7,_0x40fd10,_0x32e3bd);if(_0x40fd10['status']=_0x1d03e0['status']===_0x5bfa80(0x76)?_0x5bfa80(0xb2):_0x5bfa80(0x96),_0x40fd10[_0x5bfa80(0xb4)]=_0x1d03e0[_0x5bfa80(0xa0)],delete _0x7e2039[_0x5bfa80(0xa7)],await _0x22cdc2(_0x32e3bd['home'],_0x7e2039),_0x40fd10['status']===_0x5bfa80(0x96))throw new Error(_0x5bfa80(0xaf)+_0x40fd10[_0x5bfa80(0x71)]+'\x20transaction\x20reverted:\x20'+_0x40fd10['hash']+_0x5bfa80(0x97));}const _0x47d8ae=_0x194cc3(_0x7e2039);if(await A(_0x5c61c7,_0x47d8ae['asset'],_0x3ba84e[_0x5bfa80(0x75)])<BigInt(_0x47d8ae[_0x5bfa80(0x91)]))throw new Error(_0x5bfa80(0x67));_0x2949f8(await _0x5aa9d4(_0x32e3bd[_0x5bfa80(0xb7)],_0x7e2039[_0x5bfa80(0x88)])),_0x204f49[_0x5bfa80(0x85)]=_0x5bfa80(0x9f),await _0x22cdc2(_0x32e3bd[_0x5bfa80(0xb7)],_0x7e2039);}export{Ne as fundOrder,ge as prepareFunding};
1
+ const _0x4b176e=_0x48a1;import{decodeFunctionData as _0x3c1a99,encodeFunctionData as _0x313d52,erc20Abi as _0x390069,EstimateGasExecutionError as _0x4aee4f,formatEther as _0x416856,keccak256 as _0x17dfd9}from'viem';import{getPublicRpcClient as _0x545f70,getRpcClients as _0x1e6a7d,getSigner as _0x222eba}from'../shared.mjs';import{paymentCoin as _0xa4fe3}from'./payment-coins.mjs';function _0x4035(){const _0x556cf1=['chain','min','quotedInput','payment','\x20cannot\x20currently\x20execute.\x20No\x20new\x20transaction\x20was\x20signed.\x20Any\x20completed\x20steps\x20remain\x20saved\x20in\x20this\x20order.','home','approve_source','spender','transactionHash','push','ETH','requestKey','swap','now','maxPriorityFeePerGas','optional\x20support\x20transfer','expectedWallet','throwIfAborted','Refreshing\x20the\x20payment\x20review.\x20No\x20new\x20transaction\x20was\x20signed.','amountIn','maxFeePerGas','configured','token\x20authorization','length','paymentChain','status','toLowerCase','...','asset','ethereum','.\x20No\x20replacement\x20swap\x20will\x20be\x20made\x20for\x20this\x20order.','The\x20support\x20transfer','checking_funds','floor','replacementNonce','amount','pendingTransaction','payment_review_expired','confirmedHash','symbol','robinhood','transfer','address','data','assign','allowance','reverted','gas','args','account','kind','expiresAt','Checking\x20balances,\x20current\x20exchange\x20rate\x20and\x20network\x20fees...','approve','support','value','The\x20','rawTransaction','estimateGas','steps','reduce','IMD','all','feeCap','filter','signTransaction','readContract','Create\x20or\x20import\x20a\x20wallet\x20in\x20Wallets\x20before\x20paying.','\x20transaction\x20reverted:\x20','reset_source_allowance','The\x20saved\x20swap\x20has\x20finished,\x20but\x20this\x20wallet\x20no\x20longer\x20has\x20enough\x20IMD.\x20No\x20additional\x20swap\x20was\x20made.','The\x20swap\x20quote','funding','IMD\x20payment\x20asset\x20differs\x20from\x20the\x20selected\x20network.','success','quote','.\x20Your\x20order\x20was\x20not\x20paid.','USDT','confirmed','signal','action','Preparing\x20','hash','payWith','Resume\x20funding\x20with\x20the\x20same\x20wallet\x20that\x20started\x20this\x20order.','Required\x20network\x20fees\x20exceed\x20the\x20reviewed\x20cap.\x20No\x20new\x20transaction\x20was\x20signed.'];_0x4035=function(){return _0x556cf1;};return _0x4035();}import{paymentNetwork as _0x4afc43}from'./payment-networks.mjs';import{assertQuotePayment as _0x28eebc,orderPayment as _0x797c50,loadPaymentConfig as _0x8d0dd3}from'./payments.mjs';import{assertOrderNotCancelled as _0x5c1a13,findOrder as _0x284bd5,saveOrder as _0x54e44e}from'./orders.mjs';import{quoteSwap as _0x288317,buildSwap as _0x3dc24b,UNISWAP as _0x241032,APPROVAL_GAS as _0x3f9dd6,SWAP_ABI as _0x4e1a3c}from'./swaps.mjs';function _0x48a1(_0x10fa52,_0x4035e1){_0x10fa52=_0x10fa52-0xeb;const _0x48a185=_0x4035();let _0x321b80=_0x48a185[_0x10fa52];return _0x321b80;}import{submitTransaction as _0x37456e}from'./transactions.mjs';import{fundingRequired as _0x32f6bf}from'./funding-error.mjs';import{walletInfo as _0x16f475}from'./local-wallet.mjs';import{transactionFees as _0x1312f8,reviewedFees as _0x33b47f}from'./transaction-fees.mjs';import{resumeTransaction as _0x320913,recoveryNonce as _0x56f787,retireExpiredSwap as _0x33c04b}from'./transaction-recovery.mjs';const be=0x7a120n,N=(_0x408d1a,_0x6e0522,_0x518096)=>_0x408d1a[_0x4b176e(0x12d)]({'address':_0x6e0522,'abi':_0x390069,'functionName':'balanceOf','args':[_0x518096]}),Q=(_0x1edb38,_0x4f08d6,_0x682ab1,_0x48a4ce)=>_0x1edb38[_0x4b176e(0x12d)]({'address':_0x4f08d6,'abi':_0x390069,'functionName':_0x4b176e(0x118),'args':[_0x682ab1,_0x48a4ce]}),H=(_0x30b1b5,_0x30cfa1,_0x430c72,_0x272e2b)=>({'kind':_0x30b1b5,'to':_0x30cfa1,'value':'0','gas':String(_0x3f9dd6),'data':_0x313d52({'abi':_0x390069,'functionName':_0x4b176e(0x120),'args':[_0x430c72,_0x272e2b]})});async function ye(_0x291e17,_0x4455f7,_0x29d79c,_0x4939f7,_0x550a4a){const _0x1af096=_0x4b176e,{funding:_0x2a1514,shortages:_0x2231f5,requirement:_0x139b79}=await ve(_0x291e17,_0x4455f7,_0x29d79c,_0x4939f7,_0x550a4a);if(_0x2231f5[_0x1af096(0x102)])throw _0x32f6bf(_0x4939f7[_0x1af096(0x115)],_0x291e17[_0x1af096(0x103)]??_0x1af096(0x108),_0x2231f5,_0x139b79);return _0x2a1514;}async function ve(_0x299972,_0x22320a,_0x164d9f,_0x350421,_0x75593){const _0x4d614b=_0x4b176e,_0x3786f7=_0x299972['paymentChain']??_0x4d614b(0x108),_0x38d735=_0xa4fe3(_0x3786f7,_0x299972[_0x4d614b(0x13e)]),_0x4e7aae=_0x75593??await _0x8d0dd3(_0x22320a['api'],_0x299972[_0x4d614b(0x13b)],_0x3786f7,_0x22320a),_0x524dae=_0x75593?_0x75593[_0x4d614b(0xee)]:_0x797c50(_0x299972);if(_0x28eebc(_0x524dae),_0x524dae['asset'][_0x4d614b(0x105)]()!==_0x4e7aae[_0x4d614b(0xee)][_0x4d614b(0x107)][_0x4d614b(0x105)]())throw new Error(_0x4d614b(0x134));const _0xc37538=BigInt(_0x524dae[_0x4d614b(0x10e)]),[_0xbffac3,_0x2c8f39,_0x48a4e9]=await Promise[_0x4d614b(0x129)]([Q(_0x164d9f,_0x524dae['asset'],_0x350421['address'],_0x4e7aae[_0x4d614b(0xf2)]),_0x164d9f['getBalance']({'address':_0x350421[_0x4d614b(0x115)]}),_0x1312f8(_0x164d9f,_0x4afc43(_0x3786f7)[_0x4d614b(0xeb)]['id'])]),_0x578627=(_0x299972[_0x4d614b(0x133)]?.[_0x4d614b(0x126)]??[])[_0x4d614b(0x12b)](_0x309921=>_0x309921[_0x4d614b(0x104)]==='confirmed');let _0x5f00e2=0x0n,_0x5654f2=0x0n;for(const _0x4295a2 of _0x578627)if(_0x4295a2[_0x4d614b(0x11d)]===_0x4d614b(0xf7)){const _0x50b503=_0x3c1a99({'abi':_0x4e1a3c,'data':_0x4295a2[_0x4d614b(0x116)]});_0x5f00e2+=_0x3c1a99({'abi':_0x4e1a3c,'data':_0x50b503[_0x4d614b(0x11b)][0x1][0x0]})[_0x4d614b(0x11b)][0x0]['amountOut'];}else _0x4295a2['kind']===_0x4d614b(0x121)&&(_0x5654f2+=_0x3c1a99({'abi':_0x390069,'data':_0x4295a2[_0x4d614b(0x116)]})[_0x4d614b(0x11b)][0x1]);const _0x4c18fc=BigInt(_0x299972['support']?.[_0x4d614b(0x10e)]??0x0)-_0x5654f2,_0x334810=_0xc37538+_0x4c18fc,_0xea92db=_0x241032[_0x3786f7]['router'],_0x1f1316=_0x3786f7===_0x4d614b(0x113)?be:0x0n,_0x5793a9=_0x4c18fc>0x0n?0x186a0n:0x0n,_0x3bca4a=_0x1f1316+_0x5793a9+(_0xbffac3<_0xc37538?_0x3f9dd6:0x0n),_0x433d65=[],_0x29477c=[];let _0x2af11b;const _0x38f18c=Math[_0x4d614b(0xec)](Number(_0x299972[_0x4d614b(0x136)][_0x4d614b(0x11e)]),Math[_0x4d614b(0x10c)](Date[_0x4d614b(0xf8)]()/0x3e8)+0x12c);let _0x4fc833=_0x38d735[_0x4d614b(0x112)]===_0x4d614b(0xf5)?_0x2c8f39:null;if(_0x38d735['symbol']===_0x4d614b(0x128)){const _0x1f2d08=await N(_0x164d9f,_0x524dae[_0x4d614b(0x107)],_0x350421[_0x4d614b(0x115)]);_0x4fc833=_0x1f2d08,_0x1f2d08<_0x334810&&_0x29477c[_0x4d614b(0xf4)]({'coin':_0x4d614b(0x128),'balance':String(_0x1f2d08),'required':String(_0x334810)});}const _0x57e00a=_0x5f00e2>_0x5654f2?_0x5f00e2-_0x5654f2:0x0n,_0x18737b=_0x334810>_0x57e00a?_0x334810-_0x57e00a:0x0n;if(_0x57e00a>0x0n){const _0x2b7ee5=await N(_0x164d9f,_0x524dae[_0x4d614b(0x107)],_0x350421[_0x4d614b(0x115)]),_0x5ceb8b=_0x334810<_0x57e00a?_0x334810:_0x57e00a;_0x2b7ee5<_0x5ceb8b&&_0x29477c[_0x4d614b(0xf4)]({'coin':'IMD','balance':String(_0x2b7ee5),'required':String(_0x5ceb8b)});}if(_0x38d735[_0x4d614b(0x112)]!==_0x4d614b(0x128)&&_0x18737b>0x0n){const _0x39c1ec=_0x38d735['symbol']===_0x4d614b(0xf5)?0x0n:await Q(_0x164d9f,_0x38d735[_0x4d614b(0x115)],_0x350421[_0x4d614b(0x115)],_0xea92db);_0x2af11b=await _0x288317(_0x3786f7,_0x38d735,_0x18737b,{'client':_0x164d9f,'maxFeePerGas':_0x48a4e9['maxFeePerGas'],'sourceAllowance':_0x39c1ec,'fixedGas':_0x3bca4a,'signal':_0x22320a[_0x4d614b(0x13a)]});const _0x208cb9=BigInt(_0x2af11b[_0x4d614b(0xfe)]);if(_0x38d735[_0x4d614b(0x112)]!==_0x4d614b(0xf5)){const _0x272b98=await N(_0x164d9f,_0x38d735[_0x4d614b(0x115)],_0x350421[_0x4d614b(0x115)]);_0x4fc833=_0x272b98;const _0x5dd064=_0x39c1ec;_0x272b98<_0x208cb9&&_0x29477c[_0x4d614b(0xf4)]({'coin':_0x38d735[_0x4d614b(0x112)],'balance':String(_0x272b98),'required':String(_0x208cb9)}),_0x5dd064<_0x208cb9&&(_0x38d735['symbol']===_0x4d614b(0x138)&&_0x5dd064>0x0n&&_0x433d65['push'](H(_0x4d614b(0x130),_0x38d735[_0x4d614b(0x115)],_0xea92db,0x0n)),_0x433d65[_0x4d614b(0xf4)](H(_0x4d614b(0xf1),_0x38d735['address'],_0xea92db,_0x208cb9)));}const _0x24f6a1=_0x3dc24b(_0x3786f7,_0x38d735,_0x2af11b,_0x18737b,_0x350421[_0x4d614b(0x115)],_0x38f18c);_0x433d65['push']({'kind':_0x4d614b(0xf7),..._0x24f6a1,'gas':String(_0x2af11b[_0x4d614b(0x11a)]),'expiresAt':_0x38f18c});}_0xbffac3<_0xc37538&&_0x433d65[_0x4d614b(0xf4)](H('approve_imd',_0x524dae['asset'],_0x4e7aae[_0x4d614b(0xf2)],_0xc37538)),_0x4c18fc>0x0n&&_0x433d65['push']({'kind':'support','to':_0x524dae[_0x4d614b(0x107)],'value':'0','gas':String(_0x5793a9),'data':_0x313d52({'abi':_0x390069,'functionName':_0x4d614b(0x114),'args':[_0x299972[_0x4d614b(0x121)]['recipient'],_0x4c18fc]})});const _0x253f1a=_0x433d65[_0x4d614b(0x127)]((_0x144f0c,_0x5cbea6)=>_0x144f0c+BigInt(_0x5cbea6[_0x4d614b(0x11a)]),_0x1f1316)*_0x48a4e9['maxFeePerGas'],_0x127ced=_0x38d735[_0x4d614b(0x112)]===_0x4d614b(0x128)?_0x334810:BigInt(_0x2af11b?.['amountIn']??0x0),_0x116863=_0x127ced+(_0x38d735['symbol']===_0x4d614b(0xf5)?_0x253f1a:0x0n),_0x36b322=_0x253f1a+(_0x38d735[_0x4d614b(0x112)]===_0x4d614b(0xf5)?_0x127ced:0x0n);_0x2c8f39<_0x36b322&&_0x29477c['push']({'coin':_0x4d614b(0xf5),'balance':String(_0x2c8f39),'required':String(_0x36b322)});const _0x136796={'coin':_0x38d735[_0x4d614b(0x112)],'imd':String(_0x334810),'payment':String(_0x127ced),'estimate':String(_0x38d735[_0x4d614b(0x112)]==='IMD'?_0x334810:_0x2af11b?.[_0x4d614b(0xed)]??0x0),'gas':String(_0x253f1a),'balance':_0x4fc833===null?null:String(_0x4fc833),'nativeBalance':String(_0x2c8f39)};return{'shortages':_0x29477c,'requirement':_0x136796,'funding':{'chainId':_0x4afc43(_0x3786f7)[_0x4d614b(0xeb)]['id'],'account':_0x350421['address'],'coin':_0x38d735[_0x4d614b(0x112)],'amountIn':String(_0x127ced),'minimumOut':String(_0x334810),'maximumDebit':String(_0x116863),'quotedInput':String(_0x38d735[_0x4d614b(0x112)]===_0x4d614b(0x128)?_0x334810:_0x2af11b?.[_0x4d614b(0xed)]??0x0),..._0x2af11b?{'slippageBps':_0x2af11b['slippageBps']}:{},'feeCap':String(_0x253f1a),'maxFeePerGas':String(_0x48a4e9[_0x4d614b(0xff)]),'maxPriorityFeePerGas':String(_0x48a4e9[_0x4d614b(0xf9)]),'paymentGas':String(_0x1f1316),'expiresAt':_0x38f18c,'steps':[..._0x578627,..._0x433d65]}};}async function Be(_0x43fc06,_0x4d18e1,_0x5161e1){const _0x2729bf=_0x4b176e,_0x4f10c6=_0x4afc43(_0x43fc06['paymentChain']??'ethereum')['chain']['id'],_0x3f3d17=_0x16f475(_0x4d18e1);if(!_0x3f3d17[_0x2729bf(0x100)])throw new Error(_0x2729bf(0x12e));if(_0x4d18e1[_0x2729bf(0xfb)]&&_0x4d18e1[_0x2729bf(0xfb)]['toLowerCase']()!==_0x3f3d17['address'][_0x2729bf(0x105)]())throw new Error('Payment\x20wallet\x20changed.\x20Review\x20this\x20task\x20with\x20the\x20selected\x20wallet\x20before\x20paying.');const _0x567664=await _0x545f70(_0x4d18e1,_0x4f10c6);if(_0x43fc06['funding']&&_0x43fc06[_0x2729bf(0x133)][_0x2729bf(0x11c)][_0x2729bf(0x105)]()!==_0x3f3d17[_0x2729bf(0x115)][_0x2729bf(0x105)]())throw new Error(_0x2729bf(0x13f));for(const _0x2b209a of _0x43fc06[_0x2729bf(0x133)]?.[_0x2729bf(0x126)]??[]){if(_0x2b209a[_0x2729bf(0x124)]&&_0x2b209a[_0x2729bf(0x104)]!==_0x2729bf(0x139)&&await _0x33c04b(_0x43fc06,_0x2b209a,_0x567664,_0x4d18e1))continue;if(_0x2b209a[_0x2729bf(0x104)]==='reverted')throw new Error(_0x2729bf(0x123)+_0x2b209a[_0x2729bf(0x11d)]+'\x20transaction\x20reverted:\x20'+_0x2b209a[_0x2729bf(0x13d)]+_0x2729bf(0x109));if(!_0x2b209a[_0x2729bf(0x124)]||_0x2b209a[_0x2729bf(0x104)]===_0x2729bf(0x139))continue;const _0x4fce07=await _0x320913(_0x43fc06,_0x2b209a,_0x567664,_0x4d18e1);if(_0x2b209a[_0x2729bf(0x104)]=_0x4fce07[_0x2729bf(0x104)]===_0x2729bf(0x135)?_0x2729bf(0x139):_0x2729bf(0x119),_0x2b209a[_0x2729bf(0x111)]=_0x4fce07['transactionHash'],delete _0x43fc06[_0x2729bf(0x10f)],await _0x54e44e(_0x4d18e1[_0x2729bf(0xf0)],_0x43fc06),_0x2b209a[_0x2729bf(0x104)]===_0x2729bf(0x119))throw new Error(_0x2729bf(0x123)+_0x2b209a[_0x2729bf(0x11d)]+'\x20transaction\x20reverted:\x20'+_0x2b209a['hash']+_0x2729bf(0x109));}_0x4d18e1['onProgress']?.({'phase':_0x2729bf(0x10b),'message':_0x2729bf(0x11f)}),_0x43fc06[_0x2729bf(0x133)]=await ye(_0x43fc06,_0x4d18e1,_0x567664,_0x3f3d17);const _0x5c3d8a=_0x43fc06[_0x2729bf(0x133)];_0x43fc06['paymentReview']={'networkFeeCap':_0x416856(BigInt(_0x5c3d8a[_0x2729bf(0x12a)]))},await _0x5161e1(_0x43fc06),_0x4d18e1[_0x2729bf(0x13a)]?.[_0x2729bf(0xfc)](),_0x5c1a13(await _0x284bd5(_0x4d18e1[_0x2729bf(0xf0)],_0x43fc06[_0x2729bf(0xf6)])),await _0x54e44e(_0x4d18e1[_0x2729bf(0xf0)],_0x43fc06);const {walletClient:_0x4b8cd3,account:_0x8ebd3f}=await _0x1e6a7d({..._0x4d18e1,'expectedWallet':_0x3f3d17[_0x2729bf(0x115)]},_0x4f10c6);if(_0x4d18e1[_0x2729bf(0x13a)]?.[_0x2729bf(0xfc)](),_0x5c1a13(await _0x284bd5(_0x4d18e1[_0x2729bf(0xf0)],_0x43fc06[_0x2729bf(0xf6)])),_0x5c3d8a[_0x2729bf(0x11e)]*0x3e8<=Date[_0x2729bf(0xf8)]())throw Object[_0x2729bf(0x117)](new Error(_0x2729bf(0xfd)),{'code':'payment_review_expired'});for(const _0x2c3375 of _0x5c3d8a[_0x2729bf(0x126)]){if(_0x2c3375['status']===_0x2729bf(0x139))continue;if(_0x2c3375[_0x2729bf(0x104)]==='reverted')throw new Error(_0x2729bf(0x123)+_0x2c3375['kind']+_0x2729bf(0x12f)+_0x2c3375[_0x2729bf(0x13d)]+_0x2729bf(0x109));if(!_0x2c3375[_0x2729bf(0x124)]){if(_0x5c3d8a['expiresAt']*0x3e8<=Date[_0x2729bf(0xf8)]())throw Object[_0x2729bf(0x117)](new Error(_0x2729bf(0xfd)),{'code':_0x2729bf(0x110)});const _0x4d2668=_0x33b47f(await _0x1312f8(_0x567664,_0x4f10c6),_0x5c3d8a);_0x4d18e1['onProgress']?.({'phase':'signing','message':_0x2729bf(0x13c)+(_0x2c3375[_0x2729bf(0x11d)]==='swap'?'coin\x20conversion':_0x2c3375[_0x2729bf(0x11d)]===_0x2729bf(0x121)?_0x2729bf(0xfa):_0x2729bf(0x101))+_0x2729bf(0x106)});const _0x1846a7={'account':_0x8ebd3f,'to':_0x2c3375['to'],'data':_0x2c3375[_0x2729bf(0x116)],'value':BigInt(_0x2c3375[_0x2729bf(0x122)]),..._0x4d2668};let _0x1ccbaf;try{_0x1ccbaf=await _0x567664[_0x2729bf(0x125)](_0x1846a7);}catch(_0x4cf859){throw _0x4cf859 instanceof _0x4aee4f?new Error((_0x2c3375[_0x2729bf(0x11d)]===_0x2729bf(0xf7)?_0x2729bf(0x132):_0x2c3375[_0x2729bf(0x11d)]===_0x2729bf(0x121)?_0x2729bf(0x10a):'The\x20token\x20authorization')+_0x2729bf(0xef),{'cause':_0x4cf859}):_0x4cf859;}if(_0x1ccbaf>BigInt(_0x2c3375[_0x2729bf(0x11a)]))throw new Error(_0x2729bf(0x140));const _0x3ba486=await _0x4b8cd3['prepareTransactionRequest']({..._0x1846a7,'gas':BigInt(_0x2c3375['gas']),'nonce':await _0x56f787(_0x43fc06,_0x567664,_0x8ebd3f[_0x2729bf(0x115)])});if(await _0x222eba({..._0x4d18e1,'expectedWallet':_0x8ebd3f[_0x2729bf(0x115)]}),_0x4d18e1[_0x2729bf(0x13a)]?.[_0x2729bf(0xfc)](),_0x5c1a13(await _0x284bd5(_0x4d18e1[_0x2729bf(0xf0)],_0x43fc06[_0x2729bf(0xf6)])),_0x5c3d8a[_0x2729bf(0x11e)]*0x3e8<=Date[_0x2729bf(0xf8)]())throw Object[_0x2729bf(0x117)](new Error(_0x2729bf(0xfd)),{'code':_0x2729bf(0x110)});Object['assign'](_0x3ba486,_0x33b47f(await _0x1312f8(_0x567664,_0x4f10c6),_0x5c3d8a)),_0x2c3375[_0x2729bf(0x124)]=await _0x4b8cd3[_0x2729bf(0x12c)](_0x3ba486),_0x2c3375[_0x2729bf(0x13d)]=_0x17dfd9(_0x2c3375['rawTransaction']),_0x2c3375[_0x2729bf(0x104)]='signed',delete _0x43fc06[_0x2729bf(0x10d)],_0x43fc06[_0x2729bf(0x104)]=_0x2729bf(0x133),await _0x54e44e(_0x4d18e1[_0x2729bf(0xf0)],_0x43fc06);}const _0x738eff=await _0x37456e(_0x567664,_0x2c3375,_0x4d18e1);if(_0x2c3375[_0x2729bf(0x104)]=_0x738eff[_0x2729bf(0x104)]===_0x2729bf(0x135)?_0x2729bf(0x139):_0x2729bf(0x119),_0x2c3375['confirmedHash']=_0x738eff[_0x2729bf(0xf3)],delete _0x43fc06[_0x2729bf(0x10f)],await _0x54e44e(_0x4d18e1[_0x2729bf(0xf0)],_0x43fc06),_0x2c3375[_0x2729bf(0x104)]===_0x2729bf(0x119))throw new Error(_0x2729bf(0x123)+_0x2c3375[_0x2729bf(0x11d)]+_0x2729bf(0x12f)+_0x2c3375['hash']+_0x2729bf(0x137));}const _0x57c0b0=_0x797c50(_0x43fc06);if(await N(_0x567664,_0x57c0b0[_0x2729bf(0x107)],_0x8ebd3f[_0x2729bf(0x115)])<BigInt(_0x57c0b0['amount']))throw new Error(_0x2729bf(0x131));_0x5c1a13(await _0x284bd5(_0x4d18e1[_0x2729bf(0xf0)],_0x43fc06[_0x2729bf(0xf6)])),_0x5c3d8a[_0x2729bf(0x104)]='ready',await _0x54e44e(_0x4d18e1[_0x2729bf(0xf0)],_0x43fc06);}export{Be as fundOrder,ve as planFunding,ye as prepareFunding};