dsh-blackjack 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +12 -12
- package/dist/i18n/en.d.ts +2 -0
- package/dist/i18n/en.js +2 -0
- package/dist/i18n/messages.d.ts +17 -0
- package/dist/i18n/zh.d.ts +2 -0
- package/dist/i18n/zh.js +2 -0
- package/dist/router.d.ts +15 -0
- package/dist/router.js +23 -1
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -3,7 +3,7 @@ window.__ModuleLoader__.load({
|
|
|
3
3
|
factory: (require) => {
|
|
4
4
|
var module = { exports: {} };
|
|
5
5
|
var exports = module.exports;
|
|
6
|
-
"use strict";var v=Object.defineProperty;var
|
|
6
|
+
"use strict";var v=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var Y=(e,t)=>{for(var n in t)v(e,n,{get:t[n],enumerable:!0})},X=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of J(t))!U.call(e,o)&&o!==n&&v(e,o,{get:()=>t[o],enumerable:!(i=G(t,o))||i.enumerable});return e};var W=e=>X(v({},"__esModule",{value:!0}),e);var pe={};Y(pe,{apply:()=>ge,inject:()=>de,resolveLocaleId:()=>A,subscribeToLocale:()=>R,useLocaleId:()=>M});module.exports=W(pe);var u=require("react");var H=require("react");function j(e,t){return e.mode==="free"?t.freeStakeLine(e.betChips):t.raiseStakeLine(e.betChips)}function P(e,t){let n=e.payoutChips??0,i=e.betChips;return e.hands.length>0&&e.hands.every(o=>o.outcome==="push")?e.mode==="free"?t.freePush():t.raisePush(i):n>0?e.mode==="free"?t.freeWin(n):t.raiseWin(n,i):e.mode==="free"?t.freeLose():t.raiseLose(i)}var a=require("react/jsx-runtime"),z={S:"\u2660",H:"\u2665",D:"\u2666",C:"\u2663"},O=new Set(["H","D"]),S=e=>e.toLocaleString("en-US"),Q=`
|
|
7
7
|
.bj-table { --bj-felt: #0f3d2e; --bj-line: rgba(255,255,255,.18); font-size: 14px; }
|
|
8
8
|
.bj-hand { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 4px 0; }
|
|
9
9
|
.bj-card {
|
|
@@ -38,17 +38,17 @@ window.__ModuleLoader__.load({
|
|
|
38
38
|
color: #c0392b; border: 1px solid rgba(192,57,43,.4); border-radius: 6px;
|
|
39
39
|
padding: 4px 8px; margin-bottom: 8px;
|
|
40
40
|
}
|
|
41
|
-
`;function L({text:e}){let
|
|
42
|
-
`),agreeHint:()=>"\u8BF7\u5148\u9605\u8BFB\u987B\u77E5\u5E76\u6267\u884C /blackjack agree \u540E\u518D\u4F7F\u7528\u3002",noRoundHint:()=>"\u5F53\u524D\u6CA1\u6709\u8FDB\u884C\u4E2D\u7684\u724C\u5C40\uFF0C\u5148\u7528 /blackjack deal \u5F00\u4E00\u5C40\u3002",commandUsage:()=>"agree | deal [\u6CE8\u989D] | exchange [\u6570\u91CF] | reset",actionDescriptions:{hit:"21 \u70B9\uFF1A\u5411\u724C\u684C\u8981\u4E00\u5F20\u724C",stand:"21 \u70B9\uFF1A\u505C\u724C\uFF0C\u8FDB\u5165\u7ED3\u7B97",double:"21 \u70B9\uFF1A\u52A0\u500D\u6CE8\u989D\u5E76\u518D\u8981\u4E00\u5F20\u724C",split:"21 \u70B9\uFF1A\u628A\u4E00\u5BF9\u76F8\u540C\u70B9\u6570\u7684\u724C\u5206\u6210\u4E24\u624B",insure:"21 \u70B9\uFF1A\u5E84\u5BB6\u660E\u724C\u4E3A A \u65F6\u8D2D\u4E70\u4FDD\u9669",decline:"21 \u70B9\uFF1A\u4E0D\u8D2D\u4E70\u4FDD\u9669"},blackjackCommandDescription:()=>"21 \u70B9\u724C\u684C\uFF08\u9700\u5148\u8FDB\u5165\u4F1A\u8BDD\uFF09\uFF1A\u67E5\u770B\u72B6\u6001\u3001\u5F00\u5C40\u3001\u5151\u6362\u989D\u5EA6\u3001\u91CD\u7F6E\u51ED\u8BC1",genericFailure:()=>"\u64CD\u4F5C\u6CA1\u6709\u6210\u529F\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",serviceUnreachable:()=>"\u6682\u65F6\u8FDE\u4E0D\u4E0A\u724C\u684C\u670D\u52A1\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",dailyFreeHandsExhausted:()=>"\u4ECA\u5929\u7684\u514D\u8D39\u624B\u7528\u5B8C\u4E86\uFF0C\u660E\u5929\u518D\u6765\u3002",belowExchangeThreshold:e=>`\u4F59\u989D\u8FD8\u6CA1\u5230\u5151\u6362\u95E8\u69DB\uFF08\u9700\u8981 ${s(e)} CHIP\uFF09\u3002`,insufficientBalance:()=>"\u4F59\u989D\u4E0D\u8DB3\u4EE5\u5B8C\u6210\u8FD9\u4E2A\u52A8\u4F5C\u3002",roundAlreadyInProgress:()=>"\u5DF2\u7ECF\u6709\u4E00\u5C40\u5728\u8FDB\u884C\u4E2D\u3002",githubBindingRequired:()=>"\u8FD9\u4E2A\u94B1\u5305\u7684 GitHub \u7ED1\u5B9A\u72B6\u6001\u6709\u95EE\u9898\uFF0C\u6682\u65F6\u65E0\u6CD5\u76F4\u63A5\u5151\u6362\u3002\u8BF7\u7A0D\u540E\u518D\u8BD5\uFF1B\u5982\u679C\u4E00\u76F4\u8FD9\u6837\uFF0C\u8BF7\u8054\u7CFB\u8FD0\u8425\u8005\u5904\u7406\u3002",seasonCapReached:(e,
|
|
43
|
-
`),invalidBetAmount:()=>"\u6CE8\u989D\u5FC5\u987B\u662F\u6B63\u6574\u6570\u3002",pairingInstructions:(e,
|
|
44
|
-
`),exchangeAmountPrompt:(e,n
|
|
45
|
-
`),invalidExchangeAmount:()=>"\u5151\u6362\u6570\u91CF\u5FC5\u987B\u662F\u6B63\u6574\u6570\u3002",exchangeSuccess:(e,
|
|
46
|
-
`),exchangedQuotaNote:(e,
|
|
47
|
-
`),agreeHint:()=>"Please read the notice and run /blackjack agree before using this.",noRoundHint:()=>"No hand is in progress right now \u2014 run /blackjack deal to start one.",commandUsage:()=>"agree | deal [amount] | exchange [amount] | reset",actionDescriptions:{hit:"Blackjack: draw one card from the shoe",stand:"Blackjack: stand, ending your turn and moving to settlement",double:"Blackjack: double down \u2014 double your committed CHIP and draw exactly one more card",split:"Blackjack: split a pair of equal-rank cards into two hands",insure:"Blackjack: buy insurance when the dealer shows an Ace",decline:"Blackjack: decline insurance"},blackjackCommandDescription:()=>"Blackjack table (needs an open conversation): status, deal, exchange quota, reset",genericFailure:()=>"That didn't go through \u2014 please try again in a moment.",serviceUnreachable:()=>"Can't reach the table service right now \u2014 please try again shortly.",dailyFreeHandsExhausted:()=>"You're out of free hands for today \u2014 come back tomorrow.",belowExchangeThreshold:e=>`Your balance hasn't reached the exchange threshold yet (needs ${r(e)} CHIP).`,insufficientBalance:()=>"Your balance isn't enough to complete this action.",roundAlreadyInProgress:()=>"A hand is already in progress.",githubBindingRequired:()=>"This wallet's GitHub link looks inconsistent, so a direct exchange isn't possible right now. Please try again later; if it keeps happening, contact the operator.",seasonCapReached:(e,
|
|
48
|
-
`),invalidBetAmount:()=>"The amount must be a positive integer.",pairingInstructions:(e,
|
|
49
|
-
`),exchangeAmountPrompt:(e,n
|
|
50
|
-
`),invalidExchangeAmount:()=>"The exchange amount must be a positive integer.",exchangeSuccess:(e,
|
|
51
|
-
`),exchangedQuotaNote:(e,
|
|
41
|
+
`;function L({text:e}){let t=e.split(/(https?:\/\/[^\s,。))]+)/g);return(0,a.jsx)(a.Fragment,{children:t.map((n,i)=>/^https?:\/\//.test(n)?(0,a.jsx)("a",{href:n,target:"_blank",rel:"noreferrer noopener",children:n},i):n)})}function I({card:e,m:t}){if("hidden"in e)return(0,a.jsx)("div",{className:"bj-card bj-card-back","aria-label":t.hiddenCardLabel()});let n=z[e.suit]??e.suit,i=O.has(e.suit)?"bj-card-red":"bj-card-black";return(0,a.jsx)("div",{className:`bj-card ${i}`,children:`${e.rank}${n}`})}function _({hand:e,label:t,m:n}){return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"bj-meta",children:[t,n.totalInParens(e.total,e.soft),e.doubled?n.doubled():""]}),(0,a.jsx)("div",{className:"bj-hand",children:e.cards.map((i,o)=>(0,a.jsx)(I,{card:i,m:n},o))})]})}function K({dealer:e,m:t}){return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"bj-meta",children:[t.tableDealerLabel(),e.total!==void 0?t.totalInParens(e.total,!1):""]}),(0,a.jsx)("div",{className:"bj-hand",children:e.cards.map((n,i)=>(0,a.jsx)(I,{card:n,m:t},i))})]})}function Z({m:e}){return(0,a.jsx)("div",{className:"bj-table",children:(0,a.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:e.consentText()})})}function ee({me:e,m:t}){let n=e.exchangeThresholdChips-e.chips;return(0,a.jsxs)("div",{className:"bj-meta",children:[t.tableBalanceHeader(e.chips,e.freeHandsRemaining),e.points>0?t.tablePointsSuffix(e.points):"",e.exchangedChips>0?t.tableExchangedSuffix(e.exchangedChips):"",(0,a.jsx)("div",{className:"bj-note",children:n<=0?t.tableExchangeThresholdReached(e.exchangeThresholdChips):t.tableExchangeThresholdShort(n,e.exchangeThresholdChips)}),e.exchangedChips>0?(0,a.jsx)("div",{className:"bj-note",children:t.tableExchangedQuotaNote(e.exchangedChips)}):null,e.poolEmpty?(0,a.jsx)("div",{children:t.tablePoolEmptyNotice()}):null,e.sponsorText?(0,a.jsx)("div",{children:e.sponsorText}):null]})}function te({round:e,m:t}){return(0,a.jsxs)("div",{className:"bj-meta",children:[e.phase==="settled"?P(e,t):j(e,t),e.pointsGranted?(0,a.jsx)("div",{children:t.pointsGrantedNotice(e.pointsGranted)}):null]})}function ne(e,t){return e==="double"||e==="split"?t:e==="insure"?Math.ceil(t/2):0}function ae({round:e,me:t,onAction:n,m:i}){if(e.actions.length===0)return null;let o=t?.chips??0,d=i.tableActionLabels;return(0,a.jsx)("div",{className:"bj-actions",children:e.actions.map(l=>{let c=ne(l,e.betChips),h=c>o;return(0,a.jsxs)("button",{type:"button",disabled:h,title:h?i.actionShortfallHint(c):void 0,onClick:()=>n(l),children:[d[l]??l,c>0?i.tableCostSuffix(c):""]},l)})})}function ie(e,t,n){return!Number.isInteger(e)||e<1?n.invalidBetAmount():e>t.maxChips?n.betAmountExceedsCap(t.maxChips):e>t.balanceChips?n.betAmountExceedsBalance():null}function oe({me:e,onDeal:t,freeLabel:n,m:i}){let o=e?.freeHandsRemaining??0,d=e?[e.baseBetChips,e.baseBetChips*2]:[];return(0,a.jsxs)("div",{className:"bj-actions",children:[(0,a.jsxs)("button",{type:"button",disabled:o<=0,onClick:()=>t(),children:[n,e?i.dealButtonFreeHandsSuffix(o):""]}),d.map(l=>(0,a.jsxs)("button",{type:"button",disabled:(e?.chips??0)<l,onClick:()=>t(l),children:[S(l)," CHIP"]},l))]})}function se({me:e,onDeal:t,m:n}){let i=e.maxRaiseBetChips,[o,d]=(0,H.useState)(!1),[l,c]=(0,H.useState)("");if(i===void 0)return null;let h=Number(l),g=l.trim()===""?n.betAmountMissing():ie(h,{balanceChips:e.chips,maxChips:i},n);return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"bj-actions",children:(0,a.jsx)("button",{type:"button",onClick:()=>d(!o),children:n.customBetToggle()})}),o?(0,a.jsxs)("div",{className:"bj-custom",children:[(0,a.jsx)("input",{type:"number",min:1,max:i,value:l,onChange:x=>c(x.target.value),"aria-label":n.customBetToggle()}),(0,a.jsx)("button",{type:"button",disabled:g!==null,onClick:()=>t(h),children:n.customBetSubmit()}),(0,a.jsx)("span",{className:"bj-hint",children:g??n.customBetRange(i)})]}):null]})}function re({me:e,onDeal:t,m:n}){let i=e?.freeHandsRemaining??0,o=e?.baseBetChips??0,d=e?[o,o*2]:[],l=e?d.some(c=>e.chips>=c):!1;return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"bj-meta",children:n.noActiveRoundNotice()}),(0,a.jsxs)("div",{className:"bj-group",children:[(0,a.jsxs)("div",{className:"bj-group-title",children:[n.freeHandsGroupTitle(),i>0?n.freeHandsRemainingToday(i):n.freeHandsExhaustedToday()]}),e?(0,a.jsx)("div",{className:"bj-note",children:n.freeHandExplainer(o,Math.floor(o*1.5))}):null,(0,a.jsx)("div",{className:"bj-actions",children:(0,a.jsx)("button",{type:"button",disabled:i<=0,onClick:()=>t(),children:n.startFreeHandButton()})})]}),e?(0,a.jsxs)("div",{className:"bj-group",children:[(0,a.jsxs)("div",{className:"bj-group-title",children:[n.raiseGroupTitle(),l?"":n.insufficientBalanceSuffix()]}),(0,a.jsx)("div",{className:"bj-note",children:n.raiseExplainer()}),(0,a.jsx)("div",{className:"bj-actions",children:d.map(c=>(0,a.jsxs)("button",{type:"button",disabled:e.chips<c,onClick:()=>t(c),children:[S(c)," CHIP"]},c))}),(0,a.jsx)(se,{me:e,onDeal:t,m:n})]}):null]})}function le({me:e,onDeal:t,onDismiss:n,m:i}){return(0,a.jsxs)("div",{children:[(0,a.jsx)(oe,{me:e,onDeal:t,freeLabel:i.rematchFreeLabel(),m:i}),(0,a.jsx)("div",{className:"bj-actions",children:(0,a.jsx)("button",{type:"button",onClick:n,children:i.dismissButton()})})]})}function $({state:e,m:t,onAction:n,onDeal:i,onDismiss:o,error:d}){if(!e.consented)return(0,a.jsx)(Z,{m:t});let{me:l,round:c}=e;return(0,a.jsxs)("div",{className:"bj-table",children:[(0,a.jsx)("style",{children:Q}),d?(0,a.jsx)("div",{className:"bj-error",children:d}):null,l?(0,a.jsx)(ee,{me:l,m:t}):null,c?(0,a.jsxs)("div",{children:[c.hands.map((h,g)=>(0,a.jsx)(_,{hand:h,m:t,label:c.hands.length>1?t.tableSplitHandLabel(g+1):t.tableHandLabel()},g)),(0,a.jsx)(K,{dealer:c.dealer,m:t}),(0,a.jsx)(te,{round:c,m:t}),(0,a.jsx)(ae,{round:c,me:l,onAction:n,m:t}),c.phase==="settled"?(0,a.jsx)(le,{me:l,onDeal:i,onDismiss:o,m:t}):null]}):(0,a.jsx)(re,{me:l,onDeal:i,m:t})]})}function f(e,t){switch(t.type){case"synced":return{consented:t.payload.consented,me:t.payload.me,round:t.payload.round};case"round":return{...e,round:t.round};case"meRefreshed":return{...e,me:t.me};case"dismissed":return{...e,round:void 0}}}var ce=new Set(["","deal"]);function T(e){let t=(e.args??"").trim().split(/\s+/)[0]??"",n=ce.has(t),i=e.outcome,o=i?.kind==="error";return n?{table:!0,isError:o,...o&&i?.text?{text:i.text}:{}}:{table:!1,isError:o,...i?.text!==void 0?{text:i.text}:{}}}var s=e=>e.toLocaleString("en-US"),E={freeStakeLine:e=>`\u8FD9\u662F\u514D\u8D39\u7684\u4E00\u5C40\uFF1A\u8D62\u4E86\u62FF ${s(e)} CHIP\uFF0C\u8F93\u4E86\u4E0D\u635F\u5931\u4EFB\u4F55\u4E1C\u897F\u3002`,raiseStakeLine:e=>`\u672C\u5C40\u5DF2\u52A0\u6CE8 ${s(e)} CHIP\uFF0C\u4ECE\u4F60\u7684\u4F59\u989D\u91CC\u51FA\u3002`,freeWin:e=>`\u8D62\u4E86\uFF0C\u62FF\u5230 ${s(e)} CHIP\u3002`,freeLose:()=>"\u8FD9\u624B\u8F93\u4E86\u3002\u514D\u8D39\u624B\u4E0D\u635F\u5931\u4EFB\u4F55\u4E1C\u897F\u3002",freePush:()=>"\u5E73\u5C40\u3002\u8FD9\u624B\u4E0D\u635F\u5931\u4E5F\u4E0D\u83B7\u5F97\u3002",raiseWin:(e,t)=>`\u8D62\u4E86\uFF0C\u62FF\u56DE ${s(e)} CHIP\uFF08\u52A0\u6CE8 ${s(t)}\uFF09\u3002`,raiseLose:e=>`\u8FD9\u624B\u8F93\u4E86\uFF0C\u52A0\u6CE8\u7684 ${s(e)} CHIP \u6536\u4E0D\u56DE\u3002`,raisePush:e=>`\u5E73\u5C40\u3002\u52A0\u6CE8\u7684 ${s(e)} CHIP \u539F\u6837\u9000\u56DE\u3002`,handLabel:()=>"\u4F60\u7684\u724C\uFF1A",splitHandLabel:e=>`\u4F60\u7684\u7B2C ${e} \u624B\uFF1A`,dealerLabel:()=>"\u5E84\u5BB6\uFF1A",totalInParens:(e,t)=>`\uFF08${t?"\u8F6F":""}${e}\uFF09`,doubled:()=>" [\u53CC\u500D]",actionsPrefix:()=>"\u53EF\u9009\uFF1A",actionLabels:{hit:"/bj-hit \u8981\u724C",stand:"/bj-stand \u505C\u724C",double:"/bj-double \u53CC\u500D",split:"/bj-split \u5206\u724C",insure:"/bj-insure \u4E70\u4FDD\u9669",decline:"/bj-decline \u4E0D\u4E70\u4FDD\u9669"},actionsSeparator:()=>"\u3000",balanceLine:(e,t)=>`\u4F59\u989D\uFF1A${s(e)} CHIP\u3000\u5DF2\u5151\u6362\u989D\u5EA6\uFF1A${s(t)} CHIP`,freeHandsLine:(e,t)=>`\u4ECA\u65E5\u5269\u4F59\u514D\u8D39\u624B\uFF1A${e}\u3000\u8D5B\u5B63\uFF1A${t}`,thresholdLine:e=>`\u5151\u6362\u95E8\u69DB\uFF1A${s(e)} CHIP\uFF08\u8FBE\u6807\u540E\u53EF\u7528 /blackjack exchange \u5151\u6362\uFF09`,pointsLine:e=>`\u79EF\u5206\uFF1A${s(e)}`,poolEmptyNotice:()=>"\u63D0\u793A\uFF1A\u672C\u671F\u5956\u6C60\u5DF2\u53D1\u5B8C\uFF0C\u73B0\u5728\u8D62\u724C\u5C06\u53D1\u653E\u79EF\u5206\u3002",pointsGrantedNotice:e=>`\u672C\u671F\u5956\u6C60\u5DF2\u53D1\u5B8C\uFF0C\u6539\u4E3A\u53D1\u653E ${s(e)} \u79EF\u5206\u3002`,chipValidityNotice:()=>"\uFF08\u8D5B\u5B63\u7ED3\u675F\u65F6\uFF0C\u672A\u8FBE\u5151\u6362\u95E8\u69DB\u7684 CHIP \u4F1A\u6298\u7B97\u4E3A\u79EF\u5206\u5E76\u56DE\u6536\uFF1B\u8FBE\u6807\u7684\u7ED3\u8F6C\uFF09",consentText:()=>["\u3010\u9996\u6B21\u4F7F\u7528\u8BF7\u5148\u9605\u8BFB\u3011","\xB7 \u8FD9\u662F\u793E\u533A\u5F00\u53D1\u8005\u53D1\u5E03\u7684\u7B2C\u4E09\u65B9\u5C0F\u6E38\u620F\uFF0C\u4E0E\u4EFB\u4F55\u6A21\u578B\u5382\u5546\u5747\u65E0\u5173\u8054\uFF0C\u4E0D\u4EE3\u8868\u5176\u7ACB\u573A\u3002","\xB7 \u53C2\u4E0E\u514D\u8D39\uFF1A\u6BCF\u65E5\u6709\u9650\u6B21\u514D\u8D39\u624B\uFF0C\u8F93\u4E86\u4E0D\u6263\u4EFB\u4F55\u4E1C\u897F\uFF0C\u4F60\u81EA\u5DF1\u7684\u5BC6\u94A5\u4E0E\u4F59\u989D\u4E0D\u53D7\u5F71\u54CD\u3002","\xB7 \u8D62\u5F97\u7684 CHIP \u53EA\u80FD\u5728\u672C\u63D2\u4EF6\u5185\u5151\u6362\u4E3A\u6A21\u578B\u989D\u5EA6\u6D88\u8D39\uFF1A\u4E0D\u53EF\u63D0\u73B0\u3001\u4E0D\u53EF\u8F6C\u8BA9\u3001\u4E0D\u53EF\u8F6C\u5165\u4EFB\u4F55\u5382\u5546\u8D26\u6237\u3002","\xB7 \u5956\u52B1\u6709\u8D5B\u5B63\u6709\u6548\u671F\uFF0C\u8D5B\u5B63\u7ED3\u675F\u540E\u3001\u6216\u957F\u671F\u4E0D\u6D3B\u8DC3\u65F6\uFF0C\u672A\u4F7F\u7528\u7684\u90E8\u5206\u6309\u89C4\u5219\u56DE\u6536\u3002","","\u9605\u8BFB\u5E76\u540C\u610F\u4EE5\u4E0A\u5185\u5BB9\u540E\uFF0C\u6267\u884C /blackjack agree confirm \u5F00\u59CB\u3002"].join(`
|
|
42
|
+
`),agreeHint:()=>"\u8BF7\u5148\u9605\u8BFB\u987B\u77E5\u5E76\u6267\u884C /blackjack agree \u540E\u518D\u4F7F\u7528\u3002",noRoundHint:()=>"\u5F53\u524D\u6CA1\u6709\u8FDB\u884C\u4E2D\u7684\u724C\u5C40\uFF0C\u5148\u7528 /blackjack deal \u5F00\u4E00\u5C40\u3002",commandUsage:()=>"agree | deal [\u6CE8\u989D] | exchange [\u6570\u91CF] | reset",actionDescriptions:{hit:"21 \u70B9\uFF1A\u5411\u724C\u684C\u8981\u4E00\u5F20\u724C",stand:"21 \u70B9\uFF1A\u505C\u724C\uFF0C\u8FDB\u5165\u7ED3\u7B97",double:"21 \u70B9\uFF1A\u52A0\u500D\u6CE8\u989D\u5E76\u518D\u8981\u4E00\u5F20\u724C",split:"21 \u70B9\uFF1A\u628A\u4E00\u5BF9\u76F8\u540C\u70B9\u6570\u7684\u724C\u5206\u6210\u4E24\u624B",insure:"21 \u70B9\uFF1A\u5E84\u5BB6\u660E\u724C\u4E3A A \u65F6\u8D2D\u4E70\u4FDD\u9669",decline:"21 \u70B9\uFF1A\u4E0D\u8D2D\u4E70\u4FDD\u9669"},blackjackCommandDescription:()=>"21 \u70B9\u724C\u684C\uFF08\u9700\u5148\u8FDB\u5165\u4F1A\u8BDD\uFF09\uFF1A\u67E5\u770B\u72B6\u6001\u3001\u5F00\u5C40\u3001\u5151\u6362\u989D\u5EA6\u3001\u91CD\u7F6E\u51ED\u8BC1",genericFailure:()=>"\u64CD\u4F5C\u6CA1\u6709\u6210\u529F\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",serviceUnreachable:()=>"\u6682\u65F6\u8FDE\u4E0D\u4E0A\u724C\u684C\u670D\u52A1\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",dailyFreeHandsExhausted:()=>"\u4ECA\u5929\u7684\u514D\u8D39\u624B\u7528\u5B8C\u4E86\uFF0C\u660E\u5929\u518D\u6765\u3002",belowExchangeThreshold:e=>`\u4F59\u989D\u8FD8\u6CA1\u5230\u5151\u6362\u95E8\u69DB\uFF08\u9700\u8981 ${s(e)} CHIP\uFF09\u3002`,insufficientBalance:()=>"\u4F59\u989D\u4E0D\u8DB3\u4EE5\u5B8C\u6210\u8FD9\u4E2A\u52A8\u4F5C\u3002",roundAlreadyInProgress:()=>"\u5DF2\u7ECF\u6709\u4E00\u5C40\u5728\u8FDB\u884C\u4E2D\u3002",githubBindingRequired:()=>"\u8FD9\u4E2A\u94B1\u5305\u7684 GitHub \u7ED1\u5B9A\u72B6\u6001\u6709\u95EE\u9898\uFF0C\u6682\u65F6\u65E0\u6CD5\u76F4\u63A5\u5151\u6362\u3002\u8BF7\u7A0D\u540E\u518D\u8BD5\uFF1B\u5982\u679C\u4E00\u76F4\u8FD9\u6837\uFF0C\u8BF7\u8054\u7CFB\u8FD0\u8425\u8005\u5904\u7406\u3002",seasonCapReached:(e,t)=>`\u8FD9\u7B14\u4F1A\u8D85\u8FC7\u672C\u8D5B\u5B63\u5151\u6362\u603B\u989D\u4E0A\u9650\uFF08\u4E0A\u9650 ${s(e)} CHIP\uFF0C\u672C\u8D5B\u5B63\u5DF2\u5151\u6362 ${s(t)} CHIP\uFF09\u3002`,exchangeUnavailable:()=>"\u5151\u6362\u529F\u80FD\u6682\u65F6\u4E0D\u53EF\u7528\uFF08\u8FD0\u8425\u8005\u90E8\u7F72\u672A\u914D\u7F6E\u5B8C\u6574\uFF09\uFF0C\u724C\u5C40\u672C\u8EAB\u4E0D\u53D7\u5F71\u54CD\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",betAmountAboveLimit:e=>`\u6CE8\u989D\u8D85\u8FC7\u4E0A\u9650\uFF0C\u6700\u591A\u53EF\u4E0B\u6CE8 ${s(e)} CHIP\u3002`,illegalAction:()=>"\u8FD9\u4E2A\u52A8\u4F5C\u73B0\u5728\u4E0D\u53EF\u7528\u4E86\uFF0C\u724C\u5C40\u72B6\u6001\u53EF\u80FD\u5DF2\u7ECF\u53D8\u5316\uFF0C\u8BF7\u7528 /blackjack \u67E5\u770B\u6700\u65B0\u72B6\u6001\u3002",registerRateLimited:()=>"\u5F53\u524D\u7F51\u7EDC\u6CE8\u518C\u6B21\u6570\u8FC7\u591A\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",unknownPlayerToken:()=>"\u8FD9\u53F0\u673A\u5668\u4E0A\u7684\u724C\u684C\u51ED\u8BC1\uFF0C\u670D\u52A1\u7AEF\u5DF2\u7ECF\u4E0D\u8BA4\u8BC6\u4E86\uFF08\u670D\u52A1\u7AEF\u91CD\u7F6E\u8FC7\uFF0C\u6216\u8005 serverUrl \u6539\u6307\u5230\u4E86\u53E6\u4E00\u4E2A\u90E8\u7F72\uFF09\u3002\u8BF7\u5148\u6267\u884C /blackjack reset confirm \u6E05\u6389\u5B83\uFF0C\u518D\u6267\u884C /blackjack agree \u91CD\u65B0\u5F00\u59CB\u3002",agreeWelcome:()=>["\u5DF2\u786E\u8BA4\u987B\u77E5\uFF0C\u6B22\u8FCE\u4E0A\u684C\u3002","/blackjack deal \u5F00\u59CB\u4ECA\u5929\u7684\u514D\u8D39\u624B\uFF0C\u6216 /blackjack deal <\u6CE8\u989D> \u7528\u4F59\u989D\u52A0\u6CE8\u3002"].join(`
|
|
43
|
+
`),invalidBetAmount:()=>"\u6CE8\u989D\u5FC5\u987B\u662F\u6B63\u6574\u6570\u3002",pairingInstructions:(e,t)=>["\u9996\u6B21\u5151\u6362\u8981\u5148\u7ED1\u5B9A GitHub\uFF0C\u53EA\u9700\u505A\u8FD9\u4E00\u6B21\u3002","","\u8BF7\u5728\u6D4F\u89C8\u5668\u91CC\u6253\u5F00\u8FD9\u4E2A\u94FE\u63A5\uFF1A",e,"","\u6253\u5F00\u540E\u70B9\u300C\u7528 GitHub \u7EE7\u7EED\u300D\u6388\u6743\uFF0C\u7136\u540E\u5728\u540C\u4E00\u4E2A\u9875\u9762\u586B\u5199\u8981\u5151\u6362\u7684\u6570\u91CF\u5E76\u63D0\u4EA4\u3002",`\u94FE\u63A5\u7EA6 ${t} \u5206\u949F\u5185\u6709\u6548\uFF1B\u8FC7\u671F\u4E86\u5C31\u518D\u6267\u884C\u4E00\u6B21 /blackjack exchange \u62FF\u4E00\u4E2A\u65B0\u7684\u3002`,"\u7ED1\u5B9A\u5B8C\u6210\u540E\uFF0C\u4EE5\u540E\u76F4\u63A5\u7528 /blackjack exchange <\u6570\u91CF> \u5151\u6362\uFF0C\u4E0D\u7528\u518D\u5F00\u6D4F\u89C8\u5668\u3002"].join(`
|
|
44
|
+
`),exchangeAmountPrompt:(e,t,n)=>[`\u5DF2\u7ED1\u5B9A GitHub \u8D26\u53F7\uFF1A${e}`,`\u5F53\u524D\u4F59\u989D\uFF1A${s(t)} CHIP\u3000\u5151\u6362\u95E8\u69DB\uFF1A${s(n)} CHIP`,"\u8BF7\u7528 /blackjack exchange <\u6570\u91CF> \u6307\u5B9A\u8981\u5151\u6362\u7684 CHIP \u6570\u91CF\u3002"].join(`
|
|
45
|
+
`),invalidExchangeAmount:()=>"\u5151\u6362\u6570\u91CF\u5FC5\u987B\u662F\u6B63\u6574\u6570\u3002",exchangeSuccess:(e,t)=>[`\u5DF2\u5151\u6362 ${s(e)} CHIP\u3002`,`\u7D2F\u8BA1\u5DF2\u5151\u6362\u989D\u5EA6\uFF1A${s(t)} CHIP`,"\u8FD9\u4EFD\u989D\u5EA6\u4F1A\u5728\u4F60\u81EA\u5DF1\u7684\u6A21\u578B\u989D\u5EA6\u8017\u5C3D\u65F6\uFF0C\u81EA\u52A8\u63A5\u7BA1\u90A3\u4E00\u6B21\u5931\u8D25\u7684\u8BF7\u6C42\uFF1B\u5E73\u65F6\u4E0D\u4F1A\u52A8\u7528\uFF0C\u4F60\u4E0D\u9700\u8981\u505A\u4EFB\u4F55\u4E8B\u3002"].join(`
|
|
46
|
+
`),exchangedQuotaNote:(e,t)=>t?`\u5DF2\u5151\u6362\u989D\u5EA6\u4EC5\u9650\u672C\u63D2\u4EF6\u5185\u6D88\u8D39\uFF0C\u4E0D\u53EF\u63D0\u73B0\u3001\u4E0D\u53EF\u8F6C\u8BA9\u3002\u8FDE\u7EED ${e} \u5929\u65E0\u6E38\u620F\u4E14\u65E0\u6D88\u8D39\u7684\u8D26\u6237\uFF0C\u4F59\u989D\u4F1A\u88AB\u56DE\u6536\u8FDB\u5956\u6C60\u3002`:`\u5DF2\u5151\u6362\u989D\u5EA6\u4EC5\u9650\u672C\u63D2\u4EF6\u5185\u6D88\u8D39\uFF0C\u4E0D\u53EF\u63D0\u73B0\u3001\u4E0D\u53EF\u8F6C\u8BA9\u3002\u5B83\u4E0D\u4F1A\u56E0\u8D5B\u5B63\u7ED3\u675F\u800C\u6E05\u96F6\uFF1B\u4F46\u8FDE\u7EED ${e} \u5929\u65E0\u6E38\u620F\u4E14\u65E0\u6D88\u8D39\u7684\u8D26\u6237\uFF0C\u4F59\u989D\u4F1A\u88AB\u56DE\u6536\u8FDB\u5956\u6C60\u3002`,resetConfirmPrompt:()=>"\u8FD9\u4F1A\u6E05\u9664\u672C\u673A\u4FDD\u5B58\u7684\u724C\u684C\u51ED\u8BC1\uFF08\u4E0D\u5F71\u54CD\u670D\u52A1\u7AEF\u8BB0\u5F55\uFF0C\u91CD\u65B0\u914D\u5BF9\u5373\u53EF\u627E\u56DE\uFF09\u3002\u786E\u8BA4\u8BF7\u6267\u884C /blackjack reset confirm",resetDone:()=>"\u5DF2\u6E05\u9664\u672C\u673A\u51ED\u8BC1\uFF0C\u53EF\u7528 /blackjack agree \u91CD\u65B0\u5F00\u59CB\u3002",unknownSubcommand:(e,t)=>`\u672A\u77E5\u5B50\u547D\u4EE4\u300C${e}\u300D\u3002\u53EF\u7528\uFF1A${t}`,poolSwitchNotice:()=>"\u5DF2\u5207\u6362\u81F3\u5956\u6C60\u4F59\u989D\u7EE7\u7EED\u672C\u6B21\u8BF7\u6C42\u3002",poolFallbackFailed:e=>`\u4F60\u81EA\u5DF1\u7684\u6A21\u578B\u989D\u5EA6\u5DF2\u8017\u5C3D\uFF0C\u5956\u6C60\u63A5\u7BA1\u4E86\u8FD9\u6B21\u8BF7\u6C42\u4F46\u4E5F\u6CA1\u6210\u529F\uFF08\u5956\u6C60\uFF1A${e}\uFF09\u3002\u5DF2\u5151\u6362\u989D\u5EA6\u6CA1\u6709\u88AB\u6263\u3002`,poolFallbackBusy:()=>"\u4F60\u81EA\u5DF1\u7684\u6A21\u578B\u989D\u5EA6\u5DF2\u8017\u5C3D\uFF0C\u5956\u6C60\u63A5\u7BA1\u4E86\u8FD9\u6B21\u8BF7\u6C42\uFF0C\u4F46\u540C\u65F6\u8FDB\u884C\u7684\u8BF7\u6C42\u592A\u591A\u88AB\u6321\u4E0B\u4E86\u3002\u5DF2\u5151\u6362\u989D\u5EA6\u6CA1\u6709\u88AB\u6263\uFF0C\u7A0D\u7B49\u4E00\u4E0B\u518D\u8BD5\u3002",noCredentialHint:()=>"\u7EED\u547D\u53EA\u5728\u4F60\u81EA\u5DF1\u7684\u6A21\u578B\u989D\u5EA6\u8017\u5C3D\u65F6\u63A5\u7BA1\uFF1B\u5F53\u524D\u662F\u6CA1\u6709\u914D\u7F6E key\uFF0C\u6240\u4EE5\u7528\u4E0D\u5230\u4F60\u5DF2\u5151\u6362\u7684\u989D\u5EA6\u3002",hiddenCardLabel:()=>"\u6697\u724C",tableHandLabel:()=>"\u4F60\u7684\u724C",tableSplitHandLabel:e=>`\u4F60\u7684\u7B2C ${e} \u624B`,tableDealerLabel:()=>"\u5E84\u5BB6",tableActionLabels:{hit:"\u8981\u724C",stand:"\u505C\u724C",double:"\u53CC\u500D",split:"\u5206\u724C",insure:"\u4E70\u4FDD\u9669",decline:"\u4E0D\u4E70\u4FDD\u9669"},tableBalanceHeader:(e,t)=>`\u4F59\u989D\uFF1A${s(e)} CHIP\u3000\u4ECA\u65E5\u5269\u4F59\u514D\u8D39\u624B\uFF1A${t}`,tablePointsSuffix:e=>`\u3000\u79EF\u5206\uFF1A${s(e)}`,tableExchangedSuffix:e=>`\u3000\u5DF2\u5151\u6362\u989D\u5EA6\uFF1A${s(e)} CHIP`,tableExchangeThresholdReached:e=>`\u5DF2\u8FBE\u5151\u6362\u95E8\u69DB\uFF08${s(e)} CHIP\uFF09\xB7 \u7528 /blackjack exchange \u628A CHIP \u6362\u6210\u6A21\u578B\u989D\u5EA6`,tableExchangeThresholdShort:(e,t)=>`\u8FD8\u5DEE ${s(e)} CHIP \u5230\u5151\u6362\u95E8\u69DB\uFF08${s(t)}\uFF09\xB7 \u8FC7\u7EBF\u540E\u53EF\u7528 /blackjack exchange \u6362\u6210\u6A21\u578B\u989D\u5EA6`,tableExchangedQuotaNote:e=>`\u5DF2\u5151\u6362\u7684 ${s(e)} CHIP \u4F1A\u5728\u4F60\u81EA\u5DF1\u7684\u6A21\u578B\u989D\u5EA6\u8017\u5C3D\u65F6\u81EA\u52A8\u63A5\u7BA1\u90A3\u4E00\u6B21\u8BF7\u6C42\uFF0C\u5E73\u65F6\u4E0D\u4F1A\u52A8\u7528\u3002`,tablePoolEmptyNotice:()=>"\uFF08\u672C\u671F\u5956\u6C60\u5DF2\u53D1\u5B8C\uFF0C\u73B0\u5728\u8D62\u724C\u5C06\u53D1\u653E\u79EF\u5206\uFF09",actionShortfallHint:e=>`\u8FD8\u8981\u518D\u51FA ${s(e)} CHIP\uFF0C\u4F59\u989D\u4E0D\u8DB3`,tableCostSuffix:e=>`\uFF08${s(e)}\uFF09`,betAmountMissing:()=>"\u8BF7\u8F93\u5165\u6CE8\u989D\u3002",betAmountExceedsCap:e=>`\u5355\u5C40\u6700\u591A ${s(e)} CHIP\u3002`,betAmountExceedsBalance:()=>"\u4F59\u989D\u4E0D\u8DB3\u4EE5\u4E0B\u8FD9\u4E2A\u6CE8\u3002",customBetToggle:()=>"\u81EA\u5B9A\u4E49\u6CE8\u989D",customBetSubmit:()=>"\u5F00\u59CB",customBetRange:e=>`1 \uFF5E ${s(e)} CHIP`,noActiveRoundNotice:()=>"\u5F53\u524D\u6CA1\u6709\u8FDB\u884C\u4E2D\u7684\u724C\u5C40\u3002",freeHandsGroupTitle:()=>"\u514D\u8D39\u624B",freeHandsRemainingToday:e=>` \xB7 \u4ECA\u65E5\u5269 ${e} \u624B`,freeHandsExhaustedToday:()=>" \xB7 \u4ECA\u65E5\u5DF2\u7528\u5B8C\uFF0C\u660E\u5929\u518D\u6765",freeHandExplainer:(e,t)=>`\u4E0D\u7528\u51FA CHIP\u3002\u8D62\u4E86\u62FF ${s(e)} CHIP\uFF1B\u5934\u4E24\u5F20\u724C\u5C31\u51D1\u6210 21 \u70B9\uFF08A \u914D 10/J/Q/K\uFF09\u62FF ${s(t)}\u3002\u8F93\u4E86\u6216\u5E73\u5C40\u90FD\u4E0D\u635F\u5931\u4EFB\u4F55\u4E1C\u897F\u3002`,startFreeHandButton:()=>"\u5F00\u59CB\u514D\u8D39\u7684\u4E00\u5C40",raiseGroupTitle:()=>"\u7528\u4F59\u989D\u52A0\u6CE8",insufficientBalanceSuffix:()=>" \xB7 \u4F59\u989D\u4E0D\u8DB3",raiseExplainer:()=>"\u52A0\u6CE8\u7684 CHIP \u4ECE\u4F60\u7684\u4F59\u989D\u91CC\u51FA\uFF0C\u8D62\u4E86\u7FFB\u500D\uFF0C\u8F93\u4E86\u6536\u4E0D\u56DE\u3002",rematchFreeLabel:()=>"\u518D\u6765\u4E00\u5C40\uFF08\u514D\u8D39\uFF09",dealButtonFreeHandsSuffix:e=>`\xB7\u5269 ${e} \u624B`,dismissButton:()=>"\u6536\u8D77",actionFailedNotice:()=>"\u4E0A\u4E00\u6B21\u64CD\u4F5C\u6CA1\u6709\u6210\u529F\uFF0C\u5DF2\u4E3A\u4F60\u5237\u65B0\u5230\u6700\u65B0\u72B6\u6001\u3002"};var r=e=>e.toLocaleString("en-US"),B={freeStakeLine:e=>`This hand is free: win and you take ${r(e)} CHIP; lose and you are out nothing.`,raiseStakeLine:e=>`${r(e)} CHIP is committed from your balance for this hand.`,freeWin:e=>`You won ${r(e)} CHIP.`,freeLose:()=>"This hand did not win. A free hand costs you nothing.",freePush:()=>"A tie. Nothing gained, nothing lost.",raiseWin:(e,t)=>`You won \u2014 ${r(e)} CHIP back (${r(t)} committed).`,raiseLose:e=>`This hand lost; the ${r(e)} CHIP you committed is gone.`,raisePush:e=>`A tie. Your ${r(e)} CHIP comes back.`,handLabel:()=>"Your hand: ",splitHandLabel:e=>`Hand ${e}: `,dealerLabel:()=>"Dealer: ",totalInParens:(e,t)=>` (${t?"soft ":""}${e})`,doubled:()=>" [doubled]",actionsPrefix:()=>"Available: ",actionLabels:{hit:"/bj-hit hit",stand:"/bj-stand stand",double:"/bj-double double down",split:"/bj-split split",insure:"/bj-insure buy insurance",decline:"/bj-decline decline insurance"},actionsSeparator:()=>" ",balanceLine:(e,t)=>`Balance: ${r(e)} CHIP Exchanged so far: ${r(t)} CHIP`,freeHandsLine:(e,t)=>`Free hands left today: ${e} Season: ${t}`,thresholdLine:e=>`Exchange threshold: ${r(e)} CHIP (once reached, use /blackjack exchange)`,pointsLine:e=>`Points: ${r(e)}`,poolEmptyNotice:()=>"Note: this season's pool is spent; wins now grant points instead.",pointsGrantedNotice:e=>`This season's pool is spent, so you were granted ${r(e)} points instead.`,chipValidityNotice:()=>"(At season end, CHIP below the exchange threshold converts to points and is reclaimed; CHIP past the threshold carries over.)",consentText:()=>["[Please read before first use]","\xB7 This is a third-party mini-game published by a community developer; it is not affiliated with any model vendor and does not represent any vendor's position.","\xB7 Taking part is free: you get a limited number of free hands each day, losing costs you nothing, and your own API key and balance are unaffected.","\xB7 CHIP you win can only be exchanged, within this plugin, for model API quota to spend: it cannot be withdrawn, cannot be transferred to anyone else, and cannot be moved into any vendor account.","\xB7 Rewards carry a season-limited validity period; whatever is left unused is reclaimed under the rules after the season ends, or after a long stretch of inactivity.","","Once you have read and agree to the above, run /blackjack agree confirm to start."].join(`
|
|
47
|
+
`),agreeHint:()=>"Please read the notice and run /blackjack agree before using this.",noRoundHint:()=>"No hand is in progress right now \u2014 run /blackjack deal to start one.",commandUsage:()=>"agree | deal [amount] | exchange [amount] | reset",actionDescriptions:{hit:"Blackjack: draw one card from the shoe",stand:"Blackjack: stand, ending your turn and moving to settlement",double:"Blackjack: double down \u2014 double your committed CHIP and draw exactly one more card",split:"Blackjack: split a pair of equal-rank cards into two hands",insure:"Blackjack: buy insurance when the dealer shows an Ace",decline:"Blackjack: decline insurance"},blackjackCommandDescription:()=>"Blackjack table (needs an open conversation): status, deal, exchange quota, reset",genericFailure:()=>"That didn't go through \u2014 please try again in a moment.",serviceUnreachable:()=>"Can't reach the table service right now \u2014 please try again shortly.",dailyFreeHandsExhausted:()=>"You're out of free hands for today \u2014 come back tomorrow.",belowExchangeThreshold:e=>`Your balance hasn't reached the exchange threshold yet (needs ${r(e)} CHIP).`,insufficientBalance:()=>"Your balance isn't enough to complete this action.",roundAlreadyInProgress:()=>"A hand is already in progress.",githubBindingRequired:()=>"This wallet's GitHub link looks inconsistent, so a direct exchange isn't possible right now. Please try again later; if it keeps happening, contact the operator.",seasonCapReached:(e,t)=>`This would go over this season's exchange cap (cap ${r(e)} CHIP, already exchanged ${r(t)} CHIP this season).`,exchangeUnavailable:()=>"Exchanging isn't available right now (an operator deployment setting is missing) \u2014 the table itself is unaffected, please try again later.",betAmountAboveLimit:e=>`That amount is over the limit \u2014 the most you can raise is ${r(e)} CHIP.`,illegalAction:()=>"That move isn't available anymore \u2014 the hand's state may have changed. Run /blackjack to see the current state.",registerRateLimited:()=>"Too many registrations from this network right now \u2014 please try again later.",unknownPlayerToken:()=>"The table service no longer recognizes the credential stored on this machine (the server was reset, or serverUrl now points at a different deployment). Run /blackjack reset confirm to clear it, then /blackjack agree to start over.",agreeWelcome:()=>["You have confirmed the notice \u2014 welcome to the table.","Run /blackjack deal to start today's free hand, or /blackjack deal <amount> to raise from your balance."].join(`
|
|
48
|
+
`),invalidBetAmount:()=>"The amount must be a positive integer.",pairingInstructions:(e,t)=>["Linking a GitHub account is required for your first exchange \u2014 this is a one-time step.","","Open this link in your browser:",e,"",'After opening it, click "Continue with GitHub" to authorize, then enter the amount to exchange on the same page and submit.',`The link stays valid for about ${t} ${t===1?"minute":"minutes"}; if it expires, just run /blackjack exchange again for a new one.`,"Once linked, use /blackjack exchange <amount> directly from now on \u2014 no more browser trips needed."].join(`
|
|
49
|
+
`),exchangeAmountPrompt:(e,t,n)=>[`GitHub account linked: ${e}`,`Current balance: ${r(t)} CHIP Exchange threshold: ${r(n)} CHIP`,"Use /blackjack exchange <amount> to specify how much CHIP to exchange."].join(`
|
|
50
|
+
`),invalidExchangeAmount:()=>"The exchange amount must be a positive integer.",exchangeSuccess:(e,t)=>[`You exchanged ${r(e)} CHIP.`,`Total exchanged so far: ${r(t)} CHIP`,"This quota automatically takes over the one request that fails once your own model quota runs out; it isn't touched otherwise, and there's nothing you need to do."].join(`
|
|
51
|
+
`),exchangedQuotaNote:(e,t)=>t?`Exchanged quota is spendable only inside this plugin \u2014 it can't be withdrawn or transferred. An account with ${e} consecutive days of no play and no spending has its balance recycled into the pool.`:`Exchanged quota is spendable only inside this plugin \u2014 it can't be withdrawn or transferred. It doesn't expire at the end of a season; but an account with ${e} consecutive days of no play and no spending has its balance recycled into the pool.`,resetConfirmPrompt:()=>"This clears the table credential saved on this machine (server-side records are unaffected; pairing again will recover it). Confirm with /blackjack reset confirm",resetDone:()=>"Local credential cleared. Run /blackjack agree to start over.",unknownSubcommand:(e,t)=>`Unknown subcommand "${e}". Available: ${t}`,poolSwitchNotice:()=>"Switched to the pool balance to continue this request.",poolFallbackFailed:e=>`Your own model quota is used up. The pool took this request over but did not get through either (pool said: ${e}). Your exchanged quota was not charged.`,poolFallbackBusy:()=>"Your own model quota is used up. The pool took this request over but too many requests were in flight at once. Your exchanged quota was not charged \u2014 wait a moment and try again.",noCredentialHint:()=>"The fallback route only takes over once your own model quota is exhausted; right now no API key is configured, so your exchanged quota can't be used yet.",hiddenCardLabel:()=>"Hidden card",tableHandLabel:()=>"Your hand",tableSplitHandLabel:e=>`Hand ${e}`,tableDealerLabel:()=>"Dealer",tableActionLabels:{hit:"Hit",stand:"Stand",double:"Double down",split:"Split",insure:"Buy insurance",decline:"Decline insurance"},tableBalanceHeader:(e,t)=>`Balance: ${r(e)} CHIP \xB7 Free hands left today: ${t}`,tablePointsSuffix:e=>` \xB7 Points: ${r(e)}`,tableExchangedSuffix:e=>` \xB7 Exchanged so far: ${r(e)} CHIP`,tableExchangeThresholdReached:e=>`You've reached the exchange threshold (${r(e)} CHIP) \u2014 use /blackjack exchange to turn CHIP into model quota`,tableExchangeThresholdShort:(e,t)=>`${r(e)} CHIP short of the exchange threshold (${r(t)}) \u2014 once you cross it, use /blackjack exchange to turn CHIP into model quota`,tableExchangedQuotaNote:e=>`The ${r(e)} CHIP you've exchanged automatically takes over the one request that fails once your own model quota runs out; it isn't touched otherwise.`,tablePoolEmptyNotice:()=>"(This season's pool is spent \u2014 wins now grant points instead)",actionShortfallHint:e=>`${r(e)} more CHIP needed \u2014 balance too low`,tableCostSuffix:e=>` (${r(e)})`,betAmountMissing:()=>"Enter an amount.",betAmountExceedsCap:e=>`The cap for a single hand is ${r(e)} CHIP.`,betAmountExceedsBalance:()=>"Your balance isn't enough for this amount.",customBetToggle:()=>"Custom amount",customBetSubmit:()=>"Start",customBetRange:e=>`1 to ${r(e)} CHIP`,noActiveRoundNotice:()=>"No hand is in progress right now.",freeHandsGroupTitle:()=>"Free hands",freeHandsRemainingToday:e=>` \xB7 ${e} left today`,freeHandsExhaustedToday:()=>" \xB7 used up for today \u2014 come back tomorrow",freeHandExplainer:(e,t)=>`No CHIP required. Win and you take ${r(e)} CHIP; a natural blackjack in the first two cards (an Ace with a 10/J/Q/K) pays ${r(t)}. Lose or tie and you are out nothing.`,startFreeHandButton:()=>"Start a free hand",raiseGroupTitle:()=>"Raise from your balance",insufficientBalanceSuffix:()=>" \xB7 balance too low",raiseExplainer:()=>"The CHIP you raise comes from your balance: win and it doubles, lose and it is gone.",rematchFreeLabel:()=>"Play again (free)",dealButtonFreeHandsSuffix:e=>` \u2014 ${e} left`,dismissButton:()=>"Dismiss",actionFailedNotice:()=>"That didn't go through \u2014 you've been refreshed to the latest state."};function N(e){return e==="zh"?E:B}var m=require("react/jsx-runtime"),de=["slots"];async function w(e,t){let n=await fetch(e,t),i=await n.text(),o=i.length>0?JSON.parse(i):{};if(!n.ok){let d=typeof o?.error=="string"?o.error:`${n.status}`;throw new Error(d)}return o}function ue(){let e=typeof navigator=="object"&&navigator!==null?navigator.language:void 0;return typeof e=="string"&&e.toLowerCase().startsWith("zh")?"zh":"en"}function be(){return"en"}function A(e){return e?e.getSnapshot().active:ue()}function R(e,t){return e?e.subscribe(t):()=>{}}function M(e){let t=(0,u.useCallback)(i=>R(e,i),[e]),n=(0,u.useCallback)(()=>A(e),[e]);return(0,u.useSyncExternalStore)(t,n,be)}function he({node:e,locale:t}){let n=T(e),i=M(t),o=N(i),[d,l]=(0,u.useState)(null),[c,h]=(0,u.useState)(!1),g=(0,u.useCallback)(()=>{w("/blackjack/api/state").then(b=>l(p=>f(p??{consented:!1},{type:"synced",payload:b}))).catch(()=>l({consented:!1}))},[]),x=(0,u.useCallback)(()=>{w("/blackjack/api/state").then(b=>l(p=>p&&f(p,{type:"meRefreshed",me:b.me}))).catch(()=>{})},[]);(0,u.useEffect)(()=>{n.table&&g()},[g,n.table]);let k=(0,u.useCallback)((b,p)=>{w(b,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(p)}).then(q=>{h(!1),l(C=>C&&f(C,{type:"round",round:q})),x()}).catch(()=>{h(!0),g()})},[x,g]),F=(0,u.useCallback)(b=>k("/blackjack/api/deal",b===void 0?{}:{betChips:b}),[k]),D=(0,u.useCallback)(b=>k("/blackjack/api/action",{action:b}),[k]),V=(0,u.useCallback)(()=>l(b=>b&&f(b,{type:"dismissed"})),[]),y=n.text===void 0?null:(0,m.jsx)("div",{style:{whiteSpace:"pre-wrap",marginBottom:"8px",...n.isError?{color:"#c0392b"}:{}},children:(0,m.jsx)(L,{text:n.text})});return!n.table||d===null?y:(0,m.jsxs)("div",{children:[y,(0,m.jsx)($,{state:d,m:o,onAction:D,onDeal:F,onDismiss:V,error:c?o.actionFailedNotice():void 0})]})}function ge(e){e.slots.inject("conversation.chat.commandview",()=>e.slots.register({name:"conversation.chat.commandview",key:"blackjack",inject:()=>({})},t=>(0,m.jsx)(he,{...t,locale:e.get("locale",!1)})))}
|
|
52
52
|
return module.exports;
|
|
53
53
|
}
|
|
54
54
|
});
|
package/dist/i18n/en.d.ts
CHANGED
|
@@ -66,6 +66,8 @@ export declare const en: {
|
|
|
66
66
|
resetDone: () => string;
|
|
67
67
|
unknownSubcommand: (sub: string, usage: string) => string;
|
|
68
68
|
poolSwitchNotice: () => string;
|
|
69
|
+
poolFallbackFailed: (reason: string) => string;
|
|
70
|
+
poolFallbackBusy: () => string;
|
|
69
71
|
noCredentialHint: () => string;
|
|
70
72
|
hiddenCardLabel: () => string;
|
|
71
73
|
tableHandLabel: () => string;
|
package/dist/i18n/en.js
CHANGED
|
@@ -120,6 +120,8 @@ export const en = {
|
|
|
120
120
|
resetDone: () => 'Local credential cleared. Run /blackjack agree to start over.',
|
|
121
121
|
unknownSubcommand: (sub, usage) => `Unknown subcommand "${sub}". Available: ${usage}`,
|
|
122
122
|
poolSwitchNotice: () => 'Switched to the pool balance to continue this request.',
|
|
123
|
+
poolFallbackFailed: (reason) => `Your own model quota is used up. The pool took this request over but did not get through either (pool said: ${reason}). Your exchanged quota was not charged.`,
|
|
124
|
+
poolFallbackBusy: () => 'Your own model quota is used up. The pool took this request over but too many requests were in flight at once. Your exchanged quota was not charged — wait a moment and try again.',
|
|
123
125
|
noCredentialHint: () => "The fallback route only takes over once your own model quota is exhausted; right now no API key is configured, so your exchanged quota can't be used yet.",
|
|
124
126
|
hiddenCardLabel: () => 'Hidden card',
|
|
125
127
|
tableHandLabel: () => 'Your hand',
|
package/dist/i18n/messages.d.ts
CHANGED
|
@@ -338,6 +338,23 @@ export interface Messages {
|
|
|
338
338
|
* 要走 locale,为将来真的有通知位那天做准备。
|
|
339
339
|
*/
|
|
340
340
|
poolSwitchNotice(): string;
|
|
341
|
+
/**
|
|
342
|
+
* 续命接管了、但奖池这一侧也失败时,**替换掉交还给宿主的那条失败消息**。
|
|
343
|
+
*
|
|
344
|
+
* 为什么必须替换:奖池失败时插件把**原始**失败原样交还("装了这个插件不会让任何
|
|
345
|
+
* 调用变差"),于是玩家看到的是「Insufficient Balance」——而他明明有已兑换额度。
|
|
346
|
+
* 那是一句假话,且出现在他最需要理解发生了什么的时刻。2026-08-22 实测就是这个
|
|
347
|
+
* 场景:dsh 创建会话那一轮同时发 3 个调用,全部触发续命,奖池当时的并发闸只放 1 个,
|
|
348
|
+
* 另外两个被拒,玩家却被告知"余额不足"。
|
|
349
|
+
*
|
|
350
|
+
* 只改 `LlmFailure.message`(给人读的那半),`code` 原样保留——宿主的路由与徽章
|
|
351
|
+
* 认的是 code,动它才叫"让调用变差"。
|
|
352
|
+
*
|
|
353
|
+
* `reason` 是奖池那侧的原始说法,原样带上,便于运营者从玩家截图里定位。
|
|
354
|
+
*/
|
|
355
|
+
poolFallbackFailed(reason: string): string;
|
|
356
|
+
/** 同上,但用于奖池明确回「并发过多」的情况——这个有明确的下一步:稍后重试。 */
|
|
357
|
+
poolFallbackBusy(): string;
|
|
341
358
|
/** 没配 key 时的说明:续命只在自己额度耗尽时接管,配置缺失时用不上已兑换额度。 */
|
|
342
359
|
noCredentialHint(): string;
|
|
343
360
|
/** 暗牌(庄家扣着的那张)的 `aria-label`。 */
|
package/dist/i18n/zh.d.ts
CHANGED
|
@@ -66,6 +66,8 @@ export declare const zh: {
|
|
|
66
66
|
resetDone: () => string;
|
|
67
67
|
unknownSubcommand: (sub: string, usage: string) => string;
|
|
68
68
|
poolSwitchNotice: () => string;
|
|
69
|
+
poolFallbackFailed: (reason: string) => string;
|
|
70
|
+
poolFallbackBusy: () => string;
|
|
69
71
|
noCredentialHint: () => string;
|
|
70
72
|
hiddenCardLabel: () => string;
|
|
71
73
|
tableHandLabel: () => string;
|
package/dist/i18n/zh.js
CHANGED
|
@@ -119,6 +119,8 @@ export const zh = {
|
|
|
119
119
|
resetDone: () => '已清除本机凭证,可用 /blackjack agree 重新开始。',
|
|
120
120
|
unknownSubcommand: (sub, usage) => `未知子命令「${sub}」。可用:${usage}`,
|
|
121
121
|
poolSwitchNotice: () => '已切换至奖池余额继续本次请求。',
|
|
122
|
+
poolFallbackFailed: (reason) => `你自己的模型额度已耗尽,奖池接管了这次请求但也没成功(奖池:${reason})。已兑换额度没有被扣。`,
|
|
123
|
+
poolFallbackBusy: () => '你自己的模型额度已耗尽,奖池接管了这次请求,但同时进行的请求太多被挡下了。已兑换额度没有被扣,稍等一下再试。',
|
|
122
124
|
noCredentialHint: () => '续命只在你自己的模型额度耗尽时接管;当前是没有配置 key,所以用不到你已兑换的额度。',
|
|
123
125
|
hiddenCardLabel: () => '暗牌',
|
|
124
126
|
tableHandLabel: () => '你的牌',
|
package/dist/router.d.ts
CHANGED
|
@@ -85,6 +85,21 @@ export interface FallbackDeps {
|
|
|
85
85
|
* entirely once a fallback is underway — the pool call reports its own —
|
|
86
86
|
* instead of both being forwarded and double-counting tokens.
|
|
87
87
|
*/
|
|
88
|
+
/**
|
|
89
|
+
* 奖池也失败时,替换交还给宿主的失败**消息**,保留 `code`/`status` 等机器字段。
|
|
90
|
+
*
|
|
91
|
+
* 原样交还原始失败是有意的("装了这个插件不会让任何调用变差"),但那条消息说的是
|
|
92
|
+
* 玩家自己额度不足——他明明有已兑换额度,续命也确实接管了,只是奖池这侧没成。
|
|
93
|
+
* 假话出现在他最需要看懂的时刻,所以人读的那半必须换掉。
|
|
94
|
+
*/
|
|
95
|
+
export declare function withTruthfulMessage(original: StreamChunk & {
|
|
96
|
+
type: 'finish';
|
|
97
|
+
}, poolFailure: {
|
|
98
|
+
code?: string;
|
|
99
|
+
message?: string;
|
|
100
|
+
}, m: Messages): StreamChunk & {
|
|
101
|
+
type: 'finish';
|
|
102
|
+
};
|
|
88
103
|
export declare function runWithFallback(options: GenerateOptions, next: () => AsyncIterable<StreamChunk>, deps: FallbackDeps): AsyncIterable<StreamChunk>;
|
|
89
104
|
/**
|
|
90
105
|
* Register the pool-route adapter and hang the `llm/stream` fallback
|
package/dist/router.js
CHANGED
|
@@ -94,6 +94,26 @@ export function shouldHintNoCredential(input) {
|
|
|
94
94
|
* entirely once a fallback is underway — the pool call reports its own —
|
|
95
95
|
* instead of both being forwarded and double-counting tokens.
|
|
96
96
|
*/
|
|
97
|
+
/**
|
|
98
|
+
* 奖池也失败时,替换交还给宿主的失败**消息**,保留 `code`/`status` 等机器字段。
|
|
99
|
+
*
|
|
100
|
+
* 原样交还原始失败是有意的("装了这个插件不会让任何调用变差"),但那条消息说的是
|
|
101
|
+
* 玩家自己额度不足——他明明有已兑换额度,续命也确实接管了,只是奖池这侧没成。
|
|
102
|
+
* 假话出现在他最需要看懂的时刻,所以人读的那半必须换掉。
|
|
103
|
+
*/
|
|
104
|
+
export function withTruthfulMessage(original, poolFailure, m) {
|
|
105
|
+
const reason = original.reason;
|
|
106
|
+
if (reason.kind !== 'error' || !reason.failure)
|
|
107
|
+
return original;
|
|
108
|
+
const busy = poolFailure.code === 'RATE_LIMIT' || /concurrent|rate limit/i.test(poolFailure.message ?? '');
|
|
109
|
+
const message = busy
|
|
110
|
+
? m.poolFallbackBusy()
|
|
111
|
+
: m.poolFallbackFailed(poolFailure.message ?? poolFailure.code ?? 'unknown');
|
|
112
|
+
return {
|
|
113
|
+
...original,
|
|
114
|
+
reason: { ...reason, failure: { ...reason.failure, message } },
|
|
115
|
+
};
|
|
116
|
+
}
|
|
97
117
|
export async function* runWithFallback(options, next, deps) {
|
|
98
118
|
const m = deps.m;
|
|
99
119
|
let emittedContent = false;
|
|
@@ -181,7 +201,9 @@ export async function* runWithFallback(options, next, deps) {
|
|
|
181
201
|
// 奖池回的是 `unknown model: deepseek-v4-flash`(模型不在价目表里),
|
|
182
202
|
// 而玩家只看到原始的 Insufficient Balance,跟没装插件一模一样。
|
|
183
203
|
deps.logError?.(new Error(`dsh-blackjack: pool retry failed after a quota exhaustion; pool said ${JSON.stringify(c.reason.failure)}`));
|
|
184
|
-
|
|
204
|
+
// 交还的仍然是**原始**失败(不改 code,宿主的路由与徽章认的是它),但把
|
|
205
|
+
// 给人读的那半换成真话:原样交还等于告诉一个明明有额度的玩家"余额不足"。
|
|
206
|
+
yield withTruthfulMessage(finish, c.reason.failure, m);
|
|
185
207
|
return;
|
|
186
208
|
}
|
|
187
209
|
if (!announced) {
|