UNPKG

react-common-use-components

Version:
1 lines 45.3 kB
(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{AudioPlayer:()=>A,AudioRecorder:()=>N,Button:()=>k,CountDown:()=>a,FlexBox:()=>l,InfiniteScroll:()=>u,Modal:()=>h,PasswordInput:()=>D,PreviewVideo:()=>S,ProgressBar:()=>I,Tabs:()=>L,Toast:()=>F,ToastProvider:()=>w,Uploader:()=>b,VideoPlayer:()=>Z});const r=require("react");var n=e.n(r);const l=e=>{let{children:t,onClick:r,style:l,className:o}=e;return n().createElement("div",{className:o,onClick:r,style:{display:"flex",justifyContent:"center",alignItems:"center",...l}},t)};let o,i;const a=e=>{let{onClick:t,style:l,status:a,className:c}=e;const[s,m]=(0,r.useState)(60),[d,u]=(0,r.useState)(0);return(0,r.useEffect)((()=>()=>{clearInterval(i)}),[]),(0,r.useEffect)((()=>{a&&1===d?(m(60),i&&clearInterval(i),o=(new Date).getTime(),i=setInterval((()=>{let e=(new Date).getTime(),t=Math.floor((e-o)/1e3);t>60&&(clearInterval(i),u(2)),m(60-t)}),1e3)):2!==d&&0!==d&&a||(clearInterval(i),m(60))}),[a,d]),n().createElement("div",{className:c,style:{backgroundColor:1!==d?"#7A57EB":"#E3E3E3",color:"#FFFFFF",...l},onClick:()=>{1!==d&&t&&(t(),u(1))}},0===d?"获取验证码":1===d?s+"s后重试":2===d?"重新获取":void 0)},c=()=>Math.floor(9e7*Math.random())+1e7;function s(e){return"function"==typeof e}const m=(e,t)=>{let r;return function(){for(var n=arguments.length,l=new Array(n),o=0;o<n;o++)l[o]=arguments[o];clearTimeout(r),r=setTimeout((()=>e.apply(void 0,l)),t)}};function d(){return/(iPhone|iPod|iPad)/i.test(navigator.userAgent)?"iOS":/Android/i.test(navigator.userAgent)?"Android":"Unknown"}const u=e=>{let{children:t,hasMore:l,loadMore:o,loading:i,end:a,threshold:c=0,total:s,dataLength:d}=e;const[u,h]=(0,r.useState)(!1),C=(0,r.useRef)(0),g=(0,r.useRef)(0),f=m((()=>{const e=(null===(t=document)||void 0===t||null===(t=t.documentElement)||void 0===t?void 0:t.scrollTop)||(null===(r=document)||void 0===r||null===(r=r.body)||void 0===r?void 0:r.scrollTop)||0;var t,r;C.current=e,document.documentElement.scrollHeight-(document.documentElement.scrollTop+document.body.scrollTop)-document.documentElement.clientHeight<=c&&e>g.current&&l&&(h(!0),setTimeout((()=>{h(!1),o&&o()}),500))}),200);return(0,r.useEffect)((()=>(window.addEventListener("scroll",f),()=>{window.removeEventListener("scroll",f)})),[l,o,c]),(0,r.useEffect)((()=>{g.current=C.current}),[d]),n().createElement("div",null,t,n().createElement("style",null,"\n @keyframes loading {\n 0% { transform: rotate(0deg); }\n 25% { transform: rotate(-3deg); }\n 50% { transform: rotate(3deg); }\n 75% { transform: rotate(-3deg); }\n 100% { transform: rotate(0deg); }\n }\n "),l&&u&&n().createElement("div",{style:{paddingBottom:"1rem"}},i||n().createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"}},n().createElement("div",{style:{fontSize:"0.75rem",color:"#b3b3b3",margin:"0.5rem",animation:"loading 1s infinite"}},"加载中..."))),d===s&&n().createElement("div",{style:{paddingBottom:"1rem"}},a||n().createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"}},n().createElement("div",{style:{fontSize:"0.75rem",color:"#b3b3b3",margin:"0.5rem"}},"没有更多了"))))},h=e=>{let{children:t,openModal:r,style:l,position:o="center",onClose:i}=e;function a(){return"top"===o?{justifyContent:"center",alignItems:"flex-start"}:"right"===o?{justifyContent:"flex-end",alignItems:"center"}:"bottom"===o?{justifyContent:"center",alignItems:"flex-end"}:"left"===o?{justifyContent:"flex-start",alignItems:"center"}:"center"===o?{justifyContent:"center",alignItems:"center"}:void 0}return n().createElement("div",null,n().createElement("style",null,"\n\t\t\t\t @keyframes initAnimation {\n\t\t\t\t 0% { opacity:0}\n\t\t\t\t 20% { opacity:0.1}\n\t\t\t\t 40% { opacity:0.2}\n\t\t\t\t 60% { opacity:0.3}\n\t\t\t\t 80% { opacity:0.4}\n\t\t\t\t 100% { opacity:0.5}\n\t\t\t\t }\n\t\t\t\t "),r&&n().createElement("div",{onClick:e=>{i&&i(),e.stopPropagation()},style:{background:"rgba(0,0,0,0.5)",width:"100%",zIndex:1300,position:"fixed",inset:0,display:"flex",justifyContent:a().justifyContent,alignItems:a().alignItems,animation:"initAnimation 0.25s ease",...l}},t))},C=e=>{let{style:t}=e;return n().createElement("svg",{version:"1.1",style:t,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",width:"256",height:"256"},n().createElement("path",{d:"M0 0 C2.44 2.19 2.44 2.19 4 5 C3.83 10.93 2.23 13.52 -1.92 17.65 C-2.44 18.17 -2.96 18.7 -3.49 19.24 C-5.22 20.98 -6.97 22.7 -8.72 24.42 C-9.97 25.67 -11.22 26.92 -12.46 28.17 C-15.84 31.56 -19.24 34.92 -22.65 38.29 C-26.21 41.81 -29.75 45.35 -33.29 48.89 C-39.24 54.83 -45.2 60.76 -51.17 66.68 C-59.59 75.03 -67.99 83.4 -76.39 91.78 C-82.91 98.28 -89.44 104.78 -95.96 111.27 C-97.01 112.32 -97.01 112.32 -98.08 113.38 C-102.11 117.39 -106.13 121.39 -110.17 125.39 C-111.39 126.6 -112.61 127.81 -113.83 129.03 C-115.49 130.68 -117.16 132.33 -118.82 133.99 C-119.76 134.91 -120.69 135.84 -121.65 136.79 C-124.75 139.71 -126.41 140.92 -130.69 141.5 C-140.42 141.16 -148.4 129.89 -154.87 123.4 C-155.99 122.27 -157.12 121.15 -158.25 120.02 C-160.6 117.68 -162.94 115.33 -165.28 112.98 C-168.28 109.97 -171.29 106.97 -174.3 103.97 C-176.62 101.65 -178.94 99.33 -181.26 97.01 C-182.37 95.9 -183.48 94.79 -184.59 93.68 C-186.14 92.14 -187.68 90.59 -189.22 89.04 C-190.1 88.16 -190.97 87.28 -191.88 86.38 C-194.65 83.27 -196.03 81.38 -195.94 77.19 C-194.37 71.87 -191.6 68.07 -187 65 C-179.82 63.78 -175.58 67.37 -169.98 71.31 C-169.04 71.95 -168.1 72.59 -167.13 73.25 C-164.14 75.3 -161.16 77.37 -158.19 79.44 C-156.17 80.83 -154.14 82.22 -152.12 83.6 C-149.28 85.55 -146.44 87.5 -143.6 89.47 C-142.35 90.34 -142.35 90.34 -141.06 91.22 C-140.32 91.74 -139.59 92.25 -138.83 92.78 C-135.09 95.28 -132.52 95.44 -128 95 C-125.68 93.46 -123.92 92.08 -121.94 90.19 C-120.8 89.17 -119.67 88.15 -118.53 87.14 C-117.95 86.61 -117.37 86.09 -116.77 85.55 C-113.94 83.07 -110.98 80.79 -108 78.5 C-103.41 74.93 -98.92 71.28 -94.5 67.5 C-89.6 63.31 -84.6 59.29 -79.51 55.34 C-74.77 51.64 -70.13 47.84 -65.5 44 C-60.31 39.7 -55.08 35.45 -49.75 31.31 C-44.6 27.3 -39.58 23.16 -34.62 18.92 C-30.61 15.5 -26.55 12.18 -22.42 8.92 C-20.7 7.55 -18.99 6.17 -17.3 4.77 C-16.42 4.04 -15.53 3.31 -14.62 2.56 C-13.83 1.9 -13.04 1.25 -12.23 0.57 C-7.78 -2.56 -4.91 -2.25 0 0 Z ",fill:"#FFFFFF",transform:"translate(224,51)"}))},g=e=>{let{style:t}=e;return n().createElement("svg",{version:"1.1",style:t,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",width:"256",height:"256"},n().createElement("path",{d:"M0 0 C3.91 0.79 6.12 3.4 8.8 6.21 C9.41 6.82 10.03 7.44 10.66 8.07 C12.69 10.1 14.68 12.15 16.67 14.21 C18.07 15.62 19.47 17.03 20.87 18.44 C24.55 22.16 28.21 25.89 31.86 29.63 C35.59 33.44 39.35 37.24 43.1 41.03 C50.46 48.47 57.79 55.94 65.11 63.43 C69.27 61.8 71.99 58.75 75.03 55.6 C75.62 55 76.2 54.41 76.8 53.79 C78.06 52.5 79.32 51.21 80.58 49.92 C82.58 47.87 84.58 45.83 86.59 43.79 C92.29 38 97.99 32.21 103.66 26.38 C107.13 22.81 110.62 19.26 114.12 15.73 C115.45 14.38 116.77 13.02 118.09 11.66 C119.93 9.75 121.79 7.87 123.66 5.99 C124.2 5.43 124.73 4.86 125.28 4.27 C128.2 1.41 130.32 0.08 134.35 -0.02 C138.11 0.43 138.11 0.43 140.61 1.93 C142.69 5.39 142.86 8.53 142.11 12.43 C140.57 15.06 138.53 17.02 136.32 19.12 C135.4 20.04 135.4 20.04 134.46 20.98 C132.43 23 130.38 25 128.33 26.99 C126.91 28.39 125.5 29.79 124.09 31.19 C120.38 34.87 116.64 38.53 112.9 42.18 C109.09 45.91 105.3 49.67 101.5 53.42 C94.06 60.78 86.59 68.11 79.11 75.43 C80.73 79.59 83.79 82.32 86.93 85.37 C87.53 85.95 88.12 86.54 88.74 87.14 C90.03 88.4 91.32 89.67 92.62 90.93 C94.66 92.93 96.7 94.94 98.74 96.95 C104.53 102.66 110.33 108.37 116.15 114.05 C119.72 117.53 123.27 121.03 126.8 124.53 C128.15 125.87 129.51 127.19 130.87 128.51 C132.78 130.36 134.66 132.22 136.54 134.09 C137.39 134.9 137.39 134.9 138.26 135.73 C141.05 138.55 142.07 140.15 142.58 144.14 C142.11 147.43 142.11 147.43 140.04 150.36 C137.11 152.43 137.11 152.43 133.92 153.3 C123.79 150.98 114.63 138.08 107.32 130.73 C106.12 129.54 104.93 128.34 103.73 127.14 C100.61 124.02 97.5 120.9 94.39 117.77 C91.2 114.58 88.01 111.38 84.81 108.18 C78.58 101.93 72.34 95.68 66.11 89.43 C59.62 94.68 53.87 100.64 48.06 106.62 C44.92 109.83 41.77 113.02 38.62 116.21 C34.63 120.27 30.64 124.32 26.68 128.4 C23.46 131.71 20.22 135.01 16.97 138.28 C15.74 139.53 14.51 140.79 13.3 142.05 C11.59 143.82 9.87 145.55 8.14 147.29 C7.64 147.81 7.15 148.34 6.64 148.87 C3.82 151.64 1.76 152.75 -2.11 152.84 C-5.89 152.43 -5.89 152.43 -8.39 150.93 C-10.47 147.46 -10.64 144.32 -9.89 140.43 C-8.35 137.79 -6.31 135.83 -4.11 133.73 C-3.5 133.12 -2.88 132.5 -2.25 131.87 C-0.22 129.85 1.83 127.86 3.89 125.86 C5.3 124.46 6.71 123.06 8.13 121.66 C11.84 117.98 15.57 114.32 19.31 110.67 C23.13 106.94 26.92 103.18 30.71 99.43 C38.16 92.07 45.62 84.74 53.11 77.43 C49.38 72.97 45.54 68.71 41.41 64.63 C40.87 64.1 40.34 63.56 39.79 63.02 C38.64 61.87 37.5 60.73 36.35 59.59 C34.53 57.79 32.71 55.98 30.9 54.17 C27.06 50.33 23.21 46.5 19.36 42.68 C14.88 38.22 10.4 33.77 5.93 29.31 C4.15 27.53 2.36 25.75 0.57 23.97 C-0.53 22.88 -1.62 21.79 -2.71 20.7 C-3.21 20.21 -3.71 19.72 -4.22 19.21 C-9.75 13.68 -9.75 13.68 -10.27 9.05 C-9.57 2.27 -6.87 -0.21 0 0 Z ",fill:"#FFFFFF",transform:"translate(61.893035888671875,51.57469177246094)"}))},f=e=>{let{style:t}=e;return n().createElement("svg",{version:"1.1",style:t,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",width:"256",height:"256"},n().createElement("path",{d:"M0 0 C19.3 16.38 31.79 37.6 35.52 62.82 C36.45 77.48 36.23 91.83 31.52 105.82 C31.31 106.47 31.1 107.12 30.87 107.79 C27.75 117 23.42 125.04 17.52 132.82 C17.13 133.35 16.73 133.88 16.32 134.42 C1.12 154.29 -20.17 166.81 -44.72 171.43 C-71.81 174.24 -98.4 169.64 -120.17 152.48 C-123.79 149.44 -127.15 146.18 -130.48 142.82 C-131.2 142.1 -131.93 141.38 -132.68 140.65 C-151.16 121.3 -157.31 95.84 -156.76 69.8 C-155.81 44.27 -143.74 20.97 -125.24 3.74 C-90.86 -27.04 -36.25 -29.31 0 0 Z M-123.92 22.63 C-139.33 42.24 -144.92 65.17 -142.01 89.71 C-137.74 111.71 -125.96 130.61 -107.71 143.72 C-88.63 156.11 -66.06 161.33 -43.61 156.64 C-21.64 151.4 -2.71 139.08 9.52 119.82 C21.1 100.7 24.9 78.97 20.02 57.01 C17.85 48.33 13.93 40.56 9.52 32.82 C9.06 31.98 8.6 31.14 8.13 30.28 C0.93 18.34 -10.31 9.25 -22.48 2.82 C-23.35 2.34 -24.23 1.86 -25.14 1.37 C-58.68 -15.45 -99.77 -5.19 -123.92 22.63 Z ",fill:"#FFFFFF",transform:"translate(188.475830078125,52.181640625)"}),n().createElement("path",{d:"M0 0 C3.54 2.18 5.61 4.1 7 8 C7.06 11.03 7 13.92 6.81 16.94 C6.74 18.32 6.74 18.32 6.66 19.74 C6.46 23.16 6.23 26.58 6 30 C5.95 30.73 5.9 31.45 5.85 32.2 C5.53 37.12 5.18 42.03 4.81 46.94 C4.69 48.6 4.57 50.25 4.45 51.91 C4.29 54.27 4.1 56.64 3.91 59 C3.84 60.05 3.84 60.05 3.77 61.13 C3.36 66.03 2.19 69.66 0 74 C-2.49 76.06 -3.75 76.01 -7 75.94 C-10.83 74.74 -11.8 73.32 -14 70 C-14.7 67.04 -14.7 67.04 -14.98 63.76 C-15.15 61.93 -15.15 61.93 -15.32 60.06 C-15.47 58.11 -15.47 58.11 -15.62 56.12 C-15.74 54.78 -15.86 53.43 -15.98 52.08 C-16.22 49.36 -16.45 46.64 -16.68 43.91 C-16.97 40.35 -17.29 36.79 -17.63 33.22 C-17.82 31.21 -18 29.2 -18.19 27.19 C-18.27 26.28 -18.36 25.38 -18.44 24.45 C-19.74 9.54 -19.74 9.54 -17.38 4.62 C-12.23 -1.06 -7.2 -1.97 0 0 Z ",fill:"#FFFFFF",transform:"translate(134,76)"}),n().createElement("path",{d:"M0 0 C3.02 1.75 5.42 3.83 7 7 C7.4 11.19 7.24 13.53 5.31 17.31 C2.81 20.22 1.73 21.24 -2 22 C-7.24 22 -9.02 21.85 -13 18.38 C-15.33 14.44 -15.65 12.5 -15 8 C-11.95 1.3 -7.44 -1.57 0 0 Z ",fill:"#FFFFFF",transform:"translate(132,159)"}))},v=e=>{let{style:t,id:r}=e;return n().createElement("svg",{id:r,version:"1.1",style:t,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",width:"256",height:"256"},n().createElement("path",{d:"M0 0 C1.14 0.01 1.14 0.01 2.3 0.02 C30.58 0.61 55.46 14.76 74.76 34.58 C91.95 53.42 100.69 78.81 100.56 104.06 C100.56 105.21 100.55 106.35 100.55 107.53 C100.15 135.13 88.32 159.73 69.44 179.56 C47.17 201 19.32 209.07 -10.99 208.62 C-38.89 207.69 -63.47 193.74 -82.54 173.89 C-98.49 156.6 -107.7 132.68 -108.12 109.25 C-108.16 108.46 -108.2 107.67 -108.24 106.86 C-108.3 102.54 -108.15 100.83 -105.45 97.29 C-102.75 95.31 -102.75 95.31 -99.25 94.75 C-95.23 95.4 -93.57 96.41 -90.75 99.31 C-89.74 102.35 -89.41 105.19 -89.1 108.37 C-86.77 132.57 -77.76 154.3 -58.75 170.31 C-38.65 185.2 -15.7 192.29 9.34 188.81 C26.3 185.75 41.31 178.66 54.25 167.31 C54.94 166.72 55.63 166.13 56.34 165.52 C70.56 152.36 80.22 131.45 81.38 112.22 C82.28 86.29 74.94 63.71 57.25 44.31 C44.47 31.13 25.96 21.46 7.55 19.86 C6.71 19.79 5.87 19.72 5 19.64 C3.33 19.51 1.65 19.4 -0.03 19.31 C-5.85 18.87 -8.74 17.64 -12.75 13.31 C-13.34 9.12 -13.23 5.83 -10.75 2.31 C-7.07 -0.14 -4.26 -0.03 0 0 Z ",fill:"#FFFFFF",transform:"translate(131.75,23.6875)"}))},y=(0,r.createContext)({});let p=e=>{let{text:t,type:r,duration:n}=e},E=e=>{};const w=e=>{let{children:t}=e;const[l,o]=(0,r.useState)(!1),[i,a]=(0,r.useState)(""),[c,s]=(0,r.useState)("");return(0,r.useEffect)((()=>{"loading"===i&&function(){const e=document.getElementById("toast_loading");let t=0;!function r(){t=(t+6)%360,e&&(e.style.transform="rotate(".concat(t,"deg)"),window.requestAnimationFrame(r))}()}()}),[i]),p=e=>{let{text:t,type:r}=e;s(t),a(r),o(!0)},E=e=>{setTimeout((()=>{o(!1),s(""),a("")}),e||0)},n().createElement(y.Provider,{value:{}},l&&n().createElement("div",{onClick:e=>{E(2e3),e.stopPropagation()},style:{background:"rgba(0,0,0,0)",width:"100%",zIndex:1300,position:"fixed",inset:0,display:"flex",justifyContent:"center",alignItems:"center",opacity:l?1:0,transition:"opacity 1s ease-in-out"}},n().createElement("div",{style:{background:"rgba(0,0,0,0.6)",minWidth:150,minHeight:150,color:"#FFFFFF",fontSize:14,zIndex:1301,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",borderRadius:16,opacity:l?1:0,transition:"opacity 1s ease-in-out"}},"success"===i&&n().createElement(C,{style:{width:"2rem",height:"2rem"}}),"fail"===i&&n().createElement(g,{style:{width:"2rem",height:"2rem"}}),"warning"===i&&n().createElement(f,{style:{width:"2rem",height:"2rem"}}),"loading"===i&&n().createElement(v,{id:"toast_loading",style:{width:"2rem",height:"2rem"}}),n().createElement("div",{style:{marginTop:8,maxWidth:120,textAlign:"center",wordBreak:"break-all",wordWrap:"break-word"}},c))),t)};let F={show:(p,e=>{let{text:t,type:r,duration:n}=e;p({text:t,type:r,duration:n}),"loading"===r?0!==n&&E(n||2e3):E(2e3)}),close:(E,e=>{E(e)})};const b=function(e){let{children:t,onSuccess:l,style:o,id:i,accept:a="",capture:s=!1}=e;const[m,d]=(0,r.useState)(!1),u="video_"+c();return n().createElement("div",{style:{position:"relative"}},n().createElement("input",{accept:a,capture:s,id:i||u,type:"file",onChange:e=>{(e=>{d(!0);const t=e.target.files&&e.target.files[0];t&&l&&l(t)})(e),e.target.value=""},style:{visibility:"hidden",position:"absolute",width:"1rem"}}),n().createElement("div",{onClick:e=>{const t=document.getElementById(i||u);t&&(t.click(),e.stopPropagation())}},t))},k=e=>{let{children:t,onClick:r,type:l="",style:o,disabled:i=!1,isDebounce:a=!1,debounceDelay:c=500,className:d}=e;return n().createElement("button",{className:d,disabled:i,onClick:async()=>{r&&s(r)&&(a?m(r,500|c):r())},style:{display:"flex",justifyContent:"center",alignItems:"center",minWidth:"4rem",minHeight:"2rem",borderRadius:"0.25rem",fontSize:"0.875rem",outline:"none",..."default"!==l&&l?"primary"===l?{backgroundColor:"#1677ff",border:"1px solid #1677ff",color:"#FFFFFF"}:"success"===l?{backgroundColor:"#00b578",border:"1px solid #00b578",color:"#FFFFFF"}:"danger"===l?{backgroundColor:"#FF3141",border:"1px solid #FF3141",color:"#FFFFFF"}:"warning"===l?{backgroundColor:"#ff8f1f",border:"1px solid #ff8f1f",color:"#FFFFFF"}:void 0:{backgroundColor:"#fffffF",border:"1px solid #f0f0f0",color:"#000000"},...o}},t)},x=e=>{let{style:t}=e;return n().createElement("svg",{version:"1.1",style:t,viewBox:"0 0 64 66",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"},n().createElement("path",{d:"M0 0 C8.78 5.26 14.45 12.48 17.21 22.32 C18.32 33.23 16.95 42.05 9.96 50.64 C4.11 56.83 -2.76 60.85 -11.34 61.66 C-19.12 61.74 -25.11 61.46 -31.79 57.32 C-32.41 56.97 -33.03 56.62 -33.68 56.26 C-40.55 51.97 -44.69 45.04 -46.79 37.32 C-47.97 26.38 -46.68 16.96 -40.06 7.98 C-29.84 -3.29 -13.89 -6.58 0 0 Z M-19.79 18.32 C-22.36 22.19 -22.08 25.41 -22.04 29.89 C-22.05 30.67 -22.05 31.45 -22.06 32.25 C-22.23 36.76 -22.23 36.76 -19.79 40.32 C-15.51 40 -12.23 38.16 -8.54 36.07 C-7.48 35.49 -6.42 34.91 -5.34 34.31 C-2.57 32.54 -2.57 32.54 -1.93 29.59 C-1.86 28.47 -1.86 28.47 -1.79 27.32 C-3.85 26 -5.91 24.69 -7.98 23.39 C-8.84 22.83 -8.84 22.83 -9.73 22.26 C-13.06 20.17 -15.87 18.79 -19.79 18.32 Z ",fill:"#B2B2B2",transform:"translate(46.7890625,2.67578125)"}))},M=e=>{let{url:t,videoStyle:o,onClose:i,playIcon:a,autoPlay:s}=e;const[m,d]=(0,r.useState)(!!s&&!s),u=(0,r.useRef)(null),h=window.innerWidth,C=window.innerHeight,g="video_"+c(),f=()=>{const e=document.getElementById(g);e.addEventListener("ended",y),e.addEventListener("pause",v),e.play(),d(!1)},v=()=>{d(!0)},y=()=>{d(!0)};return n().createElement(l,{onClick:i,style:{position:"relative",width:h/1.125,maxHeight:C/1.25,height:C/1.125}},m?n().createElement("img",{style:{width:"2rem",height:"2rem",borderRadius:"2rem",position:"absolute",top:"50%",left:"50%",backgroundColor:"#FFFFFF",objectFit:"fill",marginLeft:"-1rem",marginTop:"-1rem",zIndex:1100},onClick:e=>{f(),e.stopPropagation()},src:a}):n().createElement("div",{onClick:e=>{f(),e.stopPropagation()}},n().createElement(x,{style:{width:"2rem",height:"2rem",borderRadius:"2rem",position:"absolute",top:"50%",left:"50%",backgroundColor:"#FFFFFF",objectFit:"fill",marginLeft:"-1rem",marginTop:"-1rem",zIndex:1100}})),n().createElement("video",{onClick:e=>{m?f():(document.getElementById(g).pause(),d(!0)),e.stopPropagation()},autoPlay:s,ref:u,id:g,style:{width:h/1.25,maxHeight:C/1.25,...o},src:t}))},S=e=>{let{url:t,videoStyle:o,children:i,playIcon:a,autoPlay:c=!1,className:s}=e;const[m,d]=(0,r.useState)(!1);function u(){d(!1)}return n().createElement(l,{className:s,onClick:()=>{t&&d(!0)}},n().createElement(h,{openModal:m,onClose:u,position:"center"},n().createElement(M,{onClose:u,playIcon:a,autoPlay:c,url:t,videoStyle:o})),i)},L=e=>{let{items:t,activeKey:l,onChange:o,defaultActiveKey:i,activeLineColor:a,containerStyle:m,itemStyle:d}=e;const[u,h]=(0,r.useState)(l||i||"");(0,r.useEffect)((()=>{o&&s(o)&&o(u)}),[u]);const C=(0,r.useMemo)((()=>c()),[t]);return n().createElement("div",{id:"tabs_"+C,style:{display:"flex",justifyContent:"center",alignItems:"center",width:"20.5rem",padding:"0.5rem 1rem",borderBottom:"1px solid #F3F3F3",backgroundColor:"#FFFFFF",...m}},t.length>0&&t.map(((e,t)=>n().createElement("div",{onClick:()=>{h(e.key)},style:{padding:"0.25rem 0",margin:"0 0.5rem",fontSize:"1rem",display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",...d},key:t},e.label,n().createElement("div",{style:{width:"2rem",height:"0.15rem",marginTop:"0.25rem",backgroundColor:e.key===u?a||"#1677ff":"#FFFFFF",transition:"all 0.5s ease"}})))))},B=e=>{let{style:t,onMouseDown:r}=e;return n().createElement("svg",{version:"1.1",style:{...t,display:"block",margin:"auto"},viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",onMouseDown:r},n().createElement("path",{d:"M512 512m-393.728 0a393.728 393.728 0 1 0 787.456 0 393.728 393.728 0 1 0-787.456 0Z",fill:"#3089E7"}),n().createElement("path",{d:"M512 1024a512 512 0 1 1 512-512 512 512 0 0 1-512 512z m0-787.712A275.712 275.712 0 1 0 787.712 512 275.968 275.968 0 0 0 512 236.288z",fill:"#FFFFFF"}))},I=e=>{let{percent:t,min:l=0,max:o=100,barWidth:i,barHeight:a,barBgColor:c,trackBgColor:s,onChange:m,isOpenSlideBlock:d=!0}=e;const[u,h]=(0,r.useState)(t),C=(0,r.useRef)(null),[g,f]=(0,r.useState)(!1);(0,r.useEffect)((()=>{h(t)}),[t]);const v=e=>{if(g&&C.current){const t=C.current,r=e.touches[0],n=t.getBoundingClientRect(),l=r.clientX-n.left,o=w(l);E(o)}},y=()=>{f(!0)},p=()=>{f(!1)};(0,r.useEffect)((()=>{const e=C.current;if(e&&d)return e.addEventListener("touchmove",v),e.addEventListener("touchstart",y),e.addEventListener("touchend",p),()=>{e.removeEventListener("touchmove",v),e.removeEventListener("touchstart",y),e.removeEventListener("touchend",p)}}),[g]);const E=e=>{const t=Math.max(l||0,Math.min(e,o||100));h(t),m&&m(t)},w=e=>{var t,r;return Math.round(e/(null!==(t=null===(r=C.current)||void 0===r?void 0:r.offsetWidth)&&void 0!==t?t:1)*(o-l))+l};return n().createElement("div",{ref:C,style:{background:c||"#eee",width:i||"100%",height:a||"16px",borderRadius:"0.5rem",position:"relative"},onClick:e=>{if(!d)return;e.stopPropagation();const t=C.current;if(!t)return;const r=t.getBoundingClientRect().left,n=e.clientX-r,l=w(n);E(l)}},n().createElement("div",{style:{background:s||"#1677ff",width:"".concat((u-l)/(o-l)*100,"%"),height:"100%",borderRadius:"0.5rem",transition:d?"":"width 0.25s ease-out"}},d&&n().createElement(B,{style:{position:"absolute",left:"".concat((u-l)/(o-l)*100,"%"),transform:"translateX(-50%)",cursor:"grab",width:a||"1rem",height:a||"1rem"}})))},z=e=>{let{style:t}=e;return n().createElement("svg",{version:"1.1",style:t,viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"},n().createElement("path",{d:"M384 810.666667c-25.6 0-42.666667-17.066667-42.666667-42.666667L341.333333 256c0-25.6 17.066667-42.666667 42.666667-42.666667s42.666667 17.066667 42.666667 42.666667l0 512C426.666667 793.6 409.6 810.666667 384 810.666667z","p-id":"2304",fill:"#1677ff"}),n().createElement("path",{d:"M640 810.666667c-25.6 0-42.666667-17.066667-42.666667-42.666667L597.333333 256c0-25.6 17.066667-42.666667 42.666667-42.666667s42.666667 17.066667 42.666667 42.666667l0 512C682.666667 793.6 665.6 810.666667 640 810.666667z","p-id":"2305",fill:"#1677ff"}))},T=e=>{let{style:t}=e;return n().createElement("svg",{version:"1.1",style:{...t,display:"block",margin:"auto"},viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"},n().createElement("path",{d:"M810.4 465.8 253.6 134.4c-6.8-4-13.8-6.4-21.8-6.4-21.8 0-39.6 18-39.6 40L192 168l0 688 0.2 0c0 22 17.8 40 39.6 40 8.2 0 15-2.8 22.4-6.8l556.2-331c13.2-11 21.6-27.6 21.6-46.2C832 493.4 823.6 477 810.4 465.8z","p-id":"1463",fill:"#1677ff"}))},P=e=>{let{style:t}=e;return n().createElement("svg",{version:"1.1",style:{...t,display:"block",margin:"auto"},viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"},n().createElement("path",{d:"M341.333333 483.541333l436.181334-290.773333a21.333333 21.333333 0 0 1 33.152 17.749333v602.965334a21.333333 21.333333 0 0 1-33.152 17.749333L341.333333 540.458667V810.666667a42.666667 42.666667 0 1 1-85.333333 0V213.333333a42.666667 42.666667 0 0 1 85.333333 0v270.208z","p-id":"7759",fill:"#1677ff"}))},R=e=>{let{style:t}=e;return n().createElement("svg",{version:"1.1",style:{...t,display:"block",margin:"auto"},viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"},n().createElement("path",{d:"M682.666667 540.458667L246.485333 831.232A21.333333 21.333333 0 0 1 213.333333 813.482667V210.517333a21.333333 21.333333 0 0 1 33.152-17.749333L682.666667 483.541333V213.333333a42.666667 42.666667 0 0 1 85.333333 0v597.333334a42.666667 42.666667 0 0 1-85.333333 0v-270.208z","p-id":"7489",fill:"#1677ff"}))},j=e=>{let{style:t,onClick:r,onMouseEnter:l,onMouseLeave:o}=e;return n().createElement("svg",{onClick:r,onTouchEnd:o,version:"1.1",style:{...t,display:"block",margin:"auto"},viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"},n().createElement("path",{d:"M521.046 114.21h-3.892v0.122c-12.893 0.973-25.785 6.811-38.435 17.515L258.57 319.035h-96.695c-46.828 0-84.898 38.07-84.898 84.897v216.014c0 46.828 38.07 84.898 84.898 84.898h96.695l220.272 187.188c13.744 11.676 27.975 17.636 42.205 17.636 15.934 0 30.408-7.784 39.408-21.285 6.933-10.339 10.339-23.475 10.339-38.922V174.417c0-41.597-25.056-60.207-49.747-60.207z m416.947 536.022c-12.042 12.041-31.624 12.041-43.665 0L694.125 450.03c-12.041-12.042-12.041-31.624 0-43.665 12.042-12.042 31.624-12.042 43.665 0l200.081 200.08c12.041 12.042 12.041 31.746 0.122 43.787z",fill:"#3089E7","p-id":"3045"}),n().createElement("path",{d:"M937.993 406.365c12.041 12.041 12.041 31.623 0 43.665L737.79 650.232c-12.041 12.041-31.623 12.041-43.665 0-12.041-12.041-12.041-31.624 0-43.665l200.203-200.202c12.04-12.042 31.623-12.042 43.665 0z",fill:"#3089E7","p-id":"3046"}))},H=e=>{let{style:t,onClick:r,onMouseEnter:l,onMouseLeave:o}=e;return n().createElement("svg",{onClick:r,onTouchStart:l,onTouchCancel:o,version:"1.1",style:{...t,display:"block",margin:"auto"},viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"},n().createElement("path",{d:"M689.085 335.699c-18.785-18.785-49.239-18.785-68.023 0s-18.785 49.239 0 68.023c56.355 56.355 56.355 147.717 0 204.069-18.785 18.785-18.785 49.239 0 68.023 18.785 18.785 49.239 18.785 68.023 0 93.92-93.92 93.92-246.199 0-340.125z m-225.25-176.264L258.597 313.366H130.261c-35.674 0-64.067 28.451-64.067 63.543V634.63c0 34.619 28.684 63.543 64.067 63.543h128.336l205.238 153.931c28.537 21.398 51.299 9.69 51.299-25.82V185.257c0-35.062-22.971-47.065-51.299-25.82z",fill:"#3089E7","p-id":"2822"}),n().createElement("path",{d:"M825.132 199.656c-18.785-18.785-49.239-18.785-68.023 0s-18.785 49.239 0 68.023c131.492 131.492 131.492 344.682 0 476.174-18.785 18.785-18.785 49.239 0 68.023 18.785 18.785 49.239 18.785 68.023 0v-0.001c169.06-169.06 169.06-443.158 0-612.221z",fill:"#3089E7","p-id":"2823"}))},W=e=>{let{style:t,onClick:r,onMouseEnter:l,onMouseLeave:o}=e;return n().createElement("svg",{onClick:r,onTouchEnd:o,version:"1.1",style:{...t,display:"block",margin:"auto"},viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"},n().createElement("path",{d:"M521.046 114.21h-3.892v0.122c-12.893 0.973-25.785 6.811-38.435 17.515L258.57 319.035h-96.695c-46.828 0-84.898 38.07-84.898 84.897v216.014c0 46.828 38.07 84.898 84.898 84.898h96.695l220.272 187.188c13.744 11.676 27.975 17.636 42.205 17.636 15.934 0 30.408-7.784 39.408-21.285 6.933-10.339 10.339-23.475 10.339-38.922V174.417c0-41.597-25.056-60.207-49.747-60.207z m416.947 536.022c-12.042 12.041-31.624 12.041-43.665 0L694.125 450.03c-12.041-12.042-12.041-31.624 0-43.665 12.042-12.042 31.624-12.042 43.665 0l200.081 200.08c12.041 12.042 12.041 31.746 0.122 43.787z",fill:"#B3B3B3","p-id":"3045"}),n().createElement("path",{d:"M937.993 406.365c12.041 12.041 12.041 31.623 0 43.665L737.79 650.232c-12.041 12.041-31.623 12.041-43.665 0-12.041-12.041-12.041-31.624 0-43.665l200.203-200.202c12.04-12.042 31.623-12.042 43.665 0z",fill:"#B3B3B3","p-id":"3046"}))},A=e=>{let{url:t,playIcon:o,pauseIcon:i,forwardIcon:a,progressBarConfig:c,backwardIcon:s,timeTextStyle:m}=e;const[d,u]=(0,r.useState)(!1),h=(0,r.useRef)(null),[C,g]=(0,r.useState)(0),[f,v]=(0,r.useState)(0),[y,p]=(0,r.useState)(!1),[E,w]=(0,r.useState)(50),[F,b]=(0,r.useState)(!1);(0,r.useEffect)((()=>{var e,t;d?null===(e=h.current)||void 0===e||e.play().catch((e=>{console.log("播放失败")})):null===(t=h.current)||void 0===t||t.pause()}),[d]),(0,r.useEffect)((()=>{if(h.current)return h.current.addEventListener("canplay",(()=>{var e;console.log("音频可以开始播放"),v((null===(e=h.current)||void 0===e?void 0:e.duration)||0)})),()=>{h.current.removeEventListener("canplay",(()=>{}))}}),[]),(0,r.useEffect)((()=>{h.current&&(h.current.muted=y)}),[y]);const k=(0,r.useMemo)((()=>{const e=Math.floor(f),t=Math.round(e%60);return Math.round((e-t)/60)+":"+(t<10?"0"+t.toString():t)}),[f]),x=(0,r.useMemo)((()=>0!==f?Math.round(C/f*100):0),[C,f]),M=(0,r.useMemo)((()=>{const e=Math.floor(C),t=Math.round(e%60);return Math.round((e-t)/60)+":"+(t<10?"0"+t.toString():t)}),[C]);return console.log(y),n().createElement("div",{style:{width:"100%",backgroundColor:"rgba(255,255,255,0.5)"}},n().createElement("audio",{ref:h,src:t,onTimeUpdate:()=>{g(h.current.currentTime)},onEnded:()=>u(!1)}),n().createElement(l,{style:{width:"100%"}},d?n().createElement(l,{onClick:()=>u(!1)},i||n().createElement(z,{style:{width:"2rem",height:"2rem"}})):n().createElement(l,{onClick:()=>u(!0)},o?i:n().createElement(T,{style:{width:"2rem",height:"2rem"}})),n().createElement(l,{onClick:()=>{u(!0),h.current&&(h.current.currentTime=Math.max(0,h.current.currentTime-2))}},s||n().createElement(P,{style:{width:"2rem",height:"2rem"}})),n().createElement(I,{onChange:e=>{u(!0);const t=Math.floor(e/100*f);h.current&&(g(t),h.current.currentTime=t)},trackBgColor:null==c?void 0:c.trackBgColor,barBgColor:null==c?void 0:c.barBgColor,barWidth:(null==c?void 0:c.barWidth)||"6rem",barHeight:null==c?void 0:c.barHeight,percent:x}),n().createElement(l,{style:{marginLeft:"0.5rem"},onClick:()=>{u(!0),h.current&&(h.current.currentTime=Math.min(h.current.duration,h.current.currentTime+2))}},a||n().createElement(R,{style:{width:"2rem",height:"2rem"}})),n().createElement("div",{style:{position:"relative"}},n().createElement(l,{style:{margin:"0.25rem"}},y?n().createElement(j,{onClick:()=>{p(!1)},style:{width:"2rem",height:"2rem",margin:"0.25rem"}}):n().createElement(W,{onClick:()=>{p(!0)},style:{width:"2rem",height:"2rem",margin:"0.25rem"}}),n().createElement(H,{onClick:()=>{b(!F)},style:{width:"2rem",height:"2rem",marginLeft:"0.5rem"}})),F&&n().createElement(l,{style:{position:"absolute",top:"-1.5rem",left:"-1rem"}},n().createElement("div",{style:{color:"#FFFFFF",fontSize:"1rem",marginRight:"0.5rem"}},E),n().createElement(I,{onChange:e=>{w(e)},barWidth:"5rem",barHeight:"0.5rem",percent:E}))),n().createElement("div",{style:{color:"#B3B3B3",...m}},k?M+"/"+k:"")))},D=e=>{let{value:t,maxLength:o=6,style:i,inputItemStyle:a,iconStyle:c,onChange:s,onSubmit:m,autoFocus:d=!0}=e;const[u,h]=(0,r.useState)(t||""),[C,g]=(0,r.useState)(!1);(0,r.useEffect)((()=>{const e=f.current,t=()=>g(!0),r=()=>g(!1);return e&&(e.addEventListener("focus",t),e.addEventListener("blur",r)),()=>{e&&(e.removeEventListener("focus",t),e.removeEventListener("blur",r))}}),[]);const f=(0,r.useRef)(null);return(0,r.useEffect)((()=>{u.length>o-1&&m&&m(u)}),[u]),n().createElement(l,{onClick:()=>{const e=f.current;e&&e.focus()},style:{background:"#FFFFFF",position:"relative",width:44*o,...i}},n().createElement("style",null,"\n @keyframes blink {\n 0%, 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n }\n }\n "),(e=>{let t=[];for(let r=0;r<e;r++)t.push(r);return t})(o).map(((e,t)=>n().createElement("div",{key:t,style:{marginLeft:0===t?0:4,height:44,width:44,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"#F3F3F3",borderRadius:12,fontSize:16,...a}},t===u.length&&C&&n().createElement("div",{style:{display:"inline-block",width:1,height:16,backgroundColor:"#000000",animation:"blink 1s step-start infinite"}}),t<u.length?n().createElement("div",{style:{width:16,height:16,backgroundColor:"#000000",borderRadius:16,...c}}):null))),n().createElement("input",{value:u,style:{opacity:0,zIndex:-1,position:"absolute",top:8,left:"50%",width:1},ref:f,maxLength:o,autoFocus:d,type:"text",onChange:e=>{e.target.value.length<=o&&(h(e.target.value),s&&s(e.target.value))}}))},V=e=>{let{style:t,onClick:r}=e;return n().createElement("svg",{onClick:r,version:"1.1",style:{...t,display:"block",margin:"auto"},viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"},n().createElement("path",{d:"M119.579981 119.560026l185.746448 0c16.074094 0 29.283953-13.134135 29.283953-29.322839 0-16.303314-13.113669-29.321816-29.283953-29.321816l-215.107149 0c-8.037047 0-15.34857 3.282766-20.655436 8.590656-5.383614 5.307889-8.629541 12.619412-8.629541 20.694321L60.934303 305.306474c0 16.074094 13.134135 29.283953 29.321816 29.283953 16.303314 0 29.322839-13.114692 29.322839-29.283953L119.578957 119.560026zM901.51076 119.560026 715.764312 119.560026c-16.093537 0-29.283953-13.134135-29.283953-29.322839 0-16.303314 13.114692-29.321816 29.283953-29.321816l215.107149 0c8.037047 0 15.34857 3.282766 20.655436 8.590656 5.384637 5.307889 8.629541 12.619412 8.629541 20.694321L960.156438 305.306474c0 16.074094-13.134135 29.283953-29.321816 29.283953-16.303314 0-29.322839-13.114692-29.322839-29.283953L901.511783 119.560026zM119.579981 901.489782l185.746448 0c16.074094 0 29.283953 13.133112 29.283953 29.321816 0 16.303314-13.113669 29.321816-29.283953 29.321816l-215.107149 0c-8.037047 0-15.34857-3.28379-20.655436-8.590656-5.383614-5.306866-8.629541-12.619412-8.629541-20.694321L60.934303 715.744357c0-16.075117 13.134135-29.286 29.321816-29.286 16.303314 0 29.322839 13.114692 29.322839 29.286L119.578957 901.489782zM901.51076 901.489782 715.764312 901.489782c-16.093537 0-29.283953 13.133112-29.283953 29.321816 0 16.303314 13.114692 29.321816 29.283953 29.321816l215.107149 0c8.037047 0 15.34857-3.28379 20.655436-8.590656 5.384637-5.306866 8.629541-12.619412 8.629541-20.694321L960.156438 715.744357c0-16.075117-13.134135-29.286-29.321816-29.286-16.303314 0-29.322839 13.114692-29.322839 29.286L901.511783 901.489782z",fill:"#1677ff","p-id":"2149"}))},_=e=>{let{style:t,onClick:r}=e;return n().createElement("svg",{onClick:r,version:"1.1",style:{...t,display:"block",margin:"auto"},viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"},n().createElement("path",{d:"M745.12399 745.104035l185.747471 0c16.093537 0 29.283953-13.135158 29.283953-29.321816 0-16.303314-13.114692-29.323862-29.283953-29.323862L715.764312 686.458357c-8.037047 0-15.34857 3.28379-20.656459 8.591679-5.383614 5.306866-8.628518 12.617365-8.628518 20.694321l0 215.106126c0 16.07307 13.134135 29.283953 29.321816 29.283953 16.303314 0 29.321816-13.114692 29.321816-29.283953L745.122967 745.104035zM275.966751 745.104035l-185.747471 0c-16.093537 0-29.283953-13.135158-29.283953-29.321816 0-16.303314 13.114692-29.323862 29.283953-29.323862l215.107149 0c8.037047 0 15.34857 3.28379 20.656459 8.591679 5.383614 5.306866 8.628518 12.617365 8.628518 20.694321l0 215.106126c0 16.07307-13.133112 29.283953-29.321816 29.283953-16.303314 0-29.321816-13.114692-29.321816-29.283953L275.967774 745.104035zM745.12399 275.945773l185.747471 0c16.093537 0 29.283953 13.134135 29.283953 29.322839 0 16.303314-13.114692 29.321816-29.283953 29.321816L715.764312 334.590428c-8.037047 0-15.34857-3.282766-20.656459-8.590656-5.383614-5.306866-8.628518-12.618389-8.628518-20.693298L686.479335 90.199325c0-16.074094 13.134135-29.283953 29.321816-29.283953 16.303314 0 29.321816 13.114692 29.321816 29.283953L745.122967 275.945773zM275.966751 275.945773l-185.747471 0c-16.093537 0-29.283953 13.134135-29.283953 29.322839 0 16.303314 13.114692 29.321816 29.283953 29.321816l215.107149 0c8.037047 0 15.34857-3.282766 20.656459-8.590656 5.383614-5.306866 8.628518-12.618389 8.628518-20.693298L334.611405 90.199325c0-16.074094-13.133112-29.283953-29.321816-29.283953-16.303314 0-29.321816 13.114692-29.321816 29.283953L275.967774 275.945773z",fill:"#1677ff","p-id":"2407"}))},Z=e=>{let{url:t,width:o,height:i,playIcon:a,pauseIcon:c,forwardIcon:s,progressBarConfig:m,backwardIcon:d,timeTextStyle:u}=e;const[h,C]=(0,r.useState)(!1),g=(0,r.useRef)(null),[f,y]=(0,r.useState)(0),[p,E]=(0,r.useState)(0),[w,F]=(0,r.useState)(!1),[b,k]=(0,r.useState)(0),[x,M]=(0,r.useState)(!1),[S,L]=(0,r.useState)(!1),[B,A]=(0,r.useState)(1),[D,Z]=(0,r.useState)(!1),[O,N]=(0,r.useState)(!1),[U,q]=(0,r.useState)(!1),[X,K]=(0,r.useState)(50),[Y,G]=(0,r.useState)(!1);(0,r.useEffect)((()=>{var e,t;h?null===(e=g.current)||void 0===e||e.play().then((()=>{setTimeout((()=>{G(!1),Z(!1),F(!0)}),3e3)})).catch((e=>{q(!0),console.log("播放失败")})):null===(t=g.current)||void 0===t||t.pause()}),[h]),(0,r.useEffect)((()=>{if(g.current)return g.current.addEventListener("canplay",(()=>{var e;console.log("音频可以开始播放"),E((null===(e=g.current)||void 0===e?void 0:e.duration)||0)})),()=>{g.current.removeEventListener("canplay",(()=>{}))}}),[]),(0,r.useEffect)((()=>{g.current&&(g.current.muted=x)}),[x]),(0,r.useEffect)((()=>{g.current&&(g.current.playbackRate=B)}),[B]),(0,r.useEffect)((()=>{if(g.current){if(0===X)return M(!0);M(!1),g.current.volume=X/100}}),[X]),(0,r.useEffect)((()=>{O&&function(){const e=document.getElementById("loading_icon");let t=0;!function r(){t=(t+6)%360,e&&(e.style.transform="rotate(".concat(t,"deg)"),window.requestAnimationFrame(r))}()}()}),[O]);const J=(0,r.useMemo)((()=>{const e=Math.floor(p),t=Math.round(e%60);return Math.round((e-t)/60)+":"+(t<10?"0"+t.toString():t)}),[p]),Q=(0,r.useMemo)((()=>0!==p?Math.round(f/p*100):0),[f,p]),$=(0,r.useMemo)((()=>{const e=Math.floor(f),t=Math.round(e%60);return Math.round((e-t)/60)+":"+(t<10?"0"+t.toString():t)}),[f]);return n().createElement("div",{style:{background:"#000000",width:S?"100vw":o||"100%",height:S?"100vh":i||"100%",maxWidth:"100vw",maxHeight:"100vh",position:S?"fixed":"relative",inset:S?0:""}},O&&n().createElement(v,{id:"loading_icon",style:{width:"2rem",height:"2rem",position:"absolute",top:"50%",left:"50%",marginTop:"-1rem",marginLeft:"-1rem"}}),U&&n().createElement("div",{style:{width:"5rem",height:"2rem",position:"absolute",top:"50%",left:"50%",color:"#FFFFFF",fontSize:"1rem",marginTop:"-1rem",marginLeft:"-2.5rem"}},"Play failed"),n().createElement("video",{onTouchEnd:e=>{const t=Date.now(),r=t-b;r<300&&r>0&&(C(!h),F(!0)),k(t),e.stopPropagation()},onClick:e=>{F(!w),Z(!1),G(!1),e.stopPropagation()},onLoadStart:()=>{N(!0)},onLoadedData:()=>{N(!1)},onWaiting:()=>{N(!0)},onPlaying:()=>{N(!1)},style:{width:S?"100vw":o||"100%",height:S?"100vh":i||"100%",maxWidth:"100vw",maxHeight:"100vh"},ref:g,src:t,onTimeUpdate:()=>{y(g.current.currentTime)},onEnded:()=>C(!1)}),n().createElement(l,{style:{position:"absolute",zIndex:3,bottom:"0rem",width:S?"100vw":o||"100%",opacity:w?0:1,background:"rgba(255,255,255,0.5)"}},h?n().createElement(l,{onClick:()=>C(!1)},c||n().createElement(z,{style:{width:"2rem",height:"2rem"}})):n().createElement(l,{onClick:()=>C(!0)},a?c:n().createElement(T,{style:{width:"2rem",height:"2rem"}})),n().createElement(l,{style:{marginRight:"0.5rem"},onClick:()=>{C(!0),g.current&&(g.current.currentTime=Math.max(0,g.current.currentTime-2))}},d||n().createElement(P,{style:{width:"2rem",height:"2rem"}})),n().createElement(I,{onChange:e=>{C(!0);const t=Math.floor(e/100*p);g.current&&(y(t),g.current.currentTime=t)},trackBgColor:null==m?void 0:m.trackBgColor,barBgColor:null==m?void 0:m.barBgColor,barWidth:"50%",barHeight:null==m?void 0:m.barHeight,percent:Q}),n().createElement(l,{style:{marginLeft:"0.5rem"},onClick:()=>{C(!0),g.current&&(g.current.currentTime=Math.min(g.current.duration,g.current.currentTime+2))}},s||n().createElement(R,{style:{width:"2rem",height:"2rem"}})),n().createElement("div",{style:{marginLeft:"0.25rem",color:"#FFFFFF",...u}},J?$+"/"+J:""),n().createElement("div",{onClick:e=>{Z(!D),e.stopPropagation()},style:{width:"2rem",fontSize:"0.875rem",color:"#1677ff",position:"relative",padding:"0.25rem"}},B,"x",D&&n().createElement("div",{style:{position:"absolute",width:"4rem",top:"-6.75rem",left:"-1.25rem",borderRadius:"0.5rem",background:"#FFFFFF"}},[.5,1,1.5,2].map(((e,t)=>n().createElement("div",{onClick:t=>{A(e),Z(!1),t.stopPropagation()},style:{margin:"0.25rem 0",borderRadius:"0.5rem",background:B===e?"#1677ff":"#FFFFFF",color:B!==e?"#1677ff":"#FFFFFF"},key:t},e))))),n().createElement("div",{style:{position:"relative"}},n().createElement(l,{style:{margin:"0.25rem"}},x?n().createElement(j,{onClick:()=>{M(!1)},style:{width:"2rem",height:"2rem",margin:"0.25rem"}}):n().createElement(W,{onClick:()=>{M(!0)},style:{width:"2rem",height:"2rem",margin:"0.25rem"}}),n().createElement(H,{onClick:()=>{G(!Y)},style:{width:"2rem",height:"2rem",marginLeft:"0.5rem"}})),Y&&n().createElement(l,{style:{position:"absolute",top:"-1.5rem",left:"-1rem"}},n().createElement("div",{style:{color:"#FFFFFF",fontSize:"1rem",marginRight:"0.5rem"}},X),n().createElement(I,{onChange:e=>{K(e)},barWidth:"5rem",barHeight:"0.5rem",percent:X}))),S?n().createElement(_,{onClick:()=>{L(!1)},style:{width:"2rem",height:"2rem",marginLeft:"0.5rem"}}):n().createElement(V,{onClick:()=>{L(!0)},style:{width:"2rem",height:"2rem",marginLeft:"0.5rem"}})))},O=e=>{let{style:t}=e;return n().createElement("svg",{version:"1.1",style:t,viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"256",height:"256"},n().createElement("path",{d:"M512 614.4c-78.506667 0-141.653333-63.146667-141.653333-141.653333V244.053333C370.346667 165.546667 433.493333 102.4 512 102.4s141.653333 63.146667 141.653333 141.653333v230.4c0 76.8-63.146667 139.946667-141.653333 139.946667z m0-460.8c-49.493333 0-90.453333 40.96-90.453333 90.453333v230.4c0 49.493333 40.96 90.453333 90.453333 90.453334s90.453333-40.96 90.453333-90.453334V244.053333c0-49.493333-40.96-90.453333-90.453333-90.453333zM938.666667 307.2c-13.653333 0-25.6-11.946667-25.6-25.6v-153.6c0-13.653333 11.946667-25.6 25.6-25.6s25.6 11.946667 25.6 25.6v153.6c0 13.653333-11.946667 25.6-25.6 25.6zM85.333333 307.2c-13.653333 0-25.6-11.946667-25.6-25.6v-153.6C59.733333 114.346667 71.68 102.4 85.333333 102.4s25.6 11.946667 25.6 25.6v153.6c0 13.653333-11.946667 25.6-25.6 25.6z m698.026667-37.546667c-13.653333 0-25.6-11.946667-25.6-25.6V167.253333c0-13.653333 11.946667-25.6 25.6-25.6s25.6 11.946667 25.6 25.6v76.8c0 13.653333-11.946667 25.6-25.6 25.6z m-542.72 0c-13.653333 0-25.6-11.946667-25.6-25.6V167.253333c0-13.653333 11.946667-25.6 25.6-25.6s25.6 11.946667 25.6 25.6v76.8c0 13.653333-11.946667 25.6-25.6 25.6z",fill:"#1677ff","p-id":"4571"}),n().createElement("path",{d:"M512 768c-163.84 0-296.96-131.413333-296.96-295.253333v-39.253334c0-13.653333 11.946667-25.6 25.6-25.6s25.6 11.946667 25.6 25.6v39.253334C266.24 607.573333 377.173333 716.8 512 716.8s245.76-109.226667 245.76-244.053333v-39.253334c0-13.653333 11.946667-25.6 25.6-25.6s25.6 11.946667 25.6 25.6v39.253334C808.96 636.586667 675.84 768 512 768z",fill:"#1677ff","p-id":"4572"}),n().createElement("path",{d:"M628.053333 921.6H395.946667c-13.653333 0-25.6-11.946667-25.6-25.6s11.946667-25.6 25.6-25.6h90.453333v-128c0-13.653333 11.946667-25.6 25.6-25.6s25.6 11.946667 25.6 25.6V870.4h90.453333c13.653333 0 25.6 11.946667 25.6 25.6s-11.946667 25.6-25.6 25.6z",fill:"#1677ff","p-id":"4573"}))},N=e=>{let{callback:t,children:l,statusContainerStyle:o,durationStyle:i}=e;const[a,s]=(0,r.useState)(!1),[m,u]=(0,r.useState)(!1),[h,C]=(0,r.useState)(null),[g,f]=(0,r.useState)(0),v=(0,r.useRef)(),y=(0,r.useRef)(),p=(0,r.useRef)(0);return(0,r.useEffect)((()=>{try{navigator.mediaDevices.getUserMedia({audio:!0}).then((e=>{v.current=new MediaRecorder(e)})).catch((e=>{console.error("无法访问麦克风:",e)}))}catch(e){console.error("无法访问麦克风:",e)}}),[]),(0,r.useEffect)((()=>{if(!v.current)return;const e=e=>{const t=new File([e.data],"".concat(c(),"_").concat((new Date).getTime(),".").concat("iOS"===d()?"aac":"wav"),{type:"audio/".concat("iOS"===d()?"aac":"wav")});C(t)};return v.current.ondataavailable=e,()=>{v.current.removeEventListener("dataavailable",e)}}),[g,t]),(0,r.useEffect)((()=>{h&&(m?(s(!1),f(0),C(null),u(!1)):(console.log(h,g),t&&t(h,g),f(0),C(null)))}),[m,a,h]),n().createElement("div",{onTouchStart:e=>{var t,r;s(!0),p.current=e.touches[0].clientY,"inactive"===(null===(t=v.current)||void 0===t?void 0:t.state)&&(null===(r=v.current)||void 0===r||r.start(),clearInterval(y.current),y.current=setInterval((()=>{f((e=>e+1))}),1e3))},onTouchEnd:()=>{var e,t;"recording"===(null===(e=v.current)||void 0===e?void 0:e.state)&&(null===(t=v.current)||void 0===t||t.stop(),s(!1),clearInterval(y.current))},onTouchMove:e=>{e.touches[0].clientY<p.current-50&&(u(!0),s(!1))},onContextMenu:e=>{e.preventDefault()},style:{display:"flex",justifyContent:"flex-start",alignItems:"center",flexDirection:"column",userSelect:"none"}},!a&&n().createElement("div",{style:{width:"7.03rem",height:"7.03rem"}}),a&&n().createElement("div",{style:{backgroundColor:"#f5F5F5",display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",borderRadius:"0.75rem",marginBottom:"0.5rem",width:"8.03rem",height:"8.03rem",...o}},n().createElement(O,{style:{width:"2rem",height:"2rem"}}),n().createElement("div",{style:{color:"#1677ff",fontSize:"0.875rem",lineHeight:"1rem",wordBreak:"break-all",wordWrap:"break-word",marginTop:"0.5rem",...i}},g,"s"),n().createElement("div",{style:{fontWeight:500,width:"3.5rem",color:"#656870",fontSize:"0.75rem",lineHeight:"1rem",wordBreak:"break-all",wordWrap:"break-word",marginTop:"0.5rem"}},"松手发送 上滑取消")),l)};module.exports=t})();