import{r as e,j as s}from"./vendor-react-AXa6hZO5.js";import{a8 as i,a9 as t,B as a}from"./cec18ad9a-DiLjrOUd.js";import{i7 as n,i8 as o}from"./index-C_tZnXTW.js";import{u as l,M as r}from"./vendor-intl-BdADXLLt.js";function d({isOpen:d,attachment:c,onConfirm:u,onClose:g}){const f=l(),[m,p]=e.useState("utf-8"),b=e.useMemo(()=>function(e){return[{value:"utf-8",label:e.formatMessage({defaultMessage:"Default (UTF-8)",id:"QJ0ownoZRd"})},{value:"windows-1252",label:e.formatMessage({defaultMessage:"Western European (Windows-1252)",id:"uMZxG9zGvp"})},{value:"windows-1250",label:e.formatMessage({defaultMessage:"Central European (Windows-1250)",id:"Q4V+DsnBh+"})},{value:"windows-1251",label:e.formatMessage({defaultMessage:"Cyrillic (Windows-1251)",id:"q1BWaIlpbN"})},{value:"iso-8859-1",label:e.formatMessage({defaultMessage:"Latin-1 (ISO-8859-1)",id:"oNp1waFarV"})},{value:"shift_jis",label:e.formatMessage({defaultMessage:"Japanese (Shift_JIS)",id:"k4+9F0xUH9"})},{value:"gb18030",label:e.formatMessage({defaultMessage:"Chinese (GB18030)",id:"ILxlzNXiro"})},{value:"euc-kr",label:e.formatMessage({defaultMessage:"Korean (EUC-KR)",id:"qphPEQ/z5U"})},{value:"windows-1256",label:e.formatMessage({defaultMessage:"Arabic (Windows-1256)",id:"X5tUyXfqsl"})},{value:"windows-1254",label:e.formatMessage({defaultMessage:"Turkish (Windows-1254)",id:"2epHWDjRXo"})},{value:"windows-1253",label:e.formatMessage({defaultMessage:"Greek (Windows-1253)",id:"4VcUGIGtNu"})},{value:"tis-620",label:e.formatMessage({defaultMessage:"Thai (TIS-620)",id:"Vuh/a7xjtE"})}]}(f),[f]),M=e.useCallback(()=>{p("utf-8"),g()},[g]),x=e.useMemo(()=>{if(!c?.encodingPending)return"";return new TextDecoder(m,{fatal:!1}).decode(c.encodingPending.buffer).slice(0,500)},[c?.encodingPending,m]),h=e.useCallback(e=>{if(e.preventDefault(),!c?.encodingPending)return;const s=new TextDecoder(m,{fatal:!1}).decode(c.encodingPending.buffer);u(s),p("utf-8")},[c?.encodingPending,m,u]);return s.jsx(i,{isOpen:d,onClose:M,modalSize:"md",hasCloseButton:!0,title:f.formatMessage({defaultMessage:"Select file encoding",id:"Duoty8G6d7"}),children:s.jsxs("form",{onSubmit:h,className:"flex flex-col gap-4 mt-4",children:[s.jsx("p",{className:"text-sm text-text-300",children:s.jsx(r,{defaultMessage:"The text encoding for <b>{fileName}</b> could not be determined. Choose an encoding and verify with the preview.",id:"ysZbg4a2QH",values:{fileName:c?.file_name,b:e=>s.jsx("strong",{children:e})}})}),s.jsx(n,{size:"sm",value:m,onValueChange:e=>p(e),children:b.map(e=>s.jsx(o,{value:e.value,children:e.label},e.value))}),x&&s.jsx("pre",{className:"overflow-auto max-h-64 rounded border border-border-400 bg-bg-000 p-3 text-xs text-text-200 whitespace-pre-wrap",children:x}),s.jsxs(t,{children:[s.jsx(a,{type:"button",variant:"secondary",onClick:M,children:s.jsx(r,{defaultMessage:"Cancel",id:"47FYwba+bI"})}),s.jsx(a,{type:"submit",variant:"primary",children:s.jsx(r,{defaultMessage:"Confirm",id:"N2IrpMDHDB"})})]})]})})}const c=Object.freeze(Object.defineProperty({__proto__:null,EncodingPickerModal:d},Symbol.toStringTag,{value:"Module"}));
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/var u={defaultToken:"",tokenPostfix:".cypher",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:["ALL","AND","AS","ASC","ASCENDING","BY","CALL","CASE","CONTAINS","CREATE","DELETE","DESC","DESCENDING","DETACH","DISTINCT","ELSE","END","ENDS","EXISTS","IN","IS","LIMIT","MANDATORY","MATCH","MERGE","NOT","ON","ON","OPTIONAL","OR","ORDER","REMOVE","RETURN","SET","SKIP","STARTS","THEN","UNION","UNWIND","WHEN","WHERE","WITH","XOR","YIELD"],builtinLiterals:["true","TRUE","false","FALSE","null","NULL"],builtinFunctions:["abs","acos","asin","atan","atan2","avg","ceil","coalesce","collect","cos","cot","count","degrees","e","endNode","exists","exp","floor","head","id","keys","labels","last","left","length","log","log10","lTrim","max","min","nodes","percentileCont","percentileDisc","pi","properties","radians","rand","range","relationships","replace","reverse","right","round","rTrim","sign","sin","size","split","sqrt","startNode","stDev","stDevP","substring","sum","tail","tan","timestamp","toBoolean","toFloat","toInteger","toLower","toString","toUpper","trim","type"],operators:["+","-","*","/","%","^","=","<>","<",">","<=",">=","->","<-","--\x3e","<--"],escapes:/\\(?:[tbnrf\\"'`]|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+/,octaldigits:/[0-7]+/,hexdigits:/[0-9a-fA-F]+/,tokenizer:{root:[[/[{}[\]()]/,"@brackets"],{include:"common"}],common:[{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},[/:[a-zA-Z_][\w]*/,"type.identifier"],[/[a-zA-Z_][\w]*(?=\()/,{cases:{"@builtinFunctions":"predefined.function"}}],[/[a-zA-Z_$][\w$]*/,{cases:{"@keywords":"keyword","@builtinLiterals":"predefined.literal","@default":"identifier"}}],[/`/,"identifier.escape","@identifierBacktick"],[/[;,.:|]/,"delimiter"],[/[<>=%+\-*/^]+/,{cases:{"@operators":"delimiter","@default":""}}]],numbers:[[/-?(@digits)[eE](-?(@digits))?/,"number.float"],[/-?(@digits)?\.(@digits)([eE]-?(@digits))?/,"number.float"],[/-?0x(@hexdigits)/,"number.hex"],[/-?0(@octaldigits)/,"number.octal"],[/-?(@digits)/,"number"]],strings:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@stringDouble"],[/'/,"string","@stringSingle"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/\/\/.*/,"comment"],[/[^/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[/*]/,"comment"]],stringDouble:[[/[^\\"]+/,"string"],[/@escapes/,"string"],[/\\./,"string.invalid"],[/"/,"string","@pop"]],stringSingle:[[/[^\\']+/,"string"],[/@escapes/,"string"],[/\\./,"string.invalid"],[/'/,"string","@pop"]],identifierBacktick:[[/[^\\`]+/,"identifier.escape"],[/@escapes/,"identifier.escape"],[/\\./,"identifier.escape.invalid"],[/`/,"identifier.escape","@pop"]]}};const g=Object.freeze(Object.defineProperty({__proto__:null,conf:{comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}]},language:u},Symbol.toStringTag,{value:"Module"}));export{d as E,c as a,g as c};
