@ttmg/cli 0.4.5 → 0.4.6-agent-beta.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.
Files changed (82) hide show
  1. package/README.md +644 -2
  2. package/dist/index.js +22502 -6070
  3. package/dist/index.js.map +1 -1
  4. package/dist/package.json +36 -4
  5. package/dist/public/assets/{Card-BAsimNoh.js → Card-CN2lxY0Y.js} +1 -1
  6. package/dist/public/assets/{Detail-rVxbEDgh.js → Detail-CELZZ-4h.js} +1 -1
  7. package/dist/public/assets/Detail-CELZZ-4h.js.br +0 -0
  8. package/dist/public/assets/{MonetizationMode-B20TAE9o.js → MonetizationMode-C7DNqium.js} +1 -1
  9. package/dist/public/assets/{MonetizationModeSummary-CnHqXyco.js → MonetizationModeSummary-DYE7XUq1.js} +1 -1
  10. package/dist/public/assets/{SectionHeader-Cn3FnOqh.js → SectionHeader-BKc3BWXP.js} +1 -1
  11. package/dist/public/assets/{baseForm-kBTxn8h8.js → baseForm-I9suIiQn.js} +1 -1
  12. package/dist/public/assets/baseForm-I9suIiQn.js.br +0 -0
  13. package/dist/public/assets/{col-VN3Ivd-x.js → col-w9Q-2mgM.js} +1 -1
  14. package/dist/public/assets/{compass-BabZVjAl.js → compass-D6waJ52O.js} +1 -1
  15. package/dist/public/assets/{index-DHdJsD10.js → index-8sDAOAcS.js} +1 -1
  16. package/dist/public/assets/index-8sDAOAcS.js.br +0 -0
  17. package/dist/public/assets/{index-DK4IvdRl.js → index-B6hY5GdS.js} +1 -1
  18. package/dist/public/assets/{index-Cl0_vMWE.js → index-BIrFkB6r.js} +1 -1
  19. package/dist/public/assets/index-BIrFkB6r.js.br +0 -0
  20. package/dist/public/assets/{index-BjQlJrX7.js → index-BLWgpW64.js} +1 -1
  21. package/dist/public/assets/{index-odEI7YQF.js → index-BY3eQmfP.js} +1 -1
  22. package/dist/public/assets/index-BY3eQmfP.js.br +0 -0
  23. package/dist/public/assets/{index-Bjn0ctEd.js → index-BegU9LBT.js} +2 -2
  24. package/dist/public/assets/index-BegU9LBT.js.br +0 -0
  25. package/dist/public/assets/{index-1WjGwqIV.js → index-BqwflQml.js} +1 -1
  26. package/dist/public/assets/{index-DXDZCuG4.js → index-BrOFdVbv.js} +1 -1
  27. package/dist/public/assets/{index-BxsB5E3u.js → index-BvPolBSn.js} +1 -1
  28. package/dist/public/assets/{index-BnOeYQAd.js → index-BwrZjkCc.js} +1 -1
  29. package/dist/public/assets/{index-CUuX90R9.js → index-CLKKui8G.js} +1 -1
  30. package/dist/public/assets/{index-Dohibgdp.js → index-Cb4Ja0tZ.js} +1 -1
  31. package/dist/public/assets/{index-C83QHLmD.js → index-CcUgN29Y.js} +1 -1
  32. package/dist/public/assets/{index-aSl6Wdrp.js → index-CgXOkYrX.js} +1 -1
  33. package/dist/public/assets/index-CgXOkYrX.js.br +0 -0
  34. package/dist/public/assets/{index-DulANwbq.js → index-CsiIrLKY.js} +1 -1
  35. package/dist/public/assets/{index-Ba-JWe4X.js → index-Csmg5oyu.js} +1 -1
  36. package/dist/public/assets/{index-DnnfZ7H_.js → index-DDecPuod.js} +1 -1
  37. package/dist/public/assets/{index-Clq0hTDI.js → index-DDy4PkWT.js} +1 -1
  38. package/dist/public/assets/{index-DIcz5ciL.js → index-DEQ2hVPA.js} +1 -1
  39. package/dist/public/assets/index-DEQ2hVPA.js.br +0 -0
  40. package/dist/public/assets/{index-CpM8t743.js → index-DGkgqtgJ.js} +1 -1
  41. package/dist/public/assets/{index-QNLvejKK.js → index-FVHabbDB.js} +1 -1
  42. package/dist/public/assets/{index-CzXMNZL3.js → index-M8jf-YAZ.js} +1 -1
  43. package/dist/public/assets/{index-BxokHznc.js → index-Q0GC8Irj.js} +1 -1
  44. package/dist/public/assets/index-Q0GC8Irj.js.br +0 -0
  45. package/dist/public/assets/{index--6iHQzho.js → index-YVB9ZW00.js} +1 -1
  46. package/dist/public/assets/{index-O_L1tU2b.js → index-mjEeEQcC.js} +1 -1
  47. package/dist/public/assets/index-mjEeEQcC.js.br +0 -0
  48. package/dist/public/assets/{index-BFFsJ47B.js → index-rLkONFpx.js} +1 -1
  49. package/dist/public/assets/{layers-B4zhx14P.js → layers-Dbwq9AyL.js} +1 -1
  50. package/dist/public/assets/{list-checks-Br6imjXC.js → list-checks-og1usOZf.js} +1 -1
  51. package/dist/public/assets/{sparkles-BjIkcbAi.js → sparkles-p-dZbjGb.js} +1 -1
  52. package/dist/public/assets/{triangle-alert-CgKAc3w5.js → triangle-alert-BZVAEUiL.js} +1 -1
  53. package/dist/public/assets/{zap-DFHw5liD.js → zap-BAhZUPPa.js} +1 -1
  54. package/dist/public/index.html +1 -1
  55. package/dist/scripts/acceptance-fixture.test.js +33 -0
  56. package/dist/scripts/dev-capture-smoke.js +76 -0
  57. package/dist/scripts/dev-client-preview-control-smoke.js +606 -0
  58. package/dist/scripts/dev-default-smoke.js +67 -0
  59. package/dist/scripts/dev-game-ready-smoke.js +155 -0
  60. package/dist/scripts/dev-workflow-smoke.js +260 -0
  61. package/dist/scripts/prepare-client-preview-acceptance.js +65 -0
  62. package/dist/scripts/preview-page-server-smoke.js +63 -0
  63. package/dist/scripts/run-ts-test.js +41 -0
  64. package/dist/scripts/verify-agent-contract.js +410 -0
  65. package/dist/scripts/vibe-ppe-test-preload.cjs +23 -0
  66. package/dist/scripts/vibe-upload-demo.js +72 -0
  67. package/dist/scripts/vibe-upload-smoke.js +412 -0
  68. package/dist/scripts/wasm-smoke.js +53 -0
  69. package/dist/scripts/wasm-worker.js +63 -0
  70. package/dist/scripts/worker.js +28 -22
  71. package/package.json +36 -4
  72. package/CHANGELOG.md +0 -277
  73. package/dist/public/assets/Detail-rVxbEDgh.js.br +0 -0
  74. package/dist/public/assets/baseForm-kBTxn8h8.js.br +0 -0
  75. package/dist/public/assets/index-Bjn0ctEd.js.br +0 -0
  76. package/dist/public/assets/index-BxokHznc.js.br +0 -0
  77. package/dist/public/assets/index-Cl0_vMWE.js.br +0 -0
  78. package/dist/public/assets/index-DHdJsD10.js.br +0 -0
  79. package/dist/public/assets/index-DIcz5ciL.js.br +0 -0
  80. package/dist/public/assets/index-O_L1tU2b.js.br +0 -0
  81. package/dist/public/assets/index-aSl6Wdrp.js.br +0 -0
  82. package/dist/public/assets/index-odEI7YQF.js.br +0 -0
@@ -1 +1 @@
1
- import{ai as G,t as X,w as B,aj as z,ak as U,al as _,am as Y,an as q,ao as J,ap as W,aq as Z,ar as H,as as Q,R as a,y as F,z as g,J as s,at as V,M as w,r as ee,a5 as te,_ as $,K as se,au as ne}from"./index-Bjn0ctEd.js";const N={PREFIX:`${X}-dropdown`},O={POSITION_SET:G.POSITION_SET,TRIGGER_SET:["hover","focus","click","custom","contextMenu"],DEFAULT_LEAVE_DELAY:100,ITEM_TYPE:["primary","secondary","tertiary","warning","danger"]},R={SPACING:4,NESTED_SPACING:2};class oe extends B{handleVisibleChange(e){this._adapter.setPopVisible(e),this._adapter.notifyVisibleChange(e);const{trigger:n}=this.getProps();if(e&&n==="click"){const t=this._adapter.getPopupId();this.setFocusToFirstMenuItem(t)}}getMenuItemNodes(e){const n=document.getElementById(e);return n?Array.from(n.getElementsByTagName("li")).filter(t=>t.ariaDisabled==="false"):null}setFocusToFirstMenuItem(e){const n=this.getMenuItemNodes(e);n&&z(n)}setFocusToLastMenuItem(e){const n=this.getMenuItemNodes(e);n&&U(n)}handleKeyDown(e){var n,t;const o=(t=(n=e.target)===null||n===void 0?void 0:n.attributes["data-popupid"])===null||t===void 0?void 0:t.value,{visible:r}=this._adapter.getStates();switch(e.key){case" ":case"Enter":e.target.click();break;case"ArrowDown":this.setFocusToFirstMenuItem(o),r&&_(e);break;case"ArrowUp":this.setFocusToLastMenuItem(o),r&&_(e);break}}}class re extends B{constructor(){super(...arguments),this.menuItemNodes=null,this.firstChars=[]}handleEscape(e){this._adapter.getContext("trigger")==="custom"&&(e&&Y(document.querySelectorAll("[data-popupid]"),e.id)).focus()}setFocusByFirstCharacter(e,n){const t=q(this.menuItemNodes,e,this.firstChars,n);t>=0&&J(this.menuItemNodes,this.menuItemNodes[t])}onMenuKeydown(e){const n=W(e.target,"tooltip");this.menuItemNodes||(this.menuItemNodes=[...e.target.parentNode.getElementsByTagName("li")].filter(o=>o.ariaDisabled!=="true")),this.firstChars.length===0&&this.menuItemNodes.forEach(o=>{var r;this.firstChars.push((r=o.textContent.trim()[0])===null||r===void 0?void 0:r.toLowerCase())});const t=this.menuItemNodes.find(o=>o.tabIndex===0);switch(e.key){case" ":case"Enter":e.target.click();break;case"Escape":this.handleEscape(n);break;case"ArrowUp":Q(this.menuItemNodes,t),_(e);break;case"ArrowDown":H(this.menuItemNodes,t),_(e);break;default:Z(e.key)&&this.setFocusByFirstCharacter(t,e.key);break}}}const E=a.createContext({level:0});var ae=function(i,e){var n={};for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&e.indexOf(t)<0&&(n[t]=i[t]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,t=Object.getOwnPropertySymbols(i);o<t.length;o++)e.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(i,t[o])&&(n[t[o]]=i[t[o]]);return n};const ie=N.PREFIX;class M extends F{constructor(e){super(e),this.foundation=new re(this.adapter)}get adapter(){return Object.assign({},super.adapter)}render(){const e=this.props,{children:n,className:t,style:o}=e,r=ae(e,["children","className","style"]);return a.createElement("ul",Object.assign({role:"menu","aria-orientation":"vertical"},r,{className:g(`${ie}-menu`,t),style:o,onKeyDown:l=>this.foundation.onMenuKeydown(l)}),n)}}M.propTypes={children:s.node,className:s.string,style:s.object};M.contextType=E;const f=N.PREFIX;class x extends F{render(){const{children:e,disabled:n,className:t,forwardRef:o,style:r,type:l,active:u,icon:m,onKeyDown:I,showTick:v,hover:h}=this.props,{showTick:C}=this.context,d=C??v,P=g(t,{[`${f}-item`]:!0,[`${f}-item-disabled`]:n,[`${f}-item-hover`]:h,[`${f}-item-withTick`]:d,[`${f}-item-${l}`]:l,[`${f}-item-active`]:u}),y={};n||["onClick","onMouseEnter","onMouseLeave","onContextMenu"].forEach(p=>{this.context.level!==1&&p==="onClick"?y.onMouseDown=A=>{var j,D;A.button===0&&((D=(j=this.props)[p])===null||D===void 0||D.call(j,A))}:y[p]=this.props[p]});let b=null;switch(!0){case(d&&u):b=a.createElement(V,null);break;case(d&&!u):b=a.createElement(V,{style:{color:"transparent"}});break;default:b=null;break}let T=null;return m&&(T=a.createElement("div",{className:`${f}-item-icon`},m)),a.createElement("li",Object.assign({role:"menuitem",tabIndex:-1,"aria-disabled":n},y,{onKeyDown:I,ref:p=>o(p),className:P,style:r},this.getDataAttr(this.props)),b,T,e)}}x.propTypes={children:s.oneOfType([s.string,s.node]),name:s.string,disabled:s.bool,selected:s.bool,onClick:s.func,onMouseEnter:s.func,onMouseLeave:s.func,onContextMenu:s.func,className:s.string,style:s.object,forwardRef:s.func,type:s.oneOf(O.ITEM_TYPE),active:s.bool,icon:s.node};x.contextType=E;x.defaultProps={disabled:!1,divided:!1,selected:!1,onMouseEnter:w,onMouseLeave:w,forwardRef:w};x.elementType="Dropdown.Item";const le=N.PREFIX,K=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{style:e,className:n}=i;return a.createElement("div",{className:g(`${le}-divider`,n),style:e})};K.propTypes={style:s.object,className:s.string};const L=N.PREFIX;class S extends ee.PureComponent{render(){const{className:e,style:n,children:t}=this.props,{showTick:o}=this.context,r=g({[`${L}-title`]:!0,[`${L}-title-withTick`]:o},e);return a.createElement("div",{className:r,style:n},t)}}S.propTypes={children:s.node,className:s.string,style:s.object};S.contextType=E;var k=function(i,e){var n={};for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&e.indexOf(t)<0&&(n[t]=i[t]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,t=Object.getOwnPropertySymbols(i);o<t.length;o++)e.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(i,t[o])&&(n[t[o]]=i[t[o]]);return n};const ce=O.POSITION_SET,ue=O.TRIGGER_SET;class c extends F{constructor(e){super(e),this.handleVisibleChange=n=>this.foundation.handleVisibleChange(n),this.state={popVisible:e.visible},this.foundation=new oe(this.adapter),this.tooltipRef=a.createRef()}get adapter(){return Object.assign(Object.assign({},super.adapter),{setPopVisible:e=>this.setState({popVisible:e}),notifyVisibleChange:e=>{var n,t;return(t=(n=this.props).onVisibleChange)===null||t===void 0?void 0:t.call(n,e)},getPopupId:()=>this.tooltipRef.current.getPopupId()})}renderContent(){const{render:e,menu:n,contentClassName:t,style:o,showTick:r,prefixCls:l,trigger:u}=this.props,m=g(l,t),{level:I=0}=this.context,v={showTick:r,level:I+1,trigger:u};let h=null;return a.isValidElement(e)?h=e:Array.isArray(n)&&(h=this.renderMenu()),a.createElement(E.Provider,{value:v},a.createElement("div",{className:m,style:o},a.createElement("div",{className:`${l}-content`,"x-semi-prop":"render"},h)))}renderMenu(){const{menu:e}=this.props,n=e.map((t,o)=>{switch(t.node){case"title":{const{name:r,node:l}=t,u=k(t,["name","node"]);return a.createElement(c.Title,Object.assign({},u,{key:l+r+o}),r)}case"item":{const{node:r,name:l}=t,u=k(t,["node","name"]);return a.createElement(c.Item,Object.assign({},u,{key:r+l+o}),l)}case"divider":return a.createElement(c.Divider,{key:t.node+o});default:return null}});return a.createElement(c.Menu,null,n)}renderPopCard(){const{render:e,contentClassName:n,style:t,showTick:o,prefixCls:r}=this.props,l=g(r,n),{level:u=0}=this.context,m={showTick:o,level:u+1};return a.createElement(E.Provider,{value:m},a.createElement("div",{className:l,style:t},a.createElement("div",{className:`${r}-content`},e)))}render(){const e=this.props,{children:n,position:t,trigger:o,onVisibleChange:r,zIndex:l,className:u,motion:m,margin:I,style:v,prefixCls:h}=e,C=k(e,["children","position","trigger","onVisibleChange","zIndex","className","motion","margin","style","prefixCls"]);let{spacing:d}=this.props;const{level:P}=this.context,{popVisible:y}=this.state,b=this.renderContent();return P>0?d=typeof d=="number"?d:R.NESTED_SPACING:(d===null||typeof d>"u")&&(d=R.SPACING),a.createElement(te,Object.assign({zIndex:l,motion:m,margin:I,content:b,className:u,prefixCls:h,spacing:d,position:t,trigger:o,onVisibleChange:this.handleVisibleChange,showArrow:!1,returnFocusOnClose:!0,ref:this.tooltipRef},C),a.isValidElement(n)?a.cloneElement(n,{className:g($(n,"props.className"),{[`${h}-showing`]:y}),"aria-haspopup":!0,"aria-expanded":y,onKeyDown:T=>{this.foundation.handleKeyDown(T);const p=$(n,"props.onKeyDown");p&&p(T)}}):n)}}c.Menu=M;c.Item=x;c.Divider=K;c.Title=S;c.contextType=E;c.propTypes={children:s.node,contentClassName:s.oneOfType([s.string,s.array]),className:s.string,getPopupContainer:s.func,margin:s.oneOfType([s.number,s.object]),mouseEnterDelay:s.number,mouseLeaveDelay:s.number,menu:s.array,motion:s.oneOfType([s.bool,s.func,s.object]),onVisibleChange:s.func,prefixCls:s.string,position:s.oneOf(ce),rePosKey:s.oneOfType([s.string,s.number]),render:s.node,spacing:s.oneOfType([s.number,s.object]),showTick:s.bool,style:s.object,trigger:s.oneOf(ue),visible:s.bool,zIndex:s.number};c.__SemiComponentName__="Dropdown";c.defaultProps=se(c.__SemiComponentName__,{onVisibleChange:w,prefixCls:N.PREFIX,zIndex:ne.DEFAULT_Z_INDEX,motion:!0,trigger:"hover",position:"bottom",mouseLeaveDelay:O.DEFAULT_LEAVE_DELAY,showTick:!1,closeOnEsc:!0,onEscKeyDown:w});export{c as D};
1
+ import{ai as G,t as X,w as B,aj as z,ak as U,al as _,am as Y,an as q,ao as J,ap as W,aq as Z,ar as H,as as Q,R as a,y as F,z as g,J as s,at as V,M as w,r as ee,a5 as te,_ as $,K as se,au as ne}from"./index-BegU9LBT.js";const N={PREFIX:`${X}-dropdown`},O={POSITION_SET:G.POSITION_SET,TRIGGER_SET:["hover","focus","click","custom","contextMenu"],DEFAULT_LEAVE_DELAY:100,ITEM_TYPE:["primary","secondary","tertiary","warning","danger"]},R={SPACING:4,NESTED_SPACING:2};class oe extends B{handleVisibleChange(e){this._adapter.setPopVisible(e),this._adapter.notifyVisibleChange(e);const{trigger:n}=this.getProps();if(e&&n==="click"){const t=this._adapter.getPopupId();this.setFocusToFirstMenuItem(t)}}getMenuItemNodes(e){const n=document.getElementById(e);return n?Array.from(n.getElementsByTagName("li")).filter(t=>t.ariaDisabled==="false"):null}setFocusToFirstMenuItem(e){const n=this.getMenuItemNodes(e);n&&z(n)}setFocusToLastMenuItem(e){const n=this.getMenuItemNodes(e);n&&U(n)}handleKeyDown(e){var n,t;const o=(t=(n=e.target)===null||n===void 0?void 0:n.attributes["data-popupid"])===null||t===void 0?void 0:t.value,{visible:r}=this._adapter.getStates();switch(e.key){case" ":case"Enter":e.target.click();break;case"ArrowDown":this.setFocusToFirstMenuItem(o),r&&_(e);break;case"ArrowUp":this.setFocusToLastMenuItem(o),r&&_(e);break}}}class re extends B{constructor(){super(...arguments),this.menuItemNodes=null,this.firstChars=[]}handleEscape(e){this._adapter.getContext("trigger")==="custom"&&(e&&Y(document.querySelectorAll("[data-popupid]"),e.id)).focus()}setFocusByFirstCharacter(e,n){const t=q(this.menuItemNodes,e,this.firstChars,n);t>=0&&J(this.menuItemNodes,this.menuItemNodes[t])}onMenuKeydown(e){const n=W(e.target,"tooltip");this.menuItemNodes||(this.menuItemNodes=[...e.target.parentNode.getElementsByTagName("li")].filter(o=>o.ariaDisabled!=="true")),this.firstChars.length===0&&this.menuItemNodes.forEach(o=>{var r;this.firstChars.push((r=o.textContent.trim()[0])===null||r===void 0?void 0:r.toLowerCase())});const t=this.menuItemNodes.find(o=>o.tabIndex===0);switch(e.key){case" ":case"Enter":e.target.click();break;case"Escape":this.handleEscape(n);break;case"ArrowUp":Q(this.menuItemNodes,t),_(e);break;case"ArrowDown":H(this.menuItemNodes,t),_(e);break;default:Z(e.key)&&this.setFocusByFirstCharacter(t,e.key);break}}}const E=a.createContext({level:0});var ae=function(i,e){var n={};for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&e.indexOf(t)<0&&(n[t]=i[t]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,t=Object.getOwnPropertySymbols(i);o<t.length;o++)e.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(i,t[o])&&(n[t[o]]=i[t[o]]);return n};const ie=N.PREFIX;class M extends F{constructor(e){super(e),this.foundation=new re(this.adapter)}get adapter(){return Object.assign({},super.adapter)}render(){const e=this.props,{children:n,className:t,style:o}=e,r=ae(e,["children","className","style"]);return a.createElement("ul",Object.assign({role:"menu","aria-orientation":"vertical"},r,{className:g(`${ie}-menu`,t),style:o,onKeyDown:l=>this.foundation.onMenuKeydown(l)}),n)}}M.propTypes={children:s.node,className:s.string,style:s.object};M.contextType=E;const f=N.PREFIX;class x extends F{render(){const{children:e,disabled:n,className:t,forwardRef:o,style:r,type:l,active:u,icon:m,onKeyDown:I,showTick:v,hover:h}=this.props,{showTick:C}=this.context,d=C??v,P=g(t,{[`${f}-item`]:!0,[`${f}-item-disabled`]:n,[`${f}-item-hover`]:h,[`${f}-item-withTick`]:d,[`${f}-item-${l}`]:l,[`${f}-item-active`]:u}),y={};n||["onClick","onMouseEnter","onMouseLeave","onContextMenu"].forEach(p=>{this.context.level!==1&&p==="onClick"?y.onMouseDown=A=>{var j,D;A.button===0&&((D=(j=this.props)[p])===null||D===void 0||D.call(j,A))}:y[p]=this.props[p]});let b=null;switch(!0){case(d&&u):b=a.createElement(V,null);break;case(d&&!u):b=a.createElement(V,{style:{color:"transparent"}});break;default:b=null;break}let T=null;return m&&(T=a.createElement("div",{className:`${f}-item-icon`},m)),a.createElement("li",Object.assign({role:"menuitem",tabIndex:-1,"aria-disabled":n},y,{onKeyDown:I,ref:p=>o(p),className:P,style:r},this.getDataAttr(this.props)),b,T,e)}}x.propTypes={children:s.oneOfType([s.string,s.node]),name:s.string,disabled:s.bool,selected:s.bool,onClick:s.func,onMouseEnter:s.func,onMouseLeave:s.func,onContextMenu:s.func,className:s.string,style:s.object,forwardRef:s.func,type:s.oneOf(O.ITEM_TYPE),active:s.bool,icon:s.node};x.contextType=E;x.defaultProps={disabled:!1,divided:!1,selected:!1,onMouseEnter:w,onMouseLeave:w,forwardRef:w};x.elementType="Dropdown.Item";const le=N.PREFIX,K=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{style:e,className:n}=i;return a.createElement("div",{className:g(`${le}-divider`,n),style:e})};K.propTypes={style:s.object,className:s.string};const L=N.PREFIX;class S extends ee.PureComponent{render(){const{className:e,style:n,children:t}=this.props,{showTick:o}=this.context,r=g({[`${L}-title`]:!0,[`${L}-title-withTick`]:o},e);return a.createElement("div",{className:r,style:n},t)}}S.propTypes={children:s.node,className:s.string,style:s.object};S.contextType=E;var k=function(i,e){var n={};for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&e.indexOf(t)<0&&(n[t]=i[t]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,t=Object.getOwnPropertySymbols(i);o<t.length;o++)e.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(i,t[o])&&(n[t[o]]=i[t[o]]);return n};const ce=O.POSITION_SET,ue=O.TRIGGER_SET;class c extends F{constructor(e){super(e),this.handleVisibleChange=n=>this.foundation.handleVisibleChange(n),this.state={popVisible:e.visible},this.foundation=new oe(this.adapter),this.tooltipRef=a.createRef()}get adapter(){return Object.assign(Object.assign({},super.adapter),{setPopVisible:e=>this.setState({popVisible:e}),notifyVisibleChange:e=>{var n,t;return(t=(n=this.props).onVisibleChange)===null||t===void 0?void 0:t.call(n,e)},getPopupId:()=>this.tooltipRef.current.getPopupId()})}renderContent(){const{render:e,menu:n,contentClassName:t,style:o,showTick:r,prefixCls:l,trigger:u}=this.props,m=g(l,t),{level:I=0}=this.context,v={showTick:r,level:I+1,trigger:u};let h=null;return a.isValidElement(e)?h=e:Array.isArray(n)&&(h=this.renderMenu()),a.createElement(E.Provider,{value:v},a.createElement("div",{className:m,style:o},a.createElement("div",{className:`${l}-content`,"x-semi-prop":"render"},h)))}renderMenu(){const{menu:e}=this.props,n=e.map((t,o)=>{switch(t.node){case"title":{const{name:r,node:l}=t,u=k(t,["name","node"]);return a.createElement(c.Title,Object.assign({},u,{key:l+r+o}),r)}case"item":{const{node:r,name:l}=t,u=k(t,["node","name"]);return a.createElement(c.Item,Object.assign({},u,{key:r+l+o}),l)}case"divider":return a.createElement(c.Divider,{key:t.node+o});default:return null}});return a.createElement(c.Menu,null,n)}renderPopCard(){const{render:e,contentClassName:n,style:t,showTick:o,prefixCls:r}=this.props,l=g(r,n),{level:u=0}=this.context,m={showTick:o,level:u+1};return a.createElement(E.Provider,{value:m},a.createElement("div",{className:l,style:t},a.createElement("div",{className:`${r}-content`},e)))}render(){const e=this.props,{children:n,position:t,trigger:o,onVisibleChange:r,zIndex:l,className:u,motion:m,margin:I,style:v,prefixCls:h}=e,C=k(e,["children","position","trigger","onVisibleChange","zIndex","className","motion","margin","style","prefixCls"]);let{spacing:d}=this.props;const{level:P}=this.context,{popVisible:y}=this.state,b=this.renderContent();return P>0?d=typeof d=="number"?d:R.NESTED_SPACING:(d===null||typeof d>"u")&&(d=R.SPACING),a.createElement(te,Object.assign({zIndex:l,motion:m,margin:I,content:b,className:u,prefixCls:h,spacing:d,position:t,trigger:o,onVisibleChange:this.handleVisibleChange,showArrow:!1,returnFocusOnClose:!0,ref:this.tooltipRef},C),a.isValidElement(n)?a.cloneElement(n,{className:g($(n,"props.className"),{[`${h}-showing`]:y}),"aria-haspopup":!0,"aria-expanded":y,onKeyDown:T=>{this.foundation.handleKeyDown(T);const p=$(n,"props.onKeyDown");p&&p(T)}}):n)}}c.Menu=M;c.Item=x;c.Divider=K;c.Title=S;c.contextType=E;c.propTypes={children:s.node,contentClassName:s.oneOfType([s.string,s.array]),className:s.string,getPopupContainer:s.func,margin:s.oneOfType([s.number,s.object]),mouseEnterDelay:s.number,mouseLeaveDelay:s.number,menu:s.array,motion:s.oneOfType([s.bool,s.func,s.object]),onVisibleChange:s.func,prefixCls:s.string,position:s.oneOf(ce),rePosKey:s.oneOfType([s.string,s.number]),render:s.node,spacing:s.oneOfType([s.number,s.object]),showTick:s.bool,style:s.object,trigger:s.oneOf(ue),visible:s.bool,zIndex:s.number};c.__SemiComponentName__="Dropdown";c.defaultProps=se(c.__SemiComponentName__,{onVisibleChange:w,prefixCls:N.PREFIX,zIndex:ne.DEFAULT_Z_INDEX,motion:!0,trigger:"hover",position:"bottom",mouseLeaveDelay:O.DEFAULT_LEAVE_DELAY,showTick:!1,closeOnEsc:!0,onEscKeyDown:w});export{c as D};
@@ -1 +1 @@
1
- import{j as e,T as o,i as c,I as s}from"./index-Bjn0ctEd.js";import{D as i}from"./index-1WjGwqIV.js";const t=[{node:"item",name:c("quickStart"),link:"https://bytedance.sg.larkoffice.com/docx/MarqdNvQLoihvjxN4rFllgjBgwb"},{node:"item",name:c("jsApiList"),link:"https://bytedance.larkoffice.com/wiki/GQscwDOQSiPxyjkbzyfckh2pnDg"},{node:"item",name:c("advancedGuide"),link:"https://bytedance.larkoffice.com/wiki/AGqRwu0qQiXZpVkkToUcRP99nwc"},{node:"item",name:c("faq"),link:"https://bytedance.larkoffice.com/wiki/O6aWwFhDBiEglwkcnJ4ccJpdnmb"}],d=()=>e.jsx(i,{trigger:"hover",position:"bottomRight",render:e.jsx(e.Fragment,{children:t.map(n=>e.jsx(i.Item,{onClick:()=>{window.open(n.link)},children:n.name},n.name))}),children:e.jsxs("div",{className:"access-docs tt-header-chip",role:"button",tabIndex:0,children:[e.jsx(o.Text,{className:"access-docs-text",type:"primary",children:c("docs")}),e.jsx(s,{className:"access-docs-icon"})]})});export{d as AccessDocs};
1
+ import{j as e,T as o,i as c,I as s}from"./index-BegU9LBT.js";import{D as i}from"./index-BqwflQml.js";const t=[{node:"item",name:c("quickStart"),link:"https://bytedance.sg.larkoffice.com/docx/MarqdNvQLoihvjxN4rFllgjBgwb"},{node:"item",name:c("jsApiList"),link:"https://bytedance.larkoffice.com/wiki/GQscwDOQSiPxyjkbzyfckh2pnDg"},{node:"item",name:c("advancedGuide"),link:"https://bytedance.larkoffice.com/wiki/AGqRwu0qQiXZpVkkToUcRP99nwc"},{node:"item",name:c("faq"),link:"https://bytedance.larkoffice.com/wiki/O6aWwFhDBiEglwkcnJ4ccJpdnmb"}],d=()=>e.jsx(i,{trigger:"hover",position:"bottomRight",render:e.jsx(e.Fragment,{children:t.map(n=>e.jsx(i.Item,{onClick:()=>{window.open(n.link)},children:n.name},n.name))}),children:e.jsxs("div",{className:"access-docs tt-header-chip",role:"button",tabIndex:0,children:[e.jsx(o.Text,{className:"access-docs-text",type:"primary",children:c("docs")}),e.jsx(s,{className:"access-docs-icon"})]})});export{d as AccessDocs};
@@ -1 +1 @@
1
- import{t as P,w as N,x as O,_ as p,y as T,z as E,R as i,B as v,E as V,F as L,L as R,G as k,p as I,H as B,J as n,K as j,M as C,O as w}from"./index-Bjn0ctEd.js";const S={PREFIX:`${P}-popconfirm`,POPOVER:`${P}-popconfirm-popover`},$={DEFAULT_Z_INDEX:1030};class D extends N{init(){}destroy(){}handleCancel(e){const t=this._adapter.notifyCancel(e);O(t)?(this._adapter.updateCancelLoading(!0),t.then(o=>{this.handleVisibleChange(!1),this._adapter.updateCancelLoading(!1)},o=>{this._adapter.updateCancelLoading(!1)})):this.handleVisibleChange(!1)}handleConfirm(e){const t=this._adapter.notifyConfirm(e);O(t)?(this._adapter.updateConfirmLoading(!0),t.then(o=>{this._adapter.updateConfirmLoading(!1),this.handleVisibleChange(!1)},o=>{this._adapter.updateConfirmLoading(!1)})):this.handleVisibleChange(!1)}handleClickOutSide(e){this._adapter.notifyClickOutSide(e)}handleVisibleChange(e){this._isControlledComponent("visible")||this._adapter.setVisible(e),e?this.handleFocusOperateButton():this._adapter.focusPrevFocusElement(),this._adapter.notifyVisibleChange(e)}handleFocusOperateButton(){const{cancelButtonProps:e,okButtonProps:t}=this._adapter.getProps();p(e,"autoFocus")&&!p(e,"disabled")?this._adapter.focusCancelButton():p(t,"autoFocus")&&!p(t,"disabled")&&this._adapter.focusOkButton()}}var z=function(l,e){var t={};for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&e.indexOf(o)<0&&(t[o]=l[o]);if(l!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(l);s<o.length;s++)e.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(l,o[s])&&(t[o[s]]=l[o[s]]);return t};class f extends T{constructor(e){super(e),this.handleCancel=t=>this.foundation.handleCancel(t&&t.nativeEvent),this.handleConfirm=t=>this.foundation.handleConfirm(t&&t.nativeEvent),this.handleVisibleChange=t=>this.foundation.handleVisibleChange(t),this.handleClickOutSide=t=>this.foundation.handleClickOutSide(t),this.stopImmediatePropagation=t=>t&&t.nativeEvent&&t.nativeEvent.stopImmediatePropagation(),this.renderConfirmPopCard=t=>{let{initialFocusRef:o}=t;const{content:s,title:c,className:u,style:d,cancelType:h,icon:r,prefixCls:a,showCloseIcon:b}=this.props,{direction:m}=this.context,g=E(a,u,{[`${a}-rtl`]:m==="rtl"}),y=c!==null&&typeof c<"u",x=!(s===null||typeof s>"u"),_=i.isValidElement(r),F=E({[`${a}-body`]:!0,[`${a}-body-withIcon`]:_});return i.createElement("div",{className:g,onClick:this.stopImmediatePropagation,style:d},i.createElement("div",{className:`${a}-inner`},i.createElement("div",{className:`${a}-header`},_?i.createElement("i",{className:`${a}-header-icon`,"x-semi-prop":"icon"},r):null,i.createElement("div",{className:`${a}-header-body`},y?i.createElement("div",{className:`${a}-header-title`,"x-semi-prop":"title"},c):null),b?i.createElement(v,{className:`${a}-btn-close`,icon:i.createElement(V,null),size:"small",theme:"borderless",type:h,onClick:this.handleCancel}):null),x?i.createElement("div",{className:F,"x-semi-prop":"content"},L(s)?s({initialFocusRef:o}):s):null,i.createElement("div",{className:`${a}-footer`,ref:this.footerRef},this.renderControls())))},this.state={cancelLoading:!1,confirmLoading:!1,visible:e.defaultVisible||!1},this.foundation=new D(this.adapter),this.footerRef=i.createRef(),this.popoverRef=i.createRef()}static getDerivedStateFromProps(e,t){const o={},{hasOwnProperty:s}=Object.prototype;return s.call(e,"visible")&&(o.visible=e.visible),o}get adapter(){return Object.assign(Object.assign({},super.adapter),{setVisible:e=>this.setState({visible:e}),updateConfirmLoading:e=>this.setState({confirmLoading:e}),updateCancelLoading:e=>this.setState({cancelLoading:e}),notifyConfirm:e=>this.props.onConfirm(e),notifyCancel:e=>this.props.onCancel(e),notifyVisibleChange:e=>this.props.onVisibleChange(e),notifyClickOutSide:e=>this.props.onClickOutSide(e),focusCancelButton:()=>{var e,t;const o=(t=(e=this.footerRef)===null||e===void 0?void 0:e.current)===null||t===void 0?void 0:t.querySelector("[data-type=cancel]");o?.focus({preventScroll:!0})},focusOkButton:()=>{var e,t;const o=(t=(e=this.footerRef)===null||e===void 0?void 0:e.current)===null||t===void 0?void 0:t.querySelector("[data-type=ok]");o?.focus({preventScroll:!0})},focusPrevFocusElement:()=>{var e;(e=this.popoverRef.current)===null||e===void 0||e.focusTrigger()}})}renderControls(){const{okText:e,cancelText:t,okType:o,cancelType:s,cancelButtonProps:c,okButtonProps:u}=this.props,{cancelLoading:d,confirmLoading:h}=this.state;return i.createElement(R,{componentName:"Popconfirm"},(r,a)=>i.createElement(i.Fragment,null,i.createElement(v,Object.assign({"data-type":"cancel",type:s,onClick:this.handleCancel,loading:d},k(c,"autoFocus")),t||p(r,"cancel")),i.createElement(v,Object.assign({"data-type":"ok",type:o,theme:"solid",onClick:this.handleConfirm,loading:h},k(u,"autoFocus")),e||p(r,"confirm"))))}render(){const{direction:e}=this.context,t=e==="rtl"?"bottomRight":"bottomLeft",o=this.props,{className:s,prefixCls:c,disabled:u,children:d,style:h,position:r=t}=o,a=z(o,["className","prefixCls","disabled","children","style","position"]);if(u)return d;const{visible:b}=this.state,m={onVisibleChange:this.handleVisibleChange,className:S.POPOVER,onClickOutSide:this.handleClickOutSide};return this.isControlled("visible")&&(m.trigger="custom"),i.createElement(I,Object.assign({ref:this.popoverRef},a,{content:g=>{let{initialFocusRef:y}=g;return this.renderConfirmPopCard({initialFocusRef:y})},visible:b,position:r},m),d)}}f.contextType=B;f.propTypes={motion:n.oneOfType([n.bool,n.func,n.object]),disabled:n.bool,content:n.oneOfType([n.node,n.func]),title:n.any,prefixCls:n.string,className:n.string,style:n.object,icon:n.node,okText:n.string,okType:n.string,cancelText:n.string,cancelType:n.string,onCancel:n.func,onConfirm:n.func,onClickOutSide:n.func,onVisibleChange:n.func,visible:n.bool,defaultVisible:n.bool,okButtonProps:n.object,cancelButtonProps:n.object,stopPropagation:n.oneOfType([n.bool,n.string]),showCloseIcon:n.bool,zIndex:n.number,trigger:n.string,position:n.string};f.__SemiComponentName__="Popconfirm";f.defaultProps=j(f.__SemiComponentName__,{stopPropagation:!0,trigger:"click",onVisibleChange:C,disabled:!1,icon:i.createElement(w,{size:"extra-large"}),okType:"primary",cancelType:"tertiary",prefixCls:S.PREFIX,zIndex:$.DEFAULT_Z_INDEX,showCloseIcon:!0,onCancel:C,onConfirm:C,onClickOutSide:C});export{f as P};
1
+ import{t as P,w as N,x as O,_ as p,y as T,z as E,R as i,B as v,E as V,F as L,L as R,G as k,p as I,H as B,J as n,K as j,M as C,O as w}from"./index-BegU9LBT.js";const S={PREFIX:`${P}-popconfirm`,POPOVER:`${P}-popconfirm-popover`},$={DEFAULT_Z_INDEX:1030};class D extends N{init(){}destroy(){}handleCancel(e){const t=this._adapter.notifyCancel(e);O(t)?(this._adapter.updateCancelLoading(!0),t.then(o=>{this.handleVisibleChange(!1),this._adapter.updateCancelLoading(!1)},o=>{this._adapter.updateCancelLoading(!1)})):this.handleVisibleChange(!1)}handleConfirm(e){const t=this._adapter.notifyConfirm(e);O(t)?(this._adapter.updateConfirmLoading(!0),t.then(o=>{this._adapter.updateConfirmLoading(!1),this.handleVisibleChange(!1)},o=>{this._adapter.updateConfirmLoading(!1)})):this.handleVisibleChange(!1)}handleClickOutSide(e){this._adapter.notifyClickOutSide(e)}handleVisibleChange(e){this._isControlledComponent("visible")||this._adapter.setVisible(e),e?this.handleFocusOperateButton():this._adapter.focusPrevFocusElement(),this._adapter.notifyVisibleChange(e)}handleFocusOperateButton(){const{cancelButtonProps:e,okButtonProps:t}=this._adapter.getProps();p(e,"autoFocus")&&!p(e,"disabled")?this._adapter.focusCancelButton():p(t,"autoFocus")&&!p(t,"disabled")&&this._adapter.focusOkButton()}}var z=function(l,e){var t={};for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&e.indexOf(o)<0&&(t[o]=l[o]);if(l!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(l);s<o.length;s++)e.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(l,o[s])&&(t[o[s]]=l[o[s]]);return t};class f extends T{constructor(e){super(e),this.handleCancel=t=>this.foundation.handleCancel(t&&t.nativeEvent),this.handleConfirm=t=>this.foundation.handleConfirm(t&&t.nativeEvent),this.handleVisibleChange=t=>this.foundation.handleVisibleChange(t),this.handleClickOutSide=t=>this.foundation.handleClickOutSide(t),this.stopImmediatePropagation=t=>t&&t.nativeEvent&&t.nativeEvent.stopImmediatePropagation(),this.renderConfirmPopCard=t=>{let{initialFocusRef:o}=t;const{content:s,title:c,className:u,style:d,cancelType:h,icon:r,prefixCls:a,showCloseIcon:b}=this.props,{direction:m}=this.context,g=E(a,u,{[`${a}-rtl`]:m==="rtl"}),y=c!==null&&typeof c<"u",x=!(s===null||typeof s>"u"),_=i.isValidElement(r),F=E({[`${a}-body`]:!0,[`${a}-body-withIcon`]:_});return i.createElement("div",{className:g,onClick:this.stopImmediatePropagation,style:d},i.createElement("div",{className:`${a}-inner`},i.createElement("div",{className:`${a}-header`},_?i.createElement("i",{className:`${a}-header-icon`,"x-semi-prop":"icon"},r):null,i.createElement("div",{className:`${a}-header-body`},y?i.createElement("div",{className:`${a}-header-title`,"x-semi-prop":"title"},c):null),b?i.createElement(v,{className:`${a}-btn-close`,icon:i.createElement(V,null),size:"small",theme:"borderless",type:h,onClick:this.handleCancel}):null),x?i.createElement("div",{className:F,"x-semi-prop":"content"},L(s)?s({initialFocusRef:o}):s):null,i.createElement("div",{className:`${a}-footer`,ref:this.footerRef},this.renderControls())))},this.state={cancelLoading:!1,confirmLoading:!1,visible:e.defaultVisible||!1},this.foundation=new D(this.adapter),this.footerRef=i.createRef(),this.popoverRef=i.createRef()}static getDerivedStateFromProps(e,t){const o={},{hasOwnProperty:s}=Object.prototype;return s.call(e,"visible")&&(o.visible=e.visible),o}get adapter(){return Object.assign(Object.assign({},super.adapter),{setVisible:e=>this.setState({visible:e}),updateConfirmLoading:e=>this.setState({confirmLoading:e}),updateCancelLoading:e=>this.setState({cancelLoading:e}),notifyConfirm:e=>this.props.onConfirm(e),notifyCancel:e=>this.props.onCancel(e),notifyVisibleChange:e=>this.props.onVisibleChange(e),notifyClickOutSide:e=>this.props.onClickOutSide(e),focusCancelButton:()=>{var e,t;const o=(t=(e=this.footerRef)===null||e===void 0?void 0:e.current)===null||t===void 0?void 0:t.querySelector("[data-type=cancel]");o?.focus({preventScroll:!0})},focusOkButton:()=>{var e,t;const o=(t=(e=this.footerRef)===null||e===void 0?void 0:e.current)===null||t===void 0?void 0:t.querySelector("[data-type=ok]");o?.focus({preventScroll:!0})},focusPrevFocusElement:()=>{var e;(e=this.popoverRef.current)===null||e===void 0||e.focusTrigger()}})}renderControls(){const{okText:e,cancelText:t,okType:o,cancelType:s,cancelButtonProps:c,okButtonProps:u}=this.props,{cancelLoading:d,confirmLoading:h}=this.state;return i.createElement(R,{componentName:"Popconfirm"},(r,a)=>i.createElement(i.Fragment,null,i.createElement(v,Object.assign({"data-type":"cancel",type:s,onClick:this.handleCancel,loading:d},k(c,"autoFocus")),t||p(r,"cancel")),i.createElement(v,Object.assign({"data-type":"ok",type:o,theme:"solid",onClick:this.handleConfirm,loading:h},k(u,"autoFocus")),e||p(r,"confirm"))))}render(){const{direction:e}=this.context,t=e==="rtl"?"bottomRight":"bottomLeft",o=this.props,{className:s,prefixCls:c,disabled:u,children:d,style:h,position:r=t}=o,a=z(o,["className","prefixCls","disabled","children","style","position"]);if(u)return d;const{visible:b}=this.state,m={onVisibleChange:this.handleVisibleChange,className:S.POPOVER,onClickOutSide:this.handleClickOutSide};return this.isControlled("visible")&&(m.trigger="custom"),i.createElement(I,Object.assign({ref:this.popoverRef},a,{content:g=>{let{initialFocusRef:y}=g;return this.renderConfirmPopCard({initialFocusRef:y})},visible:b,position:r},m),d)}}f.contextType=B;f.propTypes={motion:n.oneOfType([n.bool,n.func,n.object]),disabled:n.bool,content:n.oneOfType([n.node,n.func]),title:n.any,prefixCls:n.string,className:n.string,style:n.object,icon:n.node,okText:n.string,okType:n.string,cancelText:n.string,cancelType:n.string,onCancel:n.func,onConfirm:n.func,onClickOutSide:n.func,onVisibleChange:n.func,visible:n.bool,defaultVisible:n.bool,okButtonProps:n.object,cancelButtonProps:n.object,stopPropagation:n.oneOfType([n.bool,n.string]),showCloseIcon:n.bool,zIndex:n.number,trigger:n.string,position:n.string};f.__SemiComponentName__="Popconfirm";f.defaultProps=j(f.__SemiComponentName__,{stopPropagation:!0,trigger:"click",onVisibleChange:C,disabled:!1,icon:i.createElement(w,{size:"extra-large"}),okType:"primary",cancelType:"tertiary",prefixCls:S.PREFIX,zIndex:$.DEFAULT_Z_INDEX,showCloseIcon:!0,onCancel:C,onConfirm:C,onClickOutSide:C});export{f as P};
@@ -1 +1 @@
1
- import{h as i,i as r,X as n,Y as o,j as e,P as d,b as p}from"./index-Bjn0ctEd.js";import{C as m}from"./Card-BAsimNoh.js";import{Z as f}from"./zap-DFHw5liD.js";import{L as h,C as u}from"./layers-B4zhx14P.js";const N=()=>{const t=i(),l=[{key:"wasm_split",title:r("performance.card.wasmSplit.title"),description:r("performance.card.wasmSplit.desc"),icon:f,path:"/wasm_split",tags:[{label:"Unity",tone:"info"},{label:"Wasm",tone:"neutral"}]},{key:"subpackage_collect",title:r("performance.card.subpackageCollect.title"),description:r("performance.card.subpackageCollect.desc"),icon:h,path:"/subpackage_collect",tags:[{label:r("performance.card.subpackageCollect.status"),tone:"info"},{label:"FP/TTI",tone:"accent"},{label:"Preload",tone:"neutral"}]}].filter(a=>!(a.experimentOnly&&!n()||a.localDevOnly&&!o()));return e.jsxs("div",{className:"perf-page",children:[e.jsx(d,{title:r("performance.overview.title"),subtitle:r("performance.overview.desc")}),e.jsx("section",{className:"perf-section",children:e.jsx("div",{className:"perf-tool-grid",children:l.map(a=>{const c=a.icon;return e.jsxs(m,{interactive:!0,padding:"md",className:"perf-tool-card",onClick:()=>t(a.path),role:"button",tabIndex:0,children:[e.jsxs("div",{className:"perf-tool-card-head",children:[e.jsx("span",{className:"perf-tool-card-glyph","aria-hidden":"true",children:e.jsx(c,{size:18,strokeWidth:1.75})}),e.jsx("div",{className:"perf-tool-card-titlewrap",children:e.jsxs("div",{className:"perf-tool-card-title-row",children:[e.jsx("h3",{className:"perf-tool-card-title",children:a.title}),a.tags.map(s=>e.jsx(p,{tone:s.tone??"neutral",size:"sm",variant:"outline",children:s.label},s.label))]})}),e.jsx("span",{className:"perf-tool-card-chevron","aria-hidden":"true",children:e.jsx(u,{size:16,strokeWidth:2})})]}),e.jsx("p",{className:"perf-tool-card-desc",children:a.description})]},a.key)})})})]})};export{N as Performance};
1
+ import{h as i,i as r,X as n,Y as o,j as e,P as d,b as p}from"./index-BegU9LBT.js";import{C as m}from"./Card-CN2lxY0Y.js";import{Z as f}from"./zap-BAhZUPPa.js";import{L as h,C as u}from"./layers-Dbwq9AyL.js";const N=()=>{const t=i(),l=[{key:"wasm_split",title:r("performance.card.wasmSplit.title"),description:r("performance.card.wasmSplit.desc"),icon:f,path:"/wasm_split",tags:[{label:"Unity",tone:"info"},{label:"Wasm",tone:"neutral"}]},{key:"subpackage_collect",title:r("performance.card.subpackageCollect.title"),description:r("performance.card.subpackageCollect.desc"),icon:h,path:"/subpackage_collect",tags:[{label:r("performance.card.subpackageCollect.status"),tone:"info"},{label:"FP/TTI",tone:"accent"},{label:"Preload",tone:"neutral"}]}].filter(a=>!(a.experimentOnly&&!n()||a.localDevOnly&&!o()));return e.jsxs("div",{className:"perf-page",children:[e.jsx(d,{title:r("performance.overview.title"),subtitle:r("performance.overview.desc")}),e.jsx("section",{className:"perf-section",children:e.jsx("div",{className:"perf-tool-grid",children:l.map(a=>{const c=a.icon;return e.jsxs(m,{interactive:!0,padding:"md",className:"perf-tool-card",onClick:()=>t(a.path),role:"button",tabIndex:0,children:[e.jsxs("div",{className:"perf-tool-card-head",children:[e.jsx("span",{className:"perf-tool-card-glyph","aria-hidden":"true",children:e.jsx(c,{size:18,strokeWidth:1.75})}),e.jsx("div",{className:"perf-tool-card-titlewrap",children:e.jsxs("div",{className:"perf-tool-card-title-row",children:[e.jsx("h3",{className:"perf-tool-card-title",children:a.title}),a.tags.map(s=>e.jsx(p,{tone:s.tone??"neutral",size:"sm",variant:"outline",children:s.label},s.label))]})}),e.jsx("span",{className:"perf-tool-card-chevron","aria-hidden":"true",children:e.jsx(u,{size:16,strokeWidth:2})})]}),e.jsx("p",{className:"perf-tool-card-desc",children:a.description})]},a.key)})})})]})};export{N as Performance};
@@ -1 +1 @@
1
- import{r as s,j as e,S as b,T as k}from"./index-Bjn0ctEd.js";import{C as g}from"./index-DIcz5ciL.js";const S=c=>{const{open:C,onClose:u}=c,[t,n]=s.useState(!0),[o,l]=s.useState(!1),[r,d]=s.useState(!1),[x,m]=s.useState(!1),i=[{label:"是否开启域名校验",description:"开启后,客户端将校验所有请求的域名是否合法,建议开发环境关闭以便调试。",checked:t,onChange:n},{label:"是否开启 IAA Mock",description:"启用后,广告相关接口将返回模拟数据,方便开发和测试广告逻辑。",checked:o,onChange:l},{label:"是否开启 IAP Mock",description:"启用后,内购相关流程将使用模拟支付,避免真实扣费。",checked:r,onChange:d}];return e.jsx("div",{children:e.jsx(b,{vertical:!0,align:"start",spacing:"loose",children:i.map((a,h)=>e.jsxs("div",{children:[e.jsx(g,{checked:a.checked,onChange:p=>a.onChange(p.target.checked),children:a.label}),e.jsx(k.Text,{type:"tertiary",style:{display:"block",marginTop:4},children:a.description})]},h))})})};export{S as DebugSetting};
1
+ import{r as s,j as e,S as b,T as k}from"./index-BegU9LBT.js";import{C as g}from"./index-DEQ2hVPA.js";const S=c=>{const{open:C,onClose:u}=c,[t,n]=s.useState(!0),[o,l]=s.useState(!1),[r,d]=s.useState(!1),[x,m]=s.useState(!1),i=[{label:"是否开启域名校验",description:"开启后,客户端将校验所有请求的域名是否合法,建议开发环境关闭以便调试。",checked:t,onChange:n},{label:"是否开启 IAA Mock",description:"启用后,广告相关接口将返回模拟数据,方便开发和测试广告逻辑。",checked:o,onChange:l},{label:"是否开启 IAP Mock",description:"启用后,内购相关流程将使用模拟支付,避免真实扣费。",checked:r,onChange:d}];return e.jsx("div",{children:e.jsx(b,{vertical:!0,align:"start",spacing:"loose",children:i.map((a,h)=>e.jsxs("div",{children:[e.jsx(g,{checked:a.checked,onChange:p=>a.onChange(p.target.checked),children:a.label}),e.jsx(k.Text,{type:"tertiary",style:{display:"block",marginTop:4},children:a.description})]},h))})})};export{S as DebugSetting};
@@ -1 +1 @@
1
- import{c as o,h as c,j as e,P as r,i as a}from"./index-Bjn0ctEd.js";import{S as t}from"./SectionHeader-Cn3FnOqh.js";import{C as d,m,M as l,a as h,o as p}from"./MonetizationModeSummary-CnHqXyco.js";import"./index-CpM8t743.js";import{L as x,C as v}from"./layers-B4zhx14P.js";import{C as y}from"./compass-BabZVjAl.js";import"./Card-BAsimNoh.js";const j=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],u=o("credit-card",j);const g=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],k=o("megaphone",g),N={iaa:k,iap:u,iaap:x},C=s=>a(s),A=()=>{const s=c();return e.jsxs("div",{className:"ia-page",children:[e.jsx(r,{title:a("ia.overview.title"),subtitle:a("ia.overview.desc")}),e.jsxs("section",{className:"ia-section ia-section-modes",children:[e.jsx(t,{icon:d,title:a("ia.monetization.title"),subtitle:a("ia.monetization.desc")}),e.jsx("div",{className:"ia-mode-grid",children:m.map(i=>{const n=N[i.key];return e.jsxs("button",{type:"button",className:`ia-mode-card ia-mode-card-${i.key}`,onClick:()=>s(`/integration_assistant/mode/${i.key}`),children:[e.jsxs("header",{className:"ia-mode-card-head",children:[e.jsx("span",{className:"ia-mode-card-badge","aria-hidden":"true",children:e.jsx(n,{size:17,strokeWidth:2})}),e.jsx("h4",{className:"ia-mode-card-title",children:C(i.titleKey)}),e.jsx("span",{className:"ia-mode-card-chevron","aria-hidden":"true",children:e.jsx(v,{size:14,strokeWidth:2})})]}),e.jsx(l,{mode:i,compact:!0})]},i.key)})})]}),e.jsxs("section",{className:"ia-section",children:[e.jsx(t,{icon:y,title:a("ia.overview.groups.title"),subtitle:a("ia.overview.groups.desc")}),e.jsx("div",{className:"ia-section-stack",children:e.jsx(h,{sections:p})})]})]})};export{A as IntegrationAssistant};
1
+ import{c as o,h as c,j as e,P as r,i as a}from"./index-BegU9LBT.js";import{S as t}from"./SectionHeader-BKc3BWXP.js";import{C as d,m,M as l,a as h,o as p}from"./MonetizationModeSummary-DYE7XUq1.js";import"./index-DGkgqtgJ.js";import{L as x,C as v}from"./layers-Dbwq9AyL.js";import{C as y}from"./compass-D6waJ52O.js";import"./Card-CN2lxY0Y.js";const j=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],u=o("credit-card",j);const g=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],k=o("megaphone",g),N={iaa:k,iap:u,iaap:x},C=s=>a(s),A=()=>{const s=c();return e.jsxs("div",{className:"ia-page",children:[e.jsx(r,{title:a("ia.overview.title"),subtitle:a("ia.overview.desc")}),e.jsxs("section",{className:"ia-section ia-section-modes",children:[e.jsx(t,{icon:d,title:a("ia.monetization.title"),subtitle:a("ia.monetization.desc")}),e.jsx("div",{className:"ia-mode-grid",children:m.map(i=>{const n=N[i.key];return e.jsxs("button",{type:"button",className:`ia-mode-card ia-mode-card-${i.key}`,onClick:()=>s(`/integration_assistant/mode/${i.key}`),children:[e.jsxs("header",{className:"ia-mode-card-head",children:[e.jsx("span",{className:"ia-mode-card-badge","aria-hidden":"true",children:e.jsx(n,{size:17,strokeWidth:2})}),e.jsx("h4",{className:"ia-mode-card-title",children:C(i.titleKey)}),e.jsx("span",{className:"ia-mode-card-chevron","aria-hidden":"true",children:e.jsx(v,{size:14,strokeWidth:2})})]}),e.jsx(l,{mode:i,compact:!0})]},i.key)})})]}),e.jsxs("section",{className:"ia-section",children:[e.jsx(t,{icon:y,title:a("ia.overview.groups.title"),subtitle:a("ia.overview.groups.desc")}),e.jsx("div",{className:"ia-section-stack",children:e.jsx(h,{sections:p})})]})]})};export{A as IntegrationAssistant};
@@ -1 +1 @@
1
- import{t as g,w as y,y as E,U as C,R as t,V as $,E as v,z as m,T as u,W as I,l as N,m as x,O as w,J as o}from"./index-Bjn0ctEd.js";const B={PREFIX:`${g}-banner`},P={TYPE:["info","success","danger","warning"]};class l extends y{constructor(e){super(Object.assign(Object.assign({},l.defaultAdapter),e))}removeBanner(e){this._adapter.notifyClose(e),this._adapter.setVisible()}}const n=B.PREFIX,T=P.TYPE;class h extends E{constructor(e){super(e),this.remove=s=>{s&&s.stopPropagation(),this.foundation.removeBanner(s)},this.state={visible:!0},C("target"in this.props,"[Semi Banner] 'target' has been deprecated, please write JSX directly instead.")}get adapter(){return Object.assign(Object.assign({},super.adapter),{setVisible:()=>{this.setState({visible:!1})},notifyClose:e=>{const{onClose:s}=this.props;s(e)}})}componentDidMount(){this.foundation=new l(this.adapter),this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}renderCloser(){const{closeIcon:e}=this.props;return e===null?e:t.createElement($,{className:`${n}-close`,onClick:this.remove,icon:e||t.createElement(v,{"x-semi-prop":"closeIcon","aria-hidden":!0}),theme:"borderless",size:"small",type:"tertiary","aria-label":"Close"})}renderIcon(){const{type:e,icon:s}=this.props;let a={warning:t.createElement(w,{size:"large","aria-label":"warning"}),success:t.createElement(x,{size:"large","aria-label":"success"}),info:t.createElement(N,{size:"large","aria-label":"info"}),danger:t.createElement(I,{size:"large","aria-label":"danger"})}[e];const r=m({[`${n}-icon`]:!0});return typeof s<"u"&&(a=s),a?t.createElement("div",{className:r,"x-semi-prop":"icon"},a):null}render(){const{children:e,type:s,className:c,style:a,bordered:r,title:p,description:d,fullMode:i}=this.props,{visible:b}=this.state,f=m(n,c,{[`${n}-${s}`]:s,[`${n}-full`]:i,[`${n}-in-container`]:!i,[`${n}-bordered`]:!i&&r});return b?t.createElement("div",Object.assign({className:f,style:a,role:"alert"},this.getDataAttr(this.props)),t.createElement("div",{className:`${n}-content-wrapper`},t.createElement("div",{className:`${n}-content`},this.renderIcon(),t.createElement("div",{className:`${n}-content-body`},p?t.createElement(u.Title,{heading:5,className:`${n}-title`,component:"div","x-semi-prop":"title"},p):null,d?t.createElement(u.Paragraph,{className:`${n}-description`,component:"div","x-semi-prop":"description"},d):null)),this.renderCloser()),e?t.createElement("div",{className:`${n}-extra`,"x-semi-prop":"children"},e):null):null}}h.propTypes={fullMode:o.bool,type:o.oneOf(T),title:o.node,description:o.node,icon:o.node,closeIcon:o.node,children:o.node,style:o.object,className:o.string,onClose:o.func,bordered:o.bool};h.defaultProps={onClose:()=>{},type:"info",fullMode:!0};export{h as B};
1
+ import{t as g,w as y,y as E,U as C,R as t,V as $,E as v,z as m,T as u,W as I,l as N,m as x,O as w,J as o}from"./index-BegU9LBT.js";const B={PREFIX:`${g}-banner`},P={TYPE:["info","success","danger","warning"]};class l extends y{constructor(e){super(Object.assign(Object.assign({},l.defaultAdapter),e))}removeBanner(e){this._adapter.notifyClose(e),this._adapter.setVisible()}}const n=B.PREFIX,T=P.TYPE;class h extends E{constructor(e){super(e),this.remove=s=>{s&&s.stopPropagation(),this.foundation.removeBanner(s)},this.state={visible:!0},C("target"in this.props,"[Semi Banner] 'target' has been deprecated, please write JSX directly instead.")}get adapter(){return Object.assign(Object.assign({},super.adapter),{setVisible:()=>{this.setState({visible:!1})},notifyClose:e=>{const{onClose:s}=this.props;s(e)}})}componentDidMount(){this.foundation=new l(this.adapter),this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}renderCloser(){const{closeIcon:e}=this.props;return e===null?e:t.createElement($,{className:`${n}-close`,onClick:this.remove,icon:e||t.createElement(v,{"x-semi-prop":"closeIcon","aria-hidden":!0}),theme:"borderless",size:"small",type:"tertiary","aria-label":"Close"})}renderIcon(){const{type:e,icon:s}=this.props;let a={warning:t.createElement(w,{size:"large","aria-label":"warning"}),success:t.createElement(x,{size:"large","aria-label":"success"}),info:t.createElement(N,{size:"large","aria-label":"info"}),danger:t.createElement(I,{size:"large","aria-label":"danger"})}[e];const r=m({[`${n}-icon`]:!0});return typeof s<"u"&&(a=s),a?t.createElement("div",{className:r,"x-semi-prop":"icon"},a):null}render(){const{children:e,type:s,className:c,style:a,bordered:r,title:p,description:d,fullMode:i}=this.props,{visible:b}=this.state,f=m(n,c,{[`${n}-${s}`]:s,[`${n}-full`]:i,[`${n}-in-container`]:!i,[`${n}-bordered`]:!i&&r});return b?t.createElement("div",Object.assign({className:f,style:a,role:"alert"},this.getDataAttr(this.props)),t.createElement("div",{className:`${n}-content-wrapper`},t.createElement("div",{className:`${n}-content`},this.renderIcon(),t.createElement("div",{className:`${n}-content-body`},p?t.createElement(u.Title,{heading:5,className:`${n}-title`,component:"div","x-semi-prop":"title"},p):null,d?t.createElement(u.Paragraph,{className:`${n}-description`,component:"div","x-semi-prop":"description"},d):null)),this.renderCloser()),e?t.createElement("div",{className:`${n}-extra`,"x-semi-prop":"children"},e):null):null}}h.propTypes={fullMode:o.bool,type:o.oneOf(T),title:o.node,description:o.node,icon:o.node,closeIcon:o.node,children:o.node,style:o.object,className:o.string,onClose:o.func,bordered:o.bool};h.defaultProps={onClose:()=>{},type:"info",fullMode:!0};export{h as B};
@@ -1 +1 @@
1
- import{c as G,j as e,d as A,h as Me,u as Ee,r as t,i as s,a6 as Y,A as Ge,P as _e,D as X,b as ee,B as d,Q as Le,a8 as Pe,a9 as ze,aa as Ae,ab as De,ac as Re,ad as qe}from"./index-Bjn0ctEd.js";import{S as P}from"./SectionHeader-Cn3FnOqh.js";import{C as u}from"./Card-BAsimNoh.js";import{a as se,C as ae,U as We}from"./index-Cl0_vMWE.js";import{T as te}from"./triangle-alert-CgKAc3w5.js";import"./col-VN3Ivd-x.js";const Oe=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],ce=G("boxes",Oe);const Ie=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Be=G("link",Ie);const Ue=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],U=G("loader",Ue);const $e=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Fe=G("refresh-cw",$e);const Ve=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Ke=G("smartphone",Ve),ne=({entries:n,emptyText:i})=>{if(!n.length)return e.jsx("div",{className:"subpkg-preview-empty",children:i});const m=JSON.stringify({parallelPreloadSubpackages:n},null,2);return e.jsx("pre",{className:"subpkg-json",children:m})},h="__GAME__",He=9999;function Qe(n){return A({url:"/game/preload-subpackages-config",method:"GET",data:{entry:n}})}function Ze(n){return A({url:"/game/preload-subpackage-candidates",method:"GET",data:{entry:n}})}function Je(n,i){return A({url:"/game/collect-preload-subpackages",method:"POST",data:{entry:n,subpackages:i}})}function le(n){return A({url:"/game/clear-preload-subpackages-config",method:"POST",data:{entry:n}})}const Ye=2e4,ie="https://bytedance.my.larkoffice.com/docx/MIyMdmzb0oOQAKxNHGNmR5hDyAh",Xe=!1,z=[{subPkgName:"configBundle",isStartup:!0},{subPkgName:"gameplayBundle",isStartup:!1}];function es(){if(!Pe())return null;switch(ze()){case"subpackage.collecting":return{shot:"subpackage-collecting",stage:"collecting",entry:h,entryLabel:s("subpackageCollect.entry.game"),isConnected:!0,windowClosed:!1,collected:z,result:[]};case"subpackage.ready":return{shot:"subpackage-ready",stage:"collecting",entry:h,entryLabel:s("subpackageCollect.entry.game"),isConnected:!0,windowClosed:!0,collected:z,result:[]};case"subpackage.success":return{shot:"subpackage-success",stage:"success",entry:h,entryLabel:s("subpackageCollect.entry.game"),isConnected:!0,windowClosed:!0,collected:z,result:z};case"subpackage.collect-ready":return{shot:"subpackage-entry",stage:"entry",entry:h,entryLabel:"",isConnected:!1,windowClosed:!1,collected:[],result:[]};default:return null}}const ss={entry:"neutral",empty:"neutral",collecting:"accent",processing:"accent",success:"success",failed:"error"},os=()=>{const n=Me(),i=es(),{state:{devSchema:m,engine:re,packages:D,isConnected:oe},setMessage:_,setShowManualBindIP:$}=Ee(),R=t.useMemo(()=>{const a=(D||[]).filter(l=>l.type==="independent").map(l=>({value:l.name,label:l.name,isGame:!1}));return[{value:h,label:s("subpackageCollect.entry.game"),isGame:!0},...a]},[D]),q=(D?.length??0)>0,x=R.length>1,N=re==="unity",v=oe||!!i?.isConnected,[c,r]=t.useState(()=>i?.stage??"entry"),[de,C]=t.useState("idle"),[k,ue]=t.useState(()=>i?.entry??h),[F,pe]=t.useState(()=>i?.entryLabel??""),[p,f]=t.useState(()=>i?.collected??[]),[as,W]=t.useState([]),[b,w]=t.useState([]),[O,S]=t.useState(()=>i?.result??[]),[g,T]=t.useState(()=>i?.windowClosed??!1),[ge,L]=t.useState(!1),[ke,M]=t.useState(""),[be,E]=t.useState(""),I=t.useRef(!1),B=t.useRef("entry");I.current=g,B.current=c;const V=t.useMemo(()=>{if(!m)return"";const a=m.includes("?")?"&":"?";return`${m}${a}startupRoot=${encodeURIComponent(k)}`},[m,k]);t.useEffect(()=>{const a=Y.on("predownloadSubpackage",o=>{if(B.current!=="collecting"||I.current)return;const{subPkgName:j,isStartup:Se}=o;!j||j===h||(f(y=>y.some(Te=>Te.subPkgName===j)?y:[...y,{subPkgName:j,isStartup:Se}]),C(y=>y==="idle"?"running":y))}),l=Y.on("reportScene",o=>{B.current!=="collecting"||I.current||o.sceneId===He&&(T(!0),C("interactive"),_({type:"success",title:s("subpackageCollect.reportScene.toastTitle"),desc:s("subpackageCollect.reportScene.toastDesc")}))});return()=>{a(),l()}},[_]),t.useEffect(()=>{if(i||c!=="collecting"||g||!v){L(!1);return}const a=window.setTimeout(()=>L(!0),Ye);return()=>window.clearTimeout(a)},[i,c,g,v,de]);const K=async a=>{ue(a.value),pe(a.label),f([]),S([]),T(!1),C("idle"),w([]),W([]),r("collecting");const[l,o]=await Promise.all([Qe(a.value),Ze(a.value)]);if(l?.code===0&&l.data){const j=l.data.parallelPreloadSubpackages||[];w(j)}o?.code===0&&o.data&&(W(o.data.candidates||[]),o.data.totalSubpackages===0&&r("empty"))};t.useEffect(()=>{N||c==="entry"&&q&&!x&&K(R[0])},[c,q,x,N]);const H=async()=>{E(s("subpackageCollect.processing.write")),r("processing");const a=p.slice(),l=await Je(k,a);if(l?.code===0&&l.data){const o=l.data.parallelPreloadSubpackages||[];S(o),w(o),r("success")}else M(l?.error?.message||s("subpackageCollect.error.generic")),r("failed")},he=()=>{if(p.length===0&&b.length>0){qe.confirm({type:"warning",title:s("subpackageCollect.finish.clearTitle"),content:s("subpackageCollect.finish.clearConfirm",{existing:b.length}),okText:s("subpackageCollect.finish.okClear"),cancelText:s("subpackageCollect.finish.cancel"),onOk:H});return}H()},me=()=>{f([]),S([]),w([]),T(!1),C("idle"),L(!1),M(""),E(""),r("collecting")},xe=()=>{f([]),S([]),w([]),T(!1),C("idle"),L(!1),M(""),E(""),r(x?"entry":"collecting")},Q=async()=>{E(s("subpackageCollect.processing.clear")),r("processing");const a=await le(k);if(a?.code===0){me();return}M(a?.error?.message||s("subpackageCollect.error.generic")),r("failed")},Z=()=>{f([]),S([]),W([]),T(!1),C("idle"),r("entry")},Ce=async()=>{E(s("subpackageCollect.processing.cancel")),r("processing");const a=await le(k);if(a?.code===0){xe();return}M(a?.error?.message||s("subpackageCollect.error.generic")),r("failed")},je=()=>{n("/performance")},ye=()=>{$(!0)},Ne=()=>{const a=Ae();if(!De(a)){_({type:"warning",title:s("subpackageCollect.manualConnect.noRecordTitle"),desc:s("subpackageCollect.manualConnect.noRecordDesc")}),$(!0);return}Re(a),_({type:"info",title:s("subpackageCollect.manualConnect.retryTitle"),desc:s("subpackageCollect.manualConnect.retryDesc",{ip:String(a.ip),port:String(a.wsPort)})})},ve=t.useMemo(()=>c==="success"?O:p.length?p:g?[]:b,[c,O,p,b,g]),J=c==="collecting"&&!v,fe=N?s("subpackageCollect.stage.unsupported"):J?s("subpackageCollect.stage.notStarted"):s(`subpackageCollect.stage.${c}`),we=N?"warn":J?"neutral":ss[c];return e.jsxs("div",{className:"subpkg-page","data-doc-shot":i?.shot||"subpackage-collection",children:[e.jsxs("div",{className:"subpkg-hero-strip",children:[e.jsxs("button",{type:"button",className:"subpkg-back",onClick:()=>n("/performance"),children:[e.jsx(Ge,{size:14,strokeWidth:2}),e.jsx("span",{children:s("back")})]}),e.jsx(_e,{title:s("subpackageCollect"),subtitle:s("subpackageCollect.subtitle"),action:e.jsxs("div",{className:"subpkg-hero-actions",children:[e.jsx(X,{href:ie,children:s("subpackageCollect.devGuide.link")}),e.jsx(ee,{tone:we,withDot:!0,variant:"solid",children:fe})]})})]}),N?e.jsxs(u,{padding:"lg",className:"subpkg-card subpkg-unsupported-card",children:[e.jsx("div",{className:"subpkg-unsupported-icon","aria-hidden":"true",children:e.jsx(te,{size:22,strokeWidth:1.75})}),e.jsx("h2",{className:"subpkg-unsupported-title",children:s("subpackageCollect.unsupported.unity.title")}),e.jsx("p",{className:"subpkg-unsupported-desc",children:s("subpackageCollect.unsupported.unity.desc")}),e.jsx("div",{className:"subpkg-unsupported-actions",children:e.jsx(d,{type:"primary",theme:"solid",onClick:()=>n("/wasm_split"),children:s("subpackageCollect.unsupported.unity.action")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(u,{padding:"md",className:"subpkg-card subpkg-version-card",children:e.jsxs("div",{className:"subpkg-client-version",role:"list","aria-label":s("subpackageCollect.devGuide.clientVersion"),children:[e.jsxs("div",{className:"subpkg-client-version-title",children:[e.jsx(Ke,{size:16,strokeWidth:2}),e.jsx("span",{children:s("subpackageCollect.devGuide.clientVersion")})]}),e.jsx("span",{className:"subpkg-client-version-chip",role:"listitem",children:s("subpackageCollect.devGuide.android")}),e.jsx("span",{className:"subpkg-client-version-chip",role:"listitem",children:s("subpackageCollect.devGuide.ios")})]})}),e.jsxs(u,{padding:"lg",className:"subpkg-card subpkg-dev-guide-card",children:[e.jsx(P,{className:"subpkg-section-header",title:s("subpackageCollect.devGuide.stepsTitle")}),e.jsxs("div",{className:"subpkg-required-integration",children:[e.jsx("span",{className:"subpkg-required-label",children:s("subpackageCollect.devGuide.required.badge")}),e.jsxs("div",{className:"subpkg-required-copy",children:[e.jsxs("div",{className:"subpkg-required-title",children:[s("subpackageCollect.devGuide.required.title"),e.jsx("code",{children:s("subpackageCollect.devGuide.required.code")})]}),e.jsx("div",{className:"subpkg-required-desc",children:s("subpackageCollect.devGuide.required.desc")})]})]}),e.jsxs("ol",{className:"subpkg-dev-guide-list",children:[e.jsxs("li",{children:[e.jsx("span",{className:"subpkg-dev-guide-index",children:"1"}),e.jsxs("span",{className:"subpkg-dev-guide-copy",children:[e.jsx("strong",{children:s("subpackageCollect.devGuide.step1.title")}),e.jsx("span",{children:s("subpackageCollect.devGuide.step1.desc")})]})]}),e.jsxs("li",{children:[e.jsx("span",{className:"subpkg-dev-guide-index",children:"2"}),e.jsxs("span",{className:"subpkg-dev-guide-copy",children:[e.jsx("strong",{children:s("subpackageCollect.devGuide.step2.title")}),e.jsx("span",{children:s("subpackageCollect.devGuide.step2.desc")})]})]}),e.jsxs("li",{children:[e.jsx("span",{className:"subpkg-dev-guide-index",children:"3"}),e.jsxs("span",{className:"subpkg-dev-guide-copy",children:[e.jsx("strong",{children:s("subpackageCollect.devGuide.step3.title")}),e.jsx("span",{children:s("subpackageCollect.devGuide.step3.desc")})]})]})]})]}),c==="entry"&&(q&&x?e.jsxs(u,{padding:"lg",className:"subpkg-card",children:[e.jsx(P,{icon:ce,title:s("subpackageCollect.entry.title"),subtitle:s("subpackageCollect.entry.subtitle")}),e.jsx("div",{className:"subpkg-entry-grid",children:R.map(a=>e.jsxs("button",{type:"button",className:"subpkg-entry-card",onClick:()=>K(a),children:[e.jsx("span",{className:"subpkg-entry-name",children:a.label}),e.jsx(ee,{tone:a.isGame?"accent":"info",size:"sm",variant:"outline",children:a.isGame?s("subpackageCollect.entry.gameTag"):s("subpackageCollect.entry.independentTag")})]},a.value))})]}):e.jsxs(u,{padding:"lg",className:"subpkg-card subpkg-center",children:[e.jsx(U,{size:28,strokeWidth:1.75,className:"subpkg-wait-spin"}),e.jsx("p",{className:"subpkg-center-text",children:s("subpackageCollect.loading")})]})),c==="empty"&&e.jsxs(u,{padding:"lg",className:"subpkg-card subpkg-center",children:[e.jsx(ce,{size:28,strokeWidth:1.5,className:"subpkg-empty-icon"}),e.jsx("p",{className:"subpkg-empty-title",children:s("subpackageCollect.empty.title")}),e.jsx("p",{className:"subpkg-empty-desc",children:s("subpackageCollect.empty.desc")}),e.jsx("div",{className:"subpkg-actions subpkg-actions-center",children:e.jsx(d,{type:"primary",theme:"solid",onClick:()=>n("/performance"),children:s("subpackageCollect.empty.back")})})]}),c==="collecting"&&e.jsxs("div",{className:"subpkg-collect-grid",children:[e.jsxs(u,{padding:"lg",className:"subpkg-card subpkg-collect-card",children:[e.jsx(P,{className:"subpkg-section-header",title:e.jsxs("span",{className:"subpkg-entry-title",children:[e.jsx("span",{className:"subpkg-entry-title-label",children:s("subpackageCollect.preview.currentEntry")}),e.jsx("span",{className:"subpkg-entry-title-value",children:F||k})]})}),!g&&!v&&e.jsxs("div",{className:"subpkg-scan",children:[e.jsx("div",{className:"subpkg-qr",children:V?e.jsx(Le,{value:V,size:164}):e.jsx("div",{className:"subpkg-qr-empty",children:s("subpackageCollect.preview.noSchema")})}),e.jsxs("div",{className:"subpkg-scan-main",children:[e.jsxs("div",{className:"subpkg-scan-heading",children:[e.jsx("div",{className:"subpkg-scan-title",children:s("subpackageCollect.scan.title")}),e.jsx("div",{className:"subpkg-scan-subtitle",children:s("subpackageCollect.scan.subtitle")})]}),e.jsxs("ol",{className:"subpkg-guide",children:[e.jsx("li",{children:s("subpackageCollect.guide.step2")}),e.jsx("li",{className:"subpkg-guide-key",children:s("subpackageCollect.guide.step3")})]})]}),e.jsxs("div",{className:"subpkg-connect-tools",role:"group","aria-label":s("subpackageCollect.manualConnect.title"),children:[e.jsxs("div",{className:"subpkg-connect-copy",children:[e.jsx("span",{className:"subpkg-connect-icon","aria-hidden":"true",children:e.jsx(se,{size:16,strokeWidth:2})}),e.jsxs("span",{className:"subpkg-connect-text",children:[e.jsx("span",{className:"subpkg-connect-title",children:s("subpackageCollect.manualConnect.title")}),e.jsx("span",{className:"subpkg-connect-hint",children:s("subpackageCollect.manualConnect.desc")})]})]}),e.jsxs("div",{className:"subpkg-connect-actions",children:[e.jsx(d,{className:"subpkg-connect-button subpkg-connect-button-secondary",size:"small",type:"tertiary",icon:e.jsx(Fe,{size:14,strokeWidth:2}),onClick:Ne,children:s("subpackageCollect.manualConnect.retry")}),e.jsx(d,{className:"subpkg-connect-button subpkg-connect-button-primary",size:"small",theme:"light",icon:e.jsx(Be,{size:14,strokeWidth:2}),onClick:ye,children:s("subpackageCollect.manualConnect.action")})]})]})]}),g?e.jsxs("div",{className:"subpkg-banner subpkg-banner-success",role:"status",children:[e.jsx("span",{className:"subpkg-banner-bar","aria-hidden":"true"}),e.jsx("span",{className:"subpkg-banner-icon",children:e.jsx(ae,{size:18,strokeWidth:2})}),e.jsxs("div",{className:"subpkg-banner-body",children:[e.jsx("div",{className:"subpkg-banner-title",children:s("subpackageCollect.reportScene.readyTitle")}),e.jsx("div",{className:"subpkg-banner-text",children:s("subpackageCollect.reportScene.readyDesc")})]}),e.jsx(d,{className:"subpkg-banner-action",size:"small",type:"primary",theme:"solid",onClick:he,children:s("subpackageCollect.action.finish")})]}):v&&(ge?e.jsxs("div",{className:"subpkg-banner subpkg-banner-warn",role:"alert",children:[e.jsx("span",{className:"subpkg-banner-bar","aria-hidden":"true"}),e.jsx("span",{className:"subpkg-banner-icon",children:e.jsx(te,{size:18,strokeWidth:2})}),e.jsxs("div",{className:"subpkg-banner-body",children:[e.jsx("div",{className:"subpkg-banner-title",children:s("subpackageCollect.wait.timeoutTitle")}),e.jsx("div",{className:"subpkg-banner-text",children:s("subpackageCollect.wait.timeout")})]}),e.jsx(X,{className:"subpkg-banner-cta",href:ie,children:s("subpackageCollect.wait.docLink")})]}):e.jsxs("div",{className:"subpkg-banner subpkg-banner-accent",role:"status",children:[e.jsx("span",{className:"subpkg-banner-bar","aria-hidden":"true"}),e.jsx("span",{className:"subpkg-banner-icon",children:e.jsx(U,{size:18,strokeWidth:2,className:"subpkg-wait-spin"})}),e.jsxs("div",{className:"subpkg-banner-body",children:[e.jsx("div",{className:"subpkg-banner-title",children:s("subpackageCollect.wait.runningTitle")}),e.jsx("div",{className:"subpkg-banner-progress",children:e.jsx(We,{})}),e.jsx("div",{className:"subpkg-banner-text",children:s("subpackageCollect.wait.running")})]})]})),Xe]}),e.jsxs(u,{padding:"lg",className:"subpkg-card subpkg-side",children:[e.jsx(P,{title:s("subpackageCollect.preview.collectedTitle"),subtitle:p.length?s("subpackageCollect.preview.collectedDesc"):s("subpackageCollect.preview.existingDesc")}),e.jsx(ne,{entries:ve,emptyText:s("subpackageCollect.preview.empty")}),g&&b.length>0&&e.jsx("p",{className:`subpkg-finish-note${p.length?"":" subpkg-finish-note-clear"}`,children:p.length?s("subpackageCollect.finish.overwriteNote",{current:p.length,existing:b.length}):s("subpackageCollect.finish.clearNote",{existing:b.length})}),!g&&e.jsxs("div",{className:"subpkg-actions",children:[e.jsx(d,{type:"tertiary",onClick:Ce,children:s("subpackageCollect.action.cancel")}),e.jsx(d,{type:"tertiary",onClick:je,children:s("subpackageCollect.action.exit")})]})]})]}),c==="processing"&&e.jsxs(u,{padding:"lg",className:"subpkg-card subpkg-center",children:[e.jsx(U,{size:28,strokeWidth:1.75,className:"subpkg-wait-spin"}),e.jsx("p",{className:"subpkg-center-text",children:be||s("subpackageCollect.processing.write")})]}),c==="success"&&e.jsxs(u,{padding:"lg",className:"subpkg-card",children:[e.jsxs("div",{className:"subpkg-result-head subpkg-result-success",children:[e.jsx(ae,{size:20,strokeWidth:1.75}),e.jsx("span",{children:s("subpackageCollect.success.title")})]}),e.jsxs("div",{className:"subpkg-entry-hint",children:[s("subpackageCollect.preview.currentEntry"),":",e.jsx("strong",{children:F||k})]}),e.jsx(ne,{entries:O,emptyText:s("subpackageCollect.success.empty")}),e.jsxs("div",{className:"subpkg-actions",children:[e.jsx(d,{type:"primary",theme:"solid",onClick:Q,children:s("subpackageCollect.action.recollect")}),x&&e.jsx(d,{type:"tertiary",onClick:Z,children:s("subpackageCollect.action.switch")})]})]}),c==="failed"&&e.jsxs(u,{padding:"lg",className:"subpkg-card",children:[e.jsxs("div",{className:"subpkg-result-head subpkg-result-failed",children:[e.jsx(se,{size:20,strokeWidth:1.75}),e.jsx("span",{children:s("subpackageCollect.failed.title")})]}),e.jsx("p",{className:"subpkg-error-msg",children:ke}),e.jsxs("div",{className:"subpkg-actions",children:[e.jsx(d,{type:"primary",theme:"solid",onClick:Q,children:s("subpackageCollect.action.recollect")}),x&&e.jsx(d,{type:"tertiary",onClick:Z,children:s("subpackageCollect.action.switch")})]})]})]})]})};export{os as SubpackageCollect};
1
+ import{c as G,j as e,d as A,h as Me,u as Ee,r as t,i as s,a6 as Y,A as Ge,P as _e,D as X,b as ee,B as d,Q as Le,a8 as Pe,a9 as ze,aa as Ae,ab as De,ac as Re,ad as qe}from"./index-BegU9LBT.js";import{S as P}from"./SectionHeader-BKc3BWXP.js";import{C as u}from"./Card-CN2lxY0Y.js";import{a as se,C as ae,U as We}from"./index-BIrFkB6r.js";import{T as te}from"./triangle-alert-BZVAEUiL.js";import"./col-w9Q-2mgM.js";const Oe=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],ce=G("boxes",Oe);const Ie=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Be=G("link",Ie);const Ue=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],U=G("loader",Ue);const $e=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Fe=G("refresh-cw",$e);const Ve=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Ke=G("smartphone",Ve),ne=({entries:n,emptyText:i})=>{if(!n.length)return e.jsx("div",{className:"subpkg-preview-empty",children:i});const m=JSON.stringify({parallelPreloadSubpackages:n},null,2);return e.jsx("pre",{className:"subpkg-json",children:m})},h="__GAME__",He=9999;function Qe(n){return A({url:"/game/preload-subpackages-config",method:"GET",data:{entry:n}})}function Ze(n){return A({url:"/game/preload-subpackage-candidates",method:"GET",data:{entry:n}})}function Je(n,i){return A({url:"/game/collect-preload-subpackages",method:"POST",data:{entry:n,subpackages:i}})}function le(n){return A({url:"/game/clear-preload-subpackages-config",method:"POST",data:{entry:n}})}const Ye=2e4,ie="https://bytedance.my.larkoffice.com/docx/MIyMdmzb0oOQAKxNHGNmR5hDyAh",Xe=!1,z=[{subPkgName:"configBundle",isStartup:!0},{subPkgName:"gameplayBundle",isStartup:!1}];function es(){if(!Pe())return null;switch(ze()){case"subpackage.collecting":return{shot:"subpackage-collecting",stage:"collecting",entry:h,entryLabel:s("subpackageCollect.entry.game"),isConnected:!0,windowClosed:!1,collected:z,result:[]};case"subpackage.ready":return{shot:"subpackage-ready",stage:"collecting",entry:h,entryLabel:s("subpackageCollect.entry.game"),isConnected:!0,windowClosed:!0,collected:z,result:[]};case"subpackage.success":return{shot:"subpackage-success",stage:"success",entry:h,entryLabel:s("subpackageCollect.entry.game"),isConnected:!0,windowClosed:!0,collected:z,result:z};case"subpackage.collect-ready":return{shot:"subpackage-entry",stage:"entry",entry:h,entryLabel:"",isConnected:!1,windowClosed:!1,collected:[],result:[]};default:return null}}const ss={entry:"neutral",empty:"neutral",collecting:"accent",processing:"accent",success:"success",failed:"error"},os=()=>{const n=Me(),i=es(),{state:{devSchema:m,engine:re,packages:D,isConnected:oe},setMessage:_,setShowManualBindIP:$}=Ee(),R=t.useMemo(()=>{const a=(D||[]).filter(l=>l.type==="independent").map(l=>({value:l.name,label:l.name,isGame:!1}));return[{value:h,label:s("subpackageCollect.entry.game"),isGame:!0},...a]},[D]),q=(D?.length??0)>0,x=R.length>1,N=re==="unity",v=oe||!!i?.isConnected,[c,r]=t.useState(()=>i?.stage??"entry"),[de,C]=t.useState("idle"),[k,ue]=t.useState(()=>i?.entry??h),[F,pe]=t.useState(()=>i?.entryLabel??""),[p,f]=t.useState(()=>i?.collected??[]),[as,W]=t.useState([]),[b,w]=t.useState([]),[O,S]=t.useState(()=>i?.result??[]),[g,T]=t.useState(()=>i?.windowClosed??!1),[ge,L]=t.useState(!1),[ke,M]=t.useState(""),[be,E]=t.useState(""),I=t.useRef(!1),B=t.useRef("entry");I.current=g,B.current=c;const V=t.useMemo(()=>{if(!m)return"";const a=m.includes("?")?"&":"?";return`${m}${a}startupRoot=${encodeURIComponent(k)}`},[m,k]);t.useEffect(()=>{const a=Y.on("predownloadSubpackage",o=>{if(B.current!=="collecting"||I.current)return;const{subPkgName:j,isStartup:Se}=o;!j||j===h||(f(y=>y.some(Te=>Te.subPkgName===j)?y:[...y,{subPkgName:j,isStartup:Se}]),C(y=>y==="idle"?"running":y))}),l=Y.on("reportScene",o=>{B.current!=="collecting"||I.current||o.sceneId===He&&(T(!0),C("interactive"),_({type:"success",title:s("subpackageCollect.reportScene.toastTitle"),desc:s("subpackageCollect.reportScene.toastDesc")}))});return()=>{a(),l()}},[_]),t.useEffect(()=>{if(i||c!=="collecting"||g||!v){L(!1);return}const a=window.setTimeout(()=>L(!0),Ye);return()=>window.clearTimeout(a)},[i,c,g,v,de]);const K=async a=>{ue(a.value),pe(a.label),f([]),S([]),T(!1),C("idle"),w([]),W([]),r("collecting");const[l,o]=await Promise.all([Qe(a.value),Ze(a.value)]);if(l?.code===0&&l.data){const j=l.data.parallelPreloadSubpackages||[];w(j)}o?.code===0&&o.data&&(W(o.data.candidates||[]),o.data.totalSubpackages===0&&r("empty"))};t.useEffect(()=>{N||c==="entry"&&q&&!x&&K(R[0])},[c,q,x,N]);const H=async()=>{E(s("subpackageCollect.processing.write")),r("processing");const a=p.slice(),l=await Je(k,a);if(l?.code===0&&l.data){const o=l.data.parallelPreloadSubpackages||[];S(o),w(o),r("success")}else M(l?.error?.message||s("subpackageCollect.error.generic")),r("failed")},he=()=>{if(p.length===0&&b.length>0){qe.confirm({type:"warning",title:s("subpackageCollect.finish.clearTitle"),content:s("subpackageCollect.finish.clearConfirm",{existing:b.length}),okText:s("subpackageCollect.finish.okClear"),cancelText:s("subpackageCollect.finish.cancel"),onOk:H});return}H()},me=()=>{f([]),S([]),w([]),T(!1),C("idle"),L(!1),M(""),E(""),r("collecting")},xe=()=>{f([]),S([]),w([]),T(!1),C("idle"),L(!1),M(""),E(""),r(x?"entry":"collecting")},Q=async()=>{E(s("subpackageCollect.processing.clear")),r("processing");const a=await le(k);if(a?.code===0){me();return}M(a?.error?.message||s("subpackageCollect.error.generic")),r("failed")},Z=()=>{f([]),S([]),W([]),T(!1),C("idle"),r("entry")},Ce=async()=>{E(s("subpackageCollect.processing.cancel")),r("processing");const a=await le(k);if(a?.code===0){xe();return}M(a?.error?.message||s("subpackageCollect.error.generic")),r("failed")},je=()=>{n("/performance")},ye=()=>{$(!0)},Ne=()=>{const a=Ae();if(!De(a)){_({type:"warning",title:s("subpackageCollect.manualConnect.noRecordTitle"),desc:s("subpackageCollect.manualConnect.noRecordDesc")}),$(!0);return}Re(a),_({type:"info",title:s("subpackageCollect.manualConnect.retryTitle"),desc:s("subpackageCollect.manualConnect.retryDesc",{ip:String(a.ip),port:String(a.wsPort)})})},ve=t.useMemo(()=>c==="success"?O:p.length?p:g?[]:b,[c,O,p,b,g]),J=c==="collecting"&&!v,fe=N?s("subpackageCollect.stage.unsupported"):J?s("subpackageCollect.stage.notStarted"):s(`subpackageCollect.stage.${c}`),we=N?"warn":J?"neutral":ss[c];return e.jsxs("div",{className:"subpkg-page","data-doc-shot":i?.shot||"subpackage-collection",children:[e.jsxs("div",{className:"subpkg-hero-strip",children:[e.jsxs("button",{type:"button",className:"subpkg-back",onClick:()=>n("/performance"),children:[e.jsx(Ge,{size:14,strokeWidth:2}),e.jsx("span",{children:s("back")})]}),e.jsx(_e,{title:s("subpackageCollect"),subtitle:s("subpackageCollect.subtitle"),action:e.jsxs("div",{className:"subpkg-hero-actions",children:[e.jsx(X,{href:ie,children:s("subpackageCollect.devGuide.link")}),e.jsx(ee,{tone:we,withDot:!0,variant:"solid",children:fe})]})})]}),N?e.jsxs(u,{padding:"lg",className:"subpkg-card subpkg-unsupported-card",children:[e.jsx("div",{className:"subpkg-unsupported-icon","aria-hidden":"true",children:e.jsx(te,{size:22,strokeWidth:1.75})}),e.jsx("h2",{className:"subpkg-unsupported-title",children:s("subpackageCollect.unsupported.unity.title")}),e.jsx("p",{className:"subpkg-unsupported-desc",children:s("subpackageCollect.unsupported.unity.desc")}),e.jsx("div",{className:"subpkg-unsupported-actions",children:e.jsx(d,{type:"primary",theme:"solid",onClick:()=>n("/wasm_split"),children:s("subpackageCollect.unsupported.unity.action")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(u,{padding:"md",className:"subpkg-card subpkg-version-card",children:e.jsxs("div",{className:"subpkg-client-version",role:"list","aria-label":s("subpackageCollect.devGuide.clientVersion"),children:[e.jsxs("div",{className:"subpkg-client-version-title",children:[e.jsx(Ke,{size:16,strokeWidth:2}),e.jsx("span",{children:s("subpackageCollect.devGuide.clientVersion")})]}),e.jsx("span",{className:"subpkg-client-version-chip",role:"listitem",children:s("subpackageCollect.devGuide.android")}),e.jsx("span",{className:"subpkg-client-version-chip",role:"listitem",children:s("subpackageCollect.devGuide.ios")})]})}),e.jsxs(u,{padding:"lg",className:"subpkg-card subpkg-dev-guide-card",children:[e.jsx(P,{className:"subpkg-section-header",title:s("subpackageCollect.devGuide.stepsTitle")}),e.jsxs("div",{className:"subpkg-required-integration",children:[e.jsx("span",{className:"subpkg-required-label",children:s("subpackageCollect.devGuide.required.badge")}),e.jsxs("div",{className:"subpkg-required-copy",children:[e.jsxs("div",{className:"subpkg-required-title",children:[s("subpackageCollect.devGuide.required.title"),e.jsx("code",{children:s("subpackageCollect.devGuide.required.code")})]}),e.jsx("div",{className:"subpkg-required-desc",children:s("subpackageCollect.devGuide.required.desc")})]})]}),e.jsxs("ol",{className:"subpkg-dev-guide-list",children:[e.jsxs("li",{children:[e.jsx("span",{className:"subpkg-dev-guide-index",children:"1"}),e.jsxs("span",{className:"subpkg-dev-guide-copy",children:[e.jsx("strong",{children:s("subpackageCollect.devGuide.step1.title")}),e.jsx("span",{children:s("subpackageCollect.devGuide.step1.desc")})]})]}),e.jsxs("li",{children:[e.jsx("span",{className:"subpkg-dev-guide-index",children:"2"}),e.jsxs("span",{className:"subpkg-dev-guide-copy",children:[e.jsx("strong",{children:s("subpackageCollect.devGuide.step2.title")}),e.jsx("span",{children:s("subpackageCollect.devGuide.step2.desc")})]})]}),e.jsxs("li",{children:[e.jsx("span",{className:"subpkg-dev-guide-index",children:"3"}),e.jsxs("span",{className:"subpkg-dev-guide-copy",children:[e.jsx("strong",{children:s("subpackageCollect.devGuide.step3.title")}),e.jsx("span",{children:s("subpackageCollect.devGuide.step3.desc")})]})]})]})]}),c==="entry"&&(q&&x?e.jsxs(u,{padding:"lg",className:"subpkg-card",children:[e.jsx(P,{icon:ce,title:s("subpackageCollect.entry.title"),subtitle:s("subpackageCollect.entry.subtitle")}),e.jsx("div",{className:"subpkg-entry-grid",children:R.map(a=>e.jsxs("button",{type:"button",className:"subpkg-entry-card",onClick:()=>K(a),children:[e.jsx("span",{className:"subpkg-entry-name",children:a.label}),e.jsx(ee,{tone:a.isGame?"accent":"info",size:"sm",variant:"outline",children:a.isGame?s("subpackageCollect.entry.gameTag"):s("subpackageCollect.entry.independentTag")})]},a.value))})]}):e.jsxs(u,{padding:"lg",className:"subpkg-card subpkg-center",children:[e.jsx(U,{size:28,strokeWidth:1.75,className:"subpkg-wait-spin"}),e.jsx("p",{className:"subpkg-center-text",children:s("subpackageCollect.loading")})]})),c==="empty"&&e.jsxs(u,{padding:"lg",className:"subpkg-card subpkg-center",children:[e.jsx(ce,{size:28,strokeWidth:1.5,className:"subpkg-empty-icon"}),e.jsx("p",{className:"subpkg-empty-title",children:s("subpackageCollect.empty.title")}),e.jsx("p",{className:"subpkg-empty-desc",children:s("subpackageCollect.empty.desc")}),e.jsx("div",{className:"subpkg-actions subpkg-actions-center",children:e.jsx(d,{type:"primary",theme:"solid",onClick:()=>n("/performance"),children:s("subpackageCollect.empty.back")})})]}),c==="collecting"&&e.jsxs("div",{className:"subpkg-collect-grid",children:[e.jsxs(u,{padding:"lg",className:"subpkg-card subpkg-collect-card",children:[e.jsx(P,{className:"subpkg-section-header",title:e.jsxs("span",{className:"subpkg-entry-title",children:[e.jsx("span",{className:"subpkg-entry-title-label",children:s("subpackageCollect.preview.currentEntry")}),e.jsx("span",{className:"subpkg-entry-title-value",children:F||k})]})}),!g&&!v&&e.jsxs("div",{className:"subpkg-scan",children:[e.jsx("div",{className:"subpkg-qr",children:V?e.jsx(Le,{value:V,size:164}):e.jsx("div",{className:"subpkg-qr-empty",children:s("subpackageCollect.preview.noSchema")})}),e.jsxs("div",{className:"subpkg-scan-main",children:[e.jsxs("div",{className:"subpkg-scan-heading",children:[e.jsx("div",{className:"subpkg-scan-title",children:s("subpackageCollect.scan.title")}),e.jsx("div",{className:"subpkg-scan-subtitle",children:s("subpackageCollect.scan.subtitle")})]}),e.jsxs("ol",{className:"subpkg-guide",children:[e.jsx("li",{children:s("subpackageCollect.guide.step2")}),e.jsx("li",{className:"subpkg-guide-key",children:s("subpackageCollect.guide.step3")})]})]}),e.jsxs("div",{className:"subpkg-connect-tools",role:"group","aria-label":s("subpackageCollect.manualConnect.title"),children:[e.jsxs("div",{className:"subpkg-connect-copy",children:[e.jsx("span",{className:"subpkg-connect-icon","aria-hidden":"true",children:e.jsx(se,{size:16,strokeWidth:2})}),e.jsxs("span",{className:"subpkg-connect-text",children:[e.jsx("span",{className:"subpkg-connect-title",children:s("subpackageCollect.manualConnect.title")}),e.jsx("span",{className:"subpkg-connect-hint",children:s("subpackageCollect.manualConnect.desc")})]})]}),e.jsxs("div",{className:"subpkg-connect-actions",children:[e.jsx(d,{className:"subpkg-connect-button subpkg-connect-button-secondary",size:"small",type:"tertiary",icon:e.jsx(Fe,{size:14,strokeWidth:2}),onClick:Ne,children:s("subpackageCollect.manualConnect.retry")}),e.jsx(d,{className:"subpkg-connect-button subpkg-connect-button-primary",size:"small",theme:"light",icon:e.jsx(Be,{size:14,strokeWidth:2}),onClick:ye,children:s("subpackageCollect.manualConnect.action")})]})]})]}),g?e.jsxs("div",{className:"subpkg-banner subpkg-banner-success",role:"status",children:[e.jsx("span",{className:"subpkg-banner-bar","aria-hidden":"true"}),e.jsx("span",{className:"subpkg-banner-icon",children:e.jsx(ae,{size:18,strokeWidth:2})}),e.jsxs("div",{className:"subpkg-banner-body",children:[e.jsx("div",{className:"subpkg-banner-title",children:s("subpackageCollect.reportScene.readyTitle")}),e.jsx("div",{className:"subpkg-banner-text",children:s("subpackageCollect.reportScene.readyDesc")})]}),e.jsx(d,{className:"subpkg-banner-action",size:"small",type:"primary",theme:"solid",onClick:he,children:s("subpackageCollect.action.finish")})]}):v&&(ge?e.jsxs("div",{className:"subpkg-banner subpkg-banner-warn",role:"alert",children:[e.jsx("span",{className:"subpkg-banner-bar","aria-hidden":"true"}),e.jsx("span",{className:"subpkg-banner-icon",children:e.jsx(te,{size:18,strokeWidth:2})}),e.jsxs("div",{className:"subpkg-banner-body",children:[e.jsx("div",{className:"subpkg-banner-title",children:s("subpackageCollect.wait.timeoutTitle")}),e.jsx("div",{className:"subpkg-banner-text",children:s("subpackageCollect.wait.timeout")})]}),e.jsx(X,{className:"subpkg-banner-cta",href:ie,children:s("subpackageCollect.wait.docLink")})]}):e.jsxs("div",{className:"subpkg-banner subpkg-banner-accent",role:"status",children:[e.jsx("span",{className:"subpkg-banner-bar","aria-hidden":"true"}),e.jsx("span",{className:"subpkg-banner-icon",children:e.jsx(U,{size:18,strokeWidth:2,className:"subpkg-wait-spin"})}),e.jsxs("div",{className:"subpkg-banner-body",children:[e.jsx("div",{className:"subpkg-banner-title",children:s("subpackageCollect.wait.runningTitle")}),e.jsx("div",{className:"subpkg-banner-progress",children:e.jsx(We,{})}),e.jsx("div",{className:"subpkg-banner-text",children:s("subpackageCollect.wait.running")})]})]})),Xe]}),e.jsxs(u,{padding:"lg",className:"subpkg-card subpkg-side",children:[e.jsx(P,{title:s("subpackageCollect.preview.collectedTitle"),subtitle:p.length?s("subpackageCollect.preview.collectedDesc"):s("subpackageCollect.preview.existingDesc")}),e.jsx(ne,{entries:ve,emptyText:s("subpackageCollect.preview.empty")}),g&&b.length>0&&e.jsx("p",{className:`subpkg-finish-note${p.length?"":" subpkg-finish-note-clear"}`,children:p.length?s("subpackageCollect.finish.overwriteNote",{current:p.length,existing:b.length}):s("subpackageCollect.finish.clearNote",{existing:b.length})}),!g&&e.jsxs("div",{className:"subpkg-actions",children:[e.jsx(d,{type:"tertiary",onClick:Ce,children:s("subpackageCollect.action.cancel")}),e.jsx(d,{type:"tertiary",onClick:je,children:s("subpackageCollect.action.exit")})]})]})]}),c==="processing"&&e.jsxs(u,{padding:"lg",className:"subpkg-card subpkg-center",children:[e.jsx(U,{size:28,strokeWidth:1.75,className:"subpkg-wait-spin"}),e.jsx("p",{className:"subpkg-center-text",children:be||s("subpackageCollect.processing.write")})]}),c==="success"&&e.jsxs(u,{padding:"lg",className:"subpkg-card",children:[e.jsxs("div",{className:"subpkg-result-head subpkg-result-success",children:[e.jsx(ae,{size:20,strokeWidth:1.75}),e.jsx("span",{children:s("subpackageCollect.success.title")})]}),e.jsxs("div",{className:"subpkg-entry-hint",children:[s("subpackageCollect.preview.currentEntry"),":",e.jsx("strong",{children:F||k})]}),e.jsx(ne,{entries:O,emptyText:s("subpackageCollect.success.empty")}),e.jsxs("div",{className:"subpkg-actions",children:[e.jsx(d,{type:"primary",theme:"solid",onClick:Q,children:s("subpackageCollect.action.recollect")}),x&&e.jsx(d,{type:"tertiary",onClick:Z,children:s("subpackageCollect.action.switch")})]})]}),c==="failed"&&e.jsxs(u,{padding:"lg",className:"subpkg-card",children:[e.jsxs("div",{className:"subpkg-result-head subpkg-result-failed",children:[e.jsx(se,{size:20,strokeWidth:1.75}),e.jsx("span",{children:s("subpackageCollect.failed.title")})]}),e.jsx("p",{className:"subpkg-error-msg",children:ke}),e.jsxs("div",{className:"subpkg-actions",children:[e.jsx(d,{type:"primary",theme:"solid",onClick:Q,children:s("subpackageCollect.action.recollect")}),x&&e.jsx(d,{type:"tertiary",onClick:Z,children:s("subpackageCollect.action.switch")})]})]})]})]})};export{os as SubpackageCollect};
@@ -1 +1 @@
1
- import{u as U,k as b,r as o,j as e,p as D,i as a,z as y,ad as F,e as A,T as m,d as E,av as I}from"./index-Bjn0ctEd.js";import{I as x,F as g}from"./baseForm-kBTxn8h8.js";import"./col-VN3Ivd-x.js";import"./index-DIcz5ciL.js";const B=()=>{const{state:{user:h}}=U(),r=b(h),[f,i]=o.useState(!1),[j,l]=o.useState(!1),[v,c]=o.useState(""),[d,n]=o.useState(""),p=o.useRef(null),u=()=>{l(!1),n(""),c("")},C=()=>{i(!1),u(),p.current?.formApi?.reset?.()},S=()=>{r&&i(!0)},N=s=>{const t=s;if(t?.code===0)I.success({title:a("uploadPlatformSuccess"),content:e.jsxs(e.Fragment,{children:[e.jsx("div",{children:a("uploadPlatformDesc")}),e.jsx("div",{style:{marginTop:12,display:"flex",justifyContent:"flex-end"},children:e.jsx(m.Text,{link:!0,onClick:()=>{window.open(t?.data?.detail,"_blank")},children:a("viewOnPlatform")})})]}),duration:10}),i(!1),u();else{const P=t?.error?.StatusMessage||t?.detail||a("uploadPlatformFailed");n(P),l(!1)}},T=s=>{const t=s?.error?.StatusMessage||s?.response?.detail||s?.message||a("uploadPlatformFailed");n(t),l(!1)},k=()=>{l(!0),E({method:"POST",url:"/game/upload",headers:{"ttmg-game-desc":encodeURIComponent(v||"--")}}).then(s=>{N(s)}).catch(s=>{T(s)})};return e.jsxs(e.Fragment,{children:[e.jsx(D,{content:()=>r?null:e.jsx("div",{className:"uploader-login-tip",children:a("loginToUpload")}),children:e.jsxs("div",{className:y("resource-uploader",{"resource-uploader-disabled":!r}),onClick:S,children:[e.jsx(x,{size:"default"}),e.jsx("div",{className:"uploader-text",children:a("upload")})]})}),e.jsx(F,{footer:null,visible:f,onCancel:C,title:a("uploadToPlatform"),children:e.jsxs("div",{className:"uploader-modal-content",children:[j&&e.jsx("div",{className:"upload-loading-container",children:e.jsx("div",{className:"loading-spin",children:e.jsx(A,{size:"large"})})}),d&&e.jsx(m.Text,{style:{color:"var(--tt-error-text)",marginBottom:12,marginTop:12},children:d}),e.jsxs(g,{ref:p,onChange:({values:s})=>{c(s?.gameDescription||"--"),n("")},children:[e.jsx(g.TextArea,{label:a("gameAssetDescription"),placeholder:a("gameAssetDescription"),field:"gameDescription"}),e.jsxs("div",{className:"uploader-button-container",onClick:k,children:[e.jsx(x,{className:"uploader-button-icon"}),e.jsx("div",{className:"uploader-button-text",children:a("uploadGamePackageTip")})]})]})]})})]})};export{B as GameUploader};
1
+ import{u as U,k as b,r as o,j as e,p as D,i as a,z as y,ad as F,e as A,T as m,d as E,av as I}from"./index-BegU9LBT.js";import{I as x,F as g}from"./baseForm-I9suIiQn.js";import"./col-w9Q-2mgM.js";import"./index-DEQ2hVPA.js";const B=()=>{const{state:{user:h}}=U(),r=b(h),[f,i]=o.useState(!1),[j,l]=o.useState(!1),[v,c]=o.useState(""),[d,n]=o.useState(""),p=o.useRef(null),u=()=>{l(!1),n(""),c("")},C=()=>{i(!1),u(),p.current?.formApi?.reset?.()},S=()=>{r&&i(!0)},N=s=>{const t=s;if(t?.code===0)I.success({title:a("uploadPlatformSuccess"),content:e.jsxs(e.Fragment,{children:[e.jsx("div",{children:a("uploadPlatformDesc")}),e.jsx("div",{style:{marginTop:12,display:"flex",justifyContent:"flex-end"},children:e.jsx(m.Text,{link:!0,onClick:()=>{window.open(t?.data?.detail,"_blank")},children:a("viewOnPlatform")})})]}),duration:10}),i(!1),u();else{const P=t?.error?.StatusMessage||t?.detail||a("uploadPlatformFailed");n(P),l(!1)}},T=s=>{const t=s?.error?.StatusMessage||s?.response?.detail||s?.message||a("uploadPlatformFailed");n(t),l(!1)},k=()=>{l(!0),E({method:"POST",url:"/game/upload",headers:{"ttmg-game-desc":encodeURIComponent(v||"--")}}).then(s=>{N(s)}).catch(s=>{T(s)})};return e.jsxs(e.Fragment,{children:[e.jsx(D,{content:()=>r?null:e.jsx("div",{className:"uploader-login-tip",children:a("loginToUpload")}),children:e.jsxs("div",{className:y("resource-uploader",{"resource-uploader-disabled":!r}),onClick:S,children:[e.jsx(x,{size:"default"}),e.jsx("div",{className:"uploader-text",children:a("upload")})]})}),e.jsx(F,{footer:null,visible:f,onCancel:C,title:a("uploadToPlatform"),children:e.jsxs("div",{className:"uploader-modal-content",children:[j&&e.jsx("div",{className:"upload-loading-container",children:e.jsx("div",{className:"loading-spin",children:e.jsx(A,{size:"large"})})}),d&&e.jsx(m.Text,{style:{color:"var(--tt-error-text)",marginBottom:12,marginTop:12},children:d}),e.jsxs(g,{ref:p,onChange:({values:s})=>{c(s?.gameDescription||"--"),n("")},children:[e.jsx(g.TextArea,{label:a("gameAssetDescription"),placeholder:a("gameAssetDescription"),field:"gameDescription"}),e.jsxs("div",{className:"uploader-button-container",onClick:k,children:[e.jsx(x,{className:"uploader-button-icon"}),e.jsx("div",{className:"uploader-button-text",children:a("uploadGamePackageTip")})]})]})]})})]})};export{B as GameUploader};
@@ -1 +1 @@
1
- import{h as a,u as l,k as c,j as s,p as t,cg as i,i as o,T as n,B as d}from"./index-Bjn0ctEd.js";const p=()=>{const r=a(),{state:{user:e}}=l();return c(e)?s.jsx(t,{position:"bottom",content:s.jsx("div",{className:"login-user-popover",children:e?.email||e?.user_id}),children:s.jsx(i,{color:"light-blue",style:{flexShrink:0},alt:e?.email||e?.user_id||void 0,size:"small",children:(e?.email||e?.user_id||"?").trim()[0]?.toUpperCase()||"?"})}):s.jsx(t,{position:"bottom",trigger:"hover",content:s.jsxs("div",{className:"not-login-status-popover",children:[s.jsxs("div",{className:"not-login-status-popover-copy",children:[s.jsx(n.Text,{strong:!0,children:o("notLogin")}),s.jsx(n.Text,{children:o("notLoginTip")}),s.jsx("code",{className:"not-login-status-command",children:"ttmg login"})]}),s.jsx("div",{className:"not-login-status-popover-actions",children:s.jsx(d,{size:"small",theme:"light",onClick:()=>r("/basic_debug_guide"),children:o("basicDebugGuide.entryAction")})})]}),children:s.jsx(i,{color:"grey",style:{flexShrink:0},size:"small",children:o("notLogin")})})};export{p as LoginStatus};
1
+ import{h as a,u as l,k as c,j as s,p as t,cg as i,i as o,T as n,B as d}from"./index-BegU9LBT.js";const p=()=>{const r=a(),{state:{user:e}}=l();return c(e)?s.jsx(t,{position:"bottom",content:s.jsx("div",{className:"login-user-popover",children:e?.email||e?.user_id}),children:s.jsx(i,{color:"light-blue",style:{flexShrink:0},alt:e?.email||e?.user_id||void 0,size:"small",children:(e?.email||e?.user_id||"?").trim()[0]?.toUpperCase()||"?"})}):s.jsx(t,{position:"bottom",trigger:"hover",content:s.jsxs("div",{className:"not-login-status-popover",children:[s.jsxs("div",{className:"not-login-status-popover-copy",children:[s.jsx(n.Text,{strong:!0,children:o("notLogin")}),s.jsx(n.Text,{children:o("notLoginTip")}),s.jsx("code",{className:"not-login-status-command",children:"ttmg login"})]}),s.jsx("div",{className:"not-login-status-popover-actions",children:s.jsx(d,{size:"small",theme:"light",onClick:()=>r("/basic_debug_guide"),children:o("basicDebugGuide.entryAction")})})]}),children:s.jsx(i,{color:"grey",style:{flexShrink:0},size:"small",children:o("notLogin")})})};export{p as LoginStatus};
@@ -1 +1 @@
1
- import{c as i,h as d,af as h,r as p,j as e,i as a}from"./index-Bjn0ctEd.js";import{C as l}from"./compass-BabZVjAl.js";import{Z as u}from"./zap-DFHw5liD.js";const y=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],m=i("cloud-upload",y);const x=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],_=i("layout-dashboard",x);const k=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],g=i("qr-code",k),v=[{itemKey:"scan_qrcode",text:a("scanQRCode2Debug"),icon:g,path:"/"},{itemKey:"project_overview",text:a("projectInfo"),icon:_,path:"/project_overview"},{itemKey:"integration_assistant",text:a("integrationAssistant"),icon:l,path:"/integration_assistant"},{itemKey:"performance",text:a("performance.menu.title"),icon:u,path:"/performance"},{itemKey:"upload_publish",text:a("codePreCheck"),icon:m,path:"/upload_publish"}],w=()=>{const s=d(),r=h(),n=p.useMemo(()=>{const t=r.pathname;return t==="/"||["/basic_debug_guide","/network_diagnostics","/manual_connect","/launch_mode","/debug_setting"].includes(t)?"scan_qrcode":t.startsWith("/integration_assistant")?"integration_assistant":t==="/performance"||t==="/wasm_split"||t==="/subpackage_collect"?"performance":t==="/project_overview"||t==="/project_detail"?"project_overview":t==="/upload_publish"||t==="/version_upload"||t==="/precheck_code"?"upload_publish":""},[r.pathname]);return e.jsx("nav",{className:"tt-sidebar","aria-label":"primary",children:e.jsx("ul",{className:"tt-sidebar-list",children:v.map(t=>{const c=t.icon,o=t.itemKey===n;return e.jsx("li",{children:e.jsxs("button",{type:"button",className:o?"tt-sidebar-item tt-sidebar-item-active":"tt-sidebar-item",onClick:()=>s(t.path),"aria-current":o?"page":void 0,children:[e.jsx("span",{className:"tt-sidebar-item-icon","aria-hidden":"true",children:e.jsx(c,{size:16,strokeWidth:1.75})}),e.jsx("span",{className:"tt-sidebar-item-text",children:t.text})]})},t.itemKey)})})})};export{w as Sidebar};
1
+ import{c as i,h as d,af as h,r as p,j as e,i as a}from"./index-BegU9LBT.js";import{C as l}from"./compass-D6waJ52O.js";import{Z as u}from"./zap-BAhZUPPa.js";const y=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],m=i("cloud-upload",y);const x=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],_=i("layout-dashboard",x);const k=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],g=i("qr-code",k),v=[{itemKey:"scan_qrcode",text:a("scanQRCode2Debug"),icon:g,path:"/"},{itemKey:"project_overview",text:a("projectInfo"),icon:_,path:"/project_overview"},{itemKey:"integration_assistant",text:a("integrationAssistant"),icon:l,path:"/integration_assistant"},{itemKey:"performance",text:a("performance.menu.title"),icon:u,path:"/performance"},{itemKey:"upload_publish",text:a("codePreCheck"),icon:m,path:"/upload_publish"}],w=()=>{const s=d(),r=h(),n=p.useMemo(()=>{const t=r.pathname;return t==="/"||["/basic_debug_guide","/network_diagnostics","/manual_connect","/launch_mode","/debug_setting"].includes(t)?"scan_qrcode":t.startsWith("/integration_assistant")?"integration_assistant":t==="/performance"||t==="/wasm_split"||t==="/subpackage_collect"?"performance":t==="/project_overview"||t==="/project_detail"?"project_overview":t==="/upload_publish"||t==="/version_upload"||t==="/precheck_code"?"upload_publish":""},[r.pathname]);return e.jsx("nav",{className:"tt-sidebar","aria-label":"primary",children:e.jsx("ul",{className:"tt-sidebar-list",children:v.map(t=>{const c=t.icon,o=t.itemKey===n;return e.jsx("li",{children:e.jsxs("button",{type:"button",className:o?"tt-sidebar-item tt-sidebar-item-active":"tt-sidebar-item",onClick:()=>s(t.path),"aria-current":o?"page":void 0,children:[e.jsx("span",{className:"tt-sidebar-item-icon","aria-hidden":"true",children:e.jsx(c,{size:16,strokeWidth:1.75})}),e.jsx("span",{className:"tt-sidebar-item-text",children:t.text})]})},t.itemKey)})})})};export{w as Sidebar};
@@ -1 +1 @@
1
- import{i as e,h as F,u as D,r as o,N as b,j as n,v as q,B as x}from"./index-Bjn0ctEd.js";import{P as w}from"./index-BxsB5E3u.js";import{F as r}from"./baseForm-kBTxn8h8.js";import"./col-VN3Ivd-x.js";import"./index-DIcz5ciL.js";const O=[{label:e("scene_scan_qrcode"),value:"scan_qrcode"},{label:e("scene_search"),value:"search"},{label:e("scene_fyf_promotion_direct_feed_play"),value:"fyf_promotion_direct_feed_play"},{label:e("scene_anchor"),value:"anchor"},{label:e("scene_center"),value:"center"},{label:e("scene_ad"),value:"ads"},{label:e("scene_shortcut"),value:"desktop_shortcut"},{label:e("scene_sharing"),value:"dm_sharing"},{label:e("scene_link"),value:"minis_link"},{label:e("scene_inbox"),value:"inbox"}];function M(c){return c.id==="normal"?e("normalLaunchMode"):c.id==="created"?e("createdLaunchMode"):c.name}function A(c){return{...c,name:M(c)}}const B=()=>{const c=F(),{state:{launchOptions:t,selectedLaunchOption:j,packages:_},setLaunchOptions:f,setSelectedLaunchOption:v}=D(),i=o.useRef(null),u=A(j||b),[g,m]=o.useState(u),[h,N]=o.useState(u.id),y=_.map(a=>{if(a.type==="main")return{label:e("gameMainPackage"),value:a.name};if(a.type==="independent")return{label:`${e("independentPackage")}: ${a.name}`,value:a.name}}).filter(Boolean),L=o.useCallback(a=>{const l={...g,...a};l.pkgType==="main"&&l.independentPkg!==void 0&&(l.independentPkg=void 0,i.current&&i.current.setValues({independentPkg:void 0})),m(l)},[g]),k=o.useCallback(()=>{if(!i.current)return;const a=i.current.getValues();a.pkgType==="main"&&(a.independentPkg=void 0);const l=t.findIndex(d=>d.name===a.name&&d.id!=="created"&&d.id!=="normal");let s;l!==-1?(s=[...t],s[l]=a):(a.id=Date.now().toString(),s=[...t.slice(0,-1),a,...t.slice(-1)]),f(s),m(a),v(a),c("/")},[t,c,f,v]),S=o.useCallback(a=>{const l=t.find(s=>s.id===a);if(l){N(a);const s={...l};a==="created"?s.name="":a==="normal"&&(s.name=e("normalLaunchMode")),m(s),i.current?.setValues(s)}},[t]),C=o.useCallback(()=>{const a=h;if(["normal","created"].includes(a))return;const l=t.filter(p=>p.id!==a);f(l);const s=l.find(p=>p.id==="normal")||l.find(p=>p.id==="created")||l[0]||b,d={...s,...s.id==="created"?{name:""}:{},...s.id==="normal"?{name:e("normalLaunchMode")}:{}};v(d),N(d.id),m(d),i.current?.setValues(d)},[t,h,f,v]),V=o.useCallback(()=>{m(u),i.current?.setValues(u),c("/")},[u,c]),P=t.find(a=>a.id===h);return n.jsxs("div",{className:"launch-mode-page",children:[n.jsxs("section",{className:"launch-mode-guide",children:[n.jsx("div",{className:"launch-mode-guide-marker"}),n.jsxs("div",{className:"launch-mode-guide-copy",children:[n.jsx("div",{className:"launch-mode-guide-title",children:e("launchMode")}),n.jsx("div",{className:"launch-mode-guide-desc",children:e("launchModeDesc")})]})]}),n.jsxs(r,{className:"launch-mode-form",initValues:g,onValueChange:L,getFormApi:a=>i.current=a,onSubmit:k,children:[n.jsxs("div",{className:"launch-mode-form-section launch-mode-current-section",children:[n.jsxs("div",{className:"launch-mode-section-head",children:[n.jsx("div",{className:"launch-mode-section-title",children:e("selectLaunchMode")}),n.jsx("div",{className:"launch-mode-section-desc",children:e("launchMode.currentDesc")})]}),n.jsx(r.Select,{className:"launch-mode-control",placeholder:e("selectLaunchMode"),rules:[{required:!0,message:e("selectLaunchMode")}],field:"id",noLabel:!0,optionList:t.map(a=>({label:M(a),value:a.id})),onChange:S,style:{width:"100%"},value:h})]}),n.jsxs("div",{className:"launch-mode-form-section",children:[n.jsxs("div",{className:"launch-mode-section-head",children:[n.jsx("div",{className:"launch-mode-section-title",children:e("customizeLaunchMode")}),n.jsx("div",{className:"launch-mode-section-desc",children:e("launchMode.configDesc")})]}),n.jsxs("div",{className:"launch-mode-field-grid",children:[n.jsx(r.Input,{className:"launch-mode-control",required:!0,placeholder:e("launchModeName"),field:"name",label:e("launchModeName"),rules:[{required:!0,message:e("notEmpty")}],style:{width:"100%"},trigger:"blur"}),n.jsx(r.Select,{className:"launch-mode-control",field:"pkgName",label:e("selectLaunchPkg"),placeholder:e("selectLaunchPkg"),rules:[{required:!0,message:e("notEmpty")}],optionList:y,style:{width:"100%"}}),n.jsx(r.Select,{className:"launch-mode-control",field:"scene",label:e("selectScene"),rules:[{required:!0,message:e("notEmpty")}],placeholder:e("selectScene"),optionList:O,style:{width:"100%"},filter:!0}),n.jsx(r.Input,{className:"launch-mode-control",field:"queries",label:e("launchQueries"),placeholder:e("launchQueriesDesc"),trigger:"blur",rules:[{validator:(a,l)=>{const{isValid:s,message:d}=q(l);return s?Promise.resolve():Promise.reject(d)}}],style:{width:"100%"}})]})]}),n.jsxs("div",{className:"launch-mode-actions",children:[["created","normal"].includes(h)?n.jsx(x,{className:"launch-mode-secondary-action",onClick:V,children:e("cancel")}):n.jsx(w,{title:e("deleteLaunchModeConfirm",{name:P?.name??""}),onConfirm:C,position:"bottomRight",children:n.jsx(x,{className:"launch-mode-danger-action",type:"danger",children:e("delete")})}),n.jsx(x,{className:"launch-mode-primary-action",htmlType:"submit",type:"primary",children:e("saveAndUse")})]})]})]})};export{B as LaunchMode};
1
+ import{i as e,h as F,u as D,r as o,N as b,j as n,v as q,B as x}from"./index-BegU9LBT.js";import{P as w}from"./index-BvPolBSn.js";import{F as r}from"./baseForm-I9suIiQn.js";import"./col-w9Q-2mgM.js";import"./index-DEQ2hVPA.js";const O=[{label:e("scene_scan_qrcode"),value:"scan_qrcode"},{label:e("scene_search"),value:"search"},{label:e("scene_fyf_promotion_direct_feed_play"),value:"fyf_promotion_direct_feed_play"},{label:e("scene_anchor"),value:"anchor"},{label:e("scene_center"),value:"center"},{label:e("scene_ad"),value:"ads"},{label:e("scene_shortcut"),value:"desktop_shortcut"},{label:e("scene_sharing"),value:"dm_sharing"},{label:e("scene_link"),value:"minis_link"},{label:e("scene_inbox"),value:"inbox"}];function M(c){return c.id==="normal"?e("normalLaunchMode"):c.id==="created"?e("createdLaunchMode"):c.name}function A(c){return{...c,name:M(c)}}const B=()=>{const c=F(),{state:{launchOptions:t,selectedLaunchOption:j,packages:_},setLaunchOptions:f,setSelectedLaunchOption:v}=D(),i=o.useRef(null),u=A(j||b),[g,m]=o.useState(u),[h,N]=o.useState(u.id),y=_.map(a=>{if(a.type==="main")return{label:e("gameMainPackage"),value:a.name};if(a.type==="independent")return{label:`${e("independentPackage")}: ${a.name}`,value:a.name}}).filter(Boolean),L=o.useCallback(a=>{const l={...g,...a};l.pkgType==="main"&&l.independentPkg!==void 0&&(l.independentPkg=void 0,i.current&&i.current.setValues({independentPkg:void 0})),m(l)},[g]),k=o.useCallback(()=>{if(!i.current)return;const a=i.current.getValues();a.pkgType==="main"&&(a.independentPkg=void 0);const l=t.findIndex(d=>d.name===a.name&&d.id!=="created"&&d.id!=="normal");let s;l!==-1?(s=[...t],s[l]=a):(a.id=Date.now().toString(),s=[...t.slice(0,-1),a,...t.slice(-1)]),f(s),m(a),v(a),c("/")},[t,c,f,v]),S=o.useCallback(a=>{const l=t.find(s=>s.id===a);if(l){N(a);const s={...l};a==="created"?s.name="":a==="normal"&&(s.name=e("normalLaunchMode")),m(s),i.current?.setValues(s)}},[t]),C=o.useCallback(()=>{const a=h;if(["normal","created"].includes(a))return;const l=t.filter(p=>p.id!==a);f(l);const s=l.find(p=>p.id==="normal")||l.find(p=>p.id==="created")||l[0]||b,d={...s,...s.id==="created"?{name:""}:{},...s.id==="normal"?{name:e("normalLaunchMode")}:{}};v(d),N(d.id),m(d),i.current?.setValues(d)},[t,h,f,v]),V=o.useCallback(()=>{m(u),i.current?.setValues(u),c("/")},[u,c]),P=t.find(a=>a.id===h);return n.jsxs("div",{className:"launch-mode-page",children:[n.jsxs("section",{className:"launch-mode-guide",children:[n.jsx("div",{className:"launch-mode-guide-marker"}),n.jsxs("div",{className:"launch-mode-guide-copy",children:[n.jsx("div",{className:"launch-mode-guide-title",children:e("launchMode")}),n.jsx("div",{className:"launch-mode-guide-desc",children:e("launchModeDesc")})]})]}),n.jsxs(r,{className:"launch-mode-form",initValues:g,onValueChange:L,getFormApi:a=>i.current=a,onSubmit:k,children:[n.jsxs("div",{className:"launch-mode-form-section launch-mode-current-section",children:[n.jsxs("div",{className:"launch-mode-section-head",children:[n.jsx("div",{className:"launch-mode-section-title",children:e("selectLaunchMode")}),n.jsx("div",{className:"launch-mode-section-desc",children:e("launchMode.currentDesc")})]}),n.jsx(r.Select,{className:"launch-mode-control",placeholder:e("selectLaunchMode"),rules:[{required:!0,message:e("selectLaunchMode")}],field:"id",noLabel:!0,optionList:t.map(a=>({label:M(a),value:a.id})),onChange:S,style:{width:"100%"},value:h})]}),n.jsxs("div",{className:"launch-mode-form-section",children:[n.jsxs("div",{className:"launch-mode-section-head",children:[n.jsx("div",{className:"launch-mode-section-title",children:e("customizeLaunchMode")}),n.jsx("div",{className:"launch-mode-section-desc",children:e("launchMode.configDesc")})]}),n.jsxs("div",{className:"launch-mode-field-grid",children:[n.jsx(r.Input,{className:"launch-mode-control",required:!0,placeholder:e("launchModeName"),field:"name",label:e("launchModeName"),rules:[{required:!0,message:e("notEmpty")}],style:{width:"100%"},trigger:"blur"}),n.jsx(r.Select,{className:"launch-mode-control",field:"pkgName",label:e("selectLaunchPkg"),placeholder:e("selectLaunchPkg"),rules:[{required:!0,message:e("notEmpty")}],optionList:y,style:{width:"100%"}}),n.jsx(r.Select,{className:"launch-mode-control",field:"scene",label:e("selectScene"),rules:[{required:!0,message:e("notEmpty")}],placeholder:e("selectScene"),optionList:O,style:{width:"100%"},filter:!0}),n.jsx(r.Input,{className:"launch-mode-control",field:"queries",label:e("launchQueries"),placeholder:e("launchQueriesDesc"),trigger:"blur",rules:[{validator:(a,l)=>{const{isValid:s,message:d}=q(l);return s?Promise.resolve():Promise.reject(d)}}],style:{width:"100%"}})]})]}),n.jsxs("div",{className:"launch-mode-actions",children:[["created","normal"].includes(h)?n.jsx(x,{className:"launch-mode-secondary-action",onClick:V,children:e("cancel")}):n.jsx(w,{title:e("deleteLaunchModeConfirm",{name:P?.name??""}),onConfirm:C,position:"bottomRight",children:n.jsx(x,{className:"launch-mode-danger-action",type:"danger",children:e("delete")})}),n.jsx(x,{className:"launch-mode-primary-action",htmlType:"submit",type:"primary",children:e("saveAndUse")})]})]})]})};export{B as LaunchMode};
@@ -1 +1 @@
1
- import{ag as U,r as T,bF as J,bG as K,aw as H,t as $,w as M,U as _,bt as Q,R as o,z as P,M as I,J as t,y as L,aR as w,aN as ee,aS as te}from"./index-Bjn0ctEd.js";function ae(u){return T.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},u),T.createElement("path",{d:"M5 12.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 5 12.5Z",fill:"currentColor"}))}const se=U(ae,"checkbox_indeterminate");function ne(u){return T.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},u),T.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.41 7.3c.66.51.78 1.45.28 2.11l-6.5 8.5a1.5 1.5 0 0 1-2.37.01l-3.5-4.5a1.5 1.5 0 1 1 2.36-1.84L10 14.54l5.32-6.95a1.5 1.5 0 0 1 2.1-.28Z",fill:"currentColor"}))}const re=U(ne,"checkbox_tick");var R,j;function ie(){if(j)return R;j=1;var u=J(),e=K(),a="[object Boolean]";function s(r){return r===!0||r===!1||e(r)&&u(r)==a}return R=s,R}var oe=ie();const de=H(oe),G={PREFIX:`${$}-checkbox`,INPUT:`${$}-checkbox-input`,WRAPPER:""},le={PREFIX:`${$}-checkboxGroup`},p={DIRECTION_SET:["horizontal","vertical"],TYPE_DEFAULT:"default",TYPE_CARD:"card",TYPE_PURECARD:"pureCard",DEFAULT_DIRECTION:"vertical"};class ce extends M{constructor(e){super(Object.assign({},e)),this.clickState=!1,this.handleFocusVisible=a=>{const{target:s}=a;try{if(this.clickState){this.clickState=!1;return}s.matches(":focus-visible")&&this._adapter.setFocusVisible(!0)}catch{_(!0,"Warning: [Semi Checkbox] The current browser does not support the focus-visible")}},this.handleBlur=()=>{this.clickState=!1,this._adapter.setFocusVisible(!1)}}init(){const{children:e,extra:a,extraId:s,addonId:r}=this.getProps();e&&!r&&this._adapter.setAddonId(),a&&!s&&this._adapter.setExtraId()}notifyChange(e,a){const s=this._adapter.generateEvent(e,a);this._adapter.notifyChange(s)}handleChange(e){if(this.getProp("disabled"))return;if(e?.type==="click"&&(this.clickState=!0),this._adapter.focusCheckboxEntity(),this._adapter.getIsInGroup()){this._adapter.getGroupDisabled()||this.handleChangeInGroup(e);return}const l=!this.getState("checked");this._isControlledComponent("checked")?this.notifyChange(l,e):(this.setChecked(l),this.notifyChange(l,e))}handleChangeInGroup(e){const{value:a}=this.getProps(),l=!this._adapter.getGroupValue().includes(a),c=this._adapter.generateEvent(l,e);this._adapter.notifyChange(c),this._adapter.notifyGroupChange(c)}handleEnterPress(e){Q(e)&&this.handleChange(e)}setChecked(e){this._adapter.setNativeControlChecked(e)}destroy(){}}const N=o.createContext({});class A extends T.PureComponent{blur(){this.inputEntity.blur()}focus(){const{preventScroll:e}=this.props;this.inputEntity.focus({preventScroll:e})}render(){const{indeterminate:e,checked:a,disabled:s,prefixCls:r,name:l,isPureCardType:c,addonId:E,extraId:x,focusInner:f,onInputFocus:g,onInputBlur:m}=this.props,h=r||G.PREFIX,v=P({[`${h}-inner`]:!0,[`${h}-inner-checked`]:!!a,[`${h}-inner-pureCardType`]:c},G.WRAPPER),k=P({[`${h}-inner-display`]:!0,[`${h}-focus`]:f,[`${h}-focus-border`]:f&&!a}),C=a?o.createElement(re,null):e?o.createElement(se,null):null,i={type:"checkbox","aria-label":this.props["aria-label"],"aria-disabled":s,"aria-checked":a,"aria-labelledby":E,"aria-describedby":x||this.props["aria-describedby"],"aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-required":this.props["aria-required"],className:G.INPUT,onChange:I,checked:a,disabled:s,onFocus:g,onBlur:m};return l&&(i.name=l),o.createElement("span",{className:v},o.createElement("input",Object.assign({},i,{ref:b=>{this.inputEntity=b}})),o.createElement("span",{className:k},C))}}A.contextType=N;A.propTypes={"aria-describedby":t.string,"aria-errormessage":t.string,"aria-invalid":t.bool,"aria-labelledby":t.string,"aria-required":t.bool,checked:t.bool,disabled:t.bool,onChange:t.func,children:t.node,grouped:t.bool,value:t.any,isPureCardType:t.bool,addonId:t.string,extraId:t.string,focusInner:t.bool,onInputFocus:t.func,onInputBlur:t.func,preventScroll:t.bool};A.defaultProps={onChange:I};class y extends L{get adapter(){return Object.assign(Object.assign({},super.adapter),{setNativeControlChecked:e=>{this.setState({checked:e})},notifyChange:e=>{const{onChange:a}=this.props;a&&a(e)},generateEvent:(e,a)=>{const{props:s}=this;return{target:Object.assign(Object.assign({},s),{checked:e}),stopPropagation:()=>{a.stopPropagation()},preventDefault:()=>{a.preventDefault()},nativeEvent:{stopImmediatePropagation:()=>{a.nativeEvent&&typeof a.nativeEvent.stopImmediatePropagation=="function"&&a.nativeEvent.stopImmediatePropagation()}}}},getIsInGroup:()=>this.isInGroup(),getGroupValue:()=>this.context&&this.context.checkboxGroup.value||[],notifyGroupChange:e=>{this.context.checkboxGroup.onChange(e)},getGroupDisabled:()=>this.context&&this.context.checkboxGroup.disabled,setAddonId:()=>{this.setState({addonId:w({prefix:"addon"})})},setExtraId:()=>{this.setState({extraId:w({prefix:"extra"})})},setFocusVisible:e=>{this.setState({focusVisible:e})},focusCheckboxEntity:()=>{this.focus()}})}constructor(e){super(e),this.handleChange=s=>this.foundation.handleChange(s),this.handleEnterPress=s=>this.foundation.handleEnterPress(s),this.handleFocusVisible=s=>{this.foundation.handleFocusVisible(s)},this.handleBlur=s=>{this.foundation.handleBlur()};const a=!1;this.state={checked:e.checked||e.defaultChecked||a,addonId:e.addonId,extraId:e.extraId,focusVisible:!1},this.checkboxEntity=null,this.foundation=new ce(this.adapter)}componentDidUpdate(e){this.props.checked!==e.checked&&(ee(this.props.checked)?this.foundation.setChecked(!1):de(this.props.checked)&&this.foundation.setChecked(this.props.checked))}isInGroup(){return!!(this.context&&this.context.checkboxGroup&&"value"in this.props)}focus(){this.checkboxEntity&&this.checkboxEntity.focus()}blur(){this.checkboxEntity&&this.checkboxEntity.blur()}render(){const{disabled:e,style:a,prefixCls:s,className:r,indeterminate:l,children:c,onMouseEnter:E,onMouseLeave:x,extra:f,value:g,role:m,tabIndex:h,id:v,type:k}=this.props,{checked:C,addonId:i,extraId:b,focusVisible:V}=this.state,n={checked:C,disabled:e},O=this.isInGroup();if(O){if(this.context.checkboxGroup.value){const Z=(this.context.checkboxGroup.value||[]).includes(g);n.checked=Z}this.context.checkboxGroup.disabled&&(n.disabled=this.context.checkboxGroup.disabled||this.props.disabled);const{isCardType:D,isPureCardType:z}=this.context.checkboxGroup;n.isCardType=D,n.isPureCardType=z,n.name=this.context.checkboxGroup.name}else n.isPureCardType=k===p.TYPE_PURECARD,n.isCardType=k===p.TYPE_CARD||n.isPureCardType;const d=s||G.PREFIX,B=n.isCardType||n.isPureCardType,Y=P(d,{[`${d}-disabled`]:n.disabled,[`${d}-indeterminate`]:l,[`${d}-checked`]:n.checked,[`${d}-unChecked`]:!n.checked,[`${d}-cardType`]:n.isCardType,[`${d}-cardType_disabled`]:n.disabled&&n.isCardType,[`${d}-cardType_enable`]:!(n.disabled&&n.isCardType),[`${d}-cardType_checked`]:n.isCardType&&n.checked&&!n.disabled,[`${d}-cardType_checked_disabled`]:n.isCardType&&n.checked&&n.disabled,[r]:!!r,[`${d}-focus`]:V&&B}),q=P(`${d}-extra`,{[`${d}-cardType_extra_noChildren`]:n.isCardType&&!c});O&&this.context.checkboxGroup.name;const W=this.props["x-semi-children-alias"]||"children",X=()=>!c&&!f?null:o.createElement("div",{className:`${d}-content`},c?o.createElement("span",{id:i,className:`${d}-addon`,"x-semi-prop":W},c):null,f?o.createElement("div",{id:b,className:q,"x-semi-prop":"extra"},f):null);return o.createElement("span",Object.assign({role:m,tabIndex:h,style:a,className:Y,id:v,onMouseEnter:E,onMouseLeave:x,onClick:this.handleChange,onKeyPress:this.handleEnterPress,"aria-labelledby":this.props["aria-labelledby"]},this.getDataAttr(this.props)),o.createElement(A,Object.assign({},this.props,n,{addonId:c&&i,extraId:f&&b,isPureCardType:n.isPureCardType,ref:D=>{this.checkboxEntity=D},focusInner:V&&!B,onInputFocus:this.handleFocusVisible,onInputBlur:this.handleBlur})),X())}}y.contextType=N;y.propTypes={"aria-describedby":t.string,"aria-errormessage":t.string,"aria-invalid":t.bool,"aria-labelledby":t.string,"aria-required":t.bool,checked:t.bool,defaultChecked:t.bool,disabled:t.bool,indeterminate:t.bool,onChange:t.func,value:t.any,style:t.object,className:t.string,prefixCls:t.string,onMouseEnter:t.func,onMouseLeave:t.func,extra:t.node,index:t.number,"aria-label":t.string,tabIndex:t.number,preventScroll:t.bool,type:t.string};y.defaultProps={defaultChecked:!1,indeterminate:!1,onChange:I,onMouseEnter:I,onMouseLeave:I,type:"default"};y.elementType="Checkbox";class S extends M{static get checkboxGroupDefaultAdapter(){return{}}constructor(e){super(Object.assign(Object.assign({},S.checkboxGroupDefaultAdapter),e))}init(){const{defaultValue:e,value:a}=this.getProps();typeof e<"u"&&!Array.isArray(e)&&_(!0,"Warning: [Semi CheckboxGroup] defaultValue should be an Array"),typeof a<"u"&&!Array.isArray(a)&&_(!0,"Warning: [Semi CheckboxGroup] value should be an Array")}notifyChange(e){this._adapter.notifyChange(e)}handleChange(e){const a=this.getState("value");let s=[];Array.isArray(a)||(s=[a]),e.target.checked?s=[...a,e.target.value]:s=a.filter((l,c)=>l!==e.target.value),"value"in this.getProps()?this.notifyChange(s):(this._adapter.updateGroupValue(s),this.notifyChange(s))}getFormatName(){return this.getProp("name")||"default"}handlePropValueChange(e){Array.isArray(e)?this._adapter.updateGroupValue(e):(typeof e>"u"&&this._adapter.updateGroupValue([]),_(!0,"Warning: [Semi CheckboxGroup] value should be an Array"))}destroy(){}}class F extends L{get adapter(){return Object.assign(Object.assign({},super.adapter),{updateGroupValue:e=>{this.setState({value:e})},notifyChange:e=>{this.props.onChange&&this.props.onChange(e)}})}constructor(e){super(e),this.state={value:e.value||e.defaultValue},this.foundation=new S(this.adapter),this.onChange=this.onChange.bind(this)}componentDidMount(){this.foundation.init()}componentDidUpdate(e){te(e.value,this.props.value)||this.foundation.handlePropValueChange(this.props.value)}componentWillUnmount(){this.foundation.destroy()}onChange(e){this.foundation.handleChange(e)}render(){const{children:e,options:a,prefixCls:s,direction:r,className:l,id:c,style:E,type:x,disabled:f}=this.props,g=x===p.TYPE_PURECARD,m=x===p.TYPE_CARD||g,h=s||le.PREFIX,v=P({[h]:!0,[`${h}-wrapper`]:!0,[`${h}-${r}`]:r,[`${h}-${r}-cardType`]:r&&m,[`${h}-${r}-pureCardType`]:r&&g},l),k=this.state.value.slice();let C;return a?C=(a||[]).map((i,b)=>typeof i=="string"?o.createElement(y,{role:"listitem",key:b,disabled:this.props.disabled,value:i,prefixCls:s},i):o.createElement(y,{role:"listitem",key:b,disabled:i.disabled||this.props.disabled,value:i.value,prefixCls:s,extra:i.extra,className:i.className,style:i.style,onChange:i.onChange},i.label)):e&&(C=o.Children.toArray(e).map((i,b)=>o.cloneElement(i,{key:b,role:"listitem"}))),o.createElement("div",Object.assign({id:c,role:"list","aria-label":this.props["aria-label"],className:v,style:E,"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"]},this.getDataAttr(this.props)),o.createElement(N.Provider,{value:{checkboxGroup:{onChange:this.onChange,value:k,disabled:this.props.disabled,name:this.foundation.getFormatName(),isCardType:m,isPureCardType:g}}},C))}}F.propTypes={"aria-describedby":t.string,"aria-errormessage":t.string,"aria-invalid":t.bool,"aria-labelledby":t.string,"aria-required":t.bool,defaultValue:t.array,disabled:t.bool,name:t.string,options:t.array,value:t.array,onChange:t.func,children:t.node,prefixCls:t.string,direction:t.oneOf(p.DIRECTION_SET),className:t.string,type:t.oneOf([p.TYPE_DEFAULT,p.TYPE_CARD,p.TYPE_PURECARD]),style:t.object};F.defaultProps={disabled:!1,onChange:()=>{},type:p.TYPE_DEFAULT,defaultValue:[],direction:p.DEFAULT_DIRECTION};class he extends y{}he.Group=F;export{he as C,de as _,y as a,F as b};
1
+ import{ag as U,r as T,bF as J,bG as K,aw as H,t as $,w as M,U as _,bt as Q,R as o,z as P,M as I,J as t,y as L,aR as w,aN as ee,aS as te}from"./index-BegU9LBT.js";function ae(u){return T.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},u),T.createElement("path",{d:"M5 12.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 5 12.5Z",fill:"currentColor"}))}const se=U(ae,"checkbox_indeterminate");function ne(u){return T.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},u),T.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.41 7.3c.66.51.78 1.45.28 2.11l-6.5 8.5a1.5 1.5 0 0 1-2.37.01l-3.5-4.5a1.5 1.5 0 1 1 2.36-1.84L10 14.54l5.32-6.95a1.5 1.5 0 0 1 2.1-.28Z",fill:"currentColor"}))}const re=U(ne,"checkbox_tick");var R,j;function ie(){if(j)return R;j=1;var u=J(),e=K(),a="[object Boolean]";function s(r){return r===!0||r===!1||e(r)&&u(r)==a}return R=s,R}var oe=ie();const de=H(oe),G={PREFIX:`${$}-checkbox`,INPUT:`${$}-checkbox-input`,WRAPPER:""},le={PREFIX:`${$}-checkboxGroup`},p={DIRECTION_SET:["horizontal","vertical"],TYPE_DEFAULT:"default",TYPE_CARD:"card",TYPE_PURECARD:"pureCard",DEFAULT_DIRECTION:"vertical"};class ce extends M{constructor(e){super(Object.assign({},e)),this.clickState=!1,this.handleFocusVisible=a=>{const{target:s}=a;try{if(this.clickState){this.clickState=!1;return}s.matches(":focus-visible")&&this._adapter.setFocusVisible(!0)}catch{_(!0,"Warning: [Semi Checkbox] The current browser does not support the focus-visible")}},this.handleBlur=()=>{this.clickState=!1,this._adapter.setFocusVisible(!1)}}init(){const{children:e,extra:a,extraId:s,addonId:r}=this.getProps();e&&!r&&this._adapter.setAddonId(),a&&!s&&this._adapter.setExtraId()}notifyChange(e,a){const s=this._adapter.generateEvent(e,a);this._adapter.notifyChange(s)}handleChange(e){if(this.getProp("disabled"))return;if(e?.type==="click"&&(this.clickState=!0),this._adapter.focusCheckboxEntity(),this._adapter.getIsInGroup()){this._adapter.getGroupDisabled()||this.handleChangeInGroup(e);return}const l=!this.getState("checked");this._isControlledComponent("checked")?this.notifyChange(l,e):(this.setChecked(l),this.notifyChange(l,e))}handleChangeInGroup(e){const{value:a}=this.getProps(),l=!this._adapter.getGroupValue().includes(a),c=this._adapter.generateEvent(l,e);this._adapter.notifyChange(c),this._adapter.notifyGroupChange(c)}handleEnterPress(e){Q(e)&&this.handleChange(e)}setChecked(e){this._adapter.setNativeControlChecked(e)}destroy(){}}const N=o.createContext({});class A extends T.PureComponent{blur(){this.inputEntity.blur()}focus(){const{preventScroll:e}=this.props;this.inputEntity.focus({preventScroll:e})}render(){const{indeterminate:e,checked:a,disabled:s,prefixCls:r,name:l,isPureCardType:c,addonId:E,extraId:x,focusInner:f,onInputFocus:g,onInputBlur:m}=this.props,h=r||G.PREFIX,v=P({[`${h}-inner`]:!0,[`${h}-inner-checked`]:!!a,[`${h}-inner-pureCardType`]:c},G.WRAPPER),k=P({[`${h}-inner-display`]:!0,[`${h}-focus`]:f,[`${h}-focus-border`]:f&&!a}),C=a?o.createElement(re,null):e?o.createElement(se,null):null,i={type:"checkbox","aria-label":this.props["aria-label"],"aria-disabled":s,"aria-checked":a,"aria-labelledby":E,"aria-describedby":x||this.props["aria-describedby"],"aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-required":this.props["aria-required"],className:G.INPUT,onChange:I,checked:a,disabled:s,onFocus:g,onBlur:m};return l&&(i.name=l),o.createElement("span",{className:v},o.createElement("input",Object.assign({},i,{ref:b=>{this.inputEntity=b}})),o.createElement("span",{className:k},C))}}A.contextType=N;A.propTypes={"aria-describedby":t.string,"aria-errormessage":t.string,"aria-invalid":t.bool,"aria-labelledby":t.string,"aria-required":t.bool,checked:t.bool,disabled:t.bool,onChange:t.func,children:t.node,grouped:t.bool,value:t.any,isPureCardType:t.bool,addonId:t.string,extraId:t.string,focusInner:t.bool,onInputFocus:t.func,onInputBlur:t.func,preventScroll:t.bool};A.defaultProps={onChange:I};class y extends L{get adapter(){return Object.assign(Object.assign({},super.adapter),{setNativeControlChecked:e=>{this.setState({checked:e})},notifyChange:e=>{const{onChange:a}=this.props;a&&a(e)},generateEvent:(e,a)=>{const{props:s}=this;return{target:Object.assign(Object.assign({},s),{checked:e}),stopPropagation:()=>{a.stopPropagation()},preventDefault:()=>{a.preventDefault()},nativeEvent:{stopImmediatePropagation:()=>{a.nativeEvent&&typeof a.nativeEvent.stopImmediatePropagation=="function"&&a.nativeEvent.stopImmediatePropagation()}}}},getIsInGroup:()=>this.isInGroup(),getGroupValue:()=>this.context&&this.context.checkboxGroup.value||[],notifyGroupChange:e=>{this.context.checkboxGroup.onChange(e)},getGroupDisabled:()=>this.context&&this.context.checkboxGroup.disabled,setAddonId:()=>{this.setState({addonId:w({prefix:"addon"})})},setExtraId:()=>{this.setState({extraId:w({prefix:"extra"})})},setFocusVisible:e=>{this.setState({focusVisible:e})},focusCheckboxEntity:()=>{this.focus()}})}constructor(e){super(e),this.handleChange=s=>this.foundation.handleChange(s),this.handleEnterPress=s=>this.foundation.handleEnterPress(s),this.handleFocusVisible=s=>{this.foundation.handleFocusVisible(s)},this.handleBlur=s=>{this.foundation.handleBlur()};const a=!1;this.state={checked:e.checked||e.defaultChecked||a,addonId:e.addonId,extraId:e.extraId,focusVisible:!1},this.checkboxEntity=null,this.foundation=new ce(this.adapter)}componentDidUpdate(e){this.props.checked!==e.checked&&(ee(this.props.checked)?this.foundation.setChecked(!1):de(this.props.checked)&&this.foundation.setChecked(this.props.checked))}isInGroup(){return!!(this.context&&this.context.checkboxGroup&&"value"in this.props)}focus(){this.checkboxEntity&&this.checkboxEntity.focus()}blur(){this.checkboxEntity&&this.checkboxEntity.blur()}render(){const{disabled:e,style:a,prefixCls:s,className:r,indeterminate:l,children:c,onMouseEnter:E,onMouseLeave:x,extra:f,value:g,role:m,tabIndex:h,id:v,type:k}=this.props,{checked:C,addonId:i,extraId:b,focusVisible:V}=this.state,n={checked:C,disabled:e},O=this.isInGroup();if(O){if(this.context.checkboxGroup.value){const Z=(this.context.checkboxGroup.value||[]).includes(g);n.checked=Z}this.context.checkboxGroup.disabled&&(n.disabled=this.context.checkboxGroup.disabled||this.props.disabled);const{isCardType:D,isPureCardType:z}=this.context.checkboxGroup;n.isCardType=D,n.isPureCardType=z,n.name=this.context.checkboxGroup.name}else n.isPureCardType=k===p.TYPE_PURECARD,n.isCardType=k===p.TYPE_CARD||n.isPureCardType;const d=s||G.PREFIX,B=n.isCardType||n.isPureCardType,Y=P(d,{[`${d}-disabled`]:n.disabled,[`${d}-indeterminate`]:l,[`${d}-checked`]:n.checked,[`${d}-unChecked`]:!n.checked,[`${d}-cardType`]:n.isCardType,[`${d}-cardType_disabled`]:n.disabled&&n.isCardType,[`${d}-cardType_enable`]:!(n.disabled&&n.isCardType),[`${d}-cardType_checked`]:n.isCardType&&n.checked&&!n.disabled,[`${d}-cardType_checked_disabled`]:n.isCardType&&n.checked&&n.disabled,[r]:!!r,[`${d}-focus`]:V&&B}),q=P(`${d}-extra`,{[`${d}-cardType_extra_noChildren`]:n.isCardType&&!c});O&&this.context.checkboxGroup.name;const W=this.props["x-semi-children-alias"]||"children",X=()=>!c&&!f?null:o.createElement("div",{className:`${d}-content`},c?o.createElement("span",{id:i,className:`${d}-addon`,"x-semi-prop":W},c):null,f?o.createElement("div",{id:b,className:q,"x-semi-prop":"extra"},f):null);return o.createElement("span",Object.assign({role:m,tabIndex:h,style:a,className:Y,id:v,onMouseEnter:E,onMouseLeave:x,onClick:this.handleChange,onKeyPress:this.handleEnterPress,"aria-labelledby":this.props["aria-labelledby"]},this.getDataAttr(this.props)),o.createElement(A,Object.assign({},this.props,n,{addonId:c&&i,extraId:f&&b,isPureCardType:n.isPureCardType,ref:D=>{this.checkboxEntity=D},focusInner:V&&!B,onInputFocus:this.handleFocusVisible,onInputBlur:this.handleBlur})),X())}}y.contextType=N;y.propTypes={"aria-describedby":t.string,"aria-errormessage":t.string,"aria-invalid":t.bool,"aria-labelledby":t.string,"aria-required":t.bool,checked:t.bool,defaultChecked:t.bool,disabled:t.bool,indeterminate:t.bool,onChange:t.func,value:t.any,style:t.object,className:t.string,prefixCls:t.string,onMouseEnter:t.func,onMouseLeave:t.func,extra:t.node,index:t.number,"aria-label":t.string,tabIndex:t.number,preventScroll:t.bool,type:t.string};y.defaultProps={defaultChecked:!1,indeterminate:!1,onChange:I,onMouseEnter:I,onMouseLeave:I,type:"default"};y.elementType="Checkbox";class S extends M{static get checkboxGroupDefaultAdapter(){return{}}constructor(e){super(Object.assign(Object.assign({},S.checkboxGroupDefaultAdapter),e))}init(){const{defaultValue:e,value:a}=this.getProps();typeof e<"u"&&!Array.isArray(e)&&_(!0,"Warning: [Semi CheckboxGroup] defaultValue should be an Array"),typeof a<"u"&&!Array.isArray(a)&&_(!0,"Warning: [Semi CheckboxGroup] value should be an Array")}notifyChange(e){this._adapter.notifyChange(e)}handleChange(e){const a=this.getState("value");let s=[];Array.isArray(a)||(s=[a]),e.target.checked?s=[...a,e.target.value]:s=a.filter((l,c)=>l!==e.target.value),"value"in this.getProps()?this.notifyChange(s):(this._adapter.updateGroupValue(s),this.notifyChange(s))}getFormatName(){return this.getProp("name")||"default"}handlePropValueChange(e){Array.isArray(e)?this._adapter.updateGroupValue(e):(typeof e>"u"&&this._adapter.updateGroupValue([]),_(!0,"Warning: [Semi CheckboxGroup] value should be an Array"))}destroy(){}}class F extends L{get adapter(){return Object.assign(Object.assign({},super.adapter),{updateGroupValue:e=>{this.setState({value:e})},notifyChange:e=>{this.props.onChange&&this.props.onChange(e)}})}constructor(e){super(e),this.state={value:e.value||e.defaultValue},this.foundation=new S(this.adapter),this.onChange=this.onChange.bind(this)}componentDidMount(){this.foundation.init()}componentDidUpdate(e){te(e.value,this.props.value)||this.foundation.handlePropValueChange(this.props.value)}componentWillUnmount(){this.foundation.destroy()}onChange(e){this.foundation.handleChange(e)}render(){const{children:e,options:a,prefixCls:s,direction:r,className:l,id:c,style:E,type:x,disabled:f}=this.props,g=x===p.TYPE_PURECARD,m=x===p.TYPE_CARD||g,h=s||le.PREFIX,v=P({[h]:!0,[`${h}-wrapper`]:!0,[`${h}-${r}`]:r,[`${h}-${r}-cardType`]:r&&m,[`${h}-${r}-pureCardType`]:r&&g},l),k=this.state.value.slice();let C;return a?C=(a||[]).map((i,b)=>typeof i=="string"?o.createElement(y,{role:"listitem",key:b,disabled:this.props.disabled,value:i,prefixCls:s},i):o.createElement(y,{role:"listitem",key:b,disabled:i.disabled||this.props.disabled,value:i.value,prefixCls:s,extra:i.extra,className:i.className,style:i.style,onChange:i.onChange},i.label)):e&&(C=o.Children.toArray(e).map((i,b)=>o.cloneElement(i,{key:b,role:"listitem"}))),o.createElement("div",Object.assign({id:c,role:"list","aria-label":this.props["aria-label"],className:v,style:E,"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"]},this.getDataAttr(this.props)),o.createElement(N.Provider,{value:{checkboxGroup:{onChange:this.onChange,value:k,disabled:this.props.disabled,name:this.foundation.getFormatName(),isCardType:m,isPureCardType:g}}},C))}}F.propTypes={"aria-describedby":t.string,"aria-errormessage":t.string,"aria-invalid":t.bool,"aria-labelledby":t.string,"aria-required":t.bool,defaultValue:t.array,disabled:t.bool,name:t.string,options:t.array,value:t.array,onChange:t.func,children:t.node,prefixCls:t.string,direction:t.oneOf(p.DIRECTION_SET),className:t.string,type:t.oneOf([p.TYPE_DEFAULT,p.TYPE_CARD,p.TYPE_PURECARD]),style:t.object};F.defaultProps={disabled:!1,onChange:()=>{},type:p.TYPE_DEFAULT,defaultValue:[],direction:p.DEFAULT_DIRECTION};class he extends y{}he.Group=F;export{he as C,de as _,y as a,F as b};
@@ -1 +1 @@
1
- import{X as a,Y as t}from"./index-Bjn0ctEd.js";const s=[{key:"login",icon:"🔐",titleKey:"ia.menu.login",summaryKey:"ia.login.summary",sceneKey:"scene_scan_qrcode",apiTags:["tt.login","auth_code","user.info.open_id"],highlightKeys:["ia.login.highlight1","ia.login.highlight2"],prerequisiteKeys:["ia.login.prerequisite1","ia.login.prerequisite2"],stepKeys:["ia.login.step1","ia.login.step2","ia.login.step3"],tipKeys:["ia.login.tip1","ia.login.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.sg.larkoffice.com/docx/CG6wdxffcouMY3xIqQTlDEyWgBe?302from=wiki",target:"_blank",theme:"solid"}]},{key:"authorize",icon:"🛂",titleKey:"ia.menu.authorize",summaryKey:"ia.authorize.summary",sceneKey:"scene_scan_qrcode",apiTags:["tt.authorize","user.info.basic","access_token"],highlightKeys:["ia.authorize.highlight1","ia.authorize.highlight2"],prerequisiteKeys:["ia.authorize.prerequisite1","ia.authorize.prerequisite2"],stepKeys:["ia.authorize.step1","ia.authorize.step2","ia.authorize.step3"],tipKeys:["ia.authorize.tip1","ia.authorize.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.sg.larkoffice.com/docx/CewRdCPcCoxcKFxBTftlRXnSgOc",target:"_blank",theme:"solid"},{labelKey:"ia.action.goProjectDetail",type:"route",path:"/project_overview"}]},{key:"payment",icon:"💳",titleKey:"ia.menu.payment",summaryKey:"ia.payment.summary",sceneKey:"scene_scan_qrcode",apiTags:["IAP Mock","TikTok Beans","order verify"],highlightKeys:["ia.payment.highlight1","ia.payment.highlight2"],prerequisiteKeys:["ia.payment.prerequisite1","ia.payment.prerequisite2"],stepKeys:["ia.payment.step1","ia.payment.step2","ia.payment.step3"],tipKeys:["ia.payment.tip1","ia.payment.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.sg.larkoffice.com/docx/MYsLdpeGGoulzDxZ6VelG8Gggoe?302from=wiki",target:"_blank",theme:"solid"},{labelKey:"ia.action.goPrecheck",type:"route",path:"/upload_publish"}]},{key:"ad",icon:"📺",titleKey:"ia.menu.ad",summaryKey:"ia.ad.summary",sceneKey:"scene_ad",apiTags:["createRewardedVideoAd","createInterstitialAd","placement id"],highlightKeys:["ia.ad.highlight1","ia.ad.highlight2"],prerequisiteKeys:["ia.ad.prerequisite1","ia.ad.prerequisite2"],stepKeys:["ia.ad.step1","ia.ad.step2","ia.ad.step3"],tipKeys:["ia.ad.tip1","ia.ad.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.larkoffice.com/wiki/JTEiw409LiLkUSk2SltcsAqonkg",target:"_blank",theme:"solid"},{labelKey:"ia.action.goPrecheck",type:"route",path:"/upload_publish"}]},{key:"ui_adaptation",icon:"📱",titleKey:"ia.menu.uiAdaptation",summaryKey:"ia.uiAdaptation.summary",apiTags:["safeArea","screen adaptation","capsule button"],highlightKeys:["ia.uiAdaptation.highlight1","ia.uiAdaptation.highlight2"],prerequisiteKeys:["ia.uiAdaptation.prerequisite1","ia.uiAdaptation.prerequisite2"],stepKeys:["ia.uiAdaptation.step1","ia.uiAdaptation.step2","ia.uiAdaptation.step3"],tipKeys:["ia.uiAdaptation.tip1","ia.uiAdaptation.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.larkoffice.com/docx/Zes2dVS3ooIm55x67OhcXTxWnud",target:"_blank",theme:"solid"}]},{key:"share_message",icon:"🔗",titleKey:"ia.menu.shareMessage",summaryKey:"ia.shareMessage.summary",apiTags:["shareAppMessage","query","game basic info"],highlightKeys:["ia.shareMessage.highlight1","ia.shareMessage.highlight2"],prerequisiteKeys:["ia.shareMessage.prerequisite1","ia.shareMessage.prerequisite2"],stepKeys:["ia.shareMessage.step1","ia.shareMessage.step2","ia.shareMessage.step3"],tipKeys:["ia.shareMessage.tip1","ia.shareMessage.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.sg.larkoffice.com/docx/CesGdxcyJorqE1xIuf3lAXEhguh",target:"_blank",theme:"solid"}]},{key:"share_story",icon:"📣",titleKey:"ia.menu.shareStory",summaryKey:"ia.shareStory.summary",hidden:!0,apiTags:["shareToStory","query","story asset"],highlightKeys:["ia.shareStory.highlight1","ia.shareStory.highlight2"],prerequisiteKeys:["ia.shareStory.prerequisite1","ia.shareStory.prerequisite2"],stepKeys:["ia.shareStory.step1","ia.shareStory.step2","ia.shareStory.step3"],tipKeys:["ia.shareStory.tip1","ia.shareStory.tip2"],actions:[]},{key:"subpackage",icon:"📦",titleKey:"ia.menu.subpackage",summaryKey:"ia.subpackage.summary",apiTags:["preDownloadSubpackage","loadSubpackage","loadSubpackageSync"],highlightKeys:["ia.subpackage.highlight1","ia.subpackage.highlight2"],prerequisiteKeys:["ia.subpackage.prerequisite1","ia.subpackage.prerequisite2"],stepKeys:["ia.subpackage.step1","ia.subpackage.step2","ia.subpackage.step3"],tipKeys:["ia.subpackage.tip1","ia.subpackage.tip2"],actions:[]},{key:"network",icon:"🌐",titleKey:"ia.menu.network",summaryKey:"ia.network.summary",apiTags:["request","downloadFile","connectSocket"],highlightKeys:["ia.network.highlight1","ia.network.highlight2"],prerequisiteKeys:["ia.network.prerequisite1","ia.network.prerequisite2"],stepKeys:["ia.network.step1","ia.network.step2","ia.network.step3"],tipKeys:["ia.network.tip1","ia.network.tip2"],actions:[]},{key:"sidebar_revisit",icon:"🧭",titleKey:"ia.menu.sidebarRevisit",summaryKey:"ia.sidebar.summary",sceneKey:"scene_center",apiTags:["startEntranceMission","getEntranceMissionReward","canIUse"],highlightKeys:["ia.sidebar.highlight1","ia.sidebar.highlight2"],prerequisiteKeys:["ia.sidebar.prerequisite1","ia.sidebar.prerequisite2"],stepKeys:["ia.sidebar.step1","ia.sidebar.step2","ia.sidebar.step3"],tipKeys:["ia.sidebar.tip1","ia.sidebar.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.larkoffice.com/wiki/Pl9Jwg8ujiZp6ckhhQzcujujnfb",target:"_blank",theme:"solid"},{labelKey:"ia.action.goLaunchMode",type:"route",path:"/launch_mode"}]},{key:"shortcut_revisit",icon:"📌",titleKey:"ia.menu.shortcutRevisit",summaryKey:"ia.shortcut.summary",sceneKey:"scene_shortcut",apiTags:["addShortcut","getShortcutMissionReward","canIUse"],highlightKeys:["ia.shortcut.highlight1","ia.shortcut.highlight2"],prerequisiteKeys:["ia.shortcut.prerequisite1","ia.shortcut.prerequisite2"],stepKeys:["ia.shortcut.step1","ia.shortcut.step2","ia.shortcut.step3"],tipKeys:["ia.shortcut.tip1","ia.shortcut.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.larkoffice.com/wiki/AW4JwueaXiiKtTkK0c9cIo4lnud",target:"_blank",theme:"solid"},{labelKey:"ia.action.goLaunchMode",type:"route",path:"/launch_mode"}]},{key:"direct_play_card",icon:"🎯",titleKey:"ia.menu.directPlayCard",summaryKey:"ia.directPlay.summary",sceneKey:"scene_fyf_promotion_direct_feed_play",experimentOnly:!0,apiTags:["Play now","For You Feed","revisit"],highlightKeys:["ia.directPlay.highlight1","ia.directPlay.highlight2"],prerequisiteKeys:["ia.directPlay.prerequisite1","ia.directPlay.prerequisite2"],stepKeys:["ia.directPlay.step1","ia.directPlay.step2","ia.directPlay.step3"],tipKeys:["ia.directPlay.tip1","ia.directPlay.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.sg.larkoffice.com/docx/VZ3odoD8DoSxFXxANh5lLxVMgPx",target:"_blank",theme:"solid"}]},{key:"wasm_split",icon:"🧩",titleKey:"ia.menu.wasmSplit",summaryKey:"ia.wasmSplit.summary",apiTags:["Unity","Wasm"],highlightKeys:[],prerequisiteKeys:[],stepKeys:[],tipKeys:[],actions:[],customPath:"/wasm_split"}],p=s.reduce((e,i)=>(e[i.key]=i,e),{});function o(e){return!!(!e||e.hidden||e.experimentOnly&&!a()||e.localDevOnly&&!t())}export{p as c,o as i};
1
+ import{X as a,Y as t}from"./index-BegU9LBT.js";const s=[{key:"login",icon:"🔐",titleKey:"ia.menu.login",summaryKey:"ia.login.summary",sceneKey:"scene_scan_qrcode",apiTags:["tt.login","auth_code","user.info.open_id"],highlightKeys:["ia.login.highlight1","ia.login.highlight2"],prerequisiteKeys:["ia.login.prerequisite1","ia.login.prerequisite2"],stepKeys:["ia.login.step1","ia.login.step2","ia.login.step3"],tipKeys:["ia.login.tip1","ia.login.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.sg.larkoffice.com/docx/CG6wdxffcouMY3xIqQTlDEyWgBe?302from=wiki",target:"_blank",theme:"solid"}]},{key:"authorize",icon:"🛂",titleKey:"ia.menu.authorize",summaryKey:"ia.authorize.summary",sceneKey:"scene_scan_qrcode",apiTags:["tt.authorize","user.info.basic","access_token"],highlightKeys:["ia.authorize.highlight1","ia.authorize.highlight2"],prerequisiteKeys:["ia.authorize.prerequisite1","ia.authorize.prerequisite2"],stepKeys:["ia.authorize.step1","ia.authorize.step2","ia.authorize.step3"],tipKeys:["ia.authorize.tip1","ia.authorize.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.sg.larkoffice.com/docx/CewRdCPcCoxcKFxBTftlRXnSgOc",target:"_blank",theme:"solid"},{labelKey:"ia.action.goProjectDetail",type:"route",path:"/project_overview"}]},{key:"payment",icon:"💳",titleKey:"ia.menu.payment",summaryKey:"ia.payment.summary",sceneKey:"scene_scan_qrcode",apiTags:["IAP Mock","TikTok Beans","order verify"],highlightKeys:["ia.payment.highlight1","ia.payment.highlight2"],prerequisiteKeys:["ia.payment.prerequisite1","ia.payment.prerequisite2"],stepKeys:["ia.payment.step1","ia.payment.step2","ia.payment.step3"],tipKeys:["ia.payment.tip1","ia.payment.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.sg.larkoffice.com/docx/MYsLdpeGGoulzDxZ6VelG8Gggoe?302from=wiki",target:"_blank",theme:"solid"},{labelKey:"ia.action.goPrecheck",type:"route",path:"/upload_publish"}]},{key:"ad",icon:"📺",titleKey:"ia.menu.ad",summaryKey:"ia.ad.summary",sceneKey:"scene_ad",apiTags:["createRewardedVideoAd","createInterstitialAd","placement id"],highlightKeys:["ia.ad.highlight1","ia.ad.highlight2"],prerequisiteKeys:["ia.ad.prerequisite1","ia.ad.prerequisite2"],stepKeys:["ia.ad.step1","ia.ad.step2","ia.ad.step3"],tipKeys:["ia.ad.tip1","ia.ad.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.larkoffice.com/wiki/JTEiw409LiLkUSk2SltcsAqonkg",target:"_blank",theme:"solid"},{labelKey:"ia.action.goPrecheck",type:"route",path:"/upload_publish"}]},{key:"ui_adaptation",icon:"📱",titleKey:"ia.menu.uiAdaptation",summaryKey:"ia.uiAdaptation.summary",apiTags:["safeArea","screen adaptation","capsule button"],highlightKeys:["ia.uiAdaptation.highlight1","ia.uiAdaptation.highlight2"],prerequisiteKeys:["ia.uiAdaptation.prerequisite1","ia.uiAdaptation.prerequisite2"],stepKeys:["ia.uiAdaptation.step1","ia.uiAdaptation.step2","ia.uiAdaptation.step3"],tipKeys:["ia.uiAdaptation.tip1","ia.uiAdaptation.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.larkoffice.com/docx/Zes2dVS3ooIm55x67OhcXTxWnud",target:"_blank",theme:"solid"}]},{key:"share_message",icon:"🔗",titleKey:"ia.menu.shareMessage",summaryKey:"ia.shareMessage.summary",apiTags:["shareAppMessage","query","game basic info"],highlightKeys:["ia.shareMessage.highlight1","ia.shareMessage.highlight2"],prerequisiteKeys:["ia.shareMessage.prerequisite1","ia.shareMessage.prerequisite2"],stepKeys:["ia.shareMessage.step1","ia.shareMessage.step2","ia.shareMessage.step3"],tipKeys:["ia.shareMessage.tip1","ia.shareMessage.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.sg.larkoffice.com/docx/CesGdxcyJorqE1xIuf3lAXEhguh",target:"_blank",theme:"solid"}]},{key:"share_story",icon:"📣",titleKey:"ia.menu.shareStory",summaryKey:"ia.shareStory.summary",hidden:!0,apiTags:["shareToStory","query","story asset"],highlightKeys:["ia.shareStory.highlight1","ia.shareStory.highlight2"],prerequisiteKeys:["ia.shareStory.prerequisite1","ia.shareStory.prerequisite2"],stepKeys:["ia.shareStory.step1","ia.shareStory.step2","ia.shareStory.step3"],tipKeys:["ia.shareStory.tip1","ia.shareStory.tip2"],actions:[]},{key:"subpackage",icon:"📦",titleKey:"ia.menu.subpackage",summaryKey:"ia.subpackage.summary",apiTags:["preDownloadSubpackage","loadSubpackage","loadSubpackageSync"],highlightKeys:["ia.subpackage.highlight1","ia.subpackage.highlight2"],prerequisiteKeys:["ia.subpackage.prerequisite1","ia.subpackage.prerequisite2"],stepKeys:["ia.subpackage.step1","ia.subpackage.step2","ia.subpackage.step3"],tipKeys:["ia.subpackage.tip1","ia.subpackage.tip2"],actions:[]},{key:"network",icon:"🌐",titleKey:"ia.menu.network",summaryKey:"ia.network.summary",apiTags:["request","downloadFile","connectSocket"],highlightKeys:["ia.network.highlight1","ia.network.highlight2"],prerequisiteKeys:["ia.network.prerequisite1","ia.network.prerequisite2"],stepKeys:["ia.network.step1","ia.network.step2","ia.network.step3"],tipKeys:["ia.network.tip1","ia.network.tip2"],actions:[]},{key:"sidebar_revisit",icon:"🧭",titleKey:"ia.menu.sidebarRevisit",summaryKey:"ia.sidebar.summary",sceneKey:"scene_center",apiTags:["startEntranceMission","getEntranceMissionReward","canIUse"],highlightKeys:["ia.sidebar.highlight1","ia.sidebar.highlight2"],prerequisiteKeys:["ia.sidebar.prerequisite1","ia.sidebar.prerequisite2"],stepKeys:["ia.sidebar.step1","ia.sidebar.step2","ia.sidebar.step3"],tipKeys:["ia.sidebar.tip1","ia.sidebar.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.larkoffice.com/wiki/Pl9Jwg8ujiZp6ckhhQzcujujnfb",target:"_blank",theme:"solid"},{labelKey:"ia.action.goLaunchMode",type:"route",path:"/launch_mode"}]},{key:"shortcut_revisit",icon:"📌",titleKey:"ia.menu.shortcutRevisit",summaryKey:"ia.shortcut.summary",sceneKey:"scene_shortcut",apiTags:["addShortcut","getShortcutMissionReward","canIUse"],highlightKeys:["ia.shortcut.highlight1","ia.shortcut.highlight2"],prerequisiteKeys:["ia.shortcut.prerequisite1","ia.shortcut.prerequisite2"],stepKeys:["ia.shortcut.step1","ia.shortcut.step2","ia.shortcut.step3"],tipKeys:["ia.shortcut.tip1","ia.shortcut.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.larkoffice.com/wiki/AW4JwueaXiiKtTkK0c9cIo4lnud",target:"_blank",theme:"solid"},{labelKey:"ia.action.goLaunchMode",type:"route",path:"/launch_mode"}]},{key:"direct_play_card",icon:"🎯",titleKey:"ia.menu.directPlayCard",summaryKey:"ia.directPlay.summary",sceneKey:"scene_fyf_promotion_direct_feed_play",experimentOnly:!0,apiTags:["Play now","For You Feed","revisit"],highlightKeys:["ia.directPlay.highlight1","ia.directPlay.highlight2"],prerequisiteKeys:["ia.directPlay.prerequisite1","ia.directPlay.prerequisite2"],stepKeys:["ia.directPlay.step1","ia.directPlay.step2","ia.directPlay.step3"],tipKeys:["ia.directPlay.tip1","ia.directPlay.tip2"],actions:[{labelKey:"ia.action.openCapabilityDoc",type:"external",href:"https://bytedance.sg.larkoffice.com/docx/VZ3odoD8DoSxFXxANh5lLxVMgPx",target:"_blank",theme:"solid"}]},{key:"wasm_split",icon:"🧩",titleKey:"ia.menu.wasmSplit",summaryKey:"ia.wasmSplit.summary",apiTags:["Unity","Wasm"],highlightKeys:[],prerequisiteKeys:[],stepKeys:[],tipKeys:[],actions:[],customPath:"/wasm_split"}],p=s.reduce((e,i)=>(e[i.key]=i,e),{});function o(e){return!!(!e||e.hidden||e.experimentOnly&&!a()||e.localDevOnly&&!t())}export{p as c,o as i};
@@ -1 +1 @@
1
- import{ag as o,r as c,o as n,j as e,T as h,i as l,m,ah as d,d as g}from"./index-Bjn0ctEd.js";import{D as r}from"./index-1WjGwqIV.js";function u(a){return c.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},a),c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m6.62 3.25.44.75H2.6C1.72 4 1 4.67 1 5.5S1.72 7 2.6 7h1.9c0 2.45 1.1 4.71 2.5 6.5-1.1.64-2.63 1-4 1a1.5 1.5 0 1 0 0 3c2.23 0 4.3-.7 6-1.88 1.4.98 3.06 1.62 4.85 1.82l-1.7 3.39a1.5 1.5 0 0 0 2.7 1.34l.58-1.17h4.14l.59 1.17a1.5 1.5 0 0 0 2.68-1.34l-4-8a1.5 1.5 0 0 0-2.68 0l-.85 1.7a1.5 1.5 0 0 0-.31-.03c-1.37 0-2.9-.36-4-1A10.7 10.7 0 0 0 13.5 7h1.9c.88 0 1.6-.67 1.6-1.5S16.28 4 15.4 4h-4.88l-1.3-2.25a1.5 1.5 0 0 0-2.6 1.5ZM7.5 7h3c0 1.69-.56 3.25-1.5 4.5A7.47 7.47 0 0 1 7.5 7Zm10 9.85L18.57 19h-2.14l1.07-2.15Z",fill:"currentColor"}))}const w=o(u,"language"),i=[{code:"zh-CN",labelKey:"langChinese",short:"中"},{code:"en-US",labelKey:"langEnglish",short:"EN"}];async function p(a){if(a!==n){d(a);try{await g({url:"/game/language",method:"POST",data:{lang:a}})}catch{}window.location.reload()}}const f=()=>{const a=i.find(t=>t.code===n)?.short??"EN";return e.jsx(r,{trigger:"hover",position:"bottomRight",render:e.jsx(e.Fragment,{children:i.map(t=>{const s=t.code===n;return e.jsxs(r.Item,{onClick:()=>{p(t.code)},className:"lang-switcher-item"+(s?" lang-switcher-item-active":""),children:[e.jsx("span",{className:"lang-switcher-item-label",children:l(t.labelKey)}),s?e.jsx(m,{className:"lang-switcher-item-check"}):null]},t.code)})}),children:e.jsxs("div",{className:"lang-switcher tt-header-chip","aria-label":l("languageSwitcherLabel"),children:[e.jsx(w,{className:"lang-switcher-icon"}),e.jsx(h.Text,{className:"lang-switcher-text",children:a})]})})};export{f as LangSwitcher};
1
+ import{ag as o,r as c,o as n,j as e,T as h,i as l,m,ah as d,d as g}from"./index-BegU9LBT.js";import{D as r}from"./index-BqwflQml.js";function u(a){return c.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},a),c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m6.62 3.25.44.75H2.6C1.72 4 1 4.67 1 5.5S1.72 7 2.6 7h1.9c0 2.45 1.1 4.71 2.5 6.5-1.1.64-2.63 1-4 1a1.5 1.5 0 1 0 0 3c2.23 0 4.3-.7 6-1.88 1.4.98 3.06 1.62 4.85 1.82l-1.7 3.39a1.5 1.5 0 0 0 2.7 1.34l.58-1.17h4.14l.59 1.17a1.5 1.5 0 0 0 2.68-1.34l-4-8a1.5 1.5 0 0 0-2.68 0l-.85 1.7a1.5 1.5 0 0 0-.31-.03c-1.37 0-2.9-.36-4-1A10.7 10.7 0 0 0 13.5 7h1.9c.88 0 1.6-.67 1.6-1.5S16.28 4 15.4 4h-4.88l-1.3-2.25a1.5 1.5 0 0 0-2.6 1.5ZM7.5 7h3c0 1.69-.56 3.25-1.5 4.5A7.47 7.47 0 0 1 7.5 7Zm10 9.85L18.57 19h-2.14l1.07-2.15Z",fill:"currentColor"}))}const w=o(u,"language"),i=[{code:"zh-CN",labelKey:"langChinese",short:"中"},{code:"en-US",labelKey:"langEnglish",short:"EN"}];async function p(a){if(a!==n){d(a);try{await g({url:"/game/language",method:"POST",data:{lang:a}})}catch{}window.location.reload()}}const f=()=>{const a=i.find(t=>t.code===n)?.short??"EN";return e.jsx(r,{trigger:"hover",position:"bottomRight",render:e.jsx(e.Fragment,{children:i.map(t=>{const s=t.code===n;return e.jsxs(r.Item,{onClick:()=>{p(t.code)},className:"lang-switcher-item"+(s?" lang-switcher-item-active":""),children:[e.jsx("span",{className:"lang-switcher-item-label",children:l(t.labelKey)}),s?e.jsx(m,{className:"lang-switcher-item-check"}):null]},t.code)})}),children:e.jsxs("div",{className:"lang-switcher tt-header-chip","aria-label":l("languageSwitcherLabel"),children:[e.jsx(w,{className:"lang-switcher-icon"}),e.jsx(h.Text,{className:"lang-switcher-text",children:a})]})})};export{f as LangSwitcher};
@@ -1 +1 @@
1
- import{c as x,d as N,u as M,r as n,s as S,j as e,e as b,P as v,i as o,T as L,b as m,D as z,o as C}from"./index-Bjn0ctEd.js";import{B as I}from"./index-C83QHLmD.js";import{S as E}from"./SectionHeader-Cn3FnOqh.js";import{C as f}from"./Card-BAsimNoh.js";import{S as T}from"./sparkles-BjIkcbAi.js";const w=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],B=x("bug",w);const _=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],q=x("wrench",_);function A(){return N({url:"/game/changelog",method:"GET"})}const D=[{key:"feature",icon:T,titleI18n:"changelogFeature",tone:"success"},{key:"optimize",icon:q,titleI18n:"changelogOptimize",tone:"warn"},{key:"bugfix",icon:B,titleI18n:"changelogBugfix",tone:"error"}],G=()=>{const{state:{devToolVersion:r}}=M(),d=C,[h,p]=n.useState([]),[j,l]=n.useState(!0),[c,u]=n.useState("");return n.useEffect(()=>{r&&S(r)},[r]),n.useEffect(()=>{let a=!1;return(async()=>{l(!0),u("");const s=await A();if(!a){if(s?.error||s?.code!==0||!s?.data){p([]),u(typeof s?.error=="object"&&s.error?.errorMsg||"Failed to load changelog."),l(!1);return}p(s.data.items||[]),l(!1)}})(),()=>{a=!0}},[]),j?e.jsx("div",{className:"change-log-container change-log-loading",children:e.jsx(b,{size:"large"})}):e.jsxs("div",{className:"change-log-container",children:[e.jsx(v,{title:o("changelog"),subtitle:o("changelogTip")}),c?e.jsx(I,{fullMode:!1,bordered:!1,closeIcon:null,type:"danger",description:c}):null,!c&&h.length===0?e.jsx(f,{padding:"lg",children:e.jsx(L.Paragraph,{className:"change-log-empty",children:"No changelog entries yet."})}):null,h.map(a=>e.jsxs(f,{padding:"md",className:"change-log-item",children:[e.jsxs("div",{className:"change-log-item-head",children:[e.jsx("h2",{className:"change-log-version",children:a.title}),e.jsxs(m,{tone:"neutral",size:"sm",children:["iOS ",a.target.iOS," · Android ",a.target.Android]})]}),D.map(({key:i,icon:s,titleI18n:y,tone:k})=>{const g=a.changes?.[i]||[];return g.length?e.jsxs("section",{className:"change-log-section",children:[e.jsx(E,{icon:s,title:e.jsxs("span",{className:"change-log-section-title",children:[e.jsx("span",{children:o(y)}),e.jsx(m,{tone:k,size:"sm",children:g.length})]})}),e.jsx("ul",{className:"change-log-changes",children:g.map(t=>e.jsxs("li",{className:"change-log-change",children:[e.jsx("span",{className:"change-log-change-bullet","aria-hidden":!0}),e.jsxs("span",{className:"change-log-change-body",children:[t.desc[d],t?.link?e.jsx(z,{className:"change-log-change-link",href:t.link,iconSize:12,children:o("changelogLink")}):null]})]},t.desc[d]))})]},i):null})]},a.title))]})};export{G as ChangeLog};
1
+ import{c as x,d as N,u as M,r as n,s as S,j as e,e as b,P as v,i as o,T as L,b as m,D as z,o as C}from"./index-BegU9LBT.js";import{B as I}from"./index-CcUgN29Y.js";import{S as E}from"./SectionHeader-BKc3BWXP.js";import{C as f}from"./Card-CN2lxY0Y.js";import{S as T}from"./sparkles-p-dZbjGb.js";const w=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],B=x("bug",w);const _=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],q=x("wrench",_);function A(){return N({url:"/game/changelog",method:"GET"})}const D=[{key:"feature",icon:T,titleI18n:"changelogFeature",tone:"success"},{key:"optimize",icon:q,titleI18n:"changelogOptimize",tone:"warn"},{key:"bugfix",icon:B,titleI18n:"changelogBugfix",tone:"error"}],G=()=>{const{state:{devToolVersion:r}}=M(),d=C,[h,p]=n.useState([]),[j,l]=n.useState(!0),[c,u]=n.useState("");return n.useEffect(()=>{r&&S(r)},[r]),n.useEffect(()=>{let a=!1;return(async()=>{l(!0),u("");const s=await A();if(!a){if(s?.error||s?.code!==0||!s?.data){p([]),u(typeof s?.error=="object"&&s.error?.errorMsg||"Failed to load changelog."),l(!1);return}p(s.data.items||[]),l(!1)}})(),()=>{a=!0}},[]),j?e.jsx("div",{className:"change-log-container change-log-loading",children:e.jsx(b,{size:"large"})}):e.jsxs("div",{className:"change-log-container",children:[e.jsx(v,{title:o("changelog"),subtitle:o("changelogTip")}),c?e.jsx(I,{fullMode:!1,bordered:!1,closeIcon:null,type:"danger",description:c}):null,!c&&h.length===0?e.jsx(f,{padding:"lg",children:e.jsx(L.Paragraph,{className:"change-log-empty",children:"No changelog entries yet."})}):null,h.map(a=>e.jsxs(f,{padding:"md",className:"change-log-item",children:[e.jsxs("div",{className:"change-log-item-head",children:[e.jsx("h2",{className:"change-log-version",children:a.title}),e.jsxs(m,{tone:"neutral",size:"sm",children:["iOS ",a.target.iOS," · Android ",a.target.Android]})]}),D.map(({key:i,icon:s,titleI18n:y,tone:k})=>{const g=a.changes?.[i]||[];return g.length?e.jsxs("section",{className:"change-log-section",children:[e.jsx(E,{icon:s,title:e.jsxs("span",{className:"change-log-section-title",children:[e.jsx("span",{children:o(y)}),e.jsx(m,{tone:k,size:"sm",children:g.length})]})}),e.jsx("ul",{className:"change-log-changes",children:g.map(t=>e.jsxs("li",{className:"change-log-change",children:[e.jsx("span",{className:"change-log-change-bullet","aria-hidden":!0}),e.jsxs("span",{className:"change-log-change-body",children:[t.desc[d],t?.link?e.jsx(z,{className:"change-log-change-link",href:t.link,iconSize:12,children:o("changelogLink")}):null]})]},t.desc[d]))})]},i):null})]},a.title))]})};export{G as ChangeLog};