1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2338],{22338:function(e,o,i){i.d(o,{J:function(){return g},j:function(){return h}});var s=i(52322),r=i(28535),t=i(20437),a=i(17993),l=i(77533),n=i(70065),d=i(38914),c=i(2784),u=i(1233),b=i(54318),x=i(97573),p=i(67732);let m=e=>{var o,i,s,r;return null!==(r=null!==(s=e.fileName)&&void 0!==s?s:null===(o=e.fileUri)||void 0===o?void 0:o.replace(/^\/?assets\//,""))&&void 0!==r?r:null===(i=e.id)||void 0===i?void 0:i.replaceAll("-","")},g=e=>{let{children:o,isDisabled:i=!1,onSelect:g,teamId:h}=e,{upload:f}=(0,b.i)(),y=(0,n.p)(),v=(0,c.useRef)(null),j=(0,c.useRef)(null),[C,k]=(0,c.useState)(!1),[S,w]=(0,c.useState)(!1),[I,R]=(0,c.useState)(!1),[z,N]=(0,c.useState)({left:0,top:0});(0,c.useEffect)(()=>(document.body.classList.toggle("asset-library-overlay-open",I),()=>{document.body.classList.remove("asset-library-overlay-open")}),[I]);let L=async e=>{if(e){w(!0);try{let o=await f(e,h?{teamId:h}:void 0);g(m(o)),k(!1)}catch(e){y({title:"Image upload failed",description:e instanceof Error?e.message:"Could not upload image.",status:"error",isClosable:!0})}finally{w(!1)}}},_=C?(0,s.jsx)(r.xu,{inset:"0",position:"fixed",style:{zIndex:2147483600},onClick:()=>k(!1),children:(0,s.jsx)(r.xu,{bg:"bg.100",borderRadius:"md",left:"".concat(z.left,"px"),p:"2",position:"fixed",top:"".concat(z.top,"px"),w:{base:"min(92vw, 360px)",md:"360px"},onClick:e=>e.stopPropagation(),children:(0,s.jsxs)(t.M,{columns:2,gap:"2",children:[(0,s.jsx)(r.xu,{as:"button","aria-label":"Upload image",bg:"ui.5",border:"1px dashed",borderColor:"ui.20",borderRadius:"md",cursor:"pointer",minH:"96px",p:"4",textAlign:"center",transition:"background 0.15s ease, border-color 0.15s ease",type:"button",onClick:()=>{var e;return null===(e=j.current)||void 0===e?void 0:e.click()},_hover:{bg:"ui.10",borderColor:"ui.40"},children:(0,s.jsxs)(a.g,{spacing:"2",children:[(0,s.jsx)(x.e,{icon:d.cf$,boxSize:"5",color:"ui.80"}),(0,s.jsx)(l.x,{color:"ui.100",textStyle:"label.sm",children:S?"Uploading...":"Upload Image"}),(0,s.jsx)(l.x,{color:"ui.60",textStyle:"paragraph.xs",children:"Choose from your device"})]})}),(0,s.jsx)(r.xu,{as:"button","aria-label":"Select image from library",bg:"ui.5",border:"1px dashed",borderColor:"ui.20",borderRadius:"md",cursor:"pointer",minH:"96px",p:"4",textAlign:"center",transition:"background 0.15s ease, border-color 0.15s ease",type:"button",onClick:()=>{R(!0),k(!1)},_hover:{bg:"ui.10",borderColor:"ui.40"},children:(0,s.jsxs)(a.g,{spacing:"2",children:[(0,s.jsx)(x.e,{icon:d.l9f,boxSize:"5",color:"ui.80"}),(0,s.jsx)(l.x,{color:"ui.100",textStyle:"label.sm",children:"Select from Library"}),(0,s.jsx)(l.x,{color:"ui.60",textStyle:"paragraph.xs",children:"Reuse an uploaded asset"})]})})]})})}):null;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.xu,{as:"span",cursor:i?"not-allowed":"pointer",display:"inline-block",opacity:i?.6:1,ref:v,onClick:()=>{var e;if(i)return;let o=null===(e=v.current)||void 0===e?void 0:e.getBoundingClientRect();o&&N({left:Math.min(Math.max(12,o.left),Math.max(12,window.innerWidth-360-12)),top:Math.min(o.bottom+8,window.innerHeight-220)}),k(!0)},children:o}),(0,s.jsx)("input",{ref:j,accept:"image/*",className:"hidden",type:"file",onChange:e=>{var o;L(null===(o=e.target.files)||void 0===o?void 0:o[0]),e.target.value=""}}),_,I&&(0,s.jsx)(r.xu,{alignItems:"center",bg:"rgba(0, 0, 0, 0.88)",backdropFilter:"blur(10px)",display:"flex",inset:"0",justifyContent:"center",p:{base:"0",sm:"4"},position:"fixed",style:{isolation:"isolate",zIndex:2147483600},onClick:()=>R(!1),children:(0,s.jsxs)(r.xu,{borderRadius:{base:"none",sm:"xl"},className:"!bg-background-300",h:{base:"100dvh",sm:"min(90vh, 820px)"},maxW:"1440px",overflow:{base:"hidden",sm:"visible"},position:"relative",style:{isolation:"isolate",zIndex:1},w:{base:"100%",sm:"min(98vw, 1440px)"},onClick:e=>e.stopPropagation(),children:[(0,s.jsx)(r.xu,{as:"button","aria-label":"Close Image Library",bg:"ui.10",borderRadius:"md",color:"white",display:"flex",h:"9",alignItems:"center",justifyContent:"center",position:"absolute",right:{base:"3",sm:"0"},top:{base:"3",sm:"0"},transform:{base:"none",sm:"translate(33%, -33%)"},transition:"background 0.15s ease",type:"button",w:"9",zIndex:"50",onClick:()=>R(!1),_hover:{bg:"ui.20"},children:(0,s.jsx)(p.G,{icon:d.NBC,className:"size-4"})}),(0,s.jsx)(r.xu,{h:"full",overflow:"hidden",borderRadius:{base:"none",sm:"xl"}
1,children:(0,s.jsx)(u.AssetLibraryContent,{closeOnSelect:!0,pickerMode:!0,teamId:h,onSelect:e=>{g((0,u.getAssetStorageFileName)(e)),R(!1)}})})]})})]})},h=e=>{let{isDisabled:o=!1,onSelect:i,teamId:g}=e,{upload:h}=(0,b.i)(),f=(0,n.p)(),y=(0,c.useRef)(null),[v,j]=(0,c.useState)(!1),[C,k]=(0,c.useState)(!1);(0,c.useEffect)(()=>(document.body.classList.toggle("asset-library-overlay-open",C),()=>{document.body.classList.remove("asset-library-overlay-open")}),[C]);let S=async e=>{if(e&&!o){j(!0);try{let o=await h(e,g?{teamId:g}:void 0);i(m(o))}catch(e){f({title:"Image upload failed",description:e instanceof Error?e.message:"Could not upload image.",status:"error",isClosable:!0})}finally{j(!1)}}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.M,{columns:{base:1,md:2},gap:"2",maxW:"520px",children:[(0,s.jsx)(r.xu,{as:"button","aria-label":"Upload image",bg:"ui.5",border:"1px dashed",borderColor:"ui.20",borderRadius:"md",cursor:o?"not-allowed":"pointer",minH:"112px",opacity:o?.6:1,p:"4",textAlign:"center",transition:"background 0.15s ease, border-color 0.15s ease",type:"button",onClick:()=>{if(!o){var e;null===(e=y.current)||void 0===e||e.click()}},_hover:o?void 0:{bg:"ui.10",borderColor:"ui.40"},children:(0,s.jsxs)(a.g,{spacing:"2",children:[(0,s.jsx)(x.e,{icon:d.cf$,boxSize:"5",color:"ui.80"}),(0,s.jsx)(l.x,{color:"ui.100",textStyle:"label.sm",children:v?"Uploading...":"Upload Image"}),(0,s.jsx)(l.x,{color:"ui.60",textStyle:"paragraph.xs",children:"Choose from your device"})]})}),(0,s.jsx)(r.xu,{as:"button","aria-label":"Select image from library",bg:"ui.5",border:"1px dashed",borderColor:"ui.20",borderRadius:"md",cursor:o?"not-allowed":"pointer",minH:"112px",opacity:o?.6:1,p:"4",textAlign:"center",transition:"background 0.15s ease, border-color 0.15s ease",type:"button",onClick:()=>{o||k(!0)},_hover:o?void 0:{bg:"ui.10",borderColor:"ui.40"},children:(0,s.jsxs)(a.g,{spacing:"2",children:[(0,s.jsx)(x.e,{icon:d.l9f,boxSize:"5",color:"ui.80"}),(0,s.jsx)(l.x,{color:"ui.100",textStyle:"label.sm",children:"Select from Library"}),(0,s.jsx)(l.x,{color:"ui.60",textStyle:"paragraph.xs",children:"Reuse an uploaded asset"})]})})]}),(0,s.jsx)("input",{ref:y,accept:"image/*",className:"hidden",type:"file",onChange:e=>{var o;S(null===(o=e.target.files)||void 0===o?void 0:o[0]),e.target.value=""}}),C&&(0,s.jsx)(r.xu,{alignItems:"center",bg:"rgba(0, 0, 0, 0.88)",backdropFilter:"blur(10px)",display:"flex",inset:"0",justifyContent:"center",p:{base:"0",sm:"4"},position:"fixed",style:{isolation:"isolate",zIndex:2147483600},onClick:()=>k(!1),children:(0,s.jsxs)(r.xu,{borderRadius:{base:"none",sm:"xl"},className:"!bg-background-300",h:{base:"100dvh",sm:"min(90vh, 820px)"},maxW:"1440px",overflow:{base:"hidden",sm:"visible"},position:"relative",style:{isolation:"isolate",zIndex:1},w:{base:"100%",sm:"min(98vw, 1440px)"},onClick:e=>e.stopPropagation(),children:[(0,s.jsx)(r.xu,{as:"button","aria-label":"Close Image Library",alignItems:"center",bg:"ui.10",borderRadius:"md",color:"white",display:"flex",h:"9",justifyContent:"center",position:"absolute",right:{base:"3",sm:"0"},top:{base:"3",sm:"0"},transform:{base:"none",sm:"translate(33%, -33%)"},transition:"background 0.15s ease",type:"button",w:"9",zIndex:"50",onClick:()=>k(!1),_hover:{bg:"ui.20"},children:(0,s.jsx)(p.G,{icon:d.NBC,className:"size-4"})}),(0,s.jsx)(r.xu,{h:"full",overflow:"hidden",borderRadius:{base:"none",sm:"xl"},children:(0,s.jsx)(u.AssetLibraryContent,{closeOnSelect:!0,pickerMode:!0,teamId:g,onSelect:e=>{i((0,u.getAssetStorageFileName)(e)),k(!1)}})})]})})]})}}}]);
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.