nextclaw 0.13.38 → 0.13.39
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/LICENSE +21 -0
- package/dist/cli/index.js +3 -0
- package/package.json +23 -24
- package/ui-dist/assets/{ChannelsList-Bfy2ALm4.js → ChannelsList-D75wfbDS.js} +1 -1
- package/ui-dist/assets/{ChatPage-5aW7Lzjo.js → ChatPage-gWZ3rDTy.js} +14 -14
- package/ui-dist/assets/{DocBrowser-BJUes9L-.js → DocBrowser-CebTdor0.js} +1 -1
- package/ui-dist/assets/{LogoBadge-BdzDhsM3.js → LogoBadge-gdbraoaZ.js} +1 -1
- package/ui-dist/assets/{MarketplacePage-BkJvyEXE.js → MarketplacePage-C-zz0lBT.js} +1 -1
- package/ui-dist/assets/{McpMarketplacePage-BRw0OlwZ.js → McpMarketplacePage-tfpLh6Zz.js} +1 -1
- package/ui-dist/assets/{ModelConfig-D9wwVTag.js → ModelConfig-j74dn-5k.js} +1 -1
- package/ui-dist/assets/{ProvidersList-CacUSdTx.js → ProvidersList-BGI9EgVV.js} +1 -1
- package/ui-dist/assets/{RemoteAccessPage-Bz8hL7Yp.js → RemoteAccessPage-CusGQmZE.js} +1 -1
- package/ui-dist/assets/{RuntimeConfig-BbXgirGN.js → RuntimeConfig-pmhW8ifz.js} +1 -1
- package/ui-dist/assets/{SearchConfig-Bu_B0Lv1.js → SearchConfig-rrD2_F5u.js} +1 -1
- package/ui-dist/assets/{SecretsConfig-D0Tebaat.js → SecretsConfig-D7onb-hv.js} +1 -1
- package/ui-dist/assets/{SessionsConfig-Bx4vn1Oo.js → SessionsConfig-m-6RSeja.js} +1 -1
- package/ui-dist/assets/{chat-message-CxYo91JQ.js → chat-message-BO-s2mvl.js} +1 -1
- package/ui-dist/assets/{index-s75IHJNr.js → index-BsL1YIJ1.js} +5 -5
- package/ui-dist/assets/index-C63mHRbE.css +1 -0
- package/ui-dist/assets/{label-D1yR9OAj.js → label-CDSYExvV.js} +1 -1
- package/ui-dist/assets/{page-layout-DVz0vGvS.js → page-layout-BMCVAnQM.js} +1 -1
- package/ui-dist/assets/{popover-DRjgi46e.js → popover-DfywyUDH.js} +1 -1
- package/ui-dist/assets/{security-config-BQ4f9vuc.js → security-config-BU-K2EOM.js} +1 -1
- package/ui-dist/assets/{skeleton-B1N904mE.js → skeleton-Cg9CRkOt.js} +1 -1
- package/ui-dist/assets/{status-dot-D0NjdrnJ.js → status-dot-2vau2Xtc.js} +1 -1
- package/ui-dist/assets/{switch-D6un_Xg0.js → switch-CJRPF2V6.js} +1 -1
- package/ui-dist/assets/{tabs-custom-COogvgHG.js → tabs-custom-B-2uSCfW.js} +1 -1
- package/ui-dist/assets/{useConfirmDialog-KdwYA2DQ.js → useConfirmDialog-CfOpdypA.js} +1 -1
- package/ui-dist/index.html +2 -2
- package/ui-dist/assets/index-LIfO62va.css +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 NextClaw contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/cli/index.js
CHANGED
|
@@ -874,6 +874,9 @@ async function waitForExit(pid, timeoutMs) {
|
|
|
874
874
|
return !isProcessRunning(pid);
|
|
875
875
|
}
|
|
876
876
|
function resolveUiStaticDir() {
|
|
877
|
+
if (process.env.NEXTCLAW_DISABLE_STATIC_UI === "1") {
|
|
878
|
+
return null;
|
|
879
|
+
}
|
|
877
880
|
const envDir = process.env.NEXTCLAW_UI_STATIC_DIR;
|
|
878
881
|
if (envDir) {
|
|
879
882
|
return existsSync5(join2(envDir, "index.html")) ? envDir : null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nextclaw",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.39",
|
|
4
4
|
"description": "Lightweight personal AI assistant with CLI, multi-provider routing, and channel integrations.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -35,38 +35,37 @@
|
|
|
35
35
|
"ui-dist",
|
|
36
36
|
"templates"
|
|
37
37
|
],
|
|
38
|
-
"scripts": {
|
|
39
|
-
"dev": "tsx watch --tsconfig tsconfig.json src/cli/index.ts",
|
|
40
|
-
"dev:build": "tsx src/cli/index.ts",
|
|
41
|
-
"build": "node scripts/sync-usage-template.mjs && tsup src/index.ts src/cli/index.ts --format esm --dts --out-dir dist && node scripts/copy-ui-dist.mjs",
|
|
42
|
-
"prepack": "pnpm run build",
|
|
43
|
-
"start": "node dist/cli.js",
|
|
44
|
-
"lint": "eslint .",
|
|
45
|
-
"tsc": "tsc -p tsconfig.json",
|
|
46
|
-
"test": "vitest"
|
|
47
|
-
},
|
|
48
38
|
"dependencies": {
|
|
49
39
|
"chokidar": "^3.6.0",
|
|
50
40
|
"commander": "^12.1.0",
|
|
51
41
|
"yaml": "^2.8.1",
|
|
52
|
-
"@nextclaw/core": "
|
|
53
|
-
"@nextclaw/mcp": "
|
|
54
|
-
"@nextclaw/ncp": "
|
|
55
|
-
"@nextclaw/ncp-
|
|
56
|
-
"@nextclaw/ncp
|
|
57
|
-
"@nextclaw/
|
|
58
|
-
"@nextclaw/
|
|
59
|
-
"@nextclaw/
|
|
60
|
-
"@nextclaw/
|
|
61
|
-
"@nextclaw/
|
|
42
|
+
"@nextclaw/core": "0.9.12",
|
|
43
|
+
"@nextclaw/mcp": "0.1.31",
|
|
44
|
+
"@nextclaw/ncp-agent-runtime": "0.2.2",
|
|
45
|
+
"@nextclaw/ncp-mcp": "0.1.30",
|
|
46
|
+
"@nextclaw/ncp": "0.3.2",
|
|
47
|
+
"@nextclaw/runtime": "0.2.12",
|
|
48
|
+
"@nextclaw/ncp-toolkit": "0.4.2",
|
|
49
|
+
"@nextclaw/server": "0.10.35",
|
|
50
|
+
"@nextclaw/openclaw-compat": "0.3.18",
|
|
51
|
+
"@nextclaw/remote": "0.1.29"
|
|
62
52
|
},
|
|
63
53
|
"devDependencies": {
|
|
64
|
-
"@nextclaw/ui": "workspace:*",
|
|
65
54
|
"@types/node": "^20.17.6",
|
|
66
55
|
"prettier": "^3.3.3",
|
|
67
56
|
"tsup": "^8.3.5",
|
|
68
57
|
"tsx": "^4.19.2",
|
|
69
58
|
"typescript": "^5.6.3",
|
|
70
|
-
"vitest": "^2.1.2"
|
|
59
|
+
"vitest": "^2.1.2",
|
|
60
|
+
"@nextclaw/ui": "0.9.17"
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"dev": "tsx watch --tsconfig tsconfig.json src/cli/index.ts",
|
|
64
|
+
"dev:build": "tsx src/cli/index.ts",
|
|
65
|
+
"build": "node scripts/sync-usage-template.mjs && tsup src/index.ts src/cli/index.ts --format esm --dts --out-dir dist && node scripts/copy-ui-dist.mjs",
|
|
66
|
+
"start": "node dist/cli.js",
|
|
67
|
+
"lint": "eslint .",
|
|
68
|
+
"tsc": "tsc -p tsconfig.json",
|
|
69
|
+
"test": "vitest"
|
|
71
70
|
}
|
|
72
|
-
}
|
|
71
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as L,j as u,X as It,K as Bt,aq as Pt,b1 as Tt,b2 as Mt,b3 as Rt,a0 as Lt,g as ut,f as kt,b4 as Pe,ae as Te,b5 as Dt,ai as dt,e as q,a3 as Ut,i as Ft,G as qt,H as _t}from"./vendor-DJt0Azq5.js";import{Z as zt,t as c,c as K,I as Q,S as Ot,e as Ht,f as Kt,g as Vt,h as Jt,$ as ft,B as Ne,n as Gt,u as gt,a as ht,b as mt,a0 as Yt,a1 as Qt}from"./index-s75IHJNr.js";import{S as pt}from"./status-dot-D0NjdrnJ.js";import{L as yt}from"./LogoBadge-BdzDhsM3.js";import{h as Ee}from"./config-hints-CApS3K_7.js";import{c as Wt,b as Zt,a as Xt,C as $t}from"./config-layout-BHnOoweL.js";import{L as en}from"./label-D1yR9OAj.js";import{S as tn}from"./switch-D6un_Xg0.js";import{T as nn}from"./tabs-custom-COogvgHG.js";import{P as rn,a as sn}from"./page-layout-DVz0vGvS.js";function bt(e){var n,t;const s=zt();return((n=e.tutorialUrls)==null?void 0:n[s])||((t=e.tutorialUrls)==null?void 0:t.default)||e.tutorialUrl}const an={telegram:"telegram.svg",slack:"slack.svg",discord:"discord.svg",whatsapp:"whatsapp.svg",qq:"qq.svg",feishu:"feishu.svg",dingtalk:"dingtalk.svg",wecom:"wecom.svg",weixin:"weixin.svg",mochat:"mochat.svg",email:"email.svg"};function on(e,s){const a=s.toLowerCase(),n=e[a];return n?`/logos/${n}`:null}function wt(e){return on(an,e)}function ln({value:e,onChange:s,className:a,placeholder:n=""}){const[t,r]=L.useState(""),i=l=>{l.key==="Enter"&&t.trim()?(l.preventDefault(),s([...e,t.trim()]),r("")):l.key==="Backspace"&&!t&&e.length>0&&s(e.slice(0,-1))},o=l=>{s(e.filter((d,h)=>h!==l))};return u.jsxs("div",{className:K("flex flex-wrap gap-2 p-2 border rounded-md min-h-[42px]",a),children:[e.map((l,d)=>u.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-primary text-primary-foreground rounded text-sm",children:[l,u.jsx("button",{type:"button",onClick:()=>o(d),className:"hover:text-red-300 transition-colors",children:u.jsx(It,{className:"h-3 w-3"})})]},d)),u.jsx("input",{type:"text",value:t,onChange:l=>r(l.target.value),onKeyDown:i,className:"flex-1 outline-none min-w-[100px] bg-transparent text-sm",placeholder:n||c("enterTag")})]})}function cn(e){return e.includes("token")||e.includes("secret")||e.includes("password")?u.jsx(Bt,{className:"h-3.5 w-3.5 text-gray-500"}):e.includes("url")||e.includes("host")?u.jsx(Pt,{className:"h-3.5 w-3.5 text-gray-500"}):e.includes("email")||e.includes("mail")?u.jsx(Tt,{className:"h-3.5 w-3.5 text-gray-500"}):e.includes("id")||e.includes("from")?u.jsx(Mt,{className:"h-3.5 w-3.5 text-gray-500"}):e==="enabled"||e==="consentGranted"?u.jsx(Rt,{className:"h-3.5 w-3.5 text-gray-500"}):u.jsx(Lt,{className:"h-3.5 w-3.5 text-gray-500"})}function Me({channelName:e,fields:s,formData:a,jsonDrafts:n,setJsonDrafts:t,updateField:r,uiHints:i}){return u.jsx(u.Fragment,{children:s.map(o=>{const l=Ee(`channels.${e}.${o.name}`,i),d=(l==null?void 0:l.label)??o.label,h=l==null?void 0:l.placeholder;return u.jsxs("div",{className:"space-y-2.5",children:[u.jsxs(en,{htmlFor:o.name,className:"flex items-center gap-2 text-sm font-medium text-gray-900",children:[cn(o.name),d]}),o.type==="boolean"&&u.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-gray-50 p-3",children:[u.jsx("span",{className:"text-sm text-gray-500",children:a[o.name]?c("enabled"):c("disabled")}),u.jsx(tn,{id:o.name,checked:a[o.name]||!1,onCheckedChange:f=>r(o.name,f),className:"data-[state=checked]:bg-emerald-500"})]}),(o.type==="text"||o.type==="email")&&u.jsx(Q,{id:o.name,type:o.type,value:a[o.name]||"",onChange:f=>r(o.name,f.target.value),placeholder:h,className:"rounded-xl"}),o.type==="password"&&u.jsx(Q,{id:o.name,type:"password",value:a[o.name]||"",onChange:f=>r(o.name,f.target.value),placeholder:h??c("leaveBlankToKeepUnchanged"),className:"rounded-xl"}),o.type==="number"&&u.jsx(Q,{id:o.name,type:"number",value:a[o.name]||0,onChange:f=>r(o.name,parseInt(f.target.value,10)||0),placeholder:h,className:"rounded-xl"}),o.type==="tags"&&u.jsx(ln,{value:a[o.name]||[],onChange:f=>r(o.name,f)}),o.type==="select"&&u.jsxs(Ot,{value:a[o.name]||"",onValueChange:f=>r(o.name,f),children:[u.jsx(Ht,{className:"rounded-xl",children:u.jsx(Kt,{})}),u.jsx(Vt,{children:(o.options??[]).map(f=>u.jsx(Jt,{value:f.value,children:f.label},f.value))})]}),o.type==="json"&&u.jsx("textarea",{id:o.name,value:n[o.name]??"{}",onChange:f=>t(x=>({...x,[o.name]:f.target.value})),className:"min-h-[120px] w-full resize-none rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono"})]},o.name)})})}const Re=[{value:"pairing",label:"pairing"},{value:"allowlist",label:"allowlist"},{value:"open",label:"open"},{value:"disabled",label:"disabled"}],Le=[{value:"open",label:"open"},{value:"allowlist",label:"allowlist"},{value:"disabled",label:"disabled"}],un=[{value:"off",label:"off"},{value:"partial",label:"partial"},{value:"block",label:"block"},{value:"progress",label:"progress"}];function ke(){return{telegram:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"token",type:"password",label:c("botToken")},{name:"allowFrom",type:"tags",label:c("allowFrom")},{name:"proxy",type:"text",label:c("proxy")},{name:"accountId",type:"text",label:c("accountId")},{name:"dmPolicy",type:"select",label:c("dmPolicy"),options:Re},{name:"groupPolicy",type:"select",label:c("groupPolicy"),options:Le},{name:"groupAllowFrom",type:"tags",label:c("groupAllowFrom")},{name:"requireMention",type:"boolean",label:c("requireMention")},{name:"mentionPatterns",type:"tags",label:c("mentionPatterns")},{name:"groups",type:"json",label:c("groupRulesJson")}],discord:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"token",type:"password",label:c("botToken")},{name:"allowBots",type:"boolean",label:c("allowBotMessages")},{name:"allowFrom",type:"tags",label:c("allowFrom")},{name:"gatewayUrl",type:"text",label:c("gatewayUrl")},{name:"intents",type:"number",label:c("intents")},{name:"proxy",type:"text",label:c("proxy")},{name:"mediaMaxMb",type:"number",label:c("attachmentMaxSizeMb")},{name:"streaming",type:"select",label:c("streamingMode"),options:un},{name:"draftChunk",type:"json",label:c("draftChunkingJson")},{name:"textChunkLimit",type:"number",label:c("textChunkLimit")},{name:"accountId",type:"text",label:c("accountId")},{name:"dmPolicy",type:"select",label:c("dmPolicy"),options:Re},{name:"groupPolicy",type:"select",label:c("groupPolicy"),options:Le},{name:"groupAllowFrom",type:"tags",label:c("groupAllowFrom")},{name:"requireMention",type:"boolean",label:c("requireMention")},{name:"mentionPatterns",type:"tags",label:c("mentionPatterns")},{name:"groups",type:"json",label:c("groupRulesJson")}],whatsapp:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"bridgeUrl",type:"text",label:c("bridgeUrl")},{name:"allowFrom",type:"tags",label:c("allowFrom")}],feishu:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"appId",type:"text",label:c("appId")},{name:"appSecret",type:"password",label:c("appSecret")},{name:"encryptKey",type:"password",label:c("encryptKey")},{name:"verificationToken",type:"password",label:c("verificationToken")},{name:"allowFrom",type:"tags",label:c("allowFrom")}],dingtalk:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"clientId",type:"text",label:c("clientId")},{name:"clientSecret",type:"password",label:c("clientSecret")},{name:"allowFrom",type:"tags",label:c("allowFrom")}],wecom:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"corpId",type:"text",label:c("corpId")},{name:"agentId",type:"text",label:c("agentId")},{name:"secret",type:"password",label:c("secret")},{name:"token",type:"password",label:c("token")},{name:"callbackPort",type:"number",label:c("callbackPort")},{name:"callbackPath",type:"text",label:c("callbackPath")},{name:"allowFrom",type:"tags",label:c("allowFrom")}],weixin:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"defaultAccountId",type:"text",label:c("defaultAccountId")},{name:"baseUrl",type:"text",label:c("baseUrl")},{name:"pollTimeoutMs",type:"number",label:c("pollTimeoutMs")},{name:"allowFrom",type:"tags",label:c("allowFrom")},{name:"accounts",type:"json",label:c("accountsJson")}],slack:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"mode",type:"text",label:c("mode")},{name:"webhookPath",type:"text",label:c("webhookPath")},{name:"allowBots",type:"boolean",label:c("allowBotMessages")},{name:"botToken",type:"password",label:c("botToken")},{name:"appToken",type:"password",label:c("appToken")}],email:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"consentGranted",type:"boolean",label:c("consentGranted")},{name:"imapHost",type:"text",label:c("imapHost")},{name:"imapPort",type:"number",label:c("imapPort")},{name:"imapUsername",type:"text",label:c("imapUsername")},{name:"imapPassword",type:"password",label:c("imapPassword")},{name:"fromAddress",type:"email",label:c("fromAddress")}],mochat:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"baseUrl",type:"text",label:c("baseUrl")},{name:"clawToken",type:"password",label:c("clawToken")},{name:"agentUserId",type:"text",label:c("agentUserId")},{name:"allowFrom",type:"tags",label:c("allowFrom")}],qq:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"appId",type:"text",label:c("appId")},{name:"secret",type:"password",label:c("appSecret")},{name:"markdownSupport",type:"boolean",label:c("markdownSupport")},{name:"allowFrom",type:"tags",label:c("allowFrom")}]}}var H={},te,De;function dn(){return De||(De=1,te=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),te}var ne={},F={},Ue;function _(){if(Ue)return F;Ue=1;let e;const s=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return F.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},F.getSymbolTotalCodewords=function(n){return s[n]},F.getBCHDigit=function(a){let n=0;for(;a!==0;)n++,a>>>=1;return n},F.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');e=n},F.isKanjiModeEnabled=function(){return typeof e<"u"},F.toSJIS=function(n){return e(n)},F}var re={},Fe;function je(){return Fe||(Fe=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function s(a){if(typeof a!="string")throw new Error("Param is not a string");switch(a.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+a)}}e.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},e.from=function(n,t){if(e.isValid(n))return n;try{return s(n)}catch{return t}}})(re)),re}var se,qe;function fn(){if(qe)return se;qe=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(s){const a=Math.floor(s/8);return(this.buffer[a]>>>7-s%8&1)===1},put:function(s,a){for(let n=0;n<a;n++)this.putBit((s>>>a-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(s){const a=Math.floor(this.length/8);this.buffer.length<=a&&this.buffer.push(0),s&&(this.buffer[a]|=128>>>this.length%8),this.length++}},se=e,se}var ae,_e;function gn(){if(_e)return ae;_e=1;function e(s){if(!s||s<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=s,this.data=new Uint8Array(s*s),this.reservedBit=new Uint8Array(s*s)}return e.prototype.set=function(s,a,n,t){const r=s*this.size+a;this.data[r]=n,t&&(this.reservedBit[r]=!0)},e.prototype.get=function(s,a){return this.data[s*this.size+a]},e.prototype.xor=function(s,a,n){this.data[s*this.size+a]^=n},e.prototype.isReserved=function(s,a){return this.reservedBit[s*this.size+a]},ae=e,ae}var oe={},ze;function hn(){return ze||(ze=1,(function(e){const s=_().getSymbolSize;e.getRowColCoords=function(n){if(n===1)return[];const t=Math.floor(n/7)+2,r=s(n),i=r===145?26:Math.ceil((r-13)/(2*t-2))*2,o=[r-7];for(let l=1;l<t-1;l++)o[l]=o[l-1]-i;return o.push(6),o.reverse()},e.getPositions=function(n){const t=[],r=e.getRowColCoords(n),i=r.length;for(let o=0;o<i;o++)for(let l=0;l<i;l++)o===0&&l===0||o===0&&l===i-1||o===i-1&&l===0||t.push([r[o],r[l]]);return t}})(oe)),oe}var ie={},Oe;function mn(){if(Oe)return ie;Oe=1;const e=_().getSymbolSize,s=7;return ie.getPositions=function(n){const t=e(n);return[[0,0],[t-s,0],[0,t-s]]},ie}var le={},He;function pn(){return He||(He=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const s={N1:3,N2:3,N3:40,N4:10};e.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(t){const r=t.size;let i=0,o=0,l=0,d=null,h=null;for(let f=0;f<r;f++){o=l=0,d=h=null;for(let x=0;x<r;x++){let g=t.get(f,x);g===d?o++:(o>=5&&(i+=s.N1+(o-5)),d=g,o=1),g=t.get(x,f),g===h?l++:(l>=5&&(i+=s.N1+(l-5)),h=g,l=1)}o>=5&&(i+=s.N1+(o-5)),l>=5&&(i+=s.N1+(l-5))}return i},e.getPenaltyN2=function(t){const r=t.size;let i=0;for(let o=0;o<r-1;o++)for(let l=0;l<r-1;l++){const d=t.get(o,l)+t.get(o,l+1)+t.get(o+1,l)+t.get(o+1,l+1);(d===4||d===0)&&i++}return i*s.N2},e.getPenaltyN3=function(t){const r=t.size;let i=0,o=0,l=0;for(let d=0;d<r;d++){o=l=0;for(let h=0;h<r;h++)o=o<<1&2047|t.get(d,h),h>=10&&(o===1488||o===93)&&i++,l=l<<1&2047|t.get(h,d),h>=10&&(l===1488||l===93)&&i++}return i*s.N3},e.getPenaltyN4=function(t){let r=0;const i=t.data.length;for(let l=0;l<i;l++)r+=t.data[l];return Math.abs(Math.ceil(r*100/i/5)-10)*s.N4};function a(n,t,r){switch(n){case e.Patterns.PATTERN000:return(t+r)%2===0;case e.Patterns.PATTERN001:return t%2===0;case e.Patterns.PATTERN010:return r%3===0;case e.Patterns.PATTERN011:return(t+r)%3===0;case e.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2===0;case e.Patterns.PATTERN101:return t*r%2+t*r%3===0;case e.Patterns.PATTERN110:return(t*r%2+t*r%3)%2===0;case e.Patterns.PATTERN111:return(t*r%3+(t+r)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}e.applyMask=function(t,r){const i=r.size;for(let o=0;o<i;o++)for(let l=0;l<i;l++)r.isReserved(l,o)||r.xor(l,o,a(t,l,o))},e.getBestMask=function(t,r){const i=Object.keys(e.Patterns).length;let o=0,l=1/0;for(let d=0;d<i;d++){r(d),e.applyMask(d,t);const h=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(d,t),h<l&&(l=h,o=d)}return o}})(le)),le}var Y={},Ke;function xt(){if(Ke)return Y;Ke=1;const e=je(),s=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],a=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Y.getBlocksCount=function(t,r){switch(r){case e.L:return s[(t-1)*4+0];case e.M:return s[(t-1)*4+1];case e.Q:return s[(t-1)*4+2];case e.H:return s[(t-1)*4+3];default:return}},Y.getTotalCodewordsCount=function(t,r){switch(r){case e.L:return a[(t-1)*4+0];case e.M:return a[(t-1)*4+1];case e.Q:return a[(t-1)*4+2];case e.H:return a[(t-1)*4+3];default:return}},Y}var ce={},J={},Ve;function yn(){if(Ve)return J;Ve=1;const e=new Uint8Array(512),s=new Uint8Array(256);return(function(){let n=1;for(let t=0;t<255;t++)e[t]=n,s[n]=t,n<<=1,n&256&&(n^=285);for(let t=255;t<512;t++)e[t]=e[t-255]})(),J.log=function(n){if(n<1)throw new Error("log("+n+")");return s[n]},J.exp=function(n){return e[n]},J.mul=function(n,t){return n===0||t===0?0:e[s[n]+s[t]]},J}var Je;function bn(){return Je||(Je=1,(function(e){const s=yn();e.mul=function(n,t){const r=new Uint8Array(n.length+t.length-1);for(let i=0;i<n.length;i++)for(let o=0;o<t.length;o++)r[i+o]^=s.mul(n[i],t[o]);return r},e.mod=function(n,t){let r=new Uint8Array(n);for(;r.length-t.length>=0;){const i=r[0];for(let l=0;l<t.length;l++)r[l]^=s.mul(t[l],i);let o=0;for(;o<r.length&&r[o]===0;)o++;r=r.slice(o)}return r},e.generateECPolynomial=function(n){let t=new Uint8Array([1]);for(let r=0;r<n;r++)t=e.mul(t,new Uint8Array([1,s.exp(r)]));return t}})(ce)),ce}var ue,Ge;function wn(){if(Ge)return ue;Ge=1;const e=bn();function s(a){this.genPoly=void 0,this.degree=a,this.degree&&this.initialize(this.degree)}return s.prototype.initialize=function(n){this.degree=n,this.genPoly=e.generateECPolynomial(this.degree)},s.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(n.length+this.degree);t.set(n);const r=e.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){const o=new Uint8Array(this.degree);return o.set(r,i),o}return r},ue=s,ue}var de={},fe={},ge={},Ye;function Ct(){return Ye||(Ye=1,ge.isValid=function(s){return!isNaN(s)&&s>=1&&s<=40}),ge}var k={},Qe;function At(){if(Qe)return k;Qe=1;const e="[0-9]+",s="[A-Z $%*+\\-./:]+";let a="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";a=a.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+a+`)(?:.|[\r
|
|
1
|
+
import{r as L,j as u,X as It,K as Bt,aq as Pt,b1 as Tt,b2 as Mt,b3 as Rt,a0 as Lt,g as ut,f as kt,b4 as Pe,ae as Te,b5 as Dt,ai as dt,e as q,a3 as Ut,i as Ft,G as qt,H as _t}from"./vendor-DJt0Azq5.js";import{Z as zt,t as c,c as K,I as Q,S as Ot,e as Ht,f as Kt,g as Vt,h as Jt,$ as ft,B as Ne,n as Gt,u as gt,a as ht,b as mt,a0 as Yt,a1 as Qt}from"./index-BsL1YIJ1.js";import{S as pt}from"./status-dot-2vau2Xtc.js";import{L as yt}from"./LogoBadge-gdbraoaZ.js";import{h as Ee}from"./config-hints-CApS3K_7.js";import{c as Wt,b as Zt,a as Xt,C as $t}from"./config-layout-BHnOoweL.js";import{L as en}from"./label-CDSYExvV.js";import{S as tn}from"./switch-CJRPF2V6.js";import{T as nn}from"./tabs-custom-B-2uSCfW.js";import{P as rn,a as sn}from"./page-layout-BMCVAnQM.js";function bt(e){var n,t;const s=zt();return((n=e.tutorialUrls)==null?void 0:n[s])||((t=e.tutorialUrls)==null?void 0:t.default)||e.tutorialUrl}const an={telegram:"telegram.svg",slack:"slack.svg",discord:"discord.svg",whatsapp:"whatsapp.svg",qq:"qq.svg",feishu:"feishu.svg",dingtalk:"dingtalk.svg",wecom:"wecom.svg",weixin:"weixin.svg",mochat:"mochat.svg",email:"email.svg"};function on(e,s){const a=s.toLowerCase(),n=e[a];return n?`/logos/${n}`:null}function wt(e){return on(an,e)}function ln({value:e,onChange:s,className:a,placeholder:n=""}){const[t,r]=L.useState(""),i=l=>{l.key==="Enter"&&t.trim()?(l.preventDefault(),s([...e,t.trim()]),r("")):l.key==="Backspace"&&!t&&e.length>0&&s(e.slice(0,-1))},o=l=>{s(e.filter((d,h)=>h!==l))};return u.jsxs("div",{className:K("flex flex-wrap gap-2 p-2 border rounded-md min-h-[42px]",a),children:[e.map((l,d)=>u.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-primary text-primary-foreground rounded text-sm",children:[l,u.jsx("button",{type:"button",onClick:()=>o(d),className:"hover:text-red-300 transition-colors",children:u.jsx(It,{className:"h-3 w-3"})})]},d)),u.jsx("input",{type:"text",value:t,onChange:l=>r(l.target.value),onKeyDown:i,className:"flex-1 outline-none min-w-[100px] bg-transparent text-sm",placeholder:n||c("enterTag")})]})}function cn(e){return e.includes("token")||e.includes("secret")||e.includes("password")?u.jsx(Bt,{className:"h-3.5 w-3.5 text-gray-500"}):e.includes("url")||e.includes("host")?u.jsx(Pt,{className:"h-3.5 w-3.5 text-gray-500"}):e.includes("email")||e.includes("mail")?u.jsx(Tt,{className:"h-3.5 w-3.5 text-gray-500"}):e.includes("id")||e.includes("from")?u.jsx(Mt,{className:"h-3.5 w-3.5 text-gray-500"}):e==="enabled"||e==="consentGranted"?u.jsx(Rt,{className:"h-3.5 w-3.5 text-gray-500"}):u.jsx(Lt,{className:"h-3.5 w-3.5 text-gray-500"})}function Me({channelName:e,fields:s,formData:a,jsonDrafts:n,setJsonDrafts:t,updateField:r,uiHints:i}){return u.jsx(u.Fragment,{children:s.map(o=>{const l=Ee(`channels.${e}.${o.name}`,i),d=(l==null?void 0:l.label)??o.label,h=l==null?void 0:l.placeholder;return u.jsxs("div",{className:"space-y-2.5",children:[u.jsxs(en,{htmlFor:o.name,className:"flex items-center gap-2 text-sm font-medium text-gray-900",children:[cn(o.name),d]}),o.type==="boolean"&&u.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-gray-50 p-3",children:[u.jsx("span",{className:"text-sm text-gray-500",children:a[o.name]?c("enabled"):c("disabled")}),u.jsx(tn,{id:o.name,checked:a[o.name]||!1,onCheckedChange:f=>r(o.name,f),className:"data-[state=checked]:bg-emerald-500"})]}),(o.type==="text"||o.type==="email")&&u.jsx(Q,{id:o.name,type:o.type,value:a[o.name]||"",onChange:f=>r(o.name,f.target.value),placeholder:h,className:"rounded-xl"}),o.type==="password"&&u.jsx(Q,{id:o.name,type:"password",value:a[o.name]||"",onChange:f=>r(o.name,f.target.value),placeholder:h??c("leaveBlankToKeepUnchanged"),className:"rounded-xl"}),o.type==="number"&&u.jsx(Q,{id:o.name,type:"number",value:a[o.name]||0,onChange:f=>r(o.name,parseInt(f.target.value,10)||0),placeholder:h,className:"rounded-xl"}),o.type==="tags"&&u.jsx(ln,{value:a[o.name]||[],onChange:f=>r(o.name,f)}),o.type==="select"&&u.jsxs(Ot,{value:a[o.name]||"",onValueChange:f=>r(o.name,f),children:[u.jsx(Ht,{className:"rounded-xl",children:u.jsx(Kt,{})}),u.jsx(Vt,{children:(o.options??[]).map(f=>u.jsx(Jt,{value:f.value,children:f.label},f.value))})]}),o.type==="json"&&u.jsx("textarea",{id:o.name,value:n[o.name]??"{}",onChange:f=>t(x=>({...x,[o.name]:f.target.value})),className:"min-h-[120px] w-full resize-none rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono"})]},o.name)})})}const Re=[{value:"pairing",label:"pairing"},{value:"allowlist",label:"allowlist"},{value:"open",label:"open"},{value:"disabled",label:"disabled"}],Le=[{value:"open",label:"open"},{value:"allowlist",label:"allowlist"},{value:"disabled",label:"disabled"}],un=[{value:"off",label:"off"},{value:"partial",label:"partial"},{value:"block",label:"block"},{value:"progress",label:"progress"}];function ke(){return{telegram:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"token",type:"password",label:c("botToken")},{name:"allowFrom",type:"tags",label:c("allowFrom")},{name:"proxy",type:"text",label:c("proxy")},{name:"accountId",type:"text",label:c("accountId")},{name:"dmPolicy",type:"select",label:c("dmPolicy"),options:Re},{name:"groupPolicy",type:"select",label:c("groupPolicy"),options:Le},{name:"groupAllowFrom",type:"tags",label:c("groupAllowFrom")},{name:"requireMention",type:"boolean",label:c("requireMention")},{name:"mentionPatterns",type:"tags",label:c("mentionPatterns")},{name:"groups",type:"json",label:c("groupRulesJson")}],discord:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"token",type:"password",label:c("botToken")},{name:"allowBots",type:"boolean",label:c("allowBotMessages")},{name:"allowFrom",type:"tags",label:c("allowFrom")},{name:"gatewayUrl",type:"text",label:c("gatewayUrl")},{name:"intents",type:"number",label:c("intents")},{name:"proxy",type:"text",label:c("proxy")},{name:"mediaMaxMb",type:"number",label:c("attachmentMaxSizeMb")},{name:"streaming",type:"select",label:c("streamingMode"),options:un},{name:"draftChunk",type:"json",label:c("draftChunkingJson")},{name:"textChunkLimit",type:"number",label:c("textChunkLimit")},{name:"accountId",type:"text",label:c("accountId")},{name:"dmPolicy",type:"select",label:c("dmPolicy"),options:Re},{name:"groupPolicy",type:"select",label:c("groupPolicy"),options:Le},{name:"groupAllowFrom",type:"tags",label:c("groupAllowFrom")},{name:"requireMention",type:"boolean",label:c("requireMention")},{name:"mentionPatterns",type:"tags",label:c("mentionPatterns")},{name:"groups",type:"json",label:c("groupRulesJson")}],whatsapp:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"bridgeUrl",type:"text",label:c("bridgeUrl")},{name:"allowFrom",type:"tags",label:c("allowFrom")}],feishu:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"appId",type:"text",label:c("appId")},{name:"appSecret",type:"password",label:c("appSecret")},{name:"encryptKey",type:"password",label:c("encryptKey")},{name:"verificationToken",type:"password",label:c("verificationToken")},{name:"allowFrom",type:"tags",label:c("allowFrom")}],dingtalk:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"clientId",type:"text",label:c("clientId")},{name:"clientSecret",type:"password",label:c("clientSecret")},{name:"allowFrom",type:"tags",label:c("allowFrom")}],wecom:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"corpId",type:"text",label:c("corpId")},{name:"agentId",type:"text",label:c("agentId")},{name:"secret",type:"password",label:c("secret")},{name:"token",type:"password",label:c("token")},{name:"callbackPort",type:"number",label:c("callbackPort")},{name:"callbackPath",type:"text",label:c("callbackPath")},{name:"allowFrom",type:"tags",label:c("allowFrom")}],weixin:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"defaultAccountId",type:"text",label:c("defaultAccountId")},{name:"baseUrl",type:"text",label:c("baseUrl")},{name:"pollTimeoutMs",type:"number",label:c("pollTimeoutMs")},{name:"allowFrom",type:"tags",label:c("allowFrom")},{name:"accounts",type:"json",label:c("accountsJson")}],slack:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"mode",type:"text",label:c("mode")},{name:"webhookPath",type:"text",label:c("webhookPath")},{name:"allowBots",type:"boolean",label:c("allowBotMessages")},{name:"botToken",type:"password",label:c("botToken")},{name:"appToken",type:"password",label:c("appToken")}],email:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"consentGranted",type:"boolean",label:c("consentGranted")},{name:"imapHost",type:"text",label:c("imapHost")},{name:"imapPort",type:"number",label:c("imapPort")},{name:"imapUsername",type:"text",label:c("imapUsername")},{name:"imapPassword",type:"password",label:c("imapPassword")},{name:"fromAddress",type:"email",label:c("fromAddress")}],mochat:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"baseUrl",type:"text",label:c("baseUrl")},{name:"clawToken",type:"password",label:c("clawToken")},{name:"agentUserId",type:"text",label:c("agentUserId")},{name:"allowFrom",type:"tags",label:c("allowFrom")}],qq:[{name:"enabled",type:"boolean",label:c("enabled")},{name:"appId",type:"text",label:c("appId")},{name:"secret",type:"password",label:c("appSecret")},{name:"markdownSupport",type:"boolean",label:c("markdownSupport")},{name:"allowFrom",type:"tags",label:c("allowFrom")}]}}var H={},te,De;function dn(){return De||(De=1,te=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),te}var ne={},F={},Ue;function _(){if(Ue)return F;Ue=1;let e;const s=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return F.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},F.getSymbolTotalCodewords=function(n){return s[n]},F.getBCHDigit=function(a){let n=0;for(;a!==0;)n++,a>>>=1;return n},F.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');e=n},F.isKanjiModeEnabled=function(){return typeof e<"u"},F.toSJIS=function(n){return e(n)},F}var re={},Fe;function je(){return Fe||(Fe=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function s(a){if(typeof a!="string")throw new Error("Param is not a string");switch(a.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+a)}}e.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},e.from=function(n,t){if(e.isValid(n))return n;try{return s(n)}catch{return t}}})(re)),re}var se,qe;function fn(){if(qe)return se;qe=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(s){const a=Math.floor(s/8);return(this.buffer[a]>>>7-s%8&1)===1},put:function(s,a){for(let n=0;n<a;n++)this.putBit((s>>>a-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(s){const a=Math.floor(this.length/8);this.buffer.length<=a&&this.buffer.push(0),s&&(this.buffer[a]|=128>>>this.length%8),this.length++}},se=e,se}var ae,_e;function gn(){if(_e)return ae;_e=1;function e(s){if(!s||s<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=s,this.data=new Uint8Array(s*s),this.reservedBit=new Uint8Array(s*s)}return e.prototype.set=function(s,a,n,t){const r=s*this.size+a;this.data[r]=n,t&&(this.reservedBit[r]=!0)},e.prototype.get=function(s,a){return this.data[s*this.size+a]},e.prototype.xor=function(s,a,n){this.data[s*this.size+a]^=n},e.prototype.isReserved=function(s,a){return this.reservedBit[s*this.size+a]},ae=e,ae}var oe={},ze;function hn(){return ze||(ze=1,(function(e){const s=_().getSymbolSize;e.getRowColCoords=function(n){if(n===1)return[];const t=Math.floor(n/7)+2,r=s(n),i=r===145?26:Math.ceil((r-13)/(2*t-2))*2,o=[r-7];for(let l=1;l<t-1;l++)o[l]=o[l-1]-i;return o.push(6),o.reverse()},e.getPositions=function(n){const t=[],r=e.getRowColCoords(n),i=r.length;for(let o=0;o<i;o++)for(let l=0;l<i;l++)o===0&&l===0||o===0&&l===i-1||o===i-1&&l===0||t.push([r[o],r[l]]);return t}})(oe)),oe}var ie={},Oe;function mn(){if(Oe)return ie;Oe=1;const e=_().getSymbolSize,s=7;return ie.getPositions=function(n){const t=e(n);return[[0,0],[t-s,0],[0,t-s]]},ie}var le={},He;function pn(){return He||(He=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const s={N1:3,N2:3,N3:40,N4:10};e.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(t){const r=t.size;let i=0,o=0,l=0,d=null,h=null;for(let f=0;f<r;f++){o=l=0,d=h=null;for(let x=0;x<r;x++){let g=t.get(f,x);g===d?o++:(o>=5&&(i+=s.N1+(o-5)),d=g,o=1),g=t.get(x,f),g===h?l++:(l>=5&&(i+=s.N1+(l-5)),h=g,l=1)}o>=5&&(i+=s.N1+(o-5)),l>=5&&(i+=s.N1+(l-5))}return i},e.getPenaltyN2=function(t){const r=t.size;let i=0;for(let o=0;o<r-1;o++)for(let l=0;l<r-1;l++){const d=t.get(o,l)+t.get(o,l+1)+t.get(o+1,l)+t.get(o+1,l+1);(d===4||d===0)&&i++}return i*s.N2},e.getPenaltyN3=function(t){const r=t.size;let i=0,o=0,l=0;for(let d=0;d<r;d++){o=l=0;for(let h=0;h<r;h++)o=o<<1&2047|t.get(d,h),h>=10&&(o===1488||o===93)&&i++,l=l<<1&2047|t.get(h,d),h>=10&&(l===1488||l===93)&&i++}return i*s.N3},e.getPenaltyN4=function(t){let r=0;const i=t.data.length;for(let l=0;l<i;l++)r+=t.data[l];return Math.abs(Math.ceil(r*100/i/5)-10)*s.N4};function a(n,t,r){switch(n){case e.Patterns.PATTERN000:return(t+r)%2===0;case e.Patterns.PATTERN001:return t%2===0;case e.Patterns.PATTERN010:return r%3===0;case e.Patterns.PATTERN011:return(t+r)%3===0;case e.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2===0;case e.Patterns.PATTERN101:return t*r%2+t*r%3===0;case e.Patterns.PATTERN110:return(t*r%2+t*r%3)%2===0;case e.Patterns.PATTERN111:return(t*r%3+(t+r)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}e.applyMask=function(t,r){const i=r.size;for(let o=0;o<i;o++)for(let l=0;l<i;l++)r.isReserved(l,o)||r.xor(l,o,a(t,l,o))},e.getBestMask=function(t,r){const i=Object.keys(e.Patterns).length;let o=0,l=1/0;for(let d=0;d<i;d++){r(d),e.applyMask(d,t);const h=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(d,t),h<l&&(l=h,o=d)}return o}})(le)),le}var Y={},Ke;function xt(){if(Ke)return Y;Ke=1;const e=je(),s=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],a=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Y.getBlocksCount=function(t,r){switch(r){case e.L:return s[(t-1)*4+0];case e.M:return s[(t-1)*4+1];case e.Q:return s[(t-1)*4+2];case e.H:return s[(t-1)*4+3];default:return}},Y.getTotalCodewordsCount=function(t,r){switch(r){case e.L:return a[(t-1)*4+0];case e.M:return a[(t-1)*4+1];case e.Q:return a[(t-1)*4+2];case e.H:return a[(t-1)*4+3];default:return}},Y}var ce={},J={},Ve;function yn(){if(Ve)return J;Ve=1;const e=new Uint8Array(512),s=new Uint8Array(256);return(function(){let n=1;for(let t=0;t<255;t++)e[t]=n,s[n]=t,n<<=1,n&256&&(n^=285);for(let t=255;t<512;t++)e[t]=e[t-255]})(),J.log=function(n){if(n<1)throw new Error("log("+n+")");return s[n]},J.exp=function(n){return e[n]},J.mul=function(n,t){return n===0||t===0?0:e[s[n]+s[t]]},J}var Je;function bn(){return Je||(Je=1,(function(e){const s=yn();e.mul=function(n,t){const r=new Uint8Array(n.length+t.length-1);for(let i=0;i<n.length;i++)for(let o=0;o<t.length;o++)r[i+o]^=s.mul(n[i],t[o]);return r},e.mod=function(n,t){let r=new Uint8Array(n);for(;r.length-t.length>=0;){const i=r[0];for(let l=0;l<t.length;l++)r[l]^=s.mul(t[l],i);let o=0;for(;o<r.length&&r[o]===0;)o++;r=r.slice(o)}return r},e.generateECPolynomial=function(n){let t=new Uint8Array([1]);for(let r=0;r<n;r++)t=e.mul(t,new Uint8Array([1,s.exp(r)]));return t}})(ce)),ce}var ue,Ge;function wn(){if(Ge)return ue;Ge=1;const e=bn();function s(a){this.genPoly=void 0,this.degree=a,this.degree&&this.initialize(this.degree)}return s.prototype.initialize=function(n){this.degree=n,this.genPoly=e.generateECPolynomial(this.degree)},s.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(n.length+this.degree);t.set(n);const r=e.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){const o=new Uint8Array(this.degree);return o.set(r,i),o}return r},ue=s,ue}var de={},fe={},ge={},Ye;function Ct(){return Ye||(Ye=1,ge.isValid=function(s){return!isNaN(s)&&s>=1&&s<=40}),ge}var k={},Qe;function At(){if(Qe)return k;Qe=1;const e="[0-9]+",s="[A-Z $%*+\\-./:]+";let a="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";a=a.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+a+`)(?:.|[\r
|
|
2
2
|
]))+`;k.KANJI=new RegExp(a,"g"),k.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),k.BYTE=new RegExp(n,"g"),k.NUMERIC=new RegExp(e,"g"),k.ALPHANUMERIC=new RegExp(s,"g");const t=new RegExp("^"+a+"$"),r=new RegExp("^"+e+"$"),i=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return k.testKanji=function(l){return t.test(l)},k.testNumeric=function(l){return r.test(l)},k.testAlphanumeric=function(l){return i.test(l)},k}var We;function z(){return We||(We=1,(function(e){const s=Ct(),a=At();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(r,i){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!s.isValid(i))throw new Error("Invalid version: "+i);return i>=1&&i<10?r.ccBits[0]:i<27?r.ccBits[1]:r.ccBits[2]},e.getBestModeForData=function(r){return a.testNumeric(r)?e.NUMERIC:a.testAlphanumeric(r)?e.ALPHANUMERIC:a.testKanji(r)?e.KANJI:e.BYTE},e.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},e.isValid=function(r){return r&&r.bit&&r.ccBits};function n(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+t)}}e.from=function(r,i){if(e.isValid(r))return r;try{return n(r)}catch{return i}}})(fe)),fe}var Ze;function xn(){return Ze||(Ze=1,(function(e){const s=_(),a=xt(),n=je(),t=z(),r=Ct(),i=7973,o=s.getBCHDigit(i);function l(x,g,y){for(let A=1;A<=40;A++)if(g<=e.getCapacity(A,y,x))return A}function d(x,g){return t.getCharCountIndicator(x,g)+4}function h(x,g){let y=0;return x.forEach(function(A){const T=d(A.mode,g);y+=T+A.getBitsLength()}),y}function f(x,g){for(let y=1;y<=40;y++)if(h(x,y)<=e.getCapacity(y,g,t.MIXED))return y}e.from=function(g,y){return r.isValid(g)?parseInt(g,10):y},e.getCapacity=function(g,y,A){if(!r.isValid(g))throw new Error("Invalid QR Code version");typeof A>"u"&&(A=t.BYTE);const T=s.getSymbolTotalCodewords(g),E=a.getTotalCodewordsCount(g,y),P=(T-E)*8;if(A===t.MIXED)return P;const b=P-d(A,g);switch(A){case t.NUMERIC:return Math.floor(b/10*3);case t.ALPHANUMERIC:return Math.floor(b/11*2);case t.KANJI:return Math.floor(b/13);case t.BYTE:default:return Math.floor(b/8)}},e.getBestVersionForData=function(g,y){let A;const T=n.from(y,n.M);if(Array.isArray(g)){if(g.length>1)return f(g,T);if(g.length===0)return 1;A=g[0]}else A=g;return l(A.mode,A.getLength(),T)},e.getEncodedBits=function(g){if(!r.isValid(g)||g<7)throw new Error("Invalid QR Code version");let y=g<<12;for(;s.getBCHDigit(y)-o>=0;)y^=i<<s.getBCHDigit(y)-o;return g<<12|y}})(de)),de}var he={},Xe;function Cn(){if(Xe)return he;Xe=1;const e=_(),s=1335,a=21522,n=e.getBCHDigit(s);return he.getEncodedBits=function(r,i){const o=r.bit<<3|i;let l=o<<10;for(;e.getBCHDigit(l)-n>=0;)l^=s<<e.getBCHDigit(l)-n;return(o<<10|l)^a},he}var me={},pe,$e;function An(){if($e)return pe;$e=1;const e=z();function s(a){this.mode=e.NUMERIC,this.data=a.toString()}return s.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(n){let t,r,i;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),i=parseInt(r,10),n.put(i,10);const o=this.data.length-t;o>0&&(r=this.data.substr(t),i=parseInt(r,10),n.put(i,o*3+1))},pe=s,pe}var ye,et;function vn(){if(et)return ye;et=1;const e=z(),s=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function a(n){this.mode=e.ALPHANUMERIC,this.data=n}return a.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(t){let r;for(r=0;r+2<=this.data.length;r+=2){let i=s.indexOf(this.data[r])*45;i+=s.indexOf(this.data[r+1]),t.put(i,11)}this.data.length%2&&t.put(s.indexOf(this.data[r]),6)},ye=a,ye}var be,tt;function Nn(){if(tt)return be;tt=1;const e=z();function s(a){this.mode=e.BYTE,typeof a=="string"?this.data=new TextEncoder().encode(a):this.data=new Uint8Array(a)}return s.getBitsLength=function(n){return n*8},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(a){for(let n=0,t=this.data.length;n<t;n++)a.put(this.data[n],8)},be=s,be}var we,nt;function En(){if(nt)return we;nt=1;const e=z(),s=_();function a(n){this.mode=e.KANJI,this.data=n}return a.getBitsLength=function(t){return t*13},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(n){let t;for(t=0;t<this.data.length;t++){let r=s.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
|
|
3
3
|
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),n.put(r,13)}},we=a,we}var xe={exports:{}},rt;function jn(){return rt||(rt=1,(function(e){var s={single_source_shortest_paths:function(a,n,t){var r={},i={};i[n]=0;var o=s.PriorityQueue.make();o.push(n,0);for(var l,d,h,f,x,g,y,A,T;!o.empty();){l=o.pop(),d=l.value,f=l.cost,x=a[d]||{};for(h in x)x.hasOwnProperty(h)&&(g=x[h],y=f+g,A=i[h],T=typeof i[h]>"u",(T||A>y)&&(i[h]=y,o.push(h,y),r[h]=d))}if(typeof t<"u"&&typeof i[t]>"u"){var E=["Could not find a path from ",n," to ",t,"."].join("");throw new Error(E)}return r},extract_shortest_path_from_predecessor_list:function(a,n){for(var t=[],r=n;r;)t.push(r),a[r],r=a[r];return t.reverse(),t},find_path:function(a,n,t){var r=s.single_source_shortest_paths(a,n,t);return s.extract_shortest_path_from_predecessor_list(r,t)},PriorityQueue:{make:function(a){var n=s.PriorityQueue,t={},r;a=a||{};for(r in n)n.hasOwnProperty(r)&&(t[r]=n[r]);return t.queue=[],t.sorter=a.sorter||n.default_sorter,t},default_sorter:function(a,n){return a.cost-n.cost},push:function(a,n){var t={value:a,cost:n};this.queue.push(t),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=s})(xe)),xe.exports}var st;function Sn(){return st||(st=1,(function(e){const s=z(),a=An(),n=vn(),t=Nn(),r=En(),i=At(),o=_(),l=jn();function d(E){return unescape(encodeURIComponent(E)).length}function h(E,P,b){const N=[];let M;for(;(M=E.exec(b))!==null;)N.push({data:M[0],index:M.index,mode:P,length:M[0].length});return N}function f(E){const P=h(i.NUMERIC,s.NUMERIC,E),b=h(i.ALPHANUMERIC,s.ALPHANUMERIC,E);let N,M;return o.isKanjiModeEnabled()?(N=h(i.BYTE,s.BYTE,E),M=h(i.KANJI,s.KANJI,E)):(N=h(i.BYTE_KANJI,s.BYTE,E),M=[]),P.concat(b,N,M).sort(function(S,I){return S.index-I.index}).map(function(S){return{data:S.data,mode:S.mode,length:S.length}})}function x(E,P){switch(P){case s.NUMERIC:return a.getBitsLength(E);case s.ALPHANUMERIC:return n.getBitsLength(E);case s.KANJI:return r.getBitsLength(E);case s.BYTE:return t.getBitsLength(E)}}function g(E){return E.reduce(function(P,b){const N=P.length-1>=0?P[P.length-1]:null;return N&&N.mode===b.mode?(P[P.length-1].data+=b.data,P):(P.push(b),P)},[])}function y(E){const P=[];for(let b=0;b<E.length;b++){const N=E[b];switch(N.mode){case s.NUMERIC:P.push([N,{data:N.data,mode:s.ALPHANUMERIC,length:N.length},{data:N.data,mode:s.BYTE,length:N.length}]);break;case s.ALPHANUMERIC:P.push([N,{data:N.data,mode:s.BYTE,length:N.length}]);break;case s.KANJI:P.push([N,{data:N.data,mode:s.BYTE,length:d(N.data)}]);break;case s.BYTE:P.push([{data:N.data,mode:s.BYTE,length:d(N.data)}])}}return P}function A(E,P){const b={},N={start:{}};let M=["start"];for(let w=0;w<E.length;w++){const S=E[w],I=[];for(let v=0;v<S.length;v++){const B=S[v],j=""+w+v;I.push(j),b[j]={node:B,lastCount:0},N[j]={};for(let m=0;m<M.length;m++){const p=M[m];b[p]&&b[p].node.mode===B.mode?(N[p][j]=x(b[p].lastCount+B.length,B.mode)-x(b[p].lastCount,B.mode),b[p].lastCount+=B.length):(b[p]&&(b[p].lastCount=B.length),N[p][j]=x(B.length,B.mode)+4+s.getCharCountIndicator(B.mode,P))}}M=I}for(let w=0;w<M.length;w++)N[M[w]].end=0;return{map:N,table:b}}function T(E,P){let b;const N=s.getBestModeForData(E);if(b=s.from(P,N),b!==s.BYTE&&b.bit<N.bit)throw new Error('"'+E+'" cannot be encoded with mode '+s.toString(b)+`.
|
|
4
4
|
Suggested mode is: `+s.toString(N));switch(b===s.KANJI&&!o.isKanjiModeEnabled()&&(b=s.BYTE),b){case s.NUMERIC:return new a(E);case s.ALPHANUMERIC:return new n(E);case s.KANJI:return new r(E);case s.BYTE:return new t(E)}}e.fromArray=function(P){return P.reduce(function(b,N){return typeof N=="string"?b.push(T(N,null)):N.data&&b.push(T(N.data,N.mode)),b},[])},e.fromString=function(P,b){const N=f(P,o.isKanjiModeEnabled()),M=y(N),w=A(M,b),S=l.find_path(w.map,"start","end"),I=[];for(let v=1;v<S.length-1;v++)I.push(w.table[S[v]].node);return e.fromArray(g(I))},e.rawSplit=function(P){return e.fromArray(f(P,o.isKanjiModeEnabled()))}})(me)),me}var at;function In(){if(at)return ne;at=1;const e=_(),s=je(),a=fn(),n=gn(),t=hn(),r=mn(),i=pn(),o=xt(),l=wn(),d=xn(),h=Cn(),f=z(),x=Sn();function g(w,S){const I=w.size,v=r.getPositions(S);for(let B=0;B<v.length;B++){const j=v[B][0],m=v[B][1];for(let p=-1;p<=7;p++)if(!(j+p<=-1||I<=j+p))for(let C=-1;C<=7;C++)m+C<=-1||I<=m+C||(p>=0&&p<=6&&(C===0||C===6)||C>=0&&C<=6&&(p===0||p===6)||p>=2&&p<=4&&C>=2&&C<=4?w.set(j+p,m+C,!0,!0):w.set(j+p,m+C,!1,!0))}}function y(w){const S=w.size;for(let I=8;I<S-8;I++){const v=I%2===0;w.set(I,6,v,!0),w.set(6,I,v,!0)}}function A(w,S){const I=t.getPositions(S);for(let v=0;v<I.length;v++){const B=I[v][0],j=I[v][1];for(let m=-2;m<=2;m++)for(let p=-2;p<=2;p++)m===-2||m===2||p===-2||p===2||m===0&&p===0?w.set(B+m,j+p,!0,!0):w.set(B+m,j+p,!1,!0)}}function T(w,S){const I=w.size,v=d.getEncodedBits(S);let B,j,m;for(let p=0;p<18;p++)B=Math.floor(p/3),j=p%3+I-8-3,m=(v>>p&1)===1,w.set(B,j,m,!0),w.set(j,B,m,!0)}function E(w,S,I){const v=w.size,B=h.getEncodedBits(S,I);let j,m;for(j=0;j<15;j++)m=(B>>j&1)===1,j<6?w.set(j,8,m,!0):j<8?w.set(j+1,8,m,!0):w.set(v-15+j,8,m,!0),j<8?w.set(8,v-j-1,m,!0):j<9?w.set(8,15-j-1+1,m,!0):w.set(8,15-j-1,m,!0);w.set(v-8,8,1,!0)}function P(w,S){const I=w.size;let v=-1,B=I-1,j=7,m=0;for(let p=I-1;p>0;p-=2)for(p===6&&p--;;){for(let C=0;C<2;C++)if(!w.isReserved(B,p-C)){let R=!1;m<S.length&&(R=(S[m]>>>j&1)===1),w.set(B,p-C,R),j--,j===-1&&(m++,j=7)}if(B+=v,B<0||I<=B){B-=v,v=-v;break}}}function b(w,S,I){const v=new a;I.forEach(function(C){v.put(C.mode.bit,4),v.put(C.getLength(),f.getCharCountIndicator(C.mode,w)),C.write(v)});const B=e.getSymbolTotalCodewords(w),j=o.getTotalCodewordsCount(w,S),m=(B-j)*8;for(v.getLengthInBits()+4<=m&&v.put(0,4);v.getLengthInBits()%8!==0;)v.putBit(0);const p=(m-v.getLengthInBits())/8;for(let C=0;C<p;C++)v.put(C%2?17:236,8);return N(v,w,S)}function N(w,S,I){const v=e.getSymbolTotalCodewords(S),B=o.getTotalCodewordsCount(S,I),j=v-B,m=o.getBlocksCount(S,I),p=v%m,C=m-p,R=Math.floor(v/m),V=Math.floor(j/m),Et=V+1,Se=R-V,jt=new l(Se);let Z=0;const G=new Array(m),Ie=new Array(m);let X=0;const St=new Uint8Array(w.buffer);for(let O=0;O<m;O++){const ee=O<C?V:Et;G[O]=St.slice(Z,Z+ee),Ie[O]=jt.encode(G[O]),Z+=ee,X=Math.max(X,ee)}const $=new Uint8Array(v);let Be=0,D,U;for(D=0;D<X;D++)for(U=0;U<m;U++)D<G[U].length&&($[Be++]=G[U][D]);for(D=0;D<Se;D++)for(U=0;U<m;U++)$[Be++]=Ie[U][D];return $}function M(w,S,I,v){let B;if(Array.isArray(w))B=x.fromArray(w);else if(typeof w=="string"){let R=S;if(!R){const V=x.rawSplit(w);R=d.getBestVersionForData(V,I)}B=x.fromString(w,R||40)}else throw new Error("Invalid data");const j=d.getBestVersionForData(B,I);if(!j)throw new Error("The amount of data is too big to be stored in a QR Code");if(!S)S=j;else if(S<j)throw new Error(`
|