1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2111],{57451:(e,t,o)=>{o.d(t,{A:()=>s});let s=(0,o(30280).A)("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]])},72111:(e,t,o)=>{o.d(t,{YoutubeToolbarButton:()=>h});var s=o(95155),n=o(57451),u=o(16015),r=o(12115),a=o(21978),i=o(95178),l=o(50350),c=o(19433),d=o(56671);function h(e){let{className:t,...o}=e,h=(0,u.Q_)(),[x,m]=r.useState(!1),[p,b]=r.useState(""),w=r.useCallback(()=>{var e;return p.trim()?(e=p.trim())&&[/^https?:\/\/(www\.)?youtube\.com\/watch\?v=[\w-]+/,/^https?:\/\/youtu\.be\/[\w-]+/,/^https?:\/\/(www\.)?youtube\.com\/embed\/[\w-]+/,/^https?:\/\/(www\.)?youtube\.com\/shorts\/[\w-]+/].some(t=>t.test(e))?void(h.tf.insertNodes({type:"media_embed",url:p.trim(),children:[{text:""}]}),h.tf.insertNodes(h.api.create.block()),b(""),m(!1)):void d.o.error("请è¾å
¥ææç YouTube 龿¥"):void d.o.error("请è¾å
¥ YouTube 龿¥")},[h,p]),v=r.useCallback(e=>{"Enter"===e.key&&(e.preventDefault(),w())},[w]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",className:(0,c.cn)("inline-flex h-8 min-w-8 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded px-2 font-medium text-sm outline-none transition-colors","hover:bg-muted hover:text-muted-foreground","disabled:pointer-events-none disabled:opacity-50","[&_svg]:size-4 [&_svg]:shrink-0",t),title:"æå
¥ YouTube è§é¢",onClick:()=>m(!0),...o,children:(0,s.jsx)(n.A,{})}),(0,s.jsx)(i.Dialog,{open:x,onOpenChange:m,children:(0,s.jsxs)(i.DialogContent,{className:"sm:max-w-md",children:[(0,s.jsx)(i.DialogHeader,{children:(0,s.jsx)(i.DialogTitle,{children:"æå
¥ YouTube è§é¢"})}),(0,s.jsx)("div",{className:"space-y-4 py-4",children:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(l.Input,{placeholder:"ç²è´´ YouTube 龿¥...",value:p,onChange:e=>b(e.target.value),onKeyDown:v,autoFocus:!0}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"æ¯ææ ¼å¼ï¼youtube.com/watch?v=xxxãyoutu.be/xxxãyoutube.com/shorts/xxx"})]})}),(0,s.jsxs)(i.DialogFooter,{children:[(0,s.jsx)(a.Button,{variant:"outline",onClick:()=>m(!1),children:"åæ¶"}),(0,s.jsx)(a.Button,{onClick:w,children:"æå
¥"})]})]})})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.