UNPKG

filecat

Version:
1 lines 2.13 kB
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[903],{4903(t,e,n){n.r(e),n.d(e,{default:()=>y});var r=n(6540),c=n(7444),i=n(6417),o=n(5997),a=n(7952),l=n(2042),u=n(505),f=n(2389);function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,c,i,o,a=[],l=!0,u=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(t){u=!0,c=t}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw c}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return s(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var m=r.lazy(function(){return Promise.all([n.e(916),n.e(10)]).then(n.bind(n,4299))});function y(t){var e=(0,f.Bd)().t,n=d((0,c.L4)(i.A.markdown),2),s=n[0],y=n[1],v=function(t){(0,u.l)(t),(0,l.LW)("复制成功")};if((0,r.useEffect)(function(){var t=document.querySelectorAll(".copy-btn");return t.forEach(function(t){t.addEventListener("click",function(){var t=this.getAttribute("data-code");v(t)})}),function(){t.forEach(function(t){t.removeEventListener("click",function(){var t=this.getAttribute("data-code");v(t)})})}},[s]),s.context)return r.createElement("div",{id:"md-container"},r.createElement(a.A,{ignore_tags:!0,left_children:[r.createElement(o.rA,{key:1,title:e("取消"),icon:"close",onClick:function(){y({context:"",filename:""})}}),r.createElement("title",{key:2},s.filename)]}),r.createElement("div",{className:"md-context markdown-body "},r.createElement(m,{context:s.context})))}}}]);